query
stringlengths
7
33.1k
document
stringlengths
7
335k
metadata
dict
negatives
listlengths
3
101
negative_scores
listlengths
3
101
document_score
stringlengths
3
10
document_rank
stringclasses
102 values
end region Methods Initialize
public TaskDetailDto() { super(); id = 0; project = ""; nameTask = ""; status = ""; asign = ""; priority = ""; dueDate = null; originalEstimate = null; decription = ""; startDate = null; endDate = null; createBy = ""; createOn = null; modifyBy = ""; modifyOn = null; modifyById = null; createById = null; asignId = null; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void init() {\n \n }", "public void initialize()\n {\n }", "private void init() {\n\n\n\n }", "@Override\r\n\tprotected void initialize() {\r\n\t\t\r\n\t\t\r\n\t}", "private void initialize() {\n\t\t\n\t}", "@Override\r\n\t\tpublic void init() {\n\t\t\t\r\n\t\t}", "@Override\n public void initialize() {\n \n }", "protected void initialize() {}", "protected void initialize() {}", "public void init() {\r\n\t\t// to override\r\n\t}", "@Override\r\n public void initialize()\r\n {\n }", "@Override public void init()\n\t\t{\n\t\t}", "private void initialize() {\n }", "@Override\r\n\tpublic void init() {}", "public void init() {\r\n\r\n\t}", "public void init() {\n\t\t}", "@Override\n\t\tpublic void init() {\n\t\t}", "@Override\n\tprotected void initialize() {\n\t\t\n\t}", "@Override\n\tprotected void initialize() {\n\t\t\n\t}", "private void init() {\n\n\t}", "public void init() {\n\t\t\n\t}", "@Override\r\n\tpublic void init() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void init() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void init() {\n\t\t\r\n\t}", "@Override\n\tpublic void init()\n\t{\n\n\t}", "protected void initialize()\r\n {\n }", "@Override\n protected void initialize() \n {\n \n }", "@Override\r\n\tpublic void init()\r\n\t{\n\t}", "public void init() {\n\n\t}", "public void init() {\n\n\t}", "public void init() {\n\n\t}", "@Override\n\tpublic void initialize() {\n\t\t\n\t}", "@Override\n protected void init() {\n }", "public void init(){\n \n }", "@Override\n\tprotected void initialize() {\n\n\t}", "public void initialize() {\r\n }", "private void init() {\n }", "private void init() {\n }", "private void init() {\n }", "private void init() {\n }", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n public void initialize() {\n }", "@Override\n public void initialize() {\n }", "@Override\n public void initialize() {\n }", "@Override\r\n\tpublic final void init() {\r\n\r\n\t}", "private void init() {\n }", "private void initialize() {\n\t}", "protected void initialize() {\n\t\t\n\t}", "protected void initialize() {\n\t\t\n\t}", "@Override\n public void init() {}", "protected void initialize() {\n \t\n }", "private void Initialize()\n {\n\n }", "protected void initialize() {\r\n }", "protected void initialize() {\r\n }", "@Override\n public void initialize() {\n\n }", "@Override\n public void initialize() {\n\n }", "@Override\n\tpublic void init() {\n\n\t}", "@Override\n\tpublic void init() {\n\n\t}", "@Override\n\tpublic void init() {\n\n\t}", "@Override\n public void init() {\n }", "@Override\n protected void initialize() {\n }", "@Override\n protected void initialize() {\n }", "@Override\n protected void initialize() {\n }", "@Override\n protected void initialize() {\n }", "@Override\n protected void initialize() {\n }", "@Override\n protected void initialize() {\n }", "public void init() {\n\t\n\t}", "protected void initialize()\n\t{\n\t}", "public void initialize () {\n }", "protected void initialize() {\n\n\t}", "public void initialize() {\n }", "public void initialize() {\n }", "@Override\n public void initialize() {\n }", "@Override\n public void initialize() {\n }", "@Override\n public void initialize() {\n }", "@Override\n public void initialize() {\n }", "@Override\n public void initialize() {\n }", "@Override\n public void initialize() {\n }", "@Override\n public void initialize() {\n }", "@Override\n public void initialize() {\n }", "@Override\n public void initialize() {\n }", "@Override\n public void initialize() {\n }", "@Override\r\n\tprotected void initialize() {\n\r\n\t}", "public void initialize () {\n\n }", "protected void initialize() {\n }", "protected void initialize() {\n }", "protected void initialize() {\n }", "protected void initialize() {\n }", "protected void initialize() {\n }", "protected void initialize() {\n }", "protected void initialize() {\n }", "protected void initialize() {\n }", "protected void initialize() {\n }", "protected void initialize() {\n }", "protected void initialize() {\n }", "protected void initialize() {\n }", "protected void initialize() {\n }" ]
[ "0.81041294", "0.8024551", "0.8002646", "0.79893667", "0.7984924", "0.7978612", "0.7974181", "0.796229", "0.796229", "0.7946243", "0.79351264", "0.7933822", "0.7930514", "0.79297626", "0.7925859", "0.7920046", "0.79196995", "0.79189265", "0.79189265", "0.7917734", "0.79114705", "0.7902238", "0.7902238", "0.7902238", "0.7890381", "0.7884882", "0.78832126", "0.78760284", "0.78731775", "0.78731775", "0.78731775", "0.78669435", "0.78646517", "0.78600377", "0.78598106", "0.78568", "0.78498167", "0.78498167", "0.78498167", "0.78498167", "0.78445923", "0.78445923", "0.78445923", "0.78445923", "0.78445923", "0.78393257", "0.78393257", "0.78393257", "0.7838903", "0.78341717", "0.78306985", "0.78289014", "0.78289014", "0.7828578", "0.7822366", "0.7819212", "0.7810101", "0.7810101", "0.7801212", "0.7801212", "0.78002065", "0.78002065", "0.78002065", "0.77841383", "0.7781455", "0.7781455", "0.7781455", "0.7781455", "0.7781455", "0.7781455", "0.777457", "0.77678806", "0.77634174", "0.7761626", "0.7759627", "0.7756698", "0.7747991", "0.7747991", "0.7747991", "0.7747991", "0.7747991", "0.7747991", "0.7747991", "0.7747991", "0.7747991", "0.7747991", "0.7744616", "0.77411544", "0.7737583", "0.7737583", "0.7737583", "0.7737583", "0.7737583", "0.7737583", "0.7737583", "0.7737583", "0.7737583", "0.7737583", "0.7737583", "0.7737583", "0.7737583" ]
0.0
-1
Zips listed files to given archive file. It creates a new archive. If an archive was already present, it's erased.
public static void zip(BasicShell shell, File archive, List<File> filesToZip) { try { shell.printOut("Creating archive '" + archive.getPath() + "'."); final BufferedOutputStream archiveStream = new BufferedOutputStream(new FileOutputStream(archive)); ZipOutputStream zipStream = new ZipOutputStream(archiveStream); zipStream.setLevel(7); String pwd = shell.pwd().getPath(); for ( File file : filesToZip) { String name = file.getPath(); if (name.equals(pwd)) continue; if ( name.startsWith(pwd) ) { name = name.substring(pwd.length()+1); } ZipEntry entry = new ZipEntry(name); zipStream.putNextEntry(entry); if ( file.isFile() ) { BufferedInputStream fileStream = new BufferedInputStream(new FileInputStream(file)); byte[] buffer = new byte[2048]; int count = fileStream.read(buffer); while ( count > -1 ) { zipStream.write(buffer, 0, count); count = fileStream.read(buffer); } fileStream.close(); } shell.printOut("File '" + entry.getName() + "' added."); } zipStream.close(); } catch (Exception e) { shell.getErrorHandler().handleError(Diagnostic.ERROR, e.getClass().getSimpleName() + ": "+ e.getMessage()); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private void unCompress()\n\t{\n\t\ttry\n\t\t{\n\t\t\tbyte[] buffer = new byte[4096];\n\t\t\tint bytesIn;\n\t\t\tZipFile rfoFile = new ZipFile(path + fileName);\n\t\t\tEnumeration<? extends ZipEntry> allFiles = rfoFile.entries();\n\t\t\twhile(allFiles.hasMoreElements())\n\t\t\t{\n\t\t\t\tZipEntry ze = (ZipEntry)allFiles.nextElement();\n\t\t\t\tInputStream is = rfoFile.getInputStream(ze);\n\t\t\t\tString fName = processSeparators(ze.getName());\n\t\t\t\tFile element = new File(tempDir + fName);\n\t\t\t\torg.reprap.Main.ftd.add(element);\n\t\t\t\tFileOutputStream os = new FileOutputStream(element);\n\t\t\t\twhile((bytesIn = is.read(buffer)) != -1) \n\t\t\t\t\tos.write(buffer, 0, bytesIn);\n\t\t\t\tos.close();\n\t\t\t}\n\t\t} catch (Exception e)\n\t\t{\n\t\t\tDebug.e(\"RFO.unCompress(): \" + e);\n\t\t}\n\t}", "private void compress()\n\t{\n\t\ttry\n\t\t{\n\t\t\tZipOutputStream rfoFile = new ZipOutputStream(new FileOutputStream(path + fileName)); \n\t\t\tFile dirToZip = new File(rfoDir); \n\t\t\tString[] fileList = dirToZip.list(); \n\t\t\tbyte[] buffer = new byte[4096]; \n\t\t\tint bytesIn = 0; \n\n\t\t\tfor(int i=0; i<fileList.length; i++) \n\t\t\t{ \n\t\t\t\tFile f = new File(dirToZip, fileList[i]); \n\t\t\t\tFileInputStream fis = new FileInputStream(f); \n\t\t\t\tString zEntry = f.getPath();\n\t\t\t\t//System.out.println(\"\\n\" + zEntry);\n\t\t\t\tint start = zEntry.indexOf(uniqueName);\n\t\t\t\tzEntry = zEntry.substring(start + uniqueName.length() + 1, zEntry.length());\n\t\t\t\t//System.out.println(tempDir);\n\t\t\t\t//System.out.println(zEntry + \"\\n\");\n\t\t\t\tZipEntry entry = new ZipEntry(zEntry); \n\t\t\t\trfoFile.putNextEntry(entry); \n\t\t\t\twhile((bytesIn = fis.read(buffer)) != -1) \n\t\t\t\t\trfoFile.write(buffer, 0, bytesIn); \n\t\t\t\tfis.close();\n\t\t\t}\n\t\t\trfoFile.close();\n\t\t} catch (Exception e)\n\t\t{\n\t\t\tDebug.e(\"RFO.compress(): \" + e);\n\t\t}\n\t}", "private void compressArchive() throws Exception {\n\t\tif (logger.isDebugEnabled()) {\n\t\t\tlogger.debug(\"Compressing archive: \" + path);\n\t\t}\n\n\t\tFileOutputStream fout = new FileOutputStream(path + \".gz\");\n\t\tGZIPOutputStream gout = new GZIPOutputStream(fout);\n\t\tFileInputStream fin = new FileInputStream(path);\n\t\tbyte[] buf = new byte[blockSize];\n\t\tint len;\n\t\twhile ((len = fin.read(buf)) > 0) {\n\t\t\tgout.write(buf, 0, len);\n\t\t}\n\t\tfin.close();\n\n\t\t// flush and close gzip file\n\t\tgout.finish();\n\t\tgout.close();\n\n\t\t// unlink original archive\n\t\tFile file = new File(path);\n\t\tfile.delete();\n\t}", "public void unarchive(String baseDir) throws MojoExecutionException {\n try (FileInputStream fis = new FileInputStream(archive);\n ZipArchiveInputStream zipIn = new ZipArchiveInputStream(fis)) {\n ZipArchiveEntry zipEnry = zipIn.getNextZipEntry();\n while (zipEnry != null) {\n // Create a file for this tarEntry\n final File destPath = new File(baseDir + File.separator + zipEnry.getName());\n if (zipEnry.isDirectory()) {\n destPath.mkdirs();\n }\n else {\n destPath.createNewFile();\n try (BufferedOutputStream bout = new BufferedOutputStream(new FileOutputStream(destPath))) {\n IOUtils.copy(zipIn, bout);\n }\n }\n zipEnry = zipIn.getNextZipEntry();\n }\n }\n catch (IOException ex) {\n throw new MojoExecutionException(\"Could not extract archive: \" + archive.getAbsolutePath(), ex);\n }\n\n // delete archive after extraction\n archive.delete();\n }", "public void unZip(String apkFile) throws Exception \r\n\t{\r\n\t\tLog.p(tag, apkFile);\r\n\t\tFile file = new File(apkFile);\r\n\t\r\n\t\t/*\r\n\t\t * Create the Base Directory, whose name should be same as Zip file name.\r\n\t\t * All decompressed contents will be placed under this folder.\r\n\t\t */\r\n\t\tString apkFileName = file.getName();\r\n\t\t\r\n\t\tif(apkFileName.indexOf('.') != -1)\r\n\t\t\tapkFileName = apkFileName.substring(0, apkFileName.indexOf('.'));\r\n\t\t\r\n\t\tLog.d(tag, \"Folder name: \"+ apkFileName);\r\n\t\t\r\n\t\tFile extractFolder = new File((file.getParent() == null ? \"\" : file.getParent() + File.separator) + apkFileName);\r\n\t\tif(!extractFolder.exists())\r\n\t\t\textractFolder.mkdir();\r\n\t\t\r\n\t\t/*\r\n\t\t * Read zip entries.\r\n\t\t */\r\n\t\tFileInputStream fin = new FileInputStream(apkFile);\r\n\t\tZipInputStream zin = new ZipInputStream(new BufferedInputStream(fin));\r\n\t\t\r\n\t\t/*\r\n\t\t * Zip InputStream shifts its index to every Zip entry when getNextEntry() is called.\r\n\t\t * If this method returns null, Zip InputStream reaches EOF.\r\n\t\t */\r\n\t\tZipEntry ze = null;\r\n\t\tBufferedOutputStream dest;\r\n\t\t\r\n\t\twhile((ze = zin.getNextEntry()) != null)\r\n\t\t{\r\n\t\t\tLog.d(tag, \"Zip entry: \" + ze.getName() + \" Size: \"+ ze.getSize());\r\n\t\t\t/*\r\n\t\t\t * Create decompressed file for each Zip entry. A Zip entry can be a file or directory.\r\n\t\t\t * ASSUMPTION: APK Zip entry uses Unix style File seperator- \"/\"\r\n\t\t\t * \r\n\t\t\t * 1. Create the prefix Zip Entry folder, if it is not yet available\r\n\t\t\t * 2. Create the individual Zip Entry file.\r\n\t\t\t */\r\n\t\t\tString zeName = ze.getName();\r\n\t\t\tString zeFolder = zeName;\r\n\t\t\t\r\n\t\t\tif(ze.isDirectory())\r\n\t\t\t{\r\n\t\t\t\tzeName = null; // Don't create Zip Entry file\r\n\t\t\t}\r\n\t\t\telse{\r\n\t\t\t\tif(zeName.indexOf(\"/\") == -1) // Zip entry uses \"/\"\r\n\t\t\t\t\tzeFolder = null; // It is File. don't create Zip entry Folder\r\n\t\t\t\telse {\r\n\t\t\t\t\tzeFolder = zeName.substring(0, zeName.lastIndexOf(\"/\"));\r\n\t\t\t\t\tzeName = zeName.substring( zeName.lastIndexOf(\"/\") + 1);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tLog.d(tag, \"zeFolder: \"+ zeFolder +\" zeName: \"+ zeName);\r\n\t\t\t\r\n\t\t\t// Create Zip Entry Folder\r\n\t\t\tFile zeFile = extractFolder;\r\n\t\t\tif(zeFolder != null)\r\n\t\t\t{\r\n\t\t\t\tzeFile = new File(extractFolder.getPath() + File.separator + zeFolder);\r\n\t\t\t\tif(!zeFile.exists())\r\n\t\t\t\t\tzeFile.mkdirs();\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t// Create Zip Entry File\r\n\t\t\tif(zeName == null)\r\n\t\t\t\tcontinue;\r\n\t\t\t\r\n\t\t\t// Keep track of XML files, they are in Android Binary XML format\r\n\t\t\tif(zeName.endsWith(\".xml\"))\r\n\t\t\t\txmlFiles.add(zeFile.getPath() + File.separator + zeName);\r\n\t\t\t\r\n\t\t\t// Keep track of the Dex/ODex file. Need to convert to Jar\r\n\t\t\tif(zeName.endsWith(\".dex\") || zeName.endsWith(\".odex\"))\r\n\t\t\t\tdexFile = zeFile.getPath() + File.separator + zeName;\r\n\t\t\t\r\n\t\t\t// Keep track of Resources.arsc file- resources.arsc\r\n\t\t\tif(zeName.endsWith(\".arsc\"))\r\n\t\t\t\tresFile = zeFile.getPath() + File.separator + zeName;\r\n\t\t\t\r\n\t\t\t// Write Zip entry File to the disk\r\n\t\t\tint count;\r\n\t\t\tbyte data[] = new byte[BUFFER];\r\n\t\t\t\r\n\t\t\tFileOutputStream fos = new FileOutputStream(zeFile.getPath() + File.separator + zeName);\r\n\t\t\tdest = new BufferedOutputStream(fos, BUFFER);\r\n\r\n\t\t\twhile ((count = zin.read(data, 0, BUFFER)) != -1) \r\n\t\t\t{\r\n\t\t\t\tdest.write(data, 0, count);\r\n\t\t\t}\r\n\t\t\tdest.flush();\r\n\t\t\tdest.close();\r\n\t\t}\r\n\r\n\t\t// Close Zip InputStream\r\n\t\tzin.close();\r\n\t\tfin.close();\r\n\t}", "public static void zipFiles(List<String> srcFiles, String directoryPath) throws FileNotFoundException, IOException {\n DateTimeFormatter dtf = DateTimeFormatter.ofPattern(\"dd-MM-yyyy-HHmmss\");\r\n LocalDateTime now = LocalDateTime.now();\r\n String d = dtf.format(now);\r\n FileOutputStream fos = new FileOutputStream(directoryPath + \"\\\\\" + \"backupRexs\" + d + \".zip\");\r\n ZipOutputStream zipOut = new ZipOutputStream(fos);\r\n for (String srcFile : srcFiles) {\r\n File fileToZip = new File(srcFile);\r\n FileInputStream fis = new FileInputStream(fileToZip);\r\n ZipEntry zipEntry = new ZipEntry(fileToZip.getName());\r\n zipOut.putNextEntry(zipEntry);\r\n\r\n byte[] bytes = new byte[1024];\r\n int length;\r\n while ((length = fis.read(bytes)) >= 0) {\r\n zipOut.write(bytes, 0, length);\r\n }\r\n fis.close();\r\n fileToZip.delete();\r\n }\r\n zipOut.close();\r\n fos.close();\r\n }", "private void addFilesToZip(List<File> files,String outputPath) throws IOException \r\n\t{\r\n\t\t// create a zip output stream\r\n\t\tString zipFileName = outputPath + File.separator + Constants.name + zipIndex + Constants.zipExtension;\r\n\t\tOutputStreamWithLength chunkedFile = new OutputStreamWithLength(zipFileName);\r\n\t\tzipOutputStream = new ZipOutputStream(chunkedFile);\r\n\t\tdouble totalBytesRead = 0L;\r\n\t\tint count = 10; \r\n\t\tfor(File file:files)\r\n\t\t{\r\n\t\t\t// reset the file index\r\n\t\t\tfileIndex = 0;\r\n\t\t\tString zipEntryPath = file.getAbsolutePath().substring(basePath.length() + 0);\r\n\t\t\t\r\n\t\t\tif(file.isDirectory())\r\n\t\t\t{\r\n\t\t\t\tZipEntry entry =new ZipEntry(zipEntryPath+\"/\");\r\n\t\t\t\tzipOutputStream.putNextEntry(entry);\r\n\t\t\t\tzipOutputStream.closeEntry();\r\n\t\t\t\tcontinue;\r\n\t\t\t}\t\t\t\r\n\t\t\telse\r\n\t\t\t{\r\n\t\t\t\tzipEntryPath = zipEntryPath + Constants.fragmentLabel + fileIndex++;\r\n\t\t\t}\t\t\t\r\n\r\n\t\t\t// add the current file to the zip\r\n\t\t\tZipEntry entry =new ZipEntry(zipEntryPath);\r\n\t\t\tzipOutputStream.putNextEntry(entry);\r\n\r\n\t\t\tbyte[] buffer = new byte[1024]; \t \r\n\r\n\t\t\tFileInputStream inputFileStream = new FileInputStream(file);\r\n\t\t\tint len; \r\n\t\t\twhile ((len = inputFileStream.read(buffer)) > 0) \r\n\t\t\t{ \r\n\t\t\t\tif((chunkedFile.getCurrentWriteLength() + len ) > maxSplitSize){\r\n\t\t\t\t\t// close current zip output stream\r\n\t\t\t\t\tzipOutputStream.closeEntry();\r\n\t\t\t\t\tzipOutputStream.finish();\r\n\t\t\t\t\t\r\n\t\t\t\t\t// reset the write length\r\n\t\t\t\t\tchunkedFile.setCurrentWriteLength(0);\r\n\t\t\t\t\t\r\n\t\t\t\t\t// create new zip output stream\r\n\t\t\t\t\tzipIndex += 1;\r\n\t\t\t\t\tzipFileName = outputPath+ File.separator + Constants.name + zipIndex + Constants.zipExtension;\r\n\t\t\t\t\tchunkedFile = new OutputStreamWithLength(zipFileName);\r\n\t\t\t\t\tzipOutputStream = new ZipOutputStream(chunkedFile);\r\n\r\n\t\t\t\t\t// add the current file to write remaining bytes\r\n\t\t\t\t\tzipEntryPath = file.getAbsolutePath().substring(basePath.length() + 0);\r\n\t\t\t\t\tzipEntryPath = zipEntryPath + Constants.fragmentLabel + fileIndex++;\r\n\t\t\t\t\tentry = new ZipEntry(zipEntryPath);\r\n\t\t\t\t\tzipOutputStream.putNextEntry(entry);\r\n\r\n\t\t\t\t\t// write the bytes to the zip output stream\r\n\t\t\t\t\tzipOutputStream.write(buffer, 0, len);\r\n\t\t\t\t}\r\n\t\t\t\telse\r\n\t\t\t\t{\r\n\t\t\t\t\t// write the bytes to the zip output stream\r\n\t\t\t\t\tzipOutputStream.write(buffer, 0, len);\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\t//Show progress\r\n\t\t\t\ttotalBytesRead += len;\r\n\t\t\t\tdouble progress = totalBytesRead / totalBytes;\r\n\t\t\t\tif (progress*100 > 10)\r\n\t\t\t\t{\r\n\t\t\t\t\ttotalBytesRead = 0L;\r\n\t\t\t\t\tcount += 10;\r\n\t\t\t\t\tSystem.out.println(\"Finished \" + count +\"%\");\r\n\t\t\t\t}\r\n\t\t\t}\t\t\t\t\t\t\r\n\t\t\tinputFileStream.close();\r\n\t\t}\r\n\r\n\t\tzipOutputStream.closeEntry();\r\n\t\tzipOutputStream.finish();\r\n\t}", "public static void createArchiveFile( final Configuration conf, final Path zipFile, final List<Path> files, int pathTrimCount, boolean isJar, Manifest jarManifest) throws IOException\r\n\t{\r\n\t\t\r\n\t\tFSDataOutputStream out = null;\r\n\t\tZipOutputStream zipOut = null;\r\n\t\t/** Did we actually write an entry to the zip file */\r\n\t\tboolean wroteOne = false;\r\n\t\t\r\n\t\ttry {\r\n\t\t\tout = zipFile.getFileSystem(conf).create(zipFile);\r\n\t\t\tif (files.isEmpty()) {\r\n\t\t\t\treturn;\t/** Don't try to create a zip file with no entries it will throw. just return empty file. */\r\n\t\t\t}\r\n\t\t\tif (isJar) {\r\n\t\t\t\tif (jarManifest!=null) {\r\n\t\t\t\t\tzipOut = new JarOutputStream(out,jarManifest);\r\n\t\t\t\t} else {\r\n\t\t\t\t\tzipOut = new JarOutputStream(out);\r\n\t\t\t\t}\r\n\t\t\t} else {\r\n\t\t\t\tzipOut = new ZipOutputStream(out);\r\n\t\t\t}\r\n\t\t\tfor ( Path file : files) {\r\n\t\t\t\tFSDataInputStream in = null;\r\n\t\t\t\t/** Try to complete the file even if a file fails. */\r\n\t\t\t\ttry {\r\n\t\t\t\t\tFileSystem fileSystem = file.getFileSystem(conf);\r\n\t\t\t\t\tin = fileSystem.open(file);\r\n\t\t\t\t\tZipEntry zipEntry = new ZipEntry(pathTrim(file, pathTrimCount));\r\n\t\t\t\t\tzipOut.putNextEntry(zipEntry);\r\n\t\t\t\t\tIOUtils.copyBytes(in, zipOut, (int) Math.min(32768, fileSystem.getFileStatus(file).getLen()), false);\r\n\t\t\t\t\twroteOne = true;\r\n\t\t\t\t} catch( IOException e) {\r\n\t\t\t\t\tLOG.error( \"Unable to store \" + file + \" in zip file \" + zipFile + \", skipping\", e);\r\n\t\t\t\t\tcontinue;\r\n\t\t\t\t} finally {\r\n\t\t\t\t\tif (in!=null) {\r\n\t\t\t\t\t\ttry { in.close(); } catch( IOException ignore ) {}\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t} finally { /** Ensure everything is always closed before the function exits */\r\n\t\t\t\r\n\t\t\tif (zipOut!=null&&wroteOne) {\r\n\t\t\t\tzipOut.closeEntry();\r\n\t\t\t\tzipOut.flush();\r\n\t\t\t\tzipOut.close();\r\n\t\t\t\tout = null;\r\n\t\t\t}\r\n\t\t\tif (out!=null) {\r\n\t\t\t\tout.close();\r\n\t\t\t}\r\n\t\t}\r\n\t}", "public static synchronized void removeArchiveFiles() {\n System.out.println(Thread.currentThread().getName() + \"********************************************************* TestHelper.removeArchiveFiles\");\n String firstDestinationDirName = System.getProperty(USER_DIR)\n + File.separator\n + QVCSConstants.QVCS_PROJECTS_DIRECTORY\n + File.separator\n + getTestProjectName();\n File firstDestinationDirectory = new File(firstDestinationDirName);\n\n String secondDestinationDirName = firstDestinationDirName + File.separator + \"subProjectDirectory\";\n File secondDestinationDirectory = new File(secondDestinationDirName);\n\n String thirdDestinationDirName = secondDestinationDirName + File.separator + \"subProjectDirectory2\";\n File thirdDestinationDirectory = new File(thirdDestinationDirName);\n\n String fourthDestinationDirName = firstDestinationDirName + File.separator + QVCSConstants.QVCS_CEMETERY_DIRECTORY;\n File fourthDestinationDirectory = new File(fourthDestinationDirName);\n\n String fifthDestinationDirName = firstDestinationDirName + File.separator + QVCSConstants.QVCS_DIRECTORY_METADATA_DIRECTORY;\n File fifthDestinationDirectory = new File(fifthDestinationDirName);\n\n String sixthDestinationDirName = firstDestinationDirName + File.separator + QVCSConstants.QVCS_BRANCH_ARCHIVES_DIRECTORY;\n File sixthDestinationDirectory = new File(sixthDestinationDirName);\n\n deleteDirectory(sixthDestinationDirectory);\n deleteDirectory(fifthDestinationDirectory);\n deleteDirectory(fourthDestinationDirectory);\n deleteDirectory(thirdDestinationDirectory);\n deleteDirectory(secondDestinationDirectory);\n deleteDirectory(firstDestinationDirectory);\n }", "public static void zip(File destFile, File[] files) throws IOException {\n BufferedInputStream origin = null;\n FileOutputStream dest = new FileOutputStream(destFile);\n ZipOutputStream out = new ZipOutputStream(new BufferedOutputStream(dest));\n out.setMethod(ZipOutputStream.DEFLATED);\n byte[] data = new byte[BUFFER_SIZE];\n for (int i = 0; i < files.length; i++) {\n if (log.isDebugEnabled()) {\n log.debug(\"Adding: \" + files[i].getName());\n }\n if (files[i].isDirectory()) {\n if (log.isDebugEnabled()) {\n log.debug(\"Skipping directory: \" + files[i]);\n }\n continue;\n }\n FileInputStream fi = new FileInputStream(files[i]);\n origin = new BufferedInputStream(fi, BUFFER_SIZE);\n ZipEntry entry = new ZipEntry(files[i].getName());\n out.putNextEntry(entry);\n int count;\n while ((count = origin.read(data, 0, BUFFER_SIZE)) != -1) {\n out.write(data, 0, count);\n }\n origin.close();\n }\n out.flush();\n out.close();\n }", "private static void recurseFiles(File file)\r\n throws IOException, FileNotFoundException\r\n {\r\n if (file.isDirectory()) {\r\n //Create an array with all of the files and subdirectories \r\n //of the current directory.\r\nString[] fileNames = file.list();\r\n if (fileNames != null) {\r\n //Recursively add each array entry to make sure that we get\r\n //subdirectories as well as normal files in the directory.\r\n for (int i=0; i<fileNames.length; i++){ \r\n \trecurseFiles(new File(file, fileNames[i]));\r\n }\r\n }\r\n }\r\n //Otherwise, a file so add it as an entry to the Zip file. \r\nelse {\r\n byte[] buf = new byte[1024];\r\n int len;\r\n //Create a new Zip entry with the file's name. \r\n\r\n\r\nZipEntry zipEntry = new ZipEntry(file.toString());\r\n //Create a buffered input stream out of the file \r\n\r\n\r\n//we're trying to add into the Zip archive. \r\n\r\n\r\nFileInputStream fin = new FileInputStream(file);\r\n BufferedInputStream in = new BufferedInputStream(fin);\r\n zos.putNextEntry(zipEntry);\r\n //Read bytes from the file and write into the Zip archive. \r\n\r\n\r\nwhile ((len = in.read(buf)) >= 0) {\r\n zos.write(buf, 0, len);\r\n }\r\n //Close the input stream. \r\n\r\n\r\n in.close();\r\n //Close this entry in the Zip stream. \r\n\r\n\r\n zos.closeEntry();\r\n }\r\n }", "public static void unzipArchive(File archive, String outputDir) throws IOException {\n\t\tZipFile zipfile = new ZipFile(archive);\n\t\tfor (Enumeration<?> e = zipfile.entries(); e.hasMoreElements();) {\n\t\t\tZipEntry entry = (ZipEntry) e.nextElement();\n\t\t\tunzipEntry(zipfile, entry, outputDir);\n\t\t}\n\t}", "public void zipFiles() {\r\n byte[] buffer = new byte[1024];\r\n try {\r\n\r\n // On rare occasions, there will be a semi colon in the title name,\r\n // ruining everything while zipping the file.\r\n if (title.contains(\":\") || title.contains(\".\")) {\r\n String temp = \"\";\r\n for (int i = 0; i < title.length(); i++) {\r\n \r\n if (title.charAt(i) == ':' || title.charAt(i) == '.') {\r\n \r\n } else {\r\n temp += title.charAt(i);\r\n }\r\n }\r\n title = temp;\r\n }\r\n System.out.println(\"File name: \" + title);\r\n \r\n FileOutputStream fos = new FileOutputStream(savePath + \"\\\\\" + title + \".zip\");\r\n ZipOutputStream zos = new ZipOutputStream(fos);\r\n \r\n for (String fileName : fileNames) {\r\n \r\n System.out.println(\"zipping file: \" + fileName);\r\n \r\n fileName = savePath + \"\\\\\" + fileName;\r\n File srcFile = new File(fileName);\r\n FileInputStream fis;\r\n if (srcFile.exists()) {\r\n fis = new FileInputStream(srcFile);\r\n \r\n zos.putNextEntry(new ZipEntry(srcFile.getName()));\r\n int length;\r\n while ((length = fis.read(buffer)) > 0) {\r\n zos.write(buffer, 0, length);\r\n }\r\n zos.closeEntry();\r\n fis.close();\r\n \r\n boolean success = (new File(fileName)).delete();\r\n }\r\n }\r\n zos.close();\r\n \r\n } catch (FileNotFoundException ex) {\r\n System.out.println(\"File not found!\");\r\n } catch (IOException ex) {\r\n }\r\n }", "void makeZip(String zipFilePath, String srcFilePaths[], ZipMainFrame f) {\n ...\n for (int i = 0; i < srcFilePaths.length; i++) {\n f.setStatusBarText(\"Zipping \"+srcFilePaths[i]);\n //add the file srcFilePaths[i] into the zip file.\n ...\n }\n }", "public CombineArchive (File zipFile)\n\t\tthrows IOException,\n\t\t\tJDOMException,\n\t\t\tParseException,\n\t\t\tCombineArchiveException\n\t{\n\t\tinit (zipFile, false);\n\t}", "public static void makeZip(String fileName)\r\n throws IOException, FileNotFoundException\r\n {\r\n File file = new File(fileName);\r\n zos = new ZipOutputStream(new FileOutputStream(file + \".zip\"));\r\n //Call recursion.\r\n\r\n\r\nrecurseFiles(file);\r\n //We are done adding entries to the zip archive,\r\n\r\n\r\n//so close the Zip output stream.\r\n\r\n\r\nzos.close();\r\n }", "protected void zipFile(File file, ZipOutputStream zOut, String vPath)\n throws IOException\n {\n if (!vPath.equalsIgnoreCase(\"WEB-INF/web.xml\")) {\n super.zipFile(file, zOut, vPath);\n } else {\n log(\"Warning: selected \"+archiveType+\" files include a WEB-INF/web.xml which will be ignored \" +\n \"(please use webxml attribute to \"+archiveType+\" task)\", Project.MSG_WARN);\n }\n }", "private static String createZipFile(String directory, String zipFilename, List<File> filesToAdd)\n throws IOException {\n String zipFilePath = String.format(\"%s/%s\", directory, zipFilename);\n File zipFile = new File(zipFilePath);\n if (zipFile.exists()) {\n if (zipFile.delete()) {\n log.info(\"Zipfile existed and was deleted: \" + zipFilePath);\n } else {\n log.warn(\"Zipfile exists but was not deleted: \" + zipFilePath);\n }\n }\n\n // Create and add files to zip file\n addFilesToZip(zipFile, filesToAdd);\n\n return zipFilePath;\n }", "public boolean ZipFile(String sSourceFilePath, String sDestinationZipFilePath, boolean bReplaceExisting) {\n byte[] buffer = new byte[30720];\n FileInputStream fin = null;\n FileOutputStream fout = null;\n ZipOutputStream zout = null;\n int length;\n String sZipEntryFileName = \"\";\n File objFile = null;\n try {\n //check for source file\n if (sSourceFilePath.trim().equalsIgnoreCase(\"\")) {\n throw new Exception(\"Invalid Source File : \" + sSourceFilePath);\n }\n objFile = new File(sSourceFilePath);\n if (!objFile.exists()) {\n throw new Exception(\"Source file not found : \" + sSourceFilePath);\n }\n\n //check for destination Zip file\n if (sDestinationZipFilePath.trim().equalsIgnoreCase(\"\") || sDestinationZipFilePath == null) {\n String stmp_Path = objFile.getAbsolutePath();\n String stmp_Name = objFile.getName();\n if (stmp_Name.contains(\".\")) { //check for removing extension\n int indx = 0;\n try {\n indx = stmp_Name.indexOf(\".\", stmp_Name.length() - 5);\n } catch (Exception e) {\n indx = 0;\n }\n if (indx <= 0) {\n indx = stmp_Name.length();\n }\n\n stmp_Name = stmp_Name.substring(0, indx);\n stmp_Name = stmp_Name + \".zip\";\n }\n sDestinationZipFilePath = stmp_Path + File.separator + stmp_Name;\n }\n\n objFile = new File(sDestinationZipFilePath);\n if (objFile.exists()) {\n if (bReplaceExisting) {\n objFile.delete();\n } else {\n throw new Exception(\"Destination ZipFile Already exists : \" + sDestinationZipFilePath);\n }\n }\n\n //Zipping File\n sZipEntryFileName = sSourceFilePath.substring(sSourceFilePath.lastIndexOf(\"\\\\\") + 1);\n fout = new FileOutputStream(sDestinationZipFilePath);\n zout = new ZipOutputStream(fout);\n fin = new FileInputStream(sSourceFilePath);\n zout.putNextEntry(new ZipEntry(sZipEntryFileName));\n while ((length = fin.read(buffer)) > 0) {\n zout.write(buffer, 0, length);\n }\n\n return true;\n\n } catch (Exception exp) {\n println(\"Src = \" + sSourceFilePath + \" : Dest = \" + sDestinationZipFilePath + \" : \" + exp.toString());\n return false;\n } finally {\n try {\n fin.close();\n } catch (Exception exp) {\n }\n try {\n zout.closeEntry();\n } catch (Exception exp) {\n }\n try {\n zout.close();\n } catch (Exception exp) {\n }\n }\n }", "private String writeZipFile(File directoryToZip, List<File> fileList, String zipName) throws IOException{\r\n // If the zip name is null then provide the name of the directory\r\n if(zipName == null){\r\n zipName = directoryToZip.getName();\r\n }\r\n // Store the file name\r\n String fileName = zipName;\r\n // Create the zip file\r\n FileOutputStream fos = new FileOutputStream(fileName);\r\n ZipOutputStream zos = new ZipOutputStream(fos);\r\n for (File file : fileList) {\r\n if (!file.isDirectory()) { // we only zip files, not directories\r\n // Add files that are not in the skip list\r\n if(!isFileToSkip(file.getName())) {\r\n addToZip(directoryToZip, file, zos);\r\n }\r\n }\r\n }\r\n zos.close();\r\n fos.close();\r\n // Return the full name of the file\r\n return fileName;\r\n }", "void makeZip(String zipFilePath, String srcFilePaths[],\n\t\t\tMessageDisplay msgDisplay) {\n\t\t...\n\t\tfor (int i = 0; i < srcFilePaths.length; i++) {\n\t\t\tmsgDisplay.showMessage(\"Zipping \"+srcFilePaths[i]);\n\t\t\t//add the file srcFilePaths[i] into the zip file.\n\t\t\t...\n\t\t}\n\t}", "private void moveFilesToArchiveFolder(Object[] listOfArchiveFiles, String securedFolderPath,\n String archiveFolderPath) {\n\n logger.info(\"Moving older files to archive folder in FolderMonitor\");\n\n int archivedFilesCount = 0;\n\n try {\n for (int i = 0; i < listOfArchiveFiles.length; i++) {\n File sharedFolderFile = new File(listOfArchiveFiles[i].toString());\n File source = new File(securedFolderPath + \"\\\\\" + sharedFolderFile.getName());\n File destination = new File(archiveFolderPath + \"\\\\\" + sharedFolderFile.getName());\n Files.move(source.toPath(), destination.toPath(), StandardCopyOption.ATOMIC_MOVE);\n\n archivedFilesCount += 1;\n logger.info(\"No of files archived: \" + archivedFilesCount);\n }\n logger.info(\"Total count of archived files : \" + archivedFilesCount);\n } catch (IOException e) {\n logger.error(\"IOException() in FolderMonitor\");\n } catch (Exception e) {\n logger.error(\"Exception() in FolderMonitor\");\n }\n }", "public static void PackageArchive(File directoryName, File fileName) throws IOException\r\n {\r\n final String ARCHIVE_XML = \"<?xml version=\\\"1.0\\\" encoding=\\\"utf-16\\\"?>\\n<archive major_version=\\\"0\\\" minor_version=\\\"1\\\" />\";\r\n\r\n TarArchiveWriter archive = new TarArchiveWriter(new GZIPOutputStream(new FileOutputStream(fileName)));\r\n\r\n // Create the archive.xml file\r\n archive.writeFile(\"archive.xml\", ARCHIVE_XML);\r\n\r\n // Add the assets\r\n File dir = new File(directoryName, ArchiveConstants.ASSETS_PATH);\r\n String[] files = dir.list();\r\n for (String file : files)\r\n archive.writeFile(ArchiveConstants.ASSETS_PATH + FilenameUtils.getName(file), FileUtils.readFileToByteArray(new File(dir, file)));\r\n\r\n // Add the objects\r\n dir = new File(directoryName, ArchiveConstants.OBJECTS_PATH);\r\n files = dir.list();\r\n for (String file : files)\r\n archive.writeFile(ArchiveConstants.OBJECTS_PATH + FilenameUtils.getName(file), FileUtils.readFileToByteArray(new File(dir, file)));\r\n\r\n // Add the terrain(s)\r\n dir = new File(directoryName, ArchiveConstants.TERRAINS_PATH);\r\n files = dir.list();\r\n for (String file : files)\r\n archive.writeFile(ArchiveConstants.TERRAINS_PATH + FilenameUtils.getName(file), FileUtils.readFileToByteArray(new File(dir, file)));\r\n\r\n // Add the parcels(s)\r\n dir = new File(directoryName, ArchiveConstants.LANDDATA_PATH);\r\n files = dir.list();\r\n for (String file : files)\r\n archive.writeFile(ArchiveConstants.LANDDATA_PATH + FilenameUtils.getName(file), FileUtils.readFileToByteArray(new File(dir, file)));\r\n\r\n // Add the setting(s)\r\n dir = new File(directoryName, ArchiveConstants.SETTINGS_PATH);\r\n files = dir.list();\r\n for (String file : files)\r\n archive.writeFile(ArchiveConstants.SETTINGS_PATH + FilenameUtils.getName(file), FileUtils.readFileToByteArray(new File(dir, file)));\r\n\r\n archive.close();\r\n }", "boolean isArchiveSuppress();", "public void unzip(File f) throws Exception {\r\n String destDir = workplace + \"/temp/\";\r\n File tmp = new File(destDir);\r\n if(!tmp.exists())tmp.mkdir();\r\n byte b[] = new byte [1024];\r\n int length;\r\n \r\n ZipFile zipFile;\r\n zipFile = new ZipFile(f);\r\n Enumeration enumeration = zipFile.entries();\r\n ZipEntry zipEntry = null ;\r\n OutputStream outputStream = null;\r\n InputStream inputStream = null;\r\n while (enumeration.hasMoreElements()) {\r\n zipEntry = (ZipEntry) enumeration.nextElement();\r\n File loadFile = new File(destDir + zipEntry.getName());\r\n if (zipEntry.isDirectory()) {\r\n // 这段都可以不要,因为每次都貌似从最底层开始遍历的\r\n loadFile.mkdirs();\r\n }else{\r\n if (!loadFile.getParentFile().exists())\r\n loadFile.getParentFile().mkdirs();\r\n outputStream = new FileOutputStream(loadFile);\r\n inputStream = zipFile.getInputStream(zipEntry);\r\n while ((length = inputStream.read(b)) > 0)\r\n outputStream.write(b, 0, length);\r\n }\r\n }\r\n outputStream.flush();\r\n outputStream.close();\r\n inputStream.close();\r\n }", "public void clean()\r\n {\r\n // DO NOT TOUCH\r\n // System.out.println(unzipedFilePath);\r\n\r\n // only clean if there was a successful unzipping\r\n if (success)\r\n {\r\n // only clean if the file path to remove matches the zipped file.\r\n if (unzippedFilePath.equals(zippedFilePath.substring(0,\r\n zippedFilePath.length() - 4)))\r\n {\r\n // System.out.println(\"to be implmented\");\r\n for (File c : outputDir.listFiles())\r\n {\r\n // System.out.println(c.toString());\r\n if (!c.delete())\r\n {\r\n System.out.println(\"failed to delete\" + c.toString());\r\n }\r\n }\r\n outputDir.delete();\r\n outputDir = null;\r\n }\r\n }\r\n }", "private static void zipFolder(ZipOutputStream out, File folder) throws IOException {\n\n final int BUFFER = 2048;\n\n File[] fileList = folder.listFiles();\n BufferedInputStream origin;\n\n for (File file : fileList) {\n if (file.isDirectory()) {\n zipFolder(out, file);\n } else {\n byte data[] = new byte[BUFFER];\n\n String unmodifiedFilePath = file.getPath();\n FileInputStream fi = new FileInputStream(unmodifiedFilePath);\n\n origin = new BufferedInputStream(fi, BUFFER);\n ZipEntry entry = new ZipEntry(file.getName());\n\n out.putNextEntry(entry);\n\n int count;\n while ((count = origin.read(data, 0, BUFFER)) != -1) {\n out.write(data, 0, count);\n }\n\n out.closeEntry();\n origin.close();\n }\n }\n\n // Finish the zip stream and close it\n out.finish();\n out.close();\n }", "public static boolean UnzipFile(ZipFile zf, String filepathinzip, File fileinfiledir) {\r\n BufferedOutputStream Output_fos = null;\r\n BufferedInputStream bufbr = null;\r\n try {\r\n ZipEntry ze = zf.getEntry(filepathinzip);\r\n if (ze != null) {\r\n BufferedOutputStream Output_fos2 = new BufferedOutputStream(new FileOutputStream(fileinfiledir));\r\n try {\r\n byte[] buf = new byte[65536];\r\n BufferedInputStream bufbr2 = new BufferedInputStream(zf.getInputStream(ze));\r\n while (true) {\r\n try {\r\n int readlen = bufbr2.read(buf);\r\n if (readlen < 0) {\r\n break;\r\n }\r\n Output_fos2.write(buf, 0, readlen);\r\n } catch (Exception e) {\r\n e = e;\r\n bufbr = bufbr2;\r\n Output_fos = Output_fos2;\r\n } catch (Throwable th) {\r\n th = th;\r\n bufbr = bufbr2;\r\n Output_fos = Output_fos2;\r\n if (Output_fos != null) {\r\n try {\r\n Output_fos.close();\r\n if (bufbr != null) {\r\n try {\r\n bufbr.close();\r\n } catch (IOException e2) {\r\n e2.printStackTrace();\r\n return false;\r\n }\r\n }\r\n } catch (IOException e3) {\r\n e3.printStackTrace();\r\n if (bufbr == null) {\r\n return false;\r\n }\r\n try {\r\n bufbr.close();\r\n return false;\r\n } catch (IOException e4) {\r\n e4.printStackTrace();\r\n return false;\r\n }\r\n } finally {\r\n if (bufbr != null) {\r\n try {\r\n bufbr.close();\r\n } catch (IOException e5) {\r\n e5.printStackTrace();\r\n return false;\r\n }\r\n }\r\n }\r\n }\r\n throw th;\r\n }\r\n }\r\n if (Output_fos2 != null) {\r\n try {\r\n Output_fos2.close();\r\n if (bufbr2 != null) {\r\n try {\r\n bufbr2.close();\r\n } catch (IOException e6) {\r\n e6.printStackTrace();\r\n BufferedInputStream bufferedInputStream = bufbr2;\r\n BufferedOutputStream bufferedOutputStream = Output_fos2;\r\n return false;\r\n }\r\n }\r\n } catch (IOException e7) {\r\n e7.printStackTrace();\r\n if (bufbr2 != null) {\r\n try {\r\n bufbr2.close();\r\n } catch (IOException e8) {\r\n e8.printStackTrace();\r\n BufferedInputStream bufferedInputStream2 = bufbr2;\r\n BufferedOutputStream bufferedOutputStream2 = Output_fos2;\r\n return false;\r\n }\r\n }\r\n BufferedInputStream bufferedInputStream3 = bufbr2;\r\n BufferedOutputStream bufferedOutputStream3 = Output_fos2;\r\n return false;\r\n } finally {\r\n if (bufbr2 != null) {\r\n try {\r\n bufbr2.close();\r\n } catch (IOException e9) {\r\n e9.printStackTrace();\r\n BufferedInputStream bufferedInputStream4 = bufbr2;\r\n BufferedOutputStream bufferedOutputStream4 = Output_fos2;\r\n return false;\r\n }\r\n }\r\n }\r\n }\r\n BufferedInputStream bufferedInputStream5 = bufbr2;\r\n BufferedOutputStream bufferedOutputStream5 = Output_fos2;\r\n return true;\r\n } catch (Exception e10) {\r\n e = e10;\r\n Output_fos = Output_fos2;\r\n try {\r\n e.printStackTrace();\r\n if (Output_fos == null) {\r\n return false;\r\n }\r\n try {\r\n Output_fos.close();\r\n if (bufbr == null) {\r\n return false;\r\n }\r\n try {\r\n bufbr.close();\r\n return false;\r\n } catch (IOException e11) {\r\n e11.printStackTrace();\r\n return false;\r\n }\r\n } catch (IOException e12) {\r\n e12.printStackTrace();\r\n if (bufbr == null) {\r\n return false;\r\n }\r\n try {\r\n bufbr.close();\r\n return false;\r\n } catch (IOException e13) {\r\n e13.printStackTrace();\r\n return false;\r\n }\r\n } finally {\r\n if (bufbr != null) {\r\n try {\r\n bufbr.close();\r\n } catch (IOException e14) {\r\n e14.printStackTrace();\r\n return false;\r\n }\r\n }\r\n }\r\n } catch (Throwable th2) {\r\n th = th2;\r\n if (Output_fos != null) {\r\n }\r\n throw th;\r\n }\r\n } catch (Throwable th3) {\r\n th = th3;\r\n Output_fos = Output_fos2;\r\n if (Output_fos != null) {\r\n }\r\n throw th;\r\n }\r\n } else if (Output_fos == null) {\r\n return false;\r\n } else {\r\n try {\r\n Output_fos.close();\r\n if (bufbr == null) {\r\n return false;\r\n }\r\n try {\r\n bufbr.close();\r\n return false;\r\n } catch (IOException e15) {\r\n e15.printStackTrace();\r\n return false;\r\n }\r\n } catch (IOException e16) {\r\n e16.printStackTrace();\r\n if (bufbr == null) {\r\n return false;\r\n }\r\n try {\r\n bufbr.close();\r\n return false;\r\n } catch (IOException e17) {\r\n e17.printStackTrace();\r\n return false;\r\n }\r\n } finally {\r\n if (bufbr != null) {\r\n try {\r\n bufbr.close();\r\n } catch (IOException e18) {\r\n e18.printStackTrace();\r\n return false;\r\n }\r\n }\r\n }\r\n }\r\n } catch (Exception e19) {\r\n e = e19;\r\n }\r\n }", "@Override\r\n public void extractArchive(ArchiveExtractor decompressor) throws ArcException {\r\n\r\n\tString fileName = ManipString.substringAfterFirst(this.idSource, \"_\");\r\n\r\n\tboolean uncompressInProgress=false;\r\n\tFile dir = new File(this.archiveChargement + \".dir\");\r\n\tif (!dir.exists()) {\r\n\t\ttry {\r\n\t\t if (dir.mkdir())\r\n\t\t {\r\n\t\t \tStaticLoggerDispatcher.debug(LOGGER,\"$$\"+Thread.currentThread().getId()+\" is decompressing \"+dir.getAbsolutePath());\r\n\t\t \tdecompressor.extract(this.archiveChargement);\r\n\t\t \tuncompressInProgress=true;\r\n\t\t }\r\n\t\t}\r\n\t\t catch (Exception ex)\r\n\t\t{\r\n\t\t\t throw new ArcException(ex, ArcExceptionMessage.FILE_EXTRACT_FAILED, this.archiveChargement).logFullException();\r\n\t\t}\r\n\t}\r\n\t\r\n\tif (!uncompressInProgress) {\r\n\t\t\t// check if file exists\r\n\t File toRead = new File(dir + File.separator + ManipString.redoEntryName(fileName));\r\n\t while (!toRead.exists()) {\r\n\t \ttry {\r\n\t\t\t\tThread.sleep(MILLISECOND_UNCOMPRESSION_CHECK_INTERVAL);\r\n\t\t\t} catch (InterruptedException e) {\r\n\t\t\t\tThread.currentThread().interrupt();\r\n\t\t\t StaticLoggerDispatcher.error(LOGGER, \"Error in thread sleep extractArchive()\");\r\n\t\t\t}\r\n\t \ttoRead = new File(dir + File.separator + ManipString.redoEntryName(fileName));\r\n\t }\r\n\t}\r\n\r\n\r\n\t\r\n }", "private static void shiftExistingBackupFiles(final File journalDirectory, final Path journalFile) {\n\n final String journalFilename = journalFile.getFileName().toString();\n\n // retrieves an inverse order map of backup files\n final Map<Integer, File> jFileMap = JournalFileUtils.getInverseBackupMap(journalDirectory, journalFilename);\n\n // rotates each one of the existing backup files\n for (final Integer currIndex : jFileMap.keySet()) {\n final int currIndexValue = currIndex.intValue();\n if (LOGGER.isTraceEnabled()) {\n LOGGER.trace(\"Backup to rotate found; rank=\" + currIndex + \", file=\" + jFileMap.get(currIndex));\n }\n // shifts the backup file to the next index\n final File srcFile = jFileMap.get(currIndex);\n final File targetFile = new File(journalDirectory, journalFilename + \".\" + (currIndexValue + 1));\n\n if (srcFile.exists() && !targetFile.exists()) {\n try {\n Files.move(srcFile, targetFile);\n }\n catch (final IOException e) {\n // suppress errors and log them\n LOGGER.warn(\"Failed to move backup file; src=\" + srcFile + \", destination=\" + targetFile, e);\n }\n }\n else {\n LOGGER.warn(\"Not rotating backup file, either source doesn't exist or destination does; source=\"\n + srcFile + \", destination=\" + targetFile);\n }\n }\n }", "private void unzipDownloadedFile(String zipFile) throws ZipException, IOException{\n\t int BUFFER = 2048;\n\t \n\t // get zip file\n\t File file = new File(zipFile);\n\t ZipFile zip = new ZipFile(file);\n\t \n\t // unzip to directory of the same name\n\t // When sip is a directory, this gets two folders\n\t //String newPath = zipFile.substring(0, zipFile.length() - 4);\n\t //new File(newPath).mkdir();\n\t \n\t // unzip to parent directory of the zip file\n\t // This is assuming zip if of a directory\n\t String newPath = file.getParent();\n\t \n\t // Process each entry\n\t Enumeration<? extends ZipEntry> zipFileEntries = zip.entries();\n\t while (zipFileEntries.hasMoreElements())\n\t {\n\t // grab a zip file entry\n\t ZipEntry entry = (ZipEntry) zipFileEntries.nextElement();\n\t String currentEntry = entry.getName();\n\t File destFile = new File(newPath, currentEntry);\n\t File destinationParent = destFile.getParentFile();\n\n\t // create the parent directory structure if needed\n\t destinationParent.mkdirs();\n\n\t if (!entry.isDirectory())\n\t {\n\t BufferedInputStream is = new BufferedInputStream(zip.getInputStream(entry));\n\t int currentByte;\n\t // establish buffer for writing file\n\t byte data[] = new byte[BUFFER];\n\n\t // write the current file to disk\n\t FileOutputStream fos = new FileOutputStream(destFile);\n\t BufferedOutputStream dest = new BufferedOutputStream(fos,\n\t BUFFER);\n\n\t // read and write until last byte is encountered\n\t while ((currentByte = is.read(data, 0, BUFFER)) != -1) {\n\t dest.write(data, 0, currentByte);\n\t }\n\t dest.flush();\n\t dest.close();\n\t is.close();\n\t }\n\n\t if (currentEntry.endsWith(\".zip\"))\n\t {\n\t // found a zip file, try to open\n\t \tunzipDownloadedFile(destFile.getAbsolutePath());\n\t }\n\t }\n\t zip.close();\n\t}", "private void addToZipStream(Path file, ZipOutputStream zipStream, String dirName)\r\n throws Exception {\r\n String inputFileName = file.toFile().getPath();\r\n try (FileInputStream inputStream = new FileInputStream(inputFileName)) {\r\n\r\n // create a new ZipEntry, which is basically another file\r\n // within the archive. We omit the path from the filename\r\n Path directory = Paths.get(dirName);\r\n ZipEntry entry = new ZipEntry(directory.relativize(file).toString());\r\n\r\n zipStream.putNextEntry(entry);\r\n\r\n // Now we copy the existing file into the zip archive. To do\r\n // this we write into the zip stream, the call to putNextEntry\r\n // above prepared the stream, we now write the bytes for this\r\n // entry. For another source such as an in memory array, you'd\r\n // just change where you read the information from.\r\n byte[] readBuffer = new byte[2048];\r\n int amountRead;\r\n int written = 0;\r\n\r\n while ((amountRead = inputStream.read(readBuffer)) > 0) {\r\n zipStream.write(readBuffer, 0, amountRead);\r\n written += amountRead;\r\n }\r\n } catch (IOException e) {\r\n throw new Exception(\"Unable to process \" + inputFileName, e);\r\n }\r\n }", "private void addToZip(File directoryToZip, File file, ZipOutputStream zos) throws IOException {\r\n final int BUFFER_SIZE = 1024;\r\n FileInputStream fis = new FileInputStream(file);\r\n // we want the zipEntry's path to be a relative path that is relative\r\n // to the directory being zipped, so chop off the rest of the path\r\n String zipFilePath = file.getCanonicalPath().substring(\r\n (directoryToZip.getCanonicalPath().length() - directoryToZip.getName().length()),\r\n file.getCanonicalPath().length());\r\n ZipEntry zipEntry = new ZipEntry(zipFilePath);\r\n zos.putNextEntry(zipEntry);\r\n byte[] bytes = new byte[BUFFER_SIZE];\r\n int length;\r\n while ((length = fis.read(bytes)) >= 0) {\r\n zos.write(bytes, 0, length);\r\n }\r\n zos.closeEntry();\r\n fis.close();\r\n }", "public FilesArchived(File rootDir, String zip) {\n this.root = rootDir;\n this.compression = (\"zstd\".equals(zip)) ? Compression.ZSTD : Compression.GZIP;\n rescan();\n Thread thread = new Thread(this::run);\n thread.setDaemon(true);\n thread.setName(\"FilesArchived-maintainer\");\n thread.start();\n }", "public static void extractZipArchive(byte[] zipFileData, String directory) throws IOException {\n new File(directory).mkdirs();\n // get the zip file content\n ZipInputStream inputStream = new ZipInputStream(new ByteArrayInputStream(zipFileData));\n // get the zipped file list entry\n ZipEntry zipEntry = inputStream.getNextEntry();\n byte[] buffer = new byte[BUFFER_SIZE];\n while (zipEntry != null) {\n if (!zipEntry.isDirectory()) {\n String fileName = zipEntry.getName();\n File newFile = new File(directory + File.separator + fileName);\n new File(newFile.getParent()).mkdirs();\n\n FileOutputStream fos = new FileOutputStream(newFile);\n\n int len;\n while ((len = inputStream.read(buffer)) > 0) {\n fos.write(buffer, 0, len);\n }\n\n fos.close();\n\n if (LOG.isDebugEnabled()) {\n LOG.debug(\"File unzipped: \" + newFile.getAbsoluteFile());\n }\n }\n zipEntry = inputStream.getNextEntry();\n }\n inputStream.closeEntry();\n inputStream.close();\n }", "private static void createZipOrXmlFile(Document createdDocument) {\n if(attachmentList.size() > 0){\n File zipFile = new File(OUTPUT_ZIP_PATH);\n ZipOutputStream zipOutputStream = null;\n String fileName;\n byte[] decoded;\n\n try {\n zipOutputStream = new ZipOutputStream(new FileOutputStream(zipFile));\n } catch (FileNotFoundException e) {\n e.printStackTrace();\n }\n for (Attachment attachment : attachmentList) {\n try {\n //create a new zip entry\n //add the zip entry and write the decoded data\n assert zipOutputStream != null;\n fileName = attachment.filename;\n decoded = attachment.data;\n ZipEntry imageOutputStream = new ZipEntry(ImportUtils.PHOTO_FILE_PATH + fileName);\n zipOutputStream.putNextEntry(imageOutputStream);\n zipOutputStream.write(decoded);\n\n } catch (IllegalArgumentException | IOException e) {\n e.printStackTrace();\n }\n }\n //add the xml after the attachments have been added\n ZipEntry xmlOutputStream = new ZipEntry(ImportUtils.GENERATED_XML_FILENAME);\n try {\n zipOutputStream.putNextEntry(xmlOutputStream);\n zipOutputStream.write(Entry.toBytes(createdDocument));\n //closing the stream\n //! not closing the stream can result in malformed zip files\n zipOutputStream.finish();\n zipOutputStream.flush();\n zipOutputStream.closeEntry();\n } catch (IOException e) {\n e.printStackTrace();\n\n }\n }else{\n //if no attachments found\n // add the xml file only\n OutputFormat format = OutputFormat.createPrettyPrint();\n try {\n OutputStream outputStream = new FileOutputStream(OUTPUT_XML_PATH);\n XMLWriter writer = new XMLWriter(outputStream, format);\n writer.write(createdDocument);\n } catch (IOException e ) {\n e.printStackTrace();\n }\n }\n }", "private void mergeZipJarContents( ZipOutputStream output, File f ) throws IOException {\n //Check to see that the file with name \"name\" exists.\n if ( ! f .exists() ) {\n return ;\n }\n ZipFile zipf = new ZipFile( f );\n Enumeration entries = zipf.entries();\n while (entries.hasMoreElements()){\n ZipEntry inputEntry = (ZipEntry) entries.nextElement();\n //Ignore manifest entries. They're bound to cause conflicts between\n //files that are being merged. User should supply their own\n //manifest file when doing the merge.\n String inputEntryName = inputEntry.getName();\n int index = inputEntryName.indexOf(\"META-INF\");\n if (index < 0){\n //META-INF not found in the name of the entry. Go ahead and process it.\n try {\n output.putNextEntry(processEntry(zipf, inputEntry));\n } catch (ZipException ex){\n //If we get here, it could be because we are trying to put a\n //directory entry that already exists.\n //For example, we're trying to write \"com\", but a previous\n //entry from another mergefile was called \"com\".\n //In that case, just ignore the error and go on to the\n //next entry.\n String mess = ex.getMessage();\n if (mess.indexOf(\"duplicate\") >= 0){\n //It was the duplicate entry.\n continue;\n } else {\n //I hate to admit it, but we don't know what happened here. Throw the Exception.\n throw ex;\n }\n }\n InputStream in = zipf.getInputStream(inputEntry);\n int len = buffer.length;\n int count = -1;\n while ((count = in.read(buffer, 0, len)) > 0){\n output.write(buffer, 0, count);\n }\n in.close();\n output.closeEntry();\n }\n }\n zipf .close();\n }", "protected static void zipDir(File zipDir, ZipOutputStream zos, String archiveSourceDir)\n throws IOException {\n String[] dirList = zipDir.list();\n byte[] readBuffer = new byte[40960];\n int bytesIn;\n //loop through dirList, and zip the files\n if (dirList != null) {\n for (String aDirList : dirList) {\n File f = new File(zipDir, aDirList);\n //place the zip entry in the ZipOutputStream object\n zos.putNextEntry(new ZipEntry(getZipEntryPath(f, archiveSourceDir)));\n if (f.isDirectory()) {\n //if the File object is a directory, call this\n //function again to add its content recursively\n zipDir(f, zos, archiveSourceDir);\n //loop again\n continue;\n }\n //if we reached here, the File object f was not a directory\n //create a FileInputStream on top of f\n try (FileInputStream fis = new FileInputStream(f)) {\n //now write the content of the file to the ZipOutputStream\n while ((bytesIn = fis.read(readBuffer)) != -1) {\n zos.write(readBuffer, 0, bytesIn);\n }\n }\n }\n }\n }", "public static Path setupArchiveFile( final Configuration conf, final int count, boolean isJar ) throws IOException {\r\n\t\tFile tmpDir = File.createTempFile(\"tmpDir\", \"\");\r\n\t\tif (!tmpDir.delete()) {\r\n\t\t\tthrow new IOException(\"Can not delete recently created tmpFile\");\r\n\t\t}\r\n\t\tif (!tmpDir.mkdirs()) {\r\n\t\t\tthrow new IOException(\"Can not create tmp directory \" + tmpDir);\r\n\t\t}\r\n\t\t\r\n\t\tfinal Path tmpDirPath = new Path(tmpDir.getName());\r\n\t\tList<Path> files = createSimpleDirectory(conf, tmpDirPath, count, null);\r\n\t\tfinal Path zipFile = tmpDirPath.suffix(isJar?\".jar\":\".zip\");\r\n\t\tcreateArchiveFile(conf, zipFile, files, 1, isJar, null);\r\n\t\t/** Now clean up the tmpDir. */\r\n\t\tFileSystem fs = tmpDirPath.getFileSystem(conf);\r\n\t\tfs.delete( tmpDirPath, true);\r\n\t\treturn zipFile;\r\n\t}", "private static void extractArchive(Path sourcePath, Path targetPath) throws IOException {\n\n // TODO: janv_capgemini check if sourcePath is an archive and throw exception if not\n FileSystem fs = FileSystems.newFileSystem(sourcePath, null);\n\n Path path = fs.getPath(\"/\");\n Files.walkFileTree(path, new SimpleFileVisitor<Path>() {\n @Override\n public FileVisitResult visitFile(Path file, BasicFileAttributes attrs) throws IOException {\n\n Path relativePath = path.relativize(file);\n Path targetPathResolved = targetPath.resolve(relativePath.toString());\n Files.deleteIfExists(targetPathResolved);\n Files.createDirectories(targetPathResolved.getParent());\n Files.copy(file, targetPathResolved);\n return FileVisitResult.CONTINUE;\n }\n\n @Override\n public FileVisitResult visitFileFailed(Path file, IOException exc) throws IOException {\n\n // Log errors but do not throw an exception\n LOG.warn(\"An IOException occurred while reading a file on path {} with message: {}\", file, exc.getMessage());\n LOG.debug(\"An IOException occurred while reading a file on path {} with message: {}\", file,\n LOG.isDebugEnabled() ? exc : null);\n return FileVisitResult.CONTINUE;\n }\n });\n\n }", "private boolean unarchive(String osSdkRoot, File archiveFile, SdkManager sdkManager, ITaskMonitor monitor) {\n boolean success = false;\n Package pkg = getParentPackage();\n String pkgName = pkg.getShortDescription();\n String pkgDesc = String.format(\"Installing %1$s\", pkgName);\n monitor.setDescription(pkgDesc);\n monitor.setResult(pkgDesc);\n String pkgKind = pkg.getClass().getSimpleName();\n File destFolder = null;\n File unzipDestFolder = null;\n File oldDestFolder = null;\n try {\n unzipDestFolder = createTempFolder(osSdkRoot, pkgKind, \"new\");\n if (unzipDestFolder == null) {\n monitor.setResult(\"Failed to find a temp directory in %1$s.\", osSdkRoot);\n return false;\n }\n if (!unzipDestFolder.mkdirs()) {\n monitor.setResult(\"Failed to create directory %1$s\", unzipDestFolder.getPath());\n return false;\n }\n String[] zipRootFolder = new String[] { null };\n if (!unzipFolder(archiveFile, getSize(), unzipDestFolder, pkgDesc, zipRootFolder, monitor)) {\n return false;\n }\n if (!generateSourceProperties(unzipDestFolder)) {\n return false;\n }\n destFolder = pkg.getInstallFolder(osSdkRoot, zipRootFolder[0], sdkManager);\n if (destFolder == null) {\n monitor.setResult(\"Failed to compute installation directory for %1$s.\", pkgName);\n return false;\n }\n if (!pkg.preInstallHook(this, monitor, osSdkRoot, destFolder)) {\n monitor.setResult(\"Skipping archive: %1$s\", pkgName);\n return false;\n }\n boolean move1done = false;\n boolean move2done = false;\n while (!move1done || !move2done) {\n File renameFailedForDir = null;\n if (!move1done) {\n if (destFolder.isDirectory()) {\n if (oldDestFolder == null) {\n oldDestFolder = createTempFolder(osSdkRoot, pkgKind, \"old\");\n }\n if (oldDestFolder == null) {\n monitor.setResult(\"Failed to find a temp directory in %1$s.\", osSdkRoot);\n return false;\n }\n if (!destFolder.renameTo(oldDestFolder)) {\n monitor.setResult(\"Failed to rename directory %1$s to %2$s.\", destFolder.getPath(), oldDestFolder.getPath());\n renameFailedForDir = destFolder;\n }\n }\n move1done = (renameFailedForDir == null);\n }\n if (move1done && !move2done) {\n if (renameFailedForDir == null && !unzipDestFolder.renameTo(destFolder)) {\n monitor.setResult(\"Failed to rename directory %1$s to %2$s\", unzipDestFolder.getPath(), destFolder.getPath());\n renameFailedForDir = unzipDestFolder;\n }\n move2done = (renameFailedForDir == null);\n }\n if (renameFailedForDir != null) {\n if (SdkConstants.CURRENT_PLATFORM == SdkConstants.PLATFORM_WINDOWS) {\n String msg = String.format(\"-= Warning ! =-\\n\" + \"A folder failed to be renamed or moved. On Windows this \" + \"typically means that a program is using that folder (for example \" + \"Windows Explorer or your anti-virus software.)\\n\" + \"Please momentarily deactivate your anti-virus software.\\n\" + \"Please also close any running programs that may be accessing \" + \"the directory '%1$s'.\\n\" + \"When ready, press YES to try again.\", renameFailedForDir.getPath());\n if (monitor.displayPrompt(\"SDK Manager: failed to install\", msg)) {\n continue;\n }\n }\n return false;\n }\n break;\n }\n unzipDestFolder = null;\n success = true;\n pkg.postInstallHook(this, monitor, destFolder);\n return true;\n } finally {\n deleteFileOrFolder(oldDestFolder);\n deleteFileOrFolder(unzipDestFolder);\n if (!success) {\n pkg.postInstallHook(this, monitor, null);\n }\n }\n }", "static void unzip(String zipFilePath, String destDirectory, boolean recursive, boolean teacherZip) throws IOException {\n\n if (students == null) {\n students = new ArrayList<Student>();\n }\n\n ZipInputStream zipIn = null;\n\n try {\n zipIn = new ZipInputStream(new FileInputStream(zipFilePath));\n ZipEntry entry = zipIn.getNextEntry();\n\n // iterates over entries in the zip file\n while (entry != null) {\n createFiles(destDirectory, zipIn, entry, recursive);\n\n zipIn.closeEntry();\n entry = zipIn.getNextEntry();\n }\n\n } catch (IOException e) {\n System.err.println(e.getMessage());\n Errors.setUnzipperError(true);\n\n } finally {\n if (zipIn != null) {\n zipIn.close();\n }\n }\n }", "Archiver(File fileIn, File fileOut) throws IOException {\n\n InputStream fileStreamIn = new FileInputStream(fileIn);\n ArrayList<Integer> bytes = Constants.readBytesAndPushToArray(fileStreamIn);\n HashSet<Integer> uniqueBytesArray = getUniqueBytes(bytes);\n ArrayList<String> bitsArray = Constants.getBitsArray(Constants.chooseBitsSize(uniqueBytesArray.size()), bytes.size());\n HashMap<Integer, String> dictionary = createDictionary(uniqueBytesArray, bitsArray);\n ByteArrayOutputStream archivedFile = archiveFile(bytes, dictionary);\n FileOutputStream newFile = new FileOutputStream(fileOut);\n archivedFile.writeTo(newFile);\n System.out.println( \"The size of the file which was IN: \" + fileIn.length());\n System.out.println(\"The size of the file which was OUT: \" + fileOut.length());\n System.out.println(\"File archived is smaller than unarchived by \" + (100 - ((fileOut.length() * 100) / fileIn.length())) +\"%.\" );\n }", "public static void writeZipFile(File directoryToZip, String fileName, List<File> fileList) {\r\n\t\ttry {\r\n\t\t\t//FileOutputStream fos = new FileOutputStream(directoryToZip.getName() + \".zip\");\r\n\t\t\tFileOutputStream fos = new FileOutputStream(directoryToZip +\"\\\\\"+ fileName+\".zip\");\r\n\t\t\tZipOutputStream zos = new ZipOutputStream(fos);\r\n\r\n\t\t\tfor (File file : fileList) {\r\n\t\t\t\tif (!file.isDirectory()) { // we only zip files, not directories\r\n\t\t\t\t\taddToZip(directoryToZip, file, zos);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\tzos.close();\r\n\t\t\tfos.close();\r\n\t\t} catch (FileNotFoundException e) {\r\n\t\t\tlogger.error(e.getMessage());\t\r\n\t\t\te.printStackTrace();\r\n\t\t} catch (IOException e) {\r\n\t\t\tlogger.error(e.getMessage());\t\r\n\t\t\te.printStackTrace();\r\n\t\t}\r\n\t}", "public static void extractZip(String archiveFile, String destinationPath) {\n\t\tFile targetDir = new File(destinationPath);\n\t\ttry (InputStream is = new FileInputStream(new File(archiveFile));\n\t\t\t\tArchiveInputStream i = new ArchiveStreamFactory().createArchiveInputStream(ArchiveStreamFactory.ZIP, is);) {\n\t\t\tArchiveEntry entry = null;\n\t\t\twhile ((entry = i.getNextEntry()) != null) {\n\t\t\t\tif (!i.canReadEntryData(entry)) {\n\t\t\t\t\tlog.error(\"entry cannot be read!! \" + entry.getName());\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t\n\t\t\t\tif (entry.isDirectory()) {\n\t\t\t\t\t// ignore dirs as we don't want to extract any directories (non will exist in this case)\n\t\t\t\t} else {\n\t\t\t\t\t//no point in unzipping empty files\n\t\t\t\t\tif(entry.getSize() > 0) {\n\t\t\t\t\t\tString name = entry.getName();\n\t\t\t\t\t\t//in case the file was a child to a folder, we remove the parent name\n\t\t\t\t\t\tif(name.lastIndexOf(\"/\")!=-1) {\n\t\t\t\t\t\t\tname = name.substring(name.lastIndexOf(\"/\")+1);\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t\tFile f = new File(targetDir + \"/\" + name);\n\t\t\t\t\t\tOutputStream o = Files.newOutputStream(f.toPath());\n\t\t\t\t\t\tIOUtils.copy(i, o);\n\t\t\t\t\t\to.close();\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t} catch (Exception e) {\n\t\t\tlog.fatal(\"Exception thrown while zipping\", e);\n\t\t}\n\t}", "public static void generateZip(File file) {\r\n\t\t\r\n\t\tFile zipfile=new File(file.toString().replaceAll(\".xlsx\",\".zip\" ));\r\n\t\tFileOutputStream fos=null;\r\n\t\tZipOutputStream zos=null;\r\n\t\tFileInputStream fin=null;\r\n\t\tZipEntry ze=null; \r\n\t\t\t\r\n\t\tif(!zipfile.exists()){\r\n\t\t\ttry {\r\n\t\t\t\tzipfile.createNewFile();\r\n\t\t\t} catch (IOException e) {\r\n\t\t\t\t// TODO Auto-generated catch block\r\n\t\t\t\te.printStackTrace();\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\ttry {\r\n\t\t\t\r\n\t\t\t//create ZipOutputStream to write to the zipfile\r\n fos=new FileOutputStream(zipfile);\r\n\t\t\t zos=new ZipOutputStream(fos);\r\n\t\t\t \r\n\t\t//add a new Zip Entry to the ZipOutPutStream \r\n\t\t\t ze=new ZipEntry(file.getName());\r\n\t\t\t zos.putNextEntry(ze);\r\n\t\t\t \r\n\t\t//read the file and write to the ZipOutPutStream\t \r\n\t\t\t fin=new FileInputStream(file);\r\n\t\t\t int i;\r\n\t\t\t \r\n\t\t\t while((i=fin.read())!=-1){\r\n\t\t\t\t zos.write(i);\r\n\t\t\t }\r\n\t\t\t\r\n\t\t\t \r\n\t\t} catch (FileNotFoundException e) {\r\n\t\t\t\r\n\t\t\te.printStackTrace();\r\n\t\t} catch (IOException e) {\r\n\t\t\t// TODO Auto-generated catch block\r\n\t\t\te.printStackTrace();\r\n\t\t}finally{\r\n\t\t\t\r\n\t\t\t\t\t\t\t\r\n\t\t\t\tif(zos!=null && fos!=null && fin!=null){\r\n\t\t\t\t\ttry {\r\n\t\t\t\t //close the zip entry to write to to zip file\r\n\t\t\t\t\t\tzos.closeEntry();\r\n\t\t\t\t\t//close Resources.\t\r\n\t\t\t\t\t\tzos.close();\r\n\t\t\t\t\t\tfos.close();\r\n\t\t\t\t\t\tfin.close();\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t} catch (IOException e) {\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\te.printStackTrace();\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}", "protected static void instrumentJarFile(String pathToFile) throws IOException {\n File jarFile = new File(pathToFile);\n // Use tmp file for output (in the same directory).\n File newFile = File.createTempFile(\"any\", \".jar\", jarFile.getParentFile());\n ZipInputStream zis = null;\n ZipOutputStream zos = null;\n try {\n zis = new ZipInputStream(new FileInputStream(jarFile));\n zos = new ZipOutputStream(new FileOutputStream(newFile));\n for (ZipEntry entry = zis.getNextEntry(); entry != null; entry = zis.getNextEntry()) {\n String name = entry.getName();\n zos.putNextEntry(new ZipEntry(name));\n if (name.endsWith(\".class\")) {\n // We instrument classfiles and then write them to\n // new jar.\n byte[] classfileBuffer = FileUtil.loadBytes(zis, false);\n byte[] newClassfileBuffer = instrumentClassFile(classfileBuffer);\n zos.write(newClassfileBuffer);\n } else {\n int data;\n while ((data = zis.read()) != -1) {\n zos.write(data);\n }\n }\n zos.closeEntry();\n }\n } finally {\n FileUtil.closeAndIgnoreExceptions(zis);\n FileUtil.closeAndIgnoreExceptions(zos);\n }\n\n // Move new jar to old jar.\n // Files.move(newFile, jarFile, StandardCopyOption.REPLACE_EXISTING);\n FileUtil.copyBytes(newFile, jarFile);\n newFile.delete();\n }", "public void sortByZip(String file) throws FileNotFoundException, IOException, ParseException {\n\t\tarrayList = pareseFile(file);\n\t\tFile file1 = new File(file);\n\t\tfor (int i = 0; i < arrayList.size() - 1; i++) {\n\t\t\tfor (int j = 0; j < arrayList.size() - i - 1; j++) {\n\n\t\t\t\tJSONObject person1 = (JSONObject) arrayList.get(j);\n\t\t\t\tJSONObject person2 = (JSONObject) arrayList.get(j + 1);\n\t\t\t\tif ((person1.get(\"zip\").toString()).compareToIgnoreCase(person2.get(\"zip\").toString()) > 0) {\n\t\t\t\t\tJSONObject temp = person1;\n\t\t\t\t\tarrayList.set(j, person2);\n\t\t\t\t\tarrayList.set(j + 1, temp);\n\t\t\t\t}\n\t\t\t}\n\t\t\tmapper.writeValue(file1, arrayList);\n\n\t\t}\n\t}", "public static File unpackArchive(File theFile, File targetDir)\n\t\t\tthrows IOException {\n\t\tif (!theFile.exists()) {\n\t\t\tthrow new IOException(theFile.getAbsolutePath() + \" does not exist\");\n\t\t}\n\t\tif (!buildDirectory(targetDir)) {\n\t\t\tthrow new IOException(\"Could not create directory: \" + targetDir);\n\t\t}\n\t\tZipFile zipFile = new ZipFile(theFile);\n\t\tfor (Enumeration<? extends ZipEntry> entries = zipFile.entries(); entries.hasMoreElements();) {\n\t\t\tZipEntry entry = (ZipEntry) entries.nextElement();\n\t\t\tFile file = new File(targetDir, File.separator + entry.getName());\n\t\t\tif (!buildDirectory(file.getParentFile())) {\n\t\t\t\tthrow new IOException(\"Could not create directory: \"\n\t\t\t\t\t\t+ file.getParentFile());\n\t\t\t}\n\t\t\tif (!entry.isDirectory()) {\n\t\t\t\tcopyInputStream(zipFile.getInputStream(entry),\n\t\t\t\t\t\tnew BufferedOutputStream(new FileOutputStream(file)));\n\t\t\t} else {\n\t\t\t\tif (!buildDirectory(file)) {\n\t\t\t\t\tthrow new IOException(\"Could not create directory: \" + file);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tzipFile.close();\n\t\treturn theFile;\n\t}", "private static void extractFile(ZipInputStream inStreamZip, FSDataOutputStream destDirectory) throws IOException {\n BufferedOutputStream bos = new BufferedOutputStream(destDirectory);\n byte[] bytesIn = new byte[BUFFER_SIZE];\n int read = 0;\n while ((read = inStreamZip.read(bytesIn)) != -1) {\n bos.write(bytesIn, 0, read);\n }\n bos.close();\n }", "public void readZip(File f) {\r\n try {\r\n unzip(f);\r\n File file = new File(workplace + \"/temp/USQ_IMAGE\");\r\n File old = new File(workplace + \"/old\");\r\n if(!old.exists())old.mkdir();\r\n if(old.exists()&&old.isFile())old.mkdir();\r\n File files[] = file.listFiles();\r\n for(int i=0 ; i<files.length ; i++){\r\n readFile(files[i]);\r\n }\r\n //new session\r\n createSes(f);\r\n } catch (Exception ex) {\r\n JOptionPane.showMessageDialog(null, \"read zip file failed.\", \"System Message\", JOptionPane.ERROR_MESSAGE);\r\n ex.printStackTrace();\r\n }\r\n }", "protected File createZipArchive(File directoryToZip, String modpackName, String workspace) throws Exception {\n zipName = LocalDateTime.now().format(DateTimeFormatter.ofPattern(\"yyyy-MM-dd-HH-mm-ss\")) + \"--\" + modpackName + \".zip\";\n uploadStatus = \"Creating Zipfile from Directory\";\n File zipFile = new File(workspace + \"\\\\\" + zipName);\n try {\n ProgressBarLogic progressBarLogic = new ProgressBarLogic(directoryToZip);\n ZipUtil.pack(directoryToZip, zipFile, name -> {\n uploadStatus = \"Adding file: \" + name + \" to the zip\";\n progressBarLogic.progressPercentage = 0;\n progressBarLogic.progress.add(name);\n progressBarLogic.calculateProgress(progressBarLogic.progress);\n notifyObserver();\n return name;\n });\n } catch (ZipException e) {\n throw e;\n } catch (Exception e) {\n System.out.println(e);\n }\n return zipFile;\n }", "public static ZipFile zip(File zip, File fileToAdd, String password)\r\n\t\t\tthrows ZipException {\n\t\tZipFile zipFile = new ZipFile(zip);\r\n\r\n\t\tZipParameters parameters = new ZipParameters();\r\n\t\tparameters.setCompressionMethod(Zip4jConstants.COMP_DEFLATE);\r\n\t\tparameters.setCompressionLevel(Zip4jConstants.DEFLATE_LEVEL_NORMAL);\r\n\t\tif (!StringUtil.isEmpty(password)) {\r\n\t\t\tparameters.setEncryptFiles(true);\r\n\t\t\tparameters.setEncryptionMethod(Zip4jConstants.ENC_METHOD_STANDARD);\r\n\t\t\tparameters.setPassword(password);\r\n\t\t}\r\n\t\tzipFile.addFile(fileToAdd, parameters);\r\n\t\treturn zipFile;\r\n\t}", "public void link() throws Exception {\n ZipOutputStream output = new ZipOutputStream( new FileOutputStream( outfile ) );\n if ( compression ) {\n output .setMethod( ZipOutputStream .DEFLATED );\n output .setLevel( Deflater .DEFAULT_COMPRESSION );\n } else {\n output .setMethod( ZipOutputStream .STORED );\n }\n Enumeration merges = mergefiles .elements();\n while ( merges .hasMoreElements() ) {\n String path = (String) merges .nextElement();\n File f = new File( path );\n if ( f.getName().endsWith( \".jar\" ) || f.getName().endsWith( \".zip\" ) ) {\n //Do the merge\n mergeZipJarContents( output, f );\n }\n else {\n //Add this file to the addfiles Vector and add it \n //later at the top level of the output file.\n addAddFile( path );\n }\n }\n Enumeration adds = addfiles .elements();\n while ( adds .hasMoreElements() ) {\n String name = (String) adds .nextElement();\n File f = new File( name );\n if ( f .isDirectory() ) {\n //System.out.println(\"in jlink: adding directory contents of \" + f.getPath());\n addDirContents( output, f, f.getName() + '/', compression );\n }\n else {\n addFile( output, f, \"\", compression );\n }\n }\n if ( output != null ) {\n try {\n output .close();\n } catch( IOException ioe ) {}\n }\n }", "public void preArchive() {\n // update version number\n setVersionNumber(CURRENT_VERSION_NO);\n }", "private boolean compressOldFiles() {\n long now = System.currentTimeMillis();\n int count = 0;\n for (LogFile lf : knownFiles) {\n // avoid compressing entire archive at once\n if (lf.canCompress(now) && (count++ < 5)) {\n compress(lf.path);\n }\n }\n return count > 0;\n }", "public static void unzip(BasicShell shell, File archive, File destination) {\n\t\ttry {\n\t\t\tshell.printOut(\"Extracting files from archive '\" + archive.getPath() + \"'.\");\n\t\t\tZipFile zipFile = new ZipFile(archive);\n\t\t\tEnumeration<? extends ZipEntry> e = zipFile.entries();\n\t\t\twhile (e.hasMoreElements() ) {\n\t\t\t\tZipEntry entry = e.nextElement();\n\t\t\t\tFile entryFile = new File(destination, entry.getName());\n\t\t\t\tif ( entry.isDirectory() ) {\n\t\t\t\t\tentryFile.mkdirs();\n\t\t\t\t} else {\n\t\t\t\t\tentryFile.getParentFile().mkdirs();\n\t\t\t\t\t\n\t\t\t\t\tInputStream entryStream = zipFile.getInputStream(entry);\n\t\t\t\t\tBufferedOutputStream outStream = new BufferedOutputStream(new FileOutputStream(entryFile));\n\t\t\t\t\tbyte[] buffer = new byte[2048];\n\t\t\t\t\tint count = entryStream.read(buffer);\n\t\t\t\t\twhile ( count > -1 ) {\n\t\t\t\t\t\toutStream.write(buffer, 0, count);\n\t\t\t\t\t\tcount = entryStream.read(buffer);\n\t\t\t\t\t}\n\t\t\t\t\toutStream.flush();\n\t\t\t\t\toutStream.close();\n\t\t\t\t\tentryStream.close();\n\t\t\t\t}\n\t\t\t\tshell.printOut(\"Extracted file '\" + entry.getName() + \"'.\") ;\n\t\t\t}\n\t\t\tzipFile.close();\n\t\t} catch (Exception e) {\n\t\t\tshell.getErrorHandler().handleError(Diagnostic.ERROR, e.getClass().getSimpleName() + \": \"+ e.getMessage());\n\t\t}\n\n\t\t\n\t}", "void addFileToZip(File file, Zipper z, SynchronizationRequest req) \n throws IOException {\n\n if (file.isFile()) {\n z.setBaseDirectory(req.getTargetDirectory());\n z.addFileToZip(file, _out);\n } else if (file.isDirectory()) {\n z.setBaseDirectory(req.getTargetDirectory());\n z.addDirectoryToZip(file, _out);\n } else {\n assert false;\n }\n }", "public static void unzip(String csarFilename, Map<String, ToscaServiceTemplate> unzippedTemplates, String... filter)\n throws PolicyDecodingException, CoderException {\n try (var zipFile = new ZipFile(csarFilename)) {\n int totalSizeArchive = 0;\n int totalEntryArchive = 0;\n\n Enumeration<? extends ZipEntry> entries = zipFile.entries();\n\n while (entries.hasMoreElements()) {\n ZipEntry entry = entries.nextElement();\n totalEntryArchive++;\n\n if (checkEntryFilter(entry.getName(), filter)) {\n validateZipEntry(entry.getName(), csarFilename);\n InputStream entryData = new BufferedInputStream(zipFile.getInputStream(entry));\n\n int bufferedBytes;\n byte[] buffer = new byte[2048];\n int totalSizeEntry = 0;\n\n boolean isValidThreshold = true;\n while ((bufferedBytes = entryData.read(buffer)) > 0 && isValidThreshold) {\n totalSizeEntry += bufferedBytes;\n totalSizeArchive += bufferedBytes;\n\n double compressionRatio = Math.floorDiv(totalSizeEntry, entry.getCompressedSize());\n isValidThreshold = compressionRatio <= THRESHOLD_RATIO;\n }\n\n unzippedTemplates.put(entry.getName(), decodeFile(entry.getName(), zipFile.getInputStream(entry)));\n }\n\n if (totalSizeArchive > THRESHOLD_SIZE || totalEntryArchive > THRESHOLD_ENTRIES) {\n // the uncompressed data size is too much for the application resource capacity\n break;\n }\n }\n } catch (IOException exception) {\n throw new PolicyDecodingException(\"Couldn't read the zipFile\", exception);\n }\n }", "@Override\r\n\tpublic void zipFile(ZipFileDetails zipFileDetails) throws FileSystemUtilException {\r\n\t\tthrow new FileSystemUtilException(\"000000\", null, Level.ERROR, null);\r\n\r\n\t}", "public void testARCHIVECHECK() throws ZipException, IOException {\n // REPAIR\n // ZipMeVariables.getSINGLETON().setARCHIVECHECK___(false);\n\t Configuration.ARCHIVECHECK=true;\n if(Configuration.ARCHIVECHECK) {\n FileInputStream zipFile = new FileInputStream(new File(homeDir\n + \"/files/file.gz\"));\n ZipArchive zipArchive = new ZipArchive(zipFile);\n\n // checkZipArchive() checks if the file is valid\n // ZipArchive calls hook1() that calls checkZipArchive()\n // If the test reaches this point with ARCHIVECHECK disabled and\n // an invalid file, the size() will return 0;\n assertFalse(zipArchive.size() > 0);\n }\n }", "public void zip() {\n\t\tif (zipFile != null) {\n\t\t\tlong start = System.currentTimeMillis();\n\t\t\ttry (ZipOutputStream zos = new ZipOutputStream(new FileOutputStream(zipFile))) {\n\t\t\t\tzos.setLevel(ZipOutputStream.STORED);\n\t\t\t\tbyte[] buffer = new byte[4096];\n\t\t\t\tFiles.list(Paths.get(tool_builddir))\n\t\t\t\t\t\t.forEach(x -> {\n\t\t\t\t\t\t\tFile f = x.toFile();\n\t\t\t\t\t\t\tif (f.isFile() && !f.getName().contains(\".\")) {\n\t\t\t\t\t\t\t\ttry (FileInputStream fis = new FileInputStream(f)) {\n\t\t\t\t\t\t\t\t\tZipEntry zipEntry = new ZipEntry(f.getName());\n\t\t\t\t\t\t\t\t\tzos.putNextEntry(zipEntry);\n\t\t\t\t\t\t\t\t\tint count;\n\t\t\t\t\t\t\t\t\twhile ((count = fis.read(buffer)) >= 0) {\n\t\t\t\t\t\t\t\t\t\tzos.write(buffer, 0, count);\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\tzos.closeEntry();\n\t\t\t\t\t\t\t\t} catch (IOException e) {\n\t\t\t\t\t\t\t\t\tthrow new RuntimeException(e);\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t});\n\t\t\t\tout.println(\"Zipped to '\" + zipFile + \"' - \" + Duration.ofMillis(System.currentTimeMillis() - start));\n\t\t\t} catch (IOException e) {\n\t\t\t\tthrow new RuntimeException(e);\n\t\t\t}\n\t\t}\n\t}", "private static void createZipArchiv(String xmlStream, String path, String name) {\r\n\t\ttry {\r\n\t\t\tFile file = new File(path, name + \".xml\");\r\n\t\t\tif (!file.exists()) {\r\n\t\t\t\tfile.createNewFile();\r\n\t\t\t}\r\n\t\t\t//XMLStream in Datei schreiben\r\n\t\t\tPrintWriter writer = new PrintWriter(file);\r\n\t\t\twriter.write(xmlStream);\r\n\t\t\twriter.close();\r\n\t\t\t\r\n\t\t\t//Commando für die Shell um ein Tgz zu erstellen.\r\n\t\t\tString[] str = new String[] {\r\n\t\t\t\t\t\"/bin/bash\",\r\n\t\t\t\t\t\"-c\",\r\n\t\t\t\t\t\"tar cfvz \" + path + \"/\" + name + \".tgz -C \" + path + \" \" + name\r\n\t\t\t\t\t\t\t+ \".xml -C \" + path + \" \" + name + \".pdf\" };\r\n\r\n\t\t\t//Shell Aufruf\r\n\t\t\tProcess p = Runtime.getRuntime().exec(str);\r\n\t\t\t\r\n\t\t\t\r\n\t\t\tint timeout = 10;\r\n\t\t\twhile (!new File(path + name + \".tgz\").exists() && timeout != 0) {\r\n\t\t\t\t//warten bis Datei erstellt wurde oder 10 sec vergangen sind\r\n\t\t\t\ttry {\r\n\t\t\t\t\ttimeout--;\r\n\t\t\t\t\tThread.sleep(1000);\r\n\t\t\t\t} catch (InterruptedException e) {\r\n\t\t\t\t\t// TODO Auto-generated catch block\r\n\t\t\t\t\te.printStackTrace();\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t} catch (IOException e) {\r\n\t\t\t// TODO Auto-generated catch block\r\n\t\t\te.printStackTrace();\r\n\t\t}\r\n\t}", "private void copyNGClientJar(File file, File targetLibDir) throws IOException\n\t{\n\t\tFile dest = new File(targetLibDir, file.getName());\n\t\tZipInputStream zin = new ZipInputStream(new FileInputStream(file));\n\t\tZipOutputStream zout = new ZipOutputStream(new FileOutputStream(dest));\n\t\tbyte[] buf = new byte[1024];\n\n\t\tZipEntry entry = zin.getNextEntry();\n\t\twhile (entry != null)\n\t\t{\n\t\t\tString name = entry.getName();\n\t\t\tboolean toBeDeleted = false;\n\t\t\tfor (String f : EXCLUDE_FROM_NG_JAR)\n\t\t\t{\n\t\t\t\tif (name.startsWith(f))\n\t\t\t\t{\n\t\t\t\t\ttoBeDeleted = true;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (!toBeDeleted)\n\t\t\t{\n\t\t\t\t// Add ZIP entry to output stream.\n\t\t\t\tzout.putNextEntry(new ZipEntry(name));\n\t\t\t\t// Transfer bytes from the ZIP file to the output file\n\t\t\t\tint len;\n\t\t\t\twhile ((len = zin.read(buf)) > 0)\n\t\t\t\t{\n\t\t\t\t\tzout.write(buf, 0, len);\n\t\t\t\t}\n\t\t\t}\n\t\t\tentry = zin.getNextEntry();\n\t\t}\n\t\t// Close the streams\n\t\tzin.close();\n\t\t// Compress the files\n\t\t// Complete the ZIP file\n\t\tzout.close();\n\t}", "public void unzip(String zipFilePath, String destDirectory) throws IOException {\n File destDir = new File(destDirectory);\n if (!destDir.exists()) {\n destDir.mkdir();\n }\n ZipInputStream zipInputStream = new ZipInputStream(new FileInputStream(zipFilePath));\n ZipEntry ZipEntry = zipInputStream.getNextEntry();\n\t\twhile (ZipEntry != null) {\n String fileName = ZipEntry.getName();\n\t\t\tString filePath = destDirectory + File.separator + fileName;\n if (!ZipEntry.isDirectory() && fileName.endsWith(\".jar\")) {\n extractFile(zipInputStream, filePath);\n } \n zipInputStream.closeEntry();\n ZipEntry = zipInputStream.getNextEntry();\n }\n zipInputStream.close();\n }", "public Result unzip() {\n MultipartFormData<File> body = request().body().asMultipartFormData();\n MultipartFormData.FilePart<File> fileInput = body.getFile(\"inputFile\");\n String filename = fileInput.getFilename();\n if (fileInput != null) {\n File file = (File) fileInput.getFile();\n File nf = new File(ZIP_URL + filename);\n boolean rst = file.renameTo(nf);\n String destDir = ZipUtils.unZip(ZIP_URL + filename, ZIP_URL);\n File dir = new File(ZIP_URL);\n String[] dirList = dir.list();\n return ok(afterUpload.render(Arrays.asList(dirList)));\n } else {\n return badRequest(\"error\");\n }\n }", "private static void unzip(EmailTypes collection) {\n File dir = new File(destDir);\n // create output directory if it doesn't exist\n if(!dir.exists()) {\n dir.mkdirs();\n }\n FileInputStream fis;\n //buffer for read and write data to file\n byte[] buffer = new byte[1024];\n try {\n fis = new FileInputStream(sourceFiles.get(collection).getPath());\n ZipInputStream is = new ZipInputStream(fis);\n ZipEntry zipEntry = is.getNextEntry();\n System.out.println(\"Unzipping set: \" + collection.getCollection() + \".\");\n while(zipEntry != null){\n String fileName = zipEntry.getName();\n File newFile = new File(unpackedFiles.get(collection) + File.separator + fileName);\n new File(newFile.getParent()).mkdirs();\n FileOutputStream fos = new FileOutputStream(newFile);\n int len;\n while ((len = is.read(buffer)) > 0) {\n fos.write(buffer, 0, len);\n }\n fos.close();\n is.closeEntry();\n zipEntry = is.getNextEntry();\n }\n is.closeEntry();\n is.close();\n fis.close();\n } catch (IOException e) {\n e.printStackTrace();\n }\n }", "private void gzipFile(File file) throws IOException\n {\n InputStream input = null;\n GZIPOutputStream gzipOutput = null;\n try\n {\n input = new BufferedInputStream(new FileInputStream(file));\n\n String zippedPath = file.getAbsolutePath() + \".gz\";\n gzipOutput = new GZIPOutputStream(new BufferedOutputStream(new FileOutputStream(zippedPath)));\n\n int value = input.read();\n while (value >= 0)\n {\n gzipOutput.write(value);\n value = input.read();\n }\n gzipOutput.flush();\n gzipOutput.close();\n if (replaceOriginals)\n {\n file.delete();\n }\n }\n finally\n {\n if (input != null)\n {\n input.close();\n }\n if (gzipOutput != null)\n {\n gzipOutput.close();\n }\n }\n }", "private void zipDirectoryToOutputStream(File dirToZip, OutputStream outStream)\n throws IOException {\n if (!dirToZip.isDirectory()) {\n throw new IOException(\"zip directory does not exist\");\n }\n Log.v(TAG, \"zipping directory \" + dirToZip.getAbsolutePath());\n\n File[] listFiles = dirToZip.listFiles();\n try (ZipOutputStream zipStream = new ZipOutputStream(new BufferedOutputStream(outStream))) {\n for (File file : listFiles) {\n if (file.isDirectory()) {\n continue;\n }\n String filename = file.getName();\n // only for the zipped output file, we add individual entries to zip file.\n if (filename.equals(OUTPUT_ZIP_FILE) || filename.equals(EXTRA_OUTPUT_ZIP_FILE)) {\n ZipUtils.extractZippedFileToZipStream(file, zipStream);\n } else {\n ZipUtils.addFileToZipStream(file, zipStream);\n }\n }\n } finally {\n outStream.close();\n }\n // Zipping successful, now cleanup the temp dir.\n FileUtils.deleteDirectory(dirToZip);\n }", "private static void createFiles(String destDirectory, ZipInputStream zipIn, ZipEntry entry, boolean recursive) throws IOException {\n\n String filePath = destDirectory + File.separator + entry.getName();\n\n if (!entry.isDirectory()) {\n\n boolean isZipFile = filePath.endsWith(\".zip\");\n boolean isJavaFile = filePath.endsWith(\".java\");\n\n if (isZipFile || isJavaFile) {\n\n writeFile(zipIn, filePath);\n\n if (recursive) {\n File file = new File(filePath);\n\n String parts[] = entry.getName().split(\"/\");\n String studentName;\n\n if (parts.length > 1) {\n studentName = parts[1].split(\"_\")[0];\n } else {\n studentName = entry.getName().split(\"_\")[0];\n }\n\n String studentDir = file.getParentFile().getAbsolutePath() + \"/\" + studentName;\n File dir = new File(studentDir);\n dir.mkdir();\n\n students.add(new Student(studentName, studentDir));\n\n unzip(filePath, studentDir, false, false);\n }\n }\n\n } else {\n File dir = new File(filePath);\n dir.mkdir();\n }\n }", "public void unZip(String fileName, String unZipTarget) throws IOException {\n this.unzipFileTargetLocation = unZipTarget;\n dirsMade = new TreeSet();\n zippy = new ZipFile(fileName);\n Enumeration all = zippy.entries();\n while (all.hasMoreElements()) {\n getFile((ZipEntry) all.nextElement());\n }\n }", "public static void populateList(ArrayList<String> list,boolean archive){\n\t\tlist.clear();\n\t\tif (itemList!=null){\n\t\t\tfor(int i=0;i<itemList.size();i++){\n\t\t\t\tif (itemList.get(i).getArchived()==archive){\n\t\t\t\t\tlist.add(ItemListController.getItemListInstance().get(i).getName());\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "public void toUnzip(String zipFile, String targetDir) {\n\n\t\tMessage message = new Message();\n\t\tmessage.what = SUCCESS;\n\n\t\tint SIZE = 4096; // buffer size: 4KB\n\t\tString strEntry; // each zip entry name\n\t\ttry {\n\t\t\tBufferedOutputStream dest = null; // buffer output stream\n\t\t\tFileInputStream fis = new FileInputStream(zipFile);\n\t\t\tZipInputStream zis = new ZipInputStream(\n\t\t\t\t\tnew BufferedInputStream(fis));\n\t\t\tZipEntry entry; // each zip entry\n\t\t\twhile ((entry = zis.getNextEntry()) != null) {\n\t\t\t\ttry {\n\t\t\t\t\tint count;\n\t\t\t\t\tbyte data[] = new byte[SIZE];\n\t\t\t\t\tstrEntry = entry.getName();\n\n\t\t\t\t\tFile entryFile = new File(targetDir + strEntry);\n\t\t\t\t\tFile entryDir = new File(entryFile.getParent());\n\t\t\t\t\tif (!entryDir.exists()) {\n\t\t\t\t\t\tentryDir.mkdirs();\n\t\t\t\t\t}\n\n\t\t\t\t\tFileOutputStream fos = new FileOutputStream(entryFile);\n\t\t\t\t\tdest = new BufferedOutputStream(fos, SIZE);\n\t\t\t\t\twhile ((count = zis.read(data, 0, SIZE)) != -1) {\n\t\t\t\t\t\tdest.write(data, 0, count);\n\n\t\t\t\t\t\tMessage msg = Message.obtain();\n\t\t\t\t\t\tmsg.what = PROGRESS;\n\t\t\t\t\t\tmsg.obj = count;\n\t\t\t\t\t\thandler.sendMessage(msg);\n\t\t\t\t\t}\n\t\t\t\t\tdest.flush();\n\t\t\t\t\tdest.close();\n\t\t\t\t} catch (Exception ex) {\n\t\t\t\t\tmessage.what = ERROR;\n\t\t\t\t\tmessage.obj = ex.getMessage();\n\t\t\t\t\tex.printStackTrace();\n\t\t\t\t}\n\t\t\t}\n\t\t\tzis.close();\n\t\t\tFile fileszipe = new File(zipFile);\n\t\t\tfileszipe.delete();\n\t\t} catch (Exception cwj) {\n\t\t\tmessage.what = ERROR;\n\t\t\tmessage.obj = cwj.getMessage();\n\t\t\tcwj.printStackTrace();\n\t\t}\n\t\thandler.sendMessage(message);\n\t}", "public void EliminarArchivos(){\n\t\ttry{\n\t\tFile Delete = new File(\"Cod.txt\");\n\t\tDelete.deleteOnExit();\n\t\tFile Borrar = new File(\"Maq.txt\");\n\t\tBorrar.deleteOnExit();\n\t\tFile eliminar = new File(\"WS.txt\");\n\t\teliminar.deleteOnExit();\n\t\tFile Bye = new File(\"RESPALDO.txt\");\n\t\tBye.deleteOnExit();\n\t\t\tBufferedReader numero= new BufferedReader(new FileReader(\"WS.txt\"));\n\t\t\tString valor = numero.readLine();\n\t\t\tint NumAreas= Integer.valueOf(valor);\n\t\t\tfor(int i=0; i< NumAreas;i++){\n\t\t\t\tvalor= numero.readLine();\n\t\t\t\tFile eliminas = new File(\"WS\"+valor+\".txt\");\n\t\t\t\teliminas.deleteOnExit();\n\t\t\t}\n\t\t\tnumero.close();\n\t\t}catch(IOException e){\n\t\t\tSystem.out.println(\"File not found\");\n\t\t}\n\t}", "public static void packToZip(String sourceDirPath, String zipFilePath) throws IOException {\n Path p;\n p = Files.createFile(Paths.get(zipFilePath));\n try (ZipOutputStream zs = new ZipOutputStream(Files.newOutputStream(p))) {\n Path pp = Paths.get(sourceDirPath);\n Files.walk(pp)\n .filter(path -> !Files.isDirectory(path))\n .forEach(path -> {\n if (!path.toString().endsWith(\".zip\")) {\n ZipEntry zipEntry = new ZipEntry(pp.relativize(path).toString());\n try {\n zs.putNextEntry(zipEntry);\n Files.copy(path, zs);\n zs.closeEntry();\n } catch (IOException e) {\n System.err.println(e);\n }\n }\n });\n }\n }", "@Override\r\n public void setArchive(String archive) {\n }", "public RunFilter withIsArchiveEnabled(Boolean isArchiveEnabled) {\n this.isArchiveEnabled = isArchiveEnabled;\n return this;\n }", "public static void m97139a(File file, ZipOutputStream zipOutputStream, String str) throws IOException {\n if (file.exists()) {\n if (file.isDirectory()) {\n String name = file.getName();\n if (!name.endsWith(File.separator)) {\n name = name + File.separator;\n }\n if (!TextUtils.isEmpty(str)) {\n name = str + name;\n }\n File[] listFiles = file.listFiles();\n if (listFiles == null || listFiles.length <= 0) {\n zipOutputStream.putNextEntry(new ZipEntry(name));\n zipOutputStream.closeEntry();\n return;\n }\n for (File file2 : listFiles) {\n m97139a(file2, zipOutputStream, name);\n }\n return;\n }\n zipOutputStream.putNextEntry(new ZipEntry(TextUtils.isEmpty(str) ? file.getName() : str + file.getName()));\n FileInputStream fileInputStream = new FileInputStream(file);\n byte[] bArr = new byte[4096];\n while (true) {\n int read = fileInputStream.read(bArr);\n if (read != -1) {\n zipOutputStream.write(bArr, 0, read);\n } else {\n zipOutputStream.flush();\n fileInputStream.close();\n zipOutputStream.closeEntry();\n return;\n }\n }\n } else {\n return;\n }\n throw th;\n }", "public static void saveToZip(String path) throws FileNotFoundException, IOException {\n //File and Zip Outoput Streams \n FileOutputStream fos = new FileOutputStream(path);\n ZipOutputStream zipOS = new ZipOutputStream(fos);\n //For every image, we create a temporally jpeg file\n //Then, with the createFileToZip function, we include it to the output zip file\n //Finally, we delete the jpeg image\n for (int i =0; i< imageNames.size(); i++) {\n File tempImage = new File(\"image_\"+Integer.toString(i)+\".jpg\");\n ImageIO.write(imageDict.get(imageNames.get(i)),\"jpg\",tempImage);\n createFileToZip(imageDict.get(imageNames.get(i)),\"image_\",i,zipOS);\n tempImage.delete();\n }\n zipOS.finish(); //Good practice!\n zipOS.close();\n }", "private void addFile( ZipOutputStream output, File file, String prefix, boolean compress) throws IOException {\n //Make sure file exists\n long checksum = 0;\n if ( ! file .exists() ) {\n return ;\n }\n ZipEntry entry = new ZipEntry( getEntryName( file, prefix ) );\n entry .setTime( file .lastModified() );\n entry .setSize( file .length() );\n if (! compress){\n entry.setCrc(calcChecksum(file));\n }\n FileInputStream input = new FileInputStream( file );\n addToOutputStream(output, input, entry);\n }", "private void removeOldFiles() {\n Set<File> existingFiles = new HashSet<File>();\n collectFiles(existingFiles);\n for (ResourceResponse r : cacheResponseProcessor.getResources()) {\n String remotePathId = r.pathId;\n String remotePath = localClasspathProcessor.getLocalClasspath().get(remotePathId);\n String localPath = localPathTranslation.get(remotePath);\n File localFile = new File(localPath);\n File file = new File(localFile, r.name);\n existingFiles.remove(file);\n }\n }", "public static List<File> unjar(InputStream in, File dest)\r\n\t\t\tthrows IOException {\r\n\r\n\t\tfinal List<File> back = new ArrayList<File>();\r\n\t\tif (!dest.exists()) {\r\n\t\t\tdest.mkdirs();\r\n\t\t}\r\n\r\n\t\tif (!dest.isDirectory()) {\r\n\t\t\tthrow new IOException(\"Destination must be a directory.\");\r\n\t\t}\r\n\r\n\t\tJarInputStream jin = new JarInputStream(in);\r\n\t\tfinal byte[] buffer = new byte[1024];\r\n\t\tZipEntry entry = jin.getNextEntry();\r\n\t\twhile (entry != null) {\r\n\r\n\t\t\tString fileName = entry.getName();\r\n\t\t\tif (fileName.charAt(fileName.length() - 1) == '/') {\r\n\t\t\t\tfileName = fileName.substring(0, fileName.length() - 1);\r\n\t\t\t}\r\n\r\n\t\t\tif (fileName.charAt(0) == '/') {\r\n\t\t\t\tfileName = fileName.substring(1);\r\n\t\t\t}\r\n\r\n\t\t\tif (File.separatorChar != '/') {\r\n\t\t\t\tfileName = fileName.replace('/', File.separatorChar);\r\n\t\t\t}\r\n\r\n\t\t\tfinal File file = new File(dest, fileName);\r\n\t\t\tif (entry.isDirectory()) {\r\n\t\t\t\t// make sure the directory exists\r\n\t\t\t\tfile.mkdirs();\r\n\t\t\t\tjin.closeEntry();\r\n\t\t\t} else {\r\n\t\t\t\t// make sure the directory exists\r\n\t\t\t\tfinal File parent = file.getParentFile();\r\n\t\t\t\tif (parent != null && !parent.exists()) {\r\n\t\t\t\t\tparent.mkdirs();\r\n\t\t\t\t}\r\n\r\n\t\t\t\t// dump the file\r\n\r\n\t\t\t\tfinal OutputStream out = new FileOutputStream(file);\r\n\t\t\t\tint len = 0;\r\n\t\t\t\twhile ((len = jin.read(buffer, 0, buffer.length)) != -1) {\r\n\t\t\t\t\tout.write(buffer, 0, len);\r\n\t\t\t\t}\r\n\r\n\t\t\t\tout.flush();\r\n\t\t\t\tout.close();\r\n\t\t\t\tjin.closeEntry();\r\n\t\t\t\tback.add(file);\r\n\r\n\t\t\t}\r\n\r\n\t\t\tentry = jin.getNextEntry();\r\n\t\t}\r\n\t\tjin.close();\r\n\t\treturn back;\r\n\t}", "public static void zipOSM(File[] files, String destDir, String destFile) throws FileNotFoundException, IOException {\n\n\t\tFile dirFile = new File(destDir);\n\n\t\tif (!dirFile.exists()) {\n\t\t\tdirFile.mkdirs();\n\t\t}\n\n\t\tString[] strs = new String[files.length];\n\n\t\tfor (int i = 0; i < strs.length; i++) {\n\t\t\tstrs[i] = files[i].getAbsolutePath();\n\t\t}\n\n\t\tString file = destDir + destFile + \".zip\";\n\t\tfile.replace(\".osm\", \"\");\n\t\tCompressFile.instance.zip(strs, file);\n\t}", "List<File> compress(File directory, int size);", "public void testChangeZIPArchive2() throws Exception {\n IPath projectPath = env.addProject(\"Project\");\n env.addExternalJars(projectPath, Util.getJavaClassLibs());\n String internalLib = env.getProject(\"Project\").getLocation().toOSString() + File.separator + \"internalLib.abc\";\n org.eclipse.jdt.core.tests.util.Util.createJar(new String[] { \"p/X.java\", \"package p;\\n\" + \"public class X {\\n\" + \" public void foo() {\\n\" + \" }\\n\" + \"}\" }, internalLib, \"1.4\");\n env.getProject(projectPath).refreshLocal(IResource.DEPTH_INFINITE, null);\n env.addEntry(projectPath, JavaCore.newLibraryEntry(new Path(\"/Project/internalLib.abc\"), null, null));\n //$NON-NLS-1$\n IPath root = env.getPackageFragmentRootPath(projectPath, \"\");\n env.setOutputFolder(projectPath, \"\");\n IPath classY = env.addClass(root, \"q\", \"Y\", \"package q;\\n\" + \"public class Y {\\n\" + \" void bar(p.X x) {\\n\" + \" x.foo();\\n\" + \" }\\n\" + \"}\");\n fullBuild(projectPath);\n expectingNoProblems();\n org.eclipse.jdt.core.tests.util.Util.createJar(new String[] { \"p/X.java\", \"package p;\\n\" + \"public class X {\\n\" + \"}\" }, internalLib, \"1.4\");\n env.getProject(projectPath).refreshLocal(IResource.DEPTH_INFINITE, null);\n incrementalBuild(projectPath);\n expectingProblemsFor(classY, \"Problem : The method foo() is undefined for the type X [ resource : </Project/q/Y.java> range : <54,57> category : <50> severity : <2>]\");\n env.removeProject(projectPath);\n }", "public static void compressFolder(String dirPath, String zipFileName) throws Exception {\n\t\tFile destination = new File(zipFileName);\n\t\tFile source = new File(dirPath);\n\t\tOutputStream archiveStream = new FileOutputStream(destination);\n\t\tArchiveOutputStream archive = new ArchiveStreamFactory().createArchiveOutputStream(ArchiveStreamFactory.ZIP,\n\t\t\t\tarchiveStream);\n\n\t\tCollection<File> fileList = FileUtils.listFiles(source, null, true);\n\n\t\t//loop through all files and add them one by one to the archive\n\t\tfor (File file : fileList) {\n\t\t\tString entryName = getEntryName(source, file);\n\t\t\tZipArchiveEntry entry = new ZipArchiveEntry(entryName);\n\t\t\tarchive.putArchiveEntry(entry);\n\n\t\t\tBufferedInputStream input = new BufferedInputStream(new FileInputStream(file));\n\n\t\t\tIOUtils.copy(input, archive);\n\t\t\tinput.close();\n\t\t\tarchive.closeArchiveEntry();\n\t\t}\n\n\t\tarchive.finish();\n\t\tarchiveStream.close();\n\t}", "public abstract boolean moveToArchive(K id) throws ServiceException;", "public static Archive openArchive(String archiveResourcePath) throws IOException {\n UUID uuid = UUID.randomUUID();\n\n File srcFile = new File(DwcaTestUtil.class.getResource(archiveResourcePath).getFile());\n File tmpFile = new File(srcFile.getParentFile(), uuid + \".dwca\");\n Files.copy(srcFile.toPath(), tmpFile.toPath());\n\n File dwcaDir = new File(tmpFile.getParent(), uuid.toString());\n if (srcFile.toString().endsWith(\".zip\")) {\n return DwcFiles.fromCompressed(tmpFile.toPath(), dwcaDir.toPath());\n }\n\n return DwcFiles.fromLocation(tmpFile.toPath());\n }", "public synchronized static void cleanOldFiles() {\n\t\tGregorianCalendar yesterday = new GregorianCalendar();\n\t\tyesterday.roll(GregorianCalendar.HOUR_OF_DAY,-4);\n\t\tcleanOldFiles(yesterday.getTime());\n\t}", "@Test\r\n\tpublic void testBundler2() throws ArchiveException, IOException {\r\n\t\r\n\t\t// Build the path to the output file\r\n\t\tStringBuilder sb = new StringBuilder();\r\n\t\tsb.append(ArchiveTest._tempDir);\r\n\t\tsb.append(File.separator);\r\n\t\tsb.append(this._archiveFilename2);\r\n\t\tthis._archiveFilename2 = sb.toString();\r\n\t\t\r\n\t\tList<String> list = super.getFileList();\r\n\t\tArchiveFactory factory = ArchiveFactory.getFactory();\r\n\t\ttry {\r\n\t\t\t\r\n\t\t\tBundlerI bundler = factory.getInstance(ArchiveType.BZIP2);\r\n\t\t\tbundler.bundle(list, this._archiveFilename2, null);\r\n\t\t\tFile archive = new File(bundler.getArchiveName());\r\n\t\t\tSystem.out.println(bundler.getArchiveName());\r\n\t\t\tassertTrue(archive.exists());\r\n\t\t\tdouble bytes = archive.length();\r\n\t\t\tSystem.out.println(bytes);\r\n\t\t\t\r\n\t\t}\r\n\t\tcatch (UnknownArchiveTypeException uae) {\r\n\t\t\t// We *should* never get this exception\r\n\t\t\tuae.printStackTrace();\r\n\t\t}\r\n\t}", "public static void unzip(File archive, File directory) throws IOException\n {\n ZipFile zip = null;\n\n if (directory.exists()) {\n if (!directory.isDirectory()) {\n throw new IOException(\"Directory is not a directory: \" + directory);\n }\n }\n else {\n if (!directory.mkdirs()) {\n throw new IOException(\"Could not create directory: \" + directory);\n }\n }\n try {\n zip = new ZipFile(archive);\n for (Enumeration entries = zip.entries(); entries.hasMoreElements();) {\n ZipEntry entry = (ZipEntry)entries.nextElement();\n File f = new File(directory, entry.getName());\n if (entry.isDirectory()) {\n if (!f.mkdirs()) {\n throw new IOException(\"Could not create directory: \" + f);\n }\n }\n else {\n if (zip != null) {\n InputStream is = zip.getInputStream(entry);\n OutputStream os = new BufferedOutputStream(new FileOutputStream(f));\n IOUtils.copy(is, os);\n IOUtils.closeQuietly(is);\n IOUtils.closeQuietly(os);\n }\n }\n }\n }\n finally {\n if (zip != null) {\n zip.close();\n }\n }\n }", "public void testChangeZIPArchive1() throws Exception {\n String externalLib = Util.getOutputDirectory() + File.separator + \"externalLib.abc\";\n IPath projectPath = env.addProject(\"Project\");\n try {\n org.eclipse.jdt.core.tests.util.Util.createJar(new String[] { \"p/X.java\", \"package p;\\n\" + \"public class X {\\n\" + \" public void foo() {\\n\" + \" }\\n\" + \"}\" }, externalLib, \"1.4\");\n env.addExternalJars(projectPath, Util.getJavaClassLibs());\n env.addExternalJars(projectPath, new String[] { externalLib });\n //$NON-NLS-1$\n IPath root = env.getPackageFragmentRootPath(projectPath, \"\");\n env.setOutputFolder(projectPath, \"\");\n IPath classY = env.addClass(root, \"q\", \"Y\", \"package q;\\n\" + \"public class Y {\\n\" + \" void bar(p.X x) {\\n\" + \" x.foo();\\n\" + \" }\\n\" + \"}\");\n fullBuild(projectPath);\n expectingNoProblems();\n org.eclipse.jdt.core.tests.util.Util.createJar(new String[] { \"p/X.java\", \"package p;\\n\" + \"public class X {\\n\" + \"}\" }, externalLib, \"1.4\");\n IJavaProject p = env.getJavaProject(projectPath);\n p.getJavaModel().refreshExternalArchives(new IJavaElement[] { p }, null);\n incrementalBuild(projectPath);\n expectingProblemsFor(classY, \"Problem : The method foo() is undefined for the type X [ resource : </Project/q/Y.java> range : <54,57> category : <50> severity : <2>]\");\n } finally {\n new File(externalLib).delete();\n env.removeProject(projectPath);\n }\n }", "public void unzip(String _zipFile, String _targetLocation) {\n dirChecker(_targetLocation);\n\n try {\n FileInputStream fin = new FileInputStream(_zipFile);\n ZipInputStream zin = new ZipInputStream(fin);\n ZipEntry ze = null;\n while ((ze = zin.getNextEntry()) != null) {\n\n //create dir if required while unzipping\n if (ze.isDirectory()) {\n dirChecker(ze.getName());\n } else {\n FileOutputStream fout = new FileOutputStream(_targetLocation + ze.getName());\n for (int c = zin.read(); c != -1; c = zin.read()) {\n fout.write(c);\n }\n\n zin.closeEntry();\n fout.close();\n }\n\n }\n zin.close();\n } catch (Exception e) {\n System.out.println(e);\n }\n }", "public static void zipFilesTo(File[] files, String destDir, String destFile) throws FileNotFoundException, IOException {\n\n\t\tFile dirFile = new File(destDir);\n\n\t\tif (!dirFile.exists()) {\n\t\t\tdirFile.mkdirs();\n\t\t}\n\n\t\tString[] strs = new String[files.length];\n\n\t\tfor (int i = 0; i < strs.length; i++) {\n\t\t\tstrs[i] = files[i].getAbsolutePath();\n\t\t}\n\n\t\tCompressFile.instance.zip(strs, destDir + destFile + \".zip\");\n\t}", "@Override\n public File compress() throws Exception\n {\n File dest = File.createTempFile(\"TMP\",\".tar.gz\");\n FileOutputStream fos = new FileOutputStream( dest );\n BufferedOutputStream bos = new BufferedOutputStream(fos);\n TarOutputStream out = new TarOutputStream(bos);\n tarFolder( null, folder.getAbsolutePath(), out );\n out.close();\n return dest;\n }", "public static void archiveProcessedFiles(Session session, String sourceDir,\r\n\t\t\tString targetDir, String fileName) throws Exception {\r\n\t\tChannelSftp sftpChannel = null;\r\n\t\ttry {\r\n\t\t\tChannel channel = session.openChannel(\"sftp\");\r\n\t\t\tchannel.connect();\r\n\t\t\tsftpChannel = (ChannelSftp) channel;\r\n\t\t\tsftpChannel.cd(targetDir);\r\n\r\n\t\t\tDateFormat df = new SimpleDateFormat(\"MM.dd.yyyy_HHmmss\");\r\n\t\t\tDate today = Calendar.getInstance().getTime();\r\n\t\t\tString archiveDate = df.format(today);\r\n\r\n\t\t\tsftpChannel.mkdir(targetDir + archiveDate);\r\n\t\t\tsftpChannel.rename(sourceDir + fileName, targetDir + archiveDate\r\n\t\t\t\t\t+ \"/\" + fileName);\r\n\t\t\tlogger.info(\"File -> \\\"\" + fileName\r\n\t\t\t\t\t+ \"\\\": archived successfully to \" + targetDir + archiveDate);\r\n\t\t} catch (Exception e) {\r\n\t\t\te.getMessage();\r\n\t\t\tthrow e;\r\n\t\t} finally {\r\n\t\t\tif (sftpChannel != null) {\r\n\t\t\t\ttry {\r\n\t\t\t\t\tsftpChannel.exit();\r\n\t\t\t\t} catch (Exception e) {\r\n\t\t\t\t\te.getMessage();\r\n\t\t\t\t}\r\n\r\n\t\t\t}\r\n\t\t\tif (session != null) {\r\n\t\t\t\tsession.disconnect();\r\n\t\t\t}\r\n\t\t}\r\n\t}", "private void endEntry() {\n\t\tif (lastImageFile!=null) {\r\n\t\t\tSystem.out.println(\"Dealing with image file: \" + lastImageLumpName);\r\n\t\t\t//Add an entry for it\r\n\t\t\ttry {\r\n\t\t\t\tZipEntry dir = new ZipEntry(\"ohrrpgce/games/\" + newRPGName + \"/\" + lastImageLumpName);\r\n\t\t\t\t//System.out.println(\"Entry opened: \" + dir.getName());\r\n\t\t\t\ttempJar.putNextEntry(dir);\r\n\t\t\t} catch (IOException ex) {\r\n\t\t\t\tSystem.out.println(\"Error adding entry for image file: \" + lastImageLumpName);\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t//Copy it.\r\n\t\t\ttry {\r\n\t\t\t\tBufferedInputStream in = new BufferedInputStream(new FileInputStream(lastImageFile));\r\n\t\t\t\tbyte[] lin = new byte[1024];\r\n\t\t\t\tint len = 0;\r\n\t\t\t\tfor(;;) {\r\n\t\t\t\t\tlen = in.read(lin);\r\n\t\t\t\t\tif (len <= 0)\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\r\n\t\t\t\t\ttempJar.write(lin, 0, len);\r\n\t\t\t\t}\r\n\t\t\t\tin.close();\r\n\t\t\t} catch (IOException ex) {\r\n\t\t\t\tSystem.out.println(\"Error copying raw image data: \" + ex.toString());\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tlastImageFile.delete();\r\n\t\t\tlastImageFile=null;\r\n\t\t} \r\n\t\t\r\n\t\t//Close the entry\r\n\t\ttry {\r\n\t\t\t//System.out.println(\" + Entry closed\");\r\n\t\t\ttempJar.closeEntry();\r\n\t\t} catch (IOException ex) {\r\n\t\t\tSystem.out.println(\"Error closing jar entry: \" + ex.toString());\r\n\t\t}\r\n\t}", "private boolean extractSettingsZip(File fSettingsZip, String destDir, int index)\n {\n boolean result = false;\n try\n {\n //m_logWriter.write(\"Unzipping to destination: \"+destDir+\"\\n\");\n //m_logWriter.flush();\n \tboolean backFavFile = false;\n \tFile dest = new File(destDir);\n \tif (dest.exists()) {\n \t\tString userPath = destDir + \"/userdata/\";\n \t\tFile userFile = new File(userPath);\n \t\tString favDir = userPath + Update.FavouriteFile;\n \t\tFile favFile = new File(favDir);\n \t\tif (userFile.exists() && favFile.exists()) {\n \t\t\tCopyFile(userPath, Update.FavouriteFile, Update.pathSD);\n \t\t\tbackFavFile = true;\n \t\t}\n \t\t\n \t\tDeleteDir(destDir);\n \t}\n \telse\n \t\tdest.mkdirs();\n \t\n publishProgress(PROGRESS_EXTRACT, (int)(0.5 * index));\n // open the zip\n ZipFile zip = new ZipFile(fSettingsZip);\n int count=0;\n int zipSize = zip.size();\n Enumeration<? extends ZipEntry> entries = zip.entries();\n //while(entries.hasMoreElements())\n while (true)\n {\n if (isCancelled()) {\n \tresult = false;\n \tm_ErrorCode = 4;\n break;\n }\n\n if (m_DownloadStop)\n \tcontinue;\n \n if (!entries.hasMoreElements())\n \tbreak;\n \n // todo: update progress\n ZipEntry ze = (ZipEntry)entries.nextElement();\n count++;\n String entryName = ze.getName();\n String destFullpath = destDir+\"/\"+entryName;\n //m_logWriter.write(\"Extracting: \"+destFullpath+\"\\n\");\n File fDestPath = new File(destFullpath);\n if (ze.isDirectory())\n {\n fDestPath.mkdirs();\n publishProgress(PROGRESS_EXTRACT, (int)(0.5 * (index + count*100/zipSize)));\n continue;\n }\n fDestPath.getParentFile().mkdirs();\n\n // write file\n try {\n InputStream is = zip.getInputStream(ze);\n BufferedOutputStream bos = new BufferedOutputStream(new FileOutputStream(destFullpath));\n int n=0;\n byte buf[] = new byte[4096];\n while((n = is.read(buf, 0, 4096)) > -1)\n {\n bos.write(buf, 0, n);\n }\n // close\n is.close();\n bos.close();\n } catch(IOException ioe) {\n \tm_ErrorCode = 5;\n //m_logWriter.write(\"Could not write, error: \"+ioe.toString());\n }\n\n // update progress\n //publishProgress(PROGRESS_EXTRACT, (count*100/zipSize));\n }\n\n // close zip and bail\n zip.close();\n //m_logWriter.write(\"Successfully extracted: \"+fSettingsZip.getName()+\"\\n\");\n //m_logWriter.flush();\n if (backFavFile) {\n \t\tString userPath = destDir + \"/userdata/\";\n \t\tFile userFile = new File(userPath);\n \t\tif (!userFile.exists())\n \t\t\tuserFile.mkdirs();\n \t\t\n \t\tFile inputFile = new File(Update.pathSD + Update.FavouriteFile);\n \t\tif (inputFile.exists())\n \t\t\tCopyFile(Update.pathSD, Update.FavouriteFile, userPath);\n }\n \n result = !isCancelled();\n }\n catch(Exception e)\n {\n //Log.e(\"SettingsDownloader\", \"Error: \"+e.toString());\n result = false;\n m_ErrorCode = 6;\n }\n\n return result;\n }", "public static void unpackFiles() throws IOException {\n if(!new File(\"src/main/resources/tmp\").exists() || (Objects.requireNonNull(new File(\"src/main/resources/tmp\").list()).length != IO.sourceFiles.size())) {\n IO.unzipFiles();\n } else if(Objects.requireNonNull(new File(\"src/main/resources/tmp/ham_Calibration\").list()).length != new ZipFile(IO.sourceFiles.get(EmailTypes.HAM_CAL)).size()) {\n IO.unzipFiles(EmailTypes.HAM_CAL);\n } else if(Objects.requireNonNull(new File(\"src/main/resources/tmp/ham_Test\").list()).length != new ZipFile(IO.sourceFiles.get(EmailTypes.HAM_TEST)).size()) {\n IO.unzipFiles(EmailTypes.HAM_TEST);\n } else if(Objects.requireNonNull(new File(\"src/main/resources/tmp/ham_Train\").list()).length != new ZipFile(IO.sourceFiles.get(EmailTypes.HAM_TRAIN)).size()) {\n IO.unzipFiles(EmailTypes.HAM_TRAIN);\n } else if(Objects.requireNonNull(new File(\"src/main/resources/tmp/spam_Calibration\").list()).length != new ZipFile(IO.sourceFiles.get(EmailTypes.SPAM_CAL)).size()) {\n IO.unzipFiles(EmailTypes.SPAM_CAL);\n } else if(Objects.requireNonNull(new File(\"src/main/resources/tmp/spam_Test\").list()).length != new ZipFile(IO.sourceFiles.get(EmailTypes.SPAM_TEST)).size()) {\n IO.unzipFiles(EmailTypes.SPAM_TEST);\n } else if(Objects.requireNonNull(new File(\"src/main/resources/tmp/spam_Train\").list()).length != new ZipFile(IO.sourceFiles.get(EmailTypes.SPAM_TRAIN)).size()) {\n IO.unzipFiles(EmailTypes.SPAM_TRAIN);\n } else {\n System.out.println(\"Files already unpacked - skipping\\n\");\n }\n calculateSizes();\n }", "private static void extract (Path zipPath, Path destination)\n\t\tthrows IOException\n\t{\n\t\tif (Files.isDirectory (zipPath))\n\t\t{\n\t\t\ttry (DirectoryStream<Path> directoryStream = Files\n\t\t\t\t.newDirectoryStream (zipPath);)\n\t\t\t{\n\t\t\t\tfor (Path file : directoryStream)\n\t\t\t\t{\n\t\t\t\t\textract (file, destination);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\telse\n\t\t{\n\t\t\tPath fileOutZip = destination\n\t\t\t\t.resolve (\"./\" + zipPath.normalize ().toString ()).normalize ();\n\t\t\tFiles.createDirectories (fileOutZip.getParent ());\n\t\t\tFiles.copy (zipPath, fileOutZip, Utils.COPY_OPTION);\n\t\t}\n\t}" ]
[ "0.6780418", "0.61994785", "0.5976701", "0.58285916", "0.5818509", "0.5665493", "0.5615313", "0.55908424", "0.55845344", "0.5479195", "0.5478185", "0.5430337", "0.543019", "0.5410482", "0.54086125", "0.53719383", "0.53682286", "0.5348879", "0.53450614", "0.53167444", "0.5315642", "0.5284616", "0.5271098", "0.5261961", "0.52556235", "0.52509713", "0.52089", "0.51935035", "0.5192402", "0.5191834", "0.5188167", "0.51751995", "0.512178", "0.5113386", "0.5109738", "0.5096777", "0.5094935", "0.50695837", "0.5065385", "0.5048437", "0.50406337", "0.5036602", "0.5013135", "0.49976096", "0.49902546", "0.49785426", "0.49510136", "0.4947819", "0.49459898", "0.4940311", "0.4927149", "0.4925379", "0.49229607", "0.49176604", "0.48986876", "0.48980054", "0.4886417", "0.48731393", "0.48626223", "0.48592967", "0.48576418", "0.48468903", "0.4844719", "0.4832112", "0.48296642", "0.4820843", "0.4820836", "0.47976905", "0.479744", "0.47951156", "0.4784422", "0.47837585", "0.47758162", "0.476766", "0.47559893", "0.4754765", "0.47500855", "0.47491497", "0.47479957", "0.4743265", "0.47428688", "0.47285712", "0.4726622", "0.47244346", "0.47133327", "0.469582", "0.46891314", "0.46880454", "0.46871173", "0.46799222", "0.4671517", "0.4665831", "0.46553683", "0.4641842", "0.463756", "0.4632784", "0.46327215", "0.46325317", "0.46225536", "0.46221954" ]
0.6130817
2
Unzip given archives file to given destination.
public static void unzip(BasicShell shell, File archive, File destination) { try { shell.printOut("Extracting files from archive '" + archive.getPath() + "'."); ZipFile zipFile = new ZipFile(archive); Enumeration<? extends ZipEntry> e = zipFile.entries(); while (e.hasMoreElements() ) { ZipEntry entry = e.nextElement(); File entryFile = new File(destination, entry.getName()); if ( entry.isDirectory() ) { entryFile.mkdirs(); } else { entryFile.getParentFile().mkdirs(); InputStream entryStream = zipFile.getInputStream(entry); BufferedOutputStream outStream = new BufferedOutputStream(new FileOutputStream(entryFile)); byte[] buffer = new byte[2048]; int count = entryStream.read(buffer); while ( count > -1 ) { outStream.write(buffer, 0, count); count = entryStream.read(buffer); } outStream.flush(); outStream.close(); entryStream.close(); } shell.printOut("Extracted file '" + entry.getName() + "'.") ; } zipFile.close(); } catch (Exception e) { shell.getErrorHandler().handleError(Diagnostic.ERROR, e.getClass().getSimpleName() + ": "+ e.getMessage()); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void unZip(String fileName, String unZipTarget) throws IOException {\n this.unzipFileTargetLocation = unZipTarget;\n dirsMade = new TreeSet();\n zippy = new ZipFile(fileName);\n Enumeration all = zippy.entries();\n while (all.hasMoreElements()) {\n getFile((ZipEntry) all.nextElement());\n }\n }", "public void unarchive(String baseDir) throws MojoExecutionException {\n try (FileInputStream fis = new FileInputStream(archive);\n ZipArchiveInputStream zipIn = new ZipArchiveInputStream(fis)) {\n ZipArchiveEntry zipEnry = zipIn.getNextZipEntry();\n while (zipEnry != null) {\n // Create a file for this tarEntry\n final File destPath = new File(baseDir + File.separator + zipEnry.getName());\n if (zipEnry.isDirectory()) {\n destPath.mkdirs();\n }\n else {\n destPath.createNewFile();\n try (BufferedOutputStream bout = new BufferedOutputStream(new FileOutputStream(destPath))) {\n IOUtils.copy(zipIn, bout);\n }\n }\n zipEnry = zipIn.getNextZipEntry();\n }\n }\n catch (IOException ex) {\n throw new MojoExecutionException(\"Could not extract archive: \" + archive.getAbsolutePath(), ex);\n }\n\n // delete archive after extraction\n archive.delete();\n }", "public void unzip(String zipFilePath, String destDirectory) throws IOException {\n File destDir = new File(destDirectory);\n if (!destDir.exists()) {\n destDir.mkdir();\n }\n ZipInputStream zipInputStream = new ZipInputStream(new FileInputStream(zipFilePath));\n ZipEntry ZipEntry = zipInputStream.getNextEntry();\n\t\twhile (ZipEntry != null) {\n String fileName = ZipEntry.getName();\n\t\t\tString filePath = destDirectory + File.separator + fileName;\n if (!ZipEntry.isDirectory() && fileName.endsWith(\".jar\")) {\n extractFile(zipInputStream, filePath);\n } \n zipInputStream.closeEntry();\n ZipEntry = zipInputStream.getNextEntry();\n }\n zipInputStream.close();\n }", "public void toUnzip(String zipFile, String targetDir) {\n\n\t\tMessage message = new Message();\n\t\tmessage.what = SUCCESS;\n\n\t\tint SIZE = 4096; // buffer size: 4KB\n\t\tString strEntry; // each zip entry name\n\t\ttry {\n\t\t\tBufferedOutputStream dest = null; // buffer output stream\n\t\t\tFileInputStream fis = new FileInputStream(zipFile);\n\t\t\tZipInputStream zis = new ZipInputStream(\n\t\t\t\t\tnew BufferedInputStream(fis));\n\t\t\tZipEntry entry; // each zip entry\n\t\t\twhile ((entry = zis.getNextEntry()) != null) {\n\t\t\t\ttry {\n\t\t\t\t\tint count;\n\t\t\t\t\tbyte data[] = new byte[SIZE];\n\t\t\t\t\tstrEntry = entry.getName();\n\n\t\t\t\t\tFile entryFile = new File(targetDir + strEntry);\n\t\t\t\t\tFile entryDir = new File(entryFile.getParent());\n\t\t\t\t\tif (!entryDir.exists()) {\n\t\t\t\t\t\tentryDir.mkdirs();\n\t\t\t\t\t}\n\n\t\t\t\t\tFileOutputStream fos = new FileOutputStream(entryFile);\n\t\t\t\t\tdest = new BufferedOutputStream(fos, SIZE);\n\t\t\t\t\twhile ((count = zis.read(data, 0, SIZE)) != -1) {\n\t\t\t\t\t\tdest.write(data, 0, count);\n\n\t\t\t\t\t\tMessage msg = Message.obtain();\n\t\t\t\t\t\tmsg.what = PROGRESS;\n\t\t\t\t\t\tmsg.obj = count;\n\t\t\t\t\t\thandler.sendMessage(msg);\n\t\t\t\t\t}\n\t\t\t\t\tdest.flush();\n\t\t\t\t\tdest.close();\n\t\t\t\t} catch (Exception ex) {\n\t\t\t\t\tmessage.what = ERROR;\n\t\t\t\t\tmessage.obj = ex.getMessage();\n\t\t\t\t\tex.printStackTrace();\n\t\t\t\t}\n\t\t\t}\n\t\t\tzis.close();\n\t\t\tFile fileszipe = new File(zipFile);\n\t\t\tfileszipe.delete();\n\t\t} catch (Exception cwj) {\n\t\t\tmessage.what = ERROR;\n\t\t\tmessage.obj = cwj.getMessage();\n\t\t\tcwj.printStackTrace();\n\t\t}\n\t\thandler.sendMessage(message);\n\t}", "public static void unzipArchive(File archive, String outputDir) throws IOException {\n\t\tZipFile zipfile = new ZipFile(archive);\n\t\tfor (Enumeration<?> e = zipfile.entries(); e.hasMoreElements();) {\n\t\t\tZipEntry entry = (ZipEntry) e.nextElement();\n\t\t\tunzipEntry(zipfile, entry, outputDir);\n\t\t}\n\t}", "public static void unZip(String zipFilePath, String outPath) throws Exception {\n unZip(new FileInputStream(zipFilePath), outPath);\n }", "public void unzip(String _zipFile, String _targetLocation) {\n dirChecker(_targetLocation);\n\n try {\n FileInputStream fin = new FileInputStream(_zipFile);\n ZipInputStream zin = new ZipInputStream(fin);\n ZipEntry ze = null;\n while ((ze = zin.getNextEntry()) != null) {\n\n //create dir if required while unzipping\n if (ze.isDirectory()) {\n dirChecker(ze.getName());\n } else {\n FileOutputStream fout = new FileOutputStream(_targetLocation + ze.getName());\n for (int c = zin.read(); c != -1; c = zin.read()) {\n fout.write(c);\n }\n\n zin.closeEntry();\n fout.close();\n }\n\n }\n zin.close();\n } catch (Exception e) {\n System.out.println(e);\n }\n }", "public static void extractZip(String archiveFile, String destinationPath) {\n\t\tFile targetDir = new File(destinationPath);\n\t\ttry (InputStream is = new FileInputStream(new File(archiveFile));\n\t\t\t\tArchiveInputStream i = new ArchiveStreamFactory().createArchiveInputStream(ArchiveStreamFactory.ZIP, is);) {\n\t\t\tArchiveEntry entry = null;\n\t\t\twhile ((entry = i.getNextEntry()) != null) {\n\t\t\t\tif (!i.canReadEntryData(entry)) {\n\t\t\t\t\tlog.error(\"entry cannot be read!! \" + entry.getName());\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t\n\t\t\t\tif (entry.isDirectory()) {\n\t\t\t\t\t// ignore dirs as we don't want to extract any directories (non will exist in this case)\n\t\t\t\t} else {\n\t\t\t\t\t//no point in unzipping empty files\n\t\t\t\t\tif(entry.getSize() > 0) {\n\t\t\t\t\t\tString name = entry.getName();\n\t\t\t\t\t\t//in case the file was a child to a folder, we remove the parent name\n\t\t\t\t\t\tif(name.lastIndexOf(\"/\")!=-1) {\n\t\t\t\t\t\t\tname = name.substring(name.lastIndexOf(\"/\")+1);\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t\tFile f = new File(targetDir + \"/\" + name);\n\t\t\t\t\t\tOutputStream o = Files.newOutputStream(f.toPath());\n\t\t\t\t\t\tIOUtils.copy(i, o);\n\t\t\t\t\t\to.close();\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t} catch (Exception e) {\n\t\t\tlog.fatal(\"Exception thrown while zipping\", e);\n\t\t}\n\t}", "public void unZip(String apkFile) throws Exception \r\n\t{\r\n\t\tLog.p(tag, apkFile);\r\n\t\tFile file = new File(apkFile);\r\n\t\r\n\t\t/*\r\n\t\t * Create the Base Directory, whose name should be same as Zip file name.\r\n\t\t * All decompressed contents will be placed under this folder.\r\n\t\t */\r\n\t\tString apkFileName = file.getName();\r\n\t\t\r\n\t\tif(apkFileName.indexOf('.') != -1)\r\n\t\t\tapkFileName = apkFileName.substring(0, apkFileName.indexOf('.'));\r\n\t\t\r\n\t\tLog.d(tag, \"Folder name: \"+ apkFileName);\r\n\t\t\r\n\t\tFile extractFolder = new File((file.getParent() == null ? \"\" : file.getParent() + File.separator) + apkFileName);\r\n\t\tif(!extractFolder.exists())\r\n\t\t\textractFolder.mkdir();\r\n\t\t\r\n\t\t/*\r\n\t\t * Read zip entries.\r\n\t\t */\r\n\t\tFileInputStream fin = new FileInputStream(apkFile);\r\n\t\tZipInputStream zin = new ZipInputStream(new BufferedInputStream(fin));\r\n\t\t\r\n\t\t/*\r\n\t\t * Zip InputStream shifts its index to every Zip entry when getNextEntry() is called.\r\n\t\t * If this method returns null, Zip InputStream reaches EOF.\r\n\t\t */\r\n\t\tZipEntry ze = null;\r\n\t\tBufferedOutputStream dest;\r\n\t\t\r\n\t\twhile((ze = zin.getNextEntry()) != null)\r\n\t\t{\r\n\t\t\tLog.d(tag, \"Zip entry: \" + ze.getName() + \" Size: \"+ ze.getSize());\r\n\t\t\t/*\r\n\t\t\t * Create decompressed file for each Zip entry. A Zip entry can be a file or directory.\r\n\t\t\t * ASSUMPTION: APK Zip entry uses Unix style File seperator- \"/\"\r\n\t\t\t * \r\n\t\t\t * 1. Create the prefix Zip Entry folder, if it is not yet available\r\n\t\t\t * 2. Create the individual Zip Entry file.\r\n\t\t\t */\r\n\t\t\tString zeName = ze.getName();\r\n\t\t\tString zeFolder = zeName;\r\n\t\t\t\r\n\t\t\tif(ze.isDirectory())\r\n\t\t\t{\r\n\t\t\t\tzeName = null; // Don't create Zip Entry file\r\n\t\t\t}\r\n\t\t\telse{\r\n\t\t\t\tif(zeName.indexOf(\"/\") == -1) // Zip entry uses \"/\"\r\n\t\t\t\t\tzeFolder = null; // It is File. don't create Zip entry Folder\r\n\t\t\t\telse {\r\n\t\t\t\t\tzeFolder = zeName.substring(0, zeName.lastIndexOf(\"/\"));\r\n\t\t\t\t\tzeName = zeName.substring( zeName.lastIndexOf(\"/\") + 1);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tLog.d(tag, \"zeFolder: \"+ zeFolder +\" zeName: \"+ zeName);\r\n\t\t\t\r\n\t\t\t// Create Zip Entry Folder\r\n\t\t\tFile zeFile = extractFolder;\r\n\t\t\tif(zeFolder != null)\r\n\t\t\t{\r\n\t\t\t\tzeFile = new File(extractFolder.getPath() + File.separator + zeFolder);\r\n\t\t\t\tif(!zeFile.exists())\r\n\t\t\t\t\tzeFile.mkdirs();\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t// Create Zip Entry File\r\n\t\t\tif(zeName == null)\r\n\t\t\t\tcontinue;\r\n\t\t\t\r\n\t\t\t// Keep track of XML files, they are in Android Binary XML format\r\n\t\t\tif(zeName.endsWith(\".xml\"))\r\n\t\t\t\txmlFiles.add(zeFile.getPath() + File.separator + zeName);\r\n\t\t\t\r\n\t\t\t// Keep track of the Dex/ODex file. Need to convert to Jar\r\n\t\t\tif(zeName.endsWith(\".dex\") || zeName.endsWith(\".odex\"))\r\n\t\t\t\tdexFile = zeFile.getPath() + File.separator + zeName;\r\n\t\t\t\r\n\t\t\t// Keep track of Resources.arsc file- resources.arsc\r\n\t\t\tif(zeName.endsWith(\".arsc\"))\r\n\t\t\t\tresFile = zeFile.getPath() + File.separator + zeName;\r\n\t\t\t\r\n\t\t\t// Write Zip entry File to the disk\r\n\t\t\tint count;\r\n\t\t\tbyte data[] = new byte[BUFFER];\r\n\t\t\t\r\n\t\t\tFileOutputStream fos = new FileOutputStream(zeFile.getPath() + File.separator + zeName);\r\n\t\t\tdest = new BufferedOutputStream(fos, BUFFER);\r\n\r\n\t\t\twhile ((count = zin.read(data, 0, BUFFER)) != -1) \r\n\t\t\t{\r\n\t\t\t\tdest.write(data, 0, count);\r\n\t\t\t}\r\n\t\t\tdest.flush();\r\n\t\t\tdest.close();\r\n\t\t}\r\n\r\n\t\t// Close Zip InputStream\r\n\t\tzin.close();\r\n\t\tfin.close();\r\n\t}", "private void unzip(File zipFile, File targetDirectory) throws LpException {\n try {\n final ZipFile zip = new ZipFile(zipFile);\n if (zip.isEncrypted()) {\n throw new LpException(\"File is encrypted: {}\",\n zipFile.getName());\n }\n zip.extractAll(targetDirectory.toString());\n } catch (ZipException ex) {\n throw new LpException(\"Extraction failure: {}\",\n zipFile.getName(), ex);\n }\n }", "protected void unpack( File file, File location )\n throws MojoExecutionException, NoSuchArchiverException\n {\n String archiveExt = FileUtils.getExtension( file.getAbsolutePath() ).toLowerCase();\n\n try\n {\n UnArchiver unArchiver = this.archiverManager.getUnArchiver( archiveExt );\n\n unArchiver.setSourceFile( file );\n\n unArchiver.setDestDirectory( location );\n\n unArchiver.extract();\n }\n catch ( IOException e )\n {\n throw new MojoExecutionException( \"Error unpacking file: \" + file + \"to: \" + location, e );\n }\n catch ( ArchiverException e )\n {\n throw new MojoExecutionException( \"Error unpacking file: \" + file + \"to: \" + location, e );\n }\n }", "public static void unzip(File zipFile, File destDir) throws IOException {\n BufferedOutputStream dest = null;\n FileInputStream fis = new FileInputStream(zipFile);\n ZipInputStream zis = new ZipInputStream(new BufferedInputStream(fis));\n ZipEntry entry;\n while ((entry = zis.getNextEntry()) != null) {\n if (log.isDebugEnabled()) {\n log.debug(\"Extracting: \" + entry);\n }\n int count;\n byte[] data = new byte[BUFFER_SIZE];\n FileOutputStream fos = new FileOutputStream(destDir.getAbsolutePath() + \"/\" + entry.getName());\n dest = new BufferedOutputStream(fos, BUFFER_SIZE);\n while ((count = zis.read(data, 0, BUFFER_SIZE)) != -1) {\n dest.write(data, 0, count);\n }\n dest.flush();\n dest.close();\n }\n zis.close();\n }", "public void unzip(String zipFilePath, String destDirectory) throws IOException {\n File destDir = new File(destDirectory);\n if (!destDir.exists()) {\n destDir.mkdir();\n }\n ZipInputStream zipIn = new ZipInputStream(new FileInputStream(zipFilePath));\n ZipEntry entry = zipIn.getNextEntry();\n // iterates over entries in the zip file\n while (entry != null) {\n String filePath = destDirectory + \"\\\\\" + entry.getName();\n if (!entry.isDirectory()) {\n // if the entry is a file, extracts it\n extractFile(zipIn, filePath);\n } else {\n // if the entry is a directory, make the directory\n File dir = new File(filePath);\n dir.mkdir();\n }\n zipIn.closeEntry();\n entry = zipIn.getNextEntry();\n }\n zipIn.close();\n }", "public static void unzip(String zipFilePath, String destDirectory) throws IOException {\n File destDir = new File(destDirectory);\n if (!destDir.exists()) {\n destDir.mkdir();\n }\n ZipInputStream zipIn = new ZipInputStream(new FileInputStream(zipFilePath));\n ZipEntry entry = zipIn.getNextEntry();\n // iterates over entries in the zip file\n while (entry != null) {\n String filePath = destDirectory + File.separator + entry.getName();\n if (!entry.isDirectory()) {\n // if the entry is a file, extracts it\n extractFile(zipIn, filePath);\n } else {\n // if the entry is a directory, make the directory\n File dir = new File(filePath);\n dir.mkdir();\n }\n zipIn.closeEntry();\n entry = zipIn.getNextEntry();\n }\n zipIn.close();\n }", "public static void unzip(String zipFilePath, String destDirectory) throws IOException {\n File destDir = new File(destDirectory);\n if (!destDir.exists()) {\n destDir.mkdir();\n }\n ZipInputStream zipIn = new ZipInputStream(new FileInputStream(zipFilePath));\n ZipEntry entry = zipIn.getNextEntry();\n // iterates over entries in the zip file\n while (entry != null) {\n String filePath = destDirectory + File.separator + entry.getName();\n if (!entry.isDirectory()) {\n // if the entry is a file, extracts it\n extractFile(zipIn, filePath);\n } else {\n // if the entry is a directory, make the directory\n File dir = new File(filePath);\n dir.mkdir();\n }\n zipIn.closeEntry();\n entry = zipIn.getNextEntry();\n }\n zipIn.close();\n }", "public static void unzip(File fileToUnzip, File outputFolder)\n\t\t\tthrows IOException {\n\t\tZipFile zipFile = new ZipFile(fileToUnzip);\n\t\tEnumeration<?> enu = zipFile.entries();\n\t\tunzipingFileSize = 0;\n\t\tunzipingLen = 0;\n\t\twhile (enu.hasMoreElements())\n\t\t\tunzipingFileSize += (long)((ZipEntry) enu.nextElement()).getSize();\n\t\tenu = zipFile.entries();\n\t\twhile (enu.hasMoreElements()) {\n\t\t\tZipEntry zipEntry = (ZipEntry) enu.nextElement();\n\t\t\tString name = zipEntry.getName();\n\t\t\tFile file = new File(outputFolder, name);\n\t\t\tdownloadingFile = file;\n\t\t\tif (name.endsWith(\"/\")) {\n\t\t\t\tfile.mkdirs();\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tFile parent = file.getParentFile();\n\t\t\tif (parent != null)\n\t\t\t\tparent.mkdirs();\n\t\t\tInputStream is = zipFile.getInputStream(zipEntry);\n\t\t\tFileOutputStream fos = new FileOutputStream(file);\n\t\t\tbyte[] bytes = new byte[1024];\n\t\t\tint length;\n\t\t\twhile ((length = is.read(bytes)) >= 0) {\n\t\t\t\tfos.write(bytes, 0, length);\n\t\t\t\tunzipingLen += length;\n\t\t\t}\n\t\t\tis.close();\n\t\t\tfos.close();\n\t\t}\n\t\tzipFile.close();\n\t\tremove(new File(outputFolder, \"__MACOSX/\"));\n\t}", "private void unzipDownloadedFile(String zipFile) throws ZipException, IOException{\n\t int BUFFER = 2048;\n\t \n\t // get zip file\n\t File file = new File(zipFile);\n\t ZipFile zip = new ZipFile(file);\n\t \n\t // unzip to directory of the same name\n\t // When sip is a directory, this gets two folders\n\t //String newPath = zipFile.substring(0, zipFile.length() - 4);\n\t //new File(newPath).mkdir();\n\t \n\t // unzip to parent directory of the zip file\n\t // This is assuming zip if of a directory\n\t String newPath = file.getParent();\n\t \n\t // Process each entry\n\t Enumeration<? extends ZipEntry> zipFileEntries = zip.entries();\n\t while (zipFileEntries.hasMoreElements())\n\t {\n\t // grab a zip file entry\n\t ZipEntry entry = (ZipEntry) zipFileEntries.nextElement();\n\t String currentEntry = entry.getName();\n\t File destFile = new File(newPath, currentEntry);\n\t File destinationParent = destFile.getParentFile();\n\n\t // create the parent directory structure if needed\n\t destinationParent.mkdirs();\n\n\t if (!entry.isDirectory())\n\t {\n\t BufferedInputStream is = new BufferedInputStream(zip.getInputStream(entry));\n\t int currentByte;\n\t // establish buffer for writing file\n\t byte data[] = new byte[BUFFER];\n\n\t // write the current file to disk\n\t FileOutputStream fos = new FileOutputStream(destFile);\n\t BufferedOutputStream dest = new BufferedOutputStream(fos,\n\t BUFFER);\n\n\t // read and write until last byte is encountered\n\t while ((currentByte = is.read(data, 0, BUFFER)) != -1) {\n\t dest.write(data, 0, currentByte);\n\t }\n\t dest.flush();\n\t dest.close();\n\t is.close();\n\t }\n\n\t if (currentEntry.endsWith(\".zip\"))\n\t {\n\t // found a zip file, try to open\n\t \tunzipDownloadedFile(destFile.getAbsolutePath());\n\t }\n\t }\n\t zip.close();\n\t}", "public static int unzip(String srcZipFile, String specifiedFile, String targetDirectory, String passwd) {\n File srcFile = new File(srcZipFile);\n if (!srcFile.exists() || srcFile.isDirectory()) {\n System.out.println(\"[JZip] Source file does not exist or correct.\");\n return SOURCE_FILE_ERROR;\n }\n \n // Check target directory\n File destDir = new File(targetDirectory);\n destDir.mkdir();\n if (!destDir.isDirectory()) {\n System.out.println(\"[JZip] targetDirectory should be directory.\");\n return TARGET_DIR_ERROR;\n }\n \n // Init and set password\n ZipFile zipFile;\n try {\n zipFile = new ZipFile(srcZipFile);\n \n if (zipFile.isEncrypted()) {\n if (passwd != null && !passwd.isEmpty()) {\n zipFile.setPassword(passwd.toCharArray());\n }\n else {\n System.out.println(\"[JZip] No password indicated for a password-protected file.\");\n return PASSWORD_NOT_FOUND;\n }\n }\n else {\n System.out.println(\"[JZip] This zip file should has password but it doesn't.\");\n return SOURCE_SHOULD_HAS_PASSWORD;\n }\n }\n catch (ZipException e) {\n System.out.println(\"[JZip] Create zip object or set password causes cexception.\");\n return ZIP_INITIAL_ERROR;\n }\n \n // Check content and extract\n String targetFile = targetDirectory + (targetDirectory.endsWith(File.separator) ? \"\" : File.separator) + specifiedFile;\n try {\n \tList<?> fileHeaderList = zipFile.getFileHeaders();\n for (int i = 0; i < fileHeaderList.size(); i++) {\n \tFileHeader fileHeader = (FileHeader)fileHeaderList.get(i);\n \tif (fileHeader != null && fileHeader.getFileName().equals(specifiedFile)) {\n \t\tzipFile.extractFile(specifiedFile, targetDirectory);\n \t\tbreak;\n \t}\n }\n if (!new File(targetFile).isFile()) {\n \tSystem.out.println(\"[JZip] Input zip file does not have correct content.\");\n \treturn SOURCE_CONTENT_ERROR;\n }\n }\n catch (ZipException e) {\n System.out.println(\"[JZip] Extract zip file causes exception.\");\n // It will extract a zero-size file when password is incorrect, should be deleted\n new File(targetFile).delete();\n return EXTRACT_FILE_ERROR;\n }\n \n return NO_ERROR;\n }", "public File extractTo (File destination) throws IOException\n\t{\n\t\ttry (DirectoryStream<Path> directoryStream = Files\n\t\t\t.newDirectoryStream (zipfs.getPath (\"/\"));)\n\t\t{\n\t\t\tfor (Path file : directoryStream)\n\t\t\t{\n\t\t\t\textract (file, destination.toPath ());\n\t\t\t}\n\t\t}\n\t\treturn destination;\n\t}", "public static boolean UnzipFile(ZipFile zf, String filepathinzip, File fileinfiledir) {\r\n BufferedOutputStream Output_fos = null;\r\n BufferedInputStream bufbr = null;\r\n try {\r\n ZipEntry ze = zf.getEntry(filepathinzip);\r\n if (ze != null) {\r\n BufferedOutputStream Output_fos2 = new BufferedOutputStream(new FileOutputStream(fileinfiledir));\r\n try {\r\n byte[] buf = new byte[65536];\r\n BufferedInputStream bufbr2 = new BufferedInputStream(zf.getInputStream(ze));\r\n while (true) {\r\n try {\r\n int readlen = bufbr2.read(buf);\r\n if (readlen < 0) {\r\n break;\r\n }\r\n Output_fos2.write(buf, 0, readlen);\r\n } catch (Exception e) {\r\n e = e;\r\n bufbr = bufbr2;\r\n Output_fos = Output_fos2;\r\n } catch (Throwable th) {\r\n th = th;\r\n bufbr = bufbr2;\r\n Output_fos = Output_fos2;\r\n if (Output_fos != null) {\r\n try {\r\n Output_fos.close();\r\n if (bufbr != null) {\r\n try {\r\n bufbr.close();\r\n } catch (IOException e2) {\r\n e2.printStackTrace();\r\n return false;\r\n }\r\n }\r\n } catch (IOException e3) {\r\n e3.printStackTrace();\r\n if (bufbr == null) {\r\n return false;\r\n }\r\n try {\r\n bufbr.close();\r\n return false;\r\n } catch (IOException e4) {\r\n e4.printStackTrace();\r\n return false;\r\n }\r\n } finally {\r\n if (bufbr != null) {\r\n try {\r\n bufbr.close();\r\n } catch (IOException e5) {\r\n e5.printStackTrace();\r\n return false;\r\n }\r\n }\r\n }\r\n }\r\n throw th;\r\n }\r\n }\r\n if (Output_fos2 != null) {\r\n try {\r\n Output_fos2.close();\r\n if (bufbr2 != null) {\r\n try {\r\n bufbr2.close();\r\n } catch (IOException e6) {\r\n e6.printStackTrace();\r\n BufferedInputStream bufferedInputStream = bufbr2;\r\n BufferedOutputStream bufferedOutputStream = Output_fos2;\r\n return false;\r\n }\r\n }\r\n } catch (IOException e7) {\r\n e7.printStackTrace();\r\n if (bufbr2 != null) {\r\n try {\r\n bufbr2.close();\r\n } catch (IOException e8) {\r\n e8.printStackTrace();\r\n BufferedInputStream bufferedInputStream2 = bufbr2;\r\n BufferedOutputStream bufferedOutputStream2 = Output_fos2;\r\n return false;\r\n }\r\n }\r\n BufferedInputStream bufferedInputStream3 = bufbr2;\r\n BufferedOutputStream bufferedOutputStream3 = Output_fos2;\r\n return false;\r\n } finally {\r\n if (bufbr2 != null) {\r\n try {\r\n bufbr2.close();\r\n } catch (IOException e9) {\r\n e9.printStackTrace();\r\n BufferedInputStream bufferedInputStream4 = bufbr2;\r\n BufferedOutputStream bufferedOutputStream4 = Output_fos2;\r\n return false;\r\n }\r\n }\r\n }\r\n }\r\n BufferedInputStream bufferedInputStream5 = bufbr2;\r\n BufferedOutputStream bufferedOutputStream5 = Output_fos2;\r\n return true;\r\n } catch (Exception e10) {\r\n e = e10;\r\n Output_fos = Output_fos2;\r\n try {\r\n e.printStackTrace();\r\n if (Output_fos == null) {\r\n return false;\r\n }\r\n try {\r\n Output_fos.close();\r\n if (bufbr == null) {\r\n return false;\r\n }\r\n try {\r\n bufbr.close();\r\n return false;\r\n } catch (IOException e11) {\r\n e11.printStackTrace();\r\n return false;\r\n }\r\n } catch (IOException e12) {\r\n e12.printStackTrace();\r\n if (bufbr == null) {\r\n return false;\r\n }\r\n try {\r\n bufbr.close();\r\n return false;\r\n } catch (IOException e13) {\r\n e13.printStackTrace();\r\n return false;\r\n }\r\n } finally {\r\n if (bufbr != null) {\r\n try {\r\n bufbr.close();\r\n } catch (IOException e14) {\r\n e14.printStackTrace();\r\n return false;\r\n }\r\n }\r\n }\r\n } catch (Throwable th2) {\r\n th = th2;\r\n if (Output_fos != null) {\r\n }\r\n throw th;\r\n }\r\n } catch (Throwable th3) {\r\n th = th3;\r\n Output_fos = Output_fos2;\r\n if (Output_fos != null) {\r\n }\r\n throw th;\r\n }\r\n } else if (Output_fos == null) {\r\n return false;\r\n } else {\r\n try {\r\n Output_fos.close();\r\n if (bufbr == null) {\r\n return false;\r\n }\r\n try {\r\n bufbr.close();\r\n return false;\r\n } catch (IOException e15) {\r\n e15.printStackTrace();\r\n return false;\r\n }\r\n } catch (IOException e16) {\r\n e16.printStackTrace();\r\n if (bufbr == null) {\r\n return false;\r\n }\r\n try {\r\n bufbr.close();\r\n return false;\r\n } catch (IOException e17) {\r\n e17.printStackTrace();\r\n return false;\r\n }\r\n } finally {\r\n if (bufbr != null) {\r\n try {\r\n bufbr.close();\r\n } catch (IOException e18) {\r\n e18.printStackTrace();\r\n return false;\r\n }\r\n }\r\n }\r\n }\r\n } catch (Exception e19) {\r\n e = e19;\r\n }\r\n }", "public static final void unzip(String zipfileName, String baseOutputDir) {\r\n Enumeration entries;\r\n ZipFile zipFile;\r\n try {\r\n zipFile = new ZipFile(zipfileName);\r\n entries = zipFile.entries();\r\n while (entries.hasMoreElements()) {\r\n ZipEntry entry = (ZipEntry) entries.nextElement();\r\n String entryName = entry.getName();\r\n String theName = baseOutputDir + '/' + entryName;\r\n if (entry.isDirectory()) {\r\n // Assume directories are stored parents first then children.\r\n System.out.println(\"Extracting directory: \" + entry.getName());\r\n // This is not robust, just for demonstration purposes.\r\n (new File(theName)).mkdirs();\r\n continue;\r\n }\r\n //(new File(theName)).mkdirs();\r\n forceParentDirectories(theName);\r\n System.out.println(\"Extracting file: \" + theName);\r\n copyInputStream(zipFile.getInputStream(entry), new BufferedOutputStream(new FileOutputStream(theName)));\r\n }\r\n zipFile.close();\r\n } catch (Exception ioe) {\r\n System.err.println(\"Unhandled exception:\");\r\n ioe.printStackTrace();\r\n return;\r\n }\r\n }", "public static File unpackArchive(File theFile, File targetDir)\n\t\t\tthrows IOException {\n\t\tif (!theFile.exists()) {\n\t\t\tthrow new IOException(theFile.getAbsolutePath() + \" does not exist\");\n\t\t}\n\t\tif (!buildDirectory(targetDir)) {\n\t\t\tthrow new IOException(\"Could not create directory: \" + targetDir);\n\t\t}\n\t\tZipFile zipFile = new ZipFile(theFile);\n\t\tfor (Enumeration<? extends ZipEntry> entries = zipFile.entries(); entries.hasMoreElements();) {\n\t\t\tZipEntry entry = (ZipEntry) entries.nextElement();\n\t\t\tFile file = new File(targetDir, File.separator + entry.getName());\n\t\t\tif (!buildDirectory(file.getParentFile())) {\n\t\t\t\tthrow new IOException(\"Could not create directory: \"\n\t\t\t\t\t\t+ file.getParentFile());\n\t\t\t}\n\t\t\tif (!entry.isDirectory()) {\n\t\t\t\tcopyInputStream(zipFile.getInputStream(entry),\n\t\t\t\t\t\tnew BufferedOutputStream(new FileOutputStream(file)));\n\t\t\t} else {\n\t\t\t\tif (!buildDirectory(file)) {\n\t\t\t\t\tthrow new IOException(\"Could not create directory: \" + file);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tzipFile.close();\n\t\treturn theFile;\n\t}", "private void unCompress()\n\t{\n\t\ttry\n\t\t{\n\t\t\tbyte[] buffer = new byte[4096];\n\t\t\tint bytesIn;\n\t\t\tZipFile rfoFile = new ZipFile(path + fileName);\n\t\t\tEnumeration<? extends ZipEntry> allFiles = rfoFile.entries();\n\t\t\twhile(allFiles.hasMoreElements())\n\t\t\t{\n\t\t\t\tZipEntry ze = (ZipEntry)allFiles.nextElement();\n\t\t\t\tInputStream is = rfoFile.getInputStream(ze);\n\t\t\t\tString fName = processSeparators(ze.getName());\n\t\t\t\tFile element = new File(tempDir + fName);\n\t\t\t\torg.reprap.Main.ftd.add(element);\n\t\t\t\tFileOutputStream os = new FileOutputStream(element);\n\t\t\t\twhile((bytesIn = is.read(buffer)) != -1) \n\t\t\t\t\tos.write(buffer, 0, bytesIn);\n\t\t\t\tos.close();\n\t\t\t}\n\t\t} catch (Exception e)\n\t\t{\n\t\t\tDebug.e(\"RFO.unCompress(): \" + e);\n\t\t}\n\t}", "static void unzip(String zipFilePath, String destDirectory, boolean recursive, boolean teacherZip) throws IOException {\n\n if (students == null) {\n students = new ArrayList<Student>();\n }\n\n ZipInputStream zipIn = null;\n\n try {\n zipIn = new ZipInputStream(new FileInputStream(zipFilePath));\n ZipEntry entry = zipIn.getNextEntry();\n\n // iterates over entries in the zip file\n while (entry != null) {\n createFiles(destDirectory, zipIn, entry, recursive);\n\n zipIn.closeEntry();\n entry = zipIn.getNextEntry();\n }\n\n } catch (IOException e) {\n System.err.println(e.getMessage());\n Errors.setUnzipperError(true);\n\n } finally {\n if (zipIn != null) {\n zipIn.close();\n }\n }\n }", "void onUnzipCompleted(String output);", "public static void extractZipArchive(byte[] zipFileData, String directory) throws IOException {\n new File(directory).mkdirs();\n // get the zip file content\n ZipInputStream inputStream = new ZipInputStream(new ByteArrayInputStream(zipFileData));\n // get the zipped file list entry\n ZipEntry zipEntry = inputStream.getNextEntry();\n byte[] buffer = new byte[BUFFER_SIZE];\n while (zipEntry != null) {\n if (!zipEntry.isDirectory()) {\n String fileName = zipEntry.getName();\n File newFile = new File(directory + File.separator + fileName);\n new File(newFile.getParent()).mkdirs();\n\n FileOutputStream fos = new FileOutputStream(newFile);\n\n int len;\n while ((len = inputStream.read(buffer)) > 0) {\n fos.write(buffer, 0, len);\n }\n\n fos.close();\n\n if (LOG.isDebugEnabled()) {\n LOG.debug(\"File unzipped: \" + newFile.getAbsoluteFile());\n }\n }\n zipEntry = inputStream.getNextEntry();\n }\n inputStream.closeEntry();\n inputStream.close();\n }", "public static void unzip(File targetDir,File zipFile) throws ZipException, IOException{\n\t\tZipFile zip = new ZipFile(zipFile);\n\t\t\n\t\t@SuppressWarnings(\"unchecked\")\n\t\tEnumeration<ZipEntry> z = (Enumeration<ZipEntry>) zip.entries();\n\t\twhile(z.hasMoreElements()){\n\t\t\tZipEntry entry = z.nextElement();\n\t\t\tFile f = new File(targetDir, entry.getName());\n\t\t\tif(f.isDirectory()){\n\t\t\t\tif(!f.exists())\n\t\t\t\t\tf.mkdirs();\n\t\t\t}else{\n\t\t\t\tf.getParentFile().mkdirs();\n\t\t\t\tInputStream in = zip.getInputStream(entry);\n\t\t\t\tif(f.getPath().contains(\"__MACOSX\")) continue;\n\t\t\t\tBufferedOutputStream out = new BufferedOutputStream(new FileOutputStream(f));\n\t\t\t\tIOUtils.copy(in, out);\n\t\t\t\tin.close();\n\t\t\t\tout.flush();\n\t\t\t\tout.close();\n\t\t\t}\n\t\t}\n\t\tzip.close();\n\t}", "public Result unzip() {\n MultipartFormData<File> body = request().body().asMultipartFormData();\n MultipartFormData.FilePart<File> fileInput = body.getFile(\"inputFile\");\n String filename = fileInput.getFilename();\n if (fileInput != null) {\n File file = (File) fileInput.getFile();\n File nf = new File(ZIP_URL + filename);\n boolean rst = file.renameTo(nf);\n String destDir = ZipUtils.unZip(ZIP_URL + filename, ZIP_URL);\n File dir = new File(ZIP_URL);\n String[] dirList = dir.list();\n return ok(afterUpload.render(Arrays.asList(dirList)));\n } else {\n return badRequest(\"error\");\n }\n }", "public static boolean unZipFile(String _location, String _zipFile) {\n boolean unzipped = false;\n try {\n FileInputStream fin = new FileInputStream(_location + \"/\" + _zipFile);\n ZipInputStream zin = new ZipInputStream(fin);\n ZipEntry ze;\n while ((ze = zin.getNextEntry()) != null) {\n if (ze.isDirectory()) {\n File f = new File(_location + \"/\" + ze.getName());\n if(!f.isDirectory()) {\n f.mkdirs();\n }\n } else {\n FileOutputStream fOut = new FileOutputStream(_location + \"/\" + ze.getName());\n BufferedOutputStream bufOut = new BufferedOutputStream(fOut);\n byte[] buffer = new byte[1024];\n int read;\n while ((read = zin.read(buffer)) != -1) {\n bufOut.write(buffer, 0, read);\n }\n bufOut.close();\n zin.closeEntry();\n fOut.close();\n }\n }\n zin.close();\n unzipped = true;\n } catch (Exception e) {\n writeLog(LOG_LEVEL.ERROR, \"Unzipping failed - \" + e.getLocalizedMessage());\n }\n return unzipped;\n }", "private static void unzip(EmailTypes collection) {\n File dir = new File(destDir);\n // create output directory if it doesn't exist\n if(!dir.exists()) {\n dir.mkdirs();\n }\n FileInputStream fis;\n //buffer for read and write data to file\n byte[] buffer = new byte[1024];\n try {\n fis = new FileInputStream(sourceFiles.get(collection).getPath());\n ZipInputStream is = new ZipInputStream(fis);\n ZipEntry zipEntry = is.getNextEntry();\n System.out.println(\"Unzipping set: \" + collection.getCollection() + \".\");\n while(zipEntry != null){\n String fileName = zipEntry.getName();\n File newFile = new File(unpackedFiles.get(collection) + File.separator + fileName);\n new File(newFile.getParent()).mkdirs();\n FileOutputStream fos = new FileOutputStream(newFile);\n int len;\n while ((len = is.read(buffer)) > 0) {\n fos.write(buffer, 0, len);\n }\n fos.close();\n is.closeEntry();\n zipEntry = is.getNextEntry();\n }\n is.closeEntry();\n is.close();\n fis.close();\n } catch (IOException e) {\n e.printStackTrace();\n }\n }", "private static void extract (Path zipPath, Path destination)\n\t\tthrows IOException\n\t{\n\t\tif (Files.isDirectory (zipPath))\n\t\t{\n\t\t\ttry (DirectoryStream<Path> directoryStream = Files\n\t\t\t\t.newDirectoryStream (zipPath);)\n\t\t\t{\n\t\t\t\tfor (Path file : directoryStream)\n\t\t\t\t{\n\t\t\t\t\textract (file, destination);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\telse\n\t\t{\n\t\t\tPath fileOutZip = destination\n\t\t\t\t.resolve (\"./\" + zipPath.normalize ().toString ()).normalize ();\n\t\t\tFiles.createDirectories (fileOutZip.getParent ());\n\t\t\tFiles.copy (zipPath, fileOutZip, Utils.COPY_OPTION);\n\t\t}\n\t}", "private static void extractFile(ZipInputStream inStreamZip, FSDataOutputStream destDirectory) throws IOException {\n BufferedOutputStream bos = new BufferedOutputStream(destDirectory);\n byte[] bytesIn = new byte[BUFFER_SIZE];\n int read = 0;\n while ((read = inStreamZip.read(bytesIn)) != -1) {\n bos.write(bytesIn, 0, read);\n }\n bos.close();\n }", "public void extractFile(ZipModel zipModel, String outputPath, UnzipParameters unzipParameters, String newFileName,\r\n ProgressMonitor progressMonitor, boolean runInThread, char[] password) throws ZipException {\r\n if (zipModel == null) {\r\n throw new ZipException(\"input zipModel is null\");\r\n }\r\n\r\n if (!Zip4jUtil.checkOutputFolder(outputPath)) {\r\n throw new ZipException(\"Invalid output path\");\r\n }\r\n\r\n if (this == null) {\r\n throw new ZipException(\"invalid file header\");\r\n }\r\n\r\n UnzipEngine unzipEngine = new UnzipEngine(zipModel, progressMonitor, password);\r\n unzipEngine.extractFile(this, outputPath, newFileName, runInThread, unzipParameters);\r\n }", "public static void unzip(InputStream is, String outdir) throws IOException {\r\n\r\n\t\tbyte[] buffer = new byte[buffSize];\r\n\r\n\t\tjava.util.zip.ZipInputStream zis = new java.util.zip.ZipInputStream(new BufferedInputStream(is));\r\n\r\n\t\tjava.util.zip.ZipEntry entry;\r\n\r\n\t\ttry {\r\n\t\t\twhile ((entry = zis.getNextEntry()) != null) {\r\n\r\n\t\t\t\tFile of = new File(outdir + File.separator + entry.getName());\r\n\r\n\t\t\t\tif (entry.isDirectory()) {\r\n\t\t\t\t\tof.mkdirs();\r\n\t\t\t\t\tcontinue;\r\n\t\t\t\t} else {\r\n\t\t\t\t\tFile xx = new File(of.getParent());\r\n\t\t\t\t\tif (!xx.exists()) {\r\n\t\t\t\t\t\tStack<String> todo = new Stack<String>();\r\n\t\t\t\t\t\tdo {\r\n\t\t\t\t\t\t\ttodo.push(xx.getAbsolutePath());\r\n\t\t\t\t\t\t\txx = new File(xx.getParent());\r\n\t\t\t\t\t\t} while (!xx.exists());\r\n\t\t\t\t\t\twhile (todo.size() > 0) {\r\n\t\t\t\t\t\t\txx = new File(todo.pop());\r\n\t\t\t\t\t\t\tif (!xx.exists()) {\r\n\t\t\t\t\t\t\t\txx.mkdirs();\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\r\n\t\t\t\tBufferedOutputStream bos = new BufferedOutputStream(new FileOutputStream(of), buffer.length);\r\n\r\n\t\t\t\tcpio(new BufferedInputStream(zis), bos, \"unzip:\" + entry.getName());\r\n\r\n\t\t\t\tbos.flush();\r\n\t\t\t\tbos.close();\r\n\t\t\t}\r\n\t\t} catch (IllegalArgumentException e) {\r\n\t\t\t// problem with chars in entry name likely\r\n\t\t}\r\n\t\tzis.close();\r\n\r\n\t}", "private boolean unZipFileFromUrl(final String zipUrl, final File unzipFolder)\n {\n // cleanup left over files\n FileUtils.deleteFile(unzipFolder);\n FileUtils.createDirectories(unzipFolder);\n\n final URL downloadUrl;\n\n try {\n downloadUrl = new URL(zipUrl);\n\n } catch (final MalformedURLException e) {\n LOGGER.error(String.format(FishStatJFileConstants.DOWNLOAD_ERROR, zipUrl), e);\n return false;\n }\n\n try\n (InputStream urlInputStream = downloadUrl.openStream();\n ZipInputStream zipStream = new ZipInputStream(urlInputStream)) {\n\n // iterate through the files of the zip input stream\n while (true) {\n final ZipEntry entry = zipStream.getNextEntry();\n\n if (entry == null)\n break;\n\n // open streams for writing files to disk\n try\n (OutputStream fileOut = Files.newOutputStream(new File(unzipFolder, entry.getName()).toPath());\n BufferedOutputStream bufferedFileOut = new BufferedOutputStream(fileOut, FishStatJFileConstants.ZIP_EXTRACT_BUFFER_SIZE)) {\n\n // write the file from the stream to disk\n final byte[] fileOutBuffer = new byte[FishStatJFileConstants.ZIP_EXTRACT_BUFFER_SIZE];\n\n while (true) {\n final int readByteCount = zipStream.read(fileOutBuffer, 0, fileOutBuffer.length);\n\n if (readByteCount == -1)\n break;\n else\n bufferedFileOut.write(fileOutBuffer, 0, readByteCount);\n }\n\n bufferedFileOut.flush();\n }\n }\n\n return true;\n\n } catch (final ZipException e) {\n LOGGER.error(String.format(FishStatJFileConstants.UNZIP_ERROR, zipUrl), e);\n\n } catch (final IOException e) {\n LOGGER.error(String.format(FishStatJFileConstants.DOWNLOAD_ERROR, zipUrl), e);\n }\n\n return false;\n }", "public static void extractAndSaveFile(ZipInputStream zip,\n \t\t\tFileOutputStream destinationFile) throws IOException {\n \t\tByteArrayOutputStream out = readZipEntry(zip);\n \t\tdestinationFile.write(out.toByteArray());\n \t\tout.close();\n \t\tdestinationFile.close();\n \t}", "public static void unzip(File archive, File directory) throws IOException\n {\n ZipFile zip = null;\n\n if (directory.exists()) {\n if (!directory.isDirectory()) {\n throw new IOException(\"Directory is not a directory: \" + directory);\n }\n }\n else {\n if (!directory.mkdirs()) {\n throw new IOException(\"Could not create directory: \" + directory);\n }\n }\n try {\n zip = new ZipFile(archive);\n for (Enumeration entries = zip.entries(); entries.hasMoreElements();) {\n ZipEntry entry = (ZipEntry)entries.nextElement();\n File f = new File(directory, entry.getName());\n if (entry.isDirectory()) {\n if (!f.mkdirs()) {\n throw new IOException(\"Could not create directory: \" + f);\n }\n }\n else {\n if (zip != null) {\n InputStream is = zip.getInputStream(entry);\n OutputStream os = new BufferedOutputStream(new FileOutputStream(f));\n IOUtils.copy(is, os);\n IOUtils.closeQuietly(is);\n IOUtils.closeQuietly(os);\n }\n }\n }\n }\n finally {\n if (zip != null) {\n zip.close();\n }\n }\n }", "public void unzip(File f) throws Exception {\r\n String destDir = workplace + \"/temp/\";\r\n File tmp = new File(destDir);\r\n if(!tmp.exists())tmp.mkdir();\r\n byte b[] = new byte [1024];\r\n int length;\r\n \r\n ZipFile zipFile;\r\n zipFile = new ZipFile(f);\r\n Enumeration enumeration = zipFile.entries();\r\n ZipEntry zipEntry = null ;\r\n OutputStream outputStream = null;\r\n InputStream inputStream = null;\r\n while (enumeration.hasMoreElements()) {\r\n zipEntry = (ZipEntry) enumeration.nextElement();\r\n File loadFile = new File(destDir + zipEntry.getName());\r\n if (zipEntry.isDirectory()) {\r\n // 这段都可以不要,因为每次都貌似从最底层开始遍历的\r\n loadFile.mkdirs();\r\n }else{\r\n if (!loadFile.getParentFile().exists())\r\n loadFile.getParentFile().mkdirs();\r\n outputStream = new FileOutputStream(loadFile);\r\n inputStream = zipFile.getInputStream(zipEntry);\r\n while ((length = inputStream.read(b)) > 0)\r\n outputStream.write(b, 0, length);\r\n }\r\n }\r\n outputStream.flush();\r\n outputStream.close();\r\n inputStream.close();\r\n }", "public StreamUnzipper(InputStream zipStream, File destDir)\n {\n if (zipStream == null)\n throw new IllegalArgumentException(\"zip stream cannot be null\");\n this.zis = new ZipInputStream(zipStream);\n this.destDir = destDir;\n }", "public static void unzip(Context context, InputStream zipFile) {\n try (BufferedInputStream bis = new BufferedInputStream(zipFile)) {\n try (ZipInputStream zis = new ZipInputStream(bis)) {\n ZipEntry ze;\n int count;\n byte[] buffer = new byte[DEFAULT_BUFFER_SIZE];\n while ((ze = zis.getNextEntry()) != null) {\n try (FileOutputStream fout = context.openFileOutput(ze.getName(), Context.MODE_PRIVATE)) {\n while ((count = zis.read(buffer)) != -1)\n fout.write(buffer, 0, count);\n }\n }\n }\n } catch (IOException | NullPointerException ex) {\n Log.v(MainActivity.TAG, \"Zip not opened.\\n\"+ex.getMessage());\n }\n }", "public static void extractFile(String zipFilePath, String inZipFilePath, String destDirectory) throws IOException {\n ZipInputStream zipIn = new ZipInputStream(new FileInputStream(zipFilePath));\n ZipEntry entry = zipIn.getNextEntry();\n // iterates over entries in the zip file\n while (entry != null) {\n if (!entry.isDirectory() && inZipFilePath.equals(entry.getName())) {\n String filePath = entry.getName();\n int separatorIndex = filePath.lastIndexOf(File.separator);\n if (separatorIndex > -1)\n filePath = filePath.substring(separatorIndex + 1, filePath.length());\n filePath = destDirectory + File.separator + filePath;\n extractFile(zipIn, filePath);\n break;\n }\n zipIn.closeEntry();\n entry = zipIn.getNextEntry();\n }\n zipIn.close();\n }", "@Override\r\n public void extractArchive(ArchiveExtractor decompressor) throws ArcException {\r\n\r\n\tString fileName = ManipString.substringAfterFirst(this.idSource, \"_\");\r\n\r\n\tboolean uncompressInProgress=false;\r\n\tFile dir = new File(this.archiveChargement + \".dir\");\r\n\tif (!dir.exists()) {\r\n\t\ttry {\r\n\t\t if (dir.mkdir())\r\n\t\t {\r\n\t\t \tStaticLoggerDispatcher.debug(LOGGER,\"$$\"+Thread.currentThread().getId()+\" is decompressing \"+dir.getAbsolutePath());\r\n\t\t \tdecompressor.extract(this.archiveChargement);\r\n\t\t \tuncompressInProgress=true;\r\n\t\t }\r\n\t\t}\r\n\t\t catch (Exception ex)\r\n\t\t{\r\n\t\t\t throw new ArcException(ex, ArcExceptionMessage.FILE_EXTRACT_FAILED, this.archiveChargement).logFullException();\r\n\t\t}\r\n\t}\r\n\t\r\n\tif (!uncompressInProgress) {\r\n\t\t\t// check if file exists\r\n\t File toRead = new File(dir + File.separator + ManipString.redoEntryName(fileName));\r\n\t while (!toRead.exists()) {\r\n\t \ttry {\r\n\t\t\t\tThread.sleep(MILLISECOND_UNCOMPRESSION_CHECK_INTERVAL);\r\n\t\t\t} catch (InterruptedException e) {\r\n\t\t\t\tThread.currentThread().interrupt();\r\n\t\t\t StaticLoggerDispatcher.error(LOGGER, \"Error in thread sleep extractArchive()\");\r\n\t\t\t}\r\n\t \ttoRead = new File(dir + File.separator + ManipString.redoEntryName(fileName));\r\n\t }\r\n\t}\r\n\r\n\r\n\t\r\n }", "public void extractFile(ZipModel zipModel, String outputPath, UnzipParameters unzipParameters,\r\n ProgressMonitor progressMonitor, boolean runInThread, char[] password) throws ZipException {\r\n extractFile(zipModel, outputPath, unzipParameters, null, progressMonitor, runInThread, password);\r\n }", "public static boolean unzip(String unZipFile, String saveFilePath) {\n boolean succeed = true;\n ZipInputStream zin = null;\n ZipEntry entry;\n try {\n // zip file path\n File olddirec = new File(unZipFile);\n zin = new ZipInputStream(new FileInputStream(unZipFile));\n // iterate ZipEntry in zip\n while ((entry = zin.getNextEntry()) != null) {\n // if folder,create it\n if (entry.isDirectory()) {\n File directory = new File(olddirec.getParent(),\n entry.getName());\n if (!directory.exists()) {\n if (!directory.mkdirs()) {\n System.out.println(\"Create foler in \"\n + directory.getAbsoluteFile() + \" failed\");\n }\n }\n zin.closeEntry();\n }\n // if file,unzip it\n if (!entry.isDirectory()) {\n File myFile = new File(saveFilePath);\n FileOutputStream fout = null;\n DataOutputStream dout = null;\n try {\n fout = new FileOutputStream(myFile);\n dout = new DataOutputStream(fout);\n byte[] b = new byte[1024];\n int len = 0;\n while ((len = zin.read(b)) != -1) {\n dout.write(b, 0, len);\n }\n } finally {\n if (dout != null) {\n try {\n dout.close();\n } catch (Exception e) {\n e.printStackTrace();\n }\n }\n if (fout != null) {\n try {\n fout.close();\n } catch (Exception e) {\n e.printStackTrace();\n }\n }\n }\n zin.closeEntry();\n }\n }\n } catch (IOException e) {\n e.printStackTrace();\n succeed = false;\n System.out.println(e);\n } finally {\n if (null != zin) {\n try {\n zin.close();\n } catch (IOException e) {\n e.printStackTrace();\n }\n }\n }\n if (succeed)\n System.out.println(\"File unzipped successfully!\");\n else\n System.out.println(\"File unzipped with failure!\");\n return succeed;\n }", "public static List<File> unjar(InputStream in, File dest)\r\n\t\t\tthrows IOException {\r\n\r\n\t\tfinal List<File> back = new ArrayList<File>();\r\n\t\tif (!dest.exists()) {\r\n\t\t\tdest.mkdirs();\r\n\t\t}\r\n\r\n\t\tif (!dest.isDirectory()) {\r\n\t\t\tthrow new IOException(\"Destination must be a directory.\");\r\n\t\t}\r\n\r\n\t\tJarInputStream jin = new JarInputStream(in);\r\n\t\tfinal byte[] buffer = new byte[1024];\r\n\t\tZipEntry entry = jin.getNextEntry();\r\n\t\twhile (entry != null) {\r\n\r\n\t\t\tString fileName = entry.getName();\r\n\t\t\tif (fileName.charAt(fileName.length() - 1) == '/') {\r\n\t\t\t\tfileName = fileName.substring(0, fileName.length() - 1);\r\n\t\t\t}\r\n\r\n\t\t\tif (fileName.charAt(0) == '/') {\r\n\t\t\t\tfileName = fileName.substring(1);\r\n\t\t\t}\r\n\r\n\t\t\tif (File.separatorChar != '/') {\r\n\t\t\t\tfileName = fileName.replace('/', File.separatorChar);\r\n\t\t\t}\r\n\r\n\t\t\tfinal File file = new File(dest, fileName);\r\n\t\t\tif (entry.isDirectory()) {\r\n\t\t\t\t// make sure the directory exists\r\n\t\t\t\tfile.mkdirs();\r\n\t\t\t\tjin.closeEntry();\r\n\t\t\t} else {\r\n\t\t\t\t// make sure the directory exists\r\n\t\t\t\tfinal File parent = file.getParentFile();\r\n\t\t\t\tif (parent != null && !parent.exists()) {\r\n\t\t\t\t\tparent.mkdirs();\r\n\t\t\t\t}\r\n\r\n\t\t\t\t// dump the file\r\n\r\n\t\t\t\tfinal OutputStream out = new FileOutputStream(file);\r\n\t\t\t\tint len = 0;\r\n\t\t\t\twhile ((len = jin.read(buffer, 0, buffer.length)) != -1) {\r\n\t\t\t\t\tout.write(buffer, 0, len);\r\n\t\t\t\t}\r\n\r\n\t\t\t\tout.flush();\r\n\t\t\t\tout.close();\r\n\t\t\t\tjin.closeEntry();\r\n\t\t\t\tback.add(file);\r\n\r\n\t\t\t}\r\n\r\n\t\t\tentry = jin.getNextEntry();\r\n\t\t}\r\n\t\tjin.close();\r\n\t\treturn back;\r\n\t}", "public static void unzip(String csarFilename, Map<String, ToscaServiceTemplate> unzippedTemplates, String... filter)\n throws PolicyDecodingException, CoderException {\n try (var zipFile = new ZipFile(csarFilename)) {\n int totalSizeArchive = 0;\n int totalEntryArchive = 0;\n\n Enumeration<? extends ZipEntry> entries = zipFile.entries();\n\n while (entries.hasMoreElements()) {\n ZipEntry entry = entries.nextElement();\n totalEntryArchive++;\n\n if (checkEntryFilter(entry.getName(), filter)) {\n validateZipEntry(entry.getName(), csarFilename);\n InputStream entryData = new BufferedInputStream(zipFile.getInputStream(entry));\n\n int bufferedBytes;\n byte[] buffer = new byte[2048];\n int totalSizeEntry = 0;\n\n boolean isValidThreshold = true;\n while ((bufferedBytes = entryData.read(buffer)) > 0 && isValidThreshold) {\n totalSizeEntry += bufferedBytes;\n totalSizeArchive += bufferedBytes;\n\n double compressionRatio = Math.floorDiv(totalSizeEntry, entry.getCompressedSize());\n isValidThreshold = compressionRatio <= THRESHOLD_RATIO;\n }\n\n unzippedTemplates.put(entry.getName(), decodeFile(entry.getName(), zipFile.getInputStream(entry)));\n }\n\n if (totalSizeArchive > THRESHOLD_SIZE || totalEntryArchive > THRESHOLD_ENTRIES) {\n // the uncompressed data size is too much for the application resource capacity\n break;\n }\n }\n } catch (IOException exception) {\n throw new PolicyDecodingException(\"Couldn't read the zipFile\", exception);\n }\n }", "private boolean unarchive(String osSdkRoot, File archiveFile, SdkManager sdkManager, ITaskMonitor monitor) {\n boolean success = false;\n Package pkg = getParentPackage();\n String pkgName = pkg.getShortDescription();\n String pkgDesc = String.format(\"Installing %1$s\", pkgName);\n monitor.setDescription(pkgDesc);\n monitor.setResult(pkgDesc);\n String pkgKind = pkg.getClass().getSimpleName();\n File destFolder = null;\n File unzipDestFolder = null;\n File oldDestFolder = null;\n try {\n unzipDestFolder = createTempFolder(osSdkRoot, pkgKind, \"new\");\n if (unzipDestFolder == null) {\n monitor.setResult(\"Failed to find a temp directory in %1$s.\", osSdkRoot);\n return false;\n }\n if (!unzipDestFolder.mkdirs()) {\n monitor.setResult(\"Failed to create directory %1$s\", unzipDestFolder.getPath());\n return false;\n }\n String[] zipRootFolder = new String[] { null };\n if (!unzipFolder(archiveFile, getSize(), unzipDestFolder, pkgDesc, zipRootFolder, monitor)) {\n return false;\n }\n if (!generateSourceProperties(unzipDestFolder)) {\n return false;\n }\n destFolder = pkg.getInstallFolder(osSdkRoot, zipRootFolder[0], sdkManager);\n if (destFolder == null) {\n monitor.setResult(\"Failed to compute installation directory for %1$s.\", pkgName);\n return false;\n }\n if (!pkg.preInstallHook(this, monitor, osSdkRoot, destFolder)) {\n monitor.setResult(\"Skipping archive: %1$s\", pkgName);\n return false;\n }\n boolean move1done = false;\n boolean move2done = false;\n while (!move1done || !move2done) {\n File renameFailedForDir = null;\n if (!move1done) {\n if (destFolder.isDirectory()) {\n if (oldDestFolder == null) {\n oldDestFolder = createTempFolder(osSdkRoot, pkgKind, \"old\");\n }\n if (oldDestFolder == null) {\n monitor.setResult(\"Failed to find a temp directory in %1$s.\", osSdkRoot);\n return false;\n }\n if (!destFolder.renameTo(oldDestFolder)) {\n monitor.setResult(\"Failed to rename directory %1$s to %2$s.\", destFolder.getPath(), oldDestFolder.getPath());\n renameFailedForDir = destFolder;\n }\n }\n move1done = (renameFailedForDir == null);\n }\n if (move1done && !move2done) {\n if (renameFailedForDir == null && !unzipDestFolder.renameTo(destFolder)) {\n monitor.setResult(\"Failed to rename directory %1$s to %2$s\", unzipDestFolder.getPath(), destFolder.getPath());\n renameFailedForDir = unzipDestFolder;\n }\n move2done = (renameFailedForDir == null);\n }\n if (renameFailedForDir != null) {\n if (SdkConstants.CURRENT_PLATFORM == SdkConstants.PLATFORM_WINDOWS) {\n String msg = String.format(\"-= Warning ! =-\\n\" + \"A folder failed to be renamed or moved. On Windows this \" + \"typically means that a program is using that folder (for example \" + \"Windows Explorer or your anti-virus software.)\\n\" + \"Please momentarily deactivate your anti-virus software.\\n\" + \"Please also close any running programs that may be accessing \" + \"the directory '%1$s'.\\n\" + \"When ready, press YES to try again.\", renameFailedForDir.getPath());\n if (monitor.displayPrompt(\"SDK Manager: failed to install\", msg)) {\n continue;\n }\n }\n return false;\n }\n break;\n }\n unzipDestFolder = null;\n success = true;\n pkg.postInstallHook(this, monitor, destFolder);\n return true;\n } finally {\n deleteFileOrFolder(oldDestFolder);\n deleteFileOrFolder(unzipDestFolder);\n if (!success) {\n pkg.postInstallHook(this, monitor, null);\n }\n }\n }", "protected void getFile(ZipEntry e) throws IOException {\n String zipName = e.getName();\n switch (mode) {\n case EXTRACT:\n if (zipName.startsWith(\"/\")) {\n if (!warnedMkDir)\n System.out.println(\"Ignoring absolute paths\");\n warnedMkDir = true;\n zipName = zipName.substring(1);\n }\n // if a directory, just return. We mkdir for every file,\n // since some widely-used Zip creators don't put out\n // any directory entries, or put them in the wrong place.\n if (zipName.endsWith(\"/\")) {\n return;\n }\n // Else must be a file; open the file for output\n // Get the directory part.\n int ix = zipName.lastIndexOf('/');\n if (ix > 0) {\n //String dirName = zipName.substring(0, ix);\n String fileName = zipName.substring(ix + 1, zipName.length());\n zipName = fileName;\n\n }\n String targetFile = this.unzipFileTargetLocation;\n File file = new File(targetFile);\n if (!file.exists())\n file.createNewFile();\n FileOutputStream os = null;\n InputStream is = null;\n try {\n os = new FileOutputStream(targetFile);\n is = zippy.getInputStream(e);\n int n = 0;\n while ((n = is.read(b)) > 0)\n os.write(b, 0, n);\n\n } finally {\n if (is != null) {\n try {\n is.close();\n } catch (Exception ee) {\n ee.printStackTrace();\n }\n }\n if (os != null) {\n try {\n os.close();\n } catch (Exception ee) {\n ee.printStackTrace();\n }\n }\n }\n break;\n case LIST:\n // Not extracting, just list\n if (e.isDirectory()) {\n System.out.println(\"Directory \" + zipName);\n } else {\n System.out.println(\"File \" + zipName);\n }\n break;\n default:\n throw new IllegalStateException(\"mode value (\" + mode + \") bad\");\n }\n }", "private static void extractArchive(Path sourcePath, Path targetPath) throws IOException {\n\n // TODO: janv_capgemini check if sourcePath is an archive and throw exception if not\n FileSystem fs = FileSystems.newFileSystem(sourcePath, null);\n\n Path path = fs.getPath(\"/\");\n Files.walkFileTree(path, new SimpleFileVisitor<Path>() {\n @Override\n public FileVisitResult visitFile(Path file, BasicFileAttributes attrs) throws IOException {\n\n Path relativePath = path.relativize(file);\n Path targetPathResolved = targetPath.resolve(relativePath.toString());\n Files.deleteIfExists(targetPathResolved);\n Files.createDirectories(targetPathResolved.getParent());\n Files.copy(file, targetPathResolved);\n return FileVisitResult.CONTINUE;\n }\n\n @Override\n public FileVisitResult visitFileFailed(Path file, IOException exc) throws IOException {\n\n // Log errors but do not throw an exception\n LOG.warn(\"An IOException occurred while reading a file on path {} with message: {}\", file, exc.getMessage());\n LOG.debug(\"An IOException occurred while reading a file on path {} with message: {}\", file,\n LOG.isDebugEnabled() ? exc : null);\n return FileVisitResult.CONTINUE;\n }\n });\n\n }", "private void extractFile(ZipInputStream zipIn, String filePath) throws IOException {\n BufferedOutputStream bos = new BufferedOutputStream(new FileOutputStream(filePath));\n byte[] bytesIn = new byte[BUFFER_SIZE];\n int read = 0;\n while ((read = zipIn.read(bytesIn)) != -1) {\n bos.write(bytesIn, 0, read);\n }\n bos.close();\n }", "private void extractFile(ZipInputStream zipIn, String filePath) throws IOException {\n BufferedOutputStream bos = new BufferedOutputStream(new FileOutputStream(filePath));\n byte[] bytesIn = new byte[BUFFER_SIZE];\n int read = 0;\n while ((read = zipIn.read(bytesIn)) != -1) {\n bos.write(bytesIn, 0, read);\n }\n bos.close();\n }", "public static void unpackFiles() throws IOException {\n if(!new File(\"src/main/resources/tmp\").exists() || (Objects.requireNonNull(new File(\"src/main/resources/tmp\").list()).length != IO.sourceFiles.size())) {\n IO.unzipFiles();\n } else if(Objects.requireNonNull(new File(\"src/main/resources/tmp/ham_Calibration\").list()).length != new ZipFile(IO.sourceFiles.get(EmailTypes.HAM_CAL)).size()) {\n IO.unzipFiles(EmailTypes.HAM_CAL);\n } else if(Objects.requireNonNull(new File(\"src/main/resources/tmp/ham_Test\").list()).length != new ZipFile(IO.sourceFiles.get(EmailTypes.HAM_TEST)).size()) {\n IO.unzipFiles(EmailTypes.HAM_TEST);\n } else if(Objects.requireNonNull(new File(\"src/main/resources/tmp/ham_Train\").list()).length != new ZipFile(IO.sourceFiles.get(EmailTypes.HAM_TRAIN)).size()) {\n IO.unzipFiles(EmailTypes.HAM_TRAIN);\n } else if(Objects.requireNonNull(new File(\"src/main/resources/tmp/spam_Calibration\").list()).length != new ZipFile(IO.sourceFiles.get(EmailTypes.SPAM_CAL)).size()) {\n IO.unzipFiles(EmailTypes.SPAM_CAL);\n } else if(Objects.requireNonNull(new File(\"src/main/resources/tmp/spam_Test\").list()).length != new ZipFile(IO.sourceFiles.get(EmailTypes.SPAM_TEST)).size()) {\n IO.unzipFiles(EmailTypes.SPAM_TEST);\n } else if(Objects.requireNonNull(new File(\"src/main/resources/tmp/spam_Train\").list()).length != new ZipFile(IO.sourceFiles.get(EmailTypes.SPAM_TRAIN)).size()) {\n IO.unzipFiles(EmailTypes.SPAM_TRAIN);\n } else {\n System.out.println(\"Files already unpacked - skipping\\n\");\n }\n calculateSizes();\n }", "public static void unzip(InputStream inputStream, UnzipCallback unzipListener) throws IOException {\r\n\t\tZipInputStream zis = new ZipInputStream(inputStream);\r\n\t\t\r\n\t\tfor(ZipEntry zipEntry = zis.getNextEntry(); zipEntry != null; zipEntry = zis.getNextEntry()) {\r\n\t\t\tunzipListener.newZipEntry(zipEntry, zis);\r\n\t\t\tzis.closeEntry();\r\n\t\t}\r\n\t}", "@SuppressWarnings(\"unchecked\")\n private boolean unzipFolder(File archiveFile, long compressedSize, File unzipDestFolder, String description, String[] outZipRootFolder, ITaskMonitor monitor) {\n description += \" (%1$d%%)\";\n ZipFile zipFile = null;\n try {\n zipFile = new ZipFile(archiveFile);\n boolean usingUnixPerm = SdkConstants.CURRENT_PLATFORM == SdkConstants.PLATFORM_DARWIN || SdkConstants.CURRENT_PLATFORM == SdkConstants.PLATFORM_LINUX;\n long incStep = compressedSize / NUM_MONITOR_INC;\n long incTotal = 0;\n long incCurr = 0;\n int lastPercent = 0;\n byte[] buf = new byte[65536];\n Enumeration<ZipArchiveEntry> entries = zipFile.getEntries();\n while (entries.hasMoreElements()) {\n ZipArchiveEntry entry = entries.nextElement();\n String name = entry.getName();\n name = name.replace('\\\\', '/');\n int pos = name.indexOf('/');\n if (pos < 0 || pos == name.length() - 1) {\n continue;\n } else {\n if (outZipRootFolder[0] == null && pos > 0) {\n outZipRootFolder[0] = name.substring(0, pos);\n }\n name = name.substring(pos + 1);\n }\n File destFile = new File(unzipDestFolder, name);\n if (name.endsWith(\"/\")) {\n if (!destFile.isDirectory() && !destFile.mkdirs()) {\n monitor.setResult(\"Failed to create temp directory %1$s\", destFile.getPath());\n return false;\n }\n continue;\n } else if (name.indexOf('/') != -1) {\n File parentDir = destFile.getParentFile();\n if (!parentDir.isDirectory()) {\n if (!parentDir.mkdirs()) {\n monitor.setResult(\"Failed to create temp directory %1$s\", parentDir.getPath());\n return false;\n }\n }\n }\n FileOutputStream fos = null;\n try {\n fos = new FileOutputStream(destFile);\n int n;\n InputStream entryContent = zipFile.getInputStream(entry);\n while ((n = entryContent.read(buf)) != -1) {\n if (n > 0) {\n fos.write(buf, 0, n);\n }\n }\n } finally {\n if (fos != null) {\n fos.close();\n }\n }\n if (usingUnixPerm && destFile.isFile()) {\n int mode = entry.getUnixMode();\n if ((mode & 0111) != 0) {\n setExecutablePermission(destFile);\n }\n }\n for (incTotal += entry.getCompressedSize(); incCurr < incTotal; incCurr += incStep) {\n monitor.incProgress(1);\n }\n int percent = (int) (100 * incTotal / compressedSize);\n if (percent != lastPercent) {\n monitor.setDescription(description, percent);\n lastPercent = percent;\n }\n if (monitor.isCancelRequested()) {\n return false;\n }\n }\n return true;\n } catch (IOException e) {\n monitor.setResult(\"Unzip failed: %1$s\", e.getMessage());\n } finally {\n if (zipFile != null) {\n try {\n zipFile.close();\n } catch (IOException e) {\n }\n }\n }\n return false;\n }", "public void extractFile(ZipInputStream zipIn, String filePath) throws IOException {\n final int BUFFER_SIZE = (int) 1e8;\n BufferedOutputStream bos = new BufferedOutputStream(new FileOutputStream(filePath));\n byte[] bytesIn = new byte[BUFFER_SIZE];\n int read = 0;\n while ((read = zipIn.read(bytesIn)) != -1) {\n bos.write(bytesIn, 0, read);\n }\n bos.close();\n }", "@Override\r\n\tpublic String unZip(String localFilePath, boolean remLocal) throws FileSystemUtilException {\r\n\t\tthrow new FileSystemUtilException(\"000000\", null, Level.ERROR, null);\r\n\r\n\t}", "public UnZipRunnable(String token, String source, String outPutPath) {\n this.token = token;\n this.sourceFile = source;\n this.outPutPath = outPutPath;\n }", "private static void extractFile(ZipInputStream zipIn, String filePath) throws IOException {\n BufferedOutputStream bos = new BufferedOutputStream(new FileOutputStream(filePath));\n byte[] bytesIn = new byte[BUFFER_SIZE];\n int read = 0;\n while ((read = zipIn.read(bytesIn)) != -1) {\n bos.write(bytesIn, 0, read);\n }\n bos.close();\n }", "public static byte[] getUnzippedFile(byte[] aZippedBytes) throws IOException {\r\n byte[] result = null;\r\n\r\n ByteArrayInputStream bais = new ByteArrayInputStream(aZippedBytes);\r\n ByteArrayOutputStream baos = new ByteArrayOutputStream();\r\n BufferedInputStream bis = new BufferedInputStream(new GZIPInputStream(bais));\r\n BufferedOutputStream bos = new BufferedOutputStream(baos);\r\n int read = -1;\r\n while ((read = bis.read()) != -1) {\r\n bos.write(read);\r\n }\r\n bos.flush();\r\n baos.flush();\r\n result = baos.toByteArray();\r\n bos.close();\r\n bis.close();\r\n bais.close();\r\n baos.close();\r\n\r\n return result;\r\n }", "@Test\r\n public void testUnzipArchive() throws Exception {\r\n\r\n\r\n (new ZipUtils(\"Cp866\")).unzipArchive(\r\n \"src/test/resources/archive/testfile.zip\",\r\n \"target/test-classes/import/archive\"\r\n );\r\n\r\n File [] files = (new File(\"target/test-classes/import/archive\")).listFiles();\r\n\r\n boolean found = false;\r\n \r\n for (File file : files) {\r\n if (file.getAbsolutePath().contains(\"Привет, я файло.txt\")) {\r\n found = true;\r\n break;\r\n }\r\n }\r\n assertTrue(found);\r\n\r\n\r\n }", "public File extract (Path archivePath, File destination) throws IOException\n\t{\n\t\tif (!Files.isRegularFile (archivePath))\n\t\t\tthrow new IOException (archivePath + \" is not a regular file\");\n\t\t\n\t\tif (destination.isDirectory ())\n\t\t\tdestination = destination.toPath ()\n\t\t\t\t.resolve (\"./\" + archivePath.normalize ().toString ()).normalize ()\n\t\t\t\t.toFile ();\n\t\t\n\t\tFiles.createDirectories (destination.toPath ().getParent ());\n\t\tFiles.copy (archivePath, destination.toPath (), Utils.COPY_OPTION);\n\t\t\n\t\treturn destination;\n\t}", "public boolean ZipFile(String sSourceFilePath, String sDestinationZipFilePath, boolean bReplaceExisting) {\n byte[] buffer = new byte[30720];\n FileInputStream fin = null;\n FileOutputStream fout = null;\n ZipOutputStream zout = null;\n int length;\n String sZipEntryFileName = \"\";\n File objFile = null;\n try {\n //check for source file\n if (sSourceFilePath.trim().equalsIgnoreCase(\"\")) {\n throw new Exception(\"Invalid Source File : \" + sSourceFilePath);\n }\n objFile = new File(sSourceFilePath);\n if (!objFile.exists()) {\n throw new Exception(\"Source file not found : \" + sSourceFilePath);\n }\n\n //check for destination Zip file\n if (sDestinationZipFilePath.trim().equalsIgnoreCase(\"\") || sDestinationZipFilePath == null) {\n String stmp_Path = objFile.getAbsolutePath();\n String stmp_Name = objFile.getName();\n if (stmp_Name.contains(\".\")) { //check for removing extension\n int indx = 0;\n try {\n indx = stmp_Name.indexOf(\".\", stmp_Name.length() - 5);\n } catch (Exception e) {\n indx = 0;\n }\n if (indx <= 0) {\n indx = stmp_Name.length();\n }\n\n stmp_Name = stmp_Name.substring(0, indx);\n stmp_Name = stmp_Name + \".zip\";\n }\n sDestinationZipFilePath = stmp_Path + File.separator + stmp_Name;\n }\n\n objFile = new File(sDestinationZipFilePath);\n if (objFile.exists()) {\n if (bReplaceExisting) {\n objFile.delete();\n } else {\n throw new Exception(\"Destination ZipFile Already exists : \" + sDestinationZipFilePath);\n }\n }\n\n //Zipping File\n sZipEntryFileName = sSourceFilePath.substring(sSourceFilePath.lastIndexOf(\"\\\\\") + 1);\n fout = new FileOutputStream(sDestinationZipFilePath);\n zout = new ZipOutputStream(fout);\n fin = new FileInputStream(sSourceFilePath);\n zout.putNextEntry(new ZipEntry(sZipEntryFileName));\n while ((length = fin.read(buffer)) > 0) {\n zout.write(buffer, 0, length);\n }\n\n return true;\n\n } catch (Exception exp) {\n println(\"Src = \" + sSourceFilePath + \" : Dest = \" + sDestinationZipFilePath + \" : \" + exp.toString());\n return false;\n } finally {\n try {\n fin.close();\n } catch (Exception exp) {\n }\n try {\n zout.closeEntry();\n } catch (Exception exp) {\n }\n try {\n zout.close();\n } catch (Exception exp) {\n }\n }\n }", "public void extractFile(ZipModel zipModel, String outputPath, ProgressMonitor progressMonitor,\r\n boolean runInThread, char[] password) throws ZipException {\r\n extractFile(zipModel, outputPath, null, progressMonitor, runInThread, password);\r\n }", "private static void decompressJarFile(String destDirectory, String jarFilePath) throws IOException {\n File destDir = new File(destDirectory);\n if (!destDir.exists()) {\n destDir.mkdir();\n }\n JarInputStream jarIn = new JarInputStream(new FileInputStream(jarFilePath));\n JarEntry entry = jarIn.getNextJarEntry();\n // iterates over all the entries in the jar file\n while (entry != null) {\n String filePath = destDirectory + \"/\" + entry.getName();\n if (!entry.isDirectory()) {\n new File(filePath).getParentFile().mkdirs();\n // if the entry is a file, extracts it\n extractFile(jarIn, filePath);\n }/* else {\n System.out.println(\"New dir: \" + filePath);\n // if the entry is a directory, make the directory\n File dir = new File(filePath);\n dir.mkdir();\n System.out.println(dir.canWrite());\n }*/\n jarIn.closeEntry();\n entry = jarIn.getNextJarEntry();\n }\n jarIn.close();\n }", "private boolean extractSettingsZip(File fSettingsZip, String destDir, int index)\n {\n boolean result = false;\n try\n {\n //m_logWriter.write(\"Unzipping to destination: \"+destDir+\"\\n\");\n //m_logWriter.flush();\n \tboolean backFavFile = false;\n \tFile dest = new File(destDir);\n \tif (dest.exists()) {\n \t\tString userPath = destDir + \"/userdata/\";\n \t\tFile userFile = new File(userPath);\n \t\tString favDir = userPath + Update.FavouriteFile;\n \t\tFile favFile = new File(favDir);\n \t\tif (userFile.exists() && favFile.exists()) {\n \t\t\tCopyFile(userPath, Update.FavouriteFile, Update.pathSD);\n \t\t\tbackFavFile = true;\n \t\t}\n \t\t\n \t\tDeleteDir(destDir);\n \t}\n \telse\n \t\tdest.mkdirs();\n \t\n publishProgress(PROGRESS_EXTRACT, (int)(0.5 * index));\n // open the zip\n ZipFile zip = new ZipFile(fSettingsZip);\n int count=0;\n int zipSize = zip.size();\n Enumeration<? extends ZipEntry> entries = zip.entries();\n //while(entries.hasMoreElements())\n while (true)\n {\n if (isCancelled()) {\n \tresult = false;\n \tm_ErrorCode = 4;\n break;\n }\n\n if (m_DownloadStop)\n \tcontinue;\n \n if (!entries.hasMoreElements())\n \tbreak;\n \n // todo: update progress\n ZipEntry ze = (ZipEntry)entries.nextElement();\n count++;\n String entryName = ze.getName();\n String destFullpath = destDir+\"/\"+entryName;\n //m_logWriter.write(\"Extracting: \"+destFullpath+\"\\n\");\n File fDestPath = new File(destFullpath);\n if (ze.isDirectory())\n {\n fDestPath.mkdirs();\n publishProgress(PROGRESS_EXTRACT, (int)(0.5 * (index + count*100/zipSize)));\n continue;\n }\n fDestPath.getParentFile().mkdirs();\n\n // write file\n try {\n InputStream is = zip.getInputStream(ze);\n BufferedOutputStream bos = new BufferedOutputStream(new FileOutputStream(destFullpath));\n int n=0;\n byte buf[] = new byte[4096];\n while((n = is.read(buf, 0, 4096)) > -1)\n {\n bos.write(buf, 0, n);\n }\n // close\n is.close();\n bos.close();\n } catch(IOException ioe) {\n \tm_ErrorCode = 5;\n //m_logWriter.write(\"Could not write, error: \"+ioe.toString());\n }\n\n // update progress\n //publishProgress(PROGRESS_EXTRACT, (count*100/zipSize));\n }\n\n // close zip and bail\n zip.close();\n //m_logWriter.write(\"Successfully extracted: \"+fSettingsZip.getName()+\"\\n\");\n //m_logWriter.flush();\n if (backFavFile) {\n \t\tString userPath = destDir + \"/userdata/\";\n \t\tFile userFile = new File(userPath);\n \t\tif (!userFile.exists())\n \t\t\tuserFile.mkdirs();\n \t\t\n \t\tFile inputFile = new File(Update.pathSD + Update.FavouriteFile);\n \t\tif (inputFile.exists())\n \t\t\tCopyFile(Update.pathSD, Update.FavouriteFile, userPath);\n }\n \n result = !isCancelled();\n }\n catch(Exception e)\n {\n //Log.e(\"SettingsDownloader\", \"Error: \"+e.toString());\n result = false;\n m_ErrorCode = 6;\n }\n\n return result;\n }", "public void extractPackage(String zipPath, String destPath) throws IOException {\n File destDir = new File(destPath);\n if(!destDir.exists()) {\n destDir.mkdir();\n }\n ZipInputStream zipIn = new ZipInputStream(new FileInputStream((zipPath)));\n ZipEntry entry = zipIn.getNextEntry();\n while(entry != null) {\n String filePath = destPath+File.separator+entry.getName();\n //filePath = filePath.replaceAll(\" \",\"_\");\n if(!entry.isDirectory()) {\n Log.i(\"extract\",\"Package Name: \"+entry.getName());\n Log.i(\"extract\",filePath);\n String[] temp = entry.getName().split(\"\\\\.\");\n if(validExtension(temp[temp.length-1].toLowerCase())) {\n extractFile(zipIn,filePath);\n }\n //extractFile(zipIn,filePath);\n } else {\n File dir = new File(filePath);\n dir.mkdirs();\n }\n zipIn.closeEntry();;\n entry = zipIn.getNextEntry();\n }\n zipIn.close();\n }", "public void setUnzippedFile(byte[] aBytes) throws IOException {\r\n ByteArrayOutputStream baos = new ByteArrayOutputStream();\r\n GZIPOutputStream gos = new GZIPOutputStream(baos);\r\n BufferedOutputStream bos = new BufferedOutputStream(gos);\r\n ByteArrayInputStream bais = new ByteArrayInputStream(aBytes);\r\n BufferedInputStream bis = new BufferedInputStream(bais);\r\n int read = -1;\r\n while ((read = bis.read()) != -1) {\r\n bos.write(read);\r\n }\r\n bos.flush();\r\n baos.flush();\r\n gos.finish();\r\n super.setFile(baos.toByteArray());\r\n bis.close();\r\n bos.close();\r\n gos.close();\r\n bais.close();\r\n baos.close();\r\n }", "public static boolean SafeUnzipFile(ZipFile zf, String filepathinzip, File fileinfiledir, long crc) {\r\n BufferedOutputStream Output_fos = null;\r\n BufferedInputStream bufbr = null;\r\n try {\r\n ZipEntry ze = zf.getEntry(filepathinzip);\r\n if (ze == null) {\r\n if (Output_fos != null) {\r\n try {\r\n Output_fos.close();\r\n if (bufbr != null) {\r\n try {\r\n bufbr.close();\r\n } catch (IOException e) {\r\n e.printStackTrace();\r\n return false;\r\n }\r\n }\r\n } catch (IOException e2) {\r\n e2.printStackTrace();\r\n if (bufbr != null) {\r\n try {\r\n bufbr.close();\r\n } catch (IOException e3) {\r\n e3.printStackTrace();\r\n return false;\r\n }\r\n }\r\n return false;\r\n } finally {\r\n if (bufbr != null) {\r\n try {\r\n bufbr.close();\r\n } catch (IOException e4) {\r\n e4.printStackTrace();\r\n return false;\r\n }\r\n }\r\n }\r\n }\r\n return false;\r\n }\r\n if (crc != 0) {\r\n if (ze.getCrc() == crc) {\r\n if (Output_fos != null) {\r\n try {\r\n Output_fos.close();\r\n if (bufbr != null) {\r\n try {\r\n bufbr.close();\r\n } catch (IOException e5) {\r\n e5.printStackTrace();\r\n return false;\r\n }\r\n }\r\n } catch (IOException e6) {\r\n e6.printStackTrace();\r\n if (bufbr != null) {\r\n try {\r\n bufbr.close();\r\n } catch (IOException e7) {\r\n e7.printStackTrace();\r\n return false;\r\n }\r\n }\r\n return false;\r\n } finally {\r\n if (bufbr != null) {\r\n try {\r\n bufbr.close();\r\n } catch (IOException e8) {\r\n e8.printStackTrace();\r\n return false;\r\n }\r\n }\r\n }\r\n }\r\n return true;\r\n }\r\n }\r\n byte[] buf = UnzipFile(zf, ze);\r\n if (1 != 0) {\r\n BufferedOutputStream Output_fos2 = new BufferedOutputStream(new FileOutputStream(fileinfiledir));\r\n try {\r\n Output_fos2.write(buf, 0, buf.length);\r\n Output_fos = Output_fos2;\r\n } catch (Exception e9) {\r\n e = e9;\r\n Output_fos = Output_fos2;\r\n try {\r\n e.printStackTrace();\r\n if (Output_fos != null) {\r\n try {\r\n Output_fos.close();\r\n if (bufbr != null) {\r\n try {\r\n bufbr.close();\r\n } catch (IOException e10) {\r\n e10.printStackTrace();\r\n return false;\r\n }\r\n }\r\n } catch (IOException e11) {\r\n e11.printStackTrace();\r\n if (bufbr != null) {\r\n try {\r\n bufbr.close();\r\n } catch (IOException e12) {\r\n e12.printStackTrace();\r\n return false;\r\n }\r\n }\r\n return false;\r\n } finally {\r\n if (bufbr != null) {\r\n try {\r\n bufbr.close();\r\n } catch (IOException e13) {\r\n e13.printStackTrace();\r\n return false;\r\n }\r\n }\r\n }\r\n }\r\n return false;\r\n } catch (Throwable th) {\r\n th = th;\r\n if (Output_fos != null) {\r\n }\r\n throw th;\r\n }\r\n } catch (Throwable th2) {\r\n th = th2;\r\n Output_fos = Output_fos2;\r\n if (Output_fos != null) {\r\n try {\r\n Output_fos.close();\r\n if (bufbr != null) {\r\n try {\r\n bufbr.close();\r\n } catch (IOException e14) {\r\n e14.printStackTrace();\r\n return false;\r\n }\r\n }\r\n } catch (IOException e15) {\r\n e15.printStackTrace();\r\n if (bufbr != null) {\r\n try {\r\n bufbr.close();\r\n } catch (IOException e16) {\r\n e16.printStackTrace();\r\n return false;\r\n }\r\n }\r\n return false;\r\n } finally {\r\n if (bufbr != null) {\r\n try {\r\n bufbr.close();\r\n } catch (IOException e17) {\r\n e17.printStackTrace();\r\n return false;\r\n }\r\n }\r\n }\r\n }\r\n throw th;\r\n }\r\n }\r\n if (Output_fos != null) {\r\n try {\r\n Output_fos.close();\r\n if (bufbr != null) {\r\n try {\r\n bufbr.close();\r\n } catch (IOException e18) {\r\n e18.printStackTrace();\r\n return false;\r\n }\r\n }\r\n } catch (IOException e19) {\r\n e19.printStackTrace();\r\n if (bufbr != null) {\r\n try {\r\n bufbr.close();\r\n } catch (IOException e20) {\r\n e20.printStackTrace();\r\n return false;\r\n }\r\n }\r\n return false;\r\n } finally {\r\n if (bufbr != null) {\r\n try {\r\n bufbr.close();\r\n } catch (IOException e21) {\r\n e21.printStackTrace();\r\n return false;\r\n }\r\n }\r\n }\r\n }\r\n return true;\r\n } catch (Exception e22) {\r\n e = e22;\r\n }\r\n }", "public interface UnzipCallback {\n\n /**\n * Get called when unzip completed\n * \n * @param output\n */\n void onUnzipCompleted(String output);\n }", "public void unzip(){\n\t\tif(unzipIndex < unzipRange){\n\t\t\tupperHelix.addNucleotideToEnd(0,originalHelix.getNucleotide(0,unzipIndex));\n\t\t\toriginalHelix.removeNucleotide(0,unzipIndex);\n\t\t\tlowerHelix.addNucleotideToEnd(1,originalHelix.getNucleotide(1,unzipIndex));\n\t\t\toriginalHelix.removeNucleotide(1,unzipIndex);\n\t\t\tupperX=(int)(XS-Nucleotide.getImageSize()*(upperHelix.getLength()-1)*Math.cos(Math.toRadians(30)));\n\t\t\tupperY = (int)(YS-Nucleotide.getImageSize()*(upperHelix.getLength()+1)*Math.sin(Math.toRadians(30))-25);\n\n\t\t\tint h = Nucleotide.getImageSize()*unzipIndex;\n\t\t\tint lx = (int)(XS+h-30-Math.cos(Math.toRadians(30))*h);\n\t\t\tint ly = (int)(YS-25+Math.sin(Math.toRadians(30))*h);\n\t\t\tint ux = lx +Nucleotide.getImageSize()*2;\n\t\t\tint uy = (int)(YS+25-Math.sin(Math.toRadians(30))*h-Math.sin(Math.toRadians(60))*(70*2-5));\n\t\t\tSystem.out.println(\"X Y : \"+Integer.toString(lx)+\" \" + Integer.toString(ux));\n\t\t\tupperHelix.setPos(ux, uy,30);\n\t\t\tlowerHelix.setPos(lx,ly,-30);\n\t\t\tunzipIndex++;\n\t\t}\n\t}", "private void addToZipStream(Path file, ZipOutputStream zipStream, String dirName)\r\n throws Exception {\r\n String inputFileName = file.toFile().getPath();\r\n try (FileInputStream inputStream = new FileInputStream(inputFileName)) {\r\n\r\n // create a new ZipEntry, which is basically another file\r\n // within the archive. We omit the path from the filename\r\n Path directory = Paths.get(dirName);\r\n ZipEntry entry = new ZipEntry(directory.relativize(file).toString());\r\n\r\n zipStream.putNextEntry(entry);\r\n\r\n // Now we copy the existing file into the zip archive. To do\r\n // this we write into the zip stream, the call to putNextEntry\r\n // above prepared the stream, we now write the bytes for this\r\n // entry. For another source such as an in memory array, you'd\r\n // just change where you read the information from.\r\n byte[] readBuffer = new byte[2048];\r\n int amountRead;\r\n int written = 0;\r\n\r\n while ((amountRead = inputStream.read(readBuffer)) > 0) {\r\n zipStream.write(readBuffer, 0, amountRead);\r\n written += amountRead;\r\n }\r\n } catch (IOException e) {\r\n throw new Exception(\"Unable to process \" + inputFileName, e);\r\n }\r\n }", "Decompress() {\r\n // this.destinationLocation = null ; //destinationLocation;\r\n }", "public boolean isUnzipped() {\n\t\treturn helicase.isUnzipped();\n\t}", "public List<File> unzipSubtitle(File zipFile, File targetDirectory) throws IOException {\n List<File> subtitles = new ArrayList<File>();\n ZipInputStream zis = new ZipInputStream(\n new BufferedInputStream(new FileInputStream(zipFile)));\n try {\n ZipEntry ze;\n byte[] buffer = new byte[2048];\n while ((ze = zis.getNextEntry()) != null) {\n File file = new File(targetDirectory, ze.getName());\n File dir = ze.isDirectory() ? file : file.getParentFile();\n if (!dir.isDirectory() && !dir.mkdirs())\n throw new FileNotFoundException(\"Failed to ensure directory: \" +\n dir.getAbsolutePath());\n if (ze.isDirectory())\n continue;\n String ext = FilenameUtils.getExtension(ze.getName());\n if(ext.equalsIgnoreCase(\"srt\") || ext.equalsIgnoreCase(\"vtt\") ) {\n FileOutputStream fout = new FileOutputStream(file);\n BufferedOutputStream bufout = new BufferedOutputStream(fout);\n int count;\n try {\n while ((count = zis.read(buffer)) != -1)\n bufout.write(buffer, 0, count);\n } finally {\n subtitles.add(file);\n bufout.close();\n fout.close();\n }\n }\n\n }\n } finally {\n zis.close();\n }\n\n\n return subtitles;\n }", "public static void main(String [] args){\n\t\t String zipFilePath = args[1];\n\t\t //Directory of unzip Files\n\t\t String destDir = \"Dictionary\";\n\t\t //Calling a functions 5to unzip the directory\n\t\t unzip(zipFilePath, destDir);\n\t\t \n\n\t\t// The name of the file to open. File to be passed from arguments\n String fileName = args[0];\t\t\n\n // This will reference one line at a time\n String line = null;\n\n try {\n // FileReader reads text files in the default encoding.\n FileReader fileReader = \n new FileReader(fileName);\n\n // Always wrap FileReader in BufferedReader.\n BufferedReader bufferedReader = \n new BufferedReader(fileReader);\n\t\t\t\tint count = 0;\t\t\t\t\t\t//For counting how many words are wrong\n while((line = bufferedReader.readLine()) != null) {\n String[] words = line.split(\"\\\\W\");\t\t\t\t//Keeps the words in a line the the array \n int len = words.length;\n for(int i=0;i<len;i++){\n \t//System.out.println(words[i]);\n \tint flag = 0; \t\t\t\t//Just to check whether the words present or not\n \t//System.out.println(\"HI I am reading the file.\");\n \tFile folder = new File(\"Dictionary/dictionaries\");\n\t\t\t\t\tFile[] listOfFiles = folder.listFiles();\n\t\t\t\t\t//System.out.println(listOfFiles.length);\n\t\t\t\t\tfor (int i1 = 0; i1 < listOfFiles.length; i1++) {\n\t\t\t\t\t\tif(flag == 1)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t File file = listOfFiles[i1];\n\t\t\t\t\t if (file.isFile()) {\n\t\t\t\t\t\t//I am checking\n\t\t\t\t\t\t // The name of the file to open.\n //String fileName1 = file;\n\n // This will reference one line at a time\n //String line1 = null;\n\t\t\tScanner myScanner = null;\t\t\t\t//Using Scanner Class to Read the words From file\n\t\t\t\ttry\n\t\t\t\t{\n\t\t\t\t\tmyScanner = new Scanner(file);\n\t\t\t\t\twhile(myScanner.hasNextLine()){\n \t\t\t\t\tif(flag==1){\n \t\t\t\t\t\tbreak;\n \t\t\t\t\t}\n \t\t\t\t\tString contents=myScanner.nextLine();\n \t\t\t\t\t//...\n\t\t\t\t\t\tif(words[i].equalsIgnoreCase(contents)){\n\t\t\t\t\t\t//System.out.println(\"The given word is \" + words[i]);\n\t\t\t\t\t\tflag = 1;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\t//String contents = myScanner.nextLine();\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t \n\t\t\t\t}\n\t\t\t\tfinally\n\t\t\t\t{\n\t\t\t\t\tif(myScanner != null)\n\t\t\t\t\t{\n\t\t\t\t\t\tmyScanner.close(); \n\t\t\t\t\t}\n\t\t\t\t}\n \n\t\t\t\t\t } \n\t\t\t\t\t}\n\t\t\t\t\tif(flag==0){\n\t\t\t\t\t\tcount++;\n\t\t\t\t\t\tSystem.out.println(\"The wrong word is \" + words[i]);\n\t\t\t\t\t\t//System.out.println(i+1);\n\t\t\t\t\t}\n }\n //System.out.println(line);\n } \n\n // Always close files.\n bufferedReader.close(); \n System.out.println(\"The total number of wrong words are \");\n System.out.println(count);\n \n }\n catch(FileNotFoundException ex) {\n System.out.println(\n \"Unable to open file '\" + \n fileName + \"'\"); \n }\n catch(IOException ex) {\n System.out.println(\n \"Error reading file '\" \n + fileName + \"'\"); \n // Or we could just do this: \n // ex.printStackTrace();\n }\n \t}", "public static void packToZip(String sourceDirPath, String zipFilePath) throws IOException {\n Path p;\n p = Files.createFile(Paths.get(zipFilePath));\n try (ZipOutputStream zs = new ZipOutputStream(Files.newOutputStream(p))) {\n Path pp = Paths.get(sourceDirPath);\n Files.walk(pp)\n .filter(path -> !Files.isDirectory(path))\n .forEach(path -> {\n if (!path.toString().endsWith(\".zip\")) {\n ZipEntry zipEntry = new ZipEntry(pp.relativize(path).toString());\n try {\n zs.putNextEntry(zipEntry);\n Files.copy(path, zs);\n zs.closeEntry();\n } catch (IOException e) {\n System.err.println(e);\n }\n }\n });\n }\n }", "Map<String, InputStream> extract(TypedValue<InputStream> archive) throws DecompressionException;", "public void decompressFile(String fileToDeCompress, String deCompressFile) throws IOException {\n try (\n FileInputStream fin = new FileInputStream(fileToDeCompress);\n InflaterInputStream in = new InflaterInputStream(fin);\n FileOutputStream fout = new FileOutputStream(deCompressFile)) {\n int i;\n while ((i = in.read()) != -1) {\n fout.write((byte) i);\n fout.flush();\n }\n\n }\n\n }", "public ZipEntry decompress(File compressedFile, File outputDirectory) throws IOException {\n\t\tObjects.requireNonNull(compressedFile);\n\t\tObjects.requireNonNull(outputDirectory);\n\t\tZipEntry ret = null;\n\t\tif (!outputDirectory.exists()) {\n\t\t\toutputDirectory.mkdirs();\n\t\t}\n\t\tZipInputStream input = new ZipInputStream(new FileInputStream(compressedFile));\n\t\tfor (ZipEntry entry = input.getNextEntry(); Objects.nonNull(entry); entry = input.getNextEntry()) {\n\t\t\tif (Objects.isNull(ret)) {\n\t\t\t\tret = entry;\n\t\t\t}\n\n\t\t\tString fileName = entry.getName();\n\t\t\tFile newFile = new File(outputDirectory + File.separator + fileName);\n\n\t\t\t(new File(newFile.getParent())).mkdirs();\n\n\t\t\tif (entry.isDirectory()) {\n\t\t\t\tnewFile.mkdirs();\n\t\t\t} else {\n\t\t\t\tstoreFile(input, newFile);\n\t\t\t}\n\n\t\t}\n\t\tinput.closeEntry();\n\t\tinput.close();\n\t\treturn ret;\n\t}", "private void addToZip(File directoryToZip, File file, ZipOutputStream zos) throws IOException {\r\n final int BUFFER_SIZE = 1024;\r\n FileInputStream fis = new FileInputStream(file);\r\n // we want the zipEntry's path to be a relative path that is relative\r\n // to the directory being zipped, so chop off the rest of the path\r\n String zipFilePath = file.getCanonicalPath().substring(\r\n (directoryToZip.getCanonicalPath().length() - directoryToZip.getName().length()),\r\n file.getCanonicalPath().length());\r\n ZipEntry zipEntry = new ZipEntry(zipFilePath);\r\n zos.putNextEntry(zipEntry);\r\n byte[] bytes = new byte[BUFFER_SIZE];\r\n int length;\r\n while ((length = fis.read(bytes)) >= 0) {\r\n zos.write(bytes, 0, length);\r\n }\r\n zos.closeEntry();\r\n fis.close();\r\n }", "public static boolean unzipFiles(String folder, InputStream is) {\n /**\n * List of files we want to zip, folder is parent of app preferences folder\n * Shared prefs has all Avare data except tracks\n * TODO : Tracks\n */\n\n /**\n * Zip to output stream (could be File or Drive)\n */\n try {\n ZipInputStream zis = new ZipInputStream(is);\n\n ZipEntry ze = zis.getNextEntry();\n\n while(ze != null) {\n String fileName = ze.getName();\n File newFile = new File(folder + File.separator + fileName);\n\n //create all non existent folders\n new File(newFile.getParent()).mkdirs();\n\n FileOutputStream fos = new FileOutputStream(newFile);\n\n int len;\n byte[] bytes = new byte[4096];\n while ((len = zis.read(bytes)) > 0) {\n fos.write(bytes, 0, len);\n }\n\n fos.close();\n ze = zis.getNextEntry();\n }\n\n zis.closeEntry();\n zis.close();\n\n } catch (Exception e) {\n return false;\n }\n return true;\n }", "List<CompressResult> decompress(Path input, Path output) throws IOException;", "private File downloadAndUnzipCollection(final Document collectionPage)\n {\n // look for a link-element for downloading a zip-file\n final Element zipLinkElement = collectionPage.selectFirst(FishStatJSourceConstants.ZIP_LINKS_SELECTION);\n\n if (zipLinkElement == null)\n return null;\n\n // retrieve URL from link-element\n final String zipUrl = zipLinkElement.attr(FishStatJSourceConstants.HREF_ATTRIBUTE);\n\n if (zipUrl == null)\n return null;\n\n // unzip file\n final File unzipRootFolder = EventSystem.sendSynchronousEvent(new GetCacheFolderEvent());\n final File unzipFolder = new File(unzipRootFolder, FishStatJFileConstants.UNZIP_FOLDER + zipLinkElement.text().replaceAll(\"\\\\W\", \"\"));\n final boolean isUnzipped = unZipFileFromUrl(zipUrl, unzipFolder);\n\n if (!isUnzipped)\n return null;\n\n return unzipFolder;\n }", "public void undeploy(Archive<?> archive) throws DeploymentException {\n jmxClient.undeploy(getDeploymentName(archive));\n }", "public byte[] getUnzippedFile() throws IOException {\r\n byte[] result = null;\r\n\r\n byte[] zipped = super.getFile();\r\n ByteArrayInputStream bais = new ByteArrayInputStream(zipped);\r\n ByteArrayOutputStream baos = new ByteArrayOutputStream();\r\n BufferedInputStream bis = new BufferedInputStream(new GZIPInputStream(bais));\r\n BufferedOutputStream bos = new BufferedOutputStream(baos);\r\n int read = -1;\r\n while ((read = bis.read()) != -1) {\r\n bos.write(read);\r\n }\r\n bos.flush();\r\n baos.flush();\r\n result = baos.toByteArray();\r\n bos.close();\r\n bis.close();\r\n bais.close();\r\n baos.close();\r\n\r\n return result;\r\n }", "public static void zip(BasicShell shell, File archive, List<File> filesToZip) {\n\t\ttry {\n\t\t\tshell.printOut(\"Creating archive '\" + archive.getPath() + \"'.\");\n\t\t\tfinal BufferedOutputStream archiveStream = new BufferedOutputStream(new FileOutputStream(archive));\n\t\t\tZipOutputStream zipStream = new ZipOutputStream(archiveStream);\n\t\t\tzipStream.setLevel(7);\n\t\t\t\n\t\t\tString pwd = shell.pwd().getPath();\n\t\t\tfor ( File file : filesToZip) {\n\t\t\t\tString name = file.getPath();\n\t\t\t\tif (name.equals(pwd)) continue;\n\t\t\t\t\n\t\t\t\tif ( name.startsWith(pwd) ) {\n\t\t\t\t\tname = name.substring(pwd.length()+1);\n\t\t\t\t}\n\t\t\t\tZipEntry entry = new ZipEntry(name);\n\t\t\t\tzipStream.putNextEntry(entry);\n\t\t\t\tif ( file.isFile() ) {\n\t\t\t\t\tBufferedInputStream fileStream = new BufferedInputStream(new FileInputStream(file));\n\t\t\t\t\tbyte[] buffer = new byte[2048];\n\t\t\t\t\tint count = fileStream.read(buffer);\n\t\t\t\t\twhile ( count > -1 ) {\n\t\t\t\t\t\tzipStream.write(buffer, 0, count);\n\t\t\t\t\t\tcount = fileStream.read(buffer);\n\t\t\t\t\t}\n\t\t\t\t\tfileStream.close();\n\t\t\t\t}\n\t\t\t\tshell.printOut(\"File '\" + entry.getName() + \"' added.\");\n\t\t\t}\n\t\t\tzipStream.close();\n\t\t} catch (Exception e) {\n\t\t\tshell.getErrorHandler().handleError(Diagnostic.ERROR, e.getClass().getSimpleName() + \": \"+ e.getMessage());\n\t\t}\n\t}", "public static void unzipFiles(EmailTypes collection) {\n unzip(collection);\n }", "public static boolean zipFile(String fileName) throws IOException {\r\n File targetFile = new File(fileName);\r\n if (targetFile == null || !targetFile.exists()) {\r\n throw new IOException(\"target [\"+fileName+\"] doesn't exist!\");\r\n }\r\n if (!targetFile.canRead()) {\r\n throw new IOException(\"target [\"+fileName+\"] can't be read!\");\r\n }\r\n boolean result = false;\r\n byte[] buf = new byte[1024];\r\n // validate some stuff\r\n File zipFile = new File(fileName+\".zip\");\r\n if (zipFile.exists()) {\r\n zipFile.delete();\r\n }\r\n zipFile.createNewFile();\r\n ZipOutputStream out = new ZipOutputStream(new FileOutputStream(zipFile));\r\n FileInputStream in = new FileInputStream(targetFile.getAbsolutePath());\r\n out.putNextEntry(new ZipEntry(targetFile.getName()));\r\n int len;\r\n while ((len = in.read(buf)) > 0) {\r\n out.write(buf, 0, len);\r\n }\r\n out.closeEntry();\r\n in.close();\r\n out.close();\r\n // delete the source\r\n if (targetFile.delete()) {\r\n // rename to the original file\r\n result = zipFile.renameTo(targetFile);\r\n } else {\r\n zipFile.delete();\r\n }\r\n return result;\r\n }", "public CombineArchive (File zipFile)\n\t\tthrows IOException,\n\t\t\tJDOMException,\n\t\t\tParseException,\n\t\t\tCombineArchiveException\n\t{\n\t\tinit (zipFile, false);\n\t}", "synchronized void revise(String location, InputStream is)\n throws Exception\n {\n m_archive.revise(location, is);\n try\n {\n Module module = createModule();\n addModule(module);\n }\n catch (Exception ex)\n {\n m_archive.rollbackRevise();\n throw ex;\n }\n }", "public String execute(File directoryToZip) {\r\n return execute(directoryToZip,null);\r\n }", "protected static void zipDir(File zipDir, ZipOutputStream zos, String archiveSourceDir)\n throws IOException {\n String[] dirList = zipDir.list();\n byte[] readBuffer = new byte[40960];\n int bytesIn;\n //loop through dirList, and zip the files\n if (dirList != null) {\n for (String aDirList : dirList) {\n File f = new File(zipDir, aDirList);\n //place the zip entry in the ZipOutputStream object\n zos.putNextEntry(new ZipEntry(getZipEntryPath(f, archiveSourceDir)));\n if (f.isDirectory()) {\n //if the File object is a directory, call this\n //function again to add its content recursively\n zipDir(f, zos, archiveSourceDir);\n //loop again\n continue;\n }\n //if we reached here, the File object f was not a directory\n //create a FileInputStream on top of f\n try (FileInputStream fis = new FileInputStream(f)) {\n //now write the content of the file to the ZipOutputStream\n while ((bytesIn = fis.read(readBuffer)) != -1) {\n zos.write(readBuffer, 0, bytesIn);\n }\n }\n }\n }\n }", "public void zip(String directoryInZip, \n String filePath) throws Exception\n {\n File thisFile = new File(filePath);\n\n if (thisFile.exists()) {\n\n try {\n FileInputStream fi = new FileInputStream(thisFile);\n\n origin = new BufferedInputStream(fi, BUFFER);\n\n ZipEntry entry = new ZipEntry(directoryInZip + File.separator\n + thisFile.getName());\n out.putNextEntry(entry);\n\n int count;\n while ((count = origin.read(data, 0, BUFFER)) != -1) {\n out.write(data, 0, count);\n }\n origin.close();\n\n } catch (FileNotFoundException e) {\n logger.error(\"File \" + filePath + \" not found !!\", e);\n } catch (IOException e) {\n logger.error(\"Could not write to Zip File \", e);\n throw new Exception(\"Could not write to Zip File \", e);\n }\n\n } else {\n // Log message if file does not exist\n logger.info(\"File \" + thisFile.getName()\n + \" does not exist on file system\");\n\n } \t\t\n }", "protected void zipFile(File file, ZipOutputStream zOut, String vPath)\n throws IOException\n {\n if (!vPath.equalsIgnoreCase(\"WEB-INF/web.xml\")) {\n super.zipFile(file, zOut, vPath);\n } else {\n log(\"Warning: selected \"+archiveType+\" files include a WEB-INF/web.xml which will be ignored \" +\n \"(please use webxml attribute to \"+archiveType+\" task)\", Project.MSG_WARN);\n }\n }", "private static File untar(final File testdir) throws IOException {\n final String datafile = \"TestMetaMigrationConvertToPB\";\n String srcTarFile =\n System.getProperty(\"project.build.testSourceDirectory\", \"src/test\") +\n File.separator + \"data\" + File.separator + datafile + \".tgz\";\n File homedir = new File(testdir.toString());\n File tgtUntarDir = new File(homedir, datafile);\n if (tgtUntarDir.exists()) {\n if (!FileUtil.fullyDelete(tgtUntarDir)) {\n throw new IOException(\"Failed delete of \" + tgtUntarDir.toString());\n }\n }\n LOG.info(\"Untarring \" + srcTarFile + \" into \" + homedir.toString());\n FileUtil.unTar(new File(srcTarFile), homedir);\n Assert.assertTrue(tgtUntarDir.exists());\n return tgtUntarDir;\n }", "public void clean()\r\n {\r\n // DO NOT TOUCH\r\n // System.out.println(unzipedFilePath);\r\n\r\n // only clean if there was a successful unzipping\r\n if (success)\r\n {\r\n // only clean if the file path to remove matches the zipped file.\r\n if (unzippedFilePath.equals(zippedFilePath.substring(0,\r\n zippedFilePath.length() - 4)))\r\n {\r\n // System.out.println(\"to be implmented\");\r\n for (File c : outputDir.listFiles())\r\n {\r\n // System.out.println(c.toString());\r\n if (!c.delete())\r\n {\r\n System.out.println(\"failed to delete\" + c.toString());\r\n }\r\n }\r\n outputDir.delete();\r\n outputDir = null;\r\n }\r\n }\r\n }", "public void newZipEntry(ZipEntry zipEntry, InputStream inputStream);", "public static void unzipFiles(@NotNull String path, @NotNull String name) throws IOException {\n Path dir = Paths.get(path);\n final PathMatcher matcher = dir.getFileSystem().getPathMatcher(\"glob:**.zip\");\n try (final Stream<Path> stream = Files.list(dir)) {\n stream.filter(matcher::matches)\n .forEach(zipFile -> unzip(zipFile, dir, name));\n }\n }", "@Override\r\n\tpublic byte[] streamUnZipper(byte[] sampleBytes) throws FileSystemUtilException {\r\n\t\tthrow new FileSystemUtilException(\"000000\", null, Level.ERROR, null);\r\n\r\n\t}", "private String processZipFile(File zip, ReportPortalUser.ProjectDetails projectDetails,\n ReportPortalUser user, String baseUrl, Map<String, String> params) {\n String savedLaunchId = null;\n try (ZipFile zipFile = new ZipFile(zip)) {\n String launchId = startLaunch(projectDetails, user,\n zip.getName().substring(0, zip.getName().indexOf(\".\" + ZIP_EXTENSION)), params);\n savedLaunchId = launchId;\n CompletableFuture[] futures = zipFile.stream().filter(isFile.and(isXml)).map(zipEntry -> {\n XunitParseJob job = xmlParseJobProvider.get()\n .withParameters(projectDetails, launchId, user, getEntryStream(zipFile, zipEntry),\n params.get(SKIPPED_IS_NOT_ISSUE) != null && Boolean.parseBoolean(params.get(\n SKIPPED_IS_NOT_ISSUE)));\n return CompletableFuture.supplyAsync(job::call, service);\n }).toArray(CompletableFuture[]::new);\n ParseResults parseResults = processResults(futures);\n finishLaunch(launchId, projectDetails, user, parseResults, baseUrl);\n return launchId;\n } catch (Exception e) {\n updateBrokenLaunch(savedLaunchId);\n throw new ReportPortalException(ErrorType.IMPORT_FILE_ERROR, cleanMessage(e));\n }\n }" ]
[ "0.67302597", "0.6696408", "0.6599389", "0.6574496", "0.6566076", "0.65397006", "0.6504542", "0.64747566", "0.64573467", "0.64263505", "0.634087", "0.63224024", "0.6313621", "0.6305334", "0.6305334", "0.6259901", "0.6213078", "0.61559516", "0.6137596", "0.61261946", "0.60900164", "0.6064226", "0.604749", "0.5995646", "0.5982088", "0.5951298", "0.59185886", "0.59082794", "0.58452207", "0.5838901", "0.5817905", "0.5811147", "0.58106375", "0.5794662", "0.5793925", "0.5785524", "0.5729157", "0.5718282", "0.56948566", "0.5656109", "0.563707", "0.5581374", "0.5504311", "0.54233843", "0.5359037", "0.534727", "0.52603024", "0.51844174", "0.51674324", "0.51550525", "0.51550525", "0.5114699", "0.5097581", "0.50962126", "0.5082398", "0.50735825", "0.50639474", "0.5059941", "0.5030668", "0.5020111", "0.4997525", "0.49893674", "0.49733806", "0.4960619", "0.4947968", "0.48490626", "0.48304218", "0.4798863", "0.4786183", "0.47688398", "0.47548836", "0.4753025", "0.47516957", "0.47296572", "0.47283173", "0.47261575", "0.4703868", "0.47031578", "0.46974605", "0.4687067", "0.46696863", "0.46687326", "0.46646476", "0.46545184", "0.4651062", "0.4631788", "0.4585996", "0.45814833", "0.45797995", "0.45399943", "0.4528416", "0.45096642", "0.44807658", "0.4445089", "0.44308", "0.44205254", "0.44144505", "0.43951476", "0.4394851", "0.4393979" ]
0.66866034
2
Casts Msg value to Msg table if possible Does not do type conversion, if Msg value is not a table it will return null
public static MessageTable toTable(MessageValue<?> value) { if (value != null && value instanceof MessageTable) { return (MessageTable) value; } return null; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public abstract String doTableConvert(String sql);", "public OutMessage linkTypeMsg(InMessage msg) {\n\t\treturn null;\n\t}", "T convert(F experimenterMessageCase, D data) throws ConversionException;", "public static String convertString(String sType , String sValue) throws Exception{\n\t\tObject o = new Object[1];\r\n\t\tboolean emptyToNull = true;//DBProps.isEmptyNullNumbers();\r\n\t\tboolean Empty = false;\r\n\t\tif(null ==sValue || sValue.trim().length()<1) {\r\n\t\t\tEmpty = true;\r\n\t\t\to = \"\";\r\n\t\t}else {\r\n\t\t\ttry{\r\n\t\t\t\tif(\tsType.equalsIgnoreCase(\"BIT\") || sType.equalsIgnoreCase(\"BOOL\") || sType.equalsIgnoreCase(\"BOOLEAN\"))\r\n\t\t\t\t\tif(Empty || null == sValue || sValue.equals(\"0\") || sValue.equalsIgnoreCase(\"false\")){\r\n\t\t\t\t\t\to \t\t\t= new Boolean(false);\r\n\t\t\t\t\t}else{\r\n\t\t\t\t\t\to\t\t\t= new Boolean(true);\r\n\t\t\t\t\t}\r\n\t\t\t\telse if(sType.equalsIgnoreCase(\"INTEGER\") || sType.equalsIgnoreCase(\"SMALLINT\") || sType.equalsIgnoreCase(\"INT\") || sType.equalsIgnoreCase(\"MEDIUMINT\") || sType.equalsIgnoreCase(\"TINYINT\"))\r\n\t\t\t\t\tif(Empty){\r\n\t\t\t\t\t\tif(emptyToNull){\r\n\t\t\t\t\t\t\to = null;\r\n\t\t\t\t\t\t}else{\r\n\t\t\t\t\t\t\to \t\t\t= new Integer(0);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}else\r\n\t\t\t\t\t\to\t\t\t= new Integer(sValue);\r\n\t\t\t\telse if(sType.equalsIgnoreCase(\"REAL\") || sType.equalsIgnoreCase(\"FLOAT\"))\r\n\t\t\t\t\tif(Empty){\r\n\t\t\t\t\t\tif(emptyToNull){\r\n\t\t\t\t\t\t\to = null;\r\n\t\t\t\t\t\t}else{\r\n\t\t\t\t\t\t\to \t\t\t= new Float(0);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}else\r\n\t\t\t\t\t\to\t\t\t= new Float(sValue);\r\n\t\t\t\telse if(sType.equalsIgnoreCase(\"BIGINT\")||sType.equalsIgnoreCase(\"LONG\"))\r\n\t\t\t\t\tif(Empty){\r\n\t\t\t\t\t\tif(emptyToNull){\r\n\t\t\t\t\t\t\to = null;\r\n\t\t\t\t\t\t}else{\r\n\t\t\t\t\t\t\to \t\t\t= new Long(0);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}else\r\n\t\t\t\t\t\to\t\t\t= new Long(sValue);\r\n\t\t\t\telse if(sType.equalsIgnoreCase(\"NUMBER\"))\r\n\t\t\t\t\tif(Empty){\r\n\t\t\t\t\t\tif(emptyToNull){\r\n\t\t\t\t\t\t\to = null;\r\n\t\t\t\t\t\t}else{\r\n\t\t\t\t\t\t\to \t\t\t= new BigDecimal(0);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}else\r\n\t\t\t\t\t\to\t\t\t= new BigDecimal(sValue);\r\n\t\t\t\telse if(sType.equalsIgnoreCase(\"BIGDECIMAL\"))\r\n\t\t\t\t\tif(Empty){\r\n\t\t\t\t\t\tif(emptyToNull){\r\n\t\t\t\t\t\t\to = null;\r\n\t\t\t\t\t\t}else{\r\n\t\t\t\t\t\t\to \t\t\t= new BigDecimal(0);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}else\r\n\t\t\t\t\t\to\t\t\t= new BigDecimal(sValue);\r\n\t\t\t\telse if(sType.equalsIgnoreCase(\"SHORT\"))\r\n\t\t\t\t\tif(Empty){\r\n\t\t\t\t\t\tif(emptyToNull){\r\n\t\t\t\t\t\t\to = null;\r\n\t\t\t\t\t\t}else{\r\n\t\t\t\t\t\t\to \t\t\t= new Short((short)0);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}else {\r\n\t\t\t\t\t\to\t\t\t= new Short(sValue);\r\n\t\t\t\t\t}\r\n\t\t\t\telse if(sType.equalsIgnoreCase(\"DOUBLE\"))\r\n\t\t\t\t\tif(Empty){\r\n\t\t\t\t\t\tif(emptyToNull){\r\n\t\t\t\t\t\t\to = null;\r\n\t\t\t\t\t\t}else{\r\n\t\t\t\t\t\t\to \t\t\t= new Double(0);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}else {\r\n\t\t\t\t\t\to\t\t\t= new Double(sValue);\r\n\t\t\t\t\t}\r\n\t\t\t\telse if(sType.equalsIgnoreCase(\"BYTE\"))\r\n\t\t\t\t\tif(Empty) {\r\n\t\t\t\t\t\to\t\t\t= new Byte((byte)0);\r\n\t\t\t\t\t}else {\r\n\t\t\t\t\t\to\t\t\t= new Byte(sValue);\r\n\t\t\t\t\t}\r\n\t\t\t\telse if(sType.equalsIgnoreCase(\"DATE\") && (null != sValue) && (sValue.trim().length()>6)) {\r\n\t\t\t\t\tif(Empty) {\r\n\t\t\t\t\t\to \t\t\t= null;\r\n\t\t\t\t\t}else {\r\n\t\t\t\t\t\ttry{\r\n\t\t\t\t\t\t\t//if(sTypeLong.trim().equalsIgnoreCase(\"java.sql.Date\")){\r\n\t\t\t\t\t\t\tif(sValue.trim().length()>10){\r\n\t\t\t\t\t\t\t\tsValue \t\t= sValue.substring(0,11).trim();\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\to\t= java.sql.Date.valueOf(sValue);\r\n\t\t\t\t\t\t\t//}else{\r\n\t\t\t\t\t\t\t//\to\t= java.sql.Date.valueOf(sValue);\r\n\t\t\t\t\t\t\t//}\r\n\t\t\t\t\t\t}catch(Exception e){\r\n\t\t\t\t\t\t\to\t\t= (sValue);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}else if(sType.equalsIgnoreCase(\"DATETIME\") && (null != sValue) && (sValue.trim().length()>6)) {\r\n\t\t\t\t\tif(Empty)\r\n\t\t\t\t\t\to \t\t\t= null;\r\n\t\t\t\t\telse\r\n\t\t\t\t\t\ttry{\r\n\t\t\t\t\t\t\t//if(sTypeLong.trim().equalsIgnoreCase(\"java.sql.Timestamp\") || sTypeLong.trim().equalsIgnoreCase(\"java.sql.Date\")){\r\n\t\t\t\t\t\t\tif(sValue.trim().length()>10){\r\n\t\t\t\t\t\t\t\tsValue \t= sValue.substring(0,11).trim();\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\to\t= java.sql.Timestamp.valueOf(sValue);//java.sql.Date.valueOf(sValue);\r\n\t\t\t\t\t\t\t//}else{\r\n\t\t\t\t\t\t\t//\to\t= java.sql.Timestamp.valueOf(sValue);// java.sql.Date.valueOf(sValue);\r\n\t\t\t\t\t\t\t//}\r\n\t\t\t\t\t\t}catch(Exception e){\r\n\t\t\t\t\t\t\to\t\t= (sValue);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t}else if(sType.equalsIgnoreCase(\"TIME\") && (null != sValue) && (sValue.trim().length()>6) ) {\r\n\t\t\t\t\tif(Empty)\r\n\t\t\t\t\t\to \t\t\t= null;\r\n\t\t\t\t\telse\r\n\t\t\t\t\t\to\t\t\t= java.sql.Time.valueOf(sValue);\r\n\t\t\t\t}else if(sType.equalsIgnoreCase(\"TIMESTAMP\") && (null != sValue)) {\r\n\t\t\t\t\tif(Empty) {\r\n\t\t\t\t\t\to \t\t\t= null;\r\n\t\t\t\t\t}else if((sValue.trim().length()>8)) {\r\n\t\t\t\t\t\ttry{\r\n\t\t\t\t\t\t\to\t= java.sql.Timestamp.valueOf(sValue);\r\n\t\t\t\t\t\t}catch(Exception e){\r\n\t\t\t\t\t\t\t//System.out.println(sValue);\r\n\t\t\t\t\t\t\ttry{\r\n\t\t\t\t\t\t\t\tString[] dParts = sValue.split(\" \");\r\n\t\t\t\t\t\t\t\tif(dParts.length > 2){\r\n\t\t\t\t\t\t\t\t\to\t= java.sql.Timestamp.valueOf(dParts[0]+\" \"+dParts[1]);\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t}catch(Exception er){\r\n\t\t\t\t\t\t\t\tthrow er;\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t//e.printStackTrace();\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}else {\r\n\t\t\t\t\t\to = null;\r\n\t\t\t\t\t}\r\n\t\t\t\t}else {\r\n\t\t\t\t\to\t\t\t\t= \"'\"+sValue+\"'\";\r\n\t\t\t\t}\r\n\t\t\t}catch(Exception err){\r\n\t\t\t\tthrow err;\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn o.toString();\r\n\t}", "Object getConvertedValue() throws ConversionException;", "public OutMessage voiceTypeMsg(InMessage msg) {\n\t\treturn null;\n\t}", "public void sendAnycast(String msg) {\n\t}", "Object transform(String cellValue, Type toValueType) throws Throwable;", "default Object convert(GenericRowData row) {\n return convert(row, -1);\n }", "@Test\n public void testCastFunction() throws Exception {\n String sql = \"SELECT cast(a as string) FROM g\";\n Node fileNode = sequenceSql(sql, TSQL_QUERY);\n\n Node queryNode = verify(fileNode, Query.ID, Query.ID);\n\n Node selectNode = verify(queryNode, Query.SELECT_REF_NAME, Select.ID);\n Node functionNode = verifyExpressionSymbol(selectNode, Select.SYMBOLS_REF_NAME, Function.ID);\n verifyProperty(functionNode, Function.NAME_PROP_NAME, \"cast\");\n verifyElementSymbol(functionNode, Function.ARGS_REF_NAME, 1, \"a\");\n verifyConstant(functionNode, Function.ARGS_REF_NAME, 2, \"string\");\n \n Node fromNode = verify(queryNode, Query.FROM_REF_NAME, From.ID);\n verifyUnaryFromClauseGroup(fromNode, From.CLAUSES_REF_NAME, 1, \"g\");\n \n verifySql(\"SELECT cast(a AS string) FROM g\", fileNode);\n }", "protected abstract Object toObject(ByteBuffer content, Type targetType) throws BeanConversionException;", "T convert(S e);", "public abstract void fromProto(Message message, TARGET row);", "@Test\n public void testMultiCastFunction() throws Exception {\n String sql = \"SELECT cast(cast(a as timestamp) as string) FROM g\";\n Node fileNode = sequenceSql(sql, TSQL_QUERY);\n\n Node queryNode = verify(fileNode, Query.ID, Query.ID);\n\n Node selectNode = verify(queryNode, Query.SELECT_REF_NAME, Select.ID);\n Node function1Node = verifyExpressionSymbol(selectNode, Select.SYMBOLS_REF_NAME, Function.ID);\n verifyProperty(function1Node, Function.NAME_PROP_NAME, \"cast\");\n Node function2Node = verify(function1Node, Function.ARGS_REF_NAME, 1, Function.ID);\n verifyConstant(function1Node, Function.ARGS_REF_NAME, 2, \"string\");\n\n verifyElementSymbol(function2Node, Function.ARGS_REF_NAME, 1, \"a\");\n verifyConstant(function2Node, Function.ARGS_REF_NAME, 2, \"timestamp\");\n \n Node fromNode = verify(queryNode, Query.FROM_REF_NAME, From.ID);\n verifyUnaryFromClauseGroup(fromNode, From.CLAUSES_REF_NAME, 1, \"g\");\n \n verifySql(\"SELECT cast(cast(a AS timestamp) AS string) FROM g\", fileNode);\n }", "private void convert(Map map) {\n if (map == null)\n return;\n\n for (Object key : valueTypes.keySet()) {\n MessagePackObject mpo = (MessagePackObject) map.get(key);\n if (mpo != null)\n map.put(key, mpo.convert(Templates.tNullable(\n TemplateRegistry.lookup(valueTypes.get(key)))));\n }\n\n }", "@Override\n\tpublic void msgAtTable() {\n\t\t\n\t}", "@Override\n\tpublic void msgAtTable() {\n\t\t\n\t}", "T convert(S s) throws UnconvertableException;", "public <T extends Message> T getMessageClass(String fixmsg) throws Exception {\r\n\r\n Message message = MessageUtils.parse(messageFactory, dd, fixmsg);\r\n String msgType = message.getHeader().getField(new StringField(35)).getValue();\r\n if(msgType.equals(\"BJ\") || msgType.equals(\"BS\")) {\r\n log.debug(\"Handling a TradingSessionList Response -- \" + fixmsg);\r\n message.getHeader().setField(new BeginString(\"FIXT.1.19\"));\r\n }\r\n Message factorymessage = messageFactory.create(message.getHeader().getString(8), message.getHeader().getString(35));\r\n factorymessage.fromString(fixmsg,dd, false);\r\n return (T) factorymessage;\r\n }", "protected abstract V convertToModelCell(C column,\n CellValue< ? > cell);", "public OutMessage eventTypeMsg(InMessage msg) {\n\t\treturn null;\n\t}", "public static MessageNumber toNumber(MessageValue<?> value) {\n\t\tif (value != null) {\n\t\t\tif (value instanceof MessageNumber) {\n\t\t\t\treturn (MessageNumber) value;\n\t\t\t}\n\t\t\telse {\n\t\t\t\treturn new MessageNumberImpl(value.asString());\n\t\t\t}\n\t\t}\n\t\treturn null;\n\t}", "public Object toSQL(final Object object) {\n if ((object == null) || (_convertFrom == null)) {\n return object;\n }\n return _convertFrom.convert(object);\n }", "private DAPMessage constructFrom(DatabaseTableRecord record) {\n return DAPMessage.fromXML(record.getStringValue(CommunicationNetworkServiceDatabaseConstants.DAP_MESSAGE_DATA_COLUMN_NAME));\n }", "T convert(String value);", "Object convertDBValueToJavaValue(Object value, Class<?> javaType);", "private CData convert(EValueType type, String str) {\n switch (type)\n {\n case DOUBLE_64:\n return new CData(type, Double.valueOf(str));\n case FLOAT_32:\n return new CData(type, Float.valueOf(str));\n case INT_16:\n return new CData(type, Short.valueOf(str));\n case INT_32:\n return new CData(type, Integer.valueOf(str));\n case INT_64:\n return new CData(type, Long.valueOf(str));\n case INT_8:\n return new CData(type, str.charAt(0));\n case UINT_64:\n return new CData(type, Long.valueOf(str));\n case UINT_32:\n return new CData(type, Long.valueOf(str));\n case UINT_16:\n return new CData(type, Character.valueOf(str.charAt(0)));\n case UINT_8:\n return new CData(type, str.charAt(0));\n case VOID:\n default:\n return CData.VOID;\n }\n }", "public T caseDatatype(Datatype object)\n {\n return null;\n }", "public <T> T cast();", "@Override\n public Object toJdbcType(Object value) {\n return value;\n }", "private Matrix toMatrix(Object o) {\n\t\tif(o instanceof String) {\n\t\t\tif(!isMatrix((String) o)) return null;\n\t\t\telse if(o.equals(\"A\")) return a;\n\t\t\telse return b;\n\t\t}\n\t\telse if(o instanceof Matrix) return (Matrix) o;\n\t\telse return null;\n\t}", "private Object convertDBToField(Object value, Field field) {\n if(value == null)\n return null;\n \n Class<?> clazz = field.getType();\n \n if(Enum.class.isAssignableFrom(clazz))\n return Enum.valueOf((Class<Enum>)clazz, value.toString());\n \n if(Base.class.isAssignableFrom(clazz))\n return createInstance((Class<? extends Base>)clazz, (DBObject) value);\n \n if(value instanceof BasicDBList) {\n BasicDBList list = (BasicDBList)value;\n\n if(Collection.class.isAssignableFrom(clazz))\n return convertDBToCollectionField(list, field);\n \n if(clazz.isArray())\n return convertDBToArrayField(list, clazz);\n \n return value;\n }\n \n if(value instanceof BasicDBObject) {\n BasicDBObject map = (BasicDBObject)value;\n\n if(Map.class.isAssignableFrom(clazz))\n return convertDBToMapField(map, field);\n \n return value; \n }\n \n return clazz.isPrimitive() ? convertPrimitiveType(value, clazz) : value;\n }", "public interface ValueConvertor {\n\t/**\n\t * \n\t * Convert the value of result set to JAVA type<BR>\n\t * \n\t * @param cursor\n\t * @param columnIndex\n\t * @param javaType\n\t * @return value after converting\n\t */\n\tObject convertCursorToJavaValue(Cursor cursor, int columnIndex,\n\t\t\tClass<?> javaType);\n\n\t/**\n\t * \n\t * Convert DB type to JAVA type<BR>\n\t * \n\t * @param value\n\t * @param javaType\n\t * @return value after converting\n\t */\n\tObject convertDBValueToJavaValue(Object value, Class<?> javaType);\n\n\t/**\n\t * Convert JAVA type to DB type<BR>\n\t * \n\t * @param value\n\t * @param javaType\n\t * @return value after converting\n\t */\n\tObject convertJavaValueToDBValue(Object value, Class<?> javaType);\n}", "@SuppressWarnings(\"unchecked\")\n public static Object unmarshal(long msgArg, Type type) throws MarshalBusException {\n // Verify msgArg is valid\n if (msgArg == 0) {\n throw new MarshalBusException(\"cannot marshal invalid MsgArg into \" + type);\n }\n\n try {\n Object object;\n switch (getTypeId(msgArg)) {\n case ALLJOYN_ARRAY:\n /*\n * If the type parameter is an instance of Object (i.e. generic/unspecified),\n * then recompute the actual type based on the msgArg signature.\n */\n if (type == Object.class) {\n type = toType(getSignature(new long[]{msgArg}));\n }\n if (getElemSig(msgArg).charAt(0) == ALLJOYN_DICT_ENTRY_OPEN) {\n Type rawType = ((ParameterizedType) type).getRawType();\n rawType = (rawType == Map.class) ? HashMap.class : rawType;\n object = ((Class<?>) rawType).newInstance();\n for (int i = 0; i < getNumElements(msgArg); ++i) {\n long element = getElement(msgArg, i);\n Type[] typeArgs = ((ParameterizedType) type).getActualTypeArguments();\n // TODO Can't seem to get it to suppress the warning here...\n ((Map<Object, Object>) object).put(unmarshal(getKey(element), typeArgs[0]),\n unmarshal(getVal(element), typeArgs[1]));\n }\n return object;\n } else {\n Type componentType = (type instanceof GenericArrayType)\n ? ((GenericArrayType) type).getGenericComponentType()\n : ((Class<?>) type).getComponentType();\n Class<?> componentClass;\n if (componentType instanceof ParameterizedType) {\n Type rawType = ((ParameterizedType) componentType).getRawType();\n rawType = (rawType == Map.class) ? HashMap.class : rawType;\n componentClass = (Class<?>) rawType;\n } else {\n componentClass = (Class<?>) componentType;\n }\n object = Array.newInstance(componentClass, getNumElements(msgArg));\n for (int i = 0; i < getNumElements(msgArg); ++i) {\n /*\n * Under Sun the Array.set() is sufficient to check the\n * type. Under Android that is not the case.\n */\n Object component = unmarshal(getElement(msgArg, i), componentType);\n if (!componentClass.isInstance(component)) {\n throw new IllegalArgumentException(\"argument type mismatch\");\n }\n Array.set(object, i, component);\n }\n return object;\n }\n case ALLJOYN_BOOLEAN:\n return getBool(msgArg);\n case ALLJOYN_BOOLEAN_ARRAY:\n boolean[] b = getBoolArray(msgArg);\n Class<?> componentClass = ((Class<?>) type).getComponentType();\n if (componentClass == Boolean.class) {\n Boolean[] B = new Boolean[b.length];\n for (int i = 0; i < b.length; ++i) {\n B[i] = b[i];\n }\n return B;\n }\n return b;\n case ALLJOYN_BYTE:\n object = getEnumObject(type, (int) getByte(msgArg));\n if (object == null) {\n return getByte(msgArg);\n }\n return object;\n case ALLJOYN_BYTE_ARRAY:\n return getByteArray(msgArg);\n case ALLJOYN_DOUBLE:\n return getDouble(msgArg);\n case ALLJOYN_DOUBLE_ARRAY:\n return getDoubleArray(msgArg);\n case ALLJOYN_INT16:\n object = getEnumObject(type, (int) getInt16(msgArg));\n if (object == null) {\n return getInt16(msgArg);\n }\n return object;\n case ALLJOYN_INT16_ARRAY:\n return getInt16Array(msgArg);\n case ALLJOYN_INT32:\n object = getEnumObject(type, getInt32(msgArg));\n if (object == null) {\n return getInt32(msgArg);\n }\n return object;\n case ALLJOYN_INT32_ARRAY:\n return getInt32Array(msgArg);\n case ALLJOYN_INT64:\n object = getEnumObject(type, (int) getInt64(msgArg));\n if (object == null) {\n return getInt64(msgArg);\n }\n return object;\n case ALLJOYN_INT64_ARRAY:\n return getInt64Array(msgArg);\n case ALLJOYN_OBJECT_PATH:\n return getObjPath(msgArg);\n case ALLJOYN_SIGNATURE:\n return getSignature(msgArg);\n case ALLJOYN_STRING:\n return getString(msgArg);\n case ALLJOYN_STRUCT:\n /*\n * If the type parameter is an instance of Object or Object[] (i.e. generic/unspecified),\n * there is no implementation class on which to do reflection, so Type[] and Field[]\n * values can't be obtained. Instead, determine structure based on the msgArg signature.\n */\n if (type == Object.class || type == Object[].class) {\n String signature = getSignature(new long[] {msgArg});\n String[] sigs = Signature.split(signature.substring(1,signature.length()-1));\n if (sigs.length != getNumMembers(msgArg)) {\n throw new MarshalBusException(\n \"cannot marshal '\" + signature + \"' with \"\n + getNumMembers(msgArg) + \" members into \" + type + \" with \"\n + sigs.length + \" fields\");\n }\n Object[] array = (Object[]) Array.newInstance(Object.class, sigs.length);\n for (int i = 0; i < getNumMembers(msgArg); ++i) {\n array[i] = unmarshal(getMember(msgArg, i), toType(sigs[i]));\n }\n return array; // returned structure represented as a generic Object[]\n } else {\n Type[] types = Signature.structTypes((Class<?>) type);\n if (types.length != getNumMembers(msgArg)) {\n throw new MarshalBusException(\n \"cannot marshal '\" + getSignature(new long[] { msgArg }) + \"' with \"\n + getNumMembers(msgArg) + \" members into \" + type + \" with \"\n + types.length + \" fields\");\n }\n object = ((Class<?>) type).newInstance();\n Field[] fields = Signature.structFields((Class<?>) type);\n for (int i = 0; i < getNumMembers(msgArg); ++i) {\n Object value = unmarshal(getMember(msgArg, i), types[i]);\n fields[i].set(object, value);\n }\n return object;\n }\n case ALLJOYN_UINT16:\n object = getEnumObject(type, (int) getUint16(msgArg));\n if (object == null) {\n return getUint16(msgArg);\n }\n return object;\n case ALLJOYN_UINT16_ARRAY:\n return getUint16Array(msgArg);\n case ALLJOYN_UINT32:\n object = getEnumObject(type, getUint32(msgArg));\n if (object == null) {\n return getUint32(msgArg);\n }\n return object;\n case ALLJOYN_UINT32_ARRAY:\n return getUint32Array(msgArg);\n case ALLJOYN_UINT64:\n object = getEnumObject(type, (int) getUint64(msgArg));\n if (object == null) {\n return getUint64(msgArg);\n }\n return object;\n case ALLJOYN_UINT64_ARRAY:\n return getUint64Array(msgArg);\n case ALLJOYN_VARIANT:\n Variant variant = new Variant();\n variant.setMsgArg(msgArg);\n return variant;\n default:\n throw new MarshalBusException(\"unimplemented '\"\n + getSignature(new long[] { msgArg }) + \"'\");\n }\n } catch (Throwable th) {\n throw new MarshalBusException(\"cannot marshal '\" + getSignature(new long[] { msgArg })\n + \"' into \" + type, th);\n }\n }", "public Object caste(Object item, CastTo ct){\n Object result = new Object();\n switch(ct){\n case date:result = DateParser.parse((String)item, OutFormat.date);\n break;\n case datetime:result = DateParser.parse((String)item, OutFormat.datetime);\n break;\n case datetime2:result = DateParser.parse((String)item, OutFormat.datetime2);\n break;\n case smalldatetime:result = DateParser.parse((String)item, OutFormat.smalldatetime);\n break;\n case time:result = DateParser.parse((String)item, OutFormat.time);\n break;\n case CHAR:result = CharCatster(item);\n //return result.toString();\n break;\n case UNSIGNED:result = UnSigndCatster(item);\n break;\n case SIGNED:result = SigndCatster(item);\n break;\n case BINARY:result = BinaryCaster(item);\n break;\n }\n return result;\n }", "void checkSameDataType(String datatype, String datatype1)\n {\n DefaultTableModel semanticerror = (DefaultTableModel)tblErrorSemantic.getModel();\n if(datatype.equals(datatype1))\n {\n\n }\n else if(datatype.equals(\"INT\") && datatype1.equals(\"FLOAT\"))\n {\n \n }\n else if(datatype.equals(\"FLOAT\") && datatype1.equals(\"INT\"))\n {\n \n }\n else if(datatype1 == null)\n {\n\n }\n else\n {\n semanticerror.addRow(new Object[] {tblLexeme.getModel().getValueAt(tokenPos-2, 0),\"Incompatible Types: \"+datatype1+\" Cannot be converted to \"+datatype, tblLexeme.getModel().getValueAt(tokenPos-2, 2)}); \n } \n datatype = null;\n }", "public static HiveObjectConversion getConversion(\n ObjectInspector inspector, LogicalType dataType, HiveShim hiveShim) {\n if (inspector instanceof PrimitiveObjectInspector) {\n HiveObjectConversion conversion;\n if (inspector instanceof BooleanObjectInspector\n || inspector instanceof StringObjectInspector\n || inspector instanceof ByteObjectInspector\n || inspector instanceof ShortObjectInspector\n || inspector instanceof IntObjectInspector\n || inspector instanceof LongObjectInspector\n || inspector instanceof FloatObjectInspector\n || inspector instanceof DoubleObjectInspector\n || inspector instanceof BinaryObjectInspector\n || inspector instanceof VoidObjectInspector) {\n conversion = IdentityConversion.INSTANCE;\n } else if (inspector instanceof DateObjectInspector) {\n conversion = hiveShim::toHiveDate;\n } else if (inspector instanceof TimestampObjectInspector) {\n conversion = hiveShim::toHiveTimestamp;\n } else if (inspector instanceof HiveCharObjectInspector) {\n conversion =\n o ->\n o == null\n ? null\n : new HiveChar(\n (String) o, ((CharType) dataType).getLength());\n } else if (inspector instanceof HiveVarcharObjectInspector) {\n conversion =\n o ->\n o == null\n ? null\n : new HiveVarchar(\n (String) o, ((VarCharType) dataType).getLength());\n } else if (inspector instanceof HiveDecimalObjectInspector) {\n conversion = o -> o == null ? null : HiveDecimal.create((BigDecimal) o);\n } else if (inspector instanceof HiveIntervalYearMonthObjectInspector) {\n conversion =\n o -> {\n if (o == null) {\n return null;\n } else {\n Period period = (Period) o;\n return new HiveIntervalYearMonth(\n period.getYears(), period.getMonths());\n }\n };\n } else if (inspector instanceof HiveIntervalDayTimeObjectInspector) {\n conversion =\n o -> {\n if (o == null) {\n return null;\n } else {\n Duration duration = (Duration) o;\n return new HiveIntervalDayTime(\n duration.getSeconds(), duration.getNano());\n }\n };\n } else {\n throw new FlinkHiveUDFException(\n \"Unsupported primitive object inspector \" + inspector.getClass().getName());\n }\n // if the object inspector prefers Writable objects, we should add an extra conversion\n // for that\n // currently this happens for constant arguments for UDFs\n if (((PrimitiveObjectInspector) inspector).preferWritable()) {\n conversion = new WritableHiveObjectConversion(conversion, hiveShim);\n }\n return conversion;\n }\n\n if (inspector instanceof ListObjectInspector) {\n HiveObjectConversion eleConvert =\n getConversion(\n ((ListObjectInspector) inspector).getListElementObjectInspector(),\n ((ArrayType) dataType).getElementType(),\n hiveShim);\n return o -> {\n if (o == null) {\n return null;\n }\n Object[] array = (Object[]) o;\n List<Object> result = new ArrayList<>();\n\n for (Object ele : array) {\n result.add(eleConvert.toHiveObject(ele));\n }\n return result;\n };\n }\n\n if (inspector instanceof MapObjectInspector) {\n MapObjectInspector mapInspector = (MapObjectInspector) inspector;\n MapType kvType = (MapType) dataType;\n\n HiveObjectConversion keyConversion =\n getConversion(\n mapInspector.getMapKeyObjectInspector(), kvType.getKeyType(), hiveShim);\n HiveObjectConversion valueConversion =\n getConversion(\n mapInspector.getMapValueObjectInspector(),\n kvType.getValueType(),\n hiveShim);\n\n return o -> {\n if (o == null) {\n return null;\n }\n Map<Object, Object> map = (Map) o;\n Map<Object, Object> result = CollectionUtil.newHashMapWithExpectedSize(map.size());\n\n for (Map.Entry<Object, Object> entry : map.entrySet()) {\n result.put(\n keyConversion.toHiveObject(entry.getKey()),\n valueConversion.toHiveObject(entry.getValue()));\n }\n return result;\n };\n }\n\n if (inspector instanceof StructObjectInspector) {\n StructObjectInspector structInspector = (StructObjectInspector) inspector;\n\n List<? extends StructField> structFields = structInspector.getAllStructFieldRefs();\n\n List<RowType.RowField> rowFields = ((RowType) dataType).getFields();\n\n HiveObjectConversion[] conversions = new HiveObjectConversion[structFields.size()];\n for (int i = 0; i < structFields.size(); i++) {\n conversions[i] =\n getConversion(\n structFields.get(i).getFieldObjectInspector(),\n rowFields.get(i).getType(),\n hiveShim);\n }\n\n return o -> {\n if (o == null) {\n return null;\n }\n Row row = (Row) o;\n List<Object> result = new ArrayList<>(row.getArity());\n for (int i = 0; i < row.getArity(); i++) {\n result.add(conversions[i].toHiveObject(row.getField(i)));\n }\n return result;\n };\n }\n\n throw new FlinkHiveUDFException(\n String.format(\n \"Flink doesn't support convert object conversion for %s yet\", inspector));\n }", "@Override\n\tpublic Object parseValue(String value) throws IllegalArgumentException\n\t{\n\t\treturn derivedColumn.parseValue(value);\n\t}", "public static Object sqlToJavaConversion(Class destination, Object val) {\n\n\n if (destination == boolean.class || destination == Boolean.class) {\n return intToBool((int)val);\n }\n if (destination == LocalDateTime.class) {\n return stringToLocalDateTime((CharSequence)val);\n }\n\n return val;\n }", "protected <T> T convertForEntity(Object value, Class<T> type) {\r\n return typeConversionManager.convert(value, type);\r\n }", "private static Object convert(final String identifier, final Class<?> type, Object value) throws ParseException {\n if (type == Date.class) {\n return toDate(value, identifier);\n }\n if (type == PeriodDuration.class && value instanceof String) {\n try {\n return new PeriodDurationType((String) value);\n } catch (IllegalArgumentException ex) {\n // TODO: \"log and continue\" is not appropriate here, since the user can not know that his data is lost.\n LOGGER.log(Level.WARNING, \"Bad period duration value: {0} (property: {1})\",\n new Object[] {value, identifier});\n return null;\n }\n }\n if (InternationalString.class.isAssignableFrom(type) && value instanceof String) {\n return new SimpleInternationalString(value.toString());\n }\n if (Charset.class.isAssignableFrom(type) && value instanceof String) {\n return Charset.forName(value.toString());\n }\n if (Locale.class.isAssignableFrom(type) && value instanceof String) {\n String text = value.toString();\n text = text.substring(text.indexOf('.') + 1).trim();\n return Locales.parse(text);\n }\n if (!CharSequence.class.isAssignableFrom(type) && (value instanceof CharSequence)) {\n String text = value.toString();\n if (text.startsWith(\"nilReason:\")) {\n try {\n value = NilReason.valueOf(text.substring(\"nilReason:\".length())).createNilObject(type);\n } catch (URISyntaxException | IllegalArgumentException e) {\n throw new ParseException(\"Illegal value: \\\"\" + text + \"\\\".(property:\" + identifier + \")\", e);\n }\n } else {\n final boolean isCodeList = CodeList.class.isAssignableFrom(type);\n if (isCodeList || type == Locale.class || type == Charset.class || type.isEnum()) {\n text = text.substring(text.indexOf('.') + 1).trim();\n if (isCodeList) {\n value = Types.forCodeName(type.asSubclass(CodeList.class), text, false);\n } else {\n value = text;\n }\n }\n }\n }\n return value;\n }", "public T caseDataType(DataType object) {\n\t\treturn null;\n\t}", "public T caseDataType(DataType object) {\n\t\treturn null;\n\t}", "@Override\n\t\t\tpublic Object invoke(Tuple tuple) {\n\t\t\t\treturn type.cast( col.invoke(tuple) );\n\t\t\t}", "public Table getMessagesTable(){\n\t\treturn m_messages;\n\t}", "public static byte readType(byte[] msg) {\n return msg[0];\n }", "@Override\n\tpublic byte[] retrieve(String msgid)\n\t{\n\t\treturn null;\n\t}", "@Test\n public void testConversionFunction() throws Exception {\n String sql = \"SELECT CONVERT(a, string) FROM g\";\n Node fileNode = sequenceSql(sql, TSQL_QUERY);\n\n Node queryNode = verify(fileNode, Query.ID, Query.ID);\n\n Node selectNode = verify(queryNode, Query.SELECT_REF_NAME, Select.ID);\n Node functionNode = verifyExpressionSymbol(selectNode, Select.SYMBOLS_REF_NAME, Function.ID);\n verifyProperty(functionNode, Function.NAME_PROP_NAME, \"CONVERT\");\n\n verifyElementSymbol(functionNode, Function.ARGS_REF_NAME, 1, \"a\");\n verifyConstant(functionNode, Function.ARGS_REF_NAME, 2, \"string\");\n\n Node fromNode = verify(queryNode, Query.FROM_REF_NAME, From.ID);\n verifyUnaryFromClauseGroup(fromNode, From.CLAUSES_REF_NAME, 1, \"g\");\n \n verifySql(sql, fileNode);\n }", "public OutMessage locationTypeMsg(InMessage msg) {\n\t\treturn null;\n\t}", "protected abstract CellValue< ? extends Comparable< ? >> convertModelCellValue(C column,\n V cell);", "@Test\n public void testConversionFunction2() throws Exception {\n String sql = \"SELECT CONVERT(CONVERT(a, timestamp), string) FROM g\";\n Node fileNode = sequenceSql(sql, TSQL_QUERY);\n\n Node queryNode = verify(fileNode, Query.ID, Query.ID);\n\n Node selectNode = verify(queryNode, Query.SELECT_REF_NAME, Select.ID);\n Node function1Node = verifyExpressionSymbol(selectNode, Select.SYMBOLS_REF_NAME, Function.ID);\n verifyProperty(function1Node, Function.NAME_PROP_NAME, \"CONVERT\");\n\n Node function2Node = verify(function1Node, Function.ARGS_REF_NAME, 1, Function.ID);\n verifyProperty(function2Node, Function.NAME_PROP_NAME, \"CONVERT\");\n\n verifyElementSymbol(function2Node, Function.ARGS_REF_NAME, 1, \"a\");\n verifyConstant(function2Node, Function.ARGS_REF_NAME, 2, \"timestamp\");\n\n verifyConstant(function1Node, Function.ARGS_REF_NAME, 2, \"string\");\n\n Node fromNode = verify(queryNode, Query.FROM_REF_NAME, From.ID);\n verifyUnaryFromClauseGroup(fromNode, From.CLAUSES_REF_NAME, 1, \"g\");\n\n verifySql(sql, fileNode);\n }", "@Override\n\tpublic Message get(int value) throws SQLException {\n\t\treturn null;\n\t}", "@Override\r\n\tpublic void cast() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void cast() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void cast() {\n\t\t\r\n\t}", "private static int getRowType(int messageType, long senderId, long curUserID){\n int type;\n switch (messageType)\n {\n case BMessage.Type.TEXT:\n if (senderId == curUserID)\n type = TYPE_TEXT_USER;\n else type = TYPE_TEXT_FRIEND;\n break;\n\n case BMessage.Type.LOCATION:\n if (senderId == curUserID)\n type = TYPE_LOCATION_USER;\n else type = TYPE_LOCATION_FRIEND;\n break;\n\n case BMessage.Type.IMAGE:\n if (senderId == curUserID)\n type = TYPE_IMAGE_USER;\n else type = TYPE_IMAGE_FRIEND;\n break;\n\n default:\n type = -1;\n }\n\n return type;\n }", "@Override\n public String visit(CastExpr n, Object arg) {\n return null;\n }", "@SuppressWarnings(\"rawtypes\")\n public Object convert(Class type, String value) throws ConversionException {\n return value;\n }", "private T convert(String value)\n {\n if (value == null)\n {\n return null;\n }\n\n Object result = null;\n\n if (this.converter != null)\n {\n try\n {\n result = converter.convert(value);\n }\n catch (Exception e)\n {\n throw ExceptionUtils.throwAsRuntimeException(e);\n }\n }\n else if (String.class.equals(configEntryType))\n {\n result = value;\n }\n else if (Class.class.equals(configEntryType))\n {\n result = ClassUtils.tryToLoadClassForName(value);\n }\n else if (Boolean.class.equals(configEntryType))\n {\n Boolean isTrue = \"TRUE\".equalsIgnoreCase(value);\n isTrue |= \"1\".equalsIgnoreCase(value);\n isTrue |= \"YES\".equalsIgnoreCase(value);\n isTrue |= \"Y\".equalsIgnoreCase(value);\n isTrue |= \"JA\".equalsIgnoreCase(value);\n isTrue |= \"J\".equalsIgnoreCase(value);\n isTrue |= \"OUI\".equalsIgnoreCase(value);\n\n result = isTrue;\n }\n else if (Integer.class.equals(configEntryType))\n {\n result = Integer.parseInt(value);\n }\n else if (Long.class.equals(configEntryType))\n {\n result = Long.parseLong(value);\n }\n else if (Float.class.equals(configEntryType))\n {\n result = Float.parseFloat(value);\n }\n else if (Double.class.equals(configEntryType))\n {\n result = Double.parseDouble(value);\n }\n\n return (T) result;\n }", "Object convertJavaValueToDBValue(Object value, Class<?> javaType);", "@Override\n public Timestamp convertField(final Object field, final Optional<String> pattern, final String name) {\n if (field == null) {\n return null;\n }\n if (field instanceof Timestamp) {\n return (Timestamp) field;\n }\n if (field instanceof Date) {\n final Date date = (Date) field;\n return new Timestamp(date.getTime());\n }\n if (field instanceof Number) {\n final Number number = (Number) field;\n return new Timestamp(number.longValue());\n }\n if (field instanceof String) {\n final String string = field.toString().trim();\n if (string.isEmpty()) {\n return null;\n }\n\n if (pattern.isPresent()) {\n final DateTimeFormatter formatter = DateTimeFormatter.ofPattern(pattern.get());\n try {\n final LocalDateTime localDateTime = LocalDateTime.parse(string, formatter);\n return Timestamp.valueOf(localDateTime);\n } catch (final DateTimeParseException e) {\n final String message = String.format(\"Convert Field Name [%s] Value [%s] to Timestamp LocalDateTime parsing failed: %s\", name, field, e.getMessage());\n throw new IllegalTypeConversionException(message);\n }\n } else {\n try {\n final long number = Long.parseLong(string);\n return new Timestamp(number);\n } catch (final NumberFormatException e) {\n final String message = String.format(\"Convert Field Name [%s] Value [%s] to Timestamp Long parsing failed: %s\", name, field, e.getMessage());\n throw new IllegalTypeConversionException(message);\n }\n }\n }\n\n final String message = String.format(\"Convert Field Name [%s] Value [%s] Class [%s] to Timestamp not supported\", name, field, field.getClass());\n throw new IllegalTypeConversionException(message);\n }", "public X10Cast createCoercion(Position pos, Expr expr, Type toType) {\n try {\n // FIXME: Have to typeCheck, because the typechecker has already desugared this to a conversion chain\n return (X10Cast) xnf.X10Cast( pos, \n xnf.CanonicalTypeNode(pos, toType), \n expr, \n Converter.ConversionType.UNKNOWN_IMPLICIT_CONVERSION ).typeCheck(this);\n } catch (SemanticException e) {\n // work around for XTENLANG-1335\n try {\n return (X10Cast) xnf.X10Cast( pos, \n xnf.CanonicalTypeNode(pos, toType), \n expr, \n Converter.ConversionType.UNCHECKED ).typeCheck(this);\n } catch (SemanticException x) {\n // return null;\n }\n // end work around for XTENLANG-1335\n return null;\n }\n }", "public OutMessage imageTypeMsg(InMessage msg) {\n\t\treturn null;\n\t}", "public Message toMessage(Object message, Session session) throws JMSException, MessageConversionException {\r\n \t\tjavax.jms.Message jmsMessage = null;\r\n \t\tif (serializeToString){\r\n \t\t\tjmsMessage = session.createTextMessage(message.toString());\r\n \t\t} else if (message instanceof Serializable) {\r\n \t\t\tSerializable serializable = (Serializable) message;\r\n \t\t\tjmsMessage = session.createObjectMessage(serializable);\r\n \t\t}\r\n \t\treturn jmsMessage;\r\n \t}", "private void checkType(V value) {\n valueClass.cast(value);\n }", "@Override\n public SourceRecord convert() throws Exception {\n if (record == null) {\n throw new Exception (\"Cannot convert non-existing domain record\");\n }\n if (schema == null) {\n throw new Exception (\"Cannot convert non-existing kafka schema\");\n }\n if (record.getRecordOffset() == null) {\n throw new Exception (\"Cannot convert domain record with no offset\");\n }\n if (mode == null) {\n throw new Exception (\n \"Cannot convert record without connector mode configuration\"\n );\n }\n \n SourceRecord sourceRecord = null;\n \n if (logger.isTraceEnabled()) {\n logger.trace (\"Converting: \" + record.toJSONString());\n }\n \n switch (record.getDomainRecordType()) {\n case CHANGEROW_RECORD:\n {\n if (mode.getCDCFormat() == ConnectorCDCFormat.CHANGEROW) {\n sourceRecord = convertChangeRowRecord (record);\n }\n else {\n throw new Exception (\n \"Invalid configuration, not expecting \" + \n record.getDomainRecordType() + \" records when \" +\n \"configured for CDC format: \" + mode.getCDCFormat()\n );\n }\n break;\n }\n case CHANGESET_RECORD:\n {\n if (mode.getCDCFormat() == ConnectorCDCFormat.CHANGESET) {\n sourceRecord = convertChangeSetRecord (record);\n }\n else {\n throw new Exception (\n \"Invalid configuration, not expecting \" + \n record.getDomainRecordType() + \" records when \" +\n \"configured for CDC format: \" + mode.getCDCFormat()\n );\n } \n break;\n }\n case TRANSACTION_INFO_RECORD:\n {\n if (mode.publishTxInfo()) {\n sourceRecord = convertTransactionDataRecord (record);\n }\n else {\n throw new Exception (\n \"Invalid configuration, not expecting \" + \n record.getDomainRecordType() + \" records when \" +\n \"configured to not publish transaction info \" +\n \"meta data messages\"\n );\n }\n break;\n }\n case METADATA_RECORD:\n case HEADER_RECORD:\n default:\n /* we do not convert these type of records to Kafka records */\n break;\n }\n\n return sourceRecord;\n }", "public void testObjectToStringScalar() {\n\n assertEquals(\"Boolean->String\", \"false\", LocaleConvertUtils.convert(Boolean.FALSE));\n assertEquals(\"Boolean->String\", \"true\", LocaleConvertUtils.convert(Boolean.TRUE));\n assertEquals(\"Byte->String\", \"123\", LocaleConvertUtils.convert(Byte.valueOf((byte) 123)));\n assertEquals(\"Character->String\", \"a\", LocaleConvertUtils.convert(Character.valueOf('a')));\n assertEquals(\"Double->String\", \"123\" + decimalSeparator + \"4\", LocaleConvertUtils.convert(Double.valueOf(123.4)));\n assertEquals(\"Float->String\", \"123\" + decimalSeparator + \"4\", LocaleConvertUtils.convert(Float.valueOf((float) 123.4)));\n assertEquals(\"Integer->String\", \"123\", LocaleConvertUtils.convert(Integer.valueOf(123)));\n assertEquals(\"Long->String\", \"123\", LocaleConvertUtils.convert(Long.valueOf(123)));\n assertEquals(\"Short->String\", \"123\", LocaleConvertUtils.convert(Short.valueOf((short) 123)));\n assertEquals(\"String->String\", \"abc\", LocaleConvertUtils.convert(\"abc\"));\n assertEquals(\"String->String null\", null, LocaleConvertUtils.convert(null));\n\n }", "public Object caseDataType(DataType object) {\r\n\t\treturn null;\r\n\t}", "@Override\n public Type tryPerformCall(final Type... args) {\n if (params.length != args.length) {\n return null;\n }\n for (int i = 0; i < args.length; ++i) {\n if (!args[i].canConvertTo(params[i])) {\n return null;\n }\n }\n return ret;\n }", "@Override\n\t\t\tprotected Type convert(String text) {\n\t\t\t\tType t = null;\n\t\t\t\ttry {\n\t\t\t\t\t// return null if the types do not match the\n\t\t\t\t\t// original\n\t\t\t\t\tt = Type.getType(text);\n\t\t\t\t\tif (t == null || !match(t, original)) {\n\t\t\t\t\t\treturn null;\n\t\t\t\t\t}\n\t\t\t\t} catch (Exception e) {}\n\t\t\t\treturn t;\n\t\t\t}", "@Override\n\tpublic void outACastExpr(ACastExpr node) {\n\t\tType t = nodeTypes.get(node.getExpr());\n\t\tboxIt(t); \n\t\tType result = nodeTypes.get(node.getType()); \n\t\til.append(fi.createCast(getBecelType(t), getBecelType(result)));\n\t\tunboxIt(result); \t\n\t}", "private MqttMessage messageFromJSON(JSONObject jsMsg) {\n\t\tMqttMessage result = null;\n\t\ttry {\n\t\t\t// There seems no good way to turn a JSONArray (of number)\n\t\t\t// into a Java byte array, so use brute force\n\t\t\tJSONArray jsPayload = jsMsg.getJSONArray(PAYLOAD);\n\t\t\tbyte[] payload = new byte[jsPayload.length()];\n\t\t\tfor (int i = 0; i < jsPayload.length(); i++) {\n\t\t\t\tpayload[i] = (byte) jsPayload.getInt(i);\n\t\t\t}\n\t\t\tresult = new MqttMessage(payload);\n\t\t\tresult.setQos(jsMsg.optInt(QOS, 0));\n\t\t\tresult.setRetained(jsMsg.optBoolean(RETAINED, false));\n\t\t} catch (JSONException e) {\n\t\t\ttraceException(TAG, \"messageFromJSON\", e);\n\t\t}\n\n\t\treturn result;\n\t}", "public static MessageString toString(MessageValue<?> value) {\n\t\tif (value != null) {\n\t\t\tif (value instanceof MessageString) {\n\t\t\t\treturn (MessageString) value;\n\t\t\t}\n\t\t\telse {\n\t\t\t\treturn new MessageStringImpl(value.asString());\n\t\t\t}\n\t\t}\n\t\treturn null;\n\t}", "public IMessageFieldValue createFromString( String text) throws Exception;", "public abstract String toHiveType(int sqlType);", "@Override\r\n\tpublic Object getValueFromString(ColumnWraper columnWraper, String fromValue) {\n\t\treturn fromValue;\r\n\t}", "protected void record2object(String tableAlias, Object obj, Database db, ResultSet results, int position)\r\n throws SQLException, ReflectiveOperationException {\r\n Object dbValue = record2object(tableAlias, results, position);\r\n if (results.wasNull()) {\r\n dbValue = null;\r\n }\r\n dbValue = db.unformatValue(dbValue, fieldAccess.typeFromSetter());\r\n if (dbValue == null && isPrimitive)\r\n throw new SQLException(\"Attempt to assign NULL from \" + databaseFieldName + \" to a primitive\");\r\n fieldAccess.set(obj, dbValue);\r\n }", "public int getMsgType(){\r\n return localMsgType;\r\n }", "public interface IMessageFieldValue {\n\t\n\t/**\n\t * Gets the corresponding field.\n\t *\n\t * @return the corresponding field\n\t */\n\tpublic MessageField getCorrespondingField();\n\t\n\t/**\n\t * Creates the from string.\n\t *\n\t * @param text the text\n\t * @return the i message field value\n\t * @throws Exception the exception\n\t */\n\tpublic IMessageFieldValue createFromString( String text) throws Exception;\n}", "public ValueConversionException(String message, Throwable cause) {\n/* 52 */ super(message, cause);\n/* */ }", "protected Object valueTranslator(Object value){\n\t\treturn value;\n\t}", "protected <T> T convert(Object value, Class<T> type) {\r\n return typeConversionManager.convert(value, type);\r\n }", "T convert(S source) throws ConversionException;", "public static SimpleMessageObject createMessageObject(byte[] data) {\n SimpleMessageObject retVal = new SimpleMessageObject();\n \n // data is of the form:\n // byte(data type)|int(length of name)|name|int(length of value)|value\n boolean keepGoing = true;\n int currentPointer = 0;\n while(keepGoing) {\n int type = data[currentPointer];\n int bytesToRead = 0;\n String name;\n currentPointer++;\n switch(type) {\n //String\n case 0x73:\n bytesToRead = DataConversions.getInt(data, currentPointer, 4);\n currentPointer += 4;\n name = DataConversions.getString(data, currentPointer, bytesToRead);\n currentPointer += bytesToRead;\n bytesToRead = DataConversions.getInt(data, currentPointer, 4);\n currentPointer += 4;\n String stringValue = DataConversions.getString(data, currentPointer, bytesToRead);\n currentPointer += bytesToRead;\n retVal.addString(name, stringValue);\n break;\n \n //int\n case 0x69:\n bytesToRead = DataConversions.getInt(data, currentPointer, 4);\n currentPointer += 4;\n name = DataConversions.getString(data, currentPointer, bytesToRead);\n currentPointer += bytesToRead;\n bytesToRead = DataConversions.getInt(data, currentPointer, 4);\n currentPointer += 4;\n int intValue = DataConversions.getInt(data, currentPointer, bytesToRead);\n currentPointer += bytesToRead;\n retVal.addInt(name, intValue); \n break;\n \n //long\n case 0x6c:\n bytesToRead = DataConversions.getInt(data, currentPointer, 4);\n currentPointer += 4;\n name = DataConversions.getString(data, currentPointer, bytesToRead);\n currentPointer += bytesToRead;\n bytesToRead = DataConversions.getInt(data, currentPointer, 4);\n currentPointer += 4;\n long longValue = DataConversions.getLong(data, currentPointer, bytesToRead);\n currentPointer += bytesToRead;\n retVal.addLong(name, longValue);\n break;\n \n //double\n case 0x64:\n bytesToRead = DataConversions.getInt(data, currentPointer, 4);\n currentPointer += 4;\n name = DataConversions.getString(data, currentPointer, bytesToRead);\n currentPointer += bytesToRead;\n bytesToRead = DataConversions.getInt(data, currentPointer, 4);\n currentPointer += 4;\n double doubleValue = DataConversions.getDouble(data, currentPointer, bytesToRead);\n currentPointer += bytesToRead;\n retVal.addDouble(name, doubleValue); \n break;\n \n //float\n case 0x66:\n bytesToRead = DataConversions.getInt(data, currentPointer, 4);\n currentPointer += 4;\n name = DataConversions.getString(data, currentPointer, bytesToRead);\n currentPointer += bytesToRead;\n bytesToRead = DataConversions.getInt(data, currentPointer, 4);\n currentPointer += 4;\n float floatValue = DataConversions.getFloat(data, currentPointer, bytesToRead);\n currentPointer += bytesToRead;\n retVal.addFloat(name, floatValue); \n break;\n \n //char\n case 0x63:\n bytesToRead = DataConversions.getInt(data, currentPointer, 4);\n currentPointer += 4;\n name = DataConversions.getString(data, currentPointer, bytesToRead);\n currentPointer += bytesToRead;\n bytesToRead = DataConversions.getInt(data, currentPointer, 4);\n currentPointer += 4;\n char charValue = DataConversions.getChar(data, currentPointer, bytesToRead);\n currentPointer += bytesToRead;\n retVal.addChar(name, charValue);\n break;\n \n //byte array\n case 0x62:\n bytesToRead = DataConversions.getInt(data, currentPointer, 4);\n currentPointer += 4;\n name = DataConversions.getString(data, currentPointer, bytesToRead);\n currentPointer += bytesToRead;\n bytesToRead = DataConversions.getInt(data, currentPointer, 4);\n currentPointer += 4;\n byte[] byteValue = DataConversions.getByteArray(data, currentPointer, bytesToRead);\n currentPointer += bytesToRead;\n retVal.addByteArray(name, byteValue);\n break;\n }\n \n if(currentPointer == data.length) {\n keepGoing = false;\n }\n }\n \n return retVal;\n }", "public T caseRecordType(RecordType object) {\n\t\treturn null;\n\t}", "public static Map<String, String> messageToMap(Message msg) {\n Map<String, String> map = new HashMap<>();\n if (msg == null) return map;\n\n if (msg.fixedHeader().messageType() == MqttMessageType.PUBLISH) {\n MqttPublishVariableHeader variableHeader = (MqttPublishVariableHeader) msg.variableHeader();\n MqttPublishPayload payload = (MqttPublishPayload) msg.payload();\n map.put(\"type\", String.valueOf(MqttMessageType.PUBLISH.value()));\n map.put(\"retain\", BooleanUtils.toString(msg.fixedHeader().retain(), \"1\", \"0\"));\n map.put(\"qos\", String.valueOf(msg.fixedHeader().qos().value()));\n map.put(\"dup\", BooleanUtils.toString(msg.fixedHeader().dup(), \"1\", \"0\"));\n map.put(\"version\", msg.additionalHeader().version().toString());\n if (!msg.fixedHeader().retain()) map.put(\"clientId\", msg.additionalHeader().clientId());\n map.put(\"userName\", msg.additionalHeader().userName());\n map.put(\"topicName\", variableHeader.topicName());\n if (!msg.fixedHeader().retain()) map.put(\"packetId\", String.valueOf(variableHeader.packetId()));\n if (payload != null && payload.bytes() != null && payload.bytes().length > 0) try {\n map.put(\"payload\", new String(payload.bytes(), \"ISO-8859-1\"));\n } catch (UnsupportedEncodingException ignore) {\n }\n return map;\n } else if (msg.fixedHeader().messageType() == MqttMessageType.PUBREL) {\n MqttPacketIdVariableHeader variableHeader = (MqttPacketIdVariableHeader) msg.variableHeader();\n map.put(\"type\", String.valueOf(MqttMessageType.PUBREL.value()));\n map.put(\"version\", msg.additionalHeader().version().toString());\n map.put(\"clientId\", msg.additionalHeader().clientId());\n map.put(\"userName\", msg.additionalHeader().userName());\n map.put(\"packetId\", String.valueOf(variableHeader.packetId()));\n return map;\n } else {\n throw new IllegalArgumentException(\"Invalid in-flight MQTT message type: \" + msg.fixedHeader().messageType());\n }\n }", "@Nullable\n protected Object convertValueForType(MappingContext context, Object value) {\n Class<?> rawClass = context.getTypeInformation().getSafeToWriteClass();\n if (rawClass == null) {\n throw new ConfigMeMapperException(context, \"Cannot determine required type\");\n }\n\n // Step 1: check if a value transformer can perform a simple conversion\n Object result = leafValueHandler.convert(context.getTypeInformation(), value);\n if (result != null) {\n return result;\n }\n\n // Step 2: check if we have a special type like List that is handled separately\n result = handleSpecialTypes(context, value);\n if (result != null) {\n return result;\n }\n\n // Step 3: last possibility - assume it's a bean and try to map values to its structure\n return createBean(context, value);\n }", "public String makeConversion(String value);", "public FudgeMsg getNormalizedMessage(final FudgeMsg msg, final String securityUniqueId, final FieldHistoryStore history) {\n final FudgeMsg normalizedMsg = _normalizationRuleSet.getNormalizedMessage(msg, securityUniqueId, history);\n if (normalizedMsg == null) {\n return null;\n }\n if (normalizedMsg.getNumFields() == 0) {\n return null;\n }\n return normalizedMsg;\n }", "messages.Basemessage.BaseMessage.Type getType();", "MessagesType createMessagesType();", "public abstract String toText(T value);", "public SqlNode convertCallToSql(DremioContext\n context, RexProgram program, RexCall call, boolean ignoreCast) {\n return null;\n }", "org.apache.calcite.avatica.proto.Common.TypedValue getValue();", "private Time getTimeValueFromRecordBean(RecordBean recordBean){\n DateFormat formatter = new SimpleDateFormat(\"MM/dd/yyyy HH:mm:ss\");\n Time timeValue = null;\n try {\n timeValue = new Time(formatter.parse((String)recordBean.getValues().get(\"_timestamp\")).getTime());\n\n if (timeValue == null) {\n List<String> items = Arrays.asList(((String)recordBean.getValues().get(\"_message\")).split(\"\\\\s*,\\\\s*\"));\n timeValue = new Time(formatter.parse(items.get(0)).getTime());\n\n }\n\n } catch (Exception e) {\n e.printStackTrace();\n }\n return timeValue;\n }", "public abstract T getCellValueFromProto(Q q);", "public abstract Object fromProtoValue(Object in);", "public static Message mapToMessage(Map<String, String> map) {\n if (map == null || map.isEmpty()) return null;\n\n int type = Integer.parseInt(map.get(\"type\"));\n if (type == MqttMessageType.PUBLISH.value()) {\n byte[] bytes = new byte[0];\n if (map.get(\"payload\") != null) try {\n bytes = map.get(\"payload\").getBytes(\"ISO-8859-1\");\n } catch (UnsupportedEncodingException ignore) {\n }\n int pid = Integer.parseInt(map.getOrDefault(\"packetId\", \"0\"));\n return new Message<>(\n new MqttFixedHeader(\n MqttMessageType.PUBLISH,\n BooleanUtils.toBoolean(map.getOrDefault(\"dup\", \"0\"), \"1\", \"0\"),\n MqttQoS.valueOf(Integer.parseInt(map.getOrDefault(\"qos\", \"0\"))),\n BooleanUtils.toBoolean(map.getOrDefault(\"retain\", \"0\"), \"1\", \"0\"),\n 0\n ),\n new MqttAdditionalHeader(\n MqttVersion.valueOf(map.getOrDefault(\"version\", MqttVersion.MQTT_3_1_1.toString())),\n map.get(\"clientId\"),\n map.get(\"userName\"),\n null\n ),\n pid > 0 ? MqttPublishVariableHeader.from(map.get(\"topicName\"), pid)\n : MqttPublishVariableHeader.from(map.get(\"topicName\")),\n new MqttPublishPayload(\n bytes\n ));\n } else if (type == MqttMessageType.PUBREL.value()) {\n return new Message<>(\n new MqttFixedHeader(\n MqttMessageType.PUBREL,\n false,\n MqttQoS.AT_LEAST_ONCE,\n false,\n 0\n ),\n new MqttAdditionalHeader(\n MqttVersion.valueOf(map.getOrDefault(\"version\", MqttVersion.MQTT_3_1_1.toString())),\n map.get(\"clientId\"),\n map.get(\"userName\"),\n null\n ),\n MqttPacketIdVariableHeader.from(\n Integer.parseInt(map.getOrDefault(\"packetId\", \"0\"))\n ),\n null\n );\n } else {\n throw new IllegalArgumentException(\"Invalid in-flight MQTT message type: \" + MqttMessageType.valueOf(type));\n }\n }", "@Override\n\tpublic MessageVO readMessage(String userid, int mid) {\n\t\treturn null;\n\t}", "com.google.protobuf.StringValue getConversionAction();" ]
[ "0.53311616", "0.5082773", "0.5068267", "0.50117254", "0.49992234", "0.49832818", "0.4963146", "0.49404955", "0.4920902", "0.48431328", "0.47814733", "0.47547278", "0.47537518", "0.47516692", "0.47353807", "0.47283575", "0.47283575", "0.4706176", "0.46870214", "0.46710396", "0.46702984", "0.46620592", "0.46610114", "0.4652303", "0.46224457", "0.46210492", "0.46193042", "0.46185625", "0.46151355", "0.4614955", "0.45994407", "0.459843", "0.45767304", "0.4575749", "0.45736247", "0.45605323", "0.45534793", "0.4552422", "0.45513228", "0.4542625", "0.45414087", "0.45326233", "0.45326233", "0.45315602", "0.45171535", "0.45059252", "0.44954655", "0.44944534", "0.44928488", "0.4489103", "0.44871783", "0.44840533", "0.44743213", "0.44743213", "0.44743213", "0.44561514", "0.44450226", "0.44428214", "0.44362614", "0.4429751", "0.44100213", "0.44096813", "0.44034424", "0.43989068", "0.4397798", "0.43967032", "0.4379344", "0.4375068", "0.43729338", "0.4372431", "0.43649215", "0.43567374", "0.43539867", "0.4343189", "0.43371904", "0.43317777", "0.43288207", "0.43280682", "0.4321978", "0.43203744", "0.4317208", "0.43152544", "0.43117574", "0.430758", "0.43056774", "0.43050197", "0.43038967", "0.42989916", "0.42986387", "0.4294699", "0.42944804", "0.429023", "0.42835256", "0.42756915", "0.42731526", "0.42692095", "0.4264737", "0.42635432", "0.42621604", "0.425628" ]
0.6766868
0
Converts Msg value to Msg boolean if possible and if needed
public static MessageBoolean toBoolean(MessageValue<?> value) { if (value != null) { if (value instanceof MessageBoolean) { return (MessageBoolean) value; } else { return new MessageBooleanImpl(value.asString()); } } return null; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "boolean hasMsg();", "public boolean is_set_msg() {\n return this.msg != null;\n }", "public boolean isSetMsg() {\n return this.msg != null;\n }", "private String parseBoolean () {\r\n \r\n assert iMessage!=null;\r\n assert iIndex>=0;\r\n assert iIndex<=iMessage.length();\r\n \r\n char chr=next();//get next character\r\n assert \"ft\".indexOf(chr)>=0;//assert valid boolean start character\r\n switch (chr) {//switch on first character\r\n case 'f': skip(4);//skip to last character\r\n return \"false\";\r\n case 't': skip(3);//skip to last character\r\n return \"true\";\r\n default: assert false;//assert that we do not reach this statement\r\n return null;\r\n }//switch on first character\r\n \r\n }", "boolean getValue();", "com.google.protobuf.BoolValue getAreSystemMessages();", "public Boolean toBool(){\n\t\tString s = txt().trim();\n\t\tBoolean i;\n\t\ttry{\n\t\t\ti = Boolean.parseBoolean(s);\n\t\t}catch(NumberFormatException exp){\n\t\t\texp.printStackTrace();\n\t\t\treturn false;\n\t\t}\n\t\treturn i;\t\n\t}", "com.google.protobuf.BoolValueOrBuilder getAreSystemMessagesOrBuilder();", "boolean hasMessage();", "boolean hasMessage();", "boolean hasMessage();", "boolean hasMessage();", "boolean hasMessage();", "boolean hasMessage();", "boolean hasMessage();", "boolean hasMessage();", "public Boolean getValue() {\n/* 60 */ return Boolean.valueOf(this.val);\n/* */ }", "public boolean isOkToConvert()\n {\n return _okToConvert;\n }", "private boolean verifyMessagePresence(){\n boolean overallResult = true;\n \n for(int ii = 0; ii < 3; ii = ii +1){\n if(121 == getHidden(ii)){\n overallResult = true;\n }else{\n overallResult = false;\n }\n }\n \n return overallResult;\n }", "public boolean getValue();", "boolean hasMsgid();", "boolean hasUserMessage();", "public boolean isSetStateMsg() {\n return this.stateMsg != null;\n }", "protected boolean convertToBoolean(Object value) {\n if (value == null) {\n return false;\n }\n else if (value instanceof Boolean) {\n return (Boolean)value;\n }\n else if (value instanceof Number) {\n return isNumberTrue((Number)value);\n }\n else if (value instanceof String) {\n String stringValue = (String)value;\n if (\"true\".equals(stringValue)) {\n return true;\n }\n else if (\"false\".equals(stringValue)) {\n return false;\n }\n else if (NumberUtils.isCreatable(stringValue)) {\n Number number = NumberUtils.createNumber(stringValue);\n return isNumberTrue(number);\n }\n else {\n return stringValue.length() > 0;\n }\n }\n else if (value instanceof Collection) {\n return ((Collection) value).size() > 0;\n }\n return false;\n }", "boolean hasMessageType();", "public boolean loadMessageBox(){\n boolean isMessagebox = true;\n byte tempType = CustomCanvas.msgType;\n CustomCanvas.msgType = -1;\n \n if(tempType == 0){\n tempType = 1;\n } else if(tempType == 20) {\n tempType = 16;\n }\n if (tempType == 1 || tempType == 2 || tempType == 3 || tempType == 16) {\n isMessagebox = false;\n }\n handleSmartPopup(tempType);\n return isMessagebox;\n }", "public boolean getIsMessage()\n {\n return isMessage;\n }", "private static boolean checkmsg(SmsMessage smsmessage) {\n\t\tboolean isok = false;\n\t\t\n//\t private String MA_TYPE=\"\";\n//\t private String MESSAGE_TYPE=\"\";\n//\t private String TEL=\"\";\n//\t private String VBODY=\"\";\n//\t private String VTIME=\"\";\n\n\t\tif(null != smsmessage.getTEL() \n\t\t\t\t&& !\"\".equalsIgnoreCase(smsmessage.getTEL()) &&\n\t\t null != smsmessage.getVBODY()\n\t\t\t\t&& !\"\".equalsIgnoreCase(smsmessage.getVBODY())){\n\t\t\tisok = true;\n\t\t}\n\t\t\n\t\treturn isok;\n\t}", "public Value restrictToStrBoolNum() {\n checkNotPolymorphicOrUnknown();\n Value r = new Value(this);\n r.object_labels = r.getters = r.setters = null;\n r.flags &= STR | BOOL | NUM;\n return canonicalize(r);\n }", "private void IntToBool()throws TokenException{\n\t\tif (getTkn()==TipeToken.Bilangan)\n\t\t\tif (getTipeBilangan()==Tipe._int)\n\t\t\t\tif (getBilanganInt()==0){\n\t\t\t\t\tSetBilangan(false);\n\t\t\t\t\treturn;\n\t\t\t\t}else if (getBilanganInt()==1){\n\t\t\t\t\tSetBilangan(true);\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\tthrow new TokenException(\"THIS TOKEN CANNOT BE CONVERTED TO BOOL\");\n\t\t}", "boolean getIsOk();", "private String convertBoolean(boolean booToConv) {\n\t\tString convText = \"\";\n\t\tif (booToConv) {\n\t\t\tconvText = \"Yes\";\n\t\t} else {\n\t\t\tconvText = \"No\";\n\t\t}\n\t\treturn convText;\n\t}", "boolean hasMsgID();", "boolean hasMsgID();", "@Override\n\t\tpublic Boolean convert(String s) {\n\t\t\tString value = s.toLowerCase();\n\t\t\tif (\"true\".equals(value) || \"1\".equals(value) /* || \"yes\".equals(value) || \"on\".equals(value) */) {\n\t\t\t\treturn Boolean.TRUE;\n\t\t\t}\n\t\t\telse if (\"false\".equals(value) || \"0\".equals(value) /* || \"no\".equals(value) || \"off\".equals(value) */) {\n\t\t\t\treturn Boolean.FALSE;\n\t\t\t}\n\t\t\telse {\n\t\t\t\tthrow new RuntimeException(\"Can not parse to boolean type of value: \" + s);\n\t\t\t}\n\t\t}", "private static boolean stringToBoolean(String value) {\n if (value.equals(\"1\")) {\n return true;\n }\n else {\n return false;\n }\n }", "org.apache.xmlbeans.XmlBoolean xgetString();", "boolean hasRemsg();", "public Boolean asBoolean();", "public boolean hasMsgType() {\n return ((bitField0_ & 0x00000001) == 0x00000001);\n }", "boolean getBoolValue();", "boolean getBoolValue();", "public boolean booleanValue() {\n if (originalValue instanceof Boolean) {\n return (Boolean) originalValue;\n } else if (originalValue instanceof Number) {\n return ((Number) originalValue).intValue() != 0;\n } else {\n throw new CellValueCastException();\n }\n }", "@Override\n\tpublic void receive(boolean value) {\n\t\t\n\t}", "protected Boolean geBoolValue() {\n return boolValue;\n }", "public boolean hasMsgType() {\n return ((bitField0_ & 0x00000001) == 0x00000001);\n }", "public boolean apply(Message<?> msg);", "public static boolean toBoolean(byte[] value) {\r\n\t\treturn toBoolean(value, 0);\r\n\t}", "boolean isDefaultMessage();", "String byteOrBooleanRead();", "public boolean hasMsg() {\n return ((bitField0_ & 0x00000020) == 0x00000020);\n }", "boolean isSending();", "protected final boolean anyMsg() {\n\t\tDoorPulseCriterion dpc = new DoorPulseCriterion(this.getPulse() - 1);\n\t\treturn this.existMessage(dpc);\n\t}", "public boolean hasToUid() {\n return ((bitField0_ & 0x00000001) == 0x00000001);\n }", "Boolean isMessageRead(String msgId);", "public boolean hasMsg() {\n return ((bitField0_ & 0x00000020) == 0x00000020);\n }", "public boolean hasToUid() {\n return ((bitField0_ & 0x00000001) == 0x00000001);\n }", "public final boolean isMessageSetted() {\n\t\treturn engine.isPropertySetted(Properties.MESSAGE);\n\t}", "public boolean hasToUid() {\n return ((bitField0_ & 0x00000002) == 0x00000002);\n }", "public boolean isProcessed() \n{\nObject oo = get_Value(\"Processed\");\nif (oo != null) \n{\n if (oo instanceof Boolean) return ((Boolean)oo).booleanValue();\n return \"Y\".equals(oo);\n}\nreturn false;\n}", "private boolean sendAndCheckResp(byte[] userMessage, String trueResp, String falseResp) {\n\t\tbyte[] srvrResponse = sendServerCoded(userMessage);\n\t\tbyte[] expectedResponse = trueResp.getBytes();\n\t\tbyte[] alternateResponse = falseResp.getBytes();\n\n\t\tboolean truthVal = false;\n\t\tif (Arrays.equals(srvrResponse, expectedResponse)) {\n\t\t\ttruthVal = true;\n\t\t} else if (Arrays.equals(srvrResponse, alternateResponse)) {\n\t\t\t// truthVal = false;\n\t\t} else {\n\t\t\tComMethods.handleBadResp();\n\t\t}\n\t\treturn truthVal;\n\t}", "@Test\n\tpublic void testStringToBoolean() {\n\n\t\t// forwards for yes and no\n\t\tAssert.assertEquals(converter.convertForward(\"Yes\"), new Boolean(true));\n\t\tAssert.assertEquals(converter.convertForward(\"No\"), new Boolean(false));\n\n\t}", "public boolean hasToUid() {\n return ((bitField0_ & 0x00000002) == 0x00000002);\n }", "static void check(String msg, boolean value) {\n\t\tif (!value) throw new RuntimeException(msg);\n\t}", "abstract public boolean getAsBoolean();", "static Value<Boolean> parseBoolean(String value) {\n try {\n if (value == null || value.isEmpty()) return empty();\n return of(Boolean.parseBoolean(value));\n } catch (NumberFormatException error) {\n return empty();\n }\n }", "public boolean isSetMessage() {\n return this.Message != null;\n }", "public boolean isUserMessage() {\n return (msgType == MessageType.USER_MESSAGE);\n }", "public void setOkToConvert(boolean okToConvert)\n {\n _okToConvert = okToConvert;\n }", "boolean hasMessageInfoID();", "@java.lang.Override\n public boolean getBoolValue() {\n if (typeCase_ == 2) {\n return (java.lang.Boolean) type_;\n }\n return false;\n }", "boolean isValue();", "org.apache.xmlbeans.XmlBoolean xgetParlay();", "private boolean parseBoolean(final byte[] buffer, final int offset) {\n return buffer[offset] == 1;\n }", "boolean hasSendMessage();", "@Override\r\n\tpublic boolean handleMessage(Message msg) {\n\t\treturn false;\r\n\t}", "public static Boolean toBoolean(Object o, byte type) throws ExecException {\n try {\n switch (type) {\n case NULL:\n return null;\n case BOOLEAN:\n return (Boolean) o;\n case BYTE:\n return Boolean.valueOf(((Byte) o).byteValue() != 0);\n case INTEGER:\n return Boolean.valueOf(((Integer) o).intValue() != 0);\n case LONG:\n return Boolean.valueOf(((Long) o).longValue() != 0L);\n case BIGINTEGER:\n return Boolean.valueOf(!BigInteger.ZERO.equals(((BigInteger) o)));\n case BIGDECIMAL:\n return Boolean.valueOf(((BigDecimal) o).signum() != 0);\n case FLOAT:\n return Boolean.valueOf(((Float) o).floatValue() != 0.0F);\n case DOUBLE:\n return Boolean.valueOf(((Double) o).doubleValue() != 0.0D);\n case BYTEARRAY:\n String str = ((DataByteArray) o).toString();\n if (str.equalsIgnoreCase(\"true\")) {\n return Boolean.TRUE;\n } else if (str.equalsIgnoreCase(\"false\")) {\n return Boolean.FALSE;\n } else {\n return null;\n }\n case CHARARRAY:\n if (((String) o).equalsIgnoreCase(\"true\")) {\n return Boolean.TRUE;\n } else if (((String) o).equalsIgnoreCase(\"false\")) {\n return Boolean.FALSE;\n } else {\n return null;\n }\n case DATETIME:\n case MAP:\n case INTERNALMAP:\n case TUPLE:\n case BAG:\n case UNKNOWN:\n default:\n int errCode = 1071;\n String msg = \"Cannot convert a \" + findTypeName(o) + \" to a Boolean\";\n throw new ExecException(msg, errCode, PigException.INPUT);\n }\n } catch (ClassCastException cce) {\n throw cce;\n } catch (ExecException ee) {\n throw ee;\n } catch (NumberFormatException nfe) {\n int errCode = 1074;\n String msg = \"Problem with formatting. Could not convert \" + o + \" to Float.\";\n throw new ExecException(msg, errCode, PigException.INPUT, nfe);\n } catch (Exception e) {\n int errCode = 2054;\n String msg = \"Internal error. Could not convert \" + o + \" to Float.\";\n throw new ExecException(msg, errCode, PigException.BUG);\n }\n }", "private boolean isAllTrue(HashMap<Integer, Boolean> messages)\r\n {\r\n // Iterate through each value for each key in the map.\r\n for(boolean value : messages.values())\r\n {\r\n // If a value is false, then return false.\r\n if(!value)\r\n {\r\n return false;\r\n }\r\n }\r\n // If all values are true, then return true.\r\n return true;\r\n }", "public Object bool(String value) {\r\n if (value == null) return null;\r\n return isOracle() ? Integer.valueOf((isTrue(value) ? 1 : 0)) :\r\n Boolean.valueOf(isTrue(value));\r\n }", "public void setMsg(boolean status){\r\n\t\tthis.send = status;\r\n\t}", "public interface IsReceiveSMS\n {\n /**\n * receive message\n */\n String RECEIVE = \"1\";\n\n /**\n * do not receive message\n */\n String UN_RECEIVE = \"0\";\n }", "default boolean asBool() {\n\t\tthrow new EvaluatorException(\"Expecting a bool value\");\n\t}", "private boolean isVal() {\n\t\treturn look.type == Tag.BOOLEAN || look.type == Tag.NUMBER\n\t\t\t\t|| look.type == Tag.STRING || look.type == Tag.NULL;\n\n\t}", "public boolean getAccepted_tou();", "public boolean hasMsgData() {\n return ((bitField0_ & 0x00000002) == 0x00000002);\n }", "protected String getBooleanValueText(String value) {\n if (value.equals(Boolean.TRUE.toString())) {\n return getTrue();\n } else if (value.equals(Boolean.FALSE.toString())) {\n return getFalse();\n } else {\n // If it is neither true nor false it is must be an expression.\n return value;\n }\n }", "public abstract boolean read_boolean();", "boolean isReceiving();", "com.google.protobuf.BoolValue getPersistent();", "public Boolean getValue() {\n return value;\n }", "public Boolean getValue() {\n\t\treturn b;\n\t}", "public void testPositiveScalar() {\n Object value;\n\n /*\n * fixme Boolean converters not implemented value = LocaleConvertUtils.convert(\"true\", Boolean.TYPE); assertTrue(value instanceof Boolean);\n * assertEquals(((Boolean) value).booleanValue(), true);\n *\n * value = LocaleConvertUtils.convert(\"true\", Boolean.class); assertTrue(value instanceof Boolean); assertEquals(((Boolean) value).booleanValue(),\n * true);\n *\n * value = LocaleConvertUtils.convert(\"yes\", Boolean.TYPE); assertTrue(value instanceof Boolean); assertEquals(((Boolean) value).booleanValue(), true);\n *\n * value = LocaleConvertUtils.convert(\"yes\", Boolean.class); assertTrue(value instanceof Boolean); assertEquals(((Boolean) value).booleanValue(), true);\n *\n * value = LocaleConvertUtils.convert(\"y\", Boolean.TYPE); assertTrue(value instanceof Boolean); assertEquals(((Boolean) value).booleanValue(), true);\n *\n * value = LocaleConvertUtils.convert(\"y\", Boolean.class); assertTrue(value instanceof Boolean); assertEquals(((Boolean) value).booleanValue(), true);\n *\n * value = LocaleConvertUtils.convert(\"on\", Boolean.TYPE); assertTrue(value instanceof Boolean); assertEquals(((Boolean) value).booleanValue(), true);\n *\n * value = LocaleConvertUtils.convert(\"on\", Boolean.class); assertTrue(value instanceof Boolean); assertEquals(((Boolean) value).booleanValue(), true);\n *\n * value = LocaleConvertUtils.convert(\"false\", Boolean.TYPE); assertTrue(value instanceof Boolean); assertEquals(((Boolean) value).booleanValue(),\n * false);\n *\n * value = LocaleConvertUtils.convert(\"false\", Boolean.class); assertTrue(value instanceof Boolean); assertEquals(((Boolean) value).booleanValue(),\n * false);\n *\n * value = LocaleConvertUtils.convert(\"no\", Boolean.TYPE); assertTrue(value instanceof Boolean); assertEquals(((Boolean) value).booleanValue(), false);\n *\n * value = LocaleConvertUtils.convert(\"no\", Boolean.class); assertTrue(value instanceof Boolean); assertEquals(((Boolean) value).booleanValue(), false);\n *\n * value = LocaleConvertUtils.convert(\"n\", Boolean.TYPE); assertTrue(value instanceof Boolean); assertEquals(((Boolean) value).booleanValue(), false);\n *\n * value = LocaleConvertUtils.convert(\"n\", Boolean.class); assertTrue(value instanceof Boolean); assertEquals(((Boolean) value).booleanValue(), false);\n *\n * value = LocaleConvertUtils.convert(\"off\", Boolean.TYPE); assertTrue(value instanceof Boolean); assertEquals(((Boolean) value).booleanValue(), false);\n *\n * value = LocaleConvertUtils.convert(\"off\", Boolean.class); assertTrue(value instanceof Boolean); assertEquals(((Boolean) value).booleanValue(),\n * false);\n */\n\n value = LocaleConvertUtils.convert(\"123\", Byte.TYPE);\n assertTrue(value instanceof Byte);\n assertEquals(((Byte) value).byteValue(), (byte) 123);\n\n value = LocaleConvertUtils.convert(\"123\", Byte.class);\n assertTrue(value instanceof Byte);\n assertEquals(((Byte) value).byteValue(), (byte) 123);\n\n /*\n * fixme Character conversion not implemented yet value = LocaleConvertUtils.convert(\"a\", Character.TYPE); assertTrue(value instanceof Character);\n * assertEquals(((Character) value).charValue(), 'a');\n *\n * value = LocaleConvertUtils.convert(\"a\", Character.class); assertTrue(value instanceof Character); assertEquals(((Character) value).charValue(), 'a');\n */\n /*\n * fixme - this is a discrepancy with standard converters ( probably not major issue ) value = LocaleConvertUtils.convert(\"java.lang.String\",\n * Class.class); assertTrue(value instanceof Class); assertEquals(String.class, (Class) value);\n */\n\n value = LocaleConvertUtils.convert(\"123\" + decimalSeparator + \"456\", Double.TYPE);\n assertTrue(value instanceof Double);\n assertEquals(((Double) value).doubleValue(), 123.456, 0.005);\n\n value = LocaleConvertUtils.convert(\"123\" + decimalSeparator + \"456\", Double.class);\n assertTrue(value instanceof Double);\n assertEquals(((Double) value).doubleValue(), 123.456, 0.005);\n\n value = LocaleConvertUtils.convert(\"123\" + decimalSeparator + \"456\", Float.TYPE);\n assertTrue(value instanceof Float);\n assertEquals(((Float) value).floatValue(), (float) 123.456, (float) 0.005);\n\n value = LocaleConvertUtils.convert(\"123\" + decimalSeparator + \"456\", Float.class);\n assertTrue(value instanceof Float);\n assertEquals(((Float) value).floatValue(), (float) 123.456, (float) 0.005);\n\n value = LocaleConvertUtils.convert(\"123\", Integer.TYPE);\n assertTrue(value instanceof Integer);\n assertEquals(((Integer) value).intValue(), 123);\n\n value = LocaleConvertUtils.convert(\"123\", Integer.class);\n assertTrue(value instanceof Integer);\n assertEquals(((Integer) value).intValue(), 123);\n\n value = LocaleConvertUtils.convert(\"123\", Long.TYPE);\n assertTrue(value instanceof Long);\n assertEquals(((Long) value).longValue(), 123);\n\n value = LocaleConvertUtils.convert(\"123456\", Long.class);\n assertTrue(value instanceof Long);\n assertEquals(((Long) value).longValue(), 123456);\n\n /*\n * fixme - Short conversion not implemented at this point value = LocaleConvertUtils.convert(\"123\", Short.TYPE); assertTrue(value instanceof Short);\n * assertEquals(((Short) value).shortValue(), (short) 123);\n *\n * value = LocaleConvertUtils.convert(\"123\", Short.class); assertTrue(value instanceof Short); assertEquals(((Short) value).shortValue(), (short) 123);\n */\n\n String input;\n\n input = \"2002-03-17\";\n value = LocaleConvertUtils.convert(input, Date.class);\n assertTrue(value instanceof Date);\n assertEquals(input, value.toString());\n\n input = \"20:30:40\";\n value = LocaleConvertUtils.convert(input, Time.class);\n assertTrue(value instanceof Time);\n assertEquals(input, value.toString());\n\n input = \"2002-03-17 20:30:40.0\";\n value = LocaleConvertUtils.convert(input, Timestamp.class);\n assertTrue(value instanceof Timestamp);\n assertEquals(input, value.toString());\n\n }", "public boolean isAccepted_tou();", "public static boolean datoBoolean(){\n try {\n return(Boolean.parseBoolean(dato()));\n } catch (NumberFormatException error) {\n return(false);\n }\n }", "public java.lang.Boolean value() {\n return value;\n }", "public boolean hasMsgid() {\n return ((bitField0_ & 0x00000100) == 0x00000100);\n }", "@Test\n void transformtoBoolTest() {\n assertEquals(bot.transformtoBool(),bot);\n assertEquals(bof.transformtoBool(),bof);\n assertNotEquals(bot.transformtoBool(),bof);\n assertNotEquals(bof.transformtoBool(),bot);\n\n //Nulls\n assertEquals(f.transformtoBool(),Null);\n assertEquals(st.transformtoBool(),Null);\n assertEquals(i.transformtoBool(),Null);\n assertEquals(bi.transformtoBool(),Null);\n assertEquals(Null.transformtoBool(),Null);\n }", "protected Boolean m10668a(String... strArr) {\n try {\n return Boolean.valueOf(ClubActRouteSelfActivity.b(this.f9431b).m11205e(strArr[0]));\n } catch (BusinessException e) {\n return Boolean.valueOf(false);\n }\n }", "public static boolean bVal( Boolean value ) {\n return value != null && value; \n }", "Observable<Boolean> messageBodyRecipientCardViewIsGone();" ]
[ "0.6331899", "0.62795925", "0.62140477", "0.6084269", "0.59086406", "0.5815869", "0.5784967", "0.5729419", "0.56890357", "0.56890357", "0.56890357", "0.56890357", "0.56890357", "0.56890357", "0.56890357", "0.56890357", "0.5679417", "0.56386685", "0.5605978", "0.56015253", "0.5578597", "0.55717474", "0.5570274", "0.5558633", "0.5557909", "0.55247426", "0.5520528", "0.55183494", "0.5502473", "0.5485576", "0.5461973", "0.54546124", "0.54304093", "0.54304093", "0.54288346", "0.5412982", "0.5405618", "0.5397222", "0.5395276", "0.53777045", "0.53660566", "0.53660566", "0.5365017", "0.53508586", "0.53486913", "0.53468674", "0.5339937", "0.5337382", "0.5331823", "0.53126496", "0.53121424", "0.5310523", "0.53045124", "0.53034514", "0.52967507", "0.5295415", "0.5292072", "0.5291121", "0.52877045", "0.52753675", "0.5275045", "0.5272286", "0.5270215", "0.526277", "0.52618694", "0.5256679", "0.52020633", "0.5187407", "0.51832026", "0.515978", "0.51565784", "0.51528674", "0.5136027", "0.51350456", "0.5128231", "0.51237845", "0.51153743", "0.511503", "0.5105134", "0.51032656", "0.5100879", "0.50872594", "0.5085901", "0.5085874", "0.50749415", "0.507357", "0.50720435", "0.50711226", "0.5070252", "0.50651807", "0.50613976", "0.5057184", "0.5056719", "0.5056196", "0.505477", "0.50504166", "0.504665", "0.5045081", "0.5040822", "0.5038159" ]
0.6470149
0
Converts Msg value to Msg number if possible and if needed
public static MessageNumber toNumber(MessageValue<?> value) { if (value != null) { if (value instanceof MessageNumber) { return (MessageNumber) value; } else { return new MessageNumberImpl(value.asString()); } } return null; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "BigInteger getMessage();", "int getMsgid();", "netty.framework.messages.MsgId.MsgID getMsgID();", "netty.framework.messages.MsgId.MsgID getMsgID();", "int getClientMsgNo();", "public java.lang.Integer getNummessage() {\r\n\t\treturn nummessage;\r\n\t}", "public int getMsgType(){\r\n return localMsgType;\r\n }", "public int getMessageCodeValue();", "public int getUserInteger(String msg) {\n return boardController.getUserInteger(msg, Integer.MIN_VALUE, Integer.MAX_VALUE);\n }", "public int getMessageNum() {\n return mMessageNum;\n }", "public Integer getMsgTp() {\n return msgTp;\n }", "public Integer getMsgId() {\n return msgId;\n }", "public void setNummessage(java.lang.Integer nummessage) {\r\n\t\tthis.nummessage = nummessage;\r\n\t}", "java.lang.String getNum2();", "@Override\n\tpublic String GetMsgVal(MsgBean msgBean) {\n\t\tKVContainer kvEntry = ConfirmOrder.GetKeyFromMsg(msgBean.Msg);\n\t\treturn (String)kvEntry.getValue();\n\t}", "java.lang.String getMsg();", "public int getMsgid() {\n return msgid_;\n }", "public int getMsgid() {\n return msgid_;\n }", "int getMsgType();", "public int getMessageId() {\n return concatenateBytes(binary[MSID_OFFSET],\n binary[MSID_OFFSET+1],\n binary[MSID_OFFSET+2],\n binary[MSID_OFFSET+3]);\n }", "Payload getMsg();", "public static int getSequenceNumber(MessageContext msgCtx) {\n SOAPBody body = msgCtx.getEnvelope().getBody();\n OMElement messageNode = body.getFirstChildWithName(new QName(FIXConstants.FIX_MESSAGE));\n String value = messageNode.getAttributeValue(new QName(FIXConstants.FIX_MESSAGE_COUNTER));\n if (value != null) {\n return Integer.parseInt(value);\n } else {\n return -1;\n }\n }", "Res.Msg getMsg(int index);", "private void convertToNum(String s)\n\t{\n\t\tchar charArray[] = s.toCharArray();\n\t\tmyMessage = new BigInteger[(int)Math.ceil(s.length()/(double)BLOCK_SIZE)];\n\t\tfor(int i = 0; i < myMessage.length; i++)\n\t\t{\n\t\t\tString chars = \"\";\n\t\t\tfor(int j = 0; j < BLOCK_SIZE; j++)\n\t\t\t{\n\t\t\t\tif(charArray.length > j+(i*BLOCK_SIZE))\n\t\t\t\t{\n\t\t\t\t\tchars += (int)charArray[j+(i*BLOCK_SIZE)];\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tchars += \"256\";\n\t\t\t\t}\n\t\t\t}\n\t\t\tmyMessage[i] = new BigInteger(chars);\n\t\t}\n\t}", "long getMsgId();", "private void setMsg(\n int index, Msg value) {\n if (value == null) {\n throw new NullPointerException();\n }\n ensureMsgIsMutable();\n msg_.set(index, value);\n }", "private void setMsg(\n int index, Msg value) {\n if (value == null) {\n throw new NullPointerException();\n }\n ensureMsgIsMutable();\n msg_.set(index, value);\n }", "public long getMsgId() {\n return msgId_;\n }", "private String parseNumber () {\r\n \r\n assert iMessage!=null;\r\n assert iIndex>=0;\r\n assert iIndex<=iMessage.length();\r\n \r\n fBuffer.delete(0, fBuffer.length());//empty string buffer\r\n \r\n char chr=next();//get next character\r\n assert \"-0123456789\".indexOf(chr)>=0;//assert valid start character\r\n while (\"0123456789.Ee+-\".indexOf(chr)>=0) {//until non number character\r\n fBuffer.append(chr);//append to string buffer\r\n chr=next();//get next character\r\n if (chr==NONE) throw new RuntimeException(\"Invalid syntax : \"+context());//gee, thanks...\r\n }//until non number character\r\n \r\n if (\"]},\".indexOf(chr)<0) throw new RuntimeException(\"Invalid syntax : \"+context());//no way jose\r\n\r\n back(); //rewind to the terminator character\r\n \r\n return fBuffer.toString();//return string in buffer\r\n \r\n }", "public final Long getMessageId( Message msg )\n\t{\n\t\treturn (Long) msg.get( _mf__messageId );\n\t}", "Object getMessageId();", "public java.lang.String getNumber() {\n java.lang.Object ref = number_;\n if (ref instanceof java.lang.String) {\n return (java.lang.String) ref;\n } else {\n com.google.protobuf.ByteString bs = \n (com.google.protobuf.ByteString) ref;\n java.lang.String s = bs.toStringUtf8();\n if (bs.isValidUtf8()) {\n number_ = s;\n }\n return s;\n }\n }", "protected final void setMessageHelper(int number, Object... args) {\r\n if (number < 1) {\r\n SLLogger.getLogger().warning(I18N.err(257, number));\r\n return;\r\n }\r\n // f_message = args.length == 0 ? I18N.res(number) : I18N.res(number, args);\r\n // f_messageCanonical = args.length == 0 ? I18N.resc(number) :\r\n // I18N.resc(number, args);\r\n f_message = args.length == 0 ? resolveMessage(number) : resolveMessage(number, args);\r\n f_messageCanonical = args.length == 0 ? resolveMessageCanonical(number) : resolveMessageCanonical(number, args);\r\n }", "public long getMsgId() {\n return msgId_;\n }", "public OctetString getMsg1001()\n {\n\treturn this.msg1001;\n }", "@Override\n public void handleMessage(Message msg) {\n super.handleMessage(msg);\n switch (msg.what) {\n case 1:\n // 添加更新ui的代码\n if (!isstop) {\n if(currentNum==0){\n getNumberBtn.setClickable(true);\n getNumberBtn.setText(\"重新发送验证码\");\n }else{\n getNumberBtn.setText(\"发送验证码(\"+currentNum+\")\");\n currentNum--;\n mHandler.sendEmptyMessageDelayed(1, 1000);\n }\n }\n break;\n case 2:\n break;\n }\n }", "public int getMessageClass() {\n // Who in the holy hell thought this was a good idea for a protocol? The\n // `class` is a 2 bit value constructed from the lowest bit of the highest\n // order byte and the 5th lowest bit of the 2nd highester order byte.\n return (((int)data[0] & 0x01) << 1) | ((int)data[1] & 0x10) >> 4;\n }", "public void setMsgId(Integer msgId) {\n this.msgId = msgId;\n }", "com.google.protobuf.ByteString\n getNum2Bytes();", "public int getMessageType()\r\n {\r\n return msgType;\r\n }", "java.lang.String getNumber();", "java.lang.String getNumber();", "java.lang.String getNumber();", "org.apache.xmlbeans.XmlLong xgetMessageID();", "long getMessageId(int index);", "public void setMsgType(int param){\r\n \r\n // setting primitive attribute tracker to true\r\n \r\n if (param==java.lang.Integer.MIN_VALUE) {\r\n localMsgTypeTracker = false;\r\n \r\n } else {\r\n localMsgTypeTracker = true;\r\n }\r\n \r\n this.localMsgType=param;\r\n \r\n\r\n }", "public java.lang.String getNumber() {\n java.lang.Object ref = number_;\n if (!(ref instanceof java.lang.String)) {\n java.lang.String s = ((com.google.protobuf.ByteString) ref)\n .toStringUtf8();\n number_ = s;\n return s;\n } else {\n return (java.lang.String) ref;\n }\n }", "java.lang.String getMessageInfoID();", "public Builder setMsgid(int value) {\n bitField0_ |= 0x00000100;\n msgid_ = value;\n onChanged();\n return this;\n }", "public java.lang.String getNumber() {\n\t\t\t\tjava.lang.Object ref = number_;\n\t\t\t\tif (ref instanceof java.lang.String) {\n\t\t\t\t\treturn (java.lang.String) ref;\n\t\t\t\t} else {\n\t\t\t\t\tcom.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref;\n\t\t\t\t\tjava.lang.String s = bs.toStringUtf8();\n\t\t\t\t\tnumber_ = s;\n\t\t\t\t\treturn s;\n\t\t\t\t}\n\t\t\t}", "public OctetString getMsg1011()\n {\n\treturn this.msg1011;\n }", "public int getMes();", "public static Number readNumber(String message, String type){\n Scanner in = new Scanner(System.in);\n System.out.print(message);\n switch (type.toLowerCase().trim()){\n case \"byte\":\n return in.nextByte();\n case \"short\":\n return in.nextShort();\n case \"int\":\n return in.nextInt();\n case \"long\":\n return in.nextLong();\n case \"float\":\n return in.nextFloat();\n case \"double\":\n return in.nextDouble();\n default:\n return -1; \n }\n }", "public java.lang.String getNumber() {\n java.lang.Object ref = number_;\n if (!(ref instanceof java.lang.String)) {\n com.google.protobuf.ByteString bs =\n (com.google.protobuf.ByteString) ref;\n java.lang.String s = bs.toStringUtf8();\n number_ = s;\n return s;\n } else {\n return (java.lang.String) ref;\n }\n }", "private void setMessageId(long value) {\n \n messageId_ = value;\n }", "public void setMsgTp(Integer msgTp) {\n this.msgTp = msgTp;\n }", "public static int getSeqFromMessage(String msg) {\n\n\t\tString seq = msg.substring(0, 4);\n\t\tint seqCount = Integer.parseInt(seq);\n\t\treturn seqCount;\n\t}", "private void addMsg(\n int index, Msg value) {\n if (value == null) {\n throw new NullPointerException();\n }\n ensureMsgIsMutable();\n msg_.add(index, value);\n }", "private void addMsg(\n int index, Msg value) {\n if (value == null) {\n throw new NullPointerException();\n }\n ensureMsgIsMutable();\n msg_.add(index, value);\n }", "private void addMessageId(long value) {\n ensureMessageIdIsMutable();\n messageId_.addLong(value);\n }", "protected String normalizeExMsg(String msg) {\n return msg;\n }", "public java.lang.String getNumber() {\n java.lang.Object ref = number_;\n if (ref instanceof java.lang.String) {\n return (java.lang.String) ref;\n } else {\n com.google.protobuf.ByteString bs = \n (com.google.protobuf.ByteString) ref;\n java.lang.String s = bs.toStringUtf8();\n number_ = s;\n return s;\n }\n }", "java.lang.String getMessageId();", "public java.lang.String getNumber() {\n\t\t\t\t\tjava.lang.Object ref = number_;\n\t\t\t\t\tif (!(ref instanceof java.lang.String)) {\n\t\t\t\t\t\tcom.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref;\n\t\t\t\t\t\tjava.lang.String s = bs.toStringUtf8();\n\t\t\t\t\t\tnumber_ = s;\n\t\t\t\t\t\treturn s;\n\t\t\t\t\t} else {\n\t\t\t\t\t\treturn (java.lang.String) ref;\n\t\t\t\t\t}\n\t\t\t\t}", "@Override\n\tpublic Message get(int value) throws SQLException {\n\t\treturn null;\n\t}", "java.lang.String getNumb();", "static int strToNum(String str)\r\n\t{\r\n\t\tif (str.equals(\"Mutex\"))\r\n\t\t\treturn MUTEX;\r\n\t\telse if (str.equals(\"Semaphore\"))\r\n\t\t\treturn SEMAPHORE;\r\n\t\telse if (str.equals(\"Signal\"))\r\n\t\t\treturn SIGNAL;\r\n\t\telse\r\n\t\t\treturn 0;\r\n\t}", "public OctetString getMsg1032()\n {\n\treturn this.msg1032;\n }", "public Builder setMsgId(long value) {\n\n msgId_ = value;\n onChanged();\n return this;\n }", "private static int transformHexCharToInt(byte val) throws HyracksDataException {\n switch (val) {\n case '0':\n return 0;\n case '1':\n return 1;\n case '2':\n return 2;\n case '3':\n return 3;\n case '4':\n return 4;\n case '5':\n return 5;\n case '6':\n return 6;\n case '7':\n return 7;\n case '8':\n return 8;\n case '9':\n return 9;\n case 'a':\n case 'A':\n return 10;\n case 'b':\n case 'B':\n return 11;\n case 'c':\n case 'C':\n return 12;\n case 'd':\n case 'D':\n return 13;\n case 'e':\n case 'E':\n return 14;\n case 'f':\n case 'F':\n return 15;\n default:\n throw new RuntimeDataException(ErrorCode.INVALID_FORMAT);\n }\n }", "int getMessageId();", "@Override\n public void processMessage(int type, String receivedMsg) {\n }", "int getMsgCount();", "int getMsgCount();", "public int getMsgType() {\n return msgType_;\n }", "Status getMessageStatus(String msgId);", "public OctetString getMsg1024()\n {\n\treturn this.msg1024;\n }", "public java.lang.String getFromNumber()\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(FROMNUMBER$2, 0);\n if (target == null)\n {\n return null;\n }\n return target.getStringValue();\n }\n }", "com.google.protobuf.ByteString getNumberBytes();", "UnreceivedMsg.Res getUnreceivedMsgRes();", "long getMessageID();", "long getMessageID();", "@Override\r\n\t\t\t\t\tpublic void run() {\n\t\t\t\t\t\tString jsonString= HttpUtil.getSmsCheckNum(phoneEt.getText().toString(),UILApplication.sendcount);\r\n\t\t\t\t\t\tUILApplication.sendcount++;\r\n\t\t\t\t\t\tMessage numMsg = handler.obtainMessage();\r\n\t\t\t\t\t\tif(jsonString!=null){\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\tif(isNumeric(jsonString)){\r\n\t\t\t\t\t\t\t\tnumMsg.what = 1;\r\n\t\t\t\t\t\t\t\tnumMsg.obj = jsonString;\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\telse{\r\n\t\t\t\t\t\t\t\tnumMsg.what = 2;\r\n\t\t\t\t\t\t\t\tnumMsg.obj = jsonString;\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\telse{\r\n\t\t\t\t\t\t\tnumMsg.what = 2;\r\n\t\t\t\t\t\t\tnumMsg.obj = \"验证码发送失败\";\r\n\t\t\t\t\t\t}\t\t\t\t\t\t\r\n\t\t\t\t\t\tnumMsg.sendToTarget();\r\n\t\t\t\t\t}", "public OctetString getMsg1015()\n {\n\treturn this.msg1015;\n }", "public long getMessageId(int index) {\n return messageId_.getLong(index);\n }", "public int getMsgType() {\n return msgType_;\n }", "private void addMsg(Msg value) {\n if (value == null) {\n throw new NullPointerException();\n }\n ensureMsgIsMutable();\n msg_.add(value);\n }", "private void addMsg(Msg value) {\n if (value == null) {\n throw new NullPointerException();\n }\n ensureMsgIsMutable();\n msg_.add(value);\n }", "public Builder setMsgType(int value) {\n\n msgType_ = value;\n onChanged();\n return this;\n }", "@Override\n\tpublic void convertNumber(int number, String totype) {\n\t\tif(totype.equalsIgnoreCase(\"hex\")){\n\t\t\tSystem.out.println(\"Hex (\"+number+\") - \" + Integer.toHexString(number));\n\t\t}\n\t\telse{\n\t\t\tif(converter!=null)\n\t\t\t\tconverter.convertNumber(number, totype);\n\t\t\telse\n\t\t\t\tSystem.out.println(\"Can't Process Request !\");\n\t\t}\n\t\t\n\t}", "long getMessageId();", "long getMessageId();", "public WriteMessage(int accountNum, int value)\n {\n this.accountNum = accountNum;\n this.value = value;\n }", "java.lang.String getNum1();", "Rsp.Msg getMsg(int index);", "public String getValue() {\n\t\treturn this.msg;\n\t}", "@Test\n\t\t\tpublic void checkAlphanumeric() {\n\t\t\t\tMessage msgjunit = new Message();\n\t\t\t\tString msg = msgjunit.getMessage();\n\n\t\t\t\tif (msg != null) {\n\t\t\t\t\tmsg = msg;\n\t\t\t\t} else {\n\t\t\t\t\tmsg = \"This is a message\";\n\t\t\t\t}\n\n\t\t\t\ttry {\n\t\t\t\t\tInteger.parseInt(msg);\n\t\t\t\t\tSystem.out.println(\"Message is a not string:\" + \" \" + msg );\n\t\t\t\t} catch (NumberFormatException e) {\n\t\t\t\t\tSystem.out.println(\"Message is a string:\" + \" \" + msg);\n\t\t\t\t}\n\t\t\t}", "public static int toInternal(String value) {\n try {\n double qty = Double.valueOf(value);\n return toInternal(qty);\n } catch (NumberFormatException e) {\n return 0;\n }\n }", "public String getMsg() { return this.msg; }", "public Message(long msg) {\n m_msg = msg;\n m_type = getType(msg);\n parseMessage();\n }" ]
[ "0.61690897", "0.5947523", "0.5908825", "0.5908825", "0.58089405", "0.57272184", "0.5724973", "0.5708293", "0.5659886", "0.5636868", "0.56145644", "0.55574214", "0.5550486", "0.5546133", "0.552409", "0.5511026", "0.55042565", "0.547701", "0.54689586", "0.54449165", "0.54304767", "0.5424125", "0.5414278", "0.54072106", "0.5398226", "0.5358876", "0.5358876", "0.5341174", "0.53271365", "0.5309575", "0.5288813", "0.5275101", "0.52642477", "0.52570546", "0.52484185", "0.52142715", "0.5214016", "0.520199", "0.5200015", "0.5189281", "0.51862663", "0.51862663", "0.51862663", "0.51821584", "0.51796705", "0.5160352", "0.5154972", "0.51532036", "0.5149156", "0.51409423", "0.51360416", "0.5129273", "0.5127675", "0.51258194", "0.5125442", "0.51144", "0.5103314", "0.50984895", "0.50984895", "0.5094771", "0.50926214", "0.508976", "0.50881916", "0.50849754", "0.5074301", "0.50618196", "0.5060817", "0.50571394", "0.5051457", "0.50484073", "0.5046198", "0.503367", "0.5033112", "0.5033112", "0.50312495", "0.50241387", "0.5011498", "0.5009754", "0.5008314", "0.50060976", "0.49880642", "0.49880642", "0.4986468", "0.49745858", "0.49717528", "0.49633345", "0.49614787", "0.49614787", "0.4960741", "0.49530214", "0.49330744", "0.49330744", "0.4922318", "0.49145576", "0.49134335", "0.49126178", "0.49033195", "0.4900812", "0.48991773", "0.4898798" ]
0.65411484
0
Converts Msg value to Msg string if possible and if needed
public static MessageString toString(MessageValue<?> value) { if (value != null) { if (value instanceof MessageString) { return (MessageString) value; } else { return new MessageStringImpl(value.asString()); } } return null; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "java.lang.String getMsg();", "protected String normalizeExMsg(String msg) {\n return msg;\n }", "private static String getMsg(Object... msgs) {\n\t\tStringBuilder sb = new StringBuilder();\n\t\tfor (Object object : msgs) {\n\t\t\tsb.append(object.toString()).append(\"\\n\");\n\t\t}\n\t\treturn sb.toString();\n\t}", "@Override\n\tpublic String toMessageString() {\n\t\treturn null;\n\t}", "public java.lang.String getMsg() {\n java.lang.Object ref = msg_;\n if (ref instanceof java.lang.String) {\n return (java.lang.String) ref;\n } else {\n com.google.protobuf.ByteString bs = \n (com.google.protobuf.ByteString) ref;\n java.lang.String s = bs.toStringUtf8();\n if (bs.isValidUtf8()) {\n msg_ = s;\n }\n return s;\n }\n }", "public String getMsg() { return this.msg; }", "@Override\n public String toString() {\n String result = msgType.toString();\n if (msgSender != null) {\n result += \" \" + msgSender.length() + \" \" + msgSender;\n } else {\n result += \" \" + NULL_OUTPUT.length() + \" \" + NULL_OUTPUT;\n }\n if (receiver != null) {\n result += \" \" + receiver.length() + \" \" + receiver;\n } else {\n result += \" \" + NULL_OUTPUT.length() + \" \" + NULL_OUTPUT;\n }\n if (msgText != null) {\n result += \" \" + msgText.length() + \" \" + msgText;\n } else {\n result += \" \" + NULL_OUTPUT.length() + \" \" + NULL_OUTPUT;\n }\n return result;\n }", "public String messageToString(){\n String stringMessage = \"Message:\\n\" + text + \"\\nFrom User: \" + fromUser.toNameAndEmailString();\n if(toGroup != null && !emergency) {\n stringMessage = \"Message:\\n\" + text + \"\\nFrom User: \" + fromUser.toNameAndEmailString() + \"\\nTo Group:\\n\" + toGroup.groupToListString();\n\n }\n else if(emergency){\n stringMessage =\"EMERGENCY!!!\\n\" + \"Message:\\n\" + text + \"\\nFrom User: \" + fromUser.toNameAndEmailString() + \"\\n\";\n }\n\n\n return stringMessage;\n }", "public java.lang.String getMsg() {\n java.lang.Object ref = msg_;\n if (!(ref instanceof java.lang.String)) {\n java.lang.String s = ((com.google.protobuf.ByteString) ref)\n .toStringUtf8();\n msg_ = s;\n return s;\n } else {\n return (java.lang.String) ref;\n }\n }", "@Override\n public final String getMsg(final String key) {\n try {\n return messages.getString(key);\n } catch (Exception e) {\n return \"[\" + key + \"]\";\n }\n }", "Object getMessage();", "java.lang.String getMessage();", "java.lang.String getMessage();", "java.lang.String getMessage();", "java.lang.String getMessage();", "java.lang.String getMessage();", "java.lang.String getMessage();", "java.lang.String getMessage();", "java.lang.String getMessage();", "java.lang.String getMessage();", "java.lang.String getMessage();", "java.lang.String getMessage();", "java.lang.String getMessage();", "java.lang.String getMessage();", "java.lang.String getMessage();", "java.lang.String getMessage();", "java.lang.String getMessage();", "java.lang.String getMessage();", "@Override\n public String getMsg() {\n return this.msg;\n }", "public String getValue() {\n\t\treturn this.msg;\n\t}", "Payload getMsg();", "public String getMsg() {\n return msg;\n }", "public String getMsg() {\n return msg;\n }", "com.google.protobuf.ByteString getMsg();", "java.lang.String getTheMessage();", "@Override\n\tpublic String GetMsgVal(MsgBean msgBean) {\n\t\tKVContainer kvEntry = ConfirmOrder.GetKeyFromMsg(msgBean.Msg);\n\t\treturn (String)kvEntry.getValue();\n\t}", "public String toMessage() {\n String mem = \"Mem: \"+memoryLoad+\"%\";\n String cpu = \" CPU: \"+cpuLoad+\"%\";\n String bat = \" Bat: \"+batteryLevel+\"%\";\n String threads = \"Threads: \"+numberOfThreads;\n String nbCM = \"BCs: \"+numberOfBCs;\n String nbConn = \"Connectors: \"+numberOfConnectors;\n String emiss = \"Sent PF:appli \"+networkPFOutputTraffic+\":\"+networkApplicationInputTraffic+\" KB/s\";\n String rec = \"Rcvd PF:appli \"+networkPFInputTraffic+\":\"+networkApplicationInputTraffic+\" KB/s\";\n return mem+\"|\"+cpu+\"|\"+threads+\"|\"+bat+\"|\"+nbCM+\"|\"+nbConn+\"|\"+emiss+\"|\"+rec; // recuperation de l'etat de l'hote\n }", "java.lang.String getUserMessage();", "public String toString() {\n String s = \"Message <Int8Msg> \\n\";\n try {\n s += \" [dataType=0x\"+Long.toHexString(get_dataType())+\"]\\n\";\n } catch (ArrayIndexOutOfBoundsException aioobe) { /* Skip field */ }\n try {\n s += \" [senderNodeID=0x\"+Long.toHexString(get_senderNodeID())+\"]\\n\";\n } catch (ArrayIndexOutOfBoundsException aioobe) { /* Skip field */ }\n try {\n s += \" [receiverNodeID=0x\"+Long.toHexString(get_receiverNodeID())+\"]\\n\";\n } catch (ArrayIndexOutOfBoundsException aioobe) { /* Skip field */ }\n try {\n s += \" [sampleCnt=0x\"+Long.toHexString(get_sampleCnt())+\"]\\n\";\n } catch (ArrayIndexOutOfBoundsException aioobe) { /* Skip field */ }\n try {\n s += \" [min=0x\"+Long.toHexString(get_min())+\"]\\n\";\n } catch (ArrayIndexOutOfBoundsException aioobe) { /* Skip field */ }\n try {\n s += \" [max=0x\"+Long.toHexString(get_max())+\"]\\n\";\n } catch (ArrayIndexOutOfBoundsException aioobe) { /* Skip field */ }\n try {\n s += \" [sum_a=0x\"+Long.toHexString(get_sum_a())+\"]\\n\";\n } catch (ArrayIndexOutOfBoundsException aioobe) { /* Skip field */ }\n try {\n s += \" [sum_e=0x\"+Long.toHexString(get_sum_e())+\"]\\n\";\n } catch (ArrayIndexOutOfBoundsException aioobe) { /* Skip field */ }\n return s;\n }", "private static String formatSimple(ChannelHandlerContext ctx, String eventName, Object msg) {\n String chStr = getChStr(ctx);\n String msgStr = String.valueOf(msg);\n StringBuilder buf = new StringBuilder(chStr.length() + 1 + eventName.length() + 2 + msgStr.length());\n return buf.append(chStr).append(' ').append(eventName).append(\": \").append(msgStr).toString();\n }", "public String getMessage() {\n return message == null ? new StringBuilder().append(\"??\").append(key).append(\"??\").toString() : message;\n }", "private static String formatSimple(final ChannelHandlerContext ctx, final String eventName, final Object msg) {\n final String chStr = ctx.channel().toString();\n final String msgStr = String.valueOf(msg);\n final StringBuilder buf = new StringBuilder(chStr.length() + 1 + eventName.length() + 2 + msgStr.length());\n return buf.append(chStr).append(' ').append(eventName).append(\": \").append(msgStr).toString();\n }", "public String getMessage() {\n\t\tString toReturn = message;\n\t\tmessage=\"\";//delete the message\n\t\treturn toReturn;\n\t}", "String getMessage();", "String getMessage();", "String getMessage();", "public String getMessage(Object[] msgParams) {\n return getMessage(this.key, msgParams, this.key, null);\n }", "private void addMsg(Msg value) {\n if (value == null) {\n throw new NullPointerException();\n }\n ensureMsgIsMutable();\n msg_.add(value);\n }", "private void addMsg(Msg value) {\n if (value == null) {\n throw new NullPointerException();\n }\n ensureMsgIsMutable();\n msg_.add(value);\n }", "public void setMsg(String msg) { this.msg = msg; }", "public String toString() {\n String s = \"Message <RxTxMonitoringMsg> \\n\";\n try {\n s += \" [infos.type=0x\"+Long.toHexString(get_infos_type())+\"]\\n\";\n } catch (ArrayIndexOutOfBoundsException aioobe) { /* Skip field */ }\n try {\n s += \" [infos.log_src=0x\"+Long.toHexString(get_infos_log_src())+\"]\\n\";\n } catch (ArrayIndexOutOfBoundsException aioobe) { /* Skip field */ }\n try {\n s += \" [infos.timestamp=0x\"+Long.toHexString(get_infos_timestamp())+\"]\\n\";\n } catch (ArrayIndexOutOfBoundsException aioobe) { /* Skip field */ }\n try {\n s += \" [infos.seq_num=0x\"+Long.toHexString(get_infos_seq_num())+\"]\\n\";\n } catch (ArrayIndexOutOfBoundsException aioobe) { /* Skip field */ }\n try {\n s += \" [infos.size_data=0x\"+Long.toHexString(get_infos_size_data())+\"]\\n\";\n } catch (ArrayIndexOutOfBoundsException aioobe) { /* Skip field */ }\n try {\n s += \" [infos.valid_noise_samples=0x\"+Long.toHexString(get_infos_valid_noise_samples())+\"]\\n\";\n } catch (ArrayIndexOutOfBoundsException aioobe) { /* Skip field */ }\n try {\n s += \" [infos.noise=\";\n for (int i = 0; i < 3; i++) {\n s += \"0x\"+Long.toHexString(getElement_infos_noise(i) & 0xffff)+\" \";\n }\n s += \"]\\n\";\n } catch (ArrayIndexOutOfBoundsException aioobe) { /* Skip field */ }\n try {\n s += \" [infos.metadata=\";\n for (int i = 0; i < 2; i++) {\n s += \"0x\"+Long.toHexString(getElement_infos_metadata(i) & 0xff)+\" \";\n }\n s += \"]\\n\";\n } catch (ArrayIndexOutOfBoundsException aioobe) { /* Skip field */ }\n try {\n s += \" [data=\";\n for (int i = 0; i < 60; i++) {\n s += \"0x\"+Long.toHexString(getElement_data(i) & 0xff)+\" \";\n }\n s += \"]\\n\";\n } catch (ArrayIndexOutOfBoundsException aioobe) { /* Skip field */ }\n return s;\n }", "protected abstract String getMessage();", "private String appendContextMessage(String msg) {\n\t\treturn msg;\r\n\t}", "public String getMessage() {\r\n\treturn messageSB.toString();\r\n }", "private String geraMensagem(Mensagem msg) {\n\t\treturn new StringBuilder()\n\t\t\t.append(msg.remetente.nome)\n\t\t\t.append(\" enviou para \")\n\t\t\t.append(msg.destinatario.nome)\n\t\t\t.append(\" uma mensagem suspeita.\")\n\t\t\t.toString();\n\t}", "public String getMessage()\n {\n return String.format(\"MessageType=%s,TransactionId=%s,TerminalId=%s,MerchantId=%s,FingerData=%s,CustomerId=%s,IdData=%s, CustomerData=%s\", this.messageType, this.transactionId, this.terminalId, this.merchantId, this.fingerData, this.customerId, this.idData, this.customerData);\n }", "public java.lang.String getMSG() {\n return MSG;\n }", "public String readMessage() {\r\n return new String(readMessageAsByte());\r\n }", "private static void msg(Object msg) {\n msg(msg, true);\n }", "public Builder setMsg(\n java.lang.String value) {\n if (value == null) {\n throw new NullPointerException();\n }\n bitField0_ |= 0x00000020;\n msg_ = value;\n onChanged();\n return this;\n }", "public String getMsg(){\n return messageLabel.getText();\n }", "String getRawMessage();", "public String getMessage() {\n\t//TODO fix the removing of the color char one a move\n\t\tString message = this.message.substring(position, Math.min(this.message.length(), (width - 2) + position));\n\t\tchar COLORCHAR = '&';\n\t\tif (message.charAt(0) == COLORCHAR) {\n\t\t\tcolor = ChatColor.getByChar(message.charAt(1));\n\t\t} else {\n\t\t\tmessage = message.substring(1);\n\t\t\tmessage = \"\" + color + message;\n\t\t}\n\n\t\tif (message.charAt(message.length() - 1) == COLORCHAR) {\n\t\t\tmessage = message.substring(0, message.length() - 2);\n\t\t\tmessage = message + \" \";\n\t\t}\n\t\treturn message;\n\n\t}", "public int getMsgType(){\r\n return localMsgType;\r\n }", "public static String getMessage(int msg_type)\n\t{\n\t\tString msg = \"\";\n\t\t\n\t\tif(msg_type == TYPE_GET_VERSION)\n\t\t{\n\t\t\tmsg = \"<Message Type=\\\"GetVersion\\\"/>\";\n\t\t}\n\t\telse if(msg_type == TYPE_GET_DATA)\n\t\t{\n\t\t\tmsg = \"<Message Type=\\\"GetData\\\"/>\";\n//\t\t\tmsg = \"<PublicSDK Message=\\\"GetIntegratedData\\\"/>\";\n\t\t}\n\t\telse if(msg_type == TYPE_GET_EVENTS)\n\t\t{\n\t\t\tmsg = \"<Message Type=\\\"GetEvents\\\"/>\";\n\t\t}\n\t\telse if(msg_type == TYPE_GET_IMAGE)\n\t\t{\n\t\t\tmsg = \"<Message Type=\\\"GetImage\\\"/>\";\n\t\t}\n\t\telse if(msg_type == TYPE_GET_PRODUCT_INFORMATION)\n\t\t{\n\t\t\tmsg = \"<Message Type=\\\"GetProductInformation\\\"/>\";\n\t\t}\n\t\telse if(msg_type == TYPE_GET_TIME)\n\t\t{\n\t\t\tmsg = \"<Message Type=\\\"GetTime\\\"/>\";\n\t\t}\n\t\telse if(msg_type == TYPE_SET_TIME)\n\t\t{\n\t\t\tmsg = \"<PublicSDK Message=\\\"SetTime\\\" UTC=\\\"%s\\\" Milliseconds=\\\"%s\\\"/>\";\n\t\t}\n\t\telse if(msg_type == TYPE_CLEAR_DATA)\n\t\t{\n\t\t\tmsg = \"<PublicSDK Message=\\\"ClearData\\\"/>\";\n\t\t}\n\t\telse\n\t\t{\n\t\t\tlog4j.warn(\"No message mapped for msg_type = \" + msg_type + \". Return msg = null..\");\n\t\t\tmsg = null;\n\t\t}\n\t\t\n\t\treturn msg;\n\t}", "public String getMessage() {\r\n\t\tString useEncoding = encoding != null ? encoding : Data.ENC_GSM7BIT;\r\n\t\tString theMessage = null;\r\n\t\ttry {\r\n\t\t\ttheMessage = getMessage(useEncoding);\r\n\t\t} catch (UnsupportedEncodingException e) {\r\n\t\t\t// fall back to ascii\r\n\t\t\ttry {\r\n\t\t\t\ttheMessage = getMessage(Data.ENC_ASCII);\r\n\t\t\t} catch (UnsupportedEncodingException uee) {\r\n\t\t\t\t// ascii is always supported\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn theMessage;\r\n\t}", "public String getMessage() {\n String message = super.getMessage();\n\n if (message == null) {\n message = \"\";\n }\n\n if (buffer != null) {\n return message + ((message.length() > 0) ? \" \" : \"\")\n + \"(Hexdump: \" + ByteBuffers.getHexdump(buffer) + ')';\n } else {\n return message;\n }\n }", "public String getMessage(){\n return(message);\n }", "public String getMessage()\n\t{\n\t\treturn msg;\n\t}", "public String process(String msg) {\n return msg;\n }", "private String formatXMLMessage(String msg, boolean isObservation) {\n return StringUtil.wrap(msg, isObservation ? \"observation\" : \"warning\");\n }", "public String toString() {\n if (getMessage() != null) {\n return \"message(\" + getMessage().toString() + \")\";\n } else {\n return \"message(null)\";\n }\n }", "public @NotNull String getUserString(String msg) {\n return boardController.getUserString(msg, 1, Integer.MAX_VALUE, true);\n }", "private String getMsgCmd/* */(String msg) {\n return msg.substring(0); // NO SUB... for now :)\n }", "private void addMsg(\n Msg.Builder builderForValue) {\n ensureMsgIsMutable();\n msg_.add(builderForValue.build());\n }", "private void addMsg(\n Msg.Builder builderForValue) {\n ensureMsgIsMutable();\n msg_.add(builderForValue.build());\n }", "public String getMessage() {\n\t\treturn msg;\n\t}", "@java.lang.Override\n public com.google.protobuf.ByteString getMsg() {\n return msg_;\n }", "protected String getMessage() {\n if (allMessage == null)\n return allMessage;\n return allMessage.trim();\n }", "public java.lang.String getMsgText() {\n java.lang.Object ref = msgText_;\n if (ref instanceof java.lang.String) {\n return (java.lang.String) ref;\n } else {\n com.google.protobuf.ByteString bs = \n (com.google.protobuf.ByteString) ref;\n java.lang.String s = bs.toStringUtf8();\n msgText_ = s;\n return s;\n }\n }", "public java.lang.String getMsgText() {\n java.lang.Object ref = msgText_;\n if (!(ref instanceof java.lang.String)) {\n com.google.protobuf.ByteString bs =\n (com.google.protobuf.ByteString) ref;\n java.lang.String s = bs.toStringUtf8();\n msgText_ = s;\n return s;\n } else {\n return (java.lang.String) ref;\n }\n }", "public String toString()\n {\n StringBuffer loMessage = null;\n\n loMessage = new StringBuffer().append(\"\\n\");\n\n // Message Code\n if (getMSG_CD() != null)\n {\n loMessage.append(\"Message Code: \" + getMSG_CD() + \"\\n\");\n }\n\n // Severity Level\n if (getMSG_SEV() >= 0)\n {\n switch (getMSG_SEV())\n {\n case AMSMsgUtil.SEVERITY_LEVEL_INFO:\n loMessage.append(\"Severity Level: INFO\\n\");\n case AMSMsgUtil.SEVERITY_LEVEL_WARNING:\n loMessage.append(\"Severity Level: WARNING\\n\");\n case AMSMsgUtil.SEVERITY_LEVEL_ERROR:\n loMessage.append(\"Severity Level: ERROR\\n\");\n case AMSMsgUtil.SEVERITY_LEVEL_SEVERE:\n loMessage.append(\"Severity Level: SEVERE\\n\");\n } // end switch (liIndex)\n }\n\n // Override\n if (getOV_LVL() >= 0)\n {\n loMessage.append(\"Override: \" + getOV_LVL() + \"\\n\");\n }\n\n // Message\n if (getMSG_TXT() != null)\n {\n loMessage.append(\"Message: \" + getMSG_TXT() + \"\\n\");\n }\n\n // Component Name\n if (getCOMP_NM() != null)\n {\n loMessage.append(\"Component Name: \" + getCOMP_NM() + \"\\n\");\n }\n\n // Attribute ID\n if (getATTR_NM() != null)\n {\n loMessage.append(\"AttributeID: \" + getATTR_NM() + \"\\n\");\n }\n\n // Error Context\n if (getDOC_ID() != null)\n {\n loMessage.append(\"Error Context: \");\n loMessage.append(\"DOC_CD = \" + getDOC_CD() + \" AND \");\n loMessage.append(\"DOC_DEPT_CD = \" + getDOC_DEPT_CD() + \" AND \");\n loMessage.append(\"DOC_ID = \" + getDOC_ID() + \" AND \");\n loMessage.append(\"DOC_VERS_NO = \" + getDOC_VERS_NO() + \"\\n\");\n }\n\n return loMessage.toString();\n }", "public String toString() {\n\t\treturn getMessage();\n\t}", "@java.lang.Override\n public com.google.protobuf.ByteString getMsg() {\n return msg_;\n }", "public build.buf.validate.conformance.cases.MessageNone.NoneMsg getVal() {\n if (valBuilder_ == null) {\n return val_ == null ? build.buf.validate.conformance.cases.MessageNone.NoneMsg.getDefaultInstance() : val_;\n } else {\n return valBuilder_.getMessage();\n }\n }", "public static String encode(Command msg)\n\t{\n\t\tString type = msg.getType();\n\t\tString sender = msg.getSender();\n\t\tString recipient = msg.getReciever()!=null ? msg.getReciever() : \" \";\n\t\tString message = msg.getMessage()!=null? msg.getMessage() : \" \";\n\t\tSystem.out.println(type + \";\" + sender + \";\" + recipient + \";\" + message);\n\t\treturn (type + \";\" + sender + \";\" + recipient + \";\" + message);\n\t}", "public String msg() {\n return null;\n }", "protected String getMessage(Name name) {\n return message();\n }", "public String getMessage(){\n String messageOut=\"Error\";\n if(this.akun instanceof Savings && akun instanceof Investment==false){\n messageOut=\"Savings\";\n }\n else if (this.akun instanceof Investment && akun instanceof Investment==true){\n messageOut=\"Investment\";\n }\n else if (this.akun instanceof LineOfCredit){\n messageOut=\"Line-Of-Credit\";\n }\n else if (this.akun instanceof OverDraftProtection){\n messageOut=\"Overdraft\";\n }\n return super.getMessage()+ messageOut;\n }", "public String toString(){\n return String.format(\"[MessageBarHandler w/ msg:\\\"%s\\\"]\", getMsg());\n }", "public String fromPacketToString() {\r\n\t\tString message = Integer.toString(senderID) + PACKET_SEPARATOR + Integer.toString(packetID) + PACKET_SEPARATOR + type + PACKET_SEPARATOR;\r\n\t\tfor (String word:content) {\r\n\t\t\tmessage = message + word + PACKET_SEPARATOR;\r\n\t\t}\r\n\t\treturn message;\r\n\t}", "@Override\n public String getMessage() {\n String chuoi=\"\";\n if (maCD.length()!=5)\n chuoi=\"MaCD bao gom 5 ki tu\";\n else if (soBaiHat<10)\n chuoi=\"So bai hat phai lon hon 10 bai\";\n return\n chuoi;\n }", "public String parseStringMsg(String msg){\n String parsedMsg = msg;\n //Make second mthd w/o second param\n //replacements is like Variable:Replacement i.e. PLAYERTRADESENTTO:playerReceiver.getName()\n return parsedMsg;\n }", "@Override\n\tpublic void getMessage(TranObject msg) {\n\n\t}", "public com.google.protobuf.ByteString\n getMsgBytes() {\n java.lang.Object ref = msg_;\n if (ref instanceof String) {\n com.google.protobuf.ByteString b = \n com.google.protobuf.ByteString.copyFromUtf8(\n (java.lang.String) ref);\n msg_ = b;\n return b;\n } else {\n return (com.google.protobuf.ByteString) ref;\n }\n }", "public abstract String getMessage();", "@Override\n public String getHexMessage() {\n return ModbusUtil.toHex(this);\n }", "private String prettyMessage() {\n Map<String, Object> map = new LinkedHashMap<>(4);\n map.put(\"type\", getType());\n map.put(\"message\", this.message);\n map.put(\"code\", getCode());\n // TODO(\"need to optimize\")\n map.put(\"data\", getData().toString());\n return JsonUtils.getGson().toJson(map);\n }", "@AutoEscape\n\tpublic String getMessageInfo();", "private String message() {\r\n if (markers.size() == 0) return \"\";\r\n String s = \"expecting \";\r\n boolean first = true;\r\n for (Marker m : markers) {\r\n if (! first) s = s + \", \";\r\n first = false;\r\n s = s + m.toString().toLowerCase().replaceAll(\"_\",\" \");\r\n }\r\n return s;\r\n }" ]
[ "0.71420914", "0.6497901", "0.64805007", "0.6320259", "0.62302274", "0.6221212", "0.62073725", "0.6170165", "0.6132723", "0.6091095", "0.6066734", "0.6047543", "0.6047543", "0.6047543", "0.6047543", "0.6047543", "0.6047543", "0.6047543", "0.6047543", "0.6047543", "0.6047543", "0.6047543", "0.6047543", "0.6047543", "0.6047543", "0.6047543", "0.6047543", "0.6047543", "0.6035591", "0.6017972", "0.59780633", "0.59673524", "0.59673524", "0.5944361", "0.5908663", "0.59084", "0.5894683", "0.58415383", "0.58384025", "0.5817121", "0.5773934", "0.57196385", "0.57007", "0.56963223", "0.56963223", "0.56963223", "0.5674839", "0.5656771", "0.5656771", "0.56499034", "0.56467116", "0.56284636", "0.5628241", "0.5619509", "0.56186986", "0.5614111", "0.55954134", "0.55939716", "0.5592383", "0.55908763", "0.55791396", "0.5573565", "0.55525434", "0.55396473", "0.5528239", "0.5520231", "0.5506389", "0.55032307", "0.5501587", "0.5481718", "0.54804456", "0.5479731", "0.5476176", "0.54717135", "0.5469625", "0.5469625", "0.5468104", "0.5467445", "0.54589576", "0.54569435", "0.5456352", "0.5451159", "0.54503965", "0.54491025", "0.54446876", "0.54188514", "0.541363", "0.5410322", "0.54081076", "0.54071385", "0.53985566", "0.5397347", "0.53910905", "0.53811353", "0.53768724", "0.5366453", "0.53662926", "0.53632766", "0.5360237", "0.5358703" ]
0.63259095
3
Accion o envio de formularios
@ProcessAction(name = "consultarLista") public void consultarLista(ActionRequest actionRequest, ActionResponse actionResponse) throws IOException, PortletException { LOGGER.info("ID usuario tabla " + ParamUtil.getString(actionRequest, "userID")); String userID = ParamUtil.getString(actionRequest, "userID"); String nombres = StringPool.BLANK; String cargo = StringPool.BLANK; String descripcion = StringPool.BLANK; String imagenprofile = StringPool.BLANK; String estado = StringPool.BLANK; String disponibilidad = StringPool.BLANK; String correo = StringPool.BLANK; String nombreTecnologia = StringPool.BLANK; String imagenTecnologia = StringPool.BLANK; String nombreAsignacion = StringPool.BLANK; String valorAsignacion = StringPool.BLANK; JSONArray tecnologias = null; JSONArray asignacion = null; JSONArray userProfile = null; try { userProfile = api.consultarPerfil(userID); for (int i = 0; i < userProfile.length(); i++) { JSONObject item = userProfile.getJSONObject(i); nombres = item.getString("nombres"); cargo = item.getString("cargo"); descripcion = item.getString("descripcion"); estado = item.getString("estado"); disponibilidad = item.getString("disponibilidad"); correo = item.getString("correo"); imagenprofile =item.getString("imagen"); tecnologias = item.getJSONArray("tecnologias"); for (int j = 0; j < tecnologias.length(); j++) { nombreTecnologia = tecnologias.getJSONObject(j).getString("nombre"); imagenTecnologia= tecnologias.getJSONObject(j).getString("imagen"); } asignacion = item.getJSONArray("asignacion"); for (int k = 0; k < asignacion.length(); k++) { nombreAsignacion = asignacion.getJSONObject(k).getString("nombre"); valorAsignacion = asignacion.getJSONObject(k).getString("valor"); } } } catch (PortalException e) { // TODO Auto-generated catch block e.printStackTrace(); } // Hacer campos visibles en jsp actionRequest.setAttribute("nombres", nombres); actionRequest.setAttribute("cargo", cargo); actionRequest.setAttribute("descripcion", descripcion); actionRequest.setAttribute("imagenprofile", imagenprofile); actionRequest.setAttribute("tecnologias", tecnologias); actionRequest.setAttribute("asignacion", asignacion); actionRequest.setAttribute("nombreTecnologia", nombreTecnologia); actionRequest.setAttribute("imagenTecnologia", imagenTecnologia); actionRequest.setAttribute("nombreAsignacion", nombreAsignacion); actionRequest.setAttribute("valorAsignacion", valorAsignacion); actionRequest.setAttribute("userProfile", userProfile); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@RequestMapping(\"enviar\")\n\tpublic String abrirForm() {\n\t\treturn \"contato/form\";\n\t}", "public void limpiarCamposFormBusqueda() {\n\t}", "public void enviaMotorista() {\n\t\tConector con = new Conector();\r\n\t\tString params[] = new String[2];\r\n\r\n\t\tparams[0] = \"op=4\";\r\n\t\tparams[1] = \"email=\" + usuario;\r\n\r\n\t\tcon.sendHTTP(params);\r\n\t}", "@GetMapping(path = \"/realizar\")\n public ModelAndView getForm(){\n\n return new ModelAndView(ViewConstant.MANTCOMPRASMINO).addObject(\"compraMinorista\", new CompraMinorista());\n }", "public void enviarValoresCabecera(){\n }", "@RequestMapping (value =\"/cadastrarTema\", method=RequestMethod.GET)\n\tpublic String form() {\n\t\treturn \"formTema\";\n\n\t}", "protected RespostaFormularioPreenchido() {\n // for ORM\n }", "private void enviarRequisicaoAdicionar() {\n servidor.adicionarPalito(nomeJogador);\n atualizarPalitos();\n }", "public void enviar(View view) {\n HashMap<String,String> hm = new HashMap<>();\n hm.put(\"cpf\", etCpf.getText().toString());\n hm.put(\"nome\", etNome.getText().toString());\n hm.put(\"endereco\", etEndereco.getText().toString());\n hm.put(\"telefone\", etTelefone.getText().toString());\n hm.put(\"valor\", etValor.getText().toString());\n\n this.pb.setVisibility(ProgressBar.VISIBLE);\n this.inserirController.enviarParaPHP(hm);\n }", "private void readForm() {\n }", "@Override\n protected void doPost(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n String nombre = request.getParameter(\"nombre\");\n String descripcion = request.getParameter(\"descripcion\");\n String cantidad = request.getParameter(\"cantidad\");\n String precio = request.getParameter(\"precio\");\n String pago = request.getParameter(\"pago\");\n \n //creando objeto del costructor\n modelo.ventas venta = new modelo.ventas();\n //almacenando datos en las variables con el constructor \n venta.setNombre(nombre);\n venta.setDescripcion(descripcion);\n venta.setCantidad(Integer.parseInt(cantidad));\n venta.setPrecio(Double.parseDouble(precio));\n venta.setPago(Integer.parseInt(pago));\n \n //creando objeto para guardar cliente\n modelo.addVenta addventa = new modelo.addVenta();\n try {\n addventa.agrega(venta);\n } catch (SQLException ex) {\n Logger.getLogger(formVenta.class.getName()).log(Level.SEVERE, null, ex);\n }\n response.sendRedirect(\"ventas\");//si se guarda exitosamente se redirecciona a membresia\n }", "private void enviarDatos() {\n try {\n if (validarDatos()) { // verificar si todos los datos obligatorios tienen informacion\n // verificar que el usuario de la pantalla presiono el boton YES\n if (obtenerMensajeDeConfirmacion() == JOptionPane.YES_OPTION) {\n llenarEntidadConLosDatosDeLosControles(); // llenar la entidad de Rol con los datos de la caja de texto del formulario\n int resultado = 0;\n switch (opcionForm) {\n case FormEscOpcion.CREAR:\n resultado = ClienteDAL.crear(clienteActual); // si la propiedad opcionForm es CREAR guardar esos datos en la base de datos\n break;\n case FormEscOpcion.MODIFICAR:\n resultado = ClienteDAL.modificar(clienteActual);// si la propiedad opcionForm es MODIFICAR actualizar esos datos en la base de datos\n break;\n case FormEscOpcion.ELIMINAR:\n // si la propiedad opcionForm es ELIMINAR entonces quitamos ese registro de la base de datos\n resultado = ClienteDAL.eliminar(clienteActual);\n break;\n default:\n break;\n }\n if (resultado != 0) {\n // notificar al usuario que \"Los datos fueron correctamente actualizados\"\n JOptionPane.showMessageDialog(this, \"Los datos fueron correctamente actualizados\");\n if (frmPadre != null) {\n // limpiar los datos de la tabla de datos del formulario FrmRolLec\n frmPadre.iniciarDatosDeLaTabla(new ArrayList());\n }\n this.cerrarFormulario(false); // Cerrar el formulario utilizando el metodo \"cerrarFormulario\"\n } else {\n // En el caso que las filas modificadas en el la base de datos sean cero \n // mostrar el siguiente mensaje al usuario \"Sucedio un error al momento de actualizar los datos\"\n JOptionPane.showMessageDialog(this, \"Sucedio un error al momento de actualizar los datos\");\n }\n }\n }\n } catch (Exception ex) {\n // En el caso que suceda un error al ejecutar la consulta en la base de datos \n // mostrar el siguiente mensaje al usuario \"Sucedio un error al momento de actualizar los datos\"\n JOptionPane.showMessageDialog(this, \"Sucedio el siguiente error: \" + ex.getMessage());\n }\n\n }", "@Override\r\n\tpublic void refrescarFormulario() {\n\t\t\r\n\t}", "public String registrarLibroPorFormulario(HttpServletRequest request)\r\n {\r\n StringBuilder salidaTabla=new StringBuilder();\r\n if(request==null)\r\n {\r\n return \"\";\r\n }\r\n if(conexion!=null)\r\n {\r\n try{\r\n //atributos\r\n String nombre,paterno,materno,nacionalidad,titulo;\r\n StringBuilder query=new StringBuilder();\r\n int registro,registro1,codigo_autor,edicion,nroEjemplar;\r\n //sacamos del request a los atributos para autor\r\n materno=request.getParameter(\"materno\");\r\n paterno=request.getParameter(\"paterno\");\r\n nombre=request.getParameter(\"nombre\");\r\n nacionalidad=request.getParameter(\"nacionalidad\");\r\n //sacamos del request los atributos para libro\r\n titulo=request.getParameter(\"titulo\");\r\n edicion=Integer.parseInt(request.getParameter(\"edicion\"));\r\n nroEjemplar=Integer.parseInt(request.getParameter(\"nroEjemplar\"));\r\n //consulta sql\r\n query.append(\" insert into autor(paterno,materno,nombre,nacionalidad) values( \");\r\n query.append(\"'\"+materno+\"',\"+\"'\"+paterno+\"',\"+\"'\"+nombre+\"',\"+\"'\"+nacionalidad+\"')\");\r\n insertLibro=conexion.prepareStatement(query.toString());\r\n registro=insertLibro.executeUpdate();\r\n if(registro==1)\r\n {\r\n codigo_autor=listarUltimoIdAutor();\r\n if(codigo_autor!=0)\r\n {\r\n registro1=registrarLibro1(codigo_autor,titulo,edicion,nroEjemplar);\r\n }\r\n }\r\n }catch(Exception e){\r\n salidaTabla.append(e);\r\n e.printStackTrace();\r\n System.out.println(\"ERROR\");\r\n }\r\n }\r\n return salidaTabla.toString();\r\n }", "@RequestMapping(value=\"/cadastrarUsuario\", method=RequestMethod.GET)\r\n\tpublic String form(){\r\n\t\tSystem.out.println(\">>>>>>>>>>>>>>>>>>>>>cadastrarUsuario<<<<<<<<<<<<<<<<<<<evento/formEvento\");\r\n\t\treturn \"usuario/formUsuario\";\r\n\t}", "@PostMapping (value =\"/cadastrarTema\")\n\tpublic String form (Tema tema) {\n\t\t\n\t\trepository.save(tema);\n\t\treturn \"redirect:/cadastrarTema\";\n\t}", "@Override\n\tpublic String handleRequest(HttpServletRequest req, HttpServletResponse resp) throws Exception {\n\t\tString type = req.getParameter(\"type\");\n\t\treq.setAttribute(\"type\", type);\n\t\tString groupNo = req.getParameter(\"groupNo\");\n\t\treq.setAttribute(\"groupNo\", groupNo);\n\t\t\n\t\treturn \"/board/boardWriteForm.jsp\";\n\t}", "protected void agregarUbicacion(){\n\n\n\n }", "private void initFormulario() {\n btnCadastro = findViewById(R.id.btnCadastro);\n editNome = findViewById(R.id.editNome);\n editEmail = findViewById(R.id.editEmail);\n editSenhaA = findViewById(R.id.editSenha);\n editSenhaB = findViewById(R.id.editSenhaB);\n chTermo = findViewById(R.id.chTermos);\n isFormOk = false;\n }", "@RequestMapping(\"/produtos/form\")\n public String form() {\n return \"produtos/form\";\n }", "@_esCocinero\n public Result crearPaso() {\n Form<Paso> frm = frmFactory.form(Paso.class).bindFromRequest();\n\n // Comprobación de errores\n if (frm.hasErrors()) {\n return status(409, frm.errorsAsJson());\n }\n\n Paso nuevoPaso = frm.get();\n\n // Comprobar autor\n String key = request().getQueryString(\"apikey\");\n if (!SeguridadFunctions.esAutorReceta(nuevoPaso.p_receta.getId(), key))\n return Results.badRequest();\n\n // Checkeamos y guardamos\n if (nuevoPaso.checkAndCreate()) {\n Cachefunctions.vaciarCacheListas(\"pasos\", Paso.numPasos(), cache);\n Cachefunctions.vaciarCacheListas(\"recetas\", Receta.numRecetas(), cache);\n return Results.created();\n } else {\n return Results.badRequest();\n }\n\n }", "private void submitForm() {\n // Build list params\n List<NameValuePair> list = new ArrayList<>();\n list.add(new BasicNameValuePair(\"tag\", AppConfig.TAG_LOGIN));\n list.add(new BasicNameValuePair(\"username\", editTextLogin.getText().toString()));\n list.add(new BasicNameValuePair(\"password\", editTextPassword.getText().toString()));\n\n ConnectionTask connectionTask = new ConnectionTask(this, list);\n connectionTask.execute();\n }", "@Override\r\n\tprotected String requestText() {\n\t\tGuardarVtaCeroMotivoRequest guardarVtaCeroMotivoRequest = new GuardarVtaCeroMotivoRequest();\r\n\t\tguardarVtaCeroMotivoRequest.setAnio(Anio);\r\n\t\tguardarVtaCeroMotivoRequest.setCodCliente(codCliente);\r\n\t\tguardarVtaCeroMotivoRequest.setCodDeposito(codDeposito);\r\n\t\tguardarVtaCeroMotivoRequest.setMes(Mes);\r\n\t\tguardarVtaCeroMotivoRequest.setMotivo(Motivo);\r\n\t\tguardarVtaCeroMotivoRequest.setObservacion(observacion);\r\n\t\tguardarVtaCeroMotivoRequest.setSemana(Semana);\r\n\t\tguardarVtaCeroMotivoRequest.setUsuario(Usuario);\r\n\t\tString request = JSONHelper.serializar(guardarVtaCeroMotivoRequest);\r\n\t\treturn request;\r\n\t}", "@RequestMapping(value=\"admin/agregar_paquetes\", method=RequestMethod.GET)\n\tpublic ModelAndView formPaquetes(ModelAndView model) throws IOException{\n\n\t\tModelAndView model2 = new ModelAndView();\n\t\tmodel2.setViewName(\"agregar_paquete_admin\");\t \n\t\t\n\t\treturn model2;\n\n\t}", "@RequestMapping(\"cargaIOFinales.do\")\n\tpublic ModelAndView cargaFormulario(final HttpServletRequest req,\n\t\t\tfinal HttpServletResponse res) throws BusinessException {\n\t\tfinal String metodo = \"cargaFormulario()\";\n\t\tthis.info(\"Inicio de ejecucion del metodo \" + metodo);\n\t\tfinal Object objeto = req.getSession().getAttribute(MODULOS_PERMITIDOS);\n\t\tValidadorAccesoPantallas.validarAcceso(objeto, MODULO, PANTALLA);\n\t\tthis.info(\"Se direcciona al usuario hacia la pagina \" + PAGINA_CARGA_IO);\n\t\tthis.info(\"Fin de ejecucion del metodo \" + metodo);\n\t\treturn new ModelAndView(PAGINA_CARGA_IO);\n\t}", "public ServerskaForma() {\n initComponents();\n \n \n \n }", "@RequestMapping(value=\"admin/agregar_agencias\", method=RequestMethod.GET)\n\tpublic ModelAndView formAgencias(ModelAndView model) throws IOException{\n\n\t\tModelAndView model2 = new ModelAndView();\n\t\tmodel2.setViewName(\"agregar_agencia_admin\");\t \n\t\t\n\t\treturn model2;\n\n\t}", "private void mostrarNovoForm(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {\n\t\tRequestDispatcher dispatcher = request.getRequestDispatcher(\"usuario-form.jsp\");\n\t\tdispatcher.forward(request, response);\n\t\t\n\t}", "@Override\n\tprotected BaseProcesoForm devuelveFormProceso() throws Exception {\n\t\tProcesoBASLoggerForm objForm = new ProcesoBASLoggerForm();\n\t\treturn objForm;\n\t}", "public SalidaCajaForm() {\n\t\tinicializarComponentes();\n }", "public Result inicioGenerarLibro(){\n ContabilidadDTO dto = new ContabilidadDTO();\n dto.tipoLibro = new Parametro(\"\",\"LVEN\",\"\");\n //dto.tipoLibro.id.codigo =\"LVEN\";\n dto.anio = new Parametro(\"\",\"2018\",\"\");\n //dto.anio.id.codigo =\"2018\";\n dto.mes = new Parametro(\"\",\"3\",\"\");\n //dto.mes.id.codigo =\"3\"; //Simpre debe ser el mes anterior al actual\n\n Form<ContabilidadDTO> contabilidadDTOForm = formFactory.form(ContabilidadDTO.class).fill(dto);\n\n/*\n EbeanServer db = DBConnectionUtil.getDBServerFacturador();\n List<BandejaFactura> lista = db.find(BandejaFactura.class).findList();; //BandejaFactura.find.all();//obtenerTodos();\n for (BandejaFactura x:lista) {\n System.out.println(x);\n }\n*/\n/*\n EbeanServer db = DBConnectionUtil.getDBServerSGV();\n List<ControlVenta> lista = db.find(ControlVenta.class)\n .where().ilike(\"CVNT_NUM_DOCUMENTO\", \"F002-00000213\")\n .findList();\n for (ControlVenta x:lista) {\n System.out.println(\"*********** \"+x);\n }\n*/\n/*\n EbeanServer db = DBConnectionUtil.getDBServerSGV();\n List<ControlVenta> lista = db.find(ControlVenta.class).findList();; //BandejaFactura.find.all();//obtenerTodos();\n for (ControlVenta x:lista) {\n System.out.println(x);\n }\n*/\n\n return ok(generadorLibrosContables.render(contabilidadDTOForm));\n }", "private void razia(){\n /* Mereset semua Error dan fokus menjadi default */\n mViewUser.setError(null);\n mViewPassword.setError(null);\n View fokus = null;\n boolean cancel = false;\n\n /* Mengambil text dari form User dan form Password dengan variable baru bertipe String*/\n String user = mViewUser.getText().toString();\n String password = mViewPassword.getText().toString();\n\n /* Jika form user kosong atau TIDAK memenuhi kriteria di Method cekUser() maka, Set error\n * di Form User dengan menset variable fokus dan error di Viewnya juga cancel menjadi true*/\n if (TextUtils.isEmpty(user)){\n mViewUser.setError(\"This field is required\");\n fokus = mViewUser;\n cancel = true;\n }else if(!cekUser(user)){\n mViewUser.setError(\"This Username is not found\");\n fokus = mViewUser;\n cancel = true;\n }\n\n /* Sama syarat percabangannya dengan User seperti di atas. Bedanya ini untuk Form Password*/\n if (TextUtils.isEmpty(password)){\n mViewPassword.setError(\"This field is required\");\n fokus = mViewPassword;\n cancel = true;\n }else if (!cekPassword(password)){\n mViewPassword.setError(\"This password is incorrect\");\n fokus = mViewPassword;\n cancel = true;\n }\n\n /* Jika cancel true, variable fokus mendapatkan fokus */\n if (cancel) fokus.requestFocus();\n else masuk();\n }", "@Override\n\tprotected void entrada(WebRequestContext request, Ocorrencia form) throws Exception {\t\t\n\t\tif (!\"true\".equals(request.getParameter(\"reload\"))) {\n\t\t\tFiltroUtils.preencheFiltroPlanoGestaoUnidadeUsuario(form);\n\t\t}\n\t\t\n\t\t//Se for uma nova ocorrência será dada a opção de gerar uma anomalia.\n\t\tif(form.getId() == null){\n\t\t\trequest.setAttribute(\"opcaoCriarAnomalia\", true);\n\n\t\t\t//seta a data e o usuario que esta logado\n\t\t\tform.setDataLancamento(new Date(System.currentTimeMillis()));\n\t\t\tform.setRelator((Usuario)request.getUser());\t\t\t\n\t\t}\n\t\t//Senão será apenas editada.\n\t\telse {\n\t\t\trequest.setAttribute(\"opcaoCriarAnomalia\", false);\n\t\t\tif(!anomaliaService.fazParteAnomalia(form)){\n\t\t\t\trequest.setAttribute(\"opcaoCriarAnomalia\", true);\n\t\t\t}\n\t\t\t\n\t\t\tif (!usuarioService.isUsuarioLogadoAdmin()) {\n\t\t\t\trequest.setAttribute(\"editarSomenteSituacao\", Boolean.TRUE);\n\t\t\t}\t\t\t\n\t\t}\n\t\t\n\t}", "@GetMapping(\"/createRegistro\")\n\tpublic String crearValidacion(Model model) {\n\t\tList<Barrio> localidades = barrioService.obtenerBarrios();\n\t\tmodel.addAttribute(\"localidades\",localidades);\n\t\tmodel.addAttribute(\"persona\",persona);\n\t\tmodel.addAttribute(\"validacion\",validacion);\n\t\tmodel.addAttribute(\"registro\",registro);\n\t\tmodel.addAttribute(\"barrio\",barrio);\n\t\treturn \"RegistroForm\";\n\t}", "public abstract String toFORMParam();", "protected void processRequest(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n response.setContentType(\"text/html;charset=UTF-8\");\n \n String operacion=request.getParameter(\"btnSubmit\");\n \n switch(operacion)\n {\n case \"Registrar\":\n Trabajadores Trabajadores=new Trabajadores();\n \n Trabajadores.setNombres(request.getParameter(\"txtNombres\"));\n Trabajadores.setApellidos(request.getParameter(\"txtApellidos\"));\n Trabajadores.setTipo_documento(request.getParameter(\"ddlTipoDocumento\"));\n Trabajadores.setNum_documento(request.getParameter(\"txtNumDocumento\"));\n Trabajadores.setDireccion(request.getParameter(\"txtDireccion\"));\n Trabajadores.setTelefono(request.getParameter(\"txtTelefono\"));\n Trabajadores.setEmail(request.getParameter(\"txtEmail\"));\n Trabajadores.setSueldo(request.getParameter(\"txtSueldo\"));\n Trabajadores.setRol(request.getParameter(\"txtRol\"));\n Trabajadores.setLogin(request.getParameter(\"txtLogin\"));\n Trabajadores.setPassword(request.getParameter(\"txtPassword\"));\n \n \n String result= Trabajadores.insertar(Trabajadores);\n \n // para crear variables que se envian por el response\n request.setAttribute(\"mensaje\",result);\n //para redicionar y enviar las variables\n request.getRequestDispatcher(\"RegistrarTrabajadores.jsp\").forward(request, response);\n \n break;\n \n case \"Actualizar\":\n break;\n }\n }", "public ingresarDatos() {\n initComponents();\n Validacion();\n \n }", "@GetMapping(value = \"/utilisateur/inscription\")\n public String inscriptionForm(Model model){\n Utilisateur utilisateur=new Utilisateur();\n logger.info(\"Un visiteur veut accéder au formulaire d'inscription\");\n model.addAttribute(\"utilisateur\",utilisateur);\n return \"inscription\";\n }", "private void llamarFormulario(String ruta, Map<String, Object> parametros){\n\t\tcrearModal(BasePackageSistemaMaest+ruta, parametros);\n\t}", "public void Continuar (View view)\n {\n Intent continuar = new Intent( this, Formulario2.class);\n continuar.putExtra(\"nombre\",et_nombre.getText().toString());\n continuar.putExtra(\"apellido\",et_apellido.getText().toString());\n continuar.putExtra(\"telefono\",et_telefono.getText().toString());\n continuar.putExtra(\"email\",et_email.getText().toString());\n continuar.putExtra(\"direccion\",et_direccion.getText().toString());\n continuar.putExtra(\"fecha\",et_fecha.getText().toString());\n continuar.putExtra(\"spinner1\",s1.getSelectedItem().toString());\n continuar.putExtra(\"spinner2\",s2.getSelectedItem().toString());\n startActivity(continuar );\n }", "public FormaServer() {\n initComponents();\n srediFormu();\n \n }", "@GetMapping(\"/form\")\n\tpublic String form() {\n\t\treturn \"form\";\n\t}", "public creacionempresa() {\n initComponents();\n mostrardatos();\n }", "@Override\n protected void doPost(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n \n \n String id_entrada=request.getParameter(\"id_entrada\");\n String fecha_entrada=request.getParameter(\"fecha_entrada\");\n String cantidad=request.getParameter(\"cantidad\");\n String id_material=request.getParameter(\"id_material\");\n \n Entradamaterial e=new Entradamaterial();\n e.setId_entrada(id_entrada);\n e.setFecha_entrada(fecha_entrada);\n e.setCantidad(cantidad);\n e.setId_material(id_material);\n \n if(EntradamaterialDao.registrar(e)){\n request.setAttribute(\"mensaje\", \"La entrada fue registrada\");\n } else {\n request.setAttribute(\"mensaje\", \"La entrada NO fue registrada\");\n }\n request.getRequestDispatcher(\"RegistroEntrada.jsp\").forward(request, response);\n }", "public ActionForward A_GenerarPlanillaProrroga(ActionMapping mapping, ActionForm form,\n HttpServletRequest request, HttpServletResponse response)\n throws Exception {\n\n //Salidas\n final String[] SALIDAS = {\"V_GestionarProrroga\", \"A_Pre_GestionarProrroga\", };\n final int SALIDA_0 = 0;\n final int SALIDA_1 = 1;\n\n int salida = SALIDA_0;\n Session s = HibernateUtil.getCurrentSession();\n Transaction tr = s.beginTransaction();\n try {\n /*aqui empieza*/\n EstRealizaProy student = (EstRealizaProy)s.createQuery(\"from EstRealizaProy where tipoproy='1' and carnetestudiante= :login\").setString(\"login\", (String)request.getSession().getAttribute(\"login\")).uniqueResult();\n Estudiante estudiante =(Estudiante)s.createQuery(\"from Estudiante where carnete = :login\").setString(\"login\", (String)request.getSession().getAttribute(\"login\")).uniqueResult();\n PreInsPasantias consulta = (PreInsPasantias)s.createQuery(\"from PreInsPasantias where estudiante = :login\").setString(\"login\", (String)request.getSession().getAttribute(\"login\")).uniqueResult();\n\n if (estudiante != null) {\n\n String carnet = (String)request.getSession().getAttribute(\"login\");\n Prorroga fF_Prorroga = (Prorroga) s.createQuery(\"from Prorroga where idc= :carnet\").setString(\"carnet\", carnet).uniqueResult();;\n String coordinacion = fF_Prorroga.getCoordinacion();\n String nombre = fF_Prorroga.getNombre();\n String codigoTutorAcademico = fF_Prorroga.getCodigoTutorAcademico();\n String tituloPasantia = fF_Prorroga.getTituloPasantia();\n String areaProyecto = fF_Prorroga.getAreaProyecto();\n String fecha = fF_Prorroga.getFecha();\n String justificacion = fF_Prorroga.getJustificacion();\n \n String path = getServlet().getServletContext().getRealPath(\"/\")+ \"../../img/\";\n\n /**************************************/\n /* PDF */\n /**************************************/\n try {\n Document pdf = new Document(PageSize.LETTER);\n\n response.setContentType(\"application/pdf4\");\n response.setHeader(\"Content-Disposition\", \" inline; filename=PlanillaProrroga.pdf\");\n\n PdfWriter.getInstance(pdf, response.getOutputStream());\n\n pdf.open();\n\n // Logo\n Image logo = Image.getInstance(path +\"logo.png\");\n logo.scaleToFit(197, 81);\n logo.setAlignment(Image.ALIGN_LEFT);\n pdf.add(logo);\n\n // Pie\n Image pie = Image.getInstance(path +\"pie.png\");\n pie.scaleToFit(500, 216);\n pie.setAbsolutePosition(40, 20);\n pdf.add(pie);\n\n Font font = FontFactory.getFont(\"Arial\", BaseFont.IDENTITY_H, 12);\n font.setStyle(Font.BOLD);\n\n Font font2 = FontFactory.getFont(\"Arial\", BaseFont.IDENTITY_H, 13);\n font2.setStyle(Font.UNDERLINE);\n font2.setStyle(Font.BOLD);\n\n Paragraph titulo = new Paragraph(\"PERMISO PARA PASANTIA (Prorroga)\", font2);\n titulo.setAlignment(Paragraph.ALIGN_CENTER);\n pdf.add(titulo);\n\n Paragraph blank = new Paragraph(\"\\n\");\n\n pdf.add(blank);\n pdf.add(blank);\n\n Phrase est = new Phrase(\"Coordinación de: \"+ coordinacion , font);\n pdf.add(est);\n pdf.add(blank);\n\n est = new Phrase(\"Nombre: \" + nombre +\" Carnet: \"+ carnet, font);\n pdf.add(est);\n pdf.add(blank);\n\n Paragraph pfecha= new Paragraph(\"*Fecha Propuesta: \"+fecha);\n pfecha.setAlignment(Paragraph.ALIGN_CENTER);\n pdf.add(pfecha);\n\n pfecha= new Paragraph(\"_______________________________________________________________________\", font);\n pfecha.setAlignment(Paragraph.ALIGN_CENTER);\n pdf.add(pfecha);\n pdf.add(blank);\n\n pfecha= new Paragraph(\"Pasantía\", font2);\n pfecha.setAlignment(Paragraph.ALIGN_CENTER);\n pdf.add(pfecha);\n pdf.add(blank);\n\n if (tituloPasantia.equals(\"3420\")){\n pfecha= new Paragraph(\"Pasantía Larga (3420) \"+ \"Periodo: \" + areaProyecto, font);\n }\n if (tituloPasantia.equals(\"2420\")){\n pfecha= new Paragraph(\"Pasantía Media (2420) \"+ \"Periodo: \" + areaProyecto, font);\n }\n if (tituloPasantia.equals(\"1420\")){\n pfecha= new Paragraph(\"Pasantía Corta (1420) \"+ \"Periodo: \" + areaProyecto, font);\n }\n\n pfecha.setAlignment(Paragraph.ALIGN_CENTER);\n pdf.add(pfecha);\n pdf.add(blank);\n\n pdf.add(blank);\n\n est = new Phrase(\"*Tutor Academico: \"+codigoTutorAcademico , font);\n pdf.add(est);\n\n est = new Phrase(\" Firma:_____________________\" , font);\n pdf.add(est);\n pdf.add(blank);\n\n pfecha= new Paragraph(\"Justificacion: \",font);\n pdf.add(pfecha);\n pdf.add(blank);\n pfecha= new Paragraph( justificacion);\n pdf.add(pfecha);\n pdf.add(blank);\n pdf.add(blank);\n\n est = new Phrase(\"Observaciones:______________________________________________________\");\n pdf.add(est);\n pdf.add(blank);\n\n est = new Phrase(\"Firma y Sello Coordinación:______________________________\" , font);\n pdf.add(est);\n pdf.add(blank);\n\n est = new Phrase(\"Firma CCTDS:_____________________________________________\" , font);\n pdf.add(est);\n pdf.add(blank);\n\n pdf.close();\n\n } catch (Exception e) {\n e.printStackTrace();\n }\n\n /**************************************/\n /* PDF */\n /**************************************/\n\n }else{\n salida = SALIDA_1;\n }\n\n /*aqui termina*/\n tr.commit();\n\n } catch (Exception ex) {\n tr.rollback();\n throw ex;\n } finally {\n try { s.close(); } catch (Exception ex2) {}\n }\n if (salida==0) {\n request.setAttribute(\"msg\",\n getResources(request).getMessage(\"A_Pre_ConsultarPlanillaProrroga.msg0\"));\n }\n if (salida==1) {\n request.setAttribute(\"msg\",\n getResources(request).getMessage(\"A_Pre_ConsultarPlanillaProrroga.msg1\"));\n }\n\n return mapping.findForward(SALIDAS[salida]);\n }", "@Override\n protected void doPost(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n String dni = request.getParameter(\"dni\");\n String nombres = request.getParameter(\"nombres\");\n String apellido = request.getParameter(\"apellido\");\n //String fechaNacimiento = request.getParameter(\"fechaNacimiento\");\n LocalDate fechaNacimiento = LocalDate.parse(request.getParameter(\"fechaNacimiento\"));\n \n String direccion = request.getParameter(\"direccion\");\n String cargo = request.getParameter(\"cargo\");\n int usuario = Integer.parseInt(request.getParameter(\"usuario\"));\n \n //DateTimeFormatter formatter = DateTimeFormatter.ofPattern(\"dd/MM/yyyy\");\n //LocalDate date = LocalDate.parse(fechaNacimiento, formatter);\n \n //LLamamos a la controladora de la Logica\n EmpleadoControladora controlEmpleado = new EmpleadoControladora();\n if (usuario != 0 ){\n controlEmpleado.crearEmpleado(dni, nombres, apellido, fechaNacimiento, direccion, cargo, usuario);\n } else {\n controlEmpleado.crearEmpleadoSinUser(dni, nombres, apellido, fechaNacimiento, direccion, cargo);\n }\n \n //Armamos la redireccion\n response.sendRedirect(\"SvEmpleadoList\");\n }", "@Override\n public ExtensionResult dogetFormcuti(ExtensionRequest extensionRequest) {\n\n Map<String, String> output = new HashMap<>();\n String formId = appProperties.getFormIdCuti();\n FormBuilder formBuilder = new FormBuilder(formId);\n ButtonTemplate button = new ButtonTemplate();\n button.setTitle(\"Form Cuti\");\n button.setSubTitle(\"Form Cuti\");\n button.setPictureLink(Image_cuti);\n button.setPicturePath(Image_cuti);\n List<EasyMap> actions = new ArrayList<>();\n EasyMap bookAction = new EasyMap();\n bookAction.setName(\"Isi Form\");\n bookAction.setValue(formBuilder.build());\n// bookAction.setValue(appProperties.getShortenFormCuti());\n actions.add(bookAction);\n button.setButtonValues(actions);\n ButtonBuilder buttonBuilder = new ButtonBuilder(button);\n\n output.put(OUTPUT, buttonBuilder.build());\n ExtensionResult extensionResult = new ExtensionResult();\n extensionResult.setAgent(false);\n extensionResult.setRepeat(false);\n extensionResult.setSuccess(true);\n extensionResult.setNext(true);\n extensionResult.setValue(output);\n return extensionResult;\n }", "public void inicializar() {\r\n\t\ttry {\r\n\t\t\tJFrame.setDefaultLookAndFeelDecorated(true);\r\n\t\t\tUIManager.setLookAndFeel(\"com.jtattoo.plaf.hifi.HiFiLookAndFeel\");\r\n\t\t} catch (Exception e) {\r\n\t\t\te.printStackTrace();\r\n\t\t}\r\n\r\n\t\tgetContentPane().setLayout(null);\r\n\r\n\t\tlblUsuario = new JLabel(\"Mail Empleado:\");\r\n\t\tlblUsuario.setBounds(40, 40, 124, 20);\r\n\t\tgetContentPane().add(lblUsuario);\r\n\r\n\t\tlblPass = new JLabel(\"Contraseña:\");\r\n\t\tlblPass.setBounds(40, 72, 124, 20);\r\n\t\tgetContentPane().add(lblPass);\r\n\r\n\t\tlblConfPass = new JLabel(\"Confirmación Contraseña:\");\r\n\t\tlblConfPass.setBounds(40, 104, 220, 20);\r\n\t\tgetContentPane().add(lblConfPass);\r\n\r\n\t\ttxtUsuario = new JTextField();\r\n\t\ttxtUsuario.setBounds(275, 40, 138, 20);\r\n\t\tgetContentPane().add(txtUsuario);\r\n\t\ttxtUsuario.setColumns(10);\r\n\r\n\t\tpwdPass = new JPasswordField();\r\n\t\tpwdPass.setEchoChar('*'); // quitamos valor\r\n\t\tpwdPass.setBounds(275, 72, 138, 20);\r\n\t\tgetContentPane().add(pwdPass);\r\n\r\n\t\tpwdConfPass = new JPasswordField();\r\n\t\tpwdConfPass.setEchoChar('*');\r\n\t\tpwdConfPass.setBounds(275, 104, 138, 20);\r\n\t\tgetContentPane().add(pwdConfPass);\r\n\r\n\t\tbtnRegistrar = new JButton(\"Registrar\");\r\n\t\tbtnRegistrar.addActionListener(new ActionListener() {\r\n\t\t\tpublic void actionPerformed(ActionEvent arg0) {\r\n\t\t\t\t// recuperamos los datos introducidos y los volcamos en BD\r\n\t\t\t\tUsuarioPojo user = null;\r\n\t\t\t\tUsuarioPersistencia up = new UsuarioPersistencia();\r\n\r\n\t\t\t\t//int id = up.obtenerIdEmple();\r\n\t\t\t\tString usuarioMail = txtUsuario.getText();\r\n\t\t\t\tString password = new String(pwdPass.getPassword()); // DNI de momento\r\n\t\t\t\tString passwordC = new String(pwdConfPass.getPassword());\r\n\t\t\t\tString apenom = txtApenom.getText();\r\n\t\t\t\tString dni = txtDni.getText();\r\n\t\t\t\tint numSS = Integer.parseInt(txtSegSoc.getText());\r\n\t\t\t\tString cuenta = txtCuenta.getText();\r\n\r\n\t\t\t\tif (password.equals(passwordC)) {\r\n\t\t\t\t\t// creamos un objeto usuario si coinciden las contraseñas\r\n\t\t\t\t\tuser = new UsuarioPojo(apenom, numSS, cuenta, dni, usuarioMail, password);\r\n\t\t\t\t}\r\n\r\n\t\t\t\tif (user != null) {\r\n\t\t\t\t\t// insertaremos el usuario si coinciden las contraseñas\r\n\t\t\t\t\tup = new UsuarioPersistencia();\r\n\t\t\t\t\tint res = up.insertarUser(user);\r\n\r\n\t\t\t\t\tif (res == 1) { // se habrá registrado al usuario\r\n\t\t\t\t\t\tSystem.out.println(\"Insertado correctamente\");\r\n\t\t\t\t\t\tJOptionPane.showMessageDialog(null, \"Registro insertado correctamente\",\r\n\t\t\t\t\t\t\t\t\"Resultado del Registro\", JOptionPane.INFORMATION_MESSAGE);\r\n\t\t\t\t\t\tdispose(); // dispose cierra ventana actual, System.exit(0) sale del programa\r\n\t\t\t\t\t}\r\n\t\t\t\t} else {\r\n\t\t\t\t\t// mostramos msg si no coinciden las contraseñas, manteniendo el control en dreg\r\n\t\t\t\t\tSystem.out.println(\"No insertado\");\r\n\t\t\t\t\tJOptionPane.showMessageDialog(null, \"Contraseñas introducidas no coinciden\", \"Error de contraseña\",\r\n\t\t\t\t\t\t\tJOptionPane.WARNING_MESSAGE);\r\n\t\t\t\t\t// limpiamos campos de contraseña\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t});\r\n\t\tbtnRegistrar.setBounds(305, 285, 90, 23);\r\n\t\tgetContentPane().add(btnRegistrar);\r\n\r\n\t\tchckbxMostrarPass1 = new JCheckBox(\"Mostrar contraseña\");\r\n\t\tchckbxMostrarPass1.setBounds(470, 71, 175, 23);\r\n\t\t// añadimos un listener para poder mostrar la contraseña como texto\r\n\t\tchckbxMostrarPass1.addActionListener(new ActionListener() {\r\n\t\t\tpublic void actionPerformed(ActionEvent e) {\r\n\t\t\t\tif (chckbxMostrarPass1.isSelected()) {\r\n\t\t\t\t\tpwdPass.setEchoChar((char) 0);\r\n\t\t\t\t} else {\r\n\t\t\t\t\tpwdPass.setEchoChar('*');\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t});\r\n\t\tgetContentPane().add(chckbxMostrarPass1);\r\n\r\n\t\tchckbxMostrarPass2 = new JCheckBox(\"Mostrar contraseña\");\r\n\t\tchckbxMostrarPass2.setBounds(470, 103, 175, 23);\r\n\t\tchckbxMostrarPass2.addActionListener(new ActionListener() {\r\n\t\t\tpublic void actionPerformed(ActionEvent e) {\r\n\t\t\t\tif (chckbxMostrarPass2.isSelected()) {\r\n\t\t\t\t\tpwdConfPass.setEchoChar((char) 0);\r\n\t\t\t\t} else {\r\n\t\t\t\t\tpwdConfPass.setEchoChar('*');\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t});\r\n\t\tgetContentPane().add(chckbxMostrarPass2);\r\n\r\n\t\tlblApenom = new JLabel(\"Nombre y Apellidos:\");\r\n\t\tlblApenom.setBounds(40, 136, 220, 20);\r\n\t\tgetContentPane().add(lblApenom);\r\n\r\n\t\ttxtApenom = new JTextField();\r\n\t\ttxtApenom.setBounds(275, 136, 270, 20);\r\n\t\tgetContentPane().add(txtApenom);\r\n\t\ttxtApenom.setColumns(10);\r\n\r\n\t\tlblSegSoc = new JLabel(\"Nº Seguridad Social:\");\r\n\t\tlblSegSoc.setBounds(40, 200, 220, 20);\r\n\t\tgetContentPane().add(lblSegSoc);\r\n\r\n\t\ttxtSegSoc = new JTextField();\r\n\t\ttxtSegSoc.setBounds(275, 200, 138, 20);\r\n\t\tgetContentPane().add(txtSegSoc);\r\n\t\ttxtSegSoc.setColumns(10);\r\n\r\n\t\tlblCuenta = new JLabel(\"Nº Cuenta Bancaria:\");\r\n\t\tlblCuenta.setBounds(40, 232, 200, 20);\r\n\t\tgetContentPane().add(lblCuenta);\r\n\r\n\t\ttxtCuenta = new JTextField();\r\n\t\ttxtCuenta.setBounds(275, 232, 138, 20);\r\n\t\tgetContentPane().add(txtCuenta);\r\n\t\ttxtCuenta.setColumns(10);\r\n\r\n\t\tlblDniUser = new JLabel(\"DNI:\");\r\n\t\tlblDniUser.setBounds(40, 168, 124, 20);\r\n\t\tgetContentPane().add(lblDniUser);\r\n\r\n\t\ttxtDni = new JTextField();\r\n\t\ttxtDni.setColumns(10);\r\n\t\ttxtDni.setBounds(275, 168, 138, 20);\r\n\t\tgetContentPane().add(txtDni);\r\n\r\n\t\t// cambiamos EXIT por DISPOSE, porque solo queremos que cierre esta ventana, no\r\n\t\t// que me salga del programa definitivamente\r\n\t\tsetDefaultCloseOperation(WindowConstants.DISPOSE_ON_CLOSE);\r\n\t\tsetBounds(250, 250, 700, 380);\r\n\t\tthis.setLocationRelativeTo(null); // para que centre en pantalla\r\n\t}", "public tambahtoko() {\n initComponents();\n tampilkan();\n form_awal();\n }", "protected void processRequest(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n response.setContentType(\"text/html;charset=UTF-8\");\n try (PrintWriter out = response.getWriter()) {\n /* TODO output your page here. You may use following sample code. */\n String nombreParametro=null;\n String[]valoresParametro=null;\n Iterator it;\n String nombre= request.getParameter(\"nombre\");\n String cadena = request.getParameter(\"telefono\") ;\n out.println(\"<!DOCTYPE html>\");\n out.println(\"<html>\");\n out.println(\"<head>\");\n out.println(\"<title>Servlet registro</title>\"); \n out.println(\"</head>\");\n out.println(\"<body>\");\n out.println(\"<form action=\\\"registro\\\" method=\\\"post\\\">\");\n \n if (nombre == \"\"){\n \n out.println(\" <p><label for=\\\"nombre\\\"> Nombre </label>&nbsp;&nbsp;\");\n out.println( \"<input type=\\\"text\\\" id value= \\\"\"+nombre+\"\\\" > \");\n out.println(\"</br>\");\n \n \n }else{\n out.println(\" <p><label for=\\\"nombre\\\"> Nombre </label>&nbsp;&nbsp;\");\n out.println(request.getParameter(\"nombre\"));\n }\n if (request.getParameter(\"apellido\")==\"\"){\n \n out.println(\" <p><label for=\\\"apellido\\\"> Apellido </label>&nbsp;&nbsp;\");\n out.println( \"<input type=\\\"text\\\" id value= \\\"\"+request.getParameter(\"apellido\")+\"\\\" > \");\n out.println(\"</br>\");\n \n \n }else{\n out.println(\" <p><label for=\\\"nombre\\\"> Apellido </label>&nbsp;&nbsp;\");\n out.println(request.getParameter(\"apellido\"));\n }\n \n if (request.getParameter(\"usuario\")==\"\"){\n out.println(\" <p><label for=\\\"usuario\\\"> Usuario </label>&nbsp;&nbsp;\");\n out.println( \"<input type=\\\"text\\\" id value= \\\"\"+request.getParameter(\"usuario\")+\"\\\" > \");\n out.println(\"</br>\");\n }else{\n out.println(\" <p><label for=\\\"usuario\\\"> Usuario </label>&nbsp;&nbsp;\");\n out.println(request.getParameter(\"usuario\"));\n }\n \n if (request.getParameter(\"contrasena\")==\"\"){\n out.println(\" <p><label for=\\\"contraseña\\\"> Contraseña </label>&nbsp;&nbsp;\");\n out.println( \"<input type=\\\"text\\\" id value= \\\"\"+request.getParameter(\"contrasena\")+\"\\\" > \");\n out.println(\"</br>\");\n }else{\n out.println(\" <p><label for=\\\"contraseña\\\"> Contraseña </label>&nbsp;&nbsp;\");\n out.println(request.getParameter(\"contrasena\"));\n }\n \n if (cadena.length() != 9 || !cadena.startsWith(\"6\") || !cadena.startsWith(\"7\") || !cadena.startsWith(\"9\")) {\n out.println(\" <p><label for=\\\"telefono\\\"> Telefono </label>&nbsp;&nbsp;\");\n out.println( \"<input type=\\\"text\\\" id value= \\\"\"+request.getParameter(\"telefono\")+\"\\\" > \");\n out.println(\"</br>\");\n }else{\n out.println(\" <label for=\\\"telefono\\\"> Telefono </label>&nbsp;&nbsp;\");\n out.println(request.getParameter(\"telefono\")); \n }\n if (request.getParameter(\"sexo\")==null){\n out.println(\"<label>Sexo :</label> &nbsp;&nbsp;\");\n out.println(\"<label>Hombre :</label>&nbsp;&nbsp;\");\n out.println(\"<input type=\\\"radio\\\" name=\\\"sexo\\\" value=\\\"hombre\\\" >\");\n out.println(\"<label>Mujer :</label>&nbsp;&nbsp;\");\n out.println(\"<input type=\\\"radio\\\" name=\\\"sexo\\\" value=\\\"mujer\\\" >\");\n \n }else{\n out.println(\" <p><label for=\\\"sexo\\\"> sexo </label>&nbsp;&nbsp;\");\n out.println(request.getParameter(\"sexo\"));\n }\n \n if (request.getParameter(\"preferencia\")==null){\n out.println(\"<label>Preferencias :</label>&nbsp;&nbsp;\");\n out.println(\"<label>Deporte</label>&nbsp;&nbsp;\");\n out.println(\"<input type=\\\"checkbox\\\" name=\\\"preferencia\\\" value=\\\"Deporte\\\">\");\n out.println(\"<label>Lectura</label>&nbsp;&nbsp;\");\n out.println(\"<input type=\\\"checkbox\\\" name=\\\"preferencia\\\" value=\\\"Lectura\\\">\");\n out.println(\"<label>Cine</label>&nbsp;&nbsp;\");\n out.println(\"<input type=\\\"checkbox\\\" name=\\\"preferencia\\\" value=\\\"Cine\\\">\");\n out.println(\"<label>Deporte</label>&nbsp;&nbsp;\");\n out.println(\"<input type=\\\"checkbox\\\" name=\\\"preferencia\\\" value=\\\"Viajes\\\">\");\n \n }else{\n out.println(\" <p><label for=\\\"preferencias\\\"> preferencias </label>&nbsp;&nbsp;\");\n out.println(request.getParameter(\"preferencia\"));\n }\n \n out.println(\"<input type=\\\"submit\\\" name=\\\"enviar\\\" value=\\\"Enviar\\\">\");\n out.println(\"<input type=\\\"reset\\\" name=\\\"borrar\\\" value=\\\"borrar\\\">\");\n out.println(\"</form>\");\n \n out.println(\"<h1>Servlet registro at \" + request.getContextPath() + \"</h1>\");\n out.println(\"</body>\");\n out.println(\"</html>\");\n \n }\n }", "@RequestMapping(value = \"form\", method = RequestMethod.GET)\n public String form() {\n return \"user_form\";\n }", "@Override\r\n\tprotected String requestText() {\n\t\tGuardarSustentoRequest guardarSustentoRequest = new GuardarSustentoRequest();\r\n\t\tguardarSustentoRequest.setCodigoActvidad(codigoActvidad);\r\n\t\tguardarSustentoRequest.setCodigoCliente(codigoCliente);\r\n\t\tguardarSustentoRequest.setCodigoPLan(codigoPLan);\r\n\t\tguardarSustentoRequest.setDescripcionActividad(descripcionActividad);\r\n\t\tguardarSustentoRequest.setFechaVisita(fechaVisita);\r\n\t\tguardarSustentoRequest.setTipoActividad(tipoActividad);\r\n\t\tguardarSustentoRequest.setUsuario(usuario);\r\n\t\tString request = JSONHelper.serializar(guardarSustentoRequest);\r\n\t\treturn request;\r\n\t}", "public ActionForward inicio(ActionMapping mapping, ActionForm form,\n HttpServletRequest request, HttpServletResponse response)\n throws Exception\n {\n TemaForm temaForm = (TemaForm) form;\n String forward = \"INICIO\";\n try\n {\n temaForm.setCriterioTema(new CriterioTema());\n temaForm.setTema(new Tema());\n temaForm.setTemas(new ArrayList<Tema>());\n } catch (Exception e)\n {\n log.error(\"Ha ocurrido un error en el metodo inicio del tema\", e);\n }\n return mapping.findForward(forward);\n }", "public static Result getFilledForm() {\r\n\t\tStatus result;\r\n\t\ttry {\r\n\t\t\tString formName = ChangeOrderForm.NAME;\r\n\t\t\tString username = CMSSession.getEmployeeName();\r\n\t\t\tFile pdf = File.createTempFile(\"Change_Order_Form_Filled\", \".pdf\");\r\n\t\t\tCMSGuidedFormFill.fillForm(formName, username, pdf);\r\n\r\n\t\t\tresult = ok(pdf, true);\r\n\r\n\t\t\tFileDeletionHandler.deleteFile(pdf);\r\n\t\t} catch (IOException e) {\r\n\t\t\tLogger.error(\"Couldn't create new temp file.\");\r\n\t\t\tLogger.error(e.getMessage(), e);\r\n\t\t\tresult = internalServerError();\r\n\t\t}\r\n\t\treturn result;\r\n\t}", "public ActionForward saveTemaAsync(ActionMapping mapping, ActionForm form,\n HttpServletRequest request, HttpServletResponse response)\n throws Exception\n {\n response.setContentType(\"text/json\");\n try\n {\n String tema = request.getParameter(\"descripcionTema\");\n String idEmpleadoRevisor = request.getParameter(\"idEmpleadoRevisor\");\n Empleado usuarioSession = (Empleado) request.getSession().getAttribute(Constantes.USUARIO_SESION);\n Tema beanTema = new Tema();\n beanTema.setActivo(Constantes.ACTIVADO);\n beanTema.setArea(usuarioSession.getArea());\n beanTema.setEvento(Constantes.NO_ACTIVO);\n beanTema.setTema(tema);\n beanTema.setId_area(usuarioSession.getArea().getId_area());\n beanTema.getRevisor().setId_empleado(Integer.valueOf(idEmpleadoRevisor));\n this.temaService.saveTema(beanTema);\n this.temaService.saveTemaRevisor(beanTema);\n JSONObject jsonArray = JSONObject.fromObject(beanTema);\n PrintWriter pw = response.getWriter();\n pw.write(jsonArray.toString());\n pw.flush();\n pw.close();\n //subir el nuevo tema a session del usuario\n request.getSession().removeAttribute(Constantes.TEMAS);\n request.getSession().setAttribute(Constantes.TEMAS, this.temaService.listTemas(usuarioSession.getId_area()));\n\n } catch (Exception e)\n {\n log.debug(\"Error al guardar un tema desde la pantalla de captura\", e);\n }\n return null;\n }", "@PostConstruct\n\tpublic void view() {\n\t\tif (log.isDebugEnabled()) {\n log.debug(\"Entering 'ConsultaHIPCuentaCorrientesAction - view' method\");\n }\n\t\tMap<String, String> parametros = FacesContext.getCurrentInstance().getExternalContext().getRequestParameterMap();;\n\t\tthis.parametrosPantalla = new HashMap<String, String>();\n\t\tthis.parametrosPantalla.putAll(parametros);\n\t\ttry {\n\t\t\tthis.formBusqueda = this.devuelveFormBusqueda();\n\t\t}\n\t\tcatch (Exception e) {\n\t\t\t\n\t\t}\n\t}", "public GestaoFormando() {\n \n initComponents();\n listarEquipamentos();\n listarmapainscritos();\n }", "@Override\r\n\tprotected String requestText() {\n\t\tConsultarIndiceEjecucionAnioRequest consultarIndiceEjecucionAnioRequest = new ConsultarIndiceEjecucionAnioRequest();\r\n\t\tconsultarIndiceEjecucionAnioRequest.setPeriodo(periodo);\r\n\t\tString request = JSONHelper.serializar(consultarIndiceEjecucionAnioRequest);\r\n\t\treturn request;\r\n\t}", "FORM createFORM();", "public String registrarExtra(){\n\t\tFacesContext context = FacesContext.getCurrentInstance();\n\t\tActividad actividad = context.getApplication().evaluateExpressionGet(context, \"#{actividad}\", Actividad.class);\n\t\tEncargado encargado = context.getApplication().evaluateExpressionGet(context, \"#{encargado}\", Encargado.class);\n\t\t\n\t\ttry {\n\t\t\tactividad.registrarActividad_Encargado(encargado.getCedula());\n\t\t} catch (SQLException e) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\te.printStackTrace();\n\t\t}\t\n\t\t\t\t\t\n\t\t// put the user object into the POST request \n\t\tFacesContext.getCurrentInstance().getExternalContext().getRequestMap().put(\"actividad\", actividad);\n\t\t\n\t\treturn \"principalAdministrador.xhtml\";\n\t}", "public abstract FullResponse onServeFormParams(Map<String, List<String>> formParams);", "@Override\n public void asignaParametros() {\n paso = request.getParameter(\"pasoSig\")!=null?request.getParameter(\"pasoSig\"):\"0\";\n String paginaSig = \"\";\n HashMap param = new HashMap();\n Documento doc = new Documento();\n switch (Integer.parseInt(paso)){\n case 0:\n //paso inicial: obtener la vista de los parametros\n datos.clear();\n String vista = request.getParameter(\"vista\")!=null?request.getParameter(\"vista\"):\"\";\n String idoperacion = request.getParameter(\"operacion\")!=null?request.getParameter(\"operacion\"):\"\";\n //cargar los parametros al hash de datos\n datos.put(\"idoperacion\", idoperacion);\n sesion.setPaginaSiguiente(vista);\n break;\n case 1: case 6: case 50: case 51: case 52: case 53: case 97: case 98: case 99:\n paginaSig = request.getParameter(\"paginaSig\")!=null?request.getParameter(\"paginaSig\"):\"\";\n sesion.setPaginaSiguiente(paginaSig);\n break;\n case 3: case 5: case 7:\n //editar documento(3) || baja de documentos(5) || activar documento(7)\n doc.setId(Integer.parseInt(request.getParameter(\"idDoc\")));\n datos.put(\"documento\", doc);\n datos.put(\"varios\", request.getParameter(\"varios\"));\n paginaSig = request.getParameter(\"paginaSig\")!=null?request.getParameter(\"paginaSig\"):\"\";\n sesion.setPaginaSiguiente(paginaSig);\n break;\n case 8:\n //imprimir los docs seleccionados\n datos.put(\"reporte\", application.getRealPath(\"WEB-INF/Reportes/Nomina/Personal/documentosemple.jasper\"));\n //parametros\n param = new HashMap();\n param.put(\"LOGO\", application.getRealPath(\"/Imagenes/\"+datos.get(\"logo\").toString()));\n param.put(\"RUTAIMGS\", application.getRealPath(\"/Imagenes/Personal/Documentos\"));\n Empleado empl = (Empleado)datos.get(\"empleado\");\n param.put(\"EMPLEADO\", new Integer(empl.getNumempleado()));\n param.put(\"DOCS\", request.getParameter(\"dato1\"));\n datos.put(\"parametros\", param);\n break;\n }\n datos.put(\"paso\", paso);\n }", "public void initHis_atencion_embarazada() throws Exception {\n\t\ttry {\r\n\t\t\taccionForm(true, \"registrar\");\r\n\r\n\t\t} catch (Exception e) {\r\n\t\t\t\r\n\t\t\tlog.error(e.getMessage(), e);\r\n\t\t\tMessagebox.show(e.getMessage(), \"Error !!\", Messagebox.OK,\r\n\t\t\t\t\tMessagebox.ERROR);\r\n\t\t}\r\n\r\n\t}", "public ActionForward cargar(ActionMapping mapping, ActionForm form, HttpServletRequest request,\n\t\t\tHttpServletResponse response) throws IOException, ServletException {\n\n\t\tLogger loggerInfo = Utilidades.loggerInfo();\n\t\tLogger loggerError = Utilidades.loggerError();\n\t\tActionMessages errores = new ActionMessages();\n\t\t\n\t\tloggerInfo.info(FechaUtil.getHoraActual()+\"_CambiarEstadoAction cargar - INICIO***\");\n\t\t\n\t\ttry {\n\t\n\t\t\t\n\t\t\tCambiarEstadoForm formulario = (CambiarEstadoForm) form;\n\t\t\tUsuarioDAO usuarioDAO = DAOFactory.crearUsuarioDAO();\n\t\t\tUsuario usuario = (Usuario) request.getSession().getAttribute(\"usuarioLog\");\n\t\t\tEntidadDAO entidadDAO = DAOFactory.crearEntidadDAO();\n\t\t\tEstadoDAO estadoDAO = DAOFactory.crearEstadoDAO();\n\t\t\tCambioEstadoDAO cambioEstadoDAO = DAOFactory.crearCambioEstadoDAO();\n\t\t\tTipoFormatoDAO tipoDAO = DAOFactory.crearTipoFormatoDAO();\n\t\t\tList<Estado> estadoNuevo = null;\n\t\t\tList<Estado> estadosPermitidos = new ArrayList<Estado>();\n\t\t\testadoNuevo = new ArrayList<Estado>();\n\t\t\tArrayList<String> strCombinaciones = new ArrayList<String>();\n\t\t\tformulario.setTipoFormatos(tipoDAO.buscarTipoFormatos());\n\t\t\tformulario.setEntidades(entidadDAO.buscarEntidades());\n\t\t\tformulario.setEstados2(estadoDAO.obtenerEstados(\"5\"));\n\t\t\tformulario.setEstados(estadoNuevo);\n\t\t\t// formulario.setEstados(cambioEstadoDAO.BuscarEstados(\"0\"));\n\t\t\t// Solo agregar estados que se encuentren permitidos en la tabla\n\t\t\t// cambio de estados\n\t\t\tList<CambioEstado> cambioEstados = cambioEstadoDAO.BuscarCambioEstadosTodos();\n\t\t\tArrayList<String> strEstadosDe = new ArrayList<String>();\n\t\t\tArrayList<String> strEstadosA = new ArrayList<String>();\n\t\t\tList<Estado> estadoHidden = new ArrayList<Estado>();\n\t\t\tfor (int i = 0; i < cambioEstados.size(); i++) {\n\n\t\t\t\tstrEstadosDe.add(cambioEstados.get(i).getDe());\n\t\t\t\tstrEstadosA.add(cambioEstados.get(i).getA());\n\t\t\t\tEstado est = new Estado();\n\t\t\t\test.setDescripcion(cambioEstados.get(i).getDe() + \"-\" + cambioEstados.get(i).getA());\n\t\t\t\test.setEstado(cambioEstados.get(i).getDe() + \"-\" + cambioEstados.get(i).getA());\n\t\t\t\test.setFormatos(null);\n\t\t\t\testadoHidden.add(est);\n\t\t\t}\n\n\t\t\tSet<String> listFinalRegsDe = new HashSet<String>(strEstadosDe);\n\t\t\tSet<String> listFinalRegsA = new HashSet<String>(strEstadosA);\n\n\t\t\tif (!listFinalRegsDe.isEmpty() && !listFinalRegsA.isEmpty()) {\n\n\t\t\t\tIterator itDe = listFinalRegsDe.iterator();\n\t\t\t\tIterator itA = listFinalRegsA.iterator();\n\t\t\t\tInteger intCount = 0;\n\t\t\t\tstrEstadosDe = new ArrayList<String>();\n\t\t\t\tstrEstadosA = new ArrayList<String>();\n\n\t\t\t\twhile (itDe.hasNext()) {\n\t\t\t\t\tString vehDup = (String) itDe.next();\n\t\t\t\t\tstrEstadosDe.add(vehDup);\n\t\t\t\t}\n\n\t\t\t\tintCount = 0;\n\t\t\t\twhile (itA.hasNext()) {\n\t\t\t\t\tString vehDup = (String) itA.next();\n\t\t\t\t\tstrEstadosA.add(vehDup);\n\t\t\t\t}\n\n\t\t\t}\n\t\t\tfor (int i = 0; i < strEstadosDe.size(); i++) {\n\t\t\t\testadosPermitidos.add(estadoDAO.obtenerEstadosPorEstado(strEstadosDe.get(i)));\n\t\t\t}\n\t\t\tformulario.setEstados2(estadosPermitidos);\n\t\t\testadosPermitidos = new ArrayList<Estado>();\n\n\t\t\tfor (int i = 0; i < strEstadosA.size(); i++) {\n\t\t\t\testadosPermitidos.add(estadoDAO.obtenerEstadosPorEstado(strEstadosA.get(i)));\n\t\t\t}\n\t\t\t\n\t\t\tformulario.setEstados(estadosPermitidos);\n\t\t\tformulario.setEstados3(estadoHidden);\n\t\t\tloggerInfo.info(FechaUtil.getHoraActual()+\"_CambiarEstadoAction finalizo cargar - FIN***\");\n\t\t\t\n\t\t\tloggerInfo.removeAllAppenders();\n\t\t\tloggerError.removeAllAppenders();\n\t\t\treturn mapping.findForward(\"cargar\");\n\n\t\t} catch (Exception e) {\n\n\t\t\tloggerError.error(FechaUtil.getHoraActual()+\"_Fallo CambiarEstadoAction cargar\", e);\n\t\t\tloggerError.error(FechaUtil.getHoraActual()+\"_CambiarEstadoAction cargar - FIN***\");\n\t\t\tloggerInfo.removeAllAppenders();\n\t\t\tloggerError.removeAllAppenders();\n\t\t\terrores.add(ActionMessages.GLOBAL_MESSAGE, new ActionMessage(\"texto.etiqueta.error.log\"));\n\t\t\tsaveErrors(request, errores);\n\t\t\treturn mapping.findForward(\"cargar\");\n\t\t\t\n\t\t}\n\n\t}", "public String nuevo() {\n\n\t\tLOG.info(\"Submitado formulario, accion nuevo\");\n\t\tString view = \"/alumno/form\";\n\n\t\t// las validaciones son correctas, por lo cual los datos del formulario estan en\n\t\t// el atributo alumno\n\n\t\t// TODO simular index de la bbdd\n\t\tint id = this.alumnos.size();\n\t\tthis.alumno.setId(id);\n\n\t\tLOG.debug(\"alumno: \" + this.alumno);\n\n\t\t// TODO comprobar edad y fecha\n\n\t\talumnos.add(alumno);\n\t\tview = VIEW_LISTADO;\n\t\tmockAlumno();\n\n\t\t// mensaje flash\n\t\tFacesContext facesContext = FacesContext.getCurrentInstance();\n\t\tExternalContext externalContext = facesContext.getExternalContext();\n\t\texternalContext.getFlash().put(\"alertTipo\", \"success\");\n\t\texternalContext.getFlash().put(\"alertMensaje\", \"Alumno \" + this.alumno.getNombre() + \" creado con exito\");\n\n\t\treturn view + \"?faces-redirect=true\";\n\t}", "public void guardarDatosForm(ActionEvent evt) {\n\t\ttry {\n\t\t\tthis.mantenimientoCCCFacturarInteresAction.procesarArchivo();\n\t\t} catch (Exception e) {\n\t\t\tthis.addError(\"Error : \", this.obtieneMensajeErrorException(e));\n\t\t}\n\t}", "public void guardarDatos() throws Exception {\n\t\ttry {\n\t\t\tFormularioUtil.setUpperCase(groupboxEditar);\n\t\t\tif (validarForm()) {\n\t\t\t\t// Cargamos los componentes //\n\n\t\t\t\tHisc_urgencia_odontologico hisc_urgencia_odontologico = getBean();\n\n\t\t\t\tMap<String, Object> datos = new HashMap<String, Object>();\n\t\t\t\tdatos.put(\"hisc_urgencia_odontologico\",\n\t\t\t\t\t\thisc_urgencia_odontologico);\n\t\t\t\t// datos.put(\"sigvitales\", mcSignosVitales.obtenerSigvitales());\n\t\t\t\tdatos.put(\"accion\", tbxAccion.getValue());\n\t\t\t\tdatos.put(\"admision\", admision);\n\t\t\t\tdatos.put(\"datos_procedimiento\", getProcedimientos());\n\n\t\t\t\tImpresion_diagnostica impresion_diagnostica = macroImpresion_diagnostica\n\t\t\t\t\t\t.obtenerImpresionDiagnostica();\n\t\t\t\tdatos.put(\"impresion_diagnostica\", impresion_diagnostica);\n\n\t\t\t\tgetServiceLocator().getHisc_urgencia_odontologicoService()\n\t\t\t\t\t\t.guardarDatos(datos);\n\n\t\t\t\ttbxAccion.setValue(\"modificar\");\n\t\t\t\tinfoPacientes.setCodigo_historia(hisc_urgencia_odontologico\n\t\t\t\t\t\t.getCodigo_historia());\n\n\t\t\t\tactualizarRemision(admision, getInformacionClinica(), this);\n\t\t\t\tcargarServicios();\n\n\t\t\t\tMensajesUtil.mensajeInformacion(\"Informacion ..\",\n\t\t\t\t\t\t\"Los datos se guardaron satisfactoriamente\");\n\t\t\t}\n\n\t\t} catch (ImpresionDiagnosticaException e) {\n\t\t\tlog.error(e.getMessage(), e);\n\t\t} catch (Exception e) {\n\t\t\tif (!(e instanceof WrongValueException)) {\n\t\t\t\tMensajesUtil.mensajeError(e, \"\", this);\n\t\t\t}\n\t\t}\n\t}", "@RequestMapping(method = RequestMethod.POST, value = \"/gdaAltaProyecto.do\")\n public String gdaAltaProyecto(@Valid Proyectos proyecto, BindingResult result, Model model, String nActividades, String nPerfiles, String cadenaActividades, String selectto, String codigo_postal, String otra_colonia, String existeCP, String estado, String municipio, String ciudad, HttpSession session, HttpServletRequest request)\n {\n if (new ValidaSesion().validaOrganizacion(session, request))\n {\n System.out.println(\"hola gda alta organizacion\");\n\n //Validaciones\n System.out.println(\"Validar\");\n new ValidacionesOrganizaciones().valAltaAdminProy(proyecto, result, model, codigo_postal, existeCP, otra_colonia);\n\n //Desglose de Actividades\n ActividadesModel actividadesModel = new ActividadesModel(cadenaActividades);\n\n //Valida Actividades\n if (!actividadesModel.validarInsercionActividades().isSuccess())\n {\n result.addError(new ObjectError(\"actividades\", actividadesModel.validarInsercionActividades().getMensaje()));\n }\n model.addAttribute(\"validacion_actividades\", actividadesModel.validarInsercionActividades().getMensaje());\n\n if (result.hasErrors())\n {\n System.out.print(\"hubo errores\");\n System.out.println(proyecto.toString());\n System.out.println(\"Error:\" + result.toString());\n\n //Estados\n LinkedHashMap<String, String> ordenamiento = new LinkedHashMap<String, String>();\n ordenamiento.put(\"nombre\", \"asc\");\n model.addAttribute(\"estados\", daoEstadosSia.findAll(ordenamiento));\n //TipoProyecto\n model.addAttribute(\"tipoProyecto\", daoTipoProyecto.findBySpecificField(\"status\", \"1\", \"equal\", null, null));\n //Perfil\n model.addAttribute(\"perfiles\", daoPerfil.findBySpecificField(\"estatus\", \"1\", \"equal\", null, null));\n //Programa\n model.addAttribute(\"programas\", daoPrograma.findBySpecificField(\"status\", \"1\", \"equal\", null, null));\n //Regresar codigo postal\n model.addAttribute(\"cp\", codigo_postal);\n try\n {\n model.addAttribute(\"idColonia\", proyecto.getIdColonia().getIdColonia());\n } catch (Exception e)\n {\n }\n //Regresar codigo postal\n model.addAttribute(\"otra_colonia\", otra_colonia);\n\n //Regresa las Organizaciones\n List<Instancia> listaInstancias = daoInstancia.findBySpecificField(\"validacionAdmin\", \"1\", \"equal\", null, null);\n ArrayList<Instancia> filtroInstancias = new ArrayList<Instancia>();\n\n for (int i = 0; i < listaInstancias.size(); i++)\n {\n// int estatus = Integer.parseInt(listaInstancias.get(i).getEstatus().toString());//.....................................................................................................Corrección Status conversión .............................................................................................\n int estatus = (int) listaInstancias.get(i).getStatus();\n if (estatus == 1 || estatus == 2)\n {\n filtroInstancias.add(listaInstancias.get(i));\n }\n }\n model.addAttribute(\"instancias\", filtroInstancias);\n\n //Regresar actividades\n model.addAttribute(\"nActividades\", nActividades.substring(0, 1));\n System.out.println(\"nActividades:\" + nActividades.substring(0, 1));\n\n for (int i = 0; i < actividadesModel.actividades.size(); i++)\n {\n model.addAttribute(\"actividad\" + i, actividadesModel.actividades.get(i));\n System.out.println(\"Regresando Actividad:\" + actividadesModel.actividades.get(i));\n }\n model.addAttribute(\"proyecto\", proyecto);\n\n return \"/Organizaciones/altaProyecto\";\n } else\n {\n\n System.out.print(\"no hubo errores\");\n\n //Checa codigo postal\n CodigosPostalesModel codigosPostales = new CodigosPostalesModel(daoColonia, daoCodigosPostales, daoEstadosSia,\n daoMunicipiosSia, daoCiudades, daoTipoLocalidad);\n if (existeCP.equals(\"true\"))\n {\n if (proyecto.getIdColonia().getIdColonia().toString().equals(\"0\"))\n {\n //Agregar colonia \n proyecto.setIdColonia(codigosPostales.agregaColonia(codigo_postal, otra_colonia));\n }\n } else\n {\n //Agregar codigo postal + colonia\n proyecto.setIdColonia(codigosPostales.agregarCodigoPostal(codigo_postal, otra_colonia, estado, municipio, ciudad));\n }\n\n proyecto.setValidacionAdmin(BigInteger.ZERO);\n proyecto.setEstatus(BigInteger.ONE);\n proyecto.setFechaAlta(new Date());\n proyecto.setVacantesDisponibles(proyecto.getVacantes());\n System.out.println(\"idInstancia:\" + proyecto.getIdInstancia().getIdInstancia());\n //Convertir a mayuscular\n proyecto.setDomicilio(limpiar.tuneaStringParaBD(proyecto.getDomicilio()));\n proyecto.setNombre(limpiar.tuneaStringParaBD(proyecto.getNombre()));\n proyecto.setNombreResponsable(limpiar.tuneaStringParaBD(proyecto.getNombreResponsable()));\n proyecto.setResponsablePuesto(limpiar.tuneaStringParaBD(proyecto.getResponsablePuesto()));\n //Imprimir todo\n System.out.println(\"Datos del alumno\");\n System.out.println(\"Nombre:\" + proyecto.getNombre() + \" len:\" + proyecto.getNombre().length());\n System.out.println(\"Vacantes:\" + proyecto.getVacantes() + \" len:\" + proyecto.getVacantes().toString().length());\n System.out.println(\"Vacantes disponibles:\" + proyecto.getVacantesDisponibles() + \" len:\" + proyecto.getVacantesDisponibles().toString().length());\n System.out.println(\"Responsable puesto:\" + proyecto.getResponsablePuesto() + \" len:\" + proyecto.getResponsablePuesto().length());\n System.out.println(\"Nombre Responsable:\" + proyecto.getNombreResponsable() + \" len:\" + proyecto.getNombreResponsable().length());\n System.out.println(\"Telefono responsable:\" + proyecto.getTelefonoResponsable() + \" len:\" + (proyecto.getTelefonoResponsable() + \"\").length());\n System.out.println(\"Domicilio:\" + proyecto.getDomicilio() + \" len:\" + proyecto.getDomicilio().length());\n System.out.println(\"Id colonia:\" + proyecto.getIdColonia().getIdColonia() + \" len:\" + proyecto.getIdColonia().getIdColonia().toString().length());\n System.out.println(\"Id tipo proyecto:\" + proyecto.getIdTipoProyecto().getIdTipoProyecto() + \" len:\" + proyecto.getIdTipoProyecto().getIdTipoProyecto().toString().length());\n System.out.println(\"Id programa:\" + proyecto.getIdPrograma().getIdPrograma() + \" len:\" + proyecto.getIdPrograma().getIdPrograma().toString().length());\n System.out.println(\"Modalidad:\" + proyecto.getModalidad() + \" len:\" + proyecto.getModalidad().length());\n System.out.println(\"fin\");\n //\n daoProyectos.create(proyecto);\n System.out.println(\"Insercion correcta!\");\n\n //Obtenemos el proyecto creado\n LinkedHashMap<String, String> ordenamiento = new LinkedHashMap<String, String>();\n ordenamiento.put(\"idProyecto\", \"desc\");\n Proyectos newProyecto = (Proyectos) daoProyectos.findAll(ordenamiento).get(0);\n\n //Insercion de Actividades\n for (int i = 0; i < actividadesModel.actividades.size(); i++)\n {\n Actividades actividad = new Actividades();\n actividad.setDetalle(limpiar.tuneaStringParaBD(actividadesModel.actividades.get(i)));\n actividad.setEstatus(BigInteger.ONE);\n actividad.setIdProyecto(newProyecto);\n daoActividades.create(actividad);\n System.out.println(\"Se inserto la actividad: \" + actividad.getDetalle() + \" en el proyecto: \" + actividad.getIdProyecto().getNombre());\n }\n //Insercion de Perfiles\n //ProyectoPerfilModel proyectoPerfilModel;\n if (selectto != null)\n {\n //proyectoPerfilModel = new ProyectoPerfilModel(selectto); \n //Analisis de la cadena\n StringTokenizer token = new StringTokenizer(selectto, \",\");\n ArrayList<Perfil> perfiles = new ArrayList<Perfil>();\n\n System.out.println(\"Analizar cadena:\" + selectto);\n System.out.println(\"No de tokens:\" + token.countTokens());\n while (token.hasMoreTokens())\n {\n String perfil = token.nextToken();\n System.out.println(\"Token:\" + perfil);\n if (perfil != null && !perfil.equals(\"\"))\n {\n perfiles.add((Perfil) daoPerfil.find(BigDecimal.valueOf(Double.parseDouble(perfil))));\n }\n }\n for (int i = 0; i < perfiles.size(); i++)\n {\n ProyectoPerfil proyectoPerfil = new ProyectoPerfil();\n proyectoPerfil.setIdPerfil(perfiles.get(i));\n proyectoPerfil.setIdProyecto(newProyecto);\n daoProyectoPerfil.create(proyectoPerfil);\n System.out.println(\"Perfil insertado: \" + proyectoPerfil.getIdPerfil().getNombre() + \" En proyecto :\" + proyectoPerfil.getIdProyecto().getNombre());\n }\n } else\n {\n System.out.println(\"No se agregaran perfiles\");\n }\n\n return \"/Organizaciones/confirmaAltaProyectos\";\n }\n } else\n {\n model.addAttribute(\"error\", \"<div class='alert alert-danger'>Debes iniciar sesió para acceder a esta sección.</div>\");\n return \"redirect:login.do\";\n }\n\n }", "@Override\n protected void doPost(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n // processRequest(request, response);\n \n \n \n //SIMUMLANDO VALORES\n String ejercicio3=\"Enviar\";\n String ejercicio4=\"Ingresar\";\n String ejercicio5=\"Ir\";\n String ejercicio8=\"Cookies\";\n \n \n \n String pUsuario=request.getParameter(\"usuario\");\n String pPassword=request.getParameter(\"password\");\n \n String envio3=request.getParameter(\"envio3\"); //Capturo el valor del input envio3\n \n String envio4=request.getParameter(\"envio4\");\n \n String envio5=request.getParameter(\"envio5\");\n \n String envio8=request.getParameter(\"envio8\");\n \n \n \n \n //EJERCICIO 3\n //Si ejercicio3 recive el valor de envio3(enviar))\n if(ejercicio3.equals(envio3))\n {\n PrintWriter out=response.getWriter(); \n \n \n \n out.println(\"<html>\\n\" +\n\" <head>\\n\" +\n\" <link rel=\\\"stylesheet\\\" href=\\\"https://maxcdn.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css\\\">\\n\" +\n\" <link href=\\\"https://fonts.googleapis.com/css?family=Alegreya|Chilanka|Dancing+Script|Kalam|Pacifico|Satisfy&display=swap\\\" rel=\\\"stylesheet\\\">\\n\" +\n\" <script src=\\\"https://ajax.googleapis.com/ajax/libs/jquery/3.4.1/jquery.min.js\\\"></script>\\n\" +\n\"<script src=\\\"https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.14.7/umd/popper.min.js\\\"></script> \\n\" +\n\"<script src=\\\"https://maxcdn.bootstrapcdn.com/bootstrap/4.3.1/js/bootstrap.min.js\\\"></script>\\n\" +\n\"<style>/* Make the image fully responsive */\\n\" +\n\".carousel-inner img {\\n\" +\n\"width: 100%;\\n\" +\n\"height: 100%; \\n\" +\n\"}\\n\" +\n\"</style>\\n\" +\n\"\\n\" +\n\"<title>Ejercicio 3</title>\\n\" +\n\"\\n\" +\n\"<!-- Custom fonts for this theme -->\\n\" +\n\"<link href=\\\"vendor/fontawesome-free/css/all.min.css\\\" rel=\\\"stylesheet\\\" type=\\\"text/css\\\">\\n\" +\n\"<link href=\\\"https://fonts.googleapis.com/css?family=Montserrat:400,700\\\" rel=\\\"stylesheet\\\" type=\\\"text/css\\\">\\n\" +\n\"<link href=\\\"https://fonts.googleapis.com/css?family=Lato:400,700,400italic,700italic\\\" rel=\\\"stylesheet\\\" type=\\\"text/css\\\">\\n\" +\n\"\\n\" +\n\"<!-- Theme CSS -->\\n\" +\n\"<link href=\\\"css/freelancer.css\\\" rel=\\\"stylesheet\\\">\\n\" +\n\"<link href=\\\"css/estilo-indexp.css\\\" rel=\\\"stylesheet\\\">\\n\" +\n\"\\n\" +\n\"<!--Tabla de bootstrap-->\\n\" +\n\"\\n\" +\n\"<script src=\\\"https://ajax.googleapis.com/ajax/libs/jquery/3.4.1/jquery.min.js\\\"></script>\\n\" +\n\"<script src=\\\"https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.14.7/umd/popper.min.js\\\"></script>\\n\" +\n\"<script src=\\\"https://maxcdn.bootstrapcdn.com/bootstrap/4.3.1/js/bootstrap.min.js\\\"></script>\\n\" +\n\"\\n\" +\n\"<link href=\\\"https://fonts.googleapis.com/css?family=Nunito+Sans&display=swap\\\" rel=\\\"stylesheet\\\">\\n\" +\n\"<link href=\\\"https://fonts.googleapis.com/css?family=Chilanka|Nanum+Gothic:400,700|Source+Sans+Pro&display=swap\\\" rel=\\\"stylesheet\\\">\\n\" +\n\"\\n\" +\n\"<!--Estilos del formulario 3-->\\n\" +\n\"<link rel=\\\"stylesheet\\\" type=\\\"text/css\\\" href=\\\"css/estilos.css\\\">\\n\" +\n\"\\n\" +\n\"<!--Estilos ejercicio 4-->\\n\" +\n\" <script type=\\\"text/javascript\\\" src=\\\"css/funcioness.js\\\"></script>\\n\" +\n\" <!--Bootstrap formulario-->\\n\" +\n\"\\n\" +\n\"\\n\" +\n\"\\n\" +\n\"</head>\\n\" +\n\" \\n\" +\n\"\\n\" +\n\"<body id=\\\"page-top\\\">\\n\" +\n\" <!-- NavBar -->\\n\" +\n\"<nav class=\\\"navbar navbar-expand-lg bg-secondary text-uppercase fixed-top\\\" id=\\\"mainNav\\\">\\n\" +\n\"<div class=\\\"container\\\">\\n\" +\n\"\\n\" +\n\" \\n\" +\n\" <form method=\\\"post\\\" action=\\\"servletParametros1\\\" >\\n\" +\n\" <a class=\\\"navbar-brand js-scroll-trigger\\\" >Bienvenido SINAHI</a>\\n\" +\n \" <center>\\n\" +\n\" <button name=\\\"inicio\\\" value=\\\"inicio\\\" class=\\\"boton_inicio\\\">inicio</button>\\n\" +\n\" </center>\"+\n\" </form>\\n\" +\n\"\\n\" +\n\"\\n\" +\n\"<button class=\\\"navbar-toggler navbar-toggler-right text-uppercase font-weight-bold bg-primary text-white rounded\\\" type=\\\"button\\\" data-toggle=\\\"collapse\\\" data-target=\\\"#navbarResponsive\\\" aria-controls=\\\"navbarResponsive\\\" aria-expanded=\\\"false\\\" aria-label=\\\"Toggle navigation\\\">\\n\" +\n\"\\n\" +\n\" <i class=\\\"fas fa-bars\\\"></i>\\n\" +\n\" </button>\\n\" +\n\" <div class=\\\"collapse navbar-collapse\\\" id=\\\"navbarResponsive\\\">\\n\" +\n\" <ul class=\\\"navbar-nav ml-auto\\\">\\n\" +\n\" <li class=\\\"nav-item mx-0 mx-lg-1\\\">\\n\" +\n\" <a class=\\\"nav-link py-3 px-0 px-lg-3 rounded js-scroll-trigger\\\" href=\\\"administracion.html\\\">Administracion</a>\\n\" +\n\" </li>\\n\" +\n\" <li class=\\\"nav-item mx-0 mx-lg-1\\\">\\n\" +\n\" <a class=\\\"nav-link py-3 px-0 px-lg-3 rounded js-scroll-trigger\\\" href=\\\"#about\\\">Reglas de manejo</a>\\n\" +\n\" </li>\\n\" +\n\" <li class=\\\"nav-item mx-0 mx-lg-1\\\">\\n\" +\n\" <a class=\\\"nav-link py-3 px-0 px-lg-3 rounded js-scroll-trigger\\\" href=\\\"#contact\\\">Pruebas de manejo</a>\\n\" +\n\" </li>\\n\" +\n\" </ul>\\n\" +\n\" </div>\\n\" +\n\"</div>\\n\" +\n\"</nav>\\n\" +\n\"</div>\\n\" +\n\"</div> <br>\\n\" +\n\"<br>\\n\" +\n\"<br><br>\\n\" +\n\"<br>\\n\" +\n\"<br>\\n\");\n \n out.println(\"<center>EJERCICIO 3 - MANEJO DE PARAMETROS <br><br>\");\n out.println(\"El parametro de usuario es: \"+pUsuario+\"<br>\");\n out.println(\"El parametro de password es: \"+pPassword+\"</center>\");\n \n \n \n out.close();\n \n }\n \n else\n {\n \n //EJERCICIO 4\n if(ejercicio4.equals(envio4)) \n {\n response.setContentType(\"text/html;charset=UTF-8\");\n try (PrintWriter out = response.getWriter()) {\n String usuario=request.getParameter(\"usuario\");\n String password=request.getParameter(\"password\");\n String[] tecnologias=request.getParameterValues(\"tecnologias\");\n String tec= Arrays.toString(tecnologias);\n String genero=request.getParameter(\"genero\");\n String ocupacion=request.getParameter(\"ocupacion\");\n String musica=request.getParameter(\"musica\");\n String comentarios=request.getParameter(\"comentarios\");\n \n \n \n out.println(\"<html>\\n\" +\n\" <head>\\n\" +\n\" <link rel=\\\"stylesheet\\\" href=\\\"https://maxcdn.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css\\\">\\n\" +\n\" <link href=\\\"https://fonts.googleapis.com/css?family=Alegreya|Chilanka|Dancing+Script|Kalam|Pacifico|Satisfy&display=swap\\\" rel=\\\"stylesheet\\\">\\n\" +\n\" <script src=\\\"https://ajax.googleapis.com/ajax/libs/jquery/3.4.1/jquery.min.js\\\"></script>\\n\" +\n\"<script src=\\\"https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.14.7/umd/popper.min.js\\\"></script> \\n\" +\n\"<script src=\\\"https://maxcdn.bootstrapcdn.com/bootstrap/4.3.1/js/bootstrap.min.js\\\"></script>\\n\" +\n\"<style>/* Make the image fully responsive */\\n\" +\n\".carousel-inner img {\\n\" +\n\"width: 100%;\\n\" +\n\"height: 100%; \\n\" +\n\"}\\n\" +\n\"</style>\\n\" +\n\"\\n\" +\n\"<title>Ejercicio 4</title>\\n\" +\n\"\\n\" +\n\"<!-- Custom fonts for this theme -->\\n\" +\n\"<link href=\\\"vendor/fontawesome-free/css/all.min.css\\\" rel=\\\"stylesheet\\\" type=\\\"text/css\\\">\\n\" +\n\"<link href=\\\"https://fonts.googleapis.com/css?family=Montserrat:400,700\\\" rel=\\\"stylesheet\\\" type=\\\"text/css\\\">\\n\" +\n\"<link href=\\\"https://fonts.googleapis.com/css?family=Lato:400,700,400italic,700italic\\\" rel=\\\"stylesheet\\\" type=\\\"text/css\\\">\\n\" +\n\"\\n\" +\n\"<!-- Theme CSS -->\\n\" +\n\"<link href=\\\"css/freelancer.css\\\" rel=\\\"stylesheet\\\">\\n\" +\n\"<link href=\\\"css/estilo-indexp.css\\\" rel=\\\"stylesheet\\\">\\n\" +\n\"\\n\" +\n\"<!--Tabla de bootstrap-->\\n\" +\n\"\\n\" +\n\"<script src=\\\"https://ajax.googleapis.com/ajax/libs/jquery/3.4.1/jquery.min.js\\\"></script>\\n\" +\n\"<script src=\\\"https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.14.7/umd/popper.min.js\\\"></script>\\n\" +\n\"<script src=\\\"https://maxcdn.bootstrapcdn.com/bootstrap/4.3.1/js/bootstrap.min.js\\\"></script>\\n\" +\n\"\\n\" +\n\"<link href=\\\"https://fonts.googleapis.com/css?family=Nunito+Sans&display=swap\\\" rel=\\\"stylesheet\\\">\\n\" +\n\"<link href=\\\"https://fonts.googleapis.com/css?family=Chilanka|Nanum+Gothic:400,700|Source+Sans+Pro&display=swap\\\" rel=\\\"stylesheet\\\">\\n\" +\n\"\\n\" +\n\"<!--Estilos del formulario 3-->\\n\" +\n\"<link rel=\\\"stylesheet\\\" type=\\\"text/css\\\" href=\\\"css/estilos.css\\\">\\n\" +\n\"\\n\" +\n\"<!--Estilos ejercicio 4-->\\n\" +\n\" <script type=\\\"text/javascript\\\" src=\\\"css/funcioness.js\\\"></script>\\n\" +\n\" <!--Bootstrap formulario-->\\n\" +\n\"\\n\" +\n\"\\n\" +\n\"\\n\" +\n\"</head>\\n\" +\n\" \\n\" +\n\"\\n\" +\n\"<body id=\\\"page-top\\\">\\n\" +\n\" <!-- NavBar -->\\n\" +\n\"<nav class=\\\"navbar navbar-expand-lg bg-secondary text-uppercase fixed-top\\\" id=\\\"mainNav\\\">\\n\" +\n\"<div class=\\\"container\\\">\\n\" +\n\"\\n\" +\n\" \\n\" +\n\" <form method=\\\"post\\\" action=\\\"servletParametros1\\\" >\\n\" +\n\" <a class=\\\"navbar-brand js-scroll-trigger\\\" >Bienvenido SINAHI</a>\\n\" +\n \" <center>\\n\" +\n\" <button name=\\\"inicio\\\" value=\\\"inicio\\\" class=\\\"boton_inicio\\\">inicio</button>\\n\" +\n\" </center>\"+\n\" </form>\\n\" +\n\"\\n\" +\n\"\\n\" +\n\"<button class=\\\"navbar-toggler navbar-toggler-right text-uppercase font-weight-bold bg-primary text-white rounded\\\" type=\\\"button\\\" data-toggle=\\\"collapse\\\" data-target=\\\"#navbarResponsive\\\" aria-controls=\\\"navbarResponsive\\\" aria-expanded=\\\"false\\\" aria-label=\\\"Toggle navigation\\\">\\n\" +\n\"\\n\" +\n\" <i class=\\\"fas fa-bars\\\"></i>\\n\" +\n\" </button>\\n\" +\n\" <div class=\\\"collapse navbar-collapse\\\" id=\\\"navbarResponsive\\\">\\n\" +\n\" <ul class=\\\"navbar-nav ml-auto\\\">\\n\" +\n\" <li class=\\\"nav-item mx-0 mx-lg-1\\\">\\n\" +\n\" <a class=\\\"nav-link py-3 px-0 px-lg-3 rounded js-scroll-trigger\\\" href=\\\"administracion.html\\\">Administracion</a>\\n\" +\n\" </li>\\n\" +\n\" <li class=\\\"nav-item mx-0 mx-lg-1\\\">\\n\" +\n\" <a class=\\\"nav-link py-3 px-0 px-lg-3 rounded js-scroll-trigger\\\" href=\\\"#about\\\">Reglas de manejo</a>\\n\" +\n\" </li>\\n\" +\n\" <li class=\\\"nav-item mx-0 mx-lg-1\\\">\\n\" +\n\" <a class=\\\"nav-link py-3 px-0 px-lg-3 rounded js-scroll-trigger\\\" href=\\\"#contact\\\">Pruebas de manejo</a>\\n\" +\n\" </li>\\n\" +\n\" </ul>\\n\" +\n\" </div>\\n\" +\n\"</div>\\n\" +\n\"</nav>\\n\" +\n\"</div>\\n\" +\n\"</div> <br>\\n\" +\n\"<br>\\n\" +\n\"<br><br>\\n\" +\n\"<br>\\n\" +\n\"<br>\\n\");\n\n //TABLA GENERADA CON LOS PARAMETROS \n \n out.println(\" <style>\"+ \n \".parrafo\\n\" +\n\"{\\n\" +\n\" font-size: 25px;\\n\" +\n\" font-family: 'Nunito Sans', sans-serif;\\n\" +\n\" color: #9066BA;\\n\" +\n\" \\n\" +\n\"}\"+\n \n \".tabla\\n\" +\n\"{\\n\" +\n\" width: 500px;\\n\" +\n\" height: 250px;\\n\" +\n\"}\"+\n\"</style>\");\n \n \n out.println(\"\"+\n \n \"<center>\"\n + \"<p class=\\\"parrafo\\\"> EJERCICIO 4 - MANEJO DE FORMULARIO HTML </p>\"+\n \"</center>\");\n \n out.println(\"<div class=\\\"container\\\">\");\n out.println(\"<table border=3px align=center class=\\\"tabla\\\"> <tr class=\\\"table-info\\\">\");\n out.println( \"<td class=azul>Usuario(*) </td>\");\n out.println(\"<td>\" +usuario +\"</td></tr>\");\n \n out.println(\"<tr class=\\\"table-warning\\\"> <td class=azul>Password(*) </td>\");\n out.println(\"<td>\" +password +\"</td></tr>\");\n \n out.println(\"<tr class=\\\"table-info\\\"><td class=azul>Tecnologia(*) </td>\");\n out.println(\"<td>\" +tec+\"</td></tr>\");\n \n out.println(\"<tr class=\\\"table-warning\\\"><td class=azul>Genero(*) </td>\");\n out.println(\"<td>\" +genero +\"</td></tr>\");\n \n out.println(\"<tr class=\\\"table-info\\\"><td class=azul>Ocupacion(*) </td>\");\n out.println(\"<td>\" +ocupacion +\"</td></tr>\");\n \n out.println(\"<tr class=\\\"table-warning\\\"><td class=azul>Musica </td>\");\n out.println(\"<td>\" +musica +\"</td></tr>\");\n \n out.println(\"<tr class=\\\"table-info\\\"><td class=azul>Los comentarios son</td>\");\n out.println(\"<td>\" +comentarios +\"</td></tr>\");\n \n out.println(\"</div>\");\n \n out.println(\"</body>\");\n out.println(\"</html>\"); \n }\n }\n else\n {\n if(ejercicio5.equals(envio5))\n {\n response.setContentType(\"text/html;charset=UTF-8\");\n PrintWriter out = response.getWriter();\n try {\n \n \n String metodoHTTP=request.getMethod();\n String ur=request.getRequestURI();\n \n \n out.println(\"<html>\\n\" +\n\" <head>\\n\" +\n\" <link rel=\\\"stylesheet\\\" href=\\\"https://maxcdn.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css\\\">\\n\" +\n\" <link href=\\\"https://fonts.googleapis.com/css?family=Alegreya|Chilanka|Dancing+Script|Kalam|Pacifico|Satisfy&display=swap\\\" rel=\\\"stylesheet\\\">\\n\" +\n\" <script src=\\\"https://ajax.googleapis.com/ajax/libs/jquery/3.4.1/jquery.min.js\\\"></script>\\n\" +\n\"<script src=\\\"https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.14.7/umd/popper.min.js\\\"></script> \\n\" +\n\"<script src=\\\"https://maxcdn.bootstrapcdn.com/bootstrap/4.3.1/js/bootstrap.min.js\\\"></script>\\n\" +\n\"<style>/* Make the image fully responsive */\\n\" +\n\".carousel-inner img {\\n\" +\n\"width: 100%;\\n\" +\n\"height: 100%; \\n\" +\n\"}\\n\" +\n\"</style>\\n\" +\n\"\\n\" +\n\"<title>Jercicio 5</title>\\n\" +\n\"\\n\" +\n\"<!-- Custom fonts for this theme -->\\n\" +\n\"<link href=\\\"vendor/fontawesome-free/css/all.min.css\\\" rel=\\\"stylesheet\\\" type=\\\"text/css\\\">\\n\" +\n\"<link href=\\\"https://fonts.googleapis.com/css?family=Montserrat:400,700\\\" rel=\\\"stylesheet\\\" type=\\\"text/css\\\">\\n\" +\n\"<link href=\\\"https://fonts.googleapis.com/css?family=Lato:400,700,400italic,700italic\\\" rel=\\\"stylesheet\\\" type=\\\"text/css\\\">\\n\" +\n\"\\n\" +\n\"<!-- Theme CSS -->\\n\" +\n\"<link href=\\\"css/freelancer.css\\\" rel=\\\"stylesheet\\\">\\n\" +\n\"<link href=\\\"css/estilo-indexp.css\\\" rel=\\\"stylesheet\\\">\\n\" +\n\"\\n\" +\n\"<!--Tabla de bootstrap-->\\n\" +\n\"\\n\" +\n\"<script src=\\\"https://ajax.googleapis.com/ajax/libs/jquery/3.4.1/jquery.min.js\\\"></script>\\n\" +\n\"<script src=\\\"https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.14.7/umd/popper.min.js\\\"></script>\\n\" +\n\"<script src=\\\"https://maxcdn.bootstrapcdn.com/bootstrap/4.3.1/js/bootstrap.min.js\\\"></script>\\n\" +\n\"\\n\" +\n\"<link href=\\\"https://fonts.googleapis.com/css?family=Nunito+Sans&display=swap\\\" rel=\\\"stylesheet\\\">\\n\" +\n\"<link href=\\\"https://fonts.googleapis.com/css?family=Chilanka|Nanum+Gothic:400,700|Source+Sans+Pro&display=swap\\\" rel=\\\"stylesheet\\\">\\n\" +\n\"\\n\" +\n\"<!--Estilos del formulario 3-->\\n\" +\n\"<link rel=\\\"stylesheet\\\" type=\\\"text/css\\\" href=\\\"css/estilos.css\\\">\\n\" +\n\"\\n\" +\n\"<!--Estilos ejercicio 4-->\\n\" +\n\" <script type=\\\"text/javascript\\\" src=\\\"css/funcioness.js\\\"></script>\\n\" +\n\" <!--Bootstrap formulario-->\\n\" +\n\"\\n\" +\n\"\\n\" +\n\"\\n\" +\n\"</head>\\n\" +\n\" \\n\" +\n\"\\n\" +\n\"<body id=\\\"page-top\\\">\\n\" +\n\" <!-- NavBar -->\\n\" +\n\"<nav class=\\\"navbar navbar-expand-lg bg-secondary text-uppercase fixed-top\\\" id=\\\"mainNav\\\">\\n\" +\n\"<div class=\\\"container\\\">\\n\" +\n\"\\n\" +\n\" \\n\" +\n\" <form method=\\\"post\\\" action=\\\"servletParametros1\\\" >\\n\" +\n\" <a class=\\\"navbar-brand js-scroll-trigger\\\" >Bienvenido SINAHI</a>\\n\" +\n \" <center>\\n\" +\n\" <button name=\\\"inicio\\\" value=\\\"inicio\\\" class=\\\"boton_inicio\\\">inicio</button>\\n\" +\n\" </center>\"+ \n\" </form>\\n\" +\n\"\\n\" +\n\"\\n\" +\n\"<button class=\\\"navbar-toggler navbar-toggler-right text-uppercase font-weight-bold bg-primary text-white rounded\\\" type=\\\"button\\\" data-toggle=\\\"collapse\\\" data-target=\\\"#navbarResponsive\\\" aria-controls=\\\"navbarResponsive\\\" aria-expanded=\\\"false\\\" aria-label=\\\"Toggle navigation\\\">\\n\" +\n\"\\n\" +\n\" <i class=\\\"fas fa-bars\\\"></i>\\n\" +\n\" </button>\\n\" +\n\" <div class=\\\"collapse navbar-collapse\\\" id=\\\"navbarResponsive\\\">\\n\" +\n\" <ul class=\\\"navbar-nav ml-auto\\\">\\n\" +\n\" <li class=\\\"nav-item mx-0 mx-lg-1\\\">\\n\" +\n\" <a class=\\\"nav-link py-3 px-0 px-lg-3 rounded js-scroll-trigger\\\" href=\\\"administracion.html\\\">Administracion</a>\\n\" +\n\" </li>\\n\" +\n\" <li class=\\\"nav-item mx-0 mx-lg-1\\\">\\n\" +\n\" <a class=\\\"nav-link py-3 px-0 px-lg-3 rounded js-scroll-trigger\\\" href=\\\"#about\\\">Reglas de manejo</a>\\n\" +\n\" </li>\\n\" +\n\" <li class=\\\"nav-item mx-0 mx-lg-1\\\">\\n\" +\n\" <a class=\\\"nav-link py-3 px-0 px-lg-3 rounded js-scroll-trigger\\\" href=\\\"#contact\\\">Pruebas de manejo</a>\\n\" +\n\" </li>\\n\" +\n\" </ul>\\n\" +\n\" </div>\\n\" +\n\"</div>\\n\" +\n\"</nav>\\n\" +\n\"</div>\\n\" +\n\"</div> <br>\\n\" +\n\"<br>\\n\" +\n\"<br><br>\\n\" +\n\"<br>\\n\" +\n\"<br>\\n\"); \n \n //METODOSSS\n out.println(\"<h1>Metodos de HTTP </h1>\");\n out.println(\"Metodo HTTP:\"+metodoHTTP);\n out.print(\"<br>\");\n out.print(\"Uri solicitado\"+ur);\n out.print(\"<br>\");\n out.print(\"<br>\");\n out.println(\"</body>\");\n out.println(\"</html>\"); \n \n Enumeration cabeceros=request.getHeaderNames();\n while(cabeceros.hasMoreElements())\n {\n String nombreCabecero=(String)cabeceros.nextElement();\n out.println(\"<b>\"+nombreCabecero+\"</b>\");\n out.println(request.getHeader(nombreCabecero));\n out.print(\"<br>\");\n \n \n } //fin While \n \n \n \n \n } //fin try E5\n \n finally\n {\n out.close();\n } //fin finally \n \n } //fin If E5\n \n \n \n \n //MANEJO DE COOKIES\n \n else\n {\n if(ejercicio8.equals(envio8))\n {\n //Suponemos que el usuario esta visitando por primera vez nuestros sitio\n boolean nuevoUsuario =true;\n \n //obtenemos todas las cookies\n Cookie[] cookies=request.getCookies();\n \n //Buscamos si ya existe una coockie creada con anterioridad\n //llamada visitanteRecurrente\n \n if(cookies != null)\n {\n for(Cookie c : cookies)\n {\n if(c.getName().equals(\"visitanteRecurrente\") && c.getValue().equals(\"si\"))\n {\n //En caso de que ya exista una cookie indicando \n //que ya existe un usuario registrado con anterioridad\n //ponemos la bandera en falso y salimos del ciclo \n nuevoUsuario=false;\n break;\n }\n }\n }\n \n String mensaje=null;\n if(nuevoUsuario)\n {\n //En caso de ser un usuario nuevo creamos el objeto Cookie\n Cookie visitanteCookie=new Cookie(\"visitanteRecurrente\", \"si\");\n //Agregamos la cookie en la respuesta\n response.addCookie(visitanteCookie);\n mensaje=\"Gracias por visitar nuestro sitio\";\n }\n else\n {\n mensaje=\"Gracias por visitar NUEVAMENTE nuestro sitio\";\n }\n \n //Escribimos la salida\n response.setContentType(\"text/html\");\n PrintWriter out = response.getWriter();\n \n \n out.println(\"<html>\\n\" +\n\" <head>\\n\" +\n\" <link rel=\\\"stylesheet\\\" href=\\\"https://maxcdn.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css\\\">\\n\" +\n\" <link href=\\\"https://fonts.googleapis.com/css?family=Alegreya|Chilanka|Dancing+Script|Kalam|Pacifico|Satisfy&display=swap\\\" rel=\\\"stylesheet\\\">\\n\" +\n\" <script src=\\\"https://ajax.googleapis.com/ajax/libs/jquery/3.4.1/jquery.min.js\\\"></script>\\n\" +\n\"<script src=\\\"https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.14.7/umd/popper.min.js\\\"></script> \\n\" +\n\"<script src=\\\"https://maxcdn.bootstrapcdn.com/bootstrap/4.3.1/js/bootstrap.min.js\\\"></script>\\n\" +\n\"<style>/* Make the image fully responsive */\\n\" +\n\".carousel-inner img {\\n\" +\n\"width: 100%;\\n\" +\n\"height: 100%; \\n\" +\n\"}\\n\" +\n\"</style>\\n\" +\n\"\\n\" +\n\"<title>Grecia</title>\\n\" +\n\"\\n\" +\n\"<!-- Custom fonts for this theme -->\\n\" +\n\"<link href=\\\"vendor/fontawesome-free/css/all.min.css\\\" rel=\\\"stylesheet\\\" type=\\\"text/css\\\">\\n\" +\n\"<link href=\\\"https://fonts.googleapis.com/css?family=Montserrat:400,700\\\" rel=\\\"stylesheet\\\" type=\\\"text/css\\\">\\n\" +\n\"<link href=\\\"https://fonts.googleapis.com/css?family=Lato:400,700,400italic,700italic\\\" rel=\\\"stylesheet\\\" type=\\\"text/css\\\">\\n\" +\n\"\\n\" +\n\"<!-- Theme CSS -->\\n\" +\n\"<link href=\\\"css/freelancer.css\\\" rel=\\\"stylesheet\\\">\\n\" +\n\"<link href=\\\"css/estilo-indexp.css\\\" rel=\\\"stylesheet\\\">\\n\" +\n\"\\n\" +\n\"<!--Tabla de bootstrap-->\\n\" +\n\"\\n\" +\n\"<script src=\\\"https://ajax.googleapis.com/ajax/libs/jquery/3.4.1/jquery.min.js\\\"></script>\\n\" +\n\"<script src=\\\"https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.14.7/umd/popper.min.js\\\"></script>\\n\" +\n\"<script src=\\\"https://maxcdn.bootstrapcdn.com/bootstrap/4.3.1/js/bootstrap.min.js\\\"></script>\\n\" +\n\"\\n\" +\n\"<link href=\\\"https://fonts.googleapis.com/css?family=Nunito+Sans&display=swap\\\" rel=\\\"stylesheet\\\">\\n\" +\n\"<link href=\\\"https://fonts.googleapis.com/css?family=Chilanka|Nanum+Gothic:400,700|Source+Sans+Pro&display=swap\\\" rel=\\\"stylesheet\\\">\\n\" +\n\"\\n\" +\n\"<!--Estilos del formulario 3-->\\n\" +\n\"<link rel=\\\"stylesheet\\\" type=\\\"text/css\\\" href=\\\"css/estilos.css\\\">\\n\" +\n\"\\n\" +\n\"<!--Estilos ejercicio 4-->\\n\" +\n\" <script type=\\\"text/javascript\\\" src=\\\"css/funcioness.js\\\"></script>\\n\" +\n\" <!--Bootstrap formulario-->\\n\" +\n\"\\n\" +\n\"\\n\" +\n\"\\n\" +\n\"</head>\\n\" +\n\" \\n\" +\n\"\\n\" +\n\"<body id=\\\"page-top\\\">\\n\" +\n\" <!-- NavBar -->\\n\" +\n\"<nav class=\\\"navbar navbar-expand-lg bg-secondary text-uppercase fixed-top\\\" id=\\\"mainNav\\\">\\n\" +\n\"<div class=\\\"container\\\">\\n\" +\n\"\\n\" +\n\" \\n\" +\n\" <form method=\\\"post\\\" action=\\\"servletParametros1\\\" >\\n\" +\n\" <a class=\\\"navbar-brand js-scroll-trigger\\\" >Bienvenido SINAHI</a>\\n\" +\n \" <center>\\n\" +\n\" <button name=\\\"inicio\\\" value=\\\"inicio\\\" class=\\\"boton_inicio\\\">inicio</button>\\n\" +\n\" </center>\"+ \n\" </form>\\n\" +\n\"\\n\" +\n\"\\n\" +\n\"<button class=\\\"navbar-toggler navbar-toggler-right text-uppercase font-weight-bold bg-primary text-white rounded\\\" type=\\\"button\\\" data-toggle=\\\"collapse\\\" data-target=\\\"#navbarResponsive\\\" aria-controls=\\\"navbarResponsive\\\" aria-expanded=\\\"false\\\" aria-label=\\\"Toggle navigation\\\">\\n\" +\n\"\\n\" +\n\" <i class=\\\"fas fa-bars\\\"></i>\\n\" +\n\" </button>\\n\" +\n\" <div class=\\\"collapse navbar-collapse\\\" id=\\\"navbarResponsive\\\">\\n\" +\n\" <ul class=\\\"navbar-nav ml-auto\\\">\\n\" +\n\" <li class=\\\"nav-item mx-0 mx-lg-1\\\">\\n\" +\n\" <a class=\\\"nav-link py-3 px-0 px-lg-3 rounded js-scroll-trigger\\\" href=\\\"administracion.html\\\">Administracion</a>\\n\" +\n\" </li>\\n\" +\n\" <li class=\\\"nav-item mx-0 mx-lg-1\\\">\\n\" +\n\" <a class=\\\"nav-link py-3 px-0 px-lg-3 rounded js-scroll-trigger\\\" href=\\\"#about\\\">Reglas de manejo</a>\\n\" +\n\" </li>\\n\" +\n\" <li class=\\\"nav-item mx-0 mx-lg-1\\\">\\n\" +\n\" <a class=\\\"nav-link py-3 px-0 px-lg-3 rounded js-scroll-trigger\\\" href=\\\"#contact\\\">Pruebas de manejo</a>\\n\" +\n\" </li>\\n\" +\n\" </ul>\\n\" +\n\" </div>\\n\" +\n\"</div>\\n\" +\n\"</nav>\\n\" +\n\"</div>\\n\" +\n\"</div> <br>\\n\" +\n\"<br>\\n\" +\n\"<br><br>\\n\" +\n\"<br>\\n\" +\n\"<br>\\n\");\n\n \n //omitimos codigo HTML para simplificar el codigo\n out.println(\"<center>Mensaje: \"+ mensaje+\"<center>\");\n \n \n } //fin if 8\n \n }//fin else 8\n } //fin Else E5\n } //Fin Else E4 \n }", "@PostMapping(\"registrar\")\n public ResponseEntity<?> registrar(@RequestBody String payload) {\n\n JsonObject json = new Gson().fromJson(payload, JsonObject.class);\n try {\n log.info(\"Pude crear el objeto básico JSON \");\n log.info(\"siendo: \" + payload.toString());\n //log.info( \" Como yo se los objetos que vienen, puedo castear los wrappers por parte\");\n //log.info( \"Objeto 1: LoginDatos, Objeto 2: Formulario (String), 3: String[+ \");\n Usuario usuario = new Gson().fromJson(json.get(\"usuario\"), Usuario.class);\n JsonObject formulario = new Gson().fromJson(json.get(\"formulario\"), JsonObject.class);\n log.info(\"FORM: \" + formulario.toString());\n boolean artista = formulario.get(\"isArtista\").getAsBoolean();\n\n if (artista) {\n String instrumentos = new Gson().fromJson(json.get(\"instrumentos\"), String.class);\n this.usuarioServicio.guardarArtista(usuario, formulario, instrumentos);\n return new ResponseEntity(new Mensaje(\" El usuario ARTISTA se creó correctamente\"), HttpStatus.OK);\n } else {\n this.usuarioServicio.guardarComercio(usuario, formulario);\n return new ResponseEntity(new Mensaje(\" El usuario COMERCIO se creó correctamente\"), HttpStatus.OK);\n\n }\n\n } catch (Exception e) {\n return new ResponseEntity(new Mensaje(\" El uNOOOOOOOOOOOOOOOOOOOO se creó correctamente\"), HttpStatus.BAD_REQUEST);\n }\n }", "public Form_soal() {\n initComponents();\n tampil_soal();\n }", "@RequestMapping(value = \"sinResultado\", method = RequestMethod.GET)\n public ModelAndView initCreateFormSR(HttpServletRequest request) throws Exception {\n logger.debug(\"Crear reporte general de notificaciones\");\n String urlValidacion=\"\";\n try {\n urlValidacion = seguridadService.validarLogin(request);\n //si la url esta vacia significa que la validación del login fue exitosa\n if (urlValidacion.isEmpty())\n urlValidacion = seguridadService.validarAutorizacionUsuario(request, ConstantsSecurity.SYSTEM_CODE, false);\n }catch (Exception e){\n e.printStackTrace();\n urlValidacion = \"404\";\n }\n ModelAndView mav = new ModelAndView();\n if (urlValidacion.isEmpty()) {\n mav.setViewName(\"reportes/residencia/sinResultado\");\n long idUsuario = seguridadService.obtenerIdUsuario(request);\n List<EntidadesAdtvas> entidades = new ArrayList<EntidadesAdtvas>();\n if (seguridadService.esUsuarioNivelCentral(idUsuario, ConstantsSecurity.SYSTEM_CODE)){\n entidades = entidadAdmonService.getAllEntidadesAdtvas();\n }else {\n entidades = seguridadService.obtenerEntidadesPorUsuario((int) idUsuario, ConstantsSecurity.SYSTEM_CODE);\n }\n List<TipoNotificacion> tiposNotificacion = new ArrayList<TipoNotificacion>();// = catalogosService.getTipoNotificacion();\n TipoNotificacion tipoNotificacionSF = catalogosService.getTipoNotificacion(\"TPNOTI|SINFEB\");\n TipoNotificacion tipoNotificacionIRA = catalogosService.getTipoNotificacion(\"TPNOTI|IRAG\");\n tiposNotificacion.add(tipoNotificacionSF);\n tiposNotificacion.add(tipoNotificacionIRA);\n List<Divisionpolitica> departamentos = divisionPoliticaService.getAllDepartamentos();\n List<AreaRep> areas = seguridadService.getAreasUsuario((int)idUsuario,4);\n mav.addObject(\"areas\", areas);\n mav.addObject(\"departamentos\", departamentos);\n mav.addObject(\"entidades\",entidades);\n mav.addObject(\"tiposNotificacion\", tiposNotificacion);\n\n }else{\n mav.setViewName(urlValidacion);\n }\n return mav;\n }", "public FormImportar() {\n initComponents();\n }", "public boolean configure(StaplerRequest req, JSONObject o) throws FormException {\n \trhapsodyClPath = o.getString(\"rhapsodyClPath\");\n \tlicenseServerPath = o.getString(\"licenseServerPath\");\n save();\n return super.configure(req, o);\n }", "public void guardarDatos() throws Exception {\r\n\t\ttry {\r\n\t\t\tsetUpperCase();\r\n\t\t\tif (validarForm()) {\r\n\t\t\t\t// Cargamos los componentes //\r\n\r\n\t\t\t\tMap datos = new HashMap();\r\n\r\n\t\t\t\tHis_atencion_embarazada his_atencion_embarazada = new His_atencion_embarazada();\r\n\t\t\t\this_atencion_embarazada.setCodigo_empresa(empresa\r\n\t\t\t\t\t\t.getCodigo_empresa());\r\n\t\t\t\this_atencion_embarazada.setCodigo_sucursal(sucursal\r\n\t\t\t\t\t\t.getCodigo_sucursal());\r\n\t\t\t\this_atencion_embarazada.setCodigo_historia(tbxCodigo_historia\r\n\t\t\t\t\t\t.getValue());\r\n\t\t\t\this_atencion_embarazada.setFecha_inicial(new Timestamp(\r\n\t\t\t\t\t\tdtbxFecha_inicial.getValue().getTime()));\r\n\t\t\t\this_atencion_embarazada.setCodigo_eps(tbxCodigo_eps.getValue());\r\n\t\t\t\this_atencion_embarazada.setCodigo_dpto(lbxCodigo_dpto\r\n\t\t\t\t\t\t.getSelectedItem().getValue().toString());\r\n\t\t\t\this_atencion_embarazada.setCodigo_municipio(lbxCodigo_municipio\r\n\t\t\t\t\t\t.getSelectedItem().getValue().toString());\r\n\t\t\t\this_atencion_embarazada.setIdentificacion(tbxIdentificacion\r\n\t\t\t\t\t\t.getValue());\r\n\t\t\t\this_atencion_embarazada.setDireccion(tbxMotivo.getValue());\r\n\t\t\t\this_atencion_embarazada.setTelefono(tbxTelefono.getValue());\r\n\t\t\t\this_atencion_embarazada.setSeleccion(rdbSeleccion\r\n\t\t\t\t\t\t.getSelectedItem().getValue().toString());\r\n\t\t\t\this_atencion_embarazada.setGestaciones(lbxGestaciones\r\n\t\t\t\t\t\t.getSelectedItem().getValue().toString());\r\n\t\t\t\this_atencion_embarazada.setPartos(lbxPartos.getSelectedItem()\r\n\t\t\t\t\t\t.getValue().toString());\r\n\t\t\t\this_atencion_embarazada.setCesarias(lbxCesarias\r\n\t\t\t\t\t\t.getSelectedItem().getValue().toString());\r\n\t\t\t\this_atencion_embarazada.setAbortos(lbxAbortos.getSelectedItem()\r\n\t\t\t\t\t\t.getValue().toString());\r\n\t\t\t\this_atencion_embarazada.setEspontaneo(lbxEspontaneo\r\n\t\t\t\t\t\t.getSelectedItem().getValue().toString());\r\n\t\t\t\this_atencion_embarazada.setProvocado(lbxProvocado\r\n\t\t\t\t\t\t.getSelectedItem().getValue().toString());\r\n\t\t\t\this_atencion_embarazada.setNacido_muerto(lbxNacido_muerto\r\n\t\t\t\t\t\t.getSelectedItem().getValue().toString());\r\n\t\t\t\this_atencion_embarazada.setPrematuro(lbxPrematuro\r\n\t\t\t\t\t\t.getSelectedItem().getValue().toString());\r\n\t\t\t\this_atencion_embarazada.setHijos_menos(lbxHijos_menos\r\n\t\t\t\t\t\t.getSelectedItem().getValue().toString());\r\n\t\t\t\this_atencion_embarazada.setHijos_mayor(lbxHijos_mayor\r\n\t\t\t\t\t\t.getSelectedItem().getValue().toString());\r\n\t\t\t\this_atencion_embarazada.setMalformado(lbxMalformado\r\n\t\t\t\t\t\t.getSelectedItem().getValue().toString());\r\n\t\t\t\this_atencion_embarazada.setHipertension(lbxHipertension\r\n\t\t\t\t\t\t.getSelectedItem().getValue().toString());\r\n\t\t\t\this_atencion_embarazada.setFecha_ultimo_parto(new Timestamp(\r\n\t\t\t\t\t\tdtbxFecha_ultimo_parto.getValue().getTime()));\r\n\t\t\t\this_atencion_embarazada.setCirugia(lbxCirugia.getSelectedItem()\r\n\t\t\t\t\t\t.getValue().toString());\r\n\t\t\t\this_atencion_embarazada.setOtro_antecedente(tbxOtro_antecedente\r\n\t\t\t\t\t\t.getValue());\r\n\t\t\t\this_atencion_embarazada\r\n\t\t\t\t\t\t.setHemoclasificacion(lbxHemoclasificacion\r\n\t\t\t\t\t\t\t\t.getSelectedItem().getValue().toString());\r\n\t\t\t\this_atencion_embarazada.setRh(lbxRh.getSelectedItem()\r\n\t\t\t\t\t\t.getValue().toString());\r\n\t\t\t\this_atencion_embarazada.setPeso(tbxPeso.getValue());\r\n\t\t\t\this_atencion_embarazada.setTalla(tbxTalla.getValue());\r\n\t\t\t\this_atencion_embarazada.setImc(tbxImc.getValue());\r\n\t\t\t\this_atencion_embarazada.setTa(tbxTa.getValue());\r\n\t\t\t\this_atencion_embarazada.setFc(tbxFc.getValue());\r\n\t\t\t\this_atencion_embarazada.setFr(tbxFr.getValue());\r\n\t\t\t\this_atencion_embarazada.setTemperatura(tbxTemperatura\r\n\t\t\t\t\t\t.getValue());\r\n\t\t\t\this_atencion_embarazada.setCroomb(tbxCroomb.getValue());\r\n\t\t\t\this_atencion_embarazada\r\n\t\t\t\t\t\t.setFecha_ultima_mestruacion(new Timestamp(\r\n\t\t\t\t\t\t\t\tdtbxFecha_ultima_mestruacion.getValue()\r\n\t\t\t\t\t\t\t\t\t\t.getTime()));\r\n\t\t\t\this_atencion_embarazada.setFecha_probable_parto(new Timestamp(\r\n\t\t\t\t\t\tdtbxFecha_probable_parto.getValue().getTime()));\r\n\t\t\t\this_atencion_embarazada.setEdad_gestacional(tbxEdad_gestacional\r\n\t\t\t\t\t\t.getValue());\r\n\t\t\t\this_atencion_embarazada.setControl(lbxControl.getSelectedItem()\r\n\t\t\t\t\t\t.getValue().toString());\r\n\t\t\t\this_atencion_embarazada.setNum_control(tbxNum_control\r\n\t\t\t\t\t\t.getValue());\r\n\t\t\t\this_atencion_embarazada.setFetales(lbxFetales.getSelectedItem()\r\n\t\t\t\t\t\t.getValue().toString());\r\n\t\t\t\this_atencion_embarazada.setFiebre(lbxFiebre.getSelectedItem()\r\n\t\t\t\t\t\t.getValue().toString());\r\n\t\t\t\this_atencion_embarazada.setLiquido(lbxLiquido.getSelectedItem()\r\n\t\t\t\t\t\t.getValue().toString());\r\n\t\t\t\this_atencion_embarazada.setFlujo(lbxFlujo.getSelectedItem()\r\n\t\t\t\t\t\t.getValue().toString());\r\n\t\t\t\this_atencion_embarazada.setEnfermedad(lbxEnfermedad\r\n\t\t\t\t\t\t.getSelectedItem().getValue().toString());\r\n\t\t\t\this_atencion_embarazada.setCual_enfermedad(tbxCual_enfermedad\r\n\t\t\t\t\t\t.getValue());\r\n\t\t\t\this_atencion_embarazada.setCigarrillo(lbxCigarrillo\r\n\t\t\t\t\t\t.getSelectedItem().getValue().toString());\r\n\t\t\t\this_atencion_embarazada.setAlcohol(lbxAlcohol.getSelectedItem()\r\n\t\t\t\t\t\t.getValue().toString());\r\n\t\t\t\this_atencion_embarazada.setCual_alcohol(tbxCual_alcohol\r\n\t\t\t\t\t\t.getValue());\r\n\t\t\t\this_atencion_embarazada.setDroga(lbxDroga.getSelectedItem()\r\n\t\t\t\t\t\t.getValue().toString());\r\n\t\t\t\this_atencion_embarazada.setCual_droga(tbxCual_droga.getValue());\r\n\t\t\t\this_atencion_embarazada.setViolencia(lbxViolencia\r\n\t\t\t\t\t\t.getSelectedItem().getValue().toString());\r\n\t\t\t\this_atencion_embarazada.setCual_violencia(tbxCual_violencia\r\n\t\t\t\t\t\t.getValue());\r\n\t\t\t\this_atencion_embarazada.setToxoide(lbxToxoide.getSelectedItem()\r\n\t\t\t\t\t\t.getValue().toString());\r\n\t\t\t\this_atencion_embarazada.setDosis(lbxDosis.getSelectedItem()\r\n\t\t\t\t\t\t.getValue().toString());\r\n\t\t\t\this_atencion_embarazada\r\n\t\t\t\t\t\t.setObservaciones_gestion(tbxObservaciones_gestion\r\n\t\t\t\t\t\t\t\t.getValue());\r\n\t\t\t\this_atencion_embarazada.setAltura_uterina(tbxAltura_uterina\r\n\t\t\t\t\t\t.getValue());\r\n\t\t\t\this_atencion_embarazada\r\n\t\t\t\t\t\t.setCorelacion(chbCorelacion.isChecked());\r\n\t\t\t\this_atencion_embarazada\r\n\t\t\t\t\t\t.setEmbarazo_multiple(chbEmbarazo_multiple.isChecked());\r\n\t\t\t\this_atencion_embarazada\r\n\t\t\t\t\t\t.setTrasmision_sexual(chbTrasmision_sexual.isChecked());\r\n\t\t\t\this_atencion_embarazada.setAnomalia(rdbAnomalia\r\n\t\t\t\t\t\t.getSelectedItem().getValue().toString());\r\n\t\t\t\this_atencion_embarazada.setEdema_gestion(rdbEdema_gestion\r\n\t\t\t\t\t\t.getSelectedItem().getValue().toString());\r\n\t\t\t\this_atencion_embarazada.setPalidez(rdbPalidez.getSelectedItem()\r\n\t\t\t\t\t\t.getValue().toString());\r\n\t\t\t\this_atencion_embarazada.setConvulciones(rdbConvulciones\r\n\t\t\t\t\t\t.getSelectedItem().getValue().toString());\r\n\t\t\t\this_atencion_embarazada.setConciencia(rdbConciencia\r\n\t\t\t\t\t\t.getSelectedItem().getValue().toString());\r\n\t\t\t\this_atencion_embarazada.setCavidad_bucal(rdbCavidad_bucal\r\n\t\t\t\t\t\t.getSelectedItem().getValue().toString());\r\n\t\t\t\this_atencion_embarazada.setHto(tbxHto.getValue());\r\n\t\t\t\this_atencion_embarazada.setHb(tbxHb.getValue());\r\n\t\t\t\this_atencion_embarazada.setToxoplasma(tbxToxoplasma.getValue());\r\n\t\t\t\this_atencion_embarazada.setVdrl1(tbxVdrl1.getValue());\r\n\t\t\t\this_atencion_embarazada.setVdrl2(tbxVdrl2.getValue());\r\n\t\t\t\this_atencion_embarazada.setVih1(tbxVih1.getValue());\r\n\t\t\t\this_atencion_embarazada.setVih2(tbxVih2.getValue());\r\n\t\t\t\this_atencion_embarazada.setHepb(tbxHepb.getValue());\r\n\t\t\t\this_atencion_embarazada.setOtro(tbxOtro.getValue());\r\n\t\t\t\this_atencion_embarazada.setEcografia(tbxEcografia.getValue());\r\n\t\t\t\this_atencion_embarazada\r\n\t\t\t\t\t\t.setClasificacion_gestion(rdbClasificacion_gestion\r\n\t\t\t\t\t\t\t\t.getSelectedItem().getValue().toString());\r\n\t\t\t\this_atencion_embarazada.setContracciones(lbxContracciones\r\n\t\t\t\t\t\t.getSelectedItem().getValue().toString());\r\n\t\t\t\this_atencion_embarazada\r\n\t\t\t\t\t\t.setNum_contracciones(lbxNum_contracciones\r\n\t\t\t\t\t\t\t\t.getSelectedItem().getValue().toString());\r\n\t\t\t\this_atencion_embarazada.setHemorragia(lbxHemorragia\r\n\t\t\t\t\t\t.getSelectedItem().getValue().toString());\r\n\t\t\t\this_atencion_embarazada.setLiquido_vaginal(lbxLiquido_vaginal\r\n\t\t\t\t\t\t.getSelectedItem().getValue().toString());\r\n\t\t\t\this_atencion_embarazada.setColor_liquido(tbxColor_liquido\r\n\t\t\t\t\t\t.getValue());\r\n\t\t\t\this_atencion_embarazada.setDolor_cabeza(lbxDolor_cabeza\r\n\t\t\t\t\t\t.getSelectedItem().getValue().toString());\r\n\t\t\t\this_atencion_embarazada.setVision(lbxVision.getSelectedItem()\r\n\t\t\t\t\t\t.getValue().toString());\r\n\t\t\t\this_atencion_embarazada.setConvulcion(lbxConvulcion\r\n\t\t\t\t\t\t.getSelectedItem().getValue().toString());\r\n\t\t\t\this_atencion_embarazada\r\n\t\t\t\t\t\t.setObservaciones_parto(tbxObservaciones_parto\r\n\t\t\t\t\t\t\t\t.getValue());\r\n\t\t\t\this_atencion_embarazada\r\n\t\t\t\t\t\t.setContracciones_min(tbxContracciones_min.getValue());\r\n\t\t\t\this_atencion_embarazada.setFc_fera(tbxFc_fera.getValue());\r\n\t\t\t\this_atencion_embarazada\r\n\t\t\t\t\t\t.setDilatacion_cervical(tbxDilatacion_cervical\r\n\t\t\t\t\t\t\t\t.getValue());\r\n\t\t\t\this_atencion_embarazada.setPreentacion(rdbPreentacion\r\n\t\t\t\t\t\t.getSelectedItem().getValue().toString());\r\n\t\t\t\this_atencion_embarazada\r\n\t\t\t\t\t\t.setOtra_presentacion(tbxOtra_presentacion.getValue());\r\n\t\t\t\this_atencion_embarazada.setEdema(rdbEdema.getSelectedItem()\r\n\t\t\t\t\t\t.getValue().toString());\r\n\t\t\t\this_atencion_embarazada\r\n\t\t\t\t\t\t.setHemorragia_vaginal(lbxHemorragia_vaginal\r\n\t\t\t\t\t\t\t\t.getSelectedItem().getValue().toString());\r\n\t\t\t\this_atencion_embarazada.setHto_parto(tbxHto_parto.getValue());\r\n\t\t\t\this_atencion_embarazada.setHb_parto(tbxHb_parto.getValue());\r\n\t\t\t\this_atencion_embarazada.setHepb_parto(tbxHepb_parto.getValue());\r\n\t\t\t\this_atencion_embarazada.setVdrl_parto(tbxVdrl_parto.getValue());\r\n\t\t\t\this_atencion_embarazada.setVih_parto(tbxVih_parto.getValue());\r\n\t\t\t\this_atencion_embarazada\r\n\t\t\t\t\t\t.setClasificacion_parto(rdbClasificacion_parto\r\n\t\t\t\t\t\t\t\t.getSelectedItem().getValue().toString());\r\n\t\t\t\this_atencion_embarazada.setFecha_nac(new Timestamp(\r\n\t\t\t\t\t\tdtbxFecha_nac.getValue().getTime()));\r\n\t\t\t\this_atencion_embarazada\r\n\t\t\t\t\t\t.setIdentificacion_nac(tbxIdentificacion_nac.getValue());\r\n\t\t\t\this_atencion_embarazada.setSexo(lbxSexo.getSelectedItem()\r\n\t\t\t\t\t\t.getValue().toString());\r\n\t\t\t\this_atencion_embarazada.setPeso_nac(tbxPeso_nac.getValue());\r\n\t\t\t\this_atencion_embarazada.setTalla_nac(tbxTalla_nac.getValue());\r\n\t\t\t\this_atencion_embarazada.setPc_nac(tbxPc_nac.getValue());\r\n\t\t\t\this_atencion_embarazada.setFc_nac(tbxFc_nac.getValue());\r\n\t\t\t\this_atencion_embarazada.setTemper_nac(tbxTemper_nac.getValue());\r\n\t\t\t\this_atencion_embarazada.setEdad(tbxEdad.getValue());\r\n\t\t\t\this_atencion_embarazada.setAdgar1(tbxAdgar1.getValue());\r\n\t\t\t\this_atencion_embarazada.setAdgar5(tbxAdgar5.getValue());\r\n\t\t\t\this_atencion_embarazada.setAdgar10(tbxAdgar10.getValue());\r\n\t\t\t\this_atencion_embarazada.setAdgar20(tbxAdgar20.getValue());\r\n\t\t\t\this_atencion_embarazada\r\n\t\t\t\t\t\t.setObservaciones_nac(tbxObservaciones_nac.getValue());\r\n\t\t\t\this_atencion_embarazada\r\n\t\t\t\t\t\t.setClasificacion_nac(rdbClasificacion_nac\r\n\t\t\t\t\t\t\t\t.getSelectedItem().getValue().toString());\r\n\t\t\t\this_atencion_embarazada.setReani_prematuro(chbReani_prematuro\r\n\t\t\t\t\t\t.isChecked());\r\n\t\t\t\this_atencion_embarazada.setReani_meconio(chbReani_meconio\r\n\t\t\t\t\t\t.isChecked());\r\n\t\t\t\this_atencion_embarazada\r\n\t\t\t\t\t\t.setReani_respiracion(chbReani_respiracion.isChecked());\r\n\t\t\t\this_atencion_embarazada.setReani_hipotonico(chbReani_hipotonico\r\n\t\t\t\t\t\t.isChecked());\r\n\t\t\t\this_atencion_embarazada.setReani_apnea(chbReani_apnea\r\n\t\t\t\t\t\t.isChecked());\r\n\t\t\t\this_atencion_embarazada.setReani_jadeo(chbReani_jadeo\r\n\t\t\t\t\t\t.isChecked());\r\n\t\t\t\this_atencion_embarazada\r\n\t\t\t\t\t\t.setReani_deficultosa(chbReani_deficultosa.isChecked());\r\n\t\t\t\this_atencion_embarazada.setReani_gianosis(chbReani_gianosis\r\n\t\t\t\t\t\t.isChecked());\r\n\t\t\t\this_atencion_embarazada\r\n\t\t\t\t\t\t.setReani_bradicardia(chbReani_bradicardia.isChecked());\r\n\t\t\t\this_atencion_embarazada.setReani_hipoxemia(chbReani_hipoxemia\r\n\t\t\t\t\t\t.isChecked());\r\n\t\t\t\this_atencion_embarazada\r\n\t\t\t\t\t\t.setReani_estimulacion(chbReani_estimulacion\r\n\t\t\t\t\t\t\t\t.isChecked());\r\n\t\t\t\this_atencion_embarazada\r\n\t\t\t\t\t\t.setReani_ventilacion(chbReani_ventilacion.isChecked());\r\n\t\t\t\this_atencion_embarazada\r\n\t\t\t\t\t\t.setReani_comprensiones(chbReani_comprensiones\r\n\t\t\t\t\t\t\t\t.isChecked());\r\n\t\t\t\this_atencion_embarazada.setReani_intubacion(chbReani_intubacion\r\n\t\t\t\t\t\t.isChecked());\r\n\t\t\t\this_atencion_embarazada.setMedicina(tbxMedicina.getValue());\r\n\t\t\t\this_atencion_embarazada\r\n\t\t\t\t\t\t.setClasificacion_reani(rdbClasificacion_reani\r\n\t\t\t\t\t\t\t\t.getSelectedItem().getValue().toString());\r\n\t\t\t\this_atencion_embarazada.setRuptura(lbxRuptura.getSelectedItem()\r\n\t\t\t\t\t\t.getValue().toString());\r\n\t\t\t\this_atencion_embarazada.setTiempo_ruptura(lbxTiempo_ruptura\r\n\t\t\t\t\t\t.getSelectedItem().getValue().toString());\r\n\t\t\t\this_atencion_embarazada.setLiquido_neo(tbxLiquido_neo\r\n\t\t\t\t\t\t.getValue());\r\n\t\t\t\this_atencion_embarazada.setFiebre_neo(lbxFiebre_neo\r\n\t\t\t\t\t\t.getSelectedItem().getValue().toString());\r\n\t\t\t\this_atencion_embarazada.setTiempo_neo(lbxTiempo_neo\r\n\t\t\t\t\t\t.getSelectedItem().getValue().toString());\r\n\t\t\t\this_atencion_embarazada.setCoricamniotis(tbxCoricamniotis\r\n\t\t\t\t\t\t.getValue());\r\n\t\t\t\this_atencion_embarazada.setIntrauterina(rdbIntrauterina\r\n\t\t\t\t\t\t.getSelectedItem().getValue().toString());\r\n\t\t\t\this_atencion_embarazada.setMadre20(lbxMadre20.getSelectedItem()\r\n\t\t\t\t\t\t.getValue().toString());\r\n\t\t\t\this_atencion_embarazada.setAlcohol_neo(chbAlcohol_neo\r\n\t\t\t\t\t\t.isChecked());\r\n\t\t\t\this_atencion_embarazada\r\n\t\t\t\t\t\t.setDrogas_neo(chbDrogas_neo.isChecked());\r\n\t\t\t\this_atencion_embarazada.setCigarrillo_neo(chbCigarrillo_neo\r\n\t\t\t\t\t\t.isChecked());\r\n\t\t\t\this_atencion_embarazada.setRespiracion_neo(rdbRespiracion_neo\r\n\t\t\t\t\t\t.getSelectedItem().getValue().toString());\r\n\t\t\t\this_atencion_embarazada.setLlanto_neo(rdbLlanto_neo\r\n\t\t\t\t\t\t.getSelectedItem().getValue().toString());\r\n\t\t\t\this_atencion_embarazada.setVetalidad_neo(rdbVetalidad_neo\r\n\t\t\t\t\t\t.getSelectedItem().getValue().toString());\r\n\t\t\t\this_atencion_embarazada.setTaquicardia_neo(chbTaquicardia_neo\r\n\t\t\t\t\t\t.isChecked());\r\n\t\t\t\this_atencion_embarazada.setBradicardia_neo(chbBradicardia_neo\r\n\t\t\t\t\t\t.isChecked());\r\n\t\t\t\this_atencion_embarazada.setPalidez_neo(chbPalidez_neo\r\n\t\t\t\t\t\t.isChecked());\r\n\t\t\t\this_atencion_embarazada.setCianosis_neo(chbCianosis_neo\r\n\t\t\t\t\t\t.isChecked());\r\n\t\t\t\this_atencion_embarazada\r\n\t\t\t\t\t\t.setAnomalias_congenitas(lbxAnomalias_congenitas\r\n\t\t\t\t\t\t\t\t.getSelectedItem().getValue().toString());\r\n\t\t\t\this_atencion_embarazada.setCual_anomalias(tbxCual_anomalias\r\n\t\t\t\t\t\t.getValue());\r\n\t\t\t\this_atencion_embarazada.setLesiones(tbxLesiones.getValue());\r\n\t\t\t\this_atencion_embarazada.setOtras_alter(tbxOtras_alter\r\n\t\t\t\t\t\t.getValue());\r\n\t\t\t\this_atencion_embarazada\r\n\t\t\t\t\t\t.setClasificacion_neo(rdbClasificacion_neo\r\n\t\t\t\t\t\t\t\t.getSelectedItem().getValue().toString());\r\n\t\t\t\this_atencion_embarazada.setAlarma(tbxAlarma.getValue());\r\n\t\t\t\this_atencion_embarazada.setConsulta_control(tbxConsulta_control\r\n\t\t\t\t\t\t.getValue());\r\n\t\t\t\this_atencion_embarazada\r\n\t\t\t\t\t\t.setMedidas_preventiva(tbxMedidas_preventiva.getValue());\r\n\t\t\t\this_atencion_embarazada.setRecomendaciones(tbxRecomendaciones\r\n\t\t\t\t\t\t.getValue());\r\n\t\t\t\this_atencion_embarazada.setDiagnostico(tbxDiagnostico\r\n\t\t\t\t\t\t.getValue());\r\n\t\t\t\this_atencion_embarazada\r\n\t\t\t\t\t\t.setCodigo_diagnostico(tbxCodigo_diagnostico.getValue());\r\n\t\t\t\this_atencion_embarazada.setTratamiento(tbxTratamiento\r\n\t\t\t\t\t\t.getValue());\r\n\t\t\t\this_atencion_embarazada\r\n\t\t\t\t\t\t.setRecomendacion_alimentacion(tbxRecomendacion_alimentacion\r\n\t\t\t\t\t\t\t\t.getValue());\r\n\t\t\t\this_atencion_embarazada\r\n\t\t\t\t\t\t.setEvolucion_servicio(tbxEvolucion_servicio.getValue());\r\n\r\n\t\t\t\tdatos.put(\"codigo_historia\", his_atencion_embarazada);\r\n\t\t\t\tdatos.put(\"accion\", tbxAccion.getText());\r\n\r\n\t\t\t\this_atencion_embarazada = getServiceLocator()\r\n\t\t\t\t\t\t.getHis_atencion_embarazadaService().guardar(datos);\r\n\r\n\t\t\t\tif (tbxAccion.getText().equalsIgnoreCase(\"registrar\")) {\r\n\t\t\t\t\taccionForm(true, \"modificar\");\r\n\t\t\t\t}\r\n\t\t\t\t/*\r\n\t\t\t\t * else{ int result =\r\n\t\t\t\t * getServiceLocator().getHis_atencion_embarazadaService\r\n\t\t\t\t * ().actualizar(his_atencion_embarazada); if(result==0){ throw\r\n\t\t\t\t * new Exception(\r\n\t\t\t\t * \"Lo sentimos pero los datos a modificar no se encuentran en base de datos\"\r\n\t\t\t\t * ); } }\r\n\t\t\t\t */\r\n\r\n//\t\t\t\tcodigo_historia = his_atencion_embarazada.getCodigo_historia();\r\n\r\n\t\t\t\tMessagebox.show(\"Los datos se guardaron satisfactoriamente\",\r\n\t\t\t\t\t\t\"Informacion ..\", Messagebox.OK,\r\n\t\t\t\t\t\tMessagebox.INFORMATION);\r\n\r\n\t\t\t}\r\n\r\n\t\t} catch (Exception e) {\r\n\t\t\t\r\n\t\t\tlog.error(e.getMessage(), e);\r\n\t\t\tMessagebox.show(e.getMessage(), \"Mensaje de Error !!\",\r\n\t\t\t\t\tMessagebox.OK, Messagebox.ERROR);\r\n\t\t}\r\n\r\n\t}", "@Override\n public ExtensionResult getForms(ExtensionRequest extensionRequest) {\n Map<String, String> output = new HashMap<>();\n FormBuilder formBuilder = new FormBuilder(appProperties.getFormIdTest());\n\n ButtonTemplate button = new ButtonTemplate();\n button.setTitle(\"Test Form\");\n button.setSubTitle(\"Subtitle is here\");\n button.setPictureLink(appProperties.getAtmUrl());\n button.setPicturePath(appProperties.getAtmUrl());\n List<EasyMap> actions = new ArrayList<>();\n EasyMap bookAction = new EasyMap();\n bookAction.setName(\"Label here\");\n bookAction.setValue(formBuilder.build());\n actions.add(bookAction);\n button.setButtonValues(actions);\n ButtonBuilder buttonBuilder = new ButtonBuilder(button);\n\n output.put(OUTPUT, buttonBuilder.build());\n ExtensionResult extensionResult = new ExtensionResult();\n extensionResult.setAgent(false);\n extensionResult.setRepeat(false);\n extensionResult.setSuccess(true);\n extensionResult.setNext(true);\n extensionResult.setValue(output);\n return extensionResult;\n }", "public String getFormacao() {\n\t\treturn formacao;\n\t}", "public void crearProgramaFormacion(String nombre, String descripcion, Date fechaI, Date fechaF, Date fechaA, String url) throws ProgramaFormacionExcepcion;", "public void guardarSolicitud() {\n Map<String, String> paramMap = getParametrosSesion();\n String cadenaFirmada;\n try {\n if (paramMap != null) {\n cadenaFirmada = paramMap.get(firmaFormHelper.FIRMA_DIGITAL);\n firmaFormHelper.setSelloDigital(paramMap.get(FirmaFormHelper.FIRMA_DIGITAL));\n\n SimpleDateFormat formato = new SimpleDateFormat(\"dd/MM/yyyy\");\n produccion.setFechProduccion(new Date());\n desperdiciosHelper.setFechaAcuse(formato.format(produccion.getFechProduccion()));\n\n if (cadenaFirmada.length() > 0) {\n guardarRangosFolios();\n Acuse acuse = new Acuse();\n acuse.setSerieAcuse(TipoAcuse.DESPERDICIO);\n acuse.setIdProveedor(produccionCigarrosHelper.getProveedor().getIdProveedor());\n acuse.setSelloDigital(firmaFormHelper.getSelloDigital());\n acuse.setCadenaOriginal(firmaFormHelper.getCadenaOriginal());\n acuse.setFecCaptura(new Date());\n desperdiciosHelper.setIdAcuseRecibo(commonService.crearAcuse(acuse));\n habilitarPnlAcuse();\n registroMovimientoBitacora(getSession(), IdentificadorProcesoEnum.CONTRIBUYENTE_TRAMITES, new Date(), new Date(), MovimientosBitacoraEnum.DESPERDICIOS_DESTRUCCION);\n } else {\n habilitarPnlPrincipal();\n }\n }\n } catch (CommonServiceException e) {\n LOGGER.error(e.getMessage(), e);\n addErrorMessage(ERROR, \"No se pudo generar el acuse\");\n } catch (Exception ex) {\n LOGGER.error(ex.getMessage());\n }\n }", "@RequestMapping(\"/processForm\")\n public String processForm(){\n return \"helloworld\";\n }", "@RequestMapping(\"/sendData\") // will wap to the incoming request address\n\tpublic String handelFormRequest(HttpServletRequest request, Model model) {\n\t\tString data = (String)request.getParameter(\"data\");\n\t\tmodel.addAttribute(\"testData\",data); // will be set in request attribute\n\t\tmodel.addAttribute(\"Test\",\"TestVal\"); // will be set in request attribute\n\t\treturn \"getData\";\n\t}", "private void submitForm() {\n Toast.makeText(this, \"Registering...\", Toast.LENGTH_LONG).show();\n }", "@POST\n \t@Path(\"/form\")\n \t@Consumes(MediaType.APPLICATION_FORM_URLENCODED)\n \t@Produces(MediaType.TEXT_PLAIN)\n \tpublic String formMethod(@QueryParam(\"token\") String token,\n \t\t\t@FormParam(\"name\") String name,\n \t\t\t@FormParam(\"location\") String location) {\n \t\t// map json to json object \n \t\treturn token + \"::\" + name + \"::\" + location + \"\\n\";\n \t}", "private void entrar() {\n\n Connection con = Conexao.abrirConexao();\n UsuarioDAO ud = new UsuarioDAO(con);\n String login = txtLOGIN.getText();\n String senha = txtSENHA.getText();\n String nome;\n\n if (txtLOGIN.getText().equals(\"admin\")) {\n nome = \"Administrador\";\n } else {\n nome = ud.retornarUsuario(login);\n }\n\n if (/*ud.logar(login, senha) == 0 ||*/ login.equals(\"admin\") && senha.equals(\"admin\")) {\n lblERRO.setText(\"\");\n JFrame principal = new frm_PRINCIPAL(login, nome);\n this.dispose();\n principal.setVisible(true);\n\n } else {\n\n lblERRO.setText(\"Usuário e/ou Senha Inválidos!\");\n }\n Conexao.fecharConexao(con);\n }", "@GetMapping(\"hello\")\n @ResponseBody\n public String helloLangForm() {\n String html = \"<html>\" +\n \"<form method='post' action=''>\" +\n \"<input type='text' name='name' />\" +\n \"<select name='language'>\" +\n \"<option value='english'>English</option>\" +\n \"<option value='french'>French</option>\" +\n \"<option value='german'>German</option>\" +\n \"<option value='spanish'>Spanish</option>\" +\n \"<option value='arabic'>Arabic</option>\" +\n \"<input type='submit' value='Greet me!'/>\" +\n \"</form>\" +\n \"</html>\";\n\n return html;\n }", "private void formRequest() {\r\n\t\tbyte[] user_bytes = _userName.getBytes();\r\n\t\tbyte[] password_bytes = _password.getBytes();\r\n\r\n\t\t_request = new byte[3 + user_bytes.length + password_bytes.length];\r\n\t\t_request[0] = (byte) 1;\r\n\t\t_request[1] = (byte) user_bytes.length;\r\n\t\tSystem.arraycopy(user_bytes, 0, _request, 2, user_bytes.length);\r\n\t\t_request[2 + user_bytes.length] = (byte) password_bytes.length;\r\n\t\tSystem.arraycopy(password_bytes, 0, _request, 3 + user_bytes.length, password_bytes.length);\r\n\t}", "@GetMapping(\"/formuQuejas\") \n\tpublic String verInicio(Model model) {\n\t\treturn \"PQR/formQuejas\";\n\t}", "private void cargarDatos()\n {\n // Pantalla carga\n showProgress(true, mView, mProgressView, getContext());\n Comando login = new LoginComando(KPantallas.PANTALLA_PERFIL);\n String email = UtilUI.getEmail(getContext());\n String password = UtilUI.getPassword(getContext());\n login.ejecutar(email,password);\n }", "public void guardarDatos() throws Exception {\r\n\t\ttry {\r\n\t\t\tsetUpperCase();\r\n\t\t\tif (validarForm()) {\r\n\t\t\t\t// Cargamos los componentes //\r\n\r\n\t\t\t\tMap datos = new HashMap();\r\n\r\n\t\t\t\tHis_parto his_parto = new His_parto();\r\n\t\t\t\this_parto.setCodigo_empresa(empresa.getCodigo_empresa());\r\n\t\t\t\this_parto.setCodigo_sucursal(sucursal.getCodigo_sucursal());\r\n\t\t\t\this_parto.setCodigo_historia(tbxCodigo_historia.getValue());\r\n\t\t\t\this_parto.setIdentificacion(tbxIdentificacion.getValue());\r\n\t\t\t\this_parto.setFecha_inicial(new Timestamp(dtbxFecha_inicial\r\n\t\t\t\t\t\t.getValue().getTime()));\r\n\t\t\t\this_parto.setConyugue(tbxConyugue.getValue());\r\n\t\t\t\this_parto.setId_conyugue(tbxId_conyugue.getValue());\r\n\t\t\t\this_parto.setEdad_conyugue(tbxEdad_conyugue.getValue());\r\n\t\t\t\this_parto.setEscolaridad_conyugue(tbxEscolaridad_conyugue\r\n\t\t\t\t\t\t.getValue());\r\n\t\t\t\this_parto.setMotivo(tbxMotivo.getValue());\r\n\t\t\t\this_parto.setEnfermedad_actual(tbxEnfermedad_actual.getValue());\r\n\t\t\t\this_parto.setAntecedentes_familiares(tbxAntecedentes_familiares\r\n\t\t\t\t\t\t.getValue());\r\n\t\t\t\this_parto.setPreeclampsia(rdbPreeclampsia.getSelectedItem()\r\n\t\t\t\t\t\t.getValue().toString());\r\n\t\t\t\this_parto.setHipertension(rdbHipertension.getSelectedItem()\r\n\t\t\t\t\t\t.getValue().toString());\r\n\t\t\t\this_parto.setEclampsia(rdbEclampsia.getSelectedItem()\r\n\t\t\t\t\t\t.getValue().toString());\r\n\t\t\t\this_parto.setH1(rdbH1.getSelectedItem().getValue().toString());\r\n\t\t\t\this_parto.setH2(rdbH2.getSelectedItem().getValue().toString());\r\n\t\t\t\this_parto.setPostimadurez(rdbPostimadurez.getSelectedItem()\r\n\t\t\t\t\t\t.getValue().toString());\r\n\t\t\t\this_parto.setRot_pre(rdbRot_pre.getSelectedItem().getValue()\r\n\t\t\t\t\t\t.toString());\r\n\t\t\t\this_parto.setPolihidramnios(rdbPolihidramnios.getSelectedItem()\r\n\t\t\t\t\t\t.getValue().toString());\r\n\t\t\t\this_parto.setRcui(rdbRcui.getSelectedItem().getValue()\r\n\t\t\t\t\t\t.toString());\r\n\t\t\t\this_parto.setPelvis(rdbPelvis.getSelectedItem().getValue()\r\n\t\t\t\t\t\t.toString());\r\n\t\t\t\this_parto.setFeto_macrosonico(rdbFeto_macrosonico\r\n\t\t\t\t\t\t.getSelectedItem().getValue().toString());\r\n\t\t\t\this_parto.setIsoinmunizacion(rdbIsoinmunizacion\r\n\t\t\t\t\t\t.getSelectedItem().getValue().toString());\r\n\t\t\t\this_parto.setAo(rdbAo.getSelectedItem().getValue().toString());\r\n\t\t\t\this_parto.setCirc_cordon(rdbCirc_cordon.getSelectedItem()\r\n\t\t\t\t\t\t.getValue().toString());\r\n\t\t\t\this_parto.setPostparto(rdbPostparto.getSelectedItem()\r\n\t\t\t\t\t\t.getValue().toString());\r\n\t\t\t\this_parto.setDiabetes(rdbDiabetes.getSelectedItem().getValue()\r\n\t\t\t\t\t\t.toString());\r\n\t\t\t\this_parto.setCardiopatia(rdbCardiopatia.getSelectedItem()\r\n\t\t\t\t\t\t.getValue().toString());\r\n\t\t\t\this_parto.setAnemias(rdbAnemias.getSelectedItem().getValue()\r\n\t\t\t\t\t\t.toString());\r\n\t\t\t\this_parto.setEnf_autoinmunes(rdbEnf_autoinmunes\r\n\t\t\t\t\t\t.getSelectedItem().getValue().toString());\r\n\t\t\t\this_parto.setEnf_renales(rdbEnf_renales.getSelectedItem()\r\n\t\t\t\t\t\t.getValue().toString());\r\n\t\t\t\this_parto.setInf_urinaria(rdbInf_urinaria.getSelectedItem()\r\n\t\t\t\t\t\t.getValue().toString());\r\n\t\t\t\this_parto.setEpilepsia(rdbEpilepsia.getSelectedItem()\r\n\t\t\t\t\t\t.getValue().toString());\r\n\t\t\t\this_parto\r\n\t\t\t\t\t\t.setTbc(rdbTbc.getSelectedItem().getValue().toString());\r\n\t\t\t\this_parto.setMiomas(rdbMiomas.getSelectedItem().getValue()\r\n\t\t\t\t\t\t.toString());\r\n\t\t\t\this_parto.setHb(rdbHb.getSelectedItem().getValue().toString());\r\n\t\t\t\this_parto.setFumadora(rdbFumadora.getSelectedItem().getValue()\r\n\t\t\t\t\t\t.toString());\r\n\t\t\t\this_parto.setInf_puerperal(rdbInf_puerperal.getSelectedItem()\r\n\t\t\t\t\t\t.getValue().toString());\r\n\t\t\t\this_parto.setInfertilidad(rdbInfertilidad.getSelectedItem()\r\n\t\t\t\t\t\t.getValue().toString());\r\n\t\t\t\this_parto.setMenarquia(tbxMenarquia.getValue());\r\n\t\t\t\this_parto.setCiclos(tbxCiclos.getValue());\r\n\t\t\t\this_parto.setVida_marital(tbxVida_marital.getValue());\r\n\t\t\t\this_parto.setVida_obstetrica(tbxVida_obstetrica.getValue());\r\n\t\t\t\this_parto.setNo_gestaciones(lbxNo_gestaciones.getSelectedItem()\r\n\t\t\t\t\t\t.getValue().toString());\r\n\t\t\t\this_parto.setParto(lbxParto.getSelectedItem().getValue()\r\n\t\t\t\t\t\t.toString());\r\n\t\t\t\this_parto.setAborto(lbxAborto.getSelectedItem().getValue()\r\n\t\t\t\t\t\t.toString());\r\n\t\t\t\this_parto.setCesarias(lbxCesarias.getSelectedItem().getValue()\r\n\t\t\t\t\t\t.toString());\r\n\t\t\t\this_parto.setFecha_um(new Timestamp(dtbxFecha_um.getValue()\r\n\t\t\t\t\t\t.getTime()));\r\n\t\t\t\this_parto.setUm(tbxUm.getValue());\r\n\t\t\t\this_parto.setFep(tbxFep.getValue());\r\n\t\t\t\this_parto.setGemerales(lbxGemerales.getSelectedItem()\r\n\t\t\t\t\t\t.getValue().toString());\r\n\t\t\t\this_parto.setMalformados(lbxMalformados.getSelectedItem()\r\n\t\t\t\t\t\t.getValue().toString());\r\n\t\t\t\this_parto.setNacidos_vivos(lbxNacidos_vivos.getSelectedItem()\r\n\t\t\t\t\t\t.getValue().toString());\r\n\t\t\t\this_parto.setNacidos_muertos(lbxNacidos_muertos\r\n\t\t\t\t\t\t.getSelectedItem().getValue().toString());\r\n\t\t\t\this_parto.setPreterminos(lbxPreterminos.getSelectedItem()\r\n\t\t\t\t\t\t.getValue().toString());\r\n\t\t\t\this_parto.setMedico(chbMedico.isChecked());\r\n\t\t\t\this_parto.setEnfermera(chbEnfermera.isChecked());\r\n\t\t\t\this_parto.setAuxiliar(chbAuxiliar.isChecked());\r\n\t\t\t\this_parto.setPartera(chbPartera.isChecked());\r\n\t\t\t\this_parto.setOtros(chbOtros.isChecked());\r\n\t\t\t\this_parto.setControlado(rdbControlado.getSelectedItem()\r\n\t\t\t\t\t\t.getValue().toString());\r\n\t\t\t\this_parto.setLugar_consulta(rdbLugar_consulta.getSelectedItem()\r\n\t\t\t\t\t\t.getValue().toString());\r\n\t\t\t\this_parto.setNo_consultas(lbxNo_consultas.getSelectedItem()\r\n\t\t\t\t\t\t.getValue().toString());\r\n\t\t\t\this_parto.setEspecialistas(chbEspecialistas.isChecked());\r\n\t\t\t\this_parto.setGeneral(chbGeneral.isChecked());\r\n\t\t\t\this_parto.setPartera_consulta(chbPartera_consulta.isChecked());\r\n\t\t\t\this_parto.setSangrado_vaginal(rdbSangrado_vaginal\r\n\t\t\t\t\t\t.getSelectedItem().getValue().toString());\r\n\t\t\t\this_parto.setCefalias(rdbCefalias.getSelectedItem().getValue()\r\n\t\t\t\t\t\t.toString());\r\n\t\t\t\this_parto.setEdema(rdbEdema.getSelectedItem().getValue()\r\n\t\t\t\t\t\t.toString());\r\n\t\t\t\this_parto.setEpigastralgia(rdbEpigastralgia.getSelectedItem()\r\n\t\t\t\t\t\t.getValue().toString());\r\n\t\t\t\this_parto.setVomitos(rdbVomitos.getSelectedItem().getValue()\r\n\t\t\t\t\t\t.toString());\r\n\t\t\t\this_parto.setTinutus(rdbTinutus.getSelectedItem().getValue()\r\n\t\t\t\t\t\t.toString());\r\n\t\t\t\this_parto.setEscotomas(rdbEscotomas.getSelectedItem()\r\n\t\t\t\t\t\t.getValue().toString());\r\n\t\t\t\this_parto.setInfeccion_urinaria(rdbInfeccion_urinaria\r\n\t\t\t\t\t\t.getSelectedItem().getValue().toString());\r\n\t\t\t\this_parto.setInfeccion_vaginal(rdbInfeccion_vaginal\r\n\t\t\t\t\t\t.getSelectedItem().getValue().toString());\r\n\t\t\t\this_parto.setOtros_embarazo(tbxOtros_embarazo.getValue());\r\n\t\t\t\this_parto.setCardiaca(tbxCardiaca.getValue());\r\n\t\t\t\this_parto.setRespiratoria(tbxRespiratoria.getValue());\r\n\t\t\t\this_parto.setPeso(tbxPeso.getValue());\r\n\t\t\t\this_parto.setTalla(tbxTalla.getValue());\r\n\t\t\t\this_parto.setTempo(tbxTempo.getValue());\r\n\t\t\t\this_parto.setPresion(tbxPresion.getValue());\r\n\t\t\t\this_parto.setPresion2(tbxPresion2.getValue());\r\n\t\t\t\this_parto.setInd_masa(tbxInd_masa.getValue());\r\n\t\t\t\this_parto.setSus_masa(tbxSus_masa.getValue());\r\n\t\t\t\this_parto.setCabeza_cuello(tbxCabeza_cuello.getValue());\r\n\t\t\t\this_parto.setCardiovascular(tbxCardiovascular.getValue());\r\n\t\t\t\this_parto.setMamas(tbxMamas.getValue());\r\n\t\t\t\this_parto.setPulmones(tbxPulmones.getValue());\r\n\t\t\t\this_parto.setAbdomen(tbxAbdomen.getValue());\r\n\t\t\t\this_parto.setUterina(tbxUterina.getValue());\r\n\t\t\t\this_parto.setSituacion(tbxSituacion.getValue());\r\n\t\t\t\this_parto.setPresentacion(tbxPresentacion.getValue());\r\n\t\t\t\this_parto.setV_presentacion(tbxV_presentacion.getValue());\r\n\t\t\t\this_parto.setPosicion(tbxPosicion.getValue());\r\n\t\t\t\this_parto.setV_posicion(tbxV_posicion.getValue());\r\n\t\t\t\this_parto.setC_uterina(tbxC_uterina.getValue());\r\n\t\t\t\this_parto.setTono(tbxTono.getValue());\r\n\t\t\t\this_parto.setFcf(tbxFcf.getValue());\r\n\t\t\t\this_parto.setGenitales(tbxGenitales.getValue());\r\n\t\t\t\this_parto.setDilatacion(tbxDilatacion.getValue());\r\n\t\t\t\this_parto.setBorramiento(tbxBorramiento.getValue());\r\n\t\t\t\this_parto.setEstacion(tbxEstacion.getValue());\r\n\t\t\t\this_parto.setMembranas(tbxMembranas.getValue());\r\n\t\t\t\this_parto.setExtremidades(tbxExtremidades.getValue());\r\n\t\t\t\this_parto.setSnc(tbxSnc.getValue());\r\n\t\t\t\this_parto.setObservacion(tbxObservacion.getValue());\r\n\t\t\t\this_parto.setCodigo_consulta_pyp(lbxCodigo_consulta_pyp\r\n\t\t\t\t\t\t.getSelectedItem().getValue().toString());\r\n\t\t\t\this_parto.setFinalidad_cons(lbxFinalidad_cons.getSelectedItem()\r\n\t\t\t\t\t\t.getValue().toString());\r\n\t\t\t\this_parto.setCausas_externas(lbxCausas_externas\r\n\t\t\t\t\t\t.getSelectedItem().getValue().toString());\r\n\t\t\t\this_parto.setTipo_disnostico(lbxTipo_disnostico\r\n\t\t\t\t\t\t.getSelectedItem().getValue().toString());\r\n\t\t\t\this_parto.setTipo_principal(tbxTipo_principal.getValue());\r\n\t\t\t\this_parto.setTipo_relacionado_1(tbxTipo_relacionado_1\r\n\t\t\t\t\t\t.getValue());\r\n\t\t\t\this_parto.setTipo_relacionado_2(tbxTipo_relacionado_2\r\n\t\t\t\t\t\t.getValue());\r\n\t\t\t\this_parto.setTipo_relacionado_3(tbxTipo_relacionado_3\r\n\t\t\t\t\t\t.getValue());\r\n\t\t\t\this_parto.setTratamiento(tbxTratamiento.getValue());\r\n\r\n\t\t\t\tdatos.put(\"codigo_historia\", his_parto);\r\n\t\t\t\tdatos.put(\"accion\", tbxAccion.getText());\r\n\r\n\t\t\t\this_parto = getServiceLocator().getHis_partoService().guardar(\r\n\t\t\t\t\t\tdatos);\r\n\r\n\t\t\t\tif (tbxAccion.getText().equalsIgnoreCase(\"registrar\")) {\r\n\t\t\t\t\taccionForm(true, \"modificar\");\r\n\t\t\t\t}\r\n\r\n\t\t\t\tMessagebox.show(\"Los datos se guardaron satisfactoriamente\",\r\n\t\t\t\t\t\t\"Informacion ..\", Messagebox.OK,\r\n\t\t\t\t\t\tMessagebox.INFORMATION);\r\n\r\n\t\t\t}\r\n\r\n\t\t} catch (Exception e) {\r\n\t\t\t\r\n\t\t\tlog.error(e.getMessage(), e);\r\n\t\t\tMessagebox.show(e.getMessage(), \"Mensaje de Error !!\",\r\n\t\t\t\t\tMessagebox.OK, Messagebox.ERROR);\r\n\t\t}\r\n\r\n\t}", "@Override\n protected void doPost(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n String pagina = \"\";\n int option = Integer.parseInt(request.getParameter(\"option\"));\n int id_proveedor = Integer.parseInt(request.getParameter(\"proveedor\"));\n int id_pedido = Integer.parseInt(request.getParameter(\"pedido_id\"));\n \n \n switch(option) {\n case 1: {\n // CREAR\n int estado = 0;\n pagina=\"/cotizacion/crearCotizacion.jsp\";\n \n //usuarioBean usuario = (usuarioBean) request.getSession().getAttribute(\"usuario\");\n \n int id_fk_pedido = id_pedido;\n int id_fk_usuario = id_proveedor;\n String forma_pago = request.getParameter(\"forma_pago\");\n String descripcion = request.getParameter(\"descripcion\");\n float costo = 0;\n cotizacionBean objCotizacionBean=new cotizacionBean();\n objCotizacionBean.setId_fk_pedido(id_fk_pedido);\n objCotizacionBean.setId_fk_usuario(id_fk_usuario);\n objCotizacionBean.setForma_pago(forma_pago);\n objCotizacionBean.setDescripcion(descripcion);\n objCotizacionBean.setCosto(costo);\n \n cotizacionDAO objcotizacionDAO=new cotizacionDAO();\n estado = objcotizacionDAO.InsertarCotizacion(objCotizacionBean);\n \n //VALIDAR NSERCION\n if(estado == 1) {\n request.setAttribute(\"mensaje\",\"Se envio correctamente\");\n }\n else {\n request.setAttribute(\"mensaje\",\"Fallo al momento de crear\");\n }\n }\n case 3: {\n //ACTUALIZAR\n }\n case 4: {\n //ELIMINAR\n }\n }\n \n getServletContext().getRequestDispatcher(pagina).forward(request, response);\n }", "@GetMapping(\"/add\")\n public String showSocioForm(Model model, Persona persona) {\n List<Cargo> cargos = cargoService.getCargos();\n model.addAttribute(\"cargos\", cargos);\n return \"/backoffice/socioForm\";\n }", "private void preparaForm(String opcao) {\n switch(opcao){\n case \"fill\": { preparaFill(); break; }\n case \"novo\": { preparaNovo(); break; }\n case \"alterar\": { preparaAlterar(); break; }\n case \"cancelar\": { preparaCancelar(); break; }\n case \"salvar\": { preparaSalvar(); break; }\n }\n }", "private void EnviarDatos(String user, String fecha, String pasos){\n\r\n HttpClient httpclient = new DefaultHttpClient();\r\n //Utilizamos la HttpPost para enviar lso datos\r\n //A la url donde se encuentre nuestro archivo receptor\r\n\r\n\r\n\r\n\r\n HttpPost httppost2 = new HttpPost(\"http://mets.itisol.com.mx/paciente/insertaActividad\");\r\n try {\r\n //Añadimos los datos a enviar en este caso solo uno\r\n //que le llamamos de nombre 'a'\r\n //La segunda linea podría repetirse tantas veces como queramos\r\n //siempre cambiando el nombre ('a')\r\n List<NameValuePair> postValues = new ArrayList<NameValuePair>(2);\r\n postValues.add(new BasicNameValuePair(\"usuario\", user));\r\n\r\n postValues.add(new BasicNameValuePair(\"fecha\", fecha));\r\n Log.d(\"la fecha es\", \"\" + cambiaFecha(fecha));\r\n postValues.add(new BasicNameValuePair(\"pasos\", pasos));\r\n\r\n // postValues.add(new BasicNameValuePair(\"tipo\", \"1\"));\r\n\r\n //Encapsulamos\r\n httppost2.setEntity(new UrlEncodedFormEntity(postValues));\r\n //Lanzamos la petición\r\n HttpResponse respuesta2 = httpclient.execute(httppost2);\r\n //Conectamos para recibir datos de respuesta\r\n HttpEntity entity2 = respuesta2.getEntity();\r\n //Creamos el InputStream como su propio nombre indica\r\n InputStream is2 = entity2.getContent();\r\n //Limpiamos el codigo obtenido atraves de la funcion\r\n //StreamToString explicada más abajo\r\n String resultado2= StreamToString(is2);\r\n\r\n //Enviamos el resultado LIMPIO al Handler para mostrarlo\r\n Message sms2 = new Message();\r\n sms2.obj = resultado2;\r\n\r\n puente.sendMessage(sms2);\r\n }catch (IOException e) {\r\n //TODO Auto-generated catch block\r\n }\r\n\r\n }", "protected void nuevo(){\n wp = new frmEspacioTrabajo();\n System.runFinalization();\n inicializar();\n }", "public cambiarContrasenna() {\n initComponents();\n txtNombreUsuario.setEnabled(false);\n inicializarComponentes();\n cargarUsuarios();\n }", "public String inputForm() {\n return inputDataTraveler.validateData();\n }", "private void iniciaFrm() {\n statusLbls(false);\n statusBtnInicial();\n try {\n clientes = new Cliente_DAO().findAll();\n } catch (Exception ex) {\n Logger.getLogger(JF_CadastroCliente.class.getName()).log(Level.SEVERE, null, ex);\n }\n }", "@Override\n protected void doPost(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n String sesion_med = dmmed.ObtenerCodigoSesion();\n Medico medico_sesion = dmmed.VerMedicoPorCodigo(sesion_med);\n String acceder = \"\";\n String accion = request.getParameter(\"accion\");\n if (accion.equalsIgnoreCase(\"Ingresar\")) {\n String codigo = request.getParameter(\"txcodigo\");\n String contraseña = request.getParameter(\"pass\");\n Medico medico = dmmed.Validar(codigo, contraseña);\n if (medico != null) {\n dmmed.AbrirSesion(codigo);\n request.setAttribute(\"medico\", medico);\n acceder = \"medico/interfaz.jsp\";\n } else {\n String mensaje = \"Codigo o contraseña incorrectas\";\n request.getSession().setAttribute(\"mensaje\", mensaje);\n acceder = \"medico/login.jsp\";\n }\n } else if (accion.equalsIgnoreCase(\"Regresar a la interfaz\")) {\n request.setAttribute(\"medico\", medico_sesion);\n acceder = \"medico/interfaz.jsp\";\n } else if (accion.equalsIgnoreCase(\"Buscar Citas\")) {\n String codigo_paciente = request.getParameter(\"codigo_pac\");\n ArrayList<Cita> lista = dmcit.VerCitaActual(codigo_paciente, sesion_med);\n request.setAttribute(\"lista\", lista);\n acceder = \"medico/realizar_cita.jsp\";\n } else if (accion.equalsIgnoreCase(\"Realizar Cita\")) {\n String mensaje = \"Fallo al realizar cita\";\n try {\n String codigo = request.getParameter(\"codigo\");\n String inf = request.getParameter(\"informe\");\n Cita cita = dmcit.VerCitaPorCodigo(codigo);\n if (cita != null) {\n Informe informe = dmcit.ObtenerInforme(codigo);\n if (informe != null) {\n boolean comprobar = dmcit.RealizarCita(cita);\n if (comprobar == true) {\n informe.setDescripcion(inf);\n mensaje = dminf.AgregarInforme(informe);\n } else {\n mensaje = \"Fallo al actualizar cita\";\n }\n } else {\n mensaje = \"Fallo al obtener informe\";\n }\n } else {\n mensaje = \"La cita no existe\";\n }\n } catch (Exception e) {\n mensaje = e.toString();\n }\n request.getSession().setAttribute(\"mensaje_cita\", mensaje);\n acceder = \"medico/realizar_cita.jsp\";\n } else if (accion.equalsIgnoreCase(\"Agendar Examen\")) {\n String alerta = \"Fallo para agendar examen\";\n try {\n int codigo = 0;\n String codigo_paciente = request.getParameter(\"codigo_paciente\");\n String codigo_medico = request.getParameter(\"codigo_medico\");\n String tipo_examen = request.getParameter(\"codigo_examen\");\n Date fecha = Date.valueOf(request.getParameter(\"fecha\"));\n String Orden = request.getParameter(\"orden\");\n\n Examen examen = new Examen(codigo, codigo_paciente, codigo_medico, tipo_examen, fecha);\n boolean comprobar_orden = dmtip.ComprobarOrden(tipo_examen);\n if (comprobar_orden == true) {\n if (Orden != null) {\n String tipo = dmtip.ObtenerTipo(tipo_examen);\n if (\"PDF\".equals(tipo)) {\n if (Orden.endsWith(\".pdf\")) {\n Orden = \"archivos/\" + Orden;\n examen.setOrden(Orden);\n alerta = dmexa.AgendarExamen(examen);\n } else {\n alerta = \"Orden incorrecta\";\n }\n } else if (\"IMG\".equals(tipo)) {\n if (Orden.endsWith(\".jpg\") || Orden.endsWith(\".png\") || Orden.endsWith(\".jepg\")) {\n Orden = \"archivos/\" + Orden;\n examen.setOrden(Orden);\n alerta = dmexa.AgendarExamen(examen);\n } else {\n alerta = \"Orden incorrecta\";\n }\n } else {\n alerta = \"Fallo en el codigo del Tipo de examen\";\n }\n } else {\n alerta = \"Es necesaria la orden y no esta agregada\";\n }\n } else {\n alerta = dmexa.AgendarExamen(examen);\n }\n } catch (Exception e) {\n alerta = e.toString();\n }\n request.getSession().setAttribute(\"alerta_e\", alerta);\n acceder = \"medico/agendar_examen.jsp\";\n } else if (accion.equalsIgnoreCase(\"Ver Historial\")) {\n Paciente paciente = dmpac.VerPacientePorCodigo(request.getParameter(\"codigo_paciente\"));\n request.setAttribute(\"paciente\", paciente);\n acceder = \"medico/reporte1.jsp\";\n } else if (accion.equalsIgnoreCase(\"Obtener Citas\")) {\n String fecha1 = request.getParameter(\"rep2fecha1\");\n String fecha2 = request.getParameter(\"rep2fecha2\");\n ArrayList<Cita> lista = dmcit.ReporteCitasEnIntervaloDeTiempo(sesion_med, fecha1, fecha2);\n request.setAttribute(\"lista\", lista);\n acceder = \"medico/reporte2.jsp\";\n } else if (accion.equalsIgnoreCase(\"Ver Citas\")) {\n String fecha = request.getParameter(\"rep3fecha\");\n ArrayList<Cita> lista = dmcit.ReportesCitasDiaActual(sesion_med, fecha);\n request.setAttribute(\"lista\", lista);\n acceder = \"medico/reporte3.jsp\";\n } else if (accion.equalsIgnoreCase(\"Obtener Conteo\")) {\n String fecha1 = request.getParameter(\"rep4fecha1\");\n String fecha2 = request.getParameter(\"rep4fecha2\");\n ArrayList<Informe> lista = dminf.ReportePacienteConMasInformes(sesion_med, fecha1, fecha2);\n request.setAttribute(\"lista\", lista);\n acceder = \"medico/reporte4.jsp\";\n } else if (accion.equalsIgnoreCase(\"Salir a la pagina principal\")){\n acceder = \"index.jsp\";\n }\n RequestDispatcher pagina = request.getRequestDispatcher(acceder);\n pagina.forward(request, response);\n }", "private void reWriteField(HttpServletRequest request) {\n\t\t// Reesccribir campos\n\t\trequest.setAttribute(\"importe\", importe);\n\t\trequest.setAttribute(\"concepto\", concepto);\n\t\trequest.setAttribute(\"coche\", c);\n\t}", "public void registrarAdministrador() throws IOException {\n\n //asignamos al usuario la imagen de perfil default\n usuarioView.setUsuarioFotoRuta(getPathDefaultUsuario());\n usuarioView.setUsuarioFotoNombre(getNameDefaultUsuario());\n\n //Se genera un login y un pass aleatorio que se le envia al proveedor\n MD5 md = new MD5();\n GenerarPassword pass = new GenerarPassword();\n SendEmail email = new SendEmail();\n\n password = pass.generarPass(6);//Generamos pass aleatorio\n\n //Encriptamos las contraseñas\n usuarioView.setUsuarioPassword(md.getMD5(password));//Se encripta la contreseña\n usuarioView.setUsuarioRememberToken(md.getMD5(password));\n\n //el metodo recibe los atributos, agrega al atributo ciudad del objeto usuario un objeto correspondiente, \n //de la misma forma comprueba el rol y lo asocia, por ultimo persiste el usuario en la base de datos\n usuarioView.setSmsCiudad(ciudadDao.consultarCiudad(usuarioView.getSmsCiudad()));//Asociamos una ciudad a un usuario\n usuarioView.setSmsRol(rolDao.consultarRol(usuarioView.getSmsRol()));//Asociamos un rol a un usuario\n usuarioView.setUsuarioEstadoUsuario(1);//Asignamos un estado de cuenta\n usuarioView.setSmsNacionalidad(nacionalidadDao.consultarNacionalidad(usuarioView.getSmsNacionalidad()));\n\n //registramos el usuario y recargamos la lista de clientes\n usuarioDao.registrarUsuario(usuarioView);\n usuariosListView = adminDao.consultarUsuariosAdministradores();\n\n //Enviar correo\n email.sendEmailAdministradorBienvenida(usuarioView, password);\n\n //limpiamos objetos\n usuarioView = new SmsUsuario();\n password = \"\";\n }", "public void accionForm(boolean sw, String accion) throws Exception {\n\t\tgroupboxConsulta.setVisible(!sw);\n\t\tgroupboxEditar.setVisible(sw);\n\n\t\ttbxAccion.setValue(accion);\n\n\t\tif (!accion.equalsIgnoreCase(\"registrar\")) {\n\t\t\tbuscarDatos();\n\t\t} else {\n\t\t\t// buscarDatos();\n\t\t\tlimpiarDatos();\n\t\t\tif (admision != null) {\n\t\t\t\tcargarInformacion_paciente();\n\t\t\t}\n\t\t}\n\n\t}" ]
[ "0.6590561", "0.6510707", "0.60046107", "0.5979661", "0.5929833", "0.5919049", "0.58768344", "0.587363", "0.5865239", "0.5842126", "0.5819247", "0.5804534", "0.5781964", "0.57690257", "0.57573205", "0.5706824", "0.5682679", "0.5672097", "0.56699896", "0.5627998", "0.56178963", "0.55764246", "0.55651164", "0.5533218", "0.5529153", "0.55183196", "0.55081373", "0.55038285", "0.5487989", "0.5484646", "0.5471164", "0.5451614", "0.5428424", "0.54247564", "0.54197836", "0.5419739", "0.5416411", "0.5410796", "0.54033405", "0.5385413", "0.538089", "0.5368122", "0.5367058", "0.53550416", "0.5354529", "0.53461975", "0.5337739", "0.5336038", "0.53313833", "0.53262275", "0.5314772", "0.53136533", "0.53133905", "0.5307016", "0.5305072", "0.5299403", "0.52933586", "0.5282223", "0.52721596", "0.5260839", "0.5253408", "0.52456295", "0.5243225", "0.52404124", "0.52391684", "0.5234376", "0.52266526", "0.52218974", "0.5220152", "0.5208014", "0.52013296", "0.51895267", "0.51795745", "0.51777136", "0.5176013", "0.5170864", "0.5170141", "0.5167453", "0.51655316", "0.5165381", "0.51609755", "0.5157988", "0.51570284", "0.5156838", "0.51485", "0.51469994", "0.51416093", "0.5137515", "0.51351637", "0.5133699", "0.51283085", "0.5124419", "0.5122705", "0.5121553", "0.51207423", "0.5119034", "0.51098806", "0.51098615", "0.510526", "0.5102933", "0.50978136" ]
0.0
-1
Accion o envio de formularios
@ProcessAction(name = "consultarProyecto") public void consultarProyecto(ActionRequest actionRequest, ActionResponse actionResponse) throws IOException, PortletException { LOGGER.info("ID Proyecto " + ParamUtil.getString(actionRequest, "projectID")); String projectID = ParamUtil.getString(actionRequest, "projectID"); // Hacer campos visibles en jsp actionRequest.setAttribute("projectID", projectID); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@RequestMapping(\"enviar\")\n\tpublic String abrirForm() {\n\t\treturn \"contato/form\";\n\t}", "public void limpiarCamposFormBusqueda() {\n\t}", "public void enviaMotorista() {\n\t\tConector con = new Conector();\r\n\t\tString params[] = new String[2];\r\n\r\n\t\tparams[0] = \"op=4\";\r\n\t\tparams[1] = \"email=\" + usuario;\r\n\r\n\t\tcon.sendHTTP(params);\r\n\t}", "@GetMapping(path = \"/realizar\")\n public ModelAndView getForm(){\n\n return new ModelAndView(ViewConstant.MANTCOMPRASMINO).addObject(\"compraMinorista\", new CompraMinorista());\n }", "public void enviarValoresCabecera(){\n }", "@RequestMapping (value =\"/cadastrarTema\", method=RequestMethod.GET)\n\tpublic String form() {\n\t\treturn \"formTema\";\n\n\t}", "protected RespostaFormularioPreenchido() {\n // for ORM\n }", "private void enviarRequisicaoAdicionar() {\n servidor.adicionarPalito(nomeJogador);\n atualizarPalitos();\n }", "public void enviar(View view) {\n HashMap<String,String> hm = new HashMap<>();\n hm.put(\"cpf\", etCpf.getText().toString());\n hm.put(\"nome\", etNome.getText().toString());\n hm.put(\"endereco\", etEndereco.getText().toString());\n hm.put(\"telefone\", etTelefone.getText().toString());\n hm.put(\"valor\", etValor.getText().toString());\n\n this.pb.setVisibility(ProgressBar.VISIBLE);\n this.inserirController.enviarParaPHP(hm);\n }", "private void readForm() {\n }", "@Override\n protected void doPost(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n String nombre = request.getParameter(\"nombre\");\n String descripcion = request.getParameter(\"descripcion\");\n String cantidad = request.getParameter(\"cantidad\");\n String precio = request.getParameter(\"precio\");\n String pago = request.getParameter(\"pago\");\n \n //creando objeto del costructor\n modelo.ventas venta = new modelo.ventas();\n //almacenando datos en las variables con el constructor \n venta.setNombre(nombre);\n venta.setDescripcion(descripcion);\n venta.setCantidad(Integer.parseInt(cantidad));\n venta.setPrecio(Double.parseDouble(precio));\n venta.setPago(Integer.parseInt(pago));\n \n //creando objeto para guardar cliente\n modelo.addVenta addventa = new modelo.addVenta();\n try {\n addventa.agrega(venta);\n } catch (SQLException ex) {\n Logger.getLogger(formVenta.class.getName()).log(Level.SEVERE, null, ex);\n }\n response.sendRedirect(\"ventas\");//si se guarda exitosamente se redirecciona a membresia\n }", "private void enviarDatos() {\n try {\n if (validarDatos()) { // verificar si todos los datos obligatorios tienen informacion\n // verificar que el usuario de la pantalla presiono el boton YES\n if (obtenerMensajeDeConfirmacion() == JOptionPane.YES_OPTION) {\n llenarEntidadConLosDatosDeLosControles(); // llenar la entidad de Rol con los datos de la caja de texto del formulario\n int resultado = 0;\n switch (opcionForm) {\n case FormEscOpcion.CREAR:\n resultado = ClienteDAL.crear(clienteActual); // si la propiedad opcionForm es CREAR guardar esos datos en la base de datos\n break;\n case FormEscOpcion.MODIFICAR:\n resultado = ClienteDAL.modificar(clienteActual);// si la propiedad opcionForm es MODIFICAR actualizar esos datos en la base de datos\n break;\n case FormEscOpcion.ELIMINAR:\n // si la propiedad opcionForm es ELIMINAR entonces quitamos ese registro de la base de datos\n resultado = ClienteDAL.eliminar(clienteActual);\n break;\n default:\n break;\n }\n if (resultado != 0) {\n // notificar al usuario que \"Los datos fueron correctamente actualizados\"\n JOptionPane.showMessageDialog(this, \"Los datos fueron correctamente actualizados\");\n if (frmPadre != null) {\n // limpiar los datos de la tabla de datos del formulario FrmRolLec\n frmPadre.iniciarDatosDeLaTabla(new ArrayList());\n }\n this.cerrarFormulario(false); // Cerrar el formulario utilizando el metodo \"cerrarFormulario\"\n } else {\n // En el caso que las filas modificadas en el la base de datos sean cero \n // mostrar el siguiente mensaje al usuario \"Sucedio un error al momento de actualizar los datos\"\n JOptionPane.showMessageDialog(this, \"Sucedio un error al momento de actualizar los datos\");\n }\n }\n }\n } catch (Exception ex) {\n // En el caso que suceda un error al ejecutar la consulta en la base de datos \n // mostrar el siguiente mensaje al usuario \"Sucedio un error al momento de actualizar los datos\"\n JOptionPane.showMessageDialog(this, \"Sucedio el siguiente error: \" + ex.getMessage());\n }\n\n }", "@Override\r\n\tpublic void refrescarFormulario() {\n\t\t\r\n\t}", "public String registrarLibroPorFormulario(HttpServletRequest request)\r\n {\r\n StringBuilder salidaTabla=new StringBuilder();\r\n if(request==null)\r\n {\r\n return \"\";\r\n }\r\n if(conexion!=null)\r\n {\r\n try{\r\n //atributos\r\n String nombre,paterno,materno,nacionalidad,titulo;\r\n StringBuilder query=new StringBuilder();\r\n int registro,registro1,codigo_autor,edicion,nroEjemplar;\r\n //sacamos del request a los atributos para autor\r\n materno=request.getParameter(\"materno\");\r\n paterno=request.getParameter(\"paterno\");\r\n nombre=request.getParameter(\"nombre\");\r\n nacionalidad=request.getParameter(\"nacionalidad\");\r\n //sacamos del request los atributos para libro\r\n titulo=request.getParameter(\"titulo\");\r\n edicion=Integer.parseInt(request.getParameter(\"edicion\"));\r\n nroEjemplar=Integer.parseInt(request.getParameter(\"nroEjemplar\"));\r\n //consulta sql\r\n query.append(\" insert into autor(paterno,materno,nombre,nacionalidad) values( \");\r\n query.append(\"'\"+materno+\"',\"+\"'\"+paterno+\"',\"+\"'\"+nombre+\"',\"+\"'\"+nacionalidad+\"')\");\r\n insertLibro=conexion.prepareStatement(query.toString());\r\n registro=insertLibro.executeUpdate();\r\n if(registro==1)\r\n {\r\n codigo_autor=listarUltimoIdAutor();\r\n if(codigo_autor!=0)\r\n {\r\n registro1=registrarLibro1(codigo_autor,titulo,edicion,nroEjemplar);\r\n }\r\n }\r\n }catch(Exception e){\r\n salidaTabla.append(e);\r\n e.printStackTrace();\r\n System.out.println(\"ERROR\");\r\n }\r\n }\r\n return salidaTabla.toString();\r\n }", "@RequestMapping(value=\"/cadastrarUsuario\", method=RequestMethod.GET)\r\n\tpublic String form(){\r\n\t\tSystem.out.println(\">>>>>>>>>>>>>>>>>>>>>cadastrarUsuario<<<<<<<<<<<<<<<<<<<evento/formEvento\");\r\n\t\treturn \"usuario/formUsuario\";\r\n\t}", "@PostMapping (value =\"/cadastrarTema\")\n\tpublic String form (Tema tema) {\n\t\t\n\t\trepository.save(tema);\n\t\treturn \"redirect:/cadastrarTema\";\n\t}", "@Override\n\tpublic String handleRequest(HttpServletRequest req, HttpServletResponse resp) throws Exception {\n\t\tString type = req.getParameter(\"type\");\n\t\treq.setAttribute(\"type\", type);\n\t\tString groupNo = req.getParameter(\"groupNo\");\n\t\treq.setAttribute(\"groupNo\", groupNo);\n\t\t\n\t\treturn \"/board/boardWriteForm.jsp\";\n\t}", "protected void agregarUbicacion(){\n\n\n\n }", "private void initFormulario() {\n btnCadastro = findViewById(R.id.btnCadastro);\n editNome = findViewById(R.id.editNome);\n editEmail = findViewById(R.id.editEmail);\n editSenhaA = findViewById(R.id.editSenha);\n editSenhaB = findViewById(R.id.editSenhaB);\n chTermo = findViewById(R.id.chTermos);\n isFormOk = false;\n }", "@RequestMapping(\"/produtos/form\")\n public String form() {\n return \"produtos/form\";\n }", "@_esCocinero\n public Result crearPaso() {\n Form<Paso> frm = frmFactory.form(Paso.class).bindFromRequest();\n\n // Comprobación de errores\n if (frm.hasErrors()) {\n return status(409, frm.errorsAsJson());\n }\n\n Paso nuevoPaso = frm.get();\n\n // Comprobar autor\n String key = request().getQueryString(\"apikey\");\n if (!SeguridadFunctions.esAutorReceta(nuevoPaso.p_receta.getId(), key))\n return Results.badRequest();\n\n // Checkeamos y guardamos\n if (nuevoPaso.checkAndCreate()) {\n Cachefunctions.vaciarCacheListas(\"pasos\", Paso.numPasos(), cache);\n Cachefunctions.vaciarCacheListas(\"recetas\", Receta.numRecetas(), cache);\n return Results.created();\n } else {\n return Results.badRequest();\n }\n\n }", "private void submitForm() {\n // Build list params\n List<NameValuePair> list = new ArrayList<>();\n list.add(new BasicNameValuePair(\"tag\", AppConfig.TAG_LOGIN));\n list.add(new BasicNameValuePair(\"username\", editTextLogin.getText().toString()));\n list.add(new BasicNameValuePair(\"password\", editTextPassword.getText().toString()));\n\n ConnectionTask connectionTask = new ConnectionTask(this, list);\n connectionTask.execute();\n }", "@Override\r\n\tprotected String requestText() {\n\t\tGuardarVtaCeroMotivoRequest guardarVtaCeroMotivoRequest = new GuardarVtaCeroMotivoRequest();\r\n\t\tguardarVtaCeroMotivoRequest.setAnio(Anio);\r\n\t\tguardarVtaCeroMotivoRequest.setCodCliente(codCliente);\r\n\t\tguardarVtaCeroMotivoRequest.setCodDeposito(codDeposito);\r\n\t\tguardarVtaCeroMotivoRequest.setMes(Mes);\r\n\t\tguardarVtaCeroMotivoRequest.setMotivo(Motivo);\r\n\t\tguardarVtaCeroMotivoRequest.setObservacion(observacion);\r\n\t\tguardarVtaCeroMotivoRequest.setSemana(Semana);\r\n\t\tguardarVtaCeroMotivoRequest.setUsuario(Usuario);\r\n\t\tString request = JSONHelper.serializar(guardarVtaCeroMotivoRequest);\r\n\t\treturn request;\r\n\t}", "@RequestMapping(value=\"admin/agregar_paquetes\", method=RequestMethod.GET)\n\tpublic ModelAndView formPaquetes(ModelAndView model) throws IOException{\n\n\t\tModelAndView model2 = new ModelAndView();\n\t\tmodel2.setViewName(\"agregar_paquete_admin\");\t \n\t\t\n\t\treturn model2;\n\n\t}", "@RequestMapping(\"cargaIOFinales.do\")\n\tpublic ModelAndView cargaFormulario(final HttpServletRequest req,\n\t\t\tfinal HttpServletResponse res) throws BusinessException {\n\t\tfinal String metodo = \"cargaFormulario()\";\n\t\tthis.info(\"Inicio de ejecucion del metodo \" + metodo);\n\t\tfinal Object objeto = req.getSession().getAttribute(MODULOS_PERMITIDOS);\n\t\tValidadorAccesoPantallas.validarAcceso(objeto, MODULO, PANTALLA);\n\t\tthis.info(\"Se direcciona al usuario hacia la pagina \" + PAGINA_CARGA_IO);\n\t\tthis.info(\"Fin de ejecucion del metodo \" + metodo);\n\t\treturn new ModelAndView(PAGINA_CARGA_IO);\n\t}", "public ServerskaForma() {\n initComponents();\n \n \n \n }", "@RequestMapping(value=\"admin/agregar_agencias\", method=RequestMethod.GET)\n\tpublic ModelAndView formAgencias(ModelAndView model) throws IOException{\n\n\t\tModelAndView model2 = new ModelAndView();\n\t\tmodel2.setViewName(\"agregar_agencia_admin\");\t \n\t\t\n\t\treturn model2;\n\n\t}", "private void mostrarNovoForm(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {\n\t\tRequestDispatcher dispatcher = request.getRequestDispatcher(\"usuario-form.jsp\");\n\t\tdispatcher.forward(request, response);\n\t\t\n\t}", "@Override\n\tprotected BaseProcesoForm devuelveFormProceso() throws Exception {\n\t\tProcesoBASLoggerForm objForm = new ProcesoBASLoggerForm();\n\t\treturn objForm;\n\t}", "public SalidaCajaForm() {\n\t\tinicializarComponentes();\n }", "public Result inicioGenerarLibro(){\n ContabilidadDTO dto = new ContabilidadDTO();\n dto.tipoLibro = new Parametro(\"\",\"LVEN\",\"\");\n //dto.tipoLibro.id.codigo =\"LVEN\";\n dto.anio = new Parametro(\"\",\"2018\",\"\");\n //dto.anio.id.codigo =\"2018\";\n dto.mes = new Parametro(\"\",\"3\",\"\");\n //dto.mes.id.codigo =\"3\"; //Simpre debe ser el mes anterior al actual\n\n Form<ContabilidadDTO> contabilidadDTOForm = formFactory.form(ContabilidadDTO.class).fill(dto);\n\n/*\n EbeanServer db = DBConnectionUtil.getDBServerFacturador();\n List<BandejaFactura> lista = db.find(BandejaFactura.class).findList();; //BandejaFactura.find.all();//obtenerTodos();\n for (BandejaFactura x:lista) {\n System.out.println(x);\n }\n*/\n/*\n EbeanServer db = DBConnectionUtil.getDBServerSGV();\n List<ControlVenta> lista = db.find(ControlVenta.class)\n .where().ilike(\"CVNT_NUM_DOCUMENTO\", \"F002-00000213\")\n .findList();\n for (ControlVenta x:lista) {\n System.out.println(\"*********** \"+x);\n }\n*/\n/*\n EbeanServer db = DBConnectionUtil.getDBServerSGV();\n List<ControlVenta> lista = db.find(ControlVenta.class).findList();; //BandejaFactura.find.all();//obtenerTodos();\n for (ControlVenta x:lista) {\n System.out.println(x);\n }\n*/\n\n return ok(generadorLibrosContables.render(contabilidadDTOForm));\n }", "private void razia(){\n /* Mereset semua Error dan fokus menjadi default */\n mViewUser.setError(null);\n mViewPassword.setError(null);\n View fokus = null;\n boolean cancel = false;\n\n /* Mengambil text dari form User dan form Password dengan variable baru bertipe String*/\n String user = mViewUser.getText().toString();\n String password = mViewPassword.getText().toString();\n\n /* Jika form user kosong atau TIDAK memenuhi kriteria di Method cekUser() maka, Set error\n * di Form User dengan menset variable fokus dan error di Viewnya juga cancel menjadi true*/\n if (TextUtils.isEmpty(user)){\n mViewUser.setError(\"This field is required\");\n fokus = mViewUser;\n cancel = true;\n }else if(!cekUser(user)){\n mViewUser.setError(\"This Username is not found\");\n fokus = mViewUser;\n cancel = true;\n }\n\n /* Sama syarat percabangannya dengan User seperti di atas. Bedanya ini untuk Form Password*/\n if (TextUtils.isEmpty(password)){\n mViewPassword.setError(\"This field is required\");\n fokus = mViewPassword;\n cancel = true;\n }else if (!cekPassword(password)){\n mViewPassword.setError(\"This password is incorrect\");\n fokus = mViewPassword;\n cancel = true;\n }\n\n /* Jika cancel true, variable fokus mendapatkan fokus */\n if (cancel) fokus.requestFocus();\n else masuk();\n }", "@Override\n\tprotected void entrada(WebRequestContext request, Ocorrencia form) throws Exception {\t\t\n\t\tif (!\"true\".equals(request.getParameter(\"reload\"))) {\n\t\t\tFiltroUtils.preencheFiltroPlanoGestaoUnidadeUsuario(form);\n\t\t}\n\t\t\n\t\t//Se for uma nova ocorrência será dada a opção de gerar uma anomalia.\n\t\tif(form.getId() == null){\n\t\t\trequest.setAttribute(\"opcaoCriarAnomalia\", true);\n\n\t\t\t//seta a data e o usuario que esta logado\n\t\t\tform.setDataLancamento(new Date(System.currentTimeMillis()));\n\t\t\tform.setRelator((Usuario)request.getUser());\t\t\t\n\t\t}\n\t\t//Senão será apenas editada.\n\t\telse {\n\t\t\trequest.setAttribute(\"opcaoCriarAnomalia\", false);\n\t\t\tif(!anomaliaService.fazParteAnomalia(form)){\n\t\t\t\trequest.setAttribute(\"opcaoCriarAnomalia\", true);\n\t\t\t}\n\t\t\t\n\t\t\tif (!usuarioService.isUsuarioLogadoAdmin()) {\n\t\t\t\trequest.setAttribute(\"editarSomenteSituacao\", Boolean.TRUE);\n\t\t\t}\t\t\t\n\t\t}\n\t\t\n\t}", "@GetMapping(\"/createRegistro\")\n\tpublic String crearValidacion(Model model) {\n\t\tList<Barrio> localidades = barrioService.obtenerBarrios();\n\t\tmodel.addAttribute(\"localidades\",localidades);\n\t\tmodel.addAttribute(\"persona\",persona);\n\t\tmodel.addAttribute(\"validacion\",validacion);\n\t\tmodel.addAttribute(\"registro\",registro);\n\t\tmodel.addAttribute(\"barrio\",barrio);\n\t\treturn \"RegistroForm\";\n\t}", "public abstract String toFORMParam();", "protected void processRequest(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n response.setContentType(\"text/html;charset=UTF-8\");\n \n String operacion=request.getParameter(\"btnSubmit\");\n \n switch(operacion)\n {\n case \"Registrar\":\n Trabajadores Trabajadores=new Trabajadores();\n \n Trabajadores.setNombres(request.getParameter(\"txtNombres\"));\n Trabajadores.setApellidos(request.getParameter(\"txtApellidos\"));\n Trabajadores.setTipo_documento(request.getParameter(\"ddlTipoDocumento\"));\n Trabajadores.setNum_documento(request.getParameter(\"txtNumDocumento\"));\n Trabajadores.setDireccion(request.getParameter(\"txtDireccion\"));\n Trabajadores.setTelefono(request.getParameter(\"txtTelefono\"));\n Trabajadores.setEmail(request.getParameter(\"txtEmail\"));\n Trabajadores.setSueldo(request.getParameter(\"txtSueldo\"));\n Trabajadores.setRol(request.getParameter(\"txtRol\"));\n Trabajadores.setLogin(request.getParameter(\"txtLogin\"));\n Trabajadores.setPassword(request.getParameter(\"txtPassword\"));\n \n \n String result= Trabajadores.insertar(Trabajadores);\n \n // para crear variables que se envian por el response\n request.setAttribute(\"mensaje\",result);\n //para redicionar y enviar las variables\n request.getRequestDispatcher(\"RegistrarTrabajadores.jsp\").forward(request, response);\n \n break;\n \n case \"Actualizar\":\n break;\n }\n }", "public ingresarDatos() {\n initComponents();\n Validacion();\n \n }", "@GetMapping(value = \"/utilisateur/inscription\")\n public String inscriptionForm(Model model){\n Utilisateur utilisateur=new Utilisateur();\n logger.info(\"Un visiteur veut accéder au formulaire d'inscription\");\n model.addAttribute(\"utilisateur\",utilisateur);\n return \"inscription\";\n }", "private void llamarFormulario(String ruta, Map<String, Object> parametros){\n\t\tcrearModal(BasePackageSistemaMaest+ruta, parametros);\n\t}", "public void Continuar (View view)\n {\n Intent continuar = new Intent( this, Formulario2.class);\n continuar.putExtra(\"nombre\",et_nombre.getText().toString());\n continuar.putExtra(\"apellido\",et_apellido.getText().toString());\n continuar.putExtra(\"telefono\",et_telefono.getText().toString());\n continuar.putExtra(\"email\",et_email.getText().toString());\n continuar.putExtra(\"direccion\",et_direccion.getText().toString());\n continuar.putExtra(\"fecha\",et_fecha.getText().toString());\n continuar.putExtra(\"spinner1\",s1.getSelectedItem().toString());\n continuar.putExtra(\"spinner2\",s2.getSelectedItem().toString());\n startActivity(continuar );\n }", "public FormaServer() {\n initComponents();\n srediFormu();\n \n }", "@GetMapping(\"/form\")\n\tpublic String form() {\n\t\treturn \"form\";\n\t}", "public creacionempresa() {\n initComponents();\n mostrardatos();\n }", "@Override\n protected void doPost(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n \n \n String id_entrada=request.getParameter(\"id_entrada\");\n String fecha_entrada=request.getParameter(\"fecha_entrada\");\n String cantidad=request.getParameter(\"cantidad\");\n String id_material=request.getParameter(\"id_material\");\n \n Entradamaterial e=new Entradamaterial();\n e.setId_entrada(id_entrada);\n e.setFecha_entrada(fecha_entrada);\n e.setCantidad(cantidad);\n e.setId_material(id_material);\n \n if(EntradamaterialDao.registrar(e)){\n request.setAttribute(\"mensaje\", \"La entrada fue registrada\");\n } else {\n request.setAttribute(\"mensaje\", \"La entrada NO fue registrada\");\n }\n request.getRequestDispatcher(\"RegistroEntrada.jsp\").forward(request, response);\n }", "public ActionForward A_GenerarPlanillaProrroga(ActionMapping mapping, ActionForm form,\n HttpServletRequest request, HttpServletResponse response)\n throws Exception {\n\n //Salidas\n final String[] SALIDAS = {\"V_GestionarProrroga\", \"A_Pre_GestionarProrroga\", };\n final int SALIDA_0 = 0;\n final int SALIDA_1 = 1;\n\n int salida = SALIDA_0;\n Session s = HibernateUtil.getCurrentSession();\n Transaction tr = s.beginTransaction();\n try {\n /*aqui empieza*/\n EstRealizaProy student = (EstRealizaProy)s.createQuery(\"from EstRealizaProy where tipoproy='1' and carnetestudiante= :login\").setString(\"login\", (String)request.getSession().getAttribute(\"login\")).uniqueResult();\n Estudiante estudiante =(Estudiante)s.createQuery(\"from Estudiante where carnete = :login\").setString(\"login\", (String)request.getSession().getAttribute(\"login\")).uniqueResult();\n PreInsPasantias consulta = (PreInsPasantias)s.createQuery(\"from PreInsPasantias where estudiante = :login\").setString(\"login\", (String)request.getSession().getAttribute(\"login\")).uniqueResult();\n\n if (estudiante != null) {\n\n String carnet = (String)request.getSession().getAttribute(\"login\");\n Prorroga fF_Prorroga = (Prorroga) s.createQuery(\"from Prorroga where idc= :carnet\").setString(\"carnet\", carnet).uniqueResult();;\n String coordinacion = fF_Prorroga.getCoordinacion();\n String nombre = fF_Prorroga.getNombre();\n String codigoTutorAcademico = fF_Prorroga.getCodigoTutorAcademico();\n String tituloPasantia = fF_Prorroga.getTituloPasantia();\n String areaProyecto = fF_Prorroga.getAreaProyecto();\n String fecha = fF_Prorroga.getFecha();\n String justificacion = fF_Prorroga.getJustificacion();\n \n String path = getServlet().getServletContext().getRealPath(\"/\")+ \"../../img/\";\n\n /**************************************/\n /* PDF */\n /**************************************/\n try {\n Document pdf = new Document(PageSize.LETTER);\n\n response.setContentType(\"application/pdf4\");\n response.setHeader(\"Content-Disposition\", \" inline; filename=PlanillaProrroga.pdf\");\n\n PdfWriter.getInstance(pdf, response.getOutputStream());\n\n pdf.open();\n\n // Logo\n Image logo = Image.getInstance(path +\"logo.png\");\n logo.scaleToFit(197, 81);\n logo.setAlignment(Image.ALIGN_LEFT);\n pdf.add(logo);\n\n // Pie\n Image pie = Image.getInstance(path +\"pie.png\");\n pie.scaleToFit(500, 216);\n pie.setAbsolutePosition(40, 20);\n pdf.add(pie);\n\n Font font = FontFactory.getFont(\"Arial\", BaseFont.IDENTITY_H, 12);\n font.setStyle(Font.BOLD);\n\n Font font2 = FontFactory.getFont(\"Arial\", BaseFont.IDENTITY_H, 13);\n font2.setStyle(Font.UNDERLINE);\n font2.setStyle(Font.BOLD);\n\n Paragraph titulo = new Paragraph(\"PERMISO PARA PASANTIA (Prorroga)\", font2);\n titulo.setAlignment(Paragraph.ALIGN_CENTER);\n pdf.add(titulo);\n\n Paragraph blank = new Paragraph(\"\\n\");\n\n pdf.add(blank);\n pdf.add(blank);\n\n Phrase est = new Phrase(\"Coordinación de: \"+ coordinacion , font);\n pdf.add(est);\n pdf.add(blank);\n\n est = new Phrase(\"Nombre: \" + nombre +\" Carnet: \"+ carnet, font);\n pdf.add(est);\n pdf.add(blank);\n\n Paragraph pfecha= new Paragraph(\"*Fecha Propuesta: \"+fecha);\n pfecha.setAlignment(Paragraph.ALIGN_CENTER);\n pdf.add(pfecha);\n\n pfecha= new Paragraph(\"_______________________________________________________________________\", font);\n pfecha.setAlignment(Paragraph.ALIGN_CENTER);\n pdf.add(pfecha);\n pdf.add(blank);\n\n pfecha= new Paragraph(\"Pasantía\", font2);\n pfecha.setAlignment(Paragraph.ALIGN_CENTER);\n pdf.add(pfecha);\n pdf.add(blank);\n\n if (tituloPasantia.equals(\"3420\")){\n pfecha= new Paragraph(\"Pasantía Larga (3420) \"+ \"Periodo: \" + areaProyecto, font);\n }\n if (tituloPasantia.equals(\"2420\")){\n pfecha= new Paragraph(\"Pasantía Media (2420) \"+ \"Periodo: \" + areaProyecto, font);\n }\n if (tituloPasantia.equals(\"1420\")){\n pfecha= new Paragraph(\"Pasantía Corta (1420) \"+ \"Periodo: \" + areaProyecto, font);\n }\n\n pfecha.setAlignment(Paragraph.ALIGN_CENTER);\n pdf.add(pfecha);\n pdf.add(blank);\n\n pdf.add(blank);\n\n est = new Phrase(\"*Tutor Academico: \"+codigoTutorAcademico , font);\n pdf.add(est);\n\n est = new Phrase(\" Firma:_____________________\" , font);\n pdf.add(est);\n pdf.add(blank);\n\n pfecha= new Paragraph(\"Justificacion: \",font);\n pdf.add(pfecha);\n pdf.add(blank);\n pfecha= new Paragraph( justificacion);\n pdf.add(pfecha);\n pdf.add(blank);\n pdf.add(blank);\n\n est = new Phrase(\"Observaciones:______________________________________________________\");\n pdf.add(est);\n pdf.add(blank);\n\n est = new Phrase(\"Firma y Sello Coordinación:______________________________\" , font);\n pdf.add(est);\n pdf.add(blank);\n\n est = new Phrase(\"Firma CCTDS:_____________________________________________\" , font);\n pdf.add(est);\n pdf.add(blank);\n\n pdf.close();\n\n } catch (Exception e) {\n e.printStackTrace();\n }\n\n /**************************************/\n /* PDF */\n /**************************************/\n\n }else{\n salida = SALIDA_1;\n }\n\n /*aqui termina*/\n tr.commit();\n\n } catch (Exception ex) {\n tr.rollback();\n throw ex;\n } finally {\n try { s.close(); } catch (Exception ex2) {}\n }\n if (salida==0) {\n request.setAttribute(\"msg\",\n getResources(request).getMessage(\"A_Pre_ConsultarPlanillaProrroga.msg0\"));\n }\n if (salida==1) {\n request.setAttribute(\"msg\",\n getResources(request).getMessage(\"A_Pre_ConsultarPlanillaProrroga.msg1\"));\n }\n\n return mapping.findForward(SALIDAS[salida]);\n }", "@Override\n protected void doPost(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n String dni = request.getParameter(\"dni\");\n String nombres = request.getParameter(\"nombres\");\n String apellido = request.getParameter(\"apellido\");\n //String fechaNacimiento = request.getParameter(\"fechaNacimiento\");\n LocalDate fechaNacimiento = LocalDate.parse(request.getParameter(\"fechaNacimiento\"));\n \n String direccion = request.getParameter(\"direccion\");\n String cargo = request.getParameter(\"cargo\");\n int usuario = Integer.parseInt(request.getParameter(\"usuario\"));\n \n //DateTimeFormatter formatter = DateTimeFormatter.ofPattern(\"dd/MM/yyyy\");\n //LocalDate date = LocalDate.parse(fechaNacimiento, formatter);\n \n //LLamamos a la controladora de la Logica\n EmpleadoControladora controlEmpleado = new EmpleadoControladora();\n if (usuario != 0 ){\n controlEmpleado.crearEmpleado(dni, nombres, apellido, fechaNacimiento, direccion, cargo, usuario);\n } else {\n controlEmpleado.crearEmpleadoSinUser(dni, nombres, apellido, fechaNacimiento, direccion, cargo);\n }\n \n //Armamos la redireccion\n response.sendRedirect(\"SvEmpleadoList\");\n }", "@Override\n public ExtensionResult dogetFormcuti(ExtensionRequest extensionRequest) {\n\n Map<String, String> output = new HashMap<>();\n String formId = appProperties.getFormIdCuti();\n FormBuilder formBuilder = new FormBuilder(formId);\n ButtonTemplate button = new ButtonTemplate();\n button.setTitle(\"Form Cuti\");\n button.setSubTitle(\"Form Cuti\");\n button.setPictureLink(Image_cuti);\n button.setPicturePath(Image_cuti);\n List<EasyMap> actions = new ArrayList<>();\n EasyMap bookAction = new EasyMap();\n bookAction.setName(\"Isi Form\");\n bookAction.setValue(formBuilder.build());\n// bookAction.setValue(appProperties.getShortenFormCuti());\n actions.add(bookAction);\n button.setButtonValues(actions);\n ButtonBuilder buttonBuilder = new ButtonBuilder(button);\n\n output.put(OUTPUT, buttonBuilder.build());\n ExtensionResult extensionResult = new ExtensionResult();\n extensionResult.setAgent(false);\n extensionResult.setRepeat(false);\n extensionResult.setSuccess(true);\n extensionResult.setNext(true);\n extensionResult.setValue(output);\n return extensionResult;\n }", "public void inicializar() {\r\n\t\ttry {\r\n\t\t\tJFrame.setDefaultLookAndFeelDecorated(true);\r\n\t\t\tUIManager.setLookAndFeel(\"com.jtattoo.plaf.hifi.HiFiLookAndFeel\");\r\n\t\t} catch (Exception e) {\r\n\t\t\te.printStackTrace();\r\n\t\t}\r\n\r\n\t\tgetContentPane().setLayout(null);\r\n\r\n\t\tlblUsuario = new JLabel(\"Mail Empleado:\");\r\n\t\tlblUsuario.setBounds(40, 40, 124, 20);\r\n\t\tgetContentPane().add(lblUsuario);\r\n\r\n\t\tlblPass = new JLabel(\"Contraseña:\");\r\n\t\tlblPass.setBounds(40, 72, 124, 20);\r\n\t\tgetContentPane().add(lblPass);\r\n\r\n\t\tlblConfPass = new JLabel(\"Confirmación Contraseña:\");\r\n\t\tlblConfPass.setBounds(40, 104, 220, 20);\r\n\t\tgetContentPane().add(lblConfPass);\r\n\r\n\t\ttxtUsuario = new JTextField();\r\n\t\ttxtUsuario.setBounds(275, 40, 138, 20);\r\n\t\tgetContentPane().add(txtUsuario);\r\n\t\ttxtUsuario.setColumns(10);\r\n\r\n\t\tpwdPass = new JPasswordField();\r\n\t\tpwdPass.setEchoChar('*'); // quitamos valor\r\n\t\tpwdPass.setBounds(275, 72, 138, 20);\r\n\t\tgetContentPane().add(pwdPass);\r\n\r\n\t\tpwdConfPass = new JPasswordField();\r\n\t\tpwdConfPass.setEchoChar('*');\r\n\t\tpwdConfPass.setBounds(275, 104, 138, 20);\r\n\t\tgetContentPane().add(pwdConfPass);\r\n\r\n\t\tbtnRegistrar = new JButton(\"Registrar\");\r\n\t\tbtnRegistrar.addActionListener(new ActionListener() {\r\n\t\t\tpublic void actionPerformed(ActionEvent arg0) {\r\n\t\t\t\t// recuperamos los datos introducidos y los volcamos en BD\r\n\t\t\t\tUsuarioPojo user = null;\r\n\t\t\t\tUsuarioPersistencia up = new UsuarioPersistencia();\r\n\r\n\t\t\t\t//int id = up.obtenerIdEmple();\r\n\t\t\t\tString usuarioMail = txtUsuario.getText();\r\n\t\t\t\tString password = new String(pwdPass.getPassword()); // DNI de momento\r\n\t\t\t\tString passwordC = new String(pwdConfPass.getPassword());\r\n\t\t\t\tString apenom = txtApenom.getText();\r\n\t\t\t\tString dni = txtDni.getText();\r\n\t\t\t\tint numSS = Integer.parseInt(txtSegSoc.getText());\r\n\t\t\t\tString cuenta = txtCuenta.getText();\r\n\r\n\t\t\t\tif (password.equals(passwordC)) {\r\n\t\t\t\t\t// creamos un objeto usuario si coinciden las contraseñas\r\n\t\t\t\t\tuser = new UsuarioPojo(apenom, numSS, cuenta, dni, usuarioMail, password);\r\n\t\t\t\t}\r\n\r\n\t\t\t\tif (user != null) {\r\n\t\t\t\t\t// insertaremos el usuario si coinciden las contraseñas\r\n\t\t\t\t\tup = new UsuarioPersistencia();\r\n\t\t\t\t\tint res = up.insertarUser(user);\r\n\r\n\t\t\t\t\tif (res == 1) { // se habrá registrado al usuario\r\n\t\t\t\t\t\tSystem.out.println(\"Insertado correctamente\");\r\n\t\t\t\t\t\tJOptionPane.showMessageDialog(null, \"Registro insertado correctamente\",\r\n\t\t\t\t\t\t\t\t\"Resultado del Registro\", JOptionPane.INFORMATION_MESSAGE);\r\n\t\t\t\t\t\tdispose(); // dispose cierra ventana actual, System.exit(0) sale del programa\r\n\t\t\t\t\t}\r\n\t\t\t\t} else {\r\n\t\t\t\t\t// mostramos msg si no coinciden las contraseñas, manteniendo el control en dreg\r\n\t\t\t\t\tSystem.out.println(\"No insertado\");\r\n\t\t\t\t\tJOptionPane.showMessageDialog(null, \"Contraseñas introducidas no coinciden\", \"Error de contraseña\",\r\n\t\t\t\t\t\t\tJOptionPane.WARNING_MESSAGE);\r\n\t\t\t\t\t// limpiamos campos de contraseña\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t});\r\n\t\tbtnRegistrar.setBounds(305, 285, 90, 23);\r\n\t\tgetContentPane().add(btnRegistrar);\r\n\r\n\t\tchckbxMostrarPass1 = new JCheckBox(\"Mostrar contraseña\");\r\n\t\tchckbxMostrarPass1.setBounds(470, 71, 175, 23);\r\n\t\t// añadimos un listener para poder mostrar la contraseña como texto\r\n\t\tchckbxMostrarPass1.addActionListener(new ActionListener() {\r\n\t\t\tpublic void actionPerformed(ActionEvent e) {\r\n\t\t\t\tif (chckbxMostrarPass1.isSelected()) {\r\n\t\t\t\t\tpwdPass.setEchoChar((char) 0);\r\n\t\t\t\t} else {\r\n\t\t\t\t\tpwdPass.setEchoChar('*');\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t});\r\n\t\tgetContentPane().add(chckbxMostrarPass1);\r\n\r\n\t\tchckbxMostrarPass2 = new JCheckBox(\"Mostrar contraseña\");\r\n\t\tchckbxMostrarPass2.setBounds(470, 103, 175, 23);\r\n\t\tchckbxMostrarPass2.addActionListener(new ActionListener() {\r\n\t\t\tpublic void actionPerformed(ActionEvent e) {\r\n\t\t\t\tif (chckbxMostrarPass2.isSelected()) {\r\n\t\t\t\t\tpwdConfPass.setEchoChar((char) 0);\r\n\t\t\t\t} else {\r\n\t\t\t\t\tpwdConfPass.setEchoChar('*');\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t});\r\n\t\tgetContentPane().add(chckbxMostrarPass2);\r\n\r\n\t\tlblApenom = new JLabel(\"Nombre y Apellidos:\");\r\n\t\tlblApenom.setBounds(40, 136, 220, 20);\r\n\t\tgetContentPane().add(lblApenom);\r\n\r\n\t\ttxtApenom = new JTextField();\r\n\t\ttxtApenom.setBounds(275, 136, 270, 20);\r\n\t\tgetContentPane().add(txtApenom);\r\n\t\ttxtApenom.setColumns(10);\r\n\r\n\t\tlblSegSoc = new JLabel(\"Nº Seguridad Social:\");\r\n\t\tlblSegSoc.setBounds(40, 200, 220, 20);\r\n\t\tgetContentPane().add(lblSegSoc);\r\n\r\n\t\ttxtSegSoc = new JTextField();\r\n\t\ttxtSegSoc.setBounds(275, 200, 138, 20);\r\n\t\tgetContentPane().add(txtSegSoc);\r\n\t\ttxtSegSoc.setColumns(10);\r\n\r\n\t\tlblCuenta = new JLabel(\"Nº Cuenta Bancaria:\");\r\n\t\tlblCuenta.setBounds(40, 232, 200, 20);\r\n\t\tgetContentPane().add(lblCuenta);\r\n\r\n\t\ttxtCuenta = new JTextField();\r\n\t\ttxtCuenta.setBounds(275, 232, 138, 20);\r\n\t\tgetContentPane().add(txtCuenta);\r\n\t\ttxtCuenta.setColumns(10);\r\n\r\n\t\tlblDniUser = new JLabel(\"DNI:\");\r\n\t\tlblDniUser.setBounds(40, 168, 124, 20);\r\n\t\tgetContentPane().add(lblDniUser);\r\n\r\n\t\ttxtDni = new JTextField();\r\n\t\ttxtDni.setColumns(10);\r\n\t\ttxtDni.setBounds(275, 168, 138, 20);\r\n\t\tgetContentPane().add(txtDni);\r\n\r\n\t\t// cambiamos EXIT por DISPOSE, porque solo queremos que cierre esta ventana, no\r\n\t\t// que me salga del programa definitivamente\r\n\t\tsetDefaultCloseOperation(WindowConstants.DISPOSE_ON_CLOSE);\r\n\t\tsetBounds(250, 250, 700, 380);\r\n\t\tthis.setLocationRelativeTo(null); // para que centre en pantalla\r\n\t}", "public tambahtoko() {\n initComponents();\n tampilkan();\n form_awal();\n }", "protected void processRequest(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n response.setContentType(\"text/html;charset=UTF-8\");\n try (PrintWriter out = response.getWriter()) {\n /* TODO output your page here. You may use following sample code. */\n String nombreParametro=null;\n String[]valoresParametro=null;\n Iterator it;\n String nombre= request.getParameter(\"nombre\");\n String cadena = request.getParameter(\"telefono\") ;\n out.println(\"<!DOCTYPE html>\");\n out.println(\"<html>\");\n out.println(\"<head>\");\n out.println(\"<title>Servlet registro</title>\"); \n out.println(\"</head>\");\n out.println(\"<body>\");\n out.println(\"<form action=\\\"registro\\\" method=\\\"post\\\">\");\n \n if (nombre == \"\"){\n \n out.println(\" <p><label for=\\\"nombre\\\"> Nombre </label>&nbsp;&nbsp;\");\n out.println( \"<input type=\\\"text\\\" id value= \\\"\"+nombre+\"\\\" > \");\n out.println(\"</br>\");\n \n \n }else{\n out.println(\" <p><label for=\\\"nombre\\\"> Nombre </label>&nbsp;&nbsp;\");\n out.println(request.getParameter(\"nombre\"));\n }\n if (request.getParameter(\"apellido\")==\"\"){\n \n out.println(\" <p><label for=\\\"apellido\\\"> Apellido </label>&nbsp;&nbsp;\");\n out.println( \"<input type=\\\"text\\\" id value= \\\"\"+request.getParameter(\"apellido\")+\"\\\" > \");\n out.println(\"</br>\");\n \n \n }else{\n out.println(\" <p><label for=\\\"nombre\\\"> Apellido </label>&nbsp;&nbsp;\");\n out.println(request.getParameter(\"apellido\"));\n }\n \n if (request.getParameter(\"usuario\")==\"\"){\n out.println(\" <p><label for=\\\"usuario\\\"> Usuario </label>&nbsp;&nbsp;\");\n out.println( \"<input type=\\\"text\\\" id value= \\\"\"+request.getParameter(\"usuario\")+\"\\\" > \");\n out.println(\"</br>\");\n }else{\n out.println(\" <p><label for=\\\"usuario\\\"> Usuario </label>&nbsp;&nbsp;\");\n out.println(request.getParameter(\"usuario\"));\n }\n \n if (request.getParameter(\"contrasena\")==\"\"){\n out.println(\" <p><label for=\\\"contraseña\\\"> Contraseña </label>&nbsp;&nbsp;\");\n out.println( \"<input type=\\\"text\\\" id value= \\\"\"+request.getParameter(\"contrasena\")+\"\\\" > \");\n out.println(\"</br>\");\n }else{\n out.println(\" <p><label for=\\\"contraseña\\\"> Contraseña </label>&nbsp;&nbsp;\");\n out.println(request.getParameter(\"contrasena\"));\n }\n \n if (cadena.length() != 9 || !cadena.startsWith(\"6\") || !cadena.startsWith(\"7\") || !cadena.startsWith(\"9\")) {\n out.println(\" <p><label for=\\\"telefono\\\"> Telefono </label>&nbsp;&nbsp;\");\n out.println( \"<input type=\\\"text\\\" id value= \\\"\"+request.getParameter(\"telefono\")+\"\\\" > \");\n out.println(\"</br>\");\n }else{\n out.println(\" <label for=\\\"telefono\\\"> Telefono </label>&nbsp;&nbsp;\");\n out.println(request.getParameter(\"telefono\")); \n }\n if (request.getParameter(\"sexo\")==null){\n out.println(\"<label>Sexo :</label> &nbsp;&nbsp;\");\n out.println(\"<label>Hombre :</label>&nbsp;&nbsp;\");\n out.println(\"<input type=\\\"radio\\\" name=\\\"sexo\\\" value=\\\"hombre\\\" >\");\n out.println(\"<label>Mujer :</label>&nbsp;&nbsp;\");\n out.println(\"<input type=\\\"radio\\\" name=\\\"sexo\\\" value=\\\"mujer\\\" >\");\n \n }else{\n out.println(\" <p><label for=\\\"sexo\\\"> sexo </label>&nbsp;&nbsp;\");\n out.println(request.getParameter(\"sexo\"));\n }\n \n if (request.getParameter(\"preferencia\")==null){\n out.println(\"<label>Preferencias :</label>&nbsp;&nbsp;\");\n out.println(\"<label>Deporte</label>&nbsp;&nbsp;\");\n out.println(\"<input type=\\\"checkbox\\\" name=\\\"preferencia\\\" value=\\\"Deporte\\\">\");\n out.println(\"<label>Lectura</label>&nbsp;&nbsp;\");\n out.println(\"<input type=\\\"checkbox\\\" name=\\\"preferencia\\\" value=\\\"Lectura\\\">\");\n out.println(\"<label>Cine</label>&nbsp;&nbsp;\");\n out.println(\"<input type=\\\"checkbox\\\" name=\\\"preferencia\\\" value=\\\"Cine\\\">\");\n out.println(\"<label>Deporte</label>&nbsp;&nbsp;\");\n out.println(\"<input type=\\\"checkbox\\\" name=\\\"preferencia\\\" value=\\\"Viajes\\\">\");\n \n }else{\n out.println(\" <p><label for=\\\"preferencias\\\"> preferencias </label>&nbsp;&nbsp;\");\n out.println(request.getParameter(\"preferencia\"));\n }\n \n out.println(\"<input type=\\\"submit\\\" name=\\\"enviar\\\" value=\\\"Enviar\\\">\");\n out.println(\"<input type=\\\"reset\\\" name=\\\"borrar\\\" value=\\\"borrar\\\">\");\n out.println(\"</form>\");\n \n out.println(\"<h1>Servlet registro at \" + request.getContextPath() + \"</h1>\");\n out.println(\"</body>\");\n out.println(\"</html>\");\n \n }\n }", "@RequestMapping(value = \"form\", method = RequestMethod.GET)\n public String form() {\n return \"user_form\";\n }", "@Override\r\n\tprotected String requestText() {\n\t\tGuardarSustentoRequest guardarSustentoRequest = new GuardarSustentoRequest();\r\n\t\tguardarSustentoRequest.setCodigoActvidad(codigoActvidad);\r\n\t\tguardarSustentoRequest.setCodigoCliente(codigoCliente);\r\n\t\tguardarSustentoRequest.setCodigoPLan(codigoPLan);\r\n\t\tguardarSustentoRequest.setDescripcionActividad(descripcionActividad);\r\n\t\tguardarSustentoRequest.setFechaVisita(fechaVisita);\r\n\t\tguardarSustentoRequest.setTipoActividad(tipoActividad);\r\n\t\tguardarSustentoRequest.setUsuario(usuario);\r\n\t\tString request = JSONHelper.serializar(guardarSustentoRequest);\r\n\t\treturn request;\r\n\t}", "public ActionForward inicio(ActionMapping mapping, ActionForm form,\n HttpServletRequest request, HttpServletResponse response)\n throws Exception\n {\n TemaForm temaForm = (TemaForm) form;\n String forward = \"INICIO\";\n try\n {\n temaForm.setCriterioTema(new CriterioTema());\n temaForm.setTema(new Tema());\n temaForm.setTemas(new ArrayList<Tema>());\n } catch (Exception e)\n {\n log.error(\"Ha ocurrido un error en el metodo inicio del tema\", e);\n }\n return mapping.findForward(forward);\n }", "public static Result getFilledForm() {\r\n\t\tStatus result;\r\n\t\ttry {\r\n\t\t\tString formName = ChangeOrderForm.NAME;\r\n\t\t\tString username = CMSSession.getEmployeeName();\r\n\t\t\tFile pdf = File.createTempFile(\"Change_Order_Form_Filled\", \".pdf\");\r\n\t\t\tCMSGuidedFormFill.fillForm(formName, username, pdf);\r\n\r\n\t\t\tresult = ok(pdf, true);\r\n\r\n\t\t\tFileDeletionHandler.deleteFile(pdf);\r\n\t\t} catch (IOException e) {\r\n\t\t\tLogger.error(\"Couldn't create new temp file.\");\r\n\t\t\tLogger.error(e.getMessage(), e);\r\n\t\t\tresult = internalServerError();\r\n\t\t}\r\n\t\treturn result;\r\n\t}", "public ActionForward saveTemaAsync(ActionMapping mapping, ActionForm form,\n HttpServletRequest request, HttpServletResponse response)\n throws Exception\n {\n response.setContentType(\"text/json\");\n try\n {\n String tema = request.getParameter(\"descripcionTema\");\n String idEmpleadoRevisor = request.getParameter(\"idEmpleadoRevisor\");\n Empleado usuarioSession = (Empleado) request.getSession().getAttribute(Constantes.USUARIO_SESION);\n Tema beanTema = new Tema();\n beanTema.setActivo(Constantes.ACTIVADO);\n beanTema.setArea(usuarioSession.getArea());\n beanTema.setEvento(Constantes.NO_ACTIVO);\n beanTema.setTema(tema);\n beanTema.setId_area(usuarioSession.getArea().getId_area());\n beanTema.getRevisor().setId_empleado(Integer.valueOf(idEmpleadoRevisor));\n this.temaService.saveTema(beanTema);\n this.temaService.saveTemaRevisor(beanTema);\n JSONObject jsonArray = JSONObject.fromObject(beanTema);\n PrintWriter pw = response.getWriter();\n pw.write(jsonArray.toString());\n pw.flush();\n pw.close();\n //subir el nuevo tema a session del usuario\n request.getSession().removeAttribute(Constantes.TEMAS);\n request.getSession().setAttribute(Constantes.TEMAS, this.temaService.listTemas(usuarioSession.getId_area()));\n\n } catch (Exception e)\n {\n log.debug(\"Error al guardar un tema desde la pantalla de captura\", e);\n }\n return null;\n }", "@PostConstruct\n\tpublic void view() {\n\t\tif (log.isDebugEnabled()) {\n log.debug(\"Entering 'ConsultaHIPCuentaCorrientesAction - view' method\");\n }\n\t\tMap<String, String> parametros = FacesContext.getCurrentInstance().getExternalContext().getRequestParameterMap();;\n\t\tthis.parametrosPantalla = new HashMap<String, String>();\n\t\tthis.parametrosPantalla.putAll(parametros);\n\t\ttry {\n\t\t\tthis.formBusqueda = this.devuelveFormBusqueda();\n\t\t}\n\t\tcatch (Exception e) {\n\t\t\t\n\t\t}\n\t}", "public GestaoFormando() {\n \n initComponents();\n listarEquipamentos();\n listarmapainscritos();\n }", "@Override\r\n\tprotected String requestText() {\n\t\tConsultarIndiceEjecucionAnioRequest consultarIndiceEjecucionAnioRequest = new ConsultarIndiceEjecucionAnioRequest();\r\n\t\tconsultarIndiceEjecucionAnioRequest.setPeriodo(periodo);\r\n\t\tString request = JSONHelper.serializar(consultarIndiceEjecucionAnioRequest);\r\n\t\treturn request;\r\n\t}", "FORM createFORM();", "public String registrarExtra(){\n\t\tFacesContext context = FacesContext.getCurrentInstance();\n\t\tActividad actividad = context.getApplication().evaluateExpressionGet(context, \"#{actividad}\", Actividad.class);\n\t\tEncargado encargado = context.getApplication().evaluateExpressionGet(context, \"#{encargado}\", Encargado.class);\n\t\t\n\t\ttry {\n\t\t\tactividad.registrarActividad_Encargado(encargado.getCedula());\n\t\t} catch (SQLException e) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\te.printStackTrace();\n\t\t}\t\n\t\t\t\t\t\n\t\t// put the user object into the POST request \n\t\tFacesContext.getCurrentInstance().getExternalContext().getRequestMap().put(\"actividad\", actividad);\n\t\t\n\t\treturn \"principalAdministrador.xhtml\";\n\t}", "public abstract FullResponse onServeFormParams(Map<String, List<String>> formParams);", "@Override\n public void asignaParametros() {\n paso = request.getParameter(\"pasoSig\")!=null?request.getParameter(\"pasoSig\"):\"0\";\n String paginaSig = \"\";\n HashMap param = new HashMap();\n Documento doc = new Documento();\n switch (Integer.parseInt(paso)){\n case 0:\n //paso inicial: obtener la vista de los parametros\n datos.clear();\n String vista = request.getParameter(\"vista\")!=null?request.getParameter(\"vista\"):\"\";\n String idoperacion = request.getParameter(\"operacion\")!=null?request.getParameter(\"operacion\"):\"\";\n //cargar los parametros al hash de datos\n datos.put(\"idoperacion\", idoperacion);\n sesion.setPaginaSiguiente(vista);\n break;\n case 1: case 6: case 50: case 51: case 52: case 53: case 97: case 98: case 99:\n paginaSig = request.getParameter(\"paginaSig\")!=null?request.getParameter(\"paginaSig\"):\"\";\n sesion.setPaginaSiguiente(paginaSig);\n break;\n case 3: case 5: case 7:\n //editar documento(3) || baja de documentos(5) || activar documento(7)\n doc.setId(Integer.parseInt(request.getParameter(\"idDoc\")));\n datos.put(\"documento\", doc);\n datos.put(\"varios\", request.getParameter(\"varios\"));\n paginaSig = request.getParameter(\"paginaSig\")!=null?request.getParameter(\"paginaSig\"):\"\";\n sesion.setPaginaSiguiente(paginaSig);\n break;\n case 8:\n //imprimir los docs seleccionados\n datos.put(\"reporte\", application.getRealPath(\"WEB-INF/Reportes/Nomina/Personal/documentosemple.jasper\"));\n //parametros\n param = new HashMap();\n param.put(\"LOGO\", application.getRealPath(\"/Imagenes/\"+datos.get(\"logo\").toString()));\n param.put(\"RUTAIMGS\", application.getRealPath(\"/Imagenes/Personal/Documentos\"));\n Empleado empl = (Empleado)datos.get(\"empleado\");\n param.put(\"EMPLEADO\", new Integer(empl.getNumempleado()));\n param.put(\"DOCS\", request.getParameter(\"dato1\"));\n datos.put(\"parametros\", param);\n break;\n }\n datos.put(\"paso\", paso);\n }", "public void initHis_atencion_embarazada() throws Exception {\n\t\ttry {\r\n\t\t\taccionForm(true, \"registrar\");\r\n\r\n\t\t} catch (Exception e) {\r\n\t\t\t\r\n\t\t\tlog.error(e.getMessage(), e);\r\n\t\t\tMessagebox.show(e.getMessage(), \"Error !!\", Messagebox.OK,\r\n\t\t\t\t\tMessagebox.ERROR);\r\n\t\t}\r\n\r\n\t}", "public ActionForward cargar(ActionMapping mapping, ActionForm form, HttpServletRequest request,\n\t\t\tHttpServletResponse response) throws IOException, ServletException {\n\n\t\tLogger loggerInfo = Utilidades.loggerInfo();\n\t\tLogger loggerError = Utilidades.loggerError();\n\t\tActionMessages errores = new ActionMessages();\n\t\t\n\t\tloggerInfo.info(FechaUtil.getHoraActual()+\"_CambiarEstadoAction cargar - INICIO***\");\n\t\t\n\t\ttry {\n\t\n\t\t\t\n\t\t\tCambiarEstadoForm formulario = (CambiarEstadoForm) form;\n\t\t\tUsuarioDAO usuarioDAO = DAOFactory.crearUsuarioDAO();\n\t\t\tUsuario usuario = (Usuario) request.getSession().getAttribute(\"usuarioLog\");\n\t\t\tEntidadDAO entidadDAO = DAOFactory.crearEntidadDAO();\n\t\t\tEstadoDAO estadoDAO = DAOFactory.crearEstadoDAO();\n\t\t\tCambioEstadoDAO cambioEstadoDAO = DAOFactory.crearCambioEstadoDAO();\n\t\t\tTipoFormatoDAO tipoDAO = DAOFactory.crearTipoFormatoDAO();\n\t\t\tList<Estado> estadoNuevo = null;\n\t\t\tList<Estado> estadosPermitidos = new ArrayList<Estado>();\n\t\t\testadoNuevo = new ArrayList<Estado>();\n\t\t\tArrayList<String> strCombinaciones = new ArrayList<String>();\n\t\t\tformulario.setTipoFormatos(tipoDAO.buscarTipoFormatos());\n\t\t\tformulario.setEntidades(entidadDAO.buscarEntidades());\n\t\t\tformulario.setEstados2(estadoDAO.obtenerEstados(\"5\"));\n\t\t\tformulario.setEstados(estadoNuevo);\n\t\t\t// formulario.setEstados(cambioEstadoDAO.BuscarEstados(\"0\"));\n\t\t\t// Solo agregar estados que se encuentren permitidos en la tabla\n\t\t\t// cambio de estados\n\t\t\tList<CambioEstado> cambioEstados = cambioEstadoDAO.BuscarCambioEstadosTodos();\n\t\t\tArrayList<String> strEstadosDe = new ArrayList<String>();\n\t\t\tArrayList<String> strEstadosA = new ArrayList<String>();\n\t\t\tList<Estado> estadoHidden = new ArrayList<Estado>();\n\t\t\tfor (int i = 0; i < cambioEstados.size(); i++) {\n\n\t\t\t\tstrEstadosDe.add(cambioEstados.get(i).getDe());\n\t\t\t\tstrEstadosA.add(cambioEstados.get(i).getA());\n\t\t\t\tEstado est = new Estado();\n\t\t\t\test.setDescripcion(cambioEstados.get(i).getDe() + \"-\" + cambioEstados.get(i).getA());\n\t\t\t\test.setEstado(cambioEstados.get(i).getDe() + \"-\" + cambioEstados.get(i).getA());\n\t\t\t\test.setFormatos(null);\n\t\t\t\testadoHidden.add(est);\n\t\t\t}\n\n\t\t\tSet<String> listFinalRegsDe = new HashSet<String>(strEstadosDe);\n\t\t\tSet<String> listFinalRegsA = new HashSet<String>(strEstadosA);\n\n\t\t\tif (!listFinalRegsDe.isEmpty() && !listFinalRegsA.isEmpty()) {\n\n\t\t\t\tIterator itDe = listFinalRegsDe.iterator();\n\t\t\t\tIterator itA = listFinalRegsA.iterator();\n\t\t\t\tInteger intCount = 0;\n\t\t\t\tstrEstadosDe = new ArrayList<String>();\n\t\t\t\tstrEstadosA = new ArrayList<String>();\n\n\t\t\t\twhile (itDe.hasNext()) {\n\t\t\t\t\tString vehDup = (String) itDe.next();\n\t\t\t\t\tstrEstadosDe.add(vehDup);\n\t\t\t\t}\n\n\t\t\t\tintCount = 0;\n\t\t\t\twhile (itA.hasNext()) {\n\t\t\t\t\tString vehDup = (String) itA.next();\n\t\t\t\t\tstrEstadosA.add(vehDup);\n\t\t\t\t}\n\n\t\t\t}\n\t\t\tfor (int i = 0; i < strEstadosDe.size(); i++) {\n\t\t\t\testadosPermitidos.add(estadoDAO.obtenerEstadosPorEstado(strEstadosDe.get(i)));\n\t\t\t}\n\t\t\tformulario.setEstados2(estadosPermitidos);\n\t\t\testadosPermitidos = new ArrayList<Estado>();\n\n\t\t\tfor (int i = 0; i < strEstadosA.size(); i++) {\n\t\t\t\testadosPermitidos.add(estadoDAO.obtenerEstadosPorEstado(strEstadosA.get(i)));\n\t\t\t}\n\t\t\t\n\t\t\tformulario.setEstados(estadosPermitidos);\n\t\t\tformulario.setEstados3(estadoHidden);\n\t\t\tloggerInfo.info(FechaUtil.getHoraActual()+\"_CambiarEstadoAction finalizo cargar - FIN***\");\n\t\t\t\n\t\t\tloggerInfo.removeAllAppenders();\n\t\t\tloggerError.removeAllAppenders();\n\t\t\treturn mapping.findForward(\"cargar\");\n\n\t\t} catch (Exception e) {\n\n\t\t\tloggerError.error(FechaUtil.getHoraActual()+\"_Fallo CambiarEstadoAction cargar\", e);\n\t\t\tloggerError.error(FechaUtil.getHoraActual()+\"_CambiarEstadoAction cargar - FIN***\");\n\t\t\tloggerInfo.removeAllAppenders();\n\t\t\tloggerError.removeAllAppenders();\n\t\t\terrores.add(ActionMessages.GLOBAL_MESSAGE, new ActionMessage(\"texto.etiqueta.error.log\"));\n\t\t\tsaveErrors(request, errores);\n\t\t\treturn mapping.findForward(\"cargar\");\n\t\t\t\n\t\t}\n\n\t}", "public String nuevo() {\n\n\t\tLOG.info(\"Submitado formulario, accion nuevo\");\n\t\tString view = \"/alumno/form\";\n\n\t\t// las validaciones son correctas, por lo cual los datos del formulario estan en\n\t\t// el atributo alumno\n\n\t\t// TODO simular index de la bbdd\n\t\tint id = this.alumnos.size();\n\t\tthis.alumno.setId(id);\n\n\t\tLOG.debug(\"alumno: \" + this.alumno);\n\n\t\t// TODO comprobar edad y fecha\n\n\t\talumnos.add(alumno);\n\t\tview = VIEW_LISTADO;\n\t\tmockAlumno();\n\n\t\t// mensaje flash\n\t\tFacesContext facesContext = FacesContext.getCurrentInstance();\n\t\tExternalContext externalContext = facesContext.getExternalContext();\n\t\texternalContext.getFlash().put(\"alertTipo\", \"success\");\n\t\texternalContext.getFlash().put(\"alertMensaje\", \"Alumno \" + this.alumno.getNombre() + \" creado con exito\");\n\n\t\treturn view + \"?faces-redirect=true\";\n\t}", "public void guardarDatosForm(ActionEvent evt) {\n\t\ttry {\n\t\t\tthis.mantenimientoCCCFacturarInteresAction.procesarArchivo();\n\t\t} catch (Exception e) {\n\t\t\tthis.addError(\"Error : \", this.obtieneMensajeErrorException(e));\n\t\t}\n\t}", "public void guardarDatos() throws Exception {\n\t\ttry {\n\t\t\tFormularioUtil.setUpperCase(groupboxEditar);\n\t\t\tif (validarForm()) {\n\t\t\t\t// Cargamos los componentes //\n\n\t\t\t\tHisc_urgencia_odontologico hisc_urgencia_odontologico = getBean();\n\n\t\t\t\tMap<String, Object> datos = new HashMap<String, Object>();\n\t\t\t\tdatos.put(\"hisc_urgencia_odontologico\",\n\t\t\t\t\t\thisc_urgencia_odontologico);\n\t\t\t\t// datos.put(\"sigvitales\", mcSignosVitales.obtenerSigvitales());\n\t\t\t\tdatos.put(\"accion\", tbxAccion.getValue());\n\t\t\t\tdatos.put(\"admision\", admision);\n\t\t\t\tdatos.put(\"datos_procedimiento\", getProcedimientos());\n\n\t\t\t\tImpresion_diagnostica impresion_diagnostica = macroImpresion_diagnostica\n\t\t\t\t\t\t.obtenerImpresionDiagnostica();\n\t\t\t\tdatos.put(\"impresion_diagnostica\", impresion_diagnostica);\n\n\t\t\t\tgetServiceLocator().getHisc_urgencia_odontologicoService()\n\t\t\t\t\t\t.guardarDatos(datos);\n\n\t\t\t\ttbxAccion.setValue(\"modificar\");\n\t\t\t\tinfoPacientes.setCodigo_historia(hisc_urgencia_odontologico\n\t\t\t\t\t\t.getCodigo_historia());\n\n\t\t\t\tactualizarRemision(admision, getInformacionClinica(), this);\n\t\t\t\tcargarServicios();\n\n\t\t\t\tMensajesUtil.mensajeInformacion(\"Informacion ..\",\n\t\t\t\t\t\t\"Los datos se guardaron satisfactoriamente\");\n\t\t\t}\n\n\t\t} catch (ImpresionDiagnosticaException e) {\n\t\t\tlog.error(e.getMessage(), e);\n\t\t} catch (Exception e) {\n\t\t\tif (!(e instanceof WrongValueException)) {\n\t\t\t\tMensajesUtil.mensajeError(e, \"\", this);\n\t\t\t}\n\t\t}\n\t}", "@RequestMapping(method = RequestMethod.POST, value = \"/gdaAltaProyecto.do\")\n public String gdaAltaProyecto(@Valid Proyectos proyecto, BindingResult result, Model model, String nActividades, String nPerfiles, String cadenaActividades, String selectto, String codigo_postal, String otra_colonia, String existeCP, String estado, String municipio, String ciudad, HttpSession session, HttpServletRequest request)\n {\n if (new ValidaSesion().validaOrganizacion(session, request))\n {\n System.out.println(\"hola gda alta organizacion\");\n\n //Validaciones\n System.out.println(\"Validar\");\n new ValidacionesOrganizaciones().valAltaAdminProy(proyecto, result, model, codigo_postal, existeCP, otra_colonia);\n\n //Desglose de Actividades\n ActividadesModel actividadesModel = new ActividadesModel(cadenaActividades);\n\n //Valida Actividades\n if (!actividadesModel.validarInsercionActividades().isSuccess())\n {\n result.addError(new ObjectError(\"actividades\", actividadesModel.validarInsercionActividades().getMensaje()));\n }\n model.addAttribute(\"validacion_actividades\", actividadesModel.validarInsercionActividades().getMensaje());\n\n if (result.hasErrors())\n {\n System.out.print(\"hubo errores\");\n System.out.println(proyecto.toString());\n System.out.println(\"Error:\" + result.toString());\n\n //Estados\n LinkedHashMap<String, String> ordenamiento = new LinkedHashMap<String, String>();\n ordenamiento.put(\"nombre\", \"asc\");\n model.addAttribute(\"estados\", daoEstadosSia.findAll(ordenamiento));\n //TipoProyecto\n model.addAttribute(\"tipoProyecto\", daoTipoProyecto.findBySpecificField(\"status\", \"1\", \"equal\", null, null));\n //Perfil\n model.addAttribute(\"perfiles\", daoPerfil.findBySpecificField(\"estatus\", \"1\", \"equal\", null, null));\n //Programa\n model.addAttribute(\"programas\", daoPrograma.findBySpecificField(\"status\", \"1\", \"equal\", null, null));\n //Regresar codigo postal\n model.addAttribute(\"cp\", codigo_postal);\n try\n {\n model.addAttribute(\"idColonia\", proyecto.getIdColonia().getIdColonia());\n } catch (Exception e)\n {\n }\n //Regresar codigo postal\n model.addAttribute(\"otra_colonia\", otra_colonia);\n\n //Regresa las Organizaciones\n List<Instancia> listaInstancias = daoInstancia.findBySpecificField(\"validacionAdmin\", \"1\", \"equal\", null, null);\n ArrayList<Instancia> filtroInstancias = new ArrayList<Instancia>();\n\n for (int i = 0; i < listaInstancias.size(); i++)\n {\n// int estatus = Integer.parseInt(listaInstancias.get(i).getEstatus().toString());//.....................................................................................................Corrección Status conversión .............................................................................................\n int estatus = (int) listaInstancias.get(i).getStatus();\n if (estatus == 1 || estatus == 2)\n {\n filtroInstancias.add(listaInstancias.get(i));\n }\n }\n model.addAttribute(\"instancias\", filtroInstancias);\n\n //Regresar actividades\n model.addAttribute(\"nActividades\", nActividades.substring(0, 1));\n System.out.println(\"nActividades:\" + nActividades.substring(0, 1));\n\n for (int i = 0; i < actividadesModel.actividades.size(); i++)\n {\n model.addAttribute(\"actividad\" + i, actividadesModel.actividades.get(i));\n System.out.println(\"Regresando Actividad:\" + actividadesModel.actividades.get(i));\n }\n model.addAttribute(\"proyecto\", proyecto);\n\n return \"/Organizaciones/altaProyecto\";\n } else\n {\n\n System.out.print(\"no hubo errores\");\n\n //Checa codigo postal\n CodigosPostalesModel codigosPostales = new CodigosPostalesModel(daoColonia, daoCodigosPostales, daoEstadosSia,\n daoMunicipiosSia, daoCiudades, daoTipoLocalidad);\n if (existeCP.equals(\"true\"))\n {\n if (proyecto.getIdColonia().getIdColonia().toString().equals(\"0\"))\n {\n //Agregar colonia \n proyecto.setIdColonia(codigosPostales.agregaColonia(codigo_postal, otra_colonia));\n }\n } else\n {\n //Agregar codigo postal + colonia\n proyecto.setIdColonia(codigosPostales.agregarCodigoPostal(codigo_postal, otra_colonia, estado, municipio, ciudad));\n }\n\n proyecto.setValidacionAdmin(BigInteger.ZERO);\n proyecto.setEstatus(BigInteger.ONE);\n proyecto.setFechaAlta(new Date());\n proyecto.setVacantesDisponibles(proyecto.getVacantes());\n System.out.println(\"idInstancia:\" + proyecto.getIdInstancia().getIdInstancia());\n //Convertir a mayuscular\n proyecto.setDomicilio(limpiar.tuneaStringParaBD(proyecto.getDomicilio()));\n proyecto.setNombre(limpiar.tuneaStringParaBD(proyecto.getNombre()));\n proyecto.setNombreResponsable(limpiar.tuneaStringParaBD(proyecto.getNombreResponsable()));\n proyecto.setResponsablePuesto(limpiar.tuneaStringParaBD(proyecto.getResponsablePuesto()));\n //Imprimir todo\n System.out.println(\"Datos del alumno\");\n System.out.println(\"Nombre:\" + proyecto.getNombre() + \" len:\" + proyecto.getNombre().length());\n System.out.println(\"Vacantes:\" + proyecto.getVacantes() + \" len:\" + proyecto.getVacantes().toString().length());\n System.out.println(\"Vacantes disponibles:\" + proyecto.getVacantesDisponibles() + \" len:\" + proyecto.getVacantesDisponibles().toString().length());\n System.out.println(\"Responsable puesto:\" + proyecto.getResponsablePuesto() + \" len:\" + proyecto.getResponsablePuesto().length());\n System.out.println(\"Nombre Responsable:\" + proyecto.getNombreResponsable() + \" len:\" + proyecto.getNombreResponsable().length());\n System.out.println(\"Telefono responsable:\" + proyecto.getTelefonoResponsable() + \" len:\" + (proyecto.getTelefonoResponsable() + \"\").length());\n System.out.println(\"Domicilio:\" + proyecto.getDomicilio() + \" len:\" + proyecto.getDomicilio().length());\n System.out.println(\"Id colonia:\" + proyecto.getIdColonia().getIdColonia() + \" len:\" + proyecto.getIdColonia().getIdColonia().toString().length());\n System.out.println(\"Id tipo proyecto:\" + proyecto.getIdTipoProyecto().getIdTipoProyecto() + \" len:\" + proyecto.getIdTipoProyecto().getIdTipoProyecto().toString().length());\n System.out.println(\"Id programa:\" + proyecto.getIdPrograma().getIdPrograma() + \" len:\" + proyecto.getIdPrograma().getIdPrograma().toString().length());\n System.out.println(\"Modalidad:\" + proyecto.getModalidad() + \" len:\" + proyecto.getModalidad().length());\n System.out.println(\"fin\");\n //\n daoProyectos.create(proyecto);\n System.out.println(\"Insercion correcta!\");\n\n //Obtenemos el proyecto creado\n LinkedHashMap<String, String> ordenamiento = new LinkedHashMap<String, String>();\n ordenamiento.put(\"idProyecto\", \"desc\");\n Proyectos newProyecto = (Proyectos) daoProyectos.findAll(ordenamiento).get(0);\n\n //Insercion de Actividades\n for (int i = 0; i < actividadesModel.actividades.size(); i++)\n {\n Actividades actividad = new Actividades();\n actividad.setDetalle(limpiar.tuneaStringParaBD(actividadesModel.actividades.get(i)));\n actividad.setEstatus(BigInteger.ONE);\n actividad.setIdProyecto(newProyecto);\n daoActividades.create(actividad);\n System.out.println(\"Se inserto la actividad: \" + actividad.getDetalle() + \" en el proyecto: \" + actividad.getIdProyecto().getNombre());\n }\n //Insercion de Perfiles\n //ProyectoPerfilModel proyectoPerfilModel;\n if (selectto != null)\n {\n //proyectoPerfilModel = new ProyectoPerfilModel(selectto); \n //Analisis de la cadena\n StringTokenizer token = new StringTokenizer(selectto, \",\");\n ArrayList<Perfil> perfiles = new ArrayList<Perfil>();\n\n System.out.println(\"Analizar cadena:\" + selectto);\n System.out.println(\"No de tokens:\" + token.countTokens());\n while (token.hasMoreTokens())\n {\n String perfil = token.nextToken();\n System.out.println(\"Token:\" + perfil);\n if (perfil != null && !perfil.equals(\"\"))\n {\n perfiles.add((Perfil) daoPerfil.find(BigDecimal.valueOf(Double.parseDouble(perfil))));\n }\n }\n for (int i = 0; i < perfiles.size(); i++)\n {\n ProyectoPerfil proyectoPerfil = new ProyectoPerfil();\n proyectoPerfil.setIdPerfil(perfiles.get(i));\n proyectoPerfil.setIdProyecto(newProyecto);\n daoProyectoPerfil.create(proyectoPerfil);\n System.out.println(\"Perfil insertado: \" + proyectoPerfil.getIdPerfil().getNombre() + \" En proyecto :\" + proyectoPerfil.getIdProyecto().getNombre());\n }\n } else\n {\n System.out.println(\"No se agregaran perfiles\");\n }\n\n return \"/Organizaciones/confirmaAltaProyectos\";\n }\n } else\n {\n model.addAttribute(\"error\", \"<div class='alert alert-danger'>Debes iniciar sesió para acceder a esta sección.</div>\");\n return \"redirect:login.do\";\n }\n\n }", "@Override\n protected void doPost(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n // processRequest(request, response);\n \n \n \n //SIMUMLANDO VALORES\n String ejercicio3=\"Enviar\";\n String ejercicio4=\"Ingresar\";\n String ejercicio5=\"Ir\";\n String ejercicio8=\"Cookies\";\n \n \n \n String pUsuario=request.getParameter(\"usuario\");\n String pPassword=request.getParameter(\"password\");\n \n String envio3=request.getParameter(\"envio3\"); //Capturo el valor del input envio3\n \n String envio4=request.getParameter(\"envio4\");\n \n String envio5=request.getParameter(\"envio5\");\n \n String envio8=request.getParameter(\"envio8\");\n \n \n \n \n //EJERCICIO 3\n //Si ejercicio3 recive el valor de envio3(enviar))\n if(ejercicio3.equals(envio3))\n {\n PrintWriter out=response.getWriter(); \n \n \n \n out.println(\"<html>\\n\" +\n\" <head>\\n\" +\n\" <link rel=\\\"stylesheet\\\" href=\\\"https://maxcdn.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css\\\">\\n\" +\n\" <link href=\\\"https://fonts.googleapis.com/css?family=Alegreya|Chilanka|Dancing+Script|Kalam|Pacifico|Satisfy&display=swap\\\" rel=\\\"stylesheet\\\">\\n\" +\n\" <script src=\\\"https://ajax.googleapis.com/ajax/libs/jquery/3.4.1/jquery.min.js\\\"></script>\\n\" +\n\"<script src=\\\"https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.14.7/umd/popper.min.js\\\"></script> \\n\" +\n\"<script src=\\\"https://maxcdn.bootstrapcdn.com/bootstrap/4.3.1/js/bootstrap.min.js\\\"></script>\\n\" +\n\"<style>/* Make the image fully responsive */\\n\" +\n\".carousel-inner img {\\n\" +\n\"width: 100%;\\n\" +\n\"height: 100%; \\n\" +\n\"}\\n\" +\n\"</style>\\n\" +\n\"\\n\" +\n\"<title>Ejercicio 3</title>\\n\" +\n\"\\n\" +\n\"<!-- Custom fonts for this theme -->\\n\" +\n\"<link href=\\\"vendor/fontawesome-free/css/all.min.css\\\" rel=\\\"stylesheet\\\" type=\\\"text/css\\\">\\n\" +\n\"<link href=\\\"https://fonts.googleapis.com/css?family=Montserrat:400,700\\\" rel=\\\"stylesheet\\\" type=\\\"text/css\\\">\\n\" +\n\"<link href=\\\"https://fonts.googleapis.com/css?family=Lato:400,700,400italic,700italic\\\" rel=\\\"stylesheet\\\" type=\\\"text/css\\\">\\n\" +\n\"\\n\" +\n\"<!-- Theme CSS -->\\n\" +\n\"<link href=\\\"css/freelancer.css\\\" rel=\\\"stylesheet\\\">\\n\" +\n\"<link href=\\\"css/estilo-indexp.css\\\" rel=\\\"stylesheet\\\">\\n\" +\n\"\\n\" +\n\"<!--Tabla de bootstrap-->\\n\" +\n\"\\n\" +\n\"<script src=\\\"https://ajax.googleapis.com/ajax/libs/jquery/3.4.1/jquery.min.js\\\"></script>\\n\" +\n\"<script src=\\\"https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.14.7/umd/popper.min.js\\\"></script>\\n\" +\n\"<script src=\\\"https://maxcdn.bootstrapcdn.com/bootstrap/4.3.1/js/bootstrap.min.js\\\"></script>\\n\" +\n\"\\n\" +\n\"<link href=\\\"https://fonts.googleapis.com/css?family=Nunito+Sans&display=swap\\\" rel=\\\"stylesheet\\\">\\n\" +\n\"<link href=\\\"https://fonts.googleapis.com/css?family=Chilanka|Nanum+Gothic:400,700|Source+Sans+Pro&display=swap\\\" rel=\\\"stylesheet\\\">\\n\" +\n\"\\n\" +\n\"<!--Estilos del formulario 3-->\\n\" +\n\"<link rel=\\\"stylesheet\\\" type=\\\"text/css\\\" href=\\\"css/estilos.css\\\">\\n\" +\n\"\\n\" +\n\"<!--Estilos ejercicio 4-->\\n\" +\n\" <script type=\\\"text/javascript\\\" src=\\\"css/funcioness.js\\\"></script>\\n\" +\n\" <!--Bootstrap formulario-->\\n\" +\n\"\\n\" +\n\"\\n\" +\n\"\\n\" +\n\"</head>\\n\" +\n\" \\n\" +\n\"\\n\" +\n\"<body id=\\\"page-top\\\">\\n\" +\n\" <!-- NavBar -->\\n\" +\n\"<nav class=\\\"navbar navbar-expand-lg bg-secondary text-uppercase fixed-top\\\" id=\\\"mainNav\\\">\\n\" +\n\"<div class=\\\"container\\\">\\n\" +\n\"\\n\" +\n\" \\n\" +\n\" <form method=\\\"post\\\" action=\\\"servletParametros1\\\" >\\n\" +\n\" <a class=\\\"navbar-brand js-scroll-trigger\\\" >Bienvenido SINAHI</a>\\n\" +\n \" <center>\\n\" +\n\" <button name=\\\"inicio\\\" value=\\\"inicio\\\" class=\\\"boton_inicio\\\">inicio</button>\\n\" +\n\" </center>\"+\n\" </form>\\n\" +\n\"\\n\" +\n\"\\n\" +\n\"<button class=\\\"navbar-toggler navbar-toggler-right text-uppercase font-weight-bold bg-primary text-white rounded\\\" type=\\\"button\\\" data-toggle=\\\"collapse\\\" data-target=\\\"#navbarResponsive\\\" aria-controls=\\\"navbarResponsive\\\" aria-expanded=\\\"false\\\" aria-label=\\\"Toggle navigation\\\">\\n\" +\n\"\\n\" +\n\" <i class=\\\"fas fa-bars\\\"></i>\\n\" +\n\" </button>\\n\" +\n\" <div class=\\\"collapse navbar-collapse\\\" id=\\\"navbarResponsive\\\">\\n\" +\n\" <ul class=\\\"navbar-nav ml-auto\\\">\\n\" +\n\" <li class=\\\"nav-item mx-0 mx-lg-1\\\">\\n\" +\n\" <a class=\\\"nav-link py-3 px-0 px-lg-3 rounded js-scroll-trigger\\\" href=\\\"administracion.html\\\">Administracion</a>\\n\" +\n\" </li>\\n\" +\n\" <li class=\\\"nav-item mx-0 mx-lg-1\\\">\\n\" +\n\" <a class=\\\"nav-link py-3 px-0 px-lg-3 rounded js-scroll-trigger\\\" href=\\\"#about\\\">Reglas de manejo</a>\\n\" +\n\" </li>\\n\" +\n\" <li class=\\\"nav-item mx-0 mx-lg-1\\\">\\n\" +\n\" <a class=\\\"nav-link py-3 px-0 px-lg-3 rounded js-scroll-trigger\\\" href=\\\"#contact\\\">Pruebas de manejo</a>\\n\" +\n\" </li>\\n\" +\n\" </ul>\\n\" +\n\" </div>\\n\" +\n\"</div>\\n\" +\n\"</nav>\\n\" +\n\"</div>\\n\" +\n\"</div> <br>\\n\" +\n\"<br>\\n\" +\n\"<br><br>\\n\" +\n\"<br>\\n\" +\n\"<br>\\n\");\n \n out.println(\"<center>EJERCICIO 3 - MANEJO DE PARAMETROS <br><br>\");\n out.println(\"El parametro de usuario es: \"+pUsuario+\"<br>\");\n out.println(\"El parametro de password es: \"+pPassword+\"</center>\");\n \n \n \n out.close();\n \n }\n \n else\n {\n \n //EJERCICIO 4\n if(ejercicio4.equals(envio4)) \n {\n response.setContentType(\"text/html;charset=UTF-8\");\n try (PrintWriter out = response.getWriter()) {\n String usuario=request.getParameter(\"usuario\");\n String password=request.getParameter(\"password\");\n String[] tecnologias=request.getParameterValues(\"tecnologias\");\n String tec= Arrays.toString(tecnologias);\n String genero=request.getParameter(\"genero\");\n String ocupacion=request.getParameter(\"ocupacion\");\n String musica=request.getParameter(\"musica\");\n String comentarios=request.getParameter(\"comentarios\");\n \n \n \n out.println(\"<html>\\n\" +\n\" <head>\\n\" +\n\" <link rel=\\\"stylesheet\\\" href=\\\"https://maxcdn.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css\\\">\\n\" +\n\" <link href=\\\"https://fonts.googleapis.com/css?family=Alegreya|Chilanka|Dancing+Script|Kalam|Pacifico|Satisfy&display=swap\\\" rel=\\\"stylesheet\\\">\\n\" +\n\" <script src=\\\"https://ajax.googleapis.com/ajax/libs/jquery/3.4.1/jquery.min.js\\\"></script>\\n\" +\n\"<script src=\\\"https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.14.7/umd/popper.min.js\\\"></script> \\n\" +\n\"<script src=\\\"https://maxcdn.bootstrapcdn.com/bootstrap/4.3.1/js/bootstrap.min.js\\\"></script>\\n\" +\n\"<style>/* Make the image fully responsive */\\n\" +\n\".carousel-inner img {\\n\" +\n\"width: 100%;\\n\" +\n\"height: 100%; \\n\" +\n\"}\\n\" +\n\"</style>\\n\" +\n\"\\n\" +\n\"<title>Ejercicio 4</title>\\n\" +\n\"\\n\" +\n\"<!-- Custom fonts for this theme -->\\n\" +\n\"<link href=\\\"vendor/fontawesome-free/css/all.min.css\\\" rel=\\\"stylesheet\\\" type=\\\"text/css\\\">\\n\" +\n\"<link href=\\\"https://fonts.googleapis.com/css?family=Montserrat:400,700\\\" rel=\\\"stylesheet\\\" type=\\\"text/css\\\">\\n\" +\n\"<link href=\\\"https://fonts.googleapis.com/css?family=Lato:400,700,400italic,700italic\\\" rel=\\\"stylesheet\\\" type=\\\"text/css\\\">\\n\" +\n\"\\n\" +\n\"<!-- Theme CSS -->\\n\" +\n\"<link href=\\\"css/freelancer.css\\\" rel=\\\"stylesheet\\\">\\n\" +\n\"<link href=\\\"css/estilo-indexp.css\\\" rel=\\\"stylesheet\\\">\\n\" +\n\"\\n\" +\n\"<!--Tabla de bootstrap-->\\n\" +\n\"\\n\" +\n\"<script src=\\\"https://ajax.googleapis.com/ajax/libs/jquery/3.4.1/jquery.min.js\\\"></script>\\n\" +\n\"<script src=\\\"https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.14.7/umd/popper.min.js\\\"></script>\\n\" +\n\"<script src=\\\"https://maxcdn.bootstrapcdn.com/bootstrap/4.3.1/js/bootstrap.min.js\\\"></script>\\n\" +\n\"\\n\" +\n\"<link href=\\\"https://fonts.googleapis.com/css?family=Nunito+Sans&display=swap\\\" rel=\\\"stylesheet\\\">\\n\" +\n\"<link href=\\\"https://fonts.googleapis.com/css?family=Chilanka|Nanum+Gothic:400,700|Source+Sans+Pro&display=swap\\\" rel=\\\"stylesheet\\\">\\n\" +\n\"\\n\" +\n\"<!--Estilos del formulario 3-->\\n\" +\n\"<link rel=\\\"stylesheet\\\" type=\\\"text/css\\\" href=\\\"css/estilos.css\\\">\\n\" +\n\"\\n\" +\n\"<!--Estilos ejercicio 4-->\\n\" +\n\" <script type=\\\"text/javascript\\\" src=\\\"css/funcioness.js\\\"></script>\\n\" +\n\" <!--Bootstrap formulario-->\\n\" +\n\"\\n\" +\n\"\\n\" +\n\"\\n\" +\n\"</head>\\n\" +\n\" \\n\" +\n\"\\n\" +\n\"<body id=\\\"page-top\\\">\\n\" +\n\" <!-- NavBar -->\\n\" +\n\"<nav class=\\\"navbar navbar-expand-lg bg-secondary text-uppercase fixed-top\\\" id=\\\"mainNav\\\">\\n\" +\n\"<div class=\\\"container\\\">\\n\" +\n\"\\n\" +\n\" \\n\" +\n\" <form method=\\\"post\\\" action=\\\"servletParametros1\\\" >\\n\" +\n\" <a class=\\\"navbar-brand js-scroll-trigger\\\" >Bienvenido SINAHI</a>\\n\" +\n \" <center>\\n\" +\n\" <button name=\\\"inicio\\\" value=\\\"inicio\\\" class=\\\"boton_inicio\\\">inicio</button>\\n\" +\n\" </center>\"+\n\" </form>\\n\" +\n\"\\n\" +\n\"\\n\" +\n\"<button class=\\\"navbar-toggler navbar-toggler-right text-uppercase font-weight-bold bg-primary text-white rounded\\\" type=\\\"button\\\" data-toggle=\\\"collapse\\\" data-target=\\\"#navbarResponsive\\\" aria-controls=\\\"navbarResponsive\\\" aria-expanded=\\\"false\\\" aria-label=\\\"Toggle navigation\\\">\\n\" +\n\"\\n\" +\n\" <i class=\\\"fas fa-bars\\\"></i>\\n\" +\n\" </button>\\n\" +\n\" <div class=\\\"collapse navbar-collapse\\\" id=\\\"navbarResponsive\\\">\\n\" +\n\" <ul class=\\\"navbar-nav ml-auto\\\">\\n\" +\n\" <li class=\\\"nav-item mx-0 mx-lg-1\\\">\\n\" +\n\" <a class=\\\"nav-link py-3 px-0 px-lg-3 rounded js-scroll-trigger\\\" href=\\\"administracion.html\\\">Administracion</a>\\n\" +\n\" </li>\\n\" +\n\" <li class=\\\"nav-item mx-0 mx-lg-1\\\">\\n\" +\n\" <a class=\\\"nav-link py-3 px-0 px-lg-3 rounded js-scroll-trigger\\\" href=\\\"#about\\\">Reglas de manejo</a>\\n\" +\n\" </li>\\n\" +\n\" <li class=\\\"nav-item mx-0 mx-lg-1\\\">\\n\" +\n\" <a class=\\\"nav-link py-3 px-0 px-lg-3 rounded js-scroll-trigger\\\" href=\\\"#contact\\\">Pruebas de manejo</a>\\n\" +\n\" </li>\\n\" +\n\" </ul>\\n\" +\n\" </div>\\n\" +\n\"</div>\\n\" +\n\"</nav>\\n\" +\n\"</div>\\n\" +\n\"</div> <br>\\n\" +\n\"<br>\\n\" +\n\"<br><br>\\n\" +\n\"<br>\\n\" +\n\"<br>\\n\");\n\n //TABLA GENERADA CON LOS PARAMETROS \n \n out.println(\" <style>\"+ \n \".parrafo\\n\" +\n\"{\\n\" +\n\" font-size: 25px;\\n\" +\n\" font-family: 'Nunito Sans', sans-serif;\\n\" +\n\" color: #9066BA;\\n\" +\n\" \\n\" +\n\"}\"+\n \n \".tabla\\n\" +\n\"{\\n\" +\n\" width: 500px;\\n\" +\n\" height: 250px;\\n\" +\n\"}\"+\n\"</style>\");\n \n \n out.println(\"\"+\n \n \"<center>\"\n + \"<p class=\\\"parrafo\\\"> EJERCICIO 4 - MANEJO DE FORMULARIO HTML </p>\"+\n \"</center>\");\n \n out.println(\"<div class=\\\"container\\\">\");\n out.println(\"<table border=3px align=center class=\\\"tabla\\\"> <tr class=\\\"table-info\\\">\");\n out.println( \"<td class=azul>Usuario(*) </td>\");\n out.println(\"<td>\" +usuario +\"</td></tr>\");\n \n out.println(\"<tr class=\\\"table-warning\\\"> <td class=azul>Password(*) </td>\");\n out.println(\"<td>\" +password +\"</td></tr>\");\n \n out.println(\"<tr class=\\\"table-info\\\"><td class=azul>Tecnologia(*) </td>\");\n out.println(\"<td>\" +tec+\"</td></tr>\");\n \n out.println(\"<tr class=\\\"table-warning\\\"><td class=azul>Genero(*) </td>\");\n out.println(\"<td>\" +genero +\"</td></tr>\");\n \n out.println(\"<tr class=\\\"table-info\\\"><td class=azul>Ocupacion(*) </td>\");\n out.println(\"<td>\" +ocupacion +\"</td></tr>\");\n \n out.println(\"<tr class=\\\"table-warning\\\"><td class=azul>Musica </td>\");\n out.println(\"<td>\" +musica +\"</td></tr>\");\n \n out.println(\"<tr class=\\\"table-info\\\"><td class=azul>Los comentarios son</td>\");\n out.println(\"<td>\" +comentarios +\"</td></tr>\");\n \n out.println(\"</div>\");\n \n out.println(\"</body>\");\n out.println(\"</html>\"); \n }\n }\n else\n {\n if(ejercicio5.equals(envio5))\n {\n response.setContentType(\"text/html;charset=UTF-8\");\n PrintWriter out = response.getWriter();\n try {\n \n \n String metodoHTTP=request.getMethod();\n String ur=request.getRequestURI();\n \n \n out.println(\"<html>\\n\" +\n\" <head>\\n\" +\n\" <link rel=\\\"stylesheet\\\" href=\\\"https://maxcdn.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css\\\">\\n\" +\n\" <link href=\\\"https://fonts.googleapis.com/css?family=Alegreya|Chilanka|Dancing+Script|Kalam|Pacifico|Satisfy&display=swap\\\" rel=\\\"stylesheet\\\">\\n\" +\n\" <script src=\\\"https://ajax.googleapis.com/ajax/libs/jquery/3.4.1/jquery.min.js\\\"></script>\\n\" +\n\"<script src=\\\"https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.14.7/umd/popper.min.js\\\"></script> \\n\" +\n\"<script src=\\\"https://maxcdn.bootstrapcdn.com/bootstrap/4.3.1/js/bootstrap.min.js\\\"></script>\\n\" +\n\"<style>/* Make the image fully responsive */\\n\" +\n\".carousel-inner img {\\n\" +\n\"width: 100%;\\n\" +\n\"height: 100%; \\n\" +\n\"}\\n\" +\n\"</style>\\n\" +\n\"\\n\" +\n\"<title>Jercicio 5</title>\\n\" +\n\"\\n\" +\n\"<!-- Custom fonts for this theme -->\\n\" +\n\"<link href=\\\"vendor/fontawesome-free/css/all.min.css\\\" rel=\\\"stylesheet\\\" type=\\\"text/css\\\">\\n\" +\n\"<link href=\\\"https://fonts.googleapis.com/css?family=Montserrat:400,700\\\" rel=\\\"stylesheet\\\" type=\\\"text/css\\\">\\n\" +\n\"<link href=\\\"https://fonts.googleapis.com/css?family=Lato:400,700,400italic,700italic\\\" rel=\\\"stylesheet\\\" type=\\\"text/css\\\">\\n\" +\n\"\\n\" +\n\"<!-- Theme CSS -->\\n\" +\n\"<link href=\\\"css/freelancer.css\\\" rel=\\\"stylesheet\\\">\\n\" +\n\"<link href=\\\"css/estilo-indexp.css\\\" rel=\\\"stylesheet\\\">\\n\" +\n\"\\n\" +\n\"<!--Tabla de bootstrap-->\\n\" +\n\"\\n\" +\n\"<script src=\\\"https://ajax.googleapis.com/ajax/libs/jquery/3.4.1/jquery.min.js\\\"></script>\\n\" +\n\"<script src=\\\"https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.14.7/umd/popper.min.js\\\"></script>\\n\" +\n\"<script src=\\\"https://maxcdn.bootstrapcdn.com/bootstrap/4.3.1/js/bootstrap.min.js\\\"></script>\\n\" +\n\"\\n\" +\n\"<link href=\\\"https://fonts.googleapis.com/css?family=Nunito+Sans&display=swap\\\" rel=\\\"stylesheet\\\">\\n\" +\n\"<link href=\\\"https://fonts.googleapis.com/css?family=Chilanka|Nanum+Gothic:400,700|Source+Sans+Pro&display=swap\\\" rel=\\\"stylesheet\\\">\\n\" +\n\"\\n\" +\n\"<!--Estilos del formulario 3-->\\n\" +\n\"<link rel=\\\"stylesheet\\\" type=\\\"text/css\\\" href=\\\"css/estilos.css\\\">\\n\" +\n\"\\n\" +\n\"<!--Estilos ejercicio 4-->\\n\" +\n\" <script type=\\\"text/javascript\\\" src=\\\"css/funcioness.js\\\"></script>\\n\" +\n\" <!--Bootstrap formulario-->\\n\" +\n\"\\n\" +\n\"\\n\" +\n\"\\n\" +\n\"</head>\\n\" +\n\" \\n\" +\n\"\\n\" +\n\"<body id=\\\"page-top\\\">\\n\" +\n\" <!-- NavBar -->\\n\" +\n\"<nav class=\\\"navbar navbar-expand-lg bg-secondary text-uppercase fixed-top\\\" id=\\\"mainNav\\\">\\n\" +\n\"<div class=\\\"container\\\">\\n\" +\n\"\\n\" +\n\" \\n\" +\n\" <form method=\\\"post\\\" action=\\\"servletParametros1\\\" >\\n\" +\n\" <a class=\\\"navbar-brand js-scroll-trigger\\\" >Bienvenido SINAHI</a>\\n\" +\n \" <center>\\n\" +\n\" <button name=\\\"inicio\\\" value=\\\"inicio\\\" class=\\\"boton_inicio\\\">inicio</button>\\n\" +\n\" </center>\"+ \n\" </form>\\n\" +\n\"\\n\" +\n\"\\n\" +\n\"<button class=\\\"navbar-toggler navbar-toggler-right text-uppercase font-weight-bold bg-primary text-white rounded\\\" type=\\\"button\\\" data-toggle=\\\"collapse\\\" data-target=\\\"#navbarResponsive\\\" aria-controls=\\\"navbarResponsive\\\" aria-expanded=\\\"false\\\" aria-label=\\\"Toggle navigation\\\">\\n\" +\n\"\\n\" +\n\" <i class=\\\"fas fa-bars\\\"></i>\\n\" +\n\" </button>\\n\" +\n\" <div class=\\\"collapse navbar-collapse\\\" id=\\\"navbarResponsive\\\">\\n\" +\n\" <ul class=\\\"navbar-nav ml-auto\\\">\\n\" +\n\" <li class=\\\"nav-item mx-0 mx-lg-1\\\">\\n\" +\n\" <a class=\\\"nav-link py-3 px-0 px-lg-3 rounded js-scroll-trigger\\\" href=\\\"administracion.html\\\">Administracion</a>\\n\" +\n\" </li>\\n\" +\n\" <li class=\\\"nav-item mx-0 mx-lg-1\\\">\\n\" +\n\" <a class=\\\"nav-link py-3 px-0 px-lg-3 rounded js-scroll-trigger\\\" href=\\\"#about\\\">Reglas de manejo</a>\\n\" +\n\" </li>\\n\" +\n\" <li class=\\\"nav-item mx-0 mx-lg-1\\\">\\n\" +\n\" <a class=\\\"nav-link py-3 px-0 px-lg-3 rounded js-scroll-trigger\\\" href=\\\"#contact\\\">Pruebas de manejo</a>\\n\" +\n\" </li>\\n\" +\n\" </ul>\\n\" +\n\" </div>\\n\" +\n\"</div>\\n\" +\n\"</nav>\\n\" +\n\"</div>\\n\" +\n\"</div> <br>\\n\" +\n\"<br>\\n\" +\n\"<br><br>\\n\" +\n\"<br>\\n\" +\n\"<br>\\n\"); \n \n //METODOSSS\n out.println(\"<h1>Metodos de HTTP </h1>\");\n out.println(\"Metodo HTTP:\"+metodoHTTP);\n out.print(\"<br>\");\n out.print(\"Uri solicitado\"+ur);\n out.print(\"<br>\");\n out.print(\"<br>\");\n out.println(\"</body>\");\n out.println(\"</html>\"); \n \n Enumeration cabeceros=request.getHeaderNames();\n while(cabeceros.hasMoreElements())\n {\n String nombreCabecero=(String)cabeceros.nextElement();\n out.println(\"<b>\"+nombreCabecero+\"</b>\");\n out.println(request.getHeader(nombreCabecero));\n out.print(\"<br>\");\n \n \n } //fin While \n \n \n \n \n } //fin try E5\n \n finally\n {\n out.close();\n } //fin finally \n \n } //fin If E5\n \n \n \n \n //MANEJO DE COOKIES\n \n else\n {\n if(ejercicio8.equals(envio8))\n {\n //Suponemos que el usuario esta visitando por primera vez nuestros sitio\n boolean nuevoUsuario =true;\n \n //obtenemos todas las cookies\n Cookie[] cookies=request.getCookies();\n \n //Buscamos si ya existe una coockie creada con anterioridad\n //llamada visitanteRecurrente\n \n if(cookies != null)\n {\n for(Cookie c : cookies)\n {\n if(c.getName().equals(\"visitanteRecurrente\") && c.getValue().equals(\"si\"))\n {\n //En caso de que ya exista una cookie indicando \n //que ya existe un usuario registrado con anterioridad\n //ponemos la bandera en falso y salimos del ciclo \n nuevoUsuario=false;\n break;\n }\n }\n }\n \n String mensaje=null;\n if(nuevoUsuario)\n {\n //En caso de ser un usuario nuevo creamos el objeto Cookie\n Cookie visitanteCookie=new Cookie(\"visitanteRecurrente\", \"si\");\n //Agregamos la cookie en la respuesta\n response.addCookie(visitanteCookie);\n mensaje=\"Gracias por visitar nuestro sitio\";\n }\n else\n {\n mensaje=\"Gracias por visitar NUEVAMENTE nuestro sitio\";\n }\n \n //Escribimos la salida\n response.setContentType(\"text/html\");\n PrintWriter out = response.getWriter();\n \n \n out.println(\"<html>\\n\" +\n\" <head>\\n\" +\n\" <link rel=\\\"stylesheet\\\" href=\\\"https://maxcdn.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css\\\">\\n\" +\n\" <link href=\\\"https://fonts.googleapis.com/css?family=Alegreya|Chilanka|Dancing+Script|Kalam|Pacifico|Satisfy&display=swap\\\" rel=\\\"stylesheet\\\">\\n\" +\n\" <script src=\\\"https://ajax.googleapis.com/ajax/libs/jquery/3.4.1/jquery.min.js\\\"></script>\\n\" +\n\"<script src=\\\"https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.14.7/umd/popper.min.js\\\"></script> \\n\" +\n\"<script src=\\\"https://maxcdn.bootstrapcdn.com/bootstrap/4.3.1/js/bootstrap.min.js\\\"></script>\\n\" +\n\"<style>/* Make the image fully responsive */\\n\" +\n\".carousel-inner img {\\n\" +\n\"width: 100%;\\n\" +\n\"height: 100%; \\n\" +\n\"}\\n\" +\n\"</style>\\n\" +\n\"\\n\" +\n\"<title>Grecia</title>\\n\" +\n\"\\n\" +\n\"<!-- Custom fonts for this theme -->\\n\" +\n\"<link href=\\\"vendor/fontawesome-free/css/all.min.css\\\" rel=\\\"stylesheet\\\" type=\\\"text/css\\\">\\n\" +\n\"<link href=\\\"https://fonts.googleapis.com/css?family=Montserrat:400,700\\\" rel=\\\"stylesheet\\\" type=\\\"text/css\\\">\\n\" +\n\"<link href=\\\"https://fonts.googleapis.com/css?family=Lato:400,700,400italic,700italic\\\" rel=\\\"stylesheet\\\" type=\\\"text/css\\\">\\n\" +\n\"\\n\" +\n\"<!-- Theme CSS -->\\n\" +\n\"<link href=\\\"css/freelancer.css\\\" rel=\\\"stylesheet\\\">\\n\" +\n\"<link href=\\\"css/estilo-indexp.css\\\" rel=\\\"stylesheet\\\">\\n\" +\n\"\\n\" +\n\"<!--Tabla de bootstrap-->\\n\" +\n\"\\n\" +\n\"<script src=\\\"https://ajax.googleapis.com/ajax/libs/jquery/3.4.1/jquery.min.js\\\"></script>\\n\" +\n\"<script src=\\\"https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.14.7/umd/popper.min.js\\\"></script>\\n\" +\n\"<script src=\\\"https://maxcdn.bootstrapcdn.com/bootstrap/4.3.1/js/bootstrap.min.js\\\"></script>\\n\" +\n\"\\n\" +\n\"<link href=\\\"https://fonts.googleapis.com/css?family=Nunito+Sans&display=swap\\\" rel=\\\"stylesheet\\\">\\n\" +\n\"<link href=\\\"https://fonts.googleapis.com/css?family=Chilanka|Nanum+Gothic:400,700|Source+Sans+Pro&display=swap\\\" rel=\\\"stylesheet\\\">\\n\" +\n\"\\n\" +\n\"<!--Estilos del formulario 3-->\\n\" +\n\"<link rel=\\\"stylesheet\\\" type=\\\"text/css\\\" href=\\\"css/estilos.css\\\">\\n\" +\n\"\\n\" +\n\"<!--Estilos ejercicio 4-->\\n\" +\n\" <script type=\\\"text/javascript\\\" src=\\\"css/funcioness.js\\\"></script>\\n\" +\n\" <!--Bootstrap formulario-->\\n\" +\n\"\\n\" +\n\"\\n\" +\n\"\\n\" +\n\"</head>\\n\" +\n\" \\n\" +\n\"\\n\" +\n\"<body id=\\\"page-top\\\">\\n\" +\n\" <!-- NavBar -->\\n\" +\n\"<nav class=\\\"navbar navbar-expand-lg bg-secondary text-uppercase fixed-top\\\" id=\\\"mainNav\\\">\\n\" +\n\"<div class=\\\"container\\\">\\n\" +\n\"\\n\" +\n\" \\n\" +\n\" <form method=\\\"post\\\" action=\\\"servletParametros1\\\" >\\n\" +\n\" <a class=\\\"navbar-brand js-scroll-trigger\\\" >Bienvenido SINAHI</a>\\n\" +\n \" <center>\\n\" +\n\" <button name=\\\"inicio\\\" value=\\\"inicio\\\" class=\\\"boton_inicio\\\">inicio</button>\\n\" +\n\" </center>\"+ \n\" </form>\\n\" +\n\"\\n\" +\n\"\\n\" +\n\"<button class=\\\"navbar-toggler navbar-toggler-right text-uppercase font-weight-bold bg-primary text-white rounded\\\" type=\\\"button\\\" data-toggle=\\\"collapse\\\" data-target=\\\"#navbarResponsive\\\" aria-controls=\\\"navbarResponsive\\\" aria-expanded=\\\"false\\\" aria-label=\\\"Toggle navigation\\\">\\n\" +\n\"\\n\" +\n\" <i class=\\\"fas fa-bars\\\"></i>\\n\" +\n\" </button>\\n\" +\n\" <div class=\\\"collapse navbar-collapse\\\" id=\\\"navbarResponsive\\\">\\n\" +\n\" <ul class=\\\"navbar-nav ml-auto\\\">\\n\" +\n\" <li class=\\\"nav-item mx-0 mx-lg-1\\\">\\n\" +\n\" <a class=\\\"nav-link py-3 px-0 px-lg-3 rounded js-scroll-trigger\\\" href=\\\"administracion.html\\\">Administracion</a>\\n\" +\n\" </li>\\n\" +\n\" <li class=\\\"nav-item mx-0 mx-lg-1\\\">\\n\" +\n\" <a class=\\\"nav-link py-3 px-0 px-lg-3 rounded js-scroll-trigger\\\" href=\\\"#about\\\">Reglas de manejo</a>\\n\" +\n\" </li>\\n\" +\n\" <li class=\\\"nav-item mx-0 mx-lg-1\\\">\\n\" +\n\" <a class=\\\"nav-link py-3 px-0 px-lg-3 rounded js-scroll-trigger\\\" href=\\\"#contact\\\">Pruebas de manejo</a>\\n\" +\n\" </li>\\n\" +\n\" </ul>\\n\" +\n\" </div>\\n\" +\n\"</div>\\n\" +\n\"</nav>\\n\" +\n\"</div>\\n\" +\n\"</div> <br>\\n\" +\n\"<br>\\n\" +\n\"<br><br>\\n\" +\n\"<br>\\n\" +\n\"<br>\\n\");\n\n \n //omitimos codigo HTML para simplificar el codigo\n out.println(\"<center>Mensaje: \"+ mensaje+\"<center>\");\n \n \n } //fin if 8\n \n }//fin else 8\n } //fin Else E5\n } //Fin Else E4 \n }", "@PostMapping(\"registrar\")\n public ResponseEntity<?> registrar(@RequestBody String payload) {\n\n JsonObject json = new Gson().fromJson(payload, JsonObject.class);\n try {\n log.info(\"Pude crear el objeto básico JSON \");\n log.info(\"siendo: \" + payload.toString());\n //log.info( \" Como yo se los objetos que vienen, puedo castear los wrappers por parte\");\n //log.info( \"Objeto 1: LoginDatos, Objeto 2: Formulario (String), 3: String[+ \");\n Usuario usuario = new Gson().fromJson(json.get(\"usuario\"), Usuario.class);\n JsonObject formulario = new Gson().fromJson(json.get(\"formulario\"), JsonObject.class);\n log.info(\"FORM: \" + formulario.toString());\n boolean artista = formulario.get(\"isArtista\").getAsBoolean();\n\n if (artista) {\n String instrumentos = new Gson().fromJson(json.get(\"instrumentos\"), String.class);\n this.usuarioServicio.guardarArtista(usuario, formulario, instrumentos);\n return new ResponseEntity(new Mensaje(\" El usuario ARTISTA se creó correctamente\"), HttpStatus.OK);\n } else {\n this.usuarioServicio.guardarComercio(usuario, formulario);\n return new ResponseEntity(new Mensaje(\" El usuario COMERCIO se creó correctamente\"), HttpStatus.OK);\n\n }\n\n } catch (Exception e) {\n return new ResponseEntity(new Mensaje(\" El uNOOOOOOOOOOOOOOOOOOOO se creó correctamente\"), HttpStatus.BAD_REQUEST);\n }\n }", "public Form_soal() {\n initComponents();\n tampil_soal();\n }", "@RequestMapping(value = \"sinResultado\", method = RequestMethod.GET)\n public ModelAndView initCreateFormSR(HttpServletRequest request) throws Exception {\n logger.debug(\"Crear reporte general de notificaciones\");\n String urlValidacion=\"\";\n try {\n urlValidacion = seguridadService.validarLogin(request);\n //si la url esta vacia significa que la validación del login fue exitosa\n if (urlValidacion.isEmpty())\n urlValidacion = seguridadService.validarAutorizacionUsuario(request, ConstantsSecurity.SYSTEM_CODE, false);\n }catch (Exception e){\n e.printStackTrace();\n urlValidacion = \"404\";\n }\n ModelAndView mav = new ModelAndView();\n if (urlValidacion.isEmpty()) {\n mav.setViewName(\"reportes/residencia/sinResultado\");\n long idUsuario = seguridadService.obtenerIdUsuario(request);\n List<EntidadesAdtvas> entidades = new ArrayList<EntidadesAdtvas>();\n if (seguridadService.esUsuarioNivelCentral(idUsuario, ConstantsSecurity.SYSTEM_CODE)){\n entidades = entidadAdmonService.getAllEntidadesAdtvas();\n }else {\n entidades = seguridadService.obtenerEntidadesPorUsuario((int) idUsuario, ConstantsSecurity.SYSTEM_CODE);\n }\n List<TipoNotificacion> tiposNotificacion = new ArrayList<TipoNotificacion>();// = catalogosService.getTipoNotificacion();\n TipoNotificacion tipoNotificacionSF = catalogosService.getTipoNotificacion(\"TPNOTI|SINFEB\");\n TipoNotificacion tipoNotificacionIRA = catalogosService.getTipoNotificacion(\"TPNOTI|IRAG\");\n tiposNotificacion.add(tipoNotificacionSF);\n tiposNotificacion.add(tipoNotificacionIRA);\n List<Divisionpolitica> departamentos = divisionPoliticaService.getAllDepartamentos();\n List<AreaRep> areas = seguridadService.getAreasUsuario((int)idUsuario,4);\n mav.addObject(\"areas\", areas);\n mav.addObject(\"departamentos\", departamentos);\n mav.addObject(\"entidades\",entidades);\n mav.addObject(\"tiposNotificacion\", tiposNotificacion);\n\n }else{\n mav.setViewName(urlValidacion);\n }\n return mav;\n }", "public FormImportar() {\n initComponents();\n }", "public boolean configure(StaplerRequest req, JSONObject o) throws FormException {\n \trhapsodyClPath = o.getString(\"rhapsodyClPath\");\n \tlicenseServerPath = o.getString(\"licenseServerPath\");\n save();\n return super.configure(req, o);\n }", "public void guardarDatos() throws Exception {\r\n\t\ttry {\r\n\t\t\tsetUpperCase();\r\n\t\t\tif (validarForm()) {\r\n\t\t\t\t// Cargamos los componentes //\r\n\r\n\t\t\t\tMap datos = new HashMap();\r\n\r\n\t\t\t\tHis_atencion_embarazada his_atencion_embarazada = new His_atencion_embarazada();\r\n\t\t\t\this_atencion_embarazada.setCodigo_empresa(empresa\r\n\t\t\t\t\t\t.getCodigo_empresa());\r\n\t\t\t\this_atencion_embarazada.setCodigo_sucursal(sucursal\r\n\t\t\t\t\t\t.getCodigo_sucursal());\r\n\t\t\t\this_atencion_embarazada.setCodigo_historia(tbxCodigo_historia\r\n\t\t\t\t\t\t.getValue());\r\n\t\t\t\this_atencion_embarazada.setFecha_inicial(new Timestamp(\r\n\t\t\t\t\t\tdtbxFecha_inicial.getValue().getTime()));\r\n\t\t\t\this_atencion_embarazada.setCodigo_eps(tbxCodigo_eps.getValue());\r\n\t\t\t\this_atencion_embarazada.setCodigo_dpto(lbxCodigo_dpto\r\n\t\t\t\t\t\t.getSelectedItem().getValue().toString());\r\n\t\t\t\this_atencion_embarazada.setCodigo_municipio(lbxCodigo_municipio\r\n\t\t\t\t\t\t.getSelectedItem().getValue().toString());\r\n\t\t\t\this_atencion_embarazada.setIdentificacion(tbxIdentificacion\r\n\t\t\t\t\t\t.getValue());\r\n\t\t\t\this_atencion_embarazada.setDireccion(tbxMotivo.getValue());\r\n\t\t\t\this_atencion_embarazada.setTelefono(tbxTelefono.getValue());\r\n\t\t\t\this_atencion_embarazada.setSeleccion(rdbSeleccion\r\n\t\t\t\t\t\t.getSelectedItem().getValue().toString());\r\n\t\t\t\this_atencion_embarazada.setGestaciones(lbxGestaciones\r\n\t\t\t\t\t\t.getSelectedItem().getValue().toString());\r\n\t\t\t\this_atencion_embarazada.setPartos(lbxPartos.getSelectedItem()\r\n\t\t\t\t\t\t.getValue().toString());\r\n\t\t\t\this_atencion_embarazada.setCesarias(lbxCesarias\r\n\t\t\t\t\t\t.getSelectedItem().getValue().toString());\r\n\t\t\t\this_atencion_embarazada.setAbortos(lbxAbortos.getSelectedItem()\r\n\t\t\t\t\t\t.getValue().toString());\r\n\t\t\t\this_atencion_embarazada.setEspontaneo(lbxEspontaneo\r\n\t\t\t\t\t\t.getSelectedItem().getValue().toString());\r\n\t\t\t\this_atencion_embarazada.setProvocado(lbxProvocado\r\n\t\t\t\t\t\t.getSelectedItem().getValue().toString());\r\n\t\t\t\this_atencion_embarazada.setNacido_muerto(lbxNacido_muerto\r\n\t\t\t\t\t\t.getSelectedItem().getValue().toString());\r\n\t\t\t\this_atencion_embarazada.setPrematuro(lbxPrematuro\r\n\t\t\t\t\t\t.getSelectedItem().getValue().toString());\r\n\t\t\t\this_atencion_embarazada.setHijos_menos(lbxHijos_menos\r\n\t\t\t\t\t\t.getSelectedItem().getValue().toString());\r\n\t\t\t\this_atencion_embarazada.setHijos_mayor(lbxHijos_mayor\r\n\t\t\t\t\t\t.getSelectedItem().getValue().toString());\r\n\t\t\t\this_atencion_embarazada.setMalformado(lbxMalformado\r\n\t\t\t\t\t\t.getSelectedItem().getValue().toString());\r\n\t\t\t\this_atencion_embarazada.setHipertension(lbxHipertension\r\n\t\t\t\t\t\t.getSelectedItem().getValue().toString());\r\n\t\t\t\this_atencion_embarazada.setFecha_ultimo_parto(new Timestamp(\r\n\t\t\t\t\t\tdtbxFecha_ultimo_parto.getValue().getTime()));\r\n\t\t\t\this_atencion_embarazada.setCirugia(lbxCirugia.getSelectedItem()\r\n\t\t\t\t\t\t.getValue().toString());\r\n\t\t\t\this_atencion_embarazada.setOtro_antecedente(tbxOtro_antecedente\r\n\t\t\t\t\t\t.getValue());\r\n\t\t\t\this_atencion_embarazada\r\n\t\t\t\t\t\t.setHemoclasificacion(lbxHemoclasificacion\r\n\t\t\t\t\t\t\t\t.getSelectedItem().getValue().toString());\r\n\t\t\t\this_atencion_embarazada.setRh(lbxRh.getSelectedItem()\r\n\t\t\t\t\t\t.getValue().toString());\r\n\t\t\t\this_atencion_embarazada.setPeso(tbxPeso.getValue());\r\n\t\t\t\this_atencion_embarazada.setTalla(tbxTalla.getValue());\r\n\t\t\t\this_atencion_embarazada.setImc(tbxImc.getValue());\r\n\t\t\t\this_atencion_embarazada.setTa(tbxTa.getValue());\r\n\t\t\t\this_atencion_embarazada.setFc(tbxFc.getValue());\r\n\t\t\t\this_atencion_embarazada.setFr(tbxFr.getValue());\r\n\t\t\t\this_atencion_embarazada.setTemperatura(tbxTemperatura\r\n\t\t\t\t\t\t.getValue());\r\n\t\t\t\this_atencion_embarazada.setCroomb(tbxCroomb.getValue());\r\n\t\t\t\this_atencion_embarazada\r\n\t\t\t\t\t\t.setFecha_ultima_mestruacion(new Timestamp(\r\n\t\t\t\t\t\t\t\tdtbxFecha_ultima_mestruacion.getValue()\r\n\t\t\t\t\t\t\t\t\t\t.getTime()));\r\n\t\t\t\this_atencion_embarazada.setFecha_probable_parto(new Timestamp(\r\n\t\t\t\t\t\tdtbxFecha_probable_parto.getValue().getTime()));\r\n\t\t\t\this_atencion_embarazada.setEdad_gestacional(tbxEdad_gestacional\r\n\t\t\t\t\t\t.getValue());\r\n\t\t\t\this_atencion_embarazada.setControl(lbxControl.getSelectedItem()\r\n\t\t\t\t\t\t.getValue().toString());\r\n\t\t\t\this_atencion_embarazada.setNum_control(tbxNum_control\r\n\t\t\t\t\t\t.getValue());\r\n\t\t\t\this_atencion_embarazada.setFetales(lbxFetales.getSelectedItem()\r\n\t\t\t\t\t\t.getValue().toString());\r\n\t\t\t\this_atencion_embarazada.setFiebre(lbxFiebre.getSelectedItem()\r\n\t\t\t\t\t\t.getValue().toString());\r\n\t\t\t\this_atencion_embarazada.setLiquido(lbxLiquido.getSelectedItem()\r\n\t\t\t\t\t\t.getValue().toString());\r\n\t\t\t\this_atencion_embarazada.setFlujo(lbxFlujo.getSelectedItem()\r\n\t\t\t\t\t\t.getValue().toString());\r\n\t\t\t\this_atencion_embarazada.setEnfermedad(lbxEnfermedad\r\n\t\t\t\t\t\t.getSelectedItem().getValue().toString());\r\n\t\t\t\this_atencion_embarazada.setCual_enfermedad(tbxCual_enfermedad\r\n\t\t\t\t\t\t.getValue());\r\n\t\t\t\this_atencion_embarazada.setCigarrillo(lbxCigarrillo\r\n\t\t\t\t\t\t.getSelectedItem().getValue().toString());\r\n\t\t\t\this_atencion_embarazada.setAlcohol(lbxAlcohol.getSelectedItem()\r\n\t\t\t\t\t\t.getValue().toString());\r\n\t\t\t\this_atencion_embarazada.setCual_alcohol(tbxCual_alcohol\r\n\t\t\t\t\t\t.getValue());\r\n\t\t\t\this_atencion_embarazada.setDroga(lbxDroga.getSelectedItem()\r\n\t\t\t\t\t\t.getValue().toString());\r\n\t\t\t\this_atencion_embarazada.setCual_droga(tbxCual_droga.getValue());\r\n\t\t\t\this_atencion_embarazada.setViolencia(lbxViolencia\r\n\t\t\t\t\t\t.getSelectedItem().getValue().toString());\r\n\t\t\t\this_atencion_embarazada.setCual_violencia(tbxCual_violencia\r\n\t\t\t\t\t\t.getValue());\r\n\t\t\t\this_atencion_embarazada.setToxoide(lbxToxoide.getSelectedItem()\r\n\t\t\t\t\t\t.getValue().toString());\r\n\t\t\t\this_atencion_embarazada.setDosis(lbxDosis.getSelectedItem()\r\n\t\t\t\t\t\t.getValue().toString());\r\n\t\t\t\this_atencion_embarazada\r\n\t\t\t\t\t\t.setObservaciones_gestion(tbxObservaciones_gestion\r\n\t\t\t\t\t\t\t\t.getValue());\r\n\t\t\t\this_atencion_embarazada.setAltura_uterina(tbxAltura_uterina\r\n\t\t\t\t\t\t.getValue());\r\n\t\t\t\this_atencion_embarazada\r\n\t\t\t\t\t\t.setCorelacion(chbCorelacion.isChecked());\r\n\t\t\t\this_atencion_embarazada\r\n\t\t\t\t\t\t.setEmbarazo_multiple(chbEmbarazo_multiple.isChecked());\r\n\t\t\t\this_atencion_embarazada\r\n\t\t\t\t\t\t.setTrasmision_sexual(chbTrasmision_sexual.isChecked());\r\n\t\t\t\this_atencion_embarazada.setAnomalia(rdbAnomalia\r\n\t\t\t\t\t\t.getSelectedItem().getValue().toString());\r\n\t\t\t\this_atencion_embarazada.setEdema_gestion(rdbEdema_gestion\r\n\t\t\t\t\t\t.getSelectedItem().getValue().toString());\r\n\t\t\t\this_atencion_embarazada.setPalidez(rdbPalidez.getSelectedItem()\r\n\t\t\t\t\t\t.getValue().toString());\r\n\t\t\t\this_atencion_embarazada.setConvulciones(rdbConvulciones\r\n\t\t\t\t\t\t.getSelectedItem().getValue().toString());\r\n\t\t\t\this_atencion_embarazada.setConciencia(rdbConciencia\r\n\t\t\t\t\t\t.getSelectedItem().getValue().toString());\r\n\t\t\t\this_atencion_embarazada.setCavidad_bucal(rdbCavidad_bucal\r\n\t\t\t\t\t\t.getSelectedItem().getValue().toString());\r\n\t\t\t\this_atencion_embarazada.setHto(tbxHto.getValue());\r\n\t\t\t\this_atencion_embarazada.setHb(tbxHb.getValue());\r\n\t\t\t\this_atencion_embarazada.setToxoplasma(tbxToxoplasma.getValue());\r\n\t\t\t\this_atencion_embarazada.setVdrl1(tbxVdrl1.getValue());\r\n\t\t\t\this_atencion_embarazada.setVdrl2(tbxVdrl2.getValue());\r\n\t\t\t\this_atencion_embarazada.setVih1(tbxVih1.getValue());\r\n\t\t\t\this_atencion_embarazada.setVih2(tbxVih2.getValue());\r\n\t\t\t\this_atencion_embarazada.setHepb(tbxHepb.getValue());\r\n\t\t\t\this_atencion_embarazada.setOtro(tbxOtro.getValue());\r\n\t\t\t\this_atencion_embarazada.setEcografia(tbxEcografia.getValue());\r\n\t\t\t\this_atencion_embarazada\r\n\t\t\t\t\t\t.setClasificacion_gestion(rdbClasificacion_gestion\r\n\t\t\t\t\t\t\t\t.getSelectedItem().getValue().toString());\r\n\t\t\t\this_atencion_embarazada.setContracciones(lbxContracciones\r\n\t\t\t\t\t\t.getSelectedItem().getValue().toString());\r\n\t\t\t\this_atencion_embarazada\r\n\t\t\t\t\t\t.setNum_contracciones(lbxNum_contracciones\r\n\t\t\t\t\t\t\t\t.getSelectedItem().getValue().toString());\r\n\t\t\t\this_atencion_embarazada.setHemorragia(lbxHemorragia\r\n\t\t\t\t\t\t.getSelectedItem().getValue().toString());\r\n\t\t\t\this_atencion_embarazada.setLiquido_vaginal(lbxLiquido_vaginal\r\n\t\t\t\t\t\t.getSelectedItem().getValue().toString());\r\n\t\t\t\this_atencion_embarazada.setColor_liquido(tbxColor_liquido\r\n\t\t\t\t\t\t.getValue());\r\n\t\t\t\this_atencion_embarazada.setDolor_cabeza(lbxDolor_cabeza\r\n\t\t\t\t\t\t.getSelectedItem().getValue().toString());\r\n\t\t\t\this_atencion_embarazada.setVision(lbxVision.getSelectedItem()\r\n\t\t\t\t\t\t.getValue().toString());\r\n\t\t\t\this_atencion_embarazada.setConvulcion(lbxConvulcion\r\n\t\t\t\t\t\t.getSelectedItem().getValue().toString());\r\n\t\t\t\this_atencion_embarazada\r\n\t\t\t\t\t\t.setObservaciones_parto(tbxObservaciones_parto\r\n\t\t\t\t\t\t\t\t.getValue());\r\n\t\t\t\this_atencion_embarazada\r\n\t\t\t\t\t\t.setContracciones_min(tbxContracciones_min.getValue());\r\n\t\t\t\this_atencion_embarazada.setFc_fera(tbxFc_fera.getValue());\r\n\t\t\t\this_atencion_embarazada\r\n\t\t\t\t\t\t.setDilatacion_cervical(tbxDilatacion_cervical\r\n\t\t\t\t\t\t\t\t.getValue());\r\n\t\t\t\this_atencion_embarazada.setPreentacion(rdbPreentacion\r\n\t\t\t\t\t\t.getSelectedItem().getValue().toString());\r\n\t\t\t\this_atencion_embarazada\r\n\t\t\t\t\t\t.setOtra_presentacion(tbxOtra_presentacion.getValue());\r\n\t\t\t\this_atencion_embarazada.setEdema(rdbEdema.getSelectedItem()\r\n\t\t\t\t\t\t.getValue().toString());\r\n\t\t\t\this_atencion_embarazada\r\n\t\t\t\t\t\t.setHemorragia_vaginal(lbxHemorragia_vaginal\r\n\t\t\t\t\t\t\t\t.getSelectedItem().getValue().toString());\r\n\t\t\t\this_atencion_embarazada.setHto_parto(tbxHto_parto.getValue());\r\n\t\t\t\this_atencion_embarazada.setHb_parto(tbxHb_parto.getValue());\r\n\t\t\t\this_atencion_embarazada.setHepb_parto(tbxHepb_parto.getValue());\r\n\t\t\t\this_atencion_embarazada.setVdrl_parto(tbxVdrl_parto.getValue());\r\n\t\t\t\this_atencion_embarazada.setVih_parto(tbxVih_parto.getValue());\r\n\t\t\t\this_atencion_embarazada\r\n\t\t\t\t\t\t.setClasificacion_parto(rdbClasificacion_parto\r\n\t\t\t\t\t\t\t\t.getSelectedItem().getValue().toString());\r\n\t\t\t\this_atencion_embarazada.setFecha_nac(new Timestamp(\r\n\t\t\t\t\t\tdtbxFecha_nac.getValue().getTime()));\r\n\t\t\t\this_atencion_embarazada\r\n\t\t\t\t\t\t.setIdentificacion_nac(tbxIdentificacion_nac.getValue());\r\n\t\t\t\this_atencion_embarazada.setSexo(lbxSexo.getSelectedItem()\r\n\t\t\t\t\t\t.getValue().toString());\r\n\t\t\t\this_atencion_embarazada.setPeso_nac(tbxPeso_nac.getValue());\r\n\t\t\t\this_atencion_embarazada.setTalla_nac(tbxTalla_nac.getValue());\r\n\t\t\t\this_atencion_embarazada.setPc_nac(tbxPc_nac.getValue());\r\n\t\t\t\this_atencion_embarazada.setFc_nac(tbxFc_nac.getValue());\r\n\t\t\t\this_atencion_embarazada.setTemper_nac(tbxTemper_nac.getValue());\r\n\t\t\t\this_atencion_embarazada.setEdad(tbxEdad.getValue());\r\n\t\t\t\this_atencion_embarazada.setAdgar1(tbxAdgar1.getValue());\r\n\t\t\t\this_atencion_embarazada.setAdgar5(tbxAdgar5.getValue());\r\n\t\t\t\this_atencion_embarazada.setAdgar10(tbxAdgar10.getValue());\r\n\t\t\t\this_atencion_embarazada.setAdgar20(tbxAdgar20.getValue());\r\n\t\t\t\this_atencion_embarazada\r\n\t\t\t\t\t\t.setObservaciones_nac(tbxObservaciones_nac.getValue());\r\n\t\t\t\this_atencion_embarazada\r\n\t\t\t\t\t\t.setClasificacion_nac(rdbClasificacion_nac\r\n\t\t\t\t\t\t\t\t.getSelectedItem().getValue().toString());\r\n\t\t\t\this_atencion_embarazada.setReani_prematuro(chbReani_prematuro\r\n\t\t\t\t\t\t.isChecked());\r\n\t\t\t\this_atencion_embarazada.setReani_meconio(chbReani_meconio\r\n\t\t\t\t\t\t.isChecked());\r\n\t\t\t\this_atencion_embarazada\r\n\t\t\t\t\t\t.setReani_respiracion(chbReani_respiracion.isChecked());\r\n\t\t\t\this_atencion_embarazada.setReani_hipotonico(chbReani_hipotonico\r\n\t\t\t\t\t\t.isChecked());\r\n\t\t\t\this_atencion_embarazada.setReani_apnea(chbReani_apnea\r\n\t\t\t\t\t\t.isChecked());\r\n\t\t\t\this_atencion_embarazada.setReani_jadeo(chbReani_jadeo\r\n\t\t\t\t\t\t.isChecked());\r\n\t\t\t\this_atencion_embarazada\r\n\t\t\t\t\t\t.setReani_deficultosa(chbReani_deficultosa.isChecked());\r\n\t\t\t\this_atencion_embarazada.setReani_gianosis(chbReani_gianosis\r\n\t\t\t\t\t\t.isChecked());\r\n\t\t\t\this_atencion_embarazada\r\n\t\t\t\t\t\t.setReani_bradicardia(chbReani_bradicardia.isChecked());\r\n\t\t\t\this_atencion_embarazada.setReani_hipoxemia(chbReani_hipoxemia\r\n\t\t\t\t\t\t.isChecked());\r\n\t\t\t\this_atencion_embarazada\r\n\t\t\t\t\t\t.setReani_estimulacion(chbReani_estimulacion\r\n\t\t\t\t\t\t\t\t.isChecked());\r\n\t\t\t\this_atencion_embarazada\r\n\t\t\t\t\t\t.setReani_ventilacion(chbReani_ventilacion.isChecked());\r\n\t\t\t\this_atencion_embarazada\r\n\t\t\t\t\t\t.setReani_comprensiones(chbReani_comprensiones\r\n\t\t\t\t\t\t\t\t.isChecked());\r\n\t\t\t\this_atencion_embarazada.setReani_intubacion(chbReani_intubacion\r\n\t\t\t\t\t\t.isChecked());\r\n\t\t\t\this_atencion_embarazada.setMedicina(tbxMedicina.getValue());\r\n\t\t\t\this_atencion_embarazada\r\n\t\t\t\t\t\t.setClasificacion_reani(rdbClasificacion_reani\r\n\t\t\t\t\t\t\t\t.getSelectedItem().getValue().toString());\r\n\t\t\t\this_atencion_embarazada.setRuptura(lbxRuptura.getSelectedItem()\r\n\t\t\t\t\t\t.getValue().toString());\r\n\t\t\t\this_atencion_embarazada.setTiempo_ruptura(lbxTiempo_ruptura\r\n\t\t\t\t\t\t.getSelectedItem().getValue().toString());\r\n\t\t\t\this_atencion_embarazada.setLiquido_neo(tbxLiquido_neo\r\n\t\t\t\t\t\t.getValue());\r\n\t\t\t\this_atencion_embarazada.setFiebre_neo(lbxFiebre_neo\r\n\t\t\t\t\t\t.getSelectedItem().getValue().toString());\r\n\t\t\t\this_atencion_embarazada.setTiempo_neo(lbxTiempo_neo\r\n\t\t\t\t\t\t.getSelectedItem().getValue().toString());\r\n\t\t\t\this_atencion_embarazada.setCoricamniotis(tbxCoricamniotis\r\n\t\t\t\t\t\t.getValue());\r\n\t\t\t\this_atencion_embarazada.setIntrauterina(rdbIntrauterina\r\n\t\t\t\t\t\t.getSelectedItem().getValue().toString());\r\n\t\t\t\this_atencion_embarazada.setMadre20(lbxMadre20.getSelectedItem()\r\n\t\t\t\t\t\t.getValue().toString());\r\n\t\t\t\this_atencion_embarazada.setAlcohol_neo(chbAlcohol_neo\r\n\t\t\t\t\t\t.isChecked());\r\n\t\t\t\this_atencion_embarazada\r\n\t\t\t\t\t\t.setDrogas_neo(chbDrogas_neo.isChecked());\r\n\t\t\t\this_atencion_embarazada.setCigarrillo_neo(chbCigarrillo_neo\r\n\t\t\t\t\t\t.isChecked());\r\n\t\t\t\this_atencion_embarazada.setRespiracion_neo(rdbRespiracion_neo\r\n\t\t\t\t\t\t.getSelectedItem().getValue().toString());\r\n\t\t\t\this_atencion_embarazada.setLlanto_neo(rdbLlanto_neo\r\n\t\t\t\t\t\t.getSelectedItem().getValue().toString());\r\n\t\t\t\this_atencion_embarazada.setVetalidad_neo(rdbVetalidad_neo\r\n\t\t\t\t\t\t.getSelectedItem().getValue().toString());\r\n\t\t\t\this_atencion_embarazada.setTaquicardia_neo(chbTaquicardia_neo\r\n\t\t\t\t\t\t.isChecked());\r\n\t\t\t\this_atencion_embarazada.setBradicardia_neo(chbBradicardia_neo\r\n\t\t\t\t\t\t.isChecked());\r\n\t\t\t\this_atencion_embarazada.setPalidez_neo(chbPalidez_neo\r\n\t\t\t\t\t\t.isChecked());\r\n\t\t\t\this_atencion_embarazada.setCianosis_neo(chbCianosis_neo\r\n\t\t\t\t\t\t.isChecked());\r\n\t\t\t\this_atencion_embarazada\r\n\t\t\t\t\t\t.setAnomalias_congenitas(lbxAnomalias_congenitas\r\n\t\t\t\t\t\t\t\t.getSelectedItem().getValue().toString());\r\n\t\t\t\this_atencion_embarazada.setCual_anomalias(tbxCual_anomalias\r\n\t\t\t\t\t\t.getValue());\r\n\t\t\t\this_atencion_embarazada.setLesiones(tbxLesiones.getValue());\r\n\t\t\t\this_atencion_embarazada.setOtras_alter(tbxOtras_alter\r\n\t\t\t\t\t\t.getValue());\r\n\t\t\t\this_atencion_embarazada\r\n\t\t\t\t\t\t.setClasificacion_neo(rdbClasificacion_neo\r\n\t\t\t\t\t\t\t\t.getSelectedItem().getValue().toString());\r\n\t\t\t\this_atencion_embarazada.setAlarma(tbxAlarma.getValue());\r\n\t\t\t\this_atencion_embarazada.setConsulta_control(tbxConsulta_control\r\n\t\t\t\t\t\t.getValue());\r\n\t\t\t\this_atencion_embarazada\r\n\t\t\t\t\t\t.setMedidas_preventiva(tbxMedidas_preventiva.getValue());\r\n\t\t\t\this_atencion_embarazada.setRecomendaciones(tbxRecomendaciones\r\n\t\t\t\t\t\t.getValue());\r\n\t\t\t\this_atencion_embarazada.setDiagnostico(tbxDiagnostico\r\n\t\t\t\t\t\t.getValue());\r\n\t\t\t\this_atencion_embarazada\r\n\t\t\t\t\t\t.setCodigo_diagnostico(tbxCodigo_diagnostico.getValue());\r\n\t\t\t\this_atencion_embarazada.setTratamiento(tbxTratamiento\r\n\t\t\t\t\t\t.getValue());\r\n\t\t\t\this_atencion_embarazada\r\n\t\t\t\t\t\t.setRecomendacion_alimentacion(tbxRecomendacion_alimentacion\r\n\t\t\t\t\t\t\t\t.getValue());\r\n\t\t\t\this_atencion_embarazada\r\n\t\t\t\t\t\t.setEvolucion_servicio(tbxEvolucion_servicio.getValue());\r\n\r\n\t\t\t\tdatos.put(\"codigo_historia\", his_atencion_embarazada);\r\n\t\t\t\tdatos.put(\"accion\", tbxAccion.getText());\r\n\r\n\t\t\t\this_atencion_embarazada = getServiceLocator()\r\n\t\t\t\t\t\t.getHis_atencion_embarazadaService().guardar(datos);\r\n\r\n\t\t\t\tif (tbxAccion.getText().equalsIgnoreCase(\"registrar\")) {\r\n\t\t\t\t\taccionForm(true, \"modificar\");\r\n\t\t\t\t}\r\n\t\t\t\t/*\r\n\t\t\t\t * else{ int result =\r\n\t\t\t\t * getServiceLocator().getHis_atencion_embarazadaService\r\n\t\t\t\t * ().actualizar(his_atencion_embarazada); if(result==0){ throw\r\n\t\t\t\t * new Exception(\r\n\t\t\t\t * \"Lo sentimos pero los datos a modificar no se encuentran en base de datos\"\r\n\t\t\t\t * ); } }\r\n\t\t\t\t */\r\n\r\n//\t\t\t\tcodigo_historia = his_atencion_embarazada.getCodigo_historia();\r\n\r\n\t\t\t\tMessagebox.show(\"Los datos se guardaron satisfactoriamente\",\r\n\t\t\t\t\t\t\"Informacion ..\", Messagebox.OK,\r\n\t\t\t\t\t\tMessagebox.INFORMATION);\r\n\r\n\t\t\t}\r\n\r\n\t\t} catch (Exception e) {\r\n\t\t\t\r\n\t\t\tlog.error(e.getMessage(), e);\r\n\t\t\tMessagebox.show(e.getMessage(), \"Mensaje de Error !!\",\r\n\t\t\t\t\tMessagebox.OK, Messagebox.ERROR);\r\n\t\t}\r\n\r\n\t}", "@Override\n public ExtensionResult getForms(ExtensionRequest extensionRequest) {\n Map<String, String> output = new HashMap<>();\n FormBuilder formBuilder = new FormBuilder(appProperties.getFormIdTest());\n\n ButtonTemplate button = new ButtonTemplate();\n button.setTitle(\"Test Form\");\n button.setSubTitle(\"Subtitle is here\");\n button.setPictureLink(appProperties.getAtmUrl());\n button.setPicturePath(appProperties.getAtmUrl());\n List<EasyMap> actions = new ArrayList<>();\n EasyMap bookAction = new EasyMap();\n bookAction.setName(\"Label here\");\n bookAction.setValue(formBuilder.build());\n actions.add(bookAction);\n button.setButtonValues(actions);\n ButtonBuilder buttonBuilder = new ButtonBuilder(button);\n\n output.put(OUTPUT, buttonBuilder.build());\n ExtensionResult extensionResult = new ExtensionResult();\n extensionResult.setAgent(false);\n extensionResult.setRepeat(false);\n extensionResult.setSuccess(true);\n extensionResult.setNext(true);\n extensionResult.setValue(output);\n return extensionResult;\n }", "public String getFormacao() {\n\t\treturn formacao;\n\t}", "public void crearProgramaFormacion(String nombre, String descripcion, Date fechaI, Date fechaF, Date fechaA, String url) throws ProgramaFormacionExcepcion;", "public void guardarSolicitud() {\n Map<String, String> paramMap = getParametrosSesion();\n String cadenaFirmada;\n try {\n if (paramMap != null) {\n cadenaFirmada = paramMap.get(firmaFormHelper.FIRMA_DIGITAL);\n firmaFormHelper.setSelloDigital(paramMap.get(FirmaFormHelper.FIRMA_DIGITAL));\n\n SimpleDateFormat formato = new SimpleDateFormat(\"dd/MM/yyyy\");\n produccion.setFechProduccion(new Date());\n desperdiciosHelper.setFechaAcuse(formato.format(produccion.getFechProduccion()));\n\n if (cadenaFirmada.length() > 0) {\n guardarRangosFolios();\n Acuse acuse = new Acuse();\n acuse.setSerieAcuse(TipoAcuse.DESPERDICIO);\n acuse.setIdProveedor(produccionCigarrosHelper.getProveedor().getIdProveedor());\n acuse.setSelloDigital(firmaFormHelper.getSelloDigital());\n acuse.setCadenaOriginal(firmaFormHelper.getCadenaOriginal());\n acuse.setFecCaptura(new Date());\n desperdiciosHelper.setIdAcuseRecibo(commonService.crearAcuse(acuse));\n habilitarPnlAcuse();\n registroMovimientoBitacora(getSession(), IdentificadorProcesoEnum.CONTRIBUYENTE_TRAMITES, new Date(), new Date(), MovimientosBitacoraEnum.DESPERDICIOS_DESTRUCCION);\n } else {\n habilitarPnlPrincipal();\n }\n }\n } catch (CommonServiceException e) {\n LOGGER.error(e.getMessage(), e);\n addErrorMessage(ERROR, \"No se pudo generar el acuse\");\n } catch (Exception ex) {\n LOGGER.error(ex.getMessage());\n }\n }", "@RequestMapping(\"/processForm\")\n public String processForm(){\n return \"helloworld\";\n }", "@RequestMapping(\"/sendData\") // will wap to the incoming request address\n\tpublic String handelFormRequest(HttpServletRequest request, Model model) {\n\t\tString data = (String)request.getParameter(\"data\");\n\t\tmodel.addAttribute(\"testData\",data); // will be set in request attribute\n\t\tmodel.addAttribute(\"Test\",\"TestVal\"); // will be set in request attribute\n\t\treturn \"getData\";\n\t}", "private void submitForm() {\n Toast.makeText(this, \"Registering...\", Toast.LENGTH_LONG).show();\n }", "@POST\n \t@Path(\"/form\")\n \t@Consumes(MediaType.APPLICATION_FORM_URLENCODED)\n \t@Produces(MediaType.TEXT_PLAIN)\n \tpublic String formMethod(@QueryParam(\"token\") String token,\n \t\t\t@FormParam(\"name\") String name,\n \t\t\t@FormParam(\"location\") String location) {\n \t\t// map json to json object \n \t\treturn token + \"::\" + name + \"::\" + location + \"\\n\";\n \t}", "private void entrar() {\n\n Connection con = Conexao.abrirConexao();\n UsuarioDAO ud = new UsuarioDAO(con);\n String login = txtLOGIN.getText();\n String senha = txtSENHA.getText();\n String nome;\n\n if (txtLOGIN.getText().equals(\"admin\")) {\n nome = \"Administrador\";\n } else {\n nome = ud.retornarUsuario(login);\n }\n\n if (/*ud.logar(login, senha) == 0 ||*/ login.equals(\"admin\") && senha.equals(\"admin\")) {\n lblERRO.setText(\"\");\n JFrame principal = new frm_PRINCIPAL(login, nome);\n this.dispose();\n principal.setVisible(true);\n\n } else {\n\n lblERRO.setText(\"Usuário e/ou Senha Inválidos!\");\n }\n Conexao.fecharConexao(con);\n }", "@GetMapping(\"hello\")\n @ResponseBody\n public String helloLangForm() {\n String html = \"<html>\" +\n \"<form method='post' action=''>\" +\n \"<input type='text' name='name' />\" +\n \"<select name='language'>\" +\n \"<option value='english'>English</option>\" +\n \"<option value='french'>French</option>\" +\n \"<option value='german'>German</option>\" +\n \"<option value='spanish'>Spanish</option>\" +\n \"<option value='arabic'>Arabic</option>\" +\n \"<input type='submit' value='Greet me!'/>\" +\n \"</form>\" +\n \"</html>\";\n\n return html;\n }", "private void formRequest() {\r\n\t\tbyte[] user_bytes = _userName.getBytes();\r\n\t\tbyte[] password_bytes = _password.getBytes();\r\n\r\n\t\t_request = new byte[3 + user_bytes.length + password_bytes.length];\r\n\t\t_request[0] = (byte) 1;\r\n\t\t_request[1] = (byte) user_bytes.length;\r\n\t\tSystem.arraycopy(user_bytes, 0, _request, 2, user_bytes.length);\r\n\t\t_request[2 + user_bytes.length] = (byte) password_bytes.length;\r\n\t\tSystem.arraycopy(password_bytes, 0, _request, 3 + user_bytes.length, password_bytes.length);\r\n\t}", "@GetMapping(\"/formuQuejas\") \n\tpublic String verInicio(Model model) {\n\t\treturn \"PQR/formQuejas\";\n\t}", "private void cargarDatos()\n {\n // Pantalla carga\n showProgress(true, mView, mProgressView, getContext());\n Comando login = new LoginComando(KPantallas.PANTALLA_PERFIL);\n String email = UtilUI.getEmail(getContext());\n String password = UtilUI.getPassword(getContext());\n login.ejecutar(email,password);\n }", "public void guardarDatos() throws Exception {\r\n\t\ttry {\r\n\t\t\tsetUpperCase();\r\n\t\t\tif (validarForm()) {\r\n\t\t\t\t// Cargamos los componentes //\r\n\r\n\t\t\t\tMap datos = new HashMap();\r\n\r\n\t\t\t\tHis_parto his_parto = new His_parto();\r\n\t\t\t\this_parto.setCodigo_empresa(empresa.getCodigo_empresa());\r\n\t\t\t\this_parto.setCodigo_sucursal(sucursal.getCodigo_sucursal());\r\n\t\t\t\this_parto.setCodigo_historia(tbxCodigo_historia.getValue());\r\n\t\t\t\this_parto.setIdentificacion(tbxIdentificacion.getValue());\r\n\t\t\t\this_parto.setFecha_inicial(new Timestamp(dtbxFecha_inicial\r\n\t\t\t\t\t\t.getValue().getTime()));\r\n\t\t\t\this_parto.setConyugue(tbxConyugue.getValue());\r\n\t\t\t\this_parto.setId_conyugue(tbxId_conyugue.getValue());\r\n\t\t\t\this_parto.setEdad_conyugue(tbxEdad_conyugue.getValue());\r\n\t\t\t\this_parto.setEscolaridad_conyugue(tbxEscolaridad_conyugue\r\n\t\t\t\t\t\t.getValue());\r\n\t\t\t\this_parto.setMotivo(tbxMotivo.getValue());\r\n\t\t\t\this_parto.setEnfermedad_actual(tbxEnfermedad_actual.getValue());\r\n\t\t\t\this_parto.setAntecedentes_familiares(tbxAntecedentes_familiares\r\n\t\t\t\t\t\t.getValue());\r\n\t\t\t\this_parto.setPreeclampsia(rdbPreeclampsia.getSelectedItem()\r\n\t\t\t\t\t\t.getValue().toString());\r\n\t\t\t\this_parto.setHipertension(rdbHipertension.getSelectedItem()\r\n\t\t\t\t\t\t.getValue().toString());\r\n\t\t\t\this_parto.setEclampsia(rdbEclampsia.getSelectedItem()\r\n\t\t\t\t\t\t.getValue().toString());\r\n\t\t\t\this_parto.setH1(rdbH1.getSelectedItem().getValue().toString());\r\n\t\t\t\this_parto.setH2(rdbH2.getSelectedItem().getValue().toString());\r\n\t\t\t\this_parto.setPostimadurez(rdbPostimadurez.getSelectedItem()\r\n\t\t\t\t\t\t.getValue().toString());\r\n\t\t\t\this_parto.setRot_pre(rdbRot_pre.getSelectedItem().getValue()\r\n\t\t\t\t\t\t.toString());\r\n\t\t\t\this_parto.setPolihidramnios(rdbPolihidramnios.getSelectedItem()\r\n\t\t\t\t\t\t.getValue().toString());\r\n\t\t\t\this_parto.setRcui(rdbRcui.getSelectedItem().getValue()\r\n\t\t\t\t\t\t.toString());\r\n\t\t\t\this_parto.setPelvis(rdbPelvis.getSelectedItem().getValue()\r\n\t\t\t\t\t\t.toString());\r\n\t\t\t\this_parto.setFeto_macrosonico(rdbFeto_macrosonico\r\n\t\t\t\t\t\t.getSelectedItem().getValue().toString());\r\n\t\t\t\this_parto.setIsoinmunizacion(rdbIsoinmunizacion\r\n\t\t\t\t\t\t.getSelectedItem().getValue().toString());\r\n\t\t\t\this_parto.setAo(rdbAo.getSelectedItem().getValue().toString());\r\n\t\t\t\this_parto.setCirc_cordon(rdbCirc_cordon.getSelectedItem()\r\n\t\t\t\t\t\t.getValue().toString());\r\n\t\t\t\this_parto.setPostparto(rdbPostparto.getSelectedItem()\r\n\t\t\t\t\t\t.getValue().toString());\r\n\t\t\t\this_parto.setDiabetes(rdbDiabetes.getSelectedItem().getValue()\r\n\t\t\t\t\t\t.toString());\r\n\t\t\t\this_parto.setCardiopatia(rdbCardiopatia.getSelectedItem()\r\n\t\t\t\t\t\t.getValue().toString());\r\n\t\t\t\this_parto.setAnemias(rdbAnemias.getSelectedItem().getValue()\r\n\t\t\t\t\t\t.toString());\r\n\t\t\t\this_parto.setEnf_autoinmunes(rdbEnf_autoinmunes\r\n\t\t\t\t\t\t.getSelectedItem().getValue().toString());\r\n\t\t\t\this_parto.setEnf_renales(rdbEnf_renales.getSelectedItem()\r\n\t\t\t\t\t\t.getValue().toString());\r\n\t\t\t\this_parto.setInf_urinaria(rdbInf_urinaria.getSelectedItem()\r\n\t\t\t\t\t\t.getValue().toString());\r\n\t\t\t\this_parto.setEpilepsia(rdbEpilepsia.getSelectedItem()\r\n\t\t\t\t\t\t.getValue().toString());\r\n\t\t\t\this_parto\r\n\t\t\t\t\t\t.setTbc(rdbTbc.getSelectedItem().getValue().toString());\r\n\t\t\t\this_parto.setMiomas(rdbMiomas.getSelectedItem().getValue()\r\n\t\t\t\t\t\t.toString());\r\n\t\t\t\this_parto.setHb(rdbHb.getSelectedItem().getValue().toString());\r\n\t\t\t\this_parto.setFumadora(rdbFumadora.getSelectedItem().getValue()\r\n\t\t\t\t\t\t.toString());\r\n\t\t\t\this_parto.setInf_puerperal(rdbInf_puerperal.getSelectedItem()\r\n\t\t\t\t\t\t.getValue().toString());\r\n\t\t\t\this_parto.setInfertilidad(rdbInfertilidad.getSelectedItem()\r\n\t\t\t\t\t\t.getValue().toString());\r\n\t\t\t\this_parto.setMenarquia(tbxMenarquia.getValue());\r\n\t\t\t\this_parto.setCiclos(tbxCiclos.getValue());\r\n\t\t\t\this_parto.setVida_marital(tbxVida_marital.getValue());\r\n\t\t\t\this_parto.setVida_obstetrica(tbxVida_obstetrica.getValue());\r\n\t\t\t\this_parto.setNo_gestaciones(lbxNo_gestaciones.getSelectedItem()\r\n\t\t\t\t\t\t.getValue().toString());\r\n\t\t\t\this_parto.setParto(lbxParto.getSelectedItem().getValue()\r\n\t\t\t\t\t\t.toString());\r\n\t\t\t\this_parto.setAborto(lbxAborto.getSelectedItem().getValue()\r\n\t\t\t\t\t\t.toString());\r\n\t\t\t\this_parto.setCesarias(lbxCesarias.getSelectedItem().getValue()\r\n\t\t\t\t\t\t.toString());\r\n\t\t\t\this_parto.setFecha_um(new Timestamp(dtbxFecha_um.getValue()\r\n\t\t\t\t\t\t.getTime()));\r\n\t\t\t\this_parto.setUm(tbxUm.getValue());\r\n\t\t\t\this_parto.setFep(tbxFep.getValue());\r\n\t\t\t\this_parto.setGemerales(lbxGemerales.getSelectedItem()\r\n\t\t\t\t\t\t.getValue().toString());\r\n\t\t\t\this_parto.setMalformados(lbxMalformados.getSelectedItem()\r\n\t\t\t\t\t\t.getValue().toString());\r\n\t\t\t\this_parto.setNacidos_vivos(lbxNacidos_vivos.getSelectedItem()\r\n\t\t\t\t\t\t.getValue().toString());\r\n\t\t\t\this_parto.setNacidos_muertos(lbxNacidos_muertos\r\n\t\t\t\t\t\t.getSelectedItem().getValue().toString());\r\n\t\t\t\this_parto.setPreterminos(lbxPreterminos.getSelectedItem()\r\n\t\t\t\t\t\t.getValue().toString());\r\n\t\t\t\this_parto.setMedico(chbMedico.isChecked());\r\n\t\t\t\this_parto.setEnfermera(chbEnfermera.isChecked());\r\n\t\t\t\this_parto.setAuxiliar(chbAuxiliar.isChecked());\r\n\t\t\t\this_parto.setPartera(chbPartera.isChecked());\r\n\t\t\t\this_parto.setOtros(chbOtros.isChecked());\r\n\t\t\t\this_parto.setControlado(rdbControlado.getSelectedItem()\r\n\t\t\t\t\t\t.getValue().toString());\r\n\t\t\t\this_parto.setLugar_consulta(rdbLugar_consulta.getSelectedItem()\r\n\t\t\t\t\t\t.getValue().toString());\r\n\t\t\t\this_parto.setNo_consultas(lbxNo_consultas.getSelectedItem()\r\n\t\t\t\t\t\t.getValue().toString());\r\n\t\t\t\this_parto.setEspecialistas(chbEspecialistas.isChecked());\r\n\t\t\t\this_parto.setGeneral(chbGeneral.isChecked());\r\n\t\t\t\this_parto.setPartera_consulta(chbPartera_consulta.isChecked());\r\n\t\t\t\this_parto.setSangrado_vaginal(rdbSangrado_vaginal\r\n\t\t\t\t\t\t.getSelectedItem().getValue().toString());\r\n\t\t\t\this_parto.setCefalias(rdbCefalias.getSelectedItem().getValue()\r\n\t\t\t\t\t\t.toString());\r\n\t\t\t\this_parto.setEdema(rdbEdema.getSelectedItem().getValue()\r\n\t\t\t\t\t\t.toString());\r\n\t\t\t\this_parto.setEpigastralgia(rdbEpigastralgia.getSelectedItem()\r\n\t\t\t\t\t\t.getValue().toString());\r\n\t\t\t\this_parto.setVomitos(rdbVomitos.getSelectedItem().getValue()\r\n\t\t\t\t\t\t.toString());\r\n\t\t\t\this_parto.setTinutus(rdbTinutus.getSelectedItem().getValue()\r\n\t\t\t\t\t\t.toString());\r\n\t\t\t\this_parto.setEscotomas(rdbEscotomas.getSelectedItem()\r\n\t\t\t\t\t\t.getValue().toString());\r\n\t\t\t\this_parto.setInfeccion_urinaria(rdbInfeccion_urinaria\r\n\t\t\t\t\t\t.getSelectedItem().getValue().toString());\r\n\t\t\t\this_parto.setInfeccion_vaginal(rdbInfeccion_vaginal\r\n\t\t\t\t\t\t.getSelectedItem().getValue().toString());\r\n\t\t\t\this_parto.setOtros_embarazo(tbxOtros_embarazo.getValue());\r\n\t\t\t\this_parto.setCardiaca(tbxCardiaca.getValue());\r\n\t\t\t\this_parto.setRespiratoria(tbxRespiratoria.getValue());\r\n\t\t\t\this_parto.setPeso(tbxPeso.getValue());\r\n\t\t\t\this_parto.setTalla(tbxTalla.getValue());\r\n\t\t\t\this_parto.setTempo(tbxTempo.getValue());\r\n\t\t\t\this_parto.setPresion(tbxPresion.getValue());\r\n\t\t\t\this_parto.setPresion2(tbxPresion2.getValue());\r\n\t\t\t\this_parto.setInd_masa(tbxInd_masa.getValue());\r\n\t\t\t\this_parto.setSus_masa(tbxSus_masa.getValue());\r\n\t\t\t\this_parto.setCabeza_cuello(tbxCabeza_cuello.getValue());\r\n\t\t\t\this_parto.setCardiovascular(tbxCardiovascular.getValue());\r\n\t\t\t\this_parto.setMamas(tbxMamas.getValue());\r\n\t\t\t\this_parto.setPulmones(tbxPulmones.getValue());\r\n\t\t\t\this_parto.setAbdomen(tbxAbdomen.getValue());\r\n\t\t\t\this_parto.setUterina(tbxUterina.getValue());\r\n\t\t\t\this_parto.setSituacion(tbxSituacion.getValue());\r\n\t\t\t\this_parto.setPresentacion(tbxPresentacion.getValue());\r\n\t\t\t\this_parto.setV_presentacion(tbxV_presentacion.getValue());\r\n\t\t\t\this_parto.setPosicion(tbxPosicion.getValue());\r\n\t\t\t\this_parto.setV_posicion(tbxV_posicion.getValue());\r\n\t\t\t\this_parto.setC_uterina(tbxC_uterina.getValue());\r\n\t\t\t\this_parto.setTono(tbxTono.getValue());\r\n\t\t\t\this_parto.setFcf(tbxFcf.getValue());\r\n\t\t\t\this_parto.setGenitales(tbxGenitales.getValue());\r\n\t\t\t\this_parto.setDilatacion(tbxDilatacion.getValue());\r\n\t\t\t\this_parto.setBorramiento(tbxBorramiento.getValue());\r\n\t\t\t\this_parto.setEstacion(tbxEstacion.getValue());\r\n\t\t\t\this_parto.setMembranas(tbxMembranas.getValue());\r\n\t\t\t\this_parto.setExtremidades(tbxExtremidades.getValue());\r\n\t\t\t\this_parto.setSnc(tbxSnc.getValue());\r\n\t\t\t\this_parto.setObservacion(tbxObservacion.getValue());\r\n\t\t\t\this_parto.setCodigo_consulta_pyp(lbxCodigo_consulta_pyp\r\n\t\t\t\t\t\t.getSelectedItem().getValue().toString());\r\n\t\t\t\this_parto.setFinalidad_cons(lbxFinalidad_cons.getSelectedItem()\r\n\t\t\t\t\t\t.getValue().toString());\r\n\t\t\t\this_parto.setCausas_externas(lbxCausas_externas\r\n\t\t\t\t\t\t.getSelectedItem().getValue().toString());\r\n\t\t\t\this_parto.setTipo_disnostico(lbxTipo_disnostico\r\n\t\t\t\t\t\t.getSelectedItem().getValue().toString());\r\n\t\t\t\this_parto.setTipo_principal(tbxTipo_principal.getValue());\r\n\t\t\t\this_parto.setTipo_relacionado_1(tbxTipo_relacionado_1\r\n\t\t\t\t\t\t.getValue());\r\n\t\t\t\this_parto.setTipo_relacionado_2(tbxTipo_relacionado_2\r\n\t\t\t\t\t\t.getValue());\r\n\t\t\t\this_parto.setTipo_relacionado_3(tbxTipo_relacionado_3\r\n\t\t\t\t\t\t.getValue());\r\n\t\t\t\this_parto.setTratamiento(tbxTratamiento.getValue());\r\n\r\n\t\t\t\tdatos.put(\"codigo_historia\", his_parto);\r\n\t\t\t\tdatos.put(\"accion\", tbxAccion.getText());\r\n\r\n\t\t\t\this_parto = getServiceLocator().getHis_partoService().guardar(\r\n\t\t\t\t\t\tdatos);\r\n\r\n\t\t\t\tif (tbxAccion.getText().equalsIgnoreCase(\"registrar\")) {\r\n\t\t\t\t\taccionForm(true, \"modificar\");\r\n\t\t\t\t}\r\n\r\n\t\t\t\tMessagebox.show(\"Los datos se guardaron satisfactoriamente\",\r\n\t\t\t\t\t\t\"Informacion ..\", Messagebox.OK,\r\n\t\t\t\t\t\tMessagebox.INFORMATION);\r\n\r\n\t\t\t}\r\n\r\n\t\t} catch (Exception e) {\r\n\t\t\t\r\n\t\t\tlog.error(e.getMessage(), e);\r\n\t\t\tMessagebox.show(e.getMessage(), \"Mensaje de Error !!\",\r\n\t\t\t\t\tMessagebox.OK, Messagebox.ERROR);\r\n\t\t}\r\n\r\n\t}", "@Override\n protected void doPost(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n String pagina = \"\";\n int option = Integer.parseInt(request.getParameter(\"option\"));\n int id_proveedor = Integer.parseInt(request.getParameter(\"proveedor\"));\n int id_pedido = Integer.parseInt(request.getParameter(\"pedido_id\"));\n \n \n switch(option) {\n case 1: {\n // CREAR\n int estado = 0;\n pagina=\"/cotizacion/crearCotizacion.jsp\";\n \n //usuarioBean usuario = (usuarioBean) request.getSession().getAttribute(\"usuario\");\n \n int id_fk_pedido = id_pedido;\n int id_fk_usuario = id_proveedor;\n String forma_pago = request.getParameter(\"forma_pago\");\n String descripcion = request.getParameter(\"descripcion\");\n float costo = 0;\n cotizacionBean objCotizacionBean=new cotizacionBean();\n objCotizacionBean.setId_fk_pedido(id_fk_pedido);\n objCotizacionBean.setId_fk_usuario(id_fk_usuario);\n objCotizacionBean.setForma_pago(forma_pago);\n objCotizacionBean.setDescripcion(descripcion);\n objCotizacionBean.setCosto(costo);\n \n cotizacionDAO objcotizacionDAO=new cotizacionDAO();\n estado = objcotizacionDAO.InsertarCotizacion(objCotizacionBean);\n \n //VALIDAR NSERCION\n if(estado == 1) {\n request.setAttribute(\"mensaje\",\"Se envio correctamente\");\n }\n else {\n request.setAttribute(\"mensaje\",\"Fallo al momento de crear\");\n }\n }\n case 3: {\n //ACTUALIZAR\n }\n case 4: {\n //ELIMINAR\n }\n }\n \n getServletContext().getRequestDispatcher(pagina).forward(request, response);\n }", "@GetMapping(\"/add\")\n public String showSocioForm(Model model, Persona persona) {\n List<Cargo> cargos = cargoService.getCargos();\n model.addAttribute(\"cargos\", cargos);\n return \"/backoffice/socioForm\";\n }", "private void preparaForm(String opcao) {\n switch(opcao){\n case \"fill\": { preparaFill(); break; }\n case \"novo\": { preparaNovo(); break; }\n case \"alterar\": { preparaAlterar(); break; }\n case \"cancelar\": { preparaCancelar(); break; }\n case \"salvar\": { preparaSalvar(); break; }\n }\n }", "private void EnviarDatos(String user, String fecha, String pasos){\n\r\n HttpClient httpclient = new DefaultHttpClient();\r\n //Utilizamos la HttpPost para enviar lso datos\r\n //A la url donde se encuentre nuestro archivo receptor\r\n\r\n\r\n\r\n\r\n HttpPost httppost2 = new HttpPost(\"http://mets.itisol.com.mx/paciente/insertaActividad\");\r\n try {\r\n //Añadimos los datos a enviar en este caso solo uno\r\n //que le llamamos de nombre 'a'\r\n //La segunda linea podría repetirse tantas veces como queramos\r\n //siempre cambiando el nombre ('a')\r\n List<NameValuePair> postValues = new ArrayList<NameValuePair>(2);\r\n postValues.add(new BasicNameValuePair(\"usuario\", user));\r\n\r\n postValues.add(new BasicNameValuePair(\"fecha\", fecha));\r\n Log.d(\"la fecha es\", \"\" + cambiaFecha(fecha));\r\n postValues.add(new BasicNameValuePair(\"pasos\", pasos));\r\n\r\n // postValues.add(new BasicNameValuePair(\"tipo\", \"1\"));\r\n\r\n //Encapsulamos\r\n httppost2.setEntity(new UrlEncodedFormEntity(postValues));\r\n //Lanzamos la petición\r\n HttpResponse respuesta2 = httpclient.execute(httppost2);\r\n //Conectamos para recibir datos de respuesta\r\n HttpEntity entity2 = respuesta2.getEntity();\r\n //Creamos el InputStream como su propio nombre indica\r\n InputStream is2 = entity2.getContent();\r\n //Limpiamos el codigo obtenido atraves de la funcion\r\n //StreamToString explicada más abajo\r\n String resultado2= StreamToString(is2);\r\n\r\n //Enviamos el resultado LIMPIO al Handler para mostrarlo\r\n Message sms2 = new Message();\r\n sms2.obj = resultado2;\r\n\r\n puente.sendMessage(sms2);\r\n }catch (IOException e) {\r\n //TODO Auto-generated catch block\r\n }\r\n\r\n }", "protected void nuevo(){\n wp = new frmEspacioTrabajo();\n System.runFinalization();\n inicializar();\n }", "public cambiarContrasenna() {\n initComponents();\n txtNombreUsuario.setEnabled(false);\n inicializarComponentes();\n cargarUsuarios();\n }", "public String inputForm() {\n return inputDataTraveler.validateData();\n }", "private void iniciaFrm() {\n statusLbls(false);\n statusBtnInicial();\n try {\n clientes = new Cliente_DAO().findAll();\n } catch (Exception ex) {\n Logger.getLogger(JF_CadastroCliente.class.getName()).log(Level.SEVERE, null, ex);\n }\n }", "@Override\n protected void doPost(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n String sesion_med = dmmed.ObtenerCodigoSesion();\n Medico medico_sesion = dmmed.VerMedicoPorCodigo(sesion_med);\n String acceder = \"\";\n String accion = request.getParameter(\"accion\");\n if (accion.equalsIgnoreCase(\"Ingresar\")) {\n String codigo = request.getParameter(\"txcodigo\");\n String contraseña = request.getParameter(\"pass\");\n Medico medico = dmmed.Validar(codigo, contraseña);\n if (medico != null) {\n dmmed.AbrirSesion(codigo);\n request.setAttribute(\"medico\", medico);\n acceder = \"medico/interfaz.jsp\";\n } else {\n String mensaje = \"Codigo o contraseña incorrectas\";\n request.getSession().setAttribute(\"mensaje\", mensaje);\n acceder = \"medico/login.jsp\";\n }\n } else if (accion.equalsIgnoreCase(\"Regresar a la interfaz\")) {\n request.setAttribute(\"medico\", medico_sesion);\n acceder = \"medico/interfaz.jsp\";\n } else if (accion.equalsIgnoreCase(\"Buscar Citas\")) {\n String codigo_paciente = request.getParameter(\"codigo_pac\");\n ArrayList<Cita> lista = dmcit.VerCitaActual(codigo_paciente, sesion_med);\n request.setAttribute(\"lista\", lista);\n acceder = \"medico/realizar_cita.jsp\";\n } else if (accion.equalsIgnoreCase(\"Realizar Cita\")) {\n String mensaje = \"Fallo al realizar cita\";\n try {\n String codigo = request.getParameter(\"codigo\");\n String inf = request.getParameter(\"informe\");\n Cita cita = dmcit.VerCitaPorCodigo(codigo);\n if (cita != null) {\n Informe informe = dmcit.ObtenerInforme(codigo);\n if (informe != null) {\n boolean comprobar = dmcit.RealizarCita(cita);\n if (comprobar == true) {\n informe.setDescripcion(inf);\n mensaje = dminf.AgregarInforme(informe);\n } else {\n mensaje = \"Fallo al actualizar cita\";\n }\n } else {\n mensaje = \"Fallo al obtener informe\";\n }\n } else {\n mensaje = \"La cita no existe\";\n }\n } catch (Exception e) {\n mensaje = e.toString();\n }\n request.getSession().setAttribute(\"mensaje_cita\", mensaje);\n acceder = \"medico/realizar_cita.jsp\";\n } else if (accion.equalsIgnoreCase(\"Agendar Examen\")) {\n String alerta = \"Fallo para agendar examen\";\n try {\n int codigo = 0;\n String codigo_paciente = request.getParameter(\"codigo_paciente\");\n String codigo_medico = request.getParameter(\"codigo_medico\");\n String tipo_examen = request.getParameter(\"codigo_examen\");\n Date fecha = Date.valueOf(request.getParameter(\"fecha\"));\n String Orden = request.getParameter(\"orden\");\n\n Examen examen = new Examen(codigo, codigo_paciente, codigo_medico, tipo_examen, fecha);\n boolean comprobar_orden = dmtip.ComprobarOrden(tipo_examen);\n if (comprobar_orden == true) {\n if (Orden != null) {\n String tipo = dmtip.ObtenerTipo(tipo_examen);\n if (\"PDF\".equals(tipo)) {\n if (Orden.endsWith(\".pdf\")) {\n Orden = \"archivos/\" + Orden;\n examen.setOrden(Orden);\n alerta = dmexa.AgendarExamen(examen);\n } else {\n alerta = \"Orden incorrecta\";\n }\n } else if (\"IMG\".equals(tipo)) {\n if (Orden.endsWith(\".jpg\") || Orden.endsWith(\".png\") || Orden.endsWith(\".jepg\")) {\n Orden = \"archivos/\" + Orden;\n examen.setOrden(Orden);\n alerta = dmexa.AgendarExamen(examen);\n } else {\n alerta = \"Orden incorrecta\";\n }\n } else {\n alerta = \"Fallo en el codigo del Tipo de examen\";\n }\n } else {\n alerta = \"Es necesaria la orden y no esta agregada\";\n }\n } else {\n alerta = dmexa.AgendarExamen(examen);\n }\n } catch (Exception e) {\n alerta = e.toString();\n }\n request.getSession().setAttribute(\"alerta_e\", alerta);\n acceder = \"medico/agendar_examen.jsp\";\n } else if (accion.equalsIgnoreCase(\"Ver Historial\")) {\n Paciente paciente = dmpac.VerPacientePorCodigo(request.getParameter(\"codigo_paciente\"));\n request.setAttribute(\"paciente\", paciente);\n acceder = \"medico/reporte1.jsp\";\n } else if (accion.equalsIgnoreCase(\"Obtener Citas\")) {\n String fecha1 = request.getParameter(\"rep2fecha1\");\n String fecha2 = request.getParameter(\"rep2fecha2\");\n ArrayList<Cita> lista = dmcit.ReporteCitasEnIntervaloDeTiempo(sesion_med, fecha1, fecha2);\n request.setAttribute(\"lista\", lista);\n acceder = \"medico/reporte2.jsp\";\n } else if (accion.equalsIgnoreCase(\"Ver Citas\")) {\n String fecha = request.getParameter(\"rep3fecha\");\n ArrayList<Cita> lista = dmcit.ReportesCitasDiaActual(sesion_med, fecha);\n request.setAttribute(\"lista\", lista);\n acceder = \"medico/reporte3.jsp\";\n } else if (accion.equalsIgnoreCase(\"Obtener Conteo\")) {\n String fecha1 = request.getParameter(\"rep4fecha1\");\n String fecha2 = request.getParameter(\"rep4fecha2\");\n ArrayList<Informe> lista = dminf.ReportePacienteConMasInformes(sesion_med, fecha1, fecha2);\n request.setAttribute(\"lista\", lista);\n acceder = \"medico/reporte4.jsp\";\n } else if (accion.equalsIgnoreCase(\"Salir a la pagina principal\")){\n acceder = \"index.jsp\";\n }\n RequestDispatcher pagina = request.getRequestDispatcher(acceder);\n pagina.forward(request, response);\n }", "private void reWriteField(HttpServletRequest request) {\n\t\t// Reesccribir campos\n\t\trequest.setAttribute(\"importe\", importe);\n\t\trequest.setAttribute(\"concepto\", concepto);\n\t\trequest.setAttribute(\"coche\", c);\n\t}", "public void registrarAdministrador() throws IOException {\n\n //asignamos al usuario la imagen de perfil default\n usuarioView.setUsuarioFotoRuta(getPathDefaultUsuario());\n usuarioView.setUsuarioFotoNombre(getNameDefaultUsuario());\n\n //Se genera un login y un pass aleatorio que se le envia al proveedor\n MD5 md = new MD5();\n GenerarPassword pass = new GenerarPassword();\n SendEmail email = new SendEmail();\n\n password = pass.generarPass(6);//Generamos pass aleatorio\n\n //Encriptamos las contraseñas\n usuarioView.setUsuarioPassword(md.getMD5(password));//Se encripta la contreseña\n usuarioView.setUsuarioRememberToken(md.getMD5(password));\n\n //el metodo recibe los atributos, agrega al atributo ciudad del objeto usuario un objeto correspondiente, \n //de la misma forma comprueba el rol y lo asocia, por ultimo persiste el usuario en la base de datos\n usuarioView.setSmsCiudad(ciudadDao.consultarCiudad(usuarioView.getSmsCiudad()));//Asociamos una ciudad a un usuario\n usuarioView.setSmsRol(rolDao.consultarRol(usuarioView.getSmsRol()));//Asociamos un rol a un usuario\n usuarioView.setUsuarioEstadoUsuario(1);//Asignamos un estado de cuenta\n usuarioView.setSmsNacionalidad(nacionalidadDao.consultarNacionalidad(usuarioView.getSmsNacionalidad()));\n\n //registramos el usuario y recargamos la lista de clientes\n usuarioDao.registrarUsuario(usuarioView);\n usuariosListView = adminDao.consultarUsuariosAdministradores();\n\n //Enviar correo\n email.sendEmailAdministradorBienvenida(usuarioView, password);\n\n //limpiamos objetos\n usuarioView = new SmsUsuario();\n password = \"\";\n }", "public void accionForm(boolean sw, String accion) throws Exception {\n\t\tgroupboxConsulta.setVisible(!sw);\n\t\tgroupboxEditar.setVisible(sw);\n\n\t\ttbxAccion.setValue(accion);\n\n\t\tif (!accion.equalsIgnoreCase(\"registrar\")) {\n\t\t\tbuscarDatos();\n\t\t} else {\n\t\t\t// buscarDatos();\n\t\t\tlimpiarDatos();\n\t\t\tif (admision != null) {\n\t\t\t\tcargarInformacion_paciente();\n\t\t\t}\n\t\t}\n\n\t}" ]
[ "0.6590561", "0.6510707", "0.60046107", "0.5979661", "0.5929833", "0.5919049", "0.58768344", "0.587363", "0.5865239", "0.5842126", "0.5819247", "0.5804534", "0.5781964", "0.57690257", "0.57573205", "0.5706824", "0.5682679", "0.5672097", "0.56699896", "0.5627998", "0.56178963", "0.55764246", "0.55651164", "0.5533218", "0.5529153", "0.55183196", "0.55081373", "0.55038285", "0.5487989", "0.5484646", "0.5471164", "0.5451614", "0.5428424", "0.54247564", "0.54197836", "0.5419739", "0.5416411", "0.5410796", "0.54033405", "0.5385413", "0.538089", "0.5368122", "0.5367058", "0.53550416", "0.5354529", "0.53461975", "0.5337739", "0.5336038", "0.53313833", "0.53262275", "0.5314772", "0.53136533", "0.53133905", "0.5307016", "0.5305072", "0.5299403", "0.52933586", "0.5282223", "0.52721596", "0.5260839", "0.5253408", "0.52456295", "0.5243225", "0.52404124", "0.52391684", "0.5234376", "0.52266526", "0.52218974", "0.5220152", "0.5208014", "0.52013296", "0.51895267", "0.51795745", "0.51777136", "0.5176013", "0.5170864", "0.5170141", "0.5167453", "0.51655316", "0.5165381", "0.51609755", "0.5157988", "0.51570284", "0.5156838", "0.51485", "0.51469994", "0.51416093", "0.5137515", "0.51351637", "0.5133699", "0.51283085", "0.5124419", "0.5122705", "0.5121553", "0.51207423", "0.5119034", "0.51098806", "0.51098615", "0.510526", "0.5102933", "0.50978136" ]
0.0
-1
TODO Autogenerated method stub
public static void main(String[] args) { MarkIV coffeeMaker = MarkIV.getInstance(); coffeeMaker.makeCoffee(); coffeeMaker.removeCoffeePot(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\r\n\tpublic void comer() \r\n\t{\n\t\t\r\n\t}", "@Override\n\tpublic void comer() {\n\t\t\n\t}", "@Override\n public void perish() {\n \n }", "@Override\r\n\t\t\tpublic void annadir() {\n\r\n\t\t\t}", "@Override\n\tpublic void anular() {\n\n\t}", "@Override\n\tprotected void getExras() {\n\n\t}", "@Override\r\n\tpublic void anularFact() {\n\t\t\r\n\t}", "@Override\n\tpublic void entrenar() {\n\t\t\n\t}", "@Override\n\tpublic void nadar() {\n\t\t\n\t}", "@Override\r\n\tpublic void tires() {\n\t\t\r\n\t}", "@Override\r\n\t\t\tpublic void ayuda() {\n\r\n\t\t\t}", "@Override\n\tprotected void interr() {\n\t}", "@Override\n\tpublic void emprestimo() {\n\n\t}", "@Override\r\n\tpublic void bicar() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void bicar() {\n\t\t\r\n\t}", "@Override\n\tpublic void grabar() {\n\t\t\n\t}", "@Override\n\tpublic void gravarBd() {\n\t\t\n\t}", "@Override\r\n\tpublic void rozmnozovat() {\n\t}", "@Override\r\n\tpublic void dormir() {\n\t\t\r\n\t}", "@Override\n protected void getExras() {\n }", "@Override\r\n\tpublic void publierEnchere() {\n\t\t\r\n\t}", "@Override\n\tpublic void nefesAl() {\n\n\t}", "@Override\n\tpublic void ligar() {\n\t\t\n\t}", "@Override\n public void func_104112_b() {\n \n }", "@Override\n\tprotected void initdata() {\n\n\t}", "@Override\n\tpublic void nghe() {\n\n\t}", "@Override\n public void function()\n {\n }", "@Override\n public void function()\n {\n }", "public final void mo51373a() {\n }", "@Override\r\n\tpublic void stehReagieren() {\r\n\t\t//\r\n\t}", "@Override\n public void inizializza() {\n\n super.inizializza();\n }", "@Override\n\tprotected void initData() {\n\t\t\n\t}", "@Override\r\n\t\tpublic void init() {\n\t\t\t\r\n\t\t}", "@Override\n\tpublic void sacrifier() {\n\t\t\n\t}", "@Override\r\n\tprotected void InitData() {\n\t\t\r\n\t}", "public void designBasement() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initialize() {\r\n\t\t\r\n\t\t\r\n\t}", "public void gored() {\n\t\t\n\t}", "@Override\r\n\tprotected void initData() {\n\r\n\t}", "@Override\n\tpublic void einkaufen() {\n\t}", "@Override\n protected void initialize() {\n\n \n }", "public void mo38117a() {\n }", "@Override\n\tprotected void getData() {\n\t\t\n\t}", "Constructor() {\r\n\t\t \r\n\t }", "@Override\r\n\tpublic void dibujar() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void dibujar() {\n\t\t\r\n\t}", "@Override\n\tpublic void one() {\n\t\t\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "private stendhal() {\n\t}", "@Override\n\tprotected void update() {\n\t\t\n\t}", "@Override\n\t\t\tpublic void ic() {\n\t\t\t\t\n\t\t\t}", "@Override\n\tprotected void initData() {\n\n\t}", "@Override\n\tprotected void initData() {\n\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n public void init() {\n\n }", "@Override\n\tprotected void initialize() {\n\t\t\n\t}", "@Override\n\tprotected void initialize() {\n\t\t\n\t}", "@Override\r\n\tpublic void init() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void init() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void init() {\n\t\t\r\n\t}", "@Override\n\tpublic void debite() {\n\t\t\n\t}", "@Override\r\n\tpublic void init() {\n\r\n\t}", "@Override\r\n\tpublic void init() {\n\r\n\t}", "@Override\r\n\tpublic void init() {\n\r\n\t}", "public contrustor(){\r\n\t}", "@Override\n\tprotected void initialize() {\n\n\t}", "@Override\r\n\tpublic void dispase() {\n\r\n\t}", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "@Override\n\tpublic void dtd() {\n\t\t\n\t}", "@Override\n\tprotected void logic() {\n\n\t}", "@Override\n\tprotected void lazyLoad() {\n\t\t\n\t}", "public void mo4359a() {\n }", "@Override\r\n\tprotected void initialize() {\n\r\n\t}", "@Override\n public void memoria() {\n \n }", "@Override\n\t\tpublic void method() {\n\t\t\t\n\t\t}", "private RepositorioAtendimentoPublicoHBM() {\r\t}", "@Override\n protected void initialize() \n {\n \n }", "@Override\r\n\tpublic void getProposition() {\n\r\n\t}", "@Override\n\tpublic void particular1() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\n\t}", "@Override\n\tpublic void init() {\n\n\t}", "@Override\n\tpublic void init() {\n\n\t}", "@Override\n protected void prot() {\n }", "@Override\r\n\tpublic void init()\r\n\t{\n\t}", "@Override\n\tprotected void initValue()\n\t{\n\n\t}", "public void mo55254a() {\n }" ]
[ "0.6671074", "0.6567672", "0.6523024", "0.6481211", "0.6477082", "0.64591026", "0.64127725", "0.63762105", "0.6276059", "0.6254286", "0.623686", "0.6223679", "0.6201336", "0.61950207", "0.61950207", "0.61922914", "0.6186996", "0.6173591", "0.61327106", "0.61285484", "0.6080161", "0.6077022", "0.6041561", "0.6024072", "0.6020252", "0.59984857", "0.59672105", "0.59672105", "0.5965777", "0.59485507", "0.5940904", "0.59239364", "0.5910017", "0.5902906", "0.58946234", "0.5886006", "0.58839184", "0.58691067", "0.5857751", "0.58503544", "0.5847024", "0.58239377", "0.5810564", "0.5810089", "0.5806823", "0.5806823", "0.5800025", "0.5792378", "0.5792378", "0.5792378", "0.5792378", "0.5792378", "0.5792378", "0.5790187", "0.5789414", "0.5787092", "0.57844025", "0.57844025", "0.5774479", "0.5774479", "0.5774479", "0.5774479", "0.5774479", "0.5761362", "0.57596046", "0.57596046", "0.575025", "0.575025", "0.575025", "0.5747959", "0.57337177", "0.57337177", "0.57337177", "0.5721452", "0.5715831", "0.57142824", "0.57140535", "0.57140535", "0.57140535", "0.57140535", "0.57140535", "0.57140535", "0.57140535", "0.5711723", "0.57041645", "0.56991017", "0.5696783", "0.56881124", "0.56774884", "0.56734604", "0.56728", "0.56696945", "0.5661323", "0.5657007", "0.5655942", "0.5655942", "0.5655942", "0.56549734", "0.5654792", "0.5652974", "0.5650185" ]
0.0
-1
TODO Autogenerated method stub
public static void main(String[] args) throws InterruptedException { ChromeDriver driver=new ChromeDriver(); driver.get("https://appleid.apple.com/account"); driver.manage().timeouts().implicitlyWait(10, TimeUnit.SECONDS); driver.findElementByXPath("(//input[@type='text'])[2]").sendKeys("Harsha"); driver.findElementByXPath("(//input[@type='text'])[3]").sendKeys("Kumbam"); Select country=new Select (driver.findElementByXPath("(//select[@aria-required='true'])[1]")); country.selectByVisibleText("India"); driver.findElementByXPath("(//input[@type='text'])[4]").click(); //Thread.sleep(1000); driver.findElementByXPath("(//input[@type='text'])[4]").sendKeys("07/13/2000"); driver.findElementByXPath("//input[@type='email']").sendKeys("[email protected]"); driver.findElementByXPath("//input[@id='password']").sendKeys("Harsha123@2k"); driver.findElementByXPath("(//input[@type='password'])[2]").sendKeys("Harsha123@2k"); String str=driver.findElementByXPath("//span[@class='form-message']").getText(); System.out.println(str); Select mobile=new Select (driver.findElementByXPath("(//select[@aria-required='true'])[2]")); mobile.selectByVisibleText("+91 (India)"); //driver.findElementByLinkText("Phone number").sendKeys("9876543210"); driver.findElementByXPath("(//input[@aria-required='true'])[7]").sendKeys("9876543210"); // String str1=driver.findElementByXPath("(//span[@class='form-message'])[2]").getText(); // System.out.println(str1); driver.findElementByXPath("//div[@class='overflow-text']").click(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\r\n\tpublic void comer() \r\n\t{\n\t\t\r\n\t}", "@Override\n\tpublic void comer() {\n\t\t\n\t}", "@Override\n public void perish() {\n \n }", "@Override\r\n\t\t\tpublic void annadir() {\n\r\n\t\t\t}", "@Override\n\tpublic void anular() {\n\n\t}", "@Override\n\tprotected void getExras() {\n\n\t}", "@Override\r\n\tpublic void anularFact() {\n\t\t\r\n\t}", "@Override\n\tpublic void entrenar() {\n\t\t\n\t}", "@Override\n\tpublic void nadar() {\n\t\t\n\t}", "@Override\r\n\tpublic void tires() {\n\t\t\r\n\t}", "@Override\r\n\t\t\tpublic void ayuda() {\n\r\n\t\t\t}", "@Override\n\tprotected void interr() {\n\t}", "@Override\n\tpublic void emprestimo() {\n\n\t}", "@Override\r\n\tpublic void bicar() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void bicar() {\n\t\t\r\n\t}", "@Override\n\tpublic void grabar() {\n\t\t\n\t}", "@Override\n\tpublic void gravarBd() {\n\t\t\n\t}", "@Override\r\n\tpublic void rozmnozovat() {\n\t}", "@Override\r\n\tpublic void dormir() {\n\t\t\r\n\t}", "@Override\n protected void getExras() {\n }", "@Override\r\n\tpublic void publierEnchere() {\n\t\t\r\n\t}", "@Override\n\tpublic void nefesAl() {\n\n\t}", "@Override\n\tpublic void ligar() {\n\t\t\n\t}", "@Override\n public void func_104112_b() {\n \n }", "@Override\n\tprotected void initdata() {\n\n\t}", "@Override\n\tpublic void nghe() {\n\n\t}", "@Override\n public void function()\n {\n }", "@Override\n public void function()\n {\n }", "public final void mo51373a() {\n }", "@Override\r\n\tpublic void stehReagieren() {\r\n\t\t//\r\n\t}", "@Override\n public void inizializza() {\n\n super.inizializza();\n }", "@Override\n\tprotected void initData() {\n\t\t\n\t}", "@Override\r\n\t\tpublic void init() {\n\t\t\t\r\n\t\t}", "@Override\n\tpublic void sacrifier() {\n\t\t\n\t}", "@Override\r\n\tprotected void InitData() {\n\t\t\r\n\t}", "public void designBasement() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initialize() {\r\n\t\t\r\n\t\t\r\n\t}", "public void gored() {\n\t\t\n\t}", "@Override\r\n\tprotected void initData() {\n\r\n\t}", "@Override\n\tpublic void einkaufen() {\n\t}", "@Override\n protected void initialize() {\n\n \n }", "public void mo38117a() {\n }", "@Override\n\tprotected void getData() {\n\t\t\n\t}", "Constructor() {\r\n\t\t \r\n\t }", "@Override\r\n\tpublic void dibujar() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void dibujar() {\n\t\t\r\n\t}", "@Override\n\tpublic void one() {\n\t\t\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "private stendhal() {\n\t}", "@Override\n\tprotected void update() {\n\t\t\n\t}", "@Override\n\t\t\tpublic void ic() {\n\t\t\t\t\n\t\t\t}", "@Override\n\tprotected void initData() {\n\n\t}", "@Override\n\tprotected void initData() {\n\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n public void init() {\n\n }", "@Override\n\tprotected void initialize() {\n\t\t\n\t}", "@Override\n\tprotected void initialize() {\n\t\t\n\t}", "@Override\r\n\tpublic void init() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void init() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void init() {\n\t\t\r\n\t}", "@Override\n\tpublic void debite() {\n\t\t\n\t}", "@Override\r\n\tpublic void init() {\n\r\n\t}", "@Override\r\n\tpublic void init() {\n\r\n\t}", "@Override\r\n\tpublic void init() {\n\r\n\t}", "public contrustor(){\r\n\t}", "@Override\n\tprotected void initialize() {\n\n\t}", "@Override\r\n\tpublic void dispase() {\n\r\n\t}", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "@Override\n\tpublic void dtd() {\n\t\t\n\t}", "@Override\n\tprotected void logic() {\n\n\t}", "@Override\n\tprotected void lazyLoad() {\n\t\t\n\t}", "public void mo4359a() {\n }", "@Override\r\n\tprotected void initialize() {\n\r\n\t}", "@Override\n public void memoria() {\n \n }", "@Override\n\t\tpublic void method() {\n\t\t\t\n\t\t}", "private RepositorioAtendimentoPublicoHBM() {\r\t}", "@Override\n protected void initialize() \n {\n \n }", "@Override\r\n\tpublic void getProposition() {\n\r\n\t}", "@Override\n\tpublic void particular1() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\n\t}", "@Override\n\tpublic void init() {\n\n\t}", "@Override\n\tpublic void init() {\n\n\t}", "@Override\n protected void prot() {\n }", "@Override\r\n\tpublic void init()\r\n\t{\n\t}", "@Override\n\tprotected void initValue()\n\t{\n\n\t}", "public void mo55254a() {\n }" ]
[ "0.6671074", "0.6567672", "0.6523024", "0.6481211", "0.6477082", "0.64591026", "0.64127725", "0.63762105", "0.6276059", "0.6254286", "0.623686", "0.6223679", "0.6201336", "0.61950207", "0.61950207", "0.61922914", "0.6186996", "0.6173591", "0.61327106", "0.61285484", "0.6080161", "0.6077022", "0.6041561", "0.6024072", "0.6020252", "0.59984857", "0.59672105", "0.59672105", "0.5965777", "0.59485507", "0.5940904", "0.59239364", "0.5910017", "0.5902906", "0.58946234", "0.5886006", "0.58839184", "0.58691067", "0.5857751", "0.58503544", "0.5847024", "0.58239377", "0.5810564", "0.5810089", "0.5806823", "0.5806823", "0.5800025", "0.5792378", "0.5792378", "0.5792378", "0.5792378", "0.5792378", "0.5792378", "0.5790187", "0.5789414", "0.5787092", "0.57844025", "0.57844025", "0.5774479", "0.5774479", "0.5774479", "0.5774479", "0.5774479", "0.5761362", "0.57596046", "0.57596046", "0.575025", "0.575025", "0.575025", "0.5747959", "0.57337177", "0.57337177", "0.57337177", "0.5721452", "0.5715831", "0.57142824", "0.57140535", "0.57140535", "0.57140535", "0.57140535", "0.57140535", "0.57140535", "0.57140535", "0.5711723", "0.57041645", "0.56991017", "0.5696783", "0.56881124", "0.56774884", "0.56734604", "0.56728", "0.56696945", "0.5661323", "0.5657007", "0.5655942", "0.5655942", "0.5655942", "0.56549734", "0.5654792", "0.5652974", "0.5650185" ]
0.0
-1
Returns the full content for the concrete runner file.
public String getRenderedRunnerFileContent( SingleScenarioRunner singleScenarioRunner, final SingleScenario singleScenario ) throws MissingFileException { String runnerTemplatePath = singleScenarioRunner.getRunnerTemplatePath(); String featureFileName = singleScenarioRunner.getFeatureFileName(); String fileString = fileIO.readContentFromFile(runnerTemplatePath); if (runnerTemplatePath.endsWith(".java")) { fileString = replaceJavaTemplatePlaceholders(runnerTemplatePath, featureFileName, fileString); } fileString = fileString.replace(FEATURE_FILE_NAME_PLACEHOLDER, featureFileName); fileString = addScenarioInfo(fileString, singleScenario, runnerTemplatePath); return fileString; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\n public String getContent() throws FileNotFound, CannotReadFile\n {\n Reader input = null;\n try\n {\n input = new InputStreamReader(resource.openStream());\n String content = IOUtils.toString(input).replace(\"\\r\\n\", \"\\n\");\n\n return content;\n } catch (FileNotFoundException ex)\n {\n throw new FileNotFound();\n } catch (IOException ex)\n {\n throw new CannotReadFile();\n } finally\n {\n InternalUtils.close(input);\n }\n }", "public String getContent() {\n String s = null;\n try {\n s = new String(Files.readAllBytes(Paths.get(filename)), StandardCharsets.UTF_8);\n }\n catch (IOException e) {\n message = \"Problem reading a file: \" + filename;\n }\n return s;\n }", "public static String sourceContent()\n {\n read_if_needed_();\n \n return _src_content;\n }", "public String getRunInfo(){\n return runner.getRunInfo();\n }", "@NonNull\n public String getSourceContents() {\n if (mSourceContents == null) {\n File sourceFile = getSourceFile();\n if (sourceFile != null) {\n mSourceContents = getClient().readFile(mSourceFile);\n }\n\n if (mSourceContents == null) {\n mSourceContents = \"\";\n }\n }\n\n return mSourceContents;\n }", "String getRunner() {\n return mRunner;\n }", "String getContents();", "public InputStream open() {\n return demoResourceLoader.getResourceAsStream(\n MessageFormat.format(\"{0}/{1}.groovy\",\n scenario.getName().toLowerCase(), name));\n }", "java.lang.String getContents();", "java.lang.String getContents();", "private String getFileContent(){\n\t\tString employeesJsonString=\"\";\n\t\ttry {\n\t\t\tScanner sc = new Scanner(file);\n\t\t\twhile(sc.hasNextLine()){\n\t\t\t\temployeesJsonString += sc.nextLine();\n\t\t\t}\n\t\t\t\n\t\t} catch (FileNotFoundException e1) {\n\t\t\te1.printStackTrace();\n\t\t\tSystem.out.println(\"file error\");\n\t\t}\n\t\treturn employeesJsonString;\n\t}", "public String getMainContent() {\n return getString(CommandProperties.MAIN_CONTENT);\n }", "public final Artifact getSourceFile() {\n return compileCommandLine.getSourceFile();\n }", "String getFullWorkfileName();", "public String content() {\n StringWriter content = new StringWriter();\n PrintWriter w = new PrintWriter(content);\n\n printHeaderComment(w);\n\n w.println();\n\n w.println(\"#include \\\"\" + className + \".h\\\"\");\n w.println(\"#include <iostream>\");\n w.println();\n\n w.println();\n\n w.println(\"void \" + className + \"::load( PersistableInputStream& \" + INSTREAM_VAR_NAME + \" ){\");\n w.print(loadContent.toString());\n w.println(\"}\");\n\n w.println();\n\n w.println(\"void \" + className + \"::save( PersistableOutputStream& \" + OUTSTREAM_VAR_NAME + \" ){\");\n w.print(saveContent.toString());\n w.println(\"}\");\n\n return content.toString();\n }", "Path getContent(String filename);", "public String readFileContents(String filename) {\n return null;\n\n }", "java.lang.String getSourceFile();", "public static String readSourceFile(String rs) throws Exception {\n Class<TestHelper> testHelperClass = TestHelper.class;\n ClassLoader classLoader = testHelperClass.getClassLoader();\n URI uri = classLoader.getResource(rs).toURI();\n byte[] bytes = Files.readAllBytes(Paths.get(uri));\n return new String(bytes, \"UTF-8\");\n }", "public Object run() {\n String bn = baseName.endsWith(\"/\")\n ? baseName\n : baseName + \"/\";\n\n // look for prebuilt indices first\n try {\n InputStream s = root.getResourceAsStream(bn + ICU_RESOURCE_INDEX + \".txt\");\n if (s != null) {\n ArrayList lst = new ArrayList();\n BufferedReader br = new BufferedReader(new InputStreamReader(s, \"ASCII\"));\n String line;\n while ((line = br.readLine()) != null) {\n if (line.length() != 0 && !line.startsWith(\"#\")) {\n lst.add(line);\n }\n }\n return lst;\n }\n } catch (IOException e) {\n // swallow it\n }\n\n URL url = root.getResource(bn);\n /*\n URLHandler handler = URLHandler.get(url);\n if (handler != null) {\n final ArrayList lst = new ArrayList();\n URLVisitor v = new URLVisitor() {\n public void visit(String s) {\n if (s.endsWith(\".res\") && !\"res_index.res\".equals(s)) {\n lst.add(s.substring(0, s.length() - 4)); // strip '.res'\n }\n }\n };\n handler.guide(v, false);\n return lst;\n }\n \t*/\n return null;\n }", "public String getContent();", "public String getFormattedFileContents ();", "String getContent();", "String getContent();", "String getContent();", "String getContent();", "String getContent();", "String getContent();", "String getContent();", "String getContent();", "private String getContent(File file) {\n String output = \"\";\n String[] content;\n content = ((File) file).getContent().split(\"\\\\r?\\\\n\");\n for (String line : content) {\n if (line.contains(this.search)) {\n output += line + \"\\n\";\n }\n }\n if (!(output.equals(\"\"))) {\n output = Pwd.returnPathFromRoot(file) + \":\\n\" + output + \"\\n\";\n }\n return output;\n }", "public String textExtractor(String filePath) {\n\n StringBuilder textBuilder = new StringBuilder();\n try (BufferedReader bufferedReader = new BufferedReader(new InputStreamReader(getClass().getResourceAsStream(\"/\" + filePath), \"UTF-8\"))) {\n while (bufferedReader.ready()) {\n textBuilder.append(bufferedReader.readLine()).append(\"/n\");\n }\n\n } catch (IOException exc) {\n exc.printStackTrace();\n }\n return textBuilder.toString();\n }", "public String getContents() { return contents; }", "public void readResult() {\n File dirXml = new File(System.getProperty(\"user.dir\") + \"/target/classes/\");\n /// Get Parent Directory\n String parentDirectory = dirXml.getParent();\n File folder = new File(parentDirectory + \"/jbehave\");\n File[] listOfFiles = folder.listFiles();\n\n if (listOfFiles != null) {\n for (File listOfFile : listOfFiles) {\n if (listOfFile.isFile()) {\n String filePath = folder.getPath() + \"/\" + listOfFile.getName();\n System.out.println(\"File \" + filePath);\n if (filePath.contains(\".xml\") && !filePath.contains(\"AfterStories\") && !filePath.contains(\n \"BeforeStories\")) {\n readXML(filePath);\n }\n }\n }\n }\n }", "public String getStringFile(){\n return fileView(file);\n }", "@Override\n\tpublic String getContents() {\n\t\treturn this.contents;\n\t}", "@JsonGetter(\"fileContent\")\r\n public String getFileContent ( ) { \r\n return this.fileContent;\r\n }", "private String readFile() {\n try {\n BufferedReader in = new BufferedReader(new FileReader(\"C:\\\\Users\"\n + \"\\\\MohammadLoqman\\\\cs61b\\\\sp19-s1547\"\n + \"\\\\proj3\\\\byow\\\\Core\\\\previousGame.txt\"));\n StringBuilder sb = new StringBuilder();\n String toLoad;\n try {\n toLoad = in.readLine();\n while (toLoad != null) {\n sb.append(toLoad);\n sb.append(System.lineSeparator());\n toLoad = in.readLine();\n }\n String everything = sb.toString();\n return everything;\n } catch (IOException E) {\n System.out.println(\"do nothin\");\n }\n } catch (FileNotFoundException e) {\n System.out.println(\"file not found\");\n }\n return null;\n\n }", "public String loadFromFile() {\n StringBuilder sb = new StringBuilder();\n try {\n Log.d(\"DEBUG\", this.context.getPackageName());\n Log.d(\"DEBUG\", this.file);\n FileInputStream fis = context.openFileInput(file);\n BufferedReader br = new BufferedReader(new InputStreamReader(fis, this.encoding));\n String line;\n while(( line = br.readLine()) != null ) {\n sb.append( line );\n sb.append( '\\n' );\n }\n } catch (IOException e) {\n e.printStackTrace();\n return \"\";\n }\n return sb.toString();\n }", "public Output getOutput() {\n\t\treturn OutputFactory.of(outputFile.toPath());\n\t}", "private String getFileContent(String filePath) {\r\n\r\n\t\ttry {\r\n\t\t\tString text = new String(Files.readAllBytes(Paths.get(filePath)), StandardCharsets.UTF_8);\r\n\t\t\treturn text;\r\n\t\t} catch (Exception ex) {\r\n\t\t\treturn \"-1\";\r\n\t\t}\r\n\t}", "public String getRunLocation();", "public String generateJsonFileFromParsedTextFileInApp() {\n\t\treturn generateJsonFileFromParsedTextFile(TEXTSAMPLEFILE);\n\t}", "public static String getContent(IFile file) throws Exception {\n return getContent(file.getContents(true));\n }", "public String getContents() {\n return contents;\n }", "String content();", "@Override\n public BufferedReader requestContentTxtFile(Context context) throws IOException{\n InputStream ins = context.getResources().openRawResource(R.raw.timferris);\n BufferedReader reader = new BufferedReader(new InputStreamReader(ins));\n Log.d(\"teste leitura\", \"Model return after reading has been reached\");\n\n return reader;\n }", "public String getFileContent(String filePath) {\n\t\tString content = \"\";\n\t\t// get the path\n\t\tString path = filePath.substring(0, filePath.lastIndexOf(\"/\"));\n\t\t// get the file's name\n\t\tString name = filePath.substring(filePath.lastIndexOf(\"/\") + 1);\n\t\t// iterate through all the files to see if we can find it...\n\t\tfor (FileObjects t : getDirectory(path, directory).getFiles()) {\n\t\t\tif (name.equals(t.getName())) {\n\t\t\t\tcontent = t.getContent();\n\t\t\t}\n\t\t}\n\t\t// return the content of the file, or just an empty string if it's\n\t\t// empty.\n\t\treturn content;\n\n\t}", "String getContent() throws IOException;", "private static String getSourceFile() {\n\t\tFileChooser fileChooser = new FileChooser(System.getProperty(\"user.home\"),\n\t\t\t\t\"Chose json file containing satellite data!\", \"json\");\n\t\tFile file = fileChooser.getFile();\n\t\tif (file == null) {\n\t\t\tSystem.exit(-42);\n\t\t}\n\t\treturn file.getAbsolutePath();\n\t}", "protected String retrieveRbFile() {\r\n\t\tString className = this.getClass().getName();\r\n\t\tString packageName = this.getClass().getPackage().getName() + \".\";\r\n\t\treturn className.replaceFirst(packageName, \"\");\r\n\t}", "File getWorkfile();", "public String readFromFile() throws IOException {\n return br.readLine();\n }", "private InputStream getStubFile() throws MojoExecutionException {\n return getClass().getResourceAsStream(\"Messages.java.stub\");\n }", "public List<String> getFileContent() {\r\n\t\tTextFileProcessor proc = new TextFileProcessor();\r\n\t\tthis.processFile(proc);\r\n\t\treturn proc.strList;\r\n\t}", "public String readFileContent(File file) {\n StringBuilder fileContentBuilder = new StringBuilder();\n if (file.exists()) {\n String stringLine;\n try {\n FileReader fileReader = new FileReader(file);\n BufferedReader bufferedReader = new BufferedReader(fileReader);\n while ((stringLine = bufferedReader.readLine()) != null) {\n fileContentBuilder.append(stringLine + \"\\n\");\n }\n bufferedReader.close();\n fileReader.close();\n } catch (FileNotFoundException e) {\n e.printStackTrace();\n } catch (IOException e) {\n e.printStackTrace();\n }\n }\n\n return fileContentBuilder.toString();\n }", "public String getContents() {\n\t\treturn contents;\n\t}", "protected String getCurrentTestedModuleFile() {\n\t\treturn null;\n\t}", "@Override\r\n\t\t\t\tpublic void run() {\n\t\t\t\t\tparseFile(\"english_file.txt\");\r\n\t\t\t\t}", "private StringReader buildFileContents(String programFile) throws IOException {\n BufferedReader reader = new BufferedReader(new FileReader(programFile));\n StringBuilder newProgram = new StringBuilder();\n String nxt;\n newProgram.append(getMultiCoreFunctions());\n while ((nxt = reader.readLine()) != null){\n newProgram.append(nxt + \"\\n\");\n }\n return new StringReader(newProgram.toString());\n }", "@Override\n public ArrayList<RunnerThread> getRunners() {\n \tArrayList<RunnerThread> runners = new ArrayList<RunnerThread>();\n \ttry {\n \t\tString line = data.readLine();\n \t\twhile(line != null) {\n \t\t\tRunnerThread runner = getData(line);\n \t\t\trunners.add(runner); \n \t\t\tline = data.readLine();\n \t\t}\n \t}\n \tcatch (IOException e) {\n \t\tSystem.out.println(\"The following error occured while reading the file.\");\n \t\te.printStackTrace();\n \t\tSystem.exit(3);\n \t}\n\t\treturn runners;\n \t}", "private String getStringFromFile() throws FileNotFoundException {\n String contents;\n FileInputStream fis = new FileInputStream(f);\n StringBuilder stringBuilder = new StringBuilder();\n try {\n InputStreamReader inputStreamReader = new InputStreamReader(fis, \"UTF-8\");\n BufferedReader reader = new BufferedReader(inputStreamReader);\n String line = reader.readLine();\n while (line != null) {\n stringBuilder.append(line).append('\\n');\n line = reader.readLine();\n }\n } catch (IOException e) {\n // Error occurred when opening raw file for reading.\n } finally {\n contents = stringBuilder.toString();\n }\n return contents;\n }", "private static String getFilesContent() {\n String content = \"\";\n try {\n //cameras.json\n AssetManager am = MarketApplication.getMarketApplication().getAssets();\n InputStream stream = am.open(CAMERAS_FILE_NAME);\n int size = stream.available();\n byte[] buffer = new byte[size];\n stream.read(buffer);\n mJsonCameras = new String(buffer);\n\n //videogames.json\n stream = am.open(VIDEO_GAMES_FILE_NAME);\n size = stream.available();\n buffer = new byte[size];\n stream.read(buffer);\n mJsonVideogames = new String(buffer);\n\n //clothes.json\n stream = am.open(CLOTHES_FILE_NAME);\n size = stream.available();\n buffer = new byte[size];\n stream.read(buffer);\n stream.close();\n mJsonClothesProducts = new String(buffer);\n\n\n } catch (IOException e) {\n Log.e(TAG, \"Couldn't read the file\");\n }\n return content;\n }", "@Override\n public List<String> getTestCases(String path) {\n try{\n //Set Encoding to UTF-8\n Charset inputCharset = StandardCharsets.UTF_8;\n //Use bufferReader to read the file and extract text line by line\n BufferedReader bufferedReader = new BufferedReader(new InputStreamReader(new FileInputStream(path), inputCharset));\n String line;\n List<String> result = new ArrayList<>();\n while ((line = bufferedReader.readLine()) != null) {\n result.add(line);\n }\n result = result.stream().filter(s -> !s.isEmpty()).collect(Collectors.toList());\n return result;\n }catch (Exception e){\n throw new IllegalArgumentException(\"Could not extract test cases from file: \" + e.getMessage());\n }\n }", "public String getOutput() throws TavernaException, ProcessException{\n if (outputFile == null){\n return saveOutput();\n }\n try {\n return runner.getOutput();\n } catch (InterruptedException ex) {\n throw new TavernaException (\"Workflow was interrupted.\", ex);\n }\n }", "public String readFile(){\n\t\tString res = \"\";\n\t\t\n\t\tFile log = new File(filePath);\n\t\tBufferedReader bf = null;\n\t\t\n\t\ttry{\n\t\t\tbf = new BufferedReader(new FileReader(log));\n\t\t\tString line = bf.readLine();\n\t\t\n\t\t\n\t\t\twhile (line != null){\n\t\t\t\tres += line+\"\\n\";\n\t\t\t\tline = bf.readLine();\n\t\t\t}\n\t\t\n\t\t\treturn res;\n\t\t}\n\t\tcatch(Exception oops){\n\t\t\tSystem.err.println(\"There was an error reading the file \"+oops.getStackTrace());\n\t\t\treturn \"\";\n\t\t}\n\t\tfinally{\n\t\t\ttry {\n\t\t\t\tbf.close();\n\t\t\t} catch (IOException e) {\n\t\t\t\tSystem.err.println(\"There was an error closing the read Buffer \"+e.getStackTrace());\n\t\t\t}\n\t\t}\n\t}", "long getRunner();", "protected String inputInFile() {\n return \"T//\" + this.getTaskStatus() + \"//\"\n + super.getDescription();\n }", "public File getDataFile();", "public Result getFile() {\n File file = new File(\"/home/yongmu/MIDBatch.csv\");\n Scanner scanner = null;\n try {\n scanner = new Scanner(file);\n } catch (FileNotFoundException e) {\n e.printStackTrace();\n }\n while(scanner.hasNext()) {\n System.out.println(scanner.next());\n }\n return ok(file);\n }", "public File getTemplateFile();", "public static String readFile() {\n\t\tFileReader file;\n\t\tString textFile = \"\";\n\n\t\ttry {\n\t\t\tfile = new FileReader(path);\n\n\t\t\t// Output string.\n\t\t\ttextFile = new String();\n\n\t\t\tBufferedReader bfr = new BufferedReader(file);\n\n\t\t\ttextFile= bfr.readLine();\n\t\t\t\n\t\t} catch (Exception e) {\n\t\t\tSystem.out.println(\"Error reading the file\");\n\t\t}\n\t\treturn textFile;\n\n\t}", "java.lang.String getContent();", "java.lang.String getContent();", "java.lang.String getContent();", "java.lang.String getContent();", "java.lang.String getContent();", "java.lang.String getContent();", "private String readFile(String source) throws IOException {\n StringBuilder contentBuilder = new StringBuilder();\n try (Stream<String> stream = Files.lines(Paths.get(source), StandardCharsets.UTF_8)) {\n stream.forEach(s -> contentBuilder.append(s));\n }\n return contentBuilder.toString();\n }", "public String getContents() {\n return this.contents;\n }", "public String execute() {\n String output = \"\";\n String tempOut = \"\";\n FSElement file;\n ArrayList<FSElement> recfiles;\n for (String fileName : dirArray) {\n file = Traverse.accessFS(fileName, root);\n if (file != null) {\n if (file instanceof File) {\n tempOut = getContent((File) file);\n if (!(output.contains(tempOut))) {\n output += tempOut;\n }\n } else if (subdir) {\n recfiles = Traverse.getAllDirs((Directory) file);\n for (FSElement temp : recfiles) {\n if (temp instanceof File) {\n tempOut = getContent((File) temp);\n if (!(output.contains(tempOut))) {\n output += tempOut;\n }\n }\n }\n }\n } else {\n Output.pathIncorrect(fileName);\n }\n }\n if (!(output.equals(\"\"))) {\n output = output.substring(0, output.length() - 2);\n return output;\n } else {\n Output.NoFilesFound();\n return null;\n }\n }", "public static void main(String[] args) {\n byte[] content = null;\n try {\n content = Files.readAllBytes(new File(\"C:\\\\Users\\\\Administrator\\\\Desktop\\\\diemkhang\\\\test reader\\\\introduce.txt\").toPath());\n } catch (IOException e) {\n e.printStackTrace();\n }\n System.out.println(new String(content));\n }", "public String getContents(File file) {\n\t //...checks on file are elided\n\t StringBuilder contents = new StringBuilder();\n\t \n\t try {\n\t //use buffering, reading one line at a time\n\t //FileReader always assumes default encoding is OK!\n\t BufferedReader input = new BufferedReader(new FileReader(file));\n\t try {\n\t String line = null; \n\n\t while (( line = input.readLine()) != null){\n\t contents.append(line);\n\t contents.append(\"\\r\\n\");\t }\n\t }\n\t finally {\n\t input.close();\n\t }\n\t }\n\t catch (IOException ex){\n\t log.error(\"Greska prilikom citanja iz fajla: \"+ex);\n\t }\n\t \n\t return contents.toString();\n\t}", "private String getFileContents ()\n {\n final String s = m_buffers.values ()//\n .stream ()//\n .flatMap (List::stream)//\n .collect (Collectors.joining ());\n\n return s;\n }", "private String readFile(String source) throws IOException {\n StringBuilder contentBuilder = new StringBuilder();\n try (Stream<String> stream = Files.lines(Paths.get(source), StandardCharsets.UTF_8)) {\n stream.forEach(s -> contentBuilder.append(s));\n }\n\n return contentBuilder.toString();\n }", "public ResourceContent getContent() throws IOException;", "@Override\n public String execute() throws Exception {\n String workingDir = System.getProperty(\"user.dir\");\n File f = new File(workingDir + \"/target/classes/text.txt\");\n fileInputStream = new FileInputStream(f);\n return SUCCESS;\n }", "private byte[] getContent(File f) {\n byte[] content = null;\n\n try {\n FileInputStream fis = new FileInputStream(f);\n byte[] temp = new byte[fis.available()];\n fis.read(temp);\n fis.close();\n content = temp;\n } catch (IOException e) {\n System.err.println(e.getMessage());\n }\n\n return content;\n }", "public File getFile() {\n return resultsFile;\n }", "private String readFile(String source) throws IOException {\n StringBuilder contentBuilder = new StringBuilder();\n\n try (Stream<String> stream = Files.lines(Paths.get(source), StandardCharsets.UTF_8)) {\n stream.forEach(s -> contentBuilder.append(s));\n }\n\n return contentBuilder.toString();\n }", "public static String getSampleDefintion() throws IOException\n\t{\n\t\tInputStream is = ResourceHelper.getResourceAsStream(\"org/infoglue/cms/controllers/TestContentDefinition.xml\", ContentTypeDefinitionControllerTest.class);\n\n\t\tif(is == null)\n\t\t\tfail(\"Unable to read test document, make sure it got copied to the test classpath\");\n\n\t\tString line = null;\n\t\tStringBuffer sb = new StringBuffer();\n\t\tBufferedReader reader = new BufferedReader(new InputStreamReader(is));\n\t\twhile((line = reader.readLine()) != null)\n\t\t\tsb.append(line);\n\n\t\treader.close();\n\t\treturn sb.toString();\n\t}", "@Override\n public File getSourceFile() {\n return _file;\n }", "String input() {\n\n try {\n\n FileReader reader = new FileReader(\"the text.txt\");\n BufferedReader bufferedReader = new BufferedReader(reader);\n StringBuilder builder = new StringBuilder();\n String line;\n\n while ((line = bufferedReader.readLine()) != null)\n builder.append(line);\n\n return builder.toString();\n\n } catch (IOException e) {\n\n System.out.println(\"Input Failure\");\n return null;\n }\n }", "protected String readTestFile(String path) throws IOException {\n return FileUtils.readClasspathFile(path);\n }", "public String getMainFilePath() {\n return primaryFile.getAbsolutePath();\n //return code[0].file.getAbsolutePath();\n }", "private static String getText(IFile file) throws CoreException, IOException {\n\t\tInputStream in = file.getContents();\n\t\tByteArrayOutputStream out = new ByteArrayOutputStream();\n\t\tbyte[] buf = new byte[1024];\n\t\tint read = in.read(buf);\n\t\twhile (read > 0) {\n\t\t\tout.write(buf, 0, read);\n\t\t\tread = in.read(buf);\n\t\t}\n\t\treturn out.toString();\n\t}", "private Demo doReadDemo() throws IOException {\n // create a resource loader\n final URL defaultRoot = ResourceUtil.getURL(\"demo/\");\n final URLClassLoader resourceLoader = new URLClassLoader(\n new URL[] { defaultRoot }, null);\n return doReadDemo(resourceLoader);\n }", "private String readFile(String source) throws IOException {\n StringBuilder contentBuilder = new StringBuilder();\n\n try (Stream<String> stream = Files.lines(Paths.get(source), StandardCharsets.UTF_8)) {\n stream.forEach(contentBuilder::append);\n }\n return contentBuilder.toString();\n }", "public String ReadContent(File fileToRead) {\n StringBuilder spamFilterContent = new StringBuilder();\n String fileContent = \"\";\n try {\n BufferedReader bufferedReader = new BufferedReader(new FileReader(fileToRead));\n String line;\n\n while ((line = bufferedReader.readLine()) != null) {\n spamFilterContent.append(line);\n }\n bufferedReader.close();\n fileContent = spamFilterContent.toString();\n } catch (IOException e) {\n //You'll need to add proper error handling here\n }\n\n return fileContent;\n }", "private String getDataFromClassResourceFile(String file) {\n\n StringBuffer sb = new StringBuffer();\n String str = \"\";\n\n InputStream is = this.getClass().getClassLoader().getResourceAsStream(file);\n try {\n BufferedReader reader = new BufferedReader(new InputStreamReader(is));\n if (is != null) {\n while ((str = reader.readLine()) != null) {\n sb.append(str + \"\\n\");\n }\n }\n } catch (IOException ioe) {\n ioe.printStackTrace();\n } finally {\n try {\n is.close();\n } catch (Throwable ignore) {\n }\n }\n return sb.toString();\n\n }" ]
[ "0.61568964", "0.61375713", "0.5997536", "0.5932564", "0.5843764", "0.56922424", "0.5671665", "0.5651199", "0.55825", "0.55825", "0.5528545", "0.55228597", "0.5519582", "0.549795", "0.54979455", "0.54969954", "0.54751897", "0.5441682", "0.54287636", "0.5404742", "0.53708965", "0.53594637", "0.5358594", "0.5358594", "0.5358594", "0.5358594", "0.5358594", "0.5358594", "0.5358594", "0.5358594", "0.5346421", "0.53436095", "0.5339221", "0.53368235", "0.5326139", "0.53255975", "0.53250104", "0.52979875", "0.52838844", "0.527686", "0.52718925", "0.5271629", "0.52716225", "0.52672964", "0.5263709", "0.5253448", "0.52413976", "0.52375716", "0.52338535", "0.52204996", "0.5214965", "0.5208956", "0.51999", "0.5195951", "0.5182114", "0.5181249", "0.5176476", "0.5174398", "0.5172798", "0.51711893", "0.5170285", "0.5166342", "0.5138878", "0.51256037", "0.5124338", "0.51240516", "0.51236147", "0.5121363", "0.51038146", "0.5097105", "0.508801", "0.5085689", "0.50772756", "0.50772756", "0.50772756", "0.50772756", "0.50772756", "0.50772756", "0.5076981", "0.5070248", "0.5069513", "0.50682545", "0.5066678", "0.50630736", "0.50627023", "0.50556076", "0.50546956", "0.5053365", "0.50533396", "0.50446814", "0.5036717", "0.50239074", "0.5023493", "0.5022078", "0.50156885", "0.5010664", "0.5008509", "0.5004967", "0.50027055", "0.5001202" ]
0.5798323
5
Perform additional substitutions when the provided template is a java class file.
private String replaceJavaTemplatePlaceholders( final String runnerTemplatePath, final String featureFileName, final String fileString ) { String javaFileName = Paths.get(runnerTemplatePath).getFileName().toString(); String javaFileNameWithoutExtension = javaFileName.substring(0, javaFileName.lastIndexOf('.')); String replacedFileString = fileString.replace(javaFileNameWithoutExtension, featureFileName); replacedFileString = replacedFileString.replaceAll("package .*;", ""); return replacedFileString; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void generateDraftClass(HashMap<String, String> draftDataMap, String template) {\n List<String> rowList = new ArrayList<>(Arrays.asList(template.split(\"\\n\")));\n\n // Creates directory if directory doesn't exist.\n File draftDirectory = new File(draftDirectoryPath);\n if (!draftDirectory.exists()) {\n LOGGER.info(\"Created draft directory\");\n draftDirectory.mkdir();\n }\n\n LOGGER.info(\"Beginning of replacement of markers\");\n Set<String> keySet = draftDataMap.keySet();\n rowList = rowList\n .stream()\n .map(rowItem -> {\n for (String key : keySet) {\n //TODO IllegalArgumentException when replace test with { }\n rowItem = rowItem.replaceAll(String.format(KEY_WORD_TEMPLATE, key), draftDataMap.get(key));\n }\n rowItem += \"\\n\";\n return rowItem;\n })\n .collect(Collectors.toList());\n LOGGER.info(\"Ending of replacement of markers\");\n\n LOGGER.info(String.format(\"Creating %s class\", draftDataMap.get(CLASS_NAME)));\n Pattern pattern = Pattern.compile(\"public class.*\");\n Matcher matcher = pattern.matcher(settings.getTemplate());\n //get public class row\n String str = null;\n if (matcher.find()) {\n str = matcher.group();\n }\n\n Pattern pattern2 = Pattern.compile(\"\\\\{\\\\{[A-Z_]*\\\\}\\\\}\");\n Matcher matcher2 = pattern2.matcher(str);\n //get field list\n List<String> list = new ArrayList<>();\n while (matcher2.find()) {\n list.add(matcher2.group().replaceAll(\"[\\\\{\\\\}]\", \"\"));\n }\n String className = str.split(\" \")[2];\n\n for (String var : list) {\n className = className.replaceAll(\"\\\\{\\\\{[\" + var + \"]*\\\\}\\\\}\", draftDataMap.get(var));\n }\n\n String filepath = draftDirectoryPath + \"/\" + className;\n writeRowListToFile(rowList, filepath + \".java\");\n }", "public void generateScript( TemplateCompilerContext context )\r\n\t{\r\n\t\t// TODO This may give conflicts when more than one TemplateLoader is used. This must be the complete path.\r\n\t\tMatcher matcher = PATH_PATTERN.matcher( context.getPath() );\r\n\t\tAssert.isTrue( matcher.matches() );\r\n\t\tString path = matcher.group( 1 );\r\n\t\tString name = matcher.group( 2 );\r\n\r\n\t\tString pkg = TEMPLATE_PKG;\r\n\t\tif( path != null )\r\n\t\t\tpkg += \".\" + path.replaceAll( \"/+\", \".\" );\r\n\r\n\t\tStringBuilder buffer = new StringBuilder( 1024 );\r\n\r\n\t\tbuffer.append( \"package \" ).append( pkg ).append( \";\" );\r\n\t\tif( context.getImports() != null )\r\n\t\t\tfor( String imprt : context.getImports() )\r\n\t\t\t\tbuffer.append( \"import \" ).append( imprt ).append( ';' );\r\n\t\tbuffer.append( \"class \" ).append( name.replaceAll( \"[\\\\.-]\", \"_\" ) );\r\n\t\tbuffer.append( \"{Closure getClosure(){return{out->\" );\r\n\r\n\t\tboolean text = false;\r\n\t\tfor( ParseEvent event : context.getEvents() )\r\n\t\t\tswitch( event.getEvent() )\r\n\t\t\t{\r\n\t\t\t\tcase TEXT:\r\n\t\t\t\tcase NEWLINE:\r\n\t\t\t\tcase WHITESPACE:\r\n\t\t\t\t\tif( !text )\r\n\t\t\t\t\t\tbuffer.append( \"out.write(\\\"\\\"\\\"\" );\r\n\t\t\t\t\ttext = true;\r\n\t\t\t\t\twriteGroovyString( buffer, event.getData() );\r\n\t\t\t\t\tbreak;\r\n\r\n\t\t\t\tcase SCRIPT:\r\n\t\t\t\t\tif( text )\r\n\t\t\t\t\t\tbuffer.append( \"\\\"\\\"\\\");\" );\r\n\t\t\t\t\ttext = false;\r\n\t\t\t\t\tbuffer.append( event.getData() ).append( ';' );\r\n\t\t\t\t\tbreak;\r\n\r\n\t\t\t\tcase EXPRESSION:\r\n\t\t\t\t\tif( text )\r\n\t\t\t\t\t\tbuffer.append( \"\\\"\\\"\\\");\" );\r\n\t\t\t\t\ttext = false;\r\n\t\t\t\t\tbuffer.append( \"out.write(\" ).append( event.getData() ).append( \");\" );\r\n\t\t\t\t\tbreak;\r\n\r\n\t\t\t\tcase EXPRESSION2:\r\n\t\t\t\t\tif( !text )\r\n\t\t\t\t\t\tbuffer.append( \"out.write(\\\"\\\"\\\"\" );\r\n\t\t\t\t\ttext = true;\r\n\t\t\t\t\tbuffer.append( \"${\" ).append( event.getData() ).append( '}' ); // FIXME Need to escape \"\"\"\r\n\t\t\t\t\tbreak;\r\n\r\n\t\t\t\tcase DIRECTIVE:\r\n\t\t\t\tcase COMMENT:\r\n\t\t\t\t\tif( event.getData().length() == 0 )\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\tif( text )\r\n\t\t\t\t\t\tbuffer.append( \"\\\"\\\"\\\");\" );\r\n\t\t\t\t\ttext = false;\r\n\t\t\t\t\tbuffer.append( event.getData() );\r\n\t\t\t\t\tbreak;\r\n\r\n\t\t\t\tcase EOF:\r\n\t\t\t\tdefault:\r\n\t\t\t\t\tAssert.fail( \"Unexpected event \" + event.getEvent() );\r\n\t\t\t}\r\n\r\n\t\tif( text )\r\n\t\t\tbuffer.append( \"\\\"\\\"\\\");\" );\r\n\t\tbuffer.append( \"}}}\" );\r\n\r\n\t\tcontext.setScript( buffer );\r\n\t}", "public void compileTemplates(HashMap<String, HCISRFileAST> imports,ArrayList<HCISRClassAST> newClasses) {\n\t\t\n\t}", "public ResolvedTemplate(Template template){\n\t\tthis.template = template;\n\t\tthis.postParseReplacement = \"\";\n\t\tcheckPreParseReplacement();\n\t}", "public void compileScript( TemplateCompilerContext context )\r\n\t{\r\n\t\t// Compile to bytes\r\n\t\tCompilationUnit unit = new CompilationUnit();\r\n\t\tunit.addSource( context.getPath(), context.getScript().toString() );\r\n\t\tunit.compile( Phases.CLASS_GENERATION );\r\n\r\n\t\t// Results\r\n\t\t@SuppressWarnings( \"unchecked\" )\r\n\t\tList< GroovyClass > classes = unit.getClasses();\r\n\t\tAssert.isTrue( classes.size() > 0, \"Expecting 1 or more classes\" );\r\n\r\n\t\tClassLoader parent = Thread.currentThread().getContextClassLoader();\r\n\t\tif( parent == null )\r\n\t\t\tparent = GroovyTemplateCompiler.class.getClassLoader();\r\n\r\n\t\t// Define the class\r\n\t\t// TODO Configurable class loader\r\n\t\tDefiningClassLoader classLoader = new DefiningClassLoader( parent );\r\n\t\tClass< ? > first = null;\r\n\t\tfor( GroovyClass cls : classes )\r\n\t\t{\r\n\t\t\tClass< ? > clas = classLoader.defineClass( cls.getName(), cls.getBytes() );\r\n\t\t\tif( first == null )\r\n\t\t\t\tfirst = clas; // TODO Are we sure that the first one is always the right one?\r\n\t\t}\r\n\r\n\t\t// Instantiate the first\r\n\t\tGroovyObject object = (GroovyObject)Util.newInstance( first );\r\n\t\tClosure closure = (Closure)object.invokeMethod( \"getClosure\", null );\r\n\r\n\t\t// The old way:\r\n//\t\tClass< GroovyObject > groovyClass = new GroovyClassLoader().parseClass( new GroovyCodeSource( getSource(), getName(), \"x\" ) );\r\n\r\n\t\tcontext.setTemplate( new GroovyTemplate( closure ) );\r\n\t}", "void mo25969f(TemplateInfo templateInfo);", "@Override\n protected String prepareFilename(String filenameTemplate, AmqpClass thisClass, AmqpMethod method,\n AmqpField field, AmqpVersion version)\n {\n StringBuffer sb = new StringBuffer(filenameTemplate);\n if (thisClass != null)\n {\n replaceToken(sb, \"${CLASS}\", thisClass.getName());\n }\n if (method != null)\n {\n replaceToken(sb, \"${METHOD}\", method.getName());\n }\n if (field != null)\n {\n replaceToken(sb, \"${FIELD}\", field.getName());\n }\n return sb.toString();\n }", "void mo25968e(TemplateInfo templateInfo);", "StringTemplate createStringTemplate();", "public static String transformTemplateToClass(String templateToTransform, String targetNamespace) {\n\n String transformedTemplate = templateToTransform;\n\n\n if (targetNamespace != null) {\n // check whether entity is already transformed to target targetNamespace\n String namespaceDomain = ResourceBundle.getBundle(\"config\").getString(\"targetnamespace\");\n if (!templateToTransform.contains(namespaceDomain) && templateToTransform.contains(\"dbpedia.org\")) {\n // transform into target targetNamespace\n transformedTemplate = templateToTransform.replaceAll(\"dbpedia.org\", targetNamespace);\n }\n }\n\n // transform into class\n transformedTemplate = transformedTemplate.replace(\"/resource/Template:\", \"/class/\");\n\n // remove infobox information\n transformedTemplate = transformedTemplate.replace(\"infobox_\", \"\");\n transformedTemplate = transformedTemplate.replace(\"_infobox\", \"\");\n transformedTemplate = transformedTemplate.replace(\"Infobox_\", \"\");\n transformedTemplate = transformedTemplate.replace(\"_Infobox\", \"\");\n\n // transform first character of class name to uppercase\n transformedTemplate = transformedTemplate.substring(0, transformedTemplate.indexOf(\"/class/\") + 7)\n + transformedTemplate.substring(transformedTemplate.indexOf(\"/class/\") + 7).substring(0, 1).toUpperCase()\n + transformedTemplate.substring(transformedTemplate.indexOf(\"/class/\") + 7).substring(1);\n\n return transformedTemplate;\n }", "public void handleJava(HtmlObjects.Java t)\n {\n }", "public Jtpl(Reader template) throws IOException {\n fileText = readFile(template);\n makeTree(fileText);\n pattern = Pattern.compile(\"\\\\{([\\\\w\\\\.]+)\\\\}\");\n blockPattern = Pattern.compile(\"_BLOCK_\\\\.(.+)\");\n }", "public void setTemplate(Template template)\n/* */ {\n/* 62 */ this.template = template;\n/* */ }", "@Override\n public String doMapping(String template)\n {\n log.debug(\"doMapping({})\", template);\n // Copy our elements into an array\n List<String> components\n = new ArrayList<>(Arrays.asList(StringUtils.split(\n template,\n String.valueOf(TemplateService.TEMPLATE_PARTS_SEPARATOR))));\n int componentSize = components.size() - 1 ;\n\n // This method never gets an empty string passed.\n // So this is never < 0\n String templateName = components.get(componentSize);\n components.remove(componentSize--);\n\n log.debug(\"templateName is {}\", templateName);\n\n // Last element decides, which template Service to use...\n TemplateService templateService = (TemplateService)TurbineServices.getInstance().getService(TemplateService.SERVICE_NAME);\n TemplateEngineService tes = templateService.getTemplateEngineService(templateName);\n\n if (tes == null)\n {\n return null;\n }\n\n String defaultName = \"Default.vm\";\n\n // This is an optimization. If the name we're looking for is\n // already the default name for the template, don't do a \"first run\"\n // which looks for an exact match.\n boolean firstRun = !templateName.equals(defaultName);\n\n for(;;)\n {\n String templatePackage = StringUtils.join(components.iterator(), String.valueOf(separator));\n\n log.debug(\"templatePackage is now: {}\", templatePackage);\n\n StringBuilder testName = new StringBuilder();\n\n if (!components.isEmpty())\n {\n testName.append(templatePackage);\n testName.append(separator);\n }\n\n testName.append((firstRun)\n ? templateName\n : defaultName);\n\n // But the Templating service must look for the name with prefix\n StringBuilder templatePath = new StringBuilder();\n if (StringUtils.isNotEmpty(prefix))\n {\n templatePath.append(prefix);\n templatePath.append(separator);\n }\n templatePath.append(testName);\n\n log.debug(\"Looking for {}\", templatePath);\n\n if (tes.templateExists(templatePath.toString()))\n {\n log.debug(\"Found it, returning {}\", testName);\n return testName.toString();\n }\n\n if (firstRun)\n {\n firstRun = false;\n }\n else\n {\n // We run this loop only two times. The\n // first time with the 'real' name and the\n // second time with \"Default\". The second time\n // we will end up here and break the for(;;) loop.\n break;\n }\n }\n\n log.debug(\"Returning default\");\n return getDefaultName(template);\n }", "void replaceClasses(Class current, Class replacement);", "protected void processTemplate(Map<String,?> attributes, Writer out, Template template, String encoding) throws IOException {\n long startTime = System.currentTimeMillis();\n\n Context context = buildContext(attributes);\n template.setEncoding(encoding);\n\n try {\n template.merge(context, out);\n log.debug(\"Velocity template transform processed in \" + \n (System.currentTimeMillis() - startTime) + \" ms\");\n } catch (ResourceNotFoundException errAny) {\n throw new RuntimeException(\"Error merging the velocity template\", errAny);\n } catch (ParseErrorException errAny) {\n throw new RuntimeException(\"Error merging the velocity template\", errAny);\n } catch (Exception errAny) {\n throw new RuntimeException(\"Error merging the velocity template\", errAny);\n }\n }", "private String readAndProcessSourceFile(String fileName, HashMap<String, String> substitutions) {\r\n try {\r\n // Read the source file packaged as a resource\r\n BufferedReader br = new BufferedReader(new InputStreamReader(\r\n getClass().getClassLoader().getResourceAsStream(fileName)));\r\n StringBuffer sb = new StringBuffer();\r\n try {\r\n String line = null;\r\n while (true) {\r\n line = br.readLine();\r\n if (line == null) {\r\n break;\r\n }\r\n sb.append(line + \"\\n\");\r\n }\r\n }\r\n finally {\r\n br.close();\r\n }\r\n String text = sb.toString();\r\n\r\n // Handle substitutions as key-value pairs where key is a regular expression and value is the substitution\r\n if (substitutions != null) {\r\n for (Entry<String, String> s : substitutions.entrySet()) {\r\n Pattern p = Pattern.compile(s.getKey());\r\n Matcher m = p.matcher(text);\r\n sb = new StringBuffer();\r\n while (m.find()) {\r\n m.appendReplacement(sb, m.group(1) + s.getValue());\r\n }\r\n m.appendTail(sb);\r\n text = sb.toString();\r\n }\r\n }\r\n\r\n return text;\r\n }\r\n catch (IOException e) {\r\n throw new RuntimeException(e);\r\n }\r\n }", "private void ensureCorrectJavaFormat(File javaFile) throws FileNotFoundException, IOException\n\t{\n\t\tFile temp = new File(\"action.temp\");\n\t\tPrintWriter printer = new PrintWriter(new BufferedWriter(new FileWriter(temp)));\n\t\tString fileName = javaFile.getName();\n\t\tString directoryName = javaFile.getParentFile().getName();\n\t\ttry(BufferedReader buffyTheFileSlayer = new BufferedReader(new FileReader(javaFile)))\n\t\t{\n\t\t\tboolean foundPackage = false;\n\t\t\tboolean foundClass = false;\n\t\t\tString line;\n\t\t\twhile((line = buffyTheFileSlayer.readLine()) != null)\n\t\t\t{\n\t\t\t\tif(!foundPackage && line.matches(\"package .+\"))\n\t\t\t\t{\n\t\t\t\t\tfoundPackage = true;\n\t\t\t\t\tif(!line.matches(\".*\" + directoryName + \".*\"))\n\t\t\t\t\t{\n\t\t\t\t\t\tline = \"package \" + directoryName + \";\";\n\t\t\t\t\t}\n\t\t\t\t} else if(!foundClass && line.matches(\"public class .+ implements ActionNode\"))\n\t\t\t\t{\n\t\t\t\t\tfoundClass = true;\n\t\t\t\t\tif(!line.matches(\".*\" + fileName + \".*\"))\n\t\t\t\t\t{\n\t\t\t\t\t\tline = \"public class \" + fileName + \" extends ActionNode\";\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tprinter.println(line);\n\t\t\t}\n\t\t\tprinter.close();\n\t\t\tjavaFile.delete();\n\t\t\ttemp.renameTo(javaFile);\n\t\t}\n\t}", "@Test\n public void testClassName() {\n// assertEquals(SParser.parse(\"HardDisk\").toHTML(new SEclipseStyle(), new SClassName()),\"<pre style='color:#000000;background:#ffffff;'></pre>\"); //ClassName\n// assertEquals(\"{\",\"\"); //CurlyBracket\n// assertEquals(\"class\",\"\");//KeyWord\n// assertEquals(\"String\",\"\");//MainClass\n// assertEquals(\"String string\",\"\");//MainClass\n// assertEquals(\"public\",\"\");//Modifier\n// assertEquals(\"this\",\"\"); //PseudoVariable\n// assertEquals(\";\",\"\"); //Semicolon\n// assertEquals(\"\\\"string\\\"\",\"\"); //String\n// assertEquals(\"\",\"\"); //Body Alone\n\n// String html = source.toHTML(new SEclipseStyle(), new SClassName());\n// assertEquals(html, \"<pre style=\"\n// + \"'color:#000000;background:#ffffff;'>\"\n// + \"public class MainClass {\\n\"\n// + \" \\n\"\n// + \" public static void main(String args[]){\\n\"\n// + \" GradeBook myGradeBook=new GradeBook();\\n\"\n// + \" String courseName=\\\"Java \\\";\\n\"\n// + \" myGradeBook.displayMessage(courseName);\\n\"\n// + \" \\n\"\n// + \" }\\n\"\n// + \" }public class Foo {\\n\"\n// + \" \\n\"\n// + \" public boolean bar(){\\n\"\n// + \" super.foo();\\n\"\n// + \" return false;\\n\"\n// + \" \\n\"\n// + \" }\\n\"\n// + \" }</pre>\");\n }", "Expression compileTemplate(Expression exp){\r\n\t\tif (exp.isVariable()){\r\n\t\t\texp = compile(exp.getVariable());\r\n\t\t}\r\n\t\telse if (isMeta(exp)){\r\n\t\t\t// variables of meta functions are compiled as kg:pprint()\r\n\t\t\t// variable of xsd:string() is not\r\n\t\t\texp = compileTemplateMeta((Term) exp);\r\n\t\t}\r\n\t\treturn exp;\r\n\t}", "public abstract void mo32008e(TemplateInfo templateInfo);", "private void populateTemplate(String templateFile, BeanDefinition beanDefinition, File outputFile) {\r\n\t\t\r\n\t\tlogger.trace(\"enterCreateBean\");\r\n\t\t\r\n\t\t// set the serial version UID if one has not been specified.\r\n\t\tif (beanDefinition.getSerialVersionUID() == null || beanDefinition.getSerialVersionUID().isEmpty()) {\r\n\t\t\tbeanDefinition.setSerialVersionUID(new Date().getTime() + \"L\");\r\n\t\t}\r\n\t\t\r\n\t\tVelocityContext context = createContext(beanDefinition);\r\n\t\tString populatedTemplate =populateVelocityTemplate (templateFile, context); \r\n\t\t\r\n\t\ttry {\r\n\t\t\tFileWriter fw = new FileWriter(outputFile);\t\t\t\r\n\t\t\tfw.write(populatedTemplate);\r\n\t\t\tfw.flush();\r\n\t\t\tfw.close();\r\n\t\t\t\r\n\t\t} catch (IOException e) {\r\n\t\t\tlogger.error(e);\r\n\t\t}\r\n\t\t\r\n\t\tlogger.trace(\"exitCreateBean\");\r\n\r\n\t}", "public void applyTemplate(JasperDesign design, Template template)\n\t{\n\t}", "private void processTemplate(VelocityEngine velocityEngine, String template,\n String outputName, Context context)\n throws MojoExecutionException\n {\n File outputPath = new File(outputDirectory, outputName);\n\n Template velocityTemplate = velocityEngine.getTemplate(template);\n FileWriter fileWriter = null;\n try\n {\n fileWriter = new FileWriter(outputPath);\n velocityTemplate.merge(context, fileWriter);\n }\n catch (IOException e)\n {\n throw new MojoExecutionException(String.format(\n \"Error creating file '%s'\", outputPath.getAbsolutePath()));\n }\n finally\n {\n if (fileWriter != null)\n {\n try\n {\n fileWriter.close();\n }\n catch (IOException e)\n {\n getLog().warn(e);\n }\n }\n }\n }", "public abstract String getImportFromFileTemplate( );", "String template();", "static String applyTemplate(final String template, final Map<String, String> props) {\n String data = template;\n Set<Entry<String, String>> entries = props.entrySet();\n for (Entry<String, String> entry : entries) {\n data = replacePropertyWithValue(data, entry.getKey(), entry.getValue());\n }\n return data;\n }", "protected abstract String getTemplateName();", "private static String renderJavaName(String name, String keywordSuffix, boolean firstCharLowerCase) {\n // First, strip off any custom suffix\n if (name.endsWith(\"__c\") || name.endsWith(\"__r\")) {\n name = name.substring(0, name.length() - CUSTOM_POSTFIX_LENGTH);\n }\n\n // Convert to camelCase\n name = WordUtils.capitalize(name, new char[]{'_'});\n \n //Remove all underscores ('_')\n name = name.replace(\"_\", \"\");\n \n // If the name we're going to generate is a Java keyword\n // then we'll tweak it with the suffix argument\n if (SourceVersion.isKeyword(name.toLowerCase())) {\n name = name + keywordSuffix;\n }\n \n // Enforce the desired case on the first character\n if (firstCharLowerCase) {\n name = WordUtils.uncapitalize(name);\n } else {\n name = WordUtils.capitalize(name);\n }\n \n return name;\n }", "public native void compile() /*-{\r\n\t\tvar template = [email protected]::getJsObj()();\r\n\t\ttemplate.compile();\r\n\t}-*/;", "@Override\r\n\tpublic void visitJavaClass(JavaClass javaClass) {\n\t\t\r\n\t\t\r\n\t\tvisitClassName=javaClass.getClassName();\r\n\t\t\r\n\t\t//log.debug(\"className:+\"+visitClassName);\r\n\t\tsuper.visitJavaClass(javaClass);\r\n\t\t\r\n\t}", "void compileToJava();", "@Override\r\n\tpublic String getFormat() {\r\n\t\treturn \"java\";\r\n\t}", "String getTemplate();", "public static String getTemplate(String template, Pair<String, String>... replacements) {\n String ret = getTemplate(template);\n if (ret != null) {\n for (Pair<String, String> p : replacements) {\n ret = ret.replaceAll(p.fst, p.snd);\n }\n }\n return ret;\n }", "public ClassTemplate() {\n\t}", "@Override\r\n protected void addParameters() {\r\n super.addParameters();\r\n addParameter(new AlgorithmParameter(\r\n PARAMETER_CENTER_TEMPLATES,\r\n GT._T(\"Possible replacements for {0} tags\", HtmlTagType.CENTER.getOpenTag()),\r\n new AlgorithmParameterElement[] {\r\n new AlgorithmParameterElement(\r\n \"template name\",\r\n GT._T(\"Template for replacing {0} tag\", HtmlTagType.CENTER.getOpenTag())),\r\n new AlgorithmParameterElement(\r\n \"parameter name\",\r\n GT._T(\"Parameter to use in the template for the text\"),\r\n true),\r\n new AlgorithmParameterElement(\r\n \"true/false\",\r\n GT._T(\"If replacement can be automatic\"),\r\n true),\r\n new AlgorithmParameterElement(\r\n \"explanation\",\r\n GT._T(\"Description of the template\"),\r\n true)\r\n },\r\n true));\r\n addParameter(new AlgorithmParameter(\r\n PARAMETER_STRIKE_TEMPLATES,\r\n GT._T(\"Possible replacements for {0} tags\", HtmlTagType.STRIKE.getOpenTag()),\r\n new AlgorithmParameterElement[] {\r\n new AlgorithmParameterElement(\r\n \"template name\",\r\n GT._T(\"Template for replacing {0} tag\", HtmlTagType.STRIKE.getOpenTag())),\r\n new AlgorithmParameterElement(\r\n \"parameter name\",\r\n GT._T(\"Parameter to use in the template for the text\"),\r\n true),\r\n new AlgorithmParameterElement(\r\n \"true/false\",\r\n GT._T(\"If replacement can be automatic\"),\r\n true),\r\n new AlgorithmParameterElement(\r\n \"explanation\",\r\n GT._T(\"Description of the template\"),\r\n true)\r\n },\r\n true));\r\n addParameter(new AlgorithmParameter(\r\n PARAMETER_TT_TEMPLATES,\r\n GT._T(\"Possible replacements for {0} tags\", HtmlTagType.TT.getOpenTag()),\r\n new AlgorithmParameterElement[] {\r\n new AlgorithmParameterElement(\r\n \"template name\",\r\n GT._T(\"Template for replacing {0} tag\", HtmlTagType.TT.getOpenTag())),\r\n new AlgorithmParameterElement(\r\n \"parameter name\",\r\n GT._T(\"Parameter to use in the template for the text\"),\r\n true),\r\n new AlgorithmParameterElement(\r\n \"true/false\",\r\n GT._T(\"If replacement can be automatic\"),\r\n true),\r\n new AlgorithmParameterElement(\r\n \"explanation\",\r\n GT._T(\"Description of the template\"),\r\n true)\r\n },\r\n true));\r\n }", "Term compileTemplateMeta(Term exp){\t\t\r\n\t\tTerm t;\r\n\t\tif (exp.isFunction()){\r\n\t\t\tt = Term.function(exp.getName());\r\n\t\t}\r\n\t\telse {\r\n\t\t\tt = Term.create(exp.getName());\r\n\t\t}\r\n\t\tboolean isIF = isIF(exp);\r\n\t\tint count = 0;\r\n\t\t\r\n\t\tfor (Expression ee : exp.getArgs()){\r\n\t\t\tif (count == 0 && isIF){\r\n\t\t\t\t// not compile the test of if(test, then, else)\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\tee = compileTemplate(ee);\r\n\t\t\t}\r\n\t\t\tcount++;\r\n\t\t\tt.add(ee);\r\n\t\t}\r\n\t\t\r\n t.setArg(exp.getArg());\r\n\t\tt.setModality(exp.getModality());\r\n\t\tt.setDistinct(exp.isDistinct());\r\n\t\treturn t;\r\n\t\t\r\n\t}", "public static void write() throws IOException {\n VelocityContext context = new VelocityContext();\n\n //Put the data model in context object\n context.put(\"packageName\", packageName);\n context.put(\"className\", className);\n List<Attribute> attributes = new ArrayList<>();\n attributes.add(new Attribute(\"id\", \"int\"));\n attributes.add(new Attribute(\"firstName\", \"String\"));\n attributes.add(new Attribute(\"lastName\", \"String\"));\n attributes.add(new Attribute(\"dob\", \"LocalDate\"));\n context.put(\"attributes\", attributes);\n\n //Merge the template with context data\n StringWriter stringWriter = new StringWriter();\n Velocity.mergeTemplate(\"class.vm\", context, stringWriter);\n\n //Write to file\n FileWriter fw = null;\n try {\n fw = new FileWriter(\"output/User.java\");\n fw.write(stringWriter.toString());\n } finally {\n if (fw != null) {\n fw.close();\n }\n }\n }", "public void setMainClass(IJavaClassFile value);", "public static String parse(String template, Map<String, String> map){\n Matcher matcher = PROCESS_REGEX_PATTERN.matcher(template);\n int count = 0;\n StringBuffer sb = null;\n while(matcher.find()) {\n count++;\n if(sb == null) sb = new StringBuffer();\n String key = (String)matcher.group(1);\n if(map.containsKey(key)){\n matcher.appendReplacement(sb, map.get(key));\n }\n }\n if(count == 0){\n return template;\n } else {\n matcher.appendTail(sb);\n return sb.toString();\n }\n }", "protected abstract String getTemplateFilename();", "public abstract void setTemplCd(String templCd);", "public abstract String getTemplateName();", "@Override\n protected void internalTransform(String arg0, Map arg1) {\n for (SootClass c : Scene.v().getApplicationClasses()) {\n //if (c.getName().startsWith(\"com\"))//TODO\n // if(c.getName().start)\n try {\n transform(c);\n } catch (FileNotFoundException e) {\n e.printStackTrace();\n } catch (UnsupportedEncodingException e) {\n e.printStackTrace();\n }\n\n }\n }", "public final EObject entryRuleTemplateParameterSubstitutionCS() throws RecognitionException {\n EObject current = null;\n\n EObject iv_ruleTemplateParameterSubstitutionCS = null;\n\n\n try {\n // InternalMyDsl.g:9710:72: (iv_ruleTemplateParameterSubstitutionCS= ruleTemplateParameterSubstitutionCS EOF )\n // InternalMyDsl.g:9711:2: iv_ruleTemplateParameterSubstitutionCS= ruleTemplateParameterSubstitutionCS EOF\n {\n if ( state.backtracking==0 ) {\n newCompositeNode(grammarAccess.getTemplateParameterSubstitutionCSRule()); \n }\n pushFollow(FOLLOW_1);\n iv_ruleTemplateParameterSubstitutionCS=ruleTemplateParameterSubstitutionCS();\n\n state._fsp--;\n if (state.failed) return current;\n if ( state.backtracking==0 ) {\n current =iv_ruleTemplateParameterSubstitutionCS; \n }\n match(input,EOF,FOLLOW_2); if (state.failed) return current;\n\n }\n\n }\n\n catch (RecognitionException re) {\n recover(input,re);\n appendSkippedTokens();\n }\n finally {\n }\n return current;\n }", "@Override\n public void setTplPath(String arg0) {\n\n }", "public void addAuxClass(IJavaClassFile newAuxClass);", "public void _testCreateGroovyClass2GenericSuper() throws Exception {\n \t\tIPackageFragment pack1= fSourceFolder.createPackageFragment(\"test1\", false, null);\n \n \t\tNewClassWizardPage wizardPage= new NewClassWizardPage();\n \t\twizardPage.setPackageFragmentRoot(fSourceFolder, true);\n \t\twizardPage.setPackageFragment(pack1, true);\n \t\twizardPage.setEnclosingTypeSelection(false, true);\n \t\twizardPage.setTypeName(\"E\", true);\n \n \t\twizardPage.setSuperClass(\"java.util.ArrayList<String>\", true);\n \n \t\tList<String> interfaces= new ArrayList<String>();\n \t\twizardPage.setSuperInterfaces(interfaces, true);\n \n \t\twizardPage.setMethodStubSelection(false, false, false, true);\n \t\twizardPage.setAddComments(true, true);\n \t\twizardPage.enableCommentControl(true);\n \n \t\twizardPage.createType(null);\n \n \t\tString actual= wizardPage.getCreatedType().getCompilationUnit().getSource();\n \n \t\tStringBuffer buf= new StringBuffer();\n \t\tbuf.append(\"/**\\n\");\n \t\tbuf.append(\" * File\\n\");\n \t\tbuf.append(\" */\\n\");\n \t\tbuf.append(\"package test1;\\n\");\n \t\tbuf.append(\"\\n\");\n \t\tbuf.append(\"import java.util.ArrayList;\\n\");\n \t\tbuf.append(\"\\n\");\n \t\tbuf.append(\"/**\\n\");\n \t\tbuf.append(\" * Type\\n\");\n \t\tbuf.append(\" */\\n\");\n \t\tbuf.append(\"class E extends ArrayList<String> {\\n\");\n \t\tbuf.append(\" /* class body */\\n\");\n \t\tbuf.append(\"}\\n\");\n \t\tString expected= buf.toString();\n \n assertEqualLines(expected, actual);\n \t}", "public interface Template {\n\n}", "public interface TemplateCompiler {\r\n \r\n /**\r\n * Compiles template into specified outputStream.\r\n * \r\n * @param t\r\n * @param context\r\n * @param out\r\n * @throws XMLStreamException\r\n */\r\n public void compile(Template t, TemplateModel model, OutputStream out) throws TemplateCompileException;\r\n\r\n /**\r\n * Compiles template into specified reader.\r\n * Compile method which takes OutputStream is preferrable to this one.\r\n * \r\n * @param t\r\n * @param context\r\n * @param out\r\n * @throws XMLStreamException\r\n */\r\n public void compile(Template t, TemplateModel model, Writer out) throws TemplateCompileException;\r\n\r\n /**\r\n * Compiles template into specified xml Result.\r\n * \r\n * @param t\r\n * @param context\r\n * @param out\r\n * @throws XMLStreamException\r\n */\r\n public void compile(Template t, TemplateModel model, XmlResult out) throws TemplateCompileException;\r\n \r\n}", "protected String replaceMacros(String sTemplate, Object source)\n {\n String sRet = sTemplate;\n Set setMacros = Reporter.getMacros(sTemplate);\n\n for (Iterator i = setMacros.iterator(); i.hasNext();)\n {\n String sId = (String) i.next();\n ReportColumnView columnView = (ReportColumnView) m_mapColumns.get(sId);\n Object oValue = columnView.getOutputString(source);\n if (columnView != null && oValue != null)\n {\n sRet = sRet.replaceAll(MACRO_START + sId + MACRO_STOP,\n oValue.toString());\n }\n }\n return sRet;\n }", "public void compile(Template t, TemplateModel model, XmlResult out) throws TemplateCompileException;", "public void process(byte[] inputClass) throws IOException {\n\t\tClassNode classNode = BytecodeUtils.getClassNode(inputClass);\n\t\t// TODO: address innerclasses, classNode.innerClasses, could these even be found from class files? they would be different files...\n\t\tif(classNode.invisibleAnnotations != null){\n\t\t\tfor(Object annotationObject : classNode.invisibleAnnotations){\n\t\t\t\tAnnotationNode annotationNode = (AnnotationNode) annotationObject;\n\t\t\t\tJREFAnnotationIdentifier checker = new JREFAnnotationIdentifier();\n\t\t\t\tchecker.visitAnnotation(annotationNode.desc, false);\n\t\t\t\tif(checker.isJREFAnnotation()){\n\t\t\t\t\tString qualifiedClassName = classNode.name + \".class\";\n\t\t\t\t\tif(checker.isDefineTypeAnnotation()){\n\t\t\t\t\t\tif(runtimeModifications.getJarEntrySet().contains(qualifiedClassName)){\n\t\t\t\t\t\t\truntimeModifications.add(qualifiedClassName, inputClass, true);\n//\t\t\t\t\t\t\tLog.info(\"Replaced: \" + qualifiedClassName + \" in \" + runtimeModifications.getJarFile().getName());\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\truntimeModifications.add(qualifiedClassName, inputClass, false);\n//\t\t\t\t\t\t\tLog.info(\"Inserted: \" + qualifiedClassName + \" into \" + runtimeModifications.getJarFile().getName());\n\t\t\t\t\t\t}\n\t\t\t\t\t} else if(checker.isMergeTypeAnnotation()){\n\t\t\t\t\t\tString qualifiedParentClassName = classNode.superName + \".class\";\n\t\t\t\t\t\tbyte[] baseClass = runtimeModifications.extractEntry(qualifiedParentClassName);\n\t\t\t\t\t\tbyte[] mergedClass = mergeClasses(baseClass, inputClass);\n\t\t\t\t\t\truntimeModifications.add(qualifiedParentClassName, mergedClass, true);\n\t\t\t\t\t\t// TODO: clean up outputClass somehow, probably need to make a local temp\n\t\t\t\t\t\t// directory which gets deleted at the end of the build\n//\t\t\t\t\t\tLog.info(\"Merged: \" + qualifiedClassName + \" into \" + qualifiedParentClassName + \" in \" + runtimeModifications.getJarFile().getName());\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "protected String formatTemplate(String template, FaxJob faxJob) {\n return SpiUtil.formatTemplate(template, faxJob, null, true, false);\n }", "private void initStdClasses() {\n initStdClass(\"template\", \"Template\");\n initStdClass(\"stylesheet\", \"Stylesheet\");\n initStdClass(\"transform\", \"Stylesheet\");\n initStdClass(\"text\", \"Text\");\n initStdClass(\"if\", \"If\");\n initStdClass(\"choose\", \"Choose\");\n initStdClass(\"when\", \"When\");\n initStdClass(\"otherwise\", \"Otherwise\");\n initStdClass(\"for-each\", \"ForEach\");\n initStdClass(\"message\", \"Message\");\n initStdClass(\"number\", \"Number\");\n initStdClass(\"comment\", \"Comment\");\n initStdClass(\"copy\", \"Copy\");\n initStdClass(\"copy-of\", \"CopyOf\");\n initStdClass(\"param\", \"Param\");\n initStdClass(\"with-param\", \"WithParam\");\n initStdClass(\"variable\", \"Variable\");\n initStdClass(\"output\", \"Output\");\n initStdClass(\"sort\", \"Sort\");\n initStdClass(\"key\", \"Key\");\n initStdClass(\"fallback\", \"Fallback\");\n initStdClass(\"attribute\", \"XslAttribute\");\n initStdClass(\"attribute-set\", \"AttributeSet\");\n initStdClass(\"value-of\", \"ValueOf\");\n initStdClass(\"element\", \"XslElement\");\n initStdClass(\"call-template\", \"CallTemplate\");\n initStdClass(\"apply-templates\", \"ApplyTemplates\");\n initStdClass(\"apply-imports\", \"ApplyImports\");\n initStdClass(\"decimal-format\", \"DecimalFormatting\");\n initStdClass(\"import\", \"Import\");\n initStdClass(\"include\", \"Include\");\n initStdClass(\"strip-space\", \"Whitespace\");\n initStdClass(\"preserve-space\", \"Whitespace\");\n initStdClass(\"processing-instruction\", \"ProcessingInstruction\");\n initStdClass(\"namespace-alias\", \"NamespaceAlias\");\n }", "public ProcessingResult processHtmlAndJava(String htmlFragment, String... javaFragments) throws Exception {\n \t\tcompiler = new JavaSourceCompiler();\r\n \r\n Object fixture = null;\r\n \r\n for (String javaFragment : javaFragments) {\r\n \tfixture = compile(javaFragment);\t\r\n\t\t}\r\n \r\n return process(htmlFragment, fixture);\r\n }", "public void run() throws Exception {\n\t\tJavaCompiler compiler = ToolProvider.getSystemJavaCompiler();\n\t\tStandardJavaFileManager fileManager = compiler.getStandardFileManager(null, null, null);\n\t\tPath tempFolder = Files.createTempDirectory(\"gwt-jackson-apt-tmp\", new FileAttribute[0]);\n\t\tfileManager.setLocation(StandardLocation.CLASS_OUTPUT, Arrays.asList(tempFolder.toFile()));\n\t\tfileManager.setLocation(StandardLocation.SOURCE_OUTPUT, Arrays.asList(tempFolder.toFile()));\n\t\tCompilationTask task = compiler.getTask(\n\t\t\t\tnew PrintWriter(System.out), \n\t\t\t\tfileManager, \n\t\t\t\tnull, \n\t\t\t\tnull, \n\t\t\t\tnull, \n\t\t\t\tfileManager.getJavaFileObjects(\n\t\t\t\t\t\tnew File(\"src/test/java/org/dominokit/jacksonapt/processor/PolymorphicTest.java\"),\n\t\t\t\t\t\tnew File(\"src/test/java/org/dominokit/jacksonapt/processor/PolymorphicBaseInterface.java\"),\n\t\t\t\t\t\tnew File(\"src/test/java/org/dominokit/jacksonapt/processor/PolymorphicBaseClass.java\"),\n\t\t\t\t\t\tnew File(\"src/test/java/org/dominokit/jacksonapt/processor/PolymorphicChildClass.java\"),\n\t\t\t\t\t\tnew File(\"src/test/java/org/dominokit/jacksonapt/processor/PolymorphicChildClass2.java\"),\n\t\t\t\t\t\tnew File(\"src/test/java/org/dominokit/jacksonapt/processor/SecondPolymorphicBaseClass.java\"),\n\t\t\t\t\t\tnew File(\"src/test/java/org/dominokit/jacksonapt/processor/SecondPolymorphicChildClass.java\"),\n\t\t\t\t\t\tnew File(\"src/test/java/org/dominokit/jacksonapt/processor/SimpleGenericBeanObject.java\"),\n\t\t\t\t\t\tnew File(\"src/test/java/org/dominokit/jacksonapt/processor/PolymorphicGenericClass.java\")));\n\n\n\t\ttask.setProcessors(Arrays.asList(new ObjectMapperProcessor()));\n\t\ttask.call();\n\t}", "public void compile(Template t, TemplateModel model, Writer out) throws TemplateCompileException;", "@Converted(kind = Converted.Kind.AUTO,\n source = \"${LLVM_SRC}/llvm/tools/clang/include/clang/AST/DeclTemplate.h\", line = 2755,\n FQN=\"clang::VarTemplateDecl::Common::~Common\", NM=\"_ZN5clang15VarTemplateDecl6CommonD0Ev\",\n cmd=\"jclank.sh -java-options=${SPUTNIK}/modules/org.clang.ast/llvmToClangType ${LLVM_SRC}/llvm/tools/clang/lib/AST/DeclTemplate.cpp -nm=_ZN5clang15VarTemplateDecl6CommonD0Ev\")\n //</editor-fold>\n public /*inline*/ void $destroy() {\n //START JDestroy\n PartialSpecializations.$destroy();\n Specializations.$destroy();\n super.$destroy();\n //END JDestroy\n }", "private Map<String, Entity> parseJavaClasses(List<Path> classFiles) {\r\n logger.trace(\"parseJavaClass\");\r\n\r\n // Instantiate walker and listener\r\n ParseTreeWalker walker = new ParseTreeWalker();\r\n Java8CustomListener listener = new Java8CustomListener();\r\n\r\n classFiles.forEach(path -> {\r\n logger.trace(\"========== Parse: \" + path.toFile().getName() + \" ==========\");\r\n\r\n try {\r\n ParseTree tree = getTree(path);\r\n\r\n // walk through class\r\n walker.walk(listener, tree);\r\n } catch (IOException e) {\r\n logger.error(\"Error while reading creating tree for: {}\", path, e);\r\n }\r\n });\r\n\r\n return listener.getEntityMap();\r\n }", "@Override\n protected void performRefactoringIteration(UsagesInFile usagesInFile) {\n Collection<UsageInfo> usages1 = usagesInFile.getUsages();\n ArrayList<MigrationUsageInfo> usages = Lists.newArrayList(Iterables.filter(usages1, MigrationUsageInfo.class));\n usages.sort(ImportUsageFirstComparator.INSTANCE);\n\n for (MigrationMapEntry entry : migrationMap.values()) {\n FlexMigrationUtil.doClassMigration(myProject, entry, usages);\n }\n }", "public boolean processTemplateFile( String templateFile )\r\n {\r\n if( templateFile.length() == 0 ) return false;\r\n try {\r\n ArrayList<Template> lijst = templateParser.parseFile(templateFile); \r\n if( lijst != null ) templates.addAll(lijst);\r\n else return false;\r\n }catch( ParserConfigurationException e ) {\r\n e.printStackTrace();\r\n return false;\r\n // TODO: Handle exception\r\n }catch( SAXException e ) {\r\n e.printStackTrace();\r\n return false;\r\n // TODO: Handle exception\r\n }catch( IOException e ) {\r\n e.printStackTrace();\r\n return false;\r\n // TODO: Handle exception\r\n }\r\n return true;\r\n }", "private static void showJava(String string) { TODO Auto-generated method stub\n\t//\n\t\n}", "public void compile(Template t, TemplateModel model, OutputStream out) throws TemplateCompileException;", "public void addTemplate(String template) {\r\n\t\tthis.templates.add(template);\r\n\t}", "default void refactoring() {\n templateBuilder.set(new StringBuilder());\n }", "@Test\n public void testSingleParamTemplate() {\n assertEquals(\"{\\\"param\\\":\\\"value\\\"}\", util.fillTemplate(\"test.template.singleparam\", \"value\", \"value1\", null));\n }", "private Path compileTestClass(\n String packageName, String classname, String classSource, Path destinationDir)\n throws FileCompiler.FileCompilerException {\n // TODO: The use of FileCompiler is temporary. Should be replaced by use of SequenceCompiler,\n // which will compile from source, once it is able to write the class file to disk.\n Path sourceFile;\n try {\n sourceFile = javaFileWriter.writeClassCode(packageName, classname, classSource);\n } catch (RandoopOutputException e) {\n throw new RandoopBug(\"Output error during flaky-test filtering\", e);\n }\n FileCompiler fileCompiler = new FileCompiler();\n fileCompiler.compile(sourceFile, destinationDir);\n return sourceFile;\n }", "public static String transformTemplateToOntology(String templateToTransform, boolean capitalize) {\n\n String transformedTemplate = templateToTransform;\n\n // transform into ontology\n transformedTemplate = transformedTemplate.replace(\"/resource/Template:\", \"/ontology/\");\n\n // remove infobox information\n transformedTemplate = transformedTemplate.replace(\"infobox_\", \"\");\n transformedTemplate = transformedTemplate.replace(\"_infobox\", \"\");\n transformedTemplate = transformedTemplate.replace(\"Infobox_\", \"\");\n transformedTemplate = transformedTemplate.replace(\"_Infobox\", \"\");\n\n // transform first character of class name to uppercase\n if(capitalize) {\n transformedTemplate = transformedTemplate.substring(0, transformedTemplate.indexOf(\"/ontology/\") + 10)\n + transformedTemplate.substring(transformedTemplate.indexOf(\"/ontology/\") + 10).substring(0, 1).toUpperCase()\n + transformedTemplate.substring(transformedTemplate.indexOf(\"/ontology/\") + 10).substring(1);\n } else {\n transformedTemplate = transformedTemplate.substring(0, transformedTemplate.indexOf(\"/ontology/\") + 10)\n + transformedTemplate.substring(transformedTemplate.indexOf(\"/ontology/\") + 10).substring(0, 1).toLowerCase()\n + transformedTemplate.substring(transformedTemplate.indexOf(\"/ontology/\") + 10).substring(1);\n }\n return transformedTemplate;\n }", "public Function2<Object, TemplateOptions, String> template(String templateString);", "public static void main(String[] args)\n {\n ScanReplace scanRep;\n String configFile = \"\";\n String startDir = \"\";\n\n if (args.length > 1)\n {\n configFile = args[0];\n startDir = args[1];\n\n if (args.length > 2 && !args[2].contains(\">\"))\n {\n if (args[2].equalsIgnoreCase(\"replace\"))\n {\n doReplace = true;\n }\n }\n }\n else\n {\n System.out.println(\"Syntax: java -jar CodeScanner.jar <config file> <start dir> [replace] [> <outputfile.csv>]\");\n }\n\n scanRep = new ScanReplace(configFile,startDir);\n }", "private String readAndReplaceString(String fileName, String packageName, String className) {\n String baseFilePath = \"com.bgn.baseframe.base\";\n\n String time = new SimpleDateFormat(\"yyyy-MM-dd HH:mm\").format(new Date());\n String path = (codeType == 0 ? \"kotlin/\" : \"java/\");\n return readFile(path + fileName + \".txt\")\n .replace(\"&time&\", time)\n .replace(\"&package&\", packageName)\n .replace(\"&mvp&\", baseFilePath)\n .replace(\"&className&\", className);\n }", "void compileClass() throws IOException {\n tagBracketPrinter(CLASS_TAG, OPEN_TAG_BRACKET);\n try {\n compileClassHelper();\n } catch (IOException e) {\n e.printStackTrace();\n }\n tagBracketPrinter(CLASS_TAG, CLOSE_TAG_BRACKET);\n\n }", "@Converted(kind = Converted.Kind.AUTO,\n source = \"${LLVM_SRC}/llvm/tools/clang/include/clang/AST/DeclTemplate.h\", line = 2749,\n FQN=\"clang::VarTemplateDecl::~VarTemplateDecl\", NM=\"_ZN5clang15VarTemplateDeclD0Ev\",\n cmd=\"jclank.sh -java-options=${SPUTNIK}/modules/org.clang.ast/llvmToClangType ${LLVM_SRC}/llvm/tools/clang/lib/AST/DeclTemplate.cpp -nm=_ZN5clang15VarTemplateDeclD0Ev\")\n //</editor-fold>\n @Override public /*inline*/ void $destroy() {\n super.$destroy();\n }", "public void setTemplate(JdbcTemplate template) {\n\t\tthis.template = template;\n\t}", "public abstract void setTemplDesc(String templDesc);", "public static boolean isJavaSourceFile(String f) {\n\t\tString ext = FilenameUtils.getExtension(f);\n\t\tif (ext.endsWith(\"java\")) {\n\t\t\treturn true;\n\t\t} else {\n\t\t\treturn false;\n\t\t}\n\t}", "public void setClass_(String newValue);", "static void init() {\n ReplaceRule.define(\"endcomment\",\r\n new Regex(\"\\\\*/\",\"*/${POP}</font>\"));\r\n Comment3 = (new Regex(\"/\\\\*\",\"<font color=\"+\r\n CommentColor+\">/*${+endcomment}\"));\r\n\r\n // Jasmine stuff\r\n Regex.define(\"JasmineEnabled\",\"\",new Validator() {\r\n public int validate(String src,int begin,int end) {\r\n return jasmine_enabled ? end : -1;\r\n }\r\n });\r\n colorize.add(\r\n \"s{(??JasmineEnabled)^\\\\s*;\\\\s*&gt;&gt;.*}\"+\r\n \"{<HR><H3>$&</H3>}\");\r\n colorize.add(\r\n \"s{(??JasmineEnabled)(?:^|\\\\s)\\\\s*;.*}\"+\r\n \"{<font color=\"+CommentColor+\">$&</font>}\");\r\n colorize.add(\r\n \"s{(??JasmineEnabled)\\\\b(?:catch|class|end|field|\"+\r\n \"implements|interface|limit|line|method|source|super|\"+\r\n \"throws|var|stack|locals)\\\\b}{<font color=\"+\r\n DirectiveColor+\"><b>$&</b></font>}\");\r\n colorize.add(\r\n \"s{(??JasmineEnabled)^\\\\w+:}{<font color=\"+\r\n LabelColor+\"><b>$&</b></font>}\");\r\n\r\n // stick all replacement rules into the Transformer\r\n colorize.add(DQuotes);\r\n colorize.add(SQuotes);\r\n colorize.add(Comment1);\r\n colorize.add(Comment2);\r\n colorize.add(Comment3);\r\n colorize.add(PrimitiveTypes);\r\n colorize.add(Keywords);\r\n colorize.add(java_lang);\r\n colorize.add(oper);\r\n colorize.add(Regex.perlCode(\r\n \"s'\\\\w*(Error|Exception|Throwable)\\\\b'<font color=red>$&</font>'\"));\r\n\r\n ReplaceRule.define(\"colorize\",colorize);\r\n\r\n ReplaceRule.define(\"jascode\",new ReplaceRule() {\r\n public void apply(StringBufferLike sb,RegRes rr) {\r\n String s1 = rr.stringMatched(1);\r\n if(s1 != null && s1.equals(\"jas\"))\r\n jasmine_enabled = true;\r\n }\r\n });\r\n\r\n Regex r = new Regex(\"(?i)<(java|jas)code([^>]*?)>\\\\s*\",\r\n \"<!-- made by java2html, \"+\r\n \"see http://javaregex.com -->\"+\r\n \"<table $2 ><tr><td bgcolor=\"+\r\n DocumentBackgroundColor+\r\n \"><pre>${jascode}${+colorize}\");\r\n r.optimize();\r\n\r\n colorize.add(new Regex(\"(?i)\\\\s*</(?:java|jas)code>\",\r\n \"</pre></td></tr></table>${POP}\"));\r\n\r\n html_replacer = r.getReplacer();\r\n\r\n Transformer DoPre = new Transformer(true);\r\n DoPre.add(\"s'(?i)\\\\s*</(?:jav|jas)acode>'$&$POP'\");\r\n DoPre.add(\"s'<'&lt;'\");\r\n DoPre.add(\"s'>'&gt;'\");\r\n DoPre.add(\"s'&'&amp;'\");\r\n ReplaceRule.define(\"DOPRE\",DoPre);\r\n pretran_html = new Regex(\"(?i)<javacode[^>]*>\",\"$&${+DOPRE}\").getReplacer();\r\n pretran_java = DoPre.getReplacer();\r\n }", "void setTemplate(ITemplateKey key, Template template);", "private static boolean writeAndCompile(String className, String implement, String header, String expression) {\n\n\t\t// build the class\n\t\tString classData = String.format(classBase, className, implement, header, expression);\n\t\tString classFileName = className + \".java\";\n\n\t\t// write the .java file\n\t\ttry (PrintWriter out = new PrintWriter(path + classFileName)) {\n\t\t\tout.println(classData);\n\t\t} catch (FileNotFoundException e) {\n\t\t\te.printStackTrace();\n\t\t\treturn false;\n\t\t}\n\n\t\t// compile the file\n\t\tJavaCompiler compiler = ToolProvider.getSystemJavaCompiler();\n\t\tint result;\n\n\t\tif (compiler == null) {\n\t\t\tSystem.out.println(\"No Compiler! Trying external tools..\");\n\n\t\t\ttry {\n\t\t\t\tcom.sun.tools.javac.Main javac = new com.sun.tools.javac.Main();\n\t\t\t\tresult = javac.compile(new String[] {path + classFileName});\n\t\t\t} catch (NoClassDefFoundError e) {\n\t\t\t\tSystem.out.println(\"No external tools found!\");\n\t\t\t\treturn false;\n\t\t\t}\n\n\t\t\t//return false;\n\t\t} else\n\t\t\tresult = compiler.run(null, null, null, path + classFileName);\n\n\t\t// delete the .java file, just because\n\t\ttry {\n\t\t\tnew File(path + classFileName).delete();\n\n\t\t// meh, we tried\n\t\t} catch (Exception e) {}\n\n\t\t// if result is 0, compilation was successful\n\t\treturn result == 0;\n\t}", "public void saveTemplate(String filename){\n Context context = App.getContext();\n LogManager.reportStatus(context, \"INSPECTOR\", \"savingTemplate\");\n blueprint = currentTemplate.createBlueprint();\n //make sure we have correct extension\n filename = FileManager.removeExtension(filename);\n if (isInspecting){\n filename = filename + \".in\";\n } else {\n filename = filename + \".bp\";\n }\n boolean hasSaved = FileManager.createTemplate(filename, blueprint);\n if (hasSaved){\n Toast.makeText(this, \"Saved\", Toast.LENGTH_LONG).show();\n }else{\n Toast.makeText(this, \"Did not save\", Toast.LENGTH_LONG).show();\n }\n }", "private void findTemplatesTree(File aCartridgeCP) throws Exception {\n\t\tClass<?> registerTemplatesClz = this.findRegisterTemplatesClass(aCartridgeCP);\n\n\t\tObject obj = registerTemplatesClz.newInstance();\n\t\tTemplatesTree templateTree = new TemplatesTreeCloner().clone(obj);\n\n\t\tif (templateTree != null) {\n\t\t\tTemplatesStore.getInstance().add(aCartridgeCP, registerTemplatesClz, templateTree);\n\t\t}\n\t}", "private String javaFileToPackageDotClass(File java)\n\t{\n\t\tStringBuilder bob = new StringBuilder();\n\t\tbob.append(java.getParentFile().getName());\n\t\tbob.append('.');\n\t\tbob.append(java.getName().subSequence(0, java.getName().lastIndexOf('.')));\n\t\treturn bob.toString();\n\t}", "public void setTemplate(HibernateTemplate template) {\n\t\tthis.template = template;\n\t}", "@Override\n public void setTemplateArgumentTypes(List<Type> argsTypes) {\n // System.out.println(\"ARRIVED AT TEMPLATE ARGS\");\n // System.out.println(\n // \"SETTING TYPES:\" + argsTypes.stream().map(Type::getCode).collect(Collectors.joining(\"\\n\")));\n // System.out.println(\"ARGS BEFORE:\" + getTemplateArgumentStrings(null));\n setInPlace(TEMPLATE_ARGUMENTS, argsTypes.stream()\n .map(TemplateArgumentType::new)\n .collect(Collectors.toList()));\n // System.out.println(\"ARGS AFTER:\" + getTemplateArgumentStrings(null));\n // setTemplateArgumentTypes(argsTypes, true);\n\n hasUpdatedArgumentTypes = true;\n }", "private Template() {\r\n\r\n }", "@Override\n\tpublic Void visit(ClassDef classDef) {\n\t\tprintIndent(\"class\");\n\t\tindent++;\n\t\tclassDef.self_type.accept(this);\n\t\tclassDef.base_type.accept(this);\n\t\tfor (var v : classDef.body)\n\t\t\tv.accept(this);\n\t\tindent--;\n\t\treturn null;\n\t}", "@Test\n public void testTemplate(){\n }", "public String change_template(Map<String, String> variables) {\n current_template_index = PrayerTemplates.get_next_template(my_prayer_part_type, current_template_index);\r\n int template_size = PrayerTemplates.get_template_size(my_prayer_part_type);\r\n my_prayer_part_text = PrayerTemplates.get_template_text(my_prayer_part_type, current_template_index);\r\n\r\n // step #2 - plug variables into new template\r\n Iterator it = variables.entrySet().iterator();\r\n while (it.hasNext()) {\r\n Map.Entry pair = (Map.Entry) it.next();\r\n substitute(pair.getKey().toString(), pair.getValue().toString());\r\n }\r\n\r\n return String.valueOf(current_template_index + 1) + \"/\" + String.valueOf(template_size);\r\n }", "private static byte[] instrumentClassFile(byte[] classfileBuffer) {\n String className = new ClassReader(classfileBuffer).getClassName().replace(\"/\", \".\");\n ClassLoader currentClassLoader = Thread.currentThread().getContextClassLoader();\n byte[] newClassfileBuffer = new EkstaziCFT().transform(currentClassLoader, className, null, null, classfileBuffer);\n return newClassfileBuffer;\n }", "public abstract String mapSingleClass(String classToMap);", "public Entry(@NotNull SkriptPattern pattern, @NotNull Class<?> clazz) {\n this.names = pattern.unrollFully();\n this.clazz = clazz;\n }", "public void setTemplateName(java.lang.Object templateName) {\n this.templateName = templateName;\n }", "public abstract Method createDefaultCaseMethod(IClassDefinition cdef);", "private static void generateHECodeFromTemplate(ParsingResult parsingResult, String targetFile, String serviceName, String tomcatDir) {\r\n\t\tList<String> variables = parsingResult.getVariablesList();\r\n \tList<String> functionCodeLines = parsingResult.getGeneratedCode();\r\n \tMap<String, String> constants = parsingResult.getConstantsList();\r\n \tString functionCode = String.join(\"\\n\", functionCodeLines);\r\n\t\t\r\n\t\tClassLoader loader = ServiceGenerator.class.getClassLoader();\r\n\t\tHELibPredictor predictor = (HELibPredictor) parsingResult.getPredictor();\r\n\t\tURL codeTemplateUrl = loader.getResource(Constants.HE_SERVICE_TEMPLATE_FOLDER + Constants.HE_SERVICE_TEMPLATE_FILE_NAME);\r\n\r\n\t\t\r\n\t\tSTGroup impl = new STGroupFile(codeTemplateUrl, \"UTF-8\", '$', '$');\r\n\t\tST st = impl.getInstanceOf(\"service\");\r\n\t\tst.add(\"variables\", variables);\r\n\t\tst.add(\"functionCode\", functionCode);\r\n\t\tst.add(\"constantsMap\", constants);\r\n\t\tst.add(\"levelThreshold\", predictor.getLevelThreshold());\r\n\t\t\r\n\t\t/*\r\n\t\t * The key files are stored at a central place available for all services because they are quite big\r\n\t\t * */\r\n\t\t//String pathToContextFile = Utils.appendTrailingSlash(Constants.CRYPTO_GLBOAL_FOLDER);\r\n\t\t//String pathToPubKeyFile = Utils.appendTrailingSlash(Constants.CRYPTO_GLBOAL_FOLDER);\r\n\t\tString pathToContextFile = \"/app/crypto/\";//\"/mnt/hgfs/Workspace/cppPlayground/he_context_creator/\";\r\n\t\tString pathToPubKeyFile = \"/app/crypto/\"; //\"/mnt/hgfs/Workspace/cppPlayground/he_context_creator/\";\r\n\t\t\r\n\t\tif(predictor.needsBootstrapping()) {\r\n\t\t\tpathToPubKeyFile += Constants.CRYPTO_BOOTSTRAPPING_PUBLIC_KEY_FILE_NAME;\r\n\t\t\tpathToContextFile += Constants.CRYPTO_BOOTSTRAPPING_CONTEXT_FILE_NAME;\r\n\t\t}\r\n\t\telse {\r\n\t\t\tpathToPubKeyFile += Constants.CRYPTO_PUBLIC_KEY_FILE_NAME;\r\n\t\t\tpathToContextFile += Constants.CRYPTO_CONTEXT_FILE_NAME;\r\n\t\t}\r\n\t\t \t\t\r\n\t\tst.add(\"path_to_context_file\", pathToContextFile);\r\n\t\tst.add(\"path_to_public_key\", pathToPubKeyFile);\r\n\r\n\t\t\r\n\t\tString result = st.render();\r\n\t\t\r\n\t\tUtils.writeToFile(result, targetFile);\r\n\t}", "public Template(File f) throws IOException, TemplateException, JDOMException {\n super(f, new ScriptEngineDataModel(new ScriptEngineManager().getEngineByName(\"javascript\")));\n }", "public void InitFileHandles(String classname) {\n\t\t\tString fileName = classname;\n\t\t\tClassInfo currentClass = MetaDataInfoMaps.getClass(fileName);\n\t\t\tif (fileName.contains(\"$\")) {\n\t\t\t\tfileName = fileName.substring(0, fileName.indexOf(\"$\"));\n\t\t\t}\n\t\t\tfileName += \".java\";\n\t\t\tfinal ClassContext ctxt = Instrumentor.classContext.get(currentClass);\n\t\t\tctxt.setFileName(fileName);\n }", "public void setTemplateExtension(List<String> templateExtension) {\n\t\tthis.tplExtension = templateExtension;\n\t}" ]
[ "0.574093", "0.5539453", "0.54765224", "0.546341", "0.5293629", "0.51840043", "0.5143989", "0.509203", "0.50595766", "0.50529927", "0.5041583", "0.50002867", "0.49885508", "0.4973584", "0.49413133", "0.49400112", "0.48266268", "0.4811856", "0.48045245", "0.47741157", "0.477196", "0.47678664", "0.47522652", "0.47387195", "0.47279182", "0.4684052", "0.46536985", "0.4623994", "0.4617439", "0.4616203", "0.45693028", "0.45361462", "0.45289803", "0.45084226", "0.45007002", "0.44734934", "0.44731292", "0.44731107", "0.44625825", "0.4458656", "0.44524983", "0.4436834", "0.44301268", "0.44274476", "0.44187874", "0.44186884", "0.44183958", "0.4412811", "0.4409605", "0.44067", "0.4404973", "0.44033483", "0.43992984", "0.43891755", "0.43816411", "0.43765116", "0.43716997", "0.4364933", "0.4364109", "0.43604922", "0.43481806", "0.43416393", "0.43276137", "0.43212068", "0.43066168", "0.43063757", "0.43051943", "0.43046278", "0.43018773", "0.42879075", "0.42759725", "0.42737216", "0.42694175", "0.42642543", "0.4262262", "0.42610747", "0.42595318", "0.42593032", "0.42574003", "0.42526734", "0.42455968", "0.42347798", "0.42329738", "0.4232098", "0.42199895", "0.42183977", "0.42131546", "0.4211831", "0.42111966", "0.42110142", "0.42102867", "0.420943", "0.42048153", "0.4204748", "0.42015886", "0.42012113", "0.4199353", "0.41992906", "0.41968203", "0.41931075" ]
0.54304534
4
Write a Java program to search an element in a array list
public static void main(String[] args) { List<String> listOfStrings= new ArrayList<>(); listOfStrings.add("Jeden"); listOfStrings.add("Dwa"); listOfStrings.add("Trzy"); listOfStrings.add("Cztery"); listOfStrings.add("Piec"); boolean contains=listOfStrings.contains("Jeden"); boolean notContains=listOfStrings.contains("Szesc"); System.out.println(contains); System.out.println(notContains); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private static void search(int arr[],int element)\n {\n for(int i=0;i<arr.length;i++)\n {\n if(arr[i]==element)\n {\n System.out.println(\"The \"+element+\" is located at the position of \"+i);\n System.exit(0);\n }\n }\n }", "private void arraySearch(MyArrayList myArrayList, Results results, int value) {\r\n if(myArrayList.search(value)) { \r\n results.storeNewResult(\"ArraySearch test case: PASSED\");\r\n }\r\n else { \r\n results.storeNewResult(\"ArraySearch test case: FAILED\");\r\n }\r\n }", "private void search(String[] searchItem)\n {\n }", "@Test\r\n\tvoid testSearch() {\r\n\t\tSimpleList test = new SimpleList();\r\n\t\ttest.add(7);\r\n\t\ttest.add(10);\r\n\t\ttest.add(9);\r\n\t\tint output = test.search(10);\r\n\t\tassertEquals(1, output);\r\n\t}", "public static void Search(ArrayList<Integer> list, int val)\n{\n // Your code here\n int result = -1;\n for(int i=0; i<list.size(); i++)\n {\n if(list.get(i) == val)\n {\n result = i;\n break;\n }\n }\n System.out.print(result + \" \");\n \n}", "private boolean contains(List<NodeId> array, NodeId searchValue) {\n return array != null && array.contains(searchValue);\n }", "String printListSearch(String searchString);", "public List search(Veranstaltung veranstatung) throws RuntimeException;", "@In String search();", "private static int search(String item, ListArrayBasedGeneric<Runway> runwayList)\r\n\t{\r\n\t\tint size = runwayList.size();\r\n\t\tString itemFromList = \"\";\r\n\r\n\t\tfor(int i = 0; i < size; i++)\r\n\t\t{\r\n\t\t\titemFromList = runwayList.get(i).getRunwayName();\r\n\r\n\t\t\tif(itemFromList.compareToIgnoreCase(item) == 0)\r\n\t\t\t{\r\n\t\t\t\treturn i;\r\n\t\t\t} // END IF\r\n\t\t} // END FOR\r\n\r\n\t\treturn -1;\r\n\t}", "public boolean findElement(int element) {\r\n\tfor(int i = 0 ;i <myList.size();i++) {\r\n\t\tif(element == myList.get(i))\r\n\t\t\treturn true;\r\n\t}\r\n\treturn false;\r\n}", "public int Search(Element e){\n\tint int_ret_val ;\n\tList aux01 ;\n\tElement var_elem ;\n\tboolean var_end ;\n\tint nt ;\n\n\tint_ret_val = 0 ;\n\taux01 = this ;\n\tvar_end = end;\n\tvar_elem = elem ;\n\twhile (!var_end){\n\t if (e.Equal(var_elem)){\n\t\tint_ret_val = 1 ;\n\t }\n\t else nt = 0 ;\n\t aux01 = aux01.GetNext() ;\n\t var_end = aux01.GetEnd();\n\t var_elem = aux01.GetElem();\n\t}\n\treturn int_ret_val ;\n }", "public int Search(Element e){\n\tint int_ret_val ;\n\tList aux01 ;\n\tElement var_elem ;\n\tboolean var_end ;\n\tint nt ;\n\n\tint_ret_val = 0 ;\n\taux01 = this ;\n\tvar_end = end;\n\tvar_elem = elem ;\n\twhile (!var_end){\n\t if (e.Equal(var_elem)){\n\t\tint_ret_val = 1 ;\n\t }\n\t else nt = 0 ;\n\t aux01 = aux01.GetNext() ;\n\t var_end = aux01.GetEnd();\n\t var_elem = aux01.GetElem();\n\t}\n\treturn int_ret_val ;\n }", "public int Search(Element e){\n\tint int_ret_val ;\n\tList aux01 ;\n\tElement var_elem ;\n\tboolean var_end ;\n\tint nt ;\n\n\tint_ret_val = 0 ;\n\taux01 = this ;\n\tvar_end = end;\n\tvar_elem = elem ;\n\twhile (!var_end){\n\t if (e.Equal(var_elem)){\n\t\tint_ret_val = 1 ;\n\t }\n\t else nt = 0 ;\n\t aux01 = aux01.GetNext() ;\n\t var_end = aux01.GetEnd();\n\t var_elem = aux01.GetElem();\n\t}\n\treturn int_ret_val ;\n }", "public int Search(Element e){\n\tint int_ret_val ;\n\tList aux01 ;\n\tElement var_elem ;\n\tboolean var_end ;\n\tint nt ;\n\n\tint_ret_val = 0 ;\n\taux01 = this ;\n\tvar_end = end;\n\tvar_elem = elem ;\n\twhile (!var_end){\n\t if (e.Equal(var_elem)){\n\t\tint_ret_val = 1 ;\n\t }\n\t else nt = 0 ;\n\t aux01 = aux01.GetNext() ;\n\t var_end = aux01.GetEnd();\n\t var_elem = aux01.GetElem();\n\t}\n\treturn int_ret_val ;\n }", "public int Search(Element e){\n\tint int_ret_val ;\n\tList aux01 ;\n\tElement var_elem ;\n\tboolean var_end ;\n\tint nt ;\n\n\tint_ret_val = 0 ;\n\taux01 = this ;\n\tvar_end = end;\n\tvar_elem = elem ;\n\twhile (!var_end){\n\t if (e.Equal(var_elem)){\n\t\tint_ret_val = 1 ;\n\t }\n\t else nt = 0 ;\n\t aux01 = aux01.GetNext() ;\n\t var_end = aux01.GetEnd();\n\t var_elem = aux01.GetElem();\n\t}\n\treturn int_ret_val ;\n }", "public int Search(Element e){\n\tint int_ret_val ;\n\tList aux01 ;\n\tElement var_elem ;\n\tboolean var_end ;\n\tint nt ;\n\n\tint_ret_val = 0 ;\n\taux01 = this ;\n\tvar_end = end;\n\tvar_elem = elem ;\n\twhile (!var_end){\n\t if (e.Equal(var_elem)){\n\t\tint_ret_val = 1 ;\n\t }\n\t else nt = 0 ;\n\t aux01 = aux01.GetNext() ;\n\t var_end = aux01.GetEnd();\n\t var_elem = aux01.GetElem();\n\t}\n\treturn int_ret_val ;\n }", "public int Search(Element e){\n\tint int_ret_val ;\n\tList aux01 ;\n\tElement var_elem ;\n\tboolean var_end ;\n\tint nt ;\n\n\tint_ret_val = 0 ;\n\taux01 = this ;\n\tvar_end = end;\n\tvar_elem = elem ;\n\twhile (!var_end){\n\t if (e.Equal(var_elem)){\n\t\tint_ret_val = 1 ;\n\t }\n\t else nt = 0 ;\n\t aux01 = aux01.GetNext() ;\n\t var_end = aux01.GetEnd();\n\t var_elem = aux01.GetElem();\n\t}\n\treturn int_ret_val ;\n }", "public int Search(Element e){\n\tint int_ret_val ;\n\tList aux01 ;\n\tElement var_elem ;\n\tboolean var_end ;\n\tint nt ;\n\n\tint_ret_val = 0 ;\n\taux01 = this ;\n\tvar_end = end;\n\tvar_elem = elem ;\n\twhile (!var_end){\n\t if (e.Equal(var_elem)){\n\t\tint_ret_val = 1 ;\n\t }\n\t else nt = 0 ;\n\t aux01 = aux01.GetNext() ;\n\t var_end = aux01.GetEnd();\n\t var_elem = aux01.GetElem();\n\t}\n\treturn int_ret_val ;\n }", "public int Search(Element e){\n\tint int_ret_val ;\n\tList aux01 ;\n\tElement var_elem ;\n\tboolean var_end ;\n\tint nt ;\n\n\tint_ret_val = 0 ;\n\taux01 = this ;\n\tvar_end = end;\n\tvar_elem = elem ;\n\twhile (!var_end){\n\t if (e.Equal(var_elem)){\n\t\tint_ret_val = 1 ;\n\t }\n\t else nt = 0 ;\n\t aux01 = aux01.GetNext() ;\n\t var_end = aux01.GetEnd();\n\t var_elem = aux01.GetElem();\n\t}\n\treturn int_ret_val ;\n }", "public int Search(Element e){\n\tint int_ret_val ;\n\tList aux01 ;\n\tElement var_elem ;\n\tboolean var_end ;\n\tint nt ;\n\n\tint_ret_val = 0 ;\n\taux01 = this ;\n\tvar_end = end;\n\tvar_elem = elem ;\n\twhile (!var_end){\n\t if (e.Equal(var_elem)){\n\t\tint_ret_val = 1 ;\n\t }\n\t else nt = 0 ;\n\t aux01 = aux01.GetNext() ;\n\t var_end = aux01.GetEnd();\n\t var_elem = aux01.GetElem();\n\t}\n\treturn int_ret_val ;\n }", "public int Search(Element e){\n\tint int_ret_val ;\n\tList aux01 ;\n\tElement var_elem ;\n\tboolean var_end ;\n\tint nt ;\n\n\tint_ret_val = 0 ;\n\taux01 = this ;\n\tvar_end = end;\n\tvar_elem = elem ;\n\twhile (!var_end){\n\t if (e.Equal(var_elem)){\n\t\tint_ret_val = 1 ;\n\t }\n\t else nt = 0 ;\n\t aux01 = aux01.GetNext() ;\n\t var_end = aux01.GetEnd();\n\t var_elem = aux01.GetElem();\n\t}\n\treturn int_ret_val ;\n }", "public int Search(Element e){\n\tint int_ret_val ;\n\tList aux01 ;\n\tElement var_elem ;\n\tboolean var_end ;\n\tint nt ;\n\n\tint_ret_val = 0 ;\n\taux01 = this ;\n\tvar_end = end;\n\tvar_elem = elem ;\n\twhile (!var_end){\n\t if (e.Equal(var_elem)){\n\t\tint_ret_val = 1 ;\n\t }\n\t else nt = 0 ;\n\t aux01 = aux01.GetNext() ;\n\t var_end = aux01.GetEnd();\n\t var_elem = aux01.GetElem();\n\t}\n\treturn int_ret_val ;\n }", "public int Search(Element e){\n\tint int_ret_val ;\n\tList aux01 ;\n\tElement var_elem ;\n\tboolean var_end ;\n\tint nt ;\n\n\tint_ret_val = 0 ;\n\taux01 = this ;\n\tvar_end = end;\n\tvar_elem = elem ;\n\twhile (!var_end){\n\t if (e.Equal(var_elem)){\n\t\tint_ret_val = 1 ;\n\t }\n\t else nt = 0 ;\n\t aux01 = aux01.GetNext() ;\n\t var_end = aux01.GetEnd();\n\t var_elem = aux01.GetElem();\n\t}\n\treturn int_ret_val ;\n }", "public int Search(Element e){\n\tint int_ret_val ;\n\tList aux01 ;\n\tElement var_elem ;\n\tboolean var_end ;\n\tint nt ;\n\n\tint_ret_val = 0 ;\n\taux01 = this ;\n\tvar_end = end;\n\tvar_elem = elem ;\n\twhile (!var_end){\n\t if (e.Equal(var_elem)){\n\t\tint_ret_val = 1 ;\n\t }\n\t else nt = 0 ;\n\t aux01 = aux01.GetNext() ;\n\t var_end = aux01.GetEnd();\n\t var_elem = aux01.GetElem();\n\t}\n\treturn int_ret_val ;\n }", "public int Search(Element e){\n\tint int_ret_val ;\n\tList aux01 ;\n\tElement var_elem ;\n\tboolean var_end ;\n\tint nt ;\n\n\tint_ret_val = 0 ;\n\taux01 = this ;\n\tvar_end = end;\n\tvar_elem = elem ;\n\twhile (!var_end){\n\t if (e.Equal(var_elem)){\n\t\tint_ret_val = 1 ;\n\t }\n\t else nt = 0 ;\n\t aux01 = aux01.GetNext() ;\n\t var_end = aux01.GetEnd();\n\t var_elem = aux01.GetElem();\n\t}\n\treturn int_ret_val ;\n }", "public int Search(Element e){\n\tint int_ret_val ;\n\tList aux01 ;\n\tElement var_elem ;\n\tboolean var_end ;\n\tint nt ;\n\n\tint_ret_val = 0 ;\n\taux01 = this ;\n\tvar_end = end;\n\tvar_elem = elem ;\n\twhile (!var_end){\n\t if (e.Equal(var_elem)){\n\t\tint_ret_val = 1 ;\n\t }\n\t else nt = 0 ;\n\t aux01 = aux01.GetNext() ;\n\t var_end = aux01.GetEnd();\n\t var_elem = aux01.GetElem();\n\t}\n\treturn int_ret_val ;\n }", "public int Search(Element e){\n\tint int_ret_val ;\n\tList aux01 ;\n\tElement var_elem ;\n\tboolean var_end ;\n\tint nt ;\n\n\tint_ret_val = 0 ;\n\taux01 = this ;\n\tvar_end = end;\n\tvar_elem = elem ;\n\twhile (!var_end){\n\t if (e.Equal(var_elem)){\n\t\tint_ret_val = 1 ;\n\t }\n\t else nt = 0 ;\n\t aux01 = aux01.GetNext() ;\n\t var_end = aux01.GetEnd();\n\t var_elem = aux01.GetElem();\n\t}\n\treturn int_ret_val ;\n }", "public int Search(Element e){\n\tint int_ret_val ;\n\tList aux01 ;\n\tElement var_elem ;\n\tboolean var_end ;\n\tint nt ;\n\n\tint_ret_val = 0 ;\n\taux01 = this ;\n\tvar_end = end;\n\tvar_elem = elem ;\n\twhile (!var_end){\n\t if (e.Equal(var_elem)){\n\t\tint_ret_val = 1 ;\n\t }\n\t else nt = 0 ;\n\t aux01 = aux01.GetNext() ;\n\t var_end = aux01.GetEnd();\n\t var_elem = aux01.GetElem();\n\t}\n\treturn int_ret_val ;\n }", "public int Search(Element e){\n\tint int_ret_val ;\n\tList aux01 ;\n\tElement var_elem ;\n\tboolean var_end ;\n\tint nt ;\n\n\tint_ret_val = 0 ;\n\taux01 = this ;\n\tvar_end = end;\n\tvar_elem = elem ;\n\twhile (!var_end){\n\t if (e.Equal(var_elem)){\n\t\tint_ret_val = 1 ;\n\t }\n\t else nt = 0 ;\n\t aux01 = aux01.GetNext() ;\n\t var_end = aux01.GetEnd();\n\t var_elem = aux01.GetElem();\n\t}\n\treturn int_ret_val ;\n }", "public int Search(Element e){\n\tint int_ret_val ;\n\tList aux01 ;\n\tElement var_elem ;\n\tboolean var_end ;\n\tint nt ;\n\n\tint_ret_val = 0 ;\n\taux01 = this ;\n\tvar_end = end;\n\tvar_elem = elem ;\n\twhile (!var_end){\n\t if (e.Equal(var_elem)){\n\t\tint_ret_val = 1 ;\n\t }\n\t else nt = 0 ;\n\t aux01 = aux01.GetNext() ;\n\t var_end = aux01.GetEnd();\n\t var_elem = aux01.GetElem();\n\t}\n\treturn int_ret_val ;\n }", "public int Search(Element e){\n\tint int_ret_val ;\n\tList aux01 ;\n\tElement var_elem ;\n\tboolean var_end ;\n\tint nt ;\n\n\tint_ret_val = 0 ;\n\taux01 = this ;\n\tvar_end = end;\n\tvar_elem = elem ;\n\twhile (!var_end){\n\t if (e.Equal(var_elem)){\n\t\tint_ret_val = 1 ;\n\t }\n\t else nt = 0 ;\n\t aux01 = aux01.GetNext() ;\n\t var_end = aux01.GetEnd();\n\t var_elem = aux01.GetElem();\n\t}\n\treturn int_ret_val ;\n }", "public int Search(Element e){\n\tint int_ret_val ;\n\tList aux01 ;\n\tElement var_elem ;\n\tboolean var_end ;\n\tint nt ;\n\n\tint_ret_val = 0 ;\n\taux01 = this ;\n\tvar_end = end;\n\tvar_elem = elem ;\n\twhile (!var_end){\n\t if (e.Equal(var_elem)){\n\t\tint_ret_val = 1 ;\n\t }\n\t else nt = 0 ;\n\t aux01 = aux01.GetNext() ;\n\t var_end = aux01.GetEnd();\n\t var_elem = aux01.GetElem();\n\t}\n\treturn int_ret_val ;\n }", "public int Search(Element e){\n\tint int_ret_val ;\n\tList aux01 ;\n\tElement var_elem ;\n\tboolean var_end ;\n\tint nt ;\n\n\tint_ret_val = 0 ;\n\taux01 = this ;\n\tvar_end = end;\n\tvar_elem = elem ;\n\twhile (!var_end){\n\t if (e.Equal(var_elem)){\n\t\tint_ret_val = 1 ;\n\t }\n\t else nt = 0 ;\n\t aux01 = aux01.GetNext() ;\n\t var_end = aux01.GetEnd();\n\t var_elem = aux01.GetElem();\n\t}\n\treturn int_ret_val ;\n }", "public int Search(Element e){\n\tint int_ret_val ;\n\tList aux01 ;\n\tElement var_elem ;\n\tboolean var_end ;\n\tint nt ;\n\n\tint_ret_val = 0 ;\n\taux01 = this ;\n\tvar_end = end;\n\tvar_elem = elem ;\n\twhile (!var_end){\n\t if (e.Equal(var_elem)){\n\t\tint_ret_val = 1 ;\n\t }\n\t else nt = 0 ;\n\t aux01 = aux01.GetNext() ;\n\t var_end = aux01.GetEnd();\n\t var_elem = aux01.GetElem();\n\t}\n\treturn int_ret_val ;\n }", "public int Search(Element e){\n\tint int_ret_val ;\n\tList aux01 ;\n\tElement var_elem ;\n\tboolean var_end ;\n\tint nt ;\n\n\tint_ret_val = 0 ;\n\taux01 = this ;\n\tvar_end = end;\n\tvar_elem = elem ;\n\twhile (!var_end){\n\t if (e.Equal(var_elem)){\n\t\tint_ret_val = 1 ;\n\t }\n\t else nt = 0 ;\n\t aux01 = aux01.GetNext() ;\n\t var_end = aux01.GetEnd();\n\t var_elem = aux01.GetElem();\n\t}\n\treturn int_ret_val ;\n }", "public int Search(Element e){\n\tint int_ret_val ;\n\tList aux01 ;\n\tElement var_elem ;\n\tboolean var_end ;\n\tint nt ;\n\n\tint_ret_val = 0 ;\n\taux01 = this ;\n\tvar_end = end;\n\tvar_elem = elem ;\n\twhile (!var_end){\n\t if (e.Equal(var_elem)){\n\t\tint_ret_val = 1 ;\n\t }\n\t else nt = 0 ;\n\t aux01 = aux01.GetNext() ;\n\t var_end = aux01.GetEnd();\n\t var_elem = aux01.GetElem();\n\t}\n\treturn int_ret_val ;\n }", "public int Search(Element e){\n\tint int_ret_val ;\n\tList aux01 ;\n\tElement var_elem ;\n\tboolean var_end ;\n\tint nt ;\n\n\tint_ret_val = 0 ;\n\taux01 = this ;\n\tvar_end = end;\n\tvar_elem = elem ;\n\twhile (!var_end){\n\t if (e.Equal(var_elem)){\n\t\tint_ret_val = 1 ;\n\t }\n\t else nt = 0 ;\n\t aux01 = aux01.GetNext() ;\n\t var_end = aux01.GetEnd();\n\t var_elem = aux01.GetElem();\n\t}\n\treturn int_ret_val ;\n }", "public int Search(Element e){\n\tint int_ret_val ;\n\tList aux01 ;\n\tElement var_elem ;\n\tboolean var_end ;\n\tint nt ;\n\n\tint_ret_val = 0 ;\n\taux01 = this ;\n\tvar_end = end;\n\tvar_elem = elem ;\n\twhile (!var_end){\n\t if (e.Equal(var_elem)){\n\t\tint_ret_val = 1 ;\n\t }\n\t else nt = 0 ;\n\t aux01 = aux01.GetNext() ;\n\t var_end = aux01.GetEnd();\n\t var_elem = aux01.GetElem();\n\t}\n\treturn int_ret_val ;\n }", "public int Search(Element e){\n\tint int_ret_val ;\n\tList aux01 ;\n\tElement var_elem ;\n\tboolean var_end ;\n\tint nt ;\n\n\tint_ret_val = 0 ;\n\taux01 = this ;\n\tvar_end = end;\n\tvar_elem = elem ;\n\twhile (!var_end){\n\t if (e.Equal(var_elem)){\n\t\tint_ret_val = 1 ;\n\t }\n\t else nt = 0 ;\n\t aux01 = aux01.GetNext() ;\n\t var_end = aux01.GetEnd();\n\t var_elem = aux01.GetElem();\n\t}\n\treturn int_ret_val ;\n }", "public int Search(Element e){\n\tint int_ret_val ;\n\tList aux01 ;\n\tElement var_elem ;\n\tboolean var_end ;\n\tint nt ;\n\n\tint_ret_val = 0 ;\n\taux01 = this ;\n\tvar_end = end;\n\tvar_elem = elem ;\n\twhile (!var_end){\n\t if (e.Equal(var_elem)){\n\t\tint_ret_val = 1 ;\n\t }\n\t else nt = 0 ;\n\t aux01 = aux01.GetNext() ;\n\t var_end = aux01.GetEnd();\n\t var_elem = aux01.GetElem();\n\t}\n\treturn int_ret_val ;\n }", "public int Search(Element e){\n\tint int_ret_val ;\n\tList aux01 ;\n\tElement var_elem ;\n\tboolean var_end ;\n\tint nt ;\n\n\tint_ret_val = 0 ;\n\taux01 = this ;\n\tvar_end = end;\n\tvar_elem = elem ;\n\twhile (!var_end){\n\t if (e.Equal(var_elem)){\n\t\tint_ret_val = 1 ;\n\t }\n\t else nt = 0 ;\n\t aux01 = aux01.GetNext() ;\n\t var_end = aux01.GetEnd();\n\t var_elem = aux01.GetElem();\n\t}\n\treturn int_ret_val ;\n }", "public int Search(Element e){\n\tint int_ret_val ;\n\tList aux01 ;\n\tElement var_elem ;\n\tboolean var_end ;\n\tint nt ;\n\n\tint_ret_val = 0 ;\n\taux01 = this ;\n\tvar_end = end;\n\tvar_elem = elem ;\n\twhile (!var_end){\n\t if (e.Equal(var_elem)){\n\t\tint_ret_val = 1 ;\n\t }\n\t else nt = 0 ;\n\t aux01 = aux01.GetNext() ;\n\t var_end = aux01.GetEnd();\n\t var_elem = aux01.GetElem();\n\t}\n\treturn int_ret_val ;\n }", "public int Search(Element e){\n\tint int_ret_val ;\n\tList aux01 ;\n\tElement var_elem ;\n\tboolean var_end ;\n\tint nt ;\n\n\tint_ret_val = 0 ;\n\taux01 = this ;\n\tvar_end = end;\n\tvar_elem = elem ;\n\twhile (!var_end){\n\t if (e.Equal(var_elem)){\n\t\tint_ret_val = 1 ;\n\t }\n\t else nt = 0 ;\n\t aux01 = aux01.GetNext() ;\n\t var_end = aux01.GetEnd();\n\t var_elem = aux01.GetElem();\n\t}\n\treturn int_ret_val ;\n }", "public int Search(Element e){\n\tint int_ret_val ;\n\tList aux01 ;\n\tElement var_elem ;\n\tboolean var_end ;\n\tint nt ;\n\n\tint_ret_val = 0 ;\n\taux01 = this ;\n\tvar_end = end;\n\tvar_elem = elem ;\n\twhile (!var_end){\n\t if (e.Equal(var_elem)){\n\t\tint_ret_val = 1 ;\n\t }\n\t else nt = 0 ;\n\t aux01 = aux01.GetNext() ;\n\t var_end = aux01.GetEnd();\n\t var_elem = aux01.GetElem();\n\t}\n\treturn int_ret_val ;\n }", "public int Search(Element e){\n\tint int_ret_val ;\n\tList aux01 ;\n\tElement var_elem ;\n\tboolean var_end ;\n\tint nt ;\n\n\tint_ret_val = 0 ;\n\taux01 = this ;\n\tvar_end = end;\n\tvar_elem = elem ;\n\twhile (!var_end){\n\t if (e.Equal(var_elem)){\n\t\tint_ret_val = 1 ;\n\t }\n\t else nt = 0 ;\n\t aux01 = aux01.GetNext() ;\n\t var_end = aux01.GetEnd();\n\t var_elem = aux01.GetElem();\n\t}\n\treturn int_ret_val ;\n }", "public int Search(Element e){\n\tint int_ret_val ;\n\tList aux01 ;\n\tElement var_elem ;\n\tboolean var_end ;\n\tint nt ;\n\n\tint_ret_val = 0 ;\n\taux01 = this ;\n\tvar_end = end;\n\tvar_elem = elem ;\n\twhile (!var_end){\n\t if (e.Equal(var_elem)){\n\t\tint_ret_val = 1 ;\n\t }\n\t else nt = 0 ;\n\t aux01 = aux01.GetNext() ;\n\t var_end = aux01.GetEnd();\n\t var_elem = aux01.GetElem();\n\t}\n\treturn int_ret_val ;\n }", "public int Search(Element e){\n\tint int_ret_val ;\n\tList aux01 ;\n\tElement var_elem ;\n\tboolean var_end ;\n\tint nt ;\n\n\tint_ret_val = 0 ;\n\taux01 = this ;\n\tvar_end = end;\n\tvar_elem = elem ;\n\twhile (!var_end){\n\t if (e.Equal(var_elem)){\n\t\tint_ret_val = 1 ;\n\t }\n\t else nt = 0 ;\n\t aux01 = aux01.GetNext() ;\n\t var_end = aux01.GetEnd();\n\t var_elem = aux01.GetElem();\n\t}\n\treturn int_ret_val ;\n }", "public int Search(Element e){\n\tint int_ret_val ;\n\tList aux01 ;\n\tElement var_elem ;\n\tboolean var_end ;\n\tint nt ;\n\n\tint_ret_val = 0 ;\n\taux01 = this ;\n\tvar_end = end;\n\tvar_elem = elem ;\n\twhile (!var_end){\n\t if (e.Equal(var_elem)){\n\t\tint_ret_val = 1 ;\n\t }\n\t else nt = 0 ;\n\t aux01 = aux01.GetNext() ;\n\t var_end = aux01.GetEnd();\n\t var_elem = aux01.GetElem();\n\t}\n\treturn int_ret_val ;\n }", "public int Search(Element e){\n\tint int_ret_val ;\n\tList aux01 ;\n\tElement var_elem ;\n\tboolean var_end ;\n\tint nt ;\n\n\tint_ret_val = 0 ;\n\taux01 = this ;\n\tvar_end = end;\n\tvar_elem = elem ;\n\twhile (!var_end){\n\t if (e.Equal(var_elem)){\n\t\tint_ret_val = 1 ;\n\t }\n\t else nt = 0 ;\n\t aux01 = aux01.GetNext() ;\n\t var_end = aux01.GetEnd();\n\t var_elem = aux01.GetElem();\n\t}\n\treturn int_ret_val ;\n }", "public int Search(Element e){\n\tint int_ret_val ;\n\tList aux01 ;\n\tElement var_elem ;\n\tboolean var_end ;\n\tint nt ;\n\n\tint_ret_val = 0 ;\n\taux01 = this ;\n\tvar_end = end;\n\tvar_elem = elem ;\n\twhile (!var_end){\n\t if (e.Equal(var_elem)){\n\t\tint_ret_val = 1 ;\n\t }\n\t else nt = 0 ;\n\t aux01 = aux01.GetNext() ;\n\t var_end = aux01.GetEnd();\n\t var_elem = aux01.GetElem();\n\t}\n\treturn int_ret_val ;\n }", "public int Search(Element e){\n\tint int_ret_val ;\n\tList aux01 ;\n\tElement var_elem ;\n\tboolean var_end ;\n\tint nt ;\n\n\tint_ret_val = 0 ;\n\taux01 = this ;\n\tvar_end = end;\n\tvar_elem = elem ;\n\twhile (!var_end){\n\t if (e.Equal(var_elem)){\n\t\tint_ret_val = 1 ;\n\t }\n\t else nt = 0 ;\n\t aux01 = aux01.GetNext() ;\n\t var_end = aux01.GetEnd();\n\t var_elem = aux01.GetElem();\n\t}\n\treturn int_ret_val ;\n }", "public int Search(Element e){\n\tint int_ret_val ;\n\tList aux01 ;\n\tElement var_elem ;\n\tboolean var_end ;\n\tint nt ;\n\n\tint_ret_val = 0 ;\n\taux01 = this ;\n\tvar_end = end;\n\tvar_elem = elem ;\n\twhile (!var_end){\n\t if (e.Equal(var_elem)){\n\t\tint_ret_val = 1 ;\n\t }\n\t else nt = 0 ;\n\t aux01 = aux01.GetNext() ;\n\t var_end = aux01.GetEnd();\n\t var_elem = aux01.GetElem();\n\t}\n\treturn int_ret_val ;\n }", "public int Search(Element e){\n\tint int_ret_val ;\n\tList aux01 ;\n\tElement var_elem ;\n\tboolean var_end ;\n\tint nt ;\n\n\tint_ret_val = 0 ;\n\taux01 = this ;\n\tvar_end = end;\n\tvar_elem = elem ;\n\twhile (!var_end){\n\t if (e.Equal(var_elem)){\n\t\tint_ret_val = 1 ;\n\t }\n\t else nt = 0 ;\n\t aux01 = aux01.GetNext() ;\n\t var_end = aux01.GetEnd();\n\t var_elem = aux01.GetElem();\n\t}\n\treturn int_ret_val ;\n }", "public int Search(Element e){\n\tint int_ret_val ;\n\tList aux01 ;\n\tElement var_elem ;\n\tboolean var_end ;\n\tint nt ;\n\n\tint_ret_val = 0 ;\n\taux01 = this ;\n\tvar_end = end;\n\tvar_elem = elem ;\n\twhile (!var_end){\n\t if (e.Equal(var_elem)){\n\t\tint_ret_val = 1 ;\n\t }\n\t else nt = 0 ;\n\t aux01 = aux01.GetNext() ;\n\t var_end = aux01.GetEnd();\n\t var_elem = aux01.GetElem();\n\t}\n\treturn int_ret_val ;\n }", "public int Search(Element e){\n\tint int_ret_val ;\n\tList aux01 ;\n\tElement var_elem ;\n\tboolean var_end ;\n\tint nt ;\n\n\tint_ret_val = 0 ;\n\taux01 = this ;\n\tvar_end = end;\n\tvar_elem = elem ;\n\twhile (!var_end){\n\t if (e.Equal(var_elem)){\n\t\tint_ret_val = 1 ;\n\t }\n\t else nt = 0 ;\n\t aux01 = aux01.GetNext() ;\n\t var_end = aux01.GetEnd();\n\t var_elem = aux01.GetElem();\n\t}\n\treturn int_ret_val ;\n }", "public int Search(Element e){\n\tint int_ret_val ;\n\tList aux01 ;\n\tElement var_elem ;\n\tboolean var_end ;\n\tint nt ;\n\n\tint_ret_val = 0 ;\n\taux01 = this ;\n\tvar_end = end;\n\tvar_elem = elem ;\n\twhile (!var_end){\n\t if (e.Equal(var_elem)){\n\t\tint_ret_val = 1 ;\n\t }\n\t else nt = 0 ;\n\t aux01 = aux01.GetNext() ;\n\t var_end = aux01.GetEnd();\n\t var_elem = aux01.GetElem();\n\t}\n\treturn int_ret_val ;\n }", "public int Search(Element e){\n\tint int_ret_val ;\n\tList aux01 ;\n\tElement var_elem ;\n\tboolean var_end ;\n\tint nt ;\n\n\tint_ret_val = 0 ;\n\taux01 = this ;\n\tvar_end = end;\n\tvar_elem = elem ;\n\twhile (!var_end){\n\t if (e.Equal(var_elem)){\n\t\tint_ret_val = 1 ;\n\t }\n\t else nt = 0 ;\n\t aux01 = aux01.GetNext() ;\n\t var_end = aux01.GetEnd();\n\t var_elem = aux01.GetElem();\n\t}\n\treturn int_ret_val ;\n }", "public int Search(Element e){\n\tint int_ret_val ;\n\tList aux01 ;\n\tElement var_elem ;\n\tboolean var_end ;\n\tint nt ;\n\n\tint_ret_val = 0 ;\n\taux01 = this ;\n\tvar_end = end;\n\tvar_elem = elem ;\n\twhile (!var_end){\n\t if (e.Equal(var_elem)){\n\t\tint_ret_val = 1 ;\n\t }\n\t else nt = 0 ;\n\t aux01 = aux01.GetNext() ;\n\t var_end = aux01.GetEnd();\n\t var_elem = aux01.GetElem();\n\t}\n\treturn int_ret_val ;\n }", "public int Search(Element e){\n\tint int_ret_val ;\n\tList aux01 ;\n\tElement var_elem ;\n\tboolean var_end ;\n\tint nt ;\n\n\tint_ret_val = 0 ;\n\taux01 = this ;\n\tvar_end = end;\n\tvar_elem = elem ;\n\twhile (!var_end){\n\t if (e.Equal(var_elem)){\n\t\tint_ret_val = 1 ;\n\t }\n\t else nt = 0 ;\n\t aux01 = aux01.GetNext() ;\n\t var_end = aux01.GetEnd();\n\t var_elem = aux01.GetElem();\n\t}\n\treturn int_ret_val ;\n }", "public int Search(Element e){\n\tint int_ret_val ;\n\tList aux01 ;\n\tElement var_elem ;\n\tboolean var_end ;\n\tint nt ;\n\n\tint_ret_val = 0 ;\n\taux01 = this ;\n\tvar_end = end;\n\tvar_elem = elem ;\n\twhile (!var_end){\n\t if (e.Equal(var_elem)){\n\t\tint_ret_val = 1 ;\n\t }\n\t else nt = 0 ;\n\t aux01 = aux01.GetNext() ;\n\t var_end = aux01.GetEnd();\n\t var_elem = aux01.GetElem();\n\t}\n\treturn int_ret_val ;\n }", "public int Search(Element e){\n\tint int_ret_val ;\n\tList aux01 ;\n\tElement var_elem ;\n\tboolean var_end ;\n\tint nt ;\n\n\tint_ret_val = 0 ;\n\taux01 = this ;\n\tvar_end = end;\n\tvar_elem = elem ;\n\twhile (!var_end){\n\t if (e.Equal(var_elem)){\n\t\tint_ret_val = 1 ;\n\t }\n\t else nt = 0 ;\n\t aux01 = aux01.GetNext() ;\n\t var_end = aux01.GetEnd();\n\t var_elem = aux01.GetElem();\n\t}\n\treturn int_ret_val ;\n }", "public int Search(Element e){\n\tint int_ret_val ;\n\tList aux01 ;\n\tElement var_elem ;\n\tboolean var_end ;\n\tint nt ;\n\n\tint_ret_val = 0 ;\n\taux01 = this ;\n\tvar_end = end;\n\tvar_elem = elem ;\n\twhile (!var_end){\n\t if (e.Equal(var_elem)){\n\t\tint_ret_val = 1 ;\n\t }\n\t else nt = 0 ;\n\t aux01 = aux01.GetNext() ;\n\t var_end = aux01.GetEnd();\n\t var_elem = aux01.GetElem();\n\t}\n\treturn int_ret_val ;\n }", "public int Search(Element e){\n\tint int_ret_val ;\n\tList aux01 ;\n\tElement var_elem ;\n\tboolean var_end ;\n\tint nt ;\n\n\tint_ret_val = 0 ;\n\taux01 = this ;\n\tvar_end = end;\n\tvar_elem = elem ;\n\twhile (!var_end){\n\t if (e.Equal(var_elem)){\n\t\tint_ret_val = 1 ;\n\t }\n\t else nt = 0 ;\n\t aux01 = aux01.GetNext() ;\n\t var_end = aux01.GetEnd();\n\t var_elem = aux01.GetElem();\n\t}\n\treturn int_ret_val ;\n }", "public int Search(Element e){\n\tint int_ret_val ;\n\tList aux01 ;\n\tElement var_elem ;\n\tboolean var_end ;\n\tint nt ;\n\n\tint_ret_val = 0 ;\n\taux01 = this ;\n\tvar_end = end;\n\tvar_elem = elem ;\n\twhile (!var_end){\n\t if (e.Equal(var_elem)){\n\t\tint_ret_val = 1 ;\n\t }\n\t else nt = 0 ;\n\t aux01 = aux01.GetNext() ;\n\t var_end = aux01.GetEnd();\n\t var_elem = aux01.GetElem();\n\t}\n\treturn int_ret_val ;\n }", "public int Search(Element e){\n\tint int_ret_val ;\n\tList aux01 ;\n\tElement var_elem ;\n\tboolean var_end ;\n\tint nt ;\n\n\tint_ret_val = 0 ;\n\taux01 = this ;\n\tvar_end = end;\n\tvar_elem = elem ;\n\twhile (!var_end){\n\t if (e.Equal(var_elem)){\n\t\tint_ret_val = 1 ;\n\t }\n\t else nt = 0 ;\n\t aux01 = aux01.GetNext() ;\n\t var_end = aux01.GetEnd();\n\t var_elem = aux01.GetElem();\n\t}\n\treturn int_ret_val ;\n }", "public int Search(Element e){\n\tint int_ret_val ;\n\tList aux01 ;\n\tElement var_elem ;\n\tboolean var_end ;\n\tint nt ;\n\n\tint_ret_val = 0 ;\n\taux01 = this ;\n\tvar_end = end;\n\tvar_elem = elem ;\n\twhile (!var_end){\n\t if (e.Equal(var_elem)){\n\t\tint_ret_val = 1 ;\n\t }\n\t else nt = 0 ;\n\t aux01 = aux01.GetNext() ;\n\t var_end = aux01.GetEnd();\n\t var_elem = aux01.GetElem();\n\t}\n\treturn int_ret_val ;\n }", "public int Search(Element e){\n\tint int_ret_val ;\n\tList aux01 ;\n\tElement var_elem ;\n\tboolean var_end ;\n\tint nt ;\n\n\tint_ret_val = 0 ;\n\taux01 = this ;\n\tvar_end = end;\n\tvar_elem = elem ;\n\twhile (!var_end){\n\t if (e.Equal(var_elem)){\n\t\tint_ret_val = 1 ;\n\t }\n\t else nt = 0 ;\n\t aux01 = aux01.GetNext() ;\n\t var_end = aux01.GetEnd();\n\t var_elem = aux01.GetElem();\n\t}\n\treturn int_ret_val ;\n }", "public int Search(Element e){\n\tint int_ret_val ;\n\tList aux01 ;\n\tElement var_elem ;\n\tboolean var_end ;\n\tint nt ;\n\n\tint_ret_val = 0 ;\n\taux01 = this ;\n\tvar_end = end;\n\tvar_elem = elem ;\n\twhile (!var_end){\n\t if (e.Equal(var_elem)){\n\t\tint_ret_val = 1 ;\n\t }\n\t else nt = 0 ;\n\t aux01 = aux01.GetNext() ;\n\t var_end = aux01.GetEnd();\n\t var_elem = aux01.GetElem();\n\t}\n\treturn int_ret_val ;\n }", "public int Search(Element e){\n\tint int_ret_val ;\n\tList aux01 ;\n\tElement var_elem ;\n\tboolean var_end ;\n\tint nt ;\n\n\tint_ret_val = 0 ;\n\taux01 = this ;\n\tvar_end = end;\n\tvar_elem = elem ;\n\twhile (!var_end){\n\t if (e.Equal(var_elem)){\n\t\tint_ret_val = 1 ;\n\t }\n\t else nt = 0 ;\n\t aux01 = aux01.GetNext() ;\n\t var_end = aux01.GetEnd();\n\t var_elem = aux01.GetElem();\n\t}\n\treturn int_ret_val ;\n }", "public int Search(Element e){\n\tint int_ret_val ;\n\tList aux01 ;\n\tElement var_elem ;\n\tboolean var_end ;\n\tint nt ;\n\n\tint_ret_val = 0 ;\n\taux01 = this ;\n\tvar_end = end;\n\tvar_elem = elem ;\n\twhile (!var_end){\n\t if (e.Equal(var_elem)){\n\t\tint_ret_val = 1 ;\n\t }\n\t else nt = 0 ;\n\t aux01 = aux01.GetNext() ;\n\t var_end = aux01.GetEnd();\n\t var_elem = aux01.GetElem();\n\t}\n\treturn int_ret_val ;\n }", "public int Search(Element e){\n\tint int_ret_val ;\n\tList aux01 ;\n\tElement var_elem ;\n\tboolean var_end ;\n\tint nt ;\n\n\tint_ret_val = 0 ;\n\taux01 = this ;\n\tvar_end = end;\n\tvar_elem = elem ;\n\twhile (!var_end){\n\t if (e.Equal(var_elem)){\n\t\tint_ret_val = 1 ;\n\t }\n\t else nt = 0 ;\n\t aux01 = aux01.GetNext() ;\n\t var_end = aux01.GetEnd();\n\t var_elem = aux01.GetElem();\n\t}\n\treturn int_ret_val ;\n }", "public int Search(Element e){\n\tint int_ret_val ;\n\tList aux01 ;\n\tElement var_elem ;\n\tboolean var_end ;\n\tint nt ;\n\n\tint_ret_val = 0 ;\n\taux01 = this ;\n\tvar_end = end;\n\tvar_elem = elem ;\n\twhile (!var_end){\n\t if (e.Equal(var_elem)){\n\t\tint_ret_val = 1 ;\n\t }\n\t else nt = 0 ;\n\t aux01 = aux01.GetNext() ;\n\t var_end = aux01.GetEnd();\n\t var_elem = aux01.GetElem();\n\t}\n\treturn int_ret_val ;\n }", "public int Search(Element e){\n\tint int_ret_val ;\n\tList aux01 ;\n\tElement var_elem ;\n\tboolean var_end ;\n\tint nt ;\n\n\tint_ret_val = 0 ;\n\taux01 = this ;\n\tvar_end = end;\n\tvar_elem = elem ;\n\twhile (!var_end){\n\t if (e.Equal(var_elem)){\n\t\tint_ret_val = 1 ;\n\t }\n\t else nt = 0 ;\n\t aux01 = aux01.GetNext() ;\n\t var_end = aux01.GetEnd();\n\t var_elem = aux01.GetElem();\n\t}\n\treturn int_ret_val ;\n }", "public int Search(Element e){\n\tint int_ret_val ;\n\tList aux01 ;\n\tElement var_elem ;\n\tboolean var_end ;\n\tint nt ;\n\n\tint_ret_val = 0 ;\n\taux01 = this ;\n\tvar_end = end;\n\tvar_elem = elem ;\n\twhile (!var_end){\n\t if (e.Equal(var_elem)){\n\t\tint_ret_val = 1 ;\n\t }\n\t else nt = 0 ;\n\t aux01 = aux01.GetNext() ;\n\t var_end = aux01.GetEnd();\n\t var_elem = aux01.GetElem();\n\t}\n\treturn int_ret_val ;\n }", "public int Search(Element e){\n\tint int_ret_val ;\n\tList aux01 ;\n\tElement var_elem ;\n\tboolean var_end ;\n\tint nt ;\n\n\tint_ret_val = 0 ;\n\taux01 = this ;\n\tvar_end = end;\n\tvar_elem = elem ;\n\twhile (!var_end){\n\t if (e.Equal(var_elem)){\n\t\tint_ret_val = 1 ;\n\t }\n\t else nt = 0 ;\n\t aux01 = aux01.GetNext() ;\n\t var_end = aux01.GetEnd();\n\t var_elem = aux01.GetElem();\n\t}\n\treturn int_ret_val ;\n }", "public int Search(Element e){\n\tint int_ret_val ;\n\tList aux01 ;\n\tElement var_elem ;\n\tboolean var_end ;\n\tint nt ;\n\n\tint_ret_val = 0 ;\n\taux01 = this ;\n\tvar_end = end;\n\tvar_elem = elem ;\n\twhile (!var_end){\n\t if (e.Equal(var_elem)){\n\t\tint_ret_val = 1 ;\n\t }\n\t else nt = 0 ;\n\t aux01 = aux01.GetNext() ;\n\t var_end = aux01.GetEnd();\n\t var_elem = aux01.GetElem();\n\t}\n\treturn int_ret_val ;\n }", "public int Search(Element e){\n\tint int_ret_val ;\n\tList aux01 ;\n\tElement var_elem ;\n\tboolean var_end ;\n\tint nt ;\n\n\tint_ret_val = 0 ;\n\taux01 = this ;\n\tvar_end = end;\n\tvar_elem = elem ;\n\twhile (!var_end){\n\t if (e.Equal(var_elem)){\n\t\tint_ret_val = 1 ;\n\t }\n\t else nt = 0 ;\n\t aux01 = aux01.GetNext() ;\n\t var_end = aux01.GetEnd();\n\t var_elem = aux01.GetElem();\n\t}\n\treturn int_ret_val ;\n }", "public int Search(Element e){\n\tint int_ret_val ;\n\tList aux01 ;\n\tElement var_elem ;\n\tboolean var_end ;\n\tint nt ;\n\n\tint_ret_val = 0 ;\n\taux01 = this ;\n\tvar_end = end;\n\tvar_elem = elem ;\n\twhile (!var_end){\n\t if (e.Equal(var_elem)){\n\t\tint_ret_val = 1 ;\n\t }\n\t else nt = 0 ;\n\t aux01 = aux01.GetNext() ;\n\t var_end = aux01.GetEnd();\n\t var_elem = aux01.GetElem();\n\t}\n\treturn int_ret_val ;\n }", "public int Search(Element e){\n\tint int_ret_val ;\n\tList aux01 ;\n\tElement var_elem ;\n\tboolean var_end ;\n\tint nt ;\n\n\tint_ret_val = 0 ;\n\taux01 = this ;\n\tvar_end = end;\n\tvar_elem = elem ;\n\twhile (!var_end){\n\t if (e.Equal(var_elem)){\n\t\tint_ret_val = 1 ;\n\t }\n\t else nt = 0 ;\n\t aux01 = aux01.GetNext() ;\n\t var_end = aux01.GetEnd();\n\t var_elem = aux01.GetElem();\n\t}\n\treturn int_ret_val ;\n }", "public int Search(Element e){\n\tint int_ret_val ;\n\tList aux01 ;\n\tElement var_elem ;\n\tboolean var_end ;\n\tint nt ;\n\n\tint_ret_val = 0 ;\n\taux01 = this ;\n\tvar_end = end;\n\tvar_elem = elem ;\n\twhile (!var_end){\n\t if (e.Equal(var_elem)){\n\t\tint_ret_val = 1 ;\n\t }\n\t else nt = 0 ;\n\t aux01 = aux01.GetNext() ;\n\t var_end = aux01.GetEnd();\n\t var_elem = aux01.GetElem();\n\t}\n\treturn int_ret_val ;\n }", "public int Search(Element e){\n\tint int_ret_val ;\n\tList aux01 ;\n\tElement var_elem ;\n\tboolean var_end ;\n\tint nt ;\n\n\tint_ret_val = 0 ;\n\taux01 = this ;\n\tvar_end = end;\n\tvar_elem = elem ;\n\twhile (!var_end){\n\t if (e.Equal(var_elem)){\n\t\tint_ret_val = 1 ;\n\t }\n\t else nt = 0 ;\n\t aux01 = aux01.GetNext() ;\n\t var_end = aux01.GetEnd();\n\t var_elem = aux01.GetElem();\n\t}\n\treturn int_ret_val ;\n }", "public int Search(Element e){\n\tint int_ret_val ;\n\tList aux01 ;\n\tElement var_elem ;\n\tboolean var_end ;\n\tint nt ;\n\n\tint_ret_val = 0 ;\n\taux01 = this ;\n\tvar_end = end;\n\tvar_elem = elem ;\n\twhile (!var_end){\n\t if (e.Equal(var_elem)){\n\t\tint_ret_val = 1 ;\n\t }\n\t else nt = 0 ;\n\t aux01 = aux01.GetNext() ;\n\t var_end = aux01.GetEnd();\n\t var_elem = aux01.GetElem();\n\t}\n\treturn int_ret_val ;\n }", "public int Search(Element e){\n\tint int_ret_val ;\n\tList aux01 ;\n\tElement var_elem ;\n\tboolean var_end ;\n\tint nt ;\n\n\tint_ret_val = 0 ;\n\taux01 = this ;\n\tvar_end = end;\n\tvar_elem = elem ;\n\twhile (!var_end){\n\t if (e.Equal(var_elem)){\n\t\tint_ret_val = 1 ;\n\t }\n\t else nt = 0 ;\n\t aux01 = aux01.GetNext() ;\n\t var_end = aux01.GetEnd();\n\t var_elem = aux01.GetElem();\n\t}\n\treturn int_ret_val ;\n }", "public int Search(Element e){\n\tint int_ret_val ;\n\tList aux01 ;\n\tElement var_elem ;\n\tboolean var_end ;\n\tint nt ;\n\n\tint_ret_val = 0 ;\n\taux01 = this ;\n\tvar_end = end;\n\tvar_elem = elem ;\n\twhile (!var_end){\n\t if (e.Equal(var_elem)){\n\t\tint_ret_val = 1 ;\n\t }\n\t else nt = 0 ;\n\t aux01 = aux01.GetNext() ;\n\t var_end = aux01.GetEnd();\n\t var_elem = aux01.GetElem();\n\t}\n\treturn int_ret_val ;\n }", "public int Search(Element e){\n\tint int_ret_val ;\n\tList aux01 ;\n\tElement var_elem ;\n\tboolean var_end ;\n\tint nt ;\n\n\tint_ret_val = 0 ;\n\taux01 = this ;\n\tvar_end = end;\n\tvar_elem = elem ;\n\twhile (!var_end){\n\t if (e.Equal(var_elem)){\n\t\tint_ret_val = 1 ;\n\t }\n\t else nt = 0 ;\n\t aux01 = aux01.GetNext() ;\n\t var_end = aux01.GetEnd();\n\t var_elem = aux01.GetElem();\n\t}\n\treturn int_ret_val ;\n }", "public int Search(Element e){\n\tint int_ret_val ;\n\tList aux01 ;\n\tElement var_elem ;\n\tboolean var_end ;\n\tint nt ;\n\n\tint_ret_val = 0 ;\n\taux01 = this ;\n\tvar_end = end;\n\tvar_elem = elem ;\n\twhile (!var_end){\n\t if (e.Equal(var_elem)){\n\t\tint_ret_val = 1 ;\n\t }\n\t else nt = 0 ;\n\t aux01 = aux01.GetNext() ;\n\t var_end = aux01.GetEnd();\n\t var_elem = aux01.GetElem();\n\t}\n\treturn int_ret_val ;\n }", "public ArrayList<Integer> linearSearch(ArrayList<Integer> arrl, int num) {\n\n\t\tthis.num = num; \n\t\tthis.arrayList = arrl;\n\t\tif(arrl.contains(num) == false) {\n\t\t\tSystem.out.println(\"Expense of \" + num + \" not found, try again...\\n\");\n\t\t\treturn arrl;\n\t\t}\n\t\telse\n\t\t\tfor(int i : arrl) {\n\t\t\t\tif(i == num) {\n\t\t\t\t\tSystem.out.println(\"Expense of \" + num + \" found.\\n\");\n\t\t\t\t}\n\t\t\t}\n\t\treturn arrl;\n\t}", "public static native int Find(long lpjFbxArrayVector2, long pElement, int pStartIndex);", "boolean checkItem (List<Student> search, int item){\r\n // We use for loop to search\r\n for (int i = 0; i < search.size(); i++) {\r\n // if item exists, then we reutrn true\r\n if (item == i){\r\n return true;\r\n }\r\n }\r\n // else if it doesn't, then we return false\r\n return false;\r\n }", "public abstract int search(String[] words, String wordToFind) throws ItemNotFoundException;", "public static void itemsearch(List<String> shoppingList) {\n\n\n\n if(shoppingList.contains(\"milk\")){\n System.out.println(\"The list contains milk\");\n }\n else{\n System.out.println(\"We dont have milk on our list\");\n }\n\n if(shoppingList.contains(\"bananas\")){\n System.out.println(\"the list contains bananas\");\n }\n else{\n System.out.println(\"We dont have bananas on our list\");\n }\n }", "public synchronized int search(Object arg)\n {\n int result = -1;\n for (int i=0; i<dataList.size(); i++)\n {\n Object testItem = dataList.get(i);\n if (arg.equals(testItem))\n {\n // calculate the 1-based index of the last item\n // in the List (the top item on the stack)\n result = i + 1;\n break;\n }\n }\n return result;\n }", "private int linearSearch(final Integer element) {\n for (int i = 0; i < size; i++) {\n if (arrayList[i] == element) {\n return i;\n }\n }\n return -1;\n }", "public static void main(String[] args) {\n\t\tArrayList<Integer> al=new ArrayList<Integer>();\r\n\t\tal.add(100);\r\n\t\tal.add(50);\r\n\t\tal.add(2,90);\r\n\t\tal.add(20);\r\n\t\tal.add(53);\r\n\t\tal.add(70);\r\n\t\tal.add(10);\r\n\t\tSystem.out.println(al);\r\n\t\tSystem.out.println(\"Enter the key:\");\r\n\t\tScanner s=new Scanner(System.in);\r\n\t\tint[] ar=new int[al.size()];\r\n\t\tfor(int i=0;i<al.size();i++)\r\n\t\t{\r\n\t\t\tar[i]=al.get(i);\r\n\t\t}\r\n\t\tArrays.sort(ar);\r\n\t\tint key=s.nextInt();\r\n\t\tint index=Arrays.binarySearch(ar,key);//binarySearch is only applicable if the array is sorted \r\n\t\tif(index>=0)\r\n\t\t{\r\n\t\t\tSystem.out.println(\"Element found at\"+\" \"+index);\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\tSystem.out.println(\"Element not found\");\r\n\t\t}\r\n\t\t//System.out.println(index);\r\n\t}", "void search();", "void search();", "public static void linearSearch(int[] array,int key){\n for(int i=0;i<array.length;i++){\n if(array[i]==key){\n System.out.println(key+\" was found in the list with \"+(i+1)+\" iterations\");break;}\n else if(i==array.length-1&&array[i]!=key){\n System.out.println(key+\" was not found in the list with \"+(i+1)+\" iterations\"); }\n }\n }", "public boolean search(T element);", "int search(E item);", "public static void main(String[] args) {\n Scanner scanner = new Scanner(System.in);\n int elem = scanner.nextInt();\n ArrayList<Integer> list = new ArrayList<>();\n while (scanner.hasNextInt()) {\n list.add(scanner.nextInt());\n }\n int[] array = new int[list.size()];\n for (int i = 0; i < array.length; i++) {\n array[i] = list.get(i);\n }\n System.out.println(binarySearch(array,elem));\n }" ]
[ "0.6867523", "0.6832437", "0.67982644", "0.677318", "0.6683831", "0.6670109", "0.66245306", "0.65878606", "0.65746754", "0.6521319", "0.65179574", "0.6459909", "0.6459909", "0.6459909", "0.6459909", "0.6459909", "0.6459909", "0.6459909", "0.6459909", "0.6459909", "0.6459909", "0.6459909", "0.6459909", "0.6459909", "0.6459909", "0.6459909", "0.6459909", "0.6459909", "0.6459909", "0.6459909", "0.6459909", "0.6459909", "0.6459909", "0.6459909", "0.6459909", "0.6459909", "0.6459909", "0.6459909", "0.6459909", "0.6459909", "0.6459909", "0.6459909", "0.6459909", "0.6459909", "0.6459909", "0.6459909", "0.6459909", "0.6459909", "0.6459909", "0.6459909", "0.6459909", "0.6459909", "0.6459909", "0.6459909", "0.6459909", "0.6459909", "0.6459909", "0.6459909", "0.6459909", "0.6459909", "0.6459909", "0.6459909", "0.64590687", "0.64590687", "0.64590687", "0.64590687", "0.64590687", "0.64590687", "0.64590687", "0.64590687", "0.64590687", "0.64590687", "0.64590687", "0.64590687", "0.64590687", "0.64590687", "0.64590687", "0.64590687", "0.64590687", "0.64590687", "0.64590687", "0.64590687", "0.64590687", "0.64590687", "0.64590687", "0.64590687", "0.64590687", "0.64083064", "0.63974303", "0.63884693", "0.63318235", "0.6319551", "0.6302532", "0.6290463", "0.6288194", "0.62849706", "0.62849706", "0.628023", "0.6275777", "0.6274275", "0.6235254" ]
0.0
-1
Constructor The binary expression constructor uses a series of if statements to determine the operator used. The if statements are ordered using order of operations to assist in the Interpreter portion when computing the results of the expressions. If a valid operator does not exist, an error is thrown.
public binary_ex(String expression) { try { fullExpression = expression.trim(); if (expression.contains("*")) splitExpression(expression, "*"); else if (expression.contains("/")) splitExpression(expression, "/"); else if (expression.contains("+")) splitExpression(expression, "+"); else if (expression.contains("-")) splitExpression(expression, "-"); else if (expression.contains("%")) splitExpression(expression, "%"); else if (expression.contains("\\")) splitExpression(expression, "\\"); else throw new JuliaSyntaxException("arith"); } catch (JuliaSyntaxException e) { } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "Expression() { }", "public LogicalOperator() {\n this.logical = Logical.And;\n }", "public BinaryExpression(IExpression left, IExpression right, IOperation op) {\r\n\t\tthis.op = op; // passes the reference op parameter to the associated\r\n\t\t\t\t\t\t// field.\r\n\t\tthis.left = left; // passes the reference of the left parameter to the\r\n\t\t\t\t\t\t\t// associated field.\r\n\t\tthis.right = right; // passes the reference of the right parameter to\r\n\t\t\t\t\t\t\t// the associated field.\r\n\t}", "private OperatorToken(final CharSequence symbol, final Precedence precedence, final Associativity associativity,\n final Function<BigDecimal[], BigDecimal> operation) {\n super(symbol, BINARY, operation);\n this.precedence = precedence;\n this.associativity = associativity;\n }", "public Expression() {\r\n }", "public Calculator() {\r\n\t\tthis.operator = new Addition();\r\n\t}", "public Expression(String pExpStr) {\n Queue<Token> tokenQueue = new Queue<>();\n setTokenQueue(tokenQueue);\n Tokenizer tokenizer = new Tokenizer(pExpStr);\n Token prevToken = null;\n Token token = tokenizer.nextToken();\n while (token != null) {\n if (token instanceof SubOperator) {\n token = negationCheck(token, prevToken);\n }\n getTokenQueue().enqueue(token);\n prevToken = token;\n token = tokenizer.nextToken();\n }\n }", "public static EvaluationStep getBinaryOperation(final String theOperator)\n {\n if(\"+\".equals(theOperator)) return Addition;\n if(\"-\".equals(theOperator)) return Subtraction;\n if(\"*\".equals(theOperator)) return Mulitplication;\n if(\"/\".equals(theOperator)) return Division;\n if(\"^\".equals(theOperator)) return Exponentiation;\n throw new IllegalStateException(\"Invalid binary operator ($operator).\".replace(\"$operator\", (null != theOperator) ? theOperator : \"null\"));\n }", "public Equation()\r\n\t{\r\n\t\texpression = \"\";\r\n\t}", "public Expression(Expression exp1, Operator op, Expression exp2) {\r\n\t\t// Remember, this is in postfix notation.\r\n\t\telements.addAll(exp1.elements);\r\n\t\telements.addAll(exp2.elements);\r\n\t\telements.add(op);\r\n\t}", "public UnaryExpNode() {\n }", "private OperatorToken(final CharSequence symbol, final Precedence precedence, final Associativity associativity,\n final Multiplicity multiplicity, final Function<BigDecimal[], BigDecimal> operation) {\n super(symbol, multiplicity, operation);\n this.precedence = precedence;\n this.associativity = associativity;\n }", "public Binary operator(Operator op) {\n\tBinary_c n = (Binary_c) copy();\n\tn.op = op;\n\treturn n;\n }", "public OperatorNode(final Operator operator,\n final int pos) {\n super(pos);\n this.operator = operator;\n }", "public static BinaryOperation Create(IConstraintExpression operand1,\n\t\t\tIConstraintExpression operand2, BinaryOperator operator) {\n\t\tif (BoolBinaryOperators.contains(operator)) {\n\t\t\treturn new BinaryBoolOperation(operand1, operand2, operator);\n\t\t} else {\n\t\t\treturn new BinaryNumericOperation(operand1, operand2, operator);\n\t\t}\n\t}", "public Code visitOperatorNode(ExpNode.OperatorNode node) {\n beginGen(\"Operator\");\n Code code;\n ExpNode args = node.getArg();\n switch (node.getOp()) {\n case ADD_OP:\n code = args.genCode(this);\n code.generateOp(Operation.ADD);\n break;\n case SUB_OP:\n code = args.genCode(this);\n code.generateOp(Operation.NEGATE);\n code.generateOp(Operation.ADD);\n break;\n case MUL_OP:\n code = args.genCode(this);\n code.generateOp(Operation.MPY);\n break;\n case DIV_OP:\n code = args.genCode(this);\n code.generateOp(Operation.DIV);\n break;\n case EQUALS_OP:\n code = args.genCode(this);\n code.generateOp(Operation.EQUAL);\n break;\n case LESS_OP:\n code = args.genCode(this);\n code.generateOp(Operation.LESS);\n break;\n case NEQUALS_OP:\n code = args.genCode(this);\n code.generateOp(Operation.EQUAL);\n code.genBoolNot();\n break;\n case LEQUALS_OP:\n code = args.genCode(this);\n code.generateOp(Operation.LESSEQ);\n break;\n case GREATER_OP:\n /* Generate argument values in reverse order and use LESS */\n code = genArgsInReverse((ExpNode.ArgumentsNode)args);\n code.generateOp(Operation.LESS);\n break;\n case GEQUALS_OP:\n /* Generate argument values in reverse order and use LESSEQ */\n code = genArgsInReverse((ExpNode.ArgumentsNode)args);\n code.generateOp(Operation.LESSEQ);\n break;\n case NEG_OP:\n code = args.genCode(this);\n code.generateOp(Operation.NEGATE);\n break;\n default:\n errors.fatal(\"PL0 Internal error: Unknown operator\",\n node.getLocation());\n code = null;\n }\n endGen(\"Operator\");\n return code;\n }", "@Override\n public TreeNode parse() {\n TreeNode first = ArithmeticSubexpression.getAdditive(environment).parse();\n if (first == null) return null;\n\n // Try to parse something starting with an operator.\n List<Wrapper> wrappers = RightSideSubexpression.createKleene(\n environment, ArithmeticSubexpression.getAdditive(environment),\n BemTeVicTokenType.EQUAL, BemTeVicTokenType.DIFFERENT,\n BemTeVicTokenType.GREATER_OR_EQUALS, BemTeVicTokenType.GREATER_THAN,\n BemTeVicTokenType.LESS_OR_EQUALS, BemTeVicTokenType.LESS_THAN\n ).parse();\n\n // If did not found anything starting with an operator, return the first node.\n if (wrappers.isEmpty()) return first;\n\n // Constructs a binary operator node containing the expression.\n Iterator<Wrapper> it = wrappers.iterator();\n Wrapper secondWrapper = it.next();\n BinaryOperatorNode second = new BinaryOperatorNode(secondWrapper.getTokenType(), first, secondWrapper.getOutput());\n\n if (wrappers.size() == 1) return second;\n\n // If we reach this far, the expression has more than one operator. i.e. (x = y = z),\n // which is a shortcut for (x = y AND y = z).\n\n // Firstly, determine if the operators are compatible.\n RelationalOperatorSide side = RelationalOperatorSide.NONE;\n for (Wrapper w : wrappers) {\n side = side.next(w.getTokenType());\n }\n if (side.isMixed()) {\n environment.emitError(\"XXX\");\n }\n\n // Creates the other nodes. In the expression (a = b = c = d), The \"a = b\"\n // is in the \"second\" node. Creates \"b = c\", and \"c = d\" nodes.\n List<BinaryOperatorNode> nodes = new LinkedList<BinaryOperatorNode>();\n nodes.add(second);\n\n TreeNode prev = secondWrapper.getOutput();\n while (it.hasNext()) {\n Wrapper w = it.next();\n BinaryOperatorNode current = new BinaryOperatorNode(w.getTokenType(), prev, w.getOutput());\n prev = w.getOutput();\n nodes.add(current);\n }\n\n // Combines all of the nodes in a single one using AND.\n return new VariableArityOperatorNode(BemTeVicTokenType.AND, nodes);\n }", "public MathEquation(char opCode) {\n this.opCode = opCode;\n }", "@Test\n public void operator_literal() {\n OutputNode output = new OutputNode(\"testing\", typeOf(Result.class), typeOf(String.class));\n OperatorNode operator = new OperatorNode(\n classOf(SimpleOp.class), typeOf(Result.class), typeOf(String.class),\n output, new ValueElement(valueOf(\"???\")));\n InputNode root = new InputNode(operator);\n MockContext context = new MockContext();\n testing(root, context, op -> {\n op.process(\"Hello, world!\");\n });\n assertThat(context.get(\"testing\"), contains(\"Hello, world!???\"));\n }", "@Override\r\n\tpublic Object visitBinaryExpression(BinaryExpression binaryExpression,\r\n\t\t\tObject arg) throws Exception {\r\n\t\tString expr0Type = (String) binaryExpression.expression0.visit(this,arg);\r\n\t\tString expr1Type = (String) binaryExpression.expression1.visit(this,arg);\r\n\t\tKind op = binaryExpression.op.kind;\r\n\t\tcheck(expr0Type.equals(expr1Type), \"uncompatible bianry expression\", binaryExpression);\r\n\t\tswitch(op) {\r\n\t\tcase PLUS:\r\n\t\t\tcheck(expr0Type.equals(intType) || expr0Type == stringType, \"operator \" + op.toString() + \" is not defined for \" + expr0Type, binaryExpression);\r\n\t\t\tbreak;\r\n\t\tcase MINUS:\tcase TIMES:\tcase DIV:\t\t\t\r\n\t\t\tcheck(expr0Type.equals(intType), \"operator \" + op.toString() + \" is not defined for \" + expr0Type, binaryExpression);\r\n\t\t\tbreak;\r\n\t\tcase EQUAL:\tcase NOTEQUAL:\r\n\t\t\tif (expr0Type.equals(booleanType) || expr0Type.equals(intType) ||expr0Type.equals(stringType)) {\r\n\t\t\t\tbinaryExpression.setType(booleanType);\r\n\t\t\t\treturn booleanType;\r\n\t\t\t} else {\r\n\t\t\t\tthrow new TypeCheckException(\"operator \" + op.toString() + \" is not defined for \" + expr0Type, binaryExpression);\r\n\t\t\t}\t\r\n\t\tcase LT: case GT: case LE: case GE:\r\n\t\t\tif (expr0Type.equals(booleanType) || expr0Type.equals(intType)) {\r\n\t\t\t\tbinaryExpression.setType(booleanType);\r\n\t\t\t\treturn booleanType;\r\n\t\t\t} else {\r\n\t\t\t\tthrow new TypeCheckException(\"operator \" + op.toString() + \" is not defined for \" + expr0Type, binaryExpression);\r\n\t\t\t}\t\t\r\n\t\tcase LSHIFT: case RSHIFT:\r\n\t\t\tcheck(expr0Type.equals(intType), \"operator \" + op.toString() + \" is not defined for \" + expr0Type, binaryExpression);\r\n\t\t\tbreak;\r\n\t\tcase BAR: case AND:\r\n\t\t\tcheck(expr0Type.equals(booleanType), \"operator \" + op.toString() + \" is not defined for \" + expr0Type, binaryExpression);\r\n\t\t\tbreak;\r\n\t\tdefault:\r\n\t\t\tthrow new TypeCheckException(\"operator \" + op.toString() + \" is not defined for \" + expr0Type, binaryExpression);\r\n\t\t} \t\r\n\t\tbinaryExpression.setType(expr0Type);\r\n\t\treturn expr0Type;\r\n\t}", "Expression createExpression();", "private Operator checkOperator(char c){\n if (c == '+'){\n return new AddOperator(); \n }\n else if (c == '-'){\n return new SubOperator(); \n }\n else if (c == '*'){\n return new MulOperator(); \n }\n else if (c == '/'){\n return new DivOperator(); \n }\n else \n return null;\n }", "public static BinaryExpression makeBinary(ExpressionType binaryType, Expression expression0, Expression expression1) { throw Extensions.todo(); }", "ExpOperand createExpOperand();", "public TreeNode(TreeNode left, TreeNode right, char operand){\n\t\tthis.left = left;\n\t\tthis.right = right;\n\t\tthis.operand = operand;\n\t\tthis.type = \"op\";\n\n\t}", "public Expression(String expr) {\n this.expr = expr;\n scalars = null;\n arrays = null;\n openingBracketIndex = null;\n closingBracketIndex = null;\n }", "public OperatorNode(String left, String right, Operator oper, OperatorTable opers) throws IllegalArgumentException {\n this.opers = opers;\n this.oper = oper;\n this.parseExpression(left, right);\n }", "public Command createOperationCommand(int operator, Operand operand1, Operand operand2);", "public ChainOperator(){\n\n }", "Operator operator();", "public ParenthesisCalculator() {\n this(\"Calculator With Operator Precedence and Parentheses\");\n }", "public SqlComparisonExpression(final SqlComparisonOperator operator) {\n this.operator = operator;\n }", "private void processOperator() {\r\n\t\tif (expression[currentIndex] == '*') {\r\n\t\t\ttoken = new Token(TokenType.OPERATOR, Constants.AND_STRING);\r\n\t\t} else if (expression[currentIndex] == '+') {\r\n\t\t\ttoken = new Token(TokenType.OPERATOR, Constants.OR_STRING);\r\n\t\t} else if (expression[currentIndex] == '!') {\r\n\t\t\ttoken = new Token(TokenType.OPERATOR, Constants.NOT_STRING);\r\n\t\t} else {\r\n\t\t\ttoken = new Token(TokenType.OPERATOR, Constants.XOR_STRING);\r\n\t\t\t// xor operator has 2 characters more than any other operator.\r\n\t\t\tcurrentIndex += 2;\r\n\t\t}\r\n\r\n\t\tcurrentIndex++;\r\n\t}", "public void setOperator(String operator) {\n this.operator = operator;\n }", "public interface Unary extends Expr \n{\n /** Unary expression operator. */\n public static enum Operator {\n BIT_NOT (\"~\", true),\n NEG (\"-\", true),\n POST_INC (\"++\", false),\n POST_DEC (\"--\", false),\n PRE_INC (\"++\", true),\n PRE_DEC (\"--\", true),\n POS (\"+\", true),\n NOT (\"!\", true),\n CARET (\"^\", true),\n BAR (\"|\", true),\n AMPERSAND(\"&\", true),\n STAR (\"*\", true),\n SLASH (\"/\", true),\n PERCENT (\"%\", true);\n\n protected boolean prefix;\n protected String name;\n\n private Operator(String name, boolean prefix) {\n this.name = name;\n this.prefix = prefix;\n }\n\n /** Returns true of the operator is a prefix operator, false if\n * postfix. */\n public boolean isPrefix() { return prefix; }\n\n @Override public String toString() { return name; }\n }\n\n public static final Operator BIT_NOT = Operator.BIT_NOT;\n public static final Operator NEG = Operator.NEG;\n public static final Operator POST_INC = Operator.POST_INC;\n public static final Operator POST_DEC = Operator.POST_DEC;\n public static final Operator PRE_INC = Operator.PRE_INC;\n public static final Operator PRE_DEC = Operator.PRE_DEC;\n public static final Operator POS = Operator.POS;\n public static final Operator NOT = Operator.NOT;\n public static final Operator CARET = Operator.CARET;\n public static final Operator BAR = Operator.BAR;\n public static final Operator AMPERSAND = Operator.AMPERSAND;\n public static final Operator STAR = Operator.STAR;\n public static final Operator SLASH = Operator.SLASH;\n public static final Operator PERCENT = Operator.PERCENT;\n\n /** The sub-expression on that to apply the operator. */\n Expr expr();\n /** Set the sub-expression on that to apply the operator. */\n Unary expr(Expr e);\n\n /** The operator to apply on the sub-expression. */\n Operator operator();\n /** Set the operator to apply on the sub-expression. */\n Unary operator(Operator o);\n}", "public Element compileExpression() {\n\t\tElement ele = null;\n\t\tString token, tokenType;\n\t\tboolean op;\n\t\tboolean oper = false;\n\t\tString command = \"\";\n\t\tElement expressionParent = document.createElement(\"expression\");\n\n\t\t// if the term-op-term-op cycle breaks, that means its the end of the expression\n\t\tdo {\n\n\t\t\t// At least one term\n\t\t\texpressionParent.appendChild(compileTerm());\n\t\t\t\n\t\t\t//If an operand has been encountered, then can write the command as it is postfix\n\t\t\tif (oper) {\n\t\t\t\twriter.writeCommand(command);\n\t\t\t}\n\t\t\tjackTokenizer clone = new jackTokenizer(jTokenizer);\n\t\t\tclone.advance();\n\t\t\ttoken = clone.presentToken;\n\n\t\t\t// zero or more ops\n\t\t\tif (token.matches(\"\\\\+|-|\\\\*|/|\\\\&|\\\\||<|=|>|~\")) {\n\t\t\t\toper = true;\n\n\t\t\t\tswitch (token) {\n\t\t\t\tcase \"+\":\n\t\t\t\t\tcommand = \"add\";\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"-\":\n\t\t\t\t\tcommand = \"sub\";\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"*\":\n\t\t\t\t\tcommand = \"call Math.multiply 2\";\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"/\":\n\t\t\t\t\tcommand = \"call Math.divide 2\";\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"<\":\n\t\t\t\t\tcommand = \"lt\";\n\t\t\t\t\tbreak;\n\t\t\t\tcase \">\":\n\t\t\t\t\tcommand = \"gt\";\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"=\":\n\t\t\t\t\tcommand = \"eq\";\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"&\":\n\t\t\t\t\tcommand = \"and\";\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"|\":\n\t\t\t\t\tcommand = \"or\";\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\n\t\t\t\tjTokenizer.advance();\n\t\t\t\ttokenType = jTokenizer.tokenType();\n\t\t\t\tele = createXMLnode(tokenType);\n\t\t\t\texpressionParent.appendChild(ele);\n\t\t\t\tjTokenizer.advance();\n\t\t\t\top = true;\n\t\t\t} else {\n\t\t\t\top = false;\n\t\t\t}\n\t\t} while (op);\n\n\t\treturn expressionParent;\n\t}", "private Operator compile(List<Operator> ops, int offset, int length) {\n \n int lLength = findExpression(ops, offset, length);\n \n if (lLength == length){\n \n // Case 1: EXPR\n if (length == 1){\n \n // Return single operator\n return ops.get(offset);\n \n } else if ((ops.get(offset) instanceof PrecedenceOperator) &&\n (ops.get(offset + length - 1) instanceof PrecedenceOperator)){\n \n // Remove brackets\n return compile(ops, offset+1, length-2);\n \n } else {\n throw new RuntimeException(\"Invalid expression\");\n }\n \n } else {\n \n // Case 2: EXPR <OP> EXPR\n if (!(ops.get(offset + lLength) instanceof BinaryOperator)){\n \n // Invalid\n throw new RuntimeException(\"Expecting EXPR <OP> EXPR\");\n } else {\n \n // Binary operator\n BinaryOperator bop = (BinaryOperator)ops.get(offset + lLength);\n bop.left = compile(ops, offset, lLength);\n bop.right = compile(ops, offset + lLength + 1, length - lLength - 1);\n return bop;\n }\n }\n }", "public OpTree(String theOp)\n\t{\n\t\tme = ++total;\n\t\tif (DEBUG) System.out.println(\"Terminal Op \" + me);\n\t\top = theOp;\n\t\tdval = null;\n\t\tleft = null;\n\t\tright = null;\n\t}", "public ConvCalculator(Expression exp){\r\n this();\r\n this.expression = exp;\r\n }", "Operator(String s, Precedence precedence) {\n this.operatorString = s;\n this.precedence = precedence;\n }", "protected Evaluable parseExpression() throws ParsingException {\n Evaluable sub = parseSubExpression();\n\n while (_token != null &&\n _token.type == TokenType.Operator &&\n \">=<==!=\".indexOf(_token.text) >= 0) {\n\n String op = _token.text;\n\n next(true);\n\n Evaluable sub2 = parseSubExpression();\n\n sub = new OperatorCallExpr(new Evaluable[] { sub, sub2 }, op);\n }\n\n return sub;\n }", "public EnbOper() {\n super(Epc.NAMESPACE, \"enb-oper\");\n }", "Operand createOperand();", "@Override\n public NodeType ExecuteOperation()\n {\n //if the first child is an operator\n if(this.childNodes[0].isOperator==true)\n {\n BasicOperator basicOperator=(BasicOperator)this.childNodes[0]; \n if(basicOperator.operands==1)\n {\n UnaryOperator unaryOperator=(UnaryOperator)childNodes[0];\n return unaryOperator.PerformOperation(childNodes[1]);\n }\n else if(basicOperator.operands==2)\n {\n BinaryOperator binaryOperator=(BinaryOperator)childNodes[0];\n return binaryOperator.PerformOperation(childNodes[1], childNodes[2]);\n }\n else if(basicOperator.operands==3)\n {\n TernaryOperator ternaryOperator=(TernaryOperator)childNodes[0];\n return ternaryOperator.PerformOperation(childNodes[1], childNodes[2], childNodes[3]);\n }\n }\n //if not an operator\n else\n {\n return this.childNodes[0].ExecuteOperation();\n }\n return null;\n }", "public static Expression simple(Object ob1, Operator op, Object ob2) {\r\n\t\tExpression exp = new Expression(ob1);\r\n\t\texp.addElement(ob2);\r\n\t\texp.addElement(op);\r\n\t\treturn exp;\r\n\t}", "public BinaryTree(String expression) {\n \tString[] arr = expression.split(\" \");\n \troot = parse(arr);\n }", "public Expression(Object ob) {\r\n\t\tthis();\r\n\t\taddElement(ob);\r\n\t}", "private DoubleBinaryOperator chooseOperator() {\n\t\tswitch(name) {\n\t\tcase \"+\":\n\t\t\treturn ADD;\n\t\t\t\n\t\tcase \"-\":\n\t\t\treturn SUB;\n\t\t\t\n\t\tcase \"*\":\n\t\t\treturn MULTIPLY;\n\t\t\t\n\t\tcase \"/\":\n\t\t\treturn DIVIDE;\n\t\t\t\n\t\tcase \"x^n\":\n\t\t\treturn POW;\n\t\t\t\n\t\tdefault:\n\t\t\tthrow new IllegalStateException(\"Invalid binary operator\");\n\t\t}\n\t}", "JannotTreeJCBinary(InfixExpression n) \n{\n super(n);\n}", "static BinaryOperator<SibillaValue> getOperator(String op) {\n if (op.equals(\"+\")) {return SibillaValue::sum;}\n if (op.equals(\"-\")) {return SibillaValue::sub; }\n if (op.equals(\"%\")) {return SibillaValue::mod; }\n if (op.equals(\"*\")) {return SibillaValue::mul; }\n if (op.equals(\"/\")) {return SibillaValue::div; }\n if (op.equals(\"//\")) {return SibillaValue::zeroDiv; }\n return (x,y) -> SibillaValue.ERROR_VALUE;\n }", "public MathEquation() {\n }", "private IMathExpr parseOperator(String expr, MathBinOper operator,\r\n boolean processLeft2Right) throws InvalidMathExprException {\r\n int startPos, endPos, step;\r\n \r\n if (processLeft2Right) { // Parse expression forwards.\r\n startPos = 0;\r\n endPos = expr.length();\r\n step = 1;\r\n } else { // Parse expression backwards.\r\n startPos = expr.length() - 1;\r\n endPos = -1; // Going backwards, even 0 index counts.\r\n step = -1;\r\n }\r\n \r\n int i = startPos;\r\n while (i != endPos) {\r\n if (this.isOutsideOfBracket(expr, i)) {\r\n char c = expr.charAt(i);\r\n \r\n if (c == operator.getSign()) {\r\n IMathExpr left = new MathExpr(expr.substring(0, i));\r\n IMathExpr right = new MathExpr(expr.substring(i + 1,\r\n expr.length()));\r\n \r\n return MathBinOper.buildBinaryOper(operator, left, right);\r\n }\r\n }\r\n \r\n i += step;\r\n }\r\n \r\n return null;\r\n }", "private Expr comparison() {\n Expr expr = addition();\n\n while(match(GREATER, GREATER_EQUAL, LESS, LESS_EQUAL)) { // These variable length arguments are real convenient\n Token operator = previous();\n Expr right = addition();\n expr = new Expr.Binary(expr, operator, right);\n }\n\n return expr;\n }", "public String operator( String op);", "public MathEval() {\r\n super();\r\n\r\n constants=new TreeMap<String,Double>(String.CASE_INSENSITIVE_ORDER);\r\n setConstant(\"E\" ,Math.E);\r\n setConstant(\"Euler\" ,0.577215664901533D);\r\n setConstant(\"LN2\" ,0.693147180559945D);\r\n setConstant(\"LN10\" ,2.302585092994046D);\r\n setConstant(\"LOG2E\" ,1.442695040888963D);\r\n setConstant(\"LOG10E\",0.434294481903252D);\r\n setConstant(\"PHI\" ,1.618033988749895D);\r\n setConstant(\"PI\" ,Math.PI);\r\n\r\n variables=new TreeMap<String,Double>(String.CASE_INSENSITIVE_ORDER);\r\n\r\n functions=new TreeMap<String,FunctionHandler>(String.CASE_INSENSITIVE_ORDER);\r\n\r\n offset=0;\r\n isConstant=false;\r\n }", "@Override\n\tpublic List<Component> caseExprBinary(ExprBinary expr) {\n\t\tint sizeInBits = assignTarget.getVariable().getType().getSizeInBits();\n\t\t// Get the Variables\n\t\tVar e1 = ((ExprVar) expr.getE1()).getUse().getVariable();\n\t\tVar e2 = ((ExprVar) expr.getE2()).getUse().getVariable();\n\t\tList<Var> inVars = new ArrayList<Var>();\n\t\tinVars.add(e1);\n\t\tinVars.add(e2);\n\t\t// Component component = null;\n\t\tif (expr.getOp() == OpBinary.BITAND) {\n\t\t\tcurrentComponent = new AndOp();\n\t\t} else if (expr.getOp() == OpBinary.BITOR) {\n\t\t\tcurrentComponent = new OrOp();\n\t\t} else if (expr.getOp() == OpBinary.BITXOR) {\n\t\t\tcurrentComponent = new XorOp();\n\t\t} else if (expr.getOp() == OpBinary.DIV) {\n\t\t\tcurrentComponent = new DivideOp(sizeInBits);\n\t\t} else if (expr.getOp() == OpBinary.DIV_INT) {\n\t\t\tcurrentComponent = new DivideOp(sizeInBits);\n\t\t} else if (expr.getOp() == OpBinary.EQ) {\n\t\t\tcurrentComponent = new EqualsOp();\n\t\t} else if (expr.getOp() == OpBinary.GE) {\n\t\t\tcurrentComponent = new GreaterThanEqualToOp();\n\t\t} else if (expr.getOp() == OpBinary.GT) {\n\t\t\tcurrentComponent = new GreaterThanOp();\n\t\t} else if (expr.getOp() == OpBinary.LE) {\n\t\t\tcurrentComponent = new LessThanEqualToOp();\n\t\t} else if (expr.getOp() == OpBinary.LOGIC_AND) {\n\t\t\tcurrentComponent = new And(2);\n\t\t} else if (expr.getOp() == OpBinary.LOGIC_OR) {\n\t\t\tcurrentComponent = new Or(2);\n\t\t} else if (expr.getOp() == OpBinary.LT) {\n\t\t\tcurrentComponent = new LessThanOp();\n\t\t} else if (expr.getOp() == OpBinary.MINUS) {\n\t\t\tcurrentComponent = new SubtractOp();\n\t\t} else if (expr.getOp() == OpBinary.MOD) {\n\t\t\tcurrentComponent = new ModuloOp();\n\t\t} else if (expr.getOp() == OpBinary.NE) {\n\t\t\tcurrentComponent = new NotEqualsOp();\n\t\t} else if (expr.getOp() == OpBinary.PLUS) {\n\t\t\tcurrentComponent = new AddOp();\n\t\t} else if (expr.getOp() == OpBinary.SHIFT_LEFT) {\n\t\t\tint log2N = MathStuff.log2(sizeInBits);\n\t\t\tcurrentComponent = new LeftShiftOp(log2N);\n\t\t} else if (expr.getOp() == OpBinary.SHIFT_RIGHT) {\n\t\t\tint log2N = MathStuff.log2(sizeInBits);\n\t\t\tcurrentComponent = new RightShiftOp(log2N);\n\t\t} else if (expr.getOp() == OpBinary.TIMES) {\n\t\t\tcurrentComponent = new MultiplyOp(expr.getType().getSizeInBits());\n\t\t}\n\t\t// currentComponent.setNonRemovable();\n\t\tPortUtil.mapInDataPorts(currentComponent, inVars, portDependency,\n\t\t\t\tportGroupDependency);\n\t\treturn null;\n\t}", "public Calculator() {\r\n\t\tsuper();\r\n\t}", "private static OperatorBuilder binary(String symbol, DoubleBinaryOperator binaryOp, Type type) {\n if (binaryOp == null) {\n throw new IllegalArgumentException(\"operator argument must not be null\");\n }\n if (type.arity() != 2) {\n throw new IllegalArgumentException(\"type argument must be INFIXL, INFIXN, or INFIXR\");\n }\n // XXX ensure valid symbol\n return new OperatorBuilder(null, binaryOp, symbol, 10, type);\n }", "public InvalidOperatorException(char op){\n super(LocalizationHelper.getMessage(LocalizationHelper.Message.INVALID_OPERATOR, Character.toString(op)));\n }", "public static Operator CreateFromString(String Str) {\n char Sym = Str.charAt(0);\n if (Sym == '+')\n return new OperatorAdd();\n else if (Sym == '-')\n return new OperatorSub();\n else if (Sym == '*')\n return new OperatorProd();\n else if (Sym == '/')\n return new OperatorDev();\n else if (Sym == '^')\n return new OperatorPow();\n else if (Sym == '(')\n return new OperatorOpBrack();\n else if (Sym == ')')\n return new OperatorClBrack();\n else if (Str.equals(\"cos\"))\n return new OperatorCos();\n else if (Str.equals(\"sin\"))\n return new OperatorSin();\n else if (Str.equals(\"tan\"))\n return new OperatorTan();\n else if (Str.equals(\"arcsin\"))\n return new OperatorAsin();\n else if (Str.equals(\"arccos\"))\n return new OperatorAcos();\n else if (Str.equals(\"arctan\"))\n return new OperatorAtan();\n else if (Str.equals(\"abs\"))\n return new OperatorAbs();\n else if (Str.equals(\"fact\"))\n return new OperatorFact();\n else if (Str.equals(\"to_rad\"))\n return new OperatorToRad();\n else if (Str.equals(\"ln\"))\n return new OperatorLn();\n else if (Str.equals(\"log\"))\n return new OperatorLog();\n return new Operator(0, -1);\n }", "public void setOperator(String incomingOperator)\r\n {\r\n \r\n operator = incomingOperator;\r\n \r\n }", "@Override\n protected HardwareNode visit(BinaryExpressionASTNode node) throws Exception {\n var lnode = visit(node.getLeft());\n var rnode = visit(node.getRight());\n\n HardwareExpression finalexpr = null;\n String op = node.getOperator().getAsString();\n switch (op) {\n case \"+\":\n finalexpr = new AdditionExpression((HardwareExpression) lnode, (HardwareExpression) rnode);\n break;\n case \"-\":\n finalexpr = new SubtractionExpression((HardwareExpression) lnode, (HardwareExpression) rnode);\n break;\n case \"*\":\n finalexpr = new MultiplicationExpression((HardwareExpression) lnode, (HardwareExpression) rnode);\n break;\n case \"<<\":\n finalexpr = new LeftShiftExpression((HardwareExpression) lnode, (HardwareExpression) rnode);\n break;\n case \"&\":\n finalexpr = new BitWiseAndExpression((HardwareExpression) lnode, (HardwareExpression) rnode);\n break;\n case \"==\":\n finalexpr = new ComparisonExpression((HardwareExpression) lnode, (HardwareExpression) rnode);\n break;\n default:\n // finalexpr = new UnimplementedExpression((HardwareExpression) lnode, (HardwareExpression) rnode, op);\n throw new UnimplementedExpressionException(node.getAsString());\n }\n\n return new ParenthesisExpression(finalexpr);\n }", "public static Operator fromText(@NonNull String text) {\n\t\t\tfor (Operator o : Operator.values()) {\n\t\t\t\tif (o.value.equals(text)) {\n\t\t\t\t\treturn o;\n\t\t\t\t}\n\t\t\t}\n\t\t\tthrow new IllegalArgumentException(\n\t\t\t\tSafeResourceLoader.getStringFormatted(\"UNKNOWN_OPERATOR\",\n\t\t\t\t\tScriptManager.getResourceBundle(), text));\n\t\t}", "public StandardCalculator init() {\n this.load(\"+\", this.add());\n this.load(\"-\", this.subtract());\n this.load(\"*\", this.multiple());\n this.load(\"/\", this.div());\n return this;\n }", "public Equation() {\n alpha_arr = new ArrayList<LinkedList<VariableUnit>>();\n for (int i = 0; i < 26; i++) {\n LinkedList<VariableUnit> list = new LinkedList<VariableUnit>();\n alpha_arr.add(list);\n }\n \n op_order = new LinkedList<VariableUnit>();\n }", "protected UnaryExpNode(ExpNode expr) {\n this.expr = expr;\n }", "public static Expression parse(String exp) {\n\t\texp = exp.replace(\" \", \"\");\r\n\t\tchar[] cs = exp.toCharArray();\r\n\t\tint i = 0;\r\n\t\twhile (i < cs.length && !Operator.validOp(cs[i])) {\r\n\t\t\t++i;\r\n\t\t}\r\n\t\tif (i == cs.length)\r\n\t\t\treturn new Expression(Token.parse(exp));\r\n\t\telse {\r\n\t\t\t//to preserve order of operations here, flip order accordingly\r\n\t\t\t//if the operator is * or /\r\n\t\t\treturn new Expression(\r\n\t\t\t\t\tExpression.parse(exp.substring(0,i)),\r\n\t\t\t\t\t(Operator)Token.parse(cs[i]),\r\n\t\t\t\t\tExpression.parse(exp.substring(i+1, exp.length()))\r\n\t\t\t);\r\n\t\t}\r\n\t}", "public Expression() {\r\n\t\ttext = new StringBuffer();\r\n\t\txttext = new StringBuffer();\r\n\t}", "@Test\n\t\tpublic void testExpression() throws LexicalException, SyntaxException {\n\t\t\tString input = \"x + 2\";\n\t\t\tPLPParser parser = makeParser(input);\n\t\t\tExpression e = parser.expression(); //call expression here instead of parse\n\t\t\tshow(e);\t\n\t\t\tassertEquals(ExpressionBinary.class, e.getClass());\n\t\t\tExpressionBinary b = (ExpressionBinary)e;\n\t\t\tassertEquals(ExpressionIdentifier.class, b.leftExpression.getClass());//\n\t\t\tExpressionIdentifier left = (ExpressionIdentifier)b.leftExpression;\n\t\t\tassertEquals(\"x\", left.name);\n\t\t\tassertEquals(ExpressionIntegerLiteral.class, b.rightExpression.getClass());\n\t\t\tExpressionIntegerLiteral right = (ExpressionIntegerLiteral)b.rightExpression;\n\t\t\tassertEquals(2, right.value);\n\t\t\tassertEquals(OP_PLUS, b.op);\n\t\t}", "Unary operator(Operator o);", "@Test\n public void defaultOperatorsEvaluteTrueTest() throws Exception {\n\n assertThat(getNode(\"1 == 1\", \"expr\").render(null), is((Object)true));\n assertThat(getNode(\"1 != 2\", \"expr\").render(null), is((Object)true));\n assertThat(getNode(\"1 <> 2\", \"expr\").render(null), is((Object)true));\n assertThat(getNode(\"1 < 2\", \"expr\").render(null), is((Object)true));\n assertThat(getNode(\"2 > 1\", \"expr\").render(null), is((Object)true));\n assertThat(getNode(\"1 >= 1\", \"expr\").render(null), is((Object)true));\n assertThat(getNode(\"2 >= 1\", \"expr\").render(null), is((Object)true));\n assertThat(getNode(\"1 <= 2\", \"expr\").render(null), is((Object)true));\n assertThat(getNode(\"1 <= 1\", \"expr\").render(null), is((Object)true));\n\n // negative numbers\n assertThat(getNode(\"1 > -1\", \"expr\").render(null), is((Object)true));\n assertThat(getNode(\"-1 < 1\", \"expr\").render(null), is((Object)true));\n assertThat(getNode(\"1.0 > -1.0\", \"expr\").render(null), is((Object)true));\n assertThat(getNode(\"-1.0 < 1.0\", \"expr\").render(null), is((Object)true));\n }", "private void setOperatorToken() {\n\t\t\n\t\tif (currentIndex + 1 >= data.length)\n\t\t\tthrow new QueryLexerException(\"Invalid input. After operator must come text\");\n\t\t\n\t\tif (isOperator(data[currentIndex + 1])) {\n\t\t\t// two symbol operator\n\t\t\t\tif(data[currentIndex + 1] != '=') \n\t\t\t\t\tthrow new QueryLexerException(\"Invalid operator.\");\n\t\t\t\t\n\t\t\t\tif(data[currentIndex] == '=')\n\t\t\t\t\tthrow new QueryLexerException(\"Invalid operator.\");\n\t\t\t\t\n\t\t\t\tString operator = new String(data, currentIndex, 2);\n\t\t\t\ttoken = new Token(TokenType.OPERATOR, operator);\n\t\t\t\tcurrentIndex += 2;\n\t\t} else {\n\t\t\t// just one symbol operator\n\t\t\tif (data[currentIndex] == '!')\n\t\t\t\tthrow new QueryLexerException(\"Invalid operator.\");\n\t\t\t\n\t\t\ttoken = new Token(TokenType.OPERATOR, String.valueOf(data[currentIndex]));\n\t\t\tcurrentIndex++;\n\t\t}\n\t}", "public Decisao(Expressao expr, Comando cmdIf) {\r\n\t\tthis.expressao = expr;\r\n\t\tthis.comandoIf = cmdIf;\r\n\t}", "BinaryOperation(final String binOperation, final int prior) {\n operation = binOperation;\n priority = prior;\n }", "@Override\n\t\t\tpublic Ast binaryOp(BinaryOp ast, Void arg) {\n\t\t\t\tsuper.binaryOp(ast, arg);\n\n\t\t\t\ttry {\n\t\t\t\t\tExpr left = ast.left();\n\t\t\t\t\tExpr right = ast.right();\n\t\t\t\t\tInteger intValue = null;\n\t\t\t\t\tBoolean boolValue = null;\n\n\t\t\t\t\tswitch (ast.operator) {\n\t\t\t\t\tcase B_TIMES:\n\t\t\t\t\t\tintValue = asInt(left) * asInt(right);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase B_DIV:\n\t\t\t\t\t\tintValue = asInt(left) / asInt(right);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase B_MOD:\n\t\t\t\t\t\tintValue = asInt(left) % asInt(right);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase B_PLUS:\n\t\t\t\t\t\tintValue = asInt(left) + asInt(right);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase B_MINUS:\n\t\t\t\t\t\tintValue = asInt(left) - asInt(right);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase B_AND:\n\t\t\t\t\t\tboolValue = asBool(left) && asBool(right);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase B_OR:\n\t\t\t\t\t\tboolValue = asBool(left) || asBool(right);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase B_LESS_THAN:\n\t\t\t\t\t\tboolValue = asInt(left) < asInt(right);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase B_LESS_OR_EQUAL:\n\t\t\t\t\t\tboolValue = asInt(left) <= asInt(right);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase B_GREATER_THAN:\n\t\t\t\t\t\tboolValue = asInt(left) > asInt(right);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase B_GREATER_OR_EQUAL:\n\t\t\t\t\t\tboolValue = asInt(left) >= asInt(right);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase B_EQUAL:\n\t\t\t\t\t\tboolValue = areEqual(left, right);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase B_NOT_EQUAL:\n\t\t\t\t\t\tboolValue = areEqual(left, right);\n\t\t\t\t\t\tif (boolValue != null)\n\t\t\t\t\t\t\tboolValue = !boolValue;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\n\t\t\t\t\treturn replace(ast, intValue, boolValue);\n\t\t\t\t} catch (NotConstantException exc) {\n\t\t\t\t\t// non-constant operands: make no change.\n\t\t\t\t\treturn ast;\n\t\t\t\t} catch (ArithmeticException exc) {\n\t\t\t\t\t// division by zero etc: make no change.\n\t\t\t\t\treturn ast;\n\t\t\t\t}\n\t\t\t}", "public LowPrecedenceNode(ArrayList<HighPrecedenceNode> highPrecedenceNodes, ArrayList<Enums.Operator> operators) {\n //Check for illegal operators\n if (!(operators.contains(Enums.Operator.ADD) || operators.contains(Enums.Operator.SUB))) {\n throw new CompilerException(\"MUL, DIV & MOD are not Low Precedence\", getCodePosition());\n }\n this.highPrecedenceNodes = highPrecedenceNodes;\n this.operators = operators;\n }", "protected RealExpression() {\r\n super();\r\n }", "public Unary() {\n }", "static boolean binaryOperator(PsiBuilder b, int l) {\n if (!recursion_guard_(b, l, \"binaryOperator\")) return false;\n boolean r;\n r = multiplicativeOperator(b, l + 1);\n if (!r) r = additiveOperator(b, l + 1);\n if (!r) r = shiftOperator(b, l + 1);\n if (!r) r = relationalOperator(b, l + 1);\n if (!r) r = consumeToken(b, EQ_EQ);\n if (!r) r = bitwiseOperator(b, l + 1);\n return r;\n }", "public Conditional(){\n\t\tint m,n;\n\t\tLexer.lex();//skip over \"if\"\n\t\tLexer.lex();//skip over '('\n\t\tcpr=new ComparisonExpr();\n\t\tLexer.lex();//skip over ')'\n\t\tswitch(cpr.op){\n\t\tcase '<':\n\t\t\tCode.gen(\"if_icmpge \");\n\t\t\tbreak;\n\t\tcase '>':\n\t\t\tCode.gen(\"if_icmple \");\n\t\t\tbreak;\n\t\tcase '=':\n\t\t\tCode.gen(\"if_icmpne \");\n\t\t\tbreak;\n\t\tcase '!':\n\t\t\tCode.gen(\"if_icmpeq \");\n\t\t\tbreak;\n\t\tdefault:\n\t\t\tbreak;\n\t\t}\n\t\tn=Code.getPtr();\n\t\tCode.gen(\"\");\n\t\tCode.gen(\"\");\n\t\tstmt=new Statement();\n\t\tif(Lexer.nextToken==Token.KEY_ELSE){//have an else part\n\t\t\tCode.gen(\"goto \");\n\t\t\tm=Code.getPtr();\n\t\t\tCode.gen(\"\");\n\t\t\tCode.gen(\"\");\n\t\t\tCode.backpatch(n, Integer.toString(Code.getPtr()));\n\t\t\tLexer.lex();\n\t\t\tstmtr=new Statement();\n\t\t\tCode.backpatch(m, Integer.toString(Code.getPtr()));\n\t\t}else{\n\t\t\tCode.backpatch(n, Integer.toString(Code.getPtr()));\n\t\t}\n\t\t\n\t}", "public final SymbolNode getOperator() { return this.operator; }", "public void setOperator(int opr) {\n this.operator = opr;\n }", "public void setOperator(Operator_PJ o1) {\n\t\t\n\t}", "public final JavaliParser.expr_return expr() throws RecognitionException {\n\t\tJavaliParser.expr_return retval = new JavaliParser.expr_return();\n\t\tretval.start = input.LT(1);\n\n\t\tObject root_0 = null;\n\n\t\tParserRuleReturnScope leftExpr =null;\n\t\tParserRuleReturnScope op =null;\n\t\tParserRuleReturnScope rightExpr =null;\n\n\t\tRewriteRuleSubtreeStream stream_simpleExpr=new RewriteRuleSubtreeStream(adaptor,\"rule simpleExpr\");\n\t\tRewriteRuleSubtreeStream stream_compOp=new RewriteRuleSubtreeStream(adaptor,\"rule compOp\");\n\n\t\ttry {\n\t\t\t// /home/luca/svn-repos/cd_students/2015ss/master/CD2_A1/src/cd/parser/Javali.g:427:2: (leftExpr= simpleExpr ( -> $leftExpr|op= compOp rightExpr= simpleExpr -> ^( BinaryOp[$op.start, \\\"BinaryOp\\\"] $leftExpr compOp $rightExpr) ) )\n\t\t\t// /home/luca/svn-repos/cd_students/2015ss/master/CD2_A1/src/cd/parser/Javali.g:427:4: leftExpr= simpleExpr ( -> $leftExpr|op= compOp rightExpr= simpleExpr -> ^( BinaryOp[$op.start, \\\"BinaryOp\\\"] $leftExpr compOp $rightExpr) )\n\t\t\t{\n\t\t\tpushFollow(FOLLOW_simpleExpr_in_expr1531);\n\t\t\tleftExpr=simpleExpr();\n\t\t\tstate._fsp--;\n\n\t\t\tstream_simpleExpr.add(leftExpr.getTree());\n\t\t\t// /home/luca/svn-repos/cd_students/2015ss/master/CD2_A1/src/cd/parser/Javali.g:428:3: ( -> $leftExpr|op= compOp rightExpr= simpleExpr -> ^( BinaryOp[$op.start, \\\"BinaryOp\\\"] $leftExpr compOp $rightExpr) )\n\t\t\tint alt25=2;\n\t\t\tint LA25_0 = input.LA(1);\n\t\t\tif ( (LA25_0==70||LA25_0==73||LA25_0==77) ) {\n\t\t\t\talt25=1;\n\t\t\t}\n\t\t\telse if ( (LA25_0==66||(LA25_0 >= 78 && LA25_0 <= 79)||(LA25_0 >= 81 && LA25_0 <= 83)) ) {\n\t\t\t\talt25=2;\n\t\t\t}\n\n\t\t\telse {\n\t\t\t\tNoViableAltException nvae =\n\t\t\t\t\tnew NoViableAltException(\"\", 25, 0, input);\n\t\t\t\tthrow nvae;\n\t\t\t}\n\n\t\t\tswitch (alt25) {\n\t\t\t\tcase 1 :\n\t\t\t\t\t// /home/luca/svn-repos/cd_students/2015ss/master/CD2_A1/src/cd/parser/Javali.g:429:4: \n\t\t\t\t\t{\n\t\t\t\t\t// AST REWRITE\n\t\t\t\t\t// elements: leftExpr\n\t\t\t\t\t// token labels: \n\t\t\t\t\t// rule labels: leftExpr, retval\n\t\t\t\t\t// token list labels: \n\t\t\t\t\t// rule list labels: \n\t\t\t\t\t// wildcard labels: \n\t\t\t\t\tretval.tree = root_0;\n\t\t\t\t\tRewriteRuleSubtreeStream stream_leftExpr=new RewriteRuleSubtreeStream(adaptor,\"rule leftExpr\",leftExpr!=null?leftExpr.getTree():null);\n\t\t\t\t\tRewriteRuleSubtreeStream stream_retval=new RewriteRuleSubtreeStream(adaptor,\"rule retval\",retval!=null?retval.getTree():null);\n\n\t\t\t\t\troot_0 = (Object)adaptor.nil();\n\t\t\t\t\t// 429:4: -> $leftExpr\n\t\t\t\t\t{\n\t\t\t\t\t\tadaptor.addChild(root_0, stream_leftExpr.nextTree());\n\t\t\t\t\t}\n\n\n\t\t\t\t\tretval.tree = root_0;\n\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\tcase 2 :\n\t\t\t\t\t// /home/luca/svn-repos/cd_students/2015ss/master/CD2_A1/src/cd/parser/Javali.g:430:5: op= compOp rightExpr= simpleExpr\n\t\t\t\t\t{\n\t\t\t\t\tpushFollow(FOLLOW_compOp_in_expr1552);\n\t\t\t\t\top=compOp();\n\t\t\t\t\tstate._fsp--;\n\n\t\t\t\t\tstream_compOp.add(op.getTree());\n\t\t\t\t\tpushFollow(FOLLOW_simpleExpr_in_expr1556);\n\t\t\t\t\trightExpr=simpleExpr();\n\t\t\t\t\tstate._fsp--;\n\n\t\t\t\t\tstream_simpleExpr.add(rightExpr.getTree());\n\t\t\t\t\t// AST REWRITE\n\t\t\t\t\t// elements: compOp, leftExpr, rightExpr\n\t\t\t\t\t// token labels: \n\t\t\t\t\t// rule labels: leftExpr, retval, rightExpr\n\t\t\t\t\t// token list labels: \n\t\t\t\t\t// rule list labels: \n\t\t\t\t\t// wildcard labels: \n\t\t\t\t\tretval.tree = root_0;\n\t\t\t\t\tRewriteRuleSubtreeStream stream_leftExpr=new RewriteRuleSubtreeStream(adaptor,\"rule leftExpr\",leftExpr!=null?leftExpr.getTree():null);\n\t\t\t\t\tRewriteRuleSubtreeStream stream_retval=new RewriteRuleSubtreeStream(adaptor,\"rule retval\",retval!=null?retval.getTree():null);\n\t\t\t\t\tRewriteRuleSubtreeStream stream_rightExpr=new RewriteRuleSubtreeStream(adaptor,\"rule rightExpr\",rightExpr!=null?rightExpr.getTree():null);\n\n\t\t\t\t\troot_0 = (Object)adaptor.nil();\n\t\t\t\t\t// 431:4: -> ^( BinaryOp[$op.start, \\\"BinaryOp\\\"] $leftExpr compOp $rightExpr)\n\t\t\t\t\t{\n\t\t\t\t\t\t// /home/luca/svn-repos/cd_students/2015ss/master/CD2_A1/src/cd/parser/Javali.g:431:7: ^( BinaryOp[$op.start, \\\"BinaryOp\\\"] $leftExpr compOp $rightExpr)\n\t\t\t\t\t\t{\n\t\t\t\t\t\tObject root_1 = (Object)adaptor.nil();\n\t\t\t\t\t\troot_1 = (Object)adaptor.becomeRoot((Object)adaptor.create(BinaryOp, (op!=null?(op.start):null), \"BinaryOp\"), root_1);\n\t\t\t\t\t\tadaptor.addChild(root_1, stream_leftExpr.nextTree());\n\t\t\t\t\t\tadaptor.addChild(root_1, stream_compOp.nextTree());\n\t\t\t\t\t\tadaptor.addChild(root_1, stream_rightExpr.nextTree());\n\t\t\t\t\t\tadaptor.addChild(root_0, root_1);\n\t\t\t\t\t\t}\n\n\t\t\t\t\t}\n\n\n\t\t\t\t\tretval.tree = root_0;\n\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\n\t\t\t}\n\n\t\t\t}\n\n\t\t\tretval.stop = input.LT(-1);\n\n\t\t\tretval.tree = (Object)adaptor.rulePostProcessing(root_0);\n\t\t\tadaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);\n\n\t\t}\n\n\t\tcatch (RecognitionException re) {\n\t\t\treportError(re);\n\t\t\tthrow re;\n\t\t}\n\n\t\tfinally {\n\t\t\t// do for sure before leaving\n\t\t}\n\t\treturn retval;\n\t}", "public Operation() {\n super();\n }", "public ExpressionTree(String initValue, TreeNode initLeft, TreeNode initRight) {\n\t\tsuper(initValue, initLeft, initRight);\n\t}", "Expr createExpr();", "public interface BinaryOperatorCriteriaExpression<T> extends CriteriaExpression<T> {\n\t/**\n\t * Get the right-hand operand.\n\t *\n\t * @return The right-hand operand.\n\t */\n\tCriteriaExpression<?> getRightHandOperand();\n\n\t/**\n\t * Get the left-hand operand.\n\t *\n\t * @return The left-hand operand.\n\t */\n\tCriteriaExpression<?> getLeftHandOperand();\n}", "public Binary createBinary(Position pos, Expr left, polyglot.ast.Binary.Operator op, Expr right) {\n try {\n return (Binary) xnf.Binary(pos, left, op, right).typeCheck(this);\n } catch (SemanticException e) { \n throw new InternalCompilerError(\"Attempting to synthesize a Binary that cannot be typed\", pos, e);\n }\n }", "public static BinaryExpression makeBinary(ExpressionType binaryType, Expression expression0, Expression expression1, boolean liftToNull, Method method) { throw Extensions.todo(); }", "Operands createOperands();", "public static BinaryOperation Create(IConstraintExpression operand2,\n\t\t\tIConstraintExpression operand1,\n\t\t\tClass<? extends ValueOperatorPtg> operatorClass) {\n\t\tBinaryOperator operator = PtgToBinaryOperator.get(operatorClass);\n\t\treturn Create(operand1, operand2, operator);\n\n\t}", "public OperatorException(final Operator operator, final String message) {\n super(message);\n this.operator = operator;\n }", "public MathEquation(char opCode, double leftVal, double rightVal) {\n this(opCode);\n this.leftVal = leftVal;\n this.rightVal = rightVal;\n }", "@Test\n public void defaultOperatorsEvaluateFalseTest() throws Exception {\n\n assertThat(getNode(\"1 == 2\", \"expr\").render(null), is((Object)false));\n assertThat(getNode(\"1 != 1\", \"expr\").render(null), is((Object)false));\n assertThat(getNode(\"1 <> 1\", \"expr\").render(null), is((Object)false));\n assertThat(getNode(\"1 < 0\", \"expr\").render(null), is((Object)false));\n assertThat(getNode(\"2 > 4\", \"expr\").render(null), is((Object)false));\n assertThat(getNode(\"1 >= 3\", \"expr\").render(null), is((Object)false));\n assertThat(getNode(\"2 >= 4\", \"expr\").render(null), is((Object)false));\n assertThat(getNode(\"1 <= 0\", \"expr\").render(null), is((Object)false));\n }", "public BinaryNode() {\n\t\tthis(null);\t\t\t// Call next constructor\n\t}", "public static BinaryExpression equal(Expression expression0, Expression expression1) { throw Extensions.todo(); }", "public void setOperator(String operator) {\n this.operator = operator == null ? null : operator.trim();\n }", "public void setOperator(String operator) {\n this.operator = operator == null ? null : operator.trim();\n }", "public void setOperator(String operator) {\n this.operator = operator == null ? null : operator.trim();\n }" ]
[ "0.7000462", "0.6747678", "0.66733617", "0.6568737", "0.6522386", "0.65112066", "0.6497198", "0.64465034", "0.6426768", "0.6357289", "0.63292944", "0.62889415", "0.62841374", "0.6273204", "0.62376827", "0.62302643", "0.621958", "0.6211563", "0.6210255", "0.62054235", "0.6149429", "0.6147073", "0.614466", "0.6143308", "0.61410886", "0.6083603", "0.6075377", "0.6064455", "0.6054693", "0.6050893", "0.60296625", "0.6028891", "0.60173017", "0.5989938", "0.596976", "0.59573376", "0.59563524", "0.5920451", "0.5914654", "0.5906752", "0.59016544", "0.5882997", "0.58733386", "0.58713174", "0.58673364", "0.58572733", "0.58533853", "0.5847075", "0.5845095", "0.58435977", "0.58379", "0.58254", "0.5824208", "0.58181167", "0.58181053", "0.58036065", "0.5800793", "0.57899475", "0.5772681", "0.57594967", "0.5756369", "0.57451904", "0.5743152", "0.5742398", "0.5729549", "0.5728095", "0.57278675", "0.57260245", "0.571846", "0.57179743", "0.5710066", "0.57046354", "0.57030994", "0.56960154", "0.56823117", "0.5681572", "0.5674617", "0.5669823", "0.5668708", "0.56608886", "0.56577927", "0.5651626", "0.56366354", "0.56357574", "0.5632964", "0.5627398", "0.5625508", "0.5614696", "0.56074435", "0.5607143", "0.5605699", "0.5588408", "0.5576723", "0.5574323", "0.55730855", "0.55702776", "0.55673933", "0.5563381", "0.5563381", "0.5563381" ]
0.5994805
33
The splitExpression method takes in a String expression and String op. The variable op is passed to the constructor of the arithmetic operator class which is stored in the class variable operator. The index of the first instance of the operator that is found. That is used to generate two substrings which are the left and right sides of the expression. The substrings left are right are passed as parameters to the arithmetic expression constructor and stored in their respective arthmeitic_ex object, left and right.
public void splitExpression(String expression, String op) { operator = new arithmetic_op(op); expression = expression.trim(); int index = expression.indexOf(op); left = new arithmetic_ex((expression.substring(0, index)).trim()); right = new arithmetic_ex((expression.substring(index + 1)).trim()); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static String parseExpressionForOperator(String expression) {\n int space = expression.indexOf(\" \");\n String frac1 = expression.substring(0, space);\n String operator = expression.substring(space + 1, space + 2);\n return operator;\n }", "private IMathExpr parseOperator(String expr, MathBinOper operator,\r\n boolean processLeft2Right) throws InvalidMathExprException {\r\n int startPos, endPos, step;\r\n \r\n if (processLeft2Right) { // Parse expression forwards.\r\n startPos = 0;\r\n endPos = expr.length();\r\n step = 1;\r\n } else { // Parse expression backwards.\r\n startPos = expr.length() - 1;\r\n endPos = -1; // Going backwards, even 0 index counts.\r\n step = -1;\r\n }\r\n \r\n int i = startPos;\r\n while (i != endPos) {\r\n if (this.isOutsideOfBracket(expr, i)) {\r\n char c = expr.charAt(i);\r\n \r\n if (c == operator.getSign()) {\r\n IMathExpr left = new MathExpr(expr.substring(0, i));\r\n IMathExpr right = new MathExpr(expr.substring(i + 1,\r\n expr.length()));\r\n \r\n return MathBinOper.buildBinaryOper(operator, left, right);\r\n }\r\n }\r\n \r\n i += step;\r\n }\r\n \r\n return null;\r\n }", "public static int evaluateExpression(String expression) {\r\n // Create operandStack of ints to store operands\r\n Stack<Integer> operandStack = new Stack<>();\r\n \r\n // Create operatorStack of characters to store operators\r\n Stack<Character> operatorStack = new Stack<>();\r\n \r\n // Insert Blanks\r\n expression = insertBlanks(expression);\r\n \r\n // Extract operands and operators by splitting around blanks\r\n String[] tokens = expression.split(\" \");\r\n \r\n /* Phase 1: Scan tokens\r\n Enhanced for loop, puts every element of tokens in token each time\r\n Like writing token = tokens[i] every time\r\n */\r\n for (String token: tokens) { \r\n if(token.length() == 0) // It's a blank\r\n continue; // Go to the while loop\r\n else if (token.charAt(0) == '+' || token.charAt(0) == '-') {\r\n // process all +, -, *, / in the top of the operator stack\r\n while (!operatorStack.isEmpty() && // While stack isn't empty\r\n (operatorStack.peek() == '+' || // and has an operator on top\r\n operatorStack.peek() == '-' || // Like if you had (2 * 3) + 5 \r\n operatorStack.peek() == '*' || // Or if you had (2 - 3) + 5, do that last no matter what b/c +- is lowest priority\r\n operatorStack.peek() == '/' ||\r\n operatorStack.peek() == '^')) {\r\n processAnOperator(operandStack, operatorStack);\r\n }\r\n \r\n // After processing the all the previous operations, push the +- operator onto the stack\r\n operatorStack.push(token.charAt(0));\r\n }\r\n else if (token.charAt(0) == '*' || token.charAt(0) == '/') {\r\n // Proess all *, / in the top of the operator stack\r\n while(!operatorStack.isEmpty() &&\r\n (operatorStack.peek() == '*' ||\r\n operatorStack.peek() == '/' ||\r\n operatorStack.peek() == '^')) {\r\n processAnOperator(operandStack, operatorStack);\r\n }\r\n \r\n //Push the * or / onto the stack\r\n operatorStack.push(token.charAt(0));\r\n }\r\n else if (token.charAt(0) == '^') {\r\n // Proess all ^ in the top of the operator stack\r\n while(!operatorStack.isEmpty() &&\r\n (operatorStack.peek() == '^')) {\r\n processAnOperator(operandStack, operatorStack);\r\n }\r\n \r\n //Push the ^ onto the stack\r\n operatorStack.push(token.charAt(0));\r\n }\r\n else if(token.trim().charAt(0) == '(') {\r\n operatorStack.push('(');\r\n } \r\n else if(token.trim().charAt(0) == ')') {\r\n while(operatorStack.peek() != '(') {\r\n processAnOperator(operandStack, operatorStack);\r\n }\r\n operatorStack.pop(); // pop\r\n }\r\n else {\r\n operandStack.push(new Integer(token));\r\n }\r\n }\r\n // Phase two: process everything left over\r\n while (!operatorStack.isEmpty()) {\r\n processAnOperator(operandStack, operatorStack);\r\n }\r\n \r\n return operandStack.pop(); \r\n }", "private static String[] getTwoExpr(String expr, String op) {\n\t\t\n\t\tString[] exprArr = new String[2]; \n\t\t\n\t\tint commaPos = SyntaxChecker.checkMatchedParansAndReturnNextDelim(expr, op.length() + 1, ',');\n\t\tString expr1 = expr.substring(op.length() + 1, commaPos);\n\t\texprArr[0] = expr1;\n\t\t\n\t\tint endPos = SyntaxChecker.checkMatchedParansAndReturnNextDelim(expr, commaPos + 1, ')');\n\t\tString expr2 = expr.substring(commaPos + 1, endPos);\n\t\texprArr[1] = expr2;\n\t\t\n\t\treturn exprArr;\n\t}", "private void processOperator() {\r\n\t\tif (expression[currentIndex] == '*') {\r\n\t\t\ttoken = new Token(TokenType.OPERATOR, Constants.AND_STRING);\r\n\t\t} else if (expression[currentIndex] == '+') {\r\n\t\t\ttoken = new Token(TokenType.OPERATOR, Constants.OR_STRING);\r\n\t\t} else if (expression[currentIndex] == '!') {\r\n\t\t\ttoken = new Token(TokenType.OPERATOR, Constants.NOT_STRING);\r\n\t\t} else {\r\n\t\t\ttoken = new Token(TokenType.OPERATOR, Constants.XOR_STRING);\r\n\t\t\t// xor operator has 2 characters more than any other operator.\r\n\t\t\tcurrentIndex += 2;\r\n\t\t}\r\n\r\n\t\tcurrentIndex++;\r\n\t}", "public int eval(String expression) {\n String token;\n // The 3rd argument is true to indicate that the delimiters should be used\n // as tokens, too. \n this.tokenizer = new StringTokenizer(expression, DELIMITERS, true);\n\n //initialized with # operator, used as bogus to compare priorities and detect end of operatorStack.\n operatorStack.push(new PoundOperator());\n\n //Checks whether there are more tokens to be pushed in stacks\n while (this.tokenizer.hasMoreTokens()) {\n // filter out spaces\n if (!(token = this.tokenizer.nextToken()).equals(\" \")) {\n // check if token is an operand\n if (Operand.check(token)) {\n operandStack.push(new Operand(token));\n\n } else {\n if (!Operator.check(token)) {\n System.out.println(\"*****invalid token******\");\n System.exit(1);\n }\n\n //Gets a newOperator it matches from hashmap.\n Operator newOperator = Operator.getToken(token);\n\n //Processes only, when there is greater priority in stack and there are no '('\n while (operatorStack.peek().priority() >= newOperator.priority() && !newOperator.equals(Operator.getToken(\"(\"))) {\n\n //If the token read is ), then there is already '(' which is inserted in the operator stack.\n if (token.equals(\")\")) {\n //Perform until, the '(' is on top of the stack.\n while (!operatorStack.peek().equals(Operator.getToken(\"(\"))) {\n Operator oldOpr = operatorStack.pop();\n Operand op2 = operandStack.pop();\n Operand op1 = operandStack.pop();\n operandStack.push(oldOpr.execute(op1, op2));\n\n }\n\n //If '(' found on top, pop and break, to continue to read more takens\n if (operatorStack.peek().equals(Operator.getToken(\"(\"))) {\n operatorStack.pop();\n break;\n }\n\n } \n //if ')' not found, it means either its in '(' or there are no parenthesis\n else {\n Operator oldOpr = operatorStack.pop();\n Operand op2 = operandStack.pop();\n Operand op1 = operandStack.pop();\n operandStack.push(oldOpr.execute(op1, op2));\n }\n }\n //Pushes the operator, when the operator!=')'\n if (!newOperator.equals(Operator.getToken(\")\"))) {\n operatorStack.push(newOperator);\n }\n }\n }\n }\n // No more tokens to be read. All the tokens are in stacks, gets processed.\n if (!this.tokenizer.hasMoreTokens()) {\n //Keeps processing, until it reaches #\n while (operatorStack.size() != 1) {\n Operator oldOpr = operatorStack.pop();\n //Checks if there are operand left to be used,\n if (!operandStack.empty()) {\n Operand op2 = operandStack.pop();\n Operand op1 = operandStack.pop();\n operandStack.push(oldOpr.execute(op1, op2));\n } else {\n System.exit(1);\n }\n }\n }\n // Returns, the final result\n return operandStack.pop().getValue();\n }", "public static Expression parse(String exp) {\n\t\texp = exp.replace(\" \", \"\");\r\n\t\tchar[] cs = exp.toCharArray();\r\n\t\tint i = 0;\r\n\t\twhile (i < cs.length && !Operator.validOp(cs[i])) {\r\n\t\t\t++i;\r\n\t\t}\r\n\t\tif (i == cs.length)\r\n\t\t\treturn new Expression(Token.parse(exp));\r\n\t\telse {\r\n\t\t\t//to preserve order of operations here, flip order accordingly\r\n\t\t\t//if the operator is * or /\r\n\t\t\treturn new Expression(\r\n\t\t\t\t\tExpression.parse(exp.substring(0,i)),\r\n\t\t\t\t\t(Operator)Token.parse(cs[i]),\r\n\t\t\t\t\tExpression.parse(exp.substring(i+1, exp.length()))\r\n\t\t\t);\r\n\t\t}\r\n\t}", "public binary_ex(String expression) {\n try {\n fullExpression = expression.trim();\n if (expression.contains(\"*\"))\n splitExpression(expression, \"*\");\n else if (expression.contains(\"/\"))\n splitExpression(expression, \"/\");\n else if (expression.contains(\"+\"))\n splitExpression(expression, \"+\");\n else if (expression.contains(\"-\"))\n splitExpression(expression, \"-\");\n else if (expression.contains(\"%\"))\n splitExpression(expression, \"%\");\n else if (expression.contains(\"\\\\\"))\n splitExpression(expression, \"\\\\\");\n else\n throw new JuliaSyntaxException(\"arith\");\n } catch (JuliaSyntaxException e) {\n\n }\n }", "public static String evaluate( String expr )\n {\n\n\tString[] arr = expr.split(\"//s+\");\n\tString ret = \"\";\n\tALStack<String> stack = new ALStack<String>();\n\tfor( String s: arr)\n\t stack.push(s);\n\n\tif( stack.peek().equals(\"(\")){\n\t stack.pop();\n\t int operator = findOp(stack.pop());\n\t ret = unload(operator, stack);\n\t return ret;\n\t}\n\treturn \"\";\n }", "public static List<String> splitByLogicOperators(String str){\n Matcher matcher = logicOperatorPattern.matcher(str);\n List<String> result = new ArrayList<>();\n int start = 0;\n while (matcher.find()) {\n result.add(str.substring(start, matcher.start()).trim());\n result.add(str.substring(matcher.start(), matcher.end()).trim());\n start = matcher.end();\n }\n result.add(str.substring(start, str.length()).trim());\n return result;\n }", "public void parseExpression() {\n String regex = \"[ ]\";\n //\"?<=[-+*/()ep])|(?=[-+*/()ei]\";\n String[] splitString = infix.split(regex);\n infixList.addAll(Arrays.asList(splitString));\n }", "protected Double calculationEngine(String strExpression, List<Character> split) throws Exception {\r\n\t\tPattern prio0 = Pattern.compile(\"[\\\\^]\");\r\n\t\tPattern prio1 = Pattern.compile(\"[\\\\*\\\\/]\");\t\t\r\n\t\t\r\n\t\tDouble result = 0.0;\r\n\t\tList<String> listExpressions = splitExpressions(strExpression, split);\r\n\t\t\r\n\t\tString lastOperator = \"\";\r\n\t\tDouble valueA = 0.0;\r\n\t\tfor(String expression: listExpressions) {\r\n\t\t\t\r\n\t\t\tDouble expressonValue = 0.0;\r\n\t\t\tString [] parseValue = expression.split(\"\\\\|\");\t\t\t\r\n\r\n\t\t\tStringBuilder value = new StringBuilder(parseValue[0]);\t\t\t\t\r\n\t\t\t\r\n\t\t\t\r\n\t\t\tif(value.toString().contains(\"sqrt(\")) {\r\n\t\t\t\tint begin = value.toString().indexOf(\"sqrt(\");\t\t\t\t\r\n\t\t\t\tString content = getParenthesesContent(value.toString(), begin+4);\r\n\t\t\t\tint end = begin + content.length()+6;\r\n\t\t\t\texpressonValue = calculationEngine(content, macroSplit);\t\t\t\t\r\n\t\t\t\texpressonValue = Math.sqrt(expressonValue);\t\t\t\t\r\n\t\t\t\tvalue.delete(begin, end);\r\n\t\t\t\tvalue.insert(begin, expressonValue);\r\n\t\t\t} else if(value.toString().contains(\"(\")) {\r\n\t\t\t\tint begin = value.toString().indexOf(\"(\");\t\t\t\t\r\n\t\t\t\tString content = getParenthesesContent(value.toString(), begin);\r\n\t\t\t\tint end = begin + content.length()+2;\t\t\t\t\t\t\r\n\t\t\t\texpressonValue = calculationEngine(content, macroSplit);\r\n\t\t\t\tvalue.delete(begin, end);\r\n\t\t\t\tvalue.insert(begin, expressonValue);\r\n\t\t\t} \r\n\t\t\tif(prio1.matcher(value).find()) {\r\n\t\t\t\texpressonValue = calculationEngine(value.toString(), microSplit);\r\n\t\t\t} else if(prio0.matcher(value).find()) {\r\n\t\t\t\texpressonValue = calculationEngine(value.toString(), nanoSplit);\r\n\t\t\t} else {\r\n\t\t\t\texpressonValue = Double.valueOf(value.toString().replaceAll(\",\", \".\"));\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif(lastOperator != null && !lastOperator.isEmpty()) {\r\n\t\t\t\tresult = calculate(valueA, expressonValue, lastOperator.charAt(0));\t\t\t\t\r\n\t\t\t} else {\r\n\t\t\t\tresult = expressonValue;\r\n\t\t\t}\r\n\t\t\tvalueA = result;\r\n\t\t\tif(parseValue.length > 1) {\r\n\t\t\t\tlastOperator = expression.split(\"\\\\|\")[1];\r\n\t\t\t}\t\t\t\t\t\t\r\n\t\t}\r\n\t\treturn result;\r\n\t\t\r\n\t}", "public double calculate(String expression) {\n\t\tString[] inputs = expression.split(\" \");\n\t if(debug) {\n\t\tSystem.out.print(\"Input array: \");\n\t\tfor(String value : inputs) {\n\t\t\tSystem.out.print(value + \" \");\n\t\t}\n\t\tSystem.out.println();\n\t }\t\n\t\t\n\t\t// Go through the string array and pop operators onto the\n\t\t// operators stack and operands onto the the operands stack\n\t\tfor(String value : inputs) {\n\t\t if(debug) System.out.println(\"Evaluating: \" + value);\n\t\t\tif(value.equals(\"*\") || value.equals(\"/\") || value.equals(\"+\") || value.equals(\"-\")) {\n\t\t\t\t// If stack is empty push onto stack\n\t\t\t\tif(operand.empty()) {\n\t\t\t\t\toperand.push(value);\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t// If new operator is higher than old push onto\n\t\t\t\t// stack\n\t\t\t\telse if(value.equals(\"*\") || value.equals(\"/\")) {\n\t\t\t\t\tString old = (String)operand.peek();\n\t\t\t\t\tif(old.equals(\"*\")) {\n\t\t\t\t\t\tdouble a = (Double)operators.pop();\n\t\t\t\t\t\tdouble b = (Double)operators.pop();\n\t\t\t\t\t if(debug) {\n\t\t\t\t\t\tSystem.out.println(a + old + b);\n\t\t\t\t\t }\n\t\t\t\t\t \ta = a*b;\n\t\t\t\t\t\toperators.push(a);\n\t\t\t\t\t\told = (String)operand.pop();\n\t\t\t\t\t\toperand.push(value);\n\t\t\t\t\t}\n\t\t\t\t\telse if(old.equals(\"/\")) {\n\t\t\t\t\t\tdouble a = (Double)operators.pop();\n\t\t\t\t\t\tdouble b = (Double)operators.pop();\n\t\t\t\t\t if(debug) {\n\t\t\t\t\t\tSystem.out.println(a + old + b);\n\t\t\t\t\t }\n\t\t\t\t\t \ta = b/a;\n\t\t\t\t\t\toperators.push(a);\n\t\t\t\t\t\told = (String)operand.pop();\n\t\t\t\t\t\toperand.push(value);\n\t\t\t\t\t}\n\t\t\t\t\telse operand.push(value);\n\t\t\t\t}\n\n\t\t\t\t// Else pop old operator and evaluate top two\n\t\t\t\t// elements on operand stack then push new\n\t\t\t\t// operator onto stack\n\t\t\t\telse {\n\t\t\t\t\tdouble a = (Double)operators.pop();\n\t\t\t\t\tdouble b = (Double)operators.pop();\n\t\t\t\t\tString old = (String)operand.pop();\n\t\t\t\t if(debug) {\n\t\t\t\t\tSystem.out.println(a + old + b);\n\t\t\t\t }\n\t\t\t\t\tif(old.equals(\"*\")) a = a*b;\n\t\t\t\t\telse if(old.equals(\"/\")) a = b/a;\n\t\t\t\t\telse if(old.equals(\"+\")) a = a+b;\n\t\t\t\t\telse a = b-a;\n\t\t\t\t\toperators.push(a);\n\t\t\t\t\toperand.push(value);\n\t\t\t\t}\n\t\t\t}\n\t\t\t// Put operators into operators stack\n\t\t\telse {\n\t\t\t try {\n\t\t\t\tDouble num = Double.parseDouble(value);\n\t\t\t\toperators.push(num);\n\t\t\t }\n\t\t\t catch(NumberFormatException e) {\n\t\t\t\t System.out.println(\"NumberFormatException: Something besides a number or operator entered\");\n\t\t\t }\n\t\t\t}\n\t\t}\n\t\t// Finish up everything left over in stack\n\t\tString old;\n\t\tdouble a;\n\t\tdouble b;\n\t\twhile(!operand.empty()) {\n\t\t\told = (String)operand.pop();\n\t\t\ta = (Double)operators.pop();\n\t\t\tb = (Double)operators.pop();\n\t\t\tif(old.equals(\"*\")) a = a*b;\n\t\t\telse if(old.equals(\"/\")) a = b/a;\n\t\t\telse if(old.equals(\"+\")) a = a+b;\n\t\t\telse a = b-a;\n\t\t\toperators.push(a);\n\t\t}\n\t\treturn (Double)operators.peek();\n\t}", "private List<String> splitEquation(String equation) {\n List<String> result = new ArrayList<>();\n StringBuilder sb = new StringBuilder();\n int i = 0;\n while (i < equation.length()) {\n char c = equation.charAt(i);\n if (c == '+' || c == '-') {\n if (sb.length() > 0) {\n result.add(sb.toString());\n sb = new StringBuilder();\n }\n sb.append(c);\n } else {\n sb.append(c);\n }\n ++ i;\n }\n result.add(sb.toString());\n return result;\n }", "public static String evaluate( String expr ) \n {\n\tString[] arr = expr.split(\"\\\\s+\");\n\tLLStack<String> nums = new LLStack<String>();\n\tLLStack<String> noClose = new LLStack<String>();\n\tint op = 0;\n\n\tfor(String i : arr){ \n\t if(i.equals(\")\")){ //when you reach the closing parenthesis\n\t\tString top = noClose.pop(); //start going through this part of the expression\n\t\tnums.push(i); //add ( to stack for unload\n\t\t\n\t\twhile(!top.equals(\"(\")){ //until you reach the (, where the expression ends\n\t\t\t \n\t\t if(top.equals(\"+\")) op = 1;\n\t\t else if(top.equals(\"-\")) op = 2;\n\t\t else if(top.equals(\"*\")) op = 3;\n\n\t\t else nums.push(top); //if it's not an operand\n\n\t\t top = noClose.pop();\n\t\t}\n\n\t\tnoClose.push(unload(op, nums));\n\t }\n\t \n\t else noClose.push(i); //pushed into a stack of what's in this ()\n \n\t}//end of for loop \n \n\treturn noClose.peek();\n }", "public char[] evaluateExpression(char[] binaryStr1, String op, char[] binaryStr2) {\n\t\t// TODO: Implement this method.\n\t\treturn binaryStr1;\n\t}", "protected Evaluable parseExpression() throws ParsingException {\n Evaluable sub = parseSubExpression();\n\n while (_token != null &&\n _token.type == TokenType.Operator &&\n \">=<==!=\".indexOf(_token.text) >= 0) {\n\n String op = _token.text;\n\n next(true);\n\n Evaluable sub2 = parseSubExpression();\n\n sub = new OperatorCallExpr(new Evaluable[] { sub, sub2 }, op);\n }\n\n return sub;\n }", "@Override\n\tpublic void parse() throws Exception {\n\t\tLogger.log(\"Parsing expression: \" + getWords().toString(), 4);\n\t\tint wordsSize= getWords().size();\n\t\tString word;\n\t\tint lastSplitIndex = 0;\n\t\tFExpressionSide fExpSide;\n\t\tfExpSideList = new LinkedList<FExpressionSide>();\n\t\tfor(int i=0; i < wordsSize; i++){\n\t\t\tword = getWords().get(i);\n\t\t\t\n\t\t\tif(Operators.INFIX_OPS.contains(word)){\n\t\t\t\tfExpSide = new FExpressionSide(this);\n\t\t\t\tfExpSide.setWords(getWords().subList(lastSplitIndex, i));\n\t\t\t\tfExpSide.setOperator(word);\n\t\t\t\t\n\t\t\t\tlastSplitIndex = i +1;\n\t\t\t\tfExpSideList.add(fExpSide);\n\t\t\t}\n\t\t}\n\t\tfExpSide = new FExpressionSide(this);\n\t\tfExpSide.setWords(getWords().subList(lastSplitIndex, wordsSize));\n\t\tfExpSideList.add(fExpSide);\n\t\t\n\t\tfor(FExpressionSide f : fExpSideList){\n\t\t\tf.parse();\n\t\t}\n\t\t\n\t\t\n\t}", "protected void operation(String operator){\n if (this.tail<2){\n this.arr[tail++] = this.value;\n this.arr[tail++] = operator;\n } else{\n if (this.peek() != \")\"){\n this.arr[this.tail++] = this.value;\n }\n this.arr[this.tail++] = operator;\n }\n this.value=\"\"; // reset tracking variables\n this.decimalUsed = false;\n }", "public String operator( String op);", "private static List<String> tokenize(String expression) {\r\n\t\tString[] arrayTokens = expression.split(\r\n\t\t\t\t\"((?<=\\\\+)|(?=\\\\+))|((?<=\\\\-)|(?=\\\\-))|((?<=\\\\*)|(?=\\\\*))|((?<=\\\\/)|(?=\\\\/))|((?<=\\\\()|(?=\\\\())|((?<=\\\\))|(?=\\\\)))\");\r\n\r\n\t\t// not all minus sign is an operator. It can be the signal of a negative number.\r\n\t\t// The following loop will \"merge\" the minus sign with the next number when it\r\n\t\t// is only a signal\r\n\t\tList<String> listTokens = new ArrayList<String>(Arrays.asList(arrayTokens));\r\n\t\tfor (int i = 0; i < listTokens.size() - 1; i++) {\r\n\t\t\tif (listTokens.get(i).equals(\"-\")) {\r\n\t\t\t\tif (i == 0 || listTokens.get(i - 1).equals(\"(\")) {\r\n\t\t\t\t\tlistTokens.set(i + 1, \"-\" + listTokens.get(i + 1));\r\n\t\t\t\t\tlistTokens.remove(i);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\treturn listTokens;\r\n\t}", "public static int calculator(String expression) {\n int res = 0;\n char[] arr = expression.toCharArray();\n Integer operand = null;\n char operator = '+';\n int[] index = new int[1];\n for (int i = 0; i < arr.length; i++) {\n index[0] = i;\n if (!Character.isDigit(arr[i])) {\n operator = arr[i];\n } else {\n operand = getOperand(arr, index);\n i = index[0] - 1;\n if (operator == '+') {\n res = res + operand;\n } else if (operator == '-') {\n res = res - operand;\n }\n }\n }\n return res;\n }", "protected Evaluable parseSubExpression() throws ParsingException {\n Evaluable sub = parseTerm();\n\n while (_token != null &&\n _token.type == TokenType.Operator &&\n \"+-\".indexOf(_token.text) >= 0) {\n\n String op = _token.text;\n\n next(true);\n\n Evaluable sub2 = parseTerm();\n\n sub = new OperatorCallExpr(new Evaluable[] { sub, sub2 }, op);\n }\n\n return sub;\n }", "@Test\r\n\tpublic void testParseOperator() {\r\n\r\n\t\t// find the number of operators in the input\r\n\r\n\t\tint add = 0;\r\n\t\tint minus = 0;\r\n\t\tint multiply = 0;\r\n\t\tint divide = 0;\r\n\t\tString input = \"a = 5\\nb = a - 1\\nc = a + (b / 2 * 4)\";\r\n\t\tfor (int i = 0; i < input.length(); i++) {\r\n\t\t\tif (input.charAt(i) == '+')\r\n\t\t\t\tadd++;\r\n\t\t\tif (input.charAt(i) == '-')\r\n\t\t\t\tminus++;\r\n\t\t\tif (input.charAt(i) == '*')\r\n\t\t\t\tmultiply++;\r\n\t\t\tif (input.charAt(i) == '/')\r\n\t\t\t\tdivide++;\r\n\t\t}\r\n\r\n\t\t// Enter the code\r\n\r\n\t\tdriver.findElement(By.name(\"code[code]\")).sendKeys(input);\r\n\r\n\t\t// Look for the \"Parse\" button and click\r\n\r\n\t\tdriver.findElements(By.name(\"commit\")).get(1).click();\r\n\r\n\t\t// Check that there contains corresponding quantity of operators\r\n\r\n\t\ttry {\r\n\t\t\tWebElement code = driver.findElement(By.tagName(\"code\"));\r\n\t\t\tString res = code.getText();\r\n\t\t\tint add1 = 0, minus1 = 0, multiply1 = 0, divide1 = 0;\r\n\t\t\tfor (int i = 0; i < res.length(); i++) {\r\n\t\t\t\tif (res.charAt(i) == '+')\r\n\t\t\t\t\tadd1++;\r\n\t\t\t\tif (res.charAt(i) == '-')\r\n\t\t\t\t\tminus1++;\r\n\t\t\t\tif (res.charAt(i) == '*')\r\n\t\t\t\t\tmultiply1++;\r\n\t\t\t\tif (res.charAt(i) == '/')\r\n\t\t\t\t\tdivide1++;\r\n\t\t\t}\r\n\t\t\tassertEquals(add, add1);\r\n\t\t\tassertEquals(minus, minus1);\r\n\t\t\tassertEquals(multiply, multiply1);\r\n\t\t\tassertEquals(divide, divide1);\r\n\t\t} catch (NoSuchElementException nseex) {\r\n\t\t\tfail();\r\n\t\t}\r\n\t}", "Expression(String expressionString) throws IllegalArgumentException {\r\n tokenList = new ArrayList<String>();\r\n StringBuilder token = new StringBuilder();\r\n\r\n // ADD YOUR CODE BELOW HERE\r\n // ..\r\n for (int i = 0; i < expressionString.length(); i++) {\r\n Character first = expressionString.charAt(i);\r\n if (first == ' ') {\r\n continue;\r\n }\r\n if (first == '(' || first == ')' || first == '[' || first == ']') {\r\n tokenList.add(expressionString.substring(i, i + 1));\r\n }\r\n if (first == '+' || first == '-' || first == '*' || first == '/') {\r\n if (expressionString.charAt(i + 1) == '+' || expressionString.charAt(i + 1) == '-') {\r\n tokenList.add(expressionString.substring(i, i + 2));\r\n i++;\r\n continue;\r\n }\r\n tokenList.add(expressionString.substring(i, i + 1));\r\n }\r\n if (Character.isDigit(first)) {\r\n int k = i + 1;\r\n while (Character.isDigit(expressionString.charAt(k))) {\r\n k++;\r\n }\r\n tokenList.add(expressionString.substring(i, k));\r\n i = k - 1;\r\n\r\n }\r\n }\r\n }", "private static String evaluate(ArrayList<String> operators, ArrayList<String> operands) {\n\n /* Check for valid input. There should be one more operand than operator. */\n if (operands.size() != operators.size()+1)\n return \"Invalid Input\";\n\n String current;\n int value;\n int numMultiply = 0;\n int numAdd = 0;\n int currentOperator = 0;\n\n /* Get the number of multiplications in the operators list. */\n for (int i = 0; i < operators.size(); i++) {\n\n if (operators.get(i).equals(\"*\"))\n numMultiply++;\n }\n\n /* Get the number of addition and subtraction in the operators list. */\n for (int i = 0; i < operators.size(); i++) {\n\n if (operators.get(i).equals(\"-\") || operators.get(i).equals(\"+\"))\n numAdd++;\n }\n\n /* Evaluate multiplications first, from left to right. */\n while (numMultiply > 0){\n\n current = operators.get(currentOperator);\n if (current.equals(\"*\")) {\n\n /* When multiplication is found in the operators, get the associative operands from the operands list.\n Associative operands are found in the operands list at indexes current operator and current operator + 1.\n */\n value = Integer.parseInt(operands.get(currentOperator)) * Integer.parseInt(operands.get(currentOperator+1));\n\n /* Remove the operands and the operator since they have been evaluated and add the evaluated answer back in the operands. */\n operators.remove(currentOperator);\n operands.remove(currentOperator);\n operands.remove(currentOperator);\n operands.add(currentOperator, Integer.toString(value));\n\n numMultiply--;\n }\n else\n currentOperator++;\n }\n\n currentOperator = 0;\n\n /* Next evaluate the addition and subtraction, from left to right. */\n while (numAdd > 0){\n current = operators.get(currentOperator);\n if (current.equals(\"+\")) {\n\n value = Integer.parseInt(operands.get(currentOperator)) + Integer.parseInt(operands.get(currentOperator+1));\n operators.remove(currentOperator);\n operands.remove(currentOperator);\n operands.remove(currentOperator);\n operands.add(currentOperator, Integer.toString(value));\n numAdd--;\n }\n\n else if (current.equals(\"-\")) {\n\n value = Integer.parseInt(operands.get(currentOperator)) - Integer.parseInt(operands.get(currentOperator+1));\n operators.remove(currentOperator);\n operands.remove(currentOperator);\n operands.remove(currentOperator);\n operands.add(currentOperator, Integer.toString(value));\n numAdd--;\n }\n else\n currentOperator++;\n }\n\n /* When all the operations have been evaluated, the final answer will be in the first element of the operands list. */\n return operands.get(0);\n }", "public void convertInfixToPostfix() {\n\t\t// Create operator stack\n\t\tStack<String> op_stack = new Stack<String>();\n\n\t\t// Prepare the input string\n\t\tprepareInput();\n\t\t\n\t\t// Split the expression \n\t\tString[] tokens = input.split(\"(?<=[^\\\\.a-zA-Z\\\\d])|(?=[^\\\\.a-zA-Z\\\\d])\");\n\t\t\n\t\t//For each token\n\t\tfor (String t : tokens) {\n\t\t\t// If the token is empty, skip it\n\t\t\tif(t.equals(\"\") || t.equals(\" \")) continue;\n\t\t\t\n\t\t\t// If operator (o1)\n\t\t\tif (Operator.isOperator(t)) {\n\n\t\t\t\t// While there is an operator (o2) an the stack and\n\t\t\t\t// (o1 is left associative AND o2 precedence is higher or equal to o1 precedence)\n\t\t\t\t// OR\n\t\t\t\t// (o1 is right associative AND o2 precedence is higher than o1 precedence)\n\t\t\t\twhile (!op_stack.empty()\n\t\t\t\t\t\t&& Operator.isOperator(op_stack.peek())\n\t\t\t\t\t\t&& (\n\t\t\t\t\t\t\t((Operator.getAssociativity(t) == Operator.LEFT) && Operator.comparePrec(op_stack.peek(), t) >= 0) \n\t\t\t\t\t\t\t|| \n\t\t\t\t\t\t\t((Operator.getAssociativity(t) == Operator.RIGHT) && Operator.comparePrec(op_stack.peek(), t) > 0)\n\t\t\t\t\t\t )\n\t\t\t\t ) \n\t\t\t\t{\n\t\t\t\t\t// add o2 to the output\n\t\t\t\t\toutput.add(op_stack.pop());\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t// Push o1 on to the stack.\n\t\t\t\top_stack.push(t);\n\t\t\t}\n\n\t\t\telse if (t.equals(\"(\")) {\n\t\t\t\top_stack.push(t);\n\t\t\t}\n\n\t\t\telse if (t.equals(\")\")) {\n\t\t\t\t// While there is not a left parenthesis, add the top token from the stack to the output\n\t\t\t\twhile (!op_stack.peek().equals(\"(\")) {\n\t\t\t\t\toutput.add(op_stack.pop());\n\t\t\t\t}\n\n\t\t\t\t// Pop out the left parenthesis\n\t\t\t\top_stack.pop();\n\t\t\t\t\n\t\t\t\t// While there is a function on the top of the stack, add it to the output\n\t\t\t\tif(!op_stack.empty() && Function.isFunction(op_stack.peek())) output.add(op_stack.pop());\n\t\t\t}\n\t\t\telse if(Function.isFunction(t)){\n\t\t\t\top_stack.push(t);\n\t\t\t}\n\t\t\telse if(isNumeric(t) || isVariable(t)){\n\t\t\t\toutput.add(t);\n\t\t\t}\n\t\t}\n\n\t\t// Finally empty the stack, by adding all remaining tokens to the output.\n\t\twhile (!op_stack.empty()) {\n\t\t\toutput.add(op_stack.pop());\n\t\t}\n\t}", "public String evaluate(ArrayList<String> expression)\n {\n Stack<String> Values = new Stack<String>(), Operations = new Stack<String>();\n\n for (int i = 0; i < expression.size(); i++)\n\t\t{\n\t\t\tif (expression.get(i).equals(\"(\"))\n Operations.push(expression.get(i));\n else if (expression.get(i).equals(\")\"))\n {\n while (Operations.peek().equals(\"(\"))\n Values.push(apply(Operations.pop(), Values.pop(), Values.pop()));\n Operations.pop();\n }\n else if (expression.get(i).equals(\"+\") || expression.get(i).equals(\"-\") || expression.get(i).equals(\"*\") || expression.get(i).equals(\"/\"))\n {\n while (!Operations.empty() && precedence(expression.get(i), Operations.peek()))\n Values.push(apply(Operations.pop(), Values.pop(), Values.pop()));\n Operations.push(expression.get(i));\n }\n\t\t\telse\n\t\t\t{\n\t\t\t\tValues.push(expression.get(i));\n\t\t\t}\n }\n while (!Operations.empty())\n Values.push(apply(Operations.pop(), Values.pop(), Values.pop()));\n return Values.pop();\n }", "private String compute(String equ,String op)\n {\n String equation = equ;\n Pattern mdPattern = Pattern.compile(\"(\\\\d+([.]\\\\d+)*)(([\"+op+\"]))(\\\\d+([.]\\\\d+)*)\");\n Matcher matcher\t\t= mdPattern.matcher(equation);\n while(matcher.find())\n {\n String[] arr = null;\n double ans = 0;\n String eq = matcher.group(0);//get form x*y\n if(eq.contains(op))\n {\n arr = eq.split(\"\\\\\"+op);//make arr\n if(op.equals(\"*\"))\n ans = Double.valueOf(arr[0])*Double.valueOf(arr[1]);//compute\n if(op.equals(\"/\"))\n ans = Double.valueOf(arr[0])/Double.valueOf(arr[1]);//compute\n if(op.equals(\"+\"))\n ans = Double.valueOf(arr[0])+Double.valueOf(arr[1]);//compute\n if(op.equals(\"-\"))\n ans = Double.valueOf(arr[0])-Double.valueOf(arr[1]);//compute\n }\n\n equation = matcher.replaceFirst(String.valueOf(ans));//replace in equation\n matcher = mdPattern.matcher(equation);//look for more matches\n }\n return equation;\n }", "public static int evaluate(String expression) {\n\n\t\tchar[] tokens = expression.toCharArray();\n\t\t// Stack for numbers: 'values'\n\t\tStack<Integer> values = new Stack<Integer>();\n\t\t// Stack for Operators: 'operators'\n\t\tStack<Character> operators = new Stack<Character>();\n\n\t\tfor (int i = 0; i < tokens.length; i++) {\n\t\t\t// Current token is a whitespace, skip it\n\t\t\tif (tokens[i] == ' ')\n\t\t\t\tcontinue;\n\t\t\t// Current token is a number, push it to stack for numbers\n\t\t\tif (tokens[i] >= '0' && tokens[i] <= '9') {\n\t\t\t\tStringBuffer stringBuffer = new StringBuffer();\n\t\t\t\t// There may be more than one digits in number\n\t\t\t\twhile (i < tokens.length && tokens[i] >= '0' && tokens[i] <= '9') {\n\t\t\t\t\tstringBuffer.append(tokens[i++]);\n\t\t\t\t}\n\t\t\t\tvalues.push(Integer.parseInt(stringBuffer.toString()));\n\t\t\t i--;\n\t\t\t} else if (tokens[i] == '(') {\n\t\t\t // Current token is an opening brace, push it to 'operators'\n\t\t\t\toperators.push(tokens[i]);\n\t\t\t} else if (tokens[i] == ')') {\n\t\t\t // Closing brace encountered, solve entire brace\n\t\t\t\twhile (operators.peek() != '(') {\n\t\t\t\t values.push(applyOperation(operators.pop(), values.pop(), values.pop()));\n\t\t\t }\n\t\t\t\toperators.pop();\n\t\t\t} else if (tokens[i] == '+' || tokens[i] == '-' ||tokens[i] == '*' || tokens[i] == '/') {\n\t\t\t // Current token is an operator.\n\t\t\t\twhile (!operators.empty() && hasPrecedence(tokens[i], operators.peek())) {\n\t\t\t\t values.push(applyOperation(operators.pop(), values.pop(),values.pop()));\n\t\t\t // System.out.println(values.peek());\n\t\t\t }\n\t\t\t\t// Push current token to 'operators'.\n\t\t\t\toperators.push(tokens[i]);\n\t\t\t}\n\t\t}\n\t\t// Entire expression has been parsed at this point, apply remaining operators to remaining values\n\t\twhile (!operators.empty()) {\n\t\t\tvalues.push(applyOperation(operators.pop(), values.pop(), values.pop()));\n\t\t}\n\t\t// Top of 'values' contains result, return it\n\t\treturn values.pop();\n\t}", "private final boolean IsBinaryOp(String expression, String symbol, String leftExpression, String rightExpression) {\r\n boolean isBinaryOp = false;\r\n if (expression.contains(symbol)) {\r\n int openParanthesisCount = 0;\r\n int closeParanthesisCount = 0;\r\n for (int i = 0; (i < expression.length()); i++) {\r\n String currentChar = expression.substring(i, 1);\r\n if ((currentChar.equals(symbol) \r\n && (openParanthesisCount == closeParanthesisCount))) {\r\n leftExpression = expression.substring(0, i);\r\n rightExpression = expression.substring((i + 1), (expression.length() - (i - 1)));\r\n isBinaryOp = true;\r\n break;\r\n }\r\n else if (currentChar.equals(\"(\")) {\r\n openParanthesisCount++;\r\n }\r\n else if (currentChar.equals(\")\")) {\r\n closeParanthesisCount++;\r\n }\r\n \r\n }\r\n \r\n }\r\n \r\n return isBinaryOp;\r\n }", "public static ExprToken[] Tokenize(String expr) throws ParseException {\n ArrayList<ExprToken> res = new ArrayList<>();\n int i = 0;\n\n while (i < expr.length()) {\n char c = expr.charAt(i);\n\n if (Character.isSpaceChar(c)) {\n i++;\n continue;\n }\n\n if (GetOpPrio(c) != -1) {\n res.add(new ExprToken(ExprToken.Type.Operator, new Character(c)));\n i++;\n } else if (Character.isLetterOrDigit(c)) {\n int start = i++;\n\n while (i < expr.length() && Character.isLetterOrDigit(expr.charAt(i)))\n i++;\n\n res.add(new ExprToken(ExprToken.Type.Word, expr.substring(start, i)));\n } else if (c == '(') {\n res.add(new ExprToken(ExprToken.Type.Bracket, '('));\n i++;\n } else if (c == ')') {\n res.add(new ExprToken(ExprToken.Type.Bracket, ')'));\n i++;\n } else {\n throw new ParseException(\"Unexpected character (\" + c + \")\", i);\n }\n }\n\n return res.toArray(new ExprToken[res.size()]);\n }", "public void recursion(final String expression, int countOperation) {\n int numberOfOperations=0;\n String operationString=expression.replace(\" \",\"\");\n for (int i=0; i<operationString.length()-1; i++)\n {\n if(expression.substring(i,i+1).matches(\"\\\\+\")\n ||operationString.substring(i,i+1).matches(\"\\\\-\")\n ||operationString.substring(i,i+1).matches(\"\\\\*\")\n ||operationString.substring(i,i+1).matches(\"/\")\n ||operationString.substring(i,i+1).matches(\"\\\\^\")\n ||operationString.substring(i,i+1).matches(\"i\")\n ||operationString.substring(i,i+1).matches(\"a\")\n ||operationString.substring(i,i+1).matches(\"o\"))\n {\n numberOfOperations++;\n }\n }\n String result;\n int count=0;\n if (operationString.substring(0,1).equals(\"(\"))\n {\n int start=1;\n int end=0;\n count=1;\n while (count<operationString.length() && start!=end)\n {\n String temp=operationString.substring(count,count+1);\n if (temp.equals(\"(\"))\n {\n start++;\n }\n if (temp.equals(\")\"))\n {\n end++;\n }\n count++;\n }\n }\n if (count!=operationString.length() && !operationString.substring(0,1).equals(\"(\"))\n {\n //разбиваем выражения на подвыражения\n List<String> symbols=new ArrayList<>();\n for (int i=0; i<operationString.length()-1;)\n {\n String temp=operationString.substring(i,i+1);\n if (\"+-*/^\".contains(temp))\n {\n symbols.add(temp);\n i++;\n }\n if(temp.equals(\"s\") || temp.equals(\"t\") || temp.equals(\"c\"))\n {\n symbols.add(operationString.substring(i,i+3));\n i=i+3;\n }\n if (temp.matches(\"\\\\d\"))\n {\n int k=i+1;\n StringBuilder sb=new StringBuilder(temp);\n while (k<operationString.length()&&(operationString.substring(k,k+1).matches(\"\\\\d\")||operationString.substring(k,k+1).matches(\"\\\\.\")))\n {\n sb.append(operationString.substring(k,k+1));\n k++;\n }\n i=k;\n symbols.add(new String(sb));\n }\n if (temp.equals(\"(\"))\n {\n int start=1;\n int end=0;\n int k=i+1;\n while(k<operationString.length() && start!=end)\n {\n if (operationString.substring(k,k+1).equals(\"(\"))\n {\n start++;\n }\n if(operationString.substring(k,k+1).equals(\")\"))\n {\n end++;\n }\n k++;\n }\n PrintStream oldOut=System.out;\n String recTemp;\n ByteArrayOutputStream baos=new ByteArrayOutputStream();\n PrintStream ps=new PrintStream(baos);\n System.setOut(ps);\n recursion(operationString.substring(i,k),++countOperation);\n recTemp=baos.toString();\n System.setOut(oldOut);\n symbols.add(recTemp);\n i=k;\n }\n }\n\n for (int i=0; i<symbols.size(); i++)\n {\n if (symbols.get(i).startsWith(\"s\"))\n {\n symbols.set(i,\"\"+Math.sin(Double.parseDouble(symbols.remove(i+1))*Math.PI/180));\n }\n if (symbols.get(i).startsWith(\"t\"))\n {\n symbols.set(i,\"\"+Math.tan(Double.parseDouble(symbols.remove(i+1))*Math.PI/180));\n }\n if (symbols.get(i).startsWith(\"c\"))\n {\n symbols.set(i,\"\"+Math.cos(Double.parseDouble(symbols.remove(i+1))*Math.PI/180));\n }\n }\n for (int i=0; i<symbols.size();)\n {\n if (symbols.get(i).equals(\"^\"))\n {\n symbols.set(i-1, Math.pow(Double.parseDouble(symbols.get(i - 1)), Double.parseDouble(symbols.get(i + 1))) + \"\");\n symbols.remove(i);\n symbols.remove(i);\n i--;\n }\n i++;\n }\n for (int i=0; i<symbols.size();)\n {\n if (symbols.get(i).equals(\"/\"))\n {\n symbols.set(i-1, Double.parseDouble(symbols.get(i - 1))/Double.parseDouble(symbols.get(i + 1)) + \"\");\n symbols.remove(i);\n symbols.remove(i);\n i--;\n }\n if (symbols.get(i).equals(\"*\"))\n {\n symbols.set(i-1, Double.parseDouble(symbols.get(i - 1))*Double.parseDouble(symbols.get(i + 1)) + \"\");\n symbols.remove(i);\n symbols.remove(i);\n i--;\n }\n i++;\n }\n for (int i=0; i<symbols.size(); i++)\n {\n if (symbols.get(i).equals(\"-\"))\n {\n symbols.set(i,\"-\"+symbols.remove(i+1));\n }\n if (symbols.get(i).equals(\"+\"))\n {\n symbols.remove(i);\n i--;\n }\n }\n double answer=0;\n for (String s:symbols)\n {\n answer=answer+Double.parseDouble(s);\n }\n result=answer+\"\";\n countOperation--;\n }\n else\n {\n //отбрасываем начальные и конечные скобки\n operationString=operationString.substring(1,operationString.length()-1);\n PrintStream oldOut=System.out;\n ByteArrayOutputStream baos=new ByteArrayOutputStream();\n PrintStream ps=new PrintStream(baos);\n System.setOut(ps);\n recursion(operationString,++countOperation);\n result=baos.toString();\n System.setOut(oldOut);\n }\n if (countOperation==0)\n {\n System.out.println(result+\" \"+numberOfOperations);\n }\n else\n {\n System.out.println(result);\n }\n }", "public int operation(int number1,int number2,String operator)", "public static String parseExpressionForSecondFraction(String expression) {\n int space = expression.indexOf(\" \");\n String frac1 = expression.substring(0, space);\n String operator = expression.substring(space + 1, space + 2);\n int length = expression.length();\n String frac2 = expression.substring(space + 3, length);\n return frac2;\n }", "public String parsePrefixToPostfix(String exp) throws SyntaxError {\n \tif (exp.length() == 0) {\n \t\tthrow new SyntaxError(\"No expression has been entered.\");\n \t}\n //parser accepts user input into exp\n \tScanner parser = new Scanner(exp);\n int element;\n String operator;\n String entity;\n String postfixExpression = \"\"; \n String firstOperand, secondOperand;\n int result = 0;\n \n //tokenize prefix string and set up 2 stacks\n Stack<String> operandStack = new Stack<String>();\n Stack<String> reverseOperatorStack = new Stack<String>();\n //while statement to push onto the reversal stack if there are more tokens\n while (parser.hasNext()) {\n entity = parser.next();\n // unless there is a space\n if (!entity.equals(\" \"))\n reverseOperatorStack.push(entity);\n }\n try { \n \t// while statement to pop to reversal stack if it is not empty\n \twhile (!reverseOperatorStack.isEmpty()) {\n //peek to retrieve the token at the top of the stack\n \t\tentity = reverseOperatorStack.peek();\n \t\t//pop to take the token off the stack\n\t reverseOperatorStack.pop();\n\t \n\t // if it is an operand\n\t if (Character.isDigit(entity.charAt(0))) {\n\t \t//push token onto the operand stack\n\t \toperandStack.push(entity);\n\t }\n\t // if it is an operator\n\t else if (entity.equals(\"/\") || entity.equals(\"*\") \n\t \t\t|| entity.equals(\"+\") || entity.equals(\"-\")) {\n\t \t//retrieve, then pop first operand off the stack\n\t \tfirstOperand = operandStack.peek();\n\t operandStack.pop();\n\t //retrieve, then pop second operand off the stack\n\t secondOperand = operandStack.peek();\n\t operandStack.pop();\n\t // formats miniExpression String with the 2 operands followed by the operator \n\t String miniExpression = firstOperand + \" \" + secondOperand + \" \" + entity;\n\t //push the string onto the operand stack\n\t operandStack.push(miniExpression);\n\t }\n \t}\n \t //throws error if there is an incorrect entry improperly formatted \t\n } catch (Exception e) {\n throw new SyntaxError(\"You have entered an improper expression. Check your input.\");\n }\n //retrieve, then pop the postfix expression off the stack\n postfixExpression = operandStack.peek();\n operandStack.pop();\n //return postfix - holding the converted expression\n return postfixExpression; \n }", "@Override\n public String evaluate(final String leftOperand, final String rightOperand)\n throws IllegalArgumentException\n {\n // error checking for null/empty\n if (leftOperand == null || rightOperand == null || leftOperand.equals(\"\")\n || rightOperand.equals(\"\"))\n {\n throw new IllegalArgumentException(Strings.UI.getStrings().getString(Strings.TWO_OPERANDS));\n }\n\n String noSpL = leftOperand.replaceAll(Strings.SPACE, \"\");\n String noSpR = rightOperand.replaceAll(Strings.SPACE, \"\");\n String distribute = SubtractionOperator.distribute(noSpR);\n String result = new AdditionOperator().evaluate(noSpL, distribute);\n\n return result;\n }", "public static String[] parseEquation(String equation) {\n\t\tString[] result = equation.split(\"(?<=[-+*/])|(?=[-+*/])\");\n\t\treturn result;\n\t}", "private static boolean splitByDivisionAndAppendToLexemes(Lexemes lexemes, String expression, SymbolTable table) {\n\t\tif (expression.contains(\"/\")) {\n\t\t\tString[] expressionArr = expression.split(\"/\");\n\t\t\tint finalIndex = expressionArr.length - 1;\n\n\t\t\tfor (int i = 0; i <= finalIndex; i++) {\n\t\t\t\tString s = expressionArr[i].trim();\n\n\t\t\t\t// check if the expression contains either relational operator or logical operator.\n\t\t\t\tif (s.contains(\">\") || s.contains(\"<\") || s.contains(\"==\") || s.contains(\"or\") || s.contains(\"and\") || s.contains(\"not\")) {\n\t\t\t\t\tif (!checkNotOperations(s, lexemes, table)) return false;\n\t\t\t\t} else {\n\t\t\t\t\t// check if it is variable or constant\n\t\t\t\t\tif (table.contains(s)) {\n\t\t\t\t\t\tint id = table.getIdOfVariable(s);\n\t\t\t\t\t\tlexemes.insertLexeme(\"ID\", ((Integer) id).toString());\n\t\t\t\t\t} else if (s.equals(\"ARG_START\") || s.equals(\"ARG_END\")) {\n\t\t\t\t\t\tlexemes.insertLexeme(s);\n\t\t\t\t\t} else if (s.startsWith(\"FunctionCall@\")) {\n\t\t\t\t\t\tlexemes.insertLexeme(s);\n\t\t\t\t\t} else {\n\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\t// check if the current string is either empty or whitespace\n\t\t\t\t\t\t\tif (s.equals(\"\") || s.matches(\"\\\\s+\")) {\n\t\t\t\t\t\t\t\tif (expression.contains(s + \"/\")) {\n\t\t\t\t\t\t\t\t\tlexemes.insertLexeme(\"AROP\", \"/\");\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t\t} else if (s.contains(\".\")) {\n\t\t\t\t\t\t\t\tDouble.parseDouble(s);\n\t\t\t\t\t\t\t\tlexemes.insertLexeme(\"CONST_NUM\", s);\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\tInteger.parseInt(s);\n\t\t\t\t\t\t\t\tlexemes.insertLexeme(\"CONST_NUM\", s);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t} catch (Exception e) {\n\t\t\t\t\t\t\tif (!checkNotOperations(s, lexemes, table)) return false;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tif (i < finalIndex) {\n\t\t\t\t\tlexemes.insertLexeme(\"AROP\", \"/\");\n\t\t\t\t} else if (expression.endsWith(\"/\")) {\n\t\t\t\t\tlexemes.insertLexeme(\"AROP\", \"/\");\n\t\t\t\t}\n\t\t\t}\n\t\t} else {\n\n\t\t\t/* check the type */\n\n\t\t\tif (expression.contains(\"\\\"\")) {\n\t\t\t\tlexemes.insertLexeme(\"CONST_STR\", expression);\n\t\t\t} else if (expression.trim().equals(\"true\")) {\n\t\t\t\tlexemes.insertLexeme(\"CONST_BOOL\", \"true\");\n\t\t\t} else if (expression.trim().equals(\"false\")) {\n\t\t\t\tlexemes.insertLexeme(\"CONST_BOOL\", \"false\");\n\t\t\t} else if (table.contains(expression)) {\n\t\t\t\tint id = table.getIdOfVariable(expression);\n\t\t\t\tlexemes.insertLexeme(\"ID\", ((Integer) id).toString());\n\n\t\t\t} else if (expression.trim().equals(\"ARG_START\") || expression.trim().equals(\"ARG_END\")) {\n\t\t\t\tlexemes.insertLexeme(expression.trim());\n\n\t\t\t} else if (expression.trim().startsWith(\"FunctionCall@\")) {\n\t\t\t\tlexemes.insertLexeme(expression.trim());\n\n\t\t\t} else {\n\n\t\t\t\tif (expression.contains(\">\") || expression.contains(\"<\") || expression.contains(\"==\") || expression.contains(\"or\") || expression.contains(\"and\") || expression.contains(\"not\")) {\n\t\t\t\t\tif (!checkNotOperations(expression.trim(), lexemes, table)) return false;\n\t\t\t\t} else {\n\n\t\t\t\t\t// parse string to number to check if the expression is a number\n\t\t\t\t\ttry {\n\t\t\t\t\t\tif (expression.equals(\"\") || expression.matches(\"\\\\s+\")) {\n\t\t\t\t\t\t\treturn true;\n\t\t\t\t\t\t} else if (expression.contains(\".\")) {\n\t\t\t\t\t\t\tDouble.parseDouble(expression);\n\t\t\t\t\t\t\tlexemes.insertLexeme(\"CONST_NUM\", expression);\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tInteger.parseInt(expression);\n\t\t\t\t\t\t\tlexemes.insertLexeme(\"CONST_NUM\", expression);\n\t\t\t\t\t\t}\n\t\t\t\t\t} catch (Exception e) {\n\t\t\t\t\t\treturn checkNotOperations(expression, lexemes, table);\n\t\t\t\t\t}\n\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn true;\n\t}", "public String convert(ArithmeticExpression expression)\n {\n String expressionString = expression.getExpression();\n String convertedExpression = \"\";\n Stack<String> OpStack = new Stack<>();\n\n int startIndex = 0;\n while(startIndex < expressionString.length())\n {\n if(isOperand(nextToken(expressionString,startIndex)))\n {\n convertedExpression += nextToken(expressionString,startIndex);\n convertedExpression += \" \";\n\n }\n if(Brackets.isLeftBracket(nextToken(expressionString,startIndex)))\n {\n OpStack.push(nextToken(expressionString,startIndex));\n }\n if(Brackets.isRightBracket(nextToken(expressionString,startIndex)))\n {\n String topOp = OpStack.pop();\n while(!Brackets.isLeftBracket(topOp))\n {\n convertedExpression += topOp;\n convertedExpression += \" \";\n topOp = OpStack.pop();\n }\n }\n if(Operator.isOperator(nextToken(expressionString,startIndex)))\n {\n Operator temp = Operator.of(nextToken(expressionString,startIndex));\n if(OpStack.isEmpty())\n {\n OpStack.push(nextToken(expressionString, startIndex));\n }\n else\n {\n Operator topOp = Operator.of(OpStack.peek());\n while (topOp.getRank() <= temp.getRank())\n {\n convertedExpression += OpStack.pop();\n convertedExpression += \" \";\n topOp = Operator.of(OpStack.peek());\n }\n OpStack.push(nextToken(expressionString, startIndex));\n\n }\n }\n if(isOperand(nextToken(expressionString,startIndex)))\n startIndex += nextToken(expressionString,startIndex).length();\n else\n startIndex++;\n }\n while(!OpStack.isEmpty())\n {\n convertedExpression += OpStack.pop();\n convertedExpression += \" \";\n }\n return convertedExpression;\n }", "@Test\n\t\tpublic void testExpression() throws LexicalException, SyntaxException {\n\t\t\tString input = \"x + 2\";\n\t\t\tPLPParser parser = makeParser(input);\n\t\t\tExpression e = parser.expression(); //call expression here instead of parse\n\t\t\tshow(e);\t\n\t\t\tassertEquals(ExpressionBinary.class, e.getClass());\n\t\t\tExpressionBinary b = (ExpressionBinary)e;\n\t\t\tassertEquals(ExpressionIdentifier.class, b.leftExpression.getClass());//\n\t\t\tExpressionIdentifier left = (ExpressionIdentifier)b.leftExpression;\n\t\t\tassertEquals(\"x\", left.name);\n\t\t\tassertEquals(ExpressionIntegerLiteral.class, b.rightExpression.getClass());\n\t\t\tExpressionIntegerLiteral right = (ExpressionIntegerLiteral)b.rightExpression;\n\t\t\tassertEquals(2, right.value);\n\t\t\tassertEquals(OP_PLUS, b.op);\n\t\t}", "public static BinaryExpression divide(Expression expression0, Expression expression1, Method method) { throw Extensions.todo(); }", "private static String[] calculateMultiplicationOrDivision(String[] formulaArray, Integer operatorPosition) throws Exception {\n int arrayLength = formulaArray.length;\n String[] arrayAfterCalculations= new String[formulaArray.length-2];\n\n // Same array until the number before the operator.\n for (int i = 0; i < operatorPosition - 1; i++) {\n arrayAfterCalculations[i] = formulaArray[i];\n }\n if(formulaArray[operatorPosition].equals(\"*\")) {\n arrayAfterCalculations[operatorPosition - 1] = multiply(formulaArray[operatorPosition-1],formulaArray[operatorPosition+1]);\n }else if(formulaArray[operatorPosition].equals(\"/\")) {\n String divisionResult = divide(formulaArray[operatorPosition-1],formulaArray[operatorPosition+1]);\n if(!divisionResult.equals(\"DIVIDED_BY_ZERO\")){\n arrayAfterCalculations[operatorPosition - 1] =divisionResult;\n }else{\n return (new String[]{\"DIVIDED_BY_ZERO\"});\n }\n }else{\n throw new Exception(\"Unknown operation exception\");\n }\n // the rest of the array\n for (int i = operatorPosition+2; i < formulaArray.length; i++) {\n arrayAfterCalculations[i-2]= formulaArray[i];\n }\n return arrayAfterCalculations;\n }", "private static int evaluateExpression(String expression, int number1, int number2){\n if(expression.equals(\"plus\")){\n \treturn (number1 + number2);\n }else if(expression.equals(\"minus\")){\n \treturn (number1 - number2);\n }else if(expression.equals(\"times\")){\n \treturn(number1 * number2);\n }else if(expression.equals(\"divide\")){\n \treturn(number1 / number2);\n }\n return 0;\n \n }", "static BinaryOperator<SibillaValue> getOperator(String op) {\n if (op.equals(\"+\")) {return SibillaValue::sum;}\n if (op.equals(\"-\")) {return SibillaValue::sub; }\n if (op.equals(\"%\")) {return SibillaValue::mod; }\n if (op.equals(\"*\")) {return SibillaValue::mul; }\n if (op.equals(\"/\")) {return SibillaValue::div; }\n if (op.equals(\"//\")) {return SibillaValue::zeroDiv; }\n return (x,y) -> SibillaValue.ERROR_VALUE;\n }", "public static PredicateSplit splitPredicate(ScalarOperator predicate) {\n if (predicate == null) {\n return PredicateSplit.of(null, null, null);\n }\n List<ScalarOperator> rangePredicates = Lists.newArrayList();\n RangeExtractor extractor = new RangeExtractor();\n Map<ColumnRefOperator, TreeRangeSet<ConstantOperator>> rangeSet =\n predicate.accept(extractor, new RangeExtractorContext());\n if (rangeSet != null) {\n rangeSet.forEach((column, range) -> rangePredicates.add(rangeSetToExpr(range, column)));\n } else if (extractor.columnEqualityPredicates.isEmpty() && extractor.residualPredicates.isEmpty()) {\n extractor.residualPredicates.add(predicate);\n }\n return PredicateSplit.of(Utils.compoundAnd(extractor.columnEqualityPredicates), Utils.compoundAnd(rangePredicates),\n Utils.compoundAnd(extractor.residualPredicates));\n }", "private String evaluate(String expression) {\n String separators = \"()*+/-\";\n String result;\n // Stack for using in algorithm\n Stack<String> stackOperations = new Stack<String>();\n // Stack for RPN - reverse polish notation\n Stack<String> stackRPN = new Stack<String>();\n // Stack for evaluating answer\n Stack<String> stackTemp = new Stack<String>();\n //splitting expression into tokens\n StringTokenizer stringTokenizer = new StringTokenizer(updateUnaryMinus(expression), separators, true);\n\n while (stringTokenizer.hasMoreTokens()) {\n String token = stringTokenizer.nextToken();\n if (isNumber(token)) {\n stackRPN.push(token);\n } else if (isOpenBracket(token)) {\n stackOperations.push(token);\n } else if (isCloseBracket(token)) {\n while (!isOpenBracket(stackOperations.lastElement())) {\n stackRPN.push(stackOperations.pop());\n }\n stackOperations.pop();\n } else if (isOperator(token)) {\n while (!stackOperations.empty() && isOperator(stackOperations.lastElement())\n && getPrecedence(stackOperations.lastElement()) > getPrecedence(token)) {\n stackRPN.push(stackOperations.pop());\n }\n stackOperations.push(token);\n }\n }\n while (!stackOperations.empty()) {\n stackRPN.push(stackOperations.pop());\n }\n Collections.reverse(stackRPN);\n\n // Evaluation if RPN expression\n while (!stackRPN.empty()) {\n if (isNumber(stackRPN.lastElement())) stackTemp.push(stackRPN.pop());\n else stackTemp.push(makeOperation(stackRPN.pop(), stackTemp.pop(), stackTemp.pop()));\n }\n result = stackTemp.pop();\n return result;\n }", "@Override\n\tpublic String visitExpr(MicroParser.ExprContext ctx) {\n\t\tString prefix = visit(ctx.expr_prefix());\n\t\tString expr = prefix + visit(ctx.term());\n\t\t\n\t\t//System.out.println(\"in visit expr: \"+expr);\n\t\t//System.out.println(\"in visit expr: prefix is: \"+prefix);\n\t\tif((prefix.contentEquals(\"\"))) return expr;\n\t\tString op1, op2, result;\n\t\tString type = currentType;\n\t\tString[] ids = expr.split(\"\\\\-|\\\\+\");\n\t List<String> operands = new ArrayList<String>();\n\t List<Character> addops = new ArrayList<Character>();\n\t \n\t for(int i=0;i<expr.length();i++) {\n\t \tif(expr.charAt(i)=='+' || expr.charAt(i)=='-')\n\t \t\taddops.add(expr.charAt(i));\n\t }\n\t //create a list of addops\n\t \n\t //create a list of operands \n\t for(String i:ids) \n\t \t operands.add(i);\n\t \n\t op1 = operands.get(0);\n\t op2 = operands.get(1);\n\t temp = new Temporary(type);\n\t result = temp.fullName;\n\t tempList.addT(temp);\n\t //System.out.println(\"in visit expr, ops are: \"+op1+\" \"+ op2);\n\t //System.out.println(\"in visit expr, result is: \"+ result);\n\t if(addops.get(0)=='+') {\n\t \tglobalIR.addStmt(IRStatement.generateArithmetic(type, \"ADD\", op1, op2, result));\n\t \toperands.remove(0); operands.remove(0); addops.remove(0);\n\t }\n\t \t\n\t else {\n\t \tglobalIR.addStmt(IRStatement.generateArithmetic(type, \"SUB\", op1, op2, result));\n\t \toperands.remove(0); operands.remove(0); addops.remove(0);\n\t }\n\t \n\t \t\n\t if(operands.size()==0) return result;\n\t \n\t for(int i=0; i<operands.size();i++) {\n\t \top1 = result;\n\t \top2 = operands.get(i);\n\t \ttemp = new Temporary(type);\n\t \tresult = temp.fullName;\n\t \ttempList.addT(temp);\n\t \tif(addops.get(0)=='+') {\n\t\t \tglobalIR.addStmt(IRStatement.generateArithmetic(type, \"ADD\", op1, op2, result));\n\t\t \taddops.remove(0);\n\t \t}\n\t\t \t\n\t\t else {\n\t\t \tglobalIR.addStmt(IRStatement.generateArithmetic(type, \"SUB\", op1, op2, result));\n\t\t \taddops.remove(0);\n\t\t }\n\t\t \t\n\t }\n\t return result; \n\t\t\n\t}", "public static BinaryExpression divideAssign(Expression expression0, Expression expression1, Method method) { throw Extensions.todo(); }", "public final EObject ruleSplitOperator() throws RecognitionException {\n EObject current = null;\n\n Token otherlv_0=null;\n Token otherlv_1=null;\n Token otherlv_3=null;\n EObject lv_parameter_2_0 = null;\n\n\n enterRule(); \n \n try {\n // ../de.hs_rm.cs.vs.dsm.flow/src-gen/de/hs_rm/cs/vs/dsm/parser/antlr/internal/InternalFlow.g:924:28: ( (otherlv_0= 'split' otherlv_1= '(' ( (lv_parameter_2_0= ruleStreamOperatorParameter ) ) otherlv_3= ')' ) )\n // ../de.hs_rm.cs.vs.dsm.flow/src-gen/de/hs_rm/cs/vs/dsm/parser/antlr/internal/InternalFlow.g:925:1: (otherlv_0= 'split' otherlv_1= '(' ( (lv_parameter_2_0= ruleStreamOperatorParameter ) ) otherlv_3= ')' )\n {\n // ../de.hs_rm.cs.vs.dsm.flow/src-gen/de/hs_rm/cs/vs/dsm/parser/antlr/internal/InternalFlow.g:925:1: (otherlv_0= 'split' otherlv_1= '(' ( (lv_parameter_2_0= ruleStreamOperatorParameter ) ) otherlv_3= ')' )\n // ../de.hs_rm.cs.vs.dsm.flow/src-gen/de/hs_rm/cs/vs/dsm/parser/antlr/internal/InternalFlow.g:925:3: otherlv_0= 'split' otherlv_1= '(' ( (lv_parameter_2_0= ruleStreamOperatorParameter ) ) otherlv_3= ')'\n {\n otherlv_0=(Token)match(input,27,FOLLOW_27_in_ruleSplitOperator2022); \n\n \tnewLeafNode(otherlv_0, grammarAccess.getSplitOperatorAccess().getSplitKeyword_0());\n \n otherlv_1=(Token)match(input,21,FOLLOW_21_in_ruleSplitOperator2034); \n\n \tnewLeafNode(otherlv_1, grammarAccess.getSplitOperatorAccess().getLeftParenthesisKeyword_1());\n \n // ../de.hs_rm.cs.vs.dsm.flow/src-gen/de/hs_rm/cs/vs/dsm/parser/antlr/internal/InternalFlow.g:933:1: ( (lv_parameter_2_0= ruleStreamOperatorParameter ) )\n // ../de.hs_rm.cs.vs.dsm.flow/src-gen/de/hs_rm/cs/vs/dsm/parser/antlr/internal/InternalFlow.g:934:1: (lv_parameter_2_0= ruleStreamOperatorParameter )\n {\n // ../de.hs_rm.cs.vs.dsm.flow/src-gen/de/hs_rm/cs/vs/dsm/parser/antlr/internal/InternalFlow.g:934:1: (lv_parameter_2_0= ruleStreamOperatorParameter )\n // ../de.hs_rm.cs.vs.dsm.flow/src-gen/de/hs_rm/cs/vs/dsm/parser/antlr/internal/InternalFlow.g:935:3: lv_parameter_2_0= ruleStreamOperatorParameter\n {\n \n \t newCompositeNode(grammarAccess.getSplitOperatorAccess().getParameterStreamOperatorParameterParserRuleCall_2_0()); \n \t \n pushFollow(FOLLOW_ruleStreamOperatorParameter_in_ruleSplitOperator2055);\n lv_parameter_2_0=ruleStreamOperatorParameter();\n\n state._fsp--;\n\n\n \t if (current==null) {\n \t current = createModelElementForParent(grammarAccess.getSplitOperatorRule());\n \t }\n \t\tset(\n \t\t\tcurrent, \n \t\t\t\"parameter\",\n \t\tlv_parameter_2_0, \n \t\t\"StreamOperatorParameter\");\n \t afterParserOrEnumRuleCall();\n \t \n\n }\n\n\n }\n\n otherlv_3=(Token)match(input,22,FOLLOW_22_in_ruleSplitOperator2067); \n\n \tnewLeafNode(otherlv_3, grammarAccess.getSplitOperatorAccess().getRightParenthesisKeyword_3());\n \n\n }\n\n\n }\n\n leaveRule(); \n }\n \n catch (RecognitionException re) { \n recover(input,re); \n appendSkippedTokens();\n } \n finally {\n }\n return current;\n }", "public static BinaryExpression divide(Expression expression0, Expression expression1) { throw Extensions.todo(); }", "public static BinaryExpression divideAssign(Expression expression0, Expression expression1) { throw Extensions.todo(); }", "public Object[] plotStrEvalsComp2Split(Object... rhs) throws RemoteException;", "private TreeNode exprTreeHelper(String expr) {\n if (expr.charAt(0) != '(') {\n \n \treturn new TreeNode(expr); // you fill this in\n } else{\n // expr is a parenthesized expression.\n // Strip off the beginning and ending parentheses,\n // find the main operator (an occurrence of + or * not nested\n // in parentheses, and construct the two subtrees.\n int nesting = 0;\n int opPos = 0;\n char myChar='\\0';\n \n for (int k = 1; k < expr.length() - 1; k++) {\n myChar = expr.charAt(k);\n \tif(myChar == '('){\n \tnesting++;\n }\n if(myChar==')'){\n \tnesting--;\n }\n if(nesting == 0){\n \tif(myChar == '+' || myChar == '*'){\n \t\topPos = k;\n \t break;\t\n \t}\n }\n }\n \n String opnd1 = expr.substring(1, opPos);\n String opnd2 = expr.substring(opPos + 1, expr.length() - 1);\n String op = expr.substring(opPos, opPos + 1);\n System.out.println(\"expression = \" + expr);\n System.out.println(\"operand 1 = \" + opnd1);\n System.out.println(\"operator = \" + op);\n System.out.println(\"operand 2 = \" + opnd2);\n System.out.println();\n return new TreeNode(op,exprTreeHelper(opnd1),exprTreeHelper(opnd2));\n \n }\n }", "protected void operation(String op) {\n \tint value;\n \tif (stack.empty()) {\n \t\tenter();\n \t}\n \telse {\n \t\tint second = stack.pop();\n \t // handles when only one value in stack\n \t\tif (stack.empty()) {\n \t\t\tif (op.equals(\"+\")) {\n \t\t\t\tstack.push(second);\n \t\t\t}\n \t\t\telse if (op.equals(\"-\")) {\n \t\t\t\tcurrent = second *-1;\n \t\t\t\tstack.push(current);\n \t\t\t\tshow(stack.peek());\n \t\t\t\tcurrent = 0;\n \t\t\t}\n \t\t\telse if (op.equals(\"*\")) {\n \t\t\t\tstack.push(0);\n \t\t\t\tshow(stack.peek());\n \t\t\t}\n \t\t\telse {\n \t\t\t\tstack.push(0);\n \t\t\t\tshow(stack.peek());\n \t\t\t}\n \t\t}\n \t // handles the other cases\n \t\telse {\n \t\t\tif (op.equals(\"+\")) {\n \t\t\t\tvalue = second + stack.pop();\n \t\t\t\tdisplayOperatedValue(value);\n \t\t\t}\n \t\t\telse if (op.equals(\"-\")) {\n \t\t\t\tvalue = stack.pop() - second;\n \t\t\t\tdisplayOperatedValue(value);\n \t\t\t}\n \t\t\telse if (op.equals(\"*\")) {\n \t\t\t\tvalue = stack.pop() * second;\n \t\t\t\tdisplayOperatedValue(value);\n \t\t\t}\n \t\t\telse {\n \t\t\t\tvalue = stack.pop() / second;\n \t\t\t\tdisplayOperatedValue(value);\n \t\t\t}\n \t\t}\n \t}\n }", "public OperatorNode(String left, String right, Operator oper, OperatorTable opers) throws IllegalArgumentException {\n this.opers = opers;\n this.oper = oper;\n this.parseExpression(left, right);\n }", "private void processOperator(String operator){\n if (numStack.size() <2){\n System.out.println(\"Stack underflow.\");\n }\n else if (dividingByZero(operator)){\n System.out.println(\"Divide by 0.\"); \n }\n else{\n int num1 = numStack.pop();\n int num2 = numStack.pop();\n int result = performCalculation(num1, num2, operator);\n numStack.push(result);\n }\n\n }", "private static String[] calculateAdditionOrSubtraction(String[] formulaArray, Integer operatorPosition) throws Exception {\n int arrayLength = formulaArray.length;\n String[] arrayAfterCalculations= new String[formulaArray.length-2];\n\n // Same array until the number before the operator.\n for (int i = 0; i < operatorPosition - 1; i++) {\n arrayAfterCalculations[i] = formulaArray[i];\n }\n if(formulaArray[operatorPosition].equals(\"+\")) {\n arrayAfterCalculations[operatorPosition - 1] = add(formulaArray[operatorPosition-1],formulaArray[operatorPosition+1]);\n }else if(formulaArray[operatorPosition].equals(\"-\")) {\n arrayAfterCalculations[operatorPosition - 1] = subtract(formulaArray[operatorPosition-1],formulaArray[operatorPosition+1]);\n }else{\n throw new Exception(\"Unknown Operation Exception\");\n }\n // the rest of the array\n for (int i = operatorPosition+2; i < formulaArray.length; i++) {\n arrayAfterCalculations[i-2]= formulaArray[i];\n }\n return arrayAfterCalculations;\n }", "public interface Unary extends Expr \n{\n /** Unary expression operator. */\n public static enum Operator {\n BIT_NOT (\"~\", true),\n NEG (\"-\", true),\n POST_INC (\"++\", false),\n POST_DEC (\"--\", false),\n PRE_INC (\"++\", true),\n PRE_DEC (\"--\", true),\n POS (\"+\", true),\n NOT (\"!\", true),\n CARET (\"^\", true),\n BAR (\"|\", true),\n AMPERSAND(\"&\", true),\n STAR (\"*\", true),\n SLASH (\"/\", true),\n PERCENT (\"%\", true);\n\n protected boolean prefix;\n protected String name;\n\n private Operator(String name, boolean prefix) {\n this.name = name;\n this.prefix = prefix;\n }\n\n /** Returns true of the operator is a prefix operator, false if\n * postfix. */\n public boolean isPrefix() { return prefix; }\n\n @Override public String toString() { return name; }\n }\n\n public static final Operator BIT_NOT = Operator.BIT_NOT;\n public static final Operator NEG = Operator.NEG;\n public static final Operator POST_INC = Operator.POST_INC;\n public static final Operator POST_DEC = Operator.POST_DEC;\n public static final Operator PRE_INC = Operator.PRE_INC;\n public static final Operator PRE_DEC = Operator.PRE_DEC;\n public static final Operator POS = Operator.POS;\n public static final Operator NOT = Operator.NOT;\n public static final Operator CARET = Operator.CARET;\n public static final Operator BAR = Operator.BAR;\n public static final Operator AMPERSAND = Operator.AMPERSAND;\n public static final Operator STAR = Operator.STAR;\n public static final Operator SLASH = Operator.SLASH;\n public static final Operator PERCENT = Operator.PERCENT;\n\n /** The sub-expression on that to apply the operator. */\n Expr expr();\n /** Set the sub-expression on that to apply the operator. */\n Unary expr(Expr e);\n\n /** The operator to apply on the sub-expression. */\n Operator operator();\n /** Set the operator to apply on the sub-expression. */\n Unary operator(Operator o);\n}", "private void Operation(String operator, String x, String y){\n\t\tswitch(operator){\r\n\t\t\tcase \"+\":\r\n\t\t\t\tSystem.out.print(\"Result: \" + addition(x, y));\r\n\t\t\t\tbreak;\r\n\r\n\t\t\tcase \"-\":\r\n\t\t\t\tSystem.out.print(\"Result: \" + substraction(x, y));\r\n\t\t\t\tbreak;\r\n\r\n\t\t\tcase \"*\":\r\n\t\t\t\tSystem.out.print(\"Result: \" + multiplication(x, y));\r\n\t\t\t\tbreak;\r\n\r\n\t\t\tcase \"/\":\r\n\t\t\t\tSystem.out.print(\"Result: \" + division(x, y));\r\n\t\t\t\tbreak;\r\n\r\n\t\t\t\tdefault:\r\n\t\t\t\tnotOperation = true;\r\n\r\n\t\t}\r\n\t}", "public ExpressionPart parseExpressions (String[] exp, QBParser parser) {\n\t\texp = fixArray(exp);\n\t//\tSystem.out.println(\"EXPS: \" + Arrays.toString(exp));\n\t\tif(exp[0].startsWith(\"if\")){\n\t\t\tif( (exp[0].length() > 2 && !Character.isLetterOrDigit( exp[0].charAt(2) )) || exp[0].length() == 2){\n\t\t\t\tString name = ExpressionPuller.pullIfThenElse(exp, parser.getCurrentCompilingNamespace());\n\t\t\t\texp = new String[]{name};\n\t\t\t}\n\t\t}\n\t\t\n//\t\tif(exp[0].equals(\"if\")){\n//\t\t\tint thenIdx = MArrays.indexOf(exp, \"then\");\n//\t\t\tString ifPart = MArrays.concat(exp, 1, thenIdx-1);\n//\t\t\t\n//\t\t\tint elseIdx = MArrays.indexOf(exp, \"else\");\n//\t\t\tString thenPart = MArrays.concat(exp, thenIdx+1, elseIdx-thenIdx-1);\n//\t\t\t\n//\t\t\tString elsePart = MArrays.concat(exp, elseIdx+1);\n//\t\t\t\n//\t\t\tExpressionPart ifExpPart = parseExpressions(ifPart);\n//\t\t\tExpressionPart thenExpPart = parseExpressions(thenPart);\n//\t\t\tExpressionPart elseExpPart = parseExpressions(elsePart);\n//\t\t\t\n//\t\t\tExpressionPart totalIf = ExpressionPart.makePrimaryExpressionPart(null, \"if\", new ExpressionPart[]{ifExpPart});\n//\t\t\tExpressionPart totalThen = ExpressionPart.makePrimaryExpressionPart(totalIf, \"then\", new ExpressionPart[]{thenExpPart});\n//\t\t\tExpressionPart total = ExpressionPart.makePrimaryExpressionPart(totalThen, \"else\", new ExpressionPart[]{elseExpPart});\n//\t\t\n//\t\t\treturn total;\n//\t\t}\n\t\t\n\n\t\t// Go though all of the operators in order from their respective order of operations.\n\t\tfor( String[] ops : operators() ){\n\t\t\t\n\t\t\tint idx = -1;\n\t\t\t// Some operators have the same precedence, so we need to deal with that\n\t\t\tfor( String op : ops ) {\n\t\t\t\tidx = Math.max(idx, MArrays.lastIndexOf(exp, op));\n\t\t\t}\n\t\t\t\n\t\t\t// if we found one of these opeartors, then we\n\t\t\t// need to deal with it.\n\t\t\tif( idx != -1 ){\n\t\t\t\t// get the function (thats easy, it is what we just found)\n\t\t\t\tString function = exp[idx];\n\t\t\t\t\n\t\t\t\t// get all stuff before and after this point\n\t\t\t\t// the first is the caller and the second is the\n\t\t\t\t// argument believe me it works because\n\t\t\t\t// 3 * 4 / 6 + 1 * 2 - 3 ^ 2 * 2 = (3 * 4 / 6 + 1 * 2) - (3 ^ 2 * 2)\n\t\t\t\tString[] before = Arrays.copyOfRange(exp, 0, idx);\n\t\t\t\tString[] after = Arrays.copyOfRange(exp, idx + 1, exp.length);\n\t\t\t\t\n\t\t\t\t// now, using recursion we make the expression parts out of them\n\t\t\t\tExpressionPart part1 = parseExpressions( before, parser );\n\t\t\t\tExpressionPart part2 = parseExpressions( after, parser );\n\t\t\t\t\n\t\t\t\tif(function.equals(\"->\")){\n\t\t\t\t\tExpressionPart tmp = part1;\n\t\t\t\t\tpart1 = part2;\n\t\t\t\t\tpart2 = tmp;\n\t\t\t\t}\n\t\t\t\t// now put the whole thing together, and you now have a mess\n\t\t\t\treturn ExpressionPart.makePrimaryExpressionPart(part1, function, new ExpressionPart[]{part2} );\n\t\t\t}\n\t\t\t\t\n\t\t\t\n\t\t}\n\t\t\n\t\t// If there are no more \"Binary Functions\"\n\t\t// what is left must be grouped or it must be a function\n\t\tif( exp.length == 1 ){\n\t\t\tString str = exp[0];\n\t\t\tif( completelySurrounded(str) ){\n\t\t\t\tString middle = str.substring(1, str.length() - 1);\n\t\t\t\treturn parseExpressions(middle);\n\t\t\t}\n\t\t\t// This must then be a function\n\t\t\telse if(str.endsWith(\")\")){\n\t\t\t\t\n\t\t\t\t// this function will get the last index of a dot ('.') that is outside parenthesis\n\t\t\t\t// the dot is used to determine if the function is being called by an object\n\t\t\t\tint dotIdx = lastDotIndex(str);\n\t\t\t\t\n\t\t\t\t// now we find the index that the arguments start on\n\t\t\t\tint idx = str.indexOf('(',dotIdx);\n\t\t\t\t\n\t\t\t\t// check to make sure there is one.\n\t\t\t\tif( idx < 0 ){\n\t\t\t\t\tthrow new RuntimeException(\"Expected '('\");\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t// from here it is pretty straight forward to get the function,\n\t\t\t\t// caller and parameters.\n\t\t\t\tString function = str.substring(0, idx);\n\t\t\t\tString args = str.substring(idx + 1, str.length() - 1);\n\t\t\t\tString caller = null;\n\t\t\t\t\n\t\t\t\t// if there is not dot, then there is no caller and the function is global\n\t\t\t\tif( dotIdx >= 0 ){\n\t\t\t\t\tcaller = function.substring( 0, dotIdx );\n\t\t\t\t\tfunction = function.substring( dotIdx + 1 );\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t// now use recursion to build the parts and make a new part.\n\t\t\t\tExpressionPart part1 = caller !=null ? parseExpressions(caller) : null;\n\t\t\t\tExpressionPart[] parts = parseParams(args);\n\t\t\t\t\n\t\t\t\treturn ExpressionPart.makePrimaryExpressionPart(part1, function, parts);\n\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t\telse{\n\t\t\t\t// This is the base case, the very bottom of the ladder, this is where all\n\t\t\t\t// that is left is some entity that has no function.\n\t\t\t\treturn ExpressionPart.makeExpressionPart(exp[0]);\n\t\t\t}\n\t\t}\n\t\t\n\t\tthrow new RuntimeException(\"Syntax Error\");\n\t}", "private static String infixToPostfix(String expression)\r\n {\r\n String result = \"\";\r\n char current_char = ' ';\r\n int index = 0;\r\n StackInterface<Character> operand_stack = new ArrayStack<>();\r\n switch(stack_type)\r\n {\r\n case(\"vector\"):\r\n operand_stack = new VectorStack<>();\r\n break;\r\n \r\n case(\"linked\"):\r\n operand_stack = new LinkedListStack<>();\r\n break;\r\n }\r\n\r\n //iterates through every character and puts them in the stack or the result accordingly\r\n while(index < expression.length())\r\n {\r\n current_char = expression.charAt(index);\r\n switch(current_char)\r\n {\r\n //checks if the character is an operand and if so checks if it should pop the previous input or not\r\n case '+': case '-': case '*': case '/':\r\n if(!operand_stack.isEmpty())\r\n {\r\n while(!operand_stack.isEmpty() && getOperandImportance(current_char) <= getOperandImportance(operand_stack.peek()))\r\n {\r\n result += operand_stack.pop();\r\n }\r\n operand_stack.push(current_char);\r\n }\r\n else\r\n {\r\n operand_stack.push(current_char);\r\n }\r\n break;\r\n\r\n //exponents are always pushed onto the stack\r\n case '^':\r\n operand_stack.push(current_char);\r\n break;\r\n\r\n //if an open delimiter is there, we add it to the stack\r\n case '(': case '{': case '[':\r\n operand_stack.push(current_char);\r\n break;\r\n \r\n //if the delimiter is closing we pop until we find the open equivalent\r\n case ')': case '}': case ']':\r\n while(operand_stack.peek() != delimiterEquivalent(current_char))\r\n {\r\n result += operand_stack.pop();\r\n }\r\n operand_stack.pop();\r\n break;\r\n\r\n case ' ':\r\n break;\r\n\r\n default: \r\n result += current_char;\r\n break;\r\n }\r\n index++;\r\n }\r\n\r\n //pops everything left in the stack to the result at the end\r\n while(!operand_stack.isEmpty())\r\n {\r\n result += operand_stack.pop();\r\n }\r\n\r\n return result;\r\n }", "public int calculate_2(String s) {\n if ((s == null) || (s.length() == 0)) return 0;\n int i = 0;\n int j = 0;\n s = s.replace(\" \", \"\");\n String val = \"\";\n boolean ifStop = true;\n while (i < s.length()) {\n if ((s.charAt(i) == '+') || (s.charAt(i) == '-') || (s.charAt(i) == '*')\n || (s.charAt(i) == '/')) {\n j = i;\n ifStop = false;\n break;\n } else {\n val = val + s.charAt(i);\n }\n i++;\n }\n if (ifStop) return Integer.parseInt(val);\n while (j < s.length()) {\n char op = s.charAt(j);\n if (op == ' ') {\n j++;\n continue;\n }\n if ((op == '+') || (op == '-')) {\n int nextOperator = calculate(s.substring(j + 1, s.length()));\n // System.out.println(nextOperator);\n if (op == '+') return (Integer.parseInt(val) + nextOperator);\n else if (op == '-') return (Integer.parseInt(val) - nextOperator);\n j++;\n } else {\n i = j + 1;\n String anotherval = \"\";\n ifStop = true;\n while (i < s.length()) {\n if ((s.charAt(i) == '+') || (s.charAt(i) == '-') || (s.charAt(i) == '*')\n || (s.charAt(i) == '/')) {\n j = i;\n ifStop = false;\n break;\n } else {\n anotherval = anotherval + s.charAt(i);\n }\n i++;\n }\n if (op == '*')\n val = Integer.parseInt(val) * Integer.parseInt(anotherval) + \"\";\n else if (op == '/')\n val = Integer.parseInt(val) / Integer.parseInt(anotherval) + \"\";\n\n if (ifStop)\n return Integer.parseInt(val);\n }\n }\n return Integer.parseInt(val);\n }", "public Command createOperationCommand(int operator, Operand operand1, Operand operand2);", "private TreeNode exprTreeHelper(String expr) {\n if (expr.charAt(0) != '(') {\n return new TreeNode(expr); // you fill this in\n } else {\n // expr is a parenthesized expression.\n // Strip off the beginning and ending parentheses,\n // find the main operator (an occurrence of + or * not nested\n // in parentheses, and construct the two subtrees.\n int nesting = 0;\n int opPos = 0;\n for (int k = 1; k < expr.length() - 1; k++) {\n // you supply the missing code\n \tif (nesting == 0) {\n \t\tif (expr.charAt(k) == '+' || expr.charAt(k) == '*') {\n \t\t\topPos = k;\n \t\t}\n \t}\n \tif (expr.charAt(k) == '(') {\n \t\tnesting++;\n \t} else if (expr.charAt(k) == ')') {\n \t\tnesting--;\n \t}\n }\n String opnd1 = expr.substring(1, opPos);\n String opnd2 = expr.substring(opPos + 1, expr.length() - 1);\n String op = expr.substring(opPos, opPos + 1);\n System.out.println(\"expression = \" + expr);\n System.out.println(\"operand 1 = \" + opnd1);\n System.out.println(\"operator = \" + op);\n System.out.println(\"operand 2 = \" + opnd2);\n System.out.println();\n return new TreeNode(op, exprTreeHelper(opnd1), exprTreeHelper(opnd2)); // you fill this in\n }\n }", "public static String unload( int op, ALStack<String> numbers )\n {\n\tint i = 0;\n\tint operand = 0;\n\tString ret = \"\";\n\twhile( !(numbers.peek().equals(\")\") )) {\n\t\tint next = Integer.parseInt(numbers.pop());\n\t\tif(op == 1)\n\t\t i += next;\n\n\t\telse if(op == 2)\n\t\t i -= next;\n\t\t\n\t\telse if(op == 3)\n\t\t i *= next;\n\n\t}\n\tif(numbers.peek().equals(\")\")) {\n\t return ret += i;\n\t}\n\tif( numbers.peek().equals(\"(\")){\n\t \n\t if(op == 1){\n\t\tnumbers.pop();\n\t\toperand = findOp(numbers.pop());\n\t\treturn ret += (i + Integer.parseInt(unload(operand,numbers))) ;\n\t }\n\t \n\t else if(op == 2){\n\t\tnumbers.pop();\n\t\toperand = findOp(numbers.pop());\n\t\treturn ret += (i - Integer.parseInt(unload(operand,numbers)));\n\t }\n\t\n\t else if(op == 3){\n\t\tnumbers.pop();\n\t\toperand = findOp(numbers.pop());\n\t\treturn ret += (i - Integer.parseInt(unload(operand,numbers)));\n\t }\n\t}\n\tret += i;\n\treturn ret;\n }", "private Operator compile(List<Operator> ops, int offset, int length) {\n \n int lLength = findExpression(ops, offset, length);\n \n if (lLength == length){\n \n // Case 1: EXPR\n if (length == 1){\n \n // Return single operator\n return ops.get(offset);\n \n } else if ((ops.get(offset) instanceof PrecedenceOperator) &&\n (ops.get(offset + length - 1) instanceof PrecedenceOperator)){\n \n // Remove brackets\n return compile(ops, offset+1, length-2);\n \n } else {\n throw new RuntimeException(\"Invalid expression\");\n }\n \n } else {\n \n // Case 2: EXPR <OP> EXPR\n if (!(ops.get(offset + lLength) instanceof BinaryOperator)){\n \n // Invalid\n throw new RuntimeException(\"Expecting EXPR <OP> EXPR\");\n } else {\n \n // Binary operator\n BinaryOperator bop = (BinaryOperator)ops.get(offset + lLength);\n bop.left = compile(ops, offset, lLength);\n bop.right = compile(ops, offset + lLength + 1, length - lLength - 1);\n return bop;\n }\n }\n }", "public String infixToPostfix(String expression) {\n\t\tStack oPSt = new Stack();\n\t\tStack Sign = new Stack();\n\t\tStringBuilder PFE = new StringBuilder();\n\t\tString n = \"\";\n\t\t// flag -> marks adding new operator to the stack with or without removing the\n\t\t// previous one\n\t\tboolean flag = true;\n\t\t//negflag -> if (true) previous character was operator thus next(-) is negative sign\n\t\t//\t\t\t if (false) previous character was operand thus next (-) is operator\n\t\tboolean negflag = true; \n\t\tint counter = 0; // expresses number of open parenthesis at the moment and if it matches the\n\t\t// counter inside Sign Stack it means that the Sign was changed at this Counter\n\t\tString open = \"(\", closed = \")\";\n\t\tfor (int i = 0; i < expression.length(); i++) {\n\t\t\tString x = expression.substring(i, i + 1);\n\t\t\tStringBuilder longIntegers = new StringBuilder();\n\t\t\tif (x.equals(\"-\") && !expression.substring(i + 1, i + 2).equals(\" \")) {\n\t\t\t\tif(negflag) {\n\t\t\t\tif (n.equals(\"\"))\n\t\t\t\t\tn = \"-\";\n\t\t\t\telse\n\t\t\t\t\tn = \"\";\n\t\t\t\tSign.push(counter);\n\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tint counter2 = 0;\n\t\t\t\twhile (counter2 + i < expression.length()\n\t\t\t\t\t\t&& (isChar(expression.substring(i + counter2, i + counter2 + 1))\n\t\t\t\t\t\t\t\t|| isNum(expression.substring(i + counter2, i + counter2 + 1)))\n\t\t\t\t\t\t&& isNotOperator(expression.substring(i + counter2, i + counter2 + 1))) {\n\t\t\t\t\tlongIntegers.append(expression.substring(i + counter2, i + 1 + counter2));\n\t\t\t\t\tcounter2++;\n\t\t\t\t}\n\t\t\t\ti = i + counter2;\n\t\t\t\tif (counter2 > 0) {\n\t\t\t\t\ti--;\n\t\t\t\t\tx = longIntegers.toString();\n\t\t\t\t}\n\t\t\t}\n\t\t\t// end of taking the expression\n\n\t\t\t// testing the expression\n\n\t\t\t// if the char. is an open parenthesis\n\t\t\tif (x.equals(open)) {\n\t\t\t\toPSt.push(x);\n\t\t\t\tcounter++;\n\t\t\t}\n\t\t\t// if the char is a close parenthesis\n\t\t\telse if (x.equals(closed)) {\n\t\t\t\tif (counter == 0)\n\t\t\t\t\tthrow new RuntimeException(\"Invalid Input: Redundant \\\")\\\" \");\n\t\t\t\twhile (!((String) oPSt.peek()).equals(open)) {\n\t\t\t\t\tPFE.append(\" \");\n\t\t\t\t\tPFE.append(oPSt.pop());\n\t\t\t\t}\n\t\t\t\toPSt.pop();\n\t\t\t\tcounter--;\n\t\t\t}\n\t\t\t// checks if char was an operator\n\t\t\telse if (x.equals(\"*\") || x.equals(\"+\") || x.equals(\"/\") || x.equals(\"-\")) {\n\t\t\t\tnegflag = true;\n\t\t\t\twhile (!oPSt.isEmpty() && !((String) oPSt.peek()).equals(\"(\")) {\n\t\t\t\t\t// see which character has higher precedence\n\t\t\t\t\tflag = highOrLow(((String) oPSt.peek()).charAt(0), x.charAt(0));\n\t\t\t\t\tif (flag)\n\t\t\t\t\t\tbreak;\n\t\t\t\t\telse {\n\t\t\t\t\t\tPFE.append(\" \");\n\t\t\t\t\t\tPFE.append(oPSt.pop());\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\toPSt.push(x);\n\t\t\t}\n\t\t\t// if the char is space then check if the previous was space to avoid having two\n\t\t\t// spaces after each other\n\t\t\t// if the char was a new space/wasn't a space then it's definitely a\n\t\t\t// number/variable and will be pushed to PFE\n\t\t\telse if (!x.equals(\" \") || (PFE.length() > 0 && (char) PFE.charAt(PFE.length() - 1) != ' ')) {\n\t\t\t\tPFE.append(\" \");\n\t\t\t\tif (!x.equals(\" \")) {\n\t\t\t\t\tnegflag = false;\n\t\t\t\t\tPFE.append(n + x);\n\t\t\t}else \n\t\t\t\t\tPFE.append(x);\n\t\t\t\t\n\t\t\t}\n\t\t\twhile (!Sign.isEmpty() && counter == (int) Sign.peek()) {\n\t\t\t\tif (n.equals(\"\"))\n\t\t\t\t\tn = \"-\";\n\t\t\t\telse\n\t\t\t\t\tn = \"\";\n\t\t\t\tSign.pop();\n\t\t\t}\n\t\t}\n\t\t// add all the operator remaining in stack to the PFE except if '(' was found\n\t\t// then there's an runtime exception\n\t\twhile (!oPSt.isEmpty()) {\n\t\t\tif (((String) oPSt.peek()).equals(\"(\"))\n\t\t\t\tthrow new RuntimeException(\"Invalid Input : Redundant \\\"(\\\" \");\n\t\t\tPFE.append(\" \");\n\t\t\tPFE.append(oPSt.pop());\n\t\t}\n\t\t// replace any two consecutive spaces with only one\n\t\tint i = 0;\n\t\twhile (PFE.charAt(i) == ' ' && i < PFE.length() - 1) {\n\t\t\tPFE.deleteCharAt(i);\n\t\t}\n\t\tfor (i = 0; i < PFE.length() - 1; i++) {\n\t\t\tif (PFE.charAt(i) == ' ' && PFE.charAt(i + 1) == ' ') {\n\t\t\t\tPFE.deleteCharAt(i);\n\t\t\t\ti--;\n\t\t\t}\n\t\t}\n\t\treturn PFE.toString();\n\n\t}", "private void parseExpression(String l, String r) throws IllegalArgumentException {\n this.leftChild = this.parse(l, this.opers);\n this.rightChild = this.parse(r, this.opers);\n }", "public static void main(String[] args) {\n\t\tString str = \"32+5*2-40/3\";\r\n\t\t/*\r\n\t\tPattern p = Pattern.compile(\"(([0-9]+)(\\\\+\\\\-\\\\*\\\\/)?)+\");\r\n\t\tMatcher m = p.matcher(str);\r\n\t\tSystem.out.println(m.find());\r\n\t\tSystem.out.println(m.groupCount());\r\n\t\tSystem.out.println(m.group(1));\r\n\t\tSystem.out.println(m.group(2));\r\n\t\tSystem.out.println(m.group(3));\r\n\t\t*/\r\n\t\tString[] sub = str.split(\"\\\\+|\\\\-|\\\\*|\\\\/\");\r\n\t\tfor(String s : sub) {\r\n\t\t\tSystem.out.println(s);\r\n\t\t}\r\n\t\t\r\n\t}", "public String[] processString(String sMath){\n String s1 = \"\", elementMath[];\r\n sMath = sMath.trim();\r\n sMath = sMath.replaceAll(\"\\\\s+\",\" \"); // chuan hoa sMath\r\n for (int i=0; i<sMath.length(); i++){\r\n char c = sMath.charAt(i);\r\n if (!isOperator(c)) s1 = s1 + c;\r\n else s1 = s1 + \" \" + c + \" \";\r\n }\r\n s1 = s1.trim();\r\n s1 = s1.replaceAll(\"\\\\s+\",\" \"); // chuan hoa s1\r\n elementMath = s1.split(\" \"); //tach s1 thanh cac phan tu\r\n return elementMath;\r\n }", "public static String parseOperator(String operator) {\n\t\tif (StringUtils.isEmpty(operator))\n\t\t\treturn SqlBuilder.EQUAL;\n\t\telse if (\"Equals\".equals(operator))\n\t\t\treturn SqlBuilder.EQUAL;\n\t\telse if (\"Between\".equals(operator))\n\t\t\treturn SqlBuilder.BETWEEN;\n\t\telse if (\"LessThan\".equals(operator))\n\t\t\treturn SqlBuilder.LT;\n\t\telse if (\"GreaterThan\".equals(operator))\n\t\t\treturn SqlBuilder.GT;\n\t\telse if (\"IsNotNull\".equals(operator))\n\t\t\treturn SqlBuilder.NOT_NULL;\n\t\telse if (\"IsNull\".equals(operator))\n\t\t\treturn SqlBuilder.IS_NULL;\n\t\telse if (\"NotLike\".equals(operator))\n\t\t\treturn SqlBuilder.NOT_LIKE;\n\t\telse if (\"Like\".equals(operator))\n\t\t\treturn SqlBuilder.LIKE;\n\t\telse if (\"NotIn\".equals(operator))\n\t\t\treturn SqlBuilder.NOT_IN;\n\t\telse if (\"In\".equals(operator))\n\t\t\treturn SqlBuilder.IN;\n\t\telse if (\"NotNull\".equals(operator))\n\t\t\treturn SqlBuilder.NOT_NULL;\n\t\telse if (\"Not\".equals(operator))\n\t\t\treturn SqlBuilder.IS_NOT;\n\t\telse\n\t\t\tthrow new RuntimeException(\"无法识别该类过滤操作:\" + operator);\n\t}", "private void assertProperExpression(String expression) throws InvalidExpressionException {\n char lastItem = '^';\n int parentheseseCount = 0;\n\n for (int i = 0; i < expression.length(); i++) {\n char item = expression.charAt(i);\n // ignore spaces\n if (item == ' ') continue;\n\n // asserts that item is digit or operator\n if (!isDigit(item) && !isOperator(item) && !isParenthesis(item))\n throw new InvalidExpressionException(\"INVALID CHARACTER\", i);\n // asserts that here are more open parentheses than closed\n if (item == '(') parentheseseCount++;\n if (item == ')') parentheseseCount--;\n if (parentheseseCount < 0)\n throw new InvalidExpressionException(\"TOO MANY CLOSING PARENTHESES\", i); \n // asserts there are never two digits in a row\n if (isDigit(lastItem) && isDigit(item))\n throw new InvalidExpressionException(\"TOO MANY DIGITS IN NUMBER\", i);\n // asserts coefficients to expressions in parentheses have astrisks: \"6(1)\" invalid\n if (isDigit(lastItem) && item == '(')\n throw new InvalidExpressionException(\"USE ASTRISK FOR MULTIPLICATION\", i);\n // asserts there are never two operators in a row, except for parentheses\n if (isOperator(lastItem) && isOperator(item))\n throw new InvalidExpressionException(\"TOO MANY OPERATORS IN A ROW\", i);\n // asserts there are no parenthesese open or closed on operators: \"+)\" or \"(+\"\n if (isOperator(lastItem) && item == ')' || lastItem == '(' && isOperator(item))\n throw new InvalidExpressionException(\"PARENTHESIS NEXT TO OPERATOR\", i);\n // asserts there are no empty parenthesis: \"()\"\n if (lastItem == '(' && item == ')')\n throw new InvalidExpressionException(\"EMPTY PARENTHESESE ARE INVALID\", i);\n // asserts the expression does not end with an operator\n if (i == expression.length()-1 && isOperator(item))\n throw new InvalidExpressionException(\"INVALID OPERATOR AT END OF EXPRESSION\", i);\n\n lastItem = item;\n }\n\n // asserts parenthesese were all closed\n if (parentheseseCount != 0)\n throw new InvalidExpressionException(\"TOO MANY OPENING PARENTHESES\");\n }", "public static int mathNumerators(int firstNumerator, int secondNumerator, int firstDenominator,\n int secondDenominator, String operator) {\n int numerator;\n if (operator.equals(\"+\")) {\n numerator = firstNumerator + secondNumerator;\n } else if (operator.equals(\"-\")) {\n numerator = firstNumerator - secondNumerator;\n } else if (operator.equals(\"*\")) {\n numerator = firstNumerator * secondNumerator;\n } else {\n numerator = firstNumerator * secondDenominator;\n }\n return numerator;\n }", "public Expression(String pExpStr) {\n Queue<Token> tokenQueue = new Queue<>();\n setTokenQueue(tokenQueue);\n Tokenizer tokenizer = new Tokenizer(pExpStr);\n Token prevToken = null;\n Token token = tokenizer.nextToken();\n while (token != null) {\n if (token instanceof SubOperator) {\n token = negationCheck(token, prevToken);\n }\n getTokenQueue().enqueue(token);\n prevToken = token;\n token = tokenizer.nextToken();\n }\n }", "public static void main(String[] args) {\n String input = \"( ( 1 + sqrt ( 5 ) ) / 2 )\";\n Stack<String> ops = new Stack<String>();\n Stack<Double> vals = new Stack<Double>();\n String[] temps = input.split(\" \");\n for (String temp : temps) {\n\n if (temp.equals(\"(\")) ;\n else if (temp.equals(\"+\")) ops.push(temp);\n else if (temp.equals(\"-\")) ops.push(temp);\n else if (temp.equals(\"*\")) ops.push(temp);\n else if (temp.equals(\"/\")) ops.push(temp);\n else if (temp.equals(\"sqrt\")) ops.push(temp);\n else if (temp.equals(\")\")){\n String op = ops.pop();\n double v = vals.pop();\n if (op.equals(\"+\")) v = vals.pop() + v;\n else if (op.equals(\"-\")) v = vals.pop() - v;\n else if (op.equals(\"*\")) v = vals.pop() * v;\n else if (op.equals(\"/\")) v = vals.pop() / v;\n else if (op.equals(\"sqrt\")) v = Math.sqrt(v);\n vals.push(v);\n }else {\n vals.push(Double.parseDouble(temp));\n }\n }\n System.out.println(vals.pop());\n }", "private static String[] get3LetExpr(String expr, String op) {\n\t\tString[] exprArr = new String[3]; \n\t\t\n\t\tint commaPos = SyntaxChecker.checkMatchedParansAndReturnNextDelim(expr, op.length() + 1, ',');\n\t\tString label = expr.substring(op.length() + 1, commaPos);\n\t\texprArr[0] = label;\n\t\tif(logger.isDebugEnabled()){\n\t\t\tlogger.debug(\"let label = \" + label);\n\t\t}\n\t\t\n\t\tint secondCommaPos = SyntaxChecker.checkMatchedParansAndReturnNextDelim(expr, commaPos + 1, ',');\n\t\tString expr1 = expr.substring(commaPos + 1, secondCommaPos);\n\t\texprArr[1] = expr1;\n\t\t\n\t\tif(logger.isDebugEnabled()){\n\t\t\tlogger.debug(\"let expr1 = \" + expr1);\n\t\t}\n\t\t\n\t\tint endPos = SyntaxChecker.checkMatchedParansAndReturnNextDelim(expr, secondCommaPos + 1, ')');\n\t\tString expr2 = expr.substring(secondCommaPos + 1, endPos);\n\t\texprArr[2] = expr2;\n\t\tif(logger.isDebugEnabled()){\n\t\t\tlogger.debug(\"let expr2 = \" + expr2);\n\t\t}\n\t\t\n\t\treturn exprArr;\n\t\n\t}", "public void sub(String operand, Integer value) throws Exception{\n if (operand.equals(\"=\")){\n Integer accVal = dataMemory.getData(0);\n dataMemory.setData(0, accVal - value);\n }else if (operand.equals(\" \")){\n Integer regVal = dataMemory.getData(value);\n Integer accVal = dataMemory.getData(0);\n dataMemory.setData(0, accVal - regVal);\n }else if (operand.equals(\"*\")){\n Integer newDirection = dataMemory.getData(value);\n Integer regVal = dataMemory.getData(newDirection);\n Integer accVal = dataMemory.getData(0);\n dataMemory.setData(0, accVal - regVal);\n }else{\n throw new IllegalArgumentException(\"No valid operand\");\n }\n }", "@Test\n public void test_DivisionWithTwoVariables() {\n Operator add = new Operator(new Constant(10), new Variable(\"x\"), Operator.Operators.ADD);\n Operator min = new Operator(new Constant(12), new Variable(\"y\"), Operator.Operators.MINUS);\n Operator mul = new Operator(add, min, Operator.Operators.MUL);\n Operator add2 = new Operator(new Constant(5), new Variable(\"x\"), Operator.Operators.ADD);\n Operator div = new Operator(mul, add2, Operator.Operators.DIV);\n\n\t\t/* x = 3 y = 2 */\n Context c = new Context();\n c.assign(\"x\", 3);\n c.assign(\"y\", 2);\n\n assertThat(div.evaluate(c), is(16.25));\n }", "public static List<Element> Exp2Rpn(String expression) {\r\n\t\tList<String> tokenList = tokenize(expression);\r\n\t\tList<Element> rpn = new LinkedList<Element>();\r\n\t\tStack<Element> stack = new Stack<Element>();\r\n\r\n\t\tfor (String token : tokenList) {\r\n\t\t\tElement currentElement = string2Element(token);\r\n\r\n\t\t\tif (currentElement.isOperator()) {\r\n\t\t\t\twhile (!stack.empty() && precedence(stack.peek(), currentElement) == 1) {\r\n\t\t\t\t\trpn.add(stack.pop());\r\n\t\t\t\t}\r\n\t\t\t\tstack.push(currentElement);\r\n\t\t\t} else if (currentElement.isNumber()) {\r\n\t\t\t\trpn.add(currentElement);\r\n\t\t\t} else if (currentElement.isLeftParenthesis()) {\r\n\t\t\t\tstack.push(currentElement);\r\n\t\t\t} else if (currentElement.isRightParenthesis()) {\r\n\t\t\t\twhile (!stack.peek().isLeftParenthesis()) {\r\n\t\t\t\t\trpn.add(stack.pop());\r\n\t\t\t\t}\r\n\t\t\t\tstack.pop(); // pops '('\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\twhile (!stack.empty()) {\r\n\t\t\trpn.add(stack.pop());\r\n\t\t}\r\n\r\n\t\treturn rpn;\r\n\t}", "public Expression(Expression exp1, Operator op, Expression exp2) {\r\n\t\t// Remember, this is in postfix notation.\r\n\t\telements.addAll(exp1.elements);\r\n\t\telements.addAll(exp2.elements);\r\n\t\telements.add(op);\r\n\t}", "public static Expr parse(String str) {\r\n\t\tExprBinary at = new ExprBinary(null, null); // the root of the tree\r\n\t\tStringBuilder opstore = new StringBuilder(); // stores operator characters\r\n\t\tStringBuilder adder = new StringBuilder(); // stores value characters\r\n\t\tboolean text = false; // whether inside of a string\r\n\r\n\t\tfor (int i = 0; i < str.length(); i++) {\r\n\t\t\tchar c = str.charAt(i);\r\n\t\t\tboolean add = (c != '\\\\'); // whether to add the char to adder. ignore escape char\r\n\t\t\tboolean leftSide = (opstore.length() == 0); // whether on the left side of the binary expression (before the operator)\r\n\t\t\tString adderStr = adder.toString();\r\n\t\t\tString opStr = opstore.toString();\r\n\r\n\t\t\tif (c == '\"') { // string\r\n\t\t\t\tif (i == 0 || str.charAt(i - 1) != '\\\\') {\r\n\t\t\t\t\ttext = !text; // ignore string contents\r\n\t\t\t\t}\r\n\t\t\t} else if (!text) {\r\n\t\t\t\tif (c == ' ') {\r\n\t\t\t\t\tadd = false; // ignore spaces\r\n\t\t\t\t} else if (c == '(') { // grouping or function\r\n\t\t\t\t\tint closeIndex = getExitIndex(str, i);\r\n\t\t\t\t\tString contents = str.substring(i + 1, closeIndex);\r\n\t\t\t\t\tExpr group; // the expression denoted by the parentheses group\r\n\r\n\t\t\t\t\tif (i > 0 && (!isReserved(str.charAt(i - 1)) || str.charAt(i - 1) == ')')) { // function\r\n\t\t\t\t\t\tif (adderStr.isEmpty()) { // function reference call ... func()()\r\n\t\t\t\t\t\t\tExpr leftLink = leftSide ? at.left() : at.right();\r\n\t\t\t\t\t\t\tExprCall rightLink = new ExprCall(null, contents); // a reference call is only a parameter group, null name\r\n\t\t\t\t\t\t\tgroup = new ExprCallChain(leftLink, rightLink);\r\n\r\n\t\t\t\t\t\t} else { // function call\r\n\t\t\t\t\t\t\tif (adderStr.startsWith(\".\")) { // function sub call ... func().subfunc()\r\n\t\t\t\t\t\t\t\tExpr leftLink = leftSide ? at.left() : at.right();\r\n\t\t\t\t\t\t\t\tExprCall rightLink = new ExprCall(adderStr.substring(1), contents);\r\n\t\t\t\t\t\t\t\tgroup = new ExprCallChain(leftLink, rightLink);\r\n\r\n\t\t\t\t\t\t\t} else { // standalone function ... func()\r\n\t\t\t\t\t\t\t\tif (Character.toString(adderStr.charAt(0)).equals(Operator.REF.op)) { // @func()\r\n\t\t\t\t\t\t\t\t\tgroup = new ExprFuncRef(adderStr.substring(1), contents);\r\n\t\t\t\t\t\t\t\t} else { // func()\r\n\t\t\t\t\t\t\t\t\tgroup = new ExprCall(adderStr, contents);\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t} else { // parenthetical grouping\r\n\t\t\t\t\t\tchar cc = (adderStr.length() == 1 ? adderStr.charAt(0) : 0); // operator before parenthesis ... !()\r\n\t\t\t\t\t\tif (isReserved(cc)) { // operation on the group\r\n\t\t\t\t\t\t\tgroup = new ExprUnary(Operator.get(Character.toString(cc)), parse(contents));\r\n\t\t\t\t\t\t} else { // ignore character, not an operator\r\n\t\t\t\t\t\t\tgroup = parse(contents);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\t// add to tree\r\n\t\t\t\t\tif (leftSide) at.setLeft(group);\r\n\t\t\t\t\telse at.setRight(group);\r\n\r\n\t\t\t\t\tadder.setLength(0);\r\n\t\t\t\t\ti = closeIndex;\r\n\t\t\t\t\tadd = false;\r\n\r\n\t\t\t\t} else if (c == '{') { // array initializer ... {}\r\n\t\t\t\t\tint closeIndex = getExitIndex(str, i);\r\n\t\t\t\t\tExpr arr = new ExprArray(str.substring(i + 1, closeIndex), adderStr);\r\n\r\n\t\t\t\t\tif (adderStr.length() == 1 && isReserved(adderStr.charAt(0))) {\r\n\t\t\t\t\t\t// unary op done on array initializer ... !{}\r\n\t\t\t\t\t\tarr = new ExprUnary(Operator.get(Character.toString(adderStr.charAt(0))), arr);\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\tif (leftSide) at.setLeft(arr);\r\n\t\t\t\t\telse at.setRight(arr);\r\n\r\n\t\t\t\t\tadder.setLength(0);\r\n\t\t\t\t\ti = closeIndex;\r\n\t\t\t\t\tadd = false;\r\n\r\n\t\t\t\t} else if (isOp(c)) { // operator\r\n\t\t\t\t\t// add value used in operation to tree\r\n\t\t\t\t\tif (!adderStr.isEmpty()) {\r\n\t\t\t\t\t\tif (leftSide) { // ex: adderStr + ___\r\n\t\t\t\t\t\t\tat.setLeft(parseValue(adderStr));\r\n\t\t\t\t\t\t} else { // ex: (___ + adderStr) + ___\r\n\t\t\t\t\t\t\tat.setRight(parseValue(adderStr));\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\tif (opStr.equals(\"\") || (i > 0 && isOp(str.charAt(i - 1)))) { // accumulate operator from adjacent operator characters (ex: != consists of ! and =)\r\n\t\t\t\t\t\tif (!(adderStr.isEmpty() && (opStr + c).equals(\"-\")) && (Operator.get(opStr + c) != null || (opStr.isEmpty() && isOp(c)))) {// if the operator exists, then it is an operator character\r\n\t\t\t\t\t\t\tif (opStr.equals(\"-\") && c == '-') { // this and the above line handle negatives and double negatives\r\n\t\t\t\t\t\t\t\topStr = \"+\";\r\n\t\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\t\topStr += c;\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\tadd = false;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t} else { // existing operator operation must be added to tree ... in \"(a + b) * c\", \"(a+b)\" must be abstracted-out so we get \"x * c\"\r\n\t\t\t\t\t\tint endIndex = i + 1; // end index of operator\r\n\r\n\t\t\t\t\t\t// get entire operator if operator is more than 1 character long\r\n\t\t\t\t\t\tfor (int i2 = endIndex; i2 < str.length(); i2++) {\r\n\t\t\t\t\t\t\tif (isOp(str.charAt(i2))) endIndex++;\r\n\t\t\t\t\t\t\telse break;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tOperator nextOp = Operator.get(str.substring(i, endIndex)); // second (right-most) operator\r\n\t\t\t\t\t\tat.op = Operator.get(opStr); // first (left-most) operator\r\n\r\n\t\t\t\t\t\t// group values in operation by operator precedence\r\n\t\t\t\t\t\tint p1 = precedence(nextOp); // right-most op\r\n\t\t\t\t\t\tint p2 = precedence(at.op); // left-most op\r\n\r\n\t\t\t\t\t\tif (p1 > p2) { // group around the right-most op\r\n\t\t\t\t\t\t\tExprBinary right = new ExprBinary(at, nextOp);\r\n\t\t\t\t\t\t\tright.setLeft(at.right());\r\n\r\n\t\t\t\t\t\t\tat.setRight(right);\r\n\t\t\t\t\t\t\tat = right;\r\n\r\n\t\t\t\t\t\t} else if (p1 < p2) { // group around the left-most op\r\n\t\t\t\t\t\t\tExprBinary last = at;\r\n\t\t\t\t\t\t\tExprBinary match = at.parent();\r\n\r\n\t\t\t\t\t\t\t// correctly add to the binary tree based on precedence of operators\r\n\t\t\t\t\t\t\twhile (match instanceof ExprBinary && p1 < (p2 = precedence(((ExprBinary) match).op))) {\r\n\t\t\t\t\t\t\t\tlast = match;\r\n\t\t\t\t\t\t\t\tmatch = match.parent();\r\n\t\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\t\tExprBinary tr = new ExprBinary(match, nextOp);\r\n\t\t\t\t\t\t\ttr.setLeft(last);\r\n\r\n\t\t\t\t\t\t\tif (match != null) {\r\n\t\t\t\t\t\t\t\tif (last == match.right()) match.setRight(tr);\r\n\t\t\t\t\t\t\t\telse match.setLeft(tr);\r\n\t\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\t\tat = tr;\r\n\r\n\t\t\t\t\t\t} else { // group from left to right (equal operator precedence)\r\n\t\t\t\t\t\t\tExprBinary left = new ExprBinary(at, at.op); // group existing values into left node, add right to open right node spot\r\n\t\t\t\t\t\t\tleft.setLeft(at.left());\r\n\t\t\t\t\t\t\tleft.setRight(at.right());\r\n\r\n\t\t\t\t\t\t\tat.op = nextOp;\r\n\t\t\t\t\t\t\tat.setLeft(left);\r\n\t\t\t\t\t\t\tat.setRight(null);\r\n\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\topStr = nextOp.op;\r\n\t\t\t\t\t\ti = endIndex - 1;\r\n\t\t\t\t\t\tadd = false;\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\tadder.setLength(0);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\t// store valid value characters\r\n\t\t\tif (add) {\r\n\t\t\t\tadder.append(c);\r\n\r\n\t\t\t\t// if this is the last character, then add the stored value to the tree.\r\n\t\t\t\t// otherwise, would be incorrectly ignored because there is no next operator\r\n\t\t\t\tif (i + 1 == str.length()) {\r\n\t\t\t\t\tif (opstore.length() == 0) {\r\n\t\t\t\t\t\tat.setLeft(parseValue(adder.toString()));\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\tat.setRight(parseValue(adder.toString()));\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\t// initialize binary tree operator if not done so already\r\n\t\tif (at.op == null) {\r\n\t\t\tat.op = Operator.get(opstore.toString());\r\n\t\t}\r\n\r\n\t\t// after traversing the tree to some point, we need to get back to root so we can return the entire tree\r\n\t\twhile (at.parent() != null) {\r\n\t\t\tat = (ExprBinary) at.parent();\r\n\t\t}\r\n\r\n\t\t// the expression may not actually be a binary operation\r\n\t\tif (at.op == null && at.right() == NULL) {\r\n\t\t\tif (at.left() == NULL) return NULL; // the expression is empty\r\n\t\t\treturn at.left(); // the expression is a single value/unary-operation\r\n\t\t}\r\n\r\n\t\treturn at;\r\n\t}", "public double operation( String a, String b, String o){\n switch (o){\n case \"+\": return Double.valueOf(a) + Double.valueOf(b);\n case \"-\": return Double.valueOf(a) - Double.valueOf(b);\n case \"x\": return Double.valueOf(a) * Double.valueOf(b);\n case \"÷\":try{\n return Double.valueOf(a) / Double.valueOf(b);\n }catch (Exception e){\n Log.e(\"calc\",e.getMessage());\n }\n\n default: return -1;\n }\n }", "public void inputExpression(String expression, Matrix a, Matrix b) {\n\t\tif(a == null || b == null) return;\n\t\texpression = expression.replaceAll(\"\\\\s+\", \"\");\n\t\tfor(Character c : expression.trim().toCharArray())\n\t\t\tif(!(isOperator(c.toString()) || isNumber(c.toString()) \n\t\t\t\t|| isMatrix(c.toString()) || c == '(' || c == ')')) {\n\t\t\t\tthrow new IllegalArgumentException(INVALID_CHARACTER_MESSAGE);\n\t\t\t}\n\t\tif(characterCount(expression, '(') > characterCount(expression, ')'))\n\t\t\tthrow new IllegalArgumentException(\"Expecting ')'\");\n\t\telse if(characterCount(expression, '(') < characterCount(expression, ')'))\n\t\t\tthrow new IllegalArgumentException(\"Expecting '('\");\n\t\tthis.expression = expression;\n\t\tthis.a = a;\n\t\tthis.b = b;\n\t\t\n\t\tread( toReversePolishNotation( addSpaces(expression) ) );\n\t}", "private void setOperatorToken() {\n\t\t\n\t\tif (currentIndex + 1 >= data.length)\n\t\t\tthrow new QueryLexerException(\"Invalid input. After operator must come text\");\n\t\t\n\t\tif (isOperator(data[currentIndex + 1])) {\n\t\t\t// two symbol operator\n\t\t\t\tif(data[currentIndex + 1] != '=') \n\t\t\t\t\tthrow new QueryLexerException(\"Invalid operator.\");\n\t\t\t\t\n\t\t\t\tif(data[currentIndex] == '=')\n\t\t\t\t\tthrow new QueryLexerException(\"Invalid operator.\");\n\t\t\t\t\n\t\t\t\tString operator = new String(data, currentIndex, 2);\n\t\t\t\ttoken = new Token(TokenType.OPERATOR, operator);\n\t\t\t\tcurrentIndex += 2;\n\t\t} else {\n\t\t\t// just one symbol operator\n\t\t\tif (data[currentIndex] == '!')\n\t\t\t\tthrow new QueryLexerException(\"Invalid operator.\");\n\t\t\t\n\t\t\ttoken = new Token(TokenType.OPERATOR, String.valueOf(data[currentIndex]));\n\t\t\tcurrentIndex++;\n\t\t}\n\t}", "@Override\r\n\tpublic Object visitBinaryExpression(BinaryExpression binaryExpression,\r\n\t\t\tObject arg) throws Exception {\r\n\t\tString expr0Type = (String) binaryExpression.expression0.visit(this,arg);\r\n\t\tString expr1Type = (String) binaryExpression.expression1.visit(this,arg);\r\n\t\tKind op = binaryExpression.op.kind;\r\n\t\tcheck(expr0Type.equals(expr1Type), \"uncompatible bianry expression\", binaryExpression);\r\n\t\tswitch(op) {\r\n\t\tcase PLUS:\r\n\t\t\tcheck(expr0Type.equals(intType) || expr0Type == stringType, \"operator \" + op.toString() + \" is not defined for \" + expr0Type, binaryExpression);\r\n\t\t\tbreak;\r\n\t\tcase MINUS:\tcase TIMES:\tcase DIV:\t\t\t\r\n\t\t\tcheck(expr0Type.equals(intType), \"operator \" + op.toString() + \" is not defined for \" + expr0Type, binaryExpression);\r\n\t\t\tbreak;\r\n\t\tcase EQUAL:\tcase NOTEQUAL:\r\n\t\t\tif (expr0Type.equals(booleanType) || expr0Type.equals(intType) ||expr0Type.equals(stringType)) {\r\n\t\t\t\tbinaryExpression.setType(booleanType);\r\n\t\t\t\treturn booleanType;\r\n\t\t\t} else {\r\n\t\t\t\tthrow new TypeCheckException(\"operator \" + op.toString() + \" is not defined for \" + expr0Type, binaryExpression);\r\n\t\t\t}\t\r\n\t\tcase LT: case GT: case LE: case GE:\r\n\t\t\tif (expr0Type.equals(booleanType) || expr0Type.equals(intType)) {\r\n\t\t\t\tbinaryExpression.setType(booleanType);\r\n\t\t\t\treturn booleanType;\r\n\t\t\t} else {\r\n\t\t\t\tthrow new TypeCheckException(\"operator \" + op.toString() + \" is not defined for \" + expr0Type, binaryExpression);\r\n\t\t\t}\t\t\r\n\t\tcase LSHIFT: case RSHIFT:\r\n\t\t\tcheck(expr0Type.equals(intType), \"operator \" + op.toString() + \" is not defined for \" + expr0Type, binaryExpression);\r\n\t\t\tbreak;\r\n\t\tcase BAR: case AND:\r\n\t\t\tcheck(expr0Type.equals(booleanType), \"operator \" + op.toString() + \" is not defined for \" + expr0Type, binaryExpression);\r\n\t\t\tbreak;\r\n\t\tdefault:\r\n\t\t\tthrow new TypeCheckException(\"operator \" + op.toString() + \" is not defined for \" + expr0Type, binaryExpression);\r\n\t\t} \t\r\n\t\tbinaryExpression.setType(expr0Type);\r\n\t\treturn expr0Type;\r\n\t}", "@Factory\n public static Matcher<QueryTreeNode> dividedBy(Matcher<QueryTreeNode> leftMatcher, \n Matcher<QueryTreeNode> rightMatcher) {\n return new BinaryOperatorNodeMatcher(leftMatcher, \"/\", rightMatcher);\n }", "public static int [] parseOperand(String operand) {\r\n \tint wholeNum;\r\n \tint numerator;\r\n \tint denominator; \r\n \tint [] operandArray = new int [3];\r\n \tif (operand.indexOf(\"/\") >= 0 && operand.indexOf(\"_\") >= 0) {\r\n \twholeNum = Integer.parseInt(operand.substring(0, operand.indexOf(\"_\"))); \r\n \t numerator = Integer.parseInt(operand.substring(operand.indexOf(\"_\") + 1, operand.indexOf(\"/\")));\r\n \t denominator = Integer.parseInt(operand.substring(operand.indexOf(\"/\") + 1));\r\n }\r\n else if (operand.indexOf(\"_\") == -1 && operand.indexOf(\"/\") >= 0) {\r\n \twholeNum = 0;\r\n \tnumerator = Integer.parseInt(operand.substring(0, operand.indexOf(\"/\")));\r\n \tdenominator = Integer.parseInt(operand.substring(operand.indexOf(\"/\") + 1));\r\n }\r\n else {\r\n \twholeNum = Integer.parseInt(operand);\r\n \tnumerator = 0;\r\n \tdenominator = 1;\r\n }\r\n \toperandArray[0] = wholeNum;\r\n \toperandArray[1] = numerator;\r\n \toperandArray[2] = denominator;\r\n \treturn operandArray;\r\n \t\r\n \t\r\n }", "public Code visitOperatorNode(ExpNode.OperatorNode node) {\n beginGen(\"Operator\");\n Code code;\n ExpNode args = node.getArg();\n switch (node.getOp()) {\n case ADD_OP:\n code = args.genCode(this);\n code.generateOp(Operation.ADD);\n break;\n case SUB_OP:\n code = args.genCode(this);\n code.generateOp(Operation.NEGATE);\n code.generateOp(Operation.ADD);\n break;\n case MUL_OP:\n code = args.genCode(this);\n code.generateOp(Operation.MPY);\n break;\n case DIV_OP:\n code = args.genCode(this);\n code.generateOp(Operation.DIV);\n break;\n case EQUALS_OP:\n code = args.genCode(this);\n code.generateOp(Operation.EQUAL);\n break;\n case LESS_OP:\n code = args.genCode(this);\n code.generateOp(Operation.LESS);\n break;\n case NEQUALS_OP:\n code = args.genCode(this);\n code.generateOp(Operation.EQUAL);\n code.genBoolNot();\n break;\n case LEQUALS_OP:\n code = args.genCode(this);\n code.generateOp(Operation.LESSEQ);\n break;\n case GREATER_OP:\n /* Generate argument values in reverse order and use LESS */\n code = genArgsInReverse((ExpNode.ArgumentsNode)args);\n code.generateOp(Operation.LESS);\n break;\n case GEQUALS_OP:\n /* Generate argument values in reverse order and use LESSEQ */\n code = genArgsInReverse((ExpNode.ArgumentsNode)args);\n code.generateOp(Operation.LESSEQ);\n break;\n case NEG_OP:\n code = args.genCode(this);\n code.generateOp(Operation.NEGATE);\n break;\n default:\n errors.fatal(\"PL0 Internal error: Unknown operator\",\n node.getLocation());\n code = null;\n }\n endGen(\"Operator\");\n return code;\n }", "public int calculate(String s) {\n Deque<Integer> stack = new ArrayDeque<>();\n\n // Init\n int result = 0; // For the on-going result\n int sign = 1; // 1 means positive, -1 means negative\n int operand = 0;\n\n // 1 + 2 + 1\n // The tricky part is that we find an operator/sign first, then we know\n // the operand after that. We save the sign first, and when we evaluate the\n // expression so far, we use that sign.\n\n // Go through the expression string character by character.\n // Evaluate to the left when we find '+', '-', ')', or end of loop.\n // We use a stack when we find parenthesis.\n for (int i = 0; i < s.length(); i++) {\n char c = s.charAt(i);\n if (Character.isDigit(c)) {\n // Form operand, since it could be more than one digit.\n operand = 10 * operand + (c - '0');\n } else if (c == '+') {\n // We can evaluate the expression to the left,\n // with result, sign, operand\n result += sign * operand;\n // Save the recently encountered '+' sign\n sign = 1;\n // Reset operand\n operand = 0;\n } else if (c == '-') {\n // We can evaluate the expression to the left,\n result += sign * operand;\n // Save the '-' sign.\n sign = -1;\n operand = 0;\n } else if (c == '(') {\n // Push the result so far and sign onto the stack, for later use.\n // We push the result first, then sign in the stack.\n stack.push(result);\n stack.push(sign);\n // Reset result, sign, and operand, as if new evaluation begins for the new\n // sub-expression\n result = 0;\n sign = 1;\n operand = 0;\n } else if (c == ')') {\n // We can evaluate the sub-expression to the left.\n result += sign * operand;\n // Now that we know the sub-expression ended, we can also evaluate to the left.\n // First we take the sign out of the stack, and then add the result we saved\n // before to the result of the sub-expression.\n result *= stack.pop();\n result += stack.pop();\n // Reset sign and operand.\n sign = 1;\n operand = 0;\n }\n }\n\n // We need to evaluate again.\n result += sign * operand;\n\n return result;\n }", "java.lang.String getOperator();", "@Override\r\n\tpublic int evaluate(String expression) {\r\n\t\tString e =expression;\r\n\t\tfloat result=0; //the returned result \r\n\t\tif(e.length()==2) {\r\n\t\t\te = removespaces(e);\r\n\t\t\tint z =Integer.parseInt(e);\r\n\t\t\treturn z;\r\n\t\t}\r\n\t\tfor(int i =0 ;i<expression.length();i++){\r\n\t\t\tif(Character.isLetter(e.charAt(i))){\r\n\t\t\t\tthrow new RuntimeException(\"You Can't evaluate letters\");\r\n\t\t\t}\r\n\t\t}\r\n\t\tfor(int i =0 ;i<expression.length()-1;i++) {\r\n\t\t\twhile(e.charAt(i) != '+' &&e.charAt(i) != '/' &&e.charAt(i) != '-' &&e.charAt(i) != '*' ) {\r\n\t\t\t\tint j = 0;\r\n\t\t\t\twhile(e.charAt(i) != ' ' ) {\r\n\t\t\t\t\tj++;\r\n\t\t\t\t\ti++;\r\n\t\t\t\t}\r\n\t\t\t\tif(j>0) {\r\n\t\t\t\t\tString k = e.substring(i-j, i);\r\n\t\t\t\t\tk = removespaces(k);\r\n\t\t\t\t\tfloat z = Integer.parseInt(k);\r\n\t\t\t\t\topr.push(z);}\r\n\t\t\t\ti++;\r\n\t\t\t}\r\n\t\t\tif(e.charAt(i)== '+') {\r\n\t\t\t\tfloat x = (float)opr.pop();\r\n\t\t\t\tresult = (float)opr.pop();\r\n\t\t\t\tresult = result + x;\r\n\t\t\t\topr.push(result);\r\n\t\t\t}\r\n\t\t\telse if(e.charAt(i)== '*') {\r\n\t\t\t\tfloat x = (float)opr.pop();\r\n\t\t\t\tresult = (float)opr.pop();\r\n\t\t\t\tresult = result * x;\r\n\t\t\t\topr.push(result);\r\n\t\t\t}\r\n\t\t\telse if(e.charAt(i)== '-') {\r\n\t\t\t\tfloat x = (float)opr.pop();\r\n\t\t\t\tresult = (float)opr.pop();\r\n\t\t\t\tresult = result - x;\r\n\t\t\t\topr.push(result);\r\n\t\t\t}\r\n\t\t\telse if(e.charAt(i)== '/') {\r\n\t\t\t\tfloat x = (float)opr.pop();\r\n\t\t\t\tresult = (float)opr.pop();\r\n\t\t\t\tresult = result / x;\r\n\t\t\t\topr.push(result);\r\n\t\t\t}\r\n\t\t\t\r\n\t\t}\r\n\t\treturn (int)result;\r\n\r\n\t}", "private ASTNode binaryDivisionRules(ASTNode left, ASTNode right) throws Exception {\n\n Token leftToken = left.getToken();\n Token rightToken = right.getToken();\n\n TokenType leftType = leftToken.getType();\n TokenType rightType = rightToken.getType();\n\n TokenType varType = TokenType.VAR;\n TokenType numType = TokenType.NUMBER;\n TokenType divType = TokenType.DIV;\n\n Token tempToken;\n if (patternMatcher(leftType, rightType, varType, varType)){\n tempToken = new Token(numType, \"1\");\n return new Num(tempToken);\n }\n else if (rightToken.getIdentifier().equals(\"1\")){\n return left;\n }\n else if (leftToken.getIdentifier().equals(\"0\")){\n tempToken = new Token(numType, \"0\");\n return new Num(tempToken);\n }\n else{\n tempToken = new Token(divType);\n return new BinaryOp(tempToken, left, right);\n }\n }", "public static ResultValue returnResult(Parser parser, Numeric leftOp, Numeric rightOp)\r\n {\r\n \tInfixEvaluation evaluateInfix = new InfixEvaluation(parser);\r\n \tResultValue result = new ResultValue();\r\n \tdouble val1;\r\n \tdouble val2;\r\n \tdouble dVal;\r\n \tint iVal;\r\n \t\r\n \tString operator = leftOp.expr;\r\n \t\r\n \tif(leftOp.type == Token.INTEGER)\r\n \t{\r\n \t\tresult.type = Token.INTEGER;\r\n \t\t\r\n \t\t//check dataType for right operand \r\n \t\tif(rightOp.type != Token.INTEGER)\r\n \t\t\trightOp.integerValue = Numeric.getIntegerValue(rightOp.strValue);\r\n \t\t\r\n \t\tswitch(leftOp.expr)\r\n \t\t{\r\n \t\t\tcase \"+\" :\r\n \t\t\t\tresult.value = String.valueOf(addInt(leftOp.integerValue, rightOp.integerValue));\r\n \t\t\t\tbreak;\r\n \t\t\t\t\r\n \t\t\tcase \"-\" :\r\n \t\t\t\tresult.value = String.valueOf(subInt(leftOp.integerValue, rightOp.integerValue));\r\n \t\t\t\tbreak;\r\n \t\t\t\t\r\n \t\t\tcase \"*\" :\r\n \t\t\t\tresult.value = String.valueOf(mulInt(leftOp.integerValue, rightOp.integerValue));\r\n \t\t\t\tbreak;\r\n \t\t\t\t\r\n \t\t\tcase \"/\" :\r\n \t\t\t\tresult.value = String.valueOf(divInt(leftOp.integerValue, rightOp.integerValue));\r\n \t\t\t\tbreak;\r\n \t\t\t\r\n \t\t\tcase \"^\" :\r\n \t\t\t\tresult.value = String.valueOf(intExp(leftOp.integerValue, rightOp.integerValue));\r\n \t\t\t\tbreak;\r\n \t\t\t\t\r\n \t\t\tdefault :\r\n \t\t\t\tSystem.out.println(\"Error in Utilities, not valid operator\");\r\n \t\t\t\t\r\n \t\t} \t\t\r\n \t\t\r\n \t}\r\n \t\r\n \t//token is a float \r\n \telse if(leftOp.type == Token.FLOAT)\r\n \t{\r\n \t\tresult.type = Token.FLOAT;\r\n \t\t\r\n \t\tif(rightOp.type != Token.FLOAT)\r\n \t\t\trightOp.doubleValue = Numeric.getDoubleValue(rightOp.strValue);\r\n \t\t\r\n \t\tswitch(leftOp.expr)\r\n \t\t{\r\n \t\t\tcase \"+\" :\r\n \t\t\t\tresult.value = String.valueOf(add(leftOp.doubleValue, rightOp.doubleValue));\r\n \t\t\t\tbreak;\r\n\t\t\t\t\r\n \t\t\tcase \"-\" :\r\n \t\t\t\tresult.value = String.valueOf(sub(leftOp.doubleValue, rightOp.doubleValue));\r\n \t\t\t\tbreak;\r\n\t\t\t\t\r\n \t\t\tcase \"*\" :\r\n \t\t\t\tresult.value = String.valueOf(mul(leftOp.doubleValue, rightOp.doubleValue));\r\n \t\t\t\tbreak;\r\n\t\t\t\t\r\n \t\t\tcase \"/\" :\r\n \t\t\t\tresult.value = String.valueOf(div(leftOp.doubleValue, rightOp.doubleValue));\r\n \t\t\t\tbreak;\r\n\t\t\t\r\n \t\t\tcase \"^\" :\r\n \t\t\t\tresult.value = String.valueOf(exp(leftOp.doubleValue, rightOp.doubleValue));\r\n \t\t\t\tbreak;\r\n\t\t\t\t\r\n \t\t\tdefault :\r\n \t\t\t\tSystem.out.println(\"Error in Utilities, not valid operator\");\r\n\t\t\r\n \t\t}\r\n \t}\r\n\t\r\n \treturn result;\r\n }", "public Expression(String expr) {\n this.expr = expr;\n scalars = null;\n arrays = null;\n openingBracketIndex = null;\n closingBracketIndex = null;\n }", "public static String[] convertToPos(String[] string) {\n\n\t\tHashMap<String, Integer> operator = new HashMap<String, Integer>();\n\t\toperator.put(\"*\", 2);\n\t\toperator.put(\"/\", 2);\n\t\toperator.put(\"+\", 1);\n\t\toperator.put(\"-\", 1);\n\t\toperator.put(\"(\", 3);\n\t\toperator.put(\")\", 0);\n\n\t\tStack<String> evaluationStack = new Stack<String>();\n\t\tStack<String> operatorStack = new Stack<String>();\n\n\t\tfor (int i = 0; i < string.length; i++) {\n\t\t\tif (!(operator.containsKey(string[i]))) {\n\t\t\t\tevaluationStack.push(string[i]);\n\t\t\t} else {\n\t\t\t\tint precedence = operator.get(string[i]);\n\t\t\t\tif (!operatorStack.isEmpty()) {\n\t\t\t\t\tif (operator.get(operatorStack.peek()) >= precedence) {\n\t\t\t\t\t\tif (!(operatorStack.peek().equals(\"(\") || operatorStack.peek().equals(\")\") || operatorStack.peek().equals(\"(\")))\n\t\t\t\t\t\t\tevaluationStack.push(operatorStack.pop());\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\toperatorStack.push(string[i]);\n\t\t\t}\n\t\t}\n\n\t\twhile (!operatorStack.isEmpty()) {\n\t\t\tif (!((operatorStack.peek().equals(\")\") || operatorStack.peek().equals(\"(\")))) {\n\t\t\t\tevaluationStack.push(operatorStack.pop());\n\t\t\t} else {\n\t\t\t\toperatorStack.pop();\n\t\t\t}\n\t\t}\n\t\t\n\t\tString str[] = new String[evaluationStack.size()];\n\n\t\tint c = str.length - 1;\n\t\twhile (!evaluationStack.isEmpty()) {\n\t\t\tstr[c] = evaluationStack.pop();\n\t\t\tc--;\n\t\t}\n\n\t\treturn str;\n\n\t}", "@Override\n protected HardwareNode visit(BinaryExpressionASTNode node) throws Exception {\n var lnode = visit(node.getLeft());\n var rnode = visit(node.getRight());\n\n HardwareExpression finalexpr = null;\n String op = node.getOperator().getAsString();\n switch (op) {\n case \"+\":\n finalexpr = new AdditionExpression((HardwareExpression) lnode, (HardwareExpression) rnode);\n break;\n case \"-\":\n finalexpr = new SubtractionExpression((HardwareExpression) lnode, (HardwareExpression) rnode);\n break;\n case \"*\":\n finalexpr = new MultiplicationExpression((HardwareExpression) lnode, (HardwareExpression) rnode);\n break;\n case \"<<\":\n finalexpr = new LeftShiftExpression((HardwareExpression) lnode, (HardwareExpression) rnode);\n break;\n case \"&\":\n finalexpr = new BitWiseAndExpression((HardwareExpression) lnode, (HardwareExpression) rnode);\n break;\n case \"==\":\n finalexpr = new ComparisonExpression((HardwareExpression) lnode, (HardwareExpression) rnode);\n break;\n default:\n // finalexpr = new UnimplementedExpression((HardwareExpression) lnode, (HardwareExpression) rnode, op);\n throw new UnimplementedExpressionException(node.getAsString());\n }\n\n return new ParenthesisExpression(finalexpr);\n }", "@Test\r\n\t\tpublic void testParseOperator() {\r\n\t\t\t\t\t\t\t\t\t\t\t\t\r\n\t\t\tdriver.findElement(By.id(\"code_code\")).sendKeys(\"a = 5\\nb = 6\\nc = a + (b * 4)\");;\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\r\n\t\t\tWebElement submitButton = driver.findElement(By.xpath(\"(//input[@name='commit'])[2]\"));\r\n\t\t\tsubmitButton.click();\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\r\n\t\t\ttry {\r\n\t\t\t\tWebElement e = driver.findElement(By.tagName(\"code\"));\r\n\t\t\t\tString elementText = e.getText();\r\n\t\t\t\tassertTrue(elementText.contains(\"*\"));\r\n\t\t\t} catch (NoSuchElementException nseex) {\r\n\t\t\t\tfail();\r\n\t\t\t}\r\n\t\t}", "public Object[] plotStrEvalsComp3Split(Object... rhs) throws RemoteException;", "public static int calculator(int num1, int num2, String operator) {\n\n int result = 0;\n if (operator.equals(\"+\")) {\n result = num1 + num2;\n\n } else if (operator.equals(\"-\")) {\n result = num1 - num2;\n\n } else if (operator.equals(\"/\")) {\n if (num1 != 0 && num2 == 0) {\n System.out.println(\"the operation is not possible because one number if zero\");\n throw new IllegalArgumentException(\"error: you tried to divide by 0\");\n }\n result = num1 / num2;\n\n } else if (operator.equals(\"*\")) {\n result = num1 * num2;\n\n } else {\n throw new IllegalArgumentException(\"error: unknown operator: \" + operator);\n }\n\n return result;\n }" ]
[ "0.6883432", "0.6744285", "0.6554951", "0.64460534", "0.6433093", "0.6380967", "0.6359107", "0.6349444", "0.6221282", "0.62160873", "0.61560607", "0.61480474", "0.61477435", "0.6089857", "0.6057403", "0.5978089", "0.5968048", "0.595671", "0.5954235", "0.5924815", "0.59125155", "0.5875888", "0.5875369", "0.58700585", "0.5748668", "0.5726562", "0.56942487", "0.56872493", "0.56812197", "0.5677634", "0.56642926", "0.56607276", "0.55957216", "0.55834216", "0.5580856", "0.5555858", "0.55337894", "0.55288637", "0.5519977", "0.55149096", "0.55081195", "0.5494099", "0.5485417", "0.5467192", "0.5462487", "0.54539424", "0.5453799", "0.54521453", "0.54483783", "0.5447355", "0.5443746", "0.5443059", "0.54361075", "0.54350954", "0.54343086", "0.54320717", "0.5425302", "0.5403302", "0.5391561", "0.5378933", "0.53783184", "0.5375189", "0.53685266", "0.5349174", "0.5339633", "0.53274405", "0.53268254", "0.53188956", "0.5316376", "0.531264", "0.5309039", "0.5308427", "0.5306305", "0.52976495", "0.5291598", "0.5275947", "0.5272823", "0.52431816", "0.52278686", "0.5223692", "0.5219033", "0.52188134", "0.5214581", "0.5201366", "0.52000684", "0.51977324", "0.5194299", "0.51925486", "0.5180034", "0.51741946", "0.51682705", "0.5167978", "0.51674336", "0.5164742", "0.5162958", "0.51405764", "0.5138434", "0.512178", "0.5120736", "0.51183873" ]
0.8988352
0
toString method returns the full expression originally passed to the binary expression instance before splitting occured.
public String toString() { return fullExpression; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public String toString() {\n return m_expression;\n }", "public String toString() {\n if (mExpression.size() == 1 && mExpression.get(0).startsWith(\"-\")) {\n return mExpression.get(0);\n }\n\n StringBuilder output = new StringBuilder();\n boolean first = true;\n int size = mExpression.size();\n\n for (int i = 0; i < size; i++) {\n String element = mExpression.get(i);\n\n if (first) {\n first = false;\n } else {\n output.append(\"\");\n }\n\n\n if (isOperand(element) && element.startsWith(\"-\")) {\n output.append(\"(\")\n .append(element)\n .append(\")\");\n } else {\n output.append(element);\n }\n }\n\n return output.toString();\n }", "@Override\r\n\tpublic String toString() {\r\n\t\tString string = \"\";\r\n\t\tif (expressionTree.getNumberOfChildren()==0)\r\n\t\t\treturn expressionTree.getValue();\r\n\t\telse{\r\n\t\t\tstring += \"(\";\r\n\t\t\tfor (int i = 0; i < expressionTree.getNumberOfChildren(); i++){\r\n\t\t\t\tTree<String> subtree = expressionTree.getChild(i);\r\n\t\t\t\tif (subtree.getNumberOfChildren()==0)\r\n\t\t\t\t\tstring += subtree.getValue();\r\n\t\t\t\telse\r\n\t\t\t\t\tstring += (new Expression(subtree.toString())).toString()+\" \";\r\n\t\t\t\tif (i < expressionTree.getNumberOfChildren()-1)\r\n\t\t\t\t\tstring += \" \" + expressionTree.getValue()+\" \";\r\n\t\t\t}\r\n\t\t\tstring += \")\";\r\n\t\t}\r\n\t\treturn string;\r\n\t}", "public String getExpressionString ()\n {\n return toStringToken ((String) getValue ());\n }", "public String toString() {\r\n\t\tStringBuffer buf = new StringBuffer();\r\n\t\tbuf.append(\"[ Expression \");\r\n\t\tif (text() != null) {\r\n\t\t\tbuf.append(\"[\");\r\n\t\t\tbuf.append(text().toString());\r\n\t\t\tbuf.append(\"]\");\r\n\t\t}\r\n\t\tbuf.append(\": \");\r\n\t\tfor (int n = 0; n < elements.size(); ++n) {\r\n\t\t\tbuf.append(elements.get(n));\r\n\t\t\tif (n < elements.size() - 1) {\r\n\t\t\t\tbuf.append(\",\");\r\n\t\t\t}\r\n\t\t}\r\n\t\tbuf.append(\" ]\");\r\n\t\treturn new String(buf);\r\n\t}", "public String toString () {\n return \"(+ \" + leftOperand + \" \" + rightOperand + \")\";\n }", "@Override\n\t\tpublic String toString() {\n\t\t\tStringBuilder sb = new StringBuilder();\n\t\t\tpreOrderTraverse(expression.root, 1, sb);\n\t\t\treturn sb.toString();\n\t\t}", "public String toString(){\n\t\tString out=\"\";\n\t\tif (type == \"op\"){\n\t\t\treturn out + operand;\n\t\t}\n\t\telse{\n\t\t\treturn out + value ;\n\t\t}\n\t}", "@Override\n public String toString() {\n return \"(\" + getExpression1() + \" - \" + getExpression2() + \")\";\n }", "@Override\n public String toString() {\n return \"Expression\";\n }", "public String toString()\r\n\t{\r\n\t\tcheckInitialization();\r\n\t\treturn equationString + \" = \" + getResult();\r\n\t}", "public String toString() {\n return operator + \"(\" + argument + \")\";\n }", "public String toString() {\r\n\treturn expressions.get(0).getCdata();\r\n }", "public String toString() {\n return \"(\" + getExpLeft().toString() + \" * \" + getExpRight().toString() + \")\";\n }", "@Override\n public String toString() { return '(' + left.toString() + ' ' + operation.toString() + ' ' + right.toString() + ')'; }", "@Override\n public String toString() { return '(' + left.toString() + ' ' + operation.toString() + ' ' + right.toString() + ')'; }", "@Override\n public String toString() {\n return op.toString();\n }", "@Override\n\tpublic String toString() {\n\t\treturn String.format(\" %s %s\", operador, exp);\n\t}", "public String toString2() {\n\t\t\tStringBuilder sb = new StringBuilder();\n\t\t\tpostOrderTraverse(expression.root,sb);\n\t\t\treturn sb.toString();\n\t\t}", "@Override\n public String toString() {\n Helpers f = new Helpers();\n Expression left = super.getLeft();\n Expression right = super.getRight();\n\n if (super.isBonus()) {\n // x * y -> xy\n if (left instanceof Var && right instanceof Var) {\n return \"(\" + left.toString() + \"\" + right.toString() + \")\";\n }\n // 4 * x -> 4x\n if (right instanceof Var) {\n return \"(\" + left.toString() + \"\" + right.toString() + \")\";\n }\n // x * 4 -> 4x\n if (left instanceof Var) {\n return \"(\" + right.toString() + \"\" + left.toString() + \")\";\n }\n // 4 * (x^2) -> 4(x^2)\n if (right instanceof Pow) {\n return \"(\" + left.toString() + \"\" + right.toString() + \")\";\n }\n // 4 * (xy) -> 4xy\n if (right instanceof Mult) {\n if (((Mult) right).getLeft() instanceof Var && ((Mult) right).getRight() instanceof Var) {\n return \"(\" + left.toString() + \"\" + f.removeOuterParentheses(right.toString()) + \")\";\n }\n }\n }\n return \"(\" + left.toString() + \" * \" + right.toString() + \")\";\n }", "public String toString() {\n\t\tString circuit = \"(\" + left + \"/\\\\\" + right + \")\";\n\t\treturn circuit;\n\t}", "@Override\n\tpublic String toString() {\n\t\treturn super.toString() + \" \" + op1 + \" + \" + op2 + \" to \" + result;\n\t}", "public String toString() {\n\t\tif(left == this && right == this) {\n\t\t\treturn getElementString();\n\t\t}\n\t\telse {\n\t\t\tif(right.right == right && right.noBranchBit == true) {\n\t\t\t\treturn \"(\" + left.toString() + \")\";\n\t\t\t}\n\t\t\telse {\n\t\t\t\treturn \"(\" + left.toString() + \" && \" + right.toString() + \")\";\n\t\t\t}\n\t\t}\n\t}", "@Override\n\tpublic String toString() {\n\t\treturn String.format(\"%s[%s]\", name.getValue().getSValue(), exprNode.toString());\n\t}", "public final String toStringX() {\n return this.decompile(Descriptor.P_STMT, new StringBuilder(1024), Descriptor.DECO_STRX).toString();\n }", "public String toString() { return new String(b,0,i_end); }", "@Override\n public String toString(int depth) {\n if (depth <= 0) return \"\";\n String sEO = \"\" ;\n if (this.subExpressionOf != null) {\n sEO = Strings.indent(2,\n \"\\nsubExpressionOf: \" +\n Strings.indent(2, this.subExpressionOf.toString(1))) ;} ;\n return \"\\n*OpApplNode: \" + operator.getName() + \" \" + super.toString(depth+1)\n + \" errors: \" + (errors != null ? \"non-null\" : \"null\")\n + toStringBody(depth) + sEO ;\n }", "public String toString() {\n\t\treturn b.toString();\n\t}", "public String toString() {\n\t\t//|| (this.equals(new StatementParse(\"sequence\", 0)))\n\t\tif (this.equals(Parser.FAIL)) {\n\t\t\treturn \"\";\n\t\t}\n String result = \"\";\n result += \"(\";\n result += this.name;\n for (Parse child: this.children) {\n \tresult += \" \" + child.toString();\n }\n result += \")\";\n return result;\t\n }", "public String toString() { \r\n\t\tString Sresult = \"(\" + lChild.toString() + \" / \" + rChild.toString() + \")\";\r\n\t\treturn Sresult; \r\n\t}", "public String toString() {\n switch (opType) {\n case Plus:\n return \"+\";\n case Minus:\n return \"-\";\n case Multiply:\n return \"*\";\n case Divide:\n return \"/\";\n case Square:\n return \"^\";\n default:\n return null;\n }\n }", "@Override\n\tpublic String toString() {\n\t\tswitch(type) {\n\t\tcase CLOSURE : return \"*\";\n\t\tcase CONCATENATION : return \"\";\n\t\tcase LPAREN : return \"(\";\n\t\tcase RPAREN : return \")\";\n\t\tcase UNION : return \"|\";\n\t\tdefault: return value;\n\t\t}\n\t}", "@Override\n public String toString() {\n \treturn \"()\";\n }", "public String toString() {\n\t\tStringBuffer buffer = new StringBuffer();\n\t\tthis.createSpecSection(buffer);\n\t\tthis.createOperatorSection(buffer);\n\t\treturn buffer.toString();\n\t}", "@Override\n\tpublic String toString(){\n\t\treturn B_number+\",\"+left+\",\"+right+\",\"+filterType;\n\t}", "public String toString () {\n return \"()\";\n }", "public String toString()\n {\n return _xstr.subSequence(_start, _end).toString();\n }", "public String toString() {\n\t\tif (label == null && numChildren <= 0)\n\t\t\treturn \"()\";\n\t\tStringBuffer ret = new StringBuffer(label.toString());\n\t\tif (numChildren > 0) {\n\t\t\tret.append(\"(\"+children[0].toString());\n\t\t\tfor (int i = 1; i < numChildren; i++) {\n\t\t\t\tret.append(\" \"+children[i].toString());\n\t\t\t}\n\t\t\tret.append(\")\");\n\t\t}\n\t\t//\telse\n\t\t//\t ret.append(\":\"+label.hashCode());\n\t\treturn ret.toString();\n\t}", "public String toString() {\r\n\t\treturn result;\r\n\t}", "public String toString() {\n\t\treturn sb.toString();\n\t}", "public binary_ex(String expression) {\n try {\n fullExpression = expression.trim();\n if (expression.contains(\"*\"))\n splitExpression(expression, \"*\");\n else if (expression.contains(\"/\"))\n splitExpression(expression, \"/\");\n else if (expression.contains(\"+\"))\n splitExpression(expression, \"+\");\n else if (expression.contains(\"-\"))\n splitExpression(expression, \"-\");\n else if (expression.contains(\"%\"))\n splitExpression(expression, \"%\");\n else if (expression.contains(\"\\\\\"))\n splitExpression(expression, \"\\\\\");\n else\n throw new JuliaSyntaxException(\"arith\");\n } catch (JuliaSyntaxException e) {\n\n }\n }", "public String toString() { return stringify(this, true); }", "public String toString()\r\n/* 736: */ {\r\n/* 737:804 */ return toStringBuilder().toString();\r\n/* 738: */ }", "String getExpression();", "String getExpression();", "public String toString(){\n\t\tStringBuffer buffer = new StringBuffer();\n\t\t\n\t\tbuffer.append(lhs);\n\t\tbuffer.append(\" -> \");\n\t\t\n\t\t// if this is a lexical rule, prefix it with the lexical symbol\n\t\tif( lexical ){\n\t\t\tbuffer.append(LEXICAL_PREFIX);\n\t\t}\n\t\t\n\t\tfor( String s: rhs ){\n\t\t\tbuffer.append(s + \" \");\n\t\t}\n\t\t\n\t\t// delete the trailing whitespace\n\t\tbuffer.deleteCharAt(buffer.length()-1);\n\t\t\n\t\tbuffer.append(\"\\t\\t\" + weight);\n\t\t\n\t\treturn buffer.toString();\n\t}", "String toString();", "String toString();", "String toString();", "String toString();", "String toString();", "String toString();", "String toString();", "String toString();", "String toString();", "String toString();", "String toString();", "String toString();", "String toString();", "String toString();", "String toString();", "String toString();", "String toString();", "String toString();", "String toString();", "String toString();", "String toString();", "String toString();", "String toString();", "String toString();", "String toString();", "String toString();", "String toString();", "String toString();", "@Override\n public String toString() {\n\n if (this.toString == null) {\n StringBuilder sb = new StringBuilder();\n\n if (this.symbol != null) {\n sb.append(\"{\");\n sb.append(this.isLookahead ? \"lookahead\" : \"normal\");\n sb.append(\",\");\n sb.append(this.symbol);\n sb.append(\"}\");\n }\n else {\n sb.append(\"{lookahead,END}\");\n }\n\n this.toString = sb.toString();\n }\n\n return this.toString;\n }", "public String getExpression() {\r\n return tree.infixExpression();\r\n }", "public String toString() {\n\t\treturn super.toString();\n\t\t// This gives stack overflows:\n\t\t// return ToStringBuilder.reflectionToString(this);\n\t}", "@Override\r\n\tpublic String toString()\r\n\t{\r\n\t\treturn rootOperation.toString();\r\n\t}", "public String toString() ;", "@Override\r\n public String toString() {\r\n return com.butterfill.opb.util.OpbToStringHelper.toString(this);\r\n }", "public String toString() {\n\treturn \"(\" + left.toString() + \" * \" +\n\t right.toString() + \")\";\n }", "public String toString() {\n String r = \"(block ( \";\n for (Iterator it = idList.iterator (); it.hasNext (); ) {\n r += (String) it.next() + \" \";\n }\n r += \") ( \";\n for (Iterator it = exprList.iterator (); it.hasNext (); ) {\n r += ((Expr) it.next ()) + \" \";\n }\n return r + \"))\";\n }", "public String toString() {\n\t\treturn pharse;\n\t}", "@Override\r\n\tpublic String toString() {\n\t\treturn result;\r\n\t}", "@Override\n public String toString()\n {\n if(this.powerOfIi == 0 || this.imaginaryPart == 0.0)\n {\n return (\"\" + this.realPart);\n }\n else if(this.powerOfIi != 1)\n {\n return (this.realPart + \" + \" + this.imaginaryPart + \"i^\" + this.powerOfIi);\n }\n else\n {\n return (this.realPart + \" + \" + this.imaginaryPart + \"i\");\n }\n }", "private StringBuilder getOperand() {\r\n\t\tif (\"\".equals(operator)) {\r\n\t\t\treturn firstNumber;\r\n\t\t} else {\r\n\t\t\treturn secondNumber;\r\n\t\t}\r\n\t}", "private void jetBinopExprStr(){\n\t\tBinopExpr binopExpr = (BinopExpr) rExpr;\n\t\tValue op1 = binopExpr.getOp1();\n\t\tValue op2 = binopExpr.getOp2();\n\t\tZ3Type op1Z3Type = Z3MiscFunctions.v().z3Type(op1.getType());\n\t\tZ3Type op2Z3Type = Z3MiscFunctions.v().z3Type(op2.getType());\n\t\tStringBuilder sb = new StringBuilder();\n\t\t\n\t\tBinopExprType binopType = Z3MiscFunctions.v().getBinopExprType(binopExpr);\n\t\tswitch(binopType){\n\t\t//[start]ADD\n\t\tcase ADD:\n\t\t\t//add_expr = immediate \"+\" immediate;\n\t\t\t//immediate = constant | local;\n\t\t\t//only Int, Real, String can ADD\n\t\t\t//Exceptional Cases: \"084\" + 42; we exclude them\n\t\t\tassert((op1Z3Type == Z3Type.Z3String && op2Z3Type == Z3Type.Z3String) ||\n\t\t\t\t\t(op1Z3Type != Z3Type.Z3String && op2Z3Type != Z3Type.Z3String));\n\t\t\tif(op1Z3Type == Z3Type.Z3String ){\n\t\t\t\t//( Concat \"te\" y1 )\n\t\t\t\tsb.append(\"( Concat \");\n\t\t\t}else{\n\t\t\t\t//(+ 2 i2)\n\t\t\t\tsb.append(\"(+ \");\n\t\t\t}\n\t\t\tif(op1 instanceof Local){\n\t\t\t\tsb.append(fileGenerator.getRenameOf(op1, false, this.stmtIdx));\n\t\t\t}else{\n\t\t\t\tsb.append(op1.toString());\n\t\t\t}\n\t\t\tsb.append(\" \");\n\t\t\tif(op2 instanceof Local){\n\t\t\t\tsb.append(fileGenerator.getRenameOf(op2, false, this.stmtIdx));\n\t\t\t}else{\n\t\t\t\tsb.append(op2.toString());\n\t\t\t}\n\t\t\tsb.append(\" )\");\n\t\t\tthis.exprStr = sb.toString();\n\t\t\tbreak;\n\t\t//[end]ADD\n\t\tcase AND:\n\t\t\t//and_expr = immediate \"&\" immediate;\n\t\t\t//TODO\n\t\t\t//assert(false) : \"AND Expr\";\n\t\t\tbreak;\n\t\t//[start] DIV\n\t\tcase DIV:\n\t\t\t//div_expr = immediate \"/\" immediate;\n\t\t\t//(div a b) integer division\n\t\t\t//(/ a b) float division\n\t\t\tif(op1Z3Type == Z3Type.Z3Real || op2Z3Type == Z3Type.Z3Real){\n\t\t\t\tsb.append(\"(/ \");\n\t\t\t}else{\n\t\t\t\tsb.append(\"(div \");\n\t\t\t}\n\t\t\tif(op1 instanceof Local){\n\t\t\t\tsb.append(fileGenerator.getRenameOf(op1, false, this.stmtIdx));\n\t\t\t}else{\n\t\t\t\tsb.append(op1.toString());\n\t\t\t}\n\t\t\tsb.append(\" \");\n\t\t\tif(op2 instanceof Local){\n\t\t\t\tsb.append(fileGenerator.getRenameOf(op2, false, this.stmtIdx));\n\t\t\t}else{\n\t\t\t\tsb.append(op2.toString());\n\t\t\t}\n\t\t\tsb.append(\")\");\n\t\t\tthis.exprStr = sb.toString();\n\t\t\tbreak;\n\t\t//[end] DIV\n\t\t//[start] EQ\n\t\tcase EQ:\n\t\t\t//eq_expr = immediate \"==\" immediate;\n\t\t\t//b = r1 == r2\n\t\t\t//(assert (= b (= r1 r2)))\n\t\t\tsb.append(\"(= \");\n\t\t\tif(op1 instanceof Local){\n\t\t\t\tsb.append(fileGenerator.getRenameOf(op1, false, this.stmtIdx));\n\t\t\t}else{\n\t\t\t\tsb.append(op1.toString());\n\t\t\t}\n\t\t\tsb.append(\" \");\n\t\t\tif(op2 instanceof Local){\n\t\t\t\tsb.append(fileGenerator.getRenameOf(op2, false, this.stmtIdx));\n\t\t\t}else{\n\t\t\t\tsb.append(op2.toString());\n\t\t\t}\n\t\t\tsb.append(\")\");\n\t\t\tthis.exprStr = sb.toString();\n\t\t\tbreak;\n\t\t//[end] EQ\n\t\t//[start] GE\n\t\tcase GE:\n\t\t\t//ge_expr = immediate \">=\" immediate;\n\t\t\t//b = r1 >= r2\n\t\t\t//(assert (= b (>= r1 r2)))\n\t\t\tsb.append(\"(>= \");\n\t\t\tif(op1 instanceof Local){\n\t\t\t\tsb.append(fileGenerator.getRenameOf(op1, false, this.stmtIdx));\n\t\t\t}else{\n\t\t\t\tsb.append(op1.toString());\n\t\t\t}\n\t\t\tsb.append(\" \");\n\t\t\tif(op2 instanceof Local){\n\t\t\t\tsb.append(fileGenerator.getRenameOf(op2, false, this.stmtIdx));\n\t\t\t}else{\n\t\t\t\tsb.append(op2.toString());\n\t\t\t}\n\t\t\tsb.append(\")\");\n\t\t\tthis.exprStr = sb.toString();\n\t\t\tbreak;\n\t\t//[end] GE\n\t\t//[start] GT\n\t\tcase GT:\n\t\t\t//gt_expr = immediate \">\" immediate;\n\t\t\t//b = r1 > r2\n\t\t\t//(assert (= b (> r1 r2)))\n\t\t\tsb.append(\"(> \");\n\t\t\tif(op1 instanceof Local){\n\t\t\t\tsb.append(fileGenerator.getRenameOf(op1, false, this.stmtIdx));\n\t\t\t}else{\n\t\t\t\tsb.append(op1.toString());\n\t\t\t}\n\t\t\tsb.append(\" \");\n\t\t\tif(op2 instanceof Local){\n\t\t\t\tsb.append(fileGenerator.getRenameOf(op2, false, this.stmtIdx));\n\t\t\t}else{\n\t\t\t\tsb.append(op2.toString());\n\t\t\t}\n\t\t\tsb.append(\")\");\n\t\t\tthis.exprStr = sb.toString();\n\t\t\tbreak;\n\t\t//[end] GT\n\t\t//[start] LE\n\t\tcase LE:\n\t\t\t//le_expr = immediate \"<=\" immediate;\n\t\t\t//b = r1 <= r2\n\t\t\t//(assert (= b (<= r1 r2)))\n\t\t\tsb.append(\"(<= \");\n\t\t\tif(op1 instanceof Local){\n\t\t\t\tsb.append(fileGenerator.getRenameOf(op1, false, this.stmtIdx));\n\t\t\t}else{\n\t\t\t\tsb.append(op1.toString());\n\t\t\t}\n\t\t\tsb.append(\" \");\n\t\t\tif(op2 instanceof Local){\n\t\t\t\tsb.append(fileGenerator.getRenameOf(op2, false, this.stmtIdx));\n\t\t\t}else{\n\t\t\t\tsb.append(op2.toString());\n\t\t\t}\n\t\t\tsb.append(\")\");\n\t\t\tthis.exprStr = sb.toString();\n\t\t\tbreak;\n\t\t//[end] LE\n\t\t//[start] LT\n\t\tcase LT:\n\t\t\t//lt_expr = immediate \"<\" immediate;\n\t\t\t//b = r1 < r2\n\t\t\t//(assert (= b (< r1 r2)))\n\t\t\tsb.append(\"(< \");\n\t\t\tif(op1 instanceof Local){\n\t\t\t\tsb.append(fileGenerator.getRenameOf(op1, false, this.stmtIdx));\n\t\t\t}else{\n\t\t\t\tsb.append(op1.toString());\n\t\t\t}\n\t\t\tsb.append(\" \");\n\t\t\tif(op2 instanceof Local){\n\t\t\t\tsb.append(fileGenerator.getRenameOf(op2, false, this.stmtIdx));\n\t\t\t}else{\n\t\t\t\tsb.append(op2.toString());\n\t\t\t}\n\t\t\tsb.append(\")\");\n\t\t\tthis.exprStr = sb.toString();\n\t\t\tbreak;\n\t\t//[end] LT\n\t\t//[start] MUL\n\t\tcase MUL:\n\t\t\t//mul_expr = immediate \"*\" immediate;\n\t\t\t//(* op1 op2)\n\t\t\tsb.append(\"(* \");\n\t\t\tif(op1 instanceof Local){\n\t\t\t\tsb.append(fileGenerator.getRenameOf(op1, false, this.stmtIdx));\n\t\t\t}else{\n\t\t\t\tsb.append(op1.toString());\n\t\t\t}\n\t\t\tsb.append(\" \");\n\t\t\tif(op2 instanceof Local){\n\t\t\t\tsb.append(fileGenerator.getRenameOf(op2, false, this.stmtIdx));\n\t\t\t}else{\n\t\t\t\tsb.append(op2.toString());\n\t\t\t}\n\t\t\tsb.append(\")\");\n\t\t\tthis.exprStr = sb.toString();\n\t\t\tbreak;\n\t\t//[end] MUL\n\t\t//[start] NE\n\t\tcase NE:\n\t\t\t//ne_expr = immediate \"!=\" immediate;\n\t\t\t//(not (= op1 op2))\n\t\t\tsb.append(\"(not (= \");\n\t\t\tif(op1 instanceof Local){\n\t\t\t\tsb.append(fileGenerator.getRenameOf(op1, false, this.stmtIdx));\n\t\t\t}else{\n\t\t\t\tsb.append(op1.toString());\n\t\t\t}\n\t\t\tsb.append(\" \");\n\t\t\tif(op2 instanceof Local){\n\t\t\t\tsb.append(fileGenerator.getRenameOf(op2, false, this.stmtIdx));\n\t\t\t}else{\n\t\t\t\tsb.append(op2.toString());\n\t\t\t}\n\t\t\tsb.append(\"))\");\n\t\t\tthis.exprStr = sb.toString();\n\t\t\tbreak;\n\t\t//[end] NE\n\t\tcase OR:\n\t\t\t//or_expr = immediate \"|\" immediate;\n\t\t\t//TODO\n\t\t\tassert(false) : \"OR Expr\";\n\t\t\tbreak;\n\t\t//[start] REM\n\t\tcase REM:\n\t\t\t//rem_expr = immediate \"%\" immediate;\n\t\t\t//(rem op1 op2)\n\t\t\tsb.append(\"(rem \");\n\t\t\tif(op1 instanceof Local){\n\t\t\t\tsb.append(fileGenerator.getRenameOf(op1, false, this.stmtIdx));\n\t\t\t}else{\n\t\t\t\tsb.append(op1.toString());\n\t\t\t}\n\t\t\tsb.append(\" \");\n\t\t\tif(op2 instanceof Local){\n\t\t\t\tsb.append(fileGenerator.getRenameOf(op2, false, this.stmtIdx));\n\t\t\t}else{\n\t\t\t\tsb.append(op2.toString());\n\t\t\t}\n\t\t\tsb.append(\")\");\n\t\t\tthis.exprStr = sb.toString();\n\t\t\tbreak;\n\t\t//[end] REM\n\t\t//[start] SUB\n\t\tcase SUB:\n\t\t\t//sub_expr = immediate \"-\" immediate;\n\t\t\t//(- op1 op2)\n\t\t\tsb.append(\"(- \");\n\t\t\tif(op1 instanceof Local){\n\t\t\t\tsb.append(fileGenerator.getRenameOf(op1, false, this.stmtIdx));\n\t\t\t}else{\n\t\t\t\tsb.append(op1.toString());\n\t\t\t}\n\t\t\tsb.append(\" \");\n\t\t\tif(op2 instanceof Local){\n\t\t\t\tsb.append(fileGenerator.getRenameOf(op2, false, this.stmtIdx));\n\t\t\t}else{\n\t\t\t\tsb.append(op2.toString());\n\t\t\t}\n\t\t\tsb.append(\")\");\n\t\t\tthis.exprStr = sb.toString();\n\t\t\tbreak;\n\t\t//[end] SUB\n\t\t}\n\t}", "private void jetExprStr(){\n\t\texprType = Z3MiscFunctions.v().getExprType(rExpr);\n\t\tswitch(exprType){\n\t\t\tcase BINOP:\n\t\t\t\tjetBinopExprStr();\n\t\t\t\tbreak;\n\t\t\tcase CAST:\n\t\t\t\tjetCastExprStr();\n\t\t\t\tbreak;\n\t\t\tcase INVOKE:\n\t\t\t\tjetInvokeExpr();\n\t\t\t\tbreak;\n\t\t\tcase NEWARRAY:\n\t\t\t\tjetNewArrayExpr();\n\t\t\t\tbreak;\n\t\t\tcase NEWEXPR:\n\t\t\t\tjetNewExpr();\n\t\t\t\tbreak;\n\t\t\tcase UNOP:\n\t\t\t\tjetUnopExpr();\n\t\t\t\tbreak;\n\t\t\tcase INSTANCEOF:\n\t\t\t\t//TODO\n\t\t\t\tassert(false);\n\t\t\t\tbreak;\n\t\t\tcase NEWMULIARRAY:\n\t\t\t\t//TODO\n\t\t\t\tassert(false);\n\t\t\t\tbreak;\n\t\t}\n\t}", "@Override\n\tpublic String toString() {\n\t\tFormula[] literals = new Formula[posLiterals.size() + negLiterals.size()];\n\t\tint i;\n\t\tfor (i = 0; i < posLiterals.size(); i++)\n\t\t\tliterals[i] = new Negation(posLiterals.get(i));\n\t\tfor (int j = 0; j < negLiterals.size(); j++)\n\t\t\tliterals[i++] = negLiterals.get(j);\n\t\t\n\t\treturn (literals.length > 1) ? new Disjunction(literals).toString() : literals[0].toString();\n\t}", "public String toString(){\n return \"while (\" + bExpression.toString() + \")\\n\" + s1.toStringTabbed(1);\n }", "public String toString() {\n Class<? extends AST> tclass = this.getClass();\n // isolate relative name (starting after the rightmost '.')\n String absoluteClassName = tclass.toString();\n int dotIndex = absoluteClassName.lastIndexOf(\".\", absoluteClassName.length());\n String relativeClassName = absoluteClassName.substring(dotIndex+1);\n // retrieving fields (note that, unfortunately, they are not ordered)\n // TO DO : get rid of static fields (pb in case of singletons)\n Field[] fields = tclass.getDeclaredFields();\n // building string representation of the arguments of the nodes\n int arity = fields.length;\n String args = \"\";\n for(int index = 0; index < arity; index++) {\n String arg;\n try {\n arg = fields[index].get(this).toString(); // retrieve string representation of all arguments\n } catch (Exception e) {\n arg = \"?\"; // IllegalArgument or IllegalAccess Exception (this shouldn't happen)\n }\n if (index != 0) // a separator is required before each argument except the first\n args = args + \", \" + arg;\n//\t\t\t\targs = args + \" \" + arg;\n else\n args = args + arg;\n }\n return relativeClassName + \"(\" + args + \")\";\n//\t\treturn \"<\" + relativeClassName + \">\" + args + \"</\" + relativeClassName + \">\";\n }", "@Override\r\n public String toString() {\r\n String result = head.toString();\r\n if (result.equals(\"\")) {\r\n return \"0\";\r\n }\r\n if (result.charAt(0) == '+') {\r\n result = result.substring(1);\r\n }\r\n return result;\r\n }", "public String toString() {\n\t\t// Converts column\n\t\tString columnStr = \"\";\n\t\tfor (int tempColumn = cell.getAddress().getColumn();\n\t\t\t\ttempColumn >= 0; tempColumn = tempColumn\n\t\t\t\t\t/ (Address.HIGHEST_CHAR - Address.LOWEST_CHAR + 1) - 1)\n\t\t\tcolumnStr = ((char)((char)(tempColumn % (Address.HIGHEST_CHAR\n\t\t\t\t- Address.LOWEST_CHAR + 1)) + Address.LOWEST_CHAR)) + columnStr;\n\t\tif (columnAbsolute)\n\t\t\tcolumnStr = ABSOLUTE_OPERATOR + columnStr;\n\n\t\t// Converts row\n\t\tString rowStr = (rowAbsolute ? ABSOLUTE_OPERATOR : \"\")\n\t\t\t+ (cell.getAddress().getRow() + 1);\n\t\treturn columnStr + rowStr;\n\t}", "public String toString() { return \"\"; }", "public String toString() { return \"\"; }", "@Override()\n public String toString()\n {\n final StringBuilder buffer = new StringBuilder();\n toString(buffer);\n return buffer.toString();\n }", "public abstract String toString(String bin);", "@Override\n\tpublic String toString() {\n\t\t//Invert the Stack by pushing Nodes to a new Stack\n\t\tMyStack<T> invertedStack = new MyStack<T>(this.size());\n\t\twhile(!this.isEmpty()) {\n\t\t\tinvertedStack.push(this.pop());\n\t\t}\n\t\t\n\t\t//Create empty String for returning\n\t\tString returnString = \"\";\n\t\t\n\t\t//Create an iterator for traversing the Stack\n\t\tNode iteratorNode = invertedStack.topNode;\n\t\t\n\t\t//Traverse the Stack and append the individual data Strings to the return String\n\t\tfor(int i = 0; i < invertedStack.size(); i++) {\n\t\t\treturnString += iteratorNode.data.toString();\n\t\t\titeratorNode = iteratorNode.nextNode;\n\t\t}\n\t\t\n\t\t//Restore the original Stack so that it isn't destroyed\n\t\twhile(!invertedStack.isEmpty()) {\n\t\t\tthis.push(invertedStack.pop());\n\t\t}\n\t\t\n\t\t//Return the finished String to the function caller\n\t\treturn returnString;\n\t}", "public String toString() {\n return sb.toString();\n }", "public String toString();" ]
[ "0.77128035", "0.7481237", "0.7359474", "0.71864986", "0.6992027", "0.69253093", "0.69238615", "0.69204354", "0.6917663", "0.6880741", "0.68610466", "0.68461955", "0.6781008", "0.67475784", "0.6732207", "0.6732207", "0.6721226", "0.67079294", "0.6702028", "0.66144115", "0.6593263", "0.65846556", "0.65563756", "0.65039116", "0.6488364", "0.6469475", "0.6371619", "0.63506216", "0.63423395", "0.633469", "0.63263446", "0.63184065", "0.63081676", "0.6297148", "0.62970185", "0.6294389", "0.62590015", "0.6248881", "0.62401307", "0.62042356", "0.61841846", "0.61777496", "0.6175081", "0.61653274", "0.61653274", "0.6160756", "0.6147971", "0.6147971", "0.6147971", "0.6147971", "0.6147971", "0.6147971", "0.6147971", "0.6147971", "0.6147971", "0.6147971", "0.6147971", "0.6147971", "0.6147971", "0.6147971", "0.6147971", "0.6147971", "0.6147971", "0.6147971", "0.6147971", "0.6147971", "0.6147971", "0.6147971", "0.6147971", "0.6147971", "0.6147971", "0.6147971", "0.6147971", "0.6147971", "0.6146539", "0.61198837", "0.61104596", "0.60992885", "0.6097221", "0.6086671", "0.60814553", "0.60809714", "0.60667455", "0.60623544", "0.6060512", "0.6059231", "0.60530573", "0.6049836", "0.6048316", "0.6043298", "0.60422385", "0.60371846", "0.6022999", "0.60188824", "0.60188824", "0.60159475", "0.6015286", "0.6014011", "0.6002793", "0.5996662" ]
0.7670261
1
toGrammar prints out the grammar of this class. Each class represents the LHS abstraction of the Julia grammar. It then calls the toGrammar for each nonterminal piece of the grammar. Full Grammar: >
public void toGrammar() { System.out.println("<binary_expression> -> <arithmeitc_expression> <arithmetic_op> <arithmetic_expression>"); left.toGrammar(); operator.toGrammar(); right.toGrammar(); prefix(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private void writeGrammar() {\n grammar = new ArrayList<ArrayList<String>>();\n\n int programLine = 0;\n String inputLine = null;\n try {\n FileReader reader = new FileReader(grammarFile);\n BufferedReader bufferedReader = new BufferedReader(reader);\n\n while((inputLine = bufferedReader.readLine()) != null) {\n\n // removes all leading and trailing whitespaces and leading tabs\n String line = inputLine.trim().replaceFirst(\"\\\\t\", \"\");\n\n // processes a production rule on each nonempty program line\n if(!line.isEmpty() || !line.equals(\"\")) {\n String[] tokens = line.split(\"\\\\s+\");\n grammar.add(new ArrayList<String>(Arrays.asList(tokens)));\n }\n\n programLine++;\n }\n\n bufferedReader.close();\n\n } catch(FileNotFoundException e) {\n System.out.println(\n grammarFile + \" not found\"\n );\n } catch(IOException e) {\n System.out.println(\n \"Error reading file \" + grammarFile\n );\n }\n\n // check to see if grammar correctly read from file\n// for(int i = 0; i < grammar.size(); i++) {\n// printArrayList(grammar.get(i));\n// System.out.println();\n// }\n }", "public String toString(){\n\t\tStringBuffer buffer = new StringBuffer();\n\t\t\n\t\tbuffer.append(lhs);\n\t\tbuffer.append(\" -> \");\n\t\t\n\t\t// if this is a lexical rule, prefix it with the lexical symbol\n\t\tif( lexical ){\n\t\t\tbuffer.append(LEXICAL_PREFIX);\n\t\t}\n\t\t\n\t\tfor( String s: rhs ){\n\t\t\tbuffer.append(s + \" \");\n\t\t}\n\t\t\n\t\t// delete the trailing whitespace\n\t\tbuffer.deleteCharAt(buffer.length()-1);\n\t\t\n\t\tbuffer.append(\"\\t\\t\" + weight);\n\t\t\n\t\treturn buffer.toString();\n\t}", "IGrammarComp getGrammar();", "public CGrammar getGrammarStructure();", "private void outputGrammarRuleClass(PrintWriter out) {\n\t\t\n\t\tout.println(\" private class GrammarRule {\");\n\t\tout.println(\" String name;\");\n\t\tout.println(\" boolean multi_child, subrule;\");\n\t\tout.println(\" GrammarState[] graph;\");\n\t\tout.println();\n\t\tout.println(\" public GrammarRule(String n, boolean m, boolean s, GrammarState[] g) {\");\n\t\tout.println(\" name = n; multi_child = m; subrule = s; graph = g;\");\n\t\tout.println(\" }\");\n\t\tout.println(\" } // end GrammarRule\");\n\t\t\n\t}", "public interface IGrammarComp extends IPAMOJAComponent{\n \n /**\n * Returns the internal structure of this grammar.\n * \n * @return the internal structure of this grammar\n */\n public CGrammar getGrammarStructure();\n\n \n /**\n * Sets the value of the internal structure of this grammar, generates its corresponding string representation, performs grammar analysis and notifies observers about <code>GrammarStructure</code> property changes.\n * @param aGrammarStructure\n */\n public void setGrammarStructure(CGrammar aGrammarStructure);\n \n \n /**\n * Returns the string representation of this grammar.\n * \n * @return the string representation of this grammar\n */\n public String getGrammarText();\n\n /* \n * Set the string representation of this grammar.\n * Check well-formedness of the string representation of the grammar.\n * Signal an error if the string representation is invalid else compute the\n * internal representation of the grammar. Also generate analysis\n * information and fire a property change.\n *\n * @param aGrammarText the text representation of the grammar to set.\n * @pre: Grammar is well-formed(See <code>toText(String aGrammarText)</code>)\n *\n */\n\n /**\n *\n * @param aGrammarText\n */\n \n\n public void setGrammarText(String aGrammarText);\n \n /**\n * Returns <code>true</code> if this grammar is annotated with endmarker symbol, <code>false</code>\n * otherwise.\n *\n * @return <code>true</code> if this grammar is annotated with endmarker symbol, <code>false</code>\n * otherwise\n */\n public boolean isAugment();\n /**\n * Set the value of Augment and notify observers about <code>Augment</code> property changes.\n *\n * \n * @param aValue new value of Augment\n */\n public void setAugment(boolean aValue);\n \n /**\n * Returns <code>true</code> if a terminal symbol of this grammar has data, <code>false</code>\n * otherwise.\n * \n * @param aSym the code of this terminal symbol\n * @return <code>true</code> if this terminal symbol has data, <code>false</code>\n * otherwise\n */\n public boolean hasData(int aSym);\n \n /**\n * Returns structure representation of RE text.\n * @param aString\n * @return \n */\n // public CRE RETextToTree(String aString);\n /**\n * Removes all elements from the grammar component\n */\n public void clear();\n\n /**\n *\n * @return\n */\n public boolean ELL1();\n}", "public static void main(String[] args) {\n\t\t\n//\t\t//PA4 a\n//\t\tArrayList<ArrayList<String>> rhs1 = new ArrayList<>();\n//\t\tArrayList<String> rhs11 = new ArrayList<>();\n//\t\trhs11.add(\"S\");rhs11.add(\"a\");\n//\t\tArrayList<String> rhs12 = new ArrayList<>();\n//\t\trhs12.add(\"b\");\t\t\n//\t\trhs1.add(rhs11);\n//\t\trhs1.add(rhs12);\n//\n//\t\tRule r1 = new Rule(\"S\", rhs1); // S -> Aa | b\n//\t\tArrayList<Rule> rules = new ArrayList<>();\n//\t\trules.add(r1);\n//\t\tGrammar g = new Grammar(rules);\n//\t\tg.eliminateEpsilonRule();\n//\t\tg.eliminateLR();\n//\t\tSystem.out.println(g);\n//\t\tSystem.out.println(\"----------------------\");\n\t\t\n//\t\t//PA4 b\n//\t\tArrayList<ArrayList<String>> rhs1 = new ArrayList<>();\n//\t\tArrayList<String> rhs11 = new ArrayList<>();\n//\t\trhs11.add(\"S\");rhs11.add(\"a\");rhs11.add(\"b\");\n//\t\tArrayList<String> rhs12 = new ArrayList<>();\n//\t\trhs12.add(\"c\");rhs12.add(\"d\");\t\t\n//\t\trhs1.add(rhs11);\n//\t\trhs1.add(rhs12);\n//\n//\t\tRule r1 = new Rule(\"S\", rhs1); // S -> Aa | b\n//\t\tArrayList<Rule> rules = new ArrayList<>();\n//\t\trules.add(r1);\n//\t\tGrammar g = new Grammar(rules);\n//\t\tg.eliminateEpsilonRule();\n//\t\tg.eliminateLR();\n//\t\tSystem.out.println(g);\n//\t\tSystem.out.println(\"----------------------\");\n\t\t\n//\t\t//PA4 c\n//\t\tArrayList<ArrayList<String>> rhs1 = new ArrayList<>();\n//\t\tArrayList<String> rhs11 = new ArrayList<>();\n//\t\trhs11.add(\"S\");rhs11.add(\"U\");rhs11.add(\"S\");\n//\t\tArrayList<String> rhs12 = new ArrayList<>();\n//\t\trhs12.add(\"S\");rhs12.add(\"S\");\t\t\n//\t\tArrayList<String> rhs13 = new ArrayList<>();\n//\t\trhs13.add(\"S\");rhs13.add(\"*\");\n//\t\tArrayList<String> rhs14 = new ArrayList<>();\n//\t\trhs14.add(\"(\");rhs14.add(\"S\");rhs14.add(\")\");\n//\t\tArrayList<String> rhs15 = new ArrayList<>();\n//\t\trhs15.add(\"a\");\n//\t\trhs1.add(rhs11);\n//\t\trhs1.add(rhs12);\n//\t\trhs1.add(rhs13);\n//\t\trhs1.add(rhs14);\n//\t\trhs1.add(rhs15);\n//\n//\n//\t\tRule r1 = new Rule(\"S\", rhs1); // S -> Aa | b\n//\t\tArrayList<Rule> rules = new ArrayList<>();\n//\t\trules.add(r1);\n//\t\tGrammar g = new Grammar(rules);\n//\t\tg.eliminateEpsilonRule();\n//\t\tg.eliminateLR();\n//\t\tSystem.out.println(g);\n//\t\tSystem.out.println(\"----------------------\");\n\t\t\n\t\t\n//\t\t//PA-3 d\n//\t\t\n//\t\tArrayList<ArrayList<String>> rhs1 = new ArrayList<>();\n//\t\tArrayList<String> rhs11 = new ArrayList<>();\n//\t\trhs11.add(\"rexpr\");rhs11.add(\"U\");rhs11.add(\"rterm\");\t\n//\t\tArrayList<String> rhs12 = new ArrayList<>();\n//\t\trhs12.add(\"rterm\");\n//\t\trhs1.add(rhs11);\n//\t\trhs1.add(rhs12);\n//\t\tRule r1 = new Rule(\"rexpr\", rhs1);\n//\n//\t\tArrayList<ArrayList<String>> rhs2 = new ArrayList<>();\n//\t\tArrayList<String> rhs21 = new ArrayList<>();\n//\t\trhs21.add(\"rterm\");rhs21.add(\"r factor\");\n//\t\tArrayList<String> rhs22 = new ArrayList<>();\n//\t\trhs22.add(\"r factor\");\n//\t\trhs2.add(rhs21);\n//\t\trhs2.add(rhs22);\n//\t\tRule r2 = new Rule(\"rterm\", rhs2);\n//\n//\t\tArrayList<ArrayList<String>> rhs3 = new ArrayList<>();\n//\t\tArrayList<String> rhs31 = new ArrayList<>();\n//\t\trhs31.add(\"r factor\");rhs31.add(\"*\");\n//\t\tArrayList<String> rhs32 = new ArrayList<>();\n//\t\trhs32.add(\"rprimary\");\n//\t\trhs3.add(rhs31);\n//\t\trhs3.add(rhs32);\n//\t\tRule r3 = new Rule(\"r factor\", rhs3);\n//\t\t\n//\t\tArrayList<ArrayList<String>> rhs4 = new ArrayList<>();\n//\t\tArrayList<String> rhs41 = new ArrayList<>();\n//\t\trhs41.add(\"a\");\n//\t\tArrayList<String> rhs42 = new ArrayList<>();\n//\t\trhs42.add(\"b\");\n//\t\trhs4.add(rhs41);\n//\t\trhs4.add(rhs42);\n//\t\tRule r4 = new Rule(\"rprimary\", rhs4);\n//\n//\t\tArrayList<Rule> rules = new ArrayList<>();\n//\t\trules.add(r1);\n//\t\trules.add(r2);\n//\t\trules.add(r3);\n//\t\trules.add(r4);\n//\t\tGrammar g = new Grammar(rules);\n//\t\tg.eliminateEpsilonRule();\n//\t\tg.eliminateLR();\n//\n//\t\tSystem.out.println(g);\n//\t\tSystem.out.println(\"----------------------\");\t\n\t\t\t\n//\t\t//PA-3 e\t\n//\t\t\n//\t\tArrayList<ArrayList<String>> rhs1 = new ArrayList<>();\n//\t\tArrayList<String> rhs11 = new ArrayList<>();\n//\t\trhs11.add(\"0\");\n//\t\tArrayList<String> rhs12 = new ArrayList<>();\n//\t\trhs12.add(\"T\");rhs12.add(\"1\");\t\t\n//\t\trhs1.add(rhs11);\n//\t\trhs1.add(rhs12);\n//\t\t\n//\t\tArrayList<ArrayList<String>> rhs2 = new ArrayList<>();\n//\t\tArrayList<String> rhs21 = new ArrayList<>();\n//\t\trhs21.add(\"1\");\n//\t\tArrayList<String> rhs22 = new ArrayList<>();\n//\t\trhs22.add(\"A\");rhs22.add(\"0\");\t\t\n//\t\trhs2.add(rhs21);\n//\t\trhs2.add(rhs22);\n//\n//\t\tRule r1 = new Rule(\"A\", rhs1);\n//\t\tRule r2 = new Rule(\"T\", rhs2);\n//\n//\t\tArrayList<Rule> rules = new ArrayList<>();\n//\t\trules.add(r1);\n//\t\trules.add(r2);\n//\t\tGrammar g = new Grammar(rules);\n//\t\tg.eliminateEpsilonRule();\n//\t\tg.eliminateLR();\n//\t\tSystem.out.println(g);\n//\t\tSystem.out.println(\"----------------------\");\n\n\n\t\t\n//\t\t//PA-3 f\n//\t\t\n//\t\tArrayList<ArrayList<String>> rhs1 = new ArrayList<>();\n//\t\tArrayList<String> rhs11 = new ArrayList<>();\n//\t\trhs11.add(\"B\");rhs11.add(\"C\");\t\n//\t\trhs1.add(rhs11);\n//\t\tRule r1 = new Rule(\"A\", rhs1);\n//\n//\t\tArrayList<ArrayList<String>> rhs2 = new ArrayList<>();\n//\t\tArrayList<String> rhs21 = new ArrayList<>();\n//\t\trhs21.add(\"B\");rhs21.add(\"b\");\n//\t\tArrayList<String> rhs22 = new ArrayList<>();\n//\t\trhs22.add(\"e\");\n//\t\trhs2.add(rhs21);\n//\t\trhs2.add(rhs22);\n//\t\tRule r2 = new Rule(\"B\", rhs2);\n//\n//\t\tArrayList<ArrayList<String>> rhs3 = new ArrayList<>();\n//\t\tArrayList<String> rhs31 = new ArrayList<>();\n//\t\trhs31.add(\"A\");rhs31.add(\"C\");\n//\t\tArrayList<String> rhs32 = new ArrayList<>();\n//\t\trhs32.add(\"a\");\n//\t\trhs3.add(rhs31);\n//\t\trhs3.add(rhs32);\n//\t\tRule r3 = new Rule(\"C\", rhs3);\n//\n//\t\tArrayList<Rule> rules = new ArrayList<>();\n//\t\trules.add(r1);\n//\t\trules.add(r2);\n//\t\trules.add(r3);\n//\t\tGrammar g = new Grammar(rules);\n//\t\tSystem.out.println(g);\n//\t\tg.eliminateEpsilonRule();\n//\t\tSystem.out.println(g);\n//\n//\t\tg.eliminateLR();\n//\n//\t\tSystem.out.println(g);\n//\t\tSystem.out.println(\"----------------------\");\n\n\t}", "public String getGrammar(){\r\n return grammar;\r\n }", "public String toString() {\n return this.grammarRules.keySet() + \"\";\n\t}", "public static void main(String[] args) {\n\t\ttry {\r\n\t\t\t// Scanner scanner = new Scanner(System.in);\r\n\t\t\t//Grammar grammar = new Grammar(\"(i * i) * (i + i) - i\");\r\n\t\t\tGrammar grammar = new Grammar(\"i + i * i\");\r\n\t\t\tgrammar.addTerminal(\"SYMBOL\", TokenType.ID, \"i\");\r\n\t\t\tgrammar.addTerminal(\"PLUS\", TokenType.OPERATOR, OperatorType.PLUS);\r\n\t\t\tgrammar.addTerminal(\"MINUS\", TokenType.OPERATOR, OperatorType.MINUS);\r\n\t\t\tgrammar.addTerminal(\"TIMES\", TokenType.OPERATOR, OperatorType.TIMES);\r\n\t\t\tgrammar.addTerminal(\"DIVIDE\", TokenType.OPERATOR,\r\n\t\t\t\t\tOperatorType.DIVIDE);\r\n\t\t\tgrammar.addTerminal(\"LPA\", TokenType.OPERATOR, OperatorType.LPARAN);\r\n\t\t\tgrammar.addTerminal(\"RPA\", TokenType.OPERATOR, OperatorType.RPARAN);\r\n\t\t\tgrammar.setEpsilonName(\"epsilon\");\r\n\t\t\tString[] nons = new String[] {\r\n\t\t\t\t\t\"E\", \"E1\", \"T\", \"T1\", \"F\", \"A\", \"M\"\r\n\t\t\t};\r\n\t\t\tfor (String non : nons){\r\n\t\t\t\tgrammar.addNonTerminal(non);\r\n\t\t\t}\r\n\t\t\tgrammar.infer(\"E -> T E1\");\r\n\t\t\tgrammar.infer(\"E1 -> A T E1 | @epsilon\");\r\n\t\t\tgrammar.infer(\"T -> F T1\");\r\n\t\t\tgrammar.infer(\"T1 -> M F T1 | @epsilon\");\r\n\t\t\tgrammar.infer(\"F -> @LPA E @RPA | @SYMBOL\");\r\n\t\t\tgrammar.infer(\"A -> @PLUS | @MINUS\");\r\n\t\t\tgrammar.infer(\"M -> @TIMES | @DIVIDE\");\r\n\t\t\tgrammar.initialize(\"E\");\r\n\t\t\tSystem.out.println(grammar.toString());\r\n\t\t\tSystem.out.println(grammar.getPredictionString());\r\n\t\t\tgrammar.run();\r\n\t\t\tSystem.out.println(grammar.getTokenString());\r\n\t\t\t// scanner.close();\r\n\t\t} catch (RegexException e) {\r\n\t\t\tSystem.err.println(e.getPosition() + \",\" + e.getMessage());\r\n\t\t\te.printStackTrace();\r\n\t\t} catch (SyntaxException e) {\r\n\t\t\tSystem.err.println(e.getPosition() + \",\" + e.getMessage() + \" \"\r\n\t\t\t\t\t+ e.getInfo());\r\n\t\t\te.printStackTrace();\r\n\t\t} catch (GrammarException e) {\r\n\t\t\tSystem.err.println(e.getPosition() + \",\" + e.getMessage() + \" \"\r\n\t\t\t\t\t+ e.getInfo());\r\n\t\t\te.printStackTrace();\r\n\t\t}\r\n\t}", "private String tokenToGrammar(Token v) {\n\n if(v.getChVals().equals(\"$\")){\n return \"$\";\n }\n\n String type = v.getType();\n\n if(type.equals(\"keyword\")) {\n type = v.getChVals();\n }\n\n switch (type) {\n case \"begin\":\n return \"b\";\n case \"halt\":\n return \"t\";\n case \"cat\":\n return \"c\";\n case \"mouse\":\n return \"m\";\n case \"clockwise\":\n return \"l\";\n case \"move\":\n return \"o\";\n case \"north\":\n return \"n\";\n case \"south\":\n return \"s\";\n case \"east\":\n return \"e\";\n case \"west\":\n return \"w\";\n case \"hole\":\n return \"h\";\n case \"repeat\":\n return \"r\";\n case \"size\":\n return \"z\";\n case \"end\":\n return \"d\";\n case \"integer\":\n return \"i\";\n case \"variable\":\n return \"v\";\n default:\n return type;\n }\n }", "public void printRule()\n {\n System.out.print(lhs + \" ::= \");\n for( String s : rhsSymbols)\n System.out.print(s + \" \");\n System.out.println();\n }", "public void output(PrintWriter out) {\n\t\t\n\t\tString classname = prefix + \"Parser\";\n\t\tString startRuleName = grammardef.getStartRuleName();\n\t\t\n\t\tout.println(\"import java.util.HashMap;\");\n\t\tout.println(\"import java.util.Stack;\");\n\t\t\n\t\tout.println(\"public class \" + classname + \" {\");\n\t\tout.println();\n\t\t\n\t\tout.println(\" private static final String startRuleName = \\\"\" + startRuleName + \"\\\";\");\n\t\tout.println();\n\t\tout.println(\" private \" + prefix + \"iTokenizer tokenizer;\");\n\t\tout.println();\n\t\tout.println(\" private HashMap<String, HashMap<String, GrammarRule>> table = new HashMap<String, HashMap<String, GrammarRule>>();\");\n\t\tout.println();\n\t\t\n\t\tout.println(\" public \" + classname + \" (\" + prefix + \"iTokenizer tokenizer) { this.tokenizer = tokenizer; buildTable(); }\");\n\t\tout.println();\n\t\t\n\t\toutputParseFunction(out, startRuleName);\n\t\tout.println();\n\t\t\n\t\toutputMakeNodeFunction(out);\n\t\tout.println();\n\t\t\n\t\toutputBuildTableFunction(out);\n\t\tout.println();\n\t\t\n\t\toutputGrammarRuleClass(out);\n\t\tout.println();\n\t\t\n\t\toutputGrammarStateClass(out);\n\t\tout.println();\n\t\t\n\t\tout.println(\"} // end \" + classname);\n\t\t\n\t}", "protected GrammarNode createGrammar() throws IOException {\n languageModel.allocate();\n Timer.start(\"LMGrammar.create\");\n GrammarNode firstNode = null;\n if (languageModel.getMaxDepth() > 2) {\n System.out.println(\"Warning: LMGrammar limited to bigrams\");\n }\n int identity = 0;\n List nodes = new ArrayList();\n Set words = languageModel.getVocabulary();\n // create all of the word nodes\n for (Iterator i = words.iterator(); i.hasNext();) {\n String word = (String) i.next();\n GrammarNode node = createGrammarNode(identity++, word);\n if (node != null && !node.isEmpty()) {\n if (node.getWord().equals(\n getDictionary().getSentenceStartWord())) {\n firstNode = node;\n } else if (node.getWord().equals(\n getDictionary().getSentenceEndWord())) {\n node.setFinalNode(true);\n }\n nodes.add(node);\n }\n }\n if (firstNode == null) {\n throw new Error(\"No sentence start found in language model\");\n }\n for (Iterator i = nodes.iterator(); i.hasNext();) {\n GrammarNode prevNode = (GrammarNode) i.next();\n // don't add any branches out of the final node\n if (prevNode.isFinalNode()) {\n continue;\n }\n for (Iterator j = nodes.iterator(); j.hasNext();) {\n GrammarNode nextNode = (GrammarNode) j.next();\n String prevWord = prevNode.getWord().getSpelling();\n String nextWord = nextNode.getWord().getSpelling();\n Word[] wordArray = {getDictionary().getWord(prevWord),\n getDictionary().getWord(nextWord)};\n float logProbability = languageModel\n .getProbability(WordSequence.getWordSequence(wordArray));\n prevNode.add(nextNode, logProbability);\n }\n }\n Timer.stop(\"LMGrammar.create\");\n languageModel.deallocate();\n return firstNode;\n }", "public Node program() {\r\n\r\n this.CheckError(\"PROGRAM\");\r\n\r\n\r\n Node n_program = new Node(\"program\");\r\n n_program.setParent(null);\r\n System.out.println(\"read node from app: \"+n_program.getData());\r\n System.out.println(\" :parent: \"+n_program.getParent());\r\n\r\n Node n_declarations = n_program.setChildren(\"decl list\");\r\n System.out.println(\"read node from app :data: \"+n_declarations.getData());\r\n System.out.println(\" :parent: \"+n_declarations.getParent().getData());\r\n\r\n this.declaration(n_declarations);\r\n\r\n this.CheckError(\"BEGIN\");\r\n\r\n Node n_statementSequence = n_program.setChildren(\"stmt list\");\r\n this.statementSequence(n_statementSequence);\r\n\r\n this.CheckError(\"END\");\r\n\r\n System.out.println(\":::: Parsing Successful Hamid ::::\");\r\n\r\n return n_program;\r\n //////////////////////////////////////////// writeout PROGRAM treee -----------------\r\n //////////////////////////////////////////////////////////////////////////////////////\r\n ///////////////////////////////////////////////////////////////////////////////////\r\n ///////////output test generator\r\n /////////////////////////////////////////////////////////////////////////////////\r\n\r\n\r\n /*Node iteration = n_program;\r\n for (int i=0; i<iteration.childrenSize();i++){\r\n System.out.print(\"| \"+iteration.getChildren(i).getData()+\"|\");\r\n System.out.print(\" \");\r\n }\r\n System.out.println();\r\n iteration = n_program.getChildren(0);\r\n for (int i=0; i<iteration.childrenSize();i++){\r\n System.out.print(\"| \"+iteration.getChildren(i).getData()+\" |\");\r\n }\r\n System.out.print(\" \");\r\n iteration = n_program.getChildren(1);\r\n for (int i=0; i<iteration.childrenSize();i++){\r\n System.out.print(\"| \"+iteration.getChildren(i).getData()+\" |\");\r\n }\r\n System.out.println(\"\");\r\n System.out.print(\" \");\r\n Node iteration0= iteration.getChildren(0);\r\n for (int i=0; i<iteration0.childrenSize();i++){\r\n System.out.print(\"| \"+iteration0.getChildren(i).getData()+\" |\");\r\n }\r\n System.out.println();\r\n System.out.print(\" \");\r\n Node iteration1= iteration.getChildren(1);\r\n for (int i=0; i<iteration1.childrenSize();i++){\r\n System.out.print(\"| \"+iteration1.getChildren(i).getData()+\" |\");\r\n }\r\n System.out.println();\r\n System.out.print(\" \");\r\n Node iteration2= iteration.getChildren(2);\r\n for (int i=0; i<iteration2.childrenSize();i++){\r\n System.out.print(\"| \"+iteration2.getChildren(i).getData()+\" |\");\r\n }\r\n System.out.println();\r\n System.out.print(\" \");\r\n Node iteration3= iteration.getChildren(3);\r\n for (int i=0; i<iteration3.childrenSize();i++){\r\n System.out.print(\"| \"+iteration3.getChildren(i).getData()+\" |\");\r\n }\r\n System.out.println();\r\n System.out.print(\" \");\r\n Node iteration4= iteration.getChildren(4);\r\n for (int i=0; i<iteration4.childrenSize();i++){\r\n System.out.print(\"| \"+iteration4.getChildren(i).getData()+\" |\");\r\n }\r\n System.out.println();\r\n System.out.print(\" w\\n\");\r\n System.out.print(\" \");\r\n Node iteration0w= iteration2.getChildren(0);\r\n for (int i=0; i<iteration0w.childrenSize();i++){\r\n System.out.print(\"| \"+iteration0w.getChildren(i).getData()+\" |\");\r\n }\r\n System.out.print(\"\\n \");\r\n Node iteration1w= iteration2.getChildren(1);\r\n for (int i=0; i<iteration1w.childrenSize();i++){\r\n System.out.print(\"| \"+iteration1w.getChildren(i).getData()+\" |\");\r\n }\r\n System.out.print(\"\\n \");\r\n iteration= iteration0w.getChildren(0);\r\n for (int i=0; i<iteration.childrenSize();i++){\r\n System.out.print(\"| \"+iteration.getChildren(i).getData()+\" |\");\r\n }*/\r\n\r\n }", "public Grammar()\n {\n this.rules = new ArrayList<Rule>();\n }", "public String getGrammarText();", "private void print( org.antlr.v4.tool.Grammar grammar, ParseTree tree, String indentStep, String indent )\n {\n if ( tree != null )\n {\n Object payload = tree.getPayload();\n if ( payload instanceof InterpreterRuleContext )\n {\n String ruleName = grammar.getRule( ((InterpreterRuleContext) payload).getRuleIndex() ).name;\n System.out.println( indent + ruleName );\n }\n else\n {\n System.out.println( indent + \"\\\"\" + tree.getText() + \"\\\"\" );\n }\n for ( int i = 0; i <= tree.getChildCount(); i++ )\n {\n print( grammar, tree.getChild( i ), indentStep, indent + indentStep );\n }\n }\n }", "public Grammar() {\n }", "private void outputGrammarStateClass(PrintWriter out) {\n\t\t\n\t\tout.println(\" private class GrammarState {\");\n\t\tout.println(\" public static final int TOKEN = 1, RULE = 2, EPSILON = 3;\");\n\t\tout.println(\" String name;\");\n\t\tout.println(\" int type;\");\n\t\tout.println(\" public GrammarState(String n, int t) { name = n; type = t; }\");\n\t\tout.println(\" } // end GrammarState\");\n\t\t\n\t}", "public interface Expression {\n \n enum ExpressivoGrammar {ROOT, SUM, PRODUCT, TOKEN, PRIMITIVE_1, PRIMITIVE_2, \n NUMBER, INT, DECIMAL, WHITESPACE, VARIABLE};\n \n public static Expression buildAST(ParseTree<ExpressivoGrammar> concreteSymbolTree) {\n \n if (concreteSymbolTree.getName() == ExpressivoGrammar.DECIMAL) {\n /* reached a double terminal */\n return new Num(Double.parseDouble(concreteSymbolTree.getContents())); \n }\n\n else if (concreteSymbolTree.getName() == ExpressivoGrammar.INT) {\n /* reached an int terminal */\n return new Num(Integer.parseInt(concreteSymbolTree.getContents()));\n }\n \n else if (concreteSymbolTree.getName() == ExpressivoGrammar.VARIABLE) {\n /* reached a terminal */\n return new Var(concreteSymbolTree.getContents());\n }\n \n else if (concreteSymbolTree.getName() == ExpressivoGrammar.ROOT || \n concreteSymbolTree.getName() == ExpressivoGrammar.TOKEN || \n concreteSymbolTree.getName() == ExpressivoGrammar.PRIMITIVE_1 || \n concreteSymbolTree.getName() == ExpressivoGrammar.PRIMITIVE_2 || \n concreteSymbolTree.getName() == ExpressivoGrammar.NUMBER) {\n \n /* non-terminals with only one child */\n for (ParseTree<ExpressivoGrammar> child: concreteSymbolTree.children()) {\n if (child.getName() != ExpressivoGrammar.WHITESPACE) \n return buildAST(child);\n }\n \n // should never reach here\n throw new IllegalArgumentException(\"error in parsing\");\n }\n \n else if (concreteSymbolTree.getName() == ExpressivoGrammar.SUM || concreteSymbolTree.getName() == ExpressivoGrammar.PRODUCT) {\n /* a sum or product node can have one or more children that need to be accumulated together */\n return accumulator(concreteSymbolTree, concreteSymbolTree.getName()); \n }\n \n else {\n throw new IllegalArgumentException(\"error in input: should never reach here\");\n }\n \n }\n \n /**\n * (1) Create parser using lib6005.parser from grammar file\n * (2) Parse string input into CST\n * (3) Build AST from this CST using buildAST()\n * @param input\n * @return Expression (AST)\n */\n public static Expression parse(String input) {\n \n try {\n Parser<ExpressivoGrammar> parser = GrammarCompiler.compile(\n new File(\"src/expressivo/Expression.g\"), ExpressivoGrammar.ROOT);\n ParseTree<ExpressivoGrammar> concreteSymbolTree = parser.parse(input);\n \n// tree.display();\n \n return buildAST(concreteSymbolTree);\n \n }\n \n catch (UnableToParseException e) {\n throw new IllegalArgumentException(\"Can't parse the expression...\");\n }\n catch (IOException e) {\n System.out.println(\"Cannot open file Expression.g\");\n throw new RuntimeException(\"Can't open the file with grammar...\");\n }\n }\n \n // helper methods\n public static Expression accumulator(ParseTree<ExpressivoGrammar> tree, ExpressivoGrammar grammarObj) {\n Expression expr = null;\n boolean first = true;\n List<ParseTree<ExpressivoGrammar>> children = tree.children();\n int len = children.size();\n for (int i = len-1; i >= 0; i--) {\n /* the first child */\n ParseTree<ExpressivoGrammar> child = children.get(i);\n if (first) {\n expr = buildAST(child);\n first = false;\n }\n \n /* accumulate this by creating a new binaryOp object with\n * expr as the leftOp and the result as rightOp\n **/\n \n else if (child.getName() == ExpressivoGrammar.WHITESPACE) continue;\n else {\n if (grammarObj == ExpressivoGrammar.SUM)\n expr = new Sum(buildAST(child), expr);\n else\n expr = new Product(buildAST(child), expr);\n }\n }\n \n return expr;\n \n }\n \n // ----------------- problems 3-4 -----------------\n \n public static Expression create(Expression leftExpr, Expression rightExpr, char op) {\n if (op == '+')\n return Sum.createSum(leftExpr, rightExpr);\n else\n return Product.createProduct(leftExpr, rightExpr);\n }\n\n public Expression differentiate(Var x);\n \n public Expression simplify(Map<String, Double> env);\n\n}", "public Grammar(){\n this.builder = Cli.<VesperCommand>builder(\"vesper\")\n .withDescription(\"the nice CLI for Vesper\")\n .withDefaultCommand(HelpCommand.class)\n .withCommand(HelpCommand.class)\n .withCommand(LogCommand.class)\n .withCommand(ResetCommand.class)\n .withCommand(InspectCommand.class)\n .withCommand(ReplCommand.class)\n .withCommand(ConfigCommand.class)\n .withCommand(AddCommand.class)\n .withCommand(OriginShow.class)\n .withCommand(PublishCommand.class)\n .withCommand(FormatCommand.class)\n .withCommand(DeduplicateCommand.class)\n .withCommand(OptimizeImportsCommand.class);\n\n builder.withGroup(\"whereis\")\n .withDescription(\"Locates a program unit found in the tracked source\")\n .withDefaultCommand(LocateClassCommand.class)\n .withCommand(LocateClassCommand.class)\n .withCommand(LocateMethodCommand.class)\n .withCommand(LocateParamCommand.class)\n .withCommand(LocateVarCommand.class)\n .withCommand(LocateFieldCommand.class);\n\n builder.withGroup(\"notes\")\n .withDescription(\"Manage set of notes describing the tracked source\")\n .withDefaultCommand(NotesShow.class)\n .withCommand(NotesShow.class)\n .withCommand(NoteAdd.class);\n\n builder.withGroup(\"rename\")\n .withDescription(\"Manage set of renaming commands\")\n .withDefaultCommand(RenameClassCommand.class)\n .withCommand(RenameClassCommand.class)\n .withCommand(RenameMethodCommand.class)\n .withCommand(RenameParameterCommand.class)\n .withCommand(RenameFieldCommand.class)\n .withCommand(RenameLocalVariableCommand.class);\n\n builder.withGroup(\"rm\")\n .withDescription(\"Remove file contents from the tracked source\")\n .withDefaultCommand(RemoveSourceCommand.class)\n .withCommand(RemoveSourceCommand.class)\n .withCommand(RemoveClassCommand.class)\n .withCommand(RemoveMethodCommand.class)\n .withCommand(RemoveParameterCommand.class)\n .withCommand(RemoveFieldCommand.class)\n .withCommand(RemoveLocalVariableCommand.class)\n .withCommand(RemoveRegionCommand.class);\n\n builder.withGroup(\"clip\")\n .withDescription(\"Clip a code section from the tracked source\")\n .withDefaultCommand(ClipRangeCommand.class)\n .withCommand(ClipRangeCommand.class);\n\n }", "protected LR1_Grammar(Grammar grammar) {\n\t\tsuper(grammar);\n\t\tSet follow = new Set(1);\n\t\tfollow.append(END_OF_SOURCE);\n\t\tthis.start.follow = follow;\n\t}", "public static void main(String[] args) {\n\t\ttry {\r\n\t\t\t//Scanner scanner = new Scanner(System.in);\r\n\t\t\tSyntax syntax = new Syntax();\r\n\t\t\tsyntax.addTerminal(\"PLUS\", TokenType.OPERATOR, OperatorType.PLUS);\r\n\t\t\tsyntax.addTerminal(\"MINUS\", TokenType.OPERATOR, OperatorType.MINUS);\r\n\t\t\tsyntax.addTerminal(\"TIMES\", TokenType.OPERATOR, OperatorType.TIMES);\r\n\t\t\tsyntax.addTerminal(\"DIVIDE\", TokenType.OPERATOR, OperatorType.DIVIDE);\r\n\t\t\tsyntax.addTerminal(\"LPA\", TokenType.OPERATOR, OperatorType.LPARAN);\r\n\t\t\tsyntax.addTerminal(\"RPA\", TokenType.OPERATOR, OperatorType.RPARAN);\r\n\t\t\tsyntax.addTerminal(\"SYMBOL\", TokenType.ID, \"i\");\r\n\t\t\tsyntax.addNonTerminal(\"E\");\r\n\t\t\tsyntax.addNonTerminal(\"T\");\r\n\t\t\tsyntax.addNonTerminal(\"F\");\r\n\t\t\tsyntax.addErrorHandler(\"sample\", null);\r\n\t\t\t//syntax.infer(\"E -> T `PLUS`<+> E | T `MINUS`<-> E | T\");\r\n\t\t\t//syntax.infer(\"T -> F `TIMES`<*> T | F `DIVIDE`</> T | F\");\r\n\t\t\t//syntax.infer(\"F -> `LPA`<(> E `RPA`<)> | `SYMBOL`<i>\");\r\n\t\t\tsyntax.infer(\"E -> E @PLUS<+> T\");\r\n\t\t\tsyntax.infer(\"E -> E @MINUS<-> T\");\r\n\t\t\tsyntax.infer(\"E -> T\");\r\n\t\t\tsyntax.infer(\"T -> T @TIMES<*> F\");\r\n\t\t\tsyntax.infer(\"T -> T @DIVIDE</> F\");\r\n\t\t\tsyntax.infer(\"T -> F\");\r\n\t\t\tsyntax.infer(\"F -> @LPA<(> E @RPA<)>\");\r\n\t\t\tsyntax.infer(\"F -> @SYMBOL<i>\");\r\n\t\t\tsyntax.initialize(\"E\");\r\n\t\t\tSystem.out.println(syntax.toString());\r\n\t\t\tSystem.out.println(syntax.getNGAString());\r\n\t\t\tSystem.out.println(syntax.getNPAString());\r\n\t\t\t//scanner.close();\r\n\t\t} catch (RegexException e) {\r\n\t\t\tSystem.err.println(e.getPosition() + \",\" + e.getMessage());\r\n\t\t\te.printStackTrace();\r\n\t\t} catch (SyntaxException e) {\r\n\t\t\tSystem.err.println(e.getPosition() + \",\" + e.getMessage() + \" \" + e.getInfo());\r\n\t\t\te.printStackTrace();\r\n\t\t}\r\n\t}", "public Grammar(CFSG<? extends Number> grammar) {\n\t\tthis(grammar.lexRules, grammar.internalRules);\n\t\tlogFile = Parameters.logFile;\n\t}", "@Override\n\tprotected String toMips(Scope symbolTable, String indent) {\n\t\tStringBuilder build = new StringBuilder(indent).append(\"#SubProgramHeadNode\\n\");\n\n\t\t//load ptr to previous stack's head to pick up values\n\t\tbuild.append(indent).append(\"lw $t0, 8($sp)\\n\");\n\t\tbuild.append(indent).append(\"lw $t0, ($t0)\\n\");\n\n\t\t//iterate across arguments\n\t\tfor (int i = 0; i < arguments.length; i++) {\n\t\t\tbuild.append(indent).append(\"lw $t1, \").append((i + 1) * 4).append(\"($t0)\\t#get loaded value from stack\\n\");\n\t\t\tbuild.append(indent).append(\"sw $t1, \").append(symbolTable.getMemoryOffset(arguments[i])).append(\"($sp)\\t#save word in correct spot (hopefully?)\\n\");\t//This is done in SubProgramNode constructor\n\t\t}\n\n\t\treturn build.toString();\n\t}", "public void setGrammar(String grammar){\r\n this.grammar = grammar;\r\n }", "Butternut(String grammar)\n\t{\n\t\tmain = selectGrammar(grammar);\n\t\ttext = \"123CAN Weldoer\".toCharArray();//new char[0];\n\t\ttree = main.parse(0);\n\t\t//experimentalParser(\"123CAN Weldoer\".toCharArray());\n\t}", "private Grammar createCombinedGrammar(List<ClassDSLInformation> classesInfos) {\n\n\tLinkedList<GrammarCollectionBox> collectionCollector = new LinkedList<GrammarCollectionBox>();\n\n\tfor (ClassDSLInformation classInfo : classesInfos) {\n\n\t List<MethodDSLInformation> validMinfs = filterOnlyValidMethodInformations(classInfo);\n\n\t for (MethodDSLInformation methodInfo : validMinfs) {\n\n\t\tGrammarCollectionBox box = new GrammarCollectionBox(methodInfo);\n\n\t\tDslMethodType dslType = methodInfo.getDSLType();\n\t\tswitch (dslType) {\n\n\t\tcase Literal:\n\t\t // this.handleLiteral(methodInfo, box,\n\t\t // getTypeHandlerConfigurationOnGrammar(classesInfos, box));\n\t\t // this.handleNonLiteral(methodInfo, box,\n\t\t // getTypeHandlerConfigurationOnGrammar(classesInfos, box));\n\t\t // break;\n\t\t //$FALL-THROUGH$\n\t\tcase Operation:\n\t\t this.handleNonLiteral(methodInfo, box, getTypeHandlerConfigurationOnGrammar(classesInfos, box));\n\t\t break;\n\n\t\tcase AbstractionOperator:\n\t\t throw new UnsupportedOperationException(\"Functionality not yet implemented for \" + dslType);\n\t\tdefault:\n\t\t throw illegalForArg(dslType);\n\t\t}\n\t\tcollectionCollector.add(box);\n\t }\n\t}\n\n\t/* Add rule annotations where necessary */\n\n\t// build lookup list for relative priorization lookup\n\tMap<String, GrammarCollectionBox> uidLookupList = new HashMap<String, GrammarCollectionBox>();\n\tfor (GrammarCollectionBox box : collectionCollector) {\n\t uidLookupList.put(box.methodInfo.getUniqueIdentifier(), box);\n\t}\n\tuidLookupList = Collections.unmodifiableMap(uidLookupList);\n\tfor (GrammarCollectionBox grammarCollectionBox : collectionCollector) {\n\t addRuleAnnotations(grammarCollectionBox, uidLookupList);\n\t}\n\n\t/*\n\t * Assemble actual grammar from collected and configured rules and\n\t * categories\n\t */\n\tGrammar grammar = new Grammar();\n\tthis.setupGeneralGrammar(grammar);\n\n\tboolean waterSupported = isWaterSupported(classesInfos);\n\tif (waterSupported) {\n\t this.setWaterEnabled(waterSupported, grammar);\n\t}\n\n\tfor (ClassDSLInformation classInfo : classesInfos) {\n\t this.setupHostLanguageRules(classInfo.getHostLanguageRules(), grammar);\n\t}\n\n\tfor (GrammarCollectionBox box : collectionCollector) {\n\t addBoxContentToGrammar(box, grammar);\n\t}\n\n\treturn grammar;\n }", "private void make_extended() {\n Iterator it = this.getIncreased_grammar().getGrammar().iterator();\n C_Production tmp_pr;\n C_Symbol searcher_symbol; \n \n while(it.hasNext()) {\n tmp_pr = (C_Production)it.next();\n searcher_symbol = new C_Symbol(String.valueOf((char)176));\n tmp_pr.getRight().add(0, searcher_symbol);\n }\n }", "void setGrammar(IGrammarComp aGrammar);", "public void PrintMe()\n {\n /************************************/\n /* AST NODE TYPE = DEC CLASSDEC AST NODE */\n /************************************/\n System.out.print(\"AST NODE DEC CLASSDEC\\n\");\n\n /*****************************/\n /* RECURSIVELY PRINT classDec ... */\n /*****************************/\n if (dataMembers != null) dataMembers.PrintMe();\n if (methods != null) methods.PrintMe();\n\n /*********************************/\n /* Print to AST GRAPHIZ DOT file */\n /*********************************/\n if (parentName!=null)\n {\n AST_GRAPHVIZ.getInstance().logNode(SerialNumber, String.format(\"CLASS %s EXTENDS %s\",idName,parentName));\n }\n else{\n AST_GRAPHVIZ.getInstance().logNode(SerialNumber, String.format(\"CLASS %s\",idName));\n }\n /****************************************/\n /* PRINT Edges to AST GRAPHVIZ DOT file */\n /****************************************/\n\n if (dataMembers != null) AST_GRAPHVIZ.getInstance().logEdge(SerialNumber, dataMembers.SerialNumber);\n if (methods != null) AST_GRAPHVIZ.getInstance().logEdge(SerialNumber, methods.SerialNumber);\n }", "public final void grammar_() throws RecognitionException {\n\t\ttry {\n\t\t\t// org/antlr/grammar/v3/TreeToNFAConverter.g:190:2: ( ( ^( LEXER_GRAMMAR grammarSpec ) | ^( PARSER_GRAMMAR grammarSpec ) | ^( TREE_GRAMMAR grammarSpec ) | ^( COMBINED_GRAMMAR grammarSpec ) ) )\n\t\t\t// org/antlr/grammar/v3/TreeToNFAConverter.g:190:4: ( ^( LEXER_GRAMMAR grammarSpec ) | ^( PARSER_GRAMMAR grammarSpec ) | ^( TREE_GRAMMAR grammarSpec ) | ^( COMBINED_GRAMMAR grammarSpec ) )\n\t\t\t{\n\t\t\t// org/antlr/grammar/v3/TreeToNFAConverter.g:190:4: ( ^( LEXER_GRAMMAR grammarSpec ) | ^( PARSER_GRAMMAR grammarSpec ) | ^( TREE_GRAMMAR grammarSpec ) | ^( COMBINED_GRAMMAR grammarSpec ) )\n\t\t\tint alt1=4;\n\t\t\tswitch ( input.LA(1) ) {\n\t\t\tcase LEXER_GRAMMAR:\n\t\t\t\t{\n\t\t\t\talt1=1;\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase PARSER_GRAMMAR:\n\t\t\t\t{\n\t\t\t\talt1=2;\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase TREE_GRAMMAR:\n\t\t\t\t{\n\t\t\t\talt1=3;\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase COMBINED_GRAMMAR:\n\t\t\t\t{\n\t\t\t\talt1=4;\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\tif (state.backtracking>0) {state.failed=true; return;}\n\t\t\t\tNoViableAltException nvae =\n\t\t\t\t\tnew NoViableAltException(\"\", 1, 0, input);\n\t\t\t\tthrow nvae;\n\t\t\t}\n\t\t\tswitch (alt1) {\n\t\t\t\tcase 1 :\n\t\t\t\t\t// org/antlr/grammar/v3/TreeToNFAConverter.g:190:6: ^( LEXER_GRAMMAR grammarSpec )\n\t\t\t\t\t{\n\t\t\t\t\tmatch(input,LEXER_GRAMMAR,FOLLOW_LEXER_GRAMMAR_in_grammar_68); if (state.failed) return;\n\t\t\t\t\tmatch(input, Token.DOWN, null); if (state.failed) return;\n\t\t\t\t\tpushFollow(FOLLOW_grammarSpec_in_grammar_70);\n\t\t\t\t\tgrammarSpec();\n\t\t\t\t\tstate._fsp--;\n\t\t\t\t\tif (state.failed) return;\n\t\t\t\t\tmatch(input, Token.UP, null); if (state.failed) return;\n\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\tcase 2 :\n\t\t\t\t\t// org/antlr/grammar/v3/TreeToNFAConverter.g:191:5: ^( PARSER_GRAMMAR grammarSpec )\n\t\t\t\t\t{\n\t\t\t\t\tmatch(input,PARSER_GRAMMAR,FOLLOW_PARSER_GRAMMAR_in_grammar_80); if (state.failed) return;\n\t\t\t\t\tmatch(input, Token.DOWN, null); if (state.failed) return;\n\t\t\t\t\tpushFollow(FOLLOW_grammarSpec_in_grammar_82);\n\t\t\t\t\tgrammarSpec();\n\t\t\t\t\tstate._fsp--;\n\t\t\t\t\tif (state.failed) return;\n\t\t\t\t\tmatch(input, Token.UP, null); if (state.failed) return;\n\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\tcase 3 :\n\t\t\t\t\t// org/antlr/grammar/v3/TreeToNFAConverter.g:192:5: ^( TREE_GRAMMAR grammarSpec )\n\t\t\t\t\t{\n\t\t\t\t\tmatch(input,TREE_GRAMMAR,FOLLOW_TREE_GRAMMAR_in_grammar_92); if (state.failed) return;\n\t\t\t\t\tmatch(input, Token.DOWN, null); if (state.failed) return;\n\t\t\t\t\tpushFollow(FOLLOW_grammarSpec_in_grammar_94);\n\t\t\t\t\tgrammarSpec();\n\t\t\t\t\tstate._fsp--;\n\t\t\t\t\tif (state.failed) return;\n\t\t\t\t\tmatch(input, Token.UP, null); if (state.failed) return;\n\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\tcase 4 :\n\t\t\t\t\t// org/antlr/grammar/v3/TreeToNFAConverter.g:193:5: ^( COMBINED_GRAMMAR grammarSpec )\n\t\t\t\t\t{\n\t\t\t\t\tmatch(input,COMBINED_GRAMMAR,FOLLOW_COMBINED_GRAMMAR_in_grammar_104); if (state.failed) return;\n\t\t\t\t\tmatch(input, Token.DOWN, null); if (state.failed) return;\n\t\t\t\t\tpushFollow(FOLLOW_grammarSpec_in_grammar_106);\n\t\t\t\t\tgrammarSpec();\n\t\t\t\t\tstate._fsp--;\n\t\t\t\t\tif (state.failed) return;\n\t\t\t\t\tmatch(input, Token.UP, null); if (state.failed) return;\n\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\n\t\t\t}\n\n\t\t\t}\n\n\t\t\tif ( state.backtracking==0 ) {\n\t\t\t\tfinish();\n\t\t\t}\n\t\t}\n\t\tcatch (RecognitionException re) {\n\t\t\treportError(re);\n\t\t\trecover(input,re);\n\t\t}\n\t\tfinally {\n\t\t\t// do for sure before leaving\n\t\t}\n\t}", "public void setGrammarStructure(CGrammar aGrammarStructure);", "private Grammar createGrammarFromXML( String resource, org.opencypher.grammar.Grammar.ParserOption... options )\n {\n String grammarString = null;\n try\n {\n ByteArrayOutputStream out = new ByteArrayOutputStream();\n org.opencypher.grammar.Grammar oCGrammar = org.opencypher.grammar.Grammar.parseXML( Paths.get( resourceURL( resource ) ), options );\n Antlr4.write( oCGrammar, out );\n grammarString = out.toString( UTF_8.name() );\n }\n catch ( Throwable t )\n {\n fail( \"Unexpected error while writing antlr grammar: \" + t.getMessage() );\n }\n return parseGrammarFromString( grammarString );\n }", "public BNFrule()\n {\n lhs = \"\";\n rhsSymbols = new ArrayList<String>();\n }", "@Override\n public String toString() {\n String str = \"graph [\\n\";\n\n Iterator<Node<E>> it = iterator();\n\n //Node display\n while(it.hasNext()){\n Node n = it.next();\n\n str += \"\\n\\tnode [\";\n str += \"\\n\\t\\tid \" + n;\n str += \"\\n\\t]\";\n }\n\n //Edge display\n it = iterator();\n\n while(it.hasNext()){\n Node n = it.next();\n\n Iterator<Node<E>> succsIt = n.succsOf();\n while(succsIt.hasNext()){\n Node succN = succsIt.next();\n\n str += \"\\n\\tedge [\";\n str += \"\\n\\t\\tsource \" + n;\n str += \"\\n\\t\\ttarget \" + succN;\n str += \"\\n\\t\\tlabel \\\"Edge from node \" + n + \" to node \" + succN + \" \\\"\";\n str += \"\\n\\t]\";\n }\n }\n\n str += \"\\n]\";\n\n return str;\n }", "public String grammar(Source source) {\r\n Stacker stacker = new Stacker();\r\n grammar = stacker.run(source);\r\n charInput = ! grammar.has(TI);\r\n if (grammar.op() == Error) return grammar.note();\r\n else return null;\r\n }", "public String toString() {\n\t\treturn \"[\" + _name + \"] \" + _lexeme;\n\t}", "@Override\n public SemanticCFGrammar<NT, T, P, L, D, R> withProduction(P p) {\n\n Objects.requireNonNull(p);\n\n // Create new Production map.\n Map<NT, Set<P>> newProdMap = newProductionMap(p);\n\n Seq<T> rightSymbols = p.getRule().filter(Either::isRight).map(Either::get);\n\n // All terminals in P must be keys of the generator map.\n Seq<T> notMapped = rightSymbols.filter(t -> !terminalResGenerators.containsKey(t));\n\n if (!notMapped.isEmpty()) {\n throw new IllegalArgumentException(\"Given rule has terminals without result generators.\");\n }\n\n return new SemanticCFGrammar<>(getStartSymbol(), newProdMap,\n getTerminalsUsed().addAll(rightSymbols), terminalResGenerators);\n }", "void genAst();", "private SignatureWriter(AnnotatedGrammar grammar, Writer out) {\n/* 50 */ this.classSet = new Hashtable();\n/* */ \n/* */ \n/* 53 */ this.indent = 0; this.out = out; this.classes = grammar.getClasses();\n/* */ for (int i = 0; i < this.classes.length; i++)\n/* 55 */ this.classSet.put(this.classes[i].getTypeAsDefined(), this.classes[i]); }", "public static void main(String[] args) throws Exception {\n if (args.length==0) {\n emit(new PrintWriter(System.out));\n } else {\n StringWriter sw = new StringWriter();\n emit(new PrintWriter(sw));\n BuildGrammars.writeFile(args[0], sw.toString());\n }\n }", "public String toString()\n {\n \tint tempIndex;\n \tStringBuilder statesStr = new StringBuilder(\"States: { \");\n \tfor(ComplexState state: states)\n \t\tstatesStr.append(state.getName() + \", \");\n\t\ttempIndex = statesStr.lastIndexOf(\",\");\n \tif(tempIndex != -1)\n \t\tstatesStr.deleteCharAt(statesStr.lastIndexOf(\",\"));\n \tstatesStr.append(\"}\\n\");\n \tStringBuilder initStatesStr = new StringBuilder(\"Initial states: { \");\n \tfor(ComplexState state: initialStates)\n \t\tinitStatesStr.append(state.getName() + \", \");\n \ttempIndex = initStatesStr.lastIndexOf(\",\");\n \tif(tempIndex != -1)\n \t\tinitStatesStr.deleteCharAt(initStatesStr.lastIndexOf(\",\"));\n \tinitStatesStr.append(\"}\\n\");\n \tStringBuilder transitionFuncStr = new StringBuilder(\"Transition relation: { \");\n \tArrayList<ComplexState> destStates = new ArrayList<ComplexState>();\n \tfor(ComplexState srcState: states) \n \t{\n \t\tdestStates = transitionRelation.get(srcState);\n \t\tif(destStates != null)\n\t \t\tfor(ComplexState destState: destStates)\n\t \t\t\ttransitionFuncStr.append(\"( \" + srcState.getName() + \", \" + destState.getName() + \" ), \" );\t\n \t}\n \ttempIndex = transitionFuncStr.lastIndexOf(\",\");\n \tif(tempIndex != -1)\n \t\ttransitionFuncStr.deleteCharAt(transitionFuncStr.lastIndexOf(\",\"));\n \ttransitionFuncStr.append(\"}\\n\");\n \tStringBuilder labelingFuncStr = new StringBuilder(\"Labeling function: { \");\n \tArrayList<AtomicProp> atomicProps = new ArrayList<AtomicProp>();\n \tfor(ComplexState state: states) \n \t{\n \t\tlabelingFuncStr.append(\"( \" + state.getName() + \", { \");\n \t\tatomicProps = state.getLabels();\n \t\tif(atomicProps != null)\n \t\t\tfor(AtomicProp ap: state.getLabels())\n \t\t\t\tlabelingFuncStr.append(ap.getName() + \", \");\n \t\ttempIndex = labelingFuncStr.lastIndexOf(\",\");\n \tif(tempIndex != -1)\n \t\tlabelingFuncStr.deleteCharAt(labelingFuncStr.lastIndexOf(\",\"));\n \t\tlabelingFuncStr.append(\"} ), \");\n \t}\n \ttempIndex = labelingFuncStr.lastIndexOf(\",\");\n \tif(tempIndex != -1)\n \t\tlabelingFuncStr.deleteCharAt(labelingFuncStr.lastIndexOf(\",\"));\n \tlabelingFuncStr.append(\"}\\n\"); \t\n \tString result = statesStr.toString() + initStatesStr.toString() + transitionFuncStr.toString() + labelingFuncStr.toString() + \"Type: \" + type.toString();\n \treturn result;\n }", "public String toString() {\n\t\t//|| (this.equals(new StatementParse(\"sequence\", 0)))\n\t\tif (this.equals(Parser.FAIL)) {\n\t\t\treturn \"\";\n\t\t}\n String result = \"\";\n result += \"(\";\n result += this.name;\n for (Parse child: this.children) {\n \tresult += \" \" + child.toString();\n }\n result += \")\";\n return result;\t\n }", "public String toString() {\n\n StringBuilder sb = new StringBuilder();\n sb.append(\"\\nApplication Graph for \" + this.getClass().getCanonicalName() + \"\\n\");\n Map<PEMaker, Collection<StreamMaker>> pe2streamMap = pe2stream.asMap();\n for (Map.Entry<PEMaker, Collection<StreamMaker>> entry : pe2streamMap.entrySet()) {\n sb.append(toString(entry.getKey()) + \"=> \");\n for (StreamMaker sm : entry.getValue()) {\n sb.append(toString(sm));\n }\n sb.append(\"\\n\");\n }\n\n Map<StreamMaker, Collection<PEMaker>> stream2peMap = stream2pe.asMap();\n for (Map.Entry<StreamMaker, Collection<PEMaker>> entry : stream2peMap.entrySet()) {\n sb.append(toString(entry.getKey()) + \"=> \");\n for (PEMaker pm : entry.getValue()) {\n sb.append(toString(pm));\n }\n sb.append(\"\\n\");\n }\n\n return sb.toString();\n\n }", "public Parser compile( Grammar grammar)\n {\n grammar.augment();\n \n conflicts = 0;\n \n itemSets = createItemSets( grammar);\n State start = createStates( grammar, itemSets);\n grammar.freeGraph();\n\n log.infof( \"\\nFound %d conflicts in %d states.\", conflicts, itemSets.size());\n \n return new Parser( this, start);\n }", "public C_LR_1(C_Grammar gram) {\n this.increased_grammar = new C_Grammar(gram);\n this.make_extended();\n }", "public DTDGrammar getActiveGrammar() {\r\n return this.fActiveGrammar;\r\n }", "private void outputBuildTableFunction(PrintWriter out) {\n\t\t\n\t\tout.println(\" private void buildTable() {\");\n\t\t\n\t\tout.println(\" GrammarState[] graph;\");\n\t\t\n\t\tfor (String rulename : grammardef.getTable().keySet()) {\n\t\t\t\n\t\t\tout.println(\" table.put(\\\"\" + rulename + \"\\\", new HashMap<String, GrammarRule>());\");\n\t\t\t\n\t\t\tfor (String tokname : grammardef.getTable().get(rulename).keySet()) {\n\t\t\t\t\n\t\t\t\tGrammarRule rule = grammardef.getTable().get(rulename).get(tokname);\n\t\t\t\t\n\t\t\t\tString multi = rule.isMultiChild() ? \"true\" : \"false\";\n\t\t\t\tString sub = rule.isSubrule() ? \"true\" : \"false\";\n\t\t\t\t\n\t\t\t\tint i = 0;\n\t\t\t\tout.println(\" graph = new GrammarState[\" + rule.getGraph().size() + \"];\");\n\t\t\t\tfor (GrammarState state : rule.getGraph()) {\n\t\t\t\t\tout.println(\" graph[\" + (i++) + \"] = new GrammarState(\\\"\" + state.name + \"\\\", \" + state.type + \");\");\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tout.println(\" table.get(\\\"\" + rulename + \"\\\").put(\\\"\" + tokname + \"\\\", new GrammarRule(\\\"\" + rule.getName() + \"\\\", \" + multi + \", \" + sub + \", graph));\");\n\t\t\t\tout.println();\n\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t}\n\t\t\n\t\tout.println(\" }\");\n\t\t\n\t}", "@Test\n void testGrammarBasics() {\n Production<NT, T> prod1 = new Production<>(NT.A, List.of(\n left(NT.B), right(T.E)\n ));\n\n Production<NT, T> prod2 = new Production<>(NT.B, List.of(\n right(T.F)\n ));\n\n Production<NT, T> prod3 = prod1.withSource(NT.C).withRule(List.of(\n left(NT.B), right(T.F), left(NT.C), left(NT.A)\n ));\n\n assertThrows(IllegalArgumentException.class, () -> new CFGrammar<>(NT.C, List.of(prod1, prod2)));\n assertThrows(IllegalArgumentException.class, () -> new CFGrammar<>(NT.C, List.of(prod3, prod2)));\n\n Production<NT, T> prod4 = new Production<>(NT.A, List.of(\n left(NT.B), right(T.E)\n ));\n\n Production<NT, T> prod5 = new Production<>(NT.B, List.of(\n left(NT.A), right(T.E)\n ));\n\n assertThrows(IllegalArgumentException.class, () -> new CFGrammar<>(NT.A, List.of(prod4)));\n\n CFGrammar<NT, T, Production<NT, T>> g = new CFGrammar<>(NT.A, List.of(prod4, prod5));\n assertEquals(HashSet.of(NT.B, NT.A), g.getNonTerminalsUsed());\n assertEquals(HashSet.of(T.E), g.getTerminalsUsed());\n }", "private static List<GrammarRule> parseGrammar(Grammar grammar, String grammarRules)\n\t{\n\t\treturn AntlrHelpers.parseGrammar(grammar, grammarRules);\n\t}", "public String toString() {\n\n if (m_rules == null) {\n return \"Prism: No model built yet.\";\n }\n return \"Prism rules\\n----------\\n\" + m_rules.toString();\n }", "public String toProgram()\n\t{\n\t\tString prog = \"\";\n\t\tif(this.type == nodetype.root)\n\t\t{\n\t\t\tfor(ParseTreeNode node:this.children)\n\t\t\t{\n\t\t\t\tprog+= node.toProgram()+\"+\";\n\t\t\t}\n\t\t\tif(prog.length() > 0)\n\t\t\t{\n\t\t\t\tprog = prog.substring(0,prog.length()-1);\n\t\t\t}\n\t\t}\n\t\telse if(this.type == nodetype.segment)\n\t\t{\n\t\t\tif(this.children.size()==0)\n\t\t\t{\n\t\t\t\tprog = this.value;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tprog = String.format(\"substr(value,%s,%s)\", this.children.get(0).value,this.children.get(1).value);\n\t\t\t}\n\t\t}\n\t\treturn prog;\n\t}", "public interface IParserComp extends IPAMOJAComponent {\n\n /**\n * Returns a parser object. \n * This an abstract method to be implemented by the descendants.\n * @return the parser object.\n */\n CParser getParser();\n\n /**\n * Sets the specified parser object to this parser component.\n * This an abstract method to be implemented by the descendants.\n * @param parser @author Jackline Ssanyu ([email protected])\n */\n void setParser(CParser parser);\n\n /**\n * Returns a parser-result object containing boolean value (indicating whether a parse was successful or not) and the parse tree constructed. \n * This an abstract method to be implemented by the descendants.\n * \n * @return the value of the parser-result object.\n */\n CParserResult getParserResult(); \n\n /**\n *\n * @return\n */\n ArrayList<CParseLog> getLogs();\n\n /**\n * Links to <code>GrammarComp</code> component via its interface.\n * Sets the value of <code>Grammar</code> and registers for property change events.\n * \n * @param aGrammar new value of Grammar\n */\n void setGrammar(IGrammarComp aGrammar);\n\n /**\n * Get the grammar object.\n * @return the value of the grammar object\n */ \n IGrammarComp getGrammar();\n \n /**\n * Get the symbolstream object.\n * @return the value of the symbolstream object\n */ \n ISymbolStreamComp getSymbolStream();\n\n /**\n * Links to <code>SymbolStreamComp</code> component via its interface.\n * Sets the value of <code>SymbolStream</code> and registers for property change events.\n * \n * @param aSymbolStream\n */\n void setSymbolStream(ISymbolStreamComp aSymbolStream);\n\n /**\n *\n * @return\n */\n CParseStack getStateStack();\n\n /**\n *\n * @param fStateStack\n */\n void setStateStack(CParseStack fStateStack); \n\n /**\n *\n * @return\n */\n public ArrayList<Symbol> getSymbolsUnmatched();\n\n /**\n *\n * @param symbolsUnmatched\n */\n public void setSymbolsUnmatched(ArrayList<Symbol> symbolsUnmatched);\n\n /**\n *\n */\n public void parseText();\n}", "@Override\n\tpublic String toMips(Scope symbolTable, String indent) {\n\t\t//first set up labels\n\t\tmakeLabels(\"\", symbolTable);\n\n\t\t//init builder\n\t\tStringBuilder build = new StringBuilder(indent).append(\"#ProgramNode\\n\");\n\n\t\t//data section, error messages\t//TODO add globals here\n\t\tbuild.append(indent).append(\".data\\n\");\n\t\tbuild.append(indent).append(Constant.ARRAY_OUT_OF_BOUNDS_MSG_LABEL).append(\": .asciiz \\\"You may not access an index in an array out of it's range.\\\\nPrepare to die.\\\"\\n\");\n\n\t\t//text section\n\t\tbuild.append(indent).append(\".text\\n\");\n\n\t\t//main function start\n\t\tbuild.append(indent).append(\"main:\\n\");\n\n\t\t//add in global variables:\n\t\tbuild.append(globalVariables.toMips(symbolTable, indent + '\\t'));\n\n\t\t//add in main function\n\t\tbuild.append(main.toMips(symbolTable, indent + '\\t'));\n\n\t\t//load end of program\n\t\tbuild.append(indent).append(\"li $v0, 10\\n\");\n\t\tbuild.append(indent).append(\"syscall\\n\");\n\n\t\t//put in functions\n\t\tbuild.append(functions.toMips(symbolTable, indent + '\\t'));\n\n\t\t//error messages\n\t\tbuild.append(indent).append(\"#ERRORs\\n\");\n\t\tbuild.append(indent).append(Constant.ARRAY_OUT_OF_BOUNDS_LABEL).append(\":\\n\");\n\t\tbuild.append(indent).append(\"la $a0, \").append(Constant.ARRAY_OUT_OF_BOUNDS_MSG_LABEL).append(\"\\n\");\n\t\tbuild.append(indent).append(\"li $v0, 4\\n\");\n\t\tbuild.append(indent).append(\"syscall\\n\");\n\t\tbuild.append(indent).append(\"li $v0, 17\\n\");\n\t\tbuild.append(indent).append(\"li $a0, \").append(Constant.ARRAY_OUT_OF_BOUNDS_ERROR_CODE).append(\"\\n\");\n\t\tbuild.append(indent).append(\"syscall\\n\");\n\n\t\t//then return\n\t\treturn build.toString();\n\t}", "public String toString ()\n\t{\n\t\tString s = \"\";\n for (Production production : productions.values()) s += production + \"\\n\";\n\t\treturn s;\n\t}", "public String toString() {\n Class<? extends AST> tclass = this.getClass();\n // isolate relative name (starting after the rightmost '.')\n String absoluteClassName = tclass.toString();\n int dotIndex = absoluteClassName.lastIndexOf(\".\", absoluteClassName.length());\n String relativeClassName = absoluteClassName.substring(dotIndex+1);\n // retrieving fields (note that, unfortunately, they are not ordered)\n // TO DO : get rid of static fields (pb in case of singletons)\n Field[] fields = tclass.getDeclaredFields();\n // building string representation of the arguments of the nodes\n int arity = fields.length;\n String args = \"\";\n for(int index = 0; index < arity; index++) {\n String arg;\n try {\n arg = fields[index].get(this).toString(); // retrieve string representation of all arguments\n } catch (Exception e) {\n arg = \"?\"; // IllegalArgument or IllegalAccess Exception (this shouldn't happen)\n }\n if (index != 0) // a separator is required before each argument except the first\n args = args + \", \" + arg;\n//\t\t\t\targs = args + \" \" + arg;\n else\n args = args + arg;\n }\n return relativeClassName + \"(\" + args + \")\";\n//\t\treturn \"<\" + relativeClassName + \">\" + args + \"</\" + relativeClassName + \">\";\n }", "public void dumpIR () {\n\n Chain<SootClass> classes = Scene.v().getApplicationClasses();\n for (SootClass sclass : classes) {\n File jFile = new File(\"tmp/\" + sclass.getName() + \".J\");\n File bFile = new File(\"tmp/\" + sclass.getName() + \".B\");\n try {\n FileWriter jfw = new FileWriter(jFile);\n FileWriter bfw = new FileWriter(bFile);\n BufferedWriter jbw = new BufferedWriter(jfw);\n BufferedWriter bbw = new BufferedWriter(bfw);\n for (SootMethod sm : sclass.getMethods()) {\n jbw.write(\"\\n\" + sm.getSubSignature() + \" { \\n\");\n bbw.write(\"\\n\" + sm.getSubSignature() + \" { \\n\");\n JimpleBody jbody = (JimpleBody) sm.retrieveActiveBody();\n PatchingChain<Unit> units = jbody.getUnits();\n for (Unit u : units) {\n jbw.write(\"\\t\" + u + \" || \" + u.getClass().getName() + \"\\n\");\n if ( u instanceof JAssignStmt) {\n JAssignStmt as = (JAssignStmt) u;\n String a = as.getLeftOp().getType().toString();\n }\n }\n PatchingChain<Unit> bunits = (new BafBody(jbody, null)).getUnits();\n for (Unit u : bunits) {\n bbw.write(\"\\t\" + u + \" || \" + u.getClass().getName() + \"\\n\");\n }\n }\n jbw.close();\n bbw.close();\n jfw.close();\n bfw.close();\n } catch (IOException e) {\n e.printStackTrace();\n }\n }\n }", "public void printAst(){\n explore(ctx);\n }", "public void print() {\n\t// Skriv ut en grafisk representation av kösituationen\n\t// med hjälp av klassernas toString-metoder\n System.out.println(\"A -> B\");\n System.out.println(r0);\n System.out.println(\"B -> C\");\n System.out.println(r1);\n System.out.println(\"turn\");\n System.out.println(r2);\n //System.out.println(\"light 1\");\n System.out.println(s1);\n //System.out.println(\"light 2\");\n System.out.println(s2);\n }", "@Override\n\tpublic void printParseTree(String indent) {\n\t\tIO.displayln(indent+indent.length()+\" <fun op> \");\n\t\tif(boro_choto != ' ')\n\t\tIO.displayln(indent+indent.length()+\" \"+boro_choto);\n\t\telse if(soman != \"\")\n\t\tIO.displayln(indent+indent.length()+\" \"+soman);\n\t}", "public String run(String[] args) throws IOException {\r\n\r\n\t\t// Ensure proper input parameters\r\n\t\tinputValidation(args);\r\n\r\n\t\t// The two file paths (grammar and input file respectively)\r\n\t\tpathToGrammar = args[0];\r\n\t\tpathToInput = args[1];\r\n\r\n\t\t// Input and scan the grammar file\r\n\t\tMap<String, String>[] mapList = new Map[2];\r\n\t\t// Parse the classes and then the tokens\r\n\t\tInitParser initParse = new InitParser();\r\n\t\tmapList = initParse.parse(pathToGrammar, pathToInput);\r\n\r\n Map<String, String> characterClasses = mapList[0];\r\n Map<String, String> tokens = mapList[1];\r\n\r\n Grammar regexRules = createRegexRules();\r\n ParseTable parseTable = regexRules.createParseTable();\r\n\r\n for(String key : characterClasses.keySet()) {\r\n ParseTree parseTree = parseTable.parse(characterClasses.get(key), regexRules.getStartRule());\r\n classesParseTrees.put(key, parseTree);\r\n }\r\n\r\n for(String key : tokens.keySet()) {\r\n ParseTree parseTree = parseTable.parse(tokens.get(key), regexRules.getStartRule());\r\n tokensParseTrees.put(key, parseTree);\r\n }\r\n\r\n //Create basic NFAs for each class and token\r\n createNFAs(classesParseTrees);\r\n createNFAs(tokensParseTrees);\r\n \r\n //Combine all NFAs and apply the star function to create \r\n combineNFAs();\r\n \r\n dfa = DFA.createFromNFA(bigNFA);\r\n\r\n Map<NFA, String> tokenNFAs = new HashMap<NFA, String>();\r\n for (String token : tokensParseTrees.keySet()) {\r\n tokenNFAs.put(nfas.get(token), token.substring(1));\r\n }\r\n LabelledDFA ldfa = LabelledDFA.createFromNFAs(tokenNFAs);\r\n ldfa.createCSV(\"dfa.csv\");\r\n\r\n File inputFile = new File(pathToInput);\r\n\r\n Reader r = new InputStreamReader(new FileInputStream(inputFile), Charset.defaultCharset());\r\n\r\n return parseInput(ldfa, r);\r\n\r\n\t\t// TODO - Create DFA that recognizes tokens\r\n \r\n // TODO - Split input on spaces (?)\r\n \r\n // TODO - Run DFA on input tokens\r\n \r\n // TODO - Output the token-input string pairs\r\n\t}", "private void outputParseFunction(PrintWriter out, String startRuleName) {\n\t\t\n\t\tString tokenname = prefix + \"Token\";\n\t\t\n\t\tout.println(\" public \" + node(startRuleName) + \" parse() throws \" + prefix + \"ParserException, \" + prefix + \"TokenizerException {\");\n\t\tout.println(\" \" + tokenname + \" curToken;\");\n\t\tout.println();\n\t\tout.println(\" GrammarState curState;\");\n\t\tout.println();\n\t\tout.println(\" Stack<GrammarState> stateStack = new Stack<GrammarState>();\");\n\t\tout.println();\n\t\tout.println(\" \" + node(startRuleName) + \" parseTree = null;\");\n\t\tout.println(\" \" + prefix + \"ASTNode curNode = null;\");\n\t\tout.println();\n\t\tout.println(\" stateStack.push(new GrammarState(startRuleName, GrammarState.RULE));\");\n\t\tout.println();\n\t\tout.println(\" curToken = tokenizer.nextToken();\");\n\t\tout.println();\n\t\tout.println(\" while ( true ) {\");\n\t\tout.println();\n\t\tout.println(\" curState = stateStack.pop();\");\n\t\tout.println();\n\t\tout.println(\" if (curState == null) {\");\n\t\tout.println();\n\t\tout.println(\" \" + prefix + \"ASTNode nextNode = curNode.getParent();\");\n\t\tout.println();\n\t\tout.println(\" if (curNode.isMultiChild() && curNode.numChildren() == 1) {\");\n\t\tout.println(\" \" + prefix + \"ASTNode parentNode = curNode.getParent();\");\n\t\tout.println(\" parentNode.removeChild(curNode);\");\n\t\tout.println();\n\t\tout.println(\" \" + prefix + \"ASTNode childNode = curNode.getChild(0);\");\n\t\tout.println(\" curNode.removeChild(childNode);\");\n\t\tout.println(\" parentNode.addChild(childNode);\");\n\t\tout.println(\" }\");\n\t\tout.println(\" else if (curNode.numChildren() == 0) {\");\n\t\tout.println(\" curNode.getParent().removeChild(curNode);\");\n\t\tout.println(\" }\");\n\t\tout.println();\n\t\tout.println(\" curNode = nextNode;\");\n\t\tout.println();\n\t\tout.println(\" }\"); \n\t\tout.println(\" else if (curState.type == GrammarState.TOKEN) {\");\n\t\tout.println();\n\t\tout.println(\" if (!curState.name.equals(curToken.name)) {\");\n\t\tout.println(\" throw new \" + prefix + \"ParserException(\\\"Invalid token \\\\\\\"\\\" + curToken.value + \\\"\\\\\\\" (\\\" + curToken.name + \\\"), expected token (\\\" + curState.name + \\\")\\\"\t, curToken.line, curToken.column);\");\n\t\tout.println(\" }\");\n\t\tout.println();\n\t\tout.println(\" if (curToken.name.equals(\\\"eof\\\")) break;\");\n\t\tout.println();\n\t\tout.println(\" curNode.addChild(new \" + prefix + \"ASTToken(curToken.name, curToken.value));\");\n\t\tout.println();\t\t\n\t\tout.println(\" curToken = tokenizer.nextToken();\");\n\t\tout.println();\n\t\tout.println(\" }\");\n\t\tout.println(\" else if (curState.type == GrammarState.RULE) {\");\n\t\tout.println();\n\t\tout.println(\" GrammarRule newrule = table.get(curState.name).get(curToken.name);\");\n\t\tout.println();\t\t\t\t\n\t\tout.println(\" if (newrule == null) {\");\n\t\tout.println(\" String expected = \\\"\\\";\");\n\t\tout.println(\" for (String t : table.get(curState.name).keySet()) if (t != null) expected += t + \\\", \\\";\");\n\t\tout.println(\" throw new \" + prefix + \"ParserException(\\\"Invalid token \\\\\\\"\\\" + curToken.value + \\\"\\\\\\\" (\\\" + curToken.name + \\\") for rule \\\\\\\"\\\" + curState.name.replaceAll(\\\"\\\\\\\\{.*\\\", \\\"\\\") + \\\"\\\\\\\", expected one of (\\\" + expected.substring(0, expected.length()-2) + \\\")\\\", curToken.line, curToken.column);\");\n\t\tout.println(\" }\");\n\t\tout.println();\n\t\tout.println(\" if (!newrule.subrule) {\");\n\t\tout.println(\" if (parseTree == null) {\");\n\t\tout.println(\" curNode = parseTree = new \" + node(startRuleName) + \"(newrule.name, null, newrule.multi_child);\");\n\t\tout.println(\" } else {\");\n\t\tout.println(\" \" + prefix + \"ASTNode newnode = makenode(newrule.name, null, newrule.multi_child);\");\n\t\tout.println(\" curNode.addChild(newnode);\");\n\t\tout.println(\" curNode = newnode;\");\n\t\tout.println(\" }\");\n\t\tout.println();\n\t\tout.println(\" stateStack.push(null);\");\n\t\tout.println(\" }\");\n\t\tout.println();\n\t\tout.println(\" for (int i = newrule.graph.length-1; i >= 0; i--) {\");\n\t\tout.println(\" stateStack.push(newrule.graph[i]);\");\n\t\tout.println(\" }\");\n\t\tout.println(\" }\");\n\t\tout.println(\" else if (curState.type == GrammarState.EPSILON) {\");\n\t\tout.println(\" continue; //do nothing\");\n\t\tout.println(\" }\");\n\t\tout.println();\t\t\t\t\n\t\tout.println(\" }\");\n\t\tout.println();\n\t\tout.println(\" return parseTree;\");\n\t\tout.println();\n\t\tout.println(\" }\");\n\t\t\n\t}", "public void generate() {\n\t\t// Print generation stamp\n\t\tcontext.getNaming().putStamp(elementInterface, out);\n\t\t// Print the code\n\t\t// Print header\n\t\tout.println(\"package \"+modelPackage+\";\");\n\t\tout.println();\n\t\tout.println(\"public interface \"+elementInterface);\n\t\tif (context.isGenerateVisitor()) {\n\t\t\tout.println(indent+\"extends \"+context.getNaming().getVisitableInterface(modelName));\n\t\t}\n\t\tout.println(\"{\");\n\t\tif (context.isGenerateID()) {\n\t\t\tout.println(indent+\"/** Get the id */\");\n\t\t\tout.println(indent+\"public String getId();\");\n\t\t\tout.println(indent+\"/** Set the id */\");\n\t\t\tout.println(indent+\"public void setId(String id);\");\n\t\t\tout.println();\n\t\t}\n\t\tif (context.isGenerateBidirectional()) {\n\t\t\tout.println(indent+\"/** Delete */\");\n\t\t\tout.println(indent+\"public void delete();\");\n\t\t}\n\t\tout.println(indent+\"/** Override toString */\");\n\t\tout.println(indent+\"public String toString();\");\n//\t\tif (context.isGenerateInvariant()) {\n//\t\t\tout.println();\n//\t\t\tout.println(indent+\"/** Parse all invariants */\");\n//\t\t\tout.println(indent+\"public Boolean parseInvariants(ILog log);\");\n//\t\t\tout.println(indent+\"/** Evaluate all invariants */\");\n//\t\t\tout.println(indent+\"public Boolean evaluateInvariants(ILog log);\");\n//\t\t}\n\t\tout.println(\"}\");\n\t}", "public void printOWLModel(){\n\t\tmodel.write(System.out, \"RDF/XML\");\t\t\n\t}", "public LearnGramPanel(DNObject grammar) {\n initComponents();\n labelKey.setText(grammar.getKey().substring(5));\n textAreaValue.setText(grammar.getValue());\n }", "@Override\n\tpublic String toString() {\n\t\t\n\t\treturn \"Standard Text Analyse\";\n\t}", "@Override\n\tpublic String toString()\n\t{\n\t\tStringBuffer buffer = new StringBuffer();\n\t\tbuffer.append(\"Init: \" + initialState.toString() + \"\\n\");\n\t\tbuffer.append(\"Goal: \" + explicitGoal.toString() + \"\\n\");\n\t\tbuffer.append(\"Vars: \");\n\t\tfor (int var = 0; var < variableNames.size(); var++)\n\t\t{\n\t\t\tbuffer.append(var + \":\" + domainSizes.get(var) + \" \");\n\t\t}\n\t\tbuffer.append(\"\\n\");\n\t\tbuffer.append(\"Num ops: \" + getOperators().size() + \"\\n\");\n\t\treturn buffer.toString();\n\t}", "public void outputDeclarative ()\n\t{\n\t\toutput (\"\\n> (dm)\\n\");\n\t\tif (model!=null) model.outputDeclarative();\n\t}", "private StandardGrammars() {\n // do nothing\n }", "public static void printGraph(Model aGraph) {\r\n\t\tStmtIterator triples;\t\t\t\t\t//To loop through the triples\r\n\t\tStatement triple;\t\t\t\t\t\t//One of the triples\r\n\r\n\t\ttriples = aGraph.listStatements();\r\n\t\twhile (triples.hasNext()) {\r\n\t\t\ttriple = triples.next();\r\n//\t\t\tSystem.out.print(\"\\t\");\r\n\t\t\tprintTriple(triple);\r\n\t\t\tSystem.out.println();\r\n\t\t}\r\n\t}", "public static GrammarInfo generateGrammar(ParserResult parserResult) throws IngridParserException {\n GrammarInfo grammar = new GrammarInfo(parserResult.grammarName);\n\n Map<String, Rule> rules = parserResult.rules;\n\n // Lexer rules must be resolved first so that parser rules can reference them\n // Lexer rules do not contain references to parser rules\n // We need to copy the array because we are changing it inside forEach\n new ArrayList<>(rules.keySet())\n .stream()\n .filter(name -> rules.get(name) instanceof LexerRule || rules.get(name) instanceof RegexRule)\n .forEach(name -> {\n FlatLexerRule flatRule = null;\n // We always get updated Rule from rule set again, because we might have updated it\n flatRule = flattenLexerRule(rules.get(name), rules);\n grammar.rules.put(name, flatRule);\n\n // We need to put it to the old set too, so resolving in the second step works too,\n // because we create new flatRule objects inside flattenLexerRule.\n rules.put(name, flatRule);\n });\n\n // We need to copy the array because we are changing it inside forEach\n new ArrayList<>(rules.values())\n .stream()\n .filter(r -> r instanceof ParserRule)\n .forEach(rule -> {\n resolveParserRule((ParserRule) rule, rules);\n\n // We do not call \"new Rule\" inside here, so we don't need to update old rule set.\n // Unlike in the first step, ParserRule objects stay the same, just their content is changed.\n grammar.rules.put(rule.name, rule);\n });\n\n grammar.rootRule = grammar.rules.get(parserResult.rootRule);\n\n for (String ruleToRemove : parserResult.fragmentLexerRules) {\n grammar.rules.remove(ruleToRemove);\n }\n\n return grammar;\n }", "@Override\n\tpublic ATN createATN() {\n\t\tSet<String> modes = ((LexerGrammar) g).modes.keySet();\n\t\tfor (String modeName : modes) {\n\t\t\t// create s0, start state; implied Tokens rule node\n\t\t\tTokensStartState startState =\n\t\t\t\tnewState(TokensStartState.class, null);\n\t\t\tatn.modeNameToStartState.put(modeName, startState);\n\t\t\tatn.modeToStartState.add(startState);\n\t\t\tatn.defineDecisionState(startState);\n\t\t}\n\n\t\t// INIT ACTION, RULE->TOKEN_TYPE MAP\n\t\tatn.ruleToTokenType = new int[g.rules.size()];\n\t\tfor (Rule r : g.rules.values()) {\n\t\t\tatn.ruleToTokenType[r.index] = g.getTokenType(r.name);\n\t\t}\n\n\t\t// CREATE ATN FOR EACH RULE\n\t\t_createATN(g.rules.values());\n\n\t\tatn.lexerActions = new LexerAction[indexToActionMap.size()];\n\t\tfor (Map.Entry<Integer, LexerAction> entry : indexToActionMap.entrySet()) {\n\t\t\tatn.lexerActions[entry.getKey()] = entry.getValue();\n\t\t}\n\n\t\t// LINK MODE START STATE TO EACH TOKEN RULE\n\t\tfor (String modeName : modes) {\n\t\t\tList<Rule> rules = ((LexerGrammar)g).modes.get(modeName);\n\t\t\tTokensStartState startState = atn.modeNameToStartState.get(modeName);\n\t\t\tfor (Rule r : rules) {\n\t\t\t\tif ( !r.isFragment() ) {\n\t\t\t\t\tRuleStartState s = atn.ruleToStartState[r.index];\n\t\t\t\t\tepsilon(startState, s);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tATNOptimizer.optimize(g, atn);\n\t\tcheckEpsilonClosure();\n\t\treturn atn;\n\t}", "public static String createRegularExpression(AutomatonSpecification automaton) {\n String regexp = \"\";\n State initial = automaton.getInitialState();\n List<State> finalStates = new LinkedList<State>();\n\n for (State state : automaton.allStates()) {\n transitionLabels.put(hashOf(state, state), \"\");\n }\n\n String label;\n List<State> next; //lista tymczasowa.\n List<State> previous; //lista tymczasowa.\n for (State state : automaton.allStates()) {\n next = new LinkedList<State>();\n for (OutgoingTransition out : automaton.allOutgoingTransitions(state)) {\n State target = out.getTargetState();\n if (!next.contains(target)) {\n next.add(target);\n if (previousStates.containsKey(target)) {\n previous = previousStates.get(target);\n previous.add(state);\n previousStates.put(target, previous);\n } else {\n previous = new LinkedList<State>();\n previous.add(state);\n previousStates.put(target, previous);\n }\n label = out.getTransitionLabel().toString();\n for (char character : SPECIAL_CHARACTERS)\n if (label.charAt(0) == character)\n label = QUOTE + label;\n } else {\n label = transitionLabels.get(hashOf(state, target)) + '|';\n StringBuffer buf = new StringBuffer();\n for (char character : SPECIAL_CHARACTERS)\n if (out.getTransitionLabel().toString().charAt(0) == character) {\n buf.append(QUOTE);\n break;\n }\n label = label + buf.toString() + out.getTransitionLabel().toString();\n }\n transitionLabels.put(hashOf(state, target), label);\n }\n nextStates.put(state, next);\n if (automaton.isFinal(state))\n finalStates.add(state);\n }\n\n for (State state : automaton.allStates()) {\n if (!automaton.isFinal(state) && state != initial) {\n remove(state);\n }\n }\n\n String r, s, u, t, reg;\n for (State state : finalStates) {\n transitionLabelsBackup = new HashMap<String, String>(transitionLabels);\n previousBackup = new HashMap<State, List<State>>();\n for (State prevState : previousStates.keySet()) {\n previous = new LinkedList<State>();\n for (State st : previousStates.get(prevState))\n previous.add(st);\n previousBackup.put(prevState, previous);\n }\n nextBackup = new HashMap<State, List<State>>();\n for (State prevState : nextStates.keySet()) {\n next = new LinkedList<State>();\n for (State st : nextStates.get(prevState))\n next.add(st);\n nextBackup.put(prevState, next);\n }\n\n for (State toRemove : finalStates) {\n if (state != toRemove && toRemove != initial)\n remove(toRemove);\n }\n if (state == initial) {\n if (regexp.equals(\"\")) {\n if (transitionLabels.get(hashOf(state, state)).equals(\"\"))\n regexp = \"(\\u03B5)\";\n else\n regexp = \"(\" + transitionLabels.get(hashOf(state, state)) + \")*\";\n } else\n regexp = regexp + \"|\" + \"(\" + transitionLabels.get(hashOf(state, state)) + \")*\";\n } else {\n r = getLabel(initial, initial);\n s = getLabel(initial, state);\n u = getLabel(state, state);\n t = getLabel(state, initial);\n if (r.length() > 0) {\n if (t.length() > 0)\n reg = \"(\" + r + \"|\" + \"(\" + s + \")\" + \"(\" + u + \")*\" + \"(\" + t + \")\" + \")*\"\n + \"(\" + s + \")\" + \"(\" + u + \")*\";\n else\n reg = \"(\" + r + \")*\" + \"(\" + s + \")\" + \"(\" + u + \")*\";\n } else {\n if (t.length() > 0)\n reg = \"((\" + s + \")\" + \"(\" + u + \")*\" + \"(\" + t + \")\" + \")*\" + \"(\" + s + \")\"\n + \"(\" + u + \")*\";\n else\n reg = \"(\" + s + \")\" + \"(\" + u + \")*\";\n }\n if (regexp.equals(\"\"))\n regexp = reg;\n else\n regexp = regexp + \"|\" + reg;\n }\n previousStates.clear();\n previousStates.putAll(previousBackup);\n nextStates.clear();\n nextStates.putAll(nextBackup);\n transitionLabels.clear();\n transitionLabels.putAll(transitionLabelsBackup);\n }\n\n regexp = fixKleene(fixBrackets(regexp));\n\n return regexp.replace(String.valueOf(QUOTE), \"\\\\\");\n }", "public static void main (String[] args){\n if (args.length != 1){ // Check if there is the input regular expression\n System.out.println(\"Usage: java REcompiler <RegExp>\");\n return;\n }\n String input = args [0]; //Get the input regular expression\n inputCharArray = input.toCharArray(); //Convert the input string into char array\n set_state (0,\"START\",0,0); //Add the start state into the list\n int i = expression(); // Call the expression()\n if (hasError == true) System.out.println(\"GRAMMER ERROR\"); // IF there is any error, display the error message\n else {\n set_state (state, \"END\", 0,0); //Add the end state into the list\n int n1 , n2;\n n1 = n2 = getStartState(); // Get the start state of the FSM\n stateList.get(0).setN1(n1); stateList.get(0).setN2(n2); // Set the 'START' state's n1 and n2 to the start state\n stateList.forEach (state -> { //Print out all the elements in the list\n System.out.println(state.getState()+\",\"+state.getStr()+\",\"+state.getN1()+\",\"+state.getN2());\n });\n }\n }", "@Override\r\n\tpublic void visit(ast.program.Program p) {\r\n\t\t// ////////////////////////////////////////////////\r\n\t\t// step 1: build a symbol table for class (the class table)\r\n\t\t// a class table is a mapping from class names to class bindings\r\n\t\t// classTable: className -> ClassBinding{extends, fields, methods}\r\n\t\tbuildMainClass((ast.mainClass.MainClass) p.mainClass);\r\n\t\tfor (ast.classs.T c : p.classes) {\r\n\t\t\tbuildClass((ast.classs.Class) c);\r\n\t\t}\r\n\r\n\t\t// we can double check that the class table is OK!\r\n\t\tif (control.Control.elabClassTable) {\r\n\t\t\tthis.classTable.dump();\r\n\t\t}\r\n\r\n\t\t// ////////////////////////////////////////////////\r\n\t\t// step 2: elaborate each class in turn, under the class table\r\n\t\t// built above.\r\n\t\tp.mainClass.accept(this);\r\n\t\tfor (ast.classs.T c : p.classes) {\r\n\t\t\tc.accept(this);\r\n\t\t}\r\n\t}", "public final ANTLRv3Parser.grammarDef_return grammarDef() throws RecognitionException {\r\n ANTLRv3Parser.grammarDef_return retval = new ANTLRv3Parser.grammarDef_return();\r\n retval.start = input.LT(1);\r\n\r\n\r\n CommonTree root_0 = null;\r\n\r\n Token g=null;\r\n Token DOC_COMMENT1=null;\r\n Token string_literal2=null;\r\n Token string_literal3=null;\r\n Token string_literal4=null;\r\n Token char_literal6=null;\r\n Token EOF12=null;\r\n ANTLRv3Parser.id_return id5 =null;\r\n\r\n ANTLRv3Parser.optionsSpec_return optionsSpec7 =null;\r\n\r\n ANTLRv3Parser.tokensSpec_return tokensSpec8 =null;\r\n\r\n ANTLRv3Parser.attrScope_return attrScope9 =null;\r\n\r\n ANTLRv3Parser.action_return action10 =null;\r\n\r\n ANTLRv3Parser.rule_return rule11 =null;\r\n\r\n\r\n CommonTree g_tree=null;\r\n CommonTree DOC_COMMENT1_tree=null;\r\n CommonTree string_literal2_tree=null;\r\n CommonTree string_literal3_tree=null;\r\n CommonTree string_literal4_tree=null;\r\n CommonTree char_literal6_tree=null;\r\n CommonTree EOF12_tree=null;\r\n RewriteRuleTokenStream stream_DOC_COMMENT=new RewriteRuleTokenStream(adaptor,\"token DOC_COMMENT\");\r\n RewriteRuleTokenStream stream_90=new RewriteRuleTokenStream(adaptor,\"token 90\");\r\n RewriteRuleTokenStream stream_EOF=new RewriteRuleTokenStream(adaptor,\"token EOF\");\r\n RewriteRuleTokenStream stream_83=new RewriteRuleTokenStream(adaptor,\"token 83\");\r\n RewriteRuleTokenStream stream_84=new RewriteRuleTokenStream(adaptor,\"token 84\");\r\n RewriteRuleTokenStream stream_85=new RewriteRuleTokenStream(adaptor,\"token 85\");\r\n RewriteRuleTokenStream stream_76=new RewriteRuleTokenStream(adaptor,\"token 76\");\r\n RewriteRuleSubtreeStream stream_id=new RewriteRuleSubtreeStream(adaptor,\"rule id\");\r\n RewriteRuleSubtreeStream stream_tokensSpec=new RewriteRuleSubtreeStream(adaptor,\"rule tokensSpec\");\r\n RewriteRuleSubtreeStream stream_attrScope=new RewriteRuleSubtreeStream(adaptor,\"rule attrScope\");\r\n RewriteRuleSubtreeStream stream_rule=new RewriteRuleSubtreeStream(adaptor,\"rule rule\");\r\n RewriteRuleSubtreeStream stream_action=new RewriteRuleSubtreeStream(adaptor,\"rule action\");\r\n RewriteRuleSubtreeStream stream_optionsSpec=new RewriteRuleSubtreeStream(adaptor,\"rule optionsSpec\");\r\n try {\r\n // C:/dev/antlr.github/antlr/tool/src/main/antlr3/org/antlr/grammar/v3/ANTLRv3.g:93:5: ( ( DOC_COMMENT )? ( 'lexer' | 'parser' | 'tree' |) g= 'grammar' id ';' ( optionsSpec )? ( tokensSpec )? ( attrScope )* ( action )* ( rule )+ EOF -> ^( id ( DOC_COMMENT )? ( optionsSpec )? ( tokensSpec )? ( attrScope )* ( action )* ( rule )+ ) )\r\n // C:/dev/antlr.github/antlr/tool/src/main/antlr3/org/antlr/grammar/v3/ANTLRv3.g:93:9: ( DOC_COMMENT )? ( 'lexer' | 'parser' | 'tree' |) g= 'grammar' id ';' ( optionsSpec )? ( tokensSpec )? ( attrScope )* ( action )* ( rule )+ EOF\r\n {\r\n // C:/dev/antlr.github/antlr/tool/src/main/antlr3/org/antlr/grammar/v3/ANTLRv3.g:93:9: ( DOC_COMMENT )?\r\n int alt1=2;\r\n int LA1_0 = input.LA(1);\r\n\r\n if ( (LA1_0==DOC_COMMENT) ) {\r\n alt1=1;\r\n }\r\n switch (alt1) {\r\n case 1 :\r\n // C:/dev/antlr.github/antlr/tool/src/main/antlr3/org/antlr/grammar/v3/ANTLRv3.g:93:9: DOC_COMMENT\r\n {\r\n DOC_COMMENT1=(Token)match(input,DOC_COMMENT,FOLLOW_DOC_COMMENT_in_grammarDef367); if (state.failed) return retval; \r\n if ( state.backtracking==0 ) stream_DOC_COMMENT.add(DOC_COMMENT1);\r\n\r\n\r\n }\r\n break;\r\n\r\n }\r\n\r\n\r\n // C:/dev/antlr.github/antlr/tool/src/main/antlr3/org/antlr/grammar/v3/ANTLRv3.g:94:6: ( 'lexer' | 'parser' | 'tree' |)\r\n int alt2=4;\r\n switch ( input.LA(1) ) {\r\n case 84:\r\n {\r\n alt2=1;\r\n }\r\n break;\r\n case 85:\r\n {\r\n alt2=2;\r\n }\r\n break;\r\n case 90:\r\n {\r\n alt2=3;\r\n }\r\n break;\r\n case 83:\r\n {\r\n alt2=4;\r\n }\r\n break;\r\n default:\r\n if (state.backtracking>0) {state.failed=true; return retval;}\r\n NoViableAltException nvae =\r\n new NoViableAltException(\"\", 2, 0, input);\r\n\r\n throw nvae;\r\n\r\n }\r\n\r\n switch (alt2) {\r\n case 1 :\r\n // C:/dev/antlr.github/antlr/tool/src/main/antlr3/org/antlr/grammar/v3/ANTLRv3.g:94:8: 'lexer'\r\n {\r\n string_literal2=(Token)match(input,84,FOLLOW_84_in_grammarDef377); if (state.failed) return retval; \r\n if ( state.backtracking==0 ) stream_84.add(string_literal2);\r\n\r\n\r\n if ( state.backtracking==0 ) {gtype=LEXER_GRAMMAR;}\r\n\r\n }\r\n break;\r\n case 2 :\r\n // C:/dev/antlr.github/antlr/tool/src/main/antlr3/org/antlr/grammar/v3/ANTLRv3.g:95:10: 'parser'\r\n {\r\n string_literal3=(Token)match(input,85,FOLLOW_85_in_grammarDef395); if (state.failed) return retval; \r\n if ( state.backtracking==0 ) stream_85.add(string_literal3);\r\n\r\n\r\n if ( state.backtracking==0 ) {gtype=PARSER_GRAMMAR;}\r\n\r\n }\r\n break;\r\n case 3 :\r\n // C:/dev/antlr.github/antlr/tool/src/main/antlr3/org/antlr/grammar/v3/ANTLRv3.g:96:10: 'tree'\r\n {\r\n string_literal4=(Token)match(input,90,FOLLOW_90_in_grammarDef411); if (state.failed) return retval; \r\n if ( state.backtracking==0 ) stream_90.add(string_literal4);\r\n\r\n\r\n if ( state.backtracking==0 ) {gtype=TREE_GRAMMAR;}\r\n\r\n }\r\n break;\r\n case 4 :\r\n // C:/dev/antlr.github/antlr/tool/src/main/antlr3/org/antlr/grammar/v3/ANTLRv3.g:97:14: \r\n {\r\n if ( state.backtracking==0 ) {gtype=COMBINED_GRAMMAR;}\r\n\r\n }\r\n break;\r\n\r\n }\r\n\r\n\r\n g=(Token)match(input,83,FOLLOW_83_in_grammarDef452); if (state.failed) return retval; \r\n if ( state.backtracking==0 ) stream_83.add(g);\r\n\r\n\r\n pushFollow(FOLLOW_id_in_grammarDef454);\r\n id5=id();\r\n\r\n state._fsp--;\r\n if (state.failed) return retval;\r\n if ( state.backtracking==0 ) stream_id.add(id5.getTree());\r\n\r\n char_literal6=(Token)match(input,76,FOLLOW_76_in_grammarDef456); if (state.failed) return retval; \r\n if ( state.backtracking==0 ) stream_76.add(char_literal6);\r\n\r\n\r\n // C:/dev/antlr.github/antlr/tool/src/main/antlr3/org/antlr/grammar/v3/ANTLRv3.g:99:25: ( optionsSpec )?\r\n int alt3=2;\r\n int LA3_0 = input.LA(1);\r\n\r\n if ( (LA3_0==OPTIONS) ) {\r\n alt3=1;\r\n }\r\n switch (alt3) {\r\n case 1 :\r\n // C:/dev/antlr.github/antlr/tool/src/main/antlr3/org/antlr/grammar/v3/ANTLRv3.g:99:25: optionsSpec\r\n {\r\n pushFollow(FOLLOW_optionsSpec_in_grammarDef458);\r\n optionsSpec7=optionsSpec();\r\n\r\n state._fsp--;\r\n if (state.failed) return retval;\r\n if ( state.backtracking==0 ) stream_optionsSpec.add(optionsSpec7.getTree());\r\n\r\n }\r\n break;\r\n\r\n }\r\n\r\n\r\n // C:/dev/antlr.github/antlr/tool/src/main/antlr3/org/antlr/grammar/v3/ANTLRv3.g:99:38: ( tokensSpec )?\r\n int alt4=2;\r\n int LA4_0 = input.LA(1);\r\n\r\n if ( (LA4_0==TOKENS) ) {\r\n alt4=1;\r\n }\r\n switch (alt4) {\r\n case 1 :\r\n // C:/dev/antlr.github/antlr/tool/src/main/antlr3/org/antlr/grammar/v3/ANTLRv3.g:99:38: tokensSpec\r\n {\r\n pushFollow(FOLLOW_tokensSpec_in_grammarDef461);\r\n tokensSpec8=tokensSpec();\r\n\r\n state._fsp--;\r\n if (state.failed) return retval;\r\n if ( state.backtracking==0 ) stream_tokensSpec.add(tokensSpec8.getTree());\r\n\r\n }\r\n break;\r\n\r\n }\r\n\r\n\r\n // C:/dev/antlr.github/antlr/tool/src/main/antlr3/org/antlr/grammar/v3/ANTLRv3.g:99:50: ( attrScope )*\r\n loop5:\r\n do {\r\n int alt5=2;\r\n int LA5_0 = input.LA(1);\r\n\r\n if ( (LA5_0==SCOPE) ) {\r\n alt5=1;\r\n }\r\n\r\n\r\n switch (alt5) {\r\n \tcase 1 :\r\n \t // C:/dev/antlr.github/antlr/tool/src/main/antlr3/org/antlr/grammar/v3/ANTLRv3.g:99:50: attrScope\r\n \t {\r\n \t pushFollow(FOLLOW_attrScope_in_grammarDef464);\r\n \t attrScope9=attrScope();\r\n\r\n \t state._fsp--;\r\n \t if (state.failed) return retval;\r\n \t if ( state.backtracking==0 ) stream_attrScope.add(attrScope9.getTree());\r\n\r\n \t }\r\n \t break;\r\n\r\n \tdefault :\r\n \t break loop5;\r\n }\r\n } while (true);\r\n\r\n\r\n // C:/dev/antlr.github/antlr/tool/src/main/antlr3/org/antlr/grammar/v3/ANTLRv3.g:99:61: ( action )*\r\n loop6:\r\n do {\r\n int alt6=2;\r\n int LA6_0 = input.LA(1);\r\n\r\n if ( (LA6_0==AT) ) {\r\n alt6=1;\r\n }\r\n\r\n\r\n switch (alt6) {\r\n \tcase 1 :\r\n \t // C:/dev/antlr.github/antlr/tool/src/main/antlr3/org/antlr/grammar/v3/ANTLRv3.g:99:61: action\r\n \t {\r\n \t pushFollow(FOLLOW_action_in_grammarDef467);\r\n \t action10=action();\r\n\r\n \t state._fsp--;\r\n \t if (state.failed) return retval;\r\n \t if ( state.backtracking==0 ) stream_action.add(action10.getTree());\r\n\r\n \t }\r\n \t break;\r\n\r\n \tdefault :\r\n \t break loop6;\r\n }\r\n } while (true);\r\n\r\n\r\n // C:/dev/antlr.github/antlr/tool/src/main/antlr3/org/antlr/grammar/v3/ANTLRv3.g:100:6: ( rule )+\r\n int cnt7=0;\r\n loop7:\r\n do {\r\n int alt7=2;\r\n int LA7_0 = input.LA(1);\r\n\r\n if ( (LA7_0==DOC_COMMENT||LA7_0==FRAGMENT||LA7_0==RULE_REF||LA7_0==TOKEN_REF||(LA7_0 >= 86 && LA7_0 <= 88)) ) {\r\n alt7=1;\r\n }\r\n\r\n\r\n switch (alt7) {\r\n \tcase 1 :\r\n \t // C:/dev/antlr.github/antlr/tool/src/main/antlr3/org/antlr/grammar/v3/ANTLRv3.g:100:6: rule\r\n \t {\r\n \t pushFollow(FOLLOW_rule_in_grammarDef475);\r\n \t rule11=rule();\r\n\r\n \t state._fsp--;\r\n \t if (state.failed) return retval;\r\n \t if ( state.backtracking==0 ) stream_rule.add(rule11.getTree());\r\n\r\n \t }\r\n \t break;\r\n\r\n \tdefault :\r\n \t if ( cnt7 >= 1 ) break loop7;\r\n \t if (state.backtracking>0) {state.failed=true; return retval;}\r\n EarlyExitException eee =\r\n new EarlyExitException(7, input);\r\n throw eee;\r\n }\r\n cnt7++;\r\n } while (true);\r\n\r\n\r\n EOF12=(Token)match(input,EOF,FOLLOW_EOF_in_grammarDef483); if (state.failed) return retval; \r\n if ( state.backtracking==0 ) stream_EOF.add(EOF12);\r\n\r\n\r\n // AST REWRITE\r\n // elements: attrScope, optionsSpec, tokensSpec, DOC_COMMENT, rule, action, id\r\n // token labels: \r\n // rule labels: retval\r\n // token list labels: \r\n // rule list labels: \r\n // wildcard labels: \r\n if ( state.backtracking==0 ) {\r\n\r\n retval.tree = root_0;\r\n RewriteRuleSubtreeStream stream_retval=new RewriteRuleSubtreeStream(adaptor,\"rule retval\",retval!=null?retval.tree:null);\r\n\r\n root_0 = (CommonTree)adaptor.nil();\r\n // 102:6: -> ^( id ( DOC_COMMENT )? ( optionsSpec )? ( tokensSpec )? ( attrScope )* ( action )* ( rule )+ )\r\n {\r\n // C:/dev/antlr.github/antlr/tool/src/main/antlr3/org/antlr/grammar/v3/ANTLRv3.g:102:9: ^( id ( DOC_COMMENT )? ( optionsSpec )? ( tokensSpec )? ( attrScope )* ( action )* ( rule )+ )\r\n {\r\n CommonTree root_1 = (CommonTree)adaptor.nil();\r\n root_1 = (CommonTree)adaptor.becomeRoot(adaptor.create(gtype,g), root_1);\r\n\r\n adaptor.addChild(root_1, stream_id.nextTree());\r\n\r\n // C:/dev/antlr.github/antlr/tool/src/main/antlr3/org/antlr/grammar/v3/ANTLRv3.g:103:12: ( DOC_COMMENT )?\r\n if ( stream_DOC_COMMENT.hasNext() ) {\r\n adaptor.addChild(root_1, \r\n stream_DOC_COMMENT.nextNode()\r\n );\r\n\r\n }\r\n stream_DOC_COMMENT.reset();\r\n\r\n // C:/dev/antlr.github/antlr/tool/src/main/antlr3/org/antlr/grammar/v3/ANTLRv3.g:103:25: ( optionsSpec )?\r\n if ( stream_optionsSpec.hasNext() ) {\r\n adaptor.addChild(root_1, stream_optionsSpec.nextTree());\r\n\r\n }\r\n stream_optionsSpec.reset();\r\n\r\n // C:/dev/antlr.github/antlr/tool/src/main/antlr3/org/antlr/grammar/v3/ANTLRv3.g:103:38: ( tokensSpec )?\r\n if ( stream_tokensSpec.hasNext() ) {\r\n adaptor.addChild(root_1, stream_tokensSpec.nextTree());\r\n\r\n }\r\n stream_tokensSpec.reset();\r\n\r\n // C:/dev/antlr.github/antlr/tool/src/main/antlr3/org/antlr/grammar/v3/ANTLRv3.g:103:50: ( attrScope )*\r\n while ( stream_attrScope.hasNext() ) {\r\n adaptor.addChild(root_1, stream_attrScope.nextTree());\r\n\r\n }\r\n stream_attrScope.reset();\r\n\r\n // C:/dev/antlr.github/antlr/tool/src/main/antlr3/org/antlr/grammar/v3/ANTLRv3.g:103:61: ( action )*\r\n while ( stream_action.hasNext() ) {\r\n adaptor.addChild(root_1, stream_action.nextTree());\r\n\r\n }\r\n stream_action.reset();\r\n\r\n if ( !(stream_rule.hasNext()) ) {\r\n throw new RewriteEarlyExitException();\r\n }\r\n while ( stream_rule.hasNext() ) {\r\n adaptor.addChild(root_1, stream_rule.nextTree());\r\n\r\n }\r\n stream_rule.reset();\r\n\r\n adaptor.addChild(root_0, root_1);\r\n }\r\n\r\n }\r\n\r\n\r\n retval.tree = root_0;\r\n }\r\n\r\n }\r\n\r\n retval.stop = input.LT(-1);\r\n\r\n\r\n if ( state.backtracking==0 ) {\r\n\r\n retval.tree = (CommonTree)adaptor.rulePostProcessing(root_0);\r\n adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);\r\n }\r\n }\r\n catch (RecognitionException re) {\r\n reportError(re);\r\n recover(input,re);\r\n \tretval.tree = (CommonTree)adaptor.errorNode(input, retval.start, input.LT(-1), re);\r\n\r\n }\r\n\r\n finally {\r\n \t// do for sure before leaving\r\n }\r\n return retval;\r\n }", "private static Parser<Grammar> makeParser(final File grammar) {\n try {\n\n return Parser.compile(grammar, Grammar.ROOT);\n\n // translate these checked exceptions into unchecked\n // RuntimeExceptions,\n // because these failures indicate internal bugs rather than client\n // errors\n } catch (IOException e) {\n throw new RuntimeException(\"can't read the grammar file\", e);\n } catch (UnableToParseException e) {\n throw new IllegalArgumentException(\"the grammar has a syntax error\", e);\n }\n }", "public static Grammar convertToGrammar(List<String> grammarLines) throws GrammarSyntaxException {\r\n\t\tGrammar grammar = new Grammar();\r\n\t\t\r\n\t\t//Extract production\r\n\t\tfor (String line: grammarLines){\r\n\t\t\textractProduction(grammar, line);\r\n\t\t}\r\n\r\n\t\t//Axiom creation\r\n\t\tProduction axiomProduction = new Production();\r\n\t\taxiomProduction.setLeft(Grammar.AXIOM);\r\n\t\taxiomProduction.addRightElement(grammar.getProductions().get(0).getLeft());\r\n\t\taxiomProduction.addRightElement(Grammar.END_LINE);\r\n\r\n\t\tgrammar.setAxiomProduction(axiomProduction);\r\n\r\n\t\t//Calculate first and follow\r\n\t\tcalculateFirstAndFollow(grammar);\r\n\r\n\t\treturn grammar;\r\n\t}", "public static void main(String[] args) {\n\t\t\n\t\tmakeCFG(\"E -> T + T\\n \"\n\t\t\t\t+ \"E -> T - T\\n \"\n\t\t\t\t+ \"T -> F * F\\n \"\n\t\t\t\t+ \"T -> F / F\\n\", \"E\");\n\t\t\n\t\t\n//\t\tNontermianlSymbol procedure = new NontermianlSymbol(\"procedure\");\n//\t\tNontermianlSymbol subprocedure = new NontermianlSymbol(\"subprocedure\");\n//\t\tNontermianlSymbol constDefinition = new NontermianlSymbol(\"constDefinition\");\n//\t\tNontermianlSymbol varDefinition = new NontermianlSymbol(\"varDefinition\");\n//\t\tNontermianlSymbol statement = new NontermianlSymbol(\"statement\");\n//\t\tNontermianlSymbol condition = new NontermianlSymbol(\"condition\");\n//\t\tNontermianlSymbol expression = new NontermianlSymbol(\"expression\");\n//\t\tNontermianlSymbol term = new NontermianlSymbol(\"term\");\n//\t\tNontermianlSymbol factor = new NontermianlSymbol(\"factor\");\n\t\t\n\t\t\n//\t\tNontermianlSymbol S = new NontermianlSymbol(\"S\");\n//\t\tNontermianlSymbol T = new NontermianlSymbol(\"T\");\n//\t\t\n//\t\tTerminalSymbol a = new TerminalSymbol(\"a\");\n//\t\tTerminalSymbol and = new TerminalSymbol(\"^\");\n//\t\tTerminalSymbol lp = new TerminalSymbol(\"(\");\n//\t\tTerminalSymbol rp = new TerminalSymbol(\")\");\n//\t\tTerminalSymbol comma = new TerminalSymbol(\",\");\n//\t\t\n//\t\tRule r1 = new Rule(S, Arrays.asList(a));\n//\t\tRule r2 = new Rule(S, Arrays.asList(and));\n//\t\tRule r3 = new Rule(S, Arrays.asList(lp,T,rp));\n//\t\tRule r4 = new Rule(T, Arrays.asList(S));\n//\t\tRule r5 = new Rule(T, Arrays.asList(T,comma,S));\n//\t\t\n//\t\tSet<Rule> rules = new HashSet<>(Arrays.asList(r1,r2,r3,r4,r5));\n//\t\tSet<NontermianlSymbol> nonterminals = new HashSet<>(Arrays.asList(T,S));\n//\t\tSet<TerminalSymbol> terminals = new HashSet<>(Arrays.asList(a,and,lp,rp,comma));\n//\t\tNontermianlSymbol startSymbol = S;\n//\t\t\n//\t\tCFG cfg = new CFG(rules, nonterminals,terminals,startSymbol);\n//\t\t\n//\t\tSystem.out.println(cfg.isLL1());\n//\t\tcfg.removeLeftRecursion();\n//\t\tSystem.out.println(cfg.isLL1());\n// \n//\t\tfor(Rule rule : cfg.rules) {\n//\t\t\tSystem.out.println(rule.toString() + \"\\t\\t\" + cfg.SELECT(rule));\n//\t\t}\n\t}", "public EdGraGra getHostGraphGrammar() {\r\n\t\treturn this.hostGraph;\r\n\t}", "@Test\n public void testComplexGraph() {\n CFGCreator<Character> cfgCreator = new CFGCreator<>();\n CharGrammarParser parser = new CharGrammarParser(cfgCreator);\n SLPOp<Character> slpOp = new SLPOp();\n CFGOp<Character> cfgOp = new CFGOp<>();\n\n // L(G) = {(ab)^1 : i >= 1}\n String text =\n \"S -> bAs \\n\" +\n \"A -> iBa \\n\" +\n \"B -> aCi \\n\" +\n \"C -> sd \\n\" +\n \"D -> SSESS \\n\" +\n \"E -> zSSESSr \\n\" +\n \"E -> uu \\n\";\n\n Map<IJezSymbol<Character>, List<IJezSymbol<Character>>> f = new HashMap<>();\n Map<IJezSymbol<Character>, List<IJezSymbol<Character>>> g = new HashMap<>();\n\n IJezSymbol<Character> a = cfgCreator.lookupSymbol('a', true);\n IJezSymbol<Character> b = cfgCreator.lookupSymbol('b', true);\n IJezSymbol<Character> d = cfgCreator.lookupSymbol('d', true);\n IJezSymbol<Character> i = cfgCreator.lookupSymbol('i', true);\n IJezSymbol<Character> s = cfgCreator.lookupSymbol('s', true);\n IJezSymbol<Character> r = cfgCreator.lookupSymbol('r', true);\n IJezSymbol<Character> u = cfgCreator.lookupSymbol('u', true);\n IJezSymbol<Character> z = cfgCreator.lookupSymbol('z', true);\n\n IJezSymbol<Character> one = cfgCreator.lookupSymbol('1', true);\n IJezSymbol<Character> two = cfgCreator.lookupSymbol('2', true);\n IJezSymbol<Character> three = cfgCreator.lookupSymbol('3', true);\n\n f.put(a, Arrays.asList(one, two));\n f.put(b, Arrays.asList(three, two));\n f.put(d, Arrays.asList(one, one, one, two));\n f.put(i, Arrays.asList(two));\n f.put(s, Arrays.asList(one, one, two));\n f.put(r, Arrays.asList(r));\n f.put(u, Arrays.asList(u));\n f.put(z, Arrays.asList(z));\n\n\n g.put(a, Arrays.asList(one, two, one));\n g.put(b, Arrays.asList(three));\n g.put(d, Arrays.asList(one, one, one));\n g.put(i, Arrays.asList(two, two));\n g.put(s, Arrays.asList(one, two));\n g.put(r, Arrays.asList(r));\n g.put(u, Arrays.asList(u));\n g.put(z, Arrays.asList(z));\n\n\n Set<Production<Character>> productions = parser.createProductions(text);\n Set<IJezSymbol<Character>> axiom = new HashSet<>();\n axiom.add(cfgCreator.lookupSymbol('D', false));\n\n\n Set<Production<Character>> wCNFProductions = cfgOp.toWeakCNF(productions, axiom, cfgCreator);\n MorphismEQSolver<Character, Character> morphismEQSolver = new MorphismEQSolver<>(cfgCreator.createCFG(wCNFProductions, axiom), cfgCreator, new CFGCreatorFactory<>(), new CFGCreatorFactory<>());\n\n GenDefaultMorphism<Character> morphism1 = new GenDefaultMorphism<>(f::get);\n GenDefaultMorphism<Character> morphism2 = new GenDefaultMorphism<>(g::get);\n long ms = System.currentTimeMillis();\n assertTrue(morphismEQSolver.equivalentOnMorphisms(morphism1, morphism2));\n logger.info(\"Running time: \" + (System.currentTimeMillis() - ms) + \"[ms]\");\n }", "public String toString() {\n\t\treturn pharse;\n\t}", "@Override\n\tpublic String toString() {\n\t\treturn \"ProgrammingLanguage \" + programmingLanguage + super.toString();\n\t}", "private GraphPattern translateToGP(){\r\n\r\n\t\t//Generate the graph pattern object\r\n\t\tGraphPattern gp = new GraphPattern();\r\n\r\n\r\n\t\t//For each Node object, create an associated MyNode object\r\n\t\tint nodeCount = 0;\r\n\t\tfor (Node n : allNodes){\r\n\t\t\tMyNode myNode = new MyNode(nodeCount, \"PERSON\");\r\n\t\t\tnodesMap.put(n, myNode);\r\n\t\t\tgp.addNode(myNode);\r\n\r\n\t\t\tnodeCount++;\r\n\t\t}\r\n\r\n\t\t//For k random MyNodes add the id as an attribute/property.\r\n\t\t//This id is used for cypher queries.\r\n\t\t//This process uses simple random sampling\r\n\t\tif (rooted > allNodes.size()){\r\n\t\t\trooted = allNodes.size();\r\n\t\t}\r\n\r\n\t\tList<Node> allNodesClone = new ArrayList<Node>();\r\n\t\tallNodesClone.addAll(allNodes);\r\n\r\n\t\tfor (int i = 0; i < rooted; i++){\r\n\t\t\t//Pick a random node from allNodes and get it's corresponding MyNode\r\n\t\t\tint idx = random.nextInt(allNodesClone.size());\r\n\t\t\tNode node = allNodesClone.get(idx);\r\n\t\t\tMyNode myNode = nodesMap.get(node);\r\n\r\n\t\t\t//Add the property to myNode\r\n\t\t\ttry (Transaction tx = graphDb.beginTx()){\r\n\t\t\t\tmyNode.addAttribute(\"id\", node.getProperty(\"id\")+\"\");\r\n\t\t\t\ttx.success();\r\n\t\t\t}\r\n\t\t\t//Remove the node from allNodesClone list.\r\n\t\t\tallNodesClone.remove(idx);\r\n\t\t}\r\n\r\n\t\t//Process the relationships\r\n\t\tint relCount = 0;\r\n\t\tString relPrefix = \"rel\";\r\n\r\n\t\tfor (Relationship r : rels){\r\n\r\n\t\t\tMyNode source = null, target = null;\r\n\t\t\tRelType type = null;\r\n\r\n\t\t\t//For each relationship in rels, create a corresponding relationship in gp.\r\n\t\t\ttry (Transaction tx = graphDb.beginTx()){\r\n\t\t\t\tsource = nodesMap.get(r.getStartNode());\r\n\t\t\t\ttarget = nodesMap.get(r.getEndNode());\r\n\t\t\t\ttype = GPUtil.translateRelType(r.getType());\r\n\t\t\t\ttx.success();\r\n\t\t\t}\r\n\r\n\t\t\tMyRelationship rel = new MyRelationship(source, target, type, relCount);\r\n\t\t\trelCount++;\r\n\r\n\t\t\tif (relCount >= 25){\r\n\t\t\t\trelCount = 0;\r\n\t\t\t\trelPrefix = relPrefix + \"l\";\r\n\t\t\t}\r\n\r\n\t\t\tgp.addRelationship(rel);\r\n\t\t\trelsMap.put(r, rel);\r\n\t\t}\r\n\r\n\t\t//Set the attribute requirements\r\n\t\tattrsReq(gp, true);\r\n\t\tattrsReq(gp, false);\r\n\t\treturn gp;\r\n\t}", "public static void main(String[] args) {\n CharStream stream;\n if(args.length == 1){\n try {\n stream = new ANTLRFileStream(args[0]);\n } catch (IOException e) {\n System.err.println(\"Ocorreu um problema ao tentar ler o ficheiro \\\"\" + args[0] + \"\\\".\");\n e.printStackTrace();\n return;\n }\n } else{\n try {\n stream = new ANTLRInputStream(System.in);\n } catch (IOException e) {\n System.err.println(\"Ocorreu um problema ao tentar ler do stdin.\");\n e.printStackTrace();\n return;\n }\n }\n\n System.out.println(stream.toString());\n\n LissLexer lexer = new LissLexer(stream);\n TokenStream token = new CommonTokenStream(lexer);\n LissParser parser = new LissParser(token);\n\n //create identifier table\n SymbolTable idT = new SymbolTable();\n ErrorTable e = new ErrorTable();\n Mips m = new Mips();\n parser.liss(idT, e, m);\n\n System.out.println(idT.toString());\n\n /*long total_memory = Runtime.getRuntime().totalMemory(); // Total available now (bytes)\n long free_memory = Runtime.getRuntime().freeMemory(); // Free memory now (bytes)\n long max_memory = Runtime.getRuntime().maxMemory(); // (bytes)\n long mb= (2^20);\n\n System.out.println(\"TOTAL_MEMORY: \"+total_memory +\" B\");\n System.out.println(\"FREE_MEMORY: \"+(free_memory)+\" B\");\n System.out.println(\"MAX_MEMORY: \"+(max_memory)+\" B\\n\");\n\n System.out.println(\"TOTAL_MEMORY: \"+total_memory/mb +\" MB\");\n System.out.println(\"FREE_MEMORY: \"+(free_memory/mb)+\" MB\");\n System.out.println(\"MAX_MEMORY: \"+(max_memory/mb)+\" MB\");*/\n\n }", "public String toString()\n/* */ {\n/* 885 */ StringBuilder result = new StringBuilder();\n/* 886 */ for (int i = 0; i < this.ruleSets.length; i++) {\n/* 887 */ result.append(this.ruleSets[i].toString());\n/* */ }\n/* 889 */ return result.toString();\n/* */ }", "public EdGraGra getStopGraphGrammar() {\r\n\t\treturn this.stopGraph;\r\n\t}", "public String toString()\r\n/* 112: */ {\r\n/* 113:199 */ String s = \"\";\r\n/* 114:200 */ for (N node : getNodes())\r\n/* 115: */ {\r\n/* 116:201 */ s = s + \"\\n{ \" + node + \" \";\r\n/* 117:202 */ for (N suc : getSuccessors(node)) {\r\n/* 118:203 */ s = s + \"\\n ( \" + getEdge(node, suc) + \" \" + suc + \" )\";\r\n/* 119: */ }\r\n/* 120:205 */ s = s + \"\\n} \";\r\n/* 121: */ }\r\n/* 122:207 */ return s;\r\n/* 123: */ }", "public static void main(String[] args) throws IOException {\n InputStream is = ClassLoader.getSystemResourceAsStream(\"graph.gr\");\n \n //Loading the DSL script into the ANTLR stream.\n CharStream cs = new ANTLRInputStream(is);\n \n // generate lexer from input stream from dsl statements.\n GraphLexer lexer = new GraphLexer(cs);\n CommonTokenStream tokens = new CommonTokenStream(lexer);\n \n // generate parser tree from lexer tokens stream.\n GraphParser parser = new GraphParser(tokens);\n \n //Semantic model to be populated\n Graph g = new Graph();\n GraphDslListener dslRuleListener = new GraphDslListener(g, parser);\n \n //Adding the listener to facilitate walking through parse tree. \n parser.addParseListener(dslRuleListener);\n \n //invoking the parser. \n parser.graph();\n \n Graph.printGraph(g);\n }", "public interface JavaGrammarConstants {\n\n /** End of File. */\n int EOF = 0;\n /** RegularExpression Id. */\n int PLUS = 5;\n /** RegularExpression Id. */\n int MINUS = 6;\n /** RegularExpression Id. */\n int MULTIPLY = 7;\n /** RegularExpression Id. */\n int DIVIDE = 8;\n /** RegularExpression Id. */\n int OPEN_PARENTHESIS = 9;\n /** RegularExpression Id. */\n int CLOSED_PARENTHESIS = 10;\n /** RegularExpression Id. */\n int OPEN_BRACKET = 11;\n /** RegularExpression Id. */\n int CLOSED_BRACKET = 12;\n /** RegularExpression Id. */\n int OPEN_BRACE = 13;\n /** RegularExpression Id. */\n int CLOSED_BRACE = 14;\n /** RegularExpression Id. */\n int SEMICOLON = 15;\n /** RegularExpression Id. */\n int EQUALS = 16;\n /** RegularExpression Id. */\n int COMPARISON = 17;\n /** RegularExpression Id. */\n int LESS = 18;\n /** RegularExpression Id. */\n int GREATER = 19;\n /** RegularExpression Id. */\n int NUMBER = 20;\n /** RegularExpression Id. */\n int DIGIT = 21;\n /** RegularExpression Id. */\n int LETTER = 22;\n\n /** Lexical state. */\n int DEFAULT = 0;\n\n /** Literal token values. */\n String[] tokenImage = {\n \"<EOF>\",\n \"\\\" \\\"\",\n \"\\\"\\\\r\\\"\",\n \"\\\"\\\\t\\\"\",\n \"\\\"\\\\n\\\"\",\n \"\\\"+\\\"\",\n \"\\\"-\\\"\",\n \"\\\"*\\\"\",\n \"\\\"/\\\"\",\n \"\\\"(\\\"\",\n \"\\\")\\\"\",\n \"\\\"{\\\"\",\n \"\\\"}\\\"\",\n \"\\\"[\\\"\",\n \"\\\"]\\\"\",\n \"\\\";\\\"\",\n \"\\\"=\\\"\",\n \"<COMPARISON>\",\n \"\\\"<\\\"\",\n \"\\\">\\\"\",\n \"<NUMBER>\",\n \"<DIGIT>\",\n \"<LETTER>\",\n \"\\\"new\\\"\",\n \"\\\",\\\"\",\n \"\\\"System.out.println\\\"\",\n \"\\\"\\\\\\\"\\\"\",\n \"\\\"for\\\"\",\n \"\\\"int\\\"\",\n \"\\\"++\\\"\",\n \"\\\"--\\\"\",\n };\n\n}", "public static void main(String []args){\n\t\tString format = \"TURTLE\";\n\t\tInputStream is = Thread.currentThread().getContextClassLoader().\n\t\t\t\tgetResourceAsStream(\"test_ontologies/cp-11.ttl\");\n\t\tOntDocumentManager dm = OntDocumentManager.getInstance();\n\t\tdm.setProcessImports(false);\n\t\tOntModelSpec spec = new OntModelSpec(OntModelSpec.OWL_DL_MEM);\n\t\tspec.setDocumentManager(dm); \n\t\t//spec.setReasoner(reasoner);\n\t\tOntModel ontModel = ModelFactory.createOntologyModel( spec, null );\n\t\tontModel.read(is,\"\",format);\n\t\ttry {\n\t\t\tStmtIterator it = ontModel.listStatements();\n\t\t\tSystem.out.println(\"STATEMENTS\");\n\t\t\tStatement st;\n\t\t\twhile(it.hasNext()){\n\t\t\t\tst = it.next();\n\t\t\t\tif(st.getSubject().isAnon() || st.getObject().isAnon()){\n\t\t\t\t\t\n\t\t\t\t}else{\n\t\t\t\t\tSystem.out.println(it.next());\t\n\t\t\t\t}\n\t\t\t\t\n\t\t\t}\n\t\t\tSystem.out.println(\"REIFIED STATEMENTS\");\n\t\t\tRSIterator it2 = ontModel.listReifiedStatements();\n\t\t\twhile(it2.hasNext()){\n\t\t\t\tSystem.out.println(it2.next());\n\t\t\t}\n\t\t\t\n\t\t\t\n\t\t} catch (Exception e) {\n\t\t\tlogger.error(e);\n\t\t}\n\n\t}", "public static void main(String[] args) throws Exception {\r\n\t\tSpeechInput input = new SpeechInput();\r\n\t\tinput.afterPropertiesSet();\r\n\t\tRuleGrammar ruleGrammar = input.getGrammar().getRuleGrammar();\r\n\t\tSystem.out.println(\"Adding import\");\r\n\t\t\r\n\t\tRecognizer recognizer = ruleGrammar.getRecognizer();\r\n\t\tSystem.out.println(\"Loading: \" + new ClassPathResource(\"/grammar/hello.gram\"));\r\n\t\tloadGrammar(recognizer, new ClassPathResource(\"/grammar/cooking.gram\"));\r\n\t\tloadGrammar(recognizer, new ClassPathResource(\"/grammar/ingredient.gram\"));\r\n\t\tloadGrammar(recognizer, new ClassPathResource(\"/grammar/recipe.gram\"));\r\n\t\tloadGrammar(recognizer, new ClassPathResource(\"/grammar/step.gram\"));\r\n\t\tloadGrammar(recognizer, new ClassPathResource(\"/grammar/timer.gram\"));\r\n\t\tloadGrammar(recognizer, new ClassPathResource(\"/grammar/remy.gram\"));\r\n\t\t\r\n//\t\tRuleGrammar helloRules = loadGrammar(recognizer, new ClassPathResource(\"/grammar/hello.gram\"));\r\n//\t\tString name = helloRules.getName();\r\n//\t\tSystem.out.println(\"Adding grammar: \" + name);\r\n//\t\truleGrammar.addImport(new RuleName(\"hello.hello\"));\r\n\t\tSystem.out.println(\"Added\");\r\n\t\tSystem.out.println(\"Committing changes\");\r\n\t\t\r\n\t\tinput.getGrammar().commitChanges();\r\n\t\tSystem.out.println(\"Committed\");\r\n\t\tRule rule = ruleGrammar.getRule(\"command\");\r\n\t\tshowRule(rule, \"\");\r\n\t\taddGrammar(rule, \"hello\");\r\n\t\tList<String> ingredients = Arrays.asList(\r\n\t\t\t\t\"carrot\",\r\n\t\t\t\t\"broccoli\",\r\n\t\t\t\t\"kale\"\r\n\t\t\t\t);\r\n//\t\tString ingredientRuleStr = StringUtils.collectionToDelimitedString(ingredients, \"|\")\r\n//\t\t\t+ \";\";\r\n//\t\tRule ingredientsRule = ruleGrammar.ruleForJSGF(ingredientRuleStr);\r\n//\t\tRuleGrammar recipeGrammar = recognizer.getRuleGrammar(\"recipe\");\r\n//\t\trecipeGrammar.setRule(\"ingredient\", ingredientsRule, true);\r\n\t\tRuleGrammar ingredientGrammar = recognizer.getRuleGrammar(\"ingredient\");\r\n\t\tGrammarLoader.loadWords(\"ingredient\", ingredients, ingredientGrammar);\r\n\r\n//\t\trecipeGrammar.getRule(\"ingredient\");\r\n\t\t\r\n\t\t//ruleGrammar.getRecognizer().getRuleGrammar(s)\r\n\t\tinput.getGrammar().commitChanges();\r\n\t\tif (rule instanceof RuleAlternatives) {\r\n\t\t\tRuleAlternatives alts = (RuleAlternatives) rule;\r\n\t\t\tfor(Rule r: alts.getRules()) {\r\n\t\t\t\tshowRule(r, \"\");\r\n\t\t\t\tif (r instanceof RuleSequence) {\r\n\t\t\t\t\tfor (Rule rs : ((RuleSequence)r).getRules()) {\r\n\t\t\t\t\t\tshowRule(rs, \" \");\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\t//System.out.println(\"Alternatives: \" + r.getRules()\r\n\t\t\r\n//\t\tSystem.out.println(\"Random sentence:\");\r\n//\t\tString randomSentence = input.getGrammar().getRandomSentence();\r\n//\t\tSystem.out.println(\"\\t\" + randomSentence);\r\n\t\tSystem.out.println(\"Parsing...\");\r\n\t\tRuleParse result = ingredientGrammar.parse(\"kale\", \"ingredient\");\r\n\t\tSystem.out.println(\"Parse: \" + result);\r\n\t\t\r\n\t\tWhatWasSaid utterance = null;\r\n\t\tdo {\r\n\t\t\tSystem.out.println(\"Say something:\");\r\n\t\t\tutterance = input.recordUtterance();\r\n\t\t\tSystem.out.println(\"Got utterance: \" + utterance);\r\n\t\t} while (!utterance.getText().equals(\"quit\"));\r\n\t\t\r\n\t\tSystem.out.println(\"Quitting\");\r\n\t\tinput.destroy();\r\n\t}", "public void PrintMe()\r\n\t{\r\n\t\t/*************************************************/\r\n\t\t/* AST NODE TYPE = AST NODE FUNCTION DECLARATION */\r\n\t\t/*************************************************/\r\n\t\tSystem.out.format(\"CALL(%s)\\nWITH:\\n\",funcName);\r\n\r\n\t\t/***************************************/\r\n\t\t/* RECURSIVELY PRINT params + body ... */\r\n\t\t/***************************************/\r\n\t\tif (params != null) params.PrintMe();\r\n\t\t\r\n\t\t/***************************************/\r\n\t\t/* PRINT Node to AST GRAPHVIZ DOT file */\r\n\t\t/***************************************/\r\n\t\tAST_GRAPHVIZ.getInstance().logNode(\r\n\t\t\tSerialNumber,\r\n\t\t\tString.format(\"CALL(%s)\\nWITH\",funcName));\r\n\t\t\r\n\t\t/****************************************/\r\n\t\t/* PRINT Edges to AST GRAPHVIZ DOT file */\r\n\t\t/****************************************/\r\n\t\tif (params != null) AST_GRAPHVIZ.getInstance().logEdge(SerialNumber,params.SerialNumber);\t\t\r\n\t}", "public String getReadableSolution() {\n StringBuilder solution = new StringBuilder();\n\n solution.append(\"WORKFLOW_IN:{\");\n int i = 0;\n for (TypeNode workflowInput : this.workflowInputTypeStates) {\n solution.append(workflowInput.toString());\n if (++i < this.workflowInputTypeStates.size()) {\n solution.append(\", \");\n }\n }\n solution.append(\"} |\");\n\n for (ModuleNode currTool : this.moduleNodes) {\n solution.append(\" IN:{\");\n i = 0;\n for (TypeNode toolInput : currTool.getInputTypes()) {\n if (!toolInput.isEmpty()) {\n if (i++ > 1) {\n solution.append(\", \");\n }\n solution.append(toolInput.toString());\n }\n }\n solution.append(\"} \").append(currTool.toString());\n solution.append(\" OUT:{\");\n i = 0;\n for (TypeNode toolOutput : currTool.getOutputTypes()) {\n if (!toolOutput.isEmpty()) {\n if (i++ > 1) {\n solution.append(\", \");\n }\n solution.append(toolOutput.toString());\n }\n }\n solution.append(\"} |\");\n }\n i = 0;\n solution.append(\"WORKFLOW_OUT:{\");\n for (TypeNode workflowOutput : this.workflowOutputTypeStates) {\n solution.append(workflowOutput.toString());\n if (++i < this.workflowOutputTypeStates.size()) {\n solution.append(\", \");\n }\n }\n solution.append(\"}\");\n\n return solution.toString();\n }", "public String toString() {\r\n\t\tStringBuilder buffer = new StringBuilder();\r\n\t\t\r\n\t\tbuffer.append(\"<\" + xmltag + \" subgraph=\\\"\" + subgraph + \"\\\">\" + newline);\r\n\t\t\r\n\t\tfor (Variable currentVariable : variables) {\r\n\t\t\tbuffer.append(\"\\t\\t\\t\\t\\t\" + currentVariable);\r\n\t\t}\r\n\t\t\r\n\t\tbuffer.append(\"\\t\\t\\t\\t</\" + xmltag + \">\" + newline);\r\n\t\t\r\n\t\treturn buffer.toString();\r\n\t}", "public void PrintMe()\r\n\t{\r\n\t\t/********************************/\r\n\t\t/* AST NODE TYPE = AST EXP METHOD */\r\n\t\t/********************************/\r\n\t\tSystem.out.format(\"EXP\\nMETHOD\\n\");\r\n\r\n\t\t/*************************************/\r\n\t\t/* RECURSIVELY PRINT HEAD + TAIL ... */\r\n\t\t/*************************************/\r\n\t\tif (var != null) var.PrintMe();\r\n\r\n\t\t/**********************************/\r\n\t\t/* PRINT to AST GRAPHVIZ DOT file */\r\n\t\t/**********************************/\r\n\t\tAST_GRAPHVIZ.getInstance().logNode(\r\n\t\t\tSerialNumber,\r\n\t\t\tString.format(\"EXP\\nMETHOD\\n\"));\r\n\t\t\r\n\t\t/****************************************/\r\n\t\t/* PRINT Edges to AST GRAPHVIZ DOT file */\r\n\t\t/****************************************/\r\n\t\tif (var != null) AST_GRAPHVIZ.getInstance().logEdge(SerialNumber,var.SerialNumber);\r\n\t}", "private String toRules(){\n\n if (numInstances() == 0)\n\treturn \"No Rules (Empty Exemplar)\";\n\n String s = \"\", sep = \"\";\n\t\n for(int i = 0; i < numAttributes(); i++){\n\t \n\tif(i == classIndex())\n\t continue;\n\t \n\tif(attribute(i).isNumeric()){\n\t if(m_MaxBorder[i] != m_MinBorder[i]){\n\t s += sep + m_MinBorder[i] + \"<=\" + attribute(i).name() + \"<=\" + m_MaxBorder[i];\n\t } else {\n\t s += sep + attribute(i).name() + \"=\" + m_MaxBorder[i];\n\t }\n\t sep = \" ^ \";\n\t \n\t} else {\n\t s += sep + attribute(i).name() + \" in {\";\n\t String virg = \"\";\n\t for(int j = 0; j < attribute(i).numValues() + 1; j++){\n\t if(m_Range[i][j]){\n\t s+= virg;\n\t if(j == attribute(i).numValues())\n\t\ts += \"?\";\n\t else\n\t\ts += attribute(i).value(j);\n\t virg = \",\";\n\t }\n\t }\n\t s+=\"}\";\n\t sep = \" ^ \";\n\t}\t \n }\n s += \" (\"+numInstances() +\")\";\n return s;\n }", "public void PrintMe(){\r\n\t\t/* AST NODE TYPE = AST SUBSCRIPT VAR */\r\n\t\t/*************************************/\r\n\t\tSystem.out.print(\"AST NODE PAREN EXP\\n\");\r\n \r\n\t\t\r\n\t\t/***************************************/\r\n\t\t/* PRINT Node to AST GRAPHVIZ DOT file */\r\n\t\t/***************************************/\r\n\t\tAST_GRAPHVIZ.getInstance().logNode(\r\n\t\t\tSerialNumber,\r\n\t\t\t\"(exp)\");\r\n\t\tif (e != null) AST_GRAPHVIZ.getInstance().logEdge(SerialNumber,e.SerialNumber);\r\n \r\n }" ]
[ "0.6238588", "0.6069632", "0.60518706", "0.60330755", "0.59421134", "0.59068185", "0.5893124", "0.5825443", "0.5775355", "0.57602996", "0.57094747", "0.56555", "0.5636776", "0.5604189", "0.54738367", "0.53768826", "0.5299784", "0.5283195", "0.5272491", "0.5257026", "0.51770514", "0.51540375", "0.5135855", "0.5076395", "0.5074395", "0.50678706", "0.5064538", "0.5043491", "0.50300056", "0.50291914", "0.49552563", "0.49459106", "0.4943837", "0.4907964", "0.49053177", "0.4886569", "0.48514733", "0.4827051", "0.48213288", "0.48174787", "0.48116788", "0.4808188", "0.4801488", "0.48005375", "0.47951922", "0.47874677", "0.47859904", "0.4785973", "0.47848794", "0.47839245", "0.47687742", "0.47643772", "0.47628275", "0.47564197", "0.47496", "0.47382736", "0.47382632", "0.4738103", "0.4737531", "0.4733365", "0.47310278", "0.47200796", "0.47183058", "0.47141916", "0.47133675", "0.4707976", "0.46938893", "0.46807295", "0.46719795", "0.46684524", "0.46641135", "0.4654353", "0.46516228", "0.46511707", "0.464014", "0.46163014", "0.46111438", "0.46103662", "0.4603221", "0.45944965", "0.45929533", "0.45848128", "0.4583986", "0.45776814", "0.45755258", "0.45613545", "0.45603815", "0.4554321", "0.45471632", "0.4545569", "0.4545191", "0.4544439", "0.45434517", "0.45417354", "0.45338675", "0.45310763", "0.45303282", "0.45237052", "0.4516489", "0.45026943" ]
0.73188543
0
Prints the binary expression in prefix notation. Calls prefix method for left and right. Calls operator's getArithmeticOp method to get the operator. i.e. operator left right
public void prefix() { System.out.print(operator.getArithmeticOp() + " "); left.prefix(); right.prefix(); System.out.println(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\n public String toString() { return '(' + left.toString() + ' ' + operation.toString() + ' ' + right.toString() + ')'; }", "@Override\n public String toString() { return '(' + left.toString() + ' ' + operation.toString() + ' ' + right.toString() + ')'; }", "public String toString () {\n return \"(+ \" + leftOperand + \" \" + rightOperand + \")\";\n }", "public void toGrammar() {\n System.out.println(\"<binary_expression> -> <arithmeitc_expression> <arithmetic_op> <arithmetic_expression>\");\n left.toGrammar();\n operator.toGrammar();\n right.toGrammar();\n prefix();\n }", "static boolean binaryOperator(PsiBuilder b, int l) {\n if (!recursion_guard_(b, l, \"binaryOperator\")) return false;\n boolean r;\n r = multiplicativeOperator(b, l + 1);\n if (!r) r = additiveOperator(b, l + 1);\n if (!r) r = shiftOperator(b, l + 1);\n if (!r) r = relationalOperator(b, l + 1);\n if (!r) r = consumeToken(b, EQ_EQ);\n if (!r) r = bitwiseOperator(b, l + 1);\n return r;\n }", "public interface Unary extends Expr \n{\n /** Unary expression operator. */\n public static enum Operator {\n BIT_NOT (\"~\", true),\n NEG (\"-\", true),\n POST_INC (\"++\", false),\n POST_DEC (\"--\", false),\n PRE_INC (\"++\", true),\n PRE_DEC (\"--\", true),\n POS (\"+\", true),\n NOT (\"!\", true),\n CARET (\"^\", true),\n BAR (\"|\", true),\n AMPERSAND(\"&\", true),\n STAR (\"*\", true),\n SLASH (\"/\", true),\n PERCENT (\"%\", true);\n\n protected boolean prefix;\n protected String name;\n\n private Operator(String name, boolean prefix) {\n this.name = name;\n this.prefix = prefix;\n }\n\n /** Returns true of the operator is a prefix operator, false if\n * postfix. */\n public boolean isPrefix() { return prefix; }\n\n @Override public String toString() { return name; }\n }\n\n public static final Operator BIT_NOT = Operator.BIT_NOT;\n public static final Operator NEG = Operator.NEG;\n public static final Operator POST_INC = Operator.POST_INC;\n public static final Operator POST_DEC = Operator.POST_DEC;\n public static final Operator PRE_INC = Operator.PRE_INC;\n public static final Operator PRE_DEC = Operator.PRE_DEC;\n public static final Operator POS = Operator.POS;\n public static final Operator NOT = Operator.NOT;\n public static final Operator CARET = Operator.CARET;\n public static final Operator BAR = Operator.BAR;\n public static final Operator AMPERSAND = Operator.AMPERSAND;\n public static final Operator STAR = Operator.STAR;\n public static final Operator SLASH = Operator.SLASH;\n public static final Operator PERCENT = Operator.PERCENT;\n\n /** The sub-expression on that to apply the operator. */\n Expr expr();\n /** Set the sub-expression on that to apply the operator. */\n Unary expr(Expr e);\n\n /** The operator to apply on the sub-expression. */\n Operator operator();\n /** Set the operator to apply on the sub-expression. */\n Unary operator(Operator o);\n}", "@Override public String toDot() {\r\n String middle = \"\";\r\n switch(operator) {\r\n case AND : \r\n middle = \"&amp;\";\r\n break;\r\n case NOR :\r\n case OR : \r\n middle = \"&or;\";\r\n break;\r\n case IMPLIES : \r\n middle = \"=&gt;\";\r\n break;\r\n default : assert false;\r\n }\r\n middle = left.toDot() + \" \" + middle + \" \" + right.toDot();\r\n if ( operator == Token.NOR )\r\n return \"&not; (\"+middle+\")\";\r\n else\r\n return middle;\r\n }", "public String operator() {\n return this.operator;\n }", "public String toString() {\n return operator + \"(\" + argument + \")\";\n }", "public String operator( String op);", "@Override\n public String toString() {\n Helpers f = new Helpers();\n Expression left = super.getLeft();\n Expression right = super.getRight();\n\n if (super.isBonus()) {\n // x * y -> xy\n if (left instanceof Var && right instanceof Var) {\n return \"(\" + left.toString() + \"\" + right.toString() + \")\";\n }\n // 4 * x -> 4x\n if (right instanceof Var) {\n return \"(\" + left.toString() + \"\" + right.toString() + \")\";\n }\n // x * 4 -> 4x\n if (left instanceof Var) {\n return \"(\" + right.toString() + \"\" + left.toString() + \")\";\n }\n // 4 * (x^2) -> 4(x^2)\n if (right instanceof Pow) {\n return \"(\" + left.toString() + \"\" + right.toString() + \")\";\n }\n // 4 * (xy) -> 4xy\n if (right instanceof Mult) {\n if (((Mult) right).getLeft() instanceof Var && ((Mult) right).getRight() instanceof Var) {\n return \"(\" + left.toString() + \"\" + f.removeOuterParentheses(right.toString()) + \")\";\n }\n }\n }\n return \"(\" + left.toString() + \" * \" + right.toString() + \")\";\n }", "private void infix(ExpressionNodes root, StringBuilder sb)\n\t {\t\n\t \t\n\t \tif (root.left != null) // if there is a left child\n\t \t{ \n\t \t\tinfix(root.left, sb); // run recursive method \n\t \t}\n\t \t\n\t \t// add the string of this node to the the string builder \n\t \tsb.append(root.data);\n\t \t\n\t \t// add a space in between nodes for clarity.\n\t \tsb.append(\" \");\n\t \t\n\t \t\n\t \tif (root.right != null) // if there is a right child\n\t \t{ \n\t \t\tinfix(root.right, sb); // run recursive method \n\t \t}\n\t \t\n\t }", "public String toString(){\n\t\tString out=\"\";\n\t\tif (type == \"op\"){\n\t\t\treturn out + operand;\n\t\t}\n\t\telse{\n\t\t\treturn out + value ;\n\t\t}\n\t}", "@Override\n public String toString(int depth) {\n if (depth <= 0) return \"\";\n String sEO = \"\" ;\n if (this.subExpressionOf != null) {\n sEO = Strings.indent(2,\n \"\\nsubExpressionOf: \" +\n Strings.indent(2, this.subExpressionOf.toString(1))) ;} ;\n return \"\\n*OpApplNode: \" + operator.getName() + \" \" + super.toString(depth+1)\n + \" errors: \" + (errors != null ? \"non-null\" : \"null\")\n + toStringBody(depth) + sEO ;\n }", "public static boolean prefixOperator(PsiBuilder b, int l) {\n if (!recursion_guard_(b, l, \"prefixOperator\")) return false;\n if (!nextTokenIs(b, \"<prefix operator>\", BIN_NOT, MINUS,\n MINUS_MINUS, NOT, PLUS, PLUS_PLUS)) return false;\n boolean r;\n Marker m = enter_section_(b, l, _NONE_, PREFIX_OPERATOR, \"<prefix operator>\");\n r = consumeToken(b, MINUS);\n if (!r) r = consumeToken(b, PLUS);\n if (!r) r = consumeToken(b, MINUS_MINUS);\n if (!r) r = consumeToken(b, PLUS_PLUS);\n if (!r) r = consumeToken(b, NOT);\n if (!r) r = consumeToken(b, BIN_NOT);\n exit_section_(b, l, m, r, false, null);\n return r;\n }", "public String toString() {\n return leftNumber + \" + \" + rightNumber;\n }", "public final SymbolNode getOperator() { return this.operator; }", "java.lang.String getOperator();", "private void ShowRep(Integer[] op) {\n System.out.print(\" \" + this.opCodeStrings[op[0]]);\n for (int i = 1; i < 13; i++) {\n if ((i - 1) % 4 == 0)\n System.out.print(\" | \");\n if (op[i] != null)\n System.out.print(\" \" + op[i]);\n else\n System.out.print(\" - \");\n }\n System.out.println();\n }", "@Override\n public String toString() {\n return op.toString();\n }", "private void processOperator() {\r\n\t\tif (expression[currentIndex] == '*') {\r\n\t\t\ttoken = new Token(TokenType.OPERATOR, Constants.AND_STRING);\r\n\t\t} else if (expression[currentIndex] == '+') {\r\n\t\t\ttoken = new Token(TokenType.OPERATOR, Constants.OR_STRING);\r\n\t\t} else if (expression[currentIndex] == '!') {\r\n\t\t\ttoken = new Token(TokenType.OPERATOR, Constants.NOT_STRING);\r\n\t\t} else {\r\n\t\t\ttoken = new Token(TokenType.OPERATOR, Constants.XOR_STRING);\r\n\t\t\t// xor operator has 2 characters more than any other operator.\r\n\t\t\tcurrentIndex += 2;\r\n\t\t}\r\n\r\n\t\tcurrentIndex++;\r\n\t}", "private void jetBinopExprStr(){\n\t\tBinopExpr binopExpr = (BinopExpr) rExpr;\n\t\tValue op1 = binopExpr.getOp1();\n\t\tValue op2 = binopExpr.getOp2();\n\t\tZ3Type op1Z3Type = Z3MiscFunctions.v().z3Type(op1.getType());\n\t\tZ3Type op2Z3Type = Z3MiscFunctions.v().z3Type(op2.getType());\n\t\tStringBuilder sb = new StringBuilder();\n\t\t\n\t\tBinopExprType binopType = Z3MiscFunctions.v().getBinopExprType(binopExpr);\n\t\tswitch(binopType){\n\t\t//[start]ADD\n\t\tcase ADD:\n\t\t\t//add_expr = immediate \"+\" immediate;\n\t\t\t//immediate = constant | local;\n\t\t\t//only Int, Real, String can ADD\n\t\t\t//Exceptional Cases: \"084\" + 42; we exclude them\n\t\t\tassert((op1Z3Type == Z3Type.Z3String && op2Z3Type == Z3Type.Z3String) ||\n\t\t\t\t\t(op1Z3Type != Z3Type.Z3String && op2Z3Type != Z3Type.Z3String));\n\t\t\tif(op1Z3Type == Z3Type.Z3String ){\n\t\t\t\t//( Concat \"te\" y1 )\n\t\t\t\tsb.append(\"( Concat \");\n\t\t\t}else{\n\t\t\t\t//(+ 2 i2)\n\t\t\t\tsb.append(\"(+ \");\n\t\t\t}\n\t\t\tif(op1 instanceof Local){\n\t\t\t\tsb.append(fileGenerator.getRenameOf(op1, false, this.stmtIdx));\n\t\t\t}else{\n\t\t\t\tsb.append(op1.toString());\n\t\t\t}\n\t\t\tsb.append(\" \");\n\t\t\tif(op2 instanceof Local){\n\t\t\t\tsb.append(fileGenerator.getRenameOf(op2, false, this.stmtIdx));\n\t\t\t}else{\n\t\t\t\tsb.append(op2.toString());\n\t\t\t}\n\t\t\tsb.append(\" )\");\n\t\t\tthis.exprStr = sb.toString();\n\t\t\tbreak;\n\t\t//[end]ADD\n\t\tcase AND:\n\t\t\t//and_expr = immediate \"&\" immediate;\n\t\t\t//TODO\n\t\t\t//assert(false) : \"AND Expr\";\n\t\t\tbreak;\n\t\t//[start] DIV\n\t\tcase DIV:\n\t\t\t//div_expr = immediate \"/\" immediate;\n\t\t\t//(div a b) integer division\n\t\t\t//(/ a b) float division\n\t\t\tif(op1Z3Type == Z3Type.Z3Real || op2Z3Type == Z3Type.Z3Real){\n\t\t\t\tsb.append(\"(/ \");\n\t\t\t}else{\n\t\t\t\tsb.append(\"(div \");\n\t\t\t}\n\t\t\tif(op1 instanceof Local){\n\t\t\t\tsb.append(fileGenerator.getRenameOf(op1, false, this.stmtIdx));\n\t\t\t}else{\n\t\t\t\tsb.append(op1.toString());\n\t\t\t}\n\t\t\tsb.append(\" \");\n\t\t\tif(op2 instanceof Local){\n\t\t\t\tsb.append(fileGenerator.getRenameOf(op2, false, this.stmtIdx));\n\t\t\t}else{\n\t\t\t\tsb.append(op2.toString());\n\t\t\t}\n\t\t\tsb.append(\")\");\n\t\t\tthis.exprStr = sb.toString();\n\t\t\tbreak;\n\t\t//[end] DIV\n\t\t//[start] EQ\n\t\tcase EQ:\n\t\t\t//eq_expr = immediate \"==\" immediate;\n\t\t\t//b = r1 == r2\n\t\t\t//(assert (= b (= r1 r2)))\n\t\t\tsb.append(\"(= \");\n\t\t\tif(op1 instanceof Local){\n\t\t\t\tsb.append(fileGenerator.getRenameOf(op1, false, this.stmtIdx));\n\t\t\t}else{\n\t\t\t\tsb.append(op1.toString());\n\t\t\t}\n\t\t\tsb.append(\" \");\n\t\t\tif(op2 instanceof Local){\n\t\t\t\tsb.append(fileGenerator.getRenameOf(op2, false, this.stmtIdx));\n\t\t\t}else{\n\t\t\t\tsb.append(op2.toString());\n\t\t\t}\n\t\t\tsb.append(\")\");\n\t\t\tthis.exprStr = sb.toString();\n\t\t\tbreak;\n\t\t//[end] EQ\n\t\t//[start] GE\n\t\tcase GE:\n\t\t\t//ge_expr = immediate \">=\" immediate;\n\t\t\t//b = r1 >= r2\n\t\t\t//(assert (= b (>= r1 r2)))\n\t\t\tsb.append(\"(>= \");\n\t\t\tif(op1 instanceof Local){\n\t\t\t\tsb.append(fileGenerator.getRenameOf(op1, false, this.stmtIdx));\n\t\t\t}else{\n\t\t\t\tsb.append(op1.toString());\n\t\t\t}\n\t\t\tsb.append(\" \");\n\t\t\tif(op2 instanceof Local){\n\t\t\t\tsb.append(fileGenerator.getRenameOf(op2, false, this.stmtIdx));\n\t\t\t}else{\n\t\t\t\tsb.append(op2.toString());\n\t\t\t}\n\t\t\tsb.append(\")\");\n\t\t\tthis.exprStr = sb.toString();\n\t\t\tbreak;\n\t\t//[end] GE\n\t\t//[start] GT\n\t\tcase GT:\n\t\t\t//gt_expr = immediate \">\" immediate;\n\t\t\t//b = r1 > r2\n\t\t\t//(assert (= b (> r1 r2)))\n\t\t\tsb.append(\"(> \");\n\t\t\tif(op1 instanceof Local){\n\t\t\t\tsb.append(fileGenerator.getRenameOf(op1, false, this.stmtIdx));\n\t\t\t}else{\n\t\t\t\tsb.append(op1.toString());\n\t\t\t}\n\t\t\tsb.append(\" \");\n\t\t\tif(op2 instanceof Local){\n\t\t\t\tsb.append(fileGenerator.getRenameOf(op2, false, this.stmtIdx));\n\t\t\t}else{\n\t\t\t\tsb.append(op2.toString());\n\t\t\t}\n\t\t\tsb.append(\")\");\n\t\t\tthis.exprStr = sb.toString();\n\t\t\tbreak;\n\t\t//[end] GT\n\t\t//[start] LE\n\t\tcase LE:\n\t\t\t//le_expr = immediate \"<=\" immediate;\n\t\t\t//b = r1 <= r2\n\t\t\t//(assert (= b (<= r1 r2)))\n\t\t\tsb.append(\"(<= \");\n\t\t\tif(op1 instanceof Local){\n\t\t\t\tsb.append(fileGenerator.getRenameOf(op1, false, this.stmtIdx));\n\t\t\t}else{\n\t\t\t\tsb.append(op1.toString());\n\t\t\t}\n\t\t\tsb.append(\" \");\n\t\t\tif(op2 instanceof Local){\n\t\t\t\tsb.append(fileGenerator.getRenameOf(op2, false, this.stmtIdx));\n\t\t\t}else{\n\t\t\t\tsb.append(op2.toString());\n\t\t\t}\n\t\t\tsb.append(\")\");\n\t\t\tthis.exprStr = sb.toString();\n\t\t\tbreak;\n\t\t//[end] LE\n\t\t//[start] LT\n\t\tcase LT:\n\t\t\t//lt_expr = immediate \"<\" immediate;\n\t\t\t//b = r1 < r2\n\t\t\t//(assert (= b (< r1 r2)))\n\t\t\tsb.append(\"(< \");\n\t\t\tif(op1 instanceof Local){\n\t\t\t\tsb.append(fileGenerator.getRenameOf(op1, false, this.stmtIdx));\n\t\t\t}else{\n\t\t\t\tsb.append(op1.toString());\n\t\t\t}\n\t\t\tsb.append(\" \");\n\t\t\tif(op2 instanceof Local){\n\t\t\t\tsb.append(fileGenerator.getRenameOf(op2, false, this.stmtIdx));\n\t\t\t}else{\n\t\t\t\tsb.append(op2.toString());\n\t\t\t}\n\t\t\tsb.append(\")\");\n\t\t\tthis.exprStr = sb.toString();\n\t\t\tbreak;\n\t\t//[end] LT\n\t\t//[start] MUL\n\t\tcase MUL:\n\t\t\t//mul_expr = immediate \"*\" immediate;\n\t\t\t//(* op1 op2)\n\t\t\tsb.append(\"(* \");\n\t\t\tif(op1 instanceof Local){\n\t\t\t\tsb.append(fileGenerator.getRenameOf(op1, false, this.stmtIdx));\n\t\t\t}else{\n\t\t\t\tsb.append(op1.toString());\n\t\t\t}\n\t\t\tsb.append(\" \");\n\t\t\tif(op2 instanceof Local){\n\t\t\t\tsb.append(fileGenerator.getRenameOf(op2, false, this.stmtIdx));\n\t\t\t}else{\n\t\t\t\tsb.append(op2.toString());\n\t\t\t}\n\t\t\tsb.append(\")\");\n\t\t\tthis.exprStr = sb.toString();\n\t\t\tbreak;\n\t\t//[end] MUL\n\t\t//[start] NE\n\t\tcase NE:\n\t\t\t//ne_expr = immediate \"!=\" immediate;\n\t\t\t//(not (= op1 op2))\n\t\t\tsb.append(\"(not (= \");\n\t\t\tif(op1 instanceof Local){\n\t\t\t\tsb.append(fileGenerator.getRenameOf(op1, false, this.stmtIdx));\n\t\t\t}else{\n\t\t\t\tsb.append(op1.toString());\n\t\t\t}\n\t\t\tsb.append(\" \");\n\t\t\tif(op2 instanceof Local){\n\t\t\t\tsb.append(fileGenerator.getRenameOf(op2, false, this.stmtIdx));\n\t\t\t}else{\n\t\t\t\tsb.append(op2.toString());\n\t\t\t}\n\t\t\tsb.append(\"))\");\n\t\t\tthis.exprStr = sb.toString();\n\t\t\tbreak;\n\t\t//[end] NE\n\t\tcase OR:\n\t\t\t//or_expr = immediate \"|\" immediate;\n\t\t\t//TODO\n\t\t\tassert(false) : \"OR Expr\";\n\t\t\tbreak;\n\t\t//[start] REM\n\t\tcase REM:\n\t\t\t//rem_expr = immediate \"%\" immediate;\n\t\t\t//(rem op1 op2)\n\t\t\tsb.append(\"(rem \");\n\t\t\tif(op1 instanceof Local){\n\t\t\t\tsb.append(fileGenerator.getRenameOf(op1, false, this.stmtIdx));\n\t\t\t}else{\n\t\t\t\tsb.append(op1.toString());\n\t\t\t}\n\t\t\tsb.append(\" \");\n\t\t\tif(op2 instanceof Local){\n\t\t\t\tsb.append(fileGenerator.getRenameOf(op2, false, this.stmtIdx));\n\t\t\t}else{\n\t\t\t\tsb.append(op2.toString());\n\t\t\t}\n\t\t\tsb.append(\")\");\n\t\t\tthis.exprStr = sb.toString();\n\t\t\tbreak;\n\t\t//[end] REM\n\t\t//[start] SUB\n\t\tcase SUB:\n\t\t\t//sub_expr = immediate \"-\" immediate;\n\t\t\t//(- op1 op2)\n\t\t\tsb.append(\"(- \");\n\t\t\tif(op1 instanceof Local){\n\t\t\t\tsb.append(fileGenerator.getRenameOf(op1, false, this.stmtIdx));\n\t\t\t}else{\n\t\t\t\tsb.append(op1.toString());\n\t\t\t}\n\t\t\tsb.append(\" \");\n\t\t\tif(op2 instanceof Local){\n\t\t\t\tsb.append(fileGenerator.getRenameOf(op2, false, this.stmtIdx));\n\t\t\t}else{\n\t\t\t\tsb.append(op2.toString());\n\t\t\t}\n\t\t\tsb.append(\")\");\n\t\t\tthis.exprStr = sb.toString();\n\t\t\tbreak;\n\t\t//[end] SUB\n\t\t}\n\t}", "String getOperator();", "@Override\n\tpublic String visitExpr(MicroParser.ExprContext ctx) {\n\t\tString prefix = visit(ctx.expr_prefix());\n\t\tString expr = prefix + visit(ctx.term());\n\t\t\n\t\t//System.out.println(\"in visit expr: \"+expr);\n\t\t//System.out.println(\"in visit expr: prefix is: \"+prefix);\n\t\tif((prefix.contentEquals(\"\"))) return expr;\n\t\tString op1, op2, result;\n\t\tString type = currentType;\n\t\tString[] ids = expr.split(\"\\\\-|\\\\+\");\n\t List<String> operands = new ArrayList<String>();\n\t List<Character> addops = new ArrayList<Character>();\n\t \n\t for(int i=0;i<expr.length();i++) {\n\t \tif(expr.charAt(i)=='+' || expr.charAt(i)=='-')\n\t \t\taddops.add(expr.charAt(i));\n\t }\n\t //create a list of addops\n\t \n\t //create a list of operands \n\t for(String i:ids) \n\t \t operands.add(i);\n\t \n\t op1 = operands.get(0);\n\t op2 = operands.get(1);\n\t temp = new Temporary(type);\n\t result = temp.fullName;\n\t tempList.addT(temp);\n\t //System.out.println(\"in visit expr, ops are: \"+op1+\" \"+ op2);\n\t //System.out.println(\"in visit expr, result is: \"+ result);\n\t if(addops.get(0)=='+') {\n\t \tglobalIR.addStmt(IRStatement.generateArithmetic(type, \"ADD\", op1, op2, result));\n\t \toperands.remove(0); operands.remove(0); addops.remove(0);\n\t }\n\t \t\n\t else {\n\t \tglobalIR.addStmt(IRStatement.generateArithmetic(type, \"SUB\", op1, op2, result));\n\t \toperands.remove(0); operands.remove(0); addops.remove(0);\n\t }\n\t \n\t \t\n\t if(operands.size()==0) return result;\n\t \n\t for(int i=0; i<operands.size();i++) {\n\t \top1 = result;\n\t \top2 = operands.get(i);\n\t \ttemp = new Temporary(type);\n\t \tresult = temp.fullName;\n\t \ttempList.addT(temp);\n\t \tif(addops.get(0)=='+') {\n\t\t \tglobalIR.addStmt(IRStatement.generateArithmetic(type, \"ADD\", op1, op2, result));\n\t\t \taddops.remove(0);\n\t \t}\n\t\t \t\n\t\t else {\n\t\t \tglobalIR.addStmt(IRStatement.generateArithmetic(type, \"SUB\", op1, op2, result));\n\t\t \taddops.remove(0);\n\t\t }\n\t\t \t\n\t }\n\t return result; \n\t\t\n\t}", "@Override String toDot() {\r\n switch ( operator ) {\r\n case EQUALS_PREFIX :\r\n case EQUALS :\r\n return left.toDot() + \" = \" + right.toDot();\r\n case NEQ :\r\n return left.toDot() + \" &ne; \" + right.toDot();\r\n case GE : \r\n return left.toDot() + \" &ge; \" + right.toDot();\r\n case GT : \r\n return left.toDot() + \" &gt; \" + right.toDot(); \r\n case LE :\r\n return left.toDot() + \" &le; \" + right.toDot();\r\n case LT : \r\n return left.toDot() + \" &lt; \" + right.toDot();\r\n }\r\n assert false:operator;\r\n return null;\r\n }", "private void Operation(String operator, String x, String y){\n\t\tswitch(operator){\r\n\t\t\tcase \"+\":\r\n\t\t\t\tSystem.out.print(\"Result: \" + addition(x, y));\r\n\t\t\t\tbreak;\r\n\r\n\t\t\tcase \"-\":\r\n\t\t\t\tSystem.out.print(\"Result: \" + substraction(x, y));\r\n\t\t\t\tbreak;\r\n\r\n\t\t\tcase \"*\":\r\n\t\t\t\tSystem.out.print(\"Result: \" + multiplication(x, y));\r\n\t\t\t\tbreak;\r\n\r\n\t\t\tcase \"/\":\r\n\t\t\t\tSystem.out.print(\"Result: \" + division(x, y));\r\n\t\t\t\tbreak;\r\n\r\n\t\t\t\tdefault:\r\n\t\t\t\tnotOperation = true;\r\n\r\n\t\t}\r\n\t}", "private StringBuilder getOperand() {\r\n\t\tif (\"\".equals(operator)) {\r\n\t\t\treturn firstNumber;\r\n\t\t} else {\r\n\t\t\treturn secondNumber;\r\n\t\t}\r\n\t}", "public void infixLeft(TokenType token, int precedence) {\n register(token, new BinaryOperatorParselet(precedence, false));\n }", "public static void show(String num1, String num2,\n\tString result, char operator) {\n\t\t// set an appropriate length on numbers and result\n\t\tint len1 = num1.length();\n\t\tint len2 = num2.length();\n\t\tint len = resultat.length();\n\t\tint maxLen = Math.max(Math.max(len1, len2), len);\n\t\tnum1 = setLen(num1, maxLen - len1);\n\t\tnum2 = setLen(num2, maxLen - len2);\n\t\tresult = setLen(result, maxLen - len);\n\t\t// show the expression\n\t\tout.println(\" \" + num1);\n\t\tout.println(\" \" + operator + \" \" + num2);\n\t\tfor (int i = 0; i < maxLen + 2; i++)\n\t\tout.print(\" -\");\n\t\tout.println();\n\t\tout.println(\" \" + result + \" \\ n \");\n\t}", "private CodeFragment generateBinOPinstruction(String op, String type, CodeFragment exprL, CodeFragment exprR) {\n CodeFragment result = new CodeFragment();\n result.addCode(exprL);\n result.addCode(exprR);\n result.setRegister(this.generateNewRegister(false));\n\n result.addCode(String.format(\"%s = %s %s %s, %s\\n\", result.getRegister(), op, type,\n exprL.getRegister(), exprR.getRegister()));\n\n return result;\n }", "public final JavaliParser.expr_return expr() throws RecognitionException {\n\t\tJavaliParser.expr_return retval = new JavaliParser.expr_return();\n\t\tretval.start = input.LT(1);\n\n\t\tObject root_0 = null;\n\n\t\tParserRuleReturnScope leftExpr =null;\n\t\tParserRuleReturnScope op =null;\n\t\tParserRuleReturnScope rightExpr =null;\n\n\t\tRewriteRuleSubtreeStream stream_simpleExpr=new RewriteRuleSubtreeStream(adaptor,\"rule simpleExpr\");\n\t\tRewriteRuleSubtreeStream stream_compOp=new RewriteRuleSubtreeStream(adaptor,\"rule compOp\");\n\n\t\ttry {\n\t\t\t// /home/luca/svn-repos/cd_students/2015ss/master/CD2_A1/src/cd/parser/Javali.g:427:2: (leftExpr= simpleExpr ( -> $leftExpr|op= compOp rightExpr= simpleExpr -> ^( BinaryOp[$op.start, \\\"BinaryOp\\\"] $leftExpr compOp $rightExpr) ) )\n\t\t\t// /home/luca/svn-repos/cd_students/2015ss/master/CD2_A1/src/cd/parser/Javali.g:427:4: leftExpr= simpleExpr ( -> $leftExpr|op= compOp rightExpr= simpleExpr -> ^( BinaryOp[$op.start, \\\"BinaryOp\\\"] $leftExpr compOp $rightExpr) )\n\t\t\t{\n\t\t\tpushFollow(FOLLOW_simpleExpr_in_expr1531);\n\t\t\tleftExpr=simpleExpr();\n\t\t\tstate._fsp--;\n\n\t\t\tstream_simpleExpr.add(leftExpr.getTree());\n\t\t\t// /home/luca/svn-repos/cd_students/2015ss/master/CD2_A1/src/cd/parser/Javali.g:428:3: ( -> $leftExpr|op= compOp rightExpr= simpleExpr -> ^( BinaryOp[$op.start, \\\"BinaryOp\\\"] $leftExpr compOp $rightExpr) )\n\t\t\tint alt25=2;\n\t\t\tint LA25_0 = input.LA(1);\n\t\t\tif ( (LA25_0==70||LA25_0==73||LA25_0==77) ) {\n\t\t\t\talt25=1;\n\t\t\t}\n\t\t\telse if ( (LA25_0==66||(LA25_0 >= 78 && LA25_0 <= 79)||(LA25_0 >= 81 && LA25_0 <= 83)) ) {\n\t\t\t\talt25=2;\n\t\t\t}\n\n\t\t\telse {\n\t\t\t\tNoViableAltException nvae =\n\t\t\t\t\tnew NoViableAltException(\"\", 25, 0, input);\n\t\t\t\tthrow nvae;\n\t\t\t}\n\n\t\t\tswitch (alt25) {\n\t\t\t\tcase 1 :\n\t\t\t\t\t// /home/luca/svn-repos/cd_students/2015ss/master/CD2_A1/src/cd/parser/Javali.g:429:4: \n\t\t\t\t\t{\n\t\t\t\t\t// AST REWRITE\n\t\t\t\t\t// elements: leftExpr\n\t\t\t\t\t// token labels: \n\t\t\t\t\t// rule labels: leftExpr, retval\n\t\t\t\t\t// token list labels: \n\t\t\t\t\t// rule list labels: \n\t\t\t\t\t// wildcard labels: \n\t\t\t\t\tretval.tree = root_0;\n\t\t\t\t\tRewriteRuleSubtreeStream stream_leftExpr=new RewriteRuleSubtreeStream(adaptor,\"rule leftExpr\",leftExpr!=null?leftExpr.getTree():null);\n\t\t\t\t\tRewriteRuleSubtreeStream stream_retval=new RewriteRuleSubtreeStream(adaptor,\"rule retval\",retval!=null?retval.getTree():null);\n\n\t\t\t\t\troot_0 = (Object)adaptor.nil();\n\t\t\t\t\t// 429:4: -> $leftExpr\n\t\t\t\t\t{\n\t\t\t\t\t\tadaptor.addChild(root_0, stream_leftExpr.nextTree());\n\t\t\t\t\t}\n\n\n\t\t\t\t\tretval.tree = root_0;\n\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\tcase 2 :\n\t\t\t\t\t// /home/luca/svn-repos/cd_students/2015ss/master/CD2_A1/src/cd/parser/Javali.g:430:5: op= compOp rightExpr= simpleExpr\n\t\t\t\t\t{\n\t\t\t\t\tpushFollow(FOLLOW_compOp_in_expr1552);\n\t\t\t\t\top=compOp();\n\t\t\t\t\tstate._fsp--;\n\n\t\t\t\t\tstream_compOp.add(op.getTree());\n\t\t\t\t\tpushFollow(FOLLOW_simpleExpr_in_expr1556);\n\t\t\t\t\trightExpr=simpleExpr();\n\t\t\t\t\tstate._fsp--;\n\n\t\t\t\t\tstream_simpleExpr.add(rightExpr.getTree());\n\t\t\t\t\t// AST REWRITE\n\t\t\t\t\t// elements: compOp, leftExpr, rightExpr\n\t\t\t\t\t// token labels: \n\t\t\t\t\t// rule labels: leftExpr, retval, rightExpr\n\t\t\t\t\t// token list labels: \n\t\t\t\t\t// rule list labels: \n\t\t\t\t\t// wildcard labels: \n\t\t\t\t\tretval.tree = root_0;\n\t\t\t\t\tRewriteRuleSubtreeStream stream_leftExpr=new RewriteRuleSubtreeStream(adaptor,\"rule leftExpr\",leftExpr!=null?leftExpr.getTree():null);\n\t\t\t\t\tRewriteRuleSubtreeStream stream_retval=new RewriteRuleSubtreeStream(adaptor,\"rule retval\",retval!=null?retval.getTree():null);\n\t\t\t\t\tRewriteRuleSubtreeStream stream_rightExpr=new RewriteRuleSubtreeStream(adaptor,\"rule rightExpr\",rightExpr!=null?rightExpr.getTree():null);\n\n\t\t\t\t\troot_0 = (Object)adaptor.nil();\n\t\t\t\t\t// 431:4: -> ^( BinaryOp[$op.start, \\\"BinaryOp\\\"] $leftExpr compOp $rightExpr)\n\t\t\t\t\t{\n\t\t\t\t\t\t// /home/luca/svn-repos/cd_students/2015ss/master/CD2_A1/src/cd/parser/Javali.g:431:7: ^( BinaryOp[$op.start, \\\"BinaryOp\\\"] $leftExpr compOp $rightExpr)\n\t\t\t\t\t\t{\n\t\t\t\t\t\tObject root_1 = (Object)adaptor.nil();\n\t\t\t\t\t\troot_1 = (Object)adaptor.becomeRoot((Object)adaptor.create(BinaryOp, (op!=null?(op.start):null), \"BinaryOp\"), root_1);\n\t\t\t\t\t\tadaptor.addChild(root_1, stream_leftExpr.nextTree());\n\t\t\t\t\t\tadaptor.addChild(root_1, stream_compOp.nextTree());\n\t\t\t\t\t\tadaptor.addChild(root_1, stream_rightExpr.nextTree());\n\t\t\t\t\t\tadaptor.addChild(root_0, root_1);\n\t\t\t\t\t\t}\n\n\t\t\t\t\t}\n\n\n\t\t\t\t\tretval.tree = root_0;\n\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\n\t\t\t}\n\n\t\t\t}\n\n\t\t\tretval.stop = input.LT(-1);\n\n\t\t\tretval.tree = (Object)adaptor.rulePostProcessing(root_0);\n\t\t\tadaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);\n\n\t\t}\n\n\t\tcatch (RecognitionException re) {\n\t\t\treportError(re);\n\t\t\tthrow re;\n\t\t}\n\n\t\tfinally {\n\t\t\t// do for sure before leaving\n\t\t}\n\t\treturn retval;\n\t}", "private final boolean IsBinaryOp(String expression, String symbol, String leftExpression, String rightExpression) {\r\n boolean isBinaryOp = false;\r\n if (expression.contains(symbol)) {\r\n int openParanthesisCount = 0;\r\n int closeParanthesisCount = 0;\r\n for (int i = 0; (i < expression.length()); i++) {\r\n String currentChar = expression.substring(i, 1);\r\n if ((currentChar.equals(symbol) \r\n && (openParanthesisCount == closeParanthesisCount))) {\r\n leftExpression = expression.substring(0, i);\r\n rightExpression = expression.substring((i + 1), (expression.length() - (i - 1)));\r\n isBinaryOp = true;\r\n break;\r\n }\r\n else if (currentChar.equals(\"(\")) {\r\n openParanthesisCount++;\r\n }\r\n else if (currentChar.equals(\")\")) {\r\n closeParanthesisCount++;\r\n }\r\n \r\n }\r\n \r\n }\r\n \r\n return isBinaryOp;\r\n }", "public String getLeftOperandString()\r\n {\r\n return leftOperand;\r\n }", "public int operation(int number1,int number2,String operator)", "public String toString() {\n switch (opType) {\n case Plus:\n return \"+\";\n case Minus:\n return \"-\";\n case Multiply:\n return \"*\";\n case Divide:\n return \"/\";\n case Square:\n return \"^\";\n default:\n return null;\n }\n }", "public String toString() {\n\t\tif(left == this && right == this) {\n\t\t\treturn getElementString();\n\t\t}\n\t\telse {\n\t\t\tif(right.right == right && right.noBranchBit == true) {\n\t\t\t\treturn \"(\" + left.toString() + \")\";\n\t\t\t}\n\t\t\telse {\n\t\t\t\treturn \"(\" + left.toString() + \" && \" + right.toString() + \")\";\n\t\t\t}\n\t\t}\n\t}", "public String toString() {\n\treturn \"(\" + left.toString() + \" * \" +\n\t right.toString() + \")\";\n }", "private void prefix(ExpressionNodes root, StringBuilder sb)\n\t {\n\t \t\n\t \t// add the string of this node to the the string builder \n\t \tsb.append(root.data);\n\t \t\n\t \t// add a space in between nodes for clarity.\n\t \tsb.append(\" \");\n\t \t\n\t \tif (root.left != null) // if there is a left child\n\t \t{ \n\t \t\tprefix(root.left, sb); // run recursive method \n\t \t}\n\t \t\n\t \tif (root.right != null) // if there is a right child\n\t \t{ \n\t \t\tprefix(root.right, sb); // run recursive method \n\t \t}\n\t \t\n\t }", "public String getOperator()\r\n {\r\n return operator;\r\n }", "public String getOperator() {\n return operator;\n }", "@Override\n\tpublic void VisitBinaryNode(BinaryOperatorNode Node) {\n\n\t}", "public Operator operator() {\n\treturn this.op;\n }", "public R visit(Operator n) {\n R _ret=null;\n int which = n.f0.which;\n String s = \" \";\n switch (which)\n {\n case 0 : {s=\"LT\"; break;}\n case 1 : {s= \"PLUS\"; break;}\n case 2 : {s= \"MINUS\";break;}\n case 3 : {s= \"TIMES\"; break;}\n }\n \t return (R)s;\n }", "@Override\n public NodeType ExecuteOperation()\n {\n //if the first child is an operator\n if(this.childNodes[0].isOperator==true)\n {\n BasicOperator basicOperator=(BasicOperator)this.childNodes[0]; \n if(basicOperator.operands==1)\n {\n UnaryOperator unaryOperator=(UnaryOperator)childNodes[0];\n return unaryOperator.PerformOperation(childNodes[1]);\n }\n else if(basicOperator.operands==2)\n {\n BinaryOperator binaryOperator=(BinaryOperator)childNodes[0];\n return binaryOperator.PerformOperation(childNodes[1], childNodes[2]);\n }\n else if(basicOperator.operands==3)\n {\n TernaryOperator ternaryOperator=(TernaryOperator)childNodes[0];\n return ternaryOperator.PerformOperation(childNodes[1], childNodes[2], childNodes[3]);\n }\n }\n //if not an operator\n else\n {\n return this.childNodes[0].ExecuteOperation();\n }\n return null;\n }", "protected void operation(String operator){\n if (this.tail<2){\n this.arr[tail++] = this.value;\n this.arr[tail++] = operator;\n } else{\n if (this.peek() != \")\"){\n this.arr[this.tail++] = this.value;\n }\n this.arr[this.tail++] = operator;\n }\n this.value=\"\"; // reset tracking variables\n this.decimalUsed = false;\n }", "@Override\n\tpublic String toString() {\n\t\treturn super.toString() + \" \" + op1 + \" + \" + op2 + \" to \" + result;\n\t}", "public java.lang.String getOperator_lx() {\r\n return localOperator_lx;\r\n }", "public java.lang.String getOperator_lx() {\r\n return localOperator_lx;\r\n }", "String getOp();", "String getOp();", "String getOp();", "public String getOperator() {\n return operator;\n }", "public String getOperator() {\n return operator;\n }", "public String getOperator() {\n return operator;\n }", "public String getOperator() {\n return operator;\n }", "public String getOperator() {\n return operator;\n }", "public String getOperator() {\n return operator;\n }", "LogicExpression getLeft();", "public interface BinaryOperatorCriteriaExpression<T> extends CriteriaExpression<T> {\n\t/**\n\t * Get the right-hand operand.\n\t *\n\t * @return The right-hand operand.\n\t */\n\tCriteriaExpression<?> getRightHandOperand();\n\n\t/**\n\t * Get the left-hand operand.\n\t *\n\t * @return The left-hand operand.\n\t */\n\tCriteriaExpression<?> getLeftHandOperand();\n}", "public String calculate() {\r\n\t\t\r\n\t\tif(\"\".equals(firstNumber.toString()) || \"\".equals(secondNumber.toString())) {\r\n\t\t\tclear();\r\n\t\t\treturn \"0\";\r\n\t\t}\r\n\t\t\r\n\t\tif (\"\".equals(operator)) {\r\n\t\t\tif (getOperand().length() == 0) {\r\n\t\t\t\tclear();\r\n\t\t\t\treturn \"0\";\r\n\t\t\t}\r\n\t\t\tresult = getOperand().toString();\r\n\t\t}\r\n\r\n\t\tif (\"+\".equals(operator)) {\r\n\t\t\tresult = Double.toString(Double.parseDouble(firstNumber.toString())\r\n\t\t\t\t\t+ Double.parseDouble(secondNumber.toString()));\r\n\t\t}\r\n\r\n\t\tif (\"-\".equals(operator)) {\r\n\t\t\tresult = Double.toString(Double.parseDouble(firstNumber.toString())\r\n\t\t\t\t\t- Double.parseDouble(secondNumber.toString()));\r\n\t\t}\r\n\r\n\t\tif (\"*\".equals(operator)) {\r\n\t\t\tresult = Double.toString(Double.parseDouble(firstNumber.toString())\r\n\t\t\t\t\t* Double.parseDouble(secondNumber.toString()));\r\n\t\t}\r\n\r\n\t\tif (\"/\".equals(operator)) {\r\n\t\t\tif (\"0\".equals(secondNumber.toString())) {\r\n\t\t\t\tclear();\r\n\t\t\t\treturn \"Division by zero\";\r\n\t\t\t}\r\n\t\t\tresult = Double.toString(Double.parseDouble(firstNumber.toString())\r\n\t\t\t\t\t/ Double.parseDouble(secondNumber.toString()));\r\n\t\t}\r\n\r\n\t\tclear();\r\n\t\treturn filter(result);\r\n\t}", "private IMathExpr parseOperator(String expr, MathBinOper operator,\r\n boolean processLeft2Right) throws InvalidMathExprException {\r\n int startPos, endPos, step;\r\n \r\n if (processLeft2Right) { // Parse expression forwards.\r\n startPos = 0;\r\n endPos = expr.length();\r\n step = 1;\r\n } else { // Parse expression backwards.\r\n startPos = expr.length() - 1;\r\n endPos = -1; // Going backwards, even 0 index counts.\r\n step = -1;\r\n }\r\n \r\n int i = startPos;\r\n while (i != endPos) {\r\n if (this.isOutsideOfBracket(expr, i)) {\r\n char c = expr.charAt(i);\r\n \r\n if (c == operator.getSign()) {\r\n IMathExpr left = new MathExpr(expr.substring(0, i));\r\n IMathExpr right = new MathExpr(expr.substring(i + 1,\r\n expr.length()));\r\n \r\n return MathBinOper.buildBinaryOper(operator, left, right);\r\n }\r\n }\r\n \r\n i += step;\r\n }\r\n \r\n return null;\r\n }", "@Override\n public TreeNode parse() {\n TreeNode first = ArithmeticSubexpression.getAdditive(environment).parse();\n if (first == null) return null;\n\n // Try to parse something starting with an operator.\n List<Wrapper> wrappers = RightSideSubexpression.createKleene(\n environment, ArithmeticSubexpression.getAdditive(environment),\n BemTeVicTokenType.EQUAL, BemTeVicTokenType.DIFFERENT,\n BemTeVicTokenType.GREATER_OR_EQUALS, BemTeVicTokenType.GREATER_THAN,\n BemTeVicTokenType.LESS_OR_EQUALS, BemTeVicTokenType.LESS_THAN\n ).parse();\n\n // If did not found anything starting with an operator, return the first node.\n if (wrappers.isEmpty()) return first;\n\n // Constructs a binary operator node containing the expression.\n Iterator<Wrapper> it = wrappers.iterator();\n Wrapper secondWrapper = it.next();\n BinaryOperatorNode second = new BinaryOperatorNode(secondWrapper.getTokenType(), first, secondWrapper.getOutput());\n\n if (wrappers.size() == 1) return second;\n\n // If we reach this far, the expression has more than one operator. i.e. (x = y = z),\n // which is a shortcut for (x = y AND y = z).\n\n // Firstly, determine if the operators are compatible.\n RelationalOperatorSide side = RelationalOperatorSide.NONE;\n for (Wrapper w : wrappers) {\n side = side.next(w.getTokenType());\n }\n if (side.isMixed()) {\n environment.emitError(\"XXX\");\n }\n\n // Creates the other nodes. In the expression (a = b = c = d), The \"a = b\"\n // is in the \"second\" node. Creates \"b = c\", and \"c = d\" nodes.\n List<BinaryOperatorNode> nodes = new LinkedList<BinaryOperatorNode>();\n nodes.add(second);\n\n TreeNode prev = secondWrapper.getOutput();\n while (it.hasNext()) {\n Wrapper w = it.next();\n BinaryOperatorNode current = new BinaryOperatorNode(w.getTokenType(), prev, w.getOutput());\n prev = w.getOutput();\n nodes.add(current);\n }\n\n // Combines all of the nodes in a single one using AND.\n return new VariableArityOperatorNode(BemTeVicTokenType.AND, nodes);\n }", "public Code visitOperatorNode(ExpNode.OperatorNode node) {\n beginGen(\"Operator\");\n Code code;\n ExpNode args = node.getArg();\n switch (node.getOp()) {\n case ADD_OP:\n code = args.genCode(this);\n code.generateOp(Operation.ADD);\n break;\n case SUB_OP:\n code = args.genCode(this);\n code.generateOp(Operation.NEGATE);\n code.generateOp(Operation.ADD);\n break;\n case MUL_OP:\n code = args.genCode(this);\n code.generateOp(Operation.MPY);\n break;\n case DIV_OP:\n code = args.genCode(this);\n code.generateOp(Operation.DIV);\n break;\n case EQUALS_OP:\n code = args.genCode(this);\n code.generateOp(Operation.EQUAL);\n break;\n case LESS_OP:\n code = args.genCode(this);\n code.generateOp(Operation.LESS);\n break;\n case NEQUALS_OP:\n code = args.genCode(this);\n code.generateOp(Operation.EQUAL);\n code.genBoolNot();\n break;\n case LEQUALS_OP:\n code = args.genCode(this);\n code.generateOp(Operation.LESSEQ);\n break;\n case GREATER_OP:\n /* Generate argument values in reverse order and use LESS */\n code = genArgsInReverse((ExpNode.ArgumentsNode)args);\n code.generateOp(Operation.LESS);\n break;\n case GEQUALS_OP:\n /* Generate argument values in reverse order and use LESSEQ */\n code = genArgsInReverse((ExpNode.ArgumentsNode)args);\n code.generateOp(Operation.LESSEQ);\n break;\n case NEG_OP:\n code = args.genCode(this);\n code.generateOp(Operation.NEGATE);\n break;\n default:\n errors.fatal(\"PL0 Internal error: Unknown operator\",\n node.getLocation());\n code = null;\n }\n endGen(\"Operator\");\n return code;\n }", "public String getOperator()\r\n\t{\r\n\t\tSystem.out.println(\"Choose the any operation from the following operations:\");\r\n System.out.println(\"1.+\");\r\n System.out.println(\"2.-\");\r\n System.out.println(\"3.*\");\r\n System.out.println(\"4./\");\r\n \r\n\t\tString op=sc.next();\r\n\t\treturn op;\r\n\t}", "@Override\n\tpublic void outAOpExpr(AOpExpr node) {\n\t\tExpressionType expType = (ExpressionType) nodeTypes.get(node.getOp()); \n\t\tType left = nodeTypes.get(node.getLeft()); \n\t\tswitch (expType){\n\t\t\tcase DIV :\n\t\t\t\tcreateBinArithmetic(\"/\"); \n\t\t\t\tbreak; \n\t\t\tcase MINUS: \n\t\t\t\tcreateBinArithmetic(\"-\"); \n\t\t\t\tbreak; \n\t\t\tcase MOD: \n\t\t\t\tcreateBinArithmetic(\"%\"); \n\t\t\t\tbreak;\n\t\t\tcase MUL:\n\t\t\t\tcreateBinArithmetic(\"*\"); \n\t\t\t\tbreak; \n\t\t\tcase ADD : \n\t\t\t\tif ( left != Type.STRING_TYPE ){\n\t\t\t\t\tcreateBinArithmetic(\"+\"); \n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase AINVERSE : \n\t\t\t\til.append(new INEG()); \n\t\t\t\tbreak;\n\t\t\t\t//TODO comparison \n\t\t\tcase LOWEREQ:\n\t\t\t\tcreateCmpOp(Constants.IF_ICMPGT);\n\t\t\t\tbreak; \n\t\t\tcase LOWER :\n\t\t\t\tcreateCmpOp(Constants.IF_ICMPGE); \n\t\t\t\tbreak; \n\t\t\tcase BIGGEREQ:\n\t\t\t\tcreateCmpOp(Constants.IF_ICMPLT);\n\t\t\t\tbreak; \n\t\t\tcase BIGGER : \n\t\t\t\tcreateCmpOp(Constants.IF_ICMPLE); \n\t\t\t\tbreak; \n\t\t\tcase EQ :\n\t\t\t\tif (left == Type.BOOLEAN_TYPE || left == Type.INTEGER_TYPE)\n\t\t\t\t\tcreateCmpOp(Constants.IF_ICMPNE);\n\t\t\t\telse\n\t\t\t\t\tcreateCmpOp(Constants.IF_ACMPNE); \n\t\t\t\tbreak;\n\t\t\tcase NEQ :\n\t\t\t\tif (left == Type.BOOLEAN_TYPE || left == Type.INTEGER_TYPE)\n\t\t\t\t\tcreateCmpOp(Constants.IF_ICMPEQ);\n\t\t\t\telse\n\t\t\t\t\tcreateCmpOp(Constants.IF_ACMPEQ); \n\t\t\t\tbreak; \n\t\t\tcase NOT : \n\t\t\t\tcreateCmpOp(Constants.IFNE); \n\t\t\t\tbreak;\n\t\t}\n\t}", "@Override\n\tpublic String toPrefixNotation() {\n\t\tint num;\n\t\tExpressionTree left, right;\n\n\t\ttry {\n\t\t\tnum = Integer.parseInt(EMPTY + this.getValue());\n\t\t\treturn EMPTY + num;\n\t\t}\n\t\tcatch(NumberFormatException n) {\n\t\t\tleft = new ExpressionTree(getLeft());\n\t\t\tright = new ExpressionTree(getRight());\n\t\t\treturn getValue() + SPACE + left.toPrefixNotation() + SPACE \n\t\t\t\t\t+ right.toPrefixNotation();\n\t\t}\n\t}", "public String operate() {\r\n\r\n\t\t// Logger log = Logger.getLogger(IterationFactory.class);\r\n\t\tDecimalFormat form = new DecimalFormat(\"0.0000\");\r\n\t\tStringBuffer sb = new StringBuffer();\r\n\t\tOperationFactory operateF;\r\n\t\tList<Integer> valueList;\r\n\r\n\t\tIterator<String> inputItr = this.getInputList().iterator();\r\n\r\n\t\tIterator<Character> opItr = this.getOperator().iterator();\r\n\r\n\t\ttry {\r\n\t\t\t/* Domain check */\r\n\t\t\tif (this.getInputList().size() <= 1 && this.getInputList().size() >= 10) {\r\n\t\t\t\tthrow new ValuePairOutOfLimit(this.getInputList().size());\r\n\t\t\t}\r\n\r\n\t\t\twhile (inputItr.hasNext()) {\r\n\r\n\t\t\t\t/* To get individual operands from operand sets */\r\n\t\t\t\tvalueList = u.toValueList(inputItr.next());\r\n\t\t\t\tIterator<Integer> valItr = valueList.iterator();\r\n\r\n\t\t\t\t/* Check for validity of operands and string format */\r\n\t\t\t\tif (valueList.size() < Constant.TWO)\r\n\t\t\t\t\tthrow new OperandException();\r\n\t\t\t\tif (valueList.size() > Constant.TWO)\r\n\t\t\t\t\tthrow new StringFormatException();\r\n\r\n\t\t\t\t/*\r\n\t\t\t\t * If there is empty operator string default operator sets to\r\n\t\t\t\t * plus\r\n\t\t\t\t */\r\n\t\t\t\tif (operator.size() == 0)\r\n\t\t\t\t\toperateF = new OperationFactory(valItr.next(), valItr.next(), Constant.PLUS);\r\n\t\t\t\telse\r\n\t\t\t\t\toperateF = new OperationFactory(valItr.next(), valItr.next(), opItr.next());\r\n\r\n\t\t\t\t/* Output */\r\n\t\t\t\tsb.append(operateF.getmOp().getmOperand1() + operateF.getmOp().getmWord()\r\n\t\t\t\t\t\t+ operateF.getmOp().getmOperand2() + \" = \" + form.format(operateF.operate()) + \"\\n\");\r\n\r\n\t\t\t\t/*To reset operator iterator.*/\r\n\t\t\t\tif (!opItr.hasNext())\r\n\t\t\t\t\topItr = this.getOperator().iterator();\r\n\t\t\t}\r\n\t\t} catch (IntegerOutOfLimit e) {\r\n\t\t\tsb.append(e);\r\n\t\t} catch (InvalidOperator e) {\r\n\t\t\tsb.append(e);\r\n\t\t} catch (OperandException e) {\r\n\t\t\tsb.append(e);\r\n\t\t} catch (StringFormatException e) {\r\n\t\t\tsb.append(e);\r\n\t\t} catch (ValuePairOutOfLimit e) {\r\n\t\t\tsb.append(e);\r\n\t\t}\r\n\t\treturn sb.toString();\r\n\t}", "public String getLeftOperand()\r\n {\r\n if (leftOperand == null)\r\n {\r\n return null;\r\n }\r\n if (leftOperand.contains(\"+1i\"))\r\n {\r\n return leftOperand.replace(\"+1i\", \"+i\");\r\n }\r\n else if (leftOperand.contains(\"-1i\"))\r\n {\r\n return leftOperand.replace(\"-1i\", \"-i\");\r\n }\r\n return leftOperand;\r\n }", "public String toString() {\n return \"(\" + getExpLeft().toString() + \" * \" + getExpRight().toString() + \")\";\n }", "@Override\r\n\tpublic String toString()\r\n\t{\r\n\t\treturn rootOperation.toString();\r\n\t}", "public void appendOperator(String operator){\n if(validateExp(currentExp)){\n currentExp+=operator;\n calculationResult.onExpressionChange(currentExp,true);\n count++;\n }\n }", "public String infix()\n\t {\n\t \t// create an empty string builder // \n\t \tStringBuilder sb = new StringBuilder();\n\t \t\n\t \t// fill the string builder//\n\t \tinfix(root, sb);\n\t \t\n\t \treturn sb.toString().trim();\n\t }", "@Override\n public void outPlusExp(PlusExp node)\n {\n Type lexpType = this.mCurrentST.getExpType(node.getLExp());\n Type rexpType = this.mCurrentST.getExpType(node.getRExp());\n mPrintWriter.println(\"#Addddddddddddding\");\n Label l1 = new Label();\n Label l0 = new Label();\n Label l2 = new Label();\n Label l3 = new Label();\n //# Load constant int 1\n if(lexpType == Type.BYTE && rexpType == Type.INT){\n /*mPrintWriter.println(\"ldi r24,lo8(\"+node.getLExp().value+\")\");\n mPrintWriter.println(\"ldi r25,hi8(\"+node.getLExp().value+\")\");\n //# push two byte expression onto stack\n mPrintWriter.println(\"push r25\");\n mPrintWriter.println(\"push r24\");\n //# Load constant int 0\n mPrintWriter.println(\"ldi r24,lo8(\"+node.getRExp().value+\")\");\n mPrintWriter.println(\"ldi r25,hi8(\"+node.getRExp().value+\")\");\n //# push two byte expression onto stack\n mPrintWriter.println(\"push r25\");\n mPrintWriter.println(\"push r24\");\n //# Casting int to byte by popping\n //# 2 bytes off stack and only pushing low order bits\n //# back on. Low order bits are on top of stack.\n mPrintWriter.println(\"pop r24\");\n mPrintWriter.println(\"pop r25\");\n mPrintWriter.println(\"push r24\");*/\n //# load a one byte expression off stack\n mPrintWriter.println(\"pop r18\");\n mPrintWriter.println(\"pop r19\");\n //mPrintWriter.println(# load a one byte expression off stack\n mPrintWriter.println(\"pop r24\");\n //mPrintWriter.println(# promoting a byte to an int\n mPrintWriter.println(\"tst r24\");\n mPrintWriter.println(\"brlt \" + l0);\n mPrintWriter.println(\"ldi r25, 0\");\n mPrintWriter.println(\"jmp \" + l1);\n mPrintWriter.println(l0 + \":\");\n mPrintWriter.println(\"ldi r25, hi8(-1)\");\n mPrintWriter.println( l1 + \":\");\n\n // mPrintWriter.println(# Do add operation\n mPrintWriter.println(\"add r24, r18\");\n mPrintWriter.println(\"adc r25, r19\");\n //mPrintWriter.println(# push two byte expression onto stack\n mPrintWriter.println(\"push r25\");\n mPrintWriter.println(\"push r24\");\n }\n else if(lexpType == Type.BYTE && rexpType == Type.BYTE){\n /*mPrintWriter.println(\"ldi r24,lo8(\"+node.getLExp().value+\")\");\n mPrintWriter.println(\"ldi r25,hi8(\"+node.getLExp().value+\")\");\n //# push two byte expression onto stack\n mPrintWriter.println(\"push r25\");\n mPrintWriter.println(\"push r24\");\n //# Casting int to byte by popping\n //# 2 bytes off stack and only pushing low order bits\n //# back on. Low order bits are on top of stack.\n mPrintWriter.println(\"pop r24\");\n mPrintWriter.println(\"pop r25\");\n mPrintWriter.println(\"push r24\");\n mPrintWriter.println(\"ldi r24,lo8(\"+node.getRExp().value+\")\");\n mPrintWriter.println(\"ldi r25,hi8(\"+node.getRExp().value+\")\");\n //# push two byte expression onto stack\n mPrintWriter.println(\"push r25\");\n mPrintWriter.println(\"push r24\");\n //# Casting int to byte by popping\n //# 2 bytes off stack and only pushing low order bits\n //# back on. Low order bits are on top of stack.\n mPrintWriter.println(\"pop r24\");\n mPrintWriter.println(\"pop r25\");\n mPrintWriter.println(\"push r24\");*/\n //# load a one byte expression off stack\n mPrintWriter.println(\"pop r18\");\n //# load a one byte expression off stack\n mPrintWriter.println(\"pop r24\");\n //# promoting a byte to an int\n mPrintWriter.println(\"tst r24\");\n mPrintWriter.println(\"brlt \" + l0);\n mPrintWriter.println(\"ldi r25, 0\");\n mPrintWriter.println(\"jmp \" + l1);\n mPrintWriter.println(l0 + \":\");\n mPrintWriter.println(\"ldi r25, hi8(-1)\");\n mPrintWriter.println( l1 + \":\");\n //# promoting a byte to an int\n mPrintWriter.println(\"tst r18\");\n mPrintWriter.println(\"brlt \" + l2);\n mPrintWriter.println(\"ldi r19, 0\");\n mPrintWriter.println(\"jmp \" + l3);\n mPrintWriter.println(l2 + \":\");\n mPrintWriter.println(\"ldi r19, hi8(-1)\");\n mPrintWriter.println(l3 + \":\");\n\n //mPrintWriter.println(# Do add operation\n mPrintWriter.println(\"add r24, r18\");\n mPrintWriter.println(\"adc r25, r19\");\n //mPrintWriter.println(# push two byte expression onto stack\n mPrintWriter.println(\"push r25\");\n mPrintWriter.println(\"push r24\");\n }\n else if(lexpType == Type.INT && rexpType == Type.BYTE){\n /*mPrintWriter.println(\"ldi r24,lo8(\"+node.getLExp().value+\")\");\n mPrintWriter.println(\"ldi r25,hi8(\"+node.getLExp().value+\")\");\n //mPrintWriter.println(# push two byte expression onto stack);\n mPrintWriter.println(\"push r25\");\n mPrintWriter.println(\"push r24\");\n //mPrintWriter.println(# Casting int to byte by popping);\n //mPrintWriter.println(# 2 bytes off stack and only pushing low order bits);\n //mPrintWriter.println(# back on. Low order bits are on top of stack.);\n mPrintWriter.println(\"pop r24\");\n mPrintWriter.println(\"pop r25\");\n mPrintWriter.println(\"push r24\");\n //mPrintWriter.println(# Load constant int 0);\n mPrintWriter.println(\"ldi r24,lo8(\"+node.getRExp().value+\")\");\n mPrintWriter.println(\"ldi r25,hi8(\"+node.getRExp().value+\")\");\n //# push two byte expression onto stack);\n mPrintWriter.println(\"push r25\");\n mPrintWriter.println(\"push r24\");*/\n //# load a two byte expression off stack);\n mPrintWriter.println(\"pop r18\");\n //mPrintWriter.println(\"pop r19\");\n //# load a one byte expression off stack\n mPrintWriter.println(\"pop r24\");\n mPrintWriter.println(\"pop r25\");\n //# promoting a byte to an int\n mPrintWriter.println(\"tst r18\");\n mPrintWriter.println(\"brlt\" + l0);\n mPrintWriter.println(\"ldi r19, 0\");\n mPrintWriter.println(\"jmp \" + l1);\n mPrintWriter.println(l0 + \":\");\n mPrintWriter.println(\"ldi r19, hi8(-1)\");\n mPrintWriter.println(l1 + \":\");\n\n //mPrintWriter.println(# Do add operation\n mPrintWriter.println(\"add r24, r18\");\n mPrintWriter.println(\"adc r25, r19\");\n //mPrintWriter.println(# push two byte expression onto stack\n mPrintWriter.println(\"push r25\");\n mPrintWriter.println(\"push r24\");\n }\n else{\n mPrintWriter.println(\"pop r18\");\n mPrintWriter.println(\"pop r19\");\n //# load a one byte expression off stack\n mPrintWriter.println(\"pop r24\");\n mPrintWriter.println(\"pop r25\");\n\n mPrintWriter.println(\"add r24, r18\");\n mPrintWriter.println(\"adc r25, r19\");\n //mPrintWriter.println(# push two byte expression onto stack\n mPrintWriter.println(\"push r25\");\n mPrintWriter.println(\"push r24\");\n }\n }", "LogicExpression getLeftExp();", "public String getOperator() {\n\t\treturn operator;\n\t}", "public String getOperator() {\n\t\treturn operator;\n\t}", "private ASTNode binaryDivisionRules(ASTNode left, ASTNode right) throws Exception {\n\n Token leftToken = left.getToken();\n Token rightToken = right.getToken();\n\n TokenType leftType = leftToken.getType();\n TokenType rightType = rightToken.getType();\n\n TokenType varType = TokenType.VAR;\n TokenType numType = TokenType.NUMBER;\n TokenType divType = TokenType.DIV;\n\n Token tempToken;\n if (patternMatcher(leftType, rightType, varType, varType)){\n tempToken = new Token(numType, \"1\");\n return new Num(tempToken);\n }\n else if (rightToken.getIdentifier().equals(\"1\")){\n return left;\n }\n else if (leftToken.getIdentifier().equals(\"0\")){\n tempToken = new Token(numType, \"0\");\n return new Num(tempToken);\n }\n else{\n tempToken = new Token(divType);\n return new BinaryOp(tempToken, left, right);\n }\n }", "@Test\n public void operator_literal() {\n OutputNode output = new OutputNode(\"testing\", typeOf(Result.class), typeOf(String.class));\n OperatorNode operator = new OperatorNode(\n classOf(SimpleOp.class), typeOf(Result.class), typeOf(String.class),\n output, new ValueElement(valueOf(\"???\")));\n InputNode root = new InputNode(operator);\n MockContext context = new MockContext();\n testing(root, context, op -> {\n op.process(\"Hello, world!\");\n });\n assertThat(context.get(\"testing\"), contains(\"Hello, world!???\"));\n }", "public final String binary_operator(int tab) throws RecognitionException {\n String value = null;\n\n\n\n \tvalue = null;\n\n try {\n // src\\\\calculator.g:472:2: ( '+' | '-' | '*' | '/' | '%' | '^' | '&' | '&&' | '||' | '+=' | '-=' | '*=' | '/=' | '%=' | '^=' | '&=' | '=' | '>' | '>=' | '==' | '<' | '<=' | '!=' )\n int alt29=23;\n switch ( input.LA(1) ) {\n case 21:\n {\n alt29=1;\n }\n break;\n case 25:\n {\n alt29=2;\n }\n break;\n case 19:\n {\n alt29=3;\n }\n break;\n case 29:\n {\n alt29=4;\n }\n break;\n case 12:\n {\n alt29=5;\n }\n break;\n case 43:\n {\n alt29=6;\n }\n break;\n case 15:\n {\n alt29=7;\n }\n break;\n case 14:\n {\n alt29=8;\n }\n break;\n case 69:\n {\n alt29=9;\n }\n break;\n case 23:\n {\n alt29=10;\n }\n break;\n case 27:\n {\n alt29=11;\n }\n break;\n case 20:\n {\n alt29=12;\n }\n break;\n case 30:\n {\n alt29=13;\n }\n break;\n case 13:\n {\n alt29=14;\n }\n break;\n case 44:\n {\n alt29=15;\n }\n break;\n case 16:\n {\n alt29=16;\n }\n break;\n case 36:\n {\n alt29=17;\n }\n break;\n case 38:\n {\n alt29=18;\n }\n break;\n case 39:\n {\n alt29=19;\n }\n break;\n case 37:\n {\n alt29=20;\n }\n break;\n case 33:\n {\n alt29=21;\n }\n break;\n case 35:\n {\n alt29=22;\n }\n break;\n case 10:\n {\n alt29=23;\n }\n break;\n default:\n NoViableAltException nvae =\n new NoViableAltException(\"\", 29, 0, input);\n\n throw nvae;\n\n }\n\n switch (alt29) {\n case 1 :\n // src\\\\calculator.g:472:4: '+'\n {\n match(input,21,FOLLOW_21_in_binary_operator1808); \n\n value = \" + \";\n\n }\n break;\n case 2 :\n // src\\\\calculator.g:474:4: '-'\n {\n match(input,25,FOLLOW_25_in_binary_operator1817); \n\n value = \" - \";\n\n }\n break;\n case 3 :\n // src\\\\calculator.g:476:4: '*'\n {\n match(input,19,FOLLOW_19_in_binary_operator1826); \n\n value = \" * \";\n\n }\n break;\n case 4 :\n // src\\\\calculator.g:478:4: '/'\n {\n match(input,29,FOLLOW_29_in_binary_operator1835); \n\n value = \" / \";\n\n }\n break;\n case 5 :\n // src\\\\calculator.g:480:4: '%'\n {\n match(input,12,FOLLOW_12_in_binary_operator1844); \n\n value = \" % \";\n\n }\n break;\n case 6 :\n // src\\\\calculator.g:482:4: '^'\n {\n match(input,43,FOLLOW_43_in_binary_operator1853); \n\n value = \" ^ \";\n\n }\n break;\n case 7 :\n // src\\\\calculator.g:484:4: '&'\n {\n match(input,15,FOLLOW_15_in_binary_operator1862); \n\n value = \" & \";\n\n }\n break;\n case 8 :\n // src\\\\calculator.g:486:4: '&&'\n {\n match(input,14,FOLLOW_14_in_binary_operator1871); \n\n value = \" && \";\n\n }\n break;\n case 9 :\n // src\\\\calculator.g:488:4: '||'\n {\n match(input,69,FOLLOW_69_in_binary_operator1880); \n\n value = \" || \";\n\n }\n break;\n case 10 :\n // src\\\\calculator.g:490:4: '+='\n {\n match(input,23,FOLLOW_23_in_binary_operator1889); \n\n value = \" += \";\n\n }\n break;\n case 11 :\n // src\\\\calculator.g:492:4: '-='\n {\n match(input,27,FOLLOW_27_in_binary_operator1898); \n\n value = \" -= \";\n\n }\n break;\n case 12 :\n // src\\\\calculator.g:494:4: '*='\n {\n match(input,20,FOLLOW_20_in_binary_operator1907); \n\n value = \" *= \";\n\n }\n break;\n case 13 :\n // src\\\\calculator.g:496:4: '/='\n {\n match(input,30,FOLLOW_30_in_binary_operator1916); \n\n value = \" /= \";\n\n }\n break;\n case 14 :\n // src\\\\calculator.g:498:4: '%='\n {\n match(input,13,FOLLOW_13_in_binary_operator1925); \n\n value = \" %= \";\n\n }\n break;\n case 15 :\n // src\\\\calculator.g:500:4: '^='\n {\n match(input,44,FOLLOW_44_in_binary_operator1934); \n\n value = \" ^= \";\n\n }\n break;\n case 16 :\n // src\\\\calculator.g:502:4: '&='\n {\n match(input,16,FOLLOW_16_in_binary_operator1943); \n\n value = \" &= \";\n\n }\n break;\n case 17 :\n // src\\\\calculator.g:504:4: '='\n {\n match(input,36,FOLLOW_36_in_binary_operator1952); \n\n value = \" = \";\n\n }\n break;\n case 18 :\n // src\\\\calculator.g:506:4: '>'\n {\n match(input,38,FOLLOW_38_in_binary_operator1961); \n\n value = \" > \";\n\n }\n break;\n case 19 :\n // src\\\\calculator.g:508:4: '>='\n {\n match(input,39,FOLLOW_39_in_binary_operator1970); \n\n value = \" >= \";\n\n }\n break;\n case 20 :\n // src\\\\calculator.g:510:4: '=='\n {\n match(input,37,FOLLOW_37_in_binary_operator1979); \n\n value = \" == \";\n\n }\n break;\n case 21 :\n // src\\\\calculator.g:512:4: '<'\n {\n match(input,33,FOLLOW_33_in_binary_operator1988); \n\n value = \" < \";\n\n }\n break;\n case 22 :\n // src\\\\calculator.g:514:4: '<='\n {\n match(input,35,FOLLOW_35_in_binary_operator1997); \n\n value = \" <= \";\n\n }\n break;\n case 23 :\n // src\\\\calculator.g:516:4: '!='\n {\n match(input,10,FOLLOW_10_in_binary_operator2006); \n\n value = \" != \";\n\n }\n break;\n\n }\n }\n catch (RecognitionException re) {\n reportError(re);\n recover(input,re);\n }\n\n finally {\n \t// do for sure before leaving\n }\n return value;\n }", "public static BinaryExpression leftShift(Expression expression0, Expression expression1, Method method) { throw Extensions.todo(); }", "public static EvaluationStep getBinaryOperation(final String theOperator)\n {\n if(\"+\".equals(theOperator)) return Addition;\n if(\"-\".equals(theOperator)) return Subtraction;\n if(\"*\".equals(theOperator)) return Mulitplication;\n if(\"/\".equals(theOperator)) return Division;\n if(\"^\".equals(theOperator)) return Exponentiation;\n throw new IllegalStateException(\"Invalid binary operator ($operator).\".replace(\"$operator\", (null != theOperator) ? theOperator : \"null\"));\n }", "protected void operation(String op) {\n \tint value;\n \tif (stack.empty()) {\n \t\tenter();\n \t}\n \telse {\n \t\tint second = stack.pop();\n \t // handles when only one value in stack\n \t\tif (stack.empty()) {\n \t\t\tif (op.equals(\"+\")) {\n \t\t\t\tstack.push(second);\n \t\t\t}\n \t\t\telse if (op.equals(\"-\")) {\n \t\t\t\tcurrent = second *-1;\n \t\t\t\tstack.push(current);\n \t\t\t\tshow(stack.peek());\n \t\t\t\tcurrent = 0;\n \t\t\t}\n \t\t\telse if (op.equals(\"*\")) {\n \t\t\t\tstack.push(0);\n \t\t\t\tshow(stack.peek());\n \t\t\t}\n \t\t\telse {\n \t\t\t\tstack.push(0);\n \t\t\t\tshow(stack.peek());\n \t\t\t}\n \t\t}\n \t // handles the other cases\n \t\telse {\n \t\t\tif (op.equals(\"+\")) {\n \t\t\t\tvalue = second + stack.pop();\n \t\t\t\tdisplayOperatedValue(value);\n \t\t\t}\n \t\t\telse if (op.equals(\"-\")) {\n \t\t\t\tvalue = stack.pop() - second;\n \t\t\t\tdisplayOperatedValue(value);\n \t\t\t}\n \t\t\telse if (op.equals(\"*\")) {\n \t\t\t\tvalue = stack.pop() * second;\n \t\t\t\tdisplayOperatedValue(value);\n \t\t\t}\n \t\t\telse {\n \t\t\t\tvalue = stack.pop() / second;\n \t\t\t\tdisplayOperatedValue(value);\n \t\t\t}\n \t\t}\n \t}\n }", "private ASTNode binaryMultiplyRules(ASTNode left, ASTNode right) throws Exception {\n Token leftToken = left.getToken();\n Token rightToken = right.getToken();\n\n TokenType leftType = leftToken.getType();\n TokenType rightType = rightToken.getType();\n\n Token tempToken;\n TokenType numType = TokenType.NUMBER;\n TokenType minusType = TokenType.MINUS;\n TokenType mulType = TokenType.MUL;\n\n if (rightToken.getIdentifier().equals(\"0\")){\n //left is anything and right is 0\n tempToken = new Token(numType, \"0\");\n return new Num(tempToken);\n }\n else if (rightToken.getIdentifier().equals(\"1\")){\n //left is anything and right is 1\n return left;\n }\n else if (leftToken.getIdentifier().equals(\"0\")){\n //left is 0 and right is anything\n tempToken = new Token(numType, \"0\");\n return new Num(tempToken);\n }\n else if (leftToken.getIdentifier().equals(\"1\")){\n //left is 1 and right is anything\n return right;\n }\n else if(patternMatcher(leftType, rightType, numType, numType)){\n Double leftVal = Double.parseDouble(leftToken.getIdentifier());\n Double rightVal = Double.parseDouble(rightToken.getIdentifier());\n\n String prod = String.valueOf(leftVal * rightVal);\n tempToken = new Token(numType, prod);\n return new Num(tempToken);\n }\n else if (patternMatcher(leftType, rightType, minusType, minusType)){\n if (left instanceof UnaryOP && right instanceof UnaryOP){\n tempToken = new Token(mulType);\n ASTNode leftOP = ((UnaryOP) left).getOperand();\n ASTNode rightOp = ((UnaryOP) right).getOperand();\n return new BinaryOp(tempToken, leftOP, rightOp);\n }\n }\n tempToken = new Token(mulType);\n return new BinaryOp(tempToken ,left, right);\n }", "private static OperatorBuilder binary(String symbol, DoubleBinaryOperator binaryOp, Type type) {\n if (binaryOp == null) {\n throw new IllegalArgumentException(\"operator argument must not be null\");\n }\n if (type.arity() != 2) {\n throw new IllegalArgumentException(\"type argument must be INFIXL, INFIXN, or INFIXR\");\n }\n // XXX ensure valid symbol\n return new OperatorBuilder(null, binaryOp, symbol, 10, type);\n }", "private void operator() {\n reduce();\n shift();\n getDispenser().advance();\n if(getDispenser().tokenIsNumber()) setState(State.NUMBER);\n else if (getDispenser().tokenIsLeftParen()) setState(State.LEFT_PAREN);\n else syntaxError(NUM);\n \n }", "@Override\n\tpublic void VisitUnaryNode(UnaryOperatorNode Node) {\n\n\t}", "public static BinaryExpression leftShift(Expression expression0, Expression expression1) { throw Extensions.todo(); }", "public BinaryExpression(IExpression left, IExpression right, IOperation op) {\r\n\t\tthis.op = op; // passes the reference op parameter to the associated\r\n\t\t\t\t\t\t// field.\r\n\t\tthis.left = left; // passes the reference of the left parameter to the\r\n\t\t\t\t\t\t\t// associated field.\r\n\t\tthis.right = right; // passes the reference of the right parameter to\r\n\t\t\t\t\t\t\t// the associated field.\r\n\t}", "@Override public JannotTreeJCExpression getLeftOperand()\n{\n return createTree(getNode().getLeftOperand()); \n}", "@Override\r\n\tpublic Object visitBinaryExpression(BinaryExpression binaryExpression,\r\n\t\t\tObject arg) throws Exception {\r\n\t\tString expr0Type = (String) binaryExpression.expression0.visit(this,arg);\r\n\t\tString expr1Type = (String) binaryExpression.expression1.visit(this,arg);\r\n\t\tKind op = binaryExpression.op.kind;\r\n\t\tcheck(expr0Type.equals(expr1Type), \"uncompatible bianry expression\", binaryExpression);\r\n\t\tswitch(op) {\r\n\t\tcase PLUS:\r\n\t\t\tcheck(expr0Type.equals(intType) || expr0Type == stringType, \"operator \" + op.toString() + \" is not defined for \" + expr0Type, binaryExpression);\r\n\t\t\tbreak;\r\n\t\tcase MINUS:\tcase TIMES:\tcase DIV:\t\t\t\r\n\t\t\tcheck(expr0Type.equals(intType), \"operator \" + op.toString() + \" is not defined for \" + expr0Type, binaryExpression);\r\n\t\t\tbreak;\r\n\t\tcase EQUAL:\tcase NOTEQUAL:\r\n\t\t\tif (expr0Type.equals(booleanType) || expr0Type.equals(intType) ||expr0Type.equals(stringType)) {\r\n\t\t\t\tbinaryExpression.setType(booleanType);\r\n\t\t\t\treturn booleanType;\r\n\t\t\t} else {\r\n\t\t\t\tthrow new TypeCheckException(\"operator \" + op.toString() + \" is not defined for \" + expr0Type, binaryExpression);\r\n\t\t\t}\t\r\n\t\tcase LT: case GT: case LE: case GE:\r\n\t\t\tif (expr0Type.equals(booleanType) || expr0Type.equals(intType)) {\r\n\t\t\t\tbinaryExpression.setType(booleanType);\r\n\t\t\t\treturn booleanType;\r\n\t\t\t} else {\r\n\t\t\t\tthrow new TypeCheckException(\"operator \" + op.toString() + \" is not defined for \" + expr0Type, binaryExpression);\r\n\t\t\t}\t\t\r\n\t\tcase LSHIFT: case RSHIFT:\r\n\t\t\tcheck(expr0Type.equals(intType), \"operator \" + op.toString() + \" is not defined for \" + expr0Type, binaryExpression);\r\n\t\t\tbreak;\r\n\t\tcase BAR: case AND:\r\n\t\t\tcheck(expr0Type.equals(booleanType), \"operator \" + op.toString() + \" is not defined for \" + expr0Type, binaryExpression);\r\n\t\t\tbreak;\r\n\t\tdefault:\r\n\t\t\tthrow new TypeCheckException(\"operator \" + op.toString() + \" is not defined for \" + expr0Type, binaryExpression);\r\n\t\t} \t\r\n\t\tbinaryExpression.setType(expr0Type);\r\n\t\treturn expr0Type;\r\n\t}", "@Override\r\n public void infixDisplay() {\r\n System.out.print(value);\r\n }", "private static int getPrecedence(char operator)\r\n\t{\r\n\t\tswitch (operator)\r\n\t\t{\r\n\t\tcase '(': case ')': return 0;\r\n\t\tcase '+': case '-': return 1;\r\n\t\tcase '*': case '/': return 2;\r\n\t\tcase '^':\t\t\treturn 3;\r\n\t\tcase '.': return 4;\r\n\t\t} // end switch\r\n\r\n\t\treturn -1;\r\n\t\t\r\n\t}", "public Binary operator(Operator op) {\n\tBinary_c n = (Binary_c) copy();\n\tn.op = op;\n\treturn n;\n }", "public String getOp() {\n return op;\n }", "public String getOp() {\n return op;\n }", "private void postfix(ExpressionNodes root, StringBuilder sb)\n\t {\n\t \tif (root.left != null) // if there is a left child\n\t \t{ \n\t \t\tpostfix(root.left, sb); // run recursive method\n\t \t}\n\t \t\n\t \tif (root.right != null) // if there is a right child\n\t \t{ \n\t \t\tpostfix(root.right, sb); // run recursive method \n\t \t}\n\t \t\n\t \t// add the string of this node to the the string builder \n\t \tsb.append(root.data);\n\t \t\n\t \t// add a space in between nodes for clarity.\n\t \tsb.append(\" \");\n\t }", "private void PrintRenamedOperation(Integer[] op) {\n if (op[0] >= 3 && op[0] <= 7) // arithop\n System.out.println(\"\" + opCodeStrings[op[0]] + \" r\" + op[3] + \",\" + \" r\" + op[6] + \" =>\" + \" r\" + op[11]);\n else if (op[0] == 2 || op[0] == 0) { // load or store\n System.out.println(opCodeStrings[op[0]] + \" r\" + op[3] + \" =>\" + \" r\" + op[11]);\n } else if (op[0] == 1) { // loadI -- prints a constant\n System.out.println(opCodeStrings[op[0]] + \" \" + op[1] + \" =>\" + \" r\" + op[11]);\n } else if (op[0] == 8) { // output\n System.out.println(opCodeStrings[op[0]] + \" \" + op[1]);\n } else if (op[0] == 9) { // nop\n System.out.println(opCodeStrings[op[0]]);\n }\n }", "static BinaryOperator<SibillaValue> getOperator(String op) {\n if (op.equals(\"+\")) {return SibillaValue::sum;}\n if (op.equals(\"-\")) {return SibillaValue::sub; }\n if (op.equals(\"%\")) {return SibillaValue::mod; }\n if (op.equals(\"*\")) {return SibillaValue::mul; }\n if (op.equals(\"/\")) {return SibillaValue::div; }\n if (op.equals(\"//\")) {return SibillaValue::zeroDiv; }\n return (x,y) -> SibillaValue.ERROR_VALUE;\n }", "public String toString() {\n if (mExpression.size() == 1 && mExpression.get(0).startsWith(\"-\")) {\n return mExpression.get(0);\n }\n\n StringBuilder output = new StringBuilder();\n boolean first = true;\n int size = mExpression.size();\n\n for (int i = 0; i < size; i++) {\n String element = mExpression.get(i);\n\n if (first) {\n first = false;\n } else {\n output.append(\"\");\n }\n\n\n if (isOperand(element) && element.startsWith(\"-\")) {\n output.append(\"(\")\n .append(element)\n .append(\")\");\n } else {\n output.append(element);\n }\n }\n\n return output.toString();\n }", "private OpBinary getOpBinary(int opType) {\n switch(opType) {\n case napLexer.ADD: return OpBinary.ADD;\n case napLexer.SUB: return OpBinary.SUB;\n case napLexer.MUL: return OpBinary.MUL;\n case napLexer.DIV: return OpBinary.DIV;\n case napLexer.MOD: return OpBinary.MOD;\n case napLexer.AND: return OpBinary.AND;\n case napLexer.OR: return OpBinary.OR;\n case napLexer.NEQ: return OpBinary.NEQ;\n case napLexer.LT: return OpBinary.LT;\n case napLexer.LE: return OpBinary.LE;\n case napLexer.GT: return OpBinary.GT;\n case napLexer.GE: return OpBinary.GE;\n default: return OpBinary.EQ;\n }\n }" ]
[ "0.6674989", "0.6674989", "0.65576845", "0.6210426", "0.61704946", "0.6083421", "0.60298115", "0.60229945", "0.5992534", "0.59412205", "0.59328455", "0.58627623", "0.584576", "0.58325875", "0.5829431", "0.5826968", "0.5817845", "0.5813269", "0.5806517", "0.5789888", "0.5782455", "0.5779535", "0.5775133", "0.5768087", "0.574348", "0.57299846", "0.5724686", "0.5711078", "0.56869316", "0.56691545", "0.5658976", "0.565767", "0.56542844", "0.5637758", "0.5634759", "0.563433", "0.5614085", "0.559872", "0.55966526", "0.5596245", "0.5586217", "0.5581152", "0.557331", "0.55713695", "0.55647236", "0.55594", "0.55516726", "0.55516726", "0.5551186", "0.5551186", "0.5551186", "0.5551174", "0.5551174", "0.5551174", "0.5551174", "0.5551174", "0.5551174", "0.5546516", "0.5545333", "0.5544479", "0.5543171", "0.5534424", "0.5532849", "0.5529927", "0.55223566", "0.55151427", "0.5510661", "0.5507501", "0.5485565", "0.54803807", "0.545641", "0.5451705", "0.54486096", "0.54456526", "0.5441563", "0.5441563", "0.5432521", "0.5420934", "0.54173875", "0.54136354", "0.5405601", "0.54055107", "0.53972244", "0.539522", "0.53899926", "0.5383732", "0.53792334", "0.5371684", "0.5362785", "0.5356316", "0.53528005", "0.534253", "0.5342044", "0.53407", "0.53407", "0.5336563", "0.53289837", "0.53277713", "0.53172016", "0.5313399" ]
0.77967083
0
Method computes the variable of the expression
public int compute(ArrayList<variable> variables) { int l = left.compute(variables); // get value of left side int r = right.compute(variables); // get value of right side if (l == -999) { // if left side is an id l = getValue(variables, left); // get the value from the variables array list } if (r == -999) { // if right side is an id r = getValue(variables, right); // get the value from the variables array list } if (operator.getArithmeticOp().equals("*")) { return (int) l * r; } else if (operator.getArithmeticOp().equals("/")) { return (int) l / r; } else if (operator.getArithmeticOp().equals("+")) { return (int) l + r; } else if (operator.getArithmeticOp().equals("-")) { return (int) l - r; } else if (operator.getArithmeticOp().equals("%")) { return (int) l % r; } else if (operator.getArithmeticOp().equals("\\")) { return (int) r / l; } else { return -999; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "VariableExp createVariableExp();", "Node getVariable();", "Aliasing getVariable();", "public int expressionEval(String expression){\n\n int result = 0;\n\n\n\n return result;\n }", "public IExpressionValue getUserDefinedVariable(String key);", "Expression getValue();", "Expression getValue();", "public double evaluate() throws Exception {\r\n // this expression compare from variable\r\n throw new Exception(\"this expression contains a variable\");\r\n }", "String getVariable();", "public String getVariable();", "VariableDeclarationWithInitCS getResultVariable();", "private Expr expression() {\n return assignment();\n }", "public int getValue(ArrayList<variable> variables, arithmetic_ex e) {\n String id = e.getId(); // get id of arithmetic expression\n try {\n for (int i = 0; i < variables.size(); i++) {\n if ((variables.get(i).getId()).trim().equals(id)) // if variable id matches expression id\n return variables.get(i).getValue(); // return the value from the variable array list\n }\n throw new JuliaSyntaxException(\"compute\"); // hasn't returned a value yet, so throw an error\n } catch (JuliaSyntaxException jse) {\n\n }\n return -1;\n }", "@Override\r\n\tpublic void visit(VariableExpression variableExpression) {\n\r\n\t}", "private Object eval(Fact expr) {\n if (expr.getBool() != null) {\n if (\"true\".equals(expr.getBool())) {\n return true;\n } else {\n return false;\n }\n } else if (expr.getString() != null) {\n return expr.getString();\n } else if (expr.getIdent() != null) {\n if (RESULT_TYPE_VARIABLE.equals(resultType)) {\n return expr.getIdent();\n }\n return scope.getVariable(expr.getIdent());\n } else if (expr.getExpr() != null) {\n return eval(expr.getExpr(), resultType);\n } else if (expr.getLocator() != null) {\n return evalLocator(expr.getLocator());\n } else {\n return expr.getNumber();\n }\n }", "public void storeEval(final String expression, final String variableName);", "public Double visitVariable(simpleCalcParser.VariableContext ctx){\n\t\tString varname = ctx.x.getText();\n\t\tDouble d = env.get(varname);\n\t\tif (d==null){\n\t\t\tSystem.err.println(\"Variable \" + varname + \" is not defined. \\n\");\n\t\t\tSystem.exit(-1);\n\t\t}\n\t \treturn d;\n \t}", "@Override String opStr() { return \"var\"; }", "public Object getExpression();", "Expression getExpression();", "Expression getExpression();", "Expression getExpression();", "Expression getExpression();", "public Expression differentiate(String var) {\r\n // var might be a differentiate of other variable\r\n if (!this.toString().equalsIgnoreCase(var)) {\r\n return (Expression) new Num(0);\r\n }\r\n return (Expression) new Num(1);\r\n\r\n }", "@Override\n\tpublic double execute() {\n\t\tList<Variable> args = getArgs();\n\t\tVariable newVar = null;\n\t\tfor (int i = 0; i < args.size(); i += 2) {\n\t\t\tnewVar = new Variable(args.get(i).getKey(), args.get(i + 1).getValue());\n\t\t\tgetBackendController().setVariable(newVar);\n\t\t}\n\t\treturn newVar == null ? 0 : newVar.getValue();\n\t}", "@Override\n\tpublic double evaluate() {\n\t\tString var = myChildren.get(0).myChildren.get(0).toString(); //goes two levels down to get variable\n\t\tint start = (int) myChildren.get(0).myChildren.get(1).evaluate(); \n\t\tint end = (int) myChildren.get(0).myChildren.get(2).evaluate(); \n\t\tint increment = (int) myChildren.get(0).myChildren.get(3).evaluate(); \n\t\tdouble returnVal = 0;\n\t\tfor(int i = start; i < end; i += increment) {\n\t\t\tUserVariables.add(var, i);\n\t\t\tfor(Node child : myChildren) {\n\t\t\t\treturnVal = child.evaluate(); //repeatNode will contain a GroupNode, but GroupNodes know how to evaluate themselves\n\t\t\t}\n\t\t}\n\t\treturn returnVal;\n\t}", "@Override\n public double value(double x) {\n myParser.addVariable(variable, x);\n double eval = myParser.getValue();\n return eval;\n }", "@Override\n public Object evaluate(Environment env) {\n if (env.contains(name.getValue())) return new VariableExistsError(name);\n var value = expression.evaluate(env);\n env.put(name.getValue(), value);\n env.setCurrent(value);\n return value;\n }", "Expr expr();", "SEIntegerVariable getOperand1();", "public Variable getVariable(String name);", "public abstract IDecisionVariable getVariable();", "Expression getExp();", "<C, PM> VariableExp<C, PM> createVariableExp();", "public Name getVariable() {\n return variable;\n }", "@Override\n public void visit(VariableEvalNode variableEvalNode) {\n }", "Variable createVariable();", "Variable createVariable();", "private void expression(){\n\t\twhile (in.token != Token.exit){\n\t\t\tdouble value = terms();\n\t\t\tif(in.buffer.variableDetected && initialization == true){\n\t\t\t\tvariables.put(in.buffer.variable, new BigDecimal(value));\n\t\t\t\tin.buffer.variableDetected = false;\n\t\t\t}\n\t\t\telse\n\t\t\t\tif(initialization && !in.buffer.empty)\n\t\t\t\t\tSystem.out.println(\"= \" + value);\n\t\t\tinitialization = true;\n\t\t\tin.getToken(); \t\t\t//This command flushes the end of input marker \";\" which allows for new expressions to be taken in.\n\t\t}\n\t}", "@Override\n\tpublic int evaluate(){\n\t\treturn term.evaluate() + exp.evaluate();\n\t}", "Variable getTargetVariable();", "Expr getExpr();", "SEIntegerVariable getOperand2();", "public default Object expression() {\n\t\treturn info().values().iterator().next();\n\t}", "public String variable()\n\t{\n\t\treturn _var;\n\t}", "@Override\n public Integer visitAssign(CalculatorParser.AssignContext ctx) {\n String id = ctx.ID().getText(); // id is left-hand side of '='\n int value = visit(ctx.expr()); // compute value of expression on right\n memory.put(id, value); // store it in memory\n return value;\n }", "public final E getDecisionVariable() {\n return var;\n }", "public static void main(String[] args) {\n System.out.println(\"Need to count following expression\\n4.0 * (1 - (1.0/3) + (1.0/5) - (1.0/7) + (1.0/9) - (1.0/11))\\n\");\n System.out.println(\"First way - just make math in System.out.println\");\n System.out.println(\"4.0 * (1 - (1.0/3) + (1.0/5) - (1.0/7) + (1.0/9) - (1.0/11))=\" + (4.0 * (1 - (1.0/3) + (1.0/5) - (1.0/7) + (1.0/9) - (1.0/11))));\n System.out.println();\n System.out.println(\"Second way - create variables and put the expressions in () variables\\nThen make math in System.out.println using that variables\");\n double a = 4.0;\n double b = 1;\n double c = 1.0/3;\n double d = 1.0/5;\n double e = 1.0/7;\n double f = 1.0/9;\n double g = 1.0/11;\n System.out.print(\"4.0 * (1 - (1.0/3) + (1.0/5) - (1.0/7) + (1.0/9) - (1.0/11))=\");\n System.out.println(a * (b - c + d - e + f - g));\n System.out.println();\n System.out.println(\"One more way - add one more variable, count the result in that variable and print it\");\n double i = a * (b - c + d - e + f - g);\n String j = \"4.0 * (1 - (1.0/3) + (1.0/5) - (1.0/7) + (1.0/9) - (1.0/11))=\";\n System.out.println((j) + (i));\n\n\n\n }", "public Code visitVariableNode(ExpNode.VariableNode node) {\n beginGen(\"Variable\");\n SymEntry.VarEntry var = node.getVariable();\n Code code = new Code();\n code.genMemRef(staticLevel - var.getLevel(), var.getOffset());\n endGen(\"Variable\");\n return code;\n }", "DExpression getExpression();", "Expression getRValue();", "String getExpression();", "String getExpression();", "@Override\n\tpublic Expr visit(VarExpr e) {\n\t\treturn e;\n\t}", "private static Expression retrieveAssignExpressionValue(Expression expression) {\n return retrieveAssignExpression(expression).getValue();\n }", "protected IDecisionVariable getVariable() {\n return variable;\n }", "public String getVariable() {\n return variable;\n }", "double getActiveOperand();", "public String evaluate(String expression, String variable) {\n Lexer lex = new Lexer(expression);\n Parser parser = new Parser(lex);\n Expression exp;\n exp = parser.parse();\n String output = differentiate(exp, variable);\n return output;\n \n }", "Object getExpressionValue(ExpressionParams params);", "public Integer value(State state) {\n return state.lookup(variableName);\n }", "@Override\n public void visitVariable(VariableExpression variableExpression) {\n distance += variableExpression.interpret(context);\n }", "public static String differentiate(Parser.Expression exp, final String variable){\n return exp.accept(new Parser.Expression.Visitor<String>() {\n // This is the d(var)/dx case\n public String differentiate(Parser.Variable var){\n String expVar = var.toString();\n String output;\n if (expVar.equals(variable)){\n output = \"1\";\n return output;\n }\n else{\n output = \"0\";\n return output;\n }\n }\n // dc/dx case\n public String differentiate(Parser.Number num){\n String output = \"0\";\n return output;\n }\n // d(u+v)/dx case\n public String differentiate(Parser.Addition add){\n Expression leftExpr;\n Expression rightExpr;\n String outLeft;\n String outRight;\n leftExpr = add.left;\n rightExpr = add.right;\n outLeft = Differentiator.differentiate(leftExpr, variable);\n outRight = Differentiator.differentiate(rightExpr, variable);\n return \"(\" + outLeft + \" \" + \"+\" + \" \" + outRight+ \")\";\n }\n // d(u*v)/dx case\n public String differentiate(Parser.Multiplication mul){\n Expression leftExpr;\n Expression rightExpr;\n String outLeft;\n String outRight;\n leftExpr = mul.left;\n rightExpr = mul.right;\n String rightDiff = Differentiator.differentiate(rightExpr, variable);\n String leftDiff = Differentiator.differentiate(leftExpr, variable);\n outLeft = \"(\" + leftExpr.toString() + \" \" + \"*\" + \" \" + rightDiff + \")\";\n outRight = \"(\" + rightExpr.toString() + \" \" + \"*\" + \" \" + leftDiff + \")\";\n return \"(\" + outLeft + \" \" + \"+\" + \" \" + outRight + \")\";\n }\n \n });\n }", "public String evaluate(String expression);", "public String getVariable()\n {\n return this.strVariable;\n }", "public float evaluate() \n {\n return evaluate(expr, expr.length()-1);\n }", "public static void main(String[] args) {\n\n System.out.println(\"119.1+(28.2+37.3*(46.4-55.5)-4.6+(3/2)+1) = \" + evaluateExpression(\"119.1 + ( 28.2 + 37.3 * ( 46.4 - 55.5 ) - 4.6 + ( 3 / 2 ) + 1 )\"));\n\n}", "public Variable getVariableContaining(int offset);", "public Object accept(FEVisitor v)\n {\n return v.visitExprVar(this);\n }", "public Object computeValue() throws SyntaxException {\n List<String> strings = getStrings();\n return parameter.parse(strings);\n }", "R visitFreeVariable(Formula f, String name);", "public static Expression var(String var) {\n if (var.equals(\"e\")) {\n throw new RuntimeException(\"Variable can't be named e.\");\n }\n\n return new Variable(var);\n }", "XExpression getExpression();", "public int eval() {\n\t\t\treturn eval(expression.root);\n\t\t}", "public int getOperandA();", "DynamicVariable createDynamicVariable();", "public Object visitExpVar(ExpVar exp, Object arg)\n\tthrows Exception\n {\n\tEnvironment env = (Environment) arg;\n\tint val = env.get(exp.getVar());\n\treturn new Integer(val);\n }", "EvaluationResult evalExpression(ValueExp expr) { return evalExpression(expr, true); }", "public int executeOperation(){\n\t\tswitch (operation){\n\t\tcase 1: \n\t\t\treturn var1 + var2;\n\t\tcase 2: \n\t\t\treturn var1 - var2;\n\t\tcase 3: \n\t\t\treturn var1 * var2;\n\t\tcase 4: \n\t\t\treturn var1 / var2;\n\t\t default:\n\t\t\treturn 0;\n\t\t\n\t\t}\n\t}", "public Expression assign(String var, Expression expression) {\r\n // if this variable is val no meter if is capital or small letter.\r\n if (this.variable.equalsIgnoreCase(var)) {\r\n return expression;\r\n }\r\n return this;\r\n }", "public R visit(com.biosimilarity.lift.lib.scalar.Absyn.Mention p, A arg)\n {\n\n p.variableexpr_.accept(new VariableExprVisitor<R,A>(), arg);\n\n return null;\n }", "Variable getSourceVariable();", "private String compute(String equ,String op)\n {\n String equation = equ;\n Pattern mdPattern = Pattern.compile(\"(\\\\d+([.]\\\\d+)*)(([\"+op+\"]))(\\\\d+([.]\\\\d+)*)\");\n Matcher matcher\t\t= mdPattern.matcher(equation);\n while(matcher.find())\n {\n String[] arr = null;\n double ans = 0;\n String eq = matcher.group(0);//get form x*y\n if(eq.contains(op))\n {\n arr = eq.split(\"\\\\\"+op);//make arr\n if(op.equals(\"*\"))\n ans = Double.valueOf(arr[0])*Double.valueOf(arr[1]);//compute\n if(op.equals(\"/\"))\n ans = Double.valueOf(arr[0])/Double.valueOf(arr[1]);//compute\n if(op.equals(\"+\"))\n ans = Double.valueOf(arr[0])+Double.valueOf(arr[1]);//compute\n if(op.equals(\"-\"))\n ans = Double.valueOf(arr[0])-Double.valueOf(arr[1]);//compute\n }\n\n equation = matcher.replaceFirst(String.valueOf(ans));//replace in equation\n matcher = mdPattern.matcher(equation);//look for more matches\n }\n return equation;\n }", "public int getFunction() {\n\t\treturn var;\n\t}", "private void extractVars(Expression expr,List<Var> list){\n\t\tif (expr.isVar()){\n\t\t\tlist.add((Var)expr);}\n\t\telse {\n\t\t\tif (expr.isBinaryExpression()){\n\t\t\t\textractVars(((BinaryExpression)expr).getLeft(),list);\n\t\t\t\textractVars(((BinaryExpression)expr).getRight(),list);\n\t\t\t}\n\t\t}\n\t}", "String evaluate();", "public String isVar(Exp e) {\n if (e instanceof EId) {\n return ((EId) e).id_;\n } else\n throw new TypeException(\"Expected variable but found: \" + e);\n }", "int parseExpression() {\r\n\t\t\t\tint x = parseTerm();\r\n\t\t\t\tfor (;;) {\r\n\t\t\t\t\tif (eat('+'))\r\n\t\t\t\t\t\tx += parseTerm(); // addition\r\n\t\t\t\t\telse if (eat('-'))\r\n\t\t\t\t\t\tx -= parseTerm(); // subtraction\r\n\t\t\t\t\telse\r\n\t\t\t\t\t\treturn x;\r\n\t\t\t\t}\r\n\t\t\t}", "public Double getVariable(Object var) {\n Double val = constraints.get(var);\n if (val == null)\n return 0.0;\n else\n return val;\n }", "public Const evaluate();", "java.lang.String getVarValue();", "Result evaluate();", "@NotNull\n public final Promise<XExpression> calculateEvaluationExpression() {\n return myValueContainer.calculateEvaluationExpression();\n }", "public ElementVariable getVariable() {\n\t\treturn variable;\n\t}", "public String getVar()\n {\n return var;\n }", "public Object eval (Object expression);", "public int getTotalVariables() ;", "public static Temp evalExpression(CommonTree tree){\n\t\t// leaf node, int/float/id\n\n\t\tif (tree.getChildCount() == 0){\n\t\t\tTemp temp = new Temp(temperaryNum++,tree.getType(),tree.getText());\n\t\t\tif (tree.getType() == LittleParser.INTLITERAL){\n\t\t\t\tircode.add(new ThreeOpCode(\"STOREI\",tree.getText(),temp.getName()));\n\t\t\t}\n\t\t\telse if(tree.getType() == LittleParser.FLOATLITERAL){\n\t\t\t\tircode.add(new ThreeOpCode(\"STOREF\",tree.getText(),temp.getName()));\n\t\t\t}\n\t\t\telse{ // look up the variable in the symbol table to set type, use var_name instead of $Tx and recycle $Tx\n\t\t\t\ttemp.setType(allTables.lookupType(temp.getValue().trim()));\n\t\t\t\ttemp.setName(tree.getText());\n\t\t\t\ttemperaryNum--;\n\t\t\t}\n\t\t\treturn temp;\n\t\t}\n\t\t// Not a leaf node, evaluate children expressions\n\t\telse{\n\t\t\t// test for function call\n\t\t\tif (tree.getType() == LittleParser.FUNC_CALL){\n\t\t\t\t// add IR for evaluating the function and return temperary for return value\n\t\t\t\t// after it has been popped off the stack\n\t\t\t\treturn evalFunction(tree);\n\t\t\t}\n\t\t\t//\t\t\tif (tree.getChild(0).getChildCount() == 0 && tree.getChild(1).getChildCount() == 0){\n\t\t\t//\t\t\t\tif ()\n\t\t\t//\t\t\t}\n\t\t\tTemp left = evalExpression((CommonTree) tree.getChild(0));\n\t\t\tTemp right = evalExpression((CommonTree) tree.getChild(1));\n\n\t\t\tTemp temp = new Temp(temperaryNum++,left.getType(), \"EXP\");\n\t\t\tif (tree.getText().contains(\"+\")){ // add\n\t\t\t\tif (left.getType() == LittleParser.INTLITERAL && right.getType() == LittleParser.INTLITERAL){\n\t\t\t\t\tircode.add(new ThreeOpCode(\"ADDI\",left.getName(),right.getName(),temp.getName()));\n\t\t\t\t}\n\t\t\t\telse if (left.getType() == LittleParser.FLOATLITERAL || right.getType() == LittleParser.FLOATLITERAL){\n\t\t\t\t\tircode.add(new ThreeOpCode(\"ADDR\",left.getName(),right.getName(),temp.getName()));\n\t\t\t\t} //both parameters\n\t\t\t\telse if (left.getType() == -1 && right.getType() == -1){\n\t\t\t\t\t//System.out.println(left.getName() + \": \" + left.getType() + \" \" + right.getName() + \": \" + right.getType());\n\t\t\t\t\t// need to lookup symbol in main and then global to find type\n\t\t\t\t\tint ltype = allTables.lookupType(left.name);\n\t\t\t\t\tint rtype = allTables.lookupType(right.name);\n\t\t\t\t\tif (ltype == LittleParser.INTLITERAL && rtype == LittleParser.INTLITERAL){\n\t\t\t\t\t\tircode.add(new ThreeOpCode(\"ADDI\", left.getName(),right.getName(),temp.getName()));\n\t\t\t\t\t}\n\t\t\t\t\telse{\n\t\t\t\t\t\tircode.add(new ThreeOpCode(\"ADDR\", left.getName(),right.getName(),temp.getName()));\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\telse{\n\t\t\t\t\tircode.add(new ThreeOpCode(\"ADDI\",left.getName(),right.getName(),temp.getName()));\n\t\t\t\t\ttemp.setType(LittleParser.INTLITERAL);\n\t\t\t\t}\n\t\t\t}\n\t\t\telse if (tree.getText().contains(\"-\")){ // subtract\n\t\t\t\tif (left.getType() == LittleParser.INTLITERAL && right.getType() == LittleParser.INTLITERAL){\n\t\t\t\t\tircode.add(new ThreeOpCode(\"SUBI\",left.getName(),right.getName(),temp.getName()));\n\t\t\t\t}\n\t\t\t\telse if (left.getType() == LittleParser.FLOATLITERAL || right.getType() == LittleParser.FLOATLITERAL){\n\t\t\t\t\tircode.add(new ThreeOpCode(\"SUBR\",left.getName(),right.getName(),temp.getName()));\n\t\t\t\t}\n\t\t\t\telse if (left.getType() == -1 && right.getType() == -1){\n\t\t\t\t\t//System.out.println(left.getName() + \": \" + left.getType() + \" \" + right.getName() + \": \" + right.getType());\n\t\t\t\t\t// need to lookup symbol in main and then global to find type\n\t\t\t\t\tint ltype = allTables.lookupType(left.name);\n\t\t\t\t\tint rtype = allTables.lookupType(right.name);\n\t\t\t\t\tif (ltype == LittleParser.INTLITERAL && rtype == LittleParser.INTLITERAL){\n\t\t\t\t\t\tircode.add(new ThreeOpCode(\"SUBI\", left.getName(),right.getName(),temp.getName()));\n\t\t\t\t\t}\n\t\t\t\t\telse{\n\t\t\t\t\t\tircode.add(new ThreeOpCode(\"SUBR\", left.getName(),right.getName(),temp.getName()));\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\telse{\n\t\t\t\t\tircode.add(new ThreeOpCode(\"SUBI\",left.getName(),right.getName(),temp.getName()));\n\t\t\t\t\ttemp.setType(LittleParser.INTLITERAL);\n\t\t\t\t}\n\t\t\t}\n\t\t\telse if (tree.getText().contains(\"*\")){ // multiply\n\t\t\t\tif (left.getType() == LittleParser.INTLITERAL && right.getType() == LittleParser.INTLITERAL){\n\t\t\t\t\t//System.out.println(\"MULTI \" + left.getName() + \" \" + right.getName() + \" \"+temp.getName());\n\t\t\t\t\tircode.add(new ThreeOpCode(\"MULI\",left.getName(),right.getName(),temp.getName()));\n\t\t\t\t}\n\t\t\t\telse if (left.getType() == LittleParser.FLOATLITERAL || right.getType() == LittleParser.FLOATLITERAL){\n\t\t\t\t\t//System.out.println(\"MULTF \" + left.getName() + \" \" + right.getName() + \" \"+temp.getName());\n\t\t\t\t\tircode.add(new ThreeOpCode(\"MULR\",left.getName(),right.getName(),temp.getName()));\n\t\t\t\t}\n\t\t\t\telse if (left.getType() == -1 && right.getType() == -1){\n\t\t\t\t\t//System.out.println(left.getName() + \": \" + left.getType() + \" \" + right.getName() + \": \" + right.getType());\n\t\t\t\t\t// need to lookup symbol in main and then global to find type\n\t\t\t\t\tint ltype = allTables.lookupType(left.name);\n\t\t\t\t\tint rtype = allTables.lookupType(right.name);\n\t\t\t\t\tif (ltype == LittleParser.INTLITERAL && rtype == LittleParser.INTLITERAL){\n\t\t\t\t\t\tircode.add(new ThreeOpCode(\"MULI\", left.getName(),right.getName(),temp.getName()));\n\t\t\t\t\t}\n\t\t\t\t\telse{\n\t\t\t\t\t\tircode.add(new ThreeOpCode(\"MULR\", left.getName(),right.getName(),temp.getName()));\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\telse{\n\t\t\t\t\t//System.out.println(\"MULTI \" + left.getName() + \" \" + right.getName() + \" \"+temp.getName());\n\t\t\t\t\tircode.add(new ThreeOpCode(\"MULI\",left.getName(),right.getName(),temp.getName()));\n\t\t\t\t\ttemp.setType(LittleParser.INTLITERAL);\n\t\t\t\t}\n\t\t\t}\n\t\t\telse{ // divide\n\t\t\t\tif (right.getType() == LittleParser.INTLITERAL && left.getType() == LittleParser.FLOATLITERAL){\n\t\t\t\t\t//System.out.println(\"DIVI \" + left.getName() + \" \" + right.getName() + \" \"+temp.getName());\n\t\t\t\t\tircode.add(new ThreeOpCode(\"DIVI\",left.getName(),right.getName(),temp.getName()));\n\t\t\t\t}\n\t\t\t\telse if (right.getType() == LittleParser.FLOATLITERAL || left.getType() == LittleParser.FLOATLITERAL){\n\t\t\t\t\t//System.out.println(\"DIVF \" + left.getName() + \" \" + right.getName() + \" \"+temp.getName());\n\t\t\t\t\tircode.add(new ThreeOpCode(\"DIVR\",left.getName(),right.getName(),temp.getName()));\n\t\t\t\t}\n\t\t\t\telse if (left.getType() == -1 && right.getType() == -1){\n\t\t\t\t\t//System.out.println(left.getName() + \": \" + left.getType() + \" \" + right.getName() + \": \" + right.getType());\n\t\t\t\t\t// need to lookup symbol in main and then global to find type\n\t\t\t\t\tint ltype = allTables.lookupType(left.name);\n\t\t\t\t\tint rtype = allTables.lookupType(right.name);\n\t\t\t\t\tif (ltype == LittleParser.INTLITERAL && rtype == LittleParser.INTLITERAL){\n\t\t\t\t\t\tircode.add(new ThreeOpCode(\"DIVI\", left.getName(),right.getName(),temp.getName()));\n\t\t\t\t\t}\n\t\t\t\t\telse{\n\t\t\t\t\t\tircode.add(new ThreeOpCode(\"DIVR\", left.getName(),right.getName(),temp.getName()));\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\telse{\n\t\t\t\t\t//System.out.println(\"DIVI \" + left.getName() + \" \" + right.getName() + \" \"+temp.getName());\n\t\t\t\t\tircode.add(new ThreeOpCode(\"DIVI\",left.getName(),right.getName(),temp.getName()));\n\t\t\t\t\ttemp.setType(LittleParser.INTLITERAL);\n\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn temp;\n\t\t}\n\n\t}", "ExpressionCalculPrimary getExpr();", "@Override\r\n\tpublic double eval() {\r\n\t\tresult = op.apply(arg.eval());\r\n\t\treturn result;\r\n\t}" ]
[ "0.68929374", "0.66963154", "0.6660309", "0.66215277", "0.6620974", "0.658324", "0.658324", "0.6570967", "0.65543306", "0.6553024", "0.6536018", "0.6485719", "0.6454498", "0.6430528", "0.6368686", "0.63563675", "0.6350118", "0.6246874", "0.6241022", "0.6237461", "0.6237461", "0.6237461", "0.6237461", "0.6231925", "0.6230184", "0.6203045", "0.6190717", "0.61565584", "0.6153517", "0.6145072", "0.6143925", "0.61386514", "0.6130756", "0.6125187", "0.6107633", "0.6099567", "0.608858", "0.608858", "0.6078999", "0.60634637", "0.60569596", "0.60221845", "0.60180664", "0.6012118", "0.60022545", "0.59898055", "0.59886354", "0.59718746", "0.5968616", "0.59631824", "0.5962397", "0.5947337", "0.5947337", "0.5929851", "0.59279275", "0.5910853", "0.59073997", "0.5903144", "0.5900436", "0.5898876", "0.58931476", "0.5878031", "0.58760244", "0.58744246", "0.58690566", "0.5848658", "0.58351856", "0.58337384", "0.58330065", "0.583155", "0.58309174", "0.5826581", "0.58204526", "0.5807411", "0.58023065", "0.57738465", "0.57507724", "0.57496065", "0.5740437", "0.5736737", "0.5734414", "0.5731557", "0.573029", "0.5722114", "0.57161695", "0.57082397", "0.57068205", "0.5703306", "0.56932473", "0.568828", "0.5684539", "0.5683754", "0.5678752", "0.5671233", "0.5665866", "0.5665506", "0.56635565", "0.56582767", "0.5651835", "0.5645896" ]
0.5827346
71
If the arithemtic expression is an id, the method finds that id in the variable array list. The value of that id is then returned. If it is not found, an error is thrown.
public int getValue(ArrayList<variable> variables, arithmetic_ex e) { String id = e.getId(); // get id of arithmetic expression try { for (int i = 0; i < variables.size(); i++) { if ((variables.get(i).getId()).trim().equals(id)) // if variable id matches expression id return variables.get(i).getValue(); // return the value from the variable array list } throw new JuliaSyntaxException("compute"); // hasn't returned a value yet, so throw an error } catch (JuliaSyntaxException jse) { } return -1; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public String isVar(Exp e) {\n if (e instanceof EId) {\n return ((EId) e).id_;\n } else\n throw new TypeException(\"Expected variable but found: \" + e);\n }", "@Override\n public EnvironmentVariable find(Long id) throws Exception {\n return null;\n }", "public IVariable getVariable(Integer id) {\n return null;\n }", "public Variable getVariableContaining(int offset);", "public Employee findById(int id) throws InvalidOperationException {\n try {\n return employeeArray[id];\n } catch (ArrayIndexOutOfBoundsException e) {\n throw new InvalidOperationException(\"Error finding employee \", e);\n }\n }", "public int find(int p) {\r\n return id[p];\r\n }", "public E lookup(String var) throws IOException {\n E exp = get(var);\n if (exp != null) {\n return get(var);\n } else {\n throw new IOException(\"Exception ( VarID = \" + var + \") : Le VarId n'a pas été défini\");\n }\n }", "private int getFieldId(VectorAccessible accessible, LogicalExpression expr) {\n return getFieldIds(accessible, expr)[0];\n }", "public Rule idExprReq()\n \t{\n \t\treturn firstOf(field(), call());\n \t}", "Expression getExpression(long id);", "public Value lookup (String name){\n Closure exist = find_var(name);\n return exist.getValues().get(name);\n }", "public Patient returnPatFromId(String id)\r\n\t{\r\n\t\tPatient foundPatient = null;// blank patient is made\r\n\r\n\t\tfor(int i=0; arrayPatients[i]!=null ;i++)//loops through the array\r\n\t\t{\r\n\t\t\tif(arrayPatients[i].patientID.equals(id))//if the id passed matches the id of that term in the array it will save that array term \r\n\t\t\t{\r\n\t\t\t\tfoundPatient = arrayPatients[i];\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn foundPatient;// that saved array term is then returned\r\n\t}", "public IExpressionValue getUserDefinedVariable(String key);", "private int find(int[] roots , int id){\n\n if (roots[id] == id) return id;\n roots[id] = find(roots, roots[id]);\n return roots[id];\n }", "public Rule idExpr()\n \t{\n \t\treturn firstOf(idExprReq(), id());\n \t}", "@Override\n\tpublic String visitArrAssignSt(ArrAssignStContext ctx) {\n\t\tString key=visitTerminal((TerminalNode)ctx.getChild(0));\n\t\tRecord id= table.lookup(key);\n\t\tif (id==null) throw new RuntimeException(\"Identifier \"+key+\" is not declared\");\t\n\t\tif (!id.getReturnType().equals(\"int[]\")) throw new RuntimeException(\"Identifier \"+key+\" is not int[]\");\t\t\n\t\tParseTree cur = ctx.getChild(2);\n\t\tString temp = null;\n\t\tif(cur == ctx.INTEG()){\n\t\t\ttemp = \"int\";\n\t\t}\n\t\telse if(cur == ctx.ID(1)){\n\t\t\tkey=visitTerminal((TerminalNode)cur);\n\t\t\tid= table.lookup(key);\n\t\t\tif (id==null) throw new RuntimeException(\"Identifier \"+key+\" is not declared\");\t\t\t\t\t\n\t\t\ttemp = id.getReturnType();\n\t\t}\n\t\telse{\n\t\t\ttemp = visit(cur);\n\t\t}\n\t\tif(!temp.equals(\"int\"))throw new RuntimeException(\"Only type int inside ID[]\");\n\t\tif(!visit(ctx.getChild(5)).equals(\"int\"))throw new RuntimeException(\"Only type int assigned on ID[]\");\n\t\treturn(\"int\");\n\t}", "String getValueId();", "public Object lookup(String id) {\n return null;\n }", "@Override\n\tpublic Variable findById(int variableId) {\n\t\treturn variableJpaRepository.findById(variableId).get();\n\t}", "public int findVarInPackage(String varName, int packageId){\n if(packageId == -1\n || !(singleCollect.getEntities().get(packageId) instanceof AbsFLDEntity) ) {\n return -1;\n }\n for (int fileId : singleCollect.getEntities().get(packageId).getChildrenIds()) {\n int varId = nameSearchFile.findVarInFile(varName, fileId);\n if (varId != -1) {\n return varId;\n }\n }\n return -1;\n }", "private int getIndexById(String id) {\n Base element;\n int i = 0;\n int result = -1;\n try {\n element = this.simpleArray.get(i);\n while (element != null) {\n if (id.equals(element.getId())) {\n result = i;\n break;\n }\n element = this.simpleArray.get(++i);\n }\n } catch (ArrayIndexOutOfBoundsException e) {\n e.printStackTrace();\n }\n return result;\n }", "BasicException.Parameter getIdParameter();", "private @Nullable IdentifierToken eatId() {\n if (peekId()) {\n return eatIdOrKeywordAsId();\n } else {\n reportExpectedError(peekToken(), TokenType.IDENTIFIER);\n if (peekIdOrKeyword()) {\n return eatIdOrKeywordAsId();\n } else {\n return null;\n }\n }\n }", "public IString getVariableIdentifier() {\n\treturn VARIABLE_IDENTIFIER.get(getNd(), this.address);\n }", "IntVar selectVariable(IntVar[] v) {\r\n\r\n if (v.length != 0) {\r\n int index = 0;\r\n int smallestDomain = Integer.MAX_VALUE;\r\n for(int i = 0; i< v.length-1; i++){\r\n if(v[i].domain.getSize()<smallestDomain){\r\n index = i;\r\n smallestDomain = v[i].domain.getSize();\r\n }\r\n\r\n }\r\n if(v[index].min() == v[index].max()){\r\n\r\n searchVariables = new IntVar[v.length-1];\r\n for (int i = 0; i < v.length-1; i++) {\r\n if(i<index){\r\n searchVariables[i] = v[i];\r\n }\r\n else searchVariables[i] = v[i+1];\r\n\r\n }\r\n }\r\n else{\r\n searchVariables = new IntVar[v.length];\r\n for(int i = 0; i < v.length; i++){\r\n searchVariables[i] = v[i];\r\n }\r\n }\r\n return v[index];\r\n\r\n }\r\n else {\r\n System.err.println(\"Zero length list of variables for labeling\");\r\n return new IntVar(store);\r\n }\r\n }", "static int varno(String v) {\n int i=0;\n if (varlist==null) {System.out.println(\"Varlist null\");}\n while (i<varlist.size() && !v.equals( ((Variable)(varlist.get(i))).ident)) {i++;}\n if (i==varlist.size()) {i=-1;}\n return i;\n }", "private Variable findVariable(String varToFind){\r\n\t\tScope curScope = this;\r\n\t\twhile (curScope!=null) {\r\n\t\t\tif(curScope.contains(varToFind)){\r\n\t\t\t\treturn curScope.getVariable(varToFind);\r\n\t\t\t}else{\r\n\t\t\t\tcurScope = curScope.parent;\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn null;\r\n\t}", "public boolean findPatientId(String id)\r\n\t{\r\n\t\t//ID is tested to see if it appears in the array \r\n\t\tnextPatientLocation = 0;\r\n\t\tboolean foundId = false;\r\n\t\ttry\r\n\t\t{\r\n\t\t\t//loops through the array\r\n\t\t\tfor(int i=0; arrayPatients[i] != null; i++)\r\n\t\t\t{\r\n\t\t\t\tif(id.equals(arrayPatients[i].patientID))\r\n\t\t\t\t{\r\n\t\t\t\t\tfoundId = true;\r\n\t\t\t\t\treturn foundId;\r\n\t\t\t\t}\t\t\r\n\t\t\t}\r\n\t\t\t//returns if patient exists \r\n\t\t\treturn foundId;\r\n\t\t}\r\n\t\t//throws exception if errror occurs\r\n\t\tcatch(Exception e)\r\n\t\t{\r\n\t\t\treturn false;\r\n\t\t}\r\n\t}", "private static int isVariable(ArrayList<Variable> vars, String name) {\n\t\tfor (int i = 0; i < vars.size(); i++) {\n\t\t\tif (vars.get(i).name.equals(name)) {\n\t\t\t\treturn i;\n\t\t\t}\n\t\t}\n\t\treturn -1;\n\t}", "public Variable getVariable(String name);", "protected Identifier parseDatasetIdentifier( Element element, String xPathQuery )\n throws XMLParsingException,\n InvalidCapabilitiesException {\n\n Element identifierElement = (Element) XMLTools.getRequiredNode( element, xPathQuery, nsContext );\n\n String value = XMLTools.getStringValue( identifierElement ).trim();\n if ( \"\".equals( value ) ) {\n throw new InvalidCapabilitiesException( Messages.getMessage( \"WPVS_NO_VALID_IDENTIFIER\", \"dataset\" ) );\n }\n URI codeSpace = XMLTools.getNodeAsURI( identifierElement, \"@codeSpace\", nsContext, null );\n Identifier id = new Identifier( value, codeSpace );\n if ( datasetIdentifiers.contains( id.toString() ) ) {\n throw new InvalidCapabilitiesException( Messages.getMessage( \"WPVS_NO_UNIQUE_IDENTIFIER\",\n \"datasets\",\n id.toString() ) );\n\n }\n datasetIdentifiers.add( id.toString() );\n\n return id;\n }", "public IVariable getVariable(int index) {\n return null;\n }", "@Override\n public void execute() {\n\n String value=\"\";\n ////System.out.println(expCtx.printBlock().printExtra().arrayCall().getText());\n boolean chh = false;\n try {\n chh = expCtx.printBlock().printExtra().expression().assignmentExpression().assignment().additiveExpression().multiplicativeExpression().unaryExpression().unaryExpressionNotPlusMinus().postfixExpression().primary().arrayCall()!=null;\n }catch (NullPointerException e){\n\n }\n if (expCtx.printBlock().printExtra().arrayCall()!=null\n ||chh){\n //System.out.println(\"FOUND ARRAY\");\n List<Integer> matchList = new ArrayList<Integer>();\n Pattern regex = Pattern.compile(\"\\\\[(.*?)\\\\]\");\n //System.out.println(expCtx.printBlock().getText());\n Matcher regexMatcher = regex.matcher(expCtx.printBlock().getText());\n List<Integer> dummy = null;\n while (regexMatcher.find()) {//Finds Matching Pattern in String\n //System.out.println(\"IN MATCHER\");\n //System.out.println(ClypsCustomVisitor.testingExpression(regexMatcher.group(1).trim(), dummy, expCtx.start.getLine()));\n matchList.add(Integer.parseInt(ClypsCustomVisitor.testingExpression(regexMatcher.group(1).trim(), dummy, expCtx.start.getLine())));//Fetching Group from String\n }\n value = ClypsCustomVisitor.testingExpression(expCtx.printBlock().getText(), matchList, expCtx.start.getLine());\n //System.out.println(value);\n }else {\n //System.out.println(\"NOT ARRAY\");\n List<Integer> dummy = null;\n value = ClypsCustomVisitor.testingExpression(expCtx.printBlock().getText(), dummy, expCtx.start.getLine());\n //System.out.println(value);\n }\n\n if (value.contains(\"\\\"\")&&value.matches(\".*[a-zA-Z]+.*\")&&value.matches(\".*[0-9]+.*\")){\n //System.out.println(\"WE IN\");\n String[] temp = value.split(\"\\\\+\");\n ArrayList<String> store = new ArrayList<>();\n for (int i = 0;i<temp.length;i++){\n try {\n store.add(new Expression(temp[i]).eval().toPlainString());\n }catch (NullPointerException e){\n store.add(temp[i]);\n }\n }\n String send=\"\";\n for (String i:store){\n //System.out.println(i);\n send=send.concat(i);\n }\n //System.out.println(\"WE OUT\");\n //System.out.println(send);\n\n send=send.replaceAll(\"\\\"\",\"\").replaceAll(\"\\\\+\",\"\");\n ////System.out.println(\"ACTUAL PRINT\");\n if (expCtx.printHead().getText().contains(\"ln\"))\n System.out.println(send);\n else\n System.out.print(send);\n }else {\n //System.out.println(\"YEP\");\n //CAUTION: REPLACES ALL + SIGNS\n value=value.replaceAll(\"\\\"\",\"\").replaceAll(\"\\\\+\",\"\");\n ////System.out.println(\"ACTUAL PRINT\");\n if (expCtx.printHead().getText().contains(\"ln\"))\n System.out.println(value);\n else\n System.out.print(value);\n }\n\n\n\n\n\n }", "public VarType getVarById(MappingType mapping, String varId) {\n\t\tEList<RepresentsType> repList = mapping.getRepresents();\n\t\tfor(RepresentsType rep : repList) {\n\t\t\ttry {\n\t\t\t\tVarType var = rep.getVariable();\n\t\t\t\tif(var.getId().equals(varId)) {\n\t\t\t\t\treturn var;\n\t\t\t\t}\n\t\t\t} catch(Exception e) {\n\t\t\t}\n\t\t}\n\t\treturn null;\n\t}", "private static int find_value(String b)\n {\n int store = 0;\n List<String> name = new ArrayList<String>(library.return_name());\n //System.out.println(name);\n for(int x = 0; x < name.size(); x++)\n {\n if(name.get(x).charAt(0) == b.charAt(0))\n store = x;\n }\n List<Integer> value = new ArrayList<Integer>(library.return_value());\n return value.get(store);\n }", "I getIdentifier();", "private int extractInt() {\n\t\tint startIndex = index;\n\t\tfor (; index < exprLen; index++) {\n\t\t\tchar c = expr.charAt(index);\n\t\t\tif (!Character.isDigit(c)) {\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\n\t\tint endIndex = index;\n\t\tint value;\n\t\ttry {\n\t\t\tvalue = Integer.parseInt(expr.substring(startIndex, endIndex));\n\t\t} catch (NumberFormatException e) {\n\t\t\tthrow new IllegalArgumentException(e.getMessage());\n\t\t}\n\n\t\treturn value;\n\t}", "public static int indexOf(String[] theArray, String id) {\n\n for (int i = 0; i < theArray.length; i++) {\n\t\t\tif (id.equals(theArray[i])) return i;\n\t\t}\n\n\t\treturn -1;\n\t}", "public int expressionEval(String expression){\n\n int result = 0;\n\n\n\n return result;\n }", "public Variable getVariable() {\r\n\t\tObject ob = elementAt(0);\r\n\t\tif (size() == 1 && ob instanceof Variable) {\r\n\t\t\treturn (Variable) ob;\r\n\t\t}\r\n\t\treturn null;\r\n\t}", "@Override\n public int find(int p) {\n while (p != id[p]) { p = id[p]; }\n return p;\n }", "private @Nullable IdentifierToken eatIdOrKeywordAsId() {\n Token token = nextToken();\n if (token.type == TokenType.IDENTIFIER) {\n return (IdentifierToken) token;\n } else if (Keywords.isKeyword(token.type)) {\n return new IdentifierToken(token.location, Keywords.get(token.type).toString());\n } else {\n reportExpectedError(token, TokenType.IDENTIFIER);\n }\n return null;\n }", "private int a(alq paramalq, int paramInt)\r\n/* 40: */ {\r\n/* 41: 61 */ for (int i = 0; i < this.a.length; i++) {\r\n/* 42: 62 */ if ((this.a[i] != null) && (this.a[i].b() == paramalq) && (this.a[i].i() == paramInt)) {\r\n/* 43: 63 */ return i;\r\n/* 44: */ }\r\n/* 45: */ }\r\n/* 46: 66 */ return -1;\r\n/* 47: */ }", "@SneakyThrows\n @Override\n public DeveloperSkill findByID(Long id) {\n return null; //parse.get(Math.toIntExact(id));\n }", "public final Expr primary() throws RecognitionException {\r\n Expr result = null;\r\n\r\n int primary_StartIndex = input.index();\r\n\r\n Token Int5=null;\r\n Token Ident6=null;\r\n Token StringLiteral7=null;\r\n Expr x =null;\r\n\r\n\r\n try {\r\n if ( state.backtracking>0 && alreadyParsedRule(input, 12) ) { return result; }\r\n\r\n // C:\\\\Users\\\\caytekin\\\\Documents\\\\GitHub\\\\sea-of-ql\\\\caytekin\\\\QLJava/src/org/uva/sea/ql/parser/antlr/QL.g:92:3: ( Int | Ident | StringLiteral | '(' x= orExpr ')' )\r\n int alt7=4;\r\n switch ( input.LA(1) ) {\r\n case Int:\r\n {\r\n alt7=1;\r\n }\r\n break;\r\n case Ident:\r\n {\r\n alt7=2;\r\n }\r\n break;\r\n case StringLiteral:\r\n {\r\n alt7=3;\r\n }\r\n break;\r\n case 21:\r\n {\r\n alt7=4;\r\n }\r\n break;\r\n default:\r\n if (state.backtracking>0) {state.failed=true; return result;}\r\n NoViableAltException nvae =\r\n new NoViableAltException(\"\", 7, 0, input);\r\n\r\n throw nvae;\r\n\r\n }\r\n\r\n switch (alt7) {\r\n case 1 :\r\n // C:\\\\Users\\\\caytekin\\\\Documents\\\\GitHub\\\\sea-of-ql\\\\caytekin\\\\QLJava/src/org/uva/sea/ql/parser/antlr/QL.g:92:5: Int\r\n {\r\n Int5=(Token)match(input,Int,FOLLOW_Int_in_primary476); if (state.failed) return result;\r\n\r\n if ( state.backtracking==0 ) { result = new Int(Integer.parseInt((Int5!=null?Int5.getText():null))); }\r\n\r\n }\r\n break;\r\n case 2 :\r\n // C:\\\\Users\\\\caytekin\\\\Documents\\\\GitHub\\\\sea-of-ql\\\\caytekin\\\\QLJava/src/org/uva/sea/ql/parser/antlr/QL.g:93:5: Ident\r\n {\r\n Ident6=(Token)match(input,Ident,FOLLOW_Ident_in_primary486); if (state.failed) return result;\r\n\r\n if ( state.backtracking==0 ) { result = new Ident((Ident6!=null?Ident6.getText():null)); }\r\n\r\n }\r\n break;\r\n case 3 :\r\n // C:\\\\Users\\\\caytekin\\\\Documents\\\\GitHub\\\\sea-of-ql\\\\caytekin\\\\QLJava/src/org/uva/sea/ql/parser/antlr/QL.g:94:5: StringLiteral\r\n {\r\n StringLiteral7=(Token)match(input,StringLiteral,FOLLOW_StringLiteral_in_primary494); if (state.failed) return result;\r\n\r\n if ( state.backtracking==0 ) { result = new StringLiteral((StringLiteral7!=null?StringLiteral7.getText():null)); }\r\n\r\n }\r\n break;\r\n case 4 :\r\n // C:\\\\Users\\\\caytekin\\\\Documents\\\\GitHub\\\\sea-of-ql\\\\caytekin\\\\QLJava/src/org/uva/sea/ql/parser/antlr/QL.g:95:5: '(' x= orExpr ')'\r\n {\r\n match(input,21,FOLLOW_21_in_primary502); if (state.failed) return result;\r\n\r\n pushFollow(FOLLOW_orExpr_in_primary506);\r\n x=orExpr();\r\n\r\n state._fsp--;\r\n if (state.failed) return result;\r\n\r\n match(input,22,FOLLOW_22_in_primary508); if (state.failed) return result;\r\n\r\n if ( state.backtracking==0 ) { result = x; }\r\n\r\n }\r\n break;\r\n\r\n }\r\n }\r\n catch (RecognitionException re) {\r\n reportError(re);\r\n recover(input,re);\r\n }\r\n\r\n finally {\r\n \t// do for sure before leaving\r\n if ( state.backtracking>0 ) { memoize(input, 12, primary_StartIndex); }\r\n\r\n }\r\n return result;\r\n }", "public HexModel searchByID(String id) {\n\t\tfor (int y = 0; y < grid[0].length; y++) {\r\n\t\t\tfor (int x = 0; x < grid[y].length; x++) {\r\n\t\t\t\tif (grid[y][x] != null && grid[y][x].getId().equals(id))\r\n\t\t\t\t\treturn grid[y][x];\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\treturn null;\r\n\t}", "protected TopicMapObject identifyByVariable(JellyContext ctx)\n throws JellyTagException {\n\n // name of variable supplied?\n if (variable == null)\n return null;\n\n Object o = ctx.getVariable(variable);\n String identifier = \"Variable \" + variable;\n return getReference(o, identifier);\n\n }", "public default Object expression() {\n\t\treturn info().values().iterator().next();\n\t}", "public ASTVariableDeclaratorId getVarId() {\n return (ASTVariableDeclaratorId) getChild(1);\n }", "private static int validateId(Artist[] painterObject, int arrayCount) {\n\t\tboolean flag = true;\n\t\tSystem.out.println(\"Enter painter id:\");\n\t\tint id = AllValidationChecks.positiveIntegerCheck();\n\t\tfor (int i = 0; i < arrayCount; i++) {\n\t\t\tif (id == painterObject[i].getId()) {\n\t\t\t\tflag = false;\n\t\t\t}\n\t\t}\n\t\tif (flag) {\n\t\t\treturn id;\n\t\t} else {\n\t\t\tSystem.out.println(\"id already exists\");\n\t\t\treturn validateId(painterObject, arrayCount);\n\t\t}\n\t}", "public ModelGame findGameById () {\n Scanner input = new Scanner(System.in); // Create a Scanner object\n System.out.println(\"Enter the ID of the game you wish to return:\");\n int id = input.nextInt(); // Read user input of id\n for (ModelGame game : this.allGames) {\n if (game.getGameId() == id) {\n return game;\n }\n }\n return null;\n }", "@Override\r\n\tpublic Object visitIdentExpression(IdentExpression identExpression,\r\n\t\t\tObject arg) throws Exception {\r\n\t\tString ident = identExpression.identToken.getText();\r\n\t\tDeclaration dec = symbolTable.lookup(ident);\r\n\t\tcheck(dec != null, \"undeclare IdentExpression\", identExpression);\r\n//\t\tDeclaration dec = symbolTable.lookup(ident);\r\n\t\tif (dec instanceof VarDec) {\r\n\t\t\tVarDec vd = (VarDec) dec;\r\n\t\t\tString identType = (String) vd.type.visit(this, arg);\r\n\t\t\tidentExpression.setType(identType);\r\n\t\t\treturn identType;\r\n\t\t} else {\r\n\t\t\tthrow new TypeCheckException(ident + \" is not defined as a variable\", identExpression);\r\n\t\t}\t\t\r\n\t}", "public final void variableDeclaratorId() throws RecognitionException {\n int variableDeclaratorId_StartIndex = input.index();\n try { dbg.enterRule(getGrammarFileName(), \"variableDeclaratorId\");\n if ( getRuleLevel()==0 ) {dbg.commence();}\n incRuleLevel();\n dbg.location(396, 1);\n\n try {\n if ( state.backtracking>0 && alreadyParsedRule(input, 46) ) { return ; }\n // Java.g:397:5: ( Identifier ( '[' ']' )* )\n dbg.enterAlt(1);\n\n // Java.g:397:9: Identifier ( '[' ']' )*\n {\n dbg.location(397,9);\n match(input,Identifier,FOLLOW_Identifier_in_variableDeclaratorId1770); if (state.failed) return ;\n dbg.location(397,20);\n // Java.g:397:20: ( '[' ']' )*\n try { dbg.enterSubRule(61);\n\n loop61:\n do {\n int alt61=2;\n try { dbg.enterDecision(61);\n\n int LA61_0 = input.LA(1);\n\n if ( (LA61_0==48) ) {\n alt61=1;\n }\n\n\n } finally {dbg.exitDecision(61);}\n\n switch (alt61) {\n \tcase 1 :\n \t dbg.enterAlt(1);\n\n \t // Java.g:397:21: '[' ']'\n \t {\n \t dbg.location(397,21);\n \t match(input,48,FOLLOW_48_in_variableDeclaratorId1773); if (state.failed) return ;\n \t dbg.location(397,25);\n \t match(input,49,FOLLOW_49_in_variableDeclaratorId1775); if (state.failed) return ;\n\n \t }\n \t break;\n\n \tdefault :\n \t break loop61;\n }\n } while (true);\n } finally {dbg.exitSubRule(61);}\n\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, 46, variableDeclaratorId_StartIndex); }\n }\n dbg.location(398, 5);\n\n }\n finally {\n dbg.exitRule(getGrammarFileName(), \"variableDeclaratorId\");\n decRuleLevel();\n if ( getRuleLevel()==0 ) {dbg.terminate();}\n }\n\n return ;\n }", "public final Object ecmaGet(Context cx, Object id)\n {\n if (cx == null) cx = Context.getCurrentContext();\n XMLName xmlName = lib.toXMLNameOrIndex(cx, id);\n if (xmlName == null) {\n long index = ScriptRuntime.lastUint32Result(cx);\n // XXX Fix this cast\n Object result = get((int)index, this);\n if (result == Scriptable.NOT_FOUND) {\n result = Undefined.instance;\n }\n return result;\n }\n return getXMLProperty(xmlName);\n }", "protected abstract T getId(P object);", "protected final E getType(UUID id) throws NoSuchIdException {\n\t\tE entry = dict.get(id);\n\t\tif (entry != null) {\n\t\t\treturn entry;\n\t\t} else {\n\t\t\tthrow new NoSuchIdException(\"Unknown specification id '\"\n\t\t\t\t\t+ id.toString() + \"'\");\n\t\t}\n\t}", "private static Declaration\n findDeclaration(Traversable tr, IDExpression id) {\n Traversable t = tr;\n while (t != null && !(t instanceof SymbolTable)) {\n t = t.getParent();\n }\n if (t == null) {\n return null;\n } else {\n return findSymbol((SymbolTable)t, id);\n }\n }", "private int find(int p1, int p2) {\n return id[p1 - 1][p2 - 1]; // find the current value of a node\n }", "V get(K id);", "public String getIdentifier() {\n/* 222 */ return getValue(\"identifier\");\n/* */ }", "public abstract ArrayList<T> findFromReference(int id);", "<T> T get(String variable, int... indexes) throws ClassCastException, ArrayIndexOutOfBoundsException;", "public VarType getVar(MappingType mapping, String docId) {\n\t\tEList<RepresentsType> repList = mapping.getRepresents();\n\t\tfor(RepresentsType rep : repList) {\n\t\t\ttry {\n\t\t\t\tfor (DocType doc : rep.getDocument()) {\n\t\t\t\t\tif(doc.getId().equals(docId)){\n\t\t\t\t\t\treturn rep.getVariable();\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} catch(Exception e) {\n\t\t\t}\n\t\t}\n\t\treturn null;\n\t}", "AceMention findMention (String id) {\n\t\tfor (int i=0; i<values.size(); i++) {\n\t\t\tAceValue value = (AceValue) values.get(i);\n\t\t\tAceValueMention mention = value.findMention(id);\n\t\t\tif (mention != null) {\n\t\t\t\treturn mention;\n\t\t\t}\n\t\t}\n\t\tfor (int i=0; i<timeExpressions.size(); i++) {\n\t\t\tAceTimex timex = (AceTimex) timeExpressions.get(i);\n\t\t\tAceTimexMention mention = timex.findMention(id);\n\t\t\tif (mention != null) {\n\t\t\t\treturn mention;\n\t\t\t}\n\t\t}\n\t\treturn findEntityMention (id);\n\t}", "private static Declaration searchDeclaration(Identifier id) {\n Declaration ret = null;\n Traversable parent = id.getParent();\n // Broken IR\n if (parent == null) {\n return null;\n }\n // AccessExpression handling.\n if (parent instanceof AccessExpression &&\n id == ((AccessExpression)parent).getRHS()) {\n List specs = getType(((AccessExpression)parent).getLHS());\n Declaration cdecl = findUserDeclaration(id, specs);\n if (cdecl instanceof ClassDeclaration) {\n ret = ((ClassDeclaration)cdecl).findSymbol(id);\n }\n // __builtin__offsetof handling.\n } else if (parent instanceof OffsetofExpression &&\n id == ((OffsetofExpression)parent).getExpression()) {\n List specs = ((OffsetofExpression)parent).getSpecifiers();\n Declaration cdecl = findUserDeclaration(id, specs);\n if (cdecl instanceof ClassDeclaration) {\n ret = ((ClassDeclaration)cdecl).findSymbol(id);\n }\n } else {\n ret = id.findDeclaration();\n // This code section only deals with a situation that name conflicts\n // in a scope; e.g.) { int a = b; float b; ... }\n if (ret instanceof VariableDeclaration) {\n Traversable t1 = IRTools.getAncestorOfType(id, Statement.class);\n Traversable t2 = IRTools.getAncestorOfType(ret,Statement.class);\n if (t1 != null && t2 != null\n && t1.getParent() == t2.getParent()) {\n List<Traversable> children = t1.getParent().getChildren();\n if (children.indexOf(t1) < children.indexOf(t2)) {\n ret = findDeclaration(t1.getParent().getParent(), id);\n }\n }\n }\n }\n // Prints out warning for undeclared functions/symbols.\n if (ret == null) {\n if (parent instanceof FunctionCall &&\n id == ((FunctionCall)parent).getName()) {\n \tif( verbosity > 1 ) {\n \t\tSystem.err.print(\"[WARNING] Function without declaration \");\n \t\tSystem.err.println(id + \" from \" + parent);\n \t}\n } else {\n \tif( verbosity > 0 ) {\n \t\tSystem.err.print(\"[WARNING] Undeclared symbol \");\n \t\tSystem.err.println(id + \" from \" + parent);\n \t}\n }\n }\n return ret;\n }", "double getValue(int id);", "public T find(T element);", "private boolean smem_variable_get(smem_variable_key variable_id, ByRef<Long> variable_value) throws SQLException\n {\n final PreparedStatement var_get = db.var_get;\n \n var_get.setInt(1, variable_id.ordinal());\n try(ResultSet rs = var_get.executeQuery())\n {\n if(rs.next())\n {\n variable_value.value = rs.getLong(0 + 1);\n return true;\n }\n else\n {\n return false;\n }\n }\n }", "public int valuePosition(int[] arr, int x) {\n for (int i = 0; i < arr.length; i++)\n if (arr[i] == x) {\n return i;\n }\n return x;\n }", "public int find(int p) {\n\t\tvalidate(p);\n\t\twhile (p != id[p])\n\t\t\tp = id[p];\n\t\treturn p;\n\t}", "ReferenceData findById(ReferenceDataId id) throws DataException;", "public IAstRlsString findRlsString(String identifer);", "private Group findById(int id){\n assert(inputGroupList.size() > 0);\n for(Group group : inputGroupList){\n if(group.getNumber() == id)\n return group;\n }\n return null;\n }", "@Override\r\n public Object valT(String id, int indice) throws IllegalAccessException {\r\n Quadruplet quad = stack.peekFirst(id);\r\n if (quad == null){\r\n throw new IllegalAccessException(id + \" has not been declared\");\r\n }\r\n if (quad.nature() != OBJ.TAB) {\r\n throw new IllegalAccessException(id + \" is not an array\");\r\n }\r\n return heap.valeurTas(quad.val(), indice);\r\n }", "public Solucion consultarSolucion(Integer id) throws IllegalArgumentException {\n if (soluciones == null) {\n throw new IllegalArgumentException(\"Error: Soluciones es null\");\n }\n return this.soluciones.get(id);\n }", "private static String findVariable(final String value) {\n int start = value.lastIndexOf(\"${\");\n if (start >= 0) {\n start += 2;\n final int end = value.indexOf(\"}\", start);\n if (end >= 0) {\n return value.substring(start, end);\n }\n }\n return null;\n }", "private Object eval(Fact expr) {\n if (expr.getBool() != null) {\n if (\"true\".equals(expr.getBool())) {\n return true;\n } else {\n return false;\n }\n } else if (expr.getString() != null) {\n return expr.getString();\n } else if (expr.getIdent() != null) {\n if (RESULT_TYPE_VARIABLE.equals(resultType)) {\n return expr.getIdent();\n }\n return scope.getVariable(expr.getIdent());\n } else if (expr.getExpr() != null) {\n return eval(expr.getExpr(), resultType);\n } else if (expr.getLocator() != null) {\n return evalLocator(expr.getLocator());\n } else {\n return expr.getNumber();\n }\n }", "private GradsVariable findVar(Variable v2) {\n List<GradsVariable> vars = gradsDDF.getVariables();\n String varName = v2.getFullName();\n for (GradsVariable var : vars) {\n if (var.getName().equals(varName)) {\n return var;\n }\n }\n\n return null; // can't happen?\n }", "public Employee getEmployeeById(String id) {\r\n for(int i = 0; i < companyDirectory.size(); i++) {\r\n\t for(int j = 0; j < companyDirectory.get(i).getLocations().size(); j++) {\r\n\t\t for(int k = 0; k < companyDirectory.get(i).getLocations().get(j).getEmployees().size(); k++) {\t\t\r\n\t\t if(companyDirectory.get(i).getLocations().get(j).getEmployees().get(k).getId().equals(id)) \r\n\t\t \treturn companyDirectory.get(i).getLocations().get(j).getEmployees().get(k);\r\n\t\t }\r\n\t\t}\r\n\t }\r\n return null;\r\n\t}", "public int indexVar(Node node) {\n Expr ee = getFilter().getExp();\n String name = node.getLabel();\n for (int i = 0; i < 2; i++) {\n if (ee.getExp(i).type() == ExprType.VARIABLE\n && ee.getExp(i).getLabel().equals(name)) {\n return i;\n }\n }\n return -1;\n }", "public Individual getIndividualById(Integer id) throws ObjectNotFoundException{\n \tList<Individual> individualList = new ArrayList<>();\n\t\tindividualList = (new TeamsJsonReader()).getListOfIndividuals();\n\t\tIndividual individual = null;\n\t\tint size, counter = 0;\n\t\tfor (size = 0; size < individualList.size(); size++) {\n\t\t\tcounter = 0;\n\n\t\t\tindividual = individualList.get(size);\n\t\t\tif (individual.getId().compareTo(id) == 0) {\n\t\t\t\tcounter = 1;\n\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\n\t\tif (size == individualList.size() && counter == 0)\n\t\t\tthrow new ObjectNotFoundException(\"individual\", \"id\", id.toString());\n\n\t\treturn individual;\n\n }", "public Closure find_var(String name){\n Closure currentClosure = this;\n while (currentClosure != null){\n if (currentClosure.contains(name)){\n return currentClosure;\n }\n currentClosure = currentClosure.getParent();\n }\n throw new UndefinedVariable();\n }", "public static String getId(String val, String pattern) {\n String str[] = val.split(pattern);\n if (str.length > 0) { \n for (String s: str) {\n if (s != null && s.contains(\"!\")) {\n String id = pattern + s.split(\"!\")[0].trim();\n log.info(\"id \" + id);\n return id;\n }\n }\n }\n return null;\n }", "Optional<Integer> getId(Point coordinate);", "public Variable get(String rootName) {\n//\t\tSystem.out.println(\"symbolTable get \"+n);\n\t\tNameSSA ssa = name.get(rootName);\t\n//\t\tSystem.out.println(\"ssa \" + ssa);\n\t\tif (ssa != null) \n\t\t\treturn var.get(ssa.current());\n\t\telse\n\t\t\treturn null;\n\t}", "public int getExpressionId() {\n return this.id;\n }", "public abstract T findByID(ID id) ;", "public static Category findValue(String id) {\n\n if (id == null || id.isEmpty())\n return null;\n\n for (Category cat : values()) {\n if (cat.id == id.charAt(0))\n return cat;\n }\n\n return null;\n }", "private static Person findPersonById(int id) {\n Person personReturn = null;\n\n for (Person person : persons) {\n if (id == person.getId()) {\n personReturn = person;\n }\n }\n\n return personReturn;\n }", "public Product findProduct(int id)\n {\n for(Product product : stock)\n {\n if(id == product.getID())\n {\n return product;\n }\n }\n System.out.println(\"Error: Could not find ID: \" + id);\n return null;\n }", "String getVariable();", "public final int indexOfInferred(final IRNode var) {\n return lattice2.indexOf(var);\n }", "@Override\n\tpublic UserEvaluateIndex findById(Serializable id) {\n\t\treturn (UserEvaluateIndex) super.findById(UserEvaluateIndex.class, id);\n\t}", "Aliasing getVariable();", "public VariableItem SearchVariable(String variableName) {\n\t\tfor(VariableItem variable : variableItem)\n\t\t{\n\t\t\tif(variable.name==variableName)\n\t\t\t\treturn variable;\n\t\t}\n\t\treturn null;\n\t}", "@Override\n public Object evaluate(Environment env) {\n if (env.contains(name.getValue())) return new VariableExistsError(name);\n var value = expression.evaluate(env);\n env.put(name.getValue(), value);\n env.setCurrent(value);\n return value;\n }", "public Variable getVariable(int i) {\r\n\t\treturn getVariables().get(i);\r\n\t}", "public abstract Element getElement(int id) throws PositionEX;", "public void outAIdExp(AIdExp node) throws TypeException{\n TId id = node.getId();\n java.lang.String name = id.getText();\n Type t = lookUpVarType(name, golite.weeder.LineNumber.getLineNumber(node));\n typemap.put(node,t);\n\t/*\n\t if(t==null) throw new TypeException(\"[line \" + golite.weeder.LineNumber.getLineNumber(node) + \"] Identifier \" + name + \" used that cannot be found in symbol table.\");\n\t else typemap.put(node,t);\n\t*/\n }", "Object find(String name);" ]
[ "0.57049596", "0.56468046", "0.5644988", "0.5528704", "0.5511912", "0.54604083", "0.5415588", "0.5413435", "0.5395203", "0.5382083", "0.53815883", "0.53771794", "0.5305296", "0.5285925", "0.5260581", "0.5169117", "0.5155398", "0.5142571", "0.51237315", "0.51020044", "0.50978625", "0.5075236", "0.5060326", "0.5043628", "0.5043308", "0.5032481", "0.49974573", "0.499677", "0.4996598", "0.4980475", "0.49640706", "0.49513555", "0.49363154", "0.49293718", "0.49225673", "0.49032173", "0.4886849", "0.48859885", "0.48544914", "0.4836696", "0.48177224", "0.48175478", "0.48097417", "0.48034647", "0.47975227", "0.47971764", "0.4795535", "0.479305", "0.47885165", "0.47877976", "0.47849426", "0.47840062", "0.4779276", "0.4775436", "0.47744656", "0.47685102", "0.4764645", "0.47622263", "0.47619894", "0.47606558", "0.476037", "0.47427604", "0.4739843", "0.47369042", "0.47362536", "0.47261027", "0.47251478", "0.47246966", "0.47034258", "0.47008863", "0.46941352", "0.468934", "0.4687745", "0.46756268", "0.46655476", "0.46592045", "0.46546936", "0.4654168", "0.46536234", "0.4649957", "0.46462932", "0.464418", "0.46399373", "0.46255", "0.4625489", "0.46236506", "0.4623145", "0.46213657", "0.4620914", "0.46170723", "0.46140712", "0.46093297", "0.46080235", "0.4602101", "0.45990905", "0.45977476", "0.4590313", "0.4589493", "0.45800278", "0.45672414" ]
0.57958305
0
Executes persistence work passed in constructor
public interface PersistenceRunner { /** * Performs persistence work * @param persistenceWork JPA unit of work * @return Executable object to notify completion */ Executable run(PersistenceWork persistenceWork); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public Persistence() {}", "public Persistence() {\n\t\tconn = dbConnection();\n\t}", "void start() throws PersistenceException;", "abstract void initPersistance();", "public DataPersistence() {\n storage = new HashMap<>();\n idCounter = 0;\n }", "@Override\n public void execute(Work work) {\n final Session session = (Session) entityManager.getDelegate();\n session.doWork(work);\n }", "protected void execute() {\n \t\n }", "protected void execute() {\n \t\n }", "@Override\n\tpublic void execute() {\n\t\trecevier.doSomething();\n\t}", "protected void execute() {}", "protected void execute() {\n\t\t\n\t}", "public void initializeOnInstantiation() \n\t\t\t\tthrows PersistenceException{\n\n\t}", "public void initPersistence (){\n\t\tif (!this._onAppInit){\n\t\t\t/*\n\t\t\t * Evita stackoverflow\n\t\t\t */\n\t\t\tcloseActiveStoreData ();\n\t\t}\n\t\tsetDatastoreProperties ();\n\t\tfinal Properties properties = this._dataStoreEnvironment.getDataStoreProperties ();\n\t\tfinal PersistenceManagerFactory pmf =\n\t\t\t\t\t JDOHelper.getPersistenceManagerFactory(properties);\n\t\t\n//\t\tSystem.out.println (\"Setting persistent manager from \"+properties);\n\t\t\n\t\tthis.pm = pmf.getPersistenceManager();\n\t\t\n\t\tif (this.pm.currentTransaction().isActive ()){\n\t\t\tthis.pm.currentTransaction().commit();\n\t\t}\n\t\tthis.pm.currentTransaction().setOptimistic (false);\n//\t\tthis.pm.currentTransaction().begin();\n\t}", "public void execute() {\n\t\t\n\t}", "public void execute() {\n OBPropertiesProvider.setFriendlyWarnings(true);\n\n // Initialize DAL only in case it is needed: modules have refrence data to be loaded\n CPStandAlone pool = new CPStandAlone(propertiesFile);\n ApplyModuleData[] ds = null;\n try {\n if (!forceRefData) {\n ds = ApplyModuleData.selectClientReferenceModules(pool);\n } else {\n ds = ApplyModuleData.selectAllClientReferenceModules(pool);\n }\n } catch (Exception e) {\n log4j.error(\"Error checking modules with reference data\", e);\n }\n if (ds != null && ds.length > 0) {\n // Initialize DAL and execute\n super.execute();\n } else {\n try {\n if (!forceRefData) {\n ds = ApplyModuleData.selectTranslationModules(pool);\n } else {\n ds = ApplyModuleData.selectAllTranslationModules(pool);\n }\n } catch (Exception e) {\n log4j.error(\"Error checking modules with translation data\", e);\n }\n if (ds != null && ds.length > 0) {\n // Execute without DAL\n doExecute();\n }\n // do not execute if not reference data nor translations present\n }\n }", "protected void execute() {\n\n\t}", "public void execute() {\n\n\t}", "public static void main(String[] args) {\n\t\tPersistence p = new FilePersistence();\n\t}", "protected void execute() {\n\t}", "public void execute() {\n\t\t\r\n\t}", "public void execute() {\n\t\t\r\n\t}", "public void execute() {\n\t\t\r\n\t}", "public void execute() {\r\n\t\r\n\t}", "public void execute(){\n\t\t\n\t}", "@Override\r\n\tpublic void execute() {\n\t}", "@Override\r\n\tpublic void execute() {\n\t}", "protected void execute()\n\t{\n\t}", "@Override\n\t\tpublic void run() {\n\t\t\tif (runState != 0) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\ttry {\n\t\t\t\trunState = 1;\n\t\t\t\tif (om == null) \n\t\t\t\t\tom = new OracleManager();\n\t\t\t\tResultSet rs = om.getTivoliData();\n\t\t\t\tif (rs == null) {\n\t\t\t\t\trunState = 0;\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tif (sm == null)\n\t\t\t\t\tsm = new SybaseManager();\n\t\t\t\twhile (rs.next()) {\n\t\t\t\t\tif(!sm.insertTivoliData(rs)) { //如果插入数据失败,直接返回,等待下次插入\n\t\t\t\t\t\trunState = 0;\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\t\t\t\t\telse {\n\t\t\t\t\t\t//如果修改失败,直接返回,下次重新插入和修改\n\t\t\t\t\t\tif (!om.setTivoliData(rs.getString(\"I_ID\"))) {\n\t\t\t\t\t\t\trunState = 0;\n\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\trunState = 0;\n\t\t\t}\n\t\t\tcatch (Exception ex) {\n\t\t\t\tlogger.error(\"执行错误:\" + ex.toString());\n\t\t\t\trunState = 0;\n\t\t\t}\n\t\t}", "protected void execute() {\n }", "protected void execute() {\n }", "protected void execute() {\n }", "protected void execute() {\n }", "protected void execute() {\n }", "protected void execute() {\n }", "protected void execute() {\n }", "protected void execute() {\n }", "protected void execute() {\n }", "protected void execute() {\n }", "protected void execute() {\n }", "protected void execute() {\n }", "void beforeStart() throws PersistenceException;", "public interface PersistenceFinalTaskDao {\n\t\n\t/**\n\t * Persiste el total de operaciones en la tabla\n\t * de reporte final\n\t */\n\tpublic void persisteMontoOperaciones(BigDecimal montoTotal, String idProceso);\n\n\t/**\n\t * \n\t * obtiene la sumatoria de los montos de todas las\n\t * operaciones correspondienes a la carga de \n\t * un archivo de operaciones\n\t * \n\t */\n\tpublic BigDecimal conteoTotalDeOperaciones(String idProceso, String schema);\n\n\t/**\n\t * \n\t * Metodo para obtener el numero de errores\n\t * contenidos en un proceso @idProceso\n\t * \n\t * @param idProceso\n\t * @param schema\n\t * @return numero de errores correspontienes al proceso\n\t */\n\tpublic int numeroDeRegistrosCargadosConError(String idProceso, String schema);\n\n\t/**\n\t * Recibe sentencias sql para persistir,\n\t * el metodo itera la lista de sentencias\n\t * regresa el numero de registros insertados\n\t * el cual deberia ser igual al numero de sentencias recibidas\n\t * entro de la lista\n\t *\n\t * @param listQuriesToPersistence\n\t * @return\n\t */\n\tpublic int persisteInformacionArrayQuries(List<String> listQuriesToPersistence, String idProceso);\n\t\n\t/**\n\t * Metodo que contiene el llamado a base de datos para hacer \n\t * el select inser de los registros que no fueron marcados\n\t * como update y tampoco fueron rechazados.\n\t * \n\t * @param queryInserSelect\n\t * @param idProceso\n\t * @return numero de registros afectados\n\t * @throws Exception \n\t */\n\tpublic int persisteInformacionInsertSelect(String queryInserSelect, String idProceso) throws Exception;\n\t\n}", "protected void execute() {\r\n }", "public void execute() {\n // empty\n }", "public void testCtor() {\r\n new FileSystemPersistence();\r\n }", "@Override\r\n\tprotected void execute() {\r\n\t}", "@Override\n\tpublic void execute() {\n\t\t\n\t}", "public interface PersistenceImplementor {\n public boolean persistObject(Object object);\n\n public boolean persistAllObjects(Object[] objects);\n\n public Object loadObject(String objectID);\n\n public Object[] loadAllObjects();\n}", "public void execute() {\n execute0();\n }", "public void execute() {\n }", "public abstract FHIRPersistence getPersistenceImpl() throws Exception;", "protected void execute()\n {\n }", "@Override\n\tpublic void execute() {\n\t}", "@Override\r\n\tpublic void execute() {\n\r\n\t}", "public void initializeOnCreation() \n\t\t\t\tthrows PersistenceException{\n\n\t}", "@Override\r\n\tpublic void execute() {\n }", "public void execute(){\n\n }", "@SuppressWarnings(\"unchecked\")\n public void execute() {\n execute(null, null);\n }", "@Override\n protected void execute() {\n }", "@Override\n protected void execute() {\n }", "@Override\n protected void execute() {\n }", "@Override\n public void execute() {}", "public void testCtorSuccess() {\r\n new FileSystemPersistence(10);\r\n }", "@Override\n public void execute() {\n }", "protected abstract void execute();", "public abstract int getPersistence();", "@Override\n protected void execute() {\n\n }", "public void execute();", "public void execute();", "public void execute();", "public void execute();", "protected void execute() {\n \t// literally still do nothing\n }", "abstract protected void execute();", "@Transactional\npublic interface ProteinDatabaseManagement {\n /**\n * Persists protein Id search database. This database could be available for everyone in case experiment param is null\n **/\n long createDatabase(long actor, String nameToDisplay, long proteinDBType, long sizeInBytes, boolean bPublic, boolean bReversed, ExperimentCategory category);\n\n long updateDatabaseDetails(long actor, long database, String databaseName, long databaseType);\n\n\n void deleteDatabase(long actor, long db);\n\n long getMaxDatabaseSize();\n\n void specifyProteinDatabaseContent(long userId, long proteinDb, String contentUrl);\n\n void markDatabasesInProgress(Iterable<Long> dbs);\n\n void updateDatabaseSharing(long actor, boolean bPublic, long databaseId);\n\n DuplicateResponse duplicateDatabase(long actor, long database);\n\n class DuplicateResponse{\n public final Long id;\n public final String errorMessage;\n\n public DuplicateResponse(Long id, String errorMessage) {\n this.id = id;\n this.errorMessage = errorMessage;\n }\n }\n}", "void persist() throws PersistenceException;", "public abstract void execute();", "public abstract void execute();", "public abstract void execute();", "@Override\n public void Execute() {\n\n }", "protected void execute() {\n\n\n \n }", "public abstract void execute(Serializable obj);", "@Override\n protected void execute() {\n \n }", "public void store() throws PersistenceException {\n }", "public interface IPersistence\n{\n\t/**\n\t * When overridden in a child class, determines whether data exists which\n\t * can be loaded\n\t * @pre (none)\n\t * @post (none)\n\t * @return True if data can be loaded. Otherwise, false.\n\t */\n\tboolean canLoadData();\n\n\t/**\n\t * When overridden in a child class, loads all data from specified store to\n\t * the passed Inventory\n\t * @pre inventory is not null. storeName refers to a valid data store.\n\t * @post inventory's original contents have been cleared and replaced with\n\t * the data from the specified data store\n\t * @throws SerializerException\n\t */\n\tvoid loadData() throws SerializerException;\n\n\t/**\n\t * When overridden in a child class, saves all data from the Inventory with\n\t * the specified name\n\t * @pre storeName is a valid string for the system we are saving to\n\t * @post The passed Inventory has been saved under the passed name\n\t * @throws SerializerException\n\t */\n\tvoid saveData() throws SerializerException;\n}", "public interface AssetClassDatastore {\r\n\r\n\t/**\r\n\t * Creates Asset Class in the Datastore \r\n\t * @param assetClass_ Asset Class to be Created \r\n\t * @return Name of Asset Class\r\n\t */\r\n\tpublic String createAssetClass(AssetClass assetClass_);\r\n\t\r\n\t/**\r\n\t * Finds Asset Class by Name \r\n\t * @param name_ Name \r\n\t * @return Asset Class\r\n\t */\r\n\tpublic AssetClass findAssetClassByName(String name_);\r\n\t\r\n\t/**\r\n\t * Finds All Asset Classes\r\n\t * @param cursorString_ Cursor String for continuing a Paged Query or Null for a new Paged Query\r\n\t * @param maxNumberOfAssetClassesOnPage_ Max Number of Asset Classes on a Page \r\n\t * @return Paged Asset Class List\r\n\t */\r\n\tpublic PagedAssetClassList findAllAssetClassesFromCursor(String cursorString_, int maxNumberOfAssetClassesOnPage_);\r\n\t\r\n\t/**\r\n\t * Finds All Top-Level Asset Classes (that have no Parent)\r\n\t * @param cursorString_ Cursor String for continuing a Paged Query or Null for a new Paged Query\r\n\t * @param maxNumberOfAssetClassesOnPage_ Max Number of Asset Classes on a Page \r\n\t * @return Paged Asset Class List\r\n\t */\r\n\tpublic PagedAssetClassList findAllTopLevelAssetClassesFromCursor(String cursorString_, int maxNumberOfAssetClassesOnPage_);\r\n\t\r\n\t\r\n\t/**\r\n\t * Finds Asset Classes by Parent\r\n\t * @param parentAssetClassName_ Name of the Parent Asset Class \r\n\t * @param cursorString_ Cursor String for continuing a Paged Query or Null for a new Paged Query\r\n\t * @param maxNumberOfAssetClassesOnPage_ Max Number of Asset Classes on a Page \r\n\t * @return Paged Asset Class List\r\n\t */\r\n\tpublic PagedAssetClassList findAssetClassesFromCursorByParent(String parentAssetClassName_, String cursorString_, int maxNumberOfAssetClassesOnPage_);\r\n\t\r\n\t/**\r\n\t * Deletes Asset Class by Name \r\n\t * @param name_ Name of Asset Class to be Deleted\r\n\t */\r\n\tpublic void deleteAssetClass(String name_);\r\n\r\n\t/**\r\n\t * Explicitly updates Asset Class in the Datastore with instance provided \r\n\t * @param changedAssetClassModel_ Asset Class to be updated \r\n\t * @return the updated object \r\n\t */\r\n\tpublic AssetClass updateAssetClass(AssetClass changedAssetClassModel_);\r\n}", "protected DdlExecutorImpl() {\n }", "public void Execute() {\n\n }", "public DataManager(String PUnit) throws PersistenceException {\n\t\tDataManager.PUnit = PUnit;\n\t\tif (emf == null || !emf.isOpen())\n\t\t\temf = Persistence.createEntityManagerFactory(PUnit);\n\t}", "@Override\n\t@SuppressWarnings(\"unchecked\")\n\tpublic void start() {\n\t\tinitLogger();\n\n\t\tif (!databaseEnabled) {\n\t\t\tlog.info(\"DB not enabled.\");\n\t\t\treturn;\n\t\t}\n\n\t\tlog.info(\"DB start ----------\");\n\n\t\tfinal PetiteContainer petiteContainer = joyPetiteSupplier.get().getPetiteContainer();\n\n\t\t// connection pool\n\t\tconnectionProvider = createConnectionProviderIfNotSupplied();\n\n\t\tpetiteContainer.addBean(beanNamePrefix() + \"pool\", connectionProvider);\n\n\t\tif (connectionProvider instanceof CoreConnectionPool) {\n\t\t\tfinal CoreConnectionPool pool = (CoreConnectionPool) connectionProvider;\n\t\t\tif (pool.getDriver() == null) {\n\t\t\t\tdatabaseEnabled = false;\n\t\t\t\tlog.warn(\"DB configuration not set (\" + beanNamePrefix() + \"pool.*). DB will be disabled.\");\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\n\t\tconnectionProvider.init();\n\n\t\tcheckConnectionProvider();\n\n\t\t// transactions manager\n\t\tjtxManager = createJtxTransactionManager(connectionProvider);\n\t\tjtxManager.setValidateExistingTransaction(true);\n\n\t\tfinal AnnotationTxAdviceManager annTxAdviceManager = new AnnotationTxAdviceManager(new LeanJtxWorker(jtxManager), jtxScopePattern);\n\t\tAnnotationTxAdviceSupport.manager = annTxAdviceManager;\n\n\t\t// create proxy\n\t\tjoyProxettaSupplier.get().getProxetta().withAspect(createTxProxyAspects(annTxAdviceManager.getAnnotations()));\n\n\t\tfinal DbSessionProvider sessionProvider = new DbJtxSessionProvider(jtxManager);\n\n\t\t// querymap\n\t\tfinal long startTime = System.currentTimeMillis();\n\n\t\tfinal QueryMap queryMap = new DbPropsQueryMap();\n\n\t\tlog.debug(\"Queries loaded in \" + (System.currentTimeMillis() - startTime) + \"ms.\");\n\t\tlog.debug(\"Total queries: \" + queryMap.size());\n\n\t\t// dboom\n\t\tdbOom = DbOom.create()\n\t\t\t.withConnectionProvider(connectionProvider)\n\t\t\t.withSessionProvider(sessionProvider)\n\t\t\t.withQueryMap(queryMap)\n\t\t\t.get();\n\n\t\tdbOom.connect();\n\n\t\tfinal DbEntityManager dbEntityManager = dbOom.entityManager();\n\t\tdbEntityManager.reset();\n\n\t\tpetiteContainer.addBean(beanNamePrefix() + \"query\", dbOom.queryConfig());\n\t\tpetiteContainer.addBean(beanNamePrefix() + \"oom\", dbOom.config());\n\n\t\t// automatic configuration\n\t\tif (autoConfiguration) {\n\t\t\tfinal AutomagicDbOomConfigurator automagicDbOomConfigurator =\n\t\t\t\tnew AutomagicDbOomConfigurator(dbEntityManager, true);\n\n\t\t\tautomagicDbOomConfigurator.configure();\n\t\t}\n\n\t\tdbEntityManagerConsumers.accept(dbEntityManager);\n\n\t\tlog.info(\"DB OK!\");\n\t}", "public void work() {\n\t}", "public void work() {\n\t}", "private static void init(){\n entityManager = HibernateUtil.getEntityManager();\n transaction = entityManager.getTransaction();\n }", "public abstract void leerPersistencia();", "public void persistPrijava(DelegateExecution delegateExecution) {\n PrijavaEntity prijavaEntity = new PrijavaEntity();\n\n // Get all process variables\n Map<String, Object> variables = delegateExecution.getVariables();\n\n // Set order attributes\n prijavaEntity.setStudent((String) variables.get(\"student\"));\n prijavaEntity.setIndeks((String) variables.get(\"indeks\"));\n prijavaEntity.setIspit((String) variables.get(\"ispit\"));\n\n // Persist order instance and flush. After the flush the\n // id of the order instance is set.\n entityManager.persist(prijavaEntity);\n entityManager.flush();\n\n // Remove no longer needed process variables\n delegateExecution.removeVariables(variables.keySet());\n\n // Add newly created order id as process variable\n delegateExecution.setVariable(\"prijavaId\", prijavaEntity.getId());\n }", "public interface PersistenceAdapter extends Service {\n\n /**\n * Returns a set of all the\n * {@link org.apache.activemq.command.ActiveMQDestination} objects that the\n * persistence store is aware exist.\n *\n * @return active destinations\n */\n Set<ActiveMQDestination> getDestinations();\n\n /**\n * Factory method to create a new queue message store with the given\n * destination name\n *\n * @param destination\n * @return the message store\n * @throws IOException\n */\n MessageStore createQueueMessageStore(ActiveMQQueue destination) throws IOException;\n\n /**\n * Factory method to create a new topic message store with the given\n * destination name\n *\n * @param destination\n * @return the topic message store\n * @throws IOException\n */\n TopicMessageStore createTopicMessageStore(ActiveMQTopic destination) throws IOException;\n\n /**\n * Creates and returns a new Job Scheduler store instance.\n *\n * @return a new JobSchedulerStore instance if this Persistence adapter provides its own.\n *\n * @throws IOException If an error occurs while creating the new JobSchedulerStore.\n * @throws UnsupportedOperationException If this adapter does not provide its own\n * scheduler store implementation.\n */\n JobSchedulerStore createJobSchedulerStore() throws IOException, UnsupportedOperationException;\n\n /**\n * Cleanup method to remove any state associated with the given destination.\n * This method does not stop the message store (it might not be cached).\n *\n * @param destination\n * Destination to forget\n */\n void removeQueueMessageStore(ActiveMQQueue destination);\n\n /**\n * Cleanup method to remove any state associated with the given destination\n * This method does not stop the message store (it might not be cached).\n *\n * @param destination\n * Destination to forget\n */\n void removeTopicMessageStore(ActiveMQTopic destination);\n\n /**\n * Factory method to create a new persistent prepared transaction store for\n * XA recovery\n *\n * @return transaction store\n * @throws IOException\n */\n TransactionStore createTransactionStore() throws IOException;\n\n /**\n * This method starts a transaction on the persistent storage - which is\n * nothing to do with JMS or XA transactions - its purely a mechanism to\n * perform multiple writes to a persistent store in 1 transaction as a\n * performance optimization.\n * <p/>\n * Typically one transaction will require one disk synchronization point and\n * so for real high performance its usually faster to perform many writes\n * within the same transaction to minimize latency caused by disk\n * synchronization. This is especially true when using tools like Berkeley\n * Db or embedded JDBC servers.\n *\n * @param context\n * @throws IOException\n */\n void beginTransaction(ConnectionContext context) throws IOException;\n\n /**\n * Commit a persistence transaction\n *\n * @param context\n * @throws IOException\n *\n * @see PersistenceAdapter#beginTransaction(ConnectionContext context)\n */\n void commitTransaction(ConnectionContext context) throws IOException;\n\n /**\n * Rollback a persistence transaction\n *\n * @param context\n * @throws IOException\n *\n * @see PersistenceAdapter#beginTransaction(ConnectionContext context)\n */\n void rollbackTransaction(ConnectionContext context) throws IOException;\n\n /**\n *\n * @return last broker sequence\n * @throws IOException\n */\n long getLastMessageBrokerSequenceId() throws IOException;\n\n /**\n * Delete's all the messages in the persistent store.\n *\n * @throws IOException\n */\n void deleteAllMessages() throws IOException;\n\n /**\n * @param usageManager\n * The UsageManager that is controlling the broker's memory\n * usage.\n */\n void setUsageManager(SystemUsage usageManager);\n\n /**\n * Set the name of the broker using the adapter\n *\n * @param brokerName\n */\n void setBrokerName(String brokerName);\n\n /**\n * Set the directory where any data files should be created\n *\n * @param dir\n */\n void setDirectory(File dir);\n\n /**\n * @return the directory used by the persistence adaptor\n */\n File getDirectory();\n\n /**\n * checkpoint any\n *\n * @param cleanup\n * @throws IOException\n *\n */\n void checkpoint(boolean cleanup) throws IOException;\n\n /**\n * A hint to return the size of the store on disk\n *\n * @return disk space used in bytes of 0 if not implemented\n */\n long size();\n\n /**\n * return the last stored producer sequenceId for this producer Id used to\n * suppress duplicate sends on failover reconnect at the transport when a\n * reconnect occurs\n *\n * @param id\n * the producerId to find a sequenceId for\n * @return the last stored sequence id or -1 if no suppression needed\n */\n long getLastProducerSequenceId(ProducerId id) throws IOException;\n\n void allowIOResumption();\n}", "@Override\r\n\tpublic void execute() throws Exception {\n\t\t\r\n\t}", "@Override\n public void persistFlowUnit(FlowUnitOperationArgWrapper args) {}", "@Override\n public void run() {\n if (checkParameters()) {\n notifyError();\n } else {\n ADRepository repository = new ADRepository(schema);\n\n List<ADEntity> entities = repository.fetchQuery(buildQuery(), getOrder());\n nofityEntitiesLoaded(processResult(entities));\n }\n }", "protected abstract void work();", "private void run(AuthordDao dao, EntityManager entityManager) {\n Author een = new Author(\"Bakker\");\n dao.save(een);\n Author twee = new Author(\"Smit\");\n dao.save(twee);\n Author drie = new Author(\"Meijer\");\n dao.save(drie);\n Author vier = new Author(\"Mulder\");\n dao.save(vier);\n Author vijf = new Author(\"de Boer\");\n dao.save(vijf);\n Author zes = new Author(\"Pieters\");\n dao.save(zes);\n\n /////////////////////////////////////////// --> delete author 2\n dao.delete(twee);\n\n /////////////////////////////////////////// --> update naam author 1\n dao.updateName(1, \"Hendriks\");\n dao.save(een);\n\n ////////////////////////////////////////// --> try setters\n drie.setHasDebuted(Boolean.TRUE);\n vijf.setHasDebuted(Boolean.TRUE);\n zes.setHasDebuted(Boolean.TRUE);\n dao.update(drie);\n dao.update(vijf);\n dao.update(zes);\n\n /////////////////////////////////////////// --> find by lastname\n log(dao.findBy(\"Meijer\"));\n\n /////////////////////////////////////////// --> enum\n een.setGenre(Genre.FICTION);\n dao.save(een);\n\n drie.setGenre(Genre.CHILDREN);\n dao.save(drie);\n\n vier.setGenre(Genre.BIOGRAPHY);\n dao.save(vier);\n\n vijf.setGenre(Genre.ROMANCE);\n dao.save(vijf);\n\n zes.setGenre(Genre.FICTION);\n dao.save(zes);\n\n ///////////////////////////////////////////////// --> unidirectional\n Publisher theBestPublisher = new Publisher(\"the Best Publisher\");\n Publisher eenAnderePublisher = new Publisher(\"een Andere Publisher\");\n Publisher deLaaststePublisher = new Publisher(\"de Laatste Publisher\");\n\n Dao<Publisher> publisherDao = new Dao<>(entityManager);\n publisherDao.save(theBestPublisher);\n publisherDao.save(eenAnderePublisher);\n publisherDao.save(deLaaststePublisher);\n\n een.setSignedBy(theBestPublisher);\n drie.setSignedBy(deLaaststePublisher);\n vier.setSignedBy(eenAnderePublisher);\n vijf.setSignedBy(theBestPublisher);\n zes.setSignedBy(deLaaststePublisher);\n\n dao.update(een);\n dao.update(drie);\n dao.update(vier);\n dao.update(vijf);\n dao.update(zes);\n\n List<Author> soft = dao.findByPublisher(\"best\");\n soft.forEach(this::log);\n\n ////////////////////////////////////////////////// --> bidirectional\n Dao assistantDao = new Dao(entityManager);\n\n Assistant assistant1 = new Assistant(\"Assistent 1\");\n Assistant assistant2 = new Assistant(\"Assistent 2\");\n Assistant assistant3 = new Assistant(\"Assistent 3\");\n assistantDao.save(assistant1);\n assistantDao.save(assistant2);\n assistantDao.save(assistant3);\n\n een.setAssistant(assistant3);\n drie.setAssistant(assistant2);\n vier.setAssistant(assistant2);\n vijf.setAssistant(assistant1);\n zes.setAssistant(assistant1);\n\n dao.update(een);\n dao.update(drie);\n dao.update(vier);\n dao.update(vijf);\n dao.update(zes);\n\n ////////////////////////////////////////////////// --> test one-to-many (Book testen)\n\n }" ]
[ "0.670195", "0.65560424", "0.6390396", "0.62701684", "0.625024", "0.6239892", "0.58628786", "0.58628786", "0.5862454", "0.58613473", "0.5847833", "0.5832418", "0.5803424", "0.5800689", "0.57970744", "0.5795905", "0.5794451", "0.57752806", "0.57727426", "0.57721746", "0.57721746", "0.57721746", "0.57595265", "0.5748304", "0.5737879", "0.5737879", "0.5736291", "0.57220364", "0.57163125", "0.57163125", "0.57163125", "0.57163125", "0.57163125", "0.57163125", "0.57163125", "0.57163125", "0.57163125", "0.57163125", "0.57163125", "0.57163125", "0.57123923", "0.570549", "0.570096", "0.5695519", "0.5693221", "0.56871575", "0.5686757", "0.568583", "0.567988", "0.56786656", "0.5667588", "0.5659127", "0.5655349", "0.5637855", "0.5599865", "0.55975795", "0.5594219", "0.5568485", "0.5560015", "0.5560015", "0.5560015", "0.5556105", "0.55428207", "0.55397934", "0.5525156", "0.5490568", "0.54775834", "0.5472363", "0.5472363", "0.5472363", "0.5472363", "0.5444956", "0.5428955", "0.5428439", "0.542781", "0.54178554", "0.54178554", "0.54178554", "0.5416386", "0.5402964", "0.53916687", "0.5378344", "0.5347922", "0.5342952", "0.5336824", "0.53337103", "0.53305817", "0.53278416", "0.53205556", "0.5317431", "0.5317431", "0.53169096", "0.53132063", "0.53033686", "0.5284965", "0.5280891", "0.52765554", "0.52523196", "0.52418566", "0.5241449" ]
0.69689184
0
Anything in here will always be executed before each test
@BeforeEach public void beforeEach() { testBasket = new Basket(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected void runBeforeTest() {}", "@Before\n public void setUp() {\n System.out.println(\"\\n@Before - Setting Up Stuffs: Pass \"\n + ++setUpCount);\n // write setup code that must be executed before each test method run\n }", "@BeforeAll\n static void setup() {\n log.info(\"@BeforeAll - executes once before all test methods in this class\");\n }", "@Before public void setUp() { }", "@Before\n public void beforeTest(){\n\n\n }", "@Before\r\n\tpublic void doThisEveryTime() {\n\t}", "@Before\n\t public void setUp() {\n\t }", "@Before\r\n\tpublic void before() {\r\n\t}", "@Before public void setUp() {\n }", "@Before public void setUp() {\n }", "@Before public void setUp() {\n }", "@Before public void setUp() {\n }", "@Before public void setUp() {\n }", "@Before\r\n\tpublic void setUp() throws Exception {\r\n\t\t//This method is unused. \r\n\t}", "@BeforeClass\n\tpublic void beforeClass() {\n\t}", "@Before\r\n\t public void setUp(){\n\t }", "public void setUp()\r\n {\r\n //empty on purpose\r\n }", "@BeforeClass\n public static void beforeClass() {\n }", "@Before\n public void before() {\n }", "@Before\n public void before() {\n }", "protected void preTest() {\n\t\tprintTestParmas();\n\t\tif (attenuatorSetUnderTest != null) {\n\t\t\tperipheralsConfig.setAttenuatorSetValue(attenuatorSetUnderTest,\n\t\t\t\t\tattenuatorSetUnderTest.getDefaultValueAttenuation());\n\t\t} else {\n\t\t\treport.report(\"There is no attenuator set \");\n\t\t}\n\t\tchangeOtherENBsToOOS();\n\n\t\t/*if (runWithDynamicCFI)\n\t\t\tenbConfig.enableDynamicCFI(this.dut);\n\t\telse\n\t\t\tenbConfig.disableDynamicCFI(this.dut);*/\n\t\t\n\t\tgetRadioProfile();\n\n\t\tprintResultsForTest = true;\n\t\tresetTestBol = false;\n\t\texceptionThrown = false;\n\t}", "@BeforeSuite\r\n\t\tpublic void BeforeSute()\r\n\t\t{\r\n\t\t\tSystem.out.println(\"Before suite\");\r\n\t\t}", "@BeforeClass\n public void beforeclass() {\n\t}", "@Before\n public void setupThis() {\n System.out.println(\"* Before test method *\");\n }", "@Before\r\n\tpublic void setUp() {\n\t}", "protected void setUp() {\n\t}", "@Before\n public final void setUp() throws Exception\n {\n // Empty\n }", "@BeforeClass\n\tpublic static void testSetup() {\n\t\t// do something before all tests\n\t}", "@Before\r\n public void setUp()\r\n {\r\n }", "@Before\r\n public void setUp()\r\n {\r\n }", "@Before\r\n public void setUp()\r\n {\r\n }", "@Before\r\n public void setUp()\r\n {\r\n }", "public void before() {\n }", "public void before() {\n }", "@Before\n\tpublic void setUp() {\n\t}", "@Before\n public void postSetUpPerTest(){\n\n }", "@Before\r\n\tpublic void setup() {\r\n\t}", "@Override\n @Before\n public void before() throws Exception {\n\n super.before();\n }", "@Before\n public void setUp() {\n }", "@Before\n public void setUp() {\n }", "@Before\n public void setUp() {\n }", "@Before\n public void setUp() {\n }", "@Before\n public void setUp() {\n }", "@BeforeClass\r\n\tpublic static void beforeClass() {\r\n\t\tSystem.out.println(\"in before class\");\r\n\t}", "@Before\n public void setUp () {\n }", "@Before\n public void setUp() {\n }", "@Before\r\n public void before() throws Exception {\r\n }", "@Before\n public void setUp()\n {\n }", "@Before\n public void setUp()\n {\n }", "@Before\n public void setUp()\n {\n }", "@Before\n public void setUp()\n {\n }", "@Before\n public void setUp()\n {\n }", "@Before\n public void setUp()\n {\n }", "@Before\n public void setUp()\n {\n }", "@Before\n public void setUp()\n {\n }", "@Before\n public void setUp()\n {\n }", "@Before\n public void setUp()\n {\n }", "@Before\n public void setUp()\n {\n }", "@Before\n public void setUp()\n {\n }", "@Before\n public void setUp()\n {\n }", "@Before\n public void setUp()\n {\n }", "@Before\n public void setUp()\n {\n }", "@Before\n public void setUp()\n {\n }", "@Before\n public void setUp()\n {\n }", "@Before\n public void setUp()\n {\n }", "@Before\n public void setup() {\n }", "@Before\n public void setUp() {\n }", "@Before\n public void setup() {\n }", "@Before\n public void setup() {\n }", "@Before\n public void setup() {\n }", "@Before\n\tpublic void setup() {\n\t\t\n\t\t\n\t}", "public void setUp() {\n\n\t}", "@BeforeClass(enabled =true)\n\tpublic void beforeClass(){\n\t\tSystem.out.println(\"In BeforeClass\");\n\t}", "@BeforeAll\n\tstatic void initOperate()\n\t{\t\n\t\tSystem.out.println(\"only Before All the tests....\");\n\t\toperate = new Operations();\n\t}", "@BeforeClass // runs before all test cases; runs only once\n public static void setUpSuite() {\n\n }", "protected void runBeforeStep() {}", "@Override\r\n protected void setUp() {\r\n // nothing yet\r\n }", "@BeforeAll\n public void prepare() {\n }", "@BeforeClass\n\t public void setUp() {\n\t }", "@BeforeTest\n\n public void Initialize() {\n\n\n}", "@Override\n public void beforeFirstLogic() {\n }", "@Override\r\n\tpublic void setUp() {\n\t\t\r\n\t}", "@Before\n public void setUp()\n {\n summary = \"\";\n allPassed = true;\n firstFailExpected = null;\n firstFailRun = null;\n captureSummary = \"\";\n captureRun = null;\n }", "@BeforeMethod\r\n\tpublic void beforeMethod() {\r\n\t\t//initializeTestBaseSetup();\r\n\t}", "@Before\n public void setUp() throws Exception {\n }", "@Before\n public void setUp() throws Exception {\n }", "protected void setUp()\n {\n }", "protected void setUp()\n {\n }", "@Before\n public void setUp() throws Exception {\n\n }", "void before();", "@Stub\n\tpublic void before()\n\t{\n\t\t//\n\t}", "@Before\r\n\tpublic void setUp() throws Exception {\r\n\t}", "@Before\r\n\tpublic void setUp() throws Exception {\r\n\t}", "@BeforeClass\n public static void setup() {\n System.out.println(\"*** Before Class ***\");\n }", "@BeforeEach\n\tpublic void runBeforeTests() {\n\t\ttestArrayList = new ArrayList<>(Arrays.asList(38, 3, 33, 36, 5, 70, 24, 47, 7, 27, 15, 48, 53, 32, 93));\n\t}", "@Before\n public void setUp() throws Exception {\n\n }", "@BeforeAll\n public static void executedBeforeAll() {\n System.out.println(\"\\n@Before: executedBeforeall\");\n }", "@Before\r\n\tpublic void set_up(){\n\t}", "protected void runBeforeIterations() {}", "protected void setUp() {\n\n }", "@Before\n\tpublic void setup() \n\t{\n\t\tsuper.setup();\n\t\t\n }" ]
[ "0.81695586", "0.7811537", "0.77629846", "0.7674806", "0.7631169", "0.7628445", "0.75689805", "0.7561593", "0.75594723", "0.75594723", "0.75594723", "0.75594723", "0.75594723", "0.75485384", "0.75479835", "0.752601", "0.749252", "0.7489958", "0.74543124", "0.74543124", "0.7439362", "0.7438659", "0.7432815", "0.7431736", "0.7420222", "0.74150497", "0.74039775", "0.74012357", "0.7386448", "0.7386448", "0.7386448", "0.7386448", "0.7357066", "0.7357066", "0.73552316", "0.7350612", "0.73439217", "0.73388624", "0.73192954", "0.73192954", "0.73192954", "0.73192954", "0.73192954", "0.7317893", "0.7305912", "0.730562", "0.7302582", "0.72957766", "0.72957766", "0.72957766", "0.72957766", "0.72957766", "0.72957766", "0.72957766", "0.72957766", "0.72957766", "0.72957766", "0.72957766", "0.72957766", "0.72957766", "0.72957766", "0.72957766", "0.72957766", "0.72957766", "0.72957766", "0.7293971", "0.7290183", "0.728408", "0.728408", "0.728408", "0.7283604", "0.72737426", "0.72615266", "0.7259472", "0.72498274", "0.7249747", "0.7248436", "0.7247411", "0.7244735", "0.72211707", "0.7220572", "0.7206417", "0.72056276", "0.7198299", "0.71902215", "0.71902215", "0.7188625", "0.7188625", "0.7187994", "0.7176522", "0.7169268", "0.71661603", "0.71661603", "0.71611035", "0.71610266", "0.7154986", "0.7151054", "0.71352243", "0.7129321", "0.7126078", "0.7125172" ]
0.0
-1
Anything in here will always be executed after each test
@AfterEach public void afterEach() { testBasket = null; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected void runAfterTest() {}", "@AfterTest\n\tpublic void afterTest() {\n\t}", "@After\n public void afterTest(){\n }", "@Override\n protected void after() {\n }", "@After\n\tpublic void testEachCleanup() {\n\t\tSystem.out.println(\"Test Completed!\");\n\t}", "@AfterTest\n\tpublic void afterTest() {\n\t\tiDriver.quit();\n\t\tSystem.out.println(\"=====================VEGASF_419_END=====================\");\n\t}", "@After \n public void tearDownTest()\n {\n\t System.out.println(\"Test Complete\\n\\n\\n\\n\\n\");\n }", "@After\r\n\tpublic void doThatEveryTime() {\n\t}", "@After\n public void tearDown() {\n System.out.println(\"@After - Tearing Down Stuffs: Pass \"\n + ++tearDownCount);\n }", "@AfterClass\n\tpublic void afterClass() {\n\t}", "@After\r\n @CallSuper\r\n public void afterTest() {\n }", "@Stub\n\tpublic void after()\n\t{\n\t\t//\n\t}", "@AfterAll\n static void cleanOperate()\n { \n //clear reference of operate after all the tests done\n operate = null;\n System.out.println(\"only After all the tests....\");\n }", "@After\n public void tearThis() {\n System.out.println(\"* After test method *\");\n }", "@Override\r\n\t@AfterTest\r\n\tpublic void endSetting() {\n\t\tSystem.out.println(\"结束系统设置测试\");\r\n\t}", "@AfterTest\r\n public void tearDown() {\n }", "public TestCase afterThis( Procedure callafter );", "protected void runAfterStep() {}", "@AfterEach\n private void afterEachEnd()\n {\n System.out.println(\"Test Completed \" + testInfo.getDisplayName());\n System.out.println(\"After Each Clean Test........\");\n System.out.println(\"Elapsed TIme : \" + ELAPSED_TIME + \" ns\");\n LOGGER.info(\"Elapsed TIme for \" + testInfo.getDisplayName() + \" : \" + ELAPSED_TIME);\n }", "@AfterAll\n public static void afterClass() {\n System.out.println(\"After!!! **** - I am only called once!!!\");\n }", "@AfterClass\r\n\tpublic static void afterClass() {\r\n\t\tSystem.out.println(\"in after class\");\r\n\t}", "@After\n public void tearDown() {\n \n }", "@Before\r\n\tpublic void doThisEveryTime() {\n\t}", "void after();", "@After\n public void after() {\n System.out.format(\"In After of %s\\n\", ExecutionProcedureJunit2.class.getName());\n }", "@After\n public void tearDown () {\n }", "@AfterClass\n\tpublic void teardown(){\n\t}", "private void doTests()\n {\n doDeleteTest(); // doSelectTest();\n }", "protected abstract void after();", "@After\n public void tearDown() {\n }", "public void onTestSkipped() {}", "@AfterClass\n public static void tear() {\n System.out.println(\"*** After class ***\");\n }", "public void finishTest() {\r\n\t\tlatch.countDown();\r\n\t}", "@After\n public void tearDown() {\n }", "@After\n public void tearDown() {\n }", "@After\n public void tearDown() {\n }", "@After\n public void tearDown() {\n }", "@After\n public void tearDown() {\n }", "@After\r\n public void tearDown()\r\n {\r\n }", "@After\r\n public void tearDown()\r\n {\r\n }", "@After\r\n public void tearDown()\r\n {\r\n }", "@After\r\n public void tearDown()\r\n {\r\n }", "@After\n\tpublic void tearDown() {}", "@Override\n public void doAfterAllAnalysed(AnalysisContext context) {\n\n }", "@AfterClass\n\tpublic static void after() {\n\t\tXMLRetryConfigMgr.setXML_FILE(ORIG_FILE);\n\t\tHzIntegrationTestUtil.afterClass();\n\t}", "protected void tearDown() {\n // empty\n }", "@Before\n public void postSetUpPerTest(){\n\n }", "@After\n public final void tearDown() throws Exception\n {\n // Empty\n }", "@Override\r\n protected void tearDown() {\r\n // nothing yet\r\n }", "@Override\n public void tearDown() {\n // No action required\n }", "@After\n public void tearDown()\n {\n }", "@After\n public void tearDown()\n {\n }", "@After\n public void tearDown()\n {\n }", "@After\n public void tearDown()\n {\n }", "@After\n public void tearDown()\n {\n }", "@After\n public void tearDown()\n {\n }", "@After\n public void tearDown()\n {\n }", "@After\n public void tearDown()\n {\n }", "@After\n public void tearDown()\n {\n }", "@After\n public void tearDown()\n {\n }", "@After\n public void tearDown()\n {\n }", "@After\n public void tearDown()\n {\n }", "@After\n public void tearDown()\n {\n }", "@After\n public void tearDown()\n {\n }", "@After\n public void tearDown()\n {\n }", "@After\n public void tearDown()\n {\n }", "@After\n public void tearDown()\n {\n }", "@After\n public void tearDown()\n {\n }", "@After\n public void tearDown()\n {\n }", "@After\n public void tearDown()\n {\n }", "@After\n public void tearDown()\n {\n }", "@After\n public void tearDown()\n {\n }", "@After\n public void tearDown()\n {\n }", "@After\n public void tearDown()\n {\n }", "@After\n public void tearDown()\n {\n }", "@After\n public void tearDown()\n {\n }", "@After\n public void tearDown()\n {\n }", "@After\n public void tearDown()\n {\n }", "@After\n public void tearDown()\n {\n }", "@After\n public void tearDown(){\n }", "@After\n public void tearDown(){\n }", "protected void runAfterIteration() {}", "public void afterDone() {\n }", "public void afterDone() {\n }", "@AfterClass\n\tpublic void teardown() {\n\t\tSystem.out.println(\"After class Annotation\");\n\t}", "@AfterClass\n public static void runOnceAfterClass() {\n //System.out.println(\"@AfterClass - runOnceAfterClass\");\n }", "@After\n public void tearDown() throws Exception {\n }", "@After\n\tpublic void tearDown() throws Exception{\n\t\t// Don't need to do anything here.\n\t}", "@AfterAll\n public static void tearDownClass() {\n }", "@AfterAll\n public static void tearDownClass() {\n }", "@AfterAll\n public static void tearDownClass() {\n }", "@AfterAll\n public static void tearDownClass() {\n }", "@AfterAll\n public static void tearDownClass() {\n }", "@AfterAll\n public static void tearDownClass() {\n }", "@AfterAll\n public static void tearDownClass() {\n }", "@AfterAll\n public static void tearDownClass() {\n }", "@AfterAll\n public static void tearDownClass() {\n }", "@AfterAll\n public static void tearDownClass() {\n }", "@AfterClass\n public static void afterClass() throws InterruptedException {\n Thread.sleep(2000);\n }", "@After\r\n public void after() throws Exception {\r\n }", "@After\r\n public void tearDown() throws Exception {\n }" ]
[ "0.815992", "0.7618311", "0.7316253", "0.7198788", "0.7182917", "0.7152395", "0.71491075", "0.7117506", "0.70909864", "0.70899856", "0.7083649", "0.70450383", "0.70390886", "0.7001531", "0.698996", "0.698027", "0.69258946", "0.69116634", "0.6904937", "0.6902863", "0.68975735", "0.6896755", "0.6884643", "0.68546337", "0.68304914", "0.67971975", "0.6794764", "0.6788215", "0.6781582", "0.6780611", "0.6776686", "0.6776059", "0.67731595", "0.67720187", "0.67720187", "0.67720187", "0.67720187", "0.67720187", "0.67712784", "0.67712784", "0.67712784", "0.67712784", "0.677038", "0.67680854", "0.67658", "0.6764075", "0.6760688", "0.67573225", "0.6748139", "0.67452306", "0.6724182", "0.6724182", "0.6724182", "0.6724182", "0.6724182", "0.6724182", "0.6724182", "0.6724182", "0.6724182", "0.6724182", "0.6724182", "0.6724182", "0.6724182", "0.6724182", "0.6724182", "0.6724182", "0.6724182", "0.6724182", "0.6724182", "0.6724182", "0.6724182", "0.6724182", "0.6724182", "0.6724182", "0.6724182", "0.6724182", "0.6724182", "0.6724182", "0.6724182", "0.6709593", "0.6709593", "0.6707593", "0.6692747", "0.6692747", "0.6684554", "0.6675752", "0.6668765", "0.66607034", "0.6652598", "0.6652598", "0.6652598", "0.6652598", "0.6652598", "0.6652598", "0.6652598", "0.6652598", "0.6652598", "0.6652598", "0.66500556", "0.6648802", "0.6642358" ]
0.0
-1
No Standard rule for degrees, so for the time being using the one defined on Project presentation, slide 10
private float matchingDegree(OntologyResult match) { switch (match) { case Exact: return 1.0f; case Subsumption: return 0.8f; case PlugIn: return 0.6f; case Structural: return 0.5f; case NotMatched: return 0.0f; default: return 0.0f; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private static double degToRad(float deg)\r\n/* 25: */ {\r\n/* 26:32 */ return deg * 3.141592653589793D / 180.0D;\r\n/* 27: */ }", "public String getUnitOfViewAngle() {\n \treturn \"degrees\";\n }", "private static double radToDeg(float rad)\r\n/* 30: */ {\r\n/* 31:39 */ return rad * 180.0F / 3.141592653589793D;\r\n/* 32: */ }", "public int getDegreesOfFreedom() {return nu;}", "@Override\n\t\tpublic int getDegree() {\n\t\t\treturn 0;\n\t\t}", "int getStartRotationDegree();", "EDataType getAngleDegrees();", "private double degToRadian(double angle)\n\t{\n\t\treturn angle/180*Math.PI;\n\t}", "public void setDegree(float degree) {\n // set the sensitivity\n if(Math.abs(dec - degree) >= 2 ) {\n dec = degree;\n int range = 20;\n String degreeStr = String.valueOf(dec);\n\n\n if(dec > 360 - range && dec < 360 + range) {\n displayMessage = \"North \" + degreeStr + \"°\";\n }\n\n if(dec > 90 - range && dec < 90 + range) {\n displayMessage = \"East \" + degreeStr + \"°\";\n }\n\n if(dec > 180 - range && dec < 180 + range) {\n displayMessage = \"South \" + degreeStr + \"°\";\n }\n\n if(dec > 270 - range && dec < 270 + range) {\n displayMessage = \"West \" + degreeStr + \"°\";\n }\n\n if(dec > 45 - range && dec < 45 + range) {\n displayMessage = \"NE \" + degreeStr + \"°\";\n }\n\n if(dec > 135 - range && dec < 135 + range) {\n displayMessage = \"SE \" + degreeStr + \"°\";\n }\n\n if(dec > 225 - range && dec < 225 + range) {\n displayMessage = \"SW \" + degreeStr + \"°\";\n }\n\n if(dec > 315 - range && dec < 315 + range) {\n displayMessage = \"NE \" + degreeStr + \"°\";\n }\n }\n }", "int getDegree();", "int getDegree();", "private double deg2rad(double deg) {\r\n\t\t\treturn (deg * Math.PI / 180.0);\r\n\t\t}", "private double rad2deg(double rad) {\n return (rad * 180 / Math.PI);\n }", "private int DirectionCalculation(int angle)\r\n\t{\t\r\n\t\treturn (int) ((angle/14.28)+1); //Angle divided by (100/(parts-1)) = 1-8\r\n\t}", "private double rad2deg(double rad) {\r\n return (rad * 180.0 / Math.PI);\r\n }", "public static double rotation()\r\n\t{\r\n\t\treturn -(mxp.getAngle()/45);\r\n\t}", "private double AdjustDegree(double value)\n\t{\n\t\tif(value > 360.0)\n\t\t{\n\t\t\twhile (value > 360.0)\n\t\t\t{\n\t\t\t\tvalue -= 360.0;\n\t\t\t}\n\t\t}\n\t\tif(value < 0.0)\n\t\t{\n\t\t\twhile (value < 0.0)\n\t\t\t{\n\t\t\t\tvalue += 360.0;\n\t\t\t}\n\t\t}\n\t\treturn value;\n\t}", "float calcRotate(float rotateDeg, float anglePerIn)\n {\n return rotateDeg / anglePerIn;\n }", "protected static float toDegrees(int unit, float value) {\n \t\tswitch (unit) {\n \t\tcase CSSPrimitiveValue.CSS_DEG:\n \t\t\treturn value;\n \t\tcase CSSPrimitiveValue.CSS_RAD:\n \t\t\treturn (float) (value * 180 / Math.PI);\n \t\tcase CSSPrimitiveValue.CSS_GRAD:\n \t\t\treturn (value * 9 / 5);\n \t\tdefault:\n \t\t\tthrow new DOMException(DOMException.INVALID_ACCESS_ERR, \"\");\n \t\t}\n \t}", "@Test\n\tvoid toDegreesConversionTestWithRadianInput() throws CustomException {\n\t\tdouble input = 3.141592653589793;\n\t\tdouble actual = 180.0;\n\t\tdouble result = TrigLib.toDegrees(input);\n\t\tassertEquals(result, actual, \"Radian input converted into degree\");\n\t}", "private double deg2rad(double deg) {\r\n return (deg * Math.PI / 180.0);\r\n }", "public double turn (double degrees) {\n setHeading(getHeading() + degrees);\n return Math.abs(degrees);\n }", "private void setDegreeNum(double deg) {\r\n degreeNum = deg % 360.0;\r\n }", "double adjust_angle_rotation(double angle) {\n double temp;\n temp=angle;\n if(temp>90) {\n temp=180-temp;\n }\n return temp;\n }", "@Override\n\tpublic float calculateCelestialAngle(long par1, float par3) {\n\t\treturn 2.0F;\n\t}", "private float calculateAngle() {\r\n\r\n\t\tdouble angleTemp = Math.atan2(Target.getY() - y, Target.getX() - x);\r\n\t\t// I needed to use wikipedia to get this i\r\n\t\t// did not learn this in math and needed\r\n\t\t// to use a couplle youtube tutorials to\r\n\t\t// find out how to do the math in java\r\n\t\t// aswell thank fully one had the exact\r\n\t\t// way of doing this\r\n\t\treturn (float) Math.toDegrees(angleTemp) + 90;\r\n\t}", "private double deg2rad(double deg) {\n return (deg * Math.PI / 180.0);\n }", "private double rad2deg(double rad) {\r\n return (rad * 180.0 / Math.PI);\r\n }", "private double rad2deg(double rad) {\r\n\t\t\treturn (rad * 180 / Math.PI);\r\n\t\t}", "@org.junit.Test\n public void testTicksForDesiredAngle90From0() {\n int resultsTicks = SwerveDriveMath.ticksForDesiredAngle(testConfig,0, 90);\n assertEquals(90, resultsTicks);\n }", "private float findRotation()\r\n\t{\r\n\t\t//conditionals for all quadrants and axis\r\n\t\tif(tarX > 0 && tarY > 0)\r\n\t\t{\r\n\t\t\trotation = (float) Math.atan((tarY/tarX));\r\n\t\t\trotation = (float) ((rotation*180)/Math.PI);\r\n\t\t}\r\n\t\telse if(tarX < 0 && tarY > 0)\r\n\t\t{\r\n\t\t\trotation = (float) Math.atan((tarY/tarX));\r\n\t\t\trotation = (float) ((rotation*180)/Math.PI);\r\n\t\t\trotation = 180 - Math.abs(rotation);\r\n\t\t}\r\n\t\telse if(tarX < 0 && tarY < 0)\r\n\t\t{\r\n\t\t\trotation = (float) Math.atan((tarY/tarX));\r\n\t\t\trotation = (float) ((rotation*180)/Math.PI);\r\n\t\t\trotation = 180 + Math.abs(rotation);\r\n\t\t}\r\n\t\telse if(tarX > 0 && tarY < 0)\r\n\t\t{\r\n\t\t\trotation = (float) Math.atan((tarY/tarX));\r\n\t\t\trotation = (float) ((rotation*180)/Math.PI);\r\n\t\t\trotation = 90 - Math.abs(rotation);\r\n\t\t\trotation = 270 + rotation;\r\n\t\t}\r\n\t\telse if(tarX > 0 && tarY == 0)\r\n\t\t\trotation = 0;\r\n\t\telse if(tarX == 0 && tarY > 0)\r\n\t\t\trotation = 90;\r\n\t\telse if(tarX < 0 && tarY == 0)\r\n\t\t\trotation = 180;\r\n\t\telse if(tarX == 0 && tarY < 0)\r\n\t\t\trotation = 270;\r\n\t\t\r\n\t\treturn (rotation - 90);\r\n\t}", "private double deg2rad(double deg) {\r\n return (deg * Math.PI / 180.0);\r\n }", "public Unit<Angle> microradian() {return microradian;}", "double getCalibratedLevelAngle();", "public float calculateCelestialAngle(long par1, float par3)\n {\n return 0.5F;\n }", "private static int convertDegreesToPolar(int degrees) {\n switch (degrees) {\n case -90:\n return 270;\n case -60:\n return 300;\n case -30:\n return 330;\n default:\n return degrees;\n }\n }", "private static double rad2deg(double rad) {\n return (rad * 180 / Math.PI);\n }", "private static double rad2deg(double rad) {\n return (rad * 180 / Math.PI);\n }", "private static double rad2deg(double rad) {\n return (rad * 180 / Math.PI);\n }", "private static double rad(double deg) {\n return deg*Math.PI/180;\n }", "private double rad2deg(double rad) {\n return (rad * 180.0 / Math.PI);\n }", "private double rad2deg(double rad) {\n return (rad * 180.0 / Math.PI);\n }", "private static double deg2rad(double deg) {\n return (deg * Math.PI / 180.0);\n }", "private static double rad2deg(double rad) {\n return (rad * 180.0 / Math.PI);\n }", "@Override\n public int calculerPerimetre() {\n return (int)(rayon * 2 * Math.PI);\n }", "@Test\n\tvoid toRadiansConversionTestWithDegreeInput() throws CustomException {\n\t\tdouble input = 180;\n\t\tdouble actual = 3.141592653589793;\n\t\tdouble result = TrigLib.sine(input);\n\t\tassertNotEquals(result, actual, \"Output is not as expected as input is not converted to radians\");\n\t}", "private static double rad2deg(double rad) {\r\n\t\treturn (rad * 180.0 / Math.PI);\r\n\t}", "double getAngle();", "double getAngle();", "public Degree() {\n\t\tsuper();\n\t}", "private static double deg2rad(double deg) {\r\n\t\treturn (deg * Math.PI / 180.0);\r\n\t}", "private static double deg2rad(double deg) {\r\n\t\treturn (deg * Math.PI / 180.0);\r\n\t}", "private double deg2rad(double deg) {\n return (deg * Math.PI / 180.0);\n }", "private double deg2rad(double deg) {\n return (deg * Math.PI / 180.0);\n }", "@Override\n\t\tpublic int getDegree(Direction direction) {\n\t\t\treturn 0;\n\t\t}", "protected void setDegreesOfFreedom(int degrees) {\n\tnu = degrees;\n }", "@Override\n public void reAngle() {\n }", "private static int degreesToTicks(double degrees){\r\n double temp = degrees * (1086 / 90);\r\n int ticks = (int)temp;\r\n return ticks;\r\n }", "private static double deg2rad(double deg) {\n return (deg * Math.PI / 180.0);\n }", "private static double deg2rad(double deg) {\n return (deg * Math.PI / 180.0);\n }", "private static double deg2rad(double deg) {\n return (deg * Math.PI / 180.0);\n }", "public double getStartAngle();", "private double rad2deg(double rad) {\n\t\treturn (rad * 180.0 / Math.PI);\n\t}", "public double degrees() {\n return this.degrees;\n }", "@Override\n public int calculerSurface() {\n return (int)(Math.PI * carre(rayon));\n }", "@Override\n\tpublic void onSensorChanged(SensorEvent event) {\n\t\tdegree = Math.round(event.values[0]);\n\t}", "public double evaluate(Map<String, Double> assignment) throws Exception {\n if (super.getExpression().evaluate(assignment) % 180 == 90) {\n return 0;\n }\n if (super.getExpression().evaluate(assignment) % 360 == 180) {\n return -1;\n }\n if (super.getExpression().evaluate(assignment) % 360 == 0) {\n return 1;\n }\n return Math.cos(Math.toRadians(super.getExpression().evaluate(assignment)));\n }", "public int getDegree(){\n return degree;\n }", "private static double rad2deg(double rad) {\n\t\treturn (rad * 180 / Math.PI);\n\t}", "private double deg2rad(double deg) {\n\t\treturn (deg * Math.PI / 180.0);\n\t}", "public int getDegrees() {\n\t\treturn (int) (value * (180.0d / Math.PI));\n\t}", "public double getAngle() {\n try {\n switch(Coordinates.angleUnit()) {\n case Coordinates.RADIAN:\n\treturn Double.parseDouble(deg.getText().trim());\n case Coordinates.DEGRE:\n\treturn Math.PI * Double.parseDouble(deg.getText().trim()) / 180.0;\n case Coordinates.DEGMN:\n\tString d = deg.getText().trim();\n\tif(d.length() == 0)\n\t d = \"0\";\n\tString m = mn.getText().trim();\n\tif(m.length() == 0)\n\t m = \"0\";\n\treturn Coordinates.parseAngle(d + \"11\" + m + \"'\");\n case Coordinates.DEGMNSEC:\n\td = deg.getText().trim();\n\tif(d.length() == 0)\n\t d = \"0\";\n\tm = mn.getText().trim();\n\tif(m.length() == 0)\n\t m = \"0\";\n\tString s = sec.getText().trim();\n\tif(s.length() == 0)\n\t s = \"0\";\n\treturn Coordinates.parseAngle(d + \"11\" + m + \"'\" + s + \"\\\"\");\n }\n }\n catch(NumberFormatException e) {\n }\n return 0.0;\n }", "public double getAngle();", "private static double rad2deg(double rad) {\n\t\treturn (rad * 180.0 / Math.PI);\n\t}", "public static float rad2deg(float rad) {return rad/D2R;}", "public static double reduce360Degrees(double degrees){\n return degrees % 360;\n }", "Angle createAngle();", "Degree createDegree();", "public float calculateCelestialAngle(long par1, float par3) {\n\t\treturn 0.0F;\n\t}", "public void setDegree(int degree);", "abstract int degree(int i);", "private static double deg2rad(double deg) {\n\t\treturn (deg * Math.PI / 180.0);\n\t}", "private static double deg2rad(double deg) {\n\t\treturn (deg * Math.PI / 180.0);\n\t}", "private float angularRounding(float input) {\n if (input >= 180.0f) {\n return input - 360.0f;\n } else if (input <= -180.0f) {\n return 360 + input;\n } else {\n return input;\n }\n }", "private static double convertToDegree(String source) {\n String[] degMinSec = source.split(\",\");\n String[] degSrc = degMinSec[0].split(\"/\");\n String[] minSrc = degMinSec[1].split(\"/\");\n String[] secSrc = degMinSec[2].split(\"/\");\n\n double deg = Double.parseDouble(degSrc[0]) / Double.parseDouble(degSrc[1]);\n double min = Double.parseDouble(minSrc[0]) / Double.parseDouble(minSrc[1]);\n double sec = Double.parseDouble(secSrc[0]) / Double.parseDouble(secSrc[1]);\n\n return deg + (min / 60) + (sec / (60 * 60)); // Fold degrees, minutes and seconds together\n }", "public double getAngle() { return angle; }", "public double getHeadingInDegrees(){\r\n double headingRadians = calculateHeadingRadians();\r\n return headingRadians * 180 / Math.PI;\r\n }", "public void setDegrees(double degrees) {\n this.degrees = degrees;\n }", "int getEndRotationDegree();", "public int updateDegree(){\r\n \r\n \tthis.degree = this.degree + this.rotSpeed;\r\n \tif (this.degree > 359) this.degree = 0;\r\n \t\r\n return this.degree;\r\n }", "@Test\r\n public void testCalculateAngle4() {\r\n System.out.println(\"calculateAngle4\");\r\n DialDraw instance = new TachometerDraw();\r\n instance.setValue(90);\r\n double expResult = Math.toRadians(18);\r\n double result = instance.calculateAngle();\r\n assertEquals(result, expResult, 0.0001);\r\n }", "public TurnDegrees(double speed, double degrees, Drivetrain drive) {\n super(new PIDController(0.0085, 0, 0), \n drive::getGyroAngleZ, \n degrees, \n output -> {\n double clampedOutput = MathUtil.clamp(output, -1, 1);\n if(Math.abs(clampedOutput) < 0.325 && Math.abs(clampedOutput) > 0) {\n double tempClampedOutput = clampedOutput;\n clampedOutput = Math.copySign(0.325, tempClampedOutput);\n }\n System.out.println(clampedOutput);\n drive.arcadeDrive(0, clampedOutput);\n }, \n drive);\n\n m_degrees = degrees;\n m_speed = speed;\n m_drive = drive;\n }", "public float perimetro(){\r\n return 2*(float)Math.PI*radio;\r\n }", "public int getDegree()\r\n\t{\r\n\t\treturn degree;\r\n\t}", "public double getDegree() {\n return degree;\n }", "@Test\r\n public void testCalculateAngle1() {\r\n System.out.println(\"calculateAngle1\");\r\n DialDraw instance = new TachometerDraw();\r\n instance.setValue(36);\r\n double expResult = Math.toRadians(115.2);\r\n double result = instance.calculateAngle();\r\n assertEquals(result, expResult, 0.0001);\r\n }", "public float getXAngle(){\n Point project=new Point(0,accel.y,accel.z);\n\n float angl=(float)Math.asin(project.y / project.module())* PreferenceHelper.sensetivity;\n //float angl=(float)Math.acos(accel.z/accel.module())*100f;\n if(Float.isNaN(angl)) angl=0.5f;\n return (float)(Math.rint( toFlowX(angl)/1.0) * 1.0);\n }", "private double y(double pt){\n pt = -pt;\n if (pt<=0) pt = 90 + -pt;\n else pt = 90 - pt;\n\n pt = 180-pt;\n return pt;\n }", "int getSensorRotationDegrees();", "@Test\r\n public void testCalculateAngle2() {\r\n System.out.println(\"calculateAngle2\");\r\n DialDraw instance = new TachometerDraw();\r\n instance.setValue(0);\r\n double expResult = Math.toRadians(180);\r\n double result = instance.calculateAngle();\r\n assertEquals(result, expResult, 0.0001);\r\n }", "public double calculateDegToRetreat() {\r\n\t\tdouble newDeg = (degToAttack + 180) % 360;\r\n\t\tSystem.out.println(newDeg);\r\n\t\treturn newDeg;\r\n\t}" ]
[ "0.64578605", "0.6434699", "0.63901794", "0.6316969", "0.62483114", "0.62237626", "0.61589736", "0.6081636", "0.6069573", "0.6057386", "0.6057386", "0.6030873", "0.6022949", "0.60188454", "0.60096395", "0.5990671", "0.5977517", "0.5977371", "0.5973771", "0.5968612", "0.596254", "0.59497917", "0.5946226", "0.59394217", "0.5938726", "0.59279376", "0.5926545", "0.59220815", "0.59216243", "0.5910845", "0.5894286", "0.58872616", "0.5887231", "0.5885778", "0.5881683", "0.5881401", "0.58765894", "0.58765894", "0.58765894", "0.58744717", "0.5872395", "0.5872395", "0.58716935", "0.5868802", "0.58627146", "0.58616954", "0.5856957", "0.5839587", "0.5839587", "0.5828027", "0.5819918", "0.5819918", "0.581025", "0.581025", "0.5806181", "0.5805252", "0.5803806", "0.5803374", "0.5802694", "0.5802694", "0.5802694", "0.5794045", "0.5790819", "0.5772448", "0.5765388", "0.57643545", "0.57597905", "0.5753154", "0.5752525", "0.57447684", "0.5742748", "0.5742376", "0.5737716", "0.57335275", "0.57298", "0.5719547", "0.57151914", "0.5714908", "0.5714231", "0.5713607", "0.5701883", "0.5701382", "0.5701382", "0.5698423", "0.5688804", "0.56865054", "0.56808823", "0.5679407", "0.5678319", "0.56682545", "0.56677115", "0.56545776", "0.565264", "0.5633344", "0.5630926", "0.5627968", "0.5626512", "0.56243336", "0.56131876", "0.5604029", "0.560323" ]
0.0
-1
Recursive "Bruteforce" metode BubbleSort O(n^2)
public void recursiveBubbleSort(int[] numbers) { boolean sorted = false; int posA; int posB; for(int i = 0; i < numbers.length - 1; i++) { if(numbers[i] > numbers[i + 1] && numbers[i] != numbers.length) { posA = numbers[i]; posB = numbers[i + 1]; numbers[i] = posB; numbers[i + 1] = posA; sorted = true; } } if (sorted) { recursiveBubbleSort(numbers); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static void sortBubble(int[] tab) {\n boolean alreadySorted=false;\n int temp;\n int n=tab.length;\n int i=0;\n if(tab.length!=0){\n while (i<n-1 && !alreadySorted){\n alreadySorted=true;\n for (int j=0; j<n-1-i;j++){\n if (tab[j]>tab[j+1]){\n alreadySorted=false;\n temp=tab[j];\n tab[j]=tab[j+1];\n tab[j+1]=temp;\n }\n }\n i=i+1;\n }\n }\n}", "public void bubbleSort() {\n\t\tint n = data.size();\n\t\tfor (int i = 0; i < data.size(); i++) {\n\t\t\tfor (int j = 1; j < n - i; j++) {\n\t\t\t\tif (data.get(j - 1) > data.get(j)) {\n\t\t\t\t\tswap(j, j - 1);\n\t\t\t\t}\n\t\t\t}\n\n\t\t}\n\n\t}", "public static void BubbleSort(int[] a) {\n\t int n = a.length;\n\t int temp = 0;\n\n\t for(int i = 0; i < n; i++) {\n\t for(int j=1; j < (n-i); j++) {\n\t if(a[j-1] > a[j]) {\n\t temp = a[j-1];\n\t a[j-1] = a[j];\n\t a[j] = temp;\n\t }\n\t }\n\t }\n\t}", "public void setBubbleSort() \n\t{\n\t\tint last = recordCount + NOT_FOUND; //array.length() - 1\n\n\t\twhile(last > RESET_VALUE) //last > 0\n\t\t{\n\t\t\tint localIndex = RESET_VALUE; \n\t\t\tboolean swap = false;\n\n\t\t\twhile(localIndex < last) \n\t\t\t{\n\t\t\t\tif(itemIDs[localIndex] > itemIDs[localIndex + 1]) \n\t\t\t\t{\n\t\t\t\t\tsetSwapArrayElements(localIndex);\n\t\t\t\t\tswap = true;\n\t\t\t\t}\n\t\t\t\tlocalIndex++;\n\t\t\t}\n\n\t\t\tif(swap == false) \n\t\t\t{\n\t\t\t\tlast = RESET_VALUE;\n\t\t\t}\n\t\t\telse \n\t\t\t{\n\t\t\t\tlast = last + NOT_FOUND;\n\t\t\t}\n\n\t\t}//END while(last > RESET_VALUE)\n\t\treturn;\n\t}", "static int[] bubbleSort(int[] a) {\n int n = a.length;\n while(n > 0) {\n int newLastN = 0; // if no swap occurred in last step we won't need to run next iteration\n for (int i = 1; i < n; i++) {\n comparisonCount++;\n if (a[i - 1] > a[i]) {\n swapCount++;\n swap(a, i - 1, i);\n newLastN = i;\n }\n }\n n = newLastN;\n }\n return a;\n }", "private static Integer[] optimisedBubbleSort(Integer[] n) {\n int len = n.length - 1;\n boolean swapped = false;\n for (int i = 0; i < len; i++) {\n for (int j = 0; j < len - i; j++) {\n if (n[j] > n[j + 1]) {\n int temp = n[j];\n n[j] = n[j + 1];\n n[j + 1] = temp;\n swapped = true;\n }\n }\n if(swapped == false) {\n break;\n }\n }\n return n;\n }", "public void bubbleSort(ArrayList <Comparable> list){\r\n\t\tsteps += 2; //init, check condition\r\n\t\tfor (int i = list.size() - 1; i >= 0; i --){\r\n\t\t\tsteps += 2; //init, check condition\r\n\t\t\tfor (int j = 0; j < i ; j ++){\r\n\t\t\t\tsteps += 5;\r\n\t\t\t\tif (list.get(j).compareTo(list.get(j + 1)) < 0){\r\n\t\t\t\t\tsteps += 2;\r\n\t\t\t\t\tswap(list, j, j + 1);\r\n\t\t\t\t\tsteps += 5;\r\n\t\t\t\t}\r\n\t\t\t\tsteps += 2;\r\n\t\t\t}\r\n\t\t\tsteps += 2;\r\n\t\t}\r\n\t\tSystem.out.println();\r\n\t\tSystem.out.println(\"Bubble Sort\");\r\n\t\tSystem.out.println();\r\n\t}", "public void bubbleSort(ArrayList <Integer> list){\n System.out.println();\n System.out.println(\"Bubble Sort\");\n System.out.println();\n\n steps = 0;\n for (int outer = 0; outer < list.size() - 1; outer++){\n for (int inner = 0; inner < list.size()-outer-1; inner++){\n steps += 3;//count one compare and 2 gets\n if (list.get(inner)>(list.get(inner + 1))){\n steps += 4;//count 2 gets and 2 sets\n int temp = list.get(inner);\n list.set(inner,list.get(inner + 1));\n list.set(inner + 1,temp);\n }\n }\n }\n }", "void bubbleSort(int arr[]) {\r\n\r\n int n = arr.length;\r\n boolean swapped;\r\n for(int i = 0; i < n-1; i++) { //denotes pass #\r\n for(int j = 0; j < n-i-1; j++) { //denotes element in the pass\r\n if(arr[j] > arr[j+1]) {\r\n //swapping of the element\r\n arr[j] += arr[j+1];\r\n arr[j+1] = arr[j] - arr[j+1];\r\n arr[j] -= arr[j+1];\r\n swapped = true;\r\n\r\n } //end of if block\r\n }//end of element checking loop\r\n //if no 2 elements were swapped by inner loop, then break\r\n if (swapped == false)\r\n break;\r\n }//end of pass loop\r\n }", "static void BubbleSort(int[] arr){\n for(int i = 0; i< arr.length-1;i++){\n int numberOfSwaps = 0;\n for(int j = 0; j<arr.length-i-1;j++){\n if(arr[j]>arr[j+1]){\n Swap(arr, j, j+1);\n numberOfSwaps++;\n }\n }\n if(numberOfSwaps == 0){\n break;\n }\n }\n }", "public void bubbleSort(long [] a){\n\t\tint upperBound=a.length-1;\n\t\tint lowerBound =0;\n\t\tint swaps=0;\n\t\tint iterations=0;\n\t\twhile(upperBound>=lowerBound){\n\t\t\tfor(int i=0,j=1;i<=upperBound && j<=upperBound; j++,i++){\n\t\t\t\tlong lowerOrderElement = a[i];\n\t\t\t\tlong upperOrderElement = a[j];\n\t\t\t\titerations++;\n\t\t\t\tif(lowerOrderElement>upperOrderElement){ //swap positions\n\t\t\t\t\ta[i] = a[j];\n\t\t\t\t\ta[j]= lowerOrderElement;\n\t\t\t\t\tswaps=swaps+1;\n\t\t\t\t}\n\t\t\t\telse{ // sorted.\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t\tupperBound--;\n//\t\tSystem.out.println(\"upperBound:- \" +upperBound);\n//\t\tSystem.out.println(\"lowerBound:- \" +lowerBound);\n\t\t}displayArr(a);\n\t\t\n\t\tSystem.out.println(\"Total Swaps:- \" + swaps);\n\t\tSystem.out.println(\"Total Iterations:- \" + iterations);\n\t}", "private void bubbleSort(T[] arr) {\n boolean swaps;\n for (int i = 0; i < n - 1; i++) { // since we always compare two elements, we will need to iterate up to (n - 1) times\n swaps = false;\n for (int j = 1; j < n - i; j++) // we reduce the inspected area by one element at each loop, because the largest element will already be pushed to the right\n if (arr[j].compareTo(arr[j - 1]) < 0) {\n swap(arr, j, j - 1); // the swap method is implemented further\n swaps = true;\n }\n if (!swaps) break; // we stop if there were no swaps during the last iteration\n }\n }", "private static void BubbleIterMod(int[] arr) {\n\t\t\n\t\tboolean pass = true;\n\t while (pass) {\n\t pass = false; //assume this is last pass over array\n\t for (int j=0; j<arr.length-1; ++j) {\n\t if (arr[j] > arr[j+1]) { \n\t \tswap(arr, j);\n\t \tpass = true; //after an exchange, must look again\n\t }\n\t }\n\t }\n\t}", "public static void bubbleSortAlgo(int[] arr) {\n for(int i = 1; i<arr.length-1; i++){\n // inner loop to compare each element with it's next one in every iteration in one complete outer loop\n for(int j = 0; j<arr.length -1; j++){\n if(isSmaller(arr, j+1, j)){ // compares the jth element from it's next element\n swap(arr, j+1, j); // if ismaller condition is true swaps both the elements\n }\n }\n }\n \n }", "public static void bubbleSort() {\r\n\t\tfor(int i = nodeArrList.size() -1; i > 0; i--) {\r\n\t\t\tfor(int j = 0; j < i; j++) {\r\n\t\t\t\tif(nodeArrList.get(j).frequency > nodeArrList.get(j +1).frequency) {\r\n\t\t\t\t\tHuffmanNode temp = nodeArrList.get(j);\r\n\t\t\t\t\tnodeArrList.set(j, nodeArrList.get(j + 1));\r\n\t\t\t\t\tnodeArrList.set(j + 1, temp);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t}", "public static void BubbleSort(int[] input) {\r\n for (int i = input.length - 1; i > 0; i--) {\r\n for (int j = 0; j < i; i++) {\r\n if (input[j] > input[j + 1]) {\r\n swap(input, j, j + 1);\r\n }\r\n }\r\n }\r\n }", "public void bubbleSort(){\n for(int i = arraySize -1; i > 1; i--){\n for(int j = 0; j < i; j++){\n // Use < to change it to Descending order\n if(theArray[j] > theArray[j+1]){\n swapValues(j, j+1);\n printHorizontalArray(i, j);\n }\n printHorizontalArray(i, j);\n }\n }\n }", "public static void main(String[] args) {\n\t\tScanner scn = new Scanner(System.in);\r\n\t\tint t = scn.nextInt();\r\n//\t\twhile (t > 0) {\r\n//\t\t\tint n = scn.nextInt();\r\n//\t\t\tlong[] arr = new long[n];\r\n//\t\t\tint i, j;\r\n//\t\t\tlong s = 0;\r\n//\t\t\tfor (i = 0; i < n; i++) {\r\n//\t\t\t\tarr[i] = scn.nextInt();\r\n//\t\t\t}\r\n//\t\t\r\n//\t\t\t//bubble sort\r\n//\t\t\tfor (i = 0; i < n - 1; i++) {\r\n//\t\t\t\tfor (j = 0; j < n - i - 1; j++) {\r\n//\t\t\t\t\tlong k1 = combine(arr[j], arr[j + 1]);\r\n//\t\t\t\t\tlong k2 = combine(arr[(j + 1)], arr[j]);\r\n//\t\t\t\t\tif (k2 > k1) {\r\n//\t\t\t\t\t\tlong temp = arr[j];\r\n//\t\t\t\t\t\tarr[j] = arr[(j + 1)];\r\n//\t\t\t\t\t\tarr[(j + 1)] = temp;\r\n//\t\t\t\t\t}\r\n//\t\t\t\t}\r\n//\t\t\t}\r\n//\t\t\tfor (i = 0; i < n - 1; i++) {\r\n//\t\t\t\ts = combine(arr[i], arr[i + 1]);\r\n//\t\t\t\tarr[i+1] = s;\r\n//\t\t\t}\r\n//\t\t\tSystem.out.println(arr[n-1]);\r\n//\t\t\tt--;\r\n//\t\t}\r\n//\t}\r\n//\r\n//\tpublic static long combine(long n, long m) {\r\n//\t\tlong f = m;\r\n//\t\tint b = 0;\r\n//\t\twhile (f > 0) {\r\n//\t\t\tf = f / 10;\r\n//\t\t\tb++;\r\n//\t\t}\r\n//\r\n//\t\tf = (long)(n * Math.pow(10, b) + m);\r\n//\t\treturn f;\r\n\t\t\r\n\r\n\t}", "private static void BubbleIter(int[] arr) {\n\t\t\n\t\tint size = arr.length;\n\t for (int i=1; i<size; ++i) {\n\t for (int j=0; j<size-i; ++j) {\n\t \t// Sorts the array arr[first] through arr[last] iteratively.\n\t \t// Last index changes by i pass\n\t if (arr[j]>arr[j+1]) swap(arr, j);\n\t }\n\t }\n\t}", "public void bubbleSort() {\n boolean unordered = false;\n do {\n unordered = false;\n for (int i = 0; i < array.length - 1; i++) {\n if (((Comparable) array[i]).compareTo(array[i + 1]) > 0) {\n T temp = array[i + 1];\n array[i + 1] = array[i];\n array[i] = temp;\n unordered = true;\n }\n }\n } while (unordered);\n }", "public static void bubbleSort(int [] arr){\n int temp = 0; //temporary variable\n boolean flag = false; //mark if any reversion has happened\n for (int i = 0; i < arr.length - 1;i++){\n\n for (int j = 0; j < arr.length - 1-i; j++) {\n //if the previous number is bigger than the latter, reverse\n if (arr[j] > arr[j + 1]) {\n flag = true;\n temp = arr[j];\n arr[j] = arr[j + 1];\n arr[j + 1] = temp;\n }\n }\n\n //System.out.printf(\"After the %d round of sorting\",i+1);\n //System.out.println(Arrays.toString(arr));\n\n if(!flag){\n break;\n } else {\n flag = false;\n //reset flag to true to do the next check\n }\n }\n }", "public ListUtilities bubbleSort(){\n\t\tboolean swaps = true;\t\t\n\t\t\n\t\twhile(swaps == true){\n\t\t\t//no swaps to begin with\n\t\t\tswaps = false;\n\n\t\t\t//if not end of list\n\t\t\tif (this.nextNum != null){\n\t\t\t\tListUtilities temp = new ListUtilities();\n\t\t\t\t//make temp point to 2\n\t\t\t\ttemp = this.nextNum;\n\t\t\t\t//if 1 is greater than 2\n\t\t\t\tif(this.num > this.nextNum.num){\n\t\t\t\t\t//it swapped\n\t\t\t\t\tswaps = true;\n\t\t\t\t\tswapF(temp);\n\t\t\t\t}\n\n\t\t\t//keep going until you hit end of list\n\t\t\ttemp.bubbleSort();\n\t\t\t} \n\n\t\t\t//if at end of list and swaps were made, return to beginning and try again\n\t\t\tif (this.nextNum == null && swaps == true){\n\n\t\t\t\tthis.returnToStart().bubbleSort();\n\t\t\t}\n\t\t}\n\t//return beginning of list\n\treturn this.returnToStart();\n\t}", "public int Sort(){\n\tint nt ;\n\tint i ;\n\tint aux02 ;\n\tint aux04 ;\n\tint aux05 ;\n\tint aux06 ;\n\tint aux07 ;\n\tint j ;\n\tint t ;\n\ti = size - 1 ;\n\taux02 = 0 - 1 ;\n\twhile (aux02 < i) {\n\t j = 1 ;\n\t //aux03 = i+1 ;\n\t while (j < (i+1)){\n\t\taux07 = j - 1 ;\n\t\taux04 = number[aux07] ;\n\t\taux05 = number[j] ;\n\t\tif (aux05 < aux04) {\n\t\t aux06 = j - 1 ;\n\t\t t = number[aux06] ;\n\t\t number[aux06] = number[j] ;\n\t\t number[j] = t;\n\t\t}\n\t\telse nt = 0 ;\n\t\tj = j + 1 ;\n\t }\n\t i = i - 1 ;\n\t}\n\treturn 0 ;\n }", "public int Sort(){\n\tint nt ;\n\tint i ;\n\tint aux02 ;\n\tint aux04 ;\n\tint aux05 ;\n\tint aux06 ;\n\tint aux07 ;\n\tint j ;\n\tint t ;\n\ti = size - 1 ;\n\taux02 = 0 - 1 ;\n\twhile (aux02 < i) {\n\t j = 1 ;\n\t //aux03 = i+1 ;\n\t while (j < (i+1)){\n\t\taux07 = j - 1 ;\n\t\taux04 = number[aux07] ;\n\t\taux05 = number[j] ;\n\t\tif (aux05 < aux04) {\n\t\t aux06 = j - 1 ;\n\t\t t = number[aux06] ;\n\t\t number[aux06] = number[j] ;\n\t\t number[j] = t;\n\t\t}\n\t\telse nt = 0 ;\n\t\tj = j + 1 ;\n\t }\n\t i = i - 1 ;\n\t}\n\treturn 0 ;\n }", "public int Sort(){\n\tint nt ;\n\tint i ;\n\tint aux02 ;\n\tint aux04 ;\n\tint aux05 ;\n\tint aux06 ;\n\tint aux07 ;\n\tint j ;\n\tint t ;\n\ti = size - 1 ;\n\taux02 = 0 - 1 ;\n\twhile (aux02 < i) {\n\t j = 1 ;\n\t //aux03 = i+1 ;\n\t while (j < (i+1)){\n\t\taux07 = j - 1 ;\n\t\taux04 = number[aux07] ;\n\t\taux05 = number[j] ;\n\t\tif (aux05 < aux04) {\n\t\t aux06 = j - 1 ;\n\t\t t = number[aux06] ;\n\t\t number[aux06] = number[j] ;\n\t\t number[j] = t;\n\t\t}\n\t\telse nt = 0 ;\n\t\tj = j + 1 ;\n\t }\n\t i = i - 1 ;\n\t}\n\treturn 0 ;\n }", "public int Sort(){\n\tint nt ;\n\tint i ;\n\tint aux02 ;\n\tint aux04 ;\n\tint aux05 ;\n\tint aux06 ;\n\tint aux07 ;\n\tint j ;\n\tint t ;\n\ti = size - 1 ;\n\taux02 = 0 - 1 ;\n\twhile (aux02 < i) {\n\t j = 1 ;\n\t //aux03 = i+1 ;\n\t while (j < (i+1)){\n\t\taux07 = j - 1 ;\n\t\taux04 = number[aux07] ;\n\t\taux05 = number[j] ;\n\t\tif (aux05 < aux04) {\n\t\t aux06 = j - 1 ;\n\t\t t = number[aux06] ;\n\t\t number[aux06] = number[j] ;\n\t\t number[j] = t;\n\t\t}\n\t\telse nt = 0 ;\n\t\tj = j + 1 ;\n\t }\n\t i = i - 1 ;\n\t}\n\treturn 0 ;\n }", "public int Sort(){\n\tint nt ;\n\tint i ;\n\tint aux02 ;\n\tint aux04 ;\n\tint aux05 ;\n\tint aux06 ;\n\tint aux07 ;\n\tint j ;\n\tint t ;\n\ti = size - 1 ;\n\taux02 = 0 - 1 ;\n\twhile (aux02 < i) {\n\t j = 1 ;\n\t //aux03 = i+1 ;\n\t while (j < (i+1)){\n\t\taux07 = j - 1 ;\n\t\taux04 = number[aux07] ;\n\t\taux05 = number[j] ;\n\t\tif (aux05 < aux04) {\n\t\t aux06 = j - 1 ;\n\t\t t = number[aux06] ;\n\t\t number[aux06] = number[j] ;\n\t\t number[j] = t;\n\t\t}\n\t\telse nt = 0 ;\n\t\tj = j + 1 ;\n\t }\n\t i = i - 1 ;\n\t}\n\treturn 0 ;\n }", "public int Sort(){\n\tint nt ;\n\tint i ;\n\tint aux02 ;\n\tint aux04 ;\n\tint aux05 ;\n\tint aux06 ;\n\tint aux07 ;\n\tint j ;\n\tint t ;\n\ti = size - 1 ;\n\taux02 = 0 - 1 ;\n\twhile (aux02 < i) {\n\t j = 1 ;\n\t //aux03 = i+1 ;\n\t while (j < (i+1)){\n\t\taux07 = j - 1 ;\n\t\taux04 = number[aux07] ;\n\t\taux05 = number[j] ;\n\t\tif (aux05 < aux04) {\n\t\t aux06 = j - 1 ;\n\t\t t = number[aux06] ;\n\t\t number[aux06] = number[j] ;\n\t\t number[j] = t;\n\t\t}\n\t\telse nt = 0 ;\n\t\tj = j + 1 ;\n\t }\n\t i = i - 1 ;\n\t}\n\treturn 0 ;\n }", "public int Sort(){\n\tint nt ;\n\tint i ;\n\tint aux02 ;\n\tint aux04 ;\n\tint aux05 ;\n\tint aux06 ;\n\tint aux07 ;\n\tint j ;\n\tint t ;\n\ti = size - 1 ;\n\taux02 = 0 - 1 ;\n\twhile (aux02 < i) {\n\t j = 1 ;\n\t //aux03 = i+1 ;\n\t while (j < (i+1)){\n\t\taux07 = j - 1 ;\n\t\taux04 = number[aux07] ;\n\t\taux05 = number[j] ;\n\t\tif (aux05 < aux04) {\n\t\t aux06 = j - 1 ;\n\t\t t = number[aux06] ;\n\t\t number[aux06] = number[j] ;\n\t\t number[j] = t;\n\t\t}\n\t\telse nt = 0 ;\n\t\tj = j + 1 ;\n\t }\n\t i = i - 1 ;\n\t}\n\treturn 0 ;\n }", "public int Sort(){\n\tint nt ;\n\tint i ;\n\tint aux02 ;\n\tint aux04 ;\n\tint aux05 ;\n\tint aux06 ;\n\tint aux07 ;\n\tint j ;\n\tint t ;\n\ti = size - 1 ;\n\taux02 = 0 - 1 ;\n\twhile (aux02 < i) {\n\t j = 1 ;\n\t //aux03 = i+1 ;\n\t while (j < (i+1)){\n\t\taux07 = j - 1 ;\n\t\taux04 = number[aux07] ;\n\t\taux05 = number[j] ;\n\t\tif (aux05 < aux04) {\n\t\t aux06 = j - 1 ;\n\t\t t = number[aux06] ;\n\t\t number[aux06] = number[j] ;\n\t\t number[j] = t;\n\t\t}\n\t\telse nt = 0 ;\n\t\tj = j + 1 ;\n\t }\n\t i = i - 1 ;\n\t}\n\treturn 0 ;\n }", "public int Sort(){\n\tint nt ;\n\tint i ;\n\tint aux02 ;\n\tint aux04 ;\n\tint aux05 ;\n\tint aux06 ;\n\tint aux07 ;\n\tint j ;\n\tint t ;\n\ti = size - 1 ;\n\taux02 = 0 - 1 ;\n\twhile (aux02 < i) {\n\t j = 1 ;\n\t //aux03 = i+1 ;\n\t while (j < (i+1)){\n\t\taux07 = j - 1 ;\n\t\taux04 = number[aux07] ;\n\t\taux05 = number[j] ;\n\t\tif (aux05 < aux04) {\n\t\t aux06 = j - 1 ;\n\t\t t = number[aux06] ;\n\t\t number[aux06] = number[j] ;\n\t\t number[j] = t;\n\t\t}\n\t\telse nt = 0 ;\n\t\tj = j + 1 ;\n\t }\n\t i = i - 1 ;\n\t}\n\treturn 0 ;\n }", "public int Sort(){\n\tint nt ;\n\tint i ;\n\tint aux02 ;\n\tint aux04 ;\n\tint aux05 ;\n\tint aux06 ;\n\tint aux07 ;\n\tint j ;\n\tint t ;\n\ti = size - 1 ;\n\taux02 = 0 - 1 ;\n\twhile (aux02 < i) {\n\t j = 1 ;\n\t //aux03 = i+1 ;\n\t while (j < (i+1)){\n\t\taux07 = j - 1 ;\n\t\taux04 = number[aux07] ;\n\t\taux05 = number[j] ;\n\t\tif (aux05 < aux04) {\n\t\t aux06 = j - 1 ;\n\t\t t = number[aux06] ;\n\t\t number[aux06] = number[j] ;\n\t\t number[j] = t;\n\t\t}\n\t\telse nt = 0 ;\n\t\tj = j + 1 ;\n\t }\n\t i = i - 1 ;\n\t}\n\treturn 0 ;\n }", "public int Sort(){\n\tint nt ;\n\tint i ;\n\tint aux02 ;\n\tint aux04 ;\n\tint aux05 ;\n\tint aux06 ;\n\tint aux07 ;\n\tint j ;\n\tint t ;\n\ti = size - 1 ;\n\taux02 = 0 - 1 ;\n\twhile (aux02 < i) {\n\t j = 1 ;\n\t //aux03 = i+1 ;\n\t while (j < (i+1)){\n\t\taux07 = j - 1 ;\n\t\taux04 = number[aux07] ;\n\t\taux05 = number[j] ;\n\t\tif (aux05 < aux04) {\n\t\t aux06 = j - 1 ;\n\t\t t = number[aux06] ;\n\t\t number[aux06] = number[j] ;\n\t\t number[j] = t;\n\t\t}\n\t\telse nt = 0 ;\n\t\tj = j + 1 ;\n\t }\n\t i = i - 1 ;\n\t}\n\treturn 0 ;\n }", "public int Sort(){\n\tint nt ;\n\tint i ;\n\tint aux02 ;\n\tint aux04 ;\n\tint aux05 ;\n\tint aux06 ;\n\tint aux07 ;\n\tint j ;\n\tint t ;\n\ti = size - 1 ;\n\taux02 = 0 - 1 ;\n\twhile (aux02 < i) {\n\t j = 1 ;\n\t //aux03 = i+1 ;\n\t while (j < (i+1)){\n\t\taux07 = j - 1 ;\n\t\taux04 = number[aux07] ;\n\t\taux05 = number[j] ;\n\t\tif (aux05 < aux04) {\n\t\t aux06 = j - 1 ;\n\t\t t = number[aux06] ;\n\t\t number[aux06] = number[j] ;\n\t\t number[j] = t;\n\t\t}\n\t\telse nt = 0 ;\n\t\tj = j + 1 ;\n\t }\n\t i = i - 1 ;\n\t}\n\treturn 0 ;\n }", "public int Sort(){\n\tint nt ;\n\tint i ;\n\tint aux02 ;\n\tint aux04 ;\n\tint aux05 ;\n\tint aux06 ;\n\tint aux07 ;\n\tint j ;\n\tint t ;\n\ti = size - 1 ;\n\taux02 = 0 - 1 ;\n\twhile (aux02 < i) {\n\t j = 1 ;\n\t //aux03 = i+1 ;\n\t while (j < (i+1)){\n\t\taux07 = j - 1 ;\n\t\taux04 = number[aux07] ;\n\t\taux05 = number[j] ;\n\t\tif (aux05 < aux04) {\n\t\t aux06 = j - 1 ;\n\t\t t = number[aux06] ;\n\t\t number[aux06] = number[j] ;\n\t\t number[j] = t;\n\t\t}\n\t\telse nt = 0 ;\n\t\tj = j + 1 ;\n\t }\n\t i = i - 1 ;\n\t}\n\treturn 0 ;\n }", "public int Sort(){\n\tint nt ;\n\tint i ;\n\tint aux02 ;\n\tint aux04 ;\n\tint aux05 ;\n\tint aux06 ;\n\tint aux07 ;\n\tint j ;\n\tint t ;\n\ti = size - 1 ;\n\taux02 = 0 - 1 ;\n\twhile (aux02 < i) {\n\t j = 1 ;\n\t //aux03 = i+1 ;\n\t while (j < (i+1)){\n\t\taux07 = j - 1 ;\n\t\taux04 = number[aux07] ;\n\t\taux05 = number[j] ;\n\t\tif (aux05 < aux04) {\n\t\t aux06 = j - 1 ;\n\t\t t = number[aux06] ;\n\t\t number[aux06] = number[j] ;\n\t\t number[j] = t;\n\t\t}\n\t\telse nt = 0 ;\n\t\tj = j + 1 ;\n\t }\n\t i = i - 1 ;\n\t}\n\treturn 0 ;\n }", "public int Sort(){\n\tint nt ;\n\tint i ;\n\tint aux02 ;\n\tint aux04 ;\n\tint aux05 ;\n\tint aux06 ;\n\tint aux07 ;\n\tint j ;\n\tint t ;\n\ti = size - 1 ;\n\taux02 = 0 - 1 ;\n\twhile (aux02 < i) {\n\t j = 1 ;\n\t //aux03 = i+1 ;\n\t while (j < (i+1)){\n\t\taux07 = j - 1 ;\n\t\taux04 = number[aux07] ;\n\t\taux05 = number[j] ;\n\t\tif (aux05 < aux04) {\n\t\t aux06 = j - 1 ;\n\t\t t = number[aux06] ;\n\t\t number[aux06] = number[j] ;\n\t\t number[j] = t;\n\t\t}\n\t\telse nt = 0 ;\n\t\tj = j + 1 ;\n\t }\n\t i = i - 1 ;\n\t}\n\treturn 0 ;\n }", "public int Sort(){\n\tint nt ;\n\tint i ;\n\tint aux02 ;\n\tint aux04 ;\n\tint aux05 ;\n\tint aux06 ;\n\tint aux07 ;\n\tint j ;\n\tint t ;\n\ti = size - 1 ;\n\taux02 = 0 - 1 ;\n\twhile (aux02 < i) {\n\t j = 1 ;\n\t //aux03 = i+1 ;\n\t while (j < (i+1)){\n\t\taux07 = j - 1 ;\n\t\taux04 = number[aux07] ;\n\t\taux05 = number[j] ;\n\t\tif (aux05 < aux04) {\n\t\t aux06 = j - 1 ;\n\t\t t = number[aux06] ;\n\t\t number[aux06] = number[j] ;\n\t\t number[j] = t;\n\t\t}\n\t\telse nt = 0 ;\n\t\tj = j + 1 ;\n\t }\n\t i = i - 1 ;\n\t}\n\treturn 0 ;\n }", "public int Sort(){\n\tint nt ;\n\tint i ;\n\tint aux02 ;\n\tint aux04 ;\n\tint aux05 ;\n\tint aux06 ;\n\tint aux07 ;\n\tint j ;\n\tint t ;\n\ti = size - 1 ;\n\taux02 = 0 - 1 ;\n\twhile (aux02 < i) {\n\t j = 1 ;\n\t //aux03 = i+1 ;\n\t while (j < (i+1)){\n\t\taux07 = j - 1 ;\n\t\taux04 = number[aux07] ;\n\t\taux05 = number[j] ;\n\t\tif (aux05 < aux04) {\n\t\t aux06 = j - 1 ;\n\t\t t = number[aux06] ;\n\t\t number[aux06] = number[j] ;\n\t\t number[j] = t;\n\t\t}\n\t\telse nt = 0 ;\n\t\tj = j + 1 ;\n\t }\n\t i = i - 1 ;\n\t}\n\treturn 0 ;\n }", "public int Sort(){\n\tint nt ;\n\tint i ;\n\tint aux02 ;\n\tint aux04 ;\n\tint aux05 ;\n\tint aux06 ;\n\tint aux07 ;\n\tint j ;\n\tint t ;\n\ti = size - 1 ;\n\taux02 = 0 - 1 ;\n\twhile (aux02 < i) {\n\t j = 1 ;\n\t //aux03 = i+1 ;\n\t while (j < (i+1)){\n\t\taux07 = j - 1 ;\n\t\taux04 = number[aux07] ;\n\t\taux05 = number[j] ;\n\t\tif (aux05 < aux04) {\n\t\t aux06 = j - 1 ;\n\t\t t = number[aux06] ;\n\t\t number[aux06] = number[j] ;\n\t\t number[j] = t;\n\t\t}\n\t\telse nt = 0 ;\n\t\tj = j + 1 ;\n\t }\n\t i = i - 1 ;\n\t}\n\treturn 0 ;\n }", "public int Sort(){\n\tint nt ;\n\tint i ;\n\tint aux02 ;\n\tint aux04 ;\n\tint aux05 ;\n\tint aux06 ;\n\tint aux07 ;\n\tint j ;\n\tint t ;\n\ti = size - 1 ;\n\taux02 = 0 - 1 ;\n\twhile (aux02 < i) {\n\t j = 1 ;\n\t //aux03 = i+1 ;\n\t while (j < (i+1)){\n\t\taux07 = j - 1 ;\n\t\taux04 = number[aux07] ;\n\t\taux05 = number[j] ;\n\t\tif (aux05 < aux04) {\n\t\t aux06 = j - 1 ;\n\t\t t = number[aux06] ;\n\t\t number[aux06] = number[j] ;\n\t\t number[j] = t;\n\t\t}\n\t\telse nt = 0 ;\n\t\tj = j + 1 ;\n\t }\n\t i = i - 1 ;\n\t}\n\treturn 0 ;\n }", "public int Sort(){\n\tint nt ;\n\tint i ;\n\tint aux02 ;\n\tint aux04 ;\n\tint aux05 ;\n\tint aux06 ;\n\tint aux07 ;\n\tint j ;\n\tint t ;\n\ti = size - 1 ;\n\taux02 = 0 - 1 ;\n\twhile (aux02 < i) {\n\t j = 1 ;\n\t //aux03 = i+1 ;\n\t while (j < (i+1)){\n\t\taux07 = j - 1 ;\n\t\taux04 = number[aux07] ;\n\t\taux05 = number[j] ;\n\t\tif (aux05 < aux04) {\n\t\t aux06 = j - 1 ;\n\t\t t = number[aux06] ;\n\t\t number[aux06] = number[j] ;\n\t\t number[j] = t;\n\t\t}\n\t\telse nt = 0 ;\n\t\tj = j + 1 ;\n\t }\n\t i = i - 1 ;\n\t}\n\treturn 0 ;\n }", "public int Sort(){\n\tint nt ;\n\tint i ;\n\tint aux02 ;\n\tint aux04 ;\n\tint aux05 ;\n\tint aux06 ;\n\tint aux07 ;\n\tint j ;\n\tint t ;\n\ti = size - 1 ;\n\taux02 = 0 - 1 ;\n\twhile (aux02 < i) {\n\t j = 1 ;\n\t //aux03 = i+1 ;\n\t while (j < (i+1)){\n\t\taux07 = j - 1 ;\n\t\taux04 = number[aux07] ;\n\t\taux05 = number[j] ;\n\t\tif (aux05 < aux04) {\n\t\t aux06 = j - 1 ;\n\t\t t = number[aux06] ;\n\t\t number[aux06] = number[j] ;\n\t\t number[j] = t;\n\t\t}\n\t\telse nt = 0 ;\n\t\tj = j + 1 ;\n\t }\n\t i = i - 1 ;\n\t}\n\treturn 0 ;\n }", "public int Sort(){\n\tint nt ;\n\tint i ;\n\tint aux02 ;\n\tint aux04 ;\n\tint aux05 ;\n\tint aux06 ;\n\tint aux07 ;\n\tint j ;\n\tint t ;\n\ti = size - 1 ;\n\taux02 = 0 - 1 ;\n\twhile (aux02 < i) {\n\t j = 1 ;\n\t //aux03 = i+1 ;\n\t while (j < (i+1)){\n\t\taux07 = j - 1 ;\n\t\taux04 = number[aux07] ;\n\t\taux05 = number[j] ;\n\t\tif (aux05 < aux04) {\n\t\t aux06 = j - 1 ;\n\t\t t = number[aux06] ;\n\t\t number[aux06] = number[j] ;\n\t\t number[j] = t;\n\t\t}\n\t\telse nt = 0 ;\n\t\tj = j + 1 ;\n\t }\n\t i = i - 1 ;\n\t}\n\treturn 0 ;\n }", "public int Sort(){\n\tint nt ;\n\tint i ;\n\tint aux02 ;\n\tint aux04 ;\n\tint aux05 ;\n\tint aux06 ;\n\tint aux07 ;\n\tint j ;\n\tint t ;\n\ti = size - 1 ;\n\taux02 = 0 - 1 ;\n\twhile (aux02 < i) {\n\t j = 1 ;\n\t //aux03 = i+1 ;\n\t while (j < (i+1)){\n\t\taux07 = j - 1 ;\n\t\taux04 = number[aux07] ;\n\t\taux05 = number[j] ;\n\t\tif (aux05 < aux04) {\n\t\t aux06 = j - 1 ;\n\t\t t = number[aux06] ;\n\t\t number[aux06] = number[j] ;\n\t\t number[j] = t;\n\t\t}\n\t\telse nt = 0 ;\n\t\tj = j + 1 ;\n\t }\n\t i = i - 1 ;\n\t}\n\treturn 0 ;\n }", "public int Sort(){\n\tint nt ;\n\tint i ;\n\tint aux02 ;\n\tint aux04 ;\n\tint aux05 ;\n\tint aux06 ;\n\tint aux07 ;\n\tint j ;\n\tint t ;\n\ti = size - 1 ;\n\taux02 = 0 - 1 ;\n\twhile (aux02 < i) {\n\t j = 1 ;\n\t //aux03 = i+1 ;\n\t while (j < (i+1)){\n\t\taux07 = j - 1 ;\n\t\taux04 = number[aux07] ;\n\t\taux05 = number[j] ;\n\t\tif (aux05 < aux04) {\n\t\t aux06 = j - 1 ;\n\t\t t = number[aux06] ;\n\t\t number[aux06] = number[j] ;\n\t\t number[j] = t;\n\t\t}\n\t\telse nt = 0 ;\n\t\tj = j + 1 ;\n\t }\n\t i = i - 1 ;\n\t}\n\treturn 0 ;\n }", "public int Sort(){\n\tint nt ;\n\tint i ;\n\tint aux02 ;\n\tint aux04 ;\n\tint aux05 ;\n\tint aux06 ;\n\tint aux07 ;\n\tint j ;\n\tint t ;\n\ti = size - 1 ;\n\taux02 = 0 - 1 ;\n\twhile (aux02 < i) {\n\t j = 1 ;\n\t //aux03 = i+1 ;\n\t while (j < (i+1)){\n\t\taux07 = j - 1 ;\n\t\taux04 = number[aux07] ;\n\t\taux05 = number[j] ;\n\t\tif (aux05 < aux04) {\n\t\t aux06 = j - 1 ;\n\t\t t = number[aux06] ;\n\t\t number[aux06] = number[j] ;\n\t\t number[j] = t;\n\t\t}\n\t\telse nt = 0 ;\n\t\tj = j + 1 ;\n\t }\n\t i = i - 1 ;\n\t}\n\treturn 0 ;\n }", "public int Sort(){\n\tint nt ;\n\tint i ;\n\tint aux02 ;\n\tint aux04 ;\n\tint aux05 ;\n\tint aux06 ;\n\tint aux07 ;\n\tint j ;\n\tint t ;\n\ti = size - 1 ;\n\taux02 = 0 - 1 ;\n\twhile (aux02 < i) {\n\t j = 1 ;\n\t //aux03 = i+1 ;\n\t while (j < (i+1)){\n\t\taux07 = j - 1 ;\n\t\taux04 = number[aux07] ;\n\t\taux05 = number[j] ;\n\t\tif (aux05 < aux04) {\n\t\t aux06 = j - 1 ;\n\t\t t = number[aux06] ;\n\t\t number[aux06] = number[j] ;\n\t\t number[j] = t;\n\t\t}\n\t\telse nt = 0 ;\n\t\tj = j + 1 ;\n\t }\n\t i = i - 1 ;\n\t}\n\treturn 0 ;\n }", "public int Sort(){\n\tint nt ;\n\tint i ;\n\tint aux02 ;\n\tint aux04 ;\n\tint aux05 ;\n\tint aux06 ;\n\tint aux07 ;\n\tint j ;\n\tint t ;\n\ti = size - 1 ;\n\taux02 = 0 - 1 ;\n\twhile (aux02 < i) {\n\t j = 1 ;\n\t //aux03 = i+1 ;\n\t while (j < (i+1)){\n\t\taux07 = j - 1 ;\n\t\taux04 = number[aux07] ;\n\t\taux05 = number[j] ;\n\t\tif (aux05 < aux04) {\n\t\t aux06 = j - 1 ;\n\t\t t = number[aux06] ;\n\t\t number[aux06] = number[j] ;\n\t\t number[j] = t;\n\t\t}\n\t\telse nt = 0 ;\n\t\tj = j + 1 ;\n\t }\n\t i = i - 1 ;\n\t}\n\treturn 0 ;\n }", "public int Sort(){\n\tint nt ;\n\tint i ;\n\tint aux02 ;\n\tint aux04 ;\n\tint aux05 ;\n\tint aux06 ;\n\tint aux07 ;\n\tint j ;\n\tint t ;\n\ti = size - 1 ;\n\taux02 = 0 - 1 ;\n\twhile (aux02 < i) {\n\t j = 1 ;\n\t //aux03 = i+1 ;\n\t while (j < (i+1)){\n\t\taux07 = j - 1 ;\n\t\taux04 = number[aux07] ;\n\t\taux05 = number[j] ;\n\t\tif (aux05 < aux04) {\n\t\t aux06 = j - 1 ;\n\t\t t = number[aux06] ;\n\t\t number[aux06] = number[j] ;\n\t\t number[j] = t;\n\t\t}\n\t\telse nt = 0 ;\n\t\tj = j + 1 ;\n\t }\n\t i = i - 1 ;\n\t}\n\treturn 0 ;\n }", "public int Sort(){\n\tint nt ;\n\tint i ;\n\tint aux02 ;\n\tint aux04 ;\n\tint aux05 ;\n\tint aux06 ;\n\tint aux07 ;\n\tint j ;\n\tint t ;\n\ti = size - 1 ;\n\taux02 = 0 - 1 ;\n\twhile (aux02 < i) {\n\t j = 1 ;\n\t //aux03 = i+1 ;\n\t while (j < (i+1)){\n\t\taux07 = j - 1 ;\n\t\taux04 = number[aux07] ;\n\t\taux05 = number[j] ;\n\t\tif (aux05 < aux04) {\n\t\t aux06 = j - 1 ;\n\t\t t = number[aux06] ;\n\t\t number[aux06] = number[j] ;\n\t\t number[j] = t;\n\t\t}\n\t\telse nt = 0 ;\n\t\tj = j + 1 ;\n\t }\n\t i = i - 1 ;\n\t}\n\treturn 0 ;\n }", "public int Sort(){\n\tint nt ;\n\tint i ;\n\tint aux02 ;\n\tint aux04 ;\n\tint aux05 ;\n\tint aux06 ;\n\tint aux07 ;\n\tint j ;\n\tint t ;\n\ti = size - 1 ;\n\taux02 = 0 - 1 ;\n\twhile (aux02 < i) {\n\t j = 1 ;\n\t //aux03 = i+1 ;\n\t while (j < (i+1)){\n\t\taux07 = j - 1 ;\n\t\taux04 = number[aux07] ;\n\t\taux05 = number[j] ;\n\t\tif (aux05 < aux04) {\n\t\t aux06 = j - 1 ;\n\t\t t = number[aux06] ;\n\t\t number[aux06] = number[j] ;\n\t\t number[j] = t;\n\t\t}\n\t\telse nt = 0 ;\n\t\tj = j + 1 ;\n\t }\n\t i = i - 1 ;\n\t}\n\treturn 0 ;\n }", "public int Sort(){\n\tint nt ;\n\tint i ;\n\tint aux02 ;\n\tint aux04 ;\n\tint aux05 ;\n\tint aux06 ;\n\tint aux07 ;\n\tint j ;\n\tint t ;\n\ti = size - 1 ;\n\taux02 = 0 - 1 ;\n\twhile (aux02 < i) {\n\t j = 1 ;\n\t //aux03 = i+1 ;\n\t while (j < (i+1)){\n\t\taux07 = j - 1 ;\n\t\taux04 = number[aux07] ;\n\t\taux05 = number[j] ;\n\t\tif (aux05 < aux04) {\n\t\t aux06 = j - 1 ;\n\t\t t = number[aux06] ;\n\t\t number[aux06] = number[j] ;\n\t\t number[j] = t;\n\t\t}\n\t\telse nt = 0 ;\n\t\tj = j + 1 ;\n\t }\n\t i = i - 1 ;\n\t}\n\treturn 0 ;\n }", "public int Sort(){\n\tint nt ;\n\tint i ;\n\tint aux02 ;\n\tint aux04 ;\n\tint aux05 ;\n\tint aux06 ;\n\tint aux07 ;\n\tint j ;\n\tint t ;\n\ti = size - 1 ;\n\taux02 = 0 - 1 ;\n\twhile (aux02 < i) {\n\t j = 1 ;\n\t //aux03 = i+1 ;\n\t while (j < (i+1)){\n\t\taux07 = j - 1 ;\n\t\taux04 = number[aux07] ;\n\t\taux05 = number[j] ;\n\t\tif (aux05 < aux04) {\n\t\t aux06 = j - 1 ;\n\t\t t = number[aux06] ;\n\t\t number[aux06] = number[j] ;\n\t\t number[j] = t;\n\t\t}\n\t\telse nt = 0 ;\n\t\tj = j + 1 ;\n\t }\n\t i = i - 1 ;\n\t}\n\treturn 0 ;\n }", "public int Sort(){\n\tint nt ;\n\tint i ;\n\tint aux02 ;\n\tint aux04 ;\n\tint aux05 ;\n\tint aux06 ;\n\tint aux07 ;\n\tint j ;\n\tint t ;\n\ti = size - 1 ;\n\taux02 = 0 - 1 ;\n\twhile (aux02 < i) {\n\t j = 1 ;\n\t //aux03 = i+1 ;\n\t while (j < (i+1)){\n\t\taux07 = j - 1 ;\n\t\taux04 = number[aux07] ;\n\t\taux05 = number[j] ;\n\t\tif (aux05 < aux04) {\n\t\t aux06 = j - 1 ;\n\t\t t = number[aux06] ;\n\t\t number[aux06] = number[j] ;\n\t\t number[j] = t;\n\t\t}\n\t\telse nt = 0 ;\n\t\tj = j + 1 ;\n\t }\n\t i = i - 1 ;\n\t}\n\treturn 0 ;\n }", "public int Sort(){\n\tint nt ;\n\tint i ;\n\tint aux02 ;\n\tint aux04 ;\n\tint aux05 ;\n\tint aux06 ;\n\tint aux07 ;\n\tint j ;\n\tint t ;\n\ti = size - 1 ;\n\taux02 = 0 - 1 ;\n\twhile (aux02 < i) {\n\t j = 1 ;\n\t //aux03 = i+1 ;\n\t while (j < (i+1)){\n\t\taux07 = j - 1 ;\n\t\taux04 = number[aux07] ;\n\t\taux05 = number[j] ;\n\t\tif (aux05 < aux04) {\n\t\t aux06 = j - 1 ;\n\t\t t = number[aux06] ;\n\t\t number[aux06] = number[j] ;\n\t\t number[j] = t;\n\t\t}\n\t\telse nt = 0 ;\n\t\tj = j + 1 ;\n\t }\n\t i = i - 1 ;\n\t}\n\treturn 0 ;\n }", "public int Sort(){\n\tint nt ;\n\tint i ;\n\tint aux02 ;\n\tint aux04 ;\n\tint aux05 ;\n\tint aux06 ;\n\tint aux07 ;\n\tint j ;\n\tint t ;\n\ti = size - 1 ;\n\taux02 = 0 - 1 ;\n\twhile (aux02 < i) {\n\t j = 1 ;\n\t //aux03 = i+1 ;\n\t while (j < (i+1)){\n\t\taux07 = j - 1 ;\n\t\taux04 = number[aux07] ;\n\t\taux05 = number[j] ;\n\t\tif (aux05 < aux04) {\n\t\t aux06 = j - 1 ;\n\t\t t = number[aux06] ;\n\t\t number[aux06] = number[j] ;\n\t\t number[j] = t;\n\t\t}\n\t\telse nt = 0 ;\n\t\tj = j + 1 ;\n\t }\n\t i = i - 1 ;\n\t}\n\treturn 0 ;\n }", "public int Sort(){\n\tint nt ;\n\tint i ;\n\tint aux02 ;\n\tint aux04 ;\n\tint aux05 ;\n\tint aux06 ;\n\tint aux07 ;\n\tint j ;\n\tint t ;\n\ti = size - 1 ;\n\taux02 = 0 - 1 ;\n\twhile (aux02 < i) {\n\t j = 1 ;\n\t //aux03 = i+1 ;\n\t while (j < (i+1)){\n\t\taux07 = j - 1 ;\n\t\taux04 = number[aux07] ;\n\t\taux05 = number[j] ;\n\t\tif (aux05 < aux04) {\n\t\t aux06 = j - 1 ;\n\t\t t = number[aux06] ;\n\t\t number[aux06] = number[j] ;\n\t\t number[j] = t;\n\t\t}\n\t\telse nt = 0 ;\n\t\tj = j + 1 ;\n\t }\n\t i = i - 1 ;\n\t}\n\treturn 0 ;\n }", "public int Sort(){\n\tint nt ;\n\tint i ;\n\tint aux02 ;\n\tint aux04 ;\n\tint aux05 ;\n\tint aux06 ;\n\tint aux07 ;\n\tint j ;\n\tint t ;\n\ti = size - 1 ;\n\taux02 = 0 - 1 ;\n\twhile (aux02 < i) {\n\t j = 1 ;\n\t //aux03 = i+1 ;\n\t while (j < (i+1)){\n\t\taux07 = j - 1 ;\n\t\taux04 = number[aux07] ;\n\t\taux05 = number[j] ;\n\t\tif (aux05 < aux04) {\n\t\t aux06 = j - 1 ;\n\t\t t = number[aux06] ;\n\t\t number[aux06] = number[j] ;\n\t\t number[j] = t;\n\t\t}\n\t\telse nt = 0 ;\n\t\tj = j + 1 ;\n\t }\n\t i = i - 1 ;\n\t}\n\treturn 0 ;\n }", "public int Sort(){\n\tint nt ;\n\tint i ;\n\tint aux02 ;\n\tint aux04 ;\n\tint aux05 ;\n\tint aux06 ;\n\tint aux07 ;\n\tint j ;\n\tint t ;\n\ti = size - 1 ;\n\taux02 = 0 - 1 ;\n\twhile (aux02 < i) {\n\t j = 1 ;\n\t //aux03 = i+1 ;\n\t while (j < (i+1)){\n\t\taux07 = j - 1 ;\n\t\taux04 = number[aux07] ;\n\t\taux05 = number[j] ;\n\t\tif (aux05 < aux04) {\n\t\t aux06 = j - 1 ;\n\t\t t = number[aux06] ;\n\t\t number[aux06] = number[j] ;\n\t\t number[j] = t;\n\t\t}\n\t\telse nt = 0 ;\n\t\tj = j + 1 ;\n\t }\n\t i = i - 1 ;\n\t}\n\treturn 0 ;\n }", "public int Sort(){\n\tint nt ;\n\tint i ;\n\tint aux02 ;\n\tint aux04 ;\n\tint aux05 ;\n\tint aux06 ;\n\tint aux07 ;\n\tint j ;\n\tint t ;\n\ti = size - 1 ;\n\taux02 = 0 - 1 ;\n\twhile (aux02 < i) {\n\t j = 1 ;\n\t //aux03 = i+1 ;\n\t while (j < (i+1)){\n\t\taux07 = j - 1 ;\n\t\taux04 = number[aux07] ;\n\t\taux05 = number[j] ;\n\t\tif (aux05 < aux04) {\n\t\t aux06 = j - 1 ;\n\t\t t = number[aux06] ;\n\t\t number[aux06] = number[j] ;\n\t\t number[j] = t;\n\t\t}\n\t\telse nt = 0 ;\n\t\tj = j + 1 ;\n\t }\n\t i = i - 1 ;\n\t}\n\treturn 0 ;\n }", "public int Sort(){\n\tint nt ;\n\tint i ;\n\tint aux02 ;\n\tint aux04 ;\n\tint aux05 ;\n\tint aux06 ;\n\tint aux07 ;\n\tint j ;\n\tint t ;\n\ti = size - 1 ;\n\taux02 = 0 - 1 ;\n\twhile (aux02 < i) {\n\t j = 1 ;\n\t //aux03 = i+1 ;\n\t while (j < (i+1)){\n\t\taux07 = j - 1 ;\n\t\taux04 = number[aux07] ;\n\t\taux05 = number[j] ;\n\t\tif (aux05 < aux04) {\n\t\t aux06 = j - 1 ;\n\t\t t = number[aux06] ;\n\t\t number[aux06] = number[j] ;\n\t\t number[j] = t;\n\t\t}\n\t\telse nt = 0 ;\n\t\tj = j + 1 ;\n\t }\n\t i = i - 1 ;\n\t}\n\treturn 0 ;\n }", "public int Sort(){\n\tint nt ;\n\tint i ;\n\tint aux02 ;\n\tint aux04 ;\n\tint aux05 ;\n\tint aux06 ;\n\tint aux07 ;\n\tint j ;\n\tint t ;\n\ti = size - 1 ;\n\taux02 = 0 - 1 ;\n\twhile (aux02 < i) {\n\t j = 1 ;\n\t //aux03 = i+1 ;\n\t while (j < (i+1)){\n\t\taux07 = j - 1 ;\n\t\taux04 = number[aux07] ;\n\t\taux05 = number[j] ;\n\t\tif (aux05 < aux04) {\n\t\t aux06 = j - 1 ;\n\t\t t = number[aux06] ;\n\t\t number[aux06] = number[j] ;\n\t\t number[j] = t;\n\t\t}\n\t\telse nt = 0 ;\n\t\tj = j + 1 ;\n\t }\n\t i = i - 1 ;\n\t}\n\treturn 0 ;\n }", "public int Sort(){\n\tint nt ;\n\tint i ;\n\tint aux02 ;\n\tint aux04 ;\n\tint aux05 ;\n\tint aux06 ;\n\tint aux07 ;\n\tint j ;\n\tint t ;\n\ti = size - 1 ;\n\taux02 = 0 - 1 ;\n\twhile (aux02 < i) {\n\t j = 1 ;\n\t //aux03 = i+1 ;\n\t while (j < (i+1)){\n\t\taux07 = j - 1 ;\n\t\taux04 = number[aux07] ;\n\t\taux05 = number[j] ;\n\t\tif (aux05 < aux04) {\n\t\t aux06 = j - 1 ;\n\t\t t = number[aux06] ;\n\t\t number[aux06] = number[j] ;\n\t\t number[j] = t;\n\t\t}\n\t\telse nt = 0 ;\n\t\tj = j + 1 ;\n\t }\n\t i = i - 1 ;\n\t}\n\treturn 0 ;\n }", "public int Sort(){\n\tint nt ;\n\tint i ;\n\tint aux02 ;\n\tint aux04 ;\n\tint aux05 ;\n\tint aux06 ;\n\tint aux07 ;\n\tint j ;\n\tint t ;\n\ti = size - 1 ;\n\taux02 = 0 - 1 ;\n\twhile (aux02 < i) {\n\t j = 1 ;\n\t //aux03 = i+1 ;\n\t while (j < (i+1)){\n\t\taux07 = j - 1 ;\n\t\taux04 = number[aux07] ;\n\t\taux05 = number[j] ;\n\t\tif (aux05 < aux04) {\n\t\t aux06 = j - 1 ;\n\t\t t = number[aux06] ;\n\t\t number[aux06] = number[j] ;\n\t\t number[j] = t;\n\t\t}\n\t\telse nt = 0 ;\n\t\tj = j + 1 ;\n\t }\n\t i = i - 1 ;\n\t}\n\treturn 0 ;\n }", "public int Sort(){\n\tint nt ;\n\tint i ;\n\tint aux02 ;\n\tint aux04 ;\n\tint aux05 ;\n\tint aux06 ;\n\tint aux07 ;\n\tint j ;\n\tint t ;\n\ti = size - 1 ;\n\taux02 = 0 - 1 ;\n\twhile (aux02 < i) {\n\t j = 1 ;\n\t //aux03 = i+1 ;\n\t while (j < (i+1)){\n\t\taux07 = j - 1 ;\n\t\taux04 = number[aux07] ;\n\t\taux05 = number[j] ;\n\t\tif (aux05 < aux04) {\n\t\t aux06 = j - 1 ;\n\t\t t = number[aux06] ;\n\t\t number[aux06] = number[j] ;\n\t\t number[j] = t;\n\t\t}\n\t\telse nt = 0 ;\n\t\tj = j + 1 ;\n\t }\n\t i = i - 1 ;\n\t}\n\treturn 0 ;\n }", "public int Sort(){\n\tint nt ;\n\tint i ;\n\tint aux02 ;\n\tint aux04 ;\n\tint aux05 ;\n\tint aux06 ;\n\tint aux07 ;\n\tint j ;\n\tint t ;\n\ti = size - 1 ;\n\taux02 = 0 - 1 ;\n\twhile (aux02 < i) {\n\t j = 1 ;\n\t //aux03 = i+1 ;\n\t while (j < (i+1)){\n\t\taux07 = j - 1 ;\n\t\taux04 = number[aux07] ;\n\t\taux05 = number[j] ;\n\t\tif (aux05 < aux04) {\n\t\t aux06 = j - 1 ;\n\t\t t = number[aux06] ;\n\t\t number[aux06] = number[j] ;\n\t\t number[j] = t;\n\t\t}\n\t\telse nt = 0 ;\n\t\tj = j + 1 ;\n\t }\n\t i = i - 1 ;\n\t}\n\treturn 0 ;\n }", "public int Sort(){\n\tint nt ;\n\tint i ;\n\tint aux02 ;\n\tint aux04 ;\n\tint aux05 ;\n\tint aux06 ;\n\tint aux07 ;\n\tint j ;\n\tint t ;\n\ti = size - 1 ;\n\taux02 = 0 - 1 ;\n\twhile (aux02 < i) {\n\t j = 1 ;\n\t //aux03 = i+1 ;\n\t while (j < (i+1)){\n\t\taux07 = j - 1 ;\n\t\taux04 = number[aux07] ;\n\t\taux05 = number[j] ;\n\t\tif (aux05 < aux04) {\n\t\t aux06 = j - 1 ;\n\t\t t = number[aux06] ;\n\t\t number[aux06] = number[j] ;\n\t\t number[j] = t;\n\t\t}\n\t\telse nt = 0 ;\n\t\tj = j + 1 ;\n\t }\n\t i = i - 1 ;\n\t}\n\treturn 0 ;\n }", "public int Sort(){\n\tint nt ;\n\tint i ;\n\tint aux02 ;\n\tint aux04 ;\n\tint aux05 ;\n\tint aux06 ;\n\tint aux07 ;\n\tint j ;\n\tint t ;\n\ti = size - 1 ;\n\taux02 = 0 - 1 ;\n\twhile (aux02 < i) {\n\t j = 1 ;\n\t //aux03 = i+1 ;\n\t while (j < (i+1)){\n\t\taux07 = j - 1 ;\n\t\taux04 = number[aux07] ;\n\t\taux05 = number[j] ;\n\t\tif (aux05 < aux04) {\n\t\t aux06 = j - 1 ;\n\t\t t = number[aux06] ;\n\t\t number[aux06] = number[j] ;\n\t\t number[j] = t;\n\t\t}\n\t\telse nt = 0 ;\n\t\tj = j + 1 ;\n\t }\n\t i = i - 1 ;\n\t}\n\treturn 0 ;\n }", "public int Sort(){\n\tint nt ;\n\tint i ;\n\tint aux02 ;\n\tint aux04 ;\n\tint aux05 ;\n\tint aux06 ;\n\tint aux07 ;\n\tint j ;\n\tint t ;\n\ti = size - 1 ;\n\taux02 = 0 - 1 ;\n\twhile (aux02 < i) {\n\t j = 1 ;\n\t //aux03 = i+1 ;\n\t while (j < (i+1)){\n\t\taux07 = j - 1 ;\n\t\taux04 = number[aux07] ;\n\t\taux05 = number[j] ;\n\t\tif (aux05 < aux04) {\n\t\t aux06 = j - 1 ;\n\t\t t = number[aux06] ;\n\t\t number[aux06] = number[j] ;\n\t\t number[j] = t;\n\t\t}\n\t\telse nt = 0 ;\n\t\tj = j + 1 ;\n\t }\n\t i = i - 1 ;\n\t}\n\treturn 0 ;\n }", "public int Sort(){\n\tint nt ;\n\tint i ;\n\tint aux02 ;\n\tint aux04 ;\n\tint aux05 ;\n\tint aux06 ;\n\tint aux07 ;\n\tint j ;\n\tint t ;\n\ti = size - 1 ;\n\taux02 = 0 - 1 ;\n\twhile (aux02 < i) {\n\t j = 1 ;\n\t //aux03 = i+1 ;\n\t while (j < (i+1)){\n\t\taux07 = j - 1 ;\n\t\taux04 = number[aux07] ;\n\t\taux05 = number[j] ;\n\t\tif (aux05 < aux04) {\n\t\t aux06 = j - 1 ;\n\t\t t = number[aux06] ;\n\t\t number[aux06] = number[j] ;\n\t\t number[j] = t;\n\t\t}\n\t\telse nt = 0 ;\n\t\tj = j + 1 ;\n\t }\n\t i = i - 1 ;\n\t}\n\treturn 0 ;\n }", "public int Sort(){\n\tint nt ;\n\tint i ;\n\tint aux02 ;\n\tint aux04 ;\n\tint aux05 ;\n\tint aux06 ;\n\tint aux07 ;\n\tint j ;\n\tint t ;\n\ti = size - 1 ;\n\taux02 = 0 - 1 ;\n\twhile (aux02 < i) {\n\t j = 1 ;\n\t //aux03 = i+1 ;\n\t while (j < (i+1)){\n\t\taux07 = j - 1 ;\n\t\taux04 = number[aux07] ;\n\t\taux05 = number[j] ;\n\t\tif (aux05 < aux04) {\n\t\t aux06 = j - 1 ;\n\t\t t = number[aux06] ;\n\t\t number[aux06] = number[j] ;\n\t\t number[j] = t;\n\t\t}\n\t\telse nt = 0 ;\n\t\tj = j + 1 ;\n\t }\n\t i = i - 1 ;\n\t}\n\treturn 0 ;\n }", "public int Sort(){\n\tint nt ;\n\tint i ;\n\tint aux02 ;\n\tint aux04 ;\n\tint aux05 ;\n\tint aux06 ;\n\tint aux07 ;\n\tint j ;\n\tint t ;\n\ti = size - 1 ;\n\taux02 = 0 - 1 ;\n\twhile (aux02 < i) {\n\t j = 1 ;\n\t //aux03 = i+1 ;\n\t while (j < (i+1)){\n\t\taux07 = j - 1 ;\n\t\taux04 = number[aux07] ;\n\t\taux05 = number[j] ;\n\t\tif (aux05 < aux04) {\n\t\t aux06 = j - 1 ;\n\t\t t = number[aux06] ;\n\t\t number[aux06] = number[j] ;\n\t\t number[j] = t;\n\t\t}\n\t\telse nt = 0 ;\n\t\tj = j + 1 ;\n\t }\n\t i = i - 1 ;\n\t}\n\treturn 0 ;\n }", "public int Sort(){\n\tint nt ;\n\tint i ;\n\tint aux02 ;\n\tint aux04 ;\n\tint aux05 ;\n\tint aux06 ;\n\tint aux07 ;\n\tint j ;\n\tint t ;\n\ti = size - 1 ;\n\taux02 = 0 - 1 ;\n\twhile (aux02 < i) {\n\t j = 1 ;\n\t //aux03 = i+1 ;\n\t while (j < (i+1)){\n\t\taux07 = j - 1 ;\n\t\taux04 = number[aux07] ;\n\t\taux05 = number[j] ;\n\t\tif (aux05 < aux04) {\n\t\t aux06 = j - 1 ;\n\t\t t = number[aux06] ;\n\t\t number[aux06] = number[j] ;\n\t\t number[j] = t;\n\t\t}\n\t\telse nt = 0 ;\n\t\tj = j + 1 ;\n\t }\n\t i = i - 1 ;\n\t}\n\treturn 0 ;\n }", "public int Sort(){\n\tint nt ;\n\tint i ;\n\tint aux02 ;\n\tint aux04 ;\n\tint aux05 ;\n\tint aux06 ;\n\tint aux07 ;\n\tint j ;\n\tint t ;\n\ti = size - 1 ;\n\taux02 = 0 - 1 ;\n\twhile (aux02 < i) {\n\t j = 1 ;\n\t //aux03 = i+1 ;\n\t while (j < (i+1)){\n\t\taux07 = j - 1 ;\n\t\taux04 = number[aux07] ;\n\t\taux05 = number[j] ;\n\t\tif (aux05 < aux04) {\n\t\t aux06 = j - 1 ;\n\t\t t = number[aux06] ;\n\t\t number[aux06] = number[j] ;\n\t\t number[j] = t;\n\t\t}\n\t\telse nt = 0 ;\n\t\tj = j + 1 ;\n\t }\n\t i = i - 1 ;\n\t}\n\treturn 0 ;\n }", "public int Sort(){\n\tint nt ;\n\tint i ;\n\tint aux02 ;\n\tint aux04 ;\n\tint aux05 ;\n\tint aux06 ;\n\tint aux07 ;\n\tint j ;\n\tint t ;\n\ti = size - 1 ;\n\taux02 = 0 - 1 ;\n\twhile (aux02 < i) {\n\t j = 1 ;\n\t //aux03 = i+1 ;\n\t while (j < (i+1)){\n\t\taux07 = j - 1 ;\n\t\taux04 = number[aux07] ;\n\t\taux05 = number[j] ;\n\t\tif (aux05 < aux04) {\n\t\t aux06 = j - 1 ;\n\t\t t = number[aux06] ;\n\t\t number[aux06] = number[j] ;\n\t\t number[j] = t;\n\t\t}\n\t\telse nt = 0 ;\n\t\tj = j + 1 ;\n\t }\n\t i = i - 1 ;\n\t}\n\treturn 0 ;\n }", "public int Sort(){\n\tint nt ;\n\tint i ;\n\tint aux02 ;\n\tint aux04 ;\n\tint aux05 ;\n\tint aux06 ;\n\tint aux07 ;\n\tint j ;\n\tint t ;\n\ti = size - 1 ;\n\taux02 = 0 - 1 ;\n\twhile (aux02 < i) {\n\t j = 1 ;\n\t //aux03 = i+1 ;\n\t while (j < (i+1)){\n\t\taux07 = j - 1 ;\n\t\taux04 = number[aux07] ;\n\t\taux05 = number[j] ;\n\t\tif (aux05 < aux04) {\n\t\t aux06 = j - 1 ;\n\t\t t = number[aux06] ;\n\t\t number[aux06] = number[j] ;\n\t\t number[j] = t;\n\t\t}\n\t\telse nt = 0 ;\n\t\tj = j + 1 ;\n\t }\n\t i = i - 1 ;\n\t}\n\treturn 0 ;\n }", "public int Sort(){\n\tint nt ;\n\tint i ;\n\tint aux02 ;\n\tint aux04 ;\n\tint aux05 ;\n\tint aux06 ;\n\tint aux07 ;\n\tint j ;\n\tint t ;\n\ti = size - 1 ;\n\taux02 = 0 - 1 ;\n\twhile (aux02 < i) {\n\t j = 1 ;\n\t //aux03 = i+1 ;\n\t while (j < (i+1)){\n\t\taux07 = j - 1 ;\n\t\taux04 = number[aux07] ;\n\t\taux05 = number[j] ;\n\t\tif (aux05 < aux04) {\n\t\t aux06 = j - 1 ;\n\t\t t = number[aux06] ;\n\t\t number[aux06] = number[j] ;\n\t\t number[j] = t;\n\t\t}\n\t\telse nt = 0 ;\n\t\tj = j + 1 ;\n\t }\n\t i = i - 1 ;\n\t}\n\treturn 0 ;\n }", "public int Sort(){\n\tint nt ;\n\tint i ;\n\tint aux02 ;\n\tint aux04 ;\n\tint aux05 ;\n\tint aux06 ;\n\tint aux07 ;\n\tint j ;\n\tint t ;\n\ti = size - 1 ;\n\taux02 = 0 - 1 ;\n\twhile (aux02 < i) {\n\t j = 1 ;\n\t //aux03 = i+1 ;\n\t while (j < (i+1)){\n\t\taux07 = j - 1 ;\n\t\taux04 = number[aux07] ;\n\t\taux05 = number[j] ;\n\t\tif (aux05 < aux04) {\n\t\t aux06 = j - 1 ;\n\t\t t = number[aux06] ;\n\t\t number[aux06] = number[j] ;\n\t\t number[j] = t;\n\t\t}\n\t\telse nt = 0 ;\n\t\tj = j + 1 ;\n\t }\n\t i = i - 1 ;\n\t}\n\treturn 0 ;\n }", "public int Sort(){\n\tint nt ;\n\tint i ;\n\tint aux02 ;\n\tint aux04 ;\n\tint aux05 ;\n\tint aux06 ;\n\tint aux07 ;\n\tint j ;\n\tint t ;\n\ti = size - 1 ;\n\taux02 = 0 - 1 ;\n\twhile (aux02 < i) {\n\t j = 1 ;\n\t //aux03 = i+1 ;\n\t while (j < (i+1)){\n\t\taux07 = j - 1 ;\n\t\taux04 = number[aux07] ;\n\t\taux05 = number[j] ;\n\t\tif (aux05 < aux04) {\n\t\t aux06 = j - 1 ;\n\t\t t = number[aux06] ;\n\t\t number[aux06] = number[j] ;\n\t\t number[j] = t;\n\t\t}\n\t\telse nt = 0 ;\n\t\tj = j + 1 ;\n\t }\n\t i = i - 1 ;\n\t}\n\treturn 0 ;\n }", "public int Sort(){\n\tint nt ;\n\tint i ;\n\tint aux02 ;\n\tint aux04 ;\n\tint aux05 ;\n\tint aux06 ;\n\tint aux07 ;\n\tint j ;\n\tint t ;\n\ti = size - 1 ;\n\taux02 = 0 - 1 ;\n\twhile (aux02 < i) {\n\t j = 1 ;\n\t //aux03 = i+1 ;\n\t while (j < (i+1)){\n\t\taux07 = j - 1 ;\n\t\taux04 = number[aux07] ;\n\t\taux05 = number[j] ;\n\t\tif (aux05 < aux04) {\n\t\t aux06 = j - 1 ;\n\t\t t = number[aux06] ;\n\t\t number[aux06] = number[j] ;\n\t\t number[j] = t;\n\t\t}\n\t\telse nt = 0 ;\n\t\tj = j + 1 ;\n\t }\n\t i = i - 1 ;\n\t}\n\treturn 0 ;\n }", "public int Sort(){\n\tint nt ;\n\tint i ;\n\tint aux02 ;\n\tint aux04 ;\n\tint aux05 ;\n\tint aux06 ;\n\tint aux07 ;\n\tint j ;\n\tint t ;\n\ti = size - 1 ;\n\taux02 = 0 - 1 ;\n\twhile (aux02 < i) {\n\t j = 1 ;\n\t //aux03 = i+1 ;\n\t while (j < (i+1)){\n\t\taux07 = j - 1 ;\n\t\taux04 = number[aux07] ;\n\t\taux05 = number[j] ;\n\t\tif (aux05 < aux04) {\n\t\t aux06 = j - 1 ;\n\t\t t = number[aux06] ;\n\t\t number[aux06] = number[j] ;\n\t\t number[j] = t;\n\t\t}\n\t\telse nt = 0 ;\n\t\tj = j + 1 ;\n\t }\n\t i = i - 1 ;\n\t}\n\treturn 0 ;\n }", "public int Sort(){\n\tint nt ;\n\tint i ;\n\tint aux02 ;\n\tint aux04 ;\n\tint aux05 ;\n\tint aux06 ;\n\tint aux07 ;\n\tint j ;\n\tint t ;\n\ti = size - 1 ;\n\taux02 = 0 - 1 ;\n\twhile (aux02 < i) {\n\t j = 1 ;\n\t //aux03 = i+1 ;\n\t while (j < (i+1)){\n\t\taux07 = j - 1 ;\n\t\taux04 = number[aux07] ;\n\t\taux05 = number[j] ;\n\t\tif (aux05 < aux04) {\n\t\t aux06 = j - 1 ;\n\t\t t = number[aux06] ;\n\t\t number[aux06] = number[j] ;\n\t\t number[j] = t;\n\t\t}\n\t\telse nt = 0 ;\n\t\tj = j + 1 ;\n\t }\n\t i = i - 1 ;\n\t}\n\treturn 0 ;\n }", "public int Sort(){\n\tint nt ;\n\tint i ;\n\tint aux02 ;\n\tint aux04 ;\n\tint aux05 ;\n\tint aux06 ;\n\tint aux07 ;\n\tint j ;\n\tint t ;\n\ti = size - 1 ;\n\taux02 = 0 - 1 ;\n\twhile (aux02 < i) {\n\t j = 1 ;\n\t //aux03 = i+1 ;\n\t while (j < (i+1)){\n\t\taux07 = j - 1 ;\n\t\taux04 = number[aux07] ;\n\t\taux05 = number[j] ;\n\t\tif (aux05 < aux04) {\n\t\t aux06 = j - 1 ;\n\t\t t = number[aux06] ;\n\t\t number[aux06] = number[j] ;\n\t\t number[j] = t;\n\t\t}\n\t\telse nt = 0 ;\n\t\tj = j + 1 ;\n\t }\n\t i = i - 1 ;\n\t}\n\treturn 0 ;\n }", "public int Sort(){\n\tint nt ;\n\tint i ;\n\tint aux02 ;\n\tint aux04 ;\n\tint aux05 ;\n\tint aux06 ;\n\tint aux07 ;\n\tint j ;\n\tint t ;\n\ti = size - 1 ;\n\taux02 = 0 - 1 ;\n\twhile (aux02 < i) {\n\t j = 1 ;\n\t //aux03 = i+1 ;\n\t while (j < (i+1)){\n\t\taux07 = j - 1 ;\n\t\taux04 = number[aux07] ;\n\t\taux05 = number[j] ;\n\t\tif (aux05 < aux04) {\n\t\t aux06 = j - 1 ;\n\t\t t = number[aux06] ;\n\t\t number[aux06] = number[j] ;\n\t\t number[j] = t;\n\t\t}\n\t\telse nt = 0 ;\n\t\tj = j + 1 ;\n\t }\n\t i = i - 1 ;\n\t}\n\treturn 0 ;\n }", "public int Sort(){\n\tint nt ;\n\tint i ;\n\tint aux02 ;\n\tint aux04 ;\n\tint aux05 ;\n\tint aux06 ;\n\tint aux07 ;\n\tint j ;\n\tint t ;\n\ti = size - 1 ;\n\taux02 = 0 - 1 ;\n\twhile (aux02 < i) {\n\t j = 1 ;\n\t //aux03 = i+1 ;\n\t while (j < (i+1)){\n\t\taux07 = j - 1 ;\n\t\taux04 = number[aux07] ;\n\t\taux05 = number[j] ;\n\t\tif (aux05 < aux04) {\n\t\t aux06 = j - 1 ;\n\t\t t = number[aux06] ;\n\t\t number[aux06] = number[j] ;\n\t\t number[j] = t;\n\t\t}\n\t\telse nt = 0 ;\n\t\tj = j + 1 ;\n\t }\n\t i = i - 1 ;\n\t}\n\treturn 0 ;\n }", "public int Sort(){\n\tint nt ;\n\tint i ;\n\tint aux02 ;\n\tint aux04 ;\n\tint aux05 ;\n\tint aux06 ;\n\tint aux07 ;\n\tint j ;\n\tint t ;\n\ti = size - 1 ;\n\taux02 = 0 - 1 ;\n\twhile (aux02 < i) {\n\t j = 1 ;\n\t //aux03 = i+1 ;\n\t while (j < (i+1)){\n\t\taux07 = j - 1 ;\n\t\taux04 = number[aux07] ;\n\t\taux05 = number[j] ;\n\t\tif (aux05 < aux04) {\n\t\t aux06 = j - 1 ;\n\t\t t = number[aux06] ;\n\t\t number[aux06] = number[j] ;\n\t\t number[j] = t;\n\t\t}\n\t\telse nt = 0 ;\n\t\tj = j + 1 ;\n\t }\n\t i = i - 1 ;\n\t}\n\treturn 0 ;\n }", "public int Sort(){\n\tint nt ;\n\tint i ;\n\tint aux02 ;\n\tint aux04 ;\n\tint aux05 ;\n\tint aux06 ;\n\tint aux07 ;\n\tint j ;\n\tint t ;\n\ti = size - 1 ;\n\taux02 = 0 - 1 ;\n\twhile (aux02 < i) {\n\t j = 1 ;\n\t //aux03 = i+1 ;\n\t while (j < (i+1)){\n\t\taux07 = j - 1 ;\n\t\taux04 = number[aux07] ;\n\t\taux05 = number[j] ;\n\t\tif (aux05 < aux04) {\n\t\t aux06 = j - 1 ;\n\t\t t = number[aux06] ;\n\t\t number[aux06] = number[j] ;\n\t\t number[j] = t;\n\t\t}\n\t\telse nt = 0 ;\n\t\tj = j + 1 ;\n\t }\n\t i = i - 1 ;\n\t}\n\treturn 0 ;\n }", "public int Sort(){\n\tint nt ;\n\tint i ;\n\tint aux02 ;\n\tint aux04 ;\n\tint aux05 ;\n\tint aux06 ;\n\tint aux07 ;\n\tint j ;\n\tint t ;\n\ti = size - 1 ;\n\taux02 = 0 - 1 ;\n\twhile (aux02 < i) {\n\t j = 1 ;\n\t //aux03 = i+1 ;\n\t while (j < (i+1)){\n\t\taux07 = j - 1 ;\n\t\taux04 = number[aux07] ;\n\t\taux05 = number[j] ;\n\t\tif (aux05 < aux04) {\n\t\t aux06 = j - 1 ;\n\t\t t = number[aux06] ;\n\t\t number[aux06] = number[j] ;\n\t\t number[j] = t;\n\t\t}\n\t\telse nt = 0 ;\n\t\tj = j + 1 ;\n\t }\n\t i = i - 1 ;\n\t}\n\treturn 0 ;\n }", "public int Sort(){\n\tint nt ;\n\tint i ;\n\tint aux02 ;\n\tint aux04 ;\n\tint aux05 ;\n\tint aux06 ;\n\tint aux07 ;\n\tint j ;\n\tint t ;\n\ti = size - 1 ;\n\taux02 = 0 - 1 ;\n\twhile (aux02 < i) {\n\t j = 1 ;\n\t //aux03 = i+1 ;\n\t while (j < (i+1)){\n\t\taux07 = j - 1 ;\n\t\taux04 = number[aux07] ;\n\t\taux05 = number[j] ;\n\t\tif (aux05 < aux04) {\n\t\t aux06 = j - 1 ;\n\t\t t = number[aux06] ;\n\t\t number[aux06] = number[j] ;\n\t\t number[j] = t;\n\t\t}\n\t\telse nt = 0 ;\n\t\tj = j + 1 ;\n\t }\n\t i = i - 1 ;\n\t}\n\treturn 0 ;\n }", "public int Sort(){\n\tint nt ;\n\tint i ;\n\tint aux02 ;\n\tint aux04 ;\n\tint aux05 ;\n\tint aux06 ;\n\tint aux07 ;\n\tint j ;\n\tint t ;\n\ti = size - 1 ;\n\taux02 = 0 - 1 ;\n\twhile (aux02 < i) {\n\t j = 1 ;\n\t //aux03 = i+1 ;\n\t while (j < (i+1)){\n\t\taux07 = j - 1 ;\n\t\taux04 = number[aux07] ;\n\t\taux05 = number[j] ;\n\t\tif (aux05 < aux04) {\n\t\t aux06 = j - 1 ;\n\t\t t = number[aux06] ;\n\t\t number[aux06] = number[j] ;\n\t\t number[j] = t;\n\t\t}\n\t\telse nt = 0 ;\n\t\tj = j + 1 ;\n\t }\n\t i = i - 1 ;\n\t}\n\treturn 0 ;\n }", "public int Sort(){\n\tint nt ;\n\tint i ;\n\tint aux02 ;\n\tint aux04 ;\n\tint aux05 ;\n\tint aux06 ;\n\tint aux07 ;\n\tint j ;\n\tint t ;\n\ti = size - 1 ;\n\taux02 = 0 - 1 ;\n\twhile (aux02 < i) {\n\t j = 1 ;\n\t //aux03 = i+1 ;\n\t while (j < (i+1)){\n\t\taux07 = j - 1 ;\n\t\taux04 = number[aux07] ;\n\t\taux05 = number[j] ;\n\t\tif (aux05 < aux04) {\n\t\t aux06 = j - 1 ;\n\t\t t = number[aux06] ;\n\t\t number[aux06] = number[j] ;\n\t\t number[j] = t;\n\t\t}\n\t\telse nt = 0 ;\n\t\tj = j + 1 ;\n\t }\n\t i = i - 1 ;\n\t}\n\treturn 0 ;\n }", "public int Sort(){\n\tint nt ;\n\tint i ;\n\tint aux02 ;\n\tint aux04 ;\n\tint aux05 ;\n\tint aux06 ;\n\tint aux07 ;\n\tint j ;\n\tint t ;\n\ti = size - 1 ;\n\taux02 = 0 - 1 ;\n\twhile (aux02 < i) {\n\t j = 1 ;\n\t //aux03 = i+1 ;\n\t while (j < (i+1)){\n\t\taux07 = j - 1 ;\n\t\taux04 = number[aux07] ;\n\t\taux05 = number[j] ;\n\t\tif (aux05 < aux04) {\n\t\t aux06 = j - 1 ;\n\t\t t = number[aux06] ;\n\t\t number[aux06] = number[j] ;\n\t\t number[j] = t;\n\t\t}\n\t\telse nt = 0 ;\n\t\tj = j + 1 ;\n\t }\n\t i = i - 1 ;\n\t}\n\treturn 0 ;\n }", "public int Sort(){\n\tint nt ;\n\tint i ;\n\tint aux02 ;\n\tint aux04 ;\n\tint aux05 ;\n\tint aux06 ;\n\tint aux07 ;\n\tint j ;\n\tint t ;\n\ti = size - 1 ;\n\taux02 = 0 - 1 ;\n\twhile (aux02 < i) {\n\t j = 1 ;\n\t //aux03 = i+1 ;\n\t while (j < (i+1)){\n\t\taux07 = j - 1 ;\n\t\taux04 = number[aux07] ;\n\t\taux05 = number[j] ;\n\t\tif (aux05 < aux04) {\n\t\t aux06 = j - 1 ;\n\t\t t = number[aux06] ;\n\t\t number[aux06] = number[j] ;\n\t\t number[j] = t;\n\t\t}\n\t\telse nt = 0 ;\n\t\tj = j + 1 ;\n\t }\n\t i = i - 1 ;\n\t}\n\treturn 0 ;\n }", "public int Sort(){\n\tint nt ;\n\tint i ;\n\tint aux02 ;\n\tint aux04 ;\n\tint aux05 ;\n\tint aux06 ;\n\tint aux07 ;\n\tint j ;\n\tint t ;\n\ti = size - 1 ;\n\taux02 = 0 - 1 ;\n\twhile (aux02 < i) {\n\t j = 1 ;\n\t //aux03 = i+1 ;\n\t while (j < (i+1)){\n\t\taux07 = j - 1 ;\n\t\taux04 = number[aux07] ;\n\t\taux05 = number[j] ;\n\t\tif (aux05 < aux04) {\n\t\t aux06 = j - 1 ;\n\t\t t = number[aux06] ;\n\t\t number[aux06] = number[j] ;\n\t\t number[j] = t;\n\t\t}\n\t\telse nt = 0 ;\n\t\tj = j + 1 ;\n\t }\n\t i = i - 1 ;\n\t}\n\treturn 0 ;\n }", "public int Sort(){\n\tint nt ;\n\tint i ;\n\tint aux02 ;\n\tint aux04 ;\n\tint aux05 ;\n\tint aux06 ;\n\tint aux07 ;\n\tint j ;\n\tint t ;\n\ti = size - 1 ;\n\taux02 = 0 - 1 ;\n\twhile (aux02 < i) {\n\t j = 1 ;\n\t //aux03 = i+1 ;\n\t while (j < (i+1)){\n\t\taux07 = j - 1 ;\n\t\taux04 = number[aux07] ;\n\t\taux05 = number[j] ;\n\t\tif (aux05 < aux04) {\n\t\t aux06 = j - 1 ;\n\t\t t = number[aux06] ;\n\t\t number[aux06] = number[j] ;\n\t\t number[j] = t;\n\t\t}\n\t\telse nt = 0 ;\n\t\tj = j + 1 ;\n\t }\n\t i = i - 1 ;\n\t}\n\treturn 0 ;\n }", "public int Sort(){\n\tint nt ;\n\tint i ;\n\tint aux02 ;\n\tint aux04 ;\n\tint aux05 ;\n\tint aux06 ;\n\tint aux07 ;\n\tint j ;\n\tint t ;\n\ti = size - 1 ;\n\taux02 = 0 - 1 ;\n\twhile (aux02 < i) {\n\t j = 1 ;\n\t //aux03 = i+1 ;\n\t while (j < (i+1)){\n\t\taux07 = j - 1 ;\n\t\taux04 = number[aux07] ;\n\t\taux05 = number[j] ;\n\t\tif (aux05 < aux04) {\n\t\t aux06 = j - 1 ;\n\t\t t = number[aux06] ;\n\t\t number[aux06] = number[j] ;\n\t\t number[j] = t;\n\t\t}\n\t\telse nt = 0 ;\n\t\tj = j + 1 ;\n\t }\n\t i = i - 1 ;\n\t}\n\treturn 0 ;\n }", "public int Sort(){\n\tint nt ;\n\tint i ;\n\tint aux02 ;\n\tint aux04 ;\n\tint aux05 ;\n\tint aux06 ;\n\tint aux07 ;\n\tint j ;\n\tint t ;\n\ti = size - 1 ;\n\taux02 = 0 - 1 ;\n\twhile (aux02 < i) {\n\t j = 1 ;\n\t //aux03 = i+1 ;\n\t while (j < (i+1)){\n\t\taux07 = j - 1 ;\n\t\taux04 = number[aux07] ;\n\t\taux05 = number[j] ;\n\t\tif (aux05 < aux04) {\n\t\t aux06 = j - 1 ;\n\t\t t = number[aux06] ;\n\t\t number[aux06] = number[j] ;\n\t\t number[j] = t;\n\t\t}\n\t\telse nt = 0 ;\n\t\tj = j + 1 ;\n\t }\n\t i = i - 1 ;\n\t}\n\treturn 0 ;\n }", "public static void bubbleSort(Array a) {\n int temp;\n for (int i = 0; i < a.length - 1; i++) { // for passes\n int flag = 0;\n for (int j = 0; j < a.length - 1 - i; j++) { // for iteration\n if (a.get(j) > a.get(j + 1)) {\n temp = a.get(j);\n a.set(j, a.get(j + 1));\n a.set(j + 1, temp);\n flag = 1;\n }\n }\n if (flag == 0) break; // if the list is already sorted\n }\n }", "public static void getBubbleSort(int range) {\n\n Integer[] number = GetRandomArray.getIntegerArray(range);\n\n //main cursor to run across array\n int pivot_main = 0;\n\n //secondary cursor to run of each index of array\n int pivot_check = 0;\n\n //variable to hold current check number\n int check_num = 0;\n\n //run loop for array length time\n for (int i = number.length; i > 0; i--) {\n\n //set cursor to first number\n pivot_main = number[0];\n\n //loop size decreases with main loop (i - 1234 | j - 4321)\n for (int j = 0; j < i - 1; j++) {\n\n //set cursor to next number in loop\n pivot_check = j + 1;\n\n //get number at above cursor\n check_num = number[j + 1];\n\n //check if number at current cursor is less than number at main cursor\n if (check_num < pivot_main) {\n //swap there position\n number[pivot_check] = pivot_main;\n number[j] = check_num;\n }\n\n //check if number at current cursor is greater than number at main cursor\n if (check_num > pivot_main) {\n //transfer current number to main cursor\n pivot_main = check_num;\n }\n }\n System.out.println(Arrays.toString(number));\n }\n }" ]
[ "0.7167602", "0.7034164", "0.7007449", "0.69322693", "0.692657", "0.6883068", "0.6870847", "0.67569053", "0.6755198", "0.6732915", "0.67296124", "0.66639155", "0.6647272", "0.6635847", "0.6625538", "0.66038996", "0.6506145", "0.6505558", "0.64938635", "0.64790756", "0.6436423", "0.64309555", "0.64172286", "0.64172286", "0.64172286", "0.64172286", "0.64172286", "0.64172286", "0.64172286", "0.64172286", "0.64172286", "0.64172286", "0.64172286", "0.64172286", "0.64172286", "0.64172286", "0.64172286", "0.64172286", "0.64172286", "0.64172286", "0.64172286", "0.64172286", "0.64172286", "0.64172286", "0.64172286", "0.64172286", "0.64172286", "0.64168394", "0.64168394", "0.64168394", "0.64168394", "0.64168394", "0.64168394", "0.64168394", "0.64168394", "0.64168394", "0.64168394", "0.64168394", "0.64168394", "0.64168394", "0.64168394", "0.64168394", "0.64168394", "0.64168394", "0.64168394", "0.64168394", "0.64168394", "0.64168394", "0.64168394", "0.64168394", "0.64168394", "0.64168394", "0.64168394", "0.64168394", "0.64168394", "0.64168394", "0.64168394", "0.64168394", "0.64168394", "0.64168394", "0.64168394", "0.64168394", "0.64168394", "0.64168394", "0.64168394", "0.64168394", "0.64168394", "0.64168394", "0.64168394", "0.64168394", "0.64168394", "0.64168394", "0.64168394", "0.64168394", "0.64168394", "0.64168394", "0.64168394", "0.64168394", "0.64040077", "0.6381398" ]
0.65765214
16
Creates new form manage_employee_attendance
public manage_employee_attendance() { initComponents(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public attendance() {\n initComponents();\n setDate();\n controller = new AttendanceController();\n getAllEmployees();\n generateAttendanceId();\n aIdtxt.setVisible(false);\n }", "@GetMapping(\"/showNewEmpForm\")\n\tpublic String showNewEmpForm(Model model) {\n\t\tEmployees employee = new Employees();\n\t\tmodel.addAttribute(\"employee\", employee);\n\t\treturn \"new_employee\";\n\t}", "public AttendanceForm() {\n super();\n initComponents();\n attendanceTableModel = new AttendanceTableModel();\n attendanceTable.setModel(attendanceTableModel);\n }", "@RequestMapping(value = \"/add\", method = RequestMethod.GET)\r\n\tpublic ModelAndView addEmployee(@ModelAttribute Employee employee) {\r\n\t\tSystem.out.println(\"------------- redirecting to emp registration page --------------\" + employee);\r\n\t\tMap<String, Object> model = new HashMap<String, Object>();\r\n\t\treturn new ModelAndView(\"add\", model);\r\n\t}", "public static EventAttendance createEntity(EntityManager em) {\n EventAttendance eventAttendance = new EventAttendance()\n .attendanceDate(DEFAULT_ATTENDANCE_DATE);\n return eventAttendance;\n }", "@GetMapping(\"/showNewEmployeeForm\")\n public String showNewEmployeeForm(Model model){\n Employee employee=new Employee();\n model.addAttribute(\"employee\",employee);\n return \"Add_Employee\";\n }", "@RequestMapping(\"Home1\")\r\n\tpublic String createUser1(Model m) \r\n\t{\n\t\tm.addAttribute(\"employee\",new Employee());\r\n\t\treturn \"register\";//register.jsp==form action=register\r\n\t}", "@PostMapping(\"addEmployee\")\r\n\tpublic String addEmployee(@ModelAttribute(\"employee\") Employee employee) {\r\n\r\n\t\temployeeDao.addEmployee(employee);\r\n\t\t\r\n\t\treturn \"EmployeeDetails\";\r\n\t}", "protected void insertAttendance(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {\n\t\n\n\tint user=Integer.parseInt(request.getParameter(\"user\"));\n\tint t=Integer.parseInt(request.getParameter(\"intime\"));\n\tint t1=Integer.parseInt(request.getParameter(\"outtime\"));\n\tString s = request.getParameter(\"date\");\n\tString s1 = request.getParameter(\"details\");\n\t\n\tUserVO userVO=new UserVO();\n\tuserVO.setUser_id(user);\n\t\n\tAttendanceVO v=new AttendanceVO(); \n\tv.setIn_time(t);\n\tv.setOut_time(t1);\n\tv.setDate(s);\n\tv.setDetails(s1);\n\tv.setUserVO(userVO);\n\tAttendanceDAO d=new AttendanceDAO();\n\t\n\td.insertAttendance(v);\n\tresponse.sendRedirect(\"Admin/Form_ManageAttendance.jsp\");\n\n}", "private void submit_attendance() {\n }", "public Mark_Attendance() {\n initComponents();\n empolyee_Controller=new Empolyee_Controller();\n attendance_Contorller=new Attendance_Contorller();\n grade_Controller=new Grade_Controller();\n setLocationRelativeTo(null);\n setDate();\n setTime();\n Textattendanceid1.setText(\" \");\n try {\n loadEmployeeNIC();\n setid();\n } catch (ClassNotFoundException | SQLException ex) {\n Logger.getLogger(Mark_Attendance.class.getName()).log(Level.SEVERE, null, ex);\n }\n }", "public void createemployee(Employeee em) {\n\t\temployeerepo.save(em);\n\t}", "@RequestMapping(params = \"saveEmployee\", method = RequestMethod.POST)\n\tpublic ModelAndView addEmployee(\n\t\t\t@ModelAttribute(\"employee\") Employee employee,\n\t\t\tBindingResult result, Model m) {\n\n\t\temployee.setCreateddate(new Timestamp(new Date().getTime()));\n\t\temployee.setModifieddate(new Timestamp(new Date().getTime()));\n\t\tint empId = empServiceimpl.addUsers(employee);\n\t\tSystem.out.println(\"Employee id after save is \" + empId);\n\t\tString message = \"Employee: \" + empId + \" has been added successfully\";\n\t\t/*\n\t\t * @SuppressWarnings(\"unchecked\") List<Employee> lists =\n\t\t * service.fetchAllDetails(); m.addAttribute(\"lists\", lists);\n\t\t */\n\t\treturn new ModelAndView(\"index\", \"message\", message);\n\t}", "public FrmCrearEmpleado() {\n initComponents();\n tFecha.setDate(new Date());\n }", "@Override\n\tpublic void createEmployee(Employee e) {\n\t\t\n\t}", "@PostMapping(\"/addNewEmployee/save\")\n public String saveEmployee(@ModelAttribute(\"employee\") Employee employee){\n employeeService.saveEmployee(employee);\n return \"redirect:/\";\n }", "public void createAgendamento() {\n\n if (tbagendamento.getTmdataagendamento().after(TimeControl.getDateIni())) {\n if (agendamentoLogic.createTbagendamento(tbagendamento)) {\n AbstractFacesContextUtils.redirectPage(PagesUrl.URL_AGENDAMENTO_LIST);\n AbstractFacesContextUtils.addMessageInfo(\"Agendamento cadastrado com sucesso.\");\n } else {\n AbstractFacesContextUtils.addMessageWarn(\"Falhar ao realizado cadastro do agendamento.\");\n }\n } else {\n AbstractFacesContextUtils.addMessageWarn(\"verifique se a data de agendamento esta correta.\");\n }\n }", "@PostMapping( value = \"/new\", params = \"auto\" )\n public String createEventFormAutoPopulate( @ModelAttribute CreateEventForm createEventForm )\n {\n // provide default values to make user submission easier\n createEventForm.setSummary( \"A new event....\" );\n createEventForm.setDescription( \"This was autopopulated to save time creating a valid event.\" );\n createEventForm.setWhen( new Date() );\n\n // make the attendee not the current user\n CalendarUser currentUser = userContext.getCurrentUser();\n int attendeeId = currentUser.getId() == 0 ? 1 : 0;\n CalendarUser attendee = calendarService.getUser( attendeeId );\n createEventForm.setAttendeeEmail( attendee.getEmail() );\n\n return \"events/create\";\n }", "public void registhourly_employee(Hourly_employee form) throws UserException, ClassNotFoundException, InstantiationException, IllegalAccessException{\n\t\tHourly_employee hrs = hourly_employeeDao.findByHourly_ssn(form.gethourly_ssn());\r\n\t\tString hrsID = hrs.gethourly_ssn();\r\n\t\tString formID = form.gethourly_ssn();\r\n\t\t\r\n\t\tif(hrsID == formID)\r\n\t\t\tthrow new UserException(\"This Employee ID has already been in your Database!\");\r\n\t\t\r\n\t\thourly_employeeDao.add(form);\r\n\t}", "@GetMapping(\"/students/new\")\n\tpublic String createStudentForm(Model model) throws ParseException\n\t{\n\t\t\n\t\tStudent student=new Student(); //To hold form Data.\n\t\t\n\t\tmodel.addAttribute(\"student\",student);\n\t\t\n\t\t// go to create_student.html page\n\t\treturn \"create_student\";\n\t}", "@GetMapping(\"/students/new\")\r\n\tpublic String createStudentForm(Model model) {\n\t\tStudent student =new Student();\r\n\t\tmodel.addAttribute(\"student\",student);\r\n\t\treturn \"create_student\";\r\n\t}", "public addEmployee() {\n initComponents();\n \n conn = db.java_db();\n Toolkit toolkit = getToolkit();\n Dimension size = toolkit.getScreenSize();\n setLocation(size.width / 2 - getWidth() / 2, size.height / 2 - getHeight() / 2);\n }", "@PostMapping(value = \"/addEmployee\")\n\tpublic void addEmployee() {\n\t\tEmployee e = new Employee(\"Iftekhar Khan\");\n\t\tdataServiceImpl.add(e);\n\t}", "@Override\n\tpublic void create(Empleado e) {\n\t\tSystem.out.println(\"Graba el empleado \" + e + \" en la BBDD.\");\n\t}", "@PostMapping(value=\"/employes\")\n\tpublic void createEmployeeDeatils(@RequestBody Employee employee){\n\t\t\t\n\t\temployeeService.saveEmployeeDetails(employee);\n\t\t\n\t}", "@PostMapping(\"/addEmployee\")\n\tpublic ResponseEntity<EmployeeMon> createEmployee(@RequestBody EmployeeMon employee)\n\t{\n\t\ttry {\n\t\t\tEmployeeMon stud = repository.save(\n\t\t\t\t\tnew EmployeeMon(employee.getId(),employee.getName(),employee.getAddress(), employee.getEmail(),\n\t\t\t\t\t\t\temployee.getSalary()));\n\t\t\tLOGGER.info(\"Inserted data into Table\");\n\t\t\treturn new ResponseEntity<>(stud, HttpStatus.CREATED);\n\t\t} catch(Exception e) {\n\t\t\treturn new ResponseEntity<>(null, HttpStatus.INTERNAL_SERVER_ERROR);\n\t\t}\n\t}", "@Override\n public ResponseEntity createEmployee(@Valid Employee employeeRequest) {\n Employee savedemployee = employeeService.create(employeeRequest);\n URI location= ServletUriComponentsBuilder.fromCurrentRequest().path(\"/{id}\").buildAndExpand(savedemployee.getId()).toUri();\n return ResponseEntity.created(location).build();\n\n }", "public void create(Employee employee, Company company, IncomingReport incoming_report) throws IllegalArgumentException, DAOException;", "public void setCreateEmp(String createEmp) {\n this.createEmp = createEmp;\n }", "@SuppressWarnings(\"unchecked\")\n // <editor-fold defaultstate=\"collapsed\" desc=\"Generated Code\">//GEN-BEGIN:initComponents\n private void initComponents() {\n\n jScrollPane1 = new javax.swing.JScrollPane();\n jPanel3 = new javax.swing.JPanel();\n jPanel4 = new javax.swing.JPanel();\n Labelemployeeid1 = new javax.swing.JLabel();\n ComboEmployeeNic1 = new javax.swing.JComboBox();\n Labelattend1 = new javax.swing.JLabel();\n Labelarrivaltime1 = new javax.swing.JLabel();\n TextArrivaltime1 = new javax.swing.JTextField();\n Labelleavetime = new javax.swing.JLabel();\n TextLeavetime = new javax.swing.JTextField();\n btLeaveTime = new javax.swing.JButton();\n TextOtamount = new javax.swing.JTextField();\n Labelotamount = new javax.swing.JLabel();\n BtAddattendance1 = new javax.swing.JButton();\n texAttend = new javax.swing.JTextField();\n jPanel2 = new javax.swing.JPanel();\n Labelemployeeid = new javax.swing.JLabel();\n ComboEmployeeNic = new javax.swing.JComboBox();\n Labelattend = new javax.swing.JLabel();\n ComboEmployeeAttend = new javax.swing.JComboBox();\n Labelarrivaltime = new javax.swing.JLabel();\n TextArrivaltime = new javax.swing.JTextField();\n btGetArrivalTime = new javax.swing.JButton();\n BtAddattendance = new javax.swing.JButton();\n labDateType = new javax.swing.JLabel();\n CheckBoxholiday = new javax.swing.JCheckBox();\n Texdate = new javax.swing.JTextField();\n BtsearchAttendance = new javax.swing.JButton();\n Labelattendanceid1 = new javax.swing.JLabel();\n jSeparator3 = new javax.swing.JSeparator();\n labDate = new javax.swing.JLabel();\n Textattendanceid1 = new javax.swing.JTextField();\n labTime = new javax.swing.JLabel();\n jLabel1 = new javax.swing.JLabel();\n btExit = new javax.swing.JButton();\n btmini = new javax.swing.JButton();\n jLabel5 = new javax.swing.JLabel();\n jLabel2 = new javax.swing.JLabel();\n jLabel3 = new javax.swing.JLabel();\n jLabel4 = new javax.swing.JLabel();\n\n setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE);\n setTitle(\"Mark Attendance\");\n setMinimumSize(new java.awt.Dimension(1190, 630));\n setUndecorated(true);\n\n jScrollPane1.setHorizontalScrollBarPolicy(javax.swing.ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER);\n jScrollPane1.setVerticalScrollBarPolicy(javax.swing.ScrollPaneConstants.VERTICAL_SCROLLBAR_NEVER);\n jScrollPane1.setMaximumSize(new java.awt.Dimension(1190, 630));\n jScrollPane1.setMinimumSize(new java.awt.Dimension(1190, 630));\n\n jPanel3.setBackground(new java.awt.Color(255, 255, 255));\n jPanel3.setMaximumSize(new java.awt.Dimension(1190, 630));\n jPanel3.setMinimumSize(new java.awt.Dimension(1190, 630));\n jPanel3.setPreferredSize(new java.awt.Dimension(1190, 630));\n jPanel3.setLayout(new org.netbeans.lib.awtextra.AbsoluteLayout());\n\n jPanel4.setBackground(new java.awt.Color(255, 255, 255));\n jPanel4.setBorder(javax.swing.BorderFactory.createTitledBorder(null, \"\", 1, 2));\n jPanel4.setOpaque(false);\n jPanel4.setLayout(new org.netbeans.lib.awtextra.AbsoluteLayout());\n\n Labelemployeeid1.setFont(new java.awt.Font(\"Times New Roman\", 0, 24)); // NOI18N\n Labelemployeeid1.setForeground(new java.awt.Color(0, 0, 102));\n Labelemployeeid1.setHorizontalAlignment(javax.swing.SwingConstants.RIGHT);\n Labelemployeeid1.setText(\"Employee Nic : \");\n jPanel4.add(Labelemployeeid1, new org.netbeans.lib.awtextra.AbsoluteConstraints(20, 28, 170, 30));\n\n ComboEmployeeNic1.setEditable(true);\n ComboEmployeeNic1.setFont(new java.awt.Font(\"Times New Roman\", 0, 14)); // NOI18N\n ComboEmployeeNic1.setCursor(new java.awt.Cursor(java.awt.Cursor.DEFAULT_CURSOR));\n ComboEmployeeNic1.addItemListener(new java.awt.event.ItemListener() {\n public void itemStateChanged(java.awt.event.ItemEvent evt) {\n ComboEmployeeNic1ItemStateChanged(evt);\n }\n });\n jPanel4.add(ComboEmployeeNic1, new org.netbeans.lib.awtextra.AbsoluteConstraints(190, 20, 250, 40));\n\n Labelattend1.setFont(new java.awt.Font(\"Times New Roman\", 0, 24)); // NOI18N\n Labelattend1.setForeground(new java.awt.Color(0, 0, 102));\n Labelattend1.setHorizontalAlignment(javax.swing.SwingConstants.RIGHT);\n Labelattend1.setText(\"Attend : \");\n jPanel4.add(Labelattend1, new org.netbeans.lib.awtextra.AbsoluteConstraints(90, 69, 100, 40));\n\n Labelarrivaltime1.setFont(new java.awt.Font(\"Times New Roman\", 0, 24)); // NOI18N\n Labelarrivaltime1.setForeground(new java.awt.Color(0, 0, 102));\n Labelarrivaltime1.setHorizontalAlignment(javax.swing.SwingConstants.RIGHT);\n Labelarrivaltime1.setText(\"Arrival Time : \");\n jPanel4.add(Labelarrivaltime1, new org.netbeans.lib.awtextra.AbsoluteConstraints(40, 120, 150, 40));\n\n TextArrivaltime1.setEditable(false);\n TextArrivaltime1.setFont(new java.awt.Font(\"Times New Roman\", 0, 14)); // NOI18N\n TextArrivaltime1.setForeground(new java.awt.Color(0, 0, 102));\n TextArrivaltime1.setHorizontalAlignment(javax.swing.JTextField.LEFT);\n jPanel4.add(TextArrivaltime1, new org.netbeans.lib.awtextra.AbsoluteConstraints(190, 120, 80, 40));\n\n Labelleavetime.setFont(new java.awt.Font(\"Times New Roman\", 0, 24)); // NOI18N\n Labelleavetime.setForeground(new java.awt.Color(0, 0, 102));\n Labelleavetime.setHorizontalAlignment(javax.swing.SwingConstants.RIGHT);\n Labelleavetime.setText(\"Leave Time : \");\n jPanel4.add(Labelleavetime, new org.netbeans.lib.awtextra.AbsoluteConstraints(50, 170, 140, 40));\n\n TextLeavetime.setEditable(false);\n TextLeavetime.setFont(new java.awt.Font(\"Times New Roman\", 0, 14)); // NOI18N\n TextLeavetime.setForeground(new java.awt.Color(0, 0, 102));\n TextLeavetime.setHorizontalAlignment(javax.swing.JTextField.LEFT);\n jPanel4.add(TextLeavetime, new org.netbeans.lib.awtextra.AbsoluteConstraints(190, 170, 80, 40));\n\n btLeaveTime.setBackground(new java.awt.Color(102, 102, 102));\n btLeaveTime.setFont(new java.awt.Font(\"Times New Roman\", 0, 12)); // NOI18N\n btLeaveTime.setText(\"Get Time\");\n btLeaveTime.setCursor(new java.awt.Cursor(java.awt.Cursor.HAND_CURSOR));\n btLeaveTime.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n btLeaveTimeActionPerformed(evt);\n }\n });\n jPanel4.add(btLeaveTime, new org.netbeans.lib.awtextra.AbsoluteConstraints(280, 170, 80, 40));\n\n TextOtamount.setEditable(false);\n TextOtamount.setFont(new java.awt.Font(\"Times New Roman\", 0, 14)); // NOI18N\n TextOtamount.setForeground(new java.awt.Color(0, 0, 102));\n TextOtamount.setHorizontalAlignment(javax.swing.JTextField.LEFT);\n jPanel4.add(TextOtamount, new org.netbeans.lib.awtextra.AbsoluteConstraints(190, 220, 110, 40));\n\n Labelotamount.setFont(new java.awt.Font(\"Times New Roman\", 0, 24)); // NOI18N\n Labelotamount.setForeground(new java.awt.Color(0, 0, 102));\n Labelotamount.setHorizontalAlignment(javax.swing.SwingConstants.RIGHT);\n Labelotamount.setText(\"Ot Amount : \");\n jPanel4.add(Labelotamount, new org.netbeans.lib.awtextra.AbsoluteConstraints(50, 220, 140, 40));\n\n BtAddattendance1.setBackground(new java.awt.Color(102, 102, 102));\n BtAddattendance1.setFont(new java.awt.Font(\"Times New Roman\", 0, 18)); // NOI18N\n BtAddattendance1.setIcon(new javax.swing.ImageIcon(getClass().getResource(\"/com/smsc/view/Attendance/accept.png\"))); // NOI18N\n BtAddattendance1.setText(\"Mark Attendance\");\n BtAddattendance1.setCursor(new java.awt.Cursor(java.awt.Cursor.HAND_CURSOR));\n BtAddattendance1.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n BtAddattendance1ActionPerformed(evt);\n }\n });\n jPanel4.add(BtAddattendance1, new org.netbeans.lib.awtextra.AbsoluteConstraints(320, 240, 190, 50));\n\n texAttend.setFont(new java.awt.Font(\"Times New Roman\", 0, 14)); // NOI18N\n texAttend.setForeground(new java.awt.Color(0, 0, 102));\n jPanel4.add(texAttend, new org.netbeans.lib.awtextra.AbsoluteConstraints(190, 69, 134, 40));\n\n jPanel3.add(jPanel4, new org.netbeans.lib.awtextra.AbsoluteConstraints(580, 200, 570, 300));\n\n jPanel2.setBackground(new java.awt.Color(255, 255, 255));\n jPanel2.setBorder(javax.swing.BorderFactory.createTitledBorder(null, \"\", 1, 2));\n jPanel2.setOpaque(false);\n jPanel2.setLayout(new org.netbeans.lib.awtextra.AbsoluteLayout());\n\n Labelemployeeid.setFont(new java.awt.Font(\"Times New Roman\", 0, 24)); // NOI18N\n Labelemployeeid.setForeground(new java.awt.Color(0, 0, 102));\n Labelemployeeid.setHorizontalAlignment(javax.swing.SwingConstants.RIGHT);\n Labelemployeeid.setText(\"Employee Nic : \");\n jPanel2.add(Labelemployeeid, new org.netbeans.lib.awtextra.AbsoluteConstraints(14, 71, 170, 40));\n\n ComboEmployeeNic.setEditable(true);\n ComboEmployeeNic.setFont(new java.awt.Font(\"Times New Roman\", 0, 14)); // NOI18N\n ComboEmployeeNic.setCursor(new java.awt.Cursor(java.awt.Cursor.DEFAULT_CURSOR));\n jPanel2.add(ComboEmployeeNic, new org.netbeans.lib.awtextra.AbsoluteConstraints(184, 71, 213, 40));\n\n Labelattend.setFont(new java.awt.Font(\"Times New Roman\", 0, 24)); // NOI18N\n Labelattend.setForeground(new java.awt.Color(0, 0, 102));\n Labelattend.setHorizontalAlignment(javax.swing.SwingConstants.RIGHT);\n Labelattend.setText(\"Attend : \");\n jPanel2.add(Labelattend, new org.netbeans.lib.awtextra.AbsoluteConstraints(90, 120, 100, 40));\n\n ComboEmployeeAttend.setFont(new java.awt.Font(\"Times New Roman\", 0, 14)); // NOI18N\n ComboEmployeeAttend.setModel(new javax.swing.DefaultComboBoxModel(new String[] { \"Present\", \"Absent\" }));\n ComboEmployeeAttend.setCursor(new java.awt.Cursor(java.awt.Cursor.HAND_CURSOR));\n ComboEmployeeAttend.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n ComboEmployeeAttendActionPerformed(evt);\n }\n });\n jPanel2.add(ComboEmployeeAttend, new org.netbeans.lib.awtextra.AbsoluteConstraints(190, 120, 159, 40));\n\n Labelarrivaltime.setFont(new java.awt.Font(\"Times New Roman\", 0, 24)); // NOI18N\n Labelarrivaltime.setForeground(new java.awt.Color(0, 0, 102));\n Labelarrivaltime.setHorizontalAlignment(javax.swing.SwingConstants.RIGHT);\n Labelarrivaltime.setText(\"Arrival Time : \");\n jPanel2.add(Labelarrivaltime, new org.netbeans.lib.awtextra.AbsoluteConstraints(30, 170, 150, 40));\n\n TextArrivaltime.setEditable(false);\n TextArrivaltime.setFont(new java.awt.Font(\"Times New Roman\", 0, 14)); // NOI18N\n TextArrivaltime.setForeground(new java.awt.Color(0, 0, 102));\n TextArrivaltime.setHorizontalAlignment(javax.swing.JTextField.LEFT);\n jPanel2.add(TextArrivaltime, new org.netbeans.lib.awtextra.AbsoluteConstraints(190, 170, 123, 40));\n\n btGetArrivalTime.setBackground(new java.awt.Color(102, 102, 102));\n btGetArrivalTime.setFont(new java.awt.Font(\"Times New Roman\", 0, 12)); // NOI18N\n btGetArrivalTime.setText(\"Get Time\");\n btGetArrivalTime.setCursor(new java.awt.Cursor(java.awt.Cursor.HAND_CURSOR));\n btGetArrivalTime.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n btGetArrivalTimeActionPerformed(evt);\n }\n });\n jPanel2.add(btGetArrivalTime, new org.netbeans.lib.awtextra.AbsoluteConstraints(330, 170, 90, 40));\n\n BtAddattendance.setBackground(new java.awt.Color(102, 102, 102));\n BtAddattendance.setFont(new java.awt.Font(\"Times New Roman\", 0, 18)); // NOI18N\n BtAddattendance.setIcon(new javax.swing.ImageIcon(getClass().getResource(\"/com/smsc/view/Attendance/accept.png\"))); // NOI18N\n BtAddattendance.setText(\"Mark Attendance\");\n BtAddattendance.setCursor(new java.awt.Cursor(java.awt.Cursor.HAND_CURSOR));\n BtAddattendance.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n BtAddattendanceActionPerformed(evt);\n }\n });\n jPanel2.add(BtAddattendance, new org.netbeans.lib.awtextra.AbsoluteConstraints(260, 230, 200, 50));\n\n labDateType.setFont(new java.awt.Font(\"Times New Roman\", 0, 24)); // NOI18N\n labDateType.setForeground(new java.awt.Color(0, 0, 102));\n labDateType.setHorizontalAlignment(javax.swing.SwingConstants.RIGHT);\n labDateType.setText(\"Date Type : \");\n jPanel2.add(labDateType, new org.netbeans.lib.awtextra.AbsoluteConstraints(59, 25, -1, -1));\n\n CheckBoxholiday.setFont(new java.awt.Font(\"Times New Roman\", 0, 24)); // NOI18N\n CheckBoxholiday.setForeground(new java.awt.Color(0, 0, 102));\n CheckBoxholiday.setText(\"Holiday\");\n CheckBoxholiday.setContentAreaFilled(false);\n jPanel2.add(CheckBoxholiday, new org.netbeans.lib.awtextra.AbsoluteConstraints(184, 25, -1, -1));\n\n jPanel3.add(jPanel2, new org.netbeans.lib.awtextra.AbsoluteConstraints(20, 200, 540, 300));\n\n Texdate.setEditable(false);\n Texdate.setBackground(new java.awt.Color(0, 153, 204));\n Texdate.setFont(new java.awt.Font(\"sansserif\", 0, 24)); // NOI18N\n jPanel3.add(Texdate, new org.netbeans.lib.awtextra.AbsoluteConstraints(860, 50, 140, 40));\n\n BtsearchAttendance.setBackground(new java.awt.Color(102, 102, 102));\n BtsearchAttendance.setFont(new java.awt.Font(\"Times New Roman\", 0, 18)); // NOI18N\n BtsearchAttendance.setText(\"Search Past Attendance\");\n BtsearchAttendance.setCursor(new java.awt.Cursor(java.awt.Cursor.HAND_CURSOR));\n BtsearchAttendance.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n BtsearchAttendanceActionPerformed(evt);\n }\n });\n jPanel3.add(BtsearchAttendance, new org.netbeans.lib.awtextra.AbsoluteConstraints(10, 120, 220, 40));\n\n Labelattendanceid1.setFont(new java.awt.Font(\"Times New Roman\", 0, 24)); // NOI18N\n Labelattendanceid1.setForeground(new java.awt.Color(0, 0, 102));\n Labelattendanceid1.setHorizontalAlignment(javax.swing.SwingConstants.RIGHT);\n Labelattendanceid1.setText(\"Attendance id : \");\n jPanel3.add(Labelattendanceid1, new org.netbeans.lib.awtextra.AbsoluteConstraints(0, 60, 170, -1));\n jPanel3.add(jSeparator3, new org.netbeans.lib.awtextra.AbsoluteConstraints(0, 170, 1190, 10));\n\n labDate.setFont(new java.awt.Font(\"Times New Roman\", 0, 24)); // NOI18N\n labDate.setForeground(new java.awt.Color(0, 0, 102));\n labDate.setText(\"Date : \");\n jPanel3.add(labDate, new org.netbeans.lib.awtextra.AbsoluteConstraints(790, 50, -1, 40));\n\n Textattendanceid1.setBackground(new java.awt.Color(0, 153, 204));\n jPanel3.add(Textattendanceid1, new org.netbeans.lib.awtextra.AbsoluteConstraints(170, 60, 100, 30));\n\n labTime.setFont(new java.awt.Font(\"Times New Roman\", 1, 36)); // NOI18N\n labTime.setForeground(new java.awt.Color(0, 0, 102));\n labTime.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);\n jPanel3.add(labTime, new org.netbeans.lib.awtextra.AbsoluteConstraints(330, 110, 430, 60));\n\n jLabel1.setFont(new java.awt.Font(\"Times New Roman\", 1, 36)); // NOI18N\n jLabel1.setForeground(new java.awt.Color(0, 0, 102));\n jLabel1.setText(\"Mark Employee Attendance\");\n jPanel3.add(jLabel1, new org.netbeans.lib.awtextra.AbsoluteConstraints(320, 50, -1, -1));\n\n btExit.setText(\"X\");\n btExit.addMouseListener(new java.awt.event.MouseAdapter() {\n public void mouseClicked(java.awt.event.MouseEvent evt) {\n btExitMouseClicked(evt);\n }\n });\n jPanel3.add(btExit, new org.netbeans.lib.awtextra.AbsoluteConstraints(1150, 0, -1, -1));\n\n btmini.setText(\"_\");\n btmini.addMouseListener(new java.awt.event.MouseAdapter() {\n public void mouseClicked(java.awt.event.MouseEvent evt) {\n btminiMouseClicked(evt);\n }\n });\n jPanel3.add(btmini, new org.netbeans.lib.awtextra.AbsoluteConstraints(1120, 0, -1, -1));\n\n jLabel5.setFont(new java.awt.Font(\"Times New Roman\", 3, 36)); // NOI18N\n jLabel5.setForeground(new java.awt.Color(255, 255, 255));\n jLabel5.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);\n jLabel5.setText(\"SMSC Payroll\");\n jPanel3.add(jLabel5, new org.netbeans.lib.awtextra.AbsoluteConstraints(470, 0, -1, -1));\n\n jLabel2.setBackground(new java.awt.Color(0, 102, 153));\n jLabel2.setOpaque(true);\n jLabel2.addMouseListener(new java.awt.event.MouseAdapter() {\n public void mousePressed(java.awt.event.MouseEvent evt) {\n jLabel2MousePressed(evt);\n }\n });\n jLabel2.addMouseMotionListener(new java.awt.event.MouseMotionAdapter() {\n public void mouseDragged(java.awt.event.MouseEvent evt) {\n jLabel2MouseDragged(evt);\n }\n });\n jPanel3.add(jLabel2, new org.netbeans.lib.awtextra.AbsoluteConstraints(1, 0, 1190, 40));\n\n jLabel3.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);\n jLabel3.setIcon(new javax.swing.ImageIcon(getClass().getResource(\"/com/smsc/view/photos/dunya-donen1.gif\"))); // NOI18N\n jPanel3.add(jLabel3, new org.netbeans.lib.awtextra.AbsoluteConstraints(970, 30, 210, 270));\n\n jLabel4.setIcon(new javax.swing.ImageIcon(getClass().getResource(\"/com/smsc/view/photos/back3232.png\"))); // NOI18N\n jLabel4.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 102, 153), 7));\n jPanel3.add(jLabel4, new org.netbeans.lib.awtextra.AbsoluteConstraints(0, 0, 1190, 648));\n\n jScrollPane1.setViewportView(jPanel3);\n\n javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());\n getContentPane().setLayout(layout);\n layout.setHorizontalGroup(\n layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)\n );\n layout.setVerticalGroup(\n layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(layout.createSequentialGroup()\n .addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 654, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addGap(0, 0, Short.MAX_VALUE))\n );\n\n pack();\n }", "private static void newEmployee(UserType employeeType) {\n\n\t\tString username = null, password;\n\n\t\tboolean valid = false;\n\n\t\t// make sure that the username is not already taken\n\t\twhile (!valid) {\n\t\t\tSystem.out.print(\"What username would you like for your account? \");\n\t\t\tusername = input.nextLine();\n\t\t\tif (nameIsTaken(username, customerList)) {\n\t\t\t\tSystem.out.println(\"Sorry but that username has already been taken.\");\n\t\t\t} else\n\t\t\t\tvalid = true;\n\t\t}\n\t\t// set valid to false after each entry\n\t\tvalid = false;\n\n\t\tSystem.out.print(\"What password would you like for your account? \");\n\t\tpassword = input.nextLine();\n\n\t\tEmployee e = new Employee(username, password);\n\n\t\te.setType(employeeType);\n\t\temployeeList.add(e);\n\t\tcurrentUser = e;\n\t\twriteObject(employeeFile, employeeList);\n\t\temployeeDao.create(e);\n\t}", "@RequestMapping(value = \"/createUser\", method = RequestMethod.GET)\n\tpublic ModelAndView createUser(ModelMap model) throws CustomException {\n\n\t\tmodel.put(\"endUserForm\", endUserForm);\n\t\tCollection<EndUser> endUsers = endUserDAOImpl.getList();\n\t\tList<Role> roles = endUserDAOImpl.findAll();\n\t\tmodel.put(\"roles\", roles);\n\n\t\tmodel.put(\"endUsers\", endUsers);\n\t\treturn new ModelAndView(\"createUser\", \"model\", model);\n\t}", "AttendanceDTO save(AttendanceDTO attendance);", "@FXML\r\n\tprivate void saveEmployee(ActionEvent event) {\r\n\t\tif (validateFields()) {\r\n\t\t\tEmployee e;\r\n\t\t\tif (newEmployee) {\r\n\t\t\t\te = new Employee();\r\n\t\t\t\tlistaStaff.getItems().add(e);\r\n\t\t\t} else {\r\n\t\t\t\te = listaStaff.getSelectionModel().getSelectedItem();\r\n\t\t\t}\r\n\t\t\te.setUsername(txUsuario.getText());\r\n\t\t\te.setPassword(txPassword.getText());\r\n\t\t\tif (checkAdmin.isSelected())\r\n\t\t\t\te.setIsAdmin(1);\r\n\t\t\telse\r\n\t\t\t\te.setIsAdmin(0);\r\n\t\t\tif (checkTPV.isSelected())\r\n\t\t\t\te.setTpvPrivilege(1);\r\n\t\t\telse\r\n\t\t\t\te.setTpvPrivilege(0);\r\n\t\t\tif (newEmployee) {\r\n\t\t\t\tservice.saveEmployee(e);\r\n\t\t\t\tnewEmployee = false;\r\n\t\t\t} else\r\n\t\t\t\tservice.updateEmployee(e);\r\n\t\t\tbtGuardar.setDisable(true);\r\n\t\t\tbtEditar.setDisable(false);\r\n\t\t\tconmuteFields();\r\n\t\t\tupdateList();\r\n\t\t}\r\n\t}", "public Attendance() {\n initComponents();\n setLocationRelativeTo(null);\n }", "@RequestMapping(value = \"/edit/{employeeID}\", method = RequestMethod.GET)\n public ModelAndView initUpdateOwnerForm(@PathVariable(\"employeeID\") String employeeID, Model model) {\n \tEmployee e = empService.findById(employeeID);\n\t\tModelAndView mav= new ModelAndView(\"CreateOrUpdateEmployee\",\"employee\",e);\n\t\tString s=\"edit\";\n\t\tmav.addObject(\"actiont\", s);\n\t\t mav.addObject(\"roleList\", roleRepo.findAll());\n\t\t mav.addObject(\"SupervisorList\",empService.ListOfSuperVisor());\n return mav;\n }", "public boolean addEmp(Employee e) {\n\t\treturn edao.create(e);\n\t\t\n\t}", "@GetMapping ( \"/patient/foodDiary/addFoodDiaryEntry\" )\r\n @PreAuthorize ( \"hasRole('ROLE_PATIENT')\" )\r\n public String addFoodDiaryEntryForm ( final Model model ) {\r\n return \"/patient/foodDiary/addFoodDiaryEntry\";\r\n }", "@POST\n @Consumes( { \"application/xml\", \"text/xml\", \"application/json\" })\n public Response createEmployee(Employee employee) {\n final int staffNo = this.employeeMgr.createEmployee(employee);\n final URI location = createdLocation(staffNo);\n return Response.created(location).build();\n }", "private void addEmployee() {\n String name = editTextName.getText().toString().trim();\n String salary = editTextSalary.getText().toString().trim();\n String dept = spinnerDepartment.getSelectedItem().toString();\n\n //getting the current time for joining date\n Calendar cal = Calendar.getInstance();\n SimpleDateFormat sdf = new SimpleDateFormat(\"yy-mm-dd hh:mm:ss\");\n String joiningDate = sdf.format(cal.getTime());\n\n //validating the inputs\n if (inputsAreCorrect(name, salary)) {\n\n String insertSQL = \"INSERT INTO employees \\n\" +\n \"(name, department, joiningdate, salary)\\n\" +\n \"VALUES \\n\" +\n \"(?, ?, ?, ?);\";\n\n /*\n using the same method execsql for inserting values\n this time it has two parameters\n first is the sql string and second is the parameters that is to be binded with\n the query\n */\n mDatabase.execSQL(insertSQL, new String[]{name, dept, joiningDate, salary});\n\n Toast.makeText(this, \"Employee Added Successfully\", Toast.LENGTH_SHORT).show();\n }\n }", "public void newRecord() {\n\t\tDateFormat dateFormat = new SimpleDateFormat(\"MM/dd/yyyy\");\n\t\tdateTxt.setText(dateFormat.format(new Date()));\n\t\t//mark all students enrolled as attendant\n\t\tif (courseTable.getSelectedRow() != -1) {\n\t\t\tsetWarningMsg(\"\");\n\t\t\tupdateStudent(currentCourse);\n\t\t\tfor (int i = 0; i < studentTable.getRowCount(); i++) {\n\t\t\t\tstudentTable.setValueAt(new Boolean(true), i, 0);\n\t\t\t}\t\t\t\n\t\t}\n\t\telse {\n\t\t\t//show message: choose course first\n\t\t\tsetWarningMsg(\"please select course first\");\n\t\t}\n\t}", "Employee(String id, Kitchen kitchen) {\r\n this.id = id;\r\n this.kitchen = kitchen;\r\n this.attendance = \"Present\";\r\n this.password = \"password\";\r\n }", "@SuppressWarnings(\"unchecked\")\n // <editor-fold defaultstate=\"collapsed\" desc=\"Generated Code\">//GEN-BEGIN:initComponents\n private void initComponents() {\n\n jPanel2 = new javax.swing.JPanel();\n EmpIdlbl = new javax.swing.JLabel();\n Datelbl = new javax.swing.JLabel();\n jLabel16 = new javax.swing.JLabel();\n jLabel17 = new javax.swing.JLabel();\n Yeslbl = new javax.swing.JLabel();\n EmpIdcombobox = new javax.swing.JComboBox<>();\n timeIntxt = new javax.swing.JTextField();\n jScrollPane1 = new javax.swing.JScrollPane();\n Attendancetbl = new javax.swing.JTable();\n timeOuttxt = new javax.swing.JTextField();\n Datelbl1 = new javax.swing.JLabel();\n aIdtxt = new javax.swing.JTextField();\n datetxt2 = new javax.swing.JTextField();\n Printlbl = new javax.swing.JLabel();\n jLabel6 = new javax.swing.JLabel();\n jPanel1 = new javax.swing.JPanel();\n homebtn = new javax.swing.JLabel();\n Employeetxt = new javax.swing.JLabel();\n loanbtn = new javax.swing.JLabel();\n salarytxt = new javax.swing.JLabel();\n paybtn = new javax.swing.JLabel();\n empbtn = new javax.swing.JLabel();\n leavesReportBtn = new javax.swing.JLabel();\n loanreportBtn = new javax.swing.JLabel();\n paysheetbtn = new javax.swing.JLabel();\n leavesbtn = new javax.swing.JLabel();\n attendancebtn = new javax.swing.JLabel();\n\n setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);\n\n jPanel2.setBackground(new java.awt.Color(255, 255, 255));\n jPanel2.setBorder(new javax.swing.border.SoftBevelBorder(javax.swing.border.BevelBorder.RAISED, java.awt.Color.black, java.awt.Color.black, java.awt.Color.black, java.awt.Color.black));\n jPanel2.setLayout(new org.netbeans.lib.awtextra.AbsoluteLayout());\n\n EmpIdlbl.setFont(new java.awt.Font(\"Tahoma\", 1, 18)); // NOI18N\n EmpIdlbl.setForeground(new java.awt.Color(0, 102, 102));\n EmpIdlbl.setText(\"Emp Name\");\n jPanel2.add(EmpIdlbl, new org.netbeans.lib.awtextra.AbsoluteConstraints(500, 160, 111, 26));\n\n Datelbl.setFont(new java.awt.Font(\"Tahoma\", 1, 18)); // NOI18N\n Datelbl.setForeground(new java.awt.Color(0, 102, 102));\n Datelbl.setText(\"Date\");\n jPanel2.add(Datelbl, new org.netbeans.lib.awtextra.AbsoluteConstraints(500, 440, 73, -1));\n\n jLabel16.setFont(new java.awt.Font(\"Tahoma\", 1, 18)); // NOI18N\n jLabel16.setForeground(new java.awt.Color(0, 102, 102));\n jLabel16.setText(\"Time in\");\n jPanel2.add(jLabel16, new org.netbeans.lib.awtextra.AbsoluteConstraints(500, 260, 98, -1));\n\n jLabel17.setFont(new java.awt.Font(\"Tahoma\", 1, 18)); // NOI18N\n jLabel17.setForeground(new java.awt.Color(0, 102, 102));\n jLabel17.setText(\"Time Out\");\n jPanel2.add(jLabel17, new org.netbeans.lib.awtextra.AbsoluteConstraints(500, 350, 98, -1));\n\n Yeslbl.setBackground(new java.awt.Color(0, 102, 102));\n Yeslbl.setFont(new java.awt.Font(\"Tahoma\", 1, 18)); // NOI18N\n Yeslbl.setForeground(new java.awt.Color(255, 255, 255));\n Yeslbl.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);\n Yeslbl.setText(\"Yes\");\n Yeslbl.setOpaque(true);\n Yeslbl.addMouseListener(new java.awt.event.MouseAdapter() {\n public void mouseClicked(java.awt.event.MouseEvent evt) {\n YeslblMouseClicked(evt);\n }\n });\n jPanel2.add(Yeslbl, new org.netbeans.lib.awtextra.AbsoluteConstraints(1000, 480, 154, 40));\n\n EmpIdcombobox.setFont(new java.awt.Font(\"Tahoma\", 0, 18)); // NOI18N\n EmpIdcombobox.setBorder(javax.swing.BorderFactory.createEtchedBorder());\n jPanel2.add(EmpIdcombobox, new org.netbeans.lib.awtextra.AbsoluteConstraints(700, 160, 242, 35));\n\n timeIntxt.setFont(new java.awt.Font(\"Tahoma\", 0, 18)); // NOI18N\n timeIntxt.setBorder(javax.swing.BorderFactory.createMatteBorder(0, 0, 2, 0, new java.awt.Color(102, 102, 102)));\n timeIntxt.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n timeIntxtActionPerformed(evt);\n }\n });\n jPanel2.add(timeIntxt, new org.netbeans.lib.awtextra.AbsoluteConstraints(710, 250, 242, 26));\n\n Attendancetbl.setBorder(new javax.swing.border.SoftBevelBorder(javax.swing.border.BevelBorder.RAISED));\n Attendancetbl.setFont(new java.awt.Font(\"Tahoma\", 0, 18)); // NOI18N\n Attendancetbl.setModel(new javax.swing.table.DefaultTableModel(\n new Object [][] {\n\n },\n new String [] {\n \"Attendance Id\", \"EmpId\", \"Time in\", \"Time out\", \"date\"\n }\n ));\n jScrollPane1.setViewportView(Attendancetbl);\n\n jPanel2.add(jScrollPane1, new org.netbeans.lib.awtextra.AbsoluteConstraints(310, 540, 844, 269));\n\n timeOuttxt.setFont(new java.awt.Font(\"Tahoma\", 0, 18)); // NOI18N\n timeOuttxt.setBorder(javax.swing.BorderFactory.createMatteBorder(0, 0, 2, 0, new java.awt.Color(102, 102, 102)));\n timeOuttxt.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n timeOuttxtActionPerformed(evt);\n }\n });\n jPanel2.add(timeOuttxt, new org.netbeans.lib.awtextra.AbsoluteConstraints(710, 350, 242, 26));\n\n Datelbl1.setFont(new java.awt.Font(\"Tahoma\", 1, 18)); // NOI18N\n Datelbl1.setForeground(new java.awt.Color(255, 255, 255));\n Datelbl1.setText(\"Atendance Id\");\n jPanel2.add(Datelbl1, new org.netbeans.lib.awtextra.AbsoluteConstraints(380, 50, -1, -1));\n\n aIdtxt.setEditable(false);\n aIdtxt.setFont(new java.awt.Font(\"Tahoma\", 0, 18)); // NOI18N\n aIdtxt.setBorder(javax.swing.BorderFactory.createMatteBorder(0, 0, 2, 0, new java.awt.Color(102, 102, 102)));\n jPanel2.add(aIdtxt, new org.netbeans.lib.awtextra.AbsoluteConstraints(890, 40, 242, 26));\n\n datetxt2.setFont(new java.awt.Font(\"Tahoma\", 0, 18)); // NOI18N\n datetxt2.setBorder(javax.swing.BorderFactory.createMatteBorder(0, 0, 2, 0, new java.awt.Color(102, 102, 102)));\n jPanel2.add(datetxt2, new org.netbeans.lib.awtextra.AbsoluteConstraints(720, 440, 242, 26));\n\n Printlbl.setBackground(new java.awt.Color(0, 102, 102));\n Printlbl.setFont(new java.awt.Font(\"Tahoma\", 1, 18)); // NOI18N\n Printlbl.setForeground(new java.awt.Color(255, 255, 255));\n Printlbl.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);\n Printlbl.setText(\"Print\");\n Printlbl.setOpaque(true);\n Printlbl.addAncestorListener(new javax.swing.event.AncestorListener() {\n public void ancestorMoved(javax.swing.event.AncestorEvent evt) {\n }\n public void ancestorAdded(javax.swing.event.AncestorEvent evt) {\n PrintlblAncestorAdded(evt);\n }\n public void ancestorRemoved(javax.swing.event.AncestorEvent evt) {\n }\n });\n Printlbl.addMouseListener(new java.awt.event.MouseAdapter() {\n public void mouseClicked(java.awt.event.MouseEvent evt) {\n PrintlblMouseClicked(evt);\n }\n });\n jPanel2.add(Printlbl, new org.netbeans.lib.awtextra.AbsoluteConstraints(990, 840, 163, 40));\n\n jLabel6.setFont(new java.awt.Font(\"Tahoma\", 1, 36)); // NOI18N\n jLabel6.setForeground(new java.awt.Color(0, 102, 102));\n jLabel6.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);\n jLabel6.setText(\"Attendance\");\n jPanel2.add(jLabel6, new org.netbeans.lib.awtextra.AbsoluteConstraints(570, 20, 288, 53));\n\n jPanel1.setBackground(new java.awt.Color(9, 9, 27));\n jPanel1.setLayout(new org.netbeans.lib.awtextra.AbsoluteLayout());\n\n homebtn.setBackground(new java.awt.Color(9, 9, 27));\n homebtn.setFont(new java.awt.Font(\"Tahoma\", 1, 18)); // NOI18N\n homebtn.setForeground(new java.awt.Color(255, 255, 255));\n homebtn.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);\n homebtn.setIcon(new javax.swing.ImageIcon(getClass().getResource(\"/lk/ijse/payrollSystem/asset/home2.png\"))); // NOI18N\n homebtn.setText(\"Home\");\n homebtn.setOpaque(true);\n homebtn.addMouseListener(new java.awt.event.MouseAdapter() {\n public void mouseClicked(java.awt.event.MouseEvent evt) {\n homebtnMouseClicked(evt);\n }\n public void mouseEntered(java.awt.event.MouseEvent evt) {\n homebtnMouseEntered(evt);\n }\n public void mouseExited(java.awt.event.MouseEvent evt) {\n homebtnMouseExited(evt);\n }\n });\n jPanel1.add(homebtn, new org.netbeans.lib.awtextra.AbsoluteConstraints(0, 0, 286, 53));\n\n Employeetxt.setBackground(new java.awt.Color(9, 9, 27));\n Employeetxt.setFont(new java.awt.Font(\"Tahoma\", 1, 18)); // NOI18N\n Employeetxt.setForeground(new java.awt.Color(255, 255, 255));\n Employeetxt.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);\n Employeetxt.setText(\"Manage Employee\");\n Employeetxt.setOpaque(true);\n Employeetxt.addMouseListener(new java.awt.event.MouseAdapter() {\n public void mouseClicked(java.awt.event.MouseEvent evt) {\n EmployeetxtMouseClicked(evt);\n }\n public void mouseEntered(java.awt.event.MouseEvent evt) {\n EmployeetxtMouseEntered(evt);\n }\n public void mouseExited(java.awt.event.MouseEvent evt) {\n EmployeetxtMouseExited(evt);\n }\n });\n jPanel1.add(Employeetxt, new org.netbeans.lib.awtextra.AbsoluteConstraints(0, 80, 286, 53));\n\n loanbtn.setBackground(new java.awt.Color(9, 9, 27));\n loanbtn.setFont(new java.awt.Font(\"Tahoma\", 1, 18)); // NOI18N\n loanbtn.setForeground(new java.awt.Color(255, 255, 255));\n loanbtn.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);\n loanbtn.setText(\"Loan\");\n loanbtn.setOpaque(true);\n loanbtn.addMouseMotionListener(new java.awt.event.MouseMotionAdapter() {\n public void mouseDragged(java.awt.event.MouseEvent evt) {\n loanbtnMouseDragged(evt);\n }\n });\n loanbtn.addMouseListener(new java.awt.event.MouseAdapter() {\n public void mouseClicked(java.awt.event.MouseEvent evt) {\n loanbtnMouseClicked(evt);\n }\n public void mouseEntered(java.awt.event.MouseEvent evt) {\n loanbtnMouseEntered(evt);\n }\n public void mouseExited(java.awt.event.MouseEvent evt) {\n loanbtnMouseExited(evt);\n }\n });\n jPanel1.add(loanbtn, new org.netbeans.lib.awtextra.AbsoluteConstraints(0, 220, 286, 53));\n\n salarytxt.setBackground(new java.awt.Color(9, 9, 27));\n salarytxt.setFont(new java.awt.Font(\"Tahoma\", 1, 18)); // NOI18N\n salarytxt.setForeground(new java.awt.Color(255, 255, 255));\n salarytxt.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);\n salarytxt.setText(\"Basic Salary\");\n salarytxt.setOpaque(true);\n salarytxt.addMouseMotionListener(new java.awt.event.MouseMotionAdapter() {\n public void mouseDragged(java.awt.event.MouseEvent evt) {\n salarytxtMouseDragged(evt);\n }\n });\n salarytxt.addMouseListener(new java.awt.event.MouseAdapter() {\n public void mouseClicked(java.awt.event.MouseEvent evt) {\n salarytxtMouseClicked(evt);\n }\n public void mouseEntered(java.awt.event.MouseEvent evt) {\n salarytxtMouseEntered(evt);\n }\n public void mouseExited(java.awt.event.MouseEvent evt) {\n salarytxtMouseExited(evt);\n }\n });\n jPanel1.add(salarytxt, new org.netbeans.lib.awtextra.AbsoluteConstraints(0, 150, 286, 53));\n\n paybtn.setBackground(new java.awt.Color(9, 9, 27));\n paybtn.setFont(new java.awt.Font(\"Tahoma\", 1, 18)); // NOI18N\n paybtn.setForeground(new java.awt.Color(255, 255, 255));\n paybtn.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);\n paybtn.setText(\"PaySlip\");\n paybtn.setOpaque(true);\n paybtn.addMouseListener(new java.awt.event.MouseAdapter() {\n public void mouseClicked(java.awt.event.MouseEvent evt) {\n paybtnMouseClicked(evt);\n }\n public void mouseEntered(java.awt.event.MouseEvent evt) {\n paybtnMouseEntered(evt);\n }\n public void mouseExited(java.awt.event.MouseEvent evt) {\n paybtnMouseExited(evt);\n }\n });\n jPanel1.add(paybtn, new org.netbeans.lib.awtextra.AbsoluteConstraints(0, 310, 286, 53));\n\n empbtn.setBackground(new java.awt.Color(9, 9, 27));\n empbtn.setFont(new java.awt.Font(\"Tahoma\", 1, 18)); // NOI18N\n empbtn.setForeground(new java.awt.Color(255, 255, 255));\n empbtn.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);\n empbtn.setText(\"Employee Report\");\n empbtn.setOpaque(true);\n empbtn.addMouseListener(new java.awt.event.MouseAdapter() {\n public void mouseClicked(java.awt.event.MouseEvent evt) {\n empbtnMouseClicked(evt);\n }\n public void mouseEntered(java.awt.event.MouseEvent evt) {\n empbtnMouseEntered(evt);\n }\n public void mouseExited(java.awt.event.MouseEvent evt) {\n empbtnMouseExited(evt);\n }\n });\n jPanel1.add(empbtn, new org.netbeans.lib.awtextra.AbsoluteConstraints(0, 500, 286, 53));\n\n leavesReportBtn.setBackground(new java.awt.Color(9, 9, 27));\n leavesReportBtn.setFont(new java.awt.Font(\"Tahoma\", 1, 18)); // NOI18N\n leavesReportBtn.setForeground(new java.awt.Color(255, 255, 255));\n leavesReportBtn.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);\n leavesReportBtn.setText(\"Leaves Report\");\n leavesReportBtn.setOpaque(true);\n leavesReportBtn.addMouseListener(new java.awt.event.MouseAdapter() {\n public void mouseClicked(java.awt.event.MouseEvent evt) {\n leavesReportBtnMouseClicked(evt);\n }\n public void mouseEntered(java.awt.event.MouseEvent evt) {\n leavesReportBtnMouseEntered(evt);\n }\n public void mouseExited(java.awt.event.MouseEvent evt) {\n leavesReportBtnMouseExited(evt);\n }\n });\n jPanel1.add(leavesReportBtn, new org.netbeans.lib.awtextra.AbsoluteConstraints(0, 660, 290, 53));\n\n loanreportBtn.setBackground(new java.awt.Color(9, 9, 27));\n loanreportBtn.setFont(new java.awt.Font(\"Tahoma\", 1, 18)); // NOI18N\n loanreportBtn.setForeground(new java.awt.Color(255, 255, 255));\n loanreportBtn.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);\n loanreportBtn.setText(\"Loans Report\");\n loanreportBtn.setOpaque(true);\n loanreportBtn.addMouseListener(new java.awt.event.MouseAdapter() {\n public void mouseClicked(java.awt.event.MouseEvent evt) {\n loanreportBtnMouseClicked(evt);\n }\n public void mouseEntered(java.awt.event.MouseEvent evt) {\n loanreportBtnMouseEntered(evt);\n }\n public void mouseExited(java.awt.event.MouseEvent evt) {\n loanreportBtnMouseExited(evt);\n }\n });\n jPanel1.add(loanreportBtn, new org.netbeans.lib.awtextra.AbsoluteConstraints(0, 590, 290, 53));\n\n paysheetbtn.setBackground(new java.awt.Color(9, 9, 27));\n paysheetbtn.setFont(new java.awt.Font(\"Tahoma\", 1, 18)); // NOI18N\n paysheetbtn.setForeground(new java.awt.Color(255, 255, 255));\n paysheetbtn.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);\n paysheetbtn.setText(\"Pay Sheet\");\n paysheetbtn.setOpaque(true);\n paysheetbtn.addMouseListener(new java.awt.event.MouseAdapter() {\n public void mouseClicked(java.awt.event.MouseEvent evt) {\n paysheetbtnMouseClicked(evt);\n }\n public void mouseEntered(java.awt.event.MouseEvent evt) {\n paysheetbtnMouseEntered(evt);\n }\n public void mouseExited(java.awt.event.MouseEvent evt) {\n paysheetbtnMouseExited(evt);\n }\n });\n jPanel1.add(paysheetbtn, new org.netbeans.lib.awtextra.AbsoluteConstraints(0, 410, 286, 53));\n\n leavesbtn.setBackground(new java.awt.Color(9, 9, 27));\n leavesbtn.setFont(new java.awt.Font(\"Tahoma\", 1, 18)); // NOI18N\n leavesbtn.setForeground(new java.awt.Color(255, 255, 255));\n leavesbtn.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);\n leavesbtn.setText(\"Leaves\");\n leavesbtn.setOpaque(true);\n leavesbtn.addMouseListener(new java.awt.event.MouseAdapter() {\n public void mouseClicked(java.awt.event.MouseEvent evt) {\n leavesbtnMouseClicked(evt);\n }\n public void mouseEntered(java.awt.event.MouseEvent evt) {\n leavesbtnMouseEntered(evt);\n }\n public void mouseExited(java.awt.event.MouseEvent evt) {\n leavesbtnMouseExited(evt);\n }\n });\n jPanel1.add(leavesbtn, new org.netbeans.lib.awtextra.AbsoluteConstraints(0, 760, 286, 53));\n\n attendancebtn.setBackground(new java.awt.Color(0, 102, 102));\n attendancebtn.setFont(new java.awt.Font(\"Tahoma\", 1, 18)); // NOI18N\n attendancebtn.setForeground(new java.awt.Color(255, 255, 255));\n attendancebtn.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);\n attendancebtn.setText(\"Attendance\");\n attendancebtn.setOpaque(true);\n jPanel1.add(attendancebtn, new org.netbeans.lib.awtextra.AbsoluteConstraints(0, 850, 290, 50));\n\n jPanel2.add(jPanel1, new org.netbeans.lib.awtextra.AbsoluteConstraints(0, 0, -1, -1));\n\n javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());\n getContentPane().setLayout(layout);\n layout.setHorizontalGroup(\n layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(layout.createSequentialGroup()\n .addComponent(jPanel2, javax.swing.GroupLayout.PREFERRED_SIZE, 1197, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addGap(0, 0, Short.MAX_VALUE))\n );\n layout.setVerticalGroup(\n layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addComponent(jPanel2, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, 901, Short.MAX_VALUE)\n );\n\n pack();\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n View view = inflater.inflate(R.layout.fragment_insert_sleep, container, false);\n\n Sleeptime = view.findViewById(R.id.txtSleep);\n WakeTime = view.findViewById(R.id.txtWake);\n StartDate = view.findViewById(R.id.txtStart);\n EndDate = view.findViewById(R.id.txtEnd);\n bnSave = view.findViewById(R.id.btnAdd);\n\n bnSave.setOnClickListener(new View.OnClickListener() {\n @Override\n public void onClick(View v) {\n\n String sleeptime = Sleeptime.getText().toString();\n String waketime = WakeTime.getText().toString();\n String startdate = StartDate.getText().toString();\n String enddate = EndDate.getText().toString();\n\n SleepRecord sleep = new SleepRecord();\n sleep.setStartTime(sleeptime);\n sleep.setEndTime(waketime);\n sleep.setStartDate(startdate);\n sleep.setEndDate(enddate);\n\n MainActivity.sleepDatabase.sleepDAO().addRecord(sleep);\n Toast.makeText(getActivity(), \"Inserted successfully\",Toast.LENGTH_SHORT).show();\n\n Sleeptime.setText(\"\");\n WakeTime.setText(\"\");\n StartDate.setText(\"\");\n EndDate.setText(\"\");\n bnSave.setText(\"\");\n }\n });\n\n\n return view;\n\n\n }", "@FXML\r\n\tprivate void newEmployee(ActionEvent event) {\r\n\t\tnewEmployee = true;\r\n\t\tputEditables(true);\r\n\t\teraseFieldsContent();\r\n\t\tbtEditar.setDisable(true);\r\n\t\tbtGuardar.setDisable(false);\r\n\t\tbtDelete.setDisable(true);\r\n\t}", "@RequestMapping(method = RequestMethod.GET)\n\tpublic String setupForm(Model model) \n\t{\n\t\tEmployeeEntity employeeVO = new EmployeeEntity();\n\t\tmodel.addAttribute(\"employee\", employeeVO);\n\t\treturn \"listEmployeeView\";\n\t}", "public void setCreateEmpId(Integer createEmpId) {\n this.createEmpId = createEmpId;\n }", "@RequestMapping(value = \"/employee\", method = RequestMethod.POST, produces = MediaType.APPLICATION_JSON_VALUE)\n\t@Timed\n\tpublic ResponseEntity<?> saveEmployee(@Valid @RequestBody EmployeeDTO employeeDTO, HttpServletRequest request) {\n\t\tlog.info(\"Inside the saveEmployee -\" + employeeDTO);\n\t\tlog.info(\"Inside Save employee\"+employeeDTO.getManagerId());\n\t\tlong userId = SecurityUtils.getCurrentUserId();\n\t\tlog.info(\"save Employee call - userId \"+userId);\n\t\temployeeDTO.setUserId(userId);\n\n\t\ttry {\n\t\t\tEmployeeDTO employeeDto = employeeService.createEmployeeInformation(employeeDTO);\n\n\t\t\t/*\n\t\t\tif(employeeDto.isCreateUser()) {\n\t\t\t\tUserDTO userDto = new UserDTO();\n\t\t\t\tuserDto.setLogin(employeeDto.getEmpId());\n\t\t\t\tuserDto.setFirstName(employeeDto.getName());\n\t\t\t\tuserDto.setLastName(employeeDto.getLastName());\n\t\t\t\tuserDto.setEmployeeId(employeeDto.getId());\n\t\t\t\tuserDto.setEmployeeName(employeeDto.getName());\n\t\t\t\tuserService.createUserInformation(userDto);\n\t\t\t}\n\t\t\t*/\n\n\t\t}catch(Exception e) {\n\t\t\tthrow new TimesheetException(e, employeeDTO);\n\t\t}\n\t\treturn new ResponseEntity<>(HttpStatus.CREATED);\n\t}", "@RequestMapping(value=\"/addEmployeeSubmit\", method=RequestMethod.POST)\n /* Add submitted new employee details to database, and then redirect to listEmployees */\n public String addEmployeeSubmit(Employee employee) {\n employeeservice.saveEmployee(employee);\n\n return \"redirect:/employee/listEmployees\";\n }", "@PostMapping(\"/saveEmployee\")\n\tpublic String saveEmployee(@ModelAttribute(\"employee\") Employees employee) {\n\t\tservice.saveEmployee(employee);\n\t\treturn \"redirect:/employees\";\n\t}", "@PostMapping(\"/saveEmployee\")\r\n\tpublic String saveEmployee(@ModelAttribute(\"employee\") Employee employee) {\n\t\tempServ.saveEmployee(employee);\r\n\t\treturn \"redirect:/\";\r\n\t}", "public void setCreateEmpId(String createEmpId) {\n this.createEmpId = createEmpId;\n }", "public void savePatientDetails(View view){\r\n\t\tsaveToSQLite();\r\n createCalendarEntry();\r\n\t\tToast.makeText(this, \"Saved. Reminder created.\", Toast.LENGTH_SHORT).show();\r\n\t}", "private void addNewAssessment() {\n //instantiate converters object for LocalDate conversion\n Converters c = new Converters();\n\n //get UI fields\n int courseId = thisCourseId;\n String title = editTextAssessmentTitle.getText().toString();\n LocalDate dueDate = c.stringToLocalDate(textViewAssessmentDueDate.getText().toString());\n String status = editTextAssessmentStatus.getText().toString();\n String note = editTextAssessmentNote.getText().toString();\n String type = editTextAssessmentType.getText().toString();\n\n if (title.trim().isEmpty() || dueDate == null || status.trim().isEmpty() || type.trim().isEmpty()) {\n Toast.makeText(this, \"Please complete all fields\", Toast.LENGTH_SHORT).show();\n return;\n }\n\n //instantiate Assessment object\n Assessment assessment = new Assessment(courseId, title, dueDate, status, note, type);\n\n //add new assessment\n addEditAssessmentViewModel.insert(assessment);\n\n //notification\n Long longDue = c.localDateToMilliseconds(dueDate);\n makeAlarm(title+\" is due today.\", longDue);\n\n finish();\n }", "public void createEmployee(Employee newEmployee) {\n\t\tif(false == this.employee.contains(newEmployee)) {\n\t\t\tthis.employee.add(newEmployee);\n\t\t}\n\t}", "public String addEmployee() {\n\t\t\t//logger.info(\"addEmployee method called\");\n\t\t\t//userGroupBO.save(userGroup);;\n\t\t\treturn SUCCESS;\n\t\t}", "public void fillForm(Event e){\n // name\n eventName.setText(e.getEventname().toString());\n // room\n room.setText(e.getRoom() + \"\");\n // dates\n Calendar from = extractDate(e.getFromDate());\n writeDateToButton(from, R.id.newEvent_button_from);\n Calendar to = extractDate(e.getToDate());\n writeDateToButton(to, R.id.newEvent_button_to);\n Calendar fromTime = null;\n Calendar toTime = null;\n if(e.getFromTime() == -1)\n wholeDay.setChecked(true);\n else {\n fromTime = extractTime(e.getFromTime());\n writeDateToButton(fromTime, R.id.newEvent_button_from_hour);\n toTime = extractTime(e.getToTime());\n writeDateToButton(toTime, R.id.newEvent_button_to_hour);\n }\n // notification\n spinner.setSelection(e.getNotificiation());\n // patient\n PatientAdapter pa = new PatientAdapter(this);\n Patient p = pa.getPatientById(e.getPatient());\n patient_id = p.getPatient_id();\n patient.setText(p.getName());\n // desc\n desc.setText(e.getDescription().toString());\n // putting time and date togehter\n this.fromDate = Calendar.getInstance();\n this.toDate = Calendar.getInstance();\n this.fromDate.set(from.get(Calendar.YEAR), from.get(Calendar.MONTH), from.get(Calendar.DAY_OF_MONTH),\n (fromTime != null ? fromTime.get(Calendar.HOUR_OF_DAY) : 0),\n (fromTime != null ? fromTime.get(Calendar.MINUTE) : 0));\n this.toDate.set(to.get(Calendar.YEAR), to.get(Calendar.MONTH), to.get(Calendar.DAY_OF_MONTH),\n (toTime != null ? toTime.get(Calendar.HOUR_OF_DAY) : 0),\n (toTime != null ? toTime.get(Calendar.MINUTE) : 0));\n startYear = fromDate.get(Calendar.YEAR);\n startMonth = fromDate.get(Calendar.MONTH);\n startDay = fromDate.get(Calendar.DAY_OF_MONTH);\n startHour = fromDate.get(Calendar.HOUR_OF_DAY);\n }", "@PostMapping(\"/employees\")\n\tpublic Employee addEmployee(@RequestBody Employee theEmployee) {\n\t\t theEmployee.setId(0);\n\t\t employeeService.save(theEmployee);\n\t\t \n\t return theEmployee;\n\t}", "@PostMapping(\"/save\")\n\tpublic ResponseEntity<String> createEmployee(@RequestBody Employee employee) {\n\t\tInteger id = service.saveEmployee(employee);\n\t\tString message = \"Employee '\" + id + \"' Created!\";\n\t\treturn new ResponseEntity<String>(message, HttpStatus.CREATED); // 201\n\t}", "@Test\n\tpublic void testingAddNewEmployee() {\n\t\t\n\t\tdriver.manage().timeouts().implicitlyWait(5, TimeUnit.SECONDS);\n\t\t\n\t\tthis.gettingUserAndPass();\n\t\t\n\t\tthis.sendingKeys();\n\t\t\n\t\tdriver.findElement(By.id(\"sn_staff\")).click();\n\t\tdriver.findElement(By.id(\"act_primary\")).click();\n\t\t\n\t\tdriver.findElement(By.id(\"_asf1\")).sendKeys(\"FirstName\");\n\t\tdriver.findElement(By.id(\"_asl1\")).sendKeys(\"LastName\");\n\t\tdriver.findElement(By.id(\"_ase1\")).sendKeys(\"emailAddress\");\n\t\t\n\t\tdriver.findElement(By.id(\"_as_save_multiple\")).click();\n\t\t\n\t\tWebElement newEmployee = driver.findElement(By.linkText(\"FirstName LastName\"));\n\t\tassertNotNull(newEmployee);\n\t\t\n\t}", "@RequestMapping(value = \"/absensi/tambah/submit\", method = RequestMethod.POST)\n public String tambahSubmit (@NotNull Authentication auth, Model model, @ModelAttribute(\"newAbsen\") AbsenModel newAbsen)\n {\n UserWeb penggunaLogin = (UserWeb)auth.getPrincipal();\n if (penggunaLogin.getUsername().equalsIgnoreCase(null)) {\n return \"redirect:/login\";\n }\n else if (penggunaDAO.selectPenggunaByUsername(penggunaLogin.getUsername())==null) {\n return \"redirect:/logout\";\n }\n else if (!penggunaLogin.getRole().contains(\"ROLE_EMPLOYEE\")) {\n return \"redirect:/\";\n }\n //end of check\n\n int id_employee = absenDAO.selectIdByUsername(penggunaLogin.getUsername());\n newAbsen.setId_employee(id_employee);\n if(absenDAO.cekAbsen(newAbsen) == null){\n absenDAO.addAbsen(newAbsen);\n return \"redirect:/absen/kelola?success=menambah\";\n } else {\n model.addAttribute(\"message\", \"Absensi pada tanggal \" +newAbsen.getTanggal_absen() + \" gagal dibuat\");\n return \"redirect:/absen/kelola?gagal=menambah\";\n }\n\n }", "@RequestMapping(\"updat\")\r\n\tpublic String update(Model m) \r\n\t{\n\t\tm.addAttribute(\"update1\",new Employee());\r\n\t\treturn \"update\";//register.jsp==form action=register\r\n\t}", "private void createNewUser() {\n ContentValues contentValues = new ContentValues();\n contentValues.put(DataBaseConstants.Constants_TBL_PATIENTS.GENDER, getSelectedGender());\n contentValues.put(DataBaseConstants.Constants_TBL_PATIENTS.PIN, edtConfirmPin.getText().toString().trim());\n contentValues.put(DataBaseConstants.Constants_TBL_PATIENTS.LAST_NAME, edtLastName.getText().toString().trim());\n contentValues.put(DataBaseConstants.Constants_TBL_PATIENTS.FIRST_NAME, edtFirstName.getText().toString().trim());\n contentValues.put(DataBaseConstants.Constants_TBL_PATIENTS.STATUS, spnStatus.getSelectedItem().toString().trim());\n contentValues.put(DataBaseConstants.Constants_TBL_PATIENTS.DATE_OF_BIRTH, edtDateOfBirth.getText().toString().trim());\n contentValues.put(DataBaseConstants.Constants_TBL_PATIENTS.BLOOD_GROUP, spnBloodGroup.getSelectedItem().toString().trim());\n contentValues.put(DataBaseConstants.Constants_TBL_PATIENTS.IS_DELETED, \"N\");\n contentValues.put(DataBaseConstants.Constants_TBL_PATIENTS.MOBILE_NUMBER, edtMobileNumber.getText().toString());\n contentValues.put(DataBaseConstants.Constants_TBL_CATEGORIES.CREATE_DATE, Utils.getCurrentDateTime(Utils.DD_MM_YYYY));\n\n dataBaseHelper.saveToLocalTable(DataBaseConstants.TableNames.TBL_PATIENTS, contentValues);\n context.startActivity(new Intent(CreatePinActivity.this, LoginActivity.class));\n }", "public void createAppointment(View v) {\n checkFields();\n\n // grab the info in the fields and turn it into usable stuff\n int mon = parseInt(month.getText().toString());\n int d = Integer.parseInt(day.getText().toString());\n int y = Integer.parseInt(year.getText().toString());\n int h = Integer.parseInt(hour.getText().toString());\n int min = Integer.parseInt(minute.getText().toString());\n String AorP = AMorPM.getText().toString();\n String p = place.getText().toString();\n\n\n // all of the fields have been checked now. Create a new appointment\n //Appointment apt = new Appointment(d, mon, y, h, min, AorP, p);\n Appointment apt = new Appointment();\n apt.setDay(d);\n apt.setMonth(mon);\n apt.setYear(y);\n apt.setHour(h);\n apt.setMinute(min);\n apt.setAmOrPm(AorP);\n apt.setPlace(p);\n apt.setConfirmed(false);\n apt.setTaken(false);\n\n // push it onto the database\n DatabaseReference aptsRef = ref.child(\"appointmentList\");\n aptsRef.push().setValue(apt);\n\n // send out a toast signalling that we've successfully created an appointment\n Toast.makeText(getApplicationContext(), \"Appointment successfully created\", Toast.LENGTH_SHORT).show();\n\n // now send the user back to the main activity -> with their membership number\n Intent intent = new Intent(this, MainActivity.class);\n intent.putExtra(MESSAGE, memberNumber);\n startActivity(intent);\n }", "@RequestMapping(\"/{incidentId}/audit/create\")\t\n \tpublic String createAudit(@PathVariable Long incidentId, Model model) {\n \t\tmodel.addAttribute(new AuditForm());\n \t\treturn \"incident/audit/create\";\n \t}", "@PostMapping(\"/employee\")\n\tpublic Employee createEmployee(@RequestBody Employee employee) {\n\t\treturn emprepo.save(employee);\n\t}", "public static EventAttendance createUpdatedEntity(EntityManager em) {\n EventAttendance eventAttendance = new EventAttendance()\n .attendanceDate(UPDATED_ATTENDANCE_DATE);\n return eventAttendance;\n }", "private void addEmployee(HttpServletRequest request, HttpServletResponse response) throws Exception {\n\t\tString firstName = request.getParameter(\"firstName\");\r\n\t\tString lastName = request.getParameter(\"lastName\");\r\n\t\tString gender = request.getParameter(\"gender\");\r\n\t\tint age = Integer.parseInt(request.getParameter(\"age\"));\r\n\t\tString email = request.getParameter(\"email\");\t\t\r\n\t\t\r\n\t\t// create a new employee object\r\n\t\tEmployee theEmployee = new Employee (firstName, lastName,gender,age, email);\r\n\t\t\r\n\t\t// add the employee to the database\r\n\t\temployeeDAO.addEmployee(theEmployee);\r\n\t\t\t\t\r\n\t\t// send back to main page (the student list)\r\n\t\tlistEmployees(request, response);\r\n\t}", "public static AssessmentCreationForm openFillCreationForm(Assessment assm) {\n openCreationSearchForm(Roles.STAFF, WingsTopMenu.WingsStaffMenuItem.P_ASSESSMENTS, Popup.Create);\n\n Logger.getInstance().info(\"Fill out the required fields with valid data\");\n AssessmentCreationForm creationForm = new AssessmentCreationForm();\n creationForm.fillAssessmentInformation(new User(Roles.STAFF), assm);\n\n return new AssessmentCreationForm();\n }", "@PostMapping(\"/createAccount\")\n public ModelAndView createNewAccount(AccountCreateDTO createDTO){\n ModelAndView modelAndView = new ModelAndView();\n\n accountService.createAccount(createDTO);\n modelAndView.addObject(\"successMessage\", \"Account has been created\");\n modelAndView.setViewName(\"accountPage\");\n\n return modelAndView;\n }", "@PostMapping(\"/addFormation/{eid}\")\n\t\tpublic Formation createFormation(@PathVariable(value = \"eid\") Long Id, @Valid @RequestBody Formation formationDetails) {\n\n\t\t \n\t\t Formation me=new Formation();\n\t\t\t Domaine domaine = Domainev.findById(Id).orElseThrow(null);\n\t\t\t \n\t\t\t \n\t\t\t\t me.setDom(domaine);\n\t\t\t me.setTitre(formationDetails.getTitre());\n\t\t\t me.setAnnee(formationDetails.getAnnee());\n\t\t\t me.setNb_session(formationDetails.getNb_session());\n\t\t\t me.setDuree(formationDetails.getDuree());\n\t\t\t me.setBudget(formationDetails.getBudget());\n\t\t\t me.setTypeF(formationDetails.getTypeF());\n\t\t\t \n\t\t\t \n\n\t\t\t //User affecterUser= \n\t\t\t return Formationv.save(me);\n\t\t\t//return affecterUser;\n\t\t\n\n\t\t}", "@PostMapping(\"/employee\")\r\n\tpublic Employee createEmployee(@RequestBody Employee emp)\r\n\t{\r\n\t\treturn empdao.save(emp);\t\r\n\t}", "@Override\n public void onClick(View v) {\n TeacherClass t = new TeacherClass();\n //grab text from first name text input and apply to teacher first name\n t.firstName = txtFirstName.getText().toString().trim();\n //grab text from last name text input and apply to teacher last name\n t.lastName = txtLastName.getText().toString().trim();\n //grab text from username text input and and apply to teacher username\n t.username = txtUsername.getText().toString().trim();\n //grab text from password text input and apply to teacher password\n t.password = txtPassword.getText().toString().trim();\n //grab text from password confirm text input and create string variable\n String confirm = txtConfirm.getText().toString().trim();\n t.daycareID = adminDaycare; //admin can only create a user within their own daycare\n //isAdmin - set to true if admin radio button is selected\n if(admin.isChecked()) {\n t.isAdmin = true;\n }\n //verify that all information has been provided and is correct\n if(VerifyInfo(t.firstName, t.lastName, t.username, t.password, confirm)) {\n PasswordHash hash = new PasswordHash();\n t.password = hash.generatedPassword(t.password);\n\n InsertTeacher(t.firstName, t.lastName, t.username, t.password, t.daycareID, t.isAdmin);\n }\n }", "@PostMapping(\"/add_employee\")\n public ResponseEntity<?> createEmployee(@Valid @RequestBody Employee employee){\n\n employeeService.add_employee(employee);\n\n return new ResponseEntity<>(\"Employee was added successfully!\", HttpStatus.OK);\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n View view = inflater.inflate(R.layout.fragment_add_user, container, false);\n name = view.findViewById(R.id.name);\n date = view.findViewById(R.id.date);\n time = view.findViewById(R.id.time);\n description = view.findViewById(R.id.description);\n addevent = view.findViewById(R.id.addevent);\n addevent.setOnClickListener(new View.OnClickListener() {\n @Override\n public void onClick(View view) {\n String Name = name.getText().toString();\n String Date = date.getText().toString();\n String Time= time.getText().toString();\n String Description= description.getText().toString();\n\n Event event = new Event();\n event.setName(Name);\n event.setTime(Time);\n event.setDescription(Description);\n event.setDate(Date);\n Main2Activity.eventDatabase.myDao().addEvent(event);\n Toast.makeText(getActivity(), \"Event added\", Toast.LENGTH_SHORT).show();\n event.setName(\"\");\n event.setTime(\"\");\n event.setDate(\"\");\n event.setDescription(\"\");\n\n }\n });\n\n return view;\n }", "@RequestMapping(method=RequestMethod.GET)\n\tpublic String intializeForm(Model model) {\t\t\n\t\tlog.info(\"GET method is called to initialize the registration form\");\n\t\tEmployeeManagerRemote employeeManager = null;\n\t\tEmployeeRegistrationForm employeeRegistrationForm = new EmployeeRegistrationForm();\n\t\tList<Supervisor> supervisors = null;\n\t\ttry{\n\t\t\temployeeManager = (EmployeeManagerRemote) ApplicationUtil.getEjbReference(emplManagerRef);\n\t\t\tsupervisors = employeeManager.getAllSupervisors();\n\t\t\t\n\t\t} catch (Exception e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t\tmodel.addAttribute(\"supervisors\", supervisors);\n\t\tmodel.addAttribute(\"employeeRegistrationForm\", employeeRegistrationForm);\n\t\t\n\t\treturn FORMVIEW;\n\t}", "@RequestMapping(value=\"/reservations/form\", method=RequestMethod.GET)\r\n\tpublic String getAdminReservationForm(Model model) {\r\n\t\tmodel.addAttribute(\"onDate\", new Reservation());\r\n\t\treturn \"reservationsForm\";\r\n\t}", "@PostMapping(\"/appointments\")\n @ResponseStatus(HttpStatus.CREATED)\n Appointment createAppointment(@Valid @RequestBody Appointment newApp) {\n\n Appointment appointment = modelMapper.map(newApp, Appointment.class);\n appointment = appointmentService.saveAppointment(appointment);\n\n return appointment;\n }", "@RequestMapping(value = { \"/new\" }, method = RequestMethod.GET)\r\n public String newuser(ModelMap model) {\r\n User user = new User();\r\n model.addAttribute(\"user\", user);\r\n model.addAttribute(\"edit\", false);\r\n return \"registration\";\r\n\r\n }", "@Override\n\tpublic void actionPerformed(ActionEvent e) {\n\t\tString date = AppDateField.getText();\n\t\tString Time = AppTimeField.getText();\t\n\t\tString Name = AppPatNameField.getText();\n\t\tString Surname = AppPatSurnameField.getText();\n\t\tint Id = Integer.parseInt(AppPatIdField.getText());\n\t\tString Doctor = AppDocNameField.getText();\n\t\tString Service = (String) SelectTask.getSelectedItem();\n\t\t\n\t\tDBH db = new DBH();\n\t\t\n\t\tString sql = \"INSERT INTO `Narnia_Hospital`.`Appointments` (`Appointment_Date`, `Appointment_Time`, `AppPat_Name`, `AppPat_Surname`, `AppPatId`, `AppDoctor`, `AppService`) VALUES ('\"+date+\"','\"+Time+\"','\"+Name+\"','\"+Surname+\"','\"+Id+\"','\"+Doctor+\"','\"+Service+\"')\"; \n\t\t\n\t\t\n\t\tResultSet rs = null;\n\t\t\n\t\ttry{\n\t\t rs = db.executeCall(sql);\n \t\t\n\t\t while(rs.next()){\n\t\t\t \n\t\t\t Appointment A1 = new Appointment();\n\t\t\t \n\t\t\t A1.setAppDate (date);\n\t\t\t A1.setAppTime(Time);\n\t\t\t A1.setPatientName(Name);\n\t\t\t A1.setPatientSurname(Surname);\n\t\t\t A1.setPatId(Id);\n\t\t\t A1.setDoctorName(Doctor);\n\t\t\t A1.setServiceRequired(Service);\n\t\t\t \n\t\t\t \n\t\t\t \t\n\t\t\t\t }\n\t\t\t \n\t\t \n\t\t \n\t\t \n\t\t}catch (Exception ex){}\n\t\t\n\t\t//Offers the option to create a new one or leave this screen.\n\t\t\n\t\tJOptionPane.showMessageDialog(this, \"Appointment Registered!\");\n\t\t\n\t\t int n = JOptionPane.showConfirmDialog(this,\"Do you want to add another appointment?\", \"Message Selected\", JOptionPane.YES_NO_OPTION);\n\t\t\t\n\t\t if (n == 0){ \n\t\t\t this.setVisible(false);\n\t\t\t new NewAppointment();\n\t\t\t\n\t\t} else if (n == 1){\n\t\t\t this.setVisible(false);\n\t\t\t new SecretaryScreen();\n\t\t}\n\t\t\n\t}", "@Override\n\tpublic Employee create(Employee emp) {\n\t\tlog.debug(\"Welcome to logging\");\n\t\tSystem.out.println(\"Server logs \");\n\t\temployeeDAO.create(emp);\n\t\treturn null;\n\t}", "@PostMapping(\"/createEmployee\")\n\tpublic Employee createEmployee(@RequestBody Employee employee) {\n\t\treturn repo.save(employee);\n\t}", "public void createEvent(View view){\n showDatePickerDialog();\n }", "@RequestMapping(value = \"/employee\", method = RequestMethod.POST)\r\n\tpublic Employee addEmployee(@RequestBody Employee employee) throws EmployeeMaintainceException {\r\n\r\n\t\ttry {\r\n\t\t\treturn eService.addEmp(employee);\r\n\t\t}\r\n\r\n\t\tcatch (Exception e) {\r\n\t\t\tthrow new EmployeeMaintainceException(400, e.getMessage());\r\n\t\t}\r\n\r\n\t}", "public void createNewExpense(View view) {\n EditText newExpenseNameInput = (EditText) findViewById(R.id.newExpenseName);\n EditText newDateInput = (EditText) findViewById(R.id.addExpenseDateEditText);\n Spinner newWhoPaidSpinner = (Spinner) findViewById(R.id.addExpensePayerSpinner);\n\n String newExpenseName = newExpenseNameInput.getText().toString();\n Long newAmount = totalDebt;\n Date newDate = null;\n try {\n newDate = new SimpleDateFormat(\"dd/MM/yyyy\").parse(newDateInput.getText().toString());\n } catch (ParseException e) {\n e.printStackTrace();\n }\n String newWhoPaid = newWhoPaidSpinner.getSelectedItem().toString();\n List<String> newPayees = new ArrayList<String>();\n\n int payeeListItemHoldersSize = payeeListItemHolders.size();\n List<Long> newOwedAmounts = new ArrayList<Long>();\n\n for (int i = 0; i < payeeListItemHoldersSize; i++) {\n if (payeeListItemHolders.get(i).getCheckBox().isChecked()) {\n newPayees.add(payeeListItemHolders.get(i).getCheckBox().getText().toString());\n newOwedAmounts.add(payeeListItemHolders.get(i).getDebt());\n }\n }\n\n Expense newExpense = new Expense(newExpenseName, newAmount, newDate, newWhoPaid, newPayees, newOwedAmounts, group);\n\n try {\n newExpense.save();\n } catch (com.parse.ParseException e) {\n e.printStackTrace();\n }\n\n // finish activity\n Intent intent = setUpBackIntent();\n setResult(RESULT_OK, intent);\n finish();\n }", "public Employee createNewEmployee(String name) {\n Employee newEmployee = new Employee(DumbDB.employeeCounter++, name, NO_DEPARTMENT_ID);\n getAllEmployees().add(newEmployee);\n return newEmployee;\n }", "@RequestMapping(value = BASE_URL_API, method=RequestMethod.POST)\r\n public ResponseEntity<?> addNewEmployee(@RequestBody EmployeeVO newEmployeeVO) {\r\n\r\n checkLogin();\r\n\r\n EmployeeVO employeeVO = employeeService.addEmployee(newEmployeeVO);\r\n\r\n return new ResponseEntity<>(employeeVO, HttpStatus.CREATED);\r\n }", "@Override\r\n\tpublic void post(Employee employee) {\n\t\t empdao.save(employee);\r\n\t}", "Employee() {\n\t}", "public void actionPerformed(ActionEvent event) {\n try {\n anEmplist.add(new Manager(nameField.getText(),\n Double.parseDouble(salaryField.getText()),\n Double.parseDouble(bonusField.getText())));\n System.out.println(\"New manager successfully added.\");\n frame.dispose();\n }\n catch (Exception e) {\n System.out.println(\"Unable to add Employee. Please make\"\n + \" sure that all fields are filled out with valid\"\n + \" input.\");\n frame.dispose();\n }\n }", "public void popupAdd() {\n builder = new AlertDialog.Builder(getView().getContext());\n View views = getLayoutInflater().inflate(R.layout.departmentpopup, (ViewGroup) null);\n DepartmentName = (EditText) views.findViewById(R.id.department_name);\n DepartmentId = (EditText) views.findViewById(R.id.department_id);\n pbar =views.findViewById(R.id.departmentProgress);\n Button button =views.findViewById(R.id.save_depart);\n saveButton = button;\n button.setOnClickListener(new View.OnClickListener() {\n public void onClick(View view) {\n addDeparatments();\n }\n });\n builder.setView(views);\n AlertDialog create =builder.create();\n dialog = create;\n create.show();\n }", "public EditAppointment() {\r\n\t\tsuper();\r\n\t}", "@RequestMapping(value = \"/createentry\", method = RequestMethod.GET)\n\tpublic String navigateCreateEntry(Model model){\n\t\tmodel.addAttribute(\"entry\", new Entry());\t\n\t\treturn \"entry/createEntry\";\n\t}", "@RequestMapping(value = { \"/newuser\" }, method = RequestMethod.GET)\n\t@PreAuthorize(\"hasRole('ADMIN')\")\n\tpublic String newUser(ModelMap model) {\n\t\tUser user = new User();\n\t\tmodel.addAttribute(\"user\", user);\n\t\tmodel.addAttribute(\"edit\", false);\n\t\treturn \"registration\";\n\t}", "@RequestMapping(value = \"/report.create\", method = RequestMethod.GET)\n @ResponseBody public ModelAndView newreportForm(HttpSession session) throws Exception {\n ModelAndView mav = new ModelAndView();\n mav.setViewName(\"/sysAdmin/reports/details\");\n\n //Create a new blank provider.\n reports report = new reports();\n \n mav.addObject(\"btnValue\", \"Create\");\n mav.addObject(\"reportdetails\", report);\n\n return mav;\n }", "private void createBtnActionPerformed(java.awt.event.ActionEvent evt) {\n\n staff.setName(regName.getText());\n staff.setID(regID.getText());\n staff.setPassword(regPwd.getText());\n staff.setPosition(regPos.getSelectedItem().toString());\n staff.setGender(regGender.getSelectedItem().toString());\n staff.setEmail(regEmail.getText());\n staff.setPhoneNo(regPhone.getText());\n staff.addStaff();\n if (staff.getPosition().equals(\"Vet\")) {\n Vet vet = new Vet();\n vet.setExpertise(regExp.getSelectedItem().toString());\n vet.setExpertise_2(regExp2.getSelectedItem().toString());\n vet.addExpertise(staff.getID());\n }\n JOptionPane.showMessageDialog(null, \"User added to database\");\n updateJTable();\n }", "@Override\r\n\tpublic String AddEmployeeDetails(EmployeeEntity employee) throws CustomException {\n\t\tString strMessage=\"\";\r\n\t\trepository.save(employee);\r\n\t\tstrMessage=\"Employee data has been saved\";\r\n\t\treturn strMessage;\r\n\t}", "@GetMapping ( \"/patient/appointmentRequest/manageAppointmentRequest\" )\r\n @PreAuthorize ( \"hasRole('ROLE_PATIENT')\" )\r\n public String requestAppointmentForm ( final Model model ) {\r\n return \"/patient/appointmentRequest/manageAppointmentRequest\";\r\n }", "private void saveEmployee(Employee employee) {\n ContentValues contentValues = new ContentValues();\n contentValues.put(ReportContract.EmployeeEntry.COLUMN_KEY, employee.getKey());\n contentValues.put(ReportContract.EmployeeEntry.COLUMN_VALUE, employee.getValue());\n\n getContext().getContentResolver().insert(\n ReportContract.EmployeeEntry.CONTENT_URI,\n contentValues\n );\n\n }", "@Override\n\tpublic void add(Employee employee) {\n\t\temployeeDao.save(employee);\t\t\n\t}" ]
[ "0.647998", "0.63514596", "0.63096774", "0.59823227", "0.5918745", "0.59020025", "0.58612764", "0.58434165", "0.5825844", "0.58092445", "0.58088416", "0.57705945", "0.5728767", "0.5692056", "0.5602168", "0.5533711", "0.55300033", "0.55194235", "0.54992247", "0.54516876", "0.54389215", "0.54028267", "0.53940225", "0.5384834", "0.537599", "0.53602296", "0.5359049", "0.5355892", "0.5353261", "0.5340971", "0.5319314", "0.5314909", "0.53090125", "0.53063464", "0.53016496", "0.5270429", "0.5265298", "0.52595234", "0.52544886", "0.5244766", "0.5233547", "0.5232165", "0.52124745", "0.51974934", "0.5186752", "0.5186526", "0.5183534", "0.51817226", "0.5175997", "0.5169546", "0.5167833", "0.51622623", "0.51573825", "0.51569545", "0.5155164", "0.51505864", "0.5133204", "0.5121879", "0.5095159", "0.5079258", "0.5073556", "0.5072315", "0.5070462", "0.50664693", "0.5059857", "0.50590014", "0.50551367", "0.50365394", "0.50294864", "0.5024401", "0.5021485", "0.5017758", "0.5001117", "0.49936342", "0.49929088", "0.49928907", "0.49895358", "0.49886847", "0.49879578", "0.4984213", "0.49835768", "0.49815264", "0.4975011", "0.49682906", "0.49678823", "0.4958725", "0.49503186", "0.49421996", "0.49396947", "0.49309278", "0.49308378", "0.4923405", "0.49202546", "0.49181238", "0.4900447", "0.48912328", "0.4890364", "0.4886254", "0.48844877", "0.48836663" ]
0.6817602
0
This method is called from within the constructor to initialize the form. WARNING: Do NOT modify this code. The content of this method is always regenerated by the Form Editor.
@SuppressWarnings("unchecked") // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents private void initComponents() { jPanel1 = new javax.swing.JPanel(); btMark = new javax.swing.JButton(); jLabel1 = new javax.swing.JLabel(); btsearch = new javax.swing.JButton(); jLabel2 = new javax.swing.JLabel(); btHalf = new javax.swing.JButton(); jLabel4 = new javax.swing.JLabel(); btSearchHalf = new javax.swing.JButton(); jLabel5 = new javax.swing.JLabel(); btViewHalf = new javax.swing.JButton(); jLabel6 = new javax.swing.JLabel(); setOpaque(false); jPanel1.setMaximumSize(new java.awt.Dimension(880, 601)); jPanel1.setMinimumSize(new java.awt.Dimension(880, 601)); jPanel1.setOpaque(false); jPanel1.setPreferredSize(new java.awt.Dimension(880, 601)); jPanel1.setLayout(new org.netbeans.lib.awtextra.AbsoluteLayout()); btMark.setBackground(new java.awt.Color(51, 204, 255)); btMark.setIcon(new javax.swing.ImageIcon(getClass().getResource("/com/smsc/view/photos/mark attendance.png"))); // NOI18N btMark.setBorder(new javax.swing.border.LineBorder(new java.awt.Color(0, 102, 153), 2, true)); btMark.setBorderPainted(false); btMark.setContentAreaFilled(false); btMark.setCursor(new java.awt.Cursor(java.awt.Cursor.HAND_CURSOR)); btMark.addMouseListener(new java.awt.event.MouseAdapter() { public void mouseClicked(java.awt.event.MouseEvent evt) { btMarkMouseClicked(evt); } public void mouseEntered(java.awt.event.MouseEvent evt) { btMarkMouseEntered(evt); } public void mouseExited(java.awt.event.MouseEvent evt) { btMarkMouseExited(evt); } }); jPanel1.add(btMark, new org.netbeans.lib.awtextra.AbsoluteConstraints(10, 10, 260, 250)); jLabel1.setFont(new java.awt.Font("Times New Roman", 1, 18)); // NOI18N jLabel1.setHorizontalAlignment(javax.swing.SwingConstants.CENTER); jLabel1.setText("Mark Employee Attendance"); jPanel1.add(jLabel1, new org.netbeans.lib.awtextra.AbsoluteConstraints(30, 260, -1, -1)); btsearch.setBackground(new java.awt.Color(51, 204, 255)); btsearch.setIcon(new javax.swing.ImageIcon(getClass().getResource("/com/smsc/view/photos/search attendance.png"))); // NOI18N btsearch.setBorder(new javax.swing.border.LineBorder(new java.awt.Color(0, 102, 153), 2, true)); btsearch.setBorderPainted(false); btsearch.setContentAreaFilled(false); btsearch.setCursor(new java.awt.Cursor(java.awt.Cursor.HAND_CURSOR)); btsearch.addMouseListener(new java.awt.event.MouseAdapter() { public void mouseClicked(java.awt.event.MouseEvent evt) { btsearchMouseClicked(evt); } public void mouseEntered(java.awt.event.MouseEvent evt) { btsearchMouseEntered(evt); } public void mouseExited(java.awt.event.MouseEvent evt) { btsearchMouseExited(evt); } }); jPanel1.add(btsearch, new org.netbeans.lib.awtextra.AbsoluteConstraints(285, 10, 260, 250)); jLabel2.setFont(new java.awt.Font("Times New Roman", 1, 18)); // NOI18N jLabel2.setHorizontalAlignment(javax.swing.SwingConstants.CENTER); jLabel2.setText("Search Employee Attendance"); jPanel1.add(jLabel2, new org.netbeans.lib.awtextra.AbsoluteConstraints(310, 260, -1, -1)); btHalf.setBackground(new java.awt.Color(51, 204, 255)); btHalf.setBorder(new javax.swing.border.LineBorder(new java.awt.Color(0, 102, 153), 2, true)); btHalf.setBorderPainted(false); btHalf.setContentAreaFilled(false); btHalf.setCursor(new java.awt.Cursor(java.awt.Cursor.HAND_CURSOR)); btHalf.addMouseListener(new java.awt.event.MouseAdapter() { public void mouseEntered(java.awt.event.MouseEvent evt) { btHalfMouseEntered(evt); } public void mouseExited(java.awt.event.MouseEvent evt) { btHalfMouseExited(evt); } }); jPanel1.add(btHalf, new org.netbeans.lib.awtextra.AbsoluteConstraints(10, 290, 260, 250)); jLabel4.setFont(new java.awt.Font("Times New Roman", 1, 18)); // NOI18N jLabel4.setHorizontalAlignment(javax.swing.SwingConstants.CENTER); jLabel4.setText("Manage Employee Halfday Leaves"); jPanel1.add(jLabel4, new org.netbeans.lib.awtextra.AbsoluteConstraints(0, 540, -1, -1)); btSearchHalf.setBackground(new java.awt.Color(51, 204, 255)); btSearchHalf.setBorder(new javax.swing.border.LineBorder(new java.awt.Color(0, 102, 153), 2, true)); btSearchHalf.setBorderPainted(false); btSearchHalf.setContentAreaFilled(false); btSearchHalf.setCursor(new java.awt.Cursor(java.awt.Cursor.HAND_CURSOR)); btSearchHalf.addMouseListener(new java.awt.event.MouseAdapter() { public void mouseEntered(java.awt.event.MouseEvent evt) { btSearchHalfMouseEntered(evt); } public void mouseExited(java.awt.event.MouseEvent evt) { btSearchHalfMouseExited(evt); } }); jPanel1.add(btSearchHalf, new org.netbeans.lib.awtextra.AbsoluteConstraints(285, 290, 260, 250)); jLabel5.setFont(new java.awt.Font("Times New Roman", 1, 18)); // NOI18N jLabel5.setHorizontalAlignment(javax.swing.SwingConstants.CENTER); jLabel5.setText("Search Employee Halfday Leaves"); jPanel1.add(jLabel5, new org.netbeans.lib.awtextra.AbsoluteConstraints(290, 540, -1, -1)); btViewHalf.setBackground(new java.awt.Color(51, 204, 255)); btViewHalf.setBorder(new javax.swing.border.LineBorder(new java.awt.Color(0, 102, 153), 2, true)); btViewHalf.setBorderPainted(false); btViewHalf.setContentAreaFilled(false); btViewHalf.setCursor(new java.awt.Cursor(java.awt.Cursor.HAND_CURSOR)); btViewHalf.addMouseListener(new java.awt.event.MouseAdapter() { public void mouseEntered(java.awt.event.MouseEvent evt) { btViewHalfMouseEntered(evt); } public void mouseExited(java.awt.event.MouseEvent evt) { btViewHalfMouseExited(evt); } }); jPanel1.add(btViewHalf, new org.netbeans.lib.awtextra.AbsoluteConstraints(565, 290, 260, 250)); jLabel6.setFont(new java.awt.Font("Times New Roman", 1, 18)); // NOI18N jLabel6.setHorizontalAlignment(javax.swing.SwingConstants.CENTER); jLabel6.setText("View Employee Halfday Leaves"); jPanel1.add(jLabel6, new org.netbeans.lib.awtextra.AbsoluteConstraints(580, 540, -1, -1)); javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this); this.setLayout(layout); layout.setHorizontalGroup( layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(jPanel1, javax.swing.GroupLayout.PREFERRED_SIZE, 846, javax.swing.GroupLayout.PREFERRED_SIZE) ); layout.setVerticalGroup( layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(jPanel1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) ); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public Form() {\n initComponents();\n }", "public MainForm() {\n initComponents();\n }", "public MainForm() {\n initComponents();\n }", "public MainForm() {\n initComponents();\n }", "public frmRectangulo() {\n initComponents();\n }", "public form() {\n initComponents();\n }", "public AdjointForm() {\n initComponents();\n setDefaultCloseOperation(HIDE_ON_CLOSE);\n }", "public FormListRemarking() {\n initComponents();\n }", "public MainForm() {\n initComponents();\n \n }", "public FormPemilihan() {\n initComponents();\n }", "public GUIForm() { \n initComponents();\n }", "public FrameForm() {\n initComponents();\n }", "public TorneoForm() {\n initComponents();\n }", "public FormCompra() {\n initComponents();\n }", "public muveletek() {\n initComponents();\n }", "public Interfax_D() {\n initComponents();\n }", "public quanlixe_form() {\n initComponents();\n }", "public SettingsForm() {\n initComponents();\n }", "public RegistrationForm() {\n initComponents();\n this.setLocationRelativeTo(null);\n }", "public Soru1() {\n initComponents();\n }", "public FMainForm() {\n initComponents();\n this.setResizable(false);\n setLocationRelativeTo(null);\n }", "public soal2GUI() {\n initComponents();\n }", "public EindopdrachtGUI() {\n initComponents();\n }", "public MechanicForm() {\n initComponents();\n }", "public AddDocumentLineForm(java.awt.Frame parent) {\n super(parent);\n initComponents();\n myInit();\n }", "public BloodDonationGUI() {\n initComponents();\n }", "public quotaGUI() {\n initComponents();\n }", "public Customer_Form() {\n initComponents();\n setSize(890,740);\n \n \n }", "public PatientUI() {\n initComponents();\n }", "public Oddeven() {\n initComponents();\n }", "public myForm() {\n\t\t\tinitComponents();\n\t\t}", "public intrebarea() {\n initComponents();\n }", "public Magasin() {\n initComponents();\n }", "public RadioUI()\n {\n initComponents();\n }", "public NewCustomerGUI() {\n initComponents();\n }", "public ZobrazUdalost() {\n initComponents();\n }", "public FormUtama() {\n initComponents();\n }", "public p0() {\n initComponents();\n }", "public INFORMACION() {\n initComponents();\n this.setLocationRelativeTo(null); \n }", "public ProgramForm() {\n setLookAndFeel();\n initComponents();\n }", "public AmountReleasedCommentsForm() {\r\n initComponents();\r\n }", "public form2() {\n initComponents();\n }", "public MainForm() {\n\t\tsuper(\"Hospital\", List.IMPLICIT);\n\n\t\tstartComponents();\n\t}", "public LixeiraForm() {\n initComponents();\n setLocationRelativeTo(null);\n }", "public kunde() {\n initComponents();\n }", "@SuppressWarnings(\"unchecked\")\n // <editor-fold defaultstate=\"collapsed\" desc=\"Generated Code\">//GEN-BEGIN:initComponents\n private void initComponents() {\n\n setName(\"Form\"); // NOI18N\n setRequestFocusEnabled(false);\n setVerifyInputWhenFocusTarget(false);\n\n javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this);\n this.setLayout(layout);\n layout.setHorizontalGroup(\n layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGap(0, 465, Short.MAX_VALUE)\n );\n layout.setVerticalGroup(\n layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGap(0, 357, Short.MAX_VALUE)\n );\n }", "public MusteriEkle() {\n initComponents();\n }", "public frmMain() {\n initComponents();\n }", "public frmMain() {\n initComponents();\n }", "public DESHBORDPANAL() {\n initComponents();\n }", "public frmVenda() {\n initComponents();\n }", "public GUIForm() {\n initComponents();\n inputField.setText(NO_FILE_SELECTED);\n outputField.setText(NO_FILE_SELECTED);\n progressLabel.setBackground(INFO);\n progressLabel.setText(SELECT_FILE);\n }", "public Botonera() {\n initComponents();\n }", "public FrmMenu() {\n initComponents();\n }", "public OffertoryGUI() {\n initComponents();\n setTypes();\n }", "public JFFornecedores() {\n initComponents();\n }", "@SuppressWarnings(\"unchecked\")\n // <editor-fold defaultstate=\"collapsed\" desc=\"Generated Code\">//GEN-BEGIN:initComponents\n private void initComponents()\n {\n\n setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);\n setBackground(new java.awt.Color(255, 255, 255));\n\n javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());\n getContentPane().setLayout(layout);\n layout.setHorizontalGroup(\n layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGap(0, 983, Short.MAX_VALUE)\n );\n layout.setVerticalGroup(\n layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGap(0, 769, Short.MAX_VALUE)\n );\n\n pack();\n }", "public EnterDetailsGUI() {\n initComponents();\n }", "public vpemesanan1() {\n initComponents();\n }", "public Kost() {\n initComponents();\n }", "public UploadForm() {\n initComponents();\n }", "public FormHorarioSSE() {\n initComponents();\n }", "public frmacceso() {\n initComponents();\n }", "public HW3() {\n initComponents();\n }", "public Managing_Staff_Main_Form() {\n initComponents();\n }", "@SuppressWarnings(\"unchecked\")\n // <editor-fold defaultstate=\"collapsed\" desc=\"Generated Code\">//GEN-BEGIN:initComponents\n private void initComponents()\n {\n\n setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);\n getContentPane().setLayout(null);\n\n pack();\n }", "@SuppressWarnings(\"unchecked\")\n // <editor-fold defaultstate=\"collapsed\" desc=\"Generated Code\">//GEN-BEGIN:initComponents\n private void initComponents() {\n\n setName(\"Form\"); // NOI18N\n\n javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this);\n this.setLayout(layout);\n layout.setHorizontalGroup(\n layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGap(0, 400, Short.MAX_VALUE)\n );\n layout.setVerticalGroup(\n layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGap(0, 300, Short.MAX_VALUE)\n );\n }", "public sinavlar2() {\n initComponents();\n }", "public P0405() {\n initComponents();\n }", "public IssueBookForm() {\n initComponents();\n }", "public MiFrame2() {\n initComponents();\n }", "public Choose1() {\n initComponents();\n }", "public MainForm() {\n initComponents();\n\n String oldAuthor = prefs.get(\"AUTHOR\", \"\");\n if(oldAuthor != null) {\n this.authorTextField.setText(oldAuthor);\n }\n String oldBook = prefs.get(\"BOOK\", \"\");\n if(oldBook != null) {\n this.bookTextField.setText(oldBook);\n }\n String oldDisc = prefs.get(\"DISC\", \"\");\n if(oldDisc != null) {\n try {\n int oldDiscNum = Integer.parseInt(oldDisc);\n oldDiscNum++;\n this.discNumberTextField.setText(Integer.toString(oldDiscNum));\n } catch (Exception ex) {\n this.discNumberTextField.setText(oldDisc);\n }\n this.bookTextField.setText(oldBook);\n }\n\n\n }", "public GUI_StudentInfo() {\n initComponents();\n }", "public Lihat_Dokter_Keseluruhan() {\n initComponents();\n }", "public JFrmPrincipal() {\n initComponents();\n }", "public bt526() {\n initComponents();\n }", "public Pemilihan_Dokter() {\n initComponents();\n }", "public Ablak() {\n initComponents();\n }", "@Override\n\tprotected void initUi() {\n\t\t\n\t}", "@SuppressWarnings(\"unchecked\")\n\t// <editor-fold defaultstate=\"collapsed\" desc=\"Generated\n\t// Code\">//GEN-BEGIN:initComponents\n\tprivate void initComponents() {\n\n\t\tlabel1 = new java.awt.Label();\n\t\tlabel2 = new java.awt.Label();\n\t\tlabel3 = new java.awt.Label();\n\t\tlabel4 = new java.awt.Label();\n\t\tlabel5 = new java.awt.Label();\n\t\tlabel6 = new java.awt.Label();\n\t\tlabel7 = new java.awt.Label();\n\t\tlabel8 = new java.awt.Label();\n\t\tlabel9 = new java.awt.Label();\n\t\tlabel10 = new java.awt.Label();\n\t\ttextField1 = new java.awt.TextField();\n\t\ttextField2 = new java.awt.TextField();\n\t\tlabel14 = new java.awt.Label();\n\t\tlabel15 = new java.awt.Label();\n\t\tlabel16 = new java.awt.Label();\n\t\ttextField3 = new java.awt.TextField();\n\t\ttextField4 = new java.awt.TextField();\n\t\ttextField5 = new java.awt.TextField();\n\t\tlabel17 = new java.awt.Label();\n\t\tlabel18 = new java.awt.Label();\n\t\tlabel19 = new java.awt.Label();\n\t\tlabel20 = new java.awt.Label();\n\t\tlabel21 = new java.awt.Label();\n\t\tlabel22 = new java.awt.Label();\n\t\ttextField6 = new java.awt.TextField();\n\t\ttextField7 = new java.awt.TextField();\n\t\ttextField8 = new java.awt.TextField();\n\t\tlabel23 = new java.awt.Label();\n\t\ttextField9 = new java.awt.TextField();\n\t\ttextField10 = new java.awt.TextField();\n\t\ttextField11 = new java.awt.TextField();\n\t\ttextField12 = new java.awt.TextField();\n\t\tlabel24 = new java.awt.Label();\n\t\tlabel25 = new java.awt.Label();\n\t\tlabel26 = new java.awt.Label();\n\t\tlabel27 = new java.awt.Label();\n\t\tlabel28 = new java.awt.Label();\n\t\tlabel30 = new java.awt.Label();\n\t\tlabel31 = new java.awt.Label();\n\t\tlabel32 = new java.awt.Label();\n\t\tjButton1 = new javax.swing.JButton();\n\n\t\tlabel1.setFont(new java.awt.Font(\"Segoe UI Semibold\", 0, 18)); // NOI18N\n\t\tlabel1.setText(\"It seems that some of the buttons on the ATM machine are not working!\");\n\n\t\tlabel2.setFont(new java.awt.Font(\"Segoe UI Semibold\", 0, 18)); // NOI18N\n\t\tlabel2.setText(\"Unfortunately these numbers are exactly what Professor has to use to type in his password.\");\n\n\t\tlabel3.setFont(new java.awt.Font(\"Segoe UI Semibold\", 0, 18)); // NOI18N\n\t\tlabel3.setText(\n\t\t\t\t\"If you want to eat tonight, you have to help him out and construct the numbers of the password with the working buttons and math operators.\");\n\n\t\tlabel4.setFont(new java.awt.Font(\"Segoe UI Semibold\", 0, 14)); // NOI18N\n\t\tlabel4.setText(\"Denver's Password: 2792\");\n\n\t\tlabel5.setFont(new java.awt.Font(\"Consolas\", 0, 14)); // NOI18N\n\t\tlabel5.setText(\"import java.util.Scanner;\\n\");\n\n\t\tlabel6.setFont(new java.awt.Font(\"Consolas\", 0, 14)); // NOI18N\n\t\tlabel6.setText(\"public class ATM{\");\n\n\t\tlabel7.setFont(new java.awt.Font(\"Consolas\", 0, 14)); // NOI18N\n\t\tlabel7.setText(\"public static void main(String[] args){\");\n\n\t\tlabel8.setFont(new java.awt.Font(\"Consolas\", 0, 14)); // NOI18N\n\t\tlabel8.setText(\"System.out.print(\");\n\n\t\tlabel9.setFont(new java.awt.Font(\"Dialog\", 0, 14)); // NOI18N\n\t\tlabel9.setText(\" -\");\n\n\t\tlabel10.setFont(new java.awt.Font(\"Consolas\", 0, 14)); // NOI18N\n\t\tlabel10.setText(\");\");\n\n\t\ttextField1.addActionListener(new java.awt.event.ActionListener() {\n\t\t\tpublic void actionPerformed(java.awt.event.ActionEvent evt) {\n\t\t\t\ttextField1ActionPerformed(evt);\n\t\t\t}\n\t\t});\n\n\t\tlabel14.setFont(new java.awt.Font(\"Consolas\", 0, 14)); // NOI18N\n\t\tlabel14.setText(\"System.out.print( (\");\n\n\t\tlabel15.setFont(new java.awt.Font(\"Consolas\", 0, 14)); // NOI18N\n\t\tlabel15.setText(\"System.out.print(\");\n\n\t\tlabel16.setFont(new java.awt.Font(\"Consolas\", 0, 14)); // NOI18N\n\t\tlabel16.setText(\"System.out.print( ( (\");\n\n\t\tlabel17.setFont(new java.awt.Font(\"Dialog\", 0, 14)); // NOI18N\n\t\tlabel17.setText(\")\");\n\n\t\tlabel18.setFont(new java.awt.Font(\"Dialog\", 0, 14)); // NOI18N\n\t\tlabel18.setText(\" +\");\n\n\t\tlabel19.setFont(new java.awt.Font(\"Consolas\", 0, 14)); // NOI18N\n\t\tlabel19.setText(\");\");\n\n\t\tlabel20.setFont(new java.awt.Font(\"Dialog\", 0, 14)); // NOI18N\n\t\tlabel20.setText(\" /\");\n\n\t\tlabel21.setFont(new java.awt.Font(\"Dialog\", 0, 14)); // NOI18N\n\t\tlabel21.setText(\" %\");\n\n\t\tlabel22.setFont(new java.awt.Font(\"Dialog\", 0, 14)); // NOI18N\n\t\tlabel22.setText(\" +\");\n\n\t\tlabel23.setFont(new java.awt.Font(\"Consolas\", 0, 14)); // NOI18N\n\t\tlabel23.setText(\");\");\n\n\t\tlabel24.setFont(new java.awt.Font(\"Dialog\", 0, 14)); // NOI18N\n\t\tlabel24.setText(\" +\");\n\n\t\tlabel25.setFont(new java.awt.Font(\"Dialog\", 0, 14)); // NOI18N\n\t\tlabel25.setText(\" /\");\n\n\t\tlabel26.setFont(new java.awt.Font(\"Dialog\", 0, 14)); // NOI18N\n\t\tlabel26.setText(\" *\");\n\n\t\tlabel27.setCursor(new java.awt.Cursor(java.awt.Cursor.DEFAULT_CURSOR));\n\t\tlabel27.setFont(new java.awt.Font(\"Consolas\", 0, 14)); // NOI18N\n\t\tlabel27.setText(\")\");\n\n\t\tlabel28.setFont(new java.awt.Font(\"Dialog\", 0, 14)); // NOI18N\n\t\tlabel28.setText(\")\");\n\n\t\tlabel30.setFont(new java.awt.Font(\"Consolas\", 0, 14)); // NOI18N\n\t\tlabel30.setText(\"}\");\n\n\t\tlabel31.setFont(new java.awt.Font(\"Consolas\", 0, 14)); // NOI18N\n\t\tlabel31.setText(\"}\");\n\n\t\tlabel32.setFont(new java.awt.Font(\"Consolas\", 0, 14)); // NOI18N\n\t\tlabel32.setText(\");\");\n\n\t\tjButton1.setFont(new java.awt.Font(\"Segoe UI Semibold\", 0, 14)); // NOI18N\n\t\tjButton1.setText(\"Check\");\n\t\tjButton1.addActionListener(new java.awt.event.ActionListener() {\n\t\t\tpublic void actionPerformed(java.awt.event.ActionEvent evt) {\n\t\t\t\tjButton1ActionPerformed(evt);\n\t\t\t}\n\t\t});\n\n\t\tjavax.swing.GroupLayout layout = new javax.swing.GroupLayout(this);\n\t\tlayout.setHorizontalGroup(layout.createParallelGroup(Alignment.LEADING)\n\t\t\t\t.addGroup(layout.createSequentialGroup().addGap(28).addGroup(layout\n\t\t\t\t\t\t.createParallelGroup(Alignment.LEADING).addComponent(getDoneButton()).addComponent(jButton1)\n\t\t\t\t\t\t.addComponent(label7, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t.addComponent(label6, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t.addComponent(label5, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t.addComponent(label4, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t.addComponent(label3, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t.addGroup(layout.createSequentialGroup()\n\t\t\t\t\t\t\t\t.addComponent(label1, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t.addGap(1)\n\t\t\t\t\t\t\t\t.addComponent(label2, GroupLayout.PREFERRED_SIZE, 774, GroupLayout.PREFERRED_SIZE))\n\t\t\t\t\t\t.addGroup(layout.createSequentialGroup()\n\t\t\t\t\t\t\t\t.addGap(92).addGroup(layout.createParallelGroup(Alignment.LEADING).addGroup(layout\n\t\t\t\t\t\t\t\t\t\t.createSequentialGroup()\n\t\t\t\t\t\t\t\t\t\t.addGroup(layout.createParallelGroup(Alignment.LEADING, false)\n\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout.createSequentialGroup()\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(label15, GroupLayout.PREFERRED_SIZE, 145,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addPreferredGap(ComponentPlacement.RELATED)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(textField8, GroupLayout.PREFERRED_SIZE, 20,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGap(2)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(label21, GroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addPreferredGap(ComponentPlacement.RELATED,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(textField7, GroupLayout.PREFERRED_SIZE, 20,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE))\n\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout.createSequentialGroup()\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(label8, GroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addPreferredGap(ComponentPlacement.RELATED)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(textField1, GroupLayout.PREFERRED_SIZE, 20,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addPreferredGap(ComponentPlacement.RELATED)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(label9, GroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addPreferredGap(ComponentPlacement.RELATED).addComponent(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\ttextField2, GroupLayout.PREFERRED_SIZE, 20,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE))\n\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(label31, GroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout.createSequentialGroup().addGroup(layout\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.createParallelGroup(Alignment.LEADING)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout.createSequentialGroup()\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(label14, GroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGap(37))\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout.createSequentialGroup().addGap(174)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(textField5, GroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t20, GroupLayout.PREFERRED_SIZE)))\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(label18, GroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGap(7)))\n\t\t\t\t\t\t\t\t\t\t.addPreferredGap(ComponentPlacement.RELATED)\n\t\t\t\t\t\t\t\t\t\t.addGroup(layout.createParallelGroup(Alignment.LEADING).addGroup(layout\n\t\t\t\t\t\t\t\t\t\t\t\t.createSequentialGroup()\n\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.createParallelGroup(Alignment.TRAILING, false).addGroup(layout\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.createSequentialGroup()\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(textField4, GroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t20, GroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addPreferredGap(ComponentPlacement.RELATED,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(label17, GroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE))\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout.createSequentialGroup()\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(label22, GroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addPreferredGap(ComponentPlacement.RELATED)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(textField9, GroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t20, GroupLayout.PREFERRED_SIZE)))\n\t\t\t\t\t\t\t\t\t\t\t\t.addGap(20)\n\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout.createParallelGroup(Alignment.TRAILING)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(label23, GroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout.createSequentialGroup()\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(label20, GroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addPreferredGap(ComponentPlacement.RELATED)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(textField3, GroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t20, GroupLayout.PREFERRED_SIZE)))\n\t\t\t\t\t\t\t\t\t\t\t\t.addGap(20).addComponent(label19, GroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE))\n\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout.createSequentialGroup().addGap(23).addComponent(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tlabel10, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE))))\n\t\t\t\t\t\t\t\t\t\t.addGroup(layout.createSequentialGroup()\n\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(label16, GroupLayout.PREFERRED_SIZE, 177,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t.addPreferredGap(ComponentPlacement.RELATED)\n\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(textField12, GroupLayout.PREFERRED_SIZE, 20,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t.addPreferredGap(ComponentPlacement.RELATED)\n\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(label24, GroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t.addPreferredGap(ComponentPlacement.RELATED)\n\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(textField6, GroupLayout.PREFERRED_SIZE, 20,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t.addPreferredGap(ComponentPlacement.RELATED)\n\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(label27, GroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t.addPreferredGap(ComponentPlacement.RELATED)\n\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(label25, GroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t.addPreferredGap(ComponentPlacement.RELATED)\n\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(textField11, GroupLayout.PREFERRED_SIZE, 20,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t.addPreferredGap(ComponentPlacement.RELATED)\n\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(label28, GroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t.addGap(1)\n\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(label26, GroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t.addPreferredGap(ComponentPlacement.RELATED)\n\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(textField10, GroupLayout.PREFERRED_SIZE, 20,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t.addPreferredGap(ComponentPlacement.RELATED).addComponent(label32,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE))))\n\t\t\t\t\t\t.addComponent(label30, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE))\n\t\t\t\t\t\t.addContainerGap(GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)));\n\t\tlayout.setVerticalGroup(\n\t\t\t\tlayout.createParallelGroup(Alignment.LEADING).addGroup(layout.createSequentialGroup().addContainerGap()\n\t\t\t\t\t\t.addGroup(layout.createParallelGroup(Alignment.TRAILING)\n\t\t\t\t\t\t\t\t.addComponent(label1, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t.addComponent(label2, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE))\n\t\t\t\t\t\t.addGap(1)\n\t\t\t\t\t\t.addComponent(label3, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t.addPreferredGap(ComponentPlacement.RELATED)\n\t\t\t\t\t\t.addComponent(label4, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t.addPreferredGap(ComponentPlacement.RELATED)\n\t\t\t\t\t\t.addComponent(label5, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t.addPreferredGap(ComponentPlacement.RELATED)\n\t\t\t\t\t\t.addComponent(label6, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t.addPreferredGap(ComponentPlacement.RELATED)\n\t\t\t\t\t\t.addComponent(label7, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t.addPreferredGap(ComponentPlacement.RELATED)\n\t\t\t\t\t\t.addGroup(layout\n\t\t\t\t\t\t\t\t.createParallelGroup(\n\t\t\t\t\t\t\t\t\t\tAlignment.TRAILING)\n\t\t\t\t\t\t\t\t.addGroup(\n\t\t\t\t\t\t\t\t\t\tlayout.createSequentialGroup().addGroup(layout.createParallelGroup(\n\t\t\t\t\t\t\t\t\t\t\t\tAlignment.TRAILING)\n\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.createSequentialGroup().addGroup(layout\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.createParallelGroup(Alignment.TRAILING).addGroup(layout\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.createParallelGroup(Alignment.LEADING)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(label9,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.createParallelGroup(Alignment.TRAILING)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(label8,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(textField1,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE))\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\ttextField2, GroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE))\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout.createSequentialGroup()\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(label10,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGap(3)))\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGap(19)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout.createParallelGroup(Alignment.TRAILING)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout.createParallelGroup(Alignment.LEADING)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(textField5,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(label14,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE))\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout.createSequentialGroup().addGroup(layout\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.createParallelGroup(Alignment.LEADING)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(label18,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.createParallelGroup(Alignment.TRAILING)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(label17,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(textField4,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)))\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGap(1))))\n\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(label20, GroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout.createParallelGroup(Alignment.LEADING)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(label19, GroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(textField3, GroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)))\n\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout.createParallelGroup(Alignment.LEADING)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout.createSequentialGroup().addGap(78)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(label27, GroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE))\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout.createSequentialGroup().addGap(76)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(textField11, GroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE))\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout.createSequentialGroup().addGap(75)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout.createParallelGroup(Alignment.TRAILING)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(label32,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(textField10,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)))\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout.createSequentialGroup()\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addPreferredGap(ComponentPlacement.RELATED, 20,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tShort.MAX_VALUE)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.createParallelGroup(Alignment.TRAILING, false)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout.createSequentialGroup()\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.createParallelGroup(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tAlignment.TRAILING)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(label15,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(textField8,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(label21,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(textField7,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE))\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGap(27))\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout.createSequentialGroup()\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.createParallelGroup(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tAlignment.TRAILING)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(textField9,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.createParallelGroup(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tAlignment.LEADING)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(label22,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tlayout.createSequentialGroup()\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGap(3)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tlabel23,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE))))\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGap(29)))\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout.createParallelGroup(Alignment.TRAILING)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.createParallelGroup(Alignment.LEADING)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(label16,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(textField12,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE))\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout.createSequentialGroup()\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.createParallelGroup(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tAlignment.TRAILING)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(label24,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(textField6,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE))\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGap(1))))))\n\t\t\t\t\t\t\t\t.addGroup(layout.createParallelGroup(Alignment.LEADING)\n\t\t\t\t\t\t\t\t\t\t.addComponent(label25, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t.addComponent(label28, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t.addComponent(label26, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)))\n\t\t\t\t\t\t.addGap(30)\n\t\t\t\t\t\t.addComponent(label31, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t.addGap(25)\n\t\t\t\t\t\t.addComponent(label30, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t.addGap(26).addComponent(jButton1).addPreferredGap(ComponentPlacement.RELATED)\n\t\t\t\t\t\t.addComponent(getDoneButton()).addContainerGap(23, Short.MAX_VALUE)));\n\t\tthis.setLayout(layout);\n\n\t\tlabel16.getAccessibleContext().setAccessibleName(\"System.out.print( ( (\");\n\t\tlabel17.getAccessibleContext().setAccessibleName(\"\");\n\t\tlabel18.getAccessibleContext().setAccessibleName(\" +\");\n\t}", "public Pregunta23() {\n initComponents();\n }", "public FormMenuUser() {\n super(\"Form Menu User\");\n initComponents();\n }", "public AvtekOkno() {\n initComponents();\n }", "public busdet() {\n initComponents();\n }", "public ViewPrescriptionForm() {\n initComponents();\n }", "public Ventaform() {\n initComponents();\n }", "public Kuis2() {\n initComponents();\n }", "public CreateAccount_GUI() {\n initComponents();\n }", "public POS1() {\n initComponents();\n }", "public Carrera() {\n initComponents();\n }", "public EqGUI() {\n initComponents();\n }", "public JFriau() {\n initComponents();\n this.setLocationRelativeTo(null);\n this.setTitle(\"BuNus - Budaya Nusantara\");\n }", "@SuppressWarnings(\"unchecked\")\n // <editor-fold defaultstate=\"collapsed\" desc=\"Generated Code\">//GEN-BEGIN:initComponents\n private void initComponents() {\n\n setBackground(new java.awt.Color(204, 204, 204));\n setMinimumSize(new java.awt.Dimension(1, 1));\n setPreferredSize(new java.awt.Dimension(760, 402));\n\n javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this);\n this.setLayout(layout);\n layout.setHorizontalGroup(\n layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGap(0, 750, Short.MAX_VALUE)\n );\n layout.setVerticalGroup(\n layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGap(0, 400, Short.MAX_VALUE)\n );\n }", "public nokno() {\n initComponents();\n }", "public dokter() {\n initComponents();\n }", "public ConverterGUI() {\n initComponents();\n }", "public hitungan() {\n initComponents();\n }", "public Modify() {\n initComponents();\n }", "public frmAddIncidencias() {\n initComponents();\n }", "public FP_Calculator_GUI() {\n initComponents();\n \n setVisible(true);\n }" ]
[ "0.7321233", "0.72922724", "0.72922724", "0.72922724", "0.7287021", "0.7250113", "0.7214902", "0.7209478", "0.71973455", "0.71915394", "0.71855843", "0.71602577", "0.7149222", "0.70949143", "0.70813066", "0.70579875", "0.6988272", "0.6978623", "0.6956488", "0.6954857", "0.69464177", "0.6943629", "0.69367987", "0.6933018", "0.6929331", "0.69254756", "0.6925112", "0.6913102", "0.69126385", "0.6894097", "0.6893964", "0.68917936", "0.6891495", "0.68895847", "0.68845505", "0.688321", "0.6882532", "0.6878455", "0.68770224", "0.68752515", "0.6872487", "0.6861657", "0.6857395", "0.68569964", "0.6856607", "0.68555", "0.6854448", "0.6854003", "0.6854003", "0.68440473", "0.6838224", "0.6837637", "0.6829588", "0.6829244", "0.68277496", "0.68251204", "0.68236995", "0.68180907", "0.6817601", "0.681135", "0.680981", "0.680977", "0.68097097", "0.6807759", "0.6803703", "0.6795666", "0.67947936", "0.6793619", "0.6790796", "0.67902565", "0.67899716", "0.67888206", "0.67829174", "0.67670804", "0.6766693", "0.67661726", "0.6757112", "0.67564726", "0.67534983", "0.6751943", "0.67434925", "0.6739915", "0.6737868", "0.6737343", "0.673493", "0.6728943", "0.67285377", "0.672136", "0.6716568", "0.671613", "0.67153496", "0.67092025", "0.67079633", "0.6704689", "0.67022705", "0.6701755", "0.6700168", "0.66992295", "0.669491", "0.6692837", "0.6690047" ]
0.0
-1
get all question of any qid
@GetMapping("/quiz/{qid}") public ResponseEntity<?> getQuestionsOfQuiz(@PathVariable("qid") Long qid){ Quiz quiz = this.quizService.getQuiz(qid); Set<Question> questions = quiz.getQuestions(); List<Question> list = new ArrayList<>(questions); if(list.size() > Integer.parseInt(quiz.getNumberOfQuestions())) { list = list.subList(0, Integer.parseInt(quiz.getNumberOfQuestions())); } list.forEach((q)-> { q.setAnswer(""); }); Collections.shuffle(list); return ResponseEntity.ok(list); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\r\n\tpublic List<Yquestion> queryYquestion(int qid) {\n\t\treturn ym.queryYquestion(qid);\r\n\t}", "public List<MultQuestion> multChoiceQuestions(int qid);", "List<Question> getQuestions(String surveyId);", "@GetMapping(\"/quiz/all/{qid}\")\n\tpublic ResponseEntity<?> getQuestionsOfQuizAdmin(@PathVariable(\"qid\") Long qid){\n\t\tQuiz quiz = new Quiz();\n\t\tquiz.setqId(qid);\n\t\tSet<Question> questionsOfQuiz = this.questionService.getQuestionOfQuiz(quiz);\n\t\treturn ResponseEntity.ok(questionsOfQuiz);\t\t\n\t}", "public Question getQuestionbyId(int sid,int qid);", "public List<Question> getQuestionbySid(int sid);", "QuestionResponse getResponses(String questionId);", "List<Question> getQuestions();", "public List<Questions> getQuestionByUser(int uid) {\n\t\tSession session = HibernateUtil.getSessionFactory().openSession();\n\t\tList<Questions> quest = session.createQuery(\"from Questions where userid =:uid\").setInteger(\"uid\", uid).list();\n\t\tsession.close();\n\t\treturn quest;\n\t}", "public Questions getQuestion(int qid) {\n\t\tSession session = HibernateUtil.getSessionFactory().openSession();\n\t\tQuestions quest = (Questions) session.get(Questions.class, qid);\n\t\tsession.close();\n\t\treturn quest;\n\t}", "public String[] getQuestionAndAnswer(int qID) {\n String[] questionInfo = new String[8];\n String query;\n\n try {\n Connection con = Database.createDBconnection();\n Statement stmt = con.createStatement();\n query = \"SELECT question, ans1, ans2, ans3, ans4, ans5, correct_answer, point_value FROM question WHERE question_ID='\" + qID + \"';\";\n ResultSet rs = stmt.executeQuery(query);\n\n while(rs.next()){\n questionInfo[0] = rs.getString(\"question\"); // the question\n questionInfo[1] = rs.getString(\"ans1\"); // possible answer 1\n questionInfo[2] = rs.getString(\"ans2\"); // possible answer 2\n questionInfo[3] = rs.getString(\"ans3\"); // possible answer 3\n questionInfo[4] = rs.getString(\"ans4\"); // possible answer 4\n questionInfo[5] = rs.getString(\"ans5\"); // possible answer 5\n questionInfo[6] = rs.getString(\"correct_answer\"); // the correct answer\n questionInfo[7] = rs.getString(\"point_value\"); // the point value\n }\n\n Database.closeDBconnection(con);\n }\n catch (Exception e) {\n e.printStackTrace();\n }\n return questionInfo;\n }", "public List<Questions> getAllQuestionsHard() {\n List<Questions> questionList = new ArrayList<>();\n db = getReadableDatabase();\n Cursor c = db.rawQuery(\"SELECT * FROM \" + QuestionsTable.Table_name + \" WHERE _id BETWEEN 1 AND 10\", null);\n\n if (c.moveToFirst()){\n do {\n Questions question = new Questions();\n question.setQuestion(c.getString(c.getColumnIndex(QuestionsTable.Column_Question)));\n question.setOption1(c.getString(c.getColumnIndex(QuestionsTable.Column_Option1)));\n question.setOption2(c.getString(c.getColumnIndex(QuestionsTable.Column_Option2)));\n question.setOption3(c.getString(c.getColumnIndex(QuestionsTable.Column_Option3)));\n question.setOption4(c.getString(c.getColumnIndex(QuestionsTable.Column_Option4)));\n question.setAnswerNr(c.getInt(c.getColumnIndex(QuestionsTable.Column_Answer_Nr)));\n questionList.add(question);\n } while (c.moveToNext());\n }\n c.close();\n return questionList;\n }", "ArrayList<Integer> getAnswers (Integer q) {\n\t\tif (results.containsKey(q)) {\n\t\t\treturn results.get(q);\n\t\t} else {\n\t\t\tSystem.out.println(\"No answers found.\");\n\t\t\treturn null;\n\t\t}\n\t}", "public List<DataQuestion> getAllAnswer(){\n return items;\n }", "public List<Question> getQuestionsTopic(int tId){\r\n List<Question> questions = new ArrayList<>();\r\n String selectQuery = \"SELECT * FROM \" + TABLE_QUESTIONS + \" AS q INNER JOIN \" +\r\n TABLE_TOPICS_QUESTIONS + \" AS tq ON q.\" +\r\n KEY_ID + \" = tq.\" + KEY_QID +\r\n \" WHERE tq.\" + KEY_TID + \" = \" + tId + \" ORDER BY RANDOM()\";\r\n SQLiteDatabase db = this.getReadableDatabase();\r\n\r\n Cursor cursor = db.rawQuery(selectQuery, null);\r\n\r\n if(cursor.moveToFirst()){\r\n do{\r\n Question question = new Question();\r\n question.setId(cursor.getInt(cursor.getColumnIndex(KEY_QID)));\r\n question.setQuestion(cursor.getString(cursor.getColumnIndex(KEY_QUESTION)));\r\n question.setAnswer(cursor.getString(cursor.getColumnIndex(KEY_ANSWER)));\r\n question.setExplanation(cursor.getString(cursor.getColumnIndex(KEY_EXPLANATION)));\r\n question.setOptA(cursor.getString(cursor.getColumnIndex(KEY_OPT_A)));\r\n question.setOptB(cursor.getString(cursor.getColumnIndex(KEY_OPT_B)));\r\n question.setOptC(cursor.getString(cursor.getColumnIndex(KEY_OPT_C)));\r\n question.setOptD(cursor.getString(cursor.getColumnIndex(KEY_OPT_D)));\r\n\r\n questions.add(question);\r\n\r\n } while (cursor.moveToNext());\r\n }\r\n\r\n\r\n\r\n cursor.close();\r\n db.close();\r\n return questions;\r\n }", "@Override\n\tpublic List getQuestionListByExamId(Integer examId) {\n\t\tString hql = \"from ElearningExamQRelation a where 1 = 1 \";\n\t\tif(examId!=null && !examId.equals(\"\")){\n\t\t\thql+=\"and a.examId='\"+examId+\"'\";\n\t\t}\n\t\thql+=\"order by a.number asc\";\n\t\tList list = this.queryForList(hql);\n\t\tif(list == null || list.size()== 0)\n\t\t\treturn null;\n\t\telse{\n\t\t\treturn list;\n\t\t}\n\t}", "public List<Questions> getAllQuestionsEasy() {\n List<Questions> questionList = new ArrayList<>();\n db = getReadableDatabase();\n Cursor c = db.rawQuery(\"SELECT * FROM \" + QuestionsTable.Table_name + \" WHERE _id BETWEEN 21 AND 30\", null);\n\n if (c.moveToFirst()){\n do {\n Questions question = new Questions();\n question.setQuestion(c.getString(c.getColumnIndex(QuestionsTable.Column_Question)));\n question.setOption1(c.getString(c.getColumnIndex(QuestionsTable.Column_Option1)));\n question.setOption2(c.getString(c.getColumnIndex(QuestionsTable.Column_Option2)));\n question.setOption3(c.getString(c.getColumnIndex(QuestionsTable.Column_Option3)));\n question.setOption4(c.getString(c.getColumnIndex(QuestionsTable.Column_Option4)));\n question.setAnswerNr(c.getInt(c.getColumnIndex(QuestionsTable.Column_Answer_Nr)));\n questionList.add(question);\n } while (c.moveToNext());\n }\n c.close();\n return questionList;\n }", "public Collection<Question> getQuestions();", "private List<String> getSqIds(String qid)\n\t{\n\t\t@SuppressWarnings(\"unchecked\")\n\t\tList<Element> sq_list = sq_node.selectNodes(\"row[parent_qid=\" + qid + \"]/qid\");\n\t\treturn sq_list.stream()\n\t\t\t.map(e -> e.getText())\n\t\t\t.collect(Collectors.toList()); // Make a list of qid elements to a list of strings\n\t}", "@GetMapping(\"/getquestion/{id}\")\n public ResponseEntity<List<Questions>> getQuestion(@PathVariable Long id) {\n\n List<Questions> q = this.userServices.getquetion(id);\n\n if (q.size() <= 0) {\n\n return ResponseEntity.status(HttpStatus.NOT_FOUND).build();\n\n }\n\n return ResponseEntity.status(HttpStatus.CREATED).body(q);\n\n }", "@Override\r\n\tpublic List<ZyAnswer> getAnswersByQuestion(int questionId) {\n\t\treturn answerDao.getAnswersByquestion(questionId);\r\n\t}", "@Override\n\t@Transactional\n\tpublic List<Question> getQuestionsByTestId(int id) {\n\t\treturn questionDao.getQuestionsByTestId(id);\n\t}", "@Override\n\tpublic Question getQuestion(Integer qid) {\n\t\treturn questionDao.getEntity(qid);\n\t}", "public List<QuestionEntity> getAllQuestions() {\n try {\n return entityManager.createNamedQuery(\"getAllQuestions\", QuestionEntity.class).getResultList();\n } catch (NoResultException nre) {\n return null;\n }\n }", "public List<Questions> getAllQuestionsMedium() {\n List<Questions> questionList = new ArrayList<>();\n db = getReadableDatabase();\n Cursor c = db.rawQuery(\"SELECT * FROM \" + QuestionsTable.Table_name + \" WHERE _id BETWEEN 11 AND 20\", null);\n\n if (c.moveToFirst()){\n do {\n Questions question = new Questions();\n question.setQuestion(c.getString(c.getColumnIndex(QuestionsTable.Column_Question)));\n question.setOption1(c.getString(c.getColumnIndex(QuestionsTable.Column_Option1)));\n question.setOption2(c.getString(c.getColumnIndex(QuestionsTable.Column_Option2)));\n question.setOption3(c.getString(c.getColumnIndex(QuestionsTable.Column_Option3)));\n question.setOption4(c.getString(c.getColumnIndex(QuestionsTable.Column_Option4)));\n question.setAnswerNr(c.getInt(c.getColumnIndex(QuestionsTable.Column_Answer_Nr)));\n questionList.add(question);\n } while (c.moveToNext());\n }\n c.close();\n return questionList;\n }", "public Map<String ,String> GetMultipleChoiceQ(int AssessmentId) {\n Map<String, String> map = new HashMap<String, String>();\n List<String> indexes = GetAssessmentIndexes(AssessmentId);\n\n for (String index : indexes) {\n try {\n Statement stmt = Con.createStatement();\n String query = String.format(\"SELECT qora, content FROM dqs_qanda WHERE \" +\n \"((SELECT content FROM dqs_qanda WHERE qora = 'question%s_t') = 'm') AND (qora='question%s' OR qora = 'question%s_q1' \" +\n \"OR qora = 'question%s_q2' OR qora = 'question%s_q3' or qora = 'question%s_c')\", index, index, index, index, index, index);\n //System.out.println(query);\n ResultSet rs = stmt.executeQuery(query);\n while(rs.next()) {\n map.put(rs.getString(\"qora\"), rs.getString(\"content\"));\n }\n }\n catch (Exception e) {\n System.out.println(e.getMessage());\n }\n }\n return map;\n }", "List<Question> getQuestionsUsed();", "public static synchronized ArrayList<QAQuestions> fetchAllQuestions(\n\t\t\tContext context, String query) throws SQLException,\n\t\t\tNullPointerException {\n\n\t\tQADatabaseHelper dbHelper = QADatabaseHelper.getInstance(context);\n\t\tSQLiteDatabase db = dbHelper.getReadableDatabase();\n\n\t\tArrayList<QAQuestions> questionsList = null;\n\n\t\tCursor cursor = null;\n\t\ttry {\n\t\t\tcursor = db.rawQuery(query, null);\n\t\t} catch (Exception exception) {\n\t\t\texception.printStackTrace();\n\t\t}\n\t\tcursor.moveToFirst();\n\t\tif (cursor != null && cursor.getCount() > 0) {\n\t\t\tquestionsList = new ArrayList<QAQuestions>();\n\t\t\tfor (cursor.moveToFirst(); !cursor.isAfterLast(); cursor\n\t\t\t\t\t.moveToNext()) {\n\n\t\t\t\tQAQuestions question = new QAQuestions();\n\n\t\t\t\tquestion.setPrimaryKey(cursor.getInt(cursor\n\t\t\t\t\t\t.getColumnIndex(COLUMN_NAME_PRIMARY_KEY)));\n\t\t\t\tquestion.setQuestion(cursor.getString(cursor\n\t\t\t\t\t\t.getColumnIndex(COLUMN_NAME_QUESTION)));\n\t\t\t\tquestion.setOptionOne(cursor.getString(cursor\n\t\t\t\t\t\t.getColumnIndex(COLUMN_NAME_OPTION1)));\n\t\t\t\tquestion.setOptionTwo(cursor.getString(cursor\n\t\t\t\t\t\t.getColumnIndex(COLUMN_NAME_OPTION2)));\n\t\t\t\tquestion.setOptionThree(cursor.getString(cursor\n\t\t\t\t\t\t.getColumnIndex(COLUMN_NAME_OPTION3)));\n\t\t\t\tquestion.setOptionFour(cursor.getString(cursor\n\t\t\t\t\t\t.getColumnIndex(COLUMN_NAME_OPTION4)));\n\t\t\t\tquestion.setAnswer(cursor.getString(cursor\n\t\t\t\t\t\t.getColumnIndex(COLUMN_NAME_ANSWER)));\n\t\t\t\tquestion.setUpdatedAt(cursor.getString(cursor\n\t\t\t\t\t\t.getColumnIndex(COLUMN_NAME_UPDATED_AT)));\n\t\t\t\tquestion.setFetched((cursor.getInt(cursor\n\t\t\t\t\t\t.getColumnIndex(COLUMN_NAME_IS_FETCHED)) == 1) ? true\n\t\t\t\t\t\t: false);\n\t\t\t\tquestionsList.add(question);\n\t\t\t}\n\t\t}\n\t\tcursor.close();\n\t\treturn questionsList;\n\t}", "@Override\n\tpublic List getRelationListByQuestionId(Integer questionId) {\n\t\tString hql = \"from ElearningExamQRelation a where 1 = 1 \";\n\t\tif(questionId!=null && !questionId.equals(\"\")){\n\t\t\thql+=\"and a.questionId='\"+questionId+\"'\";\n\t\t}\n\t\tList list = this.queryForList(hql);\n\t\tif(list == null || list.size()== 0)\n\t\t\treturn null;\n\t\telse{\n\t\t\treturn list;\n\t\t}\n\t}", "public List<Question> getQuestionsExamTopic(int eId, int tId){\r\n List<Question> questions = new ArrayList<>();\r\n String selectQuery = \"SELECT * FROM \" + TABLE_QUESTIONS + \" AS q INNER JOIN \" +\r\n TABLE_EXAMS_TOPICS_QUESTIONS + \" AS etq ON q.\" +\r\n KEY_ID + \" = etq.\" + KEY_QID +\r\n \" WHERE etq.\" + KEY_EID + \" = \" + eId + \" AND etq.\" + KEY_TID + \" = \" + tId + \" ORDER BY RANDOM()\";\r\n SQLiteDatabase db = this.getReadableDatabase();\r\n\r\n Cursor cursor = db.rawQuery(selectQuery, null);\r\n\r\n if(cursor.moveToFirst()){\r\n do{\r\n Question question = new Question();\r\n question.setId(cursor.getInt(cursor.getColumnIndex(KEY_QID)));\r\n question.setQuestion(cursor.getString(cursor.getColumnIndex(KEY_QUESTION)));\r\n question.setAnswer(cursor.getString(cursor.getColumnIndex(KEY_ANSWER)));\r\n question.setExplanation(cursor.getString(cursor.getColumnIndex(KEY_EXPLANATION)));\r\n question.setOptA(cursor.getString(cursor.getColumnIndex(KEY_OPT_A)));\r\n question.setOptB(cursor.getString(cursor.getColumnIndex(KEY_OPT_B)));\r\n question.setOptC(cursor.getString(cursor.getColumnIndex(KEY_OPT_C)));\r\n question.setOptD(cursor.getString(cursor.getColumnIndex(KEY_OPT_D)));\r\n\r\n questions.add(question);\r\n\r\n } while (cursor.moveToNext());\r\n }\r\n\r\n\r\n\r\n cursor.close();\r\n db.close();\r\n return questions;\r\n }", "List<SurveyQuestion> getSurveyQuestionsByQuestions(List<Question> questions);", "public objData getQuestion(String id){\n objData objdata = new objData();\n try{\n MainClient mc = new MainClient(DBConn.getHost());\n\n String query = \"SELECT TBD_REFID, TSDB_REFID, TDB_QNO, TDB_QUEST FROM TEST_DB WHERE TDB_REFID = '\" + id + \"'\";\n String data[] = {};\n\n objdata.setTableData(mc.getQuery(query,data));\n }\n catch(Exception e){\n objdata.setErrorMessage(e.toString());\n objdata.setFlag(1);\n }\n return objdata;\n }", "public List<Question> getQuestionsExam(int eId){\r\n List<Question> questions = new ArrayList<>();\r\n String selectQuery = \"SELECT * FROM \" + TABLE_QUESTIONS + \" AS q INNER JOIN \" +\r\n TABLE_EXAMS_TOPICS_QUESTIONS + \" AS etq ON q.\" +\r\n KEY_ID + \" = etq.\" + KEY_QID +\r\n \" WHERE etq.\" + KEY_EID + \" = \" + eId + \" ORDER BY RANDOM()\";\r\n SQLiteDatabase db = this.getReadableDatabase();\r\n\r\n Cursor cursor = db.rawQuery(selectQuery, null);\r\n\r\n if(cursor.moveToFirst()){\r\n do{\r\n Question question = new Question();\r\n question.setId(cursor.getInt(cursor.getColumnIndex(KEY_QID)));\r\n question.setQuestion(cursor.getString(cursor.getColumnIndex(KEY_QUESTION)));\r\n question.setAnswer(cursor.getString(cursor.getColumnIndex(KEY_ANSWER)));\r\n question.setExplanation(cursor.getString(cursor.getColumnIndex(KEY_EXPLANATION)));\r\n question.setOptA(cursor.getString(cursor.getColumnIndex(KEY_OPT_A)));\r\n question.setOptB(cursor.getString(cursor.getColumnIndex(KEY_OPT_B)));\r\n question.setOptC(cursor.getString(cursor.getColumnIndex(KEY_OPT_C)));\r\n question.setOptD(cursor.getString(cursor.getColumnIndex(KEY_OPT_D)));\r\n\r\n questions.add(question);\r\n\r\n } while (cursor.moveToNext());\r\n }\r\n\r\n\r\n\r\n cursor.close();\r\n db.close();\r\n return questions;\r\n }", "public String getQuestion(int idType, int idQuest) throws SQLException{ \r\n String query= (\"select question from \"+Database.Table.TABLE_PRETEST_QUESTION+\" where idtype = '\"+idType+\"' AND idquest = '\"+idQuest+\"'\");\r\n ResultSet rs = q.querySelect(query);\r\n while(rs.next()){\r\n question=rs.getString(\"question\");\r\n }\r\n return question;\r\n }", "@Override\n\tpublic List<Questions> listQuestion(int testId) {\n\t\treturn null;\n\t}", "public List<Survey> getSurveybyTid(int tid);", "public List<Answer> getAnswers(Question question) throws Exception {\n DataBaseBroker dbb = new DataBaseBroker();\n dbb.loadDriver();\n dbb.establishConnection();\n List<Answer> answers = dbb.getAnswers(question);\n dbb.commit();\n dbb.closeConnection();\n return answers;\n }", "public List<TextQuestion> TextQuestions(int aid);", "@Override\n\tpublic List<Questions> listQuestion(long testId1) {\n\t\treturn null;\n\t}", "@WebMethod public List<Question> findAllQuestion(Event ev);", "public List<Answer> getAnswersByPoints(int n, Question q) {\n\n List<Answer> answers = getAnswersByPoints(q);\n int nChecked = n >= answers.size() ? answers.size() : n;\n\n return getListNumOfAnswers(answers, nChecked);\n }", "@Test\n\tpublic void testGetAllQuestions() {\n\t\tList<QnaQuestion> questions = questionLogic.getAllQuestions(LOCATION1_ID);\n\t\tAssert.assertEquals(5, questions.size());\n\t\tAssert.assertTrue(questions.contains(tdp.question1_location1));\n\t\tAssert.assertTrue(questions.contains(tdp.question2_location1));\n\t\tAssert.assertTrue(questions.contains(tdp.question3_location1));\n\t\tAssert.assertTrue(questions.contains(tdp.question4_location1));\n\t\tAssert.assertTrue(questions.contains(tdp.question5_location1));\n\t}", "@GetMapping(value=\"/getAll\")\n\tpublic List<Question> getAll(){\n\t\tLOGGER.info(\"Viewing all questions\");\n\t\treturn questionObj.viewAllQuestions();\n\t}", "public Question getQuestion(String questionId) {\r\n Question[] questions = currentProcessInstance.getQuestions();\r\n Question foundQuestion = null;\r\n \r\n for (int i = 0; foundQuestion == null && i < questions.length; i++) {\r\n if (questions[i].getId().equals(questionId))\r\n foundQuestion = questions[i];\r\n }\r\n \r\n return foundQuestion;\r\n }", "public ArrayList<Answer> getAllAnswersByQuestionId(int id) {\n \t\tArrayList<Answer> questionAnswers = new ArrayList<Answer>();\n \t\tfor (Answer answer : answers) {\n \t\t\tif (answer.getQuestionId() == id) {\n \t\t\t\tquestionAnswers.add(answer);\n \t\t\t}\n \t\t}\n \t\treturn questionAnswers;\n \t}", "@RequestMapping(value = \"/getQuestion/{test}/{question}\")\n\tpublic Questions getSingleQuestion(@PathVariable(\"test\") int testid,@PathVariable(\"question\") int question) {\n\t\tTest test = testDao.gettestStatus(testid);\n\t\tif(test!=null) {\n\t\t\t\n\t\t\tfor(Questions testQueList : test.getQuestions()) {\n\t\t\t\tif(testQueList.getQid()==question) {\n\t\t\t\t\t//System.out.println(\"test id : \"+testQueList.getTest());\n//\t\t\t\t\ttestQueList.setTest(test.getTestid());\n\t\t\t\t\treturn testQueList;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn null;\n\t}", "public List<TemplateExamQuestion> getQuestions(Group group);", "java.util.List<com.rpg.framework.database.Protocol.Quest> \n getQuestList();", "public List<Answer> answersOfQuestion(Question question){\n\t\treturn this.aRepo.findAllByQuestion(question);\n\t}", "Question getQuestion(String questionId);", "public List<DnsQuestion> questions() {\n if (questions == null) {\n return Collections.emptyList();\n }\n return Collections.unmodifiableList(questions);\n }", "public ArrayList<SingleQuestion> getAllQuestions(String difficulty) {\n ArrayList<SingleQuestion> questionsList = new ArrayList<>();\n String selectQuery = \"SELECT id,question,A,B,C,D,answer,explanation,category,difficulty FROM quizMaster where difficulty='\" + difficulty + \"'\";\n Log.d(\"Select Query\", \"selectQuery\" + selectQuery);\n Cursor cursor = database.rawQuery(selectQuery, null);\n if (cursor.moveToFirst()) {\n do {\n SingleQuestion singleQuestion = new SingleQuestion();\n singleQuestion.setId(String.valueOf(cursor.getInt(0)));\n singleQuestion.setQuestion(cursor.getString(1));\n singleQuestion.setOptionA(cursor.getString(2));\n singleQuestion.setOptionB(cursor.getString(3));\n singleQuestion.setOptionC(cursor.getString(4));\n singleQuestion.setOptionD(cursor.getString(5));\n singleQuestion.setAnswer(cursor.getString(6));\n singleQuestion.setExplanation(cursor.getString(7));\n singleQuestion.setCategory(cursor.getString(8));\n singleQuestion.setDifficulty(cursor.getString(9));\n questionsList.add(singleQuestion);\n } while (cursor.moveToNext());\n }\n \n return questionsList;\n }", "public static List<Question> getQuestions() {\n if (QUESTION == null) {\n QUESTION = new ArrayList<>();\n List<Option> options = new ArrayList<Option>();\n options.add(new Option(1, \"Radio Waves\"));\n options.add(new Option(2, \"Sound Waves\"));\n options.add(new Option(3, \"Gravity Waves\"));\n options.add(new Option(4, \"Light Waves\"));\n QUESTION.add(new Question(1, \"Which kind of waves are used to make and receive cellphone calls?\", getCategory(4), options, options.get(0)));\n\n List<Option> options2 = new ArrayList<Option>();\n options2.add(new Option(1, \"8\"));\n options2.add(new Option(2, \"6\"));\n options2.add(new Option(3, \"3\"));\n options2.add(new Option(4, \"1\"));\n QUESTION.add(new Question(2, \"How many hearts does an octopus have?\", getCategory(4), options2, options2.get(2)));\n\n List<Option> options3 = new ArrayList<Option>();\n options3.add(new Option(1, \"Newton's Law\"));\n options3.add(new Option(2, \"Hooke's law\"));\n options3.add(new Option(3, \"Darwin's Law\"));\n options3.add(new Option(4, \"Archimedes' principle\"));\n QUESTION.add(new Question(3, \"Whose law states that the force needed to extend a spring by some distance is proportional to that distance?\", getCategory(4), options3, options3.get(1)));\n\n List<Option> options4 = new ArrayList<Option>();\n options4.add(new Option(1, \"M\"));\n options4.add(new Option(2, \"$\"));\n options4.add(new Option(3, \"W\"));\n options4.add(new Option(4, \"#\"));\n QUESTION.add(new Question(4, \"What is the chemical symbol for tungsten?\", getCategory(4), options4, options4.get(2)));\n\n List<Option> options5 = new ArrayList<Option>();\n options5.add(new Option(1, \"Pulsar\"));\n options5.add(new Option(2, \"Draconis\"));\n options5.add(new Option(3, \"Aludra\"));\n options5.add(new Option(4, \"Alwaid\"));\n QUESTION.add(new Question(5, \"What is a highly magnetized, rotating neutron star that emits a beam of electromagnetic radiation?\", getCategory(4), options5, options5.get(0)));\n\n List<Option> options6 = new ArrayList<Option>();\n options6.add(new Option(1, \"2\"));\n options6.add(new Option(2, \"4\"));\n options6.add(new Option(3, \"7\"));\n options6.add(new Option(4, \"10\"));\n QUESTION.add(new Question(6, \"At what temperature is Centigrade equal to Fahrenheit?\", getCategory(4), options6, options6.get(2)));\n\n List<Option> options7 = new ArrayList<Option>();\n options7.add(new Option(1, \"Temperature\"));\n options7.add(new Option(2, \"Distance\"));\n options7.add(new Option(3, \"Light Intensity\"));\n options7.add(new Option(4, \"Noise\"));\n QUESTION.add(new Question(7, \"Kelvin is a unit to measure what?\", getCategory(4), options7, options7.get(2)));\n\n List<Option> options8 = new ArrayList<Option>();\n options8.add(new Option(1, \"Mars\"));\n options8.add(new Option(2, \"Jupiter\"));\n options8.add(new Option(3, \"Saturn\"));\n options8.add(new Option(4, \"Neptune\"));\n QUESTION.add(new Question(8, \"Triton is the largest moon of what planet?\", getCategory(4), options8, options8.get(3)));\n\n List<Option> options9 = new ArrayList<Option>();\n options9.add(new Option(1, \"Brain\"));\n options9.add(new Option(2, \"Heart\"));\n options9.add(new Option(3, \"Lungs\"));\n options9.add(new Option(4, \"Skin\"));\n QUESTION.add(new Question(9, \"What is the human body’s biggest organ?\", getCategory(4), options9, options9.get(3)));\n\n List<Option> options10 = new ArrayList<Option>();\n options10.add(new Option(1, \"Skull\"));\n options10.add(new Option(2, \"Knee Cap\"));\n options10.add(new Option(3, \"Shoulder Joint\"));\n options10.add(new Option(4, \"Backbone\"));\n QUESTION.add(new Question(10, \"What is the more common name for the patella?\", getCategory(4), options10, options10.get(1)));\n\n List<Option> options11 = new ArrayList<Option>();\n options11.add(new Option(1, \"Mother India\"));\n options11.add(new Option(2, \"The Guide\"));\n options11.add(new Option(3, \"Madhumati\"));\n options11.add(new Option(4, \"Amrapali\"));\n QUESTION.add(new Question(11, \"Which was the 1st Indian movie submitted for Oscar?\", getCategory(1), options11, options11.get(0)));\n\n List<Option> options12 = new ArrayList<Option>();\n options12.add(new Option(1, \"Gunda\"));\n options12.add(new Option(2, \"Sholey\"));\n options12.add(new Option(3, \"Satte pe Satta\"));\n options12.add(new Option(4, \"Angoor\"));\n QUESTION.add(new Question(12, \"Which film is similar to Seven Brides For Seven Brothers?\", getCategory(1), options12, options12.get(2)));\n\n List<Option> options13 = new ArrayList<Option>();\n options13.add(new Option(1, \"Rocky\"));\n options13.add(new Option(2, \"Pancham\"));\n options13.add(new Option(3, \"Chichi\"));\n options13.add(new Option(4, \"Chintu\"));\n QUESTION.add(new Question(13, \"Music Director R.D. Burman is also known as?\", getCategory(1), options13, options13.get(1)));\n\n List<Option> options14 = new ArrayList<Option>();\n options14.add(new Option(1, \"Nagarjuna\"));\n options14.add(new Option(2, \"Chiranjeevi\"));\n options14.add(new Option(3, \"Rajinikanth\"));\n options14.add(new Option(4, \"NTR\"));\n QUESTION.add(new Question(14, \"Shivaji Rao Gaikwad is the real name of which actor?\", getCategory(1), options14, options14.get(2)));\n\n List<Option> options15 = new ArrayList<Option>();\n options15.add(new Option(1, \"Geraftaar\"));\n options15.add(new Option(2, \"Hum\"));\n options15.add(new Option(3, \"Andha kanoon\"));\n options15.add(new Option(4, \"Agneepath\"));\n QUESTION.add(new Question(15, \"Name the film in which Amitabh Bachchan, Rajinikanth and Kamal Hasan worked together.\", getCategory(1), options15, options15.get(0)));\n\n List<Option> options16 = new ArrayList<Option>();\n options16.add(new Option(1, \"AR Rahman\"));\n options16.add(new Option(2, \"Bhanu Athaiya\"));\n options16.add(new Option(3, \"Gulzar\"));\n options16.add(new Option(4, \"Rasul Pookutty\"));\n QUESTION.add(new Question(16, \"First Indian to win Oscar award?\", getCategory(1), options16, options16.get(1)));\n\n List<Option> options17 = new ArrayList<Option>();\n options17.add(new Option(1, \"Jab tak hai jaan\"));\n options17.add(new Option(2, \"Rab ne bana di jodi\"));\n options17.add(new Option(3, \"Veer zara\"));\n options17.add(new Option(4, \"Ek tha tiger\"));\n QUESTION.add(new Question(17, \"Which was the last movie directed by Yash Chopra?\", getCategory(1), options17, options17.get(0)));\n\n\n List<Option> options18 = new ArrayList<Option>();\n options18.add(new Option(1, \"‘Thala’ Ajith\"));\n options18.add(new Option(2, \"Arjun Sarja\"));\n options18.add(new Option(3, \"Ashutosh Gawariker\"));\n options18.add(new Option(4, \"AK Hangal\"));\n QUESTION.add(new Question(18, \"\\\"Itna sannata kyun hai bhai?\\\" Who said this, now legendary words, in 'Sholay'?\", getCategory(1), options18, options18.get(3)));\n\n List<Option> options19 = new ArrayList<Option>();\n options19.add(new Option(1, \"Tommy\"));\n options19.add(new Option(2, \"Tuffy\"));\n options19.add(new Option(3, \"Toffy\"));\n options19.add(new Option(4, \"Timmy\"));\n QUESTION.add(new Question(19, \"What was the name of Madhuri Dixit’s dog in Hum Aapke Hain Koun?\", getCategory(1), options19, options19.get(1)));\n\n List<Option> options20 = new ArrayList<Option>();\n options20.add(new Option(1, \"Premnath\"));\n options20.add(new Option(2, \"Dilip Kumar\"));\n options20.add(new Option(3, \"Raj Kapoor\"));\n options20.add(new Option(4, \"Kishore Kumar\"));\n QUESTION.add(new Question(20, \"Beautiful actress Madhubala was married to?\", getCategory(1), options20, options20.get(3)));\n\n\n List<Option> options21 = new ArrayList<Option>();\n options21.add(new Option(1, \"Sher Khan\"));\n options21.add(new Option(2, \"Mufasa\"));\n options21.add(new Option(3, \"Simba\"));\n options21.add(new Option(4, \"Sarabi\"));\n QUESTION.add(new Question(21, \"What is the name of the young lion whose story is told in the musical 'The Lion King'?\", getCategory(2), options21, options21.get(2)));\n\n List<Option> options22 = new ArrayList<Option>();\n options22.add(new Option(1, \"Scotland\"));\n options22.add(new Option(2, \"England\"));\n options22.add(new Option(3, \"Germany\"));\n options22.add(new Option(4, \"Netherland\"));\n QUESTION.add(new Question(22, \"Which country's freedom struggle is portrayed in the Mel Gibson movie 'Braveheart'?\", getCategory(2), options22, options22.get(0)));\n\n List<Option> options23 = new ArrayList<Option>();\n options23.add(new Option(1, \"Letters to Juliet\"));\n options23.add(new Option(2, \"Saving Private Ryan\"));\n options23.add(new Option(3, \"Forest Gump\"));\n options23.add(new Option(4, \"Gone With The Wind\"));\n QUESTION.add(new Question(23, \"Which movie had this dialogue \\\"My mama always said, life was like a box of chocolates. You never know what you're gonna get.\", getCategory(2), options23, options23.get(2)));\n\n List<Option> options24 = new ArrayList<Option>();\n options24.add(new Option(1, \"Die\"));\n options24.add(new Option(2, \"Golden\"));\n options24.add(new Option(3, \"Casino\"));\n options24.add(new Option(4, \"Never\"));\n QUESTION.add(new Question(24, \"Excluding \\\"the\\\", which word appears most often in Bond movie titles?\", getCategory(2), options24, options24.get(3)));\n\n List<Option> options25 = new ArrayList<Option>();\n options25.add(new Option(1, \"Bishop\"));\n options25.add(new Option(2, \"Ash\"));\n options25.add(new Option(3, \"Call\"));\n options25.add(new Option(4, \"Carlos\"));\n QUESTION.add(new Question(25, \"Name the android in movie Alien \", getCategory(2), options25, options25.get(1)));\n\n List<Option> options26 = new ArrayList<Option>();\n options26.add(new Option(1, \"Gone with the wind\"));\n options26.add(new Option(2, \"Home footage\"));\n options26.add(new Option(3, \"With Our King and Queen Through India\"));\n options26.add(new Option(4, \"Treasure Island\"));\n QUESTION.add(new Question(26, \"Which was the first colour film to win a Best Picture Oscar?\", getCategory(2), options26, options26.get(0)));\n\n List<Option> options27 = new ArrayList<Option>();\n options27.add(new Option(1, \"Robert Redford\"));\n options27.add(new Option(2, \"Michael Douglas\"));\n options27.add(new Option(3, \"Harrison Ford\"));\n options27.add(new Option(4, \"Patrick Swayze\"));\n QUESTION.add(new Question(27, \"Who played the male lead opposite Sharon Stone in the hugely successful movie 'The Basic Instinct'?\", getCategory(2), options27, options27.get(1)));\n\n List<Option> options28 = new ArrayList<Option>();\n options28.add(new Option(1, \"10,000 BC\"));\n options28.add(new Option(2, \"Day after tomorrow\"));\n options28.add(new Option(3, \"2012\"));\n options28.add(new Option(4, \"The Noah's Ark Principle\"));\n QUESTION.add(new Question(28, \"Which Roland Emmerich movie portrays fictional cataclysmic events that were to take place in early 21st century?\", getCategory(2), options28, options28.get(2)));\n\n List<Option> options29 = new ArrayList<Option>();\n options29.add(new Option(1, \"Finding Nemo\"));\n options29.add(new Option(2, \"The Incredibles\"));\n options29.add(new Option(3, \"Monsters, Inc.\"));\n options29.add(new Option(4, \"Toy Story\"));\n QUESTION.add(new Question(29, \"What was the first movie by Pixar to receive a rating higher than G in the United States?\", getCategory(2), options29, options29.get(1)));\n\n List<Option> options30 = new ArrayList<Option>();\n options30.add(new Option(1, \"Draco\"));\n options30.add(new Option(2, \"Harry\"));\n options30.add(new Option(3, \"Hermione\"));\n options30.add(new Option(4, \"Ron\"));\n QUESTION.add(new Question(30, \"In the 'Prisoner of Azkaban', who throws rocks at Hagrid's hut so that Harry, Ron and Hermione can leave?\", getCategory(2), options30, options30.get(2)));\n\n List<Option> options31 = new ArrayList<Option>();\n options31.add(new Option(1, \"Brett Lee\"));\n options31.add(new Option(2, \"Adam Gilchrist\"));\n options31.add(new Option(3, \"Jason Gillespie\"));\n options31.add(new Option(4, \"Glenn McGrath\"));\n QUESTION.add(new Question(31, \"'Dizzy' is the nickname of what Australian player?\", getCategory(3), options31, options31.get(2)));\n\n List<Option> options32 = new ArrayList<Option>();\n options32.add(new Option(1, \"1883 between Australia and Wales\"));\n options32.add(new Option(2, \"1844 between Canada and the USA\"));\n options32.add(new Option(3, \"1869 between England and Australia\"));\n options32.add(new Option(4, \"1892 between England and India\"));\n QUESTION.add(new Question(32, \"In what year was the first international cricket match held?\", getCategory(3), options32, options32.get(1)));\n\n List<Option> options33 = new ArrayList<Option>();\n options33.add(new Option(1, \"Salim Durrani\"));\n options33.add(new Option(2, \"Farooq Engineer\"));\n options33.add(new Option(3, \"Vijay Hazare\"));\n options33.add(new Option(4, \"Mansur Ali Khan Pataudi\"));\n QUESTION.add(new Question(33, \"Which former Indian cricketer was nicknamed 'Tiger'?\", getCategory(3), options33, options33.get(3)));\n\n List<Option> options34 = new ArrayList<Option>();\n options34.add(new Option(1, \"Piyush Chawla\"));\n options34.add(new Option(2, \"Gautam Gambhir\"));\n options34.add(new Option(3, \"Irfan Pathan\"));\n options34.add(new Option(4, \"Suresh Raina\"));\n QUESTION.add(new Question(34, \"Who was named as the ICC Emerging Player of the Year 2004?\", getCategory(3), options34, options34.get(2)));\n\n List<Option> options35 = new ArrayList<Option>();\n options35.add(new Option(1, \"Subhash Gupte\"));\n options35.add(new Option(2, \"M.L.Jaisimha\"));\n options35.add(new Option(3, \"Raman Lamba\"));\n options35.add(new Option(4, \"Lala Amarnath\"));\n QUESTION.add(new Question(35, \"Which cricketer died on the field in Bangladesh while playing for Abahani Club?\", getCategory(3), options35, options35.get(2)));\n\n List<Option> options36 = new ArrayList<Option>();\n options36.add(new Option(1, \"V. Raju\"));\n options36.add(new Option(2, \"Rajesh Chauhan\"));\n options36.add(new Option(3, \"Arshad Ayub\"));\n options36.add(new Option(4, \"Narendra Hirwani\"));\n QUESTION.add(new Question(36, \"In 1987-88, which Indian spinner took 16 wickets on his Test debut?\", getCategory(3), options36, options36.get(3)));\n\n List<Option> options37 = new ArrayList<Option>();\n options37.add(new Option(1, \"Ravi Shastri\"));\n options37.add(new Option(2, \"Dilip Vengsarkar\"));\n options37.add(new Option(3, \"Sachin Tendulkar\"));\n options37.add(new Option(4, \"Sanjay Manjrekar\"));\n QUESTION.add(new Question(37, \"Which former Indian Test cricketer equalled Gary Sobers world record of six sixes in an over in a Ranji Trophy match?\", getCategory(3), options37, options37.get(0)));\n\n List<Option> options38 = new ArrayList<Option>();\n options38.add(new Option(1, \"Mohsin khan\"));\n options38.add(new Option(2, \"Wasim Akram\"));\n options38.add(new Option(3, \"Naveen Nischol\"));\n options38.add(new Option(4, \"None Of The Above\"));\n QUESTION.add(new Question(38, \"Reena Roy the Indian film actress married a cricketer?\", getCategory(3), options38, options38.get(0)));\n\n List<Option> options39 = new ArrayList<Option>();\n options39.add(new Option(1, \"London, England\"));\n options39.add(new Option(2, \"Mumbai, India\"));\n options39.add(new Option(3, \"Lahore, Pakistan\"));\n options39.add(new Option(4, \"Nairobi, Kenya\"));\n QUESTION.add(new Question(39, \"Where did Yuvraj Singh make his ODI debut?\", getCategory(3), options39, options39.get(3)));\n\n List<Option> options40 = new ArrayList<Option>();\n options40.add(new Option(1, \"Arvind De Silva\"));\n options40.add(new Option(2, \"Roshan Mahanama\"));\n options40.add(new Option(3, \"Harshan Tilakaratne\"));\n options40.add(new Option(4, \"None Of The Above\"));\n QUESTION.add(new Question(40, \"Kapil Dev's 432 (world) record breaking victim was?\", getCategory(3), options40, options40.get(2)));\n\n List<Option> options41 = new ArrayList<Option>();\n options41.add(new Option(1, \"Vatican\"));\n options41.add(new Option(2, \"Iceland\"));\n options41.add(new Option(3, \"Netherlands\"));\n options41.add(new Option(4, \"Hungary\"));\n QUESTION.add(new Question(41, \"Which country has the lowest population density of any country in Europe?\", getCategory(5), options41, options41.get(1)));\n\n List<Option> options42 = new ArrayList<Option>();\n options42.add(new Option(1, \"Cambodia\"));\n options42.add(new Option(2, \"Thailand\"));\n options42.add(new Option(3, \"Mynamar\"));\n options42.add(new Option(4, \"Bhutan\"));\n QUESTION.add(new Question(42, \"Angkor Wat, the largest religious monument in the world, is in which country?\", getCategory(5), options42, options42.get(0)));\n\n List<Option> options43 = new ArrayList<Option>();\n options43.add(new Option(1, \"Southern\"));\n options43.add(new Option(2, \"Northern and Southern\"));\n options43.add(new Option(3, \"Northern\"));\n options43.add(new Option(4, \"None of the above\"));\n QUESTION.add(new Question(43, \"Is the Tropic of Cancer in the northern or southern hemisphere?\", getCategory(5), options43, options43.get(2)));\n\n List<Option> options44 = new ArrayList<Option>();\n options44.add(new Option(1, \"Bangladesh\"));\n options44.add(new Option(2, \"Nepal\"));\n options44.add(new Option(3, \"Pakistan\"));\n options44.add(new Option(4, \"China\"));\n QUESTION.add(new Question(44, \"The Ganges flows through India and which other country?\", getCategory(5), options44, options44.get(0)));\n\n List<Option> options45 = new ArrayList<Option>();\n options45.add(new Option(1, \"Indian\"));\n options45.add(new Option(2, \"Pacific\"));\n options45.add(new Option(3, \"Arctic\"));\n options45.add(new Option(4, \"Atlantic\"));\n QUESTION.add(new Question(45, \"Which ocean lies on the east coast of the United States?\", getCategory(5), options45, options45.get(3)));\n\n List<Option> options46 = new ArrayList<Option>();\n options46.add(new Option(1, \"Prime Axis\"));\n options46.add(new Option(2, \"Lambert Line\"));\n options46.add(new Option(3, \"Prime Meridian\"));\n options46.add(new Option(4, \"Greenwich\"));\n QUESTION.add(new Question(46, \"What is the imaginary line called that connects the north and south pole?\", getCategory(5), options46, options46.get(2)));\n\n List<Option> options47 = new ArrayList<Option>();\n options47.add(new Option(1, \"Tropic of Cancer\"));\n options47.add(new Option(2, \"Tropic of Capricorn\"));\n QUESTION.add(new Question(47, \"The most northerly circle of latitude on the Earth at which the Sun may appear directly overhead at its culmination is called?\", getCategory(5), options47, options47.get(0)));\n\n List<Option> options48 = new ArrayList<Option>();\n options48.add(new Option(1, \"Nevada\"));\n options48.add(new Option(2, \"Arizona\"));\n options48.add(new Option(3, \"New Mexico\"));\n options48.add(new Option(4, \"San Fransisco\"));\n QUESTION.add(new Question(48, \"Which U.S. state is the Grand Canyon located in?\", getCategory(5), options48, options48.get(1)));\n\n List<Option> options49 = new ArrayList<Option>();\n options49.add(new Option(1, \"Indian Ocean\"));\n options49.add(new Option(2, \"Atlantic Ocean\"));\n options49.add(new Option(3, \"Pacific Ocean\"));\n options49.add(new Option(4, \"Arctic Ocean\"));\n QUESTION.add(new Question(49, \"Which is the largest body of water?\", getCategory(5), options49, options49.get(2)));\n\n List<Option> options50 = new ArrayList<Option>();\n options50.add(new Option(1, \"Maldives\"));\n options50.add(new Option(2, \"Monaco\"));\n options50.add(new Option(3, \"Tuvalu\"));\n options50.add(new Option(4, \"Vatican City\"));\n QUESTION.add(new Question(50, \"Which is the smallest country, measured by total land area?\", getCategory(5), options50, options50.get(3)));\n\n List<Option> options51 = new ArrayList<Option>();\n options51.add(new Option(1, \"1923\"));\n options51.add(new Option(2, \"1938\"));\n options51.add(new Option(3, \"1917\"));\n options51.add(new Option(4, \"1914\"));\n QUESTION.add(new Question(51, \"World War I began in which year?\", getCategory(6), options51, options51.get(3)));\n\n List<Option> options52 = new ArrayList<Option>();\n options52.add(new Option(1, \"France\"));\n options52.add(new Option(2, \"Germany\"));\n options52.add(new Option(3, \"Austria\"));\n options52.add(new Option(4, \"Hungary\"));\n QUESTION.add(new Question(52, \"Adolf Hitler was born in which country?\", getCategory(6), options52, options52.get(2)));\n\n List<Option> options53 = new ArrayList<Option>();\n options53.add(new Option(1, \"1973\"));\n options53.add(new Option(2, \"Austin\"));\n options53.add(new Option(3, \"Dallas\"));\n options53.add(new Option(4, \"1958\"));\n QUESTION.add(new Question(53, \"John F. Kennedy was assassinated in?\", getCategory(6), options53, options53.get(2)));\n\n List<Option> options54 = new ArrayList<Option>();\n options54.add(new Option(1, \"Johannes Gutenburg\"));\n options54.add(new Option(2, \"Benjamin Franklin\"));\n options54.add(new Option(3, \"Sir Isaac Newton\"));\n options54.add(new Option(4, \"Martin Luther\"));\n QUESTION.add(new Question(54, \"The first successful printing press was developed by this man.\", getCategory(6), options54, options54.get(0)));\n\n List<Option> options55 = new ArrayList<Option>();\n options55.add(new Option(1, \"The White Death\"));\n options55.add(new Option(2, \"The Black Plague\"));\n options55.add(new Option(3, \"Smallpox\"));\n options55.add(new Option(4, \"The Bubonic Plague\"));\n QUESTION.add(new Question(55, \"The disease that ravaged and killed a third of Europe's population in the 14th century is known as\", getCategory(6), options55, options55.get(3)));\n\n List<Option> options56 = new ArrayList<Option>();\n options56.add(new Option(1, \"Panipat\"));\n options56.add(new Option(2, \"Troy\"));\n options56.add(new Option(3, \"Waterloo\"));\n options56.add(new Option(4, \"Monaco\"));\n QUESTION.add(new Question(56, \"Napoleon was finally defeated at the battle known as?\", getCategory(6), options56, options56.get(2)));\n\n List<Option> options57 = new ArrayList<Option>();\n options57.add(new Option(1, \"Magellan\"));\n options57.add(new Option(2, \"Cook\"));\n options57.add(new Option(3, \"Marco\"));\n options57.add(new Option(4, \"Sir Francis Drake\"));\n QUESTION.add(new Question(57, \"Who was the first Western explorer to reach China?\", getCategory(6), options57, options57.get(2)));\n\n List<Option> options58 = new ArrayList<Option>();\n options58.add(new Option(1, \"Shah Jahan\"));\n options58.add(new Option(2, \"Chandragupta Maurya\"));\n options58.add(new Option(3, \"Humayun\"));\n options58.add(new Option(4, \"Sher Shah Suri\"));\n QUESTION.add(new Question(58, \"Who built the Grand Trunk Road?\", getCategory(6), options58, options58.get(3)));\n\n List<Option> options59 = new ArrayList<Option>();\n options59.add(new Option(1, \"Jawaharlal Nehru\"));\n options59.add(new Option(2, \"M. K. Gandhi\"));\n options59.add(new Option(3, \"Dr. Rajendra Prasad\"));\n options59.add(new Option(4, \"Dr. S. Radhakrishnan\"));\n QUESTION.add(new Question(59, \"Who was the first President of India?\", getCategory(6), options59, options59.get(2)));\n\n List<Option> options60 = new ArrayList<Option>();\n options60.add(new Option(1, \"8\"));\n options60.add(new Option(2, \"10\"));\n options60.add(new Option(3, \"5\"));\n options60.add(new Option(4, \"18\"));\n QUESTION.add(new Question(60, \"How many days did the battle of Mahabharata last?\", getCategory(6), options60, options60.get(3)));\n }\n return QUESTION;\n }", "@Override\n\t@Transactional(readOnly=true)\n\tpublic List<QuestionMultiChoice> findAll() {\n\t\treturn Lists.newArrayList(qcmRepository.findAll());\n\t}", "List<Result> getResultsByQuizId(int quizId);", "@Override\n\tpublic List<QA> getQAList() {\n\t\treturn qaDao.getQAList();\n\t}", "public AnswerStatistics getAnswerStatisticsbyID(int sid,int qid);", "public List<Respuesta> getRespuestas(Pregunta q, int pageSize, int page, boolean crono);", "@SuppressWarnings(\"unchecked\")\n\tpublic List<Questions> getTenQuestion(String tag){\n\t\tResponsesDao rdao = new ResponsesDao();\n\t\tTagsDao tdao = new TagsDao();\n\t\tTags tags = tdao.getTagByString(tag);\n\t\tList<Questions> quest = new ArrayList<>();\n\t\tList<Questions> retquest = new ArrayList<>();\n\t\tSession session = HibernateUtil.getSessionFactory().openSession();\n\t\tquest =\tsession.\tcreateQuery(\"from Questions where tid = :namevar\").\n\t\t\t\tsetInteger(\"namevar\", tags.getTagId()).list();\n\t\tif(quest.size() != 0) {\n\t\tfor(int i = 0; i <10; i++) {\n\t\t\tint rand = (int) (Math.random() * quest.size());\n\t\t\tretquest.add(rdao.getResponses(quest.get(rand)));\n\t\t}\n\t\t}\n\t\tsession.close();\n\t\treturn retquest;\n\t}", "public Map<String ,String> GerRegularQ(int AssessmentId) {\n Map<String, String> map = new HashMap<String, String>();\n List<String> indexes = GetAssessmentIndexes(AssessmentId);\n\n for (String index : indexes) {\n try {\n Statement stmt = Con.createStatement();\n String query = String.format(\"SELECT qora, content FROM dqs_qanda WHERE \" +\n \"((SELECT content FROM dqs_qanda WHERE qora = 'question%s_t') = 'n') AND \" +\n \"(qora='question%s' OR qora = 'question%s_c')\", index, index, index);\n //System.out.println(query);\n ResultSet rs = stmt.executeQuery(query);\n while(rs.next()) {\n map.put(rs.getString(\"qora\"), rs.getString(\"content\"));\n }\n }\n catch (Exception e) {\n System.out.println(e.getMessage());\n }\n }\n return map;\n }", "public static Object[] loadQuestions(String surveyId, String serverBase)\r\n \t\t\tthrows Exception {\r\n \t\tObject[] results = new Object[2];\r\n \t\tMap<String, String> questions = new HashMap<String, String>();\r\n \t\tList<QuestionGroupDto> groups = fetchQuestionGroups(serverBase,\r\n \t\t\t\tsurveyId);\r\n \t\tList<String> keyList = new ArrayList<String>();\r\n \t\tif (groups != null) {\r\n \t\t\tfor (QuestionGroupDto group : groups) {\r\n \t\t\t\tList<QuestionDto> questionDtos = fetchQuestions(serverBase,\r\n \t\t\t\t\t\tgroup.getKeyId());\r\n \t\t\t\tif (questionDtos != null) {\r\n \t\t\t\t\tfor (QuestionDto question : questionDtos) {\r\n \t\t\t\t\t\tkeyList.add(question.getKeyId().toString());\r\n \t\t\t\t\t\tquestions.put(question.getKeyId().toString(), question\r\n \t\t\t\t\t\t\t\t.getText());\r\n \t\t\t\t\t}\r\n \t\t\t\t}\r\n \t\t\t}\r\n \t\t}\r\n \t\tresults[0] = keyList;\r\n \t\tresults[1] = questions;\r\n \t\treturn results;\r\n \t}", "public List<Question> getQuestions()\n\t{\n\t\tList<Question> shallowCopy = new ArrayList<>();\n\t\tshallowCopy.addAll(allQuestions);\n\t\treturn shallowCopy;\n\t}", "List<Quarter> getQuarterList(Integer cityId)throws EOTException;", "public static List<Question> getAllCategoryQuestions(Category cat) {\n List<Question> questions = getQuestions(); //get all the questions\n List<Question> categoryQuestions = new ArrayList<Question>(); //make new list of questions\n for (Question q : questions) {\n if (q.getCategory().getId() == cat.getId()) {\n categoryQuestions.add(q);\n }\n }\n return categoryQuestions;\n }", "public List<Question> getQuestions() {\n return questionList;\n }", "public List<Question> listQuestion(String query) throws StorageException {\n\t\tif (query == null || query.compareTo(\"\") == 0) {\n\t\t\tquery = \"1\";\n\t\t}\n\t\tList<Question> questionList = new ArrayList<Question>();\n\t\tString sortOrder = \"_ID ASC\";\n\t\tString[] selectionArguments = null;\n\t\tQuestion question;\n\t\tCursor cursor = contentResolver.query(LocalStorageContentProvider.QUESTION_URI, null, query, selectionArguments,\n\t\t\t\tsortOrder);\n\t\ttry {\n\t\t\tif (cursor.moveToFirst()) {\n\t\t\t\tdo {\n\t\t\t\t\tquestion = new Question();\n\t\t\t\t\tquestion.set_Id(cursor.getString(cursor.getColumnIndex(\"_ID\")));\n\t\t\t\t\tquestion.setType(cursor.getString(cursor.getColumnIndex(\"TYPE\")));\n\t\t\t\t\tquestion.setTitle(cursor.getString(cursor.getColumnIndex(\"TITLE\")));\n\t\t\t\t\tquestion.setAnswer(cursor.getString(cursor.getColumnIndex(\"ANSWER\")));\n\t\t\t\t\tquestion.set_idQuestionSet(cursor.getString(cursor.getColumnIndex(\"QUESTIONSET_ID\")));\n\t\t\t\t\tquestionList.add(question);\n\t\t\t\t} while (cursor.moveToNext());\n\t\t\t}\n\t\t} catch (Exception e) {\n\t\t\tthrow new StorageException();\n\t\t} finally {\n\t\t\tif (cursor != null && !cursor.isClosed()) {\n\t\t\t\tcursor.close();\n\t\t\t}\n\t\t}\n\t\treturn questionList;\n\t}", "public Answerpojo getAnswerByQno(int qno){\n if((answerList!=null))\n for(Answerpojo ans:answerList){\n // System.out.println(\" inside for loop\");\n if(ans.getQno()==qno)\n { \n System.out.println(\" inside if return ans \");\n return ans;\n }\n // System.out.println(\"outside if return null\");\n }\n //System.out.println(\"outside for\");\n return null;\n }", "private void parseQuestions()\n\t{\n\t\tlog.info(\"Parsing questions\");\n\t\t@SuppressWarnings(\"unchecked\")\n\t\tList<Element> questions_list = doc.selectNodes(\"//document/questions/rows/row\");\n\t\tq_l10ns_node = doc.selectSingleNode(\"//document/question_l10ns/rows\");\n\t\tsq_node = doc.selectSingleNode(\"//document/subquestions/rows\");\n\t\tq_node = doc.selectSingleNode(\"//document/questions/rows\");\n\t\ta_node = doc.selectSingleNode(\"//document/answers/rows\");\n\n\t\tfor (Element question : questions_list) {\n\t\t\tString qid = question.element(\"qid\").getText();\n\t\t\tlog.debug(\"Working on question: \" + qid);\n\t\t\tQuestion q = new Question(qid,\n\t\t\t\t\t\t\t\t\t Integer.parseInt(question.element(\"gid\").getText()),\n\t\t\t\t\t\t\t\t\t question.element(\"type\").getText(),\n\t\t\t\t\t\t\t\t\t q_l10ns_node.selectSingleNode(\"row[qid=\" + qid + \"]/question\").getText(),\n\t\t\t\t\t\t\t\t\t question.element(\"title\").getText(),\n\t\t\t\t\t\t\t\t\t question.element(\"mandatory\").getText().equals(\"N\") ? \"No\" : \"Yes\",\n\t\t\t\t\t\t\t\t\t q_l10ns_node.selectSingleNode(\"row[qid=\" + qid + \"]/language\").getText());\n\n\t\t\t// Add a description, if there is one\n\t\t\tNode desc = q_l10ns_node.selectSingleNode(\"row[qid=\" + q.getQid() + \"]/help\");\n\t\t\tif (desc != null) {\n\t\t\t\tq.setDescription(desc.getText());\n\t\t\t}\n\n\t\t\taddCondition(q);\n\n\t\t\tswitch (q.type) {\n\t\t\t\t// Normal Text Fields\n\t\t\t\tcase \"S\":\n\t\t\t\tcase \"T\":\n\t\t\t\tcase \"U\":\n\t\t\t\t\tq.setType(\"T\");\n\t\t\t\t\tsurvey.addQuestion(q);\n\t\t\t\t\tbreak;\n\t\t\t\t// Date/Time\n\t\t\t\tcase \"D\":\n\t\t\t\t\tdate_time_qids.add(q.getQid());\n\t\t\t\t\tbreak;\n\t\t\t\t// Numeric Input\n\t\t\t\tcase \"N\":\n\t\t\t\t\tif (check_int_only(q)) {\n\t\t\t\t\t\tq.setType(\"I\");\n\t\t\t\t\t}\n\t\t\t\t\tadd_range(q);\n\t\t\t\t\tsurvey.addQuestion(q);\n\t\t\t\t\tbreak;\n\t\t\t\t// Single 5-Point Choice\n\t\t\t\tcase \"5\":\n\t\t\t\t\tq.setType(\"A\");\n\t\t\t\t\tq.setAnswers(new AnswersList(\"5pt.cl\", ClGenerator.getIntCl(5), \"string\", true));\n\t\t\t\t\tsurvey.addQuestion(q);\n\t\t\t\t\tbreak;\n\t\t\t\t// Yes/No\n\t\t\t\tcase \"Y\":\n\t\t\t\t\tq.setType(\"A\");\n\t\t\t\t\tq.setAnswers(new AnswersList(\"YN.cl\", ClGenerator.getYNCl(), \"string\", false));\n\t\t\t\t\tsurvey.addQuestion(q);\n\t\t\t\t\tbreak;\n\t\t\t\t// Gender\n\t\t\t\tcase \"G\":\n\t\t\t\t\tq.setType(\"A\");\n\t\t\t\t\tq.setAnswers(new AnswersList(\"Gender.cl\", ClGenerator.getGenderCl(), \"string\", false));\n\t\t\t\t\tsurvey.addQuestion(q);\n\t\t\t\t\tbreak;\n\t\t\t\t// List with comment\n\t\t\t\tcase \"O\":\n\t\t\t\t\taddComment(q);\n\t\t\t\t// Radio List\n\t\t\t\tcase \"L\":\n\t\t\t\t// Dropdown List\n\t\t\t\tcase \"!\":\n\t\t\t\t\tboolean oth = question.elementText(\"other\").equals(\"Y\");\n\t\t\t\t\tif(oth) {\n\t\t\t\t\t\taddOtherQuestion(q);\n\t\t\t\t\t}\n\t\t\t\t\tq.setType(\"A\");\n\t\t\t\t\tq.setAnswers(new AnswersList(q.getQid() + \".cl\", getAnswerCodesByID(q.getQid(), oth), \"string\", false));\n\t\t\t\t\tsurvey.addQuestion(q);\n\t\t\t\t\tbreak;\n\t\t\t\t// Multiple Texts\n\t\t\t\t// Input On Demand\n\t\t\t\tcase \"Q\":\n\t\t\t\t\taddSubquestions(q, \"T\");\n\t\t\t\t\tbreak;\n\t\t\t\t// Multiple Numeric Inputs\n\t\t\t\tcase \"K\":\n\t\t\t\t\tadd_range(q);\n\t\t\t\t\tif (check_int_only(q)){\n\t\t\t\t\t\taddSubquestions(q, \"I\");\n\t\t\t\t\t} else {\n\t\t\t\t\t\taddSubquestions(q, \"N\");\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\t// Dual scale array\n\t\t\t\tcase \"1\":\n\t\t\t\t\tHashMap<String, String>[] code_lists = ClGenerator.getDualScaleCls(q.getQid(), getAnswerIdsByID(q.getQid()), a_node);\n\t\t\t\t\taddSubquestionsWithCL(q, q.getQid() + \".0\", code_lists[0], \"string\", false, \"-0\");\n\t\t\t\t\taddSubquestionsWithCL(q, q.getQid() + \".1\", code_lists[1], \"string\", false, \"-1\");\n\t\t\t\t\tbreak;\n\t\t\t\t// Array by column\n\t\t\t\tcase \"H\":\n\t\t\t\t// Flexible Array\n\t\t\t\tcase \"F\":\n\t\t\t\t\taddSubquestionsWithCL(q, q.getQid().concat(\".cl\"), getAnswerCodesByID(q.getQid(), false), \"string\", false, \"\");\n\t\t\t\t\tbreak;\n\t\t\t\t// 5pt Array\n\t\t\t\tcase \"A\":\n\t\t\t\t\taddSubquestionsWithCL(q, \"5pt.cl\", ClGenerator.getIntCl(5), \"integer\", true, \"\");\n\t\t\t\t\tbreak;\n\t\t\t\t// 10pt Array\n\t\t\t\tcase \"B\":\n\t\t\t\t\taddSubquestionsWithCL(q, \"10pt.cl\", ClGenerator.getIntCl(10), \"integer\", true, \"\");\n\t\t\t\t\tbreak;\n\t\t\t\t// Increase/Same/Decrease Array\n\t\t\t\tcase \"E\":\n\t\t\t\t\taddSubquestionsWithCL(q, \"ISD.cl\", ClGenerator.getISDCL(), \"string\", false, \"\");\n\t\t\t\t\tbreak;\n\t\t\t\t// 10pt Array\n\t\t\t\tcase \"C\":\n\t\t\t\t\taddSubquestionsWithCL(q, \"YNU.cl\", ClGenerator.getYNUCL(), \"string\", false, \"\");\n\t\t\t\t\tbreak;\n\t\t\t\t// Matrix with numerical input\n\t\t\t\tcase \":\":\n\t\t\t\t\tq.setType(\"N\");\n\t\t\t\t\taddQuestionMatrix(q);\n\t\t\t\t\tbreak;\n\t\t\t\t// Matrix with text input\n\t\t\t\tcase \";\":\n\t\t\t\t\tq.setType(\"T\");\n\t\t\t\t\taddQuestionMatrix(q);\n\t\t\t\t\tbreak;\n\t\t\t\t// Multiple Choice (Normal, Bootstrap, Image select)\n\t\t\t\tcase \"M\":\n\t\t\t\t\taddSubquestionsWithCL(q, \"MC.cl\", ClGenerator.getMCCL(), \"string\", false, \"\");\n\t\t\t\t\tif (question.elementTextTrim(\"other\").equals(\"Y\")) {\n\t\t\t\t\t\tq.setQid(q.getQid().concat(\"other\"));\n\t\t\t\t\t\tq.setType(\"T\");\n\t\t\t\t\t\tsurvey.addQuestion(q);\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\t// MC with comments\n\t\t\t\tcase \"P\":\n\t\t\t\t\taddSubquestionsWithCL(q, \"MC.cl\", ClGenerator.getMCCL(), \"string\", false, \"\");\n\t\t\t\t\tbreak;\n\t\t\t\tdefault:\n\t\t\t\t\tlog.error(\"Question type not supported: \" + q.type);\n\t\t\t}\n\t\t}\n\t}", "@Override\n\tpublic List<Document> findDocumentsByQuestion(String question) {\n\t\t\n\t\tString [] keyWords = question.split(\" \");\n\t\tList<Document> documents = new ArrayList<>();\n\t\t\n\t\tList<Filters> filters = filtersRepository.findByCommonsWordsWordIn(keyWords);\n\t\tfor(Filters f : filters){\n\t\t\tdocuments.addAll(f.getDocuments());\n\t\t}\n\t\t\n\t\treturn documents;\n\t}", "public QuestionElement getQuestion(){\r\n\t\treturn ques;\r\n\t}", "List<Question11> selectByExample(Question11Example example);", "public List<T> query(QueryObject qo) {\n\t\treturn null;\n\t}", "public static List<Question> fetch(int id) throws ApplicationException {\n List<Question> result = null;\n\n Connection connection = null;\n try {\n connection = ConnectionPool.getConnection();\n result = QuestionDatabaseAccess.fetch(connection, id);\n } finally {\n ConnectionPool.releaseConnection(connection);\n }\n\n return result;\n }", "public List<Answer> getAnswersByPoints(Question q) {\n \tList<Answer> finalAnswers = new ArrayList<Answer>();\n List<Answer> answers = q.getAnswers();\n \n for(Answer a: answers) {\n \tif(a.getAuthor().equals(this))\n \t\tfinalAnswers.add(a);\n }\n // We want the most recent questions first so reverse the array with\n // Collections.reverse\n // PostPointsComparator returns questions in asc we want desc\n Collections.sort(finalAnswers, new PostPointsComparator());\n Collections.reverse(finalAnswers);\n\n return finalAnswers;\n }", "public List<Question> getQuestions(Category category) {\n List<Question> questions = null;\n try {\n DataBaseBroker dbb = new DataBaseBroker();\n dbb.loadDriver();\n dbb.establishConnection();\n questions = dbb.getQuestion(category);\n dbb.commit();\n dbb.closeConnection();\n } catch (Exception ex) {\n Logger.getLogger(GameDBLogic.class.getName()).log(Level.SEVERE, null, ex);\n }\n return questions;\n }", "@GetMapping(\"/{quesId}\")\n\tpublic Question get(@PathVariable(\"quesId\") Long quesId) {\n\t\treturn this.questionService.getQuestion(quesId);\n\t}", "List<Question> selectByExample(QuestionExample example);", "List<Question> selectByExample(QuestionExample example);", "List<Question> selectByExample(QuestionExample example);", "List<Question> selectByExample(QuestionExample example);", "public Pyramid[] getAllByQSortId(final int qsortId) {\n // TODO implement after QSort implemented\n Pyramid[] result=null;\n try {\n QSortHelper qSortHelper=(QSortHelper)this.dbc.getHelper(DatabaseConnector.TYPE_QSORT);\n result=new Pyramid[1];\n result[0]=getObjectById(qSortHelper.getStudyIdByQSortId(qsortId));\n //TODO: setCells! //this.getPyramidCells(qsortId, result[0].getId());\n } catch (HelperNotFoundException e) {\n e.printStackTrace();\n return null;\n }\n return result;\n }", "List<Question27> selectByExample(Question27Example example);", "public List<Literal> query(Literal q) {\n\r\n\t\t\r\n\t\tList<Literal> result = datalogReasoner.query(compiledClauses, q);\r\n\t\t\r\n\t\tLDLPProgramQueryResultDecompiler decompiler = new LDLPProgramQueryResultDecompiler();\r\n\t\t\r\n\t\tresult = decompiler.decompileLiterals(result);\r\n\t\t\t\t\r\n\t\treturn result;\r\n\r\n\r\n\t}", "public List<Question> listQuestions(DataSource ds){\n\t ArrayList<Question> questions = new ArrayList<Question>();\n ResultSet rs = null;\n Statement stmt = null;\n try{\n conn = ds.getConnection();\n stmt = conn.createStatement();\n rs = stmt.executeQuery(\n \"SELECT id, name, image, sound, category, level, easy, medium, hard FROM questions\");\n while(rs.next()){\n Question currentQuestion = new Question();\n currentQuestion.setQuestionId(rs.getInt(1));\n currentQuestion.setWord(rs.getString(2));\n currentQuestion.setImage(rs.getString(3));\n currentQuestion.setSound(rs.getString(4));\n currentQuestion.setCategory(rs.getString(5));\n currentQuestion.setLevel(rs.getInt(6));\n String difficulty = \"\";\n if (rs.getInt(7)==1)\n difficulty = \"easy\";\n else \n if(rs.getInt(8)==1)\n difficulty = \"medium\";\n else\n if(rs.getInt(9)==1)\n difficulty = \"hard\";\n currentQuestion.setDifficulty(difficulty);\n questions.add(currentQuestion);\n }\n conn.close();\n }\n catch(Exception ex){ex.printStackTrace();}\n finally {\n try {if (rs != null) rs.close();} catch (SQLException e) {}\n try {if (stmt != null) stmt.close();} catch (SQLException e) {}\n try {if (conn != null) conn.close();} catch (SQLException e) {}\n }\n System.out.println(\"TMA...All qns count: \" + questions.size());\n \n\t return questions;\n\t}", "@Override\n\t@Transactional(readOnly=true)\n\tpublic List<QuestionMultiChoice> findByTags_Id(Long id) {\n\t\tList<QuestionMultiChoice> list = qcmRepository.findByTags_Id(id);\n\t\treturn list;\n\t}", "Optional<Question> findByIdWithAllDetails(QuestionId id);", "public List<quanhuyen> getAllQuanHuyen() {\n List<quanhuyen> qhlists1 = new ArrayList<>();\n // Step 1: Establishing a Connection\n try (Connection connection = DBConnection.createConnection();\n PreparedStatement statement = connection.prepareStatement(getAll);) {\n\n ResultSet resultSet = statement.executeQuery();\n\n while (resultSet.next()) {\n int id = resultSet.getInt(\"id\");\n String tenQH = resultSet.getString(\"ten\");\n int tpid = resultSet.getInt(\"ThanhPhoid\");\n int trangthai = resultSet.getInt(\"trangthai\");\n qhlists1.add(new quanhuyen(id, tenQH, tpid, trangthai));\n }\n } catch (SQLException e) {\n printSQLException(e);\n }\n return qhlists1;\n }", "List<AnswerList> findAllAnsList();", "public static void printQuestions(ArrayList<Question> quest) {\n\t\tfor (Question question : quest) {\n\t\t\tquestion.getText();\n\t\t}\n\t}", "@WebMethod public Vector<Question> getQuestions(Event ev);", "protected List<Question> getListNumOfQuestions(List<Question> q, int n) {\n \tList<Question> finalQuestions = new ArrayList<Question>();\n \tfor (int i = 0; i < n; i++) {\n finalQuestions.add(q.get(i));\n }\n return finalQuestions;\n }", "List<Question14> selectByExample(Question14Example example);", "public void printQuestions()\r\n\t{\r\n\t\tfor(int i = 0; i < questions.size(); i++)\r\n\t\t{\r\n\t\t\tString q = questions.get(i).toString();\r\n\t\t\tSystem.out.println( (i+1) + \". \" + q);\r\n\t\t}\r\n\t}", "public ArrayList<Integer> getQuestionIDs(int cID) {\n ArrayList<Integer> questions = new ArrayList<Integer>();\n String query;\n\n try {\n Connection con = Database.createDBconnection();\n Statement stmt = con.createStatement();\n query = \"SELECT question_ID FROM question WHERE category_ID='\" + cID + \"';\";\n ResultSet rs = stmt.executeQuery(query);\n\n while(rs.next()) {\n questions.add(rs.getInt(\"question_ID\"));\n }\n\n Database.closeDBconnection(con);\n }\n catch (Exception e) {\n e.printStackTrace();\n }\n return questions;\n }", "@Override\n\tpublic List<Question> getQuestions() {\n\t\treturn null;\n\t}", "public List<AnswerEntity> getAllAnswersToQuestion(\n final String questionId, final String accessToken)\n throws AuthorizationFailedException, InvalidQuestionException {\n UserAuthEntity userAuthEntity = userAuthDao.getUserAuthByToken (accessToken);\n if (userAuthEntity == null) {\n throw new AuthorizationFailedException (\"ATHR-001\", \"User has not signed in\");\n } else if (userAuthEntity.getLogoutAt () != null) {\n throw new AuthorizationFailedException (\n \"ATHR-002\", \"User is signed out.Sign in first to get the answers\");\n }\n QuestionEntity questionEntity = questionDao.getQuestionById (questionId);\n if (questionEntity == null) {\n throw new InvalidQuestionException (\n \"QUES-001\", \"The question with entered uuid whose details are to be seen does not exist\");\n }\n return answerDao.getAllAnswersToQuestion (questionId);\n }", "Question getQuestionInPick(String questionId);", "public Faq[] findAll() throws FaqDaoException;", "public Question[] getQuestions() {\n return this.questions.toArray(new Question[0]);\n }", "protected List<QuestionImpl> readQuestions(String whereOrder, Object[] fields)\n\t{\n\t\tfinal List<QuestionImpl> rv = new ArrayList<QuestionImpl>();\n\n\t\tStringBuilder sql = new StringBuilder();\n\t\tsql.append(\"SELECT Q.CONTEXT, Q.CREATED_BY_DATE, Q.CREATED_BY_USER, Q.EXPLAIN_REASON, Q.FEEDBACK,\");\n\t\tsql.append(\" Q.HINTS, Q.HISTORICAL, Q.ID, Q.MINT, Q.MODIFIED_BY_DATE, Q.MODIFIED_BY_USER, Q.POOL_ID,\");\n\t\tsql.append(\" Q.PRESENTATION_TEXT, Q.PRESENTATION_ATTACHMENTS, Q.SURVEY, Q.TYPE, Q.GUEST, QT.TITLE\");\n\t\tsql.append(\" FROM MNEME_QUESTION Q \");\n\t\tsql.append(whereOrder);\n\n\t\tfinal QuestionServiceImpl qService = this.questionService;\n\t\tthis.sqlService.dbRead(sql.toString(), fields, new SqlReader()\n\t\t{\n\t\t\tpublic Object readSqlResultRecord(ResultSet result)\n\t\t\t{\n\t\t\t\ttry\n\t\t\t\t{\n\t\t\t\t\tQuestionImpl question = newQuestion();\n\t\t\t\t\tquestion.initContext(SqlHelper.readString(result, 1));\n\t\t\t\t\tquestion.getCreatedBy().setDate(SqlHelper.readDate(result, 2));\n\t\t\t\t\tquestion.getCreatedBy().setUserId(SqlHelper.readString(result, 3));\n\t\t\t\t\tquestion.setExplainReason(SqlHelper.readBoolean(result, 4));\n\t\t\t\t\tquestion.setFeedback(SqlHelper.readString(result, 5));\n\t\t\t\t\tquestion.setHints(SqlHelper.readString(result, 6));\n\t\t\t\t\tquestion.initHistorical(SqlHelper.readBoolean(result, 7));\n\t\t\t\t\tquestion.initId(SqlHelper.readId(result, 8));\n\t\t\t\t\tquestion.initMint(SqlHelper.readBoolean(result, 9));\n\t\t\t\t\tquestion.getModifiedBy().setDate(SqlHelper.readDate(result, 10));\n\t\t\t\t\tquestion.getModifiedBy().setUserId(SqlHelper.readString(result, 11));\n\t\t\t\t\tquestion.initPool(SqlHelper.readId(result, 12));\n\t\t\t\t\tquestion.getPresentation().setText(SqlHelper.readString(result, 13));\n\t\t\t\t\tquestion.getPresentation().setAttachments(SqlHelper.readReferences(result, 14, attachmentService));\n\t\t\t\t\tquestion.setIsSurvey(SqlHelper.readBoolean(result, 15));\n\t\t\t\t\tqService.setType(SqlHelper.readString(result, 16), question);\n\t\t\t\t\tquestion.getTypeSpecificQuestion().setData(SqlHelper.decodeStringArray(StringUtil.trimToNull(result.getString(17))));\n question.setTitle(SqlHelper.readString(result, 18));\n\n\t\t\t\t\tquestion.clearChanged();\n\t\t\t\t\trv.add(question);\n\n\t\t\t\t\treturn null;\n\t\t\t\t}\n\t\t\t\tcatch (SQLException e)\n\t\t\t\t{\n\t\t\t\t\tM_log.warn(\"readQuestions: \" + e);\n\t\t\t\t\treturn null;\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\n\t\treturn rv;\n\t}" ]
[ "0.7535263", "0.7362277", "0.72314006", "0.69558346", "0.6939551", "0.6846397", "0.67206556", "0.66955197", "0.6656947", "0.6635293", "0.66213536", "0.6611896", "0.6555799", "0.65207124", "0.6515963", "0.65091443", "0.65000916", "0.6492097", "0.6488585", "0.6483019", "0.64749104", "0.64228266", "0.64105946", "0.64100957", "0.637901", "0.63415605", "0.6335176", "0.63324034", "0.62617564", "0.62585723", "0.62257886", "0.62245333", "0.6215407", "0.61951", "0.61874044", "0.61586535", "0.6126611", "0.60693836", "0.6063994", "0.60261804", "0.6006395", "0.6005489", "0.598777", "0.5971501", "0.5966067", "0.5960452", "0.5944369", "0.5940353", "0.59284234", "0.5923224", "0.59147227", "0.58989686", "0.5866247", "0.58591855", "0.5845287", "0.58325714", "0.58305", "0.58277035", "0.58221686", "0.58087546", "0.577468", "0.5773333", "0.5768635", "0.57515174", "0.57512194", "0.57424533", "0.5738479", "0.5736857", "0.5733807", "0.57315236", "0.57267493", "0.5725238", "0.5718776", "0.5718032", "0.5714695", "0.5710253", "0.57059604", "0.57059604", "0.57059604", "0.57059604", "0.57014465", "0.5698479", "0.56940126", "0.56932324", "0.56903446", "0.5683275", "0.5674531", "0.5657882", "0.5654852", "0.56534636", "0.5642451", "0.5640607", "0.56139374", "0.5612002", "0.5601334", "0.5580321", "0.55763716", "0.5568116", "0.5566342", "0.5562987" ]
0.6850969
5
get all question of any qid
@GetMapping("/quiz/all/{qid}") public ResponseEntity<?> getQuestionsOfQuizAdmin(@PathVariable("qid") Long qid){ Quiz quiz = new Quiz(); quiz.setqId(qid); Set<Question> questionsOfQuiz = this.questionService.getQuestionOfQuiz(quiz); return ResponseEntity.ok(questionsOfQuiz); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\r\n\tpublic List<Yquestion> queryYquestion(int qid) {\n\t\treturn ym.queryYquestion(qid);\r\n\t}", "public List<MultQuestion> multChoiceQuestions(int qid);", "List<Question> getQuestions(String surveyId);", "public Question getQuestionbyId(int sid,int qid);", "@GetMapping(\"/quiz/{qid}\")\n\tpublic ResponseEntity<?> getQuestionsOfQuiz(@PathVariable(\"qid\") Long qid){\n\t\tQuiz quiz = this.quizService.getQuiz(qid);\n\t\tSet<Question> questions = quiz.getQuestions();\n\t\tList<Question> list = new ArrayList<>(questions);\n\t\tif(list.size() > Integer.parseInt(quiz.getNumberOfQuestions())) {\n\t\t\tlist = list.subList(0, Integer.parseInt(quiz.getNumberOfQuestions()));\n\t\t}\n\t\t\n\t\tlist.forEach((q)-> {\n\t\t\tq.setAnswer(\"\");\n\t\t});\n\t\t\n\t\tCollections.shuffle(list);\n\t\treturn ResponseEntity.ok(list);\n\t}", "public List<Question> getQuestionbySid(int sid);", "QuestionResponse getResponses(String questionId);", "List<Question> getQuestions();", "public List<Questions> getQuestionByUser(int uid) {\n\t\tSession session = HibernateUtil.getSessionFactory().openSession();\n\t\tList<Questions> quest = session.createQuery(\"from Questions where userid =:uid\").setInteger(\"uid\", uid).list();\n\t\tsession.close();\n\t\treturn quest;\n\t}", "public Questions getQuestion(int qid) {\n\t\tSession session = HibernateUtil.getSessionFactory().openSession();\n\t\tQuestions quest = (Questions) session.get(Questions.class, qid);\n\t\tsession.close();\n\t\treturn quest;\n\t}", "public String[] getQuestionAndAnswer(int qID) {\n String[] questionInfo = new String[8];\n String query;\n\n try {\n Connection con = Database.createDBconnection();\n Statement stmt = con.createStatement();\n query = \"SELECT question, ans1, ans2, ans3, ans4, ans5, correct_answer, point_value FROM question WHERE question_ID='\" + qID + \"';\";\n ResultSet rs = stmt.executeQuery(query);\n\n while(rs.next()){\n questionInfo[0] = rs.getString(\"question\"); // the question\n questionInfo[1] = rs.getString(\"ans1\"); // possible answer 1\n questionInfo[2] = rs.getString(\"ans2\"); // possible answer 2\n questionInfo[3] = rs.getString(\"ans3\"); // possible answer 3\n questionInfo[4] = rs.getString(\"ans4\"); // possible answer 4\n questionInfo[5] = rs.getString(\"ans5\"); // possible answer 5\n questionInfo[6] = rs.getString(\"correct_answer\"); // the correct answer\n questionInfo[7] = rs.getString(\"point_value\"); // the point value\n }\n\n Database.closeDBconnection(con);\n }\n catch (Exception e) {\n e.printStackTrace();\n }\n return questionInfo;\n }", "public List<Questions> getAllQuestionsHard() {\n List<Questions> questionList = new ArrayList<>();\n db = getReadableDatabase();\n Cursor c = db.rawQuery(\"SELECT * FROM \" + QuestionsTable.Table_name + \" WHERE _id BETWEEN 1 AND 10\", null);\n\n if (c.moveToFirst()){\n do {\n Questions question = new Questions();\n question.setQuestion(c.getString(c.getColumnIndex(QuestionsTable.Column_Question)));\n question.setOption1(c.getString(c.getColumnIndex(QuestionsTable.Column_Option1)));\n question.setOption2(c.getString(c.getColumnIndex(QuestionsTable.Column_Option2)));\n question.setOption3(c.getString(c.getColumnIndex(QuestionsTable.Column_Option3)));\n question.setOption4(c.getString(c.getColumnIndex(QuestionsTable.Column_Option4)));\n question.setAnswerNr(c.getInt(c.getColumnIndex(QuestionsTable.Column_Answer_Nr)));\n questionList.add(question);\n } while (c.moveToNext());\n }\n c.close();\n return questionList;\n }", "ArrayList<Integer> getAnswers (Integer q) {\n\t\tif (results.containsKey(q)) {\n\t\t\treturn results.get(q);\n\t\t} else {\n\t\t\tSystem.out.println(\"No answers found.\");\n\t\t\treturn null;\n\t\t}\n\t}", "public List<DataQuestion> getAllAnswer(){\n return items;\n }", "public List<Question> getQuestionsTopic(int tId){\r\n List<Question> questions = new ArrayList<>();\r\n String selectQuery = \"SELECT * FROM \" + TABLE_QUESTIONS + \" AS q INNER JOIN \" +\r\n TABLE_TOPICS_QUESTIONS + \" AS tq ON q.\" +\r\n KEY_ID + \" = tq.\" + KEY_QID +\r\n \" WHERE tq.\" + KEY_TID + \" = \" + tId + \" ORDER BY RANDOM()\";\r\n SQLiteDatabase db = this.getReadableDatabase();\r\n\r\n Cursor cursor = db.rawQuery(selectQuery, null);\r\n\r\n if(cursor.moveToFirst()){\r\n do{\r\n Question question = new Question();\r\n question.setId(cursor.getInt(cursor.getColumnIndex(KEY_QID)));\r\n question.setQuestion(cursor.getString(cursor.getColumnIndex(KEY_QUESTION)));\r\n question.setAnswer(cursor.getString(cursor.getColumnIndex(KEY_ANSWER)));\r\n question.setExplanation(cursor.getString(cursor.getColumnIndex(KEY_EXPLANATION)));\r\n question.setOptA(cursor.getString(cursor.getColumnIndex(KEY_OPT_A)));\r\n question.setOptB(cursor.getString(cursor.getColumnIndex(KEY_OPT_B)));\r\n question.setOptC(cursor.getString(cursor.getColumnIndex(KEY_OPT_C)));\r\n question.setOptD(cursor.getString(cursor.getColumnIndex(KEY_OPT_D)));\r\n\r\n questions.add(question);\r\n\r\n } while (cursor.moveToNext());\r\n }\r\n\r\n\r\n\r\n cursor.close();\r\n db.close();\r\n return questions;\r\n }", "@Override\n\tpublic List getQuestionListByExamId(Integer examId) {\n\t\tString hql = \"from ElearningExamQRelation a where 1 = 1 \";\n\t\tif(examId!=null && !examId.equals(\"\")){\n\t\t\thql+=\"and a.examId='\"+examId+\"'\";\n\t\t}\n\t\thql+=\"order by a.number asc\";\n\t\tList list = this.queryForList(hql);\n\t\tif(list == null || list.size()== 0)\n\t\t\treturn null;\n\t\telse{\n\t\t\treturn list;\n\t\t}\n\t}", "public List<Questions> getAllQuestionsEasy() {\n List<Questions> questionList = new ArrayList<>();\n db = getReadableDatabase();\n Cursor c = db.rawQuery(\"SELECT * FROM \" + QuestionsTable.Table_name + \" WHERE _id BETWEEN 21 AND 30\", null);\n\n if (c.moveToFirst()){\n do {\n Questions question = new Questions();\n question.setQuestion(c.getString(c.getColumnIndex(QuestionsTable.Column_Question)));\n question.setOption1(c.getString(c.getColumnIndex(QuestionsTable.Column_Option1)));\n question.setOption2(c.getString(c.getColumnIndex(QuestionsTable.Column_Option2)));\n question.setOption3(c.getString(c.getColumnIndex(QuestionsTable.Column_Option3)));\n question.setOption4(c.getString(c.getColumnIndex(QuestionsTable.Column_Option4)));\n question.setAnswerNr(c.getInt(c.getColumnIndex(QuestionsTable.Column_Answer_Nr)));\n questionList.add(question);\n } while (c.moveToNext());\n }\n c.close();\n return questionList;\n }", "public Collection<Question> getQuestions();", "private List<String> getSqIds(String qid)\n\t{\n\t\t@SuppressWarnings(\"unchecked\")\n\t\tList<Element> sq_list = sq_node.selectNodes(\"row[parent_qid=\" + qid + \"]/qid\");\n\t\treturn sq_list.stream()\n\t\t\t.map(e -> e.getText())\n\t\t\t.collect(Collectors.toList()); // Make a list of qid elements to a list of strings\n\t}", "@GetMapping(\"/getquestion/{id}\")\n public ResponseEntity<List<Questions>> getQuestion(@PathVariable Long id) {\n\n List<Questions> q = this.userServices.getquetion(id);\n\n if (q.size() <= 0) {\n\n return ResponseEntity.status(HttpStatus.NOT_FOUND).build();\n\n }\n\n return ResponseEntity.status(HttpStatus.CREATED).body(q);\n\n }", "@Override\r\n\tpublic List<ZyAnswer> getAnswersByQuestion(int questionId) {\n\t\treturn answerDao.getAnswersByquestion(questionId);\r\n\t}", "@Override\n\t@Transactional\n\tpublic List<Question> getQuestionsByTestId(int id) {\n\t\treturn questionDao.getQuestionsByTestId(id);\n\t}", "@Override\n\tpublic Question getQuestion(Integer qid) {\n\t\treturn questionDao.getEntity(qid);\n\t}", "public List<QuestionEntity> getAllQuestions() {\n try {\n return entityManager.createNamedQuery(\"getAllQuestions\", QuestionEntity.class).getResultList();\n } catch (NoResultException nre) {\n return null;\n }\n }", "public List<Questions> getAllQuestionsMedium() {\n List<Questions> questionList = new ArrayList<>();\n db = getReadableDatabase();\n Cursor c = db.rawQuery(\"SELECT * FROM \" + QuestionsTable.Table_name + \" WHERE _id BETWEEN 11 AND 20\", null);\n\n if (c.moveToFirst()){\n do {\n Questions question = new Questions();\n question.setQuestion(c.getString(c.getColumnIndex(QuestionsTable.Column_Question)));\n question.setOption1(c.getString(c.getColumnIndex(QuestionsTable.Column_Option1)));\n question.setOption2(c.getString(c.getColumnIndex(QuestionsTable.Column_Option2)));\n question.setOption3(c.getString(c.getColumnIndex(QuestionsTable.Column_Option3)));\n question.setOption4(c.getString(c.getColumnIndex(QuestionsTable.Column_Option4)));\n question.setAnswerNr(c.getInt(c.getColumnIndex(QuestionsTable.Column_Answer_Nr)));\n questionList.add(question);\n } while (c.moveToNext());\n }\n c.close();\n return questionList;\n }", "public Map<String ,String> GetMultipleChoiceQ(int AssessmentId) {\n Map<String, String> map = new HashMap<String, String>();\n List<String> indexes = GetAssessmentIndexes(AssessmentId);\n\n for (String index : indexes) {\n try {\n Statement stmt = Con.createStatement();\n String query = String.format(\"SELECT qora, content FROM dqs_qanda WHERE \" +\n \"((SELECT content FROM dqs_qanda WHERE qora = 'question%s_t') = 'm') AND (qora='question%s' OR qora = 'question%s_q1' \" +\n \"OR qora = 'question%s_q2' OR qora = 'question%s_q3' or qora = 'question%s_c')\", index, index, index, index, index, index);\n //System.out.println(query);\n ResultSet rs = stmt.executeQuery(query);\n while(rs.next()) {\n map.put(rs.getString(\"qora\"), rs.getString(\"content\"));\n }\n }\n catch (Exception e) {\n System.out.println(e.getMessage());\n }\n }\n return map;\n }", "List<Question> getQuestionsUsed();", "public static synchronized ArrayList<QAQuestions> fetchAllQuestions(\n\t\t\tContext context, String query) throws SQLException,\n\t\t\tNullPointerException {\n\n\t\tQADatabaseHelper dbHelper = QADatabaseHelper.getInstance(context);\n\t\tSQLiteDatabase db = dbHelper.getReadableDatabase();\n\n\t\tArrayList<QAQuestions> questionsList = null;\n\n\t\tCursor cursor = null;\n\t\ttry {\n\t\t\tcursor = db.rawQuery(query, null);\n\t\t} catch (Exception exception) {\n\t\t\texception.printStackTrace();\n\t\t}\n\t\tcursor.moveToFirst();\n\t\tif (cursor != null && cursor.getCount() > 0) {\n\t\t\tquestionsList = new ArrayList<QAQuestions>();\n\t\t\tfor (cursor.moveToFirst(); !cursor.isAfterLast(); cursor\n\t\t\t\t\t.moveToNext()) {\n\n\t\t\t\tQAQuestions question = new QAQuestions();\n\n\t\t\t\tquestion.setPrimaryKey(cursor.getInt(cursor\n\t\t\t\t\t\t.getColumnIndex(COLUMN_NAME_PRIMARY_KEY)));\n\t\t\t\tquestion.setQuestion(cursor.getString(cursor\n\t\t\t\t\t\t.getColumnIndex(COLUMN_NAME_QUESTION)));\n\t\t\t\tquestion.setOptionOne(cursor.getString(cursor\n\t\t\t\t\t\t.getColumnIndex(COLUMN_NAME_OPTION1)));\n\t\t\t\tquestion.setOptionTwo(cursor.getString(cursor\n\t\t\t\t\t\t.getColumnIndex(COLUMN_NAME_OPTION2)));\n\t\t\t\tquestion.setOptionThree(cursor.getString(cursor\n\t\t\t\t\t\t.getColumnIndex(COLUMN_NAME_OPTION3)));\n\t\t\t\tquestion.setOptionFour(cursor.getString(cursor\n\t\t\t\t\t\t.getColumnIndex(COLUMN_NAME_OPTION4)));\n\t\t\t\tquestion.setAnswer(cursor.getString(cursor\n\t\t\t\t\t\t.getColumnIndex(COLUMN_NAME_ANSWER)));\n\t\t\t\tquestion.setUpdatedAt(cursor.getString(cursor\n\t\t\t\t\t\t.getColumnIndex(COLUMN_NAME_UPDATED_AT)));\n\t\t\t\tquestion.setFetched((cursor.getInt(cursor\n\t\t\t\t\t\t.getColumnIndex(COLUMN_NAME_IS_FETCHED)) == 1) ? true\n\t\t\t\t\t\t: false);\n\t\t\t\tquestionsList.add(question);\n\t\t\t}\n\t\t}\n\t\tcursor.close();\n\t\treturn questionsList;\n\t}", "@Override\n\tpublic List getRelationListByQuestionId(Integer questionId) {\n\t\tString hql = \"from ElearningExamQRelation a where 1 = 1 \";\n\t\tif(questionId!=null && !questionId.equals(\"\")){\n\t\t\thql+=\"and a.questionId='\"+questionId+\"'\";\n\t\t}\n\t\tList list = this.queryForList(hql);\n\t\tif(list == null || list.size()== 0)\n\t\t\treturn null;\n\t\telse{\n\t\t\treturn list;\n\t\t}\n\t}", "public List<Question> getQuestionsExamTopic(int eId, int tId){\r\n List<Question> questions = new ArrayList<>();\r\n String selectQuery = \"SELECT * FROM \" + TABLE_QUESTIONS + \" AS q INNER JOIN \" +\r\n TABLE_EXAMS_TOPICS_QUESTIONS + \" AS etq ON q.\" +\r\n KEY_ID + \" = etq.\" + KEY_QID +\r\n \" WHERE etq.\" + KEY_EID + \" = \" + eId + \" AND etq.\" + KEY_TID + \" = \" + tId + \" ORDER BY RANDOM()\";\r\n SQLiteDatabase db = this.getReadableDatabase();\r\n\r\n Cursor cursor = db.rawQuery(selectQuery, null);\r\n\r\n if(cursor.moveToFirst()){\r\n do{\r\n Question question = new Question();\r\n question.setId(cursor.getInt(cursor.getColumnIndex(KEY_QID)));\r\n question.setQuestion(cursor.getString(cursor.getColumnIndex(KEY_QUESTION)));\r\n question.setAnswer(cursor.getString(cursor.getColumnIndex(KEY_ANSWER)));\r\n question.setExplanation(cursor.getString(cursor.getColumnIndex(KEY_EXPLANATION)));\r\n question.setOptA(cursor.getString(cursor.getColumnIndex(KEY_OPT_A)));\r\n question.setOptB(cursor.getString(cursor.getColumnIndex(KEY_OPT_B)));\r\n question.setOptC(cursor.getString(cursor.getColumnIndex(KEY_OPT_C)));\r\n question.setOptD(cursor.getString(cursor.getColumnIndex(KEY_OPT_D)));\r\n\r\n questions.add(question);\r\n\r\n } while (cursor.moveToNext());\r\n }\r\n\r\n\r\n\r\n cursor.close();\r\n db.close();\r\n return questions;\r\n }", "List<SurveyQuestion> getSurveyQuestionsByQuestions(List<Question> questions);", "public objData getQuestion(String id){\n objData objdata = new objData();\n try{\n MainClient mc = new MainClient(DBConn.getHost());\n\n String query = \"SELECT TBD_REFID, TSDB_REFID, TDB_QNO, TDB_QUEST FROM TEST_DB WHERE TDB_REFID = '\" + id + \"'\";\n String data[] = {};\n\n objdata.setTableData(mc.getQuery(query,data));\n }\n catch(Exception e){\n objdata.setErrorMessage(e.toString());\n objdata.setFlag(1);\n }\n return objdata;\n }", "public List<Question> getQuestionsExam(int eId){\r\n List<Question> questions = new ArrayList<>();\r\n String selectQuery = \"SELECT * FROM \" + TABLE_QUESTIONS + \" AS q INNER JOIN \" +\r\n TABLE_EXAMS_TOPICS_QUESTIONS + \" AS etq ON q.\" +\r\n KEY_ID + \" = etq.\" + KEY_QID +\r\n \" WHERE etq.\" + KEY_EID + \" = \" + eId + \" ORDER BY RANDOM()\";\r\n SQLiteDatabase db = this.getReadableDatabase();\r\n\r\n Cursor cursor = db.rawQuery(selectQuery, null);\r\n\r\n if(cursor.moveToFirst()){\r\n do{\r\n Question question = new Question();\r\n question.setId(cursor.getInt(cursor.getColumnIndex(KEY_QID)));\r\n question.setQuestion(cursor.getString(cursor.getColumnIndex(KEY_QUESTION)));\r\n question.setAnswer(cursor.getString(cursor.getColumnIndex(KEY_ANSWER)));\r\n question.setExplanation(cursor.getString(cursor.getColumnIndex(KEY_EXPLANATION)));\r\n question.setOptA(cursor.getString(cursor.getColumnIndex(KEY_OPT_A)));\r\n question.setOptB(cursor.getString(cursor.getColumnIndex(KEY_OPT_B)));\r\n question.setOptC(cursor.getString(cursor.getColumnIndex(KEY_OPT_C)));\r\n question.setOptD(cursor.getString(cursor.getColumnIndex(KEY_OPT_D)));\r\n\r\n questions.add(question);\r\n\r\n } while (cursor.moveToNext());\r\n }\r\n\r\n\r\n\r\n cursor.close();\r\n db.close();\r\n return questions;\r\n }", "public String getQuestion(int idType, int idQuest) throws SQLException{ \r\n String query= (\"select question from \"+Database.Table.TABLE_PRETEST_QUESTION+\" where idtype = '\"+idType+\"' AND idquest = '\"+idQuest+\"'\");\r\n ResultSet rs = q.querySelect(query);\r\n while(rs.next()){\r\n question=rs.getString(\"question\");\r\n }\r\n return question;\r\n }", "@Override\n\tpublic List<Questions> listQuestion(int testId) {\n\t\treturn null;\n\t}", "public List<Survey> getSurveybyTid(int tid);", "public List<Answer> getAnswers(Question question) throws Exception {\n DataBaseBroker dbb = new DataBaseBroker();\n dbb.loadDriver();\n dbb.establishConnection();\n List<Answer> answers = dbb.getAnswers(question);\n dbb.commit();\n dbb.closeConnection();\n return answers;\n }", "public List<TextQuestion> TextQuestions(int aid);", "@Override\n\tpublic List<Questions> listQuestion(long testId1) {\n\t\treturn null;\n\t}", "@WebMethod public List<Question> findAllQuestion(Event ev);", "public List<Answer> getAnswersByPoints(int n, Question q) {\n\n List<Answer> answers = getAnswersByPoints(q);\n int nChecked = n >= answers.size() ? answers.size() : n;\n\n return getListNumOfAnswers(answers, nChecked);\n }", "@Test\n\tpublic void testGetAllQuestions() {\n\t\tList<QnaQuestion> questions = questionLogic.getAllQuestions(LOCATION1_ID);\n\t\tAssert.assertEquals(5, questions.size());\n\t\tAssert.assertTrue(questions.contains(tdp.question1_location1));\n\t\tAssert.assertTrue(questions.contains(tdp.question2_location1));\n\t\tAssert.assertTrue(questions.contains(tdp.question3_location1));\n\t\tAssert.assertTrue(questions.contains(tdp.question4_location1));\n\t\tAssert.assertTrue(questions.contains(tdp.question5_location1));\n\t}", "@GetMapping(value=\"/getAll\")\n\tpublic List<Question> getAll(){\n\t\tLOGGER.info(\"Viewing all questions\");\n\t\treturn questionObj.viewAllQuestions();\n\t}", "public Question getQuestion(String questionId) {\r\n Question[] questions = currentProcessInstance.getQuestions();\r\n Question foundQuestion = null;\r\n \r\n for (int i = 0; foundQuestion == null && i < questions.length; i++) {\r\n if (questions[i].getId().equals(questionId))\r\n foundQuestion = questions[i];\r\n }\r\n \r\n return foundQuestion;\r\n }", "public ArrayList<Answer> getAllAnswersByQuestionId(int id) {\n \t\tArrayList<Answer> questionAnswers = new ArrayList<Answer>();\n \t\tfor (Answer answer : answers) {\n \t\t\tif (answer.getQuestionId() == id) {\n \t\t\t\tquestionAnswers.add(answer);\n \t\t\t}\n \t\t}\n \t\treturn questionAnswers;\n \t}", "@RequestMapping(value = \"/getQuestion/{test}/{question}\")\n\tpublic Questions getSingleQuestion(@PathVariable(\"test\") int testid,@PathVariable(\"question\") int question) {\n\t\tTest test = testDao.gettestStatus(testid);\n\t\tif(test!=null) {\n\t\t\t\n\t\t\tfor(Questions testQueList : test.getQuestions()) {\n\t\t\t\tif(testQueList.getQid()==question) {\n\t\t\t\t\t//System.out.println(\"test id : \"+testQueList.getTest());\n//\t\t\t\t\ttestQueList.setTest(test.getTestid());\n\t\t\t\t\treturn testQueList;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn null;\n\t}", "public List<TemplateExamQuestion> getQuestions(Group group);", "java.util.List<com.rpg.framework.database.Protocol.Quest> \n getQuestList();", "public List<Answer> answersOfQuestion(Question question){\n\t\treturn this.aRepo.findAllByQuestion(question);\n\t}", "Question getQuestion(String questionId);", "public List<DnsQuestion> questions() {\n if (questions == null) {\n return Collections.emptyList();\n }\n return Collections.unmodifiableList(questions);\n }", "public ArrayList<SingleQuestion> getAllQuestions(String difficulty) {\n ArrayList<SingleQuestion> questionsList = new ArrayList<>();\n String selectQuery = \"SELECT id,question,A,B,C,D,answer,explanation,category,difficulty FROM quizMaster where difficulty='\" + difficulty + \"'\";\n Log.d(\"Select Query\", \"selectQuery\" + selectQuery);\n Cursor cursor = database.rawQuery(selectQuery, null);\n if (cursor.moveToFirst()) {\n do {\n SingleQuestion singleQuestion = new SingleQuestion();\n singleQuestion.setId(String.valueOf(cursor.getInt(0)));\n singleQuestion.setQuestion(cursor.getString(1));\n singleQuestion.setOptionA(cursor.getString(2));\n singleQuestion.setOptionB(cursor.getString(3));\n singleQuestion.setOptionC(cursor.getString(4));\n singleQuestion.setOptionD(cursor.getString(5));\n singleQuestion.setAnswer(cursor.getString(6));\n singleQuestion.setExplanation(cursor.getString(7));\n singleQuestion.setCategory(cursor.getString(8));\n singleQuestion.setDifficulty(cursor.getString(9));\n questionsList.add(singleQuestion);\n } while (cursor.moveToNext());\n }\n \n return questionsList;\n }", "public static List<Question> getQuestions() {\n if (QUESTION == null) {\n QUESTION = new ArrayList<>();\n List<Option> options = new ArrayList<Option>();\n options.add(new Option(1, \"Radio Waves\"));\n options.add(new Option(2, \"Sound Waves\"));\n options.add(new Option(3, \"Gravity Waves\"));\n options.add(new Option(4, \"Light Waves\"));\n QUESTION.add(new Question(1, \"Which kind of waves are used to make and receive cellphone calls?\", getCategory(4), options, options.get(0)));\n\n List<Option> options2 = new ArrayList<Option>();\n options2.add(new Option(1, \"8\"));\n options2.add(new Option(2, \"6\"));\n options2.add(new Option(3, \"3\"));\n options2.add(new Option(4, \"1\"));\n QUESTION.add(new Question(2, \"How many hearts does an octopus have?\", getCategory(4), options2, options2.get(2)));\n\n List<Option> options3 = new ArrayList<Option>();\n options3.add(new Option(1, \"Newton's Law\"));\n options3.add(new Option(2, \"Hooke's law\"));\n options3.add(new Option(3, \"Darwin's Law\"));\n options3.add(new Option(4, \"Archimedes' principle\"));\n QUESTION.add(new Question(3, \"Whose law states that the force needed to extend a spring by some distance is proportional to that distance?\", getCategory(4), options3, options3.get(1)));\n\n List<Option> options4 = new ArrayList<Option>();\n options4.add(new Option(1, \"M\"));\n options4.add(new Option(2, \"$\"));\n options4.add(new Option(3, \"W\"));\n options4.add(new Option(4, \"#\"));\n QUESTION.add(new Question(4, \"What is the chemical symbol for tungsten?\", getCategory(4), options4, options4.get(2)));\n\n List<Option> options5 = new ArrayList<Option>();\n options5.add(new Option(1, \"Pulsar\"));\n options5.add(new Option(2, \"Draconis\"));\n options5.add(new Option(3, \"Aludra\"));\n options5.add(new Option(4, \"Alwaid\"));\n QUESTION.add(new Question(5, \"What is a highly magnetized, rotating neutron star that emits a beam of electromagnetic radiation?\", getCategory(4), options5, options5.get(0)));\n\n List<Option> options6 = new ArrayList<Option>();\n options6.add(new Option(1, \"2\"));\n options6.add(new Option(2, \"4\"));\n options6.add(new Option(3, \"7\"));\n options6.add(new Option(4, \"10\"));\n QUESTION.add(new Question(6, \"At what temperature is Centigrade equal to Fahrenheit?\", getCategory(4), options6, options6.get(2)));\n\n List<Option> options7 = new ArrayList<Option>();\n options7.add(new Option(1, \"Temperature\"));\n options7.add(new Option(2, \"Distance\"));\n options7.add(new Option(3, \"Light Intensity\"));\n options7.add(new Option(4, \"Noise\"));\n QUESTION.add(new Question(7, \"Kelvin is a unit to measure what?\", getCategory(4), options7, options7.get(2)));\n\n List<Option> options8 = new ArrayList<Option>();\n options8.add(new Option(1, \"Mars\"));\n options8.add(new Option(2, \"Jupiter\"));\n options8.add(new Option(3, \"Saturn\"));\n options8.add(new Option(4, \"Neptune\"));\n QUESTION.add(new Question(8, \"Triton is the largest moon of what planet?\", getCategory(4), options8, options8.get(3)));\n\n List<Option> options9 = new ArrayList<Option>();\n options9.add(new Option(1, \"Brain\"));\n options9.add(new Option(2, \"Heart\"));\n options9.add(new Option(3, \"Lungs\"));\n options9.add(new Option(4, \"Skin\"));\n QUESTION.add(new Question(9, \"What is the human body’s biggest organ?\", getCategory(4), options9, options9.get(3)));\n\n List<Option> options10 = new ArrayList<Option>();\n options10.add(new Option(1, \"Skull\"));\n options10.add(new Option(2, \"Knee Cap\"));\n options10.add(new Option(3, \"Shoulder Joint\"));\n options10.add(new Option(4, \"Backbone\"));\n QUESTION.add(new Question(10, \"What is the more common name for the patella?\", getCategory(4), options10, options10.get(1)));\n\n List<Option> options11 = new ArrayList<Option>();\n options11.add(new Option(1, \"Mother India\"));\n options11.add(new Option(2, \"The Guide\"));\n options11.add(new Option(3, \"Madhumati\"));\n options11.add(new Option(4, \"Amrapali\"));\n QUESTION.add(new Question(11, \"Which was the 1st Indian movie submitted for Oscar?\", getCategory(1), options11, options11.get(0)));\n\n List<Option> options12 = new ArrayList<Option>();\n options12.add(new Option(1, \"Gunda\"));\n options12.add(new Option(2, \"Sholey\"));\n options12.add(new Option(3, \"Satte pe Satta\"));\n options12.add(new Option(4, \"Angoor\"));\n QUESTION.add(new Question(12, \"Which film is similar to Seven Brides For Seven Brothers?\", getCategory(1), options12, options12.get(2)));\n\n List<Option> options13 = new ArrayList<Option>();\n options13.add(new Option(1, \"Rocky\"));\n options13.add(new Option(2, \"Pancham\"));\n options13.add(new Option(3, \"Chichi\"));\n options13.add(new Option(4, \"Chintu\"));\n QUESTION.add(new Question(13, \"Music Director R.D. Burman is also known as?\", getCategory(1), options13, options13.get(1)));\n\n List<Option> options14 = new ArrayList<Option>();\n options14.add(new Option(1, \"Nagarjuna\"));\n options14.add(new Option(2, \"Chiranjeevi\"));\n options14.add(new Option(3, \"Rajinikanth\"));\n options14.add(new Option(4, \"NTR\"));\n QUESTION.add(new Question(14, \"Shivaji Rao Gaikwad is the real name of which actor?\", getCategory(1), options14, options14.get(2)));\n\n List<Option> options15 = new ArrayList<Option>();\n options15.add(new Option(1, \"Geraftaar\"));\n options15.add(new Option(2, \"Hum\"));\n options15.add(new Option(3, \"Andha kanoon\"));\n options15.add(new Option(4, \"Agneepath\"));\n QUESTION.add(new Question(15, \"Name the film in which Amitabh Bachchan, Rajinikanth and Kamal Hasan worked together.\", getCategory(1), options15, options15.get(0)));\n\n List<Option> options16 = new ArrayList<Option>();\n options16.add(new Option(1, \"AR Rahman\"));\n options16.add(new Option(2, \"Bhanu Athaiya\"));\n options16.add(new Option(3, \"Gulzar\"));\n options16.add(new Option(4, \"Rasul Pookutty\"));\n QUESTION.add(new Question(16, \"First Indian to win Oscar award?\", getCategory(1), options16, options16.get(1)));\n\n List<Option> options17 = new ArrayList<Option>();\n options17.add(new Option(1, \"Jab tak hai jaan\"));\n options17.add(new Option(2, \"Rab ne bana di jodi\"));\n options17.add(new Option(3, \"Veer zara\"));\n options17.add(new Option(4, \"Ek tha tiger\"));\n QUESTION.add(new Question(17, \"Which was the last movie directed by Yash Chopra?\", getCategory(1), options17, options17.get(0)));\n\n\n List<Option> options18 = new ArrayList<Option>();\n options18.add(new Option(1, \"‘Thala’ Ajith\"));\n options18.add(new Option(2, \"Arjun Sarja\"));\n options18.add(new Option(3, \"Ashutosh Gawariker\"));\n options18.add(new Option(4, \"AK Hangal\"));\n QUESTION.add(new Question(18, \"\\\"Itna sannata kyun hai bhai?\\\" Who said this, now legendary words, in 'Sholay'?\", getCategory(1), options18, options18.get(3)));\n\n List<Option> options19 = new ArrayList<Option>();\n options19.add(new Option(1, \"Tommy\"));\n options19.add(new Option(2, \"Tuffy\"));\n options19.add(new Option(3, \"Toffy\"));\n options19.add(new Option(4, \"Timmy\"));\n QUESTION.add(new Question(19, \"What was the name of Madhuri Dixit’s dog in Hum Aapke Hain Koun?\", getCategory(1), options19, options19.get(1)));\n\n List<Option> options20 = new ArrayList<Option>();\n options20.add(new Option(1, \"Premnath\"));\n options20.add(new Option(2, \"Dilip Kumar\"));\n options20.add(new Option(3, \"Raj Kapoor\"));\n options20.add(new Option(4, \"Kishore Kumar\"));\n QUESTION.add(new Question(20, \"Beautiful actress Madhubala was married to?\", getCategory(1), options20, options20.get(3)));\n\n\n List<Option> options21 = new ArrayList<Option>();\n options21.add(new Option(1, \"Sher Khan\"));\n options21.add(new Option(2, \"Mufasa\"));\n options21.add(new Option(3, \"Simba\"));\n options21.add(new Option(4, \"Sarabi\"));\n QUESTION.add(new Question(21, \"What is the name of the young lion whose story is told in the musical 'The Lion King'?\", getCategory(2), options21, options21.get(2)));\n\n List<Option> options22 = new ArrayList<Option>();\n options22.add(new Option(1, \"Scotland\"));\n options22.add(new Option(2, \"England\"));\n options22.add(new Option(3, \"Germany\"));\n options22.add(new Option(4, \"Netherland\"));\n QUESTION.add(new Question(22, \"Which country's freedom struggle is portrayed in the Mel Gibson movie 'Braveheart'?\", getCategory(2), options22, options22.get(0)));\n\n List<Option> options23 = new ArrayList<Option>();\n options23.add(new Option(1, \"Letters to Juliet\"));\n options23.add(new Option(2, \"Saving Private Ryan\"));\n options23.add(new Option(3, \"Forest Gump\"));\n options23.add(new Option(4, \"Gone With The Wind\"));\n QUESTION.add(new Question(23, \"Which movie had this dialogue \\\"My mama always said, life was like a box of chocolates. You never know what you're gonna get.\", getCategory(2), options23, options23.get(2)));\n\n List<Option> options24 = new ArrayList<Option>();\n options24.add(new Option(1, \"Die\"));\n options24.add(new Option(2, \"Golden\"));\n options24.add(new Option(3, \"Casino\"));\n options24.add(new Option(4, \"Never\"));\n QUESTION.add(new Question(24, \"Excluding \\\"the\\\", which word appears most often in Bond movie titles?\", getCategory(2), options24, options24.get(3)));\n\n List<Option> options25 = new ArrayList<Option>();\n options25.add(new Option(1, \"Bishop\"));\n options25.add(new Option(2, \"Ash\"));\n options25.add(new Option(3, \"Call\"));\n options25.add(new Option(4, \"Carlos\"));\n QUESTION.add(new Question(25, \"Name the android in movie Alien \", getCategory(2), options25, options25.get(1)));\n\n List<Option> options26 = new ArrayList<Option>();\n options26.add(new Option(1, \"Gone with the wind\"));\n options26.add(new Option(2, \"Home footage\"));\n options26.add(new Option(3, \"With Our King and Queen Through India\"));\n options26.add(new Option(4, \"Treasure Island\"));\n QUESTION.add(new Question(26, \"Which was the first colour film to win a Best Picture Oscar?\", getCategory(2), options26, options26.get(0)));\n\n List<Option> options27 = new ArrayList<Option>();\n options27.add(new Option(1, \"Robert Redford\"));\n options27.add(new Option(2, \"Michael Douglas\"));\n options27.add(new Option(3, \"Harrison Ford\"));\n options27.add(new Option(4, \"Patrick Swayze\"));\n QUESTION.add(new Question(27, \"Who played the male lead opposite Sharon Stone in the hugely successful movie 'The Basic Instinct'?\", getCategory(2), options27, options27.get(1)));\n\n List<Option> options28 = new ArrayList<Option>();\n options28.add(new Option(1, \"10,000 BC\"));\n options28.add(new Option(2, \"Day after tomorrow\"));\n options28.add(new Option(3, \"2012\"));\n options28.add(new Option(4, \"The Noah's Ark Principle\"));\n QUESTION.add(new Question(28, \"Which Roland Emmerich movie portrays fictional cataclysmic events that were to take place in early 21st century?\", getCategory(2), options28, options28.get(2)));\n\n List<Option> options29 = new ArrayList<Option>();\n options29.add(new Option(1, \"Finding Nemo\"));\n options29.add(new Option(2, \"The Incredibles\"));\n options29.add(new Option(3, \"Monsters, Inc.\"));\n options29.add(new Option(4, \"Toy Story\"));\n QUESTION.add(new Question(29, \"What was the first movie by Pixar to receive a rating higher than G in the United States?\", getCategory(2), options29, options29.get(1)));\n\n List<Option> options30 = new ArrayList<Option>();\n options30.add(new Option(1, \"Draco\"));\n options30.add(new Option(2, \"Harry\"));\n options30.add(new Option(3, \"Hermione\"));\n options30.add(new Option(4, \"Ron\"));\n QUESTION.add(new Question(30, \"In the 'Prisoner of Azkaban', who throws rocks at Hagrid's hut so that Harry, Ron and Hermione can leave?\", getCategory(2), options30, options30.get(2)));\n\n List<Option> options31 = new ArrayList<Option>();\n options31.add(new Option(1, \"Brett Lee\"));\n options31.add(new Option(2, \"Adam Gilchrist\"));\n options31.add(new Option(3, \"Jason Gillespie\"));\n options31.add(new Option(4, \"Glenn McGrath\"));\n QUESTION.add(new Question(31, \"'Dizzy' is the nickname of what Australian player?\", getCategory(3), options31, options31.get(2)));\n\n List<Option> options32 = new ArrayList<Option>();\n options32.add(new Option(1, \"1883 between Australia and Wales\"));\n options32.add(new Option(2, \"1844 between Canada and the USA\"));\n options32.add(new Option(3, \"1869 between England and Australia\"));\n options32.add(new Option(4, \"1892 between England and India\"));\n QUESTION.add(new Question(32, \"In what year was the first international cricket match held?\", getCategory(3), options32, options32.get(1)));\n\n List<Option> options33 = new ArrayList<Option>();\n options33.add(new Option(1, \"Salim Durrani\"));\n options33.add(new Option(2, \"Farooq Engineer\"));\n options33.add(new Option(3, \"Vijay Hazare\"));\n options33.add(new Option(4, \"Mansur Ali Khan Pataudi\"));\n QUESTION.add(new Question(33, \"Which former Indian cricketer was nicknamed 'Tiger'?\", getCategory(3), options33, options33.get(3)));\n\n List<Option> options34 = new ArrayList<Option>();\n options34.add(new Option(1, \"Piyush Chawla\"));\n options34.add(new Option(2, \"Gautam Gambhir\"));\n options34.add(new Option(3, \"Irfan Pathan\"));\n options34.add(new Option(4, \"Suresh Raina\"));\n QUESTION.add(new Question(34, \"Who was named as the ICC Emerging Player of the Year 2004?\", getCategory(3), options34, options34.get(2)));\n\n List<Option> options35 = new ArrayList<Option>();\n options35.add(new Option(1, \"Subhash Gupte\"));\n options35.add(new Option(2, \"M.L.Jaisimha\"));\n options35.add(new Option(3, \"Raman Lamba\"));\n options35.add(new Option(4, \"Lala Amarnath\"));\n QUESTION.add(new Question(35, \"Which cricketer died on the field in Bangladesh while playing for Abahani Club?\", getCategory(3), options35, options35.get(2)));\n\n List<Option> options36 = new ArrayList<Option>();\n options36.add(new Option(1, \"V. Raju\"));\n options36.add(new Option(2, \"Rajesh Chauhan\"));\n options36.add(new Option(3, \"Arshad Ayub\"));\n options36.add(new Option(4, \"Narendra Hirwani\"));\n QUESTION.add(new Question(36, \"In 1987-88, which Indian spinner took 16 wickets on his Test debut?\", getCategory(3), options36, options36.get(3)));\n\n List<Option> options37 = new ArrayList<Option>();\n options37.add(new Option(1, \"Ravi Shastri\"));\n options37.add(new Option(2, \"Dilip Vengsarkar\"));\n options37.add(new Option(3, \"Sachin Tendulkar\"));\n options37.add(new Option(4, \"Sanjay Manjrekar\"));\n QUESTION.add(new Question(37, \"Which former Indian Test cricketer equalled Gary Sobers world record of six sixes in an over in a Ranji Trophy match?\", getCategory(3), options37, options37.get(0)));\n\n List<Option> options38 = new ArrayList<Option>();\n options38.add(new Option(1, \"Mohsin khan\"));\n options38.add(new Option(2, \"Wasim Akram\"));\n options38.add(new Option(3, \"Naveen Nischol\"));\n options38.add(new Option(4, \"None Of The Above\"));\n QUESTION.add(new Question(38, \"Reena Roy the Indian film actress married a cricketer?\", getCategory(3), options38, options38.get(0)));\n\n List<Option> options39 = new ArrayList<Option>();\n options39.add(new Option(1, \"London, England\"));\n options39.add(new Option(2, \"Mumbai, India\"));\n options39.add(new Option(3, \"Lahore, Pakistan\"));\n options39.add(new Option(4, \"Nairobi, Kenya\"));\n QUESTION.add(new Question(39, \"Where did Yuvraj Singh make his ODI debut?\", getCategory(3), options39, options39.get(3)));\n\n List<Option> options40 = new ArrayList<Option>();\n options40.add(new Option(1, \"Arvind De Silva\"));\n options40.add(new Option(2, \"Roshan Mahanama\"));\n options40.add(new Option(3, \"Harshan Tilakaratne\"));\n options40.add(new Option(4, \"None Of The Above\"));\n QUESTION.add(new Question(40, \"Kapil Dev's 432 (world) record breaking victim was?\", getCategory(3), options40, options40.get(2)));\n\n List<Option> options41 = new ArrayList<Option>();\n options41.add(new Option(1, \"Vatican\"));\n options41.add(new Option(2, \"Iceland\"));\n options41.add(new Option(3, \"Netherlands\"));\n options41.add(new Option(4, \"Hungary\"));\n QUESTION.add(new Question(41, \"Which country has the lowest population density of any country in Europe?\", getCategory(5), options41, options41.get(1)));\n\n List<Option> options42 = new ArrayList<Option>();\n options42.add(new Option(1, \"Cambodia\"));\n options42.add(new Option(2, \"Thailand\"));\n options42.add(new Option(3, \"Mynamar\"));\n options42.add(new Option(4, \"Bhutan\"));\n QUESTION.add(new Question(42, \"Angkor Wat, the largest religious monument in the world, is in which country?\", getCategory(5), options42, options42.get(0)));\n\n List<Option> options43 = new ArrayList<Option>();\n options43.add(new Option(1, \"Southern\"));\n options43.add(new Option(2, \"Northern and Southern\"));\n options43.add(new Option(3, \"Northern\"));\n options43.add(new Option(4, \"None of the above\"));\n QUESTION.add(new Question(43, \"Is the Tropic of Cancer in the northern or southern hemisphere?\", getCategory(5), options43, options43.get(2)));\n\n List<Option> options44 = new ArrayList<Option>();\n options44.add(new Option(1, \"Bangladesh\"));\n options44.add(new Option(2, \"Nepal\"));\n options44.add(new Option(3, \"Pakistan\"));\n options44.add(new Option(4, \"China\"));\n QUESTION.add(new Question(44, \"The Ganges flows through India and which other country?\", getCategory(5), options44, options44.get(0)));\n\n List<Option> options45 = new ArrayList<Option>();\n options45.add(new Option(1, \"Indian\"));\n options45.add(new Option(2, \"Pacific\"));\n options45.add(new Option(3, \"Arctic\"));\n options45.add(new Option(4, \"Atlantic\"));\n QUESTION.add(new Question(45, \"Which ocean lies on the east coast of the United States?\", getCategory(5), options45, options45.get(3)));\n\n List<Option> options46 = new ArrayList<Option>();\n options46.add(new Option(1, \"Prime Axis\"));\n options46.add(new Option(2, \"Lambert Line\"));\n options46.add(new Option(3, \"Prime Meridian\"));\n options46.add(new Option(4, \"Greenwich\"));\n QUESTION.add(new Question(46, \"What is the imaginary line called that connects the north and south pole?\", getCategory(5), options46, options46.get(2)));\n\n List<Option> options47 = new ArrayList<Option>();\n options47.add(new Option(1, \"Tropic of Cancer\"));\n options47.add(new Option(2, \"Tropic of Capricorn\"));\n QUESTION.add(new Question(47, \"The most northerly circle of latitude on the Earth at which the Sun may appear directly overhead at its culmination is called?\", getCategory(5), options47, options47.get(0)));\n\n List<Option> options48 = new ArrayList<Option>();\n options48.add(new Option(1, \"Nevada\"));\n options48.add(new Option(2, \"Arizona\"));\n options48.add(new Option(3, \"New Mexico\"));\n options48.add(new Option(4, \"San Fransisco\"));\n QUESTION.add(new Question(48, \"Which U.S. state is the Grand Canyon located in?\", getCategory(5), options48, options48.get(1)));\n\n List<Option> options49 = new ArrayList<Option>();\n options49.add(new Option(1, \"Indian Ocean\"));\n options49.add(new Option(2, \"Atlantic Ocean\"));\n options49.add(new Option(3, \"Pacific Ocean\"));\n options49.add(new Option(4, \"Arctic Ocean\"));\n QUESTION.add(new Question(49, \"Which is the largest body of water?\", getCategory(5), options49, options49.get(2)));\n\n List<Option> options50 = new ArrayList<Option>();\n options50.add(new Option(1, \"Maldives\"));\n options50.add(new Option(2, \"Monaco\"));\n options50.add(new Option(3, \"Tuvalu\"));\n options50.add(new Option(4, \"Vatican City\"));\n QUESTION.add(new Question(50, \"Which is the smallest country, measured by total land area?\", getCategory(5), options50, options50.get(3)));\n\n List<Option> options51 = new ArrayList<Option>();\n options51.add(new Option(1, \"1923\"));\n options51.add(new Option(2, \"1938\"));\n options51.add(new Option(3, \"1917\"));\n options51.add(new Option(4, \"1914\"));\n QUESTION.add(new Question(51, \"World War I began in which year?\", getCategory(6), options51, options51.get(3)));\n\n List<Option> options52 = new ArrayList<Option>();\n options52.add(new Option(1, \"France\"));\n options52.add(new Option(2, \"Germany\"));\n options52.add(new Option(3, \"Austria\"));\n options52.add(new Option(4, \"Hungary\"));\n QUESTION.add(new Question(52, \"Adolf Hitler was born in which country?\", getCategory(6), options52, options52.get(2)));\n\n List<Option> options53 = new ArrayList<Option>();\n options53.add(new Option(1, \"1973\"));\n options53.add(new Option(2, \"Austin\"));\n options53.add(new Option(3, \"Dallas\"));\n options53.add(new Option(4, \"1958\"));\n QUESTION.add(new Question(53, \"John F. Kennedy was assassinated in?\", getCategory(6), options53, options53.get(2)));\n\n List<Option> options54 = new ArrayList<Option>();\n options54.add(new Option(1, \"Johannes Gutenburg\"));\n options54.add(new Option(2, \"Benjamin Franklin\"));\n options54.add(new Option(3, \"Sir Isaac Newton\"));\n options54.add(new Option(4, \"Martin Luther\"));\n QUESTION.add(new Question(54, \"The first successful printing press was developed by this man.\", getCategory(6), options54, options54.get(0)));\n\n List<Option> options55 = new ArrayList<Option>();\n options55.add(new Option(1, \"The White Death\"));\n options55.add(new Option(2, \"The Black Plague\"));\n options55.add(new Option(3, \"Smallpox\"));\n options55.add(new Option(4, \"The Bubonic Plague\"));\n QUESTION.add(new Question(55, \"The disease that ravaged and killed a third of Europe's population in the 14th century is known as\", getCategory(6), options55, options55.get(3)));\n\n List<Option> options56 = new ArrayList<Option>();\n options56.add(new Option(1, \"Panipat\"));\n options56.add(new Option(2, \"Troy\"));\n options56.add(new Option(3, \"Waterloo\"));\n options56.add(new Option(4, \"Monaco\"));\n QUESTION.add(new Question(56, \"Napoleon was finally defeated at the battle known as?\", getCategory(6), options56, options56.get(2)));\n\n List<Option> options57 = new ArrayList<Option>();\n options57.add(new Option(1, \"Magellan\"));\n options57.add(new Option(2, \"Cook\"));\n options57.add(new Option(3, \"Marco\"));\n options57.add(new Option(4, \"Sir Francis Drake\"));\n QUESTION.add(new Question(57, \"Who was the first Western explorer to reach China?\", getCategory(6), options57, options57.get(2)));\n\n List<Option> options58 = new ArrayList<Option>();\n options58.add(new Option(1, \"Shah Jahan\"));\n options58.add(new Option(2, \"Chandragupta Maurya\"));\n options58.add(new Option(3, \"Humayun\"));\n options58.add(new Option(4, \"Sher Shah Suri\"));\n QUESTION.add(new Question(58, \"Who built the Grand Trunk Road?\", getCategory(6), options58, options58.get(3)));\n\n List<Option> options59 = new ArrayList<Option>();\n options59.add(new Option(1, \"Jawaharlal Nehru\"));\n options59.add(new Option(2, \"M. K. Gandhi\"));\n options59.add(new Option(3, \"Dr. Rajendra Prasad\"));\n options59.add(new Option(4, \"Dr. S. Radhakrishnan\"));\n QUESTION.add(new Question(59, \"Who was the first President of India?\", getCategory(6), options59, options59.get(2)));\n\n List<Option> options60 = new ArrayList<Option>();\n options60.add(new Option(1, \"8\"));\n options60.add(new Option(2, \"10\"));\n options60.add(new Option(3, \"5\"));\n options60.add(new Option(4, \"18\"));\n QUESTION.add(new Question(60, \"How many days did the battle of Mahabharata last?\", getCategory(6), options60, options60.get(3)));\n }\n return QUESTION;\n }", "@Override\n\t@Transactional(readOnly=true)\n\tpublic List<QuestionMultiChoice> findAll() {\n\t\treturn Lists.newArrayList(qcmRepository.findAll());\n\t}", "List<Result> getResultsByQuizId(int quizId);", "@Override\n\tpublic List<QA> getQAList() {\n\t\treturn qaDao.getQAList();\n\t}", "public AnswerStatistics getAnswerStatisticsbyID(int sid,int qid);", "public List<Respuesta> getRespuestas(Pregunta q, int pageSize, int page, boolean crono);", "@SuppressWarnings(\"unchecked\")\n\tpublic List<Questions> getTenQuestion(String tag){\n\t\tResponsesDao rdao = new ResponsesDao();\n\t\tTagsDao tdao = new TagsDao();\n\t\tTags tags = tdao.getTagByString(tag);\n\t\tList<Questions> quest = new ArrayList<>();\n\t\tList<Questions> retquest = new ArrayList<>();\n\t\tSession session = HibernateUtil.getSessionFactory().openSession();\n\t\tquest =\tsession.\tcreateQuery(\"from Questions where tid = :namevar\").\n\t\t\t\tsetInteger(\"namevar\", tags.getTagId()).list();\n\t\tif(quest.size() != 0) {\n\t\tfor(int i = 0; i <10; i++) {\n\t\t\tint rand = (int) (Math.random() * quest.size());\n\t\t\tretquest.add(rdao.getResponses(quest.get(rand)));\n\t\t}\n\t\t}\n\t\tsession.close();\n\t\treturn retquest;\n\t}", "public Map<String ,String> GerRegularQ(int AssessmentId) {\n Map<String, String> map = new HashMap<String, String>();\n List<String> indexes = GetAssessmentIndexes(AssessmentId);\n\n for (String index : indexes) {\n try {\n Statement stmt = Con.createStatement();\n String query = String.format(\"SELECT qora, content FROM dqs_qanda WHERE \" +\n \"((SELECT content FROM dqs_qanda WHERE qora = 'question%s_t') = 'n') AND \" +\n \"(qora='question%s' OR qora = 'question%s_c')\", index, index, index);\n //System.out.println(query);\n ResultSet rs = stmt.executeQuery(query);\n while(rs.next()) {\n map.put(rs.getString(\"qora\"), rs.getString(\"content\"));\n }\n }\n catch (Exception e) {\n System.out.println(e.getMessage());\n }\n }\n return map;\n }", "public static Object[] loadQuestions(String surveyId, String serverBase)\r\n \t\t\tthrows Exception {\r\n \t\tObject[] results = new Object[2];\r\n \t\tMap<String, String> questions = new HashMap<String, String>();\r\n \t\tList<QuestionGroupDto> groups = fetchQuestionGroups(serverBase,\r\n \t\t\t\tsurveyId);\r\n \t\tList<String> keyList = new ArrayList<String>();\r\n \t\tif (groups != null) {\r\n \t\t\tfor (QuestionGroupDto group : groups) {\r\n \t\t\t\tList<QuestionDto> questionDtos = fetchQuestions(serverBase,\r\n \t\t\t\t\t\tgroup.getKeyId());\r\n \t\t\t\tif (questionDtos != null) {\r\n \t\t\t\t\tfor (QuestionDto question : questionDtos) {\r\n \t\t\t\t\t\tkeyList.add(question.getKeyId().toString());\r\n \t\t\t\t\t\tquestions.put(question.getKeyId().toString(), question\r\n \t\t\t\t\t\t\t\t.getText());\r\n \t\t\t\t\t}\r\n \t\t\t\t}\r\n \t\t\t}\r\n \t\t}\r\n \t\tresults[0] = keyList;\r\n \t\tresults[1] = questions;\r\n \t\treturn results;\r\n \t}", "public List<Question> getQuestions()\n\t{\n\t\tList<Question> shallowCopy = new ArrayList<>();\n\t\tshallowCopy.addAll(allQuestions);\n\t\treturn shallowCopy;\n\t}", "List<Quarter> getQuarterList(Integer cityId)throws EOTException;", "public static List<Question> getAllCategoryQuestions(Category cat) {\n List<Question> questions = getQuestions(); //get all the questions\n List<Question> categoryQuestions = new ArrayList<Question>(); //make new list of questions\n for (Question q : questions) {\n if (q.getCategory().getId() == cat.getId()) {\n categoryQuestions.add(q);\n }\n }\n return categoryQuestions;\n }", "public List<Question> getQuestions() {\n return questionList;\n }", "public List<Question> listQuestion(String query) throws StorageException {\n\t\tif (query == null || query.compareTo(\"\") == 0) {\n\t\t\tquery = \"1\";\n\t\t}\n\t\tList<Question> questionList = new ArrayList<Question>();\n\t\tString sortOrder = \"_ID ASC\";\n\t\tString[] selectionArguments = null;\n\t\tQuestion question;\n\t\tCursor cursor = contentResolver.query(LocalStorageContentProvider.QUESTION_URI, null, query, selectionArguments,\n\t\t\t\tsortOrder);\n\t\ttry {\n\t\t\tif (cursor.moveToFirst()) {\n\t\t\t\tdo {\n\t\t\t\t\tquestion = new Question();\n\t\t\t\t\tquestion.set_Id(cursor.getString(cursor.getColumnIndex(\"_ID\")));\n\t\t\t\t\tquestion.setType(cursor.getString(cursor.getColumnIndex(\"TYPE\")));\n\t\t\t\t\tquestion.setTitle(cursor.getString(cursor.getColumnIndex(\"TITLE\")));\n\t\t\t\t\tquestion.setAnswer(cursor.getString(cursor.getColumnIndex(\"ANSWER\")));\n\t\t\t\t\tquestion.set_idQuestionSet(cursor.getString(cursor.getColumnIndex(\"QUESTIONSET_ID\")));\n\t\t\t\t\tquestionList.add(question);\n\t\t\t\t} while (cursor.moveToNext());\n\t\t\t}\n\t\t} catch (Exception e) {\n\t\t\tthrow new StorageException();\n\t\t} finally {\n\t\t\tif (cursor != null && !cursor.isClosed()) {\n\t\t\t\tcursor.close();\n\t\t\t}\n\t\t}\n\t\treturn questionList;\n\t}", "public Answerpojo getAnswerByQno(int qno){\n if((answerList!=null))\n for(Answerpojo ans:answerList){\n // System.out.println(\" inside for loop\");\n if(ans.getQno()==qno)\n { \n System.out.println(\" inside if return ans \");\n return ans;\n }\n // System.out.println(\"outside if return null\");\n }\n //System.out.println(\"outside for\");\n return null;\n }", "private void parseQuestions()\n\t{\n\t\tlog.info(\"Parsing questions\");\n\t\t@SuppressWarnings(\"unchecked\")\n\t\tList<Element> questions_list = doc.selectNodes(\"//document/questions/rows/row\");\n\t\tq_l10ns_node = doc.selectSingleNode(\"//document/question_l10ns/rows\");\n\t\tsq_node = doc.selectSingleNode(\"//document/subquestions/rows\");\n\t\tq_node = doc.selectSingleNode(\"//document/questions/rows\");\n\t\ta_node = doc.selectSingleNode(\"//document/answers/rows\");\n\n\t\tfor (Element question : questions_list) {\n\t\t\tString qid = question.element(\"qid\").getText();\n\t\t\tlog.debug(\"Working on question: \" + qid);\n\t\t\tQuestion q = new Question(qid,\n\t\t\t\t\t\t\t\t\t Integer.parseInt(question.element(\"gid\").getText()),\n\t\t\t\t\t\t\t\t\t question.element(\"type\").getText(),\n\t\t\t\t\t\t\t\t\t q_l10ns_node.selectSingleNode(\"row[qid=\" + qid + \"]/question\").getText(),\n\t\t\t\t\t\t\t\t\t question.element(\"title\").getText(),\n\t\t\t\t\t\t\t\t\t question.element(\"mandatory\").getText().equals(\"N\") ? \"No\" : \"Yes\",\n\t\t\t\t\t\t\t\t\t q_l10ns_node.selectSingleNode(\"row[qid=\" + qid + \"]/language\").getText());\n\n\t\t\t// Add a description, if there is one\n\t\t\tNode desc = q_l10ns_node.selectSingleNode(\"row[qid=\" + q.getQid() + \"]/help\");\n\t\t\tif (desc != null) {\n\t\t\t\tq.setDescription(desc.getText());\n\t\t\t}\n\n\t\t\taddCondition(q);\n\n\t\t\tswitch (q.type) {\n\t\t\t\t// Normal Text Fields\n\t\t\t\tcase \"S\":\n\t\t\t\tcase \"T\":\n\t\t\t\tcase \"U\":\n\t\t\t\t\tq.setType(\"T\");\n\t\t\t\t\tsurvey.addQuestion(q);\n\t\t\t\t\tbreak;\n\t\t\t\t// Date/Time\n\t\t\t\tcase \"D\":\n\t\t\t\t\tdate_time_qids.add(q.getQid());\n\t\t\t\t\tbreak;\n\t\t\t\t// Numeric Input\n\t\t\t\tcase \"N\":\n\t\t\t\t\tif (check_int_only(q)) {\n\t\t\t\t\t\tq.setType(\"I\");\n\t\t\t\t\t}\n\t\t\t\t\tadd_range(q);\n\t\t\t\t\tsurvey.addQuestion(q);\n\t\t\t\t\tbreak;\n\t\t\t\t// Single 5-Point Choice\n\t\t\t\tcase \"5\":\n\t\t\t\t\tq.setType(\"A\");\n\t\t\t\t\tq.setAnswers(new AnswersList(\"5pt.cl\", ClGenerator.getIntCl(5), \"string\", true));\n\t\t\t\t\tsurvey.addQuestion(q);\n\t\t\t\t\tbreak;\n\t\t\t\t// Yes/No\n\t\t\t\tcase \"Y\":\n\t\t\t\t\tq.setType(\"A\");\n\t\t\t\t\tq.setAnswers(new AnswersList(\"YN.cl\", ClGenerator.getYNCl(), \"string\", false));\n\t\t\t\t\tsurvey.addQuestion(q);\n\t\t\t\t\tbreak;\n\t\t\t\t// Gender\n\t\t\t\tcase \"G\":\n\t\t\t\t\tq.setType(\"A\");\n\t\t\t\t\tq.setAnswers(new AnswersList(\"Gender.cl\", ClGenerator.getGenderCl(), \"string\", false));\n\t\t\t\t\tsurvey.addQuestion(q);\n\t\t\t\t\tbreak;\n\t\t\t\t// List with comment\n\t\t\t\tcase \"O\":\n\t\t\t\t\taddComment(q);\n\t\t\t\t// Radio List\n\t\t\t\tcase \"L\":\n\t\t\t\t// Dropdown List\n\t\t\t\tcase \"!\":\n\t\t\t\t\tboolean oth = question.elementText(\"other\").equals(\"Y\");\n\t\t\t\t\tif(oth) {\n\t\t\t\t\t\taddOtherQuestion(q);\n\t\t\t\t\t}\n\t\t\t\t\tq.setType(\"A\");\n\t\t\t\t\tq.setAnswers(new AnswersList(q.getQid() + \".cl\", getAnswerCodesByID(q.getQid(), oth), \"string\", false));\n\t\t\t\t\tsurvey.addQuestion(q);\n\t\t\t\t\tbreak;\n\t\t\t\t// Multiple Texts\n\t\t\t\t// Input On Demand\n\t\t\t\tcase \"Q\":\n\t\t\t\t\taddSubquestions(q, \"T\");\n\t\t\t\t\tbreak;\n\t\t\t\t// Multiple Numeric Inputs\n\t\t\t\tcase \"K\":\n\t\t\t\t\tadd_range(q);\n\t\t\t\t\tif (check_int_only(q)){\n\t\t\t\t\t\taddSubquestions(q, \"I\");\n\t\t\t\t\t} else {\n\t\t\t\t\t\taddSubquestions(q, \"N\");\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\t// Dual scale array\n\t\t\t\tcase \"1\":\n\t\t\t\t\tHashMap<String, String>[] code_lists = ClGenerator.getDualScaleCls(q.getQid(), getAnswerIdsByID(q.getQid()), a_node);\n\t\t\t\t\taddSubquestionsWithCL(q, q.getQid() + \".0\", code_lists[0], \"string\", false, \"-0\");\n\t\t\t\t\taddSubquestionsWithCL(q, q.getQid() + \".1\", code_lists[1], \"string\", false, \"-1\");\n\t\t\t\t\tbreak;\n\t\t\t\t// Array by column\n\t\t\t\tcase \"H\":\n\t\t\t\t// Flexible Array\n\t\t\t\tcase \"F\":\n\t\t\t\t\taddSubquestionsWithCL(q, q.getQid().concat(\".cl\"), getAnswerCodesByID(q.getQid(), false), \"string\", false, \"\");\n\t\t\t\t\tbreak;\n\t\t\t\t// 5pt Array\n\t\t\t\tcase \"A\":\n\t\t\t\t\taddSubquestionsWithCL(q, \"5pt.cl\", ClGenerator.getIntCl(5), \"integer\", true, \"\");\n\t\t\t\t\tbreak;\n\t\t\t\t// 10pt Array\n\t\t\t\tcase \"B\":\n\t\t\t\t\taddSubquestionsWithCL(q, \"10pt.cl\", ClGenerator.getIntCl(10), \"integer\", true, \"\");\n\t\t\t\t\tbreak;\n\t\t\t\t// Increase/Same/Decrease Array\n\t\t\t\tcase \"E\":\n\t\t\t\t\taddSubquestionsWithCL(q, \"ISD.cl\", ClGenerator.getISDCL(), \"string\", false, \"\");\n\t\t\t\t\tbreak;\n\t\t\t\t// 10pt Array\n\t\t\t\tcase \"C\":\n\t\t\t\t\taddSubquestionsWithCL(q, \"YNU.cl\", ClGenerator.getYNUCL(), \"string\", false, \"\");\n\t\t\t\t\tbreak;\n\t\t\t\t// Matrix with numerical input\n\t\t\t\tcase \":\":\n\t\t\t\t\tq.setType(\"N\");\n\t\t\t\t\taddQuestionMatrix(q);\n\t\t\t\t\tbreak;\n\t\t\t\t// Matrix with text input\n\t\t\t\tcase \";\":\n\t\t\t\t\tq.setType(\"T\");\n\t\t\t\t\taddQuestionMatrix(q);\n\t\t\t\t\tbreak;\n\t\t\t\t// Multiple Choice (Normal, Bootstrap, Image select)\n\t\t\t\tcase \"M\":\n\t\t\t\t\taddSubquestionsWithCL(q, \"MC.cl\", ClGenerator.getMCCL(), \"string\", false, \"\");\n\t\t\t\t\tif (question.elementTextTrim(\"other\").equals(\"Y\")) {\n\t\t\t\t\t\tq.setQid(q.getQid().concat(\"other\"));\n\t\t\t\t\t\tq.setType(\"T\");\n\t\t\t\t\t\tsurvey.addQuestion(q);\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\t// MC with comments\n\t\t\t\tcase \"P\":\n\t\t\t\t\taddSubquestionsWithCL(q, \"MC.cl\", ClGenerator.getMCCL(), \"string\", false, \"\");\n\t\t\t\t\tbreak;\n\t\t\t\tdefault:\n\t\t\t\t\tlog.error(\"Question type not supported: \" + q.type);\n\t\t\t}\n\t\t}\n\t}", "@Override\n\tpublic List<Document> findDocumentsByQuestion(String question) {\n\t\t\n\t\tString [] keyWords = question.split(\" \");\n\t\tList<Document> documents = new ArrayList<>();\n\t\t\n\t\tList<Filters> filters = filtersRepository.findByCommonsWordsWordIn(keyWords);\n\t\tfor(Filters f : filters){\n\t\t\tdocuments.addAll(f.getDocuments());\n\t\t}\n\t\t\n\t\treturn documents;\n\t}", "public QuestionElement getQuestion(){\r\n\t\treturn ques;\r\n\t}", "List<Question11> selectByExample(Question11Example example);", "public List<T> query(QueryObject qo) {\n\t\treturn null;\n\t}", "public static List<Question> fetch(int id) throws ApplicationException {\n List<Question> result = null;\n\n Connection connection = null;\n try {\n connection = ConnectionPool.getConnection();\n result = QuestionDatabaseAccess.fetch(connection, id);\n } finally {\n ConnectionPool.releaseConnection(connection);\n }\n\n return result;\n }", "public List<Answer> getAnswersByPoints(Question q) {\n \tList<Answer> finalAnswers = new ArrayList<Answer>();\n List<Answer> answers = q.getAnswers();\n \n for(Answer a: answers) {\n \tif(a.getAuthor().equals(this))\n \t\tfinalAnswers.add(a);\n }\n // We want the most recent questions first so reverse the array with\n // Collections.reverse\n // PostPointsComparator returns questions in asc we want desc\n Collections.sort(finalAnswers, new PostPointsComparator());\n Collections.reverse(finalAnswers);\n\n return finalAnswers;\n }", "public List<Question> getQuestions(Category category) {\n List<Question> questions = null;\n try {\n DataBaseBroker dbb = new DataBaseBroker();\n dbb.loadDriver();\n dbb.establishConnection();\n questions = dbb.getQuestion(category);\n dbb.commit();\n dbb.closeConnection();\n } catch (Exception ex) {\n Logger.getLogger(GameDBLogic.class.getName()).log(Level.SEVERE, null, ex);\n }\n return questions;\n }", "@GetMapping(\"/{quesId}\")\n\tpublic Question get(@PathVariable(\"quesId\") Long quesId) {\n\t\treturn this.questionService.getQuestion(quesId);\n\t}", "List<Question> selectByExample(QuestionExample example);", "List<Question> selectByExample(QuestionExample example);", "List<Question> selectByExample(QuestionExample example);", "List<Question> selectByExample(QuestionExample example);", "public Pyramid[] getAllByQSortId(final int qsortId) {\n // TODO implement after QSort implemented\n Pyramid[] result=null;\n try {\n QSortHelper qSortHelper=(QSortHelper)this.dbc.getHelper(DatabaseConnector.TYPE_QSORT);\n result=new Pyramid[1];\n result[0]=getObjectById(qSortHelper.getStudyIdByQSortId(qsortId));\n //TODO: setCells! //this.getPyramidCells(qsortId, result[0].getId());\n } catch (HelperNotFoundException e) {\n e.printStackTrace();\n return null;\n }\n return result;\n }", "List<Question27> selectByExample(Question27Example example);", "public List<Literal> query(Literal q) {\n\r\n\t\t\r\n\t\tList<Literal> result = datalogReasoner.query(compiledClauses, q);\r\n\t\t\r\n\t\tLDLPProgramQueryResultDecompiler decompiler = new LDLPProgramQueryResultDecompiler();\r\n\t\t\r\n\t\tresult = decompiler.decompileLiterals(result);\r\n\t\t\t\t\r\n\t\treturn result;\r\n\r\n\r\n\t}", "public List<Question> listQuestions(DataSource ds){\n\t ArrayList<Question> questions = new ArrayList<Question>();\n ResultSet rs = null;\n Statement stmt = null;\n try{\n conn = ds.getConnection();\n stmt = conn.createStatement();\n rs = stmt.executeQuery(\n \"SELECT id, name, image, sound, category, level, easy, medium, hard FROM questions\");\n while(rs.next()){\n Question currentQuestion = new Question();\n currentQuestion.setQuestionId(rs.getInt(1));\n currentQuestion.setWord(rs.getString(2));\n currentQuestion.setImage(rs.getString(3));\n currentQuestion.setSound(rs.getString(4));\n currentQuestion.setCategory(rs.getString(5));\n currentQuestion.setLevel(rs.getInt(6));\n String difficulty = \"\";\n if (rs.getInt(7)==1)\n difficulty = \"easy\";\n else \n if(rs.getInt(8)==1)\n difficulty = \"medium\";\n else\n if(rs.getInt(9)==1)\n difficulty = \"hard\";\n currentQuestion.setDifficulty(difficulty);\n questions.add(currentQuestion);\n }\n conn.close();\n }\n catch(Exception ex){ex.printStackTrace();}\n finally {\n try {if (rs != null) rs.close();} catch (SQLException e) {}\n try {if (stmt != null) stmt.close();} catch (SQLException e) {}\n try {if (conn != null) conn.close();} catch (SQLException e) {}\n }\n System.out.println(\"TMA...All qns count: \" + questions.size());\n \n\t return questions;\n\t}", "@Override\n\t@Transactional(readOnly=true)\n\tpublic List<QuestionMultiChoice> findByTags_Id(Long id) {\n\t\tList<QuestionMultiChoice> list = qcmRepository.findByTags_Id(id);\n\t\treturn list;\n\t}", "Optional<Question> findByIdWithAllDetails(QuestionId id);", "public List<quanhuyen> getAllQuanHuyen() {\n List<quanhuyen> qhlists1 = new ArrayList<>();\n // Step 1: Establishing a Connection\n try (Connection connection = DBConnection.createConnection();\n PreparedStatement statement = connection.prepareStatement(getAll);) {\n\n ResultSet resultSet = statement.executeQuery();\n\n while (resultSet.next()) {\n int id = resultSet.getInt(\"id\");\n String tenQH = resultSet.getString(\"ten\");\n int tpid = resultSet.getInt(\"ThanhPhoid\");\n int trangthai = resultSet.getInt(\"trangthai\");\n qhlists1.add(new quanhuyen(id, tenQH, tpid, trangthai));\n }\n } catch (SQLException e) {\n printSQLException(e);\n }\n return qhlists1;\n }", "List<AnswerList> findAllAnsList();", "public static void printQuestions(ArrayList<Question> quest) {\n\t\tfor (Question question : quest) {\n\t\t\tquestion.getText();\n\t\t}\n\t}", "@WebMethod public Vector<Question> getQuestions(Event ev);", "protected List<Question> getListNumOfQuestions(List<Question> q, int n) {\n \tList<Question> finalQuestions = new ArrayList<Question>();\n \tfor (int i = 0; i < n; i++) {\n finalQuestions.add(q.get(i));\n }\n return finalQuestions;\n }", "List<Question14> selectByExample(Question14Example example);", "public void printQuestions()\r\n\t{\r\n\t\tfor(int i = 0; i < questions.size(); i++)\r\n\t\t{\r\n\t\t\tString q = questions.get(i).toString();\r\n\t\t\tSystem.out.println( (i+1) + \". \" + q);\r\n\t\t}\r\n\t}", "public ArrayList<Integer> getQuestionIDs(int cID) {\n ArrayList<Integer> questions = new ArrayList<Integer>();\n String query;\n\n try {\n Connection con = Database.createDBconnection();\n Statement stmt = con.createStatement();\n query = \"SELECT question_ID FROM question WHERE category_ID='\" + cID + \"';\";\n ResultSet rs = stmt.executeQuery(query);\n\n while(rs.next()) {\n questions.add(rs.getInt(\"question_ID\"));\n }\n\n Database.closeDBconnection(con);\n }\n catch (Exception e) {\n e.printStackTrace();\n }\n return questions;\n }", "@Override\n\tpublic List<Question> getQuestions() {\n\t\treturn null;\n\t}", "public List<AnswerEntity> getAllAnswersToQuestion(\n final String questionId, final String accessToken)\n throws AuthorizationFailedException, InvalidQuestionException {\n UserAuthEntity userAuthEntity = userAuthDao.getUserAuthByToken (accessToken);\n if (userAuthEntity == null) {\n throw new AuthorizationFailedException (\"ATHR-001\", \"User has not signed in\");\n } else if (userAuthEntity.getLogoutAt () != null) {\n throw new AuthorizationFailedException (\n \"ATHR-002\", \"User is signed out.Sign in first to get the answers\");\n }\n QuestionEntity questionEntity = questionDao.getQuestionById (questionId);\n if (questionEntity == null) {\n throw new InvalidQuestionException (\n \"QUES-001\", \"The question with entered uuid whose details are to be seen does not exist\");\n }\n return answerDao.getAllAnswersToQuestion (questionId);\n }", "Question getQuestionInPick(String questionId);", "public Faq[] findAll() throws FaqDaoException;", "public Question[] getQuestions() {\n return this.questions.toArray(new Question[0]);\n }", "protected List<QuestionImpl> readQuestions(String whereOrder, Object[] fields)\n\t{\n\t\tfinal List<QuestionImpl> rv = new ArrayList<QuestionImpl>();\n\n\t\tStringBuilder sql = new StringBuilder();\n\t\tsql.append(\"SELECT Q.CONTEXT, Q.CREATED_BY_DATE, Q.CREATED_BY_USER, Q.EXPLAIN_REASON, Q.FEEDBACK,\");\n\t\tsql.append(\" Q.HINTS, Q.HISTORICAL, Q.ID, Q.MINT, Q.MODIFIED_BY_DATE, Q.MODIFIED_BY_USER, Q.POOL_ID,\");\n\t\tsql.append(\" Q.PRESENTATION_TEXT, Q.PRESENTATION_ATTACHMENTS, Q.SURVEY, Q.TYPE, Q.GUEST, QT.TITLE\");\n\t\tsql.append(\" FROM MNEME_QUESTION Q \");\n\t\tsql.append(whereOrder);\n\n\t\tfinal QuestionServiceImpl qService = this.questionService;\n\t\tthis.sqlService.dbRead(sql.toString(), fields, new SqlReader()\n\t\t{\n\t\t\tpublic Object readSqlResultRecord(ResultSet result)\n\t\t\t{\n\t\t\t\ttry\n\t\t\t\t{\n\t\t\t\t\tQuestionImpl question = newQuestion();\n\t\t\t\t\tquestion.initContext(SqlHelper.readString(result, 1));\n\t\t\t\t\tquestion.getCreatedBy().setDate(SqlHelper.readDate(result, 2));\n\t\t\t\t\tquestion.getCreatedBy().setUserId(SqlHelper.readString(result, 3));\n\t\t\t\t\tquestion.setExplainReason(SqlHelper.readBoolean(result, 4));\n\t\t\t\t\tquestion.setFeedback(SqlHelper.readString(result, 5));\n\t\t\t\t\tquestion.setHints(SqlHelper.readString(result, 6));\n\t\t\t\t\tquestion.initHistorical(SqlHelper.readBoolean(result, 7));\n\t\t\t\t\tquestion.initId(SqlHelper.readId(result, 8));\n\t\t\t\t\tquestion.initMint(SqlHelper.readBoolean(result, 9));\n\t\t\t\t\tquestion.getModifiedBy().setDate(SqlHelper.readDate(result, 10));\n\t\t\t\t\tquestion.getModifiedBy().setUserId(SqlHelper.readString(result, 11));\n\t\t\t\t\tquestion.initPool(SqlHelper.readId(result, 12));\n\t\t\t\t\tquestion.getPresentation().setText(SqlHelper.readString(result, 13));\n\t\t\t\t\tquestion.getPresentation().setAttachments(SqlHelper.readReferences(result, 14, attachmentService));\n\t\t\t\t\tquestion.setIsSurvey(SqlHelper.readBoolean(result, 15));\n\t\t\t\t\tqService.setType(SqlHelper.readString(result, 16), question);\n\t\t\t\t\tquestion.getTypeSpecificQuestion().setData(SqlHelper.decodeStringArray(StringUtil.trimToNull(result.getString(17))));\n question.setTitle(SqlHelper.readString(result, 18));\n\n\t\t\t\t\tquestion.clearChanged();\n\t\t\t\t\trv.add(question);\n\n\t\t\t\t\treturn null;\n\t\t\t\t}\n\t\t\t\tcatch (SQLException e)\n\t\t\t\t{\n\t\t\t\t\tM_log.warn(\"readQuestions: \" + e);\n\t\t\t\t\treturn null;\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\n\t\treturn rv;\n\t}" ]
[ "0.7535263", "0.7362277", "0.72314006", "0.6939551", "0.6850969", "0.6846397", "0.67206556", "0.66955197", "0.6656947", "0.6635293", "0.66213536", "0.6611896", "0.6555799", "0.65207124", "0.6515963", "0.65091443", "0.65000916", "0.6492097", "0.6488585", "0.6483019", "0.64749104", "0.64228266", "0.64105946", "0.64100957", "0.637901", "0.63415605", "0.6335176", "0.63324034", "0.62617564", "0.62585723", "0.62257886", "0.62245333", "0.6215407", "0.61951", "0.61874044", "0.61586535", "0.6126611", "0.60693836", "0.6063994", "0.60261804", "0.6006395", "0.6005489", "0.598777", "0.5971501", "0.5966067", "0.5960452", "0.5944369", "0.5940353", "0.59284234", "0.5923224", "0.59147227", "0.58989686", "0.5866247", "0.58591855", "0.5845287", "0.58325714", "0.58305", "0.58277035", "0.58221686", "0.58087546", "0.577468", "0.5773333", "0.5768635", "0.57515174", "0.57512194", "0.57424533", "0.5738479", "0.5736857", "0.5733807", "0.57315236", "0.57267493", "0.5725238", "0.5718776", "0.5718032", "0.5714695", "0.5710253", "0.57059604", "0.57059604", "0.57059604", "0.57059604", "0.57014465", "0.5698479", "0.56940126", "0.56932324", "0.56903446", "0.5683275", "0.5674531", "0.5657882", "0.5654852", "0.56534636", "0.5642451", "0.5640607", "0.56139374", "0.5612002", "0.5601334", "0.5580321", "0.55763716", "0.5568116", "0.5566342", "0.5562987" ]
0.69558346
3
get a single question
@GetMapping("/{quesId}") public Question get(@PathVariable("quesId") Long quesId) { return this.questionService.getQuestion(quesId); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "Question getQuestion(String questionId);", "Question getFirstQuestion();", "Question getQuestion();", "public Question getQuestionbyId(int sid,int qid);", "Question getQuestionInPick(String questionId);", "public Question getQuestion(String questionId) {\r\n Question[] questions = currentProcessInstance.getQuestions();\r\n Question foundQuestion = null;\r\n \r\n for (int i = 0; foundQuestion == null && i < questions.length; i++) {\r\n if (questions[i].getId().equals(questionId))\r\n foundQuestion = questions[i];\r\n }\r\n \r\n return foundQuestion;\r\n }", "public SurveyQuestion getQuestion (int idx)\n {\n if (idx >= 0 && idx < questions.size()) {\n return questions.get(idx);\n }\n return null;\n }", "@Override\n\tpublic Question getQuestion(Integer qid) {\n\t\treturn questionDao.getEntity(qid);\n\t}", "@RequestMapping(value = \"/getQuestion/{test}/{question}\")\n\tpublic Questions getSingleQuestion(@PathVariable(\"test\") int testid,@PathVariable(\"question\") int question) {\n\t\tTest test = testDao.gettestStatus(testid);\n\t\tif(test!=null) {\n\t\t\t\n\t\t\tfor(Questions testQueList : test.getQuestions()) {\n\t\t\t\tif(testQueList.getQid()==question) {\n\t\t\t\t\t//System.out.println(\"test id : \"+testQueList.getTest());\n//\t\t\t\t\ttestQueList.setTest(test.getTestid());\n\t\t\t\t\treturn testQueList;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn null;\n\t}", "Question getQuestionInDraw(String questionId);", "public Questions getQuestion(int qid) {\n\t\tSession session = HibernateUtil.getSessionFactory().openSession();\n\t\tQuestions quest = (Questions) session.get(Questions.class, qid);\n\t\tsession.close();\n\t\treturn quest;\n\t}", "public Question getFirstQ()\n {\n return questionList.get(0);\n }", "@GetMapping (\"/getOneQuestion\")\n @ResponseBody\n public Question getOneQuestion(long id){\n Optional<Question> oquestion = this.questionRepository.findById(id);\n if(oquestion.isPresent()){\n return oquestion.get();\n }\n return null;\n }", "public String getQuestion(int idType, int idQuest) throws SQLException{ \r\n String query= (\"select question from \"+Database.Table.TABLE_PRETEST_QUESTION+\" where idtype = '\"+idType+\"' AND idquest = '\"+idQuest+\"'\");\r\n ResultSet rs = q.querySelect(query);\r\n while(rs.next()){\r\n question=rs.getString(\"question\");\r\n }\r\n return question;\r\n }", "Question selectByPrimaryKey(String questionId);", "public Question getQuestion() {\n return this.question;\n }", "Question selectByPrimaryKey(String id);", "public Survey getSurveyQuestion(Long surveyId, Long userId);", "@GetMapping(value=\"/getQuestion/{questionId}\")\n\tpublic Question getQuestion(@PathVariable(\"questionId\") int id) throws QuestionException{\n\t\tLOGGER.info(\"Viewing Question By Id\");\n\t\treturn questionObj.viewQuestionById(id);\n\t}", "public String getQuestion(int index){\n return questionList.get(index);\n }", "public Question getQuestion() {\n\t\treturn questionToAsk;\n\t}", "public String getQuestion() {\n return question;\n }", "public Question getQuestionById(int id) {\n \t\tfor (Question question : questions)\n \t\t\tif (question.getId() == id)\n \t\t\t\treturn question;\n \t\treturn null;\n \t}", "public static Question getQuestionById(Question entity) throws ApplicationException {\n Question result = null;\n\n Connection connection = null;\n\n try {\n connection = ConnectionPool.getConnection();\n result = QuestionDatabaseAccess.getQuestionById(entity, connection);\n } finally {\n ConnectionPool.releaseConnection(connection);\n }\n\n return result;\n }", "public String getQuestion() {\n return question;\n }", "public Question findQuestionById(final Long questionId) {\n final Optional<Question> findFirst = getSubmittedAnswers().keySet().stream()\n .filter(q -> q.getId() == questionId).findFirst();\n if (findFirst.isPresent()) {\n return findFirst.get();\n }\n return null;\n }", "static Question getQuestionByID(Context context, int questionID) {\n JsonReader reader;\n try {\n reader = readJSONFromAsset(context);\n reader.beginArray();\n while (reader.hasNext()) {\n Question currentQuestion = readQuestion(reader);\n if (currentQuestion.getQuestionID() == questionID) {\n reader.close();\n return currentQuestion;\n }\n }\n } catch (IOException e) {\n e.printStackTrace();\n }\n\n return null;\n }", "public Long getQuestionId();", "public String getQuestion(int a) {\n String question = textQuestions[a];\n return question;\n }", "public String getQuestion() {\n\t\treturn question;\n\t}", "Question selectByPrimaryKey(Integer id);", "Question selectByPrimaryKey(Integer id);", "public String getQuestion() {\n return mQuestion;\n }", "QuestionOne selectByPrimaryKey(Integer id);", "@Override\n\tpublic String getQuest() {\n\t\t// TODO Auto-generated method stub\n\t\treturn this.question;\n\t}", "public Question getQuestion()\n {\n return currentQuestion;\n }", "public QuestInterface getQuest(int q) throws IllegalArgumentException {\n\t\tfor (QuestInterface quest : this.getQuests()) {\n\t\t\tif (quest.getQuestId() == q) {\n\t\t\t\treturn quest;\n\t\t\t}\n\t\t}\n\t\tthrow new IllegalArgumentException(\"No quest found\");\n\t}", "public Knowledge knowlegde(String questionId) {\n\t\treturn Optional.ofNullable(questionRepository.find(questionId))\n\t\t\t\t.map(q -> new Knowledge(q, answerRepository.list(q.getAnswerIds()))).orElse(null);\n\t}", "public String getKeyword(String question)\n\t{\n\t\tString answer = \"\";\n\t\ttry \n\t\t{\n\t\t\tCorpus corpus = (Corpus) Factory.createResource(\"gate.corpora.CorpusImpl\");\n\t\t\tgate.Document doc = gate.Factory.newDocument(question);\n\t\t\tcorpus.add(doc);\n\t\t\tctrl.setCorpus(corpus);\n\t\t\tctrl.execute();\n\t\t\t\n\t\t\tcorpus.clear();\n\t\t\t\n\t\t\tArrayList<gate.Annotation> annList = new ArrayList<gate.Annotation>();\n\t\t\t//Add whatever annotations you are interested in processing further\n\t\t\t//to annList--questions, requests, instructions, etc.\n\t\t\tannList.addAll(doc.getAnnotations().get(\"question\"));\n\n\t\t for(gate.Annotation ann:annList)\n\t\t {\n\t\t \tanswer += ann.getFeatures().toString();\n\t\t }\n\t\t // REALLY important to release doc and coprpus after processing each request, \n\t\t // question, instruction, etc., or your program will quickly run out of heap space.\n\t\t Factory.deleteResource(doc);\n\t\t Factory.deleteResource(corpus);\n\t\t} catch (Exception e){\n\t\t\tSystem.out.println(e.getMessage());\n\t\t}\n\t\t\n\t\treturn answer;\n\t}", "public objData getQuestion(String id){\n objData objdata = new objData();\n try{\n MainClient mc = new MainClient(DBConn.getHost());\n\n String query = \"SELECT TBD_REFID, TSDB_REFID, TDB_QNO, TDB_QUEST FROM TEST_DB WHERE TDB_REFID = '\" + id + \"'\";\n String data[] = {};\n\n objdata.setTableData(mc.getQuery(query,data));\n }\n catch(Exception e){\n objdata.setErrorMessage(e.toString());\n objdata.setFlag(1);\n }\n return objdata;\n }", "public String getAnswer(String question) {\n for (Map.Entry<String, String> entry : questions.entrySet()) {\n if(question.matches(entry.getKey())) {\n if(!answers.containsKey(entry.getValue())) {\n logger.warning(\"Question matches, but we don't have answer ID \" + entry.getValue());\n break;\n }\n\n return answers.get(entry.getValue());\n }\n }\n return null;\n }", "Question getQuest(String topic){\r\n\t\thasQ = false;\r\n\t\twhile(!hasQ){\r\n\t\t\trandNo = rand.nextInt(bank.get(topic).size());\r\n\t\t\tif(!bank.get(topic).get(randNo).getAsked()){\r\n\t\t\t\tbank.get(topic).get(randNo).setAsked(true);\r\n\t\t\t\treturn bank.get(topic).get(randNo);\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn null;\r\n\t}", "public Question getCurrentQuestion() {\n Question question = null;\n for (Question q : questions) {\n if (q.getSequence() == sequence) {\n question = q;\n break;\n }\n }\n return question;\n }", "public String getQuestion(int i) { \n\t\ttry {\n\t\t\treturn myQuestions.getQuestion(i).getQuestionText();\n\t\t} catch (RemoteException e) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\te.printStackTrace();\n\t\t\treturn \"no connection to server\"; \n\t\t} \n\t}", "public String get_question(){return this._question;}", "public QuestionEntity getQuestionById(final String uuid) {\n try {\n return entityManager.createNamedQuery(\"getQuestionByUuid\", QuestionEntity.class)\n .setParameter(\"uuid\", uuid).getSingleResult();\n } catch (NoResultException nre) {\n return null;\n }\n }", "public Survey getSurveybySid(int sid);", "public int getIdQuestion() {\r\n return idQuestion;\r\n }", "@Override\n\t@Transactional\n\tpublic Question getQuestionById(int id) {\n\t\treturn questionDao.getQuestionById(id);\n\t}", "public String getQuestionId() \n {\n return questionId;\n }", "protected static Question getQuestionById(Question entity, Connection connection) throws ApplicationException {\n\n Question result = null;\n\n String sqlString = \"\";\n sqlString += \"SELECT * FROM \" + QuestionDatabaseAccess.TABLE;\n sqlString += \" WHERE \" + QuestionDatabaseAccess.COL_QUESTION_ID + \" = ?\";\n\n PreparedStatement statement = null;\n\n try {\n try {\n statement = connection.prepareStatement(sqlString);\n statement.setInt(1, entity.getId());\n ResultSet resultSet = statement.executeQuery();\n result = convertToInstance(resultSet);\n } finally {\n if (statement != null) {\n statement.close();\n }\n }\n } catch (SQLException e) {\n throw new ApplicationException(\"Failed to select\", e);\n }\n\n return result;\n }", "public String getQuestions(int a){\n String question = questions[a];\n return question;\n }", "public Question getQuestion() {\n if (Problem_Type.featOkTst && ((Problem_Type)jcasType).casFeat_question == null)\n jcasType.jcas.throwFeatMissing(\"question\", \"hw1.qa.Problem\");\n return (Question)(jcasType.ll_cas.ll_getFSForRef(jcasType.ll_cas.ll_getRefValue(addr, ((Problem_Type)jcasType).casFeatCode_question)));}", "public int getIdQuestion() {\n return idQuestion;\n }", "@Override\n\tpublic Questions showQuestion(Test onlineTest, BigInteger questionId) throws UserException {\n\t\treturn null;\n\t}", "@Query(\"SELECT * FROM wellbeing_questions WHERE wellbeing_question_id == :id\")\n WellbeingQuestion getQuestionById(long id);", "public QuestionModel getDefaultQuestion() {\n\t\treturn questionList.get(0);\n\t}", "public TextField getQuestion() {\r\n\t\tquestion.setPromptText(\"question\");\r\n\t\treturn question;\r\n\t}", "public Question getQuestion(int questionNumber) throws\n InvalidQuestionNumber {\n\n switch (questionNumber) {\n case 1: return questionList.get(0);\n case 2: return questionList.get(1);\n default: throw new InvalidQuestionNumber();\n }\n }", "List<Question> getQuestions(String surveyId);", "public QuestionElement getQuestion(){\r\n\t\treturn ques;\r\n\t}", "@Override\n public String ask(String question) {\n return answers[position++];\n }", "@Override\r\n\tpublic Answer getAnswer(Long userId, Long questionId) {\r\n\t\tCriteria criteria = currentSession().createCriteria(Answer.class);\r\n\t\treturn (Answer) criteria.add(Restrictions.eq(\"userId\", userId)).add(Restrictions.eq(\"questionId\", questionId))\r\n\t\t .uniqueResult();\r\n\t}", "Question getLastQuestion();", "@GET\n @Path(\"/randomquestion\")\n public String getRandomQuestion() {\n return \"test\";\n //return map.keySet().toArray()[ThreadLocalRandom.current().nextInt(1, map.size())].toString();\n }", "@Override\n\t\tpublic Object getItem(int arg0) {\n\t\t\t// TODO Auto-generated method stub\n\t\t\treturn questions.get(arg0);\n\t\t}", "public int getQuestionId() {\n return questionId;\n }", "public String getNextQuestion() {\r\n\t\t// Condition for getting the exact question, starting from the first question in\r\n\t\t// the list. This will happen until the method reaches the end of the list with\r\n\t\t// questions.\r\n\t\tif (counter < questions.size()) {\r\n\t\t\tnextQuestion = questions.get(counter).getQuestion();\r\n\t\t\t// Incrementing the counter with one, so next time the method is called it will\r\n\t\t\t// get the following question from the list.\r\n\t\t\tcounter++;\r\n\t\t}\r\n\t\t// When the end of the list is reached the next question will take this value.\r\n\t\telse {\r\n\t\t\tnextQuestion = \"You completed the test!\";\r\n\t\t}\r\n\t\treturn nextQuestion;\r\n\r\n\t}", "protected static Question getAskedQuestion(int currentUserId, Connection connection) throws ApplicationException {\n Question result = new Question();\n\n StringBuilder query = new StringBuilder(\"\");\n query.append(\"SELECT * FROM \" + TABLE);\n query.append(\" WHERE \" + COL_USER_ID);\n query.append(\"=\" + currentUserId);\n query.append(\" ORDER BY \" + COL_QUESTION_TIMESTAMP);\n query.append(\" DESC LIMIT 1; \");\n\n PreparedStatement statement = null;\n try {\n try {\n // set parameters and execute query\n statement = connection.prepareStatement(query.toString());\n\n ResultSet resultSet = statement.executeQuery();\n result = convertToInstance(resultSet);\n\n } finally {\n if (statement != null) {\n statement.close();\n }\n }\n } catch (SQLException e) {\n throw new ApplicationException(\"Failed to fetch\", e);\n }\n\n return result;\n }", "@Test\n\tpublic void testGetQuestionById() {\n\t\tQnaQuestion question = questionLogic.getQuestionById(tdp.question1_location1.getId());\n\t\tAssert.assertNotNull(question);\n\t\tAssert.assertEquals(question.getQuestionText(),tdp.question1_location1.getQuestionText());\n\t\tAssert.assertEquals(question.getId(), tdp.question1_location1.getId());\n\t}", "com.rpg.framework.database.Protocol.Quest getQuest(int index);", "@Override\r\n\tpublic AssesmentQuestion getByID(Integer id) {\r\n\r\n\t\tSession session = this.sessionFactory.getCurrentSession();\r\n\t\tTransaction trans = session.beginTransaction();\r\n\r\n\t\tAssesmentQuestion assesmentQuestion = null;\r\n\t\ttry {\r\n\t\t\tassesmentQuestion = (AssesmentQuestion) session.get(AssesmentQuestion.class, id);\r\n\t\t\t//trans.commit();\r\n\t\t\t\r\n\t\t} catch (HibernateException e) {\r\n\t\t\te.printStackTrace();\r\n\t\t} finally {\r\n\t\t\tsession.close();\r\n\t\t}\r\n\t\treturn assesmentQuestion;\r\n\t}", "public String getQuestionid() {\n return questionid;\n }", "public MovieQuestion getQuestion() {\n\t\tMovieQuestion newQ = new MovieQuestion();\n\t\tint row;\n\t\tCursor c;\n\t\tboolean okToAdd = false;\n\n\t\t// Pick random question\n\t\tswitch ((int)(Math.random()*9)) {\n\t\tcase 0: // Who directed the movie %s?\n\t\t\tc = mDb.rawQuery(\"SELECT * FROM movies\", null);\n\t\t\trow = (int)(Math.random()*c.getCount());\n\t\t\tc.moveToPosition(row);\n\t\t\tnewQ.question = String.format(QuestionTemplates.QUESTIONS[0], c.getString(1));\n\t\t\tnewQ.answers[0] = c.getString(3);\n\t\t\t\n\t\t\tLog.i(\"NewQuestion\", \"Correct:\" + c.getString(3));\n\t\t\t\n\t\t\t// Fill answers with unique wrong values\n\t\t\tfor(int i = 1; i < 4;) {\n\t\t\t\trow = (int)(Math.random()*c.getCount());\n\t\t\t\tc.moveToPosition(row);\n\t\t\t\tLog.i(\"NewQuestion\", \"Wrong:\" + c.getString(3));\n\t\t\t\t// i < 4, so we do not increment indefinitely.\n\t\t\t\tfor(int j = 0; j < i && i < 4; j++) {\n\t\t\t\t\tif(newQ.answers[j].equals(c.getString(3))) {\n\t\t\t\t\t\tokToAdd = false;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t\tokToAdd = true;\n\t\t\t\t}\n\t\t\t\tif(okToAdd)\n\t\t\t\t\tnewQ.answers[i++] = c.getString(3);\n\t\t\t}\n\t\t\tbreak;\n\t\tcase 1: // When was the movie %s released?\n\t\t\tc = mDb.rawQuery(\"SELECT * FROM movies\", null);\n\t\t\trow = (int)(Math.random()*c.getCount());\n\t\t\tc.moveToPosition(row);\n\t\t\tnewQ.question = String.format(QuestionTemplates.QUESTIONS[1], c.getString(1));\n\t\t\tnewQ.answers[0] = c.getString(2);\n\n\t\t\t// Fill answers with unique wrong values\n\t\t\tfor(int i = 1; i < 4;) {\n\t\t\t\tint wrongYear = Integer.parseInt(newQ.answers[0]) + (int)((Math.random()-.5)*50); // +/- [1-25] years\n\t\t\t\tif (wrongYear <= 2014 && wrongYear != Integer.parseInt(newQ.answers[0]))\n\t\t\t\t\tnewQ.answers[i++] = \"\" + wrongYear;\n\t\t\t}\n\t\t\tbreak;\n\t\tcase 2: // Which star was in the movie %s?\n\t\t\tc = mDb.rawQuery(\"SELECT DISTINCT m.`title`, m.`director`, s.`first_name`, s.`last_name` FROM `movies` m, `stars` s, `stars_in_movies` sm WHERE m.id = sm.movie_id AND s.id = sm.star_id AND s.id GROUP BY m.`id`, s.`first_name`, s.`last_name` ORDER BY RANDOM() LIMIT 4\", null);\n\t\t\trow = (int)(Math.random()*c.getCount());\n\t\t\tc.moveToFirst(); // only 4 results are returned.\n\t\t\tnewQ.question = String.format(QuestionTemplates.QUESTIONS[2], c.getString(0));\n\t\t\tnewQ.answers[0] = c.getString(2) +\" \"+ c.getString(3); \n\t\t\tnewQ.correctAnswerIndex = 0;\n\t\t\tfor (int j = 1; j < 4; j++) {\n\t\t\t\tc.moveToNext();\n\t\t\t\tnewQ.answers[j] = c.getString(2) +\" \"+ c.getString(3);\n\t\t\t}\n\t\t\tbreak;\n\t\tcase 3: // Which star was not in the movie %s?\n\t\t\t// The lone star, the left out one...the answer\n\t\t\tString singleActorQuery = \"SELECT mov.`title`, star.`first_name`, star.`last_name`, star.`id` FROM `movies` mov, `stars` star, \"+\n\t\t\t\t\t\"(SELECT movie_id, star_id FROM `stars_in_movies` GROUP BY movie_id HAVING COUNT(star_id) <= 1 ORDER BY RANDOM() LIMIT 1) mult \"+ \n\t\t\t\t\t\"WHERE mov.`id` = mult.`movie_id` AND star.`id`= mult.`star_id`\";\n\t\t\tc = mDb.rawQuery(singleActorQuery, null);\n\t\t\tc.moveToFirst();\n\t\t\tnewQ.correctAnswerIndex = 0;\n\t\t\tnewQ.answers[0] = c.getString(1) +\" \"+c.getString(2);\n\n\t\t\t// The cool kids: A group of actors in the same movie....excluding the lone star.\n//\t\t\tString starId = c.getString(3);\n\t\t\tString multipleActorQuery = \"SELECT mov.`title`, star.`first_name`, star.`last_name` \" +\n\t\t\t\t\t\"FROM `movies` mov, `stars` star, `stars_in_movies` sim, \" +\n\t\t\t\t\t\"(SELECT movie_id, star_id FROM `stars_in_movies` GROUP BY movie_id HAVING COUNT(star_id) > 2 ORDER BY RANDOM() LIMIT 1) mult\" +\n\t\t\t\t\t\" WHERE mov.`id` = mult.`movie_id` AND star.`id` = sim.`star_id` AND mult.`movie_id` = sim.`movie_id` \" +\n\t\t\t\t\t\"LIMIT 3\";\n\t\t\tc = mDb.rawQuery(multipleActorQuery, null);\n\t\t\tc.moveToFirst();\n\t\t\tnewQ.question = String.format(QuestionTemplates.QUESTIONS[3], c.getString(0));\n\t\t\tfor (int i = 1; i < 4; i++) {\n\t\t\t\tnewQ.answers[i] = c.getString(1) +\" \"+c.getString(2);\n\t\t\t\tc.moveToNext();\n\t\t\t}\n\n\t\t\tbreak;\n\t\tcase 4: // In which movie do the stars %s and %s appear together?\n\t\t\t// Get a movie they both star in\n\t\t\tc = mDb.rawQuery(\"SELECT m.`title`, s.`first_name`, s.`last_name`, s2.`first_name`, s2.`last_name`\" +\n\t\t\t\t\t\"FROM `movies` m, `stars` s, `stars` s2, `stars_in_movies` sm, `stars_in_movies` sm2 \" +\n\t\t\t\t\t\"WHERE m.id = sm.movie_id AND m.id = sm2.movie_id AND s.id = sm.star_id AND s2.id = sm2.star_id AND s.id != s2.id \" +\n\t\t\t\t\t\"GROUP BY m.`id`, s.`first_name`, s.`last_name` ORDER BY RANDOM() LIMIT 4\", null);\n\t\t\trow = (int)(Math.random()*c.getCount());\n\t\t\tc.moveToFirst();\n\t\t\tnewQ.question = String.format(QuestionTemplates.QUESTIONS[4], c.getString(1)+\" \"+c.getString(2), c.getString(3)+\" \"+c.getString(4));\n\t\t\tnewQ.answers[0] = c.getString(0); \n\t\t\tnewQ.correctAnswerIndex = 0;\n\t\t\tfor (int j = 1; j < 4; j++) {\n\t\t\t\tc.moveToNext();\n\t\t\t\tnewQ.answers[j] = c.getString(0);\n\t\t\t}\n\t\t\tbreak;\n\t\tcase 5: // Who directed the star %s?\n\t\t\tc = mDb.rawQuery(\"SELECT DISTINCT m.`year`, m.`director`, s.`first_name`, s.`last_name` FROM `movies` m, `stars` s, `stars_in_movies` sm WHERE m.id = sm.movie_id AND s.id = sm.star_id AND s.id GROUP BY m.`id`, s.`first_name`, s.`last_name` ORDER BY RANDOM() LIMIT 4\", null);\n\t\t\trow = (int)(Math.random()*c.getCount());\n\t\t\tc.moveToFirst(); // only 4 results are returned.\n\t\t\tnewQ.question = String.format(QuestionTemplates.QUESTIONS[5], c.getString(2) +\" \"+ c.getString(3));\n\t\t\tnewQ.answers[0] = c.getString(1); \n\t\t\tnewQ.correctAnswerIndex = 0;\n\t\t\tfor (int j = 1; j < 4; j++) {\n\t\t\t\tc.moveToNext();\n\t\t\t\tnewQ.answers[j] = c.getString(1);\n\t\t\t}\n\t\t\tbreak;\n\t\tcase 6: // Which star appears in both movies %s and %s?\n\t\t\t// Get the 2 movies with the same actor...\n\t\t\tc = mDb.rawQuery(\"SELECT mov.`id`, mov.`title`, star.`first_name`, star.`last_name`, star.`id` FROM `movies` mov, `stars_in_movies` sim, `stars` star, (SELECT movie_id, star_id, COUNT(movie_id) as cnt FROM `stars_in_movies` GROUP BY star_id HAVING COUNT(movie_id) > 3 ORDER BY RANDOM() LIMIT 1) as popular WHERE sim.`movie_id` = mov.`id` AND popular.`star_id` = sim.`star_id` AND star.`id` = sim.`star_id` LIMIT 2\", null);\n\t\t\tc.moveToFirst();\n\t\t\tString id = c.getString(4);\n\t\t\t\n\t\t\tString[] movies = new String[2];\n\t\t\tmovies[0] = c.getString(1);\n\t\t\tc.moveToNext();\n\t\t\tmovies[1] = c.getString(1);\n\t\t\t\n\t\t\tnewQ.question = String.format(QuestionTemplates.QUESTIONS[6], movies[0], movies[1]);\n\t\t\tnewQ.answers[0] = c.getString(2) +\" \"+ c.getString(3);\n\t\t\t\n\t\t\tnewQ.correctAnswerIndex = 0;\n\t\t\t\n\t\t\t// Pick 3 alternatives...\n\t\t\tc = mDb.rawQuery(\"SELECT s.first_name, s.last_name FROM stars s WHERE s.id != \"+id+\" GROUP BY s.id ORDER BY RANDOM() LIMIT 3\", null);\n\t\t\tc.moveToFirst();\n\t\t\tfor (int i = 1; i < 4; i++) {\n\t\t\t\tnewQ.answers[i] = c.getString(0) +\" \"+ c.getString(1);\n\t\t\t\tc.moveToNext();\n\t\t\t}\n\t\t\tbreak;\n\t\tcase 7: // Which star did not appear in the same movie with the star %s?\n\t\t\t// The lone star, the left out one...the answer\n\t\t\tString singleActorQueryII = \"SELECT mov.`title`, star.`first_name`, star.`last_name`, star.`id` FROM `movies` mov, `stars` star, \"+\n\t\t\t\t\t\"(SELECT movie_id, star_id FROM `stars_in_movies` GROUP BY movie_id HAVING COUNT(star_id) <= 1 ORDER BY RANDOM() LIMIT 1) mult \"+ \n\t\t\t\t\t\"WHERE mov.`id` = mult.`movie_id` AND star.`id`= mult.`star_id`\";\n\t\t\tc = mDb.rawQuery(singleActorQueryII, null);\n\t\t\tc.moveToFirst();\n\t\t\tnewQ.correctAnswerIndex = 0;\n\t\t\tnewQ.answers[0] = c.getString(1) +\" \"+c.getString(2);\n\n\t\t\t// The cool kids: A group of actors in the same movie....excluding the lone star.\n\t\t\tString multipleActorQueryII = \"SELECT mov.`title`, star.`first_name`, star.`last_name` \" +\n\t\t\t\t\t\"FROM `movies` mov, `stars` star, `stars_in_movies` sim, \" +\n\t\t\t\t\t\"(SELECT movie_id, star_id FROM `stars_in_movies` GROUP BY movie_id HAVING COUNT(star_id) > 3 ORDER BY RANDOM() LIMIT 1) mult\" +\n\t\t\t\t\t\" WHERE mov.`id` = mult.`movie_id` AND star.`id` = sim.`star_id` AND mult.`movie_id` = sim.`movie_id` \" +\n\t\t\t\t\t\" GROUP BY star.`id`\"+\n\t\t\t\t\t\" LIMIT 4\";\n\t\t\tc = mDb.rawQuery(multipleActorQueryII, null);\n\t\t\tc.moveToFirst();\n\t\t\t// Take the first of the group and put his name in the question\n\t\t\tnewQ.question = String.format(QuestionTemplates.QUESTIONS[7], c.getString(1) +\" \"+c.getString(2));\n\t\t\tc.moveToNext();\n\t\t\tfor (int i = 1; i < 4; i++) {\n\t\t\t\tnewQ.answers[i] = c.getString(1) +\" \"+c.getString(2);\n\t\t\t\tc.moveToNext();\n\t\t\t}\n\t\t\tbreak;\n\t\tdefault: // Who directed the star %s in year %s?\n\t\t\tc = mDb.rawQuery(\"SELECT DISTINCT m.`year`, m.`director`, s.`first_name`, s.`last_name` FROM `movies` m, `stars` s, `stars_in_movies` sm WHERE m.id = sm.movie_id AND s.id = sm.star_id AND s.id GROUP BY m.`id`, s.`first_name`, s.`last_name` ORDER BY RANDOM() LIMIT 4\", null);\n\t\t\trow = (int)(Math.random()*c.getCount());\n\t\t\tc.moveToFirst(); // only 4 results are returned.\n\t\t\tnewQ.question = String.format(QuestionTemplates.QUESTIONS[8], c.getString(2) +\" \"+ c.getString(3), c.getString(0));\n\t\t\tnewQ.answers[0] = c.getString(1); \n\t\t\tnewQ.correctAnswerIndex = 0;\n\t\t\tfor (int j = 1; j < 4; j++) {\n\t\t\t\tc.moveToNext();\n\t\t\t\tnewQ.answers[j] = c.getString(1);\n\t\t\t}\n\t\t\tbreak;\n\t\t}\n\n\t\treturn newQ;\n\t}", "public com.rpg.framework.database.Protocol.Quest getQuest(int index) {\n if (questBuilder_ == null) {\n return quest_.get(index);\n } else {\n return questBuilder_.getMessage(index);\n }\n }", "public int getQuestionId() {\n return questionId;\n }", "public DataRecord getQuestionRecord(String questionId)\r\n throws ProcessManagerException {\r\n Question question = getQuestion(questionId);\r\n return new QuestionRecord(question.getQuestionText());\r\n }", "public QueryQuestions saveQuestion(String question) {\n String uniqueId = UUID.randomUUID().toString();\n QueryQuestions queryQuestions1 = new QueryQuestions(uniqueId,question);\n QueryQuestions savedQueryQuestions = questionRepository.save(queryQuestions1);\n return savedQueryQuestions;\n }", "public Question findQuestion(String text) throws Exception {\n DataBaseBroker dbb = new DataBaseBroker();\n dbb.loadDriver();\n dbb.establishConnection();\n Question question = dbb.findQuestion(text);\n dbb.commit();\n dbb.closeConnection();\n return question;\n }", "public Question searchQuestion(BigInteger questId) throws UserException {\n\t\treturn null;\r\n\t}", "@GetMapping (\"/getOneAnswer\")\n @ResponseBody\n public Answer getOneAnswer(long id){\n Optional<Answer> oanswer = this.answerRepository.findById(id);\n if(oanswer.isPresent()){\n return oanswer.get();\n }\n return null;\n }", "public static synchronized QAQuestions fetchSingleQuestion(Context context,\n\t\t\tString tableName, int primaryKey) throws SQLException,\n\t\t\tNullPointerException {\n\n\t\tQADatabaseHelper dbHelper = QADatabaseHelper.getInstance(context);\n\t\tSQLiteDatabase db = dbHelper.getReadableDatabase();\n\n\t\tQAQuestions question = null;\n\n\t\tString query = QAConstants.FETCH_ALL + tableName + \" WHERE \"\n\t\t\t\t+ COLUMN_NAME_PRIMARY_KEY + \" = \" + primaryKey;\n\n\t\tCursor cursor = null;\n\t\ttry {\n\t\t\tcursor = db.rawQuery(query, null);\n\t\t} catch (Exception exception) {\n\t\t\texception.printStackTrace();\n\t\t}\n\t\tcursor.moveToFirst();\n\t\tif (cursor != null && cursor.getCount() > 0) {\n\t\t\tquestion = new QAQuestions();\n\t\t\tquestion.setPrimaryKey(cursor.getInt(cursor\n\t\t\t\t\t.getColumnIndex(COLUMN_NAME_PRIMARY_KEY)));\n\t\t\tquestion.setQuestion(cursor.getString(cursor\n\t\t\t\t\t.getColumnIndex(COLUMN_NAME_QUESTION)));\n\t\t\tquestion.setOptionOne(cursor.getString(cursor\n\t\t\t\t\t.getColumnIndex(COLUMN_NAME_OPTION1)));\n\t\t\tquestion.setOptionTwo(cursor.getString(cursor\n\t\t\t\t\t.getColumnIndex(COLUMN_NAME_OPTION2)));\n\t\t\tquestion.setOptionThree(cursor.getString(cursor\n\t\t\t\t\t.getColumnIndex(COLUMN_NAME_OPTION3)));\n\t\t\tquestion.setOptionFour(cursor.getString(cursor\n\t\t\t\t\t.getColumnIndex(COLUMN_NAME_OPTION4)));\n\t\t\tquestion.setAnswer(cursor.getString(cursor\n\t\t\t\t\t.getColumnIndex(COLUMN_NAME_ANSWER)));\n\t\t\tquestion.setUpdatedAt(cursor.getString(cursor\n\t\t\t\t\t.getColumnIndex(COLUMN_NAME_UPDATED_AT)));\n\t\t\tquestion.setFetched((cursor.getInt(cursor\n\t\t\t\t\t.getColumnIndex(COLUMN_NAME_IS_FETCHED)) == 1) ? true\n\t\t\t\t\t: false);\n\t\t}\n\t\tcursor.close();\n\t\treturn question;\n\t}", "public final Question question() throws RecognitionException {\r\n Question result = null;\r\n\r\n int question_StartIndex = input.index();\r\n\r\n Token Ident3=null;\r\n Token StringLiteral4=null;\r\n Type t =null;\r\n\r\n\r\n try {\r\n if ( state.backtracking>0 && alreadyParsedRule(input, 9) ) { return result; }\r\n\r\n // C:\\\\Users\\\\caytekin\\\\Documents\\\\GitHub\\\\sea-of-ql\\\\caytekin\\\\QLJava/src/org/uva/sea/ql/parser/antlr/QL.g:70:3: ( Ident ':' StringLiteral t= type )\r\n // C:\\\\Users\\\\caytekin\\\\Documents\\\\GitHub\\\\sea-of-ql\\\\caytekin\\\\QLJava/src/org/uva/sea/ql/parser/antlr/QL.g:70:5: Ident ':' StringLiteral t= type\r\n {\r\n Ident3=(Token)match(input,Ident,FOLLOW_Ident_in_question353); if (state.failed) return result;\r\n\r\n match(input,27,FOLLOW_27_in_question355); if (state.failed) return result;\r\n\r\n StringLiteral4=(Token)match(input,StringLiteral,FOLLOW_StringLiteral_in_question357); if (state.failed) return result;\r\n\r\n pushFollow(FOLLOW_type_in_question361);\r\n t=type();\r\n\r\n state._fsp--;\r\n if (state.failed) return result;\r\n\r\n if ( state.backtracking==0 ) { result = new Question((Ident3!=null?Ident3.getText():null), (StringLiteral4!=null?StringLiteral4.getText():null), t); }\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\r\n finally {\r\n \t// do for sure before leaving\r\n if ( state.backtracking>0 ) { memoize(input, 9, question_StartIndex); }\r\n\r\n }\r\n return result;\r\n }", "@Override\r\n\tpublic String toString() {\r\n\t\treturn question;\r\n\t}", "public final Question question() throws RecognitionException {\n Question result = null;\n\n int question_StartIndex = input.index();\n\n Token Ident7=null;\n Token StringLit8=null;\n Type type9 =null;\n\n\n try {\n if ( state.backtracking>0 && alreadyParsedRule(input, 5) ) { return result; }\n\n // /home/jahn/workspace1/QLAndroid/src/org/uva/sea/ql/parser/antlr/QL.g:77:3: ( Ident ':' StringLit type )\n // /home/jahn/workspace1/QLAndroid/src/org/uva/sea/ql/parser/antlr/QL.g:77:5: Ident ':' StringLit type\n {\n Ident7=(Token)match(input,Ident,FOLLOW_Ident_in_question203); if (state.failed) return result;\n\n match(input,24,FOLLOW_24_in_question205); if (state.failed) return result;\n\n StringLit8=(Token)match(input,StringLit,FOLLOW_StringLit_in_question207); if (state.failed) return result;\n\n pushFollow(FOLLOW_type_in_question209);\n type9=type();\n\n state._fsp--;\n if (state.failed) return result;\n\n if ( state.backtracking==0 ) {result =new Question(new Ident((Ident7!=null?Ident7.getText():null)),new StringLit((StringLit8!=null?StringLit8.getText():null)),type9);}\n\n }\n\n }\n catch (RecognitionException re) {\n reportError(re);\n recover(input,re);\n }\n\n finally {\n \t// do for sure before leaving\n if ( state.backtracking>0 ) { memoize(input, 5, question_StartIndex); }\n\n }\n return result;\n }", "public void setQuestion(String question) {\n this.question = question;\n }", "@Override\n public final GameQuestion getActiveQuestion() {\n return this.activeQuestion;\n }", "public Integer getQuestionId() {\n return questionId;\n }", "@GetMapping(\"/getquestion/{id}\")\n public ResponseEntity<List<Questions>> getQuestion(@PathVariable Long id) {\n\n List<Questions> q = this.userServices.getquetion(id);\n\n if (q.size() <= 0) {\n\n return ResponseEntity.status(HttpStatus.NOT_FOUND).build();\n\n }\n\n return ResponseEntity.status(HttpStatus.CREATED).body(q);\n\n }", "public List<Question> getQuestionbySid(int sid);", "public QnACatelogy getQnACatelogyByID(int iQnAID);", "public com.rpg.framework.database.Protocol.Quest getQuest(int index) {\n return quest_.get(index);\n }", "public Pregunta getPregunta(int id);", "public String getQuestion() {\n\t\treturn QAUTHOR + book.getTitle() + \"?\";\n\t}", "public QuestionModel getNextQuestion() {\n\t\tindex++;\n\t\treturn questionList.get(index % questionList.size());\n\t}", "public Question getQuestion() {\n if (QuestionNGram_Type.featOkTst && ((QuestionNGram_Type)jcasType).casFeat_question == null)\n jcasType.jcas.throwFeatMissing(\"question\", \"edu.cmu.deiis.types.QuestionNGram\");\n return (Question)(jcasType.ll_cas.ll_getFSForRef(jcasType.ll_cas.ll_getRefValue(addr, ((QuestionNGram_Type)jcasType).casFeatCode_question)));}", "public int getQuestionID() {\n return questionID;\n }", "java.lang.String getQ();", "public String generateQuestion(){\r\n qType = rand.nextInt(2);\r\n if (qType ==0)\r\n return \"Multiple choice question.\";\r\n else\r\n return \"Single choice question.\";\r\n }", "public List<Question> getQuestionsTopic(int tId){\r\n List<Question> questions = new ArrayList<>();\r\n String selectQuery = \"SELECT * FROM \" + TABLE_QUESTIONS + \" AS q INNER JOIN \" +\r\n TABLE_TOPICS_QUESTIONS + \" AS tq ON q.\" +\r\n KEY_ID + \" = tq.\" + KEY_QID +\r\n \" WHERE tq.\" + KEY_TID + \" = \" + tId + \" ORDER BY RANDOM()\";\r\n SQLiteDatabase db = this.getReadableDatabase();\r\n\r\n Cursor cursor = db.rawQuery(selectQuery, null);\r\n\r\n if(cursor.moveToFirst()){\r\n do{\r\n Question question = new Question();\r\n question.setId(cursor.getInt(cursor.getColumnIndex(KEY_QID)));\r\n question.setQuestion(cursor.getString(cursor.getColumnIndex(KEY_QUESTION)));\r\n question.setAnswer(cursor.getString(cursor.getColumnIndex(KEY_ANSWER)));\r\n question.setExplanation(cursor.getString(cursor.getColumnIndex(KEY_EXPLANATION)));\r\n question.setOptA(cursor.getString(cursor.getColumnIndex(KEY_OPT_A)));\r\n question.setOptB(cursor.getString(cursor.getColumnIndex(KEY_OPT_B)));\r\n question.setOptC(cursor.getString(cursor.getColumnIndex(KEY_OPT_C)));\r\n question.setOptD(cursor.getString(cursor.getColumnIndex(KEY_OPT_D)));\r\n\r\n questions.add(question);\r\n\r\n } while (cursor.moveToNext());\r\n }\r\n\r\n\r\n\r\n cursor.close();\r\n db.close();\r\n return questions;\r\n }" ]
[ "0.83676875", "0.8111332", "0.80574906", "0.76589656", "0.760205", "0.75892884", "0.7476621", "0.7421229", "0.73528457", "0.71517354", "0.705918", "0.6983351", "0.6974716", "0.68639624", "0.68374264", "0.6830063", "0.67843634", "0.67839426", "0.67749614", "0.67640704", "0.6750286", "0.6741409", "0.6722197", "0.6702504", "0.6674369", "0.66564214", "0.6649576", "0.66218287", "0.6621446", "0.6595458", "0.6592855", "0.6592855", "0.65588254", "0.6550496", "0.65001094", "0.64916545", "0.6490119", "0.6469378", "0.64331394", "0.6403652", "0.6398297", "0.6380535", "0.6349281", "0.63430905", "0.6327201", "0.63211435", "0.6315737", "0.6310918", "0.63100153", "0.62784404", "0.62766916", "0.6260566", "0.6260492", "0.6254598", "0.62534434", "0.6252944", "0.6247551", "0.62458664", "0.621042", "0.62095976", "0.6198647", "0.6163942", "0.61512464", "0.61408275", "0.6139356", "0.61237293", "0.61218065", "0.61132807", "0.6103233", "0.609863", "0.60962445", "0.6085941", "0.60831624", "0.60682243", "0.60604244", "0.605141", "0.6043044", "0.60352826", "0.6030424", "0.6020727", "0.6018131", "0.60173225", "0.6009445", "0.60008997", "0.5994063", "0.5992645", "0.5972666", "0.5939946", "0.5913928", "0.59122413", "0.58964014", "0.587918", "0.58718336", "0.5867329", "0.5861459", "0.58534473", "0.58525413", "0.58504826", "0.5848382", "0.58480924" ]
0.63535213
42
delete a single question
@DeleteMapping("/{quesId}") public void delete(@PathVariable("quesId") Long quesId) { this.questionService.deleteQuestion(quesId); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "void deleteQuestion(String questionId);", "public void deleteQuestion(int sid);", "public abstract void deleteQuestion();", "public void deleteQuestion(Question question) throws Exception {\n DataBaseBroker dbb = new DataBaseBroker();\n dbb.loadDriver();\n dbb.establishConnection();\n question.setDeleted(true);\n dbb.overwriteQuestion(question);\n dbb.commit();\n dbb.closeConnection();\n }", "@Delete\n void delete(WellbeingQuestion wellbeingQuestion);", "@Override\n public void delete(Question q) {\n try {\n c = DBConncetion.getConnection();\n String sql = \"Delete From mainquestion where id = ?\";\n PreparedStatement pstmt = c.prepareStatement(sql);\n pstmt.setString(1,String.valueOf(q.getId()));\n pstmt.executeUpdate();\n if (q.getType() == FillBlank) {\n pstmt = c.prepareStatement(\"Delete From fill_blank \\n\" +\n \"Where id = ? \");\n } else {\n pstmt = c.prepareStatement(\"Delete From multiplechoice \\n\" +\n \"Where id = ? \");\n }\n pstmt.setString(1,String.valueOf(q.getId()));\n pstmt.executeUpdate();\n } catch (Exception e) {\n throw new LoadSaveException(\"Delete: \" + e.getMessage());\n }\n }", "int deleteByPrimaryKey(String questionId);", "@Override\n public int DeleteQuestion(BigDecimal question_id) {\n return 0;\n }", "int deleteByExample(QuestionExample example);", "int deleteByExample(QuestionExample example);", "int deleteByExample(QuestionExample example);", "int deleteByExample(QuestionExample example);", "public void deleteSurvey(int sid);", "@Override\n\tpublic void deleteanswer(Integer id) throws Exception {\n\t\t\n\t}", "@Override\n\tpublic Questions deleteQuestion(BigInteger testId, BigInteger questionId) throws UserException {\n\t\treturn null;\n\t}", "@Override\n\tpublic Questions deleteQuestions(int testId, Questions question) throws TestMSException {\n\t\treturn null;\n\t}", "protected void deleteQuestionTx(QuestionImpl question)\n\t{\n\t\tStringBuilder sqlTitle = new StringBuilder();\n\t\tsqlTitle.append(\"DELETE FROM MNEME_QUESTION_TITLE\");\n\t\tsqlTitle.append(\" WHERE QUESTION_ID=?\");\n\n\t\tObject[] fields = new Object[1];\n\t\tfields[0] = Long.valueOf(question.getId());\n\n\t\tif (!this.sqlService.dbWrite(sqlTitle.toString(), fields))\n\t\t{\n\t\t\tthrow new RuntimeException(\"deleteQuestionTx MNEME_QUESTION_TITLE: db write failed\");\n\t\t}\n\t\t\n\t\tStringBuilder sql = new StringBuilder();\n\t\tsql.append(\"DELETE FROM MNEME_QUESTION\");\n\t\tsql.append(\" WHERE ID=?\");\n\n\t\tif (!this.sqlService.dbWrite(sql.toString(), fields))\n\t\t{\n\t\t\tthrow new RuntimeException(\"deleteQuestionTx: db write failed\");\n\t\t}\n\t}", "int deleteByExample(Question11Example example);", "int deleteByExample(Question27Example example);", "int deleteByExample(Question14Example example);", "int deleteByExample(CommonQuestionStrategyTypeExample example);", "void delete(Exam exam);", "public void deleteQuestion(Question a) {\n\n /*Checks to see if the question is found. */\n boolean found = false;\n\n //Searching for the correct question to delete\n for (int i = 0; i < quesCollec.size(); i++) {\n\n /* If the question name is the same as the question name in the array, then\n * we have found our question.\n */\n if (a.equals(quesCollec.get(i))) {\n quesCollec.remove(i);\n found = true;\n break;\n }\n }\n\n /* If Question not found, then print message. */\n if (!found) {\n System.out.println(\"Sorry Question Not Found\");\n }\n\n }", "public String deleteQuestion(final QuestionEntity existingQuestion) {\n entityManager.remove(existingQuestion);\n return existingQuestion.getUuid();\n }", "int deleteByPrimaryKey(CommonQuestionStrategyTypeKey key);", "@DeleteMapping(value=\"/delete/{questionId}\")\n\tpublic List<Question> removeQuestion(@PathVariable(\"questionId\") int id) throws QuestionException{\n\t\tquestionObj.deleteQuestionById(id);\n\t\tLOGGER.info(\"Removing Question by Id\");\n\t\treturn getAll();\n\t}", "void removePickDetail(Question question);", "public void deleteQuestion(ArrayList<Question> a) {\n\n for (int count = 0; count < a.size(); count++) {\n\n //Searching for the correct question to delete\n for (int i = 0; i < quesCollec.size(); i++) {\n\n /* If the question name is the same as the question name in the array, then\n * we have found our question.\n */\n if (a.get(count).equals(quesCollec.get(i))) {\n quesCollec.remove(i);\n break;\n }\n }\n }\n }", "@Override\n\tpublic void deleteQAPost(int qnum) {\n\t\tqaDao.deleteQAPost(qnum);\n\t}", "private void questionRemove(Player player, QueuedQuestion qq) {\r\n\t\tlong qqid = qq.getId();\r\n\t\t// dont allow master's first quesiton to be removed\r\n//\t\tif (player.getIsMaster() && \r\n//\t\t\t\tplayer.getGame().getRoundNumber() == 1 &&\r\n//\t\t\t\tplayer.getQueuedQuestions().size() == 1) {\r\n//\t\t\tlogger.error(\"Master tried to delete first question playerid=\"+player.getId());\r\n//\t\t\treturn;\r\n//\t\t}\r\n\t\t\t\r\n\t\tlogger.debug(\"Delete question id = \" + qqid);\r\n\t\tint i;\r\n\t\tfor (i = 0; i < player.getQueuedQuestions().size(); ++i)\r\n\t\t{\r\n\t\t\tif (qqid == player.getQueuedQuestions().get(i).getId()) {\r\n\t\t\t\tlogger.debug(\"Question found to remove = \" + qqid);\r\n\t\t\t\tplayer.getQueuedQuestions().remove(i);\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t}\r\n\t}", "@Override\r\n\tpublic void delete(Integer id) {\r\n\r\n\t\tSession session = this.sessionFactory.getCurrentSession();\r\n\t\tTransaction tx = session.beginTransaction();\r\n\t\ttry {\r\n\t\t\tAssesmentQuestion assesmentQuestion = (AssesmentQuestion) session.get(AssesmentQuestion.class, id);\r\n\t\t\tsession.delete(assesmentQuestion);\r\n\t\t\ttx.commit();\r\n\t\t} catch (HibernateException e) {\r\n\t\t\te.printStackTrace();\r\n\t\t}\r\n\r\n\t}", "void deleteChallengeById(int id);", "@Override\n\tpublic void deleteExam(ExamBean exam) {\n\t\t\n\t}", "void deleteChallenge();", "@Transactional(\"txManager\")\r\n\t@Override\r\n\tpublic void deleteQnA(int qnaNum) {\n\t\tCommentRepository.deleteComListByType(qnaNum, \"qna\");\r\n\t\tQnARepository.deleteQnA(qnaNum);\r\n\t}", "public void deleteOption() {\n try {\n this.database.delete(\"AnswerOptions\", \"optionId = \" + this.optionId);\n } catch (SQLException e) {\n // TODO Auto-generated catch block\n e.printStackTrace();\n }\n }", "@Test\n\tpublic void testRemoveQuestion() {\n\t\t// Test with invalid permissions\n\t\ttry {\n\t\t\texternalLogicStub.currentUserId = USER_NO_UPDATE;\n\t\t\tquestionLogic.removeQuestion(tdp.question1_location1.getId(), LOCATION1_ID);\n\t\t\tAssert.fail(\"Should have thrown exception\");\n\t\t} catch (SecurityException e) {\n\t\t\tAssert.assertNotNull(e);\n\t\t} catch (AttachmentException e) {\n\t\t\tAssert.fail(\"Should throw SecurityException\");\n\t\t}\n\n\t\t// Test with valid permission\n\t\ttry {\n\t\t\texternalLogicStub.currentUserId = USER_UPDATE;\n\t\t\tquestionLogic.removeQuestion(tdp.question1_location1.getId(), LOCATION1_ID);\n\t\t\tAssert.assertFalse(questionLogic.existsQuestion(tdp.question1_location1.getId()));\n\t\t} catch (SecurityException e) {\n\t\t\tAssert.fail(\"Should not have thrown exception\");\n\t\t} catch (AttachmentException e) {\n\t\t\tAssert.fail(\"Should not have thrown exception\");\n\t\t}\n\t\t\n\t\tAssert.assertNull(questionLogic.getQuestionById(tdp.question1_location1.getId()));\n\t}", "private void removeQuestion(){\n\t\tif(questionText != null){\n\t\t\tquestionBox.remove(questionText);\n\t\t\tquestionBox.reDraw();\n\t\t}\n\t}", "public void remove( IAnswer answerToRemove );", "public void deleteAnswerStatistics(int sid);", "public void delete(FaqPk pk) throws FaqDaoException;", "private void delete() {\n\n\t}", "public void delete( int nIdSuggestSubmit, Plugin plugin )\n {\n DAOUtil daoUtil = new DAOUtil( SQL_QUERY_DELETE, plugin );\n daoUtil.setInt( 1, nIdSuggestSubmit );\n daoUtil.executeUpdate( );\n daoUtil.free( );\n }", "public void setOkToDeleteQuestion(String string) {\r\n\t\t_okToDeleteQuestion = string;\r\n\t}", "public static boolean delete(Question entity) throws ApplicationException {\n boolean result = false;\n\n // entities which depend on entity must also be deleted TODO: if process\n // of entering a follow up question was canceled a nullpointer is\n // happening here\n if (entity.isHas_follow_up_question()) {\n Question followUp = QuestionDatabaseAccess.getFollowUpQuestion(entity);\n\n QuestionDatabaseAccess.delete(followUp);\n\n }\n\n Connection connection = null;\n try {\n connection = ConnectionPool.getConnection();\n result = QuestionDatabaseAccess.delete(entity, connection);\n\n } finally {\n ConnectionPool.releaseConnection(connection);\n }\n\n return result;\n }", "public boolean deleteQuestion(Question question, boolean isUndoOrRedo) throws StorageException {\n\t\ttry {\n\t\t\tcontentResolver.delete(LocalStorageContentProvider.QUESTION_URI, \"_id =\\\"\" + question.get_Id() + \"\\\"\",\n\t\t\t\t\tnull);\n\t\t} catch (Exception e) {\n\t\t\tthrow new StorageException();\n\t\t}\n\t\tif (!isUndoOrRedo) {\n\t\t\tthis.getQuestionDeletedList().add(question);\n\t\t}\n\t\treturn true;\n\t}", "public void delete() {\n\n\t}", "@Override\r\n\tpublic Exam deleteExam(int id)\r\n\t{\n\t\treturn null;\r\n\t}", "int deleteByExample(DiscussExample example);", "void delete(int commentId);", "public void delete();", "public void delete();", "public void delete();", "public void delete();", "public void delete();", "public void delete();", "@Override\n\t\tpublic void delete() {\n\n\t\t}", "public void myqnaDelete(int idx) {\n\t\tdao.myqnaDelete(idx);\r\n\t}", "@Override\n\tpublic void delete(Pessoa arg0) {\n\t\t\n\t}", "public void onClick(View v) {\n \t\ttry {\r\n\t\t\t\t\t\t\tSmilePlugServerManager spsm = new SmilePlugServerManager();\r\n String status = spsm.deleteQuestionInSessionByNumber(ip, context, currentQuestion);\r\n Toast.makeText(context, status, Toast.LENGTH_LONG).show();\r\n\t\t\t\t\t\t} catch (NetworkErrorException e) {\r\n\t\t\t\t\t\t\te.printStackTrace();\r\n Toast.makeText(context, \"Error deleting question, reason: \" + e.getMessage(), Toast.LENGTH_LONG).show();\r\n\t\t\t\t\t\t}\r\n \t\t\r\n \t\t\tconfirmDialog.dismiss();\r\n \t\t\tdetailsDialog.dismiss();\r\n \t\t\t\r\n \t\t\t// QuestionsManager.addDeletedQuestionInLocalFile(context, currentQuestion);\r\n\t\t\t\t\t}", "int deleteByExample(TResearchTeachExample example);", "private void delete() {\n\t\tComponents.questionDialog().message(\"Are you sure?\").callback(answeredYes -> {\n\n\t\t\t// if confirmed, delete the current product PropertyBox\n\t\t\tdatastore.delete(TARGET, viewForm.getValue());\n\t\t\t// Notify the user\n\t\t\tNotification.show(\"Product deleted\", Type.TRAY_NOTIFICATION);\n\n\t\t\t// navigate back\n\t\t\tViewNavigator.require().navigateBack();\n\n\t\t}).open();\n\t}", "int deleteByExample(trackcommentExample example);", "@Override\n public void edit(Question q) {\n delete(q);\n add(q);\n }", "public Question removeQuestion(BigInteger questId) throws UserException {\n\t\treturn null;\r\n\t}", "public void delete(){\r\n\r\n }", "void deleteRecipe(RecipeObject recipe);", "public void delete(int id);", "int deleteByExample(RepStuLearningExample example);", "public String deleteResearcher(int id);", "void deleteExam(Module module, Exam target);", "public void deleteEquipoComunidad(EquipoComunidad equipoComunidad);", "int deleteByExample(WstatTeachingClasshourTeacherExample example);", "public void deleteReply() {\n\r\n\t}", "@Override\r\n\tpublic void delete(int eno) {\n\r\n\t}", "void deleteMataKuliah (int id);", "int deleteByExample(CmsVoteTitleExample example);", "@Override\n\tpublic void delete() {\n\n\t}", "@Override\n\tpublic void delete() {\n\t\t// TODO Auto-generated method stub\n\t\t\n\t}", "@Override\n\tpublic void delete(int idFeedback) throws SQLException {\n\n\t\tPreparedStatement ps = conn.prepareStatement(\"DELETE FROM feedback\"\n\t\t\t\t+ \" WHERE id_feedback=?\");\n\t\tps.setInt(1, idFeedback);\n\t\tint n = ps.executeUpdate();\n\t\tif(n==0)\n\t\t\tthrow new SQLException(\"feedback \" + idFeedback+ \" non presente\");\n\t}", "@Override\n\tpublic void deleteOne(int rnum) throws Exception {\n\t\tsession.delete(\"ReplyMapper.deleteOne\",rnum);\n\t}", "@Override\n\tpublic void delete(Recipe entity) {\n\t\t\n\t}", "@Override\n public void delete(int id) {\n }", "@Override\r\n\tpublic void delete(TQssql sql) {\n\r\n\t}", "@Override\n\tpublic org.kisti.edison.virtuallaboratory.model.Survey deleteSurvey(\n\t\torg.kisti.edison.virtuallaboratory.model.Survey survey)\n\t\tthrows com.liferay.portal.kernel.exception.SystemException {\n\t\treturn _surveyLocalService.deleteSurvey(survey);\n\t}", "public void delete(MiscellaneousRecord a){\n\t\t\t\tAssert.isTrue(LoginService.hasRole(\"HANDYWORKER\"));\n\t\t\t\tUserAccount logged = LoginService.getPrincipal();\n\t\t\t\tfor (Curricula c : curriculaService.findAll()) {\n\t\t\t\t\tif (c.getMiscellaneousRecords().contains(a)\n\t\t\t\t\t\t\t&& c.getHandyWorker().getUserAccount().equals(logged)) {\n\t\t\t\t\t\tc.getMiscellaneousRecords().remove(a);\n\t\t\t\t\t\tcurriculaService.save(c);\n\t\t\t\t\t\tmiscellaneousRecordRepository.delete(a);\n\t\t\t\t\t\t//System.out.println(\"se borra el miscellaneousRecord\");\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}", "@Override\n\tpublic void delete(Translator entity) {\n\t\t\n\t}", "int deleteByExample(YqbdExample example);", "@Test\n public void deleteQuejaTest() {\n QuejaEntity entity = data.get(0);\n quejaPersistence.delete(entity.getId());\n QuejaEntity deleted = em.find(QuejaEntity.class, entity.getId());\n Assert.assertNull(deleted);\n }", "int deleteByExample(ComplainNoteDOExample example);", "int deleteByExample(TSubjectInfoExample example);", "@Override\r\n\tpublic int deleteOne(int idx) throws SQLException {\n\t\treturn 0;\r\n\t}", "@Override\r\n\tpublic void delete(int id) {\n\t\t\r\n\t}", "@Override\n\tpublic void delete(int id) {\n\t}", "@Override\n\tpublic void delete(Object entidade) {\n\t\t\n\t}", "@Override\n\tpublic void delete(int id) {\n\t\t\n\t}", "@Override\n\tpublic void delete(int id) {\n\t\t\n\t}", "@Override\n\tpublic void delete(int id) {\n\t\t\n\t}", "@Override\n\tpublic void delete(int id) {\n\t\t\n\t}", "private void deleteResource() {\n }" ]
[ "0.8765562", "0.8523122", "0.81044614", "0.7972788", "0.79545224", "0.7865521", "0.78381246", "0.7757859", "0.7632341", "0.7632341", "0.7632341", "0.7632341", "0.7552296", "0.75072896", "0.74671316", "0.74524367", "0.74274665", "0.7407109", "0.7336842", "0.7310079", "0.72917295", "0.72479105", "0.70969516", "0.6890719", "0.68851244", "0.687379", "0.6817611", "0.6803846", "0.6769046", "0.674629", "0.673499", "0.67301124", "0.6641088", "0.6603274", "0.65668076", "0.65451694", "0.65193796", "0.6483892", "0.64837897", "0.64672154", "0.64609355", "0.6431769", "0.64136076", "0.64127594", "0.641256", "0.639509", "0.63844895", "0.6377568", "0.6361126", "0.63407844", "0.63333553", "0.63333553", "0.63333553", "0.63333553", "0.63333553", "0.63333553", "0.6320901", "0.63208526", "0.63130873", "0.6312128", "0.6297499", "0.62859404", "0.6280863", "0.6259168", "0.62541133", "0.6241304", "0.624028", "0.62358266", "0.62347656", "0.6231468", "0.62125105", "0.62109494", "0.62052006", "0.6185254", "0.61852515", "0.61798936", "0.6177508", "0.6166235", "0.6161422", "0.6160364", "0.6158557", "0.61561745", "0.61542535", "0.61527085", "0.6150942", "0.61404145", "0.6133024", "0.6129261", "0.61279476", "0.6125867", "0.61258394", "0.6118581", "0.6118373", "0.6112934", "0.61061764", "0.6096184", "0.6096184", "0.6096184", "0.6096184", "0.6092809" ]
0.67097986
32
/ HashMap data = iMyPageService.getMEM(params); mav.addObject("data", data); System.out.println(data);
@RequestMapping(value = "/teamAdd") public ModelAndView teamAdd(@RequestParam HashMap<String, String> params, ModelAndView mav) throws Throwable { mav.setViewName("teamAdd/teamAdd"); return mav; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static Map<String,Object> getDataForPage(String pageUri, VitroRequest vreq, ServletContext context) throws InstantiationException, IllegalAccessException, ClassNotFoundException {\n Map<String, Object> page = vreq.getWebappDaoFactory().getPageDao().getPage(pageUri); \n \n Map<String,Object> data = new HashMap<String,Object>();\n List<PageDataGetter> dataGetters = getPageDataGetterObjects(vreq, pageUri);\n for(PageDataGetter getter: dataGetters) {\n try{\n Map<String,Object> moreData = null;\n moreData = getAdditionalData(pageUri, getter.getType(), page, vreq, getter, context);\n if( moreData != null)\n data.putAll(moreData);\n }catch(Throwable th){\n log.error(th,th);\n } \n }\n return data;\n }", "@Override\n\tprotected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {\n\t Map<String, Object> map = doService(req,resp);\n\t Gson gson = new Gson();\n\t\tString json = gson.toJson(map);\n\t\tSystem.out.println(\"返回的json数据--------------------->\"+json);\n\t\tresp.getWriter().write(json);\n\t}", "@Override\n\tprotected void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {\n\t\tMap<String, Object> map = doService(req,resp);\n\t\tGson gson = new Gson();\n\t\tString json = gson.toJson(map);\n\t\tSystem.out.println(\"返回的json数据--------------------->\"+json);\n\t\tresp.getWriter().write(json);\n\t}", "@Override\r\n\tpublic Map<String, Object> returnData(Map<String, Object> map,Model model, HttpServletRequest request) {\n\t\treturn null;\r\n\t}", "public abstract String fetchSnpData(HashMap<String,String> paramMap) throws RetrievalException;", "Map getSPEXDataMap();", "@RequestMapping(\"/query.do\")\n\tpublic @ResponseBody Map<String, Object> query(@RequestParam Map reqMap) {\nList<CpzProductLevelBean> cpzproductlevelBeans=null;\ntry {\ncpzproductlevelBeans=cpzProductLevelService.get(reqMap);\n} catch (Exception e) {\n\te.printStackTrace();\n}\nMap r=new HashMap();\nr.put(\"returnData\",cpzproductlevelBeans);\n\t return CommonUtil.ReturnWarp(Constant.TRAN_SUCCESS, Constant.ERRORTYPE,\"\",r);\n\t}", "Map getIDPSTDDataMap();", "@Override\n\tpublic String onData() {\n\t\tMap<String, Object> mapObj = new HashMap<String, Object>();\n\t\tfor (BasicNameValuePair pair : pairs) {\n\t\t\tmapObj.put(pair.getName(), pair.getValue());\n\t\t}\n\t\tGson gson = new Gson();\n\t\tString json = gson.toJson(mapObj);\n\t\treturn json;\n\t}", "public Map<String, Object> getInfo();", "@Override\n\t\t\tprotected Map<String, String> getParams() throws AuthFailureError {\n\t\t\t\tMap<String, String> map = new HashMap<String, String>();\n\n\t\t\t\t//map.put(\"address\", address);\n\t\t\t\tGson gson = new Gson();\n\t\t\t\tString json = gson.toJson(historybean,HistoryBean.class);\n\t\t\t\tmap.put(\"json\", json);\n\t\t\t\tLog.e(\"浏览历史记录\",\"成功\");\n\t\t\t\treturn map;\n\t\t\t}", "@Override\n\tprotected void generateParams(HashMap<String, String> map) {\n\t\tmap.put(\"vuid\", vUid);\n\t\tif(page>0)map.put(\"page\", \"\"+page);\n\t\tif(size>0)map.put(\"size\", \"\"+size);\n\t}", "fintech.HistoryResponse.Data getData();", "@Override\n\tpublic HashMap<String, Object> getData(Ee15 ee15) {\n\t\tPageHelper.offsetPage(ee15.getOffset(),ee15.getLimit()); \n\t\tList<Ee15> list=recruitDataEntryEe15Mapper.getListData(ee15);\n\t\tPageInfo<Ee15> pageinfo = new PageInfo<Ee15>(list);\n\t\treturn this.success_hashmap_response(pageinfo);\n\t}", "public SharedMemory infos();", "public Map<ERest,Object> list(String stPage){\n Map<ERest,Object> hm = new LinkedHashMap<>();\n List<Product> productList = new ArrayList<>();\n try {\n int page = Integer.parseInt(stPage);\n Pageable pageable = PageRequest.of(page-1,Util.pageSize);\n productList = pRepo.findByOrderByProIdAsc(pageable);\n hm.put(ERest.status,true);\n hm.put(ERest.message,(page) + \" sayfadaki ürün listeleme işlemi başarılı!\");\n hm.put(ERest.result,productList);\n } catch (Exception e) {\n String error = \"Listeleme sırasında bir hata oluştu!\" + e;\n hm.put(ERest.status,false);\n hm.put(ERest.message,error);\n Util.logger(error,Product.class);\n }\n return hm;\n }", "HashMap<String, Object[]> getUbicaciones();", "Map<String, ?> getOutputData();", "@Test\n public void doTest() throws Exception {\n CougarManager cougarManager1 = CougarManager.getInstance();\n HttpCallBean getNewHttpCallBean1 = cougarManager1.getNewHttpCallBean(\"87.248.113.14\");\n cougarManager1 = cougarManager1;\n \n getNewHttpCallBean1.setOperationName(\"simpleMapOperation\");\n \n getNewHttpCallBean1.setServiceName(\"baseline\", \"cougarBaseline\");\n \n getNewHttpCallBean1.setVersion(\"v2\");\n // Set the post body to contain a simple map with a large volume of entries\n Map map2 = new HashMap();\n map2.put(\"RESTJSON\",\"{\\\"message\\\":\\n {\\\"simpleMap\\\": {\\n\\\"1\\\": \\\"Value for 1\\\",\\n\\\"2\\\": \\\"Value for 2\\\",\\n\\\"3\\\": \\\"Value for 3\\\",\\n\\\"4\\\": \\\"Value for 4\\\",\\n\\\"5\\\": \\\"Value for 5\\\",\\n\\\"6\\\": \\\"Value for 6\\\",\\n\\\"7\\\": \\\"Value for 7\\\",\\n\\\"8\\\": \\\"Value for 8\\\",\\n\\\"9\\\": \\\"Value for 9\\\",\\n\\\"10\\\": \\\"Value for 10\\\",\\n\\\"11\\\": \\\"Value for 11\\\",\\n\\\"12\\\": \\\"Value for 12\\\",\\n\\\"13\\\": \\\"Value for 13\\\",\\n\\\"14\\\": \\\"Value for 14\\\",\\n\\\"15\\\": \\\"Value for 15\\\",\\n\\\"16\\\": \\\"Value for 16\\\",\\n\\\"17\\\": \\\"Value for 17\\\",\\n\\\"18\\\": \\\"Value for 18\\\",\\n\\\"19\\\": \\\"Value for 19\\\",\\n\\\"20\\\": \\\"Value for 20\\\",\\n\\\"21\\\": \\\"Value for 21\\\",\\n\\\"22\\\": \\\"Value for 22\\\",\\n\\\"23\\\": \\\"Value for 23\\\",\\n\\\"24\\\": \\\"Value for 24\\\",\\n\\\"25\\\": \\\"Value for 25\\\",\\n\\\"26\\\": \\\"Value for 26\\\",\\n\\\"27\\\": \\\"Value for 27\\\",\\n\\\"28\\\": \\\"Value for 28\\\",\\n\\\"29\\\": \\\"Value for 29\\\",\\n\\\"30\\\": \\\"Value for 30\\\",\\n\\\"31\\\": \\\"Value for 31\\\",\\n\\\"32\\\": \\\"Value for 32\\\",\\n\\\"33\\\": \\\"Value for 33\\\",\\n\\\"34\\\": \\\"Value for 34\\\",\\n\\\"35\\\": \\\"Value for 35\\\",\\n\\\"36\\\": \\\"Value for 36\\\",\\n\\\"37\\\": \\\"Value for 37\\\",\\n\\\"38\\\": \\\"Value for 38\\\",\\n\\\"39\\\": \\\"Value for 39\\\",\\n\\\"40\\\": \\\"Value for 40\\\",\\n\\\"41\\\": \\\"Value for 41\\\",\\n\\\"42\\\": \\\"Value for 42\\\",\\n\\\"43\\\": \\\"Value for 43\\\",\\n\\\"44\\\": \\\"Value for 44\\\",\\n\\\"45\\\": \\\"Value for 45\\\",\\n\\\"46\\\": \\\"Value for 46\\\",\\n\\\"47\\\": \\\"Value for 47\\\",\\n\\\"48\\\": \\\"Value for 48\\\",\\n\\\"49\\\": \\\"Value for 49\\\",\\n\\\"50\\\": \\\"Value for 50\\\",\\n\\\"51\\\": \\\"Value for 51\\\",\\n\\\"52\\\": \\\"Value for 52\\\",\\n\\\"53\\\": \\\"Value for 53\\\",\\n\\\"54\\\": \\\"Value for 54\\\",\\n\\\"55\\\": \\\"Value for 55\\\",\\n\\\"56\\\": \\\"Value for 56\\\",\\n\\\"57\\\": \\\"Value for 57\\\",\\n\\\"58\\\": \\\"Value for 58\\\",\\n\\\"59\\\": \\\"Value for 59\\\",\\n\\\"60\\\": \\\"Value for 60\\\",\\n\\\"61\\\": \\\"Value for 61\\\",\\n\\\"62\\\": \\\"Value for 62\\\",\\n\\\"63\\\": \\\"Value for 63\\\",\\n\\\"64\\\": \\\"Value for 64\\\",\\n\\\"65\\\": \\\"Value for 65\\\",\\n\\\"66\\\": \\\"Value for 66\\\",\\n\\\"67\\\": \\\"Value for 67\\\",\\n\\\"68\\\": \\\"Value for 68\\\",\\n\\\"69\\\": \\\"Value for 69\\\",\\n\\\"70\\\": \\\"Value for 70\\\",\\n\\\"71\\\": \\\"Value for 71\\\",\\n\\\"72\\\": \\\"Value for 72\\\",\\n\\\"73\\\": \\\"Value for 73\\\",\\n\\\"74\\\": \\\"Value for 74\\\",\\n\\\"75\\\": \\\"Value for 75\\\",\\n\\\"76\\\": \\\"Value for 76\\\",\\n\\\"77\\\": \\\"Value for 77\\\",\\n\\\"78\\\": \\\"Value for 78\\\",\\n\\\"79\\\": \\\"Value for 79\\\",\\n\\\"80\\\": \\\"Value for 80\\\",\\n\\\"81\\\": \\\"Value for 81\\\",\\n\\\"82\\\": \\\"Value for 82\\\",\\n\\\"83\\\": \\\"Value for 83\\\",\\n\\\"84\\\": \\\"Value for 84\\\",\\n\\\"85\\\": \\\"Value for 85\\\",\\n\\\"86\\\": \\\"Value for 86\\\",\\n\\\"87\\\": \\\"Value for 87\\\",\\n\\\"88\\\": \\\"Value for 88\\\",\\n\\\"89\\\": \\\"Value for 89\\\",\\n\\\"90\\\": \\\"Value for 90\\\",\\n\\\"91\\\": \\\"Value for 91\\\",\\n\\\"92\\\": \\\"Value for 92\\\",\\n\\\"93\\\": \\\"Value for 93\\\",\\n\\\"94\\\": \\\"Value for 94\\\",\\n\\\"95\\\": \\\"Value for 95\\\",\\n\\\"96\\\": \\\"Value for 96\\\",\\n\\\"97\\\": \\\"Value for 97\\\",\\n\\\"98\\\": \\\"Value for 98\\\",\\n\\\"99\\\": \\\"Value for 99\\\",\\n\\\"100\\\": \\\"Value for 100\\\",\\n\\\"101\\\": \\\"Value for 101\\\",\\n\\\"102\\\": \\\"Value for 102\\\",\\n\\\"103\\\": \\\"Value for 103\\\",\\n\\\"104\\\": \\\"Value for 104\\\",\\n\\\"105\\\": \\\"Value for 105\\\",\\n\\\"106\\\": \\\"Value for 106\\\",\\n\\\"107\\\": \\\"Value for 107\\\",\\n\\\"108\\\": \\\"Value for 108\\\",\\n\\\"109\\\": \\\"Value for 109\\\",\\n\\\"110\\\": \\\"Value for 110\\\",\\n\\\"111\\\": \\\"Value for 111\\\",\\n\\\"112\\\": \\\"Value for 112\\\",\\n\\\"113\\\": \\\"Value for 113\\\",\\n\\\"114\\\": \\\"Value for 114\\\",\\n\\\"115\\\": \\\"Value for 115\\\",\\n\\\"116\\\": \\\"Value for 116\\\",\\n\\\"117\\\": \\\"Value for 117\\\",\\n\\\"118\\\": \\\"Value for 118\\\",\\n\\\"119\\\": \\\"Value for 119\\\",\\n\\\"120\\\": \\\"Value for 120\\\",\\n\\\"121\\\": \\\"Value for 121\\\",\\n\\\"122\\\": \\\"Value for 122\\\",\\n\\\"123\\\": \\\"Value for 123\\\",\\n\\\"124\\\": \\\"Value for 124\\\",\\n\\\"125\\\": \\\"Value for 125\\\",\\n\\\"126\\\": \\\"Value for 126\\\",\\n\\\"127\\\": \\\"Value for 127\\\",\\n\\\"128\\\": \\\"Value for 128\\\",\\n\\\"129\\\": \\\"Value for 129\\\",\\n\\\"130\\\": \\\"Value for 130\\\",\\n\\\"131\\\": \\\"Value for 131\\\",\\n\\\"132\\\": \\\"Value for 132\\\",\\n\\\"133\\\": \\\"Value for 133\\\",\\n\\\"134\\\": \\\"Value for 134\\\",\\n\\\"135\\\": \\\"Value for 135\\\",\\n\\\"136\\\": \\\"Value for 136\\\",\\n\\\"137\\\": \\\"Value for 137\\\",\\n\\\"138\\\": \\\"Value for 138\\\",\\n\\\"139\\\": \\\"Value for 139\\\",\\n\\\"140\\\": \\\"Value for 140\\\",\\n\\\"141\\\": \\\"Value for 141\\\",\\n\\\"142\\\": \\\"Value for 142\\\",\\n\\\"143\\\": \\\"Value for 143\\\",\\n\\\"144\\\": \\\"Value for 144\\\",\\n\\\"145\\\": \\\"Value for 145\\\",\\n\\\"146\\\": \\\"Value for 146\\\",\\n\\\"147\\\": \\\"Value for 147\\\",\\n\\\"148\\\": \\\"Value for 148\\\",\\n\\\"149\\\": \\\"Value for 149\\\",\\n\\\"150\\\": \\\"Value for 150\\\",\\n\\\"151\\\": \\\"Value for 151\\\",\\n\\\"152\\\": \\\"Value for 152\\\",\\n\\\"153\\\": \\\"Value for 153\\\",\\n\\\"154\\\": \\\"Value for 154\\\",\\n\\\"155\\\": \\\"Value for 155\\\",\\n\\\"156\\\": \\\"Value for 156\\\",\\n\\\"157\\\": \\\"Value for 157\\\",\\n\\\"158\\\": \\\"Value for 158\\\",\\n\\\"159\\\": \\\"Value for 159\\\",\\n\\\"160\\\": \\\"Value for 160\\\",\\n\\\"161\\\": \\\"Value for 161\\\",\\n\\\"162\\\": \\\"Value for 162\\\",\\n\\\"163\\\": \\\"Value for 163\\\",\\n\\\"164\\\": \\\"Value for 164\\\",\\n\\\"165\\\": \\\"Value for 165\\\",\\n\\\"166\\\": \\\"Value for 166\\\",\\n\\\"167\\\": \\\"Value for 167\\\",\\n\\\"168\\\": \\\"Value for 168\\\",\\n\\\"169\\\": \\\"Value for 169\\\",\\n\\\"170\\\": \\\"Value for 170\\\",\\n\\\"171\\\": \\\"Value for 171\\\",\\n\\\"172\\\": \\\"Value for 172\\\",\\n\\\"173\\\": \\\"Value for 173\\\",\\n\\\"174\\\": \\\"Value for 174\\\",\\n\\\"175\\\": \\\"Value for 175\\\",\\n\\\"176\\\": \\\"Value for 176\\\",\\n\\\"177\\\": \\\"Value for 177\\\",\\n\\\"178\\\": \\\"Value for 178\\\",\\n\\\"179\\\": \\\"Value for 179\\\",\\n\\\"180\\\": \\\"Value for 180\\\",\\n\\\"181\\\": \\\"Value for 181\\\",\\n\\\"182\\\": \\\"Value for 182\\\",\\n\\\"183\\\": \\\"Value for 183\\\",\\n\\\"184\\\": \\\"Value for 184\\\",\\n\\\"185\\\": \\\"Value for 185\\\",\\n\\\"186\\\": \\\"Value for 186\\\",\\n\\\"187\\\": \\\"Value for 187\\\",\\n\\\"188\\\": \\\"Value for 188\\\",\\n\\\"189\\\": \\\"Value for 189\\\",\\n\\\"190\\\": \\\"Value for 190\\\",\\n\\\"191\\\": \\\"Value for 191\\\",\\n\\\"192\\\": \\\"Value for 192\\\",\\n\\\"193\\\": \\\"Value for 193\\\",\\n\\\"194\\\": \\\"Value for 194\\\",\\n\\\"195\\\": \\\"Value for 195\\\",\\n\\\"196\\\": \\\"Value for 196\\\",\\n\\\"197\\\": \\\"Value for 197\\\",\\n\\\"198\\\": \\\"Value for 198\\\",\\n\\\"199\\\": \\\"Value for 199\\\",\\n\\\"200\\\": \\\"Value for 200\\\",\\n\\\"201\\\": \\\"Value for 201\\\",\\n\\\"202\\\": \\\"Value for 202\\\",\\n\\\"203\\\": \\\"Value for 203\\\",\\n\\\"204\\\": \\\"Value for 204\\\",\\n\\\"205\\\": \\\"Value for 205\\\",\\n\\\"206\\\": \\\"Value for 206\\\",\\n\\\"207\\\": \\\"Value for 207\\\",\\n\\\"208\\\": \\\"Value for 208\\\",\\n\\\"209\\\": \\\"Value for 209\\\",\\n\\\"210\\\": \\\"Value for 210\\\",\\n\\\"211\\\": \\\"Value for 211\\\",\\n\\\"212\\\": \\\"Value for 212\\\",\\n\\\"213\\\": \\\"Value for 213\\\",\\n\\\"214\\\": \\\"Value for 214\\\",\\n\\\"215\\\": \\\"Value for 215\\\",\\n\\\"216\\\": \\\"Value for 216\\\",\\n\\\"217\\\": \\\"Value for 217\\\",\\n\\\"218\\\": \\\"Value for 218\\\",\\n\\\"219\\\": \\\"Value for 219\\\",\\n\\\"220\\\": \\\"Value for 220\\\",\\n\\\"221\\\": \\\"Value for 221\\\",\\n\\\"222\\\": \\\"Value for 222\\\",\\n\\\"223\\\": \\\"Value for 223\\\",\\n\\\"224\\\": \\\"Value for 224\\\",\\n\\\"225\\\": \\\"Value for 225\\\",\\n\\\"226\\\": \\\"Value for 226\\\",\\n\\\"227\\\": \\\"Value for 227\\\",\\n\\\"228\\\": \\\"Value for 228\\\",\\n\\\"229\\\": \\\"Value for 229\\\",\\n\\\"230\\\": \\\"Value for 230\\\",\\n\\\"231\\\": \\\"Value for 231\\\",\\n\\\"232\\\": \\\"Value for 232\\\",\\n\\\"233\\\": \\\"Value for 233\\\",\\n\\\"234\\\": \\\"Value for 234\\\",\\n\\\"235\\\": \\\"Value for 235\\\",\\n\\\"236\\\": \\\"Value for 236\\\",\\n\\\"237\\\": \\\"Value for 237\\\",\\n\\\"238\\\": \\\"Value for 238\\\",\\n\\\"239\\\": \\\"Value for 239\\\",\\n\\\"240\\\": \\\"Value for 240\\\",\\n\\\"241\\\": \\\"Value for 241\\\",\\n\\\"242\\\": \\\"Value for 242\\\",\\n\\\"243\\\": \\\"Value for 243\\\",\\n\\\"244\\\": \\\"Value for 244\\\",\\n\\\"245\\\": \\\"Value for 245\\\",\\n\\\"246\\\": \\\"Value for 246\\\",\\n\\\"247\\\": \\\"Value for 247\\\",\\n\\\"248\\\": \\\"Value for 248\\\",\\n\\\"249\\\": \\\"Value for 249\\\",\\n\\\"250\\\": \\\"Value for 250\\\",\\n\\\"251\\\": \\\"Value for 251\\\",\\n\\\"252\\\": \\\"Value for 252\\\",\\n\\\"253\\\": \\\"Value for 253\\\",\\n\\\"254\\\": \\\"Value for 254\\\",\\n\\\"255\\\": \\\"Value for 255\\\",\\n\\\"256\\\": \\\"Value for 256\\\",\\n\\\"257\\\": \\\"Value for 257\\\",\\n\\\"258\\\": \\\"Value for 258\\\",\\n\\\"259\\\": \\\"Value for 259\\\",\\n\\\"260\\\": \\\"Value for 260\\\",\\n\\\"261\\\": \\\"Value for 261\\\",\\n\\\"262\\\": \\\"Value for 262\\\",\\n\\\"263\\\": \\\"Value for 263\\\",\\n\\\"264\\\": \\\"Value for 264\\\",\\n\\\"265\\\": \\\"Value for 265\\\",\\n\\\"266\\\": \\\"Value for 266\\\",\\n\\\"267\\\": \\\"Value for 267\\\",\\n\\\"268\\\": \\\"Value for 268\\\",\\n\\\"269\\\": \\\"Value for 269\\\",\\n\\\"270\\\": \\\"Value for 270\\\",\\n\\\"271\\\": \\\"Value for 271\\\",\\n\\\"272\\\": \\\"Value for 272\\\",\\n\\\"273\\\": \\\"Value for 273\\\",\\n\\\"274\\\": \\\"Value for 274\\\",\\n\\\"275\\\": \\\"Value for 275\\\",\\n\\\"276\\\": \\\"Value for 276\\\",\\n\\\"277\\\": \\\"Value for 277\\\",\\n\\\"278\\\": \\\"Value for 278\\\",\\n\\\"279\\\": \\\"Value for 279\\\",\\n\\\"280\\\": \\\"Value for 280\\\",\\n\\\"281\\\": \\\"Value for 281\\\",\\n\\\"282\\\": \\\"Value for 282\\\",\\n\\\"283\\\": \\\"Value for 283\\\",\\n\\\"284\\\": \\\"Value for 284\\\",\\n\\\"285\\\": \\\"Value for 285\\\",\\n\\\"286\\\": \\\"Value for 286\\\",\\n\\\"287\\\": \\\"Value for 287\\\",\\n\\\"288\\\": \\\"Value for 288\\\",\\n\\\"289\\\": \\\"Value for 289\\\",\\n\\\"290\\\": \\\"Value for 290\\\",\\n\\\"291\\\": \\\"Value for 291\\\",\\n\\\"292\\\": \\\"Value for 292\\\",\\n\\\"293\\\": \\\"Value for 293\\\",\\n\\\"294\\\": \\\"Value for 294\\\",\\n\\\"295\\\": \\\"Value for 295\\\",\\n\\\"296\\\": \\\"Value for 296\\\",\\n\\\"297\\\": \\\"Value for 297\\\",\\n\\\"298\\\": \\\"Value for 298\\\",\\n\\\"299\\\": \\\"Value for 299\\\",\\n\\\"300\\\": \\\"Value for 300\\\",\\n\\\"301\\\": \\\"Value for 301\\\",\\n\\\"302\\\": \\\"Value for 302\\\",\\n\\\"303\\\": \\\"Value for 303\\\",\\n\\\"304\\\": \\\"Value for 304\\\",\\n\\\"305\\\": \\\"Value for 305\\\",\\n\\\"306\\\": \\\"Value for 306\\\",\\n\\\"307\\\": \\\"Value for 307\\\",\\n\\\"308\\\": \\\"Value for 308\\\",\\n\\\"309\\\": \\\"Value for 309\\\",\\n\\\"310\\\": \\\"Value for 310\\\",\\n\\\"311\\\": \\\"Value for 311\\\",\\n\\\"312\\\": \\\"Value for 312\\\",\\n\\\"313\\\": \\\"Value for 313\\\",\\n\\\"314\\\": \\\"Value for 314\\\",\\n\\\"315\\\": \\\"Value for 315\\\",\\n\\\"316\\\": \\\"Value for 316\\\",\\n\\\"317\\\": \\\"Value for 317\\\",\\n\\\"318\\\": \\\"Value for 318\\\",\\n\\\"319\\\": \\\"Value for 319\\\",\\n\\\"320\\\": \\\"Value for 320\\\",\\n\\\"321\\\": \\\"Value for 321\\\",\\n\\\"322\\\": \\\"Value for 322\\\",\\n\\\"323\\\": \\\"Value for 323\\\",\\n\\\"324\\\": \\\"Value for 324\\\",\\n\\\"325\\\": \\\"Value for 325\\\",\\n\\\"326\\\": \\\"Value for 326\\\",\\n\\\"327\\\": \\\"Value for 327\\\",\\n\\\"328\\\": \\\"Value for 328\\\",\\n\\\"329\\\": \\\"Value for 329\\\",\\n\\\"330\\\": \\\"Value for 330\\\",\\n\\\"331\\\": \\\"Value for 331\\\",\\n\\\"332\\\": \\\"Value for 332\\\",\\n\\\"333\\\": \\\"Value for 333\\\",\\n\\\"334\\\": \\\"Value for 334\\\",\\n\\\"335\\\": \\\"Value for 335\\\",\\n\\\"336\\\": \\\"Value for 336\\\",\\n\\\"337\\\": \\\"Value for 337\\\",\\n\\\"338\\\": \\\"Value for 338\\\",\\n\\\"339\\\": \\\"Value for 339\\\",\\n\\\"340\\\": \\\"Value for 340\\\",\\n\\\"341\\\": \\\"Value for 341\\\",\\n\\\"342\\\": \\\"Value for 342\\\",\\n\\\"343\\\": \\\"Value for 343\\\",\\n\\\"344\\\": \\\"Value for 344\\\",\\n\\\"345\\\": \\\"Value for 345\\\",\\n\\\"346\\\": \\\"Value for 346\\\",\\n\\\"347\\\": \\\"Value for 347\\\",\\n\\\"348\\\": \\\"Value for 348\\\",\\n\\\"349\\\": \\\"Value for 349\\\",\\n\\\"350\\\": \\\"Value for 350\\\",\\n\\\"351\\\": \\\"Value for 351\\\",\\n\\\"352\\\": \\\"Value for 352\\\",\\n\\\"353\\\": \\\"Value for 353\\\",\\n\\\"354\\\": \\\"Value for 354\\\",\\n\\\"355\\\": \\\"Value for 355\\\",\\n\\\"356\\\": \\\"Value for 356\\\",\\n\\\"357\\\": \\\"Value for 357\\\",\\n\\\"358\\\": \\\"Value for 358\\\",\\n\\\"359\\\": \\\"Value for 359\\\",\\n\\\"360\\\": \\\"Value for 360\\\",\\n\\\"361\\\": \\\"Value for 361\\\",\\n\\\"362\\\": \\\"Value for 362\\\",\\n\\\"363\\\": \\\"Value for 363\\\",\\n\\\"364\\\": \\\"Value for 364\\\",\\n\\\"365\\\": \\\"Value for 365\\\",\\n\\\"366\\\": \\\"Value for 366\\\",\\n\\\"367\\\": \\\"Value for 367\\\",\\n\\\"368\\\": \\\"Value for 368\\\",\\n\\\"369\\\": \\\"Value for 369\\\",\\n\\\"370\\\": \\\"Value for 370\\\",\\n\\\"371\\\": \\\"Value for 371\\\",\\n\\\"372\\\": \\\"Value for 372\\\",\\n\\\"373\\\": \\\"Value for 373\\\",\\n\\\"374\\\": \\\"Value for 374\\\",\\n\\\"375\\\": \\\"Value for 375\\\",\\n\\\"376\\\": \\\"Value for 376\\\",\\n\\\"377\\\": \\\"Value for 377\\\",\\n\\\"378\\\": \\\"Value for 378\\\",\\n\\\"379\\\": \\\"Value for 379\\\",\\n\\\"380\\\": \\\"Value for 380\\\",\\n\\\"381\\\": \\\"Value for 381\\\",\\n\\\"382\\\": \\\"Value for 382\\\",\\n\\\"383\\\": \\\"Value for 383\\\",\\n\\\"384\\\": \\\"Value for 384\\\",\\n\\\"385\\\": \\\"Value for 385\\\",\\n\\\"386\\\": \\\"Value for 386\\\",\\n\\\"387\\\": \\\"Value for 387\\\",\\n\\\"388\\\": \\\"Value for 388\\\",\\n\\\"389\\\": \\\"Value for 389\\\",\\n\\\"390\\\": \\\"Value for 390\\\",\\n\\\"391\\\": \\\"Value for 391\\\",\\n\\\"392\\\": \\\"Value for 392\\\",\\n\\\"393\\\": \\\"Value for 393\\\",\\n\\\"394\\\": \\\"Value for 394\\\",\\n\\\"395\\\": \\\"Value for 395\\\",\\n\\\"396\\\": \\\"Value for 396\\\",\\n\\\"397\\\": \\\"Value for 397\\\",\\n\\\"398\\\": \\\"Value for 398\\\",\\n\\\"399\\\": \\\"Value for 399\\\",\\n\\\"400\\\": \\\"Value for 400\\\",\\n\\\"401\\\": \\\"Value for 401\\\",\\n\\\"402\\\": \\\"Value for 402\\\",\\n\\\"403\\\": \\\"Value for 403\\\",\\n\\\"404\\\": \\\"Value for 404\\\",\\n\\\"405\\\": \\\"Value for 405\\\",\\n\\\"406\\\": \\\"Value for 406\\\",\\n\\\"407\\\": \\\"Value for 407\\\",\\n\\\"408\\\": \\\"Value for 408\\\",\\n\\\"409\\\": \\\"Value for 409\\\",\\n\\\"410\\\": \\\"Value for 410\\\",\\n\\\"411\\\": \\\"Value for 411\\\",\\n\\\"412\\\": \\\"Value for 412\\\",\\n\\\"413\\\": \\\"Value for 413\\\",\\n\\\"414\\\": \\\"Value for 414\\\",\\n\\\"415\\\": \\\"Value for 415\\\",\\n\\\"416\\\": \\\"Value for 416\\\",\\n\\\"417\\\": \\\"Value for 417\\\",\\n\\\"418\\\": \\\"Value for 418\\\",\\n\\\"419\\\": \\\"Value for 419\\\",\\n\\\"420\\\": \\\"Value for 420\\\",\\n\\\"421\\\": \\\"Value for 421\\\",\\n\\\"422\\\": \\\"Value for 422\\\",\\n\\\"423\\\": \\\"Value for 423\\\",\\n\\\"424\\\": \\\"Value for 424\\\",\\n\\\"425\\\": \\\"Value for 425\\\",\\n\\\"426\\\": \\\"Value for 426\\\",\\n\\\"427\\\": \\\"Value for 427\\\",\\n\\\"428\\\": \\\"Value for 428\\\",\\n\\\"429\\\": \\\"Value for 429\\\",\\n\\\"430\\\": \\\"Value for 430\\\",\\n\\\"431\\\": \\\"Value for 431\\\",\\n\\\"432\\\": \\\"Value for 432\\\",\\n\\\"433\\\": \\\"Value for 433\\\",\\n\\\"434\\\": \\\"Value for 434\\\",\\n\\\"435\\\": \\\"Value for 435\\\",\\n\\\"436\\\": \\\"Value for 436\\\",\\n\\\"437\\\": \\\"Value for 437\\\",\\n\\\"438\\\": \\\"Value for 438\\\",\\n\\\"439\\\": \\\"Value for 439\\\",\\n\\\"440\\\": \\\"Value for 440\\\",\\n\\\"441\\\": \\\"Value for 441\\\",\\n\\\"442\\\": \\\"Value for 442\\\",\\n\\\"443\\\": \\\"Value for 443\\\",\\n\\\"444\\\": \\\"Value for 444\\\",\\n\\\"445\\\": \\\"Value for 445\\\",\\n\\\"446\\\": \\\"Value for 446\\\",\\n\\\"447\\\": \\\"Value for 447\\\",\\n\\\"448\\\": \\\"Value for 448\\\",\\n\\\"449\\\": \\\"Value for 449\\\",\\n\\\"450\\\": \\\"Value for 450\\\",\\n\\\"451\\\": \\\"Value for 451\\\",\\n\\\"452\\\": \\\"Value for 452\\\",\\n\\\"453\\\": \\\"Value for 453\\\",\\n\\\"454\\\": \\\"Value for 454\\\",\\n\\\"455\\\": \\\"Value for 455\\\",\\n\\\"456\\\": \\\"Value for 456\\\",\\n\\\"457\\\": \\\"Value for 457\\\",\\n\\\"458\\\": \\\"Value for 458\\\",\\n\\\"459\\\": \\\"Value for 459\\\",\\n\\\"460\\\": \\\"Value for 460\\\",\\n\\\"461\\\": \\\"Value for 461\\\",\\n\\\"462\\\": \\\"Value for 462\\\",\\n\\\"463\\\": \\\"Value for 463\\\",\\n\\\"464\\\": \\\"Value for 464\\\",\\n\\\"465\\\": \\\"Value for 465\\\",\\n\\\"466\\\": \\\"Value for 466\\\",\\n\\\"467\\\": \\\"Value for 467\\\",\\n\\\"468\\\": \\\"Value for 468\\\",\\n\\\"469\\\": \\\"Value for 469\\\",\\n\\\"470\\\": \\\"Value for 470\\\",\\n\\\"471\\\": \\\"Value for 471\\\",\\n\\\"472\\\": \\\"Value for 472\\\",\\n\\\"473\\\": \\\"Value for 473\\\",\\n\\\"474\\\": \\\"Value for 474\\\",\\n\\\"475\\\": \\\"Value for 475\\\",\\n\\\"476\\\": \\\"Value for 476\\\",\\n\\\"477\\\": \\\"Value for 477\\\",\\n\\\"478\\\": \\\"Value for 478\\\",\\n\\\"479\\\": \\\"Value for 479\\\",\\n\\\"480\\\": \\\"Value for 480\\\",\\n\\\"481\\\": \\\"Value for 481\\\",\\n\\\"482\\\": \\\"Value for 482\\\",\\n\\\"483\\\": \\\"Value for 483\\\",\\n\\\"484\\\": \\\"Value for 484\\\",\\n\\\"485\\\": \\\"Value for 485\\\",\\n\\\"486\\\": \\\"Value for 486\\\",\\n\\\"487\\\": \\\"Value for 487\\\",\\n\\\"488\\\": \\\"Value for 488\\\",\\n\\\"489\\\": \\\"Value for 489\\\",\\n\\\"490\\\": \\\"Value for 490\\\",\\n\\\"491\\\": \\\"Value for 491\\\",\\n\\\"492\\\": \\\"Value for 492\\\",\\n\\\"493\\\": \\\"Value for 493\\\",\\n\\\"494\\\": \\\"Value for 494\\\",\\n\\\"495\\\": \\\"Value for 495\\\",\\n\\\"496\\\": \\\"Value for 496\\\",\\n\\\"497\\\": \\\"Value for 497\\\",\\n\\\"498\\\": \\\"Value for 498\\\",\\n\\\"499\\\": \\\"Value for 499\\\",\\n\\\"500\\\": \\\"Value for 500\\\"\\n}}}\");\n getNewHttpCallBean1.setPostQueryObjects(map2);\n // Get current time for getting log entries later\n\n Timestamp getTimeAsTimeStamp7 = new Timestamp(System.currentTimeMillis());\n // Make JSON call to the operation requesting an XML response\n cougarManager1.makeRestCougarHTTPCall(getNewHttpCallBean1, com.betfair.testing.utils.cougar.enums.CougarMessageProtocolRequestTypeEnum.RESTJSON, com.betfair.testing.utils.cougar.enums.CougarMessageContentTypeEnum.XML);\n // Make JSON call to the operation requesting a JSON response\n cougarManager1.makeRestCougarHTTPCall(getNewHttpCallBean1, com.betfair.testing.utils.cougar.enums.CougarMessageProtocolRequestTypeEnum.RESTJSON, com.betfair.testing.utils.cougar.enums.CougarMessageContentTypeEnum.JSON);\n // Create the expected response as an XML document\n XMLHelpers xMLHelpers4 = new XMLHelpers();\n Document createAsDocument10 = xMLHelpers4.getXMLObjectFromString(\"<SimpleMapOperationResponse><SimpleMapOperationResponseObject><responseMap><entry key=\\\"1\\\"><String>Value for 1</String></entry><entry key=\\\"10\\\"><String>Value for 10</String></entry><entry key=\\\"100\\\"><String>Value for 100</String></entry><entry key=\\\"101\\\"><String>Value for 101</String></entry><entry key=\\\"102\\\"><String>Value for 102</String></entry><entry key=\\\"103\\\"><String>Value for 103</String></entry><entry key=\\\"104\\\"><String>Value for 104</String></entry><entry key=\\\"105\\\"><String>Value for 105</String></entry><entry key=\\\"106\\\"><String>Value for 106</String></entry><entry key=\\\"107\\\"><String>Value for 107</String></entry><entry key=\\\"108\\\"><String>Value for 108</String></entry><entry key=\\\"109\\\"><String>Value for 109</String></entry><entry key=\\\"11\\\"><String>Value for 11</String></entry><entry key=\\\"110\\\"><String>Value for 110</String></entry><entry key=\\\"111\\\"><String>Value for 111</String></entry><entry key=\\\"112\\\"><String>Value for 112</String></entry><entry key=\\\"113\\\"><String>Value for 113</String></entry><entry key=\\\"114\\\"><String>Value for 114</String></entry><entry key=\\\"115\\\"><String>Value for 115</String></entry><entry key=\\\"116\\\"><String>Value for 116</String></entry><entry key=\\\"117\\\"><String>Value for 117</String></entry><entry key=\\\"118\\\"><String>Value for 118</String></entry><entry key=\\\"119\\\"><String>Value for 119</String></entry><entry key=\\\"12\\\"><String>Value for 12</String></entry><entry key=\\\"120\\\"><String>Value for 120</String></entry><entry key=\\\"121\\\"><String>Value for 121</String></entry><entry key=\\\"122\\\"><String>Value for 122</String></entry><entry key=\\\"123\\\"><String>Value for 123</String></entry><entry key=\\\"124\\\"><String>Value for 124</String></entry><entry key=\\\"125\\\"><String>Value for 125</String></entry><entry key=\\\"126\\\"><String>Value for 126</String></entry><entry key=\\\"127\\\"><String>Value for 127</String></entry><entry key=\\\"128\\\"><String>Value for 128</String></entry><entry key=\\\"129\\\"><String>Value for 129</String></entry><entry key=\\\"13\\\"><String>Value for 13</String></entry><entry key=\\\"130\\\"><String>Value for 130</String></entry><entry key=\\\"131\\\"><String>Value for 131</String></entry><entry key=\\\"132\\\"><String>Value for 132</String></entry><entry key=\\\"133\\\"><String>Value for 133</String></entry><entry key=\\\"134\\\"><String>Value for 134</String></entry><entry key=\\\"135\\\"><String>Value for 135</String></entry><entry key=\\\"136\\\"><String>Value for 136</String></entry><entry key=\\\"137\\\"><String>Value for 137</String></entry><entry key=\\\"138\\\"><String>Value for 138</String></entry><entry key=\\\"139\\\"><String>Value for 139</String></entry><entry key=\\\"14\\\"><String>Value for 14</String></entry><entry key=\\\"140\\\"><String>Value for 140</String></entry><entry key=\\\"141\\\"><String>Value for 141</String></entry><entry key=\\\"142\\\"><String>Value for 142</String></entry><entry key=\\\"143\\\"><String>Value for 143</String></entry><entry key=\\\"144\\\"><String>Value for 144</String></entry><entry key=\\\"145\\\"><String>Value for 145</String></entry><entry key=\\\"146\\\"><String>Value for 146</String></entry><entry key=\\\"147\\\"><String>Value for 147</String></entry><entry key=\\\"148\\\"><String>Value for 148</String></entry><entry key=\\\"149\\\"><String>Value for 149</String></entry><entry key=\\\"15\\\"><String>Value for 15</String></entry><entry key=\\\"150\\\"><String>Value for 150</String></entry><entry key=\\\"151\\\"><String>Value for 151</String></entry><entry key=\\\"152\\\"><String>Value for 152</String></entry><entry key=\\\"153\\\"><String>Value for 153</String></entry><entry key=\\\"154\\\"><String>Value for 154</String></entry><entry key=\\\"155\\\"><String>Value for 155</String></entry><entry key=\\\"156\\\"><String>Value for 156</String></entry><entry key=\\\"157\\\"><String>Value for 157</String></entry><entry key=\\\"158\\\"><String>Value for 158</String></entry><entry key=\\\"159\\\"><String>Value for 159</String></entry><entry key=\\\"16\\\"><String>Value for 16</String></entry><entry key=\\\"160\\\"><String>Value for 160</String></entry><entry key=\\\"161\\\"><String>Value for 161</String></entry><entry key=\\\"162\\\"><String>Value for 162</String></entry><entry key=\\\"163\\\"><String>Value for 163</String></entry><entry key=\\\"164\\\"><String>Value for 164</String></entry><entry key=\\\"165\\\"><String>Value for 165</String></entry><entry key=\\\"166\\\"><String>Value for 166</String></entry><entry key=\\\"167\\\"><String>Value for 167</String></entry><entry key=\\\"168\\\"><String>Value for 168</String></entry><entry key=\\\"169\\\"><String>Value for 169</String></entry><entry key=\\\"17\\\"><String>Value for 17</String></entry><entry key=\\\"170\\\"><String>Value for 170</String></entry><entry key=\\\"171\\\"><String>Value for 171</String></entry><entry key=\\\"172\\\"><String>Value for 172</String></entry><entry key=\\\"173\\\"><String>Value for 173</String></entry><entry key=\\\"174\\\"><String>Value for 174</String></entry><entry key=\\\"175\\\"><String>Value for 175</String></entry><entry key=\\\"176\\\"><String>Value for 176</String></entry><entry key=\\\"177\\\"><String>Value for 177</String></entry><entry key=\\\"178\\\"><String>Value for 178</String></entry><entry key=\\\"179\\\"><String>Value for 179</String></entry><entry key=\\\"18\\\"><String>Value for 18</String></entry><entry key=\\\"180\\\"><String>Value for 180</String></entry><entry key=\\\"181\\\"><String>Value for 181</String></entry><entry key=\\\"182\\\"><String>Value for 182</String></entry><entry key=\\\"183\\\"><String>Value for 183</String></entry><entry key=\\\"184\\\"><String>Value for 184</String></entry><entry key=\\\"185\\\"><String>Value for 185</String></entry><entry key=\\\"186\\\"><String>Value for 186</String></entry><entry key=\\\"187\\\"><String>Value for 187</String></entry><entry key=\\\"188\\\"><String>Value for 188</String></entry><entry key=\\\"189\\\"><String>Value for 189</String></entry><entry key=\\\"19\\\"><String>Value for 19</String></entry><entry key=\\\"190\\\"><String>Value for 190</String></entry><entry key=\\\"191\\\"><String>Value for 191</String></entry><entry key=\\\"192\\\"><String>Value for 192</String></entry><entry key=\\\"193\\\"><String>Value for 193</String></entry><entry key=\\\"194\\\"><String>Value for 194</String></entry><entry key=\\\"195\\\"><String>Value for 195</String></entry><entry key=\\\"196\\\"><String>Value for 196</String></entry><entry key=\\\"197\\\"><String>Value for 197</String></entry><entry key=\\\"198\\\"><String>Value for 198</String></entry><entry key=\\\"199\\\"><String>Value for 199</String></entry><entry key=\\\"2\\\"><String>Value for 2</String></entry><entry key=\\\"20\\\"><String>Value for 20</String></entry><entry key=\\\"200\\\"><String>Value for 200</String></entry><entry key=\\\"201\\\"><String>Value for 201</String></entry><entry key=\\\"202\\\"><String>Value for 202</String></entry><entry key=\\\"203\\\"><String>Value for 203</String></entry><entry key=\\\"204\\\"><String>Value for 204</String></entry><entry key=\\\"205\\\"><String>Value for 205</String></entry><entry key=\\\"206\\\"><String>Value for 206</String></entry><entry key=\\\"207\\\"><String>Value for 207</String></entry><entry key=\\\"208\\\"><String>Value for 208</String></entry><entry key=\\\"209\\\"><String>Value for 209</String></entry><entry key=\\\"21\\\"><String>Value for 21</String></entry><entry key=\\\"210\\\"><String>Value for 210</String></entry><entry key=\\\"211\\\"><String>Value for 211</String></entry><entry key=\\\"212\\\"><String>Value for 212</String></entry><entry key=\\\"213\\\"><String>Value for 213</String></entry><entry key=\\\"214\\\"><String>Value for 214</String></entry><entry key=\\\"215\\\"><String>Value for 215</String></entry><entry key=\\\"216\\\"><String>Value for 216</String></entry><entry key=\\\"217\\\"><String>Value for 217</String></entry><entry key=\\\"218\\\"><String>Value for 218</String></entry><entry key=\\\"219\\\"><String>Value for 219</String></entry><entry key=\\\"22\\\"><String>Value for 22</String></entry><entry key=\\\"220\\\"><String>Value for 220</String></entry><entry key=\\\"221\\\"><String>Value for 221</String></entry><entry key=\\\"222\\\"><String>Value for 222</String></entry><entry key=\\\"223\\\"><String>Value for 223</String></entry><entry key=\\\"224\\\"><String>Value for 224</String></entry><entry key=\\\"225\\\"><String>Value for 225</String></entry><entry key=\\\"226\\\"><String>Value for 226</String></entry><entry key=\\\"227\\\"><String>Value for 227</String></entry><entry key=\\\"228\\\"><String>Value for 228</String></entry><entry key=\\\"229\\\"><String>Value for 229</String></entry><entry key=\\\"23\\\"><String>Value for 23</String></entry><entry key=\\\"230\\\"><String>Value for 230</String></entry><entry key=\\\"231\\\"><String>Value for 231</String></entry><entry key=\\\"232\\\"><String>Value for 232</String></entry><entry key=\\\"233\\\"><String>Value for 233</String></entry><entry key=\\\"234\\\"><String>Value for 234</String></entry><entry key=\\\"235\\\"><String>Value for 235</String></entry><entry key=\\\"236\\\"><String>Value for 236</String></entry><entry key=\\\"237\\\"><String>Value for 237</String></entry><entry key=\\\"238\\\"><String>Value for 238</String></entry><entry key=\\\"239\\\"><String>Value for 239</String></entry><entry key=\\\"24\\\"><String>Value for 24</String></entry><entry key=\\\"240\\\"><String>Value for 240</String></entry><entry key=\\\"241\\\"><String>Value for 241</String></entry><entry key=\\\"242\\\"><String>Value for 242</String></entry><entry key=\\\"243\\\"><String>Value for 243</String></entry><entry key=\\\"244\\\"><String>Value for 244</String></entry><entry key=\\\"245\\\"><String>Value for 245</String></entry><entry key=\\\"246\\\"><String>Value for 246</String></entry><entry key=\\\"247\\\"><String>Value for 247</String></entry><entry key=\\\"248\\\"><String>Value for 248</String></entry><entry key=\\\"249\\\"><String>Value for 249</String></entry><entry key=\\\"25\\\"><String>Value for 25</String></entry><entry key=\\\"250\\\"><String>Value for 250</String></entry><entry key=\\\"251\\\"><String>Value for 251</String></entry><entry key=\\\"252\\\"><String>Value for 252</String></entry><entry key=\\\"253\\\"><String>Value for 253</String></entry><entry key=\\\"254\\\"><String>Value for 254</String></entry><entry key=\\\"255\\\"><String>Value for 255</String></entry><entry key=\\\"256\\\"><String>Value for 256</String></entry><entry key=\\\"257\\\"><String>Value for 257</String></entry><entry key=\\\"258\\\"><String>Value for 258</String></entry><entry key=\\\"259\\\"><String>Value for 259</String></entry><entry key=\\\"26\\\"><String>Value for 26</String></entry><entry key=\\\"260\\\"><String>Value for 260</String></entry><entry key=\\\"261\\\"><String>Value for 261</String></entry><entry key=\\\"262\\\"><String>Value for 262</String></entry><entry key=\\\"263\\\"><String>Value for 263</String></entry><entry key=\\\"264\\\"><String>Value for 264</String></entry><entry key=\\\"265\\\"><String>Value for 265</String></entry><entry key=\\\"266\\\"><String>Value for 266</String></entry><entry key=\\\"267\\\"><String>Value for 267</String></entry><entry key=\\\"268\\\"><String>Value for 268</String></entry><entry key=\\\"269\\\"><String>Value for 269</String></entry><entry key=\\\"27\\\"><String>Value for 27</String></entry><entry key=\\\"270\\\"><String>Value for 270</String></entry><entry key=\\\"271\\\"><String>Value for 271</String></entry><entry key=\\\"272\\\"><String>Value for 272</String></entry><entry key=\\\"273\\\"><String>Value for 273</String></entry><entry key=\\\"274\\\"><String>Value for 274</String></entry><entry key=\\\"275\\\"><String>Value for 275</String></entry><entry key=\\\"276\\\"><String>Value for 276</String></entry><entry key=\\\"277\\\"><String>Value for 277</String></entry><entry key=\\\"278\\\"><String>Value for 278</String></entry><entry key=\\\"279\\\"><String>Value for 279</String></entry><entry key=\\\"28\\\"><String>Value for 28</String></entry><entry key=\\\"280\\\"><String>Value for 280</String></entry><entry key=\\\"281\\\"><String>Value for 281</String></entry><entry key=\\\"282\\\"><String>Value for 282</String></entry><entry key=\\\"283\\\"><String>Value for 283</String></entry><entry key=\\\"284\\\"><String>Value for 284</String></entry><entry key=\\\"285\\\"><String>Value for 285</String></entry><entry key=\\\"286\\\"><String>Value for 286</String></entry><entry key=\\\"287\\\"><String>Value for 287</String></entry><entry key=\\\"288\\\"><String>Value for 288</String></entry><entry key=\\\"289\\\"><String>Value for 289</String></entry><entry key=\\\"29\\\"><String>Value for 29</String></entry><entry key=\\\"290\\\"><String>Value for 290</String></entry><entry key=\\\"291\\\"><String>Value for 291</String></entry><entry key=\\\"292\\\"><String>Value for 292</String></entry><entry key=\\\"293\\\"><String>Value for 293</String></entry><entry key=\\\"294\\\"><String>Value for 294</String></entry><entry key=\\\"295\\\"><String>Value for 295</String></entry><entry key=\\\"296\\\"><String>Value for 296</String></entry><entry key=\\\"297\\\"><String>Value for 297</String></entry><entry key=\\\"298\\\"><String>Value for 298</String></entry><entry key=\\\"299\\\"><String>Value for 299</String></entry><entry key=\\\"3\\\"><String>Value for 3</String></entry><entry key=\\\"30\\\"><String>Value for 30</String></entry><entry key=\\\"300\\\"><String>Value for 300</String></entry><entry key=\\\"301\\\"><String>Value for 301</String></entry><entry key=\\\"302\\\"><String>Value for 302</String></entry><entry key=\\\"303\\\"><String>Value for 303</String></entry><entry key=\\\"304\\\"><String>Value for 304</String></entry><entry key=\\\"305\\\"><String>Value for 305</String></entry><entry key=\\\"306\\\"><String>Value for 306</String></entry><entry key=\\\"307\\\"><String>Value for 307</String></entry><entry key=\\\"308\\\"><String>Value for 308</String></entry><entry key=\\\"309\\\"><String>Value for 309</String></entry><entry key=\\\"31\\\"><String>Value for 31</String></entry><entry key=\\\"310\\\"><String>Value for 310</String></entry><entry key=\\\"311\\\"><String>Value for 311</String></entry><entry key=\\\"312\\\"><String>Value for 312</String></entry><entry key=\\\"313\\\"><String>Value for 313</String></entry><entry key=\\\"314\\\"><String>Value for 314</String></entry><entry key=\\\"315\\\"><String>Value for 315</String></entry><entry key=\\\"316\\\"><String>Value for 316</String></entry><entry key=\\\"317\\\"><String>Value for 317</String></entry><entry key=\\\"318\\\"><String>Value for 318</String></entry><entry key=\\\"319\\\"><String>Value for 319</String></entry><entry key=\\\"32\\\"><String>Value for 32</String></entry><entry key=\\\"320\\\"><String>Value for 320</String></entry><entry key=\\\"321\\\"><String>Value for 321</String></entry><entry key=\\\"322\\\"><String>Value for 322</String></entry><entry key=\\\"323\\\"><String>Value for 323</String></entry><entry key=\\\"324\\\"><String>Value for 324</String></entry><entry key=\\\"325\\\"><String>Value for 325</String></entry><entry key=\\\"326\\\"><String>Value for 326</String></entry><entry key=\\\"327\\\"><String>Value for 327</String></entry><entry key=\\\"328\\\"><String>Value for 328</String></entry><entry key=\\\"329\\\"><String>Value for 329</String></entry><entry key=\\\"33\\\"><String>Value for 33</String></entry><entry key=\\\"330\\\"><String>Value for 330</String></entry><entry key=\\\"331\\\"><String>Value for 331</String></entry><entry key=\\\"332\\\"><String>Value for 332</String></entry><entry key=\\\"333\\\"><String>Value for 333</String></entry><entry key=\\\"334\\\"><String>Value for 334</String></entry><entry key=\\\"335\\\"><String>Value for 335</String></entry><entry key=\\\"336\\\"><String>Value for 336</String></entry><entry key=\\\"337\\\"><String>Value for 337</String></entry><entry key=\\\"338\\\"><String>Value for 338</String></entry><entry key=\\\"339\\\"><String>Value for 339</String></entry><entry key=\\\"34\\\"><String>Value for 34</String></entry><entry key=\\\"340\\\"><String>Value for 340</String></entry><entry key=\\\"341\\\"><String>Value for 341</String></entry><entry key=\\\"342\\\"><String>Value for 342</String></entry><entry key=\\\"343\\\"><String>Value for 343</String></entry><entry key=\\\"344\\\"><String>Value for 344</String></entry><entry key=\\\"345\\\"><String>Value for 345</String></entry><entry key=\\\"346\\\"><String>Value for 346</String></entry><entry key=\\\"347\\\"><String>Value for 347</String></entry><entry key=\\\"348\\\"><String>Value for 348</String></entry><entry key=\\\"349\\\"><String>Value for 349</String></entry><entry key=\\\"35\\\"><String>Value for 35</String></entry><entry key=\\\"350\\\"><String>Value for 350</String></entry><entry key=\\\"351\\\"><String>Value for 351</String></entry><entry key=\\\"352\\\"><String>Value for 352</String></entry><entry key=\\\"353\\\"><String>Value for 353</String></entry><entry key=\\\"354\\\"><String>Value for 354</String></entry><entry key=\\\"355\\\"><String>Value for 355</String></entry><entry key=\\\"356\\\"><String>Value for 356</String></entry><entry key=\\\"357\\\"><String>Value for 357</String></entry><entry key=\\\"358\\\"><String>Value for 358</String></entry><entry key=\\\"359\\\"><String>Value for 359</String></entry><entry key=\\\"36\\\"><String>Value for 36</String></entry><entry key=\\\"360\\\"><String>Value for 360</String></entry><entry key=\\\"361\\\"><String>Value for 361</String></entry><entry key=\\\"362\\\"><String>Value for 362</String></entry><entry key=\\\"363\\\"><String>Value for 363</String></entry><entry key=\\\"364\\\"><String>Value for 364</String></entry><entry key=\\\"365\\\"><String>Value for 365</String></entry><entry key=\\\"366\\\"><String>Value for 366</String></entry><entry key=\\\"367\\\"><String>Value for 367</String></entry><entry key=\\\"368\\\"><String>Value for 368</String></entry><entry key=\\\"369\\\"><String>Value for 369</String></entry><entry key=\\\"37\\\"><String>Value for 37</String></entry><entry key=\\\"370\\\"><String>Value for 370</String></entry><entry key=\\\"371\\\"><String>Value for 371</String></entry><entry key=\\\"372\\\"><String>Value for 372</String></entry><entry key=\\\"373\\\"><String>Value for 373</String></entry><entry key=\\\"374\\\"><String>Value for 374</String></entry><entry key=\\\"375\\\"><String>Value for 375</String></entry><entry key=\\\"376\\\"><String>Value for 376</String></entry><entry key=\\\"377\\\"><String>Value for 377</String></entry><entry key=\\\"378\\\"><String>Value for 378</String></entry><entry key=\\\"379\\\"><String>Value for 379</String></entry><entry key=\\\"38\\\"><String>Value for 38</String></entry><entry key=\\\"380\\\"><String>Value for 380</String></entry><entry key=\\\"381\\\"><String>Value for 381</String></entry><entry key=\\\"382\\\"><String>Value for 382</String></entry><entry key=\\\"383\\\"><String>Value for 383</String></entry><entry key=\\\"384\\\"><String>Value for 384</String></entry><entry key=\\\"385\\\"><String>Value for 385</String></entry><entry key=\\\"386\\\"><String>Value for 386</String></entry><entry key=\\\"387\\\"><String>Value for 387</String></entry><entry key=\\\"388\\\"><String>Value for 388</String></entry><entry key=\\\"389\\\"><String>Value for 389</String></entry><entry key=\\\"39\\\"><String>Value for 39</String></entry><entry key=\\\"390\\\"><String>Value for 390</String></entry><entry key=\\\"391\\\"><String>Value for 391</String></entry><entry key=\\\"392\\\"><String>Value for 392</String></entry><entry key=\\\"393\\\"><String>Value for 393</String></entry><entry key=\\\"394\\\"><String>Value for 394</String></entry><entry key=\\\"395\\\"><String>Value for 395</String></entry><entry key=\\\"396\\\"><String>Value for 396</String></entry><entry key=\\\"397\\\"><String>Value for 397</String></entry><entry key=\\\"398\\\"><String>Value for 398</String></entry><entry key=\\\"399\\\"><String>Value for 399</String></entry><entry key=\\\"4\\\"><String>Value for 4</String></entry><entry key=\\\"40\\\"><String>Value for 40</String></entry><entry key=\\\"400\\\"><String>Value for 400</String></entry><entry key=\\\"401\\\"><String>Value for 401</String></entry><entry key=\\\"402\\\"><String>Value for 402</String></entry><entry key=\\\"403\\\"><String>Value for 403</String></entry><entry key=\\\"404\\\"><String>Value for 404</String></entry><entry key=\\\"405\\\"><String>Value for 405</String></entry><entry key=\\\"406\\\"><String>Value for 406</String></entry><entry key=\\\"407\\\"><String>Value for 407</String></entry><entry key=\\\"408\\\"><String>Value for 408</String></entry><entry key=\\\"409\\\"><String>Value for 409</String></entry><entry key=\\\"41\\\"><String>Value for 41</String></entry><entry key=\\\"410\\\"><String>Value for 410</String></entry><entry key=\\\"411\\\"><String>Value for 411</String></entry><entry key=\\\"412\\\"><String>Value for 412</String></entry><entry key=\\\"413\\\"><String>Value for 413</String></entry><entry key=\\\"414\\\"><String>Value for 414</String></entry><entry key=\\\"415\\\"><String>Value for 415</String></entry><entry key=\\\"416\\\"><String>Value for 416</String></entry><entry key=\\\"417\\\"><String>Value for 417</String></entry><entry key=\\\"418\\\"><String>Value for 418</String></entry><entry key=\\\"419\\\"><String>Value for 419</String></entry><entry key=\\\"42\\\"><String>Value for 42</String></entry><entry key=\\\"420\\\"><String>Value for 420</String></entry><entry key=\\\"421\\\"><String>Value for 421</String></entry><entry key=\\\"422\\\"><String>Value for 422</String></entry><entry key=\\\"423\\\"><String>Value for 423</String></entry><entry key=\\\"424\\\"><String>Value for 424</String></entry><entry key=\\\"425\\\"><String>Value for 425</String></entry><entry key=\\\"426\\\"><String>Value for 426</String></entry><entry key=\\\"427\\\"><String>Value for 427</String></entry><entry key=\\\"428\\\"><String>Value for 428</String></entry><entry key=\\\"429\\\"><String>Value for 429</String></entry><entry key=\\\"43\\\"><String>Value for 43</String></entry><entry key=\\\"430\\\"><String>Value for 430</String></entry><entry key=\\\"431\\\"><String>Value for 431</String></entry><entry key=\\\"432\\\"><String>Value for 432</String></entry><entry key=\\\"433\\\"><String>Value for 433</String></entry><entry key=\\\"434\\\"><String>Value for 434</String></entry><entry key=\\\"435\\\"><String>Value for 435</String></entry><entry key=\\\"436\\\"><String>Value for 436</String></entry><entry key=\\\"437\\\"><String>Value for 437</String></entry><entry key=\\\"438\\\"><String>Value for 438</String></entry><entry key=\\\"439\\\"><String>Value for 439</String></entry><entry key=\\\"44\\\"><String>Value for 44</String></entry><entry key=\\\"440\\\"><String>Value for 440</String></entry><entry key=\\\"441\\\"><String>Value for 441</String></entry><entry key=\\\"442\\\"><String>Value for 442</String></entry><entry key=\\\"443\\\"><String>Value for 443</String></entry><entry key=\\\"444\\\"><String>Value for 444</String></entry><entry key=\\\"445\\\"><String>Value for 445</String></entry><entry key=\\\"446\\\"><String>Value for 446</String></entry><entry key=\\\"447\\\"><String>Value for 447</String></entry><entry key=\\\"448\\\"><String>Value for 448</String></entry><entry key=\\\"449\\\"><String>Value for 449</String></entry><entry key=\\\"45\\\"><String>Value for 45</String></entry><entry key=\\\"450\\\"><String>Value for 450</String></entry><entry key=\\\"451\\\"><String>Value for 451</String></entry><entry key=\\\"452\\\"><String>Value for 452</String></entry><entry key=\\\"453\\\"><String>Value for 453</String></entry><entry key=\\\"454\\\"><String>Value for 454</String></entry><entry key=\\\"455\\\"><String>Value for 455</String></entry><entry key=\\\"456\\\"><String>Value for 456</String></entry><entry key=\\\"457\\\"><String>Value for 457</String></entry><entry key=\\\"458\\\"><String>Value for 458</String></entry><entry key=\\\"459\\\"><String>Value for 459</String></entry><entry key=\\\"46\\\"><String>Value for 46</String></entry><entry key=\\\"460\\\"><String>Value for 460</String></entry><entry key=\\\"461\\\"><String>Value for 461</String></entry><entry key=\\\"462\\\"><String>Value for 462</String></entry><entry key=\\\"463\\\"><String>Value for 463</String></entry><entry key=\\\"464\\\"><String>Value for 464</String></entry><entry key=\\\"465\\\"><String>Value for 465</String></entry><entry key=\\\"466\\\"><String>Value for 466</String></entry><entry key=\\\"467\\\"><String>Value for 467</String></entry><entry key=\\\"468\\\"><String>Value for 468</String></entry><entry key=\\\"469\\\"><String>Value for 469</String></entry><entry key=\\\"47\\\"><String>Value for 47</String></entry><entry key=\\\"470\\\"><String>Value for 470</String></entry><entry key=\\\"471\\\"><String>Value for 471</String></entry><entry key=\\\"472\\\"><String>Value for 472</String></entry><entry key=\\\"473\\\"><String>Value for 473</String></entry><entry key=\\\"474\\\"><String>Value for 474</String></entry><entry key=\\\"475\\\"><String>Value for 475</String></entry><entry key=\\\"476\\\"><String>Value for 476</String></entry><entry key=\\\"477\\\"><String>Value for 477</String></entry><entry key=\\\"478\\\"><String>Value for 478</String></entry><entry key=\\\"479\\\"><String>Value for 479</String></entry><entry key=\\\"48\\\"><String>Value for 48</String></entry><entry key=\\\"480\\\"><String>Value for 480</String></entry><entry key=\\\"481\\\"><String>Value for 481</String></entry><entry key=\\\"482\\\"><String>Value for 482</String></entry><entry key=\\\"483\\\"><String>Value for 483</String></entry><entry key=\\\"484\\\"><String>Value for 484</String></entry><entry key=\\\"485\\\"><String>Value for 485</String></entry><entry key=\\\"486\\\"><String>Value for 486</String></entry><entry key=\\\"487\\\"><String>Value for 487</String></entry><entry key=\\\"488\\\"><String>Value for 488</String></entry><entry key=\\\"489\\\"><String>Value for 489</String></entry><entry key=\\\"49\\\"><String>Value for 49</String></entry><entry key=\\\"490\\\"><String>Value for 490</String></entry><entry key=\\\"491\\\"><String>Value for 491</String></entry><entry key=\\\"492\\\"><String>Value for 492</String></entry><entry key=\\\"493\\\"><String>Value for 493</String></entry><entry key=\\\"494\\\"><String>Value for 494</String></entry><entry key=\\\"495\\\"><String>Value for 495</String></entry><entry key=\\\"496\\\"><String>Value for 496</String></entry><entry key=\\\"497\\\"><String>Value for 497</String></entry><entry key=\\\"498\\\"><String>Value for 498</String></entry><entry key=\\\"499\\\"><String>Value for 499</String></entry><entry key=\\\"5\\\"><String>Value for 5</String></entry><entry key=\\\"50\\\"><String>Value for 50</String></entry><entry key=\\\"500\\\"><String>Value for 500</String></entry><entry key=\\\"51\\\"><String>Value for 51</String></entry><entry key=\\\"52\\\"><String>Value for 52</String></entry><entry key=\\\"53\\\"><String>Value for 53</String></entry><entry key=\\\"54\\\"><String>Value for 54</String></entry><entry key=\\\"55\\\"><String>Value for 55</String></entry><entry key=\\\"56\\\"><String>Value for 56</String></entry><entry key=\\\"57\\\"><String>Value for 57</String></entry><entry key=\\\"58\\\"><String>Value for 58</String></entry><entry key=\\\"59\\\"><String>Value for 59</String></entry><entry key=\\\"6\\\"><String>Value for 6</String></entry><entry key=\\\"60\\\"><String>Value for 60</String></entry><entry key=\\\"61\\\"><String>Value for 61</String></entry><entry key=\\\"62\\\"><String>Value for 62</String></entry><entry key=\\\"63\\\"><String>Value for 63</String></entry><entry key=\\\"64\\\"><String>Value for 64</String></entry><entry key=\\\"65\\\"><String>Value for 65</String></entry><entry key=\\\"66\\\"><String>Value for 66</String></entry><entry key=\\\"67\\\"><String>Value for 67</String></entry><entry key=\\\"68\\\"><String>Value for 68</String></entry><entry key=\\\"69\\\"><String>Value for 69</String></entry><entry key=\\\"7\\\"><String>Value for 7</String></entry><entry key=\\\"70\\\"><String>Value for 70</String></entry><entry key=\\\"71\\\"><String>Value for 71</String></entry><entry key=\\\"72\\\"><String>Value for 72</String></entry><entry key=\\\"73\\\"><String>Value for 73</String></entry><entry key=\\\"74\\\"><String>Value for 74</String></entry><entry key=\\\"75\\\"><String>Value for 75</String></entry><entry key=\\\"76\\\"><String>Value for 76</String></entry><entry key=\\\"77\\\"><String>Value for 77</String></entry><entry key=\\\"78\\\"><String>Value for 78</String></entry><entry key=\\\"79\\\"><String>Value for 79</String></entry><entry key=\\\"8\\\"><String>Value for 8</String></entry><entry key=\\\"80\\\"><String>Value for 80</String></entry><entry key=\\\"81\\\"><String>Value for 81</String></entry><entry key=\\\"82\\\"><String>Value for 82</String></entry><entry key=\\\"83\\\"><String>Value for 83</String></entry><entry key=\\\"84\\\"><String>Value for 84</String></entry><entry key=\\\"85\\\"><String>Value for 85</String></entry><entry key=\\\"86\\\"><String>Value for 86</String></entry><entry key=\\\"87\\\"><String>Value for 87</String></entry><entry key=\\\"88\\\"><String>Value for 88</String></entry><entry key=\\\"89\\\"><String>Value for 89</String></entry><entry key=\\\"9\\\"><String>Value for 9</String></entry><entry key=\\\"90\\\"><String>Value for 90</String></entry><entry key=\\\"91\\\"><String>Value for 91</String></entry><entry key=\\\"92\\\"><String>Value for 92</String></entry><entry key=\\\"93\\\"><String>Value for 93</String></entry><entry key=\\\"94\\\"><String>Value for 94</String></entry><entry key=\\\"95\\\"><String>Value for 95</String></entry><entry key=\\\"96\\\"><String>Value for 96</String></entry><entry key=\\\"97\\\"><String>Value for 97</String></entry><entry key=\\\"98\\\"><String>Value for 98</String></entry><entry key=\\\"99\\\"><String>Value for 99</String></entry></responseMap></SimpleMapOperationResponseObject></SimpleMapOperationResponse>\");\n // Create the expected response as a JSON object\n JSONHelpers jSONHelpers5 = new JSONHelpers();\n JSONObject createAsJSONObject11 = jSONHelpers5.createAsJSONObject(new JSONObject(\"{\\\"responseMap\\\": {\\\"1\\\": \\\"Value for 1\\\",\\\"2\\\": \\\"Value for 2\\\",\\\"3\\\": \\\"Value for 3\\\",\\\"4\\\": \\\"Value for 4\\\",\\\"5\\\": \\\"Value for 5\\\",\\\"6\\\": \\\"Value for 6\\\",\\\"7\\\": \\\"Value for 7\\\",\\\"8\\\": \\\"Value for 8\\\",\\\"9\\\": \\\"Value for 9\\\",\\\"10\\\": \\\"Value for 10\\\",\\\"11\\\": \\\"Value for 11\\\",\\\"12\\\": \\\"Value for 12\\\",\\\"13\\\": \\\"Value for 13\\\",\\\"14\\\": \\\"Value for 14\\\",\\\"15\\\": \\\"Value for 15\\\",\\\"16\\\": \\\"Value for 16\\\",\\\"17\\\": \\\"Value for 17\\\",\\\"18\\\": \\\"Value for 18\\\",\\\"19\\\": \\\"Value for 19\\\",\\\"20\\\": \\\"Value for 20\\\",\\\"21\\\": \\\"Value for 21\\\",\\\"22\\\": \\\"Value for 22\\\",\\\"23\\\": \\\"Value for 23\\\",\\\"24\\\": \\\"Value for 24\\\",\\\"25\\\": \\\"Value for 25\\\",\\\"26\\\": \\\"Value for 26\\\",\\\"27\\\": \\\"Value for 27\\\",\\\"28\\\": \\\"Value for 28\\\",\\\"29\\\": \\\"Value for 29\\\",\\\"30\\\": \\\"Value for 30\\\",\\\"31\\\": \\\"Value for 31\\\",\\\"32\\\": \\\"Value for 32\\\",\\\"33\\\": \\\"Value for 33\\\",\\\"34\\\": \\\"Value for 34\\\",\\\"35\\\": \\\"Value for 35\\\",\\\"36\\\": \\\"Value for 36\\\",\\\"37\\\": \\\"Value for 37\\\",\\\"38\\\": \\\"Value for 38\\\",\\\"39\\\": \\\"Value for 39\\\",\\\"40\\\": \\\"Value for 40\\\",\\\"41\\\": \\\"Value for 41\\\",\\\"42\\\": \\\"Value for 42\\\",\\\"43\\\": \\\"Value for 43\\\",\\\"44\\\": \\\"Value for 44\\\",\\\"45\\\": \\\"Value for 45\\\",\\\"46\\\": \\\"Value for 46\\\",\\\"47\\\": \\\"Value for 47\\\",\\\"48\\\": \\\"Value for 48\\\",\\\"49\\\": \\\"Value for 49\\\",\\\"50\\\": \\\"Value for 50\\\",\\\"51\\\": \\\"Value for 51\\\",\\\"52\\\": \\\"Value for 52\\\",\\\"53\\\": \\\"Value for 53\\\",\\\"54\\\": \\\"Value for 54\\\",\\\"55\\\": \\\"Value for 55\\\",\\\"56\\\": \\\"Value for 56\\\",\\\"57\\\": \\\"Value for 57\\\",\\\"58\\\": \\\"Value for 58\\\",\\\"59\\\": \\\"Value for 59\\\",\\\"60\\\": \\\"Value for 60\\\",\\\"61\\\": \\\"Value for 61\\\",\\\"62\\\": \\\"Value for 62\\\",\\\"63\\\": \\\"Value for 63\\\",\\\"64\\\": \\\"Value for 64\\\",\\\"65\\\": \\\"Value for 65\\\",\\\"66\\\": \\\"Value for 66\\\",\\\"67\\\": \\\"Value for 67\\\",\\\"68\\\": \\\"Value for 68\\\",\\\"69\\\": \\\"Value for 69\\\",\\\"70\\\": \\\"Value for 70\\\",\\\"71\\\": \\\"Value for 71\\\",\\\"72\\\": \\\"Value for 72\\\",\\\"73\\\": \\\"Value for 73\\\",\\\"74\\\": \\\"Value for 74\\\",\\\"75\\\": \\\"Value for 75\\\",\\\"76\\\": \\\"Value for 76\\\",\\\"77\\\": \\\"Value for 77\\\",\\\"78\\\": \\\"Value for 78\\\",\\\"79\\\": \\\"Value for 79\\\",\\\"80\\\": \\\"Value for 80\\\",\\\"81\\\": \\\"Value for 81\\\",\\\"82\\\": \\\"Value for 82\\\",\\\"83\\\": \\\"Value for 83\\\",\\\"84\\\": \\\"Value for 84\\\",\\\"85\\\": \\\"Value for 85\\\",\\\"86\\\": \\\"Value for 86\\\",\\\"87\\\": \\\"Value for 87\\\",\\\"88\\\": \\\"Value for 88\\\",\\\"89\\\": \\\"Value for 89\\\",\\\"90\\\": \\\"Value for 90\\\",\\\"91\\\": \\\"Value for 91\\\",\\\"92\\\": \\\"Value for 92\\\",\\\"93\\\": \\\"Value for 93\\\",\\\"94\\\": \\\"Value for 94\\\",\\\"95\\\": \\\"Value for 95\\\",\\\"96\\\": \\\"Value for 96\\\",\\\"97\\\": \\\"Value for 97\\\",\\\"98\\\": \\\"Value for 98\\\",\\\"99\\\": \\\"Value for 99\\\",\\\"100\\\": \\\"Value for 100\\\",\\\"101\\\": \\\"Value for 101\\\",\\\"102\\\": \\\"Value for 102\\\",\\\"103\\\": \\\"Value for 103\\\",\\\"104\\\": \\\"Value for 104\\\",\\\"105\\\": \\\"Value for 105\\\",\\\"106\\\": \\\"Value for 106\\\",\\\"107\\\": \\\"Value for 107\\\",\\\"108\\\": \\\"Value for 108\\\",\\\"109\\\": \\\"Value for 109\\\",\\\"110\\\": \\\"Value for 110\\\",\\\"111\\\": \\\"Value for 111\\\",\\\"112\\\": \\\"Value for 112\\\",\\\"113\\\": \\\"Value for 113\\\",\\\"114\\\": \\\"Value for 114\\\",\\\"115\\\": \\\"Value for 115\\\",\\\"116\\\": \\\"Value for 116\\\",\\\"117\\\": \\\"Value for 117\\\",\\\"118\\\": \\\"Value for 118\\\",\\\"119\\\": \\\"Value for 119\\\",\\\"120\\\": \\\"Value for 120\\\",\\\"121\\\": \\\"Value for 121\\\",\\\"122\\\": \\\"Value for 122\\\",\\\"123\\\": \\\"Value for 123\\\",\\\"124\\\": \\\"Value for 124\\\",\\\"125\\\": \\\"Value for 125\\\",\\\"126\\\": \\\"Value for 126\\\",\\\"127\\\": \\\"Value for 127\\\",\\\"128\\\": \\\"Value for 128\\\",\\\"129\\\": \\\"Value for 129\\\",\\\"130\\\": \\\"Value for 130\\\",\\\"131\\\": \\\"Value for 131\\\",\\\"132\\\": \\\"Value for 132\\\",\\\"133\\\": \\\"Value for 133\\\",\\\"134\\\": \\\"Value for 134\\\",\\\"135\\\": \\\"Value for 135\\\",\\\"136\\\": \\\"Value for 136\\\",\\\"137\\\": \\\"Value for 137\\\",\\\"138\\\": \\\"Value for 138\\\",\\\"139\\\": \\\"Value for 139\\\",\\\"140\\\": \\\"Value for 140\\\",\\\"141\\\": \\\"Value for 141\\\",\\\"142\\\": \\\"Value for 142\\\",\\\"143\\\": \\\"Value for 143\\\",\\\"144\\\": \\\"Value for 144\\\",\\\"145\\\": \\\"Value for 145\\\",\\\"146\\\": \\\"Value for 146\\\",\\\"147\\\": \\\"Value for 147\\\",\\\"148\\\": \\\"Value for 148\\\",\\\"149\\\": \\\"Value for 149\\\",\\\"150\\\": \\\"Value for 150\\\",\\\"151\\\": \\\"Value for 151\\\",\\\"152\\\": \\\"Value for 152\\\",\\\"153\\\": \\\"Value for 153\\\",\\\"154\\\": \\\"Value for 154\\\",\\\"155\\\": \\\"Value for 155\\\",\\\"156\\\": \\\"Value for 156\\\",\\\"157\\\": \\\"Value for 157\\\",\\\"158\\\": \\\"Value for 158\\\",\\\"159\\\": \\\"Value for 159\\\",\\\"160\\\": \\\"Value for 160\\\",\\\"161\\\": \\\"Value for 161\\\",\\\"162\\\": \\\"Value for 162\\\",\\\"163\\\": \\\"Value for 163\\\",\\\"164\\\": \\\"Value for 164\\\",\\\"165\\\": \\\"Value for 165\\\",\\\"166\\\": \\\"Value for 166\\\",\\\"167\\\": \\\"Value for 167\\\",\\\"168\\\": \\\"Value for 168\\\",\\\"169\\\": \\\"Value for 169\\\",\\\"170\\\": \\\"Value for 170\\\",\\\"171\\\": \\\"Value for 171\\\",\\\"172\\\": \\\"Value for 172\\\",\\\"173\\\": \\\"Value for 173\\\",\\\"174\\\": \\\"Value for 174\\\",\\\"175\\\": \\\"Value for 175\\\",\\\"176\\\": \\\"Value for 176\\\",\\\"177\\\": \\\"Value for 177\\\",\\\"178\\\": \\\"Value for 178\\\",\\\"179\\\": \\\"Value for 179\\\",\\\"180\\\": \\\"Value for 180\\\",\\\"181\\\": \\\"Value for 181\\\",\\\"182\\\": \\\"Value for 182\\\",\\\"183\\\": \\\"Value for 183\\\",\\\"184\\\": \\\"Value for 184\\\",\\\"185\\\": \\\"Value for 185\\\",\\\"186\\\": \\\"Value for 186\\\",\\\"187\\\": \\\"Value for 187\\\",\\\"188\\\": \\\"Value for 188\\\",\\\"189\\\": \\\"Value for 189\\\",\\\"190\\\": \\\"Value for 190\\\",\\\"191\\\": \\\"Value for 191\\\",\\\"192\\\": \\\"Value for 192\\\",\\\"193\\\": \\\"Value for 193\\\",\\\"194\\\": \\\"Value for 194\\\",\\\"195\\\": \\\"Value for 195\\\",\\\"196\\\": \\\"Value for 196\\\",\\\"197\\\": \\\"Value for 197\\\",\\\"198\\\": \\\"Value for 198\\\",\\\"199\\\": \\\"Value for 199\\\",\\\"200\\\": \\\"Value for 200\\\",\\\"201\\\": \\\"Value for 201\\\",\\\"202\\\": \\\"Value for 202\\\",\\\"203\\\": \\\"Value for 203\\\",\\\"204\\\": \\\"Value for 204\\\",\\\"205\\\": \\\"Value for 205\\\",\\\"206\\\": \\\"Value for 206\\\",\\\"207\\\": \\\"Value for 207\\\",\\\"208\\\": \\\"Value for 208\\\",\\\"209\\\": \\\"Value for 209\\\",\\\"210\\\": \\\"Value for 210\\\",\\\"211\\\": \\\"Value for 211\\\",\\\"212\\\": \\\"Value for 212\\\",\\\"213\\\": \\\"Value for 213\\\",\\\"214\\\": \\\"Value for 214\\\",\\\"215\\\": \\\"Value for 215\\\",\\\"216\\\": \\\"Value for 216\\\",\\\"217\\\": \\\"Value for 217\\\",\\\"218\\\": \\\"Value for 218\\\",\\\"219\\\": \\\"Value for 219\\\",\\\"220\\\": \\\"Value for 220\\\",\\\"221\\\": \\\"Value for 221\\\",\\\"222\\\": \\\"Value for 222\\\",\\\"223\\\": \\\"Value for 223\\\",\\\"224\\\": \\\"Value for 224\\\",\\\"225\\\": \\\"Value for 225\\\",\\\"226\\\": \\\"Value for 226\\\",\\\"227\\\": \\\"Value for 227\\\",\\\"228\\\": \\\"Value for 228\\\",\\\"229\\\": \\\"Value for 229\\\",\\\"230\\\": \\\"Value for 230\\\",\\\"231\\\": \\\"Value for 231\\\",\\\"232\\\": \\\"Value for 232\\\",\\\"233\\\": \\\"Value for 233\\\",\\\"234\\\": \\\"Value for 234\\\",\\\"235\\\": \\\"Value for 235\\\",\\\"236\\\": \\\"Value for 236\\\",\\\"237\\\": \\\"Value for 237\\\",\\\"238\\\": \\\"Value for 238\\\",\\\"239\\\": \\\"Value for 239\\\",\\\"240\\\": \\\"Value for 240\\\",\\\"241\\\": \\\"Value for 241\\\",\\\"242\\\": \\\"Value for 242\\\",\\\"243\\\": \\\"Value for 243\\\",\\\"244\\\": \\\"Value for 244\\\",\\\"245\\\": \\\"Value for 245\\\",\\\"246\\\": \\\"Value for 246\\\",\\\"247\\\": \\\"Value for 247\\\",\\\"248\\\": \\\"Value for 248\\\",\\\"249\\\": \\\"Value for 249\\\",\\\"250\\\": \\\"Value for 250\\\",\\\"251\\\": \\\"Value for 251\\\",\\\"252\\\": \\\"Value for 252\\\",\\\"253\\\": \\\"Value for 253\\\",\\\"254\\\": \\\"Value for 254\\\",\\\"255\\\": \\\"Value for 255\\\",\\\"256\\\": \\\"Value for 256\\\",\\\"257\\\": \\\"Value for 257\\\",\\\"258\\\": \\\"Value for 258\\\",\\\"259\\\": \\\"Value for 259\\\",\\\"260\\\": \\\"Value for 260\\\",\\\"261\\\": \\\"Value for 261\\\",\\\"262\\\": \\\"Value for 262\\\",\\\"263\\\": \\\"Value for 263\\\",\\\"264\\\": \\\"Value for 264\\\",\\\"265\\\": \\\"Value for 265\\\",\\\"266\\\": \\\"Value for 266\\\",\\\"267\\\": \\\"Value for 267\\\",\\\"268\\\": \\\"Value for 268\\\",\\\"269\\\": \\\"Value for 269\\\",\\\"270\\\": \\\"Value for 270\\\",\\\"271\\\": \\\"Value for 271\\\",\\\"272\\\": \\\"Value for 272\\\",\\\"273\\\": \\\"Value for 273\\\",\\\"274\\\": \\\"Value for 274\\\",\\\"275\\\": \\\"Value for 275\\\",\\\"276\\\": \\\"Value for 276\\\",\\\"277\\\": \\\"Value for 277\\\",\\\"278\\\": \\\"Value for 278\\\",\\\"279\\\": \\\"Value for 279\\\",\\\"280\\\": \\\"Value for 280\\\",\\\"281\\\": \\\"Value for 281\\\",\\\"282\\\": \\\"Value for 282\\\",\\\"283\\\": \\\"Value for 283\\\",\\\"284\\\": \\\"Value for 284\\\",\\\"285\\\": \\\"Value for 285\\\",\\\"286\\\": \\\"Value for 286\\\",\\\"287\\\": \\\"Value for 287\\\",\\\"288\\\": \\\"Value for 288\\\",\\\"289\\\": \\\"Value for 289\\\",\\\"290\\\": \\\"Value for 290\\\",\\\"291\\\": \\\"Value for 291\\\",\\\"292\\\": \\\"Value for 292\\\",\\\"293\\\": \\\"Value for 293\\\",\\\"294\\\": \\\"Value for 294\\\",\\\"295\\\": \\\"Value for 295\\\",\\\"296\\\": \\\"Value for 296\\\",\\\"297\\\": \\\"Value for 297\\\",\\\"298\\\": \\\"Value for 298\\\",\\\"299\\\": \\\"Value for 299\\\",\\\"300\\\": \\\"Value for 300\\\",\\\"301\\\": \\\"Value for 301\\\",\\\"302\\\": \\\"Value for 302\\\",\\\"303\\\": \\\"Value for 303\\\",\\\"304\\\": \\\"Value for 304\\\",\\\"305\\\": \\\"Value for 305\\\",\\\"306\\\": \\\"Value for 306\\\",\\\"307\\\": \\\"Value for 307\\\",\\\"308\\\": \\\"Value for 308\\\",\\\"309\\\": \\\"Value for 309\\\",\\\"310\\\": \\\"Value for 310\\\",\\\"311\\\": \\\"Value for 311\\\",\\\"312\\\": \\\"Value for 312\\\",\\\"313\\\": \\\"Value for 313\\\",\\\"314\\\": \\\"Value for 314\\\",\\\"315\\\": \\\"Value for 315\\\",\\\"316\\\": \\\"Value for 316\\\",\\\"317\\\": \\\"Value for 317\\\",\\\"318\\\": \\\"Value for 318\\\",\\\"319\\\": \\\"Value for 319\\\",\\\"320\\\": \\\"Value for 320\\\",\\\"321\\\": \\\"Value for 321\\\",\\\"322\\\": \\\"Value for 322\\\",\\\"323\\\": \\\"Value for 323\\\",\\\"324\\\": \\\"Value for 324\\\",\\\"325\\\": \\\"Value for 325\\\",\\\"326\\\": \\\"Value for 326\\\",\\\"327\\\": \\\"Value for 327\\\",\\\"328\\\": \\\"Value for 328\\\",\\\"329\\\": \\\"Value for 329\\\",\\\"330\\\": \\\"Value for 330\\\",\\\"331\\\": \\\"Value for 331\\\",\\\"332\\\": \\\"Value for 332\\\",\\\"333\\\": \\\"Value for 333\\\",\\\"334\\\": \\\"Value for 334\\\",\\\"335\\\": \\\"Value for 335\\\",\\\"336\\\": \\\"Value for 336\\\",\\\"337\\\": \\\"Value for 337\\\",\\\"338\\\": \\\"Value for 338\\\",\\\"339\\\": \\\"Value for 339\\\",\\\"340\\\": \\\"Value for 340\\\",\\\"341\\\": \\\"Value for 341\\\",\\\"342\\\": \\\"Value for 342\\\",\\\"343\\\": \\\"Value for 343\\\",\\\"344\\\": \\\"Value for 344\\\",\\\"345\\\": \\\"Value for 345\\\",\\\"346\\\": \\\"Value for 346\\\",\\\"347\\\": \\\"Value for 347\\\",\\\"348\\\": \\\"Value for 348\\\",\\\"349\\\": \\\"Value for 349\\\",\\\"350\\\": \\\"Value for 350\\\",\\\"351\\\": \\\"Value for 351\\\",\\\"352\\\": \\\"Value for 352\\\",\\\"353\\\": \\\"Value for 353\\\",\\\"354\\\": \\\"Value for 354\\\",\\\"355\\\": \\\"Value for 355\\\",\\\"356\\\": \\\"Value for 356\\\",\\\"357\\\": \\\"Value for 357\\\",\\\"358\\\": \\\"Value for 358\\\",\\\"359\\\": \\\"Value for 359\\\",\\\"360\\\": \\\"Value for 360\\\",\\\"361\\\": \\\"Value for 361\\\",\\\"362\\\": \\\"Value for 362\\\",\\\"363\\\": \\\"Value for 363\\\",\\\"364\\\": \\\"Value for 364\\\",\\\"365\\\": \\\"Value for 365\\\",\\\"366\\\": \\\"Value for 366\\\",\\\"367\\\": \\\"Value for 367\\\",\\\"368\\\": \\\"Value for 368\\\",\\\"369\\\": \\\"Value for 369\\\",\\\"370\\\": \\\"Value for 370\\\",\\\"371\\\": \\\"Value for 371\\\",\\\"372\\\": \\\"Value for 372\\\",\\\"373\\\": \\\"Value for 373\\\",\\\"374\\\": \\\"Value for 374\\\",\\\"375\\\": \\\"Value for 375\\\",\\\"376\\\": \\\"Value for 376\\\",\\\"377\\\": \\\"Value for 377\\\",\\\"378\\\": \\\"Value for 378\\\",\\\"379\\\": \\\"Value for 379\\\",\\\"380\\\": \\\"Value for 380\\\",\\\"381\\\": \\\"Value for 381\\\",\\\"382\\\": \\\"Value for 382\\\",\\\"383\\\": \\\"Value for 383\\\",\\\"384\\\": \\\"Value for 384\\\",\\\"385\\\": \\\"Value for 385\\\",\\\"386\\\": \\\"Value for 386\\\",\\\"387\\\": \\\"Value for 387\\\",\\\"388\\\": \\\"Value for 388\\\",\\\"389\\\": \\\"Value for 389\\\",\\\"390\\\": \\\"Value for 390\\\",\\\"391\\\": \\\"Value for 391\\\",\\\"392\\\": \\\"Value for 392\\\",\\\"393\\\": \\\"Value for 393\\\",\\\"394\\\": \\\"Value for 394\\\",\\\"395\\\": \\\"Value for 395\\\",\\\"396\\\": \\\"Value for 396\\\",\\\"397\\\": \\\"Value for 397\\\",\\\"398\\\": \\\"Value for 398\\\",\\\"399\\\": \\\"Value for 399\\\",\\\"400\\\": \\\"Value for 400\\\",\\\"401\\\": \\\"Value for 401\\\",\\\"402\\\": \\\"Value for 402\\\",\\\"403\\\": \\\"Value for 403\\\",\\\"404\\\": \\\"Value for 404\\\",\\\"405\\\": \\\"Value for 405\\\",\\\"406\\\": \\\"Value for 406\\\",\\\"407\\\": \\\"Value for 407\\\",\\\"408\\\": \\\"Value for 408\\\",\\\"409\\\": \\\"Value for 409\\\",\\\"410\\\": \\\"Value for 410\\\",\\\"411\\\": \\\"Value for 411\\\",\\\"412\\\": \\\"Value for 412\\\",\\\"413\\\": \\\"Value for 413\\\",\\\"414\\\": \\\"Value for 414\\\",\\\"415\\\": \\\"Value for 415\\\",\\\"416\\\": \\\"Value for 416\\\",\\\"417\\\": \\\"Value for 417\\\",\\\"418\\\": \\\"Value for 418\\\",\\\"419\\\": \\\"Value for 419\\\",\\\"420\\\": \\\"Value for 420\\\",\\\"421\\\": \\\"Value for 421\\\",\\\"422\\\": \\\"Value for 422\\\",\\\"423\\\": \\\"Value for 423\\\",\\\"424\\\": \\\"Value for 424\\\",\\\"425\\\": \\\"Value for 425\\\",\\\"426\\\": \\\"Value for 426\\\",\\\"427\\\": \\\"Value for 427\\\",\\\"428\\\": \\\"Value for 428\\\",\\\"429\\\": \\\"Value for 429\\\",\\\"430\\\": \\\"Value for 430\\\",\\\"431\\\": \\\"Value for 431\\\",\\\"432\\\": \\\"Value for 432\\\",\\\"433\\\": \\\"Value for 433\\\",\\\"434\\\": \\\"Value for 434\\\",\\\"435\\\": \\\"Value for 435\\\",\\\"436\\\": \\\"Value for 436\\\",\\\"437\\\": \\\"Value for 437\\\",\\\"438\\\": \\\"Value for 438\\\",\\\"439\\\": \\\"Value for 439\\\",\\\"440\\\": \\\"Value for 440\\\",\\\"441\\\": \\\"Value for 441\\\",\\\"442\\\": \\\"Value for 442\\\",\\\"443\\\": \\\"Value for 443\\\",\\\"444\\\": \\\"Value for 444\\\",\\\"445\\\": \\\"Value for 445\\\",\\\"446\\\": \\\"Value for 446\\\",\\\"447\\\": \\\"Value for 447\\\",\\\"448\\\": \\\"Value for 448\\\",\\\"449\\\": \\\"Value for 449\\\",\\\"450\\\": \\\"Value for 450\\\",\\\"451\\\": \\\"Value for 451\\\",\\\"452\\\": \\\"Value for 452\\\",\\\"453\\\": \\\"Value for 453\\\",\\\"454\\\": \\\"Value for 454\\\",\\\"455\\\": \\\"Value for 455\\\",\\\"456\\\": \\\"Value for 456\\\",\\\"457\\\": \\\"Value for 457\\\",\\\"458\\\": \\\"Value for 458\\\",\\\"459\\\": \\\"Value for 459\\\",\\\"460\\\": \\\"Value for 460\\\",\\\"461\\\": \\\"Value for 461\\\",\\\"462\\\": \\\"Value for 462\\\",\\\"463\\\": \\\"Value for 463\\\",\\\"464\\\": \\\"Value for 464\\\",\\\"465\\\": \\\"Value for 465\\\",\\\"466\\\": \\\"Value for 466\\\",\\\"467\\\": \\\"Value for 467\\\",\\\"468\\\": \\\"Value for 468\\\",\\\"469\\\": \\\"Value for 469\\\",\\\"470\\\": \\\"Value for 470\\\",\\\"471\\\": \\\"Value for 471\\\",\\\"472\\\": \\\"Value for 472\\\",\\\"473\\\": \\\"Value for 473\\\",\\\"474\\\": \\\"Value for 474\\\",\\\"475\\\": \\\"Value for 475\\\",\\\"476\\\": \\\"Value for 476\\\",\\\"477\\\": \\\"Value for 477\\\",\\\"478\\\": \\\"Value for 478\\\",\\\"479\\\": \\\"Value for 479\\\",\\\"480\\\": \\\"Value for 480\\\",\\\"481\\\": \\\"Value for 481\\\",\\\"482\\\": \\\"Value for 482\\\",\\\"483\\\": \\\"Value for 483\\\",\\\"484\\\": \\\"Value for 484\\\",\\\"485\\\": \\\"Value for 485\\\",\\\"486\\\": \\\"Value for 486\\\",\\\"487\\\": \\\"Value for 487\\\",\\\"488\\\": \\\"Value for 488\\\",\\\"489\\\": \\\"Value for 489\\\",\\\"490\\\": \\\"Value for 490\\\",\\\"491\\\": \\\"Value for 491\\\",\\\"492\\\": \\\"Value for 492\\\",\\\"493\\\": \\\"Value for 493\\\",\\\"494\\\": \\\"Value for 494\\\",\\\"495\\\": \\\"Value for 495\\\",\\\"496\\\": \\\"Value for 496\\\",\\\"497\\\": \\\"Value for 497\\\",\\\"498\\\": \\\"Value for 498\\\",\\\"499\\\": \\\"Value for 499\\\",\\\"500\\\": \\\"Value for 500\\\"}}\"));\n // Check the 2 responses are as expected\n HttpResponseBean response6 = getNewHttpCallBean1.getResponseObjectsByEnum(com.betfair.testing.utils.cougar.enums.CougarMessageProtocolResponseTypeEnum.RESTJSONXML);\n AssertionUtils.multiAssertEquals(createAsDocument10, response6.getResponseObject());\n AssertionUtils.multiAssertEquals((int) 200, response6.getHttpStatusCode());\n AssertionUtils.multiAssertEquals(\"OK\", response6.getHttpStatusText());\n \n HttpResponseBean response7 = getNewHttpCallBean1.getResponseObjectsByEnum(com.betfair.testing.utils.cougar.enums.CougarMessageProtocolResponseTypeEnum.RESTJSONJSON);\n AssertionUtils.multiAssertEquals(createAsJSONObject11, response7.getResponseObject());\n AssertionUtils.multiAssertEquals((int) 200, response7.getHttpStatusCode());\n AssertionUtils.multiAssertEquals(\"OK\", response7.getHttpStatusText());\n \n // generalHelpers.pauseTest(500L);\n // Check the log entries are as expected\n \n cougarManager1.verifyRequestLogEntriesAfterDate(getTimeAsTimeStamp7, new RequestLogRequirement(\"2.8\", \"simpleMapOperation\"),new RequestLogRequirement(\"2.8\", \"simpleMapOperation\") );\n }", "@Test\n public void test19(){\n // List<Integer> services = response.extract().path(\"data.findAll{it.services=='Samsung Experience'}.storeservices\");\n //List<HashMap<String, ?>> address = response.extract().path(\"data.findAll{it.service=='Samsung Experience'}.storeservices\");\n System.out.println(\"------------------StartingTest---------------------------\");\n System.out.println(\"The name of all services:\" );\n System.out.println(\"------------------End of Test---------------------------\");\n }", "private void initData() {\r\n allElements = new Vector<PageElement>();\r\n\r\n String className = Utility.getDisplayName(queryResult.getOutputEntity());\r\n List<AttributeInterface> attributes = Utility.getAttributeList(queryResult);\r\n int attributeSize = attributes.size();\r\n //int attributeLimitInDescStr = (attributeSize < 10) ? attributeSize : 10;\r\n\r\n Map<String, List<IRecord>> allRecords = queryResult.getRecords();\r\n serviceURLComboContents.add(\" All service URLs \");\r\n for (String url : allRecords.keySet()) {\r\n\r\n List<IRecord> recordList = allRecords.get(url);\r\n \r\n StringBuilder urlNameSize = new StringBuilder( url );\r\n urlNameSize = new StringBuilder( urlNameSize.substring(urlNameSize.indexOf(\"//\")+2));\r\n urlNameSize = new StringBuilder(urlNameSize.substring(0,urlNameSize.indexOf(\"/\")));\r\n urlNameSize.append(\" ( \" + recordList.size() + \" )\");\r\n serviceURLComboContents.add(urlNameSize.toString());\r\n Vector<PageElement> elements = new Vector<PageElement>();\r\n for (IRecord record : recordList) {\r\n StringBuffer descBuffer = new StringBuffer();\r\n for (int i = 0; i < attributeSize; i++) {\r\n Object value = record.getValueForAttribute(attributes.get(i));\r\n if (value != null) {\r\n if (i != 0) {\r\n descBuffer.append(',');\r\n }\r\n descBuffer.append(value);\r\n }\r\n }\r\n String description = descBuffer.toString();\r\n // if (description.length() > 150) {\r\n // //150 is allowable chars at 1024 resolution\r\n // description = description.substring(0, 150);\r\n // //To avoid clipping of attribute value in-between\r\n // int index = description.lastIndexOf(\",\");\r\n // description = description.substring(0, index);\r\n // }\r\n PageElement element = new PageElementImpl();\r\n element.setDisplayName(className + \"_\" + record.getRecordId().getId());\r\n element.setDescription(description);\r\n\r\n DataRow dataRow = new DataRow(record, queryResult.getOutputEntity());\r\n dataRow.setParent(parentDataRow);\r\n dataRow.setAssociation(queryAssociation);\r\n\r\n Vector recordListUserObject = new Vector();\r\n recordListUserObject.add(dataRow);\r\n recordListUserObject.add(record);\r\n\r\n element.setUserObject(recordListUserObject);\r\n\r\n allElements.add(element);\r\n elements.add(element);\r\n }\r\n URLSToResultRowMap.put(urlNameSize.toString(), elements);\r\n }\r\n }", "public HashMap getMetaData() ;", "@Override\n\tpublic Map<String, Object> getInfo(Map<String, Object> pageInfo) {\n\t\treturn null;\n\t}", "Map getIDPEXDataMap();", "public Object getData() \n {\n return data;\n }", "@Test\n public void test007() {\n List<HashMap<String, ?>> values = response.extract().path(\"data.findAll{it.name=='Fargo'}\");\n\n System.out.println(\"------------------StartingTest---------------------------\");\n System.out.println(\"The values for store name is Fargo:\" + values);\n System.out.println(\"------------------End of Test---------------------------\");\n }", "@Override\r\n protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {\n WebFunction.JsonHeaderInit(resp);\r\n ArticleService svc=new ArticleService();\r\n JSONObject ResultJson = svc.GetType(\"1\");\r\n WebFunction.ResponseJson(resp, ResultJson);\r\n }", "protected void processRequest(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n response.setContentType(\"text/html;charset=UTF-8\");\n try (PrintWriter out = response.getWriter()) {\n /* TODO output your page here. You may use following sample code. */\n Object[] profile = data(111);\n for(int i=0; i<4; i++){\n out.print(profile[i]);\n }\n \n }\n }", "private void getProvinces(HttpServletRequest req, HttpServletResponse resp) throws IOException {\n\t\t\n\t\t\n\t\tProvincesService provinces=new ProvincesServiceImpl();\n\t\t\n\t\tString parameter = req.getParameter(\"\");\n\t\tList<Provinces> select = provinces.select();\n\t\t\t\t\t\t\n\t\tGson gson =new GsonBuilder()\n\t\t.create();\n\t\tString json = gson.toJson(select); \n\t\tSystem.out.println(\"json:\"+json);\n\t\tPrintWriter writer = resp.getWriter();\n\t\twriter.print(json); // 返回数据给前台\n\t\twriter.close();\n\t\t\t\t\t\n\t}", "@Override\n protected Map<String, String> getParams() {\n Map<String, String> params = new HashMap<>();\n\n params.put(\"id\", id);\n params.put(\"type\", type);\n\n Log.d(TAG, \"getParams: \"+params);\n\n\n\n return params;\n }", "@Override\n protected void doGet(HttpServletRequest req, HttpServletResponse response)\n \t\tthrows ServletException, IOException {\n \tPrintWriter out = response.getWriter();\n//\t List<Point> points=new ArrayList<Point>();\n//\t Point point1=new Point(111.11, 22.22, \"���Ǵ���IJ�����Ϣ\");\n//\t Point point2=new Point(134.56,33.8,\"������Ϣ2\");\n//\t points.add(point1);\n//\t points.add(point2);\n\t //out.println(new JSONArray().fromObject(points));\n \tout.println(new JSONArray().fromObject(acledDaoImpl.findAllp()));\n }", "Map<String,Object> getMasterData(String language)throws EOTException;", "io.dstore.values.StringValue getPage();", "void requestData();", "String pageDetails();", "public static String FetchWSData(int key){\n\t\tSystem.out.println(\"Fetch output: \"+WSDataMap.get(key));\n\t\treturn WSDataMap.get(key);\n\t}", "public com.drore.cloud.tdp.service.IWsPmsSdkServiceStub.GetDictionaryPageResponse getDictionaryPage(\n\n com.drore.cloud.tdp.service.IWsPmsSdkServiceStub.GetDictionaryPage getDictionaryPage)\n \n\n throws java.rmi.RemoteException\n \n {\n org.apache.axis2.context.MessageContext _messageContext = null;\n try{\n org.apache.axis2.client.OperationClient _operationClient = _serviceClient.createClient(_operations[6].getName());\n _operationClient.getOptions().setAction(\"urn:getDictionaryPage\");\n _operationClient.getOptions().setExceptionToBeThrownOnSOAPFault(true);\n\n \n \n addPropertyToOperationClient(_operationClient,org.apache.axis2.description.WSDL2Constants.ATTR_WHTTP_QUERY_PARAMETER_SEPARATOR,\"&\");\n \n\n // create a message context\n _messageContext = new org.apache.axis2.context.MessageContext();\n\n \n\n // create SOAP envelope with that payload\n org.apache.axiom.soap.SOAPEnvelope env = null;\n \n \n env = toEnvelope(getFactory(_operationClient.getOptions().getSoapVersionURI()),\n getDictionaryPage,\n optimizeContent(new javax.xml.namespace.QName(\"http://impl.thirdsdk.api.pms.cms.hikvision.com\",\n \"getDictionaryPage\")));\n \n //adding SOAP soap_headers\n _serviceClient.addHeadersToEnvelope(env);\n // set the message context with that soap envelope\n _messageContext.setEnvelope(env);\n\n // add the message contxt to the operation client\n _operationClient.addMessageContext(_messageContext);\n\n //execute the operation client\n _operationClient.execute(true);\n\n \n org.apache.axis2.context.MessageContext _returnMessageContext = _operationClient.getMessageContext(\n org.apache.axis2.wsdl.WSDLConstants.MESSAGE_LABEL_IN_VALUE);\n org.apache.axiom.soap.SOAPEnvelope _returnEnv = _returnMessageContext.getEnvelope();\n \n \n java.lang.Object object = fromOM(\n _returnEnv.getBody().getFirstElement() ,\n com.drore.cloud.tdp.service.IWsPmsSdkServiceStub.GetDictionaryPageResponse.class,\n getEnvelopeNamespaces(_returnEnv));\n\n \n return (com.drore.cloud.tdp.service.IWsPmsSdkServiceStub.GetDictionaryPageResponse)object;\n \n }catch(org.apache.axis2.AxisFault f){\n\n org.apache.axiom.om.OMElement faultElt = f.getDetail();\n if (faultElt!=null){\n if (faultExceptionNameMap.containsKey(faultElt.getQName())){\n //make the fault by reflection\n try{\n java.lang.String exceptionClassName = (java.lang.String)faultExceptionClassNameMap.get(faultElt.getQName());\n java.lang.Class exceptionClass = java.lang.Class.forName(exceptionClassName);\n java.lang.Exception ex=\n (java.lang.Exception) exceptionClass.newInstance();\n //message class\n java.lang.String messageClassName = (java.lang.String)faultMessageMap.get(faultElt.getQName());\n java.lang.Class messageClass = java.lang.Class.forName(messageClassName);\n java.lang.Object messageObject = fromOM(faultElt,messageClass,null);\n java.lang.reflect.Method m = exceptionClass.getMethod(\"setFaultMessage\",\n new java.lang.Class[]{messageClass});\n m.invoke(ex,new java.lang.Object[]{messageObject});\n \n\n throw new java.rmi.RemoteException(ex.getMessage(), ex);\n }catch(java.lang.ClassCastException e){\n // we cannot intantiate the class - throw the original Axis fault\n throw f;\n } catch (java.lang.ClassNotFoundException e) {\n // we cannot intantiate the class - throw the original Axis fault\n throw f;\n }catch (java.lang.NoSuchMethodException e) {\n // we cannot intantiate the class - throw the original Axis fault\n throw f;\n } catch (java.lang.reflect.InvocationTargetException e) {\n // we cannot intantiate the class - throw the original Axis fault\n throw f;\n } catch (java.lang.IllegalAccessException e) {\n // we cannot intantiate the class - throw the original Axis fault\n throw f;\n } catch (java.lang.InstantiationException e) {\n // we cannot intantiate the class - throw the original Axis fault\n throw f;\n }\n }else{\n throw f;\n }\n }else{\n throw f;\n }\n } finally {\n _messageContext.getTransportOut().getSender().cleanup(_messageContext);\n }\n }", "void getValues(long id, Map<String,Object> record);", "@Override\r\n\tpublic ResponseResult queryPayLogData(Map<String, String> param) {\r\n\t\treturn null;\r\n\t}", "public interface IMeiziService {\n\n\n\n @GET(\"http://gank.io/api/data/%E7%A6%8F%E5%88%A9/10/{page}\")\n Observable<MeiziInfo> getMeizhiData(@Path(\"page\") int page);\n\n}", "@Override\n\tpublic List<Map<String, String>> getData() throws Exception{\n\t\tqueryForList(\"\", null);\n\t\treturn null;\n\t}", "public Map<String, Object> getCurrentData() throws Exception;", "java.util.Map<java.lang.String, java.lang.String>\n getDetailsMap();", "public void _jspService(HttpServletRequest request, HttpServletResponse response) throws java.io.IOException, ServletException {\n\n response.setContentType( \"text/html;charset=UTF-8\");\n /* set up the intrinsic variables using the pageContext goober:\n ** session = HttpSession\n ** application = ServletContext\n ** out = JspWriter\n ** page = this\n ** config = ServletConfig\n ** all session/app beans declared in globals.jsa\n */\n PageContext pageContext = JspFactory.getDefaultFactory().getPageContext( this, request, response, null, true, JspWriter.DEFAULT_BUFFER, true);\n // Note: this is not emitted if the session directive == false\n HttpSession session = pageContext.getSession();\n int __jsp_tag_starteval;\n ServletContext application = pageContext.getServletContext();\n JspWriter out = pageContext.getOut();\n _mapclient page = this;\n ServletConfig config = pageContext.getServletConfig();\n\n com.evermind.server.http.JspCommonExtraWriter __ojsp_s_out = (com.evermind.server.http.JspCommonExtraWriter) out;\n try {\n\n\n __ojsp_s_out.write(__oracle_jsp_text[0]);\n __ojsp_s_out.write(__oracle_jsp_text[1]);\n __ojsp_s_out.write(__oracle_jsp_text[2]);\n __ojsp_s_out.write(__oracle_jsp_text[3]);\n __ojsp_s_out.write(__oracle_jsp_text[4]);\n __ojsp_s_out.write(__oracle_jsp_text[5]);\n __ojsp_s_out.write(__oracle_jsp_text[6]);\n mapdemo.MapClientBean mcb;\n synchronized (session) {\n if ((mcb = (mapdemo.MapClientBean) pageContext.getAttribute( \"mcb\", PageContext.SESSION_SCOPE)) == null) {\n mcb = (mapdemo.MapClientBean) new mapdemo.MapClientBean();\n pageContext.setAttribute( \"mcb\", mcb, PageContext.SESSION_SCOPE);\n __ojsp_s_out.write(__oracle_jsp_text[7]);\n mcb.setMapViewerServerURL(OracleJspRuntime.toStr( mcb.determineURL(request)));\n __ojsp_s_out.write(__oracle_jsp_text[8]);\n pageContext.setAttribute( \"mcb\", mcb, PageContext.SESSION_SCOPE);\n }\n }\n __ojsp_s_out.write(__oracle_jsp_text[9]);\n {\n String[] __paramList = request.getParameterValues( \"mapViewerServerURL\");\n if ((__paramList != null) && (__paramList[0] != null) && (__paramList[0].length() > 0)) {\n mcb.setMapViewerServerURL(__paramList[0]);\n }\n }\n __ojsp_s_out.write(__oracle_jsp_text[10]);\n OracleJspRuntime.__jspSetAllParams(request, (Object)mcb, true);\n __ojsp_s_out.write(__oracle_jsp_text[11]);\n \n mcb.processRequest(request);\n \n __ojsp_s_out.write(__oracle_jsp_text[12]);\n out.print(mcb.getMapViewerServerURL());\n __ojsp_s_out.write(__oracle_jsp_text[13]);\n out.print( mcb.getDataSource() );\n __ojsp_s_out.write(__oracle_jsp_text[14]);\n out.print( mcb.getTitle() );\n __ojsp_s_out.write(__oracle_jsp_text[15]);\n out.print( mcb.getBaseMap() );\n __ojsp_s_out.write(__oracle_jsp_text[16]);\n out.print( mcb.getCenterX() );\n __ojsp_s_out.write(__oracle_jsp_text[17]);\n out.print( mcb.getCenterY() );\n __ojsp_s_out.write(__oracle_jsp_text[18]);\n out.print( mcb.getSize() );\n __ojsp_s_out.write(__oracle_jsp_text[19]);\n out.print(mcb.getImageW());\n __ojsp_s_out.write(__oracle_jsp_text[20]);\n if (mcb.getSuccess()) { \n __ojsp_s_out.write(__oracle_jsp_text[21]);\n out.print( mcb.getMapImageURL() );\n __ojsp_s_out.write(__oracle_jsp_text[22]);\n out.print( mcb.getImageW() );\n __ojsp_s_out.write(__oracle_jsp_text[23]);\n out.print( mcb.getImageH() );\n __ojsp_s_out.write(__oracle_jsp_text[24]);\n } else { \n __ojsp_s_out.write(__oracle_jsp_text[25]);\n } \n __ojsp_s_out.write(__oracle_jsp_text[26]);\n out.print( mcb.getImageW() );\n __ojsp_s_out.write(__oracle_jsp_text[27]);\n out.print( mcb.getImageW() );\n __ojsp_s_out.write(__oracle_jsp_text[28]);\n out.print(mcb.getXMLRequest());\n __ojsp_s_out.write(__oracle_jsp_text[29]);\n out.print(mcb.getXMLResponse());\n __ojsp_s_out.write(__oracle_jsp_text[30]);\n \n if(mcb.getErrorMsg()!=null && mcb.getDataSource()!=null)\n {\n \n __ojsp_s_out.write(__oracle_jsp_text[31]);\n out.print(mcb.getErrorMsg());\n __ojsp_s_out.write(__oracle_jsp_text[32]);\n \n }\n \n __ojsp_s_out.write(__oracle_jsp_text[33]);\n\n }\n catch (Throwable e) {\n if (!(e instanceof javax.servlet.jsp.SkipPageException)){\n try {\n if (out != null) out.clear();\n }\n catch (Exception clearException) {\n }\n pageContext.handlePageException(e);\n }\n }\n finally {\n OracleJspRuntime.extraHandlePCFinally(pageContext, true);\n JspFactory.getDefaultFactory().releasePageContext(pageContext);\n }\n\n }", "void render(Map<String,List<Map<String,String>>> data);", "public List<CustomReferenceVO> getDetailsOfInHomeSo(Map paramMap)throws DataServiceException {\r\n\t\tList<CustomReferenceVO> list = null;\r\n\t\ttry{\r\n\t\t\tlist = queryForList(\"getDetailsOfInHomeSo.query\",paramMap);\r\n\t\t}\r\n\t\tcatch(Exception e){\r\n\t\t\tLOGGER.error(\"Exception in getDetailsOfInHomeSo\" + e.getMessage(), e);\r\n\t\t}\r\n\t\treturn list;\r\n\t}", "protected void setMetdata(HashMap<PageMetadataEnum,String> m ){\r\n\t\tthis.metadata = m; \r\n\t}", "public void getUserDetailData(int pageNo) {\n userDetailDataService.getUserData(\"\"+pageNo)\n .enqueue(new Callback<UserDetailBean>() {\n @Override\n public void onResponse(Call<UserDetailBean> call, Response<UserDetailBean> response) {\n if (response.body() != null) {\n userDetailBeanMutableLiveData.postValue(response.body());\n }\n }\n\n @Override\n public void onFailure(Call<UserDetailBean> call, Throwable t) {\n userDetailBeanMutableLiveData.postValue(null);\n }\n });\n }", "Object getData();", "Object getData();", "private void fetchData() {\r\n RequesterBean requesterBean = new RequesterBean();\r\n requesterBean.setDataObject(hierarchyTitle);\r\n requesterBean.setFunctionType(GET_HIERARCHY_DATA);\r\n AppletServletCommunicator conn = new AppletServletCommunicator(connect,requesterBean);\r\n conn.send();\r\n ResponderBean responderBean = conn.getResponse();\r\n if(responderBean != null) {\r\n if(responderBean.isSuccessfulResponse()) {\r\n queryKey = hierarchyTitle;\r\n Hashtable htData = (Hashtable)responderBean.getDataObject();\r\n extractToQueryEngine(htData);\r\n }\r\n }else {\r\n //Server Error\r\n// throw new CoeusUIException(responderBean.getMessage(),CoeusUIException.ERROR_MESSAGE);\r\n }\r\n }", "@Override\n protected Map<String, DataPart> getByteData() {\n Map<String, DataPart> params = new HashMap<>();\n\n return params;\n }", "@Override\n protected Map<String, DataPart> getByteData() {\n Map<String, DataPart> params = new HashMap<>();\n\n return params;\n }", "@Override\n protected Map<String, DataPart> getByteData() {\n Map<String, DataPart> params = new HashMap<>();\n\n return params;\n }", "@Override\n protected Map<String, DataPart> getByteData() {\n Map<String, DataPart> params = new HashMap<>();\n\n return params;\n }", "Map<String, Object> getServiceSpecificObjects();", "@Override\r\n\tpublic int buildPage(String name, Map<?, ?> data, File file) {\n\t\treturn 0;\r\n\t}", "Map getAspectDatas();", "@Override\r\n protected Map<String, String> getParams() {\n Map<String, String> params = new HashMap<String, String>();\r\n\r\n // Adding All values to Params.\r\n params.put(\"name\", Name);\r\n params.put(\"age\", Age);\r\n params.put(\"phone_no\", Phoneno);\r\n params.put(\"h_lic_no\", Hospitallic);\r\n params.put(\"appoinment_date\", Appointment1);\r\n params.put(\"address\", Address);\r\n params.put(\"permision\", Permission);\r\n\r\n return params;\r\n }", "public interface IStatisticsExport {\r\n Map<String, Object> export(Map<String, Object> inParam) throws E5Exception;\r\n}", "public interface EvaluateService {\n //获取商品评价信息\n List<Map<String,Object>> getGoodsEvaluate(int id,String type);\n}", "java.util.Map<java.lang.String, java.lang.String>\n getDetailsMap();", "@Override\n public List<IMapData<Integer, String>> getHashMapData() {\n List<IMapData<Integer, String>> data = new ArrayList<>();\n\n data.add(this.getHashMapData1());\n data.add(this.getHashMapData2());\n\n return data;\n }", "public void addProductInspect(String accessKey, Map<String,String> dataMap) throws org.apache.thrift.TException;", "@Override\n\tpublic HashMap<String, Object> getRecruitData(Ee15 ee15) {\n\t\tPageHelper.offsetPage(ee15.getOffset(),ee15.getLimit()); \n\t/*\tee15.setAab998(SysUserUtil.getCurrentUser().getAab998());//申报用户对应的统一社会信用代码\n*/\t\tList<Ee15> list=recruitDataEntryEe15Mapper.getRecruitDataList(ee15);\n\t\tPageInfo<Ee15> pageinfo = new PageInfo<Ee15>(list);\n\t\treturn this.success_hashmap_response(pageinfo);\n\t}", "public interface SysDictionaryExtMapper {\n\n List<SysDictionary> listDictionary(@Param(\"dicClass\") String dicClass,\n @Param(\"dicValue\") String dicValue,\n Page<SysDictionary> page);\n\n}", "private Map<String,Object> getRPCBody()\n {\n \t\tMap<String,Object> result = new HashMap<>();\n \t\tresult.put(\"jsonrpc\", \"2.0\");\n \t\tresult.put(\"id\", getCounter());\n \t\treturn result;\n }", "public HashMap<Long, String> getData() {\n\t\treturn data;\n\t}", "public interface TDgapWsDailyStatProvider extends BaseProvider<TDgapWsDailyStat> {\n PageInfo<Map<String, Object>> list(Map<String, Object> params);\n\n public int stateDailyLog(Date time);\n\n public void testPageHelper();\n\n}", "public Object getData();", "public interface IStatisticManageService {\n\n\n ServerResponse<Map> getBaseCount();\n\n}", "@Override\n protected Map<String, String> getParams() {\n Map<String, String> params = new HashMap<String, String>();\n params.put(\"title\", name);\n params.put(\"ean\", ean);\n params.put(\"supplier\", supplier);\n params.put(\"offer\", offer);\n params.put(\"price\", price);\n\n return params;\n }", "private void getData(){\r\n \tsetProgressBarIndeterminateVisibility(true);\r\n \t\r\n\t String url = \"HospitalInfo?hospital=\" + URLEncoder.encode(hospital) + \"&ssid=\" + UserInfo.getSSID();\r\n\t download = new HttpGetJSONConnection(url, mHandler, TASK_GETDATA);\r\n\t download.start();\r\n }", "@Override\n protected Map<String, String> getParams() {\n int noofstudent = 2*Integer.parseInt(noOfStudents);\n String creatre = \"jbscjas\";//send anything part\n String uid = AppController.getString(WingForm.this,\"Student_id\");\n Map<String, String> params = new LinkedHashMap<String, String>();\n //using LinkedHashmap because backend does not check key value and sees order of variables\n params.put(\"createsavedform\", creatre);\n params.put(\"uid\",uid);\n params.put(\"noofstudent\", String.valueOf(noofstudent));\n for(int m=1;m<3;m++){\n String z= String.valueOf(m);\n params.put(\"pfid[\"+m+\"]\",z);\n params.put(\"hostelid[\"+m+\"]\",hostelid[m-1]);\n params.put(\"floorno[\"+m+\"]\",floorno[m-1]);\n }\n for (int k = 0; k < noofstudent; k++) {\n int m = k/2 +1;\n String z= String.valueOf(m);\n params.put(\"sid[\"+k+\"]\", sid[k]);\n params.put(\"sname[\"+k+\"]\", sname[k]);\n params.put(\"roominwing[\"+k+\"]\",z );\n }\n\n return params;\n }", "@Override\r\n\tpublic String getPage(String userInfo, String paramater) {\n\t\tDubboServiceResultInfo info=new DubboServiceResultInfo();\r\n\t\ttry {\r\n\t\t\tif(StringUtils.isNotBlank(paramater)){\r\n\t\t\t\tMap map=JacksonUtils.fromJson(paramater, HashMap.class);\r\n\t\t\t\tPage page=standardRoleService.getPage(map, (Integer)map.get(\"start\"), (Integer)map.get(\"limit\"));\r\n\t\t\t\tinfo.setResult(JacksonUtils.toJson(page));\r\n\t\t\t info.setSucess(true);\r\n\t\t\t info.setMsg(\"获取分页对象成功!\");\r\n\t\t\t}else{\r\n\t\t\t\tPage page=standardRoleService.getPage(new HashMap(), null, null);\r\n\t\t\t\tinfo.setResult(JacksonUtils.toJson(page));\r\n\t\t\t info.setSucess(true);\r\n\t\t\t info.setMsg(\"获取分页对象成功!\");\r\n\t\t\t}\r\n\t\t} catch (Exception e) {\r\n\t\t\t// TODO Auto-generated catch block\r\n\t\t\t log.error(\"获取分页对象失败!\"+e.getMessage());\r\n\t\t\t info.setSucess(false);\r\n\t\t\t info.setMsg(\"获取分页对象失败!\");\r\n\t\t\t info.setExceptionMsg(e.getMessage());\r\n\t\t}\r\n\t\treturn JacksonUtils.toJson(info);\r\n\t}", "void getDataFromServer();", "public final HashMap<String, String> invoke() {\n Serializable serializable = com.iqoption.core.ext.a.s(this.this$0).getSerializable(\"ARG_REDIRECT_PARAMS\");\n if (serializable != null) {\n return (HashMap) serializable;\n }\n throw new TypeCastException(\"null cannot be cast to non-null type java.util.HashMap<kotlin.String, kotlin.String>\");\n }", "java.util.Map<java.lang.String, java.lang.String>\n getAppClientParas();", "@Override\n protected Map<String, String> getParams() {\n int noofstudent = 2*Integer.parseInt(noOfStudents);\n String creatre = \"jbscjas\";//send anything part\n String uid = AppController.getString(WingForm.this,\"Student_id\");\n Map<String, String> params = new LinkedHashMap<String, String>();\n //using LinkedHashmap because backend does not check key value and sees order of variables\n params.put(\"createsubmittedform\", creatre);\n params.put(\"uid\",uid);\n params.put(\"noofstudent\", String.valueOf(noofstudent));\n for(int m=1;m<3;m++){\n String z= String.valueOf(m);\n params.put(\"pfid[\"+m+\"]\",z);\n params.put(\"hostelid[\"+m+\"]\",hostelid[m-1]);\n params.put(\"floorno[\"+m+\"]\",floorno[m-1]);\n }\n for (int k = 0; k < noofstudent; k++) {\n int m = k/2 +1;\n String z= String.valueOf(m);\n params.put(\"sid[\"+k+\"]\", sid[k]);\n params.put(\"roominwing[\"+k+\"]\",z );\n }\n return params;\n }", "@Override\r\n protected Map<String, String> getParams() {\n\r\n Map<String, String> params = new HashMap<String, String>();\r\n params.put(\"name\", name);\r\n params.put(\"product\", product);\r\n params.put(\"email\", email);\r\n params.put(\"phone\", phone);\r\n params.put(\"quantity\", quantity);\r\n params.put(\"price\", price);\r\n params.put(\"address\", address);\r\n\r\n return params;\r\n }", "@GET(\"V1/orders/?\")\n Observable<ItemList> getOrderDetailList(@QueryMap HashMap<String, String> stringHashMap);", "private Map<String,Object> getParams(String nombre , int id){\n\t\t\tMap <String,Object> mapa;\n\t\t\tmapa = new HashMap<String,Object>();\n\t\t\t//Pasar parametros en de JasperReport\n\t\t\tmapa.put(\"alumnoNombre\", nombre);\n\t\t\tmapa.put(\"alumnoId\", id);\n\t\t\t\n\t\t\treturn mapa;\n\t\t\t\n\t\t}", "@Test\n public void test008() {\n List<HashMap<String, ?>> address = response.extract().path(\"data.findAll{it.name=='Maplewood'}.address\");\n\n System.out.println(\"------------------StartingTest---------------------------\");\n System.out.println(\"The address for store name is Maplewood:\" + address);\n System.out.println(\"------------------End of Test---------------------------\");\n }", "@RequestMapping(value = \"/listComittee.do\")\n\tpublic String outputJsonList(HttpServletRequest request, HttpServletResponse response,Model model) throws IOException {\n\t\tSystem.out.println(\"get\");\n\t\tString sPageNo = request.getParameter(\"pageNo\");\n\t\tString sPageSize = request.getParameter(\"pageSize\");\n\t\tString sTotalcnt = \"0\";\n\t\tString sTitle = request.getParameter(\"sTitle\");\n\t\tif(sTitle == null ) {\n\t\t\tsTitle = \"\";\n\t\t};\n\t\tSystem.out.println(sTitle);\n\t\t\n\t\tMap <String,String> hm1 = new HashMap();\n\t\thm1.put (\"sPageNo\",sPageNo);\t\t\n\t\thm1.put (\"sPageSize\",sPageSize);\t\t\n\t\thm1.put (\"sTotalcnt\",sTotalcnt);\t\n\t\thm1.put (\"sTitle\",sTitle);\n\n\t\tString Tot= comitteeListService.selectTotal(hm1);\n\t\t\n\t\tList<HashMap<String, String>> aList= comitteeListService.listComittee(hm1);\n\t \n\t\tMap<String,Object> map = new HashMap<String,Object>();\n\t map.put(\"result\",aList);\n\t \n\t model.addAllAttributes(map);\n\t model.addAttribute(\"totCnt\",Tot);\n\n\t // Keypoint ! setViewName占쏙옙 占쏙옙載� String 占식띰옙占쏙옙姑占� JsonView bean 占쏙옙占쏙옙占쏙옙占쏙옙占� id占쏙옙 占쏙옙占싣억옙 占싼댐옙.\t \n\t return \"jsonView\";\n\t}", "public interface HistoryDataService {\n\n PageInfo<WaterHistoryDto> list(String code, String stationId, String startTime, String endTime, Integer pageSize, Integer pageNum);\n\n}", "Map<String, String> mo14888a();", "public IData getStoreddata();", "lanyotech.cn.park.protoc.CommonProtoc.PageHelper getPageHelper();", "lanyotech.cn.park.protoc.CommonProtoc.PageHelper getPageHelper();", "lanyotech.cn.park.protoc.CommonProtoc.PageHelper getPageHelper();", "private org.apache.axiom.soap.SOAPEnvelope toEnvelope(org.apache.axiom.soap.SOAPFactory factory, com.drore.cloud.tdp.service.IWsPmsSdkServiceStub.GetDictionaryPage param, boolean optimizeContent)\n throws org.apache.axis2.AxisFault{\n\n \n try{\n\n org.apache.axiom.soap.SOAPEnvelope emptyEnvelope = factory.getDefaultEnvelope();\n emptyEnvelope.getBody().addChild(param.getOMElement(com.drore.cloud.tdp.service.IWsPmsSdkServiceStub.GetDictionaryPage.MY_QNAME,factory));\n return emptyEnvelope;\n } catch(org.apache.axis2.databinding.ADBException e){\n throw org.apache.axis2.AxisFault.makeFault(e);\n }\n \n\n }", "@Override\n public void onDataChange(DataSnapshot dataSnapshot) {\n getHome_aDataFromMap((Map<String,Object>) dataSnapshot.getValue());\n }", "@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n HttpSession session = request.getSession(true);\n String name = session.getAttribute(\"username\").toString();\n Double[] data = new Double[12];\n TransDetail transdetail = new TransDetail();\n YearMonth yearMonth;\n LocalDate firstOfMonth;\n LocalDate lastOfMonth;\n Calendar c = GregorianCalendar.getInstance();\n \n for (int i = 0; i < 12; i++) {\n data[i] = 0.0;\n yearMonth = YearMonth.of(c.get(Calendar.YEAR), i+1); \n firstOfMonth = yearMonth.atDay(1);\n lastOfMonth = yearMonth.atEndOfMonth();\n List transdetailList = transSessionBean.searchWeeklyWithDate(name, firstOfMonth.toString(), lastOfMonth.toString()); \n Iterator iteratorMonthList = transdetailList.iterator();\n while (iteratorMonthList.hasNext()) {\n TransDetail loopMonthTransDetail = (TransDetail) iteratorMonthList.next(); \n data[i] = data[i] + Double.parseDouble(loopMonthTransDetail.getTotal());\n \n }\n System.out.print(\"month: \" + i + \" \" + data[i]);\n }\n \n System.out.print(\"tostring : \" + Arrays.toString(data));\n response.getWriter().write(Arrays.toString(data));\n \n }", "public interface CtlService {\n\n\tList<Map<String, Object>> getCtlInfByEquNum(Map<String, Object> map) throws Exception;\n\n\n\n}", "public HashMap getDatos() {\r\n return datos;\r\n }", "public interface UserService extends ICommonService<User> {\r\n\r\n public Page<User> findPage(User user,Integer sortId, int pagenum, int pagesize);\r\n\r\n public List<Map<String, Object>> pageToExcel(Map<String, Object> map);\r\n\r\n}", "@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response) {\n logger.debug(\"doGet\");\n try { \n JSONObject json = getMetricGroup(request, new MetricGroupsDao()); \n PrintWriter out = null;\n response.setContentType(\"application/json\");\n out = response.getWriter();\n out.println(json);\n }\n catch (Exception e) {\n logger.error(e.toString() + System.lineSeparator() + StackTrace.getStringFromStackTrace(e));\n }\n }", "public Map<Integer, Integer> getMemoryDataMap(){\n return dataMemory.getMemoryMap();\n }", "@Test\n public void test() {\n InformationPageParam param = new InformationPageParam();\n param.setPage(2);\n param.setPageSize(10);\n\n informationServiceI.list(param);\n }", "@Override\n\tvoid putData() {\n\t\tSystem.out.println(\"Brand : \"+brand);\n\t\tSystem.out.println(\"Model : \"+model);\n\t\tSystem.out.println(\"Year of manufacture : \"+year_of_manufacture);\n\t\tSystem.out.println(\"CC : \"+cc);\n\t}", "public static JSONObject covertDataToJSONForPage(String pageUri, Map<String, Object> data, VitroRequest vreq, ServletContext context) throws InstantiationException, IllegalAccessException, ClassNotFoundException { \n //Get PageDataGetter types associated with pageUri\n JSONObject rObj = null; \n List<PageDataGetter> dataGetters = getPageDataGetterObjects(vreq, pageUri);\n for(PageDataGetter getter: dataGetters) {\n \t JSONObject typeObj = null;\n try{\n typeObj = getter.convertToJSON(data, vreq);\n if( typeObj != null) {\n //Copy over everything from this type Obj to \n //TODO: Review how to handle duplicate keys, etc.\n if(rObj != null) {\n //For now, just nests as separate entry\n rObj.put(getter.getType(), typeObj);\n } else {\n rObj = typeObj;\n }\n } \n \t\n } catch(Throwable th){\n log.error(th,th);\n }\n } \n return rObj;\n }" ]
[ "0.612683", "0.609565", "0.58638215", "0.5838893", "0.5812796", "0.57960856", "0.572406", "0.56207806", "0.55760163", "0.55411047", "0.55183744", "0.55161214", "0.5492142", "0.5488043", "0.5478459", "0.54615146", "0.5426597", "0.54166585", "0.541021", "0.53954893", "0.5386663", "0.53645754", "0.53530383", "0.53381693", "0.53164655", "0.53034776", "0.529409", "0.5291499", "0.52913946", "0.5286514", "0.52830416", "0.52723926", "0.52601904", "0.5256505", "0.5255468", "0.52545226", "0.52414143", "0.52396125", "0.5229227", "0.52236676", "0.5221306", "0.5217439", "0.51993465", "0.5196935", "0.51877487", "0.51864904", "0.51769865", "0.5176153", "0.51741827", "0.51741827", "0.51698077", "0.5169052", "0.5169052", "0.5169052", "0.5169052", "0.516783", "0.5167506", "0.5165687", "0.5154318", "0.5129461", "0.5116008", "0.5106911", "0.509495", "0.50913465", "0.5087737", "0.50862294", "0.5082348", "0.50748104", "0.50730866", "0.5071731", "0.5055478", "0.5047521", "0.50472885", "0.50472194", "0.50454897", "0.5044641", "0.5043648", "0.50416857", "0.5031025", "0.50303775", "0.50293475", "0.50287086", "0.5026543", "0.50245655", "0.502092", "0.5020104", "0.501975", "0.5016955", "0.5016955", "0.5016955", "0.50139433", "0.5013668", "0.5013294", "0.500097", "0.5000839", "0.49999848", "0.49979666", "0.4995717", "0.49896133", "0.4988794", "0.4982931" ]
0.0
-1
there will be issue when the type is double/int/long
protected void setId(UiAction uiAction, ResultSet rs, int rowNumber) throws SQLException{ String id = rs.getString(UiActionTable.COLUMN_ID); if(id == null){ //do nothing when nothing found in database return; } uiAction.setId(id); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\n public Class getValueType() {\n return Double.class;\n }", "public static void main(String args[]) {\n\t\t \n\t\t // lets define some variables and try to insert other data type value\n\t\t int x = 23;\n\t\t double y ;\n\t\t y = x ; // here we are storing int to double ie. smaller to larger . So no error\n\t\t System.out.println(y);\n\t\t System.out.println(x);\n\t\t \n\t\t double a = 25.28;\n\t\t int b ;\n\t\t //b = a; // Here we can see error since we are trying to store double to int i.e larger to smaller w/o casting\n\t\t \n\t\t // lets do casting and store \n\t\t b = (int) a;\n\t\t System.out.println(b);\n\t\t \n\t\t boolean bool = true ;\n\t\t int num = bool; // not possible as we know boolean data type cannot be typecast;\n\t\t \n\t\t //int to long\n\t\t int value = 34;\n\t\t long value1 ;\n\t\t \n\t\t value1 = value;\n\t\t System.out.println(value1);\n\t\t value = value1; // trying longer to smaller w/o casting which is not possible;\n\t\t System.out.println(value);\n\t\t \n\t\t value = (int) value1;\n\t\t \n\t\t // long to float \n\t\t \n\t\t long value2 = 678;\n\t\t float value3; \n\t\t value3 = value2; // works fine since smaller to larger\n\t\t System.out.println(value3);\n\t\t value2 = value3 ; // trying longer to smaller w/o casting which is not possible;\n\t\t \n\t\t // so to assign value3 to value2 we need Explicitly type cast\n\t\t value2 = (long) value3;\n\t\t \n\t\t // float to long and vice versa \n\t\t \n\t\t float value4 = 567.78f;\n\t\t double value5 ;\n\t\t value5 = value4 ; // works fine since assigning smaller type to larger type\n\t\t System.out.println(value5);\n\t\t value4 = value5 ; // trying longer to smaller w/o casting which is not possible;\n\t\t \n\t\t // Also we can explicit cast for storing larger (double) to long/int/short\n\t\t double value6 = 3564.8;\n\t\t int value7 ;\n\t\t \n\t\t value7 = (int) value6;\n\t\t System.out.println(value7);\n\t\t \n\t\t \n\t\t \n\t\t \n\t\t \n\t }", "@Override\n\tpublic void visit(DoubleType n) {\n\t\t\n\t}", "private void functionalInterfacesForDoubleIntLong() {\n double d = 1.0;\n DoubleToIntFunction f1 = x -> 1;\n f1.applyAsInt(d);\n\n }", "public interface DoubleType extends NumericType {\n}", "@java.lang.Override\n public double getRealValue() {\n if (typeCase_ == 4) {\n return (java.lang.Double) type_;\n }\n return 0D;\n }", "double getEDouble();", "public boolean isDouble();", "long getNumericField();", "@Test\n public void test_column_type_detection_double() throws SQLException {\n ColumnInfo info = testColumnTypeDetection(\"x\", NodeFactory.createLiteral(\"12.3e4\", XSDDatatype.XSDdouble), true, Types.DOUBLE, Double.class.getCanonicalName());\n Assert.assertEquals(16, info.getScale());\n Assert.assertEquals(16, info.getPrecision());\n Assert.assertTrue(info.isSigned());\n }", "public abstract double read_double();", "public static void main(String[] args) {\ndouble anInt=1234;\nbyte aByte=12;\nshort aShort=12;\nlong aLong=1234567890987654321L;\ndouble anotherInt= (anInt * 10000000);\nSystem.out.println(\"The int is \" + anInt);\nSystem.out.println(\"The byte is \" + aByte);\nSystem.out.println(\"The short is \" + aShort);\nSystem.out.println(\"The long is \" + aLong);\nSystem.out.println(\"Another int is \" + anotherInt); \n\t}", "public abstract Double toDouble(T t);", "default T handleNumber(double val) {\n throw new UnsupportedOperationException();\n }", "public static Double toDouble(Object o,byte type) throws ExecException {\n try {\n switch (type) {\n case BOOLEAN:\n return (Boolean) o ? Double.valueOf(1.0D) : Double.valueOf(0.0D);\n\n case INTEGER:\n return new Double(((Integer)o).doubleValue());\n\n case LONG:\n return new Double(((Long)o).doubleValue());\n\n case FLOAT:\n return new Double(((Float)o).doubleValue());\n\n case DOUBLE:\n return (Double)o;\n\n case DATETIME:\n return new Double(Long.valueOf(((DateTime)o).getMillis()).doubleValue());\n\n case BYTEARRAY:\n return Double.valueOf(((DataByteArray)o).toString());\n\n case CHARARRAY:\n return Double.valueOf((String)o);\n\n case BIGINTEGER:\n return Double.valueOf(((BigInteger)o).doubleValue());\n\n case BIGDECIMAL:\n return Double.valueOf(((BigDecimal)o).doubleValue());\n\n case NULL:\n return null;\n\n case BYTE:\n case MAP:\n case INTERNALMAP:\n case TUPLE:\n case BAG:\n case UNKNOWN:\n default:\n int errCode = 1071;\n String msg = \"Cannot convert a \" + findTypeName(o) +\n \" to a Double\";\n throw new ExecException(msg, errCode, PigException.INPUT);\n }\n } catch (ClassCastException cce) {\n throw cce;\n } catch (ExecException ee) {\n throw ee;\n } catch (NumberFormatException nfe) {\n int errCode = 1074;\n String msg = \"Problem with formatting. Could not convert \" + o + \" to Double.\";\n throw new ExecException(msg, errCode, PigException.INPUT, nfe);\n } catch (Exception e) {\n int errCode = 2054;\n String msg = \"Internal error. Could not convert \" + o + \" to Double.\";\n throw new ExecException(msg, errCode, PigException.BUG);\n }\n }", "private void validate(Adouble val) {\r\n Assertions.assertEquals(val.aonType(), Atype.DOUBLE);\r\n Assertions.assertEquals(val, val);\r\n Assertions.assertEquals(val, Adouble.valueOf(val.toDouble()));\r\n Assertions.assertEquals(val.hashCode(), Adouble.valueOf(val.toDouble()).hashCode());\r\n Assertions.assertTrue(val.isNumber());\r\n }", "public static interface DataTypeWithRatioScale<T> {\r\n \r\n /**\r\n * Add\r\n *\r\n * @param augend\r\n * @param addend\r\n * @return\r\n */\r\n public abstract T add(T augend, T addend);\r\n\r\n /**\r\n * Compare\r\n *\r\n * @param s1\r\n * @param s2\r\n * @return\r\n * @throws NumberFormatException\r\n * @throws ParseException\r\n */\r\n public abstract int compare(String s1, String s2) throws NumberFormatException,\r\n ParseException;\r\n\r\n /**\r\n * Compare\r\n *\r\n * @param t1\r\n * @param t2\r\n * @return\r\n */\r\n public abstract int compare(T t1, T t2);\r\n\r\n /**\r\n * Divide\r\n *\r\n * @param dividend\r\n * @param divisor\r\n * @return\r\n */\r\n public abstract String divide(String dividend, String divisor);\r\n \r\n /**\r\n * Divide\r\n *\r\n * @param dividend\r\n * @param divisor\r\n * @return\r\n */\r\n public abstract T divide(T dividend, T divisor);\r\n \r\n /**\r\n * Format\r\n *\r\n * @param t\r\n * @return\r\n */\r\n public abstract String format(T t);\r\n\r\n /**\r\n * Converts a double into a value.\r\n *\r\n * @param s\r\n * @return\r\n */\r\n public abstract T fromDouble(Double d);\r\n\r\n /**\r\n * Description\r\n *\r\n * @return\r\n */\r\n public abstract DataTypeDescription<T> getDescription();\r\n\r\n /**\r\n * Maximum\r\n *\r\n * @return\r\n */\r\n public T getMaximum();\r\n \r\n /**\r\n * Minimum\r\n *\r\n * @return\r\n */\r\n public T getMinimum();\r\n\r\n /**\r\n * Valid\r\n *\r\n * @param s\r\n * @return\r\n */\r\n public abstract boolean isValid(String s);\r\n\r\n /**\r\n * Multiply\r\n *\r\n * @param multiplicand\r\n * @param multiplicator\r\n * @return\r\n */\r\n public abstract String multiply(String multiplicand,\r\n String multiplicator);\r\n\r\n /**\r\n * Multiply\r\n *\r\n * @param multiplicand\r\n * @param multiplicator\r\n * @return\r\n */\r\n public abstract T multiply(T multiplicand, double multiplicator);\r\n\r\n /**\r\n * Multiply\r\n *\r\n * @param multiplicand\r\n * @param multiplicator\r\n * @return\r\n */\r\n public abstract T multiply(T multiplicand, int multiplicator);\r\n\r\n /**\r\n * Multiply\r\n *\r\n * @param multiplicand\r\n * @param multiplicator\r\n * @return\r\n */\r\n public abstract T multiply(T multiplicand, T multiplicator);\r\n \r\n /**\r\n * Parse\r\n *\r\n * @param s\r\n * @return\r\n */\r\n public abstract T parse(String s);\r\n\r\n /**\r\n * Divide\r\n *\r\n * @param dividend\r\n * @param divisor\r\n * @return\r\n */\r\n public abstract double ratio(T dividend, T divisor);\r\n \r\n /**\r\n * Subtract\r\n *\r\n * @param minuend\r\n * @param subtrahend\r\n * @return\r\n */\r\n public abstract T subtract(T minuend, T subtrahend);\r\n \r\n /**\r\n * Converts a double into a value.\r\n *\r\n * @param s\r\n * @return\r\n */\r\n public abstract Double toDouble(T t);\r\n }", "public abstract T fromDouble(Double d);", "public double getRealValue() {\n if (typeCase_ == 4) {\n return (java.lang.Double) type_;\n }\n return 0D;\n }", "Double getDoubleValue();", "double getRealValue();", "private double convertToDbl(Object a) {\n double result = 0;\n\n //If the object is a Character...\n if(a instanceof Character){\n char x = (Character)a;\n result = (double)(x - '0'); // -'0' as it will convert the ascii number (e.g 4 is 52 in ascii) to the standard number\n }\n\n //If it is a Double...\n else if(a instanceof Double){\n result = (Double)a;\n }\n\n return result;\n }", "public boolean isDouble() {\n return this.data instanceof Double;\n }", "public abstract double getasDouble(int tuple, int val);", "public boolean isDouble() {\n return false;\n }", "@Override\n public Double value(TypeOfValue value);", "public abstract double readAsDbl(int offset);", "double readDouble()\n throws IOException {\n return Double.longBitsToDouble( readLong() );\n }", "public abstract Double getDataValue();", "private static int m6082a(Class<?> cls) {\n if (cls == Double.TYPE) {\n return 1;\n }\n if (cls == Float.TYPE) {\n return 2;\n }\n if (cls == Long.TYPE) {\n return 3;\n }\n if (cls == Integer.TYPE) {\n return 4;\n }\n if (cls == Short.TYPE) {\n return 5;\n }\n if (cls == Character.TYPE) {\n return 6;\n }\n if (cls == Byte.TYPE) {\n return 7;\n }\n if (cls == Boolean.TYPE) {\n return 99;\n }\n return 8;\n }", "double getDoubleValue2();", "double readDouble();", "Double getValue();", "private static double getLongt() {\n\t\treturn longt;\n\t}", "public double getDouble();", "boolean hasDouble();", "public abstract void writeAsDbl(int offset, double d);", "public boolean realAsDouble() {\n return false;\n }", "public abstract Number getPrimitiveType();", "double getDoubleValue1();", "int getSimpleType() {\n\t\treturn ((type / 1000)) * 1000;\n\t}", "private double readDouble() throws IOException {\n\t\treturn (isBigEndian ? ioReadDouble() : Double.longBitsToDouble(readLELong()));\n\t}", "public static void main(String[] args){\n short num=100;\n int inum=num;\n long lnum=num;\n float fnum=num;\n double dnum=num;\n //When you assign value of one data type to another,\n // the two types might not be compatible with each other.\n // If the data types are compatible,\n // then Java will perform the conversion automatically known as Automatic Type Conversion and\n // if not then they need to be casted or converted explicitly.\n //this happens only when\n //The two data types are compatible.\n //When we assign value of a smaller data type to a bigger data type.(byte<short<int<long<float<double)\n //For Example, in java the numeric data types are compatible with each other\n // but no automatic conversion is supported from numeric type to char or boolean.\n // Also, char and boolean are not compatible with each other.\n System.out.println(\"num is \"+num);\n System.out.println(\"inum is \"+inum);\n System.out.println(\"lnum is \"+lnum);\n System.out.println(\"fnum is \"+fnum);\n System.out.println(\"dnum is \"+dnum);\n\n //Narrowing or Explicit conversion\n dnum=323.142;\n byte bnum=(byte)dnum;//converting bigger data type o smaller data type\n //so explicit conversion is needed\n System.out.println(\"dnum converted to bnum(byte) is \"+bnum);\n\n }", "public static double longToDouble(long l) {\n return (double) l;\n }", "public void testDoubleValue() {\n AtomicLong ai = new AtomicLong();\n assertEquals(0.0d, ai.doubleValue());\n for (long x : VALUES) {\n ai.set(x);\n assertEquals((double)x, ai.doubleValue());\n }\n }", "double getDoubleValue3();", "public static void main(String[] args) {\n // example of type casting\n // it will store the double and store it as an int.\n //by default, java will round down\n\n int a = (int) 0.5;\n System.out.println(a);\n //results will be 0\n\n\n //some primitive data types - byte, short, char, int, long, float, double\n\n // byte a;\n // short b;\n // char c;\n // int d;\n // long e;\n // float f;\n // double g;\n\n //if you were to use int and then store it to double, it will cast to double by default.\n\n //it will work its way down this primitive types data\n\n \n }", "public static void testOfDoubleNumberIsInteger(){\n\t\tSystem.out.println(\"please enter a double number: \");\n\t\tScanner scann=new Scanner(System.in);\n\t\tdouble x=scann.nextDouble();\n\t\tif(x%1==0)\n\t\t\tSystem.out.println(\"The number you have enterd it's not a double \");\n\t\telse\n\t\t\tSystem.out.println(\"The number you have entered it's double\");\n\t}", "private final double get_DOUBLE(int column) {\n if (metadata.isZos()) {\n byte[] bytes = new byte[8];\n dataBuffer_.getBytes(columnDataPosition_[column - 1], bytes);\n return FloatingPoint.getDouble_hex(bytes, 0);\n //return dataBuffer_.getDouble(columnDataPosition_[column - 1]);\n } else {\n return dataBuffer_.getDoubleLE(columnDataPosition_[column - 1]);\n// return FloatingPoint.getDouble(dataBuffer_,\n// columnDataPosition_[column - 1]);\n }\n }", "public static void main(String[] args) {\n\n Integer num1 = 100;\n double num2 = num1;\n System.out.println(num2);\n\n float f = 0.5f;\n Float fl = f;\n System.out.println(fl);\n\n System.out.println(Byte.MAX_VALUE);\n\n // parse method --> converting String value to primitives, returne primitive\n // valueOf --> converting String to Wrapper class, return Wrapper class\n\n String str1 = \"123\";\n int result = Integer.parseInt(str1);\n System.out.println(result+1);\n\n String str2 = \"true\";\n boolean r1 = Boolean.parseBoolean(str2);\n System.out.println(r1);\n\n // parse method not case sencetive\n String str3 = \"FaLse\"; // it is work\n boolean r2 = Boolean.parseBoolean(str3);\n System.out.println(r2);\n\n String s1 = \"100.5\";\n Double c1 = Double.parseDouble(s1);\n System.out.println(c1 + 1); // it is call auto boxing\n Double c2 = Double.valueOf(s1); // this in not auto and not unboxing\n\n System.out.println(c1);\n System.out.println(c2);\n\n String s2 = \"TrUe\";\n Boolean b1 = Boolean.valueOf(s2);\n System.out.println(b1); // no sensetive\n\n Double [] arr = new Double[3];\n System.out.println(Arrays.toString(arr));\n // default value of wrapper class always --> null, null, null\n\n String name = \"string\";\n String name1 = new String(\"string\");\n\n Integer I1 = new Integer(\"123\");\n\n System.out.println(addNum(12,13));\n System.out.println(addNum(15.3,7.4));\n \n }", "public interface Numeric extends DataType {\n}", "@ZenCodeType.Caster\n @ZenCodeType.Method\n default double asDouble() {\n \n return notSupportedCast(BasicTypeID.DOUBLE);\n }", "public native double __doubleMethod( long __swiftObject, double arg );", "int toInt (double val) {\n return (int)val;\n }", "public double castToDoubleValue() {\n throw new IteratorFlowException(\"Cannot call castToDouble on non numeric\");\n }", "@Test\n\tpublic void test_TCM__double_getDoubleValue() {\n\t\tAttribute attr = new Attribute(\"test\", \"11111111111111\");\n\t\ttry {\n\t\t\tassertTrue(\"incorrect double value\", attr.getDoubleValue() == 11111111111111d );\n\n\t\t\tattr.setValue(\"0\");\n\t\t\tassertTrue(\"incorrect double value\", attr.getDoubleValue() == 0 );\n\n\t\t\tattr.setValue(Double.toString(java.lang.Double.MAX_VALUE));\n\t\t\tassertTrue(\"incorrect double value\", attr.getDoubleValue() == java.lang.Double.MAX_VALUE);\n\n\t\t\tattr.setValue(Double.toString(java.lang.Double.MIN_VALUE));\n\t\t\tassertTrue(\"incorrect double value\", attr.getDoubleValue() == java.lang.Double.MIN_VALUE);\n\n\t\t} catch (DataConversionException e) {\n\t\t\tfail(\"couldn't convert boolean value\");\n\t\t}\n\n\t\ttry {\n\t\t\tattr.setValue(\"foo\");\n\t\t\tfail(\"incorrectly returned double from non double value\" + attr.getDoubleValue());\n\n\t\t} catch (DataConversionException e) {\n\t\t\t// Do nothing\n\t\t} catch (Exception e) {\n\t\t\tfail(\"Unexpected exception \" + e.getClass());\n\t\t}\n\n\t}", "public static void main(String[] args)\n {\n double x = 5.3;\n int y = (int)x;\n \n }", "private void ex04(){\n int number;\n number = 1;\n\n double number2;\n number2 = 1.5;\n\n String number3;\n number3 = \"3\";\n\n boolean bool = (number == 1);\n\n myWindow.clearOut();\n myWindow.writeOutLine(number);\n myWindow.writeOutLine(new String(String.valueOf(number))); //int to string\n myWindow.writeOutLine((double) number); //int to double\n myWindow.writeOutLine(bool); //int to boolean\n\n /*\n Java can perform number -> string\n method 1: numberType.toString\n method 2: String.valueOf(int/double/float) //used above in the code\n Java can also perform string -> number\n dataType.parseDatatype() // e.g.: Integer.parseInt()\n\n Java allows this only when the conversion is widening (small -> larger)\n alternatively reports a compile error if the conversion is narrowing\n */\n\n //YOUR CODE ABOVE HERE\n }", "public int getAxisType()\n {\n return DOUBLE;\n }", "private double convertDouble()\n\t{\n\t\tString val = tokens[10];\n\t\tdouble value = 0.0;\n\t\ttry {\n\t\t\tvalue = Double.parseDouble(tokens[10]);\n\t\t}\n\t\tcatch(NumberFormatException e) {\n\t\t\tSystem.err.print(\"\");\n\t\t}\n\t\treturn value;\n\t}", "public static void main(String[] args){\n long money = 500000; //not equal datatype, so implicit type casting\n long money1 = 500000L; //Recommendation\n\n System.out.println(money);\n System.out.println(money1);\n\n //JVM default float is double(8byte)\n //float pi = 3.141592; //compile error, incompatible types\n float PI = 3.141592f; // f or F\n double dd = 152.12331;\n System.out.println(PI);\n System.out.println(dd);\n }", "private Type get_value_type(long xx) {\n Type vt = _values.get(xx);\n assert vt!=null;\n return vt;\n }", "private static native boolean set_0(long nativeObj, int propId, double value);", "public static void main(String[] args) {\n\n\t\tSystem.out.println( \"Min value of Byte :\"+ Byte.MIN_VALUE); \n\t\tSystem.out.println( \"Max value of Byte :\"+ Byte.MAX_VALUE); \n\n\t\tSystem.out.println();\n\t\t\n\t\tSystem.out.println( \"Min value of Short :\"+ Short.MIN_VALUE); \n\t\tSystem.out.println( \"Max value of Short :\"+ Short.MAX_VALUE); \n\n\t\tSystem.out.println();\n\t\t\n\t\tSystem.out.println( \"Min value of Integer :\"+ Integer.MIN_VALUE); \n\t\tSystem.out.println( \"Max value of Integer :\"+ Integer.MAX_VALUE); \n\n\t\tSystem.out.println();\n\t\t\n\t\tSystem.out.println( \"Min value of Long :\"+ Long.MIN_VALUE); \n\t\tSystem.out.println( \"Max value of Long :\"+ Long.MAX_VALUE); \n\n\t\t// l should be at the end of value\n\t\tlong number1 = 9223372036854775807l;\n\t\tSystem.out.println( \"After adding l at end of the long number \" + number1);\n\t\t\n\t\tSystem.out.println();\n\t\t\n\t\t\n\t\t/* *\n\t\t * Decimal Data Types *\n\t\t * \t\t-----------------\t *\n\t\t *\t\t\t\t\t\t\t *\n\t\t*/\n\t\t\n\t\t// 1. float \t\t2. double\n\n\t\tSystem.out.println( \"Min value of float :\"+ Float.MIN_VALUE); \n\t\tSystem.out.println( \"Max value of float :\"+ Float.MAX_VALUE); \n\t\t\n\t\t// f should be at the end of value\n\t\tfloat decimal1 = 32245.12123f;\n\t\t\n\t\tSystem.out.println( \"After adding f at the end of the float\" + decimal1);\n\t\t\n\t\tSystem.out.println();\n\n\t\tSystem.out.println( \"Min value of double :\"+ Double.MIN_VALUE); \n\t\tSystem.out.println( \"Max value of double :\"+ Double.MAX_VALUE); \n\n\t\tSystem.out.println();\n\t\t\n\t\t\n\t\t\n\t\t/* *\n\t\t * Character Data Types *\n\t\t * \t --------------------\t *\n\t\t *\t\t\t\t\t\t\t *\n\t\t*/\n\t\t\n\t\t\n\t\t// 1. char \t\t\t2. String( int 2 bytes)\n\n\t\t// can only contain single letter\n\t\tchar ch = 'a'; \n\t\tSystem.out.println( \"Single character :\"+ ch);\n\t\t\n\t\t// can contain unicode values \n\t\tchar unicode = '\\u0000';\n\t\tSystem.out.println( \"Unicodes are stored but not shown :\"+ unicode);\n\t\t\n\t\t// are stored in int\n\t\tint num = 'a';\n\t\tSystem.out.println( \"character stored in int:\"+num);\n\t\t\n\t\tSystem.out.println();\n\t\t\n\n\t\tString str = \"Hello\" + \" World\";\n\t\tSystem.out.println(str);\n\n\t}", "public static void main(String[] args)\n {\n\n double myDouble = 3.14;\n float myFloat = 3.14f; //Removing the f will cause an error due to lossy conversion\n double yourDouble = myFloat; //Widening/lossless conversions won't raise errors\n }", "public abstract double GetRaw();", "public int getDataType()\n {\n return dtype;\n }", "public Double\n getDoubleValue() \n {\n return ((Double) getValue());\n }", "private Object getTypeObjectPair() throws MathLinkException, NumberRangeException {\n Object result = null;\n int type = this.getInteger();\n if (type % -17 == -15) {\n type = -7 + -17 * (type / -17);\n } else if (type % -17 == -16) {\n type = -8 + -17 * (type / -17);\n }\n switch (type) {\n case -5: {\n result = new Integer(this.getInteger());\n break;\n }\n case -6: {\n result = new Long(this.getLongInteger());\n break;\n }\n case -4: {\n int i = this.getInteger();\n if (i < -32768 || i > 32767) {\n throw new NumberRangeException(i, \"short\");\n }\n result = new Short((short)i);\n break;\n }\n case -2: {\n int i = this.getInteger();\n if (i < -128 || i > 127) {\n throw new NumberRangeException(i, \"byte\");\n }\n result = new Byte((byte)i);\n break;\n }\n case -3: {\n int i = this.getInteger();\n if (i < 0 || i > 65535) {\n throw new NumberRangeException(i, \"char\");\n }\n result = new Character((char)i);\n break;\n }\n case -15: \n case -7: {\n double d = this.getDouble();\n if (d < -3.4028234663852886E38 || d > 3.4028234663852886E38) {\n throw new NumberRangeException(d, \"float\");\n }\n result = new Float((float)d);\n break;\n }\n case -16: \n case -8: {\n result = new Double(this.getDouble());\n break;\n }\n case -9: {\n int tok = this.getType();\n if (tok == 100000) {\n result = this.getObject();\n break;\n }\n result = this.getString();\n if (tok != 35 || !result.equals(\"Null\")) break;\n result = null;\n break;\n }\n case -1: {\n String s = this.getSymbol();\n if (s.equals(\"True\")) {\n result = Boolean.TRUE;\n break;\n }\n result = Boolean.FALSE;\n break;\n }\n case -13: {\n long mark = this.createMark();\n try {\n int tok = this.getNext();\n if (tok == 100000) {\n result = this.getObject();\n break;\n }\n if (tok == 35) {\n result = this.getSymbol();\n if (result.equals(\"Null\")) {\n result = null;\n break;\n }\n this.seekMark(mark);\n result = this.getComplex();\n break;\n }\n this.seekMark(mark);\n result = this.getComplex();\n }\n finally {\n this.destroyMark(mark);\n }\n }\n case -10: {\n long mark = this.createMark();\n try {\n int tok = this.getType();\n if (tok == 100000) {\n result = this.getObject();\n break;\n }\n if (tok == 35) {\n result = this.getSymbol();\n if (result.equals(\"Null\")) {\n result = null;\n break;\n }\n result = new BigInteger((String)result);\n break;\n }\n result = new BigInteger(this.getString());\n }\n finally {\n this.destroyMark(mark);\n }\n }\n case -11: {\n long mark = this.createMark();\n try {\n int tok = this.getType();\n if (tok == 100000) {\n result = this.getObject();\n break;\n }\n if (tok == 35) {\n result = this.getSymbol();\n if (result.equals(\"Null\")) {\n result = null;\n break;\n }\n result = Utils.bigDecimalFromString((String)result);\n break;\n }\n result = Utils.bigDecimalFromString(this.getString());\n }\n finally {\n this.destroyMark(mark);\n }\n }\n case -12: {\n long mark = this.createMark();\n try {\n int tok = this.getNext();\n if (tok == 100000 && (result = this.getObject()) != null) break;\n this.seekMark(mark);\n result = this.getExpr();\n }\n finally {\n this.destroyMark(mark);\n }\n }\n case -14: {\n result = this.getObject();\n break;\n }\n case -10000: {\n break;\n }\n default: {\n int tok = this.getNext();\n result = tok == 100000 || tok == 35 ? this.getObject() : (type > -34 ? this.getArray(type - -17, 1) : (type > -51 ? this.getArray(type - -34, 2) : (type > -68 ? this.getArray(type - -51, 3) : (type > -85 ? this.getArray(type - -68, 4) : this.getArray(type - -85, 5)))));\n }\n }\n return result;\n }", "private static native double get_0(long nativeObj, int propId);", "public double doubleValue() {\r\n return (double) intValue();\r\n }", "public static void isValid(double dbl) throws IllegalArgumentException {\n\t//nothing to do here\n }", "public double asDouble() {\r\n\t\tif (this.what == SCALARTYPE.Integer || this.what == SCALARTYPE.Float) {\r\n\t\t\treturn (new BigDecimal(this.scalar)).doubleValue();\r\n\t\t} else\r\n\t\t\treturn 0; // ritorna un valore di default\r\n\t}", "public static void main(String[] args) {\n\t\tdouble d=10;\n\t\tSystem.out.println(d);\n\t\t\n\t\tint i=(int)10.99;\n\t\tSystem.out.println(i);\n\t\tbyte b=(byte)1243;\n\t\tSystem.out.println(b);\n\t\t\n\n\t}", "double getFloatingPointField();", "@Override\n public Type evaluateType() throws Exception {\n return new IntegerType();\n }", "public abstract double getValue();", "private boolean isNumber(Object o) {\n\t\tif(o instanceof String) return isNumber((String) o);\n\t\telse if(o instanceof Double) return true;\n\t\telse return false;\n\t}", "private static double m6088b(Object obj) {\n Method method = null;\n Object obj2 = obj;\n while (!(obj2 instanceof Number)) {\n if (obj2 instanceof String) {\n return ScriptRuntime.m6309a((String) obj2);\n }\n if (!(obj2 instanceof Scriptable)) {\n try {\n method = obj2.getClass().getMethod(\"doubleValue\");\n } catch (NoSuchMethodException | SecurityException e) {\n }\n if (method != null) {\n try {\n return ((Number) method.invoke(obj2)).doubleValue();\n } catch (IllegalAccessException e2) {\n m6091c(obj2, Double.TYPE);\n } catch (InvocationTargetException e3) {\n m6091c(obj2, Double.TYPE);\n }\n }\n return ScriptRuntime.m6309a(obj2.toString());\n } else if (!(obj2 instanceof Wrapper)) {\n return ScriptRuntime.m6395b(obj2);\n } else {\n obj2 = ((Wrapper) obj2).mo18879a();\n }\n }\n return ((Number) obj2).doubleValue();\n }", "void checkSameDataType(String datatype, String datatype1)\n {\n DefaultTableModel semanticerror = (DefaultTableModel)tblErrorSemantic.getModel();\n if(datatype.equals(datatype1))\n {\n\n }\n else if(datatype.equals(\"INT\") && datatype1.equals(\"FLOAT\"))\n {\n \n }\n else if(datatype.equals(\"FLOAT\") && datatype1.equals(\"INT\"))\n {\n \n }\n else if(datatype1 == null)\n {\n\n }\n else\n {\n semanticerror.addRow(new Object[] {tblLexeme.getModel().getValueAt(tokenPos-2, 0),\"Incompatible Types: \"+datatype1+\" Cannot be converted to \"+datatype, tblLexeme.getModel().getValueAt(tokenPos-2, 2)}); \n } \n datatype = null;\n }", "public long longValue() {\n\t\treturn (long) mDouble;\n\t}", "private void m2248a(double d, String str) {\n this.f2954c = d;\n this.f2955d = (long) d;\n this.f2953b = str;\n this.f2952a = ValueType.doubleValue;\n }", "@Override\n public String getDataType() {\n return getPrimitiveType().name();\n }", "@Override\n public double nextDouble() {\n return super.nextDouble();\n }", "public double getAsDouble(int index) {\n switch (type) {\n case TIFFTag.TIFF_BYTE: case TIFFTag.TIFF_UNDEFINED:\n return ((byte[])data)[index] & 0xff;\n case TIFFTag.TIFF_SBYTE:\n return ((byte[])data)[index];\n case TIFFTag.TIFF_SHORT:\n return ((char[])data)[index] & 0xffff;\n case TIFFTag.TIFF_SSHORT:\n return ((short[])data)[index];\n case TIFFTag.TIFF_SLONG:\n return ((int[])data)[index];\n case TIFFTag.TIFF_LONG: case TIFFTag.TIFF_IFD_POINTER:\n return ((long[])data)[index];\n case TIFFTag.TIFF_FLOAT:\n return ((float[])data)[index];\n case TIFFTag.TIFF_DOUBLE:\n return ((double[])data)[index];\n case TIFFTag.TIFF_SRATIONAL:\n int[] ivalue = getAsSRational(index);\n return (double)ivalue[0]/ivalue[1];\n case TIFFTag.TIFF_RATIONAL:\n long[] lvalue = getAsRational(index);\n return (double)lvalue[0]/lvalue[1];\n case TIFFTag.TIFF_ASCII:\n String s = ((String[])data)[index];\n return Double.parseDouble(s);\n default:\n throw new ClassCastException();\n }\n }", "@Ignore\n @Test(expected = IllegalArgumentException.class)\n public void require_that_illegal_double_throws_exception() throws IOException {\n Slime slime = new Slime();\n Cursor root = slime.setObject();\n root.setString(\"doubleval\", \"invalid\");\n InnerCNode def = new DefParser(\"simpletypes\", new StringReader(StringUtilities.implode(SimpletypesConfig.CONFIG_DEF_SCHEMA, \"\\n\"))).getTree();\n new ConfigFileFormat(def).encode(new ByteArrayOutputStream(), slime);\n }", "private double IntegerParseIn(double Precio) {\n throw new UnsupportedOperationException(\"Not supported yet.\"); //To change body of generated methods, choose Tools | Templates.\n }", "@java.lang.Override\n public long getLongValue() {\n if (typeCase_ == 3) {\n return (java.lang.Long) type_;\n }\n return 0L;\n }", "public abstract double[] getasDouble(int tuple);", "double getValue();", "double getValue();", "double getValue();", "public static double leerDouble() {\n\t\tthrow new UnsupportedOperationException();\n\t}", "public OCFloat(OCInteger lenType)\r\n {\r\n super(lenType);\r\n setLength(4);\r\n }", "void mo130799a(double d);", "public static double datodouble(){\n try {\n Double f=new Double(dato());\n return(f.doubleValue());\n } catch (NumberFormatException error) {\n return(Double.NaN);\n }\n }", "private TsPrimitiveType readOneValue() {\n switch (dataType) {\n case BOOLEAN:\n return new TsBoolean(valueDecoder.readBoolean(valueInputStream));\n case INT32:\n return new TsInt(valueDecoder.readInt(valueInputStream));\n case INT64:\n return new TsLong(valueDecoder.readLong(valueInputStream));\n case FLOAT:\n return new TsFloat(valueDecoder.readFloat(valueInputStream));\n case DOUBLE:\n return new TsDouble(valueDecoder.readDouble(valueInputStream));\n case TEXT:\n return new TsBinary(valueDecoder.readBinary(valueInputStream));\n default:\n break;\n }\n throw new UnSupportedDataTypeException(\"Unsupported data type :\" + dataType);\n }", "int getDataTypeValue();", "public static double isDouble() {\n\t\twhile (true) {\n\t\t\ttry {\n\t\t\t\treturn input.nextDouble();\n\t\t\t} catch (InputMismatchException e) {\n\t\t\t\tinput.next();\n\t\t\t\tSystem.out.println(\"Vas unos nije odgovarajuci. Probajte ponovo: \");\n\t\t\t}\n\t\t}\n\t}", "void writeDouble(double value);", "@Override\n\tpublic Type getType() {\n\t\treturn Type.FLOAT;\n\t}" ]
[ "0.66770065", "0.63548017", "0.6348221", "0.6342794", "0.6286748", "0.6286562", "0.62415045", "0.62285113", "0.6176737", "0.61717606", "0.60764956", "0.60742694", "0.6066293", "0.6032801", "0.60286814", "0.6025049", "0.601542", "0.5959509", "0.59377545", "0.59002924", "0.5898876", "0.58972657", "0.58942175", "0.58928376", "0.5890025", "0.5873796", "0.58692664", "0.58477724", "0.58214265", "0.5804629", "0.57761407", "0.57657284", "0.5718842", "0.5710443", "0.56878364", "0.568356", "0.5680416", "0.5666828", "0.56609714", "0.5641718", "0.5640917", "0.5633694", "0.5608703", "0.56061804", "0.56019515", "0.5595205", "0.5578014", "0.5568802", "0.5529873", "0.55279505", "0.5524837", "0.5515821", "0.5509604", "0.5501653", "0.5497232", "0.549532", "0.5495134", "0.5486931", "0.54703414", "0.5466086", "0.54644877", "0.54643434", "0.5463716", "0.54481673", "0.5445194", "0.5442178", "0.5441387", "0.5441341", "0.54276496", "0.54275256", "0.5420042", "0.5417336", "0.5409133", "0.54077333", "0.540576", "0.5402641", "0.5395491", "0.5382886", "0.5371896", "0.53703064", "0.53614116", "0.53531736", "0.5352584", "0.53459674", "0.53457373", "0.5343557", "0.5335971", "0.5335881", "0.5332064", "0.5320062", "0.5320062", "0.5320062", "0.5316006", "0.530932", "0.5305781", "0.530556", "0.53034633", "0.52949995", "0.5286672", "0.5277252", "0.5266497" ]
0.0
-1
there will be issue when the type is double/int/long
protected void setCode(UiAction uiAction, ResultSet rs, int rowNumber) throws SQLException{ String code = rs.getString(UiActionTable.COLUMN_CODE); if(code == null){ //do nothing when nothing found in database return; } uiAction.setCode(code); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\n public Class getValueType() {\n return Double.class;\n }", "public static void main(String args[]) {\n\t\t \n\t\t // lets define some variables and try to insert other data type value\n\t\t int x = 23;\n\t\t double y ;\n\t\t y = x ; // here we are storing int to double ie. smaller to larger . So no error\n\t\t System.out.println(y);\n\t\t System.out.println(x);\n\t\t \n\t\t double a = 25.28;\n\t\t int b ;\n\t\t //b = a; // Here we can see error since we are trying to store double to int i.e larger to smaller w/o casting\n\t\t \n\t\t // lets do casting and store \n\t\t b = (int) a;\n\t\t System.out.println(b);\n\t\t \n\t\t boolean bool = true ;\n\t\t int num = bool; // not possible as we know boolean data type cannot be typecast;\n\t\t \n\t\t //int to long\n\t\t int value = 34;\n\t\t long value1 ;\n\t\t \n\t\t value1 = value;\n\t\t System.out.println(value1);\n\t\t value = value1; // trying longer to smaller w/o casting which is not possible;\n\t\t System.out.println(value);\n\t\t \n\t\t value = (int) value1;\n\t\t \n\t\t // long to float \n\t\t \n\t\t long value2 = 678;\n\t\t float value3; \n\t\t value3 = value2; // works fine since smaller to larger\n\t\t System.out.println(value3);\n\t\t value2 = value3 ; // trying longer to smaller w/o casting which is not possible;\n\t\t \n\t\t // so to assign value3 to value2 we need Explicitly type cast\n\t\t value2 = (long) value3;\n\t\t \n\t\t // float to long and vice versa \n\t\t \n\t\t float value4 = 567.78f;\n\t\t double value5 ;\n\t\t value5 = value4 ; // works fine since assigning smaller type to larger type\n\t\t System.out.println(value5);\n\t\t value4 = value5 ; // trying longer to smaller w/o casting which is not possible;\n\t\t \n\t\t // Also we can explicit cast for storing larger (double) to long/int/short\n\t\t double value6 = 3564.8;\n\t\t int value7 ;\n\t\t \n\t\t value7 = (int) value6;\n\t\t System.out.println(value7);\n\t\t \n\t\t \n\t\t \n\t\t \n\t\t \n\t }", "@Override\n\tpublic void visit(DoubleType n) {\n\t\t\n\t}", "private void functionalInterfacesForDoubleIntLong() {\n double d = 1.0;\n DoubleToIntFunction f1 = x -> 1;\n f1.applyAsInt(d);\n\n }", "public interface DoubleType extends NumericType {\n}", "@java.lang.Override\n public double getRealValue() {\n if (typeCase_ == 4) {\n return (java.lang.Double) type_;\n }\n return 0D;\n }", "double getEDouble();", "public boolean isDouble();", "long getNumericField();", "@Test\n public void test_column_type_detection_double() throws SQLException {\n ColumnInfo info = testColumnTypeDetection(\"x\", NodeFactory.createLiteral(\"12.3e4\", XSDDatatype.XSDdouble), true, Types.DOUBLE, Double.class.getCanonicalName());\n Assert.assertEquals(16, info.getScale());\n Assert.assertEquals(16, info.getPrecision());\n Assert.assertTrue(info.isSigned());\n }", "public abstract double read_double();", "public static void main(String[] args) {\ndouble anInt=1234;\nbyte aByte=12;\nshort aShort=12;\nlong aLong=1234567890987654321L;\ndouble anotherInt= (anInt * 10000000);\nSystem.out.println(\"The int is \" + anInt);\nSystem.out.println(\"The byte is \" + aByte);\nSystem.out.println(\"The short is \" + aShort);\nSystem.out.println(\"The long is \" + aLong);\nSystem.out.println(\"Another int is \" + anotherInt); \n\t}", "public abstract Double toDouble(T t);", "default T handleNumber(double val) {\n throw new UnsupportedOperationException();\n }", "public static Double toDouble(Object o,byte type) throws ExecException {\n try {\n switch (type) {\n case BOOLEAN:\n return (Boolean) o ? Double.valueOf(1.0D) : Double.valueOf(0.0D);\n\n case INTEGER:\n return new Double(((Integer)o).doubleValue());\n\n case LONG:\n return new Double(((Long)o).doubleValue());\n\n case FLOAT:\n return new Double(((Float)o).doubleValue());\n\n case DOUBLE:\n return (Double)o;\n\n case DATETIME:\n return new Double(Long.valueOf(((DateTime)o).getMillis()).doubleValue());\n\n case BYTEARRAY:\n return Double.valueOf(((DataByteArray)o).toString());\n\n case CHARARRAY:\n return Double.valueOf((String)o);\n\n case BIGINTEGER:\n return Double.valueOf(((BigInteger)o).doubleValue());\n\n case BIGDECIMAL:\n return Double.valueOf(((BigDecimal)o).doubleValue());\n\n case NULL:\n return null;\n\n case BYTE:\n case MAP:\n case INTERNALMAP:\n case TUPLE:\n case BAG:\n case UNKNOWN:\n default:\n int errCode = 1071;\n String msg = \"Cannot convert a \" + findTypeName(o) +\n \" to a Double\";\n throw new ExecException(msg, errCode, PigException.INPUT);\n }\n } catch (ClassCastException cce) {\n throw cce;\n } catch (ExecException ee) {\n throw ee;\n } catch (NumberFormatException nfe) {\n int errCode = 1074;\n String msg = \"Problem with formatting. Could not convert \" + o + \" to Double.\";\n throw new ExecException(msg, errCode, PigException.INPUT, nfe);\n } catch (Exception e) {\n int errCode = 2054;\n String msg = \"Internal error. Could not convert \" + o + \" to Double.\";\n throw new ExecException(msg, errCode, PigException.BUG);\n }\n }", "private void validate(Adouble val) {\r\n Assertions.assertEquals(val.aonType(), Atype.DOUBLE);\r\n Assertions.assertEquals(val, val);\r\n Assertions.assertEquals(val, Adouble.valueOf(val.toDouble()));\r\n Assertions.assertEquals(val.hashCode(), Adouble.valueOf(val.toDouble()).hashCode());\r\n Assertions.assertTrue(val.isNumber());\r\n }", "public static interface DataTypeWithRatioScale<T> {\r\n \r\n /**\r\n * Add\r\n *\r\n * @param augend\r\n * @param addend\r\n * @return\r\n */\r\n public abstract T add(T augend, T addend);\r\n\r\n /**\r\n * Compare\r\n *\r\n * @param s1\r\n * @param s2\r\n * @return\r\n * @throws NumberFormatException\r\n * @throws ParseException\r\n */\r\n public abstract int compare(String s1, String s2) throws NumberFormatException,\r\n ParseException;\r\n\r\n /**\r\n * Compare\r\n *\r\n * @param t1\r\n * @param t2\r\n * @return\r\n */\r\n public abstract int compare(T t1, T t2);\r\n\r\n /**\r\n * Divide\r\n *\r\n * @param dividend\r\n * @param divisor\r\n * @return\r\n */\r\n public abstract String divide(String dividend, String divisor);\r\n \r\n /**\r\n * Divide\r\n *\r\n * @param dividend\r\n * @param divisor\r\n * @return\r\n */\r\n public abstract T divide(T dividend, T divisor);\r\n \r\n /**\r\n * Format\r\n *\r\n * @param t\r\n * @return\r\n */\r\n public abstract String format(T t);\r\n\r\n /**\r\n * Converts a double into a value.\r\n *\r\n * @param s\r\n * @return\r\n */\r\n public abstract T fromDouble(Double d);\r\n\r\n /**\r\n * Description\r\n *\r\n * @return\r\n */\r\n public abstract DataTypeDescription<T> getDescription();\r\n\r\n /**\r\n * Maximum\r\n *\r\n * @return\r\n */\r\n public T getMaximum();\r\n \r\n /**\r\n * Minimum\r\n *\r\n * @return\r\n */\r\n public T getMinimum();\r\n\r\n /**\r\n * Valid\r\n *\r\n * @param s\r\n * @return\r\n */\r\n public abstract boolean isValid(String s);\r\n\r\n /**\r\n * Multiply\r\n *\r\n * @param multiplicand\r\n * @param multiplicator\r\n * @return\r\n */\r\n public abstract String multiply(String multiplicand,\r\n String multiplicator);\r\n\r\n /**\r\n * Multiply\r\n *\r\n * @param multiplicand\r\n * @param multiplicator\r\n * @return\r\n */\r\n public abstract T multiply(T multiplicand, double multiplicator);\r\n\r\n /**\r\n * Multiply\r\n *\r\n * @param multiplicand\r\n * @param multiplicator\r\n * @return\r\n */\r\n public abstract T multiply(T multiplicand, int multiplicator);\r\n\r\n /**\r\n * Multiply\r\n *\r\n * @param multiplicand\r\n * @param multiplicator\r\n * @return\r\n */\r\n public abstract T multiply(T multiplicand, T multiplicator);\r\n \r\n /**\r\n * Parse\r\n *\r\n * @param s\r\n * @return\r\n */\r\n public abstract T parse(String s);\r\n\r\n /**\r\n * Divide\r\n *\r\n * @param dividend\r\n * @param divisor\r\n * @return\r\n */\r\n public abstract double ratio(T dividend, T divisor);\r\n \r\n /**\r\n * Subtract\r\n *\r\n * @param minuend\r\n * @param subtrahend\r\n * @return\r\n */\r\n public abstract T subtract(T minuend, T subtrahend);\r\n \r\n /**\r\n * Converts a double into a value.\r\n *\r\n * @param s\r\n * @return\r\n */\r\n public abstract Double toDouble(T t);\r\n }", "public abstract T fromDouble(Double d);", "public double getRealValue() {\n if (typeCase_ == 4) {\n return (java.lang.Double) type_;\n }\n return 0D;\n }", "Double getDoubleValue();", "double getRealValue();", "private double convertToDbl(Object a) {\n double result = 0;\n\n //If the object is a Character...\n if(a instanceof Character){\n char x = (Character)a;\n result = (double)(x - '0'); // -'0' as it will convert the ascii number (e.g 4 is 52 in ascii) to the standard number\n }\n\n //If it is a Double...\n else if(a instanceof Double){\n result = (Double)a;\n }\n\n return result;\n }", "public boolean isDouble() {\n return this.data instanceof Double;\n }", "public abstract double getasDouble(int tuple, int val);", "public boolean isDouble() {\n return false;\n }", "@Override\n public Double value(TypeOfValue value);", "public abstract double readAsDbl(int offset);", "double readDouble()\n throws IOException {\n return Double.longBitsToDouble( readLong() );\n }", "public abstract Double getDataValue();", "private static int m6082a(Class<?> cls) {\n if (cls == Double.TYPE) {\n return 1;\n }\n if (cls == Float.TYPE) {\n return 2;\n }\n if (cls == Long.TYPE) {\n return 3;\n }\n if (cls == Integer.TYPE) {\n return 4;\n }\n if (cls == Short.TYPE) {\n return 5;\n }\n if (cls == Character.TYPE) {\n return 6;\n }\n if (cls == Byte.TYPE) {\n return 7;\n }\n if (cls == Boolean.TYPE) {\n return 99;\n }\n return 8;\n }", "double getDoubleValue2();", "double readDouble();", "Double getValue();", "private static double getLongt() {\n\t\treturn longt;\n\t}", "public double getDouble();", "boolean hasDouble();", "public abstract void writeAsDbl(int offset, double d);", "public boolean realAsDouble() {\n return false;\n }", "public abstract Number getPrimitiveType();", "double getDoubleValue1();", "int getSimpleType() {\n\t\treturn ((type / 1000)) * 1000;\n\t}", "private double readDouble() throws IOException {\n\t\treturn (isBigEndian ? ioReadDouble() : Double.longBitsToDouble(readLELong()));\n\t}", "public static void main(String[] args){\n short num=100;\n int inum=num;\n long lnum=num;\n float fnum=num;\n double dnum=num;\n //When you assign value of one data type to another,\n // the two types might not be compatible with each other.\n // If the data types are compatible,\n // then Java will perform the conversion automatically known as Automatic Type Conversion and\n // if not then they need to be casted or converted explicitly.\n //this happens only when\n //The two data types are compatible.\n //When we assign value of a smaller data type to a bigger data type.(byte<short<int<long<float<double)\n //For Example, in java the numeric data types are compatible with each other\n // but no automatic conversion is supported from numeric type to char or boolean.\n // Also, char and boolean are not compatible with each other.\n System.out.println(\"num is \"+num);\n System.out.println(\"inum is \"+inum);\n System.out.println(\"lnum is \"+lnum);\n System.out.println(\"fnum is \"+fnum);\n System.out.println(\"dnum is \"+dnum);\n\n //Narrowing or Explicit conversion\n dnum=323.142;\n byte bnum=(byte)dnum;//converting bigger data type o smaller data type\n //so explicit conversion is needed\n System.out.println(\"dnum converted to bnum(byte) is \"+bnum);\n\n }", "public static double longToDouble(long l) {\n return (double) l;\n }", "public void testDoubleValue() {\n AtomicLong ai = new AtomicLong();\n assertEquals(0.0d, ai.doubleValue());\n for (long x : VALUES) {\n ai.set(x);\n assertEquals((double)x, ai.doubleValue());\n }\n }", "double getDoubleValue3();", "public static void main(String[] args) {\n // example of type casting\n // it will store the double and store it as an int.\n //by default, java will round down\n\n int a = (int) 0.5;\n System.out.println(a);\n //results will be 0\n\n\n //some primitive data types - byte, short, char, int, long, float, double\n\n // byte a;\n // short b;\n // char c;\n // int d;\n // long e;\n // float f;\n // double g;\n\n //if you were to use int and then store it to double, it will cast to double by default.\n\n //it will work its way down this primitive types data\n\n \n }", "public static void testOfDoubleNumberIsInteger(){\n\t\tSystem.out.println(\"please enter a double number: \");\n\t\tScanner scann=new Scanner(System.in);\n\t\tdouble x=scann.nextDouble();\n\t\tif(x%1==0)\n\t\t\tSystem.out.println(\"The number you have enterd it's not a double \");\n\t\telse\n\t\t\tSystem.out.println(\"The number you have entered it's double\");\n\t}", "private final double get_DOUBLE(int column) {\n if (metadata.isZos()) {\n byte[] bytes = new byte[8];\n dataBuffer_.getBytes(columnDataPosition_[column - 1], bytes);\n return FloatingPoint.getDouble_hex(bytes, 0);\n //return dataBuffer_.getDouble(columnDataPosition_[column - 1]);\n } else {\n return dataBuffer_.getDoubleLE(columnDataPosition_[column - 1]);\n// return FloatingPoint.getDouble(dataBuffer_,\n// columnDataPosition_[column - 1]);\n }\n }", "public static void main(String[] args) {\n\n Integer num1 = 100;\n double num2 = num1;\n System.out.println(num2);\n\n float f = 0.5f;\n Float fl = f;\n System.out.println(fl);\n\n System.out.println(Byte.MAX_VALUE);\n\n // parse method --> converting String value to primitives, returne primitive\n // valueOf --> converting String to Wrapper class, return Wrapper class\n\n String str1 = \"123\";\n int result = Integer.parseInt(str1);\n System.out.println(result+1);\n\n String str2 = \"true\";\n boolean r1 = Boolean.parseBoolean(str2);\n System.out.println(r1);\n\n // parse method not case sencetive\n String str3 = \"FaLse\"; // it is work\n boolean r2 = Boolean.parseBoolean(str3);\n System.out.println(r2);\n\n String s1 = \"100.5\";\n Double c1 = Double.parseDouble(s1);\n System.out.println(c1 + 1); // it is call auto boxing\n Double c2 = Double.valueOf(s1); // this in not auto and not unboxing\n\n System.out.println(c1);\n System.out.println(c2);\n\n String s2 = \"TrUe\";\n Boolean b1 = Boolean.valueOf(s2);\n System.out.println(b1); // no sensetive\n\n Double [] arr = new Double[3];\n System.out.println(Arrays.toString(arr));\n // default value of wrapper class always --> null, null, null\n\n String name = \"string\";\n String name1 = new String(\"string\");\n\n Integer I1 = new Integer(\"123\");\n\n System.out.println(addNum(12,13));\n System.out.println(addNum(15.3,7.4));\n \n }", "public interface Numeric extends DataType {\n}", "@ZenCodeType.Caster\n @ZenCodeType.Method\n default double asDouble() {\n \n return notSupportedCast(BasicTypeID.DOUBLE);\n }", "public native double __doubleMethod( long __swiftObject, double arg );", "int toInt (double val) {\n return (int)val;\n }", "public double castToDoubleValue() {\n throw new IteratorFlowException(\"Cannot call castToDouble on non numeric\");\n }", "@Test\n\tpublic void test_TCM__double_getDoubleValue() {\n\t\tAttribute attr = new Attribute(\"test\", \"11111111111111\");\n\t\ttry {\n\t\t\tassertTrue(\"incorrect double value\", attr.getDoubleValue() == 11111111111111d );\n\n\t\t\tattr.setValue(\"0\");\n\t\t\tassertTrue(\"incorrect double value\", attr.getDoubleValue() == 0 );\n\n\t\t\tattr.setValue(Double.toString(java.lang.Double.MAX_VALUE));\n\t\t\tassertTrue(\"incorrect double value\", attr.getDoubleValue() == java.lang.Double.MAX_VALUE);\n\n\t\t\tattr.setValue(Double.toString(java.lang.Double.MIN_VALUE));\n\t\t\tassertTrue(\"incorrect double value\", attr.getDoubleValue() == java.lang.Double.MIN_VALUE);\n\n\t\t} catch (DataConversionException e) {\n\t\t\tfail(\"couldn't convert boolean value\");\n\t\t}\n\n\t\ttry {\n\t\t\tattr.setValue(\"foo\");\n\t\t\tfail(\"incorrectly returned double from non double value\" + attr.getDoubleValue());\n\n\t\t} catch (DataConversionException e) {\n\t\t\t// Do nothing\n\t\t} catch (Exception e) {\n\t\t\tfail(\"Unexpected exception \" + e.getClass());\n\t\t}\n\n\t}", "public static void main(String[] args)\n {\n double x = 5.3;\n int y = (int)x;\n \n }", "private void ex04(){\n int number;\n number = 1;\n\n double number2;\n number2 = 1.5;\n\n String number3;\n number3 = \"3\";\n\n boolean bool = (number == 1);\n\n myWindow.clearOut();\n myWindow.writeOutLine(number);\n myWindow.writeOutLine(new String(String.valueOf(number))); //int to string\n myWindow.writeOutLine((double) number); //int to double\n myWindow.writeOutLine(bool); //int to boolean\n\n /*\n Java can perform number -> string\n method 1: numberType.toString\n method 2: String.valueOf(int/double/float) //used above in the code\n Java can also perform string -> number\n dataType.parseDatatype() // e.g.: Integer.parseInt()\n\n Java allows this only when the conversion is widening (small -> larger)\n alternatively reports a compile error if the conversion is narrowing\n */\n\n //YOUR CODE ABOVE HERE\n }", "public int getAxisType()\n {\n return DOUBLE;\n }", "private double convertDouble()\n\t{\n\t\tString val = tokens[10];\n\t\tdouble value = 0.0;\n\t\ttry {\n\t\t\tvalue = Double.parseDouble(tokens[10]);\n\t\t}\n\t\tcatch(NumberFormatException e) {\n\t\t\tSystem.err.print(\"\");\n\t\t}\n\t\treturn value;\n\t}", "public static void main(String[] args){\n long money = 500000; //not equal datatype, so implicit type casting\n long money1 = 500000L; //Recommendation\n\n System.out.println(money);\n System.out.println(money1);\n\n //JVM default float is double(8byte)\n //float pi = 3.141592; //compile error, incompatible types\n float PI = 3.141592f; // f or F\n double dd = 152.12331;\n System.out.println(PI);\n System.out.println(dd);\n }", "private Type get_value_type(long xx) {\n Type vt = _values.get(xx);\n assert vt!=null;\n return vt;\n }", "private static native boolean set_0(long nativeObj, int propId, double value);", "public static void main(String[] args) {\n\n\t\tSystem.out.println( \"Min value of Byte :\"+ Byte.MIN_VALUE); \n\t\tSystem.out.println( \"Max value of Byte :\"+ Byte.MAX_VALUE); \n\n\t\tSystem.out.println();\n\t\t\n\t\tSystem.out.println( \"Min value of Short :\"+ Short.MIN_VALUE); \n\t\tSystem.out.println( \"Max value of Short :\"+ Short.MAX_VALUE); \n\n\t\tSystem.out.println();\n\t\t\n\t\tSystem.out.println( \"Min value of Integer :\"+ Integer.MIN_VALUE); \n\t\tSystem.out.println( \"Max value of Integer :\"+ Integer.MAX_VALUE); \n\n\t\tSystem.out.println();\n\t\t\n\t\tSystem.out.println( \"Min value of Long :\"+ Long.MIN_VALUE); \n\t\tSystem.out.println( \"Max value of Long :\"+ Long.MAX_VALUE); \n\n\t\t// l should be at the end of value\n\t\tlong number1 = 9223372036854775807l;\n\t\tSystem.out.println( \"After adding l at end of the long number \" + number1);\n\t\t\n\t\tSystem.out.println();\n\t\t\n\t\t\n\t\t/* *\n\t\t * Decimal Data Types *\n\t\t * \t\t-----------------\t *\n\t\t *\t\t\t\t\t\t\t *\n\t\t*/\n\t\t\n\t\t// 1. float \t\t2. double\n\n\t\tSystem.out.println( \"Min value of float :\"+ Float.MIN_VALUE); \n\t\tSystem.out.println( \"Max value of float :\"+ Float.MAX_VALUE); \n\t\t\n\t\t// f should be at the end of value\n\t\tfloat decimal1 = 32245.12123f;\n\t\t\n\t\tSystem.out.println( \"After adding f at the end of the float\" + decimal1);\n\t\t\n\t\tSystem.out.println();\n\n\t\tSystem.out.println( \"Min value of double :\"+ Double.MIN_VALUE); \n\t\tSystem.out.println( \"Max value of double :\"+ Double.MAX_VALUE); \n\n\t\tSystem.out.println();\n\t\t\n\t\t\n\t\t\n\t\t/* *\n\t\t * Character Data Types *\n\t\t * \t --------------------\t *\n\t\t *\t\t\t\t\t\t\t *\n\t\t*/\n\t\t\n\t\t\n\t\t// 1. char \t\t\t2. String( int 2 bytes)\n\n\t\t// can only contain single letter\n\t\tchar ch = 'a'; \n\t\tSystem.out.println( \"Single character :\"+ ch);\n\t\t\n\t\t// can contain unicode values \n\t\tchar unicode = '\\u0000';\n\t\tSystem.out.println( \"Unicodes are stored but not shown :\"+ unicode);\n\t\t\n\t\t// are stored in int\n\t\tint num = 'a';\n\t\tSystem.out.println( \"character stored in int:\"+num);\n\t\t\n\t\tSystem.out.println();\n\t\t\n\n\t\tString str = \"Hello\" + \" World\";\n\t\tSystem.out.println(str);\n\n\t}", "public static void main(String[] args)\n {\n\n double myDouble = 3.14;\n float myFloat = 3.14f; //Removing the f will cause an error due to lossy conversion\n double yourDouble = myFloat; //Widening/lossless conversions won't raise errors\n }", "public abstract double GetRaw();", "public int getDataType()\n {\n return dtype;\n }", "public Double\n getDoubleValue() \n {\n return ((Double) getValue());\n }", "private Object getTypeObjectPair() throws MathLinkException, NumberRangeException {\n Object result = null;\n int type = this.getInteger();\n if (type % -17 == -15) {\n type = -7 + -17 * (type / -17);\n } else if (type % -17 == -16) {\n type = -8 + -17 * (type / -17);\n }\n switch (type) {\n case -5: {\n result = new Integer(this.getInteger());\n break;\n }\n case -6: {\n result = new Long(this.getLongInteger());\n break;\n }\n case -4: {\n int i = this.getInteger();\n if (i < -32768 || i > 32767) {\n throw new NumberRangeException(i, \"short\");\n }\n result = new Short((short)i);\n break;\n }\n case -2: {\n int i = this.getInteger();\n if (i < -128 || i > 127) {\n throw new NumberRangeException(i, \"byte\");\n }\n result = new Byte((byte)i);\n break;\n }\n case -3: {\n int i = this.getInteger();\n if (i < 0 || i > 65535) {\n throw new NumberRangeException(i, \"char\");\n }\n result = new Character((char)i);\n break;\n }\n case -15: \n case -7: {\n double d = this.getDouble();\n if (d < -3.4028234663852886E38 || d > 3.4028234663852886E38) {\n throw new NumberRangeException(d, \"float\");\n }\n result = new Float((float)d);\n break;\n }\n case -16: \n case -8: {\n result = new Double(this.getDouble());\n break;\n }\n case -9: {\n int tok = this.getType();\n if (tok == 100000) {\n result = this.getObject();\n break;\n }\n result = this.getString();\n if (tok != 35 || !result.equals(\"Null\")) break;\n result = null;\n break;\n }\n case -1: {\n String s = this.getSymbol();\n if (s.equals(\"True\")) {\n result = Boolean.TRUE;\n break;\n }\n result = Boolean.FALSE;\n break;\n }\n case -13: {\n long mark = this.createMark();\n try {\n int tok = this.getNext();\n if (tok == 100000) {\n result = this.getObject();\n break;\n }\n if (tok == 35) {\n result = this.getSymbol();\n if (result.equals(\"Null\")) {\n result = null;\n break;\n }\n this.seekMark(mark);\n result = this.getComplex();\n break;\n }\n this.seekMark(mark);\n result = this.getComplex();\n }\n finally {\n this.destroyMark(mark);\n }\n }\n case -10: {\n long mark = this.createMark();\n try {\n int tok = this.getType();\n if (tok == 100000) {\n result = this.getObject();\n break;\n }\n if (tok == 35) {\n result = this.getSymbol();\n if (result.equals(\"Null\")) {\n result = null;\n break;\n }\n result = new BigInteger((String)result);\n break;\n }\n result = new BigInteger(this.getString());\n }\n finally {\n this.destroyMark(mark);\n }\n }\n case -11: {\n long mark = this.createMark();\n try {\n int tok = this.getType();\n if (tok == 100000) {\n result = this.getObject();\n break;\n }\n if (tok == 35) {\n result = this.getSymbol();\n if (result.equals(\"Null\")) {\n result = null;\n break;\n }\n result = Utils.bigDecimalFromString((String)result);\n break;\n }\n result = Utils.bigDecimalFromString(this.getString());\n }\n finally {\n this.destroyMark(mark);\n }\n }\n case -12: {\n long mark = this.createMark();\n try {\n int tok = this.getNext();\n if (tok == 100000 && (result = this.getObject()) != null) break;\n this.seekMark(mark);\n result = this.getExpr();\n }\n finally {\n this.destroyMark(mark);\n }\n }\n case -14: {\n result = this.getObject();\n break;\n }\n case -10000: {\n break;\n }\n default: {\n int tok = this.getNext();\n result = tok == 100000 || tok == 35 ? this.getObject() : (type > -34 ? this.getArray(type - -17, 1) : (type > -51 ? this.getArray(type - -34, 2) : (type > -68 ? this.getArray(type - -51, 3) : (type > -85 ? this.getArray(type - -68, 4) : this.getArray(type - -85, 5)))));\n }\n }\n return result;\n }", "private static native double get_0(long nativeObj, int propId);", "public double doubleValue() {\r\n return (double) intValue();\r\n }", "public static void isValid(double dbl) throws IllegalArgumentException {\n\t//nothing to do here\n }", "public double asDouble() {\r\n\t\tif (this.what == SCALARTYPE.Integer || this.what == SCALARTYPE.Float) {\r\n\t\t\treturn (new BigDecimal(this.scalar)).doubleValue();\r\n\t\t} else\r\n\t\t\treturn 0; // ritorna un valore di default\r\n\t}", "public static void main(String[] args) {\n\t\tdouble d=10;\n\t\tSystem.out.println(d);\n\t\t\n\t\tint i=(int)10.99;\n\t\tSystem.out.println(i);\n\t\tbyte b=(byte)1243;\n\t\tSystem.out.println(b);\n\t\t\n\n\t}", "double getFloatingPointField();", "@Override\n public Type evaluateType() throws Exception {\n return new IntegerType();\n }", "public abstract double getValue();", "private boolean isNumber(Object o) {\n\t\tif(o instanceof String) return isNumber((String) o);\n\t\telse if(o instanceof Double) return true;\n\t\telse return false;\n\t}", "private static double m6088b(Object obj) {\n Method method = null;\n Object obj2 = obj;\n while (!(obj2 instanceof Number)) {\n if (obj2 instanceof String) {\n return ScriptRuntime.m6309a((String) obj2);\n }\n if (!(obj2 instanceof Scriptable)) {\n try {\n method = obj2.getClass().getMethod(\"doubleValue\");\n } catch (NoSuchMethodException | SecurityException e) {\n }\n if (method != null) {\n try {\n return ((Number) method.invoke(obj2)).doubleValue();\n } catch (IllegalAccessException e2) {\n m6091c(obj2, Double.TYPE);\n } catch (InvocationTargetException e3) {\n m6091c(obj2, Double.TYPE);\n }\n }\n return ScriptRuntime.m6309a(obj2.toString());\n } else if (!(obj2 instanceof Wrapper)) {\n return ScriptRuntime.m6395b(obj2);\n } else {\n obj2 = ((Wrapper) obj2).mo18879a();\n }\n }\n return ((Number) obj2).doubleValue();\n }", "void checkSameDataType(String datatype, String datatype1)\n {\n DefaultTableModel semanticerror = (DefaultTableModel)tblErrorSemantic.getModel();\n if(datatype.equals(datatype1))\n {\n\n }\n else if(datatype.equals(\"INT\") && datatype1.equals(\"FLOAT\"))\n {\n \n }\n else if(datatype.equals(\"FLOAT\") && datatype1.equals(\"INT\"))\n {\n \n }\n else if(datatype1 == null)\n {\n\n }\n else\n {\n semanticerror.addRow(new Object[] {tblLexeme.getModel().getValueAt(tokenPos-2, 0),\"Incompatible Types: \"+datatype1+\" Cannot be converted to \"+datatype, tblLexeme.getModel().getValueAt(tokenPos-2, 2)}); \n } \n datatype = null;\n }", "public long longValue() {\n\t\treturn (long) mDouble;\n\t}", "private void m2248a(double d, String str) {\n this.f2954c = d;\n this.f2955d = (long) d;\n this.f2953b = str;\n this.f2952a = ValueType.doubleValue;\n }", "@Override\n public String getDataType() {\n return getPrimitiveType().name();\n }", "@Override\n public double nextDouble() {\n return super.nextDouble();\n }", "public double getAsDouble(int index) {\n switch (type) {\n case TIFFTag.TIFF_BYTE: case TIFFTag.TIFF_UNDEFINED:\n return ((byte[])data)[index] & 0xff;\n case TIFFTag.TIFF_SBYTE:\n return ((byte[])data)[index];\n case TIFFTag.TIFF_SHORT:\n return ((char[])data)[index] & 0xffff;\n case TIFFTag.TIFF_SSHORT:\n return ((short[])data)[index];\n case TIFFTag.TIFF_SLONG:\n return ((int[])data)[index];\n case TIFFTag.TIFF_LONG: case TIFFTag.TIFF_IFD_POINTER:\n return ((long[])data)[index];\n case TIFFTag.TIFF_FLOAT:\n return ((float[])data)[index];\n case TIFFTag.TIFF_DOUBLE:\n return ((double[])data)[index];\n case TIFFTag.TIFF_SRATIONAL:\n int[] ivalue = getAsSRational(index);\n return (double)ivalue[0]/ivalue[1];\n case TIFFTag.TIFF_RATIONAL:\n long[] lvalue = getAsRational(index);\n return (double)lvalue[0]/lvalue[1];\n case TIFFTag.TIFF_ASCII:\n String s = ((String[])data)[index];\n return Double.parseDouble(s);\n default:\n throw new ClassCastException();\n }\n }", "@Ignore\n @Test(expected = IllegalArgumentException.class)\n public void require_that_illegal_double_throws_exception() throws IOException {\n Slime slime = new Slime();\n Cursor root = slime.setObject();\n root.setString(\"doubleval\", \"invalid\");\n InnerCNode def = new DefParser(\"simpletypes\", new StringReader(StringUtilities.implode(SimpletypesConfig.CONFIG_DEF_SCHEMA, \"\\n\"))).getTree();\n new ConfigFileFormat(def).encode(new ByteArrayOutputStream(), slime);\n }", "private double IntegerParseIn(double Precio) {\n throw new UnsupportedOperationException(\"Not supported yet.\"); //To change body of generated methods, choose Tools | Templates.\n }", "@java.lang.Override\n public long getLongValue() {\n if (typeCase_ == 3) {\n return (java.lang.Long) type_;\n }\n return 0L;\n }", "public abstract double[] getasDouble(int tuple);", "double getValue();", "double getValue();", "double getValue();", "public static double leerDouble() {\n\t\tthrow new UnsupportedOperationException();\n\t}", "public OCFloat(OCInteger lenType)\r\n {\r\n super(lenType);\r\n setLength(4);\r\n }", "void mo130799a(double d);", "public static double datodouble(){\n try {\n Double f=new Double(dato());\n return(f.doubleValue());\n } catch (NumberFormatException error) {\n return(Double.NaN);\n }\n }", "private TsPrimitiveType readOneValue() {\n switch (dataType) {\n case BOOLEAN:\n return new TsBoolean(valueDecoder.readBoolean(valueInputStream));\n case INT32:\n return new TsInt(valueDecoder.readInt(valueInputStream));\n case INT64:\n return new TsLong(valueDecoder.readLong(valueInputStream));\n case FLOAT:\n return new TsFloat(valueDecoder.readFloat(valueInputStream));\n case DOUBLE:\n return new TsDouble(valueDecoder.readDouble(valueInputStream));\n case TEXT:\n return new TsBinary(valueDecoder.readBinary(valueInputStream));\n default:\n break;\n }\n throw new UnSupportedDataTypeException(\"Unsupported data type :\" + dataType);\n }", "int getDataTypeValue();", "public static double isDouble() {\n\t\twhile (true) {\n\t\t\ttry {\n\t\t\t\treturn input.nextDouble();\n\t\t\t} catch (InputMismatchException e) {\n\t\t\t\tinput.next();\n\t\t\t\tSystem.out.println(\"Vas unos nije odgovarajuci. Probajte ponovo: \");\n\t\t\t}\n\t\t}\n\t}", "void writeDouble(double value);", "@Override\n\tpublic Type getType() {\n\t\treturn Type.FLOAT;\n\t}" ]
[ "0.66770065", "0.63548017", "0.6348221", "0.6342794", "0.6286748", "0.6286562", "0.62415045", "0.62285113", "0.6176737", "0.61717606", "0.60764956", "0.60742694", "0.6066293", "0.6032801", "0.60286814", "0.6025049", "0.601542", "0.5959509", "0.59377545", "0.59002924", "0.5898876", "0.58972657", "0.58942175", "0.58928376", "0.5890025", "0.5873796", "0.58692664", "0.58477724", "0.58214265", "0.5804629", "0.57761407", "0.57657284", "0.5718842", "0.5710443", "0.56878364", "0.568356", "0.5680416", "0.5666828", "0.56609714", "0.5641718", "0.5640917", "0.5633694", "0.5608703", "0.56061804", "0.56019515", "0.5595205", "0.5578014", "0.5568802", "0.5529873", "0.55279505", "0.5524837", "0.5515821", "0.5509604", "0.5501653", "0.5497232", "0.549532", "0.5495134", "0.5486931", "0.54703414", "0.5466086", "0.54644877", "0.54643434", "0.5463716", "0.54481673", "0.5445194", "0.5442178", "0.5441387", "0.5441341", "0.54276496", "0.54275256", "0.5420042", "0.5417336", "0.5409133", "0.54077333", "0.540576", "0.5402641", "0.5395491", "0.5382886", "0.5371896", "0.53703064", "0.53614116", "0.53531736", "0.5352584", "0.53459674", "0.53457373", "0.5343557", "0.5335971", "0.5335881", "0.5332064", "0.5320062", "0.5320062", "0.5320062", "0.5316006", "0.530932", "0.5305781", "0.530556", "0.53034633", "0.52949995", "0.5286672", "0.5277252", "0.5266497" ]
0.0
-1
there will be issue when the type is double/int/long
protected void setIcon(UiAction uiAction, ResultSet rs, int rowNumber) throws SQLException{ String icon = rs.getString(UiActionTable.COLUMN_ICON); if(icon == null){ //do nothing when nothing found in database return; } uiAction.setIcon(icon); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\n public Class getValueType() {\n return Double.class;\n }", "public static void main(String args[]) {\n\t\t \n\t\t // lets define some variables and try to insert other data type value\n\t\t int x = 23;\n\t\t double y ;\n\t\t y = x ; // here we are storing int to double ie. smaller to larger . So no error\n\t\t System.out.println(y);\n\t\t System.out.println(x);\n\t\t \n\t\t double a = 25.28;\n\t\t int b ;\n\t\t //b = a; // Here we can see error since we are trying to store double to int i.e larger to smaller w/o casting\n\t\t \n\t\t // lets do casting and store \n\t\t b = (int) a;\n\t\t System.out.println(b);\n\t\t \n\t\t boolean bool = true ;\n\t\t int num = bool; // not possible as we know boolean data type cannot be typecast;\n\t\t \n\t\t //int to long\n\t\t int value = 34;\n\t\t long value1 ;\n\t\t \n\t\t value1 = value;\n\t\t System.out.println(value1);\n\t\t value = value1; // trying longer to smaller w/o casting which is not possible;\n\t\t System.out.println(value);\n\t\t \n\t\t value = (int) value1;\n\t\t \n\t\t // long to float \n\t\t \n\t\t long value2 = 678;\n\t\t float value3; \n\t\t value3 = value2; // works fine since smaller to larger\n\t\t System.out.println(value3);\n\t\t value2 = value3 ; // trying longer to smaller w/o casting which is not possible;\n\t\t \n\t\t // so to assign value3 to value2 we need Explicitly type cast\n\t\t value2 = (long) value3;\n\t\t \n\t\t // float to long and vice versa \n\t\t \n\t\t float value4 = 567.78f;\n\t\t double value5 ;\n\t\t value5 = value4 ; // works fine since assigning smaller type to larger type\n\t\t System.out.println(value5);\n\t\t value4 = value5 ; // trying longer to smaller w/o casting which is not possible;\n\t\t \n\t\t // Also we can explicit cast for storing larger (double) to long/int/short\n\t\t double value6 = 3564.8;\n\t\t int value7 ;\n\t\t \n\t\t value7 = (int) value6;\n\t\t System.out.println(value7);\n\t\t \n\t\t \n\t\t \n\t\t \n\t\t \n\t }", "@Override\n\tpublic void visit(DoubleType n) {\n\t\t\n\t}", "private void functionalInterfacesForDoubleIntLong() {\n double d = 1.0;\n DoubleToIntFunction f1 = x -> 1;\n f1.applyAsInt(d);\n\n }", "@java.lang.Override\n public double getRealValue() {\n if (typeCase_ == 4) {\n return (java.lang.Double) type_;\n }\n return 0D;\n }", "public interface DoubleType extends NumericType {\n}", "double getEDouble();", "public boolean isDouble();", "long getNumericField();", "@Test\n public void test_column_type_detection_double() throws SQLException {\n ColumnInfo info = testColumnTypeDetection(\"x\", NodeFactory.createLiteral(\"12.3e4\", XSDDatatype.XSDdouble), true, Types.DOUBLE, Double.class.getCanonicalName());\n Assert.assertEquals(16, info.getScale());\n Assert.assertEquals(16, info.getPrecision());\n Assert.assertTrue(info.isSigned());\n }", "public abstract double read_double();", "public static void main(String[] args) {\ndouble anInt=1234;\nbyte aByte=12;\nshort aShort=12;\nlong aLong=1234567890987654321L;\ndouble anotherInt= (anInt * 10000000);\nSystem.out.println(\"The int is \" + anInt);\nSystem.out.println(\"The byte is \" + aByte);\nSystem.out.println(\"The short is \" + aShort);\nSystem.out.println(\"The long is \" + aLong);\nSystem.out.println(\"Another int is \" + anotherInt); \n\t}", "public abstract Double toDouble(T t);", "default T handleNumber(double val) {\n throw new UnsupportedOperationException();\n }", "public static Double toDouble(Object o,byte type) throws ExecException {\n try {\n switch (type) {\n case BOOLEAN:\n return (Boolean) o ? Double.valueOf(1.0D) : Double.valueOf(0.0D);\n\n case INTEGER:\n return new Double(((Integer)o).doubleValue());\n\n case LONG:\n return new Double(((Long)o).doubleValue());\n\n case FLOAT:\n return new Double(((Float)o).doubleValue());\n\n case DOUBLE:\n return (Double)o;\n\n case DATETIME:\n return new Double(Long.valueOf(((DateTime)o).getMillis()).doubleValue());\n\n case BYTEARRAY:\n return Double.valueOf(((DataByteArray)o).toString());\n\n case CHARARRAY:\n return Double.valueOf((String)o);\n\n case BIGINTEGER:\n return Double.valueOf(((BigInteger)o).doubleValue());\n\n case BIGDECIMAL:\n return Double.valueOf(((BigDecimal)o).doubleValue());\n\n case NULL:\n return null;\n\n case BYTE:\n case MAP:\n case INTERNALMAP:\n case TUPLE:\n case BAG:\n case UNKNOWN:\n default:\n int errCode = 1071;\n String msg = \"Cannot convert a \" + findTypeName(o) +\n \" to a Double\";\n throw new ExecException(msg, errCode, PigException.INPUT);\n }\n } catch (ClassCastException cce) {\n throw cce;\n } catch (ExecException ee) {\n throw ee;\n } catch (NumberFormatException nfe) {\n int errCode = 1074;\n String msg = \"Problem with formatting. Could not convert \" + o + \" to Double.\";\n throw new ExecException(msg, errCode, PigException.INPUT, nfe);\n } catch (Exception e) {\n int errCode = 2054;\n String msg = \"Internal error. Could not convert \" + o + \" to Double.\";\n throw new ExecException(msg, errCode, PigException.BUG);\n }\n }", "private void validate(Adouble val) {\r\n Assertions.assertEquals(val.aonType(), Atype.DOUBLE);\r\n Assertions.assertEquals(val, val);\r\n Assertions.assertEquals(val, Adouble.valueOf(val.toDouble()));\r\n Assertions.assertEquals(val.hashCode(), Adouble.valueOf(val.toDouble()).hashCode());\r\n Assertions.assertTrue(val.isNumber());\r\n }", "public static interface DataTypeWithRatioScale<T> {\r\n \r\n /**\r\n * Add\r\n *\r\n * @param augend\r\n * @param addend\r\n * @return\r\n */\r\n public abstract T add(T augend, T addend);\r\n\r\n /**\r\n * Compare\r\n *\r\n * @param s1\r\n * @param s2\r\n * @return\r\n * @throws NumberFormatException\r\n * @throws ParseException\r\n */\r\n public abstract int compare(String s1, String s2) throws NumberFormatException,\r\n ParseException;\r\n\r\n /**\r\n * Compare\r\n *\r\n * @param t1\r\n * @param t2\r\n * @return\r\n */\r\n public abstract int compare(T t1, T t2);\r\n\r\n /**\r\n * Divide\r\n *\r\n * @param dividend\r\n * @param divisor\r\n * @return\r\n */\r\n public abstract String divide(String dividend, String divisor);\r\n \r\n /**\r\n * Divide\r\n *\r\n * @param dividend\r\n * @param divisor\r\n * @return\r\n */\r\n public abstract T divide(T dividend, T divisor);\r\n \r\n /**\r\n * Format\r\n *\r\n * @param t\r\n * @return\r\n */\r\n public abstract String format(T t);\r\n\r\n /**\r\n * Converts a double into a value.\r\n *\r\n * @param s\r\n * @return\r\n */\r\n public abstract T fromDouble(Double d);\r\n\r\n /**\r\n * Description\r\n *\r\n * @return\r\n */\r\n public abstract DataTypeDescription<T> getDescription();\r\n\r\n /**\r\n * Maximum\r\n *\r\n * @return\r\n */\r\n public T getMaximum();\r\n \r\n /**\r\n * Minimum\r\n *\r\n * @return\r\n */\r\n public T getMinimum();\r\n\r\n /**\r\n * Valid\r\n *\r\n * @param s\r\n * @return\r\n */\r\n public abstract boolean isValid(String s);\r\n\r\n /**\r\n * Multiply\r\n *\r\n * @param multiplicand\r\n * @param multiplicator\r\n * @return\r\n */\r\n public abstract String multiply(String multiplicand,\r\n String multiplicator);\r\n\r\n /**\r\n * Multiply\r\n *\r\n * @param multiplicand\r\n * @param multiplicator\r\n * @return\r\n */\r\n public abstract T multiply(T multiplicand, double multiplicator);\r\n\r\n /**\r\n * Multiply\r\n *\r\n * @param multiplicand\r\n * @param multiplicator\r\n * @return\r\n */\r\n public abstract T multiply(T multiplicand, int multiplicator);\r\n\r\n /**\r\n * Multiply\r\n *\r\n * @param multiplicand\r\n * @param multiplicator\r\n * @return\r\n */\r\n public abstract T multiply(T multiplicand, T multiplicator);\r\n \r\n /**\r\n * Parse\r\n *\r\n * @param s\r\n * @return\r\n */\r\n public abstract T parse(String s);\r\n\r\n /**\r\n * Divide\r\n *\r\n * @param dividend\r\n * @param divisor\r\n * @return\r\n */\r\n public abstract double ratio(T dividend, T divisor);\r\n \r\n /**\r\n * Subtract\r\n *\r\n * @param minuend\r\n * @param subtrahend\r\n * @return\r\n */\r\n public abstract T subtract(T minuend, T subtrahend);\r\n \r\n /**\r\n * Converts a double into a value.\r\n *\r\n * @param s\r\n * @return\r\n */\r\n public abstract Double toDouble(T t);\r\n }", "public abstract T fromDouble(Double d);", "public double getRealValue() {\n if (typeCase_ == 4) {\n return (java.lang.Double) type_;\n }\n return 0D;\n }", "Double getDoubleValue();", "double getRealValue();", "private double convertToDbl(Object a) {\n double result = 0;\n\n //If the object is a Character...\n if(a instanceof Character){\n char x = (Character)a;\n result = (double)(x - '0'); // -'0' as it will convert the ascii number (e.g 4 is 52 in ascii) to the standard number\n }\n\n //If it is a Double...\n else if(a instanceof Double){\n result = (Double)a;\n }\n\n return result;\n }", "public boolean isDouble() {\n return this.data instanceof Double;\n }", "public abstract double getasDouble(int tuple, int val);", "public boolean isDouble() {\n return false;\n }", "@Override\n public Double value(TypeOfValue value);", "public abstract double readAsDbl(int offset);", "double readDouble()\n throws IOException {\n return Double.longBitsToDouble( readLong() );\n }", "public abstract Double getDataValue();", "private static int m6082a(Class<?> cls) {\n if (cls == Double.TYPE) {\n return 1;\n }\n if (cls == Float.TYPE) {\n return 2;\n }\n if (cls == Long.TYPE) {\n return 3;\n }\n if (cls == Integer.TYPE) {\n return 4;\n }\n if (cls == Short.TYPE) {\n return 5;\n }\n if (cls == Character.TYPE) {\n return 6;\n }\n if (cls == Byte.TYPE) {\n return 7;\n }\n if (cls == Boolean.TYPE) {\n return 99;\n }\n return 8;\n }", "double getDoubleValue2();", "double readDouble();", "Double getValue();", "private static double getLongt() {\n\t\treturn longt;\n\t}", "public double getDouble();", "boolean hasDouble();", "public abstract void writeAsDbl(int offset, double d);", "public boolean realAsDouble() {\n return false;\n }", "public abstract Number getPrimitiveType();", "double getDoubleValue1();", "int getSimpleType() {\n\t\treturn ((type / 1000)) * 1000;\n\t}", "private double readDouble() throws IOException {\n\t\treturn (isBigEndian ? ioReadDouble() : Double.longBitsToDouble(readLELong()));\n\t}", "public static void main(String[] args){\n short num=100;\n int inum=num;\n long lnum=num;\n float fnum=num;\n double dnum=num;\n //When you assign value of one data type to another,\n // the two types might not be compatible with each other.\n // If the data types are compatible,\n // then Java will perform the conversion automatically known as Automatic Type Conversion and\n // if not then they need to be casted or converted explicitly.\n //this happens only when\n //The two data types are compatible.\n //When we assign value of a smaller data type to a bigger data type.(byte<short<int<long<float<double)\n //For Example, in java the numeric data types are compatible with each other\n // but no automatic conversion is supported from numeric type to char or boolean.\n // Also, char and boolean are not compatible with each other.\n System.out.println(\"num is \"+num);\n System.out.println(\"inum is \"+inum);\n System.out.println(\"lnum is \"+lnum);\n System.out.println(\"fnum is \"+fnum);\n System.out.println(\"dnum is \"+dnum);\n\n //Narrowing or Explicit conversion\n dnum=323.142;\n byte bnum=(byte)dnum;//converting bigger data type o smaller data type\n //so explicit conversion is needed\n System.out.println(\"dnum converted to bnum(byte) is \"+bnum);\n\n }", "public static double longToDouble(long l) {\n return (double) l;\n }", "public void testDoubleValue() {\n AtomicLong ai = new AtomicLong();\n assertEquals(0.0d, ai.doubleValue());\n for (long x : VALUES) {\n ai.set(x);\n assertEquals((double)x, ai.doubleValue());\n }\n }", "double getDoubleValue3();", "public static void main(String[] args) {\n // example of type casting\n // it will store the double and store it as an int.\n //by default, java will round down\n\n int a = (int) 0.5;\n System.out.println(a);\n //results will be 0\n\n\n //some primitive data types - byte, short, char, int, long, float, double\n\n // byte a;\n // short b;\n // char c;\n // int d;\n // long e;\n // float f;\n // double g;\n\n //if you were to use int and then store it to double, it will cast to double by default.\n\n //it will work its way down this primitive types data\n\n \n }", "public static void testOfDoubleNumberIsInteger(){\n\t\tSystem.out.println(\"please enter a double number: \");\n\t\tScanner scann=new Scanner(System.in);\n\t\tdouble x=scann.nextDouble();\n\t\tif(x%1==0)\n\t\t\tSystem.out.println(\"The number you have enterd it's not a double \");\n\t\telse\n\t\t\tSystem.out.println(\"The number you have entered it's double\");\n\t}", "private final double get_DOUBLE(int column) {\n if (metadata.isZos()) {\n byte[] bytes = new byte[8];\n dataBuffer_.getBytes(columnDataPosition_[column - 1], bytes);\n return FloatingPoint.getDouble_hex(bytes, 0);\n //return dataBuffer_.getDouble(columnDataPosition_[column - 1]);\n } else {\n return dataBuffer_.getDoubleLE(columnDataPosition_[column - 1]);\n// return FloatingPoint.getDouble(dataBuffer_,\n// columnDataPosition_[column - 1]);\n }\n }", "public static void main(String[] args) {\n\n Integer num1 = 100;\n double num2 = num1;\n System.out.println(num2);\n\n float f = 0.5f;\n Float fl = f;\n System.out.println(fl);\n\n System.out.println(Byte.MAX_VALUE);\n\n // parse method --> converting String value to primitives, returne primitive\n // valueOf --> converting String to Wrapper class, return Wrapper class\n\n String str1 = \"123\";\n int result = Integer.parseInt(str1);\n System.out.println(result+1);\n\n String str2 = \"true\";\n boolean r1 = Boolean.parseBoolean(str2);\n System.out.println(r1);\n\n // parse method not case sencetive\n String str3 = \"FaLse\"; // it is work\n boolean r2 = Boolean.parseBoolean(str3);\n System.out.println(r2);\n\n String s1 = \"100.5\";\n Double c1 = Double.parseDouble(s1);\n System.out.println(c1 + 1); // it is call auto boxing\n Double c2 = Double.valueOf(s1); // this in not auto and not unboxing\n\n System.out.println(c1);\n System.out.println(c2);\n\n String s2 = \"TrUe\";\n Boolean b1 = Boolean.valueOf(s2);\n System.out.println(b1); // no sensetive\n\n Double [] arr = new Double[3];\n System.out.println(Arrays.toString(arr));\n // default value of wrapper class always --> null, null, null\n\n String name = \"string\";\n String name1 = new String(\"string\");\n\n Integer I1 = new Integer(\"123\");\n\n System.out.println(addNum(12,13));\n System.out.println(addNum(15.3,7.4));\n \n }", "public interface Numeric extends DataType {\n}", "@ZenCodeType.Caster\n @ZenCodeType.Method\n default double asDouble() {\n \n return notSupportedCast(BasicTypeID.DOUBLE);\n }", "public native double __doubleMethod( long __swiftObject, double arg );", "int toInt (double val) {\n return (int)val;\n }", "public double castToDoubleValue() {\n throw new IteratorFlowException(\"Cannot call castToDouble on non numeric\");\n }", "@Test\n\tpublic void test_TCM__double_getDoubleValue() {\n\t\tAttribute attr = new Attribute(\"test\", \"11111111111111\");\n\t\ttry {\n\t\t\tassertTrue(\"incorrect double value\", attr.getDoubleValue() == 11111111111111d );\n\n\t\t\tattr.setValue(\"0\");\n\t\t\tassertTrue(\"incorrect double value\", attr.getDoubleValue() == 0 );\n\n\t\t\tattr.setValue(Double.toString(java.lang.Double.MAX_VALUE));\n\t\t\tassertTrue(\"incorrect double value\", attr.getDoubleValue() == java.lang.Double.MAX_VALUE);\n\n\t\t\tattr.setValue(Double.toString(java.lang.Double.MIN_VALUE));\n\t\t\tassertTrue(\"incorrect double value\", attr.getDoubleValue() == java.lang.Double.MIN_VALUE);\n\n\t\t} catch (DataConversionException e) {\n\t\t\tfail(\"couldn't convert boolean value\");\n\t\t}\n\n\t\ttry {\n\t\t\tattr.setValue(\"foo\");\n\t\t\tfail(\"incorrectly returned double from non double value\" + attr.getDoubleValue());\n\n\t\t} catch (DataConversionException e) {\n\t\t\t// Do nothing\n\t\t} catch (Exception e) {\n\t\t\tfail(\"Unexpected exception \" + e.getClass());\n\t\t}\n\n\t}", "public static void main(String[] args)\n {\n double x = 5.3;\n int y = (int)x;\n \n }", "private void ex04(){\n int number;\n number = 1;\n\n double number2;\n number2 = 1.5;\n\n String number3;\n number3 = \"3\";\n\n boolean bool = (number == 1);\n\n myWindow.clearOut();\n myWindow.writeOutLine(number);\n myWindow.writeOutLine(new String(String.valueOf(number))); //int to string\n myWindow.writeOutLine((double) number); //int to double\n myWindow.writeOutLine(bool); //int to boolean\n\n /*\n Java can perform number -> string\n method 1: numberType.toString\n method 2: String.valueOf(int/double/float) //used above in the code\n Java can also perform string -> number\n dataType.parseDatatype() // e.g.: Integer.parseInt()\n\n Java allows this only when the conversion is widening (small -> larger)\n alternatively reports a compile error if the conversion is narrowing\n */\n\n //YOUR CODE ABOVE HERE\n }", "public int getAxisType()\n {\n return DOUBLE;\n }", "private double convertDouble()\n\t{\n\t\tString val = tokens[10];\n\t\tdouble value = 0.0;\n\t\ttry {\n\t\t\tvalue = Double.parseDouble(tokens[10]);\n\t\t}\n\t\tcatch(NumberFormatException e) {\n\t\t\tSystem.err.print(\"\");\n\t\t}\n\t\treturn value;\n\t}", "private static native boolean set_0(long nativeObj, int propId, double value);", "private Type get_value_type(long xx) {\n Type vt = _values.get(xx);\n assert vt!=null;\n return vt;\n }", "public static void main(String[] args){\n long money = 500000; //not equal datatype, so implicit type casting\n long money1 = 500000L; //Recommendation\n\n System.out.println(money);\n System.out.println(money1);\n\n //JVM default float is double(8byte)\n //float pi = 3.141592; //compile error, incompatible types\n float PI = 3.141592f; // f or F\n double dd = 152.12331;\n System.out.println(PI);\n System.out.println(dd);\n }", "public static void main(String[] args) {\n\n\t\tSystem.out.println( \"Min value of Byte :\"+ Byte.MIN_VALUE); \n\t\tSystem.out.println( \"Max value of Byte :\"+ Byte.MAX_VALUE); \n\n\t\tSystem.out.println();\n\t\t\n\t\tSystem.out.println( \"Min value of Short :\"+ Short.MIN_VALUE); \n\t\tSystem.out.println( \"Max value of Short :\"+ Short.MAX_VALUE); \n\n\t\tSystem.out.println();\n\t\t\n\t\tSystem.out.println( \"Min value of Integer :\"+ Integer.MIN_VALUE); \n\t\tSystem.out.println( \"Max value of Integer :\"+ Integer.MAX_VALUE); \n\n\t\tSystem.out.println();\n\t\t\n\t\tSystem.out.println( \"Min value of Long :\"+ Long.MIN_VALUE); \n\t\tSystem.out.println( \"Max value of Long :\"+ Long.MAX_VALUE); \n\n\t\t// l should be at the end of value\n\t\tlong number1 = 9223372036854775807l;\n\t\tSystem.out.println( \"After adding l at end of the long number \" + number1);\n\t\t\n\t\tSystem.out.println();\n\t\t\n\t\t\n\t\t/* *\n\t\t * Decimal Data Types *\n\t\t * \t\t-----------------\t *\n\t\t *\t\t\t\t\t\t\t *\n\t\t*/\n\t\t\n\t\t// 1. float \t\t2. double\n\n\t\tSystem.out.println( \"Min value of float :\"+ Float.MIN_VALUE); \n\t\tSystem.out.println( \"Max value of float :\"+ Float.MAX_VALUE); \n\t\t\n\t\t// f should be at the end of value\n\t\tfloat decimal1 = 32245.12123f;\n\t\t\n\t\tSystem.out.println( \"After adding f at the end of the float\" + decimal1);\n\t\t\n\t\tSystem.out.println();\n\n\t\tSystem.out.println( \"Min value of double :\"+ Double.MIN_VALUE); \n\t\tSystem.out.println( \"Max value of double :\"+ Double.MAX_VALUE); \n\n\t\tSystem.out.println();\n\t\t\n\t\t\n\t\t\n\t\t/* *\n\t\t * Character Data Types *\n\t\t * \t --------------------\t *\n\t\t *\t\t\t\t\t\t\t *\n\t\t*/\n\t\t\n\t\t\n\t\t// 1. char \t\t\t2. String( int 2 bytes)\n\n\t\t// can only contain single letter\n\t\tchar ch = 'a'; \n\t\tSystem.out.println( \"Single character :\"+ ch);\n\t\t\n\t\t// can contain unicode values \n\t\tchar unicode = '\\u0000';\n\t\tSystem.out.println( \"Unicodes are stored but not shown :\"+ unicode);\n\t\t\n\t\t// are stored in int\n\t\tint num = 'a';\n\t\tSystem.out.println( \"character stored in int:\"+num);\n\t\t\n\t\tSystem.out.println();\n\t\t\n\n\t\tString str = \"Hello\" + \" World\";\n\t\tSystem.out.println(str);\n\n\t}", "public static void main(String[] args)\n {\n\n double myDouble = 3.14;\n float myFloat = 3.14f; //Removing the f will cause an error due to lossy conversion\n double yourDouble = myFloat; //Widening/lossless conversions won't raise errors\n }", "public int getDataType()\n {\n return dtype;\n }", "public abstract double GetRaw();", "public Double\n getDoubleValue() \n {\n return ((Double) getValue());\n }", "private static native double get_0(long nativeObj, int propId);", "private Object getTypeObjectPair() throws MathLinkException, NumberRangeException {\n Object result = null;\n int type = this.getInteger();\n if (type % -17 == -15) {\n type = -7 + -17 * (type / -17);\n } else if (type % -17 == -16) {\n type = -8 + -17 * (type / -17);\n }\n switch (type) {\n case -5: {\n result = new Integer(this.getInteger());\n break;\n }\n case -6: {\n result = new Long(this.getLongInteger());\n break;\n }\n case -4: {\n int i = this.getInteger();\n if (i < -32768 || i > 32767) {\n throw new NumberRangeException(i, \"short\");\n }\n result = new Short((short)i);\n break;\n }\n case -2: {\n int i = this.getInteger();\n if (i < -128 || i > 127) {\n throw new NumberRangeException(i, \"byte\");\n }\n result = new Byte((byte)i);\n break;\n }\n case -3: {\n int i = this.getInteger();\n if (i < 0 || i > 65535) {\n throw new NumberRangeException(i, \"char\");\n }\n result = new Character((char)i);\n break;\n }\n case -15: \n case -7: {\n double d = this.getDouble();\n if (d < -3.4028234663852886E38 || d > 3.4028234663852886E38) {\n throw new NumberRangeException(d, \"float\");\n }\n result = new Float((float)d);\n break;\n }\n case -16: \n case -8: {\n result = new Double(this.getDouble());\n break;\n }\n case -9: {\n int tok = this.getType();\n if (tok == 100000) {\n result = this.getObject();\n break;\n }\n result = this.getString();\n if (tok != 35 || !result.equals(\"Null\")) break;\n result = null;\n break;\n }\n case -1: {\n String s = this.getSymbol();\n if (s.equals(\"True\")) {\n result = Boolean.TRUE;\n break;\n }\n result = Boolean.FALSE;\n break;\n }\n case -13: {\n long mark = this.createMark();\n try {\n int tok = this.getNext();\n if (tok == 100000) {\n result = this.getObject();\n break;\n }\n if (tok == 35) {\n result = this.getSymbol();\n if (result.equals(\"Null\")) {\n result = null;\n break;\n }\n this.seekMark(mark);\n result = this.getComplex();\n break;\n }\n this.seekMark(mark);\n result = this.getComplex();\n }\n finally {\n this.destroyMark(mark);\n }\n }\n case -10: {\n long mark = this.createMark();\n try {\n int tok = this.getType();\n if (tok == 100000) {\n result = this.getObject();\n break;\n }\n if (tok == 35) {\n result = this.getSymbol();\n if (result.equals(\"Null\")) {\n result = null;\n break;\n }\n result = new BigInteger((String)result);\n break;\n }\n result = new BigInteger(this.getString());\n }\n finally {\n this.destroyMark(mark);\n }\n }\n case -11: {\n long mark = this.createMark();\n try {\n int tok = this.getType();\n if (tok == 100000) {\n result = this.getObject();\n break;\n }\n if (tok == 35) {\n result = this.getSymbol();\n if (result.equals(\"Null\")) {\n result = null;\n break;\n }\n result = Utils.bigDecimalFromString((String)result);\n break;\n }\n result = Utils.bigDecimalFromString(this.getString());\n }\n finally {\n this.destroyMark(mark);\n }\n }\n case -12: {\n long mark = this.createMark();\n try {\n int tok = this.getNext();\n if (tok == 100000 && (result = this.getObject()) != null) break;\n this.seekMark(mark);\n result = this.getExpr();\n }\n finally {\n this.destroyMark(mark);\n }\n }\n case -14: {\n result = this.getObject();\n break;\n }\n case -10000: {\n break;\n }\n default: {\n int tok = this.getNext();\n result = tok == 100000 || tok == 35 ? this.getObject() : (type > -34 ? this.getArray(type - -17, 1) : (type > -51 ? this.getArray(type - -34, 2) : (type > -68 ? this.getArray(type - -51, 3) : (type > -85 ? this.getArray(type - -68, 4) : this.getArray(type - -85, 5)))));\n }\n }\n return result;\n }", "public double doubleValue() {\r\n return (double) intValue();\r\n }", "public static void isValid(double dbl) throws IllegalArgumentException {\n\t//nothing to do here\n }", "public double asDouble() {\r\n\t\tif (this.what == SCALARTYPE.Integer || this.what == SCALARTYPE.Float) {\r\n\t\t\treturn (new BigDecimal(this.scalar)).doubleValue();\r\n\t\t} else\r\n\t\t\treturn 0; // ritorna un valore di default\r\n\t}", "public static void main(String[] args) {\n\t\tdouble d=10;\n\t\tSystem.out.println(d);\n\t\t\n\t\tint i=(int)10.99;\n\t\tSystem.out.println(i);\n\t\tbyte b=(byte)1243;\n\t\tSystem.out.println(b);\n\t\t\n\n\t}", "double getFloatingPointField();", "@Override\n public Type evaluateType() throws Exception {\n return new IntegerType();\n }", "public abstract double getValue();", "private boolean isNumber(Object o) {\n\t\tif(o instanceof String) return isNumber((String) o);\n\t\telse if(o instanceof Double) return true;\n\t\telse return false;\n\t}", "private static double m6088b(Object obj) {\n Method method = null;\n Object obj2 = obj;\n while (!(obj2 instanceof Number)) {\n if (obj2 instanceof String) {\n return ScriptRuntime.m6309a((String) obj2);\n }\n if (!(obj2 instanceof Scriptable)) {\n try {\n method = obj2.getClass().getMethod(\"doubleValue\");\n } catch (NoSuchMethodException | SecurityException e) {\n }\n if (method != null) {\n try {\n return ((Number) method.invoke(obj2)).doubleValue();\n } catch (IllegalAccessException e2) {\n m6091c(obj2, Double.TYPE);\n } catch (InvocationTargetException e3) {\n m6091c(obj2, Double.TYPE);\n }\n }\n return ScriptRuntime.m6309a(obj2.toString());\n } else if (!(obj2 instanceof Wrapper)) {\n return ScriptRuntime.m6395b(obj2);\n } else {\n obj2 = ((Wrapper) obj2).mo18879a();\n }\n }\n return ((Number) obj2).doubleValue();\n }", "void checkSameDataType(String datatype, String datatype1)\n {\n DefaultTableModel semanticerror = (DefaultTableModel)tblErrorSemantic.getModel();\n if(datatype.equals(datatype1))\n {\n\n }\n else if(datatype.equals(\"INT\") && datatype1.equals(\"FLOAT\"))\n {\n \n }\n else if(datatype.equals(\"FLOAT\") && datatype1.equals(\"INT\"))\n {\n \n }\n else if(datatype1 == null)\n {\n\n }\n else\n {\n semanticerror.addRow(new Object[] {tblLexeme.getModel().getValueAt(tokenPos-2, 0),\"Incompatible Types: \"+datatype1+\" Cannot be converted to \"+datatype, tblLexeme.getModel().getValueAt(tokenPos-2, 2)}); \n } \n datatype = null;\n }", "public long longValue() {\n\t\treturn (long) mDouble;\n\t}", "@Override\n public String getDataType() {\n return getPrimitiveType().name();\n }", "private void m2248a(double d, String str) {\n this.f2954c = d;\n this.f2955d = (long) d;\n this.f2953b = str;\n this.f2952a = ValueType.doubleValue;\n }", "@Override\n public double nextDouble() {\n return super.nextDouble();\n }", "public double getAsDouble(int index) {\n switch (type) {\n case TIFFTag.TIFF_BYTE: case TIFFTag.TIFF_UNDEFINED:\n return ((byte[])data)[index] & 0xff;\n case TIFFTag.TIFF_SBYTE:\n return ((byte[])data)[index];\n case TIFFTag.TIFF_SHORT:\n return ((char[])data)[index] & 0xffff;\n case TIFFTag.TIFF_SSHORT:\n return ((short[])data)[index];\n case TIFFTag.TIFF_SLONG:\n return ((int[])data)[index];\n case TIFFTag.TIFF_LONG: case TIFFTag.TIFF_IFD_POINTER:\n return ((long[])data)[index];\n case TIFFTag.TIFF_FLOAT:\n return ((float[])data)[index];\n case TIFFTag.TIFF_DOUBLE:\n return ((double[])data)[index];\n case TIFFTag.TIFF_SRATIONAL:\n int[] ivalue = getAsSRational(index);\n return (double)ivalue[0]/ivalue[1];\n case TIFFTag.TIFF_RATIONAL:\n long[] lvalue = getAsRational(index);\n return (double)lvalue[0]/lvalue[1];\n case TIFFTag.TIFF_ASCII:\n String s = ((String[])data)[index];\n return Double.parseDouble(s);\n default:\n throw new ClassCastException();\n }\n }", "@Ignore\n @Test(expected = IllegalArgumentException.class)\n public void require_that_illegal_double_throws_exception() throws IOException {\n Slime slime = new Slime();\n Cursor root = slime.setObject();\n root.setString(\"doubleval\", \"invalid\");\n InnerCNode def = new DefParser(\"simpletypes\", new StringReader(StringUtilities.implode(SimpletypesConfig.CONFIG_DEF_SCHEMA, \"\\n\"))).getTree();\n new ConfigFileFormat(def).encode(new ByteArrayOutputStream(), slime);\n }", "private double IntegerParseIn(double Precio) {\n throw new UnsupportedOperationException(\"Not supported yet.\"); //To change body of generated methods, choose Tools | Templates.\n }", "@java.lang.Override\n public long getLongValue() {\n if (typeCase_ == 3) {\n return (java.lang.Long) type_;\n }\n return 0L;\n }", "public abstract double[] getasDouble(int tuple);", "double getValue();", "double getValue();", "double getValue();", "public static double leerDouble() {\n\t\tthrow new UnsupportedOperationException();\n\t}", "public OCFloat(OCInteger lenType)\r\n {\r\n super(lenType);\r\n setLength(4);\r\n }", "void mo130799a(double d);", "public static double datodouble(){\n try {\n Double f=new Double(dato());\n return(f.doubleValue());\n } catch (NumberFormatException error) {\n return(Double.NaN);\n }\n }", "private TsPrimitiveType readOneValue() {\n switch (dataType) {\n case BOOLEAN:\n return new TsBoolean(valueDecoder.readBoolean(valueInputStream));\n case INT32:\n return new TsInt(valueDecoder.readInt(valueInputStream));\n case INT64:\n return new TsLong(valueDecoder.readLong(valueInputStream));\n case FLOAT:\n return new TsFloat(valueDecoder.readFloat(valueInputStream));\n case DOUBLE:\n return new TsDouble(valueDecoder.readDouble(valueInputStream));\n case TEXT:\n return new TsBinary(valueDecoder.readBinary(valueInputStream));\n default:\n break;\n }\n throw new UnSupportedDataTypeException(\"Unsupported data type :\" + dataType);\n }", "int getDataTypeValue();", "public static double isDouble() {\n\t\twhile (true) {\n\t\t\ttry {\n\t\t\t\treturn input.nextDouble();\n\t\t\t} catch (InputMismatchException e) {\n\t\t\t\tinput.next();\n\t\t\t\tSystem.out.println(\"Vas unos nije odgovarajuci. Probajte ponovo: \");\n\t\t\t}\n\t\t}\n\t}", "void writeDouble(double value);", "@Override\n\tpublic Type getType() {\n\t\treturn Type.FLOAT;\n\t}" ]
[ "0.66772467", "0.6355419", "0.63483196", "0.6342852", "0.6287018", "0.62868583", "0.62429136", "0.6228538", "0.6178516", "0.6171938", "0.6077349", "0.6074494", "0.6065865", "0.60325575", "0.6027928", "0.6024646", "0.6015092", "0.5959282", "0.5938346", "0.59007293", "0.5899381", "0.589728", "0.5895115", "0.5892888", "0.5891087", "0.5873259", "0.5869304", "0.584895", "0.5822251", "0.5806564", "0.57769185", "0.57665807", "0.5718738", "0.57119167", "0.56890285", "0.56840175", "0.56800175", "0.5668304", "0.5662382", "0.5642278", "0.5642187", "0.56345105", "0.56091166", "0.56049085", "0.5601217", "0.559585", "0.5578792", "0.55681217", "0.5530451", "0.55288094", "0.552566", "0.5516113", "0.5509732", "0.55025816", "0.54973364", "0.5495813", "0.5495761", "0.548664", "0.5471293", "0.54671156", "0.5465179", "0.5464752", "0.54643047", "0.54477364", "0.54460806", "0.5443771", "0.5443696", "0.54421735", "0.54296184", "0.5429101", "0.5421284", "0.54170233", "0.54094917", "0.5408228", "0.540752", "0.5403911", "0.53957886", "0.5383653", "0.5372423", "0.5370536", "0.536231", "0.53543204", "0.53543", "0.53466254", "0.53464043", "0.53427374", "0.53368706", "0.5335927", "0.53326416", "0.5320436", "0.5320436", "0.5320436", "0.53169155", "0.5309918", "0.5306529", "0.53056556", "0.5304184", "0.5296527", "0.52865654", "0.5276762", "0.5267712" ]
0.0
-1
there will be issue when the type is double/int/long
protected void setTitle(UiAction uiAction, ResultSet rs, int rowNumber) throws SQLException{ String title = rs.getString(UiActionTable.COLUMN_TITLE); if(title == null){ //do nothing when nothing found in database return; } uiAction.setTitle(title); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\n public Class getValueType() {\n return Double.class;\n }", "public static void main(String args[]) {\n\t\t \n\t\t // lets define some variables and try to insert other data type value\n\t\t int x = 23;\n\t\t double y ;\n\t\t y = x ; // here we are storing int to double ie. smaller to larger . So no error\n\t\t System.out.println(y);\n\t\t System.out.println(x);\n\t\t \n\t\t double a = 25.28;\n\t\t int b ;\n\t\t //b = a; // Here we can see error since we are trying to store double to int i.e larger to smaller w/o casting\n\t\t \n\t\t // lets do casting and store \n\t\t b = (int) a;\n\t\t System.out.println(b);\n\t\t \n\t\t boolean bool = true ;\n\t\t int num = bool; // not possible as we know boolean data type cannot be typecast;\n\t\t \n\t\t //int to long\n\t\t int value = 34;\n\t\t long value1 ;\n\t\t \n\t\t value1 = value;\n\t\t System.out.println(value1);\n\t\t value = value1; // trying longer to smaller w/o casting which is not possible;\n\t\t System.out.println(value);\n\t\t \n\t\t value = (int) value1;\n\t\t \n\t\t // long to float \n\t\t \n\t\t long value2 = 678;\n\t\t float value3; \n\t\t value3 = value2; // works fine since smaller to larger\n\t\t System.out.println(value3);\n\t\t value2 = value3 ; // trying longer to smaller w/o casting which is not possible;\n\t\t \n\t\t // so to assign value3 to value2 we need Explicitly type cast\n\t\t value2 = (long) value3;\n\t\t \n\t\t // float to long and vice versa \n\t\t \n\t\t float value4 = 567.78f;\n\t\t double value5 ;\n\t\t value5 = value4 ; // works fine since assigning smaller type to larger type\n\t\t System.out.println(value5);\n\t\t value4 = value5 ; // trying longer to smaller w/o casting which is not possible;\n\t\t \n\t\t // Also we can explicit cast for storing larger (double) to long/int/short\n\t\t double value6 = 3564.8;\n\t\t int value7 ;\n\t\t \n\t\t value7 = (int) value6;\n\t\t System.out.println(value7);\n\t\t \n\t\t \n\t\t \n\t\t \n\t\t \n\t }", "@Override\n\tpublic void visit(DoubleType n) {\n\t\t\n\t}", "private void functionalInterfacesForDoubleIntLong() {\n double d = 1.0;\n DoubleToIntFunction f1 = x -> 1;\n f1.applyAsInt(d);\n\n }", "public interface DoubleType extends NumericType {\n}", "@java.lang.Override\n public double getRealValue() {\n if (typeCase_ == 4) {\n return (java.lang.Double) type_;\n }\n return 0D;\n }", "double getEDouble();", "public boolean isDouble();", "long getNumericField();", "@Test\n public void test_column_type_detection_double() throws SQLException {\n ColumnInfo info = testColumnTypeDetection(\"x\", NodeFactory.createLiteral(\"12.3e4\", XSDDatatype.XSDdouble), true, Types.DOUBLE, Double.class.getCanonicalName());\n Assert.assertEquals(16, info.getScale());\n Assert.assertEquals(16, info.getPrecision());\n Assert.assertTrue(info.isSigned());\n }", "public abstract double read_double();", "public static void main(String[] args) {\ndouble anInt=1234;\nbyte aByte=12;\nshort aShort=12;\nlong aLong=1234567890987654321L;\ndouble anotherInt= (anInt * 10000000);\nSystem.out.println(\"The int is \" + anInt);\nSystem.out.println(\"The byte is \" + aByte);\nSystem.out.println(\"The short is \" + aShort);\nSystem.out.println(\"The long is \" + aLong);\nSystem.out.println(\"Another int is \" + anotherInt); \n\t}", "public abstract Double toDouble(T t);", "default T handleNumber(double val) {\n throw new UnsupportedOperationException();\n }", "public static Double toDouble(Object o,byte type) throws ExecException {\n try {\n switch (type) {\n case BOOLEAN:\n return (Boolean) o ? Double.valueOf(1.0D) : Double.valueOf(0.0D);\n\n case INTEGER:\n return new Double(((Integer)o).doubleValue());\n\n case LONG:\n return new Double(((Long)o).doubleValue());\n\n case FLOAT:\n return new Double(((Float)o).doubleValue());\n\n case DOUBLE:\n return (Double)o;\n\n case DATETIME:\n return new Double(Long.valueOf(((DateTime)o).getMillis()).doubleValue());\n\n case BYTEARRAY:\n return Double.valueOf(((DataByteArray)o).toString());\n\n case CHARARRAY:\n return Double.valueOf((String)o);\n\n case BIGINTEGER:\n return Double.valueOf(((BigInteger)o).doubleValue());\n\n case BIGDECIMAL:\n return Double.valueOf(((BigDecimal)o).doubleValue());\n\n case NULL:\n return null;\n\n case BYTE:\n case MAP:\n case INTERNALMAP:\n case TUPLE:\n case BAG:\n case UNKNOWN:\n default:\n int errCode = 1071;\n String msg = \"Cannot convert a \" + findTypeName(o) +\n \" to a Double\";\n throw new ExecException(msg, errCode, PigException.INPUT);\n }\n } catch (ClassCastException cce) {\n throw cce;\n } catch (ExecException ee) {\n throw ee;\n } catch (NumberFormatException nfe) {\n int errCode = 1074;\n String msg = \"Problem with formatting. Could not convert \" + o + \" to Double.\";\n throw new ExecException(msg, errCode, PigException.INPUT, nfe);\n } catch (Exception e) {\n int errCode = 2054;\n String msg = \"Internal error. Could not convert \" + o + \" to Double.\";\n throw new ExecException(msg, errCode, PigException.BUG);\n }\n }", "private void validate(Adouble val) {\r\n Assertions.assertEquals(val.aonType(), Atype.DOUBLE);\r\n Assertions.assertEquals(val, val);\r\n Assertions.assertEquals(val, Adouble.valueOf(val.toDouble()));\r\n Assertions.assertEquals(val.hashCode(), Adouble.valueOf(val.toDouble()).hashCode());\r\n Assertions.assertTrue(val.isNumber());\r\n }", "public static interface DataTypeWithRatioScale<T> {\r\n \r\n /**\r\n * Add\r\n *\r\n * @param augend\r\n * @param addend\r\n * @return\r\n */\r\n public abstract T add(T augend, T addend);\r\n\r\n /**\r\n * Compare\r\n *\r\n * @param s1\r\n * @param s2\r\n * @return\r\n * @throws NumberFormatException\r\n * @throws ParseException\r\n */\r\n public abstract int compare(String s1, String s2) throws NumberFormatException,\r\n ParseException;\r\n\r\n /**\r\n * Compare\r\n *\r\n * @param t1\r\n * @param t2\r\n * @return\r\n */\r\n public abstract int compare(T t1, T t2);\r\n\r\n /**\r\n * Divide\r\n *\r\n * @param dividend\r\n * @param divisor\r\n * @return\r\n */\r\n public abstract String divide(String dividend, String divisor);\r\n \r\n /**\r\n * Divide\r\n *\r\n * @param dividend\r\n * @param divisor\r\n * @return\r\n */\r\n public abstract T divide(T dividend, T divisor);\r\n \r\n /**\r\n * Format\r\n *\r\n * @param t\r\n * @return\r\n */\r\n public abstract String format(T t);\r\n\r\n /**\r\n * Converts a double into a value.\r\n *\r\n * @param s\r\n * @return\r\n */\r\n public abstract T fromDouble(Double d);\r\n\r\n /**\r\n * Description\r\n *\r\n * @return\r\n */\r\n public abstract DataTypeDescription<T> getDescription();\r\n\r\n /**\r\n * Maximum\r\n *\r\n * @return\r\n */\r\n public T getMaximum();\r\n \r\n /**\r\n * Minimum\r\n *\r\n * @return\r\n */\r\n public T getMinimum();\r\n\r\n /**\r\n * Valid\r\n *\r\n * @param s\r\n * @return\r\n */\r\n public abstract boolean isValid(String s);\r\n\r\n /**\r\n * Multiply\r\n *\r\n * @param multiplicand\r\n * @param multiplicator\r\n * @return\r\n */\r\n public abstract String multiply(String multiplicand,\r\n String multiplicator);\r\n\r\n /**\r\n * Multiply\r\n *\r\n * @param multiplicand\r\n * @param multiplicator\r\n * @return\r\n */\r\n public abstract T multiply(T multiplicand, double multiplicator);\r\n\r\n /**\r\n * Multiply\r\n *\r\n * @param multiplicand\r\n * @param multiplicator\r\n * @return\r\n */\r\n public abstract T multiply(T multiplicand, int multiplicator);\r\n\r\n /**\r\n * Multiply\r\n *\r\n * @param multiplicand\r\n * @param multiplicator\r\n * @return\r\n */\r\n public abstract T multiply(T multiplicand, T multiplicator);\r\n \r\n /**\r\n * Parse\r\n *\r\n * @param s\r\n * @return\r\n */\r\n public abstract T parse(String s);\r\n\r\n /**\r\n * Divide\r\n *\r\n * @param dividend\r\n * @param divisor\r\n * @return\r\n */\r\n public abstract double ratio(T dividend, T divisor);\r\n \r\n /**\r\n * Subtract\r\n *\r\n * @param minuend\r\n * @param subtrahend\r\n * @return\r\n */\r\n public abstract T subtract(T minuend, T subtrahend);\r\n \r\n /**\r\n * Converts a double into a value.\r\n *\r\n * @param s\r\n * @return\r\n */\r\n public abstract Double toDouble(T t);\r\n }", "public abstract T fromDouble(Double d);", "public double getRealValue() {\n if (typeCase_ == 4) {\n return (java.lang.Double) type_;\n }\n return 0D;\n }", "Double getDoubleValue();", "double getRealValue();", "private double convertToDbl(Object a) {\n double result = 0;\n\n //If the object is a Character...\n if(a instanceof Character){\n char x = (Character)a;\n result = (double)(x - '0'); // -'0' as it will convert the ascii number (e.g 4 is 52 in ascii) to the standard number\n }\n\n //If it is a Double...\n else if(a instanceof Double){\n result = (Double)a;\n }\n\n return result;\n }", "public boolean isDouble() {\n return this.data instanceof Double;\n }", "public abstract double getasDouble(int tuple, int val);", "public boolean isDouble() {\n return false;\n }", "@Override\n public Double value(TypeOfValue value);", "public abstract double readAsDbl(int offset);", "double readDouble()\n throws IOException {\n return Double.longBitsToDouble( readLong() );\n }", "public abstract Double getDataValue();", "private static int m6082a(Class<?> cls) {\n if (cls == Double.TYPE) {\n return 1;\n }\n if (cls == Float.TYPE) {\n return 2;\n }\n if (cls == Long.TYPE) {\n return 3;\n }\n if (cls == Integer.TYPE) {\n return 4;\n }\n if (cls == Short.TYPE) {\n return 5;\n }\n if (cls == Character.TYPE) {\n return 6;\n }\n if (cls == Byte.TYPE) {\n return 7;\n }\n if (cls == Boolean.TYPE) {\n return 99;\n }\n return 8;\n }", "double getDoubleValue2();", "double readDouble();", "Double getValue();", "private static double getLongt() {\n\t\treturn longt;\n\t}", "public double getDouble();", "boolean hasDouble();", "public abstract void writeAsDbl(int offset, double d);", "public boolean realAsDouble() {\n return false;\n }", "public abstract Number getPrimitiveType();", "double getDoubleValue1();", "int getSimpleType() {\n\t\treturn ((type / 1000)) * 1000;\n\t}", "private double readDouble() throws IOException {\n\t\treturn (isBigEndian ? ioReadDouble() : Double.longBitsToDouble(readLELong()));\n\t}", "public static void main(String[] args){\n short num=100;\n int inum=num;\n long lnum=num;\n float fnum=num;\n double dnum=num;\n //When you assign value of one data type to another,\n // the two types might not be compatible with each other.\n // If the data types are compatible,\n // then Java will perform the conversion automatically known as Automatic Type Conversion and\n // if not then they need to be casted or converted explicitly.\n //this happens only when\n //The two data types are compatible.\n //When we assign value of a smaller data type to a bigger data type.(byte<short<int<long<float<double)\n //For Example, in java the numeric data types are compatible with each other\n // but no automatic conversion is supported from numeric type to char or boolean.\n // Also, char and boolean are not compatible with each other.\n System.out.println(\"num is \"+num);\n System.out.println(\"inum is \"+inum);\n System.out.println(\"lnum is \"+lnum);\n System.out.println(\"fnum is \"+fnum);\n System.out.println(\"dnum is \"+dnum);\n\n //Narrowing or Explicit conversion\n dnum=323.142;\n byte bnum=(byte)dnum;//converting bigger data type o smaller data type\n //so explicit conversion is needed\n System.out.println(\"dnum converted to bnum(byte) is \"+bnum);\n\n }", "public static double longToDouble(long l) {\n return (double) l;\n }", "public void testDoubleValue() {\n AtomicLong ai = new AtomicLong();\n assertEquals(0.0d, ai.doubleValue());\n for (long x : VALUES) {\n ai.set(x);\n assertEquals((double)x, ai.doubleValue());\n }\n }", "double getDoubleValue3();", "public static void main(String[] args) {\n // example of type casting\n // it will store the double and store it as an int.\n //by default, java will round down\n\n int a = (int) 0.5;\n System.out.println(a);\n //results will be 0\n\n\n //some primitive data types - byte, short, char, int, long, float, double\n\n // byte a;\n // short b;\n // char c;\n // int d;\n // long e;\n // float f;\n // double g;\n\n //if you were to use int and then store it to double, it will cast to double by default.\n\n //it will work its way down this primitive types data\n\n \n }", "public static void testOfDoubleNumberIsInteger(){\n\t\tSystem.out.println(\"please enter a double number: \");\n\t\tScanner scann=new Scanner(System.in);\n\t\tdouble x=scann.nextDouble();\n\t\tif(x%1==0)\n\t\t\tSystem.out.println(\"The number you have enterd it's not a double \");\n\t\telse\n\t\t\tSystem.out.println(\"The number you have entered it's double\");\n\t}", "private final double get_DOUBLE(int column) {\n if (metadata.isZos()) {\n byte[] bytes = new byte[8];\n dataBuffer_.getBytes(columnDataPosition_[column - 1], bytes);\n return FloatingPoint.getDouble_hex(bytes, 0);\n //return dataBuffer_.getDouble(columnDataPosition_[column - 1]);\n } else {\n return dataBuffer_.getDoubleLE(columnDataPosition_[column - 1]);\n// return FloatingPoint.getDouble(dataBuffer_,\n// columnDataPosition_[column - 1]);\n }\n }", "public static void main(String[] args) {\n\n Integer num1 = 100;\n double num2 = num1;\n System.out.println(num2);\n\n float f = 0.5f;\n Float fl = f;\n System.out.println(fl);\n\n System.out.println(Byte.MAX_VALUE);\n\n // parse method --> converting String value to primitives, returne primitive\n // valueOf --> converting String to Wrapper class, return Wrapper class\n\n String str1 = \"123\";\n int result = Integer.parseInt(str1);\n System.out.println(result+1);\n\n String str2 = \"true\";\n boolean r1 = Boolean.parseBoolean(str2);\n System.out.println(r1);\n\n // parse method not case sencetive\n String str3 = \"FaLse\"; // it is work\n boolean r2 = Boolean.parseBoolean(str3);\n System.out.println(r2);\n\n String s1 = \"100.5\";\n Double c1 = Double.parseDouble(s1);\n System.out.println(c1 + 1); // it is call auto boxing\n Double c2 = Double.valueOf(s1); // this in not auto and not unboxing\n\n System.out.println(c1);\n System.out.println(c2);\n\n String s2 = \"TrUe\";\n Boolean b1 = Boolean.valueOf(s2);\n System.out.println(b1); // no sensetive\n\n Double [] arr = new Double[3];\n System.out.println(Arrays.toString(arr));\n // default value of wrapper class always --> null, null, null\n\n String name = \"string\";\n String name1 = new String(\"string\");\n\n Integer I1 = new Integer(\"123\");\n\n System.out.println(addNum(12,13));\n System.out.println(addNum(15.3,7.4));\n \n }", "public interface Numeric extends DataType {\n}", "@ZenCodeType.Caster\n @ZenCodeType.Method\n default double asDouble() {\n \n return notSupportedCast(BasicTypeID.DOUBLE);\n }", "public native double __doubleMethod( long __swiftObject, double arg );", "int toInt (double val) {\n return (int)val;\n }", "public double castToDoubleValue() {\n throw new IteratorFlowException(\"Cannot call castToDouble on non numeric\");\n }", "@Test\n\tpublic void test_TCM__double_getDoubleValue() {\n\t\tAttribute attr = new Attribute(\"test\", \"11111111111111\");\n\t\ttry {\n\t\t\tassertTrue(\"incorrect double value\", attr.getDoubleValue() == 11111111111111d );\n\n\t\t\tattr.setValue(\"0\");\n\t\t\tassertTrue(\"incorrect double value\", attr.getDoubleValue() == 0 );\n\n\t\t\tattr.setValue(Double.toString(java.lang.Double.MAX_VALUE));\n\t\t\tassertTrue(\"incorrect double value\", attr.getDoubleValue() == java.lang.Double.MAX_VALUE);\n\n\t\t\tattr.setValue(Double.toString(java.lang.Double.MIN_VALUE));\n\t\t\tassertTrue(\"incorrect double value\", attr.getDoubleValue() == java.lang.Double.MIN_VALUE);\n\n\t\t} catch (DataConversionException e) {\n\t\t\tfail(\"couldn't convert boolean value\");\n\t\t}\n\n\t\ttry {\n\t\t\tattr.setValue(\"foo\");\n\t\t\tfail(\"incorrectly returned double from non double value\" + attr.getDoubleValue());\n\n\t\t} catch (DataConversionException e) {\n\t\t\t// Do nothing\n\t\t} catch (Exception e) {\n\t\t\tfail(\"Unexpected exception \" + e.getClass());\n\t\t}\n\n\t}", "public static void main(String[] args)\n {\n double x = 5.3;\n int y = (int)x;\n \n }", "private void ex04(){\n int number;\n number = 1;\n\n double number2;\n number2 = 1.5;\n\n String number3;\n number3 = \"3\";\n\n boolean bool = (number == 1);\n\n myWindow.clearOut();\n myWindow.writeOutLine(number);\n myWindow.writeOutLine(new String(String.valueOf(number))); //int to string\n myWindow.writeOutLine((double) number); //int to double\n myWindow.writeOutLine(bool); //int to boolean\n\n /*\n Java can perform number -> string\n method 1: numberType.toString\n method 2: String.valueOf(int/double/float) //used above in the code\n Java can also perform string -> number\n dataType.parseDatatype() // e.g.: Integer.parseInt()\n\n Java allows this only when the conversion is widening (small -> larger)\n alternatively reports a compile error if the conversion is narrowing\n */\n\n //YOUR CODE ABOVE HERE\n }", "public int getAxisType()\n {\n return DOUBLE;\n }", "private double convertDouble()\n\t{\n\t\tString val = tokens[10];\n\t\tdouble value = 0.0;\n\t\ttry {\n\t\t\tvalue = Double.parseDouble(tokens[10]);\n\t\t}\n\t\tcatch(NumberFormatException e) {\n\t\t\tSystem.err.print(\"\");\n\t\t}\n\t\treturn value;\n\t}", "public static void main(String[] args){\n long money = 500000; //not equal datatype, so implicit type casting\n long money1 = 500000L; //Recommendation\n\n System.out.println(money);\n System.out.println(money1);\n\n //JVM default float is double(8byte)\n //float pi = 3.141592; //compile error, incompatible types\n float PI = 3.141592f; // f or F\n double dd = 152.12331;\n System.out.println(PI);\n System.out.println(dd);\n }", "private Type get_value_type(long xx) {\n Type vt = _values.get(xx);\n assert vt!=null;\n return vt;\n }", "private static native boolean set_0(long nativeObj, int propId, double value);", "public static void main(String[] args) {\n\n\t\tSystem.out.println( \"Min value of Byte :\"+ Byte.MIN_VALUE); \n\t\tSystem.out.println( \"Max value of Byte :\"+ Byte.MAX_VALUE); \n\n\t\tSystem.out.println();\n\t\t\n\t\tSystem.out.println( \"Min value of Short :\"+ Short.MIN_VALUE); \n\t\tSystem.out.println( \"Max value of Short :\"+ Short.MAX_VALUE); \n\n\t\tSystem.out.println();\n\t\t\n\t\tSystem.out.println( \"Min value of Integer :\"+ Integer.MIN_VALUE); \n\t\tSystem.out.println( \"Max value of Integer :\"+ Integer.MAX_VALUE); \n\n\t\tSystem.out.println();\n\t\t\n\t\tSystem.out.println( \"Min value of Long :\"+ Long.MIN_VALUE); \n\t\tSystem.out.println( \"Max value of Long :\"+ Long.MAX_VALUE); \n\n\t\t// l should be at the end of value\n\t\tlong number1 = 9223372036854775807l;\n\t\tSystem.out.println( \"After adding l at end of the long number \" + number1);\n\t\t\n\t\tSystem.out.println();\n\t\t\n\t\t\n\t\t/* *\n\t\t * Decimal Data Types *\n\t\t * \t\t-----------------\t *\n\t\t *\t\t\t\t\t\t\t *\n\t\t*/\n\t\t\n\t\t// 1. float \t\t2. double\n\n\t\tSystem.out.println( \"Min value of float :\"+ Float.MIN_VALUE); \n\t\tSystem.out.println( \"Max value of float :\"+ Float.MAX_VALUE); \n\t\t\n\t\t// f should be at the end of value\n\t\tfloat decimal1 = 32245.12123f;\n\t\t\n\t\tSystem.out.println( \"After adding f at the end of the float\" + decimal1);\n\t\t\n\t\tSystem.out.println();\n\n\t\tSystem.out.println( \"Min value of double :\"+ Double.MIN_VALUE); \n\t\tSystem.out.println( \"Max value of double :\"+ Double.MAX_VALUE); \n\n\t\tSystem.out.println();\n\t\t\n\t\t\n\t\t\n\t\t/* *\n\t\t * Character Data Types *\n\t\t * \t --------------------\t *\n\t\t *\t\t\t\t\t\t\t *\n\t\t*/\n\t\t\n\t\t\n\t\t// 1. char \t\t\t2. String( int 2 bytes)\n\n\t\t// can only contain single letter\n\t\tchar ch = 'a'; \n\t\tSystem.out.println( \"Single character :\"+ ch);\n\t\t\n\t\t// can contain unicode values \n\t\tchar unicode = '\\u0000';\n\t\tSystem.out.println( \"Unicodes are stored but not shown :\"+ unicode);\n\t\t\n\t\t// are stored in int\n\t\tint num = 'a';\n\t\tSystem.out.println( \"character stored in int:\"+num);\n\t\t\n\t\tSystem.out.println();\n\t\t\n\n\t\tString str = \"Hello\" + \" World\";\n\t\tSystem.out.println(str);\n\n\t}", "public static void main(String[] args)\n {\n\n double myDouble = 3.14;\n float myFloat = 3.14f; //Removing the f will cause an error due to lossy conversion\n double yourDouble = myFloat; //Widening/lossless conversions won't raise errors\n }", "public abstract double GetRaw();", "public int getDataType()\n {\n return dtype;\n }", "public Double\n getDoubleValue() \n {\n return ((Double) getValue());\n }", "private Object getTypeObjectPair() throws MathLinkException, NumberRangeException {\n Object result = null;\n int type = this.getInteger();\n if (type % -17 == -15) {\n type = -7 + -17 * (type / -17);\n } else if (type % -17 == -16) {\n type = -8 + -17 * (type / -17);\n }\n switch (type) {\n case -5: {\n result = new Integer(this.getInteger());\n break;\n }\n case -6: {\n result = new Long(this.getLongInteger());\n break;\n }\n case -4: {\n int i = this.getInteger();\n if (i < -32768 || i > 32767) {\n throw new NumberRangeException(i, \"short\");\n }\n result = new Short((short)i);\n break;\n }\n case -2: {\n int i = this.getInteger();\n if (i < -128 || i > 127) {\n throw new NumberRangeException(i, \"byte\");\n }\n result = new Byte((byte)i);\n break;\n }\n case -3: {\n int i = this.getInteger();\n if (i < 0 || i > 65535) {\n throw new NumberRangeException(i, \"char\");\n }\n result = new Character((char)i);\n break;\n }\n case -15: \n case -7: {\n double d = this.getDouble();\n if (d < -3.4028234663852886E38 || d > 3.4028234663852886E38) {\n throw new NumberRangeException(d, \"float\");\n }\n result = new Float((float)d);\n break;\n }\n case -16: \n case -8: {\n result = new Double(this.getDouble());\n break;\n }\n case -9: {\n int tok = this.getType();\n if (tok == 100000) {\n result = this.getObject();\n break;\n }\n result = this.getString();\n if (tok != 35 || !result.equals(\"Null\")) break;\n result = null;\n break;\n }\n case -1: {\n String s = this.getSymbol();\n if (s.equals(\"True\")) {\n result = Boolean.TRUE;\n break;\n }\n result = Boolean.FALSE;\n break;\n }\n case -13: {\n long mark = this.createMark();\n try {\n int tok = this.getNext();\n if (tok == 100000) {\n result = this.getObject();\n break;\n }\n if (tok == 35) {\n result = this.getSymbol();\n if (result.equals(\"Null\")) {\n result = null;\n break;\n }\n this.seekMark(mark);\n result = this.getComplex();\n break;\n }\n this.seekMark(mark);\n result = this.getComplex();\n }\n finally {\n this.destroyMark(mark);\n }\n }\n case -10: {\n long mark = this.createMark();\n try {\n int tok = this.getType();\n if (tok == 100000) {\n result = this.getObject();\n break;\n }\n if (tok == 35) {\n result = this.getSymbol();\n if (result.equals(\"Null\")) {\n result = null;\n break;\n }\n result = new BigInteger((String)result);\n break;\n }\n result = new BigInteger(this.getString());\n }\n finally {\n this.destroyMark(mark);\n }\n }\n case -11: {\n long mark = this.createMark();\n try {\n int tok = this.getType();\n if (tok == 100000) {\n result = this.getObject();\n break;\n }\n if (tok == 35) {\n result = this.getSymbol();\n if (result.equals(\"Null\")) {\n result = null;\n break;\n }\n result = Utils.bigDecimalFromString((String)result);\n break;\n }\n result = Utils.bigDecimalFromString(this.getString());\n }\n finally {\n this.destroyMark(mark);\n }\n }\n case -12: {\n long mark = this.createMark();\n try {\n int tok = this.getNext();\n if (tok == 100000 && (result = this.getObject()) != null) break;\n this.seekMark(mark);\n result = this.getExpr();\n }\n finally {\n this.destroyMark(mark);\n }\n }\n case -14: {\n result = this.getObject();\n break;\n }\n case -10000: {\n break;\n }\n default: {\n int tok = this.getNext();\n result = tok == 100000 || tok == 35 ? this.getObject() : (type > -34 ? this.getArray(type - -17, 1) : (type > -51 ? this.getArray(type - -34, 2) : (type > -68 ? this.getArray(type - -51, 3) : (type > -85 ? this.getArray(type - -68, 4) : this.getArray(type - -85, 5)))));\n }\n }\n return result;\n }", "private static native double get_0(long nativeObj, int propId);", "public double doubleValue() {\r\n return (double) intValue();\r\n }", "public static void isValid(double dbl) throws IllegalArgumentException {\n\t//nothing to do here\n }", "public double asDouble() {\r\n\t\tif (this.what == SCALARTYPE.Integer || this.what == SCALARTYPE.Float) {\r\n\t\t\treturn (new BigDecimal(this.scalar)).doubleValue();\r\n\t\t} else\r\n\t\t\treturn 0; // ritorna un valore di default\r\n\t}", "public static void main(String[] args) {\n\t\tdouble d=10;\n\t\tSystem.out.println(d);\n\t\t\n\t\tint i=(int)10.99;\n\t\tSystem.out.println(i);\n\t\tbyte b=(byte)1243;\n\t\tSystem.out.println(b);\n\t\t\n\n\t}", "double getFloatingPointField();", "@Override\n public Type evaluateType() throws Exception {\n return new IntegerType();\n }", "public abstract double getValue();", "private boolean isNumber(Object o) {\n\t\tif(o instanceof String) return isNumber((String) o);\n\t\telse if(o instanceof Double) return true;\n\t\telse return false;\n\t}", "private static double m6088b(Object obj) {\n Method method = null;\n Object obj2 = obj;\n while (!(obj2 instanceof Number)) {\n if (obj2 instanceof String) {\n return ScriptRuntime.m6309a((String) obj2);\n }\n if (!(obj2 instanceof Scriptable)) {\n try {\n method = obj2.getClass().getMethod(\"doubleValue\");\n } catch (NoSuchMethodException | SecurityException e) {\n }\n if (method != null) {\n try {\n return ((Number) method.invoke(obj2)).doubleValue();\n } catch (IllegalAccessException e2) {\n m6091c(obj2, Double.TYPE);\n } catch (InvocationTargetException e3) {\n m6091c(obj2, Double.TYPE);\n }\n }\n return ScriptRuntime.m6309a(obj2.toString());\n } else if (!(obj2 instanceof Wrapper)) {\n return ScriptRuntime.m6395b(obj2);\n } else {\n obj2 = ((Wrapper) obj2).mo18879a();\n }\n }\n return ((Number) obj2).doubleValue();\n }", "void checkSameDataType(String datatype, String datatype1)\n {\n DefaultTableModel semanticerror = (DefaultTableModel)tblErrorSemantic.getModel();\n if(datatype.equals(datatype1))\n {\n\n }\n else if(datatype.equals(\"INT\") && datatype1.equals(\"FLOAT\"))\n {\n \n }\n else if(datatype.equals(\"FLOAT\") && datatype1.equals(\"INT\"))\n {\n \n }\n else if(datatype1 == null)\n {\n\n }\n else\n {\n semanticerror.addRow(new Object[] {tblLexeme.getModel().getValueAt(tokenPos-2, 0),\"Incompatible Types: \"+datatype1+\" Cannot be converted to \"+datatype, tblLexeme.getModel().getValueAt(tokenPos-2, 2)}); \n } \n datatype = null;\n }", "public long longValue() {\n\t\treturn (long) mDouble;\n\t}", "private void m2248a(double d, String str) {\n this.f2954c = d;\n this.f2955d = (long) d;\n this.f2953b = str;\n this.f2952a = ValueType.doubleValue;\n }", "@Override\n public String getDataType() {\n return getPrimitiveType().name();\n }", "@Override\n public double nextDouble() {\n return super.nextDouble();\n }", "public double getAsDouble(int index) {\n switch (type) {\n case TIFFTag.TIFF_BYTE: case TIFFTag.TIFF_UNDEFINED:\n return ((byte[])data)[index] & 0xff;\n case TIFFTag.TIFF_SBYTE:\n return ((byte[])data)[index];\n case TIFFTag.TIFF_SHORT:\n return ((char[])data)[index] & 0xffff;\n case TIFFTag.TIFF_SSHORT:\n return ((short[])data)[index];\n case TIFFTag.TIFF_SLONG:\n return ((int[])data)[index];\n case TIFFTag.TIFF_LONG: case TIFFTag.TIFF_IFD_POINTER:\n return ((long[])data)[index];\n case TIFFTag.TIFF_FLOAT:\n return ((float[])data)[index];\n case TIFFTag.TIFF_DOUBLE:\n return ((double[])data)[index];\n case TIFFTag.TIFF_SRATIONAL:\n int[] ivalue = getAsSRational(index);\n return (double)ivalue[0]/ivalue[1];\n case TIFFTag.TIFF_RATIONAL:\n long[] lvalue = getAsRational(index);\n return (double)lvalue[0]/lvalue[1];\n case TIFFTag.TIFF_ASCII:\n String s = ((String[])data)[index];\n return Double.parseDouble(s);\n default:\n throw new ClassCastException();\n }\n }", "@Ignore\n @Test(expected = IllegalArgumentException.class)\n public void require_that_illegal_double_throws_exception() throws IOException {\n Slime slime = new Slime();\n Cursor root = slime.setObject();\n root.setString(\"doubleval\", \"invalid\");\n InnerCNode def = new DefParser(\"simpletypes\", new StringReader(StringUtilities.implode(SimpletypesConfig.CONFIG_DEF_SCHEMA, \"\\n\"))).getTree();\n new ConfigFileFormat(def).encode(new ByteArrayOutputStream(), slime);\n }", "private double IntegerParseIn(double Precio) {\n throw new UnsupportedOperationException(\"Not supported yet.\"); //To change body of generated methods, choose Tools | Templates.\n }", "@java.lang.Override\n public long getLongValue() {\n if (typeCase_ == 3) {\n return (java.lang.Long) type_;\n }\n return 0L;\n }", "public abstract double[] getasDouble(int tuple);", "double getValue();", "double getValue();", "double getValue();", "public static double leerDouble() {\n\t\tthrow new UnsupportedOperationException();\n\t}", "public OCFloat(OCInteger lenType)\r\n {\r\n super(lenType);\r\n setLength(4);\r\n }", "void mo130799a(double d);", "public static double datodouble(){\n try {\n Double f=new Double(dato());\n return(f.doubleValue());\n } catch (NumberFormatException error) {\n return(Double.NaN);\n }\n }", "private TsPrimitiveType readOneValue() {\n switch (dataType) {\n case BOOLEAN:\n return new TsBoolean(valueDecoder.readBoolean(valueInputStream));\n case INT32:\n return new TsInt(valueDecoder.readInt(valueInputStream));\n case INT64:\n return new TsLong(valueDecoder.readLong(valueInputStream));\n case FLOAT:\n return new TsFloat(valueDecoder.readFloat(valueInputStream));\n case DOUBLE:\n return new TsDouble(valueDecoder.readDouble(valueInputStream));\n case TEXT:\n return new TsBinary(valueDecoder.readBinary(valueInputStream));\n default:\n break;\n }\n throw new UnSupportedDataTypeException(\"Unsupported data type :\" + dataType);\n }", "int getDataTypeValue();", "public static double isDouble() {\n\t\twhile (true) {\n\t\t\ttry {\n\t\t\t\treturn input.nextDouble();\n\t\t\t} catch (InputMismatchException e) {\n\t\t\t\tinput.next();\n\t\t\t\tSystem.out.println(\"Vas unos nije odgovarajuci. Probajte ponovo: \");\n\t\t\t}\n\t\t}\n\t}", "void writeDouble(double value);", "@Override\n\tpublic Type getType() {\n\t\treturn Type.FLOAT;\n\t}" ]
[ "0.66770065", "0.63548017", "0.6348221", "0.6342794", "0.6286748", "0.6286562", "0.62415045", "0.62285113", "0.6176737", "0.61717606", "0.60764956", "0.60742694", "0.6066293", "0.6032801", "0.60286814", "0.6025049", "0.601542", "0.5959509", "0.59377545", "0.59002924", "0.5898876", "0.58972657", "0.58942175", "0.58928376", "0.5890025", "0.5873796", "0.58692664", "0.58477724", "0.58214265", "0.5804629", "0.57761407", "0.57657284", "0.5718842", "0.5710443", "0.56878364", "0.568356", "0.5680416", "0.5666828", "0.56609714", "0.5641718", "0.5640917", "0.5633694", "0.5608703", "0.56061804", "0.56019515", "0.5595205", "0.5578014", "0.5568802", "0.5529873", "0.55279505", "0.5524837", "0.5515821", "0.5509604", "0.5501653", "0.5497232", "0.549532", "0.5495134", "0.5486931", "0.54703414", "0.5466086", "0.54644877", "0.54643434", "0.5463716", "0.54481673", "0.5445194", "0.5442178", "0.5441387", "0.5441341", "0.54276496", "0.54275256", "0.5420042", "0.5417336", "0.5409133", "0.54077333", "0.540576", "0.5402641", "0.5395491", "0.5382886", "0.5371896", "0.53703064", "0.53614116", "0.53531736", "0.5352584", "0.53459674", "0.53457373", "0.5343557", "0.5335971", "0.5335881", "0.5332064", "0.5320062", "0.5320062", "0.5320062", "0.5316006", "0.530932", "0.5305781", "0.530556", "0.53034633", "0.52949995", "0.5286672", "0.5277252", "0.5266497" ]
0.0
-1
there will be issue when the type is double/int/long
protected void setDisplayOrder(UiAction uiAction, ResultSet rs, int rowNumber) throws SQLException{ Integer displayOrder = rs.getInt(UiActionTable.COLUMN_DISPLAY_ORDER); if(displayOrder == null){ //do nothing when nothing found in database return; } uiAction.setDisplayOrder(displayOrder); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\n public Class getValueType() {\n return Double.class;\n }", "public static void main(String args[]) {\n\t\t \n\t\t // lets define some variables and try to insert other data type value\n\t\t int x = 23;\n\t\t double y ;\n\t\t y = x ; // here we are storing int to double ie. smaller to larger . So no error\n\t\t System.out.println(y);\n\t\t System.out.println(x);\n\t\t \n\t\t double a = 25.28;\n\t\t int b ;\n\t\t //b = a; // Here we can see error since we are trying to store double to int i.e larger to smaller w/o casting\n\t\t \n\t\t // lets do casting and store \n\t\t b = (int) a;\n\t\t System.out.println(b);\n\t\t \n\t\t boolean bool = true ;\n\t\t int num = bool; // not possible as we know boolean data type cannot be typecast;\n\t\t \n\t\t //int to long\n\t\t int value = 34;\n\t\t long value1 ;\n\t\t \n\t\t value1 = value;\n\t\t System.out.println(value1);\n\t\t value = value1; // trying longer to smaller w/o casting which is not possible;\n\t\t System.out.println(value);\n\t\t \n\t\t value = (int) value1;\n\t\t \n\t\t // long to float \n\t\t \n\t\t long value2 = 678;\n\t\t float value3; \n\t\t value3 = value2; // works fine since smaller to larger\n\t\t System.out.println(value3);\n\t\t value2 = value3 ; // trying longer to smaller w/o casting which is not possible;\n\t\t \n\t\t // so to assign value3 to value2 we need Explicitly type cast\n\t\t value2 = (long) value3;\n\t\t \n\t\t // float to long and vice versa \n\t\t \n\t\t float value4 = 567.78f;\n\t\t double value5 ;\n\t\t value5 = value4 ; // works fine since assigning smaller type to larger type\n\t\t System.out.println(value5);\n\t\t value4 = value5 ; // trying longer to smaller w/o casting which is not possible;\n\t\t \n\t\t // Also we can explicit cast for storing larger (double) to long/int/short\n\t\t double value6 = 3564.8;\n\t\t int value7 ;\n\t\t \n\t\t value7 = (int) value6;\n\t\t System.out.println(value7);\n\t\t \n\t\t \n\t\t \n\t\t \n\t\t \n\t }", "@Override\n\tpublic void visit(DoubleType n) {\n\t\t\n\t}", "private void functionalInterfacesForDoubleIntLong() {\n double d = 1.0;\n DoubleToIntFunction f1 = x -> 1;\n f1.applyAsInt(d);\n\n }", "public interface DoubleType extends NumericType {\n}", "@java.lang.Override\n public double getRealValue() {\n if (typeCase_ == 4) {\n return (java.lang.Double) type_;\n }\n return 0D;\n }", "double getEDouble();", "public boolean isDouble();", "long getNumericField();", "@Test\n public void test_column_type_detection_double() throws SQLException {\n ColumnInfo info = testColumnTypeDetection(\"x\", NodeFactory.createLiteral(\"12.3e4\", XSDDatatype.XSDdouble), true, Types.DOUBLE, Double.class.getCanonicalName());\n Assert.assertEquals(16, info.getScale());\n Assert.assertEquals(16, info.getPrecision());\n Assert.assertTrue(info.isSigned());\n }", "public abstract double read_double();", "public static void main(String[] args) {\ndouble anInt=1234;\nbyte aByte=12;\nshort aShort=12;\nlong aLong=1234567890987654321L;\ndouble anotherInt= (anInt * 10000000);\nSystem.out.println(\"The int is \" + anInt);\nSystem.out.println(\"The byte is \" + aByte);\nSystem.out.println(\"The short is \" + aShort);\nSystem.out.println(\"The long is \" + aLong);\nSystem.out.println(\"Another int is \" + anotherInt); \n\t}", "public abstract Double toDouble(T t);", "default T handleNumber(double val) {\n throw new UnsupportedOperationException();\n }", "public static Double toDouble(Object o,byte type) throws ExecException {\n try {\n switch (type) {\n case BOOLEAN:\n return (Boolean) o ? Double.valueOf(1.0D) : Double.valueOf(0.0D);\n\n case INTEGER:\n return new Double(((Integer)o).doubleValue());\n\n case LONG:\n return new Double(((Long)o).doubleValue());\n\n case FLOAT:\n return new Double(((Float)o).doubleValue());\n\n case DOUBLE:\n return (Double)o;\n\n case DATETIME:\n return new Double(Long.valueOf(((DateTime)o).getMillis()).doubleValue());\n\n case BYTEARRAY:\n return Double.valueOf(((DataByteArray)o).toString());\n\n case CHARARRAY:\n return Double.valueOf((String)o);\n\n case BIGINTEGER:\n return Double.valueOf(((BigInteger)o).doubleValue());\n\n case BIGDECIMAL:\n return Double.valueOf(((BigDecimal)o).doubleValue());\n\n case NULL:\n return null;\n\n case BYTE:\n case MAP:\n case INTERNALMAP:\n case TUPLE:\n case BAG:\n case UNKNOWN:\n default:\n int errCode = 1071;\n String msg = \"Cannot convert a \" + findTypeName(o) +\n \" to a Double\";\n throw new ExecException(msg, errCode, PigException.INPUT);\n }\n } catch (ClassCastException cce) {\n throw cce;\n } catch (ExecException ee) {\n throw ee;\n } catch (NumberFormatException nfe) {\n int errCode = 1074;\n String msg = \"Problem with formatting. Could not convert \" + o + \" to Double.\";\n throw new ExecException(msg, errCode, PigException.INPUT, nfe);\n } catch (Exception e) {\n int errCode = 2054;\n String msg = \"Internal error. Could not convert \" + o + \" to Double.\";\n throw new ExecException(msg, errCode, PigException.BUG);\n }\n }", "private void validate(Adouble val) {\r\n Assertions.assertEquals(val.aonType(), Atype.DOUBLE);\r\n Assertions.assertEquals(val, val);\r\n Assertions.assertEquals(val, Adouble.valueOf(val.toDouble()));\r\n Assertions.assertEquals(val.hashCode(), Adouble.valueOf(val.toDouble()).hashCode());\r\n Assertions.assertTrue(val.isNumber());\r\n }", "public static interface DataTypeWithRatioScale<T> {\r\n \r\n /**\r\n * Add\r\n *\r\n * @param augend\r\n * @param addend\r\n * @return\r\n */\r\n public abstract T add(T augend, T addend);\r\n\r\n /**\r\n * Compare\r\n *\r\n * @param s1\r\n * @param s2\r\n * @return\r\n * @throws NumberFormatException\r\n * @throws ParseException\r\n */\r\n public abstract int compare(String s1, String s2) throws NumberFormatException,\r\n ParseException;\r\n\r\n /**\r\n * Compare\r\n *\r\n * @param t1\r\n * @param t2\r\n * @return\r\n */\r\n public abstract int compare(T t1, T t2);\r\n\r\n /**\r\n * Divide\r\n *\r\n * @param dividend\r\n * @param divisor\r\n * @return\r\n */\r\n public abstract String divide(String dividend, String divisor);\r\n \r\n /**\r\n * Divide\r\n *\r\n * @param dividend\r\n * @param divisor\r\n * @return\r\n */\r\n public abstract T divide(T dividend, T divisor);\r\n \r\n /**\r\n * Format\r\n *\r\n * @param t\r\n * @return\r\n */\r\n public abstract String format(T t);\r\n\r\n /**\r\n * Converts a double into a value.\r\n *\r\n * @param s\r\n * @return\r\n */\r\n public abstract T fromDouble(Double d);\r\n\r\n /**\r\n * Description\r\n *\r\n * @return\r\n */\r\n public abstract DataTypeDescription<T> getDescription();\r\n\r\n /**\r\n * Maximum\r\n *\r\n * @return\r\n */\r\n public T getMaximum();\r\n \r\n /**\r\n * Minimum\r\n *\r\n * @return\r\n */\r\n public T getMinimum();\r\n\r\n /**\r\n * Valid\r\n *\r\n * @param s\r\n * @return\r\n */\r\n public abstract boolean isValid(String s);\r\n\r\n /**\r\n * Multiply\r\n *\r\n * @param multiplicand\r\n * @param multiplicator\r\n * @return\r\n */\r\n public abstract String multiply(String multiplicand,\r\n String multiplicator);\r\n\r\n /**\r\n * Multiply\r\n *\r\n * @param multiplicand\r\n * @param multiplicator\r\n * @return\r\n */\r\n public abstract T multiply(T multiplicand, double multiplicator);\r\n\r\n /**\r\n * Multiply\r\n *\r\n * @param multiplicand\r\n * @param multiplicator\r\n * @return\r\n */\r\n public abstract T multiply(T multiplicand, int multiplicator);\r\n\r\n /**\r\n * Multiply\r\n *\r\n * @param multiplicand\r\n * @param multiplicator\r\n * @return\r\n */\r\n public abstract T multiply(T multiplicand, T multiplicator);\r\n \r\n /**\r\n * Parse\r\n *\r\n * @param s\r\n * @return\r\n */\r\n public abstract T parse(String s);\r\n\r\n /**\r\n * Divide\r\n *\r\n * @param dividend\r\n * @param divisor\r\n * @return\r\n */\r\n public abstract double ratio(T dividend, T divisor);\r\n \r\n /**\r\n * Subtract\r\n *\r\n * @param minuend\r\n * @param subtrahend\r\n * @return\r\n */\r\n public abstract T subtract(T minuend, T subtrahend);\r\n \r\n /**\r\n * Converts a double into a value.\r\n *\r\n * @param s\r\n * @return\r\n */\r\n public abstract Double toDouble(T t);\r\n }", "public abstract T fromDouble(Double d);", "public double getRealValue() {\n if (typeCase_ == 4) {\n return (java.lang.Double) type_;\n }\n return 0D;\n }", "Double getDoubleValue();", "double getRealValue();", "private double convertToDbl(Object a) {\n double result = 0;\n\n //If the object is a Character...\n if(a instanceof Character){\n char x = (Character)a;\n result = (double)(x - '0'); // -'0' as it will convert the ascii number (e.g 4 is 52 in ascii) to the standard number\n }\n\n //If it is a Double...\n else if(a instanceof Double){\n result = (Double)a;\n }\n\n return result;\n }", "public boolean isDouble() {\n return this.data instanceof Double;\n }", "public abstract double getasDouble(int tuple, int val);", "public boolean isDouble() {\n return false;\n }", "@Override\n public Double value(TypeOfValue value);", "public abstract double readAsDbl(int offset);", "double readDouble()\n throws IOException {\n return Double.longBitsToDouble( readLong() );\n }", "public abstract Double getDataValue();", "private static int m6082a(Class<?> cls) {\n if (cls == Double.TYPE) {\n return 1;\n }\n if (cls == Float.TYPE) {\n return 2;\n }\n if (cls == Long.TYPE) {\n return 3;\n }\n if (cls == Integer.TYPE) {\n return 4;\n }\n if (cls == Short.TYPE) {\n return 5;\n }\n if (cls == Character.TYPE) {\n return 6;\n }\n if (cls == Byte.TYPE) {\n return 7;\n }\n if (cls == Boolean.TYPE) {\n return 99;\n }\n return 8;\n }", "double getDoubleValue2();", "double readDouble();", "Double getValue();", "private static double getLongt() {\n\t\treturn longt;\n\t}", "public double getDouble();", "boolean hasDouble();", "public abstract void writeAsDbl(int offset, double d);", "public boolean realAsDouble() {\n return false;\n }", "public abstract Number getPrimitiveType();", "double getDoubleValue1();", "int getSimpleType() {\n\t\treturn ((type / 1000)) * 1000;\n\t}", "private double readDouble() throws IOException {\n\t\treturn (isBigEndian ? ioReadDouble() : Double.longBitsToDouble(readLELong()));\n\t}", "public static void main(String[] args){\n short num=100;\n int inum=num;\n long lnum=num;\n float fnum=num;\n double dnum=num;\n //When you assign value of one data type to another,\n // the two types might not be compatible with each other.\n // If the data types are compatible,\n // then Java will perform the conversion automatically known as Automatic Type Conversion and\n // if not then they need to be casted or converted explicitly.\n //this happens only when\n //The two data types are compatible.\n //When we assign value of a smaller data type to a bigger data type.(byte<short<int<long<float<double)\n //For Example, in java the numeric data types are compatible with each other\n // but no automatic conversion is supported from numeric type to char or boolean.\n // Also, char and boolean are not compatible with each other.\n System.out.println(\"num is \"+num);\n System.out.println(\"inum is \"+inum);\n System.out.println(\"lnum is \"+lnum);\n System.out.println(\"fnum is \"+fnum);\n System.out.println(\"dnum is \"+dnum);\n\n //Narrowing or Explicit conversion\n dnum=323.142;\n byte bnum=(byte)dnum;//converting bigger data type o smaller data type\n //so explicit conversion is needed\n System.out.println(\"dnum converted to bnum(byte) is \"+bnum);\n\n }", "public static double longToDouble(long l) {\n return (double) l;\n }", "public void testDoubleValue() {\n AtomicLong ai = new AtomicLong();\n assertEquals(0.0d, ai.doubleValue());\n for (long x : VALUES) {\n ai.set(x);\n assertEquals((double)x, ai.doubleValue());\n }\n }", "double getDoubleValue3();", "public static void main(String[] args) {\n // example of type casting\n // it will store the double and store it as an int.\n //by default, java will round down\n\n int a = (int) 0.5;\n System.out.println(a);\n //results will be 0\n\n\n //some primitive data types - byte, short, char, int, long, float, double\n\n // byte a;\n // short b;\n // char c;\n // int d;\n // long e;\n // float f;\n // double g;\n\n //if you were to use int and then store it to double, it will cast to double by default.\n\n //it will work its way down this primitive types data\n\n \n }", "public static void testOfDoubleNumberIsInteger(){\n\t\tSystem.out.println(\"please enter a double number: \");\n\t\tScanner scann=new Scanner(System.in);\n\t\tdouble x=scann.nextDouble();\n\t\tif(x%1==0)\n\t\t\tSystem.out.println(\"The number you have enterd it's not a double \");\n\t\telse\n\t\t\tSystem.out.println(\"The number you have entered it's double\");\n\t}", "private final double get_DOUBLE(int column) {\n if (metadata.isZos()) {\n byte[] bytes = new byte[8];\n dataBuffer_.getBytes(columnDataPosition_[column - 1], bytes);\n return FloatingPoint.getDouble_hex(bytes, 0);\n //return dataBuffer_.getDouble(columnDataPosition_[column - 1]);\n } else {\n return dataBuffer_.getDoubleLE(columnDataPosition_[column - 1]);\n// return FloatingPoint.getDouble(dataBuffer_,\n// columnDataPosition_[column - 1]);\n }\n }", "public static void main(String[] args) {\n\n Integer num1 = 100;\n double num2 = num1;\n System.out.println(num2);\n\n float f = 0.5f;\n Float fl = f;\n System.out.println(fl);\n\n System.out.println(Byte.MAX_VALUE);\n\n // parse method --> converting String value to primitives, returne primitive\n // valueOf --> converting String to Wrapper class, return Wrapper class\n\n String str1 = \"123\";\n int result = Integer.parseInt(str1);\n System.out.println(result+1);\n\n String str2 = \"true\";\n boolean r1 = Boolean.parseBoolean(str2);\n System.out.println(r1);\n\n // parse method not case sencetive\n String str3 = \"FaLse\"; // it is work\n boolean r2 = Boolean.parseBoolean(str3);\n System.out.println(r2);\n\n String s1 = \"100.5\";\n Double c1 = Double.parseDouble(s1);\n System.out.println(c1 + 1); // it is call auto boxing\n Double c2 = Double.valueOf(s1); // this in not auto and not unboxing\n\n System.out.println(c1);\n System.out.println(c2);\n\n String s2 = \"TrUe\";\n Boolean b1 = Boolean.valueOf(s2);\n System.out.println(b1); // no sensetive\n\n Double [] arr = new Double[3];\n System.out.println(Arrays.toString(arr));\n // default value of wrapper class always --> null, null, null\n\n String name = \"string\";\n String name1 = new String(\"string\");\n\n Integer I1 = new Integer(\"123\");\n\n System.out.println(addNum(12,13));\n System.out.println(addNum(15.3,7.4));\n \n }", "public interface Numeric extends DataType {\n}", "@ZenCodeType.Caster\n @ZenCodeType.Method\n default double asDouble() {\n \n return notSupportedCast(BasicTypeID.DOUBLE);\n }", "public native double __doubleMethod( long __swiftObject, double arg );", "int toInt (double val) {\n return (int)val;\n }", "public double castToDoubleValue() {\n throw new IteratorFlowException(\"Cannot call castToDouble on non numeric\");\n }", "@Test\n\tpublic void test_TCM__double_getDoubleValue() {\n\t\tAttribute attr = new Attribute(\"test\", \"11111111111111\");\n\t\ttry {\n\t\t\tassertTrue(\"incorrect double value\", attr.getDoubleValue() == 11111111111111d );\n\n\t\t\tattr.setValue(\"0\");\n\t\t\tassertTrue(\"incorrect double value\", attr.getDoubleValue() == 0 );\n\n\t\t\tattr.setValue(Double.toString(java.lang.Double.MAX_VALUE));\n\t\t\tassertTrue(\"incorrect double value\", attr.getDoubleValue() == java.lang.Double.MAX_VALUE);\n\n\t\t\tattr.setValue(Double.toString(java.lang.Double.MIN_VALUE));\n\t\t\tassertTrue(\"incorrect double value\", attr.getDoubleValue() == java.lang.Double.MIN_VALUE);\n\n\t\t} catch (DataConversionException e) {\n\t\t\tfail(\"couldn't convert boolean value\");\n\t\t}\n\n\t\ttry {\n\t\t\tattr.setValue(\"foo\");\n\t\t\tfail(\"incorrectly returned double from non double value\" + attr.getDoubleValue());\n\n\t\t} catch (DataConversionException e) {\n\t\t\t// Do nothing\n\t\t} catch (Exception e) {\n\t\t\tfail(\"Unexpected exception \" + e.getClass());\n\t\t}\n\n\t}", "public static void main(String[] args)\n {\n double x = 5.3;\n int y = (int)x;\n \n }", "private void ex04(){\n int number;\n number = 1;\n\n double number2;\n number2 = 1.5;\n\n String number3;\n number3 = \"3\";\n\n boolean bool = (number == 1);\n\n myWindow.clearOut();\n myWindow.writeOutLine(number);\n myWindow.writeOutLine(new String(String.valueOf(number))); //int to string\n myWindow.writeOutLine((double) number); //int to double\n myWindow.writeOutLine(bool); //int to boolean\n\n /*\n Java can perform number -> string\n method 1: numberType.toString\n method 2: String.valueOf(int/double/float) //used above in the code\n Java can also perform string -> number\n dataType.parseDatatype() // e.g.: Integer.parseInt()\n\n Java allows this only when the conversion is widening (small -> larger)\n alternatively reports a compile error if the conversion is narrowing\n */\n\n //YOUR CODE ABOVE HERE\n }", "public int getAxisType()\n {\n return DOUBLE;\n }", "private double convertDouble()\n\t{\n\t\tString val = tokens[10];\n\t\tdouble value = 0.0;\n\t\ttry {\n\t\t\tvalue = Double.parseDouble(tokens[10]);\n\t\t}\n\t\tcatch(NumberFormatException e) {\n\t\t\tSystem.err.print(\"\");\n\t\t}\n\t\treturn value;\n\t}", "public static void main(String[] args){\n long money = 500000; //not equal datatype, so implicit type casting\n long money1 = 500000L; //Recommendation\n\n System.out.println(money);\n System.out.println(money1);\n\n //JVM default float is double(8byte)\n //float pi = 3.141592; //compile error, incompatible types\n float PI = 3.141592f; // f or F\n double dd = 152.12331;\n System.out.println(PI);\n System.out.println(dd);\n }", "private Type get_value_type(long xx) {\n Type vt = _values.get(xx);\n assert vt!=null;\n return vt;\n }", "private static native boolean set_0(long nativeObj, int propId, double value);", "public static void main(String[] args) {\n\n\t\tSystem.out.println( \"Min value of Byte :\"+ Byte.MIN_VALUE); \n\t\tSystem.out.println( \"Max value of Byte :\"+ Byte.MAX_VALUE); \n\n\t\tSystem.out.println();\n\t\t\n\t\tSystem.out.println( \"Min value of Short :\"+ Short.MIN_VALUE); \n\t\tSystem.out.println( \"Max value of Short :\"+ Short.MAX_VALUE); \n\n\t\tSystem.out.println();\n\t\t\n\t\tSystem.out.println( \"Min value of Integer :\"+ Integer.MIN_VALUE); \n\t\tSystem.out.println( \"Max value of Integer :\"+ Integer.MAX_VALUE); \n\n\t\tSystem.out.println();\n\t\t\n\t\tSystem.out.println( \"Min value of Long :\"+ Long.MIN_VALUE); \n\t\tSystem.out.println( \"Max value of Long :\"+ Long.MAX_VALUE); \n\n\t\t// l should be at the end of value\n\t\tlong number1 = 9223372036854775807l;\n\t\tSystem.out.println( \"After adding l at end of the long number \" + number1);\n\t\t\n\t\tSystem.out.println();\n\t\t\n\t\t\n\t\t/* *\n\t\t * Decimal Data Types *\n\t\t * \t\t-----------------\t *\n\t\t *\t\t\t\t\t\t\t *\n\t\t*/\n\t\t\n\t\t// 1. float \t\t2. double\n\n\t\tSystem.out.println( \"Min value of float :\"+ Float.MIN_VALUE); \n\t\tSystem.out.println( \"Max value of float :\"+ Float.MAX_VALUE); \n\t\t\n\t\t// f should be at the end of value\n\t\tfloat decimal1 = 32245.12123f;\n\t\t\n\t\tSystem.out.println( \"After adding f at the end of the float\" + decimal1);\n\t\t\n\t\tSystem.out.println();\n\n\t\tSystem.out.println( \"Min value of double :\"+ Double.MIN_VALUE); \n\t\tSystem.out.println( \"Max value of double :\"+ Double.MAX_VALUE); \n\n\t\tSystem.out.println();\n\t\t\n\t\t\n\t\t\n\t\t/* *\n\t\t * Character Data Types *\n\t\t * \t --------------------\t *\n\t\t *\t\t\t\t\t\t\t *\n\t\t*/\n\t\t\n\t\t\n\t\t// 1. char \t\t\t2. String( int 2 bytes)\n\n\t\t// can only contain single letter\n\t\tchar ch = 'a'; \n\t\tSystem.out.println( \"Single character :\"+ ch);\n\t\t\n\t\t// can contain unicode values \n\t\tchar unicode = '\\u0000';\n\t\tSystem.out.println( \"Unicodes are stored but not shown :\"+ unicode);\n\t\t\n\t\t// are stored in int\n\t\tint num = 'a';\n\t\tSystem.out.println( \"character stored in int:\"+num);\n\t\t\n\t\tSystem.out.println();\n\t\t\n\n\t\tString str = \"Hello\" + \" World\";\n\t\tSystem.out.println(str);\n\n\t}", "public static void main(String[] args)\n {\n\n double myDouble = 3.14;\n float myFloat = 3.14f; //Removing the f will cause an error due to lossy conversion\n double yourDouble = myFloat; //Widening/lossless conversions won't raise errors\n }", "public abstract double GetRaw();", "public int getDataType()\n {\n return dtype;\n }", "public Double\n getDoubleValue() \n {\n return ((Double) getValue());\n }", "private Object getTypeObjectPair() throws MathLinkException, NumberRangeException {\n Object result = null;\n int type = this.getInteger();\n if (type % -17 == -15) {\n type = -7 + -17 * (type / -17);\n } else if (type % -17 == -16) {\n type = -8 + -17 * (type / -17);\n }\n switch (type) {\n case -5: {\n result = new Integer(this.getInteger());\n break;\n }\n case -6: {\n result = new Long(this.getLongInteger());\n break;\n }\n case -4: {\n int i = this.getInteger();\n if (i < -32768 || i > 32767) {\n throw new NumberRangeException(i, \"short\");\n }\n result = new Short((short)i);\n break;\n }\n case -2: {\n int i = this.getInteger();\n if (i < -128 || i > 127) {\n throw new NumberRangeException(i, \"byte\");\n }\n result = new Byte((byte)i);\n break;\n }\n case -3: {\n int i = this.getInteger();\n if (i < 0 || i > 65535) {\n throw new NumberRangeException(i, \"char\");\n }\n result = new Character((char)i);\n break;\n }\n case -15: \n case -7: {\n double d = this.getDouble();\n if (d < -3.4028234663852886E38 || d > 3.4028234663852886E38) {\n throw new NumberRangeException(d, \"float\");\n }\n result = new Float((float)d);\n break;\n }\n case -16: \n case -8: {\n result = new Double(this.getDouble());\n break;\n }\n case -9: {\n int tok = this.getType();\n if (tok == 100000) {\n result = this.getObject();\n break;\n }\n result = this.getString();\n if (tok != 35 || !result.equals(\"Null\")) break;\n result = null;\n break;\n }\n case -1: {\n String s = this.getSymbol();\n if (s.equals(\"True\")) {\n result = Boolean.TRUE;\n break;\n }\n result = Boolean.FALSE;\n break;\n }\n case -13: {\n long mark = this.createMark();\n try {\n int tok = this.getNext();\n if (tok == 100000) {\n result = this.getObject();\n break;\n }\n if (tok == 35) {\n result = this.getSymbol();\n if (result.equals(\"Null\")) {\n result = null;\n break;\n }\n this.seekMark(mark);\n result = this.getComplex();\n break;\n }\n this.seekMark(mark);\n result = this.getComplex();\n }\n finally {\n this.destroyMark(mark);\n }\n }\n case -10: {\n long mark = this.createMark();\n try {\n int tok = this.getType();\n if (tok == 100000) {\n result = this.getObject();\n break;\n }\n if (tok == 35) {\n result = this.getSymbol();\n if (result.equals(\"Null\")) {\n result = null;\n break;\n }\n result = new BigInteger((String)result);\n break;\n }\n result = new BigInteger(this.getString());\n }\n finally {\n this.destroyMark(mark);\n }\n }\n case -11: {\n long mark = this.createMark();\n try {\n int tok = this.getType();\n if (tok == 100000) {\n result = this.getObject();\n break;\n }\n if (tok == 35) {\n result = this.getSymbol();\n if (result.equals(\"Null\")) {\n result = null;\n break;\n }\n result = Utils.bigDecimalFromString((String)result);\n break;\n }\n result = Utils.bigDecimalFromString(this.getString());\n }\n finally {\n this.destroyMark(mark);\n }\n }\n case -12: {\n long mark = this.createMark();\n try {\n int tok = this.getNext();\n if (tok == 100000 && (result = this.getObject()) != null) break;\n this.seekMark(mark);\n result = this.getExpr();\n }\n finally {\n this.destroyMark(mark);\n }\n }\n case -14: {\n result = this.getObject();\n break;\n }\n case -10000: {\n break;\n }\n default: {\n int tok = this.getNext();\n result = tok == 100000 || tok == 35 ? this.getObject() : (type > -34 ? this.getArray(type - -17, 1) : (type > -51 ? this.getArray(type - -34, 2) : (type > -68 ? this.getArray(type - -51, 3) : (type > -85 ? this.getArray(type - -68, 4) : this.getArray(type - -85, 5)))));\n }\n }\n return result;\n }", "private static native double get_0(long nativeObj, int propId);", "public double doubleValue() {\r\n return (double) intValue();\r\n }", "public static void isValid(double dbl) throws IllegalArgumentException {\n\t//nothing to do here\n }", "public double asDouble() {\r\n\t\tif (this.what == SCALARTYPE.Integer || this.what == SCALARTYPE.Float) {\r\n\t\t\treturn (new BigDecimal(this.scalar)).doubleValue();\r\n\t\t} else\r\n\t\t\treturn 0; // ritorna un valore di default\r\n\t}", "public static void main(String[] args) {\n\t\tdouble d=10;\n\t\tSystem.out.println(d);\n\t\t\n\t\tint i=(int)10.99;\n\t\tSystem.out.println(i);\n\t\tbyte b=(byte)1243;\n\t\tSystem.out.println(b);\n\t\t\n\n\t}", "double getFloatingPointField();", "@Override\n public Type evaluateType() throws Exception {\n return new IntegerType();\n }", "public abstract double getValue();", "private boolean isNumber(Object o) {\n\t\tif(o instanceof String) return isNumber((String) o);\n\t\telse if(o instanceof Double) return true;\n\t\telse return false;\n\t}", "private static double m6088b(Object obj) {\n Method method = null;\n Object obj2 = obj;\n while (!(obj2 instanceof Number)) {\n if (obj2 instanceof String) {\n return ScriptRuntime.m6309a((String) obj2);\n }\n if (!(obj2 instanceof Scriptable)) {\n try {\n method = obj2.getClass().getMethod(\"doubleValue\");\n } catch (NoSuchMethodException | SecurityException e) {\n }\n if (method != null) {\n try {\n return ((Number) method.invoke(obj2)).doubleValue();\n } catch (IllegalAccessException e2) {\n m6091c(obj2, Double.TYPE);\n } catch (InvocationTargetException e3) {\n m6091c(obj2, Double.TYPE);\n }\n }\n return ScriptRuntime.m6309a(obj2.toString());\n } else if (!(obj2 instanceof Wrapper)) {\n return ScriptRuntime.m6395b(obj2);\n } else {\n obj2 = ((Wrapper) obj2).mo18879a();\n }\n }\n return ((Number) obj2).doubleValue();\n }", "void checkSameDataType(String datatype, String datatype1)\n {\n DefaultTableModel semanticerror = (DefaultTableModel)tblErrorSemantic.getModel();\n if(datatype.equals(datatype1))\n {\n\n }\n else if(datatype.equals(\"INT\") && datatype1.equals(\"FLOAT\"))\n {\n \n }\n else if(datatype.equals(\"FLOAT\") && datatype1.equals(\"INT\"))\n {\n \n }\n else if(datatype1 == null)\n {\n\n }\n else\n {\n semanticerror.addRow(new Object[] {tblLexeme.getModel().getValueAt(tokenPos-2, 0),\"Incompatible Types: \"+datatype1+\" Cannot be converted to \"+datatype, tblLexeme.getModel().getValueAt(tokenPos-2, 2)}); \n } \n datatype = null;\n }", "public long longValue() {\n\t\treturn (long) mDouble;\n\t}", "private void m2248a(double d, String str) {\n this.f2954c = d;\n this.f2955d = (long) d;\n this.f2953b = str;\n this.f2952a = ValueType.doubleValue;\n }", "@Override\n public String getDataType() {\n return getPrimitiveType().name();\n }", "@Override\n public double nextDouble() {\n return super.nextDouble();\n }", "public double getAsDouble(int index) {\n switch (type) {\n case TIFFTag.TIFF_BYTE: case TIFFTag.TIFF_UNDEFINED:\n return ((byte[])data)[index] & 0xff;\n case TIFFTag.TIFF_SBYTE:\n return ((byte[])data)[index];\n case TIFFTag.TIFF_SHORT:\n return ((char[])data)[index] & 0xffff;\n case TIFFTag.TIFF_SSHORT:\n return ((short[])data)[index];\n case TIFFTag.TIFF_SLONG:\n return ((int[])data)[index];\n case TIFFTag.TIFF_LONG: case TIFFTag.TIFF_IFD_POINTER:\n return ((long[])data)[index];\n case TIFFTag.TIFF_FLOAT:\n return ((float[])data)[index];\n case TIFFTag.TIFF_DOUBLE:\n return ((double[])data)[index];\n case TIFFTag.TIFF_SRATIONAL:\n int[] ivalue = getAsSRational(index);\n return (double)ivalue[0]/ivalue[1];\n case TIFFTag.TIFF_RATIONAL:\n long[] lvalue = getAsRational(index);\n return (double)lvalue[0]/lvalue[1];\n case TIFFTag.TIFF_ASCII:\n String s = ((String[])data)[index];\n return Double.parseDouble(s);\n default:\n throw new ClassCastException();\n }\n }", "@Ignore\n @Test(expected = IllegalArgumentException.class)\n public void require_that_illegal_double_throws_exception() throws IOException {\n Slime slime = new Slime();\n Cursor root = slime.setObject();\n root.setString(\"doubleval\", \"invalid\");\n InnerCNode def = new DefParser(\"simpletypes\", new StringReader(StringUtilities.implode(SimpletypesConfig.CONFIG_DEF_SCHEMA, \"\\n\"))).getTree();\n new ConfigFileFormat(def).encode(new ByteArrayOutputStream(), slime);\n }", "private double IntegerParseIn(double Precio) {\n throw new UnsupportedOperationException(\"Not supported yet.\"); //To change body of generated methods, choose Tools | Templates.\n }", "@java.lang.Override\n public long getLongValue() {\n if (typeCase_ == 3) {\n return (java.lang.Long) type_;\n }\n return 0L;\n }", "public abstract double[] getasDouble(int tuple);", "double getValue();", "double getValue();", "double getValue();", "public static double leerDouble() {\n\t\tthrow new UnsupportedOperationException();\n\t}", "public OCFloat(OCInteger lenType)\r\n {\r\n super(lenType);\r\n setLength(4);\r\n }", "void mo130799a(double d);", "public static double datodouble(){\n try {\n Double f=new Double(dato());\n return(f.doubleValue());\n } catch (NumberFormatException error) {\n return(Double.NaN);\n }\n }", "private TsPrimitiveType readOneValue() {\n switch (dataType) {\n case BOOLEAN:\n return new TsBoolean(valueDecoder.readBoolean(valueInputStream));\n case INT32:\n return new TsInt(valueDecoder.readInt(valueInputStream));\n case INT64:\n return new TsLong(valueDecoder.readLong(valueInputStream));\n case FLOAT:\n return new TsFloat(valueDecoder.readFloat(valueInputStream));\n case DOUBLE:\n return new TsDouble(valueDecoder.readDouble(valueInputStream));\n case TEXT:\n return new TsBinary(valueDecoder.readBinary(valueInputStream));\n default:\n break;\n }\n throw new UnSupportedDataTypeException(\"Unsupported data type :\" + dataType);\n }", "int getDataTypeValue();", "public static double isDouble() {\n\t\twhile (true) {\n\t\t\ttry {\n\t\t\t\treturn input.nextDouble();\n\t\t\t} catch (InputMismatchException e) {\n\t\t\t\tinput.next();\n\t\t\t\tSystem.out.println(\"Vas unos nije odgovarajuci. Probajte ponovo: \");\n\t\t\t}\n\t\t}\n\t}", "void writeDouble(double value);", "@Override\n\tpublic Type getType() {\n\t\treturn Type.FLOAT;\n\t}" ]
[ "0.66770065", "0.63548017", "0.6348221", "0.6342794", "0.6286748", "0.6286562", "0.62415045", "0.62285113", "0.6176737", "0.61717606", "0.60764956", "0.60742694", "0.6066293", "0.6032801", "0.60286814", "0.6025049", "0.601542", "0.5959509", "0.59377545", "0.59002924", "0.5898876", "0.58972657", "0.58942175", "0.58928376", "0.5890025", "0.5873796", "0.58692664", "0.58477724", "0.58214265", "0.5804629", "0.57761407", "0.57657284", "0.5718842", "0.5710443", "0.56878364", "0.568356", "0.5680416", "0.5666828", "0.56609714", "0.5641718", "0.5640917", "0.5633694", "0.5608703", "0.56061804", "0.56019515", "0.5595205", "0.5578014", "0.5568802", "0.5529873", "0.55279505", "0.5524837", "0.5515821", "0.5509604", "0.5501653", "0.5497232", "0.549532", "0.5495134", "0.5486931", "0.54703414", "0.5466086", "0.54644877", "0.54643434", "0.5463716", "0.54481673", "0.5445194", "0.5442178", "0.5441387", "0.5441341", "0.54276496", "0.54275256", "0.5420042", "0.5417336", "0.5409133", "0.54077333", "0.540576", "0.5402641", "0.5395491", "0.5382886", "0.5371896", "0.53703064", "0.53614116", "0.53531736", "0.5352584", "0.53459674", "0.53457373", "0.5343557", "0.5335971", "0.5335881", "0.5332064", "0.5320062", "0.5320062", "0.5320062", "0.5316006", "0.530932", "0.5305781", "0.530556", "0.53034633", "0.52949995", "0.5286672", "0.5277252", "0.5266497" ]
0.0
-1
there will be issue when the type is double/int/long
protected void setBrief(UiAction uiAction, ResultSet rs, int rowNumber) throws SQLException{ String brief = rs.getString(UiActionTable.COLUMN_BRIEF); if(brief == null){ //do nothing when nothing found in database return; } uiAction.setBrief(brief); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\n public Class getValueType() {\n return Double.class;\n }", "public static void main(String args[]) {\n\t\t \n\t\t // lets define some variables and try to insert other data type value\n\t\t int x = 23;\n\t\t double y ;\n\t\t y = x ; // here we are storing int to double ie. smaller to larger . So no error\n\t\t System.out.println(y);\n\t\t System.out.println(x);\n\t\t \n\t\t double a = 25.28;\n\t\t int b ;\n\t\t //b = a; // Here we can see error since we are trying to store double to int i.e larger to smaller w/o casting\n\t\t \n\t\t // lets do casting and store \n\t\t b = (int) a;\n\t\t System.out.println(b);\n\t\t \n\t\t boolean bool = true ;\n\t\t int num = bool; // not possible as we know boolean data type cannot be typecast;\n\t\t \n\t\t //int to long\n\t\t int value = 34;\n\t\t long value1 ;\n\t\t \n\t\t value1 = value;\n\t\t System.out.println(value1);\n\t\t value = value1; // trying longer to smaller w/o casting which is not possible;\n\t\t System.out.println(value);\n\t\t \n\t\t value = (int) value1;\n\t\t \n\t\t // long to float \n\t\t \n\t\t long value2 = 678;\n\t\t float value3; \n\t\t value3 = value2; // works fine since smaller to larger\n\t\t System.out.println(value3);\n\t\t value2 = value3 ; // trying longer to smaller w/o casting which is not possible;\n\t\t \n\t\t // so to assign value3 to value2 we need Explicitly type cast\n\t\t value2 = (long) value3;\n\t\t \n\t\t // float to long and vice versa \n\t\t \n\t\t float value4 = 567.78f;\n\t\t double value5 ;\n\t\t value5 = value4 ; // works fine since assigning smaller type to larger type\n\t\t System.out.println(value5);\n\t\t value4 = value5 ; // trying longer to smaller w/o casting which is not possible;\n\t\t \n\t\t // Also we can explicit cast for storing larger (double) to long/int/short\n\t\t double value6 = 3564.8;\n\t\t int value7 ;\n\t\t \n\t\t value7 = (int) value6;\n\t\t System.out.println(value7);\n\t\t \n\t\t \n\t\t \n\t\t \n\t\t \n\t }", "@Override\n\tpublic void visit(DoubleType n) {\n\t\t\n\t}", "private void functionalInterfacesForDoubleIntLong() {\n double d = 1.0;\n DoubleToIntFunction f1 = x -> 1;\n f1.applyAsInt(d);\n\n }", "public interface DoubleType extends NumericType {\n}", "@java.lang.Override\n public double getRealValue() {\n if (typeCase_ == 4) {\n return (java.lang.Double) type_;\n }\n return 0D;\n }", "double getEDouble();", "public boolean isDouble();", "long getNumericField();", "@Test\n public void test_column_type_detection_double() throws SQLException {\n ColumnInfo info = testColumnTypeDetection(\"x\", NodeFactory.createLiteral(\"12.3e4\", XSDDatatype.XSDdouble), true, Types.DOUBLE, Double.class.getCanonicalName());\n Assert.assertEquals(16, info.getScale());\n Assert.assertEquals(16, info.getPrecision());\n Assert.assertTrue(info.isSigned());\n }", "public abstract double read_double();", "public static void main(String[] args) {\ndouble anInt=1234;\nbyte aByte=12;\nshort aShort=12;\nlong aLong=1234567890987654321L;\ndouble anotherInt= (anInt * 10000000);\nSystem.out.println(\"The int is \" + anInt);\nSystem.out.println(\"The byte is \" + aByte);\nSystem.out.println(\"The short is \" + aShort);\nSystem.out.println(\"The long is \" + aLong);\nSystem.out.println(\"Another int is \" + anotherInt); \n\t}", "public abstract Double toDouble(T t);", "default T handleNumber(double val) {\n throw new UnsupportedOperationException();\n }", "public static Double toDouble(Object o,byte type) throws ExecException {\n try {\n switch (type) {\n case BOOLEAN:\n return (Boolean) o ? Double.valueOf(1.0D) : Double.valueOf(0.0D);\n\n case INTEGER:\n return new Double(((Integer)o).doubleValue());\n\n case LONG:\n return new Double(((Long)o).doubleValue());\n\n case FLOAT:\n return new Double(((Float)o).doubleValue());\n\n case DOUBLE:\n return (Double)o;\n\n case DATETIME:\n return new Double(Long.valueOf(((DateTime)o).getMillis()).doubleValue());\n\n case BYTEARRAY:\n return Double.valueOf(((DataByteArray)o).toString());\n\n case CHARARRAY:\n return Double.valueOf((String)o);\n\n case BIGINTEGER:\n return Double.valueOf(((BigInteger)o).doubleValue());\n\n case BIGDECIMAL:\n return Double.valueOf(((BigDecimal)o).doubleValue());\n\n case NULL:\n return null;\n\n case BYTE:\n case MAP:\n case INTERNALMAP:\n case TUPLE:\n case BAG:\n case UNKNOWN:\n default:\n int errCode = 1071;\n String msg = \"Cannot convert a \" + findTypeName(o) +\n \" to a Double\";\n throw new ExecException(msg, errCode, PigException.INPUT);\n }\n } catch (ClassCastException cce) {\n throw cce;\n } catch (ExecException ee) {\n throw ee;\n } catch (NumberFormatException nfe) {\n int errCode = 1074;\n String msg = \"Problem with formatting. Could not convert \" + o + \" to Double.\";\n throw new ExecException(msg, errCode, PigException.INPUT, nfe);\n } catch (Exception e) {\n int errCode = 2054;\n String msg = \"Internal error. Could not convert \" + o + \" to Double.\";\n throw new ExecException(msg, errCode, PigException.BUG);\n }\n }", "private void validate(Adouble val) {\r\n Assertions.assertEquals(val.aonType(), Atype.DOUBLE);\r\n Assertions.assertEquals(val, val);\r\n Assertions.assertEquals(val, Adouble.valueOf(val.toDouble()));\r\n Assertions.assertEquals(val.hashCode(), Adouble.valueOf(val.toDouble()).hashCode());\r\n Assertions.assertTrue(val.isNumber());\r\n }", "public static interface DataTypeWithRatioScale<T> {\r\n \r\n /**\r\n * Add\r\n *\r\n * @param augend\r\n * @param addend\r\n * @return\r\n */\r\n public abstract T add(T augend, T addend);\r\n\r\n /**\r\n * Compare\r\n *\r\n * @param s1\r\n * @param s2\r\n * @return\r\n * @throws NumberFormatException\r\n * @throws ParseException\r\n */\r\n public abstract int compare(String s1, String s2) throws NumberFormatException,\r\n ParseException;\r\n\r\n /**\r\n * Compare\r\n *\r\n * @param t1\r\n * @param t2\r\n * @return\r\n */\r\n public abstract int compare(T t1, T t2);\r\n\r\n /**\r\n * Divide\r\n *\r\n * @param dividend\r\n * @param divisor\r\n * @return\r\n */\r\n public abstract String divide(String dividend, String divisor);\r\n \r\n /**\r\n * Divide\r\n *\r\n * @param dividend\r\n * @param divisor\r\n * @return\r\n */\r\n public abstract T divide(T dividend, T divisor);\r\n \r\n /**\r\n * Format\r\n *\r\n * @param t\r\n * @return\r\n */\r\n public abstract String format(T t);\r\n\r\n /**\r\n * Converts a double into a value.\r\n *\r\n * @param s\r\n * @return\r\n */\r\n public abstract T fromDouble(Double d);\r\n\r\n /**\r\n * Description\r\n *\r\n * @return\r\n */\r\n public abstract DataTypeDescription<T> getDescription();\r\n\r\n /**\r\n * Maximum\r\n *\r\n * @return\r\n */\r\n public T getMaximum();\r\n \r\n /**\r\n * Minimum\r\n *\r\n * @return\r\n */\r\n public T getMinimum();\r\n\r\n /**\r\n * Valid\r\n *\r\n * @param s\r\n * @return\r\n */\r\n public abstract boolean isValid(String s);\r\n\r\n /**\r\n * Multiply\r\n *\r\n * @param multiplicand\r\n * @param multiplicator\r\n * @return\r\n */\r\n public abstract String multiply(String multiplicand,\r\n String multiplicator);\r\n\r\n /**\r\n * Multiply\r\n *\r\n * @param multiplicand\r\n * @param multiplicator\r\n * @return\r\n */\r\n public abstract T multiply(T multiplicand, double multiplicator);\r\n\r\n /**\r\n * Multiply\r\n *\r\n * @param multiplicand\r\n * @param multiplicator\r\n * @return\r\n */\r\n public abstract T multiply(T multiplicand, int multiplicator);\r\n\r\n /**\r\n * Multiply\r\n *\r\n * @param multiplicand\r\n * @param multiplicator\r\n * @return\r\n */\r\n public abstract T multiply(T multiplicand, T multiplicator);\r\n \r\n /**\r\n * Parse\r\n *\r\n * @param s\r\n * @return\r\n */\r\n public abstract T parse(String s);\r\n\r\n /**\r\n * Divide\r\n *\r\n * @param dividend\r\n * @param divisor\r\n * @return\r\n */\r\n public abstract double ratio(T dividend, T divisor);\r\n \r\n /**\r\n * Subtract\r\n *\r\n * @param minuend\r\n * @param subtrahend\r\n * @return\r\n */\r\n public abstract T subtract(T minuend, T subtrahend);\r\n \r\n /**\r\n * Converts a double into a value.\r\n *\r\n * @param s\r\n * @return\r\n */\r\n public abstract Double toDouble(T t);\r\n }", "public abstract T fromDouble(Double d);", "public double getRealValue() {\n if (typeCase_ == 4) {\n return (java.lang.Double) type_;\n }\n return 0D;\n }", "Double getDoubleValue();", "double getRealValue();", "private double convertToDbl(Object a) {\n double result = 0;\n\n //If the object is a Character...\n if(a instanceof Character){\n char x = (Character)a;\n result = (double)(x - '0'); // -'0' as it will convert the ascii number (e.g 4 is 52 in ascii) to the standard number\n }\n\n //If it is a Double...\n else if(a instanceof Double){\n result = (Double)a;\n }\n\n return result;\n }", "public boolean isDouble() {\n return this.data instanceof Double;\n }", "public abstract double getasDouble(int tuple, int val);", "public boolean isDouble() {\n return false;\n }", "@Override\n public Double value(TypeOfValue value);", "public abstract double readAsDbl(int offset);", "double readDouble()\n throws IOException {\n return Double.longBitsToDouble( readLong() );\n }", "public abstract Double getDataValue();", "private static int m6082a(Class<?> cls) {\n if (cls == Double.TYPE) {\n return 1;\n }\n if (cls == Float.TYPE) {\n return 2;\n }\n if (cls == Long.TYPE) {\n return 3;\n }\n if (cls == Integer.TYPE) {\n return 4;\n }\n if (cls == Short.TYPE) {\n return 5;\n }\n if (cls == Character.TYPE) {\n return 6;\n }\n if (cls == Byte.TYPE) {\n return 7;\n }\n if (cls == Boolean.TYPE) {\n return 99;\n }\n return 8;\n }", "double getDoubleValue2();", "double readDouble();", "Double getValue();", "private static double getLongt() {\n\t\treturn longt;\n\t}", "public double getDouble();", "boolean hasDouble();", "public abstract void writeAsDbl(int offset, double d);", "public boolean realAsDouble() {\n return false;\n }", "public abstract Number getPrimitiveType();", "double getDoubleValue1();", "int getSimpleType() {\n\t\treturn ((type / 1000)) * 1000;\n\t}", "private double readDouble() throws IOException {\n\t\treturn (isBigEndian ? ioReadDouble() : Double.longBitsToDouble(readLELong()));\n\t}", "public static void main(String[] args){\n short num=100;\n int inum=num;\n long lnum=num;\n float fnum=num;\n double dnum=num;\n //When you assign value of one data type to another,\n // the two types might not be compatible with each other.\n // If the data types are compatible,\n // then Java will perform the conversion automatically known as Automatic Type Conversion and\n // if not then they need to be casted or converted explicitly.\n //this happens only when\n //The two data types are compatible.\n //When we assign value of a smaller data type to a bigger data type.(byte<short<int<long<float<double)\n //For Example, in java the numeric data types are compatible with each other\n // but no automatic conversion is supported from numeric type to char or boolean.\n // Also, char and boolean are not compatible with each other.\n System.out.println(\"num is \"+num);\n System.out.println(\"inum is \"+inum);\n System.out.println(\"lnum is \"+lnum);\n System.out.println(\"fnum is \"+fnum);\n System.out.println(\"dnum is \"+dnum);\n\n //Narrowing or Explicit conversion\n dnum=323.142;\n byte bnum=(byte)dnum;//converting bigger data type o smaller data type\n //so explicit conversion is needed\n System.out.println(\"dnum converted to bnum(byte) is \"+bnum);\n\n }", "public static double longToDouble(long l) {\n return (double) l;\n }", "public void testDoubleValue() {\n AtomicLong ai = new AtomicLong();\n assertEquals(0.0d, ai.doubleValue());\n for (long x : VALUES) {\n ai.set(x);\n assertEquals((double)x, ai.doubleValue());\n }\n }", "double getDoubleValue3();", "public static void main(String[] args) {\n // example of type casting\n // it will store the double and store it as an int.\n //by default, java will round down\n\n int a = (int) 0.5;\n System.out.println(a);\n //results will be 0\n\n\n //some primitive data types - byte, short, char, int, long, float, double\n\n // byte a;\n // short b;\n // char c;\n // int d;\n // long e;\n // float f;\n // double g;\n\n //if you were to use int and then store it to double, it will cast to double by default.\n\n //it will work its way down this primitive types data\n\n \n }", "public static void testOfDoubleNumberIsInteger(){\n\t\tSystem.out.println(\"please enter a double number: \");\n\t\tScanner scann=new Scanner(System.in);\n\t\tdouble x=scann.nextDouble();\n\t\tif(x%1==0)\n\t\t\tSystem.out.println(\"The number you have enterd it's not a double \");\n\t\telse\n\t\t\tSystem.out.println(\"The number you have entered it's double\");\n\t}", "private final double get_DOUBLE(int column) {\n if (metadata.isZos()) {\n byte[] bytes = new byte[8];\n dataBuffer_.getBytes(columnDataPosition_[column - 1], bytes);\n return FloatingPoint.getDouble_hex(bytes, 0);\n //return dataBuffer_.getDouble(columnDataPosition_[column - 1]);\n } else {\n return dataBuffer_.getDoubleLE(columnDataPosition_[column - 1]);\n// return FloatingPoint.getDouble(dataBuffer_,\n// columnDataPosition_[column - 1]);\n }\n }", "public static void main(String[] args) {\n\n Integer num1 = 100;\n double num2 = num1;\n System.out.println(num2);\n\n float f = 0.5f;\n Float fl = f;\n System.out.println(fl);\n\n System.out.println(Byte.MAX_VALUE);\n\n // parse method --> converting String value to primitives, returne primitive\n // valueOf --> converting String to Wrapper class, return Wrapper class\n\n String str1 = \"123\";\n int result = Integer.parseInt(str1);\n System.out.println(result+1);\n\n String str2 = \"true\";\n boolean r1 = Boolean.parseBoolean(str2);\n System.out.println(r1);\n\n // parse method not case sencetive\n String str3 = \"FaLse\"; // it is work\n boolean r2 = Boolean.parseBoolean(str3);\n System.out.println(r2);\n\n String s1 = \"100.5\";\n Double c1 = Double.parseDouble(s1);\n System.out.println(c1 + 1); // it is call auto boxing\n Double c2 = Double.valueOf(s1); // this in not auto and not unboxing\n\n System.out.println(c1);\n System.out.println(c2);\n\n String s2 = \"TrUe\";\n Boolean b1 = Boolean.valueOf(s2);\n System.out.println(b1); // no sensetive\n\n Double [] arr = new Double[3];\n System.out.println(Arrays.toString(arr));\n // default value of wrapper class always --> null, null, null\n\n String name = \"string\";\n String name1 = new String(\"string\");\n\n Integer I1 = new Integer(\"123\");\n\n System.out.println(addNum(12,13));\n System.out.println(addNum(15.3,7.4));\n \n }", "public interface Numeric extends DataType {\n}", "@ZenCodeType.Caster\n @ZenCodeType.Method\n default double asDouble() {\n \n return notSupportedCast(BasicTypeID.DOUBLE);\n }", "public native double __doubleMethod( long __swiftObject, double arg );", "int toInt (double val) {\n return (int)val;\n }", "public double castToDoubleValue() {\n throw new IteratorFlowException(\"Cannot call castToDouble on non numeric\");\n }", "@Test\n\tpublic void test_TCM__double_getDoubleValue() {\n\t\tAttribute attr = new Attribute(\"test\", \"11111111111111\");\n\t\ttry {\n\t\t\tassertTrue(\"incorrect double value\", attr.getDoubleValue() == 11111111111111d );\n\n\t\t\tattr.setValue(\"0\");\n\t\t\tassertTrue(\"incorrect double value\", attr.getDoubleValue() == 0 );\n\n\t\t\tattr.setValue(Double.toString(java.lang.Double.MAX_VALUE));\n\t\t\tassertTrue(\"incorrect double value\", attr.getDoubleValue() == java.lang.Double.MAX_VALUE);\n\n\t\t\tattr.setValue(Double.toString(java.lang.Double.MIN_VALUE));\n\t\t\tassertTrue(\"incorrect double value\", attr.getDoubleValue() == java.lang.Double.MIN_VALUE);\n\n\t\t} catch (DataConversionException e) {\n\t\t\tfail(\"couldn't convert boolean value\");\n\t\t}\n\n\t\ttry {\n\t\t\tattr.setValue(\"foo\");\n\t\t\tfail(\"incorrectly returned double from non double value\" + attr.getDoubleValue());\n\n\t\t} catch (DataConversionException e) {\n\t\t\t// Do nothing\n\t\t} catch (Exception e) {\n\t\t\tfail(\"Unexpected exception \" + e.getClass());\n\t\t}\n\n\t}", "public static void main(String[] args)\n {\n double x = 5.3;\n int y = (int)x;\n \n }", "private void ex04(){\n int number;\n number = 1;\n\n double number2;\n number2 = 1.5;\n\n String number3;\n number3 = \"3\";\n\n boolean bool = (number == 1);\n\n myWindow.clearOut();\n myWindow.writeOutLine(number);\n myWindow.writeOutLine(new String(String.valueOf(number))); //int to string\n myWindow.writeOutLine((double) number); //int to double\n myWindow.writeOutLine(bool); //int to boolean\n\n /*\n Java can perform number -> string\n method 1: numberType.toString\n method 2: String.valueOf(int/double/float) //used above in the code\n Java can also perform string -> number\n dataType.parseDatatype() // e.g.: Integer.parseInt()\n\n Java allows this only when the conversion is widening (small -> larger)\n alternatively reports a compile error if the conversion is narrowing\n */\n\n //YOUR CODE ABOVE HERE\n }", "public int getAxisType()\n {\n return DOUBLE;\n }", "private double convertDouble()\n\t{\n\t\tString val = tokens[10];\n\t\tdouble value = 0.0;\n\t\ttry {\n\t\t\tvalue = Double.parseDouble(tokens[10]);\n\t\t}\n\t\tcatch(NumberFormatException e) {\n\t\t\tSystem.err.print(\"\");\n\t\t}\n\t\treturn value;\n\t}", "public static void main(String[] args){\n long money = 500000; //not equal datatype, so implicit type casting\n long money1 = 500000L; //Recommendation\n\n System.out.println(money);\n System.out.println(money1);\n\n //JVM default float is double(8byte)\n //float pi = 3.141592; //compile error, incompatible types\n float PI = 3.141592f; // f or F\n double dd = 152.12331;\n System.out.println(PI);\n System.out.println(dd);\n }", "private Type get_value_type(long xx) {\n Type vt = _values.get(xx);\n assert vt!=null;\n return vt;\n }", "private static native boolean set_0(long nativeObj, int propId, double value);", "public static void main(String[] args) {\n\n\t\tSystem.out.println( \"Min value of Byte :\"+ Byte.MIN_VALUE); \n\t\tSystem.out.println( \"Max value of Byte :\"+ Byte.MAX_VALUE); \n\n\t\tSystem.out.println();\n\t\t\n\t\tSystem.out.println( \"Min value of Short :\"+ Short.MIN_VALUE); \n\t\tSystem.out.println( \"Max value of Short :\"+ Short.MAX_VALUE); \n\n\t\tSystem.out.println();\n\t\t\n\t\tSystem.out.println( \"Min value of Integer :\"+ Integer.MIN_VALUE); \n\t\tSystem.out.println( \"Max value of Integer :\"+ Integer.MAX_VALUE); \n\n\t\tSystem.out.println();\n\t\t\n\t\tSystem.out.println( \"Min value of Long :\"+ Long.MIN_VALUE); \n\t\tSystem.out.println( \"Max value of Long :\"+ Long.MAX_VALUE); \n\n\t\t// l should be at the end of value\n\t\tlong number1 = 9223372036854775807l;\n\t\tSystem.out.println( \"After adding l at end of the long number \" + number1);\n\t\t\n\t\tSystem.out.println();\n\t\t\n\t\t\n\t\t/* *\n\t\t * Decimal Data Types *\n\t\t * \t\t-----------------\t *\n\t\t *\t\t\t\t\t\t\t *\n\t\t*/\n\t\t\n\t\t// 1. float \t\t2. double\n\n\t\tSystem.out.println( \"Min value of float :\"+ Float.MIN_VALUE); \n\t\tSystem.out.println( \"Max value of float :\"+ Float.MAX_VALUE); \n\t\t\n\t\t// f should be at the end of value\n\t\tfloat decimal1 = 32245.12123f;\n\t\t\n\t\tSystem.out.println( \"After adding f at the end of the float\" + decimal1);\n\t\t\n\t\tSystem.out.println();\n\n\t\tSystem.out.println( \"Min value of double :\"+ Double.MIN_VALUE); \n\t\tSystem.out.println( \"Max value of double :\"+ Double.MAX_VALUE); \n\n\t\tSystem.out.println();\n\t\t\n\t\t\n\t\t\n\t\t/* *\n\t\t * Character Data Types *\n\t\t * \t --------------------\t *\n\t\t *\t\t\t\t\t\t\t *\n\t\t*/\n\t\t\n\t\t\n\t\t// 1. char \t\t\t2. String( int 2 bytes)\n\n\t\t// can only contain single letter\n\t\tchar ch = 'a'; \n\t\tSystem.out.println( \"Single character :\"+ ch);\n\t\t\n\t\t// can contain unicode values \n\t\tchar unicode = '\\u0000';\n\t\tSystem.out.println( \"Unicodes are stored but not shown :\"+ unicode);\n\t\t\n\t\t// are stored in int\n\t\tint num = 'a';\n\t\tSystem.out.println( \"character stored in int:\"+num);\n\t\t\n\t\tSystem.out.println();\n\t\t\n\n\t\tString str = \"Hello\" + \" World\";\n\t\tSystem.out.println(str);\n\n\t}", "public static void main(String[] args)\n {\n\n double myDouble = 3.14;\n float myFloat = 3.14f; //Removing the f will cause an error due to lossy conversion\n double yourDouble = myFloat; //Widening/lossless conversions won't raise errors\n }", "public abstract double GetRaw();", "public int getDataType()\n {\n return dtype;\n }", "public Double\n getDoubleValue() \n {\n return ((Double) getValue());\n }", "private Object getTypeObjectPair() throws MathLinkException, NumberRangeException {\n Object result = null;\n int type = this.getInteger();\n if (type % -17 == -15) {\n type = -7 + -17 * (type / -17);\n } else if (type % -17 == -16) {\n type = -8 + -17 * (type / -17);\n }\n switch (type) {\n case -5: {\n result = new Integer(this.getInteger());\n break;\n }\n case -6: {\n result = new Long(this.getLongInteger());\n break;\n }\n case -4: {\n int i = this.getInteger();\n if (i < -32768 || i > 32767) {\n throw new NumberRangeException(i, \"short\");\n }\n result = new Short((short)i);\n break;\n }\n case -2: {\n int i = this.getInteger();\n if (i < -128 || i > 127) {\n throw new NumberRangeException(i, \"byte\");\n }\n result = new Byte((byte)i);\n break;\n }\n case -3: {\n int i = this.getInteger();\n if (i < 0 || i > 65535) {\n throw new NumberRangeException(i, \"char\");\n }\n result = new Character((char)i);\n break;\n }\n case -15: \n case -7: {\n double d = this.getDouble();\n if (d < -3.4028234663852886E38 || d > 3.4028234663852886E38) {\n throw new NumberRangeException(d, \"float\");\n }\n result = new Float((float)d);\n break;\n }\n case -16: \n case -8: {\n result = new Double(this.getDouble());\n break;\n }\n case -9: {\n int tok = this.getType();\n if (tok == 100000) {\n result = this.getObject();\n break;\n }\n result = this.getString();\n if (tok != 35 || !result.equals(\"Null\")) break;\n result = null;\n break;\n }\n case -1: {\n String s = this.getSymbol();\n if (s.equals(\"True\")) {\n result = Boolean.TRUE;\n break;\n }\n result = Boolean.FALSE;\n break;\n }\n case -13: {\n long mark = this.createMark();\n try {\n int tok = this.getNext();\n if (tok == 100000) {\n result = this.getObject();\n break;\n }\n if (tok == 35) {\n result = this.getSymbol();\n if (result.equals(\"Null\")) {\n result = null;\n break;\n }\n this.seekMark(mark);\n result = this.getComplex();\n break;\n }\n this.seekMark(mark);\n result = this.getComplex();\n }\n finally {\n this.destroyMark(mark);\n }\n }\n case -10: {\n long mark = this.createMark();\n try {\n int tok = this.getType();\n if (tok == 100000) {\n result = this.getObject();\n break;\n }\n if (tok == 35) {\n result = this.getSymbol();\n if (result.equals(\"Null\")) {\n result = null;\n break;\n }\n result = new BigInteger((String)result);\n break;\n }\n result = new BigInteger(this.getString());\n }\n finally {\n this.destroyMark(mark);\n }\n }\n case -11: {\n long mark = this.createMark();\n try {\n int tok = this.getType();\n if (tok == 100000) {\n result = this.getObject();\n break;\n }\n if (tok == 35) {\n result = this.getSymbol();\n if (result.equals(\"Null\")) {\n result = null;\n break;\n }\n result = Utils.bigDecimalFromString((String)result);\n break;\n }\n result = Utils.bigDecimalFromString(this.getString());\n }\n finally {\n this.destroyMark(mark);\n }\n }\n case -12: {\n long mark = this.createMark();\n try {\n int tok = this.getNext();\n if (tok == 100000 && (result = this.getObject()) != null) break;\n this.seekMark(mark);\n result = this.getExpr();\n }\n finally {\n this.destroyMark(mark);\n }\n }\n case -14: {\n result = this.getObject();\n break;\n }\n case -10000: {\n break;\n }\n default: {\n int tok = this.getNext();\n result = tok == 100000 || tok == 35 ? this.getObject() : (type > -34 ? this.getArray(type - -17, 1) : (type > -51 ? this.getArray(type - -34, 2) : (type > -68 ? this.getArray(type - -51, 3) : (type > -85 ? this.getArray(type - -68, 4) : this.getArray(type - -85, 5)))));\n }\n }\n return result;\n }", "private static native double get_0(long nativeObj, int propId);", "public double doubleValue() {\r\n return (double) intValue();\r\n }", "public static void isValid(double dbl) throws IllegalArgumentException {\n\t//nothing to do here\n }", "public double asDouble() {\r\n\t\tif (this.what == SCALARTYPE.Integer || this.what == SCALARTYPE.Float) {\r\n\t\t\treturn (new BigDecimal(this.scalar)).doubleValue();\r\n\t\t} else\r\n\t\t\treturn 0; // ritorna un valore di default\r\n\t}", "public static void main(String[] args) {\n\t\tdouble d=10;\n\t\tSystem.out.println(d);\n\t\t\n\t\tint i=(int)10.99;\n\t\tSystem.out.println(i);\n\t\tbyte b=(byte)1243;\n\t\tSystem.out.println(b);\n\t\t\n\n\t}", "double getFloatingPointField();", "@Override\n public Type evaluateType() throws Exception {\n return new IntegerType();\n }", "public abstract double getValue();", "private boolean isNumber(Object o) {\n\t\tif(o instanceof String) return isNumber((String) o);\n\t\telse if(o instanceof Double) return true;\n\t\telse return false;\n\t}", "private static double m6088b(Object obj) {\n Method method = null;\n Object obj2 = obj;\n while (!(obj2 instanceof Number)) {\n if (obj2 instanceof String) {\n return ScriptRuntime.m6309a((String) obj2);\n }\n if (!(obj2 instanceof Scriptable)) {\n try {\n method = obj2.getClass().getMethod(\"doubleValue\");\n } catch (NoSuchMethodException | SecurityException e) {\n }\n if (method != null) {\n try {\n return ((Number) method.invoke(obj2)).doubleValue();\n } catch (IllegalAccessException e2) {\n m6091c(obj2, Double.TYPE);\n } catch (InvocationTargetException e3) {\n m6091c(obj2, Double.TYPE);\n }\n }\n return ScriptRuntime.m6309a(obj2.toString());\n } else if (!(obj2 instanceof Wrapper)) {\n return ScriptRuntime.m6395b(obj2);\n } else {\n obj2 = ((Wrapper) obj2).mo18879a();\n }\n }\n return ((Number) obj2).doubleValue();\n }", "void checkSameDataType(String datatype, String datatype1)\n {\n DefaultTableModel semanticerror = (DefaultTableModel)tblErrorSemantic.getModel();\n if(datatype.equals(datatype1))\n {\n\n }\n else if(datatype.equals(\"INT\") && datatype1.equals(\"FLOAT\"))\n {\n \n }\n else if(datatype.equals(\"FLOAT\") && datatype1.equals(\"INT\"))\n {\n \n }\n else if(datatype1 == null)\n {\n\n }\n else\n {\n semanticerror.addRow(new Object[] {tblLexeme.getModel().getValueAt(tokenPos-2, 0),\"Incompatible Types: \"+datatype1+\" Cannot be converted to \"+datatype, tblLexeme.getModel().getValueAt(tokenPos-2, 2)}); \n } \n datatype = null;\n }", "public long longValue() {\n\t\treturn (long) mDouble;\n\t}", "private void m2248a(double d, String str) {\n this.f2954c = d;\n this.f2955d = (long) d;\n this.f2953b = str;\n this.f2952a = ValueType.doubleValue;\n }", "@Override\n public String getDataType() {\n return getPrimitiveType().name();\n }", "@Override\n public double nextDouble() {\n return super.nextDouble();\n }", "public double getAsDouble(int index) {\n switch (type) {\n case TIFFTag.TIFF_BYTE: case TIFFTag.TIFF_UNDEFINED:\n return ((byte[])data)[index] & 0xff;\n case TIFFTag.TIFF_SBYTE:\n return ((byte[])data)[index];\n case TIFFTag.TIFF_SHORT:\n return ((char[])data)[index] & 0xffff;\n case TIFFTag.TIFF_SSHORT:\n return ((short[])data)[index];\n case TIFFTag.TIFF_SLONG:\n return ((int[])data)[index];\n case TIFFTag.TIFF_LONG: case TIFFTag.TIFF_IFD_POINTER:\n return ((long[])data)[index];\n case TIFFTag.TIFF_FLOAT:\n return ((float[])data)[index];\n case TIFFTag.TIFF_DOUBLE:\n return ((double[])data)[index];\n case TIFFTag.TIFF_SRATIONAL:\n int[] ivalue = getAsSRational(index);\n return (double)ivalue[0]/ivalue[1];\n case TIFFTag.TIFF_RATIONAL:\n long[] lvalue = getAsRational(index);\n return (double)lvalue[0]/lvalue[1];\n case TIFFTag.TIFF_ASCII:\n String s = ((String[])data)[index];\n return Double.parseDouble(s);\n default:\n throw new ClassCastException();\n }\n }", "@Ignore\n @Test(expected = IllegalArgumentException.class)\n public void require_that_illegal_double_throws_exception() throws IOException {\n Slime slime = new Slime();\n Cursor root = slime.setObject();\n root.setString(\"doubleval\", \"invalid\");\n InnerCNode def = new DefParser(\"simpletypes\", new StringReader(StringUtilities.implode(SimpletypesConfig.CONFIG_DEF_SCHEMA, \"\\n\"))).getTree();\n new ConfigFileFormat(def).encode(new ByteArrayOutputStream(), slime);\n }", "private double IntegerParseIn(double Precio) {\n throw new UnsupportedOperationException(\"Not supported yet.\"); //To change body of generated methods, choose Tools | Templates.\n }", "@java.lang.Override\n public long getLongValue() {\n if (typeCase_ == 3) {\n return (java.lang.Long) type_;\n }\n return 0L;\n }", "public abstract double[] getasDouble(int tuple);", "double getValue();", "double getValue();", "double getValue();", "public static double leerDouble() {\n\t\tthrow new UnsupportedOperationException();\n\t}", "public OCFloat(OCInteger lenType)\r\n {\r\n super(lenType);\r\n setLength(4);\r\n }", "void mo130799a(double d);", "public static double datodouble(){\n try {\n Double f=new Double(dato());\n return(f.doubleValue());\n } catch (NumberFormatException error) {\n return(Double.NaN);\n }\n }", "private TsPrimitiveType readOneValue() {\n switch (dataType) {\n case BOOLEAN:\n return new TsBoolean(valueDecoder.readBoolean(valueInputStream));\n case INT32:\n return new TsInt(valueDecoder.readInt(valueInputStream));\n case INT64:\n return new TsLong(valueDecoder.readLong(valueInputStream));\n case FLOAT:\n return new TsFloat(valueDecoder.readFloat(valueInputStream));\n case DOUBLE:\n return new TsDouble(valueDecoder.readDouble(valueInputStream));\n case TEXT:\n return new TsBinary(valueDecoder.readBinary(valueInputStream));\n default:\n break;\n }\n throw new UnSupportedDataTypeException(\"Unsupported data type :\" + dataType);\n }", "int getDataTypeValue();", "public static double isDouble() {\n\t\twhile (true) {\n\t\t\ttry {\n\t\t\t\treturn input.nextDouble();\n\t\t\t} catch (InputMismatchException e) {\n\t\t\t\tinput.next();\n\t\t\t\tSystem.out.println(\"Vas unos nije odgovarajuci. Probajte ponovo: \");\n\t\t\t}\n\t\t}\n\t}", "void writeDouble(double value);", "@Override\n\tpublic Type getType() {\n\t\treturn Type.FLOAT;\n\t}" ]
[ "0.66770065", "0.63548017", "0.6348221", "0.6342794", "0.6286748", "0.6286562", "0.62415045", "0.62285113", "0.6176737", "0.61717606", "0.60764956", "0.60742694", "0.6066293", "0.6032801", "0.60286814", "0.6025049", "0.601542", "0.5959509", "0.59377545", "0.59002924", "0.5898876", "0.58972657", "0.58942175", "0.58928376", "0.5890025", "0.5873796", "0.58692664", "0.58477724", "0.58214265", "0.5804629", "0.57761407", "0.57657284", "0.5718842", "0.5710443", "0.56878364", "0.568356", "0.5680416", "0.5666828", "0.56609714", "0.5641718", "0.5640917", "0.5633694", "0.5608703", "0.56061804", "0.56019515", "0.5595205", "0.5578014", "0.5568802", "0.5529873", "0.55279505", "0.5524837", "0.5515821", "0.5509604", "0.5501653", "0.5497232", "0.549532", "0.5495134", "0.5486931", "0.54703414", "0.5466086", "0.54644877", "0.54643434", "0.5463716", "0.54481673", "0.5445194", "0.5442178", "0.5441387", "0.5441341", "0.54276496", "0.54275256", "0.5420042", "0.5417336", "0.5409133", "0.54077333", "0.540576", "0.5402641", "0.5395491", "0.5382886", "0.5371896", "0.53703064", "0.53614116", "0.53531736", "0.5352584", "0.53459674", "0.53457373", "0.5343557", "0.5335971", "0.5335881", "0.5332064", "0.5320062", "0.5320062", "0.5320062", "0.5316006", "0.530932", "0.5305781", "0.530556", "0.53034633", "0.52949995", "0.5286672", "0.5277252", "0.5266497" ]
0.0
-1
there will be issue when the type is double/int/long
protected void setImageUrl(UiAction uiAction, ResultSet rs, int rowNumber) throws SQLException{ String imageUrl = rs.getString(UiActionTable.COLUMN_IMAGE_URL); if(imageUrl == null){ //do nothing when nothing found in database return; } uiAction.setImageUrl(imageUrl); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\n public Class getValueType() {\n return Double.class;\n }", "public static void main(String args[]) {\n\t\t \n\t\t // lets define some variables and try to insert other data type value\n\t\t int x = 23;\n\t\t double y ;\n\t\t y = x ; // here we are storing int to double ie. smaller to larger . So no error\n\t\t System.out.println(y);\n\t\t System.out.println(x);\n\t\t \n\t\t double a = 25.28;\n\t\t int b ;\n\t\t //b = a; // Here we can see error since we are trying to store double to int i.e larger to smaller w/o casting\n\t\t \n\t\t // lets do casting and store \n\t\t b = (int) a;\n\t\t System.out.println(b);\n\t\t \n\t\t boolean bool = true ;\n\t\t int num = bool; // not possible as we know boolean data type cannot be typecast;\n\t\t \n\t\t //int to long\n\t\t int value = 34;\n\t\t long value1 ;\n\t\t \n\t\t value1 = value;\n\t\t System.out.println(value1);\n\t\t value = value1; // trying longer to smaller w/o casting which is not possible;\n\t\t System.out.println(value);\n\t\t \n\t\t value = (int) value1;\n\t\t \n\t\t // long to float \n\t\t \n\t\t long value2 = 678;\n\t\t float value3; \n\t\t value3 = value2; // works fine since smaller to larger\n\t\t System.out.println(value3);\n\t\t value2 = value3 ; // trying longer to smaller w/o casting which is not possible;\n\t\t \n\t\t // so to assign value3 to value2 we need Explicitly type cast\n\t\t value2 = (long) value3;\n\t\t \n\t\t // float to long and vice versa \n\t\t \n\t\t float value4 = 567.78f;\n\t\t double value5 ;\n\t\t value5 = value4 ; // works fine since assigning smaller type to larger type\n\t\t System.out.println(value5);\n\t\t value4 = value5 ; // trying longer to smaller w/o casting which is not possible;\n\t\t \n\t\t // Also we can explicit cast for storing larger (double) to long/int/short\n\t\t double value6 = 3564.8;\n\t\t int value7 ;\n\t\t \n\t\t value7 = (int) value6;\n\t\t System.out.println(value7);\n\t\t \n\t\t \n\t\t \n\t\t \n\t\t \n\t }", "@Override\n\tpublic void visit(DoubleType n) {\n\t\t\n\t}", "private void functionalInterfacesForDoubleIntLong() {\n double d = 1.0;\n DoubleToIntFunction f1 = x -> 1;\n f1.applyAsInt(d);\n\n }", "@java.lang.Override\n public double getRealValue() {\n if (typeCase_ == 4) {\n return (java.lang.Double) type_;\n }\n return 0D;\n }", "public interface DoubleType extends NumericType {\n}", "double getEDouble();", "public boolean isDouble();", "long getNumericField();", "@Test\n public void test_column_type_detection_double() throws SQLException {\n ColumnInfo info = testColumnTypeDetection(\"x\", NodeFactory.createLiteral(\"12.3e4\", XSDDatatype.XSDdouble), true, Types.DOUBLE, Double.class.getCanonicalName());\n Assert.assertEquals(16, info.getScale());\n Assert.assertEquals(16, info.getPrecision());\n Assert.assertTrue(info.isSigned());\n }", "public abstract double read_double();", "public static void main(String[] args) {\ndouble anInt=1234;\nbyte aByte=12;\nshort aShort=12;\nlong aLong=1234567890987654321L;\ndouble anotherInt= (anInt * 10000000);\nSystem.out.println(\"The int is \" + anInt);\nSystem.out.println(\"The byte is \" + aByte);\nSystem.out.println(\"The short is \" + aShort);\nSystem.out.println(\"The long is \" + aLong);\nSystem.out.println(\"Another int is \" + anotherInt); \n\t}", "public abstract Double toDouble(T t);", "default T handleNumber(double val) {\n throw new UnsupportedOperationException();\n }", "public static Double toDouble(Object o,byte type) throws ExecException {\n try {\n switch (type) {\n case BOOLEAN:\n return (Boolean) o ? Double.valueOf(1.0D) : Double.valueOf(0.0D);\n\n case INTEGER:\n return new Double(((Integer)o).doubleValue());\n\n case LONG:\n return new Double(((Long)o).doubleValue());\n\n case FLOAT:\n return new Double(((Float)o).doubleValue());\n\n case DOUBLE:\n return (Double)o;\n\n case DATETIME:\n return new Double(Long.valueOf(((DateTime)o).getMillis()).doubleValue());\n\n case BYTEARRAY:\n return Double.valueOf(((DataByteArray)o).toString());\n\n case CHARARRAY:\n return Double.valueOf((String)o);\n\n case BIGINTEGER:\n return Double.valueOf(((BigInteger)o).doubleValue());\n\n case BIGDECIMAL:\n return Double.valueOf(((BigDecimal)o).doubleValue());\n\n case NULL:\n return null;\n\n case BYTE:\n case MAP:\n case INTERNALMAP:\n case TUPLE:\n case BAG:\n case UNKNOWN:\n default:\n int errCode = 1071;\n String msg = \"Cannot convert a \" + findTypeName(o) +\n \" to a Double\";\n throw new ExecException(msg, errCode, PigException.INPUT);\n }\n } catch (ClassCastException cce) {\n throw cce;\n } catch (ExecException ee) {\n throw ee;\n } catch (NumberFormatException nfe) {\n int errCode = 1074;\n String msg = \"Problem with formatting. Could not convert \" + o + \" to Double.\";\n throw new ExecException(msg, errCode, PigException.INPUT, nfe);\n } catch (Exception e) {\n int errCode = 2054;\n String msg = \"Internal error. Could not convert \" + o + \" to Double.\";\n throw new ExecException(msg, errCode, PigException.BUG);\n }\n }", "private void validate(Adouble val) {\r\n Assertions.assertEquals(val.aonType(), Atype.DOUBLE);\r\n Assertions.assertEquals(val, val);\r\n Assertions.assertEquals(val, Adouble.valueOf(val.toDouble()));\r\n Assertions.assertEquals(val.hashCode(), Adouble.valueOf(val.toDouble()).hashCode());\r\n Assertions.assertTrue(val.isNumber());\r\n }", "public static interface DataTypeWithRatioScale<T> {\r\n \r\n /**\r\n * Add\r\n *\r\n * @param augend\r\n * @param addend\r\n * @return\r\n */\r\n public abstract T add(T augend, T addend);\r\n\r\n /**\r\n * Compare\r\n *\r\n * @param s1\r\n * @param s2\r\n * @return\r\n * @throws NumberFormatException\r\n * @throws ParseException\r\n */\r\n public abstract int compare(String s1, String s2) throws NumberFormatException,\r\n ParseException;\r\n\r\n /**\r\n * Compare\r\n *\r\n * @param t1\r\n * @param t2\r\n * @return\r\n */\r\n public abstract int compare(T t1, T t2);\r\n\r\n /**\r\n * Divide\r\n *\r\n * @param dividend\r\n * @param divisor\r\n * @return\r\n */\r\n public abstract String divide(String dividend, String divisor);\r\n \r\n /**\r\n * Divide\r\n *\r\n * @param dividend\r\n * @param divisor\r\n * @return\r\n */\r\n public abstract T divide(T dividend, T divisor);\r\n \r\n /**\r\n * Format\r\n *\r\n * @param t\r\n * @return\r\n */\r\n public abstract String format(T t);\r\n\r\n /**\r\n * Converts a double into a value.\r\n *\r\n * @param s\r\n * @return\r\n */\r\n public abstract T fromDouble(Double d);\r\n\r\n /**\r\n * Description\r\n *\r\n * @return\r\n */\r\n public abstract DataTypeDescription<T> getDescription();\r\n\r\n /**\r\n * Maximum\r\n *\r\n * @return\r\n */\r\n public T getMaximum();\r\n \r\n /**\r\n * Minimum\r\n *\r\n * @return\r\n */\r\n public T getMinimum();\r\n\r\n /**\r\n * Valid\r\n *\r\n * @param s\r\n * @return\r\n */\r\n public abstract boolean isValid(String s);\r\n\r\n /**\r\n * Multiply\r\n *\r\n * @param multiplicand\r\n * @param multiplicator\r\n * @return\r\n */\r\n public abstract String multiply(String multiplicand,\r\n String multiplicator);\r\n\r\n /**\r\n * Multiply\r\n *\r\n * @param multiplicand\r\n * @param multiplicator\r\n * @return\r\n */\r\n public abstract T multiply(T multiplicand, double multiplicator);\r\n\r\n /**\r\n * Multiply\r\n *\r\n * @param multiplicand\r\n * @param multiplicator\r\n * @return\r\n */\r\n public abstract T multiply(T multiplicand, int multiplicator);\r\n\r\n /**\r\n * Multiply\r\n *\r\n * @param multiplicand\r\n * @param multiplicator\r\n * @return\r\n */\r\n public abstract T multiply(T multiplicand, T multiplicator);\r\n \r\n /**\r\n * Parse\r\n *\r\n * @param s\r\n * @return\r\n */\r\n public abstract T parse(String s);\r\n\r\n /**\r\n * Divide\r\n *\r\n * @param dividend\r\n * @param divisor\r\n * @return\r\n */\r\n public abstract double ratio(T dividend, T divisor);\r\n \r\n /**\r\n * Subtract\r\n *\r\n * @param minuend\r\n * @param subtrahend\r\n * @return\r\n */\r\n public abstract T subtract(T minuend, T subtrahend);\r\n \r\n /**\r\n * Converts a double into a value.\r\n *\r\n * @param s\r\n * @return\r\n */\r\n public abstract Double toDouble(T t);\r\n }", "public abstract T fromDouble(Double d);", "public double getRealValue() {\n if (typeCase_ == 4) {\n return (java.lang.Double) type_;\n }\n return 0D;\n }", "Double getDoubleValue();", "double getRealValue();", "private double convertToDbl(Object a) {\n double result = 0;\n\n //If the object is a Character...\n if(a instanceof Character){\n char x = (Character)a;\n result = (double)(x - '0'); // -'0' as it will convert the ascii number (e.g 4 is 52 in ascii) to the standard number\n }\n\n //If it is a Double...\n else if(a instanceof Double){\n result = (Double)a;\n }\n\n return result;\n }", "public boolean isDouble() {\n return this.data instanceof Double;\n }", "public abstract double getasDouble(int tuple, int val);", "public boolean isDouble() {\n return false;\n }", "@Override\n public Double value(TypeOfValue value);", "public abstract double readAsDbl(int offset);", "double readDouble()\n throws IOException {\n return Double.longBitsToDouble( readLong() );\n }", "public abstract Double getDataValue();", "private static int m6082a(Class<?> cls) {\n if (cls == Double.TYPE) {\n return 1;\n }\n if (cls == Float.TYPE) {\n return 2;\n }\n if (cls == Long.TYPE) {\n return 3;\n }\n if (cls == Integer.TYPE) {\n return 4;\n }\n if (cls == Short.TYPE) {\n return 5;\n }\n if (cls == Character.TYPE) {\n return 6;\n }\n if (cls == Byte.TYPE) {\n return 7;\n }\n if (cls == Boolean.TYPE) {\n return 99;\n }\n return 8;\n }", "double getDoubleValue2();", "double readDouble();", "Double getValue();", "private static double getLongt() {\n\t\treturn longt;\n\t}", "public double getDouble();", "boolean hasDouble();", "public abstract void writeAsDbl(int offset, double d);", "public boolean realAsDouble() {\n return false;\n }", "public abstract Number getPrimitiveType();", "double getDoubleValue1();", "int getSimpleType() {\n\t\treturn ((type / 1000)) * 1000;\n\t}", "private double readDouble() throws IOException {\n\t\treturn (isBigEndian ? ioReadDouble() : Double.longBitsToDouble(readLELong()));\n\t}", "public static void main(String[] args){\n short num=100;\n int inum=num;\n long lnum=num;\n float fnum=num;\n double dnum=num;\n //When you assign value of one data type to another,\n // the two types might not be compatible with each other.\n // If the data types are compatible,\n // then Java will perform the conversion automatically known as Automatic Type Conversion and\n // if not then they need to be casted or converted explicitly.\n //this happens only when\n //The two data types are compatible.\n //When we assign value of a smaller data type to a bigger data type.(byte<short<int<long<float<double)\n //For Example, in java the numeric data types are compatible with each other\n // but no automatic conversion is supported from numeric type to char or boolean.\n // Also, char and boolean are not compatible with each other.\n System.out.println(\"num is \"+num);\n System.out.println(\"inum is \"+inum);\n System.out.println(\"lnum is \"+lnum);\n System.out.println(\"fnum is \"+fnum);\n System.out.println(\"dnum is \"+dnum);\n\n //Narrowing or Explicit conversion\n dnum=323.142;\n byte bnum=(byte)dnum;//converting bigger data type o smaller data type\n //so explicit conversion is needed\n System.out.println(\"dnum converted to bnum(byte) is \"+bnum);\n\n }", "public static double longToDouble(long l) {\n return (double) l;\n }", "public void testDoubleValue() {\n AtomicLong ai = new AtomicLong();\n assertEquals(0.0d, ai.doubleValue());\n for (long x : VALUES) {\n ai.set(x);\n assertEquals((double)x, ai.doubleValue());\n }\n }", "double getDoubleValue3();", "public static void main(String[] args) {\n // example of type casting\n // it will store the double and store it as an int.\n //by default, java will round down\n\n int a = (int) 0.5;\n System.out.println(a);\n //results will be 0\n\n\n //some primitive data types - byte, short, char, int, long, float, double\n\n // byte a;\n // short b;\n // char c;\n // int d;\n // long e;\n // float f;\n // double g;\n\n //if you were to use int and then store it to double, it will cast to double by default.\n\n //it will work its way down this primitive types data\n\n \n }", "public static void testOfDoubleNumberIsInteger(){\n\t\tSystem.out.println(\"please enter a double number: \");\n\t\tScanner scann=new Scanner(System.in);\n\t\tdouble x=scann.nextDouble();\n\t\tif(x%1==0)\n\t\t\tSystem.out.println(\"The number you have enterd it's not a double \");\n\t\telse\n\t\t\tSystem.out.println(\"The number you have entered it's double\");\n\t}", "private final double get_DOUBLE(int column) {\n if (metadata.isZos()) {\n byte[] bytes = new byte[8];\n dataBuffer_.getBytes(columnDataPosition_[column - 1], bytes);\n return FloatingPoint.getDouble_hex(bytes, 0);\n //return dataBuffer_.getDouble(columnDataPosition_[column - 1]);\n } else {\n return dataBuffer_.getDoubleLE(columnDataPosition_[column - 1]);\n// return FloatingPoint.getDouble(dataBuffer_,\n// columnDataPosition_[column - 1]);\n }\n }", "public static void main(String[] args) {\n\n Integer num1 = 100;\n double num2 = num1;\n System.out.println(num2);\n\n float f = 0.5f;\n Float fl = f;\n System.out.println(fl);\n\n System.out.println(Byte.MAX_VALUE);\n\n // parse method --> converting String value to primitives, returne primitive\n // valueOf --> converting String to Wrapper class, return Wrapper class\n\n String str1 = \"123\";\n int result = Integer.parseInt(str1);\n System.out.println(result+1);\n\n String str2 = \"true\";\n boolean r1 = Boolean.parseBoolean(str2);\n System.out.println(r1);\n\n // parse method not case sencetive\n String str3 = \"FaLse\"; // it is work\n boolean r2 = Boolean.parseBoolean(str3);\n System.out.println(r2);\n\n String s1 = \"100.5\";\n Double c1 = Double.parseDouble(s1);\n System.out.println(c1 + 1); // it is call auto boxing\n Double c2 = Double.valueOf(s1); // this in not auto and not unboxing\n\n System.out.println(c1);\n System.out.println(c2);\n\n String s2 = \"TrUe\";\n Boolean b1 = Boolean.valueOf(s2);\n System.out.println(b1); // no sensetive\n\n Double [] arr = new Double[3];\n System.out.println(Arrays.toString(arr));\n // default value of wrapper class always --> null, null, null\n\n String name = \"string\";\n String name1 = new String(\"string\");\n\n Integer I1 = new Integer(\"123\");\n\n System.out.println(addNum(12,13));\n System.out.println(addNum(15.3,7.4));\n \n }", "public interface Numeric extends DataType {\n}", "@ZenCodeType.Caster\n @ZenCodeType.Method\n default double asDouble() {\n \n return notSupportedCast(BasicTypeID.DOUBLE);\n }", "public native double __doubleMethod( long __swiftObject, double arg );", "int toInt (double val) {\n return (int)val;\n }", "public double castToDoubleValue() {\n throw new IteratorFlowException(\"Cannot call castToDouble on non numeric\");\n }", "@Test\n\tpublic void test_TCM__double_getDoubleValue() {\n\t\tAttribute attr = new Attribute(\"test\", \"11111111111111\");\n\t\ttry {\n\t\t\tassertTrue(\"incorrect double value\", attr.getDoubleValue() == 11111111111111d );\n\n\t\t\tattr.setValue(\"0\");\n\t\t\tassertTrue(\"incorrect double value\", attr.getDoubleValue() == 0 );\n\n\t\t\tattr.setValue(Double.toString(java.lang.Double.MAX_VALUE));\n\t\t\tassertTrue(\"incorrect double value\", attr.getDoubleValue() == java.lang.Double.MAX_VALUE);\n\n\t\t\tattr.setValue(Double.toString(java.lang.Double.MIN_VALUE));\n\t\t\tassertTrue(\"incorrect double value\", attr.getDoubleValue() == java.lang.Double.MIN_VALUE);\n\n\t\t} catch (DataConversionException e) {\n\t\t\tfail(\"couldn't convert boolean value\");\n\t\t}\n\n\t\ttry {\n\t\t\tattr.setValue(\"foo\");\n\t\t\tfail(\"incorrectly returned double from non double value\" + attr.getDoubleValue());\n\n\t\t} catch (DataConversionException e) {\n\t\t\t// Do nothing\n\t\t} catch (Exception e) {\n\t\t\tfail(\"Unexpected exception \" + e.getClass());\n\t\t}\n\n\t}", "public static void main(String[] args)\n {\n double x = 5.3;\n int y = (int)x;\n \n }", "private void ex04(){\n int number;\n number = 1;\n\n double number2;\n number2 = 1.5;\n\n String number3;\n number3 = \"3\";\n\n boolean bool = (number == 1);\n\n myWindow.clearOut();\n myWindow.writeOutLine(number);\n myWindow.writeOutLine(new String(String.valueOf(number))); //int to string\n myWindow.writeOutLine((double) number); //int to double\n myWindow.writeOutLine(bool); //int to boolean\n\n /*\n Java can perform number -> string\n method 1: numberType.toString\n method 2: String.valueOf(int/double/float) //used above in the code\n Java can also perform string -> number\n dataType.parseDatatype() // e.g.: Integer.parseInt()\n\n Java allows this only when the conversion is widening (small -> larger)\n alternatively reports a compile error if the conversion is narrowing\n */\n\n //YOUR CODE ABOVE HERE\n }", "public int getAxisType()\n {\n return DOUBLE;\n }", "private double convertDouble()\n\t{\n\t\tString val = tokens[10];\n\t\tdouble value = 0.0;\n\t\ttry {\n\t\t\tvalue = Double.parseDouble(tokens[10]);\n\t\t}\n\t\tcatch(NumberFormatException e) {\n\t\t\tSystem.err.print(\"\");\n\t\t}\n\t\treturn value;\n\t}", "private static native boolean set_0(long nativeObj, int propId, double value);", "private Type get_value_type(long xx) {\n Type vt = _values.get(xx);\n assert vt!=null;\n return vt;\n }", "public static void main(String[] args){\n long money = 500000; //not equal datatype, so implicit type casting\n long money1 = 500000L; //Recommendation\n\n System.out.println(money);\n System.out.println(money1);\n\n //JVM default float is double(8byte)\n //float pi = 3.141592; //compile error, incompatible types\n float PI = 3.141592f; // f or F\n double dd = 152.12331;\n System.out.println(PI);\n System.out.println(dd);\n }", "public static void main(String[] args) {\n\n\t\tSystem.out.println( \"Min value of Byte :\"+ Byte.MIN_VALUE); \n\t\tSystem.out.println( \"Max value of Byte :\"+ Byte.MAX_VALUE); \n\n\t\tSystem.out.println();\n\t\t\n\t\tSystem.out.println( \"Min value of Short :\"+ Short.MIN_VALUE); \n\t\tSystem.out.println( \"Max value of Short :\"+ Short.MAX_VALUE); \n\n\t\tSystem.out.println();\n\t\t\n\t\tSystem.out.println( \"Min value of Integer :\"+ Integer.MIN_VALUE); \n\t\tSystem.out.println( \"Max value of Integer :\"+ Integer.MAX_VALUE); \n\n\t\tSystem.out.println();\n\t\t\n\t\tSystem.out.println( \"Min value of Long :\"+ Long.MIN_VALUE); \n\t\tSystem.out.println( \"Max value of Long :\"+ Long.MAX_VALUE); \n\n\t\t// l should be at the end of value\n\t\tlong number1 = 9223372036854775807l;\n\t\tSystem.out.println( \"After adding l at end of the long number \" + number1);\n\t\t\n\t\tSystem.out.println();\n\t\t\n\t\t\n\t\t/* *\n\t\t * Decimal Data Types *\n\t\t * \t\t-----------------\t *\n\t\t *\t\t\t\t\t\t\t *\n\t\t*/\n\t\t\n\t\t// 1. float \t\t2. double\n\n\t\tSystem.out.println( \"Min value of float :\"+ Float.MIN_VALUE); \n\t\tSystem.out.println( \"Max value of float :\"+ Float.MAX_VALUE); \n\t\t\n\t\t// f should be at the end of value\n\t\tfloat decimal1 = 32245.12123f;\n\t\t\n\t\tSystem.out.println( \"After adding f at the end of the float\" + decimal1);\n\t\t\n\t\tSystem.out.println();\n\n\t\tSystem.out.println( \"Min value of double :\"+ Double.MIN_VALUE); \n\t\tSystem.out.println( \"Max value of double :\"+ Double.MAX_VALUE); \n\n\t\tSystem.out.println();\n\t\t\n\t\t\n\t\t\n\t\t/* *\n\t\t * Character Data Types *\n\t\t * \t --------------------\t *\n\t\t *\t\t\t\t\t\t\t *\n\t\t*/\n\t\t\n\t\t\n\t\t// 1. char \t\t\t2. String( int 2 bytes)\n\n\t\t// can only contain single letter\n\t\tchar ch = 'a'; \n\t\tSystem.out.println( \"Single character :\"+ ch);\n\t\t\n\t\t// can contain unicode values \n\t\tchar unicode = '\\u0000';\n\t\tSystem.out.println( \"Unicodes are stored but not shown :\"+ unicode);\n\t\t\n\t\t// are stored in int\n\t\tint num = 'a';\n\t\tSystem.out.println( \"character stored in int:\"+num);\n\t\t\n\t\tSystem.out.println();\n\t\t\n\n\t\tString str = \"Hello\" + \" World\";\n\t\tSystem.out.println(str);\n\n\t}", "public static void main(String[] args)\n {\n\n double myDouble = 3.14;\n float myFloat = 3.14f; //Removing the f will cause an error due to lossy conversion\n double yourDouble = myFloat; //Widening/lossless conversions won't raise errors\n }", "public int getDataType()\n {\n return dtype;\n }", "public abstract double GetRaw();", "public Double\n getDoubleValue() \n {\n return ((Double) getValue());\n }", "private static native double get_0(long nativeObj, int propId);", "private Object getTypeObjectPair() throws MathLinkException, NumberRangeException {\n Object result = null;\n int type = this.getInteger();\n if (type % -17 == -15) {\n type = -7 + -17 * (type / -17);\n } else if (type % -17 == -16) {\n type = -8 + -17 * (type / -17);\n }\n switch (type) {\n case -5: {\n result = new Integer(this.getInteger());\n break;\n }\n case -6: {\n result = new Long(this.getLongInteger());\n break;\n }\n case -4: {\n int i = this.getInteger();\n if (i < -32768 || i > 32767) {\n throw new NumberRangeException(i, \"short\");\n }\n result = new Short((short)i);\n break;\n }\n case -2: {\n int i = this.getInteger();\n if (i < -128 || i > 127) {\n throw new NumberRangeException(i, \"byte\");\n }\n result = new Byte((byte)i);\n break;\n }\n case -3: {\n int i = this.getInteger();\n if (i < 0 || i > 65535) {\n throw new NumberRangeException(i, \"char\");\n }\n result = new Character((char)i);\n break;\n }\n case -15: \n case -7: {\n double d = this.getDouble();\n if (d < -3.4028234663852886E38 || d > 3.4028234663852886E38) {\n throw new NumberRangeException(d, \"float\");\n }\n result = new Float((float)d);\n break;\n }\n case -16: \n case -8: {\n result = new Double(this.getDouble());\n break;\n }\n case -9: {\n int tok = this.getType();\n if (tok == 100000) {\n result = this.getObject();\n break;\n }\n result = this.getString();\n if (tok != 35 || !result.equals(\"Null\")) break;\n result = null;\n break;\n }\n case -1: {\n String s = this.getSymbol();\n if (s.equals(\"True\")) {\n result = Boolean.TRUE;\n break;\n }\n result = Boolean.FALSE;\n break;\n }\n case -13: {\n long mark = this.createMark();\n try {\n int tok = this.getNext();\n if (tok == 100000) {\n result = this.getObject();\n break;\n }\n if (tok == 35) {\n result = this.getSymbol();\n if (result.equals(\"Null\")) {\n result = null;\n break;\n }\n this.seekMark(mark);\n result = this.getComplex();\n break;\n }\n this.seekMark(mark);\n result = this.getComplex();\n }\n finally {\n this.destroyMark(mark);\n }\n }\n case -10: {\n long mark = this.createMark();\n try {\n int tok = this.getType();\n if (tok == 100000) {\n result = this.getObject();\n break;\n }\n if (tok == 35) {\n result = this.getSymbol();\n if (result.equals(\"Null\")) {\n result = null;\n break;\n }\n result = new BigInteger((String)result);\n break;\n }\n result = new BigInteger(this.getString());\n }\n finally {\n this.destroyMark(mark);\n }\n }\n case -11: {\n long mark = this.createMark();\n try {\n int tok = this.getType();\n if (tok == 100000) {\n result = this.getObject();\n break;\n }\n if (tok == 35) {\n result = this.getSymbol();\n if (result.equals(\"Null\")) {\n result = null;\n break;\n }\n result = Utils.bigDecimalFromString((String)result);\n break;\n }\n result = Utils.bigDecimalFromString(this.getString());\n }\n finally {\n this.destroyMark(mark);\n }\n }\n case -12: {\n long mark = this.createMark();\n try {\n int tok = this.getNext();\n if (tok == 100000 && (result = this.getObject()) != null) break;\n this.seekMark(mark);\n result = this.getExpr();\n }\n finally {\n this.destroyMark(mark);\n }\n }\n case -14: {\n result = this.getObject();\n break;\n }\n case -10000: {\n break;\n }\n default: {\n int tok = this.getNext();\n result = tok == 100000 || tok == 35 ? this.getObject() : (type > -34 ? this.getArray(type - -17, 1) : (type > -51 ? this.getArray(type - -34, 2) : (type > -68 ? this.getArray(type - -51, 3) : (type > -85 ? this.getArray(type - -68, 4) : this.getArray(type - -85, 5)))));\n }\n }\n return result;\n }", "public double doubleValue() {\r\n return (double) intValue();\r\n }", "public static void isValid(double dbl) throws IllegalArgumentException {\n\t//nothing to do here\n }", "public double asDouble() {\r\n\t\tif (this.what == SCALARTYPE.Integer || this.what == SCALARTYPE.Float) {\r\n\t\t\treturn (new BigDecimal(this.scalar)).doubleValue();\r\n\t\t} else\r\n\t\t\treturn 0; // ritorna un valore di default\r\n\t}", "public static void main(String[] args) {\n\t\tdouble d=10;\n\t\tSystem.out.println(d);\n\t\t\n\t\tint i=(int)10.99;\n\t\tSystem.out.println(i);\n\t\tbyte b=(byte)1243;\n\t\tSystem.out.println(b);\n\t\t\n\n\t}", "double getFloatingPointField();", "@Override\n public Type evaluateType() throws Exception {\n return new IntegerType();\n }", "public abstract double getValue();", "private boolean isNumber(Object o) {\n\t\tif(o instanceof String) return isNumber((String) o);\n\t\telse if(o instanceof Double) return true;\n\t\telse return false;\n\t}", "private static double m6088b(Object obj) {\n Method method = null;\n Object obj2 = obj;\n while (!(obj2 instanceof Number)) {\n if (obj2 instanceof String) {\n return ScriptRuntime.m6309a((String) obj2);\n }\n if (!(obj2 instanceof Scriptable)) {\n try {\n method = obj2.getClass().getMethod(\"doubleValue\");\n } catch (NoSuchMethodException | SecurityException e) {\n }\n if (method != null) {\n try {\n return ((Number) method.invoke(obj2)).doubleValue();\n } catch (IllegalAccessException e2) {\n m6091c(obj2, Double.TYPE);\n } catch (InvocationTargetException e3) {\n m6091c(obj2, Double.TYPE);\n }\n }\n return ScriptRuntime.m6309a(obj2.toString());\n } else if (!(obj2 instanceof Wrapper)) {\n return ScriptRuntime.m6395b(obj2);\n } else {\n obj2 = ((Wrapper) obj2).mo18879a();\n }\n }\n return ((Number) obj2).doubleValue();\n }", "void checkSameDataType(String datatype, String datatype1)\n {\n DefaultTableModel semanticerror = (DefaultTableModel)tblErrorSemantic.getModel();\n if(datatype.equals(datatype1))\n {\n\n }\n else if(datatype.equals(\"INT\") && datatype1.equals(\"FLOAT\"))\n {\n \n }\n else if(datatype.equals(\"FLOAT\") && datatype1.equals(\"INT\"))\n {\n \n }\n else if(datatype1 == null)\n {\n\n }\n else\n {\n semanticerror.addRow(new Object[] {tblLexeme.getModel().getValueAt(tokenPos-2, 0),\"Incompatible Types: \"+datatype1+\" Cannot be converted to \"+datatype, tblLexeme.getModel().getValueAt(tokenPos-2, 2)}); \n } \n datatype = null;\n }", "public long longValue() {\n\t\treturn (long) mDouble;\n\t}", "@Override\n public String getDataType() {\n return getPrimitiveType().name();\n }", "private void m2248a(double d, String str) {\n this.f2954c = d;\n this.f2955d = (long) d;\n this.f2953b = str;\n this.f2952a = ValueType.doubleValue;\n }", "@Override\n public double nextDouble() {\n return super.nextDouble();\n }", "public double getAsDouble(int index) {\n switch (type) {\n case TIFFTag.TIFF_BYTE: case TIFFTag.TIFF_UNDEFINED:\n return ((byte[])data)[index] & 0xff;\n case TIFFTag.TIFF_SBYTE:\n return ((byte[])data)[index];\n case TIFFTag.TIFF_SHORT:\n return ((char[])data)[index] & 0xffff;\n case TIFFTag.TIFF_SSHORT:\n return ((short[])data)[index];\n case TIFFTag.TIFF_SLONG:\n return ((int[])data)[index];\n case TIFFTag.TIFF_LONG: case TIFFTag.TIFF_IFD_POINTER:\n return ((long[])data)[index];\n case TIFFTag.TIFF_FLOAT:\n return ((float[])data)[index];\n case TIFFTag.TIFF_DOUBLE:\n return ((double[])data)[index];\n case TIFFTag.TIFF_SRATIONAL:\n int[] ivalue = getAsSRational(index);\n return (double)ivalue[0]/ivalue[1];\n case TIFFTag.TIFF_RATIONAL:\n long[] lvalue = getAsRational(index);\n return (double)lvalue[0]/lvalue[1];\n case TIFFTag.TIFF_ASCII:\n String s = ((String[])data)[index];\n return Double.parseDouble(s);\n default:\n throw new ClassCastException();\n }\n }", "@Ignore\n @Test(expected = IllegalArgumentException.class)\n public void require_that_illegal_double_throws_exception() throws IOException {\n Slime slime = new Slime();\n Cursor root = slime.setObject();\n root.setString(\"doubleval\", \"invalid\");\n InnerCNode def = new DefParser(\"simpletypes\", new StringReader(StringUtilities.implode(SimpletypesConfig.CONFIG_DEF_SCHEMA, \"\\n\"))).getTree();\n new ConfigFileFormat(def).encode(new ByteArrayOutputStream(), slime);\n }", "private double IntegerParseIn(double Precio) {\n throw new UnsupportedOperationException(\"Not supported yet.\"); //To change body of generated methods, choose Tools | Templates.\n }", "@java.lang.Override\n public long getLongValue() {\n if (typeCase_ == 3) {\n return (java.lang.Long) type_;\n }\n return 0L;\n }", "public abstract double[] getasDouble(int tuple);", "double getValue();", "double getValue();", "double getValue();", "public static double leerDouble() {\n\t\tthrow new UnsupportedOperationException();\n\t}", "public OCFloat(OCInteger lenType)\r\n {\r\n super(lenType);\r\n setLength(4);\r\n }", "void mo130799a(double d);", "public static double datodouble(){\n try {\n Double f=new Double(dato());\n return(f.doubleValue());\n } catch (NumberFormatException error) {\n return(Double.NaN);\n }\n }", "private TsPrimitiveType readOneValue() {\n switch (dataType) {\n case BOOLEAN:\n return new TsBoolean(valueDecoder.readBoolean(valueInputStream));\n case INT32:\n return new TsInt(valueDecoder.readInt(valueInputStream));\n case INT64:\n return new TsLong(valueDecoder.readLong(valueInputStream));\n case FLOAT:\n return new TsFloat(valueDecoder.readFloat(valueInputStream));\n case DOUBLE:\n return new TsDouble(valueDecoder.readDouble(valueInputStream));\n case TEXT:\n return new TsBinary(valueDecoder.readBinary(valueInputStream));\n default:\n break;\n }\n throw new UnSupportedDataTypeException(\"Unsupported data type :\" + dataType);\n }", "int getDataTypeValue();", "public static double isDouble() {\n\t\twhile (true) {\n\t\t\ttry {\n\t\t\t\treturn input.nextDouble();\n\t\t\t} catch (InputMismatchException e) {\n\t\t\t\tinput.next();\n\t\t\t\tSystem.out.println(\"Vas unos nije odgovarajuci. Probajte ponovo: \");\n\t\t\t}\n\t\t}\n\t}", "void writeDouble(double value);", "@Override\n\tpublic Type getType() {\n\t\treturn Type.FLOAT;\n\t}" ]
[ "0.66772467", "0.6355419", "0.63483196", "0.6342852", "0.6287018", "0.62868583", "0.62429136", "0.6228538", "0.6178516", "0.6171938", "0.6077349", "0.6074494", "0.6065865", "0.60325575", "0.6027928", "0.6024646", "0.6015092", "0.5959282", "0.5938346", "0.59007293", "0.5899381", "0.589728", "0.5895115", "0.5892888", "0.5891087", "0.5873259", "0.5869304", "0.584895", "0.5822251", "0.5806564", "0.57769185", "0.57665807", "0.5718738", "0.57119167", "0.56890285", "0.56840175", "0.56800175", "0.5668304", "0.5662382", "0.5642278", "0.5642187", "0.56345105", "0.56091166", "0.56049085", "0.5601217", "0.559585", "0.5578792", "0.55681217", "0.5530451", "0.55288094", "0.552566", "0.5516113", "0.5509732", "0.55025816", "0.54973364", "0.5495813", "0.5495761", "0.548664", "0.5471293", "0.54671156", "0.5465179", "0.5464752", "0.54643047", "0.54477364", "0.54460806", "0.5443771", "0.5443696", "0.54421735", "0.54296184", "0.5429101", "0.5421284", "0.54170233", "0.54094917", "0.5408228", "0.540752", "0.5403911", "0.53957886", "0.5383653", "0.5372423", "0.5370536", "0.536231", "0.53543204", "0.53543", "0.53466254", "0.53464043", "0.53427374", "0.53368706", "0.5335927", "0.53326416", "0.5320436", "0.5320436", "0.5320436", "0.53169155", "0.5309918", "0.5306529", "0.53056556", "0.5304184", "0.5296527", "0.52865654", "0.5276762", "0.5267712" ]
0.0
-1
there will be issue when the type is double/int/long
protected void setLinkToUrl(UiAction uiAction, ResultSet rs, int rowNumber) throws SQLException{ String linkToUrl = rs.getString(UiActionTable.COLUMN_LINK_TO_URL); if(linkToUrl == null){ //do nothing when nothing found in database return; } uiAction.setLinkToUrl(linkToUrl); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\n public Class getValueType() {\n return Double.class;\n }", "public static void main(String args[]) {\n\t\t \n\t\t // lets define some variables and try to insert other data type value\n\t\t int x = 23;\n\t\t double y ;\n\t\t y = x ; // here we are storing int to double ie. smaller to larger . So no error\n\t\t System.out.println(y);\n\t\t System.out.println(x);\n\t\t \n\t\t double a = 25.28;\n\t\t int b ;\n\t\t //b = a; // Here we can see error since we are trying to store double to int i.e larger to smaller w/o casting\n\t\t \n\t\t // lets do casting and store \n\t\t b = (int) a;\n\t\t System.out.println(b);\n\t\t \n\t\t boolean bool = true ;\n\t\t int num = bool; // not possible as we know boolean data type cannot be typecast;\n\t\t \n\t\t //int to long\n\t\t int value = 34;\n\t\t long value1 ;\n\t\t \n\t\t value1 = value;\n\t\t System.out.println(value1);\n\t\t value = value1; // trying longer to smaller w/o casting which is not possible;\n\t\t System.out.println(value);\n\t\t \n\t\t value = (int) value1;\n\t\t \n\t\t // long to float \n\t\t \n\t\t long value2 = 678;\n\t\t float value3; \n\t\t value3 = value2; // works fine since smaller to larger\n\t\t System.out.println(value3);\n\t\t value2 = value3 ; // trying longer to smaller w/o casting which is not possible;\n\t\t \n\t\t // so to assign value3 to value2 we need Explicitly type cast\n\t\t value2 = (long) value3;\n\t\t \n\t\t // float to long and vice versa \n\t\t \n\t\t float value4 = 567.78f;\n\t\t double value5 ;\n\t\t value5 = value4 ; // works fine since assigning smaller type to larger type\n\t\t System.out.println(value5);\n\t\t value4 = value5 ; // trying longer to smaller w/o casting which is not possible;\n\t\t \n\t\t // Also we can explicit cast for storing larger (double) to long/int/short\n\t\t double value6 = 3564.8;\n\t\t int value7 ;\n\t\t \n\t\t value7 = (int) value6;\n\t\t System.out.println(value7);\n\t\t \n\t\t \n\t\t \n\t\t \n\t\t \n\t }", "@Override\n\tpublic void visit(DoubleType n) {\n\t\t\n\t}", "private void functionalInterfacesForDoubleIntLong() {\n double d = 1.0;\n DoubleToIntFunction f1 = x -> 1;\n f1.applyAsInt(d);\n\n }", "public interface DoubleType extends NumericType {\n}", "@java.lang.Override\n public double getRealValue() {\n if (typeCase_ == 4) {\n return (java.lang.Double) type_;\n }\n return 0D;\n }", "double getEDouble();", "public boolean isDouble();", "long getNumericField();", "@Test\n public void test_column_type_detection_double() throws SQLException {\n ColumnInfo info = testColumnTypeDetection(\"x\", NodeFactory.createLiteral(\"12.3e4\", XSDDatatype.XSDdouble), true, Types.DOUBLE, Double.class.getCanonicalName());\n Assert.assertEquals(16, info.getScale());\n Assert.assertEquals(16, info.getPrecision());\n Assert.assertTrue(info.isSigned());\n }", "public abstract double read_double();", "public static void main(String[] args) {\ndouble anInt=1234;\nbyte aByte=12;\nshort aShort=12;\nlong aLong=1234567890987654321L;\ndouble anotherInt= (anInt * 10000000);\nSystem.out.println(\"The int is \" + anInt);\nSystem.out.println(\"The byte is \" + aByte);\nSystem.out.println(\"The short is \" + aShort);\nSystem.out.println(\"The long is \" + aLong);\nSystem.out.println(\"Another int is \" + anotherInt); \n\t}", "public abstract Double toDouble(T t);", "default T handleNumber(double val) {\n throw new UnsupportedOperationException();\n }", "public static Double toDouble(Object o,byte type) throws ExecException {\n try {\n switch (type) {\n case BOOLEAN:\n return (Boolean) o ? Double.valueOf(1.0D) : Double.valueOf(0.0D);\n\n case INTEGER:\n return new Double(((Integer)o).doubleValue());\n\n case LONG:\n return new Double(((Long)o).doubleValue());\n\n case FLOAT:\n return new Double(((Float)o).doubleValue());\n\n case DOUBLE:\n return (Double)o;\n\n case DATETIME:\n return new Double(Long.valueOf(((DateTime)o).getMillis()).doubleValue());\n\n case BYTEARRAY:\n return Double.valueOf(((DataByteArray)o).toString());\n\n case CHARARRAY:\n return Double.valueOf((String)o);\n\n case BIGINTEGER:\n return Double.valueOf(((BigInteger)o).doubleValue());\n\n case BIGDECIMAL:\n return Double.valueOf(((BigDecimal)o).doubleValue());\n\n case NULL:\n return null;\n\n case BYTE:\n case MAP:\n case INTERNALMAP:\n case TUPLE:\n case BAG:\n case UNKNOWN:\n default:\n int errCode = 1071;\n String msg = \"Cannot convert a \" + findTypeName(o) +\n \" to a Double\";\n throw new ExecException(msg, errCode, PigException.INPUT);\n }\n } catch (ClassCastException cce) {\n throw cce;\n } catch (ExecException ee) {\n throw ee;\n } catch (NumberFormatException nfe) {\n int errCode = 1074;\n String msg = \"Problem with formatting. Could not convert \" + o + \" to Double.\";\n throw new ExecException(msg, errCode, PigException.INPUT, nfe);\n } catch (Exception e) {\n int errCode = 2054;\n String msg = \"Internal error. Could not convert \" + o + \" to Double.\";\n throw new ExecException(msg, errCode, PigException.BUG);\n }\n }", "private void validate(Adouble val) {\r\n Assertions.assertEquals(val.aonType(), Atype.DOUBLE);\r\n Assertions.assertEquals(val, val);\r\n Assertions.assertEquals(val, Adouble.valueOf(val.toDouble()));\r\n Assertions.assertEquals(val.hashCode(), Adouble.valueOf(val.toDouble()).hashCode());\r\n Assertions.assertTrue(val.isNumber());\r\n }", "public static interface DataTypeWithRatioScale<T> {\r\n \r\n /**\r\n * Add\r\n *\r\n * @param augend\r\n * @param addend\r\n * @return\r\n */\r\n public abstract T add(T augend, T addend);\r\n\r\n /**\r\n * Compare\r\n *\r\n * @param s1\r\n * @param s2\r\n * @return\r\n * @throws NumberFormatException\r\n * @throws ParseException\r\n */\r\n public abstract int compare(String s1, String s2) throws NumberFormatException,\r\n ParseException;\r\n\r\n /**\r\n * Compare\r\n *\r\n * @param t1\r\n * @param t2\r\n * @return\r\n */\r\n public abstract int compare(T t1, T t2);\r\n\r\n /**\r\n * Divide\r\n *\r\n * @param dividend\r\n * @param divisor\r\n * @return\r\n */\r\n public abstract String divide(String dividend, String divisor);\r\n \r\n /**\r\n * Divide\r\n *\r\n * @param dividend\r\n * @param divisor\r\n * @return\r\n */\r\n public abstract T divide(T dividend, T divisor);\r\n \r\n /**\r\n * Format\r\n *\r\n * @param t\r\n * @return\r\n */\r\n public abstract String format(T t);\r\n\r\n /**\r\n * Converts a double into a value.\r\n *\r\n * @param s\r\n * @return\r\n */\r\n public abstract T fromDouble(Double d);\r\n\r\n /**\r\n * Description\r\n *\r\n * @return\r\n */\r\n public abstract DataTypeDescription<T> getDescription();\r\n\r\n /**\r\n * Maximum\r\n *\r\n * @return\r\n */\r\n public T getMaximum();\r\n \r\n /**\r\n * Minimum\r\n *\r\n * @return\r\n */\r\n public T getMinimum();\r\n\r\n /**\r\n * Valid\r\n *\r\n * @param s\r\n * @return\r\n */\r\n public abstract boolean isValid(String s);\r\n\r\n /**\r\n * Multiply\r\n *\r\n * @param multiplicand\r\n * @param multiplicator\r\n * @return\r\n */\r\n public abstract String multiply(String multiplicand,\r\n String multiplicator);\r\n\r\n /**\r\n * Multiply\r\n *\r\n * @param multiplicand\r\n * @param multiplicator\r\n * @return\r\n */\r\n public abstract T multiply(T multiplicand, double multiplicator);\r\n\r\n /**\r\n * Multiply\r\n *\r\n * @param multiplicand\r\n * @param multiplicator\r\n * @return\r\n */\r\n public abstract T multiply(T multiplicand, int multiplicator);\r\n\r\n /**\r\n * Multiply\r\n *\r\n * @param multiplicand\r\n * @param multiplicator\r\n * @return\r\n */\r\n public abstract T multiply(T multiplicand, T multiplicator);\r\n \r\n /**\r\n * Parse\r\n *\r\n * @param s\r\n * @return\r\n */\r\n public abstract T parse(String s);\r\n\r\n /**\r\n * Divide\r\n *\r\n * @param dividend\r\n * @param divisor\r\n * @return\r\n */\r\n public abstract double ratio(T dividend, T divisor);\r\n \r\n /**\r\n * Subtract\r\n *\r\n * @param minuend\r\n * @param subtrahend\r\n * @return\r\n */\r\n public abstract T subtract(T minuend, T subtrahend);\r\n \r\n /**\r\n * Converts a double into a value.\r\n *\r\n * @param s\r\n * @return\r\n */\r\n public abstract Double toDouble(T t);\r\n }", "public abstract T fromDouble(Double d);", "public double getRealValue() {\n if (typeCase_ == 4) {\n return (java.lang.Double) type_;\n }\n return 0D;\n }", "Double getDoubleValue();", "double getRealValue();", "private double convertToDbl(Object a) {\n double result = 0;\n\n //If the object is a Character...\n if(a instanceof Character){\n char x = (Character)a;\n result = (double)(x - '0'); // -'0' as it will convert the ascii number (e.g 4 is 52 in ascii) to the standard number\n }\n\n //If it is a Double...\n else if(a instanceof Double){\n result = (Double)a;\n }\n\n return result;\n }", "public boolean isDouble() {\n return this.data instanceof Double;\n }", "public abstract double getasDouble(int tuple, int val);", "public boolean isDouble() {\n return false;\n }", "@Override\n public Double value(TypeOfValue value);", "public abstract double readAsDbl(int offset);", "double readDouble()\n throws IOException {\n return Double.longBitsToDouble( readLong() );\n }", "public abstract Double getDataValue();", "private static int m6082a(Class<?> cls) {\n if (cls == Double.TYPE) {\n return 1;\n }\n if (cls == Float.TYPE) {\n return 2;\n }\n if (cls == Long.TYPE) {\n return 3;\n }\n if (cls == Integer.TYPE) {\n return 4;\n }\n if (cls == Short.TYPE) {\n return 5;\n }\n if (cls == Character.TYPE) {\n return 6;\n }\n if (cls == Byte.TYPE) {\n return 7;\n }\n if (cls == Boolean.TYPE) {\n return 99;\n }\n return 8;\n }", "double getDoubleValue2();", "double readDouble();", "Double getValue();", "private static double getLongt() {\n\t\treturn longt;\n\t}", "public double getDouble();", "boolean hasDouble();", "public abstract void writeAsDbl(int offset, double d);", "public boolean realAsDouble() {\n return false;\n }", "public abstract Number getPrimitiveType();", "double getDoubleValue1();", "int getSimpleType() {\n\t\treturn ((type / 1000)) * 1000;\n\t}", "private double readDouble() throws IOException {\n\t\treturn (isBigEndian ? ioReadDouble() : Double.longBitsToDouble(readLELong()));\n\t}", "public static void main(String[] args){\n short num=100;\n int inum=num;\n long lnum=num;\n float fnum=num;\n double dnum=num;\n //When you assign value of one data type to another,\n // the two types might not be compatible with each other.\n // If the data types are compatible,\n // then Java will perform the conversion automatically known as Automatic Type Conversion and\n // if not then they need to be casted or converted explicitly.\n //this happens only when\n //The two data types are compatible.\n //When we assign value of a smaller data type to a bigger data type.(byte<short<int<long<float<double)\n //For Example, in java the numeric data types are compatible with each other\n // but no automatic conversion is supported from numeric type to char or boolean.\n // Also, char and boolean are not compatible with each other.\n System.out.println(\"num is \"+num);\n System.out.println(\"inum is \"+inum);\n System.out.println(\"lnum is \"+lnum);\n System.out.println(\"fnum is \"+fnum);\n System.out.println(\"dnum is \"+dnum);\n\n //Narrowing or Explicit conversion\n dnum=323.142;\n byte bnum=(byte)dnum;//converting bigger data type o smaller data type\n //so explicit conversion is needed\n System.out.println(\"dnum converted to bnum(byte) is \"+bnum);\n\n }", "public static double longToDouble(long l) {\n return (double) l;\n }", "public void testDoubleValue() {\n AtomicLong ai = new AtomicLong();\n assertEquals(0.0d, ai.doubleValue());\n for (long x : VALUES) {\n ai.set(x);\n assertEquals((double)x, ai.doubleValue());\n }\n }", "double getDoubleValue3();", "public static void main(String[] args) {\n // example of type casting\n // it will store the double and store it as an int.\n //by default, java will round down\n\n int a = (int) 0.5;\n System.out.println(a);\n //results will be 0\n\n\n //some primitive data types - byte, short, char, int, long, float, double\n\n // byte a;\n // short b;\n // char c;\n // int d;\n // long e;\n // float f;\n // double g;\n\n //if you were to use int and then store it to double, it will cast to double by default.\n\n //it will work its way down this primitive types data\n\n \n }", "public static void testOfDoubleNumberIsInteger(){\n\t\tSystem.out.println(\"please enter a double number: \");\n\t\tScanner scann=new Scanner(System.in);\n\t\tdouble x=scann.nextDouble();\n\t\tif(x%1==0)\n\t\t\tSystem.out.println(\"The number you have enterd it's not a double \");\n\t\telse\n\t\t\tSystem.out.println(\"The number you have entered it's double\");\n\t}", "private final double get_DOUBLE(int column) {\n if (metadata.isZos()) {\n byte[] bytes = new byte[8];\n dataBuffer_.getBytes(columnDataPosition_[column - 1], bytes);\n return FloatingPoint.getDouble_hex(bytes, 0);\n //return dataBuffer_.getDouble(columnDataPosition_[column - 1]);\n } else {\n return dataBuffer_.getDoubleLE(columnDataPosition_[column - 1]);\n// return FloatingPoint.getDouble(dataBuffer_,\n// columnDataPosition_[column - 1]);\n }\n }", "public static void main(String[] args) {\n\n Integer num1 = 100;\n double num2 = num1;\n System.out.println(num2);\n\n float f = 0.5f;\n Float fl = f;\n System.out.println(fl);\n\n System.out.println(Byte.MAX_VALUE);\n\n // parse method --> converting String value to primitives, returne primitive\n // valueOf --> converting String to Wrapper class, return Wrapper class\n\n String str1 = \"123\";\n int result = Integer.parseInt(str1);\n System.out.println(result+1);\n\n String str2 = \"true\";\n boolean r1 = Boolean.parseBoolean(str2);\n System.out.println(r1);\n\n // parse method not case sencetive\n String str3 = \"FaLse\"; // it is work\n boolean r2 = Boolean.parseBoolean(str3);\n System.out.println(r2);\n\n String s1 = \"100.5\";\n Double c1 = Double.parseDouble(s1);\n System.out.println(c1 + 1); // it is call auto boxing\n Double c2 = Double.valueOf(s1); // this in not auto and not unboxing\n\n System.out.println(c1);\n System.out.println(c2);\n\n String s2 = \"TrUe\";\n Boolean b1 = Boolean.valueOf(s2);\n System.out.println(b1); // no sensetive\n\n Double [] arr = new Double[3];\n System.out.println(Arrays.toString(arr));\n // default value of wrapper class always --> null, null, null\n\n String name = \"string\";\n String name1 = new String(\"string\");\n\n Integer I1 = new Integer(\"123\");\n\n System.out.println(addNum(12,13));\n System.out.println(addNum(15.3,7.4));\n \n }", "public interface Numeric extends DataType {\n}", "@ZenCodeType.Caster\n @ZenCodeType.Method\n default double asDouble() {\n \n return notSupportedCast(BasicTypeID.DOUBLE);\n }", "public native double __doubleMethod( long __swiftObject, double arg );", "int toInt (double val) {\n return (int)val;\n }", "public double castToDoubleValue() {\n throw new IteratorFlowException(\"Cannot call castToDouble on non numeric\");\n }", "@Test\n\tpublic void test_TCM__double_getDoubleValue() {\n\t\tAttribute attr = new Attribute(\"test\", \"11111111111111\");\n\t\ttry {\n\t\t\tassertTrue(\"incorrect double value\", attr.getDoubleValue() == 11111111111111d );\n\n\t\t\tattr.setValue(\"0\");\n\t\t\tassertTrue(\"incorrect double value\", attr.getDoubleValue() == 0 );\n\n\t\t\tattr.setValue(Double.toString(java.lang.Double.MAX_VALUE));\n\t\t\tassertTrue(\"incorrect double value\", attr.getDoubleValue() == java.lang.Double.MAX_VALUE);\n\n\t\t\tattr.setValue(Double.toString(java.lang.Double.MIN_VALUE));\n\t\t\tassertTrue(\"incorrect double value\", attr.getDoubleValue() == java.lang.Double.MIN_VALUE);\n\n\t\t} catch (DataConversionException e) {\n\t\t\tfail(\"couldn't convert boolean value\");\n\t\t}\n\n\t\ttry {\n\t\t\tattr.setValue(\"foo\");\n\t\t\tfail(\"incorrectly returned double from non double value\" + attr.getDoubleValue());\n\n\t\t} catch (DataConversionException e) {\n\t\t\t// Do nothing\n\t\t} catch (Exception e) {\n\t\t\tfail(\"Unexpected exception \" + e.getClass());\n\t\t}\n\n\t}", "public static void main(String[] args)\n {\n double x = 5.3;\n int y = (int)x;\n \n }", "private void ex04(){\n int number;\n number = 1;\n\n double number2;\n number2 = 1.5;\n\n String number3;\n number3 = \"3\";\n\n boolean bool = (number == 1);\n\n myWindow.clearOut();\n myWindow.writeOutLine(number);\n myWindow.writeOutLine(new String(String.valueOf(number))); //int to string\n myWindow.writeOutLine((double) number); //int to double\n myWindow.writeOutLine(bool); //int to boolean\n\n /*\n Java can perform number -> string\n method 1: numberType.toString\n method 2: String.valueOf(int/double/float) //used above in the code\n Java can also perform string -> number\n dataType.parseDatatype() // e.g.: Integer.parseInt()\n\n Java allows this only when the conversion is widening (small -> larger)\n alternatively reports a compile error if the conversion is narrowing\n */\n\n //YOUR CODE ABOVE HERE\n }", "public int getAxisType()\n {\n return DOUBLE;\n }", "private double convertDouble()\n\t{\n\t\tString val = tokens[10];\n\t\tdouble value = 0.0;\n\t\ttry {\n\t\t\tvalue = Double.parseDouble(tokens[10]);\n\t\t}\n\t\tcatch(NumberFormatException e) {\n\t\t\tSystem.err.print(\"\");\n\t\t}\n\t\treturn value;\n\t}", "public static void main(String[] args){\n long money = 500000; //not equal datatype, so implicit type casting\n long money1 = 500000L; //Recommendation\n\n System.out.println(money);\n System.out.println(money1);\n\n //JVM default float is double(8byte)\n //float pi = 3.141592; //compile error, incompatible types\n float PI = 3.141592f; // f or F\n double dd = 152.12331;\n System.out.println(PI);\n System.out.println(dd);\n }", "private Type get_value_type(long xx) {\n Type vt = _values.get(xx);\n assert vt!=null;\n return vt;\n }", "private static native boolean set_0(long nativeObj, int propId, double value);", "public static void main(String[] args) {\n\n\t\tSystem.out.println( \"Min value of Byte :\"+ Byte.MIN_VALUE); \n\t\tSystem.out.println( \"Max value of Byte :\"+ Byte.MAX_VALUE); \n\n\t\tSystem.out.println();\n\t\t\n\t\tSystem.out.println( \"Min value of Short :\"+ Short.MIN_VALUE); \n\t\tSystem.out.println( \"Max value of Short :\"+ Short.MAX_VALUE); \n\n\t\tSystem.out.println();\n\t\t\n\t\tSystem.out.println( \"Min value of Integer :\"+ Integer.MIN_VALUE); \n\t\tSystem.out.println( \"Max value of Integer :\"+ Integer.MAX_VALUE); \n\n\t\tSystem.out.println();\n\t\t\n\t\tSystem.out.println( \"Min value of Long :\"+ Long.MIN_VALUE); \n\t\tSystem.out.println( \"Max value of Long :\"+ Long.MAX_VALUE); \n\n\t\t// l should be at the end of value\n\t\tlong number1 = 9223372036854775807l;\n\t\tSystem.out.println( \"After adding l at end of the long number \" + number1);\n\t\t\n\t\tSystem.out.println();\n\t\t\n\t\t\n\t\t/* *\n\t\t * Decimal Data Types *\n\t\t * \t\t-----------------\t *\n\t\t *\t\t\t\t\t\t\t *\n\t\t*/\n\t\t\n\t\t// 1. float \t\t2. double\n\n\t\tSystem.out.println( \"Min value of float :\"+ Float.MIN_VALUE); \n\t\tSystem.out.println( \"Max value of float :\"+ Float.MAX_VALUE); \n\t\t\n\t\t// f should be at the end of value\n\t\tfloat decimal1 = 32245.12123f;\n\t\t\n\t\tSystem.out.println( \"After adding f at the end of the float\" + decimal1);\n\t\t\n\t\tSystem.out.println();\n\n\t\tSystem.out.println( \"Min value of double :\"+ Double.MIN_VALUE); \n\t\tSystem.out.println( \"Max value of double :\"+ Double.MAX_VALUE); \n\n\t\tSystem.out.println();\n\t\t\n\t\t\n\t\t\n\t\t/* *\n\t\t * Character Data Types *\n\t\t * \t --------------------\t *\n\t\t *\t\t\t\t\t\t\t *\n\t\t*/\n\t\t\n\t\t\n\t\t// 1. char \t\t\t2. String( int 2 bytes)\n\n\t\t// can only contain single letter\n\t\tchar ch = 'a'; \n\t\tSystem.out.println( \"Single character :\"+ ch);\n\t\t\n\t\t// can contain unicode values \n\t\tchar unicode = '\\u0000';\n\t\tSystem.out.println( \"Unicodes are stored but not shown :\"+ unicode);\n\t\t\n\t\t// are stored in int\n\t\tint num = 'a';\n\t\tSystem.out.println( \"character stored in int:\"+num);\n\t\t\n\t\tSystem.out.println();\n\t\t\n\n\t\tString str = \"Hello\" + \" World\";\n\t\tSystem.out.println(str);\n\n\t}", "public static void main(String[] args)\n {\n\n double myDouble = 3.14;\n float myFloat = 3.14f; //Removing the f will cause an error due to lossy conversion\n double yourDouble = myFloat; //Widening/lossless conversions won't raise errors\n }", "public abstract double GetRaw();", "public int getDataType()\n {\n return dtype;\n }", "public Double\n getDoubleValue() \n {\n return ((Double) getValue());\n }", "private Object getTypeObjectPair() throws MathLinkException, NumberRangeException {\n Object result = null;\n int type = this.getInteger();\n if (type % -17 == -15) {\n type = -7 + -17 * (type / -17);\n } else if (type % -17 == -16) {\n type = -8 + -17 * (type / -17);\n }\n switch (type) {\n case -5: {\n result = new Integer(this.getInteger());\n break;\n }\n case -6: {\n result = new Long(this.getLongInteger());\n break;\n }\n case -4: {\n int i = this.getInteger();\n if (i < -32768 || i > 32767) {\n throw new NumberRangeException(i, \"short\");\n }\n result = new Short((short)i);\n break;\n }\n case -2: {\n int i = this.getInteger();\n if (i < -128 || i > 127) {\n throw new NumberRangeException(i, \"byte\");\n }\n result = new Byte((byte)i);\n break;\n }\n case -3: {\n int i = this.getInteger();\n if (i < 0 || i > 65535) {\n throw new NumberRangeException(i, \"char\");\n }\n result = new Character((char)i);\n break;\n }\n case -15: \n case -7: {\n double d = this.getDouble();\n if (d < -3.4028234663852886E38 || d > 3.4028234663852886E38) {\n throw new NumberRangeException(d, \"float\");\n }\n result = new Float((float)d);\n break;\n }\n case -16: \n case -8: {\n result = new Double(this.getDouble());\n break;\n }\n case -9: {\n int tok = this.getType();\n if (tok == 100000) {\n result = this.getObject();\n break;\n }\n result = this.getString();\n if (tok != 35 || !result.equals(\"Null\")) break;\n result = null;\n break;\n }\n case -1: {\n String s = this.getSymbol();\n if (s.equals(\"True\")) {\n result = Boolean.TRUE;\n break;\n }\n result = Boolean.FALSE;\n break;\n }\n case -13: {\n long mark = this.createMark();\n try {\n int tok = this.getNext();\n if (tok == 100000) {\n result = this.getObject();\n break;\n }\n if (tok == 35) {\n result = this.getSymbol();\n if (result.equals(\"Null\")) {\n result = null;\n break;\n }\n this.seekMark(mark);\n result = this.getComplex();\n break;\n }\n this.seekMark(mark);\n result = this.getComplex();\n }\n finally {\n this.destroyMark(mark);\n }\n }\n case -10: {\n long mark = this.createMark();\n try {\n int tok = this.getType();\n if (tok == 100000) {\n result = this.getObject();\n break;\n }\n if (tok == 35) {\n result = this.getSymbol();\n if (result.equals(\"Null\")) {\n result = null;\n break;\n }\n result = new BigInteger((String)result);\n break;\n }\n result = new BigInteger(this.getString());\n }\n finally {\n this.destroyMark(mark);\n }\n }\n case -11: {\n long mark = this.createMark();\n try {\n int tok = this.getType();\n if (tok == 100000) {\n result = this.getObject();\n break;\n }\n if (tok == 35) {\n result = this.getSymbol();\n if (result.equals(\"Null\")) {\n result = null;\n break;\n }\n result = Utils.bigDecimalFromString((String)result);\n break;\n }\n result = Utils.bigDecimalFromString(this.getString());\n }\n finally {\n this.destroyMark(mark);\n }\n }\n case -12: {\n long mark = this.createMark();\n try {\n int tok = this.getNext();\n if (tok == 100000 && (result = this.getObject()) != null) break;\n this.seekMark(mark);\n result = this.getExpr();\n }\n finally {\n this.destroyMark(mark);\n }\n }\n case -14: {\n result = this.getObject();\n break;\n }\n case -10000: {\n break;\n }\n default: {\n int tok = this.getNext();\n result = tok == 100000 || tok == 35 ? this.getObject() : (type > -34 ? this.getArray(type - -17, 1) : (type > -51 ? this.getArray(type - -34, 2) : (type > -68 ? this.getArray(type - -51, 3) : (type > -85 ? this.getArray(type - -68, 4) : this.getArray(type - -85, 5)))));\n }\n }\n return result;\n }", "private static native double get_0(long nativeObj, int propId);", "public double doubleValue() {\r\n return (double) intValue();\r\n }", "public static void isValid(double dbl) throws IllegalArgumentException {\n\t//nothing to do here\n }", "public double asDouble() {\r\n\t\tif (this.what == SCALARTYPE.Integer || this.what == SCALARTYPE.Float) {\r\n\t\t\treturn (new BigDecimal(this.scalar)).doubleValue();\r\n\t\t} else\r\n\t\t\treturn 0; // ritorna un valore di default\r\n\t}", "public static void main(String[] args) {\n\t\tdouble d=10;\n\t\tSystem.out.println(d);\n\t\t\n\t\tint i=(int)10.99;\n\t\tSystem.out.println(i);\n\t\tbyte b=(byte)1243;\n\t\tSystem.out.println(b);\n\t\t\n\n\t}", "double getFloatingPointField();", "@Override\n public Type evaluateType() throws Exception {\n return new IntegerType();\n }", "public abstract double getValue();", "private boolean isNumber(Object o) {\n\t\tif(o instanceof String) return isNumber((String) o);\n\t\telse if(o instanceof Double) return true;\n\t\telse return false;\n\t}", "private static double m6088b(Object obj) {\n Method method = null;\n Object obj2 = obj;\n while (!(obj2 instanceof Number)) {\n if (obj2 instanceof String) {\n return ScriptRuntime.m6309a((String) obj2);\n }\n if (!(obj2 instanceof Scriptable)) {\n try {\n method = obj2.getClass().getMethod(\"doubleValue\");\n } catch (NoSuchMethodException | SecurityException e) {\n }\n if (method != null) {\n try {\n return ((Number) method.invoke(obj2)).doubleValue();\n } catch (IllegalAccessException e2) {\n m6091c(obj2, Double.TYPE);\n } catch (InvocationTargetException e3) {\n m6091c(obj2, Double.TYPE);\n }\n }\n return ScriptRuntime.m6309a(obj2.toString());\n } else if (!(obj2 instanceof Wrapper)) {\n return ScriptRuntime.m6395b(obj2);\n } else {\n obj2 = ((Wrapper) obj2).mo18879a();\n }\n }\n return ((Number) obj2).doubleValue();\n }", "void checkSameDataType(String datatype, String datatype1)\n {\n DefaultTableModel semanticerror = (DefaultTableModel)tblErrorSemantic.getModel();\n if(datatype.equals(datatype1))\n {\n\n }\n else if(datatype.equals(\"INT\") && datatype1.equals(\"FLOAT\"))\n {\n \n }\n else if(datatype.equals(\"FLOAT\") && datatype1.equals(\"INT\"))\n {\n \n }\n else if(datatype1 == null)\n {\n\n }\n else\n {\n semanticerror.addRow(new Object[] {tblLexeme.getModel().getValueAt(tokenPos-2, 0),\"Incompatible Types: \"+datatype1+\" Cannot be converted to \"+datatype, tblLexeme.getModel().getValueAt(tokenPos-2, 2)}); \n } \n datatype = null;\n }", "public long longValue() {\n\t\treturn (long) mDouble;\n\t}", "private void m2248a(double d, String str) {\n this.f2954c = d;\n this.f2955d = (long) d;\n this.f2953b = str;\n this.f2952a = ValueType.doubleValue;\n }", "@Override\n public String getDataType() {\n return getPrimitiveType().name();\n }", "@Override\n public double nextDouble() {\n return super.nextDouble();\n }", "public double getAsDouble(int index) {\n switch (type) {\n case TIFFTag.TIFF_BYTE: case TIFFTag.TIFF_UNDEFINED:\n return ((byte[])data)[index] & 0xff;\n case TIFFTag.TIFF_SBYTE:\n return ((byte[])data)[index];\n case TIFFTag.TIFF_SHORT:\n return ((char[])data)[index] & 0xffff;\n case TIFFTag.TIFF_SSHORT:\n return ((short[])data)[index];\n case TIFFTag.TIFF_SLONG:\n return ((int[])data)[index];\n case TIFFTag.TIFF_LONG: case TIFFTag.TIFF_IFD_POINTER:\n return ((long[])data)[index];\n case TIFFTag.TIFF_FLOAT:\n return ((float[])data)[index];\n case TIFFTag.TIFF_DOUBLE:\n return ((double[])data)[index];\n case TIFFTag.TIFF_SRATIONAL:\n int[] ivalue = getAsSRational(index);\n return (double)ivalue[0]/ivalue[1];\n case TIFFTag.TIFF_RATIONAL:\n long[] lvalue = getAsRational(index);\n return (double)lvalue[0]/lvalue[1];\n case TIFFTag.TIFF_ASCII:\n String s = ((String[])data)[index];\n return Double.parseDouble(s);\n default:\n throw new ClassCastException();\n }\n }", "@Ignore\n @Test(expected = IllegalArgumentException.class)\n public void require_that_illegal_double_throws_exception() throws IOException {\n Slime slime = new Slime();\n Cursor root = slime.setObject();\n root.setString(\"doubleval\", \"invalid\");\n InnerCNode def = new DefParser(\"simpletypes\", new StringReader(StringUtilities.implode(SimpletypesConfig.CONFIG_DEF_SCHEMA, \"\\n\"))).getTree();\n new ConfigFileFormat(def).encode(new ByteArrayOutputStream(), slime);\n }", "private double IntegerParseIn(double Precio) {\n throw new UnsupportedOperationException(\"Not supported yet.\"); //To change body of generated methods, choose Tools | Templates.\n }", "@java.lang.Override\n public long getLongValue() {\n if (typeCase_ == 3) {\n return (java.lang.Long) type_;\n }\n return 0L;\n }", "public abstract double[] getasDouble(int tuple);", "double getValue();", "double getValue();", "double getValue();", "public static double leerDouble() {\n\t\tthrow new UnsupportedOperationException();\n\t}", "public OCFloat(OCInteger lenType)\r\n {\r\n super(lenType);\r\n setLength(4);\r\n }", "void mo130799a(double d);", "public static double datodouble(){\n try {\n Double f=new Double(dato());\n return(f.doubleValue());\n } catch (NumberFormatException error) {\n return(Double.NaN);\n }\n }", "private TsPrimitiveType readOneValue() {\n switch (dataType) {\n case BOOLEAN:\n return new TsBoolean(valueDecoder.readBoolean(valueInputStream));\n case INT32:\n return new TsInt(valueDecoder.readInt(valueInputStream));\n case INT64:\n return new TsLong(valueDecoder.readLong(valueInputStream));\n case FLOAT:\n return new TsFloat(valueDecoder.readFloat(valueInputStream));\n case DOUBLE:\n return new TsDouble(valueDecoder.readDouble(valueInputStream));\n case TEXT:\n return new TsBinary(valueDecoder.readBinary(valueInputStream));\n default:\n break;\n }\n throw new UnSupportedDataTypeException(\"Unsupported data type :\" + dataType);\n }", "int getDataTypeValue();", "public static double isDouble() {\n\t\twhile (true) {\n\t\t\ttry {\n\t\t\t\treturn input.nextDouble();\n\t\t\t} catch (InputMismatchException e) {\n\t\t\t\tinput.next();\n\t\t\t\tSystem.out.println(\"Vas unos nije odgovarajuci. Probajte ponovo: \");\n\t\t\t}\n\t\t}\n\t}", "void writeDouble(double value);", "@Override\n\tpublic Type getType() {\n\t\treturn Type.FLOAT;\n\t}" ]
[ "0.66770065", "0.63548017", "0.6348221", "0.6342794", "0.6286748", "0.6286562", "0.62415045", "0.62285113", "0.6176737", "0.61717606", "0.60764956", "0.60742694", "0.6066293", "0.6032801", "0.60286814", "0.6025049", "0.601542", "0.5959509", "0.59377545", "0.59002924", "0.5898876", "0.58972657", "0.58942175", "0.58928376", "0.5890025", "0.5873796", "0.58692664", "0.58477724", "0.58214265", "0.5804629", "0.57761407", "0.57657284", "0.5718842", "0.5710443", "0.56878364", "0.568356", "0.5680416", "0.5666828", "0.56609714", "0.5641718", "0.5640917", "0.5633694", "0.5608703", "0.56061804", "0.56019515", "0.5595205", "0.5578014", "0.5568802", "0.5529873", "0.55279505", "0.5524837", "0.5515821", "0.5509604", "0.5501653", "0.5497232", "0.549532", "0.5495134", "0.5486931", "0.54703414", "0.5466086", "0.54644877", "0.54643434", "0.5463716", "0.54481673", "0.5445194", "0.5442178", "0.5441387", "0.5441341", "0.54276496", "0.54275256", "0.5420042", "0.5417336", "0.5409133", "0.54077333", "0.540576", "0.5402641", "0.5395491", "0.5382886", "0.5371896", "0.53703064", "0.53614116", "0.53531736", "0.5352584", "0.53459674", "0.53457373", "0.5343557", "0.5335971", "0.5335881", "0.5332064", "0.5320062", "0.5320062", "0.5320062", "0.5316006", "0.530932", "0.5305781", "0.530556", "0.53034633", "0.52949995", "0.5286672", "0.5277252", "0.5266497" ]
0.0
-1
there will be issue when the type is double/int/long
protected void setExtraData(UiAction uiAction, ResultSet rs, int rowNumber) throws SQLException{ String extraData = rs.getString(UiActionTable.COLUMN_EXTRA_DATA); if(extraData == null){ //do nothing when nothing found in database return; } uiAction.setExtraData(extraData); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\n public Class getValueType() {\n return Double.class;\n }", "public static void main(String args[]) {\n\t\t \n\t\t // lets define some variables and try to insert other data type value\n\t\t int x = 23;\n\t\t double y ;\n\t\t y = x ; // here we are storing int to double ie. smaller to larger . So no error\n\t\t System.out.println(y);\n\t\t System.out.println(x);\n\t\t \n\t\t double a = 25.28;\n\t\t int b ;\n\t\t //b = a; // Here we can see error since we are trying to store double to int i.e larger to smaller w/o casting\n\t\t \n\t\t // lets do casting and store \n\t\t b = (int) a;\n\t\t System.out.println(b);\n\t\t \n\t\t boolean bool = true ;\n\t\t int num = bool; // not possible as we know boolean data type cannot be typecast;\n\t\t \n\t\t //int to long\n\t\t int value = 34;\n\t\t long value1 ;\n\t\t \n\t\t value1 = value;\n\t\t System.out.println(value1);\n\t\t value = value1; // trying longer to smaller w/o casting which is not possible;\n\t\t System.out.println(value);\n\t\t \n\t\t value = (int) value1;\n\t\t \n\t\t // long to float \n\t\t \n\t\t long value2 = 678;\n\t\t float value3; \n\t\t value3 = value2; // works fine since smaller to larger\n\t\t System.out.println(value3);\n\t\t value2 = value3 ; // trying longer to smaller w/o casting which is not possible;\n\t\t \n\t\t // so to assign value3 to value2 we need Explicitly type cast\n\t\t value2 = (long) value3;\n\t\t \n\t\t // float to long and vice versa \n\t\t \n\t\t float value4 = 567.78f;\n\t\t double value5 ;\n\t\t value5 = value4 ; // works fine since assigning smaller type to larger type\n\t\t System.out.println(value5);\n\t\t value4 = value5 ; // trying longer to smaller w/o casting which is not possible;\n\t\t \n\t\t // Also we can explicit cast for storing larger (double) to long/int/short\n\t\t double value6 = 3564.8;\n\t\t int value7 ;\n\t\t \n\t\t value7 = (int) value6;\n\t\t System.out.println(value7);\n\t\t \n\t\t \n\t\t \n\t\t \n\t\t \n\t }", "@Override\n\tpublic void visit(DoubleType n) {\n\t\t\n\t}", "private void functionalInterfacesForDoubleIntLong() {\n double d = 1.0;\n DoubleToIntFunction f1 = x -> 1;\n f1.applyAsInt(d);\n\n }", "public interface DoubleType extends NumericType {\n}", "@java.lang.Override\n public double getRealValue() {\n if (typeCase_ == 4) {\n return (java.lang.Double) type_;\n }\n return 0D;\n }", "double getEDouble();", "public boolean isDouble();", "long getNumericField();", "@Test\n public void test_column_type_detection_double() throws SQLException {\n ColumnInfo info = testColumnTypeDetection(\"x\", NodeFactory.createLiteral(\"12.3e4\", XSDDatatype.XSDdouble), true, Types.DOUBLE, Double.class.getCanonicalName());\n Assert.assertEquals(16, info.getScale());\n Assert.assertEquals(16, info.getPrecision());\n Assert.assertTrue(info.isSigned());\n }", "public abstract double read_double();", "public static void main(String[] args) {\ndouble anInt=1234;\nbyte aByte=12;\nshort aShort=12;\nlong aLong=1234567890987654321L;\ndouble anotherInt= (anInt * 10000000);\nSystem.out.println(\"The int is \" + anInt);\nSystem.out.println(\"The byte is \" + aByte);\nSystem.out.println(\"The short is \" + aShort);\nSystem.out.println(\"The long is \" + aLong);\nSystem.out.println(\"Another int is \" + anotherInt); \n\t}", "public abstract Double toDouble(T t);", "default T handleNumber(double val) {\n throw new UnsupportedOperationException();\n }", "public static Double toDouble(Object o,byte type) throws ExecException {\n try {\n switch (type) {\n case BOOLEAN:\n return (Boolean) o ? Double.valueOf(1.0D) : Double.valueOf(0.0D);\n\n case INTEGER:\n return new Double(((Integer)o).doubleValue());\n\n case LONG:\n return new Double(((Long)o).doubleValue());\n\n case FLOAT:\n return new Double(((Float)o).doubleValue());\n\n case DOUBLE:\n return (Double)o;\n\n case DATETIME:\n return new Double(Long.valueOf(((DateTime)o).getMillis()).doubleValue());\n\n case BYTEARRAY:\n return Double.valueOf(((DataByteArray)o).toString());\n\n case CHARARRAY:\n return Double.valueOf((String)o);\n\n case BIGINTEGER:\n return Double.valueOf(((BigInteger)o).doubleValue());\n\n case BIGDECIMAL:\n return Double.valueOf(((BigDecimal)o).doubleValue());\n\n case NULL:\n return null;\n\n case BYTE:\n case MAP:\n case INTERNALMAP:\n case TUPLE:\n case BAG:\n case UNKNOWN:\n default:\n int errCode = 1071;\n String msg = \"Cannot convert a \" + findTypeName(o) +\n \" to a Double\";\n throw new ExecException(msg, errCode, PigException.INPUT);\n }\n } catch (ClassCastException cce) {\n throw cce;\n } catch (ExecException ee) {\n throw ee;\n } catch (NumberFormatException nfe) {\n int errCode = 1074;\n String msg = \"Problem with formatting. Could not convert \" + o + \" to Double.\";\n throw new ExecException(msg, errCode, PigException.INPUT, nfe);\n } catch (Exception e) {\n int errCode = 2054;\n String msg = \"Internal error. Could not convert \" + o + \" to Double.\";\n throw new ExecException(msg, errCode, PigException.BUG);\n }\n }", "private void validate(Adouble val) {\r\n Assertions.assertEquals(val.aonType(), Atype.DOUBLE);\r\n Assertions.assertEquals(val, val);\r\n Assertions.assertEquals(val, Adouble.valueOf(val.toDouble()));\r\n Assertions.assertEquals(val.hashCode(), Adouble.valueOf(val.toDouble()).hashCode());\r\n Assertions.assertTrue(val.isNumber());\r\n }", "public static interface DataTypeWithRatioScale<T> {\r\n \r\n /**\r\n * Add\r\n *\r\n * @param augend\r\n * @param addend\r\n * @return\r\n */\r\n public abstract T add(T augend, T addend);\r\n\r\n /**\r\n * Compare\r\n *\r\n * @param s1\r\n * @param s2\r\n * @return\r\n * @throws NumberFormatException\r\n * @throws ParseException\r\n */\r\n public abstract int compare(String s1, String s2) throws NumberFormatException,\r\n ParseException;\r\n\r\n /**\r\n * Compare\r\n *\r\n * @param t1\r\n * @param t2\r\n * @return\r\n */\r\n public abstract int compare(T t1, T t2);\r\n\r\n /**\r\n * Divide\r\n *\r\n * @param dividend\r\n * @param divisor\r\n * @return\r\n */\r\n public abstract String divide(String dividend, String divisor);\r\n \r\n /**\r\n * Divide\r\n *\r\n * @param dividend\r\n * @param divisor\r\n * @return\r\n */\r\n public abstract T divide(T dividend, T divisor);\r\n \r\n /**\r\n * Format\r\n *\r\n * @param t\r\n * @return\r\n */\r\n public abstract String format(T t);\r\n\r\n /**\r\n * Converts a double into a value.\r\n *\r\n * @param s\r\n * @return\r\n */\r\n public abstract T fromDouble(Double d);\r\n\r\n /**\r\n * Description\r\n *\r\n * @return\r\n */\r\n public abstract DataTypeDescription<T> getDescription();\r\n\r\n /**\r\n * Maximum\r\n *\r\n * @return\r\n */\r\n public T getMaximum();\r\n \r\n /**\r\n * Minimum\r\n *\r\n * @return\r\n */\r\n public T getMinimum();\r\n\r\n /**\r\n * Valid\r\n *\r\n * @param s\r\n * @return\r\n */\r\n public abstract boolean isValid(String s);\r\n\r\n /**\r\n * Multiply\r\n *\r\n * @param multiplicand\r\n * @param multiplicator\r\n * @return\r\n */\r\n public abstract String multiply(String multiplicand,\r\n String multiplicator);\r\n\r\n /**\r\n * Multiply\r\n *\r\n * @param multiplicand\r\n * @param multiplicator\r\n * @return\r\n */\r\n public abstract T multiply(T multiplicand, double multiplicator);\r\n\r\n /**\r\n * Multiply\r\n *\r\n * @param multiplicand\r\n * @param multiplicator\r\n * @return\r\n */\r\n public abstract T multiply(T multiplicand, int multiplicator);\r\n\r\n /**\r\n * Multiply\r\n *\r\n * @param multiplicand\r\n * @param multiplicator\r\n * @return\r\n */\r\n public abstract T multiply(T multiplicand, T multiplicator);\r\n \r\n /**\r\n * Parse\r\n *\r\n * @param s\r\n * @return\r\n */\r\n public abstract T parse(String s);\r\n\r\n /**\r\n * Divide\r\n *\r\n * @param dividend\r\n * @param divisor\r\n * @return\r\n */\r\n public abstract double ratio(T dividend, T divisor);\r\n \r\n /**\r\n * Subtract\r\n *\r\n * @param minuend\r\n * @param subtrahend\r\n * @return\r\n */\r\n public abstract T subtract(T minuend, T subtrahend);\r\n \r\n /**\r\n * Converts a double into a value.\r\n *\r\n * @param s\r\n * @return\r\n */\r\n public abstract Double toDouble(T t);\r\n }", "public abstract T fromDouble(Double d);", "public double getRealValue() {\n if (typeCase_ == 4) {\n return (java.lang.Double) type_;\n }\n return 0D;\n }", "Double getDoubleValue();", "double getRealValue();", "private double convertToDbl(Object a) {\n double result = 0;\n\n //If the object is a Character...\n if(a instanceof Character){\n char x = (Character)a;\n result = (double)(x - '0'); // -'0' as it will convert the ascii number (e.g 4 is 52 in ascii) to the standard number\n }\n\n //If it is a Double...\n else if(a instanceof Double){\n result = (Double)a;\n }\n\n return result;\n }", "public boolean isDouble() {\n return this.data instanceof Double;\n }", "public abstract double getasDouble(int tuple, int val);", "public boolean isDouble() {\n return false;\n }", "@Override\n public Double value(TypeOfValue value);", "public abstract double readAsDbl(int offset);", "double readDouble()\n throws IOException {\n return Double.longBitsToDouble( readLong() );\n }", "public abstract Double getDataValue();", "private static int m6082a(Class<?> cls) {\n if (cls == Double.TYPE) {\n return 1;\n }\n if (cls == Float.TYPE) {\n return 2;\n }\n if (cls == Long.TYPE) {\n return 3;\n }\n if (cls == Integer.TYPE) {\n return 4;\n }\n if (cls == Short.TYPE) {\n return 5;\n }\n if (cls == Character.TYPE) {\n return 6;\n }\n if (cls == Byte.TYPE) {\n return 7;\n }\n if (cls == Boolean.TYPE) {\n return 99;\n }\n return 8;\n }", "double getDoubleValue2();", "double readDouble();", "Double getValue();", "private static double getLongt() {\n\t\treturn longt;\n\t}", "public double getDouble();", "boolean hasDouble();", "public abstract void writeAsDbl(int offset, double d);", "public boolean realAsDouble() {\n return false;\n }", "public abstract Number getPrimitiveType();", "double getDoubleValue1();", "int getSimpleType() {\n\t\treturn ((type / 1000)) * 1000;\n\t}", "private double readDouble() throws IOException {\n\t\treturn (isBigEndian ? ioReadDouble() : Double.longBitsToDouble(readLELong()));\n\t}", "public static void main(String[] args){\n short num=100;\n int inum=num;\n long lnum=num;\n float fnum=num;\n double dnum=num;\n //When you assign value of one data type to another,\n // the two types might not be compatible with each other.\n // If the data types are compatible,\n // then Java will perform the conversion automatically known as Automatic Type Conversion and\n // if not then they need to be casted or converted explicitly.\n //this happens only when\n //The two data types are compatible.\n //When we assign value of a smaller data type to a bigger data type.(byte<short<int<long<float<double)\n //For Example, in java the numeric data types are compatible with each other\n // but no automatic conversion is supported from numeric type to char or boolean.\n // Also, char and boolean are not compatible with each other.\n System.out.println(\"num is \"+num);\n System.out.println(\"inum is \"+inum);\n System.out.println(\"lnum is \"+lnum);\n System.out.println(\"fnum is \"+fnum);\n System.out.println(\"dnum is \"+dnum);\n\n //Narrowing or Explicit conversion\n dnum=323.142;\n byte bnum=(byte)dnum;//converting bigger data type o smaller data type\n //so explicit conversion is needed\n System.out.println(\"dnum converted to bnum(byte) is \"+bnum);\n\n }", "public static double longToDouble(long l) {\n return (double) l;\n }", "public void testDoubleValue() {\n AtomicLong ai = new AtomicLong();\n assertEquals(0.0d, ai.doubleValue());\n for (long x : VALUES) {\n ai.set(x);\n assertEquals((double)x, ai.doubleValue());\n }\n }", "double getDoubleValue3();", "public static void main(String[] args) {\n // example of type casting\n // it will store the double and store it as an int.\n //by default, java will round down\n\n int a = (int) 0.5;\n System.out.println(a);\n //results will be 0\n\n\n //some primitive data types - byte, short, char, int, long, float, double\n\n // byte a;\n // short b;\n // char c;\n // int d;\n // long e;\n // float f;\n // double g;\n\n //if you were to use int and then store it to double, it will cast to double by default.\n\n //it will work its way down this primitive types data\n\n \n }", "public static void testOfDoubleNumberIsInteger(){\n\t\tSystem.out.println(\"please enter a double number: \");\n\t\tScanner scann=new Scanner(System.in);\n\t\tdouble x=scann.nextDouble();\n\t\tif(x%1==0)\n\t\t\tSystem.out.println(\"The number you have enterd it's not a double \");\n\t\telse\n\t\t\tSystem.out.println(\"The number you have entered it's double\");\n\t}", "private final double get_DOUBLE(int column) {\n if (metadata.isZos()) {\n byte[] bytes = new byte[8];\n dataBuffer_.getBytes(columnDataPosition_[column - 1], bytes);\n return FloatingPoint.getDouble_hex(bytes, 0);\n //return dataBuffer_.getDouble(columnDataPosition_[column - 1]);\n } else {\n return dataBuffer_.getDoubleLE(columnDataPosition_[column - 1]);\n// return FloatingPoint.getDouble(dataBuffer_,\n// columnDataPosition_[column - 1]);\n }\n }", "public static void main(String[] args) {\n\n Integer num1 = 100;\n double num2 = num1;\n System.out.println(num2);\n\n float f = 0.5f;\n Float fl = f;\n System.out.println(fl);\n\n System.out.println(Byte.MAX_VALUE);\n\n // parse method --> converting String value to primitives, returne primitive\n // valueOf --> converting String to Wrapper class, return Wrapper class\n\n String str1 = \"123\";\n int result = Integer.parseInt(str1);\n System.out.println(result+1);\n\n String str2 = \"true\";\n boolean r1 = Boolean.parseBoolean(str2);\n System.out.println(r1);\n\n // parse method not case sencetive\n String str3 = \"FaLse\"; // it is work\n boolean r2 = Boolean.parseBoolean(str3);\n System.out.println(r2);\n\n String s1 = \"100.5\";\n Double c1 = Double.parseDouble(s1);\n System.out.println(c1 + 1); // it is call auto boxing\n Double c2 = Double.valueOf(s1); // this in not auto and not unboxing\n\n System.out.println(c1);\n System.out.println(c2);\n\n String s2 = \"TrUe\";\n Boolean b1 = Boolean.valueOf(s2);\n System.out.println(b1); // no sensetive\n\n Double [] arr = new Double[3];\n System.out.println(Arrays.toString(arr));\n // default value of wrapper class always --> null, null, null\n\n String name = \"string\";\n String name1 = new String(\"string\");\n\n Integer I1 = new Integer(\"123\");\n\n System.out.println(addNum(12,13));\n System.out.println(addNum(15.3,7.4));\n \n }", "public interface Numeric extends DataType {\n}", "@ZenCodeType.Caster\n @ZenCodeType.Method\n default double asDouble() {\n \n return notSupportedCast(BasicTypeID.DOUBLE);\n }", "public native double __doubleMethod( long __swiftObject, double arg );", "int toInt (double val) {\n return (int)val;\n }", "public double castToDoubleValue() {\n throw new IteratorFlowException(\"Cannot call castToDouble on non numeric\");\n }", "@Test\n\tpublic void test_TCM__double_getDoubleValue() {\n\t\tAttribute attr = new Attribute(\"test\", \"11111111111111\");\n\t\ttry {\n\t\t\tassertTrue(\"incorrect double value\", attr.getDoubleValue() == 11111111111111d );\n\n\t\t\tattr.setValue(\"0\");\n\t\t\tassertTrue(\"incorrect double value\", attr.getDoubleValue() == 0 );\n\n\t\t\tattr.setValue(Double.toString(java.lang.Double.MAX_VALUE));\n\t\t\tassertTrue(\"incorrect double value\", attr.getDoubleValue() == java.lang.Double.MAX_VALUE);\n\n\t\t\tattr.setValue(Double.toString(java.lang.Double.MIN_VALUE));\n\t\t\tassertTrue(\"incorrect double value\", attr.getDoubleValue() == java.lang.Double.MIN_VALUE);\n\n\t\t} catch (DataConversionException e) {\n\t\t\tfail(\"couldn't convert boolean value\");\n\t\t}\n\n\t\ttry {\n\t\t\tattr.setValue(\"foo\");\n\t\t\tfail(\"incorrectly returned double from non double value\" + attr.getDoubleValue());\n\n\t\t} catch (DataConversionException e) {\n\t\t\t// Do nothing\n\t\t} catch (Exception e) {\n\t\t\tfail(\"Unexpected exception \" + e.getClass());\n\t\t}\n\n\t}", "public static void main(String[] args)\n {\n double x = 5.3;\n int y = (int)x;\n \n }", "private void ex04(){\n int number;\n number = 1;\n\n double number2;\n number2 = 1.5;\n\n String number3;\n number3 = \"3\";\n\n boolean bool = (number == 1);\n\n myWindow.clearOut();\n myWindow.writeOutLine(number);\n myWindow.writeOutLine(new String(String.valueOf(number))); //int to string\n myWindow.writeOutLine((double) number); //int to double\n myWindow.writeOutLine(bool); //int to boolean\n\n /*\n Java can perform number -> string\n method 1: numberType.toString\n method 2: String.valueOf(int/double/float) //used above in the code\n Java can also perform string -> number\n dataType.parseDatatype() // e.g.: Integer.parseInt()\n\n Java allows this only when the conversion is widening (small -> larger)\n alternatively reports a compile error if the conversion is narrowing\n */\n\n //YOUR CODE ABOVE HERE\n }", "public int getAxisType()\n {\n return DOUBLE;\n }", "private double convertDouble()\n\t{\n\t\tString val = tokens[10];\n\t\tdouble value = 0.0;\n\t\ttry {\n\t\t\tvalue = Double.parseDouble(tokens[10]);\n\t\t}\n\t\tcatch(NumberFormatException e) {\n\t\t\tSystem.err.print(\"\");\n\t\t}\n\t\treturn value;\n\t}", "public static void main(String[] args){\n long money = 500000; //not equal datatype, so implicit type casting\n long money1 = 500000L; //Recommendation\n\n System.out.println(money);\n System.out.println(money1);\n\n //JVM default float is double(8byte)\n //float pi = 3.141592; //compile error, incompatible types\n float PI = 3.141592f; // f or F\n double dd = 152.12331;\n System.out.println(PI);\n System.out.println(dd);\n }", "private Type get_value_type(long xx) {\n Type vt = _values.get(xx);\n assert vt!=null;\n return vt;\n }", "private static native boolean set_0(long nativeObj, int propId, double value);", "public static void main(String[] args) {\n\n\t\tSystem.out.println( \"Min value of Byte :\"+ Byte.MIN_VALUE); \n\t\tSystem.out.println( \"Max value of Byte :\"+ Byte.MAX_VALUE); \n\n\t\tSystem.out.println();\n\t\t\n\t\tSystem.out.println( \"Min value of Short :\"+ Short.MIN_VALUE); \n\t\tSystem.out.println( \"Max value of Short :\"+ Short.MAX_VALUE); \n\n\t\tSystem.out.println();\n\t\t\n\t\tSystem.out.println( \"Min value of Integer :\"+ Integer.MIN_VALUE); \n\t\tSystem.out.println( \"Max value of Integer :\"+ Integer.MAX_VALUE); \n\n\t\tSystem.out.println();\n\t\t\n\t\tSystem.out.println( \"Min value of Long :\"+ Long.MIN_VALUE); \n\t\tSystem.out.println( \"Max value of Long :\"+ Long.MAX_VALUE); \n\n\t\t// l should be at the end of value\n\t\tlong number1 = 9223372036854775807l;\n\t\tSystem.out.println( \"After adding l at end of the long number \" + number1);\n\t\t\n\t\tSystem.out.println();\n\t\t\n\t\t\n\t\t/* *\n\t\t * Decimal Data Types *\n\t\t * \t\t-----------------\t *\n\t\t *\t\t\t\t\t\t\t *\n\t\t*/\n\t\t\n\t\t// 1. float \t\t2. double\n\n\t\tSystem.out.println( \"Min value of float :\"+ Float.MIN_VALUE); \n\t\tSystem.out.println( \"Max value of float :\"+ Float.MAX_VALUE); \n\t\t\n\t\t// f should be at the end of value\n\t\tfloat decimal1 = 32245.12123f;\n\t\t\n\t\tSystem.out.println( \"After adding f at the end of the float\" + decimal1);\n\t\t\n\t\tSystem.out.println();\n\n\t\tSystem.out.println( \"Min value of double :\"+ Double.MIN_VALUE); \n\t\tSystem.out.println( \"Max value of double :\"+ Double.MAX_VALUE); \n\n\t\tSystem.out.println();\n\t\t\n\t\t\n\t\t\n\t\t/* *\n\t\t * Character Data Types *\n\t\t * \t --------------------\t *\n\t\t *\t\t\t\t\t\t\t *\n\t\t*/\n\t\t\n\t\t\n\t\t// 1. char \t\t\t2. String( int 2 bytes)\n\n\t\t// can only contain single letter\n\t\tchar ch = 'a'; \n\t\tSystem.out.println( \"Single character :\"+ ch);\n\t\t\n\t\t// can contain unicode values \n\t\tchar unicode = '\\u0000';\n\t\tSystem.out.println( \"Unicodes are stored but not shown :\"+ unicode);\n\t\t\n\t\t// are stored in int\n\t\tint num = 'a';\n\t\tSystem.out.println( \"character stored in int:\"+num);\n\t\t\n\t\tSystem.out.println();\n\t\t\n\n\t\tString str = \"Hello\" + \" World\";\n\t\tSystem.out.println(str);\n\n\t}", "public static void main(String[] args)\n {\n\n double myDouble = 3.14;\n float myFloat = 3.14f; //Removing the f will cause an error due to lossy conversion\n double yourDouble = myFloat; //Widening/lossless conversions won't raise errors\n }", "public abstract double GetRaw();", "public int getDataType()\n {\n return dtype;\n }", "public Double\n getDoubleValue() \n {\n return ((Double) getValue());\n }", "private Object getTypeObjectPair() throws MathLinkException, NumberRangeException {\n Object result = null;\n int type = this.getInteger();\n if (type % -17 == -15) {\n type = -7 + -17 * (type / -17);\n } else if (type % -17 == -16) {\n type = -8 + -17 * (type / -17);\n }\n switch (type) {\n case -5: {\n result = new Integer(this.getInteger());\n break;\n }\n case -6: {\n result = new Long(this.getLongInteger());\n break;\n }\n case -4: {\n int i = this.getInteger();\n if (i < -32768 || i > 32767) {\n throw new NumberRangeException(i, \"short\");\n }\n result = new Short((short)i);\n break;\n }\n case -2: {\n int i = this.getInteger();\n if (i < -128 || i > 127) {\n throw new NumberRangeException(i, \"byte\");\n }\n result = new Byte((byte)i);\n break;\n }\n case -3: {\n int i = this.getInteger();\n if (i < 0 || i > 65535) {\n throw new NumberRangeException(i, \"char\");\n }\n result = new Character((char)i);\n break;\n }\n case -15: \n case -7: {\n double d = this.getDouble();\n if (d < -3.4028234663852886E38 || d > 3.4028234663852886E38) {\n throw new NumberRangeException(d, \"float\");\n }\n result = new Float((float)d);\n break;\n }\n case -16: \n case -8: {\n result = new Double(this.getDouble());\n break;\n }\n case -9: {\n int tok = this.getType();\n if (tok == 100000) {\n result = this.getObject();\n break;\n }\n result = this.getString();\n if (tok != 35 || !result.equals(\"Null\")) break;\n result = null;\n break;\n }\n case -1: {\n String s = this.getSymbol();\n if (s.equals(\"True\")) {\n result = Boolean.TRUE;\n break;\n }\n result = Boolean.FALSE;\n break;\n }\n case -13: {\n long mark = this.createMark();\n try {\n int tok = this.getNext();\n if (tok == 100000) {\n result = this.getObject();\n break;\n }\n if (tok == 35) {\n result = this.getSymbol();\n if (result.equals(\"Null\")) {\n result = null;\n break;\n }\n this.seekMark(mark);\n result = this.getComplex();\n break;\n }\n this.seekMark(mark);\n result = this.getComplex();\n }\n finally {\n this.destroyMark(mark);\n }\n }\n case -10: {\n long mark = this.createMark();\n try {\n int tok = this.getType();\n if (tok == 100000) {\n result = this.getObject();\n break;\n }\n if (tok == 35) {\n result = this.getSymbol();\n if (result.equals(\"Null\")) {\n result = null;\n break;\n }\n result = new BigInteger((String)result);\n break;\n }\n result = new BigInteger(this.getString());\n }\n finally {\n this.destroyMark(mark);\n }\n }\n case -11: {\n long mark = this.createMark();\n try {\n int tok = this.getType();\n if (tok == 100000) {\n result = this.getObject();\n break;\n }\n if (tok == 35) {\n result = this.getSymbol();\n if (result.equals(\"Null\")) {\n result = null;\n break;\n }\n result = Utils.bigDecimalFromString((String)result);\n break;\n }\n result = Utils.bigDecimalFromString(this.getString());\n }\n finally {\n this.destroyMark(mark);\n }\n }\n case -12: {\n long mark = this.createMark();\n try {\n int tok = this.getNext();\n if (tok == 100000 && (result = this.getObject()) != null) break;\n this.seekMark(mark);\n result = this.getExpr();\n }\n finally {\n this.destroyMark(mark);\n }\n }\n case -14: {\n result = this.getObject();\n break;\n }\n case -10000: {\n break;\n }\n default: {\n int tok = this.getNext();\n result = tok == 100000 || tok == 35 ? this.getObject() : (type > -34 ? this.getArray(type - -17, 1) : (type > -51 ? this.getArray(type - -34, 2) : (type > -68 ? this.getArray(type - -51, 3) : (type > -85 ? this.getArray(type - -68, 4) : this.getArray(type - -85, 5)))));\n }\n }\n return result;\n }", "private static native double get_0(long nativeObj, int propId);", "public double doubleValue() {\r\n return (double) intValue();\r\n }", "public static void isValid(double dbl) throws IllegalArgumentException {\n\t//nothing to do here\n }", "public double asDouble() {\r\n\t\tif (this.what == SCALARTYPE.Integer || this.what == SCALARTYPE.Float) {\r\n\t\t\treturn (new BigDecimal(this.scalar)).doubleValue();\r\n\t\t} else\r\n\t\t\treturn 0; // ritorna un valore di default\r\n\t}", "public static void main(String[] args) {\n\t\tdouble d=10;\n\t\tSystem.out.println(d);\n\t\t\n\t\tint i=(int)10.99;\n\t\tSystem.out.println(i);\n\t\tbyte b=(byte)1243;\n\t\tSystem.out.println(b);\n\t\t\n\n\t}", "double getFloatingPointField();", "@Override\n public Type evaluateType() throws Exception {\n return new IntegerType();\n }", "public abstract double getValue();", "private boolean isNumber(Object o) {\n\t\tif(o instanceof String) return isNumber((String) o);\n\t\telse if(o instanceof Double) return true;\n\t\telse return false;\n\t}", "private static double m6088b(Object obj) {\n Method method = null;\n Object obj2 = obj;\n while (!(obj2 instanceof Number)) {\n if (obj2 instanceof String) {\n return ScriptRuntime.m6309a((String) obj2);\n }\n if (!(obj2 instanceof Scriptable)) {\n try {\n method = obj2.getClass().getMethod(\"doubleValue\");\n } catch (NoSuchMethodException | SecurityException e) {\n }\n if (method != null) {\n try {\n return ((Number) method.invoke(obj2)).doubleValue();\n } catch (IllegalAccessException e2) {\n m6091c(obj2, Double.TYPE);\n } catch (InvocationTargetException e3) {\n m6091c(obj2, Double.TYPE);\n }\n }\n return ScriptRuntime.m6309a(obj2.toString());\n } else if (!(obj2 instanceof Wrapper)) {\n return ScriptRuntime.m6395b(obj2);\n } else {\n obj2 = ((Wrapper) obj2).mo18879a();\n }\n }\n return ((Number) obj2).doubleValue();\n }", "void checkSameDataType(String datatype, String datatype1)\n {\n DefaultTableModel semanticerror = (DefaultTableModel)tblErrorSemantic.getModel();\n if(datatype.equals(datatype1))\n {\n\n }\n else if(datatype.equals(\"INT\") && datatype1.equals(\"FLOAT\"))\n {\n \n }\n else if(datatype.equals(\"FLOAT\") && datatype1.equals(\"INT\"))\n {\n \n }\n else if(datatype1 == null)\n {\n\n }\n else\n {\n semanticerror.addRow(new Object[] {tblLexeme.getModel().getValueAt(tokenPos-2, 0),\"Incompatible Types: \"+datatype1+\" Cannot be converted to \"+datatype, tblLexeme.getModel().getValueAt(tokenPos-2, 2)}); \n } \n datatype = null;\n }", "public long longValue() {\n\t\treturn (long) mDouble;\n\t}", "private void m2248a(double d, String str) {\n this.f2954c = d;\n this.f2955d = (long) d;\n this.f2953b = str;\n this.f2952a = ValueType.doubleValue;\n }", "@Override\n public String getDataType() {\n return getPrimitiveType().name();\n }", "@Override\n public double nextDouble() {\n return super.nextDouble();\n }", "public double getAsDouble(int index) {\n switch (type) {\n case TIFFTag.TIFF_BYTE: case TIFFTag.TIFF_UNDEFINED:\n return ((byte[])data)[index] & 0xff;\n case TIFFTag.TIFF_SBYTE:\n return ((byte[])data)[index];\n case TIFFTag.TIFF_SHORT:\n return ((char[])data)[index] & 0xffff;\n case TIFFTag.TIFF_SSHORT:\n return ((short[])data)[index];\n case TIFFTag.TIFF_SLONG:\n return ((int[])data)[index];\n case TIFFTag.TIFF_LONG: case TIFFTag.TIFF_IFD_POINTER:\n return ((long[])data)[index];\n case TIFFTag.TIFF_FLOAT:\n return ((float[])data)[index];\n case TIFFTag.TIFF_DOUBLE:\n return ((double[])data)[index];\n case TIFFTag.TIFF_SRATIONAL:\n int[] ivalue = getAsSRational(index);\n return (double)ivalue[0]/ivalue[1];\n case TIFFTag.TIFF_RATIONAL:\n long[] lvalue = getAsRational(index);\n return (double)lvalue[0]/lvalue[1];\n case TIFFTag.TIFF_ASCII:\n String s = ((String[])data)[index];\n return Double.parseDouble(s);\n default:\n throw new ClassCastException();\n }\n }", "@Ignore\n @Test(expected = IllegalArgumentException.class)\n public void require_that_illegal_double_throws_exception() throws IOException {\n Slime slime = new Slime();\n Cursor root = slime.setObject();\n root.setString(\"doubleval\", \"invalid\");\n InnerCNode def = new DefParser(\"simpletypes\", new StringReader(StringUtilities.implode(SimpletypesConfig.CONFIG_DEF_SCHEMA, \"\\n\"))).getTree();\n new ConfigFileFormat(def).encode(new ByteArrayOutputStream(), slime);\n }", "private double IntegerParseIn(double Precio) {\n throw new UnsupportedOperationException(\"Not supported yet.\"); //To change body of generated methods, choose Tools | Templates.\n }", "@java.lang.Override\n public long getLongValue() {\n if (typeCase_ == 3) {\n return (java.lang.Long) type_;\n }\n return 0L;\n }", "public abstract double[] getasDouble(int tuple);", "double getValue();", "double getValue();", "double getValue();", "public static double leerDouble() {\n\t\tthrow new UnsupportedOperationException();\n\t}", "public OCFloat(OCInteger lenType)\r\n {\r\n super(lenType);\r\n setLength(4);\r\n }", "void mo130799a(double d);", "public static double datodouble(){\n try {\n Double f=new Double(dato());\n return(f.doubleValue());\n } catch (NumberFormatException error) {\n return(Double.NaN);\n }\n }", "private TsPrimitiveType readOneValue() {\n switch (dataType) {\n case BOOLEAN:\n return new TsBoolean(valueDecoder.readBoolean(valueInputStream));\n case INT32:\n return new TsInt(valueDecoder.readInt(valueInputStream));\n case INT64:\n return new TsLong(valueDecoder.readLong(valueInputStream));\n case FLOAT:\n return new TsFloat(valueDecoder.readFloat(valueInputStream));\n case DOUBLE:\n return new TsDouble(valueDecoder.readDouble(valueInputStream));\n case TEXT:\n return new TsBinary(valueDecoder.readBinary(valueInputStream));\n default:\n break;\n }\n throw new UnSupportedDataTypeException(\"Unsupported data type :\" + dataType);\n }", "int getDataTypeValue();", "public static double isDouble() {\n\t\twhile (true) {\n\t\t\ttry {\n\t\t\t\treturn input.nextDouble();\n\t\t\t} catch (InputMismatchException e) {\n\t\t\t\tinput.next();\n\t\t\t\tSystem.out.println(\"Vas unos nije odgovarajuci. Probajte ponovo: \");\n\t\t\t}\n\t\t}\n\t}", "void writeDouble(double value);", "@Override\n\tpublic Type getType() {\n\t\treturn Type.FLOAT;\n\t}" ]
[ "0.66770065", "0.63548017", "0.6348221", "0.6342794", "0.6286748", "0.6286562", "0.62415045", "0.62285113", "0.6176737", "0.61717606", "0.60764956", "0.60742694", "0.6066293", "0.6032801", "0.60286814", "0.6025049", "0.601542", "0.5959509", "0.59377545", "0.59002924", "0.5898876", "0.58972657", "0.58942175", "0.58928376", "0.5890025", "0.5873796", "0.58692664", "0.58477724", "0.58214265", "0.5804629", "0.57761407", "0.57657284", "0.5718842", "0.5710443", "0.56878364", "0.568356", "0.5680416", "0.5666828", "0.56609714", "0.5641718", "0.5640917", "0.5633694", "0.5608703", "0.56061804", "0.56019515", "0.5595205", "0.5578014", "0.5568802", "0.5529873", "0.55279505", "0.5524837", "0.5515821", "0.5509604", "0.5501653", "0.5497232", "0.549532", "0.5495134", "0.5486931", "0.54703414", "0.5466086", "0.54644877", "0.54643434", "0.5463716", "0.54481673", "0.5445194", "0.5442178", "0.5441387", "0.5441341", "0.54276496", "0.54275256", "0.5420042", "0.5417336", "0.5409133", "0.54077333", "0.540576", "0.5402641", "0.5395491", "0.5382886", "0.5371896", "0.53703064", "0.53614116", "0.53531736", "0.5352584", "0.53459674", "0.53457373", "0.5343557", "0.5335971", "0.5335881", "0.5332064", "0.5320062", "0.5320062", "0.5320062", "0.5316006", "0.530932", "0.5305781", "0.530556", "0.53034633", "0.52949995", "0.5286672", "0.5277252", "0.5266497" ]
0.0
-1
there will be issue when the type is double/int/long
protected void setVersion(UiAction uiAction, ResultSet rs, int rowNumber) throws SQLException{ Integer version = rs.getInt(UiActionTable.COLUMN_VERSION); if(version == null){ //do nothing when nothing found in database return; } uiAction.setVersion(version); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\n public Class getValueType() {\n return Double.class;\n }", "public static void main(String args[]) {\n\t\t \n\t\t // lets define some variables and try to insert other data type value\n\t\t int x = 23;\n\t\t double y ;\n\t\t y = x ; // here we are storing int to double ie. smaller to larger . So no error\n\t\t System.out.println(y);\n\t\t System.out.println(x);\n\t\t \n\t\t double a = 25.28;\n\t\t int b ;\n\t\t //b = a; // Here we can see error since we are trying to store double to int i.e larger to smaller w/o casting\n\t\t \n\t\t // lets do casting and store \n\t\t b = (int) a;\n\t\t System.out.println(b);\n\t\t \n\t\t boolean bool = true ;\n\t\t int num = bool; // not possible as we know boolean data type cannot be typecast;\n\t\t \n\t\t //int to long\n\t\t int value = 34;\n\t\t long value1 ;\n\t\t \n\t\t value1 = value;\n\t\t System.out.println(value1);\n\t\t value = value1; // trying longer to smaller w/o casting which is not possible;\n\t\t System.out.println(value);\n\t\t \n\t\t value = (int) value1;\n\t\t \n\t\t // long to float \n\t\t \n\t\t long value2 = 678;\n\t\t float value3; \n\t\t value3 = value2; // works fine since smaller to larger\n\t\t System.out.println(value3);\n\t\t value2 = value3 ; // trying longer to smaller w/o casting which is not possible;\n\t\t \n\t\t // so to assign value3 to value2 we need Explicitly type cast\n\t\t value2 = (long) value3;\n\t\t \n\t\t // float to long and vice versa \n\t\t \n\t\t float value4 = 567.78f;\n\t\t double value5 ;\n\t\t value5 = value4 ; // works fine since assigning smaller type to larger type\n\t\t System.out.println(value5);\n\t\t value4 = value5 ; // trying longer to smaller w/o casting which is not possible;\n\t\t \n\t\t // Also we can explicit cast for storing larger (double) to long/int/short\n\t\t double value6 = 3564.8;\n\t\t int value7 ;\n\t\t \n\t\t value7 = (int) value6;\n\t\t System.out.println(value7);\n\t\t \n\t\t \n\t\t \n\t\t \n\t\t \n\t }", "@Override\n\tpublic void visit(DoubleType n) {\n\t\t\n\t}", "private void functionalInterfacesForDoubleIntLong() {\n double d = 1.0;\n DoubleToIntFunction f1 = x -> 1;\n f1.applyAsInt(d);\n\n }", "public interface DoubleType extends NumericType {\n}", "@java.lang.Override\n public double getRealValue() {\n if (typeCase_ == 4) {\n return (java.lang.Double) type_;\n }\n return 0D;\n }", "double getEDouble();", "public boolean isDouble();", "long getNumericField();", "@Test\n public void test_column_type_detection_double() throws SQLException {\n ColumnInfo info = testColumnTypeDetection(\"x\", NodeFactory.createLiteral(\"12.3e4\", XSDDatatype.XSDdouble), true, Types.DOUBLE, Double.class.getCanonicalName());\n Assert.assertEquals(16, info.getScale());\n Assert.assertEquals(16, info.getPrecision());\n Assert.assertTrue(info.isSigned());\n }", "public abstract double read_double();", "public static void main(String[] args) {\ndouble anInt=1234;\nbyte aByte=12;\nshort aShort=12;\nlong aLong=1234567890987654321L;\ndouble anotherInt= (anInt * 10000000);\nSystem.out.println(\"The int is \" + anInt);\nSystem.out.println(\"The byte is \" + aByte);\nSystem.out.println(\"The short is \" + aShort);\nSystem.out.println(\"The long is \" + aLong);\nSystem.out.println(\"Another int is \" + anotherInt); \n\t}", "public abstract Double toDouble(T t);", "default T handleNumber(double val) {\n throw new UnsupportedOperationException();\n }", "public static Double toDouble(Object o,byte type) throws ExecException {\n try {\n switch (type) {\n case BOOLEAN:\n return (Boolean) o ? Double.valueOf(1.0D) : Double.valueOf(0.0D);\n\n case INTEGER:\n return new Double(((Integer)o).doubleValue());\n\n case LONG:\n return new Double(((Long)o).doubleValue());\n\n case FLOAT:\n return new Double(((Float)o).doubleValue());\n\n case DOUBLE:\n return (Double)o;\n\n case DATETIME:\n return new Double(Long.valueOf(((DateTime)o).getMillis()).doubleValue());\n\n case BYTEARRAY:\n return Double.valueOf(((DataByteArray)o).toString());\n\n case CHARARRAY:\n return Double.valueOf((String)o);\n\n case BIGINTEGER:\n return Double.valueOf(((BigInteger)o).doubleValue());\n\n case BIGDECIMAL:\n return Double.valueOf(((BigDecimal)o).doubleValue());\n\n case NULL:\n return null;\n\n case BYTE:\n case MAP:\n case INTERNALMAP:\n case TUPLE:\n case BAG:\n case UNKNOWN:\n default:\n int errCode = 1071;\n String msg = \"Cannot convert a \" + findTypeName(o) +\n \" to a Double\";\n throw new ExecException(msg, errCode, PigException.INPUT);\n }\n } catch (ClassCastException cce) {\n throw cce;\n } catch (ExecException ee) {\n throw ee;\n } catch (NumberFormatException nfe) {\n int errCode = 1074;\n String msg = \"Problem with formatting. Could not convert \" + o + \" to Double.\";\n throw new ExecException(msg, errCode, PigException.INPUT, nfe);\n } catch (Exception e) {\n int errCode = 2054;\n String msg = \"Internal error. Could not convert \" + o + \" to Double.\";\n throw new ExecException(msg, errCode, PigException.BUG);\n }\n }", "private void validate(Adouble val) {\r\n Assertions.assertEquals(val.aonType(), Atype.DOUBLE);\r\n Assertions.assertEquals(val, val);\r\n Assertions.assertEquals(val, Adouble.valueOf(val.toDouble()));\r\n Assertions.assertEquals(val.hashCode(), Adouble.valueOf(val.toDouble()).hashCode());\r\n Assertions.assertTrue(val.isNumber());\r\n }", "public static interface DataTypeWithRatioScale<T> {\r\n \r\n /**\r\n * Add\r\n *\r\n * @param augend\r\n * @param addend\r\n * @return\r\n */\r\n public abstract T add(T augend, T addend);\r\n\r\n /**\r\n * Compare\r\n *\r\n * @param s1\r\n * @param s2\r\n * @return\r\n * @throws NumberFormatException\r\n * @throws ParseException\r\n */\r\n public abstract int compare(String s1, String s2) throws NumberFormatException,\r\n ParseException;\r\n\r\n /**\r\n * Compare\r\n *\r\n * @param t1\r\n * @param t2\r\n * @return\r\n */\r\n public abstract int compare(T t1, T t2);\r\n\r\n /**\r\n * Divide\r\n *\r\n * @param dividend\r\n * @param divisor\r\n * @return\r\n */\r\n public abstract String divide(String dividend, String divisor);\r\n \r\n /**\r\n * Divide\r\n *\r\n * @param dividend\r\n * @param divisor\r\n * @return\r\n */\r\n public abstract T divide(T dividend, T divisor);\r\n \r\n /**\r\n * Format\r\n *\r\n * @param t\r\n * @return\r\n */\r\n public abstract String format(T t);\r\n\r\n /**\r\n * Converts a double into a value.\r\n *\r\n * @param s\r\n * @return\r\n */\r\n public abstract T fromDouble(Double d);\r\n\r\n /**\r\n * Description\r\n *\r\n * @return\r\n */\r\n public abstract DataTypeDescription<T> getDescription();\r\n\r\n /**\r\n * Maximum\r\n *\r\n * @return\r\n */\r\n public T getMaximum();\r\n \r\n /**\r\n * Minimum\r\n *\r\n * @return\r\n */\r\n public T getMinimum();\r\n\r\n /**\r\n * Valid\r\n *\r\n * @param s\r\n * @return\r\n */\r\n public abstract boolean isValid(String s);\r\n\r\n /**\r\n * Multiply\r\n *\r\n * @param multiplicand\r\n * @param multiplicator\r\n * @return\r\n */\r\n public abstract String multiply(String multiplicand,\r\n String multiplicator);\r\n\r\n /**\r\n * Multiply\r\n *\r\n * @param multiplicand\r\n * @param multiplicator\r\n * @return\r\n */\r\n public abstract T multiply(T multiplicand, double multiplicator);\r\n\r\n /**\r\n * Multiply\r\n *\r\n * @param multiplicand\r\n * @param multiplicator\r\n * @return\r\n */\r\n public abstract T multiply(T multiplicand, int multiplicator);\r\n\r\n /**\r\n * Multiply\r\n *\r\n * @param multiplicand\r\n * @param multiplicator\r\n * @return\r\n */\r\n public abstract T multiply(T multiplicand, T multiplicator);\r\n \r\n /**\r\n * Parse\r\n *\r\n * @param s\r\n * @return\r\n */\r\n public abstract T parse(String s);\r\n\r\n /**\r\n * Divide\r\n *\r\n * @param dividend\r\n * @param divisor\r\n * @return\r\n */\r\n public abstract double ratio(T dividend, T divisor);\r\n \r\n /**\r\n * Subtract\r\n *\r\n * @param minuend\r\n * @param subtrahend\r\n * @return\r\n */\r\n public abstract T subtract(T minuend, T subtrahend);\r\n \r\n /**\r\n * Converts a double into a value.\r\n *\r\n * @param s\r\n * @return\r\n */\r\n public abstract Double toDouble(T t);\r\n }", "public abstract T fromDouble(Double d);", "public double getRealValue() {\n if (typeCase_ == 4) {\n return (java.lang.Double) type_;\n }\n return 0D;\n }", "Double getDoubleValue();", "double getRealValue();", "private double convertToDbl(Object a) {\n double result = 0;\n\n //If the object is a Character...\n if(a instanceof Character){\n char x = (Character)a;\n result = (double)(x - '0'); // -'0' as it will convert the ascii number (e.g 4 is 52 in ascii) to the standard number\n }\n\n //If it is a Double...\n else if(a instanceof Double){\n result = (Double)a;\n }\n\n return result;\n }", "public boolean isDouble() {\n return this.data instanceof Double;\n }", "public abstract double getasDouble(int tuple, int val);", "public boolean isDouble() {\n return false;\n }", "@Override\n public Double value(TypeOfValue value);", "public abstract double readAsDbl(int offset);", "double readDouble()\n throws IOException {\n return Double.longBitsToDouble( readLong() );\n }", "public abstract Double getDataValue();", "private static int m6082a(Class<?> cls) {\n if (cls == Double.TYPE) {\n return 1;\n }\n if (cls == Float.TYPE) {\n return 2;\n }\n if (cls == Long.TYPE) {\n return 3;\n }\n if (cls == Integer.TYPE) {\n return 4;\n }\n if (cls == Short.TYPE) {\n return 5;\n }\n if (cls == Character.TYPE) {\n return 6;\n }\n if (cls == Byte.TYPE) {\n return 7;\n }\n if (cls == Boolean.TYPE) {\n return 99;\n }\n return 8;\n }", "double getDoubleValue2();", "double readDouble();", "Double getValue();", "private static double getLongt() {\n\t\treturn longt;\n\t}", "public double getDouble();", "boolean hasDouble();", "public abstract void writeAsDbl(int offset, double d);", "public boolean realAsDouble() {\n return false;\n }", "public abstract Number getPrimitiveType();", "double getDoubleValue1();", "int getSimpleType() {\n\t\treturn ((type / 1000)) * 1000;\n\t}", "private double readDouble() throws IOException {\n\t\treturn (isBigEndian ? ioReadDouble() : Double.longBitsToDouble(readLELong()));\n\t}", "public static void main(String[] args){\n short num=100;\n int inum=num;\n long lnum=num;\n float fnum=num;\n double dnum=num;\n //When you assign value of one data type to another,\n // the two types might not be compatible with each other.\n // If the data types are compatible,\n // then Java will perform the conversion automatically known as Automatic Type Conversion and\n // if not then they need to be casted or converted explicitly.\n //this happens only when\n //The two data types are compatible.\n //When we assign value of a smaller data type to a bigger data type.(byte<short<int<long<float<double)\n //For Example, in java the numeric data types are compatible with each other\n // but no automatic conversion is supported from numeric type to char or boolean.\n // Also, char and boolean are not compatible with each other.\n System.out.println(\"num is \"+num);\n System.out.println(\"inum is \"+inum);\n System.out.println(\"lnum is \"+lnum);\n System.out.println(\"fnum is \"+fnum);\n System.out.println(\"dnum is \"+dnum);\n\n //Narrowing or Explicit conversion\n dnum=323.142;\n byte bnum=(byte)dnum;//converting bigger data type o smaller data type\n //so explicit conversion is needed\n System.out.println(\"dnum converted to bnum(byte) is \"+bnum);\n\n }", "public static double longToDouble(long l) {\n return (double) l;\n }", "public void testDoubleValue() {\n AtomicLong ai = new AtomicLong();\n assertEquals(0.0d, ai.doubleValue());\n for (long x : VALUES) {\n ai.set(x);\n assertEquals((double)x, ai.doubleValue());\n }\n }", "double getDoubleValue3();", "public static void main(String[] args) {\n // example of type casting\n // it will store the double and store it as an int.\n //by default, java will round down\n\n int a = (int) 0.5;\n System.out.println(a);\n //results will be 0\n\n\n //some primitive data types - byte, short, char, int, long, float, double\n\n // byte a;\n // short b;\n // char c;\n // int d;\n // long e;\n // float f;\n // double g;\n\n //if you were to use int and then store it to double, it will cast to double by default.\n\n //it will work its way down this primitive types data\n\n \n }", "public static void testOfDoubleNumberIsInteger(){\n\t\tSystem.out.println(\"please enter a double number: \");\n\t\tScanner scann=new Scanner(System.in);\n\t\tdouble x=scann.nextDouble();\n\t\tif(x%1==0)\n\t\t\tSystem.out.println(\"The number you have enterd it's not a double \");\n\t\telse\n\t\t\tSystem.out.println(\"The number you have entered it's double\");\n\t}", "private final double get_DOUBLE(int column) {\n if (metadata.isZos()) {\n byte[] bytes = new byte[8];\n dataBuffer_.getBytes(columnDataPosition_[column - 1], bytes);\n return FloatingPoint.getDouble_hex(bytes, 0);\n //return dataBuffer_.getDouble(columnDataPosition_[column - 1]);\n } else {\n return dataBuffer_.getDoubleLE(columnDataPosition_[column - 1]);\n// return FloatingPoint.getDouble(dataBuffer_,\n// columnDataPosition_[column - 1]);\n }\n }", "public static void main(String[] args) {\n\n Integer num1 = 100;\n double num2 = num1;\n System.out.println(num2);\n\n float f = 0.5f;\n Float fl = f;\n System.out.println(fl);\n\n System.out.println(Byte.MAX_VALUE);\n\n // parse method --> converting String value to primitives, returne primitive\n // valueOf --> converting String to Wrapper class, return Wrapper class\n\n String str1 = \"123\";\n int result = Integer.parseInt(str1);\n System.out.println(result+1);\n\n String str2 = \"true\";\n boolean r1 = Boolean.parseBoolean(str2);\n System.out.println(r1);\n\n // parse method not case sencetive\n String str3 = \"FaLse\"; // it is work\n boolean r2 = Boolean.parseBoolean(str3);\n System.out.println(r2);\n\n String s1 = \"100.5\";\n Double c1 = Double.parseDouble(s1);\n System.out.println(c1 + 1); // it is call auto boxing\n Double c2 = Double.valueOf(s1); // this in not auto and not unboxing\n\n System.out.println(c1);\n System.out.println(c2);\n\n String s2 = \"TrUe\";\n Boolean b1 = Boolean.valueOf(s2);\n System.out.println(b1); // no sensetive\n\n Double [] arr = new Double[3];\n System.out.println(Arrays.toString(arr));\n // default value of wrapper class always --> null, null, null\n\n String name = \"string\";\n String name1 = new String(\"string\");\n\n Integer I1 = new Integer(\"123\");\n\n System.out.println(addNum(12,13));\n System.out.println(addNum(15.3,7.4));\n \n }", "public interface Numeric extends DataType {\n}", "@ZenCodeType.Caster\n @ZenCodeType.Method\n default double asDouble() {\n \n return notSupportedCast(BasicTypeID.DOUBLE);\n }", "public native double __doubleMethod( long __swiftObject, double arg );", "int toInt (double val) {\n return (int)val;\n }", "public double castToDoubleValue() {\n throw new IteratorFlowException(\"Cannot call castToDouble on non numeric\");\n }", "@Test\n\tpublic void test_TCM__double_getDoubleValue() {\n\t\tAttribute attr = new Attribute(\"test\", \"11111111111111\");\n\t\ttry {\n\t\t\tassertTrue(\"incorrect double value\", attr.getDoubleValue() == 11111111111111d );\n\n\t\t\tattr.setValue(\"0\");\n\t\t\tassertTrue(\"incorrect double value\", attr.getDoubleValue() == 0 );\n\n\t\t\tattr.setValue(Double.toString(java.lang.Double.MAX_VALUE));\n\t\t\tassertTrue(\"incorrect double value\", attr.getDoubleValue() == java.lang.Double.MAX_VALUE);\n\n\t\t\tattr.setValue(Double.toString(java.lang.Double.MIN_VALUE));\n\t\t\tassertTrue(\"incorrect double value\", attr.getDoubleValue() == java.lang.Double.MIN_VALUE);\n\n\t\t} catch (DataConversionException e) {\n\t\t\tfail(\"couldn't convert boolean value\");\n\t\t}\n\n\t\ttry {\n\t\t\tattr.setValue(\"foo\");\n\t\t\tfail(\"incorrectly returned double from non double value\" + attr.getDoubleValue());\n\n\t\t} catch (DataConversionException e) {\n\t\t\t// Do nothing\n\t\t} catch (Exception e) {\n\t\t\tfail(\"Unexpected exception \" + e.getClass());\n\t\t}\n\n\t}", "public static void main(String[] args)\n {\n double x = 5.3;\n int y = (int)x;\n \n }", "private void ex04(){\n int number;\n number = 1;\n\n double number2;\n number2 = 1.5;\n\n String number3;\n number3 = \"3\";\n\n boolean bool = (number == 1);\n\n myWindow.clearOut();\n myWindow.writeOutLine(number);\n myWindow.writeOutLine(new String(String.valueOf(number))); //int to string\n myWindow.writeOutLine((double) number); //int to double\n myWindow.writeOutLine(bool); //int to boolean\n\n /*\n Java can perform number -> string\n method 1: numberType.toString\n method 2: String.valueOf(int/double/float) //used above in the code\n Java can also perform string -> number\n dataType.parseDatatype() // e.g.: Integer.parseInt()\n\n Java allows this only when the conversion is widening (small -> larger)\n alternatively reports a compile error if the conversion is narrowing\n */\n\n //YOUR CODE ABOVE HERE\n }", "public int getAxisType()\n {\n return DOUBLE;\n }", "private double convertDouble()\n\t{\n\t\tString val = tokens[10];\n\t\tdouble value = 0.0;\n\t\ttry {\n\t\t\tvalue = Double.parseDouble(tokens[10]);\n\t\t}\n\t\tcatch(NumberFormatException e) {\n\t\t\tSystem.err.print(\"\");\n\t\t}\n\t\treturn value;\n\t}", "public static void main(String[] args){\n long money = 500000; //not equal datatype, so implicit type casting\n long money1 = 500000L; //Recommendation\n\n System.out.println(money);\n System.out.println(money1);\n\n //JVM default float is double(8byte)\n //float pi = 3.141592; //compile error, incompatible types\n float PI = 3.141592f; // f or F\n double dd = 152.12331;\n System.out.println(PI);\n System.out.println(dd);\n }", "private Type get_value_type(long xx) {\n Type vt = _values.get(xx);\n assert vt!=null;\n return vt;\n }", "private static native boolean set_0(long nativeObj, int propId, double value);", "public static void main(String[] args) {\n\n\t\tSystem.out.println( \"Min value of Byte :\"+ Byte.MIN_VALUE); \n\t\tSystem.out.println( \"Max value of Byte :\"+ Byte.MAX_VALUE); \n\n\t\tSystem.out.println();\n\t\t\n\t\tSystem.out.println( \"Min value of Short :\"+ Short.MIN_VALUE); \n\t\tSystem.out.println( \"Max value of Short :\"+ Short.MAX_VALUE); \n\n\t\tSystem.out.println();\n\t\t\n\t\tSystem.out.println( \"Min value of Integer :\"+ Integer.MIN_VALUE); \n\t\tSystem.out.println( \"Max value of Integer :\"+ Integer.MAX_VALUE); \n\n\t\tSystem.out.println();\n\t\t\n\t\tSystem.out.println( \"Min value of Long :\"+ Long.MIN_VALUE); \n\t\tSystem.out.println( \"Max value of Long :\"+ Long.MAX_VALUE); \n\n\t\t// l should be at the end of value\n\t\tlong number1 = 9223372036854775807l;\n\t\tSystem.out.println( \"After adding l at end of the long number \" + number1);\n\t\t\n\t\tSystem.out.println();\n\t\t\n\t\t\n\t\t/* *\n\t\t * Decimal Data Types *\n\t\t * \t\t-----------------\t *\n\t\t *\t\t\t\t\t\t\t *\n\t\t*/\n\t\t\n\t\t// 1. float \t\t2. double\n\n\t\tSystem.out.println( \"Min value of float :\"+ Float.MIN_VALUE); \n\t\tSystem.out.println( \"Max value of float :\"+ Float.MAX_VALUE); \n\t\t\n\t\t// f should be at the end of value\n\t\tfloat decimal1 = 32245.12123f;\n\t\t\n\t\tSystem.out.println( \"After adding f at the end of the float\" + decimal1);\n\t\t\n\t\tSystem.out.println();\n\n\t\tSystem.out.println( \"Min value of double :\"+ Double.MIN_VALUE); \n\t\tSystem.out.println( \"Max value of double :\"+ Double.MAX_VALUE); \n\n\t\tSystem.out.println();\n\t\t\n\t\t\n\t\t\n\t\t/* *\n\t\t * Character Data Types *\n\t\t * \t --------------------\t *\n\t\t *\t\t\t\t\t\t\t *\n\t\t*/\n\t\t\n\t\t\n\t\t// 1. char \t\t\t2. String( int 2 bytes)\n\n\t\t// can only contain single letter\n\t\tchar ch = 'a'; \n\t\tSystem.out.println( \"Single character :\"+ ch);\n\t\t\n\t\t// can contain unicode values \n\t\tchar unicode = '\\u0000';\n\t\tSystem.out.println( \"Unicodes are stored but not shown :\"+ unicode);\n\t\t\n\t\t// are stored in int\n\t\tint num = 'a';\n\t\tSystem.out.println( \"character stored in int:\"+num);\n\t\t\n\t\tSystem.out.println();\n\t\t\n\n\t\tString str = \"Hello\" + \" World\";\n\t\tSystem.out.println(str);\n\n\t}", "public static void main(String[] args)\n {\n\n double myDouble = 3.14;\n float myFloat = 3.14f; //Removing the f will cause an error due to lossy conversion\n double yourDouble = myFloat; //Widening/lossless conversions won't raise errors\n }", "public abstract double GetRaw();", "public int getDataType()\n {\n return dtype;\n }", "public Double\n getDoubleValue() \n {\n return ((Double) getValue());\n }", "private Object getTypeObjectPair() throws MathLinkException, NumberRangeException {\n Object result = null;\n int type = this.getInteger();\n if (type % -17 == -15) {\n type = -7 + -17 * (type / -17);\n } else if (type % -17 == -16) {\n type = -8 + -17 * (type / -17);\n }\n switch (type) {\n case -5: {\n result = new Integer(this.getInteger());\n break;\n }\n case -6: {\n result = new Long(this.getLongInteger());\n break;\n }\n case -4: {\n int i = this.getInteger();\n if (i < -32768 || i > 32767) {\n throw new NumberRangeException(i, \"short\");\n }\n result = new Short((short)i);\n break;\n }\n case -2: {\n int i = this.getInteger();\n if (i < -128 || i > 127) {\n throw new NumberRangeException(i, \"byte\");\n }\n result = new Byte((byte)i);\n break;\n }\n case -3: {\n int i = this.getInteger();\n if (i < 0 || i > 65535) {\n throw new NumberRangeException(i, \"char\");\n }\n result = new Character((char)i);\n break;\n }\n case -15: \n case -7: {\n double d = this.getDouble();\n if (d < -3.4028234663852886E38 || d > 3.4028234663852886E38) {\n throw new NumberRangeException(d, \"float\");\n }\n result = new Float((float)d);\n break;\n }\n case -16: \n case -8: {\n result = new Double(this.getDouble());\n break;\n }\n case -9: {\n int tok = this.getType();\n if (tok == 100000) {\n result = this.getObject();\n break;\n }\n result = this.getString();\n if (tok != 35 || !result.equals(\"Null\")) break;\n result = null;\n break;\n }\n case -1: {\n String s = this.getSymbol();\n if (s.equals(\"True\")) {\n result = Boolean.TRUE;\n break;\n }\n result = Boolean.FALSE;\n break;\n }\n case -13: {\n long mark = this.createMark();\n try {\n int tok = this.getNext();\n if (tok == 100000) {\n result = this.getObject();\n break;\n }\n if (tok == 35) {\n result = this.getSymbol();\n if (result.equals(\"Null\")) {\n result = null;\n break;\n }\n this.seekMark(mark);\n result = this.getComplex();\n break;\n }\n this.seekMark(mark);\n result = this.getComplex();\n }\n finally {\n this.destroyMark(mark);\n }\n }\n case -10: {\n long mark = this.createMark();\n try {\n int tok = this.getType();\n if (tok == 100000) {\n result = this.getObject();\n break;\n }\n if (tok == 35) {\n result = this.getSymbol();\n if (result.equals(\"Null\")) {\n result = null;\n break;\n }\n result = new BigInteger((String)result);\n break;\n }\n result = new BigInteger(this.getString());\n }\n finally {\n this.destroyMark(mark);\n }\n }\n case -11: {\n long mark = this.createMark();\n try {\n int tok = this.getType();\n if (tok == 100000) {\n result = this.getObject();\n break;\n }\n if (tok == 35) {\n result = this.getSymbol();\n if (result.equals(\"Null\")) {\n result = null;\n break;\n }\n result = Utils.bigDecimalFromString((String)result);\n break;\n }\n result = Utils.bigDecimalFromString(this.getString());\n }\n finally {\n this.destroyMark(mark);\n }\n }\n case -12: {\n long mark = this.createMark();\n try {\n int tok = this.getNext();\n if (tok == 100000 && (result = this.getObject()) != null) break;\n this.seekMark(mark);\n result = this.getExpr();\n }\n finally {\n this.destroyMark(mark);\n }\n }\n case -14: {\n result = this.getObject();\n break;\n }\n case -10000: {\n break;\n }\n default: {\n int tok = this.getNext();\n result = tok == 100000 || tok == 35 ? this.getObject() : (type > -34 ? this.getArray(type - -17, 1) : (type > -51 ? this.getArray(type - -34, 2) : (type > -68 ? this.getArray(type - -51, 3) : (type > -85 ? this.getArray(type - -68, 4) : this.getArray(type - -85, 5)))));\n }\n }\n return result;\n }", "private static native double get_0(long nativeObj, int propId);", "public double doubleValue() {\r\n return (double) intValue();\r\n }", "public static void isValid(double dbl) throws IllegalArgumentException {\n\t//nothing to do here\n }", "public double asDouble() {\r\n\t\tif (this.what == SCALARTYPE.Integer || this.what == SCALARTYPE.Float) {\r\n\t\t\treturn (new BigDecimal(this.scalar)).doubleValue();\r\n\t\t} else\r\n\t\t\treturn 0; // ritorna un valore di default\r\n\t}", "public static void main(String[] args) {\n\t\tdouble d=10;\n\t\tSystem.out.println(d);\n\t\t\n\t\tint i=(int)10.99;\n\t\tSystem.out.println(i);\n\t\tbyte b=(byte)1243;\n\t\tSystem.out.println(b);\n\t\t\n\n\t}", "double getFloatingPointField();", "@Override\n public Type evaluateType() throws Exception {\n return new IntegerType();\n }", "public abstract double getValue();", "private boolean isNumber(Object o) {\n\t\tif(o instanceof String) return isNumber((String) o);\n\t\telse if(o instanceof Double) return true;\n\t\telse return false;\n\t}", "private static double m6088b(Object obj) {\n Method method = null;\n Object obj2 = obj;\n while (!(obj2 instanceof Number)) {\n if (obj2 instanceof String) {\n return ScriptRuntime.m6309a((String) obj2);\n }\n if (!(obj2 instanceof Scriptable)) {\n try {\n method = obj2.getClass().getMethod(\"doubleValue\");\n } catch (NoSuchMethodException | SecurityException e) {\n }\n if (method != null) {\n try {\n return ((Number) method.invoke(obj2)).doubleValue();\n } catch (IllegalAccessException e2) {\n m6091c(obj2, Double.TYPE);\n } catch (InvocationTargetException e3) {\n m6091c(obj2, Double.TYPE);\n }\n }\n return ScriptRuntime.m6309a(obj2.toString());\n } else if (!(obj2 instanceof Wrapper)) {\n return ScriptRuntime.m6395b(obj2);\n } else {\n obj2 = ((Wrapper) obj2).mo18879a();\n }\n }\n return ((Number) obj2).doubleValue();\n }", "void checkSameDataType(String datatype, String datatype1)\n {\n DefaultTableModel semanticerror = (DefaultTableModel)tblErrorSemantic.getModel();\n if(datatype.equals(datatype1))\n {\n\n }\n else if(datatype.equals(\"INT\") && datatype1.equals(\"FLOAT\"))\n {\n \n }\n else if(datatype.equals(\"FLOAT\") && datatype1.equals(\"INT\"))\n {\n \n }\n else if(datatype1 == null)\n {\n\n }\n else\n {\n semanticerror.addRow(new Object[] {tblLexeme.getModel().getValueAt(tokenPos-2, 0),\"Incompatible Types: \"+datatype1+\" Cannot be converted to \"+datatype, tblLexeme.getModel().getValueAt(tokenPos-2, 2)}); \n } \n datatype = null;\n }", "public long longValue() {\n\t\treturn (long) mDouble;\n\t}", "private void m2248a(double d, String str) {\n this.f2954c = d;\n this.f2955d = (long) d;\n this.f2953b = str;\n this.f2952a = ValueType.doubleValue;\n }", "@Override\n public String getDataType() {\n return getPrimitiveType().name();\n }", "@Override\n public double nextDouble() {\n return super.nextDouble();\n }", "public double getAsDouble(int index) {\n switch (type) {\n case TIFFTag.TIFF_BYTE: case TIFFTag.TIFF_UNDEFINED:\n return ((byte[])data)[index] & 0xff;\n case TIFFTag.TIFF_SBYTE:\n return ((byte[])data)[index];\n case TIFFTag.TIFF_SHORT:\n return ((char[])data)[index] & 0xffff;\n case TIFFTag.TIFF_SSHORT:\n return ((short[])data)[index];\n case TIFFTag.TIFF_SLONG:\n return ((int[])data)[index];\n case TIFFTag.TIFF_LONG: case TIFFTag.TIFF_IFD_POINTER:\n return ((long[])data)[index];\n case TIFFTag.TIFF_FLOAT:\n return ((float[])data)[index];\n case TIFFTag.TIFF_DOUBLE:\n return ((double[])data)[index];\n case TIFFTag.TIFF_SRATIONAL:\n int[] ivalue = getAsSRational(index);\n return (double)ivalue[0]/ivalue[1];\n case TIFFTag.TIFF_RATIONAL:\n long[] lvalue = getAsRational(index);\n return (double)lvalue[0]/lvalue[1];\n case TIFFTag.TIFF_ASCII:\n String s = ((String[])data)[index];\n return Double.parseDouble(s);\n default:\n throw new ClassCastException();\n }\n }", "@Ignore\n @Test(expected = IllegalArgumentException.class)\n public void require_that_illegal_double_throws_exception() throws IOException {\n Slime slime = new Slime();\n Cursor root = slime.setObject();\n root.setString(\"doubleval\", \"invalid\");\n InnerCNode def = new DefParser(\"simpletypes\", new StringReader(StringUtilities.implode(SimpletypesConfig.CONFIG_DEF_SCHEMA, \"\\n\"))).getTree();\n new ConfigFileFormat(def).encode(new ByteArrayOutputStream(), slime);\n }", "private double IntegerParseIn(double Precio) {\n throw new UnsupportedOperationException(\"Not supported yet.\"); //To change body of generated methods, choose Tools | Templates.\n }", "@java.lang.Override\n public long getLongValue() {\n if (typeCase_ == 3) {\n return (java.lang.Long) type_;\n }\n return 0L;\n }", "public abstract double[] getasDouble(int tuple);", "double getValue();", "double getValue();", "double getValue();", "public static double leerDouble() {\n\t\tthrow new UnsupportedOperationException();\n\t}", "public OCFloat(OCInteger lenType)\r\n {\r\n super(lenType);\r\n setLength(4);\r\n }", "void mo130799a(double d);", "public static double datodouble(){\n try {\n Double f=new Double(dato());\n return(f.doubleValue());\n } catch (NumberFormatException error) {\n return(Double.NaN);\n }\n }", "private TsPrimitiveType readOneValue() {\n switch (dataType) {\n case BOOLEAN:\n return new TsBoolean(valueDecoder.readBoolean(valueInputStream));\n case INT32:\n return new TsInt(valueDecoder.readInt(valueInputStream));\n case INT64:\n return new TsLong(valueDecoder.readLong(valueInputStream));\n case FLOAT:\n return new TsFloat(valueDecoder.readFloat(valueInputStream));\n case DOUBLE:\n return new TsDouble(valueDecoder.readDouble(valueInputStream));\n case TEXT:\n return new TsBinary(valueDecoder.readBinary(valueInputStream));\n default:\n break;\n }\n throw new UnSupportedDataTypeException(\"Unsupported data type :\" + dataType);\n }", "int getDataTypeValue();", "public static double isDouble() {\n\t\twhile (true) {\n\t\t\ttry {\n\t\t\t\treturn input.nextDouble();\n\t\t\t} catch (InputMismatchException e) {\n\t\t\t\tinput.next();\n\t\t\t\tSystem.out.println(\"Vas unos nije odgovarajuci. Probajte ponovo: \");\n\t\t\t}\n\t\t}\n\t}", "void writeDouble(double value);", "@Override\n\tpublic Type getType() {\n\t\treturn Type.FLOAT;\n\t}" ]
[ "0.66770065", "0.63548017", "0.6348221", "0.6342794", "0.6286748", "0.6286562", "0.62415045", "0.62285113", "0.6176737", "0.61717606", "0.60764956", "0.60742694", "0.6066293", "0.6032801", "0.60286814", "0.6025049", "0.601542", "0.5959509", "0.59377545", "0.59002924", "0.5898876", "0.58972657", "0.58942175", "0.58928376", "0.5890025", "0.5873796", "0.58692664", "0.58477724", "0.58214265", "0.5804629", "0.57761407", "0.57657284", "0.5718842", "0.5710443", "0.56878364", "0.568356", "0.5680416", "0.5666828", "0.56609714", "0.5641718", "0.5640917", "0.5633694", "0.5608703", "0.56061804", "0.56019515", "0.5595205", "0.5578014", "0.5568802", "0.5529873", "0.55279505", "0.5524837", "0.5515821", "0.5509604", "0.5501653", "0.5497232", "0.549532", "0.5495134", "0.5486931", "0.54703414", "0.5466086", "0.54644877", "0.54643434", "0.5463716", "0.54481673", "0.5445194", "0.5442178", "0.5441387", "0.5441341", "0.54276496", "0.54275256", "0.5420042", "0.5417336", "0.5409133", "0.54077333", "0.540576", "0.5402641", "0.5395491", "0.5382886", "0.5371896", "0.53703064", "0.53614116", "0.53531736", "0.5352584", "0.53459674", "0.53457373", "0.5343557", "0.5335971", "0.5335881", "0.5332064", "0.5320062", "0.5320062", "0.5320062", "0.5316006", "0.530932", "0.5305781", "0.530556", "0.53034633", "0.52949995", "0.5286672", "0.5277252", "0.5266497" ]
0.0
-1
A class representing an errors measure
public interface ErrorMeasure { /** * Measure the errors for the given output and target * @param output the output * @param example the example * @return the errors */ public abstract double value(Instance output, Instance example); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public float classError() { return _errors / (float) _rows; }", "@Override\n\tpublic void calculateError() {\n\t\t\n\t}", "public Vector2d getErrm() {\n return errm;\n }", "public double GetTimeError(){\n\t\treturn this.timeError;\n\t}", "public void setError(double error) {\r\n this.error = error;\r\n }", "@Override\n public double calculateError(final MLDataSet data) {\n\n switch (getSVMType()) {\n case SupportVectorClassification:\n case NewSupportVectorClassification:\n case SupportVectorOneClass:\n return EncogUtility.calculateClassificationError(this, data);\n case EpsilonSupportVectorRegression:\n case NewSupportVectorRegression:\n return EncogUtility.calculateRegressionError(this, data);\n default:\n return EncogUtility.calculateRegressionError(this, data);\n }\n\n\n }", "private static double calcError(Instances data, Instances data2) {\n\t\t// calculate the total l1 norm of the class values of the two data sets \n\t\tdouble error = 0;\n\t\tfor (int i=0; i < data.numInstances(); ++i) {\n\t\t\terror += Math.abs(data.instance(i).classValue() - data2.instance(i).classValue());\t\t\t\n\t\t}\n\t\treturn error;\n\t}", "public double computeError(double expected, double predicted);", "private double calculateErrors(Instance instance, Hashtable<NeuralNode, Double> nodeValues) throws Exception {\r\n\t\tdouble ret = 0;\r\n\t\t\r\n\t\t// calculate errors for the network\r\n\t\tfor (InputNode input : inputs) {\r\n\t\t\tinput.getError(instance, nodeValues);\r\n\t\t}\r\n\t\t\r\n\t\tfor (OutputNode output : outputs) {\r\n\t\t\tdouble error = output.getError(instance, nodeValues);\r\n\t\t\tret += error * error;\r\n\t\t}\r\n\t\treturn ret;\r\n\r\n\t}", "private void calculateError() {\n this.error = this.elementCount - this.strippedPartition.size64();\n }", "private double computeError(){\n double temp = 0;\r\n for(int trial_Number = 0; trial_Number < expectedOutputList.length; trial_Number++){\r\n for(int index = 0; index< expectedOutputList[trial_Number].length; index++){\r\n double difference = expectedOutputList[trial_Number][index] - this.getOutput()[index];\r\n double error = difference*difference;\r\n temp += error;\r\n }\r\n }\r\n return temp;\r\n }", "List<R> errors(int start, int end);", "public static void calError(Neuron x) {\r\n int error = x.getDesired() - x.getActual();\r\n x.setError(error);\r\n }", "public void error();", "java.lang.String getError();", "java.lang.String getError();", "java.lang.String getError();", "void calculateError(double targetValue) {\n this.error = this.getOutput()*(1-this.getOutput())*(this.getOutput()-targetValue);\n }", "public JUnitError[] getErrors() {\n return _errors;\n }", "public int getErrors() {\n return errors;\n }", "public int getErrors() {\n return errors;\n }", "void setError();", "private UnitsErrorStrings() {\n }", "WorldUps.UErr getError(int index);", "public String error();", "public Double getError (long time)\n {\n if (this.state == null)\n return null;\n\n return (this.state.getError());\n }", "public static float calculateErrorOnValidationSet(MultiLayerPerceptron mlp) {\n float error=0.0f;\n float errorOnJthSample;\n for(int j = 0; j < validationSet.getTests().size(); j++){\n ArrayList<Float> actualOutput = mlp.calculateOutput(trainingSet.getInput(j));\n ArrayList<Float> expectedOutput = trainingSet.getOutput(j);\n for(int k = 0; k < actualOutput.size();k++){\n errorOnJthSample= Math.abs(expectedOutput.get(k) - actualOutput.get(k));\n error+=errorOnJthSample*errorOnJthSample;\n }\n }\n return error;\n }", "public TemperaturaErradaExcepcion(){\r\n super(\"mensaxe por defecto:temperatura ten que ser naior que 80ºC\");//mensaxe por defecto\r\n }", "public boolean applyErrors() {\n\t\t/*\n\t\tdouble erreur = Math.random(); // on genere un nombre entre 0 et 1\n\t\tSystem.out.print(this.error*erreur + \"\\n\");\n\t\tif (erreur * this.error < 0.07) { // on multiplie l'erreur aleatoire par l'error de la sonde (qui sera aussi compris entre 0 et 1)\n\t\t\treturn true;\t\t\t\t// si l'erreur finle (produit des deux erreur) est inferieur a 20%\n\t\t}\n\t\treturn false;\n\t\t*/\n\t\treturn true;\n\t}", "private void err3() {\n\t\tString errMessage = CalculatorValue.checkMeasureValue(text_Operand3.getText());\n\t\tif (errMessage != \"\") {\n\t\t\t// System.out.println(errMessage);\n\t\t\tlabel_errOperand3.setText(CalculatorValue.measuredValueErrorMessage);\n\t\t\tif (CalculatorValue.measuredValueIndexofError <= -1)\n\t\t\t\treturn;\n\t\t\tString input = CalculatorValue.measuredValueInput;\n\t\t\toperand3ErrPart1.setText(input.substring(0, CalculatorValue.measuredValueIndexofError));\n\t\t\toperand3ErrPart2.setText(\"\\u21EB\");\n\t\t} else {\n\t\t\terrMessage = CalculatorValue.checkErrorTerm(text_Operand3.getText());\n\t\t\tif (errMessage != \"\") {\n\t\t\t\t// System.out.println(errMessage);\n\t\t\t\tlabel_errOperand3.setText(CalculatorValue.errorTermErrorMessage);\n\t\t\t\tString input = CalculatorValue.errorTermInput;\n\t\t\t\tif (CalculatorValue.errorTermIndexofError <= -1)\n\t\t\t\t\treturn;\n\t\t\t\toperand3ErrPart1.setText(input.substring(0, CalculatorValue.errorTermIndexofError));\n\t\t\t\toperand3ErrPart2.setText(\"\\u21EB\");\n\t\t\t}\n\t\t}\n\t}", "public Object getError() {\n return error;\n }", "public double getError(int dataCase){//target - outputOfNet\n\t\treturn data[dataCase][1][0] - outputs[1][0];\n\t}", "public void err2() {\n\t\tString errMessage = CalculatorValue.checkMeasureValue(text_Operand2.getText());\n\t\tif (errMessage != \"\") {\n\t\t\tlabel_errOperand2.setText(CalculatorValue.measuredValueErrorMessage);\n\t\t\tif (CalculatorValue.measuredValueIndexofError <= -1)\n\t\t\t\treturn;\n\t\t\tString input = CalculatorValue.measuredValueInput;\n\t\t\toperand2ErrPart1.setText(input.substring(0, CalculatorValue.measuredValueIndexofError));\n\t\t\toperand2ErrPart2.setText(\"\\u21EB\");\n\t\t}\n\t}", "public Object getError() {\n\t\treturn error;\n\t}", "abstract void error(String error);", "java.lang.String getErr();", "public int getErrorCounter() {\n return errorCounter;\n }", "public void setErrors(int err) {\n errors = err;\n }", "public double calculateError(MLMethod method, MLDataSet data) {\n\t\tif (this.dataset.getNormHelper().getOutputColumns().size() == 1) {\n\t\t\tColumnDefinition cd = this.dataset.getNormHelper()\n\t\t\t\t\t.getOutputColumns().get(0);\n\t\t\tif (cd.getDataType() == ColumnType.nominal) {\n\t\t\t\treturn EncogUtility.calculateClassificationError(\n\t\t\t\t\t\t(MLClassification) method, data);\n\t\t\t}\n\t\t}\n\n\t\treturn EncogUtility.calculateRegressionError((MLRegression) method,\n\t\t\t\tdata);\n\t}", "public Vector getErrors() {\n \t\tif (parser.hasErrors()) {\n \t\t\tsetError(parser.getErrors());\n \t\t}\n \t\tVector tmp = errors;\n \t\terrors = new Vector();\n \t\treturn tmp;\n \t}", "public Integer getErrorCnt() {\r\n return errorCnt;\r\n }", "public Paint getErrorIndicatorPaint() { return this.errorIndicatorPaint; }", "private void err4() {\n\t\tString errMessage = CalculatorValue.checkMeasureValue(text_Operand4.getText());\n\t\tif (errMessage != \"\") {\n\t\t\t// System.out.println(errMessage);\n\t\t\tlabel_errOperand4.setText(CalculatorValue.measuredValueErrorMessage);\n\t\t\tif (CalculatorValue.measuredValueIndexofError <= -1)\n\t\t\t\treturn;\n\t\t\tString input = CalculatorValue.measuredValueInput;\n\t\t\toperand4ErrPart1.setText(input.substring(0, CalculatorValue.measuredValueIndexofError));\n\t\t\toperand4ErrPart2.setText(\"\\u21EB\");\n\t\t} else {\n\t\t\terrMessage = CalculatorValue.checkErrorTerm(text_Operand4.getText());\n\t\t\tif (errMessage != \"\") {\n\t\t\t\t// System.out.println(errMessage);\n\t\t\t\tlabel_errOperand4.setText(CalculatorValue.errorTermErrorMessage);\n\t\t\t\tString input = CalculatorValue.errorTermInput;\n\t\t\t\tif (CalculatorValue.errorTermIndexofError <= -1)\n\t\t\t\t\treturn;\n\t\t\t\toperand4ErrPart1.setText(input.substring(0, CalculatorValue.errorTermIndexofError));\n\t\t\t\toperand4ErrPart2.setText(\"\\u21EB\");\n\t\t\t}\n\t\t}\n\t}", "private String errors() {\n\t\tStringBuilder sb = new StringBuilder();\n\t\tsb.append(impossibleLapTime());\n\t\tsb.append(multipleStartTimes());\n\t\treturn sb.toString();\n\t}", "public int error() {\n return this.error;\n }", "abstract void errorLogError(String error);", "public NumericMethodException(String msg, int code, double val) {\n super(msg);\n error_code = code;\n error_value = val;\n }", "private double calculateError(double[] outputsActual, double[] outputsTarget) {\n return Utilities.calculateError(outputsActual, outputsTarget);\n }", "public XyzError getError() {\n return this.error;\n }", "protected abstract void error(String err);", "public com.opentext.bn.converters.avro.entity.ErrorInfo getErrorInfo() {\n return errorInfo;\n }", "public Integer getNumError() {\n return numError;\n }", "int getErrorCount();", "public void setError(int value) {\n this.error = value;\n }", "public void Error(){\n }", "public synchronized double getError()\n {\n final String funcName = \"getError\";\n\n if (debugEnabled)\n {\n dbgTrace.traceEnter(funcName, TrcDbgTrace.TraceLevel.API);\n dbgTrace.traceExit(funcName, TrcDbgTrace.TraceLevel.API, \"=%f\", currError);\n }\n\n return currError;\n }", "public com.opentext.bn.converters.avro.entity.ErrorInfo getErrorInfo() {\n return errorInfo;\n }", "public void correctErrors();", "public abstract void setError(String message);", "public String getError() {\n\treturn mistake;\n }", "public double getError(double desiredHeading) {\n return desiredHeading - getHeading();\n }", "public int getError() {\n return error;\n }", "java.lang.String getErrorInfo();", "java.lang.String getErrorInfo();", "java.lang.String getErrorInfo();", "java.lang.String getErrorInfo();", "public Error getError() {\r\n\t\treturn error;\r\n\t}", "private void incrementErrors() {\n totalErrors++;\n totalTunitErrors++;\n }", "public String getMeasureResult() {\r\n return measureResult;\r\n }", "public Map getError() {\n return this.error;\n }", "public Long getErrorCount() {\n return this.errorCount;\n }", "public CErrors getErrors() {\n\treturn this.mErrors;\n}", "public void calculateError() {\n double sum = 0;\n\n for (ErrorNeuron neuron : frontNeurons) {\n sum += neuron.error * neuron.neuron.getWeights()[index];\n }\n\n error = neuron.getTransferFunction().derivative(neuron.getRawOutput()) * sum;\n }", "java.util.List<WorldUps.UErr> \n getErrorList();", "@Override\n\tpublic HashMap<String, String> getErrors() {\n\t\treturn errors;\n\t}", "public Collection<ErrorClass> getErrorCol() {\r\n\t\treturn values();\r\n\t}", "public void calculateError(double expected) {\n error = neuron.getTransferFunction().derivative(neuron.getRawOutput()) * (expected - neuron.getOutput());\n }", "public void calcError(double[] idealOutput){\n for (int i = 0; i < getNeuronCount(); i++) {\n setError(i, idealOutput[i] - fire[i]);\n setErrorDelta(i, bound(calculateDelta(i)));\n }\n\n }", "public TCodeRep getErr() {\n return err;\n }", "public CErrors getErrors() {\n\t\treturn mErrors;\n\t}", "public java.lang.String getErrDisc () {\r\n\t\treturn errDisc;\r\n\t}", "public void setErrorCnt(Integer errorCnt) {\r\n this.errorCnt = errorCnt;\r\n }", "@Override\r\n\tpublic void err(ServiceStatistics serviceStatistics) {\n\t\t\r\n\t}", "public CErrors getErrors() {\n\t\treturn this.mErrors;\n\t}", "public int getNumberOfErrors() {\n return errors;\n }", "public ManagementError error() {\n return this.error;\n }", "ExternalCompiler.ErrorExpression getErrorExpression () {\n return errorExpression;\n }", "public Double getUncertainty();", "Set<ISOAError> getErrors();", "public noNamespace.ErrordetectiondashletDocument.Errordetectiondashlet.Errors addNewErrors()\r\n {\r\n synchronized (monitor())\r\n {\r\n check_orphaned();\r\n noNamespace.ErrordetectiondashletDocument.Errordetectiondashlet.Errors target = null;\r\n target = (noNamespace.ErrordetectiondashletDocument.Errordetectiondashlet.Errors)get_store().add_element_user(ERRORS$4);\r\n return target;\r\n }\r\n }", "public noNamespace.ErrordetectiondashletDocument.Errordetectiondashlet.Errors getErrors()\r\n {\r\n synchronized (monitor())\r\n {\r\n check_orphaned();\r\n noNamespace.ErrordetectiondashletDocument.Errordetectiondashlet.Errors target = null;\r\n target = (noNamespace.ErrordetectiondashletDocument.Errordetectiondashlet.Errors)get_store().find_element_user(ERRORS$4, 0);\r\n if (target == null)\r\n {\r\n return null;\r\n }\r\n return target;\r\n }\r\n }", "@ErrorType\n public int getErrorType() {\n return mErrorType;\n }", "@Override\n\tpublic void error(String message, Object p0, Object p1) {\n\n\t}", "String getErrorsString();", "public abstract double getMeasure();", "@Override\n\tpublic void adjustToError() {\n\t\t\n\t}", "public Stroke getErrorIndicatorStroke() { return this.errorIndicatorStroke; }", "public double getLastError() {\n return lastError;\n }", "public static int getErrorTotal() {\n return errorCount;\n }", "public abstract double getMeasurement();" ]
[ "0.7177101", "0.682819", "0.61936736", "0.61186796", "0.6025344", "0.6012905", "0.5999309", "0.5932013", "0.58437645", "0.5809988", "0.57555985", "0.5746555", "0.57452935", "0.57204604", "0.5715733", "0.5715733", "0.5715733", "0.5714631", "0.5682489", "0.56036186", "0.56015", "0.5598885", "0.5597392", "0.55932057", "0.55896044", "0.55753255", "0.55694574", "0.5557607", "0.5534068", "0.55233026", "0.5519644", "0.5504645", "0.5499502", "0.5498113", "0.54970247", "0.5496911", "0.54925376", "0.549058", "0.5484498", "0.54757553", "0.54749656", "0.54664946", "0.5464694", "0.5461883", "0.54440624", "0.5419984", "0.53938377", "0.53923833", "0.53864914", "0.5380657", "0.53774184", "0.53718525", "0.53669894", "0.53664523", "0.53557247", "0.5340488", "0.5340477", "0.5338662", "0.5337595", "0.5337392", "0.533647", "0.5334174", "0.53281534", "0.53281534", "0.53281534", "0.53281534", "0.53273267", "0.5321798", "0.5321364", "0.5314772", "0.53142166", "0.53049225", "0.53030014", "0.530085", "0.53004766", "0.5300432", "0.5297127", "0.5295876", "0.52858526", "0.52855605", "0.5278807", "0.52585745", "0.52503127", "0.5226364", "0.5220979", "0.5218305", "0.52180994", "0.5216149", "0.5213622", "0.5209061", "0.5208918", "0.52071303", "0.52064556", "0.5201022", "0.5199748", "0.51944894", "0.51919883", "0.51899314", "0.5186794", "0.51790184" ]
0.7303486
0
Measure the errors for the given output and target
public abstract double value(Instance output, Instance example);
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private double calculateError(double[] outputsActual, double[] outputsTarget) {\n return Utilities.calculateError(outputsActual, outputsTarget);\n }", "void calculateError(double targetValue) {\n this.error = this.getOutput()*(1-this.getOutput())*(this.getOutput()-targetValue);\n }", "private double computeError(){\n double temp = 0;\r\n for(int trial_Number = 0; trial_Number < expectedOutputList.length; trial_Number++){\r\n for(int index = 0; index< expectedOutputList[trial_Number].length; index++){\r\n double difference = expectedOutputList[trial_Number][index] - this.getOutput()[index];\r\n double error = difference*difference;\r\n temp += error;\r\n }\r\n }\r\n return temp;\r\n }", "public interface ErrorMeasure {\r\n\r\n /**\r\n * Measure the errors for the given output and target\r\n * @param output the output\r\n * @param example the example\r\n * @return the errors\r\n */\r\n public abstract double value(Instance output, Instance example);\r\n\r\n}", "public double computeError(double expected, double predicted);", "public double getError(int dataCase){//target - outputOfNet\n\t\treturn data[dataCase][1][0] - outputs[1][0];\n\t}", "public void calcError(double[] idealOutput){\n for (int i = 0; i < getNeuronCount(); i++) {\n setError(i, idealOutput[i] - fire[i]);\n setErrorDelta(i, bound(calculateDelta(i)));\n }\n\n }", "public static float calculateErrorOnValidationSet(MultiLayerPerceptron mlp) {\n float error=0.0f;\n float errorOnJthSample;\n for(int j = 0; j < validationSet.getTests().size(); j++){\n ArrayList<Float> actualOutput = mlp.calculateOutput(trainingSet.getInput(j));\n ArrayList<Float> expectedOutput = trainingSet.getOutput(j);\n for(int k = 0; k < actualOutput.size();k++){\n errorOnJthSample= Math.abs(expectedOutput.get(k) - actualOutput.get(k));\n error+=errorOnJthSample*errorOnJthSample;\n }\n }\n return error;\n }", "@Override\n\tpublic void calculateError() {\n\t\t\n\t}", "private double calculateErrors(Instance instance, Hashtable<NeuralNode, Double> nodeValues) throws Exception {\r\n\t\tdouble ret = 0;\r\n\t\t\r\n\t\t// calculate errors for the network\r\n\t\tfor (InputNode input : inputs) {\r\n\t\t\tinput.getError(instance, nodeValues);\r\n\t\t}\r\n\t\t\r\n\t\tfor (OutputNode output : outputs) {\r\n\t\t\tdouble error = output.getError(instance, nodeValues);\r\n\t\t\tret += error * error;\r\n\t\t}\r\n\t\treturn ret;\r\n\r\n\t}", "public void calculateError(double expected) {\n error = neuron.getTransferFunction().derivative(neuron.getRawOutput()) * (expected - neuron.getOutput());\n }", "@Test\n public void localAction_stderrIsReported() throws Exception {\n if (OS.getCurrent() == OS.WINDOWS) {\n return;\n }\n write(\n \"BUILD\",\n \"genrule(\",\n \" name = 'foo',\",\n \" srcs = [],\",\n \" outs = ['out/foo.txt'],\",\n \" cmd = 'echo my-error-message > $@',\",\n \")\",\n \"genrule(\",\n \" name = 'foobar',\",\n \" srcs = [':foo'],\",\n \" outs = ['out/foobar.txt'],\",\n \" cmd = 'cat $(location :foo) >&2 && exit 1',\",\n \" tags = ['no-remote'],\",\n \")\");\n RecordingOutErr outErr = new RecordingOutErr();\n this.outErr = outErr;\n\n assertThrows(BuildFailedException.class, () -> buildTarget(\"//:foobar\"));\n\n assertOutputContains(outErr.errAsLatin1(), \"my-error-message\");\n }", "@Test\n public void testSingleErrorDetecting() {\n final int[] msgWithError = {0,0,1,0, 1,0,1,1, 1,0,1,0, 1,1,1,0};\n final int expectedErrorIndex = 10;\n\n // When executing error detection\n final int errorIndex = HammingAlgorithm.calculateErrorIndex(msgWithError);\n\n // Then check if errorIndex is as expected\n assertThat(errorIndex).isEqualTo(expectedErrorIndex);\n }", "public void collectAndVerifyTarget() {\n System.out.println(\"Enter the total no of targets that needs to be achieved\");\n Scanner sc = new Scanner(System.in);\n int tCount = sc.nextInt();\n for (int i = 0; i < tCount; i++) {\n System.out.println(\"Enter the value of target \");\n double d = sc.nextDouble();\n double aTarget = 0;\n for (int j = 0; j < tranCount; j++) {\n aTarget = aTarget + transactions[j];\n if (aTarget >= d) {\n System.out.println(\"Target achieved after \" + (j + 1) + \" transactions \\n\");\n break;\n }\n }\n if (aTarget < d) {\n System.out.println(\"Given target is not achieved\");\n }\n }\n }", "public static void calError(Neuron x) {\r\n int error = x.getDesired() - x.getActual();\r\n x.setError(error);\r\n }", "@Test\n public void testDoubleErrorDetecting() {\n final int[] msgWithError = {0,0,1,0, 1,0,1,1, 1,0,1,1, 1,1,1,0};\n final int expectedErrorIndex = ResponseCode.TWO_ERRORS.code;\n\n // When executing error detection\n final int errorIndex = HammingAlgorithm.calculateErrorIndex(msgWithError);\n\n // Then check if errorIndex is as expected\n assertThat(errorIndex).isEqualTo(expectedErrorIndex);\n }", "private void incrementErrors() {\n totalErrors++;\n totalTunitErrors++;\n }", "private void checkRuntimeFail(String filename, int... input){\n\t\tString inputString = createInput(input);\n\t\t\n\t\tProgram prog;\n\t\tSimulator sim = null;\n\t\tMachine vm = null;\n\t\tPipedInputStream in = null;\n\t\ttry {\n\t\t\tprog = compiler.compile(new File(BASE_DIR, filename + EXT));\n\t\t\tvm = new Machine();\n\t\t\tsim = new Simulator(prog, vm);\n\t\t\tvm.clear();\n\t\t\tsim.setIn(new ByteArrayInputStream(inputString.getBytes()));\n\t\t\tin = new PipedInputStream();\n\t\t\tOutputStream out;\n\t\t\tout = new PipedOutputStream(in);\n\t\t\tsim.setOut(out);\n\t\t} catch (ParseException e) {fail(filename + \" did not generate\");\n\t\t} catch (IOException e) {\tfail(filename + \" did not generate\");}\n\t\t\n\t\ttry{\n\t\t\tsim.run();\n\t\t\tString output = \"\";\n\t\t\tint max = in.available();\n\t\t\tfor(int index = 0; index < max; index++)\n\t\t\t\toutput += (char)in.read();\n\t\t\t/** Check whether there was an error outputted. */\n\t\t\tif(!output.toLowerCase().contains(\"error: \"))\n\t\t\t\tfail(filename + \" shouldn't check but did\");\n\t\t} catch (Exception e) {\n\t\t\t// this is the expected behaviour\n\t\t}\n\t}", "public static double validate(Network validationNetwork, int start, int end, boolean printResult){\n double ETotal=0;\n String results=\"\";\n for (int i = start; i < end; i++) {\n ArrayList<Double> outputs = validationNetwork.runNetwork(data.getFeatures().get(i));\n //print outputs\n int output= outputs.indexOf(Collections.max(outputs))+1;\n results+= output+\", \";\n\n int target = data.getTargets().get(i);\n double[] targetlist = new double[7];\n targetlist[target - 1] = 1;\n double[] errorlist = new double[7];\n double totalerror = 0;\n for (int j = 0; j < 7; j++) {\n double outputvalue = outputs.get(j);\n double error = targetlist[j] - outputvalue;\n totalerror += error * error;\n\n }\n //Update weights of network\n ETotal += totalerror / 7;\n //MSElist.add(totalerror / 7);\n }\n if (printResult)\n System.out.println(results);\n\n return ETotal / (end-start);\n\n\n\n }", "public boolean applyErrors() {\n\t\t/*\n\t\tdouble erreur = Math.random(); // on genere un nombre entre 0 et 1\n\t\tSystem.out.print(this.error*erreur + \"\\n\");\n\t\tif (erreur * this.error < 0.07) { // on multiplie l'erreur aleatoire par l'error de la sonde (qui sera aussi compris entre 0 et 1)\n\t\t\treturn true;\t\t\t\t// si l'erreur finle (produit des deux erreur) est inferieur a 20%\n\t\t}\n\t\treturn false;\n\t\t*/\n\t\treturn true;\n\t}", "@Test(timeout = 4000)\n public void test111() throws Throwable {\n TextDirectoryLoader textDirectoryLoader0 = new TextDirectoryLoader();\n Instances instances0 = textDirectoryLoader0.getDataSet();\n Evaluation evaluation0 = new Evaluation(instances0);\n evaluation0.relativeAbsoluteError();\n assertEquals(Double.NaN, evaluation0.meanPriorAbsoluteError(), 0.01);\n assertEquals(0.0, evaluation0.SFEntropyGain(), 0.01);\n assertEquals(Double.NaN, evaluation0.meanAbsoluteError(), 0.01);\n }", "public void printError(int epoch, ArrayList<LSTMSequence> seqsArray, boolean isTrain) {\n\n int numSeqs;\n String what = \"\";\n String pre = \"\";\n float fnp = 1.0f;\n\n if (isTrain) {\n numSeqs = numSeqsTrain;\n what = \"training\";\n pre = \"\";\n rankMean = compRankMean(rankTrain, numSeqs);\n compAUC(rankTrain, rankTrainSorted, numSeqs);\n } else {\n numSeqs = numSeqsTest;\n what = \"test\";\n pre = \"TEST: \";\n rankMean = compRankMean(rankTest, numSeqs);\n compAUC(rankTest, rankTestSorted, numSeqs);\n //cr.computeAUC(roclist, numpostest, numnegtest, rocn);\n }\n\n int countTop1 = 0;\n int countTop5 = 0;\n int[] ranks;\n\n if (isTrain) {\n ranks = rankTrain;\n } else {\n ranks = rankTest;\n }\n\n for (int i = 0; i < numSeqs; i++) {\n if (ranks[i] > 1) {\n countTop1++;\n }\n if (ranks[i] > 5) {\n countTop5++;\n }\n }\n\n float top1Error = countTop1 / (float) numSeqs * 100.0f;\n float top5Error = countTop5 / (float) numSeqs * 100.0f;\n float[] crossEntropyErrors = (isTrain) ? crossEntropyErrorsTrain : crossEntropyErrorsTest;\n float min = Integer.MAX_VALUE;\n float max = Integer.MIN_VALUE;\n float sumCEE = 0;\n\n for (int i = 0; i < numSeqs; i++) {\n float crossEntropyError = crossEntropyErrors[i];\n min = Math.min(crossEntropyError, min);\n max = Math.max(crossEntropyError, max);\n sumCEE += crossEntropyError;\n }\n\n float crossEntropyErrorMean = sumCEE / numSeqs;\n int[] labels = new int[numSeqs];\n\n for (int seqNr = 0; seqNr < numSeqs; seqNr++) {\n LSTMSequence seq = seqsArray.get(seqNr);\n float[] seqTargets = seq.getTargets();\n for (int j = 0; j < seqTargets.length; j++) {\n if (seqTargets[j] == 1.0) labels[seqNr] = j + 1;\n }\n }\n\n\t\t/*\n float auc = cr.getAuc();\n float aucn = cr.getAucn();\n\t\t */\n\n fnp = (float) falseneg / (float) numSeqs;\n //float fpp = (numneg != 0) ? (float) falsepos / (float) numneg : 0;\n float mse = epochError / (1.0f * numSeqs);\n\n BufferedWriter out = null;\n\n try {\n\n out = new BufferedWriter(new FileWriter(\"out.txt\", true));\n\n out.write(\"epoch: \" + epoch);\n out.newLine();\n out.write(pre + \"MSE \");\n out.write(new DecimalFormat(\"#.######\").format(mse));\n out.newLine();\n\n out.write(pre + \"errors:\");\n out.write(falseneg + \" (out of \" + numSeqs + \" \" + what + \" examples) \");\n out.write(new DecimalFormat(\"#0.0\").format(fnp * 100) + \"%\");\n out.newLine();\n\n out.write(pre + \"Top 1 Error: \");\n out.write(new DecimalFormat(\"#0.00\").format(top1Error));\n out.newLine();\n out.write(pre + \"Top 5 Error: \");\n out.write(new DecimalFormat(\"#0.00\").format(top5Error));\n out.newLine();\n\n out.write(pre + \"Crossentropy Loss: \");\n out.write(new DecimalFormat(\"#0.00\").format(crossEntropyErrorMean));\n out.newLine();\n\n\t\t\t/*\n out.write(pre + \"false-positive:\");\n out.write(falsepos + \" (out of \" + numneg + \" negative \" + what + \" examples) \");\n out.write(new DecimalFormat(\"#0.0\").format(fpp * 100) + \"%\");\n out.newLine();\n\t\t\t */\n out.write(pre + \"ROC \");\n out.write(new DecimalFormat(\"#0.000\").format(aucVal));\n out.newLine();\n out.write(pre + \"ROC\" + rocn + \" \");\n out.write(new DecimalFormat(\"#0.000\").format(aucNVal));\n out.newLine();\n\n if (!isTrain) {\n out.write(pre + \"Ranks: \");\n for (int i = 0; i < this.numSeqsTest; i++) {\n out.write(this.rankTest[i] + \" \");\n }\n out.newLine();\n out.write(pre + \"CEL: \");\n for (int i = 0; i < this.numSeqsTest; i++) {\n out.write(this.crossEntropyErrorsTest[i] + \" \");\n }\n out.newLine();\n out.write(pre + \"Label: \");\n for (int i = 0; i < this.numSeqsTest; i++) {\n out.write(labels[i] + \" \");\n }\n out.newLine();\n } else {\n out.write(\"Ranks: \");\n for (int i = 0; i < this.numSeqsTrain; i++) {\n out.write(this.rankTrain[i] + \" \");\n }\n out.newLine();\n out.write(\"CEL: \");\n for (int i = 0; i < this.numSeqsTrain; i++) {\n out.write(this.crossEntropyErrorsTrain[i] + \" \");\n }\n out.newLine();\n out.write(\"Label: \");\n for (int i = 0; i < this.numSeqsTrain; i++) {\n out.write(labels[i] + \" \");\n }\n out.newLine();\n }\n out.write(pre + \"Rank mean: \" + new DecimalFormat(\"#0.00\").format(rankMean));\n out.newLine();\n out.newLine();\n out.close();\n\n } catch (IOException e) {\n System.err.println(e);\n } finally {\n try {\n if (out != null) out.close();\n } catch (IOException e) {\n }\n }\n\n System.out.println(\"Thread: \" + threadNr);\n System.out.println(\"epoch: \" + epoch);\n System.out.printf(\"%sMSE:%f\\n\", pre, mse);\n System.out.printf(\"%serrors:%d (out of %d %s examples) %.1f%%\\n\", pre, falseneg, numSeqs, what, fnp * 100);\n\n System.out.print(pre + \"Top 1 Error: \");\n System.out.print(new DecimalFormat(\"#0.00\").format(top1Error));\n System.out.println();\n System.out.print(pre + \"Top 5 Error: \");\n System.out.print(new DecimalFormat(\"#0.00\").format(top5Error));\n System.out.println();\n\n\t\t/*\n System.out.printf(\"%sfalse-positive:%d (out of %d negative %s examples) %.1f%%\\n\", pre, falsepos, numneg, what, fpp * 100);\n\t\t */\n System.out.printf(\"%sROC %.3f\\n\", pre, aucVal);\n System.out.printf(\"%sROC\" + rocn + \" %.3f\\n\", pre, aucNVal);\n\n\n if (!isTrain) {\n System.out.print(\"Ranks: \");\n for (int i = 0; i < this.numSeqsTest; i++) {\n System.out.print(this.rankTest[i] + \" \");\n }\n System.out.println();\n }\n System.out.printf(pre + \"Rank mean: %.2f\", rankMean);\n System.out.println();\n\n }", "@Override\r\n\tprotected double evaluate(IChromosome a_subject) {\r\n\t\tint errors = 0;\r\n\r\n\t\tGene[] genes = a_subject.getGenes();\r\n\t\tfor (int i = 0; i < genes.length; i++) {\r\n\t\t\tString allele = (String) genes[i].getAllele();\r\n\t\t\tint diff = Math.abs((int) allele.charAt(0) - (int) this.target.charAt(i));\r\n\t\t\terrors += diff * diff;\r\n\t\t}\r\n\r\n\t\treturn errors;\r\n\t}", "private void calculateError() {\n this.error = this.elementCount - this.strippedPartition.size64();\n }", "void calculateError(List<Neuron> connectedNeurons) {\n double weightedErrorSum = 0.0;\n Iterator<Neuron> iter = connectedNeurons.iterator();\n while(iter.hasNext()) {\n Neuron neuron = iter.next();\n weightedErrorSum += neuron.error * neuron.output;\n }\n this.error = this.getOutput()*(1-this.getOutput())*weightedErrorSum;\n }", "@Test\n public void dynamicExecution_stderrIsReported() throws Exception {\n if (OS.getCurrent() == OS.WINDOWS) {\n return;\n }\n addOptions(\"--internal_spawn_scheduler\");\n addOptions(\"--strategy=Genrule=dynamic\");\n addOptions(\"--experimental_local_execution_delay=9999999\");\n write(\n \"BUILD\",\n \"genrule(\",\n \" name = 'foo',\",\n \" srcs = [],\",\n \" outs = ['out/foo.txt'],\",\n \" cmd = 'echo my-error-message > $@',\",\n \" tags = ['no-local'],\",\n \")\",\n \"genrule(\",\n \" name = 'foobar',\",\n \" srcs = [':foo'],\",\n \" outs = ['out/foobar.txt'],\",\n \" cmd = 'cat $(location :foo) >&2 && exit 1',\",\n \")\");\n RecordingOutErr outErr = new RecordingOutErr();\n this.outErr = outErr;\n\n assertThrows(BuildFailedException.class, () -> buildTarget(\"//:foobar\"));\n\n assertOutputContains(outErr.errAsLatin1(), \"my-error-message\");\n }", "private void checkRuntime(String filename, int[] input, int[] output) throws ParseException, IOException{\t\t\n\t\t\n\t\tString inputString = createInput(input);\n\t\t\n\t\tProgram prog = compiler.compile(new File(BASE_DIR, filename + EXT));\n\t\tMachine vm = new Machine();\n\t\tSimulator sim = new Simulator(prog, vm);\n\t\tvm.clear();\n\t\tsim.setIn(new ByteArrayInputStream(inputString.getBytes()));\n\t\tPipedInputStream in = new PipedInputStream();\n\t\tOutputStream out;\n\t\tout = new PipedOutputStream(in);\n\t\tsim.setOut(out);\n\t\tsim.run();\n\t\t\n\t\tString outputString = \"\";\n\t\tfor(int index = 0; index < output.length; index++)\n\t\t\toutputString += \"Output: \" + output[index] + \"\\r\\n\";\n\n\t\tassertEquals(outputString.length(), in.available());\n\t\tint max = in.available();\n\t\tfor(int index = 0; index < max; index++)\n\t\t\tassertEquals(outputString.charAt(index), (char)in.read());\n\t\t\n\t\tout.close();\n\t\tin.close();\n\t}", "public void calculateError() {\n double sum = 0;\n\n for (ErrorNeuron neuron : frontNeurons) {\n sum += neuron.error * neuron.neuron.getWeights()[index];\n }\n\n error = neuron.getTransferFunction().derivative(neuron.getRawOutput()) * sum;\n }", "protected double trainingReport(List<Example> examples, int stepnum, int nsteps) {\n\t\tdouble acc = squaredErrorPerSample(examples);\n\t\t//System.out.println(stepnum + \"\\t\" + acc);\n\t\treturn acc;\n\t}", "@Override\n public void onError(SpeedTestError speedTestError, String errorMessage) {\n }", "private static double calcError(Instances data, Instances data2) {\n\t\t// calculate the total l1 norm of the class values of the two data sets \n\t\tdouble error = 0;\n\t\tfor (int i=0; i < data.numInstances(); ++i) {\n\t\t\terror += Math.abs(data.instance(i).classValue() - data2.instance(i).classValue());\t\t\t\n\t\t}\n\t\treturn error;\n\t}", "public void onTestFailedButWithinSuccessPercentage(ITestResult arg0) {\n\n }", "private void analyzeData(){\n input1 = ihd1.getOutput();\n input2 = ihd2.getOutput();\n\n output1 = (input1 > IHD_limit);\n output2 = (input2 > IHD_limit);\n }", "public void onTestFailedButWithinSuccessPercentage(ITestResult arg0) {\n\t\t\r\n\t}", "public void onTestFailedButWithinSuccessPercentage(ITestResult arg0) {\n\t\t\r\n\t}", "@Override\n public double calculateError(final MLDataSet data) {\n\n switch (getSVMType()) {\n case SupportVectorClassification:\n case NewSupportVectorClassification:\n case SupportVectorOneClass:\n return EncogUtility.calculateClassificationError(this, data);\n case EpsilonSupportVectorRegression:\n case NewSupportVectorRegression:\n return EncogUtility.calculateRegressionError(this, data);\n default:\n return EncogUtility.calculateRegressionError(this, data);\n }\n\n\n }", "private boolean printError(\n String message, ActionAnalysisMetadata action, @Nullable FileOutErr actionOutput) {\n message = action.describe() + \" failed: \" + message;\n return dumpRecordedOutErr(\n reporter, Event.error(action.getOwner().getLocation(), message), actionOutput);\n }", "public void onTestFailedButWithinSuccessPercentage(ITestResult arg0) {\n\t\n}", "public void onTestFailedButWithinSuccessPercentage(ITestResult result) {\n\t\tSystem.out.println(\"*********Test onTestFailedButWithinSuccessPercentage :\"+result.getName());\r\n\t}", "public void onTestFailedButWithinSuccessPercentage(ITestResult arg0) {\n\t\t\n\t}", "public void onTestFailedButWithinSuccessPercentage(ITestResult arg0) {\n\t\t\n\t}", "public void onTestFailedButWithinSuccessPercentage(ITestResult arg0) {\n\n\t}", "public void onTestFailedButWithinSuccessPercentage(ITestResult arg0) {\n\n\t}", "public void onTestFailedButWithinSuccessPercentage(ITestResult result) {\n\t\t\r\n\t}", "public void onTestFailedButWithinSuccessPercentage(ITestResult result) {\n\t\t\r\n\t}", "public void onTestFailedButWithinSuccessPercentage(ITestResult result) {\n\t\t\r\n\t}", "@Override\n\tpublic void onTestFailedButWithinSuccessPercentage(ITestResult arg0) {\n\t\tSystem.out.println(\"on failed but within success percentage\");\n\t\t\n\t}", "public abstract void useOutput(double output);", "public abstract void useOutput(double output);", "private void updateOutputLayerErrors(Vector errorVector) {\r\n\t\tList<Neuron> neurons = getNetwork().getOutputLayer().getNeurons();\r\n\t\tfor (int i = 0; i < neurons.size(); i++) {\r\n\t\t\tNeuron neuron = neurons.get(i);\r\n\t\t\tdouble outputError = errorVector.get(i);\r\n\t\t\tupdateOutputLayerErrors(outputError, neuron);\r\n\t\t}\r\n\t}", "@Test(timeout = 4000)\n public void test120() throws Throwable {\n TextDirectoryLoader textDirectoryLoader0 = new TextDirectoryLoader();\n Instances instances0 = textDirectoryLoader0.getStructure();\n Evaluation evaluation0 = new Evaluation(instances0);\n double double0 = evaluation0.pctIncorrect();\n assertEquals(Double.NaN, double0, 0.01);\n assertEquals(0.0, evaluation0.SFPriorEntropy(), 0.01);\n }", "@Override\n\t\tpublic void onTestFailedButWithinSuccessPercentage(ITestResult result) {\n\t\t\t\n\t\t}", "public void soaktest() {\n\t\ttry {\n\t\t\tint errCount = 0;\n\n\t\t\tfor (int i = 1; i <= 100; i++) {\n\t\t\t\tRegression test = new Regression();\n\t\t\t\ttest0();\n\t\t\t\ttest.test1(m1);\n\t\t\t\ttest.test2(m1);\n\t\t\t\ttest.test3(m1);\n\t\t\t\ttest.test4(m1);\n\t\t\t\ttest.test5(m1);\n\t\t\t\ttest.test6(m1);\n\t\t\t\ttest.test7(m1, m2);\n\t\t\t\ttest.test8(m1);\n\t\t\t\ttest.test9(m2);\n\t\t\t\ttest.test10(m3);\n\t\t\t\ttest.test11(m1, m2);\n\t\t\t\ttest.test12(m1);\n\t\t\t\ttest.test13(m1);\n\t\t\t\ttest.test14(m1);\n\t\t\t\ttest.test15(m1);\n\t\t\t\ttest.test16(m1);\n\t\t\t\ttest.test17(m1);\n\t\t\t\ttest.test18(m4);\n\t\t\t\ttest.test19(m2, m3);\n\t\t\t\ttest.test97(m1);\n\t\t\t\tif (test.getErrors())\n\t\t\t\t\terrCount++;\n\t\t\t\tif ((i % 10) == 0) {\n\t\t\t\t\tSystem.out.println(\n\t\t\t\t\t\t\"error count = \" + errCount + \" rounds = \" + i);\n\t\t\t\t}\n\t\t\t}\n\t\t} catch (Exception e) {\n\t\t\tSystem.out.println(e);\n\t\t\tassertTrue(false);\n\t\t}\n\t}", "public float classError() { return _errors / (float) _rows; }", "@Ignore\n @Test\n public void run_RL() {\n String configfile = \"C:\\\\Users\\\\gomes\\\\Desktop\\\\traffic_master\\\\n_Capstone_0426_9000.xml\";\n\n float duration = 3600f;\n float outdt = 300f;\n\n // Load ..............................\n api.OTM otm = null;\n\n try {\n otm = new api.OTM(configfile);\n\n// // Output requests .....................\n// List<Long> list_orig_link_ids = otm.scenario.get_link_ids();\n// otm.output.request_links_flow(null, list_orig_link_ids, outdt);\n// otm.output.request_links_veh(null, list_orig_link_ids, outdt);\n//\n// List<Long> ramp_ids = new ArrayList<>();\n// for(ActuatorInfo act_info : otm.scenario.get_actuators())\n// ramp_ids.add(act_info.target.getId());\n\n// ControllerCapacity controller = (ControllerCapacity) otm.scenario.get_actual_controller_with_id(1);\n\n // Qtable loop\n\n double[] sum_vehicles = new double[6];\n double[] sum_flow = new double[6];\n\n// for( int i=0 ; i<6 ; i++){\n//\n// // update control\n// for(Long ramp_id : ramp_ids) {\n// float rate_ramp = i*300f;\n// controller.set_rate_vph_for_actuator(ramp_id, rate_ramp);\n// }\n//\n// System.out.println(\"i=\" + i);\n//\n// otm.run(0,duration);\n//\n// // extract output .........................\n// sum_vehicles[i] = 0d;\n// sum_flow[i] = 0d;\n//\n// for(AbstractOutput output : otm.output.get_data()){\n//\n// if (output instanceof LinkFlow){\n//\n// for(Long link_id : list_orig_link_ids) {\n// Profile1D profile = ((LinkFlow) output).get_flow_profile_for_link_in_vph(link_id);\n// List<Double> values = profile.get_values();\n// // System.out.println(String.format(\"LinkFlow: id=%d num_values=%d\",link_id,values.size()));\n//\n// sum_flow[i] += values.stream().mapToDouble(x->x).sum();\n// }\n// }\n//\n//\n// if (output instanceof LinkVehicles) {\n// for(Long link_id : list_orig_link_ids) {\n// Profile1D profile = ((LinkVehicles) output).get_profile_for_linkid(link_id);\n// List<Double> values = profile.get_values();\n// // System.out.println(String.format(\"LinkVehicles: id=%d num_values=%d\",link_id,values.size()));\n//\n// sum_vehicles[i] += values.stream().mapToDouble(x->x).sum();\n// }\n// }\n//\n// }\n//\n// System.out.println(i + \"\\t\" + sum_flow[i] + \"\\t\" + sum_vehicles[i]);\n//\n// // do some Qtable calculation\n\n\n\n// }\n } catch (OTMException e) {\n e.printStackTrace();\n }\n\n }", "private void verifyAnalyzeOutput(String query, String message) throws Exception {\n List<QueryDataBatch>result = testRunAndReturn(QueryType.SQL, query);\n List<List<String>> output = new ArrayList<>();\n assertTrue(result.size() == 1);\n final QueryDataBatch batch = result.get(0);\n final RecordBatchLoader loader = new RecordBatchLoader(getDrillbitContext().getAllocator());\n loader.load(batch.getHeader().getDef(), batch.getData());\n output.add(new ArrayList<String>());\n for (VectorWrapper<?> vw: loader) {\n ValueVector.Accessor accessor = vw.getValueVector().getAccessor();\n Object o = accessor.getObject(0);\n output.get(0).add(o == null ? null: o.toString());\n }\n batch.release();\n loader.clear();\n assertTrue(output.get(0).size() == 2);\n assertEquals(message, output.get(0).get(1));\n }", "public void onTestFailedButWithinSuccessPercentage(ITestResult result) {\n\t\t\n\t}", "public void onTestFailedButWithinSuccessPercentage(ITestResult result) {\n\t\t\n\t}", "public void onTestFailedButWithinSuccessPercentage(ITestResult result) {\n\t\t\n\t}", "public void onTestFailedButWithinSuccessPercentage(ITestResult result) {\n\t\t\n\t}", "public void onTestFailedButWithinSuccessPercentage(ITestResult result) {\n\t\t\n\t}", "void recordExecutionError() {\n hadExecutionError = true;\n }", "public void correctErrors();", "@Override\r\n\tpublic void onTestFailedButWithinSuccessPercentage(ITestResult arg0) {\n\t\t\r\n\t}", "@Override\r\n\tpublic void onTestFailedButWithinSuccessPercentage(ITestResult arg0) {\n\t\t\r\n\t}", "@Override\r\n\tpublic void onTestFailedButWithinSuccessPercentage(ITestResult arg0) {\n\t\t\r\n\t}", "@Override\r\n\tpublic void onTestFailedButWithinSuccessPercentage(ITestResult result) {\n\t\t\r\n\t}", "@Override\r\n\tpublic void onTestFailedButWithinSuccessPercentage(ITestResult result) {\n\t\t\r\n\t}", "@Override\r\n\tpublic void onTestFailedButWithinSuccessPercentage(ITestResult result) {\n\t\t\r\n\t}", "@Override\r\n\tpublic void onTestFailedButWithinSuccessPercentage(ITestResult result) {\n\t\t\r\n\t}", "private double[] outputDifferences(double[] n) throws Exception {\n\t\tif (n.length != this.expectedOutputs.length) throw new Exception(\"ERROR: Training data incompatible with network (expected size: \" + n.length + \", got: \" + this.expectedOutputs.length + \")\");\n\t\telse {\n\t\t\tdouble[] dif = new double[n.length];\n\t\t\t\n\t\t\tfor (int i = 0; i < n.length; i ++) {\n\t\t\t\tdif[i] = this.expectedOutputs[i] - n[i];\n\t\t\t}\n\t\t\t\n\t\t\treturn dif;\n\t\t}\n\t}", "@Override\n\tpublic void onTestFailedButWithinSuccessPercentage(ITestResult arg0) {\n\t\t\n\t}", "public abstract int calculateOutput();", "@Override\n\tpublic void onTestFailedButWithinSuccessPercentage(ITestResult arg0) {\n\n\t}", "@Override\n\tpublic void onTestFailedButWithinSuccessPercentage(ITestResult arg0) {\n\n\t}", "public void err2() {\n\t\tString errMessage = CalculatorValue.checkMeasureValue(text_Operand2.getText());\n\t\tif (errMessage != \"\") {\n\t\t\tlabel_errOperand2.setText(CalculatorValue.measuredValueErrorMessage);\n\t\t\tif (CalculatorValue.measuredValueIndexofError <= -1)\n\t\t\t\treturn;\n\t\t\tString input = CalculatorValue.measuredValueInput;\n\t\t\toperand2ErrPart1.setText(input.substring(0, CalculatorValue.measuredValueIndexofError));\n\t\t\toperand2ErrPart2.setText(\"\\u21EB\");\n\t\t}\n\t}", "public void validate(Object target, Errors errors) {\n\t }", "public void calculateOutputs()\n {\n numberOfOutputs = outputs.size();\n }", "@Override\n\tpublic void onTestFailedButWithinSuccessPercentage(ITestResult result) {\n\t\t\n\t}", "@Override\n\tpublic void onTestFailedButWithinSuccessPercentage(ITestResult result) {\n\t\t\n\t}", "@Override\n\tpublic void onTestFailedButWithinSuccessPercentage(ITestResult result) {\n\t\t\n\t}", "@Override\n\tpublic void onTestFailedButWithinSuccessPercentage(ITestResult result) {\n\t\t\n\t}", "@Override\n\tpublic void onTestFailedButWithinSuccessPercentage(ITestResult result) {\n\t\t\n\t}", "@Override\n\tpublic void onTestFailedButWithinSuccessPercentage(ITestResult result) {\n\t\t\n\t}", "@Override\n\tpublic void onTestFailedButWithinSuccessPercentage(ITestResult result) {\n\t\t\n\t}", "private void err4() {\n\t\tString errMessage = CalculatorValue.checkMeasureValue(text_Operand4.getText());\n\t\tif (errMessage != \"\") {\n\t\t\t// System.out.println(errMessage);\n\t\t\tlabel_errOperand4.setText(CalculatorValue.measuredValueErrorMessage);\n\t\t\tif (CalculatorValue.measuredValueIndexofError <= -1)\n\t\t\t\treturn;\n\t\t\tString input = CalculatorValue.measuredValueInput;\n\t\t\toperand4ErrPart1.setText(input.substring(0, CalculatorValue.measuredValueIndexofError));\n\t\t\toperand4ErrPart2.setText(\"\\u21EB\");\n\t\t} else {\n\t\t\terrMessage = CalculatorValue.checkErrorTerm(text_Operand4.getText());\n\t\t\tif (errMessage != \"\") {\n\t\t\t\t// System.out.println(errMessage);\n\t\t\t\tlabel_errOperand4.setText(CalculatorValue.errorTermErrorMessage);\n\t\t\t\tString input = CalculatorValue.errorTermInput;\n\t\t\t\tif (CalculatorValue.errorTermIndexofError <= -1)\n\t\t\t\t\treturn;\n\t\t\t\toperand4ErrPart1.setText(input.substring(0, CalculatorValue.errorTermIndexofError));\n\t\t\t\toperand4ErrPart2.setText(\"\\u21EB\");\n\t\t\t}\n\t\t}\n\t}", "private void err3() {\n\t\tString errMessage = CalculatorValue.checkMeasureValue(text_Operand3.getText());\n\t\tif (errMessage != \"\") {\n\t\t\t// System.out.println(errMessage);\n\t\t\tlabel_errOperand3.setText(CalculatorValue.measuredValueErrorMessage);\n\t\t\tif (CalculatorValue.measuredValueIndexofError <= -1)\n\t\t\t\treturn;\n\t\t\tString input = CalculatorValue.measuredValueInput;\n\t\t\toperand3ErrPart1.setText(input.substring(0, CalculatorValue.measuredValueIndexofError));\n\t\t\toperand3ErrPart2.setText(\"\\u21EB\");\n\t\t} else {\n\t\t\terrMessage = CalculatorValue.checkErrorTerm(text_Operand3.getText());\n\t\t\tif (errMessage != \"\") {\n\t\t\t\t// System.out.println(errMessage);\n\t\t\t\tlabel_errOperand3.setText(CalculatorValue.errorTermErrorMessage);\n\t\t\t\tString input = CalculatorValue.errorTermInput;\n\t\t\t\tif (CalculatorValue.errorTermIndexofError <= -1)\n\t\t\t\t\treturn;\n\t\t\t\toperand3ErrPart1.setText(input.substring(0, CalculatorValue.errorTermIndexofError));\n\t\t\t\toperand3ErrPart2.setText(\"\\u21EB\");\n\t\t\t}\n\t\t}\n\t}", "@Override\n public void onTestFailedButWithinSuccessPercentage(ITestResult result) {\n\n }", "@Override\n public void onTestFailedButWithinSuccessPercentage(ITestResult result) {\n\n }", "@Override\n\tpublic void onTestFailedButWithinSuccessPercentage(ITestResult result) {\n\t}", "@Test\n public void test21() throws Throwable {\n TextDirectoryLoader textDirectoryLoader0 = new TextDirectoryLoader();\n Instances instances0 = textDirectoryLoader0.getDataSet();\n Evaluation evaluation0 = new Evaluation(instances0);\n double double0 = evaluation0.errorRate();\n assertEquals(Double.NaN, double0, 0.01D);\n assertEquals(0.0, evaluation0.SFPriorEntropy(), 0.01D);\n }", "int maxOffsetErrors(int parametricState);", "@Override\n\tpublic void onTestFailedButWithinSuccessPercentage(ITestResult result) {\n\n\t}", "void completedOutput(TestResult tr, Section section, String outputName);", "public void onTestFailedButWithinSuccessPercentage(ITestResult result) {\n\t\tlogger.info(\"onTestFailedButWithinSuccessPercentage \" + result.getName());\n\t}", "@Override\r\n\tpublic void onTestFailedButWithinSuccessPercentage(ITestResult Result) {\n\t\t\r\n\t}", "@Override\r\n\tpublic void err(ServiceStatistics serviceStatistics) {\n\t\t\r\n\t}", "@Test\n\t/**\n\t * Testing the arrays.\n\t * Testing:\n\t * - A correct sample program.\n\t * - A sample program containing spelling and context free errors.\n\t * - A sample program containing context errors.\n\t * - A sample program containing runtime errors.\n\t * \n\t * @throws ParseException\n\t * @throws IOException\n\t */\n\tpublic void arrayTest() throws ParseException, IOException{\n\t\tint[] input = {};\n\t\tint[] output = {0, -1, -1, -1, -1};\n\t\tcheckRuntime(\"arrayCorrect\", input, output);\n\t\t\n\t\t/** Check whether a program contains syntax errors. */\n\t\tcheckFail(\"arraySpellingContextFreeSyntaxError\");\n\t\t\n\t\t/** Check whether a program contains the given errors. */\n\t\tSet<String> errors = new HashSet<String>();\n\t\terrors.add(\"Line 8:16 - Expected type 'Array [0..4] of Integer' but found 'Integer'\");\n\t\terrors.add(\"Line 11:26 - Expected type 'Integer' but found 'Boolean'\");\n\t\terrors.add(\"Line 14:36 - Expected type 'Integer' but found 'Array [0..4] of Integer'\");\n\t\terrors.add(\"Line 16:10 - Expected type 'Integer' but found 'Array [0..4] of Integer'\");\n\t\terrors.add(\"Line 16:34 - Expected type 'Integer' but found 'Array [0..4] of Integer'\");\n\t\terrors.add(\"Line 21:7 - Expected type 'Integer' but found 'Array [0..4] of Integer'\");\n\t\terrors.add(\"Line 21:38 - Expected type 'Integer' but found 'Array [0..4] of Integer'\");\n\t\terrors.add(\"Line 22:7 - Expected type 'Integer' but found 'Array [0..4] of Integer'\");\t\n\t\terrors.add(\"Line 22:38 - Expected type 'Integer' but found 'Array [0..4] of Integer'\");\t\t\n\t\terrors.add(\"Line 23:7 - Expected type 'Integer' but found 'Array [0..4] of Integer'\");\n\t\terrors.add(\"Line 23:31 - Expected type 'Integer' but found 'Array [0..4] of Integer'\");\n\t\terrors.add(\"Line 25:19 - Expected type 'Integer' but found 'Char'\");\n\t\terrors.add(\"Line 26:19 - Expected type 'Integer' but found 'Boolean'\");\n\t\tcheckContextFail(\"arrayContextError\", errors);\n\t\t\n\t\t/** Check whether a program gives a runtime error. */\n\t\tcheckRuntimeFail(\"arrayRuntimeError\");\n\t}", "public static double sanityCheck(Match match)\n {\n Lane lane;\n Role role;\n \n int bot = 0;\n int bottom = 0;\n int jungle = 0;\n int mid = 0;\n int middle = 0;\n int top = 0;\n \n int solo = 0;\n int duo = 0;\n int duo_carry = 0;\n int duo_support = 0;\n int none = 0;\n \n\n \n for(int i = 0; i<10; i++)\n {\n lane = match.getParticipants().get(i).getTimeline().getLane();\n role = match.getParticipants().get(i).getTimeline().getRole();\n \n switch(lane)\n {\n case BOT:\n bot++;\n break;\n \n case BOTTOM:\n bottom++;\n break;\n \n case JUNGLE:\n jungle++;\n break;\n \n case MID:\n mid++;\n break;\n \n case MIDDLE:\n middle++;\n break;\n \n case TOP:\n top++;\n break;\n }\n \n switch(role)\n {\n case SOLO:\n solo++;\n break;\n \n case DUO:\n duo++;\n break;\n \n case DUO_CARRY:\n duo_carry++;\n break;\n \n case DUO_SUPPORT:\n duo_support++;\n break;\n \n case NONE:\n none++;\n break;\n }\n }\n \n double total = 0;\n \n if(top == 2)\n total++;\n if(mid+middle == 2)\n total++;\n if(jungle == 2)\n total++;\n if(bot + bottom == 4)\n total++;\n \n if(solo == 4)\n total++;\n if(duo + duo_carry + duo_support == 4);\n total++;\n if( duo_carry == 2);\n total++;\n if(duo_support == 2)\n total++;\n if(none == 2)\n total++;\n \n //it would be total =/ 9 but I figured every time one is wrong it makes another wrong, but there's really only 1 error \n total = ((total/18.0)+.5);\n \n \n //TestPrints\n //System.out.println(\"Sanity Check:\\nTop: \"+ top + \"\\nJungle: \"+ jungle + \"\\nMid: \" + (mid+middle) + \"\\nBot: \" + (bot+bottom)+ \"\\n\\nSolo: \"+solo + \"\\nDuo: \" + (duo+duo_carry+duo_support)\n //+ \"\\n\\\"Bot\\\": \"+ duo+\"\\nADC: \"+ duo_carry+ \"\\nSupport: \"+duo_support+ \"\\nNone: \" + none + \"\\nTotal Score: \" +total);\n \n \n \n return total;\n \n }", "public void testNgFailedToTestFailedConverter(String suiteName, String testName, String xmlOutputFileName, String reporterClass ) throws IOException {\n \t\t// DECLARATION:\n\t\t\t\tString sourceFileName = \"testng-failed.xml\";\n \t\t\n \t // PRE-CLEAN:\n \t if (fileExist(System.getProperty(\"user.dir\"), xmlOutputFileName, false)) { fileCleaner(System.getProperty(\"user.dir\"), xmlOutputFileName);}\n \t\n \t // READER-WRITER: \t\t\n \t\t String[] string = addReporterClassToTestNgXmlLinesArray(sourceFileName, reporterClass); // READS TESTNG XML\n \t\t for (String s : string) { fileWriter(System.getProperty(\"user.dir\"), xmlOutputFileName, s); }\n \t\n \t // OPTIONAL FAILURES NUMBER OUTPUT:\n \t\t int failed = 0;\n \t\t for (int i = 0; i < string.length; i++) {\n\t\t\t\t if ( string[i].contains(\"<include name=\\\"\") ) { failed++; }\n\t\t\t }\n \t\t \n \t\t// UPDATE FAILED TEST NUMBER AS PER FAILED:\n \t\tif (fileExist(\"failed.num\", false)){\n \t\t\tfileCleaner(\"failed.num\");\n \t\t\tfileWriter(\"failed.num\", failed);\n \t\t}\n \t\t\n \t\t if (fileExist(\"test.num\", false)) {\n \t\t \tif (Integer.valueOf(fileScanner(\"test.num\")) == 1 ) {\n \t\t\t if (failed > 0) { fileWriterPrinter(\"FAILED...\"); } else { fileWriterPrinter(\"PASSED!\"); }\n \t\t\t } \t\t\t\n \t\t\tif (Integer.valueOf(fileScanner(\"test.num\")) > 1 ) {\n \t\t\t if (failed > 0) {\n \t\t\t\t if (failed == Integer.valueOf(fileScanner(\"test.num\")) ) { fileWriterPrinter(\"ALL FAILED...\"); }\n \t\t\t\t else { fileWriterPrinter(\"FAILED \" + failed + \" OF \" + Integer.valueOf(fileScanner(\"test.num\"))); }\n \t\t\t }\n \t\t\t if (failed == 0) { fileWriterPrinter(\"ALL PASSED!\"); }\n \t\t\t }\t\t\t\n \t\t\t} \t\t\n }", "@Test(timeout = 4000)\n public void test18() throws Throwable {\n Discretize discretize0 = new Discretize();\n discretize0.findNumBinsTipText();\n // Undeclared exception!\n try { \n discretize0.output();\n fail(\"Expecting exception: NullPointerException\");\n \n } catch(NullPointerException e) {\n //\n // No output instance format defined\n //\n verifyException(\"weka.filters.Filter\", e);\n }\n }" ]
[ "0.7420077", "0.7071636", "0.6450394", "0.6367062", "0.6270678", "0.62261796", "0.61231124", "0.60578036", "0.5793913", "0.5775103", "0.5773539", "0.56207645", "0.55438197", "0.5452589", "0.54461837", "0.54455954", "0.54202354", "0.5409499", "0.5402611", "0.539818", "0.53922004", "0.5381852", "0.53450865", "0.5338109", "0.5315985", "0.52682555", "0.5243065", "0.52388394", "0.5227509", "0.520453", "0.5182798", "0.51608706", "0.51506793", "0.514778", "0.514778", "0.5133119", "0.513287", "0.5117834", "0.5114941", "0.51144964", "0.51144964", "0.51064265", "0.51064265", "0.5104147", "0.5104147", "0.5104147", "0.5098512", "0.5080238", "0.5080238", "0.5070495", "0.50698197", "0.5068901", "0.50677204", "0.5065402", "0.5056917", "0.50429547", "0.5037791", "0.5037791", "0.5037791", "0.5037791", "0.5037791", "0.503363", "0.503352", "0.50228256", "0.50228256", "0.50228256", "0.49925968", "0.49925968", "0.49925968", "0.49925968", "0.4992265", "0.4989619", "0.49879804", "0.49665526", "0.49665526", "0.4966023", "0.4964025", "0.49626645", "0.49589306", "0.49589306", "0.49589306", "0.49589306", "0.49589306", "0.49589306", "0.49589306", "0.49566537", "0.49503508", "0.4949829", "0.4949829", "0.494779", "0.49335948", "0.49330264", "0.49182555", "0.49066207", "0.49052185", "0.49048966", "0.48872384", "0.48780584", "0.48672545", "0.48625496", "0.4854754" ]
0.0
-1
/ renamed from: com.ss.avframework.livestreamv2.InputAudioStream$Observer
public interface Observer { void releaseInputStream(InputAudioStream inputAudioStream); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public interface AudioPlayListener {\n\n\n /**\n * 播放\n * @param url 音频url 包括网络url,本地路径,raw资源文件\n */\n void play(String url,OnAudioPlayListener onAudioPlayListener);\n\n /**\n * 暂停\n */\n void pause();\n\n /**\n * 开始\n */\n void start();\n\n /**\n * 重新播放\n */\n void restart();\n\n\n boolean isPlaying();\n\n\n /**\n * 获取音频时长\n * @return\n */\n long getDuration();\n\n /**\n * 仅仅获取音频时长,由于获取是时长是异步操作,通过回调方式回去\n * @param sourceUrl 音频文件url或者本地路径\n *\n *note 只支持单个音频文件,如果要支持列表多个音频文件,是从服务器端返回总时长\n **/\n void getOnlyDuration(String sourceUrl,OnAudioPlayListener2 listener);\n\n\n /**\n * 释放播放器\n */\n void release();\n\n /**\n * 获取播放的位置\n */\n long getCurrentPosition();\n\n /**\n * 设置循环播放\n * @param isLoop\n */\n void setLooping(boolean isLoop);\n}", "public interface IAudioMediaPlayerListener {\n void onLoadAudioDone(int duration);\n void onLoadAudioError();\n void onLoadAudioBuffering(int percent);\n}", "void mo23491a(MediaSourceEventListener mediaSourceEventListener);", "public void onAudioInfoChanged(PlaybackInfo info) {\n }", "void mo23488a(Handler handler, MediaSourceEventListener mediaSourceEventListener);", "public interface IPitchListener {\n void onPitchdetected(double freq);\n}", "@Override\n public void onTrackChange(final RadioStream.TrackInfo trackInfo) {\n }", "public interface SKListenerMux extends MediaPlayer.OnPreparedListener,\n MediaPlayer.OnCompletionListener, MediaPlayer.OnErrorListener,\n MediaPlayer.OnBufferingUpdateListener, MediaPlayer.OnSeekCompleteListener,\n MediaPlayer.OnInfoListener {\n}", "public interface AudioReceiveFrameCallback {\n AudioReceiveFrameCallback IGNORE = new AudioReceiveFrameCallback() {\n @Override\n public void receiveAudioFrame(int friendNumber, @NotNull short[] pcm, int channels, int samplingRate) {\n }\n };\n\n /**\n * @param friendNumber The friend number of the friend who sent an audio frame.\n * @param pcm An array of audio samples (sample_count * channels elements).\n * @param channels Number of audio channels.\n * @param samplingRate Sampling rate used in this frame.\n */\n void receiveAudioFrame(int friendNumber, @NotNull short[] pcm, int channels, int samplingRate);\n}", "public interface OnMediaPlayingListener {\n /**\n * duration for the media file\n * @param duration milliseconds\n */\n void onStart(int duration);\n\n void onComplete();\n\n /**\n * media play progress\n * @param currentPosition milliseconds\n */\n void onProgress(int currentPosition);\n}", "public interface AudioDecoder {\n\n\t/**\n\t * Reads in samples from the decoder and fills the array passed as parameter\n\t * with the values read (It tries to read as many samples from the stream as\n\t * there are elements in the array passed in). Returns the actual number\n\t * read in. If this number is smaller than samples.length then the end of\n\t * stream has been reached. Note: In the present version, it averages from\n\t * all the channels into a single channel.\n\t * \n\t * @param samples\n\t * The array to which it will write the samples read.\n\t * \n\t * \n\t * @return The number of read samples.\n\t */\n\tpublic int readSamples(float[] samples);\n\t\n\tpublic int readSamples(Float[] samples);\n\t\n\t/**\n\t * Gets the sample rate of the audio to be decoded\n\t * @return the sample rate\n\t */\n\tpublic float getSampleRate();\n\n}", "public interface SoundTrackListener {\r\n\r\n\t/**\r\n\t * Called when a soundtrack has completed the whole track.\r\n\t */\r\n\tpublic void finished();\r\n}", "public interface ListenerMusicUrl {\n /**\n * Fonction lance lors de la recuperation de l'url d'un stream de musique\n * @param url : url du stream\n */\n void onResultMusicUrl(String url);\n}", "public DataSource getAudioSource();", "public interface StreamListener {\n\n default void onNextEntry(CorfuStreamEntries results) {\n onNext(results);\n }\n\n /**\n * A corfu update can/may have multiple updates belonging to different streams.\n * This callback will return those updates as a list grouped by their Stream UUIDs.\n *\n * Note: there is no order guarantee within the transaction boundaries.\n *\n * @param results is a map of stream UUID -> list of entries of this stream.\n */\n void onNext(CorfuStreamEntries results);\n\n /**\n * Callback to indicate that an error or exception has occurred while streaming or that the stream is\n * shutting down. Some exceptions can be handled by restarting the stream (TrimmedException) while\n * some errors (SystemUnavailableError) are unrecoverable.\n * @param throwable\n */\n void onError(Throwable throwable);\n}", "public interface OnPlayStateChangeListener {\n\n void onPlayStateChange(int playState);\n}", "private void playSilence(){\n frameIterator = SilentMediaReader.getInstance();\n updateCurrentMedia(null);\n status = Status.PLAYING_SILENCE;\n for (StreamListener listener : streamListeners) {\n listener.mediaChanged();\n }\n }", "String registerObserver(StreamObserver observer);", "public interface Audio {\r\n\r\n\t//******************************GETS*****************************\r\n//\tpublic FileOutputStream getAudioByBitRate(String bitrate);\r\n\t/**\r\n\t * If the file was uploaded in a rate of 128 kbits/s then streaming at 320 kbits/s provides no benefits.\r\n\t * This method allows the client to check what bitrates exist and choose the adequate one.\t\r\n\t * @return String with all the BitRates accessible.\r\n\t */\r\n\tpublic ArrayList<Integer> getAccessibleBitRates();\r\n\t/**\r\n\t * Returns a Stream with the Audio in the default BitRate.\r\n\t * @return Audio stream.\r\n\t */\r\n//\tpublic FileOutputStream getAudio();\r\n\t/**\r\n\t * Evaluates if the Bitrate \"bitrate\" is allowed for audio and returns a Stream if it is.\r\n\t * @param bitrate \r\n\t * @return FileOutputStream\r\n\t */\r\n//\tpublic FileOutputStream getAudioByBitRate(int bitrate);\r\n\tpublic String getDir();\r\n\tpublic String getFileName();\r\n\t//******************************ACTIONS*****************************\r\n\t/**\r\n\t * Sets the bitRate for the value that comes as parameter.\r\n\t * @return\r\n\t */\r\n\tpublic boolean setDefaultBitRate(String bitrate);\r\n\t/**\r\n\t * Converts the Audio to the default system type, mp3. \r\n\t * @return The type of the file. If it failed returns a null String.\r\n\t */\r\n\tpublic boolean convertAudioTypeToDefault();\r\n\tboolean convertAudioTypeToDefault(String dir, long size,\r\n\t\t\tint defaultBitRate, String type);\r\n\tpublic boolean setAudioType(String type);\r\n\tpublic void setMaxBitRate(String bitRate);\r\n\tpublic Response download(String appId, String audioId, String dir);\r\n\tpublic void setDir(String dir);\r\n\tpublic void setSize(long size);\r\n\tpublic void setCreationDate(String creationDate);\r\n\tpublic void setFileName(String fileName);\r\n\tpublic void setLocation(String location);\r\n}", "public interface IPlayerListener {\n\n public void onError(String message);\n public void onBufferingStarted();\n public void onBufferingFinished();\n public void onRendereingstarted();\n void onCompletion();\n\n}", "interface NowPlayingListener\n{\n\tpublic void nowPlayingSongSet(NowPlayingEvent ev);\n\tpublic void nowPlayingSongCleared(NowPlayingEvent ev);\n}", "public interface AudioSink {\n /**\n * comfort default functionality to see if the player currently is available (not playing\n * anything)\n *\n * @return true if AudioState.Stopped, false otherwise\n */\n default boolean isAvailable() {\n switch (getState()) {\n case STOPPED:\n return true;\n case STARTING:\n return false;\n case STARTED:\n return false;\n case STOPPING:\n return false;\n default:\n throw new IllegalStateException(\"The speaker state is in an unknown state\");\n }\n }\n\n /** sets the AudioState to Stopped */\n default void free() {\n setState(Audio.AudioState.STOPPED);\n }\n\n Audio.Connection getConnection();\n\n void setConnection(Audio.Connection connection);\n\n Audio.AudioState getState();\n\n void setState(Audio.AudioState audioState);\n}", "public interface PlaybackListener {\n void onPlaybackStart();\n void onDurationChanged(long duration);\n}", "public interface OnPreparedListener\n{\n /**\n * Called when the media file is ready for playback.\n *\n * @param mp the MidiPlayer that is ready for playback\n */\n void onPrepared(AudioPlayerIterface mp);\n}", "@Override\r\n\tpublic void mediaChanged(MediaPlayer arg0, libvlc_media_t arg1, String arg2)\r\n\t{\n\t\t\r\n\t}", "public interface AudiosListener {\n void onResponseAudiosListener(ArrayList<Multimedia> audios);\n}", "void onPrepared(AudioPlayerIterface mp);", "public interface OnAudioFocusChangeListener {\n\t\t/**\n\t\t * Called on the listener to notify it the audio focus for this listener\n\t\t * has been changed. The focusChange value indicates whether the focus\n\t\t * was gained, whether the focus was lost, and whether that loss is\n\t\t * transient, or whether the new focus holder will hold it for an\n\t\t * unknown amount of time. When losing focus, listeners can use the\n\t\t * focus change information to decide what behavior to adopt when losing\n\t\t * focus. A music player could for instance elect to lower the volume of\n\t\t * its music stream (duck) for transient focus losses, and pause\n\t\t * otherwise.\n\t\t * \n\t\t * @param focusChange\n\t\t * the type of focus change, one of\n\t\t * {@link AudioManager#AUDIOFOCUS_GAIN},\n\t\t * {@link AudioManager#AUDIOFOCUS_LOSS},\n\t\t * {@link AudioManager#AUDIOFOCUS_LOSS_TRANSIENT} and\n\t\t * {@link AudioManager#AUDIOFOCUS_LOSS_TRANSIENT_CAN_DUCK}.\n\t\t */\n\t\tpublic void onAudioFocusChange(int focusChange);\n\t}", "@Override\n\t\t\tpublic void onAudioFocusChange(int arg0) {\n\t\t\t}", "@Override\r\n public void changed(final ObservableValue<? extends Wave.Status> arg0, final Wave.Status arg1, final Wave.Status arg2) {\n \r\n }", "public interface AudioInputLine extends AbstractLine {\n\n /**\n * Fill given buffer with mic captured data\n *\n * @param buffer where to put data\n * @param offset start position\n * @param length amount of byte to put\n * @return actual amount of reade bytes\n */\n\n int readNonBlocking(byte[] buffer, int offset, int length);\n\n /**\n * Short cut for read\n *\n * @param buffer to fill with data\n * @return actual amount of reade bytes\n */\n\n default int readNonBlocking(byte[] buffer) {\n return readNonBlocking(buffer, 0, buffer.length);\n }\n\n /**\n * Blocking read\n *\n * @param buffer to fill\n * @param offset buffer start position\n * @param length amount of bytes to read\n * @return actual number of read bytes from underlying device buffer\n */\n\n int readBlocking(byte[] buffer, int offset, int length);\n\n /**\n * Blocking read for full buffer\n *\n * @param buffer to fill\n * @return actual number of read bytes from underlying device buffer\n */\n\n default int readBlocking(byte[] buffer) {\n return readBlocking(buffer, 0, buffer.length);\n }\n}", "@Override\r\n\tpublic void pausableChanged(MediaPlayer mediaPlayer, int newSeekable)\r\n\t{\n\r\n\t}", "public interface IAudioEncoder {\n\n public interface IADTCallback {\n\n public void onAudioMetaInfo(byte[] meta);\n public void onAudioFrame(byte[] data, long presentationTimeUs);\n }\n\n public void setCallback(IADTCallback callback);\n public int startEncoder(int sampleRate, int channels, int bitrate);\n public int encodeFrame(byte[] data, long presentationTimeUs);\n public void stopEncoder();\n\n public MediaFormat getOutputFormat();\n}", "public interface IOStreamConnectorListener extends EventListener {\n /**\n * Implement to be informed when data is sent from the <code>InputStream</code>\n * to the <code>OutputStream</code>\n *\n * @param data the data sent\n * @param count the number of bytes in <code>data</code> that were sent\n */\n public void data(byte[] data, int count);\n}", "public interface OnGetLiveStreamProgramsListener {\n void onGetLiveStreamProgramsSuccess(SCLiveStream stream, SCLiveStreamPrograms programs);\n void onGetLiveStreamProgramsFailed(SCFailLog reason);\n}", "public interface OggStreamPlayerCallback\n{\n public void playerStarted();\n\n public void playerStopped();\n\n public void playerException(Throwable t);\n}", "public interface VolumeControl\n{\n /**\n * The name of the configuration property which specifies the volume level\n * of audio input.\n */\n public final static String CAPTURE_VOLUME_LEVEL_PROPERTY_NAME\n = \"net.java.sip.communicator.service.media.CAPTURE_VOLUME_LEVEL\";\n\n /**\n * The name of the configuration property which specifies the volume level\n * of audio output.\n */\n public final static String PLAYBACK_VOLUME_LEVEL_PROPERTY_NAME\n = \"net.java.sip.communicator.service.media.PLAYBACK_VOLUME_LEVEL\";\n\n /**\n * Current volume value.\n * @return the current volume level.\n */\n public float getVolume();\n\n /**\n * Returns the minimum allowed volume value.\n * @return the minimum allowed volume value.\n */\n public float getMinValue();\n\n /**\n * Returns the maximum allowed volume value.\n * @return the maximum allowed volume value.\n */\n public float getMaxValue();\n\n /**\n * Changes volume level.\n * @param value the new level to set.\n * @return the actual level which was set.\n */\n public float setVolume(float value);\n\n /**\n * Mutes current sound playback.\n * @param mute mutes/unmutes playback.\n */\n public void setMute(boolean mute);\n\n /**\n * Get mute state of sound playback.\n * @return mute state of sound playback.\n */\n public boolean getMute();\n\n /**\n * Adds a <tt>VolumeChangeListener</tt> to be informed for any change\n * in the volume levels.\n *\n * @param listener volume change listener.\n */\n public void addVolumeChangeListener(VolumeChangeListener listener);\n\n /**\n * Removes a <tt>VolumeChangeListener</tt>.\n * @param listener the volume change listener to be removed.\n */\n public void removeVolumeChangeListener(VolumeChangeListener listener);\n}", "@Override\n public void onServiceConnected(ComponentName componentName, IBinder iBinder) {\n audioServiceBinder = (AudioServiceBinder) iBinder;\n }", "protected void onMediaControllerConnected() {\n }", "public void streamSubscriberStart(ISubscriberStream stream);", "void changeMusic(AudioTrack newSong);", "@Override\r\n\tpublic void buffering(MediaPlayer arg0, float arg1)\r\n\t{\n\t\t\r\n\t}", "protected abstract void onPlayerStateChanged(MediaPlayerState playerState);", "public void subscribe( Observer< S, Info > obs );", "@Override\n public void onBufferingUpdate(MediaPlayer mp, int percent) {\n }", "@Override\n public void onBufferingUpdate(MediaPlayer mp, int percent) {\n }", "private void onAudioManagerChangedState() {\n setVolumeControlStream(AudioManager.STREAM_VOICE_CALL);\n }", "void addPlayerObserver(PlayerObserver observer);", "@Override\n public boolean onInfo(MediaPlayer mp, int what, int extra) {\n\n Log.v(\"FreshAir\", \"onInfo (\" + what + \" - \" + extra + \")\");\n\n switch (what) {\n case 701: //MediaPlayer.MEDIA_INFO_BUFFERING_START:\n text_info.setText(\"Buffering ...\");\n progress_main.setVisibility(View.VISIBLE);\n isPlaying = true; // ie you cant re set the data sourse without\n // stoping first\n break;\n\n case 702: //MediaPlayer.MEDIA_INFO_BUFFERING_END:\n text_info.setText(\"Playing ...\");\n progress_main.setVisibility(View.INVISIBLE);\n isPlaying = true;\n\n default:\n break;\n }\n\n return true; // return true to stop the OS calling 'onError'\n }", "@Override\n\t\tpublic void onReceive(Context arg0, Intent arg1) {\n\t\t\tString action = arg1.getAction();\n\t\t\tLog.v(TAG, \"action: \" + arg1.getAction());\n\t\t\tif(action.equals(\"android.media.VOLUME_CHANGED_ACTION\")){\n\t\t\t\tsystem_sound = audio.getStreamVolume(AudioManager.STREAM_RING) ;// 当前的媒体音量\n\t\t\t\tFyLog.d(TAG, \"the system_sound is: \" + system_sound);\n\t\t\t\tif(system_sound != sound.getProgress())\n\t\t\t\t\tsound.setProgress(system_sound);\n\t\t\t}\n\t\t}", "private Audio() {}", "public interface YJVORecognizeListener\n{\n\n public abstract void onRecognizeResult(int i, YJVORecognizeResult yjvorecognizeresult);\n\n public abstract void onRecognizeState(YJVO_STATE yjvo_state);\n\n public abstract void onRecordingStart();\n\n public abstract void onVolumeChanged(short word0);\n}", "public void UpdateSounds(mobj_t listener);", "public interface IStreamAwareScopeHandler extends IScopeHandler {\r\n\t/**\r\n\t * A broadcast stream starts being published. This will be called\r\n\t * when the first video packet has been received.\r\n\t * \r\n\t * @param stream stream\r\n\t */\r\n\tpublic void streamPublishStart(IBroadcastStream stream);\r\n\r\n\t/**\r\n\t * A broadcast stream starts being recorded. This will be called\r\n\t * when the first video packet has been received.\r\n\t * \r\n\t * @param stream stream \r\n\t */\r\n\tpublic void streamRecordStart(IBroadcastStream stream);\r\n\r\n\t/**\r\n\t * Notified when a broadcaster starts.\r\n\t * \r\n\t * @param stream stream\r\n\t */\r\n\tpublic void streamBroadcastStart(IBroadcastStream stream);\r\n\r\n\t/**\r\n\t * Notified when a broadcaster closes.\r\n\t * \r\n\t * @param stream stream\r\n\t */\r\n\tpublic void streamBroadcastClose(IBroadcastStream stream);\r\n\r\n\t/**\r\n\t * Notified when a subscriber starts.\r\n\t * \r\n\t * @param stream stream\r\n\t */\r\n\tpublic void streamSubscriberStart(ISubscriberStream stream);\r\n\r\n\t/**\r\n\t * Notified when a subscriber closes.\r\n\t * \r\n\t * @param stream stream\r\n\t */\r\n\tpublic void streamSubscriberClose(ISubscriberStream stream);\r\n\r\n\t/**\r\n\t * Notified when a playlist item plays.\r\n\t * \r\n\t * @param stream stream\r\n\t * @param item item\r\n\t * @param isLive treu if live\r\n\t * TODO\r\n\t */\r\n\tpublic void streamPlaylistItemPlay(IPlaylistSubscriberStream stream,\r\n\t\t\tIPlayItem item, boolean isLive);\r\n\r\n\t/**\r\n\t * Notified when a playlist item stops.\r\n\t * \r\n\t * @param stream stream\r\n\t * @param item item\r\n\t */\r\n\tpublic void streamPlaylistItemStop(IPlaylistSubscriberStream stream,\r\n\t\t\tIPlayItem item);\r\n\r\n\t/**\r\n\t * Notified when a playlist vod item pauses.\r\n\t * \r\n\t * @param stream stream\r\n\t * @param item item\r\n * @param position position\r\n\t */\r\n\tpublic void streamPlaylistVODItemPause(IPlaylistSubscriberStream stream,\r\n\t\t\tIPlayItem item, int position);\r\n\r\n\t/**\r\n\t * Notified when a playlist vod item resumes.\r\n\t * \r\n\t * @param stream stream\r\n\t * @param item item\r\n * @param position position\r\n\t */\r\n\tpublic void streamPlaylistVODItemResume(IPlaylistSubscriberStream stream,\r\n\t\t\tIPlayItem item, int position);\r\n\r\n\t/**\r\n\t * Notified when a playlist vod item seeks.\r\n\t * \r\n\t * @param stream stream\r\n\t * @param item item\r\n * @param position position\r\n\t */\r\n\tpublic void streamPlaylistVODItemSeek(IPlaylistSubscriberStream stream,\r\n\t\t\tIPlayItem item, int position);\r\n}", "public interface OnRecordVoiceListener {\n\n /**\n * Fires when started recording.\n */\n void onStartRecord();\n\n /**\n * Fires when finished recording.\n *\n * @param voiceFile The audio file.\n * @param duration The duration of audio file, specified in seconds.\n */\n void onFinishRecord(File voiceFile, int duration);\n}", "@Override\r\n\tpublic void mediaParsedChanged(MediaPlayer mediaPlayer, int newStatus)\r\n\t{\n\r\n\t}", "@Override\n public void run() {\n AudioManager m_amAudioManager;\n m_amAudioManager = (AudioManager) mContext.getSystemService(Context.AUDIO_SERVICE);\n m_amAudioManager.setMode(AudioManager.MODE_IN_CALL);\n m_amAudioManager.setSpeakerphoneOn(false);\n AudioTrack track = new AudioTrack(AudioManager.STREAM_MUSIC, SAMPLE_RATE, AudioFormat.CHANNEL_OUT_MONO,\n AudioFormat.ENCODING_PCM_16BIT, BUF_SIZE, AudioTrack.MODE_STREAM);\n track.play();\n try {\n // Define a socket to receive the audio\n byte[] buf = new byte[BUF_SIZE];\n while(speakers && !UDP) {\n // Play back the audio received from packets\n int rec;\n rec = dataInputStreamInstance.read(buf);\n Log.d(\"rec123\", String.valueOf(rec));\n if (rec > 0)\n track.write(buf, 4, rec);\n }\n // Stop playing back and release resources\n track.stop();\n track.flush();\n track.release();\n speakers = false;\n return;\n }\n catch(SocketException e) {\n speakers = false;\n }\n catch(IOException e) {\n speakers = false;\n }\n }", "public interface RawInputObservable {\n public void rawRegister(RawInputObserver message);\n public void rawNotify(RawInputMessage message);\n}", "@Override\n\tpublic void onBufferingUpdate(MediaPlayer mp, int percent) {\n\t}", "public void onUaMediaSessionStarted(UserAgent ua, String type, String codec)\n { //printLog(type+\" started \"+codec);\n }", "@Override\n public void update(Observable o, Object arg) {\n if (o instanceof ReceiveDataObservable){\n ReceiveDataObservable receive = (ReceiveDataObservable) o;\n int distance = receive.getDistance();\n float eAx = receive.getErrorAngleX()/100;\n float eAy = receive.getErrorAngleY()/100;\n \n this.handleIncomingData(distance, eAx, eAy); \n }\n else if (o instanceof ReceiveVideoObservable){\n BufferedImage buff = ((ReceiveVideoObservable) o).getBuff();\n this.handleIncomingVideo(buff);\n \n }\n else{\n System.out.println(\"Not instance of DH\");\n }\n }", "IAudio read(InputStream inputStream) throws AudioReaderException, InvalidFormatException;", "public interface VoiceActivityDetectorListener {\n void onVoiceActivityDetected();\n void onNoVoiceActivityDetected();\n}", "public void playAudio() {\n\n }", "void startMusic(AudioTrack newSong);", "@Override\n public void makeSound() {\n\n }", "@Override\n public void makeSound() {\n\n }", "public AudioDescriptor getAudioDescriptor();", "public interface ContextListener {\n /**\n * Gets the albums.\n * \n * @return the albums\n */\n public List<AlbumInfo> getAlbums();\n\n /**\n * Notify album retrieved.\n * \n * @param file the file\n * @param id the id\n */\n public void notifyAlbumRetrieved(AudioObject file, long id);\n\n /**\n * Notify artist image.\n * \n * @param img the img\n * @param id the id\n */\n public void notifyArtistImage(Image img, long id);\n\n /**\n * Notify cover retrieved.\n * \n * @param album the album\n * @param cover the cover\n * @param id the id\n */\n public void notifyCoverRetrieved(AlbumInfo album, Image cover, long id);\n\n /**\n * Notify finish get similar artist.\n * \n * @param a the a\n * @param img the img\n * @param id the id\n */\n public void notifyFinishGetSimilarArtist(ArtistInfo a, Image img, long id);\n\n /**\n * Notify start retrieving artist images.\n * \n * @param id the id\n */\n public void notifyStartRetrievingArtistImages(long id);\n\n /**\n * Notify start retrieving covers.\n * \n * @param id the id\n */\n public void notifyStartRetrievingCovers(long id);\n\n /**\n * Notify wiki info retrieved.\n * \n * @param wikiText the wiki text\n * @param wikiURL the wiki url\n * @param id the id\n */\n public void notifyWikiInfoRetrieved(String wikiText, String wikiURL, long id);\n\n /**\n * Sets the album.\n * \n * @param album the album\n * @param id the id\n */\n public void setAlbum(AlbumInfo album, long id);\n\n /**\n * Sets the albums.\n * \n * @param album the album\n * @param id the id\n */\n public void setAlbums(List<? extends AlbumInfo> album, long id);\n\n /**\n * Sets the image.\n * \n * @param img the img\n * @param ao audio object\n * @param id the id\n */\n public void setImage(Image img, AudioObject ao, long id);\n\n /**\n * Sets the last album retrieved.\n * \n * @param album the album\n * @param id the id\n */\n public void setLastAlbumRetrieved(String album, long id);\n\n /**\n * Sets the last artist retrieved.\n * \n * @param artist the artist\n * @param id the id\n */\n public void setLastArtistRetrieved(String artist, long id);\n}", "void onAudioLevel(float level);", "@Override\n public void dataReceived(PlayingInfoModel result) {\n }", "protected abstract UtteranceProcessor getAudioOutput() throws IOException ;", "public void onVideoStarted () {}", "public AudioMonitor(AudioMonitorListener listener) {\n this.listener = listener;\n }", "@Override\n\tpublic void onBufferingUpdate(MediaPlayer mp, int percent) {\n\n\t}", "private void playHintAudio() {\n AudioManager audioManager = (AudioManager)getContext().getSystemService(Context.AUDIO_SERVICE);\n int mode = audioManager.getRingerMode();\n Log.d(TAG,\"mode = \" + mode);\n\n if(mode != AudioManager.RINGER_MODE_SILENT && mode != AudioManager.RINGER_MODE_VIBRATE) {\n // prize modify for bug 44603 by zhaojian 20171205 start\n mMediaPlayer = MediaPlayer.create(getContext(),R.raw.hb_sound2);\n Log.d(\"debug\",\"isNotifySound = \" + getConfig().isNotifySound());\n if(getConfig().isNotifySound()) {\n mMediaPlayer.setOnPreparedListener(new MediaPlayer.OnPreparedListener() {\n @Override\n public void onPrepared(MediaPlayer mp) {\n mp.start();\n }\n });\n mMediaPlayer.setOnCompletionListener(new MediaPlayer.OnCompletionListener() {\n @Override\n public void onCompletion(MediaPlayer mp) {\n mp.release();\n }\n });\n mMediaPlayer.start();\n }\n // prize modify for bug 44603 by zhaojian 20171205 end\n }\n }", "@Override\n\tpublic void streamingServiceStopped(int arg0) {\n\t\t\n\t}", "@Override\n public void onSeekComplete(MediaPlayer mp) {\n }", "@Override\n public void onSeekComplete(MediaPlayer mp) {\n }", "public interface IPlayEvent {\n void onPlayStart();\n void OnPlayPaused();\n void OnPlayResume();\n void OnPlayStoped();\n void OnPlayComplete();\n void OnReplay();\n void OnPrepared(boolean value);\n}", "@FunctionalInterface\npublic interface ServerVoiceChannelChangeBitrateListener extends ServerAttachableListener,\n ServerVoiceChannelAttachableListener,\n GloballyAttachableListener, ObjectAttachableListener {\n\n /**\n * This method is called every time a server voice channel's bitrate changes.\n *\n * @param event The event.\n */\n void onServerVoiceChannelChangeBitrate(ServerVoiceChannelChangeBitrateEvent event);\n}", "public interface SignalSource {\r\n\t\r\n\t/**\r\n\t * Returns the number of output signals from the device\r\n\t * @return the number of signals (>0)\r\n\t */\r\n\tpublic int getNumberOfSignals();\r\n\t\r\n\t/**\r\n\t * Returns index:th signal's signal name\r\n\t * @param index signal index\r\n\t * @return name of the signal\r\n\t */\r\n\tpublic String getSignalName(int index);\r\n\t\r\n\t\r\n\t/**\r\n\t * Returns index for signal name (signal number)\r\n\t * @param name the name of the signal\r\n\t * @return signal index\r\n\t */\r\n\tpublic int getSignalNameNumber(String name);\r\n\t\r\n\t/**\r\n\t * Returns current value of the signal\r\n\t * @param index signal index\r\n\t * @return value of the signal [0,1]\r\n\t */\r\n\tpublic float getSignalValue(int index);\r\n\r\n}", "public interface AudioHeader\n{\n /**\n * @return the audio file type\n */\n public abstract String getEncodingType();\n\n /**\n * @return the ByteRate of the Audio, this is the total average amount of bytes of data sampled per second\n */\n public Integer getByteRate();\n\n\n\n /**\n * @return the BitRate of the Audio, this is the amount of kilobits of data sampled per second\n */\n public String getBitRate();\n\n /**\n * @return bitRate as a number, this is the amount of kilobits of data sampled per second\n */\n public long getBitRateAsNumber();\n\n\n /**\n *\n * @return length of the audio data in bytes, exactly what this means depends on the audio format\n *\n * TODO currently only used by Wav/Aiff/Flac/Mp4\n */\n public Long getAudioDataLength();\n\n\n /**\n *\n * @return the location in the file where the audio samples start\n *\n * TODO currently only used by Wav/Aiff/Flac/Mp4\n */\n public Long getAudioDataStartPosition();\n\n\n /**\n *\n * @return the location in the file where the audio samples end\n *\n * TODO currently only used by Wav/Aiff/Flac/Mp4\n */\n public Long getAudioDataEndPosition();\n\n\n /**\n * @return the Sampling rate, the number of samples taken per second\n */\n public String getSampleRate();\n\n /**\n * @return he Sampling rate, the number of samples taken per second\n */\n public int getSampleRateAsNumber();\n\n /**\n * @return the format\n */\n public String getFormat();\n\n /**\n * @return the number of channels (i.e 1 = Mono, 2 = Stereo)\n */\n public String getChannels();\n\n /**\n * @return if the sampling bitRate is variable or constant\n */\n public boolean isVariableBitRate();\n\n /**\n * @return track length in seconds\n */\n public int getTrackLength();\n\n /**\n *\n * @return track length as float\n */\n public double getPreciseTrackLength();\n\n /**\n * @return the number of bits in each sample\n */\n public int getBitsPerSample();\n\n /**\n *\n * @return if the audio codec is lossless or lossy\n */\n public boolean isLossless();\n\n /**\n *\n * @return the total number of samples, this can usually be used in conjunction with the\n * sample rate to determine the track duration\n */\n public Long getNoOfSamples();\n}", "public interface JCardDataStreamListener {\n\t\t/**\n\t\t * Called when a vCard has been found in the stream.\n\t\t */\n\t\tvoid beginVCard();\n\n\t\t/**\n\t\t * Called when a property is read.\n\t\t * @param group the group or null if there is not group\n\t\t * @param propertyName the property name (e.g. \"summary\")\n\t\t * @param parameters the parameters\n\t\t * @param dataType the data type or null for \"unknown\"\n\t\t * @param value the property value\n\t\t */\n\t\tvoid readProperty(String group, String propertyName, VCardParameters parameters, VCardDataType dataType, JCardValue value);\n\t}", "public void onVoiceStart(int sampleRates) {\n }", "public abstract IObserver getMediatedObserver();", "public abstract void audioMessage(Message m);", "@Override\r\n\tpublic void seekableChanged(MediaPlayer mediaPlayer, int newSeekable)\r\n\t{\n\r\n\t}", "@Override\n public void onAudioSamples(IAudioSamplesEvent event) {\n\n /*\n * -----------------------------------------------------------------------------------\n * !!! LAB EXERCISE !!!\n * -----------------------------------------------------------------------------------\n * 1. Create a 'ShortBuffer' and point it to the incoming audio samples.\n * Hint: Use 'event.getAudioSamples().getByteBuffer().asShortBuffer()'\n *\n * 2. Loop over the buffer values from 0 to 'buffer.limit()' and access each buffer\n * value using 'buffer.get'\n * Hint: 'buffer.get' gets the sample values as a 'short'\n *\n * 3. Multiply each buffer value by the 'multiplier' (which is a double) then place the\n * resultant value back into the buffer using 'buffer.put'\n * Hint: You may need to cast the data to a 'short' value\n */\n\n // ===================================================================================\n // *** YOUR CODE HERE ***\n ShortBuffer buffer = event.getAudioSamples().getByteBuffer().asShortBuffer();\n\n for (int i = 0; i < buffer.limit(); ++i)\n {\n buffer.put((short)(buffer.get(i) * this.multiplier));\n }\n // ===================================================================================\n\n // Finally, pass the adjusted event to the next tool\n super.onAudioSamples(event);\n }", "@Override\r\n public void _updateSource(MixerSource source) {\n Vec3d sourcePosition = source.getAudioNode() == null ? playerPosition : source.getAudioNode().getGlobalCoordinates();\r\n Vec3d relativepos = Vec3d.substraction(sourcePosition, playerPosition);\r\n\r\n //Calculate and set the new volume\r\n source.setVolume(getVolumeFromDistance(relativepos.length(), source.getCurrentAudio().getBaseVolume()));\r\n }", "@Override\r\n\tpublic void mediaStateChanged(MediaPlayer mediaPlayer, int newState)\r\n\t{\n\r\n\t}", "@Override\n\tpublic void streamingServiceStarted(int arg0) {\n\t\t\n\t}", "protected void audioDataChanged() {\r\n\t\tpv.update();\r\n\t\trepaint(); // is asynchronous\r\n\t}", "public void setAudioDescriptor( AudioDescriptor audioDescriptor );", "public interface Audible {\n public String makeSound();\n}", "@Override\n public void timeChanged(MediaPlayer mp, long l) {\n }", "public abstract void inputChangeEvent( float time, int dstPin, boolean v );", "@Override\n public void onVideoStarted() {\n }", "void onListeningStarted();", "public interface AudioSamplerNode extends SbNode {\n\n /**\n * Sets the <code>AudioDescriptor</code> that shall be sampled.\n * @param audioDescriptor The <code>AudioDescriptor</code> containing the\n * audio file to be sampled.\n */\n public void setAudioDescriptor( AudioDescriptor audioDescriptor );\n \n /**\n * Gets the <code>AudioDescriptor</code> that shall be sampled.\n * @return The <code>AudioDescriptor</code> to sample, or <code>null</code>\n * if none is set.\n */\n public AudioDescriptor getAudioDescriptor();\n\n /**\n * Sets the retrigger mode. The retrigger mode determines what\n * happens if a trigger event comes in and the sample is still playing.\n * @param retriggerMode The <code>RetriggerMode</code> to set. Must\n * not be <code>null</code>.\n */\n public void setRetriggerMode( RetriggerMode retriggerMode );\n \n /**\n * Gets the current retrigger mode. The retrigger mode determines what\n * happens if a trigger event comes in and the sample is still playing.\n * @return The <code>RetriggerMode</code>.\n */\n public RetriggerMode getRetriggerMode();\n \n /**\n * Sets the sample mode.\n * @param sampleMode The sample mode to set. Must not be <code>null</code>. \n */\n public void setSampleMode( SampleMode sampleMode );\n \n /**\n * Gets the current sample mode. Default is <code>START_TO_END</code>.\n * @return The current sample mode, never <code>null</code>.\n */\n public SampleMode getSampleMode();\n \n /**\n * Enables/disables the sample's default output device(s). \n * @param enabled <code>true</code> if sample playback shall\n * send to default output(s), <code>false</code> otherwise.\n */\n public void setDefaultOutputsEnabled( boolean enabled );\n\n /**\n * Gets the default output enabled flag.\n * @return <code>true</code> if sample playback sends to default output(s),\n * <code>false</code> otherwise.\n */\n public boolean getDefaultOutputsEnabled();\n \n /**\n * This enumeration contains options for the sample playback.\n */\n public static enum SampleMode {\n START_TO_END,\n }\n \n /**\n * This enumeration contains options that determine what to do\n * on a trigger event if a sample is still running.\n */\n public static enum RetriggerMode {\n CONTINUE,\n STOP,\n RESTART,\n STOP_ON_NOTE_OFF\n }\n}" ]
[ "0.6663762", "0.6620806", "0.6613738", "0.63123685", "0.63098353", "0.6281652", "0.6277885", "0.6273814", "0.61633724", "0.61198896", "0.6105604", "0.60664195", "0.59417", "0.59268266", "0.58947116", "0.5868771", "0.586341", "0.58414084", "0.5831909", "0.5825812", "0.5818604", "0.5809958", "0.5803563", "0.5802755", "0.57780236", "0.57746726", "0.57633495", "0.575668", "0.57500076", "0.57477117", "0.5738056", "0.57285273", "0.5727096", "0.5719254", "0.56895804", "0.5687791", "0.5682691", "0.5675837", "0.56532276", "0.5642049", "0.5624971", "0.5617112", "0.56032676", "0.56013995", "0.560115", "0.560115", "0.55992854", "0.55942017", "0.55837816", "0.5578832", "0.55769575", "0.5576005", "0.55649394", "0.55622023", "0.555762", "0.5556857", "0.5552909", "0.5549012", "0.55293983", "0.551843", "0.551601", "0.5508594", "0.55067974", "0.550438", "0.54941726", "0.5488463", "0.5488463", "0.547601", "0.5470993", "0.54696566", "0.5462849", "0.5461852", "0.5459533", "0.5445866", "0.5442794", "0.54420274", "0.5432992", "0.543288", "0.543288", "0.54307103", "0.5428207", "0.54246587", "0.54245335", "0.5422063", "0.5420264", "0.54186386", "0.54018533", "0.53993773", "0.5398048", "0.53968835", "0.5394302", "0.5393173", "0.53919524", "0.53843045", "0.5374585", "0.53743017", "0.5370064", "0.53574544", "0.53523487", "0.5350743" ]
0.7644752
0
/ / / / / / /
public MirroredTypesException(List<? extends TypeMirror> paramList) { /* 69 */ super("Attempt to access Class objects for TypeMirrors " + (paramList = new ArrayList<>(paramList)) /* */ /* 71 */ .toString()); /* 72 */ this.types = Collections.unmodifiableList(paramList); /* */ }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private int parent(int i){return (i-1)/2;}", "private int leftChild(int i){return 2*i+1;}", "public void divide() {\n\t\t\n\t}", "public void zeichneQuadrate(){\n for (int i=0; i<10;i++)\n rect (50+i*25,50,25,25);\n }", "private int rightChild(int i){return 2*i+2;}", "public abstract void bepaalGrootte();", "public static void bottomHalf() {\n\n for(int i = 1; i <= SIZE; i++) {\n for(int j = 1; j <= i - 1; j++) {\n System.out.print(\" \");\n }\n \n\t System.out.print(\"\\\\_\");\n\t for(int j = 3*SIZE-i; j >= i; j--) {\n\t System.out.print(\"/\\\\\");\n\t }\n\t System.out.println(\"_/\");\n }\n }", "double passer();", "public void gored() {\n\t\t\n\t}", "public String ring();", "laptop(){\r\n length= 0 ;\r\n weight = 0;\r\n height = 0;\r\n width = 0;\r\n }", "public abstract String division();", "public String toString(){ return \"DIV\";}", "public double getWidth() {\n return this.left.getLeft(0) - this.right.getRight(0); \n }", "private static Object[] newPath(int length, Object[] leaf) {\n Object[] node = leaf;\n for (int i = 0; i < length; i += 5) {\n node = new Object[] { node };\n }\n return node;\n }", "int getWidth() {return width;}", "private void pointer(Graphics image,int x,int y,int height,int b,int dir) {\n\n\t\tint[] xt=new int[3];\n\t\tint[] yt=new int[3];\n\n\t\tif(dir==0) {\n\t\t\txt[0]=x;\n\t\t\txt[1]=xt[2]=x+height;\n\t\t\tyt[0]=y;\n\t\t\tyt[1]=y+b/2;\n\t\t\tyt[2]=y-b/2;\n\t\t} else {\n\t\t\txt[0]=x;\n\t\t\txt[1]=x+b/2;\n\t\t\txt[2]=x-b/2;\n\t\t\tyt[0]=y;\n\t\t\tyt[1]=yt[2]=y-height;\n\t\t}\n\t\timage.fillPolygon(xt,yt,3);\n\t}", "public void getTile_B8();", "public double getWidth() {\n return this.size * 2.0; \n }", "double volume(){\n return width*height*depth;\n }", "@Override\n public void bfs() {\n\n }", "public static void main(String[] args) {\n\n\n for(int a=0; a<7;a++){\n for(int b=0;b<7-a;b++){\n System.out.print(\" \");\n }\n for(int c=0; c<=a;c++){\n System.out.print(\"* \");\n }\n System.out.println(\" \");\n }\n\n }", "int width();", "Operations operations();", "void sharpen();", "void sharpen();", "private static void breadcrumbArrow(int width, int height, int indent, int c1, int c2) {\n\n\t\tdouble x0 = 0, y0 = height / 2d;\n\t\tdouble x1 = indent, y1 = 0;\n\t\tdouble x2 = indent, y2 = height / 2d;\n\t\tdouble x3 = indent, y3 = height;\n\t\tdouble x4 = width, y4 = 0;\n\t\tdouble x5 = width, y5 = height / 2d;\n\t\tdouble x6 = width, y6 = height;\n\t\tdouble x7 = indent + width, y7 = 0;\n\t\tdouble x8 = indent + width, y8 = height;\n\n\t\tint fc1 = ColorHelper.mixAlphaColors(c1, c2, 0);\n\t\tint fc2 = ColorHelper.mixAlphaColors(c1, c2, (indent)/(width + 2f * indent));\n\t\tint fc3 = ColorHelper.mixAlphaColors(c1, c2, (indent + width)/(width + 2f * indent));\n\t\tint fc4 = ColorHelper.mixAlphaColors(c1, c2, 1);\n\n\t\tRenderSystem.disableTexture();\n\t\tRenderSystem.enableBlend();\n\t\tRenderSystem.disableAlphaTest();\n\t\tRenderSystem.defaultBlendFunc();\n\t\tRenderSystem.shadeModel(GL11.GL_SMOOTH);\n\n\t\tTessellator tessellator = Tessellator.getInstance();\n\t\tBufferBuilder bufferbuilder = tessellator.getBuffer();\n\t\tbufferbuilder.begin(GL11.GL_TRIANGLES, DefaultVertexFormats.POSITION_COLOR);\n\n\t\tbufferbuilder.vertex(x0, y0, 0).color(fc1 >> 16 & 0xFF, fc1 >> 8 & 0xFF, fc1 & 0xFF, fc1 >> 24 & 0xFF).endVertex();\n\t\tbufferbuilder.vertex(x1, y1, 0).color(fc2 >> 16 & 0xFF, fc2 >> 8 & 0xFF, fc2 & 0xFF, fc2 >> 24 & 0xFF).endVertex();\n\t\tbufferbuilder.vertex(x2, y2, 0).color(fc2 >> 16 & 0xFF, fc2 >> 8 & 0xFF, fc2 & 0xFF, fc2 >> 24 & 0xFF).endVertex();\n\n\t\tbufferbuilder.vertex(x0, y0, 0).color(fc1 >> 16 & 0xFF, fc1 >> 8 & 0xFF, fc1 & 0xFF, fc1 >> 24 & 0xFF).endVertex();\n\t\tbufferbuilder.vertex(x2, y2, 0).color(fc2 >> 16 & 0xFF, fc2 >> 8 & 0xFF, fc2 & 0xFF, fc2 >> 24 & 0xFF).endVertex();\n\t\tbufferbuilder.vertex(x3, y3, 0).color(fc2 >> 16 & 0xFF, fc2 >> 8 & 0xFF, fc2 & 0xFF, fc2 >> 24 & 0xFF).endVertex();\n\n\t\tbufferbuilder.vertex(x3, y3, 0).color(fc2 >> 16 & 0xFF, fc2 >> 8 & 0xFF, fc2 & 0xFF, fc2 >> 24 & 0xFF).endVertex();\n\t\tbufferbuilder.vertex(x1, y1, 0).color(fc2 >> 16 & 0xFF, fc2 >> 8 & 0xFF, fc2 & 0xFF, fc2 >> 24 & 0xFF).endVertex();\n\t\tbufferbuilder.vertex(x4, y4, 0).color(fc3 >> 16 & 0xFF, fc3 >> 8 & 0xFF, fc3 & 0xFF, fc3 >> 24 & 0xFF).endVertex();\n\n\t\tbufferbuilder.vertex(x3, y3, 0).color(fc2 >> 16 & 0xFF, fc2 >> 8 & 0xFF, fc2 & 0xFF, fc2 >> 24 & 0xFF).endVertex();\n\t\tbufferbuilder.vertex(x4, y4, 0).color(fc3 >> 16 & 0xFF, fc3 >> 8 & 0xFF, fc3 & 0xFF, fc3 >> 24 & 0xFF).endVertex();\n\t\tbufferbuilder.vertex(x6, y6, 0).color(fc3 >> 16 & 0xFF, fc3 >> 8 & 0xFF, fc3 & 0xFF, fc3 >> 24 & 0xFF).endVertex();\n\n\t\tbufferbuilder.vertex(x5, y5, 0).color(fc3 >> 16 & 0xFF, fc3 >> 8 & 0xFF, fc3 & 0xFF, fc3 >> 24 & 0xFF).endVertex();\n\t\tbufferbuilder.vertex(x4, y4, 0).color(fc3 >> 16 & 0xFF, fc3 >> 8 & 0xFF, fc3 & 0xFF, fc3 >> 24 & 0xFF).endVertex();\n\t\tbufferbuilder.vertex(x7, y7, 0).color(fc4 >> 16 & 0xFF, fc4 >> 8 & 0xFF, fc4 & 0xFF, fc4 >> 24 & 0xFF).endVertex();\n\n\t\tbufferbuilder.vertex(x6, y6, 0).color(fc3 >> 16 & 0xFF, fc3 >> 8 & 0xFF, fc3 & 0xFF, fc3 >> 24 & 0xFF).endVertex();\n\t\tbufferbuilder.vertex(x5, y5, 0).color(fc3 >> 16 & 0xFF, fc3 >> 8 & 0xFF, fc3 & 0xFF, fc3 >> 24 & 0xFF).endVertex();\n\t\tbufferbuilder.vertex(x8, y8, 0).color(fc4 >> 16 & 0xFF, fc4 >> 8 & 0xFF, fc4 & 0xFF, fc4 >> 24 & 0xFF).endVertex();\n\n\t\ttessellator.draw();\n\t\tRenderSystem.shadeModel(GL11.GL_FLAT);\n\t\tRenderSystem.disableBlend();\n\t\tRenderSystem.enableAlphaTest();\n\t\tRenderSystem.enableTexture();\n\t}", "static void pyramid(){\n\t}", "public Integer getWidth(){return this.width;}", "private void traverseBayeredPatternHalfSizeRGB(){\n int originalPositionX = 0;\n int originalPositionY = 1;\n\n for (int newX = 0; originalPositionX < originalImageHeight -1; newX++){\n for (int newY = 0; originalPositionY < originalImageWidth -1; newY++){\n Point newPosition = new Point(newX,newY);\n int newAbsoultPosition = getAbsolutPixelPosition(newPosition, originalImageHeight / 2, originalImageWidth / 2);\n halfSizePixRGB[newAbsoultPosition] = getAverageRGB(new Point(originalPositionX,originalPositionY));\n originalPositionY += 2;\n }\n originalPositionY = 0;\n originalPositionX += 2;\n }\n }", "@Override\npublic void processDirection() {\n\t\n}", "private double[] getExtents(){\n return new double[] { -90, -180, 90, 180 };\n }", "public int generateRoshambo(){\n ;]\n\n }", "@Override\n public double getPerimiter() {\n return 4 * width;\n }", "public void skystonePos4() {\n }", "void mo33732Px();", "private void traversePath()\n\t{\n\t\trobot.forward(50);\n\t\trobot.right(90);\n\t\trobot.forward(50);\n\t\trobot.right(90);\n\t\trobot.forward(50);\n\t\trobot.left(90);\n\t\trobot.forward(50);\n\t\trobot.left(90);\n\t}", "protected boolean\nshouldCompactPathLists()\n//\n////////////////////////////////////////////////////////////////////////\n{\n return true;\n}", "public void SubRect(){\n\t\n}", "public static void unionPathCompression(){\n\t\tint n = 10;\t\n\n\t\tdsf S = new dsf(n*n);\n\t\tMaze two = new Maze(n);\n\n\t\tRandom random;\n\t\tint sets = n*n;\t//number of sets in the DSF\n\t\tint randomNumber;\n\t\tint randomDirection;\n\t\tint row;\n\t\tint col;\n\n\t\tchar upperRight; \t//bottom or right\n\n\t\tS.print();\n\n\t\twhile(sets > 1){\n\t\t\trandom = new Random();\n\t\t\trandomNumber = random.nextInt((n*n) - 1);\n\t\t\t//System.out.println(\"RANDOM NUMBER: \"+randomNumber);\n\t\t\trow = randomNumber /n;\t//SWITCHED\n\t\t\tcol = randomNumber %n;\t//SWITCHED\n\t\t\trandomDirection = random.nextInt(2);\n\t\t\tString direct;\n\t\t\tif(randomDirection == 0)\n\t\t\t\tdirect = \"upper\";\n\t\t\telse\n\t\t\t\tdirect = \"right\";\n\t\t\tSystem.out.println(\"RANDOM DIRECTI0N: \"+direct);\n\t\t\tupperRight = two.direction(randomDirection);\n\n\t\t\tif(upperRight == 'u'){\n\t\t\t\tif((randomNumber) < ((n*n)-n)){\n\t\t\t\t\tSystem.out.println(\"Sets: \"+sets);\n\t\t\t\t\tif(S.findAndCompress(randomNumber+n) != S.findAndCompress(randomNumber)){\n\t\t\t\t\t\tS.union(randomNumber+n, randomNumber);\n\t\t\t\t\t\ttwo.remove_wall(col, row, 'u');\n\t\t\t\t\t\tS.print();\n\t\t\t\t\t\tsets--;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif(upperRight == 'r'){\n\t\t\t\tif(((randomNumber)%(n*n)) != n-1){\n\t\t\t\t\tif(S.findAndCompress(randomNumber) != S.findAndCompress(randomNumber+1)){\n\t\t\t\t\t\tS.union(randomNumber, randomNumber+1);\n\t\t\t\t\t\ttwo.remove_wall(col, row, 'r');\n\t\t\t\t\t\tS.print();\n\t\t\t\t\t\tsets--;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tbuildAdjacencyList(two, n);\n\t\tuserSelection_SolveMaze(n);\n\n\n\t\tStdDraw.show(0);\n\t\ttwo.draw();\n\t\ttwo.printCellNumbers();\n\t}", "private int leftChild(int index){\n\t\treturn (2*index) +1;\n\t}", "void walk() {\n\t\t\n\t}", "public static void sizePathCompression(){\n\t\tint n = 10;\t\n\n\t\tdsf S = new dsf(n*n);\n\t\tMaze five = new Maze(n);\n\n\t\tRandom random;\n\t\tint sets = n*n;\t//number of sets in the DSF\n\t\tint randomNumber;\n\t\tint randomDirection;\n\t\tint row;\n\t\tint col;\n\n\t\tchar upperRight; \t//bottom or right\n\n\t\tS.print();\n\n\t\twhile(sets > 1){\n\t\t\trandom = new Random();\n\t\t\trandomNumber = random.nextInt((n*n) - 1);\n\t\t\t//System.out.println(\"RANDOM NUMBER: \"+randomNumber);\n\t\t\trow = randomNumber /n;\t//SWITCHED\n\t\t\tcol = randomNumber %n;\t//SWITCHED\n\t\t\trandomDirection = random.nextInt(2);\n\t\t\tString direct;\n\t\t\tif(randomDirection == 0)\n\t\t\t\tdirect = \"upper\";\n\t\t\telse\n\t\t\t\tdirect = \"right\";\n\t\t\t//System.out.println(\"RANDOM DIRECTI0N: \"+direct);\n\t\t\tupperRight = five.direction(randomDirection);\n\n\t\t\tif(upperRight == 'u'){\n\t\t\t\tif((randomNumber) < ((n*n)-n)){\n\t\t\t\t\tSystem.out.println(\"Sets: \"+sets);\n\t\t\t\t\tif(S.findAndCompress(randomNumber) != S.findAndCompress(randomNumber + n)){\n\t\t\t\t\t\tS.unionBySize(randomNumber+n, randomNumber);\n\t\t\t\t\t\tfive.remove_wall(col, row, 'u');\n\t\t\t\t\t\t//S.print();\n\t\t\t\t\t\tsets--;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif(upperRight == 'r'){\n\t\t\t\tif(((randomNumber)%(n*n)) != n-1){\n\t\t\t\t\tif(S.findAndCompress(randomNumber) != S.findAndCompress(randomNumber+1)){\n\t\t\t\t\t\tS.unionBySize(randomNumber, randomNumber+1);\n\t\t\t\t\t\tfive.remove_wall(col, row, 'r');\n\t\t\t\t\t\tS.print();\n\t\t\t\t\t\tsets--;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tbuildAdjacencyList(five, n);\n\t\tuserSelection_SolveMaze(n);\n\n\t\tStdDraw.show(0);\n\t\tfive.draw();\n\t\tfive.printCellNumbers();\t\n\t}", "public double getWidth() { return _width<0? -_width : _width; }", "public void draw(){\n for(int i = 1; i <= height; i++){\n for(int s = 1; s <= i; s++)\n System.out.print(\"*\");\n System.out.println();\n }\n }", "public void stg() {\n\n\t}", "Parallelogram(){\n length = width = height = 0;\n }", "private int get_right_child(int index){\r\n return 2 * index + 2;\r\n }", "public void foundLeaf(int width, int height, int level, int currX, int currY, int location) {\n level = level +2;\n if (location == 1) {\n\n\n canvas.addLine(currX - (new Double(spatialWidth / Math.pow(2, level))).intValue(),\n (currY + (new Double(spatialHeight / Math.pow(2, level ))).intValue()) - ( (new Double(spatialHeight / Math.pow(2, level ))).intValue()),\n currX - (new Double(spatialWidth / Math.pow(2, level ))).intValue(),\n currY * 2,\n Color.BLACK);\n\n\n canvas.addLine(((currX - (new Double(spatialWidth / Math.pow(2, level))).intValue())) - (new Double(spatialWidth / Math.pow(2, level ))).intValue(),\n currY + (new Double(spatialHeight / Math.pow(2, level ))).intValue(), \n currX,\n currY + (new Double(spatialHeight / Math.pow(2, level ))).intValue(),\n Color.BLACK);\n\n\n\n }\n\n if (location == 2) {\n\n\n canvas.addLine(currX + (new Double(spatialWidth / Math.pow(2, level ))).intValue(),\n (currY + (new Double(spatialHeight / Math.pow(2, level))).intValue()) - (new Double(spatialHeight / Math.pow(2, level))).intValue(),\n currX + (new Double(spatialWidth / Math.pow(2, level))).intValue(),\n ( currY + (new Double(spatialHeight / Math.pow(2, level ))).intValue()) + (new Double(spatialHeight / Math.pow(2, level ))).intValue(),\n Color.black);\n\n canvas.addLine((currX + (new Double(spatialWidth / Math.pow(2, level ))).intValue()) - (new Double(spatialWidth / Math.pow(2, level ))).intValue(),\n currY + (new Double(spatialHeight / Math.pow(2, level ))).intValue(),\n (currX + (new Double(spatialWidth / Math.pow(2, level ))).intValue()) + (new Double(spatialWidth / Math.pow(2, level ))).intValue(),\n currY + (new Double(spatialHeight / Math.pow(2, level ))).intValue(),\n Color.black);\n\n\n\n }\n\n if (location == 3) {\n\n canvas.addLine(currX - (new Double(spatialWidth / Math.pow(2, level ))).intValue(),\n (currY - (new Double(spatialHeight / Math.pow(2, level ))).intValue()) - (new Double(spatialHeight / Math.pow(2, level ))).intValue(),\n currX - (new Double(spatialWidth / Math.pow(2, level))).intValue(),\n currY,\n Color.BLACK);\n\n\n\n canvas.addLine((currX - (new Double(spatialWidth / Math.pow(2, level))).intValue()) - (new Double(spatialWidth / Math.pow(2, level ))).intValue(),\n\tcurrY - (new Double(spatialHeight / Math.pow(2, level ))).intValue(), \n (currX - (new Double(spatialWidth / Math.pow(2, level ))).intValue()) + (new Double(spatialWidth / Math.pow(2, level))).intValue(),\n currY - (new Double(spatialHeight / Math.pow(2, level ))).intValue(),\n Color.BLACK);\n\n\n }\n\n if (location == 4) {\n\n\n canvas.addLine(currX + (new Double(spatialWidth / Math.pow(2, level ))).intValue(),\n (currY - (new Double(spatialHeight / Math.pow(2, level))).intValue()) - (new Double(spatialHeight / Math.pow(2, level))).intValue(),\n currX + (new Double(spatialWidth / Math.pow(2, level ))).intValue(),\n currY,\n Color.BLACK);\n\n\n canvas.addLine((currX + (new Double(spatialWidth / Math.pow(2, level))).intValue()) - (new Double(spatialWidth / Math.pow(2, level ))).intValue(),\n currY - (new Double(spatialHeight / Math.pow(2, level ))).intValue(),\n currX + (new Double(spatialWidth / Math.pow(2, level ))).intValue() + (new Double(spatialWidth / Math.pow(2, level))).intValue(),\n currY - (new Double(spatialHeight / Math.pow(2, level ))).intValue(), Color.BLACK);\n\n\n }\n\n\n\n\n }", "@Override\n\tpublic void draw() {\n\t\t\n\t}", "@Override\n\tpublic void draw() {\n\t\t\n\t}", "public static void main(String[] args) {\n\t\tScanner obj=new Scanner(System.in);\r\n\t\tint a=0;\r\n\t\tint count=0;\r\n System.out.println(\"enter size\");\r\n\t\ta=obj.nextInt();\r\n\t\tint m=2*a+1;\r\n\t\tint n=2*a+2;\r\n\t\tint mid=(m+1)/2;\r\n\t\tfor(int i=1;i<=m;i++)\r\n\t\t{\r\n\t\t\tcount=0;\r\n\t\t\tfor(int j=1;j<=n;j++)\r\n\t\t\t{\r\n\t\t\t\tcount++;\r\n\t\t\t\tif((i==1)||(i==m)||(j==1)||(j==n))//frame begin\r\n\t\t\t\t{\r\n\t\t\t\t\tif((i==1)||(i==m))\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tif((j==1)||(j==n))\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\tSystem.out.print(\"+\");\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\telse\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\tSystem.out.print(\"-\");\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tif((j==1)||(j==n))\r\n\t {\r\n\t\t\t\t\t\t\tSystem.out.print(\"|\");//frame left and right\r\n\t }\r\n\t\t\t\t\t}\r\n\t\t\t\t}//frame end\r\n\t\t\t\telse if (i<mid)//upper-half\r\n\t\t\t\t{\r\n\t\t\t\t\tif(count<=2)\r\n\t\t\t\t\t{\r\n\t\t\t\t for(int k=mid;k>i;k--)\r\n\t\t\t\t {\r\n\t\t\t\t\tSystem.out.print(\" \");\r\n\t\t\t\t }\r\n\t\t\t\t System.out.print(\"/\");\r\n\t\t\t\t for(int l=1;l<=2*i-4;l++)\r\n\t\t\t\t {\r\n\t\t\t\t\t if(i%2==0)\r\n\t\t\t\t\t {\r\n\t\t\t\t\t\t System.out.print(\"=\");\r\n\t\t\t\t\t }\r\n\t\t\t\t\t else\r\n\t\t\t\t\t {\r\n\t\t\t\t\t\t System.out.print(\"-\");\r\n\t\t\t\t\t }\r\n\t\t\t\t }\r\n\t\t\t\tSystem.out.print(\"\\\\\");\r\n\t\t\t\t for(int k=mid;k>i;k--)\r\n\t\t\t\t {\r\n\t\t\t\t\t System.out.print(\" \");\r\n\t\t\t\t }\r\n\t\t\t\t\t}\r\n\t\t\t\t}//end of upper half\r\n\t\t\t\telse if(i>mid)//lower half\r\n\t\t\t\t{\r\n\t\t\t\t\tif(count<=2)\r\n\t\t\t\t\t{\r\n\t\t\t\t\tfor(int k=mid;k<i;k++)\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tSystem.out.print(\" \");\r\n\t\t\t\t\t}\r\n\t\t\t\t\t System.out.print(\"\\\\\");\r\n\t\t\t\t\t for(int l=2*m-6;l>2*i-4;l--)\r\n\t\t\t\t\t {\r\n\t\t\t\t\t\t if(i%2==0)\r\n\t\t\t\t\t\t {\r\n\t\t\t\t\t\t\t System.out.print(\"=\");\r\n\t\t\t\t\t\t }\r\n\t\t\t\t\t\t else\r\n\t\t\t\t\t\t {\r\n\t\t\t\t\t\t\t System.out.print(\"-\");\r\n\t\t\t\t\t\t } \r\n\t\t\t\t\t }\r\n\t\t\t\t\t System.out.print(\"/\");\r\n\t\t\t\t\t for(int k=mid;k<i;k++)\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\tSystem.out.print(\" \");\r\n\t\t\t\t\t\t}\r\n\t\t\t }\r\n\t\t\t\t\t}//end of lower half\r\n\t\t\t\telse if(i==mid)//middle part\r\n\t\t\t\t{\r\n\t\t\t\t\tif(j==2)\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tSystem.out.print(\"<\");\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse if(j==n-1)\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tSystem.out.print(\">\");\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tif(i%2==0)\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\tSystem.out.print(\"=\");\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\telse\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\tSystem.out.print(\"-\");\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}//end\r\n\t\t\t}//end-of-j\r\n\t\t\tSystem.out.println();\r\n\t\t}//end\r\n\r\n\t}", "public static void main(String[] args) {\n\t\tfor(int j=0;j<8;j++){\n\t\t\tfor(int i=0;i<8;i++){\n\t\t\t\t//上下两侧\n\t\t\t\tif(j==0||j==7){\n\t\t\t\t\tSystem.out.print(\"*\");\n\t\t\t\t}else{\n\t\t\t\t\t//中间\n\t\t\t\t\tif(i>0&&i<7){\n\t\t\t\t\t\tSystem.out.print(\" \");\n\t\t\t\t\t}else{\n\t\t\t\t\t\tSystem.out.print(\"*\");\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t\t\n\t\t\t}\n\t\t\tSystem.out.println();\n\t\t}\n\t}", "private void e()\r\n/* 273: */ {\r\n/* 274:278 */ this.r = false;\r\n/* 275:279 */ this.s = false;\r\n/* 276:280 */ this.t = false;\r\n/* 277:281 */ this.u = false;\r\n/* 278:282 */ this.v = false;\r\n/* 279: */ }", "public double getWidth() {\n return this.getRight(this.tree.getRight(0)) - this.getLeft(this.tree.getLeft(0)); \n }", "double getPerimeter(){\n return 2*height+width;\n }", "public static void part2(){\n\t\n System.out.println(\"\\\\\"); //Outer wall\n System.out.println(\"\\\\\");\n System.out.println(\"\\\\\");\n for(int i = 0; i <= 16; i++){ //loop created to display top of the door\n\n \tSystem.out.print(\"-\");\n\n\t}\n System.out.println(\"\");\n System.out.println(\"\\\\\\t\\t| \\t(\\\")\"); //The door and the stick figure\n System.out.println(\"\\\\\\t\\t|\\t-|-\");\n System.out.println(\"\\\\\\t o | \\t |\");\n System.out.println(\"\\\\\\t\\t|\\t /\\\\\");\n System.out.println(\"\\\\\\t\\t|\\t/ \\\\\");\n\t\t\n }", "public double getPerimiter(){return (2*height +2*width);}", "@Override\r\n\tpublic void walk() {\n\r\n\t}", "double Volume(){\r\n return Height * Width * Depth;\r\n }", "int[] union(int s1,int t1,int s2,int t2)\r\n\t{\r\n\t\tint [] st=new int[2];\r\n\t\t//Please fill in the program here\r\n\t\tst[0] = incCapacity();\r\n\t\taddEdge(st[0], epssymbol, s1);\r\n\t\taddEdge(st[0], epssymbol, s2);\r\n\t\tst[1] = incCapacity();\r\n\t\taddEdge(t1, epssymbol, st[1]);\r\n\t\taddEdge(t2, epssymbol, st[1]);\r\n\r\n\t\treturn st;\r\n\t}", "void doubleBox(int sides, float x1, float y1, float z1, float x2, float y2, float z2)\r\n/* 100: */ {\r\n/* 101: 99 */ int s2 = sides << 1 & 0x2A | sides >> 1 & 0x15;\r\n/* 102: */ \r\n/* 103:101 */ this.context.renderBox(sides, x1, y1, z1, x2, y2, z2);\r\n/* 104:102 */ this.context.renderBox(s2, x2, y2, z2, x1, y1, z1);\r\n/* 105: */ }", "@Override\n protected void paint2d(Graphics2D g) {\n \n }", "public static String makeShapeA() {\n\tString result = \"\";\n\t\tfor (int i = 0; i < 8 ; i++) {\n\t\t\tresult+=printHash(i);\n\t\t\t\n\t\t}return result;\n\t\t\t//System.out.println(printHash(i));\n\t\t}", "double getNewWidth();", "public void draw4x4 (char design){\n System.out.println(\"\"+design+design+design+design);\n System.out.println(design+\" \"+design);\n System.out.println(design+\" \"+design);\n System.out.println(\"\"+design+design+design+design);\n}", "public void lowerFlatbed(){\n flatbed.lowerFlatbed();\n }", "int fi(int x, int y) {\n\t\treturn (x + 1) + (width + 2) * (y + 1);\n\t}", "private void createPath(Direction d, int width, Point p1, Point p2) {\n\t\t// Determine how far away from the center the corners are\n\t\tint sideOneOffset = 0;\t// Top or Left depending on path direction\n\t\tint sideTwoOffset = 0;\t// Bot or Right depending on path direction\n\t\t// If the width is odd, balance the offsets\n\t\tif (width % 2 != 0) {\t\n\t\t\tsideOneOffset = sideTwoOffset = ((width / 2) + 1);\n\t\t} else {\n\t\t\t// If the width is even, the offsets will be off by 1\n\t\t\tsideOneOffset = width;\n\t\t\tsideTwoOffset = width - 1;\n\t\t}\n\t\tif (d == Direction.LEFT || d == Direction.RIGHT) {\n\t\t\t// If the direction is left then we want to swap the points\n\t\t\t// to pretend like the direction was right (so the following code works)\n\t\t\tif (d == Direction.LEFT) {\n\t\t\t\tPoint tempP = p2;\n\t\t\t\tp2 = p1;\n\t\t\t\tp1 = tempP;\n\t\t\t}\n\t\t\t// Set the four corners\n\t\t\tpathSquares.add(new PathSquare(\"top-left\", new Point(p1.x, p1.y - sideOneOffset)));\n\t\t\tpathSquares.add(new PathSquare(\"bot-left\", new Point(p1.x, p1.y + sideTwoOffset)));\n\t\t\tpathSquares.add(new PathSquare(\"top-right\", new Point(p2.x, p1.y - sideOneOffset)));\n\t\t\tpathSquares.add(new PathSquare(\"bot-right\", new Point(p2.x, p1.y + sideTwoOffset)));\n\t\t\t// Set the left and right walls\n\t\t\tfor (int i = 0; i < width; i++) {\n\t\t\t\t// (i - width/2) ensures that p1.y is the center of the path (top to bottom)\n\t\t\t\tpathSquares.add(new PathSquare(\"left\", new Point(p1.x, p1.y + (i - width/2))));\n\t\t\t\tpathSquares.add(new PathSquare(\"right\", new Point(p2.x, p2.y + (i - width/2))));\n\t\t\t}\n\t\t\t// Set middle path and top/bottom padding (horizontal Oreo!)\n\t\t\tfor (int col = p1.x + 1, endCol = p2.x; col < endCol; col++) {\n\t\t\t\t// Add the top wafer\n\t\t\t\tpathSquares.add(new PathSquare(\"top\", new Point(col, p1.y - sideOneOffset)));\t\t\t\t\n\t\t\t\t// Add the delicious cream filling\n\t\t\t\tfor (int i = 0; i < width; i++) {\n\t\t\t\t\tpathSquares.add(new PathSquare(\"middle\", new Point(col, p1.y + (i - width /2))));\n\t\t\t\t}\t\t\t\t\n\t\t\t\t// Add the bottom wafer\n\t\t\t\tpathSquares.add(new PathSquare(\"bot\", new Point(col, p1.y + sideTwoOffset)));\n\t\t\t}\n\t\t} else {\n\t\t\t// If the direction is up then we want to swap the points\n\t\t\t// to pretend like the direction was down (so the following code works)\n\t\t\tif (d == Direction.UP) {\n\t\t\t\tPoint tempP = p2;\n\t\t\t\tp2 = p1;\n\t\t\t\tp1 = tempP;\n\t\t\t}\n\t\t\t// Set the four corners\n\t\t\tpathSquares.add(new PathSquare(\"top-left\", new Point(p1.x - sideOneOffset, p1.y)));\n\t\t\tpathSquares.add(new PathSquare(\"bot-left\", new Point(p2.x - sideOneOffset, p2.y)));\n\t\t\tpathSquares.add(new PathSquare(\"top-right\", new Point(p1.x + sideTwoOffset, p1.y)));\n\t\t\tpathSquares.add(new PathSquare(\"bot-right\", new Point(p2.x + sideTwoOffset, p2.y)));\n\t\t\t// Set the top and bottom walls\n\t\t\tfor (int i = 0; i < width; i++) {\n\t\t\t\t// (i - width/2) ensures that p1.x is the center of the path (left to right)\n\t\t\t\tpathSquares.add(new PathSquare(\"top\", new Point(p1.x + (i - width /2), p1.y)));\n\t\t\t\tpathSquares.add(new PathSquare(\"bot\", new Point(p2.x + (i - width /2), p2.y)));\n\t\t\t}\n\t\t\t// Set middle path and left/right padding (vertical Oreo!)\n\t\t\tfor (int row = p1.y + 1, endRow = p2.y; row < endRow; row++) {\n\t\t\t\t// Add the left wafer\n\t\t\t\tpathSquares.add(new PathSquare(\"left\", new Point(p1.x - sideOneOffset, row)));\t\t\t\t\n\t\t\t\t// Add the delicious cream filling\n\t\t\t\tfor (int i = 0; i < width; i++) {\n\t\t\t\t\tpathSquares.add(new PathSquare(\"middle\", new Point(p1.x + (i - width /2), row)));\n\t\t\t\t}\t\t\t\t\n\t\t\t\t// Add the right wafer\n\t\t\t\tpathSquares.add(new PathSquare(\"right\", new Point(p1.x + sideTwoOffset, row)));\t\t\t\t\n\t\t\t}\n\t\t}\n\t}", "@Override\n\tpublic void walk() {\n\t\t\n\t}", "public void renderCenterBlock(int cons, int side, int end)\r\n/* 143: */ {\r\n/* 144:135 */ if (cons == 0)\r\n/* 145: */ {\r\n/* 146:136 */ this.context.setTex(end);\r\n/* 147:137 */ doubleBox(63, 0.375F, 0.375F, 0.375F, 0.625F, 0.625F, 0.625F);\r\n/* 148:138 */ return;\r\n/* 149: */ }\r\n/* 150:139 */ if (cons == 3)\r\n/* 151: */ {\r\n/* 152:140 */ this.context.setTexFlags(1773);\r\n/* 153:141 */ this.context.setTex(end, end, side, side, side, side);\r\n/* 154:142 */ doubleBox(60, 0.375F, 0.0F, 0.375F, 0.625F, 1.0F, 0.625F);\r\n/* 155:143 */ return;\r\n/* 156: */ }\r\n/* 157:144 */ if (cons == 12)\r\n/* 158: */ {\r\n/* 159:145 */ this.context.setTexFlags(184365);\r\n/* 160:146 */ this.context.setTex(side, side, end, end, side, side);\r\n/* 161:147 */ doubleBox(51, 0.375F, 0.375F, 0.0F, 0.625F, 0.625F, 1.0F);\r\n/* 162:148 */ return;\r\n/* 163: */ }\r\n/* 164:149 */ if (cons == 48)\r\n/* 165: */ {\r\n/* 166:150 */ this.context.setTexFlags(187200);\r\n/* 167:151 */ this.context.setTex(side, side, side, side, end, end);\r\n/* 168:152 */ doubleBox(15, 0.0F, 0.375F, 0.375F, 1.0F, 0.625F, 0.625F);\r\n/* 169:153 */ return;\r\n/* 170: */ }\r\n/* 171:155 */ this.context.setTex(end);\r\n/* 172:156 */ doubleBox(0x3F ^ cons, 0.375F, 0.375F, 0.375F, 0.625F, 0.625F, 0.625F);\r\n/* 173:157 */ if ((cons & 0x1) > 0)\r\n/* 174: */ {\r\n/* 175:158 */ this.context.setTexFlags(1773);\r\n/* 176:159 */ this.context.setTex(end, end, side, side, side, side);\r\n/* 177:160 */ doubleBox(60, 0.375F, 0.0F, 0.375F, 0.625F, 0.375F, 0.625F);\r\n/* 178: */ }\r\n/* 179:162 */ if ((cons & 0x2) > 0)\r\n/* 180: */ {\r\n/* 181:163 */ this.context.setTexFlags(1773);\r\n/* 182:164 */ this.context.setTex(end, end, side, side, side, side);\r\n/* 183:165 */ doubleBox(60, 0.375F, 0.625F, 0.375F, 0.625F, 1.0F, 0.625F);\r\n/* 184: */ }\r\n/* 185:167 */ if ((cons & 0x4) > 0)\r\n/* 186: */ {\r\n/* 187:168 */ this.context.setTexFlags(184365);\r\n/* 188:169 */ this.context.setTex(side, side, end, end, side, side);\r\n/* 189:170 */ doubleBox(51, 0.375F, 0.375F, 0.0F, 0.625F, 0.625F, 0.375F);\r\n/* 190: */ }\r\n/* 191:172 */ if ((cons & 0x8) > 0)\r\n/* 192: */ {\r\n/* 193:173 */ this.context.setTexFlags(184365);\r\n/* 194:174 */ this.context.setTex(side, side, end, end, side, side);\r\n/* 195:175 */ doubleBox(51, 0.375F, 0.375F, 0.625F, 0.625F, 0.625F, 1.0F);\r\n/* 196: */ }\r\n/* 197:177 */ if ((cons & 0x10) > 0)\r\n/* 198: */ {\r\n/* 199:178 */ this.context.setTexFlags(187200);\r\n/* 200:179 */ this.context.setTex(side, side, side, side, end, end);\r\n/* 201:180 */ doubleBox(15, 0.0F, 0.375F, 0.375F, 0.375F, 0.625F, 0.625F);\r\n/* 202: */ }\r\n/* 203:182 */ if ((cons & 0x20) > 0)\r\n/* 204: */ {\r\n/* 205:183 */ this.context.setTexFlags(187200);\r\n/* 206:184 */ this.context.setTex(side, side, side, side, end, end);\r\n/* 207:185 */ doubleBox(15, 0.625F, 0.375F, 0.375F, 1.0F, 0.625F, 0.625F);\r\n/* 208: */ }\r\n/* 209: */ }", "double seBlesser();", "long getWidth();", "public int getWidth() {\r\n\treturn this.width;\r\n}", "private void render() {\n StringBuilder builder = new StringBuilder();\n builder.append(horizontalEdge).append(\"\\n\");\n for (int i = 0; i < this.height; i++) {\n builder.append(VERTICAL_CHAR);\n for (int j = 0; j < this.width; j++) {\n builder.append(pixels[i][j]);\n }\n builder.append(VERTICAL_CHAR);\n builder.append(\"\\n\");\n }\n builder.append(horizontalEdge);\n System.out.printf(builder.toString());\n }", "public void leerPlanesDietas();", "@Override\r\n public void draw()\r\n {\n\r\n }", "private void buildPath() {\r\n int xNext = 1;\r\n int yNext = map.getStartPos() + 1;\r\n CellLayered before = cells[yNext][xNext];\r\n while(true)\r\n {\r\n Byte[] xy = map.getDirection(xNext-1, yNext-1);\r\n xNext = xNext + xy[0];\r\n yNext = yNext + xy[1];\r\n\r\n CellLayered next = cells[yNext][xNext];\r\n\r\n if(xy[0]==-1)\r\n before.setRight(false);\r\n else\r\n before.setRight(true);\r\n before.setPath(true);\r\n if(next==null)\r\n break;\r\n\r\n before.setNextInPath(next);\r\n before = next;\r\n }\r\n }", "void block(Directions dir);", "public static void slashes() {\n\t\tSystem.out.println(\"//////////////////////\");\r\n\r\n\t}", "public String getRing();", "@Override\r\n\tpublic double perimeter() {\n\t\treturn 2*length*breadth;\r\n\t}", "public\nstatic\nvoid\nmain(String args[]) \n\n{ \n\nBinaryTree tree = \nnew\nBinaryTree(); \n\ntree.root = \nnew\nNode(\n20\n); \n\ntree.root.left = \nnew\nNode(\n8\n); \n\ntree.root.left.left = \nnew\nNode(\n4\n); \n\ntree.root.left.right = \nnew\nNode(\n12\n); \n\ntree.root.left.right.left = \nnew\nNode(\n10\n); \n\ntree.root.left.right.right = \nnew\nNode(\n14\n); \n\ntree.root.right = \nnew\nNode(\n22\n); \n\ntree.root.right.right = \nnew\nNode(\n25\n); \n\ntree.printBoundary(tree.root); \n\n}", "public int getEdgeCount() \n {\n return 3;\n }", "public int getWidth(){\n return width;\n }", "public int upright();", "protected int parent(int i) { return (i - 1) / 2; }", "@Override\n\tpublic void draw() {\n\n\t}", "@Override\n\tpublic void draw() {\n\n\t}", "protected int getWidth()\n\t{\n\t\treturn 0;\n\t}", "public int getDireccion(Pixel p) {\r\n\t\tif (x == p.x && y < p.y)\r\n\t\t\treturn DIR_N;\r\n\t\tif (x > p.x && y < p.y){\r\n\t\t\tdouble distancia = this.distancia(p);\r\n\t\t\tif (distancia <= 1){\r\n\t\t\t\treturn DIR_NE;\r\n\t\t\t}\r\n\t\t\telse{\r\n\t\t\t\tint distanciaX = Math.abs(x - p.x);\r\n\t\t\t\tint distanciaY = Math.abs(y - p.y);\r\n\t\t\t\tif (distanciaX == distanciaY)\r\n\t\t\t\t\treturn DIR_NE;\r\n\t\t\t\telse if (distanciaX > distanciaY)\r\n\t\t\t\t\treturn DIR_E;\r\n\t\t\t\telse \r\n\t\t\t\t\treturn DIR_N;\r\n\t\t\t}\r\n\t\t}\r\n\t\tif (x < p.x && y < p.y){\r\n\t\t\tdouble distancia = this.distancia(p);\r\n\t\t\tif (distancia <= 1){\r\n\t\t\t\treturn DIR_NO;\r\n\t\t\t}\r\n\t\t\telse{\r\n\t\t\t\tint distanciaX = Math.abs(x - p.x);\r\n\t\t\t\tint distanciaY = Math.abs(y - p.y);\r\n\t\t\t\tif (distanciaX == distanciaY)\r\n\t\t\t\t\treturn DIR_NO;\r\n\t\t\t\telse if (distanciaX > distanciaY)\r\n\t\t\t\t\treturn DIR_O;\r\n\t\t\t\telse \r\n\t\t\t\t\treturn DIR_N;\r\n\t\t\t}\r\n\t\t}\r\n\t\tif (x == p.x && y > p.y)\r\n\t\t\treturn DIR_S;\r\n\t\tif (x > p.x && y > p.y){\r\n\t\t\tdouble distancia = this.distancia(p);\r\n\t\t\tif (distancia <= 1){\r\n\t\t\t\treturn DIR_SE;\r\n\t\t\t}\r\n\t\t\telse{\r\n\t\t\t\tint distanciaX = Math.abs(x - p.x);\r\n\t\t\t\tint distanciaY = Math.abs(y - p.y);\r\n\t\t\t\tif (distanciaX == distanciaY)\r\n\t\t\t\t\treturn DIR_SE;\r\n\t\t\t\telse if (distanciaX > distanciaY)\r\n\t\t\t\t\treturn DIR_E;\r\n\t\t\t\telse \r\n\t\t\t\t\treturn DIR_S;\r\n\t\t\t}\r\n\t\t}\r\n\t\tif (x < p.x && y > p.y){\r\n\t\t\tdouble distancia = this.distancia(p);\r\n\t\t\tif (distancia <= 1){\r\n\t\t\t\treturn DIR_SO;\r\n\t\t\t}\r\n\t\t\telse{\r\n\t\t\t\tint distanciaX = Math.abs(x - p.x);\r\n\t\t\t\tint distanciaY = Math.abs(y - p.y);\r\n\t\t\t\tif (distanciaX == distanciaY)\r\n\t\t\t\t\treturn DIR_SO;\r\n\t\t\t\telse if (distanciaX > distanciaY)\r\n\t\t\t\t\treturn DIR_O;\r\n\t\t\t\telse \r\n\t\t\t\t\treturn DIR_S;\r\n\t\t\t}\r\n\t\t}\r\n\t\tif (x > p.x && y == p.y)\r\n\t\t\treturn DIR_E;\r\n\t\tif (x < p.x && y == p.y)\r\n\t\t\treturn DIR_O;\r\n\t\treturn -1;\r\n\t}", "private void renderPath(Node n)\n {\n\tGraphics g = getGraphics();\n\tboolean painting;\n\tColor nc,lc;\n\n\tpainting = (n.paths_passing==0);\n\twhile (n != null) {\n\t if (painting)\n\t\tn.paths_passing++;\n\t else {\n\t\tn.paths_passing--;\n\t }\n\t \n// \t nc = (n.paths_passing > 0)?hilitcolor:normalcolor;\n// \t lc = (n.paths_passing > 0)?hilitcolor:linecolor;\n\t nc = (n.paths_passing > 0)?n.path_color:normalcolor;\n\t lc = (n.paths_passing > 0)?n.path_color:linecolor;\n\t \n\t if (n.parent == null) {\n\t\tsetRenderColor(g,nc);\n\t\trenderNode(g,n);\n\t\tbreak;\n\t }\n\n\t // Double line width\n\t //setRenderColor(g,(n.paths_passing>0)?hilitcolor:Color.white);\n\t setRenderColor(g,(n.paths_passing>0)?n.path_color:Color.white);\n\t renderLine(g,n.x-1,n.y,n.parent.x-1,n.parent.y);\t\n\n\t setRenderColor(g,lc);\n\t renderLine(g,n.x,n.y,n.parent.x,n.parent.y);\n\n\t setRenderColor(g,nc);\n\t renderNode(g,n);\n\t n = n.parent;\n\t}\n }", "double volume() {\n\treturn width*height*depth;\n}", "void table(){\n fill(0);\n rect(width/2, height/2, 600, 350); // boarder\n fill(100, 0 ,0);\n rect(width/2, height/2, 550, 300); //Felt\n \n \n}", "public void snare();", "void ringBell() {\n\n }", "public static void main(String[] args) {\n\t\tint n=5;\n\t\tfor(int i=n-1;i>=0;i--)\n\t\t{\n\t\t\tfor(int space=0;space<n-1-i;space++)\n\t\t\t{\n\t\t\t\tSystem.out.print(\" \");\n\t\t\t}\n\t\t\tfor(int j=0;j<=i*2;j++)\n\t\t\t{\n\t\t\t\tSystem.out.print(\"* \");\n\t\t\t}\n\t\t\n\t\tSystem.out.println();\n\t}\n\n}", "private byte r() {\r\n\t\treturn (left_map == 0 ) ? (byte) 1 : 0;\r\n\t}", "public void skystonePos2() {\n }", "public int my_leaf_count();", "@Override\n\tpublic void draw3() {\n\n\t}" ]
[ "0.54567957", "0.53680295", "0.53644985", "0.52577376", "0.52142847", "0.51725817", "0.514088", "0.50868535", "0.5072305", "0.504888", "0.502662", "0.50005764", "0.49740013", "0.4944243", "0.4941118", "0.4937142", "0.49095523", "0.48940238", "0.48719338", "0.48613623", "0.48604724", "0.48558092", "0.48546165", "0.48490012", "0.4843668", "0.4843668", "0.48420057", "0.4839597", "0.4832105", "0.4817357", "0.481569", "0.48122767", "0.48085573", "0.48065376", "0.48032433", "0.48032212", "0.4799707", "0.4798766", "0.47978994", "0.47978172", "0.47921672", "0.47903922", "0.4790111", "0.47886384", "0.47843018", "0.47837785", "0.47828907", "0.47826976", "0.4776919", "0.47767594", "0.47767594", "0.47766045", "0.4764252", "0.47560593", "0.4753577", "0.4752732", "0.47510985", "0.47496924", "0.47485355", "0.4748455", "0.4746839", "0.4744132", "0.47203988", "0.4713808", "0.4711382", "0.47113234", "0.47096533", "0.47075558", "0.47029856", "0.4701444", "0.47014076", "0.46973658", "0.46969122", "0.4692372", "0.46897912", "0.4683049", "0.4681391", "0.46810925", "0.46750805", "0.46722633", "0.46681988", "0.466349", "0.46618745", "0.46606532", "0.46533036", "0.46485004", "0.46464643", "0.46447286", "0.46447286", "0.46438906", "0.46405315", "0.46397775", "0.4634643", "0.46339533", "0.4633923", "0.4632826", "0.4631328", "0.46299514", "0.46285036", "0.46276402", "0.4625902" ]
0.0
-1
/ / / / / / / / /
public List<? extends TypeMirror> getTypeMirrors() { /* 83 */ return this.types; /* */ }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private int parent(int i){return (i-1)/2;}", "private int leftChild(int i){return 2*i+1;}", "public void divide() {\n\t\t\n\t}", "private int rightChild(int i){return 2*i+2;}", "public void zeichneQuadrate(){\n for (int i=0; i<10;i++)\n rect (50+i*25,50,25,25);\n }", "public abstract void bepaalGrootte();", "public static void bottomHalf() {\n\n for(int i = 1; i <= SIZE; i++) {\n for(int j = 1; j <= i - 1; j++) {\n System.out.print(\" \");\n }\n \n\t System.out.print(\"\\\\_\");\n\t for(int j = 3*SIZE-i; j >= i; j--) {\n\t System.out.print(\"/\\\\\");\n\t }\n\t System.out.println(\"_/\");\n }\n }", "double passer();", "public String ring();", "int getWidth() {return width;}", "public void gored() {\n\t\t\n\t}", "public double getWidth() {\n return this.left.getLeft(0) - this.right.getRight(0); \n }", "private static Object[] newPath(int length, Object[] leaf) {\n Object[] node = leaf;\n for (int i = 0; i < length; i += 5) {\n node = new Object[] { node };\n }\n return node;\n }", "laptop(){\r\n length= 0 ;\r\n weight = 0;\r\n height = 0;\r\n width = 0;\r\n }", "public String toString(){ return \"DIV\";}", "public double getWidth() {\n return this.size * 2.0; \n }", "public void getTile_B8();", "public Integer getWidth(){return this.width;}", "public abstract String division();", "private double[] getExtents(){\n return new double[] { -90, -180, 90, 180 };\n }", "int width();", "private int leftChild(int index){\n\t\treturn (2*index) +1;\n\t}", "@Override\n public double getPerimiter() {\n return 4 * width;\n }", "private int get_right_child(int index){\r\n return 2 * index + 2;\r\n }", "@Override\n public void bfs() {\n\n }", "public double getWidth() { return _width<0? -_width : _width; }", "private void traverseBayeredPatternHalfSizeRGB(){\n int originalPositionX = 0;\n int originalPositionY = 1;\n\n for (int newX = 0; originalPositionX < originalImageHeight -1; newX++){\n for (int newY = 0; originalPositionY < originalImageWidth -1; newY++){\n Point newPosition = new Point(newX,newY);\n int newAbsoultPosition = getAbsolutPixelPosition(newPosition, originalImageHeight / 2, originalImageWidth / 2);\n halfSizePixRGB[newAbsoultPosition] = getAverageRGB(new Point(originalPositionX,originalPositionY));\n originalPositionY += 2;\n }\n originalPositionY = 0;\n originalPositionX += 2;\n }\n }", "@Override\npublic void processDirection() {\n\t\n}", "double volume(){\n return width*height*depth;\n }", "public double getWidth() {\n return this.getRight(this.tree.getRight(0)) - this.getLeft(this.tree.getLeft(0)); \n }", "public static void sizePathCompression(){\n\t\tint n = 10;\t\n\n\t\tdsf S = new dsf(n*n);\n\t\tMaze five = new Maze(n);\n\n\t\tRandom random;\n\t\tint sets = n*n;\t//number of sets in the DSF\n\t\tint randomNumber;\n\t\tint randomDirection;\n\t\tint row;\n\t\tint col;\n\n\t\tchar upperRight; \t//bottom or right\n\n\t\tS.print();\n\n\t\twhile(sets > 1){\n\t\t\trandom = new Random();\n\t\t\trandomNumber = random.nextInt((n*n) - 1);\n\t\t\t//System.out.println(\"RANDOM NUMBER: \"+randomNumber);\n\t\t\trow = randomNumber /n;\t//SWITCHED\n\t\t\tcol = randomNumber %n;\t//SWITCHED\n\t\t\trandomDirection = random.nextInt(2);\n\t\t\tString direct;\n\t\t\tif(randomDirection == 0)\n\t\t\t\tdirect = \"upper\";\n\t\t\telse\n\t\t\t\tdirect = \"right\";\n\t\t\t//System.out.println(\"RANDOM DIRECTI0N: \"+direct);\n\t\t\tupperRight = five.direction(randomDirection);\n\n\t\t\tif(upperRight == 'u'){\n\t\t\t\tif((randomNumber) < ((n*n)-n)){\n\t\t\t\t\tSystem.out.println(\"Sets: \"+sets);\n\t\t\t\t\tif(S.findAndCompress(randomNumber) != S.findAndCompress(randomNumber + n)){\n\t\t\t\t\t\tS.unionBySize(randomNumber+n, randomNumber);\n\t\t\t\t\t\tfive.remove_wall(col, row, 'u');\n\t\t\t\t\t\t//S.print();\n\t\t\t\t\t\tsets--;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif(upperRight == 'r'){\n\t\t\t\tif(((randomNumber)%(n*n)) != n-1){\n\t\t\t\t\tif(S.findAndCompress(randomNumber) != S.findAndCompress(randomNumber+1)){\n\t\t\t\t\t\tS.unionBySize(randomNumber, randomNumber+1);\n\t\t\t\t\t\tfive.remove_wall(col, row, 'r');\n\t\t\t\t\t\tS.print();\n\t\t\t\t\t\tsets--;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tbuildAdjacencyList(five, n);\n\t\tuserSelection_SolveMaze(n);\n\n\t\tStdDraw.show(0);\n\t\tfive.draw();\n\t\tfive.printCellNumbers();\t\n\t}", "public int generateRoshambo(){\n ;]\n\n }", "Operations operations();", "private void pointer(Graphics image,int x,int y,int height,int b,int dir) {\n\n\t\tint[] xt=new int[3];\n\t\tint[] yt=new int[3];\n\n\t\tif(dir==0) {\n\t\t\txt[0]=x;\n\t\t\txt[1]=xt[2]=x+height;\n\t\t\tyt[0]=y;\n\t\t\tyt[1]=y+b/2;\n\t\t\tyt[2]=y-b/2;\n\t\t} else {\n\t\t\txt[0]=x;\n\t\t\txt[1]=x+b/2;\n\t\t\txt[2]=x-b/2;\n\t\t\tyt[0]=y;\n\t\t\tyt[1]=yt[2]=y-height;\n\t\t}\n\t\timage.fillPolygon(xt,yt,3);\n\t}", "public int getEdgeCount() \n {\n return 3;\n }", "protected boolean\nshouldCompactPathLists()\n//\n////////////////////////////////////////////////////////////////////////\n{\n return true;\n}", "double getNewWidth();", "public int getWidth() {\r\n\treturn this.width;\r\n}", "long getWidth();", "public void SubRect(){\n\t\n}", "void mo33732Px();", "static void pyramid(){\n\t}", "public double getPerimiter(){return (2*height +2*width);}", "public int my_leaf_count();", "@Override\r\n\tpublic void walk() {\n\r\n\t}", "public void skystonePos4() {\n }", "public static void main(String[] args) {\n\n\n for(int a=0; a<7;a++){\n for(int b=0;b<7-a;b++){\n System.out.print(\" \");\n }\n for(int c=0; c<=a;c++){\n System.out.print(\"* \");\n }\n System.out.println(\" \");\n }\n\n }", "void walk() {\n\t\t\n\t}", "int[] union(int s1,int t1,int s2,int t2)\r\n\t{\r\n\t\tint [] st=new int[2];\r\n\t\t//Please fill in the program here\r\n\t\tst[0] = incCapacity();\r\n\t\taddEdge(st[0], epssymbol, s1);\r\n\t\taddEdge(st[0], epssymbol, s2);\r\n\t\tst[1] = incCapacity();\r\n\t\taddEdge(t1, epssymbol, st[1]);\r\n\t\taddEdge(t2, epssymbol, st[1]);\r\n\r\n\t\treturn st;\r\n\t}", "public static void main(String[] args) {\n\t\tScanner obj=new Scanner(System.in);\r\n\t\tint a=0;\r\n\t\tint count=0;\r\n System.out.println(\"enter size\");\r\n\t\ta=obj.nextInt();\r\n\t\tint m=2*a+1;\r\n\t\tint n=2*a+2;\r\n\t\tint mid=(m+1)/2;\r\n\t\tfor(int i=1;i<=m;i++)\r\n\t\t{\r\n\t\t\tcount=0;\r\n\t\t\tfor(int j=1;j<=n;j++)\r\n\t\t\t{\r\n\t\t\t\tcount++;\r\n\t\t\t\tif((i==1)||(i==m)||(j==1)||(j==n))//frame begin\r\n\t\t\t\t{\r\n\t\t\t\t\tif((i==1)||(i==m))\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tif((j==1)||(j==n))\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\tSystem.out.print(\"+\");\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\telse\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\tSystem.out.print(\"-\");\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tif((j==1)||(j==n))\r\n\t {\r\n\t\t\t\t\t\t\tSystem.out.print(\"|\");//frame left and right\r\n\t }\r\n\t\t\t\t\t}\r\n\t\t\t\t}//frame end\r\n\t\t\t\telse if (i<mid)//upper-half\r\n\t\t\t\t{\r\n\t\t\t\t\tif(count<=2)\r\n\t\t\t\t\t{\r\n\t\t\t\t for(int k=mid;k>i;k--)\r\n\t\t\t\t {\r\n\t\t\t\t\tSystem.out.print(\" \");\r\n\t\t\t\t }\r\n\t\t\t\t System.out.print(\"/\");\r\n\t\t\t\t for(int l=1;l<=2*i-4;l++)\r\n\t\t\t\t {\r\n\t\t\t\t\t if(i%2==0)\r\n\t\t\t\t\t {\r\n\t\t\t\t\t\t System.out.print(\"=\");\r\n\t\t\t\t\t }\r\n\t\t\t\t\t else\r\n\t\t\t\t\t {\r\n\t\t\t\t\t\t System.out.print(\"-\");\r\n\t\t\t\t\t }\r\n\t\t\t\t }\r\n\t\t\t\tSystem.out.print(\"\\\\\");\r\n\t\t\t\t for(int k=mid;k>i;k--)\r\n\t\t\t\t {\r\n\t\t\t\t\t System.out.print(\" \");\r\n\t\t\t\t }\r\n\t\t\t\t\t}\r\n\t\t\t\t}//end of upper half\r\n\t\t\t\telse if(i>mid)//lower half\r\n\t\t\t\t{\r\n\t\t\t\t\tif(count<=2)\r\n\t\t\t\t\t{\r\n\t\t\t\t\tfor(int k=mid;k<i;k++)\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tSystem.out.print(\" \");\r\n\t\t\t\t\t}\r\n\t\t\t\t\t System.out.print(\"\\\\\");\r\n\t\t\t\t\t for(int l=2*m-6;l>2*i-4;l--)\r\n\t\t\t\t\t {\r\n\t\t\t\t\t\t if(i%2==0)\r\n\t\t\t\t\t\t {\r\n\t\t\t\t\t\t\t System.out.print(\"=\");\r\n\t\t\t\t\t\t }\r\n\t\t\t\t\t\t else\r\n\t\t\t\t\t\t {\r\n\t\t\t\t\t\t\t System.out.print(\"-\");\r\n\t\t\t\t\t\t } \r\n\t\t\t\t\t }\r\n\t\t\t\t\t System.out.print(\"/\");\r\n\t\t\t\t\t for(int k=mid;k<i;k++)\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\tSystem.out.print(\" \");\r\n\t\t\t\t\t\t}\r\n\t\t\t }\r\n\t\t\t\t\t}//end of lower half\r\n\t\t\t\telse if(i==mid)//middle part\r\n\t\t\t\t{\r\n\t\t\t\t\tif(j==2)\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tSystem.out.print(\"<\");\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse if(j==n-1)\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tSystem.out.print(\">\");\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tif(i%2==0)\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\tSystem.out.print(\"=\");\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\telse\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\tSystem.out.print(\"-\");\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}//end\r\n\t\t\t}//end-of-j\r\n\t\t\tSystem.out.println();\r\n\t\t}//end\r\n\r\n\t}", "public void foundLeaf(int width, int height, int level, int currX, int currY, int location) {\n level = level +2;\n if (location == 1) {\n\n\n canvas.addLine(currX - (new Double(spatialWidth / Math.pow(2, level))).intValue(),\n (currY + (new Double(spatialHeight / Math.pow(2, level ))).intValue()) - ( (new Double(spatialHeight / Math.pow(2, level ))).intValue()),\n currX - (new Double(spatialWidth / Math.pow(2, level ))).intValue(),\n currY * 2,\n Color.BLACK);\n\n\n canvas.addLine(((currX - (new Double(spatialWidth / Math.pow(2, level))).intValue())) - (new Double(spatialWidth / Math.pow(2, level ))).intValue(),\n currY + (new Double(spatialHeight / Math.pow(2, level ))).intValue(), \n currX,\n currY + (new Double(spatialHeight / Math.pow(2, level ))).intValue(),\n Color.BLACK);\n\n\n\n }\n\n if (location == 2) {\n\n\n canvas.addLine(currX + (new Double(spatialWidth / Math.pow(2, level ))).intValue(),\n (currY + (new Double(spatialHeight / Math.pow(2, level))).intValue()) - (new Double(spatialHeight / Math.pow(2, level))).intValue(),\n currX + (new Double(spatialWidth / Math.pow(2, level))).intValue(),\n ( currY + (new Double(spatialHeight / Math.pow(2, level ))).intValue()) + (new Double(spatialHeight / Math.pow(2, level ))).intValue(),\n Color.black);\n\n canvas.addLine((currX + (new Double(spatialWidth / Math.pow(2, level ))).intValue()) - (new Double(spatialWidth / Math.pow(2, level ))).intValue(),\n currY + (new Double(spatialHeight / Math.pow(2, level ))).intValue(),\n (currX + (new Double(spatialWidth / Math.pow(2, level ))).intValue()) + (new Double(spatialWidth / Math.pow(2, level ))).intValue(),\n currY + (new Double(spatialHeight / Math.pow(2, level ))).intValue(),\n Color.black);\n\n\n\n }\n\n if (location == 3) {\n\n canvas.addLine(currX - (new Double(spatialWidth / Math.pow(2, level ))).intValue(),\n (currY - (new Double(spatialHeight / Math.pow(2, level ))).intValue()) - (new Double(spatialHeight / Math.pow(2, level ))).intValue(),\n currX - (new Double(spatialWidth / Math.pow(2, level))).intValue(),\n currY,\n Color.BLACK);\n\n\n\n canvas.addLine((currX - (new Double(spatialWidth / Math.pow(2, level))).intValue()) - (new Double(spatialWidth / Math.pow(2, level ))).intValue(),\n\tcurrY - (new Double(spatialHeight / Math.pow(2, level ))).intValue(), \n (currX - (new Double(spatialWidth / Math.pow(2, level ))).intValue()) + (new Double(spatialWidth / Math.pow(2, level))).intValue(),\n currY - (new Double(spatialHeight / Math.pow(2, level ))).intValue(),\n Color.BLACK);\n\n\n }\n\n if (location == 4) {\n\n\n canvas.addLine(currX + (new Double(spatialWidth / Math.pow(2, level ))).intValue(),\n (currY - (new Double(spatialHeight / Math.pow(2, level))).intValue()) - (new Double(spatialHeight / Math.pow(2, level))).intValue(),\n currX + (new Double(spatialWidth / Math.pow(2, level ))).intValue(),\n currY,\n Color.BLACK);\n\n\n canvas.addLine((currX + (new Double(spatialWidth / Math.pow(2, level))).intValue()) - (new Double(spatialWidth / Math.pow(2, level ))).intValue(),\n currY - (new Double(spatialHeight / Math.pow(2, level ))).intValue(),\n currX + (new Double(spatialWidth / Math.pow(2, level ))).intValue() + (new Double(spatialWidth / Math.pow(2, level))).intValue(),\n currY - (new Double(spatialHeight / Math.pow(2, level ))).intValue(), Color.BLACK);\n\n\n }\n\n\n\n\n }", "private static void breadcrumbArrow(int width, int height, int indent, int c1, int c2) {\n\n\t\tdouble x0 = 0, y0 = height / 2d;\n\t\tdouble x1 = indent, y1 = 0;\n\t\tdouble x2 = indent, y2 = height / 2d;\n\t\tdouble x3 = indent, y3 = height;\n\t\tdouble x4 = width, y4 = 0;\n\t\tdouble x5 = width, y5 = height / 2d;\n\t\tdouble x6 = width, y6 = height;\n\t\tdouble x7 = indent + width, y7 = 0;\n\t\tdouble x8 = indent + width, y8 = height;\n\n\t\tint fc1 = ColorHelper.mixAlphaColors(c1, c2, 0);\n\t\tint fc2 = ColorHelper.mixAlphaColors(c1, c2, (indent)/(width + 2f * indent));\n\t\tint fc3 = ColorHelper.mixAlphaColors(c1, c2, (indent + width)/(width + 2f * indent));\n\t\tint fc4 = ColorHelper.mixAlphaColors(c1, c2, 1);\n\n\t\tRenderSystem.disableTexture();\n\t\tRenderSystem.enableBlend();\n\t\tRenderSystem.disableAlphaTest();\n\t\tRenderSystem.defaultBlendFunc();\n\t\tRenderSystem.shadeModel(GL11.GL_SMOOTH);\n\n\t\tTessellator tessellator = Tessellator.getInstance();\n\t\tBufferBuilder bufferbuilder = tessellator.getBuffer();\n\t\tbufferbuilder.begin(GL11.GL_TRIANGLES, DefaultVertexFormats.POSITION_COLOR);\n\n\t\tbufferbuilder.vertex(x0, y0, 0).color(fc1 >> 16 & 0xFF, fc1 >> 8 & 0xFF, fc1 & 0xFF, fc1 >> 24 & 0xFF).endVertex();\n\t\tbufferbuilder.vertex(x1, y1, 0).color(fc2 >> 16 & 0xFF, fc2 >> 8 & 0xFF, fc2 & 0xFF, fc2 >> 24 & 0xFF).endVertex();\n\t\tbufferbuilder.vertex(x2, y2, 0).color(fc2 >> 16 & 0xFF, fc2 >> 8 & 0xFF, fc2 & 0xFF, fc2 >> 24 & 0xFF).endVertex();\n\n\t\tbufferbuilder.vertex(x0, y0, 0).color(fc1 >> 16 & 0xFF, fc1 >> 8 & 0xFF, fc1 & 0xFF, fc1 >> 24 & 0xFF).endVertex();\n\t\tbufferbuilder.vertex(x2, y2, 0).color(fc2 >> 16 & 0xFF, fc2 >> 8 & 0xFF, fc2 & 0xFF, fc2 >> 24 & 0xFF).endVertex();\n\t\tbufferbuilder.vertex(x3, y3, 0).color(fc2 >> 16 & 0xFF, fc2 >> 8 & 0xFF, fc2 & 0xFF, fc2 >> 24 & 0xFF).endVertex();\n\n\t\tbufferbuilder.vertex(x3, y3, 0).color(fc2 >> 16 & 0xFF, fc2 >> 8 & 0xFF, fc2 & 0xFF, fc2 >> 24 & 0xFF).endVertex();\n\t\tbufferbuilder.vertex(x1, y1, 0).color(fc2 >> 16 & 0xFF, fc2 >> 8 & 0xFF, fc2 & 0xFF, fc2 >> 24 & 0xFF).endVertex();\n\t\tbufferbuilder.vertex(x4, y4, 0).color(fc3 >> 16 & 0xFF, fc3 >> 8 & 0xFF, fc3 & 0xFF, fc3 >> 24 & 0xFF).endVertex();\n\n\t\tbufferbuilder.vertex(x3, y3, 0).color(fc2 >> 16 & 0xFF, fc2 >> 8 & 0xFF, fc2 & 0xFF, fc2 >> 24 & 0xFF).endVertex();\n\t\tbufferbuilder.vertex(x4, y4, 0).color(fc3 >> 16 & 0xFF, fc3 >> 8 & 0xFF, fc3 & 0xFF, fc3 >> 24 & 0xFF).endVertex();\n\t\tbufferbuilder.vertex(x6, y6, 0).color(fc3 >> 16 & 0xFF, fc3 >> 8 & 0xFF, fc3 & 0xFF, fc3 >> 24 & 0xFF).endVertex();\n\n\t\tbufferbuilder.vertex(x5, y5, 0).color(fc3 >> 16 & 0xFF, fc3 >> 8 & 0xFF, fc3 & 0xFF, fc3 >> 24 & 0xFF).endVertex();\n\t\tbufferbuilder.vertex(x4, y4, 0).color(fc3 >> 16 & 0xFF, fc3 >> 8 & 0xFF, fc3 & 0xFF, fc3 >> 24 & 0xFF).endVertex();\n\t\tbufferbuilder.vertex(x7, y7, 0).color(fc4 >> 16 & 0xFF, fc4 >> 8 & 0xFF, fc4 & 0xFF, fc4 >> 24 & 0xFF).endVertex();\n\n\t\tbufferbuilder.vertex(x6, y6, 0).color(fc3 >> 16 & 0xFF, fc3 >> 8 & 0xFF, fc3 & 0xFF, fc3 >> 24 & 0xFF).endVertex();\n\t\tbufferbuilder.vertex(x5, y5, 0).color(fc3 >> 16 & 0xFF, fc3 >> 8 & 0xFF, fc3 & 0xFF, fc3 >> 24 & 0xFF).endVertex();\n\t\tbufferbuilder.vertex(x8, y8, 0).color(fc4 >> 16 & 0xFF, fc4 >> 8 & 0xFF, fc4 & 0xFF, fc4 >> 24 & 0xFF).endVertex();\n\n\t\ttessellator.draw();\n\t\tRenderSystem.shadeModel(GL11.GL_FLAT);\n\t\tRenderSystem.disableBlend();\n\t\tRenderSystem.enableAlphaTest();\n\t\tRenderSystem.enableTexture();\n\t}", "double seBlesser();", "void sharpen();", "void sharpen();", "public static void unionPathCompression(){\n\t\tint n = 10;\t\n\n\t\tdsf S = new dsf(n*n);\n\t\tMaze two = new Maze(n);\n\n\t\tRandom random;\n\t\tint sets = n*n;\t//number of sets in the DSF\n\t\tint randomNumber;\n\t\tint randomDirection;\n\t\tint row;\n\t\tint col;\n\n\t\tchar upperRight; \t//bottom or right\n\n\t\tS.print();\n\n\t\twhile(sets > 1){\n\t\t\trandom = new Random();\n\t\t\trandomNumber = random.nextInt((n*n) - 1);\n\t\t\t//System.out.println(\"RANDOM NUMBER: \"+randomNumber);\n\t\t\trow = randomNumber /n;\t//SWITCHED\n\t\t\tcol = randomNumber %n;\t//SWITCHED\n\t\t\trandomDirection = random.nextInt(2);\n\t\t\tString direct;\n\t\t\tif(randomDirection == 0)\n\t\t\t\tdirect = \"upper\";\n\t\t\telse\n\t\t\t\tdirect = \"right\";\n\t\t\tSystem.out.println(\"RANDOM DIRECTI0N: \"+direct);\n\t\t\tupperRight = two.direction(randomDirection);\n\n\t\t\tif(upperRight == 'u'){\n\t\t\t\tif((randomNumber) < ((n*n)-n)){\n\t\t\t\t\tSystem.out.println(\"Sets: \"+sets);\n\t\t\t\t\tif(S.findAndCompress(randomNumber+n) != S.findAndCompress(randomNumber)){\n\t\t\t\t\t\tS.union(randomNumber+n, randomNumber);\n\t\t\t\t\t\ttwo.remove_wall(col, row, 'u');\n\t\t\t\t\t\tS.print();\n\t\t\t\t\t\tsets--;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif(upperRight == 'r'){\n\t\t\t\tif(((randomNumber)%(n*n)) != n-1){\n\t\t\t\t\tif(S.findAndCompress(randomNumber) != S.findAndCompress(randomNumber+1)){\n\t\t\t\t\t\tS.union(randomNumber, randomNumber+1);\n\t\t\t\t\t\ttwo.remove_wall(col, row, 'r');\n\t\t\t\t\t\tS.print();\n\t\t\t\t\t\tsets--;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tbuildAdjacencyList(two, n);\n\t\tuserSelection_SolveMaze(n);\n\n\n\t\tStdDraw.show(0);\n\t\ttwo.draw();\n\t\ttwo.printCellNumbers();\n\t}", "Parallelogram(){\n length = width = height = 0;\n }", "private int get_left_child(int index){\r\n return 2 * index + 1;\r\n }", "public void leerPlanesDietas();", "public String getRing();", "static int getNumPatterns() { return 64; }", "private void traversePath()\n\t{\n\t\trobot.forward(50);\n\t\trobot.right(90);\n\t\trobot.forward(50);\n\t\trobot.right(90);\n\t\trobot.forward(50);\n\t\trobot.left(90);\n\t\trobot.forward(50);\n\t\trobot.left(90);\n\t}", "double Volume(){\r\n return Height * Width * Depth;\r\n }", "public int getWidth(){\n return width;\n }", "@Override\n\tpublic void walk() {\n\t\t\n\t}", "public void lowerFlatbed(){\n flatbed.lowerFlatbed();\n }", "double getPerimeter(){\n return 2*height+width;\n }", "private int get_parent(int index){\r\n return (index-1)/2;\r\n }", "protected int parent(int i) { return (i - 1) / 2; }", "protected int getWidth()\n\t{\n\t\treturn 0;\n\t}", "public static String makeShapeA() {\n\tString result = \"\";\n\t\tfor (int i = 0; i < 8 ; i++) {\n\t\t\tresult+=printHash(i);\n\t\t\t\n\t\t}return result;\n\t\t\t//System.out.println(printHash(i));\n\t\t}", "@Override\n protected int mapSize() {\n return left.size()+right.size()-hidden.size();\n }", "private void e()\r\n/* 273: */ {\r\n/* 274:278 */ this.r = false;\r\n/* 275:279 */ this.s = false;\r\n/* 276:280 */ this.t = false;\r\n/* 277:281 */ this.u = false;\r\n/* 278:282 */ this.v = false;\r\n/* 279: */ }", "@Override\n public String toString()\n {\n\treturn getClass().getSimpleName() + \" (\" + getLength() + \"x\" + getWidth() + \")\";\n }", "public abstract double getBaseWidth();", "public void stg() {\n\n\t}", "@Override\n\tpublic void draw() {\n\t\t\n\t}", "@Override\n\tpublic void draw() {\n\t\t\n\t}", "@Override\n\tpublic float getWidth() {\n\t\treturn 26;\n\t}", "@Override\r\n\tpublic double perimeter() {\n\t\treturn 2*length*breadth;\r\n\t}", "void doubleBox(int sides, float x1, float y1, float z1, float x2, float y2, float z2)\r\n/* 100: */ {\r\n/* 101: 99 */ int s2 = sides << 1 & 0x2A | sides >> 1 & 0x15;\r\n/* 102: */ \r\n/* 103:101 */ this.context.renderBox(sides, x1, y1, z1, x2, y2, z2);\r\n/* 104:102 */ this.context.renderBox(s2, x2, y2, z2, x1, y1, z1);\r\n/* 105: */ }", "public void draw(){\n for(int i = 1; i <= height; i++){\n for(int s = 1; s <= i; s++)\n System.out.print(\"*\");\n System.out.println();\n }\n }", "int fi(int x, int y) {\n\t\treturn (x + 1) + (width + 2) * (y + 1);\n\t}", "int expand();", "private byte r() {\r\n\t\treturn (left_map == 0 ) ? (byte) 1 : 0;\r\n\t}", "public static void main(String[] args) {\n\t\tfor(int j=0;j<8;j++){\n\t\t\tfor(int i=0;i<8;i++){\n\t\t\t\t//上下两侧\n\t\t\t\tif(j==0||j==7){\n\t\t\t\t\tSystem.out.print(\"*\");\n\t\t\t\t}else{\n\t\t\t\t\t//中间\n\t\t\t\t\tif(i>0&&i<7){\n\t\t\t\t\t\tSystem.out.print(\" \");\n\t\t\t\t\t}else{\n\t\t\t\t\t\tSystem.out.print(\"*\");\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t\t\n\t\t\t}\n\t\t\tSystem.out.println();\n\t\t}\n\t}", "public void draw4x4 (char design){\n System.out.println(\"\"+design+design+design+design);\n System.out.println(design+\" \"+design);\n System.out.println(design+\" \"+design);\n System.out.println(\"\"+design+design+design+design);\n}", "@Override\n protected void paint2d(Graphics2D g) {\n \n }", "public int upright();", "int getTribeSize();", "int getWidth1();", "int getR();", "String directsTo();", "public int getWidth()\n {return width;}", "@Override\r\n\tpublic int getWidth() {\n\t\treturn 0;\r\n\t}", "int depth();", "int depth();", "public\nstatic\nvoid\nmain(String args[]) \n\n{ \n\nBinaryTree tree = \nnew\nBinaryTree(); \n\ntree.root = \nnew\nNode(\n20\n); \n\ntree.root.left = \nnew\nNode(\n8\n); \n\ntree.root.left.left = \nnew\nNode(\n4\n); \n\ntree.root.left.right = \nnew\nNode(\n12\n); \n\ntree.root.left.right.left = \nnew\nNode(\n10\n); \n\ntree.root.left.right.right = \nnew\nNode(\n14\n); \n\ntree.root.right = \nnew\nNode(\n22\n); \n\ntree.root.right.right = \nnew\nNode(\n25\n); \n\ntree.printBoundary(tree.root); \n\n}", "public void renderCenterBlock(int cons, int side, int end)\r\n/* 143: */ {\r\n/* 144:135 */ if (cons == 0)\r\n/* 145: */ {\r\n/* 146:136 */ this.context.setTex(end);\r\n/* 147:137 */ doubleBox(63, 0.375F, 0.375F, 0.375F, 0.625F, 0.625F, 0.625F);\r\n/* 148:138 */ return;\r\n/* 149: */ }\r\n/* 150:139 */ if (cons == 3)\r\n/* 151: */ {\r\n/* 152:140 */ this.context.setTexFlags(1773);\r\n/* 153:141 */ this.context.setTex(end, end, side, side, side, side);\r\n/* 154:142 */ doubleBox(60, 0.375F, 0.0F, 0.375F, 0.625F, 1.0F, 0.625F);\r\n/* 155:143 */ return;\r\n/* 156: */ }\r\n/* 157:144 */ if (cons == 12)\r\n/* 158: */ {\r\n/* 159:145 */ this.context.setTexFlags(184365);\r\n/* 160:146 */ this.context.setTex(side, side, end, end, side, side);\r\n/* 161:147 */ doubleBox(51, 0.375F, 0.375F, 0.0F, 0.625F, 0.625F, 1.0F);\r\n/* 162:148 */ return;\r\n/* 163: */ }\r\n/* 164:149 */ if (cons == 48)\r\n/* 165: */ {\r\n/* 166:150 */ this.context.setTexFlags(187200);\r\n/* 167:151 */ this.context.setTex(side, side, side, side, end, end);\r\n/* 168:152 */ doubleBox(15, 0.0F, 0.375F, 0.375F, 1.0F, 0.625F, 0.625F);\r\n/* 169:153 */ return;\r\n/* 170: */ }\r\n/* 171:155 */ this.context.setTex(end);\r\n/* 172:156 */ doubleBox(0x3F ^ cons, 0.375F, 0.375F, 0.375F, 0.625F, 0.625F, 0.625F);\r\n/* 173:157 */ if ((cons & 0x1) > 0)\r\n/* 174: */ {\r\n/* 175:158 */ this.context.setTexFlags(1773);\r\n/* 176:159 */ this.context.setTex(end, end, side, side, side, side);\r\n/* 177:160 */ doubleBox(60, 0.375F, 0.0F, 0.375F, 0.625F, 0.375F, 0.625F);\r\n/* 178: */ }\r\n/* 179:162 */ if ((cons & 0x2) > 0)\r\n/* 180: */ {\r\n/* 181:163 */ this.context.setTexFlags(1773);\r\n/* 182:164 */ this.context.setTex(end, end, side, side, side, side);\r\n/* 183:165 */ doubleBox(60, 0.375F, 0.625F, 0.375F, 0.625F, 1.0F, 0.625F);\r\n/* 184: */ }\r\n/* 185:167 */ if ((cons & 0x4) > 0)\r\n/* 186: */ {\r\n/* 187:168 */ this.context.setTexFlags(184365);\r\n/* 188:169 */ this.context.setTex(side, side, end, end, side, side);\r\n/* 189:170 */ doubleBox(51, 0.375F, 0.375F, 0.0F, 0.625F, 0.625F, 0.375F);\r\n/* 190: */ }\r\n/* 191:172 */ if ((cons & 0x8) > 0)\r\n/* 192: */ {\r\n/* 193:173 */ this.context.setTexFlags(184365);\r\n/* 194:174 */ this.context.setTex(side, side, end, end, side, side);\r\n/* 195:175 */ doubleBox(51, 0.375F, 0.375F, 0.625F, 0.625F, 0.625F, 1.0F);\r\n/* 196: */ }\r\n/* 197:177 */ if ((cons & 0x10) > 0)\r\n/* 198: */ {\r\n/* 199:178 */ this.context.setTexFlags(187200);\r\n/* 200:179 */ this.context.setTex(side, side, side, side, end, end);\r\n/* 201:180 */ doubleBox(15, 0.0F, 0.375F, 0.375F, 0.375F, 0.625F, 0.625F);\r\n/* 202: */ }\r\n/* 203:182 */ if ((cons & 0x20) > 0)\r\n/* 204: */ {\r\n/* 205:183 */ this.context.setTexFlags(187200);\r\n/* 206:184 */ this.context.setTex(side, side, side, side, end, end);\r\n/* 207:185 */ doubleBox(15, 0.625F, 0.375F, 0.375F, 1.0F, 0.625F, 0.625F);\r\n/* 208: */ }\r\n/* 209: */ }", "double getWidth();", "double getWidth();" ]
[ "0.5531016", "0.54378587", "0.52516115", "0.52405924", "0.5151045", "0.5127977", "0.50680465", "0.5066997", "0.50218964", "0.5013022", "0.5007318", "0.50048536", "0.49997565", "0.4994835", "0.49735898", "0.49699947", "0.49680406", "0.49594593", "0.4937881", "0.49361676", "0.49287266", "0.4884688", "0.4874051", "0.4871873", "0.48511675", "0.48435977", "0.48318782", "0.48268357", "0.48253223", "0.48089546", "0.4805502", "0.48046046", "0.4803564", "0.48035362", "0.47987092", "0.47966656", "0.47941628", "0.47918317", "0.4789212", "0.4783637", "0.47747543", "0.4774159", "0.47730577", "0.47666246", "0.47664872", "0.47615", "0.4755131", "0.47543177", "0.47509375", "0.47481856", "0.47429588", "0.47421312", "0.47413164", "0.47407025", "0.47407025", "0.47362685", "0.47353023", "0.47351807", "0.47331676", "0.47328842", "0.47319365", "0.4729934", "0.47290468", "0.47287467", "0.47275317", "0.47259426", "0.47239763", "0.4723621", "0.4715134", "0.47056246", "0.47034666", "0.47034577", "0.4701833", "0.46977103", "0.46967983", "0.46885592", "0.46881223", "0.46881223", "0.4685835", "0.4677769", "0.46758488", "0.46741006", "0.46703368", "0.46684504", "0.4664061", "0.4664013", "0.46639267", "0.46607205", "0.4659042", "0.46581274", "0.4656714", "0.46495056", "0.464903", "0.4648408", "0.46467063", "0.4643833", "0.4643833", "0.46426296", "0.46422264", "0.4639917", "0.4639917" ]
0.0
-1
/ / / / / /
private void readObject(ObjectInputStream paramObjectInputStream) throws IOException, ClassNotFoundException { /* 91 */ paramObjectInputStream.defaultReadObject(); /* 92 */ this.types = null; /* */ }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void divide() {\n\t\t\n\t}", "private int parent(int i){return (i-1)/2;}", "private int leftChild(int i){return 2*i+1;}", "public void zeichneQuadrate(){\n for (int i=0; i<10;i++)\n rect (50+i*25,50,25,25);\n }", "public abstract void bepaalGrootte();", "public static void bottomHalf() {\n\n for(int i = 1; i <= SIZE; i++) {\n for(int j = 1; j <= i - 1; j++) {\n System.out.print(\" \");\n }\n \n\t System.out.print(\"\\\\_\");\n\t for(int j = 3*SIZE-i; j >= i; j--) {\n\t System.out.print(\"/\\\\\");\n\t }\n\t System.out.println(\"_/\");\n }\n }", "private int rightChild(int i){return 2*i+2;}", "public void gored() {\n\t\t\n\t}", "double passer();", "public abstract String division();", "public String ring();", "laptop(){\r\n length= 0 ;\r\n weight = 0;\r\n height = 0;\r\n width = 0;\r\n }", "public String toString(){ return \"DIV\";}", "private void pointer(Graphics image,int x,int y,int height,int b,int dir) {\n\n\t\tint[] xt=new int[3];\n\t\tint[] yt=new int[3];\n\n\t\tif(dir==0) {\n\t\t\txt[0]=x;\n\t\t\txt[1]=xt[2]=x+height;\n\t\t\tyt[0]=y;\n\t\t\tyt[1]=y+b/2;\n\t\t\tyt[2]=y-b/2;\n\t\t} else {\n\t\t\txt[0]=x;\n\t\t\txt[1]=x+b/2;\n\t\t\txt[2]=x-b/2;\n\t\t\tyt[0]=y;\n\t\t\tyt[1]=yt[2]=y-height;\n\t\t}\n\t\timage.fillPolygon(xt,yt,3);\n\t}", "public static void main(String[] args) {\n\n\n for(int a=0; a<7;a++){\n for(int b=0;b<7-a;b++){\n System.out.print(\" \");\n }\n for(int c=0; c<=a;c++){\n System.out.print(\"* \");\n }\n System.out.println(\" \");\n }\n\n }", "void sharpen();", "void sharpen();", "public double getWidth() {\n return this.left.getLeft(0) - this.right.getRight(0); \n }", "static void pyramid(){\n\t}", "int getWidth() {return width;}", "Operations operations();", "private static void breadcrumbArrow(int width, int height, int indent, int c1, int c2) {\n\n\t\tdouble x0 = 0, y0 = height / 2d;\n\t\tdouble x1 = indent, y1 = 0;\n\t\tdouble x2 = indent, y2 = height / 2d;\n\t\tdouble x3 = indent, y3 = height;\n\t\tdouble x4 = width, y4 = 0;\n\t\tdouble x5 = width, y5 = height / 2d;\n\t\tdouble x6 = width, y6 = height;\n\t\tdouble x7 = indent + width, y7 = 0;\n\t\tdouble x8 = indent + width, y8 = height;\n\n\t\tint fc1 = ColorHelper.mixAlphaColors(c1, c2, 0);\n\t\tint fc2 = ColorHelper.mixAlphaColors(c1, c2, (indent)/(width + 2f * indent));\n\t\tint fc3 = ColorHelper.mixAlphaColors(c1, c2, (indent + width)/(width + 2f * indent));\n\t\tint fc4 = ColorHelper.mixAlphaColors(c1, c2, 1);\n\n\t\tRenderSystem.disableTexture();\n\t\tRenderSystem.enableBlend();\n\t\tRenderSystem.disableAlphaTest();\n\t\tRenderSystem.defaultBlendFunc();\n\t\tRenderSystem.shadeModel(GL11.GL_SMOOTH);\n\n\t\tTessellator tessellator = Tessellator.getInstance();\n\t\tBufferBuilder bufferbuilder = tessellator.getBuffer();\n\t\tbufferbuilder.begin(GL11.GL_TRIANGLES, DefaultVertexFormats.POSITION_COLOR);\n\n\t\tbufferbuilder.vertex(x0, y0, 0).color(fc1 >> 16 & 0xFF, fc1 >> 8 & 0xFF, fc1 & 0xFF, fc1 >> 24 & 0xFF).endVertex();\n\t\tbufferbuilder.vertex(x1, y1, 0).color(fc2 >> 16 & 0xFF, fc2 >> 8 & 0xFF, fc2 & 0xFF, fc2 >> 24 & 0xFF).endVertex();\n\t\tbufferbuilder.vertex(x2, y2, 0).color(fc2 >> 16 & 0xFF, fc2 >> 8 & 0xFF, fc2 & 0xFF, fc2 >> 24 & 0xFF).endVertex();\n\n\t\tbufferbuilder.vertex(x0, y0, 0).color(fc1 >> 16 & 0xFF, fc1 >> 8 & 0xFF, fc1 & 0xFF, fc1 >> 24 & 0xFF).endVertex();\n\t\tbufferbuilder.vertex(x2, y2, 0).color(fc2 >> 16 & 0xFF, fc2 >> 8 & 0xFF, fc2 & 0xFF, fc2 >> 24 & 0xFF).endVertex();\n\t\tbufferbuilder.vertex(x3, y3, 0).color(fc2 >> 16 & 0xFF, fc2 >> 8 & 0xFF, fc2 & 0xFF, fc2 >> 24 & 0xFF).endVertex();\n\n\t\tbufferbuilder.vertex(x3, y3, 0).color(fc2 >> 16 & 0xFF, fc2 >> 8 & 0xFF, fc2 & 0xFF, fc2 >> 24 & 0xFF).endVertex();\n\t\tbufferbuilder.vertex(x1, y1, 0).color(fc2 >> 16 & 0xFF, fc2 >> 8 & 0xFF, fc2 & 0xFF, fc2 >> 24 & 0xFF).endVertex();\n\t\tbufferbuilder.vertex(x4, y4, 0).color(fc3 >> 16 & 0xFF, fc3 >> 8 & 0xFF, fc3 & 0xFF, fc3 >> 24 & 0xFF).endVertex();\n\n\t\tbufferbuilder.vertex(x3, y3, 0).color(fc2 >> 16 & 0xFF, fc2 >> 8 & 0xFF, fc2 & 0xFF, fc2 >> 24 & 0xFF).endVertex();\n\t\tbufferbuilder.vertex(x4, y4, 0).color(fc3 >> 16 & 0xFF, fc3 >> 8 & 0xFF, fc3 & 0xFF, fc3 >> 24 & 0xFF).endVertex();\n\t\tbufferbuilder.vertex(x6, y6, 0).color(fc3 >> 16 & 0xFF, fc3 >> 8 & 0xFF, fc3 & 0xFF, fc3 >> 24 & 0xFF).endVertex();\n\n\t\tbufferbuilder.vertex(x5, y5, 0).color(fc3 >> 16 & 0xFF, fc3 >> 8 & 0xFF, fc3 & 0xFF, fc3 >> 24 & 0xFF).endVertex();\n\t\tbufferbuilder.vertex(x4, y4, 0).color(fc3 >> 16 & 0xFF, fc3 >> 8 & 0xFF, fc3 & 0xFF, fc3 >> 24 & 0xFF).endVertex();\n\t\tbufferbuilder.vertex(x7, y7, 0).color(fc4 >> 16 & 0xFF, fc4 >> 8 & 0xFF, fc4 & 0xFF, fc4 >> 24 & 0xFF).endVertex();\n\n\t\tbufferbuilder.vertex(x6, y6, 0).color(fc3 >> 16 & 0xFF, fc3 >> 8 & 0xFF, fc3 & 0xFF, fc3 >> 24 & 0xFF).endVertex();\n\t\tbufferbuilder.vertex(x5, y5, 0).color(fc3 >> 16 & 0xFF, fc3 >> 8 & 0xFF, fc3 & 0xFF, fc3 >> 24 & 0xFF).endVertex();\n\t\tbufferbuilder.vertex(x8, y8, 0).color(fc4 >> 16 & 0xFF, fc4 >> 8 & 0xFF, fc4 & 0xFF, fc4 >> 24 & 0xFF).endVertex();\n\n\t\ttessellator.draw();\n\t\tRenderSystem.shadeModel(GL11.GL_FLAT);\n\t\tRenderSystem.disableBlend();\n\t\tRenderSystem.enableAlphaTest();\n\t\tRenderSystem.enableTexture();\n\t}", "double volume(){\n return width*height*depth;\n }", "@Override\n public void bfs() {\n\n }", "void mo33732Px();", "private static Object[] newPath(int length, Object[] leaf) {\n Object[] node = leaf;\n for (int i = 0; i < length; i += 5) {\n node = new Object[] { node };\n }\n return node;\n }", "public static void slashes() {\n\t\tSystem.out.println(\"//////////////////////\");\r\n\r\n\t}", "public void stg() {\n\n\t}", "public void skystonePos4() {\n }", "public int generateRoshambo(){\n ;]\n\n }", "public void draw(){\n for(int i = 1; i <= height; i++){\n for(int s = 1; s <= i; s++)\n System.out.print(\"*\");\n System.out.println();\n }\n }", "public void getTile_B8();", "int width();", "public static void main(String[] args) {\n\t\tfor(int j=0;j<8;j++){\n\t\t\tfor(int i=0;i<8;i++){\n\t\t\t\t//上下两侧\n\t\t\t\tif(j==0||j==7){\n\t\t\t\t\tSystem.out.print(\"*\");\n\t\t\t\t}else{\n\t\t\t\t\t//中间\n\t\t\t\t\tif(i>0&&i<7){\n\t\t\t\t\t\tSystem.out.print(\" \");\n\t\t\t\t\t}else{\n\t\t\t\t\t\tSystem.out.print(\"*\");\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t\t\n\t\t\t}\n\t\t\tSystem.out.println();\n\t\t}\n\t}", "public static void unionPathCompression(){\n\t\tint n = 10;\t\n\n\t\tdsf S = new dsf(n*n);\n\t\tMaze two = new Maze(n);\n\n\t\tRandom random;\n\t\tint sets = n*n;\t//number of sets in the DSF\n\t\tint randomNumber;\n\t\tint randomDirection;\n\t\tint row;\n\t\tint col;\n\n\t\tchar upperRight; \t//bottom or right\n\n\t\tS.print();\n\n\t\twhile(sets > 1){\n\t\t\trandom = new Random();\n\t\t\trandomNumber = random.nextInt((n*n) - 1);\n\t\t\t//System.out.println(\"RANDOM NUMBER: \"+randomNumber);\n\t\t\trow = randomNumber /n;\t//SWITCHED\n\t\t\tcol = randomNumber %n;\t//SWITCHED\n\t\t\trandomDirection = random.nextInt(2);\n\t\t\tString direct;\n\t\t\tif(randomDirection == 0)\n\t\t\t\tdirect = \"upper\";\n\t\t\telse\n\t\t\t\tdirect = \"right\";\n\t\t\tSystem.out.println(\"RANDOM DIRECTI0N: \"+direct);\n\t\t\tupperRight = two.direction(randomDirection);\n\n\t\t\tif(upperRight == 'u'){\n\t\t\t\tif((randomNumber) < ((n*n)-n)){\n\t\t\t\t\tSystem.out.println(\"Sets: \"+sets);\n\t\t\t\t\tif(S.findAndCompress(randomNumber+n) != S.findAndCompress(randomNumber)){\n\t\t\t\t\t\tS.union(randomNumber+n, randomNumber);\n\t\t\t\t\t\ttwo.remove_wall(col, row, 'u');\n\t\t\t\t\t\tS.print();\n\t\t\t\t\t\tsets--;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif(upperRight == 'r'){\n\t\t\t\tif(((randomNumber)%(n*n)) != n-1){\n\t\t\t\t\tif(S.findAndCompress(randomNumber) != S.findAndCompress(randomNumber+1)){\n\t\t\t\t\t\tS.union(randomNumber, randomNumber+1);\n\t\t\t\t\t\ttwo.remove_wall(col, row, 'r');\n\t\t\t\t\t\tS.print();\n\t\t\t\t\t\tsets--;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tbuildAdjacencyList(two, n);\n\t\tuserSelection_SolveMaze(n);\n\n\n\t\tStdDraw.show(0);\n\t\ttwo.draw();\n\t\ttwo.printCellNumbers();\n\t}", "public static void part2(){\n\t\n System.out.println(\"\\\\\"); //Outer wall\n System.out.println(\"\\\\\");\n System.out.println(\"\\\\\");\n for(int i = 0; i <= 16; i++){ //loop created to display top of the door\n\n \tSystem.out.print(\"-\");\n\n\t}\n System.out.println(\"\");\n System.out.println(\"\\\\\\t\\t| \\t(\\\")\"); //The door and the stick figure\n System.out.println(\"\\\\\\t\\t|\\t-|-\");\n System.out.println(\"\\\\\\t o | \\t |\");\n System.out.println(\"\\\\\\t\\t|\\t /\\\\\");\n System.out.println(\"\\\\\\t\\t|\\t/ \\\\\");\n\t\t\n }", "private void e()\r\n/* 273: */ {\r\n/* 274:278 */ this.r = false;\r\n/* 275:279 */ this.s = false;\r\n/* 276:280 */ this.t = false;\r\n/* 277:281 */ this.u = false;\r\n/* 278:282 */ this.v = false;\r\n/* 279: */ }", "@Override\n\tpublic void draw() {\n\t\t\n\t}", "@Override\n\tpublic void draw() {\n\t\t\n\t}", "protected boolean\nshouldCompactPathLists()\n//\n////////////////////////////////////////////////////////////////////////\n{\n return true;\n}", "Parallelogram(){\n length = width = height = 0;\n }", "private void traversePath()\n\t{\n\t\trobot.forward(50);\n\t\trobot.right(90);\n\t\trobot.forward(50);\n\t\trobot.right(90);\n\t\trobot.forward(50);\n\t\trobot.left(90);\n\t\trobot.forward(50);\n\t\trobot.left(90);\n\t}", "public static void main(String[] args) {\n\t\tScanner obj=new Scanner(System.in);\r\n\t\tint a=0;\r\n\t\tint count=0;\r\n System.out.println(\"enter size\");\r\n\t\ta=obj.nextInt();\r\n\t\tint m=2*a+1;\r\n\t\tint n=2*a+2;\r\n\t\tint mid=(m+1)/2;\r\n\t\tfor(int i=1;i<=m;i++)\r\n\t\t{\r\n\t\t\tcount=0;\r\n\t\t\tfor(int j=1;j<=n;j++)\r\n\t\t\t{\r\n\t\t\t\tcount++;\r\n\t\t\t\tif((i==1)||(i==m)||(j==1)||(j==n))//frame begin\r\n\t\t\t\t{\r\n\t\t\t\t\tif((i==1)||(i==m))\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tif((j==1)||(j==n))\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\tSystem.out.print(\"+\");\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\telse\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\tSystem.out.print(\"-\");\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tif((j==1)||(j==n))\r\n\t {\r\n\t\t\t\t\t\t\tSystem.out.print(\"|\");//frame left and right\r\n\t }\r\n\t\t\t\t\t}\r\n\t\t\t\t}//frame end\r\n\t\t\t\telse if (i<mid)//upper-half\r\n\t\t\t\t{\r\n\t\t\t\t\tif(count<=2)\r\n\t\t\t\t\t{\r\n\t\t\t\t for(int k=mid;k>i;k--)\r\n\t\t\t\t {\r\n\t\t\t\t\tSystem.out.print(\" \");\r\n\t\t\t\t }\r\n\t\t\t\t System.out.print(\"/\");\r\n\t\t\t\t for(int l=1;l<=2*i-4;l++)\r\n\t\t\t\t {\r\n\t\t\t\t\t if(i%2==0)\r\n\t\t\t\t\t {\r\n\t\t\t\t\t\t System.out.print(\"=\");\r\n\t\t\t\t\t }\r\n\t\t\t\t\t else\r\n\t\t\t\t\t {\r\n\t\t\t\t\t\t System.out.print(\"-\");\r\n\t\t\t\t\t }\r\n\t\t\t\t }\r\n\t\t\t\tSystem.out.print(\"\\\\\");\r\n\t\t\t\t for(int k=mid;k>i;k--)\r\n\t\t\t\t {\r\n\t\t\t\t\t System.out.print(\" \");\r\n\t\t\t\t }\r\n\t\t\t\t\t}\r\n\t\t\t\t}//end of upper half\r\n\t\t\t\telse if(i>mid)//lower half\r\n\t\t\t\t{\r\n\t\t\t\t\tif(count<=2)\r\n\t\t\t\t\t{\r\n\t\t\t\t\tfor(int k=mid;k<i;k++)\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tSystem.out.print(\" \");\r\n\t\t\t\t\t}\r\n\t\t\t\t\t System.out.print(\"\\\\\");\r\n\t\t\t\t\t for(int l=2*m-6;l>2*i-4;l--)\r\n\t\t\t\t\t {\r\n\t\t\t\t\t\t if(i%2==0)\r\n\t\t\t\t\t\t {\r\n\t\t\t\t\t\t\t System.out.print(\"=\");\r\n\t\t\t\t\t\t }\r\n\t\t\t\t\t\t else\r\n\t\t\t\t\t\t {\r\n\t\t\t\t\t\t\t System.out.print(\"-\");\r\n\t\t\t\t\t\t } \r\n\t\t\t\t\t }\r\n\t\t\t\t\t System.out.print(\"/\");\r\n\t\t\t\t\t for(int k=mid;k<i;k++)\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\tSystem.out.print(\" \");\r\n\t\t\t\t\t\t}\r\n\t\t\t }\r\n\t\t\t\t\t}//end of lower half\r\n\t\t\t\telse if(i==mid)//middle part\r\n\t\t\t\t{\r\n\t\t\t\t\tif(j==2)\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tSystem.out.print(\"<\");\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse if(j==n-1)\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tSystem.out.print(\">\");\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tif(i%2==0)\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\tSystem.out.print(\"=\");\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\telse\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\tSystem.out.print(\"-\");\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}//end\r\n\t\t\t}//end-of-j\r\n\t\t\tSystem.out.println();\r\n\t\t}//end\r\n\r\n\t}", "public double getWidth() {\n return this.size * 2.0; \n }", "private void traverseBayeredPatternHalfSizeRGB(){\n int originalPositionX = 0;\n int originalPositionY = 1;\n\n for (int newX = 0; originalPositionX < originalImageHeight -1; newX++){\n for (int newY = 0; originalPositionY < originalImageWidth -1; newY++){\n Point newPosition = new Point(newX,newY);\n int newAbsoultPosition = getAbsolutPixelPosition(newPosition, originalImageHeight / 2, originalImageWidth / 2);\n halfSizePixRGB[newAbsoultPosition] = getAverageRGB(new Point(originalPositionX,originalPositionY));\n originalPositionY += 2;\n }\n originalPositionY = 0;\n originalPositionX += 2;\n }\n }", "@Override\npublic void processDirection() {\n\t\n}", "void walk() {\n\t\t\n\t}", "void doubleBox(int sides, float x1, float y1, float z1, float x2, float y2, float z2)\r\n/* 100: */ {\r\n/* 101: 99 */ int s2 = sides << 1 & 0x2A | sides >> 1 & 0x15;\r\n/* 102: */ \r\n/* 103:101 */ this.context.renderBox(sides, x1, y1, z1, x2, y2, z2);\r\n/* 104:102 */ this.context.renderBox(s2, x2, y2, z2, x1, y1, z1);\r\n/* 105: */ }", "public void SubRect(){\n\t\n}", "public void division() {\n\t\tx=1;\n\t\ty=0;\n\t\tz=x/y;\n\t\t\t\t\n\t}", "public void foundLeaf(int width, int height, int level, int currX, int currY, int location) {\n level = level +2;\n if (location == 1) {\n\n\n canvas.addLine(currX - (new Double(spatialWidth / Math.pow(2, level))).intValue(),\n (currY + (new Double(spatialHeight / Math.pow(2, level ))).intValue()) - ( (new Double(spatialHeight / Math.pow(2, level ))).intValue()),\n currX - (new Double(spatialWidth / Math.pow(2, level ))).intValue(),\n currY * 2,\n Color.BLACK);\n\n\n canvas.addLine(((currX - (new Double(spatialWidth / Math.pow(2, level))).intValue())) - (new Double(spatialWidth / Math.pow(2, level ))).intValue(),\n currY + (new Double(spatialHeight / Math.pow(2, level ))).intValue(), \n currX,\n currY + (new Double(spatialHeight / Math.pow(2, level ))).intValue(),\n Color.BLACK);\n\n\n\n }\n\n if (location == 2) {\n\n\n canvas.addLine(currX + (new Double(spatialWidth / Math.pow(2, level ))).intValue(),\n (currY + (new Double(spatialHeight / Math.pow(2, level))).intValue()) - (new Double(spatialHeight / Math.pow(2, level))).intValue(),\n currX + (new Double(spatialWidth / Math.pow(2, level))).intValue(),\n ( currY + (new Double(spatialHeight / Math.pow(2, level ))).intValue()) + (new Double(spatialHeight / Math.pow(2, level ))).intValue(),\n Color.black);\n\n canvas.addLine((currX + (new Double(spatialWidth / Math.pow(2, level ))).intValue()) - (new Double(spatialWidth / Math.pow(2, level ))).intValue(),\n currY + (new Double(spatialHeight / Math.pow(2, level ))).intValue(),\n (currX + (new Double(spatialWidth / Math.pow(2, level ))).intValue()) + (new Double(spatialWidth / Math.pow(2, level ))).intValue(),\n currY + (new Double(spatialHeight / Math.pow(2, level ))).intValue(),\n Color.black);\n\n\n\n }\n\n if (location == 3) {\n\n canvas.addLine(currX - (new Double(spatialWidth / Math.pow(2, level ))).intValue(),\n (currY - (new Double(spatialHeight / Math.pow(2, level ))).intValue()) - (new Double(spatialHeight / Math.pow(2, level ))).intValue(),\n currX - (new Double(spatialWidth / Math.pow(2, level))).intValue(),\n currY,\n Color.BLACK);\n\n\n\n canvas.addLine((currX - (new Double(spatialWidth / Math.pow(2, level))).intValue()) - (new Double(spatialWidth / Math.pow(2, level ))).intValue(),\n\tcurrY - (new Double(spatialHeight / Math.pow(2, level ))).intValue(), \n (currX - (new Double(spatialWidth / Math.pow(2, level ))).intValue()) + (new Double(spatialWidth / Math.pow(2, level))).intValue(),\n currY - (new Double(spatialHeight / Math.pow(2, level ))).intValue(),\n Color.BLACK);\n\n\n }\n\n if (location == 4) {\n\n\n canvas.addLine(currX + (new Double(spatialWidth / Math.pow(2, level ))).intValue(),\n (currY - (new Double(spatialHeight / Math.pow(2, level))).intValue()) - (new Double(spatialHeight / Math.pow(2, level))).intValue(),\n currX + (new Double(spatialWidth / Math.pow(2, level ))).intValue(),\n currY,\n Color.BLACK);\n\n\n canvas.addLine((currX + (new Double(spatialWidth / Math.pow(2, level))).intValue()) - (new Double(spatialWidth / Math.pow(2, level ))).intValue(),\n currY - (new Double(spatialHeight / Math.pow(2, level ))).intValue(),\n currX + (new Double(spatialWidth / Math.pow(2, level ))).intValue() + (new Double(spatialWidth / Math.pow(2, level))).intValue(),\n currY - (new Double(spatialHeight / Math.pow(2, level ))).intValue(), Color.BLACK);\n\n\n }\n\n\n\n\n }", "@Override\n public double getPerimiter() {\n return 4 * width;\n }", "public double getWidth() { return _width<0? -_width : _width; }", "public static void sizePathCompression(){\n\t\tint n = 10;\t\n\n\t\tdsf S = new dsf(n*n);\n\t\tMaze five = new Maze(n);\n\n\t\tRandom random;\n\t\tint sets = n*n;\t//number of sets in the DSF\n\t\tint randomNumber;\n\t\tint randomDirection;\n\t\tint row;\n\t\tint col;\n\n\t\tchar upperRight; \t//bottom or right\n\n\t\tS.print();\n\n\t\twhile(sets > 1){\n\t\t\trandom = new Random();\n\t\t\trandomNumber = random.nextInt((n*n) - 1);\n\t\t\t//System.out.println(\"RANDOM NUMBER: \"+randomNumber);\n\t\t\trow = randomNumber /n;\t//SWITCHED\n\t\t\tcol = randomNumber %n;\t//SWITCHED\n\t\t\trandomDirection = random.nextInt(2);\n\t\t\tString direct;\n\t\t\tif(randomDirection == 0)\n\t\t\t\tdirect = \"upper\";\n\t\t\telse\n\t\t\t\tdirect = \"right\";\n\t\t\t//System.out.println(\"RANDOM DIRECTI0N: \"+direct);\n\t\t\tupperRight = five.direction(randomDirection);\n\n\t\t\tif(upperRight == 'u'){\n\t\t\t\tif((randomNumber) < ((n*n)-n)){\n\t\t\t\t\tSystem.out.println(\"Sets: \"+sets);\n\t\t\t\t\tif(S.findAndCompress(randomNumber) != S.findAndCompress(randomNumber + n)){\n\t\t\t\t\t\tS.unionBySize(randomNumber+n, randomNumber);\n\t\t\t\t\t\tfive.remove_wall(col, row, 'u');\n\t\t\t\t\t\t//S.print();\n\t\t\t\t\t\tsets--;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif(upperRight == 'r'){\n\t\t\t\tif(((randomNumber)%(n*n)) != n-1){\n\t\t\t\t\tif(S.findAndCompress(randomNumber) != S.findAndCompress(randomNumber+1)){\n\t\t\t\t\t\tS.unionBySize(randomNumber, randomNumber+1);\n\t\t\t\t\t\tfive.remove_wall(col, row, 'r');\n\t\t\t\t\t\tS.print();\n\t\t\t\t\t\tsets--;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tbuildAdjacencyList(five, n);\n\t\tuserSelection_SolveMaze(n);\n\n\t\tStdDraw.show(0);\n\t\tfive.draw();\n\t\tfive.printCellNumbers();\t\n\t}", "double getPerimeter(){\n return 2*height+width;\n }", "double Volume(){\r\n return Height * Width * Depth;\r\n }", "public Integer getWidth(){return this.width;}", "@Override\n protected void paint2d(Graphics2D g) {\n \n }", "private void createPath(Direction d, int width, Point p1, Point p2) {\n\t\t// Determine how far away from the center the corners are\n\t\tint sideOneOffset = 0;\t// Top or Left depending on path direction\n\t\tint sideTwoOffset = 0;\t// Bot or Right depending on path direction\n\t\t// If the width is odd, balance the offsets\n\t\tif (width % 2 != 0) {\t\n\t\t\tsideOneOffset = sideTwoOffset = ((width / 2) + 1);\n\t\t} else {\n\t\t\t// If the width is even, the offsets will be off by 1\n\t\t\tsideOneOffset = width;\n\t\t\tsideTwoOffset = width - 1;\n\t\t}\n\t\tif (d == Direction.LEFT || d == Direction.RIGHT) {\n\t\t\t// If the direction is left then we want to swap the points\n\t\t\t// to pretend like the direction was right (so the following code works)\n\t\t\tif (d == Direction.LEFT) {\n\t\t\t\tPoint tempP = p2;\n\t\t\t\tp2 = p1;\n\t\t\t\tp1 = tempP;\n\t\t\t}\n\t\t\t// Set the four corners\n\t\t\tpathSquares.add(new PathSquare(\"top-left\", new Point(p1.x, p1.y - sideOneOffset)));\n\t\t\tpathSquares.add(new PathSquare(\"bot-left\", new Point(p1.x, p1.y + sideTwoOffset)));\n\t\t\tpathSquares.add(new PathSquare(\"top-right\", new Point(p2.x, p1.y - sideOneOffset)));\n\t\t\tpathSquares.add(new PathSquare(\"bot-right\", new Point(p2.x, p1.y + sideTwoOffset)));\n\t\t\t// Set the left and right walls\n\t\t\tfor (int i = 0; i < width; i++) {\n\t\t\t\t// (i - width/2) ensures that p1.y is the center of the path (top to bottom)\n\t\t\t\tpathSquares.add(new PathSquare(\"left\", new Point(p1.x, p1.y + (i - width/2))));\n\t\t\t\tpathSquares.add(new PathSquare(\"right\", new Point(p2.x, p2.y + (i - width/2))));\n\t\t\t}\n\t\t\t// Set middle path and top/bottom padding (horizontal Oreo!)\n\t\t\tfor (int col = p1.x + 1, endCol = p2.x; col < endCol; col++) {\n\t\t\t\t// Add the top wafer\n\t\t\t\tpathSquares.add(new PathSquare(\"top\", new Point(col, p1.y - sideOneOffset)));\t\t\t\t\n\t\t\t\t// Add the delicious cream filling\n\t\t\t\tfor (int i = 0; i < width; i++) {\n\t\t\t\t\tpathSquares.add(new PathSquare(\"middle\", new Point(col, p1.y + (i - width /2))));\n\t\t\t\t}\t\t\t\t\n\t\t\t\t// Add the bottom wafer\n\t\t\t\tpathSquares.add(new PathSquare(\"bot\", new Point(col, p1.y + sideTwoOffset)));\n\t\t\t}\n\t\t} else {\n\t\t\t// If the direction is up then we want to swap the points\n\t\t\t// to pretend like the direction was down (so the following code works)\n\t\t\tif (d == Direction.UP) {\n\t\t\t\tPoint tempP = p2;\n\t\t\t\tp2 = p1;\n\t\t\t\tp1 = tempP;\n\t\t\t}\n\t\t\t// Set the four corners\n\t\t\tpathSquares.add(new PathSquare(\"top-left\", new Point(p1.x - sideOneOffset, p1.y)));\n\t\t\tpathSquares.add(new PathSquare(\"bot-left\", new Point(p2.x - sideOneOffset, p2.y)));\n\t\t\tpathSquares.add(new PathSquare(\"top-right\", new Point(p1.x + sideTwoOffset, p1.y)));\n\t\t\tpathSquares.add(new PathSquare(\"bot-right\", new Point(p2.x + sideTwoOffset, p2.y)));\n\t\t\t// Set the top and bottom walls\n\t\t\tfor (int i = 0; i < width; i++) {\n\t\t\t\t// (i - width/2) ensures that p1.x is the center of the path (left to right)\n\t\t\t\tpathSquares.add(new PathSquare(\"top\", new Point(p1.x + (i - width /2), p1.y)));\n\t\t\t\tpathSquares.add(new PathSquare(\"bot\", new Point(p2.x + (i - width /2), p2.y)));\n\t\t\t}\n\t\t\t// Set middle path and left/right padding (vertical Oreo!)\n\t\t\tfor (int row = p1.y + 1, endRow = p2.y; row < endRow; row++) {\n\t\t\t\t// Add the left wafer\n\t\t\t\tpathSquares.add(new PathSquare(\"left\", new Point(p1.x - sideOneOffset, row)));\t\t\t\t\n\t\t\t\t// Add the delicious cream filling\n\t\t\t\tfor (int i = 0; i < width; i++) {\n\t\t\t\t\tpathSquares.add(new PathSquare(\"middle\", new Point(p1.x + (i - width /2), row)));\n\t\t\t\t}\t\t\t\t\n\t\t\t\t// Add the right wafer\n\t\t\t\tpathSquares.add(new PathSquare(\"right\", new Point(p1.x + sideTwoOffset, row)));\t\t\t\t\n\t\t\t}\n\t\t}\n\t}", "public void draw4x4 (char design){\n System.out.println(\"\"+design+design+design+design);\n System.out.println(design+\" \"+design);\n System.out.println(design+\" \"+design);\n System.out.println(\"\"+design+design+design+design);\n}", "private double[] getExtents(){\n return new double[] { -90, -180, 90, 180 };\n }", "public void renderCenterBlock(int cons, int side, int end)\r\n/* 143: */ {\r\n/* 144:135 */ if (cons == 0)\r\n/* 145: */ {\r\n/* 146:136 */ this.context.setTex(end);\r\n/* 147:137 */ doubleBox(63, 0.375F, 0.375F, 0.375F, 0.625F, 0.625F, 0.625F);\r\n/* 148:138 */ return;\r\n/* 149: */ }\r\n/* 150:139 */ if (cons == 3)\r\n/* 151: */ {\r\n/* 152:140 */ this.context.setTexFlags(1773);\r\n/* 153:141 */ this.context.setTex(end, end, side, side, side, side);\r\n/* 154:142 */ doubleBox(60, 0.375F, 0.0F, 0.375F, 0.625F, 1.0F, 0.625F);\r\n/* 155:143 */ return;\r\n/* 156: */ }\r\n/* 157:144 */ if (cons == 12)\r\n/* 158: */ {\r\n/* 159:145 */ this.context.setTexFlags(184365);\r\n/* 160:146 */ this.context.setTex(side, side, end, end, side, side);\r\n/* 161:147 */ doubleBox(51, 0.375F, 0.375F, 0.0F, 0.625F, 0.625F, 1.0F);\r\n/* 162:148 */ return;\r\n/* 163: */ }\r\n/* 164:149 */ if (cons == 48)\r\n/* 165: */ {\r\n/* 166:150 */ this.context.setTexFlags(187200);\r\n/* 167:151 */ this.context.setTex(side, side, side, side, end, end);\r\n/* 168:152 */ doubleBox(15, 0.0F, 0.375F, 0.375F, 1.0F, 0.625F, 0.625F);\r\n/* 169:153 */ return;\r\n/* 170: */ }\r\n/* 171:155 */ this.context.setTex(end);\r\n/* 172:156 */ doubleBox(0x3F ^ cons, 0.375F, 0.375F, 0.375F, 0.625F, 0.625F, 0.625F);\r\n/* 173:157 */ if ((cons & 0x1) > 0)\r\n/* 174: */ {\r\n/* 175:158 */ this.context.setTexFlags(1773);\r\n/* 176:159 */ this.context.setTex(end, end, side, side, side, side);\r\n/* 177:160 */ doubleBox(60, 0.375F, 0.0F, 0.375F, 0.625F, 0.375F, 0.625F);\r\n/* 178: */ }\r\n/* 179:162 */ if ((cons & 0x2) > 0)\r\n/* 180: */ {\r\n/* 181:163 */ this.context.setTexFlags(1773);\r\n/* 182:164 */ this.context.setTex(end, end, side, side, side, side);\r\n/* 183:165 */ doubleBox(60, 0.375F, 0.625F, 0.375F, 0.625F, 1.0F, 0.625F);\r\n/* 184: */ }\r\n/* 185:167 */ if ((cons & 0x4) > 0)\r\n/* 186: */ {\r\n/* 187:168 */ this.context.setTexFlags(184365);\r\n/* 188:169 */ this.context.setTex(side, side, end, end, side, side);\r\n/* 189:170 */ doubleBox(51, 0.375F, 0.375F, 0.0F, 0.625F, 0.625F, 0.375F);\r\n/* 190: */ }\r\n/* 191:172 */ if ((cons & 0x8) > 0)\r\n/* 192: */ {\r\n/* 193:173 */ this.context.setTexFlags(184365);\r\n/* 194:174 */ this.context.setTex(side, side, end, end, side, side);\r\n/* 195:175 */ doubleBox(51, 0.375F, 0.375F, 0.625F, 0.625F, 0.625F, 1.0F);\r\n/* 196: */ }\r\n/* 197:177 */ if ((cons & 0x10) > 0)\r\n/* 198: */ {\r\n/* 199:178 */ this.context.setTexFlags(187200);\r\n/* 200:179 */ this.context.setTex(side, side, side, side, end, end);\r\n/* 201:180 */ doubleBox(15, 0.0F, 0.375F, 0.375F, 0.375F, 0.625F, 0.625F);\r\n/* 202: */ }\r\n/* 203:182 */ if ((cons & 0x20) > 0)\r\n/* 204: */ {\r\n/* 205:183 */ this.context.setTexFlags(187200);\r\n/* 206:184 */ this.context.setTex(side, side, side, side, end, end);\r\n/* 207:185 */ doubleBox(15, 0.625F, 0.375F, 0.375F, 1.0F, 0.625F, 0.625F);\r\n/* 208: */ }\r\n/* 209: */ }", "int[] union(int s1,int t1,int s2,int t2)\r\n\t{\r\n\t\tint [] st=new int[2];\r\n\t\t//Please fill in the program here\r\n\t\tst[0] = incCapacity();\r\n\t\taddEdge(st[0], epssymbol, s1);\r\n\t\taddEdge(st[0], epssymbol, s2);\r\n\t\tst[1] = incCapacity();\r\n\t\taddEdge(t1, epssymbol, st[1]);\r\n\t\taddEdge(t2, epssymbol, st[1]);\r\n\r\n\t\treturn st;\r\n\t}", "public double getPerimiter(){return (2*height +2*width);}", "int fi(int x, int y) {\n\t\treturn (x + 1) + (width + 2) * (y + 1);\n\t}", "void ringBell() {\n\n }", "public static String makeShapeA() {\n\tString result = \"\";\n\t\tfor (int i = 0; i < 8 ; i++) {\n\t\t\tresult+=printHash(i);\n\t\t\t\n\t\t}return result;\n\t\t\t//System.out.println(printHash(i));\n\t\t}", "@Override\r\n public void draw()\r\n {\n\r\n }", "private int leftChild(int index){\n\t\treturn (2*index) +1;\n\t}", "@Override\r\n\tpublic void walk() {\n\r\n\t}", "public double getWidth() {\n return this.getRight(this.tree.getRight(0)) - this.getLeft(this.tree.getLeft(0)); \n }", "void block(Directions dir);", "public void lowerFlatbed(){\n flatbed.lowerFlatbed();\n }", "private void render() {\n StringBuilder builder = new StringBuilder();\n builder.append(horizontalEdge).append(\"\\n\");\n for (int i = 0; i < this.height; i++) {\n builder.append(VERTICAL_CHAR);\n for (int j = 0; j < this.width; j++) {\n builder.append(pixels[i][j]);\n }\n builder.append(VERTICAL_CHAR);\n builder.append(\"\\n\");\n }\n builder.append(horizontalEdge);\n System.out.printf(builder.toString());\n }", "@Override\n\tpublic void draw3() {\n\n\t}", "public static void main(String[] args) {\n\t\tint n=5;\n\t\tfor(int i=n-1;i>=0;i--)\n\t\t{\n\t\t\tfor(int space=0;space<n-1-i;space++)\n\t\t\t{\n\t\t\t\tSystem.out.print(\" \");\n\t\t\t}\n\t\t\tfor(int j=0;j<=i*2;j++)\n\t\t\t{\n\t\t\t\tSystem.out.print(\"* \");\n\t\t\t}\n\t\t\n\t\tSystem.out.println();\n\t}\n\n}", "private int get_right_child(int index){\r\n return 2 * index + 2;\r\n }", "@Override\n\tpublic void draw() {\n\n\t}", "@Override\n\tpublic void draw() {\n\n\t}", "double seBlesser();", "private void renderPath(Node n)\n {\n\tGraphics g = getGraphics();\n\tboolean painting;\n\tColor nc,lc;\n\n\tpainting = (n.paths_passing==0);\n\twhile (n != null) {\n\t if (painting)\n\t\tn.paths_passing++;\n\t else {\n\t\tn.paths_passing--;\n\t }\n\t \n// \t nc = (n.paths_passing > 0)?hilitcolor:normalcolor;\n// \t lc = (n.paths_passing > 0)?hilitcolor:linecolor;\n\t nc = (n.paths_passing > 0)?n.path_color:normalcolor;\n\t lc = (n.paths_passing > 0)?n.path_color:linecolor;\n\t \n\t if (n.parent == null) {\n\t\tsetRenderColor(g,nc);\n\t\trenderNode(g,n);\n\t\tbreak;\n\t }\n\n\t // Double line width\n\t //setRenderColor(g,(n.paths_passing>0)?hilitcolor:Color.white);\n\t setRenderColor(g,(n.paths_passing>0)?n.path_color:Color.white);\n\t renderLine(g,n.x-1,n.y,n.parent.x-1,n.parent.y);\t\n\n\t setRenderColor(g,lc);\n\t renderLine(g,n.x,n.y,n.parent.x,n.parent.y);\n\n\t setRenderColor(g,nc);\n\t renderNode(g,n);\n\t n = n.parent;\n\t}\n }", "public void skystonePos2() {\n }", "double volume() {\n\treturn width*height*depth;\n}", "private void buildPath() {\r\n int xNext = 1;\r\n int yNext = map.getStartPos() + 1;\r\n CellLayered before = cells[yNext][xNext];\r\n while(true)\r\n {\r\n Byte[] xy = map.getDirection(xNext-1, yNext-1);\r\n xNext = xNext + xy[0];\r\n yNext = yNext + xy[1];\r\n\r\n CellLayered next = cells[yNext][xNext];\r\n\r\n if(xy[0]==-1)\r\n before.setRight(false);\r\n else\r\n before.setRight(true);\r\n before.setPath(true);\r\n if(next==null)\r\n break;\r\n\r\n before.setNextInPath(next);\r\n before = next;\r\n }\r\n }", "void table(){\n fill(0);\n rect(width/2, height/2, 600, 350); // boarder\n fill(100, 0 ,0);\n rect(width/2, height/2, 550, 300); //Felt\n \n \n}", "@Override\n\tpublic void walk() {\n\t\t\n\t}", "public\nstatic\nvoid\nmain(String args[]) \n\n{ \n\nBinaryTree tree = \nnew\nBinaryTree(); \n\ntree.root = \nnew\nNode(\n20\n); \n\ntree.root.left = \nnew\nNode(\n8\n); \n\ntree.root.left.left = \nnew\nNode(\n4\n); \n\ntree.root.left.right = \nnew\nNode(\n12\n); \n\ntree.root.left.right.left = \nnew\nNode(\n10\n); \n\ntree.root.left.right.right = \nnew\nNode(\n14\n); \n\ntree.root.right = \nnew\nNode(\n22\n); \n\ntree.root.right.right = \nnew\nNode(\n25\n); \n\ntree.printBoundary(tree.root); \n\n}", "public wall() { //default constructor makes a 10x10 square extending right and down from the pixel located at 5,5\r\n x = 5;\r\n y = 5;\r\n height = 10;\r\n width = 10;\r\n }", "double getNewWidth();", "public int upright();", "@Override\r\n\tpublic void draw() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void draw() {\n\t\t\r\n\t}", "@Override\r\n\tpublic double perimeter() {\n\t\treturn 2*length*breadth;\r\n\t}", "public void skystonePos3() {\n }", "public void leerPlanesDietas();", "long getWidth();", "public static void body() {\n \tfor(int i = 1; i <= SIZE*SIZE; i++) {\n for(int j = 1; j <= 3*SIZE-(SIZE-1); j++) {\n System.out.print(\" \");\n }\n \n System.out.print(\"|\");\n for(int j = 1; j <= SIZE-2; j++) {\n \tSystem.out.print(\"%\");\n }\n System.out.print(\"||\");\n for(int j = 1; j <= SIZE-2; j++) {\n \tSystem.out.print(\"%\");\n }\n System.out.print(\"|\");\n \n System.out.println();\n }\n }", "public void snare();", "public void strength1(float x, float y){\n noStroke();\n fill(80);\n rect(x+7,y,66,6);\n bezier(x+7,y,x,y+1,x,y+5,x+7,y+6);\n bezier(x+73,y,x+80,y+1,x+80,y+5,x+73,y+6);\n rect(x+7,y+1,13,3);//1st blue ba\n bezier(x+7,y+1,x+1,y+2.5f,x+1,y+3.5f,x+7,y+4);\n}", "public void skystonePos5() {\n }", "void GenerateBoardPath() {\n\t\t\t\n\t\t\tint rows = board.getRowsNum();\n\t\t\tint columns = board.getColsNum();\n\t\t\tint space_number = 1; \n\t\t\t\n\t\t\t\n\t\t\tfor (int i = rows - 1; i >= 0; i--) \n\t\t\t\t//If the row is an odd-number, move L-R\n\t\t\t\tif (i % 2 != 0) {\n\t\t\t\t\tfor (int j = 0; j < columns; j++) \n\t\t\t\t\t\tBoardPathRepository.put(space_number++, board.getTile(i, j));}\n\t\t\t\telse {\n\t\t\t\t\tfor (int j = columns-1; j >=0; j--) \n\t\t\t\t\t\tBoardPathRepository.put(space_number++, board.getTile(i, j));\t}\n\t\t\t\t\n\t\t\t\t\n\t\t\t\n\t\t}" ]
[ "0.5472371", "0.5383522", "0.52979374", "0.5293668", "0.5211566", "0.51842105", "0.5161626", "0.51377255", "0.5100369", "0.5067393", "0.5064298", "0.50376177", "0.49875325", "0.49361488", "0.49140826", "0.49058613", "0.49058613", "0.48946288", "0.48945552", "0.48931476", "0.48904693", "0.48880374", "0.48798734", "0.48695773", "0.48647928", "0.48638737", "0.48618442", "0.48618138", "0.48505476", "0.48302734", "0.48278588", "0.48275942", "0.48218134", "0.48208144", "0.48172593", "0.4813516", "0.48124653", "0.4811937", "0.4811937", "0.48115787", "0.4811212", "0.48030958", "0.47998473", "0.4795484", "0.47894648", "0.47886366", "0.47878242", "0.47855106", "0.4777816", "0.47706896", "0.47695553", "0.4766223", "0.47616836", "0.4760893", "0.47604054", "0.47590306", "0.47488394", "0.4736708", "0.47364867", "0.47344264", "0.47324577", "0.47303045", "0.47301307", "0.47227973", "0.4722473", "0.4719981", "0.47176844", "0.47143498", "0.4712692", "0.47071925", "0.47001678", "0.46935824", "0.46934032", "0.46931094", "0.46875677", "0.46873635", "0.4686461", "0.46827722", "0.46827722", "0.46827522", "0.46788132", "0.46628743", "0.46617907", "0.46604863", "0.4657533", "0.46526098", "0.46518275", "0.46497184", "0.46489906", "0.46484554", "0.46466392", "0.46466392", "0.46454313", "0.46434125", "0.46428928", "0.46424708", "0.4639808", "0.46373105", "0.46368903", "0.46341428", "0.46330282" ]
0.0
-1
4) evaluateWithinBounds: Calculates the vapourphase molar enthalpy of the species at temperature T. Constants: constants[0] = Normal Boiling Point Temperature constants[1] = LiquidPhase Enthalpy constants[2] = Latent Heat of Vaporization
protected double evaluateWithinBounds(double x, double[] constants) { double T = x; double Tb = constants[0]; double hL = constants[1]; double lambda = constants[2]; double[] C = super.getC(); double Hv = EnthalpyVapour.R * ((C[0] * (T - Tb)) + (0.5 * C[1] * (Math.pow(T, 2) - Math.pow(Tb, 2))) + ((1. / 3.) * C[2] * (Math.pow(T, 3) - Math.pow(Tb, 3))) + (-1. * C[3] * (Math.pow(T, -1) - Math.pow(Tb, -1)))); return hL + lambda + Hv; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static void getValuationSlot() {\n float locX = M.evaluateLoc.x;\n float locY = M.evaluateLoc.y;\n M.lastZoneValuation = M.evaluateLoc.distanceTo(M.finalMove) * M.moveVectorStr; //Desire to move towards our main goal\n float test1;\n float test2;\n switch (angledRectangleCount) {\n default:\n case 20:\n if (M.evaluateLoc.isWithinDistance(Z20_center, Z20_maxdist)) {\n test1 = Float.sum(locX * Z20_p21x, locY * Z20_p21y);\n if (test1 >= Z20_dotsection2 && test1 <= Z20_p21MagSquared) {\n test2 = Float.sum(locX * Z20_p41x, locY * Z20_p41y);\n if (test2 >= Z20_dotsection4 && test2 <= Z20_p41MagSquared) {\n M.lastZoneValuation = Float.sum(M.lastZoneValuation, Z20_desire);\n if (M.lastZoneValuation < cutoff) return;\n }\n }\n }\n case 19:\n if (M.evaluateLoc.isWithinDistance(Z19_center, Z19_maxdist)) {\n test1 = Float.sum(locX * Z19_p21x, locY * Z19_p21y);\n if (test1 >= Z19_dotsection2 && test1 <= Z19_p21MagSquared) {\n test2 = Float.sum(locX * Z19_p41x, locY * Z19_p41y);\n if (test2 >= Z19_dotsection4 && test2 <= Z19_p41MagSquared) {\n M.lastZoneValuation = Float.sum(M.lastZoneValuation, Z19_desire);\n if (M.lastZoneValuation < cutoff) return;\n }\n }\n }\n case 18:\n if (M.evaluateLoc.isWithinDistance(Z18_center, Z18_maxdist)) {\n test1 = Float.sum(locX * Z18_p21x, locY * Z18_p21y);\n if (test1 >= Z18_dotsection2 && test1 <= Z18_p21MagSquared) {\n test2 = Float.sum(locX * Z18_p41x, locY * Z18_p41y);\n if (test2 >= Z18_dotsection4 && test2 <= Z18_p41MagSquared) {\n M.lastZoneValuation = Float.sum(M.lastZoneValuation, Z18_desire);\n if (M.lastZoneValuation < cutoff) return;\n }\n }\n }\n case 17:\n if (M.evaluateLoc.isWithinDistance(Z17_center, Z17_maxdist)) {\n test1 = Float.sum(locX * Z17_p21x, locY * Z17_p21y);\n if (test1 >= Z17_dotsection2 && test1 <= Z17_p21MagSquared) {\n test2 = Float.sum(locX * Z17_p41x, locY * Z17_p41y);\n if (test2 >= Z17_dotsection4 && test2 <= Z17_p41MagSquared) {\n M.lastZoneValuation = Float.sum(M.lastZoneValuation, Z17_desire);\n if (M.lastZoneValuation < cutoff) return;\n }\n }\n }\n case 16:\n if (M.evaluateLoc.isWithinDistance(Z16_center, Z16_maxdist)) {\n test1 = Float.sum(locX * Z16_p21x, locY * Z16_p21y);\n if (test1 >= Z16_dotsection2 && test1 <= Z16_p21MagSquared) {\n test2 = Float.sum(locX * Z16_p41x, locY * Z16_p41y);\n if (test2 >= Z16_dotsection4 && test2 <= Z16_p41MagSquared) {\n M.lastZoneValuation = Float.sum(M.lastZoneValuation, Z16_desire);\n if (M.lastZoneValuation < cutoff) return;\n }\n }\n }\n case 15:\n if (M.evaluateLoc.isWithinDistance(Z15_center, Z15_maxdist)) {\n test1 = Float.sum(locX * Z15_p21x, locY * Z15_p21y);\n if (test1 >= Z15_dotsection2 && test1 <= Z15_p21MagSquared) {\n test2 = Float.sum(locX * Z15_p41x, locY * Z15_p41y);\n if (test2 >= Z15_dotsection4 && test2 <= Z15_p41MagSquared) {\n M.lastZoneValuation = Float.sum(M.lastZoneValuation, Z15_desire);\n if (M.lastZoneValuation < cutoff) return;\n }\n }\n }\n case 14:\n if (M.evaluateLoc.isWithinDistance(Z14_center, Z14_maxdist)) {\n test1 = Float.sum(locX * Z14_p21x, locY * Z14_p21y);\n if (test1 >= Z14_dotsection2 && test1 <= Z14_p21MagSquared) {\n test2 = Float.sum(locX * Z14_p41x, locY * Z14_p41y);\n if (test2 >= Z14_dotsection4 && test2 <= Z14_p41MagSquared) {\n M.lastZoneValuation = Float.sum(M.lastZoneValuation, Z14_desire);\n if (M.lastZoneValuation < cutoff) return;\n }\n }\n }\n case 13:\n if (M.evaluateLoc.isWithinDistance(Z13_center, Z13_maxdist)) {\n test1 = Float.sum(locX * Z13_p21x, locY * Z13_p21y);\n if (test1 >= Z13_dotsection2 && test1 <= Z13_p21MagSquared) {\n test2 = Float.sum(locX * Z13_p41x, locY * Z13_p41y);\n if (test2 >= Z13_dotsection4 && test2 <= Z13_p41MagSquared) {\n M.lastZoneValuation = Float.sum(M.lastZoneValuation, Z13_desire);\n if (M.lastZoneValuation < cutoff) return;\n }\n }\n }\n case 12:\n if (M.evaluateLoc.isWithinDistance(Z12_center, Z12_maxdist)) {\n test1 = Float.sum(locX * Z12_p21x, locY * Z12_p21y);\n if (test1 >= Z12_dotsection2 && test1 <= Z12_p21MagSquared) {\n test2 = Float.sum(locX * Z12_p41x, locY * Z12_p41y);\n if (test2 >= Z12_dotsection4 && test2 <= Z12_p41MagSquared) {\n M.lastZoneValuation = Float.sum(M.lastZoneValuation, Z12_desire);\n if (M.lastZoneValuation < cutoff) return;\n }\n }\n }\n case 11:\n if (M.evaluateLoc.isWithinDistance(Z11_center, Z11_maxdist)) {\n test1 = Float.sum(locX * Z11_p21x, locY * Z11_p21y);\n if (test1 >= Z11_dotsection2 && test1 <= Z11_p21MagSquared) {\n test2 = Float.sum(locX * Z11_p41x, locY * Z11_p41y);\n if (test2 >= Z11_dotsection4 && test2 <= Z11_p41MagSquared) {\n M.lastZoneValuation = Float.sum(M.lastZoneValuation, Z11_desire);\n if (M.lastZoneValuation < cutoff) return;\n }\n }\n }\n case 10:\n if (M.evaluateLoc.isWithinDistance(Z10_center, Z10_maxdist)) {\n test1 = Float.sum(locX * Z10_p21x, locY * Z10_p21y);\n if (test1 >= Z10_dotsection2 && test1 <= Z10_p21MagSquared) {\n test2 = Float.sum(locX * Z10_p41x, locY * Z10_p41y);\n if (test2 >= Z10_dotsection4 && test2 <= Z10_p41MagSquared) {\n M.lastZoneValuation = Float.sum(M.lastZoneValuation, Z10_desire);\n if (M.lastZoneValuation < cutoff) return;\n }\n }\n }\n case 9:\n if (M.evaluateLoc.isWithinDistance(Z9_center, Z9_maxdist)) {\n test1 = Float.sum(locX * Z9_p21x, locY * Z9_p21y);\n if (test1 >= Z9_dotsection2 && test1 <= Z9_p21MagSquared) {\n test2 = Float.sum(locX * Z9_p41x, locY * Z9_p41y);\n if (test2 >= Z9_dotsection4 && test2 <= Z9_p41MagSquared) {\n M.lastZoneValuation = Float.sum(M.lastZoneValuation, Z9_desire);\n if (M.lastZoneValuation < cutoff) return;\n }\n }\n }\n case 8:\n if (M.evaluateLoc.isWithinDistance(Z8_center, Z8_maxdist)) {\n test1 = Float.sum(locX * Z8_p21x, locY * Z8_p21y);\n if (test1 >= Z8_dotsection2 && test1 <= Z8_p21MagSquared) {\n test2 = Float.sum(locX * Z8_p41x, locY * Z8_p41y);\n if (test2 >= Z8_dotsection4 && test2 <= Z8_p41MagSquared) {\n M.lastZoneValuation = Float.sum(M.lastZoneValuation, Z8_desire);\n if (M.lastZoneValuation < cutoff) return;\n }\n }\n }\n case 7:\n if (M.evaluateLoc.isWithinDistance(Z7_center, Z7_maxdist)) {\n test1 = Float.sum(locX * Z7_p21x, locY * Z7_p21y);\n if (test1 >= Z7_dotsection2 && test1 <= Z7_p21MagSquared) {\n test2 = Float.sum(locX * Z7_p41x, locY * Z7_p41y);\n if (test2 >= Z7_dotsection4 && test2 <= Z7_p41MagSquared) {\n M.lastZoneValuation = Float.sum(M.lastZoneValuation, Z7_desire);\n if (M.lastZoneValuation < cutoff) return;\n }\n }\n }\n case 6:\n if (M.evaluateLoc.isWithinDistance(Z6_center, Z6_maxdist)) {\n test1 = Float.sum(locX * Z6_p21x, locY * Z6_p21y);\n if (test1 >= Z6_dotsection2 && test1 <= Z6_p21MagSquared) {\n test2 = Float.sum(locX * Z6_p41x, locY * Z6_p41y);\n if (test2 >= Z6_dotsection4 && test2 <= Z6_p41MagSquared) {\n M.lastZoneValuation = Float.sum(M.lastZoneValuation, Z6_desire);\n if (M.lastZoneValuation < cutoff) return;\n }\n }\n }\n case 5:\n if (M.evaluateLoc.isWithinDistance(Z5_center, Z5_maxdist)) {\n test1 = Float.sum(locX * Z5_p21x, locY * Z5_p21y);\n if (test1 >= Z5_dotsection2 && test1 <= Z5_p21MagSquared) {\n test2 = Float.sum(locX * Z5_p41x, locY * Z5_p41y);\n if (test2 >= Z5_dotsection4 && test2 <= Z5_p41MagSquared) {\n M.lastZoneValuation = Float.sum(M.lastZoneValuation, Z5_desire);\n if (M.lastZoneValuation < cutoff) return;\n }\n }\n }\n case 4:\n if (M.evaluateLoc.isWithinDistance(Z4_center, Z4_maxdist)) {\n test1 = Float.sum(locX * Z4_p21x, locY * Z4_p21y);\n if (test1 >= Z4_dotsection2 && test1 <= Z4_p21MagSquared) {\n test2 = Float.sum(locX * Z4_p41x, locY * Z4_p41y);\n if (test2 >= Z4_dotsection4 && test2 <= Z4_p41MagSquared) {\n M.lastZoneValuation = Float.sum(M.lastZoneValuation, Z4_desire);\n if (M.lastZoneValuation < cutoff) return;\n }\n }\n }\n case 3:\n if (M.evaluateLoc.isWithinDistance(Z3_center, Z3_maxdist)) {\n test1 = Float.sum(locX * Z3_p21x, locY * Z3_p21y);\n if (test1 >= Z3_dotsection2 && test1 <= Z3_p21MagSquared) {\n test2 = Float.sum(locX * Z3_p41x, locY * Z3_p41y);\n if (test2 >= Z3_dotsection4 && test2 <= Z3_p41MagSquared) {\n M.lastZoneValuation = Float.sum(M.lastZoneValuation, Z3_desire);\n if (M.lastZoneValuation < cutoff) return;\n }\n }\n }\n case 2:\n if (M.evaluateLoc.isWithinDistance(Z2_center, Z2_maxdist)) {\n test1 = Float.sum(locX * Z2_p21x, locY * Z2_p21y);\n if (test1 >= Z2_dotsection2 && test1 <= Z2_p21MagSquared) {\n test2 = Float.sum(locX * Z2_p41x, locY * Z2_p41y);\n if (test2 >= Z2_dotsection4 && test2 <= Z2_p41MagSquared) {\n M.lastZoneValuation = Float.sum(M.lastZoneValuation, Z2_desire);\n if (M.lastZoneValuation < cutoff) return;\n }\n }\n }\n case 1:\n if (M.evaluateLoc.isWithinDistance(Z1_center, Z1_maxdist)) {\n test1 = Float.sum(locX * Z1_p21x, locY * Z1_p21y);\n if (test1 >= Z1_dotsection2 && test1 <= Z1_p21MagSquared) {\n test2 = Float.sum(locX * Z1_p41x, locY * Z1_p41y);\n if (test2 >= Z1_dotsection4 && test2 <= Z1_p41MagSquared) {\n M.lastZoneValuation = Float.sum(M.lastZoneValuation, Z1_desire);\n if (M.lastZoneValuation < cutoff) return;\n }\n }\n }\n case 0:\n }\n switch (circleCount) {\n case 20:\n if (M.evaluateLoc.isWithinDistance(Z20c_center, Z20c_size)) {\n M.lastZoneValuation = Float.sum(M.lastZoneValuation, Z20c_desire);\n if (M.lastZoneValuation < cutoff) return;\n }\n case 19:\n if (M.evaluateLoc.isWithinDistance(Z19c_center, Z19c_size)) {\n M.lastZoneValuation = Float.sum(M.lastZoneValuation, Z19c_desire);\n if (M.lastZoneValuation < cutoff) return;\n }\n case 18:\n if (M.evaluateLoc.isWithinDistance(Z18c_center, Z18c_size)) {\n M.lastZoneValuation = Float.sum(M.lastZoneValuation, Z18c_desire);\n if (M.lastZoneValuation < cutoff) return;\n }\n case 17:\n if (M.evaluateLoc.isWithinDistance(Z17c_center, Z17c_size)) {\n M.lastZoneValuation = Float.sum(M.lastZoneValuation, Z17c_desire);\n if (M.lastZoneValuation < cutoff) return;\n }\n case 16:\n if (M.evaluateLoc.isWithinDistance(Z16c_center, Z16c_size)) {\n M.lastZoneValuation = Float.sum(M.lastZoneValuation, Z16c_desire);\n if (M.lastZoneValuation < cutoff) return;\n }\n case 15:\n if (M.evaluateLoc.isWithinDistance(Z15c_center, Z15c_size)) {\n M.lastZoneValuation = Float.sum(M.lastZoneValuation, Z15c_desire);\n if (M.lastZoneValuation < cutoff) return;\n }\n case 14:\n if (M.evaluateLoc.isWithinDistance(Z14c_center, Z14c_size)) {\n M.lastZoneValuation = Float.sum(M.lastZoneValuation, Z14c_desire);\n if (M.lastZoneValuation < cutoff) return;\n }\n case 13:\n if (M.evaluateLoc.isWithinDistance(Z13c_center, Z13c_size)) {\n M.lastZoneValuation = Float.sum(M.lastZoneValuation, Z13c_desire);\n if (M.lastZoneValuation < cutoff) return;\n }\n case 12:\n if (M.evaluateLoc.isWithinDistance(Z12c_center, Z12c_size)) {\n M.lastZoneValuation = Float.sum(M.lastZoneValuation, Z12c_desire);\n if (M.lastZoneValuation < cutoff) return;\n }\n case 11:\n if (M.evaluateLoc.isWithinDistance(Z11c_center, Z11c_size)) {\n M.lastZoneValuation = Float.sum(M.lastZoneValuation, Z11c_desire);\n if (M.lastZoneValuation < cutoff) return;\n }\n case 10:\n if (M.evaluateLoc.isWithinDistance(Z10c_center, Z10c_size)) {\n M.lastZoneValuation = Float.sum(M.lastZoneValuation, Z10c_desire);\n if (M.lastZoneValuation < cutoff) return;\n }\n case 9:\n if (M.evaluateLoc.isWithinDistance(Z9c_center, Z9c_size)) {\n M.lastZoneValuation = Float.sum(M.lastZoneValuation, Z9c_desire);\n if (M.lastZoneValuation < cutoff) return;\n }\n case 8:\n if (M.evaluateLoc.isWithinDistance(Z8c_center, Z8c_size)) {\n M.lastZoneValuation = Float.sum(M.lastZoneValuation, Z8c_desire);\n if (M.lastZoneValuation < cutoff) return;\n }\n case 7:\n if (M.evaluateLoc.isWithinDistance(Z7c_center, Z7c_size)) {\n M.lastZoneValuation = Float.sum(M.lastZoneValuation, Z7c_desire);\n if (M.lastZoneValuation < cutoff) return;\n }\n case 6:\n if (M.evaluateLoc.isWithinDistance(Z6c_center, Z6c_size)) {\n M.lastZoneValuation = Float.sum(M.lastZoneValuation, Z6c_desire);\n if (M.lastZoneValuation < cutoff) return;\n }\n case 5:\n if (M.evaluateLoc.isWithinDistance(Z5c_center, Z5c_size)) {\n M.lastZoneValuation = Float.sum(M.lastZoneValuation, Z5c_desire);\n if (M.lastZoneValuation < cutoff) return;\n }\n case 4:\n if (M.evaluateLoc.isWithinDistance(Z4c_center, Z4c_size)) {\n M.lastZoneValuation = Float.sum(M.lastZoneValuation, Z4c_desire);\n if (M.lastZoneValuation < cutoff) return;\n }\n case 3:\n if (M.evaluateLoc.isWithinDistance(Z3c_center, Z3c_size)) {\n M.lastZoneValuation = Float.sum(M.lastZoneValuation, Z3c_desire);\n }\n case 2:\n if (M.evaluateLoc.isWithinDistance(Z2c_center, Z2c_size)) {\n M.lastZoneValuation = Float.sum(M.lastZoneValuation, Z2c_desire);\n }\n case 1:\n if (M.evaluateLoc.isWithinDistance(Z1c_center, Z1c_size)) {\n M.lastZoneValuation = Float.sum(M.lastZoneValuation, Z1c_desire);\n }\n case 0:\n }\n switch (vectorCircleCount) {\n case 20:\n if (M.evaluateLoc.isWithinDistance(Z20vc_center, Z20vc_size)) {\n M.lastZoneValuation = Float.sum(M.lastZoneValuation, Float.sum(Z20vc_baseDesire, M.evaluateLoc.distanceTo(Z20vc_center) * Z20vc_distanceDesire));\n if (M.lastZoneValuation < cutoff) return;\n }\n case 19:\n if (M.evaluateLoc.isWithinDistance(Z19vc_center, Z19vc_size)) {\n M.lastZoneValuation = Float.sum(M.lastZoneValuation, Float.sum(Z19vc_baseDesire, M.evaluateLoc.distanceTo(Z19vc_center) * Z19vc_distanceDesire));\n if (M.lastZoneValuation < cutoff) return;\n }\n case 18:\n if (M.evaluateLoc.isWithinDistance(Z18vc_center, Z18vc_size)) {\n M.lastZoneValuation = Float.sum(M.lastZoneValuation, Float.sum(Z18vc_baseDesire, M.evaluateLoc.distanceTo(Z18vc_center) * Z18vc_distanceDesire));\n if (M.lastZoneValuation < cutoff) return;\n }\n case 17:\n if (M.evaluateLoc.isWithinDistance(Z17vc_center, Z17vc_size)) {\n M.lastZoneValuation = Float.sum(M.lastZoneValuation, Float.sum(Z17vc_baseDesire, M.evaluateLoc.distanceTo(Z17vc_center) * Z17vc_distanceDesire));\n if (M.lastZoneValuation < cutoff) return;\n }\n case 16:\n if (M.evaluateLoc.isWithinDistance(Z16vc_center, Z16vc_size)) {\n M.lastZoneValuation = Float.sum(M.lastZoneValuation, Float.sum(Z16vc_baseDesire, M.evaluateLoc.distanceTo(Z16vc_center) * Z16vc_distanceDesire));\n if (M.lastZoneValuation < cutoff) return;\n }\n case 15:\n if (M.evaluateLoc.isWithinDistance(Z15vc_center, Z15vc_size)) {\n M.lastZoneValuation = Float.sum(M.lastZoneValuation, Float.sum(Z15vc_baseDesire, M.evaluateLoc.distanceTo(Z15vc_center) * Z15vc_distanceDesire));\n if (M.lastZoneValuation < cutoff) return;\n }\n case 14:\n if (M.evaluateLoc.isWithinDistance(Z14vc_center, Z14vc_size)) {\n M.lastZoneValuation = Float.sum(M.lastZoneValuation, Float.sum(Z14vc_baseDesire, M.evaluateLoc.distanceTo(Z14vc_center) * Z14vc_distanceDesire));\n if (M.lastZoneValuation < cutoff) return;\n }\n case 13:\n if (M.evaluateLoc.isWithinDistance(Z13vc_center, Z13vc_size)) {\n M.lastZoneValuation = Float.sum(M.lastZoneValuation, Float.sum(Z13vc_baseDesire, M.evaluateLoc.distanceTo(Z13vc_center) * Z13vc_distanceDesire));\n if (M.lastZoneValuation < cutoff) return;\n }\n case 12:\n if (M.evaluateLoc.isWithinDistance(Z12vc_center, Z12vc_size)) {\n M.lastZoneValuation = Float.sum(M.lastZoneValuation, Float.sum(Z12vc_baseDesire, M.evaluateLoc.distanceTo(Z12vc_center) * Z12vc_distanceDesire));\n if (M.lastZoneValuation < cutoff) return;\n }\n case 11:\n if (M.evaluateLoc.isWithinDistance(Z11vc_center, Z11vc_size)) {\n M.lastZoneValuation = Float.sum(M.lastZoneValuation, Float.sum(Z11vc_baseDesire, M.evaluateLoc.distanceTo(Z11vc_center) * Z11vc_distanceDesire));\n if (M.lastZoneValuation < cutoff) return;\n }\n case 10:\n if (M.evaluateLoc.isWithinDistance(Z10vc_center, Z10vc_size)) {\n M.lastZoneValuation = Float.sum(M.lastZoneValuation, Float.sum(Z10vc_baseDesire, M.evaluateLoc.distanceTo(Z10vc_center) * Z10vc_distanceDesire));\n if (M.lastZoneValuation < cutoff) return;\n }\n case 9:\n if (M.evaluateLoc.isWithinDistance(Z9vc_center, Z9vc_size)) {\n M.lastZoneValuation = Float.sum(M.lastZoneValuation, Float.sum(Z9vc_baseDesire, M.evaluateLoc.distanceTo(Z9vc_center) * Z9vc_distanceDesire));\n if (M.lastZoneValuation < cutoff) return;\n }\n case 8:\n if (M.evaluateLoc.isWithinDistance(Z8vc_center, Z8vc_size)) {\n M.lastZoneValuation = Float.sum(M.lastZoneValuation, Float.sum(Z8vc_baseDesire, M.evaluateLoc.distanceTo(Z8vc_center) * Z8vc_distanceDesire));\n if (M.lastZoneValuation < cutoff) return;\n }\n case 7:\n if (M.evaluateLoc.isWithinDistance(Z7vc_center, Z7vc_size)) {\n M.lastZoneValuation = Float.sum(M.lastZoneValuation, Float.sum(Z7vc_baseDesire, M.evaluateLoc.distanceTo(Z7vc_center) * Z7vc_distanceDesire));\n if (M.lastZoneValuation < cutoff) return;\n }\n case 6:\n if (M.evaluateLoc.isWithinDistance(Z6vc_center, Z6vc_size)) {\n M.lastZoneValuation = Float.sum(M.lastZoneValuation, Float.sum(Z6vc_baseDesire, M.evaluateLoc.distanceTo(Z6vc_center) * Z6vc_distanceDesire));\n if (M.lastZoneValuation < cutoff) return;\n }\n case 5:\n if (M.evaluateLoc.isWithinDistance(Z5vc_center, Z5vc_size)) {\n M.lastZoneValuation = Float.sum(M.lastZoneValuation, Float.sum(Z5vc_baseDesire, M.evaluateLoc.distanceTo(Z5vc_center) * Z5vc_distanceDesire));\n if (M.lastZoneValuation < cutoff) return;\n }\n case 4:\n if (M.evaluateLoc.isWithinDistance(Z4vc_center, Z4vc_size)) {\n M.lastZoneValuation = Float.sum(M.lastZoneValuation, Float.sum(Z4vc_baseDesire, M.evaluateLoc.distanceTo(Z4vc_center) * Z4vc_distanceDesire));\n if (M.lastZoneValuation < cutoff) return;\n }\n case 3:\n if (M.evaluateLoc.isWithinDistance(Z3vc_center, Z3vc_size)) {\n M.lastZoneValuation = Float.sum(M.lastZoneValuation, Float.sum(Z3vc_baseDesire, M.evaluateLoc.distanceTo(Z3vc_center) * Z3vc_distanceDesire));\n }\n case 2:\n if (M.evaluateLoc.isWithinDistance(Z2vc_center, Z2vc_size)) {\n M.lastZoneValuation = Float.sum(M.lastZoneValuation, Float.sum(Z2vc_baseDesire, M.evaluateLoc.distanceTo(Z2vc_center) * Z2vc_distanceDesire));\n }\n case 1:\n if (M.evaluateLoc.isWithinDistance(Z1vc_center, Z1vc_size)) {\n M.lastZoneValuation = Float.sum(M.lastZoneValuation, Float.sum(Z1vc_baseDesire, M.evaluateLoc.distanceTo(Z1vc_center) * Z1vc_distanceDesire));\n }\n case 0:\n }\n //Rarely used, should be optimized the same way if this becomes more common\n for (int i = M.squareIndexMinusOne; i >= 0; i--) {\n ZoneSquare zone = M.squares[i];\n if (zone.left < locX && locX < zone.right && locY < zone.top && locY > zone.bot) {\n M.lastZoneValuation += zone.desire;\n }\n }\n }", "@Test\n public void testJuvenilesSpreadFromOutsideInsideGrid() {\n params = new CompletelySpatiallyRandomParams(0.5, 0);\n coloniser = new CompletelySpatiallyRandomColoniser(landCoverType, juvenilePine, juvenileOak,\n juvenileDeciduous, params);\n coloniser.updateJuvenilePresenceLayers();\n\n assertTrue(countJuvenilesInGrid(juvenilePine) >= 5);\n assertTrue(countJuvenilesInGrid(juvenileOak) >= 5);\n assertTrue(countJuvenilesInGrid(juvenileDeciduous) >= 5);\n }", "@Override\n protected void doAlgorithmA1() {\n int xP = 0;\n int yP = 0;\n\n\n //Taking the variable out of the list that are in the bounds\n //Testing that the bound has variables\n if (csp.getSimpleConstraints().get(cIndex).getSimpleBounds().get(bIndex).getX() != null) {\n xP = csp.getSimpleConstraints().get(cIndex).getSimpleBounds().get(bIndex).getX().getPosition();\n }\n int xU = 0;\n int xL = 0;\n if (csp.getSimpleConstraints().get(cIndex).getSimpleBounds().get(bIndex).getY() != null) {\n yP = csp.getSimpleConstraints().get(cIndex).getSimpleBounds().get(bIndex).getY().getPosition();\n }\n int yU = 0;\n int yL = 0;\n int cright = csp.getSimpleConstraints().get(cIndex).getSimpleBounds().get(bIndex).getCright();\n int cleft = csp.getSimpleConstraints().get(cIndex).getSimpleBounds().get(bIndex).getCleft();\n\n\n\n for (Variable variable : csp.getVars()) {\n if (csp.getSimpleConstraints().get(cIndex).getSimpleBounds().get(bIndex).getX() != null) {\n if (variable.getPosition() == xP) {\n xU = variable.getUpperDomainBound();\n xL = variable.getLowerDomainBound();\n }\n }\n if (csp.getSimpleConstraints().get(cIndex).getSimpleBounds().get(bIndex).getY() != null) {\n if (variable.getPosition() == yP) {\n yU = variable.getUpperDomainBound();\n yL = variable.getLowerDomainBound();\n }\n }\n }\n\n boolean first = false;\n boolean second = false;\n\n //Testing if the bound is true, false or inconclusive\n\n if (xL + cleft >= yU + cright) {\n first = true;\n }\n if (xU + cleft < yL + cright) {\n second = true;\n }\n\n //are first and second not equal is the bound not inconclusive\n if (first != second) {\n if (first) { //a true Simple Bound was found\n //checks if it was the last constraint in a csp\n //If so the csp is true\n //else check the next constraint and do this method again\n if (csp.getSimpleConstraints().size() - 1 == cIndex) {\n System.out.println(\"P is satisfiable\");\n System.out.println(System.nanoTime()-startTime);\n return;\n } else {\n bIndex = 0;\n cIndex++;\n unit=false;\n doAlgorithmA1();\n }\n } else if (csp.getSimpleConstraints().get(cIndex).getSimpleBounds().size() - 1 == bIndex) { //a false Simple Bound was found\n //\n bIndex = 0;\n cIndex = 0;\n if (isInconclusive) {\n if(unit){\n doDeduction();\n }else {\n doAlgorithmA3();\n }\n } else {\n doAlgorithmA2();\n }\n } else {\n bIndex++;\n doAlgorithmA1();\n }\n } else {//an inconclusive Simple Bound was found\n //checks if the bound wasn't already inconclusive\n if(!isInconclusive){\n unit=true;\n unitSB = csp.getSimpleConstraints().get(cIndex).getSimpleBounds().get(bIndex);\n }else {\n unit=false;\n }\n isInconclusive = true;\n\n if (csp.getSimpleConstraints().get(cIndex).getSimpleBounds().size() - 1 == bIndex) {\n cIndex = 0;\n bIndex = 0;\n if(unit){\n doDeduction();\n }else {\n doAlgorithmA3();\n }\n } else {\n bIndex++;\n doAlgorithmA1();\n }\n }\n }", "@Test\n public void testJuvenilesSpreadFromCellsWithCorrespondingMatureLctFromInsideGrid() {\n params = new CompletelySpatiallyRandomParams(3, 0);\n coloniser = new CompletelySpatiallyRandomColoniser(landCoverType, juvenilePine, juvenileOak,\n juvenileDeciduous, params);\n coloniser.updateJuvenilePresenceLayers();\n\n assertTrue(countJuvenilesInGrid(juvenilePine) >= 6);\n assertTrue(countJuvenilesInGrid(juvenileOak) >= 9);\n assertTrue(countJuvenilesInGrid(juvenileDeciduous) >= 3);\n }", "@Test\n public void shouldEvaluateWorkProperlyCase3() throws FileNotFoundException {\n DoubleProblem problem = new MockDoubleProblem(2) ;\n\n List<DoubleSolution> frontToEvaluate = new ArrayList<>() ;\n\n DoubleSolution solution = problem.createSolution() ;\n solution.setObjective(0, 0.25);\n solution.setObjective(1, 0.75);\n frontToEvaluate.add(solution) ;\n\n solution = problem.createSolution() ;\n solution.setObjective(0, 0.75);\n solution.setObjective(1, 0.25);\n frontToEvaluate.add(solution) ;\n\n solution = problem.createSolution() ;\n solution.setObjective(0, 0.5);\n solution.setObjective(1, 0.5);\n frontToEvaluate.add(solution) ;\n\n WFGHypervolume<DoubleSolution> hypervolume = new WFGHypervolume<>() ;\n double result = hypervolume.computeHypervolume(frontToEvaluate, new ArrayPoint(new double[]{1.5, 1.5})) ;\n\n assertEquals((1.5 - 0.75) * (1.5 - 0.25) + (0.75 - 0.5) * (1.5 - 0.5) + (0.5 - 0.25) * (1.5 - 0.75), result, 0.0001) ;\n }", "public void evaluate_surface() {\n if (surface_type != 2) {\n double epsilon = 0.001;\n\n for (int i = 0; i < nr_of_segments; i++) {\n for (double u = 0.0; u < 1.0 - epsilon; u = u + step) {\n for (int j = 0; j < points_per_segment; j++) {\n for (double v = 0.0; v < 1.0 - epsilon; v = v + step) {\n evaluated_points[(int) (((i + u) / step) + epsilon)][(int) (((j + v) / step)\n + epsilon)] = evaluate_point_on_surface(i, j, u, v);\n }\n }\n }\n }\n }\n\n }", "private void testDifferentJRangesForConstantK()\r\n\t{\r\n\t\tint minJ = energiesForCurrentK.entrySet().iterator().next().getKey();\r\n\t\tint maxJ = 0;\r\n\r\n\t\tfor (Map.Entry<Integer, Double> entry : energiesForCurrentK.entrySet()) {\r\n\t\t\tmaxJ = entry.getKey();\r\n\t\t}\r\n\r\n\t\tint shiftsOfJPossible = (maxJ - minJ) + inputBranchArray.size() - 1;\r\n\r\n\t\tfor (int i = 0; i < shiftsOfJPossible; i++) {\r\n\t\t\tresetArraysAndHeader();\r\n\t\t\tsetHeaderDisplayState(false);\r\n\t\t\tlowestJValue = maxJ - i;\r\n\t\t\thighestJValue = lowestJValue + inputBranchArray.size() - 1;\r\n\t\t\tassignJValuesToInputBranch();\r\n\t\t\tpublishResults();\r\n\t\t}\r\n\t}", "public abstract Point_3 evaluate(double u, double v);", "private synchronized void initCircumstances() {\n if (circV == null) {\n\n // Calculate visit circumstances, which includes setup time.\n Function<Long, WorldCoords> coords = getObs()::getCoords;\n int size = Math.max(1, (int) (interval.getLength() / QUANTUM));\n circV = new TreeMap<Circumstance, Double[]>();\n for (Circumstance c: Circumstance.values()) {\n circV.put(c, new Double[size]);\n }\n TimingWindowSolver tws = new TimingWindowSolver(obs);\n ImprovedSkyCalc calc = new ImprovedSkyCalc(variant.getSchedule().getSite());\n for (int i = 0; i < size; i++) {\n long t = interval.getStart() + QUANTUM * i;\n calc.calculate(coords.apply(t), new Date(t), true);\n for (Circumstance c: Circumstance.values()) {\n Double[] vals = circV.get(c);\n switch (c) {\n case AIRMASS: vals[i] = calc.getAirmass(); break;\n case AZIMUTH: vals[i] = calc.getAzimuth(); break;\n case ELEVATION: vals[i] = calc.getAltitude(); break;\n case LUNAR_DISTANCE: vals[i] = calc.getLunarDistance(); break;\n case PARALLACTIC_ANGLE: vals[i] = calc.getParallacticAngle(); break;\n case TOTAL_SKY_BRIGHTNESS: vals[i] = calc.getTotalSkyBrightness(); break;\n case HOUR_ANGLE: vals[i] = calc.getHourAngle(); break;\n case TIMING_WINDOW_OPEN: vals[i] = tws.includes(t) ? 1. : 0.; break;\n default: throw new Error(\"Missing switch case for \" + c);\n }\n }\n }\n\n // Now calculate circumstances for science.\n if (getSetupType() != SetupType.NONE) {\n\n circS = new TreeMap<Circumstance, Double[]>();\n final long setupTime = getSetupTime();\n\n for (Circumstance c: Circumstance.values()) {\n\n Double[] valsV = circV.get(c);\n Double[] valsS = new Double[valsV.length];\n\n // We want to copy the range n ... length where n is the first\n // quantum that's not during setup time, or the last sample, so\n // we guarantee at least one.\n int n = Math.min((int) (setupTime / QUANTUM), valsV.length - 1);\n System.arraycopy(valsV, n, valsS, n, valsV.length - n);\n\n circS.put(c, valsS);\n\n }\n\n } else {\n\n // Science and visit circumstances are the same if there is no setup.\n circS = circV;\n\n }\n\n }\n }", "public double minPlacedRectWCET(Module m, double max_2F_wcet){\n\t\t// build the grid \n\t\tBiochip grid = new Biochip(m.width,m.height);\n\n\t\tdouble max_wcet = 0; \n\t\tfor (int x=0;x<grid.cells.size();x++){\n\t\t//for (int x=0;x<grid.cells.size();x++){\n\t\t\t//for (int y=x+1; y<4; y++){\n\t\t\tfor (int y=x+1; y<grid.cells.size()-1; y++){\n\t\t\t//\tfor (int z=y+1; z<5; z++){\n\t\t\t\t\t\n\t\t\t\tfor (int z=y+1; z<grid.cells.size()-2; z++){\n\t\t\t\t\tdouble min_wcet = 1000; \n\t\t\t\t\tArrayList<ModuleElement> fault_scen = new ArrayList<ModuleElement>(); \n\t\t\t\t\tfault_scen.add(new ModuleElement(grid.findRow(grid.cells.get(x)),grid.findColumn(grid.cells.get(x))));\n\t\t\t\t\tfault_scen.add(new ModuleElement(grid.findRow(grid.cells.get(y)),grid.findColumn(grid.cells.get(y))));\n\t\t\t\t\tfault_scen.add(new ModuleElement(grid.findRow(grid.cells.get(z)),grid.findColumn(grid.cells.get(z))));\n\t\t\t\t\tSystem.out.println(\"\\nFault scenario: \" + fault_scen.toString()); \n\n\t\t\t\t\t// mark the faulty cells as inactive\n\t\t\t\t\tfor (int k=0; k<fault_scen.size();k++){\n\t\t\t\t\t\tModuleElement f_cell = fault_scen.get(k);\n\t\t\t\t\t\tgrid.getCell(f_cell.x, f_cell.y).isActive = false; \n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\tSystem.out.println(grid.toString()); \n\t// calculate the min wcet \n\t\t\t\t\tfor (int k=0; k<fault_scen.size();k++){\n\t\t\t\t\t\tModuleElement f_cell = fault_scen.get(k);\n\t\t\t\t\t\tSystem.out.println(\"crt cell = (\" + f_cell.x + \" , \" + f_cell.y + \")\" ); \n\t\t\t\t\t\t// go around the fault - RIGHT \n\t\t\t\t\t\tif (f_cell.y+1<grid.width){\n\t\t\t\t\t\t\tModuleElement right_n = new ModuleElement(f_cell.x, f_cell.y+1); \n\t\t\t\t\t\t\tif(!this.findFault(right_n, fault_scen)){\n\t\t\t\t\t\t\t\tRectangle right_r = new Rectangle(1,1,right_n.y, grid.height - 1 - right_n.x);\n\t\t\t\t\t\t\t\t//System.out.println(\"Start rect = \" + right_r.toString()); \n\n\t\t\t\t\t\t\t\t// get the scaled ER\n\t\t\t\t\t\t\t\tthis.shiftRight(right_r,grid); \n\t\t\t\t\t\t\t\t//System.out.println(\" After right right rect = \" + right_r.toString()); \n\n\t\t\t\t\t\t\t\tthis.shiftBottom(right_r,grid);\n\t\t\t\t\t\t\t\t//System.out.println(\" After BOTTOM right rect = \" + right_r.toString()); \n\n\t\t\t\t\t\t\t\tthis.shiftTop(right_r,grid); \n\t\t\t\t\t\t\t\t//System.out.println(\" After up right rect = \" + right_r.toString()); \n\n\t\t\t\t\t\t\t\tif (right_r.height > 1 && right_r.width >1){\n\n\t\t\t\t\t\t\t\tif(min_wcet>this.nonFWCET(right_r.width, right_r.height))\n\t\t\t\t\t\t\t\t\tmin_wcet = this.nonFWCET(right_r.width, right_r.height); \n\t\t\t\t\t\t\t\t//System.out.println(\"Right rect = \" + right_r.toString()); \n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\t// LEFT\n\t\t\t\t\t\tif (f_cell.y-1 >= 0){\n\t\t\t\t\t\t\tModuleElement left_n = new ModuleElement(f_cell.x, f_cell.y-1); \n\t\t\t\t\t\t\tif(!this.findFault(left_n, fault_scen)){\n\t\t\t\t\t\t\t\tRectangle left_r = new Rectangle(1,1,left_n.y, grid.height - 1 - left_n.x);\n\t\t\t\t\t\t\t\t// get the scaled ER\n\t\t\t\t\t\t\t\tthis.shiftLeft(left_r,grid); \n\n\t\t\t\t\t\t\t\tthis.shiftBottom(left_r,grid); \n\n\t\t\t\t\t\t\t\tthis.shiftTop(left_r,grid); \n\t\t\t\t\t\t\t\tif (left_r.height > 1 && left_r.width >1){\n\n\t\t\t\t\t\t\t\tif(min_wcet>this.nonFWCET(left_r.width, left_r.height))\n\t\t\t\t\t\t\t\t\tmin_wcet = this.nonFWCET(left_r.width, left_r.height); \n\t\t\t\t\t\t\t\t//System.out.println(\"Left rect = \" + left_r.toString()); \n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t// UP\n\t\t\t\t\t\tif (f_cell.x-1>=0){\n\t\t\t\t\t\t\tModuleElement up_n = new ModuleElement(f_cell.x-1, f_cell.y); \n\t\t\t\t\t\t\tif(!this.findFault(up_n, fault_scen)){\n\t\t\t\t\t\t\t\tRectangle up_r = new Rectangle(1,1,up_n.y, grid.height - 1 - up_n.x);\n\t\t\t\t\t\t\t\t// get the scaled ER\n\t\t\t\t\t\t\t\tthis.shiftLeft(up_r, grid); \n\t\t\t\t\t\t\t\tthis.shiftRight(up_r, grid); \n\t\t\t\t\t\t\t\tthis.shiftTop(up_r, grid); \n\t\t\t\t\t\t\t\tif (up_r.height > 1 && up_r.width >1){\n\t\t\t\t\t\t\t\t\tif(min_wcet>this.nonFWCET(up_r.width, up_r.height))\n\t\t\t\t\t\t\t\t\t\tmin_wcet = this.nonFWCET(up_r.width, up_r.height); \n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t//System.out.println(\"UP rect = \" + up_r.toString()); \n\n\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\t// DOWN\n\t\t\t\t\t\tif (f_cell.x+1<grid.height){\n\n\t\t\t\t\t\t\tModuleElement down_n = new ModuleElement(f_cell.x+1, f_cell.y);\n\t\t\t\t\t\t\t//System.out.println(\"Down cell = \" + down_n.toString()); \n\t\t\t\t\t\t\tif(!this.findFault(down_n, fault_scen)){\n\t\t\t\t\t\t\t\tRectangle down_r = new Rectangle(1,1,down_n.y, grid.height - 1 - down_n.x);\n\t\t\t\t\t\t\t\t//System.out.println(\"Start rect = \" + down_r.toString()); \n\t\t\t\t\t\t\t\t// get the scaled ER\n\t\t\t\t\t\t\t\tthis.shiftLeft(down_r,grid);\n\t\t\t\t\t\t\t\t//System.out.println(\" After Left Down rect = \" + down_r.toString()); \n\t\t\t\t\t\t\t\tthis.shiftRight(down_r,grid);\n\t\t\t\t\t\t\t\t//System.out.println(\" After Right Down rect = \" + down_r.toString()); \n\t\t\t\t\t\t\t\tthis.shiftBottom(down_r,grid); \n\t\t\t\t\t\t\t\t//System.out.println(\" After Down Down rect = \" + down_r.toString()); \n\t\t\t\t\t\t\t\tif (down_r.height > 1 && down_r.width >1){\n\n\t\t\t\t\t\t\t\tif(min_wcet>this.nonFWCET(down_r.width, down_r.height))\n\t\t\t\t\t\t\t\t\tmin_wcet = this.nonFWCET(down_r.width, down_r.height); \n\t\t\t\t\t\t\t\t//System.out.println(\"Down rect = \" + down_r.toString()); \n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tSystem.out.println(\"local minimum = \" + min_wcet + \" max_wcet = \" + max_wcet);\n\t\t\t\t\tif (min_wcet > max_2F_wcet) min_wcet = max_2F_wcet; \n\t\t\t\t\t//if(max_wcet > 4) System.exit(1); \n\t\t\t\t\tif (max_wcet < min_wcet) max_wcet = min_wcet; \n\t\t\t\t\t// clean the marked cells \n\t\t\t\t\tfor (int k=0; k<fault_scen.size();k++){\n\t\t\t\t\t\tModuleElement f_cell = fault_scen.get(k);\n\t\t\t\t\t\tgrid.getCell(f_cell.x, f_cell.y).isActive = true; \n\t\t\t\t\t}\n\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\n\t\t\n\t\treturn max_wcet; \n\t}", "@Test\n public void shouldEvaluateWorkProperlyCase2() throws FileNotFoundException {\n DoubleProblem problem = new MockDoubleProblem(2) ;\n\n List<DoubleSolution> frontToEvaluate = new ArrayList<>() ;\n\n DoubleSolution solution = problem.createSolution() ;\n solution.setObjective(0, 0.25);\n solution.setObjective(1, 0.75);\n frontToEvaluate.add(solution) ;\n\n solution = problem.createSolution() ;\n solution.setObjective(0, 0.75);\n solution.setObjective(1, 0.25);\n frontToEvaluate.add(solution) ;\n\n solution = problem.createSolution() ;\n solution.setObjective(0, 0.5);\n solution.setObjective(1, 0.5);\n frontToEvaluate.add(solution) ;\n\n WFGHypervolume<DoubleSolution> hypervolume = new WFGHypervolume<>() ;\n double result = hypervolume.computeHypervolume(frontToEvaluate, new ArrayPoint(new double[]{1.0, 1.0})) ;\n\n assertEquals(0.25*0.75 + 0.25*0.5 + 0.25*0.25, result, 0.0001) ;\n }", "@Test\n public void shouldEvaluateWorkProperlyCase4() throws FileNotFoundException {\n Front storeFront = new ArrayFront(\"/pareto_fronts/ZDT1.pf\") ;\n\n DoubleProblem problem = new MockDoubleProblem(2) ;\n\n List<DoubleSolution> frontToEvaluate = new ArrayList<>() ;\n for (int i = 0 ; i < storeFront.getNumberOfPoints(); i++) {\n DoubleSolution solution = problem.createSolution() ;\n solution.setObjective(0, storeFront.getPoint(i).getValue(0));\n solution.setObjective(1, storeFront.getPoint(i).getValue(1));\n frontToEvaluate.add(solution) ;\n }\n\n WFGHypervolume<DoubleSolution> hypervolume = new WFGHypervolume<>() ;\n double result = hypervolume.computeHypervolume(frontToEvaluate, new ArrayPoint(new double[]{1.0, 1.0})) ;\n\n assertEquals(0.6661, result, 0.0001) ;\n }", "@Test\n public void testFind_West_cross_boundary() {\n\n double lat1 = 0.0;\n double lon1 = -170.0;\n double lat2 = 0.0;\n double lon2 = 170.0;\n double expResult = Math.toRadians(270);\n double result = Azimuth.find(lat1, lon1, lat2, lon2);\n assertEquals(expResult, result, 0.0);\n }", "@Test\n public void shouldEvaluateWorkProperlyCase1() throws FileNotFoundException {\n DoubleProblem problem = new MockDoubleProblem(2) ;\n\n List<DoubleSolution> frontToEvaluate = new ArrayList<>() ;\n\n DoubleSolution solution = problem.createSolution() ;\n solution.setObjective(0, 0.25);\n solution.setObjective(1, 0.75);\n frontToEvaluate.add(solution) ;\n\n solution = problem.createSolution() ;\n solution.setObjective(0, 0.75);\n solution.setObjective(1, 0.25);\n frontToEvaluate.add(solution) ;\n\n WFGHypervolume<DoubleSolution> hypervolume = new WFGHypervolume<>() ;\n double result = hypervolume.computeHypervolume(frontToEvaluate, new ArrayPoint(new double[]{1.0, 1.0})) ;\n\n assertEquals(0.25*0.75 + 0.25*0.5, result, 0.0001) ;\n }", "public void run() {\n\t\t/* HOOKE POTENTIAL PARAMETERS */\n\t\t/* ************************** */\n\t\tPotentialLookup hookeLook;\n\t\tdouble tolerance = 1e-4;\n\t\t\n\t\tHookePotential hooke;\n\t\tdouble cBrDist = 1.91;\n\t\t// nu = 267 cm-1 from handbook of chemistry and physics\n\t\t// mu = 12.01 * 79.9 / (12.01 + 79.9) / 1000 / 6.022e23 = 1.73e-26\n\t\t// k = (2*PI*3e10*267)^2 * 1.73e-26 = 43.82\n\t\tdouble cBrSpringConstant;\n\t\tcBrSpringConstant = 43.82;\t// upper Limit\n//\t\tcBrSpringConstant /= 4;\t\t// lower limit\n\t\t\n\t\t/* ********************************** */\n\t\t/* LENNARD JONES POTENTIAL PARAMETERS */\n\t\t/* ********************************** */\n\t\tPotentialLookup ljl;\n\t\tLennardJonesPotential ljp;\n\t\tdouble lookupPrecision = 0.001;\n\t\tint Z1 = 35;\n\t\tint Z2 = 35;\n\t\tdouble Z1Z2_distance = 3.8;\n\t\tdouble zeroPotentialDistance;\n\t\tdouble wellDepth = 0.034891;\n\t\t\n\t\tzeroPotentialDistance = Z1Z2_distance / Math.pow(2., (1./6.));\n\t\tljp = new LennardJonesPotential(Z1, Z2, zeroPotentialDistance, wellDepth);\n\t\thooke = new HookePotential(6, 35, cBrDist, cBrSpringConstant);\n\n\t\tJAtom center = new JAtom(6, new JVector(0, 0, 0));\n\t\tJVector ligandPos = new JVector(1, 1, 1).unit();\n\t\tligandPos.multiply(1.91);\n\t\tJAtom ligand = new JAtom(35, ligandPos);\n\t\tIdealTetrahedron test = new IdealTetrahedron(center, ligand);\n\t\t\n\t\tVector<JAtom> tempAtoms = new Vector<JAtom>();\n\t\tfor(JAtom atom : test.getAtoms())\n\t\t\ttempAtoms.add(atom);\n\t\t\n\t\tJAtom[] atoms = new JAtom[tempAtoms.size()]; \n\t\tatoms = tempAtoms.toArray(atoms);\n//\t\twhile(true) {\n\t\t\n\t\tJAtom br = atoms[1];\n\t\tJVector brBrforce = new JVector();\n\t\tJVector betweenBr;\n\t\tdouble distBetweenBr;\n\t\tfor(int i = 2; i < atoms.length; i++) {\n\t\t\tbetweenBr = JVector.subtract(br.getPosition(), atoms[i].getPosition());\n\t\t\tdistBetweenBr = betweenBr.length();\n\t\t\tbrBrforce.add_inPlace(JVector.multiply(betweenBr.unit(), ljp.calcF(distBetweenBr)));\n\t\t\t\n\t\t}\n\t\tdouble brBrDistBefore = JVector.distance(atoms[1].getPosition(), atoms[2].getPosition());\n\t\tdouble brBrForceBefore = ljp.calcF(brBrDistBefore);\n\t\tdouble cBrDistBefore = JVector.distance(atoms[0].getPosition(), atoms[1].getPosition());\n\t\tdouble newRestingPosition = cBrDist-(brBrforce.length() / cBrSpringConstant);\n\t\thooke = new HookePotential(6, 35, newRestingPosition, cBrSpringConstant);\n\t\tdouble cBrForceBefore = hooke.calcF(cBrDistBefore);\n\t\t\n\t\t\n\t\tJAtom[][] allSurroundings = buildSurroundings(atoms);\n\t\tfor(int i = 0; i < allSurroundings.length; i++) {\n\t\t\tSystem.out.println(\"Atom type/idx: \" + atoms[i].getZ() + \"/\" + atoms[i].atomID);\n\t\t\tfor(int j = 0; j < allSurroundings[i].length; j++) {\n\t\t\t\tSystem.out.println(\"\\tSurrounding atom type/idx: \" + allSurroundings[i][j].getZ() + \n\t\t\t\t\t\t\"/\" + allSurroundings[i][j].atomID);\n\t\t\t}\n\t\t}\n\t\tJVector[] force = new JVector[atoms.length];\n\t\tfor(int i = 0; i < force.length; i++)\n\t\t\tforce[i] = new JVector();\n\t\tpotentials = new Vector<Potential>();\n\t\tpotentials.add(ljp);\n\t\tpotentials.add(hooke);\n\t\tMyPrintStream movie = new MyPrintStream(new File(\"test.xyz\"));\n\t\tmovie.println(atoms.length);\n\t\tmovie.println();\n\t\t\n\t\tint idx = 0;\n\t\twhile(idx < 100) {\n\t\t\tfor(int i = 0; i < force.length; i++) {\n\t\t\t\tforce[i].setI(0);\n\t\t\t\tforce[i].setJ(0);\n\t\t\t\tforce[i].setK(0);\n\t\t\t}\n\t\t\tcalcForces(atoms, allSurroundings, force);\n\t\t\tmoveAtoms(atoms, force);\n\t\t\tprintPositions(movie, atoms);\n//\t\t\tmovie.println();\n\t\t\tidx++;\n\t\t}\n\t\tmovie.flush();\n\t\tmovie.close();\n//\t\t}\n//\t\tSystem.out.println(\"Br-Br intramolecular force: \" + ljp.calcF(3.118993));\n//\t\tSystem.out.println(\"C-Br intramolecular force: \" + ljp.calcF(3.118993));\n\n\t\tdouble step = .05;\n\t\tdouble startVal = 1;\n\t\tdouble finishVal = 3;\n\t\tint numSteps = (int) Math.rint((finishVal - startVal) / step);\n\t\tJAtom c = atoms[0];\n\t\tbr = atoms[1];\n\t\tJVector cBrVec = JVector.subtract(br.getPosition(), c.getPosition()),\n\t\t\t\tintraMolecVec;\n\t\tdouble potVal, forceVal;\n\t\tJAtom a1, a2;\n\t\tSystem.out.println(\"Distance\\tPotentialEnergy\\tForce:\");\n\t\tfor(int i = 0; i < numSteps; i++) {\n\t\t\tcBrVec = cBrVec.unit();\n\t\t\tcBrVec.multiply(startVal + i*step);\n\t\t\tbr.setNewPos(cBrVec);\n\t\t\tforceVal = potVal = 0;\n\t\t\tfor(int a = 0; a < atoms.length; a++) {\n\t\t\t\ta1 = atoms[a];\n\t\t\t\tif(a1 == br)\n\t\t\t\t\tcontinue;\n\t\t\t\t\n\t\t\t\tintraMolecVec = JVector.subtract(br.getPosition(), a1.getPosition());\n\t\t\t\tfor(Potential pot : potentials)\n\t\t\t\t\tif(pot.check(br.getZ(), a1.getZ())) {\n\t\t\t\t\t\tforceVal += pot.calcF(intraMolecVec.length());\n\t\t\t\t\t\tpotVal += pot.calcU(intraMolecVec.length());\n\t\t\t\t\t}\n\t\t\t}\n\t\t\tSystem.out.println((startVal + i*step) + \"\\t\" + potVal + \"\\t\" + forceVal);\n\t\t}\n\t\tdouble brBrDistAfter = JVector.distance(atoms[1].getPosition(), atoms[2].getPosition());\n\t\tdouble cBrDistAfter = JVector.distance(atoms[0].getPosition(), atoms[1].getPosition());\n\t\tdouble brBrForceAfter = ljp.calcF(brBrDistAfter);\n\t\tdouble cBrForceAfter = hooke.calcF(cBrDistAfter);\n\t\tSystem.out.println(\"Br-Br intermolecular distance/force before relaxing: \" + \n\t\t\t\tbrBrDistBefore + \"/\" + brBrForceBefore);\n\t\tSystem.out.println(\"Br-Br intermolecular distance/force after relaxing: \" + \n\t\t\t\tbrBrDistAfter + \"/\" + brBrForceAfter);\n\t\tSystem.out.println(\"C-Br intermolecular distance/force before relaxing: \" + \n\t\t\t\tcBrDistBefore + \"/\" + cBrForceBefore);\n\t\tSystem.out.println(\"C-Br intermolecular distance/force after relaxing: \" + \n\t\t\t\tcBrDistAfter + \"/\" + cBrForceAfter);\n\t\t\n\t\tSystem.out.println(\"New C-Br bond distance: \" + newRestingPosition);\n\t\tSystem.out.println(\"Total Br-Br force: \" + brBrforce.length());\n\t\t\n\t}", "@Test\n public void testTransect() throws GeoTessException {\n\n double dist = Math.toRadians(60);\n double azimuth = Math.toRadians(10);\n double[] vertex1 = posLinear.getModel().getGrid().getVertex(1);\n\n //System.out.println(GeoTessUtils.getLatLonString(vertex1)); System.out.println();\n\n double[] start = GeoTessUtils.move(vertex1, dist / 2., Math.PI + azimuth);\n double[] end = GeoTessUtils.move(vertex1, dist / 2., azimuth);\n\n // build the transect data structures and populate the point positions.\n int npoints = 51;\n GreatCircle gc = new GreatCircle(start, end);\n ArrayList<double[]> points = gc.getPoints(npoints, false);\n points.set(npoints / 2, vertex1);\n\n double[] distance = new double[npoints];\n double[] valuesLinear = new double[npoints];\n double[] valuesNN = new double[npoints];\n\n for (int i = 0; i < npoints; ++i) {\n distance[i] = GeoTessUtils.angleDegrees(vertex1, points.get(i));\n if (i < npoints / 2) {\n distance[i] *= -1.;\n }\n valuesLinear[i] = 1. / posLinear.set(4, points.get(i), 1e4).getValue(0);\n }\n\n int nloops = 1; // 100000;\n posNN.set(4, points.get(0), 1e4);\n\n long timer = System.currentTimeMillis();\n for (int n = 0; n < nloops; ++n) {\n for (int i = 0; i < npoints; ++i) {\n valuesNN[i] = 1. / posNN.set(4, points.get(i), 1e4).getValue(0);\n }\n }\n timer = System.currentTimeMillis() - timer;\n //System.out.println(\"cpuTime = \"+timer);\n\n//\t\tfor (int i=0; i<npoints; ++i) System.out.printf(\"%12.6f %12.6f %12.6f%n\", \n//\t\t\t\t//GeoTessUtils.getLatLonString(points.get(i)),\n//\t\t\t\tdistance[i], valuesLinear[i], valuesNN[i]);\n//\t\t\n//\t\tfor (int i=0; i<npoints; ++i) System.out.printf(\"%1.6f, \", distance[i]);\n//\t\tSystem.out.println();\n//\t\tfor (int i=0; i<npoints; ++i) System.out.printf(\"%1.6f, \", valuesLinear[i]);\n//\t\tSystem.out.println();\n//\t\tfor (int i=0; i<npoints; ++i) System.out.printf(\"%1.6f, \", valuesNN[i]);\n//\t\tSystem.out.println();\n\n double[] expDistance = new double[]{-30.000000, -28.800000,\n -27.600000, -26.400000, -25.200000, -24.000000, -22.800000,\n -21.600000, -20.400000, -19.200000, -18.000000, -16.800000,\n -15.600000, -14.400000, -13.200000, -12.000000, -10.800000,\n -9.600000, -8.400000, -7.200000, -6.000000, -4.800000,\n -3.600000, -2.400000, -1.200000, 0.000001, 1.200000, 2.400000,\n 3.600000, 4.800000, 6.000000, 7.200000, 8.400000, 9.600000,\n 10.800000, 12.000000, 13.200000, 14.400000, 15.600000,\n 16.800000, 18.000000, 19.200000, 20.400000, 21.600000,\n 22.800000, 24.000000, 25.200000, 26.400000, 27.600000,\n 28.800000, 30.000000};\n double[] expLinear = new double[]{8.040000, 8.040000, 8.040000,\n 8.040000, 8.040000, 8.040000, 8.040000, 8.040000, 8.040000,\n 8.040000, 8.040000, 8.040000, 8.040000, 8.040000, 8.040000,\n 8.040000, 8.040000, 8.054137, 8.071930, 8.089795, 8.107838,\n 8.126071, 8.144387, 8.162803, 8.181334, 8.200000, 8.168896,\n 8.138100, 8.107579, 8.077304, 8.047246, 8.018002, 8.002167,\n 8.002729, 8.005888, 8.009046, 8.012206, 8.016119, 8.035189,\n 8.054353, 8.078359, 8.105569, 8.132947, 8.160519, 8.143446,\n 8.120925, 8.098519, 8.083079, 8.078281, 8.073490, 8.089623};\n double[] expNN = new double[]{8.040000, 8.040000, 8.040000, 8.040000,\n 8.040000, 8.040000, 8.040000, 8.040000, 8.040000, 8.040000,\n 8.040000, 8.040000, 8.040000, 8.040000, 8.040000, 8.041202,\n 8.048167, 8.058878, 8.072557, 8.089860, 8.107915, 8.126098,\n 8.143861, 8.161247, 8.179631, 8.200000, 8.162554, 8.129212,\n 8.099322, 8.072501, 8.048067, 8.023506, 8.006961, 8.004099,\n 8.005888, 8.010183, 8.016907, 8.026038, 8.038366, 8.056879,\n 8.080395, 8.104321, 8.120821, 8.128538, 8.127940, 8.118928,\n 8.103649, 8.089243, 8.080988, 8.085650, 8.097606};\n\n for (int i = 0; i < npoints; ++i) {\n assertEquals(expDistance[i], distance[i], 1e-6);\n }\n\n for (int i = 0; i < npoints; ++i) {\n assertEquals(expLinear[i], valuesLinear[i], 1e-6);\n }\n\n for (int i = 0; i < npoints; ++i) {\n assertEquals(expNN[i], valuesNN[i], 1e-6);\n }\n }", "@Test\n public void testKernel() {\n assert (ff.getKernel().inside(-1, -1, 0, 50, 0, -30, 0, 10));\n }", "public abstract double[] evaluateAt(double u, double v);", "public AABB a(World paramaqu, BlockPosition paramdt, Block parambec, float paramFloat, EnumDirection paramej)\r\n/* 147: */ {\r\n/* 148:175 */ if ((parambec.getType() == this) || (parambec.getType().getMaterial() == Material.air)) {\r\n/* 149:176 */ return null;\r\n/* 150: */ }\r\n/* 151:178 */ AABB localbrt = parambec.getType().a(paramaqu, paramdt, parambec);\r\n/* 152:180 */ if (localbrt == null) {\r\n/* 153:181 */ return null;\r\n/* 154: */ }\r\n/* 155:184 */ double d1 = localbrt.minX;\r\n/* 156:185 */ double d2 = localbrt.minY;\r\n/* 157:186 */ double d3 = localbrt.minZ;\r\n/* 158:187 */ double d4 = localbrt.maxX;\r\n/* 159:188 */ double d5 = localbrt.maxY;\r\n/* 160:189 */ double d6 = localbrt.maxZ;\r\n/* 161:192 */ if (paramej.g() < 0) {\r\n/* 162:193 */ d1 -= paramej.g() * paramFloat;\r\n/* 163: */ } else {\r\n/* 164:195 */ d4 -= paramej.g() * paramFloat;\r\n/* 165: */ }\r\n/* 166:197 */ if (paramej.h() < 0) {\r\n/* 167:198 */ d2 -= paramej.h() * paramFloat;\r\n/* 168: */ } else {\r\n/* 169:200 */ d5 -= paramej.h() * paramFloat;\r\n/* 170: */ }\r\n/* 171:202 */ if (paramej.i() < 0) {\r\n/* 172:203 */ d3 -= paramej.i() * paramFloat;\r\n/* 173: */ } else {\r\n/* 174:205 */ d6 -= paramej.i() * paramFloat;\r\n/* 175: */ }\r\n/* 176:207 */ return new AABB(d1, d2, d3, d4, d5, d6);\r\n/* 177: */ }", "@Test\n public void test22() throws Throwable {\n IllinoisSolver illinoisSolver0 = new IllinoisSolver();\n Tanh tanh0 = new Tanh();\n AllowedSolution allowedSolution0 = AllowedSolution.BELOW_SIDE;\n double double0 = illinoisSolver0.solve(16, (UnivariateRealFunction) tanh0, (-0.5), (double) 16, (-0.5), allowedSolution0);\n }", "public void FVA( ArrayList< Double > objCoefs, Double objVal, ArrayList< Double > fbasoln, ArrayList< Double > min, ArrayList< Double > max, SolverComponent component ) throws Exception;", "private float[] genBounds(TECarpentersBlock TE, int quad)\n \t{\n \t\tfloat xMin = 0.0F;\n \t\tfloat zMin = 0.0F;\n \t\tfloat xMax = 1.0F;\n \t\tfloat zMax = 1.0F;\t\t\n \t\t\n \t\tswitch (quad)\n \t\t{\n \t\tcase Collapsible.QUAD_XZNN:\n \t\t\txMax = 0.5F;\n \t\t\tzMax = 0.5F;\n \t\t\tbreak;\n \t\tcase Collapsible.QUAD_XZNP:\n \t\t\txMax = 0.5F;\n \t\t\tzMin = 0.5F;\n \t\t\tbreak;\n \t\tcase Collapsible.QUAD_XZPN:\n \t\t\txMin = 0.5F;\n \t\t\tzMax = 0.5F;\n \t\t\tbreak;\n \t\tcase Collapsible.QUAD_XZPP:\n \t\t\txMin = 0.5F;\n \t\t\tzMin = 0.5F;\n \t\t\tbreak;\n \t\t}\n \t\t\n \t\tfloat maxHeight = getMaxHeight(TE);\n \t\tfloat height = Collapsible.getQuadHeight(TE, quad) / 16.0F;\n \t\t\n \t\t/* Make quads stagger no more than 0.5F so player can always walk across them. */\n \t\tif ((maxHeight - height) > 0.5F)\n \t\t\theight = maxHeight - 0.5F;\n \t\t\n \t\treturn new float[] { xMin, 0.0F, zMin, xMax, height, zMax };\t\t\n \t}", "@Test\r\n\tpublic void testGetPlannedCapacity_Nonlinear_Interval() {\n\t\tassertEquals(0, schedulerNonlinear.getPlannedCapacityNonlinear(chargingStation, car, 0, 0, 0), 0);\r\n\t\tassertEquals(car.sumUsedPhases*600.0/3600*chargePlan[0]*CONSTANTS.CHARGING_EFFICIENCY, schedulerNonlinear.getPlannedCapacityNonlinear(chargingStation, car, 0, 300, 900), 1e-8);\r\n\t\tassertEquals(car.sumUsedPhases*150.0/3600*chargePlan[0]*CONSTANTS.CHARGING_EFFICIENCY, schedulerNonlinear.getPlannedCapacityNonlinear(chargingStation, car, 0, 450, 600), 1e-8);\r\n\t\tassertEquals(car.sumUsedPhases*600.0/3600*chargePlan[0]*CONSTANTS.CHARGING_EFFICIENCY, schedulerNonlinear.getPlannedCapacityNonlinear(chargingStation, car, 300, 900, 1500), 1e-8);\r\n\t\t\r\n\t\tassertEquals(0, schedulerNonlinear.getPlannedCapacity(chargingStation, car, 0, 0, 0), 0);\r\n\t\tassertEquals(car.sumUsedPhases*600.0/3600*chargePlan[0]*CONSTANTS.CHARGING_EFFICIENCY, schedulerNonlinear.getPlannedCapacity(chargingStation, car, 0, 300, 900), 1e-8);\r\n\t\tassertEquals(car.sumUsedPhases*150.0/3600*chargePlan[0]*CONSTANTS.CHARGING_EFFICIENCY, schedulerNonlinear.getPlannedCapacity(chargingStation, car, 0, 450, 600), 1e-8);\r\n\t\tassertEquals(car.sumUsedPhases*600.0/3600*chargePlan[0]*CONSTANTS.CHARGING_EFFICIENCY, schedulerNonlinear.getPlannedCapacity(chargingStation, car, 300, 900, 1500), 1e-8);\r\n\t\t\r\n\t\t\r\n\t}", "public void updateOptimalCollisionArea();", "@Test(timeout = 4000)\n public void test01() throws Throwable {\n Range range0 = Range.of(0L);\n range0.spliterator();\n Range.Builder range_Builder0 = new Range.Builder(range0);\n range_Builder0.expandEnd((-4622L));\n range0.toString();\n Range.CoordinateSystem range_CoordinateSystem0 = Range.CoordinateSystem.RESIDUE_BASED;\n // Undeclared exception!\n try { \n Range.CoordinateSystem.valueOf(\"vH) h-=%9V8]<4%y\");\n fail(\"Expecting exception: IllegalArgumentException\");\n \n } catch(IllegalArgumentException e) {\n //\n // No enum constant org.jcvi.jillion.core.Range.CoordinateSystem.vH) h-=%9V8]<4%y\n //\n verifyException(\"java.lang.Enum\", e);\n }\n }", "public void getProbe () {\n double prxg;\n int index;\n double effaoa = effective_aoa();\n /* get variables in the generating plane */\n if (Math.abs(ypval) < .01) ypval = .05;\n getPoints(xpval,ypval);\n\n solver.getVel(lrg,lthg);\n loadProbe();\n\n pxg = lxgt;\n pyg = lygt;\n prg = lrgt;\n pthg = lthgt;\n pxm = lxmt;\n pym = lymt;\n /* smoke */\n if (pboflag == 3 ) {\n prxg = xpval;\n for (index =1; index <=POINTS_COUNT; ++ index) {\n getPoints(prxg,ypval);\n xg[19][index] = lxgt;\n yg[19][index] = lygt;\n rg[19][index] = lrgt;\n thg[19][index] = lthgt;\n xm[19][index] = lxmt;\n ym[19][index] = lymt;\n if (stall_model_type != STALL_MODEL_IDEAL_FLOW) { // stall model\n double apos = stall_model_type == STALL_MODEL_DFLT ? +10 : stall_model_apos;\n double aneg = stall_model_type == STALL_MODEL_DFLT ? -10 : stall_model_aneg;\n if (xpval > 0.0) {\n if (effaoa > apos && ypval > 0.0) { \n ym[19][index] = ym[19][1];\n } \n if (effaoa < aneg && ypval < 0.0) {\n ym[19][index] = ym[19][1];\n }\n }\n if (xpval < 0.0) {\n if (effaoa > apos && ypval > 0.0) { \n if (xm[19][index] > 0.0) {\n ym[19][index] = ym[19][index-1];\n }\n } \n if (effaoa < aneg && ypval < 0.0) {\n if (xm[19][index] > 0.0) {\n ym[19][index] = ym[19][index-1];\n }\n }\n }\n }\n solver.getVel(lrg,lthg);\n prxg = prxg + vxdir*STEP_X;\n }\n }\n return;\n }", "@Test\n public void testNumCellsColonisedFromOutsideGrid() {\n CompletelySpatiallyRandomParams params1 = new CompletelySpatiallyRandomParams(0.1, 0);\n coloniser = new CompletelySpatiallyRandomColoniser(landCoverType, juvenilePine, juvenileOak,\n juvenileDeciduous, params1);\n assertEquals(1, coloniser.getNumCellsColonisedFromOutsideGrid());\n\n // if baseRate = 0.5 then 9 * 0.5 = 4.5 ~ 5 cells colonised from outside grid\n CompletelySpatiallyRandomParams params2 = new CompletelySpatiallyRandomParams(0.5, 0);\n coloniser = new CompletelySpatiallyRandomColoniser(landCoverType, juvenilePine, juvenileOak,\n juvenileDeciduous, params2);\n assertEquals(5, coloniser.getNumCellsColonisedFromOutsideGrid());\n }", "@Test\n public void test15() throws Throwable {\n IllinoisSolver illinoisSolver0 = new IllinoisSolver();\n Tanh tanh0 = new Tanh();\n AllowedSolution allowedSolution0 = AllowedSolution.LEFT_SIDE;\n double double0 = illinoisSolver0.solve(22, (UnivariateRealFunction) tanh0, (-0.5), (double) 22, (-0.5), allowedSolution0);\n }", "@Test\n public void solveTest5() throws ContradictionException {\n\n Set<ConstraintInfo> constraints = new HashSet<>();\n Set<Position> vars = new HashSet<>();\n Position[] varArr = new Position[]{\n this.grid.getVariable(0, 6),\n this.grid.getVariable(1, 6),\n this.grid.getVariable(2, 6),\n this.grid.getVariable(3, 6),\n this.grid.getVariable(4, 6),\n this.grid.getVariable(5, 6),\n this.grid.getVariable(6, 6),\n this.grid.getVariable(7, 6),\n this.grid.getVariable(7, 5),\n this.grid.getVariable(7, 4),\n this.grid.getVariable(7, 3),\n this.grid.getVariable(7, 2),\n this.grid.getVariable(6, 2),\n this.grid.getVariable(5, 2),\n this.grid.getVariable(5, 1),\n this.grid.getVariable(5, 0)\n };\n vars.addAll(Arrays.asList(varArr));\n ArrayList<Set<Position>> cArr = new ArrayList<>();\n for (int i = 0; i < 14; i++) cArr.add(new HashSet<>());\n add(cArr.get(0), varArr[0], varArr[1]);\n add(cArr.get(1), varArr[0], varArr[1], varArr[2]);\n add(cArr.get(2), varArr[3], varArr[1], varArr[2]);\n add(cArr.get(3), varArr[3], varArr[4], varArr[2]);\n add(cArr.get(4), varArr[3], varArr[4], varArr[5]);\n add(cArr.get(5), varArr[6], varArr[4], varArr[5]);\n add(cArr.get(6), varArr[6], varArr[7], varArr[5], varArr[8], varArr[9]);\n add(cArr.get(7), varArr[8], varArr[9], varArr[10]);\n add(cArr.get(8), varArr[9], varArr[10], varArr[11], varArr[12], varArr[13]);\n add(cArr.get(9), varArr[12], varArr[13]);\n add(cArr.get(10), varArr[13]);\n add(cArr.get(11), varArr[13], varArr[14]);\n add(cArr.get(12), varArr[13], varArr[14], varArr[15]);\n add(cArr.get(13), varArr[14], varArr[15]);\n\n int[] cVal = new int[] { 1,2,2,1,1,1,2,1,2,1,1,2,3,2 };\n for (int i = 0; i < 14; i++) {\n constraints.add(new ConstraintInfo(cArr.get(i), cVal[i]));\n }\n\n MSModel model = new MSModel(constraints, vars);\n\n Set<Position> expectedBombs = new HashSet<>();\n expectedBombs.addAll(Arrays.asList(\n this.grid.getVariable(1, 6),\n this.grid.getVariable(2, 6),\n this.grid.getVariable(5, 6),\n this.grid.getVariable(5, 0),\n this.grid.getVariable(5, 1),\n this.grid.getVariable(5, 2)\n ));\n Set<Position> expectedNoBombs = new HashSet<>();\n expectedNoBombs.addAll(Arrays.asList(\n this.grid.getVariable(6,2),\n this.grid.getVariable(0,6),\n this.grid.getVariable(3,6),\n this.grid.getVariable(4,6),\n this.grid.getVariable(6,6)\n ));\n\n for (Position pos : vars) {\n if (expectedBombs.contains(pos)) {\n assertTrue(model.hasBomb(pos));\n } else {\n assertFalse(model.hasBomb(pos));\n }\n\n if (expectedNoBombs.contains(pos)) {\n assertTrue(model.hasNoBombs(pos));\n } else {\n assertFalse(model.hasNoBombs(pos));\n }\n }\n\n /*\n 00002x???\n 00003x???\n 00002xxx?\n 0000112x?\n 0000001x?\n 1221112x?\n xxxxxxxx?\n ?????????\n */\n }", "@Override\n\tprotected boolean checkFeasible(int r, int c, int v, int k, int dept) {\n\t\tboolean ok = super.checkFeasible(r, c, v, k, dept);\n\t\tif(!ok) return false;\n\t\t\n\t\tJuryInfo J = jury.get(r);\n\t\t\n\t\tfor(int rid = 1; rid <= rooms.size(); rid++) if(rid != v){\n\t\t\tint[] p = J.getJuryMemberIDs();\n\t\t\tfor(int j = 0; j < p.length; j++){\n\t\t\t\t\n\t\t\t\tif(p[j] > 0){\n\t\t\t\t\t//System.out.println(\"PartitionJuriesToRoomsTeacherNotMove::checkFeasible(\" + r + \",\" + c + \n\t\t\t\t\t\t\t\t//\",\" + v + \", occTeacherRoom[\" + rid + \"].get(\" + p[j] + \") = \" + occTeacherRoom[rid].get(p[j]));\n\t\t\t\t\tif(occTeacherRoom[rid].get(p[j]) > 0) return false;\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t}\n\t\t\n\t\t// check if the number of hust, nonHust assigned to room v exceed the upperbound\n\t\tint var_idx = 7*r+c;\n\t\tint nbHust = 0;\n\t\tint nbNonHust = 0;\n\t\tfor(int p = 0; p < 5; p++){\n\t\t\tif(x[r*7+p] > 0){\n\t\t\t\tint tid = x[r*7+p];\n\t\t\t\tif(p == 0 || p == 4){\n\t\t\t\t\tif(!nonHustOfRoom[v].contains(tid)) nbNonHust++;\n\t\t\t\t}else{\n\t\t\t\t\tif(!hustOfRoom[v].contains(tid)) nbHust++;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\tif(hustOfRoom[v].size() + nbHust > maxHustOfRoom.get(v)) ok = false;\n\t\t//if(!ok && k >= dept) System.out.println(\"TRY(\" + k + \"), var_idx = \" + var_idx + \", r = \" + r + \", c = \" + c + \", v = \" + v + \n\t\t\t\t//\", FALSE hustOfRoom[\" + v + \"].sz = \" + hustOfRoom[v].size() + \", nbHust = \" + nbHust);\n\t\tif(nonHustOfRoom[v].size() + nbNonHust > maxNonHustOfRoom.get(v)) ok = false;\n\t\t//if(!ok && k >= dept) System.out.println(\"TRY(\" + k + \"), var_idx = \" + var_idx + \", r = \" + r + \", c = \" + c + \", v = \" + v + \n\t\t\t\t//\", FALSE nonHustOfRoom[\" + v + \"].sz = \" + nonHustOfRoom[v].size() + \", nbNonHust = \" + nbNonHust);\n\t\t\n\t\treturn ok;\n\t}", "@Test\n public void test09() throws Throwable {\n IllinoisSolver illinoisSolver0 = new IllinoisSolver();\n Tanh tanh0 = new Tanh();\n AllowedSolution allowedSolution0 = AllowedSolution.LEFT_SIDE;\n // Undeclared exception!\n try { \n illinoisSolver0.solve(16, (UnivariateRealFunction) tanh0, (-1672.701), (-4.26431539230972), (-8.575998569792264E-17), allowedSolution0);\n } catch(IllegalArgumentException e) {\n //\n // function values at endpoints do not have different signs, endpoints: [-1,672.701, -4.264], values: [-1, -1]\n //\n assertThrownBy(\"org.apache.commons.math.analysis.solvers.UnivariateRealSolverUtils\", e);\n }\n }", "@Test\n public void test_lowerBound() {\n assertThat(AbstractBoundCurveInterpolator.lowerBoundIndex(0.0d, new double[] {1, 2, 3})).isEqualTo(0);\n assertThat(AbstractBoundCurveInterpolator.lowerBoundIndex(0.5d, new double[] {1, 2, 3})).isEqualTo(0);\n assertThat(AbstractBoundCurveInterpolator.lowerBoundIndex(0.9999d, new double[] {1, 2, 3})).isEqualTo(0);\n // good input\n assertThat(AbstractBoundCurveInterpolator.lowerBoundIndex(1.0d, new double[] {1, 2, 3})).isEqualTo(0);\n assertThat(AbstractBoundCurveInterpolator.lowerBoundIndex(1.0001d, new double[] {1, 2, 3})).isEqualTo(0);\n assertThat(AbstractBoundCurveInterpolator.lowerBoundIndex(1.9999d, new double[] {1, 2, 3})).isEqualTo(0);\n assertThat(AbstractBoundCurveInterpolator.lowerBoundIndex(2.0d, new double[] {1, 2, 3})).isEqualTo(1);\n assertThat(AbstractBoundCurveInterpolator.lowerBoundIndex(2.0001d, new double[] {1, 2, 3})).isEqualTo(1);\n assertThat(AbstractBoundCurveInterpolator.lowerBoundIndex(2.9999d, new double[] {1, 2, 3})).isEqualTo(1);\n assertThat(AbstractBoundCurveInterpolator.lowerBoundIndex(3.0d, new double[] {1, 2, 3})).isEqualTo(2);\n // bad input, but still produces good output\n assertThat(AbstractBoundCurveInterpolator.lowerBoundIndex(3.0001d, new double[] {1, 2, 3})).isEqualTo(2);\n // check zero\n assertThat(AbstractBoundCurveInterpolator.lowerBoundIndex(-1.0d, new double[] {-1, 0, 1})).isEqualTo(0);\n assertThat(AbstractBoundCurveInterpolator.lowerBoundIndex(-0.9999d, new double[] {-1, 0, 1})).isEqualTo(0);\n assertThat(AbstractBoundCurveInterpolator.lowerBoundIndex(-0.0001d, new double[] {-1, 0, 1})).isEqualTo(0);\n assertThat(AbstractBoundCurveInterpolator.lowerBoundIndex(-0.0d, new double[] {-1, 0, 1})).isEqualTo(1);\n assertThat(AbstractBoundCurveInterpolator.lowerBoundIndex(0.0d, new double[] {-1, 0, 1})).isEqualTo(1);\n assertThat(AbstractBoundCurveInterpolator.lowerBoundIndex(1.0d, new double[] {-1, 0, 1})).isEqualTo(2);\n assertThat(AbstractBoundCurveInterpolator.lowerBoundIndex(1.5d, new double[] {-1, 0, 1})).isEqualTo(2);\n }", "private static double ct(double W, double Vr, double V){\n\t\t/*\n\t\t//declaring constants\n\t\tdouble A0 = 0.5766; \n\t\tdouble A1 = 1.9169;\n\t\tdouble A2 = -1.0712;\n\t\tdouble A3 = 1.6898;\n\t\t\n\t\tdouble aW = a/W;\n\t\tdouble Eqn1 = A0 + (A1*aW) + (A2*(aW*aW)) + (A3*(aW*aW*aW));\n\t\t//I don't know if they need to be able to see what the reference voltage is\n\t\tdouble Vr = initialV/Eqn1;\n\t\t*/\n\t\t//declaring constants\n\t\tdouble B0 = -0.5051;\n\t\tdouble B1 = 0.8857; \n\t\tdouble B2 = -0.1398;\n\t\tdouble B3 = 0.0002398;\n\t\t\n\t\tdouble VVr = V/Vr;\n\t\tdouble Eqn2 = B0 + (B1*VVr) + (B2*(VVr*VVr)) + (B3*(VVr*VVr*VVr));\n\t\t//crack size, A calculated for any voltage\n\t\tdouble A = Eqn2 * W;\n\t\treturn A;\n\t\t\n\t}", "private double evaluate(SXTriple span) {\n// System.err.println(\"Evaluating \" + span);\n return outside(span);\n }", "public static void main(String[] args) {\n Scanner scan = new Scanner(System.in);\n scan.useLocale(Locale.ENGLISH);\n System.out.print(\"Enter A: \");\n double A = scan.nextDouble();\n System.out.print(\"Enter B: \");\n double B = scan.nextDouble();\n System.out.print(\"Enter x: \");\n double x = scan.nextDouble();\n System.out.print(\"Enter y: \");\n double y = scan.nextDouble();\n System.out.print(\"Enter z: \");\n double z = scan.nextDouble();\n\n double minSize = Math.min(A,B);\n double maxSize = Math.max(A,B);\n double minBrick = Math.min(Math.min(x,y),z);\n double midBrick = Math.min(Math.max(x,y),z);\n\n if (A*B>=minBrick*midBrick) {\n if (minSize>=minBrick || maxSize>=midBrick) {\n System.out.println(\"True\");\n }\n } else {\n System.out.println(\"False\");\n }\n }", "public void testVelocityNumerically() {\n // crud, I don't know, how much can we expect velocity and finite differences to agree?\n double bound = dt*dt*velocity*velocity; // sure, let's go with that. Keep in mind this changes with sampling rates, velocity, the order of the function, etc.\n double endtime = racetrack.getPerimeter() / racetrack.getVelocity();\n differentiatePosition(racetrack, 0.0, endtime, dt, bound);\n }", "public LSMOP9(String solutionType, Integer numberOfVariables,\r\n\t\t\tInteger numberOfObjectives) {\r\n\t\tsuper(solutionType, numberOfVariables, numberOfObjectives);\r\n\t\tnumberOfVariables_ = numberOfVariables;\r\n\t\tnumberOfObjectives_ = numberOfObjectives;\r\n\t\tnumberOfConstraints_ = 0;\r\n\t\tproblemName_ = \"LSMOP9\";\r\n\r\n\t\tnk = 5;\r\n\t\tc = new double[numberOfObjectives_];\r\n\t\tc[0] = 3.8*0.1*(1.0-0.1);\r\n\t\tdouble sumC = c[0];\r\n\t\tfor(int i = 1; i < numberOfObjectives_; i++){\r\n\t\t\tc[i] = 3.8*c[i-1]*(1.0-c[i-1]);\r\n\t\t\tsumC += c[i];\r\n\t\t}\r\n\t\tsublen = new int[numberOfObjectives_];\r\n\t\tfor(int i = 0; i < numberOfObjectives_; i++){\r\n\t\t\t//sublen[i] = (int)Math.ceil(Math.round(numberOfVariables_*c[i]/sumC)/nk);\r\n\t\t\t//sublen[i] = (int)Math.floor(numberOfVariables_*c[i]/sumC/nk);\r\n\t\t\tsublen[i] = (int)Math.floor((numberOfVariables_-numberOfObjectives_+1)*c[i]/sumC/nk);\r\n\t\t}\r\n\t\tlen = new int[numberOfObjectives_+1]; \r\n\t\tlen[0] = 0;\r\n\t\tfor(int i = 0; i < numberOfObjectives_; i++){\r\n\t\t\tlen[i+1] = len[i] + nk*sublen[i];\r\n\t\t}\r\n\t\tlowerLimit_ = new double[numberOfVariables_];\r\n\t\tupperLimit_ = new double[numberOfVariables_];\r\n\t\tfor (int var = 0; var < numberOfObjectives_ - 1; var++) {\r\n\t\t\tlowerLimit_[var] = 0.0;\r\n\t\t\tupperLimit_[var] = 1.0;\r\n\t\t} // for\r\n\t\t\r\n\t\tfor (int var = numberOfObjectives_ - 1; var < numberOfVariables_; var++) {\r\n\t\t\tlowerLimit_[var] = 0.0;\r\n\t\t\tupperLimit_[var] = 10.0;\r\n\t\t} // for\r\n\r\n\t\tif (solutionType.compareTo(\"BinaryReal\") == 0)\r\n\t\t\tsolutionType_ = new BinaryRealSolutionType(this);\r\n\t\telse if (solutionType.compareTo(\"Real\") == 0)\r\n\t\t\tsolutionType_ = new RealSolutionType(this);\r\n\t\telse {\r\n\t\t\tSystem.out.println(\"Error: solution type \" + solutionType\r\n\t\t\t\t\t+ \" invalid\");\r\n\t\t\tSystem.exit(-1);\r\n\t\t}\r\n\t}", "@Test(timeout = 4000)\n public void test31() throws Throwable {\n Range range0 = Range.of((-1259L), 255L);\n Range.CoordinateSystem range_CoordinateSystem0 = Range.CoordinateSystem.SPACE_BASED;\n String string0 = range0.toString(range_CoordinateSystem0);\n assertEquals(\"[ -1259 .. 256 ]/SB\", string0);\n \n Range range1 = Range.of((-1259L));\n range1.getEnd();\n long long0 = range1.getEnd();\n assertEquals((-1259L), long0);\n \n Range range2 = Range.of((-1259L), 255L);\n List<Range> list0 = range2.split(255L);\n List<Range> list1 = range2.complementFrom(list0);\n Range.CoordinateSystem range_CoordinateSystem1 = Range.CoordinateSystem.SPACE_BASED;\n Range range3 = Range.of(range_CoordinateSystem1, (-1259L), 0L);\n range3.endsBefore(range0);\n Consumer<Object> consumer0 = (Consumer<Object>) mock(Consumer.class, new ViolatedAssumptionAnswer());\n range0.forEach(consumer0);\n range2.complementFrom(list1);\n assertFalse(list0.contains(range0));\n assertEquals(0, list1.size());\n assertFalse(list0.isEmpty());\n \n Range range4 = Range.ofLength(0L);\n Range range5 = range4.intersection(range0);\n long long1 = range5.getEnd();\n assertEquals((-1L), long1);\n \n range0.intersects(range4);\n range3.equals(\"[ -1259 .. 256 ]/SB\");\n Range.of(333L);\n List<Range> list2 = range2.complement(range3);\n assertTrue(list2.contains(range0));\n }", "@Test\n public void testCheckPlaceValideVerticale() throws BateauxMembreInvalide, BateauxStartPointInvalide {\n Player p = new Player();\n List<Player> pL = new ArrayList<>();\n pL.add(p);\n Jeux j = new Jeux(ModeDeJeux.MONO_JOUEUR, pL);\n Grille g = new Grille(15, 15, j, p);\n\n Place[] pl = j.checkPlace(\"A6\", g, 5, false);\n Place[] att = new Place[]{new Place(\"A6\"), new Place(\"A7\"), new Place(\"A8\"), new Place(\"A9\"), new Place(\"A10\")};\n\n assertArrayEquals(\"Les places ne sont pas bonne\", att, pl);\n }", "@Test\n public void testOverboundsInside() {\n Coordinate a, b, c, d;\n a = new Coordinate2D(2, 2, 0);\n b = new Coordinate2D(3, 3, 0);\n c = new Coordinate2D(2, 0, 0);\n d = new Coordinate2D(4, 2, 0);\n\n int actual, expected;\n\n expected = 0;\n actual = hex.getDistanceOverBoundary(a);\n assertEquals(expected, actual);\n\n expected = 0;\n actual = hex.getDistanceOverBoundary(b);\n assertEquals(expected, actual);\n\n expected = 0;\n actual = hex.getDistanceOverBoundary(c);\n assertEquals(expected, actual);\n\n expected = 0;\n actual = hex.getDistanceOverBoundary(d);\n assertEquals(expected, actual);\n }", "@Test\n public void test17() throws Throwable {\n IllinoisSolver illinoisSolver0 = new IllinoisSolver();\n Tanh tanh0 = new Tanh();\n AllowedSolution allowedSolution0 = AllowedSolution.LEFT_SIDE;\n double double0 = illinoisSolver0.solve(16, (UnivariateRealFunction) tanh0, (-8.575998569792264E-17), 2.384185791015625E-7, allowedSolution0);\n }", "@Test\n public void computeResult_resultAlwaysInsideProvidedBoundaries() {\n int datasetSize = 10;\n for (int i = 0; i < 100; ++i) {\n Random random = new Random();\n double lower = random.nextDouble() * 100;\n double upper = lower + random.nextDouble() * 100;\n\n variance =\n BoundedVariance.builder()\n .epsilon(EPSILON)\n .noise(new LaplaceNoise())\n .maxPartitionsContributed(1)\n .maxContributionsPerPartition(1)\n .lower(lower)\n .upper(upper)\n .build();\n\n List<Double> dataset =\n random\n .doubles()\n .map(x -> x * 300 * getRandomSign(random))\n .limit(datasetSize)\n .boxed()\n .collect(toImmutableList());\n\n variance.addEntries(dataset);\n\n assertWithMessage(\n \"lower = %s\\nupper = %s\\ndataset = [%s]\",\n lower, upper, dataset.stream().map(x -> Double.toString(x)).collect(joining(\",\\n\")))\n .that(variance.computeResult())\n .isIn(Range.closed(0.0, (upper - lower) * (upper - lower) / 4.0));\n }\n }", "boolean is_inside(float v[])\r\n {\r\n int i;\r\n \r\n for (i = 0; i < dimension; i++)\r\n {\r\n if (v[i] < bounces[2*i] || // upper limit\r\n v[i] > bounces[2*i + 1]) // lower limit\r\n return false;\r\n }\r\n return true;\r\n }", "@Test\n public void testJuvenilesAddedToCellsWithCorrespondingMatureLct() {\n params = new CompletelySpatiallyRandomParams(0, 0);\n coloniser = new CompletelySpatiallyRandomColoniser(landCoverType, juvenilePine, juvenileOak,\n juvenileDeciduous, params);\n coloniser.updateJuvenilePresenceLayers();\n\n List<GridLoc> cellsWithMatureOak = new ArrayList<>(Arrays.asList(\n new GridLoc(1, 1), new GridLoc(1, 2), new GridLoc(2, 2)));\n\n List<GridLoc> cellsWithMaturePine = new ArrayList<>(Arrays.asList(\n new GridLoc(2, 0), new GridLoc(2, 1)));\n\n List<GridLoc> cellsWithMatureDeciduous = new ArrayList<>(Arrays.asList(\n new GridLoc(1, 0)));\n\n for (GridLoc loc : cellsWithMatureOak) {\n assertEquals(SeedPresence.True.getCode(), (int) juvenileOak.getValue(loc));\n assertEquals(SeedPresence.False.getCode(), (int) juvenilePine.getValue(loc));\n assertEquals(SeedPresence.False.getCode(), (int) juvenileDeciduous.getValue(loc));\n }\n\n for (GridLoc loc : cellsWithMaturePine) {\n assertEquals(SeedPresence.False.getCode(), (int) juvenileOak.getValue(loc));\n assertEquals(SeedPresence.True.getCode(), (int) juvenilePine.getValue(loc));\n assertEquals(SeedPresence.False.getCode(), (int) juvenileDeciduous.getValue(loc));\n }\n\n for (GridLoc loc : cellsWithMatureDeciduous) {\n assertEquals(SeedPresence.False.getCode(), (int) juvenileOak.getValue(loc));\n assertEquals(SeedPresence.False.getCode(), (int) juvenilePine.getValue(loc));\n assertEquals(SeedPresence.True.getCode(), (int) juvenileDeciduous.getValue(loc));\n }\n }", "public void testContain_Stress() throws Exception {\n // the test start time.\n long startTime = System.currentTimeMillis();\n // run the test for RUN_TIMES times.\n for (int i = 0; i < StressTestsHelper.RUN_TIMES; i++) {\n for (int j = 0; j < 50; j++) {\n for (int k = 0; k < 50; k++) {\n this.lifelineSegment.contains(j, k);\n }\n }\n }\n // output the time used.\n long endTime = System.currentTimeMillis();\n System.out.println(\"Run \" + StressTestsHelper.RUN_TIMES\n + \" LifelineSegment#contains(int x, int y) method takes \" + (endTime - startTime) + \"ms\");\n\n }", "public static void worldTimeStep() {\r\n \t\r\n \t//remake the hash map based on the x and y coordinates of the critters\r\n \tremakeMap(population);\r\n \t\r\n \t//Iterate through the grid positions in the population HashMap\r\n \tIterator<String> populationIter = population.keySet().iterator();\r\n \twhile (populationIter.hasNext()) { \r\n String pos = populationIter.next();\r\n ArrayList<Critter> critterList = population.get(pos);\r\n \r\n //Iterate through the critters ArrayList \r\n ListIterator<Critter> currCritter = critterList.listIterator();\r\n while(currCritter.hasNext()) {\r\n \tCritter thisCritter = currCritter.next();\r\n \tthisCritter.hasMoved = false;\r\n \tthisCritter.doTimeStep();\r\n \tif(thisCritter.hasMoved || thisCritter.getEnergy() <= 0) {\r\n \t\tcurrCritter.remove();\r\n \t} else {\r\n \t\tcurrCritter.set(thisCritter);\r\n \t}\r\n }\r\n population.replace(pos, critterList);\r\n }\r\n \t\r\n \tfixPopulation();\r\n \tmergePopulationMoved(populationMoved);\r\n \t\r\n \tdoEncounters();\r\n \t\r\n \tfixPopulation();\r\n \tmergePopulationMoved(populationMoved); //Stage 1 Complete\r\n \r\n \t//deduct resting energy cost from all critters in the hash map\r\n \t//could do a FOR EACH loop instead of iterator -- fixed\r\n \tpopulationIter = population.keySet().iterator();\r\n \twhile(populationIter.hasNext()) {\r\n \t\tString pos = populationIter.next();\r\n ArrayList<Critter> critterList = population.get(pos);\r\n \r\n //Iterate through the Critters attached to the keys in the Hash Map\r\n ListIterator<Critter> currCritter = critterList.listIterator();\r\n while(currCritter.hasNext()) {\r\n \tCritter thisCritter = currCritter.next();\r\n \t//deduct the rest energy cost from each critter\r\n \tthisCritter.energy = thisCritter.energy - Params.REST_ENERGY_COST;\r\n \t//remove all critters that have died after reducing the rest energy cost\r\n \tif(thisCritter.getEnergy() <= 0) {\r\n \t\tcurrCritter.remove();\r\n \t} else {\r\n \t\tcurrCritter.set(thisCritter);\r\n \t}\r\n }\r\n population.replace(pos, critterList);\r\n \t}\r\n \t\r\n \tmergePopulationMoved(babies);\r\n \t\r\n \t\r\n \t//add the clovers in each refresh of the world \r\n \ttry {\r\n \t\tfor(int j = 0; j < Params.REFRESH_CLOVER_COUNT; j++) {\r\n \t\t\tcreateCritter(\"Clover\");\r\n \t\t}\r\n \t} catch(InvalidCritterException p) {\r\n \t\tp.printStackTrace();\r\n \t}\r\n }", "public static native int OpenMM_AmoebaTorsionTorsionForce_usesPeriodicBoundaryConditions(PointerByReference target);", "@Test(timeout = 4000)\n public void test027() throws Throwable {\n Range range0 = Range.of((-81L));\n Range range1 = Range.of((-1L));\n boolean boolean0 = range0.intersects(range1);\n assertFalse(boolean0);\n assertFalse(range1.isEmpty());\n \n Range.Comparators.values();\n long long0 = range0.getBegin();\n assertEquals((-81L), long0);\n }", "@Test\n public void testFind_East_cross_boundary() {\n\n double lat1 = 0.0;\n double lon1 = 170.0;\n double lat2 = 0.0;\n double lon2 = -170.0;\n double expResult = Math.toRadians(90);\n double result = Azimuth.find(lat1, lon1, lat2, lon2);\n assertEquals(expResult, result, 0.0);\n }", "@Override\n\tpublic void evaluar(int resistencia, int capacidad, int velocidad) {\n\t\t\n\t}", "public void b(World paramaqu, Random paramRandom, BlockPosition paramdt, Block parambec)\r\n/* 77: */ {\r\n/* 78: 93 */ BlockPosition localdt1 = paramdt.up();\r\n/* 79: */ label260:\r\n/* 80: 95 */ for (int i = 0; i < 128; i++)\r\n/* 81: */ {\r\n/* 82: 96 */ BlockPosition localdt2 = localdt1;\r\n/* 83: 97 */ for (int j = 0; j < i / 16; j++)\r\n/* 84: */ {\r\n/* 85: 98 */ localdt2 = localdt2.offset(paramRandom.nextInt(3) - 1, (paramRandom.nextInt(3) - 1) * paramRandom.nextInt(3) / 2, paramRandom.nextInt(3) - 1);\r\n/* 86: 99 */ if ((paramaqu.getBlock(localdt2.down()).getType() != BlockList.grass) || (paramaqu.getBlock(localdt2).getType().blocksMovement())) {\r\n/* 87: */ break label260;\r\n/* 88: */ }\r\n/* 89: */ }\r\n/* 90:104 */ if (paramaqu.getBlock(localdt2).getType().material == Material.air)\r\n/* 91: */ {\r\n/* 92: */ Object localObject;\r\n/* 93:108 */ if (paramRandom.nextInt(8) == 0)\r\n/* 94: */ {\r\n/* 95:109 */ localObject = paramaqu.b(localdt2).a(paramRandom, localdt2);\r\n/* 96:110 */ avy localavy = ((EnumFlowerVariant)localObject).a().a();\r\n/* 97:111 */ Block localbec = localavy.instance().setData(localavy.l(), (Comparable)localObject);\r\n/* 98:112 */ if (localavy.f(paramaqu, localdt2, localbec)) {\r\n/* 99:113 */ paramaqu.setBlock(localdt2, localbec, 3);\r\n/* 100: */ }\r\n/* 101: */ }\r\n/* 102: */ else\r\n/* 103: */ {\r\n/* 104:116 */ localObject = BlockList.tallgrass.instance().setData(bbh.a, bbi.b);\r\n/* 105:117 */ if (BlockList.tallgrass.f(paramaqu, localdt2, (Block)localObject)) {\r\n/* 106:118 */ paramaqu.setBlock(localdt2, (Block)localObject, 3);\r\n/* 107: */ }\r\n/* 108: */ }\r\n/* 109: */ }\r\n/* 110: */ }\r\n/* 111: */ }", "public double visinaStolpca(int ixStolpec, double wp, double hp) {\n // popravite / dopolnite ...\n return hp/biggest * podatki[ixStolpec];\n }", "public void breakPointEvaluation(int j, int t) {\n \n\tint dcIndex=workloadGenerator.objectListRegion[j];\n\tfinalCostCalculation fc= new finalCostCalculation();\n\tint a_c=workloadGenerator.objectListWriteRate[j][t]*optimizationCost.readToWrite+\n\t\t\t(int)((objectDatacenterSpecification.getDatacenterListAll().get(dcIndex).getCbandwidthCost()*\n\t\t\t\t\tfinalCostCalculation.newBucketSize[j][t])); \n\tint l_c=(workloadGenerator.objectListWriteRate[j][t]*optimizationCost.readToWrite)*fc.latencyWithinDatacenter(dcIndex, 0, 0);//0:Cool tier, 0:read\n\t\n\tint a_h=workloadGenerator.objectListWriteRate[j][t]*(int)(objectDatacenterSpecification.getDatacenterListAll().get(dcIndex).getHStorageCost()); \n\tint s_h=(int)(objectDatacenterSpecification.getDatacenterListAll().get(dcIndex).getHStorageCost()*finalCostCalculation.newBucketSize[j][t]);\n\t \n\t breakPoint=(int)Math.ceil((double)(a_c+l_c-a_h)/(double)(s_h)) ;\n\t\n\t //System.out.println(\"breakPoint for DoubleCopy===>\"+breakPoint);\n\t \n }", "public static native int OpenMM_AmoebaPiTorsionForce_usesPeriodicBoundaryConditions(PointerByReference target);", "public static void main(String[] args) {\n\t\tint array0[] = new int[0];\r\n\t\tint array3[] = new int[3];\r\n\t\tint array5[] = new int[5];\r\n\t\tint array15[] = new int[15];\r\n\t\tint array16[] = new int[16];\r\n\t\tint array17[] = new int[17];\r\n\t\tint array19[] = new int[19];\r\n\t\tint array20[] = new int[20];\r\n\t\tint array200[] = new int[200];\r\n\t\tint array1000[] = new int[1000];\r\n\r\n\t\t// iX => integer with value X\r\n\t\tint i0 = 0;\r\n\t\tint i20 = 20;\r\n\t\tint i1 = 1;\r\n\t\tint i2 = 2;\r\n\t\tint i3 = 3;\r\n\t\tint i4 = 4;\r\n\t\tint i_5 = -5;\r\n\t\tint p = i2 * i_5; // p is [-10,-10]\r\n\r\n\t\tarray0[0] = 5; // Illegal upper bound\r\n\r\n\t\tarray0[1] = 5; // Illegal upper bound\r\n\r\n\t\tarray5[p] = 5; // Illegal lower bound\r\n\r\n\t\tp = 2 * i2; // p is [4,4]\r\n\r\n\t\tarray5[p] = 5; // Good\r\n\r\n\t\tp *= p; // p is [16,16]\r\n\r\n\t\tarray16[p] = 5; // Illegal upper bound (legal index range is 0-15)\r\n\r\n\t\tarray17[p] = 5; // Good\r\n\r\n\t\tp = i2 * i3; // p is [6,6]\r\n\r\n\t\tboolean b = args.length == 0;\r\n\r\n\t\tif (b) {\r\n\t\t\tp = p * i3; // p is [18,18]\r\n\t\t}\r\n\r\n\t\t// now p is [6,18]\r\n\r\n\t\tarray17[p] = 5; // Potentially illegal upper bound\r\n\t\tarray19[p] = 5; // Good\r\n\r\n\t\tp = 2; // p is [2,2]\r\n\r\n\t\tfor (int i = 0; i < 5; i++) {\r\n\t\t\tp *= 2;\r\n\t\t}\r\n\r\n\t\t// now p is [2,INF]\r\n\r\n\t\tarray19[p] = 5; // Potentially illegal upper bound // TODO problem\r\n\r\n\t\tp = p - 4; // p is [-2,INF]\r\n\r\n\t\tarray1000[p] = 5; // Potentially illegal lower and upper bounds\r\n\r\n\t\tp = 2; // p is [2,2]\r\n\r\n\t\tfor (int i = 0; i < 5; i++) {\r\n\t\t\tarray3[i] = 5; // Potentially illegal upper bound\r\n\t\t\tarray16[i] = 5; // Good\r\n\t\t\tp *= -2;\r\n\t\t}\r\n\r\n\t\tint i = 5, j = 10;\r\n\r\n\t\tif (b) {\r\n\t\t\ti = 15;\r\n\t\t\tj = 20;\r\n\t\t}\r\n\r\n\t\t// now i is [5,15], j is [10,20]\r\n\r\n\t\tif (i != j) {\r\n\t\t\tarray16[j] = 5; // Potentially illegal upper bound\r\n\t\t} else {\r\n\t\t\tarray16[j] = 5; // Good\r\n\t\t}\r\n\r\n\t\t// p is [-INF,INF]\r\n\r\n\t\tarray1000[p] = 5; // Potentially illegal lower and upper bounds\r\n\r\n\t}", "@Test\r\n\tpublic void testGetPlannedCapacity_Linear_Interval() {\n\t\tassertEquals(car.sumUsedPhases*600.0/3600*chargePlan[0]*CONSTANTS.CHARGING_EFFICIENCY, schedulerLinear.getPlannedCapacityNonlinear(chargingStation, car, 0, 300, 900), 1e-8);\r\n\t\tassertEquals(car.sumUsedPhases*150.0/3600*chargePlan[0]*CONSTANTS.CHARGING_EFFICIENCY, schedulerLinear.getPlannedCapacityNonlinear(chargingStation, car, 0, 450, 600), 1e-8);\r\n\t\tassertEquals(car.sumUsedPhases*600.0/3600*chargePlan[0]*CONSTANTS.CHARGING_EFFICIENCY, schedulerLinear.getPlannedCapacityNonlinear(chargingStation, car, 300, 900, 1500), 1e-8);\r\n\t\t\t\t\r\n\t\t\r\n\t}", "public Point3 intersects(Plane3 p) {\n // All the constants will be the position vector, i.e., some point on the line\n if (intersect.DEBUG) System.out.println(\"Constant Terms: <\" + this.pt + \">\");\n\n // λ coefficients will be all those in the direction vector of the line\n if (intersect.DEBUG) System.out.println(\"λ coefficients: \" + this);\n\n // Plane equation is each component multiplied by the respective normal\n // vector of the plane\n if (intersect.DEBUG) System.out.printf(\"Plane equation: %.1f(%.1f + %.1fλ) + %.1f(%.1f + %.1fλ) + %.1f(%.1f + %.1fλ) = %.3f\\n\", p.v.x, pt.x, this.x, p.v.y, pt.y, this.y, p.v.z, pt.z, this.z, p.d);\n\n // Gather all constant terms from the plane equation\n double constantTerm = (p.v.x * pt.x) + (p.v.y * pt.y) + (p.v.z * pt.z);\n if (intersect.DEBUG) System.out.printf(\"K: %.2f\\t\", constantTerm);\n\n // Gather all λ terms\n double lambdaCoefficient = (p.v.x * this.x) + (p.v.y * this.y) + (p.v.z * this.z);\n if (intersect.DEBUG) System.out.printf(\"K_λ: %.1f\\n\", lambdaCoefficient);\n\n // If the coefficient for lambda is zero, we have a degenerate case\n if (lambdaCoefficient == 0) {\n // If the constant is the same as the actual magnitude of the plane's\n // normal vector, the line lies on the plane\n // Within a margin of error because rounding is a pain in the ass\n if (Math.abs(constantTerm - p.d) < 1e-6)\n intersect.overlapFlag = true;\n\n return null;\n }\n\n // Solve for the unknown, λ.\n double lambda = (p.d - constantTerm) / lambdaCoefficient;\n if (intersect.DEBUG) System.out.printf(\"λ: %.2f\\n\", lambda);\n\n // Plug in λ into the parametric equations for the line to find\n // point of intersection\n double newX = lambda * this.x + pt.x;\n double newY = lambda * this.y + pt.y;\n double newZ = lambda * this.z + pt.z;\n return new Point3(newX, newY, newZ);\n }", "@Test\n public void test16() throws Throwable {\n double[] doubleArray0 = new double[4];\n doubleArray0[0] = (-1600.0035307559176);\n doubleArray0[1] = 1149.7346327967;\n doubleArray0[2] = (-1608.690170583074);\n PolynomialFunctionLagrangeForm polynomialFunctionLagrangeForm0 = new PolynomialFunctionLagrangeForm(doubleArray0, doubleArray0);\n try { \n UnivariateRealSolverUtils.bracket((UnivariateRealFunction) polynomialFunctionLagrangeForm0, 0.8868335868819226, 0.8868335868819226, 1.0, 4761);\n fail(\"Expecting exception: Exception\");\n \n } catch(Exception e) {\n //\n // number of iterations=1, maximum iterations=4,761, initial=0.887, lower bound=0.887, upper bound=1, final a value=0.887, final b value=1, f(a)=0.887, f(b)=1\n //\n assertThrownBy(\"org.apache.commons.math.analysis.solvers.UnivariateRealSolverUtils\", e);\n }\n }", "@Test(timeout = 4000)\n public void test25() throws Throwable {\n Range.Builder range_Builder0 = new Range.Builder();\n range_Builder0.contractBegin(0L);\n range_Builder0.copy();\n range_Builder0.copy();\n Range range0 = range_Builder0.build();\n range_Builder0.shift(265L);\n LinkedList<Range> linkedList0 = new LinkedList<Range>();\n linkedList0.add(range0);\n range0.complementFrom(linkedList0);\n Range range1 = Range.of((-3234L));\n range0.isSubRangeOf(range1);\n Range.CoordinateSystem range_CoordinateSystem0 = Range.CoordinateSystem.RESIDUE_BASED;\n range0.complementFrom(linkedList0);\n range1.intersects(range0);\n // Undeclared exception!\n try { \n Range.Comparators.valueOf(\"TGa_,[\");\n fail(\"Expecting exception: IllegalArgumentException\");\n \n } catch(IllegalArgumentException e) {\n //\n // No enum constant org.jcvi.jillion.core.Range.Comparators.TGa_,[\n //\n verifyException(\"java.lang.Enum\", e);\n }\n }", "public void computeBoundingBox() {\n\taveragePosition = new Point3(center);\n tMat.rightMultiply(averagePosition);\n \n minBound = new Point3(Double.POSITIVE_INFINITY, Double.POSITIVE_INFINITY, Double.POSITIVE_INFINITY);\n maxBound = new Point3(Double.POSITIVE_INFINITY, Double.POSITIVE_INFINITY, Double.POSITIVE_INFINITY);\n // Initialize\n Point3[] v = new Point3[8];\n for (int i = 0; i < 8; i++)\n \tv[i] = new Point3(center);\n // Vertices of the box\n v[0].add(new Vector3(-radius, -radius, -height/2.0));\n v[1].add(new Vector3(-radius, radius, -height/2.0));\n v[2].add(new Vector3(radius, -radius, -height/2.0));\n v[3].add(new Vector3(radius, radius, -height/2.0));\n v[4].add(new Vector3(-radius, -radius, height/2.0));\n v[5].add(new Vector3(-radius, radius, height/2.0));\n v[6].add(new Vector3(radius, -radius, height/2.0));\n v[7].add(new Vector3(radius, radius, height/2.0));\n // Update minBound and maxBound\n for (int i = 0; i < 8; i++)\n {\n \ttMat.rightMultiply(v[i]);\n \tif (v[i].x < minBound.x)\n \t\tminBound.x = v[i].x;\n \tif (v[i].x > maxBound.x)\n \t\tmaxBound.x = v[i].x;\n \tif (v[i].y < minBound.y)\n \t\tminBound.y = v[i].y;\n \tif (v[i].y > maxBound.y)\n \t\tmaxBound.y = v[i].y;\n \tif (v[i].z < minBound.z)\n \t\tminBound.z = v[i].z;\n \tif (v[i].z > maxBound.z)\n \t\tmaxBound.z = v[i].z;\n }\n \n }", "static double fitness(vmnode[] vms, jobnode[] jobs, int[] assigned, HashMap<Integer, Integer> map, double[][] ect) {\n double libd = LIBD(vms, jobs, assigned);\n double makesp = calcmakespan(map, ect);\n return libd * makesp;\n }", "@Test\n public void test23() throws Throwable {\n IllinoisSolver illinoisSolver0 = new IllinoisSolver(1.0);\n Floor floor0 = new Floor();\n AllowedSolution allowedSolution0 = AllowedSolution.RIGHT_SIDE;\n double double0 = illinoisSolver0.solve(2297949, (UnivariateRealFunction) floor0, 0.5, 1.0, allowedSolution0);\n double double1 = illinoisSolver0.doSolve();\n }", "@Test\n\tpublic void eastSWC()\t\n\t{\n\t\tData d = new Data();\n\t\td.set(20, 43);\n\t\td.set(22, 54);\n\t\td.set(26, 33);\n\t\td.set(28, 76);\n\t\td.set(30, 87);\n\t\td.set(1, 44);\n\t\td.set(2, 55);\n\t\td.set(3, 66);\n\t\td.set(4, 77);\n\t\td.set(5, 88);\n\t\td.set(19, 99);\n\t\tArrayList<Coordinate> test_arr = d.shieldWallCapture(99);\n\t\tassertTrue(10==test_arr.get(0).getX() && 7==test_arr.get(0).getY()\n\t\t\t&& 10==test_arr.get(1).getX() && 6==test_arr.get(1).getY()\n\t\t\t&& 10==test_arr.get(2).getX() && 5==test_arr.get(2).getY()\n\t\t\t&& 10==test_arr.get(3).getX() && 4==test_arr.get(3).getY()\n\t\t\t&& 10==test_arr.get(4).getX() && 3==test_arr.get(4).getY());\n\t}", "boolean isBoundVariable(Formula f);", "R visitBoundVariable(Formula f, int deBruijnIdx);", "private void doVels() {\n\t\tthis.launchPerVel = Math.sqrt((2d * body.getGm() * this.launchApoAlt) / (this.launchPerAlt * this.a));\n\t\tthis.launchApoVel = Math.sqrt((2d * body.getGm() * this.launchPerAlt) / (this.launchApoAlt * this.a));\n\t}", "@SuppressWarnings(\"unused\")\r\n private void findAbdomenVOI() {\r\n \r\n // find the center of mass of the single label object in the sliceBuffer (abdomenImage)\r\n findAbdomenCM();\r\n int xcm = centerOfMass[0];\r\n int ycm = centerOfMass[1];\r\n\r\n ArrayList<Integer> xValsAbdomenVOI = new ArrayList<Integer>();\r\n ArrayList<Integer> yValsAbdomenVOI = new ArrayList<Integer>();\r\n\r\n // angle in radians\r\n double angleRad;\r\n \r\n for (int angle = 39; angle < 45; angle += 3) {\r\n int x, y, yOffset;\r\n double scaleFactor; // reduces the number of trig operations that must be performed\r\n \r\n angleRad = Math.PI * angle / 180.0;\r\n if (angle > 315 || angle <= 45) {\r\n scaleFactor = Math.tan(angleRad);\r\n x = xDim;\r\n y = ycm;\r\n yOffset = y * xDim;\r\n while (x > xcm && sliceBuffer[yOffset + x] != abdomenTissueLabel) {\r\n x--;\r\n y = ycm - (int)((x - xcm) * scaleFactor);\r\n yOffset = y * xDim;\r\n }\r\n xValsAbdomenVOI.add(x);\r\n yValsAbdomenVOI.add(y);\r\n \r\n } else if (angle > 45 && angle <= 135) {\r\n scaleFactor = (Math.tan((Math.PI / 2.0) - angleRad));\r\n x = xcm;\r\n y = 0;\r\n yOffset = y * xDim;\r\n while (y < ycm && sliceBuffer[yOffset + x] != abdomenTissueLabel) {\r\n y++;\r\n x = xcm + (int)((ycm - y) * scaleFactor);\r\n yOffset = y * xDim;\r\n }\r\n xValsAbdomenVOI.add(x);\r\n yValsAbdomenVOI.add(y);\r\n \r\n } else if (angle > 135 && angle <= 225) {\r\n scaleFactor = Math.tan(Math.PI - angleRad);\r\n x = 0;\r\n y = ycm;\r\n yOffset = y * xDim;\r\n while (x < xcm && sliceBuffer[yOffset + x] != abdomenTissueLabel) {\r\n x++;\r\n y = ycm - (int)((xcm - x) * scaleFactor);\r\n yOffset = y * xDim;\r\n }\r\n xValsAbdomenVOI.add(x);\r\n yValsAbdomenVOI.add(y);\r\n \r\n } else if (angle > 225 && angle <= 315) {\r\n scaleFactor = Math.tan((3.0 * Math.PI / 2.0) - angleRad);\r\n x = xcm;\r\n y = yDim;\r\n yOffset = y * xDim;\r\n while (y < yDim && sliceBuffer[yOffset + x] == abdomenTissueLabel) {\r\n y--;\r\n x = xcm - (int)((y - ycm) * scaleFactor);\r\n yOffset = y * xDim;\r\n }\r\n xValsAbdomenVOI.add(x);\r\n yValsAbdomenVOI.add(y);\r\n \r\n }\r\n } // end for (angle = 0; ...\r\n \r\n int[] x1 = new int[xValsAbdomenVOI.size()];\r\n int[] y1 = new int[xValsAbdomenVOI.size()];\r\n int[] z1 = new int[xValsAbdomenVOI.size()];\r\n for(int idx = 0; idx < xValsAbdomenVOI.size(); idx++) {\r\n x1[idx] = xValsAbdomenVOI.get(idx);\r\n y1[idx] = xValsAbdomenVOI.get(idx);\r\n z1[idx] = 0;\r\n }\r\n\r\n // make the VOI's and add the points to them\r\n abdomenVOI = new VOI((short)0, \"Abdomen\");\r\n abdomenVOI.importCurve(x1, y1, z1);\r\n\r\n\r\n }", "public double getValue(double x, double y){\n\n\tint i,j;\n\tdouble fracX,fracY;\n\tdouble Wxm, Wx0, Wxp, Wym, Wy0, Wyp;\n\tdouble Vm, V0, Vp;\n\n\n\tif(x < x_min || y < y_min || x > x_max || y > y_max){\n\t return z_min;\n\t}\n\n i = (int) ((x-x_min)/x_step + 0.5);\n j = (int) ((y-y_min)/y_step + 0.5);\n\n if( i < 1) i = 1;\n if( i > (nX-2)) i = nX-2;\n if( j < 1) j = 1;\n if( j > (nY-2)) j = nY-2;\t \n\n fracX = (x - x_min - i*x_step)/x_step;\n fracY = (y - y_min - j*y_step)/y_step;\n\n\tWxm = 0.5*(0.5 - fracX)*(0.5 - fracX);\n\tWxp = 0.5*(0.5 + fracX)*(0.5 + fracX);\n\tWx0 = 0.75 - fracX*fracX;\n\n\tWym = 0.5*(0.5 - fracY)*(0.5 - fracY);\n\tWyp = 0.5*(0.5 + fracY)*(0.5 + fracY);\n\tWy0 = 0.75 - fracY*fracY;\n\n\tVm = Wxm*gridData[i-1][j-1]+Wx0*gridData[i][j-1]+Wxp*gridData[i+1][j-1];\n\tV0 = Wxm*gridData[i-1][j] +Wx0*gridData[i][j] +Wxp*gridData[i+1][j];\n\tVp = Wxm*gridData[i-1][j+1]+Wx0*gridData[i][j+1]+Wxp*gridData[i+1][j+1];\n\n return Wym*Vm + Wy0*V0 + Wyp*Vp;\n }", "public static native int OpenMM_AmoebaInPlaneAngleForce_usesPeriodicBoundaryConditions(PointerByReference target);", "public static void main(String[] args) throws Exception{\n Scanner scan = new Scanner(System.in);\n //DecimalFormat form = new DecimalFormat(\"0.000\");\n \n int n = scan.nextInt();\n for(int i = 0; i < n; i++)\n {\n int nAnt = scan.nextInt();\n double xMax = -1000;\n double xMin = 1000;\n double yMax = -1000;\n double yMin = 1000;\n for(int j = 0; j < nAnt; j++)\n {\n double x = scan.nextDouble();\n double y = scan.nextDouble();\n if(x > xMax)\n xMax = x;\n if(x < xMin)\n xMin = x;\n if(y > yMax)\n yMax = y;\n if(y < yMin)\n yMin = y;\n }\n double xLen = xMax - xMin;\n double yLen = yMax - yMin;\n String area = \"\"+(xLen * yLen);\n String per = \"\"+(xLen * 2 + yLen * 2);\n System.out.println(\"Case \"+(i+1)+\": Area \"+area+\", Perimeter \"+per);\n }\n System.exit(0);\n }", "@Test\n public void test06() throws Throwable {\n IllinoisSolver illinoisSolver0 = new IllinoisSolver();\n Tanh tanh0 = new Tanh();\n AllowedSolution allowedSolution0 = AllowedSolution.RIGHT_SIDE;\n // Undeclared exception!\n try { \n illinoisSolver0.solve(16, (UnivariateRealFunction) tanh0, 4.833322802454349E-9, 2.384185791015625E-7, allowedSolution0);\n } catch(IllegalArgumentException e) {\n //\n // function values at endpoints do not have different signs, endpoints: [0, 0], values: [0, 0]\n //\n assertThrownBy(\"org.apache.commons.math.analysis.solvers.UnivariateRealSolverUtils\", e);\n }\n }", "@Override\n public void run()\n {\n final int minX = region.getMinimumPoint().getX();\n final int minZ = region.getMinimumPoint().getZ();\n final int maxX = region.getMaximumPoint().getX();\n final int maxZ = region.getMaximumPoint().getZ();\n final int midX = (maxX - minX) / 2;\n final int midZ = (maxZ - minZ) / 2;\n double playerY = player.getLocation().getY();\n\n if (midX / 6 > 0)\n {\n int tmp = 0;\n final int amount = midX / 5;\n for (int i = 0; i < amount; i++)\n {\n final int x = minX + midX - tmp;\n final int x2 = minX + midX + tmp;\n for (double y = playerY - 10; y <= playerY + 10; y++)\n {\n player.spawnParticle(Particle.FLAME, x, y, minZ, 0);\n player.spawnParticle(Particle.FLAME, x, y, maxZ, 0);\n player.spawnParticle(Particle.FLAME, x2, y, minZ, 0);\n player.spawnParticle(Particle.FLAME, x2, y, maxZ, 0);\n }\n tmp += 5;\n }\n }\n if (midZ / 6 > 0)\n {\n int tmp = 0;\n final int amount = midZ / 5;\n for (int i = 0; i < amount; i++)\n {\n final int z = minZ + midZ - tmp;\n final int z2 = minZ + midZ + tmp;\n\n for (double y = playerY - 10; y <= playerY + 10; y++)\n {\n player.spawnParticle(Particle.FLAME, minX, y, z, 0);\n player.spawnParticle(Particle.FLAME, maxX, y, z, 0);\n player.spawnParticle(Particle.FLAME, minX, y, z2, 0);\n player.spawnParticle(Particle.FLAME, maxX, y, z2, 0);\n }\n tmp += 5;\n }\n }\n\n for (double y = playerY - 40; y <= 256; y++)\n {\n player.spawnParticle(Particle.FLAME, minX, y, minZ, 0);\n player.spawnParticle(Particle.FLAME, minX, y, maxZ, 0);\n player.spawnParticle(Particle.FLAME, maxX, y, minZ, 0);\n player.spawnParticle(Particle.FLAME, maxX, y, maxZ, 0);\n }\n timer--;\n\n if (0 > this.timer)\n {\n player.sendMessage(\"§5Boundaries have been expired.\");\n this.cancel();\n }\n }", "private void initMinMax(final Configuration currentConfiguration,\n\t\t\tfinal Map<DateTime, Position> minX,\n\t\t\tfinal Map<DateTime, Position> maxX,\n\t\t\tfinal Map<DateTime, Velocity> minV,\n\t\t\tfinal Map<DateTime, Velocity> maxV,\n\t\t\tfinal Map<DateTime, Amount<Power>> minCharges) {\n\n\t\t// set minX, maxX, minV, maxV\n\t\tfor (PossibleRun possibleRun : currentConfiguration\n\t\t\t\t.getPossibleRunsConfiguration().getPossibleRuns()) {\n\t\t\tAmount<Power> minXThisDim = Amount.valueOf(Double.NaN, Power.UNIT);\n\t\t\tAmount<Power> maxXThisDim = Amount.valueOf(Double.NaN, Power.UNIT);\n\n\t\t\tswitch (possibleRun.getLoadFlexibilityOfRun()) {\n\t\t\tcase FIXED:\n\t\t\t\tfor (Slot slot : possibleRun.getNeededSlots()) {\n\t\t\t\t\tif (slot.getLoad().isLessThan(minXThisDim)) {\n\t\t\t\t\t\tminXThisDim = slot.getLoad();\n\t\t\t\t\t}\n\t\t\t\t\tif (slot.getLoad().isGreaterThan(maxXThisDim)) {\n\t\t\t\t\t\tmaxXThisDim = slot.getLoad();\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tbreak;\n\t\t\tcase LIMITED_CHOICE:\n\t\t\t\tif (possibleRun.getPossibleLoads().isEmpty()) {\n\t\t\t\t\tthrow new UnsupportedOperationException(\n\t\t\t\t\t\t\t\"Possible Loads must contain at least one element!\");\n\t\t\t\t}\n\t\t\t\tminXThisDim = Amount.valueOf(0, Power.UNIT);\n\t\t\t\tmaxXThisDim = Amount.valueOf(possibleRun.getPossibleLoads()\n\t\t\t\t\t\t.size() - 1, Power.UNIT);\n//\t\t\t\tLOG.trace(\n//\t\t\t\t\t\t\"There are {} possibilities for run with start date {}\",\n//\t\t\t\t\t\tpossibleRun.getPossibleLoads().size(),\n//\t\t\t\t\t\tpossibleRun.getEarliestStartTime());\n\t\t\t\tbreak;\n\t\t\tcase RANGE:\n\t\t\t\tminXThisDim = possibleRun.getRangeOfPossibleLoads()\n\t\t\t\t\t\t.lowerEndpoint();\n\t\t\t\tmaxXThisDim = possibleRun.getRangeOfPossibleLoads()\n\t\t\t\t\t\t.upperEndpoint();\n\t\t\t\tLOG.trace(\n\t\t\t\t\t\t\"Run with start date {} has dimension limits {} to {}\",\n\t\t\t\t\t\tpossibleRun.getEarliestStartTime(), minXThisDim,\n\t\t\t\t\t\tmaxXThisDim);\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\tbreak;\n\t\t\t}\n\n\t\t\tminX.put(possibleRun.getEarliestStartTime(), new Position(\n\t\t\t\t\tpossibleRun, minXThisDim));\n\t\t\tmaxX.put(possibleRun.getEarliestStartTime(), new Position(\n\t\t\t\t\tpossibleRun, maxXThisDim));\n\n\t\t\tminV.put(possibleRun.getEarliestStartTime(), new Velocity(\n\t\t\t\t\tpossibleRun, minXThisDim.minus(maxXThisDim)));\n\t\t\tmaxV.put(possibleRun.getEarliestStartTime(), new Velocity(\n\t\t\t\t\tpossibleRun, maxXThisDim.minus(minXThisDim)));\n\t\t}\n\n\t\t// incorporate no charging times!\n\t\tRunConstraint constraint = currentConfiguration\n\t\t\t\t.getPossibleRunsConfiguration().getRunConstraint();\n\t\tfor (DateTime noCharge : constraint.getLossOfEnergyAtPointsInTime()\n\t\t\t\t.keySet()) {\n\t\t\tif (minX.containsKey(noCharge)) {\n\t\t\t\tPossibleRun run = minX.get(noCharge).getPossibleRun();\n\n\t\t\t\tif (LoadFlexiblity.LIMITED_CHOICE.equals(run\n\t\t\t\t\t\t.getLoadFlexibilityOfRun())) {\n\t\t\t\t\tminX.get(noCharge).setChosenValue(\n\t\t\t\t\t\t\tgetZeroChargeForLimitedChoice(run));\n\t\t\t\t} else if (LoadFlexiblity.RANGE.equals(run\n\t\t\t\t\t\t.getLoadFlexibilityOfRun())) {\n\t\t\t\t\tminX.get(noCharge).setChosenValue(\n\t\t\t\t\t\t\tAmount.valueOf(0, Power.UNIT));\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (maxX.containsKey(noCharge)) {\n\t\t\t\tPossibleRun run = maxX.get(noCharge).getPossibleRun();\n\n\t\t\t\tif (LoadFlexiblity.LIMITED_CHOICE.equals(run\n\t\t\t\t\t\t.getLoadFlexibilityOfRun())) {\n\t\t\t\t\tmaxX.get(noCharge).setChosenValue(\n\t\t\t\t\t\t\tgetZeroChargeForLimitedChoice(run));\n\t\t\t\t} else if (LoadFlexiblity.RANGE.equals(run\n\t\t\t\t\t\t.getLoadFlexibilityOfRun())) {\n\t\t\t\t\tmaxX.get(noCharge).setChosenValue(\n\t\t\t\t\t\t\tAmount.valueOf(0, Power.UNIT));\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (minV.containsKey(noCharge)) {\n\t\t\t\tminV.get(noCharge)\n\t\t\t\t\t\t.setChosenValue(Amount.valueOf(0, Power.UNIT));\n\t\t\t}\n\t\t\tif (maxV.containsKey(noCharge)) {\n\t\t\t\tmaxV.get(noCharge)\n\t\t\t\t\t\t.setChosenValue(Amount.valueOf(0, Power.UNIT));\n\t\t\t}\n\t\t}\n\n\t\t// set minCharges\n\t\tAmount<Power> powerToCharge = Amount.valueOf(0, Power.UNIT);\n\t\tAmount<Power> lastValueOfChargesAtPointsInTime = Amount.valueOf(0,\n\t\t\t\tPower.UNIT);\n\t\tSet<DateTime> reverseKeys = ImmutableSortedSet.copyOf(minX.keySet())\n\t\t\t\t.descendingSet();\n\t\tfor (DateTime now : reverseKeys) {\n\t\t\tif (!lastValueOfChargesAtPointsInTime.approximates(Amount.valueOf(\n\t\t\t\t\t0, Power.UNIT))) {\n\t\t\t\tpowerToCharge = powerToCharge\n\t\t\t\t\t\t.plus(lastValueOfChargesAtPointsInTime);\n\t\t\t\tlastValueOfChargesAtPointsInTime = Amount\n\t\t\t\t\t\t.valueOf(0, Power.UNIT);\n\t\t\t}\n\n\t\t\tif (constraint.getChargesAtPointsInTime().containsKey(now)) {\n\t\t\t\tlastValueOfChargesAtPointsInTime = constraint\n\t\t\t\t\t\t.getChargesAtPointsInTime().get(now);\n\t\t\t}\n\n\t\t\tPossibleRun run = minX.get(now).getPossibleRun();\n\n\t\t\tif (powerToCharge.approximates(Amount.valueOf(0, Power.UNIT))\n\t\t\t\t\t|| powerToCharge.isLessThan(Amount.valueOf(0, Power.UNIT))) {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tdouble hours = run.getLengthOfRun().toStandardMinutes()\n\t\t\t\t\t.getMinutes()\n\t\t\t\t\t/ HOUR_IN_MINUTES;\n\t\t\tAmount<Power> charge = null;\n\t\t\tif (LoadFlexiblity.LIMITED_CHOICE.equals(run\n\t\t\t\t\t.getLoadFlexibilityOfRun())) {\n\t\t\t\tfor (Amount<Power> possibleLoad : run.getPossibleLoads()) {\n\t\t\t\t\tif (possibleLoad.isLessThan(Amount.valueOf(0, Power.UNIT))) {\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\n\t\t\t\t\tcharge = possibleLoad;\n\n\t\t\t\t\tif (charge.times(hours).isGreaterThan(powerToCharge)) {\n\t\t\t\t\t\tcharge = powerToCharge.divide(hours);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tif (charge == null) {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tAmount<Power> maxChargeNow = maxX.get(now).getChosenValue();\n\t\t\t\tif (powerToCharge.isGreaterThan(maxChargeNow)) {\n\t\t\t\t\tcharge = maxChargeNow;\n\t\t\t\t} else if (powerToCharge.isGreaterThan(Amount.valueOf(0,\n\t\t\t\t\t\tPower.UNIT))) {\n\t\t\t\t\tcharge = powerToCharge;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tminCharges.put(now, powerToCharge);\n\t\t\tpowerToCharge = powerToCharge.minus(charge.times(hours));\n\t\t}\n\n\t\tif (powerToCharge.isGreaterThan(Amount.valueOf(0, Power.UNIT))) {\n\t\t\tLOG.debug(\"powerToCharge is greater than 0, which means that the charging constraints cannot be satisfied!\");\n\t\t}\n\t}", "private float checkVertical(Point2D.Float position, int firepower, boolean pierce, int blockHeight) {\r\n float value = position.y; // Start at the origin tile\r\n\r\n outer: for (int i = 1; i <= firepower; i++) {\r\n // Expand one tile at a time\r\n value += blockHeight;\r\n\r\n // Check this tile for wall collision\r\n for (int index = 0; index < GameObjectCollection.tileObjects.size(); index++) {\r\n TileObject obj = GameObjectCollection.tileObjects.get(index);\r\n if (obj.collider.contains(position.x, value)) {\r\n if (!obj.isBreakable()) {\r\n // Hard wall found, move value back to the tile before\r\n value -= blockHeight;\r\n }\r\n\r\n // Stop checking for tile objects after the first breakable is found\r\n if (!pierce) {\r\n break outer;\r\n }\r\n }\r\n }\r\n }\r\n\r\n return value;\r\n }", "@Test(timeout = 4000)\n public void test29() throws Throwable {\n Range range0 = Range.of(0L, 0L);\n Range.Builder range_Builder0 = new Range.Builder(range0);\n Range.Builder range_Builder1 = range_Builder0.copy();\n Range range1 = range_Builder1.build();\n long long0 = 9223372036854775807L;\n range_Builder1.shift(9223372036854775807L);\n LinkedList<Range> linkedList0 = new LinkedList<Range>();\n linkedList0.add(range0);\n Range.CoordinateSystem range_CoordinateSystem0 = Range.CoordinateSystem.ZERO_BASED;\n Range range2 = Range.of(range_CoordinateSystem0, 243L, 466L);\n range2.isSubRangeOf(range1);\n Range range3 = Range.of((-636L), (-636L));\n range3.complement(range2);\n range1.intersects(range3);\n // Undeclared exception!\n try { \n Range.Comparators.valueOf((String) null);\n fail(\"Expecting exception: NullPointerException\");\n \n } catch(NullPointerException e) {\n //\n // Name is null\n //\n verifyException(\"java.lang.Enum\", e);\n }\n }", "public static native int OpenMM_AmoebaOutOfPlaneBendForce_usesPeriodicBoundaryConditions(PointerByReference target);", "private double computeForcesWithinCells() {\r\n double potentialEnergy = 0;\r\n \r\n for (int i = 0; i < nXCells; i++) {\r\n for (int j = 0; j < nYCells; j++) {\r\n for (Molecule m1 = cells[i][j].firstMolecule; m1 != null; m1 = m1.nextMoleculeInCell) {\r\n for (Molecule m2 = m1.nextMoleculeInCell; m2 != null; m2 = m2.nextMoleculeInCell) {\r\n double pe = computeForceBetweenMolecules(m1, m2);\r\n if (pe != 0) {\r\n potentialEnergy += pe;\r\n }\r\n }\r\n }\r\n }\r\n }\r\n return potentialEnergy;\r\n }", "@Test(timeout = 4000)\n public void test083() throws Throwable {\n Range.CoordinateSystem range_CoordinateSystem0 = Range.CoordinateSystem.RESIDUE_BASED;\n Range range0 = Range.of(range_CoordinateSystem0, (-999L), (-999L));\n Range range1 = Range.of((-999L), (-999L));\n range1.getEnd();\n Range.CoordinateSystem range_CoordinateSystem1 = Range.CoordinateSystem.RESIDUE_BASED;\n range0.toString(range_CoordinateSystem1);\n Object object0 = new Object();\n range0.equals(range1);\n Range.CoordinateSystem.values();\n Range.CoordinateSystem.values();\n range1.equals(range_CoordinateSystem0);\n Range.CoordinateSystem[] range_CoordinateSystemArray0 = Range.CoordinateSystem.values();\n assertEquals(3, range_CoordinateSystemArray0.length);\n }", "@Test\n public void test19() throws Throwable {\n IllinoisSolver illinoisSolver0 = new IllinoisSolver();\n Tanh tanh0 = new Tanh();\n AllowedSolution allowedSolution0 = AllowedSolution.LEFT_SIDE;\n double double0 = illinoisSolver0.solve(16, (UnivariateRealFunction) tanh0, (-0.5), (double) 16, (-0.5), allowedSolution0);\n }", "@Test\r\n\tpublic void testGetPlannedCapacity_Nonlinear() {\n\t\tassertEquals(car.sumUsedPhases*900.0/3600*chargePlan[0]*CONSTANTS.CHARGING_EFFICIENCY, schedulerNonlinear.getPlannedCapacityNonlinear(chargingStation, car, 0, 0, 900), 1e-8);\r\n\t\tassertEquals(car.sumUsedPhases*600.0/3600*chargePlan[0]*CONSTANTS.CHARGING_EFFICIENCY, schedulerNonlinear.getPlannedCapacityNonlinear(chargingStation, car, 300, 300, 900), 1e-8);\r\n\t\tassertEquals(car.sumUsedPhases*600.0/3600*chargePlan[0]*CONSTANTS.CHARGING_EFFICIENCY, schedulerNonlinear.getPlannedCapacityNonlinear(chargingStation, car, 0, 0, 600), 1e-8);\r\n\t\tassertEquals(car.sumUsedPhases*300.0/3600*chargePlan[0]*CONSTANTS.CHARGING_EFFICIENCY, schedulerNonlinear.getPlannedCapacityNonlinear(chargingStation, car, 300, 300, 600), 1e-8);\r\n\t\tassertEquals(car.sumUsedPhases*1200.0/3600*chargePlan[0]*CONSTANTS.CHARGING_EFFICIENCY, schedulerNonlinear.getPlannedCapacityNonlinear(chargingStation, car, 300, 300, 1500), 1e-8);\r\n\t\t\r\n\t}", "public static void main(String[] args) throws FileNotFoundException, IOException {\nfor (double b = 0.5; b < 0.51; b+=0.1) {\n for (double k = 4.40; k < 4.5; k+=0.5) {\n Machine.b = 0.5; //0.2 - ATCnon-delay\n Machine.k = 1.5; //1.4 - ATCnon delay\n int hits = 0;\n engineJob = new cern.jet.random.engine.MersenneTwister(99999);\n noise = new cern.jet.random.Normal(0, 1, engineJob);\n SmallStatistics[] result = new SmallStatistics[5];\n result[0] = new SmallStatistics();\n result[1] = new SmallStatistics();\n for (int ds = 0; ds < 2; ds++) {\n JSPFramework[] jspTesting = new JSPFramework[105];\n for (int i = 0; i < jspTesting.length; i++) {\n jspTesting[i] = new JSPFramework();\n jspTesting[i].getJSPdata(i*2 + 1);\n }\n //DMU - instances (1-80)//la - instances (81-120)\n //mt - instances (121/-123)//orb - instances (124-133)//ta -instances (134-173)\n //////////////////////////////////////////////\n for (int i = 0; i < jspTesting.length; i++) {\n double countEval = 0;\n double tempObj = Double.POSITIVE_INFINITY;\n double globalBest = Double.POSITIVE_INFINITY;\n boolean[] isApplied_Nk = new boolean[2]; //Arrays.fill(isApplied_Nk, Boolean.TRUE);\n int Nk = 0; // index of the Iterative dispatching rule to be used\n jspTesting[i].resetALL();\n boolean firstIteration = true;\n double countLargeStep = 0;\n do{\n countEval++;\n //start evaluate schedule\n jspTesting[i].reset();\n int N = jspTesting[i].getNumberofOperations();\n jspTesting[i].initilizeSchedule();\n int nScheduledOp = 0;\n\n //choose the next machine to be schedule\n while (nScheduledOp<N){\n\n Machine M = jspTesting[i].Machines[jspTesting[i].nextMachine()];\n\n jspTesting[i].setScheduleStrategy(Machine.scheduleStrategy.HYBRID );\n jspTesting[i].setPriorityType(Machine.priorityType.ATC);\n jspTesting[i].setNonDelayFactor(0.3);\n //*\n jspTesting[i].setInitalPriority(M);\n for (Job J:M.getQueue()) {\n double RJ = J.getReadyTime();\n double RO = J.getNumberRemainingOperations();\n double RT = J.getRemainingProcessingTime();\n double PR = J.getCurrentOperationProcessingTime();\n double W = J.getWeight();\n double DD = J.getDuedate();\n double RM = M.getReadyTime();\n double RWT = J.getCurrentOperationWaitingTime();\n double RFT = J.getFinishTime();\n double RNWT = J.getNextOperationWaitingTime();\n int nextMachine = J.getNextMachine();\n\n if (nextMachine==-1){\n RNWT=0;\n } else {\n RNWT = J.getNextOperationWaitingTime();\n if (RNWT == -1){\n RNWT = jspTesting[i].getMachines()[nextMachine].getQueueWorkload()/2.0;\n }\n }\n if (RWT == -1){\n RWT = M.getQueueWorkload()/2.0;\n }\n //J.addPriority((W/PR)*Math.exp(-maxPlus((DD-RM-PR-(RT-PR+J.getRemainingWaitingTime(M)))/(3*M.getQueueWorkload()/M.getNumberofJobInQueue())))); //iATC\n //J.addPriority((PR*PR*0.614577*(-RM-RM/W)-RT*PR*RT/W)\n // -(RT*PR/(W-0.5214191)-RM/W*PR*0.614577+RT*PR/(W-0.5214191)*2*RM/W));\n //J.addPriority(((W/PR)*((W/PR)/(RFT*RFT)))/(max(div((RFT-RT),(RWT/W)),IF(RFT/W-max(RFT-RT,DD),DD,RFT))+DD/RFT+RFT/W-max(RFT-RFT/W,DD))); //best TWT priorityIterative\n if (Nk==0)\n //J.addPriority(min(W/PR-RFT+min(RT,W/RFT),((min(RT,RNWT-RFT)/(RJ-min(RWT,RFT*0.067633785)))/(RJ-min(RWT,RFT*0.067633785))))/RFT);\n J.addPriority(min(W/PR-RFT+min(RT,W/RFT),((div(min(RT,RNWT-RFT),(RJ-min(RWT,RFT*0.067633785))))/(RJ-min(RWT,RFT*0.067633785))))/RFT);\n else\n J.addPriority(min((((W/PR)/RFT)/(2*RNWT+max(RO,RFT)))/(PR+RNWT+max(RO,RFT)),((W/PR)/RFT)/PR)/RFT);\n }\n //jspTesting[i].calculatePriority(M);\n jspTesting[i].sortJobInQueue(M);\n Job J = M.completeJob();\n if (!J.isCompleted()) jspTesting[i].Machines[J.getCurrentMachine()].joinQueue(J);\n nScheduledOp++;\n }\n double currentObj = -100;\n currentObj = jspTesting[i].getTotalWeightedTardiness();\n if (tempObj > currentObj){\n tempObj = currentObj;\n jspTesting[i].recordSchedule();\n Arrays.fill(isApplied_Nk, Boolean.FALSE);\n //System.out.println(\"Improved!!!\");\n }\n else {\n isApplied_Nk[Nk] = true;\n if (!isNextApplied(Nk, isApplied_Nk)) Nk = circleShift(Nk, isApplied_Nk.length);\n else {\n if (globalBest>tempObj) {\n globalBest = tempObj;\n jspTesting[i].storeBestRecordSchedule();\n } jspTesting[i].restoreBestRecordSchedule();\n if (countLargeStep<1) {\n tempObj = Double.POSITIVE_INFINITY;\n Arrays.fill(isApplied_Nk, Boolean.FALSE);\n jspTesting[i].shakeRecordSchedule(noise, engineJob, globalBest);\n countLargeStep++;\n }\n else break;\n }\n }\n firstIteration = false;\n \n } while(true);\n result[ds].add(jspTesting[i].getDevREFTotalWeightedTardiness(globalBest));\n if (jspTesting[i].getDevLBCmax()==0) hits++;\n System.out.println(jspTesting[i].instanceName + \" & \"+ globalBest + \" & \" + countEval);\n }\n }\n //jsp.schedule();\n //*\n System.out.println(\"*************************************************************************\");\n System.out.println(\"[ & \" + formatter.format(result[0].getMin()) + \" & \"\n + formatter.format(result[0].getAverage()) + \" & \" + formatter.format(result[0].getMax()) +\n \" & \" + formatter.format(result[1].getMin()) + \" & \"\n + formatter.format(result[1].getAverage()) + \" & \" + formatter.format(result[1].getMax()) + \"]\");\n //*/\n System.out.print(\"\"+formatter.format(result[0].getAverage()) + \" \");\n }\n System.out.println(\"\");\n}\n }", "private void checkIfConstant()\r\n/* 23: */ {\r\n/* 24: 49 */ boolean isConstant = true;\r\n/* 25: 50 */ int c = 0;\r\n/* 26: 50 */ for (int max = getChildCount(); c < max; c++)\r\n/* 27: */ {\r\n/* 28: 51 */ SpelNode child = getChild(c);\r\n/* 29: 52 */ if (!(child instanceof Literal)) {\r\n/* 30: 53 */ if ((child instanceof InlineList))\r\n/* 31: */ {\r\n/* 32: 54 */ InlineList inlineList = (InlineList)child;\r\n/* 33: 55 */ if (!inlineList.isConstant()) {\r\n/* 34: 56 */ isConstant = false;\r\n/* 35: */ }\r\n/* 36: */ }\r\n/* 37: */ else\r\n/* 38: */ {\r\n/* 39: 59 */ isConstant = false;\r\n/* 40: */ }\r\n/* 41: */ }\r\n/* 42: */ }\r\n/* 43: 63 */ if (isConstant)\r\n/* 44: */ {\r\n/* 45: 64 */ List<Object> constantList = new ArrayList();\r\n/* 46: 65 */ int childcount = getChildCount();\r\n/* 47: 66 */ for (int c = 0; c < childcount; c++)\r\n/* 48: */ {\r\n/* 49: 67 */ SpelNode child = getChild(c);\r\n/* 50: 68 */ if ((child instanceof Literal)) {\r\n/* 51: 69 */ constantList.add(((Literal)child).getLiteralValue().getValue());\r\n/* 52: 70 */ } else if ((child instanceof InlineList)) {\r\n/* 53: 71 */ constantList.add(((InlineList)child).getConstantValue());\r\n/* 54: */ }\r\n/* 55: */ }\r\n/* 56: 74 */ this.constant = new TypedValue(Collections.unmodifiableList(constantList));\r\n/* 57: */ }\r\n/* 58: */ }", "@Test\n public void testCheckPlaceValideHorizontale() throws BateauxMembreInvalide, BateauxStartPointInvalide {\n Player p = new Player();\n List<Player> pL = new ArrayList<>();\n pL.add(p);\n Jeux j = new Jeux(ModeDeJeux.MONO_JOUEUR, pL);\n Grille g = new Grille(15, 15, j, p);\n\n Place[] pl = j.checkPlace(\"A6\", g, 5, true);\n Place[] att = new Place[]{new Place(\"A6\"), new Place(\"B6\"), new Place(\"C6\"), new Place(\"D6\"), new Place(\"E6\")};\n\n assertArrayEquals(\"Les places ne sont pas bonne\", att, pl);\n }", "private static void test(int xy, int si, int sj, int ei, int ej, int[][] blocked){\n System.out.println(\"\\n\\nTest Case #\"+tCase);tCase++;\n //Reset\n long start_time = System.nanoTime();\n grid = new Cell[xy][xy];\n closed = new boolean[xy][xy];\n open = new PriorityQueue<>((Object o1, Object o2) -> {\n Cell c1 = (Cell)o1;\n Cell c2 = (Cell)o2;\n\n return Integer.compare(c1.finalCost, c2.finalCost);\n });\n //Set start position\n setStartCell(si, sj); //Setting to 0,0 by default\n\n //Set End Location\n setEndCell(ei, ej);\n\n for(int i=0;i<xy;++i){\n for(int j=0;j<xy;++j){\n grid[i][j] = new Cell(i, j);\n grid[i][j].heuristicCost = Math.abs(i-endI)+Math.abs(j-endJ);\n //System.out.print(grid[i][j].heuristicCost+\" \");\n }\n //System.out.println();\n }\n grid[si][sj].finalCost = 0;\n\n //Set blocked cells to null\n for (int bX = 0; bX < blocked.length; bX++) {\n for (int bY = 0; bY < blocked.length; bY++)\n if (blocked[bX][bY] == 1)\n setBlocked(bX, bY);\n }\n\n String[][] maze = new String[xy][xy];\n //Display initial map\n System.out.println(\"Grid: \");\n char block = '▋';\n String open = \"[]\";\n for(int i=0;i<xy;++i){\n for(int j=0;j<xy;++j){\n if(i==si&&j==sj){ System.out.print(\"SO \"); //Source\n maze[i][j] = \"SO \"; }\n else if(i==ei && j==ej){ System.out.print(\"DE \"); //Destination\n maze[i][j] = \"DE \"; }\n else if(grid[i][j]!=null){ System.out.print(open + \" \");\n maze[i][j] = open + \" \"; }\n else{ System.out.print(block + \" \");\n maze[i][j] = block + \" \"; }\n }\n System.out.println();\n }\n System.out.println();\n\n AStar();\n System.out.println(\"\\nScores for cells: \");\n for(int i=0;i<xy;++i){\n for(int j=0;j<xy;++j){\n if(grid[i][j]!=null)System.out.printf(\"%-4d \", grid[i][j].finalCost);\n else System.out.print(block + \" \");\n }\n System.out.println();\n }\n System.out.println();\n\n if(closed[endI][endJ]){\n //Trace back the path\n System.out.println(\"Path: \");\n Cell current = grid[endI][endJ];\n System.out.print(current);\n ArrayList<Cell> path = new ArrayList<>();\n path.add(current);\n while(current.parent!=null){\n System.out.print(\" -> \"+current.parent);\n current = current.parent;\n path.add(current);\n }\n System.out.println(\"\\n\");\n\n Collections.reverse(path);\n\n for (Cell index : path) {\n if (path.contains(index))\n maze[index.i][index.j] = \"- \";\n }\n\n //Display final path\n System.out.println(\"Final Path: \");\n System.out.println(path.toString() + \"\\n\");\n\n for(int i=0;i<xy;++i) {\n for (int j = 0; j < xy; ++j) {\n if(i==si&&j==sj)System.out.print(\"SO \"); //Source\n else if(i==ei && j==ej)System.out.print(\"DE \"); //Destination\n else System.out.print(maze[i][j]);\n }\n System.out.println();\n }\n\n System.out.println();\n }else System.out.println(\"No possible path\");\n\n long end_time = System.nanoTime();\n double difference = (end_time - start_time) / 1e6;\n\n System.out.println(difference + \"ms\\n\");\n\n }", "@Test\n public void computeSpaceTest() {\n //2D test\n double[] envelopeA = new double[4];\n double[] envelopeB = new double[4];\n\n envelopeA[0] = -6; envelopeA[2] = 2;\n envelopeA[1] = -2; envelopeA[3] = 7;\n\n //edge\n Assert.assertEquals(\"computeSpaceTest : get edge (perimeter)\", 34, getPerimeter(envelopeA), EPSILON);\n\n //area\n Assert.assertEquals(\"computeSpaceTest : get area\", 72, getArea(envelopeA), EPSILON);\n\n //bulk\n try {\n getBulk(envelopeA);\n Assert.fail(\"test should had fail\");\n } catch (Exception ex) {\n //ok\n }\n\n //overlaps\n envelopeB[0] = 0; envelopeB[2] = 4;\n envelopeB[1] = 3; envelopeB[3] = 10;\n Assert.assertEquals(\"computeSpaceTest : getOverlaps\", 8, getOverlapValue(envelopeA, envelopeB), EPSILON);\n Assert.assertEquals(\"computeSpaceTest : getOverlaps\", 8, getOverlapValue(envelopeB, envelopeA), EPSILON);\n assertEquals(\"computeSpaceTest : getOverlaps with intersection\", 8, getArea(intersect(envelopeA, envelopeB)), EPSILON);\n\n //3D+ test\n envelopeA = new double[6];\n envelopeB = new double[6];\n\n envelopeA[0] = -6; envelopeA[3] = 2;\n envelopeA[1] = -2; envelopeA[4] = 7;\n envelopeA[2] = -9; envelopeA[5] = 5;\n\n //area\n Assert.assertEquals(\"computeSpaceTest : get area\", 620, getArea(envelopeA), EPSILON);\n\n //bulk\n Assert.assertEquals(\"computeSpaceTest : get bulk\", 1008, getBulk(envelopeA), EPSILON);\n\n //overlaps\n envelopeB[0] = 0; envelopeB[3] = 4;\n envelopeB[1] = 3; envelopeB[4] = 10;\n envelopeB[2] = -2; envelopeB[5] = 3;\n Assert.assertEquals(\"computeSpaceTest : getOverlaps\", 40, getOverlapValue(envelopeA, envelopeB), EPSILON);\n Assert.assertEquals(\"computeSpaceTest : getOverlaps\", 40, getOverlapValue(envelopeB, envelopeA), EPSILON);\n assertEquals(\"computeSpaceTest : getOverlaps with intersection\", 40, getBulk(intersect(envelopeA, envelopeB)), EPSILON);\n }", "public void calcObjective() {\n double obj;\n double objectives[];\n\n for (int i = 0; i < population.getPopulationSize(); i++) { //300\n objectives = population.getObjectiveValues(i);\n obj = evaluateAll(population.getSingleChromosome(i)); //evaluateAll(chromosome chromosome1)\n objectives[indexOfObjective] = obj;\n population.setObjectiveValue(i, objectives);\n }\n }", "private List<VariableCoefficientTuple> getVariablesUsedForBranchingInThisRectangle(Rectangle rect){\r\n List<VariableCoefficientTuple> variablesUsedForBranchingInThisRectangle = new ArrayList<VariableCoefficientTuple> ();\r\n \r\n for (String var : rect.zeroFixedVariables) {\r\n if (!treeNode_zeroFixedVariables.contains(var) ) \r\n variablesUsedForBranchingInThisRectangle.add(new VariableCoefficientTuple(var, ZERO) );\r\n }\r\n for (String var : rect.oneFixedVariables){ \r\n if ( !treeNode_oneFixedVariables.contains(var)) {\r\n variablesUsedForBranchingInThisRectangle.add(new VariableCoefficientTuple(var, ONE));\r\n } \r\n }\r\n \r\n return variablesUsedForBranchingInThisRectangle;\r\n }", "abstract public RandomRange getPlunderRange(Unit attacker);", "public void runAlgorithm(PointList customers, int highwayLength, int velocity) {\n\t\t\n\t\tif (!customers.isEmpty()){\n\t\t\tthis._highwayLength = highwayLength;\n\t\t\tthis._velocity = velocity;\n\t\t\t_maxDist = customers.maxDist();\n\t\t\t\n\t\t\t// for drawing purposes only\n\t\t\tfacilityPoints = new ArrayList<Point>();\n\t\t\tturnpikePoints = new ArrayList<Point>();\n\t\t\tpartitionRadius = new ArrayList<Double>();\n\t\t\t\n\t\t\tset_withTurnpike = new ArrayList<PointList>();\n\t\t\tset_withoutTurnpike = new ArrayList<PointList>();\n\t\t\textremePoints1 = new ArrayList<Point[]>();\n\t\t\textremePoints2 = new ArrayList<Point[]>();\n\t\t\tlist_centersWithoutTurnpike = new ArrayList<PointList>();\n\t\t\tlist_centersWithTurnpike = new ArrayList<PointList>();\n\t\t\t\n\t\t\tgetPartition(customers);\n\t\t\t\n\t\t\tmaxDist1 = new ArrayList<Point>();\n\t\t\tmaxDist2 = new ArrayList<Point>();\n\t\t\tminDist1 = new ArrayList<Point>();\n\t\t\tminDist2 = new ArrayList<Point>();\n\t\t\t\n\t\t\t// compute extreme points\n\t\t\tfor (PointList p : set_withTurnpike){\n\t\t\t\textremePoints1.add(p.getExtremePoints());\n\t\t\t}\n\t\t\tfor (PointList p : set_withoutTurnpike){\n\t\t\t\textremePoints2.add(p.getExtremePoints());\n\t\t\t}\n\t\t\t\n\t\t\t// solve basic problem for all partitions {W,H}\n\t\t\tfor (int i = 0; i < set_withTurnpike.size(); i++){\n\n\t\t\t\t_eps1 = Math.max(0, set_withTurnpike.get(i).delta() + highwayLength/velocity - set_withoutTurnpike.get(i).delta());\n\t\t\t\t_eps2 = Math.max(0, set_withoutTurnpike.get(i).delta() - set_withTurnpike.get(i).delta() - highwayLength/velocity);\n\n\t\t\t\tsolveBP(set_withTurnpike.get(i), set_withoutTurnpike.get(i)); \n\t\t\t\tfacilityPoints.add(_currentFacility);\n\t\t\t\tturnpikePoints.add(_currentTurnpikeStart);\n\t\t\t\tpartitionRadius.add(_currentRadius);\n\t\t\t\t\n\t\t\t\t// for drawing purposes\n\t\t\t\t// fixed length\n\t\t\t\tlist_centersWithoutTurnpike.add(center(set_withTurnpike.get(i), set_withTurnpike.get(i).delta() + _eps2 + _x));\n\t\t\t\tlist_centersWithTurnpike.add(center(set_withoutTurnpike.get(i), set_withoutTurnpike.get(i).delta() + _eps1 + _x));\n\t\t\t\t\n\t\t\t\tif (list_centersWithoutTurnpike.get(i).objectContains\n\t\t\t\t\t\t(list_centersWithoutTurnpike.get(i).objectMinDistPoints(list_centersWithTurnpike.get(i))[0])\n\t\t\t\t\t\t|| list_centersWithTurnpike.get(i).objectContains\n\t\t\t\t\t\t(list_centersWithoutTurnpike.get(i).objectMinDistPoints(list_centersWithTurnpike.get(i))[1])){\n\t\t\t\t\tminDist1.add(list_centersWithoutTurnpike.get(i).objectMinDistPoints(list_centersWithTurnpike.get(i))[0]); \n\t\t\t\t\tminDist2.add(list_centersWithoutTurnpike.get(i).objectMinDistPoints(list_centersWithTurnpike.get(i))[1]);\n\t\t\t\t} else {\n\t\t\t\t\tminDist1.add(list_centersWithoutTurnpike.get(i).objectMinDistPoints(list_centersWithTurnpike.get(i))[1]); \n\t\t\t\t\tminDist2.add(list_centersWithoutTurnpike.get(i).objectMinDistPoints(list_centersWithTurnpike.get(i))[0]);\n\t\t\t\t}\n\t\t\t\tmaxDist1.add(list_centersWithoutTurnpike.get(i).objectMaxDistPoints(list_centersWithTurnpike.get(i))[0]); \n\t\t\t\tmaxDist2.add(list_centersWithoutTurnpike.get(i).objectMaxDistPoints(list_centersWithTurnpike.get(i))[1]);\n\t\t\t}\t\n\t\t\t\n\t\t\tif(customers.getSize() > 1){\n\t\t\t\t// find optimal solution\n\t\t\t\tsolutionIndex = getMinRadiusIndex(); \n\t\t\t\tsolution_facility = facilityPoints.get(solutionIndex);\n\t\t\t\tsolution_turnpikeStart = turnpikePoints.get(solutionIndex);\n//\t\t\t\tsolution_radius = partitionRadius.get(solutionIndex);\n\t\t\t}\n\t\t\t\n\t\t}\n\t}", "private ExonPhase determinePhase(int _bound)\n\t{\n\t\tswitch(_bound % 3)\n\t\t{\n\t\tcase 0:\n\t\t\treturn ExonPhase.PHASE0;\n\t\tcase 1:\n\t\t\treturn ExonPhase.PHASE1;\n\t\tdefault:\n\t\t\treturn ExonPhase.PHASE2;\n\t\t}\n\t}", "protected void mapValueToWithinBounds() {\n if (getAllele() != null) {\n \tFloat d_value = ( (Float) getAllele());\n if (d_value.isInfinite()) {\n // Here we have to break to avoid a stack overflow.\n // ------------------------------------------------\n return;\n }\n // If the value exceeds either the upper or lower bounds, then\n // map the value to within the legal range. To do this, we basically\n // calculate the distance between the value and the float min,\n // then multiply it with a random number and then care that the lower\n // boundary is added.\n // ------------------------------------------------------------------\n if (d_value.floatValue() > m_upperBound ||\n d_value.floatValue() < m_lowerBound) {\n RandomGenerator rn;\n if (getConfiguration() != null) {\n rn = getConfiguration().getRandomGenerator();\n }\n else {\n rn = new StockRandomGenerator();\n }\n setAllele(new Float((rn.nextFloat()\n * ((m_upperBound - m_lowerBound))) + m_lowerBound));\n }\n }\n }", "protected void doDeduction() {\n\n boolean narrowed= false;\n\n unit=false;\n isInconclusive=false;\n\n int newXL;\n int newYU;\n\n Variable x = null;\n Variable y = null;\n\n for(Variable var : csp.getVars()){\n if(var.getPosition() == unitSB.getX().getPosition()){\n x = var;\n } else if(var.getPosition() == unitSB.getY().getPosition()){\n y = var;\n }\n }\n\n int xU = x.getUpperDomainBound();\n int yL = y.getLowerDomainBound();\n\n newXL = yL + unitSB.getCright();\n newYU = xU - unitSB.getCright();\n\n if(newXL>x.getLowerDomainBound()){\n Variable newX = new Variable(newXL, xU);\n newX.setPosition(x.getPosition());\n changeVariable(newX);\n narrowed= true;\n }\n if (newYU< y.getUpperDomainBound()){\n Variable newY = new Variable(yL, newYU);\n newY.setPosition(y.getPosition());\n changeVariable(newY);\n narrowed =true;\n }\n\n if(narrowed){\n doAlgorithmA1();\n }else {\n doAlgorithmA3();\n }\n\n }", "private double getRecEnergy(){\n\t\tdebugMatrix = new double[CELL_SIDE_COUNT][CELL_SIDE_COUNT];\n\t\tconvolutedMatrix = new Complex[CELL_SIDE_COUNT][CELL_SIDE_COUNT];\n\t\t//initiliaze the whole convolutedMatrix array to zero\n\t\tfor(int x = 0; x < CELL_SIDE_COUNT; x++)\n\t\t{\n\t\t\tfor(int y = 0; y < CELL_SIDE_COUNT; y++)\n\t\t\t{\n\t\t\t\tconvolutedMatrix[x][y] = Complex.zero;\n\t\t\t}\n\t\t}\n\t\t\n\t\t//Pg. 180 Lee[05]\n\t\tint indexTop = CELL_SIDE_COUNT * CELL_SIDE_COUNT;\n\t\t//Eq 19 Lee[05]\n\t\t//Also Eq 3.9 Essman[95]\n\t\tdouble sum = 0;\n\t\tint indtop = CELL_SIDE_COUNT * CELL_SIDE_COUNT;\n\t\tint midPoint = CELL_SIDE_COUNT / 2;\n\t\tif (midPoint << 1 < CELL_SIDE_COUNT) {\n\t\t\t++midPoint;\n\t\t}\n\t\t\n\t\tfor (int ind = 1; ind <= (indtop - 1); ++ind) {\n\t\t\t\n\t\t\tint y = ind / CELL_SIDE_COUNT + 1;\n\t\t\tint x = ind - (y - 1) * CELL_SIDE_COUNT + 1;\n\t\t\tint mXPrime = x - 1;\n\t\t\tif (x > midPoint) {\n\t\t\t\tmXPrime = x - 1 - CELL_SIDE_COUNT;\n\t\t\t}\n\t\t\tint mYPrime = y - 1;\n\t\t\tif (y > midPoint) {\n\t\t\t\tmYPrime = y - 1 - CELL_SIDE_COUNT;\n\t\t\t}\n\t\t\tdouble m = mXPrime * 1.0 + mYPrime * 1.0; //Was inverseMeshWidth - theory is reciprocal lattice vectors are for the entire cell U rather than one cell\n\t\t\tdouble mSquared = squared(mXPrime * 1.0) + squared(mYPrime * 1.0);\n\t\t\t\n\t\t\tdouble V = 1; //working in the unit mesh\n\t\t\tdouble bterm = M.bspmod[x]*M.bspmod[y];\n\t\t\tdouble eterm = Math.exp(-squared(Math.PI/ewaldCoefficient)*mSquared) / (bterm * Math.PI * V * mSquared);\n\t\t\t//Section 3.2.8 Lee[05]\n\t\t\tdouble inverseQPart = (squared(inverseFTQComplex[x-1][y-1].re())+squared(inverseFTQComplex[x-1][y-1].im())); //Lee[05]\n\t\t\tdouble thisContribution = eterm * inverseQPart;\n\t\t\tconvolutedMatrix[x-1][y-1] = inverseFTQComplex[x-1][y-1].scale(eterm); //Save this for the force calculation\n\t\t\tsum += thisContribution; //from the argument that F(Q(M))*F(Q(-M))=F-1(Q)^2\n\t\t}\n\t\treturn 0.5*sum;\n\t}", "public double getSubjectiveValue(Apartment apart) {\n checkNotNull(apart);\n ImmutableMap<Criterion, Double> subjectiveValue =\n new ImmutableMap.Builder<Criterion, Double>()\n .put(\n Criterion.FLOOR_AREA,\n this.linearValueFunctions\n .get(Criterion.FLOOR_AREA)\n .getSubjectiveValue(apart.getFloorArea()))\n .put(\n Criterion.NB_BEDROOMS,\n this.linearValueFunctions\n .get(Criterion.NB_BEDROOMS)\n .getSubjectiveValue((double) apart.getNbBedrooms()))\n .put(\n Criterion.NB_SLEEPING,\n this.linearValueFunctions\n .get(Criterion.NB_SLEEPING)\n .getSubjectiveValue((double) apart.getNbSleeping()))\n .put(\n Criterion.NB_BATHROOMS,\n this.linearValueFunctions\n .get(Criterion.NB_BATHROOMS)\n .getSubjectiveValue((double) apart.getNbBathrooms()))\n .put(\n Criterion.TERRACE,\n this.booleanValueFunctions\n .get(Criterion.TERRACE)\n .getSubjectiveValue(apart.getTerrace()))\n .put(\n Criterion.FLOOR_AREA_TERRACE,\n this.linearValueFunctions\n .get(Criterion.FLOOR_AREA_TERRACE)\n .getSubjectiveValue(apart.getFloorAreaTerrace()))\n .put(\n Criterion.WIFI,\n this.booleanValueFunctions.get(Criterion.WIFI).getSubjectiveValue(apart.getWifi()))\n .put(\n Criterion.PRICE_PER_NIGHT,\n this.reversedValueFunctions\n .get(Criterion.PRICE_PER_NIGHT)\n .getSubjectiveValue(apart.getPricePerNight()))\n .put(\n Criterion.NB_MIN_NIGHT,\n this.reversedValueFunctions\n .get(Criterion.NB_MIN_NIGHT)\n .getSubjectiveValue((double) apart.getNbMinNight()))\n .put(\n Criterion.TELE,\n this.booleanValueFunctions.get(Criterion.TELE).getSubjectiveValue(apart.getTele()))\n .build();\n\n // Check that the subjective values ​​do have a value between 0 and 1\n subjectiveValue.forEach(\n (criterion, aDouble) -> {\n LOGGER.debug(\"The {} subjective value has been set to {}\", criterion.name(), aDouble);\n checkState(\n aDouble >= 0 && aDouble <= 1,\n \"The subjective value of \" + criterion.name() + \"must be between 0 and 1\");\n });\n\n double sum =\n Arrays.stream(Criterion.values())\n .map(c -> this.weight.get(c) * subjectiveValue.get(c))\n .reduce(0.0d, Double::sum);\n double division = this.weight.values().stream().reduce(0.0d, Double::sum);\n return sum / division;\n }", "abstract float evalCell(Cell c, float hunger, Random rand);", "public static native void OpenMM_AmoebaTorsionTorsionForce_setUsesPeriodicBoundaryConditions(PointerByReference target, int periodic);", "void find_steady_conditions () {\n // System.out.println(\"-- find_steady_conditions: \" + can_do_gui_updates);\n // double min_lift = parse_force_constraint(tf_tkoff_min_lift);\n double max_drag = parse_force_constraint(tf_tkoff_max_drag);\n boolean saved_flag = can_do_gui_updates;\n can_do_gui_updates = false;\n vpp.steady_flight_at_given_speed(5, 0);\n can_do_gui_updates = saved_flag;\n recomp_all_parts();\n\n\n // this animation idea alas does not work now... \n // //add a bit of animation in case the rider crosses the takeoff speed.\n // if (alt_val == 0 && foil_lift() >= load) { // need to raise up\n // while (alt_val < 70 && foil_lift() >= load) {\n // alt_val += 0.1;\n // loadPanel();\n // viewer.repaint();\n // // try { Thread.sleep(100); } catch (InterruptedException e) {}\n // saved_flag = can_do_gui_updates;\n // can_do_gui_updates = false;\n // vpp.steady_flight_at_given_speed(5, 0);\n // can_do_gui_updates = saved_flag;\n // }\n // }\n\n if (alt_val == 0 && foil_lift() >= load) { // need to raise up\n // viewer.start_raise = true; // this is experimentsl, has quirks....\n alt_val = 70;\n } else if (alt_val > 0 && foil_lift() < load) { // must splash\n // viewer.start_descend = true; // this is experimentsl, has quirks....\n alt_val = 0;\n }\n\n \n loadPanel();\n if (total_drag() > max_drag) \n dash.outTotalDrag.setForeground(Color.red);\n if (foil_lift() < load) \n dash.outTotalLift.setForeground(Color.red);\n }", "public abstract float surfaceArea();", "@Test(timeout = 4000)\n public void test18() throws Throwable {\n Range range0 = Range.of((-1259L), 255L);\n Range.CoordinateSystem range_CoordinateSystem0 = Range.CoordinateSystem.SPACE_BASED;\n range0.toString(range_CoordinateSystem0);\n Range range1 = Range.of((-1259L));\n range1.getEnd();\n range1.getEnd();\n Range range2 = range0.intersection(range1);\n List<Range> list0 = range2.split(255L);\n range2.complementFrom(list0);\n Range.CoordinateSystem range_CoordinateSystem1 = Range.CoordinateSystem.SPACE_BASED;\n Range range3 = Range.of(range_CoordinateSystem1, (-1259L), 0L);\n range3.endsBefore(range0);\n LinkedList<Range> linkedList0 = new LinkedList<Range>();\n linkedList0.add(range3);\n List<Range> list1 = range2.complementFrom(list0);\n Range range4 = Range.of(1207L);\n assertFalse(range4.isEmpty());\n \n boolean boolean0 = range2.isSubRangeOf(range3);\n assertTrue(boolean0);\n \n Range.CoordinateSystem range_CoordinateSystem2 = Range.CoordinateSystem.RESIDUE_BASED;\n Consumer<Object> consumer0 = (Consumer<Object>) mock(Consumer.class, new ViolatedAssumptionAnswer());\n range2.forEach(consumer0);\n Range.CoordinateSystem range_CoordinateSystem3 = Range.CoordinateSystem.ZERO_BASED;\n range_CoordinateSystem3.toString();\n range0.equals(list1);\n assertSame(range2, range1);\n assertEquals(0, list1.size());\n \n range_CoordinateSystem1.toString();\n long long0 = range0.getEnd();\n assertEquals(255L, long0);\n }", "@Test(timeout = 4000)\n public void test089() throws Throwable {\n Range.CoordinateSystem range_CoordinateSystem0 = Range.CoordinateSystem.SPACE_BASED;\n Range range0 = Range.of(range_CoordinateSystem0, 3253L, 3253L);\n range0.getLength();\n range0.toString();\n Object object0 = new Object();\n Range range1 = Range.ofLength(3253L);\n range1.intersects(range0);\n range0.equals(range1);\n // Undeclared exception!\n try { \n Range.CoordinateSystem.valueOf(\"[ 3253 .. 3252 ]/0B\");\n fail(\"Expecting exception: IllegalArgumentException\");\n \n } catch(IllegalArgumentException e) {\n //\n // No enum constant org.jcvi.jillion.core.Range.CoordinateSystem.[ 3253 .. 3252 ]/0B\n //\n verifyException(\"java.lang.Enum\", e);\n }\n }" ]
[ "0.55000085", "0.53291315", "0.5213784", "0.51905704", "0.50595117", "0.5053478", "0.5049362", "0.4992604", "0.49440476", "0.49350852", "0.49122176", "0.49052626", "0.48612237", "0.48527098", "0.48089346", "0.47660965", "0.47583944", "0.47350997", "0.46887287", "0.4676782", "0.46641046", "0.46637186", "0.46598125", "0.46312332", "0.46280608", "0.46235368", "0.45929277", "0.45916528", "0.4587979", "0.45792496", "0.45588446", "0.45584732", "0.45573053", "0.45552307", "0.45488685", "0.45452476", "0.45323732", "0.4530175", "0.4524443", "0.45079318", "0.44994438", "0.44926324", "0.4491508", "0.44813475", "0.44751397", "0.44732875", "0.44716963", "0.44619906", "0.44603792", "0.44548357", "0.44452545", "0.4443727", "0.44423813", "0.44368058", "0.4432708", "0.44323522", "0.4425756", "0.44246355", "0.44146553", "0.4413872", "0.44119784", "0.44097167", "0.44086415", "0.43999097", "0.43990353", "0.43983278", "0.4396763", "0.4392474", "0.43772462", "0.43733862", "0.436739", "0.4365426", "0.43611723", "0.43598598", "0.4359793", "0.43595076", "0.43584985", "0.43566954", "0.43538883", "0.4349605", "0.43462124", "0.4345076", "0.4344494", "0.4340989", "0.43399268", "0.4339919", "0.43383253", "0.43339434", "0.43304566", "0.43274498", "0.43248394", "0.43239468", "0.43233737", "0.43224418", "0.43137044", "0.4309814", "0.43091705", "0.4306635", "0.43051356", "0.43045238" ]
0.6934277
0
6) getConstantCount() : Returns number of constants.
public int getConstantCount() { return EnthalpyVapour.CONSTANT_COUNT; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private int numberOfConstants() {\n return (int) Stream.of(this.template.split(\"\\\\.\"))\n .filter(s -> !s.equals(\"*\")).count();\n }", "int getGeoTargetConstantsCount();", "public int getSize() {\n int size = 5; // 1 (code) + 2 (data length) + 2 (# of constants)\n try {\n for (Iterator<String> i = constants.iterator(); i.hasNext();) {\n size += (i.next().getBytes(\"UTF-8\").length + 1); // Unicode, null-terminated\n }\n } catch (UnsupportedEncodingException e) {\n // UTF-8 should be available..\n }\n return size;\n }", "public int getConstant() {\n\t\treturn magicConstant;\n\t}", "public long getAllLiteralCount();", "int getVarsCount();", "public static int count() {\n\t\treturn definitions.length;\n\t}", "int getStateValuesCount();", "public int cardinality() {\n\t\tint counter = 0;\n\t\tfinal EWAHIterator i =\n\t\t\t\tnew EWAHIterator(this.buffer, this.actualsizeinwords);\n\t\twhile (i.hasNext()) {\n\t\t\tRunningLengthWord localrlw = i.next();\n\t\t\tif (localrlw.getRunningBit()) {\n\t\t\t\tcounter += wordinbits * localrlw.getRunningLength();\n\t\t\t}\n\t\t\tfor (int j = 0; j < localrlw.getNumberOfLiteralWords(); ++j) {\n\t\t\t\tcounter += Long.bitCount(i.buffer()[i.dirtyWords() + j]);\n\t\t\t}\n\t\t}\n\t\treturn counter;\n\t}", "private int analyzeConstPool()\n {\n cp_index = new int[constant_pool_count];\n cp_index[0] = -1;\n\n int index = 1;\n int offset = 10;\n while (index < constant_pool_count)\n {\n cp_index[index] = offset;\n ++index;\n\n EConstPoolItem item = EConstPoolItem.getByTag(bytes[offset]);\n if (item == EConstPoolItem.UTF8_INFO)\n {\n int length = ByteTool.uBigEnd(bytes[offset + 1], bytes[offset + 2]);\n offset += length + 3;\n }\n else\n {\n offset += item.count;\n }\n\n // 这规定mdzz\n if (item == EConstPoolItem.DOUBLE_INFO || item == EConstPoolItem.LONG_INFO)\n {\n ++index;\n }\n }\n\n return offset;\n }", "@Converted(kind = Converted.Kind.AUTO,\n source = \"${LLVM_SRC}/llvm/lib/IR/Constants.cpp\", line = 797,\n FQN=\"llvm::UndefValue::getNumElements\", NM=\"_ZNK4llvm10UndefValue14getNumElementsEv\",\n cmd=\"jclank.sh -java-options=${SPUTNIK}/modules/org.llvm.ir/llvmToClangType ${LLVM_SRC}/llvm/lib/IR/Constants.cpp -nm=_ZNK4llvm10UndefValue14getNumElementsEv\")\n //</editor-fold>\n public /*uint*/int getNumElements() /*const*/ {\n Type /*P*/ Ty = getType();\n {\n ArrayType /*P*/ AT = dyn_cast_ArrayType(Ty);\n if ((AT != null)) {\n return $ulong2uint(AT.getNumElements());\n }\n }\n {\n VectorType /*P*/ VT = dyn_cast_VectorType(Ty);\n if ((VT != null)) {\n return VT.getNumElements();\n }\n }\n return Ty.getStructNumElements();\n }", "public int constantValueIndex() {\n\t\treturn constantValueIndex;\n\t}", "int getValuesCount();", "public static int size_count() {\n return (16 / 8);\n }", "public static Constants getConstants() {\n return constants;\n }", "public int getNumOfClasses();", "public int currentTemporaryScopeDepth(){\n if(temporaryConstants == null) return 0;\n return temporaryConstants.size();\n }", "@Override\r\n\tpublic void computeConstant() {\n\t\t\r\n\t}", "public int get_var_count()\r\n {\r\n\r\n int retVal = get_var_count_0(nativeObj);\r\n\r\n return retVal;\r\n }", "public int get_count() {\n return (int)getUIntBEElement(offsetBits_count(), 16);\n }", "public List<EnumConstantDefinition> getConstantList() {\n\t\treturn constantList;\n\t}", "int getResourcePatternsCount();", "int getMetricDescriptorsCount();", "public static synchronized int size() {\n\t\treturn ClassRegistry.dictionary.size();\n\t}", "public boolean isConstant();", "int cardinality();", "public boolean isConstant()\r\n/* 92: */ {\r\n/* 93:112 */ return this.constant != null;\r\n/* 94: */ }", "String getConstant();", "public int numberOfOccorrence();", "public final native int count()/*-{\r\n\treturn this.count;\r\n\t}-*/;", "int getNumberOfCavalry();", "private void checkIfConstant()\r\n/* 23: */ {\r\n/* 24: 49 */ boolean isConstant = true;\r\n/* 25: 50 */ int c = 0;\r\n/* 26: 50 */ for (int max = getChildCount(); c < max; c++)\r\n/* 27: */ {\r\n/* 28: 51 */ SpelNode child = getChild(c);\r\n/* 29: 52 */ if (!(child instanceof Literal)) {\r\n/* 30: 53 */ if ((child instanceof InlineList))\r\n/* 31: */ {\r\n/* 32: 54 */ InlineList inlineList = (InlineList)child;\r\n/* 33: 55 */ if (!inlineList.isConstant()) {\r\n/* 34: 56 */ isConstant = false;\r\n/* 35: */ }\r\n/* 36: */ }\r\n/* 37: */ else\r\n/* 38: */ {\r\n/* 39: 59 */ isConstant = false;\r\n/* 40: */ }\r\n/* 41: */ }\r\n/* 42: */ }\r\n/* 43: 63 */ if (isConstant)\r\n/* 44: */ {\r\n/* 45: 64 */ List<Object> constantList = new ArrayList();\r\n/* 46: 65 */ int childcount = getChildCount();\r\n/* 47: 66 */ for (int c = 0; c < childcount; c++)\r\n/* 48: */ {\r\n/* 49: 67 */ SpelNode child = getChild(c);\r\n/* 50: 68 */ if ((child instanceof Literal)) {\r\n/* 51: 69 */ constantList.add(((Literal)child).getLiteralValue().getValue());\r\n/* 52: 70 */ } else if ((child instanceof InlineList)) {\r\n/* 53: 71 */ constantList.add(((InlineList)child).getConstantValue());\r\n/* 54: */ }\r\n/* 55: */ }\r\n/* 56: 74 */ this.constant = new TypedValue(Collections.unmodifiableList(constantList));\r\n/* 57: */ }\r\n/* 58: */ }", "int getMetricValuesCount();", "public int GeneralRegCount() { return GENERAL_REG_COUNT; }", "public @UInt32 int getChannelCount();", "public int getStaticCharsCount() {\n return 0;\n }", "int getWifisCount();", "int getFeaturesCount();", "public static TermConstant getConstant(int index)\n {\n return constants[index];\n }", "int getRegisterParametersCount();", "public int count() {\n\t\treturn sizeC;\n\t}", "public static int getColorsCount()\n {\n return colorsCount;\n }", "public int numOfHashFunctions() {\n return config().getK();\n }", "int numberofhc()\n{\n\treturn hc.size();}", "int getIndicesCount();", "public boolean isConstant() {\n return false;\n }", "boolean hasConst();", "public boolean isConstant()\n {\n if (getArray().isConstant() && getIndex().isConstant())\n {\n Object[] a = (Object[]) getArray().getValue();\n int i = ((Number) getIndex().getValue()).intValue();\n return a != null && i >= 0 && i < a.length;\n }\n\n return false;\n }", "int getChannelStatisticsCount();", "int getFieldCount();", "@Override\n\tpublic boolean getIsConstant() {\n\t\treturn false;\n\t}", "public static int performanceCountGet() { return 0; }", "int getFeatureCount();", "int getConditionalCasesCount();", "public int getNumResources() {\n \t\tint count = 0;\n \t\tfor (int i = 0; i < resources.length; i++)\n \t\t\tcount += resources[i];\n \n \t\treturn count;\n \t}", "public static int sizeBits_count() {\n return 16;\n }", "public boolean isConstant() {\n\t\treturn this.isConstant;\n\t}", "int getInstanceCount();", "boolean hasConstantValue();", "int getMethodsCount();", "int getDetectionRulesCount();", "public final int getConceptCount() {\r\n return this.m_count;\r\n }", "public int getCount() {\n return definition.getInteger(COUNT, 1);\n }", "int getTokenSegmentCount();", "public abstract boolean isConstant();", "public List<String> getConstants() {\n return constants;\n }", "@FameProperty(name = \"numberOfAccessingClasses\", derived = true)\n public Number getNumberOfAccessingClasses() {\n throw new UnsupportedOperationException(\"Not yet implemented!\"); \n }", "int getLabelsCount();", "int getLabelsCount();", "int getLabelsCount();", "int getLabelsCount();", "int getDataScansCount();", "public static int numberOfElement()\n\t{\n\t\treturn REF_INT_STRING.size();\n\t}", "int getConstraintsCount();", "int getRulesCount();", "Map<String, Constant> getConstantMap();", "public static int size() \r\n\t{\r\n\t\treturn m_count;\r\n }", "public long getNumInstructions();", "public static int fastNumberOfCancellations(int[] tab) {\n }", "int getParametersCount();", "int getParametersCount();", "private int computeCount() {\n \n int count;\n try{\n count = this.clippingFeatures.size() * this.featuresToClip.size();\n }catch(ArithmeticException e ){\n \n count = Integer.MAX_VALUE;\n }\n return count;\n }", "public static int count() {\n\treturn errorCount;\n }", "@Override\n\tpublic int count() {\n\t\treturn 4;\n\t}", "int getInfoCount();", "int getInfoCount();", "int getInfoCount();", "public int getNumPossibleValues()\n {\n return -1;\n }", "int getEntryCount();", "public static int sizeOf()\n {\n return 4;\n }", "public int getOccurrences() {\n\t\treturn this.occurrenceFactors.size();\n\t}", "public int IORegCount() { return IO_REG_COUNT; }", "int commentsCount();", "public final int getKnownCount()\r\n {\r\n return knownCount;\r\n }", "int getRequestedValuesCount();", "int getStatsCount();", "int getStatsCount();", "int getStatsCount();", "IntConstant createIntConstant();", "@FameProperty(name = \"numberOfGlobalAccesses\", derived = true)\n public Number getNumberOfGlobalAccesses() {\n throw new UnsupportedOperationException(\"Not yet implemented!\"); \n }" ]
[ "0.7885833", "0.7027644", "0.66746175", "0.65481156", "0.6529254", "0.6113442", "0.61029524", "0.6086527", "0.6071034", "0.6066414", "0.59607506", "0.5953467", "0.5880954", "0.5870069", "0.5849408", "0.5841066", "0.5821768", "0.5816977", "0.5814204", "0.5804974", "0.58016115", "0.5798513", "0.5797756", "0.5774127", "0.5764161", "0.57530016", "0.5752608", "0.57498807", "0.57416934", "0.57369107", "0.57297385", "0.57093716", "0.57093424", "0.5694111", "0.569142", "0.56798834", "0.56631655", "0.5660907", "0.565947", "0.5658269", "0.56535345", "0.5648014", "0.56343365", "0.56276035", "0.5626874", "0.56246483", "0.5621369", "0.56207615", "0.56171703", "0.56171477", "0.55961686", "0.55954367", "0.5587432", "0.5582389", "0.5580738", "0.55677706", "0.5555395", "0.5548395", "0.5542903", "0.5540192", "0.55335236", "0.5522158", "0.55161804", "0.5515351", "0.5508808", "0.55082095", "0.54977316", "0.5496397", "0.5496397", "0.5496397", "0.5496397", "0.54940027", "0.5489729", "0.5486243", "0.5480221", "0.54750663", "0.54653555", "0.54651755", "0.5458009", "0.54573077", "0.54573077", "0.54524285", "0.54514176", "0.545119", "0.5450534", "0.5450534", "0.5450534", "0.54493713", "0.5448327", "0.54432964", "0.5443217", "0.5442095", "0.5434708", "0.5434375", "0.54241365", "0.5423069", "0.5423069", "0.5423069", "0.54227084", "0.5422342" ]
0.8814767
0
TODO Autogenerated method stub
public static void main(String[] args) { lis= Arrays.asList(new Integer[] {4,2,0,3,2,5}); solve(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\r\n\tpublic void comer() \r\n\t{\n\t\t\r\n\t}", "@Override\n\tpublic void comer() {\n\t\t\n\t}", "@Override\n public void perish() {\n \n }", "@Override\r\n\t\t\tpublic void annadir() {\n\r\n\t\t\t}", "@Override\n\tpublic void anular() {\n\n\t}", "@Override\n\tprotected void getExras() {\n\n\t}", "@Override\r\n\tpublic void anularFact() {\n\t\t\r\n\t}", "@Override\n\tpublic void entrenar() {\n\t\t\n\t}", "@Override\n\tpublic void nadar() {\n\t\t\n\t}", "@Override\r\n\tpublic void tires() {\n\t\t\r\n\t}", "@Override\r\n\t\t\tpublic void ayuda() {\n\r\n\t\t\t}", "@Override\n\tprotected void interr() {\n\t}", "@Override\n\tpublic void emprestimo() {\n\n\t}", "@Override\r\n\tpublic void bicar() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void bicar() {\n\t\t\r\n\t}", "@Override\n\tpublic void grabar() {\n\t\t\n\t}", "@Override\n\tpublic void gravarBd() {\n\t\t\n\t}", "@Override\r\n\tpublic void rozmnozovat() {\n\t}", "@Override\r\n\tpublic void dormir() {\n\t\t\r\n\t}", "@Override\n protected void getExras() {\n }", "@Override\r\n\tpublic void publierEnchere() {\n\t\t\r\n\t}", "@Override\n\tpublic void nefesAl() {\n\n\t}", "@Override\n\tpublic void ligar() {\n\t\t\n\t}", "@Override\n public void func_104112_b() {\n \n }", "@Override\n\tprotected void initdata() {\n\n\t}", "@Override\n\tpublic void nghe() {\n\n\t}", "@Override\n public void function()\n {\n }", "@Override\n public void function()\n {\n }", "public final void mo51373a() {\n }", "@Override\r\n\tpublic void stehReagieren() {\r\n\t\t//\r\n\t}", "@Override\n public void inizializza() {\n\n super.inizializza();\n }", "@Override\n\tprotected void initData() {\n\t\t\n\t}", "@Override\r\n\t\tpublic void init() {\n\t\t\t\r\n\t\t}", "@Override\n\tpublic void sacrifier() {\n\t\t\n\t}", "@Override\r\n\tprotected void InitData() {\n\t\t\r\n\t}", "public void designBasement() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initialize() {\r\n\t\t\r\n\t\t\r\n\t}", "public void gored() {\n\t\t\n\t}", "@Override\r\n\tprotected void initData() {\n\r\n\t}", "@Override\n\tpublic void einkaufen() {\n\t}", "@Override\n protected void initialize() {\n\n \n }", "public void mo38117a() {\n }", "@Override\n\tprotected void getData() {\n\t\t\n\t}", "Constructor() {\r\n\t\t \r\n\t }", "@Override\r\n\tpublic void dibujar() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void dibujar() {\n\t\t\r\n\t}", "@Override\n\tpublic void one() {\n\t\t\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "private stendhal() {\n\t}", "@Override\n\tprotected void update() {\n\t\t\n\t}", "@Override\n\t\t\tpublic void ic() {\n\t\t\t\t\n\t\t\t}", "@Override\n\tprotected void initData() {\n\n\t}", "@Override\n\tprotected void initData() {\n\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n public void init() {\n\n }", "@Override\n\tprotected void initialize() {\n\t\t\n\t}", "@Override\n\tprotected void initialize() {\n\t\t\n\t}", "@Override\r\n\tpublic void init() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void init() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void init() {\n\t\t\r\n\t}", "@Override\n\tpublic void debite() {\n\t\t\n\t}", "@Override\r\n\tpublic void init() {\n\r\n\t}", "@Override\r\n\tpublic void init() {\n\r\n\t}", "@Override\r\n\tpublic void init() {\n\r\n\t}", "public contrustor(){\r\n\t}", "@Override\n\tprotected void initialize() {\n\n\t}", "@Override\r\n\tpublic void dispase() {\n\r\n\t}", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "@Override\n\tpublic void dtd() {\n\t\t\n\t}", "@Override\n\tprotected void logic() {\n\n\t}", "@Override\n\tprotected void lazyLoad() {\n\t\t\n\t}", "public void mo4359a() {\n }", "@Override\r\n\tprotected void initialize() {\n\r\n\t}", "@Override\n public void memoria() {\n \n }", "@Override\n\t\tpublic void method() {\n\t\t\t\n\t\t}", "private RepositorioAtendimentoPublicoHBM() {\r\t}", "@Override\n protected void initialize() \n {\n \n }", "@Override\r\n\tpublic void getProposition() {\n\r\n\t}", "@Override\n\tpublic void particular1() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\n\t}", "@Override\n\tpublic void init() {\n\n\t}", "@Override\n\tpublic void init() {\n\n\t}", "@Override\n protected void prot() {\n }", "@Override\r\n\tpublic void init()\r\n\t{\n\t}", "@Override\n\tprotected void initValue()\n\t{\n\n\t}", "public void mo55254a() {\n }" ]
[ "0.6671074", "0.6567672", "0.6523024", "0.6481211", "0.6477082", "0.64591026", "0.64127725", "0.63762105", "0.6276059", "0.6254286", "0.623686", "0.6223679", "0.6201336", "0.61950207", "0.61950207", "0.61922914", "0.6186996", "0.6173591", "0.61327106", "0.61285484", "0.6080161", "0.6077022", "0.6041561", "0.6024072", "0.6020252", "0.59984857", "0.59672105", "0.59672105", "0.5965777", "0.59485507", "0.5940904", "0.59239364", "0.5910017", "0.5902906", "0.58946234", "0.5886006", "0.58839184", "0.58691067", "0.5857751", "0.58503544", "0.5847024", "0.58239377", "0.5810564", "0.5810089", "0.5806823", "0.5806823", "0.5800025", "0.5792378", "0.5792378", "0.5792378", "0.5792378", "0.5792378", "0.5792378", "0.5790187", "0.5789414", "0.5787092", "0.57844025", "0.57844025", "0.5774479", "0.5774479", "0.5774479", "0.5774479", "0.5774479", "0.5761362", "0.57596046", "0.57596046", "0.575025", "0.575025", "0.575025", "0.5747959", "0.57337177", "0.57337177", "0.57337177", "0.5721452", "0.5715831", "0.57142824", "0.57140535", "0.57140535", "0.57140535", "0.57140535", "0.57140535", "0.57140535", "0.57140535", "0.5711723", "0.57041645", "0.56991017", "0.5696783", "0.56881124", "0.56774884", "0.56734604", "0.56728", "0.56696945", "0.5661323", "0.5657007", "0.5655942", "0.5655942", "0.5655942", "0.56549734", "0.5654792", "0.5652974", "0.5650185" ]
0.0
-1
TODO Autogenerated method stub
private static void solve() { List<Integer> rgtMax= new ArrayList<>(); List<Integer> lftMax= new ArrayList<>(); populateRgtMax(rgtMax); populateLftMax(lftMax); int area=findMaxArea(lftMax,rgtMax); System.out.println(area); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\r\n\tpublic void comer() \r\n\t{\n\t\t\r\n\t}", "@Override\n\tpublic void comer() {\n\t\t\n\t}", "@Override\n public void perish() {\n \n }", "@Override\r\n\t\t\tpublic void annadir() {\n\r\n\t\t\t}", "@Override\n\tpublic void anular() {\n\n\t}", "@Override\n\tprotected void getExras() {\n\n\t}", "@Override\r\n\tpublic void anularFact() {\n\t\t\r\n\t}", "@Override\n\tpublic void entrenar() {\n\t\t\n\t}", "@Override\n\tpublic void nadar() {\n\t\t\n\t}", "@Override\r\n\tpublic void tires() {\n\t\t\r\n\t}", "@Override\r\n\t\t\tpublic void ayuda() {\n\r\n\t\t\t}", "@Override\n\tprotected void interr() {\n\t}", "@Override\n\tpublic void emprestimo() {\n\n\t}", "@Override\r\n\tpublic void bicar() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void bicar() {\n\t\t\r\n\t}", "@Override\n\tpublic void grabar() {\n\t\t\n\t}", "@Override\n\tpublic void gravarBd() {\n\t\t\n\t}", "@Override\r\n\tpublic void rozmnozovat() {\n\t}", "@Override\r\n\tpublic void dormir() {\n\t\t\r\n\t}", "@Override\n protected void getExras() {\n }", "@Override\r\n\tpublic void publierEnchere() {\n\t\t\r\n\t}", "@Override\n\tpublic void nefesAl() {\n\n\t}", "@Override\n\tpublic void ligar() {\n\t\t\n\t}", "@Override\n public void func_104112_b() {\n \n }", "@Override\n\tprotected void initdata() {\n\n\t}", "@Override\n\tpublic void nghe() {\n\n\t}", "@Override\n public void function()\n {\n }", "@Override\n public void function()\n {\n }", "public final void mo51373a() {\n }", "@Override\r\n\tpublic void stehReagieren() {\r\n\t\t//\r\n\t}", "@Override\n public void inizializza() {\n\n super.inizializza();\n }", "@Override\n\tprotected void initData() {\n\t\t\n\t}", "@Override\r\n\t\tpublic void init() {\n\t\t\t\r\n\t\t}", "@Override\n\tpublic void sacrifier() {\n\t\t\n\t}", "@Override\r\n\tprotected void InitData() {\n\t\t\r\n\t}", "public void designBasement() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initialize() {\r\n\t\t\r\n\t\t\r\n\t}", "public void gored() {\n\t\t\n\t}", "@Override\r\n\tprotected void initData() {\n\r\n\t}", "@Override\n\tpublic void einkaufen() {\n\t}", "@Override\n protected void initialize() {\n\n \n }", "public void mo38117a() {\n }", "@Override\n\tprotected void getData() {\n\t\t\n\t}", "Constructor() {\r\n\t\t \r\n\t }", "@Override\r\n\tpublic void dibujar() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void dibujar() {\n\t\t\r\n\t}", "@Override\n\tpublic void one() {\n\t\t\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "private stendhal() {\n\t}", "@Override\n\tprotected void update() {\n\t\t\n\t}", "@Override\n\t\t\tpublic void ic() {\n\t\t\t\t\n\t\t\t}", "@Override\n\tprotected void initData() {\n\n\t}", "@Override\n\tprotected void initData() {\n\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n public void init() {\n\n }", "@Override\n\tprotected void initialize() {\n\t\t\n\t}", "@Override\n\tprotected void initialize() {\n\t\t\n\t}", "@Override\r\n\tpublic void init() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void init() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void init() {\n\t\t\r\n\t}", "@Override\n\tpublic void debite() {\n\t\t\n\t}", "@Override\r\n\tpublic void init() {\n\r\n\t}", "@Override\r\n\tpublic void init() {\n\r\n\t}", "@Override\r\n\tpublic void init() {\n\r\n\t}", "public contrustor(){\r\n\t}", "@Override\n\tprotected void initialize() {\n\n\t}", "@Override\r\n\tpublic void dispase() {\n\r\n\t}", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "@Override\n\tpublic void dtd() {\n\t\t\n\t}", "@Override\n\tprotected void logic() {\n\n\t}", "@Override\n\tprotected void lazyLoad() {\n\t\t\n\t}", "public void mo4359a() {\n }", "@Override\r\n\tprotected void initialize() {\n\r\n\t}", "@Override\n public void memoria() {\n \n }", "@Override\n\t\tpublic void method() {\n\t\t\t\n\t\t}", "private RepositorioAtendimentoPublicoHBM() {\r\t}", "@Override\n protected void initialize() \n {\n \n }", "@Override\r\n\tpublic void getProposition() {\n\r\n\t}", "@Override\n\tpublic void particular1() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\n\t}", "@Override\n\tpublic void init() {\n\n\t}", "@Override\n\tpublic void init() {\n\n\t}", "@Override\n protected void prot() {\n }", "@Override\r\n\tpublic void init()\r\n\t{\n\t}", "@Override\n\tprotected void initValue()\n\t{\n\n\t}", "public void mo55254a() {\n }" ]
[ "0.6671074", "0.6567672", "0.6523024", "0.6481211", "0.6477082", "0.64591026", "0.64127725", "0.63762105", "0.6276059", "0.6254286", "0.623686", "0.6223679", "0.6201336", "0.61950207", "0.61950207", "0.61922914", "0.6186996", "0.6173591", "0.61327106", "0.61285484", "0.6080161", "0.6077022", "0.6041561", "0.6024072", "0.6020252", "0.59984857", "0.59672105", "0.59672105", "0.5965777", "0.59485507", "0.5940904", "0.59239364", "0.5910017", "0.5902906", "0.58946234", "0.5886006", "0.58839184", "0.58691067", "0.5857751", "0.58503544", "0.5847024", "0.58239377", "0.5810564", "0.5810089", "0.5806823", "0.5806823", "0.5800025", "0.5792378", "0.5792378", "0.5792378", "0.5792378", "0.5792378", "0.5792378", "0.5790187", "0.5789414", "0.5787092", "0.57844025", "0.57844025", "0.5774479", "0.5774479", "0.5774479", "0.5774479", "0.5774479", "0.5761362", "0.57596046", "0.57596046", "0.575025", "0.575025", "0.575025", "0.5747959", "0.57337177", "0.57337177", "0.57337177", "0.5721452", "0.5715831", "0.57142824", "0.57140535", "0.57140535", "0.57140535", "0.57140535", "0.57140535", "0.57140535", "0.57140535", "0.5711723", "0.57041645", "0.56991017", "0.5696783", "0.56881124", "0.56774884", "0.56734604", "0.56728", "0.56696945", "0.5661323", "0.5657007", "0.5655942", "0.5655942", "0.5655942", "0.56549734", "0.5654792", "0.5652974", "0.5650185" ]
0.0
-1
TODO Autogenerated method stub
private static void populateRgtMax(List<Integer> rgtMax) { int curMax=-1; for(int i= lis.size()-1;i>=0;i--) { rgtMax.add(curMax); if(lis.get(i) > curMax ) curMax= Math.max(curMax, lis.get(i)); else continue; } Collections.reverse(rgtMax); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\r\n\tpublic void comer() \r\n\t{\n\t\t\r\n\t}", "@Override\n\tpublic void comer() {\n\t\t\n\t}", "@Override\n public void perish() {\n \n }", "@Override\r\n\t\t\tpublic void annadir() {\n\r\n\t\t\t}", "@Override\n\tpublic void anular() {\n\n\t}", "@Override\n\tprotected void getExras() {\n\n\t}", "@Override\r\n\tpublic void anularFact() {\n\t\t\r\n\t}", "@Override\n\tpublic void entrenar() {\n\t\t\n\t}", "@Override\n\tpublic void nadar() {\n\t\t\n\t}", "@Override\r\n\tpublic void tires() {\n\t\t\r\n\t}", "@Override\r\n\t\t\tpublic void ayuda() {\n\r\n\t\t\t}", "@Override\n\tprotected void interr() {\n\t}", "@Override\n\tpublic void emprestimo() {\n\n\t}", "@Override\r\n\tpublic void bicar() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void bicar() {\n\t\t\r\n\t}", "@Override\n\tpublic void grabar() {\n\t\t\n\t}", "@Override\n\tpublic void gravarBd() {\n\t\t\n\t}", "@Override\r\n\tpublic void rozmnozovat() {\n\t}", "@Override\r\n\tpublic void dormir() {\n\t\t\r\n\t}", "@Override\n protected void getExras() {\n }", "@Override\r\n\tpublic void publierEnchere() {\n\t\t\r\n\t}", "@Override\n\tpublic void nefesAl() {\n\n\t}", "@Override\n\tpublic void ligar() {\n\t\t\n\t}", "@Override\n public void func_104112_b() {\n \n }", "@Override\n\tprotected void initdata() {\n\n\t}", "@Override\n\tpublic void nghe() {\n\n\t}", "@Override\n public void function()\n {\n }", "@Override\n public void function()\n {\n }", "public final void mo51373a() {\n }", "@Override\r\n\tpublic void stehReagieren() {\r\n\t\t//\r\n\t}", "@Override\n public void inizializza() {\n\n super.inizializza();\n }", "@Override\n\tprotected void initData() {\n\t\t\n\t}", "@Override\r\n\t\tpublic void init() {\n\t\t\t\r\n\t\t}", "@Override\n\tpublic void sacrifier() {\n\t\t\n\t}", "@Override\r\n\tprotected void InitData() {\n\t\t\r\n\t}", "public void designBasement() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initialize() {\r\n\t\t\r\n\t\t\r\n\t}", "public void gored() {\n\t\t\n\t}", "@Override\r\n\tprotected void initData() {\n\r\n\t}", "@Override\n\tpublic void einkaufen() {\n\t}", "@Override\n protected void initialize() {\n\n \n }", "public void mo38117a() {\n }", "@Override\n\tprotected void getData() {\n\t\t\n\t}", "Constructor() {\r\n\t\t \r\n\t }", "@Override\r\n\tpublic void dibujar() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void dibujar() {\n\t\t\r\n\t}", "@Override\n\tpublic void one() {\n\t\t\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "private stendhal() {\n\t}", "@Override\n\tprotected void update() {\n\t\t\n\t}", "@Override\n\t\t\tpublic void ic() {\n\t\t\t\t\n\t\t\t}", "@Override\n\tprotected void initData() {\n\n\t}", "@Override\n\tprotected void initData() {\n\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n public void init() {\n\n }", "@Override\n\tprotected void initialize() {\n\t\t\n\t}", "@Override\n\tprotected void initialize() {\n\t\t\n\t}", "@Override\r\n\tpublic void init() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void init() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void init() {\n\t\t\r\n\t}", "@Override\n\tpublic void debite() {\n\t\t\n\t}", "@Override\r\n\tpublic void init() {\n\r\n\t}", "@Override\r\n\tpublic void init() {\n\r\n\t}", "@Override\r\n\tpublic void init() {\n\r\n\t}", "public contrustor(){\r\n\t}", "@Override\n\tprotected void initialize() {\n\n\t}", "@Override\r\n\tpublic void dispase() {\n\r\n\t}", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "@Override\n\tpublic void dtd() {\n\t\t\n\t}", "@Override\n\tprotected void logic() {\n\n\t}", "@Override\n\tprotected void lazyLoad() {\n\t\t\n\t}", "public void mo4359a() {\n }", "@Override\r\n\tprotected void initialize() {\n\r\n\t}", "@Override\n public void memoria() {\n \n }", "@Override\n\t\tpublic void method() {\n\t\t\t\n\t\t}", "private RepositorioAtendimentoPublicoHBM() {\r\t}", "@Override\n protected void initialize() \n {\n \n }", "@Override\r\n\tpublic void getProposition() {\n\r\n\t}", "@Override\n\tpublic void particular1() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\n\t}", "@Override\n\tpublic void init() {\n\n\t}", "@Override\n\tpublic void init() {\n\n\t}", "@Override\n protected void prot() {\n }", "@Override\r\n\tpublic void init()\r\n\t{\n\t}", "@Override\n\tprotected void initValue()\n\t{\n\n\t}", "public void mo55254a() {\n }" ]
[ "0.6671074", "0.6567672", "0.6523024", "0.6481211", "0.6477082", "0.64591026", "0.64127725", "0.63762105", "0.6276059", "0.6254286", "0.623686", "0.6223679", "0.6201336", "0.61950207", "0.61950207", "0.61922914", "0.6186996", "0.6173591", "0.61327106", "0.61285484", "0.6080161", "0.6077022", "0.6041561", "0.6024072", "0.6020252", "0.59984857", "0.59672105", "0.59672105", "0.5965777", "0.59485507", "0.5940904", "0.59239364", "0.5910017", "0.5902906", "0.58946234", "0.5886006", "0.58839184", "0.58691067", "0.5857751", "0.58503544", "0.5847024", "0.58239377", "0.5810564", "0.5810089", "0.5806823", "0.5806823", "0.5800025", "0.5792378", "0.5792378", "0.5792378", "0.5792378", "0.5792378", "0.5792378", "0.5790187", "0.5789414", "0.5787092", "0.57844025", "0.57844025", "0.5774479", "0.5774479", "0.5774479", "0.5774479", "0.5774479", "0.5761362", "0.57596046", "0.57596046", "0.575025", "0.575025", "0.575025", "0.5747959", "0.57337177", "0.57337177", "0.57337177", "0.5721452", "0.5715831", "0.57142824", "0.57140535", "0.57140535", "0.57140535", "0.57140535", "0.57140535", "0.57140535", "0.57140535", "0.5711723", "0.57041645", "0.56991017", "0.5696783", "0.56881124", "0.56774884", "0.56734604", "0.56728", "0.56696945", "0.5661323", "0.5657007", "0.5655942", "0.5655942", "0.5655942", "0.56549734", "0.5654792", "0.5652974", "0.5650185" ]
0.0
-1
TODO Autogenerated method stub
private static void populateLftMax(List<Integer> lftMax) { int curMax=-1; for(int i= 0;i<lis.size();i++) { lftMax.add(curMax); if(lis.get(i) > curMax ) curMax= Math.max(curMax, lis.get(i)); else continue; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\r\n\tpublic void comer() \r\n\t{\n\t\t\r\n\t}", "@Override\n\tpublic void comer() {\n\t\t\n\t}", "@Override\n public void perish() {\n \n }", "@Override\r\n\t\t\tpublic void annadir() {\n\r\n\t\t\t}", "@Override\n\tpublic void anular() {\n\n\t}", "@Override\n\tprotected void getExras() {\n\n\t}", "@Override\r\n\tpublic void anularFact() {\n\t\t\r\n\t}", "@Override\n\tpublic void entrenar() {\n\t\t\n\t}", "@Override\n\tpublic void nadar() {\n\t\t\n\t}", "@Override\r\n\tpublic void tires() {\n\t\t\r\n\t}", "@Override\r\n\t\t\tpublic void ayuda() {\n\r\n\t\t\t}", "@Override\n\tprotected void interr() {\n\t}", "@Override\n\tpublic void emprestimo() {\n\n\t}", "@Override\r\n\tpublic void bicar() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void bicar() {\n\t\t\r\n\t}", "@Override\n\tpublic void grabar() {\n\t\t\n\t}", "@Override\n\tpublic void gravarBd() {\n\t\t\n\t}", "@Override\r\n\tpublic void rozmnozovat() {\n\t}", "@Override\r\n\tpublic void dormir() {\n\t\t\r\n\t}", "@Override\n protected void getExras() {\n }", "@Override\r\n\tpublic void publierEnchere() {\n\t\t\r\n\t}", "@Override\n\tpublic void nefesAl() {\n\n\t}", "@Override\n\tpublic void ligar() {\n\t\t\n\t}", "@Override\n public void func_104112_b() {\n \n }", "@Override\n\tprotected void initdata() {\n\n\t}", "@Override\n\tpublic void nghe() {\n\n\t}", "@Override\n public void function()\n {\n }", "@Override\n public void function()\n {\n }", "public final void mo51373a() {\n }", "@Override\r\n\tpublic void stehReagieren() {\r\n\t\t//\r\n\t}", "@Override\n public void inizializza() {\n\n super.inizializza();\n }", "@Override\n\tprotected void initData() {\n\t\t\n\t}", "@Override\r\n\t\tpublic void init() {\n\t\t\t\r\n\t\t}", "@Override\n\tpublic void sacrifier() {\n\t\t\n\t}", "@Override\r\n\tprotected void InitData() {\n\t\t\r\n\t}", "public void designBasement() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initialize() {\r\n\t\t\r\n\t\t\r\n\t}", "public void gored() {\n\t\t\n\t}", "@Override\r\n\tprotected void initData() {\n\r\n\t}", "@Override\n\tpublic void einkaufen() {\n\t}", "@Override\n protected void initialize() {\n\n \n }", "public void mo38117a() {\n }", "@Override\n\tprotected void getData() {\n\t\t\n\t}", "Constructor() {\r\n\t\t \r\n\t }", "@Override\r\n\tpublic void dibujar() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void dibujar() {\n\t\t\r\n\t}", "@Override\n\tpublic void one() {\n\t\t\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "private stendhal() {\n\t}", "@Override\n\tprotected void update() {\n\t\t\n\t}", "@Override\n\t\t\tpublic void ic() {\n\t\t\t\t\n\t\t\t}", "@Override\n\tprotected void initData() {\n\n\t}", "@Override\n\tprotected void initData() {\n\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n public void init() {\n\n }", "@Override\n\tprotected void initialize() {\n\t\t\n\t}", "@Override\n\tprotected void initialize() {\n\t\t\n\t}", "@Override\r\n\tpublic void init() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void init() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void init() {\n\t\t\r\n\t}", "@Override\n\tpublic void debite() {\n\t\t\n\t}", "@Override\r\n\tpublic void init() {\n\r\n\t}", "@Override\r\n\tpublic void init() {\n\r\n\t}", "@Override\r\n\tpublic void init() {\n\r\n\t}", "public contrustor(){\r\n\t}", "@Override\n\tprotected void initialize() {\n\n\t}", "@Override\r\n\tpublic void dispase() {\n\r\n\t}", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "@Override\n\tpublic void dtd() {\n\t\t\n\t}", "@Override\n\tprotected void logic() {\n\n\t}", "@Override\n\tprotected void lazyLoad() {\n\t\t\n\t}", "public void mo4359a() {\n }", "@Override\r\n\tprotected void initialize() {\n\r\n\t}", "@Override\n public void memoria() {\n \n }", "@Override\n\t\tpublic void method() {\n\t\t\t\n\t\t}", "private RepositorioAtendimentoPublicoHBM() {\r\t}", "@Override\n protected void initialize() \n {\n \n }", "@Override\r\n\tpublic void getProposition() {\n\r\n\t}", "@Override\n\tpublic void particular1() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\n\t}", "@Override\n\tpublic void init() {\n\n\t}", "@Override\n\tpublic void init() {\n\n\t}", "@Override\n protected void prot() {\n }", "@Override\r\n\tpublic void init()\r\n\t{\n\t}", "@Override\n\tprotected void initValue()\n\t{\n\n\t}", "public void mo55254a() {\n }" ]
[ "0.6671074", "0.6567672", "0.6523024", "0.6481211", "0.6477082", "0.64591026", "0.64127725", "0.63762105", "0.6276059", "0.6254286", "0.623686", "0.6223679", "0.6201336", "0.61950207", "0.61950207", "0.61922914", "0.6186996", "0.6173591", "0.61327106", "0.61285484", "0.6080161", "0.6077022", "0.6041561", "0.6024072", "0.6020252", "0.59984857", "0.59672105", "0.59672105", "0.5965777", "0.59485507", "0.5940904", "0.59239364", "0.5910017", "0.5902906", "0.58946234", "0.5886006", "0.58839184", "0.58691067", "0.5857751", "0.58503544", "0.5847024", "0.58239377", "0.5810564", "0.5810089", "0.5806823", "0.5806823", "0.5800025", "0.5792378", "0.5792378", "0.5792378", "0.5792378", "0.5792378", "0.5792378", "0.5790187", "0.5789414", "0.5787092", "0.57844025", "0.57844025", "0.5774479", "0.5774479", "0.5774479", "0.5774479", "0.5774479", "0.5761362", "0.57596046", "0.57596046", "0.575025", "0.575025", "0.575025", "0.5747959", "0.57337177", "0.57337177", "0.57337177", "0.5721452", "0.5715831", "0.57142824", "0.57140535", "0.57140535", "0.57140535", "0.57140535", "0.57140535", "0.57140535", "0.57140535", "0.5711723", "0.57041645", "0.56991017", "0.5696783", "0.56881124", "0.56774884", "0.56734604", "0.56728", "0.56696945", "0.5661323", "0.5657007", "0.5655942", "0.5655942", "0.5655942", "0.56549734", "0.5654792", "0.5652974", "0.5650185" ]
0.0
-1
Creates new form Register
public Register() { initComponents(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@RequestMapping(\"/register\")\r\n\tpublic ModelAndView register(@ModelAttribute(\"registerForm\") final UserRegisterForm form) {\r\n\t\treturn new ModelAndView(\"users/register\");\r\n\t}", "public RegisterForm() {\n initComponents();\n }", "public RegisterForm() {\n initComponents();\n }", "public RegisterForm() {\n initComponents();\n }", "public String createRegisterForm(Register reg)\n {\n DBConnect db = new DBConnect();\n Connection con;\n \n try\n {\n con = (Connection) db.establishConnection();\n String q = \"insert into registerUser (register_name, register_email, register_phone, register_pass)\"\n + \"values (?, ?, ?, ?)\";\n \n PreparedStatement prepareState = con.prepareStatement(q);\n \n prepareState.setString(1, reg.getRegisterName());\n prepareState.setString(2, reg.getRegisterEmail());\n prepareState.setString(3, reg.getRegisterPhone());\n prepareState.setString(4, reg.getRegisterPassword());\n \n prepareState.execute();\n con.close();\n \n return \"Successfully Registered..!!\";\n }\n \n catch(Exception ex)\n {\n System.err.println(\"Exception..!!\");\n System.err.println(\"Message: \" + ex.getMessage());\n \n return \"Data Not Registered..!!\";\n }\n \n }", "public void registerUser(RegisterForm form) throws DAOException;", "@GetMapping(\"register\")\n public String registerForm(RegisterForm registerForm) {\n return \"register\";\n }", "void register() {\n if (registerView.getFirstName().length() == 0 || registerView.getLastName().length() == 0 || registerView.getUsername().length() == 0 || registerView.getPassword().length() == 0) {\n IDialog invalidRegistrationDialog\n = dialogFactory.createDialog(DialogFactoryOptions.dialogNames.MESSAGE, new HashMap<String, Object>() {\n {\n put(\"message\", \"Unable to register: Fields must be non-empty!\");\n put(\"title\", \"Authentication Error\");\n put(\"messageType\", DialogFactoryOptions.dialogType.ERROR);\n }\n });\n\n invalidRegistrationDialog.run();\n } else {\n if (userController.registerUser(registerView.getFirstName(), registerView.getLastName(), registerView.getUsername(), registerView.getPassword()) != null) {\n mainFrame.setPanel(panelFactory.createPanel(PanelFactoryOptions.panelNames.MAIN_MENU));\n } else {\n IDialog invalidRegistrationDialog = dialogFactory.createDialog(DialogFactoryOptions.dialogNames.MESSAGE, new HashMap<String, Object>() {\n {\n put(\"message\", \"Unable to register: Username is already taken\");\n put(\"title\", \"Authentication Error\");\n put(\"messageType\", DialogFactoryOptions.dialogType.ERROR);\n }\n });\n\n invalidRegistrationDialog.run();\n }\n }\n }", "public void register(String form /* should be a Form from GUI */){\n String email = \"email\";\n String nome_completo = \"full_name\";\n Date data_nascimento = new Date(1996-10-21);\n String password = getMd5(\"password\");\n String nif = \"nif\";\n String morada = \"morada\";\n String telemovel = \"telemovel\";\n User user = new User(email);\n if (!user.exists()){\n user.setNome_completo(nome_completo);\n user.setData_nascimento(data_nascimento);\n user.setPassword(password);\n user.setNif(nif);\n user.setMorada(morada);\n user.setTelemovel(telemovel);\n user.setAdmin(FALSE);\n //System registers person\n //db.register(user)\n }\n }", "@RequestMapping(\"/showForm\")\n\tpublic String showForm(Model theModel) {\n\t\tRegister theRegister = new Register();\n\t\t\n\t // add register object to the model\n\t\ttheModel.addAttribute(\"register\", theRegister);\n\t\t\n\t\treturn \"register-form\";\n\t}", "@GetMapping(\"/register\")\r\n\tpublic String showRegistrationForm(Model theModel) {\r\n\t\ttheModel.addAttribute(\"user\", new UserCrm());\r\n\t\treturn \"registration\";\r\n\t}", "@GetMapping(\"/registration\")\n\t public String registration(Model model) {\n\t model.addAttribute(\"userForm\", new User());\n\t return \"registration\";\n\t }", "@RequestMapping(value = \"/create\", method = RequestMethod.GET)\n public final String create(final ModelMap model) {\n model.addAttribute(REGISTER, new Register());\n return \"create\";\n }", "@RequestMapping(\"/newuser\")\r\n\tpublic ModelAndView newUser() {\t\t\r\n\t\tRegister reg = new Register();\r\n\t\treg.setUser_type(\"ROLE_INDIVIDUAL\");\r\n\t\treg.setEmail_id(\"[email protected]\");\r\n\t\treg.setFirst_name(\"First Name\");\r\n\t\treg.setCity(\"pune\");\r\n\t\treg.setMb_no(new BigInteger(\"9876543210\"));\r\n\t\treturn new ModelAndView(\"register\", \"rg\", reg);\r\n\t}", "@GetMapping(\"/registration\")\n public String registration(Model model) {\n \t\n model.addAttribute(\"userForm\", new User());\n\n return \"registration\";\n }", "@RequestMapping(\"/processForm\")\n\tpublic String processForm( @Valid @ModelAttribute(\"register\") Register theRegister, BindingResult theBindingResult) {\n\t\tSystem.out.println(\"Register new: \" + theRegister.getFirstName() \n\t\t\t\t\t\t+ \" \" + theRegister.getLastName());\n\t\t\n\t\tif(theBindingResult.hasErrors()) {\n\t\t\t\n\t\t\treturn \"register-form\";\n\t\t}else {\n\t\t\treturn \"register-confirmation\";\n\t\t}\n\t\t\n\t\t\n\t\t\n\t}", "@GetMapping(\"register\")\n public String registerForm(Model model){\n model.addAttribute(\"user\", new User());\n return \"register_form\";\n }", "@RequestMapping(value = \"register\", method = RequestMethod.POST)\n public String register(@ModelAttribute @Valid RegisterForm registerForm, Errors errors, HttpServletRequest request, Model model) {\n\n if (errors.hasErrors()) {\n model.addAttribute(\"title\", \"Register to RandNums\");\n model.addAttribute(\"sessionActive\", isSessionActive(request.getSession()));\n return \"login/register\";\n }\n\n User existingUser = userDao.findByUsername(registerForm.getUsername());\n\n if (existingUser != null) {\n errors.rejectValue(\"username\", \"username.alreadyexists\", \"A user with that username already exists\");\n model.addAttribute(\"title\", \"Register\");\n model.addAttribute(\"sessionActive\", isSessionActive(request.getSession()));\n return \"login/register\";\n }\n\n User newUser = new User(registerForm.getUsername(), registerForm.getEmail(), registerForm.getPassword());\n\n userDao.save(newUser);\n setUserInSession(request.getSession(), newUser);\n\n return \"redirect:/home\";\n }", "@GetMapping(\"/register-particular\")\n\tpublic ModelAndView goToRegisterPartForm() {\n\t\t\n\t\tModelAndView mav = new ModelAndView(\"register-particular\");\n\t\tUser user = new User();\n\t\tmav.addObject(\"user\", user);\n\n\t\treturn mav;\n\t}", "public Successful_Registration() {\n initComponents();\n }", "@GetMapping(\"/register\")\n public String showRegister(Model model){\n model.addAttribute(\"user\", new User());\n return \"registerForm\";\n }", "private void register() {\r\n if (mName.getText().length() == 0) {\r\n mName.setError(\"please fill this field\");\r\n return;\r\n }\r\n if (mEmail.getText().length() == 0) {\r\n mEmail.setError(\"please fill this field\");\r\n return;\r\n }\r\n if (mPassword.getText().length() == 0) {\r\n mPassword.setError(\"please fill this field\");\r\n return;\r\n }\r\n if (mPassword.getText().length() < 6) {\r\n mPassword.setError(\"password must have at least 6 characters\");\r\n return;\r\n }\r\n\r\n\r\n final String email = mEmail.getText().toString();\r\n final String password = mPassword.getText().toString();\r\n final String name = mName.getText().toString();\r\n\r\n FirebaseAuth.getInstance().createUserWithEmailAndPassword(email, password).addOnCompleteListener(getActivity(), new OnCompleteListener<AuthResult>() {\r\n @Override\r\n public void onComplete(@NonNull Task<AuthResult> task) {\r\n if (!task.isSuccessful()) {\r\n Snackbar.make(view.findViewById(R.id.layout), \"sign up error\", Snackbar.LENGTH_SHORT).show();\r\n } else {\r\n String uid = FirebaseAuth.getInstance().getCurrentUser().getUid();\r\n\r\n //Saves the user's info in the database\r\n Map<String, Object> mNewUserMap = new HashMap<>();\r\n mNewUserMap.put(\"email\", email);\r\n mNewUserMap.put(\"name\", name);\r\n\r\n FirebaseDatabase.getInstance().getReference().child(\"users\").child(uid).updateChildren(mNewUserMap);\r\n }\r\n }\r\n });\r\n\r\n }", "@RequestMapping(value = \"/register\", method = RequestMethod.GET)\n public ModelAndView displayRegisterForm() {\n return new ModelAndView(\"registerForm\", \"customer\", new Customer());\n }", "private FormLayout initRegisterForm() {\r\n final FormLayout formLayout = new FormLayout();\r\n formLayout.getElement().getThemeList().removeAll(formLayout.getElement().getThemeList());\r\n formLayout.setClassName(StyleConstants.REGISTER_CONTENT.getName());\r\n\r\n nameField = new VTextField(getTranslation(\"name.label\"));\r\n\r\n lastNameField = new VTextField(getTranslation(\"lastName.label\"));\r\n\r\n birthDate = new VDatePicker(getTranslation(\"birthDate.label\"));\r\n birthDate.setMax(LocalDate.now().minusYears(5));\r\n birthDate.setMin(LocalDate.now().minusYears(100));\r\n final DatePickerI18n calendarLocalization = new DatePickerI18n();\r\n birthDate.setI18n(calendarLocalization);\r\n\r\n identificationNumberField = new VTextField(getTranslation(\"identificationNumber.label\"));\r\n identificationNumberField.addValueChangeListener(e -> {\r\n if (setErrorIfRequired(e.getSource().getElement(), !e.getValue().matches(\"^[0-9]*$\"), \"field.onlyNumbers\")) {\r\n return;\r\n }\r\n setErrorIfRequired(e.getSource().getElement(), e.getValue().length() < e.getSource().getMinLength(), \"field.minLength\", 4);\r\n });\r\n identificationNumberField.setMinLength(4);\r\n identificationNumberField.setMaxLength(8);\r\n identificationNumberField.setValueChangeMode(ValueChangeMode.EAGER);\r\n\r\n emailField = new VEmailField(getTranslation(\"email.label\"));\r\n emailField.setValueChangeMode(ValueChangeMode.EAGER);\r\n emailField.addValueChangeListener(e -> {\r\n setErrorIfRequired(e.getSource().getElement(), !e.getValue().matches(\"^\\\\w+@[a-zA-Z_]+?\\\\.[a-zA-Z]{2,3}$\"), \"field.notEmail\");\r\n });\r\n usernameField = new VTextField(getTranslation(\"username.label\"));\r\n\r\n passwordField = new VPasswordField(getTranslation(\"password.label\"));\r\n repeatPasswordField = new VPasswordField(getTranslation(\"repeatPassword.label\"));\r\n passwordField.setValueChangeMode(ValueChangeMode.EAGER);\r\n passwordField.setMinLength(5);\r\n passwordField.addValueChangeListener(e -> {\r\n setErrorIfRequired(e.getSource().getElement(), e.getValue().length() < e.getSource().getMinLength(), \"field.minLength\", 5);\r\n });\r\n\r\n repeatPasswordField.setValueChangeMode(ValueChangeMode.EAGER);\r\n repeatPasswordField.addValueChangeListener(e -> {\r\n setErrorIfRequired(e.getSource().getElement(),\r\n !e.getValue().equals(passwordField.getValue()) && StringUtils.isNotBlank(passwordField.getValue()), \"field.passwordNotMatch\");\r\n });\r\n\r\n professionSelect = new VSelect<>(getTranslation(\"profession.label\"));\r\n professionSelect.setItemLabelGenerator(item -> getTranslation(item.getProfessionTranslationKey()));\r\n professionSelect.setItems(Arrays.asList(Professions.values()));\r\n\r\n organizationSelect = new VSelect<>(getTranslation(\"organization.label\"));\r\n organizationSelect.setItemLabelGenerator(item -> item.getName());\r\n\r\n final VButton requestAccessButton = new VButton(getTranslation(\"requestAccess.label\"));\r\n requestAccessButton.addClassName(StyleConstants.BUTTON_BLUE.getName());\r\n requestAccessButton.addClickListener(e -> requestAccess());\r\n\r\n final RouterLink signInButton = new RouterLink(getTranslation(\"signIn.label\"), LoginView.class);\r\n\r\n formLayout.add(nameField, lastNameField, birthDate, identificationNumberField, emailField, usernameField, passwordField, repeatPasswordField,\r\n professionSelect, organizationSelect);\r\n formLayout.setColspan(requestAccessButton, 2);\r\n\r\n formLayout.add(requestAccessButton, signInButton);\r\n requestAccessButton.addClickListener(e -> {\r\n\r\n });\r\n return formLayout;\r\n }", "UserRegistrationResponse registrationPost(RegistrationForm registrationForm);", "public LandingPage registerNewAccount(){\n\t\taction.WaitForWebElement(linkRegisterNewAccount)\n\t\t\t .Click(linkRegisterNewAccount);\n\t\treturn this;\n\t}", "@RequestMapping(value = \"/register\",method = RequestMethod.GET)\r\n\tpublic String viewRegistration(Model model) { \r\n\t\tmodel.addAttribute(\"userForm\", uservalue);\r\n\t\t//UserForm Name of the model attribute under which the form object is exposed. Defaults to 'command'.\r\n\t\treturn \"Registration\";\r\n\t}", "private void register() {\n Intent intent = new Intent(LoginActivity.this, RegisterActivity.class);\n startActivity(intent);\n }", "public Register() {\n initComponents();\n }", "public Register() {\n initComponents();\n }", "public Register() {\n initComponents();\n }", "public Register() {\n initComponents();\n }", "@GetMapping(value=\"/\")\n\tpublic String showRegistrationForm(WebRequest request, Model model) {\n\t\tUserDTO userDTO = new UserDTO();\n\t\tmodel.addAttribute(\"user\", userDTO);\n\t\treturn \"security/register\";\n\t}", "@RequestMapping(value = \"/create\", method = RequestMethod.POST)\n public final String submit(\n @ModelAttribute(REGISTER) @Valid final Register register,\n final BindingResult binding, final HttpServletRequest request) {\n final Locale locale = localeResolver.resolveLocale(request);\n\n if (binding.hasErrors()) {\n return \"create\";\n }\n\n final UserAccount user = new UserAccount(register.getUsername());\n user.setDisplayName(register.getDisplayName());\n user.setEmail(register.getEmail());\n user.setPassword(passwordEncoder.encodePassword(\n register.getPassword(), user.getSalt()));\n\n try {\n userDetailsService.addUser(user, locale);\n } catch (DuplicateUserException e) {\n binding.addError(new FieldError(REGISTER, \"username\",\n messageSource.getMessage(\"create.error.username\", null,\n locale)));\n return \"create\";\n }\n\n return \"redirect:/register/success\";\n }", "@GetMapping(\"/register-pro\")\n\tpublic ModelAndView goToRegisterProForm() {\n\t\t\n\t\tModelAndView mav = new ModelAndView(\"register-pro\");\n\t\tUser user = new User();\n\t\tmav.addObject(\"user\", user);\n\n\t\treturn mav;\n\t}", "public void displayRegisterForm(View v) {\n\n Intent intent = new Intent(getApplicationContext(), RegistrationScreenActivity.class);\n startActivityForResult(intent, NEW_USER_REGISTER);\n }", "public signup() {\n initComponents();\n }", "public Register() {\n user = new User();\n em = EMF.createEntityManager();\n valid = false;\n }", "@GetMapping(\"/register\")\n\tpublic String provideRegistrationForm(Model map)\n\t{\n\t\tSystem.out.println(\"inside vendor reg form\" + getClass().getName());\n\t\tmap.addAttribute(\"vendor_details\", new Vendor());\n\t\tmap.addAttribute(\"payment_modes\", PaymentMode.values());\n\t\tSystem.out.println(map);\n\t\treturn \"/admin/register\";\n\t}", "private void register_user() {\n\n\t\tHttpRegister post = new HttpRegister();\n\t\tpost.execute(Config.URL + \"/api/newuser\");\n\n\t}", "@RequestMapping(value = \"/registreren\", method = RequestMethod.POST)\n\tpublic String register(HttpServletRequest req, @ModelAttribute(\"form\") RegisterForm form,\n Errors errors, HttpSession session) {\n synchronized(AccountController.class) { // hopefully registrations don't occur too much\n User user = userSessionService.getCurrentUser(session);\n if (user == null || user.isAnonymous()) {\n validator.validate(form, errors);\n if (!errors.hasErrors()) {\n try {\n user = new User();\n form.applyTo(user);\n userRepo.store(user);\n userSessionService.login(session, user);\n int userId = user.getId();\n\t\t\t\t\t\t\n String userName = \"anonymous\";\n userName = Integer.toString(userId);\n\t\t\t\t\t\tString userIP = ipUtil.getClientIp(req);\n\t\t\t\t\t\tString action = \"register\";\n\t\t\t\t\t\tString userAgent = req.getHeader(\"user-agent\");\n\t\t\t\t\t\tString referer = req.getHeader(\"Referer\");\n\t\t\t\t\t\tif (referer == null){\n\t\t\t\t\t\t\treferer = \"register\";\n\t\t\t\t\t\t}\n\t\t\t\t\t\tLog4jPrefix.initialise(userName, userIP, action, userAgent, referer);\n log.info(String.format(\"Registered %s!\", user.getShortDescription()));\n } catch(Exception e) {\n // this exception may have been caused by duplicate user\n // so we'll simply validate again. If validation fails\n // we'll return this page, otherwise we'll rethrow,\n // resulting in the error page\n validator.validate(form, errors);\n if (!errors.hasErrors()) {\n if (e instanceof RuntimeException) {\n throw (RuntimeException) e;\n }\n throw new RuntimeException(e);\n }\n // show form again\n return \"register\";\n }\n } else {\n // show form again\n return \"register\";\n }\n }\n }\n return \"redirect:/\";\n\t}", "public void register()\n {\n String n = nameProperty.getValue();\n if (n == null || n.isEmpty())\n {\n throw new IllegalArgumentException(\"Field cannot be empty\");\n }\n String p = passwordProperty.getValue();\n if (p == null || p.isEmpty())\n {\n throw new IllegalArgumentException(\"Field cannot be empty\");\n }\n String e = emailProperty.getValue();\n if (e == null || e.isEmpty())\n {\n throw new IllegalArgumentException(\"Field cannot be empty\");\n }\n String ph = phoneProperty.getValue();\n if (ph == null || ph.isEmpty())\n {\n throw new IllegalArgumentException(\"Field cannot be empty\");\n }\n if (ph.length() != 8)\n {\n throw new IllegalArgumentException(\"Invalid phone number\");\n }\n try\n {\n Integer.parseInt(ph);\n }\n catch (NumberFormatException ex)\n {\n throw new IllegalArgumentException(\"Invalid phone number\", ex);\n }\n String t = titleProperty.getValue();\n if (t == null || t.isEmpty())\n {\n throw new IllegalArgumentException(\"Field cannot be empty\");\n }\n String a = authorProperty.getValue();\n if (a == null || a.isEmpty())\n {\n throw new IllegalArgumentException(\"Field cannot be empty\");\n }\n String y = yearProperty.getValue();\n if (y == null || y.isEmpty())\n {\n throw new IllegalArgumentException(\"Field cannot be empty\");\n }\n if (y.length() != 4)\n {\n throw new IllegalArgumentException(\"Invalid year\");\n }\n try\n {\n Integer.parseInt(y);\n }\n catch (NumberFormatException ex)\n {\n throw new IllegalArgumentException(\"Invalid year\", ex);\n }\n\n try\n {\n\n model.registerUser(n, p, e, ph, t, a, y);\n\n }\n catch (Exception e1)\n {\n\n e1.printStackTrace();\n }\n\n }", "public Register() {\n initComponents();\n \n }", "public RegisterView() {\r\n\r\n\t\tcontainer = getContentPane();\r\n\t\tcontainer.setLayout(new BorderLayout());\r\n\t\tpanelRegister = new JPanel(new GridLayout(8, 1));\r\n\t\tpanelButton = new JPanel(new GridLayout(1, 2));\r\n\t\ttextFieldUser = new JTextField();\r\n\t\tpasswordFieldPassword = new JPasswordField();\r\n\t\tpasswordFieldRePassword = new JPasswordField();\r\n\t\tcheckBoxIsFarmer = new JCheckBox();\r\n\t\tlabelUser = new JLabel(\"Username: \");\r\n\t\tlabelPassword = new JLabel(\"Password: \");\r\n\t\tlabelRePassword = new JLabel(\"Confirm Password: \");\r\n\t\tlabelIsFarmer = new JLabel(\"Farmer? (Yes/No)\");\r\n\r\n\t\tpanelRegister.add(labelUser);\r\n\t\tpanelRegister.add(textFieldUser);\r\n\t\tpanelRegister.add(labelPassword);\r\n\t\tpanelRegister.add(passwordFieldPassword);\r\n\t\tpanelRegister.add(labelRePassword);\r\n\t\tpanelRegister.add(passwordFieldRePassword);\r\n\t\tpanelRegister.add(labelIsFarmer);\r\n\t\tpanelRegister.add(checkBoxIsFarmer);\r\n\r\n\t\tpanelRegister.setBackground(Util.orange);\r\n\t\tpanelButton.setBackground(Util.orange);\r\n\t\t\r\n\t\tregisterCancelController = new RegisterCancelController();\r\n\t\t\r\n\t\tbuttonRegister = new JButton(\"Confirm Registration\");\r\n\t\tregisterController = new RegisterController();\r\n\t\tbuttonRegister.addActionListener(e -> registerController.startProcess(this));\r\n\t\tbuttonCancel = new JButton(\"Cancel\");\r\n\t\tregisterCancelController = new RegisterCancelController();\r\n\t\tbuttonCancel.addActionListener(e -> registerCancelController.startProcess(this));\r\n\t\t\r\n\t\tpanelButton.add(buttonRegister);\r\n\t\tpanelButton.add(buttonCancel);\r\n\r\n\r\n\r\n\t\tcontainer.add(panelRegister, BorderLayout.CENTER);\r\n\t\tcontainer.add(panelButton, BorderLayout.SOUTH);\r\n\t\tthis.setVisible(true);\r\n\t\tthis.setSize(500, 500);\r\n\t\tthis.setLocationRelativeTo(null);\r\n\t\tthis.setTitle(\"Register\");\r\n\t\tthis.setDefaultCloseOperation(EXIT_ON_CLOSE);\r\n\r\n\t}", "public Signup() {\n initComponents();\n }", "public void register(View v)\n {\n\n Intent loginPage = new Intent(RegisterPage.this, Login.class);\n loginPage.putExtra(\"username\",username.getText().toString());\n loginPage.putExtra(\"password\",password.getText().toString());\n loginPage.putExtra(\"firstname\",firstName.getText().toString());\n loginPage.putExtra(\"lastname\",lastName.getText().toString());\n startActivity(loginPage);\n }", "public\n RegisterView()\n {\n super(ViewKeys.REGISTER);\n\n setAccount(null);\n setAccountChooser(new ElementComboBoxChooser(getAccounts()));\n setFilter(new TransactionFilter());\n setPanel(new Panel());\n setSearchWidget(new SearchWidget(createPopupMenu()));\n\n // Build panel.\n setFill(GridBagConstraints.BOTH);\n add(createToolsPanel(), 0, 0, 1, 1, 0, 0);\n add(getPanel(), 0, 1, 1, 1, 100, 100);\n\n getAccountChooser().setAllowInactiveAccounts(false);\n\n // Add listeners.\n getAccountChooser().addActionListener(new ActionHandler());\n getSearchWidget().addActionListener(new ActionHandler());\n }", "@RequestMapping(value = \"Register\", method = RequestMethod.POST)\n\tpublic ModelAndView register(@Valid @ModelAttribute(\"userMaster\") UserMaster userMaster, BindingResult result,\n\t\t\tModelMap model) {\n\t\tString viewName = \"home\";\n\t\tuserValidator.validate(userMaster, result);\n\t\tif (result.hasErrors()) {\n\t\t\tviewName = \"register\";\n\t\t\treturn new ModelAndView(viewName);\n\t\t}\n\t\tString id = userMasterService.save(userMaster);\n\t\tif (id.equalsIgnoreCase(\"username exits\") || id.equalsIgnoreCase(\"email exits\")) {\n\t\t\tmodel.addAttribute(\"error\", id);\n\t\t\tlogger.info(\"Cannot save because \" + id);\n\t\t\treturn new ModelAndView(\"register\");\n\t\t} else {\n\t\t\tviewName = \"login\";\n\t\t\tmodel.addAttribute(\"loginForm\", new LoginForm());\n\t\t\tmodel.addAttribute(\"error\", \"Successfully registered.<br>Please Login.\");\n\t\t\tlogger.info(\"New User:id = \" + id);\n\t\t\treturn new ModelAndView(viewName);\n\t\t}\n\n\t}", "@RequestMapping(\"/createnewuser\")\r\n\tpublic ModelAndView userCreated(@ModelAttribute(\"rg\") Register reg) {\r\n\t\t\r\n\t\tBigInteger num = reg.getMb_no();\r\n\t\tSystem.out.println(\"mbno=\"+num.toString());\r\n\t\t//Doing the entry of New User in Spring_Users table\r\n\t\t\r\n\t\tString username = reg.getEmail_id();\r\n\t\tString password = reg.getPassword();\r\n\t\tSpringUsers su = new SpringUsers();\r\n\t\tsu.setUsername(username);\r\n\t\tsu.setPassword(password);\r\n\t\tsu.setEnabled(1);\r\n\t\tSystem.out.println(\"username=\"+username);\r\n\t\tSystem.out.println(\"password=\"+password);\r\n\t\t\r\n\t\t\r\n\t\t\r\n\t\tString r = reg.getUser_type();\r\n\t\t\r\n\t\t//if(r.equals(\"ROLE_INDIVIDUAL\"))\r\n\t\t\t//return new ModelAndView(\"individualhomepage\");\r\n\t\t//if(r.equals(\"ROLE_BROKER\"))\r\n\t//\t\treturn new ModelAndView(\"brokerhomepage\");\r\n\t\t//if(r.equals(\"ROLE_BUILDER\"))\r\n\t\t//\treturn new ModelAndView(\"builderhomepage\");\r\n\t\t\r\n\t//\tint i = susvc.entryOfNewUser(su);\r\n\t\t\r\n\t\tint j = regsvc.registerNewUser(reg);\r\n\t\t \r\n\t\treturn new ModelAndView(\"usercreated\");\r\n\r\n\t}", "private void Register()\n {\n Intent registerIntent = new Intent (LoginActivity.this, RegisterActivity.class);\n startActivity(registerIntent);\n finish();\n }", "@Override\n public void onRegisterClick() {\n FragmentManager fm = getSupportFragmentManager();\n FragmentTransaction ft = fm.beginTransaction();\n if (fm.findFragmentByTag(TAG_FRG_REG_1) != null)\n ft.hide(fm.findFragmentByTag(TAG_FRG_REG_1));\n ft.add(site.getId(), new ControladorRegistro(),TAG_FRG_REG_12);\n ft.addToBackStack(TAG_FRG_REG_12);\n ft.commit();\n\n }", "public VentanaDialogRegister(ListadoUsuarios listadoUsuarios) {\n\t\tgetContentPane().setLayout(null);\n\t\t\n\t\tthis.listadoUsuarios = listadoUsuarios;\n\t\tJPanel panel = new JPanel();\n\t\tpanel.setBackground(new Color(0, 139, 139));\n\t\tpanel.setBounds(0, 0, 444, 271);\n\t\tgetContentPane().add(panel);\n\t\tpanel.setLayout(null);\n\t\t\n\t\ttxtContrasea = new JPasswordField();\n\t\ttxtContrasea.setHorizontalAlignment(SwingConstants.CENTER);\n\t\ttxtContrasea.setBounds(183, 114, 113, 23);\n\t\tpanel.add(txtContrasea);\n\t\ttxtContrasea.setColumns(10);\n\t\t\n\t\ttxtNombreDeUsuario = new JTextField();\n\t\ttxtNombreDeUsuario.setHorizontalAlignment(SwingConstants.CENTER);\n\t\ttxtNombreDeUsuario.setBounds(183, 73, 113, 30);\n\t\tpanel.add(txtNombreDeUsuario);\n\t\ttxtNombreDeUsuario.setColumns(10);\n\t\t\n\t\t\n\t\tJButton btnNewButton = new JButton(\"Registrar\");\n\t\t\n\t\tbtnNewButton.addActionListener(new ActionListener() {\n\t\t\tpublic void actionPerformed(ActionEvent arg0) {\n\t\t\t\t\t\n\t\t\t\t\tauxUsuario = listadoUsuarios.buscarUnUsuario(txtNombreDeUsuario.getText());\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\tif(auxUsuario==null){\n\t\t\t\t\tauxUsuario= new Usuario();\n\t\t\t\t\tauxUsuario.setAdmin(false);\n\t\t\t\t\tauxUsuario.setNombreU(txtNombreDeUsuario.getText());\n\t\t\t\t\tauxUsuario.setClave(txtContrasea.getText());\n\t\t\t\t\tlistadoUsuarios.agregarUsuario(auxUsuario);\n\t\t\t\t\tJOptionPane.showMessageDialog(null,\"USUARIO REGISTRADO\");\n\t\t\t\t\tdispose();\n\t\t\t\t\t}\n\t\t\t\t\telse {\n\t\t\t\t\t\tJOptionPane.showMessageDialog(null,\"ERROR! ESE NOMBRE DE USUARIO YA EXISTE\");\n\t\t\t\t\t}\n\t\t\t}\n\t\t});\n\t\tbtnNewButton.setBounds(172, 205, 124, 30);\n\t\tpanel.add(btnNewButton);\n\t\t\n\t\tJLabel lblNewLabel = new JLabel(\"REGISTRO DE USUARIOS\");\n\t\tlblNewLabel.setFont(new Font(\"Tahoma\", Font.BOLD, 14));\n\t\tlblNewLabel.setBounds(134, 11, 196, 37);\n\t\tpanel.add(lblNewLabel);\n\t\t\n\t\tJLabel lblNewLabel_1 = new JLabel(\"Nombre de Usuario:\");\n\t\tlblNewLabel_1.setFont(new Font(\"Trebuchet MS\", Font.BOLD, 14));\n\t\tlblNewLabel_1.setBounds(54, 76, 128, 23);\n\t\tpanel.add(lblNewLabel_1);\n\t\t\n\t\tJLabel lblNewLabel_1_1 = new JLabel(\"Clave:\");\n\t\tlblNewLabel_1_1.setFont(new Font(\"Trebuchet MS\", Font.BOLD, 14));\n\t\tlblNewLabel_1_1.setBounds(119, 113, 79, 23);\n\t\tpanel.add(lblNewLabel_1_1);\n\t}", "public RegisterPage goRegisterPage () {\n return topBar.goRegisterPage();\n }", "public void registrarMateria() {\n materia.setIdDepartamento(departamento);\n ejbFacade.create(materia);\n RequestContext requestContext = RequestContext.getCurrentInstance();\n requestContext.execute(\"PF('MateriaCreateDialog').hide()\");\n items = ejbFacade.findAll();\n departamento = new Departamento();\n materia = new Materia();\n\n FacesMessage msg = new FacesMessage(FacesMessage.SEVERITY_INFO, \"Información\", \"La materia se registró con éxito\");\n FacesContext.getCurrentInstance().addMessage(null, msg);\n requestContext.update(\"msg\");//Actualiza la etiqueta growl para que el mensaje pueda ser mostrado\n\n requestContext.update(\"MateriaListForm\");\n requestContext.update(\"MateriaCreateForm\");\n }", "public Read_userregister() {\n initComponents();\n }", "@RequestMapping(value = \"/user/registrationForm\", method = RequestMethod.GET)\n\tpublic ModelAndView registrationForm(HttpServletRequest request) {\n\t\tlog.debug(\"User registration\");\n\t\tString communityId = \"-1\";\n\t\tModelAndView model=new ModelAndView(\"form/registration\",\"command\",new User()); \n\t\tmodel.addObject(\"selectedCommunity\", communityId);\n\t\treturn model; \n\t}", "public Sign_up() {\n initComponents();\n }", "public SignUp() {\n initComponents();\n }", "public SignUp() {\n initComponents();\n }", "public Doctor_register() {\n initComponents();\n }", "public String registration() {\n if (name != null) {\n int createdUsers = DBUtils.addUser(name, password, email);\n if (createdUsers > 0) {\n try {\n HttpServletRequest request = (HttpServletRequest) FacesContext.getCurrentInstance().getExternalContext().getRequest();\n request.login(name, password);\n initUser();\n request.getSession().setAttribute(\"current_user\", this);\n } catch (ServletException e) {\n FacesContext context = FacesContext.getCurrentInstance();\n FacesMessage message = new FacesMessage(\"Wrong login or password\");\n message.setSeverity(FacesMessage.SEVERITY_ERROR);\n context.addMessage(\"login\", message);\n }\n return \"/index?faces-redirect=true\";\n }\n }\n return \"/pages/register.xhtml?faces-redirect=true\";\n }", "public void registerNewUser(View v) {\n Intent intent = new Intent(this, com.mms.memorizationgame.RegisterActivity.class);\n\n finish();\n startActivity(intent);\n }", "public void RegisterClick(View view) {\n Intent intent = new Intent(this, RegisterActivity.class);\n startActivity(intent);\n Toast.makeText(getApplicationContext(), \"Register as a new user\", Toast.LENGTH_SHORT).show();\n }", "@Override\n\t\t\tpublic void actionPerformed(ActionEvent e) {\n\t\t\t\tnew Register();\n\t\t\t\tsetVisible(false);\n\t\t\t}", "public Register() {\n \n initComponents();\n \n }", "private void registration() {\n\t\tif (ur_name.getText().length() > 0 && email.getText().length() > 0\r\n\t\t\t\t&& pass.getText().length() > 0\r\n\t\t\t\t&& re_pass.getText().length() > 0) {\r\n\t\t\tif (pass.getText().toString()\r\n\t\t\t\t\t.equalsIgnoreCase(re_pass.getText().toString())) {\r\n\t\t\t\tString postEntity = \"user_name=\" + ur_name.getText().toString()\r\n\t\t\t\t\t\t+ \"&email=\" + email.getText().toString() + \"&password=\"\r\n\t\t\t\t\t\t+ pass.getText().toString() + \"&gcm_id=\"\r\n\t\t\t\t\t\t+ GlobalDeclares.getGcmId();\r\n\t\t\t\tnew ServerUtilities(getApplicationContext(),\r\n\t\t\t\t\t\tGlobalDeclares.NEW_REGISTRATION, postEntity, delegate);\r\n\r\n\t\t\t} else {\r\n\t\t\t\tToast.makeText(getApplicationContext(),\r\n\t\t\t\t\t\t\"Password does not match!\", Toast.LENGTH_LONG).show();\r\n\t\t\t}\r\n\r\n\t\t} else {\r\n\t\t\tToast.makeText(getApplicationContext(),\r\n\t\t\t\t\t\"You need to fill all the fields!\", Toast.LENGTH_LONG)\r\n\t\t\t\t\t.show();\r\n\t\t}\r\n\r\n\t}", "public void register(View view){\n Intent i = new Intent(this, RegisterActivity.class);\n startActivity(i);\n }", "public RegisterPanel() {\n control = new ControlRegister();\n initComponents();\n }", "public void register(View view) {\n Intent intent = new Intent(this, RegisterScreen.class);\n startActivity(intent);\n }", "@GetMapping(\"/userAddForm\")\n\tpublic String userAddForm(Model theModel) {\n\t\tUser theUser = new User();\n\t\ttheModel.addAttribute(\"user\", theUser);\n\t\treturn \"registration-form\";\n\t}", "public void register(View view) {\n Intent intent;\n intent = new Intent(this, RegisterActivity.class);\n startActivity(intent);\n }", "public RegisterPanel() {\n initComponents();\n }", "@RequestMapping(value = {\"/register\"}, method = RequestMethod.GET)\n public String newUser(ModelMap model) {\n User user = new User();\n Customer customer = new Customer();\n List<UserProfile> userProfileList = new ArrayList();\n user.setCustomer(customer);\n user.setUserProfileList(userProfileList);\n model.addAttribute(\"user\", user);\n model.addAttribute(\"edit\", false);\n model.addAttribute(\"action\", \"newuser\");\n model.addAttribute(\"loggedinuser\", appService.getPrincipal());\n return \"registration\";\n }", "private void submitForm() {\n Toast.makeText(this, \"Registering...\", Toast.LENGTH_LONG).show();\n }", "public Register() {\n }", "@SuppressWarnings(\"unchecked\")\n // <editor-fold defaultstate=\"collapsed\" desc=\"Generated Code\">//GEN-BEGIN:initComponents\n private void initComponents() {\n\n jLabel1 = new javax.swing.JLabel();\n jLabel2 = new javax.swing.JLabel();\n jLabel3 = new javax.swing.JLabel();\n jLabel4 = new javax.swing.JLabel();\n jLabel5 = new javax.swing.JLabel();\n jLabel6 = new javax.swing.JLabel();\n txtName = new javax.swing.JTextField();\n txtPhone = new javax.swing.JTextField();\n txtAddress = new javax.swing.JTextField();\n txtPassword = new javax.swing.JPasswordField();\n txtRepassword = new javax.swing.JPasswordField();\n btnRegister = new javax.swing.JButton();\n btnBackLogin = new javax.swing.JButton();\n\n setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);\n setTitle(\"Register\");\n\n jLabel1.setFont(new java.awt.Font(\"Tahoma\", 1, 36)); // NOI18N\n jLabel1.setForeground(new java.awt.Color(204, 0, 51));\n jLabel1.setText(\"Đăng Ký\");\n\n jLabel2.setText(\"Họ Tên\");\n\n jLabel3.setText(\"SĐT\");\n\n jLabel4.setText(\"Địa chỉ\");\n\n jLabel5.setText(\"Mật khẩu\");\n\n jLabel6.setText(\"Nhập lại mật khẩu\");\n\n btnRegister.setText(\"Đăng Ký\");\n btnRegister.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n btnRegisterActionPerformed(evt);\n }\n });\n\n btnBackLogin.setText(\"Trở lại\");\n btnBackLogin.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n btnBackLoginActionPerformed(evt);\n }\n });\n\n javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());\n getContentPane().setLayout(layout);\n layout.setHorizontalGroup(\n layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(layout.createSequentialGroup()\n .addGap(444, 444, 444)\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(layout.createSequentialGroup()\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addComponent(jLabel3)\n .addComponent(jLabel2)\n .addComponent(jLabel4)\n .addComponent(jLabel5)\n .addComponent(jLabel6)\n .addComponent(btnBackLogin, javax.swing.GroupLayout.PREFERRED_SIZE, 79, javax.swing.GroupLayout.PREFERRED_SIZE))\n .addGap(23, 23, 23)\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)\n .addComponent(txtName)\n .addComponent(txtPhone)\n .addComponent(txtAddress)\n .addComponent(txtPassword)\n .addComponent(txtRepassword, javax.swing.GroupLayout.PREFERRED_SIZE, 171, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addComponent(btnRegister, javax.swing.GroupLayout.PREFERRED_SIZE, 96, javax.swing.GroupLayout.PREFERRED_SIZE)))\n .addGroup(layout.createSequentialGroup()\n .addGap(70, 70, 70)\n .addComponent(jLabel1)))\n .addContainerGap(470, Short.MAX_VALUE))\n );\n layout.setVerticalGroup(\n layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(layout.createSequentialGroup()\n .addGap(104, 104, 104)\n .addComponent(jLabel1)\n .addGap(33, 33, 33)\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)\n .addComponent(jLabel2)\n .addComponent(txtName, javax.swing.GroupLayout.PREFERRED_SIZE, 33, javax.swing.GroupLayout.PREFERRED_SIZE))\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(layout.createSequentialGroup()\n .addGap(26, 26, 26)\n .addComponent(jLabel3))\n .addGroup(layout.createSequentialGroup()\n .addGap(18, 18, 18)\n .addComponent(txtPhone, javax.swing.GroupLayout.PREFERRED_SIZE, 34, javax.swing.GroupLayout.PREFERRED_SIZE)))\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(layout.createSequentialGroup()\n .addGap(30, 30, 30)\n .addComponent(jLabel4))\n .addGroup(layout.createSequentialGroup()\n .addGap(27, 27, 27)\n .addComponent(txtAddress, javax.swing.GroupLayout.PREFERRED_SIZE, 35, javax.swing.GroupLayout.PREFERRED_SIZE)))\n .addGap(18, 18, 18)\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addComponent(jLabel5)\n .addComponent(txtPassword, javax.swing.GroupLayout.PREFERRED_SIZE, 32, javax.swing.GroupLayout.PREFERRED_SIZE))\n .addGap(18, 18, 18)\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)\n .addComponent(jLabel6)\n .addComponent(txtRepassword, javax.swing.GroupLayout.PREFERRED_SIZE, 32, javax.swing.GroupLayout.PREFERRED_SIZE))\n .addGap(41, 41, 41)\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)\n .addComponent(btnRegister, javax.swing.GroupLayout.PREFERRED_SIZE, 35, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addComponent(btnBackLogin, javax.swing.GroupLayout.PREFERRED_SIZE, 35, javax.swing.GroupLayout.PREFERRED_SIZE))\n .addContainerGap(237, Short.MAX_VALUE))\n );\n\n pack();\n }", "public PatientRegForm() {\n initComponents();\n }", "@SuppressWarnings(\"unchecked\")\n // <editor-fold defaultstate=\"collapsed\" desc=\"Generated Code\">//GEN-BEGIN:initComponents\n private void initComponents() {\n\n jPanel1 = new javax.swing.JPanel();\n jLabel1 = new javax.swing.JLabel();\n jLabel2 = new javax.swing.JLabel();\n jLabel3 = new javax.swing.JLabel();\n nametxt = new javax.swing.JTextField();\n register = new javax.swing.JButton();\n cancel = new javax.swing.JButton();\n jLabel4 = new javax.swing.JLabel();\n passwordtxt = new javax.swing.JPasswordField();\n cPasswordtxt = new javax.swing.JPasswordField();\n\n setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);\n setTitle(\"Register\");\n setPreferredSize(new java.awt.Dimension(800, 600));\n setResizable(false);\n\n jPanel1.setBackground(new java.awt.Color(0, 0, 51));\n\n jLabel1.setFont(new java.awt.Font(\"Tahoma\", 0, 24)); // NOI18N\n jLabel1.setForeground(new java.awt.Color(255, 255, 0));\n jLabel1.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);\n jLabel1.setText(\"Register\");\n\n jLabel2.setFont(new java.awt.Font(\"Tahoma\", 0, 18)); // NOI18N\n jLabel2.setForeground(new java.awt.Color(255, 255, 255));\n jLabel2.setText(\"Name\");\n\n jLabel3.setFont(new java.awt.Font(\"Tahoma\", 0, 18)); // NOI18N\n jLabel3.setForeground(new java.awt.Color(255, 255, 255));\n jLabel3.setText(\"Password\");\n\n nametxt.setFont(new java.awt.Font(\"Tahoma\", 0, 18)); // NOI18N\n nametxt.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n nametxtActionPerformed(evt);\n }\n });\n\n register.setFont(new java.awt.Font(\"Tahoma\", 0, 18)); // NOI18N\n register.setText(\"Register\");\n register.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n registerActionPerformed(evt);\n }\n });\n\n cancel.setFont(new java.awt.Font(\"Tahoma\", 0, 18)); // NOI18N\n cancel.setText(\"Cancel\");\n cancel.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n cancelActionPerformed(evt);\n }\n });\n\n jLabel4.setFont(new java.awt.Font(\"Tahoma\", 0, 18)); // NOI18N\n jLabel4.setForeground(new java.awt.Color(255, 255, 255));\n jLabel4.setText(\"Confirm Password\");\n\n passwordtxt.setFont(new java.awt.Font(\"Tahoma\", 0, 18)); // NOI18N\n\n cPasswordtxt.setFont(new java.awt.Font(\"Tahoma\", 0, 18)); // NOI18N\n\n javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1);\n jPanel1.setLayout(jPanel1Layout);\n jPanel1Layout.setHorizontalGroup(\n jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(jPanel1Layout.createSequentialGroup()\n .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(jPanel1Layout.createSequentialGroup()\n .addGap(274, 274, 274)\n .addComponent(jLabel1, javax.swing.GroupLayout.PREFERRED_SIZE, 211, javax.swing.GroupLayout.PREFERRED_SIZE))\n .addGroup(jPanel1Layout.createSequentialGroup()\n .addGap(167, 167, 167)\n .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addComponent(jLabel3)\n .addComponent(jLabel4)\n .addComponent(jLabel2, javax.swing.GroupLayout.PREFERRED_SIZE, 139, javax.swing.GroupLayout.PREFERRED_SIZE))\n .addGap(27, 27, 27)\n .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)\n .addComponent(nametxt)\n .addComponent(passwordtxt, javax.swing.GroupLayout.DEFAULT_SIZE, 272, Short.MAX_VALUE)\n .addComponent(cPasswordtxt)))\n .addGroup(jPanel1Layout.createSequentialGroup()\n .addGap(224, 224, 224)\n .addComponent(register, javax.swing.GroupLayout.PREFERRED_SIZE, 137, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addGap(42, 42, 42)\n .addComponent(cancel, javax.swing.GroupLayout.PREFERRED_SIZE, 148, javax.swing.GroupLayout.PREFERRED_SIZE)))\n .addContainerGap(146, Short.MAX_VALUE))\n );\n jPanel1Layout.setVerticalGroup(\n jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(jPanel1Layout.createSequentialGroup()\n .addGap(19, 19, 19)\n .addComponent(jLabel1)\n .addGap(59, 59, 59)\n .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)\n .addComponent(jLabel2, javax.swing.GroupLayout.PREFERRED_SIZE, 35, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addComponent(nametxt, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))\n .addGap(34, 34, 34)\n .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)\n .addComponent(jLabel3)\n .addComponent(passwordtxt, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))\n .addGap(42, 42, 42)\n .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)\n .addComponent(jLabel4)\n .addComponent(cPasswordtxt, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 49, Short.MAX_VALUE)\n .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)\n .addComponent(register)\n .addComponent(cancel))\n .addGap(40, 40, 40))\n );\n\n javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());\n getContentPane().setLayout(layout);\n layout.setHorizontalGroup(\n layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addComponent(jPanel1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)\n );\n layout.setVerticalGroup(\n layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addComponent(jPanel1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)\n );\n\n pack();\n setLocationRelativeTo(null);\n }", "public void register() {\n int index = requestFromList(getUserTypes(), true);\n if (index == -1) {\n guestPresenter.returnToMainMenu();\n return;\n }\n UserManager.UserType type;\n if (index == 0) {\n type = UserManager.UserType.ATTENDEE;\n } else if (index == 1) {\n type = UserManager.UserType.ORGANIZER;\n } else {\n type = UserManager.UserType.SPEAKER;\n }\n String name = requestString(\"name\");\n char[] password = requestString(\"password\").toCharArray();\n boolean vip = false;\n if(type == UserManager.UserType.ATTENDEE) {\n vip = requestBoolean(\"vip\");\n }\n List<Object> list = guestManager.register(type, name, password, vip);\n int id = (int)list.get(0);\n updater.addCredentials((byte[])list.get(1), (byte[])list.get(2));\n updater.addUser(id, type, name, vip);\n guestPresenter.printSuccessRegistration(id);\n }", "@GetMapping(\"/registration\")\n public String getRegistration(Model model)\n {\n model.addAttribute(\"newAccount\", new Account());\n \n return \"registration\";\n }", "public String create() {\n\n if (log.isDebugEnabled()) {\n log.debug(\"create()\");\n }\n FacesContext context = FacesContext.getCurrentInstance();\n StringBuffer sb = registration(context);\n sb.append(\"?action=Create\");\n forward(context, sb.toString());\n return (null);\n\n }", "@PostMapping(\"/register\")\n public String register(@Valid UserForm userForm, BindingResult result){\n if(!userForm.confirmPassword()){\n result.rejectValue(\"confirmPassword\",\"confirmError\",\"两次密码不一致\");\n// boo = false;\n }\n if(result.hasErrors()){\n return \"register\"; // 如果使用@Valid注解,就表示已经将userForm和result放到了model中,直接可以在前端获取信息\n }\n// if(result.hasErrors()){\n// List<FieldError> fieldErrors = result.getFieldErrors();\n// for(FieldError error : fieldErrors){\n// System.out.println(error.getField() + \" : \" + error.getDefaultMessage() + \" : \" + error.getCode());\n// }\n// boo = false;\n// }\n// if(!boo){\n// return \"register\";\n// }\n User user = userForm.convertToUser();\n userRepository.save(user);\n return \"redirect:/login\";\n }", "public Sign_Up() {\n initComponents();\n }", "public SignUpForm(Context ctx) {\n super(ctx);\n init();\n }", "public FormInserir() {\n initComponents();\n }", "@RequestMapping(\"register.action\")\n\tpublic ModelAndView register(String username,String password){\n\t\tboolean result=ud.insert(username,password);\n\t\t\n\t\tModelAndView mv=new ModelAndView();\n\t\tmv.addObject(\"message\", username);\n\t\tmv.addObject(\"str1\", \"success\");\n\t\tmv.setViewName(\"sign-up3\");\n\t\t\n\t\treturn mv;\n\t}", "public Registration() {\n initComponents();\n managerpassword_label.setVisible(false);\n managerpassword_passfield.setVisible(false);\n \n }", "Register.Req getRegisterReq();", "public void RegisterUser() {\n try {\n reg = new Registration();\n reg.setFirstName(FName);\n reg.setLastName(LName);\n reg.setCompanyName(CompanyName);\n reg.setEmail(Email);\n reg.setMobile(mobile);\n ValidateRegistration validator = new ValidateRegistration();\n boolean legitmail = validator.validateEmail(reg);\n if ( legitmail == false ) {\n System.out.println(\"Not a legitimate Email\");\n FacesContext c = FacesContext.getCurrentInstance();\n FacesMessage m = new FacesMessage(\"Invalid Email\", \"The email provided is not correct\");\n c.addMessage(null, m);\n } else {\n FacesContext c = FacesContext.getCurrentInstance();\n c.getApplication().getNavigationHandler().handleNavigation(c, null, \"mainpage.xhtml\");\n }\n } catch (Exception ex) {\n System.out.println(ex.getMessage());\n }\n }", "public void processRegistration() {\n try {\n System.out.println(\"Processing Registration\");\n FacesContext c = FacesContext.getCurrentInstance();\n c.getApplication().getNavigationHandler().handleNavigation(c, null, \"register.xhtml\");\n } catch (Exception ex) {\n System.out.println(ex.getMessage());\n }\n }", "@RequestMapping(value = \"/registration\")\n public String registration(Model model) {\n User user = new User();\n model.addAttribute(\"user\", user);\n return \"user/registration\";\n }", "@RequestMapping(\"Home1\")\r\n\tpublic String createUser1(Model m) \r\n\t{\n\t\tm.addAttribute(\"employee\",new Employee());\r\n\t\treturn \"register\";//register.jsp==form action=register\r\n\t}", "public Register() {\n\n this.literatureRegister = new ArrayList<>();\n }", "public RegistrationForm() {\n initComponents();\n this.setLocationRelativeTo(null);\n }", "public Register() {\n setTitle(\"Register\"); //sets its title name which appears on top the frame\n setDefaultCloseOperation(JFrame.DO_NOTHING_ON_CLOSE); //optional, what happens when the frame closes\n addWindowListener(new WindowAdapter() {\n public void windowClosing(WindowEvent e) {\n windowListener.handleClosing();\n }\n });\n\n setBounds(150, 150, 400, 200); //Explicitly defining the frame size and also frame location\n contentPane = new JPanel(); // Creating a new jpanel\n contentPane.setBorder(new EmptyBorder(5, 5, 5, 5)); // specifies added component's position within the panel\n setContentPane(contentPane); //Adding components to the Content Pane\n contentPane.setLayout(null); //sets the layout manager as null\n\n JLabel lblUsername = new JLabel(\"Username\"); // Creates a label with default value Username\n lblUsername.setBounds(91, 14, 66, 14); // sets the label size and location\n contentPane.add(lblUsername); // Adds the label to the content pane\n\n JLabel lblEmail = new JLabel(\"Email\"); // Creates a label with default value Email\n lblEmail.setBounds(91, 39, 66, 14); // sets the label size and location\n contentPane.add(lblEmail); // Adds the label to the content pane\n\n JLabel lblPassword = new JLabel(\"Password\"); // Creates a label with default value Password\n lblPassword.setBounds(91, 64, 66, 14); // sets the label size and location\n contentPane.add(lblPassword); // Adds the label to the content pane\n\n txtLogin = new JTextField(); // creates empty Login text field\n txtLogin.setBounds(179, 11, 120, 20); //Defines the text field size and location\n contentPane.add(txtLogin); // Adds the dreated email text field to the contentpane\n txtLogin.setColumns(10); // creates JTextField with default number of columns\n\n txtEmail = new JTextField();// creates empty email text field \n txtEmail.setBounds(179, 36, 120, 20); //Defines the text field size and location\n contentPane.add(txtEmail); // Adds the dreated email text field to the contentpane\n txtLogin.setColumns(10); // creates JTextField with default number of columns\n\n passwordField = new JPasswordField(); // create empty password field\n passwordField.setToolTipText(\"\"); // shows nothing when you hover curser over the password field\n passwordField.setBounds(179, 61, 120, 20); // Defines the password field size and location\n contentPane.add(passwordField); // Adds the password field to the Content Pane\n\n JLabel lblConfirmPassword = new JLabel(\"Confirm Password\"); // Creates a label with default value Confirm Password\n lblConfirmPassword.setBounds(65, 95, 108, 14); // sets the label size and location\n contentPane.add(lblConfirmPassword); // Adds the label to the content pane\n\n // add new user and password to txt file \n JButton btnSignUp = new JButton(\"Sign Up\"); // Creates Sign Up button and gives it default name Sign Up\n btnSignUp.addActionListener(new ActionListener() {//Adds onClick listener to the button\n public void actionPerformed(ActionEvent arg0) { // method called when the button is clicked\n\n FileWriter fw; // create variable for the FileWriter which writes to the file\n //catch for empty unfilled textfields\n if (!txtLogin.getText().isEmpty() || !passwordField.getText().isEmpty() || !confirmPasswordField.getText().isEmpty() || !txtEmail.getText().isEmpty()) {\n if (passwordField.getText().equals(confirmPasswordField.getText())) {\n Pattern p = Pattern.compile(\"^[_A-Za-z0-9-\\\\+]+(\\\\.[_A-Za-z0-9-]+)*@\"\n + \"[A-Za-z0-9-]+(\\\\.[A-Za-z0-9]+)*(\\\\.[A-Za-z]{2,})$\"); // Rejex which checks for a valid email address\n Matcher m = p.matcher(txtEmail.getText()); //Tries to match the input email to check whether it is a valid email coapturing all required aspects\n\n if (m.find()) { // when mathcer finds the email valid proceed below\n try {\n fw = new FileWriter(\"src//SandwichShop//users.txt\", true); // Assign the FileWriter fw to a file\n fw.write(txtLogin.getText() + \" \" + passwordField.getText() + \" \" + txtEmail.getText() + \" \\r\\n\"); // Write user details to the file\n fw.close(); //close the FileWriter\n } catch (IOException e1) {\n e1.printStackTrace();\n }\n JOptionPane.showMessageDialog(null, \"Registration completed successfully!\");\n } else {\n JOptionPane.showMessageDialog(null, \"Enter correct E-mail, please.\");\n }\n } else {\n JOptionPane.showMessageDialog(null, \"\\\"Password\\\" field and \\\"Confirm Password\\\" field not match\");\n }\n } else {\n JOptionPane.showMessageDialog(null, \"One or more fields are empty!\");\n }\n }\n });\n btnSignUp.setBounds(16, 125, 350, 23); // set size and location of the Sign Up button\n contentPane.add(btnSignUp); // Add the button to the content pane\n\n confirmPasswordField = new JPasswordField(); // create confirmPassword field\n confirmPasswordField.setToolTipText(\"\"); // shows nothing when you hover curser over the password field\n confirmPasswordField.setBounds(179, 92, 120, 20); // set size and location of the password field\n contentPane.add(confirmPasswordField); // add the confirm password field to the content pane\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n View RegisterView = inflater.inflate(R.layout.fragment_register, container, false);\n\n mainActivity = (MainActivity) getActivity();\n mainActivity.setTitle(R.string.title_registration);\n\n\n txtRMail = RegisterView.findViewById(R.id.txtRMail);\n txtRFirstname = RegisterView.findViewById(R.id.txtRFirstname);\n txtRLastname = RegisterView.findViewById(R.id.txtRLastname);\n txtRPassword = RegisterView.findViewById(R.id.txtRPassword);\n txtRPassword2 = RegisterView.findViewById(R.id.txtRPassword2);\n\n btnRegisterUser = RegisterView.findViewById(R.id.btnRegisterUser);\n\n\n btnRegisterUser.setOnClickListener(this);\n\n\n return RegisterView;\n }", "@PostMapping(\"/registration\")\n\t public String registration(@ModelAttribute(\"userForm\") User userForm, BindingResult bindingResult,Model model) {if (bindingResult.hasErrors()) {\n\t return \"registration\";\n\t }\n\t userService.save(userForm);\n\t localUsername=userForm.getUsername();\n\t boolean flag=userService.autoLogin(userForm.getUsername(), userForm.getPasswordConfirm());\n\t model.addAttribute(\"expense\", expenseService.getMonthAndYearAndAmount());\n\t model.addAttribute(\"username\",userForm.getUsername());\n\t return \"redirect:/dashboard\";\n\t }", "@Override\n public void onClick(View v) {\n name = txtName.getText().toString();\n username = txtUsername.getText().toString();\n password = txtPassword.getText().toString();\n try {\n if (username.trim().length() > 0 && password.trim().length() > 0 && name.trim().length() > 0) {\n dbHelper.open();\n dbHelper.Register(username, password, name);\n //jika tombol diklik akan muncul toast daftar berhasil dan langsung menuju ke halaman login\n Toast.makeText(RegisterActivity.this, \"Daftar berhasil\", Toast.LENGTH_LONG).show();\n finish();\n } else {\n //jika tombol diklik akan muncul toast daftar gagal, lengkapi form!\n Toast.makeText(RegisterActivity.this, \"Daftar gagal, lengkapi form!\", Toast.LENGTH_LONG).show();\n }\n } catch (Exception e) {\n Toast.makeText(RegisterActivity.this, e.getMessage(), Toast.LENGTH_LONG).show();\n }\n }", "public void onRegisterPressed(View v) {\n String username = ((EditText) findViewById(R.id.usernameNew)).getText().toString();\n String password = ((EditText) findViewById(R.id.passwordNew)).getText().toString();\n String checkPassword = ((EditText) findViewById(R.id.passwordNew2)).getText().toString();\n Register register = new Register(username, password, checkPassword);\n TextView passwordCheck = findViewById(R.id.passwordCheck);\n TextView errorUsername = findViewById(R.id.errorUsername);\n\n if(!register.assertPassword()) {\n passwordCheck.setVisibility(View.VISIBLE);\n } else {\n passwordCheck.setVisibility(View.GONE);\n }\n if (!register.assertUsername()) {\n errorUsername.setVisibility(View.VISIBLE);\n } else {\n errorUsername.setVisibility(View.GONE);\n }\n if(register.assertUsername() && register.assertPassword()) {\n User user = new User(username, password, (UserTypes)userTypeSpinner.getSelectedItem());\n\n Toast.makeText(this, \"Account Added\", Toast.LENGTH_SHORT).show();\n\n Persistence.getInstance().write(User.SAVE_FILE, getApplicationContext(), user);\n\n Intent mainIntent = new Intent(this, MainActivity.class);\n mainIntent.putExtra(\"EXTRA_USER_TYPE\", user.getAccountType());\n startActivity(mainIntent);\n\n finish();\n }\n }", "public NewUser() {\n initComponents();\n }" ]
[ "0.74988073", "0.7378112", "0.7378112", "0.7378112", "0.7226365", "0.71316314", "0.7109775", "0.7062638", "0.70401347", "0.69042933", "0.68422097", "0.67940044", "0.67659473", "0.674207", "0.67415524", "0.670495", "0.6669819", "0.66309756", "0.66055095", "0.6573384", "0.65553546", "0.6546664", "0.65463525", "0.65141714", "0.65103257", "0.65064234", "0.6456562", "0.643298", "0.6411387", "0.6411387", "0.6411387", "0.6411387", "0.6401095", "0.63700134", "0.636612", "0.6359408", "0.63431", "0.6332392", "0.6325052", "0.6313924", "0.63031065", "0.6293237", "0.6276417", "0.6270143", "0.6257252", "0.6255824", "0.62501216", "0.6245526", "0.62381685", "0.62265366", "0.6223372", "0.6205354", "0.6194053", "0.6189768", "0.6179607", "0.6163844", "0.6162841", "0.6161345", "0.6161345", "0.6158017", "0.6155621", "0.6153314", "0.61410433", "0.6130249", "0.6113718", "0.6110639", "0.61074173", "0.60917085", "0.6077399", "0.60745776", "0.6051812", "0.6025788", "0.6025762", "0.60244477", "0.6020783", "0.6015921", "0.60149777", "0.60107714", "0.600964", "0.60063213", "0.5998315", "0.5995448", "0.598508", "0.5984746", "0.5957217", "0.5952", "0.5937518", "0.59300464", "0.5926999", "0.59244394", "0.59198976", "0.59197557", "0.5902415", "0.58998287", "0.5890059", "0.5888599", "0.588809", "0.58849716", "0.5880784", "0.5878072" ]
0.634464
36
This method is called from within the constructor to initialize the form. WARNING: Do NOT modify this code. The content of this method is always regenerated by the Form Editor.
@SuppressWarnings("unchecked") // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents private void initComponents() { jButton1 = new javax.swing.JButton(); jPanel3 = new javax.swing.JPanel(); jPanel1 = new javax.swing.JPanel(); registerfullname = new javax.swing.JTextField(); jLabel3 = new javax.swing.JLabel(); registerusername = new javax.swing.JTextField(); jLabel5 = new javax.swing.JLabel(); registerage = new javax.swing.JTextField(); jLabel6 = new javax.swing.JLabel(); login_btn = new javax.swing.JLabel(); jPanel2 = new javax.swing.JPanel(); jLabel8 = new javax.swing.JLabel(); registeraddress = new javax.swing.JTextField(); jLabel1 = new javax.swing.JLabel(); registerpassword = new javax.swing.JPasswordField(); Register = new javax.swing.JButton(); jLabelLogin2 = new javax.swing.JLabel(); jLabel4 = new javax.swing.JLabel(); jButton1.setText("jButton1"); javax.swing.GroupLayout jPanel3Layout = new javax.swing.GroupLayout(jPanel3); jPanel3.setLayout(jPanel3Layout); jPanel3Layout.setHorizontalGroup( jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGap(0, 100, Short.MAX_VALUE) ); jPanel3Layout.setVerticalGroup( jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGap(0, 100, Short.MAX_VALUE) ); setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE); jPanel1.setBackground(new java.awt.Color(204, 255, 255)); jPanel1.setLayout(null); registerfullname.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { registerfullnameActionPerformed(evt); } }); jPanel1.add(registerfullname); registerfullname.setBounds(120, 120, 290, 30); jLabel3.setFont(new java.awt.Font("Tahoma", 1, 14)); // NOI18N jLabel3.setText("UserName : "); jPanel1.add(jLabel3); jLabel3.setBounds(40, 180, 110, 17); registerusername.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { registerusernameActionPerformed(evt); } }); jPanel1.add(registerusername); registerusername.setBounds(120, 170, 290, 30); jLabel5.setFont(new java.awt.Font("Tahoma", 1, 12)); // NOI18N jLabel5.setText("Age : "); jPanel1.add(jLabel5); jLabel5.setBounds(40, 220, 50, 30); registerage.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { registerageActionPerformed(evt); } }); jPanel1.add(registerage); registerage.setBounds(120, 220, 290, 30); jLabel6.setFont(new java.awt.Font("Tahoma", 1, 14)); // NOI18N jLabel6.setText("Password : "); jPanel1.add(jLabel6); jLabel6.setBounds(40, 280, 80, 15); login_btn.setFont(new java.awt.Font("Tahoma", 1, 12)); // NOI18N login_btn.setText("LOGIN"); login_btn.addMouseListener(new java.awt.event.MouseAdapter() { public void mouseClicked(java.awt.event.MouseEvent evt) { login_btnMouseClicked(evt); } }); jPanel1.add(login_btn); login_btn.setBounds(280, 410, 50, 20); jPanel2.setBackground(new java.awt.Color(0, 0, 0)); jLabel8.setFont(new java.awt.Font("Tahoma", 1, 36)); // NOI18N jLabel8.setForeground(new java.awt.Color(255, 255, 255)); jLabel8.setText("Registration "); javax.swing.GroupLayout jPanel2Layout = new javax.swing.GroupLayout(jPanel2); jPanel2.setLayout(jPanel2Layout); jPanel2Layout.setHorizontalGroup( jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(jPanel2Layout.createSequentialGroup() .addContainerGap() .addComponent(jLabel8, javax.swing.GroupLayout.PREFERRED_SIZE, 369, javax.swing.GroupLayout.PREFERRED_SIZE) .addContainerGap(71, Short.MAX_VALUE)) ); jPanel2Layout.setVerticalGroup( jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(jPanel2Layout.createSequentialGroup() .addContainerGap() .addComponent(jLabel8, javax.swing.GroupLayout.PREFERRED_SIZE, 80, javax.swing.GroupLayout.PREFERRED_SIZE) .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) ); jPanel1.add(jPanel2); jPanel2.setBounds(0, 0, 450, 80); jPanel1.add(registeraddress); registeraddress.setBounds(120, 320, 290, 30); jLabel1.setFont(new java.awt.Font("Tahoma", 1, 14)); // NOI18N jLabel1.setText("Address:"); jPanel1.add(jLabel1); jLabel1.setBounds(40, 320, 70, 30); registerpassword.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { registerpasswordActionPerformed(evt); } }); jPanel1.add(registerpassword); registerpassword.setBounds(120, 270, 290, 30); Register.setText("Register"); Register.addMouseListener(new java.awt.event.MouseAdapter() { public void mouseClicked(java.awt.event.MouseEvent evt) { RegisterMouseClicked(evt); } }); jPanel1.add(Register); Register.setBounds(320, 370, 90, 30); jLabelLogin2.setFont(new java.awt.Font("Tahoma", 1, 12)); // NOI18N jLabelLogin2.setText("Have an account already?"); jLabelLogin2.addMouseListener(new java.awt.event.MouseAdapter() { public void mouseClicked(java.awt.event.MouseEvent evt) { jLabelLogin2MouseClicked(evt); } }); jPanel1.add(jLabelLogin2); jLabelLogin2.setBounds(120, 410, 160, 20); jLabel4.setFont(new java.awt.Font("Tahoma", 1, 14)); // NOI18N jLabel4.setText("Full Name : "); jPanel1.add(jLabel4); jLabel4.setBounds(40, 130, 100, 17); javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane()); getContentPane().setLayout(layout); layout.setHorizontalGroup( layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(jPanel1, javax.swing.GroupLayout.DEFAULT_SIZE, 450, Short.MAX_VALUE) ); layout.setVerticalGroup( layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(jPanel1, javax.swing.GroupLayout.DEFAULT_SIZE, 450, Short.MAX_VALUE) ); pack(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public Form() {\n initComponents();\n }", "public MainForm() {\n initComponents();\n }", "public MainForm() {\n initComponents();\n }", "public MainForm() {\n initComponents();\n }", "public frmRectangulo() {\n initComponents();\n }", "public form() {\n initComponents();\n }", "public AdjointForm() {\n initComponents();\n setDefaultCloseOperation(HIDE_ON_CLOSE);\n }", "public FormListRemarking() {\n initComponents();\n }", "public MainForm() {\n initComponents();\n \n }", "public FormPemilihan() {\n initComponents();\n }", "public GUIForm() { \n initComponents();\n }", "public FrameForm() {\n initComponents();\n }", "public TorneoForm() {\n initComponents();\n }", "public FormCompra() {\n initComponents();\n }", "public muveletek() {\n initComponents();\n }", "public Interfax_D() {\n initComponents();\n }", "public quanlixe_form() {\n initComponents();\n }", "public SettingsForm() {\n initComponents();\n }", "public RegistrationForm() {\n initComponents();\n this.setLocationRelativeTo(null);\n }", "public Soru1() {\n initComponents();\n }", "public FMainForm() {\n initComponents();\n this.setResizable(false);\n setLocationRelativeTo(null);\n }", "public soal2GUI() {\n initComponents();\n }", "public EindopdrachtGUI() {\n initComponents();\n }", "public MechanicForm() {\n initComponents();\n }", "public AddDocumentLineForm(java.awt.Frame parent) {\n super(parent);\n initComponents();\n myInit();\n }", "public BloodDonationGUI() {\n initComponents();\n }", "public quotaGUI() {\n initComponents();\n }", "public Customer_Form() {\n initComponents();\n setSize(890,740);\n \n \n }", "public PatientUI() {\n initComponents();\n }", "public myForm() {\n\t\t\tinitComponents();\n\t\t}", "public Oddeven() {\n initComponents();\n }", "public intrebarea() {\n initComponents();\n }", "public Magasin() {\n initComponents();\n }", "public RadioUI()\n {\n initComponents();\n }", "public NewCustomerGUI() {\n initComponents();\n }", "public ZobrazUdalost() {\n initComponents();\n }", "public FormUtama() {\n initComponents();\n }", "public p0() {\n initComponents();\n }", "public INFORMACION() {\n initComponents();\n this.setLocationRelativeTo(null); \n }", "public ProgramForm() {\n setLookAndFeel();\n initComponents();\n }", "public AmountReleasedCommentsForm() {\r\n initComponents();\r\n }", "public form2() {\n initComponents();\n }", "public MainForm() {\n\t\tsuper(\"Hospital\", List.IMPLICIT);\n\n\t\tstartComponents();\n\t}", "public LixeiraForm() {\n initComponents();\n setLocationRelativeTo(null);\n }", "public kunde() {\n initComponents();\n }", "@SuppressWarnings(\"unchecked\")\n // <editor-fold defaultstate=\"collapsed\" desc=\"Generated Code\">//GEN-BEGIN:initComponents\n private void initComponents() {\n\n setName(\"Form\"); // NOI18N\n setRequestFocusEnabled(false);\n setVerifyInputWhenFocusTarget(false);\n\n javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this);\n this.setLayout(layout);\n layout.setHorizontalGroup(\n layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGap(0, 465, Short.MAX_VALUE)\n );\n layout.setVerticalGroup(\n layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGap(0, 357, Short.MAX_VALUE)\n );\n }", "public MusteriEkle() {\n initComponents();\n }", "public frmMain() {\n initComponents();\n }", "public frmMain() {\n initComponents();\n }", "public DESHBORDPANAL() {\n initComponents();\n }", "public GUIForm() {\n initComponents();\n inputField.setText(NO_FILE_SELECTED);\n outputField.setText(NO_FILE_SELECTED);\n progressLabel.setBackground(INFO);\n progressLabel.setText(SELECT_FILE);\n }", "public frmVenda() {\n initComponents();\n }", "public Botonera() {\n initComponents();\n }", "public FrmMenu() {\n initComponents();\n }", "public OffertoryGUI() {\n initComponents();\n setTypes();\n }", "public JFFornecedores() {\n initComponents();\n }", "@SuppressWarnings(\"unchecked\")\n // <editor-fold defaultstate=\"collapsed\" desc=\"Generated Code\">//GEN-BEGIN:initComponents\n private void initComponents()\n {\n\n setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);\n setBackground(new java.awt.Color(255, 255, 255));\n\n javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());\n getContentPane().setLayout(layout);\n layout.setHorizontalGroup(\n layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGap(0, 983, Short.MAX_VALUE)\n );\n layout.setVerticalGroup(\n layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGap(0, 769, Short.MAX_VALUE)\n );\n\n pack();\n }", "public EnterDetailsGUI() {\n initComponents();\n }", "public vpemesanan1() {\n initComponents();\n }", "public Kost() {\n initComponents();\n }", "public FormHorarioSSE() {\n initComponents();\n }", "public UploadForm() {\n initComponents();\n }", "public frmacceso() {\n initComponents();\n }", "public HW3() {\n initComponents();\n }", "public Managing_Staff_Main_Form() {\n initComponents();\n }", "@SuppressWarnings(\"unchecked\")\n // <editor-fold defaultstate=\"collapsed\" desc=\"Generated Code\">//GEN-BEGIN:initComponents\n private void initComponents()\n {\n\n setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);\n getContentPane().setLayout(null);\n\n pack();\n }", "@SuppressWarnings(\"unchecked\")\n // <editor-fold defaultstate=\"collapsed\" desc=\"Generated Code\">//GEN-BEGIN:initComponents\n private void initComponents() {\n\n setName(\"Form\"); // NOI18N\n\n javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this);\n this.setLayout(layout);\n layout.setHorizontalGroup(\n layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGap(0, 400, Short.MAX_VALUE)\n );\n layout.setVerticalGroup(\n layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGap(0, 300, Short.MAX_VALUE)\n );\n }", "public sinavlar2() {\n initComponents();\n }", "public P0405() {\n initComponents();\n }", "public IssueBookForm() {\n initComponents();\n }", "public MiFrame2() {\n initComponents();\n }", "public Choose1() {\n initComponents();\n }", "public MainForm() {\n initComponents();\n\n String oldAuthor = prefs.get(\"AUTHOR\", \"\");\n if(oldAuthor != null) {\n this.authorTextField.setText(oldAuthor);\n }\n String oldBook = prefs.get(\"BOOK\", \"\");\n if(oldBook != null) {\n this.bookTextField.setText(oldBook);\n }\n String oldDisc = prefs.get(\"DISC\", \"\");\n if(oldDisc != null) {\n try {\n int oldDiscNum = Integer.parseInt(oldDisc);\n oldDiscNum++;\n this.discNumberTextField.setText(Integer.toString(oldDiscNum));\n } catch (Exception ex) {\n this.discNumberTextField.setText(oldDisc);\n }\n this.bookTextField.setText(oldBook);\n }\n\n\n }", "public GUI_StudentInfo() {\n initComponents();\n }", "public Lihat_Dokter_Keseluruhan() {\n initComponents();\n }", "public JFrmPrincipal() {\n initComponents();\n }", "public bt526() {\n initComponents();\n }", "public Pemilihan_Dokter() {\n initComponents();\n }", "public Ablak() {\n initComponents();\n }", "@Override\n\tprotected void initUi() {\n\t\t\n\t}", "@SuppressWarnings(\"unchecked\")\n\t// <editor-fold defaultstate=\"collapsed\" desc=\"Generated\n\t// Code\">//GEN-BEGIN:initComponents\n\tprivate void initComponents() {\n\n\t\tlabel1 = new java.awt.Label();\n\t\tlabel2 = new java.awt.Label();\n\t\tlabel3 = new java.awt.Label();\n\t\tlabel4 = new java.awt.Label();\n\t\tlabel5 = new java.awt.Label();\n\t\tlabel6 = new java.awt.Label();\n\t\tlabel7 = new java.awt.Label();\n\t\tlabel8 = new java.awt.Label();\n\t\tlabel9 = new java.awt.Label();\n\t\tlabel10 = new java.awt.Label();\n\t\ttextField1 = new java.awt.TextField();\n\t\ttextField2 = new java.awt.TextField();\n\t\tlabel14 = new java.awt.Label();\n\t\tlabel15 = new java.awt.Label();\n\t\tlabel16 = new java.awt.Label();\n\t\ttextField3 = new java.awt.TextField();\n\t\ttextField4 = new java.awt.TextField();\n\t\ttextField5 = new java.awt.TextField();\n\t\tlabel17 = new java.awt.Label();\n\t\tlabel18 = new java.awt.Label();\n\t\tlabel19 = new java.awt.Label();\n\t\tlabel20 = new java.awt.Label();\n\t\tlabel21 = new java.awt.Label();\n\t\tlabel22 = new java.awt.Label();\n\t\ttextField6 = new java.awt.TextField();\n\t\ttextField7 = new java.awt.TextField();\n\t\ttextField8 = new java.awt.TextField();\n\t\tlabel23 = new java.awt.Label();\n\t\ttextField9 = new java.awt.TextField();\n\t\ttextField10 = new java.awt.TextField();\n\t\ttextField11 = new java.awt.TextField();\n\t\ttextField12 = new java.awt.TextField();\n\t\tlabel24 = new java.awt.Label();\n\t\tlabel25 = new java.awt.Label();\n\t\tlabel26 = new java.awt.Label();\n\t\tlabel27 = new java.awt.Label();\n\t\tlabel28 = new java.awt.Label();\n\t\tlabel30 = new java.awt.Label();\n\t\tlabel31 = new java.awt.Label();\n\t\tlabel32 = new java.awt.Label();\n\t\tjButton1 = new javax.swing.JButton();\n\n\t\tlabel1.setFont(new java.awt.Font(\"Segoe UI Semibold\", 0, 18)); // NOI18N\n\t\tlabel1.setText(\"It seems that some of the buttons on the ATM machine are not working!\");\n\n\t\tlabel2.setFont(new java.awt.Font(\"Segoe UI Semibold\", 0, 18)); // NOI18N\n\t\tlabel2.setText(\"Unfortunately these numbers are exactly what Professor has to use to type in his password.\");\n\n\t\tlabel3.setFont(new java.awt.Font(\"Segoe UI Semibold\", 0, 18)); // NOI18N\n\t\tlabel3.setText(\n\t\t\t\t\"If you want to eat tonight, you have to help him out and construct the numbers of the password with the working buttons and math operators.\");\n\n\t\tlabel4.setFont(new java.awt.Font(\"Segoe UI Semibold\", 0, 14)); // NOI18N\n\t\tlabel4.setText(\"Denver's Password: 2792\");\n\n\t\tlabel5.setFont(new java.awt.Font(\"Consolas\", 0, 14)); // NOI18N\n\t\tlabel5.setText(\"import java.util.Scanner;\\n\");\n\n\t\tlabel6.setFont(new java.awt.Font(\"Consolas\", 0, 14)); // NOI18N\n\t\tlabel6.setText(\"public class ATM{\");\n\n\t\tlabel7.setFont(new java.awt.Font(\"Consolas\", 0, 14)); // NOI18N\n\t\tlabel7.setText(\"public static void main(String[] args){\");\n\n\t\tlabel8.setFont(new java.awt.Font(\"Consolas\", 0, 14)); // NOI18N\n\t\tlabel8.setText(\"System.out.print(\");\n\n\t\tlabel9.setFont(new java.awt.Font(\"Dialog\", 0, 14)); // NOI18N\n\t\tlabel9.setText(\" -\");\n\n\t\tlabel10.setFont(new java.awt.Font(\"Consolas\", 0, 14)); // NOI18N\n\t\tlabel10.setText(\");\");\n\n\t\ttextField1.addActionListener(new java.awt.event.ActionListener() {\n\t\t\tpublic void actionPerformed(java.awt.event.ActionEvent evt) {\n\t\t\t\ttextField1ActionPerformed(evt);\n\t\t\t}\n\t\t});\n\n\t\tlabel14.setFont(new java.awt.Font(\"Consolas\", 0, 14)); // NOI18N\n\t\tlabel14.setText(\"System.out.print( (\");\n\n\t\tlabel15.setFont(new java.awt.Font(\"Consolas\", 0, 14)); // NOI18N\n\t\tlabel15.setText(\"System.out.print(\");\n\n\t\tlabel16.setFont(new java.awt.Font(\"Consolas\", 0, 14)); // NOI18N\n\t\tlabel16.setText(\"System.out.print( ( (\");\n\n\t\tlabel17.setFont(new java.awt.Font(\"Dialog\", 0, 14)); // NOI18N\n\t\tlabel17.setText(\")\");\n\n\t\tlabel18.setFont(new java.awt.Font(\"Dialog\", 0, 14)); // NOI18N\n\t\tlabel18.setText(\" +\");\n\n\t\tlabel19.setFont(new java.awt.Font(\"Consolas\", 0, 14)); // NOI18N\n\t\tlabel19.setText(\");\");\n\n\t\tlabel20.setFont(new java.awt.Font(\"Dialog\", 0, 14)); // NOI18N\n\t\tlabel20.setText(\" /\");\n\n\t\tlabel21.setFont(new java.awt.Font(\"Dialog\", 0, 14)); // NOI18N\n\t\tlabel21.setText(\" %\");\n\n\t\tlabel22.setFont(new java.awt.Font(\"Dialog\", 0, 14)); // NOI18N\n\t\tlabel22.setText(\" +\");\n\n\t\tlabel23.setFont(new java.awt.Font(\"Consolas\", 0, 14)); // NOI18N\n\t\tlabel23.setText(\");\");\n\n\t\tlabel24.setFont(new java.awt.Font(\"Dialog\", 0, 14)); // NOI18N\n\t\tlabel24.setText(\" +\");\n\n\t\tlabel25.setFont(new java.awt.Font(\"Dialog\", 0, 14)); // NOI18N\n\t\tlabel25.setText(\" /\");\n\n\t\tlabel26.setFont(new java.awt.Font(\"Dialog\", 0, 14)); // NOI18N\n\t\tlabel26.setText(\" *\");\n\n\t\tlabel27.setCursor(new java.awt.Cursor(java.awt.Cursor.DEFAULT_CURSOR));\n\t\tlabel27.setFont(new java.awt.Font(\"Consolas\", 0, 14)); // NOI18N\n\t\tlabel27.setText(\")\");\n\n\t\tlabel28.setFont(new java.awt.Font(\"Dialog\", 0, 14)); // NOI18N\n\t\tlabel28.setText(\")\");\n\n\t\tlabel30.setFont(new java.awt.Font(\"Consolas\", 0, 14)); // NOI18N\n\t\tlabel30.setText(\"}\");\n\n\t\tlabel31.setFont(new java.awt.Font(\"Consolas\", 0, 14)); // NOI18N\n\t\tlabel31.setText(\"}\");\n\n\t\tlabel32.setFont(new java.awt.Font(\"Consolas\", 0, 14)); // NOI18N\n\t\tlabel32.setText(\");\");\n\n\t\tjButton1.setFont(new java.awt.Font(\"Segoe UI Semibold\", 0, 14)); // NOI18N\n\t\tjButton1.setText(\"Check\");\n\t\tjButton1.addActionListener(new java.awt.event.ActionListener() {\n\t\t\tpublic void actionPerformed(java.awt.event.ActionEvent evt) {\n\t\t\t\tjButton1ActionPerformed(evt);\n\t\t\t}\n\t\t});\n\n\t\tjavax.swing.GroupLayout layout = new javax.swing.GroupLayout(this);\n\t\tlayout.setHorizontalGroup(layout.createParallelGroup(Alignment.LEADING)\n\t\t\t\t.addGroup(layout.createSequentialGroup().addGap(28).addGroup(layout\n\t\t\t\t\t\t.createParallelGroup(Alignment.LEADING).addComponent(getDoneButton()).addComponent(jButton1)\n\t\t\t\t\t\t.addComponent(label7, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t.addComponent(label6, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t.addComponent(label5, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t.addComponent(label4, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t.addComponent(label3, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t.addGroup(layout.createSequentialGroup()\n\t\t\t\t\t\t\t\t.addComponent(label1, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t.addGap(1)\n\t\t\t\t\t\t\t\t.addComponent(label2, GroupLayout.PREFERRED_SIZE, 774, GroupLayout.PREFERRED_SIZE))\n\t\t\t\t\t\t.addGroup(layout.createSequentialGroup()\n\t\t\t\t\t\t\t\t.addGap(92).addGroup(layout.createParallelGroup(Alignment.LEADING).addGroup(layout\n\t\t\t\t\t\t\t\t\t\t.createSequentialGroup()\n\t\t\t\t\t\t\t\t\t\t.addGroup(layout.createParallelGroup(Alignment.LEADING, false)\n\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout.createSequentialGroup()\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(label15, GroupLayout.PREFERRED_SIZE, 145,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addPreferredGap(ComponentPlacement.RELATED)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(textField8, GroupLayout.PREFERRED_SIZE, 20,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGap(2)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(label21, GroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addPreferredGap(ComponentPlacement.RELATED,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(textField7, GroupLayout.PREFERRED_SIZE, 20,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE))\n\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout.createSequentialGroup()\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(label8, GroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addPreferredGap(ComponentPlacement.RELATED)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(textField1, GroupLayout.PREFERRED_SIZE, 20,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addPreferredGap(ComponentPlacement.RELATED)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(label9, GroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addPreferredGap(ComponentPlacement.RELATED).addComponent(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\ttextField2, GroupLayout.PREFERRED_SIZE, 20,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE))\n\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(label31, GroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout.createSequentialGroup().addGroup(layout\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.createParallelGroup(Alignment.LEADING)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout.createSequentialGroup()\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(label14, GroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGap(37))\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout.createSequentialGroup().addGap(174)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(textField5, GroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t20, GroupLayout.PREFERRED_SIZE)))\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(label18, GroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGap(7)))\n\t\t\t\t\t\t\t\t\t\t.addPreferredGap(ComponentPlacement.RELATED)\n\t\t\t\t\t\t\t\t\t\t.addGroup(layout.createParallelGroup(Alignment.LEADING).addGroup(layout\n\t\t\t\t\t\t\t\t\t\t\t\t.createSequentialGroup()\n\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.createParallelGroup(Alignment.TRAILING, false).addGroup(layout\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.createSequentialGroup()\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(textField4, GroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t20, GroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addPreferredGap(ComponentPlacement.RELATED,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(label17, GroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE))\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout.createSequentialGroup()\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(label22, GroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addPreferredGap(ComponentPlacement.RELATED)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(textField9, GroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t20, GroupLayout.PREFERRED_SIZE)))\n\t\t\t\t\t\t\t\t\t\t\t\t.addGap(20)\n\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout.createParallelGroup(Alignment.TRAILING)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(label23, GroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout.createSequentialGroup()\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(label20, GroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addPreferredGap(ComponentPlacement.RELATED)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(textField3, GroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t20, GroupLayout.PREFERRED_SIZE)))\n\t\t\t\t\t\t\t\t\t\t\t\t.addGap(20).addComponent(label19, GroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE))\n\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout.createSequentialGroup().addGap(23).addComponent(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tlabel10, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE))))\n\t\t\t\t\t\t\t\t\t\t.addGroup(layout.createSequentialGroup()\n\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(label16, GroupLayout.PREFERRED_SIZE, 177,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t.addPreferredGap(ComponentPlacement.RELATED)\n\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(textField12, GroupLayout.PREFERRED_SIZE, 20,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t.addPreferredGap(ComponentPlacement.RELATED)\n\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(label24, GroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t.addPreferredGap(ComponentPlacement.RELATED)\n\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(textField6, GroupLayout.PREFERRED_SIZE, 20,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t.addPreferredGap(ComponentPlacement.RELATED)\n\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(label27, GroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t.addPreferredGap(ComponentPlacement.RELATED)\n\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(label25, GroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t.addPreferredGap(ComponentPlacement.RELATED)\n\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(textField11, GroupLayout.PREFERRED_SIZE, 20,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t.addPreferredGap(ComponentPlacement.RELATED)\n\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(label28, GroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t.addGap(1)\n\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(label26, GroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t.addPreferredGap(ComponentPlacement.RELATED)\n\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(textField10, GroupLayout.PREFERRED_SIZE, 20,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t.addPreferredGap(ComponentPlacement.RELATED).addComponent(label32,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE))))\n\t\t\t\t\t\t.addComponent(label30, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE))\n\t\t\t\t\t\t.addContainerGap(GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)));\n\t\tlayout.setVerticalGroup(\n\t\t\t\tlayout.createParallelGroup(Alignment.LEADING).addGroup(layout.createSequentialGroup().addContainerGap()\n\t\t\t\t\t\t.addGroup(layout.createParallelGroup(Alignment.TRAILING)\n\t\t\t\t\t\t\t\t.addComponent(label1, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t.addComponent(label2, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE))\n\t\t\t\t\t\t.addGap(1)\n\t\t\t\t\t\t.addComponent(label3, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t.addPreferredGap(ComponentPlacement.RELATED)\n\t\t\t\t\t\t.addComponent(label4, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t.addPreferredGap(ComponentPlacement.RELATED)\n\t\t\t\t\t\t.addComponent(label5, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t.addPreferredGap(ComponentPlacement.RELATED)\n\t\t\t\t\t\t.addComponent(label6, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t.addPreferredGap(ComponentPlacement.RELATED)\n\t\t\t\t\t\t.addComponent(label7, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t.addPreferredGap(ComponentPlacement.RELATED)\n\t\t\t\t\t\t.addGroup(layout\n\t\t\t\t\t\t\t\t.createParallelGroup(\n\t\t\t\t\t\t\t\t\t\tAlignment.TRAILING)\n\t\t\t\t\t\t\t\t.addGroup(\n\t\t\t\t\t\t\t\t\t\tlayout.createSequentialGroup().addGroup(layout.createParallelGroup(\n\t\t\t\t\t\t\t\t\t\t\t\tAlignment.TRAILING)\n\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.createSequentialGroup().addGroup(layout\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.createParallelGroup(Alignment.TRAILING).addGroup(layout\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.createParallelGroup(Alignment.LEADING)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(label9,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.createParallelGroup(Alignment.TRAILING)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(label8,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(textField1,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE))\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\ttextField2, GroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE))\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout.createSequentialGroup()\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(label10,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGap(3)))\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGap(19)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout.createParallelGroup(Alignment.TRAILING)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout.createParallelGroup(Alignment.LEADING)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(textField5,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(label14,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE))\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout.createSequentialGroup().addGroup(layout\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.createParallelGroup(Alignment.LEADING)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(label18,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.createParallelGroup(Alignment.TRAILING)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(label17,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(textField4,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)))\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGap(1))))\n\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(label20, GroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout.createParallelGroup(Alignment.LEADING)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(label19, GroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(textField3, GroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)))\n\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout.createParallelGroup(Alignment.LEADING)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout.createSequentialGroup().addGap(78)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(label27, GroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE))\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout.createSequentialGroup().addGap(76)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(textField11, GroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE))\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout.createSequentialGroup().addGap(75)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout.createParallelGroup(Alignment.TRAILING)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(label32,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(textField10,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)))\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout.createSequentialGroup()\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addPreferredGap(ComponentPlacement.RELATED, 20,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tShort.MAX_VALUE)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.createParallelGroup(Alignment.TRAILING, false)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout.createSequentialGroup()\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.createParallelGroup(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tAlignment.TRAILING)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(label15,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(textField8,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(label21,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(textField7,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE))\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGap(27))\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout.createSequentialGroup()\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.createParallelGroup(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tAlignment.TRAILING)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(textField9,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.createParallelGroup(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tAlignment.LEADING)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(label22,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tlayout.createSequentialGroup()\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGap(3)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tlabel23,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE))))\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGap(29)))\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout.createParallelGroup(Alignment.TRAILING)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.createParallelGroup(Alignment.LEADING)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(label16,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(textField12,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE))\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout.createSequentialGroup()\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.createParallelGroup(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tAlignment.TRAILING)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(label24,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(textField6,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE))\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGap(1))))))\n\t\t\t\t\t\t\t\t.addGroup(layout.createParallelGroup(Alignment.LEADING)\n\t\t\t\t\t\t\t\t\t\t.addComponent(label25, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t.addComponent(label28, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t.addComponent(label26, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)))\n\t\t\t\t\t\t.addGap(30)\n\t\t\t\t\t\t.addComponent(label31, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t.addGap(25)\n\t\t\t\t\t\t.addComponent(label30, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t.addGap(26).addComponent(jButton1).addPreferredGap(ComponentPlacement.RELATED)\n\t\t\t\t\t\t.addComponent(getDoneButton()).addContainerGap(23, Short.MAX_VALUE)));\n\t\tthis.setLayout(layout);\n\n\t\tlabel16.getAccessibleContext().setAccessibleName(\"System.out.print( ( (\");\n\t\tlabel17.getAccessibleContext().setAccessibleName(\"\");\n\t\tlabel18.getAccessibleContext().setAccessibleName(\" +\");\n\t}", "public Pregunta23() {\n initComponents();\n }", "public FormMenuUser() {\n super(\"Form Menu User\");\n initComponents();\n }", "public AvtekOkno() {\n initComponents();\n }", "public busdet() {\n initComponents();\n }", "public ViewPrescriptionForm() {\n initComponents();\n }", "public Ventaform() {\n initComponents();\n }", "public Kuis2() {\n initComponents();\n }", "public CreateAccount_GUI() {\n initComponents();\n }", "public POS1() {\n initComponents();\n }", "public Carrera() {\n initComponents();\n }", "public EqGUI() {\n initComponents();\n }", "public JFriau() {\n initComponents();\n this.setLocationRelativeTo(null);\n this.setTitle(\"BuNus - Budaya Nusantara\");\n }", "@SuppressWarnings(\"unchecked\")\n // <editor-fold defaultstate=\"collapsed\" desc=\"Generated Code\">//GEN-BEGIN:initComponents\n private void initComponents() {\n\n setBackground(new java.awt.Color(204, 204, 204));\n setMinimumSize(new java.awt.Dimension(1, 1));\n setPreferredSize(new java.awt.Dimension(760, 402));\n\n javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this);\n this.setLayout(layout);\n layout.setHorizontalGroup(\n layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGap(0, 750, Short.MAX_VALUE)\n );\n layout.setVerticalGroup(\n layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGap(0, 400, Short.MAX_VALUE)\n );\n }", "public nokno() {\n initComponents();\n }", "public dokter() {\n initComponents();\n }", "public ConverterGUI() {\n initComponents();\n }", "public hitungan() {\n initComponents();\n }", "public Modify() {\n initComponents();\n }", "public frmAddIncidencias() {\n initComponents();\n }", "public FP_Calculator_GUI() {\n initComponents();\n \n setVisible(true);\n }" ]
[ "0.73191476", "0.72906625", "0.72906625", "0.72906625", "0.72860986", "0.7248112", "0.7213479", "0.72078276", "0.7195841", "0.71899796", "0.71840525", "0.7158498", "0.71477973", "0.7092748", "0.70800966", "0.70558053", "0.69871384", "0.69773406", "0.69548076", "0.69533914", "0.6944929", "0.6942576", "0.69355655", "0.6931378", "0.6927896", "0.69248974", "0.6924723", "0.69116884", "0.6910487", "0.6892381", "0.68921053", "0.6890637", "0.68896896", "0.68881863", "0.68826133", "0.68815064", "0.6881078", "0.68771756", "0.6875212", "0.68744373", "0.68711984", "0.6858978", "0.68558776", "0.6855172", "0.6854685", "0.685434", "0.68525875", "0.6851834", "0.6851834", "0.684266", "0.6836586", "0.6836431", "0.6828333", "0.68276715", "0.68262815", "0.6823921", "0.682295", "0.68167603", "0.68164384", "0.6809564", "0.68086857", "0.6807804", "0.6807734", "0.68067646", "0.6802192", "0.67943805", "0.67934304", "0.6791657", "0.6789546", "0.6789006", "0.67878324", "0.67877173", "0.6781847", "0.6765398", "0.6765197", "0.6764246", "0.6756036", "0.6755023", "0.6751404", "0.67508715", "0.6743043", "0.67387456", "0.6736752", "0.67356426", "0.6732893", "0.6726715", "0.6726464", "0.67196447", "0.67157453", "0.6714399", "0.67140275", "0.6708251", "0.6707117", "0.670393", "0.6700697", "0.66995865", "0.66989213", "0.6697588", "0.66939527", "0.66908985", "0.668935" ]
0.0
-1
When the toggle button is clicked, this code executes.
private void switchBtnActionPerformed(ActionEvent evt) { if(switchBtn.isSelected()) { switchBtn.setText("MIPS -> C"); switchBtnState = 1; } else { switchBtn.setText("C -> MIPS"); switchBtnState = -1; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\n public void Toggle() {\n\t \n }", "protected void execute() { \t\n// \tboolean toggle=true;\n// \tboolean grab = false;\n// \tif(toggle&&button.get()) {//execute once per button push\n// \t\ttoggle=false;//prevents code from being called again until button is released and pressed again\n// \t\tif(grab){\n// \t\t\tgrab=false;\n// \t\t\tclaw.open();\n// \t\t}else {\n// \t\t\tgrab=true;\n// \t\t\tclaw.close();\n// \t\t}\n// \t}else if(!button.get()) {\n// \t\ttoggle=true;//button has been released\n// \t}\n \tclaw.open();\n }", "public void click() {\n\t\tif(toggles) {\n\t\t\tvalue = (value == 0) ? 1 : 0;\t// flip toggle value\n\t\t}\n\t\tupdateStore();\n\t\tif(delegate != null) delegate.uiButtonClicked(this);\t// deprecated\n\t}", "public void actionPerformed(ActionEvent e) {\n\t\t\t\ttoggle = 1;\r\n\t\t\t\ttoggle(toggle);\r\n\t\t\t}", "void toggleButton_actionPerformed(ActionEvent e) {\n this.togglePlot();\n }", "public void actionPerformed(ActionEvent e) {\n\t\t\t\ttoggle = 2;\r\n\t\t\t\ttoggle(toggle);\r\n\t\t\t}", "public void actionPerformed(ActionEvent e) {\n\t\t\t\ttoggle = 3;\r\n\t\t\t\ttoggle(toggle);\r\n\t\t\t}", "void toggle();", "public void toggle(){\n isOn = !isOn;\n }", "public void onToggleClicked(View view) {\n boolean on = ((ToggleButton) view).isChecked();\n BackgroundDataBaseTasks tempTask = new BackgroundDataBaseTasks(this);\n points.clear();\n\n if (on) {\n leaderboardType.setText(\"Global Leaderboard\");\n String method = \"friend\";\n try {\n tempTask.delegate = this;\n tempTask.execute(method, \"\").get();\n } catch (Exception e) {\n e.printStackTrace();\n }\n } else {\n leaderboardType.setText(\"Friends Leaderboard\");\n String method = \"friend\";\n try {\n tempTask.delegate = this;\n tempTask.execute(method, friendSQL).get();\n } catch (Exception e) {\n e.printStackTrace();\n }\n }\n }", "@Override\r\n\tpublic void handle(ActionEvent event) {\r\n\t\tString command = ((ToggleButton) event.getSource()).getText();\r\n\t\tthis.view.getPaintPanel().setMode(command);\r\n\t\t\r\n\t}", "public void onToggleClicked(View view) {\n boolean on = ((ToggleButton) view).isChecked();\n if (on) {\n if (!BA.isEnabled()) {\n Intent turnOn = new Intent(BluetoothAdapter.ACTION_REQUEST_ENABLE);\n startActivityForResult(turnOn, 0);\n Toast.makeText(getApplicationContext(), \"Turned on\", Toast.LENGTH_LONG).show();\n } else {\n Toast.makeText(getApplicationContext(), \"Already on\", Toast.LENGTH_LONG).show();\n }\n } else {\n BA.disable();\n Toast.makeText(getApplicationContext(), \"Turned off\", Toast.LENGTH_LONG).show();\n }\n }", "public abstract void toggle();", "@Override\n public boolean onClick(View view) {\n updateToggle(view, !mChecked);\n// updateText(view); // automatically\n return true;\n }", "@FXML\n public void toggle(ActionEvent actionEvent) {\n if (isToggled) {\n cardText.setText(current.getQuestion());\n isToggled = false;\n } else {\n cardText.setText(current.getAnswer());\n isToggled = true;\n }\n }", "public void toggleStoreButton()\r\n {\r\n Message message = new Message();\r\n message.what = GUIManager.TOGGLE_STORE_BUTTON;\r\n mGUIManager.sendThreadSafeGUIMessage(message);\r\n }", "@Override\n\t\t\tpublic void onClick(View view) {\n\t\t\t\tLog.e(TAG, \"toggle onClick enter \");\n\t\t\t\tupdateSurface();\n\t\t\t}", "void onSwitched(ToggleableView toggleableView, boolean isOn);", "public void buttonClick() {\n if (soundToggle == true) {\n buttonClick.start();\n } // if\n }", "public void toggle() {\n if (isOn()) {\n turnOff();\n } else {\n turnOn();\n }\n }", "@Override\n\tpublic void onToggled() {\n\t\tmc.ingameGUI.addChatMessage(\"gui toggled\");\n\t\tmc.displayGuiScreen(Mystic.getGui());\n\t}", "public void onToggleClicked(View view) {\n\t boolean on = ((ToggleButton) view).isChecked();\n\t \n\t if (on) {\n\t // Enable vibrate\n\t } else {\n\t // Disable vibrate\n\t }\n\t}", "public void toggle(){\r\n isDown = !isDown;\r\n }", "@Override\r\n\t\t\t public void onClick(View v) {\n\t\t\t\t bFlagZhaopin = !bFlagZhaopin;\r\n\t\t\t\t zhaopin_btn.setChecked(bFlagZhaopin);\r\n\t\t\t }", "@Override\n\t\tpublic void onClick(View arg0) {\n\t\t\tif(sw.isChecked())\n\t\t\t{\n\t\t\t\tpartybool=true;\n\t\t\t\tDnDlevel=2;\n\t\t\t\tToast.makeText(con,\"\"+DnDlevel+\" \"+partybool,Toast.LENGTH_LONG).show();\n\t\t\t\tsb.setProgress(100);\n\t\t\t}\n\t\t}", "public void setupToggleButtons(){\n\t\ttoggle_textContacts.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {\n\t\t public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {\n\t\t if (isChecked) {\n\t\t // The toggle is enabled\n\t\t\t if(prefsHandler.getSettings().getIsFirstTextContacts())\n\t\t\t {\n\t\t\t \tshowTextContactsTutorialDialog();\n\t\t\t }\n\t\t\t \n\t\t \tLinearLayout.LayoutParams layout_desc = new LinearLayout.LayoutParams(LinearLayout.LayoutParams.MATCH_PARENT, LinearLayout.LayoutParams.WRAP_CONTENT);\n\t\t textContactsSmallFrame.setLayoutParams(layout_desc);\n\t\t } else {\n\t\t \t// resize the frame to just show the top button\n\t\t \tLinearLayout.LayoutParams layout_desc = new LinearLayout.LayoutParams(0, 0);\n\t\t textContactsSmallFrame.setLayoutParams(layout_desc);\n\t\t }\n\t\t }\n\t\t});\n\t\t\n\t\ttoggle_NFRadio.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {\n\t\t public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {\n\t\t if (!isChecked) {\n\t\t // The toggle is disabled\n\t\t\t if(prefsHandler.getSettings().getIsFirstMusic())\n\t\t\t {\n\t\t\t \tshowMusicTutorialDialog();\n\t\t\t }\n\t\t \t// resize the frame to just show the top button\n\t\t \tLinearLayout.LayoutParams layout_desc = new LinearLayout.LayoutParams(LinearLayout.LayoutParams.MATCH_PARENT, LinearLayout.LayoutParams.WRAP_CONTENT);\n\t\t NFRadioSmallFrame.setLayoutParams(layout_desc);\n\t\t } else {\n\t\t \t// the toggle is enabled\n\t\t\t if(prefsHandler.getSettings().getIsFirstNewsFeed())\n\t\t\t {\n\t\t\t \tshowNewsTutorialDialog();\n\t\t\t }\n\t\t\t \n\t\t \tLinearLayout.LayoutParams layout_desc = new LinearLayout.LayoutParams(0, 0);\n\t\t NFRadioSmallFrame.setLayoutParams(layout_desc);\n\t\t }\n\t\t }\n\t\t});\n\t\t\n\t\ttoggle_ShakeToWake.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {\n\t\t public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {\n\t\t \tif(isChecked&&prefsHandler.getSettings().getIsFirstShakeToWake())\n\t\t {\n\t\t \t\tshowShakeTutorialDialog();\n\t\t }\n\t\t }\n\t\t});\n\t}", "@Override\n public void toggle() {\n checkBox.toggle();\n }", "@Override\n public void onCheckedChanged(CompoundButton toggleButton, boolean isChecked) {\n if (!isChecked) {\n viewHolder.state_endpoint_in_scene_text_view.setText(context.getResources().getString(R.string.label_off));\n state[0] = 0;\n } else {\n viewHolder.state_endpoint_in_scene_text_view.setText(context.getResources().getString(R.string.label_on));\n state[0] = 255;\n }\n // If the values are modified while the user does not check/unckeck the checkbox, then we update the value from the controller.\n int exist = mode.getPayload().indexOf(c);\n if (exist != -1) {\n mode.getPayload().get(exist).setV(state[0]);\n }\n }", "public void toggle() {\n toggle(false);\n }", "void toggled(ToggledEvent event);", "public /* synthetic */ void lambda$handleClick$0() {\n boolean z = ((QSTile.BooleanState) this.mState).value;\n this.mHost.openPanels();\n this.mController.setLocationEnabled(!z);\n }", "public void settingBtnClick() {\n\t}", "@Override\r\n\t\t\tpublic void run() {\n\t\t\t\tif(null!=RecordActionToggle){\r\n\t\t\t\t\tRecordActionToggle.setEnabled(true);\r\n\t\t\t\t\tRecordActionToggle.getBackground().setAlpha(255);\r\n\t\t\t\t\tLog.e(\"RecordActivity\", \"RecordActivity = true\");\r\n\t\t\t\t}\r\n\t\t\t\tLog.e(\"RecordActivity\", \"RecordActivity\");\r\n\t\t\t}", "public void toggleEnable();", "public void onToggleClicked(View view) {\n\t boolean on = ((ToggleButton) view).isChecked();\n\t \n\t if (on) {\n\t \tairlineList.setVisibility(View.INVISIBLE);\n\t airportsList.setVisibility(View.VISIBLE);\n\t } else {\n\t airlineList.setVisibility(View.VISIBLE);\n\t airportsList.setVisibility(View.INVISIBLE);\n\t \n\t }\n\t}", "@Override\r\n\t\t\t public void onClick(View v) {\n\t\t\t\t bFlagHehuo = !bFlagHehuo;\r\n\t\t\t\t hehuo_btn.setChecked(bFlagHehuo);\r\n\t\t\t }", "public void toggleSwitch() {\r\n if (this.radioToggleGroup.getSelectedToggle().equals(this.inHouseRadio)) {\r\n machineOrCompanyLabel.setText(\"Machine ID\");\r\n inHouseSelected = true;\r\n } else {\r\n machineOrCompanyLabel.setText(\"Company Name\");\r\n inHouseSelected = false;\r\n }\r\n }", "protected void toggleStateChanged() \r\n\t{\r\n\t\tgetSoccerMaster().setShowBallCoord( isToggledOn() );\r\n\t}", "@Override\r\n\tpublic int ToggleDown() {\n\t\treturn 0;\r\n\t}", "@Override\n public void onMenuToggle(boolean b) {\n }", "public void onClick(View v) {\n is_enabled=!is_enabled;\n if(!is_enabled){\n textView_current_Status.setText(R.string.switcher_is_being_enabled_please_wait);\n //sayHello();\n Set_Switch_On();\n }else{\n textView_current_Status.setText(R.string.switcher_is_currently_disabled);\n Set_Switch_Off();\n }\n }", "@FXML public void handleToggleButtons() {\n\t\t\n\t\t// binarySplitButton\n\t\tif (binarySplitButton.isSelected()) {\n\t\t\tbinarySplitButton.setText(\"True\");\n\t\t} else {\n\t\t\tbinarySplitButton.setText(\"False\");\n\t\t}\n\t\t\n\t\t// collapseTreeButton\n\t\tif (collapseTreeButton.isSelected()) {\n\t\t\tcollapseTreeButton.setText(\"True\");\n\t\t} else {\n\t\t\tcollapseTreeButton.setText(\"False\");\n\t\t}\n\t\t\n\t\t// debugButton\n\t\tif (debugButton.isSelected()) {\n\t\t\tdebugButton.setText(\"True\");\n\t\t} else {\n\t\t\tdebugButton.setText(\"False\");\n\t\t}\n\t\t\n\t\t// doNotCheckCapabilitiesButton\n\t\tif (doNotCheckCapabilitiesButton.isSelected()) {\n\t\t\tdoNotCheckCapabilitiesButton.setText(\"True\");\n\t\t} else {\n\t\t\tdoNotCheckCapabilitiesButton.setText(\"False\");\n\t\t}\n\t\t\n\t\t// doNotMakeSplitPAVButton\n\t\tif (doNotMakeSplitPAVButton.isSelected()) {\n\t\t\tdoNotMakeSplitPAVButton.setText(\"True\");\n\t\t} else {\n\t\t\tdoNotMakeSplitPAVButton.setText(\"False\");\n\t\t}\n\t\t\n\t\t// reduceErrorPruningButton\n\t\tif (reduceErrorPruningButton.isSelected()) {\n\t\t\treduceErrorPruningButton.setText(\"True\");\n\t\t} else {\n\t\t\treduceErrorPruningButton.setText(\"False\");\n\t\t}\n\t\t\n\t\t// saveInstanceDataButton\n\t\tif (saveInstanceDataButton.isSelected()) {\n\t\t\tsaveInstanceDataButton.setText(\"True\");\n\t\t} else {\n\t\t\tsaveInstanceDataButton.setText(\"False\");\n\t\t}\n\t\t\n\t\t// subTreeRaisingButton\n\t\tif (subTreeRaisingButton.isSelected()) {\n\t\t\tsubTreeRaisingButton.setText(\"True\");\n\t\t} else {\n\t\t\tsubTreeRaisingButton.setText(\"False\");\n\t\t}\n\t\t\n\t\t// unprunedButton\n\t\tif (unprunedButton.isSelected()) {\n\t\t\tunprunedButton.setText(\"True\");\n\t\t} else {\n\t\t\tunprunedButton.setText(\"False\");\n\t\t}\n\t\t\n\t\t// useLaplaceButton\n\t\tif (useLaplaceButton.isSelected()) {\n\t\t\tuseLaplaceButton.setText(\"True\");\n\t\t} else {\n\t\t\tuseLaplaceButton.setText(\"False\");\n\t\t}\n\t\t\n\t\t// useMDLcorrectionButton\n\t\tif (useMDLcorrectionButton.isSelected()) {\n\t\t\tuseMDLcorrectionButton.setText(\"True\");\n\t\t} else {\n\t\t\tuseMDLcorrectionButton.setText(\"False\");\n\t\t}\n\t\t\n\t}", "public void switchOn();", "public void gridClick() {\n gridToggle = !gridToggle;\n draw();\n }", "public void toggle()\n\t{\n\t\tsetVisible(!this.isShowing());\n\t}", "@Override\n public void actionPerformed(ActionEvent e) {\n \tapp.toggleLightMode();\n \tisDark = !isDark;\n }", "@Override\n public void onClick(View v) {\n if (((ToggleButton) v).isChecked()) {\n ExpandAnimation animation = new ExpandAnimation(mailbox_setting_detail_layout, 250);\n mailbox_setting_detail_layout.startAnimation(animation);\n } else {\n ExpandAnimation animation = new ExpandAnimation(mailbox_setting_detail_layout, 250);\n mailbox_setting_detail_layout.startAnimation(animation);\n }\n }", "public void toggle() { this.isOpen = !this.isOpen; }", "@Override\n\tpublic void onClick(View v) {\n\t\tint id = v.getId();\n\n\t\tif (id == R.id.toggleButton) {\n\t\t\tif (toggleButton.isChecked()) {\n\t\t\t\tflashLightOn();\n\t\t\t\ttoggleButton.setTextColor(Color.GREEN);\n\t\t\t} else {\n\t\t\t\tflashLightOff();\n\t\t\t\ttoggleButton.setTextColor(Color.GRAY);\n\n\t\t\t}\n\t\t}\n\t}", "public void onStatusClicked(View view){\n Log.i(TAG, \"-- ON STATUS CLICKED --\");\n ToggleButton tb = (ToggleButton) view;\n\n //let setStatus change the check status instead\n tb.setChecked(false);\n\n if(!tb.isChecked()){\n Log.i(TAG, \"-- ON STATUS CHECKED --\");\n // Launch the DeviceListActivity to see devices and do scan\n Intent serverIntent = new Intent(this, DeviceListActivity.class);\n startActivityForResult(serverIntent, REQUEST_CONNECT_DEVICE_INSECURE);\n }\n else{\n Log.i(TAG, \"-- ON STATUS UNCHECKED --\");\n }\n\n }", "public void toggle() {\n setChecked(!checked);\n }", "private void setUpToggleButton()\n {\n rememberLoginToggle_ =\n (ToggleButton) findViewById( R.id.rememberLoginToggleButton );\n try\n {\n if ( properties_.containsKey( getString( R.string.saveInfo ) ) )\n {\n rememberLoginIsSet_ =\n Boolean.parseBoolean( (properties_\n .get( getString( R.string.saveInfo ) ))\n .toString() );\n }\n else\n {\n rememberLoginIsSet_ = true;\n }\n }\n catch ( Exception ex )\n {\n System.err.print( \"Error converting to boolean: \" + ex );\n }\n\n rememberLoginToggle_.setChecked( rememberLoginIsSet_ );\n\n rememberLoginToggle_.setOnClickListener( new View.OnClickListener()\n {\n // Toggle the button on click\n @Override\n public void onClick( View v )\n {\n rememberLoginIsSet_ = !rememberLoginIsSet_;\n }\n } );\n }", "@Override\n public void onClick(View v) {\n if (((ToggleButton) v).isChecked()) {\n ExpandAnimation animation = new ExpandAnimation(ll_setmail, 250);\n ll_setmail.startAnimation(animation);\n } else {\n ExpandAnimation animation = new ExpandAnimation(ll_setmail, 250);\n ll_setmail.startAnimation(animation);\n }\n }", "@Override\n\t\t\tpublic void onClick(View v) {\n\t\t\t\tsiv_update.changeSwitchStatus();\n\t\t\t\tEditor editor = sharedPreferences.edit();\n\t\t\t\teditor.putBoolean(MobileGuard.APP_AUTO_UPDATE,\n\t\t\t\t\t\tsiv_update.getSwitchStatus());\n\t\t\t\teditor.commit();\n\t\t\t}", "@Override\n\tpublic void toggle() {\n\t\tsetChecked(!checked);\n\t}", "public void setToggle(boolean value) {\n getElement().setToggle(value);\n }", "public void turnOn() {\n\t\tisOn = true;\n\t}", "@Override\n public void toggle(boolean active) {\n }", "@Override\r\n\t\t\t public void onClick(View v) {\n\t\t\t\t bFlagLianxiren = !bFlagLianxiren;\r\n\t\t\t\t lianxiren_btn.setChecked(bFlagLianxiren);\r\n\t\t\t }", "public static void onSwitch() {\n if (switchPanels) {\n //Insert Finanzpanel\n switchPanel.removeAll();\n PaFinance f = new PaFinance();\n switchPanel.add(f);\n switchPanel.updateUI();\n switchPanels = false;\n } else {\n //insert ActionPanel\n switchPanel.removeAll();\n switchPanel.add(paArticle);\n switchPanel.updateUI();\n switchPanels = true;\n //btnSwitch.setEnabled(false);\n }\n }", "public void actionPerformed(ActionEvent e) {\n String action = e.getActionCommand();\n \n System.out.println(action);\n if (action.equals(\"Grid\")) {\n JToggleButton button = (JToggleButton)e.getSource();\n showGrid = button.isSelected();\n frame.repaint();\n }\n }", "@Override\n public void onCheckedChanged(CompoundButton compoundButton, boolean b) {\n if (b){ //switch is ON\n reminderLayout.setVisibility(View.VISIBLE); //show the reminder\n }\n else{ //switch is OFF\n reminderLayout.setVisibility(GONE); //remove the reminder\n }\n hasReminder = b; //set the reminder state to be saved\n }", "@Override\n\t public void onClick(View v) {\n\t \teditor.putInt(\"buttonLabel\", 4);\n\t \t\teditor.commit();\n\t \tif(powerSwitch.isChecked() && nCurrentSpeed > drivingSpeed){\n\t \t\twarning();\n\t \t}\n\t \telse\n\t \t\tlaunchContact();\n\t }", "@Override\n public void onClick(View v) {\n boolean checked = ((Switch)v).isChecked();\n if(checked){\n // when the switch is checked send the state 1 and value of progress to the server\n light_value=\"1\";\n SetData(MainActivity.URL+\"/mobile/set.php?token=\"+token,\"24\",light_value, String.valueOf(seekBar_light_bedroom2.getProgress()));\n }else {\n // when the switch is unchecked send the state 0 and value of progress to the server\n light_value=\"0\";\n SetData(MainActivity.URL+\"/mobile/set.php?token=\"+token,\"24\",light_value, String.valueOf(seekBar_light_bedroom2.getProgress()));\n }\n }", "@Override\n\t\t\tpublic void actionPerformed(ActionEvent e) {\n\t\t\t\tlightOn = !lightOn;\n\t\t\t\tactiveLightSource(lightOn);\n\t\t\t\tlightButton.setLabel(lightOn ? \"Light off\" : \"Light On\");\n\t\t\t}", "public void settingsClick(View view)\r\n {\r\n Intent intent=new Intent(MainActivity.this, SettingsActivity.class);\r\n intent.putExtra(\"toggleButton\" , true);\r\n startActivity(intent);\r\n }", "void notifySpyModeToggle();", "@FXML\n\tpublic void onWaveformClick(MouseEvent e) {\n\t\t// Get the button object of the current instrument\n\t\tToggleButton waveform = (ToggleButton)e.getSource();\n\n\t\t//Instantiate an empty toggle button\n\t\tToggleButton oldWaveform = null;\n\n\t\t//Switch conditional for the current instruments waveform\n\t\t//Sets the oldWaveform toggle button based on the waveformID\n\t\tswitch(synth.getSelectedInstrument().getWaveformId()) {\n\t\tcase Instrument.SINE_WAVE:\n\t\t\toldWaveform = sineButton;\n\t\t\tbreak;\n\t\tcase Instrument.SQUARE_WAVE:\n\t\t\toldWaveform = squareButton;\n\t\t\tbreak;\n\t\tcase Instrument.TRIANGLE_WAVE:\n\t\t\toldWaveform = triangleButton;\n\t\t\tbreak;\n\t\tcase Instrument.SAW_WAVE:\n\t\t\toldWaveform = sawButton;\n\t\t\tbreak;\n\t\t}\n\n\t\t//Conditional to prevent action from being added for certain cases\n\t\tif(oldWaveform != null && !oldWaveform.equals(waveform)) {\n\t\t\ttry {\n\t\t\t\t//Add the action\n\t\t\t\tactionLog.AddAction(\n\t\t\t\t\t\toldWaveform,\n\t\t\t\t\t\twaveform,\n\t\t\t\t\t\twaveformGroup,\n\t\t\t\t\t\twaveformGroup.getClass().getMethod(\"selectToggle\", Toggle.class),\n\t\t\t\t\t\tthis.getClass().getMethod(\"changeWaveform\", Toggle.class));\n\t\t\t} catch (NoSuchMethodException | SecurityException e1) {\n\t\t\t\tSystem.out.println(\"An unexpected error has occured.\");\n\t\t\t\te1.printStackTrace();\n\t\t\t}\n\t\t}\n\n\t\t//Change the wave form\n\t\tchangeWaveform(waveform);\n\t}", "public boolean toggle() {\r\n // forward\r\n getToggleButton().doClick();\r\n // return toggle state\r\n return isExpanded();\r\n }", "public void clickYes ();", "@Override\n public void actionPerformed(ActionEvent e) {\n Main.switchViews();\n }", "public void handle(TogglesEvent event)\n\tthrows Exception;", "@Override\r\n\t\tpublic void onClick(View arg0) {\n\t\t\tif(!CanSettings.this.IsConnected())\r\n\t\t\t{\r\n\t\t\t\tCanSettings.this.PleaseDoConnection();\r\n\t\t\t\tCanSettings.this.m_SpyOnOff.setChecked(false);\r\n\t\t\t\treturn ;\r\n\t\t\t}\r\n\t\t\tif (CanSettings.this.m_SpyOnOff.isChecked())\r\n\t\t\t{\r\n\t\t\t\tCanSettings.this.SpyOn();\r\n\t\t\t\treturn ;\r\n\t\t\t}\r\n\t\t\tCanSettings.this.SpyOff();\r\n\t\t}", "public void toggleButton(){\r\n\t\tImageIcon xImage = new ImageIcon(\"image/x.png\");\t//Inserting image to the button\r\n\t\tImageIcon oImage = new ImageIcon(\"image/o.png\");\t//Inserting image to the button\r\n\t\tfor(int i=0;i<3;i++){\t\t\t\t\t//Update the buttons' text base on array of state\r\n\t\t\tfor(int j=0;j<3;j++){\r\n\t\t\t\t this.b[i][j].setIcon(Exer10.state[i][j]==1?xImage:(Exer10.state[i][j]==2?oImage:null));\r\n\t\t\t}\r\n\t\t}\r\n\t}", "public void click() {\n\t\tSystem.out.println(\"LinuxButton Click\");\r\n\t}", "public void onClick(View v) {\n\t if(toggle.isChecked())\n\t {\n\t Toast.makeText(getApplicationContext(), \"Email Confirmation Enabled\",\n\t \t\t Toast.LENGTH_SHORT).show();\n\t emailCheckedBool = true;\n\t\t \t\n\t }\n\t else\n\t {\n\t Toast.makeText(getApplicationContext(), \"Email Confirmation Disabled\",\n\t \t\t Toast.LENGTH_SHORT).show();\n\t emailCheckedBool = false;\n\t }\n\t }", "public void setClicked(){\n\t\tclicked=true;\n\t}", "public void toggle() {\n if (isExpanded()) {\n collapse();\n } else {\n expand();\n }\n }", "@Override\n\t\t\t\tpublic void onClick(View v) {\n\t\t\t\t\tloadmsg();\n\t\t\t\t\tsm.toggle();\n\t\t\t\t\t\n\t\t\t\t}", "@Override\n public void actionPerformed(ActionEvent e) {\n app.toggleDarkMode();\n isDark = !isDark;\n }", "@Override\r\n\t\t\tpublic void onClick(View arg0) {\n\t\t\t\tmenu.toggle();\r\n\t\t\t}", "@Override\n\t\t\tpublic void onSwitchChange(TagButton tagButton, boolean isChecked) {\n\t\t\t\tif (isChecked)\n\t\t\t\t{\n\t\t\t\t\tToast.makeText(Test.this, \"开\", Toast.LENGTH_SHORT).show();\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\t{\n\t\t\t\t\t\tToast.makeText(Test.this, \"关\", Toast.LENGTH_SHORT).show();\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}", "@Override\r\n public void turnOn(){\r\n isOn = true;\r\n Reporter.report(this, Reporter.Msg.SWITCHING_ON);\r\n if (isOn){\r\n engageLoads();\r\n }\r\n }", "@Override\n public void onClick(View view) {\n mPb.setVisibility(ProgressBar.VISIBLE);\n // set Start to on in Firebase\n DatabaseReference startRef = FirebaseDatabase.getInstance().getReference(\"Actuals/start\");\n startRef.setValue(\"off\");\n startRef.setValue(\"on\");\n // go to next activity\n Intent goInstruct = new Intent(PreInstructionsActivity.this,InstructionsActivity.class);\n startActivity(goInstruct);\n overridePendingTransition(android.R.anim.fade_in, android.R.anim.fade_out);\n }", "void updateCommonToggleStatus(boolean shown);", "public void checkbox() {\r\n\t\tcheckBox.click();\r\n\t}", "@Override\n\tprotected void OnClick() {\n\t\t\n\t}", "@Override\r\n\t\t\t\t public void onClick(View v) {\n\t\t\t\t\t bFlagGongsi = !bFlagGongsi;\r\n\t\t\t\t\t gongsi_btn.setChecked(bFlagGongsi);\r\n\t\t\t\t }", "@Override\n\tpublic void onClick(View v) {\n\t\tswitch (v.getId()) {\n\t\tcase R.id.button_main_open_left:\n\t\t\tsetToggle();\n\t\t\tbreak;\n\t\tcase R.id.button_main_open_right:\n\t\t\tsm.showSecondaryMenu();\n\t\t\tbreak;\n\n\t\tdefault:\n\t\t\tbreak;\n\t\t}\n\t}", "@Override\r\n\t\t\t\tpublic void onClick() {\n\r\n\t\t\t\t}", "@Override\r\n\t\t\t\tpublic void onClick() {\n\r\n\t\t\t\t}", "@Override\n public void onClick(View v) {\n set();\n }", "@Override\n\t\tpublic void onClick(View v) {\n\t\t\tindoorFlag = !indoorFlag;\n\t\t\t//indoorFlag = true;\n\t\t}", "@Override\n public void onClick(View theView) {\n setUp();\n\n\n }", "@Override\n\t\tpublic void actionPerformed(ActionEvent e) {\n\t\t\tif (button_SFX.getText().equals(\"효과음 : On\")){\n\t\t\t\tsfx=false;\n\t\t\t\tbutton_SFX.setText(\"효과음 : off\");\n\t\t\t}\n\t\t\telse{\n\t\t\t\tsfx=true;\n\t\t\t\tbutton_SFX.setText(\"효과음 : On\");\n\t\t\t}\n\t\t}", "@Override\n public void onClick(View v) {\n toggleTutorial();\n }", "@Override\n\t\t\tpublic void onCheckedChanged(CompoundButton buttonView,\n\t\t\t\t\t\t\t\t\t\t boolean isChecked) {\n\t\t\t\tif(isChecked){\n\t\t\t\t\t//editText1.setText(buttonView.getText()+\"选中\");\n\t\t\t\t\tavcom.BwSelfAdaptSwitch = 1;\n\t\t\t\t}else{\n\t\t\t\t\t//editText1.setText(buttonView.getText()+\"取消选中\");\n\t\t\t\t\tavcom.BwSelfAdaptSwitch = 0;\n\t\t\t\t}\n\t\t\t}", "@Override\r\n\t\t\tpublic void onClick(View arg0) {\n\t\t\t\tshuaxin.setVisibility(8);\r\n\t\t\t}", "public void handleToggleButtonEcho() {\n\t\tif (toggleButtonEcho.isSelected() == true) {\n\t\t\tcontroller.audioManipulatorUseDelayProcessor(true);\n\t\t\tsliderEchoLength.setDisable(false);\n\t\t\tsliderDecay.setDisable(false);\n\t\t\ttextFieldEchoLength.setDisable(false);\n\t\t\ttextFieldDecay.setDisable(false);\n\t\t\ttoggleButtonEcho.setText(bundle.getString(\"mixerToggleButtonOn\"));\n\t\t} else {\n\t\t\tcontroller.audioManipulatorUseDelayProcessor(false);\n\t\t\tsliderEchoLength.setDisable(true);\n\t\t\tsliderDecay.setDisable(true);\n\t\t\ttextFieldEchoLength.setDisable(true);\n\t\t\ttextFieldDecay.setDisable(true);\n\t\t\ttoggleButtonEcho.setText(bundle.getString(\"mixerToggleButtonOff\"));\n\t\t}\n\n\t}", "@Override\n public void onCheckedChanged(CompoundButton buttonView,\n boolean isChecked) {\n }", "@Override\n\tpublic void onClick(View arg0) {\n\t\tswitch(arg0.getId()){\n\t\tcase R.id.h1:\n\t\t\tsd.open();\n\t\t\tbreak;\n\t\tcase R.id.h2:\n\t\t\t\n\t\t\tbreak;\n\t\tcase R.id.h3:\n\t\tsd.toggle();\n\t\t\tbreak;\n\t\tcase R.id.h4:\n\t\t\tsd.close();\n\t\t\tbreak;\n\t\t}\n\t}" ]
[ "0.755118", "0.7154254", "0.7142039", "0.7095443", "0.7078202", "0.7044807", "0.7000908", "0.6969752", "0.6966333", "0.6859979", "0.68572354", "0.67617625", "0.67507994", "0.6660029", "0.6629322", "0.66250205", "0.66050893", "0.65919", "0.65828073", "0.6574363", "0.65561396", "0.6528775", "0.650379", "0.64931047", "0.6480138", "0.6480068", "0.64642704", "0.64516", "0.6450384", "0.6447537", "0.64408344", "0.641667", "0.64042836", "0.640192", "0.6370321", "0.63658506", "0.6354856", "0.6340488", "0.63280994", "0.63173044", "0.6306068", "0.6296037", "0.62853026", "0.62842745", "0.6279758", "0.6255522", "0.62550604", "0.6248979", "0.6248044", "0.62241983", "0.62229925", "0.6215128", "0.62140244", "0.6212108", "0.6207233", "0.61560285", "0.6154542", "0.61508644", "0.6146075", "0.61352116", "0.6133474", "0.61333525", "0.6120946", "0.6116421", "0.61121273", "0.6112067", "0.6110931", "0.6098627", "0.60949224", "0.6093352", "0.60774124", "0.6062675", "0.60568213", "0.6054866", "0.6054739", "0.6045217", "0.6044226", "0.60348535", "0.6030456", "0.60239327", "0.6005709", "0.5992438", "0.59904146", "0.59858775", "0.59815973", "0.59796864", "0.597847", "0.59706503", "0.59637797", "0.59523803", "0.59523803", "0.59523714", "0.59500766", "0.59494954", "0.5949073", "0.5948187", "0.5942095", "0.59420836", "0.5939862", "0.5938111", "0.59353393" ]
0.0
-1
When 'choose file' button is clicked, this code executes.
private void choosefileBtnActionPerformed(ActionEvent evt) { JFileChooser filechooser = new JFileChooser(); int returnValue = filechooser.showOpenDialog(panel); if(returnValue == JFileChooser.APPROVE_OPTION) { filename = filechooser.getSelectedFile().toString(); fileTxtField.setText(filename); codeFile = filechooser.getSelectedFile(); assemblyreader = new mipstoc.read.CodeReader(codeFile); inputTxtArea.setText(assemblyreader.getString()); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private void processChooseFileButton() {\n try {\n dataOutputArea.setText(\"\");\n JFileChooser myFileChooser = new JFileChooser(\".\", FileSystemView.getFileSystemView());\n int returnValue = myFileChooser.showOpenDialog(null);\n if(returnValue == JFileChooser.APPROVE_OPTION) {\n selectedFile = myFileChooser.getSelectedFile();\n dataFileField.setText(selectedFile.getName());\n }\n } catch(Exception e) {\n System.out.println(\"There was an error with JFileChooser!\\n\\n\" + e.getMessage());\n } //end of catch()\n }", "public void chooseFile(String fileName) {\n getQueueTool().waitEmpty();\n output.printTrace(\"Choose file by JFileChooser\\n : \" + fileName\n + \"\\n : \" + toStringSource());\n JTextFieldOperator fieldOper = new JTextFieldOperator(getPathField());\n fieldOper.copyEnvironment(this);\n fieldOper.setOutput(output.createErrorOutput());\n //workaround\n fieldOper.setText(fileName);\n //fieldOper.clearText();\n //fieldOper.typeText(fileName);\n //approveSelection();\n approve();\n }", "@Override\r\n public void actionPerformed(ActionEvent e) {\r\n JFileChooser fileChooser = new JFileChooser();\r\n fileChooser.setDialogTitle(\"Upload Files\");\r\n int result = fileChooser.showOpenDialog(null);\r\n if (result == JFileChooser.APPROVE_OPTION) { \r\n selectedFile = fileChooser.getSelectedFile();\r\n review.setText(selectedFile.getAbsolutePath());\r\n } \r\n }", "public void openFileDialog() {\n\tswitch(buttonAction) {\n\t case SELECT_FILES:\n openFileDialog(fileUpload, true);\n break;\n\t case SELECT_FILE:\n default:\n openFileDialog(fileUpload, false);\n break;\n\t}\n }", "@Override\n public void click() {\n SwingUtilities.invokeLater(new Runnable() {\n public void run() {\n int result = fileChooser.showOpenDialog(TurtleFileOpen.this);\n\n if (result == JFileChooser.APPROVE_OPTION) {\n final File selFile = fileChooser.getSelectedFile();\n //the user selects the file\n execute(new Runnable() {\n public void run() {\n openFile(selFile);\n }\n });\n }\n }\n });\n }", "private void selectButtonActionPerformed(java.awt.event.ActionEvent evt) {\n\t\tCyFileFilter tempCFF = new CyFileFilter();\n\n\t\tFile file = FileUtil.getFile(\"Import Network Files\", FileUtil.LOAD);\n\n\t\tfileNameTextField.setText(file.getAbsolutePath());\n\t\trunButton.setEnabled(true);\n\t}", "private void startFileSelection() {\n final Intent chooseFile = new Intent(Intent.ACTION_GET_CONTENT);\n chooseFile.setType(getString(R.string.file_type));\n startActivityForResult(chooseFile, PICK_FILE_RESULT_CODE);\n }", "@FXML\r\n private void handleBrowseBtn(ActionEvent event) {\r\n openFile();\r\n }", "void selectFile(){\n JLabel lblFileName = new JLabel();\n fc.setCurrentDirectory(new java.io.File(\"saved\" + File.separator));\n fc.setDialogTitle(\"FILE CHOOSER\");\n FileNameExtensionFilter xmlfilter = new FileNameExtensionFilter(\n \"json files (*.json)\", \"json\");\n fc.setFileFilter(xmlfilter);\n int response = fc.showOpenDialog(this);\n if (response == JFileChooser.APPROVE_OPTION) {\n lblFileName.setText(fc.getSelectedFile().toString());\n }else {\n lblFileName.setText(\"the file operation was cancelled\");\n }\n System.out.println(fc.getSelectedFile().getAbsolutePath());\n }", "@Override\n\t\t\t\t\tpublic void onClick(DialogInterface arg0, int arg1) {\n\t\t\t\t\t\tif(completeChoose!=null)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tcompleteChoose.finalfile(rootnow);\n\t\t\t\t\t\t}\n\t\t\t\t\t}", "public void actionPerformed(ActionEvent e) {\n\t\t int returnVal = fc.showOpenDialog(GenerateWindow.this);\n\n\t\t if (returnVal == JFileChooser.APPROVE_OPTION) {\n\t\t File imagefile = fc.getSelectedFile();\n\t\t imageSelect.setText(\"images/\"+imagefile.getName());\n\t\t }}", "@Override\r\n public void actionPerformed(ActionEvent e) {\r\n JFileChooser fileChooser = new JFileChooser();\r\n fileChooser.setCurrentDirectory(new File(System.getProperty(\"user.home\")));\r\n FileNameExtensionFilter filter = new FileNameExtensionFilter(\"*.Images\", \"jpg\", \"gif\", \"png\");\r\n fileChooser.addChoosableFileFilter(filter);\r\n int result1 = fileChooser.showOpenDialog(null);\r\n if(result1 == JFileChooser.APPROVE_OPTION) {\r\n \tselectedFile = fileChooser.getSelectedFile();\r\n \treview.setText(selectedFile.getAbsolutePath());\r\n }\r\n }", "@Override\n public void actionPerformed(ActionEvent e) {\n File selectedFile;\n JFileChooser fileChooser = new JFileChooser();\n int reply = fileChooser.showOpenDialog(null);\n if (reply == JFileChooser.APPROVE_OPTION) {\n selectedFile = fileChooser.getSelectedFile();\n geefBestandTextField1.setText(selectedFile.getAbsolutePath());\n }\n\n }", "@Override\n public void onClick(View view) {\n if (view == buttonChoose) {\n showFileChooser();\n }\n //if the clicked button is upload\n else if (view == buttonUpload)\n {\n\n\n\n uploadFile();\n\n\n }\n }", "public void pressOnUploadBtn() throws IOException {\n FileChooser fileChooser = new FileChooser();\n fileChooser.setTitle(\"Open File\");\n File file = fileChooser.showOpenDialog(this);\n uploadFile(file);\n }", "public void getDataFromFileOptionsOpen(ActionEvent event) throws Exception {\n\n //file choose\n FileChooser fileChooser = new FileChooser();\n SelectFileButton.setOnAction(e -> {\n try {\n FileImportNameTxtF.clear();\n File selectedFile = fileChooser.showOpenDialog(null);\n //fileChooser.getExtensionFilters().add(new FileChooser.ExtensionFilter(\".txt\"));//only shows .txt files to user\n FileImportNameTxtF.appendText(selectedFile.getPath());\n\n } catch (Exception exception) {\n exception.printStackTrace();\n }\n });\n\n //submit file\n SubmitFileButton.setOnAction(e -> {\n a[0] = FileImportNameTxtF.getText();\n\n });\n }", "@Override\n\tpublic void actionPerformed(ActionEvent e) {\n\t\tJFileChooser jfc=new JFileChooser();\n\t\t\n\t\t//显示文件和目录\n\t\tjfc.setFileSelectionMode(JFileChooser.FILES_AND_DIRECTORIES );\n\t\tjfc.showDialog(new JLabel(), \"选择\");\n\t\tFile file=jfc.getSelectedFile();\n\t\t\n\t\t//file.getAbsolutePath()获取到的绝对路径。\n\t\tif(file.isDirectory()){\n\t\t\tSystem.out.println(\"文件夹:\"+file.getAbsolutePath());\n\t\t}else if(file.isFile()){\n\t\t\tSystem.out.println(\"文件:\"+file.getAbsolutePath());\n\t\t}\n\t\t\n\t\t//jfc.getSelectedFile().getName() 获取到文件的名称、文件名。\n\t\tSystem.out.println(jfc.getSelectedFile().getName());\n\t\t\n\t}", "private void openPressed(){\n\t\tJFileChooser fileChooser = new JFileChooser(System.getProperty(\"user.dir\"));\n\t\tFileNameExtensionFilter extentions = new FileNameExtensionFilter(\"SuperCalcSave\", \"scalcsave\");\n\t\tfileChooser.setFileFilter(extentions);\n\t\tint retunedVal = fileChooser.showOpenDialog(this);\n\t\tFile file = null;\n\t\tif(retunedVal == JFileChooser.APPROVE_OPTION){\n\t\t\tfile = fileChooser.getSelectedFile();\n\t\t}\n\t\t//only continue if a file is selected\n\t\tif(file != null){\n\t\t\tSaveFile saveFile = null;\n\t\t\ttry {\n\t\t\t\t//read in file\n\t\t\t\tObjectInputStream input = new ObjectInputStream(new FileInputStream(file));\n\t\t\t\tsaveFile = (SaveFile) input.readObject();\n\t\t\t\tinput.close();\n\t\t\t\tVariable.setList(saveFile.getVariables());\n\t\t\t\tUserFunction.setFunctions(saveFile.getFunctions());\n\t\t\t\tmenuBar.updateFunctions();\n\t\t\t\tSystem.out.println(\"Open Success\");\n\t\t\t} catch (Exception e) {\n\t\t\t\te.printStackTrace();\n\t\t\t}\n\t\t\t\n\t\t}\n\t}", "private void fileBrowserActionPerformed(ActionEvent e) {\n }", "public static void processOneFileSelecction()\n {\n int answer = JSoundsMainWindowViewController.jfcOneFile.showOpenDialog(JSoundsMainWindowViewController.jSoundsMainWindow);\n \n if (answer == JFileChooser.APPROVE_OPTION)\n {\n File actualDirectory = JSoundsMainWindowViewController.jfcOneFile.getCurrentDirectory();\n String directory = actualDirectory.getAbsolutePath() + \"/\" + JSoundsMainWindowViewController.jfcOneFile.getSelectedFile().getName();\n UtilFunctions.listOneFile(JSoundsMainWindowViewController.jfcOneFile.getSelectedFile());\n JSoundsMainWindowViewController.orderBy(true, false, false); \n }\n }", "@FXML\n public void browseButtonAction(ActionEvent event) {\n try{\n JFileChooser chooser = new JFileChooser();\n chooser.setDialogTitle(\"Choose file to play...\"); // setting title of title bar //\n chooser.showOpenDialog(null);\n songFile = chooser.getSelectedFile();\n playButtonAction();\n }\n catch(Exception e){ \n nowPlaying.setText(\"No file choosen\");\n }\n }", "public void fileChooser() {\n\t\tWindow stage = mediaView.getScene().getWindow();\n// configureFileChooser(fileChooser);\n\t\tfileChooser.setTitle(\"Open Resource File\");\n\t\tfileChooser.getExtensionFilters().addAll(new ExtensionFilter(\"Video Files\", \"*.mp4\", \"*.mpeg\"),\n\t\t\t\tnew ExtensionFilter(\"Audio Files\", \"*.mp3\"),\n\t\t\t\tnew ExtensionFilter(\"All Files\", \"*.*\"));\n\t\tFile selectedFile = fileChooser.showOpenDialog(stage);\n\t\tif (selectedFile != null) {\n\t\t\ttry {\n\t\t\t\tif(arrayList.size() != 0) {\n\t\t\t\t\tmp.stop();\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tdesktop.open(selectedFile);\n\t\t\t\tdirectory = selectedFile.getAbsolutePath();\n\t\t\t\t\n\t\t\t\tplayMedia(directory);\n\t\t\t\t\n\t\t\t\tarrayList.add(new File(directory));\n//\t\t\t\tSystem.out.println(arrayList.get(i).getName());\n\t\t\t\ti++;\n\t\t\t\t\n\n\t\t\t} catch (IOException ex) {\n\t\t\t\tLogger.getLogger(MainController.class.getName()).log(Level.SEVERE, null, ex);\n\t\t\t}\n\t\t}\n\t}", "@FXML\n private void handleChooseBtn(ActionEvent event)\n {\n try\n {\n sm.initializeFile();\n txtDuration.setText(sm.getDuration());\n txtTitleInput.setText(sm.getSongTitle());\n txtFile.setText(sm.getFilePath());\n txtArtistInput.setText(sm.getArtist());\n } catch (MTBllException ex)\n {\n displayError(ex);\n }\n }", "public void openFile(ActionEvent e) {\r\n JFileChooser chooser = new JFileChooser();\r\n\r\n int returnVal = chooser.showOpenDialog(null);\r\n if (returnVal == JFileChooser.APPROVE_OPTION) {\r\n this.is_alg_started = false;\r\n this.is_already_renumbered = false;\r\n if (e.getActionCommand().equals(\"nodelist\")) {\r\n this.nodefileText.setText(chooser.getSelectedFile().getAbsolutePath());\r\n }\r\n if (e.getActionCommand().equals(\"edgelist\")) {\r\n this.edgeFileText.setText(chooser.getSelectedFile().getAbsolutePath());\r\n }\r\n }\r\n }", "private void actionAddFile ()\r\n\t{\r\n\t\ttry\r\n\t\t{\r\n\t\t\tJFileChooser fileChooserDriver = new JFileChooser();\r\n\r\n\t\t\tint isFileSelected = fileChooserDriver.showOpenDialog(fileChooserDriver);\r\n\r\n\t\t\tif (isFileSelected == JFileChooser.APPROVE_OPTION)\r\n\t\t\t{\r\n\t\t\t\tString filePath = fileChooserDriver.getSelectedFile().getPath();\r\n\t\t\t\tDataController.scenarioAddFile(filePath);\r\n\r\n\t\t\t\thelperDisplayProjectFiles();\r\n\t\t\t\thelperDisplayInputImage();\r\n\t\t\t}\r\n\t\t}\r\n\t\tcatch (ExceptionMessage e)\r\n\t\t{\r\n\t\t\tExceptionHandler.processException(e);\r\n\t\t}\r\n\r\n\t}", "@Override\n\t public void actionPerformed(ActionEvent arg0) {\n\t\t JFileChooser j = new JFileChooser(FileSystemView.getFileSystemView().getHomeDirectory()); \n\t\t\n\t\t // invoke the showsOpenDialog function to show the save dialog \n\t\t int r = j.showOpenDialog(null); \n\t\t\n\t\t // if the user selects a file \n\t\t if (r == JFileChooser.APPROVE_OPTION) \n\t\t\n\t\t { \n\t\t // set the label to the path of the selected file \n\t\t textfield.setText(j.getSelectedFile().getAbsolutePath()); \n\t\t\n\t\t } \n\t\t // if the user cancelled the operation \n\t\t \n\t\t //\n\t\t \n\t\t }", "public void actionPerformed(ActionEvent e) {\n\t \tJFileChooser fileChooser = new JFileChooser(lastChoosenDir);\n\t int returnValue = fileChooser.showOpenDialog(null);\n\t if (returnValue == JFileChooser.APPROVE_OPTION) {\n\t selectedFile = fileChooser.getSelectedFile();\n\t lastChoosenDir = selectedFile.getParentFile();\n\t System.out.println(selectedFile.getName());\n\t // lblSlika=new JLabel(\"aa\");\n\t displayChosen();\n\t \n\t // content.add(lblSlika);\n\t \n\t }\n\t }", "@Override\r\n\tpublic void onBrowserSelected() {\n\t\tLog.d(TAG, \"onBrowserSelected()\");\r\n\t\t\r\n // Use the GET_CONTENT intent from the utility class\r\n Intent target = FileUtils.createGetContentIntent();\r\n // Create the chooser Intent\r\n Intent intent = Intent.createChooser(\r\n target, getString(R.string.choose_file));\r\n try {\r\n startActivityForResult(intent, 6383);\r\n } catch (ActivityNotFoundException e) {\r\n \tToast.makeText(getApplicationContext(), \"Couldn't open file browser\", Toast.LENGTH_SHORT).show();\r\n }\r\n\t}", "public void selectFile(String file) {\n clickOnFile(file);\n }", "public void actionPerformed(ActionEvent evt) {\n\t int result = chooser.showOpenDialog(frame);\n\n\t // Get the selected file\n\t if ( result == JFileChooser.APPROVE_OPTION){\n\t \ttextField.setText(chooser.getSelectedFile().getAbsolutePath());\n\t }\n\t }", "private void fileChooser(){\n JFileChooser chooser = new JFileChooser();\n // Note: source for ExampleFileFilter can be found in FileChooserDemo,\n // under the demo/jfc directory in the JDK.\n //ExampleFileFilter filter = new ExampleFileFilter();\n// filter.addExtension(\"jpg\");\n// filter.addExtension(\"gif\");\n// filter.setDescription(\"JPG & GIF Images\");\n // chooser.setFileFilter(new javax.swing.plaf.basic.BasicFileChooserUI.AcceptAllFileFilter());\n int returnVal = chooser.showOpenDialog(this.getContentPane());\n if(returnVal == JFileChooser.APPROVE_OPTION) {\n System.out.println(\"You chose to open this file: \" +\n chooser.getSelectedFile().getName());\n try{\n this.leerArchivo(chooser.getSelectedFile());\n\n }\n catch (Exception e){\n System.out.println(\"Imposible abrir archivo \" + e);\n }\n }\n }", "private void jButtonBrowseFileNameActionPerformed(ActionEvent e) {\n\t\tJFileChooser fileChooser = new JFileChooser();\n\t\tint result = fileChooser.showSaveDialog(this);\n\t\tif (result == JFileChooser.APPROVE_OPTION) {\n\t\t\tFile file = fileChooser.getSelectedFile();\n\t\t\tjTextFieldFileName.setText(file.getAbsolutePath());\n\t\t}\n\t}", "@Override\n\t\t\t\tpublic void actionPerformed(ActionEvent arg0) {\n\t\t\t\t\tJFileChooser jc=new JFileChooser();\n\t\t\t\t\tjc.setFileFilter(new FileNameExtensionFilter(\".xml\", \".xml\"));\n\t\t\t\t\tjc.setFileFilter(new FileNameExtensionFilter(\".json\", \".json\"));\n\t\t\t\t\tint resp=jc.showSaveDialog(null);\n\t\t\t\t\tString url=\"\";\n\t\t\t\t\tString name=\"\";\n\t\t\t\t\tif(resp==jc.APPROVE_OPTION){\n\t\t\t\t\t\tFile file=jc.getSelectedFile();\n\t\t\t\t\t\turl=file.getPath()+jc.getFileFilter().getDescription();\n\t\t\t\t\t\tname=file.getName()+jc.getFileFilter().getDescription();\n\t\t\t\t\tif(name.charAt(name.length()-1)=='l'){\n\t\t\t\t\t\tSaveAndLoadXml.save(url);\n\t\t\t\t\t}else{\n\t\t\t\t\t\tnew JasonSave().saveJson(url);\n\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}", "public void actionPerformed(ActionEvent e) {\n\t\t int returnVal = fc.showOpenDialog(GenerateWindow.this);\n\n\t\t if (returnVal == JFileChooser.APPROVE_OPTION) {\n\t\t File goodsoundfile = fc.getSelectedFile();\n\t\t goodSoundTF.setText(\"sounds/\"+goodsoundfile.getName());\n\t\t }}", "private void jButtonBrowseInputFilesActionPerformed(ActionEvent e) {\n\t\tJFileChooser fileChooser = new JFileChooser();\n\t\tfileChooser.addChoosableFileFilter(new RootFileFilter());\n\t\tfileChooser.setAcceptAllFileFilterUsed(false);\n\t\tint result = fileChooser.showOpenDialog(this);\n\t\tif (result == JFileChooser.APPROVE_OPTION) {\n\t\t\tFile file = fileChooser.getSelectedFile();\n\t\t\tjTextFieldInputFiles.setText(file.getAbsolutePath());\n\t\t}\n\t}", "public void actionPerformed(java.awt.event.ActionEvent evt) {\n if (!askSave()) {\n return;\n }\n //loop until user choose valid file\n while (true) {\n int result = chooser.showOpenDialog(form);\n //check if user chooser approve option\n if (result == JFileChooser.APPROVE_OPTION) {\n File openFile = chooser.getSelectedFile();\n //check if open file is exist\n if (openFile.exists()) {\n file = openFile;\n text.setText(\"\");\n setSaveTitle(openFile.getName());\n writeToTextArea(openFile);\n saved = true;\n break;\n } else {\n JOptionPane.showMessageDialog(form, \"File not found\", \"Open\", JOptionPane.OK_OPTION);\n }\n } else {\n break;\n }\n\n }\n }", "public void actionPerformed(ActionEvent e) {\n\t\t\t\tif (e.getSource() == browseBtn) {\n\t\t\t\t\tfc.setFileSelectionMode(JFileChooser.DIRECTORIES_ONLY);\n\t\t\t\t\tint returnVal = fc.showOpenDialog(browseBtn);\n\t\t\t\t\tif (returnVal == JFileChooser.APPROVE_OPTION) {\n\t\t\t\t\t\tFile file = fc.getSelectedFile();\n\t\t\t\t\t\tcomboBox.setSelectedItem(file.getAbsolutePath());\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}", "@FXML\n void fileOpenPressed(ActionEvent event) {\n \tFileChooser fileChooser = new FileChooser();\n\t\tfileChooser.setTitle(\"Open File\");\n\t\tFile f = fileChooser.showOpenDialog(stage);\n\t\tif (f != null) {\n\t\t\tsetFile(f);\n\t\t\tviewState.set(ViewState.OPEN);\n\t\t}\n }", "private void browseInputButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_browseInputButtonActionPerformed\n JFileChooser chooser = new JFileChooser();\n FileNameExtensionFilter filter = new FileNameExtensionFilter(\"XLS file\", new String[]{\"xls\", \"xlsx\"});\n chooser.setFileFilter(filter);\n chooser.setCurrentDirectory(new java.io.File(\".\"));\n chooser.setDialogTitle(\"Select a file\");\n chooser.setFileSelectionMode(JFileChooser.FILES_AND_DIRECTORIES);\n chooser.setAcceptAllFileFilterUsed(false);\n\n if (chooser.showOpenDialog(null) == JFileChooser.APPROVE_OPTION) {\n FILEPATH.setText(chooser.getSelectedFile().getPath());\n }\n }", "@Override\n public void actionPerformed(AnActionEvent event) {\n\n Project project = event.getData(PlatformDataKeys.PROJECT);\n\n DataContext dataContext = event.getDataContext();\n VirtualFile file = DataKeys.VIRTUAL_FILE.getData(dataContext);\n if(file != null){\n //获取选中的文件\n file = DataKeys.VIRTUAL_FILE.getData(dataContext);\n if(file == null){\n Messages.showErrorDialog(\"未选中文件\",\"error\");\n return;\n }\n }\n Module module = StringUtil.getModule(event.getProject(),dataContext,file.getPath());\n ExportDialog exportDialog = new ExportDialog(project,module,file);\n exportDialog.setTitle(\"Export Files\");\n exportDialog.show();\n }", "@Override\n\t\t\tpublic void actionPerformed(ActionEvent e) {\n\n\t\t\t\tint re = jfc.showOpenDialog(f);\n\t\t\t\tfile = jfc.getSelectedFile();\n\t\t\t\tif (re == 0) {\n\t\t\t\t\ttry {\n\n\t\t\t\t\t\tFileReader fr = new FileReader(file);\n\t\t\t\t\t\tint ch;\n\t\t\t\t\t\tString str = \"\";\n\n\t\t\t\t\t\twhile ((ch = fr.read()) != -1) {\n\t\t\t\t\t\t\tstr += (char) ch;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tta.setText(str);\n\t\t\t\t\t\tfr.close();\n\t\t\t\t\t} catch (Exception ex) {\n\t\t\t\t\t\tSystem.out.println(ex.getMessage());\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}", "public void onClickOfChooseFile(View view) {\n Log.i(TAG, \"onClickOfChooseFile: \");\n if (ContextCompat.checkSelfPermission(this, Manifest.permission.READ_EXTERNAL_STORAGE) != PackageManager.PERMISSION_GRANTED) {\n\n if (ActivityCompat.shouldShowRequestPermissionRationale(this, Manifest.permission.READ_EXTERNAL_STORAGE)) {\n\n ActivityCompat.requestPermissions(this, new String[]{Manifest.permission.READ_EXTERNAL_STORAGE}, REQUEST_READ_EXTERNAL_STORAGE);\n\n } else {\n\n ActivityCompat.requestPermissions(this, new String[]{Manifest.permission.READ_EXTERNAL_STORAGE}, REQUEST_READ_EXTERNAL_STORAGE);\n }\n\n } else {\n //Go ahead with file choosing\n startIntentFileChooser();\n }\n }", "private void itemFileButtonActionPerformed(java.awt.event.ActionEvent evt) {\n JFileChooser chooser = new JFileChooser();\n chooser.setDialogTitle(\"Select Raffle Items File\");\n File workingDirectory = new File(System.getProperty(\"user.dir\"));\n chooser.setCurrentDirectory(workingDirectory);\n if (chooser.showSaveDialog(this) == JFileChooser.APPROVE_OPTION) {\n itemFile = chooser.getSelectedFile();\n itemFileLabel.setText(getFileName(itemFile));\n pcs.firePropertyChange(\"ITEM\" , null, itemFile);\n }\n }", "@Override\n public void actionPerformed(ActionEvent e) {\n String src;\n JFileChooser fileChooser = new JFileChooser();\n fileChooser.setCurrentDirectory(new File(System.getProperty(\"user.home\")));\n int result = fileChooser.showOpenDialog(getParent());\n if (result == JFileChooser.APPROVE_OPTION) {\n File selectedFile = fileChooser.getSelectedFile();\n textSalida.append(\"\\nAutómata seleccionado \" + selectedFile.getAbsolutePath() );\n automa = null;\n automataready = false;\n compilar.setEnabled(false);\n try {\n src = selectedFile.getAbsolutePath();\n automa = new AFDVault(src);\n automataready = automa.allready();\n if (automataready){\n compilar.setEnabled(true);\n textSalida.append(\"\\nAutomata cargado\");\n //automa.PrintAFD();\n }else{\n compilar.setEnabled(false);\n textSalida.append(\"\\nAutomata no cargado verifique el archivo\");\n }\n }catch (IOException|ParserException ex){\n textSalida.append(ex.getMessage()+\"\\n\");\n }\n }\n }", "@Override\n public void onFileUploaded(FolderNode folderNode, FileNode fileNode) {\n choices.selectValue(fileNode.getName());\n closeAdditionalChoiceDialog(true);\n }", "public String getFileChosen() \n {\n return fileName.getText();\n }", "private void selectPDFFile() {\n JFileChooser jfc = new JFileChooser();\n jfc.setFileFilter(new PDFFilter());\n jfc.setMultiSelectionEnabled(false);\n int ret = jfc.showDialog(this, \"Open\");\n if (ret == 0) {\n readFile = jfc.getSelectedFile();\n inputField.setText(readFile.getAbsolutePath());\n String outString = readFile.getAbsolutePath();\n outString = outString.substring(0, outString.length() - 3);\n outString = outString + \"txt\";\n outputField.setText(outString);\n progressLabel.setBackground(INFO);\n progressLabel.setText(PRESS_EXTRACT);\n } else {\n System.out.println(NO_FILE_SELECTED);\n progressLabel.setBackground(WARNING);\n progressLabel.setText(SELECT_FILE);\n }\n }", "public void pressOnDownloadBtn() {\n Network.sendMsg(\n new FileRequest(\n serverFilesList.getSelectionModel().getSelectedItem()));\n }", "private void txttenfileActionPerformed(java.awt.event.ActionEvent evt) {\n }", "public void actionPerformed(ActionEvent e) {\r\n\r\n if (e.getActionCommand() == \"BATCH_SOURCE_FOLDER\") { \r\n \t JFileChooser fc = new JFileChooser();\r\n\r\n\t\t fc.setFileSelectionMode(JFileChooser.DIRECTORIES_ONLY);\r\n\t\t int returnVal = fc.showDialog(RSMLGUI.this, \"Choose\");\r\n\t\t \r\n if (returnVal == JFileChooser.APPROVE_OPTION){ \r\n \t String fName = fc.getSelectedFile().toString();\r\n \t batchSourceFolder.setText(fName);\r\n }\r\n else SR.write(\"Choose folder cancelled.\"); \r\n }\r\n \r\n else if(e.getActionCommand() == \"BATCH_EXPORT\"){\r\n \t batchExport();\r\n }\r\n \r\n }", "private void entryFileButtonActionPerformed(java.awt.event.ActionEvent evt) {\n JFileChooser chooser = new JFileChooser();\n chooser.setDialogTitle(\"Select Entries File\");\n File workingDirectory = new File(System.getProperty(\"user.dir\"));\n chooser.setCurrentDirectory(workingDirectory);\n if (chooser.showSaveDialog(this) == JFileChooser.APPROVE_OPTION) {\n entryFile = chooser.getSelectedFile();\n entryFileLabel.setText(getFileName(entryFile));\n pcs.firePropertyChange(\"ENTRY\", null, entryFile);\n }\n }", "@Override\r\n\t\t\tpublic void actionPerformed(ActionEvent arg0) {\n\t\t\t\tJFileChooser chooser = new JFileChooser();\r\n\t\t\t\tFileNameExtensionFilter filter = new FileNameExtensionFilter(\r\n\t\t\t\t\t\t\"Excel Files\", // 파일 이름에 창에 출력될 문자열\r\n\t\t\t\t\t\t\"xls\"); // 파일 필터로 사용되는 확장자. *.xml 만 나열됨\r\n\t\t\t\tchooser.setFileFilter(filter); // 파일 다이얼로그에 파일 필터 설정\r\n\t\t\t\tchooser.setMultiSelectionEnabled(false);//다중 선택 불가\r\n\r\n\t\t\t\t// 파일 다이얼로그 출력\r\n\t\t\t\tint ret = chooser.showOpenDialog(null);\r\n\t\t\t\tif (ret != JFileChooser.APPROVE_OPTION) { // 사용자가 창을 강제로 닫았거나 취소\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// 버튼을 누른 경우\r\n\t\t\t\t\tJOptionPane.showMessageDialog(null, \"파일을 선택하지 않았습니다\", \"경고\",\r\n\t\t\t\t\t\t\tJOptionPane.WARNING_MESSAGE);\r\n\t\t\t\t\treturn;\r\n\t\t\t\t}\r\n\t\t\t\t// 사용자가 파일을 선택하고 \"열기\" 버튼을 누른 경우\r\n\t\t\t\tString readFilePath = chooser.getSelectedFile().getPath(); // 파일 경로명을 알아온다.\t\t\t\t\r\n\t\t\t\tShowPatientInfo_K showPatientInfo = new ShowPatientInfo_K(readFilePath);\r\n\t\t\t}", "public void actionPerformed(ActionEvent e) {\n\t\t\t\tint returnVal = fileChooser.showOpenDialog(panel);\n\n\t\t\t\tif (returnVal == JFileChooser.APPROVE_OPTION) {\n\t\t\t\t\tFile file = fileChooser.getSelectedFile();\n\n\t\t\t\t\tif (communicationsHandler instanceof Server) {\n\t\t\t\t\t\tFileUserSelectorUI fileUI = new FileUserSelectorUI(file, myMessagePane.getText(),\n\t\t\t\t\t\t\t\tcommunicationsHandler);\n\n\t\t\t\t\t} else {\n\t\t\t\t\t\t// This is a client, send file request to server.\n\t\t\t\t\t\tcommunicationsHandler.sendFileRequest(file, myMessagePane.getText(), null);\n\t\t\t\t\t}\n\n\t\t\t\t\tmyMessagePane.setText(\"\");\n\t\t\t\t}\n\t\t\t}", "@FXML\r\n void ClickUploadBtn(ActionEvent event) throws IOException {\r\n FileChooser fileExplorer = new FileChooser();\r\n File file = fileExplorer.showOpenDialog(null);\r\n //Open a file explorer and ask user to select a file\r\n if(file != null && file.exists())\r\n {\r\n UploadScriptField.setText(file.getCanonicalPath());\r\n //Set the upload field text\r\n DateTimeFormatter formatter = DateTimeFormatter.ofPattern(\r\n \"dd/MM/yyyy\");\r\n TextInputDialog dialog = new TextInputDialog(\"Command to\"\r\n + \" run script\");\r\n dialog.setTitle(\"Found script from File Explorer\");\r\n dialog.setHeaderText(\"Enter Command to run\");\r\n Optional<String> result = dialog.showAndWait();\r\n //Wait for response\r\n if(result.isPresent())\r\n {\r\n TextInputDialog dialogDescription = new \r\n TextInputDialog(\"Script Description\");\r\n dialogDescription.setTitle(\"Found script in explorer\");\r\n dialogDescription.setHeaderText(\"Enter script description\");\r\n Optional<String>resultDesc =dialogDescription.showAndWait();\r\n if(resultDesc.isPresent())\r\n {\r\n //Set the date format for the string\r\n //set the image view as the delete button\r\n user.getListOfScripts().add(new Script(file.getName(),\r\n formatter.format(LocalDate.now()), \r\n dialogDescription.getResult(), \r\n dialog.getResult()));\r\n //Add script to list and set details\r\n scriptTable.setItems(user.getListOfScripts());\r\n //Reload table\r\n user.setListOfScripts(user.getListOfScripts());\r\n }\r\n }\r\n }\r\n }", "private void openJMenuItemActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_openJMenuItemActionPerformed\n fromFileJButton.doClick();\n }", "public void actionPerformed(ActionEvent e) {\n\t\t int returnVal = fc.showOpenDialog(GenerateWindow.this);\n\n\t\t if (returnVal == JFileChooser.APPROVE_OPTION) {\n\t\t File badsoundfile = fc.getSelectedFile();\n\t\t badSoundTF.setText(\"sounds/\"+badsoundfile.getName());\n\t\t }}", "private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton1ActionPerformed\n\n JFileChooser chooser = new JFileChooser(); ////apabila merah -> ALT+ENTER -> j file chooser -> TOP\n chooser.showOpenDialog(null);\n File f = chooser.getSelectedFile();\n String filename = f.getAbsolutePath();\n vpath.setText(filename);\n }", "private void openFileChoose() {\n Intent intent = new Intent();\n intent.setType(\"image/*\");\n intent.setAction(Intent.ACTION_GET_CONTENT);\n startActivityForResult(intent, PEGA_IMAGEM);\n }", "@FXML\n\tvoid uploadBtnClicked(ActionEvent event) throws FileNotFoundException {\n\t\tArrayList<String> errorLog = new ArrayList<String>();\n\t\tFileChooser filechooser = new FileChooser();\n\t\tfilechooser.setTitle(\"upload finished exam\");\n\t\tFile selectedfile = filechooser.showOpenDialog(null);\n\t\tif (selectedfile != null && selectedfile.getName().endsWith(\".docx\")) {\n\t\t\t// here we need to implements upload file to sql DB\n\t\t\tMyFile fileToUpload = new MyFile(ClientUI.clientHandler.myDetails.getId(), examID, \"manual\");\n\t\t\tfileToUpload.setUserType(\"student\");\n\t\t\tbyte[] myByteArray = new byte[(int) selectedfile.length()];\n\t\t\tFileInputStream fileIn = new FileInputStream(selectedfile);\n\t\t\tBufferedInputStream bufferIn = new BufferedInputStream(fileIn);\n\t\t\tfileToUpload.initArray(myByteArray.length);\n\t\t\tfileToUpload.setSize(myByteArray.length);\n\t\t\ttry {\n\t\t\t\tbufferIn.read(fileToUpload.getMybytearray(), 0, myByteArray.length);\n\t\t\t\tClientUI.clientHandler.handleMessageFromClientUI(fileToUpload);\n\t\t\t\tString serverRespond = (String) ClientHandler.returnMessage;\n\t\t\t\tif (serverRespond.equals(\"success\")) {\n\t\t\t\t\tbufferIn.close();\n\t\t\t\t\tapproveImage.setVisible(true);\n\t\t\t\t\tSpecialCalls.callSuccessFrame(\"Exam uploaded successfuly\");\n\t\t\t\t\tflag2 = false;\n\t\t\t\t}\n\t\t\t} catch (IOException e) {\n\t\t\t\te.printStackTrace();\n\t\t\t}\n\t\t} else {\n\t\t\terrorLog.add(\"Uploaded file is not valid\");\n\t\t\tSpecialCalls.callErrorFrame(errorLog);\n\t\t}\n\n\t}", "private void browseInputFile()\n\t{\n\t\ttry\n\t\t{\n\t\t\tJFileChooser fc = new JFileChooser(\".\");\n\t\t\tfc.setDialogTitle(\"Please choose an XML file\");\n\t\t\tFileNameExtensionFilter xmldata = new FileNameExtensionFilter(\"XML\", \"xml\");\n\t\t\tfc.addChoosableFileFilter(xmldata);\n\n\t\t\tint returnVal = fc.showOpenDialog(this); // shows the dialog of the file browser\n\t\t\t// get name und path\n\t\t\tif(returnVal == JFileChooser.APPROVE_OPTION)\n\t\t\t{\n\t\t\t\tcurFile = fc.getSelectedFile();\n\t\t\t\tinputfilepath = curFile.getAbsolutePath();\n\t\t\t\tmainframe.setInputFileText(inputfilepath);\n\t\t\t}\n\n\t\t}\n\t\tcatch (Exception e)\n\t\t{\n\t\t\tJOptionPane\n\t\t\t\t\t.showMessageDialog(new JFrame(),\n\t\t\t\t\t\t\t\"Please select a valid xml file downloaded from Pathway Interaction Database, or a converted SIF file.\",\n\t\t\t\t\t\t\t\"Warning\", JOptionPane.WARNING_MESSAGE);\n\t\t\te.printStackTrace();\n\t\t}\n\n\t}", "@Override\r\n\tpublic void actionPerformed(ActionEvent arg0)\r\n\t{\n\t\tString message = textField.getText();\r\n\t\tString buttonText = button.getText();\r\n\r\n\t\t// Did the user click on the first button?\r\n\t\tif (arg0.getSource() == button)\r\n\t\t{\r\n\t\t\t// Pop up the text from the message\r\n\t\t\tJOptionPane.showMessageDialog(frame, message);\r\n\t\t}\r\n\t\t// Did the user click on the other button?\r\n\t\telse\r\n\t\t{\r\n\t\t\t// Pop open the file chooser\r\n\t\t\tint returnVal = fc.showOpenDialog(frame);\r\n\r\n\t\t\t// If file was really selected, do something with it\r\n\t\t\tif (returnVal == JFileChooser.APPROVE_OPTION)\r\n\t\t\t{\r\n\t\t\t\t// Get the file the user selected\r\n\t\t\t\tFile file = fc.getSelectedFile();\r\n\r\n\t\t\t\t// Do something with the file path (display it, use it to open, etc.)\r\n\t\t\t\tSystem.out.println(file.getPath());\r\n\t\t\t}\r\n\t\t\telse\r\n\t\t\t{\r\n\t\t\t\tSystem.out.println(\"No file was selected\");\r\n\t\t\t}\r\n\t\t}\r\n\t}", "@Override\n\tpublic void actionPerformed(ActionEvent e) {\n\t\t\n\t\tif(e.getSource()==browse){\n\t\t\tif (chooser == null){\n\t\t\t\tchooser = new JFileChooser();\n\t\t\t\tchooser.setCurrentDirectory(new java.io.File(projectPath));\n\t\t\t\tchooser.setDialogTitle(\"Find Folder\");\n\t\t\t\tchooser.setFileSelectionMode(JFileChooser.DIRECTORIES_ONLY);\n\t\t\t\tchooser.setAcceptAllFileFilterUsed(false);\n\n\t\t\t\tif (chooser.showOpenDialog(null) == JFileChooser.APPROVE_OPTION) {\n\t\t\t\t\tsaveTo.setText(chooser.getSelectedFile().toString());\t\t\n\t\t\t\t}\n\t\t\t\tchooser = null;\n\t\t\t}\t\n\t\t}else if(e.getSource()== save){\n\t\t\tsaveFile();\n\t\t}else if(e.getSource()==cancel){\n\t\t\tnameOfFile.setText(\"\");\n\t\t\tsaveTo.setText(\"\");\n\t\t\tthisFrame.dispose();\n\t\t}\n\t\t\n\t}", "@Override\n public void actionPerformed(ActionEvent e) {\n JFileChooser fc = new JFileChooser(); \n int returnVal = fc.showOpenDialog(null);\n if (returnVal == JFileChooser.APPROVE_OPTION) {\n File file = fc.getSelectedFile();\n System.out.println(file.getAbsolutePath()); \n image = loadImage( file);\n }\n }", "public void widgetSelected(SelectionEvent event) {\n fileName = textBox.getText();\n setReturnValue(fileName);\n shell.close();\n }", "@Override\n\t\tpublic void actionPerformed(ActionEvent e) {\n\t\t\tJFileChooser chooser;\n\t\t\tif (currentPath == null) {\n\t\t\t\tchooser = new JFileChooser(System.getProperty(\"user.dir\"));\n\t\t\t} else {\n\t\t\t\tchooser = new JFileChooser(currentPath);\n\t\t\t}\n\t\t\tchooser.setFileFilter(new SvgFileFilter());\n\t\t\tint retval = chooser.showOpenDialog(canvas);\n\t\t\tif (retval == JFileChooser.APPROVE_OPTION) {\n\t\t\t\tFile f = chooser.getSelectedFile();\n\t\t\t\tcurrentPath = f.getPath();\n\t\t\t\tSystem.out.println(f.getAbsolutePath());\n\t\t\t\tloadNewDocument(f.getAbsolutePath());\n\t\t\t}\n\t\t}", "private void selectXmlFile() {\n\t\t JFileChooser chooser = new JFileChooser();\n\t\t // ask for a file to open\n\t\t int option = chooser.showSaveDialog(this);\n\t\t if (option == JFileChooser.APPROVE_OPTION) {\n\t\t\t // get pathname and stick it in the field\n\t\t\t xmlfileField.setText(\n chooser.getSelectedFile().getAbsolutePath());\n\t\t } \n }", "private void jButtonBrowseOutputFileActionPerformed(ActionEvent e) {\n\t\tJFileChooser fileChooser = new JFileChooser();\n\t\tint result = fileChooser.showSaveDialog(this);\n\t\tif (result == JFileChooser.APPROVE_OPTION) {\n\t\t\tFile file = fileChooser.getSelectedFile();\n\t\t\tjTextFieldOutputFile.setText(file.getAbsolutePath());\n\t\t}\n\t}", "@FXML\n public void openFile(Event e) {\n String inputData = \"\";\n File file = chooser.showOpenDialog(open.getScene().getWindow());\n\n try {\n inputData = new String(Files.readAllBytes(file.toPath()));\n } catch (IOException error) {\n error.getSuppressed();\n }\n\n input.setFont(Font.font(\"monospaced\"));\n input.setText(inputData);\n\n Stage primary = (Stage) open.getScene().getWindow();\n primary.setTitle(file.getName());\n }", "@Override\n public void actionPerformed(ActionEvent e) {\n JFileChooser j = new JFileChooser(FileSystemView.getFileSystemView().getHomeDirectory());\n\n // invoke the showsSaveDialog function to show the save dialog\n int r = j.showSaveDialog(null);\n\n if (r == JFileChooser.APPROVE_OPTION) {\n // set the label to the path of the selected directory\n dataFile.setText(j.getSelectedFile().getAbsolutePath());\n }\n // if the user cancelled the operation\n else\n dataFile.setText(\"the user cancelled the operation\");\n }", "@FXML\n void newFilePressed(ActionEvent event) {\n\t\tFileChooser fileChooser = new FileChooser();\n\t\tfileChooser.setTitle(\"Open New File\");\n\t\tFile f = fileChooser.showSaveDialog(stage);\n\t\tif (f != null) {\n\t\t\tsetFile(f);\n\t\t\tviewState.set(ViewState.NEW);\n\t\t}\n\n }", "@Override\r\n\t\t\t\tpublic void actionPerformed(ActionEvent e) {\n\t\t\t\t\tJFileChooser fc = new JFileChooser();\r\n\t\t\t\t\tfc.setFileSelectionMode(JFileChooser.DIRECTORIES_ONLY);\r\n\t\t\t\t\tint result = fc.showOpenDialog(new JFrame());\r\n\t\t\t\t\tif(result == JFileChooser.APPROVE_OPTION){\r\n\t\t\t\t\t\tString path = fc.getSelectedFile().getAbsolutePath();\r\n\t\t\t\t\t\ttfPath.setText(path);\r\n\t\t\t\t\t}\r\n\t\t\t\t}", "private void browseTemplateActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_browseTemplateActionPerformed\n JFileChooser chooser = new JFileChooser();\n FileNameExtensionFilter filter = new FileNameExtensionFilter(\"Word document\", new String[]{\"doc\", \"docx\"});\n chooser.setFileFilter(filter);\n chooser.setCurrentDirectory(new java.io.File(\".\"));\n chooser.setDialogTitle(\"Select a file\");\n chooser.setFileSelectionMode(JFileChooser.FILES_AND_DIRECTORIES);\n chooser.setAcceptAllFileFilterUsed(false);\n\n if (chooser.showOpenDialog(null) == JFileChooser.APPROVE_OPTION) {\n templateDoc.setText(chooser.getSelectedFile().getPath());\n }\n }", "private void jButton2ActionPerformed(java.awt.event.ActionEvent evt) {\n JFileChooser fc = new JFileChooser();\n fc.setCurrentDirectory(new File(System.getProperty(\"user.dir\")));\n int result = fc.showOpenDialog(this);\n if (result == JFileChooser.APPROVE_OPTION) {\n File selectedFile = fc.getSelectedFile();\n myFile = selectedFile.getAbsolutePath().replaceAll(\"\\\\\\\\\", \"/\");\n //System.out.println(\"Selected file: \" + myFile);\n }\n jSimulationBtn.setEnabled(true);\n jBtnFuzzy.setEnabled(true);\n jFileTxt.setText(myFile);\n }", "private void buttonBrowseFileClicked(java.awt.event.ActionEvent evt) {\n\t\tString tableName = null;\n\t\tfinal JFileChooser fc = new JFileChooser();\n\n\t\tfc.addActionListener(new java.awt.event.ActionListener() {\n\t\t\tpublic void actionPerformed(java.awt.event.ActionEvent evt) {\n\n\t\t\t\tgetLabelFileOperationStatus().setText(\"Scanning backup files...Please wait\");\n\n\t\t\t\tgetLabelFileOperationStatus().setVisible(true);\n\n\t\t\t}\n\t\t});\n\n\t\tfc.showOpenDialog(new JLabel(\"Select the Backup File\"));\n\t\tFile restoreFile = fc.getSelectedFile();\n\n\t\ttry {\n\n\t\t\tBackupRestoreFileUtil fileUtil = new BackupRestoreFileUtil(restoreFile);\n\n\t\t\t// readFilesDialog = new ReadFilesDialog(new JFrame(), true,\n\t\t\t// fileUtil);\n\t\t\t// readFilesDialog.setVisible(true);\n\t\t\tList<HbaseTableObject> restoredTableData = fileUtil.restoreFromFiles(this);\n\n\t\t\tif (restoredTableData.size() > 0) {\n\n\t\t\t\ttableName = restoredTableData.get(0).getTableStructure().getHTableName();\n\t\t\t\tlistRestoreupAllTablesModel.addElement(tableName);\n\t\t\t\ttableObjects.put(tableName, restoredTableData);\n\t\t\t\tlong rows = (restoredTableData.size() - 1) * 20001 + restoredTableData.get(restoredTableData.size() - 1).getTableData().getHbaseTableData().size();\n\t\t\t\tthis.getLabelFileOperationStatus().setText(\"Status: Completed Reading Files (~\" + rows + \"rows available)\");\n\t\t\t}\n\t\t\telse {\n\t\t\t\tJOptionPane.showMessageDialog(this, \"Nothing to restore\", \"Warning\", JOptionPane.WARNING_MESSAGE);\n\t\t\t}\n\n\t\t}\n\t\tcatch (Exception e) {\n\t\t\tJOptionPane.showMessageDialog(this, \"Failed to find valid rows\", \"Error\", JOptionPane.ERROR_MESSAGE);\n\n\t\t}\n\n\t}", "private void showFileChooser() {\n Intent intent = new Intent();\n intent.setType(\"image/*\");\n intent.setAction(Intent.ACTION_GET_CONTENT);\n startActivityForResult(Intent.createChooser(intent, \"Select Picture\"), 234);\n }", "@Override\r\n\t\t\tpublic void actionPerformed(ActionEvent e) {\n\t\t\t\tJFileChooser jfc=new JFileChooser(); \r\n\t\t jfc.setFileSelectionMode(JFileChooser.FILES_AND_DIRECTORIES ); \r\n\t\t jfc.showDialog(new JLabel(), \"选择\"); \r\n\t\t File file=jfc.getSelectedFile();\r\n\t\t if(null==file){\r\n\t\t \treturn;\r\n\t\t }\r\n\t\t if(file.isDirectory()){\r\n\t\t System.out.println(\"文件夹:\"+file.getAbsolutePath()); \r\n\t\t }else if(file.isFile()){\r\n\t\t System.out.println(\"文件:\"+file.getAbsolutePath()); \r\n\t\t }\r\n\t\t if(Util.isImage(file)){\r\n\t\t \tImageIcon img = new ImageIcon(file.getAbsolutePath());\r\n\t\t\t\t\tlbImage.setIcon(img);\r\n\t\t\t\t\tMain.img = img.getImage();\r\n\t\t }else{\r\n\t\t \tJOptionPane.showMessageDialog(Main.this, \"请选择图片\");\r\n\t\t }\r\n\t\t\t}", "private void jButton2ActionPerformed(java.awt.event.ActionEvent evt) {\n JFileChooser fc = new JFileChooser();\n int result = fc.showDialog(this, \"Attach\");\n if (result == JFileChooser.APPROVE_OPTION) \n {\n selectedFile = fc.getSelectedFile();\n \tjTextField1.setText(selectedFile.getAbsolutePath());\n \n }\n \n }", "private void handleBrowse() {\n\t\tContainerSelectionDialog dialog = new ContainerSelectionDialog(\n\t\t\t\tgetShell(), ResourcesPlugin.getWorkspace().getRoot(), false,\n\t\t\t\t\"Select new file container\");\n\t\tif (dialog.open() == ContainerSelectionDialog.OK) {\n\t\t\tObject[] result = dialog.getResult();\n\t\t\tif (result.length == 1) {\n\t\t\t\tcontainerSourceText.setText(((Path) result[0]).toString());\n\t\t\t}\n\t\t}\n\t}", "@FXML \n\tprivate void handleUserDefinedCH0() throws Exception {\n\t\tif(userDefinedButtonCH0.isSelected()){\n\t\t\t//Open a file chooser\n\t\t\tFileChooser fileChooser = new FileChooser();\n\t\t\t//ÎĵµÀàÐ͹ýÂËÆ÷\n\t\t\tExtensionFilter extFilter = new ExtensionFilter(\"wve files (*.wve)\", \"*.wve\");\n\t\t\tfileChooser.getExtensionFilters().add(extFilter);\n\t\t\tfileChooser.showOpenDialog(mainApp.getPrimaryStage());\n\t\t\t\n\t\t\t//check data\n\t\t}\n\t}", "@Override\n\t\t\tpublic void onClick(DialogInterface dialog, int which) {\n\t\t\t\tfilename = inputText.getText().toString().trim();\n\t\t\t\tnew CaptureTask(context).execute();\n\t\t\t}", "@FXML public void handleImportButton() {\n\t\tSystem.out.println(\"Import Button Clicked!\");\n\t\tFileChooser fileChooser = new FileChooser();\n\t\tfileChooser.getExtensionFilters().addAll(new ExtensionFilter(\"SENTA features selection\", \"*.sfs\"), new ExtensionFilter(\"All files\", \"*.*\"));\n\t\tfileChooser.setTitle(\"Please specify which file you want to import\");\n\t\ttry {\n\t\t\t\tString fileToOpen = fileChooser.showOpenDialog(Main.primaryStage).getPath();\n\t\t\t\tif (ConfirmBox.display(\"Import features configuration?\", \"Are you sure you want to import the selected set of features?\")) {\n\t\t\t\t\tReader.importFeatures(fileToOpen);\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tMain.root = FXMLLoader.load(getClass().getResource(\"/windows/main/SelectBasicFeaturesWindow.fxml\"));\n\t\t\t\tMain.primaryStage.setScene(new Scene(Main.root, 800, 600));\n\t\t\t\tMain.primaryStage.show();\n\t\t\t\t\n\t\t} catch (NullPointerException exepction) {\n\t\t\tSystem.out.println(exepction.getMessage());\n\t\t} catch (IOException e) {\n\t\t\tSystem.out.println(e.getMessage());\n\t\t}\n\t}", "private void showFileChooser() {\n Intent intent = new Intent();\n intent.setType(\"image/*\");\n intent.setAction(Intent.ACTION_GET_CONTENT);\n startActivityForResult(Intent.createChooser(intent, \"Select Picture\"), PICK_IMAGE_REQUEST);\n }", "private void showFileChooser() {\n Intent intent = new Intent();\n intent.setType(\"image/*\");\n intent.setAction(Intent.ACTION_GET_CONTENT);\n startActivityForResult(Intent.createChooser(intent, \"Select Picture\"), PICK_IMAGE_REQUEST);\n }", "@FXML\r\n protected void dialogOpen() throws IOException {\r\n final FileChooser fileChooser = new FileChooser();\r\n File file = fileChooser.showOpenDialog(FracGenApplication.getInstance().stageOpenData);\r\n if (file != null) {\r\n if (file.exists()) {\r\n if (file.getAbsolutePath() != null) {\r\n tfFilename.setText(file.getAbsolutePath());\r\n }\r\n }\r\n }\r\n }", "private void fixFileOption() {\n\t\t\n\t\tnewFileOption.addActionListener(new ActionListener() {\n\t\t\t@Override\n\t\t\tpublic void actionPerformed(ActionEvent e) {\n\t\t\t\tnew CreateFileFrame(main, true , controller);\n\t\t\t}\n\t\t});\n\t\t\n\t\t\n\t\topenFileOption.addActionListener(new ActionListener() {\n\t\t\t@Override\n\t\t\tpublic void actionPerformed(ActionEvent e) {\n\t\t\t\tJFileChooser fileSelector = new JFileChooser();\n\t\t\t\tFileNameExtensionFilter fileFilter = new FileNameExtensionFilter(\"ASM , IN, OUT\", \"asm\", \"in\",\"out\");\n\t\t\t\tfileSelector.setFileFilter(fileFilter);\n\t\t\t\t\n\t\t\t\tint option = fileSelector.showOpenDialog(openFileOption);\n\t\t\t\t\n\t\t\t\tif(option == JFileChooser.APPROVE_OPTION){\n\t\t\t\t\tString path = fileSelector.getSelectedFile().getPath();\n\t\t\t\t\tString extension = path.substring(path.lastIndexOf('.') + 1);\n\t\t\t\t\t\n\t\t\t\t\tif (extension.equalsIgnoreCase(\"in\")) {\n\t\t\t\t\t\tcontroller.changeIn(path);\n\t\t\t\t\t}\n\t\t\t\t\telse if (extension.equalsIgnoreCase(\"out\")) {\n\t\t\t\t\t\tcontroller.changeOut(path);\n\t\t\t\t\t}\n\t\t\t\t\telse if (extension.equalsIgnoreCase(\"asm\")) {\n\t\t\t\t\t\tcontroller.changeProgram(path);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\n\t\t\t}\n\t\t});\n\t\t\n\t\texitOption.addActionListener(new ActionListener(){\n\t\t\tpublic void actionPerformed(ActionEvent arg0){\n\t\t\t\toptionExit();\n\t\t\t}\n\t\t});\n\t}", "private void jCBListFoodActionPerformed(java.awt.event.ActionEvent evt) {\n int aux2 = jCBListFood.getSelectedIndex();\n if (aux2 != -1) {\n filePath = \"C:\\\\PGS\\\\nutricion\\\\\" + jCBListFood.getSelectedItem();\n controller.openDocument(filePath);\n } else {\n filePath = \"\";\n }\n }", "private void showFileChooser() {\n Intent intent = new Intent();\n intent.setType(\"image/*\");\n intent.setAction(Intent.ACTION_GET_CONTENT);\n startActivityForResult(Intent.createChooser(intent, \"Select Picture\"), PICK_IMAGE_REQUEST);\n }", "private void viewFileChooser() {\n try {\n JFileChooser chooser = new JFileChooser();\n chooser.showOpenDialog(null);\n f = chooser.getSelectedFile();\n// this.attachmentName = f.getName();\n// this.attachmentPath = f.getAbsolutePath();//dan mokdda karanna ona// meke file ek \n// txtAttachment.setText(attachmentPath);\n System.out.println(f.getName());\n System.out.println(f.getAbsolutePath());\n \n// Icon icon = new ImageIcon(getClass().getResource(\"/image/file.png\"));\n lblPath.setText(f.getName());\n// lblPath.setIcon(icon);\n lblPath.setVisible(true);\n \n \n } catch (NullPointerException e) {\n \n } \n }", "@Override\n\tpublic void actionPerformed(ActionEvent event)\n\t{\n\t\tif (event.getSource() == selectFileButton)\n\t\t{\n\t\t\t//create a file chooser (only .ali files)\n\t\t\tfinal JFileChooser fc = new JFileChooser();\n\t\t\tFileNameExtensionFilter filter = new FileNameExtensionFilter(\"Storyteller database files\", \"ali\");\n\t\t\tfc.setFileFilter(filter);\n\n\t\t\t//pop it up\n\t\t\tint returnVal = fc.showOpenDialog(this);\n\n\t\t\t//if the user selected a file\n\t\t\tif (returnVal == JFileChooser.APPROVE_OPTION)\n\t\t\t{\n\t\t\t\t//this is the selected file\n\t\t\t\tselectedDatabaseFile = fc.getSelectedFile();\n\t\t\t\tselectedFileLabel.setText(\"Selected DB File: \" + selectedDatabaseFile.getAbsolutePath());\n\n\t\t\t\t//now that there is a db file fill the drop downs\n\t\t\t\tsetUpDropDowns();\n\n\t\t\t\tstartStopServerButton.setEnabled(true);\n\t\t\t}\n\t\t\t//else- they can choose another file later\n\t\t}\n\t\t//the user wants to start or stop the server\n\t\telse if (event.getSource() == startStopServerButton)\n\t\t{\n\t\t\t//if they are starting the server\n\t\t\tif (event.getActionCommand().equals(START_SERVER_BUTTON_TEXT))\n\t\t\t{\n\t\t\t\t//change the text on the button to stop the server\n\t\t\t\tstartStopServerButton.setText(STOP_SERVER_BUTTON_TEXT);\n\n\t\t\t\t//start the server\n\t\t\t\tsetUpServer();\n\t\t\t}\n\t\t\telse\n\t\t\t//stopping the server\n\t\t\t{\n\t\t\t\t//close the server\n\t\t\t\tstopServer();\n\t\t\t\t\n\t\t\t\t//disable the last input\n\t\t\t\tstartStopServerButton.setEnabled(false);\n\t\t\t}\n\t\t}\n\t}", "private void openFile() {\n\t\t\n\t\n\t\t\t\n\t\tFile file = jfc.getSelectedFile();\n\t\tint a = -1;\n\t\tif(file==null&&!jta.getText().equals(\"\"))\n\t\t{\n\t\t\ta = JOptionPane.showConfirmDialog(this, \"저장?\");\n\t\t\n\t\t}\n\t\tswitch (a){\n\t\tcase 0:\n\t\t\ttry {\n\t\t\t\tint c = -1;\n\t\t\t\tif(file==null)\n\t\t\t\t{\n\t\t\t\t\tc = jfc.showSaveDialog(this);\n\t\t\t\t}\n\t\t\t\tif(file!= null || c ==0)\n\t\t\t\t{\t\n\t\t\t\t\tFileWriter fw = new FileWriter(jfc.getSelectedFile());\n\t\t\t\t\tfw.write(jta.getText());\n\t\t\t\t\tfw.close();\n\t\t\t\t\tSystem.out.println(\"파일을 저장하였습니다\");\n\t\t\t\t}\n\t\t\t} catch (Exception e2) {\n\t\t\t\t// TODO: handle exception\n\t\t\t\tSystem.out.println(e2.getMessage());\n\t\t\t}\n\t\tbreak;\n\t\tcase 1:\n\t\t\ttry {\n\t\t\t\tint j=-1;\n\t\t\t\tif(file==null)\n\t\t\t\t{\n\t\t\t\t\tj = jfc.showOpenDialog(this);\n\t\t\t\t}\n\t\t\t\tif(file!= null || j == 1)\n\t\t\t\t{\t\n\t\t\t\t\tFileReader fr = new FileReader(file);\n\n\t\t\t\t\tString str=\"\";\n\t\t\t\t\twhile((j=fr.read())!=-1)\n\t\t\t\t\t{\n\t\t\t\t\t\tstr = str+(char)j;\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\tjta.setText(str);\n\t\t\t\t\t\n\t\t\t\t\tsetTitle(file.getName());\n\t\t\t\t\t\n\t\t\t\t\tfr.close();\n\t\t\t\t}\n\t\t\t}\t\n\t\t\tcatch (Exception e2) {\n\t\t\t\t// TODO: handle exception\n\t\t\t\tSystem.out.println(e2.getMessage());\n\t\t\t}\n\t\t\tbreak;\n\t\t}\n\t\tint d= jfc.showOpenDialog(this);\n\t\t\n\t\tif(d==0)\n\t\t\ttry {\n\t\t\t\tFileReader fr = new FileReader(jfc.getSelectedFile());\n\t\t\t\tint l;\n\t\t\t\tString str=\"\";\n\t\t\t\twhile((l=fr.read())!=-1)\n\t\t\t\t{\n\t\t\t\t\tstr = str+(char)l;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tjta.setText(str);\n\t\t\t\t\n\t\t\t\tfr.close();\n\t\n\t\t\t\t\t\n\t\t\t} catch (Exception e2) {\n\t\t\t\t// TODO: handle exception\n\t\t\t\tSystem.out.println(e2.getMessage());\n\t\t\t}\n\t}", "public void run() {\n UIManager.put(\"swing.boldMetal\", Boolean.FALSE); \n String str = FileChooserDemo.selectFile();\n if (str == null){\n \t\n }else{\n \ttext_field.setText(str);\n }\n }", "@Override\r\n\t protected void onActivityResult(int requestCode, int resultCode, Intent data) {\n\t\t if (resultCode == RESULT_OK) {\r\n\t\t\t if (data != null) {\r\n\t\t\t\t // Get the URI of the selected file\r\n\t\t\t\t uri = data.getData();\r\n\t\t\t\t Log.i(TAG, \"Uri = \" + uri.toString());\r\n\t\t\t\t try {\r\n\t\t\t\t\t // Get the file path from the URI\r\n\t\t\t\t\t final String path = FileUtils.getPath(this, uri);\r\n\t\t\t\t\t Intent intent = new Intent(MainActivity.this, ShowFileActiviy.class);\r\n\t\t\t\t\t intent.putExtra(\"file_path\", path);\r\n\t\t\t\t\t startActivity(intent);\r\n\t\t\t\t } catch (Exception e) {\r\n\t\t\t\t\t Log.e(\"FileSelectorTestActivity\", \"File select error\", e);\r\n\t\t\t\t }\r\n\t\t\t }\r\n\t\t }\r\n\t }", "@Override\n\t\t\tpublic void actionPerformed(ActionEvent ae) {\n\t\t\t\tJFileChooser chooser = new JFileChooser();\n\t\t\t\tFileNameExtensionFilter filter = new FileNameExtensionFilter(\"HALTING Files\", EXT);\n\t\t\t\tchooser.setFileFilter(filter);\n\t\t\t\tint choice = chooser.showOpenDialog(MainWindow.this);\n\t\t\t\tif (choice != JFileChooser.APPROVE_OPTION)\n\t\t\t\t\treturn;\n\t\t\t\t\n\t\t\t\t// attempt to read from file\n\t\t\t\tString filename = chooser.getSelectedFile().getAbsolutePath();\n\t\t\t\ttry {\n\t\t\t\t\treadFromFile(filename);\n\t\t\t\t}\n\t\t\t\t// warn the user about a failure\n\t\t\t\tcatch (Exception e) {\n\t\t\t\t\t\n\t\t\t\t\t// if already a builtin Exception, just report it\n\t\t\t\t\tif (e.getClass().getSimpleName().equals(\"FileError\"))\n\t\t\t\t\t\treportException(e);\n\t\t\t\t\t\t\n\t\t\t\t\t// build an Exception message and report it\n\t\t\t\t\telse {\n\t\t\t\t\t\tString msg = e.getClass().getSimpleName() + \": \";\n\t\t\t\t\t\tmsg += e.getMessage() == null ? filename : e.getMessage();\n\t\t\t\t\t\treportException(new FileError(filename, msg));\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}", "@Override\n\tpublic void actionPerformed(ActionEvent e) {\n\t\tString cmd = e.getActionCommand();\n\t\tFile file;\n\t\tfile = jfc.getSelectedFile();\n\t\tswitch (cmd) {\n\t\tcase \"저장\":\n\t\t\tsaveFile();\n\t\t\tbreak;\n\t\tcase \"열기\":\n\t\t\t\n\t\t\topenFile();\n\t\t\t\n\t\t\tbreak;\n\t\tcase \"새파일\":\n\t\t\tjta.setText(\"\");\n\t\t\tbreak;\n\t\tcase \"종료\":\n\t\t\tSystem.exit(0);\n\t\t\tbreak;\n\t\t}\n\t\t/*if(cmd.equals(\"저장\"))\n\t\t{\n\t\ttry {\n\t\t\tFileWriter fw = new FileWriter(\"c:/output/notepad.txt\");\n\t\t\tfw.write(jta.getText());\n\t\t\tfw.close();\n\t\t\tSystem.out.println(\"파일을 생성하였습니다\");\n\t\t} catch (Exception e2) {\n\t\t\t// TODO: handle exception\n\t\t\tSystem.out.println(e2.getMessage());\n\t\t}\n\t\t}\n\t\t*/\n\t}", "@Override\n public void onClick(View view) {\n if (view == imageView) {\n showFileChooser();\n }\n //if the clicked button is upload\n else if (view == btnPost) {\n uploadFile();\n\n }\n }", "@Override\n public void onClick(View v) {\n switch (v.getId()){\n case R.id.browse_path_button:\n showChooser();\n break;\n }\n }", "@Override\r\n\t\tpublic void actionPerformed(ActionEvent event)\r\n\t\t{\n\t\t\tString filePath = filePathField.getText();\r\n\t\t\tif(filePath.isBlank())\r\n\t\t\t{\r\n\t\t\t\tJOptionPane.showMessageDialog(null, \"Input cannot be blank. Please enter a valid file path.\",\r\n\t\t\t\t\t\t\"Invalid Input\", JOptionPane.ERROR_MESSAGE);\r\n\t\t\t}\r\n\t\t\telse\r\n\t\t\t{\r\n\t\t\t\t// Create file from given filePath and read through it using Scanner.\r\n\t\t\t\tFile file = new File(filePath);\r\n\t\t\t\ttry\r\n\t\t\t\t{\r\n\t\t\t\t\tString fileText = \"\";\r\n\t\t\t\t\t\r\n\t\t\t\t\t// Read contents of file and create string containing all lines of text.\r\n\t\t\t\t\tScanner scan = new Scanner(file);\r\n\t\t\t\t\twhile (scan.hasNextLine())\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tString line = scan.nextLine() + \"\\n\";\r\n\t\t\t\t\t\tfileText += line;\r\n\t\t\t\t\t}\r\n\t\t\t\t\tscan.close();\r\n\t\t\t\t\t\r\n\t\t\t\t\t// Set the text of the text area to the string we just created.\r\n\t\t\t\t\tfilePreviewTextArea.setText(fileText);\r\n\t\t\t\t\t\r\n\t\t\t\t\t// Set the cursor/caret position to the top to fix annoying bug where scroll bar is at bottom\r\n\t\t\t\t\tfilePreviewTextArea.setCaretPosition(0);\r\n\t\t\t\t}\r\n\t\t\t\tcatch(FileNotFoundException e)\r\n\t\t\t\t{\r\n\t\t\t\t\tfilePreviewTextArea.setText(\"Could not open file: \" + file.getPath());\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}", "public void mouseClicked(MouseEvent e) {\n int returnVal = fileChooser.showOpenDialog(FileChooserField.this);\n \t\t \n if (returnVal == JFileChooser.APPROVE_OPTION) {\n File file = fileChooser.getSelectedFile();\n destinationTextField.setText(file.getPath());\n }\n \n destinationTextField.setCaretPosition(destinationTextField.getDocument().getLength());\n }", "public void actionPerformed(final ActionEvent e) {\r\n\t\tFileDialog chooser = new FileDialog(this,\r\n\t\t\t\t\"Use a .png or .jpg extension\", FileDialog.SAVE);\r\n\t\tchooser.setVisible(true);\r\n\t\tif (chooser.getFile() != null) {\r\n\t\t\tsave(chooser.getDirectory() + File.separator + chooser.getFile());\r\n\t\t}\r\n\t}", "@FXML\r\n\tprivate void choisirFichier()\r\n\t{\r\n\t\tFileChooser fileChooser = new FileChooser();\r\n\r\n\t\tfileChooser\r\n\t\t\t\t.setInitialDirectory(new File(System.getProperty(\"user.dir\")));\r\n\t\tFile fichier = fileChooser.showOpenDialog(new Stage());\r\n\r\n\t\tif (fichier != null)\r\n\t\t{\r\n\t\t\ttextFieldFichier.setText(fichier.getPath());\r\n\t\t}\r\n\t}" ]
[ "0.79288673", "0.7595121", "0.7576315", "0.7473494", "0.7441884", "0.7421623", "0.73790914", "0.7367778", "0.73540634", "0.73471", "0.7345575", "0.72822505", "0.7256489", "0.7243895", "0.7229164", "0.71922743", "0.71757853", "0.71725917", "0.7171434", "0.7129604", "0.7116965", "0.7099318", "0.70931995", "0.7069734", "0.7055346", "0.7051636", "0.70353067", "0.70302117", "0.7018912", "0.7015453", "0.70098984", "0.69535404", "0.6946035", "0.6943386", "0.694327", "0.69425946", "0.6932974", "0.69309634", "0.692474", "0.689699", "0.68681204", "0.6861325", "0.68411154", "0.68301415", "0.68240106", "0.6821123", "0.67992556", "0.6795248", "0.6794936", "0.67936075", "0.6791197", "0.67839664", "0.678394", "0.6779639", "0.67780614", "0.67760646", "0.6774357", "0.6765167", "0.67611784", "0.67504823", "0.67369443", "0.6732726", "0.6719774", "0.67195266", "0.67049766", "0.6704766", "0.6696504", "0.66899794", "0.6687694", "0.6646025", "0.66426486", "0.66331035", "0.6631997", "0.66306084", "0.6628731", "0.6620481", "0.6616261", "0.6612783", "0.6597221", "0.659053", "0.6584009", "0.65537345", "0.65537345", "0.6544432", "0.6530945", "0.6521137", "0.6509512", "0.65072715", "0.65060586", "0.65045094", "0.65042824", "0.65033597", "0.6503335", "0.6502617", "0.65012175", "0.6499285", "0.6496174", "0.64925313", "0.6492243", "0.6486423" ]
0.77557194
1
When the translate button is clicked, this code executes.
private void translateBtnActionPerformed(ActionEvent evt) { if(switchBtnState == 1) { assemblyreader = new mipstoc.read.CodeReader(inputTxtArea.getText()); mipstoc.lexer.Lexer lex = new mipstoc.lexer.Lexer(assemblyreader); mipstoc.parser.Parser parser = new mipstoc.parser.Parser(lex); try { parser.program(); outputTxtArea.setText(mipstoc.parser.Parser.output); mipstoc.parser.Parser.output = ""; } catch(Error e) { Toolkit.getDefaultToolkit().beep(); JOptionPane.showMessageDialog(panel, e.toString(), "Error", JOptionPane.ERROR_MESSAGE); } } else { try { ctomips.reader.ReadFile reader = new ctomips.reader.ReadFile(inputTxtArea.getText()); ctomips.lexer.LexInter li = new ctomips.lexer.LexInter(); ctomips.asm.Assembly ass = new ctomips.asm.Assembly(li); ctomips.lexer.Lexer lex = new ctomips.lexer.Lexer(reader); ctomips.parser.Parser parser = new ctomips.parser.Parser(lex, ass); ctomips.inter.Node.labels = 0; ctomips.lexer.Lexer.line = 1; parser.program(); ass.program(); outputTxtArea.setText(ass.assembStr); ctomips.parser.Parser.output = ""; } catch(IOException ie) { } catch(Error e) { Toolkit.getDefaultToolkit().beep(); JOptionPane.showMessageDialog(panel, e.toString(), "Error", JOptionPane.ERROR_MESSAGE); } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\r\n\t\t\tpublic void actionPerformed(ActionEvent e) {\n\t\t\t\tbtTranslate.setEnabled(false);\r\n\t\t\t\tbtTranslate.setText(\"正在翻译..\");\r\n\t\t\t\tString re = Languages.translate(taResult.getText());\r\n\t\t\t\tif(\"\"==re || null==re){\r\n\t\t\t\t\treturn;\r\n\t\t\t\t}\r\n\t\t\t\ttaTranslate.setText(re);\r\n\t\t\t\tbtTranslate.setEnabled(true);\r\n\t\t\t\tbtTranslate.setText(\"翻译\");\r\n\t\t\t}", "private void translate()\r\n\t{\r\n\t\tLocale locale = Locale.getDefault();\r\n\t\t\r\n\t\tString language = locale.getLanguage();\r\n\t\t\r\n\t\ttranslate(language);\r\n\t}", "public void translateText(View view)\n {\n\n Intent i = new Intent(HomeScreen.this, transIt.class);\n startActivity(i);\n\n }", "@Override\n\t\t\tpublic void actionPerformed(ActionEvent arg0) {\n\t\t\t\tTranslater translater = new Translater();\n\t\t\t\t\n\t\t\t\ttry {\n\t\t\t\t\tString data = dataText.getText();\n\t\t\t\t\tString presentes = presentesText.getText();\n\t\t\t\t\tString ausentes = ausentesText.getText();\n\t\t\t\t\tString ausentesJusti = ausentesJustiText.getText();\n\t\t\t\t\tString atrasos = atrasosText.getText();\n\t\t\t\t\tString atrasosJusti = atrasosJustiText.getText();\n\t\t\t\t\tString presidente = presidenteText.getText();\n\t\t\t\t\tString ateiro = ateiroText.getText();\n\t\t\t\t\tString ata = ataMesmo.getText();\n\t\t\t\t\t\n\t\t\t\t\ttranslater.traduzir(data, presentes, ausentes, ausentesJusti, atrasos, atrasosJusti, presidente, ateiro, ata);\n\t\t\t\t} catch (IOException e) {\n\t\t\t\t\te.printStackTrace();\n\t\t\t\t}\n\t\t\t}", "@Action(selectedProperty = TRANSLATION_PAINTING)\r\n public void toggleTranslations (ActionEvent e)\r\n {\r\n }", "@Override\n\t\t\tpublic void onClick(View arg0) {\n\t\t\t\tAnimation alpha=AnimationUtils.loadAnimation(MainActivity.this,\n\t\t\t\t\t\tR.anim.translate_animation);\n\t\t\t\ttv.startAnimation(alpha);\n\t\t\t}", "public void goTranslate(View view)\n {\n Intent startIntent = new Intent(help.this, wordPageActivity.class);\n startActivity(startIntent);\n }", "private void langBtnActionPerformed(ActionEvent evt) {\n }", "private void onTranslationClick() {\n Animator animator = AnimatorInflater.loadAnimator(getActivity(), R.animator.translation);\r\n animator.setTarget(animatedView);\r\n animator.start();\r\n }", "public TranslateButton() {\n this.posX = 0;\n this.posY = 0;\n this.width = 0;\n this.height = 0;\n translateButton = new JButton();\n }", "@Override\n\t\t\t\t\t\tpublic void onClick(View arg0) {\n\t\t\t\t\t\t\tmCurriculumVitaeInterface.onAddLanguage();\n\t\t\t\t\t\t}", "@Override\n protected void translateFields(View view, String languageString) {\n Context context = view.getContext();\n ((TextView) view.findViewById(R.id.first_page_text_title))\n .setText(LanguageManager.Intro.getTextTitle(context, languageString));\n ((TextView) view.findViewById(R.id.first_page_text))\n .setText(LanguageManager.Intro.getText(context, languageString));\n ((Button) view.findViewById(R.id.first_page_test_button))\n .setText(LanguageManager.Intro.getButtonText(context, languageString));\n }", "void onTranslation(Sentence sentence);", "void TranslateToTurkish() {\n // Check wheter the device language is English\n if(Locale.getDefault().getDisplayLanguage() == \"en\"){ // Don't do anything if it is English\n }\n else { // Translate to device language (For now just Turkish)\n final Handler textViewHandler = new Handler();\n new AsyncTask<Void, Void, Void>() {\n @Override\n protected Void doInBackground(Void... params) {\n TranslateOptions options = TranslateOptions.newBuilder()\n .setApiKey(googleApiKey)\n .build();\n Translate translate = options.getService();\n final Translation translation =\n translate.translate(textToSpeechInputText,\n Translate.TranslateOption.targetLanguage(\"tr\"));\n textViewHandler.post(new Runnable() {\n @Override\n public void run() {\n Log.d(\"Translated text:\", translation.getTranslatedText().toString());\n textToSpeechInputText = translation.getTranslatedText().toString();\n Log.d(\"Output\", textToSpeechInputText);\n //Speak of the result\n Speak(textToSpeechInputText);\n state = 2; // Turn state to speaking the result\n }\n });\n return null;\n }\n }.execute();\n }\n }", "@Override\n public void updateLanguage() {\n if (isEnglish) {\n languageButton.setText(R.string.alien_painter_language_chinese);\n exitButton.setText(R.string.alien_painter_exit);\n retryButton.setText(R.string.alien_painter_retry);\n scoreboardButton.setText(R.string.alien_painter_scoreboard_button);\n painterTextViewInstructions.setText(R.string.alien_painter_instructions);\n replayButton.setText(R.string.alien_painter_replay);\n } else {\n languageButton.setText(R.string.alien_painter_language_english);\n exitButton.setText(R.string.alien_painter_exit_chinese);\n retryButton.setText(R.string.alien_painter_retry_chinese);\n scoreboardButton.setText(R.string.alien_painter_scoreboard_button_chinese);\n painterTextViewInstructions.setText(R.string.alien_painter_instructions_chinese);\n replayButton.setText(R.string.alien_painter_replay_chinese);\n }\n }", "@FXML\n\tprivate void sendTranslationEventHandler(ActionEvent event) {\n\t\ttestChoiceAnswer();\n\t}", "public void updateLanguage() {\n buttonPlay.setText(GameConfiguration.getText(\"playButton\"));\n buttonSettings.setText(GameConfiguration.getText(\"settingsButton\"));\n buttonHighScores.setText(GameConfiguration.getText(\"highScores\"));\n }", "ILoLoString translate();", "public void setLanguageEnglishButtonText(String text) {\n/*Generated! Do not modify!*/ replyDTO.getVariablesToSet().add(\"overviewSmall_languageEnglishButton_propertyText\");\n/*Generated! Do not modify!*/ if (text == null) {\n/*Generated! Do not modify!*/ replyDTO.getVariableValues().remove(\"overviewSmall_languageEnglishButton_propertyText\");\n/*Generated! Do not modify!*/ } else {\n/*Generated! Do not modify!*/ replyDTO.getVariableValues().put(\"overviewSmall_languageEnglishButton_propertyText\", text);\n/*Generated! Do not modify!*/ }\n/*Generated! Do not modify!*/ if (recordMode){\n/*Generated! Do not modify!*/ addRecordedAction(\"setLanguageEnglishButtonText(\" + escapeString(text) + \");\");\n/*Generated! Do not modify!*/ }\n/*Generated! Do not modify!*/ }", "@Override\n public void onClick(View view) {\n // Create a new intent to open the {@link PhrasesActivity}\n showChangeLanguageDialog();\n }", "public void onClick(View v) {\n\t\t\t\tLog.d(\"on\", \"274\");\n\t\t\t\tIntent smsIntent = new Intent(Intent.ACTION_VIEW);\n\t\t\t\tsmsIntent.setType(\"vnd.android-dir/mms-sms\");\n\t\t\t\tsmsIntent.putExtra(\"sms_body\", translatedText);\n\t\t\t\tstartActivity(smsIntent);\n\n\t\t\t}", "public void setTranslate (String File,String Close, String German, String English, String Settings, String Language)\n\t{\n\t\t fileMenu.setText(File);\n\t\t settingsMenu.setText(Settings);\n\t\t menuItem.setText(Close);\n\t\t menuItemEnglish.setText(English);\n\t\t menuItemGerman.setText(German);\n\t\t settingsSubMenu.setText(Language);\n\t\t \n\t}", "String translate(String text, String fromLanguage, String toLanguage) throws TranslationException;", "public void translate(int i, int j) {\n\t\t\n\t}", "private void updateLabel() {\n\t\tString translation = lp.getString(key);\n\t\tsetText(translation);\n\n\t}", "@SuppressWarnings(\"unchecked\")\n // <editor-fold defaultstate=\"collapsed\" desc=\"Generated Code\">//GEN-BEGIN:initComponents\n private void initComponents() {\n\n word = new javax.swing.JTextField();\n from = new javax.swing.JTextField();\n translateTo = new javax.swing.JTextField();\n translate = new javax.swing.JButton();\n output = new javax.swing.JTextField();\n jL = new javax.swing.JLabel();\n jL1 = new javax.swing.JLabel();\n jL2 = new javax.swing.JLabel();\n clear = new javax.swing.JButton();\n\n setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);\n\n word.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n wordActionPerformed(evt);\n }\n });\n\n translate.setText(\"Translate\");\n translate.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n translateActionPerformed(evt);\n }\n });\n\n jL.setText(\"Word:\");\n\n jL1.setText(\"From:\");\n\n jL2.setText(\"Translate to:\");\n\n clear.setText(\"Clear\");\n clear.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n clearActionPerformed(evt);\n }\n });\n\n javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());\n getContentPane().setLayout(layout);\n layout.setHorizontalGroup(\n layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(layout.createSequentialGroup()\n .addGap(19, 19, 19)\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)\n .addGroup(layout.createSequentialGroup()\n .addComponent(output, javax.swing.GroupLayout.PREFERRED_SIZE, 221, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))\n .addGroup(layout.createSequentialGroup()\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()\n .addComponent(word, javax.swing.GroupLayout.PREFERRED_SIZE, 95, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED))\n .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()\n .addComponent(jL)\n .addGap(67, 67, 67)))\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addComponent(from, javax.swing.GroupLayout.PREFERRED_SIZE, 85, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addComponent(jL1))\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addComponent(jL2)\n .addComponent(translateTo, javax.swing.GroupLayout.PREFERRED_SIZE, 99, javax.swing.GroupLayout.PREFERRED_SIZE))\n .addGap(90, 90, 90))))\n .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()\n .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()\n .addComponent(translate)\n .addGap(16, 16, 16))\n .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()\n .addComponent(clear)\n .addGap(40, 40, 40))))\n );\n layout.setVerticalGroup(\n layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(layout.createSequentialGroup()\n .addGap(55, 55, 55)\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)\n .addComponent(jL)\n .addComponent(jL1)\n .addComponent(jL2))\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)\n .addComponent(word, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addComponent(from, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addComponent(translateTo, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)\n .addComponent(translate)\n .addGap(18, 18, 18)\n .addComponent(output, javax.swing.GroupLayout.PREFERRED_SIZE, 60, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)\n .addComponent(clear)\n .addContainerGap(33, Short.MAX_VALUE))\n );\n\n pack();\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 run() {\r\n _btnPreviewStop.setText(\"Preview\"); // I18N\r\n }", "@Override\r\n\t\t\t\tpublic void actionPerformed(ActionEvent e) {\n\t\t\t\t\t_translateX += _deltaX;\r\n\t\t\t\t\tlayoutContainer(_container);\r\n\t\t\t\t}", "public void doLocalization() {\r\n\t\tdoLocalization(0);\r\n\t\t//do localization like it's in the corner 0\r\n\t\tnavigation.turnTo(0);\r\n\t}", "@FXML\r\n void englishSelected(ActionEvent event)\r\n {\r\n \t\r\n }", "@Override\n public void translate(double x, double y, double z) {\n GL11.glTranslated(x, y, z);\n }", "void translate(Sentence sentence);", "public void translate(int x, int y);", "public void onClick(View v) {\n \n \tTitleBarManager.toggleLanguage_SelectMenu(); // change language of menu\n \tloadOrderBoard(); // Update language of ordered list\n }", "public void translate(int x, int y)\r\n\t{\r\n\t\t// g.translate(x,y);\r\n\t\t// System.err.println(\"not translate int x: \" + x + \" y:\" + y );\r\n\t}", "@Override\n public void onClick(View v) {\n isEnglish = !isEnglish;\n updateLanguage();\n updateStats();\n }", "@Override\n public void setTranslation(String translation) {\n }", "@Override\n\t\t\tpublic void onClick(View v) {\n\t\t\t\tsetLocale(\"jp\");\n\t\t\t}", "public void setLanguageGermanButtonText(String text) {\n/*Generated! Do not modify!*/ replyDTO.getVariablesToSet().add(\"overviewSmall_languageGermanButton_propertyText\");\n/*Generated! Do not modify!*/ if (text == null) {\n/*Generated! Do not modify!*/ replyDTO.getVariableValues().remove(\"overviewSmall_languageGermanButton_propertyText\");\n/*Generated! Do not modify!*/ } else {\n/*Generated! Do not modify!*/ replyDTO.getVariableValues().put(\"overviewSmall_languageGermanButton_propertyText\", text);\n/*Generated! Do not modify!*/ }\n/*Generated! Do not modify!*/ if (recordMode){\n/*Generated! Do not modify!*/ addRecordedAction(\"setLanguageGermanButtonText(\" + escapeString(text) + \");\");\n/*Generated! Do not modify!*/ }\n/*Generated! Do not modify!*/ }", "public int acceptTranslation()\n\t{\n\t\t// get the current translations\n\t\tString translation = this.altTargetWindow.getText();\n\t\tif (translation.equals(\"\"))\n\t\t\treturn SWT.NO;\n\t\treturn this.xliffEditorWindow.setTranslation(this.xliffEditorWindow.getIOldSegmentPosition(), translation, true);\n\t}", "public boolean isTranslateAble() {\n \treturn model.isTranslateAble();\n }", "private void checkButtonTranslate(Button button)\r\n {\r\n int[] loc = new int[2];\r\n button.getLocationOnScreen(loc);\r\n int y = loc[1];\r\n\r\n if (y > 1200) {\r\n //Toast.makeText(getApplicationContext(),\"EXCEDDED! \" + y, Toast.LENGTH_SHORT).show();\r\n updateQuestion();\r\n }\r\n }", "@Override\n\tpublic void execute() {\n\t\ttry {\n\t\t\tProperties properties\t = new Properties();\n\t\t\tClassLoader classLoader = Thread.currentThread().getContextClassLoader();\n\t\t\tInputStream propertiesFile = classLoader.getResourceAsStream(\"languages/language_\" + lang + \".properties\");\n\t\t\tproperties.load(propertiesFile);\n\t\t\tResultSearchFrame rsf = new ResultSearchFrame(properties.getProperty(\"view_search_result\") , dto.getRootNode() , dto.getSessionId() , dto.getSearchName() , wordManagerFrame.getTransmitter() , lang);\n\t\t\trsf.showWindows();\n\t\t\tpropertiesFile.close();\n\t\t} catch (Exception e) {\n\t\t\tlogger.fatal(\"Problem to load languages\" , e);\n\t\t}\n\t\t\n\t}", "@Override\n public void onClick(View v) {\n Button tword = (Button) v.findViewById(R.id.tvWord);\n String valueToFind = tword.getText().toString().replace(\"Ver más de: \",\"\");\n Intent allWords = new Intent((MainActivity) context, AllWordsActivity.class);\n allWords.putExtra(\"wordtf\", valueToFind);\n allWords.putExtra(\"olanguage\", originalLanguaje);\n context.startActivity(allWords);\n\n }", "public void translate() {\n for (Ball b: balls) {\n b.translate(balls);\n }\n }", "@FXML\r\n private void handleAboutUs(ActionEvent event) throws Exception{\n Main.replaceSceneContent(\"AdvanceCalculator.fxml\",\"AdvanceCalculator.css\");\r\n \r\n // getLocaleText();\r\n }", "public void applyI18n(){\r\n // Start autogenerated code ----------------------\r\n jButton1.setText(I18n.getString(\"passwordDialog.button1\",\"Ok\"));\r\n jButton2.setText(I18n.getString(\"passwordDialog.button2\",\"Cancel\"));\r\n jLabel2.setText(I18n.getString(\"passwordDialog.label2\",\"Password\"));\r\n // End autogenerated code ----------------------\r\n this.setTitle(I18n.getString(\"passwordDialog.title\",\"Database password\"));\r\n jButton1.setMnemonic(I18n.getString(\"passwordDialog.button1Mnemonic\",\"o\").charAt(0));\r\n jButton2.setMnemonic(I18n.getString(\"passwordDialog.button2Mnemonic\",\"c\").charAt(0));\r\n }", "private void refreshLayout(PMTranslate translate) {\n if (translate.GetPMCoorTransMethod() == ECoorTransMethod.enNull) {\n this._Dialog.findViewById(R.id.ll_translateParams).setVisibility(8);\n return;\n }\n this._Dialog.findViewById(R.id.ll_translateParams).setVisibility(0);\n if (translate.GetPMCoorTransMethod() == ECoorTransMethod.enXYZMove) {\n this._Dialog.findViewById(R.id.ll_translate_param_move).setVisibility(0);\n this._Dialog.findViewById(R.id.translate_param_3).setVisibility(8);\n this._Dialog.findViewById(R.id.translate_param_4).setVisibility(8);\n this._Dialog.findViewById(R.id.translate_param_7).setVisibility(8);\n Common.SetEditTextValueOnID(this._Dialog, R.id.ppmove_p1, String.valueOf(translate.getBiasX()));\n Common.SetEditTextValueOnID(this._Dialog, R.id.ppmove_p2, String.valueOf(translate.getBiasY()));\n Common.SetEditTextValueOnID(this._Dialog, R.id.ppmove_p3, String.valueOf(translate.getBiasZ()));\n } else if (translate.GetPMCoorTransMethod() == ECoorTransMethod.enThreePara) {\n this._Dialog.findViewById(R.id.ll_translate_param_move).setVisibility(8);\n this._Dialog.findViewById(R.id.translate_param_3).setVisibility(0);\n this._Dialog.findViewById(R.id.translate_param_4).setVisibility(8);\n this._Dialog.findViewById(R.id.translate_param_7).setVisibility(8);\n this._Dialog.findViewById(R.id.ll_translate3_extend).setVisibility(8);\n Common.SetEditTextValueOnID(this._Dialog, R.id.pp3_p1, String.valueOf(translate.GetTransToP31()));\n Common.SetEditTextValueOnID(this._Dialog, R.id.pp3_p2, String.valueOf(translate.GetTransToP32()));\n Common.SetEditTextValueOnID(this._Dialog, R.id.pp3_p3, String.valueOf(translate.GetTransToP33()));\n } else if (translate.GetPMCoorTransMethod() == ECoorTransMethod.enFourPara) {\n this._Dialog.findViewById(R.id.ll_translate_param_move).setVisibility(8);\n this._Dialog.findViewById(R.id.translate_param_3).setVisibility(8);\n this._Dialog.findViewById(R.id.translate_param_4).setVisibility(0);\n this._Dialog.findViewById(R.id.translate_param_7).setVisibility(8);\n Common.SetEditTextValueOnID(this._Dialog, R.id.pp4_p1, String.valueOf(translate.GetTransToP41()));\n Common.SetEditTextValueOnID(this._Dialog, R.id.pp4_p2, String.valueOf(translate.GetTransToP42()));\n Common.SetEditTextValueOnID(this._Dialog, R.id.pp4_p3, String.valueOf(translate.GetTransToP43()));\n Common.SetEditTextValueOnID(this._Dialog, R.id.pp4_p4, String.valueOf(translate.GetTransToP44()));\n } else if (translate.GetPMCoorTransMethod() == ECoorTransMethod.enServenPara) {\n this._Dialog.findViewById(R.id.ll_translate_param_move).setVisibility(8);\n this._Dialog.findViewById(R.id.translate_param_3).setVisibility(8);\n this._Dialog.findViewById(R.id.translate_param_4).setVisibility(8);\n this._Dialog.findViewById(R.id.translate_param_7).setVisibility(0);\n Common.SetEditTextValueOnID(this._Dialog, R.id.pp7_p1, String.valueOf(translate.GetTransToP71()));\n Common.SetEditTextValueOnID(this._Dialog, R.id.pp7_p2, String.valueOf(translate.GetTransToP72()));\n Common.SetEditTextValueOnID(this._Dialog, R.id.pp7_p3, String.valueOf(translate.GetTransToP73()));\n Common.SetEditTextValueOnID(this._Dialog, R.id.pp7_p4, String.valueOf(translate.GetTransToP74()));\n Common.SetEditTextValueOnID(this._Dialog, R.id.pp7_p5, String.valueOf(translate.GetTransToP75()));\n Common.SetEditTextValueOnID(this._Dialog, R.id.pp7_p6, String.valueOf(translate.GetTransToP76()));\n Common.SetEditTextValueOnID(this._Dialog, R.id.pp7_p7, String.valueOf(translate.GetTransToP77()));\n }\n }", "public void translate(int x, int y){\n a.translate(x, y);\n b.translate(x, y);\n c.translate(x, y);\n }", "public void translate(float theX, float theY) {\n\t}", "abstract void translate(double x, double y, double z);", "public ActionListener getTranslationBasListener() {\r\n\t\treturn new ActionListener() {\r\n\t\t\t\r\n\t\t\t@Override\r\n\t\t\tpublic void actionPerformed(ActionEvent arg0) {\r\n\t\t\t\tit.increaseTransY();\r\n\t\t\t}\r\n\t\t};\r\n\t}", "@Override\n\t\t\tpublic void onClick(View v) {\n\t\t\t\tsetLocale(\"en\");\n\t\t\t}", "public void actionPerformed(ActionEvent arg0) { // Receives an action event so it can carry out the stuff inside it\n\t\t\t\tFileManager read_2 = new FileManager(\"Z:\\\\Java\\\\R\\\\src\\\\Example1.txt\");\n\t\t \t\tread_2.connectToFile();\n\t\t \t\tArrayList<String> fileRead = read_2.readFile();\n\t\t \t\tread_2.closeReadFile();\n\t\t\t\tFindLan t3 = new FindLan(fileRead);\n\t \t\t \tString lang = t3.cLang();\n\t \t\t \ttextField.setText(lang);\n\t\t\t}", "public abstract WordEntry manualTranslate(String text, String from, String to);", "public void translate() {\n\t\twhile (!inputBuffer.endOfBuffer()) {\n\t\t\tMsgChar get = inputBuffer.getChar();\n\t\t\tif (get == null) continue;\n\t\t\tif (inputBuffer.isEndOfSentence()) {\n\t\t\t\toutputBuffer.markEndOfSentence();\n\t\t\t} else if (inputBuffer.isEndOfWord()) {\n\t\t\t\toutputBuffer.markEndOfWord();\n\t\t\t} else {\n\t\t\t\toutputBuffer.putChar(get.convert());\n\t\t\t}\n\t\t}\n\t\tinputBuffer.getReader().close();\n\t\toutputBuffer.close();\n\t}", "public SimulationViewButton(String words, String language) {\n myResources = ResourceBundle.getBundle(DEFAULT_RESOURCE_PACKAGE + \"English\");\n font = myResources.getString(\"FontStylePath\");\n setText(words);\n setButtonTextFont();\n setPrefHeight(BUTTON_HEIGHT);//45\n setPrefWidth(BUTTON_WIDTH);//190\n setStyle(font);\n mouseUpdateListener();\n }", "public void refreshLanguage() {\n\t\tbutton.setText(\"<html><p>\"+Translation.SEARCH.getTranslation(PropertiesWorker.language)+\"</p></html>\");\n\t\trefresh.setText(\"<html><p>\"+Translation.REFRESH.getTranslation(PropertiesWorker.language)+\"</p></html>\");\n\t}", "@Override\n\t\t\tpublic void onClick(View v) {\n\t\t\t\tsetLocale(\"vi\");\n\t\t\t}", "public void textbutton_clicked(View v) {\n \t\tIntent intent = new Intent(this, TextcraftActivity.class);\n \t\t\n \t\tBundle bundle =new Bundle();\n \t\tbundle.putStringArray(\"test bundle\", new String[]{\"Hello\", \"World\"});\n \t\t\n \t\tintent.putExtras(bundle);\n \t\t\n \t\t// We use startActivityForResult so that when the textcraft activity finishes, we can detect\n \t\t// WHAT finished and get back specialized results\n\t\tstartActivityForResult(intent, TEXTCRAFT_REQCODE);\n\t\toverridePendingTransition(R.anim.fade_in, R.anim.fade_out);\n \t}", "public void addMouseListener(ParagraphTranslateGUI app) {\n translateButton.addMouseListener(new MouseListener() {\n @Override\n public void mouseClicked(MouseEvent e) {\n String targetText = app.getTargetText();\n String explainText = app.getGGTranslate(targetText);\n app.setExplainAreaText(explainText);\n }\n\n @Override\n public void mousePressed(MouseEvent e) {\n\n }\n\n @Override\n public void mouseReleased(MouseEvent e) {\n\n }\n\n @Override\n public void mouseEntered(MouseEvent e) {\n\n }\n\n @Override\n public void mouseExited(MouseEvent e) {\n\n }\n });\n }", "public void UpdateLang() {\n for (ParamButton selected : this.mBtnLang) {\n selected.setSelected(false);\n }\n int lang = FtSet.GetLangDef();\n if (lang < 0 || lang >= this.mBtnLang.length) {\n this.mBtnLang[0].setSelected(true);\n } else {\n this.mBtnLang[lang].setSelected(true);\n }\n }", "public abstract WordEntry autoTranslate(String text, String to);", "public ILoLoString translate() {\n return this.ribosome(new MtLoString(), new MtLoLoString(), false); \n }", "JButton createTranslateButton(ParagraphTranslateGUI app) {\n ImageIcon translateIcon = new ImageIcon(\"resources/TranslateButton.png\");\n translateButton = new JButton(resizeIcon(translateIcon, this.width, this.height));\n translateButton.setBounds(this.posX, this.posY, this.width, this.height);\n\n addMouseListener(app);\n\n return translateButton;\n }", "public void switchToCountry()\n {\n questionLabel.setText(currentQuestion.getQuestion());\n d.setVisible(true);\n atQuestionStage=true;\n mapImageLabel.setVisible(false);\n a.setText(\"A\");\n b.setText(\"B\");\n c.setText(\"C\");\n a.setBounds(380,220,a.getPreferredSize().height+20,30);\n b.setBounds(500,220,b.getPreferredSize().height+20,30);\n c.setBounds(380,320,c.getPreferredSize().height+20,30);\n d.setBounds(500,320,d.getPreferredSize().height+20,30);\n questionLabel.setBounds(380,100,600,100);\n revalidate();\n }", "public void displayTranslated(float x, float y, float angleDegrees) {\n /*\n pushMatrix();\n translate(x, y);\n popMatrix();\n xCord = (int)x;\n yCord = (int)y;\n pushMatrix();\n translate(x, y);\n rotate(radians(angleDegrees));\n popMatrix();\n shape(fullCar);\n */\n pushMatrix();\n translate(x, y);\n rotate(radians(angleDegrees));\n shape(fullCar);\n popMatrix();\n xCord = (int)x;\n yCord = (int)y;\n }", "public ActionListener getTranslationDroiteListener() {\r\n\t\treturn new ActionListener() {\r\n\t\t\t\r\n\t\t\t@Override\r\n\t\t\tpublic void actionPerformed(ActionEvent arg0) {\r\n\t\t\t\tit.increaseTransX();\r\n\t\t\t}\r\n\t\t};\r\n\t}", "public void actionPerformed(java.awt.event.ActionEvent evt) {\n if (evt.getSource() == btnConvert) {\n MainWindowAlt.this.btnConvertActionPerformed(evt);\n }\n else if (evt.getSource() == btnExit) {\n MainWindowAlt.this.btnExitActionPerformed(evt);\n }\n }", "@Override\n\tpublic void onClick(View v) {\n\t\tswitch (v.getId()){\n\t\tcase (R.id.ibNewMes):\n\t\t\tIntent i = new Intent(this,RTranslation.class);\n\t\t\tstartActivity(i);\n\t\t}\n\t}", "@Override\n\t\t\tpublic void actionPerformed(ActionEvent arg0) {\n\t\t\t\tencriptar();\n\t\t\t}", "public ActionListener getTranslationGaucheListener() {\r\n\t\treturn new ActionListener() {\r\n\t\t\t\r\n\t\t\t@Override\r\n\t\t\tpublic void actionPerformed(ActionEvent arg0) {\r\n\t\t\t\tit.decreaseTransX();\r\n\t\t\t\t\r\n\t\t\t}\r\n\t\t};\r\n\t}", "public static String translate(String label) {\n return getSession().translate(label);\n }", "private JButton getBok() {\n if( Bok == null ) {\n Bok = new JButton();\n Bok.setText(\"Ok\");\n Bok.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent e) {\n ComboBoxEntry cbe;\n cbe = (ComboBoxEntry) getCBoxSourceLanguage().getSelectedItem();\n String sourceLanguageName = cbe.getLocale().getLanguage();\n boolean isSourceExternal = cbe.isExternal();\n \n cbe = (ComboBoxEntry) getCBoxTargetLanguage().getSelectedItem();\n String targetLanguageName = cbe.getLocale().getLanguage();\n boolean isTargetExternal = cbe.isExternal();\n boolean isTargetNew = cbe.isNew();\n \n startTranslation(\n sourceLanguageName, \n isSourceExternal, \n targetLanguageName,\n isTargetExternal,\n isTargetNew);\n }\n });\n }\n return Bok;\n }", "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 }", "@Override\n public void onClick(View v) {\n if (getAdapterPosition() == RecyclerView.NO_POSITION) return;\n\n // Updating old as well as new positions\n notifyItemChanged(focusedItem);\n focusedItem = getAdapterPosition();\n notifyItemChanged(focusedItem);\n\n speak(english.getText().toString(), Locale.ENGLISH);\n final Handler handler = new Handler();\n handler.postDelayed(new Runnable() {\n @Override\n public void run() {\n speak(french.getText().toString(), Locale.ENGLISH);\n }\n }, 2000);\n }", "@Override\n public void setText(String englishText) {\n\n }", "public ActionListener getTranslationHautListener() {\r\n\t\treturn new ActionListener() {\r\n\t\t\t\r\n\t\t\t@Override\r\n\t\t\tpublic void actionPerformed(ActionEvent e) {\r\n\t\t\t\tit.decreaseTransY();\r\n\t\t\t}\r\n\t\t};\r\n\t}", "private void translate()\r\n {\r\n for(int x = 0;x<14;x++)\r\n {\r\n pack.add(new Card(sPack.get(x)));\r\n }\r\n \r\n }", "public void translate(Point p){\n a.translate(p);\n b.translate(p);\n c.translate(p);\n }", "@Override\n\t\t\tpublic void onClick(View v) {\n\t\t\t\tIntent intent = new Intent(\n\t\t\t\t\t\tRecognizerIntent.ACTION_RECOGNIZE_SPEECH);\n\n\t\t\t\tintent.putExtra(RecognizerIntent.EXTRA_LANGUAGE_MODEL, \"en-US\");\n\n\t\t\t\ttry {\n\t\t\t\t\tstartActivityForResult(intent, RESULT_SPEECH);\n\t\t\t\t\tet1.setText(\"\");\n\t\t\t\t} catch (ActivityNotFoundException a) {\n\t\t\t\t\tToast t = Toast.makeText(getApplicationContext(),\n\t\t\t\t\t\t\t\"Opps! Your device doesn't support Speech to Text\",\n\t\t\t\t\t\t\tToast.LENGTH_SHORT);\n\t\t\t\t\tt.show();\n\t\t\t\t}\n\t\t\t\t\n\n\t\t\t}", "@Override\n\t\t\tpublic void buttonClick(ClickEvent event) {\n\t\t\t\t\n\t\t\t\t\n\t\t\t\tUI.getCurrent().getNavigator().navigateTo(\"CliPantallaBusquedaExpedientes\");\t \n\t\t\t}", "@FXML\n private void btnNederlandsOnAction(ActionEvent event) {\n \n locale = new Locale(\"\");\n \n }", "void onLanguageSelected();", "private void setLanguageScreen(){\n\t\t\n\t\tscreenUI.clearScreen();\n\t\tscreenUI.drawText(2, 1, \"Choose a language/Wybierz język:\");\n\t\tscreenUI.drawText(1, 3, \"[a]: English\");\n\t\tscreenUI.drawText(1, 4, \"[b]: Polski\");\n\t}", "@Override\n\t\t\tpublic void onClick(View v) {\n\t\t\t\tString text = \"\";\n\t\t\t\tif(cb_VN.isChecked()) {\n\t\t\t\t\ttext = \"vn\";\n\t\t\t\t} else {\n\t\t\t\t\ttext = \"en\";\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tsettings = getSharedPreferences(\"language\", MODE_WORLD_WRITEABLE);\n\t\t\t\teditor = settings.edit();\n\t\t\t\teditor.putString(\"language\", text);\n\t\t\t\teditor.commit();\n\t\t\t\t\n\t\t\t\tIntent intent = new Intent(Activity_ChangeLanguage.this, TabpageActivity.class);\n\t\t\t\tstartActivity(intent);\n\t\t\t\tSystem.exit(0);\n\t\t\t\t\n\t\t\t\tonBackPressed();\n\t\t\t}", "public void applyI18n(){\r\n // Start autogenerated code ----------------------\r\n jButton1.setText(I18n.getString(\"oracleOptions.button1\",\"Save\"));\r\n jButton2.setText(I18n.getString(\"oracleOptions.button2\",\"Cancel\"));\r\n jLabel1.setText(I18n.getString(\"oracleOptions.label1\",\"Language\"));\r\n jLabel2.setText(I18n.getString(\"oracleOptions.label2\",\"Territory\"));\r\n // End autogenerated code ----------------------\r\n ((javax.swing.border.TitledBorder)jPanel1.getBorder()).setTitle(I18n.getString(\"oracleOptions.panelBorder.OracleOptions\",\"OracleOptions\") );\r\n }", "public void translate( Vector3f t )\n\t{\n\t\tMatrix4f opMat = new Matrix4f();\n\t\topMat.set( t );\n\t\tmat.mul( opMat );\n\t}", "@Override\n\tvoid setupAction() {\n\n\t\tgetButton().setOnAction(event -> {\n\t\t\tmainPrevCommandBox.addText(mainTextInput.getText());\n\t\t\tfor (Turtle t : getThisTurtleList()) {\n\n\t\t\t\tlanguage = ((LanguageCombo) mainLanguageComboBox).getLanguage();\n\t\t\t\tCommand test = new Command(mainTextInput.getText(), t, variableMap, userCommandMap, language);\n\t\t\t\ttest.execute();\n\n\t\t\t}\n\t\t\tmainVarTable.updateVars(variableMap);\n\t\t\tmainFuncTable.updateCommandFuncs(userCommandMap);\n\t\t\tmainTurtleTable.updateValues();\n\n\t\t\tmainTextInput.clear();\n\n\t\t});\n\t}", "@Override\n\tpublic void onClick() {\n\t\tSystem.out.println(\"전화를 겁니다\");\n\t}", "public MouseListener getTranslationListener(){\r\n\t\treturn new MouseListener() {\r\n\t\t\t\r\n\t\t\t@Override\r\n\t\t\tpublic void mouseReleased(MouseEvent e) {\r\n\t\t\t\t// TODO Auto-generated method stub\r\n\t\t\t\t\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t@Override\r\n\t\t\tpublic void mousePressed(MouseEvent e) {\r\n\t\t\t\r\n\t\t\t\tif(e.getButton() == MouseEvent.BUTTON1){\r\n\t\t\t\t\tok =true;\r\n\t\t\t\t}else if(e.getButton() == MouseEvent.BUTTON3){\r\n\t\t\t\t\tok = false;\r\n\t\t\t\t}\r\n\t\t\t\tit.setPosXY(e.getX(), e.getY());\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t@Override\r\n\t\t\tpublic void mouseExited(MouseEvent e) {\r\n\t\t\t\t// TODO Auto-generated method stub\r\n\t\t\t\t\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t@Override\r\n\t\t\tpublic void mouseEntered(MouseEvent e) {\r\n\t\t\t\t// TODO Auto-generated method stub\r\n\t\t\t\t\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t@Override\r\n\t\t\tpublic void mouseClicked(MouseEvent e) {\r\n\t\t\t\t// TODO Auto-generated method stub\r\n\t\t\t\t\r\n\t\t\t}\r\n\t\t};\r\n\t}", "@Override\n\t\t\tpublic void actionPerformed(ActionEvent e) {\n\t\t\t\ttext.setText(ok.getText());\n\t\t\t}", "public static void clickIntertnational() {\n try {\n AppiumDriver<MobileElement> driver = getAppiumDriver();\n waitToElement(\"// android.widget.TextView[@text='International']\");\n MobileElement internationalBTN = driver.findElementByXPath(\"// android.widget.TextView[@text='International']\");\n internationalBTN.click();\n } catch (Exception e) {\n ReportHelper.logReportStatus(LogStatus.FAIL, \"unable to click International transfer button\" + e.getMessage());\n }\n }", "public void translate(E3DVector3F translationAmt)\r\n\t{\r\n\t\tgetVertexPosA().addEqual(translationAmt);\r\n\t\tgetVertexPosB().addEqual(translationAmt);\r\n\t\tgetVertexPosC().addEqual(translationAmt);\r\n\t\tneedPlaneEquationRecalc = true;\r\n\t}", "@Override\r\n protected void onCreate(Bundle savedInstanceState) {\r\n super.onCreate(savedInstanceState);\r\n setContentView(R.layout.activity_translate);\r\n\r\n translatedPhrase = findViewById(R.id.translatedPhrase);//textview to display the translated phrase or word\r\n list3 = findViewById(R.id.list3);\r\n list3.setChoiceMode(ListView.CHOICE_MODE_SINGLE);//setting the choice mode of the list to single choice\r\n\r\n subscribedLanguage = findViewById(R.id.subscribedLanguage);\r\n languageArrayList = phrasesDatabase.languages();//storing the data from the database into the array\r\n //array to store the string values of the main array\r\n ArrayList<String> spinnerArray = new ArrayList<>();\r\n //loop to retrieve the values from the main array into the string array for displaying\r\n for(int i =0; i < languageArrayList.size(); i++) {\r\n spinnerArray.add(languageArrayList.get(i).getLanguage());\r\n }\r\n\r\n ArrayAdapter<String> spinnerAdapter = new ArrayAdapter<>(this, android.R.layout.simple_spinner_item, spinnerArray);\r\n spinnerAdapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);\r\n subscribedLanguage.setAdapter(spinnerAdapter);\r\n\r\n translate = findViewById(R.id.translate);\r\n pronounce = findViewById(R.id.pronounce);\r\n\r\n translationService = initLanguageTranslatorService();\r\n textService = initTextToSpeechService();\r\n\r\n //calling methods\r\n translatePhrase();\r\n textToSpeech();\r\n }", "public static String translate(String langFrom, String langTo, String text) throws IOException {\n requestStatus=false;\n translateStatus.setValue(true);\n String urlStr = \"https://script.google.com/macros/s/AKfycbw2qKkvobro8WLNZUKi2kGwGwEO4W8cBavcKqcuCIGhGBBtVts/exec\" +\n \"?q=\" + URLEncoder.encode(text, \"UTF-8\")\n + \"&target=\" + langTo +\n \"&source=\" + langFrom;\n URL url = new URL(urlStr);\n StringBuilder response = new StringBuilder();\n HttpURLConnection con = (HttpURLConnection) url.openConnection();\n con.setRequestProperty(\"User-Agent\", \"Mozilla/5.0\");\n\n count++;\n //System.out.println(count);\n if (con.getResponseCode() == 200) {\n requestStatus=true;\n translateStatus.setValue(false);\n //System.out.println(count + \" OK\");\n }\n BufferedReader in = new BufferedReader(new InputStreamReader(con.getInputStream()));\n String inputLine;\n while ((inputLine = in.readLine()) != null) {\n response.append(inputLine);\n }\n in.close();\n return response.toString();\n }", "public interface TranslateResultListener {\n void onResult(String result);\n}", "public void onClick(View arg0) {\n getActivity().getSupportFragmentManager().beginTransaction()\r\n .replace(R.id.container, new Maps_Principal_Trans_Fragemnt()).commit();\r\n\r\n }", "public void translate(float x, float y);" ]
[ "0.7652226", "0.70364374", "0.67359775", "0.6700231", "0.66519856", "0.66466194", "0.66206276", "0.66011196", "0.6458095", "0.6291425", "0.6250822", "0.6086243", "0.6084099", "0.608268", "0.60745794", "0.6053448", "0.60309535", "0.5898058", "0.5888397", "0.58865964", "0.5882478", "0.5835655", "0.58331823", "0.5792804", "0.5782664", "0.5778596", "0.57423395", "0.5742308", "0.5738826", "0.57326", "0.5726701", "0.5693382", "0.56892556", "0.56777024", "0.5666389", "0.56532246", "0.56238866", "0.5616879", "0.5606054", "0.55726254", "0.5568119", "0.5567335", "0.55622256", "0.55615634", "0.55579776", "0.55540156", "0.55527085", "0.55354756", "0.55169266", "0.55149144", "0.5484818", "0.5480898", "0.5473253", "0.5471391", "0.54631627", "0.5456512", "0.5444554", "0.5436024", "0.54224205", "0.5420311", "0.54000175", "0.53773725", "0.53618824", "0.5359994", "0.5358673", "0.5352017", "0.53472054", "0.5342806", "0.53290355", "0.53162783", "0.53125083", "0.531041", "0.5304422", "0.5304177", "0.5291226", "0.52908045", "0.5286388", "0.5285258", "0.52731985", "0.527109", "0.5267913", "0.5256209", "0.525596", "0.5239569", "0.5234594", "0.52291846", "0.5227424", "0.5225928", "0.52162945", "0.52066916", "0.52048796", "0.5199129", "0.51954865", "0.51940787", "0.51803946", "0.5180248", "0.51666194", "0.51633245", "0.51627916", "0.5160627" ]
0.6870467
2
size of the stack
public LinkedListStack() { firstNode = null; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public int getSize() {\r\n\t\treturn stack.size();\r\n\t}", "public int getSize(){\n return this.stack.size();\n }", "public int size() {\n \treturn stack.size();\n }", "int size() {\n return stackSize;\n }", "@Override\r\n\tpublic int size() {\r\n\t\treturn stack.length;\r\n\t}", "@Override\r\n\tpublic int size() {\r\n\t\treturn stack.size();\r\n\t}", "public int getSize(){\r\n return topOfStack;\r\n }", "public final int size() {\n\t\treturn opstack.size();\n\t}", "public int size() \n {\n return stack1.size() + stack2.size(); \n }", "public int stackCount() {\r\n\t\t return count;\r\n\t }", "public int getStackSize() {\n\t\treturn stackSize;\n\t}", "final int threadLocalSize()\r\n/* 154: */ {\r\n/* 155:182 */ return ((Stack)this.threadLocal.get()).size;\r\n/* 156: */ }", "public int size() {\n //TODO: Fill in this method, then remove the RuntimeException\n throw new RuntimeException(\"RatPolyStack->size() unimplemented!\\n\");\n }", "public int getSize() {\r\n\t\treturn 5; // 1 (code) + 2 (data length) + 2 (branch offset)\r\n\t}", "public void testSize() {\n assertEquals(this.stack.size(), 10, 0.01);\n assertEquals(this.empty.size(), 0, 0.01);\n }", "private static int calcStackSize(Code32 code) {\r\n\t\tint size = 8 + nofNonVolGPR * 4 + nofNonVolEXTRD * 8 + nofNonVolEXTRS * 4;\t// includes LR and SP for back trace\r\n\t\tsize += callParamSlotsOnStack * 4 + RegAllocator.maxLocVarStackSlots * 4 + (intfMethStorage? 12: 0);\t\r\n\t\tassert(nofNonVolEXTRD < 16);\r\n\t\tif (nofNonVolEXTRD >= 16) ErrorReporter.reporter.error(1000);\r\n\t\t// enFloatsInExc could be true, even if this is no exception method\r\n\t\t// such a case arises when this method is called from within an exception method\r\n\t\tif (enFloatsInExc) size += nonVolStartEXTR * 8 + 4;\t// save volatile FPR's and FPSCR\r\n\t\tparamOffset = 4;\r\n\t\tcode.localVarOffset = paramOffset + callParamSlotsOnStack * 4;\r\n\t\tintfMethStorageOffset = paramOffset + callParamSlotsOnStack * 4 + RegAllocator.maxLocVarStackSlots * 4;\r\n\t\treturn size;\r\n\t}", "int getMapEntrySize() {\n if (frameType >= Const.SAME_FRAME && frameType <= Const.SAME_FRAME_MAX) {\n return 1;\n }\n if (frameType >= Const.SAME_LOCALS_1_STACK_ITEM_FRAME && frameType <= Const.SAME_LOCALS_1_STACK_ITEM_FRAME_MAX) {\n return 1 + (typesOfStackItems[0].hasIndex() ? 3 : 1);\n }\n if (frameType == Const.SAME_LOCALS_1_STACK_ITEM_FRAME_EXTENDED) {\n return 3 + (typesOfStackItems[0].hasIndex() ? 3 : 1);\n }\n if (frameType >= Const.CHOP_FRAME && frameType <= Const.CHOP_FRAME_MAX || frameType == Const.SAME_FRAME_EXTENDED) {\n return 3;\n }\n if (frameType >= Const.APPEND_FRAME && frameType <= Const.APPEND_FRAME_MAX) {\n int len = 3;\n for (final StackMapType typesOfLocal : typesOfLocals) {\n len += typesOfLocal.hasIndex() ? 3 : 1;\n }\n return len;\n }\n if (frameType != Const.FULL_FRAME) {\n throw new IllegalStateException(\"Invalid StackMap frameType: \" + frameType);\n }\n int len = 7;\n for (final StackMapType typesOfLocal : typesOfLocals) {\n len += typesOfLocal.hasIndex() ? 3 : 1;\n }\n for (final StackMapType typesOfStackItem : typesOfStackItems) {\n len += typesOfStackItem.hasIndex() ? 3 : 1;\n }\n return len;\n }", "@Test\n public void testSize() {\n System.out.println(\"size\");\n instance = new Stack();\n int expResult = 10;\n for (int i = 0; i < 10; i++) {\n instance.push(i*3);\n }\n assertEquals(expResult, instance.size());\n }", "int getLocalOnHeapSize();", "public abstract int getStackSizeWishInKb();", "public int size()\r\n/* 41: */ {\r\n/* 42:69 */ return this.pop.size();\r\n/* 43: */ }", "int treeSize() {\r\n\t\treturn\r\n\t\t\tmemSize()\r\n\t\t\t+ (this.expression == null ? 0 : getExpression().treeSize())\r\n\t\t\t+ (this.newArguments.listSize())\r\n\t\t\t+ (this.constructorArguments.listSize())\r\n\t\t\t+ (this.baseClasses.listSize())\r\n\t\t\t+ (this.declarations.listSize())\r\n\t;\r\n\t}", "public void size()\r\n\t{\r\n\t\tSystem.out.println(\"size = \"+top);\r\n\t}", "public long getSizeOfStackReserve()\n throws IOException, EndOfStreamException\n {\n return (imageState_ == ImageStateType.PE64\n ? peFile_.readInt64(relpos(Offsets.SIZE_OF_STACK_RESERVE_64.position))\n : peFile_.readInt32(relpos(Offsets.SIZE_OF_STACK_RESERVE_32.position)));\n }", "public static int size() {\n\t\treturn (anonymousSize() + registeredSize());\n\t}", "public static int size_length() {\n return (8 / 8);\n }", "public static int size_count() {\n return (16 / 8);\n }", "public int size()\r\n\t{\r\n\t\treturn heap.size();\r\n\t}", "int size() {\r\n\t\treturn top; \r\n\t}", "int getLocalSize();", "public int maxStack();", "public int getLocalSize();", "public static int size_hop() {\n return (8 / 8);\n }", "int treeSize() {\n return memSize() + (this.expression == null ? 0 : getExpression().treeSize()) + (this.typeArguments == null ? 0 : this.typeArguments.listSize()) + (this.methodName == null ? 0 : getName().treeSize());\n }", "public int size() {\n\t\treturn heap.size();\n\t}", "public long getSizeOfStackCommit()\n throws IOException, EndOfStreamException\n {\n return (imageState_ == ImageStateType.PE64\n ? peFile_.readInt64(relpos(Offsets.SIZE_OF_STACK_COMMIT_64.position))\n : peFile_.readInt32(relpos(Offsets.SIZE_OF_STACK_COMMIT_32.position)));\n }", "final int threadLocalCapacity()\r\n/* 149: */ {\r\n/* 150:178 */ return ((Stack)this.threadLocal.get()).elements.length;\r\n/* 151: */ }", "public int heapSize();", "int memSize() {\n // treat Code as free\n return BASE_NODE_SIZE + 3 * 4;\n }", "int getCurrentSize();", "public int size( )\r\n {\r\n int size = (int) manyNodes;// Student will replace this return statement with their own code:\r\n return size;\r\n }", "public int size () {\n\t\treturn size;\n\t}", "public int size () {\n\t\treturn size;\n\t}", "public int Size(){\n \treturn size;\n\t}", "int getLocalOffHeapSize();", "public int size() {\n return this.top;\n }", "private int funcSize( String defun ) {\n\t// Justification:\n\t// All types require 4 bytes. (the \"4*\")\n\t// We need space for the saved ra and maybe pushing our current fp (the \"+8\")\n\treturn 4*symbolTable.get( defun ).size()+8;\n }", "int treeSize() {\n return\n memSize()\n + initializers.listSize()\n + updaters.listSize()\n + (optionalConditionExpression == null ? 0 : getExpression().treeSize())\n + (body == null ? 0 : getBody().treeSize()); }", "public int getSize(){\n //To be written by student\n return localSize;\n }", "public int get_size();", "public int get_size();", "public abstract int getSmallStackSizeWishInKb();", "public static int sizeOf()\n {\n return 4;\n }", "public long size() {\n\t\treturn size;\n\t}", "public int size() {\n return sz;\n }", "public int size()\r\n\t{\r\n\t\treturn currentSize;\r\n\t}", "public int size ()\n {\n return size;\n }", "int memSize() {\r\n\t\treturn BASE_NODE_SIZE + 5 * 4;\r\n\t}", "int getTotalSize();", "long getLocalOnHeapSizeInBytes();", "public int size (){\n return N;\n }", "public int getTotalSize();", "public int size(){\n\t\treturn currentsize;\n\n\t}", "public int size() {\n return this.heap.size();\n }", "public synchronized long size() {\n\t\treturn size;\n\t}", "public int size(){\n\t\treturn size; \n\t}", "public int GetSize() \n\t{\n\t\treturn numEntries; //dummy return so file would compile\n\t}", "public int size(){\r\n return currentSize;\r\n }", "@Override\n\tpublic int size() {\n\t\treturn (top + 1);\n\t}", "public int size() {\n \t\treturn size;\n \t}", "private long size() {\n\t\treturn 0;\n\t}", "@Override\n\tpublic int size() {\n\t\treturn heap.size();\n\t}", "public int size() {\n\t\treturn N;\n\t}", "public int size() {\n\t\treturn N;\n\t}", "public int size() {\n\t\treturn N;\n\t}", "public int size() {\n\t\treturn N;\n\t}", "public int size() {\n\t\treturn N;\n\t}", "public int size()\r\n {\r\n return top;\r\n }", "public int size(){\n\t\t\r\n\t\treturn N;\r\n\t}", "public int size(){\n\t\treturn size;\n\t}", "int getQueueSize();", "public int get_size()\r\n\t{\r\n\t\treturn this.size;\r\n\t}", "public int size() {\r\n \treturn size;\r\n }", "public int size()\n {\n return currentSize;\n }", "public int sizeof() {\n return Type.getSourceABI().getPointerSize();\n }", "@Override\n public int size() {\n // Returns the number of elements stored in the heap\n return nelems;\n }", "public int size() {\r\n\t\treturn size;\r\n\t}", "public int size() {\r\n\t\treturn size;\r\n\t}", "public int size() {\r\n\t\treturn size;\r\n\t}", "public int size() {\r\n\t\treturn size;\r\n\t}", "public int size() {\r\n\t\treturn size;\r\n\t}", "public int size() {\r\n\t\treturn size;\r\n\t}", "public int size() {\n\t\treturn size;\r\n\t}", "public int size() {\n\t\treturn size;\r\n\t}", "public int size(){\r\n\t\treturn N;\r\n\t}", "public int size()\n\t{\n\t\treturn size;\n\t}", "public int size()\n\t{\n\t\treturn size;\n\t}", "public int size() {\n // DO NOT MODIFY THIS METHOD!\n return size;\n }", "public int getSize(){\n /**\n * TODO: INSERT YOUR CODE HERE\n * FIND THE NUMBER OF NODES IN THE TREE AND STORE THE VALUE IN CLASS VARIABLE \"size\"\n * RETURN THE \"size\" VALUE\n *\n * HINT: THE NMBER OF NODES CAN BE UPDATED IN THE \"size\" VARIABLE EVERY TIME A NODE IS INSERTED OR DELETED FROM THE TREE.\n */\n\n return size;\n }", "public int size() {\n // DO NOT MODIFY!\n return size;\n }", "boolean isFull(Stack stack){\n\t\tif(stack.getStackSize() >= 100) return true;\r\n\t\telse return false;\t\r\n\t}" ]
[ "0.85695404", "0.85089684", "0.8482001", "0.84283763", "0.82918966", "0.816369", "0.7859386", "0.7744371", "0.7496939", "0.7432217", "0.7334923", "0.7168407", "0.7129974", "0.7065047", "0.7053018", "0.6905363", "0.6859299", "0.6821442", "0.68144774", "0.68063843", "0.67686933", "0.6741242", "0.67096", "0.6676178", "0.6673261", "0.6655826", "0.66505754", "0.6648679", "0.66413057", "0.66318625", "0.66158766", "0.66077095", "0.6598117", "0.65772223", "0.6577209", "0.6576448", "0.6538585", "0.6537855", "0.65040195", "0.6493414", "0.6492354", "0.6488772", "0.6488772", "0.64887", "0.64747477", "0.64738464", "0.6461167", "0.6442991", "0.6440975", "0.6411558", "0.6411558", "0.640969", "0.6400661", "0.6391872", "0.6390842", "0.6381581", "0.63766223", "0.63701427", "0.6364365", "0.6354306", "0.63477856", "0.6344777", "0.6341655", "0.633986", "0.63353235", "0.63268137", "0.6324588", "0.6323744", "0.63234234", "0.63196933", "0.6313999", "0.630717", "0.62960905", "0.62960905", "0.62960905", "0.62960905", "0.62960905", "0.62919784", "0.62837654", "0.62806463", "0.62730336", "0.6272518", "0.62703836", "0.6263499", "0.6260296", "0.6259801", "0.6258723", "0.6258723", "0.6258723", "0.6258723", "0.6258723", "0.6258723", "0.6252319", "0.6252319", "0.62523115", "0.62512946", "0.62512946", "0.6249743", "0.6235555", "0.6232757", "0.62298286" ]
0.0
-1
process xml bitch Processing the purchase order, needs to be added to the xml file
public void process(PurchaseOrder po) { File file = new File(path + "/" + ORDERS_XML); try { DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance(); DocumentBuilder db = dbf.newDocumentBuilder(); InputSource is = new InputSource(); is.setCharacterStream(new FileReader(file)); Document doc = db.parse(is); Element root = doc.getDocumentElement(); Element e = doc.createElement("order"); // Convert the purchase order to an XML format String keys[] = {"orderNum","customerRef","product","quantity","unitPrice"}; String values[] = {Integer.toString(po.getOrderNum()), po.getCustomerRef(), po.getProduct().getProductType(), Integer.toString(po.getQuantity()), Float.toString(po.getUnitPrice())}; for(int i=0;i<keys.length;i++) { Element tmp = doc.createElement(keys[i]); tmp.setTextContent(values[i]); e.appendChild(tmp); } // Set the status to submitted Element status = doc.createElement("status"); status.setTextContent("submitted"); e.appendChild(status); // Set the order total Element total = doc.createElement("orderTotal"); float orderTotal = po.getQuantity() * po.getUnitPrice(); total.setTextContent(Float.toString(orderTotal)); e.appendChild(total); // Write the content all as a new element in the root root.appendChild(e); TransformerFactory tf = TransformerFactory.newInstance(); Transformer m = tf.newTransformer(); DOMSource source = new DOMSource(root); StreamResult result = new StreamResult(file); m.transform(source, result); } catch(Exception e) { System.out.println("Error: " + e.getMessage()); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static OrderDTO parsePurchaseOrderXML(Document orderXML) {\n OrderDTO orderDTO = new OrderDTO();\n List<OrderlineDTO> listOrderLineDTO = new ArrayList<OrderlineDTO>();\n int lineCount = 0;\n int fieldsCount = 0;\n\n try {\n orderDTO.setStoreName(orderXML.getElementsByTagName(storeName).item(0).getChildNodes()\n .item(0).getNodeValue());\n orderDTO.setEmail(orderXML.getElementsByTagName(email).item(0).getChildNodes().item(0)\n .getNodeValue());\n orderDTO.setBrand(orderXML.getElementsByTagName(brand).item(0).getChildNodes().item(0)\n .getNodeValue());\n\n // Parsing of Purchase order lines\n\n NodeList listPOlines = orderXML.getElementsByTagName(poLines);\n NodeList listPOl = orderXML.getElementsByTagName(poLine);\n lineCount = listPOl.getLength();\n // System.out.println(lineCount+\"linecount============\");\n\n if (null != listPOlines && listPOlines.getLength() > 0 && null != listPOl\n && listPOl.getLength() > 0) {\n log.debug(\"PO Lines exist\");\n\n lineCount = listPOl.getLength();\n\n for (int indexLine = 0; indexLine < lineCount; indexLine++) {\n Node poLineNode = listPOl.item(indexLine);\n fieldsCount = poLineNode.getChildNodes().getLength();\n NodeList listFields = poLineNode.getChildNodes();\n\n OrderlineDTO orderlineDTO = new OrderlineDTO();\n int tagCount = 0;\n\n for (int indexField = 0; indexField < fieldsCount; indexField++) {\n Node fieldNode = listFields.item(indexField);\n\n if (fieldNode.getNodeName().equals(qtyOrdered)) {\n orderlineDTO.setQtyOrdered(Integer.parseInt(fieldNode.getChildNodes().item(0)\n .getNodeValue()));\n tagCount += 1;\n }\n if (fieldNode.getNodeName().equals(priceActual)) {\n orderlineDTO.setPriceActual(Double.parseDouble(fieldNode.getChildNodes().item(0)\n .getNodeValue()));\n tagCount += 1;\n }\n\n if (fieldNode.getNodeName().equals(itemCode)) {\n orderlineDTO.setItemCode(fieldNode.getChildNodes().item(0).getNodeValue());\n tagCount += 1;\n }\n }\n\n if (tagCount != 3) {\n throw new Exception(\"Mandatory parameters missing in Lines.\");\n }\n\n listOrderLineDTO.add(orderlineDTO);\n }\n\n }\n\n orderDTO.setListOrderlineDTOs(listOrderLineDTO);\n orderDTO.setSuccessStatus(success);\n\n } catch (Exception exp) {\n log.error(\"Exception while parsing the mandatory fields for creating Purchase Order. \", exp);\n // orderDTO.setSuccessStatus(\"failure\");\n orderDTO.setSuccessStatus(\"Unable to create Order-Incomplete Data->\" + exp);\r\n\n return orderDTO;\n }\n\n return orderDTO;\n\n }", "@Override\n public void doPost(String path, HttpServletRequest request, HttpServletResponse response)\n throws Exception {\n String xml = \"\";\n String strRead = \"\";\n\n InputStreamReader isReader = new InputStreamReader(request.getInputStream());\n BufferedReader bReader = new BufferedReader(isReader);\n StringBuilder strBuilder = new StringBuilder();\n strRead = bReader.readLine();\n while (strRead != null) {\n strBuilder.append(strRead);\n strRead = bReader.readLine();\n }\n xml = strBuilder.toString();\n\n DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();\n DocumentBuilder builder = factory.newDocumentBuilder();\n InputSource is = new InputSource(new StringReader(xml));\n Document document = builder.parse(is);\n\n // Verify if all the necessary tag and values are present\n\n StringBuilder xmlBuilder = new StringBuilder();\n xmlBuilder.append(\"<?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\" ?>\");\n xmlBuilder.append(\"<purchaseOrder>\");\n\n OrderDTO orderDTO = parsePurchaseOrderXML(document);\n\n if (orderDTO.getSuccessStatus().equals(success)) {\n\n PurchaseOrderServiceDAO poServiceDAO = new PurchaseOrderServiceDAO();\n synchronized (poServiceDAO) {\n orderDTO = poServiceDAO.createPONew(orderDTO);\n poServiceDAO.closeConnection();\n }\n\n if (orderDTO.getSuccessStatus().equals(success)) {\n\n final String linesInfoString = orderDTO.getLinesInfo();\n final String[] linesArray = linesInfoString.split(\",\");\n\n xmlBuilder.append(\"<status>\").append(orderDTO.getSuccessStatus()).append(\"</status>\");\n xmlBuilder.append(\"<documentNo>\").append(orderDTO.getDocumentNo()).append(\"</documentNo>\");\n xmlBuilder.append(\"<purchaseOrderId>\").append(orderDTO.getCOrderId())\n .append(\"</purchaseOrderId>\");\n xmlBuilder.append(\"<purchaseOrderLines>\");\n for (int i = 0; i < linesArray.length; i++) {\n\n final String lineInfo = linesArray[i];\n final String[] lineInfoValues = lineInfo.split(\"-\");\n xmlBuilder.append(\"<purchaseOrderLine>\");\n xmlBuilder.append(\"<itemCode>\" + lineInfoValues[0] + \"</itemCode>\");\n xmlBuilder.append(\"<orderedQty>\" + lineInfoValues[1] + \"</orderedQty>\");\n xmlBuilder.append(\"<confirmedQty>\" + lineInfoValues[2] + \"</confirmedQty>\");\n xmlBuilder.append(\"</purchaseOrderLine>\");\n }\n xmlBuilder.append(\"</purchaseOrderLines>\");\n xmlBuilder.append(\"<confirmedQty>\").append(orderDTO.getConfirmedQty())\n .append(\"</confirmedQty>\");\n log.debug(\"Purchase Order successfully created with c_order_id: \" + orderDTO.getCOrderId()\n + \" and documentno: \" + orderDTO.getDocumentNo());\n } else {\n // System.out.println(orderDTO.getSuccessStatus());\n xmlBuilder.append(\"<status>\").append(orderDTO.getSuccessStatus()).append(\"</status>\");\n }\n\n } else {\n xmlBuilder.append(\"<status>\").append(orderDTO.getSuccessStatus()).append(\"</status>\");\n }\n\n xmlBuilder.append(\"</purchaseOrder>\");\n\n response.setContentType(\"text/xml\");\n response.setCharacterEncoding(\"utf-8\");\n final Writer w = response.getWriter();\n w.write(xmlBuilder.toString());\n w.close();\n\n }", "private void parseXMLResult(String respFile, ProcureLineItem pli,\r\n\t\t\tApprovalRequest ar, BaseVector lineItems, Approvable lic)\r\n\t\t\tthrows SAXException, ParserConfigurationException, IOException {\r\n\t\tLog.customer.debug(\"After calling getVertexTaxResponse()...: %s\",\r\n\t\t\t\t\"CatTaxCustomApprover response file before parsing : - %s\",\r\n\t\t\t\tclassName, respFile);\r\n\t\t// Parsing XML and populating field in Ariba.....\r\n\t\tlic = ar.getApprovable();\r\n\t\tLog.customer.debug(\" Parsing XML file ...........: %s\", className);\r\n\t\tFile file1 = new File(respFile);\r\n\t\tDocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();\r\n\t\tDocumentBuilder db = dbf.newDocumentBuilder();\r\n\t\tDocument doc = db.parse(file1);\r\n\t\t// if(respFile!=null){\r\n\t\tdoc.getDocumentElement().normalize();\r\n\t\tNodeList nodeList = doc.getElementsByTagName(\"LineItem\");\r\n\t\tLog.customer.debug(\"%s Information of all Line Item nodeList %s\",\r\n\t\t\t\tclassName, nodeList.getLength());\r\n\r\n\t\tfor (int s = 0; s < nodeList.getLength(); s++) {\r\n\t\t\tNode fstNode = nodeList.item(s);\r\n\t\t\tElement fstElmntlnm = (Element) fstNode;\r\n\t\t\tString lineItemNumber = fstElmntlnm.getAttribute(\"lineItemNumber\");\r\n\t\t\tint index = Integer.parseInt(lineItemNumber);\r\n\t\t\ttry {\r\n\t\t\t\tint plinumber = index - 1;\r\n\t\t\t\tLog.customer.debug(\r\n\t\t\t\t\t\t\"%s *** lineItemNumber plinumber after: %s\",\r\n\t\t\t\t\t\tclassName, plinumber);\r\n\t\t\t\tpli = (ProcureLineItem) lineItems.get(plinumber);\r\n\t\t\t} catch (Exception e) {\r\n\t\t\t\tLog.customer.debug(\"%s *** in catch of pli : %s\", className,\r\n\t\t\t\t\t\tlineItemNumber + \" ******** \" + e.toString());\r\n\t\t\t\tLog.customer.debug(pli.toString());\r\n\t\t\t\tLog.customer.debug(e.getClass());\r\n\t\t\t}\r\n\t\t\tif (fstNode.getNodeType() == Node.ELEMENT_NODE) {\r\n\r\n\t\t\t\tElement fstElmnt = (Element) fstNode;\r\n\t\t\t\tNodeList countryElmntLst = fstElmnt\r\n\t\t\t\t\t\t.getElementsByTagName(\"Country\");\r\n\t\t\t\tElement lstNmElmnt = (Element) countryElmntLst.item(0);\r\n\t\t\t\tNodeList lstNm = lstNmElmnt.getChildNodes();\r\n\t\t\t\tLog.customer.debug(\"%s *** Country : %s\", className,\r\n\t\t\t\t\t\t((Node) lstNm.item(0)).getNodeValue());\r\n\r\n\t\t\t\t// Total Tax\r\n\t\t\t\tNodeList totaltaxElmntLst = fstElmnt\r\n\t\t\t\t\t\t.getElementsByTagName(\"TotalTax\");\r\n\t\t\t\tElement lstNmElmnt1 = (Element) totaltaxElmntLst.item(0);\r\n\t\t\t\tNodeList lstNm1 = lstNmElmnt1.getChildNodes();\r\n\t\t\t\tString totalTax = ((Node) lstNm1.item(0)).getNodeValue();\r\n\t\t\t\tBigDecimal taxAmount = new BigDecimal(totalTax);\r\n\t\t\t\tMoney taxTotal = new Money(taxAmount, pli.getAmount()\r\n\t\t\t\t\t\t.getCurrency());\r\n\t\t\t\tpli.setFieldValue(\"TaxAmount\", taxTotal);\r\n\t\t\t\tLog.customer.debug(\"%s *** Tax Amount : %s\", className,\r\n\t\t\t\t\t\ttotalTax);\r\n\r\n\t\t\t\t// Reason code\r\n\t\t\t\tElement fstElmntRC = (Element) fstNode;\r\n\t\t\t\tNodeList lstNmElmntLstRC = fstElmntRC\r\n\t\t\t\t\t\t.getElementsByTagName(\"AssistedParameter\");\r\n\t\t\t\tString ReasonCode = \" \";\r\n\t\t\t\tfor (int b = 0; b < lstNmElmntLstRC.getLength(); b++) {\r\n\t\t\t\t\tNode fstNodeRC = lstNmElmntLstRC.item(b);\r\n\t\t\t\t\tif (fstNodeRC.getNodeType() == Node.ELEMENT_NODE) {\r\n\t\t\t\t\t\tElement fstElmntRC1 = (Element) fstNodeRC;\r\n\t\t\t\t\t\tString fieldIdRC = fstElmntRC1.getAttribute(\"phase\");\r\n\t\t\t\t\t\tLog.customer.debug(\"%s *** ReasonCode in loop : \"\r\n\t\t\t\t\t\t\t\t+ fieldIdRC);\r\n\t\t\t\t\t\tif (\"POST\".equalsIgnoreCase(fieldIdRC)) {\r\n\t\t\t\t\t\t\ttry {\r\n\t\t\t\t\t\t\t\tElement lstNmElmntRC = (Element) lstNmElmntLstRC\r\n\t\t\t\t\t\t\t\t\t\t.item(0);\r\n\t\t\t\t\t\t\t\tif (lstNmElmntRC.equals(null)\r\n\t\t\t\t\t\t\t\t\t\t|| lstNmElmntRC.equals(\"\")) {\r\n\t\t\t\t\t\t\t\t\tReasonCode = \"\";\r\n\t\t\t\t\t\t\t\t\tLog.customer.debug(\r\n\t\t\t\t\t\t\t\t\t\t\t\"%s *** ReasonCode in if : %s\",\r\n\t\t\t\t\t\t\t\t\t\t\tclassName, ReasonCode);\r\n\t\t\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\t\t\tNodeList lstNmRC = lstNmElmntRC\r\n\t\t\t\t\t\t\t\t\t\t\t.getChildNodes();\r\n\t\t\t\t\t\t\t\t\tReasonCode = ((Node) lstNmRC.item(0))\r\n\t\t\t\t\t\t\t\t\t\t\t.getNodeValue();\r\n\t\t\t\t\t\t\t\t\tLog.customer.debug(\r\n\t\t\t\t\t\t\t\t\t\t\t\"%s *** ReasonCode in else : %s\",\r\n\t\t\t\t\t\t\t\t\t\t\tclassName, ReasonCode);\r\n\t\t\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\t\t} catch (NullPointerException e) {\r\n\t\t\t\t\t\t\t\tLog.customer.debug(\r\n\t\t\t\t\t\t\t\t\t\t\"%s *** inside exception : %s\",\r\n\t\t\t\t\t\t\t\t\t\tclassName);\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t/*****************************************/\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t\tLog.customer.debug(\"inside loop still....\");\r\n\t\t\t\t}\r\n\t\t\t\tLog.customer.debug(\"outside loop .....\");\r\n\t\t\t\t// *********************************************************************************\r\n\t\t\t\t// TaxAmount = 0 and Reason code = Null then exempt Reason code\r\n\t\t\t\t// is E0.\r\n\r\n\t\t\t\t// Start : RSD 111 (FRD4.0/TD 1.2)\r\n\r\n\t\t\t\tString sapsource = null;\r\n\t\t\t\tsapsource = (String)pli.getLineItemCollection().getDottedFieldValue(\"CompanyCode.SAPSource\");\r\n\r\n\t\t\t\tLog.customer.debug(\"*** ReasonCode logic RSD111 SAPSource is: %s\",sapsource);\r\n\r\n\t\t\t\tif((sapsource.equals(\"MACH1\")) && ((ReasonCode != null) && (!\"\"\r\n\t\t\t\t\t\t.equals(ReasonCode))))\r\n\t\t\t\t{\r\n\t\t\t\t\t/** Fetching Description from Table. */\r\n\t\t\t\t\tLog.customer.debug(\"*** ReasonCode logic RSD111: \" + ReasonCode);\r\n\t\t\t\t\tString taxCodeForLookup = ReasonCode; // Please Replace with\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// the Actual value\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// from Web Service\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// Response.\r\n\t\t\t\t\tString qryStringrc = \"Select TaxExemptDescription from cat.core.TaxExemptReasonCode where TaxExemptUniqueName = '\"\r\n\t\t\t\t\t\t\t+ taxCodeForLookup + \"'\";\r\n\t\t\t\t\tLog.customer.debug(\"%s TaxExemptReasonCode : qryString \"\r\n\t\t\t\t\t\t\t+ qryStringrc);\r\n\t\t\t\t\t// Replace the cntrctrequest - Invoice Reconciliation Object\r\n\t\t\t\t\tAQLOptions queryOptionsrc = new AQLOptions(ar\r\n\t\t\t\t\t\t\t.getPartition());\r\n\t\t\t\t\tAQLResultCollection queryResultsrc = Base.getService()\r\n\t\t\t\t\t\t\t.executeQuery(qryStringrc, queryOptionsrc);\r\n\t\t\t\t\tif (queryResultsrc != null) {\r\n\t\t\t\t\t\tLog.customer\r\n\t\t\t\t\t\t\t\t.debug(\" RSD111 -- TaxExemptReasonCode: Query Results not null\");\r\n\t\t\t\t\t\twhile (queryResultsrc.next()) {\r\n\t\t\t\t\t\t\tString taxdescfromLookupvalue = (String) queryResultsrc\r\n\t\t\t\t\t\t\t\t\t.getString(0);\r\n\t\t\t\t\t\t\tLog.customer\r\n\t\t\t\t\t\t\t\t\t.debug(\" RSD111 TaxExemptReasonCode: taxdescfromLookupvalue = \"\r\n\t\t\t\t\t\t\t\t\t\t\t+ taxdescfromLookupvalue);\r\n\t\t\t\t\t\t\t// Change the rli to appropriate Carrier Holding\r\n\t\t\t\t\t\t\t// object, i.e. IR Line object\r\n\t\t\t\t\t\t\tif (\"\".equals(taxdescfromLookupvalue)\r\n\t\t\t\t\t\t\t\t\t|| taxdescfromLookupvalue == null\r\n\t\t\t\t\t\t\t\t\t|| \"null\".equals(taxdescfromLookupvalue)) {\r\n\t\t\t\t\t\t\t\t// if(taxdescfromLookupvalue.equals(\"\")||taxdescfromLookupvalue\r\n\t\t\t\t\t\t\t\t// ==\r\n\t\t\t\t\t\t\t\t// null||taxdescfromLookupvalue.equals(\"null\")\r\n\t\t\t\t\t\t\t\t// ){\r\n\t\t\t\t\t\t\t\ttaxdescfromLookupvalue = \"\";\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\tpli\r\n\t\t\t\t\t\t\t\t\t.setFieldValue(\"Carrier\",\r\n\t\t\t\t\t\t\t\t\t\t\ttaxdescfromLookupvalue);\r\n\t\t\t\t\t\t\tLog.customer\r\n\t\t\t\t\t\t\t\t\t.debug(\" RSD111 -- TaxExemptReasonCode Applied on Carrier: \"\r\n\t\t\t\t\t\t\t\t\t\t\t+ taxdescfromLookupvalue);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\t// End : RSD 111 (FRD4.0/TD 1.2)\r\n\r\n\r\n\t\t\t\t} else if ((\"0.0\".equals(totalTax) && ((ReasonCode == null) || (\"\"\r\n\t\t\t\t\t\t.equals(ReasonCode))))) {\r\n\t\t\t\t\tReasonCode = \"E0\";\r\n\t\t\t\t\tLog.customer.debug(\"*** ReasonCode in condition : %s\",\r\n\t\t\t\t\t\t\tclassName, ReasonCode);\r\n\t\t\t\t} else if ((\"0.0\".equals(totalTax) && ((ReasonCode != null) || (!\"\"\r\n\t\t\t\t\t\t.equals(ReasonCode))))) {\r\n\r\n\t\t\t\t\t// End Exempt Reason code logic.\r\n\t\t\t\t\t/** Fetching Description from Table. */\r\n\t\t\t\t\tLog.customer.debug(\"*** ReasonCode after : \" + ReasonCode);\r\n\t\t\t\t\tString taxCodeForLookup = ReasonCode; // Please Replace with\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// the Actual value\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// from Web Service\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// Response.\r\n\t\t\t\t\tString qryStringrc = \"Select TaxExemptDescription from cat.core.TaxExemptReasonCode where TaxExemptUniqueName = '\"\r\n\t\t\t\t\t\t\t+ taxCodeForLookup + \"'\";\r\n\t\t\t\t\tLog.customer.debug(\"%s TaxExemptReasonCode : qryString \"\r\n\t\t\t\t\t\t\t+ qryStringrc);\r\n\t\t\t\t\t// Replace the cntrctrequest - Invoice Reconciliation Object\r\n\t\t\t\t\tAQLOptions queryOptionsrc = new AQLOptions(ar\r\n\t\t\t\t\t\t\t.getPartition());\r\n\t\t\t\t\tAQLResultCollection queryResultsrc = Base.getService()\r\n\t\t\t\t\t\t\t.executeQuery(qryStringrc, queryOptionsrc);\r\n\t\t\t\t\tif (queryResultsrc != null) {\r\n\t\t\t\t\t\tLog.customer\r\n\t\t\t\t\t\t\t\t.debug(\" TaxExemptReasonCode: Query Results not null\");\r\n\t\t\t\t\t\twhile (queryResultsrc.next()) {\r\n\t\t\t\t\t\t\tString taxdescfromLookupvalue = (String) queryResultsrc\r\n\t\t\t\t\t\t\t\t\t.getString(0);\r\n\t\t\t\t\t\t\tLog.customer\r\n\t\t\t\t\t\t\t\t\t.debug(\" TaxExemptReasonCode: taxdescfromLookupvalue = \"\r\n\t\t\t\t\t\t\t\t\t\t\t+ taxdescfromLookupvalue);\r\n\t\t\t\t\t\t\t// Change the rli to appropriate Carrier Holding\r\n\t\t\t\t\t\t\t// object, i.e. IR Line object\r\n\t\t\t\t\t\t\tif (\"\".equals(taxdescfromLookupvalue)\r\n\t\t\t\t\t\t\t\t\t|| taxdescfromLookupvalue == null\r\n\t\t\t\t\t\t\t\t\t|| \"null\".equals(taxdescfromLookupvalue)) {\r\n\t\t\t\t\t\t\t\t// if(taxdescfromLookupvalue.equals(\"\")||taxdescfromLookupvalue\r\n\t\t\t\t\t\t\t\t// ==\r\n\t\t\t\t\t\t\t\t// null||taxdescfromLookupvalue.equals(\"null\")\r\n\t\t\t\t\t\t\t\t// ){\r\n\t\t\t\t\t\t\t\ttaxdescfromLookupvalue = \"\";\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\tpli\r\n\t\t\t\t\t\t\t\t\t.setFieldValue(\"Carrier\",\r\n\t\t\t\t\t\t\t\t\t\t\ttaxdescfromLookupvalue);\r\n\t\t\t\t\t\t\tLog.customer\r\n\t\t\t\t\t\t\t\t\t.debug(\" TaxExemptReasonCode Applied on Carrier: \"\r\n\t\t\t\t\t\t\t\t\t\t\t+ taxdescfromLookupvalue);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\r\n\t\t\t\t// End Exempt Reason code logic.\r\n\r\n\t\t\t\t// *****************************************************************************//*\r\n\t\t\t\t// tax code logic ...\r\n\t\t\t\tif (totalTax.equals(\"0.0\")) {\r\n\t\t\t\t\tString companyCode = (String) lic\r\n\t\t\t\t\t\t\t.getDottedFieldValue(\"CompanyCode.UniqueName\");\r\n\t\t\t\t\tString state = (String) pli\r\n\t\t\t\t\t\t\t.getDottedFieldValue(\"ShipTo.State\");\r\n\t\t\t\t\tString formattedString = companyCode + \"_\" + state + \"_\"\r\n\t\t\t\t\t\t\t+ \"B0\";\r\n\t\t\t\t\tLog.customer.debug(\"***formattedString : \"\r\n\t\t\t\t\t\t\t+ formattedString);\r\n\t\t\t\t\tString qryString = \"Select TaxCode,UniqueName, SAPTaxCode from ariba.tax.core.TaxCode where UniqueName = '\"\r\n\t\t\t\t\t\t\t+ formattedString\r\n\t\t\t\t\t\t\t+ \"' and Country.UniqueName ='\"\r\n\t\t\t\t\t\t\t+ pli\r\n\t\t\t\t\t\t\t\t\t.getDottedFieldValue(\"ShipTo.Country.UniqueName\")\r\n\t\t\t\t\t\t\t+ \"'\";\r\n\t\t\t\t\tLog.customer\r\n\t\t\t\t\t\t\t.debug(\" CatMSCTaxCodeDetermination : REQUISITION: qryString \"\r\n\t\t\t\t\t\t\t\t\t+ qryString);\r\n\t\t\t\t\tAQLOptions queryOptions = new AQLOptions(ar.getPartition());\r\n\t\t\t\t\tLog.customer\r\n\t\t\t\t\t\t\t.debug(\" CatMSCTaxCodeDetermination: REQUISITION - Stage I\");\r\n\t\t\t\t\tAQLResultCollection queryResults = Base.getService()\r\n\t\t\t\t\t\t\t.executeQuery(qryString, queryOptions);\r\n\t\t\t\t\tLog.customer\r\n\t\t\t\t\t\t\t.debug(\" CatMSCTaxCodeDetermination: REQUISITION - Stage II- Query Executed\");\r\n\t\t\t\t\tif (queryResults != null) {\r\n\t\t\t\t\t\tLog.customer\r\n\t\t\t\t\t\t\t\t.debug(\" CatMSCTaxCodeDetermination: REQUISITION - Stage III - Query Results not null\");\r\n\t\t\t\t\t\twhile (queryResults.next()) {\r\n\t\t\t\t\t\t\tLog.customer\r\n\t\t\t\t\t\t\t\t\t.debug(\" CatMSCTaxCodeDetermination: REQUISITION - Stage IV - Entering the DO of DO-WHILE\"\r\n\t\t\t\t\t\t\t\t\t\t\t+ queryResults.getBaseId(0).get());\r\n\t\t\t\t\t\t\tTaxCode taxfromLookupvalue = (TaxCode) queryResults\r\n\t\t\t\t\t\t\t\t\t.getBaseId(0).get();\r\n\t\t\t\t\t\t\tLog.customer.debug(\" taxfromLookupvalue\"\r\n\t\t\t\t\t\t\t\t\t+ taxfromLookupvalue);\r\n\t\t\t\t\t\t\tLog.customer\r\n\t\t\t\t\t\t\t\t\t.debug(\" CatMSCTaxCodeDetermination : REQUISITION: TaxCodefromLookup\"\r\n\t\t\t\t\t\t\t\t\t\t\t+ taxfromLookupvalue);\r\n\t\t\t\t\t\t\t// Set the Value of LineItem.TaxCode.UniqueName =\r\n\t\t\t\t\t\t\t// 'formattedString'\r\n\t\t\t\t\t\t\tLog.customer\r\n\t\t\t\t\t\t\t\t\t.debug(\" CatMSCTaxCodeDetermination : REQUISITION: Setting TaxCodefromLookup\"\r\n\t\t\t\t\t\t\t\t\t\t\t+ taxfromLookupvalue);\r\n\t\t\t\t\t\t\tpli.setFieldValue(\"TaxCode\", taxfromLookupvalue);\r\n\t\t\t\t\t\t\tLog.customer\r\n\t\t\t\t\t\t\t\t\t.debug(\" CatMSCTaxCodeDetermination : REQUISITION: Applied \"\r\n\t\t\t\t\t\t\t\t\t\t\t+ taxfromLookupvalue);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\t// end Tax code...\r\n\t\t\t\tLog.customer.debug(\"*** After loop Tax code : \");\r\n\t\t\t}\r\n\t\t}\r\n\t\t// }\r\n\t}", "static void processFile(File xmlFile) {\n Document doc = null;\n try {\n doc = builder.parse(xmlFile);\n }\n catch (IOException e) {\n e.printStackTrace();\n System.exit(3);\n }\n catch (SAXException e) {\n System.out.println(\"Parsing error on file \" + xmlFile);\n System.out.println(\" (not supposed to happen with supplied XML files)\");\n e.printStackTrace();\n System.exit(3);\n }\n \n /* At this point 'doc' contains a DOM representation of an 'Items' XML\n * file. Use doc.getDocumentElement() to get the root Element. */\n System.out.println(\"Successfully parsed - \" + xmlFile);\n \n /* Fill in code here (you will probably need to write auxiliary\n methods). */\n \n Element[] elems = getElementsByTagNameNR(doc.getDocumentElement(), \"Item\");\n for(Element e : elems) {\n\n String itemId = e.getAttribute(\"ItemID\");\n String name = getElementTextByTagNameNR(e, \"Name\");\n String currently = strip(getElementTextByTagNameNR(e, \"Currently\"));\n String buy_price = strip(getElementTextByTagNameNR(e, \"Buy_Price\"));\n String first_bid = strip(getElementTextByTagNameNR(e, \"First_Bid\"));\n String number_of_bids = getElementTextByTagNameNR(e, \"Number_of_Bids\");\n String country = getElementTextByTagNameNR(e, \"Country\");\n String started = changeTime(getElementTextByTagNameNR(e, \"Started\"));\n String ends = changeTime(getElementTextByTagNameNR(e, \"Ends\"));\n Element seller = getElementByTagNameNR(e, \"Seller\");\n String sellerId = seller.getAttribute(\"UserID\");\n String sellerRatings = seller.getAttribute(\"Rating\");\n String location = getElementTextByTagNameNR(e, \"Location\");\n Element locate = getElementByTagNameNR(e, \"Location\");\n String latitude = locate.getAttribute(\"Latitude\");\n String longitude = locate.getAttribute(\"Longitude\");\n String description = getElementTextByTagNameNR(e, \"Description\");\n if(description.length() > 4000)\n description = description.substring(0, 4001);\n\n // add the record to the list\n items.add(itemRecord(itemId, name, currently, buy_price, first_bid, number_of_bids, country,\n started, ends, sellerId, location, latitude, longitude, description));\n\n // add the category infomation and belongsTo information\n Element[] cates = getElementsByTagNameNR(e, \"Category\");\n for(Element c : cates) {\n String cate = getElementText(c);\n if(category.containsKey(cate) == false) {\n int cnt = category.size();\n category.put(cate, cnt);\n }\n int index = category.get(cate);\n String caterecord = itemId + columnSeparator + index;\n belongsTo.add(caterecord);\n }\n\n // add the user information\n if(users.containsKey(sellerId)) {\n users.get(sellerId).sellRating = sellerRatings;\n }\n else {\n User u = new User(sellerId);\n u.sellRating = sellerRatings;\n users.put(sellerId, u);\n }\n\n // add the bid infromation and bider inforamtion\n Element[] ebids = getElementsByTagNameNR(getElementByTagNameNR(e, \"Bids\"), \"Bid\");\n for(Element b : ebids) {\n Element bidder = getElementByTagNameNR(b, \"Bidder\");\n String bidderId = bidder.getAttribute(\"UserID\");\n String bidderRating = bidder.getAttribute(\"Rating\");\n String bidderloc = getElementTextByTagNameNR(bidder, \"Location\");\n String biddercoun = getElementTextByTagNameNR(bidder, \"Country\");\n String amount = strip(getElementTextByTagNameNR(b, \"Amount\"));\n String time = changeTime(getElementTextByTagNameNR(b, \"Time\"));\n\n\n if(users.containsKey(bidderId) == false) {\n User u = new User(bidderId);\n users.put(bidderId, u);\n }\n users.get(bidderId).location = bidderloc;\n users.get(bidderId).country = biddercoun;\n users.get(bidderId).bidRating = bidderRating;\n bids.add(bidRecord(itemId, bidderId, time, amount));\n }\n\n }\n \n \n /**************************************************************/\n \n }", "@Override\n public void endElement(String s, String s1, String element) throws SAXException {\n if (element.equalsIgnoreCase(\"sale\")) {\n\n //Add SaleSKU to Sale object\n sale.setSaleSKUSet(saleSKUSet);\n\n //check alterStatus and choose list\n\n /*if(alterStatus){\n\n // Add to the list\n salesUpdateData.add(sale);\n\n }else{*/\n\n // Add to the list\n\n //check the sale location null or zero\n try {\n\n if(sale !=null && (sale.getSalLocation() ==null || sale.getSalLocation().longValue() ==0L)){\n\n sale.setSalLocation(userLocation);\n }\n }catch (Exception e){\n\n log.info(\"Exception\"+e);\n\n }\n\n\n salesData.add(sale);\n/*\n }*/\n\n saleSKUSet=null;\n }\n\n\n // Check if the element is starting with the ITEM_CODE\n if ( element.equalsIgnoreCase(\"ITEM_CODE\")) {\n\n // Set the value read\n saleSKU.setSsuProductCode(tmpValue);\n\n }\n\n // Check if the element is starting with the ITEM_QTY\n if ( element.equalsIgnoreCase(\"ITEM_QTY\")) {\n\n // Set the value read\n saleSKU.setSsuQty(Double.parseDouble(tmpValue.equals(\"\")?\"0\":tmpValue));\n\n }\n\n\n // Check if the element is starting with the ITEM_PRICE\n if ( element.equalsIgnoreCase(\"ITEM_PRICE\")) {\n\n // Set the value read\n saleSKU.setSsuPrice(Double.parseDouble(tmpValue.equals(\"\")?\"0\":tmpValue));\n\n }\n\n // Check if the element is starting with the ITEM_DISCOUNT\n if ( element.equalsIgnoreCase(\"ITEM_DISCOUNT\")) {\n\n // Set the value read\n saleSKU.setSsuDiscountPercent(Double.parseDouble(tmpValue.equals(\"\")?\"0\":tmpValue));\n\n }\n\n\n\n\n // If the ending elenment is SALE_ITEM, then we need to add the saleSKU to the list\n if ( element.equalsIgnoreCase(\"SALE_ITEM\")) {\n\n saleSKUSet.add(saleSKU);\n\n saleSKU=null;\n\n }\n\n\n\n }", "@Override\n public void startElement(String s, String s1, String elementName, Attributes attributes) throws SAXException {\n if (elementName.equalsIgnoreCase(\"sale\")) {\n\n //make alter status false\n alterStatus=false;\n\n // Create the object\n sale = new Sale();\n\n saleSKUSet=new HashSet<SaleSKU>();\n\n //get merchantNo\n Long merchantNo=this.merchantNo;\n\n //get userNo\n Long userNo=this.userNo;\n\n //get userLocation\n Long userLocation=this.userLocation;\n\n // Hold the audit details\n String auditDetails = this.auditDetails;\n\n try{\n\n // Set the alter status\n alterStatus=(Integer.parseInt(attributes.getValue(\"ALTER_STATUS\")))==0?false:true;\n\n }catch(Exception ex){\n\n alterStatus=false;\n }\n\n // Set the merchantNo\n sale.setSalMerchantNo(merchantNo);\n\n // Set the user location\n sale.setSalLocation(userLocation);\n\n // Set the user number\n sale.setSalUserNo(userNo);\n\n if(alterStatus){\n\n //Set the updated by field\n sale.setUpdatedBy(auditDetails);\n\n }else{\n\n // Set the created by field\n sale.setCreatedBy(auditDetails);\n\n }\n\n // Set the loyatly id\n sale.setSalLoyaltyId(attributes.getValue(\"LOYALTY_ID\")==null?\"\":attributes.getValue(\"LOYALTY_ID\"));\n\n\n try{\n\n // Set the sale date\n sale.setSalDate(DBUtils.covertToSqlDate(attributes.getValue(\"DATE\")));\n\n }catch(Exception ex){\n\n // Log the file\n log.info(\"SalesMasterXMLParser - No DATE attribute\");\n\n throw new NullPointerException();\n\n }\n\n try{\n\n // Set the sale time\n sale.setSalTime(DBUtils.convertToSqlTime(attributes.getValue(\"TIME\")));\n\n }catch(Exception ex){\n\n // Log the file\n log.info(\"SalesMasterXMLParser - No TIME attribute\");\n\n\n }\n\n try{\n\n // Set the sale amount\n sale.setSalAmount(Double.parseDouble(attributes.getValue(\"TOTAL_AMOUNT\")));\n\n }catch(Exception ex){\n\n\n // Log the file\n log.info(\"SalesMasterXMLParser - No TOTAL_AMOUNT attribute\");\n\n sale.setSalAmount(0.0);\n\n //throw new NullPointerException();\n }\n\n try{\n\n // Set the reference\n sale.setSalPaymentReference(attributes.getValue(\"REFERENCE\"));\n\n\n }catch(Exception ex){\n\n // Log the file\n log.info(\"SalesMasterXMLParser - No REFERENCE attribute\");\n\n throw new NullPointerException();\n }\n\n try{\n\n // Set the reference\n String location = attributes.getValue(\"PURCHASE_LOCATION\") ==null?\"\":attributes.getValue(\"PURCHASE_LOCATION\");\n\n if(!location.equals(\"\")){\n\n Long customerLocation = getLocation(location.trim());\n\n if(customerLocation.longValue() !=0L){\n\n sale.setSalLocation(customerLocation);\n\n }else {\n\n sale.setSalLocation(userLocation);\n }\n\n }else {\n\n sale.setSalLocation(userLocation);\n }\n\n\n }catch(Exception ex){\n\n // Log the file\n log.info(\"SalesMasterXMLParser - Pue\");\n\n sale.setSalLocation(userLocation);\n\n }\n\n String paymentMode=attributes.getValue(\"PAYMENT_MODE\")==null?\"\":attributes.getValue(\"PAYMENT_MODE\");\n\n // Set the Payment Mode\n switch (paymentMode){\n\n case \"CHARGE_CARD\" :\n\n sale.setSalPaymentMode(PaymentStatusMode.CHARGE_CARD);\n\n break;\n\n case \"CASHBACK_POINTS\" :\n\n sale.setSalPaymentMode(PaymentStatusMode.CASHBACK_POINTS);\n\n break;\n\n case \"CREDIT_CARD\" :\n\n sale.setSalPaymentMode(PaymentStatusMode.CREDIT_CARD);\n\n break;\n\n case \"DEBIT_CARD\" :\n\n sale.setSalPaymentMode(PaymentStatusMode.DEBIT_CARD);\n\n break;\n\n case \"NET_BANKING\" :\n\n sale.setSalPaymentMode(PaymentStatusMode.NET_BANKING);\n\n break;\n\n case \"CASH\" :\n\n sale.setSalPaymentMode(PaymentStatusMode.CASH);\n\n break;\n default:\n break;\n }\n\n }\n\n\n // Check if the element is starting with SALE_ITEM, then its sku value\n if ( elementName.equalsIgnoreCase(\"SALE_ITEM\")) {\n\n // Set the type of the sale to sku based\n sale.setSalType(SaleType.ITEM_BASED_PURCHASE);\n\n // Create the object\n saleSKU = new SaleSKU();\n\n }\n tmpValue=\"\";\n\n }", "public boolean processXml() throws Exception {\n\t\ttry {\n\t\t\tFile f = new File(fileOutboundLocation);\n\t\t\tString filesList[] = f.list();\n\t\n\t\t\tif (filesList != null) {\n\t\t\t\tfor (int i = 0; i < filesList.length; i++) {\n\t\t\t\t\tfileName = filesList[i];\n\t\t\t\t\tAppLogger.info(\"XmlProcessor.processXml()... file Name=\"+ filesList[i]);\n\t\t\t\t\tcopyFile(filesList[i], fileOutboundLocation, fileBackupLocation);\n\t\t\t\t\tSchemaValidator sv = new SchemaValidator();\n\t\t\t\t\tsv.validateXml(fileOutboundLocation+File.separator+filesList[i], xsdFileLocation, fileErrorLocation);\n\t\t\t\t\tString xmlString = fileRead(fileOutboundLocation + File.separator+ filesList[i]);\n\n\t\t\t\t\tconvertXmlToJavaObject(xmlString);\n\t\t\t\t\tpolicyNo = tXLifeType.getTXLifeRequest().getOLifE().getHolding().getPolicy().getPolNumber(); //RL_009109 - Changed by Kayal\n\t\t\t\t\tint indexOfUnderScore = fileName.indexOf(\"_\");\n\t\t\t\t\tString backupFileName = fileName.substring(0,indexOfUnderScore+1).concat(policyNo+\"_\").concat(fileName.substring(indexOfUnderScore+1));\n\t\t\t\t\t\n\t\t\t\t\trenameFile(fileName, fileBackupLocation, backupFileName, fileBackupLocation); //RL_009109 - Changed by Kayal\n\t\t\t\t\t\n\t\t\t\t\tsaveDetails();\n\t\t\t\t\tdeleteFile(filesList[i], fileOutboundLocation);\n\n\t\t\t\t}\n\t\t\t}\n\t\t} catch (Exception e) {\n\t\t\tStringWriter sw = new StringWriter();\n\t\t\tPrintWriter pw = new PrintWriter(sw);\n\t\t\te.printStackTrace(pw);\n\t\t\tAppLogger.error(\"Error Occurred: Exception is=\"+sw.toString());\n\t\t\tcopyFile(fileName, fileOutboundLocation, fileErrorLocation);\n\t\t\tdeleteFile(fileName, fileOutboundLocation);\n\t\t\tApcDAO dao = new ApcDAO();\n\t\t\tdao.saveErrorMsg(fileName, sw.toString(), policyNo); //RL_009109\n\t\t}\n\n\t\treturn true;\n\t}", "public static void main(String[] args) {\n\t\t\r\n\t\tArrayList<Order> OrderList=new ArrayList<Order>();\r\n\t\t\r\n\t\tIterator<Order> iterator1 = OrderList.iterator();\r\n\t\t\r\n\t\tfinal List<String> tagValues1=null; \r\n\t\t\r\n\t\ttry\r\n\t\t{\r\n\t\t\tint option;\r\n\t\t\tFile file = new File(\"d:/CustomerOrder.xml\");\r\n\t\t\t\r\n\t\t\tSystem.out.println(\"Select an option 1. Print entire xml document, 2. print all orders, 3.print orders excluding a single city\");\r\n\t\t\tScanner s =new Scanner(System.in);\r\n\t\t\toption=s.nextInt();\r\n\t\t\tString xmlStr = null;\r\n\t\t\tString docname=null;\r\n\t\t\tString excludeCode=null;\r\n\t\t\tif(option==1)\r\n\t\t\t{\t\r\n\t\t\t\r\n\t\t\t\r\n\t\t\tSystem.out.println(\"Please enter the name of the XML File\");\r\n\t\t\t\r\n\t\t\tdocname=s.next();\r\n\t\t\t\r\n\t\t\txmlStr = new Scanner( new File(\"d:/\"+docname+\".xml\") ).useDelimiter(\"\\\\Z\").next();\r\n\t\t\t\r\n\t\t\t System.out.println(xmlStr);\r\n\t\t\t}\r\n\t\t\tif(option==2)\r\n\t\t\t{\r\n\t\t\t\tSystem.out.println(\"Please enter the name of the XML File\");\r\n\t\t\t\t\r\n\t\t\t\tdocname=s.next();\r\n\t\t\t\t\r\n\t\t\t\txmlStr = new Scanner( new File(\"d:/\"+docname+\".xml\") ).useDelimiter(\"\\\\Z\").next();\r\n\t\t\t\t\r\n\t\t\t\tSystem.out.println(Arrays.toString(getCustomerIDValues(xmlStr).toArray()));\r\n\t\t\t\tSystem.out.println();\r\n\t\t\t\tSystem.out.println(Arrays.toString(getShipPostalValues(xmlStr).toArray())); \r\n\t\t\t\tSystem.out.println();\r\n\t\t\t\t//System.out.println(Arrays.toString(getShippedDateValues(xmlStr).toArray())); \t\t\r\n\t\t\t}\r\n\t\t\tif(option==3)\r\n\t\t\t{\r\n\t\t\t\tSystem.out.println(\"Please enter the name of the XML File\");\r\n\t\t\t\t\r\n\t\t\t\tdocname=s.next();\r\n\t\t\t\txmlStr = new Scanner( new File(\"d:/\"+docname+\".xml\") ).useDelimiter(\"\\\\Z\").next();\r\n\t\t\t\t\r\n\t\t\t\tSystem.out.println(\"Enter thr postal code to excluded\");\r\n\t\t\t\texcludeCode=s.next();\r\n\t\t\t\tArrayList<String> CustIDs = (ArrayList<String>) getCustomerIDValues(xmlStr);\r\n\t\t\t\tArrayList<String> ShipCode =(ArrayList<String>) getShipPostalValues(xmlStr);\r\n\t\t\t\t\r\n\t\t\t\tIterator<String> iterator2 = CustIDs.iterator();\r\n\t\t\t\tIterator<String> iterator3 = ShipCode.iterator();\r\n\t\t\t\t\r\n\t\t\t\twhile(iterator2.hasNext())\r\n\t\t\t\t{\r\n\t\t\t\twhile(iterator3.hasNext())\r\n\t\t\t\t{\r\n\t\t\t\t\tif(iterator3.next().equals(excludeCode))\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tSystem.out.println(\"Code excluded\");\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\tString a=iterator2.next();\r\n\t\t\t\t\t\tString b=iterator3.next();\r\n\t\t\t\t\t\tOrder order=new Order(a,b);\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\tOrderList.add(order);\r\n\t\t\t\t\t\tSystem.out.println(\"Object added\");\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t\r\n\t\t}\r\n\t\tcatch(Exception e)\r\n\t\t{\r\n\t\t\tSystem.out.println(e);\r\n\t\t}\r\n\t\t\r\n\t\tfor (Order temp : OrderList) \r\n\t\t{\r\n\t\t\tSystem.out.println(\"Customer ID :\"+temp.CustomerID+\" Ship Postal Code :\"+temp.ShipPostalCode);\r\n\t\t}\r\n\t\t\r\n\t}", "public void parseDocument() {\n\n // Create a SAXParserFactory instance\n SAXParserFactory factory = SAXParserFactory.newInstance();\n\n // Get the today Date\n Date today = new Date(new java.util.Date().getTime());\n\n File file=new File(this.xmlFileName);\n this.fileName=file.getName();\n\n //Create Sync Status Object\n SyncStatus syncStatus= new SyncStatus();\n syncStatus.setSysMerchantNo(this.merchantNo);\n syncStatus.setSysLocation(this.userLocation);\n\n Long lastBatchIndex=syncStatusService.getLastBatchIndex(this.merchantNo, this.userLocation,SyncType.SALES, today);\n\n syncStatus.setSysBatch(lastBatchIndex!=null?lastBatchIndex+1L:1L);\n syncStatus.setSysDate(today);\n syncStatus.setSysBatchRef(this.fileName);\n syncStatus.setSysType(SyncType.SALES);\n syncStatus.setSysStatus(SyncProcessStatus.ONGOING);\n syncStatus=syncStatusService.saveSyncStatus(syncStatus);\n\n try {\n\n\n\n // Get the parser\n SAXParser parser = factory.newSAXParser();\n\n // Call the parse on the parser for the filename\n parser.parse(xmlFileName,this);\n\n //get size of salesData\n Integer noSalesData=salesData.size();\n\n //Sub list of salesData List for Batch split\n List<Sale> saleList;\n\n //To set batchEndIndex for subList\n int batchStartIndex=0;\n\n //To set batchEndIndex for subList\n int batchEndIndex=0;\n\n\n boolean isSaveStatus=true;\n\n Integer savedCount=0;\n\n //process new sales\n for(batchStartIndex=0;batchStartIndex<noSalesData;batchStartIndex=batchStartIndex+noPerBatch){\n\n //set batchEndIndex\n batchEndIndex=(batchStartIndex+noPerBatch);\n\n //set batchEndIndex as size of saleData if batchEndIndex is greater than its size\n batchEndIndex=batchEndIndex>noSalesData?noSalesData:batchEndIndex;\n\n saleList=salesData.subList(batchStartIndex,batchEndIndex);\n\n try{\n\n // Save the Sale\n saleService.saveSalesAll(saleList, auditDetails);\n\n savedCount++;\n\n }catch(InspireNetzException ex){\n\n isSaveStatus=false;\n\n log.info(\"SalesMasterXMLParser:- Save :-batch \"+syncStatus.getSysBatch()+\" : \"+batchStartIndex+\" failed\");\n\n ex.printStackTrace();\n }catch(Exception e){\n\n log.info(\"SalesMasterXMLParser:- Save :-batch sale:\"+e);\n\n e.printStackTrace();\n\n }\n\n\n }\n\n if(isSaveStatus){\n\n syncStatus.setSysStatus(SyncProcessStatus.COMPLETED);\n\n }else if(!isSaveStatus && savedCount>0){\n\n syncStatus.setSysStatus(SyncProcessStatus.PARTIALLY_COMPLETED);\n\n }else{\n\n syncStatus.setSysStatus(SyncProcessStatus.FAILED);\n\n }\n\n syncStatus=syncStatusService.saveSyncStatus(syncStatus);\n\n }catch(NullPointerException e){\n\n syncStatus.setSysStatus(SyncProcessStatus.FAILED);\n\n syncStatus=syncStatusService.saveSyncStatus(syncStatus);\n\n log.error(\"Parser Config Error \" + xmlFileName);\n\n\n e.printStackTrace();\n\n throw e;\n }\n catch (ParserConfigurationException e) {\n\n syncStatus.setSysStatus(SyncProcessStatus.FAILED);\n\n syncStatus=syncStatusService.saveSyncStatus(syncStatus);\n\n log.error(\"Parser Config Error \" + xmlFileName);\n e.printStackTrace();\n\n } catch (SAXException e) {\n\n syncStatus.setSysStatus(SyncProcessStatus.FAILED);\n\n syncStatus=syncStatusService.saveSyncStatus(syncStatus);\n\n log.error(\"SAX Exception : XML not well formed \" + xmlFileName);\n e.printStackTrace();\n\n } catch (IOException e) {\n\n syncStatus.setSysStatus(SyncProcessStatus.FAILED);\n\n syncStatus=syncStatusService.saveSyncStatus(syncStatus);\n\n log.error(\"IO Error \" + xmlFileName);\n e.printStackTrace();\n\n }catch(Exception e){\n\n syncStatus.setSysStatus(SyncProcessStatus.FAILED);\n\n syncStatus=syncStatusService.saveSyncStatus(syncStatus);\n\n log.error(e.toString() + xmlFileName);\n e.printStackTrace();\n\n }\n\n }", "public void processOrder(int orderID);", "private void testProXml(){\n\t}", "public CommandProcessXML(String filePath){\n _xmlFile = new File(filePath);\n _dbFactory = DocumentBuilderFactory.newInstance();\n }", "public void process(final String filename) throws JDOMException, IOException {\n\n // Parsing our XML file being located below \"resources\"\n final Document docInput = builder.build(\n getClass().getClassLoader().getResource(filename)\n );\n\n // Accessing the document's root element <catalog>\n final Element docRoot = docInput.getRootElement();\n\n // Accessing the <item> children of parent element <catalog>\n docRoot.getChildren().stream().\n map(item -> \"Article: \" + item.getText() +\n \", order number: \" + item.getAttributeValue(\"orderNo\")).\n forEach(System.out::println);\n }", "private static String generateXML(String userName, String hash,\n String userID, String ipAddress, String paymentToolNumber,\n String expDate, String cvc, String orderID, String amount,\n String currency) {\n\n try {\n // Create instance of DocumentBuilderFactory\n DocumentBuilderFactory factory = DocumentBuilderFactory\n .newInstance();\n // Get the DocumentBuilder\n DocumentBuilder docBuilder = factory.newDocumentBuilder();\n // Create blank DOM Document\n Document doc = docBuilder.newDocument();\n\n Element root = doc.createElement(\"GVPSRequest\");\n doc.appendChild(root);\n\n Element Mode = doc.createElement(\"Mode\");\n Mode.appendChild(doc.createTextNode(\"PROD\"));\n root.appendChild(Mode);\n\n Element Version = doc.createElement(\"Version\");\n Version.appendChild(doc.createTextNode(\"v0.01\"));\n root.appendChild(Version);\n\n Element Terminal = doc.createElement(\"Terminal\");\n root.appendChild(Terminal);\n\n Element ProvUserID = doc.createElement(\"ProvUserID\");\n // ProvUserID.appendChild(doc.createTextNode(userName));\n ProvUserID.appendChild(doc.createTextNode(\"PROVAUT\"));\n Terminal.appendChild(ProvUserID);\n\n Element HashData_ = doc.createElement(\"HashData\");\n HashData_.appendChild(doc.createTextNode(hash));\n Terminal.appendChild(HashData_);\n\n Element UserID = doc.createElement(\"UserID\");\n UserID.appendChild(doc.createTextNode(\"deneme\"));\n Terminal.appendChild(UserID);\n\n Element ID = doc.createElement(\"ID\");\n ID.appendChild(doc.createTextNode(\"10000039\"));\n Terminal.appendChild(ID);\n\n Element MerchantID = doc.createElement(\"MerchantID\");\n MerchantID.appendChild(doc.createTextNode(userID));\n Terminal.appendChild(MerchantID);\n\n Element Customer = doc.createElement(\"Customer\");\n root.appendChild(Customer);\n\n Element IPAddress = doc.createElement(\"IPAddress\");\n IPAddress.appendChild(doc.createTextNode(ipAddress));\n Customer.appendChild(IPAddress);\n\n Element EmailAddress = doc.createElement(\"EmailAddress\");\n EmailAddress.appendChild(doc.createTextNode(\"[email protected]\"));\n Customer.appendChild(EmailAddress);\n\n Element Card = doc.createElement(\"Card\");\n root.appendChild(Card);\n\n Element Number = doc.createElement(\"Number\");\n Number.appendChild(doc.createTextNode(paymentToolNumber));\n Card.appendChild(Number);\n\n Element ExpireDate = doc.createElement(\"ExpireDate\");\n ExpireDate.appendChild(doc.createTextNode(\"1212\"));\n Card.appendChild(ExpireDate);\n\n Element CVV2 = doc.createElement(\"CVV2\");\n CVV2.appendChild(doc.createTextNode(cvc));\n Card.appendChild(CVV2);\n\n Element Order = doc.createElement(\"Order\");\n root.appendChild(Order);\n\n Element OrderID = doc.createElement(\"OrderID\");\n OrderID.appendChild(doc.createTextNode(orderID));\n Order.appendChild(OrderID);\n\n Element GroupID = doc.createElement(\"GroupID\");\n GroupID.appendChild(doc.createTextNode(\"\"));\n Order.appendChild(GroupID);\n\n\t\t\t/*\n * Element Description=doc.createElement(\"Description\");\n\t\t\t * Description.appendChild(doc.createTextNode(\"\"));\n\t\t\t * Order.appendChild(Description);\n\t\t\t */\n\n Element Transaction = doc.createElement(\"Transaction\");\n root.appendChild(Transaction);\n\n Element Type = doc.createElement(\"Type\");\n Type.appendChild(doc.createTextNode(\"sales\"));\n Transaction.appendChild(Type);\n\n Element InstallmentCnt = doc.createElement(\"InstallmentCnt\");\n InstallmentCnt.appendChild(doc.createTextNode(\"\"));\n Transaction.appendChild(InstallmentCnt);\n\n Element Amount = doc.createElement(\"Amount\");\n Amount.appendChild(doc.createTextNode(amount));\n Transaction.appendChild(Amount);\n\n Element CurrencyCode = doc.createElement(\"CurrencyCode\");\n CurrencyCode.appendChild(doc.createTextNode(currency));\n Transaction.appendChild(CurrencyCode);\n\n Element CardholderPresentCode = doc\n .createElement(\"CardholderPresentCode\");\n CardholderPresentCode.appendChild(doc.createTextNode(\"0\"));\n Transaction.appendChild(CardholderPresentCode);\n\n Element MotoInd = doc.createElement(\"MotoInd\");\n MotoInd.appendChild(doc.createTextNode(\"N\"));\n Transaction.appendChild(MotoInd);\n\n // Convert dom to String\n TransformerFactory tranFactory = TransformerFactory.newInstance();\n Transformer aTransformer = tranFactory.newTransformer();\n StringWriter buffer = new StringWriter();\n aTransformer.setOutputProperty(OutputKeys.OMIT_XML_DECLARATION,\n \"yes\");\n aTransformer\n .transform(new DOMSource(doc), new StreamResult(buffer));\n return buffer.toString();\n\n } catch (Exception e) {\n return null;\n }\n\n }", "public static void main(List<String> header, List<String> items, Integer itemCount, String folder) {\n SimpleDateFormat sdf = new SimpleDateFormat(\"yyyy-MM-dd' 'HH:mm:ss.SSS\");\n String nowDate =sdf.format(new Date());\n\n ///Calculate a ship date (2 days from current?)\n Date date = new Date();\n long twoDaysFromNowTime = date.getTime();\n twoDaysFromNowTime = twoDaysFromNowTime +\n (1000 * 60 * 60 * 24 * 2);\n Date twoDaysFromNow = new Date(twoDaysFromNowTime);\n String twoDate =sdf.format(twoDaysFromNow);\n\n // Create a random number for Tracking reference\n long randomnumber = System.currentTimeMillis();\n String trkRef = String.valueOf(randomnumber);\n trkRef = (\"TRKNO\" +trkRef);\n\n for(int i = 0; i < header.size(); i++) {\n System.out.println(\"itemCount from XML \" +itemCount);\n }\n\n try {\n\n DocumentBuilderFactory docFactory = DocumentBuilderFactory.newInstance();\n DocumentBuilder docBuilder = docFactory.newDocumentBuilder();\n\n // root elements **FIXED VALUE**\n Document doc = docBuilder.newDocument();\n Element rootElement = doc.createElement(\"Update_WCS_OrderStatus\");\n doc.appendChild(rootElement);\n\n // Control **CONTROL NODE**\n Element control = doc.createElement(\"ControlArea\");\n rootElement.appendChild(control);\n\n // verb **FIXED VALUE**\n Element verb = doc.createElement(\"Verb\");\n verb.appendChild(doc.createTextNode(\"Update\"));\n control.appendChild(verb);\n\n // noun **FIXED VALUE**\n Element noun = doc.createElement(\"Noun\");\n noun.appendChild(doc.createTextNode(\"WCS_OrderStatus\"));\n control.appendChild(noun);\n\n // DataArea **CONTROL NODE**\n Element dataarea = doc.createElement(\"DataArea\");\n dataarea.appendChild(doc.createTextNode(\"\"));\n rootElement.appendChild(dataarea);\n\n // Order Status **CONTROL NODE**\n Element orderstatus = doc.createElement(\"OrderStatus\");\n orderstatus.appendChild(doc.createTextNode(\"\"));\n dataarea.appendChild(orderstatus);\n\n//** Order Status Header elements **/\n // Order Status Header **CONTROL NODE**\n Element orderstatusheader = doc.createElement(\"OrderStatusHeader\");\n orderstatusheader.appendChild(doc.createTextNode(\"\"));\n orderstatus.appendChild(orderstatusheader);\n\n /** Order Number **DYNAMIC VALUE**\n **/\n Element ordernumber = doc.createElement(\"OrderNumber\");\n ordernumber.appendChild(doc.createTextNode(header.get(0)));\n orderstatusheader.appendChild(ordernumber);\n ordernumber.setAttribute(\"type\", \"ByWCS\");\n\n /** Total Header Pricing\n * (Currency) **DYNAMIC VALUES**\n **/\n Element totalpriceinfoheader = doc.createElement(\"TotalPriceInfo\");\n orderstatusheader.appendChild(totalpriceinfoheader);\n totalpriceinfoheader.setAttribute(\"currency\", (header.get(1)));\n\n /** Total Net Price **DYNAMIC VALUES**\n **/\n Element totalnetpriceheader = doc.createElement(\"TotalNetPrice\");\n totalnetpriceheader.appendChild(doc.createTextNode(header.get(2)));\n totalpriceinfoheader.appendChild(totalnetpriceheader);\n\n /** Total Ship Price **DYNAMIC VALUES**\n **/\n Element totalshippingpriceheader = doc.createElement(\"TotalShippingPrice\");\n totalshippingpriceheader.appendChild(doc.createTextNode(header.get(3)));\n totalpriceinfoheader.appendChild(totalshippingpriceheader);\n\n /** Total Selling Price **DYNAMIC VALUES**\n **/\n Element totalsellingpriceheader = doc.createElement(\"TotalSellingPrice\");\n totalsellingpriceheader.appendChild(doc.createTextNode(header.get(4))); totalpriceinfoheader.appendChild(totalsellingpriceheader);\n\n // Order Status **FIXED VALUE**\n Element headerstatus = doc.createElement(\"Status\");\n headerstatus.appendChild(doc.createTextNode(\"S\"));\n orderstatusheader.appendChild(headerstatus);\n\n // Order Date **RUNTIME VARIABLE**\n Element placeddate = doc.createElement(\"PlacedDate\");\n placeddate.appendChild(doc.createTextNode(nowDate));\n orderstatusheader.appendChild(placeddate);\n\n // The 4 Blank customer fields ** FIXED **/\n Element cf1 = doc.createElement(\"CustomerField\");\n orderstatusheader.appendChild(cf1);\n Element cf2 = doc.createElement(\"CustomerField\");\n orderstatusheader.appendChild(cf2);\n Element cf3 = doc.createElement(\"CustomerField\");\n orderstatusheader.appendChild(cf3);\n Element cf4 = doc.createElement(\"CustomerField\");\n orderstatusheader.appendChild(cf4);\n\n//** Order Status Item elements **/\n int itemArrayCount = 0;\n for (int i = 0; i < itemCount; i++) {\n // Order Status Item **CONTROL NODE**\n Element orderstatusitem = doc.createElement(\"OrderStatusItem\");\n orderstatusitem.appendChild(doc.createTextNode(\"\"));\n orderstatus.appendChild(orderstatusitem);\n\n // Item Number WCS Value that cannot be got at. Fixed to '9999999' for now.\n Element itemnumber = doc.createElement(\"ItemNumber\");\n itemnumber.appendChild(doc.createTextNode(items.get(0 + itemArrayCount)));\n orderstatusitem.appendChild(itemnumber);\n itemnumber.setAttribute(\"type\", \"ByWCS\");\n\n /** Product Number By Merchant (SKU) **DYNAMIC VALUES**\n **/\n Element productnumberbymerchant = doc.createElement(\"ProductNumberByMerchant\");\n productnumberbymerchant.appendChild(doc.createTextNode(items.get(1 + itemArrayCount)));\n orderstatusitem.appendChild(productnumberbymerchant);\n\n // Quantity Info **CONTROL NODE**\n Element quantityinfo = doc.createElement(\"QuantityInfo\");\n orderstatusitem.appendChild(quantityinfo);\n\n /** Shipped Quantity **DYNAMIC VALUES**\n **/\n Element shippedquantity = doc.createElement(\"ShippedQuantity\");\n String itemQty = String.valueOf(items.get(2 + itemArrayCount).split(\"\\\\.\")[0]);\n shippedquantity.appendChild(doc.createTextNode(itemQty));\n quantityinfo.appendChild(shippedquantity);\n\n /** Total Item Pricing\n * (Currency) **DYNAMIC VALUE**\n **/\n Element totalpriceinfoitem = doc.createElement(\"TotalPriceInfo\");\n orderstatusitem.appendChild(totalpriceinfoitem);\n totalpriceinfoitem.setAttribute(\"currency\", (header.get(1 )));\n\n /** Item Price **DYNAMIC VALUE**\n **/\n Element totalnetpriceitem = doc.createElement(\"TotalNetPrice\");\n totalnetpriceitem.appendChild(doc.createTextNode(items.get(3 + itemArrayCount)));\n totalpriceinfoitem.appendChild(totalnetpriceitem);\n\n // Shipping Price **FIXED VALUE**\n Element totalshippingpriceitem = doc.createElement(\"TotalShippingPrice\");\n totalshippingpriceitem.appendChild(doc.createTextNode(\"0.00\"));\n totalpriceinfoitem.appendChild(totalshippingpriceitem);\n\n /** Item Price **DYNAMIC VALUE**\n **/\n Element totalsellingpriceitem = doc.createElement(\"TotalSellingPrice\");\n totalsellingpriceitem.appendChild(doc.createTextNode(items.get(3 + itemArrayCount)));\n totalpriceinfoitem.appendChild(totalsellingpriceitem);\n\n // Item status **FIXED VALUE**\n Element itemstatus = doc.createElement(\"Status\");\n itemstatus.appendChild(doc.createTextNode(\"S\"));\n orderstatusitem.appendChild(itemstatus);\n\n // Shipping Info **CONTROL NODE**\n Element shippinginfo = doc.createElement(\"ShippingInfo\");\n orderstatusitem.appendChild(shippinginfo);\n\n // Ship Date **RUN TIME VARIABLE**\n Element shippeddate = doc.createElement(\"ActualShipDate\");\n shippeddate.appendChild(doc.createTextNode(twoDate));\n shippinginfo.appendChild(shippeddate);\n\n // Ship Date **RUN TIME VARIABLE**\n Element trackingreference = doc.createElement(\"TrackingReference\");\n trackingreference.appendChild(doc.createTextNode(trkRef));\n orderstatusitem.appendChild(trackingreference);\n\n // Carrier **FIXED VALUE**\n Element carreier = doc.createElement(\"Carrier\");\n carreier.appendChild(doc.createTextNode(\"PNT\"));\n orderstatusitem.appendChild(carreier);\n itemArrayCount = (i+1) * 4;\n }\n\n // write the content into xml file\n TransformerFactory transformerFactory = TransformerFactory.newInstance();\n Transformer transformer = transformerFactory.newTransformer();\n transformer.setOutputProperty(OutputKeys.DOCTYPE_SYSTEM, \"Update_WCS_OrderStatus_30.dtd\");\n transformer.setOutputProperty(OutputKeys.INDENT, \"yes\");\n transformer.setOutputProperty(\"{http://xml.apache.org/xslt}indent-amount\", \"7\");\n DOMSource source = new DOMSource(doc);\n StreamResult result = new StreamResult(new File(\"Q:/Testing/Results/\" +folder+ \"/OR03_\"+header.get(0) +\".xml\"));\n\n // Output to console for testing\n //StreamResult result = new StreamResult(System.out);\n\n transformer.transform(source, result);\n\n System.out.println(\"File saved!\");\n\n } catch (ParserConfigurationException pce) {\n pce.printStackTrace();\n } catch (TransformerException tfe) {\n tfe.printStackTrace();\n }\n }", "public static void processCustomerMgmt() throws IOException, XMLStreamException, ParseException {\n futureNullDate = formatter.parse(\"2999-12-31\");\n deleteDatabase();\n\n XMLInputFactory xmlif = XMLInputFactory.newInstance();\n\n xmlif.setEventAllocator(new XMLEventAllocatorImpl());\n allocator = xmlif.getEventAllocator();\n\n XMLStreamReader xmlr = xmlif.createXMLStreamReader(filename, new FileInputStream(filename));\n\n int eventType = xmlr.getEventType();\n\n while (xmlr.hasNext()) {\n eventType = xmlr.next();\n\n if (eventType == XMLStreamConstants.START_ELEMENT && xmlr.getLocalName().equals(\"Action\") && mode == Mode.NULL) {\n StartElement event = getXMLEvent(xmlr).asStartElement();\n\n Attribute attr = event.getAttributeByName(new QName(\"ActionType\"));\n // System.out.println (\"Action: \" + attr.getValue());\n\n\n switch (attr.getValue()) {\n case \"NEW\":\n System.out.println(\"Start NEW\");\n mode = Mode.NEW;\n break;\n case \"ADDACCT\":\n System.out.println(\"Start ADDACCT\");\n mode = Mode.ADDACCT;\n break;\n case \"UPDCUST\":\n System.out.println(\"Start UPDCUST\");\n mode = Mode.UPDCUST;\n break;\n case \"UPDACCT\":\n System.out.println(\"Start UPDACCT\");\n mode = Mode.UPDACCT;\n break;\n case \"CLOSEACCT\":\n System.out.println(\"Start CLOSEACCT\");\n mode = Mode.CLOSEACCT;\n break;\n case \"INACT\":\n System.out.println(\"Start INACT\");\n mode = Mode.INACT;\n break;\n default:\n throw new IllegalArgumentException(\"Invalid attribute: [\" + attr.getValue() + \"]\");\n }\n\n attr = event.getAttributeByName(new QName(\"ActionTS\"));\n actionTimestamp = timeStamp.parse(attr.getValue());\n }\n\n if (eventType == XMLStreamConstants.END_ELEMENT && xmlr.getLocalName().equals(\"Action\") && mode != Mode.NULL) {\n mode = Mode.NULL;\n actionTimestamp = null;\n }\n\n\n if (eventType == XMLStreamConstants.START_ELEMENT && xmlr.getLocalName().equals(\"Customer\") && mode != Mode.NULL) {\n StartElement event = getXMLEvent(xmlr).asStartElement();\n\n accounts = new ArrayList<DimAccount>();\n String customerID;\n\n Attribute attr = event.getAttributeByName(new QName(\"C_ID\"));\n customerID = attr.getValue();\n System.out.println(\" Customer ID = [\" + customerID + \"]\");\n\n if (mode == Mode.NEW || mode == Mode.UPDCUST || mode == Mode.INACT) {\n dimCustomer = new DimCustomer();\n dimCustomer.setCustomerID(Long.parseLong(attr.getValue())); // I think this gets moved into logic below...\n\n ////////\n // Kimballian Type 2 (New Customer Record)\n dimCustomer.setIsCurrent(true);\n dimCustomer.setEffectiveDate(actionTimestamp);\n dimCustomer.setEndDate(futureNullDate);\n }\n\n if (mode == Mode.ADDACCT || mode == Mode.UPDACCT || mode == Mode.CLOSEACCT) {\n dimCustomer = DimCustomer.find.where().eq(\"customer_id\", customerID).eq(\"is_current\", \"1\").findUnique();\n }\n\n // Copy the original row before making any changes...\n if (mode == Mode.UPDCUST || mode == Mode.INACT) {\n DimCustomer dimCustomerOld = DimCustomer.find.where().eq(\"customer_id\", customerID).eq(\"is_current\", \"1\").findUnique();\n DimCustomer.copyData(dimCustomerOld, dimCustomer);\n\n ////////\n // Kimballian Type 2 (Old Customer Record)\n dimCustomerOld.setIsCurrent(false);\n dimCustomerOld.setEndDate(actionTimestamp);\n dimCustomerOld.save();\n dimCustomerOld = null;\n System.out.println(\" Copy old customer record\");\n }\n\n if (mode == Mode.NEW) {\n dimCustomer.setStatus(\"Active\");\n }\n\n if (mode == Mode.INACT) {\n dimCustomer.setStatus(\"Inactive\");\n }\n\n attr = event.getAttributeByName(new QName(\"C_TAX_ID\"));\n if (attr != null) {\n dimCustomer.setTaxID(attr.getValue());\n }\n\n attr = event.getAttributeByName(new QName(\"C_GNDR\"));\n if (attr != null) {\n dimCustomer.setGender(attr.getValue());\n }\n\n attr = event.getAttributeByName(new QName(\"C_TIER\"));\n if (attr != null) {\n if (!attr.getValue().trim().isEmpty()) {\n dimCustomer.setTier(Integer.parseInt(attr.getValue()));\n }\n else {\n dimCustomer.setTier(null);\n }\n }\n\n attr = event.getAttributeByName(new QName(\"C_DOB\"));\n if (attr != null) {\n dimCustomer.setDob(formatter.parse(attr.getValue()));\n }\n\n } // START_ELEMENT \"Customer\"\n\n\n if (eventType == XMLStreamConstants.END_ELEMENT && xmlr.getLocalName().equals(\"Customer\") && mode != Mode.NULL) {\n if (mode == Mode.NEW || mode == Mode.UPDCUST || mode == Mode.INACT) {\n dimCustomer.save();\n System.out.println(\" Save customer UID = [\" + dimCustomer.getsK_CustomerID() + \"] Customer ID = [\" + dimCustomer.getCustomerID() + \"]\");\n }\n\n // Iterate over accounts\n for (DimAccount account : accounts) {\n account.setsK_CustomerId(dimCustomer.getsK_CustomerID());\n account.save();\n System.out.println(\" Save account UID = [\" + account.getsK_AccountId() + \"] Account ID = [\" + account.getAccountID() + \"]\");\n }\n\n //for (DimAccount account : accounts) { // I'm going for an explicit delete... just in case GC can't sort it out.\n // accounts.remove(account);\n //}\n accounts = null;\n dimCustomer = null;\n } // END_ELEMENT \"Customer\"\n\n\n if (eventType == XMLStreamConstants.START_ELEMENT && xmlr.getLocalName().equals(\"Account\") && mode != Mode.NULL) {\n StartElement event = getXMLEvent(xmlr).asStartElement();\n\n Attribute attr = event.getAttributeByName(new QName(\"CA_ID\"));\n String accountID = attr.getValue();\n System.out.println(\" Account ID = [\" + accountID + \"]\");\n\n // If we're here, we will always create a new account...\n dimAccount = new DimAccount();\n dimAccount.setAccountID(accountID);\n\n ////////\n // Kimballian Type 2 (New Account Record)\n dimAccount.setIsCurrent(true);\n dimAccount.setEffectiveDate(actionTimestamp);\n dimAccount.setEndDate(futureNullDate);\n\n if (mode == Mode.UPDACCT || mode == Mode.CLOSEACCT) {\n DimAccount dimAccountOld = DimAccount.find.where().eq(\"account_id\", accountID).eq(\"is_current\", \"1\").findUnique();\n DimAccount.copyData(dimAccountOld, dimAccount);\n\n ////////\n // Kimballian Type 2 (Old Account Record)\n dimAccountOld.setIsCurrent(false);\n dimAccountOld.setEndDate(actionTimestamp);\n dimAccountOld.save();\n dimAccountOld = null;\n System.out.println(\" Copy old account record\");\n }\n\n if (mode == Mode.NEW || mode == Mode.ADDACCT) {\n dimAccount.setStatus(\"Active\");\n }\n\n if (mode == Mode.CLOSEACCT) {\n dimAccount.setStatus(\"Inactive\");\n }\n\n attr = event.getAttributeByName(new QName(\"CA_TAX_ST\"));\n if (attr != null) {\n dimAccount.setTaxStatus(attr.getValue());\n }\n\n } // START_ELEMENT \"Account\"\n\n\n if (eventType == XMLStreamConstants.END_ELEMENT && xmlr.getLocalName().equals(\"Account\") && mode != Mode.NULL) {\n accounts.add(dimAccount);\n\n dimAccount = null;\n }\n\n\n if (eventType == XMLStreamConstants.CHARACTERS) {\n tagContent = xmlr.getText().trim();\n }\n\n else if (eventType == XMLStreamConstants.END_ELEMENT && xmlr.getLocalName().equals(\"C_L_NAME\") && mode != Mode.NULL) {\n dimCustomer.setLastName(tagContent);\n }\n else if (eventType == XMLStreamConstants.END_ELEMENT && xmlr.getLocalName().equals(\"C_F_NAME\") && mode != Mode.NULL) {\n dimCustomer.setFirstName(tagContent);\n }\n else if (eventType == XMLStreamConstants.END_ELEMENT && xmlr.getLocalName().equals(\"C_M_NAME\") && mode != Mode.NULL) {\n dimCustomer.setMiddleInitial(tagContent);\n }\n else if (eventType == XMLStreamConstants.END_ELEMENT && xmlr.getLocalName().equals(\"C_ADLINE1\") && mode != Mode.NULL) {\n dimCustomer.setAddressLine1(tagContent);\n }\n else if (eventType == XMLStreamConstants.END_ELEMENT && xmlr.getLocalName().equals(\"C_ADLINE2\") && mode != Mode.NULL) {\n dimCustomer.setAddressLine2(tagContent);\n }\n else if (eventType == XMLStreamConstants.END_ELEMENT && xmlr.getLocalName().equals(\"C_ZIPCODE\") && mode != Mode.NULL) {\n dimCustomer.setPostalCode(tagContent);\n }\n else if (eventType == XMLStreamConstants.END_ELEMENT && xmlr.getLocalName().equals(\"C_CITY\") && mode != Mode.NULL) {\n dimCustomer.setCity(tagContent);\n }\n else if (eventType == XMLStreamConstants.END_ELEMENT && xmlr.getLocalName().equals(\"C_STATE_PROV\") && mode != Mode.NULL) {\n dimCustomer.setStateProv(tagContent);\n }\n else if (eventType == XMLStreamConstants.END_ELEMENT && xmlr.getLocalName().equals(\"C_CTRY\") && mode != Mode.NULL) {\n dimCustomer.setCountry(tagContent);\n }\n else if (eventType == XMLStreamConstants.END_ELEMENT && xmlr.getLocalName().equals(\"C_PRIM_EMAIL\") && mode != Mode.NULL) {\n dimCustomer.seteMail1(tagContent);\n }\n else if (eventType == XMLStreamConstants.END_ELEMENT && xmlr.getLocalName().equals(\"C_ALT_EMAIL\") && mode != Mode.NULL) {\n dimCustomer.seteMail2(tagContent);\n }\n else if (eventType == XMLStreamConstants.END_ELEMENT && xmlr.getLocalName().equals(\"CA_B_ID\") && mode != Mode.NULL) {\n dimAccount.setBrokerId(tagContent);\n }\n else if (eventType == XMLStreamConstants.END_ELEMENT && xmlr.getLocalName().equals(\"CA_NAME\") && mode != Mode.NULL) {\n dimAccount.setAccountDesc(tagContent);\n }\n else if (eventType == XMLStreamConstants.START_ELEMENT && xmlr.getLocalName().equals(\"C_PHONE_1\") && mode != Mode.NULL) {\n phone = \"\";\n }\n else if (eventType == XMLStreamConstants.START_ELEMENT && xmlr.getLocalName().equals(\"C_PHONE_2\") && mode != Mode.NULL) {\n phone = \"\";\n }\n else if (eventType == XMLStreamConstants.START_ELEMENT && xmlr.getLocalName().equals(\"C_PHONE_3\") && mode != Mode.NULL) {\n phone = \"\";\n }\n else if (eventType == XMLStreamConstants.END_ELEMENT && xmlr.getLocalName().equals(\"C_CTRY_CODE\") && mode != Mode.NULL) {\n if (!tagContent.trim().isEmpty()) {\n phone += \"+\" + tagContent;\n }\n }\n else if (eventType == XMLStreamConstants.END_ELEMENT && xmlr.getLocalName().equals(\"C_AREA_CODE\") && mode != Mode.NULL) {\n if (!tagContent.trim().isEmpty()) {\n phone += \" (\" + tagContent + \")\";\n }\n }\n else if (eventType == XMLStreamConstants.END_ELEMENT && xmlr.getLocalName().equals(\"C_LOCAL\") && mode != Mode.NULL) {\n if (!tagContent.trim().isEmpty()) {\n phone += \" \" + tagContent;\n }\n }\n else if (eventType == XMLStreamConstants.END_ELEMENT && xmlr.getLocalName().equals(\"C_EXT\") && mode != Mode.NULL) {\n if (!tagContent.trim().isEmpty()) {\n phone += \" x\" + tagContent;\n }\n }\n else if (eventType == XMLStreamConstants.END_ELEMENT && xmlr.getLocalName().equals(\"C_PHONE_1\") && mode != Mode.NULL) {\n dimCustomer.setPhone1(phone.trim());\n phone = \"\";\n }\n else if (eventType == XMLStreamConstants.END_ELEMENT && xmlr.getLocalName().equals(\"C_PHONE_2\") && mode != Mode.NULL) {\n dimCustomer.setPhone2(phone.trim());\n phone = \"\";\n }\n else if (eventType == XMLStreamConstants.END_ELEMENT && xmlr.getLocalName().equals(\"C_PHONE_3\") && mode != Mode.NULL) {\n dimCustomer.setPhone3(phone.trim());\n phone = \"\";\n }\n\n }\n }", "public void persist() {\n\t\ttry {\n\t\t\tFileOutputStream fos = this._context.openFileOutput(\n\t\t\t\t\tConstants.CATALOG_XML_FILE_NAME, Context.MODE_PRIVATE);\n\t\t\tfos.write(\"<?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\" ?>\\n\".getBytes());\n\t\t\tfos.write(\"<orders>\\n\".getBytes());\n\t\t\tfor (int i = 0; i < getOrderEntryCount(); i++) {\n\t\t\t\tOrderEntry oe = getOrderEntry(i);\n\t\t\t\tfos.write(oe.toXMLString().getBytes());\n\t\t\t}\n\t\t\tfos.write(\"</orders>\\n\".getBytes());\n\t\t\tfos.flush();\n\t\t\tfos.close();\n\t\t}\n\t\tcatch (Exception e) {\n\t\t\tLog.d(Constants.LOGTAG, \" \" + OrderList.CLASSTAG\n\t\t\t\t\t+ \"Failed to write out file?\" + e.getMessage());\n\t\t}\n\t}", "public void writeXMLFinisher() {\n\t\tJavaIO.createXMLFile(getCurrentPath(), \"coveragePriorJ.xml\", \"</list>\", true);\n\t}", "@Override\n public YFCDocument invoke(YFCDocument inXml) {\n \n YFCElement inEle = inXml.getDocumentElement();\n YFCIterable<YFCElement> yfsItrator = inEle.getChildren(XMLLiterals.ITEM);\n for(YFCElement itemEle : yfsItrator) {\n YFCDocument itemListDoc = YFCDocument.createDocument(XMLLiterals.ITEM_LIST);\n YFCElement itemListEle = itemListDoc.getDocumentElement();\n itemEle.setAttribute(XMLLiterals.ORGANIZATION_CODE, INDIGO_CA);\n itemEle.setAttribute(XMLLiterals.UNIT_OF_MEASURE, EACH);\n itemListEle.importNode(itemEle);\n invokeYantraService(ITEM_LOAD_Q, itemListDoc);\n }\n return inXml;\n }", "@Override\n public void endElement(String uri, String localName, String qName) throws SAXException {\n\n //Verificar se a TAG 'produto' chegou ao fim. Se chegou podemos adicionar o produto no array\n if(qName.equals(\"produto\")) {\n\n produtos.add(produto);\n \n //Verificar se a TAG nome hegou ao fim. se chegou podemos atribui-la ao produto\n } else if(qName.equals(\"nome\")) {\n\n produto.setNome(conteudo.toString());\n\n //Verificar se a TAG preco hegou ao fim. se chegou podemos atribui-la ao produto\n } else if(qName.equals(\"preco\")) {\n\n produto.setPreco(Double.parseDouble(conteudo.toString()));\n }\n\n\n }", "@ProcessElement public void process(ProcessContext c) {\n MyProduct elem = c.element();\n c.output(KV.of(elem.getId(), elem));\n }", "public void processElementProlog(Element node) \r\n\tthrows Exception \r\n\t{\r\n\tWriter xml = getWriter();\r\n\txml.write(getIndent());\r\n\txml.write(\"<\");\r\n\txml.write(node.getTagName());\r\n\txml.write(\">\\n\");\r\n\tindentMore();\r\n\treturn;\t\r\n\t}", "public void processOrders() \n\t{\n\t\tfor(int index = 0; index < orderList.size(); index++)\n\t\t{\t\n\t\t\t//process the order and possibly promote the customer object\n\t\t\tcustomerArrayHolder.processOrder(orderList.get(index));\n\t\t}\n\t\torderList.clear(); //should prevent memory leaks, not sure if necessary\n\t}", "public static OrderStatus parse(javax.xml.stream.XMLStreamReader reader) throws java.lang.Exception{\n OrderStatus object =\n new OrderStatus();\n\n int event;\n java.lang.String nillableValue = null;\n java.lang.String prefix =\"\";\n java.lang.String namespaceuri =\"\";\n try {\n \n while (!reader.isStartElement() && !reader.isEndElement())\n reader.next();\n\n \n if (reader.getAttributeValue(\"http://www.w3.org/2001/XMLSchema-instance\",\"type\")!=null){\n java.lang.String fullTypeName = reader.getAttributeValue(\"http://www.w3.org/2001/XMLSchema-instance\",\n \"type\");\n if (fullTypeName!=null){\n java.lang.String nsPrefix = null;\n if (fullTypeName.indexOf(\":\") > -1){\n nsPrefix = fullTypeName.substring(0,fullTypeName.indexOf(\":\"));\n }\n nsPrefix = nsPrefix==null?\"\":nsPrefix;\n\n java.lang.String type = fullTypeName.substring(fullTypeName.indexOf(\":\")+1);\n \n if (!\"OrderStatus\".equals(type)){\n //find namespace for the prefix\n java.lang.String nsUri = reader.getNamespaceContext().getNamespaceURI(nsPrefix);\n return (OrderStatus)ExtensionMapper.getTypeObject(\n nsUri,type,reader);\n }\n \n\n }\n \n\n }\n\n \n\n \n // Note all attributes that were handled. Used to differ normal attributes\n // from anyAttributes.\n java.util.Vector handledAttributes = new java.util.Vector();\n \n\n \n \n reader.next();\n \n \n while (!reader.isStartElement() && !reader.isEndElement()) reader.next();\n \n if (reader.isStartElement() && new javax.xml.namespace.QName(\"\",\"OrderID\").equals(reader.getName())){\n \n nillableValue = reader.getAttributeValue(\"http://www.w3.org/2001/XMLSchema-instance\",\"nil\");\n if (\"true\".equals(nillableValue) || \"1\".equals(nillableValue)){\n throw new org.apache.axis2.databinding.ADBException(\"The element: \"+\"OrderID\" +\" cannot be null\");\n }\n \n\n java.lang.String content = reader.getElementText();\n \n object.setOrderID(\n org.apache.axis2.databinding.utils.ConverterUtil.convertToString(content));\n \n reader.next();\n \n } // End of if for expected property start element\n \n else{\n // A start element we are not expecting indicates an invalid parameter was passed\n throw new org.apache.axis2.databinding.ADBException(\"Unexpected subelement \" + reader.getName());\n }\n \n \n while (!reader.isStartElement() && !reader.isEndElement()) reader.next();\n \n if (reader.isStartElement() && new javax.xml.namespace.QName(\"\",\"OrderStatus\").equals(reader.getName())){\n \n nillableValue = reader.getAttributeValue(\"http://www.w3.org/2001/XMLSchema-instance\",\"nil\");\n if (\"true\".equals(nillableValue) || \"1\".equals(nillableValue)){\n throw new org.apache.axis2.databinding.ADBException(\"The element: \"+\"OrderStatus\" +\" cannot be null\");\n }\n \n\n java.lang.String content = reader.getElementText();\n \n object.setOrderStatus(\n org.apache.axis2.databinding.utils.ConverterUtil.convertToString(content));\n \n reader.next();\n \n } // End of if for expected property start element\n \n else{\n // A start element we are not expecting indicates an invalid parameter was passed\n throw new org.apache.axis2.databinding.ADBException(\"Unexpected subelement \" + reader.getName());\n }\n \n while (!reader.isStartElement() && !reader.isEndElement())\n reader.next();\n \n if (reader.isStartElement())\n // A start element we are not expecting indicates a trailing invalid property\n throw new org.apache.axis2.databinding.ADBException(\"Unexpected subelement \" + reader.getName());\n \n\n\n\n } catch (javax.xml.stream.XMLStreamException e) {\n throw new java.lang.Exception(e);\n }\n\n return object;\n }", "@Override\n public void endElement(String str1, String str2, String element) throws SAXException {\n \n if (element.equals(\"phone\")) {\n phones.put(\"S\"+x, phone);\n x++;\n\n return;\n }\n if (element.equalsIgnoreCase(\"phoneImage\")) {\n phone.setImage(elementValueRead);\n\n return;\n }\n if (element.equalsIgnoreCase(\"phoneName\")) {\n phone.setName(elementValueRead);\n\n return;\n }\n if (element.equalsIgnoreCase(\"phoneCompany\")) {\n phone.setCompany(elementValueRead);\n\n return;\n }\n if (element.equalsIgnoreCase(\"phoneCondition\")) {\n phone.setCondition(elementValueRead);\n\n return;\n }\n if(element.equalsIgnoreCase(\"phonePrice\")){\n phone.setPrice(Float.parseFloat(elementValueRead));\n\n return;\n }\n if(element.equalsIgnoreCase(\"phoneColor\")){\n phone.setColor(elementValueRead);\n \n return;\n }\n if(element.equalsIgnoreCase(\"phoneDescription\")){\n phone.setDescription(elementValueRead);\n return;\n }\n\t\t\nif(element.equalsIgnoreCase(\"phoneQuantity\")){\n phone.setQty(Integer.parseInt(elementValueRead));\n return;\n }\n \n if(element.equalsIgnoreCase(\"phoneRebate\")){\n phone.setRebate(elementValueRead);\n return;\n }\n\t\tif(element.equalsIgnoreCase(\"phoneRebateName\")){\n phone.setRebateName(elementValueRead);\n return;\n }\n\t\tif(element.equalsIgnoreCase(\"phoneOriginal\")){\n phone.setOriginal(Float.parseFloat(elementValueRead));\n\t\t\t\n\t return;\n }\n\t\tif(element.equalsIgnoreCase(\"phoneSale\")){\n phone.setSale(elementValueRead);\n return;\n }\n//Fetching values of Smart Watches\n\n if (element.equals(\"smartwatch\")) {\n smartwatches.put(\"T\"+y, watch);\n y++;\n return;\n }\n if (element.equalsIgnoreCase(\"watchImage\")) {\n watch.setImage(elementValueRead);\n return;\n }\n if (element.equalsIgnoreCase(\"watchName\")) {\n watch.setName(elementValueRead);\n return;\n }\n if (element.equalsIgnoreCase(\"watchCompany\")) {\n watch.setCompany(elementValueRead);\n return;\n }\n if (element.equalsIgnoreCase(\"watchCondition\")) {\n watch.setCondition(elementValueRead);\n return;\n }\n if(element.equalsIgnoreCase(\"watchPrice\")){\n watch.setPrice(Float.parseFloat(elementValueRead));\n return;\n }\n if(element.equalsIgnoreCase(\"watchColor\")){\n watch.setColor(elementValueRead);\n return;\n }\n if(element.equalsIgnoreCase(\"watchDescription\")){\n watch.setDescription(elementValueRead);\n //watches.put(\"T\", watch);\n return;\n }\n\t\tif(element.equalsIgnoreCase(\"watchQuantity\")){\n watch.setQty(Integer.parseInt(elementValueRead));\n return;\n }\n if(element.equalsIgnoreCase(\"watchRebate\")){\n watch.setRebate(elementValueRead);\n return;\n }\n\t\tif(element.equalsIgnoreCase(\"watchRebateName\")){\n watch.setRebateName(elementValueRead);\n return;\n }\n\t\tif(element.equalsIgnoreCase(\"watchOriginal\")){\n watch.setOriginal(Float.parseFloat(elementValueRead));\n\t\t\t\n\t return;\n }\n\t\tif(element.equalsIgnoreCase(\"watchSale\")){\n watch.setSale(elementValueRead);\n return;\n }\n \n// Fetching values of Laptops\n\n if (element.equals(\"laptop\")) {\n laptops.put(\"L\"+z, laptop);\n z++;\n return;\n }\n if (element.equalsIgnoreCase(\"laptopImage\")) {\n laptop.setImage(elementValueRead);\n return;\n }\n if (element.equalsIgnoreCase(\"laptopName\")) {\n laptop.setName(elementValueRead);\n return;\n }\n if (element.equalsIgnoreCase(\"laptopCompany\")) {\n laptop.setCompany(elementValueRead);\n return;\n }\n if (element.equalsIgnoreCase(\"laptopCondition\")) {\n laptop.setCondition(elementValueRead);\n return;\n }\n if(element.equalsIgnoreCase(\"laptopPrice\")){\n laptop.setPrice(Float.parseFloat(elementValueRead));\n return;\n }\n if(element.equalsIgnoreCase(\"laptopColor\")){\n laptop.setColor(elementValueRead);\n return;\n }\n if(element.equalsIgnoreCase(\"laptopDescription\")){\n laptop.setDescription(elementValueRead);\n //laptops.put(\"L\", laptop);\n return;\n }\n\t\tif(element.equalsIgnoreCase(\"laptopQuantity\")){\n laptop.setQty(Integer.parseInt(elementValueRead));\n return;\n }\n if(element.equalsIgnoreCase(\"laptopRebate\")){\n laptop.setRebate(elementValueRead);\n return;\n }\n\t\tif(element.equalsIgnoreCase(\"laptopRebateName\")){\n laptop.setRebateName(elementValueRead);\n return;\n }\n\t\tif(element.equalsIgnoreCase(\"laptopOriginal\")){\n laptop.setOriginal(Float.parseFloat(elementValueRead));\n\t\t\t\n\t return;\n }\n\t\tif(element.equalsIgnoreCase(\"laptopSale\")){\n laptop.setSale(elementValueRead);\n return;\n }\n\n\n// Fetching values of Speakers\n\n\n\n if (element.equals(\"speaker\")) {\n speakers.put(\"S\"+s, speaker);\n s++;\n return;\n }\n if (element.equalsIgnoreCase(\"speakerImage\")) {\n speaker.setImage(elementValueRead);\n return;\n }\n if (element.equalsIgnoreCase(\"speakerName\")) {\n speaker.setName(elementValueRead);\n return;\n }\n if (element.equalsIgnoreCase(\"speakerCompany\")) {\n speaker.setCompany(elementValueRead);\n return;\n }\n if (element.equalsIgnoreCase(\"speakerCondition\")) {\n speaker.setCondition(elementValueRead);\n return;\n }\n if(element.equalsIgnoreCase(\"speakerPrice\")){\n speaker.setPrice(Float.parseFloat(elementValueRead));\n return;\n }\n if(element.equalsIgnoreCase(\"speakerColor\")){\n speaker.setColor(elementValueRead);\n return;\n }\n if(element.equalsIgnoreCase(\"speakerDescription\")){\n speaker.setDescription(elementValueRead);\n //speakers.put(\"Tv\", speaker);\n return;\n }\n if(element.equalsIgnoreCase(\"speakerQuantity\")){\n speaker.setQty(Integer.parseInt(elementValueRead));\n return;\n }\nif(element.equalsIgnoreCase(\"speakerRebate\")){\n speaker.setRebate(elementValueRead);\n return;\n }\n\t\tif(element.equalsIgnoreCase(\"speakerRebateName\")){\n speaker.setRebateName(elementValueRead);\n return;\n }\n\t\tif(element.equalsIgnoreCase(\"speakerOriginal\")){\n speaker.setOriginal(Float.parseFloat(elementValueRead));\n\t\t\t\n\t return;\n }\n\t\tif(element.equalsIgnoreCase(\"speakerSale\")){\n speaker.setSale(elementValueRead);\n return;\n }\n\n\nif (element.equals(\"headphone\")) {\n headphones.put(\"H\"+h, headphone);\n h++;\n return;\n }\n if (element.equalsIgnoreCase(\"headphoneImage\")) {\n headphone.setImage(elementValueRead);\n return;\n }\n if (element.equalsIgnoreCase(\"headphoneName\")) {\n headphone.setName(elementValueRead);\n return;\n }\n if (element.equalsIgnoreCase(\"headphoneCompany\")) {\n headphone.setCompany(elementValueRead);\n return;\n }\n if (element.equalsIgnoreCase(\"headphoneCondition\")) {\n headphone.setCondition(elementValueRead);\n return;\n }\n if(element.equalsIgnoreCase(\"headphonePrice\")){\n headphone.setPrice(Float.parseFloat(elementValueRead));\n return;\n }\n if(element.equalsIgnoreCase(\"headphoneColor\")){\n headphone.setColor(elementValueRead);\n return;\n }\n if(element.equalsIgnoreCase(\"headphoneDescription\")){\n headphone.setDescription(elementValueRead);\n //speakers.put(\"Tv\", speaker);\n return;\n }\n\t\tif(element.equalsIgnoreCase(\"headphoneQuantity\")){\n headphone.setQty(Integer.parseInt(elementValueRead));\n return;\n }\n if(element.equalsIgnoreCase(\"headphoneRebate\")){\n headphone.setRebate(elementValueRead);\n return;\n }\n\t\tif(element.equalsIgnoreCase(\"headphoneRebateName\")){\n headphone.setRebateName(elementValueRead);\n return;\n }\n\t\tif(element.equalsIgnoreCase(\"headphoneOriginal\")){\n headphone.setOriginal(Float.parseFloat(elementValueRead));\n\t\t\t\n\t return;\n }\n\t\tif(element.equalsIgnoreCase(\"headphoneSale\")){\n headphone.setSale(elementValueRead);\n return;\n }\n\t\t\n\t\t\nif (element.equals(\"externalstorage\")) {\n externalstorages.put(\"E\"+e, externalstorage);\n e++;\n return;\n }\n if (element.equalsIgnoreCase(\"externalstorageImage\")) {\n externalstorage.setImage(elementValueRead);\n return;\n }\n if (element.equalsIgnoreCase(\"externalstorageName\")) {\n externalstorage.setName(elementValueRead);\n return;\n }\n if (element.equalsIgnoreCase(\"externalstorageCompany\")) {\n externalstorage.setCompany(elementValueRead);\n return;\n }\n if (element.equalsIgnoreCase(\"externalstorageCondition\")) {\n externalstorage.setCondition(elementValueRead);\n return;\n }\n if(element.equalsIgnoreCase(\"externalstoragePrice\")){\n externalstorage.setPrice(Float.parseFloat(elementValueRead));\n return;\n }\n if(element.equalsIgnoreCase(\"externalstorageColor\")){\n externalstorage.setColor(elementValueRead);\n return;\n }\n if(element.equalsIgnoreCase(\"externalstorageDescription\")){\n externalstorage.setDescription(elementValueRead);\n //speakers.put(\"Tv\", speaker);\n return;\n }\n\t\tif(element.equalsIgnoreCase(\"externalstorageQuantity\")){\n externalstorage.setQty(Integer.parseInt(elementValueRead));\n return;\n }\n\t\tif(element.equalsIgnoreCase(\"externalstorageRebate\")){\n externalstorage.setRebate(elementValueRead);\n return;\n }\n\t\tif(element.equalsIgnoreCase(\"externalstorageRebateName\")){\n externalstorage.setRebateName(elementValueRead);\n return;\n }\n\t\tif(element.equalsIgnoreCase(\"externalstorageOriginal\")){\n externalstorage.setOriginal(Float.parseFloat(elementValueRead));\n\t\t\t\n\t return;\n }\n\t\tif(element.equalsIgnoreCase(\"externalstorageSale\")){\n externalstorage.setSale(elementValueRead);\n return;\n }\n\t\t\n\t\t\n\t\t\n if (element.equals(\"accessory\")) {\n\t\t\taccessories.put(\"A\"+a, accessory);\n\t\t\ta++;\n\t\t\t\n\t return;\n }\n if (element.equalsIgnoreCase(\"accessoryImage\")) {\n accessory.setImage(elementValueRead);\n\t\t\n\t return;\n }\n if (element.equalsIgnoreCase(\"accessoryName\")) {\n accessory.setName(elementValueRead);\n\t\t\t\n\t return;\n }\n\t\tif (element.equalsIgnoreCase(\"accessoryCompany\")) {\n accessory.setCompany(elementValueRead);\n\t\t\t\n\t return;\n }\n\t\tif (element.equalsIgnoreCase(\"accessoryCondition\")) {\n accessory.setCondition(elementValueRead);\n\t\t\t\n\t return;\n }\n\t\tif(element.equalsIgnoreCase(\"accessoryPrice\")){\n accessory.setPrice(Float.parseFloat(elementValueRead));\n\t\t\t\n\t return;\n }\n if(element.equalsIgnoreCase(\"accessoryColor\")){\n accessory.setColor(elementValueRead);\n\t\t \n\t return;\n }\n\t\tif(element.equalsIgnoreCase(\"accessoryDescription\")){\n accessory.setDescription(elementValueRead);\n\t return;\n }\n\t\tif(element.equalsIgnoreCase(\"accessoryQuantity\")){\n accessory.setQty(Integer.parseInt(elementValueRead));\n return;\n }\n\t\tif(element.equalsIgnoreCase(\"accessoryRebate\")){\n accessory.setRebate(elementValueRead);\n return;\n }\n\t\tif(element.equalsIgnoreCase(\"accessoryRebateName\")){\n accessory.setRebateName(elementValueRead);\n return;\n }\n\t\tif(element.equalsIgnoreCase(\"accessoryOriginal\")){\n accessory.setOriginal(Float.parseFloat(elementValueRead));\n\t\t\t\n\t return;\n }\n\t\tif(element.equalsIgnoreCase(\"accessorySale\")){\n accessory.setSale(elementValueRead);\n return;\n }\n\t\t\n\t\t\n\t\t\n\t}", "public final void process() {\n parseReport();\n checkThreshold();\n updateQualityXML();\n }", "public void save() {\n int hour = Calendar.getInstance().get(Calendar.HOUR_OF_DAY);\r\n int minute = Calendar.getInstance().get(Calendar.MINUTE);\r\n\r\n // Hierarchie: 2010/04/05/01_05042010_00002.xml\r\n File dir = getOutputDir();\r\n File f = new File(dir, getCode().replace(' ', '_') + \".xml\");\r\n Element topLevel = new Element(\"ticket\");\r\n topLevel.setAttribute(new Attribute(\"code\", this.getCode()));\r\n topLevel.setAttribute(\"hour\", String.valueOf(hour));\r\n topLevel.setAttribute(\"minute\", String.valueOf(minute));\r\n // Articles\r\n for (Pair<Article, Integer> item : this.items) {\r\n Element e = new Element(\"article\");\r\n e.setAttribute(\"qte\", String.valueOf(item.getSecond()));\r\n // Prix unitaire\r\n e.setAttribute(\"prix\", String.valueOf(item.getFirst().getPriceInCents()));\r\n e.setAttribute(\"prixHT\", String.valueOf(item.getFirst().getPriceHTInCents()));\r\n e.setAttribute(\"idTaxe\", String.valueOf(item.getFirst().getIdTaxe()));\r\n e.setAttribute(\"categorie\", item.getFirst().getCategorie().getName());\r\n e.setAttribute(\"codebarre\", item.getFirst().getCode());\r\n e.setText(item.getFirst().getName());\r\n topLevel.addContent(e);\r\n }\r\n // Paiements\r\n for (Paiement paiement : this.paiements) {\r\n final int montantInCents = paiement.getMontantInCents();\r\n if (montantInCents > 0) {\r\n final Element e = new Element(\"paiement\");\r\n String type = \"\";\r\n if (paiement.getType() == Paiement.CB) {\r\n type = \"CB\";\r\n } else if (paiement.getType() == Paiement.CHEQUE) {\r\n type = \"CHEQUE\";\r\n } else if (paiement.getType() == Paiement.ESPECES) {\r\n type = \"ESPECES\";\r\n }\r\n e.setAttribute(\"type\", type);\r\n e.setAttribute(\"montant\", String.valueOf(montantInCents));\r\n topLevel.addContent(e);\r\n }\r\n\r\n }\r\n try {\r\n final XMLOutputter out = new XMLOutputter(Format.getPrettyFormat());\r\n out.output(topLevel, new FileOutputStream(f));\r\n } catch (IOException e) {\r\n e.printStackTrace();\r\n }\r\n\r\n }", "@Override\n public void parseXml(Element ele, LoadContext lc) {\n\n }", "public void processElementEpilog(Element node) \r\n\tthrows Exception \r\n\t{\r\n\tWriter xml = getWriter();\r\n\tindentLess();\r\n\txml.write(getIndent());\r\n\txml.write(\"</\");\r\n\txml.write(node.getNodeName());\r\n\txml.write(\">\\n\");\r\n\treturn;\t\r\n\t}", "public void writeToXML(){\n\t\t\n\t\t String s1 = \"\";\n\t\t String s2 = \"\";\n\t\t String s3 = \"\";\n\t\t Element lastElement= null;\n\t\t\n\t\tDocumentBuilderFactory dbfactory = DocumentBuilderFactory.newInstance();\n\t\tDocumentBuilder dbElement;\n\t\tBufferedReader brRead=null;\n\n\t\ttry{\n\t\t\tdbElement = dbfactory.newDocumentBuilder();\n\t\t\t\n\t\t\t//Create the root\n\t\t\tDocument docRoot = dbElement.newDocument();\n\t\t\tElement rootElement = docRoot.createElement(\"ROYAL\");\n\t\t\tdocRoot.appendChild(rootElement);\n\t\t\t\n\t\t\t//Create elements\n\t\t\t\n\t\t\t//Element fam = docRoot.createElement(\"FAM\");\n\t\t\tElement e= null;\n\t\t\tbrRead = new BufferedReader(new FileReader(\"complet.ged\"));\n\t\t\tString line=\"\";\n\t\t\twhile((line = brRead.readLine()) != null){\n\t\t\t\tString lineTrim = line.trim();\n\t\t\t\tString str[] = lineTrim.split(\" \");\n\t\t\t\t//System.out.println(\"length = \"+str.length);\n\n\t\t\t\tif(str.length == 2){\n\t\t\t\t\ts1 = str[0];\n\t\t\t\t\ts2 = str[1];\n\t\t\t\t\ts3 = \"\";\n\t\t\t\t}else if(str.length ==3){\n\t\t\t\t\ts1 = str[0];\n\t\t\t\t\ts2=\"\";\n\n\t\t\t\t\ts2 = str[1];\n//\t\t\t\t\tSystem.out.println(\"s2=\"+s2);\n\t\t\t\t\ts3=\"\";\n\t\t\t\t\ts3 = str[2];\n//\t\t\t\t\ts3 = s[0];\n\t\t\t\t\t\n\t\t\t\t}else if(str.length >3){\n\t\t\t\t\ts1 = str[0];\n\t\t\t\t\ts2 = str[1];\n\t\t\t\t\ts3=\"\";\n\t\t\t\t\tfor(int i =2; i<str.length; i++){\n\t\t\t\t\t\ts3 = s3 + str[i]+ \" \";\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t//System.out.println(s1+\"!\"+s2+\"!\"+s3+\"!\");\n\t\t\t\t//Write to file xml\n\t\t\t\t//writeToXML(s1, s2, s3);\n\t\t\t//Element indi = docRoot.createElement(\"INDI\");\t\n\t\t\t//System.out.println(\"Check0 :\" + s1);\n\t\t\tif( Integer.parseInt(s1)==0){\n\t\t\t\t\n\t\t\t\t//System.out.println(\"Check1\");\n\t\t\t\tif(s3.equalsIgnoreCase(\"INDI\")){\n\t\t\t\t\t//System.out.println(\"Check2\");\n\t\t\t\t\tSystem.out.println(\"This is a famille Individual!\");\n\t\t\t\t\te = docRoot.createElement(\"INDI\");\n\t\t\t\t\trootElement.appendChild(e);\n\t\t\t\t\t\n\t\t\t\t\t//Set attribute to INDI\n\t\t\t\t\tAttr indiAttr = docRoot.createAttribute(\"id\");\n\t\t\t\t\ts2 = s2.substring(1, s2.length()-1);\n\t\t\t\t\tindiAttr.setValue(s2);\n\t\t\t\t\te.setAttributeNode(indiAttr);\n\t\t\t\t\tlastElement = e;\n\t\t\t\t\t\n\t\t\t\t}if(s3.equalsIgnoreCase(\"FAM\")){\n\t\t\t\t\t//System.out.println(\"Check3\");\n\t\t\t\t\tSystem.out.println(\"This is a famille!\");\n\t\t\t\t\te = docRoot.createElement(\"FAM\");\n\t\t\t\t\trootElement.appendChild(e);\n\t\t\t\t\t//Set attribute to FAM\n\t\t\t\t\tAttr famAttr = docRoot.createAttribute(\"id\");\n\t\t\t\t\ts2 = s2.substring(1, s2.length()-1);\n\t\t\t\t\tfamAttr.setValue(s2);\n\t\t\t\t\te.setAttributeNode(famAttr);\n\t\t\t\t\tlastElement = e;\n\t\t\t\t}if(s2.equalsIgnoreCase(\"HEAD\")){\n\t\t\t\t\tSystem.out.println(\"This is a head!\");\n\t\t\t\t\te = docRoot.createElement(\"HEAD\");\n\t\t\t\t\trootElement.appendChild(e);\n\t\t\t\t\tlastElement = e;\n\t\t\t\t\t\n\t\t\t\t}if(s3.equalsIgnoreCase(\"SUBM\")){\n\n\t\t\t\t\tSystem.out.println(\"This is a subm!\");\n\t\t\t\t\te = docRoot.createElement(\"SUBM\");\n\t\t\t\t\trootElement.appendChild(e);\n\t\t\t\t\t//Set attribute to FAM\n\t\t\t\t\tAttr famAttr = docRoot.createAttribute(\"id\");\n\t\t\t\t\ts2 = s2.substring(1, s2.length()-1);\n\t\t\t\t\tfamAttr.setValue(s2);\n\t\t\t\t\te.setAttributeNode(famAttr);\n\t\t\t\t\tlastElement = e;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif(Integer.parseInt(s1)==1){\n\n\t\t\t\tString child = s2;\n\t\t\t\tif(child.equalsIgnoreCase(\"SOUR\")||child.equalsIgnoreCase(\"DEST\")||child.equalsIgnoreCase(\"DATE\")\n\t\t\t\t\t\t||child.equalsIgnoreCase(\"FILE\")||child.equalsIgnoreCase(\"CHAR\")\n\t\t\t\t\t\t||child.equalsIgnoreCase(\"NAME\")||child.equalsIgnoreCase(\"TITL\")||child.equalsIgnoreCase(\"SEX\")||child.equalsIgnoreCase(\"REFN\")\n\t\t\t\t\t\t||child.equalsIgnoreCase(\"PHON\")||child.equalsIgnoreCase(\"DIV\")){\n\t\t\t\t\tString name = lastElement.getNodeName();\n\t\t\t\t\tif(name.equalsIgnoreCase(\"INDI\")||name.equalsIgnoreCase(\"HEAD\")||name.equalsIgnoreCase(\"FAM\")||name.equalsIgnoreCase(\"SUBM\")){\t\n\t\t\t\t\t\te= docRoot.createElement(child);\n\t\t\t\t\t\te.setTextContent(s3);\n\t\t\t\t\t\t\n\t\t\t\t\t\tlastElement.appendChild(e);\n\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\tNode p = e.getParentNode();\n\t\t\t\t\t\t\tElement x= docRoot.createElement(child);\n\t\t\t\t\t\t\tx.setTextContent(s3);\n\t\t\t\t\t\t\tp.appendChild(x);\n\t\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif(child.equalsIgnoreCase(\"BIRT\")||child.equalsIgnoreCase(\"DEAT\")||child.equalsIgnoreCase(\"COMM\")\n\t\t\t\t\t\t||child.equalsIgnoreCase(\"BURI\")||child.equalsIgnoreCase(\"ADDR\")||child.equalsIgnoreCase(\"CHR\")){\n\t\t\t\t\t\n\t\t\t\t\tString name = lastElement.getNodeName();\t\n\t\t\t\t\tif(name.equalsIgnoreCase(\"INDI\")||name.equalsIgnoreCase(\"FAM\")||name.equalsIgnoreCase(\"SUBM\")){\t\n\t\t\t\t\te= docRoot.createElement(child);\n\t\t\t\t\te.setTextContent(s3);\n\t\t\t\t\t\n\t\t\t\t\tlastElement.appendChild(e);\n\t\t\t\t\tlastElement = e;\n\t\t\t\t\t}else{\n\t\t\t\t\t\tNode p = e.getParentNode();\n\t\t\t\t\t\tElement x= docRoot.createElement(child);\n\t\t\t\t\t\tx.setTextContent(s3);\n\t\t\t\t\t\tp.appendChild(x);\n\t\t\t\t\t\tlastElement = x;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif(child.equalsIgnoreCase(\"FAMS\")||child.equalsIgnoreCase(\"FAMC\")){\n\t\t\t\t\tString name = lastElement.getNodeName();\n\t\t\t\t\tif(name.equalsIgnoreCase(\"INDI\")||name.equalsIgnoreCase(\"FAM\")){\t\n\t\t\t\t\t\te= docRoot.createElement(child);\n\t\t\t\t\t\ts3 = s3.substring(1, s3.length()-1);\n\t\t\t\t\t\te.setAttribute(\"id\",s3);\n\t\t\t\t\t\tlastElement.appendChild(e);\n\t\t\t\t\t\tlastElement = e;\n\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\tNode p = e.getParentNode();\n\t\t\t\t\t\t\tElement x= docRoot.createElement(child);\n\t\t\t\t\t\t\ts3 = s3.substring(1, s3.length()-1);\n\t\t\t\t\t\t\tx.setAttribute(\"id\",s3);\n\t\t\t\t\t\t\tp.appendChild(x);\n\t\t\t\t\t\t\tlastElement = x;\n\t\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t\tif(child.equalsIgnoreCase(\"HUSB\")||child.equalsIgnoreCase(\"WIFE\")||child.equalsIgnoreCase(\"CHIL\")){\n\t\t\t\t\te= docRoot.createElement(child);\n\t\t\t\t\ts3 = s3.substring(1, s3.length()-1);\n\t\t\t\t\te.setAttribute(\"id\",s3);\n\t\t\t\t\tlastElement.appendChild(e);\n\t\t\t\t}\n\t\t\t\tif(child.equalsIgnoreCase(\"MARR\")){\n\t\t\t\t\te= docRoot.createElement(child);\n\t\t\t\t\tlastElement.appendChild(e);\n\t\t\t\t\tlastElement = e;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif(Integer.parseInt(s1)==2){\n\t\t\t\tString lastName = lastElement.getNodeName();\n\t\t\t\tif((lastName.equalsIgnoreCase(\"BIRT\"))||(lastName.equalsIgnoreCase(\"DEAT\"))||(lastName.equalsIgnoreCase(\"BURI\"))\n\t\t\t\t\t\t||(lastName.equalsIgnoreCase(\"MARR\"))||(lastName.equalsIgnoreCase(\"CHR\"))){\n\t\t\t\t\t//Add child nodes to birt, deat or marr\n\t\t\t\t\tif(s2.equalsIgnoreCase(\"DATE\")){\n\t\t\t\t\t\tElement date = docRoot.createElement(\"DATE\");\n\t\t\t\t\t\tdate.setTextContent(s3);\n\t\t\t\t\t\tlastElement.appendChild(date);\n\t\t\t\t\t}\n\t\t\t\t\tif(s2.equalsIgnoreCase(\"PLAC\")){\n\t\t\t\t\t\tElement plac = docRoot.createElement(\"PLAC\");\n\t\t\t\t\t\tplac.setTextContent(s3);\n\t\t\t\t\t\tlastElement.appendChild(plac);\n\t\t\t\t\t}\n\n\t\t\t\t}\n\t\t\t\tif(lastName.equalsIgnoreCase(\"COMM\")||lastName.equalsIgnoreCase(\"ADDR\")){\n\t\t\t\t\tif(s2.equalsIgnoreCase(\"CONT\")){\n\t\t\t\t\t\tElement plac = docRoot.createElement(\"CONT\");\n\t\t\t\t\t\tplac.setTextContent(s3);\n\t\t\t\t\t\tlastElement.appendChild(plac);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\t//lastElement = e;\n\t\t\t}\n\n\t\t\t\n\t\t\t\n\t\t\t//Saved this element for the next step\n\t\t\t\n\t\t\t//Write to file\n\t\t\tTransformerFactory transformerFactory = TransformerFactory.newInstance();\n\t\t\tTransformer transformer = transformerFactory.newTransformer();\n\t\t\ttransformer.setOutputProperty(OutputKeys.ENCODING, \"iso-8859-1\");\n\t\t\ttransformer.setOutputProperty(OutputKeys.INDENT, \"yes\");\n\t\t\ttransformer.setOutputProperty(OutputKeys.DOCTYPE_SYSTEM, \"Royal.dtd\");\n\t\t\tDOMSource source = new DOMSource(docRoot);\n\t\t\tStreamResult result = new StreamResult(new File(\"complet.xml\"));\n\t \n\t\t\t// Output to console for testing\n\t\t\t// StreamResult result = new StreamResult(System.out);\t \n\t\t\ttransformer.transform(source, result);\n\t \n\t\t\tSystem.out.println(\"\\nXML DOM Created Successfully.\");\n\t\t}catch(Exception e){\n\t\t\te.printStackTrace();\n\t\t}\n\t\t\n\t}", "public void parseXML(String xmlString) {\n DocumentBuilderFactory builderFactory = DocumentBuilderFactory.newInstance(); \n Document document = null; \n try { \n //DOM parser instance \n DocumentBuilder builder = builderFactory.newDocumentBuilder(); \n \n //parse an XML file into a DOM tree, in this case, change the filepath to xml String \n document = builder.parse(new File(filePath));\n \n //get root element, which is <Airports>\n Element rootElement = document.getDocumentElement(); \n \n //traverse child elements. retrieve all the <Airport>\n NodeList nodes = rootElement.getChildNodes(); \n for (int i=0; i < nodes.getLength(); i++) \n { \n Node node = nodes.item(i); \n if (node.getNodeType() == Node.ELEMENT_NODE) { \n Element airport = (Element) node; \n \n //process child element \n String code = airport.getAttribute(\"Code\");\n String name = airport.getAttribute(\"Name\"); \n \n // child node of airport\n NodeList airportChildren = airport.getChildNodes();\n \n // value of longitude & latitude\n String longitude = airportChildren.item(1).getTextContent();\n String latitude = airportChildren.item(2).getTextContent();\n \n Location location = new Location(longitude, latitude);\n airportList.add(new Airport(code, name, location));\n } \n } \n \n // another approach to traverse all the listNode by tagName \n /*NodeList nodeList = rootElement.getElementsByTagName(\"book\"); \n if(nodeList != null) \n { \n for (int i = 0 ; i < nodeList.getLength(); i++) \n { \n Element element = (Element)nodeList.item(i); \n String id = element.getAttribute(\"id\"); \n } \n }*/\n // add the DOM object to the airportList\n } catch (ParserConfigurationException e) { \n e.printStackTrace(); \n } catch (SAXException e) { \n e.printStackTrace(); \n } catch (IOException e) { \n e.printStackTrace(); \n } \n }", "public void processInternalBilling(ReturnDocument rdoc) {\r\n\r\n if (ObjectUtils.isNull(rdoc.getOrderDocument())\r\n || !this.returnOrderBillingDao.hasAccountsForBilling(rdoc.getDocumentNumber()))\r\n return;\r\n\r\n String docNumber = rdoc.getDocumentNumber();\r\n\r\n String warehouseCode = rdoc.getOrderDocument().getWarehouseCd();\r\n\r\n Map<String, List<FinancialInternalBillingItem>> returnedOrderLines = this.returnOrderBillingDao\r\n .getReturnedOrderLines(docNumber);\r\n Set<String> keys = returnedOrderLines.keySet();\r\n Map<String, List<FinancialAccountingLine>> returnedAccountingLines = getReturnBillingAccountingLines(rdoc);\r\n Warehouse warehouse = rdoc.getOrderDocument().getWarehouse();\r\n\r\n if (warehouse == null)\r\n warehouse = StoresPersistableBusinessObject.getObjectByPrimaryKey(Warehouse.class,\r\n warehouseCode);\r\n\r\n for (String key : keys) {\r\n List<FinancialInternalBillingItem> lineItems = returnedOrderLines.get(key);\r\n List<FinancialAccountingLine> acctLines = returnedAccountingLines.get(key);\r\n if (warehouse != null && warehouse.isActive()) {\r\n FinancialCapitalAssetInformation capitalAssetInformation = null;\r\n String astInfoId = null;\r\n if (key.contains(\"-\") && (astInfoId = key.split(\"-\")[1]) != null) {\r\n capitalAssetInformation = new FinancialCapitalAssetInformation();\r\n MMCapitalAssetInformation assetInfo = SpringContext.getBean(\r\n BusinessObjectService.class).findBySinglePrimaryKey(\r\n MMCapitalAssetInformation.class, astInfoId);\r\n if (assetInfo != null) {\r\n adapt(assetInfo, capitalAssetInformation);\r\n List<MMCapitalAssetInformationDetail> assetInformationDetails = assetInfo\r\n .getCapitalAssetInformationDetails();\r\n if (assetInformationDetails != null) {\r\n for (MMCapitalAssetInformationDetail source : assetInformationDetails) {\r\n FinancialCapitalAssetInformationDetail target = new FinancialCapitalAssetInformationDetail();\r\n adapt(source, target);\r\n capitalAssetInformation.getCapitalAssetInformationDetails().add(\r\n target);\r\n }\r\n }\r\n }\r\n }\r\n DocumentHeader ibDocHeader = processInternalBilling(warehouse, lineItems,\r\n acctLines, capitalAssetInformation);\r\n if (ibDocHeader != null) {\r\n String ibDocNumber = ibDocHeader.getDocumentNumber();\r\n if (astInfoId != null) {\r\n for (ReturnDetail detail : rdoc.getReturnDetails()) {\r\n if (detail.getOrderDetailId().toString().equals(astInfoId)) {\r\n detail.setCreditDocumentNumber(ibDocNumber);\r\n }\r\n }\r\n }\r\n else {\r\n for (ReturnDetail detail : rdoc.getReturnDetails()) {\r\n detail.setCreditDocumentNumber(ibDocNumber);\r\n }\r\n }\r\n }\r\n }\r\n else {\r\n // LOG error here\r\n LOG.warn(\"Warehouse \" + lineItems.get(0).getWarehouseCode()\r\n + \" is not valid, so batch did not post charges to the depts\");\r\n }\r\n }\r\n\r\n }", "public javax.xml.stream.XMLStreamReader getPullParser(javax.xml.namespace.QName qName)\n throws org.apache.axis2.databinding.ADBException{\n\n\n \n java.util.ArrayList elementList = new java.util.ArrayList();\n java.util.ArrayList attribList = new java.util.ArrayList();\n\n if (localMsisdnTracker){\n elementList.add(new javax.xml.namespace.QName(\"http://soap.crmapi.util.redknee.com/subscriptions/xsd/2010/06\",\n \"msisdn\"));\n \n elementList.add(localMsisdn==null?null:\n org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localMsisdn));\n } if (localBundleIDTracker){\n elementList.add(new javax.xml.namespace.QName(\"http://soap.crmapi.util.redknee.com/subscriptions/xsd/2010/06\",\n \"bundleID\"));\n \n elementList.add(\n org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localBundleID));\n } if (localSpidTracker){\n elementList.add(new javax.xml.namespace.QName(\"http://soap.crmapi.util.redknee.com/subscriptions/xsd/2010/06\",\n \"spid\"));\n \n elementList.add(\n org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localSpid));\n } if (localBucketIDTracker){\n elementList.add(new javax.xml.namespace.QName(\"http://soap.crmapi.util.redknee.com/subscriptions/xsd/2010/06\",\n \"bucketID\"));\n \n elementList.add(\n org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localBucketID));\n } if (localBalancesTracker){\n if (localBalances!=null) {\n for (int i = 0;i < localBalances.length;i++){\n\n if (localBalances[i] != null){\n elementList.add(new javax.xml.namespace.QName(\"http://soap.crmapi.util.redknee.com/subscriptions/xsd/2010/06\",\n \"balances\"));\n elementList.add(localBalances[i]);\n } else {\n \n elementList.add(new javax.xml.namespace.QName(\"http://soap.crmapi.util.redknee.com/subscriptions/xsd/2010/06\",\n \"balances\"));\n elementList.add(null);\n \n }\n\n }\n } else {\n \n elementList.add(new javax.xml.namespace.QName(\"http://soap.crmapi.util.redknee.com/subscriptions/xsd/2010/06\",\n \"balances\"));\n elementList.add(localBalances);\n \n }\n\n } if (localUnitTypeTracker){\n elementList.add(new javax.xml.namespace.QName(\"http://soap.crmapi.util.redknee.com/subscriptions/xsd/2010/06\",\n \"unitType\"));\n \n \n elementList.add(localUnitType==null?null:\n localUnitType);\n } if (localExpiryTimeTracker){\n elementList.add(new javax.xml.namespace.QName(\"http://soap.crmapi.util.redknee.com/subscriptions/xsd/2010/06\",\n \"expiryTime\"));\n \n elementList.add(localExpiryTime==null?null:\n org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localExpiryTime));\n } if (localActivationTimeTracker){\n elementList.add(new javax.xml.namespace.QName(\"http://soap.crmapi.util.redknee.com/subscriptions/xsd/2010/06\",\n \"activationTime\"));\n \n elementList.add(localActivationTime==null?null:\n org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localActivationTime));\n } if (localProvisionTimeTracker){\n elementList.add(new javax.xml.namespace.QName(\"http://soap.crmapi.util.redknee.com/subscriptions/xsd/2010/06\",\n \"provisionTime\"));\n \n elementList.add(localProvisionTime==null?null:\n org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localProvisionTime));\n } if (localStatusTracker){\n elementList.add(new javax.xml.namespace.QName(\"http://soap.crmapi.util.redknee.com/subscriptions/xsd/2010/06\",\n \"status\"));\n \n \n elementList.add(localStatus==null?null:\n localStatus);\n } if (localBundleNameTracker){\n elementList.add(new javax.xml.namespace.QName(\"http://soap.crmapi.util.redknee.com/subscriptions/xsd/2010/06\",\n \"bundleName\"));\n \n elementList.add(localBundleName==null?null:\n org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localBundleName));\n }\n\n return new org.apache.axis2.databinding.utils.reader.ADBXMLStreamReaderImpl(qName, elementList.toArray(), attribList.toArray());\n \n \n\n }", "public Saxpaser(String consoleXmlFileName) \n {\n\t\ta=1;\n\t\t// Product product ;\n\t\thm=new HashMap<String, Product>();\n this.consoleXmlFileName = consoleXmlFileName;\n // accessories = new ArrayList<Accesory>();\n parseDocument();\n prettyPrint();\n }", "protected abstract void _fromXml_(Element in_xml) throws ConfigurationException;", "public void process(FixMessage message) throws Exception\n {\n String tag = message.get(MsgType);\n UserTransaction txn = Context.getUserTransaction();\n txn.begin();\n switch(tag)\n {\n case NEWORDERSINGLE : {\n\n OrderProcessor orderProcessor = new OrderProcessor(message, this);\n orderProcessor.process();\n break;\n }\n }\n\n txn.commit();\n System.out.println(orderCache);\n\n }", "void processElement(File documentPath) \n\t\t\tthrows XMLFormatException;", "public static void main(String[] args)\n throws FileNotFoundException, XMLStreamException {\n XMLInputFactory factory = XMLInputFactory.newInstance();\n // Create XML event reader 1\n XMLEventReader r1 = \n factory.createXMLEventReader(new FileReader(\"prodList1.xml\"));\n // Create XML event reader 2\n XMLEventReader r2 = \n factory.createXMLEventReader(new FileReader(\"prodList2.xml\"));\n // Create the output factory\n XMLOutputFactory xmlof = XMLOutputFactory.newInstance();\n // Create XML event writer\n XMLEventWriter xmlw = xmlof.createXMLEventWriter(System.out);\n // Read to first <product> element in document 1\n // and output to result document\n String pid1 = readToNextElement(r1, xmlw, false);\n // Read to first <product> element in document 1\n // without writing to result document\n String pid2 = readToNextElement(r2, null, false);\n // Loop over both XML input streams\n while (pid1 != null || pid2 != null) {\n // Compare merge criteria\n if (pid2 == null || (pid1 != null && pid1.compareTo(pid2) <= 0))\n // Continue in document 1\n pid1 = readToNextElement(r1, xmlw, pid2 == null);\n else\n // Continue in document 2\n pid2 = readToNextElement(r2, xmlw, pid1 == null);\n }\n xmlw.close();\n }", "public void selectedTx(){\r\n\r\n tpoCheck(); //check tpo\r\n channelNumber = Double.parseDouble(channel.getText());//set channelNumber\r\n System.out.println(\"Channel number: \"+channelNumber);\r\n\r\n System.out.println(\" \"); //just adding some space for clarity on console print out\r\n DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();\r\n DocumentBuilder builder = null;\r\n try {\r\n builder = factory.newDocumentBuilder();\r\n } catch (ParserConfigurationException e) {\r\n e.printStackTrace();\r\n }\r\n\r\n // Load the input XML document, parse it and return an instance of the document class. will need to make this work on any computer somehow.\r\n Document document = null;\r\n try {\r\n document = builder.parse(new File(\"test.xml\"));\r\n } catch (SAXException e) {\r\n e.printStackTrace();\r\n } catch (IOException e) {\r\n e.printStackTrace();\r\n }\r\n\r\n //refer to Transmitter.java\r\n List<Transmitter> transmitters = new ArrayList<Transmitter>();\r\n NodeList nodeList = document.getDocumentElement().getChildNodes();\r\n for (int i = 0; i < nodeList.getLength(); i++) { //loop through to get every item and its attributes from the test.xml\r\n Node node = nodeList.item(i);\r\n\r\n if (node.getNodeType() == Node.ELEMENT_NODE) {\r\n Element elem = (Element) node;\r\n\r\n // Get the value of the ID attribute.\r\n ID = node.getAttributes().getNamedItem(\"ID\").getNodeValue();//transmitters(i.e. ULXTE-2)\r\n // Get the value of all sub-elements.\r\n pa = Integer.parseInt(elem.getElementsByTagName(\"PA\").item(0).getChildNodes().item(0).getNodeValue());//pa modules\r\n cabinets = Integer.parseInt(elem.getElementsByTagName(\"Cabinets\").item(0).getChildNodes().item(0).getNodeValue());// cabinets\r\n powerblocks = Integer.parseInt(elem.getElementsByTagName(\"Powerblocks\").item(0).getChildNodes().item(0).getNodeValue());// power blocks\r\n linesize = elem.getElementsByTagName(\"Linesize\").item(0).getChildNodes().item(0).getNodeValue();//line size\r\n powerRating = Double.parseDouble(elem.getElementsByTagName(\"Power\").item(0).getChildNodes().item(0).getNodeValue());\r\n\r\n transmitters.add(new Transmitter(ID, pa, cabinets, powerblocks, linesize, powerRating));//call constructor in Transmitter.java to set values for variables\r\n\r\n /** breaks for loop when ID == tx_cb value. need ID for populating label element. display info to console about selection **/\r\n if (ID.equals(tx_cb.getValue())) {\r\n NodeList power = elem.getElementsByTagName(\"Power\");\r\n Node node2 = power.item(0);\r\n System.out.println(ID + \" selected\");\r\n System.out.println(pa + \" PA Modules for \" + ID);\r\n System.out.println(\"Power rating: \"+powerRating);\r\n break;\r\n }\r\n }\r\n }\r\n for (Transmitter tx : transmitters) {\r\n if (ID.equals(tx_cb.getValue())) {\r\n TX_Text.setText(tx.toString());\r\n }\r\n }\r\n }", "public void orderPo(int pid) throws Exception {\n PoBean po = this.getPoById(pid);\n if (po == null) throw new Exception(\"Purchase Order doesn't exist!\");\n if (po.getStatus() != PoBean.Status.PROCESSED) throw new Exception(\"Invalid Purchase Order Status.\");\n this.setPoStatus(PoBean.Status.ORDERED, pid);\n }", "private void processToXML(StringBuffer buffer) {\n\n buffer.append(getStartElement(PROCESS));\n\n\n respValue = this.getMashupResponse().toUpperCase();\n\n buffer.append(getStartElementWithAtrribute(MASHUP, RESPONSETYPE, respValue));\n buffer.append(getStartElement(MASHUP_SQL));\n //buffer.append(XmlUtil.escapeXML(this.mashupQuery.toXMLString()));\n buffer.append(this.mashupQuery.toXMLString());\n buffer.append(getEndElement(MASHUP_SQL));\n buffer.append(getEndElement(MASHUP));\n buffer.append(getEndElement(PROCESS));\n }", "@SuppressWarnings(\"deprecation\")\n\tpublic void process(Exchange exc) throws Exception {\n\t\tString emp = \"<?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\" standalone=\\\"yes\\\"?><employees><employee><firstName>Katy</firstName><lastName>Perry</lastName></employee><employee><firstName>John</firstName><lastName>Wick</lastName></employee></employees>\";\n\t\t//String emp = \"<?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\" standalone=\\\"yes\\\"?><employee><firstName>Katy</firstName><lastName>Perry</lastName></employee>\";\n\t\texc.getMessage().setBody(emp);\n\t}", "public static RadiologyOrderIDForPayment parse(javax.xml.stream.XMLStreamReader reader) throws java.lang.Exception{\n RadiologyOrderIDForPayment object =\n new RadiologyOrderIDForPayment();\n\n int event;\n java.lang.String nillableValue = null;\n java.lang.String prefix =\"\";\n java.lang.String namespaceuri =\"\";\n try {\n \n while (!reader.isStartElement() && !reader.isEndElement())\n reader.next();\n\n \n\n \n // Note all attributes that were handled. Used to differ normal attributes\n // from anyAttributes.\n java.util.Vector handledAttributes = new java.util.Vector();\n \n\n \n while(!reader.isEndElement()) {\n if (reader.isStartElement() ){\n \n if (reader.isStartElement() && new javax.xml.namespace.QName(\"http://www.PAHospital.org/RadiologyService/\",\"RadiologyOrderIDForPayment\").equals(reader.getName())){\n \n nillableValue = reader.getAttributeValue(\"http://www.w3.org/2001/XMLSchema-instance\",\"nil\");\n if (\"true\".equals(nillableValue) || \"1\".equals(nillableValue)){\n throw new org.apache.axis2.databinding.ADBException(\"The element: \"+\"RadiologyOrderIDForPayment\" +\" cannot be null\");\n }\n \n\n java.lang.String content = reader.getElementText();\n \n object.setRadiologyOrderIDForPayment(\n org.apache.axis2.databinding.utils.ConverterUtil.convertToString(content));\n \n } // End of if for expected property start element\n \n else{\n // A start element we are not expecting indicates an invalid parameter was passed\n throw new org.apache.axis2.databinding.ADBException(\"Unexpected subelement \" + reader.getName());\n }\n \n } else {\n reader.next();\n } \n } // end of while loop\n \n\n\n\n } catch (javax.xml.stream.XMLStreamException e) {\n throw new java.lang.Exception(e);\n }\n\n return object;\n }", "public static void addToXML(CD c)\n\t\t\tthrows TransformerException, FileNotFoundException, SAXException, IOException {\n\t\ttry {\n\t\t\tDocumentBuilderFactory docFactory = DocumentBuilderFactory.newInstance();\n\t\t\tDocumentBuilder docBuilder = docFactory.newDocumentBuilder();\n\n\t\t\t// root elements\n\t\t\tDocument doc = docBuilder.newDocument();\n\t\t\tElement rootElement;\n\t\t\tString filePath = \"src/Part2_Ex3/CD.xml\";\n\t\t\tFile xmlFile = new File(filePath);\n\n\t\t\tif (xmlFile.isFile()) {\n\t\t\t\tdoc = docBuilder.parse(new FileInputStream(xmlFile));\n\t\t\t\tdoc.getDocumentElement().normalize();\n\t\t\t\trootElement = doc.getDocumentElement();\n\t\t\t} else {\n\t\t\t\trootElement = doc.createElement(\"CDs\");\n\t\t\t\tdoc.appendChild(rootElement);\n\t\t\t}\n\n\t\t\tElement cd = doc.createElement(\"CD\");\n\t\t\trootElement.appendChild(cd);\n\n\t\t\t// id element\n\t\t\tElement id = doc.createElement(\"id\");\n\t\t\tid.appendChild(doc.createTextNode(Integer.toString(c.getId())));\n\t\t\tcd.appendChild(id);\n\t\t\t\n\t\t\t// name\n\t\t\tElement name = doc.createElement(\"name\");\n\t\t\tname.appendChild(doc.createTextNode(c.getName()));\n\t\t\tcd.appendChild(name);\n\n\t\t\t//singer\n\t\t\tElement singer = doc.createElement(\"singer\");\n\t\t\tsinger.appendChild((doc.createTextNode(c.getSinger())));\n\t\t\tcd.appendChild(singer);\n\n\t\t\t// number songs\n\t\t\tElement numbersongs = doc.createElement(\"numbersongs\");\n\t\t\tnumbersongs.appendChild(doc.createTextNode(Integer.toString(c.getNumOfSong())));\n\t\t\tcd.appendChild(numbersongs);\n\t\t\t\n\t\t\t// price\n\t\t\tElement price = doc.createElement(\"price\");\n\t\t\tprice.appendChild(doc.createTextNode(Double.toString(c.getPrice())));\n\t\t\tcd.appendChild(price);\n\t\t\t\n\t\t\t// write the content into xml file\n\t\t\tTransformerFactory transformerFactory = TransformerFactory.newInstance();\n\t\t\tTransformer transformer = transformerFactory.newTransformer();\n\t\t\tDOMSource source = new DOMSource(doc);\n\t\t\tStreamResult result = new StreamResult(xmlFile);\n\t\t\ttransformer.transform(source, result);\n\n\t\t\tSystem.out.println(\"Add completed !\");\n\n\t\t} catch (ParserConfigurationException pce) {\n\t\t\tSystem.out.println(\"Cannot insert new CD. Error: \" + pce.getMessage());\n\t\t}\n\t}", "private void printFile(Products print, String ufilename) {\n\t\tFile file = new File(\"output\"+File.separator+ufilename+fileId+\".xml\"); \n\t\tSystem.out.println(\"Exporting : \"+ file);\n\t\tJAXBContext jaxbContext;\n\t\ttry {\n\t\t\tjaxbContext = JAXBContext.newInstance(Products.class); \n\t\t\tMarshaller jaxbMarshaller = jaxbContext.createMarshaller();\n\t\t\tjaxbMarshaller.setProperty(Marshaller.JAXB_FRAGMENT, Boolean.TRUE);\n\t\t\tjaxbMarshaller.setProperty(\"com.sun.xml.internal.bind.xmlHeaders\", \"<?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\"?>\");\n\t\t\tjaxbMarshaller.setProperty(Marshaller.JAXB_FORMATTED_OUTPUT,Boolean.TRUE);\n\t\t\tjaxbMarshaller.marshal(print, file); // prints the file\n\t\t\t// \t\t jaxbMarshaller.marshal(products, System.out);\n\t\t} catch (JAXBException e) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\te.printStackTrace();\n\t\t}\n\t}", "public static void main(String[] args) {\n\t\tMap<String, String> param = new HashMap<String, String>();\n\t\tparam.put(\"GoodsID\", \"81633\");\n\t\tString priceData = HttpUtil45.postAuth(\"http://studio69.atelier98.net/api_studio69/api_studio69.asmx/GetGoodsDetailByGoodsID\",\n\t\t\t\tparam ,new OutTimeConfig(1000*60*10,1000*60*10,1000*60*10),\"SHANGPIN\",\"2MWWKgNSxgf\");\nSystem.out.println(priceData);\n//\t\ttry {\n////\t\t\tGoodDetail goodDetail = ObjectXMLUtil.xml2Obj(GoodDetail.class, priceData);\n//\t\t\tGoodsDetail categorys = ObjectXMLUtil.xml2Obj(GoodsDetail.class, priceData);\n//\t\t\tSystem.out.println(categorys.getGoodDetials().get(0).getStock().getItemlist().size());\n//\t\t} catch (JAXBException e1) {\n//\t\t\te1.printStackTrace();\n//\t\t}\n//\t\tSystem.out.println(priceData);\n\n//\t\tMap<String, String> param = new HashMap<String, String>();\n//\t\tparam.put(\"orderID\", \"20160909121212\");\n//\t\tString buyerInfo = \"<BuyerInfo>\" +\n//\t\t\t\t\" <Name>test</Name>\" +\n//\t\t\t\t\" <Address>Via Edgardo Macrelli 107</Address>\" +\n//\t\t\t\t\" <Mobile>47521</Mobile>\" +\n//\t\t\t\t\" <Corriere>100000</Corriere>\" +\n//\t\t\t\t\" <Notes></Notes>\" +\n//\t\t\t\t\"</BuyerInfo>\";\n//\t\tString gooodsList=\"<GoodsList>\" +\n//\t\t\t\t\" <Good>\" +\n//\t\t\t\t\" <ID>36894</ID>\" +\n//\t\t\t\t\" <Size>42</Size>\" +\n//\t\t\t\t\" <Qty>1</Qty>\" +\n//\t\t\t\t\" <Price>1265</Price>\" +\n//\t\t\t\t\" </Good>\" +\n//\t\t\t\t\"</GoodsList>\";\n//\t\ttry {\n//\t\t\tbuyerInfo = URLEncoder.encode(buyerInfo,\"UTF-8\");\n//\t\t\tSystem.out.println(\"buyerInfo =\" +buyerInfo);\n//\t\t\tgooodsList = URLEncoder.encode(gooodsList,\"UTF-8\");\n//\t\t\tSystem.out.println(\"gooodsList =\" +gooodsList);\n//\t\t} catch (UnsupportedEncodingException e) {\n//\t\t\te.printStackTrace();\n//\t\t}\n//\t\tparam.put(\"buyerInfo\", buyerInfo);\n//\n//\t\tparam.put(\"goodsList\", gooodsList);\n//\n//\t\tString priceData = HttpUtil45.postAuth(\"http://studio69.atelier98.net/api_studio69/api_studio69.asmx/CreateNewOrder\",\n//\t\t\t\tparam ,new OutTimeConfig(1000*60*10,1000*60*10,1000*60*10),\"SHANGPIN\",\"2MWWKgNSxgf\");\n//\n//\t\ttry {\n////\t\t\tGoodDetail goodDetail = ObjectXMLUtil.xml2Obj(GoodDetail.class, priceData);\n//\t\t\tGoodsDetail categorys = ObjectXMLUtil.xml2Obj(GoodsDetail.class, priceData);\n//\t\t\tSystem.out.println(categorys.getGoodDetials().get(0).getStock().getItemlist().size());\n//\t\t} catch (JAXBException e1) {\n//\t\t\te1.printStackTrace();\n//\t\t}\n//\t\tSystem.out.println(priceData);\n//\n//\n//\n//\t\tFile file = new File(\"F://studio/GetGoodsDetailByGoodsID.xml\");\n//\t\tif (!file.exists()) {\n//\t\t\ttry {\n//\t\t\t\tfile.getParentFile().mkdirs();\n//\t\t\t\tfile.createNewFile();\n//\n//\t\t\t} catch (IOException e) {\n//\t\t\t\te.printStackTrace();\n//\t\t\t}\n//\t\t}\n//\t\tFileWriter fwriter = null;\n//\t\ttry {\n//\t\t\tfwriter = new FileWriter(\"F://studio/GetGoodsDetailByGoodsID.xml\");\n//\t\t\tfwriter.write(priceData);\n//\t\t} catch (IOException ex) {\n//\t\t\tex.printStackTrace();\n//\t\t} finally {\n//\t\t\ttry {\n//\t\t\t\tfwriter.flush();\n//\t\t\t\tfwriter.close();\n//\t\t\t} catch (IOException ex) {\n//\t\t\t\tex.printStackTrace();\n//\t\t\t}\n//\t\t}\n\n\n\n\n\t}", "public void handle(Element xmlRequest, HttpServletRequest req, HttpServletResponse res) throws IOException;", "private void processXMLFile( File xmlFile ) throws SAXException, IOException, ParserConfigurationException {\r\n\t\t\r\n\t\t//parse the uploaded xml file\r\n\t\tDocumentBuilderFactory domFactory = DocumentBuilderFactory.newInstance();\r\n\t\t\r\n\t\tdomFactory.setValidating(false);\r\n\t\tdomFactory.setIgnoringComments(true);\r\n\t\t\r\n\t\tDocumentBuilder docBuilder = domFactory.newDocumentBuilder();\r\n\t\t\t\r\n\t\tDocument doc = docBuilder.parse(xmlFile);\r\n\t\t\t\t\r\n\t\tElement employeesNode = doc.getDocumentElement();\r\n\t\t\r\n\t\tNodeList employees = employeesNode.getElementsByTagName(\"Employee\");\r\n\t\t\r\n\t\tLogger.debug(\"found \" + employees.getLength() + \" employees in xml document\");\r\n\t\t\r\n\t\tfor (int i=0; i<employees.getLength(); i++ ) {\r\n\t\t\t\r\n\t\t\tHashMap<String,String> contactObject = new HashMap<String,String>();\r\n\t\t\t\r\n\t\t\tElement employee = (Element) employees.item(i);\r\n\t\t\t\r\n\t\t\tcontactObject.put( \"id\", employee.getAttribute(\"id\") );\r\n\t\t\tcontactObject.put( \"givenname\", ContactsImport.getXmlChildNodeValue( employee, \"GivenName\") );\r\n\t\t\tcontactObject.put( \"sn\", ContactsImport.getXmlChildNodeValue( employee, \"SurName\") );\r\n\t\t\tcontactObject.put( \"title\", ContactsImport.getXmlChildNodeValue( employee, \"JobTitle\") );\r\n\t\t\tcontactObject.put( \"mail\", ContactsImport.getXmlChildNodeValue( employee, \"EmailAddress\") );\r\n\t\t\tcontactObject.put( \"telephonenumber\", ContactsImport.getXmlChildNodeValue( employee, \"PhoneNumber\") );\r\n\t\t\t\r\n\t\t\tcreateContact(contactObject);\r\n\t\t\t\r\n\t\t}\r\n\t\t\r\n\t}", "public void initializeXMLElements(TOSCAPlan newBuildPlan) {\n\t\tnewBuildPlan.setBpelDocument(this.documentBuilder.newDocument());\n\n\t\t// initialize processElement and append to document\n\t\tnewBuildPlan.setBpelProcessElement(\n\t\t\t\tnewBuildPlan.getBpelDocument().createElementNS(TOSCAPlan.bpelNamespace, \"process\"));\n\t\tnewBuildPlan.getBpelDocument().appendChild(newBuildPlan.getBpelProcessElement());\n\n\t\t// FIXME declare xml schema namespace\n\t\tnewBuildPlan.getBpelProcessElement().setAttributeNS(\"http://www.w3.org/2000/xmlns/\", \"xmlns:xsd\",\n\t\t\t\t\"http://www.w3.org/2001/XMLSchema\");\n\n\t\t// init import files list\n\t\tnewBuildPlan.setImportedFiles(new ArrayList<File>());\n\n\t\t// initialize and append extensions element to process\n\t\tnewBuildPlan.setBpelExtensionsElement(\n\t\t\t\tnewBuildPlan.getBpelDocument().createElementNS(TOSCAPlan.bpelNamespace, \"extensions\"));\n\t\tnewBuildPlan.getBpelProcessElement().appendChild(newBuildPlan.getBpelExtensionsElement());\n\n\t\t// init and append imports element\n\t\tnewBuildPlan.setBpelImportElements(new ArrayList<Element>());\n\n\t\t// TODO this is here to not to forget that the imports elements aren't\n\t\t// attached, cause there are none and import elements aren't nested in a\n\t\t// list element\n\t\t//\n\t\t// this.bpelImportsElement = this.bpelProcessDocument.createElementNS(\n\t\t// BuildPlan.bpelNamespace, \"imports\");\n\t\t// this.bpelProcessElement.appendChild(bpelImportsElement);\n\n\t\t// init and append partnerlink element\n\t\tnewBuildPlan.setBpelPartnerLinksElement(\n\t\t\t\tnewBuildPlan.getBpelDocument().createElementNS(TOSCAPlan.bpelNamespace, \"partnerLinks\"));\n\t\tnewBuildPlan.getBpelProcessElement().appendChild(newBuildPlan.getBpelPartnerLinksElement());\n\n\t\t// initialize and append variables element\n\t\tnewBuildPlan.setBpelProcessVariablesElement(\n\t\t\t\tnewBuildPlan.getBpelDocument().createElementNS(TOSCAPlan.bpelNamespace, \"variables\"));\n\t\tnewBuildPlan.getBpelProcessElement().appendChild(newBuildPlan.getBpelProcessVariablesElement());\n\n\t\t// init and append main sequence to process element\n\t\tnewBuildPlan.setBpelMainSequenceElement(\n\t\t\t\tnewBuildPlan.getBpelDocument().createElementNS(TOSCAPlan.bpelNamespace, \"sequence\"));\n\t\tnewBuildPlan.getBpelProcessElement().appendChild(newBuildPlan.getBpelMainSequenceElement());\n\n\t\t// init and append main sequence receive element to main sequence\n\t\t// element\n\t\tnewBuildPlan.setBpelMainSequenceReceiveElement(\n\t\t\t\tnewBuildPlan.getBpelDocument().createElementNS(TOSCAPlan.bpelNamespace, \"receive\"));\n\t\tnewBuildPlan.getBpelMainSequenceElement().appendChild(newBuildPlan.getBpelMainSequenceReceiveElement());\n\n\t\t// init and append main sequence property assign element to main\n\t\t// sequence element\n\t\tnewBuildPlan.setBpelMainSequencePropertyAssignElement(\n\t\t\t\tnewBuildPlan.getBpelDocument().createElementNS(TOSCAPlan.bpelNamespace, \"assign\"));\n\t\tnewBuildPlan.getBpelMainSequenceElement().appendChild(newBuildPlan.getBpelMainSequencePropertyAssignElement());\n\n\t\t// init and append main sequence flow element to main sequence element\n\t\tnewBuildPlan.setBpelMainFlowElement(\n\t\t\t\tnewBuildPlan.getBpelDocument().createElementNS(TOSCAPlan.bpelNamespace, \"flow\"));\n\t\tnewBuildPlan.getBpelMainSequenceElement().appendChild(newBuildPlan.getBpelMainFlowElement());\n\n\t\t// init and append flow links element\n\t\tnewBuildPlan.setBpelMainFlowLinksElement(\n\t\t\t\tnewBuildPlan.getBpelDocument().createElementNS(TOSCAPlan.bpelNamespace, \"links\"));\n\t\tnewBuildPlan.getBpelMainFlowElement().appendChild(newBuildPlan.getBpelMainFlowLinksElement());\n\n\t\t// init and append output assign element\n\t\tnewBuildPlan.setBpelMainSequenceOutputAssignElement(\n\t\t\t\tnewBuildPlan.getBpelDocument().createElementNS(TOSCAPlan.bpelNamespace, \"assign\"));\n\t\tnewBuildPlan.getBpelMainSequenceElement().appendChild(newBuildPlan.getBpelMainSequenceOutputAssignElement());\n\n\t\t// init and append main sequence callback invoke element to main\n\t\t// sequence element\n\t\tnewBuildPlan.setBpelMainSequenceCallbackInvokeElement(\n\t\t\t\tnewBuildPlan.getBpelDocument().createElementNS(TOSCAPlan.bpelNamespace, \"invoke\"));\n\t\tnewBuildPlan.getBpelMainSequenceElement().appendChild(newBuildPlan.getBpelMainSequenceCallbackInvokeElement());\n\t}", "protected void parseElements(XmlElement processElement) {\n\n parseStartEvents(processElement);\n parseActivities(processElement);\n parseEndEvents(processElement);\n parseSequenceFlow(processElement);\n }", "public void processReturnShipment() {\n \n }", "public void process(Page page) {\n \n \tpage.putField(\"title\", page.getHtml().xpath(\"//h1[@id='title']/span[@id='productTitle']/text()\").toString());\n if (page.getResultItems().get(\"title\")==null){\n //skip this page\n page.setSkip(true);\n }\n \n page.putField(\"style\", page.getHtml().xpath(\"//div[@id='variation_style_name']/div[@class='a-row']/span[@class='selection']/text()\"));\n page.putField(\"size\", page.getHtml().xpath(\"//div[@id='variation_size_name']/div[@class='a-row']/span[@class='selection']/text()\"));\n page.putField(\"color\", page.getHtml().xpath(\"//div[@id='variation_color_name']/div[@class='a-row']/span[@class='selection']/text()\"));\n \n page.putField(\"price\", page.getHtml().xpath(\"//span[@id='priceblock_ourprice']/text()\"));\n \n resultItems = page.getResultItems();\n System.out.println(page.getResultItems().toString());\n }", "public void startElement(String uri, String sName, String qName, Attributes attrs)\r\n\t{\r\n\r\n\t current_tag.push(qName);\r\n\r\n\t if (qName.equals(\"DISS_submission\"))\r\n\t\t{\r\n\t\t /* determine if there is an embargo */\r\n\t\t if (attrs != null && attrs.getValue(\"embargo_code\") != null )\r\n\t\t\t{\r\n\t\t\t try{\r\n\t\t\t\t\r\n\t\t\t\tString emb_code = attrs.getValue(\"embargo_code\");\r\n\r\n\t\t\t\t//System.out.println(\"emb_code: \" + emb_code);\r\n\t\t\t\tif(emb_code.contains(\"0\")){\r\n\t\t\t\t //writer.write(\"embargo_code = 0 \\n\");\r\n\t\t\t\t}\r\n\r\n\t\t\t\telse{\r\n\t\t\t\t String writeFileName = \"GWU_etd_\" + pid + \"_warning.txt\";\r\n\t\t\t\t String writeFile = writeFileName;\r\n\r\n\t\t\t\t writeFile = writeFile.replace('/', '_');\r\n\t\t\t\t System.out.println (\"writeFile = \" + writeFile);\r\n\r\n\t\t\t\t BufferedWriter writer = new BufferedWriter(new FileWriter(writeFile));\r\n\r\n\t\t\t\t if(emb_code.contains(\"1\")){\r\n\t\t\t\t\twriter.write(\"embargo_code = 1 \\n\");\r\n\t\t\t\t\twriter.write(\"Warning !!!!!!! \" + pid + \" embargo for 6 months !!!!!\");\r\n\t\t\t\t }\r\n\t\t\t\t else if(emb_code.contains(\"2\")){\r\n\t\t\t\t\twriter.write (\"embargo_code = 2 \\n\");\r\n\t\t\t\t\twriter.write(\"Warning !!!!!!! \" + pid + \" embargo for 1 year !!!!!\");\r\n\t\t\t\t }\r\n\t\t\t\t else if(emb_code.contains(\"3\")){\r\n\t\t\t\t\twriter.write (\"embargo_code = 3 \\n\");\r\n\t\t\t\t\twriter.write(\"Warning !!!!!!! \" + pid + \" embargo for 2 years !!!!!\");\r\n\t\t\t\t }\r\n\t\t\t\t else if(emb_code.contains(\"4\")){\r\n\t\t\t\t\twriter.write (\"embargo_code = 4 \\n\");\r\n\t\t\t\t\twriter.write(\"Warning !!!!!!! \" + pid + \" embargo for ??? months !!!!!\");\r\n\t\t\t\t }\r\n\t\t\t\t else if(!emb_code.contains(\"0\")){\r\n\t\t\t\t\twriter.write(pid + \" has an invalid embargo code.\");\r\n\t\t\t\t }\r\n\t\t\t\t writer.close();\r\n\t\t\t\t}\r\n\t\t\t }\r\n\t\t\t catch(IOException e){\r\n\t\t\t\tSystem.err.println(pid + \" IOException in startElement embargo statement.\");\r\n\t\t\t }\r\n\t\t\t}\r\n\t\t}\r\n\t if(qName.equals(\"DISS_author\"))\r\n\t\t{\r\n\t\t /* Determine if author/s belong in 100 or 700 field */\r\n\t\t if(attrs != null && attrs.getValue(\"type\") != null){\r\n\t\t\tauthor_attr = attrs.getValue(\"type\");\r\n\t\t }\r\n\t\t else{\r\n\t\t\tauthor_attr = \"primary\";\r\n\t\t }\r\n\t\t}\r\n\t else if(qName.equals(\"DISS_description\"))\r\n\t\t{\r\n\t\t /* get the page number and document type discriptors */\r\n\t\t if(attrs != null)\r\n\t\t\t{\r\n\t\t\t String pages, type;\r\n\t\t\t if((pages = attrs.getValue(\"page_count\")) != null)\r\n\t\t\t\t{\r\n\t\t\t\t String value = \"=516 \\\\\\\\$aText (PDF: \" + pages + \" p.)\";\r\n\t\t\t\t marc_out.add(value);\r\n\t\t\t\t}\r\n\t\t\t /*if((type = attrs.getValue(\"type\")) != null)\r\n\t\t\t\t{\r\n\t\t\t\t String value = \"=500 \\\\\\\\$a\" + type + \".\";\r\n\t\t\t\t marc_out.add(value);\r\n\t\t\t\t}*/\r\n\t\t\t}\r\n\t\t}\r\n\t}", "public void transformToSecondXml();", "@Test\r\n public void testShipOrder() throws Exception\r\n {\r\n String epcToCheck = \"urn:epc:id:sgtin:0614141.107343.1\";\r\n XmlTransactionEventType event = dbHelper.getTransactionEventByEpc(epcToCheck);\r\n Assert.assertNull(event);\r\n\r\n runCaptureTest(SHIP_ORDER_XML);\r\n\r\n event = dbHelper.getTransactionEventByEpc(epcToCheck);\r\n Assert.assertNotNull(event);\r\n }", "protected void processRequest(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n response.setContentType(\"text/html;charset=UTF-8\");\n PrintWriter out = response.getWriter();\n\n if (request.getSession().getAttribute(\"order\") == null) {\n out.println(\"Session expired\");\n out.close();\n return;\n }\n String order = (String) request.getSession().getAttribute(\"order\");\n\n\n try {\n /*\n * TODO output your page here. You may use following sample code.\n */\n String mcode = request.getServletContext().getInitParameter(\"merchantcode\");\n String authcode = request.getServletContext().getInitParameter(\"authcode\");\n String sp = request.getServletContext().getInitParameter(\"servicepoint\");\n policlient.MerchantAPIServiceStub stub = new policlient.MerchantAPIServiceStub(sp);\n if (request.getParameter(\"CurrencyCode\") == null || request.getParameter(\"PaymentAmount\") == null) {\n out.print(\"amount and currency code missing\");\n out.close();\n return;\n }\n if (request.getSession().getAttribute(\"order\") == null) { /*\n * you may also check if transaction is already initiated and pending\n */\n out.print(\"Session Expired\");\n out.close();\n }\n\n InitiateTransactionDocument doc = InitiateTransactionDocument.Factory.newInstance();\n InitiateTransactionRequest itr = InitiateTransactionRequest.Factory.newInstance();\n itr.setAuthenticationCode(authcode);\n InitiateTransactionInput input = InitiateTransactionInput.Factory.newInstance();\n input.setMerchantCode(mcode);\n\n\n\n input.setCurrencyAmount(BigDecimal.valueOf(new Double(request.getParameter(\"PaymentAmount\").toString()).doubleValue()));\n input.setCurrencyCode(request.getParameter(\"CurrencyCode\").toString());\n input.setUserIPAddress(request.getRemoteAddr());\n input.setMerchantData(request.getSession().getId());\n input.setMerchantCode(mcode);\n\n input.setMerchantRef(request.getSession().getAttribute(\"order\").toString());//put order id \n\n\n /*\n * build your own host url, you may use constants here\n */\n String urlm = request.getScheme() + \"://\" + request.getServerName();\n if (request.getServerPort() != 80) {\n urlm += \":\" + request.getServerPort();\n }\n urlm += request.getContextPath() + \"/\";\n input.setMerchantCheckoutURL(urlm);\n input.setMerchantHomePageURL(urlm); //use your own values here and other urls.\n input.setNotificationURL(urlm + \"notify\");//nudge url\n input.setUnsuccessfulURL(urlm);\n input.setSuccessfulURL(urlm + \"receipt\");//page printed on success \n\n if (request.getParameter(\"FinancialInstitutionCode\") != null) {\n input.setSelectedFICode(request.getParameter(\"FinancialInstitutionCode\").toString());\n } else {\n input.setNilSelectedFICode();\n }\n\n\n input.setMerchantDateTime(java.util.Calendar.getInstance());\n input.setTimeout(1000);\n\n\n\n\n itr.setTransaction(input);\n\n\n doc.addNewInitiateTransaction().setRequest(itr);\n\n InitiateTransactionResponseDocument initiateTransaction = stub.initiateTransaction(doc);\n\n\n\n\n if (initiateTransaction.getInitiateTransactionResponse().isNilInitiateTransactionResult()) {\n out.println(\"Failed to initiate transaction\");\n out.close();\n return;\n }\n\n /*\n * print error message\n */\n if (initiateTransaction.getInitiateTransactionResponse().getInitiateTransactionResult().getErrors().sizeOfErrorArray() > 0) {\n\n for (org.datacontract.schemas._2004._07.centricom_poli_services_merchantapi_dco.Error e : initiateTransaction.getInitiateTransactionResponse().getInitiateTransactionResult().getErrors().getErrorArray()) {\n\n out.println(\"Error Code:\" + e.getCode() + \" Message: \" + e.getMessage());\n\n }\n\n out.close();\n\n }\n//FinancialInstitutionSelected\n if (initiateTransaction.getInitiateTransactionResponse().getInitiateTransactionResult().getTransactionStatusCode().equalsIgnoreCase(\"initiated\")||initiateTransaction.getInitiateTransactionResponse().getInitiateTransactionResult().getTransactionStatusCode().equalsIgnoreCase(\"FinancialInstitutionSelected\")) {\n String url = initiateTransaction.getInitiateTransactionResponse().getInitiateTransactionResult().getTransaction().getNavigateURL();\n String token = initiateTransaction.getInitiateTransactionResponse().getInitiateTransactionResult().getTransaction().getTransactionToken();\n String tref = initiateTransaction.getInitiateTransactionResponse().getInitiateTransactionResult().getTransaction().getTransactionRefNo();\n\n\n\n /*\n * save the transaction values for later reference in notify\n */\n TransactionsPK pk = new TransactionsPK(order, tref);\n\n Transactions t = new Transactions(pk, new Float(request.getParameter(\"PaymentAmount\").toString()).floatValue(), request.getParameter(\"CurrencyCode\").toString(), Short.parseShort(\"0\"), token);\n EntityManagerFactory emf = PersistenceManager.getInstance().getEntityManagerFactory();\n EntityManager em = emf.createEntityManager();\n EntityTransaction tx = em.getTransaction();\n tx.begin();\n em.persist(t);\n tx.commit();\n em.close();\n request.getSession().setAttribute(\"tref\", tref);//save the transaction ref for additional safety if needed.\n\n response.sendRedirect(url);\n\n } else {\n out.print(\"invalid code\"+initiateTransaction.getInitiateTransactionResponse().getInitiateTransactionResult().getTransactionStatusCode());\n }\n\n\n\n\n } catch (MerchantAPIService_InitiateTransaction_MerchantApiFaultFault_FaultMessage ex) {\n Logger.getLogger(initiatetransaction.class.getName()).log(Level.SEVERE, null, ex);\n } finally {\n out.close();\n }\n }", "public interface XmlService {\n\n\t/**\n\t * Parse response file.\n\t * \n\t * @param xmlPath\n\t * @param orderId\n\t * @param complete_on\n\t * @return\n\t * @throws JAXBException\n\t */\n ResponseMQ parseResponseFile(String xmlPath, Long orderId, Date complete_on) throws JAXBException;\n \n /**\n * \n * @param xml\n * @param orderId\n * @param complete_on\n * @return\n * @throws JAXBException\n */\n\tResponseMQ parseResponse(String xml, Long orderId, Date complete_on) throws JAXBException;\n\n\t/**\n\t * Generate change status request.\n\t * \n\t * @param requestMQ\n\t * @return result string or NULL\n\t */\n\tString generateChangeStatusRequest(RequestMQ requestMQ);\n\t\n}", "public void processReturnDocument(ReturnDocument rdoc) {\r\n this.processReturnDispositions(rdoc);\r\n this.processRentals(rdoc);\r\n // this.processDepartmentCredit(rdoc);\r\n this.computeSalesTaxAmount(rdoc);\r\n\r\n }", "public HSSFWorkbook process(){\r\n\t\tHSSFSheet sheet = templateWorkbook.getSheetAt(0);\r\n\r\n\t\t//write product infmration\r\n\t\torder.putSetToList();\r\n\t\tList<InventoryOrderProduct> orderProducts = order.getProduct_List();\r\n\t\tint totalDataRow = orderProducts.size();\r\n\t\tfor (int i = 0; i < totalDataRow; i++){\r\n\r\n\t\t\tInventoryOrderProduct orderProduct = orderProducts.get(i);\r\n\t\t\tRow row = sheet.createRow(data_row + i);\r\n\t\t\t\r\n\t\t\t\r\n\t\t\tProduct product = orderProduct.getProductBarcode().getProduct();\r\n\t\t\trow.createCell(barcode_column).setCellValue(orderProduct.getProductBarcode().getBarcode());\r\n\t\t\t\r\n\t\t\tColor color = orderProduct.getProductBarcode().getColor();\r\n\t\t\tif (color == null)\r\n\t\t\t\trow.createCell(productCode_column).setCellValue(product.getProductCode());\r\n\t\t\telse \r\n\t\t\t\trow.createCell(productCode_column).setCellValue(product.getProductCode() + color.getName());\r\n\t\t\t\r\n\t\t\trow.createCell(unit_column).setCellValue(product.getUnit());\r\n\t\t\tint q = orderProduct.getQuantity();\r\n\t\t\t\r\n\t\t\trow.createCell(quantity_column).setCellValue(orderProduct.getQuantity());\r\n\t\t\trow.createCell(salePrice_column).setCellValue(orderProduct.getSalesPrice());\r\n\t\t\t\r\n\t\t\tString year = product.getYear().getYear();\r\n\t\t\tString quarter = product.getQuarter().getQuarter_Name();\r\n\t\t\tString brandName = product.getBrand().getBrand_Name();\r\n\t\t\t\r\n\t\t\tString productComment = year +\"年\" + brandName + quarter + \"装\";\r\n\t\t\t\t\t\r\n\t\t\t\r\n\t\t\trow.createCell(productComment_column).setCellValue(productComment);\r\n\t\t}\r\n\r\n\t\treturn templateWorkbook;\r\n\t}", "public javax.xml.stream.XMLStreamReader getPullParser(javax.xml.namespace.QName qName)\n throws org.apache.axis2.databinding.ADBException{\n\n\n \n java.util.ArrayList elementList = new java.util.ArrayList();\n java.util.ArrayList attribList = new java.util.ArrayList();\n\n if (localGBInterval_fromTracker){\n elementList.add(new javax.xml.namespace.QName(\"http://www.ncbi.nlm.nih.gov/soap/eutils/efetch_seq\",\n \"GBInterval_from\"));\n \n if (localGBInterval_from != null){\n elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localGBInterval_from));\n } else {\n throw new org.apache.axis2.databinding.ADBException(\"GBInterval_from cannot be null!!\");\n }\n } if (localGBInterval_toTracker){\n elementList.add(new javax.xml.namespace.QName(\"http://www.ncbi.nlm.nih.gov/soap/eutils/efetch_seq\",\n \"GBInterval_to\"));\n \n if (localGBInterval_to != null){\n elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localGBInterval_to));\n } else {\n throw new org.apache.axis2.databinding.ADBException(\"GBInterval_to cannot be null!!\");\n }\n } if (localGBInterval_pointTracker){\n elementList.add(new javax.xml.namespace.QName(\"http://www.ncbi.nlm.nih.gov/soap/eutils/efetch_seq\",\n \"GBInterval_point\"));\n \n if (localGBInterval_point != null){\n elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localGBInterval_point));\n } else {\n throw new org.apache.axis2.databinding.ADBException(\"GBInterval_point cannot be null!!\");\n }\n } if (localGBInterval_iscompTracker){\n elementList.add(new javax.xml.namespace.QName(\"http://www.ncbi.nlm.nih.gov/soap/eutils/efetch_seq\",\n \"GBInterval_iscomp\"));\n \n \n if (localGBInterval_iscomp==null){\n throw new org.apache.axis2.databinding.ADBException(\"GBInterval_iscomp cannot be null!!\");\n }\n elementList.add(localGBInterval_iscomp);\n } if (localGBInterval_interbpTracker){\n elementList.add(new javax.xml.namespace.QName(\"http://www.ncbi.nlm.nih.gov/soap/eutils/efetch_seq\",\n \"GBInterval_interbp\"));\n \n \n if (localGBInterval_interbp==null){\n throw new org.apache.axis2.databinding.ADBException(\"GBInterval_interbp cannot be null!!\");\n }\n elementList.add(localGBInterval_interbp);\n }\n elementList.add(new javax.xml.namespace.QName(\"http://www.ncbi.nlm.nih.gov/soap/eutils/efetch_seq\",\n \"GBInterval_accession\"));\n \n if (localGBInterval_accession != null){\n elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localGBInterval_accession));\n } else {\n throw new org.apache.axis2.databinding.ADBException(\"GBInterval_accession cannot be null!!\");\n }\n \n\n return new org.apache.axis2.databinding.utils.reader.ADBXMLStreamReaderImpl(qName, elementList.toArray(), attribList.toArray());\n \n \n\n }", "@Override\n public void endElement(String uri, String localName,\n String qName) throws SAXException {\ntry{\n if (currentField.equals(\"vypis\")) {\n String hodnota = stringBuffer.toString();\n scanner = new Scanner(hodnota);\n while (scanner.hasNextLine()) {\n String veta=scanner.nextLine();\n //tady otchytavam vety tarifikace\n\n System.out.println(veta);\n //String[] radky = veta.split(\"\\n\");\n //for (int radek=0;radek<radky.length;radek++){\n // System.out.println(\"tak radek \"+ radek + \" : \"+radky[radek]);\n String[] temp = veta.split(\";\");// radky[radek].split(\";\"); //rozdelim string po castech do pole sringu, oddelovac je strednik\n // System.out.println(\"velikost vety je:\"+temp.length);\n if (temp.length == 13) { //pravidelne na stejnem vzorku se vzdy stane po x desitkach radek, ze neni vse, posledni znak je utnut a vlozen jako jediny do dalsiho value\n String sql = \"insert into tarifikace(_z,_na,pole2,kdy,priznak1,priznak2,popis,pole7,delka,pole10,pole11,pole12,pole13) values('\" + temp[0].trim() + \"','\" + temp[1] + \"','\" + temp[2] + \"','\" + temp[3] + \"','\" + temp[4] + \"','\" + temp[5] + \"','\" + temp[6] + \"','\" + temp[7] + \"',\" + temp[8] + \",'\" + temp[9] + \"','\" + temp[10] + \"','\" + temp[11] + \"','\" + temp[12] + \"')\";\n \n try {\n if(d.existujeTarifikace(temp[0].trim(),temp[1], temp[3]))\n {\n //System.out.println(\"sql :\" + sql);\n Menu.log1.info(\"Tarifikace: linka \"+temp[0]+\" cil \"+temp[1]+\" datum \"+temp[3]+\" delka\"+temp[8]);\n d.update(sql);\n if (temp[11].length() < 1) {\n temp[11] = \"0\";// a mam tu problem trun se jmenuje \"vyskocilova\" tak dam natvrdo \"0\"\n }\n if (temp[5].contains(\"Y\")) {\n Menu.single.execute(new Caracas(c.tatifikace(temp[0].trim(), temp[1], temp[3], Integer.parseInt(temp[8]), \"0\")));//c.zapis(c.tatifikace(temp[0].trim(), temp[1], temp[3], Integer.parseInt(temp[8]), \"0\"));\n }}else{\n //System.out.println(\"zaznam jiz v tarifikaci existuje\");\n }\n } catch (Exception ex) {\n Menu.log1.severe(\"Chyba - sql: \"+sql);\n Logger.getLogger(LinkyHandler.class.getName()).log(Level.SEVERE, null, ex);\n }\n } else {\n //System.out.println(\"Zaznam \"+temp + \"ma delku: \" + temp.length);\n }//}\n }\n\n\n\n }\n }catch (NullPointerException ne){\n //System.out.println(\"Tak currenfield je null\");\n }\n currentField = null;\n }", "static void parseIt() {\n try {\n long start = System.nanoTime();\n int[] modes = {DET_MODE, SUM_MODE, DOUBLES_MODE};\n String[] filePaths = {\"\\\\catalogue_products.xml\", \"\\\\products_to_categories.xml\", \"\\\\doubles.xml\"};\n HashMap<String, String[]> update = buildUpdateMap(remainderFile);\n window.putLog(\"-------------------------------------\\n\" + updateNodes(offerNodes, update) +\n \"\\nФайлы для загрузки:\");\n for (int i = 0; i < filePaths.length; i++) {\n // Define location for output file\n File outputFile = new File(workingDirectory.getParent() + filePaths[i]);\n pushDocumentToFile(outputFile, modes[i]);\n printFileInfo(outputFile);\n }\n window.putLog(\"-------------------------------------\\nВсего обработано уникальных записей: \" +\n offerNodes.size());\n long time = (System.nanoTime() - start) / 1000000;\n window.putLog(\"Завершено без ошибок за \" + time + \" мс.\");\n offerNodes = null;\n //window.workshop.setParseButtonDisabled();\n } catch (TransformerException e) {\n reportException(Thread.currentThread(),\n new RuntimeException(e.getCause() + \" (\" + e.getException() + \")\\n\\t\" + e.getMessageAndLocation()));\n } catch (ParserConfigurationException e) {\n reportException(Thread.currentThread(),\n new RuntimeException(e.getCause() + \"\\n\\t\" + e.getLocalizedMessage()));\n } catch (SAXException e) {\n reportException(Thread.currentThread(),\n new RuntimeException(\"SAXexception: \" + e.getMessage()));\n\n } catch (IOException e) {\n reportException(Thread.currentThread(),\n new RuntimeException(e.getCause() + \"\\n\\t\" + e.getMessage() + \". \" + e.getStackTrace()[0]));\n }\n }", "private void prepareXml()\n throws PaginatedResultSetXmlGenerationException\n {\n reset();\n if (m_taskVector.size() > 0 && m_pageNumber > -1)\n {\n addXmlHeader();\n addBody();\n }\n }", "public void addOrderToFile(Order order) {\n\n try {\n dao.addToFile(order, date);\n\n } catch (FlooringMasteryDaoException e) {\n\n }\n }", "@Override \n\t public void startDocument() throws SAXException {\n\t\t _data = new ArrayList<AlarmItemContent>();\n\t\t position = -1;\n\t }", "public javax.xml.stream.XMLStreamReader getPullParser(javax.xml.namespace.QName qName)\r\n throws org.apache.axis2.databinding.ADBException{\r\n\r\n\r\n \r\n java.util.ArrayList elementList = new java.util.ArrayList();\r\n java.util.ArrayList attribList = new java.util.ArrayList();\r\n\r\n if (localSpIdTracker){\r\n elementList.add(new javax.xml.namespace.QName(\"http://www.huawei.com.cn/schema/common/v2_1\",\r\n \"spId\"));\r\n \r\n if (localSpId != null){\r\n elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localSpId));\r\n } else {\r\n throw new org.apache.axis2.databinding.ADBException(\"spId cannot be null!!\");\r\n }\r\n } if (localSpPasswordTracker){\r\n elementList.add(new javax.xml.namespace.QName(\"http://www.huawei.com.cn/schema/common/v2_1\",\r\n \"spPassword\"));\r\n \r\n if (localSpPassword != null){\r\n elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localSpPassword));\r\n } else {\r\n throw new org.apache.axis2.databinding.ADBException(\"spPassword cannot be null!!\");\r\n }\r\n } if (localServiceIdTracker){\r\n elementList.add(new javax.xml.namespace.QName(\"http://www.huawei.com.cn/schema/common/v2_1\",\r\n \"serviceId\"));\r\n \r\n if (localServiceId != null){\r\n elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localServiceId));\r\n } else {\r\n throw new org.apache.axis2.databinding.ADBException(\"serviceId cannot be null!!\");\r\n }\r\n } if (localTimeStampTracker){\r\n elementList.add(new javax.xml.namespace.QName(\"http://www.huawei.com.cn/schema/common/v2_1\",\r\n \"timeStamp\"));\r\n \r\n if (localTimeStamp != null){\r\n elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localTimeStamp));\r\n } else {\r\n throw new org.apache.axis2.databinding.ADBException(\"timeStamp cannot be null!!\");\r\n }\r\n } if (localOATracker){\r\n elementList.add(new javax.xml.namespace.QName(\"http://www.huawei.com.cn/schema/common/v2_1\",\r\n \"OA\"));\r\n \r\n if (localOA != null){\r\n elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localOA));\r\n } else {\r\n throw new org.apache.axis2.databinding.ADBException(\"OA cannot be null!!\");\r\n }\r\n } if (localOauth_tokenTracker){\r\n elementList.add(new javax.xml.namespace.QName(\"http://www.huawei.com.cn/schema/common/v2_1\",\r\n \"oauth_token\"));\r\n \r\n if (localOauth_token != null){\r\n elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localOauth_token));\r\n } else {\r\n throw new org.apache.axis2.databinding.ADBException(\"oauth_token cannot be null!!\");\r\n }\r\n } if (localFATracker){\r\n elementList.add(new javax.xml.namespace.QName(\"http://www.huawei.com.cn/schema/common/v2_1\",\r\n \"FA\"));\r\n \r\n if (localFA != null){\r\n elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localFA));\r\n } else {\r\n throw new org.apache.axis2.databinding.ADBException(\"FA cannot be null!!\");\r\n }\r\n } if (localTokenTracker){\r\n elementList.add(new javax.xml.namespace.QName(\"http://www.huawei.com.cn/schema/common/v2_1\",\r\n \"token\"));\r\n \r\n if (localToken != null){\r\n elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localToken));\r\n } else {\r\n throw new org.apache.axis2.databinding.ADBException(\"token cannot be null!!\");\r\n }\r\n } if (localWatcherTracker){\r\n elementList.add(new javax.xml.namespace.QName(\"http://www.huawei.com.cn/schema/common/v2_1\",\r\n \"watcher\"));\r\n \r\n if (localWatcher != null){\r\n elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localWatcher));\r\n } else {\r\n throw new org.apache.axis2.databinding.ADBException(\"watcher cannot be null!!\");\r\n }\r\n } if (localPresentityTracker){\r\n elementList.add(new javax.xml.namespace.QName(\"http://www.huawei.com.cn/schema/common/v2_1\",\r\n \"presentity\"));\r\n \r\n if (localPresentity != null){\r\n elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localPresentity));\r\n } else {\r\n throw new org.apache.axis2.databinding.ADBException(\"presentity cannot be null!!\");\r\n }\r\n } if (localAuthIdTracker){\r\n elementList.add(new javax.xml.namespace.QName(\"http://www.huawei.com.cn/schema/common/v2_1\",\r\n \"authId\"));\r\n \r\n if (localAuthId != null){\r\n elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localAuthId));\r\n } else {\r\n throw new org.apache.axis2.databinding.ADBException(\"authId cannot be null!!\");\r\n }\r\n } if (localLinkidTracker){\r\n elementList.add(new javax.xml.namespace.QName(\"http://www.huawei.com.cn/schema/common/v2_1\",\r\n \"linkid\"));\r\n \r\n if (localLinkid != null){\r\n elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localLinkid));\r\n } else {\r\n throw new org.apache.axis2.databinding.ADBException(\"linkid cannot be null!!\");\r\n }\r\n } if (localPresentidTracker){\r\n elementList.add(new javax.xml.namespace.QName(\"http://www.huawei.com.cn/schema/common/v2_1\",\r\n \"presentid\"));\r\n \r\n if (localPresentid != null){\r\n elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localPresentid));\r\n } else {\r\n throw new org.apache.axis2.databinding.ADBException(\"presentid cannot be null!!\");\r\n }\r\n } if (localMsgTypeTracker){\r\n elementList.add(new javax.xml.namespace.QName(\"http://www.huawei.com.cn/schema/common/v2_1\",\r\n \"msgType\"));\r\n \r\n elementList.add(\r\n org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localMsgType));\r\n }\r\n\r\n return new org.apache.axis2.databinding.utils.reader.ADBXMLStreamReaderImpl(qName, elementList.toArray(), attribList.toArray());\r\n \r\n \r\n\r\n }", "public static android.service.notification.ZenModeConfig readXml(org.xmlpull.v1.XmlPullParser r17) throws org.xmlpull.v1.XmlPullParserException, java.io.IOException {\n /*\n r12 = r17.getEventType();\n r14 = 2;\n if (r12 == r14) goto L_0x0009;\n L_0x0007:\n r8 = 0;\n L_0x0008:\n return r8;\n L_0x0009:\n r11 = r17.getName();\n r14 = \"zen\";\n r14 = r14.equals(r11);\n if (r14 != 0) goto L_0x0018;\n L_0x0016:\n r8 = 0;\n goto L_0x0008;\n L_0x0018:\n r8 = new android.service.notification.ZenModeConfig;\n r8.<init>();\n r14 = \"version\";\n r15 = 1;\n r0 = r17;\n r13 = safeInt(r0, r14, r15);\n r2 = new java.util.ArrayList;\n r2.<init>();\n r4 = new java.util.ArrayList;\n r4.<init>();\n L_0x0031:\n r12 = r17.next();\n r14 = 1;\n if (r12 == r14) goto L_0x0184;\n L_0x0038:\n r11 = r17.getName();\n r14 = 3;\n if (r12 != r14) goto L_0x006b;\n L_0x003f:\n r14 = \"zen\";\n r14 = r14.equals(r11);\n if (r14 == 0) goto L_0x006b;\n L_0x0048:\n r14 = r2.isEmpty();\n if (r14 != 0) goto L_0x0008;\n L_0x004e:\n r14 = r2.size();\n r14 = new android.content.ComponentName[r14];\n r14 = r2.toArray(r14);\n r14 = (android.content.ComponentName[]) r14;\n r8.conditionComponents = r14;\n r14 = r4.size();\n r14 = new android.net.Uri[r14];\n r14 = r4.toArray(r14);\n r14 = (android.net.Uri[]) r14;\n r8.conditionIds = r14;\n goto L_0x0008;\n L_0x006b:\n r14 = 2;\n if (r12 != r14) goto L_0x0031;\n L_0x006e:\n r14 = \"allow\";\n r14 = r14.equals(r11);\n if (r14 == 0) goto L_0x00c9;\n L_0x0076:\n r14 = \"calls\";\n r15 = 0;\n r0 = r17;\n r14 = safeBoolean(r0, r14, r15);\n r8.allowCalls = r14;\n r14 = \"messages\";\n r15 = 0;\n r0 = r17;\n r14 = safeBoolean(r0, r14, r15);\n r8.allowMessages = r14;\n r14 = \"events\";\n r15 = 1;\n r0 = r17;\n r14 = safeBoolean(r0, r14, r15);\n r8.allowEvents = r14;\n r14 = \"from\";\n r15 = 0;\n r0 = r17;\n r14 = safeInt(r0, r14, r15);\n r8.allowFrom = r14;\n r14 = r8.allowFrom;\n if (r14 < 0) goto L_0x00ac;\n L_0x00a7:\n r14 = r8.allowFrom;\n r15 = 2;\n if (r14 <= r15) goto L_0x0031;\n L_0x00ac:\n r14 = new java.lang.IndexOutOfBoundsException;\n r15 = new java.lang.StringBuilder;\n r15.<init>();\n r16 = \"bad source in config:\";\n r15 = r15.append(r16);\n r0 = r8.allowFrom;\n r16 = r0;\n r15 = r15.append(r16);\n r15 = r15.toString();\n r14.<init>(r15);\n throw r14;\n L_0x00c9:\n r14 = \"sleep\";\n r14 = r14.equals(r11);\n if (r14 == 0) goto L_0x0142;\n L_0x00d2:\n r14 = 0;\n r15 = \"mode\";\n r0 = r17;\n r7 = r0.getAttributeValue(r14, r15);\n r14 = isValidSleepMode(r7);\n if (r14 == 0) goto L_0x0138;\n L_0x00e2:\n r8.sleepMode = r7;\n r14 = \"none\";\n r15 = 0;\n r0 = r17;\n r14 = safeBoolean(r0, r14, r15);\n r8.sleepNone = r14;\n r14 = \"startHour\";\n r15 = 0;\n r0 = r17;\n r9 = safeInt(r0, r14, r15);\n r14 = \"startMin\";\n r15 = 0;\n r0 = r17;\n r10 = safeInt(r0, r14, r15);\n r14 = \"endHour\";\n r15 = 0;\n r0 = r17;\n r5 = safeInt(r0, r14, r15);\n r14 = \"endMin\";\n r15 = 0;\n r0 = r17;\n r6 = safeInt(r0, r14, r15);\n r14 = isValidHour(r9);\n if (r14 == 0) goto L_0x013a;\n L_0x011c:\n r8.sleepStartHour = r9;\n r14 = isValidMinute(r10);\n if (r14 == 0) goto L_0x013c;\n L_0x0124:\n r8.sleepStartMinute = r10;\n r14 = isValidHour(r5);\n if (r14 == 0) goto L_0x013e;\n L_0x012c:\n r8.sleepEndHour = r5;\n r14 = isValidMinute(r6);\n if (r14 == 0) goto L_0x0140;\n L_0x0134:\n r8.sleepEndMinute = r6;\n goto L_0x0031;\n L_0x0138:\n r7 = 0;\n goto L_0x00e2;\n L_0x013a:\n r9 = 0;\n goto L_0x011c;\n L_0x013c:\n r10 = 0;\n goto L_0x0124;\n L_0x013e:\n r5 = 0;\n goto L_0x012c;\n L_0x0140:\n r6 = 0;\n goto L_0x0134;\n L_0x0142:\n r14 = \"condition\";\n r14 = r14.equals(r11);\n if (r14 == 0) goto L_0x0166;\n L_0x014a:\n r14 = \"component\";\n r0 = r17;\n r1 = safeComponentName(r0, r14);\n r14 = \"id\";\n r0 = r17;\n r3 = safeUri(r0, r14);\n if (r1 == 0) goto L_0x0031;\n L_0x015c:\n if (r3 == 0) goto L_0x0031;\n L_0x015e:\n r2.add(r1);\n r4.add(r3);\n goto L_0x0031;\n L_0x0166:\n r14 = \"exitCondition\";\n r14 = r14.equals(r11);\n if (r14 == 0) goto L_0x0031;\n L_0x016e:\n r14 = readConditionXml(r17);\n r8.exitCondition = r14;\n r14 = r8.exitCondition;\n if (r14 == 0) goto L_0x0031;\n L_0x0178:\n r14 = \"component\";\n r0 = r17;\n r14 = safeComponentName(r0, r14);\n r8.exitConditionComponent = r14;\n goto L_0x0031;\n L_0x0184:\n r14 = new java.lang.IllegalStateException;\n r15 = \"Failed to reach END_DOCUMENT\";\n r14.<init>(r15);\n throw r14;\n */\n throw new UnsupportedOperationException(\"Method not decompiled: android.service.notification.ZenModeConfig.readXml(org.xmlpull.v1.XmlPullParser):android.service.notification.ZenModeConfig\");\n }", "public void reprocessOrder(final Order order) {\n final String orderId = order.getId();\n final Map<String, Object> logMap = LoggingUtils.createLogMap();\n LoggingUtils.logIfNotNull(logMap, LoggingUtils.ORDER_ID, orderId);\n LOGGER.info(\"REPUBLISHING notification to Kafka 'order-received' topic for order - \" + orderId + \".\", logMap);\n sendOrderReceivedMessage(order.getId());\n }", "public void readXML() {\n\t try {\n\n\t \t//getting xml file\n\t \t\tFile fXmlFile = new File(\"cards.xml\");\n\t\t\tDocumentBuilderFactory dbFactory = DocumentBuilderFactory.newInstance();\n\t\t\tDocumentBuilder dBuilder = dbFactory.newDocumentBuilder();\n\t\t\tDocument doc = dBuilder.parse(fXmlFile);\n\t\t \n\t\t\t//doc.getDocumentElement().normalize(); ???\n\t\t \n\t\t \t//inserting card IDs and Effects into arrays\n\t\t\tNodeList nList = doc.getElementsByTagName(\"card\");\n\t\t\tfor (int i = 0; i < nList.getLength(); i++) {\n\t\t\t\tNode nNode = nList.item(i);\n\t\t\t\tif (nNode.getNodeType() == Node.ELEMENT_NODE) {\n\t\t\t\t\tElement eElement = (Element) nNode;\n\t\t\t\t\tint id = Integer.parseInt(eElement.getAttribute(\"id\"));\n\t\t\t\t\tString effect = eElement.getElementsByTagName(\"effect\").item(0).getTextContent();\n\t\t\t\t\tidarr.add(id);\n\t\t\t\t\teffsarr.add(effect);\n\t\t\t\t}\n\t\t\t}\n\t } catch (Exception e) {\n\t\t\te.printStackTrace();\n\t }\n }", "private Map<String,ProductInfo> parseProductInfo(Document doc) {\n\t\tMap<String,ProductInfo> pInfoMap = new LinkedHashMap<String, ProductInfo>();\n\n\t\tElement docEle = doc.getDocumentElement();\n\n\t\t// Print root element of the document\n\t\tSystem.out.println(\"Root element of the document: \"\n\t\t\t\t+ docEle.getNodeName());\n\n\t\tNodeList halalInfoList = docEle.getElementsByTagName(\"halalInfo\");\n\n\t\t// Print total student elements in document\n\t\tSystem.out.println(\"Total halal infos: \" + halalInfoList.getLength());\n\n\t\tif (halalInfoList != null && halalInfoList.getLength() > 0) {\n\t\t\tfor (int i = 0; i < halalInfoList.getLength(); i++) {\n\n\t\t\t\tNode node = halalInfoList.item(i);\n\n\t\t\t\tif (node.getNodeType() == Node.ELEMENT_NODE) {\n\t\t\t\t\tProductInfo pInfo = new ProductInfo();\n\t\t\t\t\tSystem.out.println(\"=====================\");\n\n\t\t\t\t\tElement e = (Element) node;\n\t\t\t\t\tNodeList nodeList = e.getElementsByTagName(\"halalId\");\n\t\t\t\t\tpInfo.setHalalId(nodeList.item(0).getChildNodes().item(0).getNodeValue());\n\t\t\t\t\tSystem.out.println(\"halalId: \" + pInfo.getHalalId() );\n\n\t\t\t\t\tnodeList = e.getElementsByTagName(\"product\");\n\t\t\t\t\tpInfo.setProduct(nodeList.item(0).getChildNodes().item(0).getNodeValue());\n\t\t\t\t\tSystem.out.println(\"product: \" + pInfo.getProduct() );\n\n\t\t\t\t\tnodeList = e.getElementsByTagName(\"validFrom\");\n\t\t\t\t\tpInfo.setHalalBeginDate(nodeList.item(0).getChildNodes().item(0).getNodeValue());\n\t\t\t\t\tSystem.out.println(\"valid from: \" + pInfo.getHalalBeginDate() );\n\n\t\t\t\t\tnodeList = e.getElementsByTagName(\"validTo\");\n\t\t\t\t\tpInfo.setHalalExpDate(nodeList.item(0).getChildNodes().item(0).getNodeValue());\n\t\t\t\t\tSystem.out.println(\"valid to: \" + pInfo.getHalalExpDate() );\n\n\t\t\t\t\tnodeList = e.getElementsByTagName(\"otherInfo\");\n\t\t\t\t\tpInfo.setOtherInfo(nodeList.item(0).getChildNodes().item(0).getNodeValue());\n\t\t\t\t\tSystem.out.println(\"other info: \" + pInfo.getOtherInfo() );\n\t\t\t\t\t\n\t\t\t\t\tpInfoMap.put(pInfo.getHalalId(), pInfo);\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn pInfoMap;\n\t}", "public static void main(String[] args) {\n new MySaxParserEx(\"ProductCatalog.xml\");\n\n }", "public void convertFile(String xlsFileName, String xmlFileName) throws IOException\n\t{\n\t try \n\t {\n\t Document newDoc = domBuilder.newDocument();\n\t Element rootElement = newDoc.createElement(\"suite\");\n\t rootElement.setAttribute(\"name\", \"Regression suite\");\n\t rootElement.setAttribute(\"verbose\", \"1\");\n\t \n\t \n\t \tnewDoc.appendChild(rootElement);\n\n\t \n\t Element rootElement2 = newDoc.createElement(\"listeners\");\n\t rootElement.appendChild(rootElement2);\n\n\t \n\t Element rootElement6 = newDoc.createElement(\"listener\");\n\t rootElement6.setAttribute(\"class-name\", \"com.dista.listeners.RetryListener\");\n\t rootElement2.appendChild(rootElement6);\n\t \n/*\t Element rootElement7 = newDoc.createElement(\"listener\");\n\t rootElement7.setAttribute(\"class-name\", \"com.dista.listeners.ExtentListener\");\n\t rootElement2.appendChild(rootElement7);*/\n\n/*\t Element rootElement8 = newDoc.createElement(\"listener\");\n\t rootElement8.setAttribute(\"class-name\", \"com.dista.listeners.CustomMethods\");\n\t rootElement2.appendChild(rootElement8);*/\n\t \n\t Element rootElement9 = newDoc.createElement(\"listener\");\n\t rootElement9.setAttribute(\"class-name\", \"com.dista.listeners.TestListener\");\n\t rootElement2.appendChild(rootElement9);\n\t \n\t \n\t FileInputStream ExcelFile;\n\t\t\tExcelFile = new FileInputStream(xlsFileName);\t\t//files stored at specified path contains URLs\n\t\t\tXSSFWorkbook ExcelWBook = new XSSFWorkbook(ExcelFile);\n\t\t\tXSSFSheet ExcelWSheet = ExcelWBook.getSheet(\"XML Data\");\n\t\t\tIterator <Row> ri = ExcelWSheet.iterator(); \n\t\t\tRow r = ri.next();\n\t\t\t\n\t\t\tboolean loop_condition2 = true, loop_condition3=true;\n\t\n\t\t\tdo\n\t\t\t{\n\t\t\t\t\n\t\t\t\tboolean loop_condition = true;\n\t\t\t\t\n\t\t\t\t//System.out.println(\"Text\"+r.getCell(0).getStringCellValue());\n\t\t\t\t\n\t\t\t\tElement rowElement = newDoc.createElement(\"test\");\n\t\t\t\trowElement.setAttribute(\"name\", r.getCell(0).getStringCellValue());\n\t\t\t\trootElement.appendChild(rowElement);\n\t\t\t\t\n\t\t\t\tElement curElement = newDoc.createElement(\"classes\");\n\t\t\t\trowElement.appendChild(curElement);\n\t\t\t\t\n\t\t\t\tElement curElement2 = newDoc.createElement(\"class\");\n\t curElement2.setAttribute(\"name\", \"com.dista.test.automation.\"+r.getCell(0).getStringCellValue());\n\t curElement.appendChild(curElement2); \n\t \n\t Element curElement3 = newDoc.createElement(\"methods\");\n\t curElement2.appendChild(curElement3);\n\t \n\t r= ri.next();\n\t \n\t while(loop_condition )\n\t {\n\t \t//System.out.println(r.getCell(1).getStringCellValue());\n\t \n\t \tString option=null;\n\t\n\t try\n\t {\n\t \tswitch (r.getCell(2).getStringCellValue())\n\t \t{\n\t \t\tcase \"Y\":\n\t \t\t\toption = \"include\";\n\t \t\t\tbreak;\n\t \t\t\t\n\t \t\tcase \"N\":\n\t \t\t\toption = \"exclude\";\n\t break;\n\t \n\t default:\n\t System.out.println(\"Invalid Data\");\n\t break;\n\t \t} \t\t\t\n\t }\n\t catch(NullPointerException npe)\n\t {\n\t \toption= \"exclude\";\n\t }\n\t \n\t //System.out.println(option);\n\t \t\tElement curElement4 = newDoc.createElement(option);\n\t \t\tcurElement4.setAttribute(\"name\", r.getCell(1).getStringCellValue());\n\t curElement3.appendChild(curElement4);\n\t \n\t\t if (ri.hasNext())\n\t\t {\n\t\t \tr= ri.next();\n\t\t \t\t\n\t\t try\n\t\t { \t\n\t\t \tif(!r.getCell(1).getStringCellValue().isEmpty())\n\t\t \t\tloop_condition= true;\n\t\t \telse\n\t\t \t\tloop_condition=false;\n\t\t \t}\n\t\t catch(NullPointerException npe)\n\t\t {\n\t\t \tloop_condition=false;\n\t\t }\n\t\t }\n\t\t else\n\t\t {\n\t\t \tloop_condition=false;\n\t\t \tloop_condition3= false;\n\t\t }\n\t }\n\t \n\t if(loop_condition3)\n\t {\n\t\t try\n\t\t { \t\n\t\t \tif(!r.getCell(0).getStringCellValue().isEmpty())\n\t\t \t\tloop_condition2= true;\n\t\t \telse\n\t\t \t\tloop_condition2=false;\n\t\t }\n\t\t catch(NullPointerException npe)\n\t\t {\n\t\t \tloop_condition2=false;\n\t\t }\n\t }\n\t else\n\t \tloop_condition2=false;\n\t\t\t}\n\t\t\twhile(loop_condition2);\n\t\n\t\t\t\n\t\t\tbaos = new ByteArrayOutputStream();\n\t\t\tosw = new OutputStreamWriter(baos);\n\t\n\t\t\tTransformerFactory tranFactory = TransformerFactory.newInstance();\n\t\t\tTransformer aTransformer = tranFactory.newTransformer();\n\t\t\taTransformer.setOutputProperty(OutputKeys.INDENT, \"yes\");\n\t\t\taTransformer.setOutputProperty(OutputKeys.METHOD, \"xml\");\n\t\t\taTransformer.setOutputProperty(OutputKeys.OMIT_XML_DECLARATION, \"no\");\n\t DOMImplementation domImpl = newDoc.getImplementation();\n\t // <!DOCTYPE suite PUBLIC \"-//Oberon//YOUR PUBLIC DOCTYPE//EN\" \"YOURDTD.dtd\">\n\t //<!DOCTYPE suite SYSTEM \"http://testng.org/testng-1.0.dtd\">\n\n\t // <!DOCTYPE suite SYSTEM \"http://testng.org/testng-1.0.dtd\" >\n\t\t DocumentType doctype = domImpl.createDocumentType(\"doctype\",\n\t\t \t\t\"\", \"http://testng.org/testng-1.0.dtd\");\n\t\t aTransformer.setOutputProperty(OutputKeys.DOCTYPE_SYSTEM, doctype.getSystemId());\n\t \n\t Source src = new DOMSource(newDoc);\n\t Result result = new StreamResult(new File(xmlFileName));\n\t aTransformer.transform(src, result);\n\t\n\t osw.flush();\n\t System.out.println(new String(baos.toByteArray()));\n\t \n\t ExcelWBook.close();\n\t\n\t\t}\n\t catch (Exception exp) \n\t {\n\t \texp.printStackTrace();\n\t } \n\t \n\t osw.close();\n\t baos.close();\n\t}", "private void rewriteXmlSource(){\n //Log.i(LOG_TAG, \"Updating radios.xml....\");\n String fileName = \"radios.xml\";\n String content = \"<?xml version=\\\"1.0\\\" encoding=\\\"utf-8\\\"?>\\n\" +\n \"<playlist>\\n\";\n\n for (Radio radio : radioList) {\n content += \"<track>\\n\";\n content += \"<location>\" + radio.getUrl() + \"</location>\\n\";\n content += \"<title>\" + radio.getName() + \"</title>\\n\";\n content += \"</track>\\n\";\n }\n content += \"</playlist>\";\n\n FileOutputStream outputStream = null;\n try {\n //Log.i(LOG_TAG,\"write new radios.xml file\");\n outputStream = owner.openFileOutput(fileName, owner.getBaseContext().MODE_PRIVATE);\n outputStream.write(content.getBytes());\n outputStream.close();\n } catch (Exception e2) {\n e2.printStackTrace();\n }\n }", "public static RadiologyOrder parse(javax.xml.stream.XMLStreamReader reader) throws java.lang.Exception{\n RadiologyOrder object =\n new RadiologyOrder();\n\n int event;\n java.lang.String nillableValue = null;\n java.lang.String prefix =\"\";\n java.lang.String namespaceuri =\"\";\n try {\n \n while (!reader.isStartElement() && !reader.isEndElement())\n reader.next();\n\n \n if (reader.getAttributeValue(\"http://www.w3.org/2001/XMLSchema-instance\",\"type\")!=null){\n java.lang.String fullTypeName = reader.getAttributeValue(\"http://www.w3.org/2001/XMLSchema-instance\",\n \"type\");\n if (fullTypeName!=null){\n java.lang.String nsPrefix = null;\n if (fullTypeName.indexOf(\":\") > -1){\n nsPrefix = fullTypeName.substring(0,fullTypeName.indexOf(\":\"));\n }\n nsPrefix = nsPrefix==null?\"\":nsPrefix;\n\n java.lang.String type = fullTypeName.substring(fullTypeName.indexOf(\":\")+1);\n \n if (!\"RadiologyOrder\".equals(type)){\n //find namespace for the prefix\n java.lang.String nsUri = reader.getNamespaceContext().getNamespaceURI(nsPrefix);\n return (RadiologyOrder)ExtensionMapper.getTypeObject(\n nsUri,type,reader);\n }\n \n\n }\n \n\n }\n\n \n\n \n // Note all attributes that were handled. Used to differ normal attributes\n // from anyAttributes.\n java.util.Vector handledAttributes = new java.util.Vector();\n \n\n \n \n reader.next();\n \n \n while (!reader.isStartElement() && !reader.isEndElement()) reader.next();\n \n if (reader.isStartElement() && new javax.xml.namespace.QName(\"\",\"PatientID\").equals(reader.getName())){\n \n nillableValue = reader.getAttributeValue(\"http://www.w3.org/2001/XMLSchema-instance\",\"nil\");\n if (\"true\".equals(nillableValue) || \"1\".equals(nillableValue)){\n throw new org.apache.axis2.databinding.ADBException(\"The element: \"+\"PatientID\" +\" cannot be null\");\n }\n \n\n java.lang.String content = reader.getElementText();\n \n object.setPatientID(\n org.apache.axis2.databinding.utils.ConverterUtil.convertToString(content));\n \n reader.next();\n \n } // End of if for expected property start element\n \n else{\n // A start element we are not expecting indicates an invalid parameter was passed\n throw new org.apache.axis2.databinding.ADBException(\"Unexpected subelement \" + reader.getName());\n }\n \n \n while (!reader.isStartElement() && !reader.isEndElement()) reader.next();\n \n if (reader.isStartElement() && new javax.xml.namespace.QName(\"\",\"CaseID\").equals(reader.getName())){\n \n nillableValue = reader.getAttributeValue(\"http://www.w3.org/2001/XMLSchema-instance\",\"nil\");\n if (\"true\".equals(nillableValue) || \"1\".equals(nillableValue)){\n throw new org.apache.axis2.databinding.ADBException(\"The element: \"+\"CaseID\" +\" cannot be null\");\n }\n \n\n java.lang.String content = reader.getElementText();\n \n object.setCaseID(\n org.apache.axis2.databinding.utils.ConverterUtil.convertToString(content));\n \n reader.next();\n \n } // End of if for expected property start element\n \n else{\n // A start element we are not expecting indicates an invalid parameter was passed\n throw new org.apache.axis2.databinding.ADBException(\"Unexpected subelement \" + reader.getName());\n }\n \n \n while (!reader.isStartElement() && !reader.isEndElement()) reader.next();\n \n if (reader.isStartElement() && new javax.xml.namespace.QName(\"\",\"ExaminationType\").equals(reader.getName())){\n \n object.setExaminationType(ExaminationType_type1.Factory.parse(reader));\n \n reader.next();\n \n } // End of if for expected property start element\n \n else{\n // A start element we are not expecting indicates an invalid parameter was passed\n throw new org.apache.axis2.databinding.ADBException(\"Unexpected subelement \" + reader.getName());\n }\n \n while (!reader.isStartElement() && !reader.isEndElement())\n reader.next();\n \n if (reader.isStartElement())\n // A start element we are not expecting indicates a trailing invalid property\n throw new org.apache.axis2.databinding.ADBException(\"Unexpected subelement \" + reader.getName());\n \n\n\n\n } catch (javax.xml.stream.XMLStreamException e) {\n throw new java.lang.Exception(e);\n }\n\n return object;\n }", "@Test\n public void testTaxpayerInfoFromXml() throws FileNotFoundException {\n\n Database.processTaxpayersDataFromFilesIntoDatabase(databaseInstance.getTaxpayersInfoFilesPath(), xmlTestFilenameList);\n\n // Get the taxpayer from the Database\n Taxpayer actualTaxpayerInfoXml = databaseInstance.getTaxpayerFromArrayList(0);\n\n // Test user info from xml file\n Taxpayer expectedTaxpayerInfoFromXml = new Taxpayer(\"Nikos Zisis\", \"130456094\",\n ApplicationConstants.SINGLE, \"40000.0\");\n\n Receipt expectedTaxpayerReceiptFromXml =\n new Receipt(ApplicationConstants.OTHER_RECEIPT, \"1\", \"25/2/2014\", \"2000.0\",\n \"Omega Watches\", \"Greece\", \"Ioannina\", \"Kaloudi\", \"4\");\n\n expectedTaxpayerInfoFromXml.setReceipts( new ArrayList<>( Collections.singletonList(expectedTaxpayerReceiptFromXml)));\n expectedTaxpayerInfoFromXml.calculateTaxpayerTaxIncreaseOrDecreaseBasedOnReceipts();\n\n assertEquals(expectedTaxpayerReceiptFromXml.toString(), actualTaxpayerInfoXml.getReceipts().get(0).toString());\n assertEquals(expectedTaxpayerInfoFromXml.toString(), actualTaxpayerInfoXml.toString());\n }", "public static void parseNewOrder(String line) throws IOException, Exception{\n\t\tString order_id, timestamp;\n\t\tString side;\n\t\tint target_size, size;\n\t\tdouble price;\n\n\t\tremove_order_matcher = remove_order_pattern.matcher(line);\n\t\tadd_order_matcher = add_order_pattern.matcher(line);\n\n if(add_order_matcher.matches()){//add order to log book\n\t\t\t//separate fields\n\t\t\ttimestamp = add_order_matcher.group(1);\n\t\t\torder_id = add_order_matcher.group(2);\n\t\t\tside = add_order_matcher.group(3);\n\t\t\tprice = Double.parseDouble(add_order_matcher.group(4));\n\t\t\tsize = Integer.parseInt(add_order_matcher.group(5));\n\n\t\t\taddOrder(timestamp,order_id,side,price,size);\n\n } else if(remove_order_matcher.matches()){\n\t\t\t//separate fields\n\t\t\ttimestamp = remove_order_matcher.group(1);\n\t\t\torder_id = remove_order_matcher.group(2);\n\t\t\tsize = Integer.parseInt(remove_order_matcher.group(3));\n\n\t\t\tremoveOrder(timestamp,order_id,size);\n\n\t\t} else {\n\t\t\tthrow new IOException();\n\t\t}\n\t}", "public void saveOrder(Order order) {\n Client client = clientService.findBySecurityNumber(order.getClient().getSecurityNumber());\n Product product = productService.findByBarcode(order.getProduct().getBarcode());\n order.setClient(client);\n order.setProduct(product);\n if (isClientPresent(order) && isProductPresent(order)) {\n do {\n currencies = parseCurrencies();\n } while (currencies.isEmpty());\n\n generateTransactionDate(order);\n\n// Client client = ClientServiceImpl.getClientRepresentationMap().get(order.getClient());\n// Product product = ProductServiceImpl.getProductRepresentationMap().get(order.getProduct());\n convertPrice(order);\n orders.add(order);\n orderedClients.add(client);\n orderedProducts.add(product);\n }\n }", "@Override\n public void endElement(String uri, String localName, String qName)\n throws SAXException {\n if(branchInXML.equalsIgnoreCase(ELEM_BOOK)) {\n if(localName.equalsIgnoreCase(ELEM_ID)) {\n currentBook.setId(new Integer(currentvalue.toString()));\n } else if(localName.equalsIgnoreCase(ELEM_TITLE)) {\n currentBook.setTitle(currentvalue.toString());\n } else if(localName.equalsIgnoreCase(ELEM_ISBN)) {\n currentBook.setIsbn(currentvalue.toString());\n } else if(localName.equalsIgnoreCase(ELEM_IMAGE_URL)) {\n currentBook.setImageURL(currentvalue.toString());\n } else if(localName.equalsIgnoreCase(ELEM_THUMBNAIL)) {\n currentBook.setThumbnailURL(currentvalue.toString());\n } else if(localName.equalsIgnoreCase(ELEM_THUMBNAIL)) {\n currentBook.setTitle(currentvalue.toString());\n } else if(localName.equalsIgnoreCase(ELEM_DESCRIPTION)) {\n currentBook.setDescription(currentvalue.toString());\n } else if(localName.equalsIgnoreCase(ELEM_RATING)) {\n currentBook.setRating(new Double(currentvalue.toString()).doubleValue());\n } else if(localName.equalsIgnoreCase(ELEM_RATING_COUNT)) {\n currentBook.setRatingCount(new Integer(currentvalue.toString()).intValue());\n } else if(localName.equalsIgnoreCase(ELEM_NUM_PAGES)) {\n currentBook.setNumPages(new Integer(currentvalue.toString()).intValue());\n } else if(localName.equalsIgnoreCase(ELEM_LINK)) {\n currentBook.setLink(currentvalue.toString());\n }\n \n } else if(branchInXML.equalsIgnoreCase(ELEM_REVIEW)) {\n if(localName.equalsIgnoreCase(ELEM_ID)) {\n currentReview.setId(new Integer(currentvalue.toString()).intValue());\n } else if(localName.equalsIgnoreCase(ELEM_RECOMMENDED_FOR)) {\n currentReview.setRecommendedFor(currentvalue.toString());\n } else if(localName.equalsIgnoreCase(ELEM_BODY)) {\n currentReview.setContent(currentvalue.toString());\n } else if(localName.equalsIgnoreCase(ELEM_DATE_ADDED)) {\n currentReview.setDateAdded(currentvalue.toString());\n }\n } else if(branchInXML.equalsIgnoreCase(ELEM_AUTHOR)) {\n if(localName.equalsIgnoreCase(ELEM_AUTHOR)) {\n currentBook.addAuthor(currentvalue.toString());\n }\n } else if(branchInXML.equalsIgnoreCase(ELEM_USER)) {\n if(localName.equalsIgnoreCase(ELEM_NAME)) {\n currentReview.setAuthor(currentvalue.toString());\n } else if(localName.equalsIgnoreCase(ELEM_LOCATION)) {\n currentReview.setAuthorLocation(currentvalue.toString());\n }\n }\n currentElement=false;\n //Close the branch if necessary and return to the parent branch.\n if(localName.equalsIgnoreCase(ELEM_BOOK)) {\n books.add(currentBook);\n } else if(localName.equalsIgnoreCase(ELEM_REVIEW)) {\n currentBook.addReview(currentReview);\n } else if(localName.equalsIgnoreCase(ELEM_USER)) {\n branchInXML = ELEM_REVIEW;\n } else if(localName.equalsIgnoreCase(ELEM_AUTHOR)) {\n branchInXML = ELEM_BOOK;\n }\n }", "private void processAce ()\n{\n // Set the .ace input file name.\n ace_file.setFileName ( fileName );\n\n // Open the .ace input file.\n ace_file.openFile ();\n\n // Set the XML file name.\n xml_file.setFileName ( fileName + \".xml\" );\n\n // Open the XML file for writing.\n xml_file.open_XML_file ();\n\n // Write the XML file header.\n xml_file.write_XML_header ();\n\n // Process the .ace summary line.\n processSummary ();\n\n // Process the Phrap assembled contigs.\n processContigs ();\n\n // Complete the XML file.\n xml_file.write_XML_footer ();\n xml_file.close_XML ();\n\n // Close the .ace input file.\n ace_file.closeFile ();\n\n // Close the XML file.\n xml_file.closeFile ();\n}", "public javax.xml.stream.XMLStreamReader getPullParser(javax.xml.namespace.QName qName)\n throws org.apache.axis2.databinding.ADBException{\n\n\n \n java.util.ArrayList elementList = new java.util.ArrayList();\n java.util.ArrayList attribList = new java.util.ArrayList();\n\n if (localTokenTracker){\n elementList.add(new javax.xml.namespace.QName(\"http://knowledge.sjxx.cn\",\n \"token\"));\n \n elementList.add(localToken==null?null:\n org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localToken));\n } if (localObjectNameTracker){\n elementList.add(new javax.xml.namespace.QName(\"http://knowledge.sjxx.cn\",\n \"objectName\"));\n \n elementList.add(localObjectName==null?null:\n org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localObjectName));\n } if (localOldProperty_descriptionTracker){\n elementList.add(new javax.xml.namespace.QName(\"http://knowledge.sjxx.cn\",\n \"oldProperty_description\"));\n \n elementList.add(localOldProperty_description==null?null:\n org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localOldProperty_description));\n } if (localOldValues_descriptionTracker){\n elementList.add(new javax.xml.namespace.QName(\"http://knowledge.sjxx.cn\",\n \"oldValues_description\"));\n \n elementList.add(localOldValues_description==null?null:\n org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localOldValues_description));\n } if (localNewProperty_descriptionTracker){\n elementList.add(new javax.xml.namespace.QName(\"http://knowledge.sjxx.cn\",\n \"newProperty_description\"));\n \n elementList.add(localNewProperty_description==null?null:\n org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localNewProperty_description));\n } if (localNewValues_descriptionTracker){\n elementList.add(new javax.xml.namespace.QName(\"http://knowledge.sjxx.cn\",\n \"newValues_description\"));\n \n elementList.add(localNewValues_description==null?null:\n org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localNewValues_description));\n } if (localOldProperty_descriptionTypeTracker){\n elementList.add(new javax.xml.namespace.QName(\"http://knowledge.sjxx.cn\",\n \"oldProperty_descriptionType\"));\n \n elementList.add(\n org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localOldProperty_descriptionType));\n } if (localOldValues_descriptionTypeTracker){\n elementList.add(new javax.xml.namespace.QName(\"http://knowledge.sjxx.cn\",\n \"oldValues_descriptionType\"));\n \n elementList.add(\n org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localOldValues_descriptionType));\n } if (localNewProperty_descriptionTypeTracker){\n elementList.add(new javax.xml.namespace.QName(\"http://knowledge.sjxx.cn\",\n \"newProperty_descriptionType\"));\n \n elementList.add(\n org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localNewProperty_descriptionType));\n } if (localNewValues_descriptionTypeTracker){\n elementList.add(new javax.xml.namespace.QName(\"http://knowledge.sjxx.cn\",\n \"newValues_descriptionType\"));\n \n elementList.add(\n org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localNewValues_descriptionType));\n } if (localOldCardinalityTypeTracker){\n elementList.add(new javax.xml.namespace.QName(\"http://knowledge.sjxx.cn\",\n \"oldCardinalityType\"));\n \n elementList.add(\n org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localOldCardinalityType));\n } if (localOldCardinalityNumTracker){\n elementList.add(new javax.xml.namespace.QName(\"http://knowledge.sjxx.cn\",\n \"oldCardinalityNum\"));\n \n elementList.add(\n org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localOldCardinalityNum));\n } if (localNewCardinalityTypeTracker){\n elementList.add(new javax.xml.namespace.QName(\"http://knowledge.sjxx.cn\",\n \"newCardinalityType\"));\n \n elementList.add(\n org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localNewCardinalityType));\n } if (localNewCardinalityNumTracker){\n elementList.add(new javax.xml.namespace.QName(\"http://knowledge.sjxx.cn\",\n \"newCardinalityNum\"));\n \n elementList.add(\n org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localNewCardinalityNum));\n } if (localDescriptionTypeTracker){\n elementList.add(new javax.xml.namespace.QName(\"http://knowledge.sjxx.cn\",\n \"descriptionType\"));\n \n elementList.add(\n org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localDescriptionType));\n }\n\n return new org.apache.axis2.databinding.utils.reader.ADBXMLStreamReaderImpl(qName, elementList.toArray(), attribList.toArray());\n \n \n\n }", "public void insertPakageXML(String userID, String fromDate, String toDate, String access_token,String retrieveRequestID) {\n String uri = \"https://vinay9-dev-ed.my.salesforce.com/services/data/v56.0/sobjects/Package_XML__c/\";\n try {\n System.out.println(\"access_token \"+access_token);\n Header oauthHeader = new BasicHeader(\"Authorization\", \"OAuth \" + access_token);\n JSONObject packageXMLRecord = new JSONObject();\n packageXMLRecord.put(\"xml_string__c\", packageXMLString);\n packageXMLRecord.put(\"CSV_String__c\", csvRows);\n packageXMLRecord.put(\"userid__c\", userID);\n packageXMLRecord.put(\"from_date__c\", fromDate);\n packageXMLRecord.put(\"to_date__c\", toDate);\n\t packageXMLRecord.put(\"Retrieve_Request_ID__c\", retrieveRequestID);\n DefaultHttpClient httpClient = new DefaultHttpClient();\n HttpPost httpPost = new HttpPost(uri);\n httpPost.addHeader(oauthHeader);\n StringEntity body = new StringEntity(packageXMLRecord.toString(1));\n body.setContentType(\"application/json\");\n httpPost.setEntity(body);\n\n HttpResponse response = httpClient.execute(httpPost);\n\n int statusCode = response.getStatusLine().getStatusCode();\n if (statusCode == 201) {\n String response_string = EntityUtils.toString(response.getEntity());\n JSONObject json = new JSONObject(response_string);\n System.out.println(\"New packagexml id from response: \" + json.getString(\"id\"));\n } else {\n System.out.println(\"Insertion unsuccessful. Status code returned is \" + statusCode);\n }\n } catch (JSONException e) {\n\t \n System.out.println(\"Issue creating JSON or processing results\");\n e.printStackTrace();\n } catch (IOException ioe) {\n ioe.printStackTrace();\n } catch (NullPointerException npe) {\n npe.printStackTrace();\n }\n }", "private void addOrder() {\r\n // Variables\r\n String date = null, cust_email = null, cust_location = null, product_id = null;\r\n int quantity = 0;\r\n\r\n // Date-Time Format \"YYYY-MM-DD\"\r\n DateTimeFormatter dateFormatter = DateTimeFormatter.ISO_LOCAL_DATE;\r\n boolean date_Valid = false;\r\n\r\n // Separator for user readability\r\n String s = \"----------------------------------------\"; // separator\r\n\r\n boolean user_confirmed = false;\r\n while (!user_confirmed) {\r\n\r\n // module header\r\n System.out.println(s);\r\n System.out.println(\"Adding Order: \");\r\n System.out.println(s);\r\n\r\n // Getting the user date for entry\r\n System.out.print(\"Enter Date(YYYY-MM-DD): \");\r\n date = console.next();\r\n //This while loop will check if the date is valid\r\n while (!date_Valid) {\r\n try {\r\n LocalDate.parse(date, dateFormatter);\r\n System.out.println(\"Validated Date\");\r\n date_Valid = true;\r\n } catch (DateTimeParseException e) {\r\n date_Valid = false;\r\n System.out.println(\"Invalid Date\");\r\n System.out.print(\"Enter valid date(YYYY-MM-DD):\");\r\n date = console.next();\r\n }\r\n }\r\n\r\n // Getting user email\r\n System.out.print(\"Enter customer email: \");\r\n cust_email = console.next();\r\n boolean flag = false;\r\n int countr = 0, countd = 0;\r\n while(!flag) {\r\n //This loop will check if the email is valid\r\n for (int i = 0; i < cust_email.length(); i++) {\r\n if (cust_email.charAt(i) == '@') {\r\n countr++;\r\n if (countr > 1) {\r\n flag = false;\r\n break;\r\n }\r\n if (i >= 1) flag = true;\r\n else {\r\n flag = false;\r\n break;\r\n }\r\n\r\n }\r\n if (cust_email.charAt(i) == '.') {\r\n countd++;\r\n if (countd > 1) {\r\n flag = false;\r\n break;\r\n }\r\n if (i >= 3) flag = true;\r\n else {\r\n flag = false;\r\n break;\r\n }\r\n }\r\n if (cust_email.indexOf(\".\") - cust_email.indexOf(\"@\") >= 2) {\r\n flag = true;\r\n }\r\n if (!flag) break;\r\n }\r\n if (flag && cust_email.length() >= 5) {\r\n System.out.println(\"Validated Email\");\r\n break;\r\n } else {\r\n System.out.println(\"Invalid Email\");\r\n }\r\n }\r\n\r\n //Validate the customer ZIP code\r\n System.out.print(\"Enter ZIP Code: \");\r\n cust_location = console.next();\r\n while((cust_location.length()) != 5){\r\n System.out.println(\"ZIP Code must be 5 characters long\");\r\n System.out.print(\"Enter ZIP Code: \");\r\n cust_location = console.next();\r\n }\r\n\r\n // Validate product id\r\n System.out.print(\"Enter Product ID: \");\r\n product_id = console.next();\r\n while ((product_id.length()) != 12) {\r\n System.out.println(\"Product ID must be 12 characters long!\");\r\n System.out.print(\"Enter Product ID: \");\r\n product_id = console.next();\r\n }\r\n\r\n // Validate quantity\r\n System.out.print(\"Enter Quantity: \");\r\n while (!console.hasNextInt()) {\r\n System.out.println(\"Quantity must be a whole number!\");\r\n System.out.print(\"Enter Quantity: \");\r\n console.next();\r\n }\r\n quantity = console.nextInt();\r\n\r\n //Confirming Entries\r\n System.out.println(s);\r\n System.out.println(\"You entered the following values:\");\r\n System.out.println(s);\r\n System.out.printf(\"%-11s %-20s %-20s %-18s %-11s\\n\", \"|DATE:|\", \"|CUSTOMER EMAIL:|\", \"|CUSTOMER LOCATION:|\", \"|PRODUCT ID:|\", \"|QUANTITY:|\");\r\n System.out.printf(\"%-11s %-20s %-20s %-18s %11s\\n\", date, cust_email, cust_location, product_id, quantity);\r\n System.out.println(s);\r\n System.out.println(\"Is this correct?\");\r\n System.out.print(\"Type 'yes' to add this record, type 'no' to start over: \");\r\n String inp = console.next();\r\n boolean validated = false;\r\n while (validated == false) {\r\n if (inp.toLowerCase().equals(\"yes\")) {\r\n validated = true;\r\n user_confirmed = true;\r\n }\r\n else if (inp.toLowerCase().equals(\"no\")) {\r\n validated = true;\r\n\r\n }\r\n else {\r\n System.out.print(\"Invalid response. Please type 'yes' or 'no': \");\r\n inp = console.next();\r\n }\r\n }\r\n }\r\n OrderItem newItem = new OrderItem(date, cust_email, cust_location, product_id, quantity);\r\n orderInfo.add(newItem);\r\n\r\n // alert user and get next step\r\n System.out.println(s);\r\n System.out.println(\"Entry added to Data Base!\");\r\n System.out.println(s);\r\n System.out.println(\"Do you want to add another entry?\");\r\n System.out.print(\"Type 'yes' to add another entry, or 'no' to exit to main menu: \");\r\n String inp = console.next();\r\n boolean valid = false;\r\n while (valid == false) {\r\n if (inp.toLowerCase().equals(\"yes\")) {\r\n valid = true;\r\n addOrder();\r\n } else if (inp.toLowerCase().equals(\"no\")) {\r\n valid = true; // possibly direct to main menu later\r\n } else {\r\n System.out.print(\"Invalid response. Please type 'yes' or 'no': \");\r\n inp = console.next();\r\n }\r\n }\r\n }", "public void set_xml_info(Element _xml_info) {\n\t\tthis._xml_info = _xml_info;\n\t}", "protected abstract void fromXmlEx(Element source)\n throws PSUnknownNodeTypeException;", "@Override\n\tpublic void execute(final CheckoutActionContext context) throws EpSystemException {\n\t\tcheckoutEventHandler.preCheckoutOrderPersist(context.getShoppingCart(),\n\t\t\t\tcontext.getOrderPaymentList(), context.getOrder());\n\n\t\t//process and update order - should limit our updates to once\n\t\tfinal Order updatedOrder = orderService.processOrderOnCheckout(context.getOrder(),\n\t\t\t\tcontext.getShoppingCart().isExchangeOrderShoppingCart());\n\t\tcontext.setOrder(updatedOrder);\n\t\tcontext.setOrderPaymentList(updatedOrder.getOrderPayments());\n\t}", "private void createOrder(Shop shop, FileManager fileManager, ArrayList<Tool> toolList,\n ArrayList<Integer> quantityList) {\n if (toolList.size() != 0) {\n if (shop.createOrderOrAppendOrder(shop, toolList, quantityList, fileManager)) {\n System.out.println(\"Successfully added and/or appended order to orders.txt!\");\n } else {\n System.out.println(\"ERROR: Could not edit orders.txt.\");\n }\n }\n }", "private void parseProduct(User user) throws XMLStreamException, XMLParserException {\n\t\twhile(this.reader.next() == START_ELEMENT){\n\t\t\tuser.setProperty(this.reader.getLocalName(), this.getElementString());\n\t\t}\n\t}", "@Override\n abstract public void commitPendingXmlChanges();", "@Override\n public void toXml(XmlContext xc) {\n\n }", "protected void processElements(Node node, int uolId) throws\n PropertyException {\n Node child = node.getFirstChild();\n\n while (child != null) {\n\n if ( (child.getNodeType() == Node.ELEMENT_NODE) &&\n (!processElement((Element) child, uolId))) {\n //if the child node was not processed already, process it now.\n processElements(child, uolId);\n\n }\n child = child.getNextSibling();\n }\n }", "@Override\n\tpublic Document executeTask(YFSEnvironment env, Document inXML) throws Exception {\n\t\tYFCDocument\tdocTaskQueue = YFCDocument.getDocumentFor (inXML);\n\t\tYFCElement\teleTaskQueue = docTaskQueue.getDocumentElement();\n\t\tYIFApi\tapi = YIFClientFactory.getInstance().getLocalApi ();\n\n\t\tif (YFSUtil.getDebug ())\n\t\t{\n\t\t\tSystem.out.println (\"In Agent \" + eleTaskQueue.getAttribute(\"TransactionId\") + \" (SEWarrantyActivationAgentImpl.java)\");\n\t\t\tSystem.out.println (\"Task Input:\");\n\t\t\tSystem.out.println (docTaskQueue.getString());\n\t\t}\n\t\t\t\t\n\t\tchangeOrderLineStatus (env, eleTaskQueue);\n\t\t\n\t\tregisterTaskComplete (env, eleTaskQueue);\n\t\treturn null;\n\t}", "@Override\n @Transactional\n public PurchaseResponse placeOrder(Purchase purchase) {\n Order order = purchase.getOrder();\n\n //genrate traking number\n String orderTrakingNumber = genrateOrderTrakingnumber();\n order.setOrderTrackingNumber(orderTrakingNumber);\n\n //populate order with order item\n Set<OrderItem> orderItems = purchase.getOrderItems();\n orderItems.forEach(item-> order.add(item));\n\n //populate order with billingAddress and shipplingAddress\n order.setBillingAddress(purchase.getBillingAddress());\n order.setShippingAddress(purchase.getShippingAddress());\n\n //populate customer with order\n Customer customer = purchase.getCustomer();\n\n // checck if the existing customer\n String theEmail = customer.getEmail();\n Customer customerFromDB = customerRepository.findByEmail(theEmail);\n\n if(customerFromDB != null){\n // we found it let assign them\n customer = customerFromDB;\n }\n\n customer.add(order);\n\n //sqve to the db\n customerRepository.save(customer);\n\n\n\n // return the response\n return new PurchaseResponse(orderTrakingNumber);\n }", "public static void subirXMLFTP(String cotizacionId,String xml) {\n\t\tDocumentBuilderFactory factory;\r\n\t DocumentBuilder builder;\r\n\t Document doc;\r\n\t TransformerFactory tFactory;\r\n\t Transformer transformer;\r\n\t \r\n\t String nombreArchivo = cotizacionId+\".xml\";\r\n\t\ttry {\r\n\t\t\tfactory \t\t\t= DocumentBuilderFactory.newInstance();\r\n\t\t\tbuilder \t\t\t= factory.newDocumentBuilder();\r\n\t\t\tdoc \t\t\t\t= builder.parse(new InputSource(new StringReader(xml)));\r\n\t\t\t// Usamos un transformador para la salida del archivo xml generado\r\n\t\t\ttFactory \t\t\t= TransformerFactory.newInstance();\r\n\t\t transformer \t\t= tFactory.newTransformer();\r\n\t\t DOMSource source \t= new DOMSource(doc);\t\t \r\n\t\t StreamResult result = new StreamResult(new File(\"/home/insis/\"+nombreArchivo));\r\n\t\t transformer.transform(source, result);\r\n\t\t \r\n\t\t \r\n\t\t} catch (SAXException e) {\r\n\t\t\te.printStackTrace();\r\n\t\t} catch (IOException e) {\r\n\t\t\te.printStackTrace();\r\n\t\t} catch (ParserConfigurationException e) {\r\n\t\t\te.printStackTrace();\r\n\t\t} catch (TransformerConfigurationException e) {\r\n\t\t\te.printStackTrace();\r\n\t\t} catch (TransformerException e) {\t\t\r\n\t\t\te.printStackTrace();\r\n\t\t}\r\n\t \r\n}", "public void printToXML() {\n String fileString = \"outputDisposal.xml\";\n //Creating the path object of the file\n Path filePath = Paths.get(fileString);\n if (Files.notExists(filePath)) {\n try {\n Files.createFile(filePath);\n } catch (IOException e1) {\n\n e1.printStackTrace();\n }\n }\n //Converting the path object to file to use in the FileWriter constructor \n File newFile = filePath.toFile();\n\n /*\n Typical try-with-resources block that features three streams: FileWriter,BufferedWriter and PrintWriter.\n The FileWriter object connects the file tho the stream.\n The BufferedWriter object \n */\n try ( PrintWriter out = new PrintWriter(new BufferedWriter(new FileWriter(newFile)))) {\n for (PickUp pck : pickups) {\n out.print(pck);\n }\n\n } catch (IOException e) {\n System.err.println(e);\n }\n\n }", "public void startDocument() throws SAXException {\n\t\ttry {\n\t\t\tlogger.info(\"Parsing XML buddies\");\n\t\t} catch (Exception e) {\n\t\t\tbuddies = null;\n\t\t\tthrow new SAXException(\"XMLBuddyParser error\", e);\n\t\t}\n\t}", "private boolean inputXML(String xmlName, ArrayList<Map> fieldsAttribs, String outputFileName){\n ArrayList<String> wholeFile = this.readReturnFileContents(xmlName);\n String first = wholeFile.get(0);\n String xmlversion = \"((\\\\<\\\\?)\\\\s*(xml)\\\\s*(version)\\\\s*(=)\\\\s*(\\\\\\\".*?\\\\\\\")\\\\s*(\\\\?\\\\>))\";\n if(first.matches(xmlversion)){\n wholeFile.remove(0);\n }\n String t = \"\";\n for(String s : wholeFile){\n t+=s + \"\\n\";\n }\n if(this.parseXML(t, fieldsAttribs)){\n if(this.validateXML(t, fieldsAttribs, outputFileName))\n {\n return true;\n }\n }\n return false;\n }", "public void getXmlFromStream (BufferedReader reader){\n\n String tmpDate = null;\n String strDate = null;\n Date date = null;\n\n try{\n XmlPullParserFactory factory = XmlPullParserFactory.newInstance();\n XmlPullParser xpp = factory.newPullParser();\n\n // point the parser to our file.\n xpp.setInput(reader);\n // get initial eventType\n int eventType = xpp.getEventType();\n\n // process tag while not reaching the end of document\n while(eventType != XmlPullParser.END_DOCUMENT) {\n switch(eventType) {\n // at start of document: START_DOCUMENT\n case XmlPullParser.START_DOCUMENT:\n //study = new Study();\n break;\n\n // at start of a tag: START_TAG\n case XmlPullParser.START_TAG:\n // get tag name\n String tagName = xpp.getName();\n\n // if <Cube>, get attribute: 'currency'\n if(tagName.equalsIgnoreCase(KEY_CUBE)) {\n if(strDate == null){\n strDate = xpp.getAttributeValue(null, KEY_DATE);\n }\n\n String currency = xpp.getAttributeValue(null, KEY_CURRENCY);\n String rate = xpp.getAttributeValue(null, KEY_RATE);\n if(currency != null) {\n\n // Create new object\n date = createDate(strDate); // Create date\n double doubleRate = Double.parseDouble(rate); // Convert string to double\n cubes.add(new CubeXML(new Date(),currency, doubleRate)); // Create object and store in list\n }\n }\n break;\n }\n // jump to next event\n eventType = xpp.next();\n }\n\n // Add euro\n cubes.add(new CubeXML(date, \"Euro\",1));\n\n } catch (XmlPullParserException e) {\n e.printStackTrace();\n } catch (IOException e) {\n e.printStackTrace();\n }\n\n }", "void bukaXoxo(){\r\n FileInputStream xx = null;\r\n try {\r\n xx = new FileInputStream(\"xoxo.xml\");\r\n // harus diingat objek apa yang dahulu disimpan di file \r\n // program untuk membaca harus sinkron dengan program\r\n // yang dahulu digunakan untuk menyimpannya\r\n int isi;\r\n char charnya;\r\n String stringnya;\r\n // isi file dikembalikan menjadi string\r\n stringnya =\"\";\r\n while ((isi = xx.read()) != -1) {\r\n charnya= (char) isi;\r\n stringnya = stringnya + charnya;\r\n } \r\n // string isi file dikembalikan menjadi larik double\r\n resi = (String) xstream.fromXML(stringnya);\t \r\n }\r\n catch (Exception e){\r\n System.err.println(\"test: \"+e.getMessage());\r\n }\r\n finally{\r\n if(xx != null){\r\n try{\r\n xx.close();\r\n }\r\n catch (IOException e) {\r\n e.printStackTrace();\r\n }\r\n } \r\n } \r\n \r\n }", "public void commit() {\n\t\ttry {\n\t\t\tTransformer transformer = TransformerFactory.newInstance().newTransformer();\n\t\t\tDOMSource domSource = new DOMSource(document);\n\t\t\tStreamResult streamResult = new StreamResult(new File(fileName));\n\t\t\ttransformer.transform(domSource, streamResult);\n\t\t\t//Reload nodes list\n\t\t\tnodes = document.getDocumentElement().getChildNodes();\n\t\t} catch(Exception e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t}", "@Override\n\t\t\t\tpublic void endDocument() throws SAXException {\n\t\t\t\t\tsuper.endDocument();\n\t\t\t\t}" ]
[ "0.6623879", "0.6362716", "0.6247964", "0.61684823", "0.61121035", "0.6063292", "0.6047522", "0.5665954", "0.5574057", "0.53982854", "0.53892297", "0.53848714", "0.5333109", "0.5323768", "0.52402836", "0.5218283", "0.5210993", "0.52014107", "0.51908886", "0.5189148", "0.518883", "0.51824886", "0.51737124", "0.51589286", "0.51528883", "0.5116261", "0.511447", "0.508937", "0.5071891", "0.50452185", "0.50260085", "0.5008412", "0.5005375", "0.5000687", "0.49995273", "0.49978706", "0.49605396", "0.49525553", "0.4947382", "0.49413043", "0.4938569", "0.49137974", "0.49084577", "0.49016142", "0.4894955", "0.4887389", "0.48862094", "0.48784575", "0.48740074", "0.48483974", "0.48454964", "0.4832399", "0.48317805", "0.4826551", "0.48168838", "0.4816216", "0.48127225", "0.48051274", "0.47899246", "0.478975", "0.47867787", "0.47744772", "0.47719675", "0.47716567", "0.47668266", "0.47612888", "0.4761159", "0.47511423", "0.47494617", "0.4742456", "0.4741224", "0.47319356", "0.47224373", "0.472175", "0.47182631", "0.47143504", "0.47121185", "0.47097513", "0.47074628", "0.4702959", "0.4699916", "0.46845078", "0.46779308", "0.4676046", "0.46741828", "0.46721607", "0.46711066", "0.46702653", "0.46701416", "0.4666133", "0.46585023", "0.46567625", "0.46564373", "0.46533754", "0.46533412", "0.4652362", "0.46449542", "0.4642561", "0.464235", "0.4641838" ]
0.7744413
0
Corresponds to function w_nn(x), see Eqn. 22.10 in [1]. TODO: test, not used currently.
@Override public double getWeight(double x) { if (-0.5 <= x && x < 0.5) return 1; else return 0; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private int nn(int x)\n {\n return x > 0 ? 1 : 0;\n }", "private void computeWeights(double w_m) {\n\t\t// Initialise\n\t\tdouble m = Math.floor(lambda);\n\t\tif (!flag) return;\n\t\t\n\t\t// Down\n\t\tint j = (int) m;\n\t\twhile (j > leftTruncation) {\n\t\t\tweights[j-1-leftTruncation] = (j / lambda) * weights[j-leftTruncation];\n\t\t\tj = j - 1;\n\t\t}\n\t\t\n\t\t// Up\n\t\tif (lambda >= 400) {\n\t\t\tj = (int) m;\n\t\t\twhile (j < rightTruncation) {\n\t\t\t\tweights[j+1-leftTruncation] = (lambda / (j+1)) * weights[j-leftTruncation];\n\t\t\t\tj = j + 1;\n\t\t\t}\n\t\t} else {\n\t\t\t// Special\n\t\t\tif (rightTruncation > 600) {\n\t\t\t\tflag = false;\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tj = (int) m;\n\t\t\twhile (j < rightTruncation) {\n\t\t\t\tdouble q = lambda / (j + 1);\n\t\t\t\tif (weights[j-leftTruncation] > (underflow / q)) {\n\t\t\t\t\tweights[j+1-leftTruncation] = q * weights[j-leftTruncation];\n\t\t\t\t\tj = j + 1;\n\t\t\t\t} else {\n\t\t\t\t\trightTruncation = j;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\t// Compute W\n\t\ttotalWeight = 0;\n\t\tint s = leftTruncation;\n\t\tint t = rightTruncation;\n\t\twhile (s < t) {\n\t\t\tif (weights[s-leftTruncation] <= weights[t-leftTruncation]) {\n\t\t\t\ttotalWeight += weights[s-leftTruncation];\n\t\t\t\ts = s + 1;\n\t\t\t} else {\n\t\t\t\ttotalWeight += weights[t-leftTruncation];\n\t\t\t\tt = t - 1;\n\t\t\t}\n\t\t}\n\t\ttotalWeight += weights[s-leftTruncation];\n\t\t\n\t}", "protected abstract void updateWeightsSpecific(double ni);", "public static Double[] learnSimplePerceptronWords(Data data1[],int index,double LearningRate,Double w[],HashMap<Integer, Integer> words)\r\n \t{\r\n \t\t\r\n \t\tData data[] = Arrays.copyOf(data1,index);\r\n \t\t\r\n \t\t//shuffle the data..\r\n \t \tArrayList<Data> arrayList = new ArrayList<Data>(Arrays.asList(Arrays.copyOf(data,index))); \r\n \t\tCollections.shuffle(arrayList,new Random(10));\r\n \t\tdata = arrayList.toArray(new Data[arrayList.size()]);\r\n \t\tfor(int i=0;i<index;i++)\r\n \t\t{\r\n \t\t\tdouble trueLabel;\r\n \t\t\tdouble predictedLabel;\r\n \t\t\tdouble dotProduct_wT_x = 0.0f;\r\n \t\t\tHashMap<Integer, Double> x = new HashMap<Integer, Double>();\r\n \t\t \r\n \t\t\ttrueLabel = data[i].getY();\r\n \t\t\tx= data[i].getX();\r\n \t\t\t \r\n \t\t\t\r\n \t\t \r\n \t\t\t//wT*x (contains bias)\r\n \t\t\tfor (Map.Entry<Integer, Double> entry : x.entrySet()) {\r\n \t\t\t\tdotProduct_wT_x = dotProduct_wT_x + w[entry.getKey()] * entry.getValue();\r\n \t\t\t}\r\n \t\t\t\r\n \t\t\t//predict the label\r\n \t\t\tif(dotProduct_wT_x < 0)\r\n \t\t\t\tpredictedLabel = -1;\r\n \t\t\telse\t\r\n \t\t\t\tpredictedLabel = +1;\r\n \t\t\t\r\n \t\t\t//check if prediction is correct, if not update the weight vector and bias.\r\n \t\t\tif(predictedLabel != trueLabel)\r\n \t\t//\tif(dotProduct_wT_x<0)\r\n \t\t\t{\r\n \t\t\t\t//update bias\r\n \t\t\t\tw[0]=w[0]+trueLabel*LearningRate;\r\n\r\n \t\t\t\t\r\n \t\t\t\t//update all other weights only if those words are worthy tracking\r\n \t\t\t\r\n \t\t\t\tfor(int j=1;j<w.length;j++)\r\n \t\t\t\t{\r\n \t\t\t\t\t// if(x.containsKey(j))\r\n \t\t\t\t if(x.containsKey(j))\r\n \t\t\t \t if(words.containsKey(j)) //give more weightage to words that matter updates only when keyword found\r\n \t\t \t\t\t \tw[j]=w[j]+LearningRate*trueLabel*x.get(j);\r\n\r\n \t\t\t\t//\telse\r\n \t\t\t//\t\t\tw[j]=(double)0;\r\n \t\t\t\t \r\n \t\t\t\t\r\n \t\t\t\t \r\n \t\t\t\t}\r\n \t\t\t}\r\n \t\t \r\n \t\t}\r\n \t\treturn w;\r\n \t}", "public static Double[] learnSimplePerceptron(Data data1[],int index,double LearningRate,Double w[],HashMap<Integer, Integer> words)\r\n \t{\r\n \t\t\r\n \t\tData data[] = Arrays.copyOf(data1,index);\r\n \t\t\r\n \t\t//shuffle the data..\r\n \t \tArrayList<Data> arrayList = new ArrayList<Data>(Arrays.asList(Arrays.copyOf(data,index))); \r\n \t\tCollections.shuffle(arrayList,new Random(10));\r\n \t\tdata = arrayList.toArray(new Data[arrayList.size()]);\r\n \t\tfor(int i=0;i<index;i++)\r\n \t\t{\r\n \t\t\tdouble trueLabel;\r\n \t\t\tdouble predictedLabel;\r\n \t\t\tdouble dotProduct_wT_x = 0.0f;\r\n \t\t\tHashMap<Integer, Double> x = new HashMap<Integer, Double>();\r\n \t\t \r\n \t\t\ttrueLabel = data[i].getY();\r\n \t\t\tx= data[i].getX();\r\n \t\t\t \r\n \t\t\t\r\n \t\t \r\n \t\t\t//wT*x (contains bias)\r\n \t\t\tfor (Map.Entry<Integer, Double> entry : x.entrySet()) {\r\n \t\t\t\tdotProduct_wT_x = dotProduct_wT_x + w[entry.getKey()] * entry.getValue();\r\n \t\t\t}\r\n \t\t\t\r\n \t\t\t//predict the label\r\n \t\t\tif(dotProduct_wT_x < 0)\r\n \t\t\t\tpredictedLabel = -1;\r\n \t\t\telse\t\r\n \t\t\t\tpredictedLabel = +1;\r\n \t\t\t\r\n \t\t\t//check if prediction is correct, if not update the weight vector and bias.\r\n \t\t\tif(predictedLabel != trueLabel)\r\n \t\t//\tif(dotProduct_wT_x<0)\r\n \t\t\t{\r\n \t\t\t\t//update bias\r\n \t\t\t\tw[0]=w[0]+trueLabel*LearningRate;\r\n \t\t\t\t\r\n \t\t\t\t\r\n \t\t\t\t//update all other weights only if those words are worthy tracking\r\n \t\t\t\r\n \t\t\t\tfor(int j=1;j<w.length;j++)\r\n \t\t\t\t{\r\n \t\t\t\t\t// if(x.containsKey(j))\r\n \t\t\t\t if(x.containsKey(j))\r\n \t\t\t \t//\t if(words.containsKey(j)) //give more weightage to words that matter\r\n \t\t \t\t\t \tw[j]=w[j]+LearningRate*trueLabel*x.get(j);\r\n\r\n \t\t\t\t//\telse\r\n \t\t\t//\t\t\tw[j]=(double)0;\r\n \t\t\t\t \r\n \t\t\t\r\n \t\t\t\t \r\n \t\t\t\t}\r\n \t\t\t}\r\n \t\t \r\n \t\t}\r\n \t\treturn w;\r\n \t}", "public static Node w_(Object x) {\r\n\t\t\r\n\t\treturn w_(x, defaultClass);\r\n\t}", "static int webknapSackDyna(int W, int wt[], int val[], int n) {\n int i, w;\n int K[][] = new int[n + 1][W + 1];\n //K[i][w] represents the max value for weight w by using i elements\n // row i represents using i values\n // col w represents the current weight\n // Build table K[][] in bottom up manner\n // n is the number of values available to use\n // for each available value\n for (i = 0; i <= n; i++) {\n // for each weight until target weight is achieved\n for (w = 0; w <= W; w++) {\n\n if (i == 0 || w == 0)\n K[i][w] = 0;\n // if the previous weight is still less than the target weight it can potentially be included\n // to calculate the max val for current weight\n else if (wt[i - 1] <= w)\n // val[i-1]: value for the i th weight\n // K[i-1][w-wt[i-1]]: max value using i-1 values to achieve weight target weight - wt of i-1 element\n // val[i-1] + K[i-1][w-wt[i-1]] -> used ith weight add val[i-] and use the remaining i-1 weights to\n // get to the target weight w-wt of ith element -> wt-wt[i-1]\n // K[i-1][w] => max value using i-1 elements to achieve weight w i.e. not using ith element\n K[i][w] = max(val[i - 1] + K[i - 1][w - wt[i - 1]], K[i - 1][w]);\n // wt[i-1] > w\n else\n K[i][w] = K[i - 1][w];\n }\n }\n\n return K[n][W];\n }", "public int getNetworth();", "private double[] getNewNodeWeights(GNode winner, int X, int Y) {\n\n double[] newWeights = new double[GSOMConstants.DIMENSIONS];\n\n if (winner.getY() == Y) {\n\t\t\t//two consecutive nodes \n\n //winnerX,otherX\n if (X == winner.getX() + 1) {\n String nextNodeStr = Utils.generateIndexString(X + 1, Y); //nX\n String othrSideNodeStr = Utils.generateIndexString(X - 2, Y); //oX\n String topNodeStr = Utils.generateIndexString(winner.getX(), Y + 1); //tX\n String botNodeStr = Utils.generateIndexString(winner.getX(), Y - 1); //bX\n\n\t\t\t\t//new node has one direct neighbor, \n //but neighbor has a neighbor in the opposing directly\n //wX,X,nX\n if (nodeMap.containsKey(nextNodeStr)) {\n newWeights = newWeightsForNewNodeInMiddle(winner, nextNodeStr);\n } //oX,wX,X\n else if (nodeMap.containsKey(othrSideNodeStr)) {\n //2 consecutive nodes on right\n newWeights = newWeightsForNewNodeOnOneSide(winner, othrSideNodeStr);\n } // tX\n //wX, X\n else if (nodeMap.containsKey(topNodeStr)) {\n //right and top nodes\n newWeights = newWeightsForNewNodeOnOneSide(winner, topNodeStr);\n } //wX, X\n // bX\n else if (nodeMap.containsKey(botNodeStr)) {\n //right and bottom nodes\n newWeights = newWeightsForNewNodeOnOneSide(winner, botNodeStr);\n } else {\n newWeights = newWeightsForNewNodeOneOlderNeighbor(winner);\n }\n } //otherX,winnerX\n else if (X == winner.getX() - 1) {\n String nextNodeStr = Utils.generateIndexString(X - 1, Y);\n String othrSideNodeStr = Utils.generateIndexString(X + 2, Y);\n String topNodeStr = Utils.generateIndexString(winner.getX(), Y + 1);\n String botNodeStr = Utils.generateIndexString(winner.getX(), Y - 1);\n\n\t\t\t\t//new node has one direct neighbor, \n //but neighbor has a neighbor in the opposing directly\n //nX,X,wX\n if (nodeMap.containsKey(nextNodeStr)) {\n newWeights = newWeightsForNewNodeInMiddle(winner, nextNodeStr);\n } //X,wX,oX\n else if (nodeMap.containsKey(othrSideNodeStr)) {\n //2 consecutive nodes on left\n newWeights = newWeightsForNewNodeOnOneSide(winner, othrSideNodeStr);\n } else if (nodeMap.containsKey(topNodeStr)) {\n //left and top nodes\n newWeights = newWeightsForNewNodeOnOneSide(winner, topNodeStr);\n } else if (nodeMap.containsKey(botNodeStr)) {\n //left and bottom nodes\n newWeights = newWeightsForNewNodeOnOneSide(winner, botNodeStr);\n } else {\n newWeights = newWeightsForNewNodeOneOlderNeighbor(winner);\n }\n }\n\n //new node is in the middle of two older nodes\n } else if (winner.getX() == X) {\n\n\t\t\t//otherY\n //winnerY\n if (Y == winner.getY() + 1) {\n String nextNodeStr = Utils.generateIndexString(X, Y + 1);\n String othrSideNodeStr = Utils.generateIndexString(X, Y - 2);\n String leftNodeStr = Utils.generateIndexString(X - 1, winner.getY());\n String rightNodeStr = Utils.generateIndexString(X + 1, winner.getY());\n\n\t\t\t\t//new node has one direct neighbor, \n //but neighbor has a neighbor in the opposing directly\n //nY\n // Y\n //wY\n if (nodeMap.containsKey(nextNodeStr)) {\n newWeights = newWeightsForNewNodeInMiddle(winner, nextNodeStr);\n } else if (nodeMap.containsKey(othrSideNodeStr)) {\n //2 consecutive nodes upwards\n newWeights = newWeightsForNewNodeOnOneSide(winner, othrSideNodeStr);\n } else if (nodeMap.containsKey(leftNodeStr)) {\n //left and top nodes\n newWeights = newWeightsForNewNodeOnOneSide(winner, leftNodeStr);\n } else if (nodeMap.containsKey(rightNodeStr)) {\n //right and top nodes\n newWeights = newWeightsForNewNodeOnOneSide(winner, rightNodeStr);\n } else {\n newWeights = newWeightsForNewNodeOneOlderNeighbor(winner);\n }\n } //winnerY\n //otherY\n else if (Y == winner.getY() - 1) {\n String nextNodeStr = Utils.generateIndexString(X, Y - 1);\n String othrSideNodeStr = Utils.generateIndexString(X, Y + 2);\n String leftNodeStr = Utils.generateIndexString(X - 1, winner.getY());\n String rightNodeStr = Utils.generateIndexString(X + 1, winner.getY());\n\n\t\t\t\t//new node has one direct neighbor, \n //but neighbor has a neighbor in the opposing directly\n //wY\n // Y\n //nY\n if (nodeMap.containsKey(nextNodeStr)) {\n newWeights = newWeightsForNewNodeInMiddle(winner, nextNodeStr);\n } else if (nodeMap.containsKey(othrSideNodeStr)) {\n //2 consecutive nodes on left\n newWeights = newWeightsForNewNodeOnOneSide(winner, othrSideNodeStr);\n } else if (nodeMap.containsKey(leftNodeStr)) {\n //left and top nodes\n newWeights = newWeightsForNewNodeOnOneSide(winner, leftNodeStr);\n } else if (nodeMap.containsKey(rightNodeStr)) {\n //left and bottom nodes\n newWeights = newWeightsForNewNodeOnOneSide(winner, rightNodeStr);\n } else {\n newWeights = newWeightsForNewNodeOneOlderNeighbor(winner);\n }\n }\n }\n\n for (int i = 0; i < GSOMConstants.DIMENSIONS; i++) {\n if (newWeights[i] < 0) {\n newWeights[i] = 0;\n }\n if (newWeights[i] > 1) {\n newWeights[i] = 1;\n }\n }\n return newWeights;\n }", "@Override\n /**\n * @param X The input vector. An array of doubles.\n * @return The value returned by th LUT or NN for this input vector\n */\n\n public double outputFor(double[] X) {\n int i = 0, j = 0;\n for(i=0;i<argNumInputs;i++){\n S[0][i] = X[i];\n NeuronCell[0][i] = X[i];\n }\n //then add the bias term\n S[0][argNumInputs] = 1;\n NeuronCell[0][argNumInputs] = customSigmoid(S[0][argNumInputs]);\n S[1][argNumHidden] = 1;\n NeuronCell[1][argNumHidden] = customSigmoid(S[1][argNumInputs]);\n\n for(i=0;i<argNumHidden;i++){\n for(j=0;j<=argNumInputs;j++){\n //Wji : weigth from j to i\n WeightSum+=NeuronCell[0][j]*Weight[0][j][i];\n }\n //Sj = sigma(Wji * Xi)\n S[1][i]=WeightSum;\n NeuronCell[1][i]=(customSigmoid(WeightSum));\n //reset weigthsum\n WeightSum=0;\n }\n\n for(i = 0; i < argNumOutputs; i++){\n for(j = 0;j <= argNumHidden;j++){\n WeightSum += NeuronCell[1][j] * Weight[1][j][i];\n }\n NeuronCell[2][i]=customSigmoid(WeightSum);\n S[2][i]=WeightSum;\n WeightSum=0;\n }\n //if we only return 1 double, it means we only have one output, so actually we can write return NeuronCell[2][0]\n return NeuronCell[2][0];\n }", "public static String isNSW(String word)\n\t{\n\t\tif (sw.contains(word))\n\t\t{\n\t\t\treturn \"\";\n\t\t}\n\t\treturn word;\n\t}", "public void transform(double[] x) {\r\n int i,j;\r\n double sumWindow=nn*nn;\r\n\r\n System.arraycopy(x,0,data,1,n);\r\n if(winNum>0) {\r\n for(i=0,j=1;i<nn;i++) {\r\n data[j]=data[j]*winMult[i];\r\n j++;\r\n data[j]=data[j]*winMult[i];\r\n j++;\r\n sumWindow=sumWindow+winMult[i]*winMult[i];\r\n }\r\n }\r\n/* Test to plot windowed function\r\n nSpectrum++;\r\n for(i=0,j=0;i<nn;i++) {\r\n x[j]=i;\r\n j++;\r\n x[j]=data[j];\r\n j++;\r\n }\r\n if(ncurve>=0) ncurve = graph.deleteAllCurves();\r\n ncurve = graph.addCurve(x,nn,Color.blue);\r\n graph.paintAll=true;\r\n graph.repaint();\r\n*/\r\n four1(data,nn,1);\r\n nSpectrum++;\r\n x[0]=0;\r\n spectrum[0]+=(data[0]*data[0]+data[1]*data[1])/sumWindow;\r\n for(i=1,j=2;i<nn/2;i++) {\r\n x[j]=i*scale;\r\n j++;\r\n spectrum[i]+=2.*(data[j]*data[j]+data[j+1]*data[j+1])/sumWindow;\r\n j++;\r\n }\r\n x[j]=(nn/2)*scale;\r\n j++;\r\n spectrum[nn/2]+=(data[j]*data[j]+data[j+1]*data[j+1])/sumWindow;\r\n for(i=0,j=1;i<=nn/2;i++) {\r\n x[j]=0.434*Math.log(floor+spectrum[i]/nSpectrum);\r\n j+=2;\r\n }\r\n }", "public static Double[] learnSimplePerceptronRound2(Data data1[],int index,double LearningRate,Double w[],HashMap<Integer, Integer> words)\r\n \t{\r\n \t\t//Double w[] = new Double[20]; \r\n \t/*\tDouble min =-0.01; // Set To Your Desired Min Value\r\n\t Double max = 0.01;\r\n \t\tdouble smallRandNumber = min + new Random().nextDouble() * (max - min); \r\n \t\tArrays.fill(w, smallRandNumber);*/\r\n \t\t\r\n \t\tData data[] = Arrays.copyOf(data1,index);\r\n \t\t\r\n \t\t//shuffle the data..\r\n \t \tArrayList<Data> arrayList = new ArrayList<Data>(Arrays.asList(Arrays.copyOf(data,index))); \r\n \t\tCollections.shuffle(arrayList,new Random(10));\r\n \t\tdata = arrayList.toArray(new Data[arrayList.size()]);\r\n \t\tfor(int i=0;i<index;i++)\r\n \t\t{\r\n \t\t\tdouble trueLabel;\r\n \t\t\tdouble predictedLabel;\r\n \t\t\tdouble dotProduct_wT_x = 0.0f;\r\n \t\t\tHashMap<Integer, Double> x = new HashMap<Integer, Double>();\r\n \t\t \r\n \t\t\ttrueLabel = data[i].getY();\r\n \t\t\tx= data[i].getX();\r\n \t\t\tboolean correct=false;\r\n \t\t\t// loop till its corrects..\r\n \t\t\t\r\n \t\t\twhile(correct==false)\r\n \t\t\t{\r\n \t\t\t//wT*x (contains bias)\r\n \t\t\tfor (Map.Entry<Integer, Double> entry : x.entrySet()) {\r\n \t\t\t\tdotProduct_wT_x = dotProduct_wT_x + w[entry.getKey()] * entry.getValue();\r\n \t\t\t}\r\n \t\t\t\r\n \t\t\t//predict the label\r\n \t\t\tif(dotProduct_wT_x < 0)\r\n \t\t\t\tpredictedLabel = -1;\r\n \t\t\telse\t\r\n \t\t\t\tpredictedLabel = +1;\r\n \t\t\t\r\n \t\t\t//check if prediction is correct, if not update the weight vector and bias.\r\n \t\t\tif(predictedLabel != trueLabel)\r\n \t\t//\tif(dotProduct_wT_x<0)\r\n \t\t\t{\r\n \t\t\t\t//update bias\r\n \t\t\t\tw[0]=w[0]+trueLabel*LearningRate;\r\n \t\t\t\t\r\n \t\t\t\t//update all other weights only if those words are worthy tracking\r\n \t\t\t\r\n \t\t\t\tfor(int j=1;j<w.length;j++)\r\n \t\t\t\t{\r\n \t\t\t\t\t// if(x.containsKey(j))\r\n \t\t\t\t if(x.containsKey(j))\r\n \t\t\t\t//\t if(words.containsKey(j)) //give more weightage to words that matter\r\n \t\t\t//\t\t\t\tw[j]=w[j]+LearningRate*trueLabel*(x.get(j));\r\n \t\t\t\t//\t else\r\n\t\t\t\t\t\t\tw[j]=w[j]+LearningRate*trueLabel*x.get(j);\r\n\r\n \t\t\t\t//\telse\r\n \t\t\t//\t\t\tw[j]=(double)0;\r\n \t\t\t\t}\r\n \t\t\t}\r\n \t\t\telse\r\n \t\t\t\tcorrect=true;\r\n \t\t }\r\n \t\t}\r\n \t\treturn w;\r\n \t}", "public static double noise(double x, double y, double z, double w){\n\t\t\n\t\tdouble n0,n1,n2,n3,n4; // Noise contributions from the five corners\n\t\t// Skew the (x,y,z,w) space to determine which cell of 24 simplices we're in\n\t\tdouble s=(x+y+z+w)*F4; // Factor for 4D skewing\n\t\tint i=fastfloor(x+s);\n\t\tint j=fastfloor(y+s);\n\t\tint k=fastfloor(z+s);\n\t\tint l=fastfloor(w+s);\n\t\tdouble t=(i+j+k+l)*G4; // Factor for 4D unskewing\n\t\tdouble X0=i-t; // Unskew the cell origin back to (x,y,z,w) space\n\t\tdouble Y0=j-t;\n\t\tdouble Z0=k-t;\n\t\tdouble W0=l-t;\n\t\tdouble x0=x-X0; // The x,y,z,w distances from the cell origin\n\t\tdouble y0=y-Y0;\n\t\tdouble z0=z-Z0;\n\t\tdouble w0=w-W0;\n\t\t// For the 4D case, the simplex is a 4D shape I won't even try to describe.\n\t\t// To find out which of the 24 possible simplices we're in, we need to\n\t\t// determine the magnitude ordering of x0, y0, z0 and w0.\n\t\t// Six pair-wise comparisons are performed between each possible pair\n\t\t// of the four coordinates, and the results are used to rank the numbers.\n\t\tint rankx=0;\n\t\tint ranky=0;\n\t\tint rankz=0;\n\t\tint rankw=0;\n\t\tif(x0>y0) rankx++;\n\t\telse ranky++;\n\t\tif(x0>z0) rankx++;\n\t\telse rankz++;\n\t\tif(x0>w0) rankx++;\n\t\telse rankw++;\n\t\tif(y0>z0) ranky++;\n\t\telse rankz++;\n\t\tif(y0>w0) ranky++;\n\t\telse rankw++;\n\t\tif(z0>w0) rankz++;\n\t\telse rankw++;\n\t\tint i1,j1,k1,l1; // The integer offsets for the second simplex corner\n\t\tint i2,j2,k2,l2; // The integer offsets for the third simplex corner\n\t\tint i3,j3,k3,l3; // The integer offsets for the fourth simplex corner\n\t\t// [rankx, ranky, rankz, rankw] is a 4-vector with the numbers 0, 1, 2 and 3\n\t\t// in some order. We use a thresholding to set the coordinates in turn.\n\t\t// Rank 3 denotes the largest coordinate.\n\t\ti1=rankx>=3?1:0;\n\t\tj1=ranky>=3?1:0;\n\t\tk1=rankz>=3?1:0;\n\t\tl1=rankw>=3?1:0;\n\t\t// Rank 2 denotes the second largest coordinate.\n\t\ti2=rankx>=2?1:0;\n\t\tj2=ranky>=2?1:0;\n\t\tk2=rankz>=2?1:0;\n\t\tl2=rankw>=2?1:0;\n\t\t// Rank 1 denotes the second smallest coordinate.\n\t\ti3=rankx>=1?1:0;\n\t\tj3=ranky>=1?1:0;\n\t\tk3=rankz>=1?1:0;\n\t\tl3=rankw>=1?1:0;\n\t\t// The fifth corner has all coordinate offsets = 1, so no need to compute that.\n\t\tdouble x1=x0-i1+G4; // Offsets for second corner in (x,y,z,w) coords\n\t\tdouble y1=y0-j1+G4;\n\t\tdouble z1=z0-k1+G4;\n\t\tdouble w1=w0-l1+G4;\n\t\tdouble x2=x0-i2+2.0*G4; // Offsets for third corner in (x,y,z,w) coords\n\t\tdouble y2=y0-j2+2.0*G4;\n\t\tdouble z2=z0-k2+2.0*G4;\n\t\tdouble w2=w0-l2+2.0*G4;\n\t\tdouble x3=x0-i3+3.0*G4; // Offsets for fourth corner in (x,y,z,w) coords\n\t\tdouble y3=y0-j3+3.0*G4;\n\t\tdouble z3=z0-k3+3.0*G4;\n\t\tdouble w3=w0-l3+3.0*G4;\n\t\tdouble x4=x0-1.0+4.0*G4; // Offsets for last corner in (x,y,z,w) coords\n\t\tdouble y4=y0-1.0+4.0*G4;\n\t\tdouble z4=z0-1.0+4.0*G4;\n\t\tdouble w4=w0-1.0+4.0*G4;\n\t\t// Work out the hashed gradient indices of the five simplex corners\n\t\tint ii=i&255;\n\t\tint jj=j&255;\n\t\tint kk=k&255;\n\t\tint ll=l&255;\n\t\tint gi0=perm[ii+perm[jj+perm[kk+perm[ll]]]]%32;\n\t\tint gi1=perm[ii+i1+perm[jj+j1+perm[kk+k1+perm[ll+l1]]]]%32;\n\t\tint gi2=perm[ii+i2+perm[jj+j2+perm[kk+k2+perm[ll+l2]]]]%32;\n\t\tint gi3=perm[ii+i3+perm[jj+j3+perm[kk+k3+perm[ll+l3]]]]%32;\n\t\tint gi4=perm[ii+1+perm[jj+1+perm[kk+1+perm[ll+1]]]]%32;\n\t\t// Calculate the contribution from the five corners\n\t\tdouble t0=0.6-x0*x0-y0*y0-z0*z0-w0*w0;\n\t\tif(t0<0) n0=0.0;\n\t\telse{\n\t\t\tt0*=t0;\n\t\t\tn0=t0*t0*dot(grad4[gi0], x0, y0, z0, w0);\n\t\t}\n\t\tdouble t1=0.6-x1*x1-y1*y1-z1*z1-w1*w1;\n\t\tif(t1<0) n1=0.0;\n\t\telse{\n\t\t\tt1*=t1;\n\t\t\tn1=t1*t1*dot(grad4[gi1], x1, y1, z1, w1);\n\t\t}\n\t\tdouble t2=0.6-x2*x2-y2*y2-z2*z2-w2*w2;\n\t\tif(t2<0) n2=0.0;\n\t\telse{\n\t\t\tt2*=t2;\n\t\t\tn2=t2*t2*dot(grad4[gi2], x2, y2, z2, w2);\n\t\t}\n\t\tdouble t3=0.6-x3*x3-y3*y3-z3*z3-w3*w3;\n\t\tif(t3<0) n3=0.0;\n\t\telse{\n\t\t\tt3*=t3;\n\t\t\tn3=t3*t3*dot(grad4[gi3], x3, y3, z3, w3);\n\t\t}\n\t\tdouble t4=0.6-x4*x4-y4*y4-z4*z4-w4*w4;\n\t\tif(t4<0) n4=0.0;\n\t\telse{\n\t\t\tt4*=t4;\n\t\t\tn4=t4*t4*dot(grad4[gi4], x4, y4, z4, w4);\n\t\t}\n\t\t// Sum up and scale the result to cover the range [-1,1]\n\t\treturn 27.0*(n0+n1+n2+n3+n4);\n\t}", "public int weight ();", "public void setWeights(float[] w) {\n _w1D = w;\n _weights = true;\n }", "public void trainWeights(int numEpochs, int player, int winner) {\n // Will be using the boardStates member which has already encoded the\n // boards on the path to the endgame.\n // The board states must now be fit to a reinforcement learning curve.\n double[][] trainingOutput = new double[stateCount][1]; // this is the total output (useful if using an ANN).\n double nn_i_succ = 0.0;\n double nn_i = 0.0;\n\n //REALLY IMPORTANT: Training is from the perspective of the black player, so if black lost, training will\n //use negative values. If black won, it will be trained with positive values. This must be kept in mind\n //when querying the features for values!\n\n //every other value depends on this one.\n for (int i=stateCount-1; i>=0; i--) {\n //for convenience get the value of the nn at boardStates[i] and boardStates[i+1]\n if (i == stateCount-1) {\n if (winner == LOABoard.PLAYER_BLACK)\n nn_i_succ = 1;\n else if (winner == LOABoard.PLAYER_WHITE)\n nn_i_succ = -1;\n else // Draw\n nn_i_succ = 0;\n } else {\n nn_i_succ = DISCOUNT_FACTOR * nn_i;\n }\n\n nn_i = 0;\n for ( int j = 0; j < numberOfWeights; j++ )\n nn_i += boardStates[i][j] * weights[j];\n\n trainingOutput[i][0] = nn_i + LEARNING_RATE*(nn_i_succ-nn_i);\n\n for (int j=0; j< numberOfWeights; j++) {//each epoch involves training on every board state in the game\n weights[j] = weights[j] + LEARNING_RATE*(nn_i_succ-nn_i)*boardStates[i][j];\n }//for j\n }//for i\n\n ////begin debug\n//\t System.out.println(\"Debug Message: Displaying array trainingOutput (after fit to TD learning curve) \" + stateCount);\n//\t for (int debug =0; debug < trainingOutput.length; debug++) {\n//\t\tSystem.out.println(trainingOutput[debug][0]);\n// }\n ////done debug\n\n System.out.println(\"Debug Message: Displaying weights array after update.\");\n for (int i = 0; i < numberOfWeights; i++) {\n System.out.println(weights[i]);\n }\n\n System.out.println(\"Info Message: Done training weights on results from game.\");\n }", "private void trainPerceptrons(){\n double activationValues[] = new double[4];\n for(Image image:asciiReader.getTrainingImages()){\n for (int j = 0 ; j < activationValues.length; j++){\n activationValues[j] = activationFunction\n .apply(sumWeights(j,image));\n }\n adjustWeights(activationValues,image);\n }\n }", "@Override\n\tpublic double getInternalWeight(int nodeIndex) {\n\t\treturn this.inWeights[nodeIndex];\n\t}", "public FeedForwardNeuralNetwork mutate(FeedForwardNeuralNetwork net)\n\t{\n // Copies the net\n FeedForwardNeuralNetwork newNetwork = new FeedForwardNeuralNetwork(net);\n newNetwork.setWeightVector((Vector<Double>)net.getWeightVector().clone());\n\n Vector<Double> newWeights = new Vector<Double>();\n\t\tRandom gen = new Random();\n int mc = gen.nextInt(100), slSize;\n\n if (mc <= 10) { // all the weights in the network\n for(SynapseLayer sl: newNetwork.synapse_layers) {\n slSize = sl.getWeightVector().size() / 20;\n for (Double weight: sl.getWeightVector())\n newWeights.add(weight + gen.nextGaussian()*Math.sqrt(slSize));\n }\n newNetwork.setWeightVector(newWeights);\n }\n else if (mc <= 37) { // all the weights in a randomly selected layer\n SynapseLayer sl = newNetwork.synapse_layers.get(gen.nextInt(newNetwork.synapse_layers.size()));\n for (Double weight: sl.getWeightVector())\n newWeights.add(weight + gen.nextGaussian() * Math.sqrt(sl.getWeightVector().size()/20));\n sl.setWeightVector(newWeights);\n }\n else if (mc <= 64) { // all the weights going into a randomly selecte layer, i can't tell the difference between this and the last one\n SynapseLayer sl = newNetwork.synapse_layers.get(gen.nextInt(newNetwork.synapse_layers.size()));\n for (Double weight: sl.getWeightVector())\n newWeights.add(weight + gen.nextGaussian() * Math.sqrt(sl.getWeightVector().size()/20));\n sl.setWeightVector(newWeights);\n }\n else {\n newWeights = newNetwork.getWeightVector();\n int rInd = gen.nextInt(newWeights.size());\n newWeights.set(rInd, newWeights.get(rInd) + Math.sqrt(gen.nextGaussian()*14));\n newNetwork.setWeightVector(newWeights);\n }\n\t\treturn newNetwork;\n\t}", "private double weight(){\n return ((double) (m_PositiveCount + m_NegativeCount)) / ((double) m_PositiveCount);\n }", "protected void findWeights( double learning_rate, int iterations )\n\t{\n\t\tdouble sum, error, o, delta;\n\t\tint n = this.class_data.attribute_data.size();\n\t\tAttribute temp;\n\n\t\tfor ( int i = 0; i < iterations; i++ )\n\t\t{\n\t\t\tsum = 0;\n\t\t\tfor ( int j = 0; j < this.attribute_list.size(); j++ )\n\t\t\t{\n\t\t\t\ttemp = this.attribute_list.get( j );\n\t\t\t\tsum += temp.attribute_data.get( i % n ) * temp.getWeigth();\t\t//Sum of wi * xi\n\t\t\t}\n\n\t\t\to = getSigmoidValue( sum );\t\t\t\t\t\t\t\t\t\t//Get the value from sigmoid function\n\t\t\terror = this.class_data.attribute_data.get( i % n ) - o;\t\t//Find out the error\n\t\t\tdelta = learning_rate * error * o * (1.0 - o);\t\t\t\t\t//Delta w\n\n\t\t\tfor ( int j = 0; j < this.attribute_list.size(); j++ )\n\t\t\t\tthis.attribute_list.get( j ).incrementWeigth( delta, i % n );\t\t//Update weights\n\t\t}\n\t}", "public int getNN() {\n\t\treturn NN;\n\t}", "public double getW() {\n\t\treturn w;\n\t}", "public void initWeights(){\r\n Random rand = new Random();\r\n double e = Math.sqrt(6.0/(wordSize*windowSize+hiddenSize));\r\n \r\n W = SimpleMatrix.random(hiddenSize, windowSize*wordSize, -e, e, rand);\r\n b1 = new SimpleMatrix(hiddenSize, 1);\r\n b1.zero();\r\n \r\n //U = SimpleMatrix.random(hiddenSize, 1, -0.1, 0.1, rand);\r\n U = new SimpleMatrix(hiddenSize, 1);\r\n U.zero();\r\n b2 = 0.0;\r\n \r\n C = C/(W.getNumElements()+U.getNumElements());\r\n \t}", "private double costOf(int w) {\n\t\treturn getVertex(w).getCost();\n\t}", "private double p_w_given_l(String word, Label label) {\n\t\t// TODO : Implement\n\t\t// Calculate the probability with Laplace smoothing for word in class(label)\n\t\tif(label.equals(Label.POSITIVE)) {\n\t\t\tdouble posCount = wordCount.get(Label.POSITIVE) + 0.0;\n\t\t\tif(!posWords.containsKey(word))\n\t\t\t\treturn 1.0/(v + posCount);\n\t\t\telse\n\t\t\t\treturn (1.0 + ((double)(posWords.get(word))))/(v + posCount);\n\t\t}\n\t\telse {\n\t\t\tdouble negCount = wordCount.get(Label.NEGATIVE) + 0.0;\n\t\t\tif(!negWords.containsKey(word))\n\t\t\t\treturn 1.0/(v + negCount);\n\t\t\telse\n\t\t\t\treturn (1.0 + ((double)(negWords.get(word))))/(v + negCount);\n\t\t}\n\t}", "private double newCost(int v, int w) {\n\t\treturn 0.0;\n\t}", "private static int numWaysDP(int N, ArrayList<Integer> x) {\n /* Base Cases */\n if (N == 0) {\n return 1;\n }\n\n int count;\n int[] counts = new int[N + 1];\n counts[0] = 1;\n for (int i = 1; i <= N; i++) {\n count = 0;\n for (int num : x) {\n if (i - num >= 0) {\n count += counts[i - num];\n }\n }\n counts[i] = count;\n }\n\n return counts[N];\n }", "double getWeight(int node) {\n\n return this.neighbors.get(node);\n }", "private void calculateNewWeights(double tmp) {\n // a) for output layer (linear) neuron\n if (layer == 0) {\n for (int j = 0; j < inputs; ++j) {\n changes[j] += tmp * network.getInput()[j];\n }\n }\n // b) if neuron belongs to one of hidden layers\n else {\n for (int j = 0; j < inputs; ++j) {\n changes[j] += tmp * network.getNeurons()[layer - 1][j].output;\n }\n }\n\n // additional calculation if const input is enabled\n if (enableConstAddend)\n changes[inputs] += tmp;\n }", "public void updateNetworkWeights(int particleIndex) {\n int x=0;\r\n double[] weights;\r\n // loops through all nodes in first hidden layer, setting weights (there is a weight associated with each input)\r\n for (int j=0; j<layers.get(0); j++) {\r\n weights = new double[numberOfInputs+1];\r\n for (int k=0; k<numberOfInputs+1; k++) {\r\n weights[k] = particles.get(particleIndex).coordinates.get(x);\r\n x++;\r\n }\r\n n.net.get(0).get(j).setWeights(weights);\r\n }\r\n // loops through all nodes in each subesquent layer, setting weights (there is a weight associated with each node from the layer below\r\n for (int i=1; i<layers.size(); i++) {\r\n for (int j=0; j<layers.get(i); j++) {\r\n weights = new double[layers.get(i-1)+1];\r\n for (int k=0; k<layers.get(i-1); k++) {\r\n weights[k] = particles.get(particleIndex).coordinates.get(x);\r\n x++;\r\n }\r\n n.net.get(i).get(j).setWeights(weights);\r\n }\r\n }\r\n \r\n }", "public double myPow(double x, int n) {\n if (n == 0) {\n \treturn 1;\n }\n if (n == 1) {\n \treturn x;\n }\n if (n == -1) {\n \treturn 1 / x;\n }\n double num = myPow(x, n / 2);\n return num * num * myPow(x, n % 2);\n }", "public void setNetworth(int value);", "public double getW() {\n return w;\n }", "@Override\n public void calculate(double[] x) {\n\n double prob = 0.0; // the log prob of the sequence given the model, which is the negation of value at this point\n Triple<double[][], double[][], double[][]> allParams = separateWeights(x);\n double[][] linearWeights = allParams.first();\n double[][] W = allParams.second(); // inputLayerWeights \n double[][] U = allParams.third(); // outputLayerWeights \n\n double[][] Y = null;\n if (flags.softmaxOutputLayer) {\n Y = new double[U.length][];\n for (int i = 0; i < U.length; i++) {\n Y[i] = ArrayMath.softmax(U[i]);\n }\n }\n\n double[][] What = emptyW();\n double[][] Uhat = emptyU();\n\n // the expectations over counts\n // first index is feature index, second index is of possible labeling\n double[][] E = empty2D();\n double[][] eW = emptyW();\n double[][] eU = emptyU();\n\n // iterate over all the documents\n for (int m = 0; m < data.length; m++) {\n int[][][] docData = data[m];\n int[] docLabels = labels[m];\n\n // make a clique tree for this document\n CRFCliqueTree cliqueTree = CRFCliqueTree.getCalibratedCliqueTree(docData, labelIndices, numClasses, classIndex,\n backgroundSymbol, new NonLinearCliquePotentialFunction(linearWeights, W, U, flags));\n\n // compute the log probability of the document given the model with the parameters x\n int[] given = new int[window - 1];\n Arrays.fill(given, classIndex.indexOf(backgroundSymbol));\n int[] windowLabels = new int[window];\n Arrays.fill(windowLabels, classIndex.indexOf(backgroundSymbol));\n\n if (docLabels.length>docData.length) { // only true for self-training\n // fill the given array with the extra docLabels\n System.arraycopy(docLabels, 0, given, 0, given.length);\n System.arraycopy(docLabels, 0, windowLabels, 0, windowLabels.length);\n // shift the docLabels array left\n int[] newDocLabels = new int[docData.length];\n System.arraycopy(docLabels, docLabels.length-newDocLabels.length, newDocLabels, 0, newDocLabels.length);\n docLabels = newDocLabels;\n }\n // iterate over the positions in this document\n for (int i = 0; i < docData.length; i++) {\n int label = docLabels[i];\n double p = cliqueTree.condLogProbGivenPrevious(i, label, given);\n if (VERBOSE) {\n System.err.println(\"P(\" + label + \"|\" + ArrayMath.toString(given) + \")=\" + p);\n }\n prob += p;\n System.arraycopy(given, 1, given, 0, given.length - 1);\n given[given.length - 1] = label;\n }\n\n // compute the expected counts for this document, which we will need to compute the derivative\n // iterate over the positions in this document\n for (int i = 0; i < docData.length; i++) {\n // for each possible clique at this position\n System.arraycopy(windowLabels, 1, windowLabels, 0, window - 1);\n windowLabels[window - 1] = docLabels[i];\n for (int j = 0; j < docData[i].length; j++) {\n Index<CRFLabel> labelIndex = labelIndices[j];\n // for each possible labeling for that clique\n int[] cliqueFeatures = docData[i][j];\n double[] As = null;\n double[] fDeriv = null;\n double[][] yTimesA = null;\n double[] sumOfYTimesA = null;\n\n if (j == 0) {\n As = NonLinearCliquePotentialFunction.hiddenLayerOutput(W, cliqueFeatures, flags);\n fDeriv = new double[inputLayerSize];\n double fD = 0;\n for (int q = 0; q < inputLayerSize; q++) {\n if (useSigmoid) {\n fD = As[q] * (1 - As[q]); \n } else {\n fD = 1 - As[q] * As[q]; \n }\n fDeriv[q] = fD;\n }\n\n // calculating yTimesA for softmax\n if (flags.softmaxOutputLayer) {\n double val = 0;\n\n yTimesA = new double[outputLayerSize][numHiddenUnits];\n for (int ii = 0; ii < outputLayerSize; ii++) {\n yTimesA[ii] = new double[numHiddenUnits];\n }\n sumOfYTimesA = new double[outputLayerSize];\n\n for (int k = 0; k < outputLayerSize; k++) {\n double[] Yk = null;\n if (flags.tieOutputLayer) {\n Yk = Y[0];\n } else {\n Yk = Y[k];\n }\n double sum = 0;\n for (int q = 0; q < inputLayerSize; q++) {\n if (q % outputLayerSize == k) {\n int hiddenUnitNo = q / outputLayerSize;\n val = As[q] * Yk[hiddenUnitNo];\n yTimesA[k][hiddenUnitNo] = val;\n sum += val;\n }\n }\n sumOfYTimesA[k] = sum;\n }\n }\n\n // calculating Uhat What\n int[] cliqueLabel = new int[j + 1];\n System.arraycopy(windowLabels, window - 1 - j, cliqueLabel, 0, j + 1);\n\n CRFLabel crfLabel = new CRFLabel(cliqueLabel);\n int givenLabelIndex = labelIndex.indexOf(crfLabel);\n double[] Uk = null;\n double[] UhatK = null;\n double[] Yk = null;\n double[] yTimesAK = null;\n double sumOfYTimesAK = 0;\n if (flags.tieOutputLayer) {\n Uk = U[0];\n UhatK = Uhat[0];\n if (flags.softmaxOutputLayer) {\n Yk = Y[0];\n }\n } else {\n Uk = U[givenLabelIndex];\n UhatK = Uhat[givenLabelIndex];\n if (flags.softmaxOutputLayer) {\n Yk = Y[givenLabelIndex];\n }\n }\n\n if (flags.softmaxOutputLayer) {\n yTimesAK = yTimesA[givenLabelIndex];\n sumOfYTimesAK = sumOfYTimesA[givenLabelIndex];\n }\n\n for (int k = 0; k < inputLayerSize; k++) {\n double deltaK = 1;\n if (flags.sparseOutputLayer || flags.tieOutputLayer) {\n if (k % outputLayerSize == givenLabelIndex) {\n int hiddenUnitNo = k / outputLayerSize;\n if (flags.softmaxOutputLayer) {\n UhatK[hiddenUnitNo] += (yTimesAK[hiddenUnitNo] - Yk[hiddenUnitNo] * sumOfYTimesAK);\n deltaK *= Yk[hiddenUnitNo];\n } else {\n UhatK[hiddenUnitNo] += As[k];\n deltaK *= Uk[hiddenUnitNo];\n }\n }\n } else {\n UhatK[k] += As[k];\n if (useOutputLayer) {\n deltaK *= Uk[k];\n }\n }\n if (useHiddenLayer)\n deltaK *= fDeriv[k];\n if (useOutputLayer) {\n if (flags.sparseOutputLayer || flags.tieOutputLayer) {\n if (k % outputLayerSize == givenLabelIndex) {\n double[] WhatK = What[k];\n for (int n = 0; n < cliqueFeatures.length; n++) {\n WhatK[cliqueFeatures[n]] += deltaK;\n }\n }\n } else {\n double[] WhatK = What[k];\n for (int n = 0; n < cliqueFeatures.length; n++) {\n WhatK[cliqueFeatures[n]] += deltaK;\n }\n }\n } else {\n if (k == givenLabelIndex) {\n double[] WhatK = What[k];\n for (int n = 0; n < cliqueFeatures.length; n++) {\n WhatK[cliqueFeatures[n]] += deltaK;\n }\n }\n }\n }\n }\n\n for (int k = 0; k < labelIndex.size(); k++) { // labelIndex.size() == numClasses\n int[] label = labelIndex.get(k).getLabel();\n double p = cliqueTree.prob(i, label); // probability of these labels occurring in this clique with these features\n if (j == 0) { // for node features\n double[] Uk = null;\n double[] eUK = null;\n double[] Yk = null;\n if (flags.tieOutputLayer) {\n Uk = U[0];\n eUK = eU[0];\n if (flags.softmaxOutputLayer) {\n Yk = Y[0];\n }\n } else {\n Uk = U[k];\n eUK = eU[k];\n if (flags.softmaxOutputLayer) {\n Yk = Y[k];\n }\n }\n if (useOutputLayer) {\n for (int q = 0; q < inputLayerSize; q++) {\n double deltaQ = 1;\n if (flags.sparseOutputLayer || flags.tieOutputLayer) {\n if (q % outputLayerSize == k) {\n int hiddenUnitNo = q / outputLayerSize;\n if (flags.softmaxOutputLayer) {\n eUK[hiddenUnitNo] += (yTimesA[k][hiddenUnitNo] - Yk[hiddenUnitNo] * sumOfYTimesA[k]) * p;\n deltaQ = Yk[hiddenUnitNo];\n } else {\n eUK[hiddenUnitNo] += As[q] * p;\n deltaQ = Uk[hiddenUnitNo];\n }\n }\n } else {\n eUK[q] += As[q] * p;\n deltaQ = Uk[q];\n }\n if (useHiddenLayer)\n deltaQ *= fDeriv[q];\n if (flags.sparseOutputLayer || flags.tieOutputLayer) {\n if (q % outputLayerSize == k) {\n double[] eWq = eW[q];\n for (int n = 0; n < cliqueFeatures.length; n++) {\n eWq[cliqueFeatures[n]] += deltaQ * p;\n }\n }\n } else {\n double[] eWq = eW[q];\n for (int n = 0; n < cliqueFeatures.length; n++) {\n eWq[cliqueFeatures[n]] += deltaQ * p;\n }\n }\n }\n } else {\n double deltaK = 1;\n if (useHiddenLayer)\n deltaK *= fDeriv[k];\n double[] eWK = eW[k];\n for (int n = 0; n < cliqueFeatures.length; n++) {\n eWK[cliqueFeatures[n]] += deltaK * p;\n }\n }\n } else { // for edge features\n for (int n = 0; n < cliqueFeatures.length; n++) {\n E[cliqueFeatures[n]][k] += p;\n }\n }\n }\n }\n }\n }\n\n if (Double.isNaN(prob)) { // shouldn't be the case\n throw new RuntimeException(\"Got NaN for prob in CRFNonLinearLogConditionalObjectiveFunction.calculate()\");\n }\n\n value = -prob;\n if(VERBOSE){\n System.err.println(\"value is \" + value);\n }\n\n // compute the partial derivative for each feature by comparing expected counts to empirical counts\n int index = 0;\n for (int i = 0; i < E.length; i++) {\n int originalIndex = edgeFeatureIndicesMap.get(i);\n\n for (int j = 0; j < E[i].length; j++) {\n derivative[index++] = (E[i][j] - Ehat[i][j]);\n if (VERBOSE) {\n System.err.println(\"linearWeights deriv(\" + i + \",\" + j + \") = \" + E[i][j] + \" - \" + Ehat[i][j] + \" = \" + derivative[index - 1]);\n }\n }\n }\n if (index != edgeParamCount)\n throw new RuntimeException(\"after edge derivative, index(\"+index+\") != edgeParamCount(\"+edgeParamCount+\")\");\n\n for (int i = 0; i < eW.length; i++) {\n for (int j = 0; j < eW[i].length; j++) {\n derivative[index++] = (eW[i][j] - What[i][j]);\n if (VERBOSE) {\n System.err.println(\"inputLayerWeights deriv(\" + i + \",\" + j + \") = \" + eW[i][j] + \" - \" + What[i][j] + \" = \" + derivative[index - 1]);\n }\n }\n }\n\n\n if (index != beforeOutputWeights)\n throw new RuntimeException(\"after W derivative, index(\"+index+\") != beforeOutputWeights(\"+beforeOutputWeights+\")\");\n\n if (useOutputLayer) {\n for (int i = 0; i < eU.length; i++) {\n for (int j = 0; j < eU[i].length; j++) {\n derivative[index++] = (eU[i][j] - Uhat[i][j]);\n if (VERBOSE) {\n System.err.println(\"outputLayerWeights deriv(\" + i + \",\" + j + \") = \" + eU[i][j] + \" - \" + Uhat[i][j] + \" = \" + derivative[index - 1]);\n }\n }\n }\n }\n\n if (index != x.length)\n throw new RuntimeException(\"after W derivative, index(\"+index+\") != x.length(\"+x.length+\")\");\n\n int regSize = x.length;\n if (flags.skipOutputRegularization || flags.softmaxOutputLayer) {\n regSize = beforeOutputWeights;\n }\n\n // incorporate priors\n if (prior == QUADRATIC_PRIOR) {\n double sigmaSq = sigma * sigma;\n for (int i = 0; i < regSize; i++) {\n double k = 1.0;\n double w = x[i];\n value += k * w * w / 2.0 / sigmaSq;\n derivative[i] += k * w / sigmaSq;\n }\n } else if (prior == HUBER_PRIOR) {\n double sigmaSq = sigma * sigma;\n for (int i = 0; i < regSize; i++) {\n double w = x[i];\n double wabs = Math.abs(w);\n if (wabs < epsilon) {\n value += w * w / 2.0 / epsilon / sigmaSq;\n derivative[i] += w / epsilon / sigmaSq;\n } else {\n value += (wabs - epsilon / 2) / sigmaSq;\n derivative[i] += ((w < 0.0) ? -1.0 : 1.0) / sigmaSq;\n }\n }\n } else if (prior == QUARTIC_PRIOR) {\n double sigmaQu = sigma * sigma * sigma * sigma;\n for (int i = 0; i < regSize; i++) {\n double k = 1.0;\n double w = x[i];\n value += k * w * w * w * w / 2.0 / sigmaQu;\n derivative[i] += k * w / sigmaQu;\n }\n }\n }", "public void FeedForward() {\r\n\t\tfor (int i = 0; i < Node.length; i++) {\r\n\t\t\tNet = Node[i].Threshold;\r\n\r\n\t\t\tfor (int j = 0; j < Node[i].Weight.length; j++)\r\n\t\t\t\tNet = Net + Input[j] * Node[i].Weight[j];\r\n\r\n\t\t\tNode[i].Output = Sigmoid(Net);\r\n\t\t}\r\n\t}", "public static double xavier_weight(double n_in) {\n return (2*(rand.nextDouble()-1)) * 2/Math.sqrt(n_in);\n }", "public Solution(int[] w) {\n // get a Random instance\n random = new Random();\n\n // fulfill weightPrefixSum array\n int len = w.length;\n weightPrefixSum = new int[len];\n weightPrefixSum[0] = w[0];\n for(int i = 1; i < w.length; i++){\n weightPrefixSum[i] = weightPrefixSum[i-1] + w[i];\n }\n }", "private static int solve(int[] wt, int[] val, int n, int w) {\n int[][] dp = new int[n+1][w + 1];\n\n for (int i = 1; i <= n; ++i) {\n for (int j = 1; j <= w; ++j) {\n if (wt[i-1] <= j) dp[i][j] = Math.max(dp[i-1][j] , val[i-1]+dp[i-1][j-wt[i-1]]);\n else dp[i][j] = dp[i-1][j];\n }\n }\n return dp[n][w];\n }", "public ArrayList<ArrayList<Tensor<?>>> getWeights() {\n ArrayList<Tensor<?>> w1 = (ArrayList<Tensor<?>>) sess.runner().fetch(\"Variable:0\").run();\n ArrayList<Tensor<?>> b1 = (ArrayList<Tensor<?>>) sess.runner().fetch(\"Variable_1:0\").run();\n ArrayList<Tensor<?>> w2 = (ArrayList<Tensor<?>>) sess.runner().fetch(\"Variable_2:0\").run();\n ArrayList<Tensor<?>> b2 = (ArrayList<Tensor<?>>) sess.runner().fetch(\"Variable_3:0\").run();\n ArrayList<ArrayList<Tensor<?>>> ls = new ArrayList<>();\n ls.add(w1);\n ls.add(b1);\n ls.add(w2);\n ls.add(b2);\n return ls;\n }", "public static void findWeights(int number){\n double[] array=new double[number];\n for (int i=0;i<number;i++){\n double sum=0;\n for (int j=0;j<number;j++){\n sum+=normalA[i][j];\n }\n df.setRoundingMode(RoundingMode.HALF_UP);\n array[i]= Double.valueOf(df.format(sum/number));\n }\n weights=array.clone();\n System.out.println(\"max weights for each objective: \\n\"+Arrays.toString(array));\n System.out.println();\n }", "public String revealRelationshipsInW() {\n\t\tString w = \"\";\n\t\tif (this.numWVertices > 0) {\n\t\t\tfor (int i = 0; i < this.numWVertices; i++) {\n\t\t\t\t// find w_i and print it with all its neighbors\n\t\t\t\tw += \"w\" + i + \": \" + this.vertices.get(i).getWNeighbors() + \"\\n\";\n\t\t\t}\n\t\t}\n\t\treturn \"Expected Relationships between targeted vertices (W): \\n\" + w;\n\t}", "public void initWeights(){\n setNextLayer(network.getNextLayer(layerNumber));\n //determine the number of neurons in the next layer\n int neuronNextLayer = next.neuronCount;\n //create arrays for backpopagation learning\n createArr();\n //set the weightThreshold\n weightThreshold = new double[neuronCount+1][neuronNextLayer];\n //System.out.println(\"weightThreshold row:\"+weightThreshold.length+\" col:\"+weightThreshold[0].length);\n //randomize all the elements. range is between -.5 and .5\n for(int i=0; i<weightThreshold.length; i++){\n for(int j=0; j<weightThreshold[i].length; j++){\n weightThreshold[i][j] = getRandomNumber();\n }\n }\n }", "private static int numWays(int N, ArrayList<Integer> x) {\n /* Base Cases */\n if (N == 0) {\n return 1;\n }\n int count = 0;\n\n for (int num : x) {\n if (N - num >= 0) {\n count += numWays(N-num, x);\n }\n }\n\n return count;\n }", "private double sumWeights(int index, Image image){\n double sum = 0;\n for(int i= 0; i<400 ; i++){\n sum+=perceptrons.get(i).getWeight(index)\n *normalizeImageValue(image.getImage()[i]);\n }\n return sum;\n }", "private int createWEdges() {\n\t\tint scaler = 5; // Adjusts the number of edges in W\n\t\tint count = 0;\n\t\tfor (int i = 0; i < this.numWVertices; i++) {\n\t\t\tfor (int j = 0; j < this.randomGen(scaler); j++) {\n\t\t\t\tint neighbor = this.randomGen(this.numWVertices - 1);\n\t\t\t\tif (i != neighbor) {\n\t\t\t\t\tthis.vertices.get(i).addNeighbor(this.vertices.get(neighbor));\n\t\t\t\t\tthis.vertices.get(neighbor).addNeighbor(this.vertices.get(i));\n\t\t\t\t\tcount++;\n\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn count;\n\t}", "public float tune( float v, float x ) {\n\t\tfloat w = (float)(v+x*1.2f);\n\t\tif ( w<0 ) w = 0;\n\t\tif ( w>1 ) w = 1;\n\t\treturn w;\n\t}", "public double netForce() {\n\t\treturn this.findBotPressure() * Controller.window.width * findSurfaceArea(xs.length / 2, xs.length - 1)\n\t\t\t\t- this.findTopPressure() * Controller.window.width * findSurfaceArea(1, xs.length / 2);\n\t}", "public static void perceptronB(List<double[]> wektoryTrenujace,\n double[] w, double[] d, double c){\n\n double[] result = new double[4];\n double[] sumOfWec = new double[4];\n boolean repeat;\n\n //y1\n int iteracje = 0;\n do {\n Arrays.fill(sumOfWec, 0.0);\n repeat = false;\n iteracje++;\n System.out.println(\"Iteracja: \" + iteracje);\n for (int i=0; i< wektoryTrenujace.size();i++){\n result[i] = vectorSign(sigmFunc(matrixMult(wektoryTrenujace.get(i),w)),d[i]);\n sumOfWec = matrixAdd(sumOfWec, matrixMult(result[i],wektoryTrenujace.get(i)));\n if (result[i] != 0){\n System.out.println(\"Wektor trenujacy x\" + (i+1) + \" zostal zle rozpoznany przez wage \" + Print(w));\n repeat = true;\n }\n\n }\n w = matrixAdd(w,matrixMult(c,sumOfWec));\n System.out.println(\"Nowa waga: \" + Print(w) + \"\\n\");\n if (iteracje> 40)\n {\n System.out.println(\"Wagi nie stabilizują się po 40 iteracjach.\");\n return;\n }\n } while (repeat);\n\n System.out.println(\"Wagi ustabilizowaly sie po \" + iteracje + \" iteracji/ach.\\nWaga wynosi \" + Print(w));\n\n\n\n }", "public String revealAllRelationshipsInW() {\n\t\tString w = \"\";\n\t\tif (this.numWVertices > 0) {\n\t\t\tfor (int i = 0; i < this.numWVertices; i++) {\n\t\t\t\t// find w_i and print it with all its neighbors\n\t\t\t\tw += \"w\" + i + \": \" + this.vertices.get(i).getNeighbors() + \"\\n\";\n\t\t\t}\n\t\t}\n\t\treturn w;\n\t}", "void calculateWeights(List<Neuron> connectedNeurons) {\n // neuron_k:weight = neuron_k:weight - this:LearningRate * neuron_k:error * this:output\n Iterator<Neuron> iter = connectedNeurons.iterator();\n while(iter.hasNext()) {\n Neuron neuron = iter.next();\n try{\n double currentWeight = neuron.inputWeights.get(this.neuronName);\n double neuronError = neuron.error;\n double newWeight = currentWeight - LEARNING_RATE*neuronError*this.getOutput(); // !!! equation difference\n \n System.out.println(\"this neuronName: \" + this.neuronName + \" that neuron keys: \" + neuron.inputWeights);\n System.out.println(\"Old weight: \" + currentWeight + \" new weight: \" + newWeight);\n \n neuron.inputWeights.put(this.getName(), newWeight);\n }catch (Exception e) {\n System.out.println(this.neuronName + \" : \" + neuron.inputWeights);\n e.printStackTrace();\n System.exit(1);\n }\n }\n }", "private void adjustWeights(double activationValues[],Image image){\n\n for(int i=0;i<perceptrons.size();i++){\n for(int j=0;j<4;j++) {\n if ((j + 1) == image.getEmotion()) {\n perceptrons.get(i).adjustWeight(j, learningValue\n , 1, activationValues[j]\n ,normalizeImageValue(image.getImage()[i]));\n } else {\n perceptrons.get(i).adjustWeight(j, learningValue\n , 0, activationValues[j]\n ,normalizeImageValue(image.getImage()[i]));\n }\n }\n }\n\n }", "float getW();", "private static double lnInternal(double x){\n double a = 1 - x;\n double s = -a;\n double t = a;\n \n for (int i = 2; i < 25; i++){\n t = t*a;\n s -= t/i;\n }\n return s;\n }", "public double feedForward(List<Integer> context, Integer nextWord){\n\t\t// TODO: implement the feedforward activation process\n\t\treturn -10000.0;\n\t}", "public double eval(double[] x) {\n\t\tdouble z = VectorOps.dot(this.weights, x); \t\t// z is still w dot x\n\t\tdouble log = 1.0 / (1.0 + Math.exp(-1 * z) ); \t// 1 / (1 + e^-z)\n\n\t\treturn log;\n\t\t\n\t}", "private double[][] emptyW() {\n double[][] temp = new double[inputLayerSize][numNodeFeatures];\n for (int i = 0; i < inputLayerSize; i++) {\n temp[i] = new double[numNodeFeatures];\n }\n return temp;\n }", "public double myPow(double x, int n) {\n // write your code here\n boolean neg = false;\n if (n < 0) {\n x = 1 / x;\n n = - (n + 1);\n neg = true;\n }\n\n double ans = 1, base = x;\n while (n > 0) {\n if (n % 2 == 1) {\n ans *= base;\n }\n base *= base;\n n /= 2;\n }\n\n if (neg) ans *= x;\n return ans;\n }", "private double getUnitWidth(int index)\n {\n return _weights.get(index) / _totalWeight;\n }", "private boolean classify(FeatureVector<? extends Number> wd) {\n\t\tfloat sum = 0;\n\t\t// Scalar Product\n\t\tfor (int i = 0; i < this.getDimensionality(); ++i) {\n\t\t\t// TODO check the type of the vector\n\t\t\tsum += wd.getValue(i).doubleValue()\n\t\t\t\t\t* this.getValue(i).doubleValue();\n\t\t}\n\n\t\t// sign binary function\n\t\tif (sum <= 0) {\n\t\t\treturn false;\n\t\t} else {\n\t\t\treturn true;\n\t\t}\n\t}", "public void setWeights(float[][] w) {\n _w2D = w;\n _weights = true;\n }", "private boolean feasible() {\n\t\tint weight = 0;\n\t\tfor (int i = 0; i < n; i++) {\n\t\t\tassert x[i] == 0 || x[i] == 1;\n\t\t\tweight += w[i] * x[i];\n\t\t}\n\t\treturn weight <= k;\n\t}", "public void train()\r\n\t{\r\n\t\tfor(int i=0; i < this.maxEpoch; i++)\r\n\t\t{\r\n\t\t\tfor(Instance temp_example: this.trainingSet)\r\n\t\t\t{\r\n\t\t\t\tdouble O = calculateOutputForInstance(temp_example);\r\n\t\t\t\tdouble T = temp_example.output;\r\n\t\t\t\tdouble err = T - O;\r\n\r\n\t\t\t\t//w_jk (hidden to output)\r\n\t\t\t\tdouble g_p_out = (outputNode.getSum() <= 0) ? 0 : 1;\r\n\t\t\t\tfor(NodeWeightPair hiddenNode: outputNode.parents)\r\n\t\t\t\t{\r\n\t\t\t\t\thiddenNode.set_deltaw_pq(this.learningRate*\r\n\t\t\t\t\t\t\thiddenNode.node.getOutput()*err*g_p_out);\r\n\t\t\t\t}\r\n\r\n\t\t\t\t//w_ij (input to hidden)\r\n\t\t\t\tint hid_count =0;\r\n\t\t\t\tfor(Node hiddenNode: hiddenNodes){\r\n\t\t\t\t\tdouble g_p_hid = (hiddenNode.getSum() <= 0) ? 0 : 1;\r\n\t\t\t\t\tif(hiddenNode.getType()==2)\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tfor(NodeWeightPair inputNode: hiddenNode.parents){\r\n\t\t\t\t\t\t\tdouble a_i = inputNode.node.getOutput();\r\n\t\t\t\t\t\t\tinputNode.set_deltaw_pq\r\n\t\t\t\t\t\t\t(\r\n\t\t\t\t\t\t\t\t\tthis.learningRate*\r\n\t\t\t\t\t\t\t\t\ta_i*g_p_hid*(err*\r\n\t\t\t\t\t\t\t\t\toutputNode.parents.get(hid_count).weight*\r\n\t\t\t\t\t\t\t\t\tg_p_out)\r\n\t\t\t\t\t\t\t\t\t);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t}\r\n\t\t\t\t\thid_count++;\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\t// for all w_pq, update weights\r\n\t\t\t\tfor(Node hiddenNode: hiddenNodes){\r\n\t\t\t\t\tif(hiddenNode.getType()==2){\r\n\t\t\t\t\t\tfor(NodeWeightPair inputNode: hiddenNode.parents){\r\n\t\t\t\t\t\t\tinputNode.weight += inputNode.get_deltaw_pq();\r\n\t\t\t\t\t\t\tinputNode.set_deltaw_pq(new Double (0.00));\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\tfor(NodeWeightPair hiddenNode: outputNode.parents)\r\n\t\t\t\t{\r\n\t\t\t\t\thiddenNode.weight += hiddenNode.get_deltaw_pq();\r\n\t\t\t\t\thiddenNode.set_deltaw_pq(new Double (0.00));\r\n\t\t\t\t}\r\n\r\n\t\t\t} // end of an instance \r\n\t\t} // end of an epoch\r\n\t}", "@Override\n public Tensor apply(Integer t) {\n Tensor weights = halfWindowSampler.apply(t);\n Tensor chronological = Range.of(0, weights.length());\n Scalar distance = RealScalar.of(weights.length() - 1).subtract(weights.dot(chronological));\n Tensor extrapolatory = weights.extract(0, weights.length() - 1).negate();\n extrapolatory.append(RealScalar.ONE.subtract(Last.of(weights)).add(distance));\n return extrapolatory.divide(distance).unmodifiable();\n }", "List<Integer> getNeighbors(int x);", "private static final int adjustment(int x, int xn) \n\t {\n\t int xn2 = xn * xn;\n\t \n\t // |xn * xn - x|\n\t int comparitor0 = xn2 - x;\n\t if (comparitor0 < 0) {\n\t comparitor0 = -comparitor0;\n\t }\n\t \n\t int twice_xn = xn << 1;\n\t \n\t // |x - (xn-1) * (xn-1)|\n\t int comparitor1 = x - xn2 + twice_xn - 1;\n\t if (comparitor1 < 0) { // need to correct for x == 0 case?\n\t comparitor1 = -comparitor1; // only gets here when x == 0\n\t }\n\t \n\t // |(xn+1) * (xn+1) - x|\n\t int comparitor2 = xn2 + twice_xn + 1 - x;\n\t \n\t if (comparitor0 > comparitor1) {\n\t return (comparitor1 > comparitor2) ? ++xn : --xn;\n\t }\n\t \n\t return (comparitor0 > comparitor2) ? ++xn : xn;\n\t }", "public void updateWeights() {\n\t\t\n\t}", "public void updateNeighbors(Neuron BMU, ArrayList<Double> input, int t) {\n double radiusMap = this.width / 2;\n double lambda = this.nbIterations / radiusMap;\n\n // Calculation of the radius of influence.\n double radius = radiusMap * Math.exp(-t / lambda);\n\n int iMin = (BMU.getY() - radius) < 0 ? 0 : (int) (BMU.getY() - radius);\n int iMax = (BMU.getY() + radius) > this.width ? this.width : (int) (BMU.getY() + radius);\n int jMin = (BMU.getX() - radius) < 0 ? 0 : (int) (BMU.getX() - radius);\n int jMax = (BMU.getX() + radius) > this.width ? this.width : (int) (BMU.getX() + radius);\n\n // Set the new weights of neurons in proximity\n for (int i = iMin; i < iMax; i++) {\n for (int j = jMin; j < jMax; j++) {\n // Run over weights\n Neuron n = this.network[i][j];\n double Lt = this.learningRate * Math.exp(-t / lambda);\n\n double sumDist = this.euclideDistance(BMU.getWeights(), n.getWeights());\n\n double delta = sumDist / (2 * radius * radius);\n //double theta = Math.exp(-1 * (sumDist / (2 * Math.pow(radius, 2))));\n double theta = Math.exp(-delta);\n\n for (int k = 0; k < BMU.getSizeWeights(); k++) {\n\n double value = n.getWeightI(k) + theta * Lt * (input.get(k) - n.getWeightI(k));\n\n n.setWeightI(k, value);\n if (value > 1.0)\n System.out.println(\"error\");\n }\n }\n }\n }", "private static int[] square(int[] w, int[] x)\n {\n // Note: this method allows w to be only (2 * x.Length - 1) words if result will fit\n// if (w.length != 2 * x.length)\n// {\n// throw new IllegalArgumentException(\"no I don't think so...\");\n// }\n\n long c;\n\n int wBase = w.length - 1;\n\n for (int i = x.length - 1; i != 0; --i)\n {\n long v = x[i] & IMASK;\n\n c = v * v + (w[wBase] & IMASK);\n w[wBase] = (int)c;\n c >>>= 32;\n\n for (int j = i - 1; j >= 0; --j)\n {\n long prod = v * (x[j] & IMASK);\n\n c += (w[--wBase] & IMASK) + ((prod << 1) & IMASK);\n w[wBase] = (int)c;\n c = (c >>> 32) + (prod >>> 31);\n }\n\n c += w[--wBase] & IMASK;\n w[wBase] = (int)c;\n\n if (--wBase >= 0)\n {\n w[wBase] = (int)(c >> 32);\n }\n wBase += i;\n }\n\n c = x[0] & IMASK;\n\n c = c * c + (w[wBase] & IMASK);\n w[wBase] = (int)c;\n\n if (--wBase >= 0)\n {\n w[wBase] += (int)(c >> 32);\n }\n\n return w;\n }", "double getWeight(V v, V w);", "public int knapSackDP(int wt[], int val[], int mw) {\n // init DP\n int[][] dp = new int[wt.length + 1][mw + 1];\n\n // base conditions\n // set all rows for n=0 and w=0 to 0\n\n // Loop\n for (int n = 1; n < dp.length; n++) {\n for (int w = 1; w < dp[0].length; w++) {\n if (wt[n - 1] > w)\n dp[n][w] = dp[n - 1][w];\n else\n dp[n][w] = Math.max(val[n - 1] + dp[n - 1][w - wt[n - 1]], dp[n - 1][w]);\n }\n }\n return dp[dp.length - 1][dp[0].length - 1];\n }", "public int[] getNeighborsWeights(){\n\t\tint[] weights = new int[4];\n\t\tweights[0] = getNeighbor(\"east\").weight;\n\t\tweights[1] = getNeighbor(\"north\").weight;\n\t\tweights[2] = getNeighbor(\"west\").weight;\n\t\tweights[3] = getNeighbor(\"south\").weight;\t\t\n\t\treturn weights;\n\t}", "@java.lang.Override\n public float getW() {\n return w_;\n }", "static int webknapSackRecur(int W, int wt[], int val[], int n) {\n // Base Case\n if (n == 0 || W == 0)\n return 0;\n\n // wt[i] represents the weight of the ith item\n // If weight of the nth item is more than Knapsack capacity W, then\n // this item cannot be included in the optimal solution\n if (wt[n - 1] > W)\n return webknapSackRecur(W, wt, val, n - 1);\n\n // Return the maximum of two cases:\n // (1) nth item included\n // (2) not included\n else return max(val[n - 1] + webknapSackRecur(W - wt[n - 1], wt, val, n - 1),\n webknapSackRecur(W, wt, val, n - 1)\n );\n }", "public void setWeight(int w) {\n\t\tweight = w;\n\t}", "@java.lang.Override\n public float getW() {\n return w_;\n }", "public double myPowIter(double x, int n) {\n\t\tif (n == 0)\n\t\t\treturn 1;\n\n\t\tif (n < 0) {\n\t\t\tn = -n;\n\t\t\tx = 1 / x;\n\t\t}\n\t\tdouble ans = 1;\n\t\twhile (n > 0) {\n\t\t\tif ((n & 1) == 1)\n\t\t\t\tans *= x;\n\t\t\tx *= x;\n\t\t\tn >>= 1;\n\t\t}\n\t\treturn ans;\n\t}", "int getNNZ(){\n return this.nnz;\n }", "public void setWeight(double w){\n weight = w;\n }", "@Override\n\tpublic void updateWw4RNNLayer(ProjectionLayer layer) {\n\t\t\n\t}", "public void setWeight(int w){\n\t\tweight = w;\n\t}", "public double getWeight() {\n \treturn this.trainWeight;\n }", "private double getWidthUntil(int index)\n {\n double weightsSum = 0;\n\n for (int i = 0; i < index; i++)\n {\n weightsSum += _weights.get(i);\n }\n\n return weightsSum / _totalWeight;\n }", "public void setWeight(float w) {\n weight = w;\n }", "public static String stemNSW(String word)\n\t{\n\t\treturn isNSW(getRoot(word.toLowerCase()));\n\t}", "public void setBoxWeights(float boxVal, int itmin, int itmax, int ixmin, int ixmax, \n int ntf, int nx) {\n float[][] w = zerofloat(ntf,nx);\n for (int ix = ixmin; ix<=ixmax; ++ix) {\n for (int it=itmin; it<=itmax; ++it) { \n w[ix][it] = boxVal;\n }\n }\n _w2D = w;\n _weights = true;\n }", "private int rs(final int x) {\n assert(! leaf(x));\n return Math.min(2*x+2, n);\n }", "private void trainPerceptron() {\n\t\t// Creates a log of that contains the percentage each epoch got correct\n\t\tint numWrong = images.size();\n\t\tint numReps = 0;\n\n\t\t// Repeat the training process TIMES_TO_REPEAT number of times or until\n\t\t// there are none wrong\n\t\tfor (int repetition = 0; repetition < TIMES_TO_REPEAT && numWrong != 0; repetition++) {\n\t\t\tint numCorrect = 0;\n\n\t\t\t// Iterate through each image in the set of image\n\t\t\tfor (PerceptronImage image : images) {\n\t\t\t\tdouble netInput = 0;\n\n\t\t\t\t// Work out the net input by evaluating each feature on the\n\t\t\t\t// image\n\t\t\t\tfor (Feature feature : features) {\n\t\t\t\t\tnetInput += feature.evaluate(image) * feature.getWeight();\n\t\t\t\t}\n\n\t\t\t\t// If the image is evaluated to be an X\n\t\t\t\tif (netInput <= 0) {\n\t\t\t\t\t// If it actually is an X then record it\n\t\t\t\t\tif (image.isX()) {\n\t\t\t\t\t\tnumCorrect++;\n\t\t\t\t\t} else {\n\t\t\t\t\t\t// If it is not then re-weight features\n\t\t\t\t\t\tfor (Feature feature : features) {\n\t\t\t\t\t\t\tdouble newWeight = feature.getWeight()\n\t\t\t\t\t\t\t\t\t+ feature.evaluate(image) * learningRate;\n\t\t\t\t\t\t\tfeature.setWeight(newWeight);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\t// If the image is evaluated to be not an X\n\t\t\t\t\t// If it actually not an X then record it\n\t\t\t\t\tif (!image.isX()) {\n\t\t\t\t\t\tnumCorrect++;\n\t\t\t\t\t} else {\n\t\t\t\t\t\t// If it is not then re-weight features\n\t\t\t\t\t\tfor (Feature feature : features) {\n\t\t\t\t\t\t\tdouble newWeight = feature.getWeight()\n\t\t\t\t\t\t\t\t\t- feature.evaluate(image) * learningRate;\n\t\t\t\t\t\t\tfeature.setWeight(newWeight);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Update the number of images wrong for this epoch\n\t\t\tnumWrong = images.size() - numCorrect;\n\n\t\t\t// Modify the learning rate\n\t\t\tif (learningRate > LEARNING_RATE_MINIMUM) {\n\t\t\t\tlearningRate *= LEARNING_RATE_MODIFIER;\n\t\t\t}\n\n\t\t\tnumReps++;\n\t\t}\n\n\t\ttry {\n\t\t\tPrintWriter writer = new PrintWriter(\"output.txt\");\n\t\t\t\n\t\t\t// Print out the number of repetitions if the perceptron converged,\n\t\t\t// otherwise print out the number of images that are still classified\n\t\t\t// incorrectly\n\t\t\tif (numWrong == 0) {\n\t\t\t\twriter.println(\"Perceptron converged\");\n\t\t\t\twriter.println(\"Number of repetitions: \" + numReps);\n\t\t\t\tSystem.out.println(\"Perceptron converged\");\n\t\t\t\tSystem.out.println(\"Number of repetitions: \" + numReps);\n\t\t\t} else {\n\t\t\t\twriter.println(\"Perceptron did not converge\");\n\t\t\t\twriter.println(\"Number of images still incorrect: \" + numWrong);\n\t\t\t\tSystem.out.println(\"Perceptron did not converge\");\n\t\t\t\tSystem.out.println(\"Number of images still incorrect: \" + numWrong);\n\t\t\t}\n\n\t\t\twriter.println(\"\\nEnding learning Rate: \" + learningRate + \"\\n\");\n\t\t\tSystem.out.println(\"\\nEnding learning Rate: \" + learningRate + \"\\n\");\n\t\t\t\n\t\t\tfor (Feature feature : features){\n\t\t\t\tSystem.out.println(feature.toString());\n\t\t\t\twriter.println(feature.toString());\n\t\t\t}\n\t\t\twriter.close();\n\t\t} catch (FileNotFoundException e) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\te.printStackTrace();\n\t\t}\n\t}", "private void setNN(int NN) {\n\t\tCMN.NN = NN;\n\t}", "public Collection<String> wordsNearest(String word,int n) {\n INDArray vec = Transforms.unitVec(this.getWordVectorMatrix(word));\n\n\n if(cache instanceof InMemoryLookupCache) {\n InMemoryLookupCache l = (InMemoryLookupCache) cache;\n INDArray syn0 = l.getSyn0();\n INDArray weights = syn0.norm2(0).rdivi(1).muli(vec);\n INDArray distances = syn0.mulRowVector(weights).sum(1);\n INDArray[] sorted = Nd4j.sortWithIndices(distances,0,false);\n INDArray sort = sorted[0];\n List<String> ret = new ArrayList<>();\n VocabWord word2 = cache.wordFor(word);\n if(n > sort.length())\n n = sort.length();\n //there will be a redundant word\n for(int i = 0; i < n + 1; i++) {\n if(sort.getInt(i) == word2.getIndex())\n continue;\n ret.add(cache.wordAtIndex(sort.getInt(i)));\n }\n\n\n return ret;\n }\n\n if(vec == null)\n return new ArrayList<>();\n Counter<String> distances = new Counter<>();\n\n for(String s : cache.words()) {\n if(s.equals(word))\n continue;\n INDArray otherVec = getWordVectorMatrix(s);\n double sim = Transforms.cosineSim(vec,otherVec);\n distances.incrementCount(s, sim);\n }\n\n\n distances.keepTopNKeys(n);\n return distances.keySet();\n\n }", "public static double sqnl(double x) {\n if (Double.isNaN(x)) return Double.NaN;\n if (x <= -2) return -1.0;\n if (x < 0) return x + (Math.pow(x, 2) / 4);\n if (x < 2) return x - (Math.pow(x, 2) / 4);\n return 1.0;\n }", "public int getW() {\n\t\treturn w;\n\t}", "private static void demonstrateListOperation(IndexWord word) throws JWNLException {\n PointerTargetNodeList hypernyms = PointerUtils.getInstance().getDirectHypernyms(word.getSense(1));\n System.out.println(\"Direct hypernyms of \\\"\" + word.getLemma() + \"\\\":\");\n for(int idx = 0; idx < hypernyms.size(); idx++){\n PointerTargetNode nn = (PointerTargetNode)hypernyms.get(idx);\n for(int wrdIdx = 0; wrdIdx < nn.getSynset().getWordsSize(); wrdIdx++){\n System.out.println(\"Syn\" + idx + \" of direct hypernyms of\\\"\" + word.getLemma() + \"\\\" : \" +\n nn.getSynset().getWord(wrdIdx).getLemma());\n }\n }\n hypernyms.print();\n }", "public void setW(double w) {\n this.w = w;\n }", "public void adjustWeightsTest() {\n\t\tboolean[] tempCorrectArray = new boolean[numInstances()];\n\t\tfor (int i = 0; i < tempCorrectArray.length / 2; i++) {\n\t\t\ttempCorrectArray[i] = true;\n\t\t} // Of for i\n\n\t\tdouble tempWeightedError = 0.3;\n\n\t\tadjustWeights(tempCorrectArray, tempWeightedError);\n\n\t\tSystem.out.println(\"After adjusting\");\n\n\t\tSystem.out.println(toString());\n\t}", "@Override\n\tpublic double weight() {\n\t\treturn 1.0;\n\t}", "float getWetness();", "float getW() {\n return _w;\n }", "public int hammingWeight(int n) {\r\n int ans=0;\r\n int mask=1;\r\n for(int i=0;i<32;i++){\r\n if((mask&n)!=0) ans++;\r\n mask=mask<<1;\r\n }\r\n return ans;\r\n }" ]
[ "0.6209543", "0.55445784", "0.5459818", "0.5421155", "0.5380668", "0.53452563", "0.53389794", "0.5309462", "0.5265589", "0.5209318", "0.5145935", "0.5129835", "0.50964594", "0.5091493", "0.50909054", "0.50892305", "0.5082551", "0.50642943", "0.5051765", "0.503793", "0.50347173", "0.503129", "0.502534", "0.50245625", "0.5018866", "0.5003193", "0.49982107", "0.4991196", "0.49844444", "0.4969857", "0.49618834", "0.49600092", "0.49555707", "0.49474743", "0.4944823", "0.4944111", "0.49420556", "0.49399424", "0.4922473", "0.49208435", "0.49186632", "0.49145168", "0.49112564", "0.4899155", "0.48926604", "0.48886827", "0.48726407", "0.48662055", "0.48639065", "0.48592594", "0.48590687", "0.48584944", "0.48536792", "0.48396364", "0.4837376", "0.48364934", "0.48350617", "0.48180184", "0.48172733", "0.48084125", "0.4802614", "0.47955453", "0.4795398", "0.47859943", "0.47574687", "0.4756301", "0.47562724", "0.47510144", "0.4741737", "0.47335654", "0.47304785", "0.4729075", "0.47265062", "0.47248882", "0.47183102", "0.47181153", "0.4718052", "0.47146115", "0.4714544", "0.46996716", "0.46978316", "0.46964312", "0.4696045", "0.46926832", "0.46902984", "0.46898094", "0.4689276", "0.4681188", "0.4668714", "0.46665767", "0.46639827", "0.46576315", "0.46570295", "0.46567285", "0.46539342", "0.4653842", "0.46521717", "0.46506077", "0.46467075", "0.46457303" ]
0.55514574
1
Created by Donny Dominic on 27012016.
public interface updateTabBarIcon { void updateDeleteIcon(float x, float y, PhotoSortrView.Img imgItem, boolean isPointerDown, boolean isPointerUp); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\n public void perish() {\n \n }", "@Override\n public void func_104112_b() {\n \n }", "@Override\n\tpublic void grabar() {\n\t\t\n\t}", "private stendhal() {\n\t}", "public final void mo51373a() {\n }", "@Override\n\tpublic void comer() {\n\t\t\n\t}", "@Override\r\n\tpublic void bicar() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void bicar() {\n\t\t\r\n\t}", "protected boolean func_70814_o() { return true; }", "@Override\n\tpublic void sacrifier() {\n\t\t\n\t}", "@Override\n public int describeContents() { return 0; }", "@Override\n\tprotected void interr() {\n\t}", "@Override\r\n\tpublic void tires() {\n\t\t\r\n\t}", "private void m50366E() {\n }", "@Override\n\tpublic void nadar() {\n\t\t\n\t}", "@Override\r\n\tpublic void dormir() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void comer() \r\n\t{\n\t\t\r\n\t}", "@Override\n\tprotected void getExras() {\n\n\t}", "private void poetries() {\n\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n public void init() {\n\n }", "@Override\r\n\t\tpublic void init() {\n\t\t\t\r\n\t\t}", "public void mo38117a() {\n }", "@Override\n\tpublic void entrenar() {\n\t\t\n\t}", "@Override\r\n\tpublic void anularFact() {\n\t\t\r\n\t}", "@Override\n\tpublic void anular() {\n\n\t}", "public void gored() {\n\t\t\n\t}", "@Override\n\tprotected void initialize() {\n\t\t\n\t}", "@Override\n\tprotected void initialize() {\n\t\t\n\t}", "@Override\n public void init() {\n }", "private static void cajas() {\n\t\t\n\t}", "@Override\n void init() {\n }", "@Override\n protected void initialize() {\n }", "@Override\n protected void initialize() {\n }", "@Override\n protected void initialize() {\n }", "@Override\n protected void initialize() {\n }", "@Override\n protected void initialize() {\n }", "@Override\n protected void initialize() {\n }", "@Override\r\n\tpublic void rozmnozovat() {\n\t}", "@Override\r\n\tpublic void init() {}", "@Override\n protected void initialize() {\n\n \n }", "private void init() {\n\n\t}", "@Override public int describeContents() { return 0; }", "@Override\n public int retroceder() {\n return 0;\n }", "@Override\n public void init() {}", "@Override\n\tpublic void jugar() {\n\t\t\n\t}", "@Override\r\n\t\t\tpublic void annadir() {\n\r\n\t\t\t}", "public void mo4359a() {\n }", "private void kk12() {\n\n\t}", "@Override\n\tpublic void init() {\n\n\t}", "@Override\n\tpublic void init() {\n\n\t}", "@Override\n\tpublic void init() {\n\n\t}", "@Override\n protected void init() {\n }", "@Override\r\n\tpublic void init() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void init() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void init() {\n\t\t\r\n\t}", "@Override\n\tprotected void initialize() {\n\n\t}", "@Override\n protected void getExras() {\n }", "@Override\n protected void initialize() \n {\n \n }", "@Override\n\tpublic void ligar() {\n\t\t\n\t}", "@Override\n\tpublic void one() {\n\t\t\n\t}", "@Override\r\n\tpublic void init() {\n\r\n\t}", "@Override\r\n\tpublic void init() {\n\r\n\t}", "@Override\r\n\tpublic void init() {\n\r\n\t}", "@Override\n\tpublic void gravarBd() {\n\t\t\n\t}", "@Override\r\n\tprotected void initialize() {\r\n\t\t\r\n\t\t\r\n\t}", "@Override\n public void init() {\n\n }", "@Override\n public void init() {\n\n }", "private Rekenhulp()\n\t{\n\t}", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "private void strin() {\n\n\t}", "@Override\n\tpublic void init() {\n\t}", "@Override\r\n\tpublic void init()\r\n\t{\n\t}", "@Override\r\n\tprotected void doF4() {\n\t\t\r\n\t}", "private MetallicityUtils() {\n\t\t\n\t}", "@Override\n\tpublic void nghe() {\n\n\t}", "@Override\r\n\tpublic void dibujar() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void dibujar() {\n\t\t\r\n\t}", "@Override\n\tpublic void init()\n\t{\n\n\t}", "@Override\r\n\tprotected void doF8() {\n\t\t\r\n\t}", "@Override\n public void initialize() { \n }", "@Override\n\tpublic int mettreAJour() {\n\t\treturn 0;\n\t}", "public void method_4270() {}", "@Override\n\tpublic void nefesAl() {\n\n\t}", "@Override\n\tpublic void einkaufen() {\n\t}", "@Override\n\t\tpublic void init() {\n\t\t}", "public void m23075a() {\n }", "Consumable() {\n\t}", "@Override\n\tprotected void initialize() {\n\t}", "@Override\n\tprotected void initialize() {\n\t}", "private void m50367F() {\n }" ]
[ "0.58745766", "0.56963676", "0.56820554", "0.5672955", "0.5670526", "0.5614913", "0.55790114", "0.55790114", "0.5558534", "0.5557314", "0.5556293", "0.55486315", "0.5494039", "0.5490438", "0.54656345", "0.54647297", "0.5441037", "0.54380274", "0.5437413", "0.54292583", "0.54292583", "0.54292583", "0.54292583", "0.54292583", "0.54150116", "0.5414967", "0.53985816", "0.53880733", "0.53857213", "0.53823674", "0.537775", "0.5365097", "0.5365097", "0.5363221", "0.53492844", "0.5333673", "0.53276443", "0.53276443", "0.53276443", "0.53276443", "0.53276443", "0.53276443", "0.53255975", "0.531561", "0.53147453", "0.53088856", "0.53084606", "0.5308191", "0.5306059", "0.5297031", "0.529351", "0.52927387", "0.52839607", "0.5274324", "0.5274324", "0.5274324", "0.5264409", "0.5261461", "0.5261461", "0.5261461", "0.5258754", "0.52561665", "0.524645", "0.52462995", "0.5241299", "0.5239578", "0.5239578", "0.5239578", "0.523883", "0.5232536", "0.5230687", "0.5230687", "0.5229788", "0.52194417", "0.52194417", "0.52194417", "0.52194417", "0.52194417", "0.52194417", "0.52194417", "0.5218314", "0.5212723", "0.52076477", "0.5201573", "0.5197722", "0.519503", "0.5184493", "0.5184493", "0.51838183", "0.51759267", "0.51758105", "0.51716125", "0.51667845", "0.51649773", "0.51637006", "0.51620597", "0.51504743", "0.51455814", "0.5145129", "0.5145129", "0.5138003" ]
0.0
-1
Panning manually Translates the camera in the X and Y dimensions. Does bounds checking.
@Override public void pan(Vector2 delta) { // keep camera within borders float x = Utils.between(viewCamera.position.x + delta.x, bounds.min.x, bounds.max.x); float y = Utils.between(viewCamera.position.y + delta.y, bounds.min.y, bounds.max.y); viewCamera.position.set(x, y, 0); viewCamera.update(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void panView() {\n double xDistance = currentXOffset - targetXOffset;\n double yDistance = currentYOffset - targetYOffset;\n\n xDistance *= -0.5;\n yDistance *= -0.5;\n\n boolean clearX = Math.abs(xDistance) < 2;\n if (clearX) {\n currentXOffset = targetXOffset;\n } else {\n currentXOffset += xDistance;\n }\n\n boolean clearY = Math.abs(xDistance) < 2;\n if (clearY) {\n currentYOffset = targetYOffset;\n } else {\n currentYOffset += yDistance;\n }\n\n doPan = !clearX || !clearY;\n\n gameChanged = true;\n\n }", "private void moveCameraToPosWithinBoardBounds(float x, float y) {\n // the camera position is the center coordinate of the displayed area --> cam.viewport.../2\n cam.position.x = MathUtils.clamp(x,\n cam.viewportWidth/2 - (cam.viewportWidth/2)*(1-getZoomFactor()),\n cam.viewportWidth/2 + (cam.viewportWidth/2)*(1-getZoomFactor()));\n cam.position.y = MathUtils.clamp(cam.viewportHeight-y,\n cam.viewportHeight/2 - (cam.viewportHeight/2)*(1-getZoomFactor()),\n cam.viewportHeight/2 + (cam.viewportHeight/2)*(1-getZoomFactor()));\n cam.update();\n }", "@Override\n\tpublic void pan(float x, float y, float z) {\n\t\t// keep camera within borders\n\t\tx = Utils.between(viewCamera.position.x + x, bounds.min.x, bounds.max.x);\n\t\ty = Utils.between(viewCamera.position.y + y, bounds.min.y, bounds.max.y);\n\t\tz = Utils.between(viewCamera.position.z + z, bounds.min.z, bounds.max.z);\n\t\tviewCamera.position.set(x, y, z);\n\t\tviewCamera.update();\n\t}", "@Override\n\tpublic void pan(Vector3 delta) {\n\t\t// keep camera within borders\n\t\tfloat x = Utils.between(viewCamera.position.x + delta.x, bounds.min.x, bounds.max.x);\n\t\tfloat y = Utils.between(viewCamera.position.y + delta.y, bounds.min.y, bounds.max.y);\n\t\tfloat z = Utils.between(viewCamera.position.z + delta.z, bounds.min.z, bounds.max.z);\n\t\tviewCamera.position.set(x, y, z);\n\t\tviewCamera.update();\n\t}", "private void moveCameraWithinBoardBounds(float deltaX, float deltaY) {\n // zoom factor is incorporated to make (absolute) camera movement slower when zoomed in\n // so it's always the same visual velocity\n float newX = cam.position.x - deltaX*getZoomFactor();\n float newY = cam.position.y + deltaY*getZoomFactor();\n moveCameraToPosWithinBoardBounds(newX, cam.viewportHeight-newY);\n }", "private void adjustCameraPosition() {\n if (upward) {\n\n if (tilt<90) {\n tilt ++;\n zoom-=0.01f;\n } else {\n upward=false;\n }\n\n } else {\n if (tilt>0) {\n tilt --;\n zoom+=0.01f;\n } else {\n upward=true;\n }\n }\n }", "public void panOriginTo(double x, double y) {\n \t\tfloat tx = (float) (x / mapDisplay.sc);\n \t\tfloat ty = (float) (y / mapDisplay.sc);\n \t\tsetPosition(tx, ty, tweening);\n \t}", "public void moveViewTo(int newX, int newY) {\n int scaledWidth = (int) (TileDataRegister.TILE_WIDTH * scale);\n int scaledHeight = (int) (TileDataRegister.TILE_HEIGHT * scale);\n int baseX = (int) (map.getWidth() * TileDataRegister.TILE_WIDTH * scale) / 2;\n\n int x = baseX + (newY - newX) * scaledWidth / 2;\n x -= viewPortWidth * 0.5;\n\n int y = (newY + newX) * scaledHeight / 2;\n y -= viewPortHeight * 0.5;\n\n targetXOffset = -1 * x;\n targetYOffset = -1 * y;\n\n doPan = true;\n\n gameChanged = true;\n }", "public void pan(double oldX, double oldY, double x, double y) {\n \t\tdouble dx = (double) (x - oldX);\n \t\tdouble dy = (double) (y - oldY);\n \t\tpanOriginDelta(dx, dy, false);\n \t}", "@SuppressWarnings(\"unused\")\n private void panBy(JSONArray args, CallbackContext callbackContext) throws JSONException {\n int x = args.getInt(1);\n int y = args.getInt(2);\n float xPixel = -x * this.density;\n float yPixel = -y * this.density;\n \n CameraUpdate cameraUpdate = CameraUpdateFactory.scrollBy(xPixel, yPixel);\n map.animateCamera(cameraUpdate);\n }", "public void checkCameraLimits()\n {\n //Daca camera ar vrea sa mearga prea in stanga sau prea in dreapta (Analog si pe verticala) ea e oprita (practic cand se intampla acest lucru Itemul asupra caruia se incearca centrarea nu mai e in centrul camerei )\n\n if(xOffset < 0 )\n xOffset = 0;\n else if( xOffset > refLinks.GetMap().getWidth()* Tile.TILE_WIDTH - refLinks.GetWidth())\n xOffset =refLinks.GetMap().getWidth()* Tile.TILE_WIDTH - refLinks.GetWidth();\n if(yOffset<0)\n yOffset = 0;\n if(yOffset > refLinks.GetMap().getHeight()*Tile.TILE_HEIGHT - refLinks.GetHeight())\n {\n yOffset = refLinks.GetMap().getHeight()*Tile.TILE_HEIGHT - refLinks.GetHeight();\n }\n }", "private void updateCamera() {\n\t\tVector3f x = new Vector3f();\n\t\tVector3f y = new Vector3f();\n\t\tVector3f z = new Vector3f();\n\t\tVector3f temp = new Vector3f(this.mCenterOfProjection);\n\n\t\ttemp.sub(this.mLookAtPoint);\n\t\ttemp.normalize();\n\t\tz.set(temp);\n\n\t\ttemp.set(this.mUpVector);\n\t\ttemp.cross(temp, z);\n\t\ttemp.normalize();\n\t\tx.set(temp);\n\n\t\ty.cross(z, x);\n\n\t\tMatrix4f newMatrix = new Matrix4f();\n\t\tnewMatrix.setColumn(0, x.getX(), x.getY(), x.getZ(), 0);\n\t\tnewMatrix.setColumn(1, y.getX(), y.getY(), y.getZ(), 0);\n\t\tnewMatrix.setColumn(2, z.getX(), z.getY(), z.getZ(), 0);\n\t\tnewMatrix.setColumn(3, mCenterOfProjection.getX(),\n\t\t\t\tmCenterOfProjection.getY(), mCenterOfProjection.getZ(), 1);\n\t\ttry {\n\t\t\tnewMatrix.invert();\n\t\t\tthis.mCameraMatrix.set(newMatrix);\n\t\t} catch (SingularMatrixException exc) {\n\t\t\tLog.d(\"Camera\",\n\t\t\t\t\t\"SingularMatrixException on Matrix: \"\n\t\t\t\t\t\t\t+ newMatrix.toString());\n\t\t}\n\t}", "@Override\n\tpublic void move_x() {\n\t\tif(mX < 0){\n\t \tdirection *= -1 ;\n\t \t setScale(-1, 1);\n\t }else if (mX > activity.getCameraWidth()-64){\n\t \tdirection *= -1 ;\n\t \tsetScale(1, 1);\n\t } \n\t\tmove_x(direction);\n\t}", "private void changeCameraPosition() {\n yPosition = mPerspectiveCamera.position.y;\n if (isMovingUp) {\n yPosition += 0.1;\n if (yPosition > 20)\n isMovingUp = false;\n } else {\n yPosition -= 0.1;\n if (yPosition < 1)\n isMovingUp = true;\n }\n\n mPerspectiveCamera.position.set(xPosition, yPosition, zPosition);\n mPerspectiveCamera.update();\n }", "private static void verifyViewPoint() {\n if (viewPoint.x < 0)\n viewPoint.x = 0;\n if (viewPoint.y < 0)\n viewPoint.y = 0;\n if (viewPoint.x > map.WIDTH - GAME_WIDTH * zoom)\n viewPoint.x = map.WIDTH - ((int) (GAME_WIDTH * zoom));\n if (viewPoint.y > map.HEIGHT - GAME_HEIGHT * zoom)\n viewPoint.y = map.HEIGHT - ((int) (GAME_HEIGHT * zoom));\n }", "public void moveViewRelative(int newX, int newY) {\n\n targetXOffset = (int) (currentXOffset - newX);\n targetYOffset = (int) (currentYOffset - newY);\n\n doPan = true;\n\n gameChanged = true;\n }", "private void reboundCameraOffset(Point offset, EnumSet<Direction> directions) {\n int boundsStartX = 0;\n int boundsEndX = tileMap.getPixelWidth();\n int boundsStartY = 0;\n int boundsEndY = tileMap.getPixelHeight();\n if (offset.x < boundsStartX && directions.contains(Direction.LEFT)) {\n offset.x = boundsStartX;\n } else if (offset.x + screenWidth > boundsEndX && directions.contains(Direction.RIGHT)) {\n offset.x = boundsEndX - screenWidth;\n }\n if (offset.y < boundsStartY && directions.contains(Direction.UP)) {\n offset.y = boundsStartY;\n } else if (offset.y + screenHeight > boundsEndY && directions.contains(Direction.DOWN)) {\n offset.y = boundsEndY - screenHeight;\n }\n }", "private void handleScreenBoundaries() {\n\t\tif (tiledMapHelper.getCamera().position.x < screenWidth / 2) {\n\t\t\ttiledMapHelper.getCamera().position.x = screenWidth / 2;\n\t\t}\n\t\tif (tiledMapHelper.getCamera().position.x >= tiledMapHelper.getWidth()\n\t\t\t\t- screenWidth / 2) {\n\t\t\ttiledMapHelper.getCamera().position.x = tiledMapHelper.getWidth()\n\t\t\t\t\t- screenWidth / 2;\n\t\t}\n\n\t\tif (tiledMapHelper.getCamera().position.y < screenHeight / 2) {\n\t\t\ttiledMapHelper.getCamera().position.y = screenHeight / 2;\n\t\t}\n\t\tif (tiledMapHelper.getCamera().position.y >= tiledMapHelper.getHeight()\n\t\t\t\t- screenHeight / 2) {\n\t\t\ttiledMapHelper.getCamera().position.y = tiledMapHelper.getHeight()\n\t\t\t\t\t- screenHeight / 2;\n\t\t}\n\t}", "public void processCamera() {\n\t\tif (Mario.getX() > 300) {\n\t\t\tlevelCompound.move(-Mario.xVel, 0);\n\t\t\tPhysics.moveHitboxes(-Mario.xVel, 0);\n\t\t\tPhysics.moveEnemies(-Mario.xVel, 0);\n\t\t\tMario.setLocation(299, Mario.getY());\n\n\t\t\tlevelCompound.move(-3, 0);\n\t\t\tPhysics.moveHitboxes(-3, 0);\n\t\t\tPhysics.moveEnemies(-3, 0);\n\t\t}\n\t}", "public void pan(float panX, float panY) {\n workTransform.setTransform(null);\n workTransform.mTranslate(panX, panY);\n workTransform.mMultiply(userTransform);\n doc.setTransform(workTransform);\n swapTransforms();\n }", "private void calculateViewportOffset (int[] xy, int visitorX, int visitorY) {\n Image mapImage = cityMap.getMapImage ();\n\n int mapWidth = mapImage.getWidth ();\n int mapHeight = mapImage.getHeight ();\n\n int vpWidth = getWidth ();\n int vpHeight = getHeight ();\n\n int x = visitorX - (vpWidth / 2);\n int y = visitorY - (vpHeight / 2);\n\n if ((x + vpWidth) > mapWidth) {\n x = mapWidth - vpWidth;\n }\n\n if ((y + vpHeight) > mapHeight) {\n y = mapHeight - vpHeight;\n }\n\n if (x < 0) {\n x = 0;\n }\n\n if (y < 0) {\n y = 0;\n }\n\n xy[X] = x;\n xy[Y] = y;\n }", "private void panMap(int x, int y){\r\n Point p = map.getMapCenter();\r\n p.x += x;\r\n p.y += y;\r\n map.setMapCenter(p);\r\n mapPane.render();\r\n }", "private Point restrictDelta(int deltaX, int deltaY)\n {\n for (GraphElement element : elements) {\n if(element instanceof Moveable) {\n Moveable target = (Moveable) element;\n\n if(target.getX() + deltaX < 0) {\n deltaX = -target.getX();\n }\n if(target.getY() + deltaY < 0) {\n deltaY = -target.getY();\n }\n }\n }\n return new Point(deltaX, deltaY);\n }", "public void runProjectionMotion(){\n\t\tpos.setLocation(pos.getX() + vel[0]/5, pos.getY() - vel[1]/5);\r\n\t\tvel[1]-=gravity;\r\n\t}", "@Override\n\tpublic void moveCamera() {\n\n\t}", "public void moveCamera(int dX, int dY) {\n cameraX += dX;\n cameraY += dY;\n reposition();\n }", "private double translateX( double xRaw )\r\n {\r\n double x = xRaw;\r\n \r\n // Zoom\r\n x = x * zoomFactor;\r\n \r\n // Shift\r\n x = x - viewMinX;\r\n \r\n // Center\r\n double cShift = (getWidth()/2) - ((viewMaxX-viewMinX)/2);\r\n x = x + cShift;\r\n \r\n return x;\r\n }", "public void updateCamera(int x, int y) {\n gc.getCamera().setPosition(x, y);\n\n // DOWN\n if (gc.getCamera().getY() > gc.getHeight()\n - gc.getCamera().getViewportSizeY()) {\n gc.getCamera().setY(gc.getHeight()\n - gc.getCamera().getViewportSizeY());\n }\n\n // RIGHT\n if (gc.getCamera().getX() > gc.getWidth()\n - gc.getCamera().getViewportSizeX()) {\n gc.getCamera().setX(gc.getWidth()\n - gc.getCamera().getViewportSizeX());\n }\n\n // LEFT\n if (gc.getCamera().getX() < 0) {\n gc.getCamera().setX(0);\n }\n\n // UP\n if (gc.getCamera().getY() < 0) {\n gc.getCamera().setY(0);\n }\n }", "@Override\n\tpublic void resize(int width, int height) {\n\t\tviewCamera.viewportWidth = width;\n\t\tviewCamera.viewportHeight = height;\n\t\tviewCamera.position.set(0, 0, 0);\n\t\tviewCamera.update();\n\n\t\tVector3 min = MIN_BOUND.cpy();\n\t\tVector3 max = new Vector3(MAX_BOUND.x - width, MAX_BOUND.y - height, 0);\n\t\tviewCamera.project(min, 0, 0, width, height);\n\t\tviewCamera.project(max, 0, 0, width, height);\n\t\tbounds = new BoundingBox(min, max);\n\t\t// do a pan to reset camera position\n\t\tpan(min);\n\t}", "@Override\n public boolean onTouchEvent(MotionEvent event) {\n x = (int) event.getRawX();\n y = (int) event.getRawY();\n if (event.getAction() == MotionEvent.ACTION_MOVE) {\n deltaX = x - mLastX;\n deltaY = y - mLastY;\n setTranslationX(getTranslationX() + deltaX);\n setTranslationY(getTranslationY() + deltaY);\n }\n mLastX = x;\n mLastY = y;\n return true;\n }", "public void move(TrackerState state) {\n\t\t\n\t\tcurrentPosition[0] = state.devicePos[0];\n\t\tcurrentPosition[1] = state.devicePos[1];\n\t\tcurrentPosition[2] = state.devicePos[2];\n\t\t\n\t\tboolean processMove = false;\n\t\t\n\t\tboolean isWheel = (state.actionType == TrackerState.TYPE_WHEEL);\n\t\tboolean isZoom = (isWheel || state.ctrlModifier);\n\t\t\n\t\tif (isZoom) {\n\t\t\t\n\t\t\tdirection[0] = 0;\n\t\t\tdirection[1] = 0;\n\t\t\t\n\t\t\tif (isWheel) {\n\t\t\t\tdirection[2] = state.wheelClicks * 0.1f;\n\t\t\t\t\n\t\t\t} else if (state.ctrlModifier) {\n\t\t\t\tdirection[2] = (currentPosition[1] - startPosition[1]);\n\t\t\t\t\n\t\t\t} else {\n\t\t\t\tdirection[2] = 0;\n\t\t\t}\n\t\t\t\n\t\t\tif (direction[2] != 0) {\n\t\t\t\t\n\t\t\t\tdirection[2] *= 16;\n\t\t\t\t\n\t\t\t\tdata.viewpointTransform.getTransform(startViewMatrix);\n\t\t\t\tstartViewMatrix.get(positionVector);\n\t\t\t\t\n\t\t\t\tinVector.x = startViewMatrix.m02;\n\t\t\t\tinVector.y = startViewMatrix.m12;\n\t\t\t\tinVector.z = startViewMatrix.m22;\n\t\t\t\tinVector.normalize();\n\t\t\t\tinVector.scale(direction[2]);\n\t\t\t\t\n\t\t\t\tpositionVector.add(inVector);\n\t\t\t\t\n\t\t\t\t// stay above the floor\n\t\t\t\tif (positionVector.y > 0) {\n\t\t\t\t\tdestViewMatrix.set(startViewMatrix);\n\t\t\t\t\tdestViewMatrix.setTranslation(positionVector);\n\t\t\t\t\t\n\t\t\t\t\tprocessMove = true;\n\t\t\t\t}\n\t\t\t}\n\t\t} else {\n\t\t\t\n\t\t\tdirection[0] = -(startPosition[0] - currentPosition[0]);\n\t\t\tdirection[1] = -(currentPosition[1] - startPosition[1]);\n\t\t\tdirection[2] = 0;\n\t\t\t\n\t\t\tfloat Y_Rotation = direction[0];\n\t\t\tfloat X_Rotation = direction[1];\n\t\t\t\n\t\t\tif( ( Y_Rotation != 0 ) || ( X_Rotation != 0 ) ) {\n\t\t\t\t\n\t\t\t\tdouble theta_Y = -Y_Rotation * Math.PI;\n\t\t\t\tdouble theta_X = -X_Rotation * Math.PI;\n\t\t\t\t\n\t\t\t\tdata.viewpointTransform.getTransform(startViewMatrix);\n\t\t\t\tstartViewMatrix.get(positionVector);\n\t\t\t\t\n\t\t\t\tpositionVector.x -= centerOfRotation.x;\n\t\t\t\tpositionVector.y -= centerOfRotation.y;\n\t\t\t\tpositionVector.z -= centerOfRotation.z;\n\t\t\t\t\n\t\t\t\tif (theta_Y != 0) {\n\n\t\t\t\t\trot.set(0, 1, 0, (float)theta_Y);\n\t\t\t\t\tmtx.set(rot);\n\t\t\t\t\tmtx.transform(positionVector);\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tif (theta_X != 0) {\n\t\t\t\t\t\n\t\t\t\t\tvec.set(positionVector);\n\t\t\t\t\tvec.normalize();\n\t\t\t\t\tfloat angle = vec.angle(Y_AXIS);\n\t\t\t\t\t\n\t\t\t\t\tif (angle == 0) {\n\t\t\t\t\t\tif (theta_X > 0) {\n\t\t\t\t\t\t\trightVector.x = startViewMatrix.m00;\n\t\t\t\t\t\t\trightVector.y = startViewMatrix.m10;\n\t\t\t\t\t\t\trightVector.z = startViewMatrix.m20;\n\t\t\t\t\t\t\trightVector.normalize();\n\t\t\t\t\t\t\trot.set(rightVector.x, 0, rightVector.z, (float)theta_X);\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\trot.set(0, 0, 1, 0);\n\t\t\t\t\t\t}\n\t\t\t\t\t} else {\n\t\t\t\t\t\tif ((theta_X + angle) < 0) {\n\t\t\t\t\t\t\ttheta_X = -(angle - 0.0001f);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tvec.y = 0;\n\t\t\t\t\t\tvec.normalize();\n\t\t\t\t\t\trot.set(vec.z, 0, -vec.x, (float)theta_X);\n\t\t\t\t\t}\n\t\t\t\t\tmtx.set(rot);\n\t\t\t\t\tmtx.transform(positionVector);\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tpositionPoint.x = positionVector.x + centerOfRotation.x;\n\t\t\t\tpositionPoint.y = positionVector.y + centerOfRotation.y;\n\t\t\t\tpositionPoint.z = positionVector.z + centerOfRotation.z;\n\t\t\t\t\n\t\t\t\t// don't go below the floor\n\t\t\t\tif (positionPoint.y > 0) {\n\t\t\t\t\t\n\t\t\t\t\tmatrixUtils.lookAt(positionPoint, centerOfRotation, Y_AXIS, destViewMatrix);\n\t\t\t\t\tmatrixUtils.inverse(destViewMatrix, destViewMatrix);\n\t\t\t\t\t\n\t\t\t\t\tprocessMove = true;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif (processMove) {\n\t\t\t\n\t\t\tboolean collisionDetected = \n\t\t\t\tcollisionManager.checkCollision(startViewMatrix, destViewMatrix);\n\t\t\t\n\t\t\tif (!collisionDetected) {\n\t\t\t\tAV3DUtils.toArray(destViewMatrix, array);\n\t\t\t\tChangePropertyTransientCommand cptc = new ChangePropertyTransientCommand(\n\t\t\t\t\tve, \n\t\t\t\t\tEntity.DEFAULT_ENTITY_PROPERTIES, \n\t\t\t\t\tViewpointEntity.VIEW_MATRIX_PROP,\n\t\t\t\t\tarray,\n\t\t\t\t\tnull);\n\t\t\t\tcmdCntl.execute(cptc);\n\t\t\t\tif (statusManager != null) {\n\t\t\t\t\tstatusManager.fireViewMatrixChanged(destViewMatrix);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tstartPosition[0] = currentPosition[0];\n\t\tstartPosition[1] = currentPosition[1];\n\t\tstartPosition[2] = currentPosition[2];\n\t}", "private void checkBoundaries() {\n Position moveTo = pos.copy();\n boolean move = false;\n float minZoom = getZoomToFit();\n float maxZoom = minZoom * 3;\n if (maxZoom < getZoomToFill()) maxZoom = getZoomToFill();\n \n if (pos.zoom < minZoom) {\n moveTo = new Position(minZoom, 0, 0);\n move = true;\n } else { \n if (pos.zoom > maxZoom) {\n moveTo.zoom = maxZoom;\n \n float viewXcenter = 0.5f * getWidth();\n float viewYcenter = 0.5f * getHeight();\n double centerXcontentBefore = getContentX(viewXcenter, pos);\n double centerYcontentBefore = getContentY(viewYcenter, pos);\n moveTo.x = (float) (viewXcenter - centerXcontentBefore * maxZoom - 0.5f * getWidth());\n moveTo.y = (float) (viewYcenter - centerYcontentBefore * maxZoom - 0.5f * getHeight());\n \n move = true;\n }\n \n RectF imageBounds = new RectF();\n float zoomedWidth = (flippedDimensions() ? contentWorkHeight : contentWorkWidth) * moveTo.zoom;\n float zoomedHeight = (flippedDimensions() ? contentWorkWidth : contentWorkHeight) * moveTo.zoom;\n imageBounds.left = -0.5f * zoomedWidth + moveTo.x;\n imageBounds.right = 0.5f * zoomedWidth + moveTo.x;\n imageBounds.top = -0.5f * zoomedHeight + moveTo.y;\n imageBounds.bottom = 0.5f * zoomedHeight + moveTo.y;\n \n if (debug) Log.w(TAG, \"checkBoundaries() current image bounds: \" + imageBounds.left + \"x\" + imageBounds.top + \" -> \" + imageBounds.right + \"x\" + imageBounds.bottom);\n \n // adjust offset to fit in boundaries\n RectF offsetBounds = new RectF();\n if (imageBounds.width() - getWidth() > 0) {\n offsetBounds.left = -0.5f * (imageBounds.width() - getWidth());\n offsetBounds.right = 0.5f * (imageBounds.width() - getWidth());\n }\n if (imageBounds.height() - getHeight() > 0) {\n offsetBounds.top = -0.5f * (imageBounds.height() - getHeight());\n offsetBounds.bottom = 0.5f * (imageBounds.height() - getHeight());\n }\n if (imageBounds.centerX() < offsetBounds.left) { \n moveTo.x = offsetBounds.left; \n move = true;\n } else if (imageBounds.centerX() > offsetBounds.right) {\n moveTo.x = offsetBounds.right;\n move = true;\n } \n \n if (imageBounds.centerY() < offsetBounds.top) { \n moveTo.y = offsetBounds.top; \n move = true; \n } else if (imageBounds.centerY() > offsetBounds.bottom) { \n moveTo.y = offsetBounds.bottom; \n move = true; \n }\n }\n \n if (move) {\n final Position finalMoveTo = moveTo;\n move(new Move() {\n Position startPos = new Position(pos);\n Position toPos = finalMoveTo;\n long durationMs = 200;\n public boolean handleMove(Position result, long currentTime, long startedAt) {\n if (currentTime - startedAt > durationMs) {\n result.set(toPos);\n return false;\n }\n \n double remainingProgress = 1.0 - (1.0 * (currentTime - startedAt) / durationMs);\n result.zoom = (float) (toPos.zoom + (startPos.zoom - toPos.zoom) * remainingProgress); \n result.x = (float) (toPos.x + (startPos.x - toPos.x) * remainingProgress);\n result.y = (float) (toPos.y + (startPos.y - toPos.y) * remainingProgress);\n return true;\n }\n });\n }\n if (debug) Log.i(TAG, \"checkBoundaries() \" + (move ? \"moveTo: \" + moveTo : \"ok\"));\n \n }", "public void translate(float x, float y){\n hitBox.offset(x, y);\n }", "@Override\n\tpublic boolean pan(float x, float y, float deltaX, float deltaY) {\n\t\tVector3 touchCoords = camera.unproject(new Vector3(x, y, 0));\n\t\tif(bagSelect.contains(touchCoords.x, touchCoords.y) && world.getState() == World.State.STATE_BAG)\n\t\t{\n\t\t\tworld.setBagPos(world.getBagPos() - (int)(deltaY/5));\n\t\t\tSystem.out.println(world.getBagPos());\n\t\t}\n\n\n\t\treturn false;\n\t}", "@Override\n\t\t\tpublic void mouseDragged(MouseEvent e) {\n\t\t\t\t\n\t\t\t\ttry {\n\t\t\t\t\t//inverted.invert();\n\t\t\t\t\t//Point2D point = inverted.transform(new Point2D.Double(e.getX(), e.getY()), null);\n\t\t\t\t\t//inverted.setToTranslation((double)e.getX(), (double)e.getY());\n\t\t\t\t\tPoint2D p = transform.inverseTransform(new Point2D.Double(e.getX() - panOrigin.getX(), e.getY() - panOrigin.getY()), null);\n\t\t\t\t\ttransform.translate(p.getX(), p.getY());\n\t\t\t\t\trevalidate();\n\t\t\t\t\trepaint();\n\t\t\t\t\tpanOrigin.setLocation(e.getX(), e.getY());\n\t\t\t\t\tSystem.out.printf(\"%f, %f\\n\", p.getX(), p.getY());\n\t\t\t\t} catch (NoninvertibleTransformException e1) {\n\t\t\t\t\te1.printStackTrace();\n\t\t\t\t}\n\t\t\t}", "private void setCameraView() {\n double bottomBoundary = mUserPosition.getLatitude() - .1;\n double leftBoundary = mUserPosition.getLongitude() - .1;\n double topBoundary = mUserPosition.getLatitude() + .1;\n double rightBoundary = mUserPosition.getLongitude() + .1;\n\n mMapBoundary = new LatLngBounds(\n new LatLng(bottomBoundary, leftBoundary),\n new LatLng(topBoundary, rightBoundary)\n );\n\n mGoogleMap.moveCamera(CameraUpdateFactory.newLatLngBounds(mMapBoundary, 500,500,1));\n }", "private void updatePosition() {\n position.add(deltaPosition);\n Vector2[] points = getRotatedPoints();\n\n for (Vector2 point : points) {\n if (point.getX() < bound.getX() || point.getX() > bound.getX() + bound.getWidth()) { //If the point is outside of the bounds because of X\n position.addX(-deltaPosition.getX() * 2); //Undo the move so it is back in bounds\n deltaPosition.setX(-deltaPosition.getX()); //Make the direction it is going bounce to the other direction\n break;\n }\n if (point.getY() < bound.getY() || point.getY() > bound.getY() + bound.getHeight()) { //If the point is outside of the bounds because of Y\n position.addY(-deltaPosition.getY() * 2); //Undo the move so it is back in bounds\n deltaPosition.setY(-deltaPosition.getY()); //Make the direction it is going bounce to the other direction\n break;\n }\n }\n deltaPosition.scale(.98);\n }", "public void updateMvpMatrix()\n\t\t{\n\t\t\t// Set the matrix, specifying the edges of the visible canvas and the near and far clipping planes.\n\t\t\tMatrix.orthoM(mvpMatrix, 0,\n\t\t\t\t\t-viewportWidth / (2f * zoom) + cameraX,\n\t\t\t\t\tviewportWidth / (2f * zoom) + cameraX,\n\t\t\t\t\t-viewportHeight / (2f * zoom) + cameraY,\n\t\t\t\t\tviewportHeight / (2f * zoom) + cameraY, -1, 1);\n\t\t}", "private void setCamera() {\n\t\tVector viewTranslation = controller.getCameraPosition();\n\n\t\tGL11.glClear(GL11.GL_COLOR_BUFFER_BIT | GL11.GL_DEPTH_BUFFER_BIT);\n\t\tGL11.glMatrixMode(GL11.GL_PROJECTION);\n\t\tGL11.glLoadIdentity();\n\n\t\tfloat whRatio = (float) windowWidth / (float) windowHeight;\n\t\tGLU.gluPerspective(controller.getFOV(), whRatio, 1, 100000);\n\t\tGLU.gluLookAt((float) viewTranslation.x, (float) viewTranslation.y,\n\t\t\t\t(float) controller.getCameraDistance(), (float) viewTranslation.x,\n\t\t\t\t(float) viewTranslation.y, 0, 0, 1, 0);\n\n\t\tGL11.glMatrixMode(GL11.GL_MODELVIEW);\n\t\tGL11.glLoadIdentity();\n\t}", "private void pointCameraAt(Point3D target,Group root){\n for(Node node: root.getChildren()){\n node.setTranslateX(node.getTranslateX()-xOffset);\n node.setTranslateY(node.getTranslateY()-yOffset);\n node.setTranslateZ(node.getTranslateZ()-zOffset);\n }\n\n xOffset = -target.getX(); yOffset = -target.getY(); zOffset = -target.getZ();\n\n for(Node node: root.getChildren()){\n node.setTranslateX(node.getTranslateX()+xOffset);\n node.setTranslateY(node.getTranslateY()+yOffset);\n node.setTranslateZ(node.getTranslateZ()+zOffset);\n }\n }", "private void fixView(final float newX, final float newY) {\n final float x = this.worldView.getX();\n final float y = this.worldView.getY();\n final float scale = this.worldView.getScale();\n final int width = this.worldView.getMasterImage().getWidth();\n final int height = this.worldView.getMasterImage().getHeight();\n\n float updatedX = Math.max(0, newX);\n float updatedY = Math.max(0, newY);\n\n\n if (width * scale + x > width) {\n updatedX = width - (width * scale);\n }\n if (height * scale + y > height) {\n updatedY = height - (height * scale);\n }\n\n this.worldView.setX(updatedX);\n this.worldView.setY(updatedY);\n\n }", "public void offsetCamera(Location offset){\n //updateCoordinateToScreenPosition();\n xCameraOffset = offset.getX();\n yCameraOffset = offset.getY();\n }", "private void configureCamera() {\n float fHeight = cam.getFrustumTop() - cam.getFrustumBottom();\n float fWidth = cam.getFrustumRight() - cam.getFrustumLeft();\n float fAspect = fWidth / fHeight;\n float yDegrees = 45f;\n float near = 0.02f;\n float far = 20f;\n cam.setFrustumPerspective(yDegrees, fAspect, near, far);\n\n flyCam.setMoveSpeed(5f);\n\n cam.setLocation(new Vector3f(2f, 4.7f, 0.4f));\n cam.setRotation(new Quaternion(0.348f, -0.64f, 0.4f, 0.556f));\n }", "public void setPanning(float value) {\r\n\t\tleft.lvl.set(0.50f - value / 2);\r\n\t\tright.lvl.set(0.50f + value / 2);\r\n\t}", "private void moveCamera(float tpf) {\n //Place the camera at the node\n this.getCamera().setLocation(cameraNode.getLocalTranslation().multLocal(1,0,1).add(0, 2, 0));\n cameraNode.lookAt(cam.getDirection().mult(999999), new Vector3f(0,1,0)); //Makes the gun point\n if (im.up) {\n cameraNode.move(getCamera().getDirection().mult(tpf).mult(10));\n }\n else if (im.down) {\n cameraNode.move(getCamera().getDirection().negate().mult(tpf).mult(10));\n }\n if (im.right) {\n cameraNode.move(getCamera().getLeft().negate().mult(tpf).mult(10));\n }\n else if (im.left) {\n cameraNode.move(getCamera().getLeft().mult(tpf).mult(10));\n }\n }", "public void panCenterTo(float x, float y) {\n \t\tLocation location = mapDisplay.pointLocation(x, y);\n \t\tpanCenterTo(location);\n \t}", "public void setupCamera() {\r\n p.camera(width/2.0f, height/2.0f, cameraZ,\r\n width/2.0f, height/2.0f, 0, 0, 1, 0);\r\n\r\n if(isTiling) {\r\n float mod=1f/10f;\r\n p.frustum(width*((float)tileX/(float)tileNum-.5f)*mod,\r\n width*((tileX+1)/(float)tileNum-.5f)*mod,\r\n height*((float)tileY/(float)tileNum-.5f)*mod,\r\n height*((tileY+1)/(float)tileNum-.5f)*mod,\r\n cameraZ*mod, 10000);\r\n }\r\n\r\n }", "public void panMapCoords(double dx, double dy){\n transform.translate(dx, dy);\n repaint();\n }", "public void translateX(float dx) {\r\n this.center.x += Math.cos(Math.toRadians(-rotation)) * dx;\r\n this.center.z += Math.sin(Math.toRadians(-rotation)) * dx;\r\n if (this.center.x > (this.boardWidth - ((this.boardWidth / 2f) * percentZoom))) {\r\n this.center.x = (this.boardWidth - ((this.boardWidth / 2f) * percentZoom));\r\n } else if (this.center.x < (this.boardWidth / 2f) * percentZoom) {\r\n this.center.x = (this.boardWidth / 2f) * percentZoom;\r\n }\r\n if (this.center.z > this.boardLength - ((this.boardLength / 2f) * percentZoom)) {\r\n this.center.z = this.boardLength - ((this.boardLength / 2f) * percentZoom);\r\n } else if (this.center.z < (this.boardLength / 2f) * percentZoom) {\r\n this.center.z = (this.boardLength / 2f) * percentZoom;\r\n }\r\n changed = true;\r\n }", "@Override\n protected int computeHorizontalScrollOffset() {\n return (int) -panX;\n }", "public Point worldToViewport(Point dst, Affine.Point src) {\n if (dst == null) {\n dst = new Point();\n }\n dst.x = worldToViewportX(src.x);\n dst.y = worldToViewportY(src.y);\n return dst;\n }", "public void panOriginDelta(double dx, double dy, boolean tweening) {\n \t\tfloat tx = (float) (mapDisplay.tx + (dx / mapDisplay.sc));\n \t\tfloat ty = (float) (mapDisplay.ty + (dy / mapDisplay.sc));\n \t\tsetPosition(tx, ty, tweening);\n \t}", "@Override\r\n\tpublic void translate(float vx, float vy) {\n\t\t\r\n\t}", "public void centerMapOnPoint(int targetX, int targetY) {\n\n int scaledWidth = (int) (TileDataRegister.TILE_WIDTH * scale);\n int scaledHeight = (int) (TileDataRegister.TILE_HEIGHT * scale);\n int baseX = (int) (map.getWidth() * TileDataRegister.TILE_WIDTH * scale) / 2;\n\n int x = baseX + (targetY - targetX) * scaledWidth / 2;\n x -= viewPortWidth * 0.5;\n int y = (targetY + targetX) * scaledHeight / 2;\n y -= viewPortHeight * 0.5;\n\n currentXOffset = -x;\n currentYOffset = -y;\n\n gameChanged = true;\n }", "public void calculatePanScale(float distanceX, float distanceY, float newScaleFactor){\n //Log.d(LOG_TAG, \"input = \" + distanceX + \":\" + distanceY + \":\" + newScaleFactor);\n int width = getWidth();\n int height = getHeight();\n //Log.d(LOG_TAG, \"view size = \" + width + \" x \" + height);\n\n scaleFactor *= newScaleFactor;\n // Don't let the object get too small or too large.\n scaleFactor = Math.max(minScale, Math.min(scaleFactor, maxScale));\n //Log.d(LOG_TAG, \"calculatePanScale: scale factor = \" + scaleFactor);\n\n scaledRightBound = rightBound * scaleFactor;\n scaledBottomBound = bottomBound * scaleFactor;\n //Log.d(LOG_TAG, \"calculatePanScale: scaledBounds \" + scaledRightBound + \":\" + scaledBottomBound);\n\n float maxPanX = -(scaledRightBound- width);\n float maxPanY = -(scaledBottomBound- height);\n //Log.d(LOG_TAG, \"calculatePanScale: maxPan \" + maxPanX + \":\" + maxPanY);\n\n panX = Math.min(0, Math.max(maxPanX,(panX - distanceX)));\n panY = Math.min(0, Math.max(maxPanY,(panY - distanceY)));\n //Log.d(LOG_TAG, \"calculatePanScale: Pan \" + panX + \":\" + panY);\n\n mainMatrix.setScale(scaleFactor, scaleFactor);\n mainMatrix.postTranslate(panX, panY);\n columnHeaderMatrix.setScale(scaleFactor, scaleFactor);\n columnHeaderMatrix.postTranslate(panX, 0);\n rowHeaderMatrix.setScale(scaleFactor, scaleFactor);\n rowHeaderMatrix.postTranslate(0, panY);\n cornerMatrix.setScale(scaleFactor, scaleFactor);\n\n invalidate();\n }", "public Point getCameraOffset() {\n Point offset = new Point(getPlayer().getCenterX() - screenWidthMiddle,\n getPlayer().getCenterY() - screenHeightMiddle);\n reboundCameraOffset(offset, EnumSet.of(Direction.LEFT, Direction.RIGHT));\n // we want to add these offsets to the player's x and y, so invert them\n offset.x = -offset.x;\n offset.y = -offset.y;\n return offset;\n }", "public final native void panBy(int x, int y) /*-{\n this.panBy(x, y);\n }-*/;", "@Override\n public boolean isTransforming() {\n return super.isTransforming() || desiredWorldPosition != null;\n }", "public void moveCam() {\n float x = this.cam_bind_x; //current pos the camera is binded to\n float y = this.cam_bind_y;\n\n //this amazing camera code is from: https://stackoverflow.com/questions/24047172/libgdx-camera-smooth-translation\n Vector3 target = new Vector3(x+MathUtils.cos(Global.m_angle)*20,y+MathUtils.sin(Global.m_angle)*20,0);\n final float speed = 0.1f, ispeed=1.0f-speed;\n\n Vector3 cameraPosition = cam.position;\n cameraPosition.scl(ispeed);\n target.scl(speed);\n cameraPosition.add(target);\n cam.position.set(cameraPosition);\n\n this.updateCam();\n\n }", "private boolean riftCoversCameraBounds(float cameraX, float cameraY, float maskWidth, float maskHeight,\r\n\t\t\t\t\t\t\t\t\t\t CharacterModel character) {\r\n\t\tupdateMaskPosition(maskWidth, maskHeight, character);\r\n\t\tboolean coversLeft = maskOrigin.x + maskOffset < cameraX;\r\n\t\tboolean coversRight = maskOrigin.x + maskWidth - maskOffset > cameraX + canvas.getWidth();\r\n\t\tboolean coversBottom = maskOrigin.y + maskOffset < cameraY;\r\n\t\tboolean coversTop = maskOrigin.y + maskHeight - maskOffset > cameraY + canvas.getHeight();\r\n\t\treturn coversLeft && coversRight && coversBottom && coversTop;\r\n\t}", "@Override\n public void translate(double x, double y) {\n graphicsEnvironmentImpl.translate(canvas, x, y);\n }", "@Override\r\n\tpublic void reshape(GLAutoDrawable drawable, int x, int y, int width, int height) {\n\t\tscreenWidth = width;\r\n\t\tscreenHeight = height;\r\n\r\n\t\tGL gl = drawable.getGL();\r\n\t\tgl.glMatrixMode(GL.GL_PROJECTION);\r\n\r\n\t\t// Clear current view\r\n\t\tgl.glLoadIdentity();\r\n\r\n\t\t// Set a basic perspective view (using a frustum):\r\n\t\tdouble frustumWidth = PROJECTION_LONG_EDGE / 2;\r\n\t\tdouble frustumHeight = PROJECTION_LONG_EDGE / 2;\r\n\t\tif (width < height) {\r\n\t\t\tfrustumWidth *= screenWidth / screenHeight;\r\n\t\t} else {\r\n\t\t\tfrustumHeight *= screenHeight / screenWidth;\r\n\t\t}\r\n\t\tgl.glFrustum(-frustumWidth, frustumWidth, -frustumHeight, frustumHeight, 1, 100);\r\n\t}", "public static void runFocusPoint() {\n //center map to current point\n point = getPoint(currentPoint);\n\n if (prevPoint[0] != point[0]) {\n if (prevPoint[0] > point[0]) {\n diff[0] = prevPoint[0] - point[0];\n prevPoint[0] -= FImageGrid.scrollIncrement;\n } else {\n diff[0] = point[0] - prevPoint[0];\n prevPoint[0] += FImageGrid.scrollIncrement;\n }\n }\n if (prevPoint[1] != point[1]) {\n diff[1] = prevPoint[1] - point[1];\n if (prevPoint[1] > point[1]) {\n diff[1] = prevPoint[1] - point[1];\n prevPoint[1] -= FImageGrid.scrollIncrement;\n } else {\n diff[1] = point[1] - prevPoint[1];\n prevPoint[1] += FImageGrid.scrollIncrement;\n }\n }\n if (diff[0] > 0 || diff[1] > 0) {\n diff[0] -= FImageGrid.scrollIncrement;\n diff[1] -= FImageGrid.scrollIncrement;\n if (diff[0] <= FImageGrid.scrollIncrement) {\n diff[0] = 0;\n prevPoint[0] = point[0];\n }\n if (diff[1] <= FImageGrid.scrollIncrement) {\n diff[1] = 0;\n prevPoint[1] = point[1];\n }\n //System.out.print(\"prev[\" + prevPoint[0] + \",\" + prevPoint[1] + \"] | \");\n //System.out.print(\"next[\" + point[0] + \",\" + point[1] + \"] | \");\n //System.out.println(\"diff[\" + diff[0] + \",\" + diff[1] + \"]\");\n centerMapTo(prevPoint[0] + transformCoordenate(mapPos, X_COORD),\n prevPoint[1] + transformCoordenate(mapPos, Y_COORD));\n } else {\n diff = new int[]{0, 0};\n if (currentPoint - 1 > 0) {\n prevPoint = getPoint(currentPoint - 1);\n } else {\n prevPoint = point;\n }\n centerMapTo(point[0] + transformCoordenate(mapPos, X_COORD),\n point[1] + transformCoordenate(mapPos, Y_COORD));\n }\n }", "public static void setCameraFrame() {\n\t\tCAMERA.src = VERTICES[CAMERA.v];\n\t\tVector zc = CAMERA.src.d.scale(-1).normalized();\n\t\tCAMERA.zAxis = zc;\n\t\tVector xc = MathUtils.cross(CAMERA.src.d, new Vector(0, 1, 0)).normalized();\n\t\tCAMERA.xAxis = xc;\n\t\tVector yc = MathUtils.cross(zc, xc).normalized();\n\t\tCAMERA.yAxis = yc;\n\t\t\n\t\tSystem.out.println(\"***** just set camera: \" + CAMERA.toString());\n\t}", "public void centerCameraOn(GameObject thing) {\r\n\t\tthis.cameraX = (int)(thing.getX() - Game.WIDTH / 2);\r\n\t\tthis.cameraY = (int) (thing.getY() - Game.HEIGHT / 2);\r\n\t}", "private boolean verifyBounds() {\r\n\t if((x>RobotController.BOUNDS_X || y>RobotController.BOUNDS_Y)\r\n\t || x<0 || y<0){\r\n\t return false;\r\n\t }\r\n\t return true;\r\n\t }", "public void translate(float x, float y);", "public boolean detectBound(){\n if(posX < 10){\n posX = 10;\n velX = 0;\n accX = 0;\n return true;\n }\n else if(posX > width - 10){\n posX = width - 10;\n velX = 0;\n accX = 0;\n return true;\n }\n if(posY < 10){\n posY = 10;\n velY = 0;\n accY = 0;\n return true;\n }\n else if(posY > height - 10){\n posY = height - 10;\n velY = 0;\n accY = 0;\n return true;\n }\n return false;\n }", "static void setViewPointRelevantTo(Point point) {\n point.translate(-1 * viewPoint.x, -1 * viewPoint.y);\n point.x /= Map.zoom;\n point.y /= Map.zoom;\n point.translate(viewPoint.x, viewPoint.y);\n viewPoint.setLocation(point.x - GAME_WIDTH / 2, point.y - GAME_HEIGHT / 2);\n verifyViewPoint();\n }", "private void inspectTranslateBounds(Matrix matrix) {\n int containerWidth = getWidth();\n int containerHeight = getHeight();\n\n // get drawable's bounds\n RectF bounds =\n MatrixHelper.getBounds(\n getDrawable().getIntrinsicWidth(),\n getDrawable().getIntrinsicHeight(),\n matrix);\n\n float dx = containerWidth - bounds.right;\n float dy = containerHeight - bounds.bottom;\n\n // don't let the drawable move out of screen\n if (bounds.width() > containerWidth) {\n if (bounds.left > 0) {\n matrix.postTranslate(-bounds.left, 0);\n } else if (dx > 0) {\n matrix.postTranslate(dx, 0);\n }\n } else {\n if (bounds.left < 0) {\n matrix.postTranslate(-bounds.left, 0);\n } else if (dx < 0) {\n matrix.postTranslate(dx, 0);\n }\n }\n if (bounds.height() > containerHeight) {\n if (bounds.top > 0) {\n matrix.postTranslate(0, -bounds.top);\n } else if (dy > 0) {\n matrix.postTranslate(0, dy);\n }\n } else {\n if (bounds.top < 0) {\n matrix.postTranslate(0, -bounds.top);\n } else if (dy < 0) {\n matrix.postTranslate(0, dy);\n }\n }\n }", "public void setCameraPos(CamPos in){\r\n\t\tresolveCamPos(in);\r\n\t\tpan_servo.setAngle(cur_pan_angle);\r\n\t\ttilt_servo.setAngle(cur_tilt_angle);\r\n\t\t\r\n\t\t\r\n\t}", "private int computeMoveCameraPadding() {\n \t\tPoint dim = this.getScreenDim();\n \t\tint min = Math.min( dim.x, dim.y );\n \t\treturn (int) (CAMERA_MOVE_BOUNDS_PADDING * min);\n \t}", "private void scrollCam( int tiles_per_cam_width ) {\r\n\t\tcamera[l()].position.x = left_map_scroll + tiles_per_cam_width/2;\r\n\t\tcamera[l()].update();\r\n\t\tcamera[r()].position.x = left_map_scroll - left_map_width \r\n\t\t\t\t+ tiles_per_cam_width/2;\r\n\t\tcamera[r()].update();\r\n\t}", "public void move() {\n\t\tx+= -1;\n\t\tif (x < 0) {\n\t\t\tx = (processing.width - 1);\n\t\t}\n\t\ty+= 1;\n\t\tif (y > processing.height-1)\n\t\t\ty=0;\n\t}", "public void handleCamera(){\n CameraIsScrolling = true;\n //if the camera is scrolling, scroll the camera\n if(CameraIsScrolling){\n mainCamera.position.set(mainCamera.position.x + CameraScrollSpeed, mainCamera.position.y, mainCamera.position.z);\n mainCamera.update();\n }\n\n }", "public void zoomToBounds(double ulLon, double ulLat, double lrLon, double lrLat)\n/* 116: */ {\n/* 117:182 */ int x_min = 2147483647;\n/* 118:183 */ int y_min = 2147483647;\n/* 119:184 */ int x_max = -2147483648;\n/* 120:185 */ int y_max = -2147483648;\n/* 121:186 */ int mapZoomMax = 20;\n/* 122: */\n/* 123:188 */ x_max = Math.max(x_max, MercatorProj.LonToX(lrLon, mapZoomMax));\n/* 124:189 */ x_max = Math.max(x_max, MercatorProj.LonToX(ulLon, mapZoomMax));\n/* 125:190 */ y_max = Math.max(y_max, MercatorProj.LatToY(ulLat, mapZoomMax));\n/* 126:191 */ y_max = Math.max(y_max, MercatorProj.LatToY(lrLat, mapZoomMax));\n/* 127:192 */ x_min = Math.min(x_min, MercatorProj.LonToX(ulLon, mapZoomMax));\n/* 128:193 */ x_min = Math.min(x_min, MercatorProj.LonToX(lrLon, mapZoomMax));\n/* 129:194 */ y_min = Math.min(y_min, MercatorProj.LatToY(ulLat, mapZoomMax));\n/* 130:195 */ y_min = Math.min(y_min, MercatorProj.LatToY(lrLat, mapZoomMax));\n/* 131: */\n/* 132: */\n/* 133: */\n/* 134:199 */ int height = Math.max(0, this.mapPanel.getHeight());\n/* 135:200 */ int width = Math.max(0, this.mapPanel.getWidth());\n/* 136:201 */ int newZoom = mapZoomMax;\n/* 137:202 */ int x = x_max - x_min;\n/* 138:203 */ int y = y_max - y_min;\n/* 139:204 */ while ((x > width) || (y > height))\n/* 140: */ {\n/* 141:205 */ newZoom--;\n/* 142:206 */ x >>= 1;\n/* 143:207 */ y >>= 1;\n/* 144: */ }\n/* 145:209 */ x = x_min + (x_max - x_min) / 2;\n/* 146:210 */ y = y_min + (y_max - y_min) / 2;\n/* 147:211 */ int z = 1 << mapZoomMax - newZoom;\n/* 148:212 */ x /= z;\n/* 149:213 */ y /= z;\n/* 150:214 */ this.mapPanel.setZoom(new Point(x, y), newZoom);\n/* 151: */ }", "public void correctPosition(Rectangle bounds) {\n\t\tif(!enabled())\n\t\t\treturn;\n\t\t\n\t\tbounds = Maths.wider(bounds, 20);\n\t\t\n\t\tif(!bounds.contains(renderX, track.getY())) {\n\t\t\trenderX = track.getX();\n\t\t}\n\t\tif(!bounds.contains(track.getX(), renderY)) {\n\t\t\trenderY = track.getY();\n\t\t}\n\t}", "public void translate(float theX, float theY) {\n\t}", "@Override\n public void onCameraIdle() {\n LatLng midLatLng = mMap.getCameraPosition().target;\n draggedMarker.setPosition(midLatLng);\n }", "public void setMove(float dx, float dy) {\n float dstWidth = src.right - src.left;\n float dstHeight = src.bottom - src.top;\n dst.left = src.left + dx > 0 ? 0 : (src.left + dx);\n dst.top = src.top + dy > 0 ? 0 : (src.top + dy);\n dst.right = dst.left + dstWidth;\n dst.bottom = dst.top + dstHeight;\n\n dst.right = dst.right < mapViewWidth ?\n mapViewWidth : dst.right;\n dst.bottom = dst.bottom < mapViewHeight ?\n mapViewHeight : dst.bottom;\n dst.left = dst.right - dstWidth;\n dst.top = dst.bottom - dstHeight;\n\n src = dst;\n setxZero();\n setyZero();\n Log.d(\"dxdy\", \"dx=\" + dx + \",dy=\" + dy);\n Log.d(\"setMove\", \"dst.left=\" + dst.left + \",dst.top=\" + dst.top + \",dst.right=\" + dst.right + \",dst.bottom=\" + dst.bottom);\n setChanged();\n notifyObservers();\n }", "public interface IPanStopListener {\n boolean panStop(float x, float y, int pointer, int button);\n}", "public Vector2 getCameraPosition()\n {\n\n Vector2 tmpVector = new Vector2(camera.position.x/camera.zoom - Gdx.graphics.getWidth()/2, camera.position.y/camera.zoom - Gdx.graphics.getHeight()/2);\n return tmpVector;\n }", "private void setCamera(GL2 gl, GLU glu)\n {\n Boundary bc = simulation.getBoundary();\n int w = (int) (bc.getMaxSize(0)-bc.getMinSize(0));\n int h = (int) (bc.getMaxSize(1)-bc.getMinSize(1));\n\n gl.glViewport(0, 0, w, h);\n\n\n gl.glMatrixMode(GL2.GL_PROJECTION);\n gl.glLoadIdentity();\n //opening angle, ratio of height and width, near and far\n glu.gluPerspective(80.0, 1,0.1,3*( bc.getMaxSize(2)-bc.getMinSize(2)));\n\n gl.glTranslatef(0.5f*(float) bc.getMinSize(0),-0.5f*(float) bc.getMinSize(1),1.5f*(float) bc.getMinSize(2));\n // gl.glTranslatef(0.5f*(float) (bc.getMaxSize(0)+bc.getMinSize(0)),0.5f*(float)(bc.getMaxSize(1)+ bc.getMinSize(1)),(float) -(bc.getMaxSize(2)-bc.getMinSize(2)));\n\n }", "private int getIsoX(int x, int y) {\n\t\tint rshift = (DEFAULT_VIEW_SIZE/2) - (TILE_WIDTH/2) + (x - y); //Pan camera to the right\n\t\treturn (x - y) * (TILE_WIDTH/2) + rshift;\n\t}", "private void setupCamera(GL gl) {\r\n\t\tgl.glMatrixMode(GL.GL_MODELVIEW);\r\n\t\t// If there's a rotation to make, do it before everything else\r\n\t\tgl.glLoadIdentity();\r\n if (rotationMatrix == null) {\r\n\t\t\trotationMatrix = new double[16];\r\n\t\t\tgl.glGetDoublev(GL.GL_MODELVIEW, rotationMatrix, 0);\r\n\t\t}\r\n\t\tif (nextRotationAxis != null) {\r\n\t\t\tgl.glRotated(nextRotationAngle, nextRotationAxis.x, nextRotationAxis.y, nextRotationAxis.z);\r\n\t\t\tnextRotationAngle = 0;\r\n\t\t\tnextRotationAxis = null;\r\n\t\t}\r\n\t\tgl.glMultMatrixd(rotationMatrix, 0);\r\n\t\tgl.glGetDoublev(GL.GL_MODELVIEW, rotationMatrix, 0);\r\n\t\t// Move the objects according to the camera (instead of moving the camera)\r\n\t\tif (zoom != 0) {\r\n\t\t\tdouble[] oldMatrix = new double[16];\r\n\t\t\tgl.glGetDoublev(GL.GL_MODELVIEW, oldMatrix, 0);\r\n\t\t\tgl.glLoadIdentity();\r\n\t\t\tgl.glTranslated(0, 0, zoom);\r\n\t\t\tgl.glMultMatrixd(oldMatrix, 0);\r\n\t\t}\r\n\t}", "public void translate(float dx, float dy) {\n float oldv = this.x;\n float newv = oldv + dx;\n if (dx < 0) {\n // moving leftward\n if (newv > oldv) {\n // negative overflow\n // Only adjust width if it was valid (>= 0).\n if (w >= 0) {\n // The right edge is now conceptually at\n // newv+width, but we may move newv to prevent\n // overflow. But we want the right edge to\n // remain at its new location in spite of the\n // clipping. Think of the following adjustment\n // conceptually the same as:\n // width += newv; newv = MIN_VALUE; width -= newv;\n w += newv - Float.MIN_VALUE;\n // width may go negative if the right edge went past\n // MIN_VALUE, but it cannot overflow since it cannot\n // have moved more than MIN_VALUE and any non-negative\n // number + MIN_VALUE does not overflow.\n }\n newv = Float.MIN_VALUE;\n }\n } else {\n // moving rightward (or staying still)\n if (newv < oldv) {\n // positive overflow\n if (w >= 0) {\n // Conceptually the same as:\n // width += newv; newv = MAX_VALUE; width -= newv;\n w += newv - Float.MAX_VALUE;\n // With large widths and large displacements\n // we may overflow so we need to check it.\n if (w < 0) w = Float.MAX_VALUE;\n }\n newv = Float.MAX_VALUE;\n }\n }\n this.x = newv;\n\n oldv = this.y;\n newv = oldv + dy;\n if (dy < 0) {\n // moving upward\n if (newv > oldv) {\n // negative overflow\n if (h >= 0) {\n h += newv - Float.MIN_VALUE;\n // See above comment about no overflow in this case\n }\n newv = Float.MIN_VALUE;\n }\n } else {\n // moving downward (or staying still)\n if (newv < oldv) {\n // positive overflow\n if (h >= 0) {\n h += newv - Float.MAX_VALUE;\n if (h < 0) h = Float.MAX_VALUE;\n }\n newv = Float.MAX_VALUE;\n }\n }\n this.y = newv;\n }", "public void set() {\n if(keyLeft&&keyRight||!keyLeft&&!keyRight){\n xspeed *=0.8;\n }\n else if(keyLeft&&!keyRight) {\n xspeed--;\n }\n else if(keyRight&&!keyLeft){\n xspeed++;\n }\n if (xspeed>0 && xspeed <0.75) xspeed=0;\n if (xspeed<0 && xspeed >-0.75) xspeed=0;\n\n if (xspeed>7) xspeed=7;\n if (xspeed<-7) xspeed=-7;\n\n if(keyUp) {\n hitBox.y++;\n for(Wall wall: panel.walls) {\n if(wall.hitBox.intersects(hitBox)){\n yspeed=-8;\n }\n }\n hitBox.y--;\n }\n\n if (yspeed < 8) yspeed += 0.3;\n\n //Horizontal collisons\n hitBox.x += xspeed;\n for(Wall wall: panel.walls) {\n if(hitBox.intersects(wall.hitBox)){ //if on floor\n hitBox.x -= xspeed;//Moves hitbox back to last place\n while(!wall.hitBox.intersects(hitBox)){\n hitBox.x += Math.signum(xspeed);\n }\n hitBox.x -= Math.signum(xspeed); //Moves hitbox to space next to the wall\n panel.cameraX += x - hitBox.x;\n xspeed = 0;\n hitBox.x = x;\n }\n }\n\n //Vertical collisions\n hitBox.y += yspeed;\n for(Wall wall: panel.walls) {\n if(hitBox.intersects(wall.hitBox)){\n hitBox.y -= yspeed;\n while(!wall.hitBox.intersects(hitBox)) hitBox.y += Math.signum(yspeed);\n hitBox.y -= Math.signum(yspeed);\n yspeed = 0;\n y = hitBox.y;\n }\n }\n\n panel.cameraX -= xspeed;\n y += yspeed;\n hitBox.x=x;\n hitBox.y=y;\n\n //Death\n if(y>MainFrame.FRAME_HEIGHT+100) panel.reset();\n }", "@NonNull\n @Override\n public PointF transformMeteringPoint(@NonNull PointF point) {\n final PointF referencePoint = new PointF(point.x, point.y);\n Size referenceSize = previewSize;\n\n // 1. Account for cropping.\n // This will enlarge the preview size so that aspect ratio matches.\n referenceSize = applyPreviewCropping(referenceSize, referencePoint);\n\n // 2. Scale to the preview stream coordinates.\n // This will move to the preview stream coordinates by scaling.\n referenceSize = applyPreviewScale(referenceSize, referencePoint);\n\n // 3. Rotate to the stream coordinate system.\n // This leaves us with sensor stream coordinates.\n referenceSize = applyPreviewToSensorRotation(referenceSize, referencePoint);\n\n // 4. Move to the crop region coordinate system.\n // The crop region is the union of all currently active streams.\n referenceSize = applyCropRegionCoordinates(referenceSize, referencePoint);\n\n // 5. Move to the active array coordinate system.\n referenceSize = applyActiveArrayCoordinates(referenceSize, referencePoint);\n LOG.i(\"input:\", point, \"output (before clipping):\", referencePoint);\n\n // 6. Probably not needed, but make sure we clip.\n if (referencePoint.x < 0) referencePoint.x = 0;\n if (referencePoint.y < 0) referencePoint.y = 0;\n if (referencePoint.x > referenceSize.getWidth()) referencePoint.x = referenceSize.getWidth();\n if (referencePoint.y > referenceSize.getHeight()) referencePoint.y = referenceSize.getHeight();\n LOG.i(\"input:\", point, \"output (after clipping):\", referencePoint);\n return referencePoint;\n }", "public void setPanX(double panX) {\n if(panX != mPanX) {\n mPanX = panX;\n setChanged();\n }\n }", "@Override\r\n\tpublic void mouseDragged(MouseEvent e) {\r\n\t\tif((e.getModifiersEx() & MouseEvent.BUTTON2_DOWN_MASK) != 0)\r\n\t\t{\r\n\t\t\t//for middle mouse button drags, pan across the scene\r\n\t\t\tVector temp = new Vector(new PointD(lastPointOnScreen), new PointD(e.getPoint()));\r\n\t\t\ttemp.setTail(worldCenter);\r\n\t\t\tworldCenter = temp.getHead();\r\n\t\t\tlastPointOnScreen = e.getPoint();\r\n\t\t}\r\n\t\telse if((e.getModifiersEx() & MouseEvent.BUTTON1_DOWN_MASK) != 0)\r\n\t\t{\r\n\t\t\t//for left mouse button drags, move closest vert.\r\n\t\t\tif(closestPointToCursor != null)\r\n\t\t\t{\r\n\t\t\t\tVector temp = new Vector(new PointD(lastPointOnScreen), new PointD(e.getPoint()));\r\n\t\t\t\ttemp.setTail(closestPointToCursor);\r\n\t\t\t\tclosestPointToCursor.set(temp.getHead());\r\n\t\t\t\tlastPointOnScreen = e.getPoint();\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t}", "public static void main(String[] args) {\n// Vector v1 = new Vector(new double[]{0, 0, 1});\n// Vector v2 = new Vector(new double[]{1, 0, 0});\n// System.out.println(v1.dot(v2));\n System.setProperty(\"sun.java2d.opengl\", \"true\");\n \n // Make World\n //WorldSpace world = new StreetWorldSpace();\n WorldSpace world = new TestWorldSpace();\n //WorldSpace world = new BigAssPolygonSpace();\n \n // Make Frame\n JFrame frame = new JFrame();\n \n // Get effective screen size\n Dimension screenSize = getScreenDimension(frame);\n\n // Set Camera View dimensions\n int width = 730;\n int height = width;\n \n // Make Camera\n Polygon[] polygons = world.getPolygons();\n Camera camera = new Camera(polygons, width, height, frame.getGraphicsConfiguration());\n image = camera.observe();\n \n // Make Camera Control Panel\n// int controlPanelHeight = 100;\n// CameraControlPanel cameraControlPanel = new CameraControlPanel(camera);\n// cameraControlPanel.setPreferredSize(new Dimension(width, controlPanelHeight));\n// cameraControlPanel.setBorder(BorderFactory.createCompoundBorder(new LineBorder(Color.BLACK, 2, false), new EmptyBorder(10, 10, 10, 10)));\n \n // Make Camera View Component\n CameraViewComponent cameraViewComponent = new CameraViewComponent(camera);\n cameraViewComponent.updateImage(image);\n cameraViewComponent.updateData(camera.getData());\n cameraViewComponent.setPreferredSize(new Dimension(width, height));\n\n // Make Camera Panel\n JPanel cameraPanel = new JPanel();\n cameraPanel.setLayout(new BoxLayout(cameraPanel, BoxLayout.Y_AXIS));\n cameraPanel.setPreferredSize(new Dimension(width, height));// + controlPanelHeight));\n cameraPanel.add(cameraViewComponent);\n //cameraPanel.add(cameraControlPanel);\n\n // Make Camera Data Panel\n //CameraDataPanel cameraDataPanel = new CameraDataPanel(camera);\n \n // Make Master Panel\n JPanel masterPanel = new JPanel();\n masterPanel.add(cameraPanel);\n //masterPanel.add(cameraDataPanel);\n \n frame.add(masterPanel);\n frame.pack();\n frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);\n frame.setVisible(true);\n\n // Make keyboard listener\n KeyListener kl = new KeyListener();\n \n // Time\n int lastTenthOfASecond = 0;\n double lastMilliSecond = 0;\n double currentMilliSecond = System.currentTimeMillis();\n double averageFrameRate = 0;\n double currentFrameRate = 0;\n long totalTime = 0;\n long totalFrames = 0;\n \n // Redraw camera view upon keyboard input\n while(true) { \n int currentTenthOfASecond = (int)((currentMilliSecond%1000)/100);\n if (currentMilliSecond/100 > lastMilliSecond/100) {\n boolean cameraMoved = false;\n if (kl.isWPressed()) {\n camera.move(FORWARD); \n cameraMoved = true;\n }\n if (kl.isSPressed()) {\n camera.move(BACKWARD); \n cameraMoved = true;\n }\n if (kl.isAPressed()) {\n camera.move(LEFT); \n cameraMoved = true;\n }\n if (kl.isDPressed()) {\n camera.move(RIGHT); \n cameraMoved = true;\n }\n if (kl.isSpacePressed()) {\n camera.move(UP); \n cameraMoved = true;\n }\n if (kl.isShiftPressed()) {\n camera.move(DOWN); \n cameraMoved = true;\n }\n if (cameraViewComponent.wasUpdated()) {\n cameraMoved = true;\n }\n// if (cameraControlPanel.getWasCameraChanged() || cameraViewComponent.wasUpdated()) {\n// cameraMoved = true;\n// }\n if (cameraMoved) {\n image = camera.observe();\n cameraViewComponent.updateImage(image);\n //cameraDataPanel.update();\n //cameraControlPanel.update(); \n totalFrames++;\n totalTime += currentMilliSecond-lastMilliSecond + 1;\n averageFrameRate = (totalFrames)/(totalTime/1000.0); \n currentFrameRate = (1000.0/(currentMilliSecond-lastMilliSecond));\n \n }\n }\n if (currentTenthOfASecond > lastTenthOfASecond) {\n \n String[] cameraData = camera.getData();\n String[] frameData = {\n \"Average Framerate: \" + String.format(\"%.2f\", averageFrameRate), \n \"Current Framerate: \" + String.format(\"%.2f\",currentFrameRate)\n };\n String[] data = new String[cameraData.length + frameData.length ];\n System.arraycopy(cameraData, 0, data, 0, cameraData.length);\n System.arraycopy(frameData, 0, data, cameraData.length, frameData.length);\n cameraViewComponent.updateData(data);\n } \n lastTenthOfASecond = currentTenthOfASecond;\n lastMilliSecond = currentMilliSecond;\n currentMilliSecond = System.currentTimeMillis(); \n }\n }", "public Affine.Point viewportToWorld(Affine.Point dst, Point src) {\n if (dst == null) {\n dst = new Affine.Point();\n }\n dst.x = viewportToWorldX(src.x);\n dst.y = viewportToWorldY(src.y);\n return dst;\n }", "protected void updateCameraPosition() {\n if (!mIsMapStatic && mMap != null && mMapConfiguration != null && mIsMapLoaded) {\n updateCameraPosition(mMapConfiguration.getCameraPosition());\n }\n }", "private void transformPoints() {\r\n\r\n\t\t// angle between x-axis and the line between start and goal\r\n//\t\tthis.angle = inverse_tan (slope)\r\n\t\tthis.angle = (int) Math.toDegrees(Math.atan2(goal.getY()-robot.getY(), goal.getX()-robot.getX()));\r\n\r\n\t\t// deviation of start point's x-axis from (0,0)\r\n\t\tthis.deviation = this.robot;\r\n\r\n\t\tthis.robot = new Robot(GA_PathPlanning.Transform(robot, -deviation.x, -deviation.y));\r\n\t\tthis.robot = new Robot(Rotate(robot, -angle));\r\n\t\t \r\n\t\tthis.goal = GA_PathPlanning.Transform(goal, -deviation.x, -deviation.y);\r\n\t\tthis.goal = GA_PathPlanning.Rotate(goal, -angle);\r\n\t\t\r\n\t\tfor(int i=0;i<obstacles.length;i++)\r\n\t\t{\r\n\t\t\tthis.obstacles[i]= new Obstacle(GA_PathPlanning.Transform(obstacles[i], -deviation.x, -deviation.y));\r\n\t\t\tthis.obstacles[i]= new Obstacle(GA_PathPlanning.Rotate(obstacles[i], -angle));\r\n\t\t}\r\n\t\t// make start point as (0,0)\r\n\t\t// transform xy-axis to axis of the straight line between start and goal\r\n\t\t\r\n\t\t\r\n\t}", "public void checkXAxis ()\n {\n if (player.getX() >= 599)\n {\n player.setLocation (0, player.getY());\n }\n else if (player.getX() <= 0)\n {\n player.setLocation (598, player.getY());\n }\n }", "private void moveTouch(float x, float y) {\n boolean updated = false;\n //Set boundaries\n int maxX = getMaxX();\n int maxY = getMaxY();\n\n\n if(Math.abs(x)>1) {\n if ((xPlacing) >= 0 && (maxX) <= displaySize.x) {\n if(xPlacing + x < 0){\n xPlacing = 0;\n } else if(xPlacing + getTotalWidth(blockSize)+x > displaySize.x){\n xPlacing = displaySize.x - getTotalWidth(blockSize);\n } else {\n xPlacing += x;\n }\n\n } else if(maxX >= displaySize.x && x <0){\n if(maxX + x < displaySize.x){\n xPlacing = displaySize.x - getTotalWidth(blockSize);\n } else {\n xPlacing += x;\n }\n } else if(xPlacing < 0 && x > 0){\n if(xPlacing + x > 0){\n xPlacing = 0;\n } else {\n xPlacing += x;\n }\n }\n updated = true;\n }\n\n if(Math.abs(y)>1){\n if(yPlacing >= 0 && maxY < displaySize.y){\n if(yPlacing + y < 0){\n yPlacing = 0;\n } else if(yPlacing + getTotalHeight(blockSize) + y > displaySize.y){\n yPlacing = displaySize.y - getTotalHeight(blockSize);\n } else {\n yPlacing += y;\n }\n } else if(maxY >= displaySize.y && y <0){\n if(maxY + y < displaySize.y){\n yPlacing = displaySize.y - getTotalHeight(blockSize);\n } else {\n yPlacing += y;\n }\n } else if(yPlacing < 0 && y > 0){\n if(yPlacing + y > 0){\n yPlacing = 0;\n } else {\n yPlacing += y;\n }\n }\n updated = true;\n }\n\n\n /*if(Math.abs(x) > 1) {\n if (xPlacing <= 100 && (xPlacing + x) <= 100) {\n xPlacing += x;\n updated = true;\n }\n }\n\n if(yPlacing <= 100 && (yPlacing+y)<=100 && Math.abs(y) > 1){\n yPlacing += y;\n updated = true;\n }*/\n\n\n /*if(xPlacing >100){\n xPlacing = 100;\n }\n if(yPlacing > 100) {\n yPlacing = 100;\n }*/\n\n if(updated){\n moved = true;\n invalidate();\n }\n\n /*float dx = Math.abs(x - mX);\n float dy = Math.abs(y - mY);\n if (dx >= TOLERANCE || dy >= TOLERANCE) {\n mPath.quadTo(mX, mY, (x + mX) / 2, (y + mY) / 2);\n mX = x;\n mY = y;\n }*/\n }", "public void translate(int x, int y);", "private static Activity moveInDirection(int x, int y) {\n return Activity.newBuilder()\n .addSubActivity(() -> {\n Position pos = Players.getLocal().getPosition();\n while(pos.isPositionWalkable()) {\n pos = pos.translate(x, y);\n }\n pos = pos.translate(-x, -y);\n while(!Movement.setWalkFlagWithConfirm(pos)) {\n pos = pos.translate(-x, -y);\n }\n Time.sleepUntil(() -> !Movement.isDestinationSet(), 1000 * 10);\n })\n .build();\n }", "public void centerScreen(int x, int y)\r\n {\r\n // Scaled parameters\r\n int width = View.WIDTH;\r\n int height = View.HEIGHT;\r\n int mapWidth = gameData.getMap().getWidth();\r\n int mapHeight = gameData.getMap().getHeight();\r\n\r\n xScreenOffset = x - width / 2;\r\n yScreenOffset = y - height / 2;\r\n\r\n // Limit Offset, so that the view never leaves the map\r\n if (xScreenOffset < 0)\r\n {\r\n xScreenOffset = 0;\r\n }\r\n if (xScreenOffset > mapWidth - width)\r\n {\r\n xScreenOffset = mapWidth - width;\r\n }\r\n if (yScreenOffset < 0)\r\n {\r\n yScreenOffset = 0;\r\n }\r\n if (yScreenOffset > mapHeight - height)\r\n {\r\n yScreenOffset = mapHeight - height;\r\n }\r\n }", "private void move() {\n\n if(currentPosition.getX() == -1 && currentPosition.getY() == -1) {\n System.out.println(\"Robot is not placed, yet.\");\n return;\n }\n\n Position.Direction direction = currentPosition.getDirection();\n int newX = -1;\n int newY = -1;\n switch (direction) {\n case EAST:\n newX = currentPosition.getX() + 1;\n newY = currentPosition.getY();\n break;\n case WEST:\n newX = currentPosition.getX() - 1;\n newY = currentPosition.getY();\n break;\n case NORTH:\n newX = currentPosition.getX();\n newY = currentPosition.getY() + 1;\n break;\n case SOUTH:\n newX = currentPosition.getX();\n newY = currentPosition.getY() - 1;\n break;\n }\n\n if(newX < lowerBound.getX() || newY < lowerBound.getY()\n || newX > upperBound.getX() || newY > upperBound.getY()) {\n System.out.println(\"Cannot move to \" + direction);\n return;\n }\n\n currentPosition.setX(newX);\n currentPosition.setY(newY);\n }" ]
[ "0.70061785", "0.6716039", "0.66990155", "0.66380274", "0.64787245", "0.6157305", "0.60979664", "0.5899116", "0.5883657", "0.5841495", "0.5824696", "0.5819426", "0.5810836", "0.5803291", "0.57847756", "0.5775908", "0.5727387", "0.56609565", "0.5609323", "0.557196", "0.5540527", "0.5517504", "0.55119884", "0.5463922", "0.5463532", "0.5447138", "0.54424334", "0.544226", "0.5419347", "0.5389874", "0.53837883", "0.5349554", "0.5326086", "0.5324384", "0.5293756", "0.52893376", "0.5280076", "0.52394164", "0.52356607", "0.5220229", "0.5218304", "0.5181422", "0.51702285", "0.5166179", "0.5159247", "0.5153408", "0.51274115", "0.50976634", "0.50874066", "0.5085775", "0.50750995", "0.5068738", "0.5058211", "0.50470465", "0.50462353", "0.5039322", "0.5028658", "0.5008305", "0.5007101", "0.500357", "0.49966177", "0.49957705", "0.498603", "0.49761087", "0.4972275", "0.4958886", "0.49471992", "0.49386147", "0.49370083", "0.49329203", "0.49242714", "0.4919529", "0.49069545", "0.49051148", "0.49043822", "0.49016562", "0.49005726", "0.48812208", "0.48594007", "0.4852547", "0.48496062", "0.48485205", "0.4846841", "0.48353058", "0.48318157", "0.48314783", "0.4815752", "0.48152158", "0.4808388", "0.48080358", "0.48071867", "0.4805869", "0.48042622", "0.48031324", "0.48004952", "0.47928178", "0.47900888", "0.47888795", "0.47818005", "0.4781237" ]
0.67861164
1
Translates the camera in all 3 dimensions. Does bounds checking.
@Override public void pan(Vector3 delta) { // keep camera within borders float x = Utils.between(viewCamera.position.x + delta.x, bounds.min.x, bounds.max.x); float y = Utils.between(viewCamera.position.y + delta.y, bounds.min.y, bounds.max.y); float z = Utils.between(viewCamera.position.z + delta.z, bounds.min.z, bounds.max.z); viewCamera.position.set(x, y, z); viewCamera.update(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private void updateCamera() {\n\t\tVector3f x = new Vector3f();\n\t\tVector3f y = new Vector3f();\n\t\tVector3f z = new Vector3f();\n\t\tVector3f temp = new Vector3f(this.mCenterOfProjection);\n\n\t\ttemp.sub(this.mLookAtPoint);\n\t\ttemp.normalize();\n\t\tz.set(temp);\n\n\t\ttemp.set(this.mUpVector);\n\t\ttemp.cross(temp, z);\n\t\ttemp.normalize();\n\t\tx.set(temp);\n\n\t\ty.cross(z, x);\n\n\t\tMatrix4f newMatrix = new Matrix4f();\n\t\tnewMatrix.setColumn(0, x.getX(), x.getY(), x.getZ(), 0);\n\t\tnewMatrix.setColumn(1, y.getX(), y.getY(), y.getZ(), 0);\n\t\tnewMatrix.setColumn(2, z.getX(), z.getY(), z.getZ(), 0);\n\t\tnewMatrix.setColumn(3, mCenterOfProjection.getX(),\n\t\t\t\tmCenterOfProjection.getY(), mCenterOfProjection.getZ(), 1);\n\t\ttry {\n\t\t\tnewMatrix.invert();\n\t\t\tthis.mCameraMatrix.set(newMatrix);\n\t\t} catch (SingularMatrixException exc) {\n\t\t\tLog.d(\"Camera\",\n\t\t\t\t\t\"SingularMatrixException on Matrix: \"\n\t\t\t\t\t\t\t+ newMatrix.toString());\n\t\t}\n\t}", "public void processCamera() {\n\t\tif (Mario.getX() > 300) {\n\t\t\tlevelCompound.move(-Mario.xVel, 0);\n\t\t\tPhysics.moveHitboxes(-Mario.xVel, 0);\n\t\t\tPhysics.moveEnemies(-Mario.xVel, 0);\n\t\t\tMario.setLocation(299, Mario.getY());\n\n\t\t\tlevelCompound.move(-3, 0);\n\t\t\tPhysics.moveHitboxes(-3, 0);\n\t\t\tPhysics.moveEnemies(-3, 0);\n\t\t}\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 void handleScreenBoundaries() {\n\t\tif (tiledMapHelper.getCamera().position.x < screenWidth / 2) {\n\t\t\ttiledMapHelper.getCamera().position.x = screenWidth / 2;\n\t\t}\n\t\tif (tiledMapHelper.getCamera().position.x >= tiledMapHelper.getWidth()\n\t\t\t\t- screenWidth / 2) {\n\t\t\ttiledMapHelper.getCamera().position.x = tiledMapHelper.getWidth()\n\t\t\t\t\t- screenWidth / 2;\n\t\t}\n\n\t\tif (tiledMapHelper.getCamera().position.y < screenHeight / 2) {\n\t\t\ttiledMapHelper.getCamera().position.y = screenHeight / 2;\n\t\t}\n\t\tif (tiledMapHelper.getCamera().position.y >= tiledMapHelper.getHeight()\n\t\t\t\t- screenHeight / 2) {\n\t\t\ttiledMapHelper.getCamera().position.y = tiledMapHelper.getHeight()\n\t\t\t\t\t- screenHeight / 2;\n\t\t}\n\t}", "private void inspectTranslateBounds(Matrix matrix) {\n int containerWidth = getWidth();\n int containerHeight = getHeight();\n\n // get drawable's bounds\n RectF bounds =\n MatrixHelper.getBounds(\n getDrawable().getIntrinsicWidth(),\n getDrawable().getIntrinsicHeight(),\n matrix);\n\n float dx = containerWidth - bounds.right;\n float dy = containerHeight - bounds.bottom;\n\n // don't let the drawable move out of screen\n if (bounds.width() > containerWidth) {\n if (bounds.left > 0) {\n matrix.postTranslate(-bounds.left, 0);\n } else if (dx > 0) {\n matrix.postTranslate(dx, 0);\n }\n } else {\n if (bounds.left < 0) {\n matrix.postTranslate(-bounds.left, 0);\n } else if (dx < 0) {\n matrix.postTranslate(dx, 0);\n }\n }\n if (bounds.height() > containerHeight) {\n if (bounds.top > 0) {\n matrix.postTranslate(0, -bounds.top);\n } else if (dy > 0) {\n matrix.postTranslate(0, dy);\n }\n } else {\n if (bounds.top < 0) {\n matrix.postTranslate(0, -bounds.top);\n } else if (dy < 0) {\n matrix.postTranslate(0, dy);\n }\n }\n }", "private void moveCameraToPosWithinBoardBounds(float x, float y) {\n // the camera position is the center coordinate of the displayed area --> cam.viewport.../2\n cam.position.x = MathUtils.clamp(x,\n cam.viewportWidth/2 - (cam.viewportWidth/2)*(1-getZoomFactor()),\n cam.viewportWidth/2 + (cam.viewportWidth/2)*(1-getZoomFactor()));\n cam.position.y = MathUtils.clamp(cam.viewportHeight-y,\n cam.viewportHeight/2 - (cam.viewportHeight/2)*(1-getZoomFactor()),\n cam.viewportHeight/2 + (cam.viewportHeight/2)*(1-getZoomFactor()));\n cam.update();\n }", "@Override\n\tpublic void pan(float x, float y, float z) {\n\t\t// keep camera within borders\n\t\tx = Utils.between(viewCamera.position.x + x, bounds.min.x, bounds.max.x);\n\t\ty = Utils.between(viewCamera.position.y + y, bounds.min.y, bounds.max.y);\n\t\tz = Utils.between(viewCamera.position.z + z, bounds.min.z, bounds.max.z);\n\t\tviewCamera.position.set(x, y, z);\n\t\tviewCamera.update();\n\t}", "private void pointCameraAt(Point3D target,Group root){\n for(Node node: root.getChildren()){\n node.setTranslateX(node.getTranslateX()-xOffset);\n node.setTranslateY(node.getTranslateY()-yOffset);\n node.setTranslateZ(node.getTranslateZ()-zOffset);\n }\n\n xOffset = -target.getX(); yOffset = -target.getY(); zOffset = -target.getZ();\n\n for(Node node: root.getChildren()){\n node.setTranslateX(node.getTranslateX()+xOffset);\n node.setTranslateY(node.getTranslateY()+yOffset);\n node.setTranslateZ(node.getTranslateZ()+zOffset);\n }\n }", "abstract void translate(double x, double y, double z);", "public void translateTransform(Vector3f trans) {\r\n\t\tm[0][0] = 1.0f; m[0][1] = 0.0f; m[0][2] = 0.0f; m[0][3] = trans.x;\r\n\t\tm[1][0] = 0.0f; m[1][1] = 1.0f; m[1][2] = 0.0f; m[1][3] = trans.y;\r\n\t\tm[2][0] = 0.0f; m[2][1] = 0.0f; m[2][2] = 1.0f; m[2][3] = trans.z;\r\n\t\tm[3][0] = 0.0f; m[3][1] = 0.0f; m[3][2] = 0.0f; m[3][3] = 1.0f;\r\n\r\n\t}", "@Override\n public boolean isTransforming() {\n return super.isTransforming() || desiredWorldPosition != null;\n }", "public void runProjectionMotion(){\n\t\tpos.setLocation(pos.getX() + vel[0]/5, pos.getY() - vel[1]/5);\r\n\t\tvel[1]-=gravity;\r\n\t}", "public void translate( Vector3f t )\n\t{\n\t\tMatrix4f opMat = new Matrix4f();\n\t\topMat.set( t );\n\t\tmat.mul( opMat );\n\t}", "private void moveCameraWithinBoardBounds(float deltaX, float deltaY) {\n // zoom factor is incorporated to make (absolute) camera movement slower when zoomed in\n // so it's always the same visual velocity\n float newX = cam.position.x - deltaX*getZoomFactor();\n float newY = cam.position.y + deltaY*getZoomFactor();\n moveCameraToPosWithinBoardBounds(newX, cam.viewportHeight-newY);\n }", "public void checkCameraLimits()\n {\n //Daca camera ar vrea sa mearga prea in stanga sau prea in dreapta (Analog si pe verticala) ea e oprita (practic cand se intampla acest lucru Itemul asupra caruia se incearca centrarea nu mai e in centrul camerei )\n\n if(xOffset < 0 )\n xOffset = 0;\n else if( xOffset > refLinks.GetMap().getWidth()* Tile.TILE_WIDTH - refLinks.GetWidth())\n xOffset =refLinks.GetMap().getWidth()* Tile.TILE_WIDTH - refLinks.GetWidth();\n if(yOffset<0)\n yOffset = 0;\n if(yOffset > refLinks.GetMap().getHeight()*Tile.TILE_HEIGHT - refLinks.GetHeight())\n {\n yOffset = refLinks.GetMap().getHeight()*Tile.TILE_HEIGHT - refLinks.GetHeight();\n }\n }", "public void translate( float x, float y, float z )\n\t{\n\t\tMatrix4f opMat = new Matrix4f();\n\t\topMat.set( new Vector3f( x, y, z ) );\n\t\tmat.mul( opMat );\n\t}", "@Override\n\tpublic void pan(Vector2 delta) {\n\t\t// keep camera within borders\n\t\tfloat x = Utils.between(viewCamera.position.x + delta.x, bounds.min.x, bounds.max.x);\n\t\tfloat y = Utils.between(viewCamera.position.y + delta.y, bounds.min.y, bounds.max.y);\n\t\tviewCamera.position.set(x, y, 0);\n\t\tviewCamera.update();\n\t}", "@Override\n\tpublic void resize(int width, int height) {\n\t\tviewCamera.viewportWidth = width;\n\t\tviewCamera.viewportHeight = height;\n\t\tviewCamera.position.set(0, 0, 0);\n\t\tviewCamera.update();\n\n\t\tVector3 min = MIN_BOUND.cpy();\n\t\tVector3 max = new Vector3(MAX_BOUND.x - width, MAX_BOUND.y - height, 0);\n\t\tviewCamera.project(min, 0, 0, width, height);\n\t\tviewCamera.project(max, 0, 0, width, height);\n\t\tbounds = new BoundingBox(min, max);\n\t\t// do a pan to reset camera position\n\t\tpan(min);\n\t}", "public final native Mat4 translate(double x, double y, double z) /*-{\n return $wnd.mat4.translate(this, [x, y, z]);\n }-*/;", "private void checkBoundaries() {\n Position moveTo = pos.copy();\n boolean move = false;\n float minZoom = getZoomToFit();\n float maxZoom = minZoom * 3;\n if (maxZoom < getZoomToFill()) maxZoom = getZoomToFill();\n \n if (pos.zoom < minZoom) {\n moveTo = new Position(minZoom, 0, 0);\n move = true;\n } else { \n if (pos.zoom > maxZoom) {\n moveTo.zoom = maxZoom;\n \n float viewXcenter = 0.5f * getWidth();\n float viewYcenter = 0.5f * getHeight();\n double centerXcontentBefore = getContentX(viewXcenter, pos);\n double centerYcontentBefore = getContentY(viewYcenter, pos);\n moveTo.x = (float) (viewXcenter - centerXcontentBefore * maxZoom - 0.5f * getWidth());\n moveTo.y = (float) (viewYcenter - centerYcontentBefore * maxZoom - 0.5f * getHeight());\n \n move = true;\n }\n \n RectF imageBounds = new RectF();\n float zoomedWidth = (flippedDimensions() ? contentWorkHeight : contentWorkWidth) * moveTo.zoom;\n float zoomedHeight = (flippedDimensions() ? contentWorkWidth : contentWorkHeight) * moveTo.zoom;\n imageBounds.left = -0.5f * zoomedWidth + moveTo.x;\n imageBounds.right = 0.5f * zoomedWidth + moveTo.x;\n imageBounds.top = -0.5f * zoomedHeight + moveTo.y;\n imageBounds.bottom = 0.5f * zoomedHeight + moveTo.y;\n \n if (debug) Log.w(TAG, \"checkBoundaries() current image bounds: \" + imageBounds.left + \"x\" + imageBounds.top + \" -> \" + imageBounds.right + \"x\" + imageBounds.bottom);\n \n // adjust offset to fit in boundaries\n RectF offsetBounds = new RectF();\n if (imageBounds.width() - getWidth() > 0) {\n offsetBounds.left = -0.5f * (imageBounds.width() - getWidth());\n offsetBounds.right = 0.5f * (imageBounds.width() - getWidth());\n }\n if (imageBounds.height() - getHeight() > 0) {\n offsetBounds.top = -0.5f * (imageBounds.height() - getHeight());\n offsetBounds.bottom = 0.5f * (imageBounds.height() - getHeight());\n }\n if (imageBounds.centerX() < offsetBounds.left) { \n moveTo.x = offsetBounds.left; \n move = true;\n } else if (imageBounds.centerX() > offsetBounds.right) {\n moveTo.x = offsetBounds.right;\n move = true;\n } \n \n if (imageBounds.centerY() < offsetBounds.top) { \n moveTo.y = offsetBounds.top; \n move = true; \n } else if (imageBounds.centerY() > offsetBounds.bottom) { \n moveTo.y = offsetBounds.bottom; \n move = true; \n }\n }\n \n if (move) {\n final Position finalMoveTo = moveTo;\n move(new Move() {\n Position startPos = new Position(pos);\n Position toPos = finalMoveTo;\n long durationMs = 200;\n public boolean handleMove(Position result, long currentTime, long startedAt) {\n if (currentTime - startedAt > durationMs) {\n result.set(toPos);\n return false;\n }\n \n double remainingProgress = 1.0 - (1.0 * (currentTime - startedAt) / durationMs);\n result.zoom = (float) (toPos.zoom + (startPos.zoom - toPos.zoom) * remainingProgress); \n result.x = (float) (toPos.x + (startPos.x - toPos.x) * remainingProgress);\n result.y = (float) (toPos.y + (startPos.y - toPos.y) * remainingProgress);\n return true;\n }\n });\n }\n if (debug) Log.i(TAG, \"checkBoundaries() \" + (move ? \"moveTo: \" + moveTo : \"ok\"));\n \n }", "private void adjustCameraPosition() {\n if (upward) {\n\n if (tilt<90) {\n tilt ++;\n zoom-=0.01f;\n } else {\n upward=false;\n }\n\n } else {\n if (tilt>0) {\n tilt --;\n zoom+=0.01f;\n } else {\n upward=true;\n }\n }\n }", "public void cameraTransform(Vector3f targ, Vector3f up) {\r\n\t\t// First normalize the target\r\n\t\tVector3f n = targ;\r\n\t\tn.normalize();\r\n\t\t// Then normalize the up vector\r\n\t\tVector3f u = up;\r\n\t\tu.normalize();\r\n\t\t// Then cross the two together to get the right vector\r\n\t\tu = u.cross(n);\r\n\t\tVector3f v = n.cross(u);\r\n\r\n\t\t// Finally build a matrix from the result\r\n\t\tm[0][0] = u.x; m[0][1] = u.y; m[0][2] = u.z; m[0][3] = 0.0f;\r\n\t\tm[1][0] = v.x; m[1][1] = v.y; m[1][2] = v.z; m[1][3] = 0.0f;\r\n\t\tm[2][0] = n.x; m[2][1] = n.y; m[2][2] = n.z; m[2][3] = 0.0f;\r\n\t\tm[3][0] = 0.0f; m[3][1] = 0.0f; m[3][2] = 0.0f; m[3][3] = 1.0f;\r\n\r\n\t}", "public void updateMvpMatrix()\n\t\t{\n\t\t\t// Set the matrix, specifying the edges of the visible canvas and the near and far clipping planes.\n\t\t\tMatrix.orthoM(mvpMatrix, 0,\n\t\t\t\t\t-viewportWidth / (2f * zoom) + cameraX,\n\t\t\t\t\tviewportWidth / (2f * zoom) + cameraX,\n\t\t\t\t\t-viewportHeight / (2f * zoom) + cameraY,\n\t\t\t\t\tviewportHeight / (2f * zoom) + cameraY, -1, 1);\n\t\t}", "@Override\n\tpublic void moveCamera() {\n\n\t}", "public void translate(float x, float y);", "@Override\r\n\tpublic void translate(float vx, float vy) {\n\t\t\r\n\t}", "@Override\n\tpublic void update(){\n\t\tif(!isPositionValid())\n\t\t\tescape();\n\t\tdouble dx = velocity.x * speed;\n\t\tdouble dy = velocity.y * speed;\n\t\tprojectedCenter.setLocation(center.x + dx, center.y + dy);\n\t\t//check other ball collisions\n\t\tboolean aloneFlag = true;\n\t\tfor(Ball other : Game.gameField.getBalls()){\n\t\t\tif(other == this)\n\t\t\t\tcontinue;\n\t\t\tcheckCollision(other);\n\t\t\tif(quadrant.equals(other.getQuadrant())){\n\t\t\t\taloneFlag = false;\n\t\t\t}\n\t\t}\n\t\tisAlone = aloneFlag;\n\t\t//check wall collisions\n\t\tfor(Wall wall : Game.gameField.getWalls()){\n\t\t\twall.checkCollision(this, projectedCenter);\n\t\t}\n\t\t//check boundary collisions\n\t\tGame.gameField.checkBoundaryCollision(this, projectedCenter);\n\t\t//collisions may have changed the velocity vector\n\t\tdx = velocity.x * speed;\n\t\tdy = velocity.y * speed;\n\t\tmove(dx, dy);\n\t\t//check if the move is valid, if not move back\n\t\tif(!isPositionValid()){\n\t\t\tmove(-dx, -dy);\n\t\t}\n\t\tquadrant = Calculations.getQuadrant(center, Game.gameField.getWalls());\n\t}", "private boolean riftCoversCameraBounds(float cameraX, float cameraY, float maskWidth, float maskHeight,\r\n\t\t\t\t\t\t\t\t\t\t CharacterModel character) {\r\n\t\tupdateMaskPosition(maskWidth, maskHeight, character);\r\n\t\tboolean coversLeft = maskOrigin.x + maskOffset < cameraX;\r\n\t\tboolean coversRight = maskOrigin.x + maskWidth - maskOffset > cameraX + canvas.getWidth();\r\n\t\tboolean coversBottom = maskOrigin.y + maskOffset < cameraY;\r\n\t\tboolean coversTop = maskOrigin.y + maskHeight - maskOffset > cameraY + canvas.getHeight();\r\n\t\treturn coversLeft && coversRight && coversBottom && coversTop;\r\n\t}", "public void onBoundsResolved()\n {\n updateTransform();\n }", "public interface Camera extends GameObject {\n\n public static final byte FORWARDS = 0x0;\n public static final byte LEFT = 0x1;\n public static final byte BACKWARDS = 0x2;\n public static final byte RIGHT = 0x3;\n\n /**\n * The default camera controls.\n */\n public static final byte[] DEFAULT_CAMERA_CONTROLLER = {\n Keys.KEY_W, Keys.KEY_A, Keys.KEY_S, Keys.KEY_D\n };\n\n /**\n * @return the position of the <code>Camera</code> in the world\n */\n public abstract ReadableVector3f getPosition();\n\n /**\n * @param deltaX the change along the X axis\n * @param deltaY the change along the Y axis\n * @param deltaZ the change along the Z axis\n */\n public abstract void translate(float deltaX, float deltaY, float deltaZ);\n\n public abstract void translate(ReadableVector3f delta);\n\n /**\n * @param position the new position of the <code>Camera</code>\n */\n public abstract void setPosition(ReadableVector3f position);\n}", "public void applyTransform() {\n\t\tglRotatef(xaxisrot, 1.0f, 0.0f, 0.0f);\n\t\tglRotatef(yaxisrot, 0.0f, 1.0f, 0.0f);\n\t\tglRotatef(tilt, 0.0f, 0.0f, 1.0f);\n\t\tglTranslatef(-pos.geti(), -pos.getj(), -pos.getk());\n\t}", "public void keyPressed(KeyEvent evt) {\n Vector3f translate = new Vector3f();\n Vector3f transball = new Vector3f();\n \n plane_trans.get( translate ); \n ball_trans.get( transball ); \n \n if (evt.getKeyChar()=='a') {\n Transform3D rotate = new Transform3D();\n rotate.rotY(Math.PI/36.0d);\n plane_trans.mul(rotate);\n \n //transball.x += 0.4f;\n \n \n \n }\n if (evt.getKeyChar()=='d') {\n Transform3D rotate = new Transform3D();\n rotate.rotY(-Math.PI/36.0d);\n plane_trans.mul(rotate);\n //transball.x -= 0.3f;\n }\n \n /*if (evt.getKeyChar()=='s') {\n Transform3D rotate = new Transform3D();\n rotate.rotX(-Math.PI/36.0d);\n plane_trans.mul(rotate);\n transball.y += 0.5f;\n }*/\n \n /*if (evt.getKeyChar()=='w') {\n Transform3D rotate = new Transform3D();\n rotate.rotX(Math.PI/36.0d);\n plane_trans.mul(rotate);\n transball.y -= 0.4f;\n \n }*/\n \n if (evt.getKeyChar()=='i') {\n //transball.x = 0.0f;\n //transball.y = -3.00f;\n //transball.z = 0.3f;\n plane_trans.set(new Vector3f(0.0f, 1.5f, 9985.0f));\n \n Transform3D rotate = new Transform3D();\n rotate.rotX(-Math.PI/3.0d);\n plane_trans.mul(rotate);\n }\n \n if(evt.getKeyChar()=='l'){\n stime = 2000;\n movement();\n \n \n }\n \n // (-5,5) (-5,-4) (5,-4) (5,5)\n // x varies from -5 to 5\n // y varies from 5 to -4\n \n /*if(transball.x< -5 || transball.x>5){\n transball.x = 0.0f;\n transball.y = -3.00f;\n }\n if(transball.y < -4 || transball.y>5){\n transball.x = 0.0f;\n transball.y = -3.00f;\n }*/\n \n \n //ball_trans.setTranslation( transball );\n //ballTG.setTransform(ball_trans);\n \n plane_trans.setTranslation( translate );\n planeTG.setTransform(plane_trans);\n \n // make a rectangle and usse its four coordinates to check where the ball is in the area or outside\n // resetball();\n \n \n \n }", "public void translate(float x, float y){\n hitBox.offset(x, y);\n }", "public Point[] transformPosition(Point[] objectPosition, double fieldWidth, double fieldHeight) {\n\t\t// Set field center point from sizes.\n\t\tthis.center.set(new double[] { fieldWidth/2, fieldHeight/2 });\n\t\t\n\t\t// Find centroid - geometric center of car.\n\t\tPoint carCenter = this.findCenter(objectPosition);\n\n\t\t// Find length of line between center and perceived location.\n\t\tdouble UV = this.lineLength(carCenter, center);\n\t\tdouble TV = sourceHeight;\n\t\t\n\t\t// Find the angle from the camera to the perceived location.\n\t\tdouble theta = Math.atan2(UV, TV);\n\t\t\n\t\t// Calculate error from perceived location and actual z-location.\n\t\tdouble AC = objHeight;\n\t\tdouble BC = Math.tan(theta) * AC;\n\t\t\n\t\t// Find length from center to z-axis transformed car location.\n\t\tdouble newLength = UV - BC;\n\t\t\n\t\t// Move coordinate system to move center to origo.\n\t\tPoint[] transformedObjectPosition = Arrays.copyOf(\n\t\t\tthis.transformCoordinateSystem(objectPosition, this.center),\n\t\t\tobjectPosition.length\n\t\t);\n\t\t\n\t\t// Create scalar and relocate the location of object (perceived loc / actual loc).\n\t\tdouble scalar = newLength / UV;\n\t\tfor(int i = 0; i < transformedObjectPosition.length; i++) {\n\t\t\ttransformedObjectPosition[i].set(new double[] {\n\t\t\t\ttransformedObjectPosition[i].x * scalar,\n\t\t\t\ttransformedObjectPosition[i].y * scalar\t\t\t\t\t\n\t\t\t});\n\t\t}\n\t\t\n\t\t// Return to old coordinate system.\n\t\ttransformedObjectPosition = this.inverseTransformCoordinateSystem(transformedObjectPosition, this.center);\n\t\t\n\t\t// Find center of triangle\n\t\tPoint objectCenter = this.findCenter(new MatOfPoint2f(transformedObjectPosition));\n\t\t\n\t\t// Transform to coordinate system with triangle center as origo.\n\t\ttransformedObjectPosition = this.transformCoordinateSystem(transformedObjectPosition, objectCenter);\n\t\t\n\t\t// Scale according to real-life factors\n\t\tfor(int i = 0; i < transformedObjectPosition.length; i++) {\n\t\t\ttransformedObjectPosition[i].set(new double[] {\n\t\t\t\ttransformedObjectPosition[i].x * Config.Client.triangleScale,\n\t\t\t\ttransformedObjectPosition[i].y * Config.Client.triangleScale\n\t\t\t});\n\t\t}\n\t\t\n\t\t// Return the inverse trasnform result.\n\t\treturn this.inverseTransformCoordinateSystem(transformedObjectPosition, objectCenter);\n\t}", "private void updateBounds(final float[] values) {\n if (getDrawable() != null) {\n mBounds.set(values[Matrix.MTRANS_X],\n values[Matrix.MTRANS_Y],\n getDrawable().getIntrinsicWidth() * values[Matrix.MSCALE_X] + values[Matrix.MTRANS_X],\n getDrawable().getIntrinsicHeight() * values[Matrix.MSCALE_Y] + values[Matrix.MTRANS_Y]);\n }\n }", "public void translate( float x, float y )\n\t{\n\t\tMatrix4f opMat = new Matrix4f();\n\t\topMat.set( new Vector3f( x, y, 0 ) );\n\t\tmat.mul( opMat );\n\t}", "public void translate(float x, float y, float z) {\n Matrix.translateM(mModelMatrix, 0, x, y, z);\n }", "private float[] getTranslationVector(float centerX, float centerY,\n int bitmapXLength, int bitmapYLength,\n float constant){\n return new float[]{\n -(centerX * constant) + (bitmapXLength/2),\n -(centerY * constant) + (bitmapYLength/2)\n };\n }", "private void updateTransform() {\n Matrix matrix = new Matrix();\n float centerX = dataBinding.viewFinder.getWidth() / 2f;\n float centerY = dataBinding.viewFinder.getHeight() / 2f;\n int rotation = dataBinding.viewFinder.getDisplay().getRotation();\n int rotationDegrees = 0;\n switch (rotation) {\n case Surface.ROTATION_0:\n rotationDegrees = 0;\n break;\n case Surface.ROTATION_90:\n rotationDegrees = 90;\n break;\n case Surface.ROTATION_180:\n rotationDegrees = 180;\n break;\n case Surface.ROTATION_270:\n rotationDegrees = 270;\n break;\n default:\n }\n matrix.postRotate(-rotationDegrees, centerX, centerY);\n }", "private void setCamera() {\n\t\tVector viewTranslation = controller.getCameraPosition();\n\n\t\tGL11.glClear(GL11.GL_COLOR_BUFFER_BIT | GL11.GL_DEPTH_BUFFER_BIT);\n\t\tGL11.glMatrixMode(GL11.GL_PROJECTION);\n\t\tGL11.glLoadIdentity();\n\n\t\tfloat whRatio = (float) windowWidth / (float) windowHeight;\n\t\tGLU.gluPerspective(controller.getFOV(), whRatio, 1, 100000);\n\t\tGLU.gluLookAt((float) viewTranslation.x, (float) viewTranslation.y,\n\t\t\t\t(float) controller.getCameraDistance(), (float) viewTranslation.x,\n\t\t\t\t(float) viewTranslation.y, 0, 0, 1, 0);\n\n\t\tGL11.glMatrixMode(GL11.GL_MODELVIEW);\n\t\tGL11.glLoadIdentity();\n\t}", "private void calculateMatrices() {\n viewMatrix = new Matrix();\n clipRect = null;\n\n float actualWidth = gameModel.actualWidth = getWidth();\n float actualHeight = gameModel.actualHeight = getHeight();\n float virtualWidth = gameModel.getWidth();\n float virtualHeight = gameModel.getHeight();\n\n float scale = Math.max(virtualWidth / actualWidth, virtualHeight / actualHeight);\n if (scale < 0.99 || scale > 1.01) {\n viewMatrix.postScale(1f / scale, 1f / scale);\n\n float extraW = actualWidth * scale - virtualWidth;\n float extraH = actualHeight * scale - virtualHeight;\n\n if (extraW > 1f || extraH > 1f) {\n viewMatrix.postTranslate(extraW / scale / 2f, extraH / scale / 2f);\n clipRect = new RectF(0, 0, virtualWidth, virtualHeight);\n }\n }\n\n // Invert the view matrix, to obtain a matrix that can be used for translating\n // touch events back to virtual coordinates.\n touchMatrix = new Matrix(viewMatrix);\n touchMatrix.invert(touchMatrix);\n }", "private double translateX( double xRaw )\r\n {\r\n double x = xRaw;\r\n \r\n // Zoom\r\n x = x * zoomFactor;\r\n \r\n // Shift\r\n x = x - viewMinX;\r\n \r\n // Center\r\n double cShift = (getWidth()/2) - ((viewMaxX-viewMinX)/2);\r\n x = x + cShift;\r\n \r\n return x;\r\n }", "private static void verifyViewPoint() {\n if (viewPoint.x < 0)\n viewPoint.x = 0;\n if (viewPoint.y < 0)\n viewPoint.y = 0;\n if (viewPoint.x > map.WIDTH - GAME_WIDTH * zoom)\n viewPoint.x = map.WIDTH - ((int) (GAME_WIDTH * zoom));\n if (viewPoint.y > map.HEIGHT - GAME_HEIGHT * zoom)\n viewPoint.y = map.HEIGHT - ((int) (GAME_HEIGHT * zoom));\n }", "public static void main(String[] args) {\n// Vector v1 = new Vector(new double[]{0, 0, 1});\n// Vector v2 = new Vector(new double[]{1, 0, 0});\n// System.out.println(v1.dot(v2));\n System.setProperty(\"sun.java2d.opengl\", \"true\");\n \n // Make World\n //WorldSpace world = new StreetWorldSpace();\n WorldSpace world = new TestWorldSpace();\n //WorldSpace world = new BigAssPolygonSpace();\n \n // Make Frame\n JFrame frame = new JFrame();\n \n // Get effective screen size\n Dimension screenSize = getScreenDimension(frame);\n\n // Set Camera View dimensions\n int width = 730;\n int height = width;\n \n // Make Camera\n Polygon[] polygons = world.getPolygons();\n Camera camera = new Camera(polygons, width, height, frame.getGraphicsConfiguration());\n image = camera.observe();\n \n // Make Camera Control Panel\n// int controlPanelHeight = 100;\n// CameraControlPanel cameraControlPanel = new CameraControlPanel(camera);\n// cameraControlPanel.setPreferredSize(new Dimension(width, controlPanelHeight));\n// cameraControlPanel.setBorder(BorderFactory.createCompoundBorder(new LineBorder(Color.BLACK, 2, false), new EmptyBorder(10, 10, 10, 10)));\n \n // Make Camera View Component\n CameraViewComponent cameraViewComponent = new CameraViewComponent(camera);\n cameraViewComponent.updateImage(image);\n cameraViewComponent.updateData(camera.getData());\n cameraViewComponent.setPreferredSize(new Dimension(width, height));\n\n // Make Camera Panel\n JPanel cameraPanel = new JPanel();\n cameraPanel.setLayout(new BoxLayout(cameraPanel, BoxLayout.Y_AXIS));\n cameraPanel.setPreferredSize(new Dimension(width, height));// + controlPanelHeight));\n cameraPanel.add(cameraViewComponent);\n //cameraPanel.add(cameraControlPanel);\n\n // Make Camera Data Panel\n //CameraDataPanel cameraDataPanel = new CameraDataPanel(camera);\n \n // Make Master Panel\n JPanel masterPanel = new JPanel();\n masterPanel.add(cameraPanel);\n //masterPanel.add(cameraDataPanel);\n \n frame.add(masterPanel);\n frame.pack();\n frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);\n frame.setVisible(true);\n\n // Make keyboard listener\n KeyListener kl = new KeyListener();\n \n // Time\n int lastTenthOfASecond = 0;\n double lastMilliSecond = 0;\n double currentMilliSecond = System.currentTimeMillis();\n double averageFrameRate = 0;\n double currentFrameRate = 0;\n long totalTime = 0;\n long totalFrames = 0;\n \n // Redraw camera view upon keyboard input\n while(true) { \n int currentTenthOfASecond = (int)((currentMilliSecond%1000)/100);\n if (currentMilliSecond/100 > lastMilliSecond/100) {\n boolean cameraMoved = false;\n if (kl.isWPressed()) {\n camera.move(FORWARD); \n cameraMoved = true;\n }\n if (kl.isSPressed()) {\n camera.move(BACKWARD); \n cameraMoved = true;\n }\n if (kl.isAPressed()) {\n camera.move(LEFT); \n cameraMoved = true;\n }\n if (kl.isDPressed()) {\n camera.move(RIGHT); \n cameraMoved = true;\n }\n if (kl.isSpacePressed()) {\n camera.move(UP); \n cameraMoved = true;\n }\n if (kl.isShiftPressed()) {\n camera.move(DOWN); \n cameraMoved = true;\n }\n if (cameraViewComponent.wasUpdated()) {\n cameraMoved = true;\n }\n// if (cameraControlPanel.getWasCameraChanged() || cameraViewComponent.wasUpdated()) {\n// cameraMoved = true;\n// }\n if (cameraMoved) {\n image = camera.observe();\n cameraViewComponent.updateImage(image);\n //cameraDataPanel.update();\n //cameraControlPanel.update(); \n totalFrames++;\n totalTime += currentMilliSecond-lastMilliSecond + 1;\n averageFrameRate = (totalFrames)/(totalTime/1000.0); \n currentFrameRate = (1000.0/(currentMilliSecond-lastMilliSecond));\n \n }\n }\n if (currentTenthOfASecond > lastTenthOfASecond) {\n \n String[] cameraData = camera.getData();\n String[] frameData = {\n \"Average Framerate: \" + String.format(\"%.2f\", averageFrameRate), \n \"Current Framerate: \" + String.format(\"%.2f\",currentFrameRate)\n };\n String[] data = new String[cameraData.length + frameData.length ];\n System.arraycopy(cameraData, 0, data, 0, cameraData.length);\n System.arraycopy(frameData, 0, data, cameraData.length, frameData.length);\n cameraViewComponent.updateData(data);\n } \n lastTenthOfASecond = currentTenthOfASecond;\n lastMilliSecond = currentMilliSecond;\n currentMilliSecond = System.currentTimeMillis(); \n }\n }", "private Dimension calculateTranslate() {\n \t\n \tint maxx=50;\n \tint minx=0;\n \tint maxy=50;\n \tint miny=0;\n \t\n \tVector v=Selector.getInstance().getAllEntitiesOnPanel();\n \tfor (int i=0; i<v.size(); i++) {\n \t\tEntity e =(Entity)v.elementAt(i);\n \t\tmaxx=Math.max(maxx,e.getX()+e.getWidth()+20);\n \t\tmaxy=Math.max(maxy,e.getY()+e.getHeight()+20);\n \t\tminx=Math.min(minx,e.getX()-20);\n \t\tminy=Math.min(miny,e.getY()-20);\n \t}\n \treturn new Dimension(minx,miny);\n }", "public Vector3f getTranslationVec() {\n\t\treturn m_xforms[NvCameraXformType.MAIN].m_translate;\n\t}", "public void centerCameraOn(GameObject thing) {\r\n\t\tthis.cameraX = (int)(thing.getX() - Game.WIDTH / 2);\r\n\t\tthis.cameraY = (int) (thing.getY() - Game.HEIGHT / 2);\r\n\t}", "private void updateRotated() {\r\n\r\n\tfor (int n = 0; n < npoints * 3; n += 3) {\r\n\r\n\t // take the linear sum of local co-ords with local\r\n\t // unit vectors and then translate by adding the local\r\n\t // origin's co-ords\r\n\t ps[n] = locals[n] * i[0] + locals[n + 1] * j[0] + locals[n + 2] * k[0];\r\n\t ps[n + 1] = locals[n] * i[1] + locals[n + 1] * j[1] + locals[n + 2] * k[1];\r\n\t ps[n + 2] = locals[n] * i[2] + locals[n + 1] * j[2] + locals[n + 2] * k[2];\r\n\r\n\t ps[n] += p[0];\r\n\t ps[n + 1] += p[1];\r\n\t ps[n + 2] += p[2];\r\n\t}\r\n\r\n\t// reset bounding box and clear dirty flags\r\n\tbox.setBB();\r\n\tdirtyR = false;\r\n\tdirtyT = false;\r\n\r\n\t// normals must be reset\r\n\tthis.setNormals();\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\t_roll = roll;\r\n }", "public void updateTransformMatrix(float[] fArr) {\n boolean z;\n float f;\n float f2;\n boolean z2 = true;\n if (!this.mVideoStabilizationCropped || !ModuleManager.isVideoModule()) {\n f2 = 1.0f;\n f = 1.0f;\n z = false;\n } else {\n f2 = MOVIE_SOLID_CROPPED_X * 1.0f;\n f = MOVIE_SOLID_CROPPED_Y * 1.0f;\n z = true;\n }\n if (this.mNeedCropped) {\n f2 *= this.mScaleX;\n f *= this.mScaleY;\n z = true;\n }\n if (this.mDisplayOrientation == 0) {\n z2 = z;\n }\n if (z2) {\n Matrix.translateM(fArr, 0, 0.5f, 0.5f, 0.0f);\n Matrix.rotateM(fArr, 0, (float) this.mDisplayOrientation, 0.0f, 0.0f, 1.0f);\n Matrix.scaleM(fArr, 0, f2, f, 1.0f);\n Matrix.translateM(fArr, 0, -0.5f, -0.5f, 0.0f);\n }\n }", "public void translate(float theX, float theY) {\n\t}", "private void fixView(final float newX, final float newY) {\n final float x = this.worldView.getX();\n final float y = this.worldView.getY();\n final float scale = this.worldView.getScale();\n final int width = this.worldView.getMasterImage().getWidth();\n final int height = this.worldView.getMasterImage().getHeight();\n\n float updatedX = Math.max(0, newX);\n float updatedY = Math.max(0, newY);\n\n\n if (width * scale + x > width) {\n updatedX = width - (width * scale);\n }\n if (height * scale + y > height) {\n updatedY = height - (height * scale);\n }\n\n this.worldView.setX(updatedX);\n this.worldView.setY(updatedY);\n\n }", "public void apply() {\n\t\tglTranslated(0, 0, -centerDistance);\n\t\tglRotated(pitch, 1, 0, 0);\n\t\tglRotated(yaw, 0, 0, 1);\n\t\tglScaled(scale, scale, scale);\n\n\t\tglTranslated(-pos.get(0), -pos.get(1), -pos.get(2));\n\t}", "private void translate(final double w, final double h, final double z) {\n mesh.setTranslation(0, w / 2, h / 2 + z);\n }", "public void updateTransform() {\n \t\tif (viewBox != null) {\n \t\t\tOMSVGRect bbox = ((SVGRectElement)viewBox.getElement()).getBBox();\n //\t\t\tGWT.log(\"bbox = \" + bbox.getDescription());\n \t\t\tfloat d = (float)Math.sqrt((bbox.getWidth() * bbox.getWidth() + bbox.getHeight() * bbox.getHeight()) * 0.25) * scale * 2;\n //\t\t\tGWT.log(\"d = \" + d);\n \t\t\n \t\t\t// Compute the actual canvas size. It is the max of the window rect\n \t\t\t// and the transformed bbox.\n \t\t\tfloat width = Math.max(d, windowRect.getWidth());\n \t\t\tfloat height = Math.max(d, windowRect.getHeight());\n //\t\t\tGWT.log(\"width = \" + width);\n //\t\t\tGWT.log(\"height = \" + height);\n \n \t\t\t// Compute the display transform to center the image in the\n \t\t\t// canvas\n \t\t\tOMSVGMatrix m = svg.createSVGMatrix();\n \t\t\tfloat cx = bbox.getCenterX();\n \t\t\tfloat cy = bbox.getCenterY();\n \t\t\tm = m.translate(0.5f * (width - bbox.getWidth()) -bbox.getX(), 0.5f * (height - bbox.getHeight()) -bbox.getY())\n \t\t\t.translate(cx, cy)\n \t\t\t.rotate(angle)\n \t\t\t.scale(scale)\n \t\t\t.translate(-cx, -cy);\n \t\t\t((ISVGTransformable)xformGroup).getTransform().getBaseVal().getItem(0).setMatrix(m);\n \t\t\t((ISVGTransformable)modelGroup.getTwinWrapper()).getTransform().getBaseVal().getItem(0).setMatrix(m);\n //\t\t\tGWT.log(\"m=\" + m.getDescription());\n \t\t\tsvg.getStyle().setWidth(width, Unit.PX);\n \t\t\tsvg.getStyle().setHeight(height, Unit.PX);\n \t\t}\n \t}", "private void setCamera(GL2 gl, GLU glu)\n {\n Boundary bc = simulation.getBoundary();\n int w = (int) (bc.getMaxSize(0)-bc.getMinSize(0));\n int h = (int) (bc.getMaxSize(1)-bc.getMinSize(1));\n\n gl.glViewport(0, 0, w, h);\n\n\n gl.glMatrixMode(GL2.GL_PROJECTION);\n gl.glLoadIdentity();\n //opening angle, ratio of height and width, near and far\n glu.gluPerspective(80.0, 1,0.1,3*( bc.getMaxSize(2)-bc.getMinSize(2)));\n\n gl.glTranslatef(0.5f*(float) bc.getMinSize(0),-0.5f*(float) bc.getMinSize(1),1.5f*(float) bc.getMinSize(2));\n // gl.glTranslatef(0.5f*(float) (bc.getMaxSize(0)+bc.getMinSize(0)),0.5f*(float)(bc.getMaxSize(1)+ bc.getMinSize(1)),(float) -(bc.getMaxSize(2)-bc.getMinSize(2)));\n\n }", "public final void glTranslatef(final float x, final float y, final float z) {\n matrixTrans[0+4*3] = x;\n matrixTrans[1+4*3] = y;\n matrixTrans[2+4*3] = z;\n glMultMatrixf(matrixTrans, 0);\n }", "public void checkWorldCollisions(Bounds bounds) {\n final boolean atRightBorder = getShape().getLayoutX() >= (bounds.getMaxX() - RADIUS);\n final boolean atLeftBorder = getShape().getLayoutX() <= RADIUS;\n final boolean atBottomBorder = getShape().getLayoutY() >= (bounds.getMaxY() - RADIUS);\n final boolean atTopBorder = getShape().getLayoutY() <= RADIUS;\n final double padding = 1.00;\n\n if (atRightBorder) {\n getShape().setLayoutX(bounds.getMaxX() - (RADIUS * padding));\n velX *= frictionX;\n velX *= -1;\n }\n if (atLeftBorder) {\n getShape().setLayoutX(RADIUS * padding);\n velX *= frictionX;\n velX *= -1;\n }\n if (atBottomBorder) {\n velY *= -1;\n velY *= frictionY;\n getShape().setLayoutY(bounds.getMaxY() - (RADIUS * padding));\n }\n if (atTopBorder) {\n velY *= -1;\n velY *= frictionY;\n getShape().setLayoutY(RADIUS * padding);\n }\n }", "private void initCamera(SubScene scene, Group root){\n //Create a perspective camera for 3D use and add it to the scene.\n PerspectiveCamera camera = new PerspectiveCamera(true);\n scene.setCamera(camera);\n\n //Set the camera's field of view, near and far pane, and starting zoom.\n camera.setFieldOfView(80);\n camera.setNearClip(1);\n camera.setFarClip(5000);\n camera.setTranslateZ(-1000);\n\n //Initiate the rotation objects used for rotating the camera about the world.\n Rotate xRotate = new Rotate(0, Rotate.X_AXIS);\n Rotate yRotate = new Rotate(0, Rotate.Y_AXIS);\n root.getTransforms().addAll(xRotate, yRotate);\n\n //Bind the property so it automatically updates.\n xRotate.angleProperty().bind(angleX);\n yRotate.angleProperty().bind(angleY);\n\n //Add an event listener to track the start of a mouse drag when the mouse is clicked.\n scene.setOnMousePressed(event -> {\n dragStartX = event.getSceneX();\n dragStartY = event.getSceneY();\n anchorAngleX = angleX.get();\n anchorAngleY = angleY.get();\n });\n\n //Add an event listener to update the rotation objects based on the distance dragged.\n scene.setOnMouseDragged(event -> {\n //A modifier (0.2 in this case) is used to control the sensitivity.\n Double newAngleX = anchorAngleX - (dragStartY - event.getSceneY())*0.2;\n //Restrict the rotation to angles less than 90.\n if(newAngleX > 90){\n angleX.set(90);\n //Restrict the rotation to angles greater than 5.\n } else if (newAngleX < 5){\n angleX.set(5);\n } else {\n angleX.set(newAngleX);\n }\n angleY.set(anchorAngleY + (dragStartX - event.getSceneX())*0.2);\n });\n\n //Add an event listener to move the camera away or towards the scene using the mouse wheel.\n scene.setOnScroll(event -> {\n Double delta = event.getDeltaY();\n //If the mouse scrolls in, and the camera is not too close, then move the camera closer.\n if(delta > 0 && camera.getTranslateZ() <= -100){\n camera.setTranslateZ(camera.getTranslateZ()*0.975);\n //Else, if the mouse scrolls out and it's not too far away, then move the camera away.\n } else if(delta <0 && camera.getTranslateZ() >= -3000){\n camera.setTranslateZ(camera.getTranslateZ()* 1/0.975);\n }\n });\n }", "private void reboundCameraOffset(Point offset, EnumSet<Direction> directions) {\n int boundsStartX = 0;\n int boundsEndX = tileMap.getPixelWidth();\n int boundsStartY = 0;\n int boundsEndY = tileMap.getPixelHeight();\n if (offset.x < boundsStartX && directions.contains(Direction.LEFT)) {\n offset.x = boundsStartX;\n } else if (offset.x + screenWidth > boundsEndX && directions.contains(Direction.RIGHT)) {\n offset.x = boundsEndX - screenWidth;\n }\n if (offset.y < boundsStartY && directions.contains(Direction.UP)) {\n offset.y = boundsStartY;\n } else if (offset.y + screenHeight > boundsEndY && directions.contains(Direction.DOWN)) {\n offset.y = boundsEndY - screenHeight;\n }\n }", "public abstract Vector4fc normalize3();", "public\n Projection project ( double x , double y , double z , ClampMode clampModeOutside , boolean extrudeInverted ) {\n boolean outsideFrustum;\n if ( this.viewport == null || this.modelview == null || this.projection == null )\n return new Projection ( 0.0 , 0.0 , Projection.Type.FAIL );\n Vector3D posVec = new Vector3D ( x , y , z );\n boolean[] frustum = this.doFrustumCheck ( this.frustum , this.frustumPos , x , y , z );\n boolean bl = outsideFrustum = frustum[0] || frustum[1] || frustum[2] || frustum[3];\n if ( outsideFrustum ) {\n boolean outsideInvertedFrustum;\n boolean opposite = posVec.sub ( this.frustumPos ).dot ( this.viewVec ) <= 0.0;\n boolean[] invFrustum = this.doFrustumCheck ( this.invFrustum , this.frustumPos , x , y , z );\n boolean bl2 = outsideInvertedFrustum = invFrustum[0] || invFrustum[1] || invFrustum[2] || invFrustum[3];\n if ( extrudeInverted && ! outsideInvertedFrustum || outsideInvertedFrustum && clampModeOutside != ClampMode.NONE ) {\n if ( extrudeInverted && ! outsideInvertedFrustum || clampModeOutside == ClampMode.DIRECT && outsideInvertedFrustum ) {\n double vecX = 0.0;\n double vecY = 0.0;\n if ( ! GLU.gluProject ( (float) x , (float) y , (float) z , this.modelview , this.projection , this.viewport , this.coords ) )\n return new Projection ( 0.0 , 0.0 , Projection.Type.FAIL );\n if ( opposite ) {\n vecX = this.displayWidth * this.widthScale - (double) this.coords.get ( 0 ) * this.widthScale - this.displayWidth * this.widthScale / 2.0;\n vecY = this.displayHeight * this.heightScale - ( this.displayHeight - (double) this.coords.get ( 1 ) ) * this.heightScale - this.displayHeight * this.heightScale / 2.0;\n } else {\n vecX = (double) this.coords.get ( 0 ) * this.widthScale - this.displayWidth * this.widthScale / 2.0;\n vecY = ( this.displayHeight - (double) this.coords.get ( 1 ) ) * this.heightScale - this.displayHeight * this.heightScale / 2.0;\n }\n Vector3D vec = new Vector3D ( vecX , vecY , 0.0 ).snormalize ( );\n vecX = vec.x;\n vecY = vec.y;\n Line vectorLine = new Line ( this.displayWidth * this.widthScale / 2.0 , this.displayHeight * this.heightScale / 2.0 , 0.0 , vecX , vecY , 0.0 );\n double angle = Math.toDegrees ( Math.acos ( vec.y / Math.sqrt ( vec.x * vec.x + vec.y * vec.y ) ) );\n if ( vecX < 0.0 ) {\n angle = 360.0 - angle;\n }\n Vector3D intersect = new Vector3D ( 0.0 , 0.0 , 0.0 );\n intersect = angle >= this.bra && angle < this.tra ? this.rb.intersect ( vectorLine ) : ( angle >= this.tra && angle < this.tla ? this.tb.intersect ( vectorLine ) : ( angle >= this.tla && angle < this.bla ? this.lb.intersect ( vectorLine ) : this.bb.intersect ( vectorLine ) ) );\n return new Projection ( intersect.x , intersect.y , outsideInvertedFrustum ? Projection.Type.OUTSIDE : Projection.Type.INVERTED );\n }\n if ( clampModeOutside != ClampMode.ORTHOGONAL || ! outsideInvertedFrustum )\n return new Projection ( 0.0 , 0.0 , Projection.Type.FAIL );\n if ( ! GLU.gluProject ( (float) x , (float) y , (float) z , this.modelview , this.projection , this.viewport , this.coords ) )\n return new Projection ( 0.0 , 0.0 , Projection.Type.FAIL );\n double guiX = (double) this.coords.get ( 0 ) * this.widthScale;\n double guiY = ( this.displayHeight - (double) this.coords.get ( 1 ) ) * this.heightScale;\n if ( opposite ) {\n guiX = this.displayWidth * this.widthScale - guiX;\n guiY = this.displayHeight * this.heightScale - guiY;\n }\n if ( guiX < 0.0 ) {\n guiX = 0.0;\n } else if ( guiX > this.displayWidth * this.widthScale ) {\n guiX = this.displayWidth * this.widthScale;\n }\n if ( guiY < 0.0 ) {\n guiY = 0.0;\n return new Projection ( guiX , guiY , outsideInvertedFrustum ? Projection.Type.OUTSIDE : Projection.Type.INVERTED );\n } else {\n if ( ! ( guiY > this.displayHeight * this.heightScale ) )\n return new Projection ( guiX , guiY , outsideInvertedFrustum ? Projection.Type.OUTSIDE : Projection.Type.INVERTED );\n guiY = this.displayHeight * this.heightScale;\n }\n return new Projection ( guiX , guiY , outsideInvertedFrustum ? Projection.Type.OUTSIDE : Projection.Type.INVERTED );\n }\n if ( ! GLU.gluProject ( (float) x , (float) y , (float) z , this.modelview , this.projection , this.viewport , this.coords ) )\n return new Projection ( 0.0 , 0.0 , Projection.Type.FAIL );\n double guiX = (double) this.coords.get ( 0 ) * this.widthScale;\n double guiY = ( this.displayHeight - (double) this.coords.get ( 1 ) ) * this.heightScale;\n if ( ! opposite )\n return new Projection ( guiX , guiY , outsideInvertedFrustum ? Projection.Type.OUTSIDE : Projection.Type.INVERTED );\n guiX = this.displayWidth * this.widthScale - guiX;\n guiY = this.displayHeight * this.heightScale - guiY;\n return new Projection ( guiX , guiY , outsideInvertedFrustum ? Projection.Type.OUTSIDE : Projection.Type.INVERTED );\n }\n if ( ! GLU.gluProject ( (float) x , (float) y , (float) z , this.modelview , this.projection , this.viewport , this.coords ) )\n return new Projection ( 0.0 , 0.0 , Projection.Type.FAIL );\n double guiX = (double) this.coords.get ( 0 ) * this.widthScale;\n double guiY = ( this.displayHeight - (double) this.coords.get ( 1 ) ) * this.heightScale;\n return new Projection ( guiX , guiY , Projection.Type.INSIDE );\n }", "public void transform() {\n final var bounds = getParentBounds();\n transform( bounds.width, bounds.height );\n }", "private void moveCamera(float tpf) {\n //Place the camera at the node\n this.getCamera().setLocation(cameraNode.getLocalTranslation().multLocal(1,0,1).add(0, 2, 0));\n cameraNode.lookAt(cam.getDirection().mult(999999), new Vector3f(0,1,0)); //Makes the gun point\n if (im.up) {\n cameraNode.move(getCamera().getDirection().mult(tpf).mult(10));\n }\n else if (im.down) {\n cameraNode.move(getCamera().getDirection().negate().mult(tpf).mult(10));\n }\n if (im.right) {\n cameraNode.move(getCamera().getLeft().negate().mult(tpf).mult(10));\n }\n else if (im.left) {\n cameraNode.move(getCamera().getLeft().mult(tpf).mult(10));\n }\n }", "public void setTransform(Rectangle view, Rectangle2D limits) {\n this.view = view;\n\t\tRectangle2D.Double lim = (Rectangle2D.Double)limits.clone();\n xUnit = (view.width/(lim.width - lim.x));\n yUnit = (view.height/(lim.height - lim.y));\n \n if (xUnit > yUnit){\n\t\t\txUnit = yUnit;\n\t\t\tlim.width = ((view.width/xUnit) + lim.x);\n }else{\n\t\t\tyUnit = xUnit;\n\t\t\tlim.height = ((view.height/yUnit) + lim.y);\n }\n\t\t\n aux.setToIdentity();\n transform.setToIdentity();\n aux.translate(lim.x, lim.y);\n transform.concatenate(aux);\n aux.setToIdentity();\n aux.scale(1/xUnit, -1/yUnit);\n transform.concatenate(aux);\n aux.setToIdentity();\n aux.translate(0, (-1) * (view.height - 1));\n transform.concatenate(aux);\n try {\n inverse = transform.createInverse();\n \t}catch (Exception e){\n\t\t\tSystem.out.println(\"Unable to create inverse trasform\");\n\t\t}\n\t\t\n this.limits = limits;\n\t\t\n }", "@Override\n public void applySurfaceParams(SurfaceParams[] params) {\n RectF newAppBounds = new RectF(mAppBounds);\n params[0].matrix.mapRect(newAppBounds);\n Assert.assertThat(newAppBounds, new AlmostSame(mAppBounds));\n\n System.err.println(\"Bounds mapped: \" + mAppBounds + \" => \" + newAppBounds);\n }", "protected void applyMatrices () {\n combinedMatrix.set(projectionMatrix).mul(transformMatrix);\n getShader().setUniformMatrix(\"u_projTrans\", combinedMatrix);\n }", "private void updateTranslationfromCenterAnchor(Pose pose, int teapotId) {\n float poseX = pose.tx();\n float poseZ = pose.tz();\n\n float anchorPoseX = globalCenterPose.tx();\n float anchorPoseZ = globalCenterPose.tz();\n\n float[] translate = new float[3];\n\n if (poseX > anchorPoseX) {\n translate[0] = poseX - anchorPoseX;\n } else {\n translate[0] = -(anchorPoseX - poseX);\n }\n\n if (poseZ > anchorPoseZ) {\n translate[2] = poseZ - anchorPoseZ;\n } else {\n translate[2] = -(anchorPoseZ - poseZ);\n }\n\n teapotTranslations[teapotId] = translate;\n }", "public void translate(double x, double y, double z){\n \n \tMatrix trans = new Matrix();\n \ttrans.identity();\n \ttrans.set(1,4,x);\n \ttrans.set(2,4,y);\n \ttrans.set(3,4,x);\n \tthis.leftMultiply(trans);\n\n /* this doesn't work yet\n this.temp.identity();\n temp.set(1,4,x);\n temp.set(2,4,y);\n temp.set(3,4,x);\n this.leftMultiply(temp); */\n }", "@Override\r\n protected Matrix4f genViewMatrix() {\r\n\r\n // refreshes the position\r\n position = calcPosition();\r\n\r\n // calculate the camera's coordinate system\r\n Vector3f[] coordSys = genCoordSystem(position.subtract(center));\r\n Vector3f right, up, forward;\r\n forward = coordSys[0];\r\n right = coordSys[1];\r\n up = coordSys[2];\r\n\r\n // we move the world, not the camera\r\n Vector3f position = this.position.negate();\r\n\r\n return genViewMatrix(forward, right, up, position);\r\n }", "public void translate(int x, int y);", "protected void updateCameraPosition() {\n if (!mIsMapStatic && mMap != null && mMapConfiguration != null && mIsMapLoaded) {\n updateCameraPosition(mMapConfiguration.getCameraPosition());\n }\n }", "private void applyTransform() {\n GlStateManager.rotate(180, 1.0F, 0.0F, 0.0F);\n GlStateManager.translate(offsetX, offsetY - 26, offsetZ);\n }", "public void update(List<Player> players) {\n float playersMinX = Integer.MAX_VALUE;\n float playersMaxX = Integer.MIN_VALUE;\n float playersMinY = Integer.MAX_VALUE;\n float playersMaxY = Integer.MIN_VALUE;\n\n for (Player p : players) {\n playersMinX = Math.min(p.damsel.pos.x, playersMinX);\n playersMaxX = Math.max(p.damsel.pos.x, playersMaxX);\n playersMinY = Math.min(p.damsel.pos.y, playersMinY);\n playersMaxY = Math.max(p.damsel.pos.y + p.damsel.pos.z, playersMaxY);\n }\n\n // Offset to account for the player size (we want the players to be fully encompassed by the camera)\n playersMinX -= players.get(0).damsel.getVisualWidth() / 2;\n playersMaxX += players.get(0).damsel.getVisualWidth() / 2;\n playersMinY -= players.get(0).damsel.shadow.getHeight();\n playersMaxY += players.get(0).damsel.getVisualHeight() + players.get(0).damsel.shadow.getHeight() / 2;\n\n float deltaX = playersMaxX - playersMinX;\n float deltaY = playersMaxY - playersMinY;\n\n float ratio = Math.max(Math.max(deltaX / (float)Gdx.graphics.getWidth(), deltaY / (float)Gdx.graphics.getHeight()), 1);\n lastRatio = lastRatio * 0.9f + ratio * 0.1f;\n lastX = lastX * 0.9f + (playersMinX + deltaX / 2) * 0.1f;\n lastY = lastY * 0.9f + (playersMinY + deltaY / 2) * 0.1f;\n ratio = lastRatio;\n\n float transformedWidth = Gdx.graphics.getWidth() * ratio;\n float transformedHeight = Gdx.graphics.getHeight() * ratio;\n\n innerCamera.setToOrtho(false,\n transformedWidth,\n transformedHeight\n );\n innerCamera.translate(\n Math.round(lastX - transformedWidth / 2),\n Math.round(lastY - transformedHeight / 2)\n );\n\n innerCamera.update();\n }", "public BoundingBox3d transform(SpaceTransformer transformers) {\n return new BoundingBox3d(transformers.getX().compute(xmin), transformers.getX().compute(xmax),\n transformers.getY().compute(ymin), transformers.getY().compute(ymax),\n transformers.getZ().compute(zmin), transformers.getZ().compute(zmax));\n }", "public boolean translateSpace( int x, int y )\n\t{\n\t\tboolean success = false;\n\t\t\n\t\t// If translation is horizontal\n\t\tif ( x != 0 )\n\t\t{\n\t\t\tif ( x > 0 && x0 < 2) // Translate right, can't if x0 > 1\n\t\t\t{\n\t\t\t\tgrid[x0][y0] = grid[x0+1][y0];\n\t\t\t\tgrid[x0+1][y0] = 0;\n\t\t\t\t\n\t\t\t\tx0 = x0+1;\n\t\t\t\tsuccess = true;\n\t\t\t}\n\t\t\telse if ( x < 0 && x0 > 0 ) // Translate left, can't if x0 < 1\n\t\t\t{\n\t\t\t\tgrid[x0][y0] = grid[x0-1][y0];\n\t\t\t\tgrid[x0-1][y0] = 0;\n\t\t\t\t\n\t\t\t\tx0 = x0-1;\n\t\t\t\tsuccess = true;\n\t\t\t}\n\t\t} // If translation is vertical\n\t\telse if ( y != 0 ) // Can't translate diagonal, so if x != 0, then y wont be translated no matter\n\t\t{\t\t\t\t // what it is, and visa versa\n\t\t\tif ( y > 0 && y0 < 2) // Translate down, can't if y0 > 1\n\t\t\t{\n\t\t\t\tgrid[x0][y0] = grid[x0][y0+1];\n\t\t\t\tgrid[x0][y0+1] = 0;\n\t\t\t\t\n\t\t\t\ty0 = y0+1;\n\t\t\t\tsuccess = true;\n\t\t\t}\n\t\t\telse if ( y < 0 && y0 > 0 ) // Translate up, cant if y0 < 1\n\t\t\t{\n\t\t\t\tgrid[x0][y0] = grid[x0][y0-1];\n\t\t\t\tgrid[x0][y0-1] = 0;\n\t\t\t\t\n\t\t\t\ty0 = y0-1;\n\t\t\t\tsuccess = true;\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn success;\n\t}", "private void transformation(GL gl)\n {\n\t\t// Make X axis face forward, Y right, Z up\n\t\t// (map ZXY to XYZ)\n\t\tgl.glRotated(-90, 1, 0, 0);\n\t\tgl.glRotated(-90, 0, 0, 1);\n\t \n\t\tif (drawBugView.value) {\n\t\t // ---- \"Bug cam\" transformation (for mainBug)\n\t\t\t// this is the inverse of the M transformation that places the bug in the scene (based on mainbug pos and vel)\n double angle = Math.atan2(mainBug.vel.y, mainBug.vel.x);\n \t\tgl.glRotated(Math.toDegrees(Math.PI - angle), 0, 0, 1);\n \t\t\n \t\t//drawing a bit above the z axis so we can see the ground\n\t\t\tgl.glTranslated(-mainBug.pos.x, -mainBug.pos.y, -mainBug.pos.z-0.2);\n\t\t} else {\n\t\t // ---- Ordinary scene transformation\n\t\n\t\t // Move camera back so that scene is visible\n\t\t gl.glTranslated(-20, 0, 0);\n\t\t \n\t\t // Translate by Zoom/Horiz/Vert\n\t\t gl.glTranslated(tZ.value, tH.value, tV.value);\n\t\t \n\t\t // Rotate by Alt/Azim\n\t\t gl.glRotated(rAlt.value, 0, 1, 0);\n\t\t gl.glRotated(rAzim.value, 0, 0, 1);\n\t\t}\n }", "public void setTranslation(float x, float y,float z) {\n\t\tm_xforms[NvCameraXformType.MAIN].m_translate.set(x, y, z);\n\t}", "public AlignByCamera ()\n\t{\n\t\trequires(Subsystems.transmission);\n\t\trequires(Subsystems.goalVision);\n\n\t\tthis.motorRatio = DEFAULT_ALIGNMENT_SPEED;\n\t}", "public interface ICanvasTransform {\r\n\r\n\t/**\r\n\t * Inverse-transforms a relative length along the X axis to world\r\n\t * coordinates.\r\n\t * \r\n\t * @param screen\r\n\t * the length on screen.\r\n\t * @return the corresponding length in world coordinates.\r\n\t */\r\n\tdouble transformXScreenLengthToWorld(final double screen);\r\n\r\n\t/**\r\n\t * Inverse-transforms a relative length along the Y axis to world\r\n\t * coordinates.\r\n\t * \r\n\t * @param screen\r\n\t * the length on screen.\r\n\t * @return the corresponding length in world coordinates.\r\n\t */\r\n\tdouble transformYScreenLengthToWorld(final double screen);\r\n\r\n\t/**\r\n\t * Inverse-transforms a point on the screen to absolute world coordinates.\r\n\t * \r\n\t * @param screen\r\n\t * the canvas screen coordinate.\r\n\t * @return the corresponding world coordinate.\r\n\t */\r\n\tWorldCoordinate transformScreenToWorld(final DeviceCoordinate screen);\r\n\r\n\t/**\r\n\t * Inverse-transforms a distance in screen space to a corresponding distance\r\n\t * in world coordinates.\r\n\t * \r\n\t * @param screen\r\n\t * the distance on screen.\r\n\t * @return the corresponding distance in world coordinates.\r\n\t */\r\n\tWorldDistance transformScreenDeltaToWorld(final DeviceDistance screen);\r\n\r\n\t/**\r\n\t * Transforms a world coordinate to a point on the canvas screen.\r\n\t * \r\n\t * @param x\r\n\t * the x coordinate in world space.\r\n\t * @param y\r\n\t * the y coordinate in world space.\r\n\t * @return the corresponding point on the canvas screen.\r\n\t */\r\n\tDeviceCoordinate transformWorldToScreen(final double x, final double y);\r\n\r\n\t/**\r\n\t * @param world\r\n\t * @return\r\n\t */\r\n\tDeviceCoordinate transformWorldToScreen(WorldCoordinate world);\r\n\r\n\t/**\r\n\t * @param world\r\n\t * @return\r\n\t */\r\n\tint transformWorldLengthToScreen(final double world);\r\n\r\n}", "public SVector3d getPositionCam() {\n\t\treturn transCamera;\n\t}", "@Override\n\tpublic void mouseDragged(MouseEvent e) {\n\t\tif(scale != 1.0) {\n\t\t\tPoint2D.Double view = new Point2D.Double(e.getX(), e.getY());\n\t\t\tPoint2D.Double worldPoint = new Point2D.Double();\n\t\t\tAffineTransform viewToWorld = new AffineTransform(1.0 / scale, 0, 0, 1.0 / scale, worldUpperLeft.getX(), worldUpperLeft.getY());\n\t\t\tviewToWorld.transform(view, worldPoint);\n\t\t\t\n\t\t\twX = worldPoint.getX();\n\t\t\twY = worldPoint.getY();\n\t\n\t\t\tdouble diffX = wDragStartX - wX;\n\t\t\tdouble diffY = wDragStartY - wY;\n\t\t\tdouble wulX = worldUpperLeft.getX();\n\t\t\tdouble wulY = worldUpperLeft.getY();\n\t\t\tdouble newUpX = diffX + wulX;\n\t\t\tdouble newUpY = diffY + wulY;\n\t\t\t\n\t\t\tif(newUpX < 0)\n\t\t\t\tnewUpX = 0;\n\t\t\tif(newUpY < 0)\n\t\t\t\tnewUpY = 0;\n\t\t\tif(scale == 2.0 && newUpX > 512)\n\t\t\t\tnewUpX = 512;\n\t\t\tif(scale == 2.0 && newUpY > 512)\n\t\t\t\tnewUpY = 512;\n\t\t\tif(scale == 4.0 && newUpX > 768)\n\t\t\t\tnewUpX = 768;\n\t\t\tif(scale == 4.0 && newUpY > 768)\n\t\t\t\tnewUpY = 768;\n\t\t\t\n\t\t\tworldUpperLeft = new Point2D.Double(newUpX, newUpY);\n\t\t\t\n\t\t\tif(worldUpperLeft.getX() + scrollbarSize > MAXSCROLLBARSIZE) \n\t\t\t\tGUIFunctions.setHScrollBarPosit(MAXSCROLLBARSIZE - scrollbarSize);\n\t\t\telse \n\t\t\t\tGUIFunctions.setHScrollBarPosit((int) worldUpperLeft.getX());\n\t\t\t\n\t\t\tif(worldUpperLeft.getY() + scrollbarSize > MAXSCROLLBARSIZE) \n\t\t\t\tGUIFunctions.setVScrollBarPosit(MAXSCROLLBARSIZE - scrollbarSize);\n\t\t\telse \n\t\t\t\tGUIFunctions.setVScrollBarPosit((int) worldUpperLeft.getY());\n\t\t\tGUIFunctions.refresh();\n\t\t}\n\t}", "public void setupCamera() {\r\n p.camera(width/2.0f, height/2.0f, cameraZ,\r\n width/2.0f, height/2.0f, 0, 0, 1, 0);\r\n\r\n if(isTiling) {\r\n float mod=1f/10f;\r\n p.frustum(width*((float)tileX/(float)tileNum-.5f)*mod,\r\n width*((tileX+1)/(float)tileNum-.5f)*mod,\r\n height*((float)tileY/(float)tileNum-.5f)*mod,\r\n height*((tileY+1)/(float)tileNum-.5f)*mod,\r\n cameraZ*mod, 10000);\r\n }\r\n\r\n }", "private void positionObjectInScene(float x, float y, float z) {\n setIdentityM(modelMatrix, 0);\n translateM(modelMatrix, 0, x, y, z);\n multiplyMM(modelViewProjectionMatrix, 0, viewProjectionMatrix,\n 0, modelMatrix, 0);\n }", "@Override\n public void onSurfaceChanged(GL10 unused, int width, int height) {\n GLES20.glViewport(0, 0, width, height);\n \n float ratio = (float) width / height;\n /*\n mWidth = width;\n mHeight = height;\n */\n \n // this projection matrix is applied to object coordinates\n // in the onDrawFrame() method\n /*\n Near / far clipping planes, in terms of units away from the camera\n Cannot be negative or 0, should not be close to 0\n */\n //Matrix.frustumM(mProjMatrix, 0, -ratio, ratio, -1, 1, 3, 7);\n Matrix.frustumM(mProjMatrix, 0, -ratio, ratio, -1, 1, 0.5f, 21);\n \n }", "public void updateTransform(float transX, float transY, float scaleX, float scaleY, int viewportWidth, int viewportHeight) {\n float left = ((float) this.mView.getLeft()) + transX;\n float top = ((float) this.mView.getTop()) + transY;\n RectF r = ZoomView.adjustToFitInBounds(new RectF(left, top, (((float) this.mView.getWidth()) * scaleX) + left, (((float) this.mView.getHeight()) * scaleY) + top), viewportWidth, viewportHeight);\n this.mView.setScaleX(scaleX);\n this.mView.setScaleY(scaleY);\n transX = r.top - ((float) this.mView.getTop());\n this.mView.setTranslationX(r.left - ((float) this.mView.getLeft()));\n this.mView.setTranslationY(transX);\n }", "private void updatePosition() {\n position.add(deltaPosition);\n Vector2[] points = getRotatedPoints();\n\n for (Vector2 point : points) {\n if (point.getX() < bound.getX() || point.getX() > bound.getX() + bound.getWidth()) { //If the point is outside of the bounds because of X\n position.addX(-deltaPosition.getX() * 2); //Undo the move so it is back in bounds\n deltaPosition.setX(-deltaPosition.getX()); //Make the direction it is going bounce to the other direction\n break;\n }\n if (point.getY() < bound.getY() || point.getY() > bound.getY() + bound.getHeight()) { //If the point is outside of the bounds because of Y\n position.addY(-deltaPosition.getY() * 2); //Undo the move so it is back in bounds\n deltaPosition.setY(-deltaPosition.getY()); //Make the direction it is going bounce to the other direction\n break;\n }\n }\n deltaPosition.scale(.98);\n }", "public void mygluLookAt(\n double eX, double eY, double eZ,\n double cX, double cY, double cZ,\n double upX, double upY, double upZ) {\n\n double[] F = new double[3];\n double[] UP = new double[3];\n double[] s = new double[3];\n double[] u = new double[3];\n\n F[0] = cX-eX;\n F[1] = cY-eY;\n F[2] = cZ-eZ;\n UP[0] = upX;\n UP[1] = upY;\n UP[2] = upZ;\n normalize(F);\n normalize(UP);\n crossProd(F, UP, s);\n crossProd(s, F, u);\n\n double[] M = new double[16];\n\n // Switching to row-major order\n M[0] = s[0];\n M[4] = u[0];\n M[8] = -F[0];\n M[12] = 0;\n M[1] = s[1];\n M[5] = u[1];\n M[9] = -F[1];\n M[13] = 0;\n M[2] = s[2];\n M[6] = u[2];\n M[10] = -F[2];\n M[14] = 0;\n M[3] = 0;\n M[7] = 0;\n M[11] = 0;\n M[15] = 1;\n\n projection.multiply(M);\n projection.translate((float)-eX, (float)-eY, (float)-eZ);\n }", "public void scaleAffine(){\n //Get the monitors size.\n Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize();\n transform = new AffineTransform();\n double width = screenSize.getWidth();\n double height = screenSize.getHeight();\n\n //Set up the scale amount for our Affinetransform\n double xscale = width / model.getBbox().getWidth();\n double yscale = height / model.getBbox().getHeight();\n\n double scale = max(xscale, yscale);\n\n adjustZoomLvl(scale);\n transform.translate(-model.getBbox().getMinX(), -model.getBbox().getMaxY());\n\n bounds = new CanvasBounds(getBounds(), transform);\n adjustZoomFactor();\n }", "public void fitContentInBounds(boolean z, boolean z2, boolean z3, boolean z4) {\n float f;\n if (this.state != null) {\n float cropWidth = this.areaView.getCropWidth();\n float cropHeight = this.areaView.getCropHeight();\n float access$2200 = this.state.getOrientedWidth();\n float access$2300 = this.state.getOrientedHeight();\n float access$2500 = this.state.getRotation();\n float radians = (float) Math.toRadians((double) access$2500);\n RectF calculateBoundingBox = calculateBoundingBox(cropWidth, cropHeight, access$2500);\n RectF rectF = new RectF(0.0f, 0.0f, access$2200, access$2300);\n float access$2100 = this.state.getScale();\n this.tempRect.setRect(rectF);\n Matrix access$2600 = this.state.getMatrix();\n access$2600.preTranslate(((cropWidth - access$2200) / 2.0f) / access$2100, ((cropHeight - access$2300) / 2.0f) / access$2100);\n this.tempMatrix.reset();\n this.tempMatrix.setTranslate(rectF.centerX(), rectF.centerY());\n Matrix matrix = this.tempMatrix;\n matrix.setConcat(matrix, access$2600);\n this.tempMatrix.preTranslate(-rectF.centerX(), -rectF.centerY());\n this.tempRect.applyMatrix(this.tempMatrix);\n this.tempMatrix.reset();\n this.tempMatrix.preRotate(-access$2500, access$2200 / 2.0f, access$2300 / 2.0f);\n this.tempRect.applyMatrix(this.tempMatrix);\n this.tempRect.getRect(rectF);\n PointF pointF = new PointF(this.state.getX(), this.state.getY());\n if (!rectF.contains(calculateBoundingBox)) {\n f = (!z || (calculateBoundingBox.width() <= rectF.width() && calculateBoundingBox.height() <= rectF.height())) ? access$2100 : fitScale(rectF, access$2100, calculateBoundingBox.width() / scaleWidthToMaxSize(calculateBoundingBox, rectF));\n fitTranslation(rectF, calculateBoundingBox, pointF, radians);\n } else if (!z2 || this.rotationStartScale <= 0.0f) {\n f = access$2100;\n } else {\n float width = calculateBoundingBox.width() / scaleWidthToMaxSize(calculateBoundingBox, rectF);\n if (this.state.getScale() * width < this.rotationStartScale) {\n width = 1.0f;\n }\n f = fitScale(rectF, access$2100, width);\n fitTranslation(rectF, calculateBoundingBox, pointF, radians);\n }\n float access$2700 = pointF.x - this.state.getX();\n float access$2800 = pointF.y - this.state.getY();\n if (z3) {\n float f2 = f / access$2100;\n if (Math.abs(f2 - 1.0f) >= 1.0E-5f || Math.abs(access$2700) >= 1.0E-5f || Math.abs(access$2800) >= 1.0E-5f) {\n this.animating = true;\n ValueAnimator ofFloat = ValueAnimator.ofFloat(new float[]{0.0f, 1.0f});\n ofFloat.addUpdateListener(new CropView$$ExternalSyntheticLambda0(this, access$2700, new float[]{1.0f, 0.0f, 0.0f}, access$2800, f2));\n final boolean z5 = z4;\n final boolean z6 = z;\n final boolean z7 = z2;\n final boolean z8 = z3;\n ofFloat.addListener(new AnimatorListenerAdapter() {\n public void onAnimationEnd(Animator animator) {\n boolean unused = CropView.this.animating = false;\n if (!z5) {\n CropView.this.fitContentInBounds(z6, z7, z8, true);\n }\n }\n });\n ofFloat.setInterpolator(this.areaView.getInterpolator());\n ofFloat.setDuration(z4 ? 100 : 200);\n ofFloat.start();\n return;\n }\n return;\n }\n this.state.translate(access$2700, access$2800);\n this.state.scale(f / access$2100, 0.0f, 0.0f);\n updateMatrix();\n }\n }", "private AffineTransform createTransform() {\n Dimension size = getSize();\n Rectangle2D.Float panelRect = new Rectangle2D.Float(\n BORDER,\n BORDER,\n size.width - BORDER - BORDER,\n size.height - BORDER - BORDER);\n AffineTransform tr = AffineTransform.getTranslateInstance(panelRect.getCenterX(), panelRect.getCenterY());\n double sx = panelRect.getWidth() / mapBounds.getWidth();\n double sy = panelRect.getHeight() / mapBounds.getHeight();\n double scale = min(sx, sy);\n tr.scale(scale, -scale);\n tr.translate(-mapBounds.getCenterX(), -mapBounds.getCenterY());\n return tr;\n }", "public abstract Matrix4f getCameraMatrix();", "public void translateX(float dx) {\r\n this.center.x += Math.cos(Math.toRadians(-rotation)) * dx;\r\n this.center.z += Math.sin(Math.toRadians(-rotation)) * dx;\r\n if (this.center.x > (this.boardWidth - ((this.boardWidth / 2f) * percentZoom))) {\r\n this.center.x = (this.boardWidth - ((this.boardWidth / 2f) * percentZoom));\r\n } else if (this.center.x < (this.boardWidth / 2f) * percentZoom) {\r\n this.center.x = (this.boardWidth / 2f) * percentZoom;\r\n }\r\n if (this.center.z > this.boardLength - ((this.boardLength / 2f) * percentZoom)) {\r\n this.center.z = this.boardLength - ((this.boardLength / 2f) * percentZoom);\r\n } else if (this.center.z < (this.boardLength / 2f) * percentZoom) {\r\n this.center.z = (this.boardLength / 2f) * percentZoom;\r\n }\r\n changed = true;\r\n }", "boolean canReplace(World world, int x, int y, int z);", "void vectorToWorld(double px, double py, double pz, DVector3 result);", "private void setCameraView() {\n double bottomBoundary = mUserPosition.getLatitude() - .1;\n double leftBoundary = mUserPosition.getLongitude() - .1;\n double topBoundary = mUserPosition.getLatitude() + .1;\n double rightBoundary = mUserPosition.getLongitude() + .1;\n\n mMapBoundary = new LatLngBounds(\n new LatLng(bottomBoundary, leftBoundary),\n new LatLng(topBoundary, rightBoundary)\n );\n\n mGoogleMap.moveCamera(CameraUpdateFactory.newLatLngBounds(mMapBoundary, 500,500,1));\n }", "@Override\n public void translate(double x, double y, double z) {\n GL11.glTranslated(x, y, z);\n }", "public void move (View view){\n\n if (toyRobotIsActive){//only run code after PLACE is DONE\n\n if (orientation == 0) {//Move while Facing North\n\n if((robot.getTranslationY()/perUnitY*(-1)) >=4) {\n System.out.println(\"Out of Bounds\");//Chk Error in Logs\n errorMessage(\"Out of Bounds\");//Error display to user via Toast\n } else {\n robot.animate().translationYBy(-perUnitY).setDuration(50);\n } //move robot 1 unit\n\n } else if (orientation == 3 || orientation == -1) {//Facing West\n if((robot.getTranslationX()/perUnitX) <= 0) {\n System.out.println(\"Out of Bounds\");\n errorMessage(\"Out of Bounds\");\n } else {\n robot.animate().translationXBy(-perUnitX).setDuration(50);\n }\n\n\n } else if (orientation == 2 || orientation == -2) {//Facing South\n if((robot.getTranslationY()/perUnitY)*(-1) <= 0){\n System.out.println(\"Out of Bounds\");\n errorMessage(\"Out of Bounds\");\n } else {\n robot.animate().translationYBy(perUnitY).setDuration(50);\n }\n\n\n } else if (orientation == 1 || orientation == -3) {//Facing East\n if((robot.getTranslationX()/perUnitX) >=4){\n System.out.println(\"Out of Bounds\");\n errorMessage(\"Out of Bounds\");\n } else {\n robot.animate().translationXBy(perUnitX).setDuration(50);\n }\n }\n } else errorMessage(\"Please place toy robot\"); //button not active if\n }", "@Override // kotlin.jvm.functions.Function1\n public Unit invoke(Camera.Parameters parameters) {\n Camera.Parameters parameters2 = parameters;\n Intrinsics.checkNotNullParameter(parameters2, \"$receiver\");\n parameters2.setFocusMode(DebugKt.DEBUG_PROPERTY_VALUE_AUTO);\n if (parameters2.getMaxNumFocusAreas() > 0) {\n this.a.e.mapRect(this.b);\n parameters2.setFocusAreas(t6.n.d.listOf(new Camera.Area(CameraInteractorKt.access$toCameraRect(this.b), 1000)));\n }\n if (parameters2.getMaxNumMeteringAreas() > 0 && this.c != null) {\n this.a.e.mapRect(this.c);\n parameters2.setMeteringAreas(t6.n.d.listOf(new Camera.Area(CameraInteractorKt.access$toCameraRect(this.c), 1000)));\n }\n return Unit.INSTANCE;\n }", "private AffineTransform setUpTransform(Envelope mapExtent, Rectangle screenSize) {\n double scaleX = screenSize.getWidth() / mapExtent.getWidth();\n double scaleY = screenSize.getHeight() / mapExtent.getHeight();\n \n double tx = -mapExtent.getMinX() * scaleX;\n double ty = (mapExtent.getMinY() * scaleY) + screenSize.getHeight();\n \n AffineTransform at = new AffineTransform(scaleX, 0.0d, 0.0d, -scaleY, tx, ty);\n \n return at;\n }", "public void moveViewTo(int newX, int newY) {\n int scaledWidth = (int) (TileDataRegister.TILE_WIDTH * scale);\n int scaledHeight = (int) (TileDataRegister.TILE_HEIGHT * scale);\n int baseX = (int) (map.getWidth() * TileDataRegister.TILE_WIDTH * scale) / 2;\n\n int x = baseX + (newY - newX) * scaledWidth / 2;\n x -= viewPortWidth * 0.5;\n\n int y = (newY + newX) * scaledHeight / 2;\n y -= viewPortHeight * 0.5;\n\n targetXOffset = -1 * x;\n targetYOffset = -1 * y;\n\n doPan = true;\n\n gameChanged = true;\n }" ]
[ "0.64974374", "0.6296229", "0.6084651", "0.6048473", "0.59204775", "0.58289766", "0.5777127", "0.5711406", "0.5687184", "0.5602646", "0.5577445", "0.5547904", "0.551686", "0.5511902", "0.55085677", "0.54973555", "0.5488452", "0.5474201", "0.54332304", "0.539785", "0.53920895", "0.5368028", "0.53571415", "0.53481984", "0.5334355", "0.53287005", "0.5290523", "0.527079", "0.5269882", "0.5260499", "0.5240202", "0.523579", "0.5234387", "0.5230037", "0.5215845", "0.51995856", "0.5194212", "0.51804996", "0.5171799", "0.51537305", "0.51485217", "0.51372415", "0.5128263", "0.5126369", "0.51184344", "0.5117114", "0.5116825", "0.51152414", "0.51111966", "0.5088393", "0.5086251", "0.507925", "0.50779253", "0.50769424", "0.505289", "0.5052839", "0.50506055", "0.504945", "0.5033068", "0.5024551", "0.5012083", "0.5006289", "0.5001329", "0.50002563", "0.49801168", "0.4979807", "0.49692857", "0.49633032", "0.49492407", "0.4949092", "0.49448258", "0.4937562", "0.49002665", "0.48993203", "0.48955742", "0.48877206", "0.48877177", "0.48856425", "0.48823804", "0.48823747", "0.48807395", "0.48744184", "0.48712587", "0.4864807", "0.48594525", "0.48591855", "0.4857172", "0.48437622", "0.48402143", "0.48401642", "0.48393393", "0.4838524", "0.4833946", "0.48227605", "0.48166695", "0.4808998", "0.48074657", "0.4804679", "0.4803582", "0.48035097" ]
0.5819355
6
Translates the camera in all 3 dimensions. Does bounds checking.
@Override public void pan(float x, float y, float z) { // keep camera within borders x = Utils.between(viewCamera.position.x + x, bounds.min.x, bounds.max.x); y = Utils.between(viewCamera.position.y + y, bounds.min.y, bounds.max.y); z = Utils.between(viewCamera.position.z + z, bounds.min.z, bounds.max.z); viewCamera.position.set(x, y, z); viewCamera.update(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private void updateCamera() {\n\t\tVector3f x = new Vector3f();\n\t\tVector3f y = new Vector3f();\n\t\tVector3f z = new Vector3f();\n\t\tVector3f temp = new Vector3f(this.mCenterOfProjection);\n\n\t\ttemp.sub(this.mLookAtPoint);\n\t\ttemp.normalize();\n\t\tz.set(temp);\n\n\t\ttemp.set(this.mUpVector);\n\t\ttemp.cross(temp, z);\n\t\ttemp.normalize();\n\t\tx.set(temp);\n\n\t\ty.cross(z, x);\n\n\t\tMatrix4f newMatrix = new Matrix4f();\n\t\tnewMatrix.setColumn(0, x.getX(), x.getY(), x.getZ(), 0);\n\t\tnewMatrix.setColumn(1, y.getX(), y.getY(), y.getZ(), 0);\n\t\tnewMatrix.setColumn(2, z.getX(), z.getY(), z.getZ(), 0);\n\t\tnewMatrix.setColumn(3, mCenterOfProjection.getX(),\n\t\t\t\tmCenterOfProjection.getY(), mCenterOfProjection.getZ(), 1);\n\t\ttry {\n\t\t\tnewMatrix.invert();\n\t\t\tthis.mCameraMatrix.set(newMatrix);\n\t\t} catch (SingularMatrixException exc) {\n\t\t\tLog.d(\"Camera\",\n\t\t\t\t\t\"SingularMatrixException on Matrix: \"\n\t\t\t\t\t\t\t+ newMatrix.toString());\n\t\t}\n\t}", "public void processCamera() {\n\t\tif (Mario.getX() > 300) {\n\t\t\tlevelCompound.move(-Mario.xVel, 0);\n\t\t\tPhysics.moveHitboxes(-Mario.xVel, 0);\n\t\t\tPhysics.moveEnemies(-Mario.xVel, 0);\n\t\t\tMario.setLocation(299, Mario.getY());\n\n\t\t\tlevelCompound.move(-3, 0);\n\t\t\tPhysics.moveHitboxes(-3, 0);\n\t\t\tPhysics.moveEnemies(-3, 0);\n\t\t}\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 void handleScreenBoundaries() {\n\t\tif (tiledMapHelper.getCamera().position.x < screenWidth / 2) {\n\t\t\ttiledMapHelper.getCamera().position.x = screenWidth / 2;\n\t\t}\n\t\tif (tiledMapHelper.getCamera().position.x >= tiledMapHelper.getWidth()\n\t\t\t\t- screenWidth / 2) {\n\t\t\ttiledMapHelper.getCamera().position.x = tiledMapHelper.getWidth()\n\t\t\t\t\t- screenWidth / 2;\n\t\t}\n\n\t\tif (tiledMapHelper.getCamera().position.y < screenHeight / 2) {\n\t\t\ttiledMapHelper.getCamera().position.y = screenHeight / 2;\n\t\t}\n\t\tif (tiledMapHelper.getCamera().position.y >= tiledMapHelper.getHeight()\n\t\t\t\t- screenHeight / 2) {\n\t\t\ttiledMapHelper.getCamera().position.y = tiledMapHelper.getHeight()\n\t\t\t\t\t- screenHeight / 2;\n\t\t}\n\t}", "private void inspectTranslateBounds(Matrix matrix) {\n int containerWidth = getWidth();\n int containerHeight = getHeight();\n\n // get drawable's bounds\n RectF bounds =\n MatrixHelper.getBounds(\n getDrawable().getIntrinsicWidth(),\n getDrawable().getIntrinsicHeight(),\n matrix);\n\n float dx = containerWidth - bounds.right;\n float dy = containerHeight - bounds.bottom;\n\n // don't let the drawable move out of screen\n if (bounds.width() > containerWidth) {\n if (bounds.left > 0) {\n matrix.postTranslate(-bounds.left, 0);\n } else if (dx > 0) {\n matrix.postTranslate(dx, 0);\n }\n } else {\n if (bounds.left < 0) {\n matrix.postTranslate(-bounds.left, 0);\n } else if (dx < 0) {\n matrix.postTranslate(dx, 0);\n }\n }\n if (bounds.height() > containerHeight) {\n if (bounds.top > 0) {\n matrix.postTranslate(0, -bounds.top);\n } else if (dy > 0) {\n matrix.postTranslate(0, dy);\n }\n } else {\n if (bounds.top < 0) {\n matrix.postTranslate(0, -bounds.top);\n } else if (dy < 0) {\n matrix.postTranslate(0, dy);\n }\n }\n }", "private void moveCameraToPosWithinBoardBounds(float x, float y) {\n // the camera position is the center coordinate of the displayed area --> cam.viewport.../2\n cam.position.x = MathUtils.clamp(x,\n cam.viewportWidth/2 - (cam.viewportWidth/2)*(1-getZoomFactor()),\n cam.viewportWidth/2 + (cam.viewportWidth/2)*(1-getZoomFactor()));\n cam.position.y = MathUtils.clamp(cam.viewportHeight-y,\n cam.viewportHeight/2 - (cam.viewportHeight/2)*(1-getZoomFactor()),\n cam.viewportHeight/2 + (cam.viewportHeight/2)*(1-getZoomFactor()));\n cam.update();\n }", "@Override\n\tpublic void pan(Vector3 delta) {\n\t\t// keep camera within borders\n\t\tfloat x = Utils.between(viewCamera.position.x + delta.x, bounds.min.x, bounds.max.x);\n\t\tfloat y = Utils.between(viewCamera.position.y + delta.y, bounds.min.y, bounds.max.y);\n\t\tfloat z = Utils.between(viewCamera.position.z + delta.z, bounds.min.z, bounds.max.z);\n\t\tviewCamera.position.set(x, y, z);\n\t\tviewCamera.update();\n\t}", "private void pointCameraAt(Point3D target,Group root){\n for(Node node: root.getChildren()){\n node.setTranslateX(node.getTranslateX()-xOffset);\n node.setTranslateY(node.getTranslateY()-yOffset);\n node.setTranslateZ(node.getTranslateZ()-zOffset);\n }\n\n xOffset = -target.getX(); yOffset = -target.getY(); zOffset = -target.getZ();\n\n for(Node node: root.getChildren()){\n node.setTranslateX(node.getTranslateX()+xOffset);\n node.setTranslateY(node.getTranslateY()+yOffset);\n node.setTranslateZ(node.getTranslateZ()+zOffset);\n }\n }", "abstract void translate(double x, double y, double z);", "public void translateTransform(Vector3f trans) {\r\n\t\tm[0][0] = 1.0f; m[0][1] = 0.0f; m[0][2] = 0.0f; m[0][3] = trans.x;\r\n\t\tm[1][0] = 0.0f; m[1][1] = 1.0f; m[1][2] = 0.0f; m[1][3] = trans.y;\r\n\t\tm[2][0] = 0.0f; m[2][1] = 0.0f; m[2][2] = 1.0f; m[2][3] = trans.z;\r\n\t\tm[3][0] = 0.0f; m[3][1] = 0.0f; m[3][2] = 0.0f; m[3][3] = 1.0f;\r\n\r\n\t}", "@Override\n public boolean isTransforming() {\n return super.isTransforming() || desiredWorldPosition != null;\n }", "public void runProjectionMotion(){\n\t\tpos.setLocation(pos.getX() + vel[0]/5, pos.getY() - vel[1]/5);\r\n\t\tvel[1]-=gravity;\r\n\t}", "public void translate( Vector3f t )\n\t{\n\t\tMatrix4f opMat = new Matrix4f();\n\t\topMat.set( t );\n\t\tmat.mul( opMat );\n\t}", "private void moveCameraWithinBoardBounds(float deltaX, float deltaY) {\n // zoom factor is incorporated to make (absolute) camera movement slower when zoomed in\n // so it's always the same visual velocity\n float newX = cam.position.x - deltaX*getZoomFactor();\n float newY = cam.position.y + deltaY*getZoomFactor();\n moveCameraToPosWithinBoardBounds(newX, cam.viewportHeight-newY);\n }", "public void checkCameraLimits()\n {\n //Daca camera ar vrea sa mearga prea in stanga sau prea in dreapta (Analog si pe verticala) ea e oprita (practic cand se intampla acest lucru Itemul asupra caruia se incearca centrarea nu mai e in centrul camerei )\n\n if(xOffset < 0 )\n xOffset = 0;\n else if( xOffset > refLinks.GetMap().getWidth()* Tile.TILE_WIDTH - refLinks.GetWidth())\n xOffset =refLinks.GetMap().getWidth()* Tile.TILE_WIDTH - refLinks.GetWidth();\n if(yOffset<0)\n yOffset = 0;\n if(yOffset > refLinks.GetMap().getHeight()*Tile.TILE_HEIGHT - refLinks.GetHeight())\n {\n yOffset = refLinks.GetMap().getHeight()*Tile.TILE_HEIGHT - refLinks.GetHeight();\n }\n }", "public void translate( float x, float y, float z )\n\t{\n\t\tMatrix4f opMat = new Matrix4f();\n\t\topMat.set( new Vector3f( x, y, z ) );\n\t\tmat.mul( opMat );\n\t}", "@Override\n\tpublic void pan(Vector2 delta) {\n\t\t// keep camera within borders\n\t\tfloat x = Utils.between(viewCamera.position.x + delta.x, bounds.min.x, bounds.max.x);\n\t\tfloat y = Utils.between(viewCamera.position.y + delta.y, bounds.min.y, bounds.max.y);\n\t\tviewCamera.position.set(x, y, 0);\n\t\tviewCamera.update();\n\t}", "@Override\n\tpublic void resize(int width, int height) {\n\t\tviewCamera.viewportWidth = width;\n\t\tviewCamera.viewportHeight = height;\n\t\tviewCamera.position.set(0, 0, 0);\n\t\tviewCamera.update();\n\n\t\tVector3 min = MIN_BOUND.cpy();\n\t\tVector3 max = new Vector3(MAX_BOUND.x - width, MAX_BOUND.y - height, 0);\n\t\tviewCamera.project(min, 0, 0, width, height);\n\t\tviewCamera.project(max, 0, 0, width, height);\n\t\tbounds = new BoundingBox(min, max);\n\t\t// do a pan to reset camera position\n\t\tpan(min);\n\t}", "public final native Mat4 translate(double x, double y, double z) /*-{\n return $wnd.mat4.translate(this, [x, y, z]);\n }-*/;", "private void checkBoundaries() {\n Position moveTo = pos.copy();\n boolean move = false;\n float minZoom = getZoomToFit();\n float maxZoom = minZoom * 3;\n if (maxZoom < getZoomToFill()) maxZoom = getZoomToFill();\n \n if (pos.zoom < minZoom) {\n moveTo = new Position(minZoom, 0, 0);\n move = true;\n } else { \n if (pos.zoom > maxZoom) {\n moveTo.zoom = maxZoom;\n \n float viewXcenter = 0.5f * getWidth();\n float viewYcenter = 0.5f * getHeight();\n double centerXcontentBefore = getContentX(viewXcenter, pos);\n double centerYcontentBefore = getContentY(viewYcenter, pos);\n moveTo.x = (float) (viewXcenter - centerXcontentBefore * maxZoom - 0.5f * getWidth());\n moveTo.y = (float) (viewYcenter - centerYcontentBefore * maxZoom - 0.5f * getHeight());\n \n move = true;\n }\n \n RectF imageBounds = new RectF();\n float zoomedWidth = (flippedDimensions() ? contentWorkHeight : contentWorkWidth) * moveTo.zoom;\n float zoomedHeight = (flippedDimensions() ? contentWorkWidth : contentWorkHeight) * moveTo.zoom;\n imageBounds.left = -0.5f * zoomedWidth + moveTo.x;\n imageBounds.right = 0.5f * zoomedWidth + moveTo.x;\n imageBounds.top = -0.5f * zoomedHeight + moveTo.y;\n imageBounds.bottom = 0.5f * zoomedHeight + moveTo.y;\n \n if (debug) Log.w(TAG, \"checkBoundaries() current image bounds: \" + imageBounds.left + \"x\" + imageBounds.top + \" -> \" + imageBounds.right + \"x\" + imageBounds.bottom);\n \n // adjust offset to fit in boundaries\n RectF offsetBounds = new RectF();\n if (imageBounds.width() - getWidth() > 0) {\n offsetBounds.left = -0.5f * (imageBounds.width() - getWidth());\n offsetBounds.right = 0.5f * (imageBounds.width() - getWidth());\n }\n if (imageBounds.height() - getHeight() > 0) {\n offsetBounds.top = -0.5f * (imageBounds.height() - getHeight());\n offsetBounds.bottom = 0.5f * (imageBounds.height() - getHeight());\n }\n if (imageBounds.centerX() < offsetBounds.left) { \n moveTo.x = offsetBounds.left; \n move = true;\n } else if (imageBounds.centerX() > offsetBounds.right) {\n moveTo.x = offsetBounds.right;\n move = true;\n } \n \n if (imageBounds.centerY() < offsetBounds.top) { \n moveTo.y = offsetBounds.top; \n move = true; \n } else if (imageBounds.centerY() > offsetBounds.bottom) { \n moveTo.y = offsetBounds.bottom; \n move = true; \n }\n }\n \n if (move) {\n final Position finalMoveTo = moveTo;\n move(new Move() {\n Position startPos = new Position(pos);\n Position toPos = finalMoveTo;\n long durationMs = 200;\n public boolean handleMove(Position result, long currentTime, long startedAt) {\n if (currentTime - startedAt > durationMs) {\n result.set(toPos);\n return false;\n }\n \n double remainingProgress = 1.0 - (1.0 * (currentTime - startedAt) / durationMs);\n result.zoom = (float) (toPos.zoom + (startPos.zoom - toPos.zoom) * remainingProgress); \n result.x = (float) (toPos.x + (startPos.x - toPos.x) * remainingProgress);\n result.y = (float) (toPos.y + (startPos.y - toPos.y) * remainingProgress);\n return true;\n }\n });\n }\n if (debug) Log.i(TAG, \"checkBoundaries() \" + (move ? \"moveTo: \" + moveTo : \"ok\"));\n \n }", "private void adjustCameraPosition() {\n if (upward) {\n\n if (tilt<90) {\n tilt ++;\n zoom-=0.01f;\n } else {\n upward=false;\n }\n\n } else {\n if (tilt>0) {\n tilt --;\n zoom+=0.01f;\n } else {\n upward=true;\n }\n }\n }", "public void cameraTransform(Vector3f targ, Vector3f up) {\r\n\t\t// First normalize the target\r\n\t\tVector3f n = targ;\r\n\t\tn.normalize();\r\n\t\t// Then normalize the up vector\r\n\t\tVector3f u = up;\r\n\t\tu.normalize();\r\n\t\t// Then cross the two together to get the right vector\r\n\t\tu = u.cross(n);\r\n\t\tVector3f v = n.cross(u);\r\n\r\n\t\t// Finally build a matrix from the result\r\n\t\tm[0][0] = u.x; m[0][1] = u.y; m[0][2] = u.z; m[0][3] = 0.0f;\r\n\t\tm[1][0] = v.x; m[1][1] = v.y; m[1][2] = v.z; m[1][3] = 0.0f;\r\n\t\tm[2][0] = n.x; m[2][1] = n.y; m[2][2] = n.z; m[2][3] = 0.0f;\r\n\t\tm[3][0] = 0.0f; m[3][1] = 0.0f; m[3][2] = 0.0f; m[3][3] = 1.0f;\r\n\r\n\t}", "public void updateMvpMatrix()\n\t\t{\n\t\t\t// Set the matrix, specifying the edges of the visible canvas and the near and far clipping planes.\n\t\t\tMatrix.orthoM(mvpMatrix, 0,\n\t\t\t\t\t-viewportWidth / (2f * zoom) + cameraX,\n\t\t\t\t\tviewportWidth / (2f * zoom) + cameraX,\n\t\t\t\t\t-viewportHeight / (2f * zoom) + cameraY,\n\t\t\t\t\tviewportHeight / (2f * zoom) + cameraY, -1, 1);\n\t\t}", "@Override\n\tpublic void moveCamera() {\n\n\t}", "public void translate(float x, float y);", "@Override\r\n\tpublic void translate(float vx, float vy) {\n\t\t\r\n\t}", "@Override\n\tpublic void update(){\n\t\tif(!isPositionValid())\n\t\t\tescape();\n\t\tdouble dx = velocity.x * speed;\n\t\tdouble dy = velocity.y * speed;\n\t\tprojectedCenter.setLocation(center.x + dx, center.y + dy);\n\t\t//check other ball collisions\n\t\tboolean aloneFlag = true;\n\t\tfor(Ball other : Game.gameField.getBalls()){\n\t\t\tif(other == this)\n\t\t\t\tcontinue;\n\t\t\tcheckCollision(other);\n\t\t\tif(quadrant.equals(other.getQuadrant())){\n\t\t\t\taloneFlag = false;\n\t\t\t}\n\t\t}\n\t\tisAlone = aloneFlag;\n\t\t//check wall collisions\n\t\tfor(Wall wall : Game.gameField.getWalls()){\n\t\t\twall.checkCollision(this, projectedCenter);\n\t\t}\n\t\t//check boundary collisions\n\t\tGame.gameField.checkBoundaryCollision(this, projectedCenter);\n\t\t//collisions may have changed the velocity vector\n\t\tdx = velocity.x * speed;\n\t\tdy = velocity.y * speed;\n\t\tmove(dx, dy);\n\t\t//check if the move is valid, if not move back\n\t\tif(!isPositionValid()){\n\t\t\tmove(-dx, -dy);\n\t\t}\n\t\tquadrant = Calculations.getQuadrant(center, Game.gameField.getWalls());\n\t}", "private boolean riftCoversCameraBounds(float cameraX, float cameraY, float maskWidth, float maskHeight,\r\n\t\t\t\t\t\t\t\t\t\t CharacterModel character) {\r\n\t\tupdateMaskPosition(maskWidth, maskHeight, character);\r\n\t\tboolean coversLeft = maskOrigin.x + maskOffset < cameraX;\r\n\t\tboolean coversRight = maskOrigin.x + maskWidth - maskOffset > cameraX + canvas.getWidth();\r\n\t\tboolean coversBottom = maskOrigin.y + maskOffset < cameraY;\r\n\t\tboolean coversTop = maskOrigin.y + maskHeight - maskOffset > cameraY + canvas.getHeight();\r\n\t\treturn coversLeft && coversRight && coversBottom && coversTop;\r\n\t}", "public void onBoundsResolved()\n {\n updateTransform();\n }", "public interface Camera extends GameObject {\n\n public static final byte FORWARDS = 0x0;\n public static final byte LEFT = 0x1;\n public static final byte BACKWARDS = 0x2;\n public static final byte RIGHT = 0x3;\n\n /**\n * The default camera controls.\n */\n public static final byte[] DEFAULT_CAMERA_CONTROLLER = {\n Keys.KEY_W, Keys.KEY_A, Keys.KEY_S, Keys.KEY_D\n };\n\n /**\n * @return the position of the <code>Camera</code> in the world\n */\n public abstract ReadableVector3f getPosition();\n\n /**\n * @param deltaX the change along the X axis\n * @param deltaY the change along the Y axis\n * @param deltaZ the change along the Z axis\n */\n public abstract void translate(float deltaX, float deltaY, float deltaZ);\n\n public abstract void translate(ReadableVector3f delta);\n\n /**\n * @param position the new position of the <code>Camera</code>\n */\n public abstract void setPosition(ReadableVector3f position);\n}", "public void applyTransform() {\n\t\tglRotatef(xaxisrot, 1.0f, 0.0f, 0.0f);\n\t\tglRotatef(yaxisrot, 0.0f, 1.0f, 0.0f);\n\t\tglRotatef(tilt, 0.0f, 0.0f, 1.0f);\n\t\tglTranslatef(-pos.geti(), -pos.getj(), -pos.getk());\n\t}", "public void keyPressed(KeyEvent evt) {\n Vector3f translate = new Vector3f();\n Vector3f transball = new Vector3f();\n \n plane_trans.get( translate ); \n ball_trans.get( transball ); \n \n if (evt.getKeyChar()=='a') {\n Transform3D rotate = new Transform3D();\n rotate.rotY(Math.PI/36.0d);\n plane_trans.mul(rotate);\n \n //transball.x += 0.4f;\n \n \n \n }\n if (evt.getKeyChar()=='d') {\n Transform3D rotate = new Transform3D();\n rotate.rotY(-Math.PI/36.0d);\n plane_trans.mul(rotate);\n //transball.x -= 0.3f;\n }\n \n /*if (evt.getKeyChar()=='s') {\n Transform3D rotate = new Transform3D();\n rotate.rotX(-Math.PI/36.0d);\n plane_trans.mul(rotate);\n transball.y += 0.5f;\n }*/\n \n /*if (evt.getKeyChar()=='w') {\n Transform3D rotate = new Transform3D();\n rotate.rotX(Math.PI/36.0d);\n plane_trans.mul(rotate);\n transball.y -= 0.4f;\n \n }*/\n \n if (evt.getKeyChar()=='i') {\n //transball.x = 0.0f;\n //transball.y = -3.00f;\n //transball.z = 0.3f;\n plane_trans.set(new Vector3f(0.0f, 1.5f, 9985.0f));\n \n Transform3D rotate = new Transform3D();\n rotate.rotX(-Math.PI/3.0d);\n plane_trans.mul(rotate);\n }\n \n if(evt.getKeyChar()=='l'){\n stime = 2000;\n movement();\n \n \n }\n \n // (-5,5) (-5,-4) (5,-4) (5,5)\n // x varies from -5 to 5\n // y varies from 5 to -4\n \n /*if(transball.x< -5 || transball.x>5){\n transball.x = 0.0f;\n transball.y = -3.00f;\n }\n if(transball.y < -4 || transball.y>5){\n transball.x = 0.0f;\n transball.y = -3.00f;\n }*/\n \n \n //ball_trans.setTranslation( transball );\n //ballTG.setTransform(ball_trans);\n \n plane_trans.setTranslation( translate );\n planeTG.setTransform(plane_trans);\n \n // make a rectangle and usse its four coordinates to check where the ball is in the area or outside\n // resetball();\n \n \n \n }", "public void translate(float x, float y){\n hitBox.offset(x, y);\n }", "public Point[] transformPosition(Point[] objectPosition, double fieldWidth, double fieldHeight) {\n\t\t// Set field center point from sizes.\n\t\tthis.center.set(new double[] { fieldWidth/2, fieldHeight/2 });\n\t\t\n\t\t// Find centroid - geometric center of car.\n\t\tPoint carCenter = this.findCenter(objectPosition);\n\n\t\t// Find length of line between center and perceived location.\n\t\tdouble UV = this.lineLength(carCenter, center);\n\t\tdouble TV = sourceHeight;\n\t\t\n\t\t// Find the angle from the camera to the perceived location.\n\t\tdouble theta = Math.atan2(UV, TV);\n\t\t\n\t\t// Calculate error from perceived location and actual z-location.\n\t\tdouble AC = objHeight;\n\t\tdouble BC = Math.tan(theta) * AC;\n\t\t\n\t\t// Find length from center to z-axis transformed car location.\n\t\tdouble newLength = UV - BC;\n\t\t\n\t\t// Move coordinate system to move center to origo.\n\t\tPoint[] transformedObjectPosition = Arrays.copyOf(\n\t\t\tthis.transformCoordinateSystem(objectPosition, this.center),\n\t\t\tobjectPosition.length\n\t\t);\n\t\t\n\t\t// Create scalar and relocate the location of object (perceived loc / actual loc).\n\t\tdouble scalar = newLength / UV;\n\t\tfor(int i = 0; i < transformedObjectPosition.length; i++) {\n\t\t\ttransformedObjectPosition[i].set(new double[] {\n\t\t\t\ttransformedObjectPosition[i].x * scalar,\n\t\t\t\ttransformedObjectPosition[i].y * scalar\t\t\t\t\t\n\t\t\t});\n\t\t}\n\t\t\n\t\t// Return to old coordinate system.\n\t\ttransformedObjectPosition = this.inverseTransformCoordinateSystem(transformedObjectPosition, this.center);\n\t\t\n\t\t// Find center of triangle\n\t\tPoint objectCenter = this.findCenter(new MatOfPoint2f(transformedObjectPosition));\n\t\t\n\t\t// Transform to coordinate system with triangle center as origo.\n\t\ttransformedObjectPosition = this.transformCoordinateSystem(transformedObjectPosition, objectCenter);\n\t\t\n\t\t// Scale according to real-life factors\n\t\tfor(int i = 0; i < transformedObjectPosition.length; i++) {\n\t\t\ttransformedObjectPosition[i].set(new double[] {\n\t\t\t\ttransformedObjectPosition[i].x * Config.Client.triangleScale,\n\t\t\t\ttransformedObjectPosition[i].y * Config.Client.triangleScale\n\t\t\t});\n\t\t}\n\t\t\n\t\t// Return the inverse trasnform result.\n\t\treturn this.inverseTransformCoordinateSystem(transformedObjectPosition, objectCenter);\n\t}", "private void updateBounds(final float[] values) {\n if (getDrawable() != null) {\n mBounds.set(values[Matrix.MTRANS_X],\n values[Matrix.MTRANS_Y],\n getDrawable().getIntrinsicWidth() * values[Matrix.MSCALE_X] + values[Matrix.MTRANS_X],\n getDrawable().getIntrinsicHeight() * values[Matrix.MSCALE_Y] + values[Matrix.MTRANS_Y]);\n }\n }", "public void translate( float x, float y )\n\t{\n\t\tMatrix4f opMat = new Matrix4f();\n\t\topMat.set( new Vector3f( x, y, 0 ) );\n\t\tmat.mul( opMat );\n\t}", "public void translate(float x, float y, float z) {\n Matrix.translateM(mModelMatrix, 0, x, y, z);\n }", "private float[] getTranslationVector(float centerX, float centerY,\n int bitmapXLength, int bitmapYLength,\n float constant){\n return new float[]{\n -(centerX * constant) + (bitmapXLength/2),\n -(centerY * constant) + (bitmapYLength/2)\n };\n }", "private void updateTransform() {\n Matrix matrix = new Matrix();\n float centerX = dataBinding.viewFinder.getWidth() / 2f;\n float centerY = dataBinding.viewFinder.getHeight() / 2f;\n int rotation = dataBinding.viewFinder.getDisplay().getRotation();\n int rotationDegrees = 0;\n switch (rotation) {\n case Surface.ROTATION_0:\n rotationDegrees = 0;\n break;\n case Surface.ROTATION_90:\n rotationDegrees = 90;\n break;\n case Surface.ROTATION_180:\n rotationDegrees = 180;\n break;\n case Surface.ROTATION_270:\n rotationDegrees = 270;\n break;\n default:\n }\n matrix.postRotate(-rotationDegrees, centerX, centerY);\n }", "private void setCamera() {\n\t\tVector viewTranslation = controller.getCameraPosition();\n\n\t\tGL11.glClear(GL11.GL_COLOR_BUFFER_BIT | GL11.GL_DEPTH_BUFFER_BIT);\n\t\tGL11.glMatrixMode(GL11.GL_PROJECTION);\n\t\tGL11.glLoadIdentity();\n\n\t\tfloat whRatio = (float) windowWidth / (float) windowHeight;\n\t\tGLU.gluPerspective(controller.getFOV(), whRatio, 1, 100000);\n\t\tGLU.gluLookAt((float) viewTranslation.x, (float) viewTranslation.y,\n\t\t\t\t(float) controller.getCameraDistance(), (float) viewTranslation.x,\n\t\t\t\t(float) viewTranslation.y, 0, 0, 1, 0);\n\n\t\tGL11.glMatrixMode(GL11.GL_MODELVIEW);\n\t\tGL11.glLoadIdentity();\n\t}", "private void calculateMatrices() {\n viewMatrix = new Matrix();\n clipRect = null;\n\n float actualWidth = gameModel.actualWidth = getWidth();\n float actualHeight = gameModel.actualHeight = getHeight();\n float virtualWidth = gameModel.getWidth();\n float virtualHeight = gameModel.getHeight();\n\n float scale = Math.max(virtualWidth / actualWidth, virtualHeight / actualHeight);\n if (scale < 0.99 || scale > 1.01) {\n viewMatrix.postScale(1f / scale, 1f / scale);\n\n float extraW = actualWidth * scale - virtualWidth;\n float extraH = actualHeight * scale - virtualHeight;\n\n if (extraW > 1f || extraH > 1f) {\n viewMatrix.postTranslate(extraW / scale / 2f, extraH / scale / 2f);\n clipRect = new RectF(0, 0, virtualWidth, virtualHeight);\n }\n }\n\n // Invert the view matrix, to obtain a matrix that can be used for translating\n // touch events back to virtual coordinates.\n touchMatrix = new Matrix(viewMatrix);\n touchMatrix.invert(touchMatrix);\n }", "private double translateX( double xRaw )\r\n {\r\n double x = xRaw;\r\n \r\n // Zoom\r\n x = x * zoomFactor;\r\n \r\n // Shift\r\n x = x - viewMinX;\r\n \r\n // Center\r\n double cShift = (getWidth()/2) - ((viewMaxX-viewMinX)/2);\r\n x = x + cShift;\r\n \r\n return x;\r\n }", "private static void verifyViewPoint() {\n if (viewPoint.x < 0)\n viewPoint.x = 0;\n if (viewPoint.y < 0)\n viewPoint.y = 0;\n if (viewPoint.x > map.WIDTH - GAME_WIDTH * zoom)\n viewPoint.x = map.WIDTH - ((int) (GAME_WIDTH * zoom));\n if (viewPoint.y > map.HEIGHT - GAME_HEIGHT * zoom)\n viewPoint.y = map.HEIGHT - ((int) (GAME_HEIGHT * zoom));\n }", "public static void main(String[] args) {\n// Vector v1 = new Vector(new double[]{0, 0, 1});\n// Vector v2 = new Vector(new double[]{1, 0, 0});\n// System.out.println(v1.dot(v2));\n System.setProperty(\"sun.java2d.opengl\", \"true\");\n \n // Make World\n //WorldSpace world = new StreetWorldSpace();\n WorldSpace world = new TestWorldSpace();\n //WorldSpace world = new BigAssPolygonSpace();\n \n // Make Frame\n JFrame frame = new JFrame();\n \n // Get effective screen size\n Dimension screenSize = getScreenDimension(frame);\n\n // Set Camera View dimensions\n int width = 730;\n int height = width;\n \n // Make Camera\n Polygon[] polygons = world.getPolygons();\n Camera camera = new Camera(polygons, width, height, frame.getGraphicsConfiguration());\n image = camera.observe();\n \n // Make Camera Control Panel\n// int controlPanelHeight = 100;\n// CameraControlPanel cameraControlPanel = new CameraControlPanel(camera);\n// cameraControlPanel.setPreferredSize(new Dimension(width, controlPanelHeight));\n// cameraControlPanel.setBorder(BorderFactory.createCompoundBorder(new LineBorder(Color.BLACK, 2, false), new EmptyBorder(10, 10, 10, 10)));\n \n // Make Camera View Component\n CameraViewComponent cameraViewComponent = new CameraViewComponent(camera);\n cameraViewComponent.updateImage(image);\n cameraViewComponent.updateData(camera.getData());\n cameraViewComponent.setPreferredSize(new Dimension(width, height));\n\n // Make Camera Panel\n JPanel cameraPanel = new JPanel();\n cameraPanel.setLayout(new BoxLayout(cameraPanel, BoxLayout.Y_AXIS));\n cameraPanel.setPreferredSize(new Dimension(width, height));// + controlPanelHeight));\n cameraPanel.add(cameraViewComponent);\n //cameraPanel.add(cameraControlPanel);\n\n // Make Camera Data Panel\n //CameraDataPanel cameraDataPanel = new CameraDataPanel(camera);\n \n // Make Master Panel\n JPanel masterPanel = new JPanel();\n masterPanel.add(cameraPanel);\n //masterPanel.add(cameraDataPanel);\n \n frame.add(masterPanel);\n frame.pack();\n frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);\n frame.setVisible(true);\n\n // Make keyboard listener\n KeyListener kl = new KeyListener();\n \n // Time\n int lastTenthOfASecond = 0;\n double lastMilliSecond = 0;\n double currentMilliSecond = System.currentTimeMillis();\n double averageFrameRate = 0;\n double currentFrameRate = 0;\n long totalTime = 0;\n long totalFrames = 0;\n \n // Redraw camera view upon keyboard input\n while(true) { \n int currentTenthOfASecond = (int)((currentMilliSecond%1000)/100);\n if (currentMilliSecond/100 > lastMilliSecond/100) {\n boolean cameraMoved = false;\n if (kl.isWPressed()) {\n camera.move(FORWARD); \n cameraMoved = true;\n }\n if (kl.isSPressed()) {\n camera.move(BACKWARD); \n cameraMoved = true;\n }\n if (kl.isAPressed()) {\n camera.move(LEFT); \n cameraMoved = true;\n }\n if (kl.isDPressed()) {\n camera.move(RIGHT); \n cameraMoved = true;\n }\n if (kl.isSpacePressed()) {\n camera.move(UP); \n cameraMoved = true;\n }\n if (kl.isShiftPressed()) {\n camera.move(DOWN); \n cameraMoved = true;\n }\n if (cameraViewComponent.wasUpdated()) {\n cameraMoved = true;\n }\n// if (cameraControlPanel.getWasCameraChanged() || cameraViewComponent.wasUpdated()) {\n// cameraMoved = true;\n// }\n if (cameraMoved) {\n image = camera.observe();\n cameraViewComponent.updateImage(image);\n //cameraDataPanel.update();\n //cameraControlPanel.update(); \n totalFrames++;\n totalTime += currentMilliSecond-lastMilliSecond + 1;\n averageFrameRate = (totalFrames)/(totalTime/1000.0); \n currentFrameRate = (1000.0/(currentMilliSecond-lastMilliSecond));\n \n }\n }\n if (currentTenthOfASecond > lastTenthOfASecond) {\n \n String[] cameraData = camera.getData();\n String[] frameData = {\n \"Average Framerate: \" + String.format(\"%.2f\", averageFrameRate), \n \"Current Framerate: \" + String.format(\"%.2f\",currentFrameRate)\n };\n String[] data = new String[cameraData.length + frameData.length ];\n System.arraycopy(cameraData, 0, data, 0, cameraData.length);\n System.arraycopy(frameData, 0, data, cameraData.length, frameData.length);\n cameraViewComponent.updateData(data);\n } \n lastTenthOfASecond = currentTenthOfASecond;\n lastMilliSecond = currentMilliSecond;\n currentMilliSecond = System.currentTimeMillis(); \n }\n }", "private Dimension calculateTranslate() {\n \t\n \tint maxx=50;\n \tint minx=0;\n \tint maxy=50;\n \tint miny=0;\n \t\n \tVector v=Selector.getInstance().getAllEntitiesOnPanel();\n \tfor (int i=0; i<v.size(); i++) {\n \t\tEntity e =(Entity)v.elementAt(i);\n \t\tmaxx=Math.max(maxx,e.getX()+e.getWidth()+20);\n \t\tmaxy=Math.max(maxy,e.getY()+e.getHeight()+20);\n \t\tminx=Math.min(minx,e.getX()-20);\n \t\tminy=Math.min(miny,e.getY()-20);\n \t}\n \treturn new Dimension(minx,miny);\n }", "public Vector3f getTranslationVec() {\n\t\treturn m_xforms[NvCameraXformType.MAIN].m_translate;\n\t}", "public void centerCameraOn(GameObject thing) {\r\n\t\tthis.cameraX = (int)(thing.getX() - Game.WIDTH / 2);\r\n\t\tthis.cameraY = (int) (thing.getY() - Game.HEIGHT / 2);\r\n\t}", "private void updateRotated() {\r\n\r\n\tfor (int n = 0; n < npoints * 3; n += 3) {\r\n\r\n\t // take the linear sum of local co-ords with local\r\n\t // unit vectors and then translate by adding the local\r\n\t // origin's co-ords\r\n\t ps[n] = locals[n] * i[0] + locals[n + 1] * j[0] + locals[n + 2] * k[0];\r\n\t ps[n + 1] = locals[n] * i[1] + locals[n + 1] * j[1] + locals[n + 2] * k[1];\r\n\t ps[n + 2] = locals[n] * i[2] + locals[n + 1] * j[2] + locals[n + 2] * k[2];\r\n\r\n\t ps[n] += p[0];\r\n\t ps[n + 1] += p[1];\r\n\t ps[n + 2] += p[2];\r\n\t}\r\n\r\n\t// reset bounding box and clear dirty flags\r\n\tbox.setBB();\r\n\tdirtyR = false;\r\n\tdirtyT = false;\r\n\r\n\t// normals must be reset\r\n\tthis.setNormals();\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\t_roll = roll;\r\n }", "public void updateTransformMatrix(float[] fArr) {\n boolean z;\n float f;\n float f2;\n boolean z2 = true;\n if (!this.mVideoStabilizationCropped || !ModuleManager.isVideoModule()) {\n f2 = 1.0f;\n f = 1.0f;\n z = false;\n } else {\n f2 = MOVIE_SOLID_CROPPED_X * 1.0f;\n f = MOVIE_SOLID_CROPPED_Y * 1.0f;\n z = true;\n }\n if (this.mNeedCropped) {\n f2 *= this.mScaleX;\n f *= this.mScaleY;\n z = true;\n }\n if (this.mDisplayOrientation == 0) {\n z2 = z;\n }\n if (z2) {\n Matrix.translateM(fArr, 0, 0.5f, 0.5f, 0.0f);\n Matrix.rotateM(fArr, 0, (float) this.mDisplayOrientation, 0.0f, 0.0f, 1.0f);\n Matrix.scaleM(fArr, 0, f2, f, 1.0f);\n Matrix.translateM(fArr, 0, -0.5f, -0.5f, 0.0f);\n }\n }", "public void translate(float theX, float theY) {\n\t}", "private void fixView(final float newX, final float newY) {\n final float x = this.worldView.getX();\n final float y = this.worldView.getY();\n final float scale = this.worldView.getScale();\n final int width = this.worldView.getMasterImage().getWidth();\n final int height = this.worldView.getMasterImage().getHeight();\n\n float updatedX = Math.max(0, newX);\n float updatedY = Math.max(0, newY);\n\n\n if (width * scale + x > width) {\n updatedX = width - (width * scale);\n }\n if (height * scale + y > height) {\n updatedY = height - (height * scale);\n }\n\n this.worldView.setX(updatedX);\n this.worldView.setY(updatedY);\n\n }", "public void apply() {\n\t\tglTranslated(0, 0, -centerDistance);\n\t\tglRotated(pitch, 1, 0, 0);\n\t\tglRotated(yaw, 0, 0, 1);\n\t\tglScaled(scale, scale, scale);\n\n\t\tglTranslated(-pos.get(0), -pos.get(1), -pos.get(2));\n\t}", "private void translate(final double w, final double h, final double z) {\n mesh.setTranslation(0, w / 2, h / 2 + z);\n }", "public void updateTransform() {\n \t\tif (viewBox != null) {\n \t\t\tOMSVGRect bbox = ((SVGRectElement)viewBox.getElement()).getBBox();\n //\t\t\tGWT.log(\"bbox = \" + bbox.getDescription());\n \t\t\tfloat d = (float)Math.sqrt((bbox.getWidth() * bbox.getWidth() + bbox.getHeight() * bbox.getHeight()) * 0.25) * scale * 2;\n //\t\t\tGWT.log(\"d = \" + d);\n \t\t\n \t\t\t// Compute the actual canvas size. It is the max of the window rect\n \t\t\t// and the transformed bbox.\n \t\t\tfloat width = Math.max(d, windowRect.getWidth());\n \t\t\tfloat height = Math.max(d, windowRect.getHeight());\n //\t\t\tGWT.log(\"width = \" + width);\n //\t\t\tGWT.log(\"height = \" + height);\n \n \t\t\t// Compute the display transform to center the image in the\n \t\t\t// canvas\n \t\t\tOMSVGMatrix m = svg.createSVGMatrix();\n \t\t\tfloat cx = bbox.getCenterX();\n \t\t\tfloat cy = bbox.getCenterY();\n \t\t\tm = m.translate(0.5f * (width - bbox.getWidth()) -bbox.getX(), 0.5f * (height - bbox.getHeight()) -bbox.getY())\n \t\t\t.translate(cx, cy)\n \t\t\t.rotate(angle)\n \t\t\t.scale(scale)\n \t\t\t.translate(-cx, -cy);\n \t\t\t((ISVGTransformable)xformGroup).getTransform().getBaseVal().getItem(0).setMatrix(m);\n \t\t\t((ISVGTransformable)modelGroup.getTwinWrapper()).getTransform().getBaseVal().getItem(0).setMatrix(m);\n //\t\t\tGWT.log(\"m=\" + m.getDescription());\n \t\t\tsvg.getStyle().setWidth(width, Unit.PX);\n \t\t\tsvg.getStyle().setHeight(height, Unit.PX);\n \t\t}\n \t}", "private void setCamera(GL2 gl, GLU glu)\n {\n Boundary bc = simulation.getBoundary();\n int w = (int) (bc.getMaxSize(0)-bc.getMinSize(0));\n int h = (int) (bc.getMaxSize(1)-bc.getMinSize(1));\n\n gl.glViewport(0, 0, w, h);\n\n\n gl.glMatrixMode(GL2.GL_PROJECTION);\n gl.glLoadIdentity();\n //opening angle, ratio of height and width, near and far\n glu.gluPerspective(80.0, 1,0.1,3*( bc.getMaxSize(2)-bc.getMinSize(2)));\n\n gl.glTranslatef(0.5f*(float) bc.getMinSize(0),-0.5f*(float) bc.getMinSize(1),1.5f*(float) bc.getMinSize(2));\n // gl.glTranslatef(0.5f*(float) (bc.getMaxSize(0)+bc.getMinSize(0)),0.5f*(float)(bc.getMaxSize(1)+ bc.getMinSize(1)),(float) -(bc.getMaxSize(2)-bc.getMinSize(2)));\n\n }", "public final void glTranslatef(final float x, final float y, final float z) {\n matrixTrans[0+4*3] = x;\n matrixTrans[1+4*3] = y;\n matrixTrans[2+4*3] = z;\n glMultMatrixf(matrixTrans, 0);\n }", "public void checkWorldCollisions(Bounds bounds) {\n final boolean atRightBorder = getShape().getLayoutX() >= (bounds.getMaxX() - RADIUS);\n final boolean atLeftBorder = getShape().getLayoutX() <= RADIUS;\n final boolean atBottomBorder = getShape().getLayoutY() >= (bounds.getMaxY() - RADIUS);\n final boolean atTopBorder = getShape().getLayoutY() <= RADIUS;\n final double padding = 1.00;\n\n if (atRightBorder) {\n getShape().setLayoutX(bounds.getMaxX() - (RADIUS * padding));\n velX *= frictionX;\n velX *= -1;\n }\n if (atLeftBorder) {\n getShape().setLayoutX(RADIUS * padding);\n velX *= frictionX;\n velX *= -1;\n }\n if (atBottomBorder) {\n velY *= -1;\n velY *= frictionY;\n getShape().setLayoutY(bounds.getMaxY() - (RADIUS * padding));\n }\n if (atTopBorder) {\n velY *= -1;\n velY *= frictionY;\n getShape().setLayoutY(RADIUS * padding);\n }\n }", "private void initCamera(SubScene scene, Group root){\n //Create a perspective camera for 3D use and add it to the scene.\n PerspectiveCamera camera = new PerspectiveCamera(true);\n scene.setCamera(camera);\n\n //Set the camera's field of view, near and far pane, and starting zoom.\n camera.setFieldOfView(80);\n camera.setNearClip(1);\n camera.setFarClip(5000);\n camera.setTranslateZ(-1000);\n\n //Initiate the rotation objects used for rotating the camera about the world.\n Rotate xRotate = new Rotate(0, Rotate.X_AXIS);\n Rotate yRotate = new Rotate(0, Rotate.Y_AXIS);\n root.getTransforms().addAll(xRotate, yRotate);\n\n //Bind the property so it automatically updates.\n xRotate.angleProperty().bind(angleX);\n yRotate.angleProperty().bind(angleY);\n\n //Add an event listener to track the start of a mouse drag when the mouse is clicked.\n scene.setOnMousePressed(event -> {\n dragStartX = event.getSceneX();\n dragStartY = event.getSceneY();\n anchorAngleX = angleX.get();\n anchorAngleY = angleY.get();\n });\n\n //Add an event listener to update the rotation objects based on the distance dragged.\n scene.setOnMouseDragged(event -> {\n //A modifier (0.2 in this case) is used to control the sensitivity.\n Double newAngleX = anchorAngleX - (dragStartY - event.getSceneY())*0.2;\n //Restrict the rotation to angles less than 90.\n if(newAngleX > 90){\n angleX.set(90);\n //Restrict the rotation to angles greater than 5.\n } else if (newAngleX < 5){\n angleX.set(5);\n } else {\n angleX.set(newAngleX);\n }\n angleY.set(anchorAngleY + (dragStartX - event.getSceneX())*0.2);\n });\n\n //Add an event listener to move the camera away or towards the scene using the mouse wheel.\n scene.setOnScroll(event -> {\n Double delta = event.getDeltaY();\n //If the mouse scrolls in, and the camera is not too close, then move the camera closer.\n if(delta > 0 && camera.getTranslateZ() <= -100){\n camera.setTranslateZ(camera.getTranslateZ()*0.975);\n //Else, if the mouse scrolls out and it's not too far away, then move the camera away.\n } else if(delta <0 && camera.getTranslateZ() >= -3000){\n camera.setTranslateZ(camera.getTranslateZ()* 1/0.975);\n }\n });\n }", "private void reboundCameraOffset(Point offset, EnumSet<Direction> directions) {\n int boundsStartX = 0;\n int boundsEndX = tileMap.getPixelWidth();\n int boundsStartY = 0;\n int boundsEndY = tileMap.getPixelHeight();\n if (offset.x < boundsStartX && directions.contains(Direction.LEFT)) {\n offset.x = boundsStartX;\n } else if (offset.x + screenWidth > boundsEndX && directions.contains(Direction.RIGHT)) {\n offset.x = boundsEndX - screenWidth;\n }\n if (offset.y < boundsStartY && directions.contains(Direction.UP)) {\n offset.y = boundsStartY;\n } else if (offset.y + screenHeight > boundsEndY && directions.contains(Direction.DOWN)) {\n offset.y = boundsEndY - screenHeight;\n }\n }", "public abstract Vector4fc normalize3();", "public\n Projection project ( double x , double y , double z , ClampMode clampModeOutside , boolean extrudeInverted ) {\n boolean outsideFrustum;\n if ( this.viewport == null || this.modelview == null || this.projection == null )\n return new Projection ( 0.0 , 0.0 , Projection.Type.FAIL );\n Vector3D posVec = new Vector3D ( x , y , z );\n boolean[] frustum = this.doFrustumCheck ( this.frustum , this.frustumPos , x , y , z );\n boolean bl = outsideFrustum = frustum[0] || frustum[1] || frustum[2] || frustum[3];\n if ( outsideFrustum ) {\n boolean outsideInvertedFrustum;\n boolean opposite = posVec.sub ( this.frustumPos ).dot ( this.viewVec ) <= 0.0;\n boolean[] invFrustum = this.doFrustumCheck ( this.invFrustum , this.frustumPos , x , y , z );\n boolean bl2 = outsideInvertedFrustum = invFrustum[0] || invFrustum[1] || invFrustum[2] || invFrustum[3];\n if ( extrudeInverted && ! outsideInvertedFrustum || outsideInvertedFrustum && clampModeOutside != ClampMode.NONE ) {\n if ( extrudeInverted && ! outsideInvertedFrustum || clampModeOutside == ClampMode.DIRECT && outsideInvertedFrustum ) {\n double vecX = 0.0;\n double vecY = 0.0;\n if ( ! GLU.gluProject ( (float) x , (float) y , (float) z , this.modelview , this.projection , this.viewport , this.coords ) )\n return new Projection ( 0.0 , 0.0 , Projection.Type.FAIL );\n if ( opposite ) {\n vecX = this.displayWidth * this.widthScale - (double) this.coords.get ( 0 ) * this.widthScale - this.displayWidth * this.widthScale / 2.0;\n vecY = this.displayHeight * this.heightScale - ( this.displayHeight - (double) this.coords.get ( 1 ) ) * this.heightScale - this.displayHeight * this.heightScale / 2.0;\n } else {\n vecX = (double) this.coords.get ( 0 ) * this.widthScale - this.displayWidth * this.widthScale / 2.0;\n vecY = ( this.displayHeight - (double) this.coords.get ( 1 ) ) * this.heightScale - this.displayHeight * this.heightScale / 2.0;\n }\n Vector3D vec = new Vector3D ( vecX , vecY , 0.0 ).snormalize ( );\n vecX = vec.x;\n vecY = vec.y;\n Line vectorLine = new Line ( this.displayWidth * this.widthScale / 2.0 , this.displayHeight * this.heightScale / 2.0 , 0.0 , vecX , vecY , 0.0 );\n double angle = Math.toDegrees ( Math.acos ( vec.y / Math.sqrt ( vec.x * vec.x + vec.y * vec.y ) ) );\n if ( vecX < 0.0 ) {\n angle = 360.0 - angle;\n }\n Vector3D intersect = new Vector3D ( 0.0 , 0.0 , 0.0 );\n intersect = angle >= this.bra && angle < this.tra ? this.rb.intersect ( vectorLine ) : ( angle >= this.tra && angle < this.tla ? this.tb.intersect ( vectorLine ) : ( angle >= this.tla && angle < this.bla ? this.lb.intersect ( vectorLine ) : this.bb.intersect ( vectorLine ) ) );\n return new Projection ( intersect.x , intersect.y , outsideInvertedFrustum ? Projection.Type.OUTSIDE : Projection.Type.INVERTED );\n }\n if ( clampModeOutside != ClampMode.ORTHOGONAL || ! outsideInvertedFrustum )\n return new Projection ( 0.0 , 0.0 , Projection.Type.FAIL );\n if ( ! GLU.gluProject ( (float) x , (float) y , (float) z , this.modelview , this.projection , this.viewport , this.coords ) )\n return new Projection ( 0.0 , 0.0 , Projection.Type.FAIL );\n double guiX = (double) this.coords.get ( 0 ) * this.widthScale;\n double guiY = ( this.displayHeight - (double) this.coords.get ( 1 ) ) * this.heightScale;\n if ( opposite ) {\n guiX = this.displayWidth * this.widthScale - guiX;\n guiY = this.displayHeight * this.heightScale - guiY;\n }\n if ( guiX < 0.0 ) {\n guiX = 0.0;\n } else if ( guiX > this.displayWidth * this.widthScale ) {\n guiX = this.displayWidth * this.widthScale;\n }\n if ( guiY < 0.0 ) {\n guiY = 0.0;\n return new Projection ( guiX , guiY , outsideInvertedFrustum ? Projection.Type.OUTSIDE : Projection.Type.INVERTED );\n } else {\n if ( ! ( guiY > this.displayHeight * this.heightScale ) )\n return new Projection ( guiX , guiY , outsideInvertedFrustum ? Projection.Type.OUTSIDE : Projection.Type.INVERTED );\n guiY = this.displayHeight * this.heightScale;\n }\n return new Projection ( guiX , guiY , outsideInvertedFrustum ? Projection.Type.OUTSIDE : Projection.Type.INVERTED );\n }\n if ( ! GLU.gluProject ( (float) x , (float) y , (float) z , this.modelview , this.projection , this.viewport , this.coords ) )\n return new Projection ( 0.0 , 0.0 , Projection.Type.FAIL );\n double guiX = (double) this.coords.get ( 0 ) * this.widthScale;\n double guiY = ( this.displayHeight - (double) this.coords.get ( 1 ) ) * this.heightScale;\n if ( ! opposite )\n return new Projection ( guiX , guiY , outsideInvertedFrustum ? Projection.Type.OUTSIDE : Projection.Type.INVERTED );\n guiX = this.displayWidth * this.widthScale - guiX;\n guiY = this.displayHeight * this.heightScale - guiY;\n return new Projection ( guiX , guiY , outsideInvertedFrustum ? Projection.Type.OUTSIDE : Projection.Type.INVERTED );\n }\n if ( ! GLU.gluProject ( (float) x , (float) y , (float) z , this.modelview , this.projection , this.viewport , this.coords ) )\n return new Projection ( 0.0 , 0.0 , Projection.Type.FAIL );\n double guiX = (double) this.coords.get ( 0 ) * this.widthScale;\n double guiY = ( this.displayHeight - (double) this.coords.get ( 1 ) ) * this.heightScale;\n return new Projection ( guiX , guiY , Projection.Type.INSIDE );\n }", "public void transform() {\n final var bounds = getParentBounds();\n transform( bounds.width, bounds.height );\n }", "private void moveCamera(float tpf) {\n //Place the camera at the node\n this.getCamera().setLocation(cameraNode.getLocalTranslation().multLocal(1,0,1).add(0, 2, 0));\n cameraNode.lookAt(cam.getDirection().mult(999999), new Vector3f(0,1,0)); //Makes the gun point\n if (im.up) {\n cameraNode.move(getCamera().getDirection().mult(tpf).mult(10));\n }\n else if (im.down) {\n cameraNode.move(getCamera().getDirection().negate().mult(tpf).mult(10));\n }\n if (im.right) {\n cameraNode.move(getCamera().getLeft().negate().mult(tpf).mult(10));\n }\n else if (im.left) {\n cameraNode.move(getCamera().getLeft().mult(tpf).mult(10));\n }\n }", "public void setTransform(Rectangle view, Rectangle2D limits) {\n this.view = view;\n\t\tRectangle2D.Double lim = (Rectangle2D.Double)limits.clone();\n xUnit = (view.width/(lim.width - lim.x));\n yUnit = (view.height/(lim.height - lim.y));\n \n if (xUnit > yUnit){\n\t\t\txUnit = yUnit;\n\t\t\tlim.width = ((view.width/xUnit) + lim.x);\n }else{\n\t\t\tyUnit = xUnit;\n\t\t\tlim.height = ((view.height/yUnit) + lim.y);\n }\n\t\t\n aux.setToIdentity();\n transform.setToIdentity();\n aux.translate(lim.x, lim.y);\n transform.concatenate(aux);\n aux.setToIdentity();\n aux.scale(1/xUnit, -1/yUnit);\n transform.concatenate(aux);\n aux.setToIdentity();\n aux.translate(0, (-1) * (view.height - 1));\n transform.concatenate(aux);\n try {\n inverse = transform.createInverse();\n \t}catch (Exception e){\n\t\t\tSystem.out.println(\"Unable to create inverse trasform\");\n\t\t}\n\t\t\n this.limits = limits;\n\t\t\n }", "@Override\n public void applySurfaceParams(SurfaceParams[] params) {\n RectF newAppBounds = new RectF(mAppBounds);\n params[0].matrix.mapRect(newAppBounds);\n Assert.assertThat(newAppBounds, new AlmostSame(mAppBounds));\n\n System.err.println(\"Bounds mapped: \" + mAppBounds + \" => \" + newAppBounds);\n }", "protected void applyMatrices () {\n combinedMatrix.set(projectionMatrix).mul(transformMatrix);\n getShader().setUniformMatrix(\"u_projTrans\", combinedMatrix);\n }", "private void updateTranslationfromCenterAnchor(Pose pose, int teapotId) {\n float poseX = pose.tx();\n float poseZ = pose.tz();\n\n float anchorPoseX = globalCenterPose.tx();\n float anchorPoseZ = globalCenterPose.tz();\n\n float[] translate = new float[3];\n\n if (poseX > anchorPoseX) {\n translate[0] = poseX - anchorPoseX;\n } else {\n translate[0] = -(anchorPoseX - poseX);\n }\n\n if (poseZ > anchorPoseZ) {\n translate[2] = poseZ - anchorPoseZ;\n } else {\n translate[2] = -(anchorPoseZ - poseZ);\n }\n\n teapotTranslations[teapotId] = translate;\n }", "public void translate(double x, double y, double z){\n \n \tMatrix trans = new Matrix();\n \ttrans.identity();\n \ttrans.set(1,4,x);\n \ttrans.set(2,4,y);\n \ttrans.set(3,4,x);\n \tthis.leftMultiply(trans);\n\n /* this doesn't work yet\n this.temp.identity();\n temp.set(1,4,x);\n temp.set(2,4,y);\n temp.set(3,4,x);\n this.leftMultiply(temp); */\n }", "@Override\r\n protected Matrix4f genViewMatrix() {\r\n\r\n // refreshes the position\r\n position = calcPosition();\r\n\r\n // calculate the camera's coordinate system\r\n Vector3f[] coordSys = genCoordSystem(position.subtract(center));\r\n Vector3f right, up, forward;\r\n forward = coordSys[0];\r\n right = coordSys[1];\r\n up = coordSys[2];\r\n\r\n // we move the world, not the camera\r\n Vector3f position = this.position.negate();\r\n\r\n return genViewMatrix(forward, right, up, position);\r\n }", "public void translate(int x, int y);", "protected void updateCameraPosition() {\n if (!mIsMapStatic && mMap != null && mMapConfiguration != null && mIsMapLoaded) {\n updateCameraPosition(mMapConfiguration.getCameraPosition());\n }\n }", "private void applyTransform() {\n GlStateManager.rotate(180, 1.0F, 0.0F, 0.0F);\n GlStateManager.translate(offsetX, offsetY - 26, offsetZ);\n }", "public void update(List<Player> players) {\n float playersMinX = Integer.MAX_VALUE;\n float playersMaxX = Integer.MIN_VALUE;\n float playersMinY = Integer.MAX_VALUE;\n float playersMaxY = Integer.MIN_VALUE;\n\n for (Player p : players) {\n playersMinX = Math.min(p.damsel.pos.x, playersMinX);\n playersMaxX = Math.max(p.damsel.pos.x, playersMaxX);\n playersMinY = Math.min(p.damsel.pos.y, playersMinY);\n playersMaxY = Math.max(p.damsel.pos.y + p.damsel.pos.z, playersMaxY);\n }\n\n // Offset to account for the player size (we want the players to be fully encompassed by the camera)\n playersMinX -= players.get(0).damsel.getVisualWidth() / 2;\n playersMaxX += players.get(0).damsel.getVisualWidth() / 2;\n playersMinY -= players.get(0).damsel.shadow.getHeight();\n playersMaxY += players.get(0).damsel.getVisualHeight() + players.get(0).damsel.shadow.getHeight() / 2;\n\n float deltaX = playersMaxX - playersMinX;\n float deltaY = playersMaxY - playersMinY;\n\n float ratio = Math.max(Math.max(deltaX / (float)Gdx.graphics.getWidth(), deltaY / (float)Gdx.graphics.getHeight()), 1);\n lastRatio = lastRatio * 0.9f + ratio * 0.1f;\n lastX = lastX * 0.9f + (playersMinX + deltaX / 2) * 0.1f;\n lastY = lastY * 0.9f + (playersMinY + deltaY / 2) * 0.1f;\n ratio = lastRatio;\n\n float transformedWidth = Gdx.graphics.getWidth() * ratio;\n float transformedHeight = Gdx.graphics.getHeight() * ratio;\n\n innerCamera.setToOrtho(false,\n transformedWidth,\n transformedHeight\n );\n innerCamera.translate(\n Math.round(lastX - transformedWidth / 2),\n Math.round(lastY - transformedHeight / 2)\n );\n\n innerCamera.update();\n }", "public BoundingBox3d transform(SpaceTransformer transformers) {\n return new BoundingBox3d(transformers.getX().compute(xmin), transformers.getX().compute(xmax),\n transformers.getY().compute(ymin), transformers.getY().compute(ymax),\n transformers.getZ().compute(zmin), transformers.getZ().compute(zmax));\n }", "public boolean translateSpace( int x, int y )\n\t{\n\t\tboolean success = false;\n\t\t\n\t\t// If translation is horizontal\n\t\tif ( x != 0 )\n\t\t{\n\t\t\tif ( x > 0 && x0 < 2) // Translate right, can't if x0 > 1\n\t\t\t{\n\t\t\t\tgrid[x0][y0] = grid[x0+1][y0];\n\t\t\t\tgrid[x0+1][y0] = 0;\n\t\t\t\t\n\t\t\t\tx0 = x0+1;\n\t\t\t\tsuccess = true;\n\t\t\t}\n\t\t\telse if ( x < 0 && x0 > 0 ) // Translate left, can't if x0 < 1\n\t\t\t{\n\t\t\t\tgrid[x0][y0] = grid[x0-1][y0];\n\t\t\t\tgrid[x0-1][y0] = 0;\n\t\t\t\t\n\t\t\t\tx0 = x0-1;\n\t\t\t\tsuccess = true;\n\t\t\t}\n\t\t} // If translation is vertical\n\t\telse if ( y != 0 ) // Can't translate diagonal, so if x != 0, then y wont be translated no matter\n\t\t{\t\t\t\t // what it is, and visa versa\n\t\t\tif ( y > 0 && y0 < 2) // Translate down, can't if y0 > 1\n\t\t\t{\n\t\t\t\tgrid[x0][y0] = grid[x0][y0+1];\n\t\t\t\tgrid[x0][y0+1] = 0;\n\t\t\t\t\n\t\t\t\ty0 = y0+1;\n\t\t\t\tsuccess = true;\n\t\t\t}\n\t\t\telse if ( y < 0 && y0 > 0 ) // Translate up, cant if y0 < 1\n\t\t\t{\n\t\t\t\tgrid[x0][y0] = grid[x0][y0-1];\n\t\t\t\tgrid[x0][y0-1] = 0;\n\t\t\t\t\n\t\t\t\ty0 = y0-1;\n\t\t\t\tsuccess = true;\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn success;\n\t}", "private void transformation(GL gl)\n {\n\t\t// Make X axis face forward, Y right, Z up\n\t\t// (map ZXY to XYZ)\n\t\tgl.glRotated(-90, 1, 0, 0);\n\t\tgl.glRotated(-90, 0, 0, 1);\n\t \n\t\tif (drawBugView.value) {\n\t\t // ---- \"Bug cam\" transformation (for mainBug)\n\t\t\t// this is the inverse of the M transformation that places the bug in the scene (based on mainbug pos and vel)\n double angle = Math.atan2(mainBug.vel.y, mainBug.vel.x);\n \t\tgl.glRotated(Math.toDegrees(Math.PI - angle), 0, 0, 1);\n \t\t\n \t\t//drawing a bit above the z axis so we can see the ground\n\t\t\tgl.glTranslated(-mainBug.pos.x, -mainBug.pos.y, -mainBug.pos.z-0.2);\n\t\t} else {\n\t\t // ---- Ordinary scene transformation\n\t\n\t\t // Move camera back so that scene is visible\n\t\t gl.glTranslated(-20, 0, 0);\n\t\t \n\t\t // Translate by Zoom/Horiz/Vert\n\t\t gl.glTranslated(tZ.value, tH.value, tV.value);\n\t\t \n\t\t // Rotate by Alt/Azim\n\t\t gl.glRotated(rAlt.value, 0, 1, 0);\n\t\t gl.glRotated(rAzim.value, 0, 0, 1);\n\t\t}\n }", "public void setTranslation(float x, float y,float z) {\n\t\tm_xforms[NvCameraXformType.MAIN].m_translate.set(x, y, z);\n\t}", "public AlignByCamera ()\n\t{\n\t\trequires(Subsystems.transmission);\n\t\trequires(Subsystems.goalVision);\n\n\t\tthis.motorRatio = DEFAULT_ALIGNMENT_SPEED;\n\t}", "public interface ICanvasTransform {\r\n\r\n\t/**\r\n\t * Inverse-transforms a relative length along the X axis to world\r\n\t * coordinates.\r\n\t * \r\n\t * @param screen\r\n\t * the length on screen.\r\n\t * @return the corresponding length in world coordinates.\r\n\t */\r\n\tdouble transformXScreenLengthToWorld(final double screen);\r\n\r\n\t/**\r\n\t * Inverse-transforms a relative length along the Y axis to world\r\n\t * coordinates.\r\n\t * \r\n\t * @param screen\r\n\t * the length on screen.\r\n\t * @return the corresponding length in world coordinates.\r\n\t */\r\n\tdouble transformYScreenLengthToWorld(final double screen);\r\n\r\n\t/**\r\n\t * Inverse-transforms a point on the screen to absolute world coordinates.\r\n\t * \r\n\t * @param screen\r\n\t * the canvas screen coordinate.\r\n\t * @return the corresponding world coordinate.\r\n\t */\r\n\tWorldCoordinate transformScreenToWorld(final DeviceCoordinate screen);\r\n\r\n\t/**\r\n\t * Inverse-transforms a distance in screen space to a corresponding distance\r\n\t * in world coordinates.\r\n\t * \r\n\t * @param screen\r\n\t * the distance on screen.\r\n\t * @return the corresponding distance in world coordinates.\r\n\t */\r\n\tWorldDistance transformScreenDeltaToWorld(final DeviceDistance screen);\r\n\r\n\t/**\r\n\t * Transforms a world coordinate to a point on the canvas screen.\r\n\t * \r\n\t * @param x\r\n\t * the x coordinate in world space.\r\n\t * @param y\r\n\t * the y coordinate in world space.\r\n\t * @return the corresponding point on the canvas screen.\r\n\t */\r\n\tDeviceCoordinate transformWorldToScreen(final double x, final double y);\r\n\r\n\t/**\r\n\t * @param world\r\n\t * @return\r\n\t */\r\n\tDeviceCoordinate transformWorldToScreen(WorldCoordinate world);\r\n\r\n\t/**\r\n\t * @param world\r\n\t * @return\r\n\t */\r\n\tint transformWorldLengthToScreen(final double world);\r\n\r\n}", "public SVector3d getPositionCam() {\n\t\treturn transCamera;\n\t}", "@Override\n\tpublic void mouseDragged(MouseEvent e) {\n\t\tif(scale != 1.0) {\n\t\t\tPoint2D.Double view = new Point2D.Double(e.getX(), e.getY());\n\t\t\tPoint2D.Double worldPoint = new Point2D.Double();\n\t\t\tAffineTransform viewToWorld = new AffineTransform(1.0 / scale, 0, 0, 1.0 / scale, worldUpperLeft.getX(), worldUpperLeft.getY());\n\t\t\tviewToWorld.transform(view, worldPoint);\n\t\t\t\n\t\t\twX = worldPoint.getX();\n\t\t\twY = worldPoint.getY();\n\t\n\t\t\tdouble diffX = wDragStartX - wX;\n\t\t\tdouble diffY = wDragStartY - wY;\n\t\t\tdouble wulX = worldUpperLeft.getX();\n\t\t\tdouble wulY = worldUpperLeft.getY();\n\t\t\tdouble newUpX = diffX + wulX;\n\t\t\tdouble newUpY = diffY + wulY;\n\t\t\t\n\t\t\tif(newUpX < 0)\n\t\t\t\tnewUpX = 0;\n\t\t\tif(newUpY < 0)\n\t\t\t\tnewUpY = 0;\n\t\t\tif(scale == 2.0 && newUpX > 512)\n\t\t\t\tnewUpX = 512;\n\t\t\tif(scale == 2.0 && newUpY > 512)\n\t\t\t\tnewUpY = 512;\n\t\t\tif(scale == 4.0 && newUpX > 768)\n\t\t\t\tnewUpX = 768;\n\t\t\tif(scale == 4.0 && newUpY > 768)\n\t\t\t\tnewUpY = 768;\n\t\t\t\n\t\t\tworldUpperLeft = new Point2D.Double(newUpX, newUpY);\n\t\t\t\n\t\t\tif(worldUpperLeft.getX() + scrollbarSize > MAXSCROLLBARSIZE) \n\t\t\t\tGUIFunctions.setHScrollBarPosit(MAXSCROLLBARSIZE - scrollbarSize);\n\t\t\telse \n\t\t\t\tGUIFunctions.setHScrollBarPosit((int) worldUpperLeft.getX());\n\t\t\t\n\t\t\tif(worldUpperLeft.getY() + scrollbarSize > MAXSCROLLBARSIZE) \n\t\t\t\tGUIFunctions.setVScrollBarPosit(MAXSCROLLBARSIZE - scrollbarSize);\n\t\t\telse \n\t\t\t\tGUIFunctions.setVScrollBarPosit((int) worldUpperLeft.getY());\n\t\t\tGUIFunctions.refresh();\n\t\t}\n\t}", "public void setupCamera() {\r\n p.camera(width/2.0f, height/2.0f, cameraZ,\r\n width/2.0f, height/2.0f, 0, 0, 1, 0);\r\n\r\n if(isTiling) {\r\n float mod=1f/10f;\r\n p.frustum(width*((float)tileX/(float)tileNum-.5f)*mod,\r\n width*((tileX+1)/(float)tileNum-.5f)*mod,\r\n height*((float)tileY/(float)tileNum-.5f)*mod,\r\n height*((tileY+1)/(float)tileNum-.5f)*mod,\r\n cameraZ*mod, 10000);\r\n }\r\n\r\n }", "private void positionObjectInScene(float x, float y, float z) {\n setIdentityM(modelMatrix, 0);\n translateM(modelMatrix, 0, x, y, z);\n multiplyMM(modelViewProjectionMatrix, 0, viewProjectionMatrix,\n 0, modelMatrix, 0);\n }", "@Override\n public void onSurfaceChanged(GL10 unused, int width, int height) {\n GLES20.glViewport(0, 0, width, height);\n \n float ratio = (float) width / height;\n /*\n mWidth = width;\n mHeight = height;\n */\n \n // this projection matrix is applied to object coordinates\n // in the onDrawFrame() method\n /*\n Near / far clipping planes, in terms of units away from the camera\n Cannot be negative or 0, should not be close to 0\n */\n //Matrix.frustumM(mProjMatrix, 0, -ratio, ratio, -1, 1, 3, 7);\n Matrix.frustumM(mProjMatrix, 0, -ratio, ratio, -1, 1, 0.5f, 21);\n \n }", "public void updateTransform(float transX, float transY, float scaleX, float scaleY, int viewportWidth, int viewportHeight) {\n float left = ((float) this.mView.getLeft()) + transX;\n float top = ((float) this.mView.getTop()) + transY;\n RectF r = ZoomView.adjustToFitInBounds(new RectF(left, top, (((float) this.mView.getWidth()) * scaleX) + left, (((float) this.mView.getHeight()) * scaleY) + top), viewportWidth, viewportHeight);\n this.mView.setScaleX(scaleX);\n this.mView.setScaleY(scaleY);\n transX = r.top - ((float) this.mView.getTop());\n this.mView.setTranslationX(r.left - ((float) this.mView.getLeft()));\n this.mView.setTranslationY(transX);\n }", "private void updatePosition() {\n position.add(deltaPosition);\n Vector2[] points = getRotatedPoints();\n\n for (Vector2 point : points) {\n if (point.getX() < bound.getX() || point.getX() > bound.getX() + bound.getWidth()) { //If the point is outside of the bounds because of X\n position.addX(-deltaPosition.getX() * 2); //Undo the move so it is back in bounds\n deltaPosition.setX(-deltaPosition.getX()); //Make the direction it is going bounce to the other direction\n break;\n }\n if (point.getY() < bound.getY() || point.getY() > bound.getY() + bound.getHeight()) { //If the point is outside of the bounds because of Y\n position.addY(-deltaPosition.getY() * 2); //Undo the move so it is back in bounds\n deltaPosition.setY(-deltaPosition.getY()); //Make the direction it is going bounce to the other direction\n break;\n }\n }\n deltaPosition.scale(.98);\n }", "public void mygluLookAt(\n double eX, double eY, double eZ,\n double cX, double cY, double cZ,\n double upX, double upY, double upZ) {\n\n double[] F = new double[3];\n double[] UP = new double[3];\n double[] s = new double[3];\n double[] u = new double[3];\n\n F[0] = cX-eX;\n F[1] = cY-eY;\n F[2] = cZ-eZ;\n UP[0] = upX;\n UP[1] = upY;\n UP[2] = upZ;\n normalize(F);\n normalize(UP);\n crossProd(F, UP, s);\n crossProd(s, F, u);\n\n double[] M = new double[16];\n\n // Switching to row-major order\n M[0] = s[0];\n M[4] = u[0];\n M[8] = -F[0];\n M[12] = 0;\n M[1] = s[1];\n M[5] = u[1];\n M[9] = -F[1];\n M[13] = 0;\n M[2] = s[2];\n M[6] = u[2];\n M[10] = -F[2];\n M[14] = 0;\n M[3] = 0;\n M[7] = 0;\n M[11] = 0;\n M[15] = 1;\n\n projection.multiply(M);\n projection.translate((float)-eX, (float)-eY, (float)-eZ);\n }", "public void scaleAffine(){\n //Get the monitors size.\n Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize();\n transform = new AffineTransform();\n double width = screenSize.getWidth();\n double height = screenSize.getHeight();\n\n //Set up the scale amount for our Affinetransform\n double xscale = width / model.getBbox().getWidth();\n double yscale = height / model.getBbox().getHeight();\n\n double scale = max(xscale, yscale);\n\n adjustZoomLvl(scale);\n transform.translate(-model.getBbox().getMinX(), -model.getBbox().getMaxY());\n\n bounds = new CanvasBounds(getBounds(), transform);\n adjustZoomFactor();\n }", "public void fitContentInBounds(boolean z, boolean z2, boolean z3, boolean z4) {\n float f;\n if (this.state != null) {\n float cropWidth = this.areaView.getCropWidth();\n float cropHeight = this.areaView.getCropHeight();\n float access$2200 = this.state.getOrientedWidth();\n float access$2300 = this.state.getOrientedHeight();\n float access$2500 = this.state.getRotation();\n float radians = (float) Math.toRadians((double) access$2500);\n RectF calculateBoundingBox = calculateBoundingBox(cropWidth, cropHeight, access$2500);\n RectF rectF = new RectF(0.0f, 0.0f, access$2200, access$2300);\n float access$2100 = this.state.getScale();\n this.tempRect.setRect(rectF);\n Matrix access$2600 = this.state.getMatrix();\n access$2600.preTranslate(((cropWidth - access$2200) / 2.0f) / access$2100, ((cropHeight - access$2300) / 2.0f) / access$2100);\n this.tempMatrix.reset();\n this.tempMatrix.setTranslate(rectF.centerX(), rectF.centerY());\n Matrix matrix = this.tempMatrix;\n matrix.setConcat(matrix, access$2600);\n this.tempMatrix.preTranslate(-rectF.centerX(), -rectF.centerY());\n this.tempRect.applyMatrix(this.tempMatrix);\n this.tempMatrix.reset();\n this.tempMatrix.preRotate(-access$2500, access$2200 / 2.0f, access$2300 / 2.0f);\n this.tempRect.applyMatrix(this.tempMatrix);\n this.tempRect.getRect(rectF);\n PointF pointF = new PointF(this.state.getX(), this.state.getY());\n if (!rectF.contains(calculateBoundingBox)) {\n f = (!z || (calculateBoundingBox.width() <= rectF.width() && calculateBoundingBox.height() <= rectF.height())) ? access$2100 : fitScale(rectF, access$2100, calculateBoundingBox.width() / scaleWidthToMaxSize(calculateBoundingBox, rectF));\n fitTranslation(rectF, calculateBoundingBox, pointF, radians);\n } else if (!z2 || this.rotationStartScale <= 0.0f) {\n f = access$2100;\n } else {\n float width = calculateBoundingBox.width() / scaleWidthToMaxSize(calculateBoundingBox, rectF);\n if (this.state.getScale() * width < this.rotationStartScale) {\n width = 1.0f;\n }\n f = fitScale(rectF, access$2100, width);\n fitTranslation(rectF, calculateBoundingBox, pointF, radians);\n }\n float access$2700 = pointF.x - this.state.getX();\n float access$2800 = pointF.y - this.state.getY();\n if (z3) {\n float f2 = f / access$2100;\n if (Math.abs(f2 - 1.0f) >= 1.0E-5f || Math.abs(access$2700) >= 1.0E-5f || Math.abs(access$2800) >= 1.0E-5f) {\n this.animating = true;\n ValueAnimator ofFloat = ValueAnimator.ofFloat(new float[]{0.0f, 1.0f});\n ofFloat.addUpdateListener(new CropView$$ExternalSyntheticLambda0(this, access$2700, new float[]{1.0f, 0.0f, 0.0f}, access$2800, f2));\n final boolean z5 = z4;\n final boolean z6 = z;\n final boolean z7 = z2;\n final boolean z8 = z3;\n ofFloat.addListener(new AnimatorListenerAdapter() {\n public void onAnimationEnd(Animator animator) {\n boolean unused = CropView.this.animating = false;\n if (!z5) {\n CropView.this.fitContentInBounds(z6, z7, z8, true);\n }\n }\n });\n ofFloat.setInterpolator(this.areaView.getInterpolator());\n ofFloat.setDuration(z4 ? 100 : 200);\n ofFloat.start();\n return;\n }\n return;\n }\n this.state.translate(access$2700, access$2800);\n this.state.scale(f / access$2100, 0.0f, 0.0f);\n updateMatrix();\n }\n }", "private AffineTransform createTransform() {\n Dimension size = getSize();\n Rectangle2D.Float panelRect = new Rectangle2D.Float(\n BORDER,\n BORDER,\n size.width - BORDER - BORDER,\n size.height - BORDER - BORDER);\n AffineTransform tr = AffineTransform.getTranslateInstance(panelRect.getCenterX(), panelRect.getCenterY());\n double sx = panelRect.getWidth() / mapBounds.getWidth();\n double sy = panelRect.getHeight() / mapBounds.getHeight();\n double scale = min(sx, sy);\n tr.scale(scale, -scale);\n tr.translate(-mapBounds.getCenterX(), -mapBounds.getCenterY());\n return tr;\n }", "public abstract Matrix4f getCameraMatrix();", "public void translateX(float dx) {\r\n this.center.x += Math.cos(Math.toRadians(-rotation)) * dx;\r\n this.center.z += Math.sin(Math.toRadians(-rotation)) * dx;\r\n if (this.center.x > (this.boardWidth - ((this.boardWidth / 2f) * percentZoom))) {\r\n this.center.x = (this.boardWidth - ((this.boardWidth / 2f) * percentZoom));\r\n } else if (this.center.x < (this.boardWidth / 2f) * percentZoom) {\r\n this.center.x = (this.boardWidth / 2f) * percentZoom;\r\n }\r\n if (this.center.z > this.boardLength - ((this.boardLength / 2f) * percentZoom)) {\r\n this.center.z = this.boardLength - ((this.boardLength / 2f) * percentZoom);\r\n } else if (this.center.z < (this.boardLength / 2f) * percentZoom) {\r\n this.center.z = (this.boardLength / 2f) * percentZoom;\r\n }\r\n changed = true;\r\n }", "boolean canReplace(World world, int x, int y, int z);", "void vectorToWorld(double px, double py, double pz, DVector3 result);", "private void setCameraView() {\n double bottomBoundary = mUserPosition.getLatitude() - .1;\n double leftBoundary = mUserPosition.getLongitude() - .1;\n double topBoundary = mUserPosition.getLatitude() + .1;\n double rightBoundary = mUserPosition.getLongitude() + .1;\n\n mMapBoundary = new LatLngBounds(\n new LatLng(bottomBoundary, leftBoundary),\n new LatLng(topBoundary, rightBoundary)\n );\n\n mGoogleMap.moveCamera(CameraUpdateFactory.newLatLngBounds(mMapBoundary, 500,500,1));\n }", "@Override\n public void translate(double x, double y, double z) {\n GL11.glTranslated(x, y, z);\n }", "public void move (View view){\n\n if (toyRobotIsActive){//only run code after PLACE is DONE\n\n if (orientation == 0) {//Move while Facing North\n\n if((robot.getTranslationY()/perUnitY*(-1)) >=4) {\n System.out.println(\"Out of Bounds\");//Chk Error in Logs\n errorMessage(\"Out of Bounds\");//Error display to user via Toast\n } else {\n robot.animate().translationYBy(-perUnitY).setDuration(50);\n } //move robot 1 unit\n\n } else if (orientation == 3 || orientation == -1) {//Facing West\n if((robot.getTranslationX()/perUnitX) <= 0) {\n System.out.println(\"Out of Bounds\");\n errorMessage(\"Out of Bounds\");\n } else {\n robot.animate().translationXBy(-perUnitX).setDuration(50);\n }\n\n\n } else if (orientation == 2 || orientation == -2) {//Facing South\n if((robot.getTranslationY()/perUnitY)*(-1) <= 0){\n System.out.println(\"Out of Bounds\");\n errorMessage(\"Out of Bounds\");\n } else {\n robot.animate().translationYBy(perUnitY).setDuration(50);\n }\n\n\n } else if (orientation == 1 || orientation == -3) {//Facing East\n if((robot.getTranslationX()/perUnitX) >=4){\n System.out.println(\"Out of Bounds\");\n errorMessage(\"Out of Bounds\");\n } else {\n robot.animate().translationXBy(perUnitX).setDuration(50);\n }\n }\n } else errorMessage(\"Please place toy robot\"); //button not active if\n }", "@Override // kotlin.jvm.functions.Function1\n public Unit invoke(Camera.Parameters parameters) {\n Camera.Parameters parameters2 = parameters;\n Intrinsics.checkNotNullParameter(parameters2, \"$receiver\");\n parameters2.setFocusMode(DebugKt.DEBUG_PROPERTY_VALUE_AUTO);\n if (parameters2.getMaxNumFocusAreas() > 0) {\n this.a.e.mapRect(this.b);\n parameters2.setFocusAreas(t6.n.d.listOf(new Camera.Area(CameraInteractorKt.access$toCameraRect(this.b), 1000)));\n }\n if (parameters2.getMaxNumMeteringAreas() > 0 && this.c != null) {\n this.a.e.mapRect(this.c);\n parameters2.setMeteringAreas(t6.n.d.listOf(new Camera.Area(CameraInteractorKt.access$toCameraRect(this.c), 1000)));\n }\n return Unit.INSTANCE;\n }", "private AffineTransform setUpTransform(Envelope mapExtent, Rectangle screenSize) {\n double scaleX = screenSize.getWidth() / mapExtent.getWidth();\n double scaleY = screenSize.getHeight() / mapExtent.getHeight();\n \n double tx = -mapExtent.getMinX() * scaleX;\n double ty = (mapExtent.getMinY() * scaleY) + screenSize.getHeight();\n \n AffineTransform at = new AffineTransform(scaleX, 0.0d, 0.0d, -scaleY, tx, ty);\n \n return at;\n }", "public void moveViewTo(int newX, int newY) {\n int scaledWidth = (int) (TileDataRegister.TILE_WIDTH * scale);\n int scaledHeight = (int) (TileDataRegister.TILE_HEIGHT * scale);\n int baseX = (int) (map.getWidth() * TileDataRegister.TILE_WIDTH * scale) / 2;\n\n int x = baseX + (newY - newX) * scaledWidth / 2;\n x -= viewPortWidth * 0.5;\n\n int y = (newY + newX) * scaledHeight / 2;\n y -= viewPortHeight * 0.5;\n\n targetXOffset = -1 * x;\n targetYOffset = -1 * y;\n\n doPan = true;\n\n gameChanged = true;\n }" ]
[ "0.64974374", "0.6296229", "0.6084651", "0.6048473", "0.59204775", "0.58289766", "0.5819355", "0.5711406", "0.5687184", "0.5602646", "0.5577445", "0.5547904", "0.551686", "0.5511902", "0.55085677", "0.54973555", "0.5488452", "0.5474201", "0.54332304", "0.539785", "0.53920895", "0.5368028", "0.53571415", "0.53481984", "0.5334355", "0.53287005", "0.5290523", "0.527079", "0.5269882", "0.5260499", "0.5240202", "0.523579", "0.5234387", "0.5230037", "0.5215845", "0.51995856", "0.5194212", "0.51804996", "0.5171799", "0.51537305", "0.51485217", "0.51372415", "0.5128263", "0.5126369", "0.51184344", "0.5117114", "0.5116825", "0.51152414", "0.51111966", "0.5088393", "0.5086251", "0.507925", "0.50779253", "0.50769424", "0.505289", "0.5052839", "0.50506055", "0.504945", "0.5033068", "0.5024551", "0.5012083", "0.5006289", "0.5001329", "0.50002563", "0.49801168", "0.4979807", "0.49692857", "0.49633032", "0.49492407", "0.4949092", "0.49448258", "0.4937562", "0.49002665", "0.48993203", "0.48955742", "0.48877206", "0.48877177", "0.48856425", "0.48823804", "0.48823747", "0.48807395", "0.48744184", "0.48712587", "0.4864807", "0.48594525", "0.48591855", "0.4857172", "0.48437622", "0.48402143", "0.48401642", "0.48393393", "0.4838524", "0.4833946", "0.48227605", "0.48166695", "0.4808998", "0.48074657", "0.4804679", "0.4803582", "0.48035097" ]
0.5777127
7
Rendering Override if there are graphics that need to be rendered. Panner should use its own SpriteBatch.
@Override public void render(float delta) { }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\n\tpublic void render(SpriteBatch batch) {\n\t}", "public abstract void render(SpriteBatch spriteBatch);", "public void render(){\n spriteBatch.begin();\n drawEnemies();\n drawPlayer();\n drawBullets();\n spriteBatch.end();\n if(debug){\n drawDebug();\n }\n }", "public abstract void render(SpriteBatch batch);", "public void render () \n\t{ \n\t\trenderWorld(batch);\n\t\trenderGui(batch);\n\t}", "public void render(SpriteBatch batch){\n\n if(isInGame()) {\n draw(batch);\n }\n }", "private void render() {\n\n if (state == STATE.PAUSE) {\n\n return;\n }\n\n\n if (state == STATE.MENU) {\n\n menu.draw();\n arrow.render();\n return;\n\n }\n\n if (state == STATE.INSTRUCTIONS) {\n instructions.draw();\n return;\n }\n\n for (int i = 0; i < spaceShips.size(); i++) {\n spaceShips.get(i).render();\n }\n\n\n for (Enemy enemy : enemies) {\n enemy.render();\n }\n\n for (int i = 0; i < powerUps.size(); i++) {\n\n powerUps.get(i).render();\n }\n\n for (int i = 0; i < enemyBullets.size(); i++) {\n\n enemyBullets.get(i).render();\n }\n\n for (int i = 0; i < friendlyBullets.size(); i++) {\n\n friendlyBullets.get(i).render();\n }\n\n topBar.render();\n bottomBar.render();\n fps.render();\n score.render();\n\n\n }", "private void render() {\n bs = display.getCanvas().getBufferStrategy();\n /* if it is null, we define one with 3 buffers to display images of\n the game, if not null, then we display every image of the game but\n after clearing the Rectanlge, getting the graphic object from the \n buffer strategy element. \n show the graphic and dispose it to the trash system\n */\n if (bs == null) {\n display.getCanvas().createBufferStrategy(3);\n } else {\n g = bs.getDrawGraphics();\n g.drawImage(Assets.background, 0, 0, width, height, null);\n g.setColor(Color.white);\n g.drawLine(0, 500, 595, 500);\n player.render(g);\n for (int i = 0; i < aliens.size(); i++) {\n Alien al = aliens.get(i);\n al.render(g);\n }\n if (shotVisible) {\n shot.render(g);\n }\n\n if(gameOver==false)\n {\n gameOver();\n }\n for(Alien alien: aliens){\n Bomb b = alien.getBomb();\n b.render(g);\n }\n g.setColor(Color.red);\n Font small = new Font(\"Helvetica\", Font.BOLD, 20);\n g.setFont(small);\n g.drawString(\"G - Guardar\", 10, 50);\n g.drawString(\"C - Cargar\", 10, 70);\n g.drawString(\"P - Pausa\", 10, 90);\n\n if(keyManager.pause)\n {\n g.drawString(\"PAUSA\", 250, 300);\n }\n \n bs.show();\n g.dispose();\n }\n\n }", "void render(SpriteBatch batch){\n sprite.draw(batch);\r\n }", "protected abstract void render(Graphics g);", "private void render() {\n bs = display.getCanvas().getBufferStrategy();\n /* if it is null, we define one with 3 buffers to display images of\n the game, if not null, then we display every image of the game but\n after clearing the Rectanlge, getting the graphic object from the \n buffer strategy element. \n show the graphic and dispose it to the trash system\n */\n if (bs == null) {\n display.getCanvas().createBufferStrategy(3);\n }else{\n g = bs.getDrawGraphics();\n g.drawImage(Assets.background, 0, 0, width, height, null);\n \n \n if(!gameover){\n player.render(g);\n borrego.render(g);\n rayo.render(g);\n \n for (Enemy brick : enemies) {\n brick.render(g);\n //bomba.render(g);\n }\n \n for (Fortaleza fortaleza : fortalezas) {\n fortaleza.render(g);\n }\n \n for (Bomba bomba: bombas){\n bomba.render(g);\n }\n \n drawScore(g);\n drawLives(g,vidas);\n }else if(gameover){\n drawGameOver(g);\n }\n \n\n if (lost && !gameover){\n drawLost(g);\n }\n if (pause && !lost && !gameover){\n drawPause(g);\n }\n if(win && !lost && !pause && !lost &&!gameover){\n \n drawWin(g);\n }\n \n bs.show();\n g.dispose();\n }\n }", "public abstract void render(Graphics g);", "@Override\n\tpublic void render() {\n\t\t// Call update before anything gets drawn\n\t\tupdate();\n\n\t\t// Begin drawing operations - set projection matrix, grab frames, etc\n\t\tmBatch.setProjectionMatrix(mCamera.combined);\n\n\t\tGdx.gl.glClearColor(0, 0, 0.2f, 1);\n\t\tGdx.gl.glClear(GL20.GL_COLOR_BUFFER_BIT);\n\t\tmBatch.begin();\n // Draw the background first, regardless of state\n mBatch.draw(mGameBackgrounds[mCastleDamageStage], 0f, 0f);\n\n\t\tswitch (mGameState) {\n\t\t\tcase STATE_PRE_GAME:\n\t\t\t\tmFont.draw(mBatch, mGameTitle, 125, 375);\n\t\t\t\tmButtons[0].draw(mFont, mBatch);\n\t\t\t\tmButtons[1].draw(mFont, mBatch);\n\t\t\t\tbreak;\n\t\t\tcase STATE_ROUND_START:\n\t\t\t\tmFont.draw(mBatch, mRoundText, 360, 440);\n\t\t\t\tmButtons[2].draw(mFont, mBatch);\n\t\t\t\tmButtons[3].draw(mFont, mBatch);\n\t\t\t\tbreak;\n\t\t\tcase STATE_ROUND_PLAY:\n\t\t\t\t// Draw text on top of the background in the sky\n\t\t\t\tmFont.draw(mBatch, mHealthText, 600, 440);\n\t\t\t\tmFont.draw(mBatch, mRoundScoreText, 50, 440);\n\t\t\t\tmFont.draw(mBatch, mRoundText, 360, 440);\n\t\t\t\t// Draw attackers if the game isn't paused\n\t\t\t\tfor (int i = 0; i < ATTACKER_ARRAY_SIZE; i++) {\n\t\t\t\t\tAttacker a = mAttackers[i];\n\t\t\t\t\tif (a.isAlive()) {\n\t\t\t\t\t\tmBatch.draw(a.getCurrentFrame(), a.getX(), a.getY());\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tmButtons[2].draw(mFont, mBatch);\n\t\t\t\tmButtons[3].draw(mFont, mBatch);\n\t\t\t\tbreak;\n\t\t\tcase STATE_ROUND_OVER:\n\t\t\t\tmFont.draw(mBatch, mHealthText, 600, 440);\n\t\t\t\tmFont.draw(mBatch, mRoundScoreText, 50, 440);\n\t\t\t\tmFont.draw(mBatch, mTotalScoreText, 50, 400);\n\t\t\t\tmButtons[4].draw(mFont, mBatch);\n\t\t\t\tmButtons[5].draw(mFont, mBatch);\n\t\t\t\tmButtons[6].draw(mFont, mBatch);\n\t\t\t\tif(mRoundSaved) {\n\t\t\t\t\tmFont.draw(mBatch, mGameSavedText, 350, 125);\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase STATE_GAME_OVER:\n\t\t\t\tmButtons[0].draw(mFont, mBatch);\n\n\t\t\t\tbreak;\n\t\t}\n\n if(mPaused)\n mFont.draw(mBatch, \"Paused\", 380, 400);\n\n\t\tmBatch.end();\n\t}", "@Override\r\n\tpublic void paint(Graphics g) {\n\t\tsuper.paint(g);\r\n\t\trender(g);\r\n\t}", "private void render() {\n if (game.isEnded()) {\n if (endGui == null) {\n drawEndScreen();\n }\n\n return;\n }\n\n drawScore();\n drawSnake();\n drawFood();\n }", "private void render() {\n\t\ttheMap.draw(g);\n\t\ttheTrainer.draw(g);\n\t}", "public abstract void Draw(SpriteBatch spriteBatch);", "@Override\n\tpublic void render(Graphics g)\n\t{\n\t}", "private final void \n renderIt( ) {\n \t\n \tif( this.mImageCount > 0 || this.mLineCount > 0 || this.mRectCount > 0 || this.mTriangleCount > 0 ) {\n\t \n \t\tthis.mVertexBuffer.clear(); //clearing the buffer\n\t GLES11.glEnableClientState( GLES11.GL_VERTEX_ARRAY );\n\n\t //if there are images to render\n\t if( this.mImageCount > 0 ) {\n\t\t this.mVertexBuffer.put( this.mVertices, 0, this.mImageCount * 16 ); //put available points into the buffer\n\t\t this.mVertexBuffer.flip(); //flipping buffer\n\t\t GLES11.glVertexPointer( 2, GLES11.GL_FLOAT, 16, this.mVertexBuffer ); //copy the vertices into the GPU\n\t\t GLES11.glEnableClientState( GLES11.GL_TEXTURE_COORD_ARRAY ); //copy the texture coordinates into the GPU\n\t\t GLES11.glEnable(GLES11.GL_TEXTURE_2D);\n\t\t this.mVertexBuffer.position( 2 ); //put buffer position to the texture coordinates\n\t\t GLES11.glTexCoordPointer( 2, GLES11.GL_FLOAT, 16, this.mVertexBuffer );\n\t\t this.mIndexBuffer.limit(this.mImageCount * 6); //DESKTOP VERSION ONLY\n\t\t GLES11.glDrawElements( GLES11.GL_TRIANGLES, this.mImageCount * BitsGLImage.INDICES_PER_SPRITE, GLES11.GL_UNSIGNED_SHORT, this.mIndexBuffer );\n\t \tGLES11.glDisable(GLES11.GL_TEXTURE_2D);\n\t\t GLES11.glDisableClientState( GLES11.GL_TEXTURE_COORD_ARRAY );\n\t }\n\t \n\t //if there are lines to render\n\t if( this.mLineCount > 0 ) {\n\t\t this.mVertexBuffer.put( this.mVertices, 0, this.mLineCount * 4 ); //put available points into the buffer\n\t\t this.mVertexBuffer.flip(); //flipping buffer\n\t\t GLES11.glVertexPointer( 2, GLES11.GL_FLOAT, 0, this.mVertexBuffer ); //copy the vertices into the GPU\n\t\t GLES11.glDrawArrays( GLES11.GL_LINES, 0, this.mLineCount * 2 ); //* 2 because every line got 2 points\n\t }\n\n\t //if there are rects to render\n\t if( this.mRectCount > 0 ) {\n\t\t this.mVertexBuffer.put( this.mVertices, 0, this.mRectCount * 8 ); //put available points into the buffer\n\t\t this.mVertexBuffer.flip(); //flipping buffer\n\t\t this.mIndexBuffer.limit(this.mRectCount * 6); //DESKTOP VERSION ONLY\n\t \t GLES11.glVertexPointer(2, GLES11.GL_FLOAT, 0, this.mVertexBuffer); //copy the vertices into the GPU\t \t \n\t \t \tGLES11.glDrawElements( GLES11.GL_TRIANGLES, this.mRectCount * BitsGLImage.INDICES_PER_SPRITE, GLES11.GL_UNSIGNED_SHORT, this.mIndexBuffer );\n\t }\n\t \n\t //if there are triangles to render\n\t if( this.mTriangleCount > 0 ) {\n\t\t this.mVertexBuffer.put( this.mVertices, 0, this.mTriangleCount * 12 ); //put available points into the buffer\n\t\t this.mVertexBuffer.flip(); //flipping buffer\n\t\t GLES11.glVertexPointer( 2, GLES11.GL_FLOAT, 16, this.mVertexBuffer ); //copy the vertices into the GPU\n\t\t GLES11.glEnableClientState( GLES11.GL_TEXTURE_COORD_ARRAY ); //copy the texture coordinates into the GPU\n\t\t GLES11.glEnable(GLES11.GL_TEXTURE_2D);\n\t\t this.mVertexBuffer.position( 2 ); //put buffer position to the texture coordinates\n\t\t GLES11.glTexCoordPointer( 2, GLES11.GL_FLOAT, 16, this.mVertexBuffer ); //16 == byteoffset -> es liegen 2 werte dazwischen\n\t\t GLES11.glDrawArrays( GLES11.GL_TRIANGLES, 0, this.mTriangleCount * 3 ); //* 2 because every line got 2 points\t \t\n\t\t GLES11.glDisable(GLES11.GL_TEXTURE_2D);\n\t\t GLES11.glDisableClientState( GLES11.GL_TEXTURE_COORD_ARRAY );\n\t }\n\t \n\t GLES11.glDisableClientState( GLES11.GL_VERTEX_ARRAY );\n \t\t\n\t //resetting counters\n\t this.mBufferIndex = 0;\n\t \tthis.mImageCount = 0;\n\t \tthis.mLineCount = 0;\n\t \tthis.mRectCount = 0;\n\t \tthis.mTriangleCount = 0;\n \t}\n }", "private void render() {\n\t\tBufferStrategy buffStrat = display.getCanvas().getBufferStrategy();\n\t\tif(buffStrat == null) {\n\t\t\tdisplay.getCanvas().createBufferStrategy(3); //We will have 3 buffered screens for the game\n\t\t\treturn;\n\t\t}\n\n\t\t//A bufferstrategy prevents flickering since it preloads elements onto the display.\n\t\t//A graphics object is a paintbrush style object\n\t\tGraphics g = buffStrat.getDrawGraphics();\n\t\t//Clear the screen\n\t\tg.clearRect(0, 0, width, height); //Clear for further rendering\n\t\t\n\t\tif(State.getState() !=null) {\n\t\t\tState.getState().render(g);\n\t\t}\n\t\t//Drawings to be done in this space\n\t\t\n\t\t\n\t\t\n\t\tbuffStrat.show();\n\t\tg.dispose();\n\t}", "public void render()\n\t{\n\t\t// Get or create the BufferStrategy to plan rendering\n\t\tBufferStrategy bs = getBufferStrategy();\n\t\tif (bs == null)\n\t\t{\n\t\t\tcreateBufferStrategy(3);\n\t\t\treturn;\n\t\t}\n\t\t\n\t\t// Get the graphics that can be drawn to\n\t\tg = bs.getDrawGraphics();\n\t\t\n\t\t// Set the Graphics2D\n\t\tg2d = (Graphics2D)g;\n\t\t\n\t\t// Create a black rectangle to fill the canvas as a base background\n\t\tg.setColor(Color.black);\n\t\tg.fillRect(0, 0, getWidth(), getHeight());\n\t\t\n\t\tif (screenLoaded)\n\t\t{\n\t\t\t// Draw the static background\n\t\t\tif (game.getScreenHandler().getCurrentScreen() != null)\n\t\t\t\tgame.getScreenHandler().getCurrentScreen().drawStaticBackground(g);\n\t\t\t\n\t\t\t// Translate the screen based on the Camera\n\t\t\tif (game.getCamera() != null && game.usesCamera())\n\t\t\t\tg2d.translate(game.getCamera().getxPos(), \n\t\t\t\t\t\t \t game.getCamera().getyPos());\n\t\t\t\n\t\t\t// Draw the background layer\n\t\t\tif (game.getScreenHandler().getCurrentScreen() != null)\n\t\t\t\tgame.getScreenHandler().getCurrentScreen().drawBackground(g);\n\t\t\t\n\t\t\t// Render all of the Tiles\n\t\t\tif (game.getScreenHandler().getCurrentScreen() != null && game.usesWorld())\n\t\t\t\tgame.getWorldHandler().renderTiles(g);\n\t\t\t\n\t\t\t// Render all of the GameObjects\n\t\t\tif (game.getScreenHandler().getCurrentScreen() != null && game.usesGameObjects())\n\t\t\t\tgame.getObjectHandler().renderGameObjects(g);\n\t\t\t\n\t\t\t// Draw the foreground layer\n\t\t\tif (game.getScreenHandler().getCurrentScreen() != null)\n\t\t\t\tgame.getScreenHandler().getCurrentScreen().drawForeground(g);\n\t\t\t\n\t\t\t// Draw the lighting\n\t\t\tif (game.getScreenHandler().getCurrentScreen() != null && game.usesLighting())\n\t\t\tg.drawImage(game.getLightHandler().getLightmap(), -1500, -3100, null);\n\t\t\t\n\t\t\t// Translate the screen based on the Camera\n\t\t\tif (game.getCamera() != null && game.usesCamera())\n\t\t\t\tg2d.translate(-game.getCamera().getxPos(), \n\t\t\t\t\t\t \t -game.getCamera().getyPos());\n\t\t\t\n\t\t\t// Draw the gui layer\n\t\t\tif (game.getScreenHandler().getCurrentScreen() != null)\n\t\t\t\tgame.getScreenHandler().getCurrentScreen().drawGui(g);\n\t\t\t\n\t\t\t// Draw the debug layer\n\t\t\tif (game.getScreenHandler().getCurrentScreen() != null\n\t\t\t\t&& game.getDebugScreen() != null\n\t\t\t\t&& game.isDebugShown())\n\t\t\t\tgame.getDebugScreen().showDebug(g);\n\t\t\t\n\t\t\t// Draw the loading \"curtain\" if the screen is still loading\n\t\t\tif (game.getScreenHandler().getCurrentScreen() != null &&\n\t\t\t\t!screenLoaded)\n\t\t\t{\n\t\t\t\tif (timeCount < game.getFps() / 4)\n\t\t\t\t{\n\t\t\t\t\tg.setColor(Color.black);\n\t\t\t\t\tg.fillRect(0, 0, game.getWindow().getWidth(), \n\t\t\t\t\t\t\tgame.getWindow().getHeight());\n\t\t\t\t\tg.setColor(Color.white);\n\t\t\t\t\tif (loadingFont == null)\n\t\t\t\t\t\tg.setFont(new Font(\"Verdana\", Font.PLAIN, 32));\n\t\t\t\t\telse\n\t\t\t\t\t\tg.setFont(loadingFont);\n\t\t\t\t\tg.drawString(\"Loading . \", (game.getWindow().getWidth() / 2) - 80, \n\t\t\t\t\t\t\t(game.getWindow().getHeight() / 2) - 80);\n\t\t\t\t}\n\t\t\t\telse if (timeCount < (game.getFps() / 4) * 2)\n\t\t\t\t{\n\t\t\t\t\tg.setColor(Color.black);\n\t\t\t\t\tg.fillRect(0, 0, game.getWindow().getWidth(), \n\t\t\t\t\t\t\tgame.getWindow().getHeight());\n\t\t\t\t\tg.setColor(Color.white);\n\t\t\t\t\tif (loadingFont == null)\n\t\t\t\t\t\tg.setFont(new Font(\"Verdana\", Font.PLAIN, 32));\n\t\t\t\t\telse\n\t\t\t\t\t\tg.setFont(loadingFont);\n\t\t\t\t\tg.drawString(\"Loading . \", (game.getWindow().getWidth() / 2) - 80, \n\t\t\t\t\t\t\t(game.getWindow().getHeight() / 2) - 80);\n\t\t\t\t}\n\t\t\t\telse if (timeCount < (game.getFps() / 4) * 3)\n\t\t\t\t{\n\t\t\t\t\tg.setColor(Color.black);\n\t\t\t\t\tg.fillRect(0, 0, game.getWindow().getWidth(), \n\t\t\t\t\t\t\tgame.getWindow().getHeight());\n\t\t\t\t\tg.setColor(Color.white);\n\t\t\t\t\tif (loadingFont == null)\n\t\t\t\t\t\tg.setFont(new Font(\"Verdana\", Font.PLAIN, 32));\n\t\t\t\t\telse\n\t\t\t\t\t\tg.setFont(loadingFont);\n\t\t\t\t\tg.drawString(\"Loading . . \", (game.getWindow().getWidth() / 2) - 80, \n\t\t\t\t\t\t\t(game.getWindow().getHeight() / 2) - 80);\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tg.setColor(Color.black);\n\t\t\t\t\tg.fillRect(0, 0, game.getWindow().getWidth(), \n\t\t\t\t\t\t\tgame.getWindow().getHeight());\n\t\t\t\t\tg.setColor(Color.white);\n\t\t\t\t\tif (loadingFont == null)\n\t\t\t\t\t\tg.setFont(new Font(\"Verdana\", Font.PLAIN, 32));\n\t\t\t\t\telse\n\t\t\t\t\t\tg.setFont(loadingFont);\n\t\t\t\t\tg.drawString(\"Loading . . . \", (game.getWindow().getWidth() / 2) - 80, \n\t\t\t\t\t\t\t(game.getWindow().getHeight() / 2) - 80);\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\t// Dispose of all graphics\n\t\t\tg.dispose();\n\t\t\t// Show all graphics prepared on the BufferStrategy\n\t\t\tbs.show();\n\t\t}\n\t\telse\n\t\t{\n\t\t\tGraphics2D g2 = (Graphics2D)g;\n\t\t\tg2.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON);\n\t\t\t\n\t\t\tif (timeCount < game.getFps() / 4)\n\t\t\t{\n\t\t\t\tg.setColor(Color.black);\n\t\t\t\tg.fillRect(0, 0, game.getWindow().getWidth(), \n\t\t\t\t\t\tgame.getWindow().getHeight());\n\t\t\t\tg2.setColor(Color.white);\n\t\t\t\tif (loadingFont == null)\n\t\t\t\t\tg2.setFont(new Font(\"Verdana\", Font.PLAIN, 32));\n\t\t\t\telse\n\t\t\t\t\tg2.setFont(loadingFont);\n\t\t\t\tg2.drawString(\"Loading . \", (game.getWindow().getWidth() / 2) - 80, \n\t\t\t\t\t\t(game.getWindow().getHeight() / 2) - 80);\n\t\t\t}\n\t\t\telse if (timeCount < (game.getFps() / 4) * 2)\n\t\t\t{\n\t\t\t\tg.setColor(Color.black);\n\t\t\t\tg.fillRect(0, 0, game.getWindow().getWidth(), \n\t\t\t\t\t\tgame.getWindow().getHeight());\n\t\t\t\tg2.setColor(Color.white);\n\t\t\t\tif (loadingFont == null)\n\t\t\t\t\tg2.setFont(new Font(\"Verdana\", Font.PLAIN, 32));\n\t\t\t\telse\n\t\t\t\t\tg2.setFont(loadingFont);\n\t\t\t\tg2.drawString(\"Loading . \", (game.getWindow().getWidth() / 2) - 80, \n\t\t\t\t\t\t(game.getWindow().getHeight() / 2) - 80);\n\t\t\t}\n\t\t\telse if (timeCount < (game.getFps() / 4) * 3)\n\t\t\t{\n\t\t\t\tg.setColor(Color.black);\n\t\t\t\tg.fillRect(0, 0, game.getWindow().getWidth(), \n\t\t\t\t\t\tgame.getWindow().getHeight());\n\t\t\t\tg2.setColor(Color.white);\n\t\t\t\tif (loadingFont == null)\n\t\t\t\t\tg2.setFont(new Font(\"Verdana\", Font.PLAIN, 32));\n\t\t\t\telse\n\t\t\t\t\tg2.setFont(loadingFont);\n\t\t\t\tg2.drawString(\"Loading . . \", (game.getWindow().getWidth() / 2) - 80, \n\t\t\t\t\t\t(game.getWindow().getHeight() / 2) - 80);\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tg.setColor(Color.black);\n\t\t\t\tg.fillRect(0, 0, game.getWindow().getWidth(), \n\t\t\t\t\t\tgame.getWindow().getHeight());\n\t\t\t\tg2.setColor(Color.white);\n\t\t\t\tif (loadingFont == null)\n\t\t\t\t\tg2.setFont(new Font(\"Verdana\", Font.PLAIN, 32));\n\t\t\t\telse\n\t\t\t\t\tg2.setFont(loadingFont);\n\t\t\t\tg2.drawString(\"Loading . . . \", (game.getWindow().getWidth() / 2) - 80, \n\t\t\t\t\t\t(game.getWindow().getHeight() / 2) - 80);\n\t\t\t}\n\t\t}\n\t\t\n\t\t// Dispose of all graphics\n\t\tg.dispose();\n\t\t// Show all graphics prepared on the BufferStrategy\n\t\tbs.show();\n\t}", "@Override\n public void draw(SpriteBatch batch) {\n sprite.draw(batch);\n }", "public void render()\r\n\t{\n\t}", "@Override\n\tpublic void render(Graphics g) {\n\t\t\n\t}", "@Override\n\tpublic void render(Graphics g) {\n\t\t\n\t}", "@Override\n\tpublic void render() {\n\t\tScreen.render();\n\t}", "public void render(){\n\t\tBufferStrategy bs = frame.getBufferStrategy();\n\t\tif(bs == null){\n\t\t\tframe.createBufferStrategy(3);\n\t\t\treturn;\n\t\t}\n\t\trenderGraphics(bs);\n\t}", "public Render(SpriteBatch spriteBatch) {\n _spriteBatch = spriteBatch;\n }", "public void render() {\n\t\t// do nothing... as we should\n\t}", "public void draw(SpriteBatch batch){\n this.draw(null,batch,false);\n }", "public void renderAll() {\n GameObjectManager.instance.renderAll(graphics);\n this.repaint();\n }", "public void render() {\r\n\t\t //Draw all of the sprites in the game\r\n\t background.draw(0,backgroudY1);\r\n\t\tbackground.draw(0,backgroudY2);\r\n\t\tbackground.draw(0,backgroudY3);\r\n\t\tbackground.draw(WIDTH/2,backgroudY1);\r\n\t\tbackground.draw(WIDTH/2,backgroudY2);\r\n\t background.draw(WIDTH/2,backgroudY3);\r\n\t \r\n\t // call this method from Player class, to draw the plane.\r\n\t player.render();\r\n\t \r\n\t \r\n\t // loop through every enemy, draw enemy if it's not killed\r\n\t for(int i=0; i<enemy.length; i++) {\r\n\t \t\r\n \tif(enemy[i] != null && enemyKilled[i] == true) {\r\n \t\t\r\n\t \t\t\r\n\t enemy[i].render();\r\n\t \r\n\t \t}\r\n\t \r\n\t }\r\n\t // loop through every laser, if it has not made contact with any enemy,\r\n\t // call its render method to draw it\r\n\t for (int i = 0; i < arr_size; i++) {\r\n\t \tif (lasers[i] != null && laserUsed[i] == true) {\r\n\t lasers[i].render();\r\n \t}\r\n\t \t\r\n\t }\r\n\t \r\n\t}", "public void render () {\n\t\tcam.update();\n\t\tbatch.setProjectionMatrix(cam.combined);\n\t\trenderBackground();\n\t\t/*shapeRender.setProjectionMatrix(cam.combined);\n\t\tshapeRender.begin(ShapeRenderer.ShapeType.Line);\n\t\tshapeRender.ellipse(world.trout.hitBox.x, world.trout.hitBox.y, world.trout.hitBox.width, world.trout.hitBox.height);\n\t\tshapeRender.circle(world.hook.circleBounds.x, world.hook.circleBounds.y, world.hook.circleBounds.radius);\n\t\tshapeRender.point(world.trout.position.x, world.trout.position.y, 0f);*/\n\t\trenderObjects();\n\t\t\n\t}", "public abstract void render(Graphics2D graphics);", "@Override\n public void paintComponent(Graphics g) {\n super.paintComponent(g);\n render(g);\n }", "public void render() {\r\n\r\n }", "@Override\n public void render() {\n super.render();\n }", "@Override\n public void render() {\n super.render();\n }", "protected void preRender()\n {\n // subclass\n }", "public void render(GameContainer gc, Graphics g){\n\n for(Renderable r:renderables){\n r.render(gc, g);\n }\n\n if(this.gameData.getCurrentRoom().getRoomType() == MasarRoom.VICTORYROOM) {\n this.gameData.getImageList().get(2).draw(226, 284);\n }\n\n if(this.gameData.getCurrentRoom().getRoomType() == MasarRoom.DEFEATROOM) {\n this.gameData.getImageList().get(3).draw(120, 288);\n }\n\n\n if(roomType == GAMEROOM){\n\n for(Renderable l: this.gameData.getLinkList()){\n l.render(gc, g);\n }\n for(Renderable s: this.gameData.getSystemList()){\n s.render(gc, g);\n }\n\n this.gameData.getImageList().get(0).draw(300, 5);\n this.gameData.getImageList().get(1).draw(800, 5);\n this.gameData.getButtonsImages().get(\"Enemy\").drawNextSubimage(600, 16);\n this.gameData.getButtonsImages().get(\"Allied\").drawNextSubimage(500, 16);\n\n TrueTypeFont font = this.gameData.getFont(\"UITopFont\");\n font.drawString(536, 0, \"VS\" , Color.green);\n\n int popa = this.gameData.getPopA();\n int pope = this.gameData.getPopE();\n int resa = this.gameData.getResA();\n int rese = this.gameData.getResE();\n\n if ( popa > 1000000 ) font.drawString(480 - font.getWidth(\"\"+popa/1000000 + \"M\"), 0, \"\"+popa/1000000 + \"M\" , Color.cyan);\n else if ( popa > 1000 ) font.drawString(480 - font.getWidth(\"\"+popa/1000 + \"K\"), 0, \"\"+popa/1000 + \"K\" , Color.cyan);\n else font.drawString(480 - font.getWidth(\"\"+popa), 0, \"\"+popa , Color.cyan);\n font.drawString(295 - font.getWidth(\"\"+resa), 0, \"\"+resa , Color.cyan);\n\n if ( pope > 1000000 ) font.drawString(620, 0, \"\"+pope/1000000 + \"M\" , Color.red);\n else if ( pope > 1000 ) font.drawString(620, 0, \"\"+pope/1000 + \"K\" , Color.red);\n else font.drawString(620, 0, \"\"+pope , Color.red);\n font.drawString(830, 0, \"\"+rese , Color.red);\n\n for(WindowSystem w: this.gameData.getWindowList()){\n if(w.getMs().isShowWindow())\n w.render(gc, g);\n }\n\n //this.getClickManager().renderHitboxes(gc, g);\n\n }\n\n //this.getClickManager().renderHitboxes(gc, g);\n }", "public void render() {\n }", "@Override\n\tpublic void draw() {\n\t\tbatch.begin();\n\t\t\n\t\t/**Only renders the logo if the max font size is greater than 0.*/\n\t\tfor(int size = 1; size <= maxLoadedSize && maxLoadedSize >= 1; size++) {\n\t\t\tBitmapFont font = Core.getGraphics().getFonts().get(size);\n\t\t\t/**Renders the logo text in the centre of the scene with the current largest loaded font size.*/\n\t\t\tfont.draw(batch, LOADING_TEXT,\n\t\t\t\t\t(getWidth() - FontLoader.getWidth(font, LOADING_TEXT)) / 2,\n\t\t\t\t\t(getHeight() - FontLoader.getHeight(font, LOADING_TEXT)) / 2);\n\t\t}\n\t\t\n\t\t/**Renders the appropriate loading flag if the text has finished loading.*/\n\t\tif(maxLoadedSize == FontLoader.MAX_SIZE) {\n\t\t\tBitmapFont infoFont = Core.getGraphics().getFonts().get(32);\n\t\t\t\n\t\t\tif(!physicsShapesLoaded) {\n\t\t\t\tinfoFont.draw(batch, \"Loading physics engine...\",\n\t\t\t\t\t\t(getWidth() - FontLoader.getWidth(infoFont, \"Loading physics shapes...\")) / 2,\n\t\t\t\t\t\t(getHeight() / 4));\n\t\t\t}\n\t\t}\n\t\t\n\t\tbatch.end();\n\t}", "@Override\n\tpublic void render() {\n\t\tGdx.gl.glViewport(0, 0, Gdx.graphics.getWidth(), Gdx.graphics.getHeight());\n\t\tGdx.gl.glClear(GL20.GL_COLOR_BUFFER_BIT | GL20.GL_DEPTH_BUFFER_BIT);\n\n\n\t\t// TODO: begin the model batch with the current camera\n\t\t// render the instance of the model in the set-up environment using the model batch\n\t\t// end the model batch rendering process\n\t\tmodelBatch.begin(cam);\n\t\tmodelBatch.render(instance, environment);\n\t\tmodelBatch.end();\n\n\t\t// TODO: begin the sprite batch rendering\n\t\t// draw the new order logo at (50, 50, 200, 200)\n\t\t// end the sprite batch rendering process\n\t\tsprites.begin();\n\t\tsprites.draw(logo,50, 50, 200, 200);\n\t\tsprites.end();\n\t}", "public void render(Graphics g) {\n\t}", "public void render(float f) {\n update();\n\n long currentTime = System.currentTimeMillis();\n //Divide by a thousand to convert from milliseconds to seconds\n elapsedTime = (currentTime - lastTime) % 1000.0f;\n lastTime = currentTime;\n\n batch.begin();\n bg1.draw(batch, 1);\n bg2.draw(batch, 1);\n playerSprite.draw(batch);\n\n //Draws bullets if bullet array is holding bullet objects\n if (bullets.size() > 0) {\n for (Bullet bullet : bullets) {\n bullet.getSprite().draw(batch);\n }\n }\n\n //Draws worms if worm array is holding worm objects\n if (worms.size() > 0) {\n for (Worm worm : worms) {\n worm.getSprite().draw(batch);\n }\n }\n\n //Draws trojans if trojan array is holding trojan objects\n if (trojans.size() > 0) {\n if (bigTrojan == null) {\n for (Trojan trojan : trojans) {\n trojan.getSprite().draw(batch);\n }\n } else if (bigTrojan != null) {\n bigTrojan.getSprite().draw(batch);\n }\n }\n //Draws memLeaks if memLeak array is holding memLeak objects\n if (memLeaks.size() > 0) {\n for (MemoryLeak memLeak : memLeaks) {\n memLeak.getSprite().draw(batch);\n }\n }\n\n if (elissaArray.size() > 0) {\n for (Elissa elissa : elissaArray) {\n elissa.getSprite().draw(batch);\n }\n }\n\n //Draws ElissaFiles if elissaFiles array is holding files objects\n if (elissaFiles.size() > 0) {\n for (ElissaFiles file : elissaFiles) {\n file.getSprite().draw(batch);\n }\n }\n\n //Draws files if files array is holding files objects\n if (files.size() > 0) {\n for (Files file : files) {\n file.getSprite().draw(batch);\n }\n }\n\n //particle system\n particles.render(batch);\n\n switch (gameState) {\n case PLAYING:\n //Score\n scoreTxt = \"Score: \" + String.format(Locale.US, \"%06d\", score);\n uiFont.draw(batch, scoreTxt, 0, HEIGHT - (scoreLayout.height));\n //Health\n healthTxt = \"Health: \" + player.getHp();\n uiFont.draw(batch, healthTxt, WIDTH / 2, HEIGHT - (healthLayout.height));\n //MOVEMENT\n isTouched = Gdx.input.isTouched();\n //Gdx.app.log(\"Playing: \", \"Is touched: \" + isTouched);\n playerMovement();\n pauseButton.draw(batch, 1);\n stage.draw();\n break;\n case PAUSED:\n //Fill in pause code\n if (settingsOn == false) {\n pauseScreenRender();\n } else if (settingsOn == true) {\n settingsScreenRender();\n }\n break;\n case GAMEOVER:\n countdown = ((System.currentTimeMillis() - startTime) / 1000);\n Gdx.app.log(\"Seconds Elapsed: \", \"\" + ((System.currentTimeMillis() - startTime) / 1000));\n overlay.draw(batch, 0.5f);\n font.draw(batch, txt, WIDTH / 2 - layout.width / 2, HEIGHT / 2 + layout.height / 2);\n if (countdown == 5) {\n gameState = GameState.PLAYING;\n Lvl1.musicBackground.dispose();\n game.setScreen(AntiVirus.levelSelectScreen);\n }\n break;\n case COMPLETE:\n completeScreenRender();\n break;\n }\n batch.end();\n }", "public void render() {\n backGraphics.drawImage(background, backgroundX, backgroundY, null);\n\n GameObject.renderAll(backGraphics);\n\n //2. Call repaint\n repaint();\n }", "private void render() {\n final int numBuffers = 3;\n BufferStrategy bs = this.getBufferStrategy(); // starts value at null\n if (bs == null) {\n this.createBufferStrategy(numBuffers); // 3: buffer creations\n return;\n }\n Graphics g = bs.getDrawGraphics();\n\n g.setColor(Color.black); // stops flashing background\n g.fillRect(0, 0, WINDOW_WIDTH, WINDOW_HEIGHT);\n\n handler.render(g);\n\n if (gameStart == GAME_STATE.Game) {\n hud.render(g);\n } else if (gameStart == GAME_STATE.Menu || gameStart == GAME_STATE.Help || gameStart == GAME_STATE.GameOver || gameStart == GAME_STATE.GameVictory) {\n menu.render(g);\n }\n\n g.dispose();\n bs.show();\n }", "public void render() {\n uiBatch.begin();\n for (int x = 0; x < uiManager.getUIComponents().size();x++) {\n uiManager.getUIComponent(x).render(uiBatch, Assets.patch);\n }\n if (uiManager.dialogue != null) {\n uiManager.dialogue.render(uiBatch, Assets.patch);\n }\n if (!uiManager.notifications.isEmpty()) {\n uiManager.notifications.get(0).render(uiBatch, Assets.patch);\n }\n uiManager.partyMenu.render(uiBatch, Assets.patch);\n uiBatch.end();\n }", "public void render(){\n //this block is pre-loading 2 frames in\n BufferStrategy bs = this.getBufferStrategy();\n if(bs == null){\n this.createBufferStrategy(2);\n return;\n }\n\n Graphics g = bs.getDrawGraphics();\n Graphics2D g2d = (Graphics2D) g;\n ///////////////////////////\n //Draw things below here!\n g.setColor(Color.white);\n g.fillRect(0, 0, 800, 800);\n\n g2d.translate(-camera.getX(), -camera.getY());\n\n g.setColor(Color.gray);\n g.fillRect(0, 0, 500, 500);\n //render all the objects\n handler.render(g);\n\n //g2d.translate(camera.getX(), camera.getY());\n //Draw things above here!\n ///////////////////////////\n g.dispose();\n bs.show();\n }", "@Override\n public void render() {\n GUI.clearScreen();\n if (assetManager.update()) {\n switch (gameState) {\n case MENU:\n GUI.menuLoop();\n break;\n case PAUSE:\n case GAME:\n gameLoop();\n break;\n case LOAD:\n World.load();\n gameState = GameState.GAME;\n break;\n }\n } else {\n GUI.splashScreen(assetManager.getProgress());\n }\n DrawManager.end();\n }", "private void render() {\n\t\t// clear the screen and depth buffer\n\t\tglClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);\n\t\t\n\t\t// draws the background\n\t\tdrawScreen(sprite.get(\"background\"));\n\t\t\n\t\t// drawing player\n\t\tif (!stopDrawingPlayer)\n\t\t\tdrawEntity(player);\n\t\t// drawing bullets\n\t\tdrawListEntity(bullet);\n\t\t// drawing enemy bullets\n\t\tdrawListEntity(enemy_bullet);\n\t\t// drawing enemies\n\t\tdrawListEntity(enemy);\n\t\t// drawing powerups\n\t\tdrawListEntity(powerup);\n\t\t// drawing explosions\n\t\tdrawListEntity(explosion);\n\t\t\n\t\t// draw health\n\t\tdefaultFont.drawString(10, 10, \"Health: \" + player.getHP() + \"/1000\");\n\t\t// draw cash\n\t\tdefaultFont.drawString(10, 40, \"Cash: $\" + cash);\n\t\t// draw shop prompt\n\t\tdefaultFont.drawString(displayWidth - 280, displayHeight - 40, \"Press F to enter shop\");\n\t\t\n\t\tif (stopDrawingPlayer) {\n\t\t\t// draw Game Over\n\t\t\tgameOverFont.drawString(displayWidth / 2 - gameOverFont.getWidth(\"Game Over!\") / 2, displayHeight\n\t\t\t\t\t/ 2 - gameOverFont.getHeight(\"Game Over!\") / 2 - 50, \"Game Over!\");\n\t\t\t\n\t\t\t// draw the score\n\t\t\tscoreFont.drawString(displayWidth / 2 - scoreFont.getWidth(\"Score: \" + totalCash) / 2, displayHeight\n\t\t\t\t\t/ 2\n\t\t\t\t\t+ scoreFont.getHeight(\"Game Over!\")\n\t\t\t\t\t/ 2\n\t\t\t\t\t+ scoreFont.getHeight(\"Score: \" + totalCash)\n\t\t\t\t\t/ 2 + 10 - 50, \"Score: \" + totalCash);\n\t\t}\n\t}", "public void draw(SpriteBatch spriteBatch) {\n if(isMoving) {\n\t\t\t//walkingParticleEffect.scaleEffect(walkingParticleEffectScale);\n walkingParticleEffect.draw(spriteBatch);\n }\n\n spriteBatch.setColor(1, colorValue, colorValue, 1);\n\n if(isMoving) {\n\t\t\tanimation.draw(spriteBatch, hitbox.getX()+xOffset, hitbox.getY()+yOffset, spriteWidth, spriteHeight);\n\t\t} else {\n\t\t\tanimation.drawStaticFrame(spriteBatch, hitbox.getX()+xOffset, hitbox.getY()+yOffset, spriteWidth, spriteHeight);\n\t\t}\n\n\t\tspriteBatch.setColor(1, 1, 1, 1);\n\n if(damaged) {\n \t//gettingHitParticleEffect.scaleEffect(gettingHitParticleEffectScale);\n gettingHitParticleEffect.draw(spriteBatch);\n }\n\n // Draw HP bar\n hpBar.draw(spriteBatch);\n\n /*\n // Debug draw enemie sprite hitbox\n hitboxSprite.draw(spriteBatch);\n\n // Debug draw enemie bullet hitboxes sprite\n for(Sprite bulletHitbox : bulletHitboxSpriteList) {\n \tbulletHitbox.draw(spriteBatch);\n\t\t}\n\n\t\tspriteBatch.draw(mapHitboxSprite, mapHitbox.getX(), mapHitbox.getY(), mapHitbox.getWidth(), mapHitbox.getHeight());\n\t\t*/\n }", "@Override\n public void render(float delta) {\n if(counter>1000) counter = 1;\n super.render(delta);\n myCamera.update();\n myCamera.setCamera(renderer, batch);\n batch.begin();\n backgroundSprite.draw(batch, calculateAlpha()/2);\n batch.end();\n drawCurve();\n drawFlights();\n drawFavouritesAndLegend();\n ab.render();\n clicked = false;\n counter++;\n }", "public void render(GameContainer gc, GameManager gm, Renderer r) {\n }", "public void render(){\n\t\tBufferStrategy bs = getBufferStrategy();\n\t\tif(bs == null){\n\t\t\tcreateBufferStrategy(3);\n\t\t\treturn;\n\t\t}\n\t\t\n\t\tthis.screen.renderBackground();\n\t\t\n\t\t\n\t\tfor(int i=0;i<this.obstacles.size();i++){\n\t\t\tobstacles.get(i).render(screen);\n\t\t}\n\t\t\n\t\tthis.screen.renderGround();\n\t\t\n\t\t\n\t\tthis.bird.render(screen);\n\n\t\tscreen.renderLeftLim();\n\t\t\n\t\tfor(int i= 0;i<this.pixels.length;i++){\n\t\t\tthis.pixels[i] = this.screen.getPixel(i);\n\t\t}\n\t\n\n\t\t\n\t\tGraphics g = bs.getDrawGraphics();\n\t\tg.drawImage(image,0,0,getWidth(),getHeight(),null);\n\t\tg.setColor(Color.WHITE);\n\t\tg.setFont(new Font(\"Verdana\",0,30));\n\t\tg.drawString(\"\"+this.numGoals, 300, 60);\n\t\tif(this.gameOver){\n\t\t\tif(this.begin){\n\t\t\t\tg.setFont(new Font(\"Verdana\",0,50));\n\t\t\t\tg.drawString(GAMEOVER_MESSAGE, (WIDTH-300)/2, 200);\n\t\t\t\t\n\t\t\t\tg.setFont(new Font(\"Verdana\",0,20));\n\t\t\t\tg.drawString(\"press down key to restart\", (WIDTH-250)/2, 300);\n\t\t\t\tg.drawString(\"Best score:\"+this.bestScore, (WIDTH-135)/2, 350);\n\t\t\t}else{\n\t\t\t\tg.setFont(new Font(\"Verdana\",0,50));\n\t\t\t\tg.drawString(\"OPEN BIRD\", (WIDTH-270)/2, 200);\n\t\t\t\t\n\t\t\t\tg.setFont(new Font(\"Verdana\",0,20));\n\t\t\t\tg.drawString(\"press down key to start\", (WIDTH-250)/2, 300);\n\t\t\t}\n\t\t}\n\t\tg.dispose();\n\t\tbs.show();\n\t}", "protected void render() {\n\t\tentities.render();\n\t\t// Render GUI\n\t\tentities.renderGUI();\n\n\t\t// Flips the page between the two buffers\n\t\ts.drawToGraphics((Graphics2D) Window.strategy.getDrawGraphics());\n\t\tWindow.strategy.show();\n\t}", "public void render(float delta) {\n Gdx.gl.glClearColor(0.1f, 0.1f, 0.1f, 0.1f);\n Gdx.gl.glClear(GL20.GL_COLOR_BUFFER_BIT);\n camera.update();\n game.batch.setProjectionMatrix(camera.combined);\n game.batch.begin();\n\n stage.draw();\n game.batch.end();\n game.batch.begin();\n font12.draw(game.batch, \"2Pool4Skool\", 220, 465);\n game.batch.end();\n\n }", "@Override\n\tpublic void tick() {\n\t\trenderer.render(this);\n\t}", "@Override\r\n\tpublic void render(Graphics g) {\r\n\t\tg.drawImage(objectsType.texture, (int) (x - handler.getGameCamera().getxOffset()),\r\n\t\t\t\t(int) (y - handler.getGameCamera().getyOffset()), width, height);\r\n\r\n\t\tif (DEBUGMODE) {\r\n\t\t\tg.setColor(Color.WHITE);\r\n\t\t\tg.drawRect((int) (x + bounds.x - handler.getGameCamera().getxOffset()),\r\n\t\t\t\t\t(int) (y + bounds.y - handler.getGameCamera().getyOffset()), bounds.width, bounds.height);\r\n\t\t}\r\n\r\n\t}", "@Override\n\tpublic void render(float delta) {\n\t\tbackground.render(camera);\n\t\tui.act();\n\t\tui.draw();\n\t\tif(showG) {\n\t\t\tspriteBatch.begin();\n\t\t\tspriteBatch.draw(texture, 0, 0);\n\t\t\tspriteBatch.end();\n\t\t}\n\t\tif(showA) {\n\t\t\tspriteBatch.begin();\n\t\t\tspriteBatch.draw(texture2, 0, 0);\n\t\t\tspriteBatch.end();\n\t\t}\n\t}", "public void render(){\n\t\tGL11.glPushMatrix();\n GL11.glClear(GL11.GL_COLOR_BUFFER_BIT | GL11.GL_DEPTH_BUFFER_BIT);\n\n /* Load the Identity Matrix to reset our drawing locations */\n GL11.glLoadIdentity(); \n \n /* Zoom */\n \tGL11.glScalef(zoom, zoom, 0);\n \t\n \t /* Position */\n \tGL11.glTranslatef(parent.width/zoom/2-position.x, parent.height/zoom/2-position.y, 0);\n\n \t/* Prepares draw list with graphics elements list to sort and render */\n \tdrawlist.clear();\n\t\tdrawlist.addAll(graphicsElements);\n\n\t\t/* Sort draw list, with respect to y of sprite */\n\t\tCollections.sort(drawlist, new Comparator<Sprite>() {\n\t\t\t@Override\n\t\t\tpublic int compare(Sprite s1, Sprite s2) {\n\t\t\t\t/* Sprites that not sort, like backgrounds or maps */\n\t\t\t\tif(!s1.sort)\n\t\t\t\t\treturn -1;\n\t\t\t\tif(!s2.sort)\n\t\t\t\t\treturn 1;\n\t\n\t\t\t\t\n\t\t if (s1.position.y+s1.height < s2.position.y+s2.height) {\n\t\t return -1;\n\t\t }else {\n\t\t return 1;\n\t\t }\n\t\t\t}\n\t\t});\n\t\t\n\t\t/* render each sprite already ordered of draw list */\n \tfor (Iterator<Sprite> iterator = drawlist.iterator(); iterator.hasNext();) {\n\t\t\tSprite s = iterator.next();\n\t\t\ts.render();\n \t}\n \t\n \tGL11.glPushMatrix();\n }", "public void render() {\n\t\tcam.update();\n\t\tcam.apply(Gdx.gl10);\n\n\t\t// TODO: encapsulate in the background class\n\t\t/*\n\t\t * float gravColour = (WorldGravity.G - WorldGravity.gravMin) /\n\t\t * (WorldGravity.gravMax - WorldGravity.gravMin);\n\t\t * \n\t\t * float red = gravColour; float blue = (1 - gravColour);\n\t\t * \n\t\t * Gdx.graphics.getGL10().glClearColor(red, 0f, blue, 1f);\n\t\t */\n\n\t\tGdx.graphics.getGL10().glClearColor(0.3f, 0f, 0.4f, 1f);\n\t\tGdx.graphics.getGL10().glClear(\n\t\t\t\tGL10.GL_COLOR_BUFFER_BIT | GL10.GL_DEPTH_BUFFER_BIT);\n\n\t\t// spriteBatch has its own camera so the code below sets its projection\n\t\t// matrix to that of the camera\n\t\tspriteBatch.setProjectionMatrix(cam.combined);\n\t\t\n\t\t// all drawing using spriteBatch needs to be surrounded with begin() and\n\t\t// end()\n\t\tspriteBatch.begin();\n\t\t// put all the drawing methods here\n\t\t// *************************************\n\t\tdrawBackground();\n\t\t\n\t\tdrawButtons();\n\t\t\n\t\tdrawMenu();\n\n\t\tspriteBatch.end();\n\t}", "@Override\n\tpublic void render () {\n super.render();\n\t}", "void render(Graphics g);", "public void render() {\n GameApp.getSpritebatch().draw(sprite, position.x, position.y, GridSquare.SIZE, GridSquare.SIZE);\n if (active) {\n if (currTime + attack.getAttackDelay() < System.currentTimeMillis() && attackTargets()) {\n\n currTime = System.currentTimeMillis();\n }\n attack.render();\n }\n }", "@Override\n public void render() {\n // Set the background color to opaque black\n Gdx.gl.glClearColor(0, 0, 0, 1);\n // Actually tell OpenGL to clear the screen\n Gdx.gl.glClear(GL20.GL_COLOR_BUFFER_BIT);\n // First we begin a batch of points\n shapeRenderer.begin(ShapeType.Point);\n // Then we draw a point\n shapeRenderer.point(100, 100, 0);\n // And make sure we end the batch\n shapeRenderer.end();\n }", "public void startRendering() {\n if (!justRendered) {\n justRendered = true;\n \n if (Flags.wireFrame) p.render_wireFrame();\n else p.render();\n }\n }", "public void render()\n\t{\n\t\t//double buffering is cool\n\t\tBufferStrategy bs = getBufferStrategy();\n\t\tif (bs == null)\n\t\t{\n\t\t\tcreateBufferStrategy(2);\n\t\t\tbs = getBufferStrategy();\n\t\t}\n\t\t\t\n\t\tGraphics2D g2 = (Graphics2D)bs.getDrawGraphics();\n\t\n\t\t\n\t\t\n\t\tif (true)\t\n\t\t{\n\t\t\tif (level != 0)\n\t\t\t{\n\t\t\t\tg2.setColor(Color.black);\n\t\t\t\tg2.fillRect(0, 0, width, height);\t\t\t\n\t\t\t}\n\t\t\tgameObjectHandler.render(g2,false);\n\t\t}\n\t\tif(currTransition != null)\n\t\t{\n\t\t\tcurrTransition.render(g2);\n\t\t\n\t\t}\n\t\t\n\t\t\n\t\tbs.show();\n\t\tg2.dispose();\n\t\n\t}", "@Override\r\n\tpublic void render() {\n\t\t\r\n\t}", "@Override\n public void render(GameContainer gameContainer, StateBasedGame stateBasedGame, Graphics graphics) {\n /**\n * The image is being rendered if:\n * 1. The target is not destroyed, OR\n * 2. The target is an ENEMY that has not been fallen out of the game frame yet.\n */\n\n if (!isDestroyed() || (getType() == TargetType.ENEMY && !isUnreachable())) {\n metaObject.getImage(hitCounter).draw(getSmallestX(), getSmallestY());\n }\n }", "public void render() {\n\t\tBufferStrategy bs = getBufferStrategy();\n\t\tif (bs == null) { //if the buffer strategy doesnt get created, then you create it\n\t\t\tcreateBufferStrategy(3); //the number 3 means it creates triple buffering\n\t\t\treturn;\t\t\t\t\t//, so when you backup frame gets displayed (2) it will also have a backup\t\n\t\t}\n\t\t\n\t\t//apply data to the buffer \"bs\"\n\t\t//this is creating a link to graphics to drawing graphics to the screen.\n\t\tGraphics g = bs.getDrawGraphics();\n\t\t/**\n\t\t * You input all of your graphics inbetween the g object and g.dispose();\n\t\t */\n\t\t//###################\n\t\t\n\t\tg.setColor(Color.BLACK);\n\t\tg.fillRect(0, 0, getWidth(), getHeight());\n\t\t\n\t\t//###################\n\t\tg.dispose(); //this dispose of all the graphics\n\t\tbs.show(); //this will make the next available buffer visible\n\t}", "void render(@Nonnull GameContainer container);", "@Override\n\tpublic void render() {\n\t\t\n\t}", "public abstract void render(Renderer renderer);", "@Override\n public void render() { super.render(); }", "public void render(final Graphics aG)\r\n\t{\r\n\t\t// Render background\r\n\t\tfinal Image background = DataManager.instance().getBackgroundImage(0);\r\n\t\taG.drawImage(background, -(mScreen.getX() / 5 % background.getWidth()), 0);\r\n\t\taG.drawImage(background, background.getWidth() - (mScreen.getX() / 5 % background.getWidth()), 0);\r\n\t\t\r\n\t\t// Render Blocks\r\n\t\tfor (int x = Math.max(mScreen.getX() / Block.SIZE, 0); x <= (mScreen.getX() + mScreen.getWidth()) / Block.SIZE && x < mWidth; x++ )\r\n\t\t\tfor (int y = Math.max(mScreen.getY() / Block.SIZE, 0); y <= (mScreen.getY() + mScreen.getHeight()) / Block.SIZE && y < mHeight; y++ )\r\n\t\t\t\trenderBlock(x, y, aG);\r\n\t\t\r\n\t\t// Render entities\r\n\t\tfor (final Entity entity : mEntities.values())\r\n\t\t\tentity.render(aG);\r\n\t\tfor (final Entity entity : mParticles.values())\r\n\t\t\tentity.render(aG);\r\n\t\t\r\n\t\t// Render transparent blocks\r\n\t\tfor (final int tile : mTransparentBlocks)\r\n\t\t{\r\n\t\t\tfinal int x = tile % mWidth, y = tile / mWidth;\r\n\t\t\tBlock.render(x, y, mBlocks[x][y], aG, this);\r\n\t\t}\r\n\t}", "private void renderEngine() {\r\n GL11.glDisable(GL11.GL_LIGHTING);\r\n\r\n GL11.glEnable(GL11.GL_BLEND);\r\n GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE);\r\n\r\n shotTexture.bind();\r\n engine.render();\r\n\r\n GL11.glDisable(GL11.GL_BLEND);\r\n }", "@Override\n public void render() {\n sortEntities(Entity.getEntities());\n renderBackground();\n renderBattleState();\n if(selectedPc != null){\n MyGL2dRenderer.drawLabel(getSelectedPc().getCollisionBox().left - 4 * GameView.density() + cameraX,\n getSelectedPc().getCollisionBox().bottom - getSelectedPc().getCollisionBox().width() / 5 + cameraY,\n getSelectedPc().getCollisionBox().width() + 8 * GameView.density(),\n getSelectedPc().getCollisionBox().width() * 2 / 5,\n TextureData.selected_character_visual, 255);\n }\n if(!win){\n renderSpells();\n renderGold();\n }\n }", "public void drawAllGraphics(){\r\n\t\t \r\n\t}", "@Override\n\tpublic void paint(Graphics g) {\n\t\tGraphics2D backBufferG2 = (Graphics2D)backBuffer.getGraphics();\n\t\tbackBufferG2.translate(0, scene.height);\n\t\tbackBufferG2.scale(1, -1);\n\t\t\n\t\t// Clear the buffer image before drawing stuff onto it\n\t\tbackBufferG2.setColor(scene.backgroundColor);\n\t\tbackBufferG2.fillRect(0, 0, getWidth(), getHeight());\n\t\t\n\t\t// Now we render the entire scene!\n\t\trenderer.scheduleNodeForRendering(scene); // Render scene + all it's children!\n\t\trenderer.scheduleNodeForRendering(scene.camera); //Need to specify camera individually \n\t\t\t\t\t\t\t\t\t\t\t\t\t//because camera isn't in the scene's children array\n\t\trenderer.renderAllNodes(backBufferG2);\n\t\t\n\t\t// Finally we draw the buffer image onto the main Graphics object\n\t\tg.drawImage(backBuffer, 0 , 0, this);\n\t}", "@Override\n\tpublic void render(GameContainer gc, Graphics g) throws SlickException\n\t{\n\t\tswitch(GameMaster.getState()){\n\t\tcase 1:\n\t\t\tgui.drawContent(g);\n\t\t\tbreak;\n\t\tcase 2:\t\t\t\n\t\t\tgui.drawEndScene(g);\n\t\t\tbreak;\n\t\tdefault:\n\t\t\tgui.drawStartScene(g);\n\t\t\tbreak;\n\t\t}\n\t}", "void draw() {\n\t\t// display debug information\n\t\t// if (debugMode)\n\t\t// displayDebugInformation();\n\n\t\tupdate();\n\t\trender(); // display freetransform points, lines and colorings\n\n\t\t// display opposite objects\n\t\t// displayOppositeObject();\n\t}", "@Override\r\n\tpublic void draw() {\r\n\t\t//Set the background to dark grey\r\n\t\tbackground(50, 50, 50);\t\r\n\t\t//If the current state is processing, display text explaining this\r\n\t\tif (this.currentGameState == DisplayStates.PROCESSING) {\r\n\t\t\ttext(\"Processing, please wait...\", 30, 340); \r\n\t\t} else { //Otherwise, the grid should be drawn in it's current state\r\n\t\t\tthis.zoomer.transform(); //Transform the zoom based on user input\r\n\t\t\t//Get the cells in their current state\r\n\t\t\tthis.gridCells = this.world.getCells(); \r\n\t\t\t//Work out which size images to use.\r\n\t\t\tupdateImageScale();\r\n\t\t\t//Draw the images to the sketch based on the current scale\r\n\t\t\tif (this.currentImageScale == ImageDrawScales.LARGE) {\r\n\t\t\t\tdrawImages(LARGE_IMAGE, this.gridCells);\r\n\t\t\t} else if (this.currentImageScale == ImageDrawScales.MEDIUM) {\r\n\t\t\t\tdrawImages(MEDIUM_IMAGE, this.gridCells);\r\n\t\t\t} else {\r\n\t\t\t\tdrawImages(SMALL_IMAGE, this.gridCells);\r\n\t\t\t}\r\n\t\t}\r\n\t}", "public void render (SpriteBatch batch){\n \tif(collected) return;\n \t\n \tTextureRegion reg = null; //init reg var\n \treg = (TextureRegion) animation.getKeyFrame(stateTime,true); //set reg var\n \tbatch.draw(reg.getTexture(), position.x, position.y,\n \t\t\torigin.x, origin.y, dimension.x, dimension.y, scale.x, scale.y,\n \t\t\trotation, reg.getRegionX(), reg.getRegionY(),\n \t\t\treg.getRegionWidth(), reg.getRegionHeight(), false, false);\n }", "@Override\r\n\tpublic void render() {\n\r\n\t}", "@Override\n public void prerender() {\n }", "@Override\n public void renderGameObject() {\n Gdx.gl.glClearColor(1, 1, 1, 1);\n Gdx.gl.glClear(GL20.GL_COLOR_BUFFER_BIT);\n\n //this is where we can actually display stuff on the screen\n batch.begin();\n\n batch.draw(new TextureRegion(background),100,100,100,100,200,200,1,1,0);\n\n batch.end();\n\n }", "public void render()\n\t{\n\t\tBufferStrategy bs = this.getBufferStrategy();\n\n\t\tif (bs == null)\n\t\t{\n\t\t\tcreateBufferStrategy(3);\n\t\t\treturn;\n\t\t}\n\n\t\tGraphics g = bs.getDrawGraphics();\n\t\t//////////////////////////////\n\n\t\tg.setColor(Color.DARK_GRAY);\n\t\tg.fillRect(0, 0, getWidth(), getHeight());\n\t\tif (display != null && GeneticSimulator.updateRendering)\n\t\t{\n\t\t\tg.drawImage(display, 0, 0, getWidth(), getHeight(), this);\n\t\t}\n\n\t\tWorld world = GeneticSimulator.world();\n\n\t\tworld.draw((Graphics2D) g, view);\n\n\t\tg.setColor(Color.WHITE);\n\t\tg.drawString(String.format(\"view: [%2.1f, %2.1f, %2.1f, %2.1f, %2.2f]\", view.x, view.y, view.width, view.height, view.PxToWorldScale), (int) 10, (int) 15);\n\n\t\tg.drawString(String.format(\"world: [time: %2.2f pop: %d]\", world.getTime() / 100f, World.popCount), 10, 30);\n\n\t\tg.drawRect(view.pixelX, view.pixelY, view.pixelWidth, view.pixelHeight);\n//\t\tp.render(g);\n//\t\tc.render(g);\n\n\n\t\t//g.drawImage(player,100,100,this);\n\n\t\t//////////////////////////////\n\t\tg.dispose();\n\t\tbs.show();\n\t}", "@Override\r\n public void render(final Graphics graphics) throws Exception\r\n {\r\n if (hasGameover())\r\n {\r\n //draw the victory screen\r\n graphics.drawImage(victory, 0, 0, null);\r\n }\r\n else\r\n {\r\n if (intermission.isActive())\r\n {\r\n //draw the intermission\r\n this.intermission.render(graphics);\r\n }\r\n else\r\n {\r\n //draw the background\r\n graphics.drawImage(background, 0, 0, null);\r\n\r\n //draw the current puzzle\r\n this.puzzles.render(graphics);\r\n\r\n //draw the pieces\r\n this.pieces.render(graphics);\r\n\r\n //draw the outline of the current puzzle\r\n this.puzzles.renderOutline(graphics);\r\n\r\n //draw the cursor\r\n this.puzzles.renderCursor(graphics);\r\n }\r\n }\r\n }", "public void render(){\r\n if(getLives() >= 10){\r\n StdDraw.picture(super.xCoord,super.yCoord,\"EnemyPurple.png\",super.radius*2,super.radius*2);\r\n }\r\n if(getLives() < 10){\r\n StdDraw.picture(super.xCoord,super.yCoord,\"EnemyPink.png\",super.radius*2,super.radius*2);\r\n }\r\n }", "@Override\n public void render() {\n\n renderer.prepWindowRender(globalGameData.getGameWindow());\n renderer.setRenderSpace(0,0,500,500);\n\n\n renderEnvironment(getMainCamera(),testPlayer.getPlayerEntity().getEntityView().getViewableRegions(), instancedGridMesh);\n renderer.enableTransparency();\n walkieTalkie.render(renderer,renderer.getRenderWidth());\n renderer.disableTransparency();\n\n\n\n renderer.setRenderSpace(500,0,500,500);\n if (currentPlayers.containsKey(UUID.fromString(\"087954ba-2b12-4215-9a90-f7b810797562\"))) {\n renderEnvironment(getMainCamera(),currentPlayers.get(UUID.fromString(\"087954ba-2b12-4215-9a90-f7b810797562\")).getEntityView().getViewableRegions(), instancedGridMesh);\n }\n\n renderer.setRenderSpace(1000,0,500,500);\n renderer.enableTransparency();\n renderer.render2DTextItems(debugItems, \"Default2D\");\n renderer.disableTransparency();\n\n /*\n if (currentPlayers.containsKey(UUID.fromString(\"087954ba-2b12-4215-9a90-f7b810797562\"))) {\n renderer.setRenderSpace(500, 0, 500, 500);\n for (Region region : currentPlayers.get(UUID.fromString(\"087954ba-2b12-4215-9a90-f7b810797562\")).getEntityView().getViewableRegions()) {\n for (Block block : region.getBlocksArray()) {\n if (block instanceof CustomRenderBlock) {\n ((CustomRenderBlock) block).renderCustomBlock(renderer, camera);\n }\n }\n for (Entity entity : region.getEntities()) {\n entity.render(renderer, camera);\n }\n }\n }\n */\n\n\n //renderer.setRenderSpace(500,0,280,500);\n //SpriteItem spriteItem = new SpriteItem(AssetLoader.getTextureAsset(\"Noise\"),280,500,true);\n //spriteItem.setPosition(0,0,0);\n //renderer.render2DSpriteItem(spriteItem,\"Default2D\");\n //spriteItem.cleanup();\n\n\n\n /*\n renderer.getShader(\"DebugShader2D\").bind();\n glActiveTexture(GL_TEXTURE1);\n glBindTexture(GL_TEXTURE_2D, shaderTestBitmap.getId());\n glActiveTexture(GL_TEXTURE2);\n glBindTexture(GL_TEXTURE_2D, shaderTestEffect1.getId());\n glActiveTexture(GL_TEXTURE3);\n glBindTexture(GL_TEXTURE_2D, shaderTestEffect2.getId());\n glActiveTexture(GL_TEXTURE4);\n glBindTexture(GL_TEXTURE_2D, shaderTestEffect3.getId());\n renderer.getShader(\"DebugShader2D\").setUniform(\"bitmap\", 1);\n renderer.getShader(\"DebugShader2D\").setUniform(\"effect1\", 2);\n renderer.getShader(\"DebugShader2D\").setUniform(\"effect2\", 3);\n renderer.getShader(\"DebugShader2D\").setUniform(\"effect3\", 4);\n i++;\n i %= 600;\n float framePercent = i / 600.0f;\n renderer.getShader(\"DebugShader2D\").setUniform(\"frame\", framePercent);\n System.out.println(i);\n shaderTest.setPosition((float)gameInput.getMouseX(),(float)gameInput.getMouseY(),0);\n renderer.render2DSprite(shaderTest, \"DebugShader2D\");\n */\n\n\n\n\n\n }", "@Override\r\n\tpublic void draw() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void draw() {\n\t\t\r\n\t}", "private void render() {\n\n\tbs=display.getCanvas().getBufferStrategy();\t\n\t\n\tif(bs==null) \n\t {\t\n\t\tdisplay.getCanvas().createBufferStrategy(3);\n\t\treturn ;\n\t }\n\t\n\tg=bs.getDrawGraphics();\n\n\t//Clear Screen\n\tg.clearRect(0, 0, width, height);\n\t\n\tif(State.getState()!=null )\n\t\tState.getState().render(g);\n\t\n\t//End Drawing!\n\tbs.show();\n\tg.dispose();\n\t\n\t}", "public void render() {\n this.canvas.repaint();\n }", "@Override\n public void render() {\n if (!gameOver && !youWin) this.update();\n\n //Dibujamos\n this.draw();\n }", "public void render(GameContainer gc, Painter p) {\n\n }", "@Override\n\tpublic void render(GameContainer gc, StateBasedGame sbg, Graphics g) throws SlickException\n\t{\n\t\tmapRenderSystem.process();\n\t\trenderingSystem.process();\n\t\tanimationRenderSystem.process();\t\t\n\t\tspellRenderSystem.process();\n\t\tHUDRenderSystem.process();\n\n\t}", "private void render() {\n\t\tBufferStrategy bs = this.getBufferStrategy();\r\n\t\tif (bs == null) {\r\n\t\t\tcreateBufferStrategy(3);\r\n\t\t\treturn;\r\n\t\t}\r\n\t\t\r\n\t\t//Initiates Graphics class using bufferStrategy\r\n\t\tGraphics g = bs.getDrawGraphics();\r\n\t\t\r\n\t\t//displays img on screen\r\n\t\tg.drawImage(img, 0, 0, null);\r\n\t\t\r\n\t\tg.setColor(Color.CYAN);\r\n\t\tg.drawString(fps + \" FPS\", 10, 10);\r\n\t\tg.setFont(new Font(\"Arial\", 0, 45));\r\n\r\n\t\tg.dispose();//clears graphics\r\n\t\tbs.show();//shows graphics\r\n\t}", "public void render(){\n//\t\tsetCards();\n//\t\tsetMurderInfo();\n\t}", "@Override\r\n public void draw() {\n }" ]
[ "0.745359", "0.7426727", "0.74100864", "0.7379814", "0.7192833", "0.70937014", "0.69786537", "0.6970433", "0.69589263", "0.6914293", "0.68060005", "0.68037814", "0.6798673", "0.6794093", "0.67768365", "0.67726725", "0.6753567", "0.67510694", "0.67271084", "0.6727085", "0.6711148", "0.66915894", "0.6691226", "0.66896546", "0.66896546", "0.668774", "0.6678248", "0.6678121", "0.66739416", "0.6671017", "0.6669807", "0.6668507", "0.66542256", "0.6635774", "0.66343933", "0.6583093", "0.6579611", "0.6579611", "0.6570222", "0.656947", "0.6551748", "0.6547872", "0.6547668", "0.65410864", "0.6523589", "0.6511066", "0.65063304", "0.65038097", "0.64965427", "0.64858425", "0.6483381", "0.64743394", "0.64652944", "0.64630264", "0.6458596", "0.64578867", "0.645105", "0.645077", "0.64504504", "0.64483136", "0.64397365", "0.6434688", "0.64344037", "0.6426536", "0.64262044", "0.6421236", "0.6411649", "0.6402077", "0.63943297", "0.6384353", "0.6383979", "0.63839555", "0.63733524", "0.6365978", "0.63626266", "0.6353982", "0.6351413", "0.63499707", "0.6346349", "0.63447315", "0.63395864", "0.6334849", "0.632862", "0.63205653", "0.63092685", "0.63084733", "0.63081515", "0.63080096", "0.63077474", "0.6305107", "0.6304224", "0.6291058", "0.6291058", "0.62883884", "0.62844056", "0.628101", "0.62742424", "0.62719107", "0.62592393", "0.6256603", "0.6250783" ]
0.0
-1
width & height are already scaled.
@Override public void resize(int width, int height) { viewCamera.viewportWidth = width; viewCamera.viewportHeight = height; viewCamera.position.set(0, 0, 0); viewCamera.update(); Vector3 min = MIN_BOUND.cpy(); Vector3 max = new Vector3(MAX_BOUND.x - width, MAX_BOUND.y - height, 0); viewCamera.project(min, 0, 0, width, height); viewCamera.project(max, 0, 0, width, height); bounds = new BoundingBox(min, max); // do a pan to reset camera position pan(min); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\n\tfinal public void scale(double x, double y)\n\t{\n\t\twidth *= x;\n\t\theight *= y;\n\t}", "public void initSize() {\n WIDTH = 320;\n //WIDTH = 640;\n HEIGHT = 240;\n //HEIGHT = 480;\n SCALE = 2;\n //SCALE = 1;\n }", "public abstract BufferedImage scale(Dimension destinationSize);", "public void rescale()\r\n\t{\n\t}", "private void updateScale() {\n target.setScaleX(scaleValue);\n target.setScaleY(scaleValue);\n }", "private float getNewScale() {\n int width = getWidth() - (padding[0] + padding[2]);\n float scaleWidth = (float) width / (cropRect.right - cropRect.left);\n\n int height = getHeight() - (padding[1] + padding[3]);\n float scaleHeight = (float) height / (cropRect.bottom - cropRect.top);\n if (getHeight() > getWidth()) {\n return scaleWidth < scaleHeight ? scaleWidth : scaleHeight;\n }\n return scaleWidth < scaleHeight ? scaleWidth : scaleHeight;\n }", "@Override\n public float getScale() {\n return scale;\n }", "@Override\n\tpublic void resize(float width, float height) {\n\t}", "private BufferedImage scale(final BufferedImage input,\n \t\tfinal int newWidth, final int newHeight)\n \t{\n \t\tfinal int oldWidth = input.getWidth(), oldHeight = input.getHeight();\n \t\tif (oldWidth == newWidth && oldHeight == newHeight) return input;\n \n \t\tfinal BufferedImage output =\n \t\t\tnew BufferedImage(newWidth, newHeight, input.getType());\n \t\tfinal AffineTransform at = new AffineTransform();\n \t\tat.scale((double) newWidth / oldWidth, (double) newHeight / oldHeight);\n \t\tfinal AffineTransformOp scaleOp =\n \t\t\tnew AffineTransformOp(at, AffineTransformOp.TYPE_BILINEAR);\n \t\treturn scaleOp.filter(input, output);\n \t}", "@Override\n public void resize(int width, int height) {\n \n }", "public void beginScaling() {\n xScale = 1.0f;\n yScale = 1.0f;\n }", "private void updateImageScale() {\r\n\t\t//Check which dimension is larger and store it in this variable.\r\n\t\tint numHexLargestDimension = this.numHexRow;\r\n\t\tif (this.totalHexWidth > this.totalHexHeight) {\r\n\t\t\tnumHexLargestDimension = this.numHexCol;\r\n\t\t}\r\n\t\t\r\n\t\tif (numHexLargestDimension < 35) {\r\n\t\t\tif (this.zoomer.getZoomScale() * (this.numHexCol / 2) > 16.5) {\r\n\t\t\t\tthis.currentImageScale = ImageDrawScales.LARGE;\r\n\t\t\t} else if (this.zoomer.getZoomScale() * (this.numHexCol / 2) > 7){\r\n\t\t\t\tthis.currentImageScale = ImageDrawScales.MEDIUM;\r\n\t\t\t} else {\r\n\t\t\t\tthis.currentImageScale = ImageDrawScales.SMALL;\r\n\t\t\t}\r\n\t\t}\r\n\t\telse if (numHexLargestDimension < 70) {\r\n\t\t\tif (this.zoomer.getZoomScale() * (this.numHexCol / 2) > 22.2) {\r\n\t\t\t\tthis.currentImageScale = ImageDrawScales.LARGE;\r\n\t\t\t} else if (this.zoomer.getZoomScale() \r\n\t\t\t\t\t* (this.numHexCol / 2) > 14.5){\r\n\t\t\t\tthis.currentImageScale = ImageDrawScales.MEDIUM;\r\n\t\t\t} else {\r\n\t\t\t\tthis.currentImageScale = ImageDrawScales.SMALL;\r\n\t\t\t}\r\n\t\t}\r\n\t\telse if (numHexLargestDimension < 105) {\r\n\t\t\tif (this.zoomer.getZoomScale() * (this.numHexCol / 2) > 32.6) {\r\n\t\t\t\tthis.currentImageScale = ImageDrawScales.LARGE;\r\n\t\t\t} else if (this.zoomer.getZoomScale() * (this.numHexCol / 2) > 21){\r\n\t\t\t\tthis.currentImageScale = ImageDrawScales.MEDIUM;\r\n\t\t\t} else {\r\n\t\t\t\tthis.currentImageScale = ImageDrawScales.SMALL;\r\n\t\t\t}\r\n\t\t}\r\n\t\telse {\r\n\t\t\tif (this.zoomer.getZoomScale() * (this.numHexCol / 2) > 44.4) {\r\n\t\t\t\tthis.currentImageScale = ImageDrawScales.LARGE;\r\n\t\t\t} else if (this.zoomer.getZoomScale() * (this.numHexCol / 2) > 28){\r\n\t\t\t\tthis.currentImageScale = ImageDrawScales.MEDIUM;\r\n\t\t\t} else {\r\n\t\t\t\tthis.currentImageScale = ImageDrawScales.SMALL;\r\n\t\t\t}\r\n\t\t}\r\n\t}", "@Override\n public void resize(int width, int height) {\n\n }", "public void scaleBitmap(int newWidth, int newHeight) {\n\t\t// Technically since we always keep aspect ratio intact\n\t\t// we should only need to check one dimension.\n\t\t// Need to investigate and fix\n\t\tif ((newWidth > mMaxWidth) || (newHeight > mMaxHeight)) {\n\t\t\tnewWidth = mMaxWidth;\n\t\t\tnewHeight = mMaxHeight;\n\t\t}\n\t\tif ((newWidth < mMinWidth) || (newHeight < mMinHeight)) {\n\t\t\tnewWidth = mMinWidth;\n\t\t\tnewHeight = mMinHeight;\t\t\t\n\t\t}\n\n\t\tif ((newWidth != mExpandWidth) || (newHeight!=mExpandHeight)) {\t\n\t\t\t// NOTE: depending on the image being used, it may be \n\t\t\t// better to keep the original image available and\n\t\t\t// use those bits for resize. Repeated grow/shrink\n\t\t\t// can render some images visually non-appealing\n\t\t\t// see comments at top of file for mScaleFromOriginal\n\t\t\t// try to create a new bitmap\n\t\t\t// If you get a recycled bitmap exception here, check to make sure\n\t\t\t// you are not setting the bitmap both from XML and in code\n\t\t\tBitmap newbits = Bitmap.createScaledBitmap(mScaleFromOriginal ? mOriginal:mImage, newWidth,\n\t\t\t\t\tnewHeight, true);\n\t\t\t// if successful, fix up all the tracking variables\n\t\t\tif (newbits != null) {\n\t\t\t\tif (mImage!=mOriginal) {\n\t\t\t\t\tmImage.recycle();\n\t\t\t\t}\n\t\t\t\tmImage = newbits;\n\t\t\t\tmExpandWidth=newWidth;\n\t\t\t\tmExpandHeight=newHeight;\n\t\t\t\tmResizeFactorX = ((float) newWidth / mImageWidth);\n\t\t\t\tmResizeFactorY = ((float) newHeight / mImageHeight);\n\t\t\t\t\n\t\t\t\tmRightBound = mExpandWidth>mViewWidth ? 0 - (mExpandWidth - mViewWidth) : 0;\n\t\t\t\tmBottomBound = mExpandHeight>mViewHeight ? 0 - (mExpandHeight - mViewHeight) : 0;\n\t\t\t}\t\t\t\t\t\t\t\n\t\t}\n\t}", "@Override\r\n public void resize(int width, int height) {\r\n\r\n }", "int getScale();", "@Override\r\n\tpublic void resize(int width, int height) {\n\t\t\r\n\t}", "@Override\r\n\tpublic void resize(int width, int height) {\n\t\t\r\n\t}", "@Override\r\n\tpublic void resize(int width, int height) {\n\t\t\r\n\t}", "@Override\r\n\tpublic void resize(int width, int height) {\n\t\t\r\n\t}", "@Override\r\n\tpublic void resize(int width, int height) {\n\t\t\r\n\t}", "@Override\r\n\tpublic void resize(int width, int height) {\n\t\t\r\n\t}", "@Override\r\n\tpublic void resize(int width, int height) {\n\t\t\r\n\t}", "@Override\r\n\tpublic void resize(int width, int height) {\n\t\t\r\n\t}", "private BufferedImage scale(BufferedImage sourceImage) {\n GraphicsEnvironment graphicsEnvironment = GraphicsEnvironment.getLocalGraphicsEnvironment();\n GraphicsDevice graphicsDevice = graphicsEnvironment.getDefaultScreenDevice();\n GraphicsConfiguration graphicsConfiguration = graphicsDevice.getDefaultConfiguration();\n BufferedImage scaledImage = graphicsConfiguration.createCompatibleImage(IMAGE_DIMENSION, IMAGE_DIMENSION);\n\n Graphics2D newGraphicsImage = scaledImage.createGraphics();\n newGraphicsImage.setColor(Color.white);\n newGraphicsImage.fillRect(0, 0, IMAGE_DIMENSION, IMAGE_DIMENSION);\n\n double xScale = (double) IMAGE_DIMENSION / sourceImage.getWidth();\n double yScale = (double) IMAGE_DIMENSION / sourceImage.getHeight();\n AffineTransform affineTransform = AffineTransform.getScaleInstance(xScale,yScale);\n newGraphicsImage.drawRenderedImage(sourceImage, affineTransform);\n newGraphicsImage.dispose();\n\n return scaledImage;\n }", "@Override\n public void resize(int width, int height) {\n\n }", "@Override\n\tpublic int[] getImageScaleDrawing() {\n\t\treturn new int[] {\n\t\t\t\t80, 80\n\t\t};\n\t}", "public void setSize(float width, float height);", "public double getScale() {\n return scale;\n }", "public float getScale();", "@Override\r\n\tpublic void resize(int width, int height) {\n\r\n\t}", "@Override\r\n\tpublic void resize(int width, int height) {\n\r\n\t}", "@Override\r\n\tpublic void resize(int width, int height) {\n\r\n\t}", "public void setSize(double aWidth, double aHeight) { setWidth(aWidth); setHeight(aHeight); }", "@Override\n\tpublic void resize(int width, int height) {\n\n\t}", "@Override\n\tpublic void resize(int width, int height) {\n\n\t}", "@Override\n\tpublic void resize(int width, int height) {\n\n\t}", "@Override\n\tpublic void resize(int width, int height) {\n\n\t}", "@Override\n\tpublic void resize(int width, int height) {\n\n\t}", "@Override\n\tpublic void resize(int width, int height) {\n\n\t}", "@Override\n\tpublic void resize(int width, int height) {\n\n\t}", "@Override\n\tpublic void resize(int width, int height) {\n\n\t}", "@Override\n\tpublic void resize(int width, int height) {\n\n\t}", "@Override\n\tpublic void resize(int width, int height) {\n\n\t}", "@Override\n public void resize(int width, int height) {\n }", "private void ScaleImage(){\n\t\tBufferedImage resizedImage = new BufferedImage(this.getWidth(), this.getHeight(), BufferedImage.TYPE_INT_RGB);\n\t\tGraphics2D g2 = resizedImage.createGraphics();\n\t\tg2.setRenderingHint(RenderingHints.KEY_INTERPOLATION, RenderingHints.VALUE_INTERPOLATION_BILINEAR);\n\t\tg2.drawImage(image, 0, 0, this.getWidth(), this.getHeight(), null);\n\t\tg2.dispose();\n\t\tthis.image = resizedImage;\n\t}", "@Override\n\tpublic void resize(int width, int height) {\n\t\t\n\t}", "@Override\n\tpublic void resize(int width, int height) {\n\t\t\n\t}", "@Override\n\tpublic void resize(int width, int height) {\n\t\t\n\t}", "@Override\n\tpublic void resize(int width, int height) {\n\t\t\n\t}", "@Override\n\tpublic void resize(int width, int height) {\n\t\t\n\t}", "@Override\n\tpublic void resize(int width, int height) {\n\t\t\n\t}", "@Override\n\tpublic void resize(int width, int height) {\n\t\t\n\t}", "@Override\n\tpublic void resize(int width, int height) {\n\t\t\n\t}", "@Override\n\tpublic void resize(int width, int height) {\n\t\t\n\t}", "@Override\n\tpublic void resize(int width, int height) {\n\t\t\n\t}", "@Override\n\tpublic void resize(int width, int height) {\n\t\t\n\t}", "@Override\n\tpublic void resize(int width, int height) {\n\t\t\n\t}", "@Override\n\tpublic void resize(int width, int height) {\n\t\t\n\t}", "@Override\n\tpublic void resize(int width, int height) {\n\t\t\n\t}", "@Override\n\tpublic void resize(int width, int height) {\n\t\t\n\t}", "@Override\n\tpublic void resize(int width, int height) {\n\t\t\n\t}", "@Override\n\tpublic void resize(int width, int height) {\n\t\t\n\t}", "@Override\n\tpublic void resize(int width, int height) {\n\t\t\n\t}", "@Override\n\tpublic void resize(int width, int height) {\n\t\t\n\t}", "@Override\n\tpublic void resize(int width, int height) {\n\t\t\n\t}", "@Override\r\n\tpublic void resize(int width, int height) {\n\t}", "@Override\n\tpublic void resize(int width, int height) \n\t{\n\n\t}", "@Override\n\tpublic void resize(int width, int height) {\n\t}", "@Override\n\tpublic void resize(int width, int height) {\n\t}", "@Override\n\tpublic void resize(int width, int height) {\n\t}", "@Override\n\tpublic void resize(int width, int height) {\n\t}", "protected void updateScales() {\n hscale = 1f;\n vscale = 1f;\n viewData.setHscale(hscale);\n viewData.setVscale(vscale);\n }", "public int getScale() {\n return scale_;\n }", "@Override\n\tpublic void resize(int w, int h) {\n\t\tthis.leveys = w;\n\t\tthis.korkeus = h;\n\t\tthis.batch = new SpriteBatch();\n\t\tthis.ylaPalkinKorkeus = (int) (0.0931 * leveys);\n\n//\t\tskaala = Math.min((float) (w - 50) / 640,\n//\t\t\t\t(float) (h - 50 - ylaPalkinKorkeus) / 370f);\n\t\tskaala = Math.min((float) (w - 50) / 590,\n\t\t\t\t(float) (h - 50 - ylaPalkinKorkeus) / 354f);\n\n\t\t//System.out.println(\"(w - 50) / 640 = \" + w + \" - 50) / 640 = \" + (float) (w - 50) / 640);\n\t\t//System.out.println(\"(h - 50 - ylaPalkinKorkeus) / 370f) = \" + h + \"- 50 - \" + ylaPalkinKorkeus + \") / 370f = \" + (float) (h - 50 - ylaPalkinKorkeus) / 370f);\n\t\tSystem.out.println(\"Fontin skaala: \" + skaala);\n\t\tfont2.setScale(skaala);\n\t\t//font2.setScale(skaala*0.2f);\n\t\t// leveysSkaala = w / 640;\n\t\t// korkeusSkaala = h / 480;\n\n\t}", "private void rescale() {\n this.affineTransform = AffineTransform.getScaleInstance(this.zoom,\n this.zoom);\n int width = (int) ((this.board.getWidth() * 32) * this.zoom);\n int height = (int) ((this.board.getHeight() * 32) * this.zoom);\n this.setPreferredSize(new Dimension(width, height));\n this.repaint();\n }", "public int getScale(){\n return scale;\n }", "private void updateSize() {\n double width = pane.getWidth();\n double height = pane.getHeight();\n\n if(oldWidth == 0) {\n oldWidth = width;\n }\n if(oldHeight == 0) {\n oldHeight = height;\n }\n\n double oldHvalue = pane.getHvalue();\n double oldVvalue = pane.getVvalue();\n if(Double.isNaN(oldVvalue)) {\n oldVvalue = 0;\n }\n if(Double.isNaN(oldHvalue)) {\n oldHvalue = 0;\n }\n\n pane.setVmax(height);\n pane.setHmax(width);\n\n if(grow) {\n renderMapGrow(width, height, curZoom);\n } else {\n renderMap(width, height, curZoom);\n }\n\n pane.setVvalue((height/oldHeight)*oldVvalue);\n pane.setHvalue((width/oldWidth)*oldHvalue);\n\n oldWidth = width;\n oldHeight = height;\n }", "@Override\n\tpublic void resize(int width, int height)\n\t{\n\n\t}", "public double getScale() {\r\n return scale;\r\n }", "@Override\r\n\tpublic void resize() {\n\t\t\r\n\t}", "@Override\n\tpublic void componentResized(ComponentEvent e) {\n\t\twidthAttitude=e.getComponent().getSize().getWidth()/Width;\n\t\theightAttitude=e.getComponent().getSize().getHeight()/Height;\n\t}", "public void size(final int theWidth, final int theHeight);", "public void scale(float x, float y);", "protected abstract void resize();", "public int getScale() {\r\n return scale;\r\n }", "public void updateScale()\n {\n // get scale from world presenter\n s2 = (cam.getScale());\n //Convert to English Miles if appropriate\n if( !SettingsScreen.getUnits() ) s2 *= 0.60934;\n s1 = s2/2;\n repaint();\n }", "public double getScale() {\n return scale;\n }", "private void resize() {\n }", "@Override\n public void settings() {\n setSize(WIDTH, HEIGHT);\n }", "@Override\n\tpublic float getRenderSizeModifier() {\n\t\treturn getScale();\n\t}", "@Override\n\tpublic void setWidthAndHeight(int width, int height) {\n\t\t\n\t}", "private static AppImage scale(AppImage image) {\n\t\treturn scale(image, GraphicsConfig.getScaleWidth(), GraphicsConfig.getScaleHeight());\n\t}", "@Override\n\tpublic void resize(int width, int height) {\n\t\tcreate();\n\t}", "@Override\n\tpublic void resize() {\n\t\t\n\t}", "public Integer getScale() {\n return _scale;\n }", "public Integer getScale() {\n return _scale;\n }", "public ImageScale getScale() {\n return this.scale;\n }", "@Override\n public Double scalingFactor() {\n return 1.55d;\n }", "public void setRescale(double x, double y) {\n scaleX = x;\n scaleY = y;\n System.out.println(\"Rescale \" + x + \" \" + y);\n }", "public double getScale(){\n\t\treturn scale;\n\t}" ]
[ "0.74785966", "0.7100216", "0.7075639", "0.7059147", "0.69936097", "0.69198674", "0.6839444", "0.68285537", "0.6802287", "0.6753039", "0.67444104", "0.6723397", "0.6675232", "0.66713923", "0.6664888", "0.66529155", "0.66460663", "0.66460663", "0.66460663", "0.66460663", "0.66460663", "0.66460663", "0.66460663", "0.66460663", "0.66460013", "0.6628106", "0.6625251", "0.6619568", "0.6611692", "0.6610036", "0.66012603", "0.66012603", "0.66012603", "0.6599373", "0.6598087", "0.6598087", "0.6598087", "0.6598087", "0.6598087", "0.6598087", "0.6598087", "0.6598087", "0.6598087", "0.6598087", "0.6591339", "0.6574869", "0.6560313", "0.6560313", "0.6560313", "0.6560313", "0.6560313", "0.6560313", "0.6560313", "0.6560313", "0.6560313", "0.6560313", "0.6560313", "0.6560313", "0.6560313", "0.6560313", "0.6560313", "0.6560313", "0.6560313", "0.6560313", "0.6560313", "0.6560313", "0.6547301", "0.6545062", "0.6541424", "0.6541424", "0.6541424", "0.6541424", "0.6525095", "0.6519748", "0.65154916", "0.6511641", "0.6504265", "0.648086", "0.64766514", "0.6461139", "0.6451484", "0.64513147", "0.6449969", "0.6444986", "0.6443064", "0.6435144", "0.6431396", "0.6431083", "0.64186597", "0.6396362", "0.6391489", "0.638448", "0.6370693", "0.63699174", "0.6364947", "0.63630676", "0.63630676", "0.6363066", "0.6360608", "0.6354264", "0.6351282" ]
0.0
-1
Mapper for the entity Team and its DTO TeamDTO.
@Mapper(componentModel = "spring", uses = { CustomUserMapper.class, IconMapper.class }) public interface TeamMapper extends EntityMapper<TeamDTO, Team> { /* (non-Javadoc) * @see com.ttth.teamcaring.service.mapper.EntityMapper#toDto(java.lang.Object) */ @Mapping(source = "owner.id", target = "ownerId") @Mapping(source = "icon.id", target = "iconId") TeamDTO toDto(Team team); /* (non-Javadoc) * @see com.ttth.teamcaring.service.mapper.EntityMapper#toEntity(java.lang.Object) */ @Mapping(target = "groups", ignore = true) @Mapping(target = "appointments", ignore = true) @Mapping(source = "ownerId", target = "owner") @Mapping(source = "iconId", target = "icon") Team toEntity(TeamDTO teamDTO); /** * From id. * * @param id the id * @return the team */ default Team fromId(Long id) { if (id == null) { return null; } Team team = new Team(); team.setId(id); return team; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Mapper(uses = {PassengerMapper.class, TicketScheduleSectionMapper.class})\npublic interface TicketMapper {\n\n /**\n * To dto ticket dto.\n *\n * @param ticketEntity the ticket entity\n * @return the ticket dto\n */\n @Mappings({\n @Mapping(target = \"passengerDto\", source = \"ticketEntity.passengerEntity\"),\n @Mapping(target = \"ticketScheduleSectionDtoList\", source = \"ticketEntity.ticketScheduleSectionEntityList\")\n })\n TicketDto toDto(TicketEntity ticketEntity);\n\n /**\n * To dto list list.\n *\n * @param ticketEntityList the ticket entity list\n * @return the list\n */\n List<TicketDto> toDtoList(List<TicketEntity> ticketEntityList);\n\n /**\n * To entity ticket entity.\n *\n * @param ticketDto the ticket dto\n * @return the ticket entity\n */\n @Mappings({\n\n @Mapping(target = \"passengerEntity\", source = \"ticketDto.passengerDto\"),\n @Mapping(target = \"ticketScheduleSectionEntityList\", source = \"ticketDto.ticketScheduleSectionDtoList\")\n })\n TicketEntity toEntity(TicketDto ticketDto);\n\n /**\n * To entity list list.\n *\n * @param ticketDtoList the ticket dto list\n * @return the list\n */\n List<TicketEntity> toEntityList(List<TicketDto> ticketDtoList);\n\n}", "TeamDTO findOne(Long id);", "@Mappings({\n @Mapping(target = \"passengerDto\", source = \"ticketEntity.passengerEntity\"),\n @Mapping(target = \"ticketScheduleSectionDtoList\", source = \"ticketEntity.ticketScheduleSectionEntityList\")\n })\n TicketDto toDto(TicketEntity ticketEntity);", "@Mapper(componentModel = \"spring\", uses = {UserMapper.class, })\npublic interface PeopleMapper extends EntityMapper <PeopleDTO, People> {\n\n @Mapping(source = \"user.id\", target = \"userId\")\n @Mapping(source = \"user.firstName\", target = \"userFirstName\")\n @Mapping(source = \"user.lastName\", target = \"userLastName\")\n PeopleDTO toDto(People people);\n\n @Mapping(source = \"userId\", target = \"user\")\n @Mapping(target = \"seminarsPresenteds\", ignore = true)\n @Mapping(target = \"seminarsAttendeds\", ignore = true)\n @Mapping(target = \"specialGuestAts\", ignore = true)\n People toEntity(PeopleDTO peopleDTO);\n default People fromId(Long id) {\n if (id == null) {\n return null;\n }\n People people = new People();\n people.setId(id);\n return people;\n }\n\n default String peopleName(People people) {\n String name = \"\";\n if (people == null) {\n return null;\n }\n if (people.getUser() == null) {\n return null;\n }\n String firstName = people.getUser().getFirstName();\n if (firstName != null) {\n name += firstName;\n }\n String lastName = people.getUser().getLastName();\n if (lastName != null) {\n name += \" \" + lastName;\n }\n return name;\n }\n}", "public TeamInfo(TeamInfo other) {\n __isset_bitfield = other.__isset_bitfield;\n this.teamId = other.teamId;\n if (other.isSetTeamName()) {\n this.teamName = other.teamName;\n }\n this.teamPrice = other.teamPrice;\n if (other.isSetSource()) {\n this.source = other.source;\n }\n this.teamInventory = other.teamInventory;\n }", "@Mappings({\n\n @Mapping(target = \"passengerEntity\", source = \"ticketDto.passengerDto\"),\n @Mapping(target = \"ticketScheduleSectionEntityList\", source = \"ticketDto.ticketScheduleSectionDtoList\")\n })\n TicketEntity toEntity(TicketDto ticketDto);", "@Mapper\npublic interface ProjectMapper {\n\n ProjectMapper INSTANCE = Mappers.getMapper(ProjectMapper.class);\n\n Project toModel(ProjectDTO projectDTO);\n\n ProjectDTO toDTO(Project project);\n}", "@Mapper(componentModel = \"spring\", uses = {OgWorkPlaceTypesMapper.class})\npublic interface OgWorkPlacesMapper extends EntityMapper<OgWorkPlacesDTO, OgWorkPlaces> {\n\n @Mapping(source = \"idParent.id\", target = \"idParentId\")\n @Mapping(source = \"idParent.name\", target = \"idParentName\")\n @Mapping(source = \"idWorkPlaceTypes.id\", target = \"idWorkPlaceTypesId\")\n @Mapping(source = \"idWorkPlaceTypes.name\", target = \"idWorkPlaceTypesName\")\n OgWorkPlacesDTO toDto(OgWorkPlaces ogWorkPlaces);\n\n @Mapping(source = \"idParentId\", target = \"idParent\")\n @Mapping(source = \"idWorkPlaceTypesId\", target = \"idWorkPlaceTypes\")\n OgWorkPlaces toEntity(OgWorkPlacesDTO ogWorkPlacesDTO);\n\n default OgWorkPlaces fromId(Long id) {\n if (id == null) {\n return null;\n }\n OgWorkPlaces ogWorkPlaces = new OgWorkPlaces();\n ogWorkPlaces.setId(id);\n return ogWorkPlaces;\n }\n}", "D mapToDTO(E entity);", "public static <Entity,Dto> Dto entityToDTO(Entity entity,Class<Dto> classDTO)\n\t{\n\t\tModelMapper mapper = new ModelMapper();\n\t\treturn mapper.map(entity, classDTO);\n\t}", "@Mapper(componentModel = \"spring\", uses = {})\npublic interface TourBubblRoutePointMapper {\n\n @Mapping(source = \"tourBubbl.id\", target = \"tourBubblId\")\n TourBubblRoutePointDTO tourBubblRoutePointToTourBubblRoutePointDTO(TourBubblRoutePoint tourBubblRoutePoint);\n\n List<TourBubblRoutePointDTO> tourBubblRoutePointsToTourBubblRoutePointDTOs(List<TourBubblRoutePoint> tourBubblRoutePoints);\n\n @Mapping(source = \"tourBubblId\", target = \"tourBubbl\")\n TourBubblRoutePoint tourBubblRoutePointDTOToTourBubblRoutePoint(TourBubblRoutePointDTO tourBubblRoutePointDTO);\n\n List<TourBubblRoutePoint> tourBubblRoutePointDTOsToTourBubblRoutePoints(List<TourBubblRoutePointDTO> tourBubblRoutePointDTOs);\n\n default TourBubbl tourBubblFromId(Long id) {\n if (id == null) {\n return null;\n }\n TourBubbl tourBubbl = new TourBubbl();\n tourBubbl.setId(id);\n return tourBubbl;\n }\n}", "private LecturerDto mapDto(Lecturer lecturer) {\n return new LecturerDto(lecturer.getLecturerID(), lecturer.getFirstName(), lecturer.getLastName(), lecturer.getEmail(), lecturer.getType());\n }", "@Mapper(componentModel = \"spring\", uses = {UtilisateurMapper.class, DepotMapper.class})\npublic interface UtilisateurDepotPKMapper extends EntityMapper<UtilisateurDepotPKDTO, UtilisateurDepotPK> {\n\n @Mapping(source = \"utilisateur.id\", target = \"utilisateurId\")\n @Mapping(source = \"depot.id\", target = \"depotId\")\n UtilisateurDepotPKDTO toDto(UtilisateurDepotPK utilisateurDepotPK);\n\n @Mapping(source = \"utilisateurId\", target = \"utilisateur\")\n @Mapping(source = \"depotId\", target = \"depot\")\n UtilisateurDepotPK toEntity(UtilisateurDepotPKDTO utilisateurDepotPKDTO);\n\n default UtilisateurDepotPK fromId(Long id) {\n if (id == null) {\n return null;\n }\n UtilisateurDepotPK utilisateurDepotPK = new UtilisateurDepotPK();\n utilisateurDepotPK.setId(id);\n return utilisateurDepotPK;\n }\n}", "@Mapper(componentModel = \"spring\", uses = {UserMapper.class, CustomerMapper.class})\npublic interface WorkDayMapper extends EntityMapper<WorkDayDTO, WorkDay> {\n\n @Mapping(source = \"user.id\", target = \"userId\")\n @Mapping(source = \"user.login\", target = \"userLogin\")\n @Mapping(source = \"customer.id\", target = \"customerId\")\n WorkDayDTO toDto(WorkDay workDay);\n\n @Mapping(source = \"userId\", target = \"user\")\n @Mapping(source = \"customerId\", target = \"customer\")\n WorkDay toEntity(WorkDayDTO workDayDTO);\n\n default WorkDay fromId(Long id) {\n if (id == null) {\n return null;\n }\n WorkDay workDay = new WorkDay();\n workDay.setId(id);\n return workDay;\n }\n}", "private static TableMapper buildTableMapper(Class<?> dtoClass) {\r\n\r\n\t\tMap<String, FieldMapper> fieldMapperCache = null;\r\n\t\tField[] fields = dtoClass.getDeclaredFields();\r\n\r\n\t\tFieldMapper fieldMapper = null;\r\n\t\tTableMapper tableMapper = null;\r\n\t\ttableMapper = tableMapperCache.get(dtoClass);\r\n\t\tif (tableMapper != null) {\r\n\t\t\treturn tableMapper;\r\n\t\t}\r\n\t\ttableMapper = new TableMapper();\r\n\t\ttableMapper.setClazz(dtoClass);\r\n\t\tList<FieldMapper> uniqueKeyList = new LinkedList<FieldMapper>();\r\n\t\tList<FieldMapper> opVersionLockList = new LinkedList<FieldMapper>();\r\n\t\tAnnotation[] classAnnotations = dtoClass.getDeclaredAnnotations();\r\n\t\tfor (Annotation an : classAnnotations) {\r\n\t\t\tif (an instanceof TableMapperAnnotation) {\r\n\t\t\t\ttableMapper.setTableMapperAnnotation((TableMapperAnnotation) an);\r\n\t\t\t} else if (an instanceof Table) {\r\n\t\t\t\ttableMapper.setTable((Table) an);\r\n\t\t\t}\r\n\t\t}\r\n\t\tfieldMapperCache = new WeakHashMap<String, FieldMapper>(16);\r\n\t\tfor (Field field : fields) {\r\n\t\t\tfieldMapper = new FieldMapper();\r\n\t\t\tboolean b = fieldMapper.buildMapper(field);\r\n\t\t\tif (!b) {\r\n\t\t\t\tcontinue;\r\n\t\t\t}\r\n\t\t\tswitch (fieldMapper.getOpLockType()) {\r\n\t\t\tcase Version:\r\n\t\t\t\tfieldMapper.setOpVersionLock(true);\r\n\t\t\t\tbreak;\r\n\t\t\tdefault:\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t\tif (fieldMapper.isUniqueKey()) {\r\n\t\t\t\tuniqueKeyList.add(fieldMapper);\r\n\t\t\t}\r\n\r\n\t\t\tif (fieldMapper.getIgnoreTag().length > 0) {\r\n\t\t\t\tfor (String t : fieldMapper.getIgnoreTag()) {\r\n\t\t\t\t\tfieldMapper.getIgnoreTagSet().add(t);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\tif (!\"\".equals(fieldMapper.getDbAssociationUniqueKey())) {\r\n\t\t\t\tfieldMapper.setForeignKey(true);\r\n\t\t\t}\r\n\r\n\t\t\tif (fieldMapper.isForeignKey()) {\r\n\t\t\t\tif (!tableMapperCache.containsKey(field.getType())) {\r\n\t\t\t\t\tbuildTableMapper(field.getType());\r\n\t\t\t\t}\r\n\t\t\t\tTableMapper tm = tableMapperCache.get(field.getType());\r\n\t\t\t\tString foreignFieldName = getFieldMapperByDbFieldName(tm.getFieldMapperCache(),\r\n\t\t\t\t\t\tfieldMapper.getDbAssociationUniqueKey()).getFieldName();\r\n\t\t\t\tfieldMapper.setForeignFieldName(foreignFieldName);\r\n\t\t\t}\r\n\r\n\t\t\tif (!\"\".equals(fieldMapper.getDbCrossedAssociationUniqueKey())) {\r\n\t\t\t\tfieldMapper.setCrossDbForeignKey(true);\r\n\t\t\t}\r\n\r\n\t\t\tif (fieldMapper.isCrossDbForeignKey()) {\r\n\t\t\t\tif (!tableMapperCache.containsKey(field.getType())) {\r\n\t\t\t\t\tbuildTableMapper(field.getType());\r\n\t\t\t\t}\r\n\t\t\t\tTableMapper tm = tableMapperCache.get(field.getType());\r\n\t\t\t\tString foreignFieldName = getFieldMapperByDbFieldName(tm.getFieldMapperCache(),\r\n\t\t\t\t\t\tfieldMapper.getDbCrossedAssociationUniqueKey()).getFieldName();\r\n\t\t\t\tfieldMapper.setForeignFieldName(foreignFieldName);\r\n\t\t\t}\r\n\r\n\t\t\tif (fieldMapper.isOpVersionLock()) {\r\n\t\t\t\topVersionLockList.add(fieldMapper);\r\n\t\t\t}\r\n\t\t\tfieldMapperCache.put(fieldMapper.getDbFieldName(), fieldMapper);\r\n\t\t}\r\n\t\ttableMapper.setFieldMapperCache(fieldMapperCache);\r\n\t\ttableMapper.setUniqueKeyNames(uniqueKeyList.toArray(new FieldMapper[uniqueKeyList.size()]));\r\n\t\ttableMapper.setOpVersionLocks(opVersionLockList.toArray(new FieldMapper[opVersionLockList.size()]));\r\n\t\ttableMapper.buildTableName();\r\n\t\ttableMapperCache.put(dtoClass, tableMapper);\r\n\t\treturn tableMapper;\r\n\t}", "@Mapper(componentModel = \"spring\", uses = {})\npublic interface StockOutFrozenTubeMapper {\n\n @Mapping(source = \"stockOutFrozenBox.id\", target = \"stockOutFrozenBoxId\")\n @Mapping(source = \"frozenTube.id\", target = \"frozenTubeId\")\n StockOutFrozenTubeDTO stockOutFrozenTubeToStockOutFrozenTubeDTO(StockOutFrozenTube stockOutFrozenTube);\n\n List<StockOutFrozenTubeDTO> stockOutFrozenTubesToStockOutFrozenTubeDTOs(List<StockOutFrozenTube> stockOutFrozenTubes);\n\n @Mapping(source = \"stockOutFrozenBoxId\", target = \"stockOutFrozenBox\")\n @Mapping(source = \"frozenTubeId\", target = \"frozenTube\")\n StockOutFrozenTube stockOutFrozenTubeDTOToStockOutFrozenTube(StockOutFrozenTubeDTO stockOutFrozenTubeDTO);\n\n List<StockOutFrozenTube> stockOutFrozenTubeDTOsToStockOutFrozenTubes(List<StockOutFrozenTubeDTO> stockOutFrozenTubeDTOs);\n\n default StockOutFrozenBox stockOutFrozenBoxFromId(Long id) {\n if (id == null) {\n return null;\n }\n StockOutFrozenBox stockOutFrozenBox = new StockOutFrozenBox();\n stockOutFrozenBox.setId(id);\n return stockOutFrozenBox;\n }\n\n default FrozenTube frozenTubeFromId(Long id) {\n if (id == null) {\n return null;\n }\n FrozenTube frozenTube = new FrozenTube();\n frozenTube.setId(id);\n return frozenTube;\n }\n}", "@Mapper(componentModel = \"spring\", uses = {})\npublic interface OTHERMapper extends EntityMapper<OTHERDTO, OTHER> {\n\n\n\n default OTHER fromId(Long id) {\n if (id == null) {\n return null;\n }\n OTHER oTHER = new OTHER();\n oTHER.setId(id);\n return oTHER;\n }\n}", "@Mapper(componentModel = \"spring\", uses = {})\npublic interface ChildMapper extends EntityMapper<ChildDTO, Child> {\n\n @Mapping(target = \"timeTables\", ignore = true)\n Child toEntity(ChildDTO childDTO);\n\n default Child fromId(Long id) {\n if (id == null) {\n return null;\n }\n Child child = new Child();\n child.setId(id);\n return child;\n }\n}", "public interface TeamService {\n\n /**\n * Save a team.\n *\n * @param teamDTO the entity to save\n * @return the persisted entity\n */\n TeamDTO save(TeamDTO teamDTO);\n\n /**\n * Get all the teams.\n *\n * @param pageable the pagination information\n * @return the list of entities\n */\n Page<TeamDTO> findAll(Pageable pageable);\n\n /**\n * Get the \"id\" team.\n *\n * @param id the id of the entity\n * @return the entity\n */\n TeamDTO findOne(Long id);\n\n /**\n * Delete the \"id\" team.\n *\n * @param id the id of the entity\n */\n void delete(Long id);\n\n\tPage<TeamDTO> findByTeamHeadUserLoginIsCurrentUser(Pageable pageable);\n\tPage<TeamDTO> findByActiveAndTeamHeadUserLogin(boolean isActive, String teamHeadLogin, Pageable pageable);\n\tPage<TeamDTO> findByActiveAndIdNotInAndTeamHeadUserLoginNot(boolean isActive, String teamHeadLogin, Pageable pageable);\n\tPage<TeamDTO> findByActiveAndIdInAndTeamHeadUserLoginNot(boolean isActive, String teamHeadLogin, Pageable pageable);\n\tPage<TeamDTO> findByActiveAndIdNotInAndTeamHeadUserLogin(boolean isActive, String teamHeadLogin, Pageable pageable);\n\tPage<TeamDTO> findByActiveAndIdNotIn(boolean isActive, String userLogin, Pageable pageable);\n\tPage<TeamDTO> findByActive(boolean isActive, Pageable pageable);\n\tPage<TeamDTO> findByActiveAndIdInAndTeamHeadUserLogin(boolean isActive, String userLogin, String teamHeadUserLogin, Pageable pageable);\n}", "TeamResultWrapper findAllTeams(String personId, int offset,\n int pageSize);", "@Mapper(componentModel = \"spring\", uses = {SysRoleMapper.class, SysMenuMapper.class, })\npublic interface SysRoleMenuMapper extends EntityMapper <SysRoleMenuDTO, SysRoleMenu> {\n\n @Mapping(source = \"sysRole.id\", target = \"sysRoleId\")\n\n @Mapping(source = \"sysMenu.id\", target = \"sysMenuId\")\n SysRoleMenuDTO toDto(SysRoleMenu sysRoleMenu);\n\n @Mapping(source = \"sysRoleId\", target = \"sysRole\")\n\n @Mapping(source = \"sysMenuId\", target = \"sysMenu\")\n SysRoleMenu toEntity(SysRoleMenuDTO sysRoleMenuDTO); \n default SysRoleMenu fromId(Long id) {\n if (id == null) {\n return null;\n }\n SysRoleMenu sysRoleMenu = new SysRoleMenu();\n sysRoleMenu.setId(id);\n return sysRoleMenu;\n }\n}", "@Mapper(componentModel = \"spring\", uses = {AanvraagberichtMapper.class})\npublic interface FdnAanvragerMapper extends EntityMapper<FdnAanvragerDTO, FdnAanvrager> {\n\n @Mapping(source = \"aanvraagbericht.id\", target = \"aanvraagberichtId\")\n FdnAanvragerDTO toDto(FdnAanvrager fdnAanvrager);\n\n @Mapping(target = \"adres\", ignore = true)\n @Mapping(target = \"legitimatiebewijs\", ignore = true)\n @Mapping(target = \"werksituaties\", ignore = true)\n @Mapping(target = \"gezinssituaties\", ignore = true)\n @Mapping(target = \"financieleSituaties\", ignore = true)\n @Mapping(source = \"aanvraagberichtId\", target = \"aanvraagbericht\")\n FdnAanvrager toEntity(FdnAanvragerDTO fdnAanvragerDTO);\n\n default FdnAanvrager fromId(Long id) {\n if (id == null) {\n return null;\n }\n FdnAanvrager fdnAanvrager = new FdnAanvrager();\n fdnAanvrager.setId(id);\n return fdnAanvrager;\n }\n}", "public Team update(TeamDTO teamForm) throws TeamNotFoundException;", "@Mapper(componentModel = \"spring\", uses = {})\npublic interface EmploymentTypeMapper extends EntityMapper<EmploymentTypeDTO, EmploymentType> {\n\n\n @Mapping(target = \"people\", ignore = true)\n EmploymentType toEntity(EmploymentTypeDTO employmentTypeDTO);\n\n default EmploymentType fromId(Long id) {\n if (id == null) {\n return null;\n }\n EmploymentType employmentType = new EmploymentType();\n employmentType.setId(id);\n return employmentType;\n }\n}", "@Mapper(componentModel = \"spring\", uses = {SabegheMapper.class, NoeSabegheMapper.class})\npublic interface AdamKhesaratMapper extends EntityMapper<AdamKhesaratDTO, AdamKhesarat> {\n\n @Mapping(source = \"sabeghe.id\", target = \"sabegheId\")\n @Mapping(source = \"sabeghe.name\", target = \"sabegheName\")\n @Mapping(source = \"noeSabeghe.id\", target = \"noeSabegheId\")\n @Mapping(source = \"noeSabeghe.name\", target = \"noeSabegheName\")\n AdamKhesaratDTO toDto(AdamKhesarat adamKhesarat);\n\n @Mapping(source = \"sabegheId\", target = \"sabeghe\")\n @Mapping(source = \"noeSabegheId\", target = \"noeSabeghe\")\n AdamKhesarat toEntity(AdamKhesaratDTO adamKhesaratDTO);\n\n default AdamKhesarat fromId(Long id) {\n if (id == null) {\n return null;\n }\n AdamKhesarat adamKhesarat = new AdamKhesarat();\n adamKhesarat.setId(id);\n return adamKhesarat;\n }\n}", "public TwoplayertournamentDTO getTwoplayertournamentDTO() {\r\n\t\treturn twoplayertournamentDTO;\r\n\t}", "@Mapper(componentModel = \"spring\", uses = {})\npublic interface TipoTelaMapper {\n\n @Mapping(source = \"direccionamientoTela.id\", target = \"direccionamientoTelaId\")\n @Mapping(source = \"direccionamientoTela.nombre\", target = \"direccionamientoTelaNombre\")\n TipoTelaDTO tipoTelaToTipoTelaDTO(TipoTela tipoTela);\n\n @Mapping(source = \"direccionamientoTelaId\", target = \"direccionamientoTela\")\n @Mapping(target = \"telaCrudas\", ignore = true)\n TipoTela tipoTelaDTOToTipoTela(TipoTelaDTO tipoTelaDTO);\n\n default DireccionamientoTela direccionamientoTelaFromId(Long id) {\n if (id == null) {\n return null;\n }\n DireccionamientoTela direccionamientoTela = new DireccionamientoTela();\n direccionamientoTela.setId(id);\n return direccionamientoTela;\n }\n}", "@Mapper\npublic interface SeguridadDtoMap {\n SeguridadDtoMap INSTANCE = Mappers.getMapper( SeguridadDtoMap.class );\n\n GrupoDto grupoToGrupoDto(Grupo grupo);\n\n Grupo grupoDtoToGrupo(GrupoDto grupoDto);\n}", "public Team create(TeamDTO teamForm);", "@Mapper\npublic interface ShippmentDtoBoMapper {\n\n\tpublic ShippmentDto mapBoToDto(ShippmentBo shippmentBo);\n\n\n\n\tpublic ShippmentBo mapDtoToBo(ShippmentDto shippmentDto);\n}", "TeamResultWrapper findAllTeamsByMember(String personId, int offset,\n int pageSize);", "public Team get(Long id);", "Team findById(Long id);", "@Mapper(componentModel = \"spring\", uses = {CompanyMapper.class})\npublic interface VehicleMapper extends EntityMapper<VehicleDTO, Vehicle> {\n\n @Mapping(source = \"company.id\", target = \"companyId\")\n VehicleDTO toDto(Vehicle vehicle);\n\n @Mapping(target = \"vehicleDocuments\", ignore = true)\n @Mapping(target = \"vehicleStaffs\", ignore = true)\n @Mapping(source = \"companyId\", target = \"company\")\n Vehicle toEntity(VehicleDTO vehicleDTO);\n\n default Vehicle fromId(Long id) {\n if (id == null) {\n return null;\n }\n Vehicle vehicle = new Vehicle();\n vehicle.setId(id);\n return vehicle;\n }\n}", "@Mapper\npublic interface ProjectMapper extends EntityMapper<ProjectDTO, Project> {\n\n // All methods are parameterized for EntityMapper\n\n}", "public interface EntryLeagueInfoMapper extends MyBaseMapper<EntryLeagueInfoEntity> {\n\n}", "@Mapper(componentModel = \"spring\", uses = {UsuarioMapper.class, FileMapper.class})\npublic interface RateMapper extends EntityMapper<RateDTO, Rate> {\n\n @Mapping(source = \"usuario.id\", target = \"usuarioId\")\n @Mapping(source = \"file.id\", target = \"fileId\")\n RateDTO toDto(Rate rate); \n\n @Mapping(source = \"usuarioId\", target = \"usuario\")\n @Mapping(source = \"fileId\", target = \"file\")\n Rate toEntity(RateDTO rateDTO);\n\n default Rate fromId(Long id) {\n if (id == null) {\n return null;\n }\n Rate rate = new Rate();\n rate.setId(id);\n return rate;\n }\n}", "public List<Team> getAllTeams() { \r\n\t\t\tif(teams==null)\t{\r\n\t\t\t\tteams=dao.listTeams(); //LIST\t\t\t\r\n\t\t\tfor(Team atemp:teams){\t\t\tthis.mapTeam.put(atemp.getTeam(), atemp);\t\t}\r\n\t\t\t\t}\r\n\t\t\treturn teams;\r\n\t\t}", "@Mapper(componentModel = \"spring\", uses = {ClientMapper.class, UserAppMapper.class, DistrictMapper.class})\npublic interface CampusMapper extends EntityMapper<CampusDTO, Campus> {\n\n @Mapping(source = \"client\", target = \"clientDto\")\n @Mapping(source = \"district\", target = \"districtDto\")\n CampusDTO toDto(Campus campus);\n\n @Mapping(source = \"clientDto\", target = \"client\")\n @Mapping(source = \"districtDto\", target = \"district\")\n @Mapping(target = \"fields\", ignore = true)\n Campus toEntity(CampusDTO campusDTO);\n\n default Campus fromId(Long id) {\n if (id == null) {\n return null;\n }\n Campus campus = new Campus();\n campus.setId(id);\n return campus;\n }\n}", "@Mapper(componentModel = \"spring\", uses = {RoomExpenseSplitMapper.class})\npublic interface RoomExpenseSplitRecordMapper extends EntityMapper<RoomExpenseSplitRecordDTO, RoomExpenseSplitRecord> {\n\n @Mapping(source = \"split.id\", target = \"splitId\")\n RoomExpenseSplitRecordDTO toDto(RoomExpenseSplitRecord roomExpenseSplitRecord);\n\n @Mapping(source = \"splitId\", target = \"split\")\n RoomExpenseSplitRecord toEntity(RoomExpenseSplitRecordDTO roomExpenseSplitRecordDTO);\n\n default RoomExpenseSplitRecord fromId(Long id) {\n if (id == null) {\n return null;\n }\n RoomExpenseSplitRecord roomExpenseSplitRecord = new RoomExpenseSplitRecord();\n roomExpenseSplitRecord.setId(id);\n return roomExpenseSplitRecord;\n }\n}", "@Mapper(componentModel = \"spring\", uses = {TravauxMapper.class, ChantierMapper.class, EmployeMapper.class})\npublic interface AffectationMapper extends EntityMapper<AffectationDTO, Affectation> {\n\n @Mapping(source = \"travaux.id\", target = \"travauxId\")\n @Mapping(source = \"travaux.nomTrav\", target = \"travauxNomTrav\")\n @Mapping(source = \"chantier.id\", target = \"chantierId\")\n @Mapping(source = \"chantier.nomChantier\", target = \"chantierNomChantier\")\n AffectationDTO toDto(Affectation affectation);\n\n @Mapping(source = \"travauxId\", target = \"travaux\")\n @Mapping(source = \"chantierId\", target = \"chantier\")\n Affectation toEntity(AffectationDTO affectationDTO);\n\n default Affectation fromId(Long id) {\n if (id == null) {\n return null;\n }\n Affectation affectation = new Affectation();\n affectation.setId(id);\n return affectation;\n }\n}", "@Test\n\tpublic void testPersonToPersonDtoMap() {\n\t\t\n\t\t// prepare \n\t\tPerson person = this.getFakePersonToMap();\n\t\tAddress address = person.getAddress();\n\t\tContactDetail contactDetail = person.getContactDetail();\n\t\t\n\t\t// sut (system / class under test)\n\t\tMapper testee = new Mapper();\n\t\t\n\t\t// act\t\t\n\t\tPersonDto personDto = testee.map(person, PersonDto.class);\n\t\t\n\t\t// tests\n\t\t// address\n\t\tassertEquals(personDto.getAddressCity(), address.getCity());\n\t\tassertEquals(personDto.getAddressCountry(), address.getCountry());\n\t\t\n\t\t// contact details\n\t\tassertEquals(personDto.getPhoneNumber1(), contactDetail.getPhoneNumber1());\n\t\tassertEquals(personDto.getPhoneNumber2(), contactDetail.getPhoneNumber2());\n\t\tassertEquals(personDto.getPhoneNumber3(), contactDetail.getPhoneNumber3());\n\t\tassertEquals(personDto.getFax(), contactDetail.getFax());\n\t\t\n\t}", "@Mapper(componentModel = \"spring\", uses = {UserMapper.class, LanguageMapper.class })\npublic interface ProjectMapper {\n\n @Mapping(source = \"owner.id\", target = \"ownerId\")\n @Mapping(source = \"owner.login\", target = \"ownerName\")\n ProjectDTO projectToProjectDTO(Project project);\n\n List<ProjectDTO> projectsToProjectDTOs(List<Project> projects);\n\n @Mapping(target = \"releases\", ignore = true)\n @Mapping(source = \"ownerId\", target = \"owner\")\n Project projectDTOToProject(ProjectDTO projectDTO);\n\n List<Project> projectDTOsToProjects(List<ProjectDTO> projectDTOs);\n\n default Language languageFromId(Long id) {\n if (id == null) {\n return null;\n }\n Language language = new Language();\n language.setId(id);\n return language;\n }\n}", "@Mapper(componentModel = \"spring\", uses = {HopDongMapper.class})\npublic interface GhiNoMapper extends EntityMapper<GhiNoDTO, GhiNo> {\n\n @Mapping(source = \"hopDong.id\", target = \"hopDongId\")\n GhiNoDTO toDto(GhiNo ghiNo);\n\n @Mapping(source = \"hopDongId\", target = \"hopDong\")\n GhiNo toEntity(GhiNoDTO ghiNoDTO);\n\n default GhiNo fromId(Long id) {\n if (id == null) {\n return null;\n }\n GhiNo ghiNo = new GhiNo();\n ghiNo.setId(id);\n return ghiNo;\n }\n}", "public Team getTeam() {\n return team;\n }", "public ArVideoDto arVideoEntityToDto (ArVideoEntity arvideoEntity) {\n\t\tArVideoDto arvideoDto = mapper.map(arvideoEntity, ArVideoDto.class);\n\t\treturn arvideoDto;\n\t}", "public RaceDTO mapTo(Race race) {\n\t\tRaceDTO dto = new RaceDTO();\n\t\tdto.setId(race.getId());\n\t\tdto.setName(race.getName());\n\t\tdto.setDate(race.getDate());\n\t\tdto.setTime(race.getTime());\n\t\tList<DriverDTO> drivers = new ArrayList<>();\n\t\t\n\t\tfor(Driver driver : race.getDrivers()) {\n\t\t\tdrivers.add(this.driverMapper.mapTo(driver));\n\t\t}\n\t\tdto.setDrivers(drivers);\n\t\treturn dto;\n\t\t\n\t}", "@Mapper(componentModel = \"spring\", uses = {})\npublic interface TxnActivityAuditMapper {\n\n @Mapping(source = \"editedBy.id\", target = \"editedById\")\n TxnActivityAuditDTO txnActivityAuditToTxnActivityAuditDTO(TxnActivityAudit txnActivityAudit);\n\n @Mapping(source = \"editedById\", target = \"editedBy\")\n TxnActivityAudit txnActivityAuditDTOToTxnActivityAudit(TxnActivityAuditDTO txnActivityAuditDTO);\n\n default Staff staffFromId(Long id) {\n if (id == null) {\n return null;\n }\n Staff staff = new Staff();\n staff.setId(id);\n return staff;\n }\n}", "public List<Team> getListOfTeams(){\n \tMap<String, Object> myMap = new HashMap<String, Object>();\n\t\tJSONObject jsonobj = null;\n\t\tList<Team> team = new ArrayList<>();\n\t\tTeamsJsonReader reader = new TeamsJsonReader();\n\t\tJSONParser parser = new JSONParser();\n\t\tObject obj = null;\n\n\t\ttry {\n\t\t\tobj = parser.parse(new FileReader(\"src/main/resources/db.json\"));\n\t\t\tJSONObject jsonObject = (JSONObject) obj;\n\t\t\tJSONArray jsonarr = (JSONArray) jsonObject.get(\"teams\");\n\t\t\tfor (int size = 0; size < jsonarr.size(); size++) {\n\t\t\t\tList<Individual> individualList = new ArrayList<>();\n\t\t\t\tjsonobj = (JSONObject) jsonarr.get(size);\n\t\t\t\tmyMap.put(\"name\", jsonobj.get(\"name\"));\n\t\t\t\tmyMap.put(\"id\", ((Long) jsonobj.get(\"id\")).intValue());\n\t\t\t\tJSONArray memberArray = (JSONArray) jsonobj.get(\"members\");\n\n\t\t\t\tfor (int index = 0; index < memberArray.size(); index++) {\n\n\t\t\t\t\tindividualList.add(reader.getIndividualById(((Long) memberArray.get(index)).intValue()));\n\n\t\t\t\t}\n\t\t\t\tmyMap.put(\"members\", individualList);\n\t\t\t\t\n\t\t\t\tteam.add(new Team(myMap));\n\t\t\t}\n\n\t\t} catch (Exception e) {\n\t\t\te.printStackTrace();\n\t\t}\n\n\t\treturn team;\n }", "@Mapper(componentModel = \"spring\", uses = {OperationMapper.class, PecStatusChangeMatrixMapper.class, StatusPecMapper.class,})\npublic interface RaisonPecMapper extends EntityMapper <RaisonPecDTO, RaisonPec> {\n\n @Mapping(source = \"operation.id\", target = \"operationId\")\n @Mapping(source = \"operation.label\", target = \"operationLabel\")\n @Mapping(source = \"statusPec.id\", target = \"statusPecId\")\n @Mapping(source = \"statusPec.label\", target = \"statusPecLabel\")\n\n \n @Mapping(source = \"pecStatusChangeMatrix.id\", target = \"pecStatusChangeMatrixId\")\n @Mapping(source = \"pecStatusChangeMatrix.label\", target = \"pecStatusChangeMatrixLabel\")\n \n RaisonPecDTO toDto(RaisonPec raisonPec); \n\n @Mapping(source = \"operationId\", target = \"operation\")\n\n\n\n @Mapping(source = \"statusPecId\", target = \"statusPec\")\n\n \n @Mapping(source = \"pecStatusChangeMatrixId\", target = \"pecStatusChangeMatrix\")\n\n RaisonPec toEntity(RaisonPecDTO raisonPecDTO); \n default RaisonPec fromId(Long id) {\n if (id == null) {\n return null;\n }\n RaisonPec raisonPec = new RaisonPec();\n raisonPec.setId(id);\n return raisonPec;\n }\n}", "@Mapper(componentModel = \"spring\", uses = {AppMenuMapper.class, AppGroupMapper.class})\npublic interface AppAppsMapper extends EntityMapper<AppAppsDTO, AppApps> {\n\n @Mapping(source = \"menu.id\", target = \"menuId\")\n @Mapping(source = \"group.id\", target = \"groupId\")\n AppAppsDTO toDto(AppApps appApps); \n\n @Mapping(source = \"menuId\", target = \"menu\")\n @Mapping(source = \"groupId\", target = \"group\")\n AppApps toEntity(AppAppsDTO appAppsDTO);\n\n default AppApps fromId(Long id) {\n if (id == null) {\n return null;\n }\n AppApps appApps = new AppApps();\n appApps.setId(id);\n return appApps;\n }\n}", "public int getTeamId() {\n return teamId;\n }", "@Mapper(componentModel = \"spring\", uses = {})\npublic interface Owner3Mapper extends EntityMapper <Owner3DTO, Owner3> {\n \n @Mapping(target = \"car3S\", ignore = true)\n Owner3 toEntity(Owner3DTO owner3DTO); \n default Owner3 fromId(Long id) {\n if (id == null) {\n return null;\n }\n Owner3 owner3 = new Owner3();\n owner3.setId(id);\n return owner3;\n }\n}", "@Override\n public Team getTeamById(int id){\n try {\n String sql = \"SELECT * FROM Team WHERE Team.teamid = ?\";\n Team team = jdbc.queryForObject(sql, new TeamMapper(), id);\n team.setUser(getUserFromTeam(team));\n return team;\n }catch(DataAccessException ex){\n return null;\n }\n }", "@Mapper(componentModel = \"spring\", uses = {TipoDocumentoMapper.class, GeneroMapper.class, AseguradoraMapper.class, GrupoEtnicoMapper.class, RegimenMapper.class, MunicipioMapper.class, TipoResidenciaMapper.class})\npublic interface PacienteMapper extends EntityMapper<PacienteDTO, Paciente> {\n\n @Mapping(source = \"tipoDocumento.id\", target = \"tipoDocumentoId\")\n @Mapping(source = \"tipoDocumento.nombre\", target = \"tipoDocumentoNombre\")\n @Mapping(source = \"genero.id\", target = \"generoId\")\n @Mapping(source = \"genero.nombre\", target = \"generoNombre\")\n @Mapping(source = \"aseguradora.id\", target = \"aseguradoraId\")\n @Mapping(source = \"aseguradora.nombre\", target = \"aseguradoraNombre\")\n @Mapping(source = \"grupoEtnico.id\", target = \"grupoEtnicoId\")\n @Mapping(source = \"grupoEtnico.nombre\", target = \"grupoEtnicoNombre\")\n @Mapping(source = \"regimen.id\", target = \"regimenId\")\n @Mapping(source = \"regimen.nombre\", target = \"regimenNombre\")\n @Mapping(source = \"municipio.id\", target = \"municipioId\")\n @Mapping(source = \"municipio.nombre\", target = \"municipioNombre\")\n @Mapping(source = \"tipoResidencia.id\", target = \"tipoResidenciaId\")\n @Mapping(source = \"tipoResidencia.nombre\", target = \"tipoResidenciaNombre\")\n PacienteDTO toDto(Paciente paciente);\n\n @Mapping(target = \"aplicacions\", ignore = true)\n @Mapping(target = \"acudientes\", ignore = true)\n @Mapping(source = \"tipoDocumentoId\", target = \"tipoDocumento\")\n @Mapping(source = \"generoId\", target = \"genero\")\n @Mapping(source = \"aseguradoraId\", target = \"aseguradora\")\n @Mapping(source = \"grupoEtnicoId\", target = \"grupoEtnico\")\n @Mapping(source = \"regimenId\", target = \"regimen\")\n @Mapping(source = \"municipioId\", target = \"municipio\")\n @Mapping(source = \"tipoResidenciaId\", target = \"tipoResidencia\")\n Paciente toEntity(PacienteDTO pacienteDTO);\n\n default Paciente fromId(Long id) {\n if (id == null) {\n return null;\n }\n Paciente paciente = new Paciente();\n paciente.setId(id);\n return paciente;\n }\n}", "public void setTwoplayertournamentDTO(\r\n\t\t\tTwoplayertournamentDTO twoplayertournamentDTO) {\r\n\t\tthis.twoplayertournamentDTO = twoplayertournamentDTO;\r\n\t}", "@Override\r\n\tpublic AbstractDto mapToDto() {\n\t\treturn null;\r\n\t}", "@Mapper(componentModel = \"spring\", uses = {CategorieFilmMapper.class})\npublic interface FilmMapper extends EntityMapper<FilmDTO, Film> {\n\n @Mapping(source = \"categorie.id\", target = \"categorieId\")\n FilmDTO toDto(Film film);\n\n @Mapping(source = \"categorieId\", target = \"categorie\")\n Film toEntity(FilmDTO filmDTO);\n\n default Film fromId(Long id) {\n if (id == null) {\n return null;\n }\n Film film = new Film();\n film.setId(id);\n return film;\n }\n}", "@Mapper(componentModel = \"spring\", uses = {})\npublic interface WwtreatmentthreeMapper {\n\n WwtreatmentthreeDTO wwtreatmentthreeToWwtreatmentthreeDTO(Wwtreatmentthree wwtreatmentthree);\n\n List<WwtreatmentthreeDTO> wwtreatmentthreesToWwtreatmentthreeDTOs(List<Wwtreatmentthree> wwtreatmentthrees);\n\n Wwtreatmentthree wwtreatmentthreeDTOToWwtreatmentthree(WwtreatmentthreeDTO wwtreatmentthreeDTO);\n\n List<Wwtreatmentthree> wwtreatmentthreeDTOsToWwtreatmentthrees(List<WwtreatmentthreeDTO> wwtreatmentthreeDTOs);\n}", "@Mapper(componentModel = \"spring\", uses = {})\npublic interface OrganisationTypeMapper extends EntityMapper<OrganisationTypeDTO, OrganisationType> {\n\n\n @Mapping(target = \"organisations\", ignore = true)\n OrganisationType toEntity(OrganisationTypeDTO organisationTypeDTO);\n\n default OrganisationType fromId(Long id) {\n if (id == null) {\n return null;\n }\n OrganisationType organisationType = new OrganisationType();\n organisationType.setId(id);\n return organisationType;\n }\n}", "V toDto(E entity);", "@Mapper(componentModel = \"spring\", uses = {PlaqueMapper.class})\npublic interface PlaqueRuleMapper extends EntityMapper<PlaqueRuleDTO, PlaqueRule> {\n\n @Mapping(source = \"plaque.id\", target = \"plaqueId\")\n @Mapping(source = \"plaque.title\", target = \"plaqueTitle\")\n PlaqueRuleDTO toDto(PlaqueRule plaqueRule);\n\n @Mapping(source = \"plaqueId\", target = \"plaque\")\n PlaqueRule toEntity(PlaqueRuleDTO plaqueRuleDTO);\n\n default PlaqueRule fromId(Long id) {\n if (id == null) {\n return null;\n }\n PlaqueRule plaqueRule = new PlaqueRule();\n plaqueRule.setId(id);\n return plaqueRule;\n }\n}", "@Mapper(componentModel = \"spring\", uses = {ExchangeMapper.class, MarketMapper.class, UserMapper.class})\npublic interface OrdersMapper extends EntityMapper<OrdersDTO, Orders> {\n\n @Mapping(source = \"market.id\", target = \"marketId\")\n @Mapping(source = \"user.id\", target = \"userId\")\n OrdersDTO toDto(Orders orders);\n\n @Mapping(target = \"source\", ignore = true)\n @Mapping(source = \"marketId\", target = \"market\")\n @Mapping(source = \"userId\", target = \"user\")\n Orders toEntity(OrdersDTO ordersDTO);\n\n default Orders fromId(Long id) {\n if (id == null) {\n return null;\n }\n Orders orders = new Orders();\n orders.setId(id);\n return orders;\n }\n}", "private static Team getTeam(Connection con,Long teamId) {\n\n Team team = null;\n\n String query = SQLConstants.GET_TEAM_BY_TEAM_ID;\n\n try {\n team = new Team();\n //Connection con = JdbcConnection.getConnection();\n PreparedStatement pstmt = con.prepareStatement(query);\n pstmt.setLong(1, teamId);\n\n ResultSet rs = pstmt.executeQuery();\n\n while (rs.next()) {\n team.setId(rs.getLong(\"id\"));\n team.setName(rs.getString(\"name\"));\n team.setDescribe(rs.getString(\"describe\"));\n }\n\n } catch (Exception e) {\n e.printStackTrace();\n }\n\n return team;\n\n }", "private Lecturer map(LecturerDto dto) {\n return Lecturer.builder().firstName(dto.getFirstName()).createdAt(Instant.now())\n .lastName(dto.getLastName()).email(dto.getEmail()).type(dto.getType().toLowerCase()).build();\n }", "@PostMapping(path=\"/add/{id}/team\")\n public @ResponseBody Object assignTeamMember(@PathVariable long id, @RequestParam Team team){\n TeamMember tm = teamMemberRepository.getOne(id);\n tm.setTeam(team); // Retrieving the list of team members and adding new team member\n return teamMemberRepository.saveAndFlush(tm);\n }", "public interface TeamService {\n\n /**\n * Finds all teams\n *\n * @return A list of teams\n */\n public List<Team> getAll();\n\n /**\n * Finds team by ID\n *\n * @param id The ID of the wanted team\n * @return The found team. If no team is found, this method returns null.\n */\n public Team get(Long id);\n\n /**\n * Creates a new team\n *\n * @param teamForm The information of the created team\n * @return The created team\n */\n public Team create(TeamDTO teamForm);\n\n /**\n * Updates the information of a team\n *\n * @param teamForm The information of the updated team\n * @return The updated team\n * @throws TeamNotFoundException If no team is found with given ID\n */\n public Team update(TeamDTO teamForm) throws TeamNotFoundException;\n\n /**\n * Deletes a team\n *\n * @param id The ID of the deleted team\n * @throws TeamNotFoundException If no team is found with the given ID\n */\n public void delete(Long id) throws TeamNotFoundException;\n\n}", "@Mapper(componentModel = \"spring\")\npublic interface PedidoMapper {\n\t\n\t@AfterMapping\n\tdefault void afterMapping(@MappingTarget PedidoDTO target, Pedido source) {\n\t\t\n\t\tFloat totalIVA = new Float(0);\n\t\tFloat totalDomicilio = new Float(0);\n\t\tFloat totalNeto = new Float(0);\n\t\t\n\t\tif(source.getEstado().equals(Constantes.ESTADO_PEDIDO_ACTIVO))\n\t\t{\n\t\t\ttarget.setEstadoString(Constantes.ESTADO_PEIDIDO_ACTIVO_STRING);\n\t\t\ttotalIVA = new Float(target.getSubtotal() * 0.19);\n\t\t\ttotalDomicilio = target.getSubtotal() >= Constantes.VALOR_MINIMO_PARA_COBRO_DE_DOMICILIO && target.getSubtotal() <= Constantes.VALOR_MAXIMO_PARA_COBRO_DE_DOMICILIO ? new Float(target.getSubtotal() * 0.05) : new Float(0);\n\t\t\ttotalNeto = target.getSubtotal() + totalIVA + totalDomicilio;\n\t\t}\n\t\telse if (source.getEstado().equals(Constantes.ESTADO_PEDIDO_CANCELADO))\n\t\t{\n\t\t\ttarget.setEstadoString(Constantes.ESTADO_PEDIDO_CANCELADO_STRING);\n\t\t\ttotalNeto = new Float(target.getSubtotal() * 0.10);\n\t\t}\t\t \n\t\t\n\t\t\n\t\ttarget.setTotalIVA(totalIVA);\n\t\ttarget.setTotalDomicilio(totalDomicilio);\n\t\ttarget.setTotalNeto(totalNeto);\n\t}\n\t\n\t@Mapping(source = \"entity.idUsuario.idUsuario\", target = \"idUsuario\")\n\t@Mapping(source = \"entity.idUsuario.nombre\", target = \"nombreUsuario\")\n\t@Mapping(source = \"entity.fechaCreacion\", target = \"fechaCreacion\", dateFormat = Constantes.DATE_AND_TIME_FORMAT_WITH_MINUTES)\n\t@Mapping(source = \"entity.estado\", target = \"estado\")\n\t@Mapping(target = \"idProductosConcatenados\", ignore = true)\n\t@Mapping(target = \"totalIVA\", ignore = true)\n\t@Mapping(target = \"totalDomicilio\", ignore = true)\n\t@Mapping(target = \"totalNeto\", ignore = true)\n\t@Mapping(target = \"codigoRespuesta\", ignore = true)\n\t@Mapping(target = \"mensajeRespuesta\", ignore = true)\n\t@Mapping(target = \"estadoString\", ignore = true)\n\tpublic PedidoDTO transformEntityToDTO(Pedido entity);\n\t\n\t@Mapping(source = \"DTO.idUsuario\", target = \"idUsuario.idUsuario\")\n\t@Mapping(source = \"DTO.fechaCreacion\", target = \"fechaCreacion\", dateFormat = Constantes.DATE_AND_TIME_FORMAT_WITH_MINUTES)\n\t@Mapping(source = \"DTO.estado\", target = \"estado\")\n\tpublic Pedido transformDTOToEntity(PedidoDTO DTO);\n\t\n\tpublic List<PedidoDTO> transformEntitiesToDTO(List<Pedido> listEntities);\n\t\n\tpublic List<Pedido> transformDTOToEntities(List<Pedido> listDTO);\n\n}", "@Bean\n public TypeMap<Carriage, CarriageDto> getCarriageCarriageDtoTypeMap() {\n Converter<List<Driver>, List<DriverDto>> toDriverDtoList = new AbstractConverter<List<Driver>, List<DriverDto>>() {\n protected List<DriverDto> convert(List<Driver> source) {\n if (source == null) {\n return null;\n } else {\n List<DriverDto> driverDtos = new ArrayList<>(source.size());\n for (Driver driver : source) {\n driverDtos.add(getModelMapper().getTypeMap(Driver.class, DriverDto.class, \"DriverDriverDto\").map(driver));\n }\n return driverDtos;\n }\n }\n };\n\n Converter<Vehicle, VehicleDto> toVehicleDto = new AbstractConverter<Vehicle, VehicleDto>() {\n @Override\n protected VehicleDto convert(Vehicle vehicle) {\n if (vehicle == null) {\n return null;\n } else {\n return getModelMapper().getTypeMap(Vehicle.class, VehicleDto.class, \"VehicleVehicleDto\")\n .map(vehicle);\n }\n }\n };\n\n /*\n\n Converter<? super Cargo, CargoDto> toCargoDto = new AbstractConverter<Cargo, CargoDto>() {\n @Override\n protected CargoDto convert(Cargo cargo) {\n if (cargo == null) {\n return null;\n } else {\n return getModelMapper().getTypeMap(Cargo.class, CargoDto.class, \"CargoCargoDto\")\n .map(cargo);\n }\n }\n };*/\n\n return getModelMapper().createTypeMap(Carriage.class, CarriageDto.class, \"CarriageCarriageDto\")\n .addMappings(mapper -> mapper.skip(CarriageDto::setMaxWeight))\n\n// .addMappings(mapper -> mapper.using(toCargoDto).map(Carriage::getCargoes, CarriageDto::setCargoes))\n// .addMappings(mapper -> mapper.using(toWaypointDto).map(Carriage::getWaypoints, CarriageDto::setWaypoints))\n .addMappings(mapper -> mapper.using(toVehicleDto).map(Carriage::getVehicle, CarriageDto::setVehicle))\n .addMappings(mapper -> mapper.using(toDriverDtoList).map(Carriage::getDrivers, CarriageDto::setDrivers));\n }", "public interface DTOMapper<E> {\n\n /**\n * Fills the DTO with information from the entity.\n *\n * @param entity the <code>E</code> generics entity\n */\n void buildFromEntity(E entity);\n}", "@Mapper(componentModel = \"spring\", uses = {MatiereMapper.class})\npublic interface ClasseMapper extends EntityMapper<ClasseDTO, Classe> {\n\n\n @Mapping(target = \"professeurClasses\", ignore = true)\n Classe toEntity(ClasseDTO classeDTO);\n\n default Classe fromId(Long id) {\n if (id == null) {\n return null;\n }\n Classe classe = new Classe();\n classe.setId(id);\n return classe;\n }\n}", "@Mapper(componentModel = \"spring\", uses = {NotificationTemplatesMapper.class})\npublic interface UserNotificationsMapper extends EntityMapper<UserNotificationsDTO, UserNotifications> {\n\n @Mapping(source = \"notificationTemplates.id\", target = \"notification_templatesId\")\n UserNotificationsDTO toDto(UserNotifications userNotifications);\n\n @Mapping(source = \"notification_templatesId\", target = \"notificationTemplates\")\n UserNotifications toEntity(UserNotificationsDTO userNotificationsDTO);\n\n default UserNotifications fromId(Long id) {\n if (id == null) {\n return null;\n }\n UserNotifications userNotifications = new UserNotifications();\n userNotifications.setId(id);\n return userNotifications;\n }\n}", "@Mapper(componentModel = \"spring\", uses = {CurrencyMapper.class})\npublic interface TransactionMapper extends EntityMapper<TransactionDTO, Transaction> {\n\n @Mapping(source = \"currency.id\", target = \"currencyId\")\n TransactionDTO toDto(Transaction transaction);\n\n @Mapping(source = \"currencyId\", target = \"currency\")\n Transaction toEntity(TransactionDTO transactionDTO);\n\n default Transaction fromId(Long id) {\n if (id == null) {\n return null;\n }\n Transaction transaction = new Transaction();\n transaction.setId(id);\n return transaction;\n }\n}", "@Mappings({\n\t\t@Mapping(target=\"id\", source=\"entity.id\"),\n\t\t@Mapping(target=\"userId\", source=\"entity.userId\"),\n\t\t@Mapping(target=\"task_description\", source=\"entity.description\"),\n\t\t@Mapping(target=\"createdDate\", source=\"entity.createdDate\"),\n\t\t@Mapping(target=\"modifiedDate\", source=\"entity.modifiedDate\")\n\t\t//@Mapping(target=\"isDeleted\", source=\"entity.isDeleted\")\n\t\t})\n\n\t\tTaskDto taskToTaskDTO(Task entity);", "@Mapper(uses = DateMapper.class)\npublic interface ExerciseMapper {\n\n // Autogenerated code will map exercise object to ExerciseDTO\n // @Mapping(source = \"firstName\", target = \"name\") can be used if the field names do not match.\n ExerciseDTO convertToExerciseDTO(Exercise exercise);\n\n Exercise convertToExercise(ExerciseDTO exerciseDTO);\n\n}", "public User getUserFromTeam(Team team){\n String sql = \"SELECT * FROM trainer tr INNER JOIN Team T ON tr.userid = T.userid WHERE T.teamid = ?\";\n User user = jdbc.queryForObject(sql, new UserDaoImpl.UserMapper(), team.getId());\n System.out.print(user);\n return user;\n }", "@Mapper(componentModel = \"spring\", uses = {})\npublic interface EightydMapper extends EntityMapper<EightydDTO, Eightyd> {\n\n\n\n default Eightyd fromId(Long id) {\n if (id == null) {\n return null;\n }\n Eightyd eightyd = new Eightyd();\n eightyd.setId(id);\n return eightyd;\n }\n}", "@Mapper\npublic interface MissionMapper {\n\n MissionMapper INSTANCE = Mappers.getMapper(MissionMapper.class);\n\n @Mapping(source = \"izQuestion\", target = \"izQuestion\")\n @Mapping(source = \"missionDescription\", target = \"missionDescription\")\n @Mapping(source = \"missionName\", target = \"missionName\")\n @Mapping(source = \"shortDescription\", target = \"shortDescription\")\n @Mapping(source = \"winnerScore\", target = \"winnerScore\")\n @Mapping(source = \"storyId\", target = \"story.id\")\n Mission dtoToMission (MissionDTO missionDTO);\n}", "E mapToEntity(D dto);", "@Mapper(componentModel = \"spring\", uses = {})\npublic interface EventdataMapper {\n\n @Mapping(source = \"application.id\", target = \"applicationId\")\n @Mapping(source = \"applicationevent.id\", target = \"applicationeventId\")\n @Mapping(source = \"applicationview.id\", target = \"applicationviewId\")\n @Mapping(source = \"application.name\", target = \"applicationName\")\n @Mapping(source = \"applicationevent.name\", target = \"applicationeventName\")\n @Mapping(source = \"applicationview.name\", target = \"applicationviewName\")\n EventdataDTO eventdataToEventdataDTO(Eventdata eventdata);\n\n List<EventdataDTO> eventdataToEventdataDTOs(List<Eventdata> eventdata);\n\n @Mapping(source = \"applicationId\", target = \"application\")\n @Mapping(source = \"applicationeventId\", target = \"applicationevent\")\n @Mapping(source = \"applicationviewId\", target = \"applicationview\")\n Eventdata eventdataDTOToEventdata(EventdataDTO eventdataDTO);\n\n List<Eventdata> eventdataDTOsToEventdata(List<EventdataDTO> eventdataDTOs);\n\n default Application applicationFromId(Long id) {\n if (id == null) {\n return null;\n }\n Application application = new Application();\n application.setId(id);\n return application;\n }\n\n default Applicationevent applicationeventFromId(Long id) {\n if (id == null) {\n return null;\n }\n Applicationevent applicationevent = new Applicationevent();\n applicationevent.setId(id);\n return applicationevent;\n }\n\n default Applicationview applicationviewFromId(Long id) {\n if (id == null) {\n return null;\n }\n Applicationview applicationview = new Applicationview();\n applicationview.setId(id);\n return applicationview;\n }\n}", "@Mapper(componentModel = \"spring\", uses = {ProOrderMapper.class})\r\npublic interface ProOrderItemMapper extends EntityMapper<ProOrderItemDTO, ProOrderItem> {\r\n\r\n @Mapping(source = \"proOrder.id\", target = \"proOrderId\")\r\n ProOrderItemDTO toDto(ProOrderItem proOrderItem);\r\n\r\n @Mapping(source = \"proOrderId\", target = \"proOrder\")\r\n ProOrderItem toEntity(ProOrderItemDTO proOrderItemDTO);\r\n\r\n default ProOrderItem fromId(Long id) {\r\n if (id == null) {\r\n return null;\r\n }\r\n ProOrderItem proOrderItem = new ProOrderItem();\r\n proOrderItem.setId(id);\r\n return proOrderItem;\r\n }\r\n}", "public void setTeam(Team team) {\r\n\t\tthis.team = team;\r\n\t}", "public static <DTO,Entity> Entity dtoToEntity(DTO dto,Class<Entity> classEntity)\n\t{\n\t\tModelMapper mapper = new ModelMapper();\n\t\treturn mapper.map(dto, classEntity);\n\t}", "@Mapper(componentModel = \"spring\", uses = {})\npublic interface TarifMapper extends EntityMapper <TarifDTO, Tarif> {\n \n \n default Tarif fromId(Long id) {\n if (id == null) {\n return null;\n }\n Tarif tarif = new Tarif();\n tarif.setId(id);\n return tarif;\n }\n}", "@Mapper(componentModel = \"spring\", uses = {ApplicationProspectMapper.class, NomineeMapper.class})\npublic interface AddressMapper extends EntityMapper<AddressDTO, Address> {\n\n @Mapping(source = \"applicationProspect.id\", target = \"applicationProspectId\")\n @Mapping(source = \"nominee.id\", target = \"nomineeId\")\n AddressDTO toDto(Address address);\n\n @Mapping(source = \"applicationProspectId\", target = \"applicationProspect\")\n @Mapping(source = \"nomineeId\", target = \"nominee\")\n Address toEntity(AddressDTO addressDTO);\n\n default Address fromId(Long id) {\n if (id == null) {\n return null;\n }\n Address address = new Address();\n address.setId(id);\n return address;\n }\n}", "@Mapper\npublic interface UserConvert {\n\n UserConvert INSTANCE = Mappers.getMapper(UserConvert.class);\n\n static UserConvertConvertor instance() {\n return INSTANCE;\n }\n\n @Mappings({})\n User toUser(UserDTO userDTO);\n\n @Mappings({})\n UserDTO toUserDTO(User user);\n\n List<UserDTO> toUserDTOs(List<User> users);\n\n List<User> toUsers(List<UserDTO> userDTOs);\n}", "@Mapper(componentModel = \"spring\", uses = {ProvinciaMapper.class})\npublic interface CodigoPostalMapper extends EntityMapper<CodigoPostalDTO, CodigoPostal> {\n\n @Mapping(source = \"provincia.id\", target = \"provinciaId\")\n @Mapping(source = \"provincia.nombreProvincia\", target = \"provinciaNombreProvincia\")\n CodigoPostalDTO toDto(CodigoPostal codigoPostal);\n\n @Mapping(source = \"provinciaId\", target = \"provincia\")\n CodigoPostal toEntity(CodigoPostalDTO codigoPostalDTO);\n\n default CodigoPostal fromId(Long id) {\n if (id == null) {\n return null;\n }\n CodigoPostal codigoPostal = new CodigoPostal();\n codigoPostal.setId(id);\n return codigoPostal;\n }\n}", "@Mapper(componentModel = \"spring\", uses = {AdGameMapper.class})\npublic interface AdChoiseMapper extends EntityMapper<AdChoiseDTO, AdChoise> {\n\n @Mapping(source = \"adGame.id\", target = \"adGameId\")\n AdChoiseDTO toDto(AdChoise adChoise); \n\n @Mapping(source = \"adGameId\", target = \"adGame\")\n @Mapping(target = \"corrects\", ignore = true)\n @Mapping(target = \"possiblities\", ignore = true)\n AdChoise toEntity(AdChoiseDTO adChoiseDTO);\n\n default AdChoise fromId(Long id) {\n if (id == null) {\n return null;\n }\n AdChoise adChoise = new AdChoise();\n adChoise.setId(id);\n return adChoise;\n }\n}", "@Mapper(componentModel = \"spring\", uses = {})\npublic interface StockInMapper {\n\n @Mapping(source = \"tranship.id\", target = \"transhipId\")\n @Mapping(source = \"project.id\", target = \"projectId\")\n @Mapping(source = \"projectSite.id\", target = \"projectSiteId\")\n StockInDTO stockInToStockInDTO(StockIn stockIn);\n\n List<StockInDTO> stockInsToStockInDTOs(List<StockIn> stockIns);\n\n @Mapping(source = \"transhipId\", target = \"tranship\")\n @Mapping(source = \"projectId\", target = \"project\")\n @Mapping(source = \"projectSiteId\", target = \"projectSite\")\n StockIn stockInDTOToStockIn(StockInDTO stockInDTO);\n\n List<StockIn> stockInDTOsToStockIns(List<StockInDTO> stockInDTOS);\n\n default Tranship transhipFromId(Long id) {\n if (id == null) {\n return null;\n }\n Tranship tranship = new Tranship();\n tranship.setId(id);\n return tranship;\n }\n\n default Project projectFromId(Long id) {\n if (id == null) {\n return null;\n }\n Project project = new Project();\n project.setId(id);\n return project;\n }\n\n default ProjectSite projectSiteFromId(Long id) {\n if (id == null) {\n return null;\n }\n ProjectSite projectSite = new ProjectSite();\n projectSite.setId(id);\n return projectSite;\n }\n\n default List<StockInForDataTable> stockInsToStockInTables(List<StockIn> stockIns){\n if ( stockIns == null ) {\n return null;\n }\n\n List<StockInForDataTable> list = new ArrayList<StockInForDataTable>();\n for ( StockIn stockIn : stockIns ) {\n list.add( stockInToStockInTable( stockIn ) );\n }\n\n return list;\n }\n\n default StockInForDataTable stockInToStockInTable(StockIn stockIn){\n if ( stockIn == null ) {\n return null;\n }\n\n StockInForDataTable stockInTable = new StockInForDataTable();\n\n stockInTable.setId( stockIn.getId() );\n stockInTable.setProjectCode( stockIn.getProjectCode() );\n stockInTable.setProjectSiteCode( stockIn.getProjectSiteCode() );\n stockInTable.setStoreKeeper1( stockIn.getStoreKeeper1() );\n stockInTable.setStoreKeeper2( stockIn.getStoreKeeper2() );\n stockInTable.setStockInDate( stockIn.getStockInDate() );\n stockInTable.setCountOfSample( stockIn.getCountOfSample() );\n stockInTable.setStatus( stockIn.getStatus() );\n stockInTable.setTranshipCode(stockIn.getTranship().getTranshipCode());\n stockInTable.setCountOfBox(stockIn.getTranship().getFrozenBoxNumber());\n stockInTable.setRecordDate(stockIn.getTranship().getReceiveDate());\n stockInTable.setStockInCode(stockIn.getStockInCode());\n return stockInTable;\n }\n\n default StockInForDataDetail stockInToStockInDetail(StockIn stockIn){\n if ( stockIn == null ) {\n return null;\n }\n\n StockInForDataDetail stockInDetail = new StockInForDataDetail();\n\n stockInDetail.setId( stockIn.getId() );\n stockInDetail.setProjectId(stockIn.getProject()!=null?stockIn.getProject().getId():null);\n stockInDetail.setProjectCode( stockIn.getProjectCode() );\n stockInDetail.setProjectSiteId(stockIn.getProjectSite()!=null?stockIn.getProjectSite().getId():null);\n stockInDetail.setProjectSiteCode( stockIn.getProjectSiteCode() );\n stockInDetail.setStoreKeeper1( stockIn.getStoreKeeper1() );\n stockInDetail.setStoreKeeper2( stockIn.getStoreKeeper2() );\n stockInDetail.setStockInDate( stockIn.getStockInDate() );\n stockInDetail.setStatus( stockIn.getStatus() );\n stockInDetail.setTranshipCode(stockIn.getTranship()!=null?stockIn.getTranship().getTranshipCode():null);\n stockInDetail.setReceiveDate(stockIn.getReceiveDate());\n stockInDetail.setStockInCode(stockIn.getStockInCode());\n stockInDetail.setReceiver(stockIn.getReceiveName());\n stockInDetail.setMemo(stockIn.getMemo());\n return stockInDetail;\n }\n}", "public void setTeamId(int teamId) {\n\t\tthis.teamId = teamId;\n\t}", "public void setTeamId(String teamId) {\n\t\tthis.teamId = teamId;\n\t}", "public void setTeamId(String teamId) {\n\t\tthis.teamId = teamId;\n\t}", "public abstract DTO toDTO(M model);", "public void setTeamId(String teamId) {\r\n\t\tthis.teamName = teamId;\r\n\t}", "@Mapper(componentModel = \"spring\", uses = {})\npublic interface CountryMapper extends EntityMapper<CountryDTO, Country> {\n\n\n @Mapping(target = \"cities\", ignore = true)\n @Mapping(target = \"countryLanguages\", ignore = true)\n Country toEntity(CountryDTO countryDTO);\n\n default Country fromId(Long id) {\n if (id == null) {\n return null;\n }\n Country country = new Country();\n country.setId(id);\n return country;\n }\n}", "@Mapper(componentModel = \"spring\", uses = {ProduitMapper.class, AchatLigneProformaMapper.class})\npublic interface AchatArticleLigneProformaMapper extends EntityMapper<AchatArticleLigneProformaDTO, AchatArticleLigneProforma> {\n\n @Mapping(source = \"produit.id\", target = \"produitId\")\n @Mapping(source = \"achatLigneProforma.id\", target = \"achatLigneProformaId\")\n AchatArticleLigneProformaDTO toDto(AchatArticleLigneProforma achatArticleLigneProforma);\n\n @Mapping(source = \"produitId\", target = \"produit\")\n @Mapping(source = \"achatLigneProformaId\", target = \"achatLigneProforma\")\n AchatArticleLigneProforma toEntity(AchatArticleLigneProformaDTO achatArticleLigneProformaDTO);\n\n default AchatArticleLigneProforma fromId(Long id) {\n if (id == null) {\n return null;\n }\n AchatArticleLigneProforma achatArticleLigneProforma = new AchatArticleLigneProforma();\n achatArticleLigneProforma.setId(id);\n return achatArticleLigneProforma;\n }\n}", "public Team getTeam() {\r\n\t\treturn team;\r\n\t}", "public Team getTeam1 () {\n return team1;\n }", "@Mapper(componentModel = \"spring\")\npublic interface SaleMapper extends EntityMapper<SaleDto, Sale> {\n\n @Mapping(source = \"client.id\", target = \"clientId\")\n @Mapping(source = \"client.name\", target = \"clientName\")\n SaleDto toDto(Sale sale);\n\n @Mapping(source = \"clientId\", target = \"client.id\")\n Sale toEntity(SaleDto saleDTO);\n\n default Sale fromId(Long id) {\n if (id == null) {\n return null;\n }\n Sale sale = new Sale();\n sale.setId(id);\n return sale;\n }\n\n}", "public Team getTeam() {\n Team team = new Team();\n team.setTeamName(this.getTeamNameDataLabel().getText());\n team.setCaptain(this.getCaptainDataLabel().getText());\n if (this.getCoachDataLabel().equals(\"\")) {\n team.setCoach(null);\n } else {\n team.setCoach(this.getCoachDataLabel().getText());\n }\n if (this.getAchievementsDataLabel().equals(\"\")) {\n team.setAchievements(null);\n } else {\n team.setAchievements(this.getAchievementsDataLabel().getText());\n }\n return team;\n }" ]
[ "0.62198985", "0.61338985", "0.6116561", "0.59001225", "0.5882696", "0.5848403", "0.5774008", "0.57154024", "0.5684394", "0.5674126", "0.56538534", "0.56444776", "0.5639643", "0.56371975", "0.56351537", "0.5613999", "0.5605752", "0.5591831", "0.5587719", "0.5581962", "0.55692774", "0.5562619", "0.55591035", "0.55553937", "0.5539653", "0.5539294", "0.5538194", "0.5535428", "0.55244887", "0.55174947", "0.5515379", "0.5512252", "0.54923886", "0.54782885", "0.54743946", "0.5473825", "0.5471236", "0.54557925", "0.5439756", "0.5425913", "0.54186505", "0.54174954", "0.54057956", "0.5404834", "0.5397274", "0.5397087", "0.53953844", "0.5394226", "0.5384398", "0.5383403", "0.5380738", "0.5379154", "0.53771484", "0.53701675", "0.53631437", "0.5333309", "0.53316957", "0.53310674", "0.53217167", "0.5309281", "0.53053766", "0.52938014", "0.5293107", "0.5291026", "0.5289649", "0.5278883", "0.52751124", "0.5267548", "0.52652204", "0.5264217", "0.5256311", "0.5241854", "0.5230614", "0.52299476", "0.5226961", "0.5224094", "0.5221039", "0.5216004", "0.5215995", "0.5214461", "0.5210775", "0.520867", "0.5208125", "0.5207456", "0.5206388", "0.5202182", "0.5200206", "0.52002054", "0.51922756", "0.5184273", "0.5183536", "0.5183536", "0.518285", "0.5169195", "0.51571465", "0.5155569", "0.51547635", "0.51546377", "0.5148644", "0.5145756" ]
0.78375375
0
plans the practiceTimes and sets notifications at those times
@Override public void onClick(View v) { Alarm alarm = new Alarm(getContext(), userId); alarm.setAlarmWithNewPracticeTimes(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private ActionInterface timeSchedulingTest(PlayerInfo playerInfo, Timestamp executionTime, double responseFactor) {\r\n\r\n User user = playerInfo.getUser();\r\n int favouriteTime = playerInfo.getReceptivityForPlayer().getFavouriteTimeOfDay(ReceptivityProfile.SignificanceLevel.SPECIFIC);\r\n\r\n switch(favouriteTime){\r\n\r\n case ReceptivityProfile.DAY:\r\n\r\n if(randomize3(user, 0)){\r\n\r\n // Schedule correctly\r\n return new NotificationAction(\"Hello \"+ user.name+\", your daily bonus is waiting for you at Slot America. Click here to claim it NOW!\",\r\n user, executionTime, getPriority(), getTag(), Name, 1000, getState(), responseFactor)\r\n .scheduleInTime( ReceptivityProfile.DAY );\r\n }\r\n\r\n if(randomize3(user, 1)){\r\n\r\n // Schedule later\r\n return new NotificationAction(\"Hello \"+ user.name+\", your daily bonus is waiting for you at Slot America. Click here to claim it NOW!\",\r\n user, executionTime, getPriority(), getTag(), Name, 1001, getState(), responseFactor)\r\n .scheduleInTime( ReceptivityProfile.EVENING );\r\n }\r\n\r\n // Schedule earlier\r\n return new NotificationAction(\"Hello \"+ user.name+\", your daily bonus is waiting for you at Slot America. Click here to claim it NOW!\",\r\n user, executionTime, getPriority(), getTag(), Name, 1002, getState(), responseFactor)\r\n .scheduleInTime( ReceptivityProfile.NIGHT );\r\n\r\n case ReceptivityProfile.EVENING:\r\n\r\n if(randomize3(user, 0)){\r\n\r\n // Schedule correctly\r\n return new NotificationAction(\"Hello \"+ user.name+\", your daily bonus is waiting for you at Slot America. Click here to claim it NOW!\",\r\n user, executionTime, getPriority(), getTag(), Name, 1011, getState(), responseFactor)\r\n .scheduleInTime( ReceptivityProfile.EVENING );\r\n }\r\n\r\n if(randomize3(user, 1)){\r\n\r\n // Schedule later\r\n return new NotificationAction(\"Hello \"+ user.name+\", your daily bonus is waiting for you at Slot America. Click here to claim it NOW!\",\r\n user, executionTime, getPriority(), getTag(), Name, 1012, getState(), responseFactor)\r\n .scheduleInTime( ReceptivityProfile.NIGHT );\r\n }\r\n\r\n // Schedule earlier\r\n return new NotificationAction(\"Hello \"+ user.name+\", your daily bonus is waiting for you at Slot America. Click here to claim it NOW!\",\r\n user, executionTime, getPriority(), getTag(), Name, 1010, getState(), responseFactor)\r\n .scheduleInTime( ReceptivityProfile.DAY );\r\n\r\n case ReceptivityProfile.NIGHT:\r\n\r\n if(randomize3(user, 0)){\r\n\r\n // Schedule correctly\r\n return new NotificationAction(\"Hello \"+ user.name+\", your daily bonus is waiting for you at Slot America. Click here to claim it NOW!\",\r\n user, executionTime, getPriority(), getTag(), Name, 1022, getState(), responseFactor)\r\n .scheduleInTime( ReceptivityProfile.DAY );\r\n }\r\n\r\n if(randomize3(user, 1)){\r\n\r\n // Schedule later\r\n return new NotificationAction(\"Hello \"+ user.name+\", your daily bonus is waiting for you at Slot America. Click here to claim it NOW!\",\r\n user, executionTime, getPriority(), getTag(), Name, 1020, getState(), responseFactor)\r\n .scheduleInTime( ReceptivityProfile.EVENING );\r\n }\r\n\r\n // Schedule earlier\r\n return new NotificationAction(\"Hello \"+ user.name+\", your daily bonus is waiting for you at Slot America. Click here to claim it NOW!\",\r\n user, executionTime, getPriority(), getTag(), Name, 1021, getState(), responseFactor)\r\n .scheduleInTime( ReceptivityProfile.NIGHT );\r\n\r\n\r\n default:\r\n\r\n // No specific time of day for user.\r\n\r\n return new NotificationAction(\"Hello \"+ user.name+\", your daily bonus is waiting for you at Slot America. Click here to claim it NOW!\",\r\n user, executionTime, getPriority(), getTag(), Name, 3, getState(), responseFactor)\r\n .scheduleInTime( favouriteTime );\r\n\r\n }\r\n\r\n\r\n\r\n\r\n\r\n }", "public void generateTimes() {\n\n\t\tLocalTime currentTime = PropertiesConfig.getMorningSessionBegin();\n\t\tfor (Talk talk : morningSession.getTalks()) {\n\t\t\ttalk.setTime(currentTime);\n\t\t\tcurrentTime = currentTime.plusMinutes(talk.getLength());\n\t\t}\n\n\t\tTalk lunch = new Talk(PropertiesConfig.LUNCH_TITLE);\n\t\tlunch.setTime(PropertiesConfig.getLunchBegin());\n\t\tlunchSession.addTalk(lunch);\n\n\t\tcurrentTime = PropertiesConfig.getAfternoonSessionBegin();\n\t\tfor (Talk talk : afternoonSession.getTalks()) {\n\t\t\ttalk.setTime(currentTime);\n\t\t\tcurrentTime = currentTime.plusMinutes(talk.getLength());\n\t\t}\n\n\t\tTalk meetEvent = new Talk(PropertiesConfig.MEET_EVENT_TITLE);\n\t\tmeetEvent.setTime(currentTime);\n\t\tmeetSession.addTalk(meetEvent);\n\t}", "private void renewTimes() {\n String time_morgens_new = time_prefs.getString(\"time_morgens\", getResources().getString(R.string.default_morgens));\n String time_mittags_new = time_prefs.getString(\"time_mittags\", getResources().getString(R.string.default_mittags));\n String time_abends_new = time_prefs.getString(\"time_abends\", getResources().getString(R.string.default_abends));\n String time_zur_nacht_new = time_prefs.getString(\"time_morgens\", getResources().getString(R.string.default_morgens));\n /*comparison of class local time variblaes with new Preferences\n deletes alarms affected medicines and creates new alarms for them\n */\n\n if (!time_morgens.equals(time_morgens_new)) {\n //list all affected Meds and iterate for each\n List<Meds> meds = Meds.find(Meds.class, \"time = ?\", \"Morgens\");\n for (Meds m : meds) {\n if (!m.getDays().equals(\"\")) {\n cancelAlarm(m.getId());\n }\n }\n\n for (Meds m : meds) {\n if (!m.getDays().equals(\"\")) {\n createAlarm(m.getDays(), m.getTime(), m.getId());\n }\n }\n }\n\n if (!time_mittags.equals(time_mittags_new)) {\n List<Meds> meds = Meds.find(Meds.class, \"time = ?\", \"Mittags\");\n for (Meds m : meds) {\n if (!m.getDays().equals(\"\")) {\n cancelAlarm(m.getId());\n }\n }\n\n for (Meds m : meds) {\n if (!m.getDays().equals(\"\")) {\n createAlarm(m.getDays(), m.getTime(), m.getId());\n }\n }\n }\n if (!time_abends.equals(time_abends_new)) {\n List<Meds> meds = Meds.find(Meds.class, \"time = ?\", \"Abends\");\n for (Meds m : meds) {\n if (!m.getDays().equals(\"\")) {\n cancelAlarm(m.getId());\n }\n }\n\n for (Meds m : meds) {\n if (!m.getDays().equals(\"\")) {\n createAlarm(m.getDays(), m.getTime(), m.getId());\n }\n }\n }\n if (!time_zur_nacht.equals(time_zur_nacht_new)) {\n List<Meds> meds = Meds.find(Meds.class, \"time = ?\", \"Morgens\");\n for (Meds m : meds) {\n if (!m.getDays().equals(\"\")) {\n cancelAlarm(m.getId());\n }\n }\n\n for (Meds m : meds) {\n if (!m.getDays().equals(\"\")) {\n createAlarm(m.getDays(), m.getTime(), m.getId());\n }\n }\n }\n }", "@Override\n public void setNotification() {\n if (getTense() == Tense.FUTURE) {\n //Context ctx = SHiTApplication.getContext();\n //SharedPreferences sharedPref = PreferenceManager.getDefaultSharedPreferences(ctx);\n\n int leadTimeEventMinutes = SHiTApplication.getPreferenceInt(Constants.Setting.ALERT_LEAD_TIME_EVENT, LEAD_TIME_MISSING);\n\n if (leadTimeEventMinutes != LEAD_TIME_MISSING) {\n if (travelTime > 0) {\n leadTimeEventMinutes += travelTime;\n }\n\n setNotification(Constants.Setting.ALERT_LEAD_TIME_EVENT\n , leadTimeEventMinutes\n , R.string.alert_msg_event\n , getNotificationClickAction()\n , null);\n }\n }\n }", "public void timeLogic(int time){\n //Add logic to decide time increments at which tickets will be granted\n }", "public void setTime() {\r\n\t\tArrayList<String> slots = new ArrayList<String>();\r\n\t\tString inSched = getWorkHours();\r\n\t\tswitch(inSched) {\r\n\t\tcase \"6AM-3PM\":\r\n\t\t\tArrayList<String> sched1 = new ArrayList<String>(Arrays.asList(\"06AM\",\"07AM\",\"08AM\",\"09AM\",\"10AM\",\"12PM\",\"1PM\",\"2PM\"));\r\n\t\t\tslots = sched1;\r\n\t\t\tbreak;\r\n\t\tcase \"7AM-4PM\":\r\n\t\t\tArrayList<String> sched2 = new ArrayList<String>(Arrays.asList(\"07AM\",\"08AM\",\"09AM\",\"10AM\",\"11AM\",\"1PM\",\"2PM\",\"3PM\"));\r\n\t\t\tslots = sched2;\r\n\t\t\tbreak;\r\n\t\tcase \"8AM-5PM\":\r\n\t\t\tArrayList<String> sched3 = new ArrayList<String>(Arrays.asList(\"08AM\",\"09AM\",\"10AM\",\"11AM\",\"12PM\",\"2PM\",\"3PM\",\"4PM\"));\r\n\t\t\tslots = sched3;\r\n\t\t\tbreak;\r\n\t\tcase \"9AM-6PM\":\r\n\t\t\tArrayList<String> sched4 = new ArrayList<String>(Arrays.asList(\"09AM\",\"10AM\",\"11AM\",\"12PM\",\"1PM\",\"3PM\",\"4PM\",\"5PM\"));\r\n\t\t\tslots = sched4;\r\n\t\t\tbreak;\r\n\t\tcase \"10AM-7PM\":\r\n\t\t\tArrayList<String> sched5 = new ArrayList<String>(Arrays.asList(\"10AM\",\"11AM\",\"12PM\",\"1PM\",\"2PM\",\"4PM\",\"5PM\",\"6PM\"));\r\n\t\t\tslots = sched5;\r\n\t\t\tbreak;\r\n\t\tdefault:\r\n\t\t\tslots.add(\"No appointments available for this date.\");\r\n\t\t}\r\n\t\tthis.timeAvailable = slots;\r\n\t}", "@Override\n public void run() {\n Calendar calendar = Calendar.getInstance();\n SimpleDateFormat simpleDateFormat = new SimpleDateFormat(\"dd/MM/yyyy\");\n String dateTime = simpleDateFormat.format(calendar.getTime());\n\n //Find the current time\n SimpleDateFormat simpleDateFormat1 = new SimpleDateFormat(\"hh:mm:ss a\");\n String currentTime = simpleDateFormat1.format(calendar.getTime());\n\n //Find duration of current date and first day\n Date date1,date2;\n String dateStr1 = data.getDate();\n String dateStr2 = dateTime;\n SimpleDateFormat sdf = new SimpleDateFormat(\"dd/MM/yyyy\");\n try{\n date1 = sdf.parse(dateStr1);\n date2 = sdf.parse(dateStr2);\n long diff = date2.getTime() - date1.getTime();\n long totalDay = TimeUnit.DAYS.convert(diff, TimeUnit.MILLISECONDS);\n\n if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {\n NotificationChannel channel = new NotificationChannel(\"My Notification\", \"My Notification\", NotificationManager.IMPORTANCE_DEFAULT);\n NotificationManager manager = getSystemService(NotificationManager.class);\n manager.createNotificationChannel(channel);\n }\n\n //Exercise Time\n if(totalDay==0 || totalDay==1 || (totalDay>4+dayInSpace && totalDay<=10+dayInSpace)){\n if (currentTime.equals(\"05:00:00 PM\")) {\n NotificationExercise();\n }\n }\n\n if(totalDay==2){\n if (currentTime.equals(\"08:00:00 PM\")) {\n NotificationExercise();\n }\n }\n\n if(totalDay==3){\n if (currentTime.equals(\"10:00:00 PM\")) {\n NotificationExercise();\n }\n }\n\n if(totalDay>=5 && totalDay<=4+dayInSpace){\n if (currentTime.equals(\"03:00:00 AM\")) {\n NotificationExercise();\n }\n }\n\n //Eating time (After half hour wake up-breakfast, After five hours wake up-lunch, Before four hours sleep-dinner)\n if(totalDay==0 || totalDay==1){\n if (currentTime.equals(\"07:30:00 AM\") || currentTime.equals(\"12:00:00 PM\") || currentTime.equals(\"07:00:00 PM\")) {\n NotificationMeal();\n }\n }\n\n if(totalDay==2){\n if (currentTime.equals(\"08:30:00 AM\") || currentTime.equals(\"01:00:00 PM\") || currentTime.equals(\"10:00:00 PM\")) {\n NotificationMeal();\n }\n }\n\n if(totalDay==3){\n if (currentTime.equals(\"10:30:00 AM\") || currentTime.equals(\"03:00:00 PM\")) {\n NotificationMeal();\n }\n }\n\n if(totalDay==4){\n if (currentTime.equals(\"12:00:00 AM\") || currentTime.equals(\"12:30:00 PM\") || currentTime.equals(\"05:00:00 PM\")) {\n NotificationMeal();\n }\n }\n\n if(totalDay>=5 && totalDay<=4+dayInSpace){\n if (currentTime.equals(\"05:00:00 AM\") || currentTime.equals(\"03:30:00 PM\") || currentTime.equals(\"08:00:00 PM\")) {\n NotificationMeal();\n }\n }\n\n if(totalDay>4+dayInSpace && totalDay<=10+dayInSpace){\n if (currentTime.equals(\"08:30:00 AM\") || currentTime.equals(\"01:00:00 PM\") || currentTime.equals(\"7:00:00 PM\")) {\n NotificationMeal();\n }\n }\n\n //Take Melatonin time\n if(totalDay>=5 && totalDay<5+dayInSpace){\n if (currentTime.equals(\"09:00:00 AM\")) {\n NotificationTakeMelatonin();\n }\n }\n\n if(totalDay>=4+dayInSpace && totalDay<=6+dayInSpace){\n if (currentTime.equals(\"11:00:00 PM\")) {\n NotificationTakeMelatonin();\n }\n }\n\n //Nap time\n if(totalDay>=4 && totalDay<4+dayInSpace){\n if (currentTime.equals(\"06:00:00 PM\")) {\n NotificationNap();\n }\n }\n\n if(totalDay>=4 && totalDay<4+dayInSpace){\n if (currentTime.equals(\"08:00:00 PM\")) {\n NotificationNap();\n }\n }\n\n //Sleep Time\n if(totalDay==0){\n if (currentTime.equals(\"12:00:00 AM\")) {\n NotificationSleep();\n }\n }\n\n if(totalDay==0 || totalDay==1){\n if (currentTime.equals(\"11:00:00 PM\")) {\n NotificationSleep();\n }\n }\n\n if(totalDay==3){\n if (currentTime.equals(\"02:00:00 AM\")) {\n NotificationSleep();\n }\n }\n\n if(totalDay==4){\n if (currentTime.equals(\"04:00:00 AM\")) {\n NotificationSleep();\n }\n }\n\n if(totalDay>=5 && totalDay<5+dayInSpace){\n if (currentTime.equals(\"09:00:00 AM\")) {\n NotificationSleep();\n }\n }\n\n if(totalDay>=4+dayInSpace && totalDay<=10+dayInSpace){\n if (currentTime.equals(\"11:00:00 PM\")) {\n NotificationSleep();\n }\n }\n\n //Wake Up Time\n if(totalDay==0 || totalDay==1){\n if (currentTime.equals(\"07:00:00 AM\")) {\n NotificationWakeUp();\n }\n }\n\n if(totalDay==2){\n if (currentTime.equals(\"08:00:00 AM\")) {\n NotificationWakeUp();\n }\n }\n\n if(totalDay==3){\n if (currentTime.equals(\"10:00:00 AM\")) {\n NotificationWakeUp();\n }\n }\n\n if(totalDay==4){\n if (currentTime.equals(\"12:00:00 PM\")) {\n NotificationWakeUp();\n }\n }\n\n if(totalDay>=5 && totalDay<5+dayInSpace){\n if (currentTime.equals(\"03:00:00 PM\")) {\n NotificationWakeUp();\n }\n }\n\n if(totalDay>=5+dayInSpace && totalDay<=10+dayInSpace){\n if (currentTime.equals(\"08:00:00 AM\")) {\n NotificationWakeUp();\n }\n }\n\n }catch(ParseException e){\n Log.d(\"error\",\"error\");\n }\n }", "private void createScheduledNotification(List<SessionModel> values, int test)\n\t{\n\n\t\t// Get new calendar object and set the date to now\n\t\tCalendar calendar = Calendar.getInstance();\n\t\tcalendar.setTimeInMillis(System.currentTimeMillis());\n\t\t// Add defined amount of days to the date\n\n\t\tgetBaseContext();\n\t\t// Retrieve alarm manager from the system\n\t\tAlarmManager alarmManager = (AlarmManager)getSystemService(Context.ALARM_SERVICE);\n\n\t\tfor (SessionModel element : values) {\n\n\t\t\tString[] ymd = element.getStartDateSplit();\n\t\t\tint month = Integer.parseInt(ymd[0]);\n\t\t\tint date = Integer.parseInt(ymd[1]);\n\t\t\tint year = Integer.parseInt(ymd[2]);\n\n\t\t\tString[] hm = element.getStartTimeSplit();\n\t\t\tint hour = Integer.parseInt(hm[0]);\n\t\t\tint min = Integer.parseInt(hm[1]);\n\n\t\t\tcalendar.set(Calendar.YEAR, year);\n\t\t\tcalendar.set(Calendar.MONTH, month);\n\t\t\tcalendar.set(Calendar.DATE, date);\n\t\t\tcalendar.set(Calendar.HOUR, hour);\n\t\t\tcalendar.set(Calendar.MINUTE, min);\n\n\t\t\tlong secs = calendar.getTimeInMillis();\n\t\t\tsecs -= 600000;\n\t\t\tcalendar.setTimeInMillis(secs);\n\t\t\tLog.w(\"AlarmManager-TDC2014 \", \"Setting Alarm Time : \" + calendar.toString());\n\t\t\tint id = (int) System.currentTimeMillis();\n\t\t\tIntent intent = new Intent(\"net.redirectme.apps.SESSION_NOTIFY\");\n\t\t\tintent.putExtra(android.content.Intent.EXTRA_TEXT, element.getId());\n\t\t\tintent.putExtra(android.content.Intent.EXTRA_TITLE, element.getName());;\n\t\t\tintent.putExtra(android.content.Intent.EXTRA_SUBJECT, element.getAuthor());\n\n\t\t\tint trackIcon = element.getTrackIcon();\n\t\t\tintent.putExtra(android.content.Intent.EXTRA_SHORTCUT_ICON, trackIcon);\n\n\n\t\t\tPendingIntent pendingIntent = PendingIntent.getBroadcast(this, id, intent, PendingIntent.FLAG_ONE_SHOT);\n\t\t\talarmManager.set(AlarmManager.RTC_WAKEUP, calendar.getTimeInMillis(), pendingIntent);\n\n\t\t}\n\t\tif(test==1)\n\t\t{\n\t\t\t// 5secs from now\n\t\t\tcalendar.setTimeInMillis(System.currentTimeMillis() + 10000);\n\t\t\tLog.w(\"AlarmManager-TEST \", \"Setting Alarm Time : \" + calendar.getTime());\n\t\t\tint id = (int) System.currentTimeMillis();\n\t\t\tIntent intent = new Intent(\"net.redirectme.apps.SESSION_NOTIFY\");\n\t\t\tlong value = 1;\n\t\t\tintent.putExtra(android.content.Intent.EXTRA_TEXT, value);\n\t\t\tintent.putExtra(android.content.Intent.EXTRA_TITLE, \"Test Session\");;\n\t\t\tintent.putExtra(android.content.Intent.EXTRA_SUBJECT, \"Sanjeev BA\");\n\t\t\tintent.putExtra(android.content.Intent.EXTRA_SHORTCUT_ICON, R.drawable.track_43_general);\n\n\t\t\tPendingIntent pendingIntent = PendingIntent.getBroadcast(this, id, intent, 0);\n\t\t\talarmManager.set(AlarmManager.RTC_WAKEUP, calendar.getTimeInMillis(), pendingIntent);\n\t\t}\n\n\t}", "private void setNotifications() {\n RealmManager realmManager = new RealmManager();\n realmManager.open();\n RecurringDao recurringDao = realmManager.createRecurringDao();\n\n List<Recurring> recurringTransactions = recurringDao.getAllRecurringTransactions();\n NotificationScheduler notificationScheduler = new NotificationScheduler(this);\n\n for (Recurring recurring : recurringTransactions) {\n notificationScheduler.schedule(recurring);\n }\n realmManager.close();\n }", "@Test\n\tpublic void test02() throws Throwable {\n\t\tint startHour=-15;\n\t\tint startMinute=30;\n\t\tint startDay=11;\n\t\tint startMonth=4;\n\t\tint startYear=2017;\n\t\tString title=\"Birthday Party\";\n\t\tString description=\"This is my birthday party.\";\n\t\t//Construct a new Appointment object with the initial data\n\t\tAppt appt1 = new Appt(startHour,\n\t\t\t\tstartMinute ,\n\t\t\t\tstartDay ,\n\t\t\t\tstartMonth ,\n\t\t\t\tstartYear ,\n\t\t\t\ttitle,\n\t\t\t\tdescription);\n\t\t// create another appointment\n\t\tstartHour=14;\n\t\tstartMinute=30;\n\t\tstartDay=11;\n\t\tstartMonth=4;\n\t\tstartYear=2017;\n\t\ttitle=\"Class\";\n\t\tdescription=\"Rescheduled class.\";\n\t\t//Construct a new Appointment object with the initial data\n\t\tAppt appt2 = new Appt(startHour,\n\t\t\t\tstartMinute ,\n\t\t\t\tstartDay ,\n\t\t\t\tstartMonth ,\n\t\t\t\tstartYear ,\n\t\t\t\ttitle,\n\t\t\t\tdescription);\n\t\t// create another appointment\n\t\tstartHour=13;\n\t\tstartMinute=30;\n\t\tstartDay=11;\n\t\tstartMonth=4;\n\t\tstartYear=2017;\n\t\ttitle=\"Meeting Today\";\n\t\tdescription=\"Meeting with the students.\";\n\t\t//Construct a new Appointment object with the initial data\n\t\tAppt appt3 = new Appt(startHour,\n\t\t\t\tstartMinute ,\n\t\t\t\tstartDay ,\n\t\t\t\tstartMonth ,\n\t\t\t\tstartYear ,\n\t\t\t\ttitle,\n\t\t\t\tdescription);\n\t\t//Create CalDay objects\n\t\tCalDay today = new CalDay (new GregorianCalendar(2017,4,11));\n\t\t//Set the calender appointments\n\t\ttoday.addAppt(appt1);\n\t\ttoday.addAppt(appt2);\n\t\ttoday.addAppt(appt3);\n\t\t//Assertions\n\t\tassertTrue(today.isValid());\n\t\tassertEquals(11, today.getDay());\n\t\tassertEquals(4, today.getMonth());\n\t\tassertEquals(2017, today.getYear());\n\t\tassertEquals(2, today.getSizeAppts());\n\t\tassertEquals(\"\\t --- 4/11/2017 --- \\n\" +\n\t\t\t\t\" --- -------- Appointments ------------ --- \\n\" +\n\t\t\t\t\"\\t4/11/2017 at 1:30pm ,Meeting Today, Meeting with the students.\\n\" +\n\t\t\t\t\" \\t4/11/2017 at 2:30pm ,Class, Rescheduled class.\\n\" +\n\t\t\t\t\" \\n\", today.toString());\n\t}", "public void checkTimes(){\r\n\t\tcal = Calendar.getInstance();\r\n\t\t//if(alarmList.size() != 0){\r\n\t\tfor(int i = 0; i < alarmList.size(); i++){\r\n\t\t\tAlarmTime current = alarmList.get(i);\r\n\t\t\tif(current.getYear() == cal.get(Calendar.YEAR) && current.getMonth() == cal.get(Calendar.MONTH)\r\n\t\t\t\t\t&& current.getDay() == cal.get(Calendar.DAY_OF_MONTH) && current.getHour() == cal.get(Calendar.HOUR_OF_DAY)\r\n\t\t\t\t\t&& current.getMinute() <= cal.get(Calendar.MINUTE)){\r\n\t\t\t\t//display alarm / play sound\r\n\t\t\t\t\t//alarmList.get(i).setActive(true);\r\n\t\t\t\t\tcurrent.setActive(true);\r\n\t\t\t\t//if(!alarmList.get(i).isActive){\t\t\t\t\t//this can be removed if it needs to repeatedly go off\r\n\r\n//\t\t\t\t\tif(!(activeAlarms.contains(alarmList.get(i)))){\r\n//\t\t\t\t\t\tactiveAlarms.add(alarmList.get(i));\r\n//\t\t\t\t\t}\r\n\t\t\t\t\tif(!(activeAlarms.contains(current))){\r\n\t\t\t\t\t\tactiveAlarms.add(current);\r\n\t\t\t\t\t}\r\n\t\t\t\t\t\r\n\t\t\t\t\t//System.out.println(alarmList.get(i).getMinute());\r\n\t\t\t\t\t//System.out.println(current.getMinute());\r\n\t\t\t\t\tring = new AlarmRingDesign(alarmList.get(i).getMessage(), this, alarmList.get(i));\r\n\t\t\t\t\tring.init();\r\n\t\t\t\t\r\n\t\t\t}\r\n\t\t\telse{\r\n\t\t\t\t//do nothing\r\n\t\t\t}\r\n\t\t}\r\n\t//}\r\n\t}", "private void informTimeToCross() {\n if (continueAskingTimes) {\n requestTimes();\n }\n }", "@Test\n\t public void test01() throws Throwable {\n\t\tint startHour=21;\n\t\tint startMinute=30;\n\t\tint startDay=1;\n\t\tint startMonth=2;\n\t\tint startYear=2018;\n\t\tString title=\"Test 2a\";\n\t\tString description=\"This is test 1a.\";\n\t\t //Construct a new Appointment object with the initial data\t \n\t\tAppt appt1 = new Appt(startHour,\n\t\t startMinute ,\n\t\t startDay ,\n\t\t startMonth ,\n\t\t startYear ,\n\t\t title,\n\t\t description);\n\t\t\t\t \n\t\tstartHour=8;\n\t\tstartMinute=15;\n\t\tstartDay=1;\n\t\tstartMonth=2;\n\t\tstartYear=2018;\n\t\ttitle=\"Test 2b\";\n\t\tdescription=\"This is test 1b.\";\n\t\t //Construct a new Appointment object with the initial data\t \n\t\tAppt appt2 = new Appt(startHour,\n\t\t startMinute ,\n\t\t startDay ,\n\t\t startMonth ,\n\t\t startYear ,\n\t\t title,\n\t\t description);\n\t\t\t\t \n\t// assertions\n\t\tassertTrue(appt1.getValid());\n\t\tassertTrue(appt2.getValid());\n\t\t \n\t\tLinkedList<Appt> appts = new LinkedList<Appt>();\n\t\tappts.add(appt1);\n\t\tappts.add(appt2);\n\t\t \n\t\tCalendar rightnow = Calendar.getInstance();\n \tint thisMonth = rightnow.get(Calendar.MONTH)+1;\n\t\tint thisYear = rightnow.get(Calendar.YEAR);\n\t\tint thisDay = rightnow.get(Calendar.DAY_OF_MONTH);\n\t\tGregorianCalendar today = new GregorianCalendar(thisYear,thisMonth,thisDay);\n\t\tGregorianCalendar tomorrow = (GregorianCalendar)today.clone();\n\t\ttomorrow.add(Calendar.DAY_OF_MONTH,1);\n\t\t//Construct new CalDay object\n\t\tCalDay day = new CalDay(today);\n\t\tday.addAppt(appt1);\n\t\tday.addAppt(appt2);\n\t\tTimeTable timeTable = new TimeTable();\n\t//assertions\n\t\tassertTrue(day.isValid());\n\t\tassertEquals(2, day.getSizeAppts()); //check for two appts added\n\t\tassertEquals(1, timeTable.getApptRange(appts, today, tomorrow).size()); //should return the CalDay between the two dates\n\t }", "protected abstract void scheduleSuspicions();", "@ScheduledMethod(start= 1, interval =1, priority=5.5)\n\tpublic void meetUp(){\n\t\tif(CFG.MEETUP_VEG()){\n\t\t\tPContext affordanceToRemove =null;\n\t\t\tfor(PContext affordance:getMeatPractice().getAffordances()){\n\t\t\t\tif(affordance.getMyLocation().getClass() == myMeetUpPlace.getClass()) affordanceToRemove = affordance;\n\t\t\t}\n\t\t\t if(affordanceToRemove != null) getMeatPractice().removeAffordance(affordanceToRemove); //After one time it isnt there anymore\n\t\t}\n\t\tif(CFG.isMeetUp() &&!isLocated){\n\t\t\tif(CFG.MEETUP_INVITE()){\n\t\t\t\tif(acceptInvitation(myMeetUpPlace)) diningOutToMeetUp(); //Only if you want to eat Veg you organize a dining party.\n\t\t\t}\n\t\t\telse goTo(myMeetUpPlace); //maar anders ga je er ok heen?!\n\t\t//\tSystem.out.println(\"Agents MEETUP\");\n\t\t}\n\t}", "@Override\n public void onSleepingHoursSet(int hourOfDay, int minute, int hourOfDayEnd, int minuteEnd) {\n Calendar calendar = Calendar.getInstance();\n calendar.set(Calendar.HOUR_OF_DAY, hourOfDay);\n calendar.set(Calendar.MINUTE, minute);\n // create a date object\n Date startSHdate = calendar.getTime();\n // add one day (for the stopSleepingHours end interval - assuming it next day)\n calendar.add(Calendar.DAY_OF_WEEK, 1);\n // set user selected hour and minute\n calendar.set(Calendar.HOUR_OF_DAY, hourOfDayEnd);\n calendar.set(Calendar.MINUTE, minuteEnd);\n // create a date object\n Date stopSHDate = calendar.getTime();\n // Check of the difference between the dates is at least 8 hours\n if (DateUtils.getDifferenceInHours(startSHdate, stopSHDate) >= 8) {\n // the difference between the dates is > = 8 hours. It is OK\n // Check if the start hour is before midnight\n if (hourOfDay <= ELEVEN_PM && hourOfDay >= SEVEN_PM) {\n try {\n mModel.setSleepingHours(hourOfDay, minute, hourOfDayEnd, minuteEnd);\n mView.showMessage(\"Selected: \" +\n hourOfDay + \" \" + minute +\n \" \" + hourOfDayEnd\n + \" \" + minuteEnd);\n } catch (Exception e) {\n mView.showMessage(\"Error! \" + e.getMessage());\n }\n } else {\n mView.showMessage(\"The start hour has to be between 7pm and 11pm\");\n }\n\n } else {\n mView.showMessage(\"The minimal interval for Sleeping hours is 8 hours!\");\n }\n }", "public void setWaterReminder(int hourGap, String userID) {\n \tif (hourGap ==0) \n \t\treturn;\n \t\n \tTimer timer = new Timer ();\n \tTimerTask hourlyTask = new TimerTask () {\n \t @Override\n \t public void run () {\n \t // your code here...\n \tTextMessage textMessage = new TextMessage(\"It is time to drink your water :)\");\n \tPushMessage pushMessage = new PushMessage(userID, textMessage);\n \ttry {\n \tResponse<BotApiResponse> response =\n \t LineMessagingServiceBuilder\n \t .create(\"CJo3Ka/VX7VW4fsG78i5dNDpP5qqYgr1PD7YUclFFc62ZtnrIpHiM/Muof6oLc/J/bPoaheiYdHNoUkg09kAt5VqnD+tMyzOCClGLwvJaR3+etoVOdsHo1DGXv2UqOljNgUIFR/zQWk1U4iFRPr4TQdB04t89/1O/w1cDnyilFU=\") // channel access token\n \t .build()\n \t .pushMessage(pushMessage)\n \t .execute();\n \tSystem.out.println(response.code() + \" \" + response.message());\n \t}\n \tcatch (Exception e) {\n \t\te.printStackTrace();\n \t}\n \t }\n \t};\n\n \t// schedule the task to run starting now and then every hour...\n \ttimer.schedule (hourlyTask, 0l, 1000*60*60*hourGap);\n\n\t}", "ConferenceScheduleBuilderService startLunch();", "public void workedOnTODO(int hours){\n\t\ttimeAllocated -=hours;\n\t}", "public void grantTickets(){\n //45mins\n if (tempTime >= 10){\n addTicket();\n }\n tempTime = 0;\n }", "public void timePasses(){\n crtClock++;\n if(crtClock==25)crtClock=1; // If end of day, reset to 1\n if(crtClock<=opHours)tellMeterToConsumeUnits(unitsPerHr);\n }", "public void setAlarms()\n\t{\n\t\tSharedPreferences sp = PreferenceManager.getDefaultSharedPreferences(getApplicationContext());\n\t\tAlarmManager alarm = (AlarmManager) getSystemService(Context.ALARM_SERVICE);\n\t\t\n\t\tSet<String> set;\n\t\tset=sp.getStringSet(\"lowattnotifs\", null);\n\t\tif(set!=null)\n\t\t{\n\t\t\tCalendar cal = Calendar.getInstance();\n\t\t\tcal.set(Calendar.HOUR_OF_DAY, 19);\n\t\t\tcal.set(Calendar.MINUTE, 0);\n\t\t\tcal.set(Calendar.SECOND, 0);\n\t\t\t\n\t\t\tIntent attintent = new Intent(this, Monitor.class);\n\t\t\tattintent.putExtra(\"attordate\", 0);\n\t\t\tPendingIntent attpintent = PendingIntent.getService(this, 0, attintent, 0);\n\t\t\t\n\t\t\talarm.cancel(attpintent);\t\t//cancel all alarms for attendance reminders\n\t\t\t\n\t\t\t//check if set contains these days\n\t\t\tfor(int i=0; i<7; i++)\n\t\t\t{\n\t\t\t\tif(set.contains(String.valueOf(i)))\n\t\t\t\t{\n\t\t\t\t\tcal.set(Calendar.DAY_OF_WEEK, i);\n\t\t\t\t\talarm.set(AlarmManager.RTC_WAKEUP, cal.getTimeInMillis(), attpintent);\n\t\t\t\t\tToast.makeText(getApplicationContext(), \"Set for day: \"+i, Toast.LENGTH_SHORT).show();\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "public void setProvisionTime(java.util.Calendar param){\n localProvisionTimeTracker = true;\n \n this.localProvisionTime=param;\n \n\n }", "void timeSet(Integer timeOpen, Integer timeWork){\n\t\tdaysUntilStarts = timeOpen;\n\t\tdaysToRun = timeWork;\n\t}", "@Override\n\tpublic void setNotification(String title, String text, int minutes, int type) {\n\t \t Calendar cal = Calendar.getInstance();\n\t \t // add 5 minutes to the calendar object\n\t \t cal.add(Calendar.MINUTE, minutes);\n\t \t Intent intent = new Intent(this, AlarmReceiver.class);\n\t \t intent.putExtra(\"title\", title);\n\t \t intent.putExtra(\"text\", text);\n\t \t intent.putExtra(\"type\", type);\n\t \t // In reality, you would want to have a static variable for the request code instead of 192837\n\t \t PendingIntent sender = PendingIntent.getBroadcast(this, 192213, intent, PendingIntent.FLAG_UPDATE_CURRENT);\n\t \t \n\t \t // Get the AlarmManager service\n\t \t AlarmManager am = (AlarmManager) getSystemService(ALARM_SERVICE);\n\t \t am.set(AlarmManager.RTC_WAKEUP, cal.getTimeInMillis(), sender);\n\t}", "public static void testSim(PriorityQueue roomQueue, int totalTime, int roomNum) {\r\n\t\t//this will run a test with the user specified number of rooms\r\n\t\t//and preset patient visits\r\n\t\t\r\n\t\tint currentTime = 0; //the current time in minutes - the number of minutes that have passed\r\n\t\tPriorityQueue arrivalQueue = new PriorityQueue<>(); // a queue to hold arriving patients\r\n\t\tPriorityQueue departureQueue = new PriorityQueue<>(); // a queue to hold departing patients\r\n\t\tArrayList<PatientVisit> treatedPatients = new ArrayList<PatientVisit>(); // a list to store the treated patients (will actually be deep copies of patients as their fields existed when they were moved to rooms)\t\t\r\n\t\tArrayList<ExamRoom> roomsInUse = new ArrayList<ExamRoom>(); // a list to hold rooms while they are in use\r\n\t\t\r\n\t\t//THE DATA WE WANT TO KEEP TRACK OF\r\n\t\tint totalPatients = 0;\r\n\t\tint highPriorityPatients = 0;\r\n\t\tint lowPriorityPatients = 0;\r\n\t\tdouble totalTreatmentTime = 0;\r\n\t\tdouble avgTreatmentTime;\r\n\t\tdouble highPriorityWaitTime = 0;\r\n\t\tdouble avgHighPriorityWaitTime;\r\n\t\tdouble lowPriorityWaitTime = 0;\r\n\t\tdouble avgLowPriorityWaitTime;\r\n\t\tdouble totalWaitTime = 0;\r\n\t\tdouble avgWaitTime;\r\n\t\t\r\n\t\twhile (currentTime < totalTime || departureQueue.size() > 0) { //until the time has elapsed AND all patients have finished treatment\r\n\t\t\t\r\n\t\t\tif (currentTime < totalTime) { // if the time specified by the user has not yet elapsed\r\n\t\t\t\tPatientVisit newPatient = PatientVisitGenerator.getNextProgrammedArrival(currentTime, roomNum); //generate an arrival event\r\n\t\t\t\tarrivalQueue.insert(newPatient); //add that patient to the arrival queue\t\t\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\telse if (!arrivalQueue.isEmpty()) {\r\n\t\t\t\tarrivalQueue = new PriorityQueue<>(); // clear any future events when user specified time has elapsed\r\n\t\t\t}\r\n\t\t\t//PUT PATIENT IN ROOM IF POSSIBLE\r\n\t\t\t// if there is an available room AND there are waiting patients (who have already arrived)\r\n\t\t\twhile (!roomQueue.isEmpty() && !arrivalQueue.isEmpty() && ((PatientVisit) arrivalQueue.front()).getArrivalTime() <= currentTime) { \r\n\t\t\t\t\r\n\t\t\t\t//GRAB THE NEXT ROOM AND PATIENT IN THEIR RESPECTIVE QUEUES\r\n\t\t\t\t\r\n\t\t\t\tExamRoom room = (ExamRoom) roomQueue.remove(); // take the first room from the room list\r\n\t\t\t\tPatientVisit patient = (PatientVisit) arrivalQueue.remove(); // take the first patient from the patient list\r\n\t\t\t\t\r\n\t\t\t\t//MODIFY THE ROOM AND PATIENT AND CAPTURE SOME DATA\r\n\t\t\t\t//PATIENTS\r\n\t\t\t\tpatient.setWaitTime(currentTime - patient.getArrivalTime()); // set the time the patient waited\r\n\t\t\t\tpatient.setDepartureTime(currentTime + patient.getDuration()); // set the departure time of the patient equal to arrival time + duration of appointment\r\n\t\t\t\ttreatedPatients.add(patient.deepCopy()); // add a copy of this patient to a queue for treated patients to preserve its wait time and urgency (for data collection purposes)\r\n\t\t\t\tpatient.setUrgency(10); // set each patient to lowest priority once in treatment room (allows them to be compared based on departure time)\r\n\t\t\t\tpatient.setArrivalTime(0); // set each arrival time to 0 once in treatment room (allows them to be compared based on departure time)\r\n\t\t\t\tdepartureQueue.insert(patient); // add patient to departure queue to be sorted by departure time\r\n\t\t\t\t\r\n\t\t\t\t//ROOMS\r\n\t\t\t\troom.setInUseTime(room.getInUseTime() + patient.getDuration()); // add the duration of the patient's treatment to the in-use time of the room\r\n\t\t\t\troom.setPatientNum(room.getPatientNum() + 1); // increase the number of patients treated in the room by 1\r\n\t\t\t\troom.setDepartureTime(patient.getDepartureTime()); // set departure time of room to that of patient\r\n\t\t\t\troomsInUse.add(room); // put the rooms in a list for rooms in use\r\n\t\t\t\t\r\n\t\t\t\t//GENERAL DATA\r\n\t\t\t\ttotalPatients ++; //increment number of patients treated\t\t\t\t\r\n\t\t\t\ttotalTreatmentTime += patient.getDuration(); // add the patient's treatment time to the total\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t//GO THROUGH ROOMS AND PATIENTS TO FIND THOSE WHICH ARE DONE\r\n\t\t\t//ROOMS\r\n\t\t\tfor (int i=0; i<roomsInUse.size(); i++) { // look through rooms currently in use\r\n\t\t\t\tExamRoom room = roomsInUse.get(i); // for each room\r\n\t\t\t\tif (room.getDepartureTime() <= currentTime) { // if the departure time is now or has passed\r\n\t\t\t\t\troomsInUse.remove(i); //remove that room from the list of in-use rooms\r\n\t\t\t\t\troomQueue.insert(room); // add it back to the room queue where it will be sorted according to its new in-use time\r\n\t\t\t\t\ti--; // go back one index as the list is now shorter\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t//PATIENTS\t\t\r\n\t\t\twhile (!departureQueue.isEmpty() && ((PatientVisit) departureQueue.front()).getDepartureTime() <= currentTime) { // while the next patient to depart is ready to depart\r\n\t\t\t\tdepartureQueue.remove(); // remove that patient from the departure queue\r\n\t\t\t}\r\n\t\t\tcurrentTime += 1; // increment time 1 minute\r\n\t\t}\r\n\t\t\r\n\t\t//CALCULATE THE AVERAGE WAIT TIMES\r\n\t\tIterator<PatientVisit> treatedPatientsIter = treatedPatients.iterator(); //attach an iterator to the list of treated patients\r\n\t\twhile (treatedPatientsIter.hasNext()) {\r\n\t\t\tPatientVisit currentPatient = treatedPatientsIter.next(); // go through all treated patients\r\n\t\t\tif (currentPatient.getUrgency() >= 1 && currentPatient.getUrgency() <= 4) { // if the patient was high priority\r\n\t\t\t\thighPriorityPatients += 1; // add 1 to total of high priority patients\r\n\t\t\t\thighPriorityWaitTime += currentPatient.getWaitTime(); // add patient's wait time to high priority wait-time total\t\t\t\t\r\n\t\t\t}\r\n\t\t\telse if (currentPatient.getUrgency() >= 9) { //if patient was low priority\r\n\t\t\t\tlowPriorityPatients += 1; //add 1 to total of low priority patients\r\n\t\t\t\tlowPriorityWaitTime += currentPatient.getWaitTime(); // add patient's wait time to low priority wait-time total\t\r\n\t\t\t}\r\n\t\t\ttotalWaitTime += currentPatient.getWaitTime();\r\n\t\t}\r\n\t\tavgHighPriorityWaitTime = highPriorityWaitTime/highPriorityPatients; // calculate the average for high priority patients\r\n\t\tavgLowPriorityWaitTime = lowPriorityWaitTime/lowPriorityPatients; // calculate the average for low priority patients\r\n\t\tavgWaitTime = totalWaitTime/totalPatients;\r\n\t\tavgTreatmentTime = totalTreatmentTime/totalPatients; // calculate overall average treatment time\t\r\n\t\t\r\n\t\t// PRINT THE DATA FOR THE USER\r\n\t\tSystem.out.println();\r\n\t\t//System.out.println(\"total treatment time: \" + totalTreatmentTime);\r\n\t\tSystem.out.println(\"There are \" + roomNum + \" rooms in the system.\");\r\n\t\tSystem.out.println(\"The simulation ran for \" + currentTime/60 + \" hours and \" + currentTime%60 + \" minutes.\");\r\n\t\tSystem.out.println(totalPatients + \" patients were treated in total.\");\r\n\t\tSystem.out.printf(\"The average wait time for treatment was: \" + \"%.2f\" + \" minutes.\\n\", avgWaitTime);\r\n\t\tif (highPriorityPatients > 0) {\r\n\t\t\tSystem.out.printf(\"There were \" + highPriorityPatients + \" patients with urgency 1 to 4 and their average wait time was: \" + \"%.2f\" + \" minutes.\\n\", avgHighPriorityWaitTime);\r\n\t\t}\r\n\t\telse {\r\n\t\t\tSystem.out.printf(\"There were \" + highPriorityPatients + \" patients with urgency 1 to 4 and their average wait time cannot be calculated.\");\r\n\t\t}\r\n\t\tif (lowPriorityPatients > 0) {\r\n\t\t\tSystem.out.printf(\"There were \" + lowPriorityPatients + \" patients with urgency 9 to 10 and their average wait time was: \" + \"%.2f\" + \" minutes.\\n\", avgLowPriorityWaitTime);\r\n\t\t}\r\n\t\telse {\r\n\t\t\tSystem.out.printf(\"There were \" + lowPriorityPatients + \" patients with urgency 9 to 10 and their average wait cannot be calculated.\\n\");\r\n\t\t}\r\n\t\tSystem.out.printf(\"The average duration of treatment was: \" + \"%.2f\" + \" minutes.\\n\", avgTreatmentTime);\r\n\t\tfor (int i=0; i<roomNum; i++) {\r\n\t\t\tExamRoom room = (ExamRoom) roomQueue.remove();\r\n\t\t\tint patientNum = room.getPatientNum();\r\n\t\t\tdouble busyTime = room.getInUseTime();\r\n\t\t\tSystem.out.println(patientNum + \" patients were treated in room \" + room.getIdent() + \".\");\r\n\t\t\tSystem.out.printf(\"Room \" + room.getIdent() + \" was busy \" + \"%.2f\" + \" percent of the time.\\n\", (busyTime/currentTime)*100);\r\n\t\t}\r\n\t\tSystem.out.println();\t\t\r\n\t}", "void updateLecture(String day, String time, String subject, String teacher);", "public void passTime(){\n growPop();\n growGdp();\n growSocial();\n growLiving();\n }", "public void addToReminders(Date reminders);", "Notification createNewAppointmentNotification(Appointment appointment);", "private void fillTrackSession(TrackSession trackSession, List<Talk> talks) {\n Calendar currentStartTime = trackSession.getType().startTime;\n for (Iterator<Talk> talksIterator = talks.iterator(); talksIterator.hasNext(); ) {\n Talk talk = talksIterator.next();\n if (trackSession.hasRoomFor(talk)) {\n // add an event to the trackSession at the currentStartTime calculated.\n trackSession.addEvent(new Event(currentStartTime, talk.getTitle(), talk.getMinutes()));\n // calculate the next start time based on the current start time and current talk duration.\n currentStartTime = ConferenceUtils.getNextStartTime(currentStartTime, talk);\n // remove the talk from the list. This means that the talk has been scheduled in the conference.\n talksIterator.remove();\n }\n }\n }", "private void calculatingWakeUp(String wakeUpTime){\n final float MINUTES_PERCENTS=60/100;\n final float TOLLERANCE_WAKING=MINUTES_PERCENTS*50;\n\n sp = context.getSharedPreferences(\"pref_avg_sleep\", Context.MODE_PRIVATE);\n float timeWakeUp=getTime(wakeUpTime);\n double avgTillToday=sp.getFloat(\"avg\",timeWakeUp);\n int learnedDaysTillToday=sp.getInt(\"days\", 0);\n Log.v(\"statistics: days\",learnedDaysTillToday+\"\");\n Log.v(\"statistics: avg\",avgTillToday+\"\");\n Log.v(\"statistics: waking\",timeWakeUp+\"\");\n int isDeviation=0;\n\n //calc th e statistics and update yhe sp\n //update the days (add +1)11\n editor.putInt(\"days\",learnedDaysTillToday+1);\n //update the avg\n float newAvg=(float) (avgTillToday*(learnedDaysTillToday)+timeWakeUp)/(learnedDaysTillToday+1);\n editor.putFloat(\"avg\",newAvg);\n Log.v(\"statistics\",\"end\");\n\n// // TODO: variance\n\n //calc the time to wake him up tomorrow if he did not wake up\n float wakeUpTomorrow=newAvg*TOLLERANCE_WAKING;\n editor.putFloat(\"wakeUpTime\",wakeUpTomorrow);\n editor.apply();\n\n }", "public void run() {\n try {\n arrive();\n\n //Wait for the daily developer standup\n team.getStandupBarrier().await();\n int lunchtime = 2400;\n\n working(lunchtime, false);\n \n int dillyDallyBeforeLunch = rng.nextInt((80 - 10) + 1) + 10;\n Thread.sleep(dillyDallyBeforeLunch);\n \n System.out.println(\"Developer \" + this.getName() +\n \" Goes to lunch at \" + team.getLead().getPM().getClockTime());\n\n int lunchDuration = rng.nextInt((600 - 300) + 1) + 300;\n Thread.sleep(lunchDuration);\n \n System.out.println(\"Developer \" + this.getName() +\n \" Leaves lunch at \" + team.getLead().getPM().getClockTime());\n \n //Go to final meeting somewhere between 4:00 and 4:15\n int workInterval = rng.nextInt((4950 - 4800) + 1) + 4800;\n working(workInterval, false);\n\n System.out.println(\"Developer \" + this.getName() +\n \" Goes to afternoon meeting at \" + team.getLead().getPM().getClockTime());\n \n //Wait for that afternoon meeting to kick off\n team.getLead().getPM().getAfternoonMeetingBarrier().await();\n\n //After the meeting, get ready to go home and end the day\n int dillyDallyBeforeHome = rng.nextInt((150 - 10) + 1) + 10;\n Thread.sleep(dillyDallyBeforeHome);\n\n //Leave after afternoon meeting is complete\n System.out.println(\"Developer \" + this.getName() +\n \" is heading home at \" + team.getLead().getPM().getClockTime());\n\n } catch (Exception e) {\n e.printStackTrace();\n }\n }", "public void checkAttendance() {\n\t\tRandom random = new Random();\n\t\trandomCheck = random.nextInt(3);\n\t\tif (randomCheck == isFullTimePresent) {\n\t\t\tSystem.out.println(\"Employee is Full Time Present \");\n\t\t\tworkingHrs = 8;\n\t\t} else if (randomCheck == isPartTimePresent) {\n\t\t\tSystem.out.println(\"Employee is Part time Present \");\n\t\t\tworkingHrs = 4;\n\t\t} else {\n\t\t\tSystem.out.println(\"Employee is Absent \");\n\t\t\tworkingHrs = 0;\n\t\t}\n\t}", "private void meetWithHrForBenefitAndSalryInfo() {\n metWithHr = true;\n }", "private void syncPostAirportDueTimes()\n {\n resetCounts();\n\n JwMap<String,JwList<AcGlobalPostAirportDueTimes>> globals = getAirportToGlobalPostAirportDueTimesMap();\n JwMap<String,JwList<AcPostAirportDueTimes>> accounts = getAirportToPostAirportDueTimesMap();\n\n JwSet<String> keys = new JwSet<String>();\n keys.addAll(globals.getKeys());\n keys.addAll(accounts.getKeys());\n\n for ( String airportCode : keys )\n {\n JwList<AcGlobalPostAirportDueTimes> gV = globals.get(airportCode);\n JwList<AcPostAirportDueTimes> aV = accounts.get(airportCode);\n syncPostAirportDueTimesForAirport(airportCode, gV, aV);\n }\n logSummary(\"post airport due times\");\n }", "private static void seTimeStamps() {\n MDC.put(MDC_INSTANCE_UUID, \"\");\n MDC.put(MDC_ALERT_SEVERITY, \"\");\n\n var startTime = Instant.now();\n var endTime = Instant.now();\n\n seTimeStamps(startTime, endTime);\n\n MDC.put(PARTNER_NAME, \"N/A\");\n\n MDC.put(STATUS_CODE, COMPLETE_STATUS);\n MDC.put(RESPONSE_CODE, \"N/A\");\n MDC.put(RESPONSE_DESCRIPTION, \"N/A\");\n\n }", "public void appendToReminders(Date reminders);", "@Override\n public void schedulePeriodicNotification(Context context, long time, String title, String text, int period) {\n Notification notification = new Notification(title, text, new Date(time), Long.toString(time));\n notification.setNotificationID(notificationId);\n notification.setRequestCode(requestCode);\n user.addNotification(notification);\n Intent intent = new Intent(context, NotificationReceiver.class);\n intent.putExtra(getString(R.string.title), title);\n intent.putExtra(getString(R.string.text), text);\n intent.putExtra(getString(R.string.notificationid), Integer.toString(notificationId));\n notificationId++;\n PendingIntent pending = PendingIntent.getBroadcast(context, requestCode, intent,\n PendingIntent.FLAG_UPDATE_CURRENT);\n requestCode++;\n AlarmManager manager = (AlarmManager) context.getSystemService(Context.ALARM_SERVICE);\n assert manager != null;\n manager.setInexactRepeating(AlarmManager.RTC_WAKEUP, time,\n AlarmManager.INTERVAL_DAY*period, pending);\n }", "public void clickSchedule(View view) {\n\n final String WorkoutText=WorkoutName.getText().toString();\n\n //Toast.makeText(CalendarActivity.this, WorkoutText, Toast.LENGTH_LONG).show();\n\n Calendar notification = Calendar.getInstance();\n notification.set(Calendar.DAY_OF_MONTH, _day );\n notification.set(Calendar.MONTH, _month);\n notification.set(Calendar.HOUR,_hour);\n notification.set(Calendar.MINUTE, _minute);\n final String date = String.valueOf(_day) + '-' + String.valueOf(_month) + '-' + String.valueOf(_year);\n final String _time = time.getText().toString().replace(\" \",\"\");\n System.out.println(_time);\n final Session session = new Session(this);\n\n\n\n Schedule schedule = new Schedule(session.getUsername(), date, _time, WorkoutText);\n\n OkHttpClient httpClient = new OkHttpClient();\n Retrofit.Builder builder = new Retrofit.Builder()\n .baseUrl(WorkoutAPI.BASE_URL)\n .addConverterFactory(GsonConverterFactory.create())\n .client(httpClient);\n\n Retrofit retrofit = builder.build();\n WorkoutAPI requests = retrofit.create(WorkoutAPI.class);\n\n Call<ResponseBody> call = requests.newSchedulePost(schedule);\n call.enqueue(new Callback<ResponseBody>() {\n @Override\n public void onResponse(Call<ResponseBody> call, Response<ResponseBody> response) {\n\n if(response.code() == 201){\n System.out.println(\"Success\");\n Session session = new Session(CalendarActivity.this);\n session.setDate(date);\n session.setTime(_time);\n session.setWorkout(WorkoutText);\n Intent intent = new Intent(getApplicationContext(),BodyListActivity.class);\n startActivity(intent);\n\n// PendingIntent alarmIntent = PendingIntent.getBroadcast(getApplicationContext(),111,intent,PendingIntent.FLAG_UPDATE_CURRENT);\n//\n// AlarmManager alarmManager = (AlarmManager) getSystemService(ALARM_SERVICE);\n// alarmManager.set(AlarmManager.RTC_WAKEUP, notification.getTimeInMillis(), alarmIntent);\n //include AlarmManager after Millis to set up intervals\n }else{\n System.out.println(\"Failed\");\n }\n }\n\n @Override\n public void onFailure(Call<ResponseBody> call, Throwable t) {\n System.out.println(\"Throws: \" + t);\n }\n\n });\n\n\n\n\n\n\n }", "private void notifyUser(List<String> result) {\r\n\t\t\tif(Util.getProperty(getApplicationContext(),\"notificationTimeChanged\",\"\").equals(\"true\") \r\n\t\t\t\t\t|| !notifiedToday())\r\n\t\t\t{\r\n\t\t\t\tUtil.setProperty(getApplicationContext(), \"notificationTimeChanged\", \"false\");\r\n\t\t\t\tif(result.size() > 0){\r\n\t\t\t\t\tint itemsDue = result.size();\r\n\t\t\t\t\tStringBuffer notificationText = new StringBuffer();\r\n\t\t\t\t\tfor(int i=0; i<itemsDue; i++){\r\n\t\t\t\t\t\tif(i!=0)\r\n\t\t\t\t\t\t\tnotificationText.append(\", \");\r\n\t\t\t\t\t\tnotificationText.append(result.get(i));\t\t\t\t\r\n\t\t\t\t\t}\r\n\t\t\t\t\tContext context = getApplicationContext();\r\n\t\t\t\t\tNotificationManager nm = (NotificationManager)context.getSystemService(NOTIFICATION_SERVICE);\r\n\t\t\t\t\tIntent notificationIntent = new Intent(context,ReminderActivity.class);\r\n\t\t\t\t\tPendingIntent pi = PendingIntent.getActivity(context, 0, notificationIntent,PendingIntent.FLAG_UPDATE_CURRENT | PendingIntent.FLAG_ONE_SHOT);\r\n\t\t\t\t\tNotification n = new Notification.Builder(context)\r\n\t\t\t\t\t.setContentTitle(String.valueOf(itemsDue) + \" Items Due\")\r\n\t\t\t\t\t.setContentText(notificationText.toString())\r\n\t\t\t\t\t.setSmallIcon(R.drawable.ic_launcher)\r\n\t\t\t\t\t//.setLargeIcon(R.drawable.ic_basket)\r\n\t\t\t\t\t.setContentIntent(pi)\r\n\t\t\t\t\t.build();\t \r\n\t\t\t\t\tnm.notify(1, n);\r\n\t\t\t\t}\r\n\t\t\t\tSimpleDateFormat formatter = new SimpleDateFormat(\"dd-MMM-yyyy\",Locale.US);\r\n\t\t\t\tUtil.setProperty(getApplicationContext(), \"ServiceLastRanOn\",formatter.format(new Date()));\r\n\t\t\t}\r\n\t\t}", "public void punchIn(){\n Date currentDate = new Date();\n String currentTime = hoursFormat.format(currentDate);\n String timeString = String.format(\"You have clocked in.\\nThe current time is %s\", currentTime);\n JOptionPane.showMessageDialog(null, timeString, \"Coronos Time Clock\", JOptionPane.INFORMATION_MESSAGE);\n employee.setClockedIn(true);\n JSONArray clockTimes = employee.getClockTimes();\n Date date = new Date();\n long now = date.getTime();\n JSONObject newPunch = new JSONObject();\n newPunch.put(\"in\", now);\n clockTimes.add(newPunch);\n employee.setPunches(clockTimes);\n }", "public void punchOut(){\n Date currentDate = new Date();\n String currentTime = hoursFormat.format(currentDate);\n employee.setClockedIn(false);\n JSONArray clockTimes = employee.getClockTimes();\n Date date = new Date();\n long now = date.getTime();\n int index = clockTimes.size() -1;\n JSONObject newPunch = (JSONObject) clockTimes.get(index);\n long first = (long) newPunch.get(\"in\");\n double pay = employee.calculateForPeriod(first, now);\n newPunch.put(\"out\", now);\n newPunch.put(\"pay\", pay);\n clockTimes.set(index, newPunch);\n employee.setPunches(clockTimes);\n String timeString = String.format(\"You have clocked out.\\nThe current time is %s.\\nYou have been paid $%.2f\", currentTime, pay);\n JOptionPane.showMessageDialog(null, timeString, \"Coronos Time Clock\", JOptionPane.INFORMATION_MESSAGE);\n }", "void setTestAlarm() \n {\n \t// start with now\n java.util.Calendar c = java.util.Calendar.getInstance();\n c.setTimeInMillis(System.currentTimeMillis());\n\n int nowHour = c.get(java.util.Calendar.HOUR_OF_DAY);\n int nowMinute = c.get(java.util.Calendar.MINUTE);\n\n int minutes = (nowMinute + 1) % 60;\n int hour = nowHour + (nowMinute == 0 ? 1 : 0);\n\n saveAlarm(this, mId, true, hour, minutes, mRepeatPref.getDaysOfWeek(),\n true, \"\", mAlarmPref.getAlertString(), true);\n }", "@Override\n public void onClick(View view) {\n Intent intent = new Intent(getApplicationContext(), ReminderBroadcastReceiver.class);\n intent.putExtra(\"notificationText\", reminderData.getNotificationText());\n\n // Create pending intent with time given\n PendingIntent alarmIntent = PendingIntent.getBroadcast(getApplicationContext(), notificationId,\n intent, PendingIntent.FLAG_UPDATE_CURRENT);\n\n // Create AlarmManager which is sent with pending intent\n AlarmManager alarm = (AlarmManager) getSystemService(ALARM_SERVICE);\n // Create time when notification will fire\n Calendar startTime = Calendar.getInstance();\n startTime.set(Calendar.DAY_OF_WEEK, startTime.get(Calendar.DAY_OF_WEEK));\n startTime.set(Calendar.HOUR_OF_DAY, timePicker.getHour());\n startTime.set(Calendar.MINUTE, timePicker.getMinute());\n startTime.set(Calendar.SECOND, 0);\n\n long alarmStartTime = startTime.getTimeInMillis();\n\n\n /* If reminder time is smaller than current time, start notification on next day, still in progress */\n\n /*\n if (startTime.getTimeInMillis() < System.currentTimeMillis()) {\n startTime.set(Calendar.DAY_OF_WEEK, startTime.get(Calendar.DAY_OF_WEEK + 1));\n alarmStartTime = startTime.getTimeInMillis();\n }\n else\n {\n alarmStartTime = startTime.getTimeInMillis();\n }\n */\n\n\n // Set alarm with (type, milliseconds, intent)\n // With RTC_WAKEUP we wake the device up and deliver the pending intent\n alarm.set(AlarmManager.RTC_WAKEUP, alarmStartTime, alarmIntent);\n saveData();\n\n }", "public void doCollectMeeting() {\n\t}", "private void summarizeTimeslot ()\n {\n if (null == brokers) {\n // first time through\n brokers = new ArrayList<>();\n stats = new HashMap<>();\n\n data.print(\"Broker Name,\");\n data.print(\"Power Type,\");\n data.print(\"Customers,\");\n data.print(\"Usage (kWh),\");\n data.println(\"Income Gained\");\n\n // set up the maps of brokers, and stats by power type\n for (Broker broker : brokerRepo.findRetailBrokers())\n {\n brokers.add(broker);\n stats.put(broker, new HashMap<>());\n for (PowerType type : powerTypes)\n {\n StatsTracked theseStats = new StatsTracked();\n HashMap<PowerType, StatsTracked> map = stats.get(broker);\n map.put(type, theseStats);\n stats.put(broker, map);\n }\n }\n\n // store customer statistics\n\n }\n\n if (ttx.size() > 0) {\n // there are some signups and withdraws here\n for (TariffTransaction tx : ttx) {\n Broker broker = tx.getBroker();\n PowerType type = tx.getTariffSpec().getPowerType();\n HashMap<PowerType, StatsTracked> brokerMap = stats.get(broker);\n StatsTracked theseStats = brokerMap.get(type);\n if (tx.getTxType() == TariffTransaction.Type.CONSUME ||\n tx.getTxType() == TariffTransaction.Type.PRODUCE) {\n theseStats.updateUsage(tx.getKWh());\n theseStats.updateProfit(tx.getCharge());\n }\n else if (tx.getTxType() == TariffTransaction.Type.SIGNUP)\n theseStats.updateCustomers(tx.getCustomerCount());\n\n // reupdate the tracking...\n brokerMap.put(type, theseStats);\n stats.put(broker, brokerMap);\n }\n }\n ttx.clear();\n }", "@Test\n public void testViewAppointmentSchedule() {\n for (int i = 0; i < 10; i++) {\n presenter.onViewAppointmentSchedule();\n }\n Assert.assertEquals(10, view.getManageViewAppointmentScheduleClicks());\n }", "public static void main(String[] args) throws ParseException {\n String beginWorkDate = \"8:00:00\";//上班时间\n String endWorkDate = \"12:00:00\";//下班时间\n SimpleDateFormat sdf = new SimpleDateFormat(TimeUtil.DF_ZH_HMS);\n long a = TimeUtil.countMinutes(sdf.parse(beginWorkDate),sdf.parse(endWorkDate));\n System.out.println(a/30);\n\n String beginRestDate = \"8:30:00\";//休息时间\n String endRestDate = \"9:00:00\";\n long e = TimeUtil.countMinutes(sdf.parse(beginWorkDate),sdf.parse(beginRestDate));\n long f = TimeUtil.countMinutes(sdf.parse(beginWorkDate),sdf.parse(endRestDate));\n\n String beginVactionDate = \"10:00:00\";//请假时间\n String endVactionDate = \"11:00:00\";\n long b= TimeUtil.countMinutes(sdf.parse(beginWorkDate),sdf.parse(beginVactionDate));\n long c= TimeUtil.countMinutes(sdf.parse(beginWorkDate),sdf.parse(endVactionDate));\n\n String time = \"9:00:00\";//被别人预约的\n long d = TimeUtil.countMinutes(sdf.parse(beginWorkDate),sdf.parse(time));\n List<Integer> num = new ArrayList<>();\n num.add((int) (d/30));\n\n String myTime = \"11:30:00\";//我约的\n long g = TimeUtil.countMinutes(sdf.parse(beginWorkDate),sdf.parse(myTime));\n List<Integer> mynum = new ArrayList<>();\n mynum.add((int) (g/30));\n\n\n List<Date> yes = new ArrayList<>();//能约\n List<Date> no = new ArrayList<>();//不能约\n List<Date> my = new ArrayList<>();//我约的\n for (int i = 0; i < a/30; i ++) {\n Date times = TimeUtil.movDateForMinute(sdf.parse(beginWorkDate), i * 30);\n System.out.println(sdf.format(times));\n yes.add(times);\n if ((i >= e / 30 && i < f / 30) || (i >= b / 30 && i < c / 30)) {\n //休息时间,请假时间\n no.add(times);\n yes.remove(times);\n continue;\n }\n for (Integer n : num) {\n if (i == n) {\n //被预约时间\n no.add(times);\n yes.remove(times);\n }\n }\n for (Integer n : mynum) {\n if (i == n) {\n //被预约时间\n my.add(times);\n }\n }\n }\n }", "static void setTiming(){\n killTime=(Pars.txType!=0) ? Pars.txSt+Pars.txDur+60 : Pars.collectTimesB[2]+Pars.dataTime[1]+60;//time to kill simulation\n tracksTime=(Pars.tracks && Pars.txType==0) ? Pars.collectTimesI[1]:(Pars.tracks)? Pars.collectTimesBTx[1]:100*24*60;//time to record tracks\n }", "public void activateInterArrivalTimeTally() {\n\t\tactivateInterArrivalTimeTally(false);\n\t}", "@Override\r\n\tpublic void ticketing(User user, Seat seat, Performance pfm) {\n\t\t\r\n\t}", "@Scheduled(fixedRateString = \"PT120M\")\n\tvoid someJob(){\n//\t\tString s = \"Testing message.\\nNow time is : \"+new Date();\n////\t\tSystem.out.println(s);\n//\t\tPushNotificationOptions.sendMessageToAllUsers(s);\n//\n\t\t//get all schedules in current dayOfWeek\n\t\tCollection<Notification> notifications = notificationService.findAllByDayOfWeekAndTime();\n\t\tfor(Notification notification : notifications){\n//\t\t\tSystem.out.println(notification.toString());\n//\t\t\tSystem.out.println(!notification.getStatus());\n////\t\t\tSystem.out.println(check(notification.getStartTime()));\n//\t\t\t//check for already not sent notifications , also check for time difference < TIME_CONSTANT\n//\t\t\tif(!notification.getStatus() && check(notification.getStartTime())){\n//\t\t\t\t//send push notification\n//\t\t\t\tPushNotificationOptions.sendMessageToAllUsers(notification.getMessage());\n//\t\t\t\t//mark the notification as sent\n//\t\t\t\tnotificationService.setStatus(notification.getNotificationId());\n//\t\t\t}\n\t\t\tif(checkForDayTime()){\n\t\t\t\tPushNotificationOptions.sendMessageToAllUsers(notification.getMessage());\n\t\t\t\tnotificationService.setStatus(notification.getNotificationId());\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\n\t}", "public void setReminder(Context context, String type, String time, String message){\n AlarmManager alarmManager = (AlarmManager)context.getSystemService(Context.ALARM_SERVICE);\n Intent intent = new Intent(context, ReminderReceiver.class);\n intent.putExtra(EXTRA_MESSAGE,message);\n intent.putExtra(EXTRA_TYPE,type);\n String timeArray[] = time.split(\":\");\n Calendar calendar = Calendar.getInstance();\n calendar.set(Calendar.HOUR_OF_DAY,Integer.parseInt(timeArray[0]));\n calendar.set(Calendar.MINUTE,Integer.parseInt(timeArray[1]));\n calendar.set(Calendar.SECOND,0);\n\n int requestCode = NOTIF_ID_REMINDER;\n PendingIntent pendingIntent = PendingIntent.getBroadcast(context,requestCode,intent,0);\n alarmManager.setInexactRepeating(AlarmManager.RTC_WAKEUP, calendar.getTimeInMillis(), AlarmManager.INTERVAL_DAY, pendingIntent);\n\n Toast.makeText(context,\"Reminder berhasil disimpan\",Toast.LENGTH_SHORT).show();\n }", "public void imminentAppointment(String username) throws SQLException {\n this.currentUser = username;\n ObservableList<Appointment> allAppointments = dbQuery.getAllAppointments();\n ObservableList<User> allUsers = dbQuery.getAllUsers();\n Appointment imminentAppointment = null;\n User user = null;\n //get username entered at login\n for(User u : allUsers){\n if(u.getUserName().equals(username)){\n user = u;\n }\n }\n //get possible appointment within 15 minutes\n for(Appointment a : allAppointments){\n long timeDifference = ChronoUnit.MINUTES.between(LocalDateTime.now(), a.getAppointmentStart());\n assert user != null;\n if(a.getUserID() == user.getUserID() && timeDifference > 0 && timeDifference <= 15) {\n imminentAppointment = a;\n }\n }\n\n //display message in dialog box if there is an imminent appointment.\n if(imminentAppointment != null){\n LocalDate appointmentDate = imminentAppointment.getAppointmentStart().toLocalDate();\n LocalTime appointmentTime = imminentAppointment.getAppointmentStart().toLocalTime();\n Alert alert = new Alert(Alert.AlertType.INFORMATION);\n alert.setTitle(\"Upcoming Appointment\");\n alert.setHeaderText(\"You have an appointment within 15 minutes.\");\n alert.setContentText(\"Appointment ID: \" + imminentAppointment.getAppointmentID() + \"\\n\" +\n \" Date: \" + appointmentDate + \"\\n\" +\n \" Time: \" + appointmentTime);\n alert.showAndWait();\n }\n //if no appointment was found, display no upcoming appointment reminder\n else {\n Alert alert = new Alert(Alert.AlertType.INFORMATION);\n alert.setTitle(\"Upcoming Appointment\");\n alert.setHeaderText(\"You have no upcoming appointments.\");\n alert.showAndWait();\n }\n\n }", "public static void Test4Out(){\n System.setProperty(\"webdriver.chrome.driver\", \"src/test/resources/chromedriver.exe\");\n HashMap<String, Object> map = new HashMap<String, Object>();\n map.put(\"profile.default_content_setting_values.notifications\", 2);\n ChromeOptions options = new ChromeOptions();\n options.setExperimentalOption(\"prefs\", map);\n WebDriver driver = new ChromeDriver();\n driver.manage().window().maximize();\n driver.manage().timeouts().implicitlyWait(30, TimeUnit.SECONDS);\n driver.get(\"https://opensource-demo.orangehrmlive.com/\");\n\n //login\n Login(driver);\n //PunchIn\n Punch(driver);\n\n SoftAssert softAssert = new SoftAssert();\n WebElement date = driver.findElement(By.xpath(\"//*[@id = 'attendance_date']\"));\n WebElement time = driver.findElement(By.xpath(\"//*[@id = 'attendance_time']\"));\n WebElement note = driver.findElement(By.xpath(\"//*[@id = 'attendance_note']\"));\n WebElement btnPunch = driver.findElement(By.xpath(\"//*[@id = 'btnPunch']\"));\n\n //data testing\n String urlTujuan = \"https://opensource-demo.orangehrmlive.com/index.php/attendance/punchIn\";\n CharSequence[] test = new String[10];\n test[0] = \"\"; //coba String kosong\n test[1] = \"a\"; //coba isi char\n test[2] = \"aa:bb\"; //coba isi alfabet\n test[3] = \"a1:b2\"; //coba isi alpanumerik\n test[4] = \"@@:$$\"; //coba isi simbol\n test[5] = \"1212\"; //coba angka tanpa pemisah\n test[6] = \"25:00\"; //coba jam 25\n test[7] = \"-10:00\"; //coba jam minus\n test[8] = \"12:61\"; //coba menit 61\n test[9] = \"12:-10\"; //coba menit minus\n\n //coba input time\n for (int i=0; i<test.length; i++){\n time.clear();\n CharSequence temp = test[i];\n System.out.println(\"testing test case ke:\"+(i+1)+\", isi test case : \"+temp);\n time.sendKeys(temp);\n btnPunch.click();\n System.out.println(driver.getCurrentUrl());\n softAssert.assertEquals(driver.getCurrentUrl(), urlTujuan, \"test ke-\"+(i+1)+\" gagal\");\n// try {\n// Thread.sleep(2000);\n// } catch (InterruptedException e) {\n// e.printStackTrace();\n// }\n }\n btnPunch.click();\n if (driver.getCurrentUrl().equals(urlTujuan) == false){\n //input data valid agar tidak stuck di PunchOut\n System.out.println(\"input\");\n String tanggal = \"2021-06-14\";\n String jam = \"12:10\";\n\n date.clear();\n time.clear();\n date.sendKeys(tanggal);\n time.sendKeys(jam);\n note.sendKeys(\"test out 4\");\n btnPunch.click();\n }\n driver.quit();\n softAssert.assertAll();\n }", "public void activateInterArrivalTimeTally(\n\t\t\tClass<? extends Reporter> reporterClass,\n\t\t\tboolean showTimeSpansInReport) {\n\t\tthis._interArrivalTimeActivated = true;\n\n\t\tif (_interArrivalTally == null) {\n\t\t\t_interArrivalTally = new Tally(this.getModel(), this.getName()\n\t\t\t\t\t+ \" Interarrivaltime\", this.reportIsOn(), this.traceIsOn());\n\t\t\t_interArrivalTally.setShowTimeSpansInReport(showTimeSpansInReport);\n\t\t\tif (reporterClass != null)\n\t\t\t\t_interArrivalTally.setReporter(reporterClass);\n\t\t\t\n\t\t\tSchedulable schedulable = getCorrespondingSchedulable();\n\t\t\t\n\t\t\tif (schedulable != null)\n\t\t\t\t_interArrivalTally.setCorrespondingSchedulable(schedulable);\n\t\t}\n\t}", "private List<Conference> allocateTrackOnePm(List<Conference> listTemp2) {\r\n\t\tint sum3 = 0;\r\n\t\tList<Conference> listTemp3 = new LinkedList<Conference>();\r\n\t\tlistTemp3.addAll(listTemp2);\r\n\t\twhile (sum3 < PM_MINUTES_MIN || sum3 > PM_MINUTES_MAX) {\r\n\t\t\tInteger index = random.nextInt(listTemp3.size());\r\n\t\t\tConference ele = listTemp3.get(index);\r\n\t\t\tlistTemp3.remove((int)index);\r\n\t\t\tsuper.trackOnePm.add(ele);\r\n\t\t\tsum3 += ele.getTimeDuration();\r\n\t\t}\r\n\t\tsuper.trackOnePm.add(new Conference(\"Networking Event\", \"Networking Event\", 0));\r\n\t\treturn listTemp3;\r\n\t}", "@Test\n\tpublic void test07() throws Throwable {\n\t\tAppt appt = new Appt( 1, 1, 1, 1, 1, null, null);\n\n\t\t//Construct a new Appointment object with the initial data\n\t\tAppt apptS = new Appt( 1,1,1,1,1, \" \", \" \");\n\n\t\tGregorianCalendar cal = new GregorianCalendar();\n\t\tcal.set(2000, 3, 10, 10, 10 , 15);\n\n\t\tCalDay calDay = new CalDay(cal);\n\t\tcalDay.addAppt(appt);\n\t\tcalDay.addAppt(apptS);\n\n\t\tGregorianCalendar gCal = new GregorianCalendar();\n\t\tgCal.set(2000, 3, 11, 11, 11, 11);\n\n\t\tGregorianCalendar goCal = new GregorianCalendar();\n\t\tgCal.set(2020, 5, 15, 15, 15, 15);\n\n\t\tTimeTable timeTable = new TimeTable();\n\t\tassertNotEquals(null, timeTable.getApptRange(calDay.getAppts(), cal, gCal));\n\t\tassertNotEquals(null, timeTable.getApptRange(calDay.getAppts(), cal, goCal));\n\t\tassertNotEquals(null, timeTable.deleteAppt(calDay.getAppts(), appt));\n\n\t\t//Construct a new Appointment object with the initial data\n\t\tAppt apptY = new Appt(150, 150, 150, 150, 150, \"a\", \"a\");\n\n\n\t\tassertEquals(null, timeTable.deleteAppt( calDay.getAppts(), apptY ) );\n\t\tcalDay.addAppt(apptY);\n\n\t\tassertNotEquals(null, timeTable.getApptRange(calDay.getAppts(), cal, gCal));\n\t\tassertEquals(null, timeTable.deleteAppt(null, null ) );\n\t\tassertEquals(null, timeTable.deleteAppt(calDay.getAppts(), null ) );\n\n\t\tapptY = new Appt( -1, -1, -1, -1, -1, \"lol\", \"not today\");\n\n\t\tassertEquals(null, timeTable.deleteAppt( calDay.getAppts(), apptY ) );\n\t\tcalDay.addAppt(apptY);\n\t}", "public void setNotifications(ArrayList<TaskModel> temp, Context context){\n if (temp.isEmpty()) {\n return;\n }\n TaskModel t = temp.get(0);\n\n //Add counter and t.getTimeLeft()(in some fucked up value);\n int toAdd = (int)t.getTimeLeft() / 1000 / 60;\n AlarmManager manager = (AlarmManager) context.getSystemService(Context.ALARM_SERVICE);\n Intent intent= new Intent(context, NotificationReceiver.class);\n intent.putExtra(\"content\", t.getTitle());\n PendingIntent alarmIntent = PendingIntent.getBroadcast(context, 0, intent, PendingIntent.FLAG_UPDATE_CURRENT);\n Calendar c = Calendar.getInstance();\n c.add(Calendar.MINUTE, (toAdd));\n long time = c.getTimeInMillis();\n manager.set(AlarmManager.RTC_WAKEUP, time, alarmIntent);\n //set task for deletion\n final TaskModel toDelete = t;\n Handler timerHandler = new Handler();\n Runnable timerRunnable = new Runnable(){\n @Override\n public void run(){\n deleteTask(tasks, toDelete);\n }\n };\n timerHandler.postDelayed(timerRunnable, time - 100);\n\n // counter += toAdd;\n }", "@Override\n public void run() {\n\n try {\n LocalDateTime now = LocalDateTime.now();\n voda bot = new voda();\n\n List<Integer> notifyTime = Arrays.asList(7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23);\n int currentHour = now.getHour();\n\n ArrayList<Integer> consulted = dbmodel.MysqlCon.getFollowers();\n\n for (Integer ntime : notifyTime) {\n if (ntime == currentHour) {\n for (Integer consultedUser : consulted) {\n bot.sendTextToIdMessage(consultedUser, dbmodel.MysqlCon.getEveryDayWaterUserWaterCountView(consultedUser));\n }\n }\n }\n\n\n } catch (Exception e) {\n System.out.println();\n }\n }", "private void updateNonRecurringSchedule() {\n int pos = scheduleSpinner.getSelectedItemPosition();\n PHSchedule schedule = nonRecurringSchedules.get(pos);\n\n String timerName = editTvScheduleName.getText().toString().trim();\n if (timerName.length() != 0) {\n schedule.setName(timerName);\n }\n\n if (timeToSend == null) {\n PHWizardAlertDialog.showErrorDialog(\n PHUpdateNonRecurringScheduleActivity.this, getResources()\n .getString(R.string.txt_empty_time),\n R.string.btn_ok);\n return;\n } else {\n schedule.setDate(timeToSend);\n\n }\n\n String lightIdentifier = null;\n String groupIdentifier = null;\n if (rbLightForSchedule.isChecked()) {\n int lightPos = lightSpinner.getSelectedItemPosition();\n PHLight light = lights.get(lightPos);\n lightIdentifier = light.getIdentifier();\n schedule.setLightIdentifier(lightIdentifier);\n schedule.setGroupIdentifier(null);\n\n } else if (rbGroupForSchedule.isChecked()) {\n int groupPos = groupSpinner.getSelectedItemPosition();\n PHGroup group = groups.get(groupPos);\n groupIdentifier = group.getIdentifier();\n schedule.setGroupIdentifier(groupIdentifier);\n schedule.setLightIdentifier(null);\n }\n\n if (stateToSend != null) {\n schedule.setLightState(stateToSend);\n }\n\n String timerDescription = editTvScheduleDescriptor.getText().toString()\n .trim();\n\n if (timerDescription.length() != 0) {\n schedule.setDescription(timerDescription);\n }\n\n String timerRandomTime = editTvScheduleRandomTime.getText().toString()\n .trim();\n if (timerRandomTime.length() != 0) {\n schedule.setRandomTime(Integer.parseInt(timerRandomTime));\n }\n\n final PHWizardAlertDialog dialogManager = PHWizardAlertDialog\n .getInstance();\n dialogManager.showProgressDialog(R.string.sending_progress,\n PHUpdateNonRecurringScheduleActivity.this);\n\n bridge.updateSchedule(schedule, new PHScheduleListener() {\n\n @Override\n public void onSuccess() {\n\n dialogManager.closeProgressDialog();\n PHUpdateNonRecurringScheduleActivity.this.runOnUiThread(new Runnable() {\n public void run() {\n if (isCurrentActivity()) { \n PHWizardAlertDialog.showResultDialog(PHUpdateNonRecurringScheduleActivity.this, getString(R.string.txt_timer_updated), R.string.btn_ok, R.string.txt_result);\n }\n }\n });\n \n }\n\n @Override\n public void onStateUpdate(\n Hashtable<String, String> successAttribute,\n List<PHHueError> errorAttribute) {\n // TODO Auto-generated method stub\n }\n\n @Override\n public void onError(int code, final String msg) {\n dialogManager.closeProgressDialog();\n Log.v(TAG, \"onError : \" + code + \" : \" + msg);\n PHUpdateNonRecurringScheduleActivity.this.runOnUiThread(new Runnable() {\n public void run() {\n if (isCurrentActivity()) { \n PHWizardAlertDialog.showErrorDialog(PHUpdateNonRecurringScheduleActivity.this, msg,R.string.btn_ok);\n }\n }\n });\n \n }\n });\n }", "@Override\n public void onClick(View v) {\n\n title = mTitle.getText().toString();\n details = mDetails.getText().toString();\n repeats = 0;\n date.setHours(hour);\n date.setMinutes(minute);\n try {\n repeats = Integer.parseInt(mRepeats.getText().toString());\n } catch (NumberFormatException io){\n\n }\n if (mSpinner.getSelectedItem().toString().equals(\"Days\")) {\n repeats = repeats*24*60;\n }\n else if (mSpinner.getSelectedItem().toString().equals(\"Hours\")) {\n repeats = repeats*60;\n }\n Assignment newAssignment = new Assignment(title, details, repeats, date);\n AssignmentList.get(getActivity()).addAssignment(newAssignment);\n //Calendar c = Calendar.getInstance();\n //c.setTime(date);\n mScheduleClient.setAlarmForNotification(newAssignment); // tell service to set alarm for this date\n // (talks to client which then talks to service)\n if (mScheduleClient!=null) {\n mScheduleClient.doUnbindService();\n }\n getActivity().finish();\n\n }", "@Override\n\tpublic void waitCheck(double hours) {\n\t\t\n\t}", "@Override\n\tpublic void waitCheck(double hours) {\n\t\t\n\t}", "private void retrieveNotification() { =====================================================\n // Creating Notification Model\n // =====================================================\n\n// Bitmap patientAvatar1 = BitmapFactory.decodeResource(getResources(), R.drawable.avatar_18);\n// Bitmap patientAvatar2 = BitmapFactory.decodeResource(getResources(), R.drawable.avatar_19);\n// Bitmap patientAvatar3 = BitmapFactory.decodeResource(getResources(), R.drawable.avatar_20);\n//\n// Patient patient1 = new Patient(\"Garry\", \"Reese\", \"123AB456\", patientAvatar1);\n// Patient patient2 = new Patient(\"Lillian\", \"Wade\", \"987CD654\", patientAvatar2);\n// Patient patient3 = new Patient(\"Laura\", \"Freeman\", \"AV12G64\", patientAvatar3);\n//\n// Bitmap caregiverAvatar1 = BitmapFactory.decodeResource(getResources(), R.drawable.avatar_01);\n// Bitmap caregiverAvatar2 = BitmapFactory.decodeResource(getResources(), R.drawable.avatar_02);\n// Bitmap caregiverAvatar3 = BitmapFactory.decodeResource(getResources(), R.drawable.avatar_03);\n// Bitmap caregiverAvatar4 = BitmapFactory.decodeResource(getResources(), R.drawable.avatar_04);\n// Bitmap caregiverAvatar5 = BitmapFactory.decodeResource(getResources(), R.drawable.avatar_05);\n//\n// DateTime date1 = DateTime.now();\n// DateTime date2 = DateTime.now().minusDays(2).minusHours(2);\n// DateTime date3 = DateTime.now().minusDays(5).plusHours(1);\n// DateTime date4 = DateTime.now().minusDays(4).minusHours(2);\n// DateTime date5 = DateTime.now().minusDays(1).plusHours(1);\n// DateTime date6 = DateTime.now().minusDays(3).plusHours(5);\n//\n// String caregiverName1 = \"John Doe\";\n// String caregiverName2 = \"Jane Doe\";\n// String caregiverName3 = \"Tracy Lee\";\n// String caregiverName4 = \"Apple Tan\";\n// String caregiverName5 = \"Bethany Mandler\";\n//\n// String summary1 = \"Updated information of patient Garry Reese\";\n// String summary2 = \"Log new problem for patient Lilian Wade\";\n// String summary3 = \"Create new patient Laura Freeman\";\n// String summary4 = \"Recommended the game category memory to patient Garry Reese\";\n// String summary5 = \"Updated the milk allergy of patient Lillian Wade\";\n// String summary6 = \"Log new problem for patient Garry Reese\";\n//\n// Notification notification1 = new Notification(date1, caregiverName1, caregiverAvatar1, summary1, patient1, Notification.STATUS_NONE, Notification.TYPE_UPDATE_INFO_FIELD);\n// Notification notification2 = new Notification(date2, caregiverName2, caregiverAvatar2, summary2, patient2, Notification.STATUS_NONE, Notification.TYPE_NEW_INFO_OBJECT);\n// Notification notification3 = new Notification(date3, caregiverName3, caregiverAvatar3, summary3, patient3, Notification.STATUS_NONE, Notification.TYPE_NEW_PATIENT);\n// Notification notification4 = new Notification(date4, caregiverName4, caregiverAvatar4, summary4, patient1, Notification.STATUS_NONE, Notification.TYPE_GAME_RECOMMENDATION);\n// Notification notification5 = new Notification(date5, caregiverName5, caregiverAvatar5, summary5, patient2, Notification.STATUS_NONE, Notification.TYPE_UPDATE_INFO_OBJECT);\n// Notification notification6 = new Notification(date6, caregiverName3, caregiverAvatar3, summary6, patient1, Notification.STATUS_NONE, Notification.TYPE_NEW_INFO_OBJECT);\n//\n ArrayList<Notification> notificationList = new ArrayList<>();\n//// notificationList.add(notification1);\n//// notificationList.add(notification2);\n//// notificationList.add(notification3);\n//// notificationList.add(notification4);\n//// notificationList.add(notification5);\n//// notificationList.add(notification6);\n\n dbfile db = new dbfile();\n notificationList = db.prepareNotificationList(getApplicationContext());\n Log.v(\"WHY LIKE THAT\", String.valueOf(notificationList.size()));\n // =====================================================\n // Building the Notification Group based on the notification\n // =====================================================\n\n HashMap patientAndNotificationGroupMap = new HashMap();\n\n for(Notification notification:notificationList) {\n Patient currentPatient = notification.getAffectedPatient();\n String patientNric = currentPatient.getNric();\n\n if (patientAndNotificationGroupMap.containsKey(patientNric)) {\n NotificationGroup notifGroup = (NotificationGroup) patientAndNotificationGroupMap.get(patientNric);\n if(notification.getStatus() == Notification.STATUS_NONE) {\n notifGroup.getUnprocessedNotif().add(notification);\n } else {\n notifGroup.getProcessedNotif().add(notification);\n }\n } else {\n NotificationGroup newNotifGroup = new NotificationGroup();\n newNotifGroup.setAffectedPatient(currentPatient);\n if(notification.getStatus() == Notification.STATUS_NONE) {\n newNotifGroup.getUnprocessedNotif().add(notification);\n } else {\n newNotifGroup.getProcessedNotif().add(notification);\n }\n patientAndNotificationGroupMap.put(patientNric, newNotifGroup);\n }\n }\n\n ArrayList<NotificationGroup> notificationGroupList = new ArrayList<>();\n NotificationComparator comparator = new NotificationComparator();\n for (Object obj : patientAndNotificationGroupMap.values()) {\n NotificationGroup notificationGroup = (NotificationGroup) obj;\n\n // Set notification status\n UtilsUi.setNotificationGroupStatus(this, notificationGroup);\n\n // Sort the notifications by date\n Collections.sort(notificationGroup.getProcessedNotif(), comparator);\n Collections.sort(notificationGroup.getUnprocessedNotif(), comparator);\n\n // Set the summary\n UtilsUi.setNotificationGroupSummary(this, notificationGroup);\n\n notificationGroupList.add(notificationGroup);\n }\n\n DataHolder.setNotificationGroupList(notificationGroupList);\n }", "protected void processStartedObserving(int gameNumber, String whiteName, String blackName, int wildNumber, String ratingCategoryString,\n boolean isRated, int whiteInitial, int whiteIncrement, int blackInitial, int blackIncrement, boolean isPlayedGame, String exString,\n int whiteRating, int blackRating, long gameID, String whiteTitles, String blackTitles, boolean isIrregularLegality,\n boolean isIrregularSemantics, boolean usesPlunkers, String fancyTimeControls) {\n if (!isPlayedGame) {\n return;\n }\n Player whitePlayer = tournamentService.findPlayer(whiteName);\n Player blackPlayer = tournamentService.findPlayer(blackName);\n if (whitePlayer == null) return;\n if (blackPlayer == null) return;\n Game game = tournamentService.findGame(gameNumber);\n if (game == null) {\n alertManagers(\"A game has started on an unpredicted board: {0} - {1} {2}\", gameNumber, whiteName, blackName);\n game = tournamentService.findPlayerGame(whitePlayer);\n }\n if (game == null) {\n alertManagers(\"I am totally confused. I don't have a scheduled game for: {0} {1}\", whiteName, blackName);\n return;\n }\n tournamentService.updateGameStatus(game, GameState.PLAYING);\n tournamentService.flush();\n game.needsAnnounce = true;\n game.whitePlayer = whitePlayer;\n game.blackPlayer = blackPlayer;\n game.observerCountCurrent = 0;\n command.spoof(\"ROBOadmin\", \"observe {0}\", gameNumber);\n command.sendAdminCommand(\"spoof {0} set busy 2\", whitePlayer);\n command.sendAdminCommand(\"spoof {0} set busy 2\", blackPlayer);\n command.qsuggest(\"USCLTD\", \"observe {0}\", gameNumber);\n command.sendAdminCommand(\"spoof {0} ;-notify USCL; +notify USCLTD\", whitePlayer);\n command.sendAdminCommand(\"spoof {0} ;-notify USCL; +notify USCLTD\", blackPlayer);\n /* Announcement will occur when the move list arrives, since we can then tell if it's a resumed game. */\n }", "public static void scheduleRepeatingElapsedNotification15(Context context) {\n\n\n // Setting intent to class where notification will be handled\n Intent intent = new Intent(context, AlarmReceiver.class);\n\n // Setting pending intent to respond to broadcast sent by AlarmManager everyday at 8am\n alarmIntentElapsed = PendingIntent.getBroadcast(context, ALARM_TYPE_ELAPSED, intent, PendingIntent.FLAG_UPDATE_CURRENT);\n\n // Getting instance of AlarmManager service\n alarmManagerElapsed = (AlarmManager)context.getSystemService(ALARM_SERVICE);\n\n // Daily inexact alarm from phone boot - current set to test for 10 seconds\n alarmManagerElapsed.setInexactRepeating(AlarmManager.ELAPSED_REALTIME, SystemClock.elapsedRealtime(), 60000 * 15, alarmIntentElapsed);\n }", "protected final void generateUsageHours() {\n //Create a treeset to store generated usage hours\n //Provide set with Timed event comparator to sort usage hours\n //according to start times\n usageHours = new TreeSet<ApplianceTimedEvent>(new TimedEventComparator());\n\n Random r = new Random();\n\n //Determine how many rules should be generated\n int numberOfRules = r.nextInt(maxNumberOfRules);\n\n\n\n //Generate rules\n for (int x = 0; x < numberOfRules; x++) {\n int useDuration = 1 + r.nextInt(duration); // at least 1 hour long\n int day = r.nextInt(7);\n Time usageStartTime = Time.random(new Time(earliestUsageStart, day), new Time(latestUsageStart, day));\n\n\n Time currentTime = universe.getUniverseTime();\n /*BUG FIX by Darius... The generated time was in the past so we need to make sure\n the new TimedEvent is in the future. I have added this code to adjust it therefore.*/\n if(usageStartTime.compare(currentTime) < 0){\n\n usageStartTime = new Time(usageStartTime.getCurrentHour(), usageStartTime.getCurrentDay());\n if(usageStartTime.compare(currentTime) < 0) usageStartTime = usageStartTime.advanceTime(new Time(0,0,1,0,0));\n }\n\n Time usageEndTime = usageStartTime.clone();\n\n usageEndTime = usageEndTime.advanceTime(new Time(useDuration, 0, 0, 0, 0));\n\n //Create timed event for usage hour\n ApplianceTimedEvent ate = new ApplianceTimedEvent(this,\n usageStartTime,\n usageEndTime,\n new ApplianceUseCommand(this),\n new Time(0, 1 + r.nextInt(6)) // random day repeat\n );\n \n //Randomly give usage hours a maximum number of runs value\n if(r.nextBoolean()) ate.setNumberOfRuns(r.nextInt(MAX_RUNS));\n //add to usage hours the generated appliance timed event\n usageHours.add(ate);\n }\n\n //If the number of rules to be generated was zero call method again\n if(usageHours.isEmpty()) generateUsageHours();\n\n }", "public void startAlarm() {\n AlarmManager manager = (AlarmManager) getSystemService(Context.ALARM_SERVICE);\n\n Calendar calendar = Calendar.getInstance();\n\n // Set alarm only if the remained time is over 10 minutes\n if (time >10 ) {\n //TODO: Change to ((time * 60000) - 600000) for 10 minutes before\n calendar.setTimeInMillis((System.currentTimeMillis() + ((time * 1000)) - 10000)); // Alarm set to 10 sec before the booking\n\n Log.d(TAG, \"current time = \" + new Date().toLocaleString());\n// Log.d(TAG, \"current time = \" + System.currentTimeMillis());\n Log.d(TAG, \"Alarm set at = \" + calendar.getTime());\n\n /* no Repeat */\n manager.setRepeating(AlarmManager.RTC_WAKEUP, calendar.getTimeInMillis(),\n 0, pendingIntent);\n }\n\n }", "private void setHeartRateMonitor()\n {\n\n Calendar cal = Calendar.getInstance();\n Date now = new Date();\n cal.setTime(now);\n\n long alarm_time = cal.getTimeInMillis();\n\n// if(cal.before(Calendar.getInstance()))\n// alarm_time += 60*1000;\n\n AlarmManager alarmManager = (AlarmManager) getSystemService(Context.ALARM_SERVICE);\n\n Intent intent = new Intent(this, HeartRateMonitor.class);\n\n PendingIntent pendingIntent = PendingIntent.getBroadcast(this, HEART_RATE_MONITOR_REQUEST_CODE, intent,PendingIntent.FLAG_UPDATE_CURRENT);\n\n alarmManager.setRepeating(AlarmManager.RTC_WAKEUP, alarm_time,90000, pendingIntent);\n\n Log.i(\"hrmonitor\",\"hrmonitor alarm set\");\n }", "@Test\n public void testMaybeScheduleStartAlarmLocked_SmallRollingQuota_UpdatedAllowedTime() {\n setDeviceConfigLong(QcConstants.KEY_ALLOWED_TIME_PER_PERIOD_WORKING_MS,\n mQcConstants.ALLOWED_TIME_PER_PERIOD_WORKING_MS / 2);\n\n runTestMaybeScheduleStartAlarmLocked_SmallRollingQuota_AllowedTimeCheck();\n mQuotaController.getTimingSessions(SOURCE_USER_ID, SOURCE_PACKAGE).clear();\n runTestMaybeScheduleStartAlarmLocked_SmallRollingQuota_MaxTimeCheck();\n }", "public void addNotificationAlarm() {\n // get hour and minute from time preference\n SharedPreferences settingsPrefs = PreferenceManager.getDefaultSharedPreferences(this);\n String time = settingsPrefs.getString(SettingsActivity.KEY_NOTIFICATION_TIME, TimePreference.DEFAULT_TIME);\n final int notificationHour = TimePreference.getHourFromString(time);\n final int notificationMinute = TimePreference.getMinuteFromString(time);\n\n // build DateTime for next alarm\n ZonedDateTime notificationTime = ZonedDateTime.now()\n .truncatedTo(ChronoUnit.DAYS)\n .plusHours(notificationHour)\n .plusMinutes(notificationMinute);\n\n if (notificationTime.isBefore(ZonedDateTime.now())) {\n notificationTime = notificationTime.plusDays(1);\n }\n\n // create alarm\n AlarmManager am = (AlarmManager) getSystemService(ALARM_SERVICE);\n am.setInexactRepeating(AlarmManager.RTC_WAKEUP,\n notificationTime.toInstant().toEpochMilli(),\n AlarmManager.INTERVAL_DAY,\n buildAlarmPendingIntent());\n\n // too ensure alarm is recreated if device is restarted\n setBootReceiverEnabled(true);\n }", "@Test\n public void testAddBookedTimeInterval() {\n TimeInterval workingTime=new TimeInterval(new DateTime(2019, 8, 27, 9, 0), new DateTime(2019, 8, 27, 12, 0));\n TimeInterval bookedTime1=new TimeInterval(new DateTime(2019, 8, 27, 10, 0), new DateTime(2019, 8, 27, 11, 0));\n TimeInterval bookedTime2=new TimeInterval(new DateTime(2019, 8, 27, 9, 0), new DateTime(2019, 8, 27, 9, 30));\n TimeInterval bookedTime3=new TimeInterval(new DateTime(2019, 8, 27, 11, 30), new DateTime(2019, 8, 27, 12, 0));\n ArrayList<TimeInterval> freeTime=new ArrayList<>();\n freeTime.add(workingTime);\n TimeManager manager=new TimeManager(freeTime);\n manager.addBookedTimeInterval(bookedTime1);\n System.out.println(manager);\n manager.addBookedTimeInterval(bookedTime2);\n System.out.println(manager);\n manager.addBookedTimeInterval(bookedTime3);\n System.out.println(manager);\n }", "ConferenceScheduleBuilderService endLunch();", "private void updateSimState(Date currentSimDateTime){\n\n SimpleDateFormat ft =\n new SimpleDateFormat(\"E yyyy.MM.dd 'at' hh:mm:ss a\");\n String simDateTime = ft.format(currentSimDateTime);\n\n\n for(Person person : entirePopulation){\n for (Task task : person.getSchedule().getTasks()){\n int taskHour = task.getHourOfDay();\n\n int currentSimHour = currentSimDateTime.getHours();\n\n String output = \"{\" + taskHour + \" , \" + currentSimHour + \"}\";\n Log.d(\"Testing\", output);\n\n if(taskHour == currentSimHour ){\n // Perform given task now.\n Log.d(\"Task Executed: \", task.getTaskName());\n }\n }\n }\n }", "public void schedule(Context context, int requestCode)\n {\n AlarmManager alarmManager = (AlarmManager) context.getSystemService(Context.ALARM_SERVICE);\n\n int alarmID = 0;\n Days[] days = getDays();\n int routineID = id;\n String routineName = name;\n\n Calendar routineTime = Calendar.getInstance();\n\n try\n {\n routineTime.setTime(Objects.requireNonNull(formatter.parse(time)));\n }\n catch (Exception e)\n {\n e.printStackTrace();\n }\n\n // Schedule for each selected days\n for (Days day : days)\n {\n Calendar scheduleTime = Calendar.getInstance();\n\n // Set current calendar to current system time\n scheduleTime.setTimeInMillis(System.currentTimeMillis());\n scheduleTime.set(Calendar.HOUR_OF_DAY, routineTime.get(Calendar.HOUR_OF_DAY));\n scheduleTime.set(Calendar.MINUTE, routineTime.get(Calendar.MINUTE));\n scheduleTime.set(Calendar.SECOND, 0);\n scheduleTime.set(Calendar.MILLISECOND, 0);\n scheduleTime.set(Calendar.DAY_OF_MONTH, Calendar.DAY_OF_MONTH);\n\n switch(day)\n {\n case Sunday:\n scheduleTime.set(Calendar.DAY_OF_WEEK, Calendar.SUNDAY);\n break;\n\n case Monday:\n scheduleTime.set(Calendar.DAY_OF_WEEK, Calendar.MONDAY);\n break;\n\n case Tuesday:\n scheduleTime.set(Calendar.DAY_OF_WEEK, Calendar.TUESDAY);\n break;\n\n case Wednesday:\n scheduleTime.set(Calendar.DAY_OF_WEEK, Calendar.WEDNESDAY);\n break;\n\n case Thursday:\n scheduleTime.set(Calendar.DAY_OF_WEEK, Calendar.THURSDAY);\n break;\n\n case Friday:\n scheduleTime.set(Calendar.DAY_OF_WEEK, Calendar.FRIDAY);\n break;\n\n case Saturday:\n scheduleTime.set(Calendar.DAY_OF_WEEK, Calendar.SATURDAY);\n break;\n }\n\n Log.i(\"Routine\", \"----- Scheduling -----\");\n\n // Check if whether the day selected has passed, if yes then\n // add 7 days into the scheduler\n if (scheduleTime.getTimeInMillis() <= System.currentTimeMillis())\n {\n scheduleTime.add(Calendar.DAY_OF_MONTH, 7);\n Log.i(\"Routine\", \"ADD 7 DAYS\");\n }\n\n // DEBUG LOG\n Log.i(\"Routine\", \"Routine ID : \" + routineID);\n Log.i(\"Routine\", \"Day : \" + scheduleTime.get(Calendar.DAY_OF_WEEK));\n Log.i(\"Routine\", \"Hours : \" + scheduleTime.get(Calendar.HOUR_OF_DAY));\n Log.i(\"Routine\", \"Minutes : \" + scheduleTime.get(Calendar.MINUTE));\n Log.i(\"Routine\", \"DOM : \" + scheduleTime.get(Calendar.DAY_OF_MONTH));\n Log.i(\"Routine\", \"Month : \" + scheduleTime.get(Calendar.MONTH));\n\n // Intent to handle broadcast from alarm manager\n Intent intent = new Intent(context, AlarmBroadcastReceiver.class);\n intent.putExtra(\"Routine ID\", routineID);\n intent.putExtra(\"Routine Name\", routineName);\n\n PendingIntent alarmPendingIntent = PendingIntent.getBroadcast(context, (routineID * 10) + alarmID, intent, 0);\n\n // Routine will always repeating\n int RUN_WEEKLY = 24 * 7 * 60 * 60 * 1000;\n\n switch(requestCode)\n {\n case REQ_ADD_SCHEDULE:\n Log.i(\"Routine\", \"SCHEDULE ACTION ADD\");\n\n // Schedule to alarm manager\n if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {\n alarmManager.setExactAndAllowWhileIdle(\n AlarmManager.RTC_WAKEUP,\n scheduleTime.getTimeInMillis(),\n alarmPendingIntent\n );\n }\n else\n {\n alarmManager.setExact(\n AlarmManager.RTC_WAKEUP,\n scheduleTime.getTimeInMillis(),\n alarmPendingIntent\n );\n }\n\n alarmID++;\n break;\n\n case REQ_DELETE_SCHEDULE:\n Log.i(\"Routine\", \"SCHEDULE ACTION REMOVE\");\n alarmManager.cancel(alarmPendingIntent);\n alarmID++;\n break;\n }\n }\n }", "@Test\r\n\tpublic void testGetTimeslot() {\r\n\t\tassertEquals(time1, breaku1.getTimeslot());\r\n\t\tassertEquals(time1, externu1.getTimeslot());\r\n\t\tassertEquals(time1, meetingu1.getTimeslot());\r\n\t\tassertEquals(time1, teachu1.getTimeslot());\r\n\t}", "private static void setupTimePicker(LoopView timeHours, LoopView timeMins, LoopView timeTime) {\n timeHours.setItemsVisibleCount(5);\n timeHours.setNotLoop();\n //timeMins.setItems(timeMinsList);\n timeMins.setItemsVisibleCount(5);\n timeMins.setNotLoop();\n //timeTime.setItems(timeTimeList);\n timeTime.setItemsVisibleCount(5);\n timeTime.setNotLoop();\n }", "public static void createWeeklyReminderAlarm(Context context) {\n String prefWeekStart = PreferenceUtils.readString(PreferenceUtils.SNOOZE_WEEK_START, context);\n int weekStartDay = DateUtils.weekdayFromPrefValue(prefWeekStart);\n int dayBeforeWeekStart = weekStartDay - 1 == 0 ? Calendar.SATURDAY : weekStartDay - 1;\n\n // Load evening start preference.\n String prefEveningStart = PreferenceUtils.readString(PreferenceUtils.SNOOZE_EVENING_START, context);\n int eveningStartHour = TimePreference.getHour(prefEveningStart);\n int eveningStartMinute = TimePreference.getMinute(prefEveningStart);\n\n // Set alarm time based on preference.\n Calendar alarmTime = getBaseCalendar();\n alarmTime.set(Calendar.HOUR_OF_DAY, eveningStartHour);\n alarmTime.set(Calendar.MINUTE, eveningStartMinute);\n alarmTime.set(Calendar.DAY_OF_WEEK, dayBeforeWeekStart);\n\n // Check if alarm should be in the next week.\n if (alarmTime.before(Calendar.getInstance())) {\n alarmTime.setTimeInMillis(alarmTime.getTimeInMillis() + 604800000);\n }\n\n // Create reminders intent.\n PendingIntent alarmIntent = getRemindersIntent(context, Intents.WEEKLY_REMINDER);\n\n // Cancel existing alarms.\n AlarmManager alarmManager = (AlarmManager) context.getSystemService(Context.ALARM_SERVICE);\n alarmManager.cancel(alarmIntent);\n\n // Trigger the alarm weekly on the given time.\n alarmManager.setInexactRepeating(AlarmManager.RTC_WAKEUP, alarmTime.getTimeInMillis(), 604800000, alarmIntent);\n }", "public void setAvailableTime() {\n System.out.println(\"What is the free time for the playground\");\n System.out.println(\"From:\");\n Scanner input = new Scanner(System.in);\n int x = input.nextInt();\n System.out.print(\"To: \");\n int y = input.nextInt();\n for (int i = x; i <= y; ++i) {\n availableTime[i] = true;\n }\n }", "public int chooseTimeOfDay(Household hh, Person person, int tourTypeIndex ) {\n Arrays.fill(tcSample, 1);\n Arrays.fill(tcAvailability, true);\n\n setTcAvailability ( person, tcAvailability, tcSample );\n\n\n // count the number of tours in which no time-of-day alternative was available\n int noTOD = 0;\n for (int p=1; p <= tcUEC[tourTypeIndex].getNumberOfAlternatives(); p++) {\n if (tcAvailability[p]) {\n noTOD++;\n break;\n }\n }\n if (noTOD == 0) {\n noTODAvailableIndiv[tourTypeIndex]++;\n tcAvailability[1] = true;\n tcSample[1] = 1;\n tcAvailability[tcUEC[tourTypeIndex].getNumberOfAlternatives()] = true;\n tcSample[tcUEC[tourTypeIndex].getNumberOfAlternatives()] = 1;\n }\n\n\n long markTime = System.currentTimeMillis();\n // calculate the mode choice logsums for TOD choice based on chosen dest and default time periods\n hh.setTODDefaults ( TourType.NON_MANDATORY_CATEGORY, \"EaEa\" );\n tcLogsumEaEa = getMcLogsum ( hh, tourTypeIndex, TourType.NON_MANDATORY_CATEGORY );\n\n hh.setTODDefaults ( TourType.NON_MANDATORY_CATEGORY, \"EaAm\" );\n tcLogsumEaAm = getMcLogsum ( hh, tourTypeIndex, TourType.NON_MANDATORY_CATEGORY );\n\n hh.setTODDefaults ( TourType.NON_MANDATORY_CATEGORY, \"EaMd\" );\n tcLogsumEaMd = getMcLogsum ( hh, tourTypeIndex, TourType.NON_MANDATORY_CATEGORY );\n\n hh.setTODDefaults ( TourType.NON_MANDATORY_CATEGORY, \"EaPm\" );\n tcLogsumEaPm = getMcLogsum ( hh, tourTypeIndex, TourType.NON_MANDATORY_CATEGORY );\n\n hh.setTODDefaults ( TourType.NON_MANDATORY_CATEGORY, \"EaNt\" );\n tcLogsumEaNt = getMcLogsum ( hh, tourTypeIndex, TourType.NON_MANDATORY_CATEGORY );\n\n hh.setTODDefaults ( TourType.NON_MANDATORY_CATEGORY, \"AmAm\" );\n tcLogsumAmAm = getMcLogsum ( hh, tourTypeIndex, TourType.NON_MANDATORY_CATEGORY );\n\n hh.setTODDefaults ( TourType.NON_MANDATORY_CATEGORY, \"AmMd\" );\n tcLogsumAmMd = getMcLogsum ( hh, tourTypeIndex, TourType.NON_MANDATORY_CATEGORY );\n\n hh.setTODDefaults ( TourType.NON_MANDATORY_CATEGORY, \"AmPm\" );\n tcLogsumAmPm = getMcLogsum ( hh, tourTypeIndex, TourType.NON_MANDATORY_CATEGORY );\n\n hh.setTODDefaults ( TourType.NON_MANDATORY_CATEGORY, \"AmNt\" );\n tcLogsumAmNt = getMcLogsum ( hh, tourTypeIndex, TourType.NON_MANDATORY_CATEGORY );\n\n hh.setTODDefaults ( TourType.NON_MANDATORY_CATEGORY, \"MdMd\" );\n tcLogsumMdMd = getMcLogsum ( hh, tourTypeIndex, TourType.NON_MANDATORY_CATEGORY );\n\n hh.setTODDefaults ( TourType.NON_MANDATORY_CATEGORY, \"MdPm\" );\n tcLogsumMdPm = getMcLogsum ( hh, tourTypeIndex, TourType.NON_MANDATORY_CATEGORY );\n\n hh.setTODDefaults ( TourType.NON_MANDATORY_CATEGORY, \"MdNt\" );\n tcLogsumMdNt = getMcLogsum ( hh, tourTypeIndex, TourType.NON_MANDATORY_CATEGORY );\n\n hh.setTODDefaults ( TourType.NON_MANDATORY_CATEGORY, \"PmPm\" );\n tcLogsumPmPm = getMcLogsum ( hh, tourTypeIndex, TourType.NON_MANDATORY_CATEGORY );\n\n hh.setTODDefaults ( TourType.NON_MANDATORY_CATEGORY, \"PmNt\" );\n tcLogsumPmNt = getMcLogsum ( hh, tourTypeIndex, TourType.NON_MANDATORY_CATEGORY );\n\n hh.setTODDefaults ( TourType.NON_MANDATORY_CATEGORY, \"NtNt\" );\n tcLogsumNtNt = getMcLogsum ( hh, tourTypeIndex, TourType.NON_MANDATORY_CATEGORY );\n\n\n\n // assign mode choice logsums to time-of-day choice alternatives, given correspondiong time periods\n TODDataManager.logsumTcEAEA[1] = tcLogsumEaEa;\n TODDataManager.logsumTcEAEA[2] = tcLogsumEaEa;\n TODDataManager.logsumTcEAAM[3] = tcLogsumEaAm;\n TODDataManager.logsumTcEAAM[4] = tcLogsumEaAm;\n TODDataManager.logsumTcEAAM[5] = tcLogsumEaAm;\n TODDataManager.logsumTcEAMD[6] = tcLogsumEaMd;\n TODDataManager.logsumTcEAMD[7] = tcLogsumEaMd;\n TODDataManager.logsumTcEAMD[8] = tcLogsumEaMd;\n TODDataManager.logsumTcEAMD[9] = tcLogsumEaMd;\n TODDataManager.logsumTcEAMD[10] = tcLogsumEaMd;\n TODDataManager.logsumTcEAMD[11] = tcLogsumEaMd;\n TODDataManager.logsumTcEAPM[12] = tcLogsumEaPm;\n TODDataManager.logsumTcEAPM[13] = tcLogsumEaPm;\n TODDataManager.logsumTcEAPM[14] = tcLogsumEaPm;\n TODDataManager.logsumTcEAPM[15] = tcLogsumEaPm;\n TODDataManager.logsumTcEANT[16] = tcLogsumEaNt;\n TODDataManager.logsumTcEANT[17] = tcLogsumEaNt;\n TODDataManager.logsumTcEANT[18] = tcLogsumEaNt;\n TODDataManager.logsumTcEANT[19] = tcLogsumEaNt;\n TODDataManager.logsumTcEAEA[20] = tcLogsumEaEa;\n TODDataManager.logsumTcEAAM[21] = tcLogsumEaAm;\n TODDataManager.logsumTcEAAM[22] = tcLogsumEaAm;\n TODDataManager.logsumTcEAAM[23] = tcLogsumEaAm;\n TODDataManager.logsumTcEAMD[24] = tcLogsumEaMd;\n TODDataManager.logsumTcEAMD[25] = tcLogsumEaMd;\n TODDataManager.logsumTcEAMD[26] = tcLogsumEaMd;\n TODDataManager.logsumTcEAMD[27] = tcLogsumEaMd;\n TODDataManager.logsumTcEAMD[28] = tcLogsumEaMd;\n TODDataManager.logsumTcEAMD[29] = tcLogsumEaMd;\n TODDataManager.logsumTcEAPM[30] = tcLogsumEaPm;\n TODDataManager.logsumTcEAPM[31] = tcLogsumEaPm;\n TODDataManager.logsumTcEAPM[32] = tcLogsumEaPm;\n TODDataManager.logsumTcEAPM[33] = tcLogsumEaPm;\n TODDataManager.logsumTcEANT[34] = tcLogsumEaNt;\n TODDataManager.logsumTcEANT[35] = tcLogsumEaNt;\n TODDataManager.logsumTcEANT[36] = tcLogsumEaNt;\n TODDataManager.logsumTcEANT[37] = tcLogsumEaNt;\n TODDataManager.logsumTcAMAM[38] = tcLogsumEaAm;\n TODDataManager.logsumTcAMAM[39] = tcLogsumEaAm;\n TODDataManager.logsumTcAMAM[40] = tcLogsumEaAm;\n TODDataManager.logsumTcAMMD[41] = tcLogsumAmMd;\n TODDataManager.logsumTcAMMD[42] = tcLogsumAmMd;\n TODDataManager.logsumTcAMMD[43] = tcLogsumAmMd;\n TODDataManager.logsumTcAMMD[44] = tcLogsumAmMd;\n TODDataManager.logsumTcAMMD[45] = tcLogsumAmMd;\n TODDataManager.logsumTcAMMD[46] = tcLogsumAmMd;\n TODDataManager.logsumTcAMPM[47] = tcLogsumAmPm;\n TODDataManager.logsumTcAMPM[48] = tcLogsumAmPm;\n TODDataManager.logsumTcAMPM[49] = tcLogsumAmPm;\n TODDataManager.logsumTcAMPM[50] = tcLogsumAmPm;\n TODDataManager.logsumTcAMNT[51] = tcLogsumAmNt;\n TODDataManager.logsumTcAMNT[52] = tcLogsumAmNt;\n TODDataManager.logsumTcAMNT[53] = tcLogsumAmNt;\n TODDataManager.logsumTcAMNT[54] = tcLogsumAmNt;\n TODDataManager.logsumTcAMAM[55] = tcLogsumAmAm;\n TODDataManager.logsumTcAMAM[56] = tcLogsumAmAm;\n TODDataManager.logsumTcAMMD[57] = tcLogsumAmMd;\n TODDataManager.logsumTcAMMD[58] = tcLogsumAmMd;\n TODDataManager.logsumTcAMMD[59] = tcLogsumAmMd;\n TODDataManager.logsumTcAMMD[60] = tcLogsumAmMd;\n TODDataManager.logsumTcAMMD[61] = tcLogsumAmMd;\n TODDataManager.logsumTcAMMD[62] = tcLogsumAmMd;\n TODDataManager.logsumTcAMPM[63] = tcLogsumAmPm;\n TODDataManager.logsumTcAMPM[64] = tcLogsumAmPm;\n TODDataManager.logsumTcAMPM[65] = tcLogsumAmPm;\n TODDataManager.logsumTcAMPM[66] = tcLogsumAmPm;\n TODDataManager.logsumTcAMNT[67] = tcLogsumAmNt;\n TODDataManager.logsumTcAMNT[68] = tcLogsumAmNt;\n TODDataManager.logsumTcAMNT[69] = tcLogsumAmNt;\n TODDataManager.logsumTcAMNT[70] = tcLogsumAmNt;\n TODDataManager.logsumTcAMAM[71] = tcLogsumAmAm;\n TODDataManager.logsumTcAMMD[72] = tcLogsumAmMd;\n TODDataManager.logsumTcAMMD[73] = tcLogsumAmMd;\n TODDataManager.logsumTcAMMD[74] = tcLogsumAmMd;\n TODDataManager.logsumTcAMMD[75] = tcLogsumAmMd;\n TODDataManager.logsumTcAMMD[76] = tcLogsumAmMd;\n TODDataManager.logsumTcAMMD[77] = tcLogsumAmMd;\n TODDataManager.logsumTcAMPM[78] = tcLogsumAmPm;\n TODDataManager.logsumTcAMPM[79] = tcLogsumAmPm;\n TODDataManager.logsumTcAMPM[80] = tcLogsumAmPm;\n TODDataManager.logsumTcAMPM[81] = tcLogsumAmPm;\n TODDataManager.logsumTcAMNT[82] = tcLogsumAmNt;\n TODDataManager.logsumTcAMNT[83] = tcLogsumAmNt;\n TODDataManager.logsumTcAMNT[84] = tcLogsumAmNt;\n TODDataManager.logsumTcAMNT[85] = tcLogsumAmNt;\n TODDataManager.logsumTcMDMD[86] = tcLogsumMdMd;\n TODDataManager.logsumTcMDMD[87] = tcLogsumMdMd;\n TODDataManager.logsumTcMDMD[88] = tcLogsumMdMd;\n TODDataManager.logsumTcMDMD[89] = tcLogsumMdMd;\n TODDataManager.logsumTcMDMD[90] = tcLogsumMdMd;\n TODDataManager.logsumTcMDMD[91] = tcLogsumMdMd;\n TODDataManager.logsumTcMDPM[92] = tcLogsumMdPm;\n TODDataManager.logsumTcMDPM[93] = tcLogsumMdPm;\n TODDataManager.logsumTcMDPM[94] = tcLogsumMdPm;\n TODDataManager.logsumTcMDPM[95] = tcLogsumMdPm;\n TODDataManager.logsumTcMDNT[96] = tcLogsumMdNt;\n TODDataManager.logsumTcMDNT[97] = tcLogsumMdNt;\n TODDataManager.logsumTcMDNT[98] = tcLogsumMdNt;\n TODDataManager.logsumTcMDNT[99] = tcLogsumMdNt;\n TODDataManager.logsumTcMDMD[100] = tcLogsumMdMd;\n TODDataManager.logsumTcMDMD[101] = tcLogsumMdMd;\n TODDataManager.logsumTcMDMD[102] = tcLogsumMdMd;\n TODDataManager.logsumTcMDMD[103] = tcLogsumMdMd;\n TODDataManager.logsumTcMDMD[104] = tcLogsumMdMd;\n TODDataManager.logsumTcMDPM[105] = tcLogsumMdPm;\n TODDataManager.logsumTcMDPM[106] = tcLogsumMdPm;\n TODDataManager.logsumTcMDPM[107] = tcLogsumMdPm;\n TODDataManager.logsumTcMDPM[108] = tcLogsumMdPm;\n TODDataManager.logsumTcMDNT[109] = tcLogsumMdNt;\n TODDataManager.logsumTcMDNT[110] = tcLogsumMdNt;\n TODDataManager.logsumTcMDNT[111] = tcLogsumMdNt;\n TODDataManager.logsumTcMDNT[112] = tcLogsumMdNt;\n TODDataManager.logsumTcMDMD[113] = tcLogsumMdMd;\n TODDataManager.logsumTcMDMD[114] = tcLogsumMdMd;\n TODDataManager.logsumTcMDMD[115] = tcLogsumMdMd;\n TODDataManager.logsumTcMDMD[116] = tcLogsumMdMd;\n TODDataManager.logsumTcMDPM[117] = tcLogsumMdPm;\n TODDataManager.logsumTcMDPM[118] = tcLogsumMdPm;\n TODDataManager.logsumTcMDPM[119] = tcLogsumMdPm;\n TODDataManager.logsumTcMDPM[120] = tcLogsumMdPm;\n TODDataManager.logsumTcMDNT[121] = tcLogsumMdNt;\n TODDataManager.logsumTcMDNT[122] = tcLogsumMdNt;\n TODDataManager.logsumTcMDNT[123] = tcLogsumMdNt;\n TODDataManager.logsumTcMDNT[124] = tcLogsumMdNt;\n TODDataManager.logsumTcMDMD[125] = tcLogsumMdMd;\n TODDataManager.logsumTcMDMD[126] = tcLogsumMdMd;\n TODDataManager.logsumTcMDMD[127] = tcLogsumMdMd;\n TODDataManager.logsumTcMDPM[128] = tcLogsumMdPm;\n TODDataManager.logsumTcMDPM[129] = tcLogsumMdPm;\n TODDataManager.logsumTcMDPM[130] = tcLogsumMdPm;\n TODDataManager.logsumTcMDPM[131] = tcLogsumMdPm;\n TODDataManager.logsumTcMDNT[132] = tcLogsumMdNt;\n TODDataManager.logsumTcMDNT[133] = tcLogsumMdNt;\n TODDataManager.logsumTcMDNT[134] = tcLogsumMdNt;\n TODDataManager.logsumTcMDNT[135] = tcLogsumMdNt;\n TODDataManager.logsumTcMDMD[136] = tcLogsumMdMd;\n TODDataManager.logsumTcMDMD[137] = tcLogsumMdMd;\n TODDataManager.logsumTcMDPM[138] = tcLogsumMdPm;\n TODDataManager.logsumTcMDPM[139] = tcLogsumMdPm;\n TODDataManager.logsumTcMDPM[140] = tcLogsumMdPm;\n TODDataManager.logsumTcMDPM[141] = tcLogsumMdPm;\n TODDataManager.logsumTcMDNT[142] = tcLogsumMdNt;\n TODDataManager.logsumTcMDNT[143] = tcLogsumMdNt;\n TODDataManager.logsumTcMDNT[144] = tcLogsumMdNt;\n TODDataManager.logsumTcMDNT[145] = tcLogsumMdNt;\n TODDataManager.logsumTcMDMD[146] = tcLogsumMdMd;\n TODDataManager.logsumTcMDPM[147] = tcLogsumMdPm;\n TODDataManager.logsumTcMDPM[148] = tcLogsumMdPm;\n TODDataManager.logsumTcMDPM[149] = tcLogsumMdPm;\n TODDataManager.logsumTcMDPM[150] = tcLogsumMdPm;\n TODDataManager.logsumTcMDNT[151] = tcLogsumMdNt;\n TODDataManager.logsumTcMDNT[152] = tcLogsumMdNt;\n TODDataManager.logsumTcMDNT[153] = tcLogsumMdNt;\n TODDataManager.logsumTcMDNT[154] = tcLogsumMdNt;\n TODDataManager.logsumTcPMPM[155] = tcLogsumPmPm;\n TODDataManager.logsumTcPMPM[156] = tcLogsumPmPm;\n TODDataManager.logsumTcPMPM[157] = tcLogsumPmPm;\n TODDataManager.logsumTcPMPM[158] = tcLogsumPmPm;\n TODDataManager.logsumTcPMNT[159] = tcLogsumPmNt;\n TODDataManager.logsumTcPMNT[160] = tcLogsumPmNt;\n TODDataManager.logsumTcPMNT[161] = tcLogsumPmNt;\n TODDataManager.logsumTcPMNT[162] = tcLogsumPmNt;\n TODDataManager.logsumTcPMPM[163] = tcLogsumPmPm;\n TODDataManager.logsumTcPMPM[164] = tcLogsumPmPm;\n TODDataManager.logsumTcPMPM[165] = tcLogsumPmPm;\n TODDataManager.logsumTcPMNT[166] = tcLogsumPmNt;\n TODDataManager.logsumTcPMNT[167] = tcLogsumPmNt;\n TODDataManager.logsumTcPMNT[168] = tcLogsumPmNt;\n TODDataManager.logsumTcPMNT[169] = tcLogsumPmNt;\n TODDataManager.logsumTcPMPM[170] = tcLogsumPmPm;\n TODDataManager.logsumTcPMPM[171] = tcLogsumPmPm;\n TODDataManager.logsumTcPMNT[172] = tcLogsumPmNt;\n TODDataManager.logsumTcPMNT[173] = tcLogsumPmNt;\n TODDataManager.logsumTcPMNT[174] = tcLogsumPmNt;\n TODDataManager.logsumTcPMNT[175] = tcLogsumPmNt;\n TODDataManager.logsumTcPMPM[176] = tcLogsumPmPm;\n TODDataManager.logsumTcPMNT[177] = tcLogsumPmNt;\n TODDataManager.logsumTcPMNT[178] = tcLogsumPmNt;\n TODDataManager.logsumTcPMNT[179] = tcLogsumPmNt;\n TODDataManager.logsumTcPMNT[180] = tcLogsumPmNt;\n TODDataManager.logsumTcNTNT[181] = tcLogsumNtNt;\n TODDataManager.logsumTcNTNT[182] = tcLogsumNtNt;\n TODDataManager.logsumTcNTNT[183] = tcLogsumNtNt;\n TODDataManager.logsumTcNTNT[184] = tcLogsumNtNt;\n TODDataManager.logsumTcNTNT[185] = tcLogsumNtNt;\n TODDataManager.logsumTcNTNT[186] = tcLogsumNtNt;\n TODDataManager.logsumTcNTNT[187] = tcLogsumNtNt;\n TODDataManager.logsumTcNTNT[188] = tcLogsumNtNt;\n TODDataManager.logsumTcNTNT[189] = tcLogsumNtNt;\n TODDataManager.logsumTcNTNT[190] = tcLogsumNtNt;\n tcLogsumTime += (System.currentTimeMillis()-markTime);\n\n // compute time-of-day choice proportions and choose alternative\n markTime = System.currentTimeMillis();\n tc[tourTypeIndex].updateLogitModel ( hh, tcAvailability, tcSample );\n\n int chosenTODAlt;\n try {\n chosenTODAlt = tc[tourTypeIndex].getChoiceResult();\n }\n catch (ModelException e) {\n chosenTODAlt = SeededRandom.getRandom() < 0.5 ? 1 : 190;\n }\n tcTime += (System.currentTimeMillis()-markTime);\n return chosenTODAlt;\n }", "@FXML\n void onActAddAppt(ActionEvent event) throws SQLException, IOException {\n\n try {\n\n\n int startMinute = Integer.parseInt(startMin.getText());\n int startHour = Integer.parseInt(startHr.getText());\n int startSecond = Integer.parseInt(startSec.getText());\n int endHour = Integer.parseInt(endHr.getText());\n int endMinute = Integer.parseInt(endMin.getText());\n int endSecond = Integer.parseInt(endSec.getText());\n\n if (startMinute > 59 || startHour > 23 || startSecond > 59 || startMinute < 0 || startHour < 0 || startSecond < 0) {\n Alert alert = new Alert(Alert.AlertType.ERROR);\n alert.setTitle(\"Invalid Time Entries\");\n alert.setContentText(\"Please make sure your time inputs are valid and based on a 24 hour clock.\");\n alert.showAndWait();\n } else {\n\n int id = idCount * 40 * Math.toIntExact(Math.round((Math.random() * 1000)));\n idCount++;\n String title = apptTitleTxt.getText();\n String description = apptDescTxt.getText();\n String location = apptLocationTxt.getText();\n String type = apptTypeTxt.getText();\n\n\n //Local Appt Time\n ZoneId zoneIdLocal = ZoneId.systemDefault();\n LocalTime startTime = LocalTime.of(startHour, startMinute, startSecond);\n LocalTime endTime = LocalTime.of(endHour, endMinute, endSecond);\n\n\n // Local Appt day\n LocalDate startDay = LocalDate.of(startDate.getValue().getYear(), startDate.getValue().getMonthValue(), startDate.getValue().getDayOfMonth());\n\n //Appt in LocalDateTime object\n LocalDateTime start1 = LocalDateTime.of(startDay, startTime);\n LocalDateTime end1 = LocalDateTime.of(startDay, endTime);\n\n if (start1.isAfter(end1) || start1.equals(end1)) {\n Alert alert = new Alert(Alert.AlertType.ERROR);\n alert.setTitle(\"Invalid Time Entries\");\n alert.setContentText(\"Please make sure your start time is before your end time.\");\n alert.showAndWait();\n } else {\n\n\n //Business hours in LocalDateTime object\n ZoneId estZoneId = ZoneId.of(\"America/New_York\");\n LocalDateTime estBStart = LocalDateTime.of(startDay, LocalTime.of(8, 0)); //Business hours in EST\n LocalDateTime estBEnd = LocalDateTime.of(startDay, LocalTime.of(22, 0)); //Business hours in EST\n\n\n ZonedDateTime bStartZDT = estBStart.atZone(estZoneId); //Business hours start converted to Zoned Date Time object\n ZonedDateTime lStartZDT = ZonedDateTime.of(startDay, startTime, zoneIdLocal);\n\n ZonedDateTime bEndZDT = estBEnd.atZone(estZoneId);\n ZonedDateTime lEndZDT = ZonedDateTime.of(startDay, endTime, zoneIdLocal);\n\n Timestamp start = Timestamp.valueOf(start1);\n Timestamp end = Timestamp.valueOf(end1);\n\n if (lStartZDT.isBefore(bStartZDT) || lStartZDT.isAfter(bEndZDT) || lEndZDT.isAfter(bEndZDT) || lEndZDT.isBefore(bStartZDT)) {\n Alert alert = new Alert(Alert.AlertType.ERROR);\n alert.setContentText(\"Please place your time within the business hours of 8am-10pm EST.\");\n alert.showAndWait();\n } else {\n\n ObservableList<Appointment> filteredAppointments = allAppointments.filtered(a -> {\n if (a.getStart().isBefore(start1) && a.getEnd().isAfter(end1) || a.getStart().isAfter(start1) && a.getStart().isBefore(end1) || end1.isAfter(a.getStart()) && end1.isBefore(a.getEnd()) || a.getStart().equals(start1) || a.getStart().equals(end1) || a.getEnd().equals(start1) || a.getEnd().equals(end1)) {\n System.out.println(\"Got one!\");\n return true;\n }\n System.out.println(a.getStart());\n return false;\n\n });\n\n if (!filteredAppointments.isEmpty()) {\n Alert alert = new Alert(Alert.AlertType.ERROR);\n alert.setContentText(\"This time is taken. Please choose another.\");\n alert.showAndWait();\n } else {\n System.out.println(lStartZDT);\n System.out.println(lEndZDT);\n System.out.println(bStartZDT);\n System.out.println(bEndZDT);\n\n int customerId = Integer.parseInt(apptCustIdTxt.getText());\n int userId = Integer.parseInt(apptUserIdTxt.getText());\n\n if (contactList.getSelectionModel().isEmpty()) {\n Alert alert = new Alert(Alert.AlertType.ERROR);\n alert.setContentText(\"Please select a contact.\");\n alert.showAndWait();\n\n } else {\n Contact contact = contactList.getSelectionModel().getSelectedItem();\n\n String sqlStatement = \"INSERT INTO appointments VALUES(?,?,?,?,?,?,?,NOW(), 'script',NOW(), 'script',?,?,?);\";\n PreparedStatement pSqlStatement = DBConnection.startConnection().prepareStatement(sqlStatement, Statement.RETURN_GENERATED_KEYS);\n\n pSqlStatement.setInt(1, id);\n pSqlStatement.setString(2, title);\n pSqlStatement.setString(3, description);\n pSqlStatement.setString(4, location);\n pSqlStatement.setString(5, type);\n pSqlStatement.setTimestamp(6, start);\n pSqlStatement.setTimestamp(7, end);\n pSqlStatement.setInt(8, customerId);\n pSqlStatement.setInt(9, userId);\n pSqlStatement.setInt(10, contact.getId());\n\n pSqlStatement.execute();\n\n Appointment newAppt = new Appointment(id, title, description, location, type, start.toLocalDateTime(), end.toLocalDateTime(), customerId, userId, contact);\n allAppointments.add(newAppt);\n DBConnection.closeConnection();\n sceneManage(\"/View/Dashboard.fxml\", event);\n }\n }\n }\n }\n }\n } catch (NumberFormatException ex) {\n Alert alert = new Alert(Alert.AlertType.ERROR);\n alert.setContentText(ex.getMessage());\n alert.showAndWait();\n }\n }", "@Test\n public void repeatingTask_changeRepeatPeriod_nextWeekDate() {\n LocalDate testDate = LocalDateTime.now().minusWeeks(1).minusDays(1).toLocalDate();\n LocalTime testTime = LocalTime.of(8, 30);\n LocalDateTime testDateTime = LocalDateTime.of(testDate, testTime);\n Event testEvent = new Event(\"8 days ago\", \"CS2113T\", testDateTime, testDateTime.plusHours(4),\n \"testing\");\n testTaskList.addTask(testEvent);\n // Set to 1w\n RepeatCommand testRepeatCommand = new RepeatCommand(2, 1, RepeatCommand.WEEKLY_ICON);\n testRepeatCommand.execute(testTaskList, testUi);\n RepeatEvent repeatEvent = (RepeatEvent) testTaskList.getTask(2);\n // Set to 1d\n testRepeatCommand = new RepeatCommand(2, 1, RepeatCommand.DAILY_ICON);\n testRepeatCommand.execute(testTaskList, testUi);\n repeatEvent = (RepeatEvent) testTaskList.getTask(2);\n\n assertEquals(repeatEvent.getPeriodCounter(), 0);\n assertEquals(repeatEvent.getNextDateTime(), LocalDateTime.of(LocalDate.now().plusWeeks(1), testTime));\n }", "@Override\r\n\tpublic void doInitialSchedules() {\n\t}", "@Override\n public void onTimePicked() {\n }", "@Test\n public void testTimerTracking_TempAllowlisting() {\n // None of these should be affected purely by the temp allowlist changing.\n setDischarging();\n setProcessState(ActivityManager.PROCESS_STATE_RECEIVER);\n final long gracePeriodMs = 15 * SECOND_IN_MILLIS;\n setDeviceConfigLong(QcConstants.KEY_EJ_GRACE_PERIOD_TEMP_ALLOWLIST_MS, gracePeriodMs);\n Handler handler = mQuotaController.getHandler();\n spyOn(handler);\n\n JobStatus job1 = createJobStatus(\"testTimerTracking_TempAllowlisting\", 1);\n JobStatus job2 = createJobStatus(\"testTimerTracking_TempAllowlisting\", 2);\n JobStatus job3 = createJobStatus(\"testTimerTracking_TempAllowlisting\", 3);\n JobStatus job4 = createJobStatus(\"testTimerTracking_TempAllowlisting\", 4);\n JobStatus job5 = createJobStatus(\"testTimerTracking_TempAllowlisting\", 5);\n synchronized (mQuotaController.mLock) {\n mQuotaController.maybeStartTrackingJobLocked(job1, null);\n }\n assertNull(mQuotaController.getTimingSessions(SOURCE_USER_ID, SOURCE_PACKAGE));\n List<TimingSession> expected = new ArrayList<>();\n\n long start = JobSchedulerService.sElapsedRealtimeClock.millis();\n synchronized (mQuotaController.mLock) {\n mQuotaController.prepareForExecutionLocked(job1);\n }\n advanceElapsedClock(10 * SECOND_IN_MILLIS);\n synchronized (mQuotaController.mLock) {\n mQuotaController.maybeStopTrackingJobLocked(job1, job1, true);\n }\n expected.add(createTimingSession(start, 10 * SECOND_IN_MILLIS, 1));\n assertEquals(expected,\n mQuotaController.getTimingSessions(SOURCE_USER_ID, SOURCE_PACKAGE));\n\n advanceElapsedClock(SECOND_IN_MILLIS);\n\n // Job starts after app is added to temp allowlist and stops before removal.\n start = JobSchedulerService.sElapsedRealtimeClock.millis();\n mTempAllowlistListener.onAppAdded(mSourceUid);\n synchronized (mQuotaController.mLock) {\n mQuotaController.maybeStartTrackingJobLocked(job2, null);\n mQuotaController.prepareForExecutionLocked(job2);\n }\n advanceElapsedClock(10 * SECOND_IN_MILLIS);\n synchronized (mQuotaController.mLock) {\n mQuotaController.maybeStopTrackingJobLocked(job2, null, false);\n }\n expected.add(createTimingSession(start, 10 * SECOND_IN_MILLIS, 1));\n assertEquals(expected,\n mQuotaController.getTimingSessions(SOURCE_USER_ID, SOURCE_PACKAGE));\n\n // Job starts after app is added to temp allowlist and stops after removal,\n // before grace period ends.\n mTempAllowlistListener.onAppAdded(mSourceUid);\n synchronized (mQuotaController.mLock) {\n mQuotaController.maybeStartTrackingJobLocked(job3, null);\n mQuotaController.prepareForExecutionLocked(job3);\n }\n start = JobSchedulerService.sElapsedRealtimeClock.millis();\n advanceElapsedClock(10 * SECOND_IN_MILLIS);\n mTempAllowlistListener.onAppRemoved(mSourceUid);\n long elapsedGracePeriodMs = 2 * SECOND_IN_MILLIS;\n advanceElapsedClock(elapsedGracePeriodMs);\n synchronized (mQuotaController.mLock) {\n mQuotaController.maybeStopTrackingJobLocked(job3, null, false);\n }\n expected.add(createTimingSession(start, 10 * SECOND_IN_MILLIS + elapsedGracePeriodMs, 1));\n assertEquals(expected,\n mQuotaController.getTimingSessions(SOURCE_USER_ID, SOURCE_PACKAGE));\n\n advanceElapsedClock(SECOND_IN_MILLIS);\n elapsedGracePeriodMs += SECOND_IN_MILLIS;\n\n // Job starts during grace period and ends after grace period ends\n synchronized (mQuotaController.mLock) {\n mQuotaController.maybeStartTrackingJobLocked(job4, null);\n mQuotaController.prepareForExecutionLocked(job4);\n }\n final long remainingGracePeriod = gracePeriodMs - elapsedGracePeriodMs;\n start = JobSchedulerService.sElapsedRealtimeClock.millis();\n advanceElapsedClock(remainingGracePeriod);\n // Wait for handler to update Timer\n // Can't directly evaluate the message because for some reason, the captured message returns\n // the wrong 'what' even though the correct message goes to the handler and the correct\n // path executes.\n verify(handler, timeout(gracePeriodMs + 5 * SECOND_IN_MILLIS)).handleMessage(any());\n advanceElapsedClock(10 * SECOND_IN_MILLIS);\n expected.add(createTimingSession(start, remainingGracePeriod + 10 * SECOND_IN_MILLIS, 1));\n synchronized (mQuotaController.mLock) {\n mQuotaController.maybeStopTrackingJobLocked(job4, job4, true);\n }\n assertEquals(expected,\n mQuotaController.getTimingSessions(SOURCE_USER_ID, SOURCE_PACKAGE));\n\n // Job starts and runs completely after temp allowlist grace period.\n advanceElapsedClock(10 * SECOND_IN_MILLIS);\n start = JobSchedulerService.sElapsedRealtimeClock.millis();\n synchronized (mQuotaController.mLock) {\n mQuotaController.maybeStartTrackingJobLocked(job5, null);\n mQuotaController.prepareForExecutionLocked(job5);\n }\n advanceElapsedClock(10 * SECOND_IN_MILLIS);\n synchronized (mQuotaController.mLock) {\n mQuotaController.maybeStopTrackingJobLocked(job5, job5, true);\n }\n expected.add(createTimingSession(start, 10 * SECOND_IN_MILLIS, 1));\n assertEquals(expected,\n mQuotaController.getTimingSessions(SOURCE_USER_ID, SOURCE_PACKAGE));\n }", "public void changeSettings(View view) {\n Log.d(LOG, \"in changeSettings\");\r\n //this is making the dummy calls for now\r\n /*TextView eventId = (TextView) findViewById(R.id.eventId);\r\n TextView time = (TextView) findViewById(R.id.time);\r\n TextView value = (TextView) findViewById(R.id.value);*/\r\n\r\n // int eventIdInteger = Integer.parseInt(eventId.getText().toString());\r\n // long timeLong = Long.parseLong(time.getText().toString());\r\n // int valueInteger = Integer.parseInt(value.getText().toString());\r\n\r\n Algo algo = new Algo(this);\r\n //valueInteger should always be 1\r\n\r\n Calendar calendar = Calendar.getInstance();\r\n calendar.setTime(new Date());\r\n int hours = calendar.get(Calendar.HOUR_OF_DAY);\r\n int minutes = calendar.get(Calendar.MINUTE) + 2;\r\n\r\n long timeLong = (1436121000000L + (hours * 60 * 60 + minutes * 60) * 1000 ); //6th July Monday 00:00 AM\r\n int eventIdInteger = 5;\r\n int valueInteger = 1;\r\n long durationOfEvent = 3*60*1000;\r\n\r\n calendar.setTime(new Date(timeLong));\r\n\r\n Toast.makeText(this, \"Time entered : \"\r\n + calendar.get(Calendar.DATE) + \":\"\r\n + calendar.get(Calendar.HOUR_OF_DAY) + \":\"\r\n + calendar.get(Calendar.MINUTE) + \":\"\r\n + calendar.get(Calendar.SECOND)\r\n , Toast.LENGTH_SHORT).show();\r\n\r\n Log.d(LOG, \"the time being set i the DB is :\" + timeLong);\r\n Log.d(LOG, \"Time entered : \"\r\n + calendar.get(Calendar.DATE) + \":\"\r\n + calendar.get(Calendar.HOUR_OF_DAY) + \":\"\r\n + calendar.get(Calendar.MINUTE) + \":\"\r\n + calendar.get(Calendar.SECOND));\r\n\r\n for(int i=0;i<5;i++){\r\n algo.writeToDB(5, timeLong , valueInteger);\r\n\r\n //enter the end case of the above call\r\n algo.writeToDB(eventIdInteger, (timeLong + durationOfEvent), 0); //add 5 minutes to the end event, duration 5 min\r\n\r\n\r\n Log.d(LOG, \"taking a nap for 2 seconds\");\r\n/* try {\r\n Thread.currentThread().sleep(2000);\r\n } catch (InterruptedException e) {\r\n Log.d(LOG, \"the nap got fucked up!!\");\r\n e.printStackTrace();\r\n }*/\r\n timeLong += 24*60*60*1000;\r\n\r\n }\r\n\r\n Log.d(LOG, \"this should be learned\");\r\n long otherTime = 1436725800000L + (hours * 60 * 60 + minutes * 60) * 1000 ; //13th July Friday 00:00 AM\r\n algo.writeToDB(5, otherTime, valueInteger);\r\n algo.writeToDB(5, otherTime + durationOfEvent, 0); //end this event\r\n\r\n }", "@Test\n public void testAppointmentManagement() {\n for (int i = 0; i < 10; i++) {\n presenter.onAppointmentManagement();\n }\n Assert.assertEquals(10, view.getManageAppointmentManagementClicks());\n }", "public void pauseWorkout(){\n mStart = 0;\n mEnd = 0;\n mIsPlay = false;\n mIsPause = true;\n mFabPlay.setIcon(R.mipmap.ic_play_arrow_white_24dp);\n if(mCounter != null) {\n if (mCounter.timerCheck()) mCounter.cancel();\n mCurrentTime = mCounter.timerPause();\n }\n if(mIsFirstAppRun){\n mTxtBreakTime.setText(mCurrentTime);\n }else {\n if (mIsBreak) {\n // If this is break, set mTimer to break time view and set sub title view\n // with initial time\n mTxtBreakTime.setText(mCurrentTime);\n mTxtSubTitle.setText(mCurrentTime);\n } else {\n mTxtSubTitle.setText(mCurrentTime);\n }\n }\n }", "@Scheduled(fixedRate = 60_000)\n public void checkEventTime() {\n isTimeService.findAll().forEach(event -> {\n if (event.getSchedulledTime().isBefore(LocalDateTime.now())) {\n this.producer.sendReachTimeMessage(new IsTime(event.getMessageId()));\n this.isTimeService.deleteById(event.getSchedulledId());\n }\n });\n// log.info(\"Schedulled time check.\");\n }", "public void setRechargeTime(Skills skill, int time);", "public void pickUpTimer()\r\n\t{\t\t\r\n\t\tSystem.out.println(timer.get());\r\n\t\tif(timer.get() < Config.Auto.timeIntakeOpen)\r\n\t\t{\r\n\t\t\t//claw.openClaw();\r\n\t\t\tSystem.out.println(\"in second if\");\r\n\t\t}\r\n\t\t\t\t\r\n\t\telse if(timer.get() < Config.Auto.timeElevatorStack)\r\n\t\t{\r\n\t\t\t//elevator.setLevel(elevatorLevel);\r\n\t\t\t//elevatorLevel++;\r\n\t\t}\r\n\t\t\r\n\t\telse if(timer.get() < Config.Auto.timeIntakeClose)\r\n\t\t{\r\n\t\t\tSystem.out.println(\"in first if\");\r\n\t\t\t//claw.closeClaw();\r\n\t\t}\r\n\t\t\r\n\t\telse\r\n\t\t\tendRoutine();\r\n\t}", "@Test\n public void firstRatingsIsLate() {\n LocalDateTime firstTime = LocalDateTime.of(2017, Month.JANUARY, 1, 0, 0);\n\n //start with creating tp (proportional)\n // |------|\n TimePeriod tp = new TimePeriod(firstTime.plusHours(0), firstTime.plusHours(7));\n\n\n /**match tp with ratings and chunkEnd so we have (proportional scale)\n * ratings |--o----||\n * tp: |-------|\n *\n */\n ScoreTime rStart = new ScoreTime(firstTime.plusHours(2), 3);\n LocalDateTime chunkEnd = firstTime.plusHours(7); //=> same as tp.end\n\n //this is the method we are testing\n double[] avgscoreAndWeight = RatingTime.calcAvgAndWeight(tp, Arrays.asList(rStart),\n chunkEnd);\n assertEquals(3.0, avgscoreAndWeight[0]);\n\n /* weight should equal durationOfRatingsInScopeOfTp/tp.duration\n timeOfRatingsInScopeOfTp = 5 hours\n tp.duration = 7 hours.\n weight should be 5/7\n */\n\n assertEquals(5. / 7., avgscoreAndWeight[1], 0.01);\n }", "ConferenceScheduleBuilderService createEventsFromStartToLunch();", "@Test\r\n\tpublic void displayCandidatesScheduled1() throws Exception {\r\n\r\n\t\tList<ShowCandidateDTO> candidateList = new ArrayList<>();\r\n\t\tcandidateList.add(getShowCandidateDTO());\r\n\r\n\t\twhen(interviewerService.scheduledList(anyLong())).thenReturn(candidateList);\r\n\t\tmockMvc.perform(MockMvcRequestBuilders.get(\"/scheduledInterviewListforInterview/1\"))\r\n\t\t\t\t.andExpect(MockMvcResultMatchers.status().isOk());\r\n\r\n\t}", "private static void randomSim(PriorityQueue roomQueue, int totalTime, int roomNum) {\r\n\t\t//this will run a test with the user specified number of rooms\r\n\t\t//and random patient visits\r\n\t\t\r\n\t\tint currentTime = 0; //the current time in minutes - the number of minutes that have passed\r\n\t\tPriorityQueue arrivalQueue = new PriorityQueue<>(); // a queue to hold arriving patients\r\n\t\tPriorityQueue departureQueue = new PriorityQueue<>(); // a queue to hold departing patients\r\n\t\tArrayList<PatientVisit> treatedPatients = new ArrayList<PatientVisit>(); // a list to store the treated patients (will actually be deep copies of patients as their fields existed when they were moved to rooms)\t\t\r\n\t\tArrayList<ExamRoom> roomsInUse = new ArrayList<ExamRoom>(); // a list to hold rooms while they are in use\r\n\t\t\r\n\t\t//THE DATA WE WANT TO KEEP TRACK OF\r\n\t\tint totalPatients = 0;\r\n\t\tint highPriorityPatients = 0;\r\n\t\tint lowPriorityPatients = 0;\r\n\t\tdouble totalTreatmentTime = 0;\r\n\t\tdouble avgTreatmentTime;\r\n\t\tdouble highPriorityWaitTime = 0;\r\n\t\tdouble avgHighPriorityWaitTime;\r\n\t\tdouble lowPriorityWaitTime = 0;\r\n\t\tdouble avgLowPriorityWaitTime;\r\n\t\tdouble totalWaitTime = 0;\r\n\t\tdouble avgWaitTime;\r\n\t\t\r\n\t\twhile (currentTime < totalTime || departureQueue.size() > 0) { //until the time has elapsed AND all patients have finished treatment\r\n\t\t\t\r\n\t\t\tif (currentTime < totalTime) { // if the time specified by the user has not yet elapsed\r\n\t\t\t\tPatientVisit newPatient = PatientVisitGenerator.getNextRandomArrival(currentTime); //generate an arrival event\r\n\t\t\t\tarrivalQueue.insert(newPatient); //add that patient to the arrival queue\t\t\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\telse if (!arrivalQueue.isEmpty()) {\r\n\t\t\t\tarrivalQueue = new PriorityQueue<>(); // clear any future events when user specified time has elapsed\r\n\t\t\t}\r\n\t\t\t//PUT PATIENT IN ROOM IF POSSIBLE\r\n\t\t\t// if there is an available room AND there are waiting patients (who have already arrived)\r\n\t\t\twhile (!roomQueue.isEmpty() && !arrivalQueue.isEmpty() && ((PatientVisit) arrivalQueue.front()).getArrivalTime() <= currentTime) { \r\n\t\t\t\t\r\n\t\t\t\t//GRAB THE NEXT ROOM AND PATIENT IN THEIR RESPECTIVE QUEUES\r\n\t\t\t\t\r\n\t\t\t\tExamRoom room = (ExamRoom) roomQueue.remove(); // take the first room from the room list\r\n\t\t\t\tPatientVisit patient = (PatientVisit) arrivalQueue.remove(); // take the first patient from the patient list\r\n\t\t\t\t\r\n\t\t\t\t//MODIFY THE ROOM AND PATIENT AND CAPTURE SOME DATA\r\n\t\t\t\t//PATIENTS\r\n\t\t\t\tpatient.setWaitTime(currentTime - patient.getArrivalTime()); // set the time the patient waited\r\n\t\t\t\tpatient.setDepartureTime(currentTime + patient.getDuration()); // set the departure time of the patient equal to arrival time + duration of appointment\r\n\t\t\t\ttreatedPatients.add(patient.deepCopy()); // add a copy of this patient to a queue for treated patients to preserve its wait time and urgency (for data collection purposes)\r\n\t\t\t\tpatient.setUrgency(10); // set each patient to lowest priority once in treatment room (allows them to be compared based on departure time)\r\n\t\t\t\tpatient.setArrivalTime(0); // set each arrival time to 0 once in treatment room (allows them to be compared based on departure time)\r\n\t\t\t\tdepartureQueue.insert(patient); // add patient to departure queue to be sorted by departure time\r\n\t\t\t\t\r\n\t\t\t\t//ROOMS\r\n\t\t\t\troom.setInUseTime(room.getInUseTime() + patient.getDuration()); // add the duration of the patient's treatment to the in-use time of the room\r\n\t\t\t\troom.setPatientNum(room.getPatientNum() + 1); // increase the number of patients treated in the room by 1\r\n\t\t\t\troom.setDepartureTime(patient.getDepartureTime()); // set departure time of room to that of patient\r\n\t\t\t\troomsInUse.add(room); // put the rooms in a list for rooms in use\r\n\t\t\t\t\r\n\t\t\t\t//GENERAL DATA\r\n\t\t\t\ttotalPatients ++; //increment number of patients treated\t\t\t\t\r\n\t\t\t\ttotalTreatmentTime += patient.getDuration(); // add the patient's treatment time to the total\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t//GO THROUGH ROOMS AND PATIENTS TO FIND THOSE WHICH ARE DONE\r\n\t\t\t//ROOMS\r\n\t\t\tfor (int i=0; i<roomsInUse.size(); i++) { // look through rooms currently in use\r\n\t\t\t\tExamRoom room = roomsInUse.get(i); // for each room\r\n\t\t\t\tif (room.getDepartureTime() <= currentTime) { // if the departure time is now or has passed\r\n\t\t\t\t\troomsInUse.remove(i); //remove that room from the list of in-use rooms\r\n\t\t\t\t\troomQueue.insert(room); // add it back to the room queue where it will be sorted according to its new in-use time\r\n\t\t\t\t\ti--; // go back one index as the list is now shorter\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t//PATIENTS\t\t\r\n\t\t\twhile (!departureQueue.isEmpty() && ((PatientVisit) departureQueue.front()).getDepartureTime() <= currentTime) { // while the next patient to depart is ready to depart\r\n\t\t\t\tdepartureQueue.remove(); // remove that patient from the departure queue\r\n\t\t\t}\r\n\t\t\tcurrentTime += 1; // increment time 1 minute\r\n\t\t}\r\n\t\t\r\n\t\t//CALCULATE THE AVERAGE WAIT TIMES\r\n\t\tIterator<PatientVisit> treatedPatientsIter = treatedPatients.iterator(); //attach an iterator to the list of treated patients\r\n\t\twhile (treatedPatientsIter.hasNext()) {\r\n\t\t\tPatientVisit currentPatient = treatedPatientsIter.next(); // go through all treated patients\r\n\t\t\tif (currentPatient.getUrgency() >= 1 && currentPatient.getUrgency() <= 4) { // if the patient was high priority\r\n\t\t\t\thighPriorityPatients += 1; // add 1 to total of high priority patients\r\n\t\t\t\thighPriorityWaitTime += currentPatient.getWaitTime(); // add patient's wait time to high priority wait-time total\t\t\t\t\r\n\t\t\t}\r\n\t\t\telse if (currentPatient.getUrgency() >= 9) { //if patient was low priority\r\n\t\t\t\tlowPriorityPatients += 1; //add 1 to total of low priority patients\r\n\t\t\t\tlowPriorityWaitTime += currentPatient.getWaitTime(); // add patient's wait time to low priority wait-time total\t\r\n\t\t\t}\r\n\t\t\ttotalWaitTime += currentPatient.getWaitTime();\r\n\t\t}\r\n\t\tavgHighPriorityWaitTime = highPriorityWaitTime/highPriorityPatients; // calculate the average for high priority patients\r\n\t\tavgLowPriorityWaitTime = lowPriorityWaitTime/lowPriorityPatients; // calculate the average for low priority patients\r\n\t\tavgWaitTime = totalWaitTime/totalPatients;\r\n\t\tavgTreatmentTime = totalTreatmentTime/totalPatients; // calculate overall average treatment time\t\r\n\t\t\r\n\t\t// PRINT THE DATA FOR THE USER\r\n\t\tSystem.out.println();\r\n\t\t//System.out.println(\"total treatment time: \" + totalTreatmentTime);\r\n\t\tSystem.out.println(\"There are \" + roomNum + \" rooms in the system.\");\r\n\t\tSystem.out.println(\"The simulation ran for \" + currentTime/60 + \" hours and \" + currentTime%60 + \" minutes.\");\r\n\t\tSystem.out.println(totalPatients + \" patients were treated in total.\");\r\n\t\tSystem.out.printf(\"The average wait time for treatment was: \" + \"%.2f\" + \" minutes.\\n\", avgWaitTime);\r\n\t\tif (highPriorityPatients > 0) {\r\n\t\t\tSystem.out.printf(\"There were \" + highPriorityPatients + \" patients with urgency 1 to 4 and their average wait time was: \" + \"%.2f\" + \" minutes.\\n\", avgHighPriorityWaitTime);\r\n\t\t}\r\n\t\telse {\r\n\t\t\tSystem.out.printf(\"There were \" + highPriorityPatients + \" patients with urgency 1 to 4 and their average wait time cannot be calculated.\");\r\n\t\t}\r\n\t\tif (lowPriorityPatients > 0) {\r\n\t\t\tSystem.out.printf(\"There were \" + lowPriorityPatients + \" patients with urgency 9 to 10 and their average wait time was: \" + \"%.2f\" + \" minutes.\\n\", avgLowPriorityWaitTime);\r\n\t\t}\r\n\t\telse {\r\n\t\t\tSystem.out.printf(\"There were \" + lowPriorityPatients + \" patients with urgency 9 to 10 and their average wait cannot be calculated.\\n\");\r\n\t\t}\r\n\t\tSystem.out.printf(\"The average duration of treatment was: \" + \"%.2f\" + \" minutes.\\n\", avgTreatmentTime);\r\n\t\tfor (int i=0; i<roomNum; i++) {\r\n\t\t\tExamRoom room = (ExamRoom) roomQueue.remove();\r\n\t\t\tint patientNum = room.getPatientNum();\r\n\t\t\tdouble busyTime = room.getInUseTime();\r\n\t\t\tSystem.out.println(patientNum + \" patients were treated in room \" + room.getIdent() + \".\");\r\n\t\t\tSystem.out.printf(\"Room \" + room.getIdent() + \" was busy \" + \"%.2f\" + \" percent of the time.\\n\", (busyTime/currentTime)*100);\r\n\t\t}\r\n\t\tSystem.out.println();\t\r\n\t\t\r\n\t}", "@Override\n\tpublic void setStartTime(int t) {\n\t\t\n\t}", "protected void dispatchSetupEvents() {\r\n TimedEvent e = null;\r\n while ((e = scenarioQueue.peek()) != null && e.time < 0) {\r\n scenarioQueue.poll();\r\n disp.dispatchEvent(e);\r\n }\r\n }", "public void startRideTime(){\r\n\t\trideTime.start();\r\n\t}" ]
[ "0.674904", "0.6402943", "0.63828427", "0.63553834", "0.62454104", "0.6227041", "0.60704577", "0.60596526", "0.60575205", "0.5896097", "0.5790509", "0.57494676", "0.56630373", "0.5618681", "0.55680424", "0.5556579", "0.5505372", "0.55004543", "0.54687786", "0.5452236", "0.5442726", "0.5421177", "0.540729", "0.5401108", "0.5384826", "0.5355036", "0.5353048", "0.53516334", "0.53328013", "0.5332513", "0.53304553", "0.53295976", "0.53257835", "0.53255147", "0.53242564", "0.53223133", "0.5321984", "0.53218305", "0.53086436", "0.53064895", "0.5305363", "0.5291668", "0.5291075", "0.52899885", "0.5286807", "0.5285262", "0.52813613", "0.5278677", "0.5269672", "0.5266005", "0.5264236", "0.52614045", "0.52561295", "0.5241973", "0.5230486", "0.5226475", "0.5225605", "0.5215", "0.520909", "0.5202912", "0.5196519", "0.5196331", "0.5186876", "0.5179459", "0.5179459", "0.51755774", "0.5175397", "0.5168108", "0.5152739", "0.51522624", "0.5145855", "0.514363", "0.51380295", "0.5133688", "0.5130353", "0.5129257", "0.5126704", "0.5125493", "0.51238316", "0.5123328", "0.51213694", "0.5117894", "0.51173663", "0.5116056", "0.51151466", "0.51143664", "0.51126975", "0.5111987", "0.51067156", "0.51064706", "0.5101116", "0.50988513", "0.5097788", "0.50970954", "0.50936073", "0.50830364", "0.5070624", "0.50671357", "0.5066086", "0.50618273" ]
0.516654
68
Parses the file with the given filename.
public ArrayList<Operation> parse(String filename) { int ref, op, arg; ArrayList<Operation> retVal; BufferedReader br; String line; String[] lineContent; File file = new File(filename); retVal = new ArrayList<Operation>(); try { br = new BufferedReader(new FileReader(file)); while ((line = br.readLine()) != null) { lineContent = line.split(" "); ref = Integer.parseInt(lineContent[0]); op = Integer.parseInt(lineContent[1]); arg = Integer.parseInt(lineContent[2]); retVal.add(new Operation(ref, op, arg)); } br.close(); return retVal; } catch (Exception e) { return null; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void parse(String filename);", "public void parse(String fileName) throws Exception;", "public String parse(File file);", "protected abstract void parseFile(File f) throws IOException;", "public void parseInputFile(String filename) throws BadInputFormatException {\r\n\t\tString line;\r\n\r\n\t\ttry {\r\n\t\t\tInputStream fis = new FileInputStream(filename);\r\n\t\t\tInputStreamReader isr = new InputStreamReader(fis);\r\n\t\t\tBufferedReader br = new BufferedReader(isr);\r\n\r\n\t\t\twhile ((line = br.readLine()) != null) {\r\n\t\t\t\tparseMessage(line);\r\n\t\t\t}\r\n\t\t\tbr.close();\r\n\t\t} catch (FileNotFoundException e) {\r\n\t\t\te.printStackTrace();\r\n\t\t} catch (IOException e) {\r\n\t\t\te.printStackTrace();\r\n\t\t}\r\n\t}", "public void parseFile(String fileName) {\n\t\tparseFile(Values.StorySequences, fileName + \".seq\");\n\t}", "public boolean parseFile(String fileName) {\n\n\t\t// This will reference one line at a time\n\t\tString line = \"\";\n\n\t\ttry {\n\t\t\t// FileReader reads text files in the default encoding.\n\t\t\tFileReader fileReader = new FileReader(fileName);\n\n\t\t\t// Always wrap FileReader in BufferedReader.\n\t\t\tBufferedReader bufferedReader = new BufferedReader(fileReader);\n\n\t\t\twhile ((line = bufferedReader.readLine()) != null) {\n\n\t\t\t\tif (line.startsWith(\"//\")) {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\tparseLine(line, true);\n\t\t\t}\n\n\t\t\t// Always close files.\n\t\t\tbufferedReader.close();\n\t\t} catch (Exception e) {\n\t\t\te.printStackTrace();\n\t\t\treturn false;\n\t\t}\n\n\t\treturn true;\n\t}", "private static SimpleNode parse(String filename) throws ParseException {\n\t\tParser parser;\n\t\t// open file as input stream\n\t\ttry {\n\t\t\tparser = new Parser(new java.io.FileInputStream(filename));\n\t\t}\n\t\tcatch (java.io.FileNotFoundException e) {\n\t\t\tSystem.out.println(\"ERROR: file \" + filename + \" not found.\");\n\t\t\treturn null;\n\t\t}\n\t\t// parse and return root node\n\t\treturn parser.parse();\n\t}", "public void parseXmlFile(String fileName){\n\t\t//get the factory\n\t\tDocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();\n\t\t\n\t\ttry {\n\t\t\t//Using factory get an instance of document builder\n\t\t\tDocumentBuilder db = dbf.newDocumentBuilder();\n\t\t\t\n\t\t\t//parse using builder to get DOM representation of the XML file\n\t\t\tdoc = db.parse(fileName);\n\t\t} catch(ParserConfigurationException pce) {\n\t\t\tpce.printStackTrace();\n\t\t} catch(SAXException se) {\n\t\t\tSystem.err.println(\"Malformed XML: Make sure to provide a valid XML document.\");\n\t\t} catch(IOException ioe) {\n\t\t\tSystem.err.println(\"File not found: Path to a valid XML file has to be specified.\" );\n\t\t}\n\t}", "public JsnParser(String filename) {\n this.filename = filename;\n }", "public void fileRead(String filename) throws IOException;", "public static Document parse(String filename) throws ParserException {\n\n\t\tString FileID, Category, Title = null, Author = null, AuthorOrg = null, Place = null, NewsDate = null, Content = null, FileN;\n\t\tDocument d = new Document();\n\t\tif (filename == null || filename == \"\")\n\t\t\tthrow new ParserException();\n\t\tFileN = filename;\n\t\tHashMap<Integer, String> map = new HashMap<Integer, String>();\n\t\tBufferedReader r = null;\n\t\tFile file = new File(FileN);\n\t\tif (!file.exists())\n\t\t\tthrow new ParserException();\n\t\tFileID = file.getName();\n\t\tCategory = file.getParentFile().getName();\n\t\ttry {\n\t\t\tr = new BufferedReader(new FileReader(file));\n\t\t\tint i = 1, j = 3;\n\t\t\tBoolean isTitle = true, hasAuthor = false;\n\t\t\tString line;\n\t\t\twhile ((line = r.readLine()) != null) {\n\t\t\t\tline = line.trim();\n\t\t\t\tif (!line.equals(\"\")) {\n\t\t\t\t\tmap.put(i, line);\n\t\t\t\t\tif (isTitle) {\n\t\t\t\t\t\tTitle = line;\n\t\t\t\t\t\tisTitle = false;\n\t\t\t\t\t}\n\t\t\t\t\tif (hasAuthor == false && i == 2) {\n\t\t\t\t\t\tPattern pattern = Pattern\n\t\t\t\t\t\t\t\t.compile(\"<AUTHOR>(.+?)</AUTHOR>\");\n\t\t\t\t\t\tMatcher matcher = pattern.matcher(line);\n\t\t\t\t\t\tif (matcher.find()) {\n\t\t\t\t\t\t\tAuthor = matcher.group(1).replace(\"BY\", \"\");\n\t\t\t\t\t\t\tAuthorOrg = Author.substring(\n\t\t\t\t\t\t\t\t\tAuthor.lastIndexOf(\",\") + 1).trim();\n\t\t\t\t\t\t\tAuthor = Author.split(\",\")[0].trim();\n\t\t\t\t\t\t\thasAuthor = true;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tif (!hasAuthor && i == 2) {\n\t\t\t\t\t\tString[] str = checkPlace(line);\n\t\t\t\t\t\tContent = str[0];\n\t\t\t\t\t\tPlace = str[1];\n\t\t\t\t\t\tNewsDate = str[2];\n\t\t\t\t\t} else if (hasAuthor && i == 3) {\n\t\t\t\t\t\tString[] str = checkPlace(line);\n\t\t\t\t\t\tContent = str[0];\n\t\t\t\t\t\tPlace = str[1];\n\t\t\t\t\t\tNewsDate = str[2];\n\t\t\t\t\t\tj = 4;\n\t\t\t\t\t}\n\t\t\t\t\tif (i >= j) {\n\t\t\t\t\t\tContent = Content + map.get(i) + \"\\n\";\n\t\t\t\t\t}\n\t\t\t\t\ti++;\n\t\t\t\t}\n\t\t\t}\n\t\t\tr.close();\n\t\t} catch (IOException e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t\tif (Author != null) {\n\t\t\tAuthor = Author.replace(\"By\", \"\").trim();\n\t\t\td.setField(FieldNames.AUTHOR, Author);\n\t\t\td.setField(FieldNames.AUTHORORG, AuthorOrg);\n\t\t} \n\t\td.setField(FieldNames.FILEID, FileID);\n\t\td.setField(FieldNames.CATEGORY, Category);\n\t\td.setField(FieldNames.TITLE, Title);\n\t\td.setField(FieldNames.PLACE, Place);\n\t\td.setField(FieldNames.NEWSDATE, NewsDate);\n\t\td.setField(FieldNames.CONTENT, Content);\n\n\t\treturn d;\n\t}", "public static void reading(String fileName)\n {\n\n }", "public void parseFile(File file) throws IOException {\r\n if (file.isDirectory()) {\r\n for (File subFile : file.listFiles()) {\r\n if (subFile.isDirectory() || subFile.getName().endsWith(\".java\")) {\r\n parseFile(subFile);\r\n }\r\n }\r\n } else {\r\n parseSourceCode(new String(Files.readAllBytes(file.toPath()), StandardCharsets.UTF_8));\r\n }\r\n }", "public ImportCommand parseFile(File file) throws ParseException {\n\n FileReader fr;\n\n try {\n fr = new FileReader(file);\n } catch (FileNotFoundException fnfe) {\n throw new ParseException(\"File not found\");\n }\n\n BufferedReader br = new BufferedReader(fr);\n return parseLinesFromFile(br);\n }", "public SqlFileParser(String filename) {\n try {\n this.reader = new BufferedReader(new FileReader(filename));\n } catch (FileNotFoundException e) {\n throw new IllegalArgumentException(\"file not found \" + filename);\n }\n }", "public void parse(File file, HandlerBase handler) throws SAXException,\n IOException {\n if (file == null) {\n throw new IllegalArgumentException(\"file must not be null\");\n }\n if (file.isDirectory()) {\n throw new IllegalArgumentException(\"file must not be a directory\");\n }\n InputSource source = new InputSource(\"file:\" + file.getAbsolutePath());\n parse(source, handler);\n }", "public CommandParser(String filename) {\r\n try {\r\n sc = new Scanner(new File(filename));\r\n }\r\n catch (FileNotFoundException e) {\r\n e.printStackTrace();\r\n System.out.println(\"File not found.\");\r\n }\r\n }", "public void parse(File file, DefaultHandler handler) throws SAXException,\n IOException {\n if (file == null) {\n throw new IllegalArgumentException(\"file must not be null\");\n }\n if (file.isDirectory()) {\n throw new IllegalArgumentException(\"file must not be a directory\");\n }\n InputSource source = new InputSource(\"file:\" + file.getAbsolutePath());\n parse(source, handler);\n }", "public void load(String filename) {\n\t\tsetup();\n\t\tparseOBJ(getBufferedReader(filename));\n\t}", "@Override\n\tpublic void parse(String s) throws MalformedFileException {\n\t\t\n\t}", "@Override\n public void parse() {\n if (file == null)\n throw new IllegalStateException(\n \"File cannot be null. Call setFile() before calling parse()\");\n\n if (parseComplete)\n throw new IllegalStateException(\"File has alredy been parsed.\");\n\n FSDataInputStream fis = null;\n BufferedReader br = null;\n\n try {\n fis = fs.open(file);\n br = new BufferedReader(new InputStreamReader(fis));\n\n // Go to our offset. DFS should take care of opening a block local file\n fis.seek(readOffset);\n records = new LinkedList<T>();\n\n LineReader ln = new LineReader(fis);\n Text line = new Text();\n long read = readOffset;\n\n if (readOffset != 0)\n read += ln.readLine(line);\n\n while (read < readLength) {\n int r = ln.readLine(line);\n if (r == 0)\n break;\n\n try {\n T record = clazz.newInstance();\n record.fromString(line.toString());\n records.add(record);\n } catch (Exception ex) {\n LOG.warn(\"Unable to instantiate the updateable record type\", ex);\n }\n read += r;\n }\n\n } catch (IOException ex) {\n LOG.error(\"Encountered an error while reading from file \" + file, ex);\n } finally {\n try {\n if (br != null)\n br.close();\n\n if (fis != null)\n fis.close();\n } catch (IOException ex) {\n LOG.error(\"Can't close file\", ex);\n }\n }\n\n LOG.debug(\"Read \" + records.size() + \" records\");\n }", "void fileReader(String filename) \r\n\t\t{\r\n\r\n\t\ttry (Scanner s = new Scanner(new FileReader(filename))) { \r\n\t\t while (s.hasNext()) { \r\n\t\t \tString name = s.nextLine(); // read name untill space\r\n\t\t \tString str[] = name.split(\",\");\r\n\t\t \tString nam = str[0]; \r\n\t\t \tint number = Integer.parseInt(str[1]); // read number untill space\r\n\t\t this.addContact(nam, number);\r\n\t\t\r\n\t\t }\t\t \r\n\t\t \r\n\t\t} \r\n\t\tcatch (IOException e) {\r\n\t\t\te.printStackTrace();\r\n\t\t}\r\n\t\t}", "public void readFromTxtFile(String filename){\n try{\n File graphFile = new File(filename); \n Scanner myReader = new Scanner(graphFile); \n parseFile(myReader);\n myReader.close();\n } \n catch(FileNotFoundException e){\n System.out.println(\"ERROR: DGraphEdges, readFromTxtFile: file not found.\");\n e.printStackTrace();\n } \n }", "private void readFromFile(String filename) {\n\t\ttry {\n\t\t Scanner read = new Scanner(new File(filename));\n\t\t String line;\n\t\t int counter = 0;\n\t\t String temp;\n\t\t line = read.nextLine();\n\t\t temp = line.substring(0);\n\t\t height = convertToInt(temp);\n\n\t\t line = read.nextLine();\n\t\t temp = line.substring(0);\n\n\t\t length = convertToInt(temp);\n\t\t size = height*length;\n\t\t \n\t\t squares = new Square[size][size];\n\n\t\t while(read.hasNextLine()) {\n\t\t\t\tline = read.nextLine();\n\t\t \tfor (int i = 0; i < line.length(); i++) {\n\t\t \t temp = line.substring(i, i+1);\n\n\t\t \t if (temp.equals(\".\")) {\n\t\t \t\t\tsquares[counter][i] = new FindValue(0);\n\t\t \t } \n\t\t \t else {\n\t\t\t\t\t\tsquares[counter][i] = new PreFilled(convertToInt(temp));\n\t\t\t \t\t}\n\t\t \t}\n\t\t \tcounter++;\n\t\t }\n\t\t} catch(IOException e) {\n\t\t e.printStackTrace();\n\t\t}\n }", "public Document parseFile(String fileName) {\r\n log.debug(\"Parsing XML file... \" + fileName);\r\n DocumentBuilder docBuilder;\r\n Document doc = null;\r\n DocumentBuilderFactory docBuilderFactory = DocumentBuilderFactory.newInstance();\r\n docBuilderFactory.setIgnoringElementContentWhitespace(true);\r\n try {\r\n docBuilder = docBuilderFactory.newDocumentBuilder();\r\n }\r\n catch (ParserConfigurationException e) {\r\n log.debug(\"Wrong parser configuration: \" + e.getMessage());\r\n return null;\r\n }\r\n File sourceFile = new File(fileName);\r\n try {\r\n doc = docBuilder.parse(sourceFile);\r\n setDocument(doc);\r\n }\r\n catch (SAXException e) {\r\n log.debug(\"Wrong XML file structure: \" + e.getMessage());\r\n return null;\r\n }\r\n catch (IOException e) {\r\n log.debug(\"Could not read source file: \" + e.getMessage());\r\n }\r\n log.debug(\"XML file parsed\");\r\n return doc; \r\n }", "void open(String fileName) throws IOException, ParserConfigurationException, SAXException;", "public Parser( File inFile ) throws FileNotFoundException\r\n {\r\n if( inFile.isDirectory() )\r\n throw new FileNotFoundException( \"Excepted a file but found a directory\" );\r\n \r\n feed = new Scanner( inFile );\r\n lineNum = 1;\r\n }", "private void loadFromFile(String filename) {\n\t\tFile file = new File(filename);\n\t\tif (file.exists()) {\n\t\t\ttry {\n\t\t\t\tScanner scan = new Scanner(file);\n\t\t\t\twhile (scan.hasNextLine()) {\n\t\t\t\t\tString photoName = scan.nextLine().trim();\n\t\t\t\t\tFile photoFile = new File(scan.nextLine().trim());\n\t\t\t\t\tPhoto photo = new Photo(photoName, photoFile);\n\t\t\t\t\tphotos.add(photo);\n\t\t\t\t}\n\t\t\t\tscan.close();\n\t\t\t} catch (FileNotFoundException e) {\n\t\t\t\tSystem.err.println(\"Could not read album file: \" + e.getMessage());\n\t\t\t}\n\t\t} else {\n\t\t\tSystem.err.println(\"Album not found:: \" + file);\n\t\t}\n\t}", "public SparseDataset parse(String name, File file) throws FileNotFoundException, IOException, ParseException {\n return parse(name, new FileInputStream(file));\n }", "private void parseFile(String fileName) {\n\t\ttry {\n\t\t\tBufferedReader bufferedReader = new BufferedReader(new FileReader(fileName));\n\t\t\tString line;\n\t\t\tint counter = 0;\n\t\t\tString lastMethod = null;\n\t\t\t\n\t\t\twhile ((line = bufferedReader.readLine()) != null) {\n\t\t\t\t\n\t\t\t\t// Logic for method consolidation\n\t\t\t\tif (line.contains(\"Method Call\")) {\n\t\t\t\t\tlastMethod = line.substring(line.indexOf(\"target=\")+7);\n\t\t\t\t\tlastMethod = lastMethod.substring(lastMethod.indexOf('#')+1).replace(\"\\\"\",\"\").trim();\n\t\t\t\t\tlastMethod = lastMethod + \":\" + counter++;\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t\tif (line.contains(\"Field Write\")) {\n\t\t\t\t\tString[] tokens = line.split(\",\");\n\t\t\t\t\t\n\t\t\t\t\tString object = tokens[4].substring(tokens[4].indexOf(\"=\") + 1).replace(\"\\\"\", \"\").trim();\n\t\t\t\t\tString field = tokens[5].substring(0, tokens[5].indexOf(\"=\")).replace(\"\\\"\", \"\").trim();\n\t\t\t\t\tString value = tokens[5].substring(tokens[5].indexOf(\"=\") + 1).replace(\"\\\"\", \"\").trim();\n\t\t\t\t\tString fld = object.replace(\"/\", \".\") + \".\" + field;\n\t\t\t\t\tevents.add(new Event(fld, value, lastMethod));\n\t\t\t\t\t\n\t\t\t\t\tallFields.add(fld);\n\t\t\t\t}\n//\t\t\t\tif (line.contains(\"Method Returned\")) {\n//\t\t\t\t\t//operations for this method ended\n//\t\t\t\t}\n\t\t\t\t\n\t\t\t}\n\t\t\tbufferedReader.close();\n\t\t} catch (IOException e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t}", "ReleaseFile parse( InputStream is ) throws IOException;", "@Override\n public ArrayList parseFile(String pathToFile) {\n\n Scanner scanner = null;\n try {\n scanner = new Scanner(new File(pathToFile));\n } catch (FileNotFoundException e) {\n e.printStackTrace();\n }\n ArrayList<String> data = new ArrayList<>();\n while (scanner.hasNext()) {\n data.add(scanner.next());\n }\n scanner.close();\n\n return data;\n }", "public ArrayList<String> parseFile(String fileName) throws IOException {\n\t\tthis.parrsedArray = new ArrayList<String>();\n\t\tFileInputStream inFile = null;\n\n\t\tinFile = new FileInputStream(mngr.getPath() + fileName);\n\t\tDataInputStream in = new DataInputStream(inFile);\n\t\tBufferedReader reader = new BufferedReader(new InputStreamReader(in));\n\n\t\tString strLine;\n\n\t\twhile ((strLine = reader.readLine()) != null && strLine.length() > 0) {\n\t\t\t// Print the content on the console\n\t\t\tparrsedArray.add(strLine);\n\t\t}\n\n\t\tinFile.close();\n\n\t\treturn parrsedArray;\n\n\t}", "@Override\n @SneakyThrows\n public void process() {\n process(new FileReader(new File(fileName)));\n }", "public Parser(File file) {\n \t\t\ttry {\n \t\t\t\tload(new FileInputStream(file));\n \t\t\t} catch (Exception e) {\n \t\t\t\t// continue ... actual parsing will report errors\n \t\t\t}\n \t\t}", "public Scanner( String filename ) throws IOException\n {\n sourceFile = new PushbackInputStream(new FileInputStream(filename));\n \n nextToken = null;\n }", "public void initParser(String file) {\n if (checkFileExists(file)) {\n parseXml(file);\n }\n }", "public static final Document parse(final File f) {\r\n String uri = \"file:\" + f.getAbsolutePath();\r\n\r\n if (File.separatorChar == '\\\\') {\r\n uri = uri.replace('\\\\', '/');\r\n }\r\n\r\n return parse(new InputSource(uri));\r\n }", "private void parseFiles() throws ParserException{\n NodeList fileNodesList = root.getElementsByTagName(\"file\");\n for(int i=0; i<fileNodesList.getLength(); i++){\n filesToProcess.add(getFile((Element) fileNodesList.item(i)));\n }\n }", "private boolean parse(String fileName)\r\n {\r\n\t/* Make sure xml file exists */\r\n\tFile xml = new File(fileName);\r\n\tif(!xml.exists())\r\n\t {\r\n\t\tSystem.out.println(\"Error (parse): \" + fileName + \" does not exists\");\r\n\t\treturn false;\r\n\t }\r\n\r\n\t/* Create the filename */\r\n\ttry{\r\n\t /* create the parser */\r\n\t DefaultHandler handler = new ETDHandler(fileName);\r\n\r\n\t /* Remember, Remember, the fifth friday of every december */\r\n\t SAXParserFactory sax_fac = SAXParserFactory.newInstance();\r\n\t SAXParser sax_parser = sax_fac.newSAXParser();\r\n\t sax_parser.parse(xml, handler);\r\n\r\n\t}\r\n\tcatch(Throwable t)\r\n\t {\r\n\t\tSystem.out.println(\"Error (parse): \" + t.getMessage());\r\n\t\tt.printStackTrace();\r\n\t }\r\n\r\n\treturn true;\r\n }", "void processFile(File file);", "@Override\n public void parse() throws ParseException {\n\n /* parse file */\n try {\n\n Scanner scanner = new Scanner(file, CHARSET_UTF_8);\n\n MowerConfig mowerConfig = null;\n\n int lineNumber = 1;\n\n do {\n\n boolean even = lineNumber % 2 == 0;\n String line = scanner.nextLine();\n\n /* if nothing in the file */\n if ((line == null || line.isEmpty()) && lineNumber == 1) {\n\n throw new ParseException(\"Nothing found in the file: \" + file);\n\n /* first line: lawn top right position */\n } else if(lineNumber == 1) {\n\n Position lawnTopRight = Position.parsePosition(line);\n config.setLawnTopRightCorner(lawnTopRight);\n\n /* even line: mower init */\n } else if (even) {\n\n int lastWhitespace = line.lastIndexOf(' ');\n Position p = Position.parsePosition(line.substring(0, lastWhitespace));\n Orientation o = Orientation.parseOrientation(line.substring(lastWhitespace).trim());\n\n mowerConfig = new MowerConfig();\n mowerConfig.setInitialPosition(p);\n mowerConfig.setInitialOrientation(o);\n\n /* odd line: mower commands */\n } else {\n\n mowerConfig.setCommands(MowerCommand.parseCommands(line));\n config.addMowerConfig(mowerConfig);\n }\n\n lineNumber++;\n\n } while(scanner.hasNextLine());\n\n\n } catch (Exception e) {\n throw new ParseException(\"Exception: \" + e.getMessage());\n }\n\n }", "public static Document parse(String filename) throws ParserException {\n\t\tif (filename == null) {\n\t\t\tthrow new ParserException();\n\t\t}\n\t\tFile file = new File(filename);\n\t\tif (!file.exists() || !file.isFile()) {\n\t\t\tthrow new ParserException();\n\t\t}\n\t\tFile subDir = file.getParentFile();\n\t\tif (!subDir.exists() || !subDir.isDirectory()) {\n\t\t\tthrow new ParserException();\n\t\t}\n\t\t// Document should be valid by here\n\t\tDocument doc = new Document();\n\t\tFieldNames field = FieldNames.TITLE;\n\t\tList<String> authors = new LinkedList<String>();\n\t\tString content = new String();\n\t\tboolean startContent = false;\n\n\t\tdoc.setField(FieldNames.FILEID, file.getName());\n\t\tdoc.setField(FieldNames.CATEGORY, subDir.getName());\n\n\t\ttry {\n\t\t\tBufferedReader reader = new BufferedReader(new FileReader(file));\n\t\t\tString line = reader.readLine();\n\n\t\t\twhile (line != null) {\n\t\t\t\tif (!line.isEmpty()) {\n\t\t\t\t\tswitch (field) {\n\t\t\t\t\tcase TITLE:\n\t\t\t\t\t\tdoc.setField(field, line);\n\t\t\t\t\t\tfield = FieldNames.AUTHOR;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase AUTHOR:\n\t\t\t\t\tcase AUTHORORG:\n\t\t\t\t\t\tif (line.startsWith(\"<AUTHOR>\") || !authors.isEmpty()) {\n\t\t\t\t\t\t\tString[] seg = null;\n\t\t\t\t\t\t\tString[] author = null;\n\n\t\t\t\t\t\t\tline = line.replace(\"<AUTHOR>\", \"\");\n\t\t\t\t\t\t\tseg = line.split(\",\");\n\t\t\t\t\t\t\tauthor = seg[0].split(\"and\");\n\t\t\t\t\t\t\tauthor[0] = author[0].replaceAll(\"BY|By|by\", \"\");\n\t\t\t\t\t\t\t// Refines author names\n\t\t\t\t\t\t\tfor (int i = 0; i < author.length; ++i) {\n\t\t\t\t\t\t\t\tauthor[i] = author[i].trim();\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tauthor[author.length - 1] = author[author.length - 1]\n\t\t\t\t\t\t\t\t\t.replace(\"</AUTHOR>\", \"\").trim();\n\t\t\t\t\t\t\tauthors.addAll(Arrays.asList(author));\n\n\t\t\t\t\t\t\t// Saves author organization\n\t\t\t\t\t\t\tif (seg.length > 1) {\n\t\t\t\t\t\t\t\tdoc.setField(FieldNames.AUTHORORG, seg[1]\n\t\t\t\t\t\t\t\t\t\t.replace(\"</AUTHOR>\", \"\").trim());\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tif (line.endsWith(\"</AUTHOR>\")) {\n\t\t\t\t\t\t\t\t// Saves author\n\t\t\t\t\t\t\t\tdoc.setField(FieldNames.AUTHOR, authors\n\t\t\t\t\t\t\t\t\t\t.toArray(new String[authors.size()]));\n\t\t\t\t\t\t\t\tfield = FieldNames.PLACE;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t// This should be a PLACE\n\t\t\t\t\t\t\tfield = FieldNames.PLACE;\n\t\t\t\t\t\t}\n\t\t\t\t\tcase PLACE:\n\t\t\t\t\t\tif (!line.contains(\"-\")) {\n\t\t\t\t\t\t\tfield = FieldNames.CONTENT;\n\t\t\t\t\t\t\tstartContent = true;\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tString[] seg = line.split(\"-\");\n\t\t\t\t\t\t\tString[] meta = seg[0].split(\",\");\n\t\t\t\t\t\t\tif (seg.length != 0 && !seg[0].isEmpty()) {\n\n\t\t\t\t\t\t\t\tif (meta.length > 1) {\n\t\t\t\t\t\t\t\t\tdoc.setField(\n\t\t\t\t\t\t\t\t\t\t\tFieldNames.PLACE,\n\t\t\t\t\t\t\t\t\t\t\tseg[0].substring(0,\n\t\t\t\t\t\t\t\t\t\t\t\t\tseg[0].lastIndexOf(\",\"))\n\t\t\t\t\t\t\t\t\t\t\t\t\t.trim());\n\t\t\t\t\t\t\t\t\tdoc.setField(FieldNames.NEWSDATE,\n\t\t\t\t\t\t\t\t\t\t\tmeta[meta.length - 1].trim());\n\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\tmeta[0] = meta[0].trim();\n\t\t\t\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\t\t\t\tnew SimpleDateFormat(\"MMM d\",\n\t\t\t\t\t\t\t\t\t\t\t\tLocale.ENGLISH).parse(meta[0]);\n\t\t\t\t\t\t\t\t\t\t// This is a news date\n\t\t\t\t\t\t\t\t\t\tdoc.setField(FieldNames.NEWSDATE,\n\t\t\t\t\t\t\t\t\t\t\t\tmeta[0]);\n\t\t\t\t\t\t\t\t\t} catch (ParseException e) {\n\t\t\t\t\t\t\t\t\t\t// This is a place\n\t\t\t\t\t\t\t\t\t\tdoc.setField(FieldNames.PLACE, meta[0]);\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\tfield = FieldNames.CONTENT;\n\t\t\t\t\tcase CONTENT:\n\t\t\t\t\t\tif (!startContent) {\n\t\t\t\t\t\t\t// First line of content\n\t\t\t\t\t\t\tString[] cont = line.split(\"-\");\n\t\t\t\t\t\t\tif (cont.length > 1) {\n\t\t\t\t\t\t\t\tfor (int i = 1; i < cont.length; ++i) {\n\t\t\t\t\t\t\t\t\tcontent += cont[i];\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tstartContent = true;\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tcontent += \" \" + line;\n\t\t\t\t\t\t}\n\t\t\t\t\tdefault:\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tline = reader.readLine();\n\t\t\t}\n\t\t\tdoc.setField(FieldNames.CONTENT, content);\n\t\t\tdoc.setField(FieldNames.LENGTH, Integer.toString(content.trim().split(\"\\\\s+\").length));\n\t\t\treader.close();\n\t\t} catch (IOException e) {\n\t\t\tthrow new ParserException();\n\t\t}\n\n\t\treturn doc;\n\t}", "public void load(String filename){\n //Create a file if its not already on disk\n File extDir = new File(this.getFilesDir(), filename);\n\n //Read text from file\n StringBuilder text = new StringBuilder();\n\n\n //Needs lots of try and catch blocks because so much can go wrong\n try{\n\n BufferedReader br = new BufferedReader(new FileReader(extDir));\n String line;\n\n while ((line = br.readLine()) != null) {\n text.append(line);\n text.append('\\n');\n }//end while\n\n br.close();//Close the buffer\n }//end try\n catch (FileNotFoundException e){//If file not found on disk here.\n Toast.makeText(this, \"There was no data to load\", Toast.LENGTH_LONG).show();\n e.printStackTrace();\n }\n\n catch (IOException e)//If io Exception here\n {\n Toast.makeText(this, \"Error loading file\", Toast.LENGTH_LONG).show();\n e.printStackTrace();\n }//end catch\n\n\n //Set the data from the file content and conver it to a String\n String data = new String(text);\n\n //Safety first Parse data if available.\n if (data.length() > 0) {\n parseXML(data);\n }\n else\n Toast.makeText(this, \"There is no data to display\", Toast.LENGTH_LONG).show();\n }", "public Document parse(File aFile)\n\t\t\t\t throws org.xml.sax.SAXException, java.io.IOException {\n\t\t/**\n\t\t * @todo Fix/implement this later\n\t\t */\n\t\tthrow new SAXException(\"Not supported\");\n\t}", "private ArrayList<String> parseFile(String file_name){ // extract each line from file AS string (stopList)\r\n ArrayList<String> list = new ArrayList<>();\r\n Scanner scanner = null;\r\n try{\r\n scanner = new Scanner(new BufferedReader(new FileReader(file_name)));\r\n while (scanner.hasNextLine())\r\n {\r\n list.add(scanner.nextLine());\r\n }\r\n }\r\n catch (Exception e ){ System.out.println(\"Error reading file -> \"+e.getMessage()); }\r\n finally {\r\n if(scanner != null ){scanner.close();} // close the file\r\n }\r\n return list;\r\n }", "public void parseFile(String filePath) {\r\n\r\n\t\t// get the file content\r\n\t\tString fileContent = getFileContent(filePath);\r\n\r\n\t\tJSONObject flightEnvObj = new JSONObject(fileContent);\r\n\r\n\t\tairports = flightEnvObj.getJSONObject(\"airports\");\r\n\t\t@SuppressWarnings(\"unused\")\r\n\t\tJSONObject bufferGeometry = flightEnvObj.getJSONObject(\"bufferGeometry\");\r\n\t\twaypoints = flightEnvObj.getJSONObject(\"pathPoints\");\r\n\t\troutes = flightEnvObj.getJSONObject(\"paths\");\r\n\r\n\t\t_airportsFeatures = airports.getJSONArray(\"features\");\r\n\t\t_waypointsFeatures = waypoints.getJSONArray(\"features\");\r\n\t\t_routesFeatures = routes.getJSONArray(\"features\");\r\n\r\n\t\t// call private method\r\n\t\tgenerateLayerAirports();\r\n\t\tgenerateLayerWaypoints();\r\n\t\tgenerateLayerRoutes();\r\n\r\n\t}", "public Parser(String fileHandle) {\n\t\tmainFile = fileHandle;\n\t}", "public static MobilityMap parseMap( String filename ) throws FileNotFoundException\r\n {\r\n File f = new File( filename );\r\n return parseMap( f );\r\n }", "public void load(String filename) throws IOException\n {\n FileInputStream input;\n\n try {\n input = new FileInputStream(new File(filename));\n }\n catch (Exception e)\n {\n throw new IOException(\"Cannot open input file \" + filename + \":\" + e.getMessage());\n }\n load(input);\n input.close();\n }", "private void parseFile(Project p, File f, ImportSettings settings, int pass)\n throws ImportException {\n\n\n try {\n BufferedInputStream bs = new BufferedInputStream(new FileInputStream(f));\n Lexer l = new Lexer(bs, f.getAbsolutePath());\n TokenCollection toks = l.lex();\n Parser px = new Parser();\n CompilationUnitNode cu = px.parse(toks, l.StringLiterals);\n parsedElements.add(cu);\n } catch (FeatureNotSupportedException e) {\n //throw new ImportException(\"Error parsing file: \" + f.getAbsolutePath() + \" due to: \"+e.getMessage());\n System.out.println(\"Error parsing file: \" + f.getAbsolutePath() + \" due to: \"+e.getMessage());\n } catch (Exception e) {\n// e.printStackTrace(); //To change body of catch statement use File | Settings | File Templates.\n// throw new ImportException(\"Error parsing file: \" + f.getAbsolutePath());\n System.out.println(\"Error parsing file: \" + f.getAbsolutePath());\n }\n\n }", "private void parseFile(String fileName) {\n Set<String> inputs = new HashSet<String>();\n Set<String> outputs = new HashSet<String>();\n double[] qos = new double[4];\n\n Properties p = new Properties(inputs, outputs, qos);\n\n try {\n Scanner scan = new Scanner(new File(fileName));\n while(scan.hasNext()) {\n\t\t\t\tString name = scan.next();\n\t\t\t\tString inputBlock = scan.next();\n\t\t\t\tString outputBlock = scan.next();\n\n\t\t\t\tqos[TIME] = scan.nextDouble();\n\t\t\t\tqos[COST] = scan.nextDouble();\n\t\t\t\tqos[AVAILABILITY] = scan.nextDouble()/100;\n\t\t\t\tqos[RELIABILITY] = scan.nextDouble()/100;\n\t\t\t\t// Throw the other two away;\n\t\t\t\tscan.nextDouble();\n\t\t\t\tscan.nextDouble();\n\n\t\t\t\tfor (String s :inputBlock.split(\",\"))\n\t\t\t\t\tinputs.add(s);\n\t\t\t\tfor (String s :outputBlock.split(\",\"))\n\t\t\t\toutputs.add(s);\n\n p = new Properties(inputs, outputs, qos);\n\n ServiceNode ws = new ServiceNode(name, p);\n serviceMap.put(name, ws);\n inputs = new HashSet<String>();\n outputs = new HashSet<String>();\n qos = new double[4];\n }\n scan.close();\n }\n catch(IOException ioe) {\n System.out.println(\"File parsing failed...\");\n }\n\t\tnumServices = serviceMap.size();\n }", "public void readFromFile(String fileName)\r\n\t{\r\n\r\n\t\tScanner fileScanner = null;\r\n\t\ttry\r\n\t\t{\r\n\t\t\tfileScanner = new Scanner(new File(fileName));\r\n\t\t}\r\n\t\tcatch(FileNotFoundException e)\r\n\t\t{\r\n\t\t\te.printStackTrace();\r\n\t\t}\r\n\t\twhile(fileScanner.hasNext())\r\n\t\t{\r\n\t\t\tString fileLine = fileScanner.nextLine();\r\n\t\t\tString[] splitLines = fileLine.split(\" \",2);\r\n\t\t\t//checks each word and makes sure it is ok\r\n\t\t\tif(splitLines[0].equalsIgnoreCase(\"Name\"))\r\n\t\t\t{\r\n\t\t\t\tname = splitLines[1];\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif(splitLines[0].equalsIgnoreCase(\"Speed\"))\r\n\t\t\t{\r\n\t\t\t\tspeed = Double.parseDouble(splitLines[1]);\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif(splitLines[0].equalsIgnoreCase(\"Strength\"))\r\n\t\t\t{\r\n\t\t\t\tstrength = Integer.parseInt(splitLines[1]);\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif(splitLines[0].equalsIgnoreCase(\"HP\"))\r\n\t\t\t{\r\n\t\t\t\thp = Integer.parseInt(splitLines[1]);\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif(splitLines[0].equalsIgnoreCase(\"Weapon\"))\r\n\t\t\t{\r\n\t\t\t\t\tweapon = splitLines[1];\r\n\t\t\t}\r\n\t\t\t\r\n\t\t}\r\n\t\tfileScanner.close();\r\n\t\r\n\t}", "public ObjReader(String filename){\n file = filename;\n }", "public static Document parse(String filename) throws ParserException {\n\t\t// TODO YOU MUST IMPLEMENT THIS\n\t\t// girish - All the code below is mine\n\t\t\t\n\t\t// Creating the object for the new Document\n\t\t\n\t\t\n\t\tif (filename == null){\n\t\t\tthrow new ParserException();\n\t\t}\n\t\t\n\t\t// Variable indexPos to track the current pointer location in the String Array\n\t\tint indexPos = 0;\n\t\t\n\t\t// Creating an instance of the document class to store the parsed content\n\t\tDocument d = new Document();\n\t\t\n\t\t// to store the result sent from the regexAuthor method and regexPlaceDate method\n\t\tObject[] resultAuthor = {null, null, null};\n\t\tObject[] resultPlaceDate = {null, null, null};\n\t\tStringBuilder news = new StringBuilder();\n\t\t\n\t\t// Next 4 lines contains the code to get the fileID and Category metadata\n\t\tString[] fileCat = new String[2];\n\t\t\n\t\tfileCat = regexFileIDCat(\"/((?:[a-z]|-)+)/([0-9]{7})\", filename);\n\t\t// System.out.println(filename);\n\t\t// throw an exception if the file is blank, junk or null\n\t\tif (fileCat[0] == null){\n\t\t\tthrow new ParserException();\n\t\t}\n\t\td.setField(FieldNames.CATEGORY, fileCat[0]);\n\t\td.setField(FieldNames.FILEID, fileCat[1]);\n\t\t\n\t\t\n\t\t// Now , parsing the file\n\t\tFile fileConnection = new File(filename);\n\t\t\n\t\t// newscollated - it will store the parsed file content on a line by line basis\n\t\tArrayList<String> newscollated = new ArrayList<String>();\n\t\t\n\t\t// String that stores the content obtained from the . readline() operation\n\t\tString temp = null;\n\t\t\n\t\ttry\n\t\t{\n\t\t\t\n\t\t\tBufferedReader getInfo = new BufferedReader(new FileReader(fileConnection));\n\t\t\twhile ((temp = getInfo.readLine()) != null)\n\t\t\t{\n\t\t\t\tif(temp.equals(\"\"))\n\t\t\t\t{\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\t\n\t\t\t\t\ttemp = temp + \" \";\n\t\t\t\t\tnewscollated.add(temp);\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t\n\t\t\t}\n\t\t\tgetInfo.close();\n\t\t\t\n\t\t\t//-- deprecated (REMOVE THIS IF OTHER WORKS)\n\t\t\t// setting the title using the arraylist's 0th index element\n\t\t\t//d.setField(FieldNames.TITLE, newscollated.get(0));\n\t\t\t\n\t\t\t// Appending the lines into one big string using StringBuilder\n\t\t\t\n\t\t\tfor (String n: newscollated)\n\t\t\t{\n\t\t\t\tnews.append(n);\n\t\t\t}\n\t\t\t\n\t\t\t\n\t\t\t// Obtaining the TITLE of the file\n\t\t\tObject[] titleInfo = new Object[2];\n\t\t\t\n\t\t\ttitleInfo = regexTITLE(\"([^a-z]+)\\\\s{2,}\", news.toString());\n\t\t\td.setField(FieldNames.TITLE, titleInfo[0].toString().trim());\n\t\t\tindexPos = (Integer) titleInfo[1];\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t\t// Getting the Author and Author Org\n\t\t\tresultAuthor = regexAuthor(\"<AUTHOR>(.*)</AUTHOR>\", news.toString());\n\t\t\t\n\t\t\tif (resultAuthor[0] != null)\n\t\t\t{\n\t\t\t\td.setField(FieldNames.AUTHOR, resultAuthor[0].toString());\n\t\t\t}\n\t\t\t\n\t\t\tif (resultAuthor[1] != null)\n\t\t\t{\n\t\t\t\td.setField(FieldNames.AUTHORORG, resultAuthor[1].toString());\n\t\t\t}\n\t\t \n\t\t \n\t\t \n\t\t if ((Integer) resultAuthor[2] != 0)\n\t\t {\n\t\t \tindexPos = (Integer) resultAuthor[2];\n\t\t }\n\t\t\t\n\t\t \n\t\t \n\t\t // Getting the Place and Date\n \t\t\tresultPlaceDate = regexPlaceDate(\"\\\\s{2,}(.+),\\\\s(?:([A-Z][a-z]+\\\\s[0-9]{1,})\\\\s{1,}-)\", news.toString());\n \t\t\t\n \t\t\tif (resultPlaceDate[0] != null)\n \t\t\t{\n \t\t\t\td.setField(FieldNames.PLACE, resultPlaceDate[0].toString().trim());\n \t\t\t}\n \t\t \n \t\t\tif (resultPlaceDate[1] != null)\n \t\t\t{\n \t\t\t\td.setField(FieldNames.NEWSDATE, resultPlaceDate[1].toString().trim());\n \t\t\t}\n \t\t\t\n \t\t // getting the content\n \t\t \n \t\t if ((Integer) resultPlaceDate[2] != 0)\n\t\t {\n\t\t \tindexPos = (Integer) resultPlaceDate[2];\n\t\t }\n \t\t \n \t\t \n \t\t d.setField(FieldNames.CONTENT, news.substring(indexPos + 1));\n \t\t \n \t\t return d;\n \t\t \n\t\t \n\t\t \n\t\t\t\n\t\t\t\n\t\t}\n\t\tcatch(FileNotFoundException e){\n\t\t\tthrow new ParserException();\n\t\t\t\n\t\t}\n\n\t\tcatch(IOException e){\n\t\t\tthrow new ParserException();\n\t\t}\n\t\t\n\t\tcatch(Exception e){\n\t\t\te.printStackTrace();\n\t\t\t\n\t\t}\n\t\treturn d;\n\t\t\n\t\t\n\t\t\n\t\t\n\t\t\n\t}", "void visitFile(File file);", "public void parseFile() {\n File file = new File(inputFile);\n try {\n Scanner scan = new Scanner(file);\n\n while (scan.hasNextLine()) {\n String line = scan.nextLine();\n line = line.replaceAll(\"\\\\s+\", \" \").trim();\n\n if (line.isEmpty()) {\n continue;\n }\n // System.out.println(line);\n String cmd = line.split(\" \")[0];\n String lineWithoutCmd = line.replaceFirst(cmd, \"\").trim();\n // System.out.println(lineWithoutCmd);\n\n // The fields following each command\n String[] fields;\n\n switch (cmd) {\n case (\"add\"):\n fields = lineWithoutCmd.split(\"<SEP>\");\n fields[0] = fields[0].trim();\n fields[1] = fields[1].trim();\n fields[2] = fields[2].trim();\n add(fields);\n break;\n case (\"delete\"):\n\n fields = split(lineWithoutCmd);\n delete(fields[0], fields[1]);\n break;\n case (\"print\"):\n if (lineWithoutCmd.equals(\"ratings\")) {\n printRatings();\n break;\n }\n fields = split(lineWithoutCmd);\n\n print(fields[0], fields[1]);\n\n break;\n case (\"list\"):\n // need to check if it is the movie or reviewer\n fields = split(lineWithoutCmd);\n list(fields[0], fields[1]);\n break;\n case (\"similar\"):\n // need to check if it is the movie or reviewer\n fields = split(lineWithoutCmd);\n similar(fields[0], fields[1]);\n break;\n default:\n break;\n }\n\n }\n\n }\n catch (FileNotFoundException e) {\n e.printStackTrace();\n }\n }", "public void readFile(String file)\n\t{\t\n\t\tfindPieces(file);\n\t}", "@Override\r\n\t\t\t\tpublic void run() {\n\t\t\t\t\tparseFile(\"english_file.txt\");\r\n\t\t\t\t}", "public void fileLoaderMethod(String filename) {\n\t\t\n\t\tString fileloc = \"\";\n\t\tif(!prf.foldername.getText().equals(\"\"))\n\t\t\tfileloc += prf.foldername.getText()+\"/\";\n\t\t\n\t\tfileloc += filename;\n\t\tFile fl = new File(fileloc);\n\t\t\n\t\tString code = \"\";\n\t\t\n\t\tif(!fl.exists()) {\n\t\t\tJOptionPane.showMessageDialog(null, \"The specified file doesnt exist at the given location.\");\n\t\t} else {\t\n\t\t\ttry {\n\t\t\t\tFileReader flrd = new FileReader(fileloc);\n\t\t\t\tBufferedReader bufread = new BufferedReader(flrd);\t\t\n\t\t\t\tString str;\n\t\t\t\twhile((str = bufread.readLine()) != null) {\n\t\t\t\t\tcode += str + \"\\n\";\n\t\t\t\t}\t\t\n\t\t\t\tbufread.close();\n\t\t\t\tflrd.close();\t\t\t\n\t\t\t} catch (IOException e) {\n\t\t\t\te.printStackTrace();\n\t\t\t}\n\t\t}\t\n\t\tinterpretorMainMethod(code, 0);\n\t}", "public SparseDataset parse(File file) throws FileNotFoundException, IOException, ParseException {\n String name = file.getPath();\n return parse(name, new FileInputStream(file));\n }", "public ClassParser(final String file_name) {\n this.file_name = file_name;\n fileOwned = true;\n }", "public void loadFile(File p_file) throws IOException;", "Program( String filename ) throws IOException, ParserException, EvaluationException\n\t\t{\n\t\t\tmParser = new Parser();\n\t\t\t\n\t\t\tFileReader r = new FileReader( filename );\n\t\t\t\n\t\t\tStringBuilder builder = new StringBuilder();\n\t\t\t\n\t\t\tint ch = -1;\n\t\t\twhile( ( ch = r.read() ) >= 0 )\n\t\t\t{\n\t\t\t\tbuilder.append( (char) ch );\n\t\t\t}\n\t\t\tmProgram = builder.toString();\n\t\t\t\n\t\t\tmParser.parse( mProgram );\n\t\t}", "@SuppressWarnings(\"resource\")//I ADDED\n\tpublic static CensusData parse(String filename) {\n\t\tCensusData result = new CensusData();\n\t\t\n try {\n BufferedReader fileIn = new BufferedReader(new FileReader(filename));\n \n // Skip the first line of the file\n // After that each line has 7 comma-separated numbers (see constants above)\n // We want to skip the first 4, the 5th is the population (an int)\n // and the 6th and 7th are latitude and longitude (floats)\n // If the population is 0, then the line has latitude and longitude of +.,-.\n // which cannot be parsed as floats, so that's a special case\n // (we could fix this, but noisy data is a fact of life, more fun\n // to process the real data as provided by the government)\n \n String oneLine = fileIn.readLine(); // skip the first line\n\n // read each subsequent line and add relevant data to a big array\n while ((oneLine = fileIn.readLine()) != null) {\n String[] tokens = oneLine.split(\",\");\n if(tokens.length != TOKENS_PER_LINE)\n \tthrow new NumberFormatException();\n int population = Integer.parseInt(tokens[POPULATION_INDEX]);\n if(population != 0)\n \tresult.add(population,\n \t\t\t Float.parseFloat(tokens[LATITUDE_INDEX]),\n \t\t Float.parseFloat(tokens[LONGITUDE_INDEX]));\n }\n\n fileIn.close();\n } catch(IOException ioe) {\n System.err.println(\"Error opening/reading/writing input or output file.\");\n System.exit(1);\n } catch(NumberFormatException nfe) {\n System.err.println(nfe.toString());\n System.err.println(\"Error in file format\");\n System.exit(1);\n }\n return result;\n\t}", "public Document getDocFromFile(String filename)\r\n throws ParserConfigurationException{\r\n {\r\n DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();\r\n DocumentBuilder db = dbf.newDocumentBuilder();\r\n Document doc = null;\r\n try{\r\n doc = db.parse(filename);\r\n }\r\n catch (Exception ex){\r\n System.out.println(\"XML parse failure\");\r\n ex.printStackTrace();\r\n }\r\n return doc;\r\n } \r\n }", "private String[] loadFile(String filename) {\n\t\treturn loadFile(filename, new String[0], System.lineSeparator());\n\t}", "public JsonParser createParser(File f)\n/* */ throws IOException, JsonParseException\n/* */ {\n/* 755 */ IOContext ctxt = _createContext(f, true);\n/* 756 */ InputStream in = new FileInputStream(f);\n/* 757 */ return _createParser(_decorate(in, ctxt), ctxt);\n/* */ }", "public void load(String filename) throws IOException\n {\n DataInputStream input;\n\n try\n {\n input = new DataInputStream(new BufferedInputStream(new FileInputStream(new File(filename))));\n }\n catch (Exception e)\n {\n throw new IOException(\"Cannot open input file \" + filename + \":\" + e.getMessage());\n }\n load(input);\n input.close();\n }", "@Override\n\tpublic void run() {\n\n\t\ttry {\n\t\t\tBufferedReader br = new BufferedReader(new InputStreamReader(new FileInputStream(file)));\n\t\t\tString line = null;\n\n\t\t\twhile ((line = br.readLine()) != null) {\n\t\t\t\tString[] record = line.trim().split(\"@\");\n\t\t\t\tif (record.length != 2)\n\t\t\t\t\tcontinue;\n\t\t\t\tparse(record[0], record[1]);\n\n\t\t\t}\n\t\t\t// close buffer reader\n\t\t\tbr.close();\n\t\t\t// Debug catch An exception\n\t\t} catch (Exception e) {\n\t\t\te.printStackTrace();\n\n\t\t}\n\t}", "public ReadFile (String file) throws java.io.FileNotFoundException\n {\n reader = new java.io.FileReader(file);\t\t//Construct the file reader\n br = new java.io.BufferedReader(reader);\t//Wrap it with a BufferedReader\n assert this.isValid(); \t\t\t//Make sure all is well and we can read the file\n }", "public static Document parseXMLFile(final String fileName) throws IOException {\n\t\treturn parseXMLFile(new File(fileName));\n\t}", "public void load (File file) throws Exception;", "public void parseFile() throws IOException {\r\n\t\tFileInputStream inputStream = new FileInputStream(FILE_PATH);\r\n\t\tScanner sc = new Scanner(inputStream, \"UTF-8\");\r\n\r\n\t\tString line = \"\";\r\n\t\t\r\n\t\twhile (sc.hasNextLine()) {\r\n\t\t\ttry{line = sc.nextLine();} catch(Exception e){System.out.println(e);}\r\n\t\t\tif(line.indexOf(comment_char)==0) {\r\n\t\t\t\tcontinue;\r\n\t\t\t} else {\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\tif(header == true) {\r\n//\t\t\tline = sc.nextLine();\r\n\t\t\tString[] linee = line.split(delimiter);\r\n\t\t\tthis.fieldNames = linee;\r\n\t\t\tfor(int i = 0; i < linee.length; i++) {\r\n\t\t\t\tcolumnMapping.put(linee[i], i);\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\twhile (sc.hasNextLine()) {\r\n\t\t\ttry{line = sc.nextLine();} catch(Exception e){System.out.println(e);}\r\n\t\t\tdf.add(line.split(delimiter, -1));\r\n//\t\t\tif(df.get(df.size()-1).length != this.fieldNames.length) {\r\n//\t\t\t\tSystem.out.println(this.FILE_PATH);\r\n//\t\t\t\tSystem.out.println(String.join(\" \", df.get(df.size()-1)));\r\n//\t\t\t}\r\n\t\t\tfor(int i = 0; i < df.get(df.size()-1).length; i++) {\r\n\t\t\t\tif(df.get(df.size()-1)[i].equals(\"\")) {\r\n\t\t\t\t\tdf.get(df.size()-1)[i] = \"0\";\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\tinputStream.close();\r\n\t\tsc.close();\t\r\n\t}", "public static ArrayList<String> parseFile(String f) throws Exception {\n\t\tArrayList<CommandNode> cmdNode = new ArrayList<CommandNode>();\n\t\tArrayList<MemoryNode> memNode = new ArrayList<MemoryNode>();\n\t\tparseFile(f,cmdNode,memNode);\n\t\treturn preCompile(cmdNode, memNode);\n\t}", "private void parse() {\n if (workingDirectory != null) {\n Parser.initConstants(this, workingDirectory, remainderFile);\n Parser.parseIt();\n workingDirectory = null;\n remainderFile = null;\n jbParse.setEnabled(false);\n }\n }", "public String readFile(String filename)\n {\n StringBuilder texts = new StringBuilder();\n \n try \n {\n FileReader inputFile = new FileReader(filename);\n Scanner parser = new Scanner(inputFile);\n \n while (parser.hasNextLine())\n {\n String line = parser.nextLine();\n texts.append(line + \";\");\n }\n \n inputFile.close();\n parser.close();\n return texts.toString();\n \n }\n \n catch(FileNotFoundException exception) \n {\n String error = filename + \" not found\";\n System.out.println(error);\n return error;\n }\n \n catch(IOException exception) \n {\n String error = \"Unexpected I/O error occured\";\n System.out.println(error); \n return error;\n } \n }", "public void readFile(File file){\n try{\n scan = new Scanner(file);\n while(scan.hasNextLine()){\n String line = scan.nextLine();\n if(line.startsWith(\"//\")){\n continue;\n }\n process(line);\n }\n }catch(IOException e){\n Alert alert = new Alert(AlertType.INFORMATION);\n alert.setTitle(\"\");\n alert.setHeaderText(null);\n alert.setContentText(\"Oops the input was not read properly\");\n alert.showAndWait();\n e.printStackTrace();\n }catch(NullPointerException e){\n Alert alert = new Alert(AlertType.INFORMATION);\n alert.setTitle(\"\");\n alert.setHeaderText(null);\n alert.setContentText(\"Oops the input was not read properly\");\n alert.showAndWait();\n e.printStackTrace();\n \n }\n }", "void load(File file);", "private Document parseFile() throws IOException {\n\tString contents = instream_to_contents();\n\tDocument doc = Jsoup.parse(contents);\n\treturn doc;\n }", "public void readRules( String filename ) {\r\n\t\ttry {\r\n\t\t\ts.readRules(filename);\r\n\t\t} catch (Exception e) {\r\n\t\t\te.printStackTrace();\r\n\t\t}\r\n\t}", "private void parseFile(IFile file) throws CoreException, IOException {\r\n \t\tBufferedReader reader = new BufferedReader(new InputStreamReader(file.getContents()));\r\n \t\tString nxt = \"\";\r\n \t\tStringBuilder builder = new StringBuilder();\r\n \t\tbuilder.append(reader.readLine());\r\n \t\twhile (nxt!=null) {\r\n \t\t\tnxt = reader.readLine();\r\n \t\t\tif (nxt!=null) {\r\n \t\t\t\tbuilder.append(\"\\n\");\r\n \t\t\t\tbuilder.append(nxt);\r\n \t\t\t}\r\n \t\t}\r\n \t\t// QUESTION: does this trigger the reconcilers?\r\n \t\tset(builder.toString());\r\n \t}", "public void readFromFile() {\n\n\t}", "private void readMonsters(String filename)\r\n throws FileNotFoundException, IOException, ParseException {\r\n\r\n this.filename = filename;\r\n\r\n slugIndex = new BTree<String, Integer>(7);\r\n typeIndex = new BTree<String, Integer>(7);\r\n crIndex = new BTree<Float, Integer>(7);\r\n xpIndex = new BTree<Integer, Integer>(7);\r\n\r\n JSONParser parser = new JSONParser();\r\n JSONObject json = (JSONObject) parser.parse(new FileReader(filename));\r\n JSONArray monsters = (JSONArray) json.get(\"results\");\r\n\r\n for (int i = 0; i < monsters.size(); i++) {\r\n JSONObject jsonMon = (JSONObject) monsters.get(i);\r\n String slug = (String) jsonMon.get(\"slug\");\r\n String type = (String) jsonMon.get(\"type\");\r\n float CR = (float) jsonMon.get(\"challenge_rating\");\r\n Integer XP = this.convertToXP(CR);\r\n slugIndex.insert(slug, i);\r\n if (type.length() > 0) {\r\n typeIndex.insert(type, i);\r\n }\r\n crIndex.insert(CR, i);\r\n xpIndex.insert(XP, i);\r\n }\r\n }", "public void loadFile(String fname) \n\t{\n\t\t// use Scanner used to read the file\n\t\ttry{\n\t\t\tScanner scan = new Scanner(new FileReader(fname));\n\t\t\t//read in number of row and column in the first line\n\t\t\treadRC(scan);\n\t\t\treadMaze(scan);\n\t\t\t//close the scanner\n\t\t\tscan.close();\t\t\t\t\t\t\t\t\n\t\t}catch(FileNotFoundException e){\n\t\t\tSystem.out.println(\"FileNotFound\"+e.getMessage());\n\t\t}\n\t}", "public FlashCardReader(String filename)\n\t{\t\n\t\ttry\n\t\t{\n\t\t\tFileReader freader = new FileReader(filename);\n\t\t\treader = new BufferedReader(freader);\n\t\t} catch(FileNotFoundException fnfe)\n\t\t{\n\t\t\tSystem.out.println(\"File not found!\");\n\t\t\tnotFound = true;\n\t\t}\n\t}", "private SourceFile _parseString(String txt) throws ParseException {\n ACParser p = new ACParser(txt);\n return p.SourceFile();\n }", "@VisibleForTesting\n\tDocument parseLocalFile(String url) throws IOException {\n\t\treturn Jsoup.parse(new File(url), \"UTF-8\", \"\");\n\t}", "public static void readFile(String filename) {\n JSONParser jsonParser = new JSONParser();\n try (Reader reader = new FileReader(filename)) {\n JSONObject jo = (JSONObject) jsonParser.parse(reader);\n\n SHORT_PERIOD = (int) (long) jo.get(\"shortPeriod\");\n LONG_PERIOD = (int) (long) jo.get(\"longPeriod\");\n AVG_AMOUNT_PERIOD = (int) (long) jo.get(\"avgAmountPeriod\");\n SESSION_INTERVAL = (int) (long) jo.get(\"sessionInterval\");\n\n\n } catch (IOException | ParseException e) {\n e.printStackTrace();\n }\n }", "private HashMap<ASTNode, NodeInfo> parseFile(String file) {\n ASTParser parser = ASTParser.newParser(AST.JLS3);\n parser.setSource(file.toCharArray());\n parser.setKind(ASTParser.K_COMPILATION_UNIT);\n final CompilationUnit cu = (CompilationUnit) parser.createAST(null);\n ASTStatsCollector astStatsCollector = new ASTStatsCollector(cu);\n cu.accept(astStatsCollector);\n\n\n return astStatsCollector.nodeSubNodeMap;\n }", "public void loadFile(String fileName) {//Retrieves name of file\r\n\t\tString line = null;\r\n\t\ttry{\r\n\t\t\tFileReader open = new FileReader(fileName);\r\n\t\t\tBufferedReader read = new BufferedReader(open);\r\n\t\t\twhile((line = read.readLine()) != null) {\r\n String[] parts = line.split(\" \");\r\n String part1 = parts[0];\r\n String part2 = parts[1];\r\n System.out.println(part1 + part2);\r\n \r\n\t\t\t\r\n\t\t\t}read.close();}\r\n\t\tcatch(FileNotFoundException ex) {\r\n System.out.println(\r\n \"Unable to open file '\" + \r\n fileName + \"'\"); } \r\n\t\tcatch(IOException ex) {\r\n System.out.println(\r\n \"Error reading file '\" \r\n + fileName + \"'\"); }\r\n\t}", "public void loadMembers(String filename) {\n try {\r\n Scanner input = new Scanner(new File(filename));\r\n // keep going until the end \r\n while (input.hasNext()) {\r\n String name = input.nextLine();\r\n String address = input.nextLine();\r\n String onLoan = input.nextLine();\r\n // add the member \r\n addMember(name, address);\r\n \r\n if (!onLoan.equals(\"NONE\")) {\r\n \r\n }\r\n }\r\n } catch (FileNotFoundException e) {\r\n // print an error message \r\n System.err.println(\"File not found\");\r\n }\r\n }", "boolean processFile(Path file, PaymentReceiver paymentReceiver) throws IOException, ParseException;", "public AnalysisMetadata parseFileToAnalysisMetadata(String filename) {\n\t\t\n\t\tAnalysisMetadata am = new AnalysisMetadata();\n\t\t\n\t\tRubyScript rs = new RubyScript(filename);\n\t\t\n\t\tam.setScript(rs);\n\t\t\t\t\n\t\tParameterDictionary pd = ParameterDictionary.emptyDictionary();\n\t\t\n\t\tParameter p = new Parameter(SCRIPT_FILENAME_PARAM, SCRIPT_FILENAME_PARAM, ParameterType.STRING_T, filename, null);\n\t\tpd.addParameter(p);\n\t\t\n\t\t\n\t\tam.setInputParameters(pd);\n\t\t\n\t\tScriptingContainer sc = new ScriptingContainer(org.jruby.embed.LocalContextScope.SINGLETHREAD, org.jruby.embed.LocalVariableBehavior.PERSISTENT);\n\t\tsc.setClassLoader(ij.IJ.getClassLoader());\n\t\tsc.put(\"parameters\", pd);\n\t\t\t\t\n\t\tsc.setCompatVersion(org.jruby.CompatVersion.RUBY1_9);\n\t\t\n\t\tsc.runScriptlet(this.getClass().getClassLoader().getResourceAsStream(SCRIPT_FUNCTIONS_FILE), SCRIPT_FUNCTIONS_FILE);\n\t\tsc.runScriptlet(rs.getScriptString());\n\t\t\n\t\tp = new Parameter(\"method_name\", \"method_name\", ParameterType.STRING_T, \"ScriptMethod\", null);\n\t\tpd.addIfNotSet(\"method_name\", p);\n\t\t\n\t\tam.setOutputParameters(new ParameterDictionary(pd));\n\t\t\n\t\treturn am;\n\t}", "public XmlPullParser getLocalXML(String filename) throws IOException {\r\n\t\ttry {\r\n\t\t\tin = mContext.getAssets().open(filename);\r\n\t\t} catch (IOException e) {\r\n\t\t\te.printStackTrace();\r\n\t\t}\r\n\r\n\t\ttry {\r\n\t\t\tXmlPullParser parser = Xml.newPullParser();\r\n\t\t\tparser.setFeature(XmlPullParser.FEATURE_PROCESS_NAMESPACES, false);\r\n\t\t\tparser.setInput(in, null);\r\n\t\t\tparser.nextTag();\r\n\t\t\treturn parser;\r\n\t\t} catch (XmlPullParserException e) {\r\n\t\t\te.printStackTrace();\r\n\t\t}\r\n\r\n\t\treturn null;\r\n\t}", "public void parseFile(String fileName) {\n Matrix m = new Matrix(); \n imp.doPaint(m);\n System.out.println(fileName + \", format is PNG.\");\n }", "public void processInput(String theFile){processInput(new File(theFile));}", "public void readIn(String fileName) throws FileNotFoundException {\n\t\tScanner scanner = new Scanner(new FileInputStream(fileName));\n\t\ttry {\n\t\t\tscanner.nextLine(); // Skip line 1 (header)\n\t\t\tscanner.nextLine(); // Skip line 2 (header)\n\t\t\twhile (scanner.hasNextLine()){\n\t\t\t\tprocess(scanner.nextLine());\n\t\t\t}\n\t\t\tCollections.sort(allCoords); //Sort allCoords by z-value\n\t\t}\n\t\tfinally{\n\t\t\tscanner.close();\n\t\t}\n\t}", "public Document load(final String filename) throws IOException, SAXException {\n final DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();\n factory.setNamespaceAware(true);\n final DocumentBuilder builder;\n try {\n builder = factory.newDocumentBuilder();\n } catch (final ParserConfigurationException pce) {\n pce.printStackTrace();\n return null;\n }\n final InputStream inputStream = getClass().getResourceAsStream(filename);\n if (inputStream != null) {\n // for files found in JARs\n return builder.parse(inputStream);\n } else {\n // for files directly on the file system\n return builder.parse(new File(filename));\n }\n }" ]
[ "0.8347835", "0.8027686", "0.7414873", "0.73528993", "0.68828213", "0.6755388", "0.66980344", "0.6691712", "0.642254", "0.6414959", "0.63733053", "0.631838", "0.6255708", "0.62537104", "0.62377185", "0.62257236", "0.6218611", "0.6210062", "0.6208284", "0.6205385", "0.61982274", "0.61955714", "0.61869526", "0.61725825", "0.6167359", "0.60676247", "0.60549164", "0.6050953", "0.6015423", "0.59666157", "0.5949991", "0.59188366", "0.5918194", "0.5913807", "0.5912204", "0.5879377", "0.5853789", "0.5849128", "0.58445436", "0.58440304", "0.58378613", "0.5826512", "0.58250934", "0.5808688", "0.5781199", "0.5778126", "0.57716715", "0.57658756", "0.57635295", "0.575937", "0.5757495", "0.57566875", "0.5745169", "0.5738138", "0.5727758", "0.5725404", "0.5722726", "0.57178944", "0.57003856", "0.5690571", "0.56860834", "0.56834257", "0.5679168", "0.5674335", "0.5661377", "0.5658677", "0.56444657", "0.563574", "0.562757", "0.56254554", "0.56195146", "0.561436", "0.5609336", "0.5608789", "0.55967605", "0.55947095", "0.55928624", "0.5590135", "0.55853486", "0.55824775", "0.557823", "0.5575186", "0.5574045", "0.55662894", "0.5558154", "0.5547129", "0.554695", "0.5538081", "0.55376405", "0.55249906", "0.5522547", "0.55221444", "0.55219805", "0.5518521", "0.5517594", "0.5513756", "0.55105776", "0.5509114", "0.5507025", "0.55048525" ]
0.595247
30
if the location has been sampled before first location should be true set the current lat/long to the updated location if firstLocCheck is false create a new drive with the current location
@Override public void onLocationChanged(Location location) { if(!firstLocCheck){ drive = new Drive(location.getLatitude(),location.getLongitude(),Car.carList.get(carIndex),startTime); firstLocCheck = true; } else { Drive.curLat = location.getLatitude(); Drive.curLong = location.getLongitude(); } System.out.println("Location has changed"); System.out.println(location.getLatitude() + " | " + location.getLongitude()); //updateLoc(location); //locProvider = location.getProvider(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\n public void onLocationChanged(Location location) {\n\n if(!locationFound){\n while(mlongitude == 0.0 && mlatitude == 0.0) {\n\n mlatitude = location.getLatitude();\n mlongitude = location.getLongitude();\n }\n\n locationFound = true;\n }\n\n }", "@Override\n\t\t\t\tpublic void onLocationChanged(Location loc) {\n\n\t\t\t\t\t//If Wifi\n\t\t\t\t\tif (monitor.isNetworkConnected()\n\t\t\t\t\t\t\t&& monitor.networkType == ConnectivityManager.TYPE_WIFI) {\n\n\t\t\t\t\t\t@SuppressWarnings(\"deprecation\")\n\t\t\t\t\t\tString locationProviders = Settings.Secure.getString(\n\t\t\t\t\t\t\t\tcont.getContentResolver(),\n\t\t\t\t\t\t\t\tSettings.Secure.LOCATION_PROVIDERS_ALLOWED);\n\t\t\t\t\t\tif (locationProviders != null\n\t\t\t\t\t\t\t\t&& !locationProviders.equals(\"\")) {\n\t\t\t\t\t\t\t//Lock our location.\n\t\t\t\t\t\t\tmonitor.locationLocked = true;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\t//If we have had a steady lock\n\t\t\t\t\tif (monitor.locationLocked && (counter >= 2 || first)) {\n\n\t\t\t\t\t\t//Swap \n\t\t\t\t\t\tDouble oldLat = self.member.lat;\n\t\t\t\t\t\tDouble oldLong = self.member.lon;\n\n\t\t\t\t\t\tself.member.lat = loc.getLatitude();\n\t\t\t\t\t\tself.member.lon = loc.getLongitude();\n\n\t\t\t\t\t\tif (self.member.pic == null) {\n\t\t\t\t\t\t\tself.member.pic = Images\n\t\t\t\t\t\t\t\t\t.paintMarkerBitmap(self.member);\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tplaceMarker(self.member);\n\n\t\t\t\t\t\tLog.i(\"Position\", self.member.lat.toString() + \", \"\n\t\t\t\t\t\t\t\t+ self.member.lon.toString());\n\n\t\t\t\t\t\tGCMMessage.sendLocation(self.member.lat,\n\t\t\t\t\t\t\t\tself.member.lon);\n\n\t\t\t\t\t\tMembersFragment.stopSpinning();\n\n\t\t\t\t\t\t// gcmMessage.sendLocation(self.lat, self.lon);\n\n\t\t\t\t\t\tfloat[] results = new float[1];\n\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\tLocation.distanceBetween(oldLat, oldLong,\n\t\t\t\t\t\t\t\t\tself.member.lat, self.member.lon, results);\n\n\t\t\t\t\t\t\tif (results[0] > 35 && wobble > -interval / 2) {\n\n\t\t\t\t\t\t\t} else if (results[0] <= 35\n\t\t\t\t\t\t\t\t\t&& wobble < interval / 2) {\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t} catch (NullPointerException npe) {\n\t\t\t\t\t\t\tLog.i(\"Locater\", \"Got first location\");\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tgpsTimer.removeCallbacks(r);\n\n\t\t\t\t\t\tlocationClient.disconnect();\n\n\t\t\t\t\t\tmonitor.locationLocked = false;\n\n\t\t\t\t\t\tcounter = 0;\n\n\t\t\t\t\t\tfirst = false;\n\n\t\t\t\t\t}\n\n\t\t\t\t\tcounter++;\n\t\t\t\t}", "private void locate() {\n possibleLocations[0][0] = false;\n possibleLocations[0][1] = false;\n possibleLocations[1][0] = false;\n do {\n location.randomGenerate();\n } while (!possibleLocations[location.y][location.x]);\n }", "private void initLocation() {\n BaiduLocationHolder.OPTION.setLocationMode(LocationClientOption.LocationMode.Hight_Accuracy);\n //可选,默认高精度,设置定位模式,高精度,低功耗,仅设备\n\n BaiduLocationHolder.OPTION.setCoorType(\"bd09ll\");\n //可选,默认gcj02,设置返回的定位结果坐标系\n\n int span = 1000;\n BaiduLocationHolder.OPTION.setScanSpan(span);\n //可选,默认0,即仅定位一次,设置发起定位请求的间隔需要大于等于1000ms才是有效的\n\n BaiduLocationHolder.OPTION.setIsNeedAddress(true);\n //可选,设置是否需要地址信息,默认不需要\n\n BaiduLocationHolder.OPTION.setOpenGps(true);\n //可选,默认false,设置是否使用gps\n\n BaiduLocationHolder.OPTION.setLocationNotify(true);\n //可选,默认false,设置是否当GPS有效时按照1S/1次频率输出GPS结果\n\n BaiduLocationHolder.OPTION.setIsNeedLocationDescribe(true);\n //可选,默认false,设置是否需要位置语义化结果,可以在BDLocation.getLocationDescribe里得到,结果类似于“在北京天安门附近”\n\n BaiduLocationHolder.OPTION.setIsNeedLocationPoiList(true);\n //可选,默认false,设置是否需要POI结果,可以在BDLocation.getPoiList里得到\n\n BaiduLocationHolder.OPTION.setIgnoreKillProcess(false);\n //可选,默认true,定位SDK内部是一个SERVICE,并放到了独立进程,设置是否在stop的时候杀死这个进程,默认不杀死\n\n BaiduLocationHolder.OPTION.SetIgnoreCacheException(false);\n //可选,默认false,设置是否收集CRASH信息,默认收集\n\n BaiduLocationHolder.OPTION.setEnableSimulateGps(false);\n //可选,默认false,设置是否需要过滤GPS仿真结果,默认需要\n\n// BaiduLocationHolder.OPTION.setWifiValidTime(5*60*1000);\n //可选,7.2版本新增能力,如果您设置了这个接口,首次启动定位时,会先判断当前WiFi是否超出有效期,超出有效期的话,会先重新扫描WiFi,然后再定位\n\n BaiduLocationHolder.CLIENT.setLocOption(BaiduLocationHolder.OPTION);\n }", "@SuppressLint(\"MissingPermission\")\n private void requestNewLocationData() {\n LocationRequest mLocationRequest = new LocationRequest();\n mLocationRequest.setPriority(LocationRequest.PRIORITY_HIGH_ACCURACY);\n mLocationRequest.setInterval(5);\n mLocationRequest.setFastestInterval(0);\n mLocationRequest.setNumUpdates(1);\n\n // setting LocationRequest\n // on FusedLocationClient\n FusedLocationProviderClient mFusedLocationClient = LocationServices.getFusedLocationProviderClient(this);\n mFusedLocationClient.requestLocationUpdates(mLocationRequest, mLocationCallback, Looper.myLooper());\n }", "@SuppressLint(\"MissingPermission\")\n private void requestNewLocationData() {\n LocationRequest mLocationRequest = new LocationRequest();\n mLocationRequest.setPriority(LocationRequest.PRIORITY_HIGH_ACCURACY);\n mLocationRequest.setInterval(5);\n mLocationRequest.setFastestInterval(0);\n mLocationRequest.setNumUpdates(1);\n\n // setting LocationRequest\n // on FusedLocationClient\n mFusedLocationClient = LocationServices.getFusedLocationProviderClient(this);\n mFusedLocationClient.requestLocationUpdates(mLocationRequest, mLocationCallback, Looper.myLooper());\n }", "@SuppressLint(\"MissingPermission\")\n private void requestNewLocationData() {\n LocationRequest mLocationRequest = new LocationRequest();\n mLocationRequest.setPriority(LocationRequest.PRIORITY_HIGH_ACCURACY);\n mLocationRequest.setInterval(5);\n mLocationRequest.setFastestInterval(0);\n mLocationRequest.setNumUpdates(1);\n\n // setting LocationRequest\n // on FusedLocationClient\n mFusedLocationClient = LocationServices.getFusedLocationProviderClient(this);\n mFusedLocationClient.requestLocationUpdates(mLocationRequest, mLocationCallback, Looper.myLooper());\n }", "private void initLocationData() {\n\n // init google client and request for fused location provider\n fusedLocationProviderClient = LocationServices.getFusedLocationProviderClient(context);\n\n locationRequest = new LocationRequest()\n //.setPriority(LocationRequest.PRIORITY_HIGH_ACCURACY) // GPS quality location points\n .setPriority(LocationRequest.PRIORITY_BALANCED_POWER_ACCURACY) // optimized for battery\n .setInterval(20000) // at least once every 20 seconds\n .setFastestInterval(10000); // at most once every 10 seconds\n\n locationCallback = new LocationCallback() {\n @Override\n public void onLocationResult(LocationResult locationResult) {\n\n Point userPoint;\n if (locationResult != null) {\n // update user location\n Location lastLocation = locationResult.getLastLocation();\n userPoint = new Point(lastLocation.getLatitude(), lastLocation.getLongitude());\n // cache location\n PreferencesCache.setLastLatitude(lastLocation.getLatitude());\n PreferencesCache.setLastLongitude(lastLocation.getLongitude());\n } else {\n // get cached data\n userPoint = new Point(PreferencesCache.getLastLatitude(), PreferencesCache.getLastLongitude());\n }\n\n navigator.updateUserLocation(userPoint);\n }\n };\n }", "protected void startLocationUpdates() {\n mLocationRequest = LocationRequest.create()\n .setPriority(LocationRequest.PRIORITY_BALANCED_POWER_ACCURACY)\n .setInterval(1000000)\n .setFastestInterval(1000000);\n // Request location updates\n if (ActivityCompat.checkSelfPermission(this, android.Manifest.permission.ACCESS_COARSE_LOCATION) == PackageManager.PERMISSION_GRANTED) {\n LocationServices.FusedLocationApi.requestLocationUpdates(mGoogleApiClient, mLocationRequest, new LocationListener() {\n @Override\n public void onLocationChanged(Location location) {\n mLastLocation = location;\n }\n });\n }\n\n }", "private void StartLocationUpdates() {\n mLocationRequest = new LocationRequest();\n mLocationRequest.setPriority(LocationRequest.PRIORITY_BALANCED_POWER_ACCURACY);\n mLocationRequest.setInterval(UPDATE_INTERVAL);\n mLocationRequest.setFastestInterval(FASTEST_INTERVAL);\n\n // Create LocationSettings object using location request\n LocationSettingsRequest.Builder builder = new LocationSettingsRequest.Builder();\n builder.addLocationRequest(mLocationRequest);\n LocationSettingsRequest locationSettingsRequest = builder.build();\n\n // Checks if location settings are OK\n SettingsClient settingsClient = LocationServices.getSettingsClient(context);\n settingsClient.checkLocationSettings(locationSettingsRequest);\n\n if (ActivityCompat.checkSelfPermission(context, Manifest.permission.ACCESS_FINE_LOCATION)\n != PackageManager.PERMISSION_GRANTED && ActivityCompat.checkSelfPermission\n (context, Manifest.permission.ACCESS_COARSE_LOCATION) != PackageManager.PERMISSION_GRANTED) {\n\n return;\n }else {\n getFusedLocationProviderClient(context).requestLocationUpdates(mLocationRequest, new LocationCallback() {\n @Override\n public void onLocationResult(LocationResult locationResult) {\n onLocationChanged(locationResult.getLastLocation());\n// getLastLocation();\n }\n },\n Looper.myLooper());\n }\n\n }", "private void setCurrentLocation() {\n foundLocation = false;\n //Ignore the red line - we check for permissions before this function is called\n if (ActivityCompat.checkSelfPermission(getContext(), Manifest.permission.ACCESS_FINE_LOCATION) != PackageManager.PERMISSION_GRANTED &&\n ActivityCompat.checkSelfPermission(getContext(), Manifest.permission.ACCESS_COARSE_LOCATION) != PackageManager.PERMISSION_GRANTED) {\n return;\n }\n googleMap.setMyLocationEnabled(true);\n FusedLocationProviderClient mFusedLocationProviderClient = LocationServices\n .getFusedLocationProviderClient(getActivity());\n //Ignore the red line - we check for permissions before this function is called\n Task<Location> lastLocation = mFusedLocationProviderClient.getLastLocation();\n lastLocation.addOnCompleteListener(task -> {\n if (task.isSuccessful()) {\n // Set the map's camera position to the current location of the device.\n Location location = task.getResult();\n if (location == null) {\n locationControlTask = new LocationControl();\n locationControlTask.execute(getActivity());\n } else {\n LatLng currentLatLng = new LatLng(location.getLatitude(),\n location.getLongitude());\n CameraUpdate update = CameraUpdateFactory.newLatLngZoom(currentLatLng,\n DEFAULT_ZOOM);\n googleMap.moveCamera(update);\n foundLocation = true;\n }\n }\n });\n }", "private void startLocationUpdates() {\r\n try {\r\n TimeUnit.SECONDS.sleep(3);\r\n } catch (InterruptedException e) {\r\n e.printStackTrace();\r\n }\r\n mFusedLocationClient.requestLocationUpdates(getLocationRequest(), mLocationCallback, Looper.getMainLooper());\r\n mMap.setMyLocationEnabled(true);\r\n }", "public void startDrawing() {\n try {\n LocationRequest locationRequest = LocationRequest.create()\n .setInterval(10 * 1000)\n .setPriority(LocationRequest.PRIORITY_HIGH_ACCURACY);\n LocationServices.FusedLocationApi.requestLocationUpdates(mGoogleApiClient, locationRequest, this);\n isDrawing = true;\n } catch (SecurityException e) {\n Log.e(TAG, \"Failed to start location updates \" + e.getLocalizedMessage());\n }\n }", "private synchronized void initLocation() {\n if (locationManager == null) {\n LocationManager manager =\n (LocationManager) context.getSystemService(Context.LOCATION_SERVICE);\n\n Criteria criteriaCoarse = new Criteria();\n /* \"Coarse\" accuracy means \"no need to use GPS\".\n * Typically a gShots phone would be located in a building,\n * and GPS may not be able to acquire a location.\n * We only care about the location to determine the country,\n * so we don't need a super accurate location, cell/wifi is good enough.\n */\n criteriaCoarse.setAccuracy(Criteria.ACCURACY_COARSE);\n criteriaCoarse.setPowerRequirement(Criteria.POWER_LOW);\n String providerName =\n manager.getBestProvider(criteriaCoarse, /*enabledOnly=*/true);\n \n \n List<String> providers = manager.getAllProviders();\n for (String providerNameIter : providers) {\n try {\n LocationProvider provider = manager.getProvider(providerNameIter);\n } catch (SecurityException se) {\n // Not allowed to use this provider\n Logger.w(\"Unable to use provider \" + providerNameIter);\n continue;\n }\n Logger.i(providerNameIter + \": \" +\n (manager.isProviderEnabled(providerNameIter) ? \"enabled\" : \"disabled\"));\n }\n\n /* Make sure the provider updates its location.\n * Without this, we may get a very old location, even a\n * device powercycle may not update it.\n * {@see android.location.LocationManager.getLastKnownLocation}.\n */\n manager.requestLocationUpdates(providerName,\n /*minTime=*/0,\n /*minDistance=*/0,\n new LoggingLocationListener(),\n Looper.getMainLooper());\n locationManager = manager;\n locationProviderName = providerName;\n }\n assert locationManager != null;\n assert locationProviderName != null;\n }", "private void setLastLocation() {\n\n if (ContextCompat.checkSelfPermission(this,\n Manifest.permission.ACCESS_FINE_LOCATION)\n == PackageManager.PERMISSION_GRANTED) {\n // Permission has already been granted\n mFusedLocationClient.getLastLocation()\n .addOnSuccessListener(this, new OnSuccessListener<Location>() {\n @Override\n public void onSuccess(Location location) {\n // Got last known location. In some rare situations this can be null.\n if (location != null) {\n lastLatitude = Double.toString(location.getLatitude());\n lastLongitude = Double.toString(location.getLongitude());\n //lastLocation = Double.toString(location.getLatitude()) + \",\" + Double.toString(location.getLongitude()) ;\n //String b = lastLocation;\n // Get into right format\n // Logic to handle location object\n }\n }\n });\n }\n }", "private void getDeviceLocation( ) {\n\n if (searchLocationMarker != null) {\n searchLocationMarker.remove();\n }\n\n mFusedLocationProviderClient =\n LocationServices.getFusedLocationProviderClient(this);\n //Task locationResult = mFusedLocationProviderClient.getLastLocation();\n try {\n if (mLocationPermissionGranted) {\n Task locationResult = mFusedLocationProviderClient.getLastLocation();\n locationResult.addOnCompleteListener(this, new OnCompleteListener() {\n @Override\n public void onComplete(@NonNull Task task) {\n if (task.isSuccessful()) {\n // Set the map's camera position to the current location of the device.\n System.out.println(\"Current location retrieved successfully!\");\n mLastKnownLocation = (Location) task.getResult(); // location?\n mMap.moveCamera(CameraUpdateFactory.newLatLngZoom(\n new LatLng(mLastKnownLocation.getLatitude(),\n mLastKnownLocation.getLongitude()), DEFAULT_ZOOM));\n searchLocationMarker = mMap.addMarker(new MarkerOptions()\n .position(new LatLng(mLastKnownLocation.getLatitude(),\n mLastKnownLocation.getLongitude()))\n .title(\"Current Location\")\n .icon(BitmapDescriptorFactory.fromBitmap(\n getBitmapFromVectorDrawable(\n MainActivity.this, R.drawable.ic_current_location_marker))));\n getNearbyStations(mLastKnownLocation.getLatitude(), mLastKnownLocation.getLongitude());\n\n } else {\n Log.d(TAG, \"Current location is null. Using defaults.\");\n Log.e(TAG, \"Exception: %s\", task.getException());\n mMap.moveCamera(CameraUpdateFactory.newLatLngZoom(mDefaultLocation, DEFAULT_ZOOM));\n mMap.getUiSettings().setMyLocationButtonEnabled(false);\n searchLocationMarker = mMap.addMarker(new MarkerOptions()\n .position(mDefaultLocation)\n .title(\"Current Location\")\n .icon(BitmapDescriptorFactory.fromBitmap(\n getBitmapFromVectorDrawable(\n MainActivity.this, R.drawable.ic_current_location_marker))));\n }\n }\n });\n }\n } catch(SecurityException e) {\n Log.e(\"Exception: %s\", e.getMessage());\n }\n\n }", "private void getCurrentLocation() {\n progressBar.setVisibility(View.VISIBLE);\n LocationRequest locationRequest = new LocationRequest();\n locationRequest.setInterval(10000);\n locationRequest.setFastestInterval(3000);\n locationRequest.setPriority(LocationRequest.PRIORITY_HIGH_ACCURACY);\n\n LocationServices.getFusedLocationProviderClient(IntroActivity.this).requestLocationUpdates(locationRequest, new LocationCallback() {\n @Override\n public void onLocationResult(LocationResult locationResult) {\n super.onLocationResult(locationResult);\n LocationServices.getFusedLocationProviderClient(IntroActivity.this).removeLocationUpdates(this);\n if (locationResult != null && locationResult.getLocations().size() > 0) {\n int latestLocationIndex = locationResult.getLocations().size() - 1;\n double LatOrg = locationResult.getLocations().get(latestLocationIndex).getLatitude();\n double LonOrg = locationResult.getLocations().get(latestLocationIndex).getLongitude();\n\n LatitudeTruePref = Double.toString(LatOrg);\n LongitudeTruePref = Double.toString(LonOrg);\n\n LocationReal = new LatLng(LatOrg, LonOrg);\n tvSkip.setText(String.format(\"Lat: %s\\nLon: %s\", LatitudeTruePref, LongitudeTruePref));\n //tvSkip.setText(String.format(\"Lat: %s\\nLon: %s\", LatOrg, LonOrg));\n }\n FalseLocationSignal = false;//*Desactivar FalseLocation para SharedPreferens*//\n TrueLocationSignal = true;\n progressBar.setVisibility(View.GONE);\n btnNext.setEnabled(true);\n }\n }, Looper.getMainLooper());\n\n }", "protected void startLocationUpdates() {\n mLocationRequest = new LocationRequest();\n mLocationRequest.setPriority(LocationRequest.PRIORITY_HIGH_ACCURACY);\n mLocationRequest.setInterval(UPDATE_INTERVAL);\n //mLocationRequest.setFastestInterval(FASTEST_INTERVAL);\n\n // Create LocationSettingsRequest object using location request\n LocationSettingsRequest.Builder builder = new LocationSettingsRequest.Builder();\n builder.addLocationRequest(mLocationRequest);\n LocationSettingsRequest locationSettingsRequest = builder.build();\n\n // Check whether location settings are satisfied\n // https://developers.google.com/android/reference/com/google/android/gms/location/SettingsClient\n SettingsClient settingsClient = LocationServices.getSettingsClient(this);\n settingsClient.checkLocationSettings(locationSettingsRequest);\n\n // new Google API SDK v11 uses getFusedLocationProviderClient(this)\n try{\n getFusedLocationProviderClient(this).requestLocationUpdates(mLocationRequest, new LocationCallback() {\n @Override\n public void onLocationResult(LocationResult locationResult) {\n onLocationChanged(locationResult.getLastLocation(),false);\n }\n },\n Looper.myLooper());\n }\n catch(SecurityException e){\n e.printStackTrace();\n }\n\n }", "public void startLocationUpdate() {\n if (locationCallback != null) {\n try {\n locationCallback = new LocationCallback() {//khoi tao dinh nghia (extent)\n\n @Override\n public void onLocationResult(LocationResult locationResult) {\n super.onLocationResult(locationResult);\n Log.d(TAG, \"onLocationResult: \");\n if (locationResult != null) {\n Log.d(TAG, \"onLocationResult: loaction!==null\");\n myLocation = locationResult.getLastLocation();\n showMarker();//de show hinh len\n }\n }\n };\n fusedLocationProviderClient.requestLocationUpdates(locationRequest, locationCallback, null);//dang ky voi he thong app lang nghe su thay doi cua location\n\n } catch (SecurityException e) {\n e.getMessage();\n\n }\n }\n }", "public void add_location() {\n if (currentLocationCheckbox.isChecked()) {\n try {\n CurrentLocation locationListener = new CurrentLocation();\n LocationManager locationManager = (LocationManager) getSystemService(Context.LOCATION_SERVICE);\n locationManager.requestLocationUpdates(LocationManager.GPS_PROVIDER, 0, 0, locationListener);\n Location location = locationManager.getLastKnownLocation(LocationManager.GPS_PROVIDER);\n if (location != null) {\n int latitude = (int) (location.getLatitude() * 1E6);\n int longitude = (int) (location.getLongitude() * 1E6);\n currentLocation = new GeoPoint(latitude, longitude);\n }\n } catch (SecurityException e) {\n e.printStackTrace();\n }\n } else {\n currentLocation = null;\n }\n\n }", "public String generateRandomLoc(double curLon, double curLat, double num, double r, Context mapsContext) {\r\n myDB = new DBHelper(mapsContext);\r\n boolean locationsFromDB = false;\r\n Log.d(\"Detailed analysis\",\"finding data available in db or not\");\r\n //Method to find weather there was a previous record of fake locations.\r\n locationsFromDB = getLocationsFrom(curLat, curLon, num);\r\n r = r * 1609.34;\r\n //Condition if there was no previous record\r\n if(!locationsFromDB) {\r\n //Method to generate fake locations\r\n locationValues = findRandomLocations(curLat, curLon, num, r );\r\n Log.d(\"Detailed Analysis\",\"Going to save location values in sqllite db\");\r\n //calling insertLocations in DBHelper class to insert the generated fake locations into db for further use\r\n myDB.insertLocations(Math.round(curLat * 10000.0) / 10000.0,Math.round(curLon * 10000.0) / 10000.0,num,locationValues, condChoice ,false);\r\n Cursor rs = myDB.getData(Math.round(curLat * 10000.0) / 10000.0,Math.round(curLon * 10000.0) / 10000.0, num);\r\n rs.moveToFirst();\r\n number = Double.parseDouble(rs.getString(rs.getColumnIndex(DBHelper.Locations_COLUMN_num)));\r\n Log.d(\"Detailed Analysis\",\"Recent number value from !locationsFromDB: \"+ number);\r\n Log.d(\"Detailed analysis\",\"Location Values \"+locationValues);\r\n }\r\n else{\r\n locationValues = locationValues+\"\";\r\n Log.d(\"Detailed Analysis\",\"Going to save updated location values in sqllite db\");\r\n double num1;\r\n String values = locationValues;\r\n String valuesArray[] = values.split(\":\");\r\n num1 = valuesArray.length;\r\n myDB.insertLocations(Math.round(curLat * 10000.0) / 10000.0,Math.round(curLon * 10000.0) / 10000.0,num1,locationValues, condChoice, false);\r\n Log.d(\"Detailed analysis\",\"Location Values \"+locationValues);\r\n }\r\n //Condition to check if the requested fake locations count was greater than the previous request\r\n if(num > number){\r\n Log.d(\"Detailed Analysis: \",\"num: \"+num +\" number: \"+ number);\r\n Log.d(\"Detailed Analysis\",\"Number of fake locations requested this time were higher than previous request\");\r\n Log.d(\"Detailed Analysis\",\"Generating new random locations\");\r\n String temp = locationValues;\r\n locationValues = \"\";\r\n //generating new fake locations for the extra count\r\n temp = temp + findRandomLocations(curLat, curLon, num - number, r);\r\n Log.d(\"Detailed Analysis\",\"Going to save updated location values in sqllite db after adding new random locations\");\r\n //updating the previous record with new fake locations count\r\n myDB.insertLocations(Math.round(curLat * 10000.0) / 10000.0,Math.round(curLon * 10000.0) / 10000.0,num,temp, condChoice, true);\r\n locationValues = temp;\r\n }\r\n //Condition to check if the requested fake locations count was less than the previous request\r\n if(num < number){\r\n Log.d(\"Detailed Analysis: \",\"num: \"+num +\" number: \"+ number);\r\n Log.d(\"Detailed Analysis\",\"Number of fake locations requested this time were lesser than previous request\");\r\n String values = locationValues;\r\n String valuesArray[] = values.split(\":\");\r\n String temp = \"\";\r\n //trimmig the fake locations count to the requested number\r\n for(int i = 0; i < num; i++) {\r\n String pointsArray[] = valuesArray[i].split(\",\");\r\n temp = temp + Double.parseDouble(pointsArray[0]) + \",\" + Double.parseDouble(pointsArray[1]) + \":\" + \"\" ;\r\n }\r\n locationValues = temp;\r\n Log.d(\"Detailed Analysis\",\"Location values when reduced fake locations count to \"+num + \": \"+ locationValues);\r\n }\r\n Log.d(\"Detailed Analysis: \", \"number before returning locations: \"+ number);\r\n return locationValues;\r\n }", "@Override\n public void onLocationChanged(Location location) {\n mLastLocation = location;\n\n\n }", "protected void setDeviceLocation() {\n\t\tmLocationMgr = (LocationManager) getActivity().getSystemService(\n\t\t\t\tContext.LOCATION_SERVICE);\n\n\t\t// Get last known location from either GPS or Network provider\n\t\tLocation loc = null;\n\t\tboolean netAvail = (mLocationMgr\n\t\t\t\t.getProvider(LocationManager.NETWORK_PROVIDER) != null);\n\t\tboolean gpsAvail = (mLocationMgr\n\t\t\t\t.getProvider(LocationManager.GPS_PROVIDER) != null);\n\t\tif (gpsAvail) {\n\t\t\tloc = mLocationMgr\n\t\t\t\t\t.getLastKnownLocation(LocationManager.GPS_PROVIDER);\n\t\t} else if (netAvail) {\n\t\t\tloc = mLocationMgr\n\t\t\t\t\t.getLastKnownLocation(LocationManager.NETWORK_PROVIDER);\n\t\t}\n\n\t\t// Just use last location if it's less than 10 minutes old\n\t\tif (loc != null\n\t\t\t\t&& ((new Date()).getTime() - loc.getTime() < 10 * 60 * 1000)) {\n\t\t\tonLocationChanged(loc);\n\t\t} else {\n\t\t\tif (gpsAvail) {\n\t\t\t\tmLocationMgr.requestLocationUpdates(\n\t\t\t\t\t\tLocationManager.GPS_PROVIDER, 0, 0, this);\n\t\t\t}\n\t\t\tif (netAvail) {\n\t\t\t\tmLocationMgr.requestLocationUpdates(\n\t\t\t\t\t\tLocationManager.NETWORK_PROVIDER, 0, 0, this);\n\t\t\t}\n\t\t}\n\t}", "@Override\n public void onLocationChanged(final Location location) {\n // Lay vi tri hien tai cua minh\n myLocation = new LatLng(location.getLatitude(), location.getLongitude());\n if (firstLocation == true) {\n // Neu day la lan dau co thong tin vi tri thi chuyen camera ve vi tri nay\n mMap.moveCamera(CameraUpdateFactory.newLatLngZoom(myLocation, 15));\n firstLocation = false;\n }\n // Gui vi tri cua minh len server\n String myLocationMessage = String.format(\"{\\\"COMMAND\\\":\\\"MEMBER_CURRENT_LOCATION\\\", \\\"LATITUDE\\\": \\\"%s\\\", \\\"LONGITUDE\\\": \\\"%s\\\"}\", myLocation.latitude, myLocation.longitude);\n OnlineManager.getInstance().sendMessage(myLocationMessage);\n // Refresh danh sach timesheet\n if (tourTimesheetAdapter != null) {\n tourTimesheetAdapter.notifyDataSetChanged();\n }\n }", "void makeUseOfNewLocation(Location location) {\n if ( isBetterLocation(location, currentBestLocation) ) {\n currentBestLocation = location;\n }\n }", "private void checkLocationandAddToMap() {\n if (ActivityCompat.checkSelfPermission(getActivity(), android.Manifest.permission.ACCESS_FINE_LOCATION) != PackageManager.PERMISSION_GRANTED && ActivityCompat.checkSelfPermission(getActivity(), android.Manifest.permission.ACCESS_COARSE_LOCATION) != PackageManager.PERMISSION_GRANTED) {\n //Requesting the Location permission\n ActivityCompat.requestPermissions(getActivity(), new String[]{android.Manifest.permission.ACCESS_FINE_LOCATION}, LOCATION_REQUEST_CODE);\n return;\n }\n\n locationManager = (LocationManager) getActivity().getSystemService(LOCATION_SERVICE);\n criteria = new Criteria();\n bestProvider = locationManager.getBestProvider(criteria, true);\n\n\n //Fetching the last known location using the Fus\n Location location = locationManager.getLastKnownLocation(bestProvider);\n\n\n if (location != null) {\n\n onLocationChanged(location);\n\n\n } else {\n //This is what you need:\n locationManager.requestLocationUpdates(bestProvider, 1000, 0, (LocationListener) getActivity());\n }\n\n\n }", "public void gotLocation(Location location){\r\n \tif(location!=null){\r\n\t \tConstants.gpslat = location.getLatitude()+\"\";\r\n\t Constants.gpslng = location.getLongitude()+\"\";\r\n\t Log.d(\"location changed: lattitue & longitude\",Constants.gpslat+\" & \"+Constants.gpslng);\r\n \t}\r\n }", "public void fetchLocationOnce() throws LocationException {\n if ( listener != null && hasSystemFeature() && isProviderEnabled() && isSecure()) {\n try {\n locationManager.requestSingleUpdate(provider, listener, null);\n return;\n } catch (SecurityException se) {\n Log.wtf(GeoLocationProvider.class.getSimpleName(), se);\n throw new LocationException(se);\n }\n } else {\n throw new LocationException(listener != null, hasSystemFeature(), isProviderEnabled(), isSecure());\n }\n\n }", "@SuppressLint(\"RestrictedApi\")\n protected void startLocationUpdates() {\n mLocationRequest = new LocationRequest();\n mLocationRequest.setPriority(LocationRequest.PRIORITY_HIGH_ACCURACY);\n mLocationRequest.setInterval(UPDATE_INTERVAL);\n mLocationRequest.setFastestInterval(FASTEST_INTERVAL);\n\n LocationSettingsRequest.Builder builder = new LocationSettingsRequest.Builder();\n builder.addLocationRequest(mLocationRequest);\n LocationSettingsRequest locationSettingsRequest = builder.build();\n\n SettingsClient settingsClient = LocationServices.getSettingsClient(this);\n settingsClient.checkLocationSettings(locationSettingsRequest);\n\n if (ActivityCompat.checkSelfPermission(this, Manifest.permission.ACCESS_FINE_LOCATION) != PackageManager.PERMISSION_GRANTED && ActivityCompat.checkSelfPermission(this, Manifest.permission.ACCESS_COARSE_LOCATION) != PackageManager.PERMISSION_GRANTED) {\n return;\n }\n getFusedLocationProviderClient(this).requestLocationUpdates(mLocationRequest, new LocationCallback() {\n @Override\n public void onLocationResult(LocationResult locationResult) {\n onLocationChanged(locationResult.getLastLocation());\n }\n },\n Looper.myLooper());\n }", "public void onLocationChanged(Location location) {\n\n if (net_connection_check()) {\n\n String message = String.format(\n\n \"New Location \\n Longitude: %1$s \\n Latitude: %2$s\",\n\n location.getLongitude(), location.getLatitude());\n\n // *************************** GPS LOCATION ***************************\n\n\n driveruserid = User_id;\n driverlat = location.getLatitude();\n driverlong = location.getLongitude();\n\n\n Location driverLocation = new Location(\"user location\");\n driverLocation.setLatitude(driverlat);\n driverLocation.setLongitude(driverlong);\n\n aController.setDriverLocation(driverLocation);\n\n String drivercurrentaddress = lattoaddress(driverlat, driverlong);\n\n\n if (!checktripend && mGoogleMap != null) {\n // mGoogleMap.clear();\n\n\n }\n LatLng mark1 = new LatLng(driverlat, driverlong);\n\n if (logoutcheck) {\n//\t\t\tDriverdetails();\n }\n\n LatLng target = new LatLng(driverlat, driverlong);\n\n String check = fullbutton.getText().toString();\n if (acc.equals(\"yes\") || check.equals(\"End Trip\")) {\n if (check.equals(\"End Trip\")) {\n // mGoogleMap.clear();\n // mGoogleMap.setTrafficEnabled(true);\n }\n origin = new LatLng(driverlat, driverlong);\n /* try{\n String url = getDirectionsUrl(origin, dest);\n drawMarker(dest);\n DownloadTask downloadTask = new DownloadTask();\n //Start downloading json data from Google Directions API\n downloadTask.execute(url);\n }catch (Exception e){\n\n }*/\n\n// checkOffRouteAndRedrwaRoute(location);\n\n }\n\n checkOffRouteAndRedrwaRoute(location);\n if (location.hasBearing() && mGoogleMap != null) {\n CameraPosition cameraPosition = new CameraPosition.Builder()\n .target(target) // Sets the center of the map to current location\n .zoom(16)\n .bearing(location.getBearing()) // Sets the orientation of the camera to east\n .tilt(0) // Sets the tilt of the camera to 0 degrees\n .build(); // Creates a CameraPosition from the builder\n mGoogleMap.animateCamera(CameraUpdateFactory.newCameraPosition(cameraPosition));\n }\n }\n }", "@Override\n public void onLocationChanged(final Location location) {\n\n if(mLastLocation==null || location.distanceTo(mLastLocation)>getResources().getInteger(R.integer.min_distance_listen))\n {\n new GetNearBy().executePreHeavy();\n }\n\n mLastLocation=location;\n\n android.util.Log.e(\"onLocationChanged\",mLastLocation.getLatitude()+\" - \"+mLastLocation.getLongitude());\n\n\n\n }", "private void setupLocation() {\n\n if (ContextCompat.checkSelfPermission(this, Manifest.permission.ACCESS_FINE_LOCATION) != PackageManager.PERMISSION_GRANTED &&\n ContextCompat.checkSelfPermission(this, Manifest.permission.ACCESS_COARSE_LOCATION) != PackageManager.PERMISSION_GRANTED) {\n\n // Permission is not granted.\n if (ActivityCompat.shouldShowRequestPermissionRationale(this, Manifest.permission.ACCESS_FINE_LOCATION) &&\n ActivityCompat.shouldShowRequestPermissionRationale(this, Manifest.permission.ACCESS_COARSE_LOCATION)) {\n\n ActivityCompat.requestPermissions(this,\n new String[]{Manifest.permission.ACCESS_FINE_LOCATION, Manifest.permission.ACCESS_COARSE_LOCATION},\n LOCATION_PERMISSION_REQUEST);\n } else {\n // Request the permission\n ActivityCompat.requestPermissions(this,\n new String[]{Manifest.permission.ACCESS_FINE_LOCATION, Manifest.permission.ACCESS_COARSE_LOCATION},\n LOCATION_PERMISSION_REQUEST);\n }\n } else {\n // Permission has already been granted\n }\n }", "private void startLocationUpdate()\r\n {\r\n try \r\n {\r\n _locationProvider = LocationProvider.getInstance(null);\r\n \r\n if ( _locationProvider == null ) \r\n {\r\n // We would like to display a dialog box indicating that GPS isn't supported, but because\r\n // the event-dispatcher thread hasn't been started yet, modal screens cannot be pushed onto\r\n // the display stack. So delay this operation until the event-dispatcher thread is running\r\n // by asking it to invoke the following Runnable object as soon as it can.\r\n Runnable showGpsUnsupportedDialog = new Runnable() \r\n {\r\n public void run() \r\n {\r\n Dialog.alert(\"GPS is not supported on this platform, exiting...\");\r\n System.exit( 1 );\r\n }\r\n };\r\n invokeLater( showGpsUnsupportedDialog ); // ask event-dispatcher thread to display dialog ASAP\r\n } \r\n else \r\n {\r\n // only a single listener can be associated with a provider, and unsetting it involves the same\r\n // call but with null, therefore, no need to cache the listener instance\r\n _locationProvider.setLocationListener(new LocationListenerImpl(), _interval, 1, 1);\r\n }\r\n } catch (LocationException le) {\r\n System.err.println(\"Failed to instantiate the LocationProvider object, exiting...\");\r\n System.err.println(le); \r\n System.exit(0);\r\n } \r\n }", "public void onLocationChanged(Location location) {\r\n\t\tif(isBetterLocation(location, this.oldLocation, this.limitPeriodToControlBetterLocation)){\r\n\t\t\tdeviceLocation.setLatitude(location.getLatitude());\r\n\t\t\tdeviceLocation.setLongitude(location.getLongitude());\r\n\t\t\tdeviceLocation.setGpsEnable(true);\r\n\t\t\tdeviceLocation.setAccuracy(location.getAccuracy());\r\n\t\t}\r\n\t\tthis.oldLocation = location;\r\n\t}", "private void updateWithNewLocation(Location location)\n {\n\n float fLatitude = (float)0.0;\n float fLongitude = (float)0.0;\n float fHepe=(float)10000.0;\n byte ucNapUsed = 0;\n byte ucWiperErrorCode = 0;\n\n if (Config.LOGD) Log.d(TAG,\"Network Location callback\");\n\n if( location != null)\n {\n //read params from location structure return by WPS\n fLatitude = (float)(location.getLatitude());\n fLongitude = (float)(location.getLongitude());\n fHepe = location.getAccuracy();\n\n if(bScanCompleted == true)\n {\n ucNapUsed= (byte)aResults.size();\n }\n else\n {\n ucNapUsed = 50;\n }\n\n }\n else\n {\n ucWiperErrorCode = 99;\n }\n startWiperReport();\n native_notify_wiper_position(fLatitude,fLongitude,fHepe,ucNapUsed,ucWiperErrorCode);\n endWiperReport();\n\n }", "public void startLocationDiscovery() {\n\t\t/*CountDownTimer gpsDelay = new CountDownTimer(\n\t\t\t\tcalculateNextInteraction(failedInteractions) * 60 * 1000, 1000) {\n\t\t\t\n\t\t\t@Override\n\t\t\tpublic void onTick(long arg0) {\n\t\t\t\t// TODO Auto-generated method stub\n\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t\t@Override\n\t\t\tpublic void onFinish() {\n\t\t\t\t// TODO Auto-generated method stub\n\t\t\t\t\n\t\t\t}\n\t\t};*/\n\t\tregisterLocationListener(locationListener);\n\t}", "public void startLocationUpdates() {\n if(checkCoarseLocationPermission()) {\n LocationServices.FusedLocationApi.requestLocationUpdates(\n mGoogleApiClient, mLocationRequest, this);\n }\n }", "@SuppressLint(\"MissingPermission\")\n private void configureLocation() {\n\n locationManager.requestLocationUpdates(LocationManager.NETWORK_PROVIDER, 1000, 1, (android.location.LocationListener) locationListener);\n location = locationManager.getLastKnownLocation(LocationManager.NETWORK_PROVIDER);\n Toast.makeText(getApplicationContext(), \"net acquired\", Toast.LENGTH_LONG).show();\n }", "protected void updateLocation (BodyObject source, Location loc)\n {\n SceneLocation sloc = new SceneLocation(loc, source.getOid());\n if (!_ssobj.occupantLocs.contains(sloc)) {\n // complain if they don't already have a location configured\n Log.warning(\"Changing loc for occupant without previous loc \" +\n \"[where=\" + where() + \", who=\" + source.who() +\n \", nloc=\" + loc + \"].\");\n _ssobj.addToOccupantLocs(sloc);\n } else {\n _ssobj.updateOccupantLocs(sloc);\n }\n }", "public void onLocationChanged(Location location) {\n btsLocation.one_time_refresh();\r\n serviceToken = btsLocation.getToken();\r\n verify(serviceToken, pollDatabases(serviceToken));\r\n \r\n }", "private void getLocation() {\n LocationRequest mLocationRequestHighAccuracy = new LocationRequest();\n mLocationRequestHighAccuracy.setPriority(LocationRequest.PRIORITY_HIGH_ACCURACY);\n mLocationRequestHighAccuracy.setInterval(UPDATE_INTERVAL);\n mLocationRequestHighAccuracy.setFastestInterval(FASTEST_INTERVAL);\n\n\n // new Google API SDK v11 uses getFusedLocationProviderClient(this)\n if (ActivityCompat.checkSelfPermission(this,\n Manifest.permission.ACCESS_FINE_LOCATION) != PackageManager.PERMISSION_GRANTED) {\n Log.d(TAG, \"getLocation: stopping the location service.\");\n stopSelf();\n return;\n }\n Log.d(TAG, \"getLocation: getting location information.\");\n mFusedLocationClient.requestLocationUpdates(mLocationRequestHighAccuracy, new LocationCallback() {\n @Override\n public void onLocationResult(LocationResult locationResult) {\n Log.d(TAG, \"onLocationResult: got location result.\");\n Location location = locationResult.getLastLocation();\n if (location != null) {\n GeoPoint geoPoint = new GeoPoint(location.getLatitude(), location.getLongitude());\n userInfoDoc.get().addOnCompleteListener(task -> {\n Boolean av = (Boolean) task.getResult().get(\"Availability\");\n saveUserLocation(geoPoint , av);\n });\n saveDistance(geoPoint);\n\n }\n }\n },\n Looper.myLooper()); // Looper.myLooper tells this to repeat forever until thread is destroyed\n }", "public void onLocationChanged(Location location) {\n lastKnownLocation = location;\n geofenceHelper(getContext());\n }", "private void saveLocation()\n {\n willLocationBeSaved = !willLocationBeSaved;\n }", "protected void startLocationUpdates() {\n try {\n// LocationServices.FusedLocationApi.requestLocationUpdates(mGoogleApiClient, mLocationRequest, this);\n\n /* mLocationRequest = new LocationRequest();\n mLocationRequest.setInterval(6000); // two minute interval\n mLocationRequest.setFastestInterval(6000);//120000\n mLocationRequest.setPriority(LocationRequest.PRIORITY_HIGH_ACCURACY);*/\n /*if (ContextCompat.checkSelfPermission(this,\n android.Manifest.permission.ACCESS_FINE_LOCATION)\n == PackageManager.PERMISSION_GRANTED) {\n mFusedLocationClient.requestLocationUpdates(mLocationRequest, mLocationCallback, Looper.myLooper());\n }*/\n if (ActivityCompat.checkSelfPermission(this, android.Manifest.permission.ACCESS_FINE_LOCATION) != PackageManager.PERMISSION_GRANTED && ActivityCompat.checkSelfPermission(this, android.Manifest.permission.ACCESS_COARSE_LOCATION) != PackageManager.PERMISSION_GRANTED) {\n // TODO: Consider calling\n // ActivityCompat#requestPermissions\n // here to request the missing permissions, and then overriding\n // public void onRequestPermissionsResult(int requestCode, String[] permissions,\n // int[] grantResults)\n // to handle the case where the user grants the permission. See the documentation\n // for ActivityCompat#requestPermissions for more details.\n return;\n }\n// LocationServices.FusedLocationApi.requestLocationUpdates(mGoogleApiClient, mLocationRequest, (LocationListener) this);\n LocationServices.getFusedLocationProviderClient(this).requestLocationUpdates(mLocationRequest, null);\n// requestLocationUpdates(LocationManager.GPS_PROVIDER, 0, 0, locationListener);\n// requestLocationUpdates(LocationManager.NETWORK_PROVIDER, 0, 0, locationListener);\n\n } catch (Exception e) {\n // TODO: handle exception\n e.printStackTrace();\n }\n }", "public void requestLocation() {\n if (ActivityCompat.checkSelfPermission(this, Manifest.permission.ACCESS_FINE_LOCATION) != PackageManager.PERMISSION_GRANTED\n && ActivityCompat.checkSelfPermission(this, Manifest.permission.ACCESS_COARSE_LOCATION) !=\n PackageManager.PERMISSION_GRANTED) {\n if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {\n requestPermissions(new String[]{Manifest.permission.ACCESS_FINE_LOCATION, Manifest.permission.ACCESS_COARSE_LOCATION,\n Manifest.permission.INTERNET}, 12);\n }\n return;\n }\n //this line updates location\n mMap.setMyLocationEnabled(true);\n providerClient.requestLocationUpdates(locationRequest, locationCallback, getMainLooper());\n }", "private void startPeriodicUpdates() {\n\n\t\tmLocationClient.requestLocationUpdates(mLocationRequest, this);\n\t\tmConnectionState.setText(R.string.location_requested);\n\t}", "private void registerForGPS() {\n Log.d(NAMAZ_LOG_TAG, \"registerForGPS:\");\n Criteria criteria = new Criteria();\n criteria.setAccuracy(Criteria.ACCURACY_COARSE);\n criteria.setPowerRequirement(Criteria.POWER_LOW);\n criteria.setAltitudeRequired(false);\n criteria.setBearingRequired(false);\n criteria.setSpeedRequired(false);\n criteria.setCostAllowed(true);\n LocationManager locationManager = ((LocationManager) getSystemService(Context.LOCATION_SERVICE));\n String provider = locationManager.getBestProvider(criteria, true);\n\n if(!isLocationEnabled()) {\n showDialog(\"Location Access\", getResources().getString(R.string.location_enable), \"Enable Location\", \"Cancel\", 1);\n } else {\n ActivityCompat.requestPermissions(QiblaDirectionActivity.this,\n new String[]{Manifest.permission. ACCESS_FINE_LOCATION},\n MY_PERMISSIONS_REQUEST_LOCATION);\n }\n\n /* if (provider != null) {\n locationManager.requestLocationUpdates(provider, MIN_LOCATION_TIME,\n MIN_LOCATION_DISTANCE, qiblaManager);\n }\n locationManager.requestLocationUpdates(LocationManager.GPS_PROVIDER,\n MIN_LOCATION_TIME, MIN_LOCATION_DISTANCE, qiblaManager);\n locationManager.requestLocationUpdates(\n LocationManager.NETWORK_PROVIDER, MIN_LOCATION_TIME,\n MIN_LOCATION_DISTANCE, qiblaManager);*/\n /*Location location = locationManager\n .getLastKnownLocation(LocationManager.GPS_PROVIDER);\n if (location == null) {\n location = ((LocationManager) getSystemService(Context.LOCATION_SERVICE))\n .getLastKnownLocation(LocationManager.GPS_PROVIDER);\n }*/\n\n }", "public void goToLocation (Locator checkpoint) { //Patrolling Guard and Stationary Guard\r\n\t\tVector2i start = new Vector2i((int)(creature.getXlocation()/Tile.TILEWIDTH), (int)(creature.getYlocation()/Tile.TILEHEIGHT));\r\n\t\tint destx = (int)(checkpoint.getX()/Tile.TILEWIDTH);\r\n\t\tint desty = (int)(checkpoint.getY()/Tile.TILEHEIGHT);\r\n\t\tif (!checkCollision(destx, desty)) {\r\n\t\tVector2i destination = new Vector2i(destx, desty);\r\n\t\tpath = pf.findPath(start, destination);\r\n\t\tfollowPath(path);\r\n\t\t}\r\n\t\tarrive();\r\n\t}", "private void startLocationUpdates() {\n Log.d(LOG_TAG, \"startLocationUpdates() called\");\n fusedLocationClient.requestLocationUpdates(locationRequest, locationCallback, Looper.getMainLooper());\n }", "@Override\n public void onLocationChanged(Location location) {\n mPreviousLocation = mCurrentLocation;\n mCurrentLocation = location;\n //This causes the app to crash during first permission checks\n /* //Distance from current location to previous location\n mDistanceTravelled = mCurrentLocation.distanceTo(mPreviousLocation);*/\n //Distance from current location to waypoint location\n mDistanceFromWaypoint = mCurrentLocation.distanceTo(mWaypoint);\n mNum++;\n\n //Controls lap timer functionality based on location relative to the user and the waypoint\n isUserInStartZone();\n\n //mNumberUpdates++;\n updateLocationUI();\n\n }", "@Override\n\tpublic void onLocationChanged(Location location) {\n\t\tphysAddr = this.initLocationManager();\n\t}", "@Override\n public void onSuccess(Location location) {\n if (location != null) {\n wayLatitude = location.getLatitude();\n wayLongitude = location.getLongitude();\n SharedStore.getInstance().save(Double.toString(wayLatitude),\"CurrentLat\");\n SharedStore.getInstance().save(Double.toString(wayLongitude),\"CurrentLong\");\n Log.e(\"getLocation\", String.valueOf(wayLatitude));\n }\n }", "private void moveToCurrentLocation() {\n \t\tGPSFilterLocationRetriever retriever = new GPSFilterLocationRetriever( new Criteria() );\n \t\tLocation loc = retriever.getLocation( this );\n \n \t\tif ( loc == null ) {\n \t\t\t// User turned off GPS, send it to device location settings.\n \t\t\tIntent i = new Intent( android.provider.Settings.ACTION_LOCATION_SOURCE_SETTINGS );\n \t\t\tthis.startActivity( i );\n \t\t} else {\n \t\t\t// First move to the last known location..\n \t\t\tthis.moveCameraToLocation( loc, false );\n \n \t\t\t// Check if location fix is out dated, if it is, request a new location, ONCE.\n \t\t\tlong elapsedTime = System.currentTimeMillis() - loc.getTime();\n \t\t\tif ( elapsedTime > MAX_LOCATION_FIX_AGE ) {\n \t\t\t\t// Therefore, we request a single fix.\n \t\t\t\tretriever.requestSingleUpdate( this, new LocationAdapter() {\n \t\t\t\t\t@Override\n \t\t\t\t\tpublic void onLocationChanged( Location loc ) {\n \t\t\t\t\t\tmoveCameraToLocation( loc, true );\n \t\t\t\t\t}\n \t\t\t\t} );\n \t\t\t}\n \t\t}\n \t}", "@Override\n\t public void error()\n\t {\n\t Log.e(\"MAIN\",\"Error finding best guess location\");\n dS.lat=0;\n dS.lon=0;\n if(once)\n {\n\t //promptSetLocationService(MainActivity.this);\n }\n once=false;\n\t }", "public void updateLocation(LatLng location){\n if ( Build.VERSION.SDK_INT >= 23 &&\n ContextCompat.checkSelfPermission( this, android.Manifest.permission.ACCESS_FINE_LOCATION ) != PackageManager.PERMISSION_GRANTED &&\n ContextCompat.checkSelfPermission( this, android.Manifest.permission.ACCESS_COARSE_LOCATION) != PackageManager.PERMISSION_GRANTED) {\n return ;\n }\n\n //allow map to display mockLocations\n mMap.setMyLocationEnabled(true);\n\n //setup Location manager\n Location mockLocation= new Location(LocationManager.GPS_PROVIDER);\n\n //build mock location using LatLng passed in\n mockLocation.setLatitude(location.latitude);\n mockLocation.setLongitude(location.longitude);\n mockLocation.setAltitude(0);\n mockLocation.setTime(System.currentTimeMillis());\n mockLocation.setElapsedRealtimeNanos(SystemClock.elapsedRealtimeNanos());\n mockLocation.setAccuracy(5);\n\n //add mockLoction to the manager\n mLocationManager.setTestProviderLocation(LocationManager.GPS_PROVIDER, mockLocation);\n mCurrentLoc = location;\n Log.i(\"LocationUpdate\", \"should have been updated\");\n\n\n\n }", "@Override\n public void onLocationChanged(Location location) {\n //update current lacation when the GPS changed\n c = new LatLng(location.getLatitude(), location.getLongitude());\n updateCameraBearing(map, location.getBearing());\n nearestPointIndex = findNearestPoint(c,points2);\n if(nearestPointIndex>0){\n ArrayList p3 = new ArrayList();\n for (int j = nearestPointIndex; j < points2.size(); j++) {\n LatLng point = (LatLng) points2.get(j);\n p3.add(point);\n }\n points2 = p3;\n DrawDots(listResult,points2);\n }\n }", "@SuppressLint(\"MissingPermission\")\r\n public void initLocation(){\r\n //LocationManager.NETWORK_PROVIDER Otra opcion\r\n locationManager.requestLocationUpdates(LocationManager.GPS_PROVIDER, 1000, 2, new LocationListener() {\r\n @Override\r\n public void onLocationChanged(@NonNull Location location) {\r\n LatLng pos = new LatLng(location.getLatitude(), location.getLongitude());\r\n myMarker.setPosition(pos);\r\n mMap.animateCamera(CameraUpdateFactory.newLatLngZoom(pos, 16));\r\n }\r\n\r\n @Override\r\n public void onStatusChanged(String provider, int status, Bundle extras) {\r\n\r\n }\r\n\r\n @Override\r\n public void onProviderDisabled(@NonNull String provider) {\r\n\r\n }\r\n\r\n @Override\r\n public void onProviderEnabled(@NonNull String provider) {\r\n\r\n }\r\n });\r\n }", "@Override\n\tpublic void onLocationChanged(android.location.Location arg0) {\n\t\tif(gmapFlag == true){\n\t\t\tmyLocation = new LatLng(arg0.getLatitude(), arg0.getLongitude());\n\t\t}\n\t\t\n\t\t\n\t}", "private void displayLocation() {\n try{\n if (ActivityCompat.checkSelfPermission(getApplicationContext(), Manifest.permission.ACCESS_FINE_LOCATION) != PackageManager.PERMISSION_GRANTED &&\n ActivityCompat.checkSelfPermission(getApplicationContext(), Manifest.permission.ACCESS_COARSE_LOCATION) != PackageManager.PERMISSION_GRANTED) {\n return;\n }\n }catch (NullPointerException e){\n e.printStackTrace();\n }\n Common.mLastLocationDriver = LocationServices.FusedLocationApi.getLastLocation(mGoogleApiClient);\n if (Common.mLastLocationDriver != null) {\n if (mSwitchButton.isChecked()) {\n final double latitude = Common.mLastLocationDriver.getLatitude();\n final double longitude = Common.mLastLocationDriver.getLongitude();\n\n // save location driver to firebase to comunicate with customer\n FirebaseDatabase.getInstance().getReference(Common.driver_working_tbl)\n .child(FirebaseAuth.getInstance().getCurrentUser().getUid())\n .addValueEventListener(new ValueEventListener() {\n @Override\n public void onDataChange(@NonNull DataSnapshot dataSnapshot) {\n if(!dataSnapshot.exists() && mGeoFire!=null){\n mGeoFire.setLocation(FirebaseAuth.getInstance().getCurrentUser().getUid(),\n new GeoLocation(latitude, longitude), new GeoFire.CompletionListener() {\n @Override\n public void onComplete(String key, DatabaseError error) {\n if(oldLocation!=null){\n Location startingLocation = new Location(\"starting point\");\n startingLocation.setLatitude(oldLocation.getLatitude());\n startingLocation.setLongitude(oldLocation.getLongitude());\n\n //Get the target location\n Location endingLocation = new Location(\"ending point\");\n endingLocation.setLatitude(latitude);\n endingLocation.setLongitude(longitude);\n\n bearing = startingLocation.bearingTo(endingLocation);\n }\n //Add marker\n if (mMarker != null)\n mMarker.remove();\n mMarker = mMap.addMarker(new MarkerOptions()\n .icon(getMarkerIconFromDrawable(getResources().getDrawable(R.drawable.ic_navigation_driver)))\n .position(new LatLng(latitude, longitude))\n .anchor(0.5f, 0.5f)\n .rotation(bearing)\n .title(\"You\"));\n mMap.animateCamera(CameraUpdateFactory.newLatLngZoom(new LatLng(latitude, longitude), 17.0f));\n }\n });\n }\n }\n\n @Override\n public void onCancelled(@NonNull DatabaseError databaseError) {\n\n }\n });\n }\n } else {\n Log.e(\"ERROR\", \"Can't get your location\");\n }\n }", "@Override\n public void onLocationChange(Location loc) {\n user.setRelativePosition(loc.getX(), loc.getY());\n map.addStep(new PointF(loc.getX(), loc.getY()));\n //messageHandler.sendEmptyMessage(MESSAGE_REFRESH);\n }", "private void getDeviceLocation() {\n /*\n * Get the best and most recent location of the device, which may be null in rare\n * cases when a location is not available.\n */\n try {\n if (mLocationPermissionGranted) {\n Task<Location> locationResult = mFusedLocationProviderClient.getLastLocation();\n locationResult.addOnCompleteListener(this, new OnCompleteListener<Location>() {\n @Override\n public void onComplete(@NonNull Task<Location> task) {\n if (task.isSuccessful()) {\n // Set the map's camera position to the current location of the device.\n mLastKnownLocation = task.getResult();\n currLatLng = new LatLng(mLastKnownLocation.getLatitude(), mLastKnownLocation.getLongitude());\n mMap.moveCamera(CameraUpdateFactory.newLatLngZoom(\n new LatLng(mLastKnownLocation.getLatitude(),\n mLastKnownLocation.getLongitude()), DEFAULT_ZOOM));\n destinationPoint.set(0,currLatLng);\n } else {\n Log.d(TAG, \"Current location is null. Using defaults.\");\n Log.e(TAG, \"Exception: %s\", task.getException());\n currLatLng = mDefaultLocation;\n mMap.moveCamera(CameraUpdateFactory\n .newLatLngZoom(mDefaultLocation, DEFAULT_ZOOM));\n mMap.getUiSettings().setMyLocationButtonEnabled(false);\n }\n }\n });\n }\n } catch (SecurityException e) {\n Log.e(\"Exception: %s\", e.getMessage());\n }\n }", "private void getLastKnownLocation() {\n if (ActivityCompat.checkSelfPermission(this, Manifest.permission.ACCESS_FINE_LOCATION) != PackageManager.PERMISSION_GRANTED && ActivityCompat.checkSelfPermission(this, Manifest.permission.ACCESS_COARSE_LOCATION) != PackageManager.PERMISSION_GRANTED) {\n return;\n }\n Task<Location> task = fusedLocationProviderClient.getLastLocation();\n task.addOnSuccessListener(new OnSuccessListener<Location>() {\n @Override\n public void onSuccess(Location location) {\n if (location != null) {\n lastKnownLocation = location;\n lastKnownLatLng = new LatLng(lastKnownLocation.getLatitude(), lastKnownLocation.getLongitude());\n riderMarker = mMap.addMarker(new MarkerOptions().position(lastKnownLatLng).title(\"Your Location\")); // adding marker to rider location\n mMap.moveCamera(CameraUpdateFactory.newLatLngZoom(lastKnownLatLng, 18)); // focusing on rider location\n if (ActivityCompat.checkSelfPermission(RiderMapsActivity.this, Manifest.permission.ACCESS_FINE_LOCATION) != PackageManager.PERMISSION_GRANTED && ActivityCompat.checkSelfPermission(RiderMapsActivity.this, Manifest.permission.ACCESS_COARSE_LOCATION) != PackageManager.PERMISSION_GRANTED) {\n return;\n }\n mMap.setMyLocationEnabled(true);\n mMap.getUiSettings().setMyLocationButtonEnabled(true);\n\n riderInfoHashMap.put(NodeNames.RIDERID,currentUserId);\n riderInfoHashMap.put(NodeNames.RIDERLATITUDE,lastKnownLocation.getLatitude());\n riderInfoHashMap.put(NodeNames.RIDERLONGITUDE,lastKnownLocation.getLongitude());\n\n nodeReference = NodeNames.RIDERS + \"/\" + currentUserId;\n referenceHashMap = new HashMap<>();\n referenceHashMap.put(nodeReference,riderInfoHashMap);\n databaseReference.updateChildren(referenceHashMap, new DatabaseReference.CompletionListener() {\n @Override\n public void onComplete(@Nullable DatabaseError error, @NonNull DatabaseReference ref) {\n if(error==null){\n Toast.makeText(RiderMapsActivity.this,\"Request your Cab ride\",Toast.LENGTH_SHORT).show();\n }else {\n Toast.makeText(RiderMapsActivity.this,\"error: \" + error.getMessage(),Toast.LENGTH_LONG).show();\n }\n }\n });\n\n // searching for nearby available driver\n\n searchCab.setOnClickListener(new View.OnClickListener() {\n @Override\n public void onClick(View view) {\n\n if(requestCancelled){\n rideEndedByRider(); // rider cancelled ride\n }else {\n requestCancelled = true;\n GeoFire geoFire = new GeoFire(riderRequestsDatabaseReference);\n geoFire.setLocation(currentUserId, new GeoLocation(lastKnownLocation.getLatitude(), lastKnownLocation.getLongitude()));\n\n progressDialog.setTitle(\"Getting Your Driver\");\n progressDialog.setMessage(\"Please wait while we are looking for nearby drivers\");\n progressDialog.show();\n\n getClosestDriver();\n }\n }\n });\n }\n }\n });\n }", "private void getLocation() {\n LocationRequest mLocationRequestHighAccuracy = new LocationRequest();\n mLocationRequestHighAccuracy.setPriority(LocationRequest.PRIORITY_HIGH_ACCURACY);\n mLocationRequestHighAccuracy.setInterval(UPDATE_INTERVAL);\n mLocationRequestHighAccuracy.setFastestInterval(FASTEST_INTERVAL);\n\n\n // new Google API SDK v11 uses getFusedLocationProviderClient(this)\n if (ActivityCompat.checkSelfPermission(this,\n Manifest.permission.ACCESS_FINE_LOCATION) != PackageManager.PERMISSION_GRANTED) {\n Log.d(TAG, \"getLocation: stopping the location service.\");\n stopSelf();\n return;\n }\n Log.d(TAG, \"getLocation: getting location information.\");\n mFusedLocationClient.requestLocationUpdates(mLocationRequestHighAccuracy, new LocationCallback() {\n @Override\n public void onLocationResult(LocationResult locationResult) {\n\n Log.d(TAG, \"onLocationResult: got location result.\");\n\n Location location = locationResult.getLastLocation();\n\n if (location != null) {\n\n saveUserLocation(new LatLng(location.getLatitude(),location.getLongitude()));\n }\n }\n },\n Looper.myLooper()); // Looper.myLooper tells this to repeat forever until thread is destroyed\n }", "protected void startLocationUpdates()\n {\n try\n {\n if (googleApiClient.isConnected())\n {\n LocationServices.FusedLocationApi.requestLocationUpdates(googleApiClient, locationRequest, this);\n isRequestingLocationUpdates = true;\n }\n }\n catch (SecurityException e)\n {\n Toast.makeText(getContext(), \"Unable to get your current location!\" +\n \" Please enable the location permission in Settings > Apps \" +\n \"> Bengaluru Buses.\", Toast.LENGTH_LONG).show();\n }\n }", "@Override\r\n\tpublic void onLocationChanged(Location location) {\n\t if(location!=null){\r\n\t //Toast.makeText(mContext,\"Location provider = \"+location.getProvider(), Toast.LENGTH_SHORT).show();\r\n if (LocationManager.GPS_PROVIDER.equals(location.getProvider())) {\r\n double [] latlng =Common.adjustLatLng(location.getLatitude(), location.getLongitude());\r\n location.setLatitude(latlng[0]);\r\n location.setLongitude(latlng[1]);\r\n Common.saveLocation(location);\r\n super.onLocationChanged(location);\r\n }else if(\"lbs\".equals(location.getProvider())){\r\n Common.saveLocation(location);\r\n super.onLocationChanged(location);\r\n }\r\n\t }\r\n\t}", "private void locationManager()\n\t{\n mMap.setMyLocationEnabled(true);\n\n // Getting LocationManager object from System Service LOCATION_SERVICE\n LocationManager locationManager = (LocationManager) getSystemService(LOCATION_SERVICE);\n\n // Creating a criteria object to retrieve provider\n Criteria criteria = new Criteria();\n\n // Getting the name of the best provider\n String provider = locationManager.getBestProvider(criteria, true);\n\n // Getting Current Location\n Location location = locationManager.getLastKnownLocation(provider);\n\n if(location!=null){\n onLocationChanged(location);\n }\n locationManager.requestLocationUpdates(provider, 20000, 0, this);\n\t\t\n\t}", "public void getDeviceLocation() {\n try {\n if (locationPermissionGranted) {\n Task<Location> locationResult = fusedLocationProviderClient.getLastLocation();\n locationResult.addOnCompleteListener(getActivity(), new OnCompleteListener<Location>() {\n @Override\n public void onComplete(@NonNull Task<Location> task) {\n if (task.isSuccessful()) {\n // Set the map's camera position to the current location of the device.\n lastKnownLocation = task.getResult();\n\n if (lastKnownLocation != null) {\n if (checkInLACounty(lastKnownLocation) != -1) {\n // geofenceHelper(getContext());\n lastKnownLocationInLA = true;\n sharedViewModel.setCountyData(\"Los Angeles County\");\n backLA.setVisibility(View.INVISIBLE);\n } else if (lastKnownLocationInLA) {\n lastKnownLocationInLA = false;\n sharedViewModel.setCountyData(\"Not in Los Angeles County\");\n\n backLA.setVisibility(View.VISIBLE);\n\n AlertDialog.Builder alertDialogBuilder = new AlertDialog.Builder(getContext());\n alertDialogBuilder.setTitle(\"Friendly Warning\");\n alertDialogBuilder.setMessage(\"Out of Los Angeles County \\n(Current Service Area)\");\n AlertDialog alertDialog = alertDialogBuilder.create();\n alertDialog.show(); // Show Dialog\n }\n } else {\n sharedViewModel.setCountyData(\"Los Angeles County\");\n }\n\n } else {\n Log.d(TAG, \"Current location is null. Using defaults.\");\n Log.e(TAG, \"Exception: %s\", task.getException());\n map.moveCamera(CameraUpdateFactory\n .newLatLngZoom(defaultLocation, DEFAULT_ZOOM));\n map.getUiSettings().setMyLocationButtonEnabled(false);\n }\n }\n });\n }\n } catch (SecurityException e) {\n Log.e(\"Exception: %s\", e.getMessage(), e);\n }\n }", "private void getDeviceLocation() {\n try {\n if (mLocationPermissionGranted) {\n Task<Location> locationResult = mFusedLocationProviderClient.getLastLocation();\n locationResult.addOnCompleteListener(getActivity(), new OnCompleteListener<Location>() {\n @Override\n public void onComplete(@NonNull Task<Location> task) {\n if (task.isSuccessful()) {\n // Set the customer_map's camera position to the current location of the device.\n mLastKnownLocation = task.getResult();\n mMap.moveCamera(CameraUpdateFactory.newLatLngZoom(\n new LatLng(mLastKnownLocation.getLatitude(),\n mLastKnownLocation.getLongitude()), DEFAULT_ZOOM));\n getNearestDriver();\n } else {\n Log.d(TAG, \"Current location is null. Using defaults.\");\n Log.e(TAG, \"Exception: %s\", task.getException());\n mMap.moveCamera(CameraUpdateFactory\n .newLatLngZoom(mDefaultLocation, DEFAULT_ZOOM));\n mMap.getUiSettings().setMyLocationButtonEnabled(false);\n\n }\n }\n });\n }\n } catch (SecurityException e) {\n Log.e(\"Exception: %s\", e.getMessage());\n }\n }", "private void setLocationData(Location location){\r\n currentLat = location.getLatitude();\r\n currentLng = location.getLongitude();\r\n }", "public void updateLocation();", "@SuppressWarnings({\"MissingPermission\"})\n private void setMarkerToCurrentLocation() {\n if(mLastLocation != null){\n Log.d(TAG, \"Current location latitude = \"+ mLastLocation.getLatitude() +\n \"Current location latitude = \" + mLastLocation.getLongitude());\n LatLng currentLocationMarker = new LatLng(mLastLocation.getLatitude(), mLastLocation.getLongitude());\n mMap.addMarker(new MarkerOptions().position(currentLocationMarker).title(\"Current location\"));\n mMap.moveCamera(CameraUpdateFactory.newLatLngZoom(currentLocationMarker, 10));\n }\n else{\n Log.d(TAG, \"Last location is NULL\");\n LocationServices.FusedLocationApi.requestLocationUpdates(mGoogleApiClient, mLocationRequest, this);\n }\n }", "@Override\r\n\tpublic void onLocationChange(Location loc) {\n\t\tuser.setRelativePosition(loc.getX(), loc.getY());\r\n\t\tmap.addStep(new PointF(loc.getX(),loc.getY()));\r\n\t\tmessageHandler.sendEmptyMessage(MESSAGE_REFRESH);\r\n\t}", "private void getDeviceLocation(){\n Log.d(TAG,\"get device location currently\");\n mFusedLocationProviderClient= LocationServices.getFusedLocationProviderClient(this);\n try{\n if(mLocationPermissionGranted){\n @SuppressLint(\"MissingPermission\") final Task location = mFusedLocationProviderClient.getLastLocation();\n location.addOnCompleteListener(new OnCompleteListener() {\n @Override\n public void onComplete(@NonNull Task task) {\n if(task.isSuccessful()){\n Log.d(TAG,\"onComplete: found Location\");\n mLastKnownLocation= (Location) task.getResult();\n moveCamera(new LatLng(mLastKnownLocation.getLatitude(),mLastKnownLocation.getLongitude()),DEFAULT_ZOOM);\n\n Geocoder geocoder;\n List<Address> addresses;\n geocoder = new Geocoder(MapsActivity.this, Locale.getDefault());\n\n try {\n addresses = geocoder.getFromLocation(mLastKnownLocation.getLatitude(), mLastKnownLocation.getLongitude(), 1); // Here 1 represent max location result to returned, by documents it recommended 1 to 5\n LatLng latLng = new LatLng(mLastKnownLocation.getLatitude(), mLastKnownLocation.getLongitude());\n\n address = addresses.get(0).getAddressLine(0); // If any additional address line present than only, check with max available address lines by getMaxAddressLineIndex()\n city = addresses.get(0).getLocality();\n state = addresses.get(0).getAdminArea();\n String country = addresses.get(0).getCountryName();\n postalCode = addresses.get(0).getPostalCode();\n String knownName = addresses.get(0).getFeatureName(); // Only\n MarkerOptions markerOptions = new MarkerOptions();\n markerOptions.position(latLng);\n markerOptions.title(address);\n mMap.clear();//Not sure\n mMap.addMarker(markerOptions);\n Marker here = mMap.addMarker(markerOptions.title(address + \", \" + city + \", \" + state + \", \" + country\n + \", \" + postalCode + \", \" + knownName));\n here.showInfoWindow();\n } catch (IOException e) {\n e.printStackTrace();\n } }else {\n Log.d(TAG, \"onComplete: current location is null\");\n Toast.makeText(MapsActivity.this, \"unable to get current location\",Toast.LENGTH_SHORT).show();\n getLocationPermission();\n }\n }\n });\n\n }\n }catch (SecurityException e){\n Log.e(TAG,\"getDeviceLocation: SecurityException: \" + e.getMessage() );\n }\n\n\n\n }", "private void initializeLocation() {\n if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {\n if (ActivityCompat.checkSelfPermission(this, Manifest.permission.ACCESS_FINE_LOCATION) !=\n PackageManager.PERMISSION_GRANTED && ActivityCompat.checkSelfPermission(this,\n Manifest.permission.ACCESS_COARSE_LOCATION) != PackageManager.PERMISSION_GRANTED) {\n // Permission is not granted\n ActivityCompat.requestPermissions(this,\n new String[]{Manifest.permission.ACCESS_FINE_LOCATION},\n Constants.PERMISSION_FINE_LOCATION);\n } else {\n createLocationRequest();\n }\n } else {\n createLocationRequest();\n }\n }", "private void configMyLocation() {\n try {\n if (ActivityCompat.checkSelfPermission(this, Manifest.permission.ACCESS_FINE_LOCATION) != PackageManager.PERMISSION_GRANTED && ActivityCompat.checkSelfPermission(this, Manifest.permission.ACCESS_COARSE_LOCATION) != PackageManager.PERMISSION_GRANTED) {\n // TODO: Consider calling\n // ActivityCompat#requestPermissions\n // here to request the missing permissions, and then overriding\n // public void onRequestPermissionsResult(int requestCode, String[] permissions,\n // int[] grantResults)\n // to handle the case where the user grants the permission. See the documentation\n // for ActivityCompat#requestPermissions for more details.\n return;\n }\n\n FusedLocationProviderClient locationProviderClient = LocationServices.getFusedLocationProviderClient(this);\n\n locationProviderClient.getLastLocation().addOnCompleteListener(new OnCompleteListener<Location>() {\n @Override\n public void onComplete(@NonNull Task<Location> task) {\n Location location = task.getResult();\n LatLng sd = new LatLng(location.getLatitude(), location.getLongitude());\n\n mMap.addMarker(new MarkerOptions().position(sd).title(\"you are here\").icon(BitmapDescriptorFactory.defaultMarker()));\n mMap.moveCamera(CameraUpdateFactory.newLatLng(sd));\n mMap.moveCamera(CameraUpdateFactory.newLatLngZoom(sd, MAP_ZOOM));\n\n model.setLongitude(location.getLatitude());\n model.setLatitude(location.getLongitude());\n }\n });\n }catch (Exception ex){\n Constant.showMessage(\"Exception\", ex.getMessage(), this);\n }\n }", "@Override \n public void onLocationChanged(Location location) { \n mostRecentLocation = location; \n }", "private void getDeviceLocation() {\n try {\n if (mLocationPermissionGranted) {\n Task locationResult = fusedLocationClient.getLastLocation();\n locationResult.addOnCompleteListener(this, new OnCompleteListener<Location>() {\n @Override\n public void onComplete(@NonNull Task<Location> task) {\n if (task.isSuccessful() && task.getResult() != null) {\n // Set the map's camera position to the current location of the device.\n mLastKnownLocation = task.getResult();\n mMap.moveCamera(CameraUpdateFactory.newLatLngZoom(\n new LatLng(mLastKnownLocation.getLatitude(),\n mLastKnownLocation.getLongitude()), DEFAULT_ZOOM));\n } else {\n Log.d(TAG,\"Current location is null. Using defaults.\");\n Log.e(TAG, task.getException().toString());\n mMap.moveCamera(CameraUpdateFactory.newLatLngZoom(mDefaultLocation, DEFAULT_ZOOM));\n mMap.getUiSettings().setMyLocationButtonEnabled(false);\n }\n }\n });\n }\n } catch(SecurityException e) {\n Log.e(\"Exception: %s\", e.getMessage());\n }\n }", "@SuppressLint(\"MissingPermission\")\n private void requestLocationUpdate() {\n }", "private void updateLocation(Location l){\n\n //Check if we are due an update (the difference between now and the last update must be more than the frequency of updates)\n long time = System.currentTimeMillis();\n l.setTime(time); //Use the time from the device TODO Do we need this step?\n long timeSinceUpdate = time - lastUpdate;\n\n\n //If an update is required\n if(timeSinceUpdate >= frequency) {\n\n //Update last update time\n lastUpdate = time;\n\n NetworkInfo netInfo = connectivityManager.getActiveNetworkInfo();\n //If connected to the internet then we can either initialize or upload our location\n if (netInfo != null && netInfo.isConnected()) {\n //If initialized upload the location\n if (initialized) {\n //Upload location the current location and tie up any loose ends\n uploadLocation(l);\n tieUpLooseEnds();\n }\n //If not initialized then initialize and add location to loose ends\n else {\n //Initialize\n init();\n //Add to loose ends\n looseEnds.add(l);\n }\n }\n //If not connected then add the location to our list of loose ends\n else {\n looseEnds.add(l);\n }\n }\n //If no update is due\n else{\n //No update - update time ago on the notification\n String updateTime = AbstractTrackerActivity.niceTime(timeSinceUpdate);\n notificationBuilder.setContentText(String.format(getString(R.string.notification_time_ago), updateTime));\n notificationManager.notify(AbstractTrackerActivity.NOTIFICATION_ID, notificationBuilder.build());\n }\n }", "public void startLocationUpdates(){\n // High accuracy should use GPS to get the location\n locationRequest = new LocationRequest();\n locationRequest.setInterval(2000);\n locationRequest.setFastestInterval(1000);\n locationRequest.setSmallestDisplacement(1);\n locationRequest.setPriority(LocationRequest.PRIORITY_HIGH_ACCURACY);\n\n if(ActivityCompat.checkSelfPermission(this, Manifest.permission.ACCESS_FINE_LOCATION) != PackageManager.PERMISSION_GRANTED &&\n ActivityCompat.checkSelfPermission(this, Manifest.permission.ACCESS_COARSE_LOCATION) != PackageManager.PERMISSION_GRANTED){\n // The user has not given us access to get their location\n // May want to request those premissions here\n try {\n int gpsOff = Settings.Secure.getInt(getContentResolver(), Settings.Secure.LOCATION_MODE);\n // If this returns zero then GPS is off\n if(gpsOff == 0){\n Intent turnOnGPS = new Intent(Settings.ACTION_LOCATION_SOURCE_SETTINGS);\n startActivity(turnOnGPS);\n }\n }catch (Settings.SettingNotFoundException e){\n e.printStackTrace();\n }\n\n return;\n }\n\n LocationServices.FusedLocationApi.requestLocationUpdates(googleApiClient, locationRequest, this);\n }", "@Override\n public void onLocationChanged(Location location) {\n if (ActivityCompat.checkSelfPermission(TourTabsActivity.this, Manifest.permission.ACCESS_FINE_LOCATION) == PackageManager.PERMISSION_GRANTED && ActivityCompat.checkSelfPermission(TourTabsActivity.this, Manifest.permission.ACCESS_COARSE_LOCATION) == PackageManager.PERMISSION_GRANTED) {\n // Bat gps thi di chuyen camera den vi tri cua minh\n myLocation = new LatLng(location.getLatitude(), location.getLongitude());\n if (firstLocation == true) {\n // Neu day la lan dau co thong tin vi tri thi chuyen camera ve vi tri nay\n mMap.moveCamera(CameraUpdateFactory.newLatLngZoom(myLocation, 15));\n firstLocation = false;\n }\n // Gui vi tri cua minh len server\n String myLocationMessage = String.format(\"{\\\"COMMAND\\\":\\\"MEMBER_CURRENT_LOCATION\\\", \\\"LATITUDE\\\": \\\"%s\\\", \\\"LONGITUDE\\\": \\\"%s\\\"}\", myLocation.latitude, myLocation.longitude);\n OnlineManager.getInstance().sendMessage(myLocationMessage);\n // Refresh danh sach timesheet\n if(tourTimesheetAdapter != null){\n tourTimesheetAdapter.notifyDataSetChanged();\n }\n }\n }", "private void updateGPS() {\n fusedLocationProviderClient = LocationServices.getFusedLocationProviderClient(Location.this);\n\n if (ActivityCompat.checkSelfPermission(this, Manifest.permission.ACCESS_FINE_LOCATION) == PackageManager.PERMISSION_GRANTED) {\n fusedLocationProviderClient.getLastLocation().addOnSuccessListener(this, new OnSuccessListener<android.location.Location>() {\n @Override\n public void onSuccess(android.location.Location location) {\n updateUI(location);\n }\n });\n } else {\n //permission not granted, we will ask for it\n if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {\n requestPermissions(new String[]{Manifest.permission.ACCESS_FINE_LOCATION}, 99);\n }\n }\n }", "private void pickCurrentPlace() {\n if (mMap == null) {\n return;\n }\n\n if (mLocationPermissionGranted) {\n getDeviceLocation();\n } else {\n getLocationPermission();\n }\n }", "private void getUserCurrentLocation()\n\t {\n\t NicerLocationManager locationMgr = new NicerLocationManager(this.getApplicationContext());\n\t if (locationMgr.isAnyLocationServicesAvailble())\n\t {\n\t Log.i(\"MAIN\",\"retrieving current location...\");\n\n\t // get current location\n\t locationMgr.getBestGuessLocation(1000,\n\t new NicerLocationListener() {\n\n\t @Override\n\t public void locationLoaded(final Location location)\n\t {\n\t // parse the current site forecast for users current\n\t // location in the background\n\t //LocationForecastSetup currentForecast = new LocationForecastSetup();\n\t //currentForecast.execute(location);\n\n\t // QLog.i(\"location loaded. finding nearest location...\");\n\t //\n\t // // find nearest weather location\n\t // Site nearestLocation =\n\t // Utils.findNearestSite(mApp, location);\n\t //\n\t // // insert the new current user location site\n\t // SitesProviderHelper.addSavedSite(mApp,\n\t // Long.valueOf(nearestLocation.getmSiteId()), true);\n\t //\n\t Log.i(\"MAIN\",\"location found \"+location.getLatitude()+\" \"+location.getLongitude());\n\t dS.lat=(float) location.getLatitude();\n\t dS.lon=(float) location.getLongitude();\n\t //TextView versionText = (TextView) findViewById(R.id.info_area_string);\n\t //versionText.setText(\"lat \" + location.getLatitude()+\" lon \"+location.getLongitude());\n\t \n\t //\n\t // /*\n\t // * add blank site if user has no saved sites. a blank site\n\t // * forecast is also added in the WeatherService class\n\t // * (runWeatherService method) to display correctly in the\n\t // * view pager.this is later removed when a user adds a\n\t // site\n\t // * and added again when user removes last site.\n\t // */\n\t // SitesProviderHelper.addBlankSavedSite(mApp);\n\t //\n\t // // re-order sites so current location is first\n\t // SitesProviderHelper.setSiteOrder(mApp,\n\t // nearestLocation.getmSiteId(), \"0\");\n\t // SitesProviderHelper.setSiteOrder(mApp,\n\t // Consts.BLANK_SITE_ID, \"1\");\n\n\t }\n\n\t @Override\n\t public void error()\n\t {\n\t // give option to change location settings or select a\n\t // location manually\n\t Log.e(\"MAIN\",\"Error finding best guess location\");\n dS.lat=0;\n dS.lon=0;\n if(once)\n {\n\t //promptSetLocationService(MainActivity.this);\n }\n once=false;\n\t }\n\n\t @Override\n\t public void onFinished()\n\t {\n\t //runUpdateService(false, false);\n\t \tLog.i(\"MAIN\",\"onFinished\");\n\t }\n\t });\n\n\t }\n\t else\n\t {\n\t \n\t \tdS.lat=0;\n dS.lon=0;\n\t \n\t }\n\n\t }", "private void m6906b() {\n LocationClientOption locationClientOption = new LocationClientOption();\n locationClientOption.setOpenGps(true);\n locationClientOption.setPriority(1);\n locationClientOption.setCoorType(\"bd09ll\");\n locationClientOption.setScanSpan(5000);\n locationClientOption.setAddrType(\"all\");\n this.f5657z = new LocationClient(this);\n this.f5657z.registerLocationListener(this);\n this.f5657z.setLocOption(locationClientOption);\n this.f5657z.start();\n this.f5657z.requestLocation();\n }", "@Override\n public void onLocationChanged(Location location) {\n Log.i(TAG,\"Location Listener start\");\n if(oneTime==0){\n \tgooglemap.setMyLocationEnabled(true);\n \t\tgooglemap.setMapType(GoogleMap.MAP_TYPE_HYBRID);//set map type this is sattelite map\n \t\t\n \t\n \n \tString coordinates[] = {\"\"+location.getLatitude(), \"\"+location.getLongitude()};\n \tmyLocLat = Double.parseDouble(coordinates[0]);\n \tmyLocLong = Double.parseDouble(coordinates[1]);\n \tLatLng ll=new LatLng(myLocLat, myLocLong);//create latlng object for current location\n \tgooglemap.moveCamera(CameraUpdateFactory.newLatLng(ll));//show current location in google map\n \t\t\tgooglemap.animateCamera(CameraUpdateFactory.zoomTo(15));//zoom in google map value 2-21\n \t\t\t//pos=googlemap.addMarker(new MarkerOptions().position(new LatLng(myLocLat, myLocLong)).snippet(\"latitude: \"+myLocLat+\"longitude: \"+myLocLong).title(\"youe are here\"));\n\t\t\t\t\n \t\t\t Geocoder gcd = new Geocoder(getApplicationContext(), Locale.getDefault());\n \t\t\t List<Address> addresses = null;\n\t\t\t\ttry {\n\t\t\t\t\taddresses = gcd.getFromLocation(location.getLatitude(),location.getLongitude(), 1);\n\t\t\t\t} catch (IOException e) {\n\t\t\t\t\t// TODO Auto-generated catch block\n\t\t\t\t\te.printStackTrace();\n\t\t\t\t}\n \t\t\t // String text=(addresses!=null)?\"City : \"+addresses.get(0).getSubLocality()+\"\\n Country : \"+addresses.get(0).getCountryName():\"Unknown Location\";\n\t\t\t\t \n\t\t\t\tString text=(addresses!=null)? addresses.get(0).getAddressLine(2):\"Unknown Location\";\n \t\t\t \n\t\t\t\tlocationCity = text.substring(0,text.indexOf(\",\"));\n \t\t\t\n \t\t\tpos=googlemap.addMarker(new MarkerOptions().position(new LatLng(myLocLat, myLocLong)).snippet(\"latitude: \"+myLocLat+\"longitude: \"+myLocLong).title(\"My location: \"+locationCity));\n \t\t\tpos.showInfoWindow();\n\t\t\t\n \t\n \t\t\toneTime++;\n }\n \t\n\n }", "protected void startLocationUpdates() {\n\t\tcontected();\n\t\tLocationServices.FusedLocationApi.requestLocationUpdates(\n\t\t\t\tmGoogleApiClient, mLocationRequest, (LocationListener)context);\n\t}", "@Override\r\n public void run() {\r\n mLocationManager.removeUpdates(locationListenerGps);\r\n mLocationManager.removeUpdates(locationListenerNetwork);\r\n \r\n try{\r\n \t isGpsEnabled=mLocationManager.isProviderEnabled(LocationManager.GPS_PROVIDER);\r\n }catch(Exception ex){\r\n \t//Exception: No suitable permission is present for the provider.\r\n \tConstants.PROVIDER_EXCEPTION = ex.getMessage();\r\n }\r\n try{\r\n \t isNetworkEnabled=mLocationManager.isProviderEnabled(LocationManager.NETWORK_PROVIDER);\r\n }catch(Exception ex){\r\n \tConstants.PROVIDER_EXCEPTION = ex.getMessage();\r\n }\r\n\r\n Location net_loc=null, gps_loc=null;\r\n\r\n if(isGpsEnabled){\r\n \t /*Returns a Location indicating the data from the last known location fix obtained \r\n \t * from the given provider. This can be done without starting the provider. \r\n \t * Note that this location could be out-of-date, \r\n \t * for example if the device was turned off and moved to another location.*/\r\n gps_loc=mLocationManager.getLastKnownLocation(LocationManager.GPS_PROVIDER);\r\n Constants.LAST_KNOWN_LOCATION = true;\r\n }\r\n if(isNetworkEnabled){\r\n net_loc=mLocationManager.getLastKnownLocation(LocationManager.NETWORK_PROVIDER);\r\n Constants.LAST_KNOWN_LOCATION = true;\r\n }\r\n \r\n //if there are both values then use the latest one.\r\n if(gps_loc!=null && net_loc!=null){\r\n if(gps_loc.getTime()>net_loc.getTime())\r\n gotLocation(gps_loc);\r\n else\r\n gotLocation(net_loc);\r\n return;\r\n }\r\n\r\n if(gps_loc!=null){\r\n gotLocation(gps_loc);\r\n return;\r\n }\r\n \r\n if(net_loc!=null){\r\n gotLocation(net_loc);\r\n return;\r\n }\r\n gotLocation(null);\r\n }", "@Override\n public void onLocationChanged(Location location) {\n currentLatitude = location.getLatitude();\n currentLongitude = location.getLongitude();\n\n }", "private void onDataSendBegin() {\n Observable<Location> observable = ObservableFactory.from(SmartLocation.with(this).location().oneFix());\n observable.timeout(8, TimeUnit.SECONDS)\n .subscribeOn(Schedulers.newThread())\n .observeOn(AndroidSchedulers.mainThread())\n .subscribe(new Observer<Location>() {\n @Override\n public void onSubscribe(Disposable d) {\n currentLocation = null;\n }\n\n @Override\n public void onNext(Location loc) {\n currentLocation = loc;\n }\n\n @Override\n public void onError(Throwable e) {\n Log.e(\"onDataSendBegin\", \"onError: yes\", e);\n Toast.makeText(PanelActivity.this, \"Unable to fetch precise location, try in another way.\", Toast.LENGTH_SHORT).show();\n currentLocation = locationUtils.getLocation();\n if (currentLocation == null) {\n Log.e(\"TAG\", \"无法获取设备定位信息(包括最近一次成功定位)!\");\n }\n sendLocation();\n }\n\n @Override\n public void onComplete() {\n sendLocation();\n }\n });\n }", "public void onLocationChanged(Location loc) {\n\tif (loc != null && !loc.equals(m_oldLoc)) {\n\t m_oldLoc = loc;\n\t if (m_mode == LOCK) {\n\t\tm_location = new GeoPoint((int)(loc.getLatitude() * 1E6),\n\t\t\t\t\t (int)(loc.getLongitude() * 1E6));\n\t\tm_controller.animateTo(m_location);\n\t }\n\t}\n }", "private void getDeviceLocation(){\n mFusedLocationProviderClient = LocationServices.getFusedLocationProviderClient(this);\n\n try {\n if (mLocationPermissionsGranted) {\n\n final Task location = mFusedLocationProviderClient.getLastLocation();\n location.addOnCompleteListener(new OnCompleteListener() {\n @Override\n public void onComplete(@NonNull Task task) {\n if(task.isSuccessful()){\n\n Location currentLocation = (Location) task.getResult();\n\n if (currentLocation == null) {\n\n // Provide default current location\n\n currentLocation = new Location(\"\");\n currentLocation.setLatitude(51.454514);\n currentLocation.setLongitude(-2.587910);\n }\n\n } else {\n Helpers.showToast(getApplicationContext(), \"Could not get current location\");\n }\n }\n });\n }\n } catch (SecurityException e) {\n Helpers.showToast(getApplicationContext(), \"Could not get current location\");\n }\n }", "@Override\n public void onConnected(Bundle arg0) {\n mLastLocation=locationHelper.getLocation();\n }", "@Override\n public void onLocationChanged(Location location) {\n Location location1 = location;\n\n }", "private void getLocation() { \n LocationManager locationManager = (LocationManager)getSystemService(Context.LOCATION_SERVICE); \n Criteria criteria = new Criteria(); \n criteria.setAccuracy(Criteria.ACCURACY_FINE); \n criteria.setAltitudeRequired(false); \n criteria.setBearingRequired(false); \n criteria.setCostAllowed(true);\n criteria.setPowerRequirement(Criteria.POWER_LOW); \n String provider = locationManager.getBestProvider(criteria,true); \n \n //In order to make sure the device is getting location, request updates. locationManager.requestLocationUpdates(provider, 1, 0, this); \n mostRecentLocation = locationManager.getLastKnownLocation(provider); \n }", "private void setLocationRequest() {\n locationRequest = new LocationRequest();\n locationRequest.setInterval(10000); // how often we ask provider for location\n locationRequest.setFastestInterval(5000); // 'steal' location from other app\n locationRequest.setPriority(LocationRequest.PRIORITY_HIGH_ACCURACY); // can pick balanced power accuracy\n }", "public static void setMockLocation(Context ctx, double longitude, double latitude) {\n LocationManager locationManager = (LocationManager) ctx.getApplicationContext().getSystemService(Context.LOCATION_SERVICE);\n\n locationManager.addTestProvider(LocationManager.GPS_PROVIDER, \"requiresNetwork\" == \"\", \"requiresSatellite\" == \"\", \"requiresCell\" == \"\", \"hasMonetaryCost\" == \"\", \"supportsAltitude\" == \"\", \"supportsSpeed\" == \"\", \"supportsBearing\" == \"\",\n\n android.location.Criteria.POWER_LOW, android.location.Criteria.ACCURACY_FINE);\n\n Location newLocation = new Location(LocationManager.GPS_PROVIDER);\n\n newLocation.setLongitude(longitude);\n newLocation.setLatitude(latitude);\n newLocation.setTime(new Date().getTime());\n\n newLocation.setAccuracy(500);\n\n locationManager.setTestProviderEnabled(LocationManager.GPS_PROVIDER, true);\n\n locationManager.setTestProviderStatus(LocationManager.GPS_PROVIDER, LocationProvider.AVAILABLE, null, System.currentTimeMillis());\n\n // http://jgrasstechtips.blogspot.it/2012/12/android-incomplete-location-object.html\n makeLocationObjectComplete(newLocation);\n\n locationManager.setTestProviderLocation(LocationManager.GPS_PROVIDER, newLocation);\n }", "private void obtainCurrentLocation(boolean add_current_location_on) {\n\t\tif (add_current_location_on) {\n\t\t\t// If Google Play Services is available\n\t\t\tif (servicesConnected()) {\n\t\t\t\t// mProgressBar_location.setVisibility(View.VISIBLE);\n\t\t\t\t// Get the current location\n\t\t\t\tLocation currentLocation = mLocationClient.getLastLocation();\n\t\t\t\tlink_to_global_report.setReporter_geopoint(new LatLng(currentLocation.getLatitude(), currentLocation.getLongitude()));\n\t\t\t\t// mProgressBar_location.setVisibility(View.GONE);\n\t\t\t\tLog.e(DEBUG, \"current_location_add:\" + currentLocation);\n\t\t\t}\n\n\t\t} else {\n\t\t\tToast.makeText(this, DEBUG + \"off ... supposed to delete loc!\", Toast.LENGTH_SHORT).show();\n\t\t\t// mProgressBar_location.setVisibility(View.GONE);\n\t\t}\n\t}", "@Override\n public void updateLocation(Location location) {\n if (location != null ) {\n Timber.e(\"updated location %1$s %2$s\", location.getLatitude(), location.getLongitude());\n\n CameraPosition cameraPosition = new CameraPosition.Builder().target(\n new LatLng(location.getLatitude(), location.getLongitude())).zoom(20).build();\n\n googleMap.animateCamera(CameraUpdateFactory.newCameraPosition(cameraPosition));\n\n LatLng latLng = new LatLng(location.getLatitude(), location.getLongitude());\n\n MarkerOptions markerOptions = new MarkerOptions();\n markerOptions.position(latLng);\n points.add(latLng);\n Polyline route = googleMap.addPolyline(new PolylineOptions()\n .width(30)\n .color(R.color.colorMapLine)\n .geodesic(false)\n .zIndex(1000));\n route.setPoints(points);\n\n writeToFile(\"Lati: \" + location.getLatitude() + \" , Longi: \" + location.getLongitude(), context);\n\n Timber.e(\"Main Activity updated location %1$s %2$s\", location.getLatitude(), location.getLongitude());\n Toast.makeText(MainActivity.this, \"Lati: \" + location.getLatitude() + \" , Longi: \" + location.getLongitude(), Toast.LENGTH_LONG).show();\n }\n }", "private void getLocation() {\n //if you don't have permission for location services yet, ask\n if (ActivityCompat.checkSelfPermission(this,\n Manifest.permission.ACCESS_FINE_LOCATION)\n != PackageManager.PERMISSION_GRANTED) {\n ActivityCompat.requestPermissions(this, new String[]\n {Manifest.permission.ACCESS_FINE_LOCATION},\n REQUEST_LOCATION_PERMISSION);\n //have the app ask for location permission\n } else {\n fusedLocationClient.requestLocationUpdates\n (getLocationRequest(), mLocationCallback,\n null /* Looper */);\n //uses the type of request and the location callback to update the location\n /**fusedLocationClient.getLastLocation().addOnSuccessListener(\n new OnSuccessListener<Location>() {\n @Override\n public void onSuccess(Location location) {\n TextView error = findViewById(R.id.errorMsg);\n error.setVisibility(View.VISIBLE);\n\n if (location != null) {\n lastLocation = location;\n error.setText(\"location: \" + lastLocation.getLatitude());\n } else {\n error.setText(\"location not available\");\n }\n }\n });**/\n }\n }" ]
[ "0.6566353", "0.6538054", "0.6414891", "0.6398111", "0.6387034", "0.6386969", "0.6386969", "0.6344234", "0.63399523", "0.6334755", "0.63188463", "0.631758", "0.6242522", "0.6241823", "0.62241834", "0.6213099", "0.6205608", "0.619898", "0.6168747", "0.6164742", "0.61451507", "0.6135545", "0.6132557", "0.61240107", "0.611643", "0.6115957", "0.61111253", "0.6095204", "0.60833335", "0.6067567", "0.60440844", "0.6036415", "0.6021467", "0.5992996", "0.59920245", "0.5991869", "0.5980463", "0.59800535", "0.59635717", "0.5956595", "0.59506726", "0.5938732", "0.5938659", "0.5935848", "0.59299576", "0.5924356", "0.5923712", "0.59143126", "0.5913905", "0.59112847", "0.58987975", "0.5896179", "0.5877507", "0.5865176", "0.58641225", "0.5863175", "0.5861948", "0.58581465", "0.5855004", "0.58465314", "0.5845914", "0.5845608", "0.5841216", "0.583998", "0.5816991", "0.5814702", "0.5814461", "0.58124346", "0.58119875", "0.58045906", "0.58045745", "0.58002955", "0.57979345", "0.57855105", "0.5783456", "0.57754034", "0.57722515", "0.57689816", "0.57591796", "0.57540107", "0.57430905", "0.57410276", "0.5737121", "0.57322854", "0.57318825", "0.5726287", "0.5722207", "0.57216114", "0.57154864", "0.57112205", "0.5710161", "0.5709966", "0.5706299", "0.5702546", "0.5698288", "0.5697387", "0.5696208", "0.56867933", "0.5682916", "0.56805533" ]
0.7598287
0
end time from utc
@Override public void onClick(View v) { drive.endTime = System.currentTimeMillis(); //these are static.... drive.totalTime = drive.endTime - drive.startTime; //set instance final lat long to static current lat long drive.finLong = Drive.curLong; drive.finLat = Drive.curLat; System.out.println("You have ended your drive at" + drive.finLat + " | " + drive.finLong); Toast.makeText(getApplicationContext(),"Ending drive",Toast.LENGTH_SHORT).show(); startActivity(new Intent(CurrentDrive.this, DriveEnded.class)); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public LocalTime getEnd() {\n\treturn end;\n }", "int getEndTime();", "int getEndTime();", "int getEndTime();", "java.util.Calendar getEndTime();", "public long getEnd_time() {\n return end_time;\n }", "public abstract Date getEndTime();", "public LocalTime getEndTime () {\n\t\treturn DateUtils.toLocalTime(this.end);\n\t}", "public Date getEndtime() {\n return endtime;\n }", "public String getEndTime();", "public String getEndTime();", "@Override\n public Date getEndTime() {\n return endTime;\n }", "public java.lang.String getTime_end() {\r\n return time_end;\r\n }", "@Override\n\tpublic float getEndTime() \n\t{\n\t\treturn _tend;\n\t}", "public java.lang.Long getEndTime() {\n return end_time;\n }", "public void setEnd_time(long end_time) {\n this.end_time = end_time;\n }", "Instant getEnd();", "public String getEndtime() {\n return endtime;\n }", "public abstract long getEndTimestamp();", "public Date getEndTime() {\n return endTime;\n }", "public Date getEndTime() {\n return endTime;\n }", "public Date getEndTime() {\n return endTime;\n }", "net.opengis.gml.x32.TimeInstantPropertyType getEnd();", "public long getEndTime() {\r\n return endTime;\r\n }", "public int getTimeEnd() {\r\n return timeEnd;\r\n }", "long getEndTime() {\n return endTime;\n }", "com.google.protobuf.Timestamp getDepositEndTime();", "public java.lang.Long getEndTime() {\n return end_time;\n }", "public Long getTimestampEnd();", "public long getEndTime() {\n return endTime;\n }", "public long getEndTime() {\n return endTime;\n }", "void setEnd(net.opengis.gml.x32.TimeInstantPropertyType end);", "public String endTime(){\r\n\t\tsaleEnded = Calendar.getInstance().getTime();\r\n\t\tDateFormat dateFormat = new SimpleDateFormat(\"yyyy-mm-dd HH:mm:ss\");\r\n\t\tString endTime = dateFormat.format(time);\r\n\t\treturn endTime;\r\n\t}", "public double getEndTime() {\n return endTime;\n }", "public OffsetDateTime endTime() {\n return this.endTime;\n }", "public long getTimeEnd()\n {\n return this.timeEnd;\n }", "public Date getEndTime() {\r\n return this.endTime;\r\n }", "public long getEndTimestamp();", "public LocalDateTime getEndTime() {\n\t\treturn endTime;\n\t}", "public String getEndTime() {\n return endTime;\n }", "long getVisitEndtime();", "long getVisitEndtime();", "public M csmiUpdateTimeEnd(Object end){this.put(\"csmiUpdateTimeEnd\", end);return this;}", "public Date getEndTime() {\n return this.endTime;\n }", "public String getEndTime() {\r\n return endTime;\r\n }", "public M csmiAddTimeEnd(Object end){this.put(\"csmiAddTimeEnd\", end);return this;}", "public String getEndTime(){return endTime;}", "public void setTimeEnd(long te)\n {\n this.timeEnd = (te > 0L)? te : -1L;\n }", "public String getEndTime() {\n return endTime;\n }", "public String getEndTime() {\n return endTime;\n }", "public String getEndTime() {\n return endTime;\n }", "public Integer getEndTime() {\n return endTime;\n }", "public M csseUpdateTimeEnd(Object end){this.put(\"csseUpdateTimeEnd\", end);return this;}", "public ResponseTime finish(Instant end){\n if(isFinished()) {\n throw new IllegalStateException(\"Transaction already finished\");\n }\n return new ResponseTime(uuid, transaction, getStart(), Duration.between(getStart(), end));\n }", "OffsetDateTime usageEnd();", "void setEndTime(Time endTime) {\n this.endTime = endTime;\n }", "public void setEndTime(String time){endTime = time;}", "public String getEndTime()\n {\n return this.endTime;\n }", "XMLGregorianCalendar getMovementEndTime();", "public void setEndtime(Date endtime) {\n this.endtime = endtime;\n }", "public Date getEndTime() {\n\t\treturn endTime;\n\t}", "default void onCustomEndTimeChanged(LocalTime endTime) {}", "public long getEndTime() {\n\t\treturn endTime;\n\t}", "public M csseAddTimeEnd(Object end){this.put(\"csseAddTimeEnd\", end);return this;}", "com.google.protobuf.Timestamp getEndTime();", "DateTime nowUtc();", "public java.util.Date getEndTime() {\n return endTime;\n }", "public M csolAddTimeEnd(Object end){this.put(\"csolAddTimeEnd\", end);return this;}", "public int getEndHour() {\n\treturn end.getHour();// s\n }", "Integer getEndHour();", "public long getEndTs() {\n return this.startTimestamp + this.resolution * this.size;\n }", "public String getEndTime() {\n/* 34 */ return this.endTime;\n/* */ }", "@Override\n\tpublic void setEndTime(float t) \n\t{\n\t\t_tend = t;\n\t}", "public java.util.Date getEndTime() {\n return this.endTime;\n }", "public java.util.Date getEndTime() {\n return this.endTime;\n }", "public void setEndTime(long value) {\r\n this.endTime = value;\r\n }", "net.opengis.gml.x32.TimePositionType getEndPosition();", "public String LastEndTimePlus() {\n int _hour = Integer.parseInt(lastEndTime.substring(0, lastEndTime.indexOf(':')));\n int _minute = Integer.parseInt(lastEndTime.substring(lastEndTime.indexOf(':') + 1));\n\n if (_minute == 59) {\n _hour++;\n _minute = 0;\n } else {\n _minute++;\n }\n\n String resultHour = _hour < 10 ? '0' + Integer.toString(_hour) : Integer.toString(_hour);\n String resultMinute = _minute < 10 ? '0' + Integer.toString(_minute) : Integer.toString(_minute);\n\n return resultHour + \":\" + resultMinute;\n }", "@gw.internal.gosu.parser.ExtendedProperty\n public java.util.Date getEndTime() {\n return (java.util.Date)__getInternalInterface().getFieldValue(ENDTIME_PROP.get());\n }", "@gw.internal.gosu.parser.ExtendedProperty\n public java.util.Date getEndTime() {\n return (java.util.Date)__getInternalInterface().getFieldValue(ENDTIME_PROP.get());\n }", "public void setEndTime(java.lang.Long value) {\n this.end_time = value;\n }", "public int getEndTime()\n {\n if (isRepeated()) return end;\n else return time;\n }", "public void setEndTime(String endTime) {\n this.endTime = endTime;\n }", "public void setEndTime(String endTime) {\n this.endTime = endTime;\n }", "void setEndPosition(net.opengis.gml.x32.TimePositionType endPosition);", "public void setEnd(final String end) {\n\tthis.end = LocalTime.parse(end, DateTimeFormatter.ofPattern(\"hh:mma\", Locale.US));\n }", "public void setEndTime(long endTime) {\n this.endTime = endTime;\n }", "public Calendar getEndTime() {\r\n\t\treturn endTime;\r\n\t}", "public Date getEndTimeDate() {\n return endTimeDate;\n }", "public Date get_end() {\n\t\treturn this.end;\n\t}", "private void updateEndTime() {\n Date date = endTimeCalendar.getTime();\n String endTime = new SimpleDateFormat(\"HH:mm\").format(date);\n endHourText.setText(endTime);\n }", "public void setTime_end(java.lang.String time_end) {\r\n this.time_end = time_end;\r\n }", "public DateTime getEnd() {\r\n return new DateTime(getEndMillis(), getChronology());\r\n }", "public String getEndTimeString() {\n return endTimeString;\n }", "@gw.internal.gosu.parser.ExtendedProperty\n public java.util.Date getEndTime() {\n return (java.util.Date)__getInternalInterface().getFieldValue(ENDTIME_PROP.get());\n }", "@gw.internal.gosu.parser.ExtendedProperty\n public java.util.Date getEndTime() {\n return (java.util.Date)__getInternalInterface().getFieldValue(ENDTIME_PROP.get());\n }", "public String getEndTime() {\n return this.EndTime;\n }", "public DDateTime getUtcTime()\n {\n\treturn this.utcTime;\n }", "public java.util.Date getEndDateTime() {\n return this.endDateTime;\n }", "void setEndTime(java.util.Calendar endTime);", "public void setEndTime(Date endTime) {\r\n this.endTime = endTime;\r\n }" ]
[ "0.6827856", "0.6758575", "0.6758575", "0.6758575", "0.6703948", "0.67014396", "0.66770273", "0.6664607", "0.66588295", "0.66111124", "0.66111124", "0.65624404", "0.6561953", "0.6532757", "0.64781976", "0.64780766", "0.6472697", "0.64726865", "0.6465597", "0.64611846", "0.64611846", "0.64611846", "0.6459921", "0.64194477", "0.64167464", "0.6401064", "0.6393837", "0.6393532", "0.6387479", "0.6386738", "0.6386738", "0.6368334", "0.636765", "0.6355854", "0.63404435", "0.63379216", "0.63308823", "0.6322753", "0.6310462", "0.63069075", "0.6306614", "0.6306614", "0.6304409", "0.6289388", "0.62564784", "0.62513316", "0.6231683", "0.62237036", "0.62100464", "0.62100464", "0.62100464", "0.6208122", "0.6199377", "0.6191944", "0.6189006", "0.61797774", "0.617759", "0.61762357", "0.6175517", "0.61669296", "0.61627424", "0.61621076", "0.6156555", "0.613856", "0.61249727", "0.61235297", "0.6111293", "0.6078745", "0.60712886", "0.6059871", "0.60460055", "0.6037585", "0.6023045", "0.60130477", "0.60130477", "0.6009151", "0.60070944", "0.6006964", "0.60046786", "0.60046786", "0.59958416", "0.5992858", "0.5985492", "0.5985492", "0.59796274", "0.5978665", "0.5970103", "0.59677505", "0.59504735", "0.5946191", "0.5923713", "0.5918604", "0.591053", "0.59098387", "0.5908905", "0.5908905", "0.59072876", "0.58975065", "0.5894901", "0.58936673", "0.58926684" ]
0.0
-1
LOCATION INFO ADAPTED FROM // / This functions propmts user to allow for gps THIS IS NEED TO START THE REQUEST IN CONFIGLOC()
private void gpsRequest(){ new AlertDialog.Builder(this) .setTitle("Enable GPS") .setMessage("Would you like to allow location tracking?") .setPositiveButton(android.R.string.yes, new DialogInterface.OnClickListener() { @Override public void onClick(DialogInterface dialogInterface, int i) { //yes configLoc(); Toast.makeText(getApplicationContext(),"Location tracking is enabled",Toast.LENGTH_SHORT).show(); } }) .setNegativeButton(android.R.string.no, new DialogInterface.OnClickListener() { @Override public void onClick(DialogInterface dialogInterface, int i) { //no Toast.makeText(getApplicationContext(),"Location Tracking has been disabled",Toast.LENGTH_SHORT).show(); } }) .setIcon(android.R.drawable.ic_dialog_alert) .show(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private void configLoc(){\n System.out.println(\"Configuring location\");\n\n // first check for permissions\n if (ActivityCompat.checkSelfPermission(this, Manifest.permission.ACCESS_FINE_LOCATION) !=\n PackageManager.PERMISSION_GRANTED && ActivityCompat.checkSelfPermission(this,\n Manifest.permission.ACCESS_COARSE_LOCATION) != PackageManager.PERMISSION_GRANTED) {\n if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {\n requestPermissions(new String[]{Manifest.permission.ACCESS_COARSE_LOCATION,\n Manifest.permission.ACCESS_FINE_LOCATION, Manifest.permission.INTERNET}\n , 10);\n }\n return;\n }\n locationManager.requestLocationUpdates(\"gps\",5000,0,locationListener);\n }", "private void initLocation() {\n BaiduLocationHolder.OPTION.setLocationMode(LocationClientOption.LocationMode.Hight_Accuracy);\n //可选,默认高精度,设置定位模式,高精度,低功耗,仅设备\n\n BaiduLocationHolder.OPTION.setCoorType(\"bd09ll\");\n //可选,默认gcj02,设置返回的定位结果坐标系\n\n int span = 1000;\n BaiduLocationHolder.OPTION.setScanSpan(span);\n //可选,默认0,即仅定位一次,设置发起定位请求的间隔需要大于等于1000ms才是有效的\n\n BaiduLocationHolder.OPTION.setIsNeedAddress(true);\n //可选,设置是否需要地址信息,默认不需要\n\n BaiduLocationHolder.OPTION.setOpenGps(true);\n //可选,默认false,设置是否使用gps\n\n BaiduLocationHolder.OPTION.setLocationNotify(true);\n //可选,默认false,设置是否当GPS有效时按照1S/1次频率输出GPS结果\n\n BaiduLocationHolder.OPTION.setIsNeedLocationDescribe(true);\n //可选,默认false,设置是否需要位置语义化结果,可以在BDLocation.getLocationDescribe里得到,结果类似于“在北京天安门附近”\n\n BaiduLocationHolder.OPTION.setIsNeedLocationPoiList(true);\n //可选,默认false,设置是否需要POI结果,可以在BDLocation.getPoiList里得到\n\n BaiduLocationHolder.OPTION.setIgnoreKillProcess(false);\n //可选,默认true,定位SDK内部是一个SERVICE,并放到了独立进程,设置是否在stop的时候杀死这个进程,默认不杀死\n\n BaiduLocationHolder.OPTION.SetIgnoreCacheException(false);\n //可选,默认false,设置是否收集CRASH信息,默认收集\n\n BaiduLocationHolder.OPTION.setEnableSimulateGps(false);\n //可选,默认false,设置是否需要过滤GPS仿真结果,默认需要\n\n// BaiduLocationHolder.OPTION.setWifiValidTime(5*60*1000);\n //可选,7.2版本新增能力,如果您设置了这个接口,首次启动定位时,会先判断当前WiFi是否超出有效期,超出有效期的话,会先重新扫描WiFi,然后再定位\n\n BaiduLocationHolder.CLIENT.setLocOption(BaiduLocationHolder.OPTION);\n }", "@SuppressLint(\"MissingPermission\")\n private void configureLocation() {\n\n locationManager.requestLocationUpdates(LocationManager.NETWORK_PROVIDER, 1000, 1, (android.location.LocationListener) locationListener);\n location = locationManager.getLastKnownLocation(LocationManager.NETWORK_PROVIDER);\n Toast.makeText(getApplicationContext(), \"net acquired\", Toast.LENGTH_LONG).show();\n }", "private void registerForGPS() {\n Log.d(NAMAZ_LOG_TAG, \"registerForGPS:\");\n Criteria criteria = new Criteria();\n criteria.setAccuracy(Criteria.ACCURACY_COARSE);\n criteria.setPowerRequirement(Criteria.POWER_LOW);\n criteria.setAltitudeRequired(false);\n criteria.setBearingRequired(false);\n criteria.setSpeedRequired(false);\n criteria.setCostAllowed(true);\n LocationManager locationManager = ((LocationManager) getSystemService(Context.LOCATION_SERVICE));\n String provider = locationManager.getBestProvider(criteria, true);\n\n if(!isLocationEnabled()) {\n showDialog(\"Location Access\", getResources().getString(R.string.location_enable), \"Enable Location\", \"Cancel\", 1);\n } else {\n ActivityCompat.requestPermissions(QiblaDirectionActivity.this,\n new String[]{Manifest.permission. ACCESS_FINE_LOCATION},\n MY_PERMISSIONS_REQUEST_LOCATION);\n }\n\n /* if (provider != null) {\n locationManager.requestLocationUpdates(provider, MIN_LOCATION_TIME,\n MIN_LOCATION_DISTANCE, qiblaManager);\n }\n locationManager.requestLocationUpdates(LocationManager.GPS_PROVIDER,\n MIN_LOCATION_TIME, MIN_LOCATION_DISTANCE, qiblaManager);\n locationManager.requestLocationUpdates(\n LocationManager.NETWORK_PROVIDER, MIN_LOCATION_TIME,\n MIN_LOCATION_DISTANCE, qiblaManager);*/\n /*Location location = locationManager\n .getLastKnownLocation(LocationManager.GPS_PROVIDER);\n if (location == null) {\n location = ((LocationManager) getSystemService(Context.LOCATION_SERVICE))\n .getLastKnownLocation(LocationManager.GPS_PROVIDER);\n }*/\n\n }", "private void reqquestGps() {\n builder = new LocationSettingsRequest.Builder();//mang di request\n builder.addLocationRequest(locationRequest);\n SettingsClient settingsClient = LocationServices.getSettingsClient(context);//dang tao 1 requet vao may va lasy ra thong so\n\n Task<LocationSettingsResponse> task = settingsClient.checkLocationSettings(builder.build());//day la lenh cua thu vien\n\n task.addOnFailureListener(new OnFailureListener() {//lang nghe su kien bi fai kho k lay dc gps,boi nnhieu nhie nghuyen nhan 1 co the la chua bat,\n @Override\n public void onFailure(@NonNull Exception e) {//requye\n if (e instanceof ResolvableApiException) {//chua bat\n ResolvableApiException resolvableApiException = (ResolvableApiException) e;//bat man hinh hien thi bat gps\n ((MainActivity) context).requestOpenGps(resolvableApiException);\n }\n }\n });\n }", "public void getLocationInfo() {\n startLocationService();\n }", "protected void startLocationUpdates()\n {\n try\n {\n if (googleApiClient.isConnected())\n {\n LocationServices.FusedLocationApi.requestLocationUpdates(googleApiClient, locationRequest, this);\n isRequestingLocationUpdates = true;\n }\n }\n catch (SecurityException e)\n {\n Toast.makeText(getContext(), \"Unable to get your current location!\" +\n \" Please enable the location permission in Settings > Apps \" +\n \"> Bengaluru Buses.\", Toast.LENGTH_LONG).show();\n }\n }", "private void getlocation() {\n\t\t\t\ttry {\n\n\t\t\t\t\tgps = new GPSTracker(RegisterActivity.this);\n\t\t\t\t\tLog.d(\"LOgggg\", \"inCurrentlocation\");\n\n\t\t\t\t\t// check if GPS enabled\n\t\t\t\t\tif (gps.canGetLocation()) {\n\n\t\t\t\t\t\tlatitude = gps.getLatitude();\n\t\t\t\t\t\tlongitude = gps.getLongitude();\n\n\t\t\t\t\t\tLog.i(\"latitude\", \"\" + latitude);\n\t\t\t\t\t\tLog.i(\"longitude\", \"\" + longitude);\n\n\t\t\t\t\t\tnew getLoc().execute(\"\");\n\n\t\t\t\t\t} else {\n\t\t\t\t\t\tgps.showSettingsAlert();\n\t\t\t\t\t}\n\t\t\t\t} catch (Exception e) {\n\t\t\t\t\t// TODO Auto-generated catch block\n\t\t\t\t\te.printStackTrace();\n\t\t\t\t}\n\t\t\t}", "private void configMyLocation() {\n try {\n if (ActivityCompat.checkSelfPermission(this, Manifest.permission.ACCESS_FINE_LOCATION) != PackageManager.PERMISSION_GRANTED && ActivityCompat.checkSelfPermission(this, Manifest.permission.ACCESS_COARSE_LOCATION) != PackageManager.PERMISSION_GRANTED) {\n // TODO: Consider calling\n // ActivityCompat#requestPermissions\n // here to request the missing permissions, and then overriding\n // public void onRequestPermissionsResult(int requestCode, String[] permissions,\n // int[] grantResults)\n // to handle the case where the user grants the permission. See the documentation\n // for ActivityCompat#requestPermissions for more details.\n return;\n }\n\n FusedLocationProviderClient locationProviderClient = LocationServices.getFusedLocationProviderClient(this);\n\n locationProviderClient.getLastLocation().addOnCompleteListener(new OnCompleteListener<Location>() {\n @Override\n public void onComplete(@NonNull Task<Location> task) {\n Location location = task.getResult();\n LatLng sd = new LatLng(location.getLatitude(), location.getLongitude());\n\n mMap.addMarker(new MarkerOptions().position(sd).title(\"you are here\").icon(BitmapDescriptorFactory.defaultMarker()));\n mMap.moveCamera(CameraUpdateFactory.newLatLng(sd));\n mMap.moveCamera(CameraUpdateFactory.newLatLngZoom(sd, MAP_ZOOM));\n\n model.setLongitude(location.getLatitude());\n model.setLatitude(location.getLongitude());\n }\n });\n }catch (Exception ex){\n Constant.showMessage(\"Exception\", ex.getMessage(), this);\n }\n }", "private void StartLocationUpdates() {\n mLocationRequest = new LocationRequest();\n mLocationRequest.setPriority(LocationRequest.PRIORITY_BALANCED_POWER_ACCURACY);\n mLocationRequest.setInterval(UPDATE_INTERVAL);\n mLocationRequest.setFastestInterval(FASTEST_INTERVAL);\n\n // Create LocationSettings object using location request\n LocationSettingsRequest.Builder builder = new LocationSettingsRequest.Builder();\n builder.addLocationRequest(mLocationRequest);\n LocationSettingsRequest locationSettingsRequest = builder.build();\n\n // Checks if location settings are OK\n SettingsClient settingsClient = LocationServices.getSettingsClient(context);\n settingsClient.checkLocationSettings(locationSettingsRequest);\n\n if (ActivityCompat.checkSelfPermission(context, Manifest.permission.ACCESS_FINE_LOCATION)\n != PackageManager.PERMISSION_GRANTED && ActivityCompat.checkSelfPermission\n (context, Manifest.permission.ACCESS_COARSE_LOCATION) != PackageManager.PERMISSION_GRANTED) {\n\n return;\n }else {\n getFusedLocationProviderClient(context).requestLocationUpdates(mLocationRequest, new LocationCallback() {\n @Override\n public void onLocationResult(LocationResult locationResult) {\n onLocationChanged(locationResult.getLastLocation());\n// getLastLocation();\n }\n },\n Looper.myLooper());\n }\n\n }", "protected void startLocationUpdates() {\n mLocationRequest = new LocationRequest();\n mLocationRequest.setPriority(LocationRequest.PRIORITY_HIGH_ACCURACY);\n mLocationRequest.setInterval(UPDATE_INTERVAL);\n //mLocationRequest.setFastestInterval(FASTEST_INTERVAL);\n\n // Create LocationSettingsRequest object using location request\n LocationSettingsRequest.Builder builder = new LocationSettingsRequest.Builder();\n builder.addLocationRequest(mLocationRequest);\n LocationSettingsRequest locationSettingsRequest = builder.build();\n\n // Check whether location settings are satisfied\n // https://developers.google.com/android/reference/com/google/android/gms/location/SettingsClient\n SettingsClient settingsClient = LocationServices.getSettingsClient(this);\n settingsClient.checkLocationSettings(locationSettingsRequest);\n\n // new Google API SDK v11 uses getFusedLocationProviderClient(this)\n try{\n getFusedLocationProviderClient(this).requestLocationUpdates(mLocationRequest, new LocationCallback() {\n @Override\n public void onLocationResult(LocationResult locationResult) {\n onLocationChanged(locationResult.getLastLocation(),false);\n }\n },\n Looper.myLooper());\n }\n catch(SecurityException e){\n e.printStackTrace();\n }\n\n }", "private void getLocation() {\n if (ActivityCompat.checkSelfPermission(getActivity(), Manifest.permission.ACCESS_FINE_LOCATION)\n != PackageManager.PERMISSION_GRANTED && ActivityCompat.checkSelfPermission(getActivity(), Manifest.permission.ACCESS_COARSE_LOCATION) != PackageManager.PERMISSION_GRANTED) {\n if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {\n requestPermissions(new String[]{Manifest.permission.ACCESS_COARSE_LOCATION, Manifest.permission.ACCESS_FINE_LOCATION, Manifest.permission.INTERNET}\n , 10);\n }\n return;\n }\n\n //Update location\n locationManager.requestLocationUpdates(\"gps\", 5000, 0, listener);\n }", "public Location myLocation() {\n\n // Acquire a reference to the system Location Manager\n LocationManager locationManager = (LocationManager) this.getSystemService(Context.LOCATION_SERVICE);\n Criteria criteria = new Criteria();\n criteria.setHorizontalAccuracy(Criteria.ACCURACY_FINE);\n String provider = locationManager.getBestProvider(criteria, true);\n // Define a listener that responds to location updates\n LocationListener locationListener = new LocationListener() {\n\n //When the location of the device changes\n public void onLocationChanged(Location location) {\n\n //Display the current location\n double latitude = location.getLatitude();\n double longitude = location.getLongitude();\n MapProjection mapProjection = MapProjection.getDefault();\n GridPoint gp = mapProjection.toGridPoint(latitude,longitude);\n mGPSon.setText(\"Latitude: \"+Math.round(gp.x)+\"\\nLongitude: \"+Math.round(gp.y));\n\n }\n\n //When the status of the GNSS receiver changes\n public void onStatusChanged(String provider, int status, Bundle extras) {\n\n\n\n }\n\n //When the location provider is enabled\n public void onProviderEnabled(String provider) {\n\n\n\n }\n\n //When the location provider is disabled\n public void onProviderDisabled(String provider) {\n\n\n\n }\n\n };\n // Register the listener with the Location Manager to receive location updates\n locationManager.requestLocationUpdates(LocationManager.GPS_PROVIDER,0,0,locationListener);\n // Obtain the current location\n Location myLocation = locationManager.getLastKnownLocation(provider);\n\n //Only if the current location is passed\n if (myLocation != null) {\n\n //Project the Location object to a GridPoint object\n double latitude = myLocation.getLatitude();\n double longitude = myLocation.getLongitude();\n MapProjection mapProjection = MapProjection.getDefault();\n GridPoint gp = mapProjection.toGridPoint(latitude, longitude);\n //Update the real-time latitude and longitude\n mGPSon.setText(\"Latitude: \" + Math.round(gp.x) + \"\\nLongitude: \" + Math.round(gp.y));\n return myLocation;\n\n } else {\n\n //If GPS is off, notify the user to turn it on\n Toast.makeText(MainActivity.this,\"Turn on GPS.\",Toast.LENGTH_SHORT).show();\n return null;\n\n }\n\n }", "private void getLocation() {\n //if you don't have permission for location services yet, ask\n if (ActivityCompat.checkSelfPermission(this,\n Manifest.permission.ACCESS_FINE_LOCATION)\n != PackageManager.PERMISSION_GRANTED) {\n ActivityCompat.requestPermissions(this, new String[]\n {Manifest.permission.ACCESS_FINE_LOCATION},\n REQUEST_LOCATION_PERMISSION);\n //have the app ask for location permission\n } else {\n fusedLocationClient.requestLocationUpdates\n (getLocationRequest(), mLocationCallback,\n null /* Looper */);\n //uses the type of request and the location callback to update the location\n /**fusedLocationClient.getLastLocation().addOnSuccessListener(\n new OnSuccessListener<Location>() {\n @Override\n public void onSuccess(Location location) {\n TextView error = findViewById(R.id.errorMsg);\n error.setVisibility(View.VISIBLE);\n\n if (location != null) {\n lastLocation = location;\n error.setText(\"location: \" + lastLocation.getLatitude());\n } else {\n error.setText(\"location not available\");\n }\n }\n });**/\n }\n }", "private void getUserCurrentLocation()\n\t {\n\t NicerLocationManager locationMgr = new NicerLocationManager(this.getApplicationContext());\n\t if (locationMgr.isAnyLocationServicesAvailble())\n\t {\n\t Log.i(\"MAIN\",\"retrieving current location...\");\n\n\t // get current location\n\t locationMgr.getBestGuessLocation(1000,\n\t new NicerLocationListener() {\n\n\t @Override\n\t public void locationLoaded(final Location location)\n\t {\n\t // parse the current site forecast for users current\n\t // location in the background\n\t //LocationForecastSetup currentForecast = new LocationForecastSetup();\n\t //currentForecast.execute(location);\n\n\t // QLog.i(\"location loaded. finding nearest location...\");\n\t //\n\t // // find nearest weather location\n\t // Site nearestLocation =\n\t // Utils.findNearestSite(mApp, location);\n\t //\n\t // // insert the new current user location site\n\t // SitesProviderHelper.addSavedSite(mApp,\n\t // Long.valueOf(nearestLocation.getmSiteId()), true);\n\t //\n\t Log.i(\"MAIN\",\"location found \"+location.getLatitude()+\" \"+location.getLongitude());\n\t dS.lat=(float) location.getLatitude();\n\t dS.lon=(float) location.getLongitude();\n\t //TextView versionText = (TextView) findViewById(R.id.info_area_string);\n\t //versionText.setText(\"lat \" + location.getLatitude()+\" lon \"+location.getLongitude());\n\t \n\t //\n\t // /*\n\t // * add blank site if user has no saved sites. a blank site\n\t // * forecast is also added in the WeatherService class\n\t // * (runWeatherService method) to display correctly in the\n\t // * view pager.this is later removed when a user adds a\n\t // site\n\t // * and added again when user removes last site.\n\t // */\n\t // SitesProviderHelper.addBlankSavedSite(mApp);\n\t //\n\t // // re-order sites so current location is first\n\t // SitesProviderHelper.setSiteOrder(mApp,\n\t // nearestLocation.getmSiteId(), \"0\");\n\t // SitesProviderHelper.setSiteOrder(mApp,\n\t // Consts.BLANK_SITE_ID, \"1\");\n\n\t }\n\n\t @Override\n\t public void error()\n\t {\n\t // give option to change location settings or select a\n\t // location manually\n\t Log.e(\"MAIN\",\"Error finding best guess location\");\n dS.lat=0;\n dS.lon=0;\n if(once)\n {\n\t //promptSetLocationService(MainActivity.this);\n }\n once=false;\n\t }\n\n\t @Override\n\t public void onFinished()\n\t {\n\t //runUpdateService(false, false);\n\t \tLog.i(\"MAIN\",\"onFinished\");\n\t }\n\t });\n\n\t }\n\t else\n\t {\n\t \n\t \tdS.lat=0;\n dS.lon=0;\n\t \n\t }\n\n\t }", "private void getLocation() {\n LocationRequest mLocationRequestHighAccuracy = new LocationRequest();\n mLocationRequestHighAccuracy.setPriority(LocationRequest.PRIORITY_HIGH_ACCURACY);\n mLocationRequestHighAccuracy.setInterval(UPDATE_INTERVAL);\n mLocationRequestHighAccuracy.setFastestInterval(FASTEST_INTERVAL);\n\n\n // new Google API SDK v11 uses getFusedLocationProviderClient(this)\n if (ActivityCompat.checkSelfPermission(this,\n Manifest.permission.ACCESS_FINE_LOCATION) != PackageManager.PERMISSION_GRANTED) {\n Log.d(TAG, \"getLocation: stopping the location service.\");\n stopSelf();\n return;\n }\n Log.d(TAG, \"getLocation: getting location information.\");\n mFusedLocationClient.requestLocationUpdates(mLocationRequestHighAccuracy, new LocationCallback() {\n @Override\n public void onLocationResult(LocationResult locationResult) {\n Log.d(TAG, \"onLocationResult: got location result.\");\n Location location = locationResult.getLastLocation();\n if (location != null) {\n GeoPoint geoPoint = new GeoPoint(location.getLatitude(), location.getLongitude());\n userInfoDoc.get().addOnCompleteListener(task -> {\n Boolean av = (Boolean) task.getResult().get(\"Availability\");\n saveUserLocation(geoPoint , av);\n });\n saveDistance(geoPoint);\n\n }\n }\n },\n Looper.myLooper()); // Looper.myLooper tells this to repeat forever until thread is destroyed\n }", "protected void getLocation() {\n if (isLocationEnabled(Navigate.this)) {\n locationManager = (LocationManager) this.getSystemService(Context.LOCATION_SERVICE);\n criteria = new Criteria();\n bestProvider = String.valueOf(locationManager.getBestProvider(criteria, true)).toString();\n\n //You can still do this if you like, you might get lucky:\n if (ActivityCompat.checkSelfPermission(this, Manifest.permission.ACCESS_FINE_LOCATION) != PackageManager.PERMISSION_GRANTED && ActivityCompat.checkSelfPermission(this, Manifest.permission.ACCESS_COARSE_LOCATION) != PackageManager.PERMISSION_GRANTED) {\n // TODO: Consider calling\n // ActivityCompat#requestPermissions\n // here to request the missing permissions, and then overriding\n // public void onRequestPermissionsResult(int requestCode, String[] permissions,\n // int[] grantResults)\n // to handle the case where the user grants the permission. See the documentation\n // for ActivityCompat#requestPermissions for more details.\n return;\n }\n Location location = locationManager.getLastKnownLocation(bestProvider);\n if (location != null) {\n Log.e(\"TAG\", \"GPS is on\");\n latitude = location.getLatitude();\n longitude = location.getLongitude();\n } else {\n //This is what you need:\n locationManager.requestLocationUpdates(bestProvider, 1000, 0, this);\n }\n } else {\n// final AlertDialog.Builder builder = new AlertDialog.Builder(this);\n// builder.setMessage(\"Your GPS seems to be disabled, do you want to enable it?\")\n// .setCancelable(false)\n// .setPositiveButton(\"Yes\", new DialogInterface.OnClickListener() {\n// public void onClick(final DialogInterface dialog, final int id) {\n// startActivity(new Intent(android.provider.Settings.ACTION_LOCATION_SOURCE_SETTINGS));\n// }\n// })\n// .setNegativeButton(\"No\", new DialogInterface.OnClickListener() {\n// public void onClick(final DialogInterface dialog, final int id) {\n// dialog.cancel();\n// }\n// });\n// final AlertDialog alert = builder.create();\n// alert.show();\n }\n }", "private void initLocation() {\n\t\tlocationManager = (LocationManager) this\n\t\t\t\t.getSystemService(Context.LOCATION_SERVICE);\n\t\t// Define a listener that responds to location updates\n\t\tnetworkLocListener = new MyLocationListener();\n\t\tgpsLocListener = new MyLocationListener();\n\n\t\tlocationProvider2 = LocationManager.NETWORK_PROVIDER;\n\t\tlocationProvider1 = LocationManager.GPS_PROVIDER;\n\n\t\tgps_enabled = false;\n\t\tnetwork_enabled = false;\n\t\t// exceptions will be thrown if provider is not permitted.\n\n\t\t// try{gps_enabled=mlocManager.isProviderEnabled(LocationManager.GPS_PROVIDER);}catch(Exception\n\t\t// ex){}\n\t\tgps_enabled = locationManager\n\t\t\t\t.isProviderEnabled(LocationManager.GPS_PROVIDER);\n\t\t// try{network_enabled=mlocManager.isProviderEnabled(LocationManager.NETWORK_PROVIDER);}catch(Exception\n\t\t// ex){}\n\t\tnetwork_enabled = locationManager\n\t\t\t\t.isProviderEnabled(LocationManager.NETWORK_PROVIDER);\n\n\t\t// don't start listeners if no provider is enabled\n\t\tif (!gps_enabled && !network_enabled) {\n\t\t\tToast.makeText(getApplicationContext(),\n\t\t\t\t\t\"Either network or GPS not enabled, please check\",\n\t\t\t\t\tToast.LENGTH_LONG).show();\n\t\t\t/*\n\t\t\t * Intent gpsOptionsIntent = new\n\t\t\t * Intent(android.provider.Settings.ACTION_LOCATION_SOURCE_SETTINGS\n\t\t\t * ); startActivity(gpsOptionsIntent);\n\t\t\t */\n\t\t}\n\n\t\t// Define a listener that responds to location updates\n\t\t// LocationListener locationListener = new LocationListener() {\n\t\t// @Override\n\t\t// public void onLocationChanged(Location location) {\n\t\t// // Called when a new location is found by the network location\n\t\t// // provider.\n\t\t// if (D)\n\t\t// Log.i(TAG, \"Updating current location\");\n\t\t// Toast.makeText(getApplicationContext(),\n\t\t// \"Updating current location\", Toast.LENGTH_LONG).show();\n\t\t// }\n\t\t//\n\t\t// public void onStatusChanged(String provider, int status,\n\t\t// Bundle extras) {\n\t\t// if (D)\n\t\t// Log.i(TAG, \"status changed\");\n\t\t// }\n\t\t//\n\t\t// public void onProviderEnabled(String provider) {\n\t\t// if (D)\n\t\t// Log.i(TAG, \"location enabled\");\n\t\t// }\n\t\t//\n\t\t// public void onProviderDisabled(String provider) {\n\t\t// if (D)\n\t\t// Log.i(TAG, \"Location disabled\");\n\t\t// }\n\t\t// };\n\n\t\tif (network_enabled) {\n\t\t\tlocationManager.requestLocationUpdates(\n\t\t\t\t\tLocationManager.NETWORK_PROVIDER, 1, 1, networkLocListener);\n\t\t}\n\t\tif (gps_enabled) {\n\t\t\tlocationManager.requestLocationUpdates(\n\t\t\t\t\tLocationManager.GPS_PROVIDER, 1, 1, gpsLocListener);\n\t\t}\n\t}", "@SuppressLint(\"MissingPermission\")\n private void requestLocationUpdate() {\n }", "protected void startLocationUpdates() {\n mLocationRequest = LocationRequest.create()\n .setPriority(LocationRequest.PRIORITY_BALANCED_POWER_ACCURACY)\n .setInterval(1000000)\n .setFastestInterval(1000000);\n // Request location updates\n if (ActivityCompat.checkSelfPermission(this, android.Manifest.permission.ACCESS_COARSE_LOCATION) == PackageManager.PERMISSION_GRANTED) {\n LocationServices.FusedLocationApi.requestLocationUpdates(mGoogleApiClient, mLocationRequest, new LocationListener() {\n @Override\n public void onLocationChanged(Location location) {\n mLastLocation = location;\n }\n });\n }\n\n }", "@SuppressLint(\"MissingPermission\")\n private void requestNewLocationData() {\n LocationRequest mLocationRequest = new LocationRequest();\n mLocationRequest.setPriority(LocationRequest.PRIORITY_HIGH_ACCURACY);\n mLocationRequest.setInterval(5);\n mLocationRequest.setFastestInterval(0);\n mLocationRequest.setNumUpdates(1);\n\n // setting LocationRequest\n // on FusedLocationClient\n FusedLocationProviderClient mFusedLocationClient = LocationServices.getFusedLocationProviderClient(this);\n mFusedLocationClient.requestLocationUpdates(mLocationRequest, mLocationCallback, Looper.myLooper());\n }", "@SuppressLint(\"MissingPermission\")\n private void requestNewLocationData() {\n LocationRequest mLocationRequest = new LocationRequest();\n mLocationRequest.setPriority(LocationRequest.PRIORITY_HIGH_ACCURACY);\n mLocationRequest.setInterval(5);\n mLocationRequest.setFastestInterval(0);\n mLocationRequest.setNumUpdates(1);\n\n // setting LocationRequest\n // on FusedLocationClient\n mFusedLocationClient = LocationServices.getFusedLocationProviderClient(this);\n mFusedLocationClient.requestLocationUpdates(mLocationRequest, mLocationCallback, Looper.myLooper());\n }", "@SuppressLint(\"MissingPermission\")\n private void requestNewLocationData() {\n LocationRequest mLocationRequest = new LocationRequest();\n mLocationRequest.setPriority(LocationRequest.PRIORITY_HIGH_ACCURACY);\n mLocationRequest.setInterval(5);\n mLocationRequest.setFastestInterval(0);\n mLocationRequest.setNumUpdates(1);\n\n // setting LocationRequest\n // on FusedLocationClient\n mFusedLocationClient = LocationServices.getFusedLocationProviderClient(this);\n mFusedLocationClient.requestLocationUpdates(mLocationRequest, mLocationCallback, Looper.myLooper());\n }", "private void enableLoc() {\r\n if (googleApiClient == null) {\r\n googleApiClient = new GoogleApiClient.Builder(this)\r\n .addApi(LocationServices.API)\r\n .addConnectionCallbacks(new GoogleApiClient.ConnectionCallbacks() {\r\n @Override\r\n public void onConnected(Bundle bundle) {\r\n\r\n }\r\n\r\n @Override\r\n public void onConnectionSuspended(int i) {\r\n googleApiClient.connect();\r\n }\r\n })\r\n .addOnConnectionFailedListener(new GoogleApiClient.OnConnectionFailedListener() {\r\n @Override\r\n public void onConnectionFailed(ConnectionResult connectionResult) {\r\n\r\n Log.d(\"Location error\", \"Location error \" + connectionResult.getErrorCode());\r\n }\r\n }).build();\r\n googleApiClient.connect();\r\n\r\n LocationRequest locationRequest = LocationRequest.create();\r\n locationRequest.setPriority(LocationRequest.PRIORITY_HIGH_ACCURACY);\r\n locationRequest.setInterval(30 * 1000);\r\n locationRequest.setFastestInterval(5 * 1000);\r\n LocationSettingsRequest.Builder builder = new LocationSettingsRequest.Builder()\r\n .addLocationRequest(locationRequest);\r\n\r\n builder.setAlwaysShow(true);\r\n\r\n PendingResult<LocationSettingsResult> result =\r\n LocationServices.SettingsApi.checkLocationSettings(googleApiClient, builder.build());\r\n result.setResultCallback(new ResultCallback<LocationSettingsResult>() {\r\n @Override\r\n public void onResult(LocationSettingsResult result) {\r\n final Status status = result.getStatus();\r\n switch (status.getStatusCode()) {\r\n case LocationSettingsStatusCodes.RESOLUTION_REQUIRED:\r\n try {\r\n Show the dialog by calling startResolutionForResult(),\r\n and check the result in onActivityResult().\r\n status.startResolutionForResult(Newmaps.this, REQUEST_LOCATION);\r\n } catch (IntentSender.SendIntentException e) {\r\n // Ignore the error.\r\n }\r\n break;\r\n }\r\n }\r\n });\r\n }\r\n\r\n }", "protected void createLocationRequest()\n {\n errorLinearLayout.setVisibility(View.GONE);\n swipeRefreshLayout.setRefreshing(true);\n final int REQUEST_CHECK_SETTINGS = 0x1;\n locationRequest = new LocationRequest();\n locationRequest.setInterval(5000);\n locationRequest.setFastestInterval(3000);\n locationRequest.setPriority(LocationRequest.PRIORITY_HIGH_ACCURACY);\n LocationSettingsRequest.Builder builder = new LocationSettingsRequest.Builder().addLocationRequest(locationRequest);\n PendingResult<LocationSettingsResult> result = LocationServices.SettingsApi.checkLocationSettings(googleApiClient, builder.build());\n\n result.setResultCallback(new ResultCallback<LocationSettingsResult>()\n {\n @Override\n public void onResult(@NonNull LocationSettingsResult result)\n {\n final Status status = result.getStatus();\n switch (status.getStatusCode())\n {\n case LocationSettingsStatusCodes.SUCCESS:\n if (!isRequestingLocationUpdates)\n {\n int permissionCheck = ContextCompat.checkSelfPermission(getActivity(), Manifest.permission.ACCESS_FINE_LOCATION);\n if (permissionCheck == PackageManager.PERMISSION_GRANTED)\n {\n startLocationUpdates();\n }\n else\n {\n requestPermissions(new String[]{Manifest.permission.ACCESS_FINE_LOCATION}, LOCATION_PERMISSION_REQUEST_CODE);\n }\n }\n break;\n case LocationSettingsStatusCodes.RESOLUTION_REQUIRED:\n\n int permissionCheck = ContextCompat.checkSelfPermission(getActivity(), Manifest.permission.ACCESS_FINE_LOCATION);\n if (permissionCheck == PackageManager.PERMISSION_GRANTED)\n {\n if (locationManager.isProviderEnabled(LocationManager.GPS_PROVIDER))\n {\n if (!isRequestingLocationUpdates)\n {\n startLocationUpdates();\n }\n }\n else\n {\n try\n {\n status.startResolutionForResult(getActivity(), REQUEST_CHECK_SETTINGS);\n }\n catch (IntentSender.SendIntentException e)\n {\n Toast.makeText(getActivity(), \"Failed to enable location services! Please try again later...\", Toast.LENGTH_SHORT).show();\n }\n }\n }\n else\n {\n requestPermissions(new String[]{Manifest.permission.ACCESS_FINE_LOCATION}, LOCATION_PERMISSION_REQUEST_CODE);\n }\n break;\n case LocationSettingsStatusCodes.SETTINGS_CHANGE_UNAVAILABLE:\n Toast.makeText(getActivity(), \"Device doesn't have a GPS! Can't locate bus stops nearby...\", Toast.LENGTH_LONG).show();\n break;\n }\n }\n });\n }", "public void requestLocation() {\n if (ActivityCompat.checkSelfPermission(this, Manifest.permission.ACCESS_FINE_LOCATION) != PackageManager.PERMISSION_GRANTED\n && ActivityCompat.checkSelfPermission(this, Manifest.permission.ACCESS_COARSE_LOCATION) !=\n PackageManager.PERMISSION_GRANTED) {\n if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {\n requestPermissions(new String[]{Manifest.permission.ACCESS_FINE_LOCATION, Manifest.permission.ACCESS_COARSE_LOCATION,\n Manifest.permission.INTERNET}, 12);\n }\n return;\n }\n //this line updates location\n mMap.setMyLocationEnabled(true);\n providerClient.requestLocationUpdates(locationRequest, locationCallback, getMainLooper());\n }", "private void startTrackingRoute(){\n if(ContextCompat.checkSelfPermission(this, ACCESS_FINE_LOCATION) != PackageManager.PERMISSION_GRANTED){\n //Starts up alert dialog for getting permission\n ActivityCompat.requestPermissions(this, new String[]{Manifest.permission.ACCESS_FINE_LOCATION}, REQUEST_LOC_PERMISSION);\n }\n else{\n //Start the location updater listener\n locationManager.requestLocationUpdates(LocationManager.GPS_PROVIDER, 0, MIN_DISTANCE, this);\n }\n }", "private void startLocationUpdates() {\r\n // Begin by checking if the device has the necessary location settings.\r\n mSettingsClient.checkLocationSettings(mLocationSettingsRequest)\r\n .addOnSuccessListener(this, new OnSuccessListener<LocationSettingsResponse>() {\r\n @Override\r\n public void onSuccess(LocationSettingsResponse locationSettingsResponse) {\r\n Log.i(TAG, \"All location settings are satisfied.\");\r\n\r\n if(checkPermissions()){\r\n // Launch background service - Monitor location\r\n Log.i(TAG, \"trying to start location service..\");\r\n startService(new Intent(MainActivity.this, LocationService.class));\r\n\r\n // Launch background service - Geofence\r\n if(localUser.isGeofenceEnabled()){\r\n Log.i(TAG, \"trying to start geofence service..\");\r\n startService(new Intent(MainActivity.this, GeofenceService.class));\r\n }\r\n } else{\r\n requestPermissions();\r\n }\r\n\r\n\r\n\r\n }\r\n })\r\n .addOnFailureListener(this, new OnFailureListener() {\r\n @Override\r\n public void onFailure(@NonNull Exception e) {\r\n int statusCode = ((ApiException) e).getStatusCode();\r\n switch (statusCode) {\r\n case LocationSettingsStatusCodes.RESOLUTION_REQUIRED:\r\n Log.i(TAG, \"Location settings are not satisfied. Attempting to upgrade \" +\r\n \"location settings \");\r\n try {\r\n // Show the dialog by calling startResolutionForResult(), and check the\r\n // result in onActivityResult().\r\n ResolvableApiException rae = (ResolvableApiException) e;\r\n rae.startResolutionForResult(MainActivity.this, REQUEST_CHECK_SETTINGS);\r\n } catch (IntentSender.SendIntentException sie) {\r\n Log.i(TAG, \"PendingIntent unable to execute request.\");\r\n }\r\n break;\r\n case LocationSettingsStatusCodes.SETTINGS_CHANGE_UNAVAILABLE:\r\n String errorMessage = \"Location settings are inadequate, and cannot be \" +\r\n \"fixed here. Fix in Settings.\";\r\n Log.e(TAG, errorMessage);\r\n Toast.makeText(MainActivity.this, errorMessage, Toast.LENGTH_LONG).show();\r\n mRequestingLocationUpdates = false;\r\n }\r\n\r\n }\r\n });\r\n }", "public void startLocationUpdates(){\n // High accuracy should use GPS to get the location\n locationRequest = new LocationRequest();\n locationRequest.setInterval(2000);\n locationRequest.setFastestInterval(1000);\n locationRequest.setSmallestDisplacement(1);\n locationRequest.setPriority(LocationRequest.PRIORITY_HIGH_ACCURACY);\n\n if(ActivityCompat.checkSelfPermission(this, Manifest.permission.ACCESS_FINE_LOCATION) != PackageManager.PERMISSION_GRANTED &&\n ActivityCompat.checkSelfPermission(this, Manifest.permission.ACCESS_COARSE_LOCATION) != PackageManager.PERMISSION_GRANTED){\n // The user has not given us access to get their location\n // May want to request those premissions here\n try {\n int gpsOff = Settings.Secure.getInt(getContentResolver(), Settings.Secure.LOCATION_MODE);\n // If this returns zero then GPS is off\n if(gpsOff == 0){\n Intent turnOnGPS = new Intent(Settings.ACTION_LOCATION_SOURCE_SETTINGS);\n startActivity(turnOnGPS);\n }\n }catch (Settings.SettingNotFoundException e){\n e.printStackTrace();\n }\n\n return;\n }\n\n LocationServices.FusedLocationApi.requestLocationUpdates(googleApiClient, locationRequest, this);\n }", "private void setupLocation() {\n\n if (ContextCompat.checkSelfPermission(this, Manifest.permission.ACCESS_FINE_LOCATION) != PackageManager.PERMISSION_GRANTED &&\n ContextCompat.checkSelfPermission(this, Manifest.permission.ACCESS_COARSE_LOCATION) != PackageManager.PERMISSION_GRANTED) {\n\n // Permission is not granted.\n if (ActivityCompat.shouldShowRequestPermissionRationale(this, Manifest.permission.ACCESS_FINE_LOCATION) &&\n ActivityCompat.shouldShowRequestPermissionRationale(this, Manifest.permission.ACCESS_COARSE_LOCATION)) {\n\n ActivityCompat.requestPermissions(this,\n new String[]{Manifest.permission.ACCESS_FINE_LOCATION, Manifest.permission.ACCESS_COARSE_LOCATION},\n LOCATION_PERMISSION_REQUEST);\n } else {\n // Request the permission\n ActivityCompat.requestPermissions(this,\n new String[]{Manifest.permission.ACCESS_FINE_LOCATION, Manifest.permission.ACCESS_COARSE_LOCATION},\n LOCATION_PERMISSION_REQUEST);\n }\n } else {\n // Permission has already been granted\n }\n }", "public void getCurrentLoaction() {\n locationManager = (LocationManager) getSystemService(LOCATION_SERVICE);\n locationListener = new LocationListener() {\n @Override\n public void onLocationChanged(Location location) {\n latitude = \"\" + location.getLatitude();\n TextView txtLatitude = (TextView) findViewById(R.id.txtLatitude);\n txtLatitude.setText(\"Latitud: \" + latitude);\n longitude = \"\" + location.getLongitude();\n TextView txtLongitude = (TextView) findViewById(R.id.txtLongitude);\n txtLongitude.setText(\"Longitud: \" + longitude);\n\n Geocoder gcd = new Geocoder(getBaseContext(), Locale.getDefault());\n List<Address> addresses;\n try {\n addresses = gcd.getFromLocation(location.getLatitude(), location.getLongitude(), 1);\n if (addresses.size() > 0) {\n cityName = addresses.get(0).getLocality();\n }\n }\n catch (IOException e) {\n e.printStackTrace();\n }\n }\n\n @Override\n public void onStatusChanged(String s, int i, Bundle bundle) {\n\n }\n\n @Override\n public void onProviderEnabled(String s) {\n\n }\n\n @Override\n public void onProviderDisabled(String s) {\n Toast.makeText(pantallaIdentificacion.this, \"Por favor, habilite el GPS para continuar\", Toast.LENGTH_LONG).show();\n Intent intent = new Intent(Settings.ACTION_LOCATION_SOURCE_SETTINGS);\n startActivity(intent);\n }\n };\n if (ActivityCompat.checkSelfPermission(this, android.Manifest.permission.ACCESS_FINE_LOCATION) != PackageManager.PERMISSION_GRANTED && ActivityCompat.checkSelfPermission(this, android.Manifest.permission.ACCESS_COARSE_LOCATION) != PackageManager.PERMISSION_GRANTED) {\n // TODO: Consider calling\n // ActivityCompat#requestPermissions\n // here to request the missing permissions, and then overriding\n // public void onRequestPermissionsResult(int requestCode, String[] permissions,\n // int[] grantResults)\n // to handle the case where the user grants the permission. See the documentation\n // for ActivityCompat#requestPermissions for more details.\n return;\n }\n locationManager.requestLocationUpdates(\"network\", 1000, 0, locationListener);\n }", "private void _Setup_GetLocData() {\n\t\tString log_msg = \"CONS.LocData.LONGITUDE=\"\n\t\t\t\t\t+ String.valueOf(CONS.LocData.LONGITUDE);\n\n\t\tLog.d(\"[\" + \"ShowMapActv.java : \"\n\t\t\t\t+ +Thread.currentThread().getStackTrace()[2].getLineNumber()\n\t\t\t\t+ \" : \"\n\t\t\t\t+ Thread.currentThread().getStackTrace()[2].getMethodName()\n\t\t\t\t+ \"]\", log_msg);\n\t\t\n\t\tIntent i = this.getIntent();\n\t\t\n\t\tthis.longitude\t= i.getDoubleExtra(\n\t\t\t\t\t\t\tCONS.IntentData.iName_Showmap_Longitude,\n\t\t\t\t\t\t\tCONS.IntentData.Showmap_DefaultValue);\n\t\t\n\t\tthis.latitude\t= i.getDoubleExtra(\n\t\t\t\tCONS.IntentData.iName_Showmap_Latitude,\n\t\t\t\tCONS.IntentData.Showmap_DefaultValue);\n\t\t\n\t\t// Log\n\t\tlog_msg = \"this.latitude=\" + String.valueOf(this.latitude)\n\t\t\t\t\t\t+ \"/\"\n\t\t\t\t\t\t+ \"this.longitude=\" + String.valueOf(this.longitude);\n\n\t\tLog.d(\"[\" + \"ShowMapActv.java : \"\n\t\t\t\t+ +Thread.currentThread().getStackTrace()[2].getLineNumber()\n\t\t\t\t+ \" : \"\n\t\t\t\t+ Thread.currentThread().getStackTrace()[2].getMethodName()\n\t\t\t\t+ \"]\", log_msg);\n\t\t\n\t}", "private void setLocationRequest() {\n locationRequest = new LocationRequest();\n locationRequest.setInterval(10000); // how often we ask provider for location\n locationRequest.setFastestInterval(5000); // 'steal' location from other app\n locationRequest.setPriority(LocationRequest.PRIORITY_HIGH_ACCURACY); // can pick balanced power accuracy\n }", "private void initLocationData() {\n\n // init google client and request for fused location provider\n fusedLocationProviderClient = LocationServices.getFusedLocationProviderClient(context);\n\n locationRequest = new LocationRequest()\n //.setPriority(LocationRequest.PRIORITY_HIGH_ACCURACY) // GPS quality location points\n .setPriority(LocationRequest.PRIORITY_BALANCED_POWER_ACCURACY) // optimized for battery\n .setInterval(20000) // at least once every 20 seconds\n .setFastestInterval(10000); // at most once every 10 seconds\n\n locationCallback = new LocationCallback() {\n @Override\n public void onLocationResult(LocationResult locationResult) {\n\n Point userPoint;\n if (locationResult != null) {\n // update user location\n Location lastLocation = locationResult.getLastLocation();\n userPoint = new Point(lastLocation.getLatitude(), lastLocation.getLongitude());\n // cache location\n PreferencesCache.setLastLatitude(lastLocation.getLatitude());\n PreferencesCache.setLastLongitude(lastLocation.getLongitude());\n } else {\n // get cached data\n userPoint = new Point(PreferencesCache.getLastLatitude(), PreferencesCache.getLastLongitude());\n }\n\n navigator.updateUserLocation(userPoint);\n }\n };\n }", "private void locationManager()\n\t{\n mMap.setMyLocationEnabled(true);\n\n // Getting LocationManager object from System Service LOCATION_SERVICE\n LocationManager locationManager = (LocationManager) getSystemService(LOCATION_SERVICE);\n\n // Creating a criteria object to retrieve provider\n Criteria criteria = new Criteria();\n\n // Getting the name of the best provider\n String provider = locationManager.getBestProvider(criteria, true);\n\n // Getting Current Location\n Location location = locationManager.getLastKnownLocation(provider);\n\n if(location!=null){\n onLocationChanged(location);\n }\n locationManager.requestLocationUpdates(provider, 20000, 0, this);\n\t\t\n\t}", "private void locationRequests(){\n mFusedClient = LocationServices.getFusedLocationProviderClient(this);\n mLocationCallback = new LocationCallback(){\n @Override\n public void onLocationResult(LocationResult locationResult){\n List<Location> locationList = locationResult.getLocations();\n if(locationList.size() > 0){\n Location location = locationList.get(locationList.size() - 1);\n Log.i(TAG, \"Location: \" + location.getLatitude() + \" \" + location.getLongitude());\n mLatitude = String.valueOf(location.getLatitude());\n mLongitude = String.valueOf(location.getLongitude());\n }\n }\n };\n mLocationRequest = new LocationRequest();\n mLocationRequest.setInterval(UPDATE_INTERVAL_IN_MILLISECONDS);\n mLocationRequest.setFastestInterval(FASTEST_UPDATE_INTERVAL_IN_MILLISECONDS);\n mLocationRequest.setPriority(LocationRequest.PRIORITY_HIGH_ACCURACY);\n if(Build.VERSION.SDK_INT >= Build.VERSION_CODES.M){\n if(ContextCompat.checkSelfPermission(this, Manifest.permission.ACCESS_FINE_LOCATION)\n == PackageManager.PERMISSION_GRANTED) {\n mFusedClient.requestLocationUpdates(mLocationRequest, mLocationCallback, Looper.myLooper());\n } else {\n getLocation();\n }\n } else {\n mFusedClient.requestLocationUpdates(mLocationRequest, mLocationCallback, Looper.myLooper());\n }\n }", "protected void startLocationUpdates() {\n try {\n// LocationServices.FusedLocationApi.requestLocationUpdates(mGoogleApiClient, mLocationRequest, this);\n\n /* mLocationRequest = new LocationRequest();\n mLocationRequest.setInterval(6000); // two minute interval\n mLocationRequest.setFastestInterval(6000);//120000\n mLocationRequest.setPriority(LocationRequest.PRIORITY_HIGH_ACCURACY);*/\n /*if (ContextCompat.checkSelfPermission(this,\n android.Manifest.permission.ACCESS_FINE_LOCATION)\n == PackageManager.PERMISSION_GRANTED) {\n mFusedLocationClient.requestLocationUpdates(mLocationRequest, mLocationCallback, Looper.myLooper());\n }*/\n if (ActivityCompat.checkSelfPermission(this, android.Manifest.permission.ACCESS_FINE_LOCATION) != PackageManager.PERMISSION_GRANTED && ActivityCompat.checkSelfPermission(this, android.Manifest.permission.ACCESS_COARSE_LOCATION) != PackageManager.PERMISSION_GRANTED) {\n // TODO: Consider calling\n // ActivityCompat#requestPermissions\n // here to request the missing permissions, and then overriding\n // public void onRequestPermissionsResult(int requestCode, String[] permissions,\n // int[] grantResults)\n // to handle the case where the user grants the permission. See the documentation\n // for ActivityCompat#requestPermissions for more details.\n return;\n }\n// LocationServices.FusedLocationApi.requestLocationUpdates(mGoogleApiClient, mLocationRequest, (LocationListener) this);\n LocationServices.getFusedLocationProviderClient(this).requestLocationUpdates(mLocationRequest, null);\n// requestLocationUpdates(LocationManager.GPS_PROVIDER, 0, 0, locationListener);\n// requestLocationUpdates(LocationManager.NETWORK_PROVIDER, 0, 0, locationListener);\n\n } catch (Exception e) {\n // TODO: handle exception\n e.printStackTrace();\n }\n }", "private void requestLocationUpdates(){\n if(googleApiClient.isConnected()){\n try{\n setLocationRequest();\n LocationServices.FusedLocationApi.requestLocationUpdates(googleApiClient, locationRequest, this);\n } catch (SecurityException ex) {\n Log.e(TAG, \"requestLocationUpdates: no permissions\", ex);\n }\n }\n }", "private void getLocation() {\n LocationRequest mLocationRequestHighAccuracy = new LocationRequest();\n mLocationRequestHighAccuracy.setPriority(LocationRequest.PRIORITY_HIGH_ACCURACY);\n mLocationRequestHighAccuracy.setInterval(UPDATE_INTERVAL);\n mLocationRequestHighAccuracy.setFastestInterval(FASTEST_INTERVAL);\n\n\n // new Google API SDK v11 uses getFusedLocationProviderClient(this)\n if (ActivityCompat.checkSelfPermission(this,\n Manifest.permission.ACCESS_FINE_LOCATION) != PackageManager.PERMISSION_GRANTED) {\n Log.d(TAG, \"getLocation: stopping the location service.\");\n stopSelf();\n return;\n }\n Log.d(TAG, \"getLocation: getting location information.\");\n mFusedLocationClient.requestLocationUpdates(mLocationRequestHighAccuracy, new LocationCallback() {\n @Override\n public void onLocationResult(LocationResult locationResult) {\n\n Log.d(TAG, \"onLocationResult: got location result.\");\n\n Location location = locationResult.getLastLocation();\n\n if (location != null) {\n\n saveUserLocation(new LatLng(location.getLatitude(),location.getLongitude()));\n }\n }\n },\n Looper.myLooper()); // Looper.myLooper tells this to repeat forever until thread is destroyed\n }", "public Location getLocation() {\n\n try {\n\n locationManager = (LocationManager) mContext.getSystemService(LOCATION_SERVICE);\n\n isGPSEnabled = locationManager.isProviderEnabled(GPS_PROVIDER);\n isNetworkEnabled = locationManager.isProviderEnabled(NETWORK_PROVIDER);\n\n if (!isGPSEnabled && !isNetworkEnabled) {\n //Nothing is enabled...\n } else {\n canGetLocation = true;\n\n if (isNetworkEnabled) {\n if (ActivityCompat.checkSelfPermission(mContext, Manifest.permission.ACCESS_FINE_LOCATION) != PackageManager.PERMISSION_GRANTED\n && ActivityCompat.checkSelfPermission(mContext, Manifest.permission.ACCESS_COARSE_LOCATION) != PackageManager.PERMISSION_GRANTED) {\n // TODO: Consider calling\n // ActivityCompat#requestPermissions\n // here to request the missing permissions, and then overriding\n // public void onRequestPermissionsResult(int requestCode, String[] permissions,\n // int[] grantResults)\n // to handle the case where the user grants the permission. See the documentation\n // for ActivityCompat#requestPermissions for more details.\n\n Intent trackingIntent = new Intent(CustomConstants.SEND_TRACKING_MAIL);\n sendBroadcast(trackingIntent);\n\n return null;\n }\n locationManager.requestLocationUpdates(NETWORK_PROVIDER, MIN_TIME_BW_UPDATES, MIN_DISTANCE_CHANGE_FOR_UPDATES, this);\n\n if (locationManager != null) {\n location = locationManager.getLastKnownLocation(LocationManager.NETWORK_PROVIDER);\n location.setAccuracy(LOCATION_ACCURACY);\n\n if (location != null) {\n latitude = location.getLatitude();\n longitude = location.getLongitude();\n }\n }\n }\n\n if (isGPSEnabled) {\n\n if (locationManager == null) {\n\n locationManager.requestLocationUpdates(GPS_PROVIDER, MIN_TIME_BW_UPDATES, MIN_DISTANCE_CHANGE_FOR_UPDATES, this);\n location.setAccuracy(LOCATION_ACCURACY);\n if (locationManager != null) {\n location = locationManager.getLastKnownLocation(GPS_PROVIDER);\n\n if (location != null) {\n latitude = location.getLatitude();\n longitude = location.getLongitude();\n }\n }\n }\n }\n }\n } catch (Exception e) {\n e.printStackTrace();\n }\n\n return location;\n }", "private void getCurrentLocation() {\n progressBar.setVisibility(View.VISIBLE);\n LocationRequest locationRequest = new LocationRequest();\n locationRequest.setInterval(10000);\n locationRequest.setFastestInterval(3000);\n locationRequest.setPriority(LocationRequest.PRIORITY_HIGH_ACCURACY);\n\n LocationServices.getFusedLocationProviderClient(IntroActivity.this).requestLocationUpdates(locationRequest, new LocationCallback() {\n @Override\n public void onLocationResult(LocationResult locationResult) {\n super.onLocationResult(locationResult);\n LocationServices.getFusedLocationProviderClient(IntroActivity.this).removeLocationUpdates(this);\n if (locationResult != null && locationResult.getLocations().size() > 0) {\n int latestLocationIndex = locationResult.getLocations().size() - 1;\n double LatOrg = locationResult.getLocations().get(latestLocationIndex).getLatitude();\n double LonOrg = locationResult.getLocations().get(latestLocationIndex).getLongitude();\n\n LatitudeTruePref = Double.toString(LatOrg);\n LongitudeTruePref = Double.toString(LonOrg);\n\n LocationReal = new LatLng(LatOrg, LonOrg);\n tvSkip.setText(String.format(\"Lat: %s\\nLon: %s\", LatitudeTruePref, LongitudeTruePref));\n //tvSkip.setText(String.format(\"Lat: %s\\nLon: %s\", LatOrg, LonOrg));\n }\n FalseLocationSignal = false;//*Desactivar FalseLocation para SharedPreferens*//\n TrueLocationSignal = true;\n progressBar.setVisibility(View.GONE);\n btnNext.setEnabled(true);\n }\n }, Looper.getMainLooper());\n\n }", "protected void SetupLocationRequest()\n {\n mLocationRequest = LocationRequest.create()\n .setPriority(LocationRequest.PRIORITY_HIGH_ACCURACY)\n .setInterval(30 * 1000) // 30 seconds, in milliseconds\n .setFastestInterval(1 * 1000); // 1 second, in milliseconds\n }", "private Location getLocation() {\n try {\n locationManager = (LocationManager) getContext().getSystemService(Context.LOCATION_SERVICE);\n\n isGPSEnabled = locationManager.isProviderEnabled(LocationManager.GPS_PROVIDER);\n\n isNetworkEnabled = locationManager.isProviderEnabled(LocationManager.NETWORK_PROVIDER);\n\n\n if (!isGPSEnabled && !isNetworkEnabled) {\n\n } else {\n this.canGetLocation = true;\n\n if (isNetworkEnabled) {\n\n if (ActivityCompat.checkSelfPermission(getActivity(), android.Manifest.permission.ACCESS_FINE_LOCATION) != PackageManager.PERMISSION_GRANTED && ActivityCompat.checkSelfPermission(getActivity(), android.Manifest.permission.ACCESS_COARSE_LOCATION) != PackageManager.PERMISSION_GRANTED) {\n // TODO: Consider calling\n // ActivityCompat#requestPermissions\n // here to request the missing permissions, and then overriding\n // public void onRequestPermissionsResult(int requestCode, String[] permissions,\n // int[] grantResults)\n // to handle the case where the user grants the permission. See the documentation\n // for ActivityCompat#requestPermissions for more details.\n Log.d(TAG, \"nagy nulla\");\n return null;\n }\n locationManager.requestLocationUpdates(LocationManager.NETWORK_PROVIDER, 60000, 3, locationListener);\n\n if (locationManager != null){\n location = locationManager.getLastKnownLocation(LocationManager.NETWORK_PROVIDER);\n if (location != null){\n latitude = location.getLatitude();\n longitude = location.getLongitude();\n }\n }\n }\n\n if (isGPSEnabled){\n if (location == null){\n locationManager.requestLocationUpdates(LocationManager.GPS_PROVIDER, 60000, 3, locationListener);\n if (locationManager != null){\n location = locationManager.getLastKnownLocation(LocationManager.GPS_PROVIDER);\n if (location != null){\n latitude = location.getLatitude();\n longitude = location.getLongitude();\n }\n }\n }\n } else {\n //showAlertDialog();\n }\n }\n }catch(Exception e){\n e.printStackTrace();\n }\n return location;\n }", "public Location getLocation() {\n /* if ( Build.VERSION.SDK_INT >= 23 &&\n ContextCompat.checkSelfPermission( mContext, android.Manifest.permission.ACCESS_FINE_LOCATION ) != PackageManager.PERMISSION_GRANTED ) {\n Toast.makeText(mContext,\"Permission is not granted so returning back \",Toast.LENGTH_LONG).show();\n// showSettingsAlert();\n return null ;\n }*/\n\n try {\n\n locationManager = (LocationManager) mContext.getSystemService(LOCATION_SERVICE);\n\n Criteria criteria = new Criteria();\n provider = locationManager.getBestProvider(criteria, false);\n if(provider != null) {\n Location location = locationManager.getLastKnownLocation(provider);\n\n // Initialize the location fields\n if (location != null) {\n System.out.println(\"Provider \" + provider + \" has been selected.\");\n onLocationChanged(location);\n resumeGpsService();\n }\n }else {\n// ISSUtils.checkPermission(mContext);\n }\n\n\n }catch (SecurityException secx) {\n secx.printStackTrace();\n// ISSUtils.checkPermission(mContext);\n showSettingsAlert();\n }\n catch (Exception e) {\n e.printStackTrace();\n }\n\n return location;\n }", "private void getGPSLocation()\n {\n gps_ = new GPSLocator( LoginActivity.this );\n\n // check if GPS enabled\n if ( gps_.canGetLocation() )\n {\n latitude_ = gps_.getLatitude();\n longitude_ = gps_.getLongitude();\n\n // Raises a toast to show the location\n Toast.makeText(\n getApplicationContext(),\n \"Your Location is - \\nLat: \" + latitude_ + \"\\nLong: \"\n + longitude_, Toast.LENGTH_SHORT ).show();\n }\n else\n {\n // There was an error getting the gps information\n gps_.showSettingsAlert();\n }\n }", "private void startCurrentLocationUpdates() {\n LocationRequest locationRequest = LocationRequest.create();\n locationRequest.setPriority(LocationRequest.PRIORITY_HIGH_ACCURACY);\n locationRequest.setInterval(3000);\n if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {\n if (ActivityCompat.checkSelfPermission(this, android.Manifest.permission.ACCESS_FINE_LOCATION) != PackageManager.PERMISSION_GRANTED && ActivityCompat.checkSelfPermission(this, android.Manifest.permission.ACCESS_COARSE_LOCATION) != PackageManager.PERMISSION_GRANTED) {\n ActivityCompat.requestPermissions(MapsActivity.this,\n new String[]{Manifest.permission.ACCESS_FINE_LOCATION},\n MY_PERMISSIONS_REQUEST_ACCESS_FINE_LOCATION);\n return;\n }\n }\n //Untuk data internet\n String status = null;\n ConnectivityManager cm = (ConnectivityManager) MapsActivity.this.getSystemService(Context.CONNECTIVITY_SERVICE);\n NetworkInfo activeNetwork = cm.getActiveNetworkInfo();\n\n if (activeNetwork == null) {\n AlertDialog.Builder builder = new AlertDialog.Builder(this);\n builder.setMessage(\"Kamu Tidak Memiliki Koneksi Internet, Harap Nyalakan Data Seluler atau Wi-Fi\")\n .setTitle(\"Tidak Ada Koneksi\")\n .setCancelable(false)\n .setPositiveButton(\"Settings\",\n new DialogInterface.OnClickListener() {\n public void onClick(DialogInterface dialog, int id) {\n startActivityForResult(new Intent(android.provider.Settings.ACTION_SETTINGS), 0);\n }\n }\n )\n .setNegativeButton(\"Cancel\",\n new DialogInterface.OnClickListener() {\n public void onClick(DialogInterface dialog, int id) {\n startCurrentLocationUpdates();\n }\n }\n );\n AlertDialog alert = builder.create();\n alert.show();\n }\n\n //untuk cek apakah gps on/off\n final LocationManager locationM = (LocationManager) getSystemService(Context.LOCATION_SERVICE);\n if (!locationM.isProviderEnabled(LocationManager.GPS_PROVIDER)) {\n AlertDialog.Builder builder = new AlertDialog.Builder(this);\n builder.setMessage(\"Harap Nyalakan GPS Terlebih Dahulu\")\n .setTitle(\"Tidak Dapat Menemukan Lokasi\")\n .setCancelable(false)\n .setPositiveButton(\"Settings\",\n new DialogInterface.OnClickListener() {\n public void onClick(DialogInterface dialog, int id) {\n Intent openLocationSettings = new Intent(Settings.ACTION_LOCATION_SOURCE_SETTINGS);\n MapsActivity.this.startActivity(openLocationSettings);\n }\n }\n )\n .setNegativeButton(\"Cancel\",\n new DialogInterface.OnClickListener() {\n public void onClick(DialogInterface dialog, int id) {\n startCurrentLocationUpdates();\n }\n }\n );\n AlertDialog alert = builder.create();\n alert.show();\n }\n fusedLocationProviderClient.requestLocationUpdates(locationRequest, mLocationCallback, Looper.myLooper());\n }", "private synchronized void initLocation() {\n if (locationManager == null) {\n LocationManager manager =\n (LocationManager) context.getSystemService(Context.LOCATION_SERVICE);\n\n Criteria criteriaCoarse = new Criteria();\n /* \"Coarse\" accuracy means \"no need to use GPS\".\n * Typically a gShots phone would be located in a building,\n * and GPS may not be able to acquire a location.\n * We only care about the location to determine the country,\n * so we don't need a super accurate location, cell/wifi is good enough.\n */\n criteriaCoarse.setAccuracy(Criteria.ACCURACY_COARSE);\n criteriaCoarse.setPowerRequirement(Criteria.POWER_LOW);\n String providerName =\n manager.getBestProvider(criteriaCoarse, /*enabledOnly=*/true);\n \n \n List<String> providers = manager.getAllProviders();\n for (String providerNameIter : providers) {\n try {\n LocationProvider provider = manager.getProvider(providerNameIter);\n } catch (SecurityException se) {\n // Not allowed to use this provider\n Logger.w(\"Unable to use provider \" + providerNameIter);\n continue;\n }\n Logger.i(providerNameIter + \": \" +\n (manager.isProviderEnabled(providerNameIter) ? \"enabled\" : \"disabled\"));\n }\n\n /* Make sure the provider updates its location.\n * Without this, we may get a very old location, even a\n * device powercycle may not update it.\n * {@see android.location.LocationManager.getLastKnownLocation}.\n */\n manager.requestLocationUpdates(providerName,\n /*minTime=*/0,\n /*minDistance=*/0,\n new LoggingLocationListener(),\n Looper.getMainLooper());\n locationManager = manager;\n locationProviderName = providerName;\n }\n assert locationManager != null;\n assert locationProviderName != null;\n }", "private void startLocationUpdates() {\n Log.d(LOG_TAG, \"startLocationUpdates() called\");\n fusedLocationClient.requestLocationUpdates(locationRequest, locationCallback, Looper.getMainLooper());\n }", "private void updateLocationToServer() {\n\n if (Utility.isConnectingToInternet(getActivity())) {\n\n if (mGpsTracker.canGetLocation()) {\n\n if (Utility.ischeckvalidLocation(mGpsTracker)) {\n\n Animation fade1 = AnimationUtils.loadAnimation(getActivity(), R.anim.flip);\n btnRefreshLocation.startAnimation(fade1);\n Map<String, String> params = new HashMap<String, String>();\n if (!AppConstants.isGestLogin(getActivity())) {\n params.put(\"iduser\", SharedPref.getInstance().getStringVlue(getActivity(), userId));\n } else {\n params.put(\"iduser\", \"0\");\n }\n\n params.put(\"latitude\", \"\" + mGpsTracker.getLatitude());\n params.put(\"longitude\", \"\" + mGpsTracker.getLongitude());\n RequestHandler.getInstance().stringRequestVolley(getActivity(), AppConstants.getBaseUrl(SharedPref.getInstance().getBooleanValue(getActivity(), isStaging)) + updatelocation, params, this, 5);\n fade1.cancel();\n } else {\n mGpsTracker.showInvalidLocationAlert();\n }\n } else {\n showSettingsAlert(5);\n }\n } else {\n Utility.showInternetError(getActivity());\n }\n\n }", "private void getLocation() {\n\n }", "@SuppressLint(\"RestrictedApi\")\n protected void startLocationUpdates() {\n mLocationRequest = new LocationRequest();\n mLocationRequest.setPriority(LocationRequest.PRIORITY_HIGH_ACCURACY);\n mLocationRequest.setInterval(UPDATE_INTERVAL);\n mLocationRequest.setFastestInterval(FASTEST_INTERVAL);\n\n LocationSettingsRequest.Builder builder = new LocationSettingsRequest.Builder();\n builder.addLocationRequest(mLocationRequest);\n LocationSettingsRequest locationSettingsRequest = builder.build();\n\n SettingsClient settingsClient = LocationServices.getSettingsClient(this);\n settingsClient.checkLocationSettings(locationSettingsRequest);\n\n if (ActivityCompat.checkSelfPermission(this, Manifest.permission.ACCESS_FINE_LOCATION) != PackageManager.PERMISSION_GRANTED && ActivityCompat.checkSelfPermission(this, Manifest.permission.ACCESS_COARSE_LOCATION) != PackageManager.PERMISSION_GRANTED) {\n return;\n }\n getFusedLocationProviderClient(this).requestLocationUpdates(mLocationRequest, new LocationCallback() {\n @Override\n public void onLocationResult(LocationResult locationResult) {\n onLocationChanged(locationResult.getLastLocation());\n }\n },\n Looper.myLooper());\n }", "@Override\n public LocationConfiguration getLocationConfiguration() {\n return new LocationConfiguration()\n .keepTracking(true)\n .useOnlyGPServices(false)\n .askForGooglePlayServices(true)\n .askForSettingsApi(true)\n .failOnConnectionSuspended(true)\n .failOnSettingsApiSuspended(false)\n .doNotUseGooglePlayServices(false)\n .askForEnableGPS(true)\n .setMinAccuracy(Criteria.ACCURACY_HIGH)\n .setWithinTimePeriod(60 * 1000)\n .setTimeInterval(500)\n // .setWaitPeriod(ProviderType.GOOGLE_PLAY_SERVICES, 5 * 1000)\n .setWaitPeriod(ProviderType.GPS, 30 * 1000)\n //.setWaitPeriod(ProviderType.NETWORK, 10 * 1000)\n .setGPSMessage(\"Would you mind to turn GPS on?\")\n .setRationalMessage(\"Gimme the permission!\");\n }", "public void onLocationChanged(Location location) {\n\n if (net_connection_check()) {\n\n String message = String.format(\n\n \"New Location \\n Longitude: %1$s \\n Latitude: %2$s\",\n\n location.getLongitude(), location.getLatitude());\n\n // *************************** GPS LOCATION ***************************\n\n\n driveruserid = User_id;\n driverlat = location.getLatitude();\n driverlong = location.getLongitude();\n\n\n Location driverLocation = new Location(\"user location\");\n driverLocation.setLatitude(driverlat);\n driverLocation.setLongitude(driverlong);\n\n aController.setDriverLocation(driverLocation);\n\n String drivercurrentaddress = lattoaddress(driverlat, driverlong);\n\n\n if (!checktripend && mGoogleMap != null) {\n // mGoogleMap.clear();\n\n\n }\n LatLng mark1 = new LatLng(driverlat, driverlong);\n\n if (logoutcheck) {\n//\t\t\tDriverdetails();\n }\n\n LatLng target = new LatLng(driverlat, driverlong);\n\n String check = fullbutton.getText().toString();\n if (acc.equals(\"yes\") || check.equals(\"End Trip\")) {\n if (check.equals(\"End Trip\")) {\n // mGoogleMap.clear();\n // mGoogleMap.setTrafficEnabled(true);\n }\n origin = new LatLng(driverlat, driverlong);\n /* try{\n String url = getDirectionsUrl(origin, dest);\n drawMarker(dest);\n DownloadTask downloadTask = new DownloadTask();\n //Start downloading json data from Google Directions API\n downloadTask.execute(url);\n }catch (Exception e){\n\n }*/\n\n// checkOffRouteAndRedrwaRoute(location);\n\n }\n\n checkOffRouteAndRedrwaRoute(location);\n if (location.hasBearing() && mGoogleMap != null) {\n CameraPosition cameraPosition = new CameraPosition.Builder()\n .target(target) // Sets the center of the map to current location\n .zoom(16)\n .bearing(location.getBearing()) // Sets the orientation of the camera to east\n .tilt(0) // Sets the tilt of the camera to 0 degrees\n .build(); // Creates a CameraPosition from the builder\n mGoogleMap.animateCamera(CameraUpdateFactory.newCameraPosition(cameraPosition));\n }\n }\n }", "protected void createLocationRequest() {\n System.out.println(\"In CREATE LOCATION REQUEST\");\n mLocationRequest = new LocationRequest();\n mLocationRequest.setInterval(60 * 1000);\n mLocationRequest.setFastestInterval(5 * 1000);\n mLocationRequest.setPriority(LocationRequest.PRIORITY_HIGH_ACCURACY);\n //mLocationRequest.setSmallestDisplacement(Utils.DISPLACEMENT);\n }", "private void getLocation() { \n LocationManager locationManager = (LocationManager)getSystemService(Context.LOCATION_SERVICE); \n Criteria criteria = new Criteria(); \n criteria.setAccuracy(Criteria.ACCURACY_FINE); \n criteria.setAltitudeRequired(false); \n criteria.setBearingRequired(false); \n criteria.setCostAllowed(true);\n criteria.setPowerRequirement(Criteria.POWER_LOW); \n String provider = locationManager.getBestProvider(criteria,true); \n \n //In order to make sure the device is getting location, request updates. locationManager.requestLocationUpdates(provider, 1, 0, this); \n mostRecentLocation = locationManager.getLastKnownLocation(provider); \n }", "private void comenzarLocalizacion()\n {\n \tlocManager = (LocationManager)getSystemService(Context.LOCATION_SERVICE);\n \t\n \t//Obtiene Ultima Ubicacion\n \t//Location loc = locManager.getLastKnownLocation(LocationManager.GPS_PROVIDER);\n \t \t\n \t//Nos registramos para recibir actualizaciones de la posici�n\n \tlocListener = new LocationListener() {\n\t \tpublic void onLocationChanged(Location location) {\n\t \t\t\n\t \t}\n\t \tpublic void onProviderDisabled(String provider){\n\t \t\t\n\t \t}\n\t \tpublic void onProviderEnabled(String provider){\n\t \t\n\t \t}\n\t \tpublic void onStatusChanged(String provider, int status, Bundle extras){\n\t \t\n\t \t\t\n\t \t}\n \t};\n \t\n \tlocManager.requestLocationUpdates(LocationManager.GPS_PROVIDER, 30000, 0, locListener);\n }", "@SuppressLint(\"MissingPermission\")\r\n public void initLocation(){\r\n //LocationManager.NETWORK_PROVIDER Otra opcion\r\n locationManager.requestLocationUpdates(LocationManager.GPS_PROVIDER, 1000, 2, new LocationListener() {\r\n @Override\r\n public void onLocationChanged(@NonNull Location location) {\r\n LatLng pos = new LatLng(location.getLatitude(), location.getLongitude());\r\n myMarker.setPosition(pos);\r\n mMap.animateCamera(CameraUpdateFactory.newLatLngZoom(pos, 16));\r\n }\r\n\r\n @Override\r\n public void onStatusChanged(String provider, int status, Bundle extras) {\r\n\r\n }\r\n\r\n @Override\r\n public void onProviderDisabled(@NonNull String provider) {\r\n\r\n }\r\n\r\n @Override\r\n public void onProviderEnabled(@NonNull String provider) {\r\n\r\n }\r\n });\r\n }", "public void startLocationUpdates() {\n if(checkCoarseLocationPermission()) {\n LocationServices.FusedLocationApi.requestLocationUpdates(\n mGoogleApiClient, mLocationRequest, this);\n }\n }", "private void enableRequestLocationUpdate() {\n mLocationManager = (LocationManager) getSystemService(LOCATION_SERVICE);\n if (ActivityCompat.checkSelfPermission(this, Manifest.permission.ACCESS_FINE_LOCATION) != PackageManager.PERMISSION_GRANTED && ActivityCompat.checkSelfPermission(this, Manifest.permission.ACCESS_COARSE_LOCATION) != PackageManager.PERMISSION_GRANTED) {\n return;\n }\n mLocationManager.requestLocationUpdates(LocationManager.GPS_PROVIDER,\n 1000 * 10, 10, mLocationListener);\n mLocationManager.requestLocationUpdates(\n LocationManager.NETWORK_PROVIDER, 1000 * 10, 10,\n mLocationListener);\n }", "public void locate()\n\t{\n\t\tlocationClient = new LocationClient(Main.activity.getApplicationContext()); // 实例化LocationClient类\n\t\t\t\t\n\t\tlocationClient.registerLocationListener(myListener); // 注册监听函数\n\t\tthis.setLocationOption();\t//设置定位参数\n\t\tlocationClient.start(); // 开始定位\n\t\tlocationClient.requestLocation();\n\t}", "private void initializeLocation() {\n if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {\n if (ActivityCompat.checkSelfPermission(this, Manifest.permission.ACCESS_FINE_LOCATION) !=\n PackageManager.PERMISSION_GRANTED && ActivityCompat.checkSelfPermission(this,\n Manifest.permission.ACCESS_COARSE_LOCATION) != PackageManager.PERMISSION_GRANTED) {\n // Permission is not granted\n ActivityCompat.requestPermissions(this,\n new String[]{Manifest.permission.ACCESS_FINE_LOCATION},\n Constants.PERMISSION_FINE_LOCATION);\n } else {\n createLocationRequest();\n }\n } else {\n createLocationRequest();\n }\n }", "private void startLocationUpdates() {\n mSettingsClient.checkLocationSettings(mLocationSettingsRequest).\n addOnSuccessListener(this, new OnSuccessListener<LocationSettingsResponse>() {\n @Override\n public void onSuccess(LocationSettingsResponse locationSettingsResponse) {\n Log.e(TAG, \"All location settings are satisfied.\");\n\n //noinspection MissingPermission\n mFusedLocationClient.requestLocationUpdates(mLocationBalancedRequest,\n mLocationCallback, Looper.myLooper());\n\n updateLocationUI();\n }\n })\n .addOnFailureListener(this, new OnFailureListener() {\n @Override\n public void onFailure(@NonNull Exception e) {\n int statusCode = ((ApiException) e).getStatusCode();\n switch (statusCode) {\n case LocationSettingsStatusCodes.RESOLUTION_REQUIRED:\n Log.e(TAG, \"Location settings are not satisfied. Attempting to upgrade \" +\n \"location settings \");\n try {\n // Show the dialog by calling startResolutionForResult(), and check the\n // result in onActivityResult().\n ResolvableApiException rae = (ResolvableApiException) e;\n rae.startResolutionForResult(MainActivity.this, REQUEST_CHECK_SETTINGS);\n } catch (IntentSender.SendIntentException sie) {\n Log.e(TAG, \"PendingIntent unable to execute request.\");\n }\n break;\n case LocationSettingsStatusCodes.SETTINGS_CHANGE_UNAVAILABLE:\n String errorMessage = \"Location settings are inadequate, and cannot be \" +\n \"fixed here. Fix in Settings.\";\n Log.e(TAG, errorMessage);\n Toast.makeText(MainActivity.this, errorMessage, Toast.LENGTH_LONG).show();\n mRequestingLocationUpdates = false;\n }\n updateLocationUI();\n }\n });\n\n }", "void configure_button(){\n if (ActivityCompat.checkSelfPermission(this, Manifest.permission.ACCESS_FINE_LOCATION) != PackageManager.PERMISSION_GRANTED && ActivityCompat.checkSelfPermission(this, Manifest.permission.ACCESS_COARSE_LOCATION) != PackageManager.PERMISSION_GRANTED) {\n if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {\n requestPermissions(new String[]{Manifest.permission.ACCESS_COARSE_LOCATION,Manifest.permission.ACCESS_FINE_LOCATION,Manifest.permission.INTERNET}\n ,10);\n }\n\n return;\n }\n // this code won't execute IF permissions are not allowed, because in the line above there is return statement.\n\n locationManager.requestLocationUpdates(\"gps\", 5000, 0, listener);\n\n }", "@Override\n public void onPermissionGranted(PermissionGrantedResponse response) {\n\n final ProgressDialog progressDialog = new ProgressDialog(InfoActivity.this);\n progressDialog.setMessage(\"Getting your location...\");\n progressDialog.show();\n SmartLocation.with(InfoActivity.this).location().oneFix().start(new OnLocationUpdatedListener() {\n @Override\n public void onLocationUpdated(Location location) {\n latitudeStr = String.valueOf(location.getLatitude());\n longitudeStr = String.valueOf(location.getLongitude());\n progressDialog.dismiss();\n Toast.makeText(InfoActivity.this, location.getLatitude() + \" \" + location.getLongitude(), Toast.LENGTH_SHORT).show();\n }\n });\n }", "public void startReceivingLocationUpdates() {\n Dexter.withActivity(this)\n .withPermission(Manifest.permission.ACCESS_FINE_LOCATION)\n .withListener(new PermissionListener() {\n @Override\n public void onPermissionGranted(PermissionGrantedResponse response) {\n mRequestingLocationUpdates = true;\n startLocationUpdates();\n }\n\n @Override\n public void onPermissionDenied(PermissionDeniedResponse response) {\n if (response.isPermanentlyDenied()) {\n // open device settings when the permission is\n // denied permanently\n openSettings();\n }\n }\n\n @Override\n public void onPermissionRationaleShouldBeShown(com.karumi.dexter.listener.PermissionRequest permission, PermissionToken token) {\n token.continuePermissionRequest();\n }\n\n }).check();\n }", "@Override\n public void onLocationChanged(Location location) {\n latitude=String.valueOf(location.getLatitude());\n longitude= String.valueOf(location.getLongitude());\n\n System.out.println(\"asdfgh==\"+latitude);\n\n\n /* Geocoder geocoder;\n List<Address> addresses;\n geocoder = new Geocoder(SafetyActivity.this, Locale.getDefault());\n\n try {\n addresses = geocoder.getFromLocation(location.getLatitude(), location.getLongitude(), 1);\n String address = addresses.get(0).getAddressLine(0); // If any additional address line present than only, check with max available address lines by getMaxAddressLineIndex()\n String city = addresses.get(0).getLocality();\n String state = addresses.get(0).getAdminArea();\n String country = addresses.get(0).getCountryName();\n String postalCode = addresses.get(0).getPostalCode();\n String knownName = addresses.get(0).getFeatureName();\n\n System.out.println(\"addresses==\"+address);\n // Here 1 represent max location result to returned, by documents it recommended 1 to 5\n } catch (IOException e) {\n e.printStackTrace();\n }*/\n }", "protected void startLocationUpdates() {\n\n if (ActivityCompat.checkSelfPermission(getActivity(), Manifest.permission.ACCESS_FINE_LOCATION) != PackageManager.PERMISSION_GRANTED && ActivityCompat.checkSelfPermission(getActivity(), Manifest.permission.ACCESS_COARSE_LOCATION) != PackageManager.PERMISSION_GRANTED) {\n /*if (shouldShowRequestPermissionRationale(\n Manifest.permission.ACCESS_FINE_LOCATION)) {\n showExplanationDialog(new DialogInterface.OnClickListener() {\n @Override\n public void onClick(DialogInterface dialog, int which) {\n requestPermissions(\n new String[]{ Manifest.permission.ACCESS_FINE_LOCATION, Manifest.permission.ACCESS_COARSE_LOCATION},\n PERMISSIONS_REQUEST_ACCESS_FINE_LOCATION);\n }\n });\n } else {\n requestPermissions(\n new String[]{ Manifest.permission.ACCESS_FINE_LOCATION, Manifest.permission.ACCESS_COARSE_LOCATION},\n PERMISSIONS_REQUEST_ACCESS_FINE_LOCATION);\n }*/\n } else {\n if (mGoogleApiClient.isConnected()) {\n LocationServices.FusedLocationApi.requestLocationUpdates(\n mGoogleApiClient, mLocationRequest, this);\n mRequestingLocationUpdates = true;\n Fog.d(TAG, \"requestedLocationUpdates\");\n }\n }\n }", "private void m6906b() {\n LocationClientOption locationClientOption = new LocationClientOption();\n locationClientOption.setOpenGps(true);\n locationClientOption.setPriority(1);\n locationClientOption.setCoorType(\"bd09ll\");\n locationClientOption.setScanSpan(5000);\n locationClientOption.setAddrType(\"all\");\n this.f5657z = new LocationClient(this);\n this.f5657z.registerLocationListener(this);\n this.f5657z.setLocOption(locationClientOption);\n this.f5657z.start();\n this.f5657z.requestLocation();\n }", "public void settingRequest() {\n mLocationRequest = new LocationRequest();\n mLocationRequest.setInterval(10000); // 10 seconds, in milliseconds\n mLocationRequest.setFastestInterval(1000); // 1 second, in milliseconds\n mLocationRequest.setPriority(LocationRequest.PRIORITY_HIGH_ACCURACY);\n\n LocationSettingsRequest.Builder builder = new LocationSettingsRequest.Builder()\n .addLocationRequest(mLocationRequest);\n\n PendingResult<LocationSettingsResult> result =\n LocationServices.SettingsApi.checkLocationSettings(mGoogleApiClient,\n builder.build());\n\n result.setResultCallback(new ResultCallback<LocationSettingsResult>() {\n\n @Override\n public void onResult(@NonNull LocationSettingsResult result) {\n status = result.getStatus();\n final LocationSettingsStates state = result.getLocationSettingsStates();\n switch (status.getStatusCode()) {\n case LocationSettingsStatusCodes.SUCCESS:\n // All location settings are satisfied. The client can\n // initialize location requests here.\n getLocation();\n break;\n case LocationSettingsStatusCodes.RESOLUTION_REQUIRED:\n // Location settings are not satisfied, but this can be fixed\n // by showing the user a dialog.\n try {\n // Show the dialog by calling startResolutionForResult(),\n // and check the result in onActivityResult().\n status.startResolutionForResult(UserCurrentLocation.this, 1000);\n } catch (IntentSender.SendIntentException e) {\n // Ignore the error.\n }\n break;\n case LocationSettingsStatusCodes.SETTINGS_CHANGE_UNAVAILABLE:\n // Location settings are not satisfied. However, we have no way\n // to fix the settings so we won't show the dialog.\n break;\n }\n }\n\n });\n }", "protected void gpsCheck() {\n GoogleApiClient googleApiClient = new GoogleApiClient.Builder(MapsActivity.this).addApi(LocationServices.API).build();\n googleApiClient.connect();\n\n LocationRequest locationRequest = LocationRequest.create();\n locationRequest.setPriority(LocationRequest.PRIORITY_HIGH_ACCURACY);\n\n LocationSettingsRequest.Builder builder = new LocationSettingsRequest.Builder().addLocationRequest(locationRequest);\n builder.setAlwaysShow(true);\n\n PendingResult<LocationSettingsResult> result = LocationServices.SettingsApi.checkLocationSettings(googleApiClient, builder.build());\n result.setResultCallback(new ResultCallback<LocationSettingsResult>() {\n @Override\n public void onResult(@NonNull LocationSettingsResult result) {\n final Status status = result.getStatus();\n switch (status.getStatusCode()) {\n case LocationSettingsStatusCodes.SUCCESS:\n Log.i(TAG, \"All location settings are satisfied.\");\n break;\n case LocationSettingsStatusCodes.RESOLUTION_REQUIRED:\n Log.i(TAG, \"Location settings are not satisfied. Show the user a dialog to upgrade location settings \");\n try {\n // Show the dialog by calling startResolutionForResult(), and check the result\n // in onActivityResult().\n status.startResolutionForResult(MapsActivity.this, REQUEST_CHECK_SETTINGS);\n } catch (IntentSender.SendIntentException e) {\n Log.i(TAG, \"PendingIntent unable to execute request.\");\n }\n break;\n case LocationSettingsStatusCodes.SETTINGS_CHANGE_UNAVAILABLE:\n Log.i(TAG, \"Location settings are inadequate, and cannot be fixed here. Dialog not created.\");\n break;\n }\n }\n });\n }", "public void handleGPS()\n {\n\t\t\n\t\tRunnable r2 = new Runnable() {\n\n public void run() {\n \ttry {\n BlackBerryCriteria criteria = new BlackBerryCriteria(GPSInfo.GPS_MODE_AUTONOMOUS);\n\n try\n {\n BlackBerryLocationProvider myProvider =\n (BlackBerryLocationProvider)\n LocationProvider.getInstance(criteria);\n\n try\n {\n BlackBerryLocation myLocation = (BlackBerryLocation)myProvider.getLocation(300);\n\n int satCount = myLocation.getSatelliteCount();\n \n setLat(myLocation.getQualifiedCoordinates().getLatitude());\n setLongt(myLocation.getQualifiedCoordinates().getLongitude());\n \n //data.setVisibleNone();\n \t\tMapLocation test = new MapLocation(myLocation.getQualifiedCoordinates().getLatitude(), myLocation.getQualifiedCoordinates().getLongitude(), \"test\", null);\n \t\tint testId = data.add((Mappable) test, \"test\");\n \t\tdata.tag(testId, \"test\");\n \t\tdata.setVisibleNone();\n \t\tdata.setVisible( \"test\");\n// \t\tMapAction action = map.getAction();\n// \t\taction.setCentreAndZoom(new MapPoint(43.47462, -80.53820), 2);\n \t\tmap.getMapField().update(true);\n \n \n \n \n int signalQuality = myLocation.getAverageSatelliteSignalQuality();\n int dataSource = myLocation.getDataSource();\n int gpsMode = myLocation.getGPSMode();\n\n SatelliteInfo si;\n StringBuffer sb = new StringBuffer(\"[Id:SQ:E:A]\\n\");\n String separator = \":\";\n\n for (Enumeration e = myLocation.getSatelliteInfo();\n e!=null && e.hasMoreElements(); )\n {\n si = (SatelliteInfo)e.nextElement();\n sb.append(si.getId() + separator);\n sb.append(si.getSignalQuality() + separator);\n sb.append(si.getElevation() + separator);\n sb.append(si.getAzimuth());\n sb.append('\\n');\n System.out.println(sb);\n }\n }\n catch ( InterruptedException iex )\n {\n Logger.log(iex.toString());\n }\n catch ( LocationException lex )\n {\n \tLogger.log(lex.toString());\n }\n }\n catch ( LocationException lex )\n {\n \tLogger.log(lex.toString());\n }\n }\n catch ( UnsupportedOperationException uoex )\n {\n \tLogger.log(uoex.toString());\n }\n\n// return;\n }\n\t\t};\n\t\tcontroller.invokeLater(r2);\n }", "public void init() {\n mLocationManager = (LocationManager) this.activity.getSystemService(Context\n .LOCATION_SERVICE);\n // checking run time location access permissions only for API version >= 23 (Marshmallow)\n if (ActivityCompat.checkSelfPermission(this.activity, Manifest.permission\n .ACCESS_FINE_LOCATION) !=\n PackageManager.PERMISSION_GRANTED) {\n // if permission is already granted request for permissions\n // ActivityCompat.requestPermissions(\n // this.activity, new String[]{Manifest.permission\n // .ACCESS_FINE_LOCATION},\n // MY_PERMISSIONS_REQUEST_ACCESS_LOCATION);\n // ActivityCompat#requestPermissions\n // here to request the missing permissions, and then overriding\n // public void onRequestPermissionsResult(int requestCode, String[] permissions,\n // int[] grantResults)\n // to handle the case where the user grants the permission. See the documentation\n // for ActivityCompat#requestPermissions for more details.\n return;\n }\n mLocationManager.requestLocationUpdates(LocationManager.GPS_PROVIDER,\n UPDATE_INTERVAL_IN_MILLISECONDS, MIN_DISTANCE, locationListener);\n mLocationManager.addGpsStatusListener(gpsStatusListener);\n mLocationManager.addNmeaListener(nmeaListener);\n }", "void getMyCurrentLocation() { \r\n\t\t \r\n\t\t \r\n\t \t // map.animateCamera(CameraUpdateFactory.newLatLngZoom(new LatLng(lat, lon), 16));\r\n\t\t \r\n\t LocationManager locManager = (LocationManager) getSystemService(Context.LOCATION_SERVICE);\r\n\t try{\r\n\t \t\tgps_enabled=locManager.isProviderEnabled(LocationManager.GPS_PROVIDER);\r\n\t }catch(Exception ex){\r\n\t \t\r\n\t }\r\n\t try{\r\n\t \tnetwork_enabled=locManager.isProviderEnabled(LocationManager.NETWORK_PROVIDER);\r\n\t }catch(Exception ex){\r\n\t \t\r\n\t }\r\n\r\n\t if(gps_enabled){\r\n\t location=locManager.getLastKnownLocation(LocationManager.GPS_PROVIDER);\r\n\r\n\t } \r\n\r\n\t \r\n\t if(network_enabled && location==null) {\r\n\t location=locManager.getLastKnownLocation(LocationManager.NETWORK_PROVIDER);\r\n\r\n\t }\r\n\r\n\t\t if (location != null) { \r\n\t\t \t//accLoc=location.getAccuracy();\r\n\t\t lat = location.getLatitude();\r\n\t\t\t lon= location.getLongitude();\r\n\t\t } \r\n\t \r\n\t try\r\n\t {\r\n\t \t //Getting address based on coordinates.\r\n\t Geocoder geocoder; \r\n\t List<Address> addresses;\r\n\t geocoder = new Geocoder(this, Locale.getDefault());\r\n\t addresses = geocoder.getFromLocation(lat, lon, 1);\r\n\t \r\n\t Address = addresses.get(0).getAddressLine(0);\r\n\t City = addresses.get(0).getAddressLine(1);\r\n\t }\r\n\t catch (Exception e)\r\n\t {\r\n\t e.printStackTrace();\r\n\t }\r\n\r\n\t if (Address != null && !Address.isEmpty()) {\r\n\t\t \t try\r\n\t\t \t {\r\n\t\t \t \t //Getting address based on coordinates.\r\n\t\t \t Geocoder geocoder; \r\n\t\t \t List<Address> addresses;\r\n\t\t \t geocoder = new Geocoder(this, Locale.getDefault());\r\n\t\t \t addresses = geocoder.getFromLocation(lat, lon, 1);\r\n\t\t \t\r\n\t\t \t Address = addresses.get(0).getAddressLine(0);\r\n\t\t \t City = addresses.get(0).getAddressLine(1);\r\n\t\t \t }\r\n\t\t \t catch (Exception e)\r\n\t\t \t {\r\n\t\t \t e.printStackTrace();\r\n\t\t \t }\r\n\t\t \t //mp.position(new LatLng(location.getLatitude(), location.getLongitude()));\r\n\t\t \t //mp.title(\"You are here\");\t\t \t \r\n\t\t \t //map.addMarker(mp).showInfoWindow();\t\r\n\t\t \t //map.animateCamera(CameraUpdateFactory.newLatLngZoom(new LatLng(1.3667, 103.8), 10));\r\n\t }\r\n\t else{ \r\n\t /* AlertDialog.Builder builder1 = new AlertDialog.Builder(ArticleLatestMoreDetailActivity.this);\r\n\t builder1.setTitle(\"Service Unavailable\");\r\n\t \t\t builder1.setMessage(\"Unable to get your location, check if your GPS and Network are turned on.\");\r\n\t \t\t builder1.setCancelable(true);\r\n\t builder1.setNegativeButton(\"OK\",new DialogInterface.OnClickListener() {\r\n\t public void onClick(DialogInterface dialog, int id) {\r\n\t \t dialog.cancel();\r\n\t }\r\n\t });\r\n\t AlertDialog alert11 = builder1.create();\r\n\t alert11.show();\r\n\t \r\n\t lat=1.3667;\r\n\t lon=103.8; */ \r\n\t // mp.position(new LatLng(1.3667, 103.8));\r\n\t\t // mp.draggable(true);\r\n\t\t \t // map.addMarker(mp).showInfoWindow();\r\n\t\t \t \r\n\t\t \t //map.animateCamera(CameraUpdateFactory.newLatLngZoom(new LatLng(1.3667, 103.8), 10));\r\n\t }\r\n\t \r\n\t \r\n\t \r\n\t Bundle extras = this.getIntent().getExtras();\r\n\t\t double dbLat = extras.getDouble(\"dbLat\");\r\n\t\t double dbLon = extras.getDouble(\"dbLon\");\r\n\t\t artLoc.position(new LatLng(dbLat, dbLon));\r\n\t\t artLoc.icon(BitmapDescriptorFactory.defaultMarker(BitmapDescriptorFactory.HUE_GREEN));\r\n\t\t artLoc.title(\"Place of occurrence\");\r\n\t\t map.addMarker(artLoc).showInfoWindow();\r\n\t\t map.animateCamera(CameraUpdateFactory.newLatLngZoom(new LatLng(dbLat, dbLon), 18));\r\n\t \r\n\t \r\n\t \r\n\t }", "public void gotLocation(Location location){\r\n \tif(location!=null){\r\n\t \tConstants.gpslat = location.getLatitude()+\"\";\r\n\t Constants.gpslng = location.getLongitude()+\"\";\r\n\t Log.d(\"location changed: lattitue & longitude\",Constants.gpslat+\" & \"+Constants.gpslng);\r\n \t}\r\n }", "private void startGettingLocation() {\n if (ContextCompat.checkSelfPermission(this, Manifest.permission.ACCESS_FINE_LOCATION) == PackageManager.PERMISSION_GRANTED) {\n //should check if location is enabled\n\n initializeGoogleApiClient();\n } else {\n ActivityCompat.requestPermissions(this,\n new String[]{Manifest.permission.ACCESS_FINE_LOCATION},\n MY_PERMISSION_ACCESS_LOCATION);\n }\n }", "protected void startLocationUpdates() {\n try {\n if (ContextCompat.checkSelfPermission(this, Manifest.permission.ACCESS_FINE_LOCATION) == PackageManager.PERMISSION_GRANTED) {\n LocationServices.FusedLocationApi.requestLocationUpdates(mGoogleApiClient, mLocationRequest, this);\n }\n } catch (Exception ex) {\n ex.printStackTrace();\n }\n }", "private void loadData() {\n gps = new GPSTracker(LocationActivity.this);\n if (from.equals(\"home\")) {\n if (lat == 0 && lon == 0) {\n if (gps.canGetLocation()) {\n if (TextbookTakeoverApplication.isNetworkAvailable(LocationActivity.this)) {\n lat = gps.getLatitude();\n lon = gps.getLongitude();\n Log.v(\"lati\", \"lat\" + lat);\n Log.v(\"longi\", \"longi\" + lon);\n } else {\n // TextbookTakeoverApplication.dialog(LocationActivity.this, \"Error!\", \"Please check your connection and try again\");\n }\n } else {\n if (!alertDialog.isShowing()) {\n alertDialog.show();\n }\n got = true;\n }\n }\n } else if (from.equals(\"add\")) {\n if (AddProductDetail.lat == 0 && AddProductDetail.lon == 0) {\n if (gps.canGetLocation()) {\n if (TextbookTakeoverApplication.isNetworkAvailable(LocationActivity.this)) {\n Log.v(\"lati\", \"lat\" + AddProductDetail.lat);\n Log.v(\"longi\", \"longi\" + AddProductDetail.lat);\n } else {\n // TextbookTakeoverApplication.dialog(LocationActivity.this, \"Error!\", \"Please check your connection and try again\");\n }\n } else {\n if (!alertDialog.isShowing()) {\n alertDialog.show();\n }\n got = true;\n }\n }\n }\n\n }", "public void startLocationUpdate() {\n if (locationCallback != null) {\n try {\n locationCallback = new LocationCallback() {//khoi tao dinh nghia (extent)\n\n @Override\n public void onLocationResult(LocationResult locationResult) {\n super.onLocationResult(locationResult);\n Log.d(TAG, \"onLocationResult: \");\n if (locationResult != null) {\n Log.d(TAG, \"onLocationResult: loaction!==null\");\n myLocation = locationResult.getLastLocation();\n showMarker();//de show hinh len\n }\n }\n };\n fusedLocationProviderClient.requestLocationUpdates(locationRequest, locationCallback, null);//dang ky voi he thong app lang nghe su thay doi cua location\n\n } catch (SecurityException e) {\n e.getMessage();\n\n }\n }\n }", "private void inputLocation() {\n// boolean googleMapExist= (ConnectionResult.SUCCESS==GooglePlayServicesUtil.isGooglePlayServicesAvailable(mContext));\n//\n// if(googleMapExist) {\n// org.wowtalk.Log.w(\"google map exist\");\n// Intent mapIntent = new Intent(mContext, PickLocActivity.class);\n// mapIntent.putExtra(\"auto_loc\", true);\n// mContext.startActivityForResult(mapIntent, REQ_INPUT_LOC);\n// } else {\n //org.wowtalk.Log.w(\"google map not exist\");\n Intent mapIntent = new Intent(mContext, PickLocActivityWithAMap.class);\n mapIntent.putExtra(\"auto_loc\", true);\n mContext.startActivityForResult(mapIntent, REQ_INPUT_LOC);\n //}\n }", "void getlatlong(){\n if (ActivityCompat.checkSelfPermission(this, Manifest.permission.ACCESS_FINE_LOCATION) != PackageManager.PERMISSION_GRANTED && ActivityCompat.checkSelfPermission(this, Manifest.permission.ACCESS_COARSE_LOCATION) != PackageManager.PERMISSION_GRANTED) {\n if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {\n requestPermissions(new String[]{Manifest.permission.ACCESS_COARSE_LOCATION,Manifest.permission.ACCESS_FINE_LOCATION,Manifest.permission.INTERNET}\n ,10);\n }\n return;\n }\n // this code won't execute IF permissions are not allowed, because in the line above there is return statement.\n\n //noinspection MissingPermission\n locationManager.requestLocationUpdates(\"gps\", 0, 0, listener);\n\n }", "private void getDeviceLocation(){\n\n Log.d(TAG, \"getDeviceLocation: getting device current location\");\n mFusedLocationProviderClient = LocationServices.getFusedLocationProviderClient(this);\n try{\n if(mLocationPermissionGaranted){\n\n final Task location = mFusedLocationProviderClient.getLastLocation();\n location.addOnCompleteListener(task -> {\n if(task.isSuccessful()){\n Log.d(TAG, \"onComplete: found location!\");\n Location currentLocation = (Location) task.getResult();\n System.out.println(currentLocation);\n if (currentLocation !=null) {\n if (numDispositivo==1) {\n disp_Lat1 = Double.toString(currentLocation.getLatitude());\n disp_Long1 = Double.toString(currentLocation.getLongitude());\n }\n if (numDispositivo==2) {\n disp_Lat2 = Double.toString(currentLocation.getLatitude());\n disp_Long2 = Double.toString(currentLocation.getLongitude());\n }\n }\n System.out.println(disp_Lat1+\"-\"+disp_Long1);\n System.out.println(disp_Lat2+\"-\"+disp_Long2);\n Guardar();\n\n }else{\n Log.d(TAG, \"onComplete: current location is null\");\n Toast.makeText(FormularioCurso.this, \"unable to get current location\", Toast.LENGTH_SHORT).show();\n }\n });\n }\n }catch (SecurityException e){\n Log.e(TAG, \"getDeviceLocation: SecurityException: \" + e.getMessage() );\n }\n }", "private void detectUserLocation(){\n \ttimestamp = System.currentTimeMillis();\n \tmLocationManager = (LocationManager) getSystemService(Context.LOCATION_SERVICE);\n\t\tCriteria criteria = new Criteria();\n\t\tcriteria.setAccuracy(Criteria.ACCURACY_FINE);\n\t\tcriteria.setCostAllowed(false);\n\t\tcriteria.setAltitudeRequired(false);\n\t\tcriteria.setPowerRequirement(Criteria.POWER_MEDIUM);\n\t\tString providerName = mLocationManager.getBestProvider(criteria, true);\n\t\tLog.d(TAG,\"Provider selected based on given criteria: \"+providerName);\n\t\tif(providerName != null)\n\t\t\tmLocationManager.requestLocationUpdates(providerName, 10000, 10, this);\n\t\telse\n\t\t\tLog.w(TAG,\"No provider\");\n }", "@SuppressLint(\"MissingPermission\")\n private void Locate(){\n locationManager.requestLocationUpdates(LocationManager.GPS_PROVIDER, 2000, 0, (LocationListener) this);\n\n // Obtain the SupportMapFragment and get notified when the map is ready to be used.\n mapFragment = (SupportMapFragment) getSupportFragmentManager()\n .findFragmentById(R.id.map);\n\n //Initialize fused location\n client = LocationServices.getFusedLocationProviderClient(this);\n }", "public void startLocationDiscovery() {\n\t\t/*CountDownTimer gpsDelay = new CountDownTimer(\n\t\t\t\tcalculateNextInteraction(failedInteractions) * 60 * 1000, 1000) {\n\t\t\t\n\t\t\t@Override\n\t\t\tpublic void onTick(long arg0) {\n\t\t\t\t// TODO Auto-generated method stub\n\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t\t@Override\n\t\t\tpublic void onFinish() {\n\t\t\t\t// TODO Auto-generated method stub\n\t\t\t\t\n\t\t\t}\n\t\t};*/\n\t\tregisterLocationListener(locationListener);\n\t}", "private void getDeviceLocation( ) {\n\n if (searchLocationMarker != null) {\n searchLocationMarker.remove();\n }\n\n mFusedLocationProviderClient =\n LocationServices.getFusedLocationProviderClient(this);\n //Task locationResult = mFusedLocationProviderClient.getLastLocation();\n try {\n if (mLocationPermissionGranted) {\n Task locationResult = mFusedLocationProviderClient.getLastLocation();\n locationResult.addOnCompleteListener(this, new OnCompleteListener() {\n @Override\n public void onComplete(@NonNull Task task) {\n if (task.isSuccessful()) {\n // Set the map's camera position to the current location of the device.\n System.out.println(\"Current location retrieved successfully!\");\n mLastKnownLocation = (Location) task.getResult(); // location?\n mMap.moveCamera(CameraUpdateFactory.newLatLngZoom(\n new LatLng(mLastKnownLocation.getLatitude(),\n mLastKnownLocation.getLongitude()), DEFAULT_ZOOM));\n searchLocationMarker = mMap.addMarker(new MarkerOptions()\n .position(new LatLng(mLastKnownLocation.getLatitude(),\n mLastKnownLocation.getLongitude()))\n .title(\"Current Location\")\n .icon(BitmapDescriptorFactory.fromBitmap(\n getBitmapFromVectorDrawable(\n MainActivity.this, R.drawable.ic_current_location_marker))));\n getNearbyStations(mLastKnownLocation.getLatitude(), mLastKnownLocation.getLongitude());\n\n } else {\n Log.d(TAG, \"Current location is null. Using defaults.\");\n Log.e(TAG, \"Exception: %s\", task.getException());\n mMap.moveCamera(CameraUpdateFactory.newLatLngZoom(mDefaultLocation, DEFAULT_ZOOM));\n mMap.getUiSettings().setMyLocationButtonEnabled(false);\n searchLocationMarker = mMap.addMarker(new MarkerOptions()\n .position(mDefaultLocation)\n .title(\"Current Location\")\n .icon(BitmapDescriptorFactory.fromBitmap(\n getBitmapFromVectorDrawable(\n MainActivity.this, R.drawable.ic_current_location_marker))));\n }\n }\n });\n }\n } catch(SecurityException e) {\n Log.e(\"Exception: %s\", e.getMessage());\n }\n\n }", "public void setLocation(){\n //Check if user come from notification\n if (getIntent().hasExtra(EXTRA_PARAM_LAT) && getIntent().hasExtra(EXTRA_PARAM_LON)){\n Log.d(TAG, \"Proviene del servicio, lat: \" + getIntent().getExtras().getDouble(EXTRA_PARAM_LAT) + \" - lon: \" + getIntent().getExtras().getDouble(EXTRA_PARAM_LON));\n mMap.moveCamera(CameraUpdateFactory.newLatLngZoom(new LatLng(getIntent().getExtras().getDouble(EXTRA_PARAM_LAT), getIntent().getExtras().getDouble(EXTRA_PARAM_LON)), 18));\n NotificationManager mNM = (NotificationManager) getSystemService(NOTIFICATION_SERVICE);\n mNM.cancel(1);\n } else{\n if (bestLocation!=null){\n Log.d(TAG, \"Posicion actual -> LAT: \"+ bestLocation.getLatitude() + \" LON: \" + bestLocation.getLongitude());\n mMap.moveCamera(CameraUpdateFactory.newLatLngZoom(new LatLng(bestLocation.getLatitude(), bestLocation.getLongitude()), 16));\n } else{\n mMap.moveCamera(CameraUpdateFactory.newLatLngZoom(new LatLng(41.651981, -4.728561), 16));\n }\n }\n }", "private boolean getLocation() {\n LocationManager locationManager = (LocationManager) this.getSystemService(Context.LOCATION_SERVICE);\n\n // define listener responding to location updates\n LocationListener locationListener = new LocationListener() {\n public void onLocationChanged(Location location) {\n // new location is found by the network location provider\n }\n public void onStatusChanged(String provider, int status, Bundle extras) { }\n public void onProviderEnabled(String provider) { }\n public void onProviderDisabled(String provider) { }\n };\n\n // register listener with Location Manager to receive location updates\n if (ActivityCompat.checkSelfPermission(this, Manifest.permission.ACCESS_FINE_LOCATION) != PackageManager.PERMISSION_GRANTED && ActivityCompat.checkSelfPermission(this, Manifest.permission.ACCESS_COARSE_LOCATION) != PackageManager.PERMISSION_GRANTED) {\n Log.d(TAG, \"Location permission not granted\");\n requestLocationPermission();\n return false;\n }\n\n locationManager.requestLocationUpdates(LocationManager.NETWORK_PROVIDER, 0, 0, locationListener);\n String locationProvider = LocationManager.GPS_PROVIDER;\n Location lastKnownLocation = locationManager.getLastKnownLocation(locationProvider);\n\n // store values\n longitude = lastKnownLocation.getLongitude();\n latitude = lastKnownLocation.getLatitude();\n Log.d(TAG, \"Longitude: \" + longitude + \", Latitude: \" + latitude);\n\n return true;\n }", "private void startLocationUpdates() {\n settingsClient\n .checkLocationSettings(locationSettingsRequest)\n .addOnSuccessListener(this, new OnSuccessListener<LocationSettingsResponse>() {\n @SuppressLint(\"MissingPermission\")\n @Override\n public void onSuccess(LocationSettingsResponse locationSettingsResponse) {\n Log.i(TAG, \"All location settings are satisfied.\");\n\n //noinspection MissingPermission\n fusedLocationClient.requestLocationUpdates(locationRequest, locationCallback, Looper.myLooper());\n\n onLocationChange();\n }\n })\n .addOnFailureListener(this, new OnFailureListener() {\n @Override\n public void onFailure(@NonNull Exception e) {\n int statusCode = ((ApiException) e).getStatusCode();\n switch (statusCode) {\n case LocationSettingsStatusCodes.RESOLUTION_REQUIRED:\n Log.i(TAG, \"Location settings are not satisfied. Attempting to upgrade \" +\n \"location settings \");\n try {\n // Show the dialog by calling startResolutionForResult(), and check the\n // result in onActivityResult().\n ResolvableApiException rae = (ResolvableApiException) e;\n rae.startResolutionForResult(UserLocation.this, REQUEST_CODE);\n } catch (IntentSender.SendIntentException sie) {\n Log.i(TAG, \"PendingIntent unable to execute request.\");\n }\n break;\n case LocationSettingsStatusCodes.SETTINGS_CHANGE_UNAVAILABLE:\n String errorMessage = \"Location settings are inadequate, and cannot be \" +\n \"fixed here. Fix in Settings.\";\n Log.e(TAG, errorMessage);\n\n Toast.makeText(UserLocation.this, errorMessage, Toast.LENGTH_LONG).show();\n }\n\n onLocationChange();\n }\n });\n }", "protected void startLocationUpdates() {\n\t\tcontected();\n\t\tLocationServices.FusedLocationApi.requestLocationUpdates(\n\t\t\t\tmGoogleApiClient, mLocationRequest, (LocationListener)context);\n\t}", "@Override\n public void onReceiveLocation(BDLocation dbLocation) {\n if (dbLocation == null || mapView == null) {\n return;\n }\n //得到定位数据\n MyLocationData myLoationData = new MyLocationData.Builder()\n .accuracy(dbLocation.getRadius()) //设置精度\n .direction(dbLocation.getDirection()) //定位数据的方向信息\n .latitude(dbLocation.getLatitude())\n .longitude(dbLocation.getLongitude())\n .build();\n baiduMap.setMyLocationData(myLoationData);\n //如果是第一次登陆\n if (isFirstLoc) {\n isFirstLoc = false;\n LatLng latLng = new LatLng(dbLocation.getLatitude(), dbLocation.getLongitude());\n MapStatusUpdate mapStatusUpdate = MapStatusUpdateFactory.newLatLng(latLng);\n baiduMap.animateMapStatus(mapStatusUpdate);\n }\n Log.i(\"aaa\", \"-----\");\n showInfo(dbLocation);\n Log.i(\"aaa\", \"-----\");\n }", "private void checkLocationandAddToMap() {\n if (ActivityCompat.checkSelfPermission(getActivity(), android.Manifest.permission.ACCESS_FINE_LOCATION) != PackageManager.PERMISSION_GRANTED && ActivityCompat.checkSelfPermission(getActivity(), android.Manifest.permission.ACCESS_COARSE_LOCATION) != PackageManager.PERMISSION_GRANTED) {\n //Requesting the Location permission\n ActivityCompat.requestPermissions(getActivity(), new String[]{android.Manifest.permission.ACCESS_FINE_LOCATION}, LOCATION_REQUEST_CODE);\n return;\n }\n\n locationManager = (LocationManager) getActivity().getSystemService(LOCATION_SERVICE);\n criteria = new Criteria();\n bestProvider = locationManager.getBestProvider(criteria, true);\n\n\n //Fetching the last known location using the Fus\n Location location = locationManager.getLastKnownLocation(bestProvider);\n\n\n if (location != null) {\n\n onLocationChanged(location);\n\n\n } else {\n //This is what you need:\n locationManager.requestLocationUpdates(bestProvider, 1000, 0, (LocationListener) getActivity());\n }\n\n\n }", "void requestLocClick() {\n isRequest = true;\n mHasLocationData = false;\n if (mLocationClient != null && mLocationClient.isStarted()) {\n mLocationClient.requestLocation();\n Toast.makeText(getActivity(), \"Locating...\", Toast.LENGTH_SHORT).show();\n } else {\n Log.d(TAG, \"Location Client is not started...\");\n }\n }", "private void getDeviceLocation(){\n Log.d(TAG,\"get device location currently\");\n mFusedLocationProviderClient= LocationServices.getFusedLocationProviderClient(this);\n try{\n if(mLocationPermissionGranted){\n @SuppressLint(\"MissingPermission\") final Task location = mFusedLocationProviderClient.getLastLocation();\n location.addOnCompleteListener(new OnCompleteListener() {\n @Override\n public void onComplete(@NonNull Task task) {\n if(task.isSuccessful()){\n Log.d(TAG,\"onComplete: found Location\");\n mLastKnownLocation= (Location) task.getResult();\n moveCamera(new LatLng(mLastKnownLocation.getLatitude(),mLastKnownLocation.getLongitude()),DEFAULT_ZOOM);\n\n Geocoder geocoder;\n List<Address> addresses;\n geocoder = new Geocoder(MapsActivity.this, Locale.getDefault());\n\n try {\n addresses = geocoder.getFromLocation(mLastKnownLocation.getLatitude(), mLastKnownLocation.getLongitude(), 1); // Here 1 represent max location result to returned, by documents it recommended 1 to 5\n LatLng latLng = new LatLng(mLastKnownLocation.getLatitude(), mLastKnownLocation.getLongitude());\n\n address = addresses.get(0).getAddressLine(0); // If any additional address line present than only, check with max available address lines by getMaxAddressLineIndex()\n city = addresses.get(0).getLocality();\n state = addresses.get(0).getAdminArea();\n String country = addresses.get(0).getCountryName();\n postalCode = addresses.get(0).getPostalCode();\n String knownName = addresses.get(0).getFeatureName(); // Only\n MarkerOptions markerOptions = new MarkerOptions();\n markerOptions.position(latLng);\n markerOptions.title(address);\n mMap.clear();//Not sure\n mMap.addMarker(markerOptions);\n Marker here = mMap.addMarker(markerOptions.title(address + \", \" + city + \", \" + state + \", \" + country\n + \", \" + postalCode + \", \" + knownName));\n here.showInfoWindow();\n } catch (IOException e) {\n e.printStackTrace();\n } }else {\n Log.d(TAG, \"onComplete: current location is null\");\n Toast.makeText(MapsActivity.this, \"unable to get current location\",Toast.LENGTH_SHORT).show();\n getLocationPermission();\n }\n }\n });\n\n }\n }catch (SecurityException e){\n Log.e(TAG,\"getDeviceLocation: SecurityException: \" + e.getMessage() );\n }\n\n\n\n }", "private void getLastKnownLocation() {\n\n loc=LocationServices.FusedLocationApi.getLastLocation(client);\n\n if (loc != null) {\n Log.i(\"LOCATION: \",loc.toString());\n\n myCurrentLocationMarker= gMap.addMarker(new MarkerOptions()\n .position(new LatLng(loc.getLatitude(),loc.getLongitude()))\n .title(\"My Current Location\"));\n\n currentLocCircle= gMap.addCircle(new CircleOptions()\n .center(new LatLng(loc.getLatitude(),loc.getLongitude()))\n .radius(1000)\n .strokeColor(Color.GREEN)\n .fillColor(Color.LTGRAY));\n\n\n }\n else {\n\n AlertDialog.Builder builder= new AlertDialog.Builder(this);\n builder.setTitle(\"Location Service not Active\");\n builder.setMessage(\"Please enable location service (GPS)\");\n builder.setPositiveButton(\"Settings\", new DialogInterface.OnClickListener() {\n @Override\n public void onClick(DialogInterface dialog, int which) {\n startActivity(new Intent(Settings.ACTION_LOCATION_SOURCE_SETTINGS));\n }\n });\n Dialog dialog=builder.create();\n dialog.setCancelable(false);\n dialog.show();\n }\n }", "@Override\n public void onMapReady(GoogleMap googleMap) {\n mMap = googleMap;\n\n // Add a marker in Sydney and move the camera\n\n if (displayGpsStatus()) {\n\n Log.v(TAG, \"onClick\");\n\n\n locationListener = new MyLocationListener();\n\n if (ActivityCompat.checkSelfPermission(this, android.Manifest.permission.ACCESS_FINE_LOCATION) == PackageManager.PERMISSION_GRANTED ) {\n locationMangaer.requestLocationUpdates(LocationManager.NETWORK_PROVIDER, 0, 0, locationListener);\n\n }\n else{\n Toast.makeText(this,\"Kindly Provide Location Acces\",Toast.LENGTH_SHORT).show();\n }\n\n Log.v(TAG,latitudeUsers +\" , \"+longitudeUsers);\n\n } else {\n Toast.makeText(this,\"GPS not available!!\",Toast.LENGTH_SHORT).show();\n }\n\n }", "public void checkForLocationSettings() {\n try {\n LocationSettingsRequest settingsRequest = new LocationSettingsRequest.Builder()\n .addLocationRequest(mLocationRequest).build();\n SettingsClient settingsClient = LocationServices.getSettingsClient(context);\n\n Task<LocationSettingsResponse> task = settingsClient\n .checkLocationSettings(settingsRequest);\n task.addOnSuccessListener(context, new OnSuccessListener<LocationSettingsResponse>() {\n @Override\n public void onSuccess(LocationSettingsResponse locationSettingsResponse) {\n //Setting is success...\n PrintLog.d(TAG, \"LocationSettingsStatusCodes ..............: \" + locationSettingsResponse.getLocationSettingsStates());\n // All location settings are satisfied. The client can initialize location requests here\n getLastLocation();\n }\n }).addOnFailureListener(context, new OnFailureListener() {\n @Override\n public void onFailure(@NonNull Exception e) {\n int statusCode = ((ApiException) e).getStatusCode();\n switch (statusCode) {\n case LocationSettingsStatusCodes.RESOLUTION_REQUIRED:\n PrintLog.d(TAG, \"dialogue open settings ..............: \");\n try {\n ResolvableApiException rae = (ResolvableApiException) e;\n rae.startResolutionForResult(context, REQUEST_CHECK_SETTINGS);\n } catch (IntentSender.SendIntentException sie) {\n sie.printStackTrace();\n }\n break;\n case LocationSettingsStatusCodes.SETTINGS_CHANGE_UNAVAILABLE:\n Toast.makeText(context, \"Setting change is not available.Try in another device.\", Toast.LENGTH_LONG).show();\n }\n\n }\n });\n\n } catch (Exception ex) {\n ex.printStackTrace();\n }\n }", "private void startLocationUpdates() {\r\n try {\r\n TimeUnit.SECONDS.sleep(3);\r\n } catch (InterruptedException e) {\r\n e.printStackTrace();\r\n }\r\n mFusedLocationClient.requestLocationUpdates(getLocationRequest(), mLocationCallback, Looper.getMainLooper());\r\n mMap.setMyLocationEnabled(true);\r\n }", "private void askPermissionsAndShowMyLocation() {\n boolean isGPSEnabled = false;\n // flag for network status\n boolean isNetworkEnabled = false;\n // flag for GPS status\n boolean canGetLocation = false;\n LocationManager locationManager;\n\n locationManager = (LocationManager) getSystemService(LOCATION_SERVICE);\n\n // getting GPS status\n isGPSEnabled = locationManager.isProviderEnabled(LocationManager.GPS_PROVIDER);\n\n // getting network status\n isNetworkEnabled = locationManager.isProviderEnabled(LocationManager.NETWORK_PROVIDER);\n if (Build.VERSION.SDK_INT >= 23) {\n // flag for GPS status\n if (!isGPSEnabled && !isNetworkEnabled) {\n// no network provider is enabled\n final Intent data = new Intent();\n data.putExtra(\"latitude\", latitude);\n data.putExtra(\"longitude\", longitude);\n\n setResult(Activity.RESULT_CANCELED, data);\n finish();\n } else {\n// if (accessCoarsePermission != PackageManager.PERMISSION_GRANTED\n// || accessFinePermission != PackageManager.PERMISSION_GRANTED)\n\n if (ActivityCompat.checkSelfPermission(this, Manifest.permission.ACCESS_FINE_LOCATION) != PackageManager.PERMISSION_GRANTED &&\n ActivityCompat.checkSelfPermission(this, Manifest.permission.ACCESS_COARSE_LOCATION) != PackageManager.PERMISSION_GRANTED) {\n // The Permissions to ask user.\n String[] permissions = new String[]{Manifest.permission.ACCESS_COARSE_LOCATION,\n Manifest.permission.ACCESS_FINE_LOCATION};\n // Show a dialog asking the user to allow the above permissions.\n ActivityCompat.requestPermissions(this, permissions,\n REQUEST_ID_ACCESS_COURSE_FINE_LOCATION);\n\n return;\n }\n this.showMyLocation();\n }\n\n } else {\n if (!isGPSEnabled && !isNetworkEnabled) {\n// no network provider is enabled\n final Intent data = new Intent();\n data.putExtra(\"latitude\", latitude);\n data.putExtra(\"longitude\", longitude);\n\n setResult(Activity.RESULT_CANCELED, data);\n finish();\n } else {\n this.showMyLocation();\n }\n\n\n }\n // Show current location on Map.\n }", "private void getLocation() {\n\t\tif (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {\n\t\t\tif (checkSelfPermission(Manifest.permission.ACCESS_FINE_LOCATION) != PackageManager.PERMISSION_GRANTED) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\n\t\t\n\t\tFusedLocationProviderClient locationProviderClient = LocationServices.getFusedLocationProviderClient(getApplicationContext());\n\t\tlocationProviderClient.getLastLocation().addOnSuccessListener(new OnSuccessListener<Location>() {\n\t\t\t@Override\n\t\t\tpublic void onSuccess(Location location) {\n\t\t\t\t\n\t\t\t\tfinal Location finalLocation = location;\n\t\t\t\t\n\t\t\t\tbtnGoToYou.setOnClickListener(new View.OnClickListener() {\n\t\t\t\t\t@Override\n\t\t\t\t\tpublic void onClick(View v) {\n\t\t\t\t\t\tLatLng userLocation = new LatLng(finalLocation.getLatitude(), finalLocation.getLongitude());\n\t\t\t\t\t\tmMap.addMarker(new MarkerOptions().position(userLocation).title(\"You are Here!\"));\n\t\t\t\t\t\tmMap.moveCamera(CameraUpdateFactory.newLatLng(userLocation));\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t\t\n\t\t\t\t\n\t\t\t}\n\t\t});\n\t\t\n\t}", "private void startLocationService() {\n\t\tmLocationMngr = (LocationManager) this\r\n\t\t\t\t.getSystemService(Context.LOCATION_SERVICE);\r\n\r\n\t\tmGpsListener = new GPSListener();\r\n\t\tlong minTime = 10000;\r\n\t\tfloat minDistance = 0;\r\n\r\n\t\tmLocationMngr.requestLocationUpdates(LocationManager.GPS_PROVIDER,\r\n\t\t\t\tminTime, minDistance, mGpsListener);\r\n\t\tmLocationMngr.requestLocationUpdates(LocationManager.NETWORK_PROVIDER,\r\n\t\t\t\tminTime, minDistance, mGpsListener);\r\n\r\n\t\ttry {\r\n\t\t\tLocation lastLocation = mLocationMngr\r\n\t\t\t\t\t.getLastKnownLocation(LocationManager.GPS_PROVIDER);\r\n\t\t\tif (lastLocation != null) {\r\n\t\t\t\tDouble latitude = lastLocation.getLatitude();\r\n\t\t\t\tDouble longitude = lastLocation.getLongitude();\r\n\t\t\t\tString msg = \"Your Current Location \\nLatitude: \" + latitude\r\n\t\t\t\t\t\t+ \", Longitude: \" + longitude;\r\n\t\t\t\tLog.i(TAG, msg);\r\n\t\t\t\t// this.showToastMsg(msg);\r\n\t\t\t\tshowCurrentLocation(latitude, longitude);\r\n\t\t\t}\r\n\t\t} catch (Exception e) {\r\n\t\t\tString msg = \"Failed to get current location. Please try later.\";\r\n\t\t\tLog.e(TAG, msg);\r\n\t\t\tshowToastMsg(msg);\r\n\t\t}\r\n\r\n\t}" ]
[ "0.7541306", "0.73979753", "0.71591675", "0.7154587", "0.70012677", "0.69299495", "0.6904219", "0.686761", "0.67851293", "0.6757525", "0.674305", "0.67262983", "0.67246675", "0.67233324", "0.6713415", "0.6695457", "0.66828024", "0.6675027", "0.6669233", "0.66557187", "0.6651652", "0.664152", "0.664152", "0.66373324", "0.66364974", "0.66197336", "0.6613651", "0.660688", "0.66045225", "0.6588466", "0.65857524", "0.6570941", "0.6569231", "0.65603894", "0.65494686", "0.6541749", "0.6541397", "0.6531533", "0.65294814", "0.65186536", "0.6511836", "0.65066725", "0.65039027", "0.6494053", "0.6491707", "0.648492", "0.6472181", "0.64668906", "0.6462819", "0.6461703", "0.6461125", "0.64477015", "0.6426147", "0.64241976", "0.64178437", "0.64173704", "0.64163136", "0.6415547", "0.6385321", "0.63840735", "0.63816786", "0.63764644", "0.6372725", "0.6368996", "0.6368522", "0.6368009", "0.6364296", "0.63539094", "0.63527805", "0.63497216", "0.63495785", "0.63427573", "0.63399035", "0.63319147", "0.63308656", "0.63020915", "0.6299237", "0.62966174", "0.62965745", "0.6292711", "0.62910455", "0.62868506", "0.62867683", "0.6281684", "0.6279749", "0.62742585", "0.626838", "0.62590015", "0.6254375", "0.6249727", "0.6234141", "0.6234096", "0.6225224", "0.62247247", "0.6220157", "0.6218121", "0.62155986", "0.6212474", "0.62118024", "0.6207632" ]
0.69762534
5
/ Checks the manifest to make sure the user has okay'd the use of gps if not the user will be prompted to make that change then the location manager will fire the request location updates without the call to request location updates location will not be updated
private void configLoc(){ System.out.println("Configuring location"); // first check for permissions if (ActivityCompat.checkSelfPermission(this, Manifest.permission.ACCESS_FINE_LOCATION) != PackageManager.PERMISSION_GRANTED && ActivityCompat.checkSelfPermission(this, Manifest.permission.ACCESS_COARSE_LOCATION) != PackageManager.PERMISSION_GRANTED) { if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) { requestPermissions(new String[]{Manifest.permission.ACCESS_COARSE_LOCATION, Manifest.permission.ACCESS_FINE_LOCATION, Manifest.permission.INTERNET} , 10); } return; } locationManager.requestLocationUpdates("gps",5000,0,locationListener); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private void startLocationUpdates() {\r\n // Begin by checking if the device has the necessary location settings.\r\n mSettingsClient.checkLocationSettings(mLocationSettingsRequest)\r\n .addOnSuccessListener(this, new OnSuccessListener<LocationSettingsResponse>() {\r\n @Override\r\n public void onSuccess(LocationSettingsResponse locationSettingsResponse) {\r\n Log.i(TAG, \"All location settings are satisfied.\");\r\n\r\n if(checkPermissions()){\r\n // Launch background service - Monitor location\r\n Log.i(TAG, \"trying to start location service..\");\r\n startService(new Intent(MainActivity.this, LocationService.class));\r\n\r\n // Launch background service - Geofence\r\n if(localUser.isGeofenceEnabled()){\r\n Log.i(TAG, \"trying to start geofence service..\");\r\n startService(new Intent(MainActivity.this, GeofenceService.class));\r\n }\r\n } else{\r\n requestPermissions();\r\n }\r\n\r\n\r\n\r\n }\r\n })\r\n .addOnFailureListener(this, new OnFailureListener() {\r\n @Override\r\n public void onFailure(@NonNull Exception e) {\r\n int statusCode = ((ApiException) e).getStatusCode();\r\n switch (statusCode) {\r\n case LocationSettingsStatusCodes.RESOLUTION_REQUIRED:\r\n Log.i(TAG, \"Location settings are not satisfied. Attempting to upgrade \" +\r\n \"location settings \");\r\n try {\r\n // Show the dialog by calling startResolutionForResult(), and check the\r\n // result in onActivityResult().\r\n ResolvableApiException rae = (ResolvableApiException) e;\r\n rae.startResolutionForResult(MainActivity.this, REQUEST_CHECK_SETTINGS);\r\n } catch (IntentSender.SendIntentException sie) {\r\n Log.i(TAG, \"PendingIntent unable to execute request.\");\r\n }\r\n break;\r\n case LocationSettingsStatusCodes.SETTINGS_CHANGE_UNAVAILABLE:\r\n String errorMessage = \"Location settings are inadequate, and cannot be \" +\r\n \"fixed here. Fix in Settings.\";\r\n Log.e(TAG, errorMessage);\r\n Toast.makeText(MainActivity.this, errorMessage, Toast.LENGTH_LONG).show();\r\n mRequestingLocationUpdates = false;\r\n }\r\n\r\n }\r\n });\r\n }", "@SuppressLint(\"MissingPermission\")\n private void requestLocationUpdate() {\n }", "protected void gpsCheck() {\n GoogleApiClient googleApiClient = new GoogleApiClient.Builder(MapsActivity.this).addApi(LocationServices.API).build();\n googleApiClient.connect();\n\n LocationRequest locationRequest = LocationRequest.create();\n locationRequest.setPriority(LocationRequest.PRIORITY_HIGH_ACCURACY);\n\n LocationSettingsRequest.Builder builder = new LocationSettingsRequest.Builder().addLocationRequest(locationRequest);\n builder.setAlwaysShow(true);\n\n PendingResult<LocationSettingsResult> result = LocationServices.SettingsApi.checkLocationSettings(googleApiClient, builder.build());\n result.setResultCallback(new ResultCallback<LocationSettingsResult>() {\n @Override\n public void onResult(@NonNull LocationSettingsResult result) {\n final Status status = result.getStatus();\n switch (status.getStatusCode()) {\n case LocationSettingsStatusCodes.SUCCESS:\n Log.i(TAG, \"All location settings are satisfied.\");\n break;\n case LocationSettingsStatusCodes.RESOLUTION_REQUIRED:\n Log.i(TAG, \"Location settings are not satisfied. Show the user a dialog to upgrade location settings \");\n try {\n // Show the dialog by calling startResolutionForResult(), and check the result\n // in onActivityResult().\n status.startResolutionForResult(MapsActivity.this, REQUEST_CHECK_SETTINGS);\n } catch (IntentSender.SendIntentException e) {\n Log.i(TAG, \"PendingIntent unable to execute request.\");\n }\n break;\n case LocationSettingsStatusCodes.SETTINGS_CHANGE_UNAVAILABLE:\n Log.i(TAG, \"Location settings are inadequate, and cannot be fixed here. Dialog not created.\");\n break;\n }\n }\n });\n }", "public void checkLocationPermission() {\n try {\n if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {\n if (checkPermission(Manifest.permission.ACCESS_FINE_LOCATION, getActivity(), getActivity())) {\n if (checkPermission(Manifest.permission.ACCESS_COARSE_LOCATION, getActivity(), getActivity())) {\n gpsTracker.getLocation();\n } else {\n requestPermission(android.Manifest.permission.ACCESS_COARSE_LOCATION, PERMISSION_REQUEST_CODE_LOCATION, getActivity().getApplicationContext(),\n getActivity());\n }\n } else {\n requestPermission(android.Manifest.permission.ACCESS_FINE_LOCATION, PERMISSION_REQUEST_CODE_LOCATION, getActivity().getApplicationContext(),\n getActivity());\n }\n } else {\n gpsTracker.getLocation();\n }\n } catch (Exception e) {\n // logException(e, \"GpsMapManualFragment_checkLocationPermission()\");\n }\n\n\n }", "protected void startLocationUpdates() {\n\n if (ActivityCompat.checkSelfPermission(getActivity(), Manifest.permission.ACCESS_FINE_LOCATION) != PackageManager.PERMISSION_GRANTED && ActivityCompat.checkSelfPermission(getActivity(), Manifest.permission.ACCESS_COARSE_LOCATION) != PackageManager.PERMISSION_GRANTED) {\n /*if (shouldShowRequestPermissionRationale(\n Manifest.permission.ACCESS_FINE_LOCATION)) {\n showExplanationDialog(new DialogInterface.OnClickListener() {\n @Override\n public void onClick(DialogInterface dialog, int which) {\n requestPermissions(\n new String[]{ Manifest.permission.ACCESS_FINE_LOCATION, Manifest.permission.ACCESS_COARSE_LOCATION},\n PERMISSIONS_REQUEST_ACCESS_FINE_LOCATION);\n }\n });\n } else {\n requestPermissions(\n new String[]{ Manifest.permission.ACCESS_FINE_LOCATION, Manifest.permission.ACCESS_COARSE_LOCATION},\n PERMISSIONS_REQUEST_ACCESS_FINE_LOCATION);\n }*/\n } else {\n if (mGoogleApiClient.isConnected()) {\n LocationServices.FusedLocationApi.requestLocationUpdates(\n mGoogleApiClient, mLocationRequest, this);\n mRequestingLocationUpdates = true;\n Fog.d(TAG, \"requestedLocationUpdates\");\n }\n }\n }", "private void checkLocationPermission() {\n\n if(ContextCompat.checkSelfPermission(this, Manifest.permission.ACCESS_FINE_LOCATION)\n != PackageManager.PERMISSION_GRANTED){\n //location permission required\n ActivityCompat.requestPermissions(this, new String[]\n {Manifest.permission.ACCESS_FINE_LOCATION}, PERMISSION_FINE_LOCATION);\n\n }else{\n //location already granted\n checkCoarseAddress();\n }\n }", "private void startLocationUpdates() {\n mSettingsClient.checkLocationSettings(mLocationSettingsRequest).\n addOnSuccessListener(this, new OnSuccessListener<LocationSettingsResponse>() {\n @Override\n public void onSuccess(LocationSettingsResponse locationSettingsResponse) {\n Log.e(TAG, \"All location settings are satisfied.\");\n\n //noinspection MissingPermission\n mFusedLocationClient.requestLocationUpdates(mLocationBalancedRequest,\n mLocationCallback, Looper.myLooper());\n\n updateLocationUI();\n }\n })\n .addOnFailureListener(this, new OnFailureListener() {\n @Override\n public void onFailure(@NonNull Exception e) {\n int statusCode = ((ApiException) e).getStatusCode();\n switch (statusCode) {\n case LocationSettingsStatusCodes.RESOLUTION_REQUIRED:\n Log.e(TAG, \"Location settings are not satisfied. Attempting to upgrade \" +\n \"location settings \");\n try {\n // Show the dialog by calling startResolutionForResult(), and check the\n // result in onActivityResult().\n ResolvableApiException rae = (ResolvableApiException) e;\n rae.startResolutionForResult(MainActivity.this, REQUEST_CHECK_SETTINGS);\n } catch (IntentSender.SendIntentException sie) {\n Log.e(TAG, \"PendingIntent unable to execute request.\");\n }\n break;\n case LocationSettingsStatusCodes.SETTINGS_CHANGE_UNAVAILABLE:\n String errorMessage = \"Location settings are inadequate, and cannot be \" +\n \"fixed here. Fix in Settings.\";\n Log.e(TAG, errorMessage);\n Toast.makeText(MainActivity.this, errorMessage, Toast.LENGTH_LONG).show();\n mRequestingLocationUpdates = false;\n }\n updateLocationUI();\n }\n });\n\n }", "private void getLocation() {\n if (ActivityCompat.checkSelfPermission(getActivity(), Manifest.permission.ACCESS_FINE_LOCATION)\n != PackageManager.PERMISSION_GRANTED && ActivityCompat.checkSelfPermission(getActivity(), Manifest.permission.ACCESS_COARSE_LOCATION) != PackageManager.PERMISSION_GRANTED) {\n if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {\n requestPermissions(new String[]{Manifest.permission.ACCESS_COARSE_LOCATION, Manifest.permission.ACCESS_FINE_LOCATION, Manifest.permission.INTERNET}\n , 10);\n }\n return;\n }\n\n //Update location\n locationManager.requestLocationUpdates(\"gps\", 5000, 0, listener);\n }", "void configure_button(){\n if (ActivityCompat.checkSelfPermission(this, Manifest.permission.ACCESS_FINE_LOCATION) != PackageManager.PERMISSION_GRANTED && ActivityCompat.checkSelfPermission(this, Manifest.permission.ACCESS_COARSE_LOCATION) != PackageManager.PERMISSION_GRANTED) {\n if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {\n requestPermissions(new String[]{Manifest.permission.ACCESS_COARSE_LOCATION,Manifest.permission.ACCESS_FINE_LOCATION,Manifest.permission.INTERNET}\n ,10);\n }\n\n return;\n }\n // this code won't execute IF permissions are not allowed, because in the line above there is return statement.\n\n locationManager.requestLocationUpdates(\"gps\", 5000, 0, listener);\n\n }", "public void checkLocationPermission() {\n if (ContextCompat.checkSelfPermission(this,\n Manifest.permission.ACCESS_FINE_LOCATION)\n != PackageManager.PERMISSION_GRANTED) {\n ActivityCompat.requestPermissions(this,\n new String[]{Manifest.permission.ACCESS_FINE_LOCATION},\n 99);\n }\n\n }", "private void requestLocationPermission() {\n if (ActivityCompat.shouldShowRequestPermissionRationale(this,\n Manifest.permission.ACCESS_FINE_LOCATION)) {\n\n new AlertDialog.Builder(this)\n .setTitle(\"Permission needed\")\n .setMessage(\"Location Permission is needed to show your current location on the map\")\n .setPositiveButton(\"OK\", new DialogInterface.OnClickListener() {\n @Override\n public void onClick(DialogInterface dialog, int which) {\n ActivityCompat.requestPermissions(ScavengerHunt.this,\n new String[]{Manifest.permission.ACCESS_FINE_LOCATION}, 2);\n }\n })\n .setNegativeButton(\"Cancel\", new DialogInterface.OnClickListener() {\n @Override\n public void onClick(DialogInterface dialog, int which) {\n dialog.dismiss();\n Toast.makeText(ScavengerHunt.this, \"Location Permission is needed to update the map\", Toast.LENGTH_SHORT).show();\n }\n })\n .create()\n .show();\n\n } else {\n ActivityCompat.requestPermissions(this,\n new String[]{Manifest.permission.ACCESS_FINE_LOCATION}, 2);\n }\n }", "private void requestLocationUpdates(){\n if(googleApiClient.isConnected()){\n try{\n setLocationRequest();\n LocationServices.FusedLocationApi.requestLocationUpdates(googleApiClient, locationRequest, this);\n } catch (SecurityException ex) {\n Log.e(TAG, \"requestLocationUpdates: no permissions\", ex);\n }\n }\n }", "private void updateGPS() {\n fusedLocationProviderClient = LocationServices.getFusedLocationProviderClient(Location.this);\n\n if (ActivityCompat.checkSelfPermission(this, Manifest.permission.ACCESS_FINE_LOCATION) == PackageManager.PERMISSION_GRANTED) {\n fusedLocationProviderClient.getLastLocation().addOnSuccessListener(this, new OnSuccessListener<android.location.Location>() {\n @Override\n public void onSuccess(android.location.Location location) {\n updateUI(location);\n }\n });\n } else {\n //permission not granted, we will ask for it\n if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {\n requestPermissions(new String[]{Manifest.permission.ACCESS_FINE_LOCATION}, 99);\n }\n }\n }", "private void registerForGPS() {\n Log.d(NAMAZ_LOG_TAG, \"registerForGPS:\");\n Criteria criteria = new Criteria();\n criteria.setAccuracy(Criteria.ACCURACY_COARSE);\n criteria.setPowerRequirement(Criteria.POWER_LOW);\n criteria.setAltitudeRequired(false);\n criteria.setBearingRequired(false);\n criteria.setSpeedRequired(false);\n criteria.setCostAllowed(true);\n LocationManager locationManager = ((LocationManager) getSystemService(Context.LOCATION_SERVICE));\n String provider = locationManager.getBestProvider(criteria, true);\n\n if(!isLocationEnabled()) {\n showDialog(\"Location Access\", getResources().getString(R.string.location_enable), \"Enable Location\", \"Cancel\", 1);\n } else {\n ActivityCompat.requestPermissions(QiblaDirectionActivity.this,\n new String[]{Manifest.permission. ACCESS_FINE_LOCATION},\n MY_PERMISSIONS_REQUEST_LOCATION);\n }\n\n /* if (provider != null) {\n locationManager.requestLocationUpdates(provider, MIN_LOCATION_TIME,\n MIN_LOCATION_DISTANCE, qiblaManager);\n }\n locationManager.requestLocationUpdates(LocationManager.GPS_PROVIDER,\n MIN_LOCATION_TIME, MIN_LOCATION_DISTANCE, qiblaManager);\n locationManager.requestLocationUpdates(\n LocationManager.NETWORK_PROVIDER, MIN_LOCATION_TIME,\n MIN_LOCATION_DISTANCE, qiblaManager);*/\n /*Location location = locationManager\n .getLastKnownLocation(LocationManager.GPS_PROVIDER);\n if (location == null) {\n location = ((LocationManager) getSystemService(Context.LOCATION_SERVICE))\n .getLastKnownLocation(LocationManager.GPS_PROVIDER);\n }*/\n\n }", "private void startLocationUpdates() {\n mSettingsClient.checkLocationSettings(mLocationSettingsRequest)\n .addOnSuccessListener(this, new OnSuccessListener<LocationSettingsResponse>() {\n @Override\n public void onSuccess(LocationSettingsResponse locationSettingsResponse) {\n Log.i(TAG, \"All location settings are satisfied.\");\n\n //noinspection MissingPermission\n if (ActivityCompat.checkSelfPermission(ChooseParty.this, Manifest.permission.ACCESS_FINE_LOCATION) != PackageManager.PERMISSION_GRANTED && ActivityCompat.checkSelfPermission(ChooseParty.this, Manifest.permission.ACCESS_COARSE_LOCATION) != PackageManager.PERMISSION_GRANTED) {\n ActivityCompat.requestPermissions(ChooseParty.this,\n new String[]{Manifest.permission.ACCESS_FINE_LOCATION},\n REQUEST_PERMISSIONS_REQUEST_CODE);\n }\n mFusedLocationClient.requestLocationUpdates(mLocationRequest,\n mLocationCallback, Looper.myLooper());\n\n }\n })\n .addOnFailureListener(this, new OnFailureListener() {\n @Override\n public void onFailure(@NonNull Exception e) {\n int statusCode = ((ApiException) e).getStatusCode();\n switch (statusCode) {\n case LocationSettingsStatusCodes.RESOLUTION_REQUIRED:\n Log.i(TAG, \"Location settings are not satisfied. Attempting to upgrade \" +\n \"location settings \");\n try {\n // Show the dialog by calling startResolutionForResult(), and check the\n // result in onActivityResult().\n ResolvableApiException rae = (ResolvableApiException) e;\n rae.startResolutionForResult(ChooseParty.this, REQUEST_CHECK_SETTINGS);\n } catch (IntentSender.SendIntentException sie) {\n Log.i(TAG, \"PendingIntent unable to execute request.\");\n }\n break;\n case LocationSettingsStatusCodes.SETTINGS_CHANGE_UNAVAILABLE:\n String errorMessage = \"Location settings are inadequate, and cannot be \" +\n \"fixed here. Fix in Settings.\";\n Log.e(TAG, errorMessage);\n Toast.makeText(ChooseParty.this, errorMessage, Toast.LENGTH_LONG).show();\n mRequestingLocationUpdates = false;\n }\n }\n });\n }", "private void askForLocationPermission() {\n if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {\n //this code will be executed on devices running on DONUT (NOT ICS) or later\n askForPermission(Manifest.permission.ACCESS_FINE_LOCATION, Extra.LOCATION);\n }\n }", "private void getLocation() {\n if(ContextCompat.checkSelfPermission(this,Manifest.permission.ACCESS_FINE_LOCATION)\n != PackageManager.PERMISSION_GRANTED){\n if(ActivityCompat.shouldShowRequestPermissionRationale(this, Manifest.permission.ACCESS_FINE_LOCATION)){\n new AlertDialog.Builder(this)\n .setTitle(\"Location Permission Required\")\n .setMessage(\"This app needs permission to use your location\")\n .setPositiveButton(\"OK\", new DialogInterface.OnClickListener() {\n @Override\n public void onClick(DialogInterface dialog, int which) {\n ActivityCompat.requestPermissions(RestaurantsActivity.this, new String[]{Manifest.permission.ACCESS_FINE_LOCATION},\n MY_PERMISSIONS_LOCATIONS);\n }\n })\n .create()\n .show();\n } else {\n ActivityCompat.requestPermissions(this,\n new String[]{Manifest.permission.ACCESS_FINE_LOCATION},\n MY_PERMISSIONS_LOCATIONS);\n }\n }\n }", "private void enableRequestLocationUpdate() {\n mLocationManager = (LocationManager) getSystemService(LOCATION_SERVICE);\n if (ActivityCompat.checkSelfPermission(this, Manifest.permission.ACCESS_FINE_LOCATION) != PackageManager.PERMISSION_GRANTED && ActivityCompat.checkSelfPermission(this, Manifest.permission.ACCESS_COARSE_LOCATION) != PackageManager.PERMISSION_GRANTED) {\n return;\n }\n mLocationManager.requestLocationUpdates(LocationManager.GPS_PROVIDER,\n 1000 * 10, 10, mLocationListener);\n mLocationManager.requestLocationUpdates(\n LocationManager.NETWORK_PROVIDER, 1000 * 10, 10,\n mLocationListener);\n }", "public void requestLocationPermision(){\n\n // Forma de actuar diferente si la versión del dispositivo en Marshmallow\n if (android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.M) {\n Log.d(TAG, \"Versión 23\");\n if (ContextCompat.checkSelfPermission(this, Manifest.permission.ACCESS_FINE_LOCATION) != PackageManager.PERMISSION_GRANTED) {\n //Si no tenemos permiso, lo pedimos\n\n if (ActivityCompat.shouldShowRequestPermissionRationale(this, Manifest.permission.ACCESS_FINE_LOCATION)) {\n // Show an expanation to the user *asynchronously* -- don't block\n // this thread waiting for the user's response! After the user\n // sees the explanation, try again to request the permission.\n Log.d(TAG, \"Show an expanation\");\n new AlertDialog.Builder(this)\n .setMessage(getString(R.string.show_explanation))\n .setPositiveButton(\"Ok\", new DialogInterface.OnClickListener() {\n @Override\n public void onClick(DialogInterface dialog, int which) {\n if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {\n requestPermissions(new String[] {Manifest.permission.ACCESS_FINE_LOCATION},\n REQUEST_CODE_ASK_PERMISSIONS);\n }\n }\n })\n .create()\n .show();\n\n } else{\n ActivityCompat.requestPermissions(this, new String[]{Manifest.permission.ACCESS_FINE_LOCATION}, REQUEST_CODE_ASK_PERMISSIONS);\n }\n } else{\n Log.d(TAG, \"Tenemos permiso\");\n\n String provider = Settings.Secure.getString(getContentResolver(), Settings.Secure.LOCATION_PROVIDERS_ALLOWED);\n if (!provider.contains(\"gps\")) {\n //Si el GPS no esta activo, pedimos su iniciación\n AlertNoGps();\n }\n\n //Inicializacion de los providers\n for (String s : locationManager.getAllProviders()) {\n int minDistance = 2;\n int checkInterval = 2;\n locationManager.requestLocationUpdates(s, checkInterval,\n minDistance, this);\n Location actualLocation = locationManager.getLastKnownLocation(s);\n //Comprobamos si es una mejor localización\n if (actualLocation!=null){\n if (isBetterLocation(actualLocation)){\n Log.d(TAG, \"Mejor localización -> \" + s + \" - \"+ actualLocation);\n bestLocation = actualLocation;\n }\n }\n }\n\n mMap.setMyLocationEnabled(true);\n setLocation();\n }\n } else{\n //Comprobacion de permisos\n if (ContextCompat.checkSelfPermission(this, Manifest.permission.ACCESS_FINE_LOCATION) == PackageManager.PERMISSION_GRANTED) {\n Log.d(TAG, \"Tenemos permiso\");\n\n String provider = Settings.Secure.getString(getContentResolver(), Settings.Secure.LOCATION_PROVIDERS_ALLOWED);\n\n if (!provider.contains(\"gps\")) {\n //Si el GPS no esta activo, pedimos su iniciación\n AlertNoGps();\n }\n\n //Inicializacion de los providers\n for (String s : locationManager.getAllProviders()) {\n int minDistance = 2;\n int checkInterval = 2;\n locationManager.requestLocationUpdates(s, checkInterval,\n minDistance, this);\n Location actualLocation = locationManager.getLastKnownLocation(s);\n if (actualLocation!=null){\n if (isBetterLocation(actualLocation)){\n Log.d(TAG, \"Mejor localización -> \" + s + \" - \"+ actualLocation);\n bestLocation = actualLocation;\n }\n }\n }\n\n mMap.setMyLocationEnabled(true);\n setLocation();\n }\n }\n\n }", "private void setLocationUpdateFunction() {\n fabLocation.setOnClickListener(new View.OnClickListener() {\n @Override\n public void onClick(View v) {\n //create boolean isGPSEnabled equal to result returned from isProviderEnabled() method, sending locationManager.GPS_PROVIDER as paremeter\n boolean isGPSEnabled = locationManager.isProviderEnabled(locationManager.GPS_PROVIDER);\n //create boolean isNetworkEnabled equal to result returned from isProviderEnabled() method, sending locationManager.NETWORK_PROVIDER as paremeter\n boolean isNetworkEnabled = locationManager.isProviderEnabled(locationManager.NETWORK_PROVIDER);\n\n //if statement to determine if both booleans are false\n if (!isGPSEnabled && !isNetworkEnabled && ActivityCompat.checkSelfPermission(MainActivity.this, Manifest.permission_group.LOCATION) != PackageManager.PERMISSION_GRANTED) {\n //toast message to tell the user that network and location are not available/enabled\n Toast.makeText(MainActivity.this, \"Network and Location not Available\", Toast.LENGTH_LONG).show();\n return;\n } else {\n //create Criteria object critera\n Criteria criteria = new Criteria();\n\n //string provider equal to value returned from method\n String provider = locationManager.getBestProvider(criteria, true);\n\n fabLocation.setClickable(false);\n\n //call locationupdater\n locationManager.requestLocationUpdates(provider, 0, 0, locationListener);\n }\n }\n });\n }", "private void locationPermission() {\n if(Build.VERSION.SDK_INT<23){\n locationPermission = true;\n startService(new Intent(this, LocationService.class));\n }else{\n if(checkSelfPermission(Manifest.permission.ACCESS_COARSE_LOCATION) == PackageManager.PERMISSION_GRANTED\n && checkSelfPermission(Manifest.permission.ACCESS_FINE_LOCATION) == PackageManager.PERMISSION_GRANTED){\n locationPermission = true;\n startService(new Intent(this, LocationService.class));\n return;\n }\n\n if(shouldShowRequestPermissionRationale(Manifest.permission.ACCESS_COARSE_LOCATION) && shouldShowRequestPermissionRationale(Manifest.permission.ACCESS_FINE_LOCATION)){\n Snackbar.make(drawer,\"Location access is required to show your friend and questions on map.\",Snackbar.LENGTH_INDEFINITE)\n .setAction(\"OK\", new View.OnClickListener() {\n @TargetApi(Build.VERSION_CODES.M)\n @Override\n public void onClick(View v) {\n requestPermissions(new String[]{Manifest.permission.ACCESS_FINE_LOCATION,Manifest.permission.ACCESS_COARSE_LOCATION},LOCATION_PERMISSION_CODE);\n }\n })\n .show();\n }else{\n requestPermissions(new String[]{Manifest.permission.ACCESS_FINE_LOCATION,Manifest.permission.ACCESS_COARSE_LOCATION},LOCATION_PERMISSION_CODE);\n }\n }\n }", "private void startLocationUpdates() {\n settingsClient\n .checkLocationSettings(locationSettingsRequest)\n .addOnSuccessListener(this, new OnSuccessListener<LocationSettingsResponse>() {\n @SuppressLint(\"MissingPermission\")\n @Override\n public void onSuccess(LocationSettingsResponse locationSettingsResponse) {\n Log.i(TAG, \"All location settings are satisfied.\");\n\n //noinspection MissingPermission\n fusedLocationClient.requestLocationUpdates(locationRequest, locationCallback, Looper.myLooper());\n\n onLocationChange();\n }\n })\n .addOnFailureListener(this, new OnFailureListener() {\n @Override\n public void onFailure(@NonNull Exception e) {\n int statusCode = ((ApiException) e).getStatusCode();\n switch (statusCode) {\n case LocationSettingsStatusCodes.RESOLUTION_REQUIRED:\n Log.i(TAG, \"Location settings are not satisfied. Attempting to upgrade \" +\n \"location settings \");\n try {\n // Show the dialog by calling startResolutionForResult(), and check the\n // result in onActivityResult().\n ResolvableApiException rae = (ResolvableApiException) e;\n rae.startResolutionForResult(UserLocation.this, REQUEST_CODE);\n } catch (IntentSender.SendIntentException sie) {\n Log.i(TAG, \"PendingIntent unable to execute request.\");\n }\n break;\n case LocationSettingsStatusCodes.SETTINGS_CHANGE_UNAVAILABLE:\n String errorMessage = \"Location settings are inadequate, and cannot be \" +\n \"fixed here. Fix in Settings.\";\n Log.e(TAG, errorMessage);\n\n Toast.makeText(UserLocation.this, errorMessage, Toast.LENGTH_LONG).show();\n }\n\n onLocationChange();\n }\n });\n }", "public void startReceivingLocationUpdates() {\n Dexter.withActivity(this)\n .withPermission(Manifest.permission.ACCESS_FINE_LOCATION)\n .withListener(new PermissionListener() {\n @Override\n public void onPermissionGranted(PermissionGrantedResponse response) {\n mRequestingLocationUpdates = true;\n startLocationUpdates();\n }\n\n @Override\n public void onPermissionDenied(PermissionDeniedResponse response) {\n if (response.isPermanentlyDenied()) {\n // open device settings when the permission is\n // denied permanently\n openSettings();\n }\n }\n\n @Override\n public void onPermissionRationaleShouldBeShown(com.karumi.dexter.listener.PermissionRequest permission, PermissionToken token) {\n token.continuePermissionRequest();\n }\n\n }).check();\n }", "public void getLocationPermission() {\n if (!isPermissionGranted())\n // get the location permission from user\n // this will prompt user a dialog to give the location permission\n requestPermissionLauncher.launch(Manifest.permission.ACCESS_FINE_LOCATION);\n /*ActivityCompat.requestPermissions(activity,\n new String[]{Manifest.permission.ACCESS_FINE_LOCATION},\n PERMISSIONS_REQUEST_ACCESS_FINE_LOCATION);*/\n }", "public static void checkLocationPermission() {\n globalContext.stopService(locationIntent);\n\n globalFragmentActivity.requestPermissions(\n new String[]{\n Manifest.permission.ACCESS_FINE_LOCATION,\n Manifest.permission.ACCESS_COARSE_LOCATION\n },\n MY_PERMISSIONS_REQUEST_LOCATION);\n }", "protected void startLocationUpdates()\n {\n try\n {\n if (googleApiClient.isConnected())\n {\n LocationServices.FusedLocationApi.requestLocationUpdates(googleApiClient, locationRequest, this);\n isRequestingLocationUpdates = true;\n }\n }\n catch (SecurityException e)\n {\n Toast.makeText(getContext(), \"Unable to get your current location!\" +\n \" Please enable the location permission in Settings > Apps \" +\n \"> Bengaluru Buses.\", Toast.LENGTH_LONG).show();\n }\n }", "private void startTrackingRoute(){\n if(ContextCompat.checkSelfPermission(this, ACCESS_FINE_LOCATION) != PackageManager.PERMISSION_GRANTED){\n //Starts up alert dialog for getting permission\n ActivityCompat.requestPermissions(this, new String[]{Manifest.permission.ACCESS_FINE_LOCATION}, REQUEST_LOC_PERMISSION);\n }\n else{\n //Start the location updater listener\n locationManager.requestLocationUpdates(LocationManager.GPS_PROVIDER, 0, MIN_DISTANCE, this);\n }\n }", "protected void startLocationUpdates() {\n try {\n if (ContextCompat.checkSelfPermission(this, Manifest.permission.ACCESS_FINE_LOCATION) == PackageManager.PERMISSION_GRANTED) {\n LocationServices.FusedLocationApi.requestLocationUpdates(mGoogleApiClient, mLocationRequest, this);\n }\n } catch (Exception ex) {\n ex.printStackTrace();\n }\n }", "private void setupLocation() {\n\n if (ContextCompat.checkSelfPermission(this, Manifest.permission.ACCESS_FINE_LOCATION) != PackageManager.PERMISSION_GRANTED &&\n ContextCompat.checkSelfPermission(this, Manifest.permission.ACCESS_COARSE_LOCATION) != PackageManager.PERMISSION_GRANTED) {\n\n // Permission is not granted.\n if (ActivityCompat.shouldShowRequestPermissionRationale(this, Manifest.permission.ACCESS_FINE_LOCATION) &&\n ActivityCompat.shouldShowRequestPermissionRationale(this, Manifest.permission.ACCESS_COARSE_LOCATION)) {\n\n ActivityCompat.requestPermissions(this,\n new String[]{Manifest.permission.ACCESS_FINE_LOCATION, Manifest.permission.ACCESS_COARSE_LOCATION},\n LOCATION_PERMISSION_REQUEST);\n } else {\n // Request the permission\n ActivityCompat.requestPermissions(this,\n new String[]{Manifest.permission.ACCESS_FINE_LOCATION, Manifest.permission.ACCESS_COARSE_LOCATION},\n LOCATION_PERMISSION_REQUEST);\n }\n } else {\n // Permission has already been granted\n }\n }", "@Override\n public void onPermissionGranted(PermissionGrantedResponse response) {\n\n final ProgressDialog progressDialog = new ProgressDialog(InfoActivity.this);\n progressDialog.setMessage(\"Getting your location...\");\n progressDialog.show();\n SmartLocation.with(InfoActivity.this).location().oneFix().start(new OnLocationUpdatedListener() {\n @Override\n public void onLocationUpdated(Location location) {\n latitudeStr = String.valueOf(location.getLatitude());\n longitudeStr = String.valueOf(location.getLongitude());\n progressDialog.dismiss();\n Toast.makeText(InfoActivity.this, location.getLatitude() + \" \" + location.getLongitude(), Toast.LENGTH_SHORT).show();\n }\n });\n }", "public boolean requestingLocationUpdates() {\n return prefs\n .getBoolean(KEY_REQUESTING_LOCATION_UPDATES, false);\n }", "private void StartLocationUpdates() {\n mLocationRequest = new LocationRequest();\n mLocationRequest.setPriority(LocationRequest.PRIORITY_BALANCED_POWER_ACCURACY);\n mLocationRequest.setInterval(UPDATE_INTERVAL);\n mLocationRequest.setFastestInterval(FASTEST_INTERVAL);\n\n // Create LocationSettings object using location request\n LocationSettingsRequest.Builder builder = new LocationSettingsRequest.Builder();\n builder.addLocationRequest(mLocationRequest);\n LocationSettingsRequest locationSettingsRequest = builder.build();\n\n // Checks if location settings are OK\n SettingsClient settingsClient = LocationServices.getSettingsClient(context);\n settingsClient.checkLocationSettings(locationSettingsRequest);\n\n if (ActivityCompat.checkSelfPermission(context, Manifest.permission.ACCESS_FINE_LOCATION)\n != PackageManager.PERMISSION_GRANTED && ActivityCompat.checkSelfPermission\n (context, Manifest.permission.ACCESS_COARSE_LOCATION) != PackageManager.PERMISSION_GRANTED) {\n\n return;\n }else {\n getFusedLocationProviderClient(context).requestLocationUpdates(mLocationRequest, new LocationCallback() {\n @Override\n public void onLocationResult(LocationResult locationResult) {\n onLocationChanged(locationResult.getLastLocation());\n// getLastLocation();\n }\n },\n Looper.myLooper());\n }\n\n }", "private void permissionLocationRequest() {\n if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {\n int hasLocationPermission = checkSelfPermission(Manifest.permission.ACCESS_FINE_LOCATION);\n if (hasLocationPermission != PackageManager.PERMISSION_GRANTED) {\n if (!shouldShowRequestPermissionRationale(Manifest.permission.ACCESS_FINE_LOCATION)) {\n showMessageOKCancel(\"You need to allow access to Location\",\n new DialogInterface.OnClickListener() {\n @Override\n public void onClick(DialogInterface dialog, int which) {\n requestPermissions(new String[]{Manifest.permission.ACCESS_FINE_LOCATION},\n REQUEST_CODE_ASK_PERMISSIONS);\n }\n });\n }\n }\n\n }\n }", "private void getLocationPermission(){\n if(ContextCompat.checkSelfPermission(this, Manifest.permission.ACCESS_FINE_LOCATION) == PackageManager.PERMISSION_GRANTED){\n locationAccess = true;\n } else {\n locationAccess = false;\n ActivityCompat.requestPermissions(this, new String[]{Manifest.permission.ACCESS_FINE_LOCATION}, REQUEST_LOCATION_PERMISSION);\n }\n }", "private void getLocationPermission() {\n if (ActivityCompat.checkSelfPermission(this, android.Manifest.permission.ACCESS_FINE_LOCATION)\n != PackageManager.PERMISSION_GRANTED) {\n //request location permission\n ActivityCompat.requestPermissions(this, new String[]{android.Manifest.permission.ACCESS_FINE_LOCATION\n }, LOCATION_REQUEST_CODE);\n }\n fetchLastLocation();\n }", "@SuppressLint(\"MissingPermission\")\n private void doStuff() {\n LocationManager locationManager = (LocationManager) getApplicationContext().getSystemService(Context.LOCATION_SERVICE);\n if (locationManager != null) {\n locationManager.requestLocationUpdates(LocationManager.GPS_PROVIDER, 0, 0, (LocationListener) this);\n }\n\n }", "protected void getLocation() {\n if (isLocationEnabled(Navigate.this)) {\n locationManager = (LocationManager) this.getSystemService(Context.LOCATION_SERVICE);\n criteria = new Criteria();\n bestProvider = String.valueOf(locationManager.getBestProvider(criteria, true)).toString();\n\n //You can still do this if you like, you might get lucky:\n if (ActivityCompat.checkSelfPermission(this, Manifest.permission.ACCESS_FINE_LOCATION) != PackageManager.PERMISSION_GRANTED && ActivityCompat.checkSelfPermission(this, Manifest.permission.ACCESS_COARSE_LOCATION) != PackageManager.PERMISSION_GRANTED) {\n // TODO: Consider calling\n // ActivityCompat#requestPermissions\n // here to request the missing permissions, and then overriding\n // public void onRequestPermissionsResult(int requestCode, String[] permissions,\n // int[] grantResults)\n // to handle the case where the user grants the permission. See the documentation\n // for ActivityCompat#requestPermissions for more details.\n return;\n }\n Location location = locationManager.getLastKnownLocation(bestProvider);\n if (location != null) {\n Log.e(\"TAG\", \"GPS is on\");\n latitude = location.getLatitude();\n longitude = location.getLongitude();\n } else {\n //This is what you need:\n locationManager.requestLocationUpdates(bestProvider, 1000, 0, this);\n }\n } else {\n// final AlertDialog.Builder builder = new AlertDialog.Builder(this);\n// builder.setMessage(\"Your GPS seems to be disabled, do you want to enable it?\")\n// .setCancelable(false)\n// .setPositiveButton(\"Yes\", new DialogInterface.OnClickListener() {\n// public void onClick(final DialogInterface dialog, final int id) {\n// startActivity(new Intent(android.provider.Settings.ACTION_LOCATION_SOURCE_SETTINGS));\n// }\n// })\n// .setNegativeButton(\"No\", new DialogInterface.OnClickListener() {\n// public void onClick(final DialogInterface dialog, final int id) {\n// dialog.cancel();\n// }\n// });\n// final AlertDialog alert = builder.create();\n// alert.show();\n }\n }", "private void updateGPS(){\n fusedLocationProviderClient =\n\n //---------------------------------------------------------------------------------------------\n\n\n //get permission from the user to track GPS\n if(ActivityCompat.checkSelfPermission(this, Manifest.permission.ACCESS_FINE_LOCATION) == PackageManager.PERMISSION_GRANTED){\n //user provided the permission\n //if a location is found than the SuccessListener will create an other trigger to an other anonymous function it´s called\n fusedLocationProviderClient.getLastLocation().addOnSuccessListener(this, new OnSuccessListener<Location>(){\n @Override\n public void onSuccess(Location location) {\n //Update the UI\n updateUIValues(location);\n }\n });\n }\n else{\n //user permission not granted yet\n //checking valid OS\n if(Build.VERSION.SDK_INT >= Build.VERSION_CODES.M){\n requestPermissions(new String[] {Manifest.permission.ACCESS_FINE_LOCATION}, PERMISSION_FINE_LOCATION);\n }\n }\n\n }", "private void getLocationPermission() {\n if (ContextCompat.checkSelfPermission(activity.getApplicationContext(), android.Manifest.permission.ACCESS_FINE_LOCATION) == PackageManager.PERMISSION_GRANTED) {\n mLocationPermissionGranted = true;\n } else {\n ActivityCompat.requestPermissions(activity,\n new String[]{android.Manifest.permission.ACCESS_FINE_LOCATION},\n PERMISSIONS_REQUEST_ACCESS_FINE_LOCATION);\n }\n }", "public void startLocationUpdates(){\n // High accuracy should use GPS to get the location\n locationRequest = new LocationRequest();\n locationRequest.setInterval(2000);\n locationRequest.setFastestInterval(1000);\n locationRequest.setSmallestDisplacement(1);\n locationRequest.setPriority(LocationRequest.PRIORITY_HIGH_ACCURACY);\n\n if(ActivityCompat.checkSelfPermission(this, Manifest.permission.ACCESS_FINE_LOCATION) != PackageManager.PERMISSION_GRANTED &&\n ActivityCompat.checkSelfPermission(this, Manifest.permission.ACCESS_COARSE_LOCATION) != PackageManager.PERMISSION_GRANTED){\n // The user has not given us access to get their location\n // May want to request those premissions here\n try {\n int gpsOff = Settings.Secure.getInt(getContentResolver(), Settings.Secure.LOCATION_MODE);\n // If this returns zero then GPS is off\n if(gpsOff == 0){\n Intent turnOnGPS = new Intent(Settings.ACTION_LOCATION_SOURCE_SETTINGS);\n startActivity(turnOnGPS);\n }\n }catch (Settings.SettingNotFoundException e){\n e.printStackTrace();\n }\n\n return;\n }\n\n LocationServices.FusedLocationApi.requestLocationUpdates(googleApiClient, locationRequest, this);\n }", "@SuppressLint(\"RestrictedApi\")\n protected void startLocationUpdates() {\n mLocationRequest = new LocationRequest();\n mLocationRequest.setPriority(LocationRequest.PRIORITY_HIGH_ACCURACY);\n mLocationRequest.setInterval(UPDATE_INTERVAL);\n mLocationRequest.setFastestInterval(FASTEST_INTERVAL);\n\n LocationSettingsRequest.Builder builder = new LocationSettingsRequest.Builder();\n builder.addLocationRequest(mLocationRequest);\n LocationSettingsRequest locationSettingsRequest = builder.build();\n\n SettingsClient settingsClient = LocationServices.getSettingsClient(this);\n settingsClient.checkLocationSettings(locationSettingsRequest);\n\n if (ActivityCompat.checkSelfPermission(this, Manifest.permission.ACCESS_FINE_LOCATION) != PackageManager.PERMISSION_GRANTED && ActivityCompat.checkSelfPermission(this, Manifest.permission.ACCESS_COARSE_LOCATION) != PackageManager.PERMISSION_GRANTED) {\n return;\n }\n getFusedLocationProviderClient(this).requestLocationUpdates(mLocationRequest, new LocationCallback() {\n @Override\n public void onLocationResult(LocationResult locationResult) {\n onLocationChanged(locationResult.getLastLocation());\n }\n },\n Looper.myLooper());\n }", "public void requestLocation() {\n if (ActivityCompat.checkSelfPermission(this, Manifest.permission.ACCESS_FINE_LOCATION) != PackageManager.PERMISSION_GRANTED\n && ActivityCompat.checkSelfPermission(this, Manifest.permission.ACCESS_COARSE_LOCATION) !=\n PackageManager.PERMISSION_GRANTED) {\n if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {\n requestPermissions(new String[]{Manifest.permission.ACCESS_FINE_LOCATION, Manifest.permission.ACCESS_COARSE_LOCATION,\n Manifest.permission.INTERNET}, 12);\n }\n return;\n }\n //this line updates location\n mMap.setMyLocationEnabled(true);\n providerClient.requestLocationUpdates(locationRequest, locationCallback, getMainLooper());\n }", "private void getLocation() {\n //if you don't have permission for location services yet, ask\n if (ActivityCompat.checkSelfPermission(this,\n Manifest.permission.ACCESS_FINE_LOCATION)\n != PackageManager.PERMISSION_GRANTED) {\n ActivityCompat.requestPermissions(this, new String[]\n {Manifest.permission.ACCESS_FINE_LOCATION},\n REQUEST_LOCATION_PERMISSION);\n //have the app ask for location permission\n } else {\n fusedLocationClient.requestLocationUpdates\n (getLocationRequest(), mLocationCallback,\n null /* Looper */);\n //uses the type of request and the location callback to update the location\n /**fusedLocationClient.getLastLocation().addOnSuccessListener(\n new OnSuccessListener<Location>() {\n @Override\n public void onSuccess(Location location) {\n TextView error = findViewById(R.id.errorMsg);\n error.setVisibility(View.VISIBLE);\n\n if (location != null) {\n lastLocation = location;\n error.setText(\"location: \" + lastLocation.getLatitude());\n } else {\n error.setText(\"location not available\");\n }\n }\n });**/\n }\n }", "private void getLocationPermission() {\n /*\n * Request location permission, so that we can get the location of the\n * device. The result of the permission request is handled by a callback,\n * onRequestPermissionsResult.\n */\n mLocationPermissionGranted = false;\n if (ContextCompat.checkSelfPermission(this.getApplicationContext(),\n android.Manifest.permission.ACCESS_FINE_LOCATION)\n == PackageManager.PERMISSION_GRANTED) {\n mLocationPermissionGranted = true;\n } else {\n ActivityCompat.requestPermissions(this,\n new String[]{android.Manifest.permission.ACCESS_FINE_LOCATION},\n PERMISSIONS_REQUEST_ACCESS_FINE_LOCATION);\n }\n }", "private void getLocationPermission() {\n /*\n * Request location permission, so that we can get the location of the\n * device. The result of the permission request is handled by a callback,\n * onRequestPermissionsResult.\n */\n mLocationPermissionGranted = false;\n if (ContextCompat.checkSelfPermission(this.getApplicationContext(),\n android.Manifest.permission.ACCESS_FINE_LOCATION)\n == PackageManager.PERMISSION_GRANTED) {\n mLocationPermissionGranted = true;\n } else {\n ActivityCompat.requestPermissions(this,\n new String[]{android.Manifest.permission.ACCESS_FINE_LOCATION},\n PERMISSIONS_REQUEST_ACCESS_FINE_LOCATION);\n }\n }", "private void getLocationPermission() {\n if (ContextCompat.checkSelfPermission(this.getApplicationContext(),\n android.Manifest.permission.ACCESS_FINE_LOCATION)\n == PackageManager.PERMISSION_GRANTED) {\n mLocationPermissionGranted = true;\n } else {\n ActivityCompat.requestPermissions(this,\n new String[]{android.Manifest.permission.ACCESS_FINE_LOCATION},\n PERMISSIONS_REQUEST_ACCESS_FINE_LOCATION);\n }\n }", "private void getLocationPermission() {\n if (ContextCompat.checkSelfPermission(this.getApplicationContext(),\n android.Manifest.permission.ACCESS_FINE_LOCATION)\n == PackageManager.PERMISSION_GRANTED) {\n mLocationPermissionGranted = true;\n } else {\n ActivityCompat.requestPermissions(this,\n new String[]{android.Manifest.permission.ACCESS_FINE_LOCATION},\n PERMISSIONS_REQUEST_ACCESS_FINE_LOCATION);\n }\n }", "private void startCurrentLocationUpdates() {\n LocationRequest locationRequest = LocationRequest.create();\n locationRequest.setPriority(LocationRequest.PRIORITY_HIGH_ACCURACY);\n locationRequest.setInterval(3000);\n if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {\n if (ActivityCompat.checkSelfPermission(this, android.Manifest.permission.ACCESS_FINE_LOCATION) != PackageManager.PERMISSION_GRANTED && ActivityCompat.checkSelfPermission(this, android.Manifest.permission.ACCESS_COARSE_LOCATION) != PackageManager.PERMISSION_GRANTED) {\n ActivityCompat.requestPermissions(MapsActivity.this,\n new String[]{Manifest.permission.ACCESS_FINE_LOCATION},\n MY_PERMISSIONS_REQUEST_ACCESS_FINE_LOCATION);\n return;\n }\n }\n //Untuk data internet\n String status = null;\n ConnectivityManager cm = (ConnectivityManager) MapsActivity.this.getSystemService(Context.CONNECTIVITY_SERVICE);\n NetworkInfo activeNetwork = cm.getActiveNetworkInfo();\n\n if (activeNetwork == null) {\n AlertDialog.Builder builder = new AlertDialog.Builder(this);\n builder.setMessage(\"Kamu Tidak Memiliki Koneksi Internet, Harap Nyalakan Data Seluler atau Wi-Fi\")\n .setTitle(\"Tidak Ada Koneksi\")\n .setCancelable(false)\n .setPositiveButton(\"Settings\",\n new DialogInterface.OnClickListener() {\n public void onClick(DialogInterface dialog, int id) {\n startActivityForResult(new Intent(android.provider.Settings.ACTION_SETTINGS), 0);\n }\n }\n )\n .setNegativeButton(\"Cancel\",\n new DialogInterface.OnClickListener() {\n public void onClick(DialogInterface dialog, int id) {\n startCurrentLocationUpdates();\n }\n }\n );\n AlertDialog alert = builder.create();\n alert.show();\n }\n\n //untuk cek apakah gps on/off\n final LocationManager locationM = (LocationManager) getSystemService(Context.LOCATION_SERVICE);\n if (!locationM.isProviderEnabled(LocationManager.GPS_PROVIDER)) {\n AlertDialog.Builder builder = new AlertDialog.Builder(this);\n builder.setMessage(\"Harap Nyalakan GPS Terlebih Dahulu\")\n .setTitle(\"Tidak Dapat Menemukan Lokasi\")\n .setCancelable(false)\n .setPositiveButton(\"Settings\",\n new DialogInterface.OnClickListener() {\n public void onClick(DialogInterface dialog, int id) {\n Intent openLocationSettings = new Intent(Settings.ACTION_LOCATION_SOURCE_SETTINGS);\n MapsActivity.this.startActivity(openLocationSettings);\n }\n }\n )\n .setNegativeButton(\"Cancel\",\n new DialogInterface.OnClickListener() {\n public void onClick(DialogInterface dialog, int id) {\n startCurrentLocationUpdates();\n }\n }\n );\n AlertDialog alert = builder.create();\n alert.show();\n }\n fusedLocationProviderClient.requestLocationUpdates(locationRequest, mLocationCallback, Looper.myLooper());\n }", "protected void startLocationUpdates() {\n try {\n// LocationServices.FusedLocationApi.requestLocationUpdates(mGoogleApiClient, mLocationRequest, this);\n\n /* mLocationRequest = new LocationRequest();\n mLocationRequest.setInterval(6000); // two minute interval\n mLocationRequest.setFastestInterval(6000);//120000\n mLocationRequest.setPriority(LocationRequest.PRIORITY_HIGH_ACCURACY);*/\n /*if (ContextCompat.checkSelfPermission(this,\n android.Manifest.permission.ACCESS_FINE_LOCATION)\n == PackageManager.PERMISSION_GRANTED) {\n mFusedLocationClient.requestLocationUpdates(mLocationRequest, mLocationCallback, Looper.myLooper());\n }*/\n if (ActivityCompat.checkSelfPermission(this, android.Manifest.permission.ACCESS_FINE_LOCATION) != PackageManager.PERMISSION_GRANTED && ActivityCompat.checkSelfPermission(this, android.Manifest.permission.ACCESS_COARSE_LOCATION) != PackageManager.PERMISSION_GRANTED) {\n // TODO: Consider calling\n // ActivityCompat#requestPermissions\n // here to request the missing permissions, and then overriding\n // public void onRequestPermissionsResult(int requestCode, String[] permissions,\n // int[] grantResults)\n // to handle the case where the user grants the permission. See the documentation\n // for ActivityCompat#requestPermissions for more details.\n return;\n }\n// LocationServices.FusedLocationApi.requestLocationUpdates(mGoogleApiClient, mLocationRequest, (LocationListener) this);\n LocationServices.getFusedLocationProviderClient(this).requestLocationUpdates(mLocationRequest, null);\n// requestLocationUpdates(LocationManager.GPS_PROVIDER, 0, 0, locationListener);\n// requestLocationUpdates(LocationManager.NETWORK_PROVIDER, 0, 0, locationListener);\n\n } catch (Exception e) {\n // TODO: handle exception\n e.printStackTrace();\n }\n }", "private boolean checkAndroidVersionForLocationPermission() {\n Log.v(MainActivity.TAG,\"Checking location permissions.\");\n try {\n if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {\n Log.d(MainActivity.TAG,\"Calling checkSelfPermission: Access Fine Location.\");\n int locationDangerCheck = checkSelfPermission(android.Manifest.permission.ACCESS_FINE_LOCATION);\n if (!(locationDangerCheck == PackageManager.PERMISSION_GRANTED)) {\n Log.d(MainActivity.TAG,\"locationCheck: \" + locationDangerCheck);\n requestLocationPermission();\n return false;\n }\n }\n return true;\n } catch (SecurityException e) {\n Log.d(MainActivity.TAG, getString(R.string.error_message), e);\n return false;\n }\n }", "private void startGettingLocation() {\n if (ContextCompat.checkSelfPermission(this, Manifest.permission.ACCESS_FINE_LOCATION) == PackageManager.PERMISSION_GRANTED) {\n //should check if location is enabled\n\n initializeGoogleApiClient();\n } else {\n ActivityCompat.requestPermissions(this,\n new String[]{Manifest.permission.ACCESS_FINE_LOCATION},\n MY_PERMISSION_ACCESS_LOCATION);\n }\n }", "private void gpsRequest(){\n new AlertDialog.Builder(this)\n .setTitle(\"Enable GPS\")\n .setMessage(\"Would you like to allow location tracking?\")\n .setPositiveButton(android.R.string.yes, new DialogInterface.OnClickListener() {\n @Override\n public void onClick(DialogInterface dialogInterface, int i) {\n //yes\n\n configLoc();\n Toast.makeText(getApplicationContext(),\"Location tracking is enabled\",Toast.LENGTH_SHORT).show();\n }\n })\n .setNegativeButton(android.R.string.no, new DialogInterface.OnClickListener() {\n @Override\n public void onClick(DialogInterface dialogInterface, int i) {\n //no\n Toast.makeText(getApplicationContext(),\"Location Tracking has been disabled\",Toast.LENGTH_SHORT).show();\n }\n })\n .setIcon(android.R.drawable.ic_dialog_alert)\n .show();\n }", "private void getLocationPermission() {\n if (ContextCompat.checkSelfPermission(this.getApplicationContext(),\n android.Manifest.permission.ACCESS_FINE_LOCATION)\n == PackageManager.PERMISSION_GRANTED) {\n locationPermissionGranted = true;\n } else {\n ActivityCompat.requestPermissions(this,\n new String[]{android.Manifest.permission.ACCESS_FINE_LOCATION},\n PERMISSIONS_REQUEST_ACCESS_FINE_LOCATION);\n }\n }", "public void checkGPS()\r\n {\r\n\t\tlm = (LocationManager) this.getSystemService(Context.LOCATION_SERVICE);\r\n\t\tif (!lm.isProviderEnabled(LocationManager.GPS_PROVIDER)) {\r\n\t\t\tbuildAlertMessageNoGps();\r\n\t\t} else {\r\n\t\t\tlm = (LocationManager) this\r\n\t\t\t\t\t.getSystemService(Context.LOCATION_SERVICE);\r\n\t\t\tlm.getProvider(LocationManager.GPS_PROVIDER);\r\n\t\t\tlocationListener = new UserLocationListener();\r\n\t\t\tlm.requestLocationUpdates(LocationManager.GPS_PROVIDER, 5000, 10,\r\n\t\t\t\t\tlocationListener);\r\n\t\t}\r\n\t}", "private void updateLocationUI() {\n if (map == null) {\n return;\n }\n try {\n if (locationPermissionGranted) {\n map.setMyLocationEnabled(true);\n map.getUiSettings().setMyLocationButtonEnabled(true);\n } else {\n map.setMyLocationEnabled(false);\n map.getUiSettings().setMyLocationButtonEnabled(false);\n lastKnownLocation = null;\n getLocationPermission();\n }\n } catch (SecurityException e) {\n Log.e(\"Exception: %s\", e.getMessage());\n }\n }", "protected void startLocationUpdates() {\n mLocationRequest = LocationRequest.create()\n .setPriority(LocationRequest.PRIORITY_BALANCED_POWER_ACCURACY)\n .setInterval(1000000)\n .setFastestInterval(1000000);\n // Request location updates\n if (ActivityCompat.checkSelfPermission(this, android.Manifest.permission.ACCESS_COARSE_LOCATION) == PackageManager.PERMISSION_GRANTED) {\n LocationServices.FusedLocationApi.requestLocationUpdates(mGoogleApiClient, mLocationRequest, new LocationListener() {\n @Override\n public void onLocationChanged(Location location) {\n mLastLocation = location;\n }\n });\n }\n\n }", "private void reqquestGps() {\n builder = new LocationSettingsRequest.Builder();//mang di request\n builder.addLocationRequest(locationRequest);\n SettingsClient settingsClient = LocationServices.getSettingsClient(context);//dang tao 1 requet vao may va lasy ra thong so\n\n Task<LocationSettingsResponse> task = settingsClient.checkLocationSettings(builder.build());//day la lenh cua thu vien\n\n task.addOnFailureListener(new OnFailureListener() {//lang nghe su kien bi fai kho k lay dc gps,boi nnhieu nhie nghuyen nhan 1 co the la chua bat,\n @Override\n public void onFailure(@NonNull Exception e) {//requye\n if (e instanceof ResolvableApiException) {//chua bat\n ResolvableApiException resolvableApiException = (ResolvableApiException) e;//bat man hinh hien thi bat gps\n ((MainActivity) context).requestOpenGps(resolvableApiException);\n }\n }\n });\n }", "private void getLocationPermission() {\n if (ContextCompat.checkSelfPermission(getActivity(),\n android.Manifest.permission.ACCESS_FINE_LOCATION)\n == PackageManager.PERMISSION_GRANTED) {\n mLocationPermissionGranted = true;\n } else {\n ActivityCompat.requestPermissions(getActivity(),\n new String[]{android.Manifest.permission.ACCESS_FINE_LOCATION},\n PERMISSIONS_REQUEST_ACCESS_FINE_LOCATION);\n }\n }", "void getlatlong(){\n if (ActivityCompat.checkSelfPermission(this, Manifest.permission.ACCESS_FINE_LOCATION) != PackageManager.PERMISSION_GRANTED && ActivityCompat.checkSelfPermission(this, Manifest.permission.ACCESS_COARSE_LOCATION) != PackageManager.PERMISSION_GRANTED) {\n if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {\n requestPermissions(new String[]{Manifest.permission.ACCESS_COARSE_LOCATION,Manifest.permission.ACCESS_FINE_LOCATION,Manifest.permission.INTERNET}\n ,10);\n }\n return;\n }\n // this code won't execute IF permissions are not allowed, because in the line above there is return statement.\n\n //noinspection MissingPermission\n locationManager.requestLocationUpdates(\"gps\", 0, 0, listener);\n\n }", "private void startLocationUpdates() {\n mSettingsClient.checkLocationSettings(mLocationSettingsRequest)\n .addOnSuccessListener(getActivity(), locationSettingsResponse -> {\n mFusedLocationClient.requestLocationUpdates(mLocationRequest,\n mLocationCallback, Looper.myLooper());\n\n updateUI();\n })\n .addOnFailureListener(getActivity(), e -> {\n int statusCode = ((ApiException) e).getStatusCode();\n switch (statusCode) {\n case LocationSettingsStatusCodes.RESOLUTION_REQUIRED:\n try {\n // Show the dialog and check the result in onActivityResult().\n ResolvableApiException resolvable = (ResolvableApiException) e;\n MapFragment.this.startIntentSenderForResult(resolvable.getResolution().getIntentSender(),\n REQUEST_CHECK_SETTINGS, null, 0,\n 0, 0, null);\n } catch (IntentSender.SendIntentException sie) {\n //...\n }\n break;\n case LocationSettingsStatusCodes.SETTINGS_CHANGE_UNAVAILABLE:\n String errorMessage = \"Location settings are inadequate, and cannot be \" +\n \"fixed here. Fix in Settings.\";\n Toast.makeText(MapFragment.this.getActivity(), errorMessage, Toast.LENGTH_LONG).show();\n mRequestingLocationUpdates = false;\n }\n\n MapFragment.this.updateUI();\n });\n }", "protected void createLocationRequest()\n {\n errorLinearLayout.setVisibility(View.GONE);\n swipeRefreshLayout.setRefreshing(true);\n final int REQUEST_CHECK_SETTINGS = 0x1;\n locationRequest = new LocationRequest();\n locationRequest.setInterval(5000);\n locationRequest.setFastestInterval(3000);\n locationRequest.setPriority(LocationRequest.PRIORITY_HIGH_ACCURACY);\n LocationSettingsRequest.Builder builder = new LocationSettingsRequest.Builder().addLocationRequest(locationRequest);\n PendingResult<LocationSettingsResult> result = LocationServices.SettingsApi.checkLocationSettings(googleApiClient, builder.build());\n\n result.setResultCallback(new ResultCallback<LocationSettingsResult>()\n {\n @Override\n public void onResult(@NonNull LocationSettingsResult result)\n {\n final Status status = result.getStatus();\n switch (status.getStatusCode())\n {\n case LocationSettingsStatusCodes.SUCCESS:\n if (!isRequestingLocationUpdates)\n {\n int permissionCheck = ContextCompat.checkSelfPermission(getActivity(), Manifest.permission.ACCESS_FINE_LOCATION);\n if (permissionCheck == PackageManager.PERMISSION_GRANTED)\n {\n startLocationUpdates();\n }\n else\n {\n requestPermissions(new String[]{Manifest.permission.ACCESS_FINE_LOCATION}, LOCATION_PERMISSION_REQUEST_CODE);\n }\n }\n break;\n case LocationSettingsStatusCodes.RESOLUTION_REQUIRED:\n\n int permissionCheck = ContextCompat.checkSelfPermission(getActivity(), Manifest.permission.ACCESS_FINE_LOCATION);\n if (permissionCheck == PackageManager.PERMISSION_GRANTED)\n {\n if (locationManager.isProviderEnabled(LocationManager.GPS_PROVIDER))\n {\n if (!isRequestingLocationUpdates)\n {\n startLocationUpdates();\n }\n }\n else\n {\n try\n {\n status.startResolutionForResult(getActivity(), REQUEST_CHECK_SETTINGS);\n }\n catch (IntentSender.SendIntentException e)\n {\n Toast.makeText(getActivity(), \"Failed to enable location services! Please try again later...\", Toast.LENGTH_SHORT).show();\n }\n }\n }\n else\n {\n requestPermissions(new String[]{Manifest.permission.ACCESS_FINE_LOCATION}, LOCATION_PERMISSION_REQUEST_CODE);\n }\n break;\n case LocationSettingsStatusCodes.SETTINGS_CHANGE_UNAVAILABLE:\n Toast.makeText(getActivity(), \"Device doesn't have a GPS! Can't locate bus stops nearby...\", Toast.LENGTH_LONG).show();\n break;\n }\n }\n });\n }", "public void checkForLocationSettings() {\n try {\n LocationSettingsRequest settingsRequest = new LocationSettingsRequest.Builder()\n .addLocationRequest(mLocationRequest).build();\n SettingsClient settingsClient = LocationServices.getSettingsClient(context);\n\n Task<LocationSettingsResponse> task = settingsClient\n .checkLocationSettings(settingsRequest);\n task.addOnSuccessListener(context, new OnSuccessListener<LocationSettingsResponse>() {\n @Override\n public void onSuccess(LocationSettingsResponse locationSettingsResponse) {\n //Setting is success...\n PrintLog.d(TAG, \"LocationSettingsStatusCodes ..............: \" + locationSettingsResponse.getLocationSettingsStates());\n // All location settings are satisfied. The client can initialize location requests here\n getLastLocation();\n }\n }).addOnFailureListener(context, new OnFailureListener() {\n @Override\n public void onFailure(@NonNull Exception e) {\n int statusCode = ((ApiException) e).getStatusCode();\n switch (statusCode) {\n case LocationSettingsStatusCodes.RESOLUTION_REQUIRED:\n PrintLog.d(TAG, \"dialogue open settings ..............: \");\n try {\n ResolvableApiException rae = (ResolvableApiException) e;\n rae.startResolutionForResult(context, REQUEST_CHECK_SETTINGS);\n } catch (IntentSender.SendIntentException sie) {\n sie.printStackTrace();\n }\n break;\n case LocationSettingsStatusCodes.SETTINGS_CHANGE_UNAVAILABLE:\n Toast.makeText(context, \"Setting change is not available.Try in another device.\", Toast.LENGTH_LONG).show();\n }\n\n }\n });\n\n } catch (Exception ex) {\n ex.printStackTrace();\n }\n }", "private void getLocationPermission(){\n Log.d(TAG, \"getLocationPermission: getting location permission.\");\n String[] permissions = {Manifest.permission.ACCESS_FINE_LOCATION, Manifest.permission.ACCESS_COARSE_LOCATION};\n if (ContextCompat.checkSelfPermission(this.getApplicationContext(),\n FINE_LOCATION)== PackageManager.PERMISSION_GRANTED){\n if (ContextCompat.checkSelfPermission(this.getApplicationContext(),\n COURSE_LOCATION)== PackageManager.PERMISSION_GRANTED){\n mLocationPermissionGaranted = true;\n getDeviceLocation();\n }else{\n ActivityCompat.requestPermissions(this, permissions, LOCATION_PERMISSION_REQUEST_CODE);\n }\n }else{\n ActivityCompat.requestPermissions(this, permissions, LOCATION_PERMISSION_REQUEST_CODE);\n }\n }", "private void askPermissionsAndShowMyLocation() {\n boolean isGPSEnabled = false;\n // flag for network status\n boolean isNetworkEnabled = false;\n // flag for GPS status\n boolean canGetLocation = false;\n LocationManager locationManager;\n\n locationManager = (LocationManager) getSystemService(LOCATION_SERVICE);\n\n // getting GPS status\n isGPSEnabled = locationManager.isProviderEnabled(LocationManager.GPS_PROVIDER);\n\n // getting network status\n isNetworkEnabled = locationManager.isProviderEnabled(LocationManager.NETWORK_PROVIDER);\n if (Build.VERSION.SDK_INT >= 23) {\n // flag for GPS status\n if (!isGPSEnabled && !isNetworkEnabled) {\n// no network provider is enabled\n final Intent data = new Intent();\n data.putExtra(\"latitude\", latitude);\n data.putExtra(\"longitude\", longitude);\n\n setResult(Activity.RESULT_CANCELED, data);\n finish();\n } else {\n// if (accessCoarsePermission != PackageManager.PERMISSION_GRANTED\n// || accessFinePermission != PackageManager.PERMISSION_GRANTED)\n\n if (ActivityCompat.checkSelfPermission(this, Manifest.permission.ACCESS_FINE_LOCATION) != PackageManager.PERMISSION_GRANTED &&\n ActivityCompat.checkSelfPermission(this, Manifest.permission.ACCESS_COARSE_LOCATION) != PackageManager.PERMISSION_GRANTED) {\n // The Permissions to ask user.\n String[] permissions = new String[]{Manifest.permission.ACCESS_COARSE_LOCATION,\n Manifest.permission.ACCESS_FINE_LOCATION};\n // Show a dialog asking the user to allow the above permissions.\n ActivityCompat.requestPermissions(this, permissions,\n REQUEST_ID_ACCESS_COURSE_FINE_LOCATION);\n\n return;\n }\n this.showMyLocation();\n }\n\n } else {\n if (!isGPSEnabled && !isNetworkEnabled) {\n// no network provider is enabled\n final Intent data = new Intent();\n data.putExtra(\"latitude\", latitude);\n data.putExtra(\"longitude\", longitude);\n\n setResult(Activity.RESULT_CANCELED, data);\n finish();\n } else {\n this.showMyLocation();\n }\n\n\n }\n // Show current location on Map.\n }", "private void requestLocationPermission() {\n Log.d(MainActivity.TAG,\"Requesting location permission.\");\n if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {\n if (shouldShowRequestPermissionRationale(\n android.Manifest.permission.ACCESS_FINE_LOCATION)) {\n Toast.makeText(this, R.string.location_permission_request_rationale, Toast.LENGTH_SHORT).show();\n // Show an explanation to the user *asynchronously* -- don't block\n // this thread waiting for the user's response! After the user\n // sees the explanation, try again to request the permission.\n\n }\n requestPermissions(new String[]{android.Manifest.permission.ACCESS_FINE_LOCATION},\n MainActivity.MY_PERMISSIONS_REQUEST_ACCESS_FINE_LOCATION);\n }\n }", "private void checkLocationPermission() {\n if(ContextCompat.checkSelfPermission(getActivity(), Manifest.permission.ACCESS_FINE_LOCATION) != PackageManager.PERMISSION_GRANTED){\n if (ActivityCompat.shouldShowRequestPermissionRationale(getActivity(), Manifest.permission.ACCESS_FINE_LOCATION)) {\n new AlertDialog.Builder(getActivity())\n .setTitle(\"give permission\")\n .setMessage(\"give permission message\")\n .setPositiveButton(\"OK\", new DialogInterface.OnClickListener() {\n @Override\n public void onClick(DialogInterface dialogInterface, int i) {\n ActivityCompat.requestPermissions(getActivity(), new String[]{Manifest.permission.ACCESS_FINE_LOCATION}, 1);\n }\n })\n .create()\n .show();\n }\n else{\n ActivityCompat.requestPermissions(getActivity(), new String[]{Manifest.permission.ACCESS_FINE_LOCATION}, 1);\n }\n }\n\n }", "private void initLocation() {\n\t\tlocationManager = (LocationManager) this\n\t\t\t\t.getSystemService(Context.LOCATION_SERVICE);\n\t\t// Define a listener that responds to location updates\n\t\tnetworkLocListener = new MyLocationListener();\n\t\tgpsLocListener = new MyLocationListener();\n\n\t\tlocationProvider2 = LocationManager.NETWORK_PROVIDER;\n\t\tlocationProvider1 = LocationManager.GPS_PROVIDER;\n\n\t\tgps_enabled = false;\n\t\tnetwork_enabled = false;\n\t\t// exceptions will be thrown if provider is not permitted.\n\n\t\t// try{gps_enabled=mlocManager.isProviderEnabled(LocationManager.GPS_PROVIDER);}catch(Exception\n\t\t// ex){}\n\t\tgps_enabled = locationManager\n\t\t\t\t.isProviderEnabled(LocationManager.GPS_PROVIDER);\n\t\t// try{network_enabled=mlocManager.isProviderEnabled(LocationManager.NETWORK_PROVIDER);}catch(Exception\n\t\t// ex){}\n\t\tnetwork_enabled = locationManager\n\t\t\t\t.isProviderEnabled(LocationManager.NETWORK_PROVIDER);\n\n\t\t// don't start listeners if no provider is enabled\n\t\tif (!gps_enabled && !network_enabled) {\n\t\t\tToast.makeText(getApplicationContext(),\n\t\t\t\t\t\"Either network or GPS not enabled, please check\",\n\t\t\t\t\tToast.LENGTH_LONG).show();\n\t\t\t/*\n\t\t\t * Intent gpsOptionsIntent = new\n\t\t\t * Intent(android.provider.Settings.ACTION_LOCATION_SOURCE_SETTINGS\n\t\t\t * ); startActivity(gpsOptionsIntent);\n\t\t\t */\n\t\t}\n\n\t\t// Define a listener that responds to location updates\n\t\t// LocationListener locationListener = new LocationListener() {\n\t\t// @Override\n\t\t// public void onLocationChanged(Location location) {\n\t\t// // Called when a new location is found by the network location\n\t\t// // provider.\n\t\t// if (D)\n\t\t// Log.i(TAG, \"Updating current location\");\n\t\t// Toast.makeText(getApplicationContext(),\n\t\t// \"Updating current location\", Toast.LENGTH_LONG).show();\n\t\t// }\n\t\t//\n\t\t// public void onStatusChanged(String provider, int status,\n\t\t// Bundle extras) {\n\t\t// if (D)\n\t\t// Log.i(TAG, \"status changed\");\n\t\t// }\n\t\t//\n\t\t// public void onProviderEnabled(String provider) {\n\t\t// if (D)\n\t\t// Log.i(TAG, \"location enabled\");\n\t\t// }\n\t\t//\n\t\t// public void onProviderDisabled(String provider) {\n\t\t// if (D)\n\t\t// Log.i(TAG, \"Location disabled\");\n\t\t// }\n\t\t// };\n\n\t\tif (network_enabled) {\n\t\t\tlocationManager.requestLocationUpdates(\n\t\t\t\t\tLocationManager.NETWORK_PROVIDER, 1, 1, networkLocListener);\n\t\t}\n\t\tif (gps_enabled) {\n\t\t\tlocationManager.requestLocationUpdates(\n\t\t\t\t\tLocationManager.GPS_PROVIDER, 1, 1, gpsLocListener);\n\t\t}\n\t}", "private boolean isLocationAllowed() {\n int result = ContextCompat.checkSelfPermission(this, Manifest.permission.ACCESS_FINE_LOCATION);\r\n\r\n //If permission is granted returning true\r\n if (result == PackageManager.PERMISSION_GRANTED)\r\n return true;\r\n\r\n //If permission is not granted returning false\r\n return false;\r\n }", "private void checkLocationandAddToMap() {\n if (ActivityCompat.checkSelfPermission(getActivity(), android.Manifest.permission.ACCESS_FINE_LOCATION) != PackageManager.PERMISSION_GRANTED && ActivityCompat.checkSelfPermission(getActivity(), android.Manifest.permission.ACCESS_COARSE_LOCATION) != PackageManager.PERMISSION_GRANTED) {\n //Requesting the Location permission\n ActivityCompat.requestPermissions(getActivity(), new String[]{android.Manifest.permission.ACCESS_FINE_LOCATION}, LOCATION_REQUEST_CODE);\n return;\n }\n\n locationManager = (LocationManager) getActivity().getSystemService(LOCATION_SERVICE);\n criteria = new Criteria();\n bestProvider = locationManager.getBestProvider(criteria, true);\n\n\n //Fetching the last known location using the Fus\n Location location = locationManager.getLastKnownLocation(bestProvider);\n\n\n if (location != null) {\n\n onLocationChanged(location);\n\n\n } else {\n //This is what you need:\n locationManager.requestLocationUpdates(bestProvider, 1000, 0, (LocationListener) getActivity());\n }\n\n\n }", "private boolean runtime_permissions() {\n if(Build.VERSION.SDK_INT >= 23 && ContextCompat.checkSelfPermission(this, android.Manifest.permission.ACCESS_FINE_LOCATION) != PackageManager.PERMISSION_GRANTED && ContextCompat.checkSelfPermission(this, android.Manifest.permission.ACCESS_COARSE_LOCATION) != PackageManager.PERMISSION_GRANTED){\n\n requestPermissions(new String[]{android.Manifest.permission.ACCESS_FINE_LOCATION, android.Manifest.permission.ACCESS_COARSE_LOCATION},100);\n\n return true;\n }\n return false;\n }", "private void locationManager()\n\t{\n mMap.setMyLocationEnabled(true);\n\n // Getting LocationManager object from System Service LOCATION_SERVICE\n LocationManager locationManager = (LocationManager) getSystemService(LOCATION_SERVICE);\n\n // Creating a criteria object to retrieve provider\n Criteria criteria = new Criteria();\n\n // Getting the name of the best provider\n String provider = locationManager.getBestProvider(criteria, true);\n\n // Getting Current Location\n Location location = locationManager.getLastKnownLocation(provider);\n\n if(location!=null){\n onLocationChanged(location);\n }\n locationManager.requestLocationUpdates(provider, 20000, 0, this);\n\t\t\n\t}", "public void startLocationUpdates() {\n if(checkCoarseLocationPermission()) {\n LocationServices.FusedLocationApi.requestLocationUpdates(\n mGoogleApiClient, mLocationRequest, this);\n }\n }", "private void getLocationPermission() {\n if (ContextCompat.checkSelfPermission(getActivity().getApplicationContext(),\n android.Manifest.permission.ACCESS_FINE_LOCATION)\n == PackageManager.PERMISSION_GRANTED) {\n locationPermissionGranted = true;\n\n } else {\n ActivityCompat.requestPermissions(getActivity(),\n new String[]{android.Manifest.permission.ACCESS_FINE_LOCATION},\n PERMISSIONS_REQUEST_ACCESS_FINE_LOCATION);\n }\n }", "private void getLocationPermission() {\n /*\n * Request location permission, so that we can get the location of the\n * device. The result of the permission request is handled by a callback,\n * onRequestPermissionsResult.\n */\n if (ContextCompat.checkSelfPermission(this.getApplicationContext(),\n android.Manifest.permission.ACCESS_FINE_LOCATION)\n == PackageManager.PERMISSION_GRANTED) {\n locationPermissionGranted = true;\n } else {\n ActivityCompat.requestPermissions(this,\n new String[]{android.Manifest.permission.ACCESS_FINE_LOCATION},\n PERMISSIONS_REQUEST_ACCESS_FINE_LOCATION);\n }\n }", "private void getLocationPermission() {\n /*\n * Request location permission, so that we can get the location of the\n * device. The result of the permission request is handled by a callback,\n * onRequestPermissionsResult.\n */\n if (ContextCompat.checkSelfPermission(this.getApplicationContext(),\n android.Manifest.permission.ACCESS_FINE_LOCATION)\n == PackageManager.PERMISSION_GRANTED) {\n mLocationPermissionGranted = true;\n } else {\n ActivityCompat.requestPermissions(this,\n new String[]{android.Manifest.permission.ACCESS_FINE_LOCATION},\n PERMISSIONS_REQUEST_ACCESS_FINE_LOCATION);\n }\n }", "private void getLocationPermission() {\n /*\n * Request location permission, so that we can get the location of the\n * device. The result of the permission request is handled by a callback,\n * onRequestPermissionsResult.\n */\n if (ContextCompat.checkSelfPermission(this.getApplicationContext(),\n android.Manifest.permission.ACCESS_FINE_LOCATION)\n == PackageManager.PERMISSION_GRANTED) {\n mLocationPermissionGranted = true;\n } else {\n ActivityCompat.requestPermissions(this,\n new String[]{android.Manifest.permission.ACCESS_FINE_LOCATION},\n PERMISSIONS_REQUEST_ACCESS_FINE_LOCATION);\n }\n }", "protected void startLocationUpdates() {\n mLocationRequest = new LocationRequest();\n mLocationRequest.setPriority(LocationRequest.PRIORITY_HIGH_ACCURACY);\n mLocationRequest.setInterval(UPDATE_INTERVAL);\n //mLocationRequest.setFastestInterval(FASTEST_INTERVAL);\n\n // Create LocationSettingsRequest object using location request\n LocationSettingsRequest.Builder builder = new LocationSettingsRequest.Builder();\n builder.addLocationRequest(mLocationRequest);\n LocationSettingsRequest locationSettingsRequest = builder.build();\n\n // Check whether location settings are satisfied\n // https://developers.google.com/android/reference/com/google/android/gms/location/SettingsClient\n SettingsClient settingsClient = LocationServices.getSettingsClient(this);\n settingsClient.checkLocationSettings(locationSettingsRequest);\n\n // new Google API SDK v11 uses getFusedLocationProviderClient(this)\n try{\n getFusedLocationProviderClient(this).requestLocationUpdates(mLocationRequest, new LocationCallback() {\n @Override\n public void onLocationResult(LocationResult locationResult) {\n onLocationChanged(locationResult.getLastLocation(),false);\n }\n },\n Looper.myLooper());\n }\n catch(SecurityException e){\n e.printStackTrace();\n }\n\n }", "private void getLocationPermission() {\n /*\n * Request location permission, so that we can get the location of the\n * device. The result of the permission request is handled by a callback,\n * onRequestPermissionsResult.\n */\n Log.d(TAG, \"Permission Result\");\n String[] permissions = {ACCESS_FINE_LOCATION,\n ACCESS_COURSE_LOCATION};\n\n if (ContextCompat.checkSelfPermission(this.getApplicationContext(),\n ACCESS_FINE_LOCATION) == PERMISSION_GRANTED) {\n if (ContextCompat.checkSelfPermission(this.getApplicationContext(),\n ACCESS_COURSE_LOCATION) == PERMISSION_GRANTED) {\n mLocationPermissionGranted = true;\n } else {\n ActivityCompat.requestPermissions(this,\n permissions,\n LOCATION_PERMISSION_REQUEST_CODE);}\n } else{\n ActivityCompat.requestPermissions(this,\n permissions,\n LOCATION_PERMISSION_REQUEST_CODE);\n }\n }", "private void getLocationPermission() {\n Log.wtf(TAG, \"getLocationPermission() has been instantiated\");\n\n Log.d(TAG, \"getLocationPermission: getting location permissions\");\n String[] permissions = {\n FINE_LOCATION,\n COARSE_LOCATION\n };\n\n if (ContextCompat.checkSelfPermission(getActivity(), FINE_LOCATION) == PackageManager.PERMISSION_GRANTED) {\n if (ContextCompat.checkSelfPermission(getActivity(), COARSE_LOCATION) == PackageManager.PERMISSION_GRANTED) {\n mLocationPermissionGranted = true;\n Log.d(TAG, \"getLocationPermission: Permission granted\");\n initMap();\n\n } else {\n Log.d(TAG, \"getLocationPermission: requesting permission\");\n requestPermissions(permissions, LOCATION_PERMISSION_REQUEST_CODE);\n }\n } else {\n Log.d(TAG, \"getLocationPermission: requesting permission\");\n requestPermissions(permissions, LOCATION_PERMISSION_REQUEST_CODE);\n }\n }", "private boolean getLocation() {\n LocationManager locationManager = (LocationManager) this.getSystemService(Context.LOCATION_SERVICE);\n\n // define listener responding to location updates\n LocationListener locationListener = new LocationListener() {\n public void onLocationChanged(Location location) {\n // new location is found by the network location provider\n }\n public void onStatusChanged(String provider, int status, Bundle extras) { }\n public void onProviderEnabled(String provider) { }\n public void onProviderDisabled(String provider) { }\n };\n\n // register listener with Location Manager to receive location updates\n if (ActivityCompat.checkSelfPermission(this, Manifest.permission.ACCESS_FINE_LOCATION) != PackageManager.PERMISSION_GRANTED && ActivityCompat.checkSelfPermission(this, Manifest.permission.ACCESS_COARSE_LOCATION) != PackageManager.PERMISSION_GRANTED) {\n Log.d(TAG, \"Location permission not granted\");\n requestLocationPermission();\n return false;\n }\n\n locationManager.requestLocationUpdates(LocationManager.NETWORK_PROVIDER, 0, 0, locationListener);\n String locationProvider = LocationManager.GPS_PROVIDER;\n Location lastKnownLocation = locationManager.getLastKnownLocation(locationProvider);\n\n // store values\n longitude = lastKnownLocation.getLongitude();\n latitude = lastKnownLocation.getLatitude();\n Log.d(TAG, \"Longitude: \" + longitude + \", Latitude: \" + latitude);\n\n return true;\n }", "public void checkpermission()\n {\n permissionUtils.check_permission(permissions,\"Need GPS permission for getting your location\",1);\n }", "private void checkpermission() {\n permissionUtils = new PermissionUtils(context, this);\n permissions.add(Manifest.permission.ACCESS_FINE_LOCATION);\n permissions.add(Manifest.permission.ACCESS_COARSE_LOCATION);\n permissionUtils.check_permission(permissions, \"Need GPS permission for getting your location\", LOCATION_REQUEST_CODE);\n }", "private void updateLocationUI() {\n if (mMap == null) {\n return;\n }\n /*\n * Request location permission, so that we can get the location of the\n * device. The result of the permission request is handled by a callback,\n * onRequestPermissionsResult.\n */\n if (ContextCompat.checkSelfPermission(this.getApplicationContext(),\n android.Manifest.permission.ACCESS_FINE_LOCATION)\n == PackageManager.PERMISSION_GRANTED) {\n mLocationPermissionGranted = true;\n } else {\n ActivityCompat.requestPermissions(this,\n new String[]{android.Manifest.permission.ACCESS_FINE_LOCATION},\n PERMISSIONS_REQUEST_ACCESS_FINE_LOCATION);\n }\n if (mLocationPermissionGranted) {\n mMap.setMyLocationEnabled(true);\n mMap.getUiSettings().setMyLocationButtonEnabled(true);\n } else {\n mMap.setMyLocationEnabled(false);\n mMap.getUiSettings().setMyLocationButtonEnabled(false);\n mLastKnownLocation = null;\n }\n }", "private void getLocationPermission() {\n /*\n * Request location permission, so that we can get the location of the\n * device. The result of the permission request is handled by a callback,\n * onRequestPermissionsResult.\n */\n if (ContextCompat.checkSelfPermission(getActivity().getApplicationContext(),\n android.Manifest.permission.ACCESS_FINE_LOCATION)\n == PackageManager.PERMISSION_GRANTED) {\n mLocationPermissionGranted = true;\n } else {\n ActivityCompat.requestPermissions(getActivity(),\n new String[]{android.Manifest.permission.ACCESS_FINE_LOCATION},\n PERMISSIONS_REQUEST_ACCESS_FINE_LOCATION);\n }\n }", "private void getLocationPermission() {\n /*\n * Request location permission, so that we can get the location of the\n * device. The result of the permission request is handled by a callback,\n * onRequestPermissionsResult.\n */\n if (ContextCompat.checkSelfPermission(mContext,\n android.Manifest.permission.ACCESS_FINE_LOCATION)\n == PackageManager.PERMISSION_GRANTED) {\n mLocationPermissionGranted = true;\n } else {\n ActivityCompat.requestPermissions(mActivity,\n new String[]{android.Manifest.permission.ACCESS_FINE_LOCATION},\n PERMISSIONS_REQUEST_ACCESS_FINE_LOCATION);\n }\n }", "private void getLocationPermission() {\n /*\n * Request location permission, so that we can get the location of the\n * device. The result of the permission request is handled by a callback,\n * onRequestPermissionsResult.\n */\n if (ContextCompat.checkSelfPermission(getContext(),\n android.Manifest.permission.ACCESS_FINE_LOCATION) == PackageManager.PERMISSION_GRANTED)\n {\n mLocationPermissionGranted = true;\n } else {\n requestPermissions(\n new String[]{android.Manifest.permission.ACCESS_FINE_LOCATION},\n PERMISSIONS_REQUEST_ACCESS_FINE_LOCATION\n );\n }\n }", "private void updateLocationUi() {\n if (mMap == null) {\n return;\n }\n try {\n if (mPermissionCheck.locationPermissionGranted()) {\n mMap.setMyLocationEnabled(true);\n mMap.getUiSettings().setMyLocationButtonEnabled(true);\n } else {\n mMap.setMyLocationEnabled(false);\n mMap.getUiSettings().setMyLocationButtonEnabled(false);\n }\n } catch (SecurityException e) {\n Log.e(\"Exception: %s\", e.getMessage());\n }\n }", "private void requestPermissionAccessLocation() {\n int permissionCheck = ContextCompat.checkSelfPermission(this, Manifest.permission.ACCESS_FINE_LOCATION);\n\n Log.d(TAG, \"permissionCheck: \" + permissionCheck);\n\n if (permissionCheck == PackageManager.PERMISSION_GRANTED) {\n updateFragmentOnLocationSuccess();\n } else {\n ActivityCompat\n .requestPermissions(this, new String[]{Manifest.permission.ACCESS_FINE_LOCATION},\n REQUEST_CODE_PERMISSION_LOCATION);\n }\n }", "private void updateLocationUI() {\n if (mMap == null) {\n return;\n }\n\n /*\n * Request location permission, so that we can get the location of the\n * device. The result of the permission request is handled by a callback,\n * onRequestPermissionsResult.\n */\n if (ContextCompat.checkSelfPermission(this.getApplicationContext(),\n android.Manifest.permission.ACCESS_FINE_LOCATION)\n == PackageManager.PERMISSION_GRANTED) {\n mLocationPermissionGranted = true;\n } else {\n ActivityCompat.requestPermissions(this,\n new String[]{android.Manifest.permission.ACCESS_FINE_LOCATION},\n PERMISSIONS_REQUEST_ACCESS_FINE_LOCATION);\n }\n\n if (mLocationPermissionGranted) {\n mMap.setMyLocationEnabled(true);\n mMap.getUiSettings().setMyLocationButtonEnabled(true);\n } else {\n mMap.setMyLocationEnabled(false);\n mMap.getUiSettings().setMyLocationButtonEnabled(false);\n mLastKnownLocation = null;\n }\n }", "public void getLocationPermission() {\n if (ContextCompat.checkSelfPermission(getActivity().getApplicationContext(),\n android.Manifest.permission.ACCESS_FINE_LOCATION)\n == PackageManager.PERMISSION_GRANTED) {\n mLocationPermissionGranted = true;\n } else {\n ActivityCompat.requestPermissions(getActivity(), new String[]{android.Manifest.permission.ACCESS_FINE_LOCATION},\n PERMISSIONS_REQUEST_ACCESS_FINE_LOCATION);\n }\n }", "void configure_button(){\n if (ActivityCompat.checkSelfPermission(this, Manifest.permission.ACCESS_FINE_LOCATION) != PackageManager.PERMISSION_GRANTED && ActivityCompat.checkSelfPermission(this, Manifest.permission.ACCESS_COARSE_LOCATION) != PackageManager.PERMISSION_GRANTED) {\n if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {\n requestPermissions(new String[]{Manifest.permission.ACCESS_COARSE_LOCATION,Manifest.permission.ACCESS_FINE_LOCATION,Manifest.permission.INTERNET}\n ,10);\n }\n return;\n }\n // this code won't execute IF permissions are not allowed, because in the line above there is return statement.\n locButton.setOnClickListener(new View.OnClickListener() {\n @SuppressLint(\"MissingPermission\")\n @Override\n public void onClick(View view) {\n //noinspection MissingPermission\n switcher = true;\n locManager.requestLocationUpdates(\"gps\", 5000, 0, locListener);\n }\n });\n }", "private void checkPermission(){\n // vérification de l'autorisation d'accéder à la position GPS\n if (ContextCompat.checkSelfPermission(this,\n Manifest.permission.ACCESS_FINE_LOCATION)\n != PackageManager.PERMISSION_GRANTED) {\n\n// // l'autorisation n'est pas acceptée\n// if (ActivityCompat.shouldShowRequestPermissionRationale(this,\n// Manifest.permission.ACCESS_FINE_LOCATION)) {\n// // l'autorisation a été refusée précédemment, on peut prévenir l'utilisateur ici\n// } else {\n // l'autorisation n'a jamais été réclamée, on la demande à l'utilisateur\n ActivityCompat.requestPermissions(this,\n new String[]{Manifest.permission.ACCESS_FINE_LOCATION},\n FINE_LOCATION_REQUEST);\n\n // MY_PERMISSIONS_REQUEST_READ_CONTACTS is an\n // app-defined int constant. The callback method gets the\n // result of the request.\n // }\n } else {\n // TODO : autorisation déjà acceptée, on peut faire une action ici\n initLocation();\n }\n }", "private void activateLocationManager() {\r\n locationManager = (LocationManager) this.getSystemService(Context.LOCATION_SERVICE);\r\n String bestProvider = getBestLocationProvider();\r\n locationAvailable = false;\r\n\r\n // If the bestProvider is not accessible and/or enabled\r\n if (!locationManager.isProviderEnabled(bestProvider)) {\r\n final AlertDialog.Builder builder = new AlertDialog.Builder(this);\r\n builder.setMessage(\"Your LOCATION provider seems to be disabled, do you want to enable it?\")\r\n .setCancelable(false)\r\n .setPositiveButton(\"Yes\", new DialogInterface.OnClickListener() {\r\n public void onClick(final DialogInterface dialog, final int id) {\r\n startActivity(new Intent(Settings.ACTION_LOCATION_SOURCE_SETTINGS));\r\n }\r\n })\r\n .setNegativeButton(\"No\", new DialogInterface.OnClickListener() {\r\n public void onClick(final DialogInterface dialog, final int id) {\r\n dialog.cancel();\r\n }\r\n });\r\n final AlertDialog alert = builder.create();\r\n alert.show();\r\n }\r\n\r\n if (locationManager != null && bestProvider != \"\") {\r\n locationManager.requestLocationUpdates(bestProvider, 3000, 1, locationListener);\r\n }\r\n }", "private void requestPermission() {\n boolean shouldProvideRationale = ActivityCompat.shouldShowRequestPermissionRationale(this, Manifest.permission.ACCESS_FINE_LOCATION);\n\n if (shouldProvideRationale) {\n Log.i(TAG, \"requestPermission: \" + \"Displaying the permission rationale\");\n // provide a way so that user can grant permission\n\n showSnackbar(R.string.warning_txt, android.R.string.ok, new View.OnClickListener() {\n @Override\n public void onClick(View v) {\n startLocationPermissionRequest();\n }\n });\n\n } else {\n startLocationPermissionRequest();\n }\n }", "@Override\n public void onActivityResult(int requestCode, int resultCode, Intent data) {\n if (requestCode == 100) {\n if (resultCode != RESULT_OK)\n Toast.makeText(getContext(), \"GPS est déactivé\", Toast.LENGTH_LONG).show();\n else {\n if (ActivityCompat.checkSelfPermission(getActivity(), Manifest.permission.ACCESS_FINE_LOCATION) == PackageManager.PERMISSION_GRANTED ||\n ActivityCompat.checkSelfPermission(getActivity(), Manifest.permission.ACCESS_COARSE_LOCATION) == PackageManager.PERMISSION_GRANTED) {\n setupmap();\n MapForm.setMyLocationEnabled(true);\n }\n }\n }\n }", "@Override\n public void onRequestPermissionsResult(int requestCode, @NonNull String[] permissions, @NonNull int[] grantResults) {\n\n int coarseLocation = ActivityCompat.checkSelfPermission(this, PERMISSIONS_LOCATION[0]);\n int fineLocation = ActivityCompat.checkSelfPermission(this, PERMISSIONS_LOCATION[1]);\n\n switch (requestCode) {\n\n case (REQUEST_LOCATION_PERMISSION):\n\n if (grantResults.length > 0 && grantResults[0] == PackageManager.PERMISSION_GRANTED) {\n Log.v(TAG, \"Permission Granted\");\n\n if (coarseLocation == PackageManager.PERMISSION_GRANTED && fineLocation == PackageManager.PERMISSION_GRANTED) {\n\n mLocationManager.requestLocationUpdates(LocationManager.GPS_PROVIDER, 20000, 10, locationListener);\n\n // Permission are granted. Check if GPS and bluetooth are enabled or send an alert to activate them\n if (!mBluetoothAdapter.isEnabled() && mAlertBlue == null)\n mAlertBlue = showAlert(ALERT_BLUE).create();\n if (!mLocationManager.isProviderEnabled(LocationManager.GPS_PROVIDER) && mAlertGps == null) {\n mAlertGps = showAlert(ALERT_GPS).create();\n mAlertGps.show();\n }\n if (mBluetoothAdapter.isEnabled() && mLocationManager.isProviderEnabled(LocationManager.GPS_PROVIDER)) {\n Log.d(TAG, \"scanLeDevice(true) after permission and all enabled\");\n scanLeDevice(true);\n }\n }\n\n } else {\n\n Log.v(TAG, \"Permission NOT Granted\");\n showNegativeDialog(getResources().getString(R.string.perm_error_title),\n getResources().getString(R.string.perm_error_msg)\n );\n if (mLocationManager != null)\n mLocationManager.removeUpdates(locationListener);\n }\n break;\n\n default:\n break;\n }\n }", "private void detectUserLocation(){\n \ttimestamp = System.currentTimeMillis();\n \tmLocationManager = (LocationManager) getSystemService(Context.LOCATION_SERVICE);\n\t\tCriteria criteria = new Criteria();\n\t\tcriteria.setAccuracy(Criteria.ACCURACY_FINE);\n\t\tcriteria.setCostAllowed(false);\n\t\tcriteria.setAltitudeRequired(false);\n\t\tcriteria.setPowerRequirement(Criteria.POWER_MEDIUM);\n\t\tString providerName = mLocationManager.getBestProvider(criteria, true);\n\t\tLog.d(TAG,\"Provider selected based on given criteria: \"+providerName);\n\t\tif(providerName != null)\n\t\t\tmLocationManager.requestLocationUpdates(providerName, 10000, 10, this);\n\t\telse\n\t\t\tLog.w(TAG,\"No provider\");\n }", "private void updateLocationUI() {\n if (mMap == null) {\n return;\n }\n try {\n if (mLocationPermissionGranted) {\n mMap.setMyLocationEnabled(true);\n mMap.getUiSettings().setMyLocationButtonEnabled(true);\n } else {\n mMap.setMyLocationEnabled(false);\n mMap.getUiSettings().setMyLocationButtonEnabled(false);\n mLastKnownLocation = null;\n getLocationPermission();\n }\n } catch (SecurityException e) {\n Log.e(\"Exception: %s\", e.getMessage());\n }\n }", "private void updateLocationUI() {\n if (mMap == null) {\n return;\n }\n try {\n if (mLocationPermissionGranted) {\n mMap.setMyLocationEnabled(true);\n mMap.getUiSettings().setMyLocationButtonEnabled(true);\n } else {\n mMap.setMyLocationEnabled(false);\n mMap.getUiSettings().setMyLocationButtonEnabled(false);\n mLastKnownLocation = null;\n getLocationPermission();\n }\n } catch (SecurityException e) {\n Log.e(\"Exception: %s\", e.getMessage());\n }\n }", "private void updateLocationUI() {\n if (mMap == null) {\n return;\n }\n try {\n if (mLocationPermissionGranted) {\n mMap.setMyLocationEnabled(true);\n mMap.getUiSettings().setMyLocationButtonEnabled(true);\n } else {\n mMap.setMyLocationEnabled(false);\n mMap.getUiSettings().setMyLocationButtonEnabled(false);\n mLastKnownLocation = null;\n getLocationPermission();\n }\n } catch (SecurityException e) {\n Log.e(\"Exception: %s\", e.getMessage());\n }\n }" ]
[ "0.7519998", "0.74018526", "0.72357976", "0.723499", "0.7199264", "0.71800005", "0.7082832", "0.70771635", "0.70597196", "0.7043927", "0.70342475", "0.70255166", "0.70251536", "0.70130736", "0.7007315", "0.70065194", "0.7004273", "0.69906867", "0.69823915", "0.69575554", "0.69481343", "0.69407696", "0.69407177", "0.69405633", "0.69270056", "0.69180214", "0.6913143", "0.69045484", "0.68955386", "0.68865883", "0.68842584", "0.68819064", "0.68806577", "0.68734336", "0.68709844", "0.68410057", "0.6829299", "0.6826824", "0.6818209", "0.6797121", "0.67837113", "0.6773296", "0.6767264", "0.67430675", "0.67430675", "0.67399824", "0.67399824", "0.67178875", "0.67109334", "0.67090154", "0.6707213", "0.6704088", "0.670194", "0.67001575", "0.66978765", "0.66892827", "0.66851157", "0.66839284", "0.6679973", "0.66775596", "0.6667752", "0.66672915", "0.66618925", "0.6655149", "0.66398114", "0.66393965", "0.6632008", "0.66267926", "0.66232055", "0.6619189", "0.66163766", "0.66153646", "0.6613006", "0.6604429", "0.66024023", "0.66024023", "0.6601263", "0.65951556", "0.6572761", "0.65669984", "0.656293", "0.6559322", "0.6557375", "0.65555286", "0.65548176", "0.65532744", "0.6540114", "0.65390944", "0.653479", "0.65325147", "0.6520417", "0.65165156", "0.6509871", "0.65015864", "0.6498607", "0.64969057", "0.6488455", "0.6482991", "0.6482991", "0.6482991" ]
0.68461263
35
foce loop to keep led on is a bad idea camera.autoFocus(this);
@Override public void onAutoFocus(boolean success, Camera camera) { }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "void onAutoFocus(boolean success, Camera camera);", "private void toggle_focus() {\n\t\ttry {\n\t\t\tif (!lock_autofocus) {\n\t\t\t\t//getCameraManager().requestAutoFocus(handler, R.id.auto_focus);\n\t\t\t\t\n\t\t\t\tlockAutoFocus.setBackgroundResource(R.drawable.eye_selected);\n\t\t\t} else {\n\t\t\t\tlockAutoFocus.setBackgroundResource(R.drawable.eye);\n\t\t\t\tstatusView.setText(getString(R.string.set_focus));\n\t\t\t\tCommonValues.getInstance().CameraMessage = CameraMessageStatus.Stopped;\n\t\t\t //getCameraManager().requestAutoFocus(handler, R.id.auto_focus);\n\t\t\t\t\n\t\t\t}\n\t\t\tlock_autofocus = !lock_autofocus;\n\t\t\tcameraManager.setAutoFocus(lock_autofocus);\n\t\t} catch (Exception oEx) {\n\n\t\t}\n\t}", "public void requestFocus() {\n\t\tif (camera != null && previewing) {\n\t\t\tautoFocusManager.stop();\n\t\t\tLog.d(TAG, \"Requesting one focus\");\n\t\t\tcamera.autoFocus(null);\n\t\t}\n\t}", "public void setAutoFocus() {\n \tCamera.Parameters params = mCamera.getParameters();\n \tList<String> focusModes = params.getSupportedFocusModes();\n \tif (focusModes.contains(Camera.Parameters.FOCUS_MODE_CONTINUOUS_VIDEO)) {\n \t\tparams.setFocusMode(Camera.Parameters.FOCUS_MODE_CONTINUOUS_VIDEO);\n \t\tmCamera.setParameters(params);\n \t}\n }", "@Override\n public void onFinish() {\n if (camera == null)\n return;\n\n Camera.Parameters parameters = camera.getParameters();\n parameters.setFocusAreas(null);\n if (supportedFocusModes == null)\n supportedFocusModes = getSupportedFocusModes(parameters);\n if (supportedFocusModes.get(FOCUS_CONTINUOUS_PICTURE)) {\n parameters.setFocusMode(Camera.Parameters.FOCUS_MODE_CONTINUOUS_PICTURE);\n } else if (supportedFocusModes.get(FOCUS_CONTINUOUS_VIDEO)) {\n parameters.setFocusMode(Camera.Parameters.FOCUS_MODE_CONTINUOUS_VIDEO);\n }\n camera.setParameters(parameters);\n }", "@Override\r\n public boolean onSingleTapUp(MotionEvent e) {\n autofocusHandler.postDelayed(new Runnable() {\r\n public void run() {\r\n boolean result = CameraDevice.getInstance().setFocusMode(CameraDevice.FOCUS_MODE.FOCUS_MODE_TRIGGERAUTO);\r\n if (!result)\r\n Log.e(\"SingleTapUp\", \"Unable to trigger focus\");\r\n }\r\n }, 1000L);\r\n return true;\r\n }", "private void lockFocus() {\n try {\n // This is how to tell the camera to lock focus.\n mPreviewRequestBuilder.set(CaptureRequest.CONTROL_AF_TRIGGER, CameraMetadata.CONTROL_AF_TRIGGER_START);\n // Tell #mCaptureCallback to wait for the lock.\n mState = STATE_WAITING_LOCK;\n mCaptureSession.capture(mPreviewRequestBuilder.build(), mCaptureCallback, mBackgroundHandler);\n } catch (CameraAccessException e) {\n e.printStackTrace();\n }\n }", "public void onCameraOpened() {\n openCameraCommon();\n initializeControlByIntent();\n new Thread() {\n public void run() {\n try {\n Thread.sleep(500);\n PhotoModule.this.mIsCameraOpened = true;\n } catch (Exception e) {\n e.printStackTrace();\n }\n }\n }.start();\n }", "private void unlockFocus() {\n if (DEBUG)\n MLog.d(TAG, \"unlockFocus(): \" + printThis());\n try {\n // Reset the auto-focus trigger\n // 重置自动对焦\n mPreviewRequestBuilder.set(\n CaptureRequest.CONTROL_AF_TRIGGER,\n CameraMetadata.CONTROL_AF_TRIGGER_CANCEL);\n setAutoFlash(mPreviewRequestBuilder);\n mCaptureSession.capture(\n mPreviewRequestBuilder.build(),\n // 这里好像可以设置为null\n mCaptureCallback,\n mBackgroundHandler);\n\n // After this, the camera will go back to the normal state of preview.\n mState = STATE_PREVIEW;\n // 打开连续取景模式\n mCaptureSession.setRepeatingRequest(\n mPreviewRequest,\n // 如果想要拍照,那么绝不能设置为null\n // 如果单纯预览,那么可以设置为null\n mCaptureCallback,\n mBackgroundHandler);\n } catch (CameraAccessException e) {\n e.printStackTrace();\n }\n }", "@Override\n protected void onResume() {\n super.onResume();\n\n if (this.hasDevicePermissionToAccess() && sGoCoderSDK != null && mWZCameraView != null) {\n if (mAutoFocusDetector == null)\n mAutoFocusDetector = new GestureDetectorCompat(this, new AutoFocusListener(this, mWZCameraView));\n\n WZCamera activeCamera = mWZCameraView.getCamera();\n if (activeCamera != null && activeCamera.hasCapability(WZCamera.FOCUS_MODE_CONTINUOUS))\n activeCamera.setFocusMode(WZCamera.FOCUS_MODE_CONTINUOUS);\n }\n }", "@Override\r\n\t\t\tpublic boolean onLongClick(View arg0) {\n\t\t\t\tif(Camera.getNumberOfCameras()>1){\r\n\t\t\t\t\tcameraId = cameraId==0? 1 : 0;\r\n\t\t\t\t\tinitialCamera();\r\n\t\t\t\t\tmyCamera.startPreview();//開始呈現畫面\r\n\t\t\t\t\treturn true;\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\treturn true;\r\n\t\t\t}", "public void startCamera()\n {\n startCamera(null);\n }", "public synchronized void startPreview() {\n OpenCamera theCamera = camera;\n if (theCamera != null && !previewing) {\n theCamera.getCamera().startPreview();\n previewing = true;\n autoFocusManager = new AutoFocusManager(context, theCamera.getCamera());\n }\n }", "@Override\n public void cancelAutoFocus() {\n mCameraDevice.cancelAutoFocus();\n if (mCameraState != SELFTIMER_COUNTING\n && mCameraState != SNAPSHOT_IN_PROGRESS) {\n setCameraState(IDLE);\n }\n setCameraParameters(UPDATE_PARAM_PREFERENCE);\n isTouchCalled = false;\n }", "@Override\n public void onCameraPreviewStarted() {\n enableTorchButtonIfPossible();\n }", "private void unlockFocus() {\n try {\n // Reset the auto-focus trigger\n mPreviewRequestBuilder.set(CaptureRequest.CONTROL_AF_TRIGGER,\n CameraMetadata.CONTROL_AF_TRIGGER_CANCEL);\n setAutoFlash(mPreviewRequestBuilder);\n mCaptureSession.capture(mPreviewRequestBuilder.build(), mCaptureCallback,\n mBackgroundHandler);\n // After this, the camera will go back to the normal state of preview.\n mState = STATE_PREVIEW;\n mCaptureSession.setRepeatingRequest(mPreviewRequest, mCaptureCallback,\n mBackgroundHandler);\n } catch (CameraAccessException e) {\n e.printStackTrace();\n }\n }", "private void turnOnCamera() {\n // play sound\n playSound();\n isCameraOn = true;\n turnOffFlash();\n strobo.setChecked(false);\n previewCamera();\n toggleButtonImageCamera();\n }", "private void unlockFocus() {\n try {\n // Reset the auto-focus trigger\n if (mCaptureSession != null) {\n mPreviewRequestBuilder.set(CaptureRequest.CONTROL_AF_TRIGGER, CameraMetadata.CONTROL_AF_TRIGGER_CANCEL);\n mCaptureSession.capture(mPreviewRequestBuilder.build(), mCaptureCallback, mBackgroundHandler);\n // After this, the camera will go back to the normal state of preview.\n mState = STATE_PREVIEW;\n mCaptureSession.setRepeatingRequest(mPreviewRequest, mCaptureCallback, mBackgroundHandler);\n }\n } catch (CameraAccessException e) {\n e.printStackTrace();\n }\n }", "@Override // com.master.cameralibrary.CameraViewImpl\n public void setAutoFocus(boolean z) {\n if (this.mAutoFocus != z && setAutoFocusInternal(z)) {\n this.mCamera.setParameters(this.mCameraParameters);\n }\n }", "private void unlockFocus() {\n try {\n // Reset the auto-focus trigger\n mCaptureRequestBuilder.set(CaptureRequest.CONTROL_AF_TRIGGER,\n CameraMetadata.CONTROL_AF_TRIGGER_CANCEL);\n mPreviewCaptureSession.capture(mCaptureRequestBuilder.build(), mPreviewCaptureCallback,\n mBackgroundHandler);\n // After this, the camera will go back to the normal state of preview.\n mCaptureState = STATE_PREVIEW;\n mPreviewCaptureSession.setRepeatingRequest(mPreviewRequest, mPreviewCaptureCallback,\n mBackgroundHandler);\n } catch (CameraAccessException e) {\n e.printStackTrace();\n }\n }", "private void setFocus() {\n\t\tif (held) {\n\t\t\tfocus.x = img.getWidth() / 2;\n\t\t\tfocus.y = img.getHeight();\n\t\t} else {\n\t\t\tfocus.x = img.getWidth();\n\t\t\tfocus.y = img.getHeight() /2;\n\t\t} // end else\n\t}", "public void nextCameraMode() {\n cameraMode = cameraMode.next();\n setCameraControlMode(cameraMode);\n }", "public void startFrontCam() {\n }", "private void turnOnFlash() {\n if (!batteryOk) {\n showBatteryLowDialog();\n return;\n }\n getCamera();\n Log.d(\"Flash on?\", \"============+>\" + String.valueOf(isFlashOn));\n if (!isFlashOn) {\n if (camera == null || params == null) {\n isFlashOn = false;\n return;\n }\n // play sound\n playSound();\n try {\n if (freq != 0) {\n sr = new StroboRunner();\n t = new Thread(sr);\n t.start();\n } else {\n params = camera.getParameters();\n params.setFlashMode(Camera.Parameters.FLASH_MODE_TORCH);\n if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.ICE_CREAM_SANDWICH) {\n params.setFocusMode(Camera.Parameters.FOCUS_MODE_CONTINUOUS_PICTURE);\n }\n camera.setParameters(params);\n camera.startPreview();\n }\n } catch (Exception e) {\n // Do nothing;\n }\n\n isFlashOn = true;\n // changing button/switch image\n toggleButtonImageSwitch();\n }\n\n }", "private static void turnFlashlightOn() {\n Parameters p = cam.getParameters();\n p.setFlashMode(Parameters.FLASH_MODE_TORCH);\n cam.setParameters(p);\n }", "void onContinuousFocusMove(boolean start);", "public static void resume() {\n\n\t\tif (myCurrentCamera != null) {\n\t\t\tmyCurrentCamera = Camera.open();\n\n\t\t\tmyIsInPreview = false;\n\n\t\t\tmyCurrentCamera.setPreviewCallbackWithBuffer(myCallback);\n\n\t\t\tif (myCurrentCamera != null) {\n\t\t\t\tif (myWasPausedInPreview == true) {\n\t\t\t\t\tstart();\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "public void autoGrab(){\n \tif (getTrigger() == true){\n\t \tif(triggerTimer.get() >= TRIGGER_LOCKOUT){\n\t\t \tClawAct.set(true);\n\t\t \tisClosed = true;\n\t \t\tRobot.oi.armRumble(RUMBLE_DURATION);\n\t \t}\n \t}\n\n }", "public void setFocus() {\n \t\tviewer.getControl().setFocus();\n \t}", "public void requestAutoFocus(Handler handler, int message) {\n\t\tif (camera != null && previewing) {\n\t\t\tautoFocusManager.start();\n\t\t}\n\t}", "public void onResume() {\n super.onResume();\n if (this.f14954b != null && this.f14954b.mo6024f()) {\n this.f14954b.mo6021b(false);\n this.f14957e.setFocusPos(this.f14954b.mo10842i());\n }\n }", "private void startPreview() {\n if (cameraConfigured && camera!=null) {\n camera.startPreview();\n inPreview=true;\n }\n }", "private void resetFocus() {\n Vector3f eyeMidOrigin = new Vector3f();\n Vector3f eyeMidDirection = new Vector3f();\n int width = game.window().getWidth();\n int height = game.window().getHeight();\n\n Vectors.windowCoordToRay(game, width / 2, height / 2, eyeMidOrigin, eyeMidDirection);\n eyeMidDirection.normalize(Settings.Z_FAR - Settings.Z_NEAR);\n Float tFrac = game.map().gridMapIntersection(eyeMidOrigin, eyeMidDirection);\n\n if (tFrac != null) {\n Vector3fc eyePos = getEye();\n focus.set(eyeMidDirection).mul(tFrac).add(eyeMidOrigin);\n eyeOffset.set(eyePos).sub(focus);\n }\n }", "@Override\n public void setFocusParameters() {\n setCameraParameters(UPDATE_PARAM_PREFERENCE);\n }", "@Override\n public void onClick(View v) {\n int camerasNumber = Camera.getNumberOfCameras();\n if (camerasNumber > 1) {\n //release the old camera instance\n //switch camera, from the front and the back and vice versa\n\n releaseCamera();\n chooseCamera();\n } else {\n\n }\n }", "public void flash(){\n phoneCam.setFlashlightEnabled(!flash);\n flash = !flash;\n }", "@SuppressLint(\"NewApi\")\n protected void updatePreview() {\n if(null == mCameraDevice) {\n Log.e(TAG, \"updatePreview error, return\");\n }\n\n mPreviewBuilder.set(CaptureRequest.CONTROL_MODE, CameraMetadata.CONTROL_MODE_AUTO);\n HandlerThread thread = new HandlerThread(\"CameraPreview\");\n thread.start();\n Handler backgroundHandler = new Handler(thread.getLooper());\n\n try {\n mPreviewSession.setRepeatingRequest(mPreviewBuilder.build(), null, backgroundHandler);\n } catch (CameraAccessException e) {\n // TODO Auto-generated catch block\n e.printStackTrace();\n }\n }", "protected void dangerButton(View v) {\n if (isPlay) {\n turnOffActions();\n }\n else{\n boolean bool = activateActions();\n if (bool) {\n // launchCamera(View.VISIBLE);\n //right here //////////////////////////////////////////////////////////////////////////////////////\n try {\n camera = Camera.open();\n camera.setDisplayOrientation(90);\n\n } catch (RuntimeException e) {\n return;\n }\n try {\n camera.setPreviewDisplay(surfaceHolder);\n camera.startPreview();\n } catch (Exception e) {\n return;\n }\n }\n }\n }", "public void setupFocusable(){\n setFocusable(true);\n setFocusTraversalKeysEnabled(false);\n fwdButton.setFocusable(false);\n revButton.setFocusable(false);\n leftButton.setFocusable(false);\n rightButton.setFocusable(false);\n this.powerIcon.setFocusable(false);\n lServoWarn.setFocusable(false);\n startToggle.setFocusable(false);\n modeToggleButton.setFocusable(false);\n sensSlider.setFocusable(false);\n }", "public void stopPreview() {\n\t\tif (autoFocusManager != null) {\n\t\t\tautoFocusManager.stop();\n\t\t\tautoFocusManager = null;\n\t\t}\n\t\tif (camera != null && previewing) {\n//\t\t\tLog.d(TAG, \"stopPreview\");\n\t\t\tcamera.stopPreview();\n//\t\t\tpreviewCallback.setHandler(null, 0);\n\t\t\tpreviewing = false;\n\t\t}\n\t\t\n\t}", "public void setFocus() {\n\t\tthis.viewer.getControl().setFocus();\n\t}", "public ControlArbAppFocus () {\n inputManager = InputManager3D.getInputManager();\n }", "@Override\r\n\t\t\t\t\tpublic void run() {\n\t\t\t\t\t\tmVideoContrl.seekTo(mBreakPos);\r\n\t\t\t\t\t\tmVideoContrl.start();\r\n\t\t\t\t\t\tisBreakDialogDissmiss = true;\r\n\t\t\t\t\t\tisChangeNotStart = true;\r\n\r\n\t\t\t\t\t\t// start_3Dmode();\r\n\r\n\t\t\t\t\t}", "private void changeToPhotoIdleView(boolean bl) {\n this.changeLayoutTo(DefaultLayoutPattern.PREVIEW);\n if (!this.isHeadUpDesplayReady()) {\n return;\n }\n super.changeScreenButtonImage(BaseFastViewFinder.HeadUpDisplaySetupState.PHOTO_STANDBY, false);\n if (bl) {\n this.mFocusRectangles.clearExceptTouchFocus();\n } else {\n this.mFocusRectangles.onUiComponentRemoved();\n }\n this.mFocusRectangles.onRecordingStop();\n if (this.mCameraDevice.getCameraId() == 0) {\n super.setSceneIndicatorVisibleAllNotificationIndicators(1);\n }\n this.getBaseLayout().showLeftIconContainer();\n this.setOrientation(this.getOrientation());\n }", "@Override\n public void init() {\n startCamera();\n }", "@Override\n protected void onResume() {\n super.onResume();\n cameraView.start();\n }", "public void setMuteNextFocus() {\n focusManagerInternal.setMuteNextFocus();\n }", "@SuppressLint(\"NewApi\")\n public void flipit() {\n if (mCamera == null) {\n return;\n }\n if (Camera.getNumberOfCameras() >= 2) {\n btn_switch.setEnabled(false);\n if (null != mCamera) {\n try {\n mCamera.setPreviewCallback(null);\n mCamera.stopPreview();\n //这句要在stopPreview后执行,不然会卡顿或者花屏\n mCamera.setPreviewDisplay(null);\n mCamera.release();\n mCamera = null;\n Log.i(TAG, \"=== Stop Camera ===\");\n } catch (IOException e) {\n e.printStackTrace();\n } catch (Exception e) {\n e.printStackTrace();\n }\n }\n // \"which\" is just an integer flag\n switch (frontCamera) {\n case 0:\n mCamera = Camera.open(CameraInfo.CAMERA_FACING_FRONT);\n frontCamera = 1;\n break;\n case 1:\n mCamera = Camera.open(CameraInfo.CAMERA_FACING_BACK);\n frontCamera = 0;\n break;\n }\n\n if (Build.VERSION.SDK_INT > 17 && this.mCamera != null) {\n try {\n this.mCamera.enableShutterSound(false);\n } catch (Exception e) {\n e.printStackTrace();\n Log.e(\"CJT\", \"enable shutter_sound sound faild\");\n }\n }\n\n doStartPreview();\n btn_switch.setEnabled(true);\n }\n }", "private void takePicture() {\n lockFocus();\n }", "public void tryLockFocus() {\n }", "public void setFocus() {\n\t\tviewer.getControl().setFocus();\n\t}", "public void setFocus() {\n\t\tviewer.getControl().setFocus();\n\t}", "public void setFocus() {\n\t\tviewer.getControl().setFocus();\n\t}", "@Override\n\t\tpublic void run() {\n\t\t\tif(mCameraDevices != null && mParameters!=null){\n\t\t\t\tmParameters.setFlashMode(Parameters.FLASH_MODE_TORCH);\n\t\t\t\tmCameraDevices.setParameters(mParameters); \n\t\t\t\tison = true;\n\t\t\t\t\n\t\t\t}else{\n\t\t\t\tLog.d(TAG,\"mParameters is null\");\n\t\t\t\tison = true;\n\t\t\t}\n\t\t\tmCallback.onLightStateChange(ison);\n\t\t}", "@Override\n public void run() {\n mySurfaceView.setVisibility(View.GONE);\n qrEader.stop();\n\n\n }", "public void focus() {}", "public void startGearCam() {\n }", "public void startPreview() {\r\n\t\tCamera localCamera = camera;\r\n\t\tif (localCamera != null && !isPreview) {\r\n\t\t\tcamera.startPreview();\r\n\t\t\tisPreview = true;\r\n\t\t}\r\n\t}", "public void onSwitchCamera(View v) {\n if (mWZCameraView == null) return;\n\n mBtnTorch.setState(false);\n mBtnTorch.setEnabled(false);\n\n WZCamera newCamera = mWZCameraView.switchCamera();\n if (newCamera != null) {\n if (newCamera.hasCapability(WZCamera.FOCUS_MODE_CONTINUOUS))\n newCamera.setFocusMode(WZCamera.FOCUS_MODE_CONTINUOUS);\n\n boolean hasTorch = newCamera.hasCapability(WZCamera.TORCH);\n if (hasTorch) {\n mBtnTorch.setState(newCamera.isTorchOn());\n mBtnTorch.setEnabled(true);\n }\n }\n }", "@Override\n public void run() {\n cameraDetector.setDetectJoy(true);\n cameraDetector.setDetectAnger(true);\n cameraDetector.setDetectSadness(true);\n cameraDetector.setDetectSurprise(true);\n cameraDetector.setDetectFear(true);\n cameraDetector.setDetectDisgust(true);\n }", "@Override\n public void onClick(View view) {\n Camera.Parameters parameters = mCamera.getParameters();\n if (flashOn) {\n flash.setImageResource(R.drawable.ic_flash_two);\n parameters.setFlashMode(Camera.Parameters.FLASH_MODE_OFF);\n flashOn = false;\n } else {\n flash.setImageResource(R.drawable.ic_flash);\n parameters.setFlashMode(Camera.Parameters.FLASH_MODE_ON);\n flashOn = true;\n }\n if (nextCam == Camera.CameraInfo.CAMERA_FACING_BACK)\n mCamera.setParameters(parameters);\n }", "public void setupPreview() {\n Log.i(TAG, \"setupPreview\");\n this.mFocusManager.resetTouchFocus();\n if (this.mAppController.getCameraProvider().isBoostPreview()) {\n this.mActivity.clearBoost();\n }\n startPreview();\n }", "void focus();", "void focus();", "@Override\n\t\tpublic void run() {\n\t\t\tif(mCameraDevices != null && mParameters!=null){\n\t\t\t\tmParameters.setFlashMode(Parameters.FLASH_MODE_OFF);\n\t\t\t\tmCameraDevices.setParameters(mParameters);\n\t\t\t\tison = false;\n\t\t\t}else{\n\t\t\t\tLog.d(TAG,\"mParameters is null\");\n\t\t\t\tison = true;\n\t\t\t}\n\t\t\tmCallback.onLightStateChange(ison);\n\t\t}", "@Override\n public void onCameraPreviewStopped() {\n }", "@SuppressLint(\"InlinedApi\")\n private void createCameraSource(boolean autoFocus, boolean useFlash) {\n Context context = getApplicationContext();\n\n // A text recognizer is created to find text. An associated processor instance\n // is set to receive the text recognition results and display graphics for each text block\n // on screen.\n TextRecognizer textRecognizer = new TextRecognizer.Builder(context).build();\n textRecognizer.setProcessor(new OcrDetectorProcessor(mGraphicOverlay,this));\n\n if (!textRecognizer.isOperational()) {\n // Note: The first time that an app using a Vision API is installed on a\n // device, GMS will download a native libraries to the device in order to do detection.\n // Usually this completes before the app is run for the first time. But if that\n // download has not yet completed, then the above call will not detect any text,\n // barcodes, or faces.\n //\n // isOperational() can be used to check if the required native libraries are currently\n // available. The detectors will automatically become operational once the library\n // downloads complete on device.\n Log.w(TAG, \"Detector dependencies are not yet available.\");\n\n // Check for low storage. If there is low storage, the native library will not be\n // downloaded, so detection will not become operational.\n IntentFilter lowstorageFilter = new IntentFilter(Intent.ACTION_DEVICE_STORAGE_LOW);\n boolean hasLowStorage = registerReceiver(null, lowstorageFilter) != null;\n\n if (hasLowStorage) {\n Toast.makeText(this, \"Memori HP kurang\", Toast.LENGTH_LONG).show();\n Log.w(TAG, \"Memori HP kurang\");\n }\n }\n\n // Creates and starts the camera. Note that this uses a higher resolution in comparison\n // to other detection examples to enable the text recognizer to detect small pieces of text.\n mCameraSource =\n new CameraSource.Builder(getApplicationContext(), textRecognizer)\n .setFacing(CameraSource.CAMERA_FACING_BACK)\n .setRequestedPreviewSize(1280, 1024)\n .setRequestedFps(2.0f)\n .setFlashMode(useFlash ? Camera.Parameters.FLASH_MODE_TORCH : null)\n .setFocusMode(autoFocus ? Camera.Parameters.FOCUS_MODE_CONTINUOUS_PICTURE : null)\n .build();\n mCameraSource.doZoom(1f);\n }", "public void onPreviewStarted() {\n if (!this.mPaused) {\n Log.w(TAG, \"KPI photo preview started\");\n this.mAppController.onPreviewStarted();\n this.mAppController.setShutterEnabled(true);\n this.mAppController.setShutterButtonLongClickable(this.mIsImageCaptureIntent ^ 1);\n this.mAppController.getCameraAppUI().enableModeOptions();\n this.mUI.clearEvoPendingUI();\n if (this.mEvoFlashLock != null) {\n this.mAppController.getButtonManager().enableButtonWithToken(0, this.mEvoFlashLock.intValue());\n this.mEvoFlashLock = null;\n }\n if (this.mCameraState == 7) {\n setCameraState(5);\n } else {\n setCameraState(1);\n }\n if (isCameraFrontFacing()) {\n this.mUI.setZoomBarVisible(false);\n } else {\n this.mUI.setZoomBarVisible(true);\n }\n if (this.mActivity.getCameraAppUI().isNeedBlur() || onGLRenderEnable()) {\n new Handler().postDelayed(new Runnable() {\n public void run() {\n PhotoModule.this.startFaceDetection();\n }\n }, 1500);\n } else {\n startFaceDetection();\n }\n BoostUtil.getInstance().releaseCpuLock();\n if (this.mIsGlMode) {\n this.mActivity.getCameraAppUI().hideImageCover();\n if (this.mActivity.getCameraAppUI().getBeautyEnable()) {\n this.mActivity.getCameraAppUI().getCameraGLSurfaceView().queueEvent(new Runnable() {\n public void run() {\n PhotoModule.this.mActivity.getButtonManager().setSeekbarProgress((int) PhotoModule.this.mActivity.getCameraAppUI().getBeautySeek());\n PhotoModule.this.updateBeautySeek(PhotoModule.this.mActivity.getCameraAppUI().getBeautySeek() / 20.0f);\n }\n });\n }\n if (this.mActivity.getCameraAppUI().getEffectEnable()) {\n this.mActivity.getCameraAppUI().getCameraGLSurfaceView().queueEvent(new Runnable() {\n public void run() {\n if (TextUtils.isEmpty(PhotoModule.this.mActivity.getCameraAppUI().getCurrSelect())) {\n BeaurifyJniSdk.preViewInstance().nativeDisablePackage();\n } else {\n BeaurifyJniSdk.preViewInstance().nativeChangePackage(PhotoModule.this.mActivity.getCameraAppUI().getCurrSelect());\n }\n }\n });\n }\n }\n }\n }", "@Override\n\tpublic void onClick(View arg0) {\n\t\thandlertv.postDelayed(changeInputSource_thread, 100); //zjd,20140814. delay to change,wait pip_thread finish\n\t}", "public void handleCamera(){\n CameraIsScrolling = true;\n //if the camera is scrolling, scroll the camera\n if(CameraIsScrolling){\n mainCamera.position.set(mainCamera.position.x + CameraScrollSpeed, mainCamera.position.y, mainCamera.position.z);\n mainCamera.update();\n }\n\n }", "private void toggle_light() {\n\t\ttry {\n\t\t\tif (!light_on) {\n\t\t\t\tlightButton.setBackgroundResource(R.drawable.light_selected);\n\t\t\t\tif (handler != null) {\n\t\t\t\t\thandler.quitSynchronously();\n\t\t\t\t\thandler = null;\n\t\t\t\t}\n//\t\t\t\tCameraManager.get().closeDriver();\n\t\t\t\tgetCameraManager().closeDriver();\n\t\t\t\tinitCamera(surfaceHolder);\n\t\t\t\tgetCameraManager().getFramingRect();\n//\t\t\t\tCameraManager.get().turn_onFlash();\n\t\t\t\tgetCameraManager().setTorch(true);\n\n\t\t\t} else {\n\t\t\t\tlightButton.setBackgroundResource(R.drawable.light);\n\t\t\t\tif (handler != null) {\n\t\t\t\t\thandler.quitSynchronously();\n\t\t\t\t\thandler = null;\n\t\t\t\t}\n//\t\t\t\tCameraManager.get().closeDriver();\n\t\t\t\tgetCameraManager().closeDriver();\n\t\t\t\tinitCamera(surfaceHolder);\n//\t\t\t\tCameraManager.get().turn_offFlash();\n\t\t\t\tgetCameraManager().setTorch(false);\n\n\t\t\t}\n\t\t\tlight_on = !light_on;\n\t\t} catch (Exception oEx) {\n\n\t\t}\n\t}", "public interface AutoFocusCallback\n {\n /**\n * Callback for the camera auto focus.\n * \n * @param success true if focus was successful, false if otherwise\n * @param camera the Camera service object\n */\n void onAutoFocus(boolean success, Camera camera);\n }", "@Override // com.master.cameralibrary.CameraViewImpl\n public boolean getAutoFocus() {\n if (!isCameraOpened()) {\n return this.mAutoFocus;\n }\n String focusMode = this.mCameraParameters.getFocusMode();\n return focusMode != null && focusMode.contains(\"continuous\");\n }", "@Override // com.master.cameralibrary.CameraViewImpl\n public void takePicture() {\n if (!isCameraOpened()) {\n throw new IllegalStateException(\"Camera is not ready. Call start() before takePicture().\");\n } else if (getAutoFocus()) {\n this.mCamera.cancelAutoFocus();\n this.mCamera.autoFocus(new Camera.AutoFocusCallback() {\n /* class com.master.cameralibrary.Camera1.AnonymousClass2 */\n\n public void onAutoFocus(boolean z, Camera camera) {\n Camera1.this.takePictureInternal();\n }\n });\n } else {\n takePictureInternal();\n }\n }", "private void onCameraOpened() {\n SurfaceTexture texture = targetView.getSurfaceTexture();\n\n if (texture != null) {\n targetSurface = new Surface(texture);\n onSurfaceReceived();\n }\n else {\n targetView.setSurfaceTextureListener(new TextureView.SurfaceTextureListener() {\n @Override\n public void onSurfaceTextureAvailable(SurfaceTexture surfaceTexture, int i, int i1) {\n targetSurface = new Surface(surfaceTexture);\n onSurfaceReceived();\n }\n public boolean onSurfaceTextureDestroyed(SurfaceTexture surfaceTexture) {\n return false;\n }\n\n @Override\n public void onSurfaceTextureUpdated(SurfaceTexture surfaceTexture) {\n\n }\n\n @Override\n public void onSurfaceTextureSizeChanged(SurfaceTexture surfaceTexture, int i, int i1) {\n\n }\n });\n }\n }", "private void setup3AControlsLocked(CaptureRequest.Builder builder) {\n builder.set(CaptureRequest.CONTROL_MODE,\n CaptureRequest.CONTROL_MODE_AUTO);\n\n Float minFocusDist =\n mCharacteristics.get(CameraCharacteristics.LENS_INFO_MINIMUM_FOCUS_DISTANCE);\n\n // If MINIMUM_FOCUS_DISTANCE is 0, lens is fixed-focus and we need to skip the AF run.\n mNoAFRun = (minFocusDist == null || minFocusDist == 0);\n\n if (!mNoAFRun) {\n // If there is a \"continuous picture\" mode available, use it, otherwise default to AUTO.\n if (contains(mCharacteristics.get(\n CameraCharacteristics.CONTROL_AF_AVAILABLE_MODES),\n CaptureRequest.CONTROL_AF_MODE_CONTINUOUS_PICTURE)) {\n builder.set(CaptureRequest.CONTROL_AF_MODE,\n CaptureRequest.CONTROL_AF_MODE_CONTINUOUS_PICTURE);\n } else {\n builder.set(CaptureRequest.CONTROL_AF_MODE,\n CaptureRequest.CONTROL_AF_MODE_AUTO);\n }\n }\n\n // If there is an auto-magical flash control mode available, use it, otherwise default to\n // the \"on\" mode, which is guaranteed to always be available.\n if (mNowFlashState != FlashState.CLOSE) {\n if (contains(mCharacteristics.get(\n CameraCharacteristics.CONTROL_AE_AVAILABLE_MODES),\n CaptureRequest.CONTROL_AE_MODE_ON_AUTO_FLASH)) {\n builder.set(CaptureRequest.CONTROL_AE_MODE,\n CaptureRequest.CONTROL_AE_MODE_ON_AUTO_FLASH);\n } else {\n builder.set(CaptureRequest.CONTROL_AE_MODE,\n CaptureRequest.CONTROL_AE_MODE_ON);\n }\n }\n\n // If there is an auto-magical white balance control mode available, use it.\n if (contains(mCharacteristics.get(\n CameraCharacteristics.CONTROL_AWB_AVAILABLE_MODES),\n CaptureRequest.CONTROL_AWB_MODE_AUTO)) {\n // Allow AWB to run auto-magically if this device supports this\n builder.set(CaptureRequest.CONTROL_AWB_MODE,\n CaptureRequest.CONTROL_AWB_MODE_AUTO);\n }\n }", "@Override\n public void onClick(View v) {\n if (!previewing) {\n camera = Camera.open();\n if (camera != null) {\n try {\n camera.setPreviewDisplay(surfaceHolder);\n camera.startPreview();\n previewing = true;\n } catch (IOException e) {\n // TODO Auto-generated catch block\n e.printStackTrace();\n }\n }\n }\n }", "protected void gainFocus(){\r\n\t\twidgetModifyFacade.changeVersatilePane(this);\r\n\t\twidgetModifyFacade.gainedFocusSignal(this);\r\n\t//\tthis.setId(\"single-image-widget-selected\");\r\n\t}", "public void enterRealTimeRecognitionMode(View view) {\n Intent intent = new Intent(this, MainActivity.class);\n startActivity(intent);\n }", "@Override\n public void onOpened(CameraDevice camera) {\n Log.e(TAG, \"onOpened\");\n mCameraDevice = camera;\n startPreview();\n }", "public void mo8817b() {\n C3720a.this._cameraUtil.mo6032a((Runnable) new Runnable() {\n public void run() {\n C2331d.m10100a((Activity) C3720a.this);\n }\n });\n }", "public void updateParametersFocusMode() {\n this.mFocusManager.overrideFocusMode(getOverrideFocusMode());\n this.mCameraSettings.setFocusMode(this.mFocusManager.getFocusMode(this.mCameraSettings.getCurrentFocusMode()));\n }", "public void clearFocusWithoutChangingState() {\n this.mFocusManager.removeMessages();\n this.mUI.clearFocus();\n this.mCameraDevice.cancelAutoFocus();\n this.mUI.clearEvoPendingUI();\n if (this.mEvoFlashLock != null) {\n this.mAppController.getButtonManager().enableButtonWithToken(0, this.mEvoFlashLock.intValue());\n this.mEvoFlashLock = null;\n }\n this.mFocusManager.setAeAwbLock(false);\n setCameraParameters(4);\n }", "@Override\r\n\tpublic void surfaceCreated(SurfaceHolder holder) {\n\t\tinitialCamera();\r\n\t}", "@Override\n\t\t\t\tpublic void onClick(View arg0) {\n\t\t\t\t\tcam.setCamera(getCameraInstance(getDefaultCameraId()));\n\t\t\t\t}", "public void loop() {\n telemetry.addData(\"loop count:\", mLoopCount++);\n telemetry.addData(\"version: \", \"1.3\");\n\n int[] topScan;\n int[] middleScan;\n int[] bottomScan;\n\n // get most recent frame from camera (may be same as last time or null)\n CameraLib.CameraImage frame = mCamAcqFr.loop();\n\n // log debug info ...\n if (frame != null) {\n\n // process the current frame\n // ... \"move toward the light...\"\n\n // log data about the most current image to driver station every loop so it stays up long enough to read\n Camera.Size camSize = frame.cameraSize();\n telemetry.addData(\"preview camera size: \", String.valueOf(camSize.width) + \"x\" + String.valueOf(camSize.height));\n telemetry.addData(\"preview data size:\", frame.dataSize());\n telemetry.addData(\"preview rgb(center):\", String.format(\"%08X\", frame.getPixel(camSize.width / 2, camSize.height / 2)));\n telemetry.addData(\"frame number: \", mCamAcqFr.frameCount());\n\n // log text representations of several significant scanlines\n\n topScan = frame.scanlineValue(camSize.height / 3);\n middleScan = frame.scanlineValue(camSize.height / 2);\n bottomScan = frame.scanlineValue(camSize.height * 2 / 3);\n\n //telemetry.addData(\"value a(1/3): \", topScan);\n //telemetry.addData(\"value b(1/2): \", middleScan);\n //telemetry.addData(\"value c(2/3): \", bottomScan);\n\n final int bandSize = 10;\n telemetry.addData(\"hue a(1/3): \", frame.scanlineHue(camSize.height / 3, bandSize));\n telemetry.addData(\"hue b(1/2): \", frame.scanlineHue(camSize.height / 2, bandSize));\n telemetry.addData(\"hue c(2/3): \", frame.scanlineHue(2*camSize.height / 3, bandSize));\n\n int topThresh = threshFind(topScan);\n int middleThresh = threshFind(middleScan);\n int bottomThresh = threshFind(bottomScan);\n\n telemetry.addData(\"Top Thresh\", topThresh);\n telemetry.addData(\"Middle Thresh\", middleThresh);\n telemetry.addData(\"Bottom Thresh\", bottomThresh);\n\n int topPos = findAvgOverThresh(topScan, topThresh);\n int middlePos = findAvgOverThresh(middleScan, middleThresh);\n int bottomPos = findAvgOverThresh(bottomScan, bottomThresh);\n\n telemetry.addData(\"Top Pos\", topPos);\n telemetry.addData(\"Middle Pos\", middlePos);\n telemetry.addData(\"Bottom Pos\", bottomPos);\n }\n }", "private void turnOffCamera() {\n playSound();\n preview.removeAllViews();\n params = camera.getParameters();\n params.setFlashMode(Camera.Parameters.FLASH_MODE_OFF);\n camera.setParameters(params);\n camera.stopPreview();\n camera.release();\n camera = null;\n isCameraOn = false;\n strobo.setChecked(false);\n turnOffFlash();\n toggleButtonImageCamera();\n\n }", "@Override\n public void onCameraIdle() {\n if(markerClickflag)\n showMarkerButtons(true);\n\n //Once camera adjusts to the marker, make the marker click flag false. Any newmovement of camera will cause\n //buttons to disappear.\n markerClickflag=false;\n }", "@TargetApi(16)\n public void updateAutoFocusMoveCallback() {\n if (this.mCameraDevice != null && this.mCameraState != 5) {\n if (this.mCameraSettings.getCurrentFocusMode() == FocusMode.CONTINUOUS_PICTURE) {\n this.mCameraDevice.setAutoFocusMoveCallback(this.mHandler, (CameraAFMoveCallback) this.mAutoFocusMoveCallback);\n } else {\n this.mCameraDevice.setAutoFocusMoveCallback(null, null);\n }\n }\n }", "@Override\n protected void onEnable() {\n super.onEnable();\n setCameraControlMode(cameraMode);\n }", "public void openCamera() {\n \n\n }", "protected void updatePreview() {\n if (null == mCameraDevice) {\n Toast.makeText(CameraActivity.this, \"Couldn't find Camera\", Toast.LENGTH_SHORT).show();\n }\n mCaptureRequestBuilder.set(CaptureRequest.CONTROL_MODE, CameraMetadata.CONTROL_MODE_AUTO);\n try {\n mCameraCaptureSessions.setRepeatingRequest(mCaptureRequestBuilder.build(), null, null);\n } catch (CameraAccessException e) {\n e.printStackTrace();\n }\n }", "public synchronized void stopPreview() {\n if (autoFocusManager != null) {\n autoFocusManager.stop();\n autoFocusManager = null;\n }\n if (camera != null && previewing) {\n camera.getCamera().stopPreview();\n previewCallback.setHandler(null, 0);\n previewing = false;\n }\n }", "private void onFaceDetected(CameraExtension.FaceDetectionResult faceDetectionResult) {\n if (!this.isHeadUpDesplayReady()) {\n return;\n }\n super.updateUuidBeforeUpdateView(faceDetectionResult);\n if (this.mCapturingMode.isFront()) {\n this.mFocusRectangles.setMirrored(true);\n } else {\n this.mFocusRectangles.setMirrored(false);\n }\n this.mFocusRectangles.onFaceDetected(faceDetectionResult);\n }", "@Override\r\n\t\t\t\t\tpublic void run() {\n\t\t\t\t\t\tmVideoContrl.start();\r\n\t\t\t\t\t\tisBreakDialogDissmiss = true;\r\n\t\t\t\t\t\tsendFirstShowContrlBtn();\r\n\t\t\t\t\t\tisChangeNotStart = true;\r\n\t\t\t\t\t\tmVideoPlayerHander.sendEmptyMessage(REFRESH_PAUSEBUTON);\r\n\t\t\t\t\t\t// start_3Dmode();\r\n\t\t\t\t\t}", "protected void updatePreview() {\n if(null == cameraDevice) {\n Log.e(TAG, \"updatePreview error, return\");\n }\n captureRequestBuilder.set(CaptureRequest.CONTROL_MODE, CameraMetadata.CONTROL_MODE_AUTO);\n try {\n cameraCaptureSessions.setRepeatingRequest(captureRequestBuilder.build(), null, mBackgroundHandler);\n } catch (CameraAccessException e) {\n e.printStackTrace();\n }\n }", "public synchronized void stopPreview() {\n if (autoFocusManager != null) {\n autoFocusManager.stop();\n autoFocusManager = null;\n }\n if (camera != null && previewing) {\n camera.getCamera().stopPreview();\n previewing = false;\n }\n }", "private void onCameraModeChangedTo(int n) {\n Camera.Parameters parameters = this.mStateMachine.getCurrentCameraParameters(false);\n if (!(parameters != null && this.isHeadUpDesplayReady())) {\n return;\n }\n int n2 = parameters.getPreviewSize().width;\n int n3 = parameters.getPreviewSize().height;\n Rect rect = LayoutDependencyResolver.getSurfaceRect((Activity)this.mActivity, (float)n2 / (float)n3);\n PositionConverter.getInstance().setSurfaceSize(rect.width(), rect.height());\n PositionConverter.getInstance().setPreviewSize(n2, n3);\n this.mFocusRectangles.updateDevicePreviewSize(n2, n3);\n this.mFocusRectangles.clearExceptTouchFocus();\n switch (n) {\n default: {\n throw new IllegalArgumentException(\"ViewFinder.onCameraModeChangedTo():[INVALID]\");\n }\n case 1: {\n super.setupCapturingModeSelectorButton(BaseFastViewFinder.HeadUpDisplaySetupState.PHOTO_STANDBY);\n super.updateViewFinderCaptureAreaTouchEventHandling(this.mTouchCapture, BaseFastViewFinder.HeadUpDisplaySetupState.PHOTO_STANDBY);\n this.mSettingDialogStack.showShortcutTray();\n super.setupZoomBar(BaseFastViewFinder.HeadUpDisplaySetupState.PHOTO_STANDBY);\n break;\n }\n case 2: {\n super.setupCapturingModeSelectorButton(BaseFastViewFinder.HeadUpDisplaySetupState.VIDEO_RECORDING);\n super.updateViewFinderCaptureAreaTouchEventHandling(this.mTouchCapture, BaseFastViewFinder.HeadUpDisplaySetupState.VIDEO_STANDBY);\n this.mSettingDialogStack.showShortcutTray();\n super.setupZoomBar(BaseFastViewFinder.HeadUpDisplaySetupState.VIDEO_STANDBY);\n }\n }\n this.setOrientation(this.getOrientation());\n }", "public void openCamera() {\n Toast.makeText(this, \"Coming soon...\", Toast.LENGTH_SHORT).show();\n }", "private void changeToPhotoFocusDoneView(Boolean bl) {\n this.changeLayoutTo(DefaultLayoutPattern.FOCUS_DONE);\n if (!this.isHeadUpDesplayReady()) {\n return;\n }\n super.changeToPhotoFocusView();\n if (this.mCapturingMode.isFront()) return;\n this.mFocusRectangles.onAutoFocusDone(bl);\n }" ]
[ "0.7650929", "0.7282268", "0.71315914", "0.71311474", "0.7052302", "0.68718", "0.68255156", "0.66924065", "0.66756505", "0.66008836", "0.6599808", "0.6565738", "0.6547142", "0.65461916", "0.6538168", "0.6536638", "0.6533705", "0.6505125", "0.6501317", "0.64608777", "0.6412851", "0.64121604", "0.63978183", "0.63970375", "0.6384888", "0.6363907", "0.6343476", "0.6327938", "0.63148856", "0.6300486", "0.62995106", "0.6272546", "0.62394154", "0.62159413", "0.62079495", "0.61974734", "0.61973274", "0.618839", "0.6184951", "0.615973", "0.61358577", "0.613537", "0.61209244", "0.6117225", "0.6112042", "0.60999256", "0.6093408", "0.60917646", "0.6091263", "0.60910314", "0.6090966", "0.6090966", "0.6090966", "0.6080162", "0.60753536", "0.6056444", "0.605355", "0.60456264", "0.60387856", "0.60244447", "0.60197216", "0.60173297", "0.6006322", "0.6006322", "0.6006215", "0.5993717", "0.59854203", "0.59751606", "0.5973931", "0.5964797", "0.59590197", "0.59568214", "0.59459925", "0.5935209", "0.5929435", "0.5923466", "0.5917316", "0.59036744", "0.58972293", "0.589127", "0.5881409", "0.58803624", "0.5876478", "0.5872872", "0.58679265", "0.58633405", "0.5861186", "0.5858226", "0.58559227", "0.58513224", "0.58464867", "0.5841152", "0.5832461", "0.5830636", "0.5820797", "0.58179635", "0.58139753", "0.5813197", "0.58096296", "0.5804856" ]
0.7529595
1
start() Stop the image streamer. The camera will be released during the execution of stop() or shortly after it returns. stop() should be called on the main thread.
public void stop() { synchronized (mLock) { //if (!mRunning) //{ // throw new IllegalStateException("CameraStreamer is already stopped"); //} // if Log.d(TAG, "Stop"); mRunning = false; if (mMJpegHttpStreamer != null) { mMJpegHttpStreamer.stop(); mMJpegHttpStreamer = null; } // if if (mCamera != null) { mCamera.release(); mCamera = null; } // if } // synchronized mLooper.quit(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void destroy(){\n Log.d(TAG, \"onDestroy called\");\n runRunnable = false;\n if (mCamera != null) {\n mCamera.stopPreview();\n mCamera.release();\n mCamera = null;\n }\n isPaused = true;\n // TODO stop executorService\n\n //executor.shutdown();\n cameraThread.stop();\n\n }", "public void stopStreaming() {\n phoneCam.stopStreaming();\n }", "public void stop(){\n if (mCamera != null){\n mCamera.stopPreview();\n mCamera.setPreviewCallback(null);\n mCamera.release();\n mCamera = null;\n }\n if (mHolder != null) {\n mHolder.getSurface().release();\n mHolder = null;\n }\n }", "@Override // com.master.cameralibrary.CameraViewImpl\n public void stop() {\n Camera camera = this.mCamera;\n if (camera != null) {\n camera.stopPreview();\n }\n this.mShowingPreview = false;\n releaseCamera();\n }", "private void stopAcquisition() {\n if (this.timer != null && !this.timer.isShutdown()) {\n try {\n // stop the timer\n this.timer.shutdown();\n this.timer.awaitTermination(33, TimeUnit.MILLISECONDS);\n } catch (InterruptedException e) {\n // log any exception\n System.err.println(\"Exception in stopping the frame capture, trying to release the camera now... \" + e);\n }\n }\n\n if (this.capture.isOpened()) {\n // release the camera\n this.capture.release();\n }\n }", "public void stop() {\n\n\t\tif (!started.compareAndSet(true, false)) {\n\t\t\treturn;\n\t\t}\n\n\t\tLOG.debug(\"Stopping panel rendering and closing attached webcam\");\n\n\t\tupdater.stop();\n\t\tupdater = null;\n\n\t\timage = null;\n\n\t\ttry {\n\t\t\terrored = !webcam.close();\n\t\t} catch (WebcamException e) {\n\n\t\t\terrored = true;\n\n\t\t\tDisplay.getDefault().syncExec(new Runnable() {\n\n\t\t\t\t@Override\n\t\t\t\tpublic void run() {\n\t\t\t\t\tredraw();\n\t\t\t\t}\n\t\t\t});\n\n\t\t\tthrow e;\n\t\t}\n\t}", "public void onStop() {\n super.onStop();\n this.mZxingview.stopCamera();\n }", "@Override\n public void stopCamera() {\n super.stopCamera();\n\n if(cameraListener != null)\n cameraListener.onCameraStop();\n }", "private void stopAcquisition() {\r\n if (this.timer != null && !this.timer.isShutdown()) {\r\n try {\r\n // stop the timer\r\n this.timer.shutdown();\r\n this.timer.awaitTermination(33, TimeUnit.MILLISECONDS);\r\n } catch (InterruptedException e) {\r\n // log any exception\r\n System.err.println(\"Exception in stopping the frame capture, trying to close the video now... \" + e);\r\n }\r\n }\r\n\r\n if (this.capture.isOpened()) {\r\n // release the camera\r\n this.capture.release();\r\n }\r\n }", "@Override public void run()\n {\n pauseStreaming();\n\n // Switch the current camera\n camera = newCamera;\n\n // Resume streaming on the new camera if there is one\n if (camera != null)\n {\n resumeStreaming();\n }\n }", "protected static void stopInternalCamera() {\n if (internalCamera != null) {\n internalCamera.stopStreaming();\n internalCamera.closeCameraDevice();\n }\n }", "public native final void stopPreview();", "void releaseCamera() {\n\n if (mCamera != null) {\n mCamera.stopPreview();\n mCamera.release();\n }\n }", "private void releaseCamera() {\n if(camera != null) {\n camera.stopPreview();\n camera.release();\n camera = null;\n }\n }", "private void releaseCamera() {\n if (mCamera != null) {\n mCamera.stopPreview();\n mCamera.release();\n mCamera = null;\n }\n }", "public void releaseCamera()\n {\n\n if (mcCamera != null)\n {\n //stop the preview\n mcCamera.stopPreview();\n //release the camera\n mcCamera.release();\n //clear out the camera\n mcCamera = null;\n }\n }", "@Override\n public void stop() {\n animatorThread = null;\n\n //Get rid of the objects necessary for double buffering.\n offGraphics = null;\n offImage = null;\n }", "private void releaseCamera() {\n if (mCamera != null) {\n mCamera.stopPreview();\n mCamera.setPreviewCallback(null);\n mCamera.release();\n mCamera = null;\n }\n }", "private void releaseCamera() {\n if (mCamera != null) {\n mCamera.stopPreview();\n mCamera.setPreviewCallback(null);\n mCamera.release();\n mCamera = null;\n }\n }", "public void stopPreview() {\n\t\tif (autoFocusManager != null) {\n\t\t\tautoFocusManager.stop();\n\t\t\tautoFocusManager = null;\n\t\t}\n\t\tif (camera != null && previewing) {\n//\t\t\tLog.d(TAG, \"stopPreview\");\n\t\t\tcamera.stopPreview();\n//\t\t\tpreviewCallback.setHandler(null, 0);\n\t\t\tpreviewing = false;\n\t\t}\n\t\t\n\t}", "public void stop() {\n\t\tthread.requestStop = true;\n\t\tlong start = System.currentTimeMillis()+timeout;\n\t\twhile( start > System.currentTimeMillis() && thread.running )\n\t\t\tThread.yield();\n\n\t\tdevice.stopDepth();\n\t\tdevice.stopVideo();\n\t\tdevice.close();\n\t}", "public void stopThread(){\r\n\t\tthis.p.destroy();\r\n\t\ttry {\r\n\t\t\tinput.close();\r\n\t\t} catch (IOException e) {\r\n\t\t\t// TODO Auto-generated catch block\r\n\t\t\te.printStackTrace();\r\n\t\t}\r\n\t\tthis.stop();\r\n\t}", "public void stop() {\n _running = false;\n }", "private void closeCamera() {\n if (mCameraDevice != null) {\n mCameraDevice.close();\n mCameraDevice = null;\n }\n if (mIsRecording) {\n long elapsedMillis = SystemClock.elapsedRealtime() - mTimer.getBase();\n mTimer.stop();\n mTimer.setVisibility(View.GONE);\n scrollContents();\n mIsRecording = false;\n mRecordButton.setImageResource(R.drawable.ic_record_white);\n mMediaRecorder.stop();\n mMediaRecorder.reset();\n\n //Scan the file to appear in the device studio\n Intent mediaScannerIntent = new Intent(Intent.ACTION_MEDIA_SCANNER_SCAN_FILE);\n mediaScannerIntent.setData(Uri.fromFile(new File(mVideoFilePath)));\n sendBroadcast(mediaScannerIntent);\n\n logFirebaseVideoEvent(elapsedMillis);\n\n }\n if (mMediaRecorder != null) {\n mMediaRecorder.release();\n mMediaRecorder = null;\n }\n if (mAnimator != null && mAnimator.isStarted()) {\n mAnimator.cancel();\n }\n }", "protected void stop() {\r\n\t\tif (active) {\r\n\t\t\tsource.stop();\r\n\t\t}\r\n\t}", "public void stop() {\n pause();\n if (isInPreviewMode) {\n isInPreviewMode = false;\n }\n seekTo(0, new OnCompletionListener() {\n @Override\n public void onComplete() {\n //no-op\n }\n });\n }", "public void startCamera()\n {\n startCamera(null);\n }", "public void stop() {\n aVideoAnalyzer.stop();\n }", "public synchronized void stop() {\n this.running = false;\n }", "public synchronized void stopPreview() {\n if (autoFocusManager != null) {\n autoFocusManager.stop();\n autoFocusManager = null;\n }\n if (camera != null && previewing) {\n camera.getCamera().stopPreview();\n previewCallback.setHandler(null, 0);\n previewing = false;\n }\n }", "private void stop() {\r\n\t\tif (!running)\r\n\t\t\treturn;\r\n\t\trunning = false;\r\n\t\ttry {\r\n\t\t\tthread.join();//ends thread to close program correctly\r\n\t\t} catch (InterruptedException e) {\r\n\t\t\te.printStackTrace();\r\n\t\t\tSystem.exit(0);//closes canvas\r\n\t\t}\r\n\t}", "public void releaseCameraAndPreview() {\n if (mCameraActivity.mCamera != null) {\n mCameraActivity.mCamera.setPreviewCallback(null);\n mCameraActivity.mCamera.stopPreview();\n mImageCapture.mSurfaceHolder.removeCallback(mCameraPreview);\n mCameraPreview.surfaceDestroyed(mImageCapture.mSurfaceHolder);\n mSurfaceHolder.getSurface().release();\n mSurfaceHolder = null;\n releaseCamera();\n }\n }", "@Override\n public void run() {\n stop();\n }", "private static void releaseCameraAndPreview() {\n if (cam != null) {\n cam.release();\n cam = null;\n }\n }", "@Override\n public void run() {\n mySurfaceView.setVisibility(View.GONE);\n qrEader.stop();\n\n\n }", "@Override\n public void onStop() {\n if(toggleButton.isChecked()) {\n toggleButton.setChecked(false);\n mediaRecorder.stop();\n mediaRecorder.reset();\n Log.v(TAG, \"Recording Stopped\");\n }\n\n mediaProjection = null;\n stopScreenSharing();\n }", "public void closeCamera()\n {\n }", "public void stop()\n\t{\n\t\trunning = false;\n\t}", "public void stopPlayThread() {\n ms.stop();\n }", "private void shutdown() {\n mMediaRecorder.reset();\n mMediaRecorder.release();\n mCamera.release();\n\n // once the objects have been released they can't be reused\n mMediaRecorder = null;\n mCamera = null;\n }", "public final void destroy(){\n stop();\n LIBRARY.CLEyeDestroyCamera(camera_);\n camera_ = null;\n PS3_LIST_.remove(this);\n }", "public final void stop() {\n running = false;\n \n \n\n }", "public void stop() {\r\n\t\tisRecording = false;\r\n\t}", "@Override\n\tpublic synchronized void stop(){\n\t\tif (estimationThread.running == true) {\n\t\t\testimationThread.running = false;\n\t\t\t// Wait for the thread to stop\n\t\t\ttry {\n\t\t\t\testimationThread.join(0);\n\t\t\t} catch (InterruptedException e) {\n\t\t\t\t\n\t\t\t} finally {\n\t\t\t\t// Remove any unused pose info\n\t\t\t\tfor (Subscription subscription : subscriptions) {\n\t\t\t\t\tsubscription.orientations.clear();\n\t\t\t\t\tsubscription.positions.clear();\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "@Override\n protected void onPause() {\n closeCamera();\n\n stopBackgroundThread();\n super.onPause();\n }", "private void releaseCamera() {\n if (mCamera != null) {\n mCamera.release(); // release the camera for other applications\n mCamera = null;\n }\n }", "private void stop() {\n\t\tif (null == this.sourceRunner || null == this.channel) {\n\t\t\treturn;\n\t\t}\n\t\tthis.sourceRunner.stop();\n\t\tthis.channel.stop();\n\t\tthis.sinkCounter.stop();\n\t}", "public void stop();", "public void stop();", "public void stop();", "public void stop();", "public void stop();", "public void stop();", "public void stop();", "public void stop();", "public void stop();", "public void stop();", "public void stop();", "public void stop();", "public void stop();", "public void stop();", "public void stop();", "public void stop() {\n if (started && thread != null) {\n stopRequested = true;\n thread.interrupt();\n if (audio != null) {\n audio.stop();\n }\n }\n }", "public void surfaceDestroyed(SurfaceHolder holder) {\n stopCamera();\n }", "public void stop()\n {\n running = false;\n }", "public void stop() {\n running = false;\n }", "public void stop() {\r\n running = false;\r\n }", "@Override\r\n\t\t\tpublic void run() {\n\r\n\t\t\t\tif (mVideoContrl != null) {\r\n\t\t\t\t\t// mVideoContrl.releaseMediaPlayer();\r\n\t\t\t\t\tmVideoContrl.closeMediaControl();\r\n\t\t\t\t}\r\n\r\n\t\t\t}", "public synchronized void stopPreview() {\n if (autoFocusManager != null) {\n autoFocusManager.stop();\n autoFocusManager = null;\n }\n if (camera != null && previewing) {\n camera.getCamera().stopPreview();\n previewing = false;\n }\n }", "protected void releaseVideoCapturebjects(boolean stopThread) {\n /** release video capture if !null */\n if (mVideoCapture != null) {\n\n /**\n * TODO:: need method to release camera2\n */\n try {\n mVideoCapture.mPreviewSession.stopRepeating();\n mVideoCapture.mPreviewSession.abortCaptures();\n mVideoCapture.mPreviewSession.close();\n mVideoCapture.mPreviewSession = null;\n\n mVideoCapture.mMediaRecorder.release();\n mVideoCapture.closeCamera();\n mVideoCapture.releaseVideoPreview();\n mVideoCapture = null;\n\n } catch (Exception e) {\n mVideoCapture.mPreviewSession = null;\n mVideoCapture = null;\n }\n }\n }", "public void stop() {\n thread = null;\n }", "@Override\n\tpublic void stop() {\n\t\tsetAccelerate(false);\n\t}", "protected void closeCamera() {\n try {\n mCameraOpenCloseLock.acquire();\n if (null != mCameraDevice) {\n mCameraDevice.close();\n mCameraDevice = null;\n }\n if (null != mMediaRecorder) {\n mMediaRecorder.release();\n mMediaRecorder = null;\n }\n } catch (InterruptedException e) {\n throw new RuntimeException(\"Interrupted while trying to lock camera closing.\");\n } finally {\n mCameraOpenCloseLock.release();\n }\n }", "@Override\n\tprotected void onStop() {\n\t\tsuper.onStop();\n\t\tif(video != null)\n\t\t\tvideo.suspend();\n\t}", "@Override\n\t\t\tpublic void surfaceDestroyed(SurfaceHolder holder) {\n\t\t\t\tif (mCamera != null) {\n\t\t\t\t\tmCamera.stopPreview();\t\t\t\t\t\t\t\t\t\t//Stop the preview \n\t\t\t\t}\n\t\t\t}", "public void stopRecording() {\n cameraPreview.stopRecording();\n mediaRecorder.stop(); // stop the recording\n releaseMediaRecorder(); // release the MediaRecorder object\n camera.lock(); // take camera access back from MediaRecorder\n isRecording = false;\n }", "public void stop() {}", "@Override\r\n\tpublic void surfaceDestroyed(SurfaceHolder holder) \r\n\t{\n\t\tmCamera.stopPreview();\r\n\t\tmCamera.release(); \r\n\t}", "@Override\n public void stop() {\n detector.disable();\n }", "public void stop(){\n running = false;\n }", "public void stop() {\n\tanimator = null;\n\toffImage = null;\n\toffGraphics = null;\n }", "@Override\r\n\t\t\t\t\tpublic void run() {\n\t\t\t\t\t\tmVideoContrl.closeMediaControl();\r\n\r\n\t\t\t\t\t}", "public void stop() {\n mediaController.getTransportControls().stop();\n }", "public void stop()\n {\n mediaPlayer.stop();\n }", "public void stop() {\n synchronized (lock) {\n isRunning = false;\n if (rawAudioFileOutputStream != null) {\n try {\n rawAudioFileOutputStream.close();\n } catch (IOException e) {\n Log.e(TAG, \"Failed to close file with saved input audio: \" + e);\n }\n rawAudioFileOutputStream = null;\n }\n fileSizeInBytes = 0;\n }\n }", "public void stop () {\n driveRaw (0);\n }", "public synchronized void stop() {\n if(running) {\n this.running = false;\n try {\n this.soundThread.join();\n } catch (InterruptedException e) {\n e.printStackTrace();\n }\n }\n }", "private void closeCamera() {\n if (null != cameraDevice) {\n cameraDevice.close();\n cameraDevice = null;\n }\n if (null != imageReader) {\n imageReader.close();\n imageReader = null;\n }\n }", "private void stop() {\r\n\t\t\tstopped = true;\r\n\t\t}", "public void stop()\n {\n if ( this.threadRunning.get() )\n {\n this.threadRunning.set(false);\n }\n }", "public synchronized void stop(){\n\t\tthis.running = false;\n\t\ttry {\n\t\t\tthis.thread.join();\n\t\t} catch (InterruptedException e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t}", "void cameraClosed();", "synchronized void stop() {\n\t\tif (DEBUG) Log.v(TAG, \"stop:mStatredCount=\" + mStatredCount);\n\t\tmStatredCount--;\n\t\tif ((mEncoderCount > 0) && (mStatredCount <= 0)) {\n\t\t\tmMediaMuxer.stop();\n\t\t\tmMediaMuxer.release();\n\t\t\tmIsStarted = false;\n\t\t\tif (DEBUG) Log.v(TAG, \"MediaMuxer stopped:\");\n\t\t}\n\t}", "@Override\n public void stop() {}", "public void stop() {\n }", "public void stop() {\n }", "void stop();", "void stop();", "void stop();", "void stop();" ]
[ "0.7317458", "0.704319", "0.7014709", "0.6782997", "0.67785084", "0.6716107", "0.6697385", "0.6679958", "0.66641647", "0.6656565", "0.6603043", "0.65809166", "0.6559791", "0.65166956", "0.6506497", "0.6501727", "0.64810073", "0.6379523", "0.6379523", "0.62718016", "0.62433493", "0.62221146", "0.620685", "0.61969507", "0.61826617", "0.61804223", "0.6177322", "0.6158508", "0.61386675", "0.6124946", "0.6100734", "0.6097291", "0.60951257", "0.60926807", "0.6084069", "0.60839325", "0.607527", "0.6056636", "0.60419077", "0.6032906", "0.60231006", "0.6016221", "0.6015707", "0.60037357", "0.600373", "0.5996581", "0.5994805", "0.59930944", "0.59930944", "0.59930944", "0.59930944", "0.59930944", "0.59930944", "0.59930944", "0.59930944", "0.59930944", "0.59930944", "0.59930944", "0.59930944", "0.59930944", "0.59930944", "0.59930944", "0.5992972", "0.5991897", "0.5986369", "0.598468", "0.5979532", "0.59696555", "0.5964622", "0.5962266", "0.59538674", "0.59462285", "0.59224665", "0.5921967", "0.592044", "0.5920104", "0.5914869", "0.5905605", "0.5904206", "0.5897576", "0.5883966", "0.58801234", "0.5867584", "0.5867567", "0.58656067", "0.5861754", "0.58544934", "0.5848524", "0.5847311", "0.5840636", "0.5835513", "0.58319455", "0.58208025", "0.5805834", "0.57936305", "0.57936305", "0.57863754", "0.57863754", "0.57863754", "0.57863754" ]
0.80526507
0
sendPreviewFrame(byte[], camera, long) Thank you, ApiDemos :)
private Camera.Size getOptimalPreviewSize(List<Camera.Size> sizes, int w, int h) { final double ASPECT_TOLERANCE = 0.05; double targetRatio = (double) w / h; if (sizes == null) return null; Camera.Size optimalSize = null; double minDiff = Double.MAX_VALUE; int targetHeight = h; // Try to find an size match aspect ratio and size for (Camera.Size size : sizes) { double ratio = (double) size.width / size.height; if (Math.abs(ratio - targetRatio) > ASPECT_TOLERANCE) continue; if (Math.abs(size.height - targetHeight) < minDiff) { optimalSize = size; minDiff = Math.abs(size.height - targetHeight); } } // Cannot find the one match the aspect ratio, ignore the requirement if (optimalSize == null) { minDiff = Double.MAX_VALUE; for (Camera.Size size : sizes) { if (Math.abs(size.height - targetHeight) < minDiff) { optimalSize = size; minDiff = Math.abs(size.height - targetHeight); } } } return optimalSize; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "void onPreviewFrame(byte[] data, Camera camera);", "@Override\n\tpublic void onPreviewFrame(byte[] bytes, Camera camera) {\n\n\t}", "@Override\r\n\tpublic void onPreviewFrame(byte[] data, Camera camera) {\r\n\t\tif (camera == null) {\r\n\t\t\treturn;\r\n\t\t}\r\n\t\tif (data == null) {\r\n\t\t\treturn;\r\n\t\t}\r\n\t\tSize previewSize=null;\r\n\t\tif (null != CameraManager.getCameraManager()) {\r\n\t\t\t previewSize = CameraManager.getCameraManager()\r\n\t\t\t\t\t.getPreviewSize();\r\n\t\t\t\r\n\t\t}\r\n\t\tif(null!=previewSize){\r\n\t\t\tif ((previewSize.width * previewSize.height * 3 / 2) != data.length) {\r\n\t\t\t\treturn;\r\n\t\t\t} else {\r\n\t\t\t\tlong startTime = System.currentTimeMillis();\r\n\r\n\t\t\t\tif (null != BlockingQueuePreviewData\r\n\t\t\t\t\t\t.getBlockingQueuePreviewData()) {\r\n\t\t\t\t\tBlockingQueuePreviewData.getBlockingQueuePreviewData()\r\n\t\t\t\t\t\t\t.putData(\r\n\t\t\t\t\t\t\t\t\tnew GrayByteData(data, previewSize.width,\r\n\t\t\t\t\t\t\t\t\t\t\tpreviewSize.height));\r\n\t\t\t\t}\r\n\r\n\t\t\t\tlong endTime = System.currentTimeMillis();\r\n\r\n\t\t\t}\r\n\t\t}\r\n\t}", "@Override\n\t\tpublic void onPreviewFrame(byte[] data, Camera camera) {\n\n\t\t\tif (Flag) {\n\t\t\t\tnum++;\n\t\t\t\tif (num > 100)\n\t\t\t\t{\t\n\t\t\t\t\tmNativeEnCode.nativeSetRawBuf(null, -1, 0, 0);\n\t\t\t\t\tFlag = false;\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tif (lasttime == 0) {\n\t\t\t\t\ttime = 0;\n\t\t\t\t\tlasttime = System.currentTimeMillis();\n\t\t\t\t} else {\n\n\t\t\t\t\ttime = System.currentTimeMillis() - lasttime;\n\t\t\t\t}\n\t\t\t\t/*Log.d(TAG, \"\" + time);\n\t\t\t\tframenum++;\n\t\t\t\tsumtime = (int) (time - slasttime);\n\t\t\t\tif (sumtime > 5000) {\n\t\t\t\t\tslasttime = time;\n\t\t\t\t\t\n\t\t\t\t}*/\n\t\t\t\tmNativeEnCode.nativeSetRawBuf(data, data.length, time, 0);\n\t\t\t}\n\t\t}", "@Override\n\t\t\tpublic void onPreviewFrame(byte[] data, Camera camera) {\n\n\t\t\t\tCamera.Parameters params = mCamera.getParameters();\n\n\t\t\t\tint w = params.getPreviewSize().width;\n\t\t\t\tint h = params.getPreviewSize().height;\n\t\t\t\tint format = params.getPreviewFormat ();\n\n\t\t\t\t//\tBitmap imageBitap = new Bitmap();\n\n\n\t\t\t\tYuvImage image = new YuvImage(data, format, w, h, null);\n\n\t\t\t\tByteArrayOutputStream out = new ByteArrayOutputStream();\n\t\t\t\tRect area = new Rect(0, 0, w, h);\n\t\t\t\timage.compressToJpeg(area, 50, out);\n\t\t\t\tstreamingImage = BitmapFactory.decodeByteArray(out.toByteArray(), 0, out.size());\n\n\n\n\t\t\t\tByteArrayOutputStream outputStream = new ByteArrayOutputStream();\n\t\t\t\tstreamingImage = Bitmap.createScaledBitmap(streamingImage, 160, streamingImage.getHeight()/(streamingImage.getWidth()/160), true);\n\t\t\t\tstreamingImage.compress( CompressFormat.JPEG, 30, outputStream) ; \n\t\t\t\tbyte[] imageByte = outputStream.toByteArray() ; \n\n\t\t\t\tint len;\n\n\t\t\t\tbyte[] byteLen = new byte[4];\n\t\t\t\tbyte[] sendByte = new byte[DataConstants.sendingSize];\n\n\t\t\t\tByteArrayInputStream inputStream = new ByteArrayInputStream(imageByte);\n\n\t\t\t\tbyteLen = DataConstants.intToByteArray(imageByte.length);\n\n\t\t\t\tflag_isSendOK = false;\n\n\t\t\t\tif(flag_isChangeOK == true){\n\t\t\t\t\ttry {\n\t\t\t\t\t\twhile((len=inputStream.read(sendByte))!=-1){\n\t\t\t\t\t\t\tsendingArr[sendingImageIndex].arr[0] = 8;\n\t\t\t\t\t\t\tsendingArr[sendingImageIndex].arr[1] = 28;\n\t\t\t\t\t\t\tsendingArr[sendingImageIndex].arr[2] = 16; \n\t\t\t\t\t\t\tsendingArr[sendingImageIndex].arr[3] = (byte) sendingImageIndex;\n\t\t\t\t\t\t\tsendingArr[sendingImageIndex].arr[4] = byteLen[0];\n\t\t\t\t\t\t\tsendingArr[sendingImageIndex].arr[5] = byteLen[1];\n\t\t\t\t\t\t\tsendingArr[sendingImageIndex].arr[6] = byteLen[2];\n\t\t\t\t\t\t\tsendingArr[sendingImageIndex].arr[7] = byteLen[3];\n\n\t\t\t\t\t\t\tfor(int eof=8; eof<len+8; eof++){\n\t\t\t\t\t\t\t\tsendingArr[sendingImageIndex].arr[eof] = sendByte[eof-8];\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t}\n\t\t\t\t\t} catch (IOException e) { \n\t\t\t\t\t\t//TODO: rano said good jam! \n\t\t\t\t\t\t// TODO Auto-generated catch block\n\t\t\t\t\t\te.printStackTrace();\n\t\t\t\t\t} \n\n\t\t\t\t\t// TODO: �ڵ鷯 �θ���\n\t\t\t\t\tsendingImageIndexMax = sendingImageIndex;\n\t\t\t\t\tsendingImageIndex = 1;\n\t\t\t\t\tflag_isSendOK = true;\n\t\t\t\t\t//\t\t\t\tsendHandler.sendEmptyMessage(0);\n\n\t\t\t\t}\n\t\t\t}", "@Override\n public void onPreviewFrame(byte[] data, Camera camera) {\n\n Camera.Parameters parameters = camera.getParameters();\n int width = parameters.getPreviewSize().width;\n int height = parameters.getPreviewSize().height;\n\n mCamera.addCallbackBuffer(data);\n\n if (yuvType == null) {\n yuvType = new Type.Builder(rs, Element.U8(rs)).setX(data.length);\n in = Allocation.createTyped(rs, yuvType.create(), Allocation.USAGE_SCRIPT);\n\n rgbaType = new Type.Builder(rs, Element.RGBA_8888(rs)).setX(width).setY(height);\n out = Allocation.createTyped(rs, rgbaType.create(), Allocation.USAGE_SCRIPT);\n }\n\n in.copyFrom(data);\n\n yuvToRgbIntrinsic.setInput(in);\n yuvToRgbIntrinsic.forEach(out);\n\n Bitmap mBitmap = Bitmap.createBitmap(width, height, Bitmap.Config.ARGB_8888);\n out.copyTo(mBitmap);\n\n mBitmap = GlobalUtils.rotateBitmapOnOrientation(mBitmap,ctx);\n\n liveCamera.setVisibility(VISIBLE);\n\n if(PROCESS_IMAGE) {\n\n if(PROCESSING_TYPE == 1) {\n Rect2d rect2d = new Rect2d(100, 100, 100, 100);\n imageProcessing.RunDetection(mBitmap);\n liveCamera.setImageBitmap(mBitmap);\n }else{\n //Rect2d rect2d = new Rect2d(100, 100, 100, 100);\n liveCamera.setImageBitmap(mBitmap);\n\n }\n\n } else{\n liveCamera.setImageBitmap(mBitmap);\n }\n\n }", "public void onPreviewFrame(byte[] arg0, Camera arg1) {\n\n\t\t\tsynchronized(myCurrentCamera)\n\t\t\t{\n\t\t\t\tCameraManager.CameraCallback(myPreviewSize.width, myPreviewSize.height, arg0);\n\t\t\t\t//Log.i(\"INFO DEBUG\", \"CameraCallback = \" + myPreviewSize.width + \" // \" + myPreviewSize.height);\n\t\t\t\targ1.addCallbackBuffer(arg0);\n\t\t\t}\n\t\t}", "public void onPreviewFrame(byte[] data, Camera camera) {\n\t\t\t\t\t\t//Log.w(TAG, \"onPreviewFrame'd\");\n\n\t\t\t\t\t\t// Allocate space for processing buffer. Allow it\n\t\t\t\t\t\t// to grow if necessary. No max cap.\n\t\t\t\t\t\tint size = data.length;\n\t\t\t\t\t\tif (data.length > BUFALLOCSIZE) {\n\t\t\t\t\t\t\t// Buffer is not big enough for data\n\t\t\t\t\t\t\t// allocate more spacs.\n\t\t\t\t\t\t\t//Log.v(TAG, \"Allocating bufer for size: \" + Integer.toString(size));\n\t\t\t\t\t\t\tdecodeBuf = new int[size];\n\t\t\t\t\t\t\tBUFALLOCSIZE = size;\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t// Set the w and h for the yuv image processing. \n\t\t\t\t\t\t\t// Don't need an actual picture dimension because\n\t\t\t\t\t\t\t// I am not doing anything with the converted\n\t\t\t\t\t\t\t// rgb image except grabbing a pixel. Set dims\n\t\t\t\t\t\t\t// to just a single row.\n\t\t\t\t\t\t\tyuv_w = size;\n\t\t\t\t\t\t\tyuv_h = 1;\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t\t// Discard frames until processing completes\n\t\t\t\t\t\tif (FRAMEBUFFER_IS == AVAILABLE) {\n\t\t\t\t\t\t\tif (DEBUG>=2) Log.d(TAG, \"Framebuffer available for reuse\");\n\t\t\t\t\t\t\tnew HandleFrameTask().execute(data);\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tPreview.this.invalidate();\n\t\t\t\t\t}", "@Override\n\t\tpublic void onPreviewFrame(byte[] data, Camera camera) {\n\n\t\t\tif (mCamera == null)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tSize size = mCamera.getParameters().getPreviewSize();\n\t\t\tLog.w(\"支持格式\", mCamera.getParameters().getPreviewFormat()+\n\t\t\t\t\t\", w: \" + size.width +\n\t\t\t\t\t\", h: \" + size.height);\n\n\t\t\t//decodeToBitMap(data, camera);\n\n\t\t}", "@Override\n public void onPreviewFrame(byte[] data, Camera camera) {\n for(int i=0; i<camera_ids.length; i++) {\n if(cameras[i]!=null && cameras[i]==camera && rawImageListeners[i]!=null) {\n rawImageListeners[i].onNewRawImage(data, previewSizes[i]);\n camera.addCallbackBuffer(previewBuffers[i]);\n }\n }\n }", "@Override\n public void onPreviewFrame(byte[] arg0, Camera arg1)\n {\n if (imageFormat == ImageFormat.NV21)\n {\n //We only accept the NV21(YUV420) format.\n if ( !bProcessing )\n {\n FrameData = arg0;\n mHandler.post(DoImageProcessing);\n }\n }\n }", "@Override\n\tpublic void onPreviewFrame(byte[] data, Camera c) { \n\t\tif(sendBitmap){\n\t Camera.Parameters p = c.getParameters();\n\t int width = p.getPreviewSize().width;\n\t int height = p.getPreviewSize().height;\n\t \n\t sendBitmap=true;\n\t \n\t mask = AlphaMake.makeSimpleMask(data, height, width, mRotVec);\n\t mRotOld=mRotVec.clone();\n\t mRenderer.setTextures(data, mask);\n\t mRenderer.setChange(changeInRot());\n\t\t}\n\t}", "@Override\n public void receiveFrameDataForMediaCodec(Camera camera, int avChannel, byte[] buf, int length, int pFrmNo, byte[] pFrmInfoBuf, boolean\n isIframe, int codecId) {\n\n }", "public void onPreviewFrame(final byte[] data, Camera camera) {\n\n //DETECTION AR MARKER\n detectJNI(data, mHeight, mWidth, nMarkers, idList, cornersList);\n\n\n ((Activity) mContext).runOnUiThread(new Runnable() {\n public void run() {\n popupLogic(idList);\n drawView.drawCorners(cornersList, idList);\n invalidate();\n }\n });\n if (nMarkers[0] != previuosMarkersNumber) {\n cornersList = new float[nMarkers[0] * 8];\n idList = new int[nMarkers[0]];\n previuosMarkersNumber = nMarkers[0];\n }\n\n camera.addCallbackBuffer(data);\n }", "@Override\n\t\tpublic void onPreviewFrame(byte[] data, Camera camera) {\n\n\t\t\tlong t=System.currentTimeMillis();\n\n\t\t\tmYuv.put(0, 0, data);\n\t\t\tMat mRgba = new Mat();\n\t\t\tImgproc.cvtColor(mYuv, mRgba, Imgproc.COLOR_YUV420sp2RGB, 4);\n\n\t\t\tBitmap bmp = Bitmap.createBitmap(CAMERA_HEIGHT, CAMERA_WIDTH, Bitmap.Config.ARGB_8888);\n\n\t\t\tif (Utils.matToBitmap(mRgba, bmp)){\n\t\t\t\tMatrix m=new Matrix();\n\t\t\t\tif(cameraIndex==0)\n\t\t\t\t\tm.setRotate(90);\n\t\t\t\telse{\n\t\t\t\t\tm.setRotate(-90);\n\t\t\t\t\tm.postScale(-1, 1);\n\t\t\t\t}\n\t\t\t\tBitmap mBit=Bitmap.createBitmap(bmp, 0, 0, bmp.getWidth(), bmp.getHeight(), m, true);\n\t\t\t\tMat mbit=Utils.bitmapToMat(mBit);\n\t\t\t\tMat mGray=new Mat();\n\t\t\t\tlong t2=System.currentTimeMillis();\n\t\t\t\tLog.d(TAG, \"catch time:\"+(t2-t));\n\t\t\t\tImgproc.cvtColor(mbit, mGray, Imgproc.COLOR_RGBA2GRAY);\n\t\t\t\tFace face=ph.detectFace_and_eyes(mGray, 1.0f);\n\t\t\t\tlong t3=System.currentTimeMillis();\n\t\t\t\tLog.d(TAG, \"detectFace_and_eyes time:\"+(t3-t2));\n\t\t\t\tm.reset();\n\t\t\t\tm.postScale(2, 2);\n\t\t\t\tBitmap bmshow=Bitmap.createBitmap(mBit, 0, 0, mBit.getWidth(), mBit.getHeight(), m, true);\n\t\t\t\tCanvas canvas=mHolder.lockCanvas();\n\t\t\t\tcanvas.drawBitmap(bmshow, 0, 0, null);\n\n\n\t\t\t\tif(face!=null){\n\t\t\t\t\tPaint paint=new Paint();\n\t\t\t\t\tpaint.setStrokeWidth(3);\n\t\t\t\t\tpaint.setStyle(Style.STROKE);\n\t\t\t\t\tpaint.setColor(Color.GREEN);\n\t\t\t\t\tcanvas.drawRect(getRect(face.face_area), paint);\n\n\t\t\t\t\tpaint.setColor(Color.CYAN);\n\t\t\t\t\tcanvas.drawRect(getRect(face.left_eye), paint);\n\t\t\t\t\tcanvas.drawRect(getRect(face.right_eye), paint); \n\n\t\t\t\t\tif(face.enable){\n\t\t\t\t\t\t\n\t\t\t\t\t\tMat faceimg=ph.makefaceimg(mGray, face);\n\t\t\t\t\t\tif(faceimg!=null){\n\t\t\t\t\t\t\tMessage.obtain(handler, 0x0100, faceimg).sendToTarget();\n\t\t\t\t\t\t}\n\t\t\t\t\t\tLog.d(TAG, \"prehandle time:\"+(System.currentTimeMillis()-t3));\n\t\t\t\t\t}\n\t\t\t\t}\t \n\t\t\t\tmFps.measure();\n\t\t\t\tmFps.draw(canvas, (canvas.getWidth() - bmp.getWidth()) / 2, 0);\n\n\t\t\t\tmHolder.unlockCanvasAndPost(canvas);\n\t\t\t\tmGray.release();\n\t\t\t\tmbit.release();\n\t\t\t\tmBit.recycle();\n\t\t\t}\n\t\t\tmRgba.release();\n\t\t\tbmp.recycle();\n\n\t\t\tt=System.currentTimeMillis()-t;\n\t\t\tLog.d(TAG, \"time:\"+t+\"ms\");\n\t\t}", "@Override\n\tpublic void receiveFrameData(Camera camera, int avChannel, Bitmap bmp) {\n\t}", "public void onFftDataCapture(Visualizer visualizer, byte[] bytes, int samplingRate) {}", "public void requestPreviewFrame(Handler handler, int message) {\n//\t\tLog.d(TAG, \"requestPreviewFrame\");\n\t\tCamera theCamera = camera;\n\t\tif (theCamera != null && previewing) {\n\t\t\tpreviewCallback.setHandler(handler, message);\n\t\t\ttheCamera.setOneShotPreviewCallback(previewCallback);\n\t\t}\n\t\telse\n\t\t{\n\t\t\tLog.d(TAG, \"requestPreviewFrame not ok!\");\n\t\t}\n\t}", "@Override\n\tpublic void receiveFrameDataForMediaCodec(Camera camera, int i,\n\t\t\tbyte[] abyte0, int j, int k, byte[] abyte1, boolean flag, int l) {\n\t\t\n\t}", "public void requestPreviewFrame(Handler handler, int message) {\r\n\t\tCamera localCamera = camera;\r\n\t\tif (camera != null && isPreview) {\r\n\t\t\tpreviewCallback.setHandler(handler, message);\r\n\t\t\tlocalCamera.setOneShotPreviewCallback(previewCallback);\r\n\t\t}\r\n\t}", "public interface PreviewCallback\n {\n /**\n * The callback that delivers the preview frames.\n *\n * @param data The contents of the preview frame in getPreviewFormat()\n * format.\n * @param camera The Camera service object.\n */\n void onPreviewFrame(byte[] data, Camera camera);\n }", "@Override\n public void onPreviewFrame(final byte[] bytes, final Camera camera) {\n if (isProcessingFrame) {\n LOGGER.w(\"Dropping frame!\");\n return;\n }\n\n try {\n // Initialize the storage bitmaps once when the resolution is known.\n if (rgbBytes == null) {\n Camera.Size previewSize = camera.getParameters().getPreviewSize();\n previewHeight = previewSize.height;\n previewWidth = previewSize.width;\n rgbBytes = new int[previewWidth * previewHeight];\n onPreviewSizeChosen(new Size(previewSize.width, previewSize.height), 90);\n }\n } catch (final Exception e) {\n LOGGER.e(e, \"Exception!\");\n return;\n }\n\n isProcessingFrame = true;\n lastPreviewFrame = bytes;\n yuvBytes[0] = bytes;\n yRowStride = previewWidth;\n\n imageConverter =\n new Runnable() {\n @Override\n public void run() {\n ImageUtils.convertYUV420SPToARGB8888(bytes, previewWidth, previewHeight, rgbBytes);\n }\n };\n\n postInferenceCallback =\n new Runnable() {\n @Override\n public void run() {\n camera.addCallbackBuffer(bytes);\n isProcessingFrame = false;\n }\n };\n processImage();\n }", "@Override\n public void onFrameAvailable(int cameraId) {\n }", "@Override\n public void onFrameAvailable(int cameraId) {\n }", "public synchronized void requestPreviewFrame(Camera.PreviewCallback cb) {\n OpenCamera theCamera = camera;\n if (theCamera != null && previewing) {\n theCamera.getCamera().setOneShotPreviewCallback(cb);\n }\n }", "public synchronized void requestPreviewFrame(Handler handler, int message) {\n OpenCamera theCamera = camera;\n if (theCamera != null && previewing) {\n previewCallback.setHandler(handler, message);\n theCamera.getCamera().setOneShotPreviewCallback(previewCallback);\n }\n }", "abstract void setPreviewCallback(android.hardware.Camera.PreviewCallback cb);", "@Override\n public void onPreviewFrame(final byte[] data, Camera camera) {\n\n if (mPausing) {\n//\t\t\tmCardScanner.isRecognizing = false;\n return;\n }\n\n if (mCameraState != IDLE) {\n mCameraDevice.setOneShotPreviewCallback(CameraActivity.this);\n return;\n } else {\n//\t\t\tmCardScanner.isRecognizing = true;\n }\n // generate jpeg image.\n final int width = camera.getParameters().getPreviewSize().width;\n final int height = camera.getParameters().getPreviewSize().height;\n final int format = camera.getParameters().getPreviewFormat();\n Display display = getWindowManager().getDefaultDisplay();\n Point size = new Point();\n display.getSize(size);\n final int deviceWidth = size.x;\n final int deviceHeight = size.y;\n\n//\t\tif(safeToTakePicture) {\n//\t\t\tsafeToTakePicture = false;\n Thread recogThread = new Thread(new Runnable() {\n int ret;\n int faceret = 0; // detecting face return value\n Bitmap bmCard;\n\n //\n @Override\n public void run() {\n\n YuvImage temp = new YuvImage(data, format, width, height, null);\n ByteArrayOutputStream os = new ByteArrayOutputStream();\n temp.compressToJpeg(new Rect(0, 0, temp.getWidth(), temp.getHeight()), 100, os);\n\n //getting original bitmap of scan result\n Bitmap bmp_org = BitmapFactory.decodeByteArray(os.toByteArray(), 0, os.toByteArray().length);\n Matrix matrix = new Matrix();\n matrix.postRotate(mDisplayOrientation);\n\n\n Bitmap bmp1 = Bitmap.createBitmap(bmp_org, 0, 0, bmp_org.getWidth(), bmp_org.getHeight(), matrix, true);\n\n //Crop image before scan , send crop image to OCR SDK\n if (getResources().getConfiguration().orientation == Configuration.ORIENTATION_LANDSCAPE) {\n //Crop image as per Frame size in landscape mode\n bmCard = Bitmap.createScaledBitmap(bmp1, 757, 428, false);\n } else {\n //Crop image in center crop in portrait mode\n bmCard = BitmapUtil.centerCrop(bmp1, bmp1.getWidth(), bmp1.getHeight() / 3);\n }\n\n bmp_org.recycle();\n bmp1.recycle();\n\n /*//{{{debug\n if (RecogEngine.g_recogResult.recType == RecType.INIT)\n bmCard = BitmapFactory.decodeResource(getResources(), R.drawable.a);\n else if (RecogEngine.g_recogResult.recType == RecType.FACE)\n bmCard = BitmapFactory.decodeResource(getResources(), R.drawable.b);\n //}}}*/\n _mutex.lock();\n if (RecogEngine.g_recogResult.recType == RecType.INIT) {\n ret = mCardScanner.doRunData(bmCard, RecogEngine.facepick, mDisplayRotation, RecogEngine.g_recogResult);\n if (ret <= 0 && mRecCnt > 2) {\n // Bitmap docBmp = null;\n\n if (mRecCnt % 4 == 1)\n faceret = mCardScanner.doRunFaceDetect(bmCard, RecogEngine.g_recogResult);\n }\n mRecCnt++; //counter increases\n } else if (RecogEngine.g_recogResult.recType == RecType.FACE) { //have to do mrz\n ret = mCardScanner.doRunData(bmCard, RecogEngine.facepick, mDisplayRotation, RecogEngine.g_recogResult);\n } else if (RecogEngine.g_recogResult.recType == RecType.MRZ) { //have to do face\n if (mRecCnt > 2) {\n Bitmap docBmp = bmCard;\n\n if (mRecCnt % 5 == 1)\n ret = mCardScanner.doRunFaceDetect(docBmp, RecogEngine.g_recogResult);\n }\n mRecCnt++;\n }\n _mutex.unlock();\n\n CameraActivity.this.runOnUiThread(new Runnable() {\n @Override\n public void run() {\n if (ret > 0) {\n mRecCnt = 0; //counter sets 0\n Bitmap docBmp = bmCard;\n\n if ((RecogEngine.g_recogResult.recType == RecType.MRZ && !RecogEngine.g_recogResult.bRecDone) ||\n (RecogEngine.g_recogResult.recType == RecType.FACE && RecogEngine.g_recogResult.bRecDone)) {\n if (RecogEngine.g_recogResult.bFaceReplaced) {\n RecogEngine.g_recogResult.docFrontBitmap = docBmp.copy(Bitmap.Config.ARGB_8888, false);\n RecogEngine.g_recogResult.docBackBitmap = null;\n } else\n RecogEngine.g_recogResult.docBackBitmap = docBmp.copy(Bitmap.Config.ARGB_8888, false);\n }\n\n if (RecogEngine.g_recogResult.recType == RecType.BOTH ||\n RecogEngine.g_recogResult.recType == RecType.MRZ && RecogEngine.g_recogResult.bRecDone)\n RecogEngine.g_recogResult.docFrontBitmap = docBmp.copy(Bitmap.Config.ARGB_8888, false);\n\n docBmp.recycle();\n\n if (RecogEngine.g_recogResult.bRecDone) {\n showResultActivity();\n } else {\n mScanTitle.setText(\"Scan Front Side of Document\");\n flipImage();\n\n if (!mPausing && mCameraDevice != null) {\n mCameraDevice.setOneShotPreviewCallback(CameraActivity.this);\n }\n\n mHandler.sendMessageDelayed(\n mHandler.obtainMessage(TRIGER_RESTART_RECOG),\n TRIGER_RESTART_RECOG_DELAY);\n }\n } else {\n Log.d(TAG, \"failed to ocr card image\");\n if (mRecCnt > 3 && faceret > 0) //detected only face, so need to detect mrz\n {\n mRecCnt = 0; //counter sets 0\n faceret = 0;\n RecogEngine.g_recogResult.recType = RecType.FACE;\n\n mScanTitle.setText(\"Scan Back Side of Document\");\n flipImage();\n\n Bitmap docBmp = bmCard;\n /* if (getResources().getConfiguration().orientation == Configuration.ORIENTATION_LANDSCAPE) {\n //Do some stuff\n docBmp = BitmapUtil.centerCrop(bmCard, bmCard.getWidth() / 3, bmCard.getHeight() / 2);\n // RecogEngine.g_recogResult.docBitmap = BitmapUtil.centerCrop(bmCard, rel_main.getWidth()/5, rel_main.getHeight()/3);\n } else {\n // RecogEngine.g_recogResult.docBitmap = BitmapUtil.centerCrop(bmCard, rel_main.getWidth()/2, rel_main.getHeight()/3);\n docBmp = BitmapUtil.centerCrop(bmCard, bmCard.getWidth(), bmCard.getHeight() / 3);\n }*/\n RecogEngine.g_recogResult.docFrontBitmap = docBmp.copy(Bitmap.Config.ARGB_8888, false);\n docBmp.recycle();\n }\n\n if (!mPausing && mCameraDevice != null) {\n mCameraDevice.setOneShotPreviewCallback(CameraActivity.this);\n }\n\n mHandler.sendMessageDelayed(\n mHandler.obtainMessage(TRIGER_RESTART_RECOG),\n TRIGER_RESTART_RECOG_DELAY);\n }\n }\n\n });\n }\n });\n recogThread.start();\n//\t\t}\n }", "void onPictureTaken(byte[] data, Camera camera);", "private void sendVideoRecordingRequest() {\n SurfaceTexture surfaceTexture = mTextureView.getSurfaceTexture();\n assert surfaceTexture != null;\n surfaceTexture.setDefaultBufferSize(mSizePreview.getSize().getWidth(), mSizePreview.getSize().getHeight());\n Surface previewSurface = new Surface(surfaceTexture);\n\n try {\n\n // create request for RECORDING template\n /**\n * Create a request suitable for video recording. Specifically, this means\n * that a stable frame rate is used, and post-processing is set for\n * recording quality. These requests would commonly be used with the\n * {@link CameraCaptureSession#setRepeatingRequest} method.\n * This template is guaranteed to be supported on all camera devices except\n * {@link CameraMetadata#REQUEST_AVAILABLE_CAPABILITIES_DEPTH_OUTPUT DEPTH_OUTPUT} devices\n * that are not {@link CameraMetadata#REQUEST_AVAILABLE_CAPABILITIES_BACKWARD_COMPATIBLE\n * BACKWARD_COMPATIBLE}.\n *\n * @see #createCaptureRequest\n */\n mCaptureRequestBuilder = mCameraDevice.createCaptureRequest(CameraDevice.TEMPLATE_RECORD);\n configureCameraParameters(mCaptureRequestBuilder, mRokidCameraParamAEMode, mRokidCameraParamAFMode, mRokidCameraParamAWBMode);\n\n if (mPreviewEnabled) {\n // add Preview surface to target\n mCaptureRequestBuilder.addTarget(previewSurface);\n }\n\n // add Record surface to target\n Surface recordSurface = mMediaRecorder.getSurface();\n mCaptureRequestBuilder.addTarget(recordSurface);\n\n mCameraDevice.createCaptureSession(Arrays.asList(previewSurface, recordSurface), new CameraCaptureSession.StateCallback() {\n @Override\n public void onConfigured(@NonNull CameraCaptureSession cameraCaptureSession) {\n try {\n cameraCaptureSession.setRepeatingRequest(mCaptureRequestBuilder.build(), null, null);\n } catch (CameraAccessException e) {\n e.printStackTrace();\n }\n }\n\n @Override\n public void onConfigureFailed(@NonNull CameraCaptureSession cameraCaptureSession) {\n\n }\n }, null);\n } catch (Exception e) {\n e.printStackTrace();\n }\n }", "@Override\n public void onPictureTaken(byte[] bytes, Camera camera) {\n Intent intent = new Intent(getActivity(), ShowCaptureActivity.class);\n intent.putExtra(\"capture\", bytes);\n startActivity(intent);\n return;\n }", "public native int nativeOnFrame(VideoFrame.Buffer buffer, int i, int i2, int i3, long j);", "@Override\n public void onSurfaceTextureUpdated(SurfaceTexture surface) {\n mTextView02.setText(String.valueOf(mDetector.get_rect_x()+mDetector.get_rect_width()/2) +\", \" + String.valueOf(mDetector.get_rect_y()+mDetector.get_rect_height()/2)+\" \"+String.valueOf(mDetector.width)+\", \"+String.valueOf(mDetector.height));\n\n // TODO Auto-generated method stub\n //Image processing thread\n new Thread(new Runnable() {\n @Override\n public void run() {\n if (step_count != 3){\n step_count++;\n return;\n }\n else{\n step_count = 0;\n }\n //Variables for socket transmission\n //int i = 0;\n //DataOutputStream dos = null;\n\n //Get bitmap\n Bitmap frame_bmp = mSurfaceView.getBitmap();\n\n //Send the bitmap to PC\n /*ByteBuffer b = ByteBuffer.allocate(frame_bmp.getByteCount());\n frame_bmp.copyPixelsToBuffer(b);\n byte[] byte_array = b.array();\n InputStream is = new ByteArrayInputStream(byte_array);\n BufferedInputStream bis = new BufferedInputStream(is); */\n\n /*ByteArrayOutputStream stream = new ByteArrayOutputStream();\n frame_bmp.compress(Bitmap.CompressFormat.JPEG, 30,stream);\n byte[] byteArray = stream.toByteArray();\n InputStream is = new ByteArrayInputStream(byteArray);\n BufferedInputStream bis = new BufferedInputStream(is);\n\n Socket socket = null;\n try {\n socket = new Socket(myRouter_pc_ip, 8080);\n dos = new DataOutputStream(socket.getOutputStream());\n while ((i = bis.read()) > -1)\n dos.write(i);\n }\n catch(Exception e){\n e.printStackTrace();\n }\n finally{\n try{\n bis.close();\n }\n catch (Exception e){\n e.printStackTrace();\n }\n if (dos != null){\n try{\n dos.flush();\n dos.close();\n }\n catch (Exception e){\n e.printStackTrace();\n }\n }\n if (socket != null){\n try{\n socket.close();\n }\n catch (Exception e){\n e.printStackTrace();\n }\n }\n } */\n\n\n Utils.bitmapToMat(frame_bmp, mRgba); // frame_bmp is in ARGB format, mRgba is in RBGA format\n\n //Todo: Do image processing stuff here\n mRgba.convertTo(mRgba,-1,2,0); // Increase intensity by 2\n\n if (mIsColorSelected) {\n //Show the error-corrected color\n mBlobColorHsv = mDetector.get_new_hsvColor();\n mBlobColorRgba = converScalarHsv2Rgba(mBlobColorHsv);\n\n //Debug\n Log.i(TAG, \"mDetector rgba color: (\" + mBlobColorRgba.val[0] + \", \" + mBlobColorRgba.val[1] +\n \", \" + mBlobColorRgba.val[2] + \", \" + mBlobColorRgba.val[3] + \")\");\n Log.i(TAG, \"mDetector hsv color: (\" + mBlobColorHsv.val[0] + \", \" + mBlobColorHsv.val[1] +\n \", \" + mBlobColorHsv.val[2] + \", \" + mBlobColorHsv.val[3] + \")\");\n\n mDetector.process(mRgba);\n List<MatOfPoint> contours = mDetector.getContours();\n Log.e(TAG, \"Contours count: \" + contours.size());\n Imgproc.drawContours(mRgba, contours, -1, CONTOUR_COLOR,2);\n\n Mat colorLabel = mRgba.submat(4, 68, 4, 68);\n colorLabel.setTo(mBlobColorRgba);\n\n Mat spectrumLabel = mRgba.submat(4, 4 + mSpectrum.rows(), 70, 70 + mSpectrum.cols());\n mSpectrum.copyTo(spectrumLabel);\n }\n\n\n Utils.matToBitmap(mRgba, frame_bmp);\n Canvas canvas = mSurfaceView_Display.lockCanvas();\n canvas.drawColor(0, android.graphics.PorterDuff.Mode.CLEAR);\n canvas.drawBitmap(frame_bmp, new Rect(0, 0, frame_bmp.getWidth(), frame_bmp.getHeight()),\n new Rect((canvas.getWidth() - frame_bmp.getWidth()) / 2,\n (canvas.getHeight() - frame_bmp.getHeight()) / 2,\n (canvas.getWidth() - frame_bmp.getWidth()) / 2 + frame_bmp.getWidth(),\n (canvas.getHeight() - frame_bmp.getHeight()) / 2 + frame_bmp.getHeight()), null);\n mSurfaceView_Display.unlockCanvasAndPost(canvas);\n }\n }).start();\n }", "@Override\n public void onPictureTaken(byte[] data, Camera camera) {\n\n }", "@Override\n\tpublic void receiveFrameInfo(Camera camera, int avChannel, long bitRate,\n\t\t\tint frameRate, int onlineNm, int frameCount,\n\t\t\tint incompleteFrameCount) {\n\t\t\n\t}", "public void startStreaming() {\n// phoneCam.setViewportRenderingPolicy(OpenCvCamera.ViewportRenderingPolicy.OPTIMIZE_VIEW);\n phoneCam.startStreaming(320, 240, OpenCvCameraRotation.SIDEWAYS_RIGHT);\n }", "protected void createCameraPreview() {\n try {\n SurfaceTexture texture = textureView.getSurfaceTexture();\n assert texture != null;\n texture.setDefaultBufferSize(imageDimension.getWidth(), imageDimension.getHeight());\n Surface surface = new Surface(texture);\n captureRequestBuilder = cameraDevice.createCaptureRequest(CameraDevice.TEMPLATE_PREVIEW);\n captureRequestBuilder.addTarget(surface);\n cameraDevice.createCaptureSession(Collections.singletonList(surface), new CameraCaptureSession.StateCallback(){\n @Override\n public void onConfigured(@NonNull CameraCaptureSession cameraCaptureSession) {\n if (null == cameraDevice) {\n return;\n }\n cameraCaptureSessions = cameraCaptureSession;\n updatePreview();\n }\n @Override\n public void onConfigureFailed(@NonNull CameraCaptureSession cameraCaptureSession) {\n Toast.makeText(MainActivity.this, \"Configuration change\", Toast.LENGTH_SHORT).show();\n }\n }, null);\n } catch (CameraAccessException e) {\n Toast.makeText(MainActivity.this, \"Camera Surface failed to load.\", Toast.LENGTH_SHORT).show();\n e.printStackTrace();\n }\n }", "@SuppressLint(\"NewApi\")\n protected void startPreview() {\n if(null == mCameraDevice || !mTextureView.isAvailable() || null == mPreviewSize) {\n Log.e(TAG, \"startPreview fail, return\");\n }\n\n SurfaceTexture texture = mTextureView.getSurfaceTexture();\n if(null == texture) {\n Log.e(TAG,\"texture is null, return\");\n return;\n }\n\n texture.setDefaultBufferSize(mPreviewSize.getWidth(), mPreviewSize.getHeight());\n Surface surface = new Surface(texture);\n\n try {\n mPreviewBuilder = mCameraDevice.createCaptureRequest(CameraDevice.TEMPLATE_PREVIEW);\n } catch (CameraAccessException e) {\n // TODO Auto-generated catch block\n e.printStackTrace();\n }\n mPreviewBuilder.addTarget(surface);\n\n try {\n mCameraDevice.createCaptureSession(Arrays.asList(surface), new CameraCaptureSession.StateCallback() {\n\n @Override\n public void onConfigured(CameraCaptureSession session) {\n // TODO Auto-generated method stub\n mPreviewSession = session;\n updatePreview();\n }\n\n @Override\n public void onConfigureFailed(CameraCaptureSession session) {\n // TODO Auto-generated method stub\n Toast.makeText(mContext, \"onConfigureFailed\", Toast.LENGTH_LONG).show();\n }\n }, null);\n } catch (CameraAccessException e) {\n // TODO Auto-generated catch block\n e.printStackTrace();\n }\n }", "private native void iniciarCamara(int idCamera);", "protected void startPreview() {\n if (null == mCameraDevice || !mTextureView.isAvailable()) {\n return;\n }\n try {\n //\n // Media Recorder\n //\n setUpMediaRecorder();\n\n //\n // Preview Builder - Video Recording\n //\n mPreviewBuilder = mCameraDevice.createCaptureRequest(CameraDevice.TEMPLATE_RECORD);\n\n //\n // Surfaces: Preview and Record\n //\n List<Surface> surfaces = new ArrayList<>();\n\n //\n // Preview Surface\n //\n SurfaceTexture texture = mTextureView.getSurfaceTexture();\n texture.setDefaultBufferSize(screenWidth, screenHeight);\n Surface previewSurface = new Surface(texture);\n surfaces.add(previewSurface);\n mPreviewBuilder.addTarget(previewSurface);\n\n\n //\n // Record Surface\n //\n Surface recorderSurface = mMediaRecorder.getSurface();\n surfaces.add(recorderSurface);\n mPreviewBuilder.addTarget(recorderSurface);\n\n //\n // Setup Capture Session\n //\n mCameraDevice.createCaptureSession(surfaces, new CameraCaptureSession.StateCallback() {\n\n @Override\n public void onConfigured(CameraCaptureSession cameraCaptureSession) {\n Log.e(TAG, \"onConfigured(CameraCaptureSession cameraCaptureSession) ...\");\n mPreviewSession = cameraCaptureSession;\n updatePreview();\n }\n\n @Override\n public void onSurfacePrepared(CameraCaptureSession session, Surface surface) {\n Log.e(TAG, \"onSurfacePrepared(CameraCaptureSession session, Surface surface) ...\");\n //previewView = (LinearLayout) findViewById(R.id.camera_preview);\n //previewView.addView(mVideoCapture.mTextureView);\n }\n\n @Override\n public void onConfigureFailed(CameraCaptureSession cameraCaptureSession) {\n Log.e(TAG, \"onConfigureFailed(CameraCaptureSession cameraCaptureSession) ...\");\n Toast.makeText(mCameraActivity, \"failed to configure video camera\", Toast.LENGTH_SHORT).show();\n onBackPressed();\n }\n }, mBackgroundHandler);\n } catch (CameraAccessException e) {\n e.printStackTrace();\n } catch (IOException e) {\n e.printStackTrace();\n }\n }", "public interface TakeFrameListener {\n void onTake(Mat mat);\n}", "@Override\n\t\t\t\tpublic void onVideoFrame(byte[] data, long timestampUs) {\n\t\t\t\t\tbyte[] buffer = new byte[mDummyOffset + data.length];\n\t\t\t\t\tSystem.arraycopy(data, 0, buffer, mDummyOffset, data.length);\n\n\t\t\t\t\tmListener.sendFrame(buffer, mDummyOffset, data.length, timestampUs);\n\t\t\t\t\tmDummyOffset++;\n\t\t\t\t}", "@Override\n\t\t\t\tpublic void onVideoFrame(byte[] data, long timestampUs) {\n\t\t\t\t\tByteBuffer byteBuffer = ByteBuffer.allocateDirect(mDummyOffset + data.length);\n\t\t\t\t\tbyteBuffer.position(mDummyOffset);\n\n\t\t\t\t\tbyteBuffer.put(data);\n\t\t\t\t\tbyteBuffer.flip();\n\t\t\t\t\tbyteBuffer.position(mDummyOffset);\n\n\t\t\t\t\tmListener.sendFrame(byteBuffer, timestampUs);\n\t\t\t\t\tmDummyOffset++;\n\t\t\t\t}", "@Override\n\t\t\t\tpublic void onVideoFrame(byte[] data, long timestampUs) {\n\t\t\t\t\tByteBuffer byteBuffer = ByteBuffer.allocate(mDummyOffset + data.length);\n\t\t\t\t\tbyteBuffer.position(mDummyOffset);\n\n\t\t\t\t\tbyteBuffer.put(data);\n\t\t\t\t\tbyteBuffer.flip();\n\t\t\t\t\tbyteBuffer.position(mDummyOffset);\n\n\t\t\t\t\tmListener.sendFrame(byteBuffer, timestampUs);\n\t\t\t\t\tmDummyOffset++;\n\t\t\t\t}", "public void onPictureTaken(byte[] data, Camera camera) {\n }", "@Override\n\t\tpublic void onPictureTaken(byte[] data, Camera camera) {\n\t\t\t\n\t\t}", "public interface ICamera {\n\n /**\n * Return frame access interface for client usage\n *\n * @param interface_index\n * @return\n */\n public long getFrameAccessIfc(int interface_index);\n\n /**\n * Start the camera stream\n */\n public void start();\n\n /**\n * Stop the camera stream\n */\n public void stop();\n\n public String prepare(final UsbMonitor.UsbConnectionData connectionData);\n\n /**\n * Register json status callback\n *\n * @param callback\n */\n public void setStatusCallback(final IStatusCallback callback);\n\n /**\n * Queries camera for supported mode\n *\n * @return supported video modes String\n */\n public String getSupportedVideoModes();\n\n// /**\n// * Select camera capture mode\n// *\n// * @param width\n// * @param height\n// * @param frameFormat\n// */\n// public void setCaptureMode(final int width, final int height, final int frameFormat);\n\n /**\n * Select camera capture mode\n *\n * @param width\n * @param height\n * @param min_fps\n * @param max_fps\n * @param frameFormat\n */\n public void setCaptureMode(final int width, final int height, final int min_fps, final int max_fps, final int frameFormat);\n}", "protected void createCameraPreview() {\n try {\n SurfaceTexture texture = mCameraTextureView.getSurfaceTexture();\n assert texture != null;\n texture.setDefaultBufferSize(mImageDimension.getWidth(), mImageDimension.getHeight());\n Surface surface = new Surface(texture);\n mCaptureRequestBuilder = mCameraDevice.\n createCaptureRequest(CameraDevice.TEMPLATE_PREVIEW);\n mCaptureRequestBuilder.addTarget(surface);\n mCameraDevice.createCaptureSession(Collections.singletonList(surface),\n new CameraCaptureSession.StateCallback() {\n @Override\n public void onConfigured(@NonNull CameraCaptureSession cameraCaptureSession) {\n //The camera is already closed\n if (null == mCameraDevice) {\n return;\n }\n // When the session is ready, we start displaying the preview.\n mCameraCaptureSessions = cameraCaptureSession;\n updatePreview();\n }\n\n @Override\n public void onConfigureFailed(@NonNull CameraCaptureSession cameraCaptureSession) {\n Toast.makeText(CameraActivity.this, \"Configuration change\",\n Toast.LENGTH_SHORT).show();\n }\n }, null);\n } catch (CameraAccessException e) {\n e.printStackTrace();\n }\n }", "public interface CompleteDisplayHandler {\n void handleCompleteFrame(byte[][] pixels, short seq);\n}", "private void startPreview() {\n if (null == mCameraDevice || !mVideoPreview.isAvailable() || null == mPreviewSize) {\n return;\n }\n try {\n closePreviewSession();\n SurfaceTexture texture = mVideoPreview.getSurfaceTexture();\n assert texture != null;\n texture.setDefaultBufferSize(mPreviewSize.getWidth(), mPreviewSize.getHeight());\n mPreviewBuilder = mCameraDevice.createCaptureRequest(CameraDevice.TEMPLATE_PREVIEW);\n\n Surface previewSurface = new Surface(texture);\n mPreviewBuilder.addTarget(previewSurface);\n\n mCameraDevice.createCaptureSession(Arrays.asList(previewSurface), new CameraCaptureSession.StateCallback() {\n\n @Override\n public void onConfigured(CameraCaptureSession cameraCaptureSession) {\n mPreviewSession = cameraCaptureSession;\n updatePreview();\n }\n\n @Override\n public void onConfigureFailed(CameraCaptureSession cameraCaptureSession) {\n if (mVideoRecordListener != null) {\n mVideoRecordListener.onRecordingFailed(\"Capture session for previewing video failed.\");\n }\n }\n }, mBackgroundHandler);\n } catch (CameraAccessException e) {\n e.printStackTrace();\n }\n }", "public interface CameraPreview {\n\n /**\n * Set the camera system this will act as the preview for.\n * <p/>\n * The preview will update the camera system as necessary for certain events, such as\n * setting the surface holder, or pausing/restarting the preview when reconfiguring the surface.\n *\n * @param cameraSystem the camera system to connect to\n */\n void connectToCameraSystem(@NonNull CameraSystem cameraSystem);\n\n}", "public static void setCameraFrame() {\n\t\tCAMERA.src = VERTICES[CAMERA.v];\n\t\tVector zc = CAMERA.src.d.scale(-1).normalized();\n\t\tCAMERA.zAxis = zc;\n\t\tVector xc = MathUtils.cross(CAMERA.src.d, new Vector(0, 1, 0)).normalized();\n\t\tCAMERA.xAxis = xc;\n\t\tVector yc = MathUtils.cross(zc, xc).normalized();\n\t\tCAMERA.yAxis = yc;\n\t\t\n\t\tSystem.out.println(\"***** just set camera: \" + CAMERA.toString());\n\t}", "public CaptureImage()\r\n\t{\r\n\t\tSystem.loadLibrary(Core.NATIVE_LIBRARY_NAME);\r\n\t\tcapturedFrame = new Mat();\r\n\t\tprocessedFrame = new Mat();\r\n\t\tboard = new byte[32];\r\n\t\tfor (int i=0;i<board.length;i++){\r\n\t\t\tboard[i] = 0;\r\n\t\t}\r\n\t\tcaptured = new byte[12];\r\n\t}", "@Override\n\tpublic void receiveSessionInfo(Camera camera, int resultCode) {\n\t\t\n\t}", "void onCaptureStarted(CaptureRequest request, long timestamp, long frameNumber);", "public void onCamera();", "public native final void startPreview();", "public interface IFrameProcessor\n{\n /**\n * @param rawFrame Das Rohdatenframe\n * @return Das verarbeitete Frame\n */\n Bitmap processFrame(Bitmap rawFrame);\n}", "@SuppressLint(\"NewApi\")\n protected void updatePreview() {\n if(null == mCameraDevice) {\n Log.e(TAG, \"updatePreview error, return\");\n }\n\n mPreviewBuilder.set(CaptureRequest.CONTROL_MODE, CameraMetadata.CONTROL_MODE_AUTO);\n HandlerThread thread = new HandlerThread(\"CameraPreview\");\n thread.start();\n Handler backgroundHandler = new Handler(thread.getLooper());\n\n try {\n mPreviewSession.setRepeatingRequest(mPreviewBuilder.build(), null, backgroundHandler);\n } catch (CameraAccessException e) {\n // TODO Auto-generated catch block\n e.printStackTrace();\n }\n }", "public void openCamera() {\n \n\n }", "@Override\n public void onCameraPreviewStopped() {\n }", "public void onCreateCameraPipeline(com.arashivision.onestream.pipeline.ICameraPreviewPipeline r20) {\n /*\n r19 = this;\n r0 = r19\n com.arashivision.insta360.basemedia.log.MediaLogger r1 = com.arashivision.insta360.basemedia.ui.player.capture.CapturePlayerView.LL1IL\n java.lang.String r2 = \"onCreateCameraPipeline\"\n r1.d(r2)\n com.arashivision.insta360.basemedia.ui.player.capture.CapturePlayerView r1 = r0.f577a\n r2 = r20\n r1.f73l = r2\n com.arashivision.insta360.basemedia.ui.player.capture.ICaptureParams r1 = r1.IL1Iii\n com.arashivision.insta360.basemedia.model.FileType r1 = r1.getFileType()\n com.arashivision.insta360.basemedia.model.FileType r2 = com.arashivision.insta360.basemedia.model.FileType.FISH_EYE\n r3 = 1\n r4 = 0\n if (r1 != r2) goto L_0x0059\n com.arashivision.insta360.basemedia.ui.player.capture.CapturePlayerView r1 = r0.f577a\n com.arashivision.insta360.basemedia.ui.player.capture.ICaptureParams r1 = r1.IL1Iii\n com.arashivision.insta360.basemedia.model.viewconstraint.Constraint r1 = r1.getConstraint()\n com.arashivision.insta360.basemedia.ui.player.capture.CapturePlayerView r2 = r0.f577a\n com.arashivision.insta360.basemedia.ui.player.capture.ICaptureParams r2 = r2.IL1Iii\n int[] r2 = r2.getConstraintRatio()\n if (r1 == 0) goto L_0x0059\n com.arashivision.insta360.basemedia.ui.player.capture.CapturePlayerView r5 = r0.f577a\n com.arashivision.arvbmg.previewer.BMGCameraPreviewerSessionRender r6 = r5.I11L\n float r5 = r1.getDefaultDistance()\n double r9 = (double) r5\n float r5 = r1.getDefaultFov()\n double r11 = (double) r5\n r5 = r2[r3]\n float r5 = (float) r5\n r2 = r2[r4]\n float r2 = (float) r2\n float r5 = r5 / r2\n double r13 = (double) r5\n float r2 = r1.getXScale()\n double r7 = (double) r2\n float r1 = r1.getYScale()\n double r1 = (double) r1\n r15 = 4607182418800017408(0x3ff0000000000000, double:1.0)\n r17 = r7\n r7 = r15\n r15 = r17\n r17 = r1\n r6.setGyroStabilizerFovDistance2(r7, r9, r11, r13, r15, r17)\n L_0x0059:\n com.arashivision.insta360.basemedia.ui.player.capture.CapturePlayerView r1 = r0.f577a\n r1.setLoading(r4)\n com.arashivision.insta360.basemedia.ui.player.capture.CapturePlayerView r1 = r0.f577a\n if (r1 == 0) goto L_0x00cf\n com.arashivision.insta360.basemedia.ui.player.capture.IPlayCaptureParams r2 = r1.ILil\n if (r2 == 0) goto L_0x006d\n com.arashivision.insta360.basemedia.ui.player.capture.CameraRenderSurfaceInfo r2 = r2.getCameraRenderSurfaceInfo()\n if (r2 == 0) goto L_0x006d\n r4 = r3\n L_0x006d:\n if (r4 != 0) goto L_0x0077\n com.arashivision.insta360.basemedia.log.MediaLogger r1 = com.arashivision.insta360.basemedia.ui.player.capture.CapturePlayerView.LL1IL\n java.lang.String r2 = \"startCameraRenderSurface return. Custom surface is null\"\n L_0x0073:\n r1.e(r2)\n goto L_0x00c5\n L_0x0077:\n com.arashivision.arvbmg.previewer.BMGCameraPreviewerSessionRender r2 = r1.I11L\n if (r2 != 0) goto L_0x0080\n com.arashivision.insta360.basemedia.log.MediaLogger r1 = com.arashivision.insta360.basemedia.ui.player.capture.CapturePlayerView.LL1IL\n java.lang.String r2 = \"startCameraRenderSurface return. Render is null\"\n goto L_0x0073\n L_0x0080:\n boolean r2 = r1.llliI\n if (r2 == 0) goto L_0x0089\n com.arashivision.insta360.basemedia.log.MediaLogger r1 = com.arashivision.insta360.basemedia.ui.player.capture.CapturePlayerView.LL1IL\n java.lang.String r2 = \"startCameraRenderSurface return. Already render surface\"\n goto L_0x0073\n L_0x0089:\n com.arashivision.arvbmg.previewer.BMGCameraPreviewerSessionRender$CameraRenderSurfaceInfo r2 = new com.arashivision.arvbmg.previewer.BMGCameraPreviewerSessionRender$CameraRenderSurfaceInfo\n r2.<init>()\n com.arashivision.insta360.basemedia.ui.player.capture.IPlayCaptureParams r4 = r1.ILil\n com.arashivision.insta360.basemedia.ui.player.capture.CameraRenderSurfaceInfo r4 = r4.getCameraRenderSurfaceInfo()\n int r4 = r4.renderWidth\n r2.renderWidth = r4\n com.arashivision.insta360.basemedia.ui.player.capture.IPlayCaptureParams r4 = r1.ILil\n com.arashivision.insta360.basemedia.ui.player.capture.CameraRenderSurfaceInfo r4 = r4.getCameraRenderSurfaceInfo()\n int r4 = r4.renderHeight\n r2.renderHeight = r4\n a.a.a.a.e.a.e.l r4 = r1.f60IL\n com.arashivision.insta360.basemedia.ui.player.capture.IPlayCaptureParams r5 = r1.ILil\n int r5 = r5.getRenderModelType()\n com.arashivision.graphicpath.render.rendermodel.RenderModelType r4 = r4.a(r5)\n int r4 = r4.getType()\n r2.renderModeType = r4\n com.arashivision.insta360.basemedia.ui.player.capture.IPlayCaptureParams r4 = r1.ILil\n com.arashivision.insta360.basemedia.ui.player.capture.CameraRenderSurfaceInfo r4 = r4.getCameraRenderSurfaceInfo()\n android.view.Surface r4 = r4.mSurface\n r2.mSurface = r4\n com.arashivision.arvbmg.previewer.BMGCameraPreviewerSessionRender r4 = r1.I11L\n r4.startCameraRenderSurface(r2)\n r1.llliI = r3\n L_0x00c5:\n com.arashivision.insta360.basemedia.ui.player.capture.CapturePlayerView r1 = r0.f577a\n com.arashivision.insta360.basemedia.ui.player.listener.IBasePlayerViewListener r1 = r1.f741\n if (r1 == 0) goto L_0x00ce\n r1.onLoadingFinish()\n L_0x00ce:\n return\n L_0x00cf:\n r1 = 0\n throw r1\n */\n throw new UnsupportedOperationException(\"Method not decompiled: a.a.a.a.e.a.f.h.onCreateCameraPipeline(com.arashivision.onestream.pipeline.ICameraPreviewPipeline):void\");\n }", "private void startPreview(CameraCaptureSession session) throws CameraAccessException{\n mPreviewBuilder.addTarget(mSurface);\n mPreviewBuilder.addTarget(mImageReader.getSurface());\n session.setRepeatingRequest(mPreviewBuilder.build(), mSessionCaptureCallback, mCamSessionHandler);\n }", "@Option int getPortSendCam();", "public void onPictureTaken(byte[] data, Camera camera) {\n }", "private void requestLiveStreaming() throws IOException {\n\n String targetCamCode = dis.readUTF();\n\n Cam targetCam = CamRegister.findRegisteredCam(targetCamCode);\n\n try {\n DataOutputStream targetDos = new DataOutputStream(targetCam.getCamSocket().getOutputStream());\n\n targetDos.writeInt(LIVE_STREAMING_COMMAND);\n targetDos.writeUTF(camClient.getCamCode());\n targetDos.flush();\n\n dos.writeInt(SUCCESS_CODE);\n dos.flush();\n\n } catch (Exception e) {\n e.printStackTrace();\n dos.writeInt(NOT_FOUND_CODE);\n dos.flush();\n }\n }", "public void capture()\r\n\t{ \r\n\t VideoCapture camera = new VideoCapture();\r\n\t \r\n\t camera.set(12, -20); // change contrast, might not be necessary\r\n\t \r\n\t //CaptureImage image = new CaptureImage();\r\n\t \r\n\t \r\n\t \r\n\t camera.open(0); //Useless\r\n\t if(!camera.isOpened())\r\n\t {\r\n\t System.out.println(\"Camera Error\");\r\n\t \r\n\t // Determine whether to use System.exit(0) or return\r\n\t \r\n\t }\r\n\t else\r\n\t {\r\n\t System.out.println(\"Camera OK\");\r\n\t }\r\n\t\t\r\n\t\t \r\n\t\tboolean success = camera.read(capturedFrame);\r\n\t\tif (success)\r\n\t\t{\r\n\t\t\ttry {\r\n\t\t\t\tprocessWithContours(capturedFrame, processedFrame);\r\n\t\t\t}\r\n\t\t\tcatch(Exception e){\r\n\t\t\t\tSystem.out.println(e);\r\n\t\t\t}\r\n\t\t //image.processFrame(capturedFrame, processedFrame);\r\n\t\t // processedFrame should be CV_8UC3\r\n\t\t \r\n\t\t //image.findCaptured(processedFrame);\r\n\t\t \r\n\t\t //image.determineKings(capturedFrame);\r\n\t\t \r\n\t\t int bufferSize = processedFrame.channels() * processedFrame.cols() * processedFrame.rows();\r\n\t\t byte[] b = new byte[bufferSize];\r\n\t\t \r\n\t\t processedFrame.get(0,0,b); // get all the pixels\r\n\t\t // This might need to be BufferedImage.TYPE_INT_ARGB\r\n\t\t img = new BufferedImage(processedFrame.cols(), processedFrame.rows(), BufferedImage.TYPE_INT_RGB);\r\n\t\t int width = (int)camera.get(Highgui.CV_CAP_PROP_FRAME_WIDTH);\r\n\t\t int height = (int)camera.get(Highgui.CV_CAP_PROP_FRAME_HEIGHT);\r\n\t\t //img.getRaster().setDataElements(0, 0, width, height, b);\r\n\t\t byte[] a = new byte[bufferSize];\r\n\t\t System.arraycopy(b, 0, a, 0, bufferSize);\r\n\r\n\t\t Highgui.imwrite(\"camera.jpg\",processedFrame);\r\n\t\t System.out.println(\"Success\");\r\n\t\t}\r\n\t\telse\r\n\t\t\tSystem.out.println(\"Unable to capture image\");\r\n\t\t\r\n\t camera.release();\r\n\t}", "org.auvua.utils.protobuffer.AUVprotocol.AUVState.Telemetry.Camera getCamera(int index);", "public void doVideoCapture() {\n /*\n r6 = this;\n r0 = r6.mPaused;\n if (r0 != 0) goto L_0x0043;\n L_0x0004:\n r0 = r6.mCameraDevice;\n if (r0 != 0) goto L_0x0009;\n L_0x0008:\n goto L_0x0043;\n L_0x0009:\n r0 = r6.mMediaRecorderRecording;\n if (r0 == 0) goto L_0x0042;\n L_0x000d:\n r0 = r6.mNeedGLRender;\n if (r0 == 0) goto L_0x0029;\n L_0x0011:\n r0 = r6.isSupportEffects();\n if (r0 == 0) goto L_0x0029;\n L_0x0017:\n r0 = r6.mCameraDevice;\n r1 = 0;\n r0.enableShutterSound(r1);\n r0 = r6.mAppController;\n r0 = r0.getCameraAppUI();\n r1 = r6.mPictureTaken;\n r0.takePicture(r1);\n goto L_0x0041;\n L_0x0029:\n r0 = r6.mSnapshotInProgress;\n if (r0 != 0) goto L_0x0041;\n L_0x002d:\n r0 = java.lang.System.currentTimeMillis();\n r2 = r6.mLastTakePictureTime;\n r2 = r0 - r2;\n r4 = 2000; // 0x7d0 float:2.803E-42 double:9.88E-321;\n r2 = (r2 > r4 ? 1 : (r2 == r4 ? 0 : -1));\n if (r2 >= 0) goto L_0x003c;\n L_0x003b:\n return;\n L_0x003c:\n r6.mLastTakePictureTime = r0;\n r6.takeASnapshot();\n L_0x0041:\n return;\n L_0x0042:\n return;\n L_0x0043:\n return;\n */\n throw new UnsupportedOperationException(\"Method not decompiled: com.hmdglobal.app.camera.VideoModule.doVideoCapture():void\");\n }", "public void updateCam()\r\n {\n \ttry{\r\n \tSystem.out.println();\r\n \tNIVision.IMAQdxGrab(curCam, frame, 1);\r\n \tif(curCam == camCenter){\r\n \t\tNIVision.imaqDrawLineOnImage(frame, frame, NIVision.DrawMode.DRAW_VALUE, new Point(320, 0), new Point(320, 480), 120);\r\n \t}\r\n server.setImage(frame);}\n \tcatch(Exception e){}\r\n }", "@Override\r\n\t\tpublic void onPictureTaken(byte[] data, Camera camera) {\n\t\t\tLog.d(TAG, \"onPictureTaken - raw\");\r\n\t\t}", "public static native void speexEchoPlayback(short[] echoFrame);", "public void recordVideo() {\n\n }", "protected void updatePreview() {\n if (null == mCameraDevice) {\n Toast.makeText(CameraActivity.this, \"Couldn't find Camera\", Toast.LENGTH_SHORT).show();\n }\n mCaptureRequestBuilder.set(CaptureRequest.CONTROL_MODE, CameraMetadata.CONTROL_MODE_AUTO);\n try {\n mCameraCaptureSessions.setRepeatingRequest(mCaptureRequestBuilder.build(), null, null);\n } catch (CameraAccessException e) {\n e.printStackTrace();\n }\n }", "@Override\n public void onFrameAvailable(int cameraId) {\n if (cameraId == TangoCameraIntrinsics.TANGO_CAMERA_COLOR) {\n // Now that we are receiving onFrameAvailable callbacks, we can switch\n // to RENDERMODE_WHEN_DIRTY to drive the render loop from this callback.\n // This will result on a frame rate of approximately 30FPS, in synchrony with\n // the RGB camera driver.\n // If you need to render at a higher rate (i.e.: if you want to render complex\n // animations smoothly) you can use RENDERMODE_CONTINUOUSLY throughout the\n // application lifecycle.\n if (mSurfaceView.getRenderMode() != GLSurfaceView.RENDERMODE_WHEN_DIRTY) {\n mSurfaceView.setRenderMode(GLSurfaceView.RENDERMODE_WHEN_DIRTY);\n }\n\n // Mark a camera frame is available for rendering in the OpenGL thread.\n mIsFrameAvailableTangoThread.set(true);\n // Trigger an OpenGL render to update the OpenGL scene with the new RGB data.\n mSurfaceView.requestRender();\n }\n }", "private void startRecord() {\n try {\n if (mIsRecording) {\n setupMediaRecorder();\n } else if (mIsTimelapse) {\n setupTimelapse();\n }\n SurfaceTexture surfaceTexture = mTextureView.getSurfaceTexture();\n surfaceTexture.setDefaultBufferSize(mPreviewSize.getWidth(), mPreviewSize.getHeight());\n Surface previewSurface = new Surface(surfaceTexture);\n Surface recordSurface = mMediaRecorder.getSurface();\n mCaptureRequestBuilder = mCameraDevice.createCaptureRequest(CameraDevice.TEMPLATE_RECORD);\n mCaptureRequestBuilder.addTarget(previewSurface);\n mCaptureRequestBuilder.addTarget(recordSurface);\n\n mCameraDevice.createCaptureSession(Arrays.asList(previewSurface, recordSurface, mImageReader.getSurface()),\n new CameraCaptureSession.StateCallback() {\n\n\n @Override\n public void onConfigured(CameraCaptureSession session) {\n\n mRecordCaptureSession = session;\n\n try {\n mRecordCaptureSession.setRepeatingRequest(mCaptureRequestBuilder.build(), null, null);\n } catch (CameraAccessException e) {\n e.printStackTrace();\n }\n }\n\n @Override\n public void onConfigureFailed(@NonNull CameraCaptureSession session) {\n\n }\n }, null);\n } catch (Exception e) {\n e.printStackTrace();\n }\n }", "void accessFrame(Buffer frame) {\r\n\r\n\t\t\t// For demo, we'll just print out the frame #, time &\r\n\t\t\t// data length.\r\n\r\n\t\t\tlong t = (long)(frame.getTimeStamp()/10000000f);\r\n\r\n\t\t\tStdout.log(\"Pre: frame #: \" + frame.getSequenceNumber() + \r\n\t\t\t\t\t\", time: \" + ((float)t)/100f + \r\n\t\t\t\t\t\", len: \" + frame.getLength());\r\n\t\t}", "@Override\n public void onCameraNotify(int notify) {\n }", "@Override\n public void imagingUpdate(CameraState status) {\n synchronized(_cameraListeners) {\n if (_cameraListeners.isEmpty()) return;\n }\n \n try {\n // Construct message\n Response resp = new Response(UdpConstants.NO_TICKET, DUMMY_ADDRESS);\n resp.stream.writeUTF(UdpConstants.COMMAND.CMD_SEND_CAMERA.str);\n resp.stream.writeByte(status.ordinal());\n \n // Send to all listeners\n synchronized(_cameraListeners) {\n _udpServer.bcast(resp, _cameraListeners.keySet());\n }\n } catch (IOException e) {\n throw new RuntimeException(\"Failed to serialize camera\");\n }\n }", "@Override\n protected void onStart() {\n camera_ = getCameraInstance();\n Parameters params;\n\n if (camera_ != null) {\n params = camera_.getParameters();\n params.setPreviewFormat(ImageFormat.NV21);\n getSmallestPreviewSize(params);\n params.setPreviewSize(width_, height_);\n //params.setFlashMode(Parameters.FLASH_MODE_TORCH);\n params.setWhiteBalance(Parameters.WHITE_BALANCE_AUTO);\n camera_.setParameters(params);\n\n frame_ = new RGB[width_ * height_];\n for (int i = 0; i < frame_.length; ++i) {\n frame_[i] = new RGB();\n }\n\n camera_.setPreviewCallback(new PreviewCallback() {\n @Override\n public void onPreviewFrame(byte[] data, Camera camera) {\n synchronized (frame_) {\n decodeYUV420SP(frame_, data, width_, height_);\n }\n }\n });\n SurfaceTexture texture_ = new SurfaceTexture(0);\n try {\n camera_.setPreviewTexture(texture_);\n } catch (IOException e) {\n e.printStackTrace();\n }\n camera_.startPreview();\n }\n\n super.onStart();\n }", "public native void renderFrame();", "public native void renderFrame();", "@Override\n public void onOpened(CameraDevice camera) {\n Log.e(TAG, \"onOpened\");\n cameraDevice = camera;\n createCameraPreview();\n }", "@Override\n public void onOpened(CameraDevice camera) {\n Log.e(TAG, \"onOpened\");\n cameraDevice = camera;\n createCameraPreview();\n }", "public void initializeCamera(){\n mCamera = Camera.open();\n\n Camera.Parameters parameters = mCamera.getParameters();\n parameters.setFlashMode(Camera.Parameters.FLASH_MODE_TORCH);\n\n List<Camera.Size> previewSizes = parameters.getSupportedPreviewSizes();\n // Get the supported preview size closest to the requested dimensions:\n Camera.Size previewSize = previewSizes.get(previewSizes.size() - 1); // getOptimalPreviewSize(previewSizes, width, height);\n width = previewSize.width;\n height = previewSize.height;\n Log.d(TAG, \"width: \" + width + \" , height: \" + height);\n nPixels = width * height;\n pixels = new int[nPixels];\n setSize(width, height);\n parameters.setPreviewSize(width, height);\n\n mCamera.setParameters(parameters);\n\n int dataBufferSize=(int)(height * width * (ImageFormat.getBitsPerPixel(parameters.getPreviewFormat())/8.0));\n\n mCamera.addCallbackBuffer(new byte[dataBufferSize]);\n mCamera.setPreviewCallbackWithBuffer(this);\n }", "@Override\r\n\t\tpublic void cameraCallback(int value) {\n\t\t\tLogCatUtils.showString(\" value \"+ String.valueOf(value));\r\n\t\t\tMessage message = Message.obtain();\r\n\t\t\tmessage.what=5;\r\n\t\t\tmessage.arg1=value;\r\n\t\t\thandler.sendMessage(message);\r\n\t\t}", "private void handleImage(byte[] b) throws IOException {\n Log.i(\"ScrencapHandler\",\"handleImage\");\n long utime = System.currentTimeMillis();\n byte[] unixTime = toByteArray(utime);\n int start = b.length - unixTime.length - 1; //-1 for the seqnum\n for (int i = 0; i < unixTime.length; i++) {\n b[start + i] = unixTime[i];\n }\n\n if (jitterControl.channelIsFree()) {\n int seq = jitterControl.sendt(utime, b.length);\n\n // Add seq number.\n b[b.length - 1] = (byte) seq;\n\n // Send out the data to the network.\n Log.i(\"ScrencapHandler\",\"Send out the data to the network\");\n mWebkeyVisitor.send(b);\n }\n }", "private static native void runFrame(long pointer);", "@Override\n public void onOpened(CameraDevice camera) {\n Log.e(TAG, \"onOpened\");\n mCameraDevice = camera;\n startPreview();\n }", "public void frameMsg(byte[] encodedMsg, OutputStream out) {\n\r\n }", "private void setupCamera(final int camera) {\n try {\n // mPreview = new CamPreview(this, camera, CamPreview.LayoutMode.NoBlank);// .FitToParent);\n } catch (Exception e) {\n Toast.makeText(this, R.string.cannot_connect_to_camera, Toast.LENGTH_LONG).show();\n finish();\n return;\n }\n\n RelativeLayout.LayoutParams previewLayoutParams = new RelativeLayout.LayoutParams(RelativeLayout.LayoutParams.WRAP_CONTENT, RelativeLayout.LayoutParams.WRAP_CONTENT);\n Display display = getWindowManager().getDefaultDisplay();\n DisplayMetrics outMetrics = new DisplayMetrics();\n display.getMetrics(outMetrics);\n\n int width = outMetrics.widthPixels;\n int height = outMetrics.heightPixels;\n\n previewLayoutParams.height = width;\n previewLayoutParams.width = width;\n\n // Un-comment below line to specify the position.\n // mPreview.setCenterPosition(width / 2, height / 2);\n\n // previewParent.addView(mPreview, 0, previewLayoutParams);\n\n\n }", "public void startFrontCam() {\n }", "@FXML\r\n protected void startCamera() {\r\n // set a fixed width for the frame\r\n this.currentFrame.setFitWidth(600);\r\n // preserve image ratio\r\n this.currentFrame.setPreserveRatio(true);\r\n\r\n if (!this.cameraActive) {\r\n\r\n // start the video capture\r\n //this.capture.open(0);\r\n //Read the video (Chage video)\r\n this.capture.open(\"Faruri.m4v\");\r\n\r\n\r\n System.out.println(\"start capture...\");\r\n // is the video stream available?\r\n if (this.capture.isOpened()) {\r\n System.out.println(\"inif\");\r\n this.cameraActive = true;\r\n\r\n // grab a frame every 33 ms (30 frames/sec)\r\n Runnable frameGrabber = new Runnable() {\r\n\r\n @Override\r\n public void run() {\r\n // effectively grab and process a single frame\r\n Mat frame = grabFrame();\r\n\r\n//\t\t\t\t\t\t// convert and show the frame\r\n//\t\t\t\t\t\tImage imageToShow = Utils.mat2Image(frame);\r\n//\t\t\t\t\t\tupdateImageView(currentFrame, imageToShow);\r\n }\r\n };\r\n\r\n this.timer = Executors.newSingleThreadScheduledExecutor();\r\n this.timer.scheduleAtFixedRate(frameGrabber, 0, 33, TimeUnit.MILLISECONDS);\r\n\r\n // update the button content\r\n this.button.setText(\"Stop Video\");\r\n } else {\r\n // log the error\r\n System.err.println(\"Impossible to open the video...\");\r\n }\r\n } else {\r\n // the camera is not active at this point\r\n this.cameraActive = false;\r\n // update again the button content\r\n this.button.setText(\"Start Video\");\r\n\r\n // stop the timer\r\n this.stopAcquisition();\r\n }\r\n }", "public void onPictureTaken(byte[] arg0, Camera arg1) {\n\t \n \n }", "protected void updatePreview() {\n if(null == cameraDevice) {\n Log.e(TAG, \"updatePreview error, return\");\n }\n captureRequestBuilder.set(CaptureRequest.CONTROL_MODE, CameraMetadata.CONTROL_MODE_AUTO);\n try {\n cameraCaptureSessions.setRepeatingRequest(captureRequestBuilder.build(), null, mBackgroundHandler);\n } catch (CameraAccessException e) {\n e.printStackTrace();\n }\n }", "@Override\r\n\tpublic void surfaceChanged(SurfaceHolder holder, int format, int width,\r\n\t\t\tint height) {\n\t\tif(myCamera!=null){\r\n\t\t\tCamera.Parameters parameters = myCamera.getParameters();//得到initial參數\r\n\t\t\tmyCamera.setParameters(parameters);\r\n\t\t\tmyCamera.startPreview();\r\n\t\t}\r\n\t}", "@Override\n public void openVideoCapture(Map<String, Object> parameters) throws Exception {\n checkNotNull(camera, \"Camera required\");\n ImageView viewCamera = checkNotNull((ImageView) parameters.get(\"viewCamera\"),\n \"Camera's ImageView required\");\n\n videoCapture.open(camera.getWebCamIndex());\n\n videoCapture.set(3, camera.getWidth());\n videoCapture.set(4, camera.getHeight());\n\n Runnable frameGrabber = () -> viewCamera.setImage(grabFrame(new HashMap<>()));\n timer = Executors.newSingleThreadScheduledExecutor();\n timer.scheduleAtFixedRate(frameGrabber, 0, 33, TimeUnit.MICROSECONDS);\n }", "@Override\n public Mat onCameraFrame(CameraBridgeViewBase.CvCameraViewFrame inputFrame) {\n /*apply image effects to new frame*/\n Mat mat= hangman.decapitate(inputFrame);\n\n /*check if users clicked the capture button and if external storage is writable for save it*/\n if(isToSaveBitmap && isExternalStorageWritable()){\n isToSaveBitmap=false;\n Bitmap bmp;\n try {\n bmp = Bitmap.createBitmap(mat.cols(), mat.rows(), Bitmap.Config.ARGB_8888);\n Utils.matToBitmap(mat, bmp);\n File dir = getAlbumStorageDir(\"hangman\");\n String path =dir.getPath()+File.separator+ \"hangman\" +System.currentTimeMillis() + \".JPG\";\n File capture= new File(path);\n\n OutputStream out = null;\n try {\n capture.createNewFile();\n out = new FileOutputStream(capture);\n bmp.compress(Bitmap.CompressFormat.JPEG, 90, out);\n out.flush();\n\n /*Inform the media store that a new image was saved*/\n ContentValues values = new ContentValues();\n values.put(MediaStore.Images.Media.DATE_TAKEN, System.currentTimeMillis());\n values.put(MediaStore.Images.Media.MIME_TYPE, \"image/jpeg\");\n values.put(MediaStore.MediaColumns.DATA, path);\n getBaseContext().getContentResolver().insert(MediaStore.Images.Media.EXTERNAL_CONTENT_URI, values);\n\n /*if app was called with intent image capture */\n if(intentImageCapture){\n Intent result = new Intent(\"com.example.RESULT_ACTION\");\n result.setData(Uri.fromFile(capture));\n result.putExtra(Intent.EXTRA_STREAM,capture);\n result.setType(\"image/jpg\");\n setResult(Activity.RESULT_OK, result);\n finish();\n }\n } catch (IOException e) {\n e.printStackTrace();\n }\n finally {\n try {\n out.close();\n } catch (IOException e) {\n e.printStackTrace();\n }\n }\n }\n catch (CvException e) {\n Log.e(\"Exception\", e.getMessage());\n e.printStackTrace();\n }\n }\n return mat;\n }", "@RequiresApi(api = Build.VERSION_CODES.O)\n @Override\n public void onPictureTaken(byte[] data, Camera camera) {\n Log.d(\"Hawk.CameraHandler\",\"onPictureCalled\");\n //\n bmp = BitmapFactory.decodeByteArray(data, 0, data.length); //Convert raw byte array to Bitmap format\n ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream();\n bmp.compress(Bitmap.CompressFormat.PNG, 100, byteArrayOutputStream); //Write the Bitmap to ByteArrayOutputStream\n byte[] byteArray = byteArrayOutputStream .toByteArray(); //Get byte array from ByteArrayOutputStream\n //\n encodedImage=Base64.getEncoder().encodeToString(byteArray); //Convert the byte array to Base64 encoded string\n camera.stopPreview(); //Stop the preview\n Log.d(\"EncodedImage\",\"starthere#\"+encodedImage+\"###ENDED\");\n picReady=true; //Indicates that encoded string is ready\n camera.release();\n }", "public void camera(){\n System.out.println(\"I am taking pictures...\");\r\n }", "@Override\n public Mat onCameraFrame(CameraBridgeViewBase.CvCameraViewFrame inputFrame) {\n// steering = (TextView) findViewById(R.id.steering_angle);\n\n\n Mat frame = inputFrame.rgba();\n steering_angle_ = get_steering_prediction(frame.clone());\n Mat displayMat = null;\n// if(counterFrme % 10 == 0 || counterFrme %10 ==1 || counterFrme %10 ==2 || counterFrme %10 ==3 || counterFrme %10 ==4 ) {\n displayMat = draw_LaneLines(frame.clone());\n// displayMat = CarDetect(displayMat);\n// displayMat = PedestrainDet(frame.clone());\n\n// }else{\n// displayMat = frame;\n// }\n\n counterFrme ++;\n if(steering_angle_< 0 ) {\n Imgproc.putText(\n displayMat, // Matrix obj of the image\n \"turn left \" + steering_angle_ * -1 + \"% of the wheel\", // Text to be added\n new Point(10, 50), // point\n Core.FONT_HERSHEY_SIMPLEX, // front face\n 1, // front scale\n new Scalar(255, 0, 0), // Scalar object for color\n 6 // Thickness\n );\n }\n if(steering_angle_ > 0 ) {\n Imgproc.putText(\n displayMat, // Matrix obj of the image\n \"turn right \" + steering_angle_ + \"% of the wheel\", // Text to be added\n new Point(10, 50), // point\n Core.FONT_HERSHEY_SIMPLEX, // front face\n 1, // front scale\n new Scalar(255, 0, 0), // Scalar object for color\n 6 // Thickness\n );\n }\n\n return displayMat;\n\n }" ]
[ "0.8511629", "0.8054202", "0.7405713", "0.7379435", "0.7329217", "0.72953725", "0.71791726", "0.7139684", "0.7103969", "0.7094602", "0.6992523", "0.680396", "0.67932326", "0.67156076", "0.67072415", "0.66719234", "0.66351366", "0.6615612", "0.6532058", "0.64890087", "0.64313704", "0.6416859", "0.64040637", "0.64040637", "0.6357151", "0.63469976", "0.6287498", "0.62797964", "0.6266412", "0.624777", "0.61931914", "0.61476004", "0.6091036", "0.606065", "0.60531735", "0.6023504", "0.6020037", "0.60103095", "0.60076046", "0.60007304", "0.59936476", "0.5946047", "0.5928257", "0.5918249", "0.59148794", "0.5911753", "0.58994204", "0.58937764", "0.5861921", "0.5820033", "0.58170396", "0.5803785", "0.5803019", "0.57828015", "0.57710373", "0.57701343", "0.5767579", "0.57403284", "0.5727592", "0.5726714", "0.5718665", "0.5711318", "0.57060885", "0.56915355", "0.56831586", "0.56821585", "0.567091", "0.566521", "0.5660966", "0.560543", "0.5600847", "0.5597224", "0.55877435", "0.5584257", "0.55716103", "0.5559057", "0.5549975", "0.5548132", "0.5547761", "0.55321", "0.5531097", "0.5531097", "0.5524202", "0.5524202", "0.5521882", "0.5520555", "0.5514655", "0.5502429", "0.5500947", "0.5498264", "0.54969263", "0.5482834", "0.5459595", "0.54588574", "0.5451248", "0.5450871", "0.54416376", "0.54384834", "0.54337776", "0.5429118", "0.54273975" ]
0.0
-1
Created by J on 05/02/2017.
public interface ComicService { @GET("/v1/public/characters/{characterId}/comics") Call<ResponseBody> getComics(@Path("characterId") int characterId, @Query("offset") int offset, @Query("limit") int limit, @Query("ts") long ts, @Query("apikey") String apikey, @Query("hash") String hash); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\n public void perish() {\n \n }", "private stendhal() {\n\t}", "@Override\n\tpublic void comer() {\n\t\t\n\t}", "@Override\n\tpublic void grabar() {\n\t\t\n\t}", "public final void mo51373a() {\n }", "@Override\n\tprotected void getExras() {\n\n\t}", "@Override\n public void func_104112_b() {\n \n }", "@Override\r\n\tpublic void bicar() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void bicar() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void comer() \r\n\t{\n\t\t\r\n\t}", "@Override\r\n\tpublic void tires() {\n\t\t\r\n\t}", "@Override\n protected void getExras() {\n }", "@Override\n\tprotected void interr() {\n\t}", "@Override\n\tpublic void entrenar() {\n\t\t\n\t}", "public void mo38117a() {\n }", "@Override\r\n\tpublic void dormir() {\n\t\t\r\n\t}", "protected boolean func_70814_o() { return true; }", "@Override\n\tpublic void anular() {\n\n\t}", "private static void cajas() {\n\t\t\n\t}", "private void poetries() {\n\n\t}", "@Override\n public int describeContents() { return 0; }", "@Override\n\tpublic void nadar() {\n\t\t\n\t}", "@Override\r\n\t\tpublic void init() {\n\t\t\t\r\n\t\t}", "@Override\r\n\t\t\tpublic void annadir() {\n\r\n\t\t\t}", "@Override\n\tpublic void gravarBd() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void sacrifier() {\n\t\t\n\t}", "private void m50366E() {\n }", "public void mo4359a() {\n }", "@Override\n public void init() {\n\n }", "public void gored() {\n\t\t\n\t}", "@Override\r\n\tpublic void rozmnozovat() {\n\t}", "@Override\r\n\tpublic void anularFact() {\n\t\t\r\n\t}", "@Override\n\tprotected void initialize() {\n\t\t\n\t}", "@Override\n\tprotected void initialize() {\n\t\t\n\t}", "@Override\n\tpublic void jugar() {\n\t\t\n\t}", "@Override\n public void init() {\n }", "private void init() {\n\n\t}", "private void kk12() {\n\n\t}", "@Override\n void init() {\n }", "@Override\n protected void initialize() {\n\n \n }", "@Override\r\n\tpublic void init() {}", "@Override\n\tpublic void init() {\n\n\t}", "@Override\n\tpublic void init() {\n\n\t}", "@Override\n\tpublic void init() {\n\n\t}", "Constructor() {\r\n\t\t \r\n\t }", "@Override\r\n\tpublic void init() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void init() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void init() {\n\t\t\r\n\t}", "@Override\n protected void init() {\n }", "@Override\r\n\tpublic void dibujar() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void dibujar() {\n\t\t\r\n\t}", "@Override\n public void init() {}", "@Override\n public void memoria() {\n \n }", "@Override\n\tpublic void ligar() {\n\t\t\n\t}", "@Override\n protected void initialize() {\n }", "@Override\n protected void initialize() {\n }", "@Override\n protected void initialize() {\n }", "@Override\n protected void initialize() {\n }", "@Override\n protected void initialize() {\n }", "@Override\n protected void initialize() {\n }", "@Override\n protected void initialize() \n {\n \n }", "@Override\r\n\tpublic void init() {\n\r\n\t}", "@Override\r\n\tpublic void init() {\n\r\n\t}", "@Override\r\n\tpublic void init() {\n\r\n\t}", "private Rekenhulp()\n\t{\n\t}", "@Override\r\n\tprotected void initialize() {\r\n\t\t\r\n\t\t\r\n\t}", "@Override\n\tpublic int mettreAJour() {\n\t\treturn 0;\n\t}", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "@Override\n\tprotected void initialize() {\n\n\t}", "@Override\n\tpublic void einkaufen() {\n\t}", "@Override\n\tpublic void nghe() {\n\n\t}", "@Override\n public void init() {\n\n }", "@Override\n public void init() {\n\n }", "@Override\n\tpublic void one() {\n\t\t\n\t}", "@Override\n public int retroceder() {\n return 0;\n }", "@Override\r\n\tpublic void init()\r\n\t{\n\t}", "public void mo12628c() {\n }", "@Override\r\n\tprotected void doF4() {\n\t\t\r\n\t}", "@Override\r\n\t\t\tpublic void ayuda() {\n\r\n\t\t\t}", "@Override\n\tpublic void init()\n\t{\n\n\t}", "@Override\n\tpublic void init() {\n\t}", "public Pitonyak_09_02() {\r\n }", "public void mo6081a() {\n }", "@Override\n public void inizializza() {\n\n super.inizializza();\n }", "@Override public int describeContents() { return 0; }", "public void mo12930a() {\n }", "protected MetadataUGWD() {/* intentionally empty block */}", "public void mo21779D() {\n }", "public void mo21877s() {\n }", "private void strin() {\n\n\t}" ]
[ "0.59584874", "0.5853115", "0.5824897", "0.5822332", "0.58007634", "0.5781821", "0.5762445", "0.5745335", "0.5745335", "0.5723344", "0.56633186", "0.5591055", "0.55867755", "0.5585921", "0.558377", "0.55739", "0.5573458", "0.55652976", "0.55635095", "0.5555431", "0.55483097", "0.55295473", "0.5522565", "0.55221266", "0.55210334", "0.55148834", "0.55148834", "0.55148834", "0.55148834", "0.55148834", "0.55145806", "0.5513032", "0.55031633", "0.5489078", "0.5489016", "0.54763037", "0.5457369", "0.5417883", "0.5417883", "0.5409424", "0.54081255", "0.5403321", "0.5401764", "0.53924066", "0.53903455", "0.5380278", "0.53756434", "0.53756434", "0.53756434", "0.537185", "0.5369296", "0.5369296", "0.5369296", "0.5367108", "0.5365218", "0.5365218", "0.53650695", "0.536421", "0.5360035", "0.53582525", "0.53582525", "0.53582525", "0.53582525", "0.53582525", "0.53582525", "0.53536695", "0.5350332", "0.5350332", "0.5350332", "0.53449196", "0.533936", "0.5337478", "0.5334719", "0.5334719", "0.5334719", "0.5334719", "0.5334719", "0.5334719", "0.5334719", "0.53346705", "0.53342915", "0.5330837", "0.5329429", "0.5329429", "0.53160125", "0.53137195", "0.5313168", "0.53102", "0.5310105", "0.531008", "0.52961487", "0.5289323", "0.52832717", "0.5278844", "0.52729094", "0.52725923", "0.5271342", "0.52688235", "0.5268097", "0.5266675", "0.52614963" ]
0.0
-1
TODO Autogenerated method stub
@Override public boolean retry(ITestResult result) { if (!result.isSuccess()) { //Check if test not succeed if (count < maxTry) { //Check if maxtry count is reached count++; //Increase the maxTry count by 1 System.out.println("is this working?"); result.setStatus(ITestResult.FAILURE); //Mark test as failed return true; //Tells TestNG to re-run the test } else { result.setStatus(ITestResult.FAILURE); //If maxCount reached,test marked as failed } } else { result.setStatus(ITestResult.SUCCESS); //If test passes, TestNG marks it as passed } return false; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\r\n\tpublic void comer() \r\n\t{\n\t\t\r\n\t}", "@Override\n\tpublic void comer() {\n\t\t\n\t}", "@Override\n public void perish() {\n \n }", "@Override\r\n\t\t\tpublic void annadir() {\n\r\n\t\t\t}", "@Override\n\tpublic void anular() {\n\n\t}", "@Override\n\tprotected void getExras() {\n\n\t}", "@Override\r\n\tpublic void anularFact() {\n\t\t\r\n\t}", "@Override\n\tpublic void entrenar() {\n\t\t\n\t}", "@Override\n\tpublic void nadar() {\n\t\t\n\t}", "@Override\r\n\tpublic void tires() {\n\t\t\r\n\t}", "@Override\r\n\t\t\tpublic void ayuda() {\n\r\n\t\t\t}", "@Override\n\tprotected void interr() {\n\t}", "@Override\n\tpublic void emprestimo() {\n\n\t}", "@Override\r\n\tpublic void bicar() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void bicar() {\n\t\t\r\n\t}", "@Override\n\tpublic void grabar() {\n\t\t\n\t}", "@Override\n\tpublic void gravarBd() {\n\t\t\n\t}", "@Override\r\n\tpublic void rozmnozovat() {\n\t}", "@Override\r\n\tpublic void dormir() {\n\t\t\r\n\t}", "@Override\n protected void getExras() {\n }", "@Override\r\n\tpublic void publierEnchere() {\n\t\t\r\n\t}", "@Override\n\tpublic void nefesAl() {\n\n\t}", "@Override\n\tpublic void ligar() {\n\t\t\n\t}", "@Override\n public void func_104112_b() {\n \n }", "@Override\n\tprotected void initdata() {\n\n\t}", "@Override\n\tpublic void nghe() {\n\n\t}", "@Override\n public void function()\n {\n }", "@Override\n public void function()\n {\n }", "public final void mo51373a() {\n }", "@Override\r\n\tpublic void stehReagieren() {\r\n\t\t//\r\n\t}", "@Override\n public void inizializza() {\n\n super.inizializza();\n }", "@Override\n\tprotected void initData() {\n\t\t\n\t}", "@Override\r\n\t\tpublic void init() {\n\t\t\t\r\n\t\t}", "@Override\n\tpublic void sacrifier() {\n\t\t\n\t}", "@Override\r\n\tprotected void InitData() {\n\t\t\r\n\t}", "public void designBasement() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initialize() {\r\n\t\t\r\n\t\t\r\n\t}", "public void gored() {\n\t\t\n\t}", "@Override\r\n\tprotected void initData() {\n\r\n\t}", "@Override\n\tpublic void einkaufen() {\n\t}", "@Override\n protected void initialize() {\n\n \n }", "public void mo38117a() {\n }", "@Override\n\tprotected void getData() {\n\t\t\n\t}", "Constructor() {\r\n\t\t \r\n\t }", "@Override\r\n\tpublic void dibujar() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void dibujar() {\n\t\t\r\n\t}", "@Override\n\tpublic void one() {\n\t\t\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "private stendhal() {\n\t}", "@Override\n\tprotected void update() {\n\t\t\n\t}", "@Override\n\t\t\tpublic void ic() {\n\t\t\t\t\n\t\t\t}", "@Override\n\tprotected void initData() {\n\n\t}", "@Override\n\tprotected void initData() {\n\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n public void init() {\n\n }", "@Override\n\tprotected void initialize() {\n\t\t\n\t}", "@Override\n\tprotected void initialize() {\n\t\t\n\t}", "@Override\r\n\tpublic void init() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void init() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void init() {\n\t\t\r\n\t}", "@Override\n\tpublic void debite() {\n\t\t\n\t}", "@Override\r\n\tpublic void init() {\n\r\n\t}", "@Override\r\n\tpublic void init() {\n\r\n\t}", "@Override\r\n\tpublic void init() {\n\r\n\t}", "public contrustor(){\r\n\t}", "@Override\n\tprotected void initialize() {\n\n\t}", "@Override\r\n\tpublic void dispase() {\n\r\n\t}", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "@Override\n\tpublic void dtd() {\n\t\t\n\t}", "@Override\n\tprotected void logic() {\n\n\t}", "@Override\n\tprotected void lazyLoad() {\n\t\t\n\t}", "public void mo4359a() {\n }", "@Override\r\n\tprotected void initialize() {\n\r\n\t}", "@Override\n public void memoria() {\n \n }", "@Override\n\t\tpublic void method() {\n\t\t\t\n\t\t}", "private RepositorioAtendimentoPublicoHBM() {\r\t}", "@Override\n protected void initialize() \n {\n \n }", "@Override\r\n\tpublic void getProposition() {\n\r\n\t}", "@Override\n\tpublic void particular1() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\n\t}", "@Override\n\tpublic void init() {\n\n\t}", "@Override\n\tpublic void init() {\n\n\t}", "@Override\n protected void prot() {\n }", "@Override\r\n\tpublic void init()\r\n\t{\n\t}", "@Override\n\tprotected void initValue()\n\t{\n\n\t}", "public void mo55254a() {\n }" ]
[ "0.6671074", "0.6567672", "0.6523024", "0.6481211", "0.6477082", "0.64591026", "0.64127725", "0.63762105", "0.6276059", "0.6254286", "0.623686", "0.6223679", "0.6201336", "0.61950207", "0.61950207", "0.61922914", "0.6186996", "0.6173591", "0.61327106", "0.61285484", "0.6080161", "0.6077022", "0.6041561", "0.6024072", "0.6020252", "0.59984857", "0.59672105", "0.59672105", "0.5965777", "0.59485507", "0.5940904", "0.59239364", "0.5910017", "0.5902906", "0.58946234", "0.5886006", "0.58839184", "0.58691067", "0.5857751", "0.58503544", "0.5847024", "0.58239377", "0.5810564", "0.5810089", "0.5806823", "0.5806823", "0.5800025", "0.5792378", "0.5792378", "0.5792378", "0.5792378", "0.5792378", "0.5792378", "0.5790187", "0.5789414", "0.5787092", "0.57844025", "0.57844025", "0.5774479", "0.5774479", "0.5774479", "0.5774479", "0.5774479", "0.5761362", "0.57596046", "0.57596046", "0.575025", "0.575025", "0.575025", "0.5747959", "0.57337177", "0.57337177", "0.57337177", "0.5721452", "0.5715831", "0.57142824", "0.57140535", "0.57140535", "0.57140535", "0.57140535", "0.57140535", "0.57140535", "0.57140535", "0.5711723", "0.57041645", "0.56991017", "0.5696783", "0.56881124", "0.56774884", "0.56734604", "0.56728", "0.56696945", "0.5661323", "0.5657007", "0.5655942", "0.5655942", "0.5655942", "0.56549734", "0.5654792", "0.5652974", "0.5650185" ]
0.0
-1
TODO Autogenerated method stub
@Override public void attributeAdded(ServletRequestAttributeEvent event) { name=event.getName(); value=event.getValue(); System.out.println(event.getServletRequest()+"范围内添加了名为"+name+",值为"+value+"的属性!"); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\r\n\tpublic void comer() \r\n\t{\n\t\t\r\n\t}", "@Override\n\tpublic void comer() {\n\t\t\n\t}", "@Override\n public void perish() {\n \n }", "@Override\r\n\t\t\tpublic void annadir() {\n\r\n\t\t\t}", "@Override\n\tpublic void anular() {\n\n\t}", "@Override\n\tprotected void getExras() {\n\n\t}", "@Override\r\n\tpublic void anularFact() {\n\t\t\r\n\t}", "@Override\n\tpublic void entrenar() {\n\t\t\n\t}", "@Override\n\tpublic void nadar() {\n\t\t\n\t}", "@Override\r\n\tpublic void tires() {\n\t\t\r\n\t}", "@Override\r\n\t\t\tpublic void ayuda() {\n\r\n\t\t\t}", "@Override\n\tprotected void interr() {\n\t}", "@Override\n\tpublic void emprestimo() {\n\n\t}", "@Override\r\n\tpublic void bicar() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void bicar() {\n\t\t\r\n\t}", "@Override\n\tpublic void grabar() {\n\t\t\n\t}", "@Override\n\tpublic void gravarBd() {\n\t\t\n\t}", "@Override\r\n\tpublic void rozmnozovat() {\n\t}", "@Override\r\n\tpublic void dormir() {\n\t\t\r\n\t}", "@Override\n protected void getExras() {\n }", "@Override\r\n\tpublic void publierEnchere() {\n\t\t\r\n\t}", "@Override\n\tpublic void nefesAl() {\n\n\t}", "@Override\n\tpublic void ligar() {\n\t\t\n\t}", "@Override\n public void func_104112_b() {\n \n }", "@Override\n\tprotected void initdata() {\n\n\t}", "@Override\n\tpublic void nghe() {\n\n\t}", "@Override\n public void function()\n {\n }", "@Override\n public void function()\n {\n }", "public final void mo51373a() {\n }", "@Override\r\n\tpublic void stehReagieren() {\r\n\t\t//\r\n\t}", "@Override\n public void inizializza() {\n\n super.inizializza();\n }", "@Override\n\tprotected void initData() {\n\t\t\n\t}", "@Override\r\n\t\tpublic void init() {\n\t\t\t\r\n\t\t}", "@Override\n\tpublic void sacrifier() {\n\t\t\n\t}", "@Override\r\n\tprotected void InitData() {\n\t\t\r\n\t}", "public void designBasement() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initialize() {\r\n\t\t\r\n\t\t\r\n\t}", "public void gored() {\n\t\t\n\t}", "@Override\r\n\tprotected void initData() {\n\r\n\t}", "@Override\n\tpublic void einkaufen() {\n\t}", "@Override\n protected void initialize() {\n\n \n }", "public void mo38117a() {\n }", "@Override\n\tprotected void getData() {\n\t\t\n\t}", "Constructor() {\r\n\t\t \r\n\t }", "@Override\r\n\tpublic void dibujar() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void dibujar() {\n\t\t\r\n\t}", "@Override\n\tpublic void one() {\n\t\t\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "private stendhal() {\n\t}", "@Override\n\tprotected void update() {\n\t\t\n\t}", "@Override\n\t\t\tpublic void ic() {\n\t\t\t\t\n\t\t\t}", "@Override\n\tprotected void initData() {\n\n\t}", "@Override\n\tprotected void initData() {\n\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n public void init() {\n\n }", "@Override\n\tprotected void initialize() {\n\t\t\n\t}", "@Override\n\tprotected void initialize() {\n\t\t\n\t}", "@Override\r\n\tpublic void init() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void init() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void init() {\n\t\t\r\n\t}", "@Override\n\tpublic void debite() {\n\t\t\n\t}", "@Override\r\n\tpublic void init() {\n\r\n\t}", "@Override\r\n\tpublic void init() {\n\r\n\t}", "@Override\r\n\tpublic void init() {\n\r\n\t}", "public contrustor(){\r\n\t}", "@Override\n\tprotected void initialize() {\n\n\t}", "@Override\r\n\tpublic void dispase() {\n\r\n\t}", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "@Override\n\tpublic void dtd() {\n\t\t\n\t}", "@Override\n\tprotected void logic() {\n\n\t}", "@Override\n\tprotected void lazyLoad() {\n\t\t\n\t}", "public void mo4359a() {\n }", "@Override\r\n\tprotected void initialize() {\n\r\n\t}", "@Override\n public void memoria() {\n \n }", "@Override\n\t\tpublic void method() {\n\t\t\t\n\t\t}", "private RepositorioAtendimentoPublicoHBM() {\r\t}", "@Override\n protected void initialize() \n {\n \n }", "@Override\r\n\tpublic void getProposition() {\n\r\n\t}", "@Override\n\tpublic void particular1() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\n\t}", "@Override\n\tpublic void init() {\n\n\t}", "@Override\n\tpublic void init() {\n\n\t}", "@Override\n protected void prot() {\n }", "@Override\r\n\tpublic void init()\r\n\t{\n\t}", "@Override\n\tprotected void initValue()\n\t{\n\n\t}", "public void mo55254a() {\n }" ]
[ "0.6671074", "0.6567672", "0.6523024", "0.6481211", "0.6477082", "0.64591026", "0.64127725", "0.63762105", "0.6276059", "0.6254286", "0.623686", "0.6223679", "0.6201336", "0.61950207", "0.61950207", "0.61922914", "0.6186996", "0.6173591", "0.61327106", "0.61285484", "0.6080161", "0.6077022", "0.6041561", "0.6024072", "0.6020252", "0.59984857", "0.59672105", "0.59672105", "0.5965777", "0.59485507", "0.5940904", "0.59239364", "0.5910017", "0.5902906", "0.58946234", "0.5886006", "0.58839184", "0.58691067", "0.5857751", "0.58503544", "0.5847024", "0.58239377", "0.5810564", "0.5810089", "0.5806823", "0.5806823", "0.5800025", "0.5792378", "0.5792378", "0.5792378", "0.5792378", "0.5792378", "0.5792378", "0.5790187", "0.5789414", "0.5787092", "0.57844025", "0.57844025", "0.5774479", "0.5774479", "0.5774479", "0.5774479", "0.5774479", "0.5761362", "0.57596046", "0.57596046", "0.575025", "0.575025", "0.575025", "0.5747959", "0.57337177", "0.57337177", "0.57337177", "0.5721452", "0.5715831", "0.57142824", "0.57140535", "0.57140535", "0.57140535", "0.57140535", "0.57140535", "0.57140535", "0.57140535", "0.5711723", "0.57041645", "0.56991017", "0.5696783", "0.56881124", "0.56774884", "0.56734604", "0.56728", "0.56696945", "0.5661323", "0.5657007", "0.5655942", "0.5655942", "0.5655942", "0.56549734", "0.5654792", "0.5652974", "0.5650185" ]
0.0
-1
Converts an Association to a Constraint in order to allow associations in a profile definition
public static void configureOCL(ResourceSet rset) { Environment.Registry reg = Environment.Registry.INSTANCE; // register prototype environments EcoreEnvironment ecoreEnv = (EcoreEnvironment) EcoreEnvironmentFactory.INSTANCE.createEnvironment(); reg.registerEnvironment(ecoreEnv); UMLEnvironment umlEnv = new UMLEnvironmentFactory(rset).createEnvironment(); reg.registerEnvironment(umlEnv); // register their standard library packages ecoreEnv.getOCLStandardLibrary(); umlEnv.getOCLStandardLibrary(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private void checkForAssociationConstraint()\n {\n try\n {\n String methodName = String.format(\"%sOptions\", name());\n _associationConstraint = _parent.getJavaClass().getMethod(methodName);\n }\n catch (NoSuchMethodException e)\n {\n // ignore\n }\n }", "@SuppressWarnings(\"unchecked\")\r\n public <T> T loadAssociation(Object bean, Association association) {\r\n // check if target property is set\r\n String targetAlias = association.getAlias();\r\n TypedField targetTf = FieldUtils.getBeanTypedField(bean.getClass(), targetAlias);\r\n if(targetTf == null) {\r\n return null;\r\n }\r\n Object value;\r\n try {\r\n value = targetTf.get(bean);\r\n if (value != null) { // if value is set, returns\r\n return (T) value;\r\n } else if (bean instanceof Updatable) {\r\n Set<String> changed = ((Updatable) bean).changed();\r\n if (changed != null && changed.contains(targetTf.getName())) {\r\n return null;\r\n }\r\n }\r\n\r\n Class<?> klass = targetTf.getPropertyType();\r\n\r\n Relation[] relations = association.getRelations();\r\n List<Condition> restrictions = new ArrayList<>();\r\n for (Relation relation : relations) {\r\n // from source FK\r\n String fkAlias = relation.getFrom().getColumn().getAlias();\r\n TypedField tf = FieldUtils.getBeanTypedField(bean.getClass(), fkAlias);\r\n if(tf != null) {\r\n value = tf.get(bean);\r\n restrictions.add(relation.getTo().getColumn().is(Definition.raw(value)));\r\n }\r\n }\r\n\r\n Query query = query(association.getTableTo()).all()\r\n .where(restrictions);\r\n if (Collection.class.isAssignableFrom(klass)) {\r\n Class<?> genKlass = FieldUtils.getTypeGenericClass(targetTf.getType());\r\n value = query.list(genKlass);\r\n if (Set.class.isAssignableFrom(klass)) {\r\n value = new LinkedHashSet<Object>((Collection<?>) value);\r\n } else if (List.class.isAssignableFrom(klass)) {\r\n value = new ArrayList<Object>((Collection<?>) value);\r\n }\r\n } else {\r\n value = query.select(klass);\r\n }\r\n\r\n targetTf.set(bean, value);\r\n\r\n } catch (Exception ex) {\r\n throw new PersistenceException(\"Unable to retrieve association \" + association + \" for \" + bean, ex);\r\n }\r\n\r\n return (T) value;\r\n }", "@SuppressWarnings( \"unchecked\" )\n public static <T> AssociationFunction<T> association( Association<T> association )\n {\n return ( (AssociationReferenceHandler<T>) Proxy.getInvocationHandler( association ) ).association();\n }", "public interface Constraint extends TOSCAObject<Constraint> {\n\n\tpublic String name();\n\n\tpublic default Constraint.Type type() {\n\t\treturn Type.valueOf(Type.class, name());\n\t}\n\n\t/* this is a one entry map so here we pick the single \n\t */\n\tpublic default Object expression() {\n\t\treturn info().values().iterator().next();\n\t}\n\n\tpublic enum Type {\n\t\tequal,\n\t\tgreater_than,\n\t\tgreater_or_equal,\n\t\tless_than,\n\t\tless_or_equal,\n\t\tin_range,\n\t\tvalid_values,\n\t\tlength,\n\t\tmin_length,\n\t\tmax_length,\n\t\tpattern\n\t}\n}", "Constraint createConstraint();", "Constraint createConstraint();", "void addConstraintRelation(IViewRelation relation);", "abstract void takeResposibilityForConnectionOfAssociation(com.webobjects.eointerface.EOAssociation association);", "private VwConstraintDef fromBeanToObject(BaseOracleBean baseBean) {\n VwConstraintDefOracleBean bean = (VwConstraintDefOracleBean) baseBean;\n VwConstraintDef object = new VwConstraintDef();\n object.setConsType(bean.getConsType());\n object.setConsName(bean.getConsName());\n object.setMainTable(bean.getMainTable());\n object.setRefTable(bean.getRefTable());\n object.setTable1(bean.getTable1());\n object.setCol1(bean.getCol1());\n return object;\n }", "TypeAssociation getConcerneZoneAutreElementControle();", "private Association parseAssociation(Record record) {\n return new Association(record.value(CommonTerms.associationIDTerm),\n record.value(DwcTerm.occurrenceID),\n record.value(TermFactory.instance().findTerm(TermURIs.associationType)),\n record.value(TermFactory.instance().findTerm(TermURIs.targetOccurrenceID)),\n record.value(DwcTerm.measurementDeterminedDate), record.value(DwcTerm.measurementDeterminedBy),\n record.value(DwcTerm.measurementMethod), record.value(DwcTerm.measurementRemarks),\n record.value(CommonTerms.sourceTerm), record.value(CommonTerms.bibliographicCitationTerm),\n record.value(CommonTerms.contributorTerm), record.value(CommonTerms.referenceIDTerm));\n }", "@Nullable\n\tprivate TypeInformation<?> detectAssociationTargetType() {\n\n\t\tif (!isAssociation()) {\n\t\t\treturn null;\n\t\t}\n\n\t\tfor (Class<? extends Annotation> annotationType : ASSOCIATION_ANNOTATIONS) {\n\n\t\t\tAnnotation annotation = findAnnotation(annotationType);\n\n\t\t\tif (annotation == null) {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tObject entityValue = AnnotationUtils.getValue(annotation, \"targetEntity\");\n\n\t\t\tif (entityValue == null || entityValue.equals(void.class)) {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\treturn TypeInformation.of((Class<?>) entityValue);\n\t\t}\n\n\t\treturn null;\n\t}", "void addAssociation(Association association);", "Cascade createCascade();", "public interface Constraint<ANNOTATION extends Annotation, TYPE> extends Serializable\n{\n /**\n * For each value or parameter which should be checked this method will be invoked.\n * If the method returns true the value is valid. If it returns false the value\n * is considered invalid. When all constraints have been checked a ConstraintViolationException\n * will be thrown with all the constraint violations that were found.\n *\n * @param annotation the annotation to match\n * @param value the value to be checked\n * @return true if valid, false if invalid\n */\n boolean isValid( ANNOTATION annotation, TYPE value );\n}", "TypeAssociation getConcernePlanFeuxPlanFeux();", "TypeAssociation getAssocieCommeObjetAdresse();", "protected Constraint createConstraint(Structure constraintStructure, Long ownerOMA, Ipo influenceIpo, \r\n\t\t\t\t\t\tBlenderContext blenderContext) throws BlenderFileException {\r\n\t\tString constraintClassName = this.getConstraintClassName(constraintStructure, blenderContext);\r\n\t\tClass<? extends Constraint> constraintClass = constraintClasses.get(constraintClassName);\r\n\t\tif(constraintClass != null) {\r\n\t\t\ttry {\r\n\t\t\t\treturn (Constraint) constraintClass.getDeclaredConstructors()[0].newInstance(constraintStructure, ownerOMA, influenceIpo, \r\n\t\t\t\t\t\tblenderContext);\r\n\t\t\t} catch (IllegalArgumentException e) {\r\n\t\t\t\tthrow new BlenderFileException(e.getLocalizedMessage(), e);\r\n\t\t\t} catch (SecurityException e) {\r\n\t\t\t\tthrow new BlenderFileException(e.getLocalizedMessage(), e);\r\n\t\t\t} catch (InstantiationException e) {\r\n\t\t\t\tthrow new BlenderFileException(e.getLocalizedMessage(), e);\r\n\t\t\t} catch (IllegalAccessException e) {\r\n\t\t\t\tthrow new BlenderFileException(e.getLocalizedMessage(), e);\r\n\t\t\t} catch (InvocationTargetException e) {\r\n\t\t\t\tthrow new BlenderFileException(e.getLocalizedMessage(), e);\r\n\t\t\t}\r\n\t\t} else {\r\n\t\t\tthrow new BlenderFileException(\"Unknown constraint type: \" + constraintClassName);\r\n\t\t}\r\n\t}", "public void createConstraint(ConstraintConfig constraintConfig) throws ConfigurationException;", "public interface AssociationClassConfiguration extends AssociationClass, ClassConfiguration, AssociationConfiguration {\n}", "<C, P> AssociationClassCallExp<C, P> createAssociationClassCallExp();", "static String getAlterArtifactInstancesAddAccountIdConstraintTemplate() {\n // Each \"%s\" will be replaced with the relevant TYPE_instances table name.\n return \"ALTER TABLE %s\"\n + \" ADD CONSTRAINT account_id_fk foreign key (account_id) references accounts(id)\";\n }", "@Mappings({@Mapping(source = \"province\",target = \"province2\"),@Mapping(source = \"valid\",target = \"valid2\")})\n OaCompanyDto convert(OaCompany OaCompany);", "void removeConstraintRelation(IViewRelation relation);", "public Constraint addConstraint() {\n\t\tConstraint newType = new Constraint();\n\t\tgetConstraint().add(newType);\n\t\treturn newType; \n\t}", "A adapt(C constraint);", "@PreAuthorize(\"hasRole('ROLE_USER') and hasPermission(#idDesignOption, 'at.decisionexpert.neo4jentity.node.DesignOption', 'OWNER')\")\n <T extends DOAttributeRelationship<A>, A extends CoreData> DesignOptionRelationDto createRelation(\n @NotNull Long idDesignOption, DesignOptionRelationDto attributeInfo, Class<T> relationClass, Class<A> toNodeType);", "private VwConstraintDefOracleBean fromObjectToBean(VwConstraintDef object) {\n VwConstraintDefOracleBean bean = new VwConstraintDefOracleBean();\n bean.setConsType(object.getConsType());\n bean.setConsName(object.getConsName());\n bean.setMainTable(object.getMainTable());\n bean.setRefTable(object.getRefTable());\n bean.setTable1(object.getTable1());\n bean.setCol1(object.getCol1());\n return bean;\n }", "private RelationMapping createRelationMapping(RoleSchema role, EJB ejb, Table table, Table relatedTable) throws DeploymentException {\n Map columnNameMapping = role.getPkMapping();\n LinkedHashMap ejbFieldMappings = new LinkedHashMap();\n LinkedHashMap columnMappings = new LinkedHashMap();\n for (Iterator iterator = table.getPrimaryKeyFields().iterator(); iterator.hasNext();) {\n Column column = (Column) iterator.next();\n \n // -- column names\n String columnName = column.getPhysicalName();\n String relatedColumnName = (String) columnNameMapping.get(columnName);\n if (null == relatedColumnName) {\n throw new DeploymentException(\"Role \" + role + \" is misconfigured: primary key column [\" +\n columnName + \"] is not mapped to a foreign key.\");\n }\n \n // -- field Names\n String ejbFieldName = column.getName();\n String relatedEjbFieldName = relatedColumnName;\n for (Iterator iter = relatedTable.getAttributes().iterator(); iter.hasNext();) {\n Column relatedTableColumn = (Column) iter.next();\n if (relatedTableColumn.getPhysicalName().equals(relatedColumnName)) {\n relatedEjbFieldName = relatedTableColumn.getName();\n break;\n }\n }\n \n // -- create related ejb field\n FKField relatedEjbField = new FKField(relatedEjbFieldName, relatedColumnName, column.getType());\n ejbFieldMappings.put(ejb.getAttribute(ejbFieldName), relatedEjbField);\n \n \n // -- create related column\n FKColumn relatedcolumn = new FKColumn(relatedEjbFieldName, relatedColumnName, column.getType());\n if (column.isSQLTypeSet()) {\n relatedcolumn.setSQLType(column.getSQLType());\n }\n if (column.isTypeConverterSet()) {\n relatedcolumn.setTypeConverter(column.getTypeConverter());\n }\n columnMappings.put(column, relatedcolumn);\n }\n return new RelationMapping(ejbFieldMappings, columnMappings);\n }", "public T caseAssocRelationshipDefinition(AssocRelationshipDefinition object) {\n\t\treturn null;\n\t}", "public Association association(ComplexEObject ceo)\n {\n if (_inverseFieldName == null)\n {\n return new Association(this, ceo);\n }\n else\n {\n return new Association(this, ceo, inverseField());\n }\n }", "public static <T> AssociationNotNullSpecification<T> isNotNull( Association<T> association )\n {\n return new AssociationNotNullSpecification<>( association( association ) );\n }", "protected abstract void defineConstraints();", "@Override\n\tpublic void addConstraint(String constraint) {\n\n\t}", "public <E extends cn.vertxup.atom.domain.tables.interfaces.IMRelation> E into(E into);", "@Override\n\tpublic void initialize(ValidCreateEmail constraintAnnotation) {\n\t\tConstraintValidator.super.initialize(constraintAnnotation);\n\t}", "public interface LookupConstraint {\n}", "private void checkMappedByOneToMany(DeployBeanInfo<?> info, DeployBeanPropertyAssocMany<?> prop) {\n if (prop.isElementCollection()) {\n // skip mapping check\n return;\n }\n DeployBeanDescriptor<?> targetDesc = targetDescriptor(prop);\n if (targetDesc.isDraftableElement()) {\n // automatically turning on orphan removal and CascadeType.ALL\n prop.setModifyListenMode(BeanCollection.ModifyListenMode.REMOVALS);\n prop.getCascadeInfo().setSaveDelete(true, true);\n }\n\n if (prop.hasOrderColumn()) {\n makeOrderColumn(prop);\n }\n\n if (prop.getMappedBy() == null) {\n // if we are doc store only we are done\n // this allows the use of @OneToMany in @DocStore - Entities\n if (info.getDescriptor().isDocStoreOnly()) {\n prop.setUnidirectional();\n return;\n }\n\n if (!findMappedBy(prop)) {\n if (!prop.isO2mJoinTable()) {\n makeUnidirectional(prop);\n }\n return;\n }\n }\n\n // check that the mappedBy property is valid and read\n // its associated join information if it is available\n String mappedBy = prop.getMappedBy();\n\n // get the mappedBy property\n DeployBeanPropertyAssocOne<?> mappedAssocOne = mappedManyToOne(prop, targetDesc, mappedBy);\n DeployTableJoin tableJoin = prop.getTableJoin();\n if (!tableJoin.hasJoinColumns()) {\n // define Join as the inverse of the mappedBy property\n DeployTableJoin otherTableJoin = mappedAssocOne.getTableJoin();\n otherTableJoin.copyTo(tableJoin, true, tableJoin.getTable());\n }\n\n PropertyForeignKey foreignKey = mappedAssocOne.getForeignKey();\n if (foreignKey != null) {\n ConstraintMode onDelete = foreignKey.getOnDelete();\n switch (onDelete) {\n case SET_DEFAULT:\n case SET_NULL:\n case CASCADE: {\n // turn off cascade delete when we are using the foreign\n // key constraint to cascade the delete or set null\n prop.getCascadeInfo().setDelete(false);\n }\n }\n }\n }", "TypeAssociation getAssocieCommeObjetAction();", "@Override\n\tpublic InscriptionAssuranceVie toBean(InscriptionAssuranceVieDto vo) {\n\t\tInscriptionAssuranceVie iAV = new InscriptionAssuranceVie();\n\t\tif(StringUtil.isNotEmpty(vo.getId())){\n\t\t\tiAV.setId(StringUtil.toLong(vo.getId()));\n\t }\n\t\tif(StringUtil.isNotEmpty(vo.getReference())){\n\t\t\tiAV.setReference(vo.getReference());\n\t }\n\t\tif(StringUtil.isNotEmpty(vo.getPrix())){\n\t\t\tiAV.setPrix(StringUtil.toDouble(vo.getPrix()));\n\t }\n\t\tif(StringUtil.isNotEmpty(vo.getDateInscription())){\n\t\t\ttry {\n\t\t\t\tiAV.setDateInscription(StringUtil.toDate(vo.getDateInscription()));\n\t\t\t} catch (ParseException e) {\n\t\t\t\t// TODO Auto-generated catch block\n\t\t\t\te.printStackTrace();\n\t\t\t}\n\t }\n\t\tif(vo.getClient()!=null && client){\n\t\t\tiAV.setClient(clientConverter.toBean(vo.getClient()));\n }\n\t\tif(vo.getiAVPF()!=null && iAVPF){\n\t\t\tiAV.setiAVPF(iAVPFConverter.toBean(vo.getiAVPF()));\n }\n\t\treturn iAV;\n\t}", "com.microsoft.schemas.crm._2011.contracts.ArrayOfConstraintRelation getConstraints();", "@objid (\"db7f3c97-1871-4855-958d-3659b2211f8a\")\n protected Object getConstraint() {\n return this.constraint;\n }", "Proof contraConvert(Proof p) {\n Expression a = ((Implication) p.lastExpr()).statement;\n Expression b = ((Implication) p.lastExpr()).consequence;\n return mpBack(contra(a, b), p);\n }", "public static Function<Type, Association> createAssociation(final boolean end1IsNavigable, final AggregationKind end1Aggregation, final String end1Name, final int end1Lower, final int end1Upper, final Type end1Type, final boolean end2IsNavigable, final AggregationKind end2Aggregation, final String end2Name, final int end2Lower, final int end2Upper) {\n return new Function<Type, Association>() {\n public Association apply(Type s) {\n return s.createAssociation(end1IsNavigable, end1Aggregation, end1Name, end1Lower, end1Upper, end1Type, end2IsNavigable, end2Aggregation, end2Name, end2Lower, end2Upper);\n }\n };\n }", "ConstraintModelFactory getConstraintModelFactory();", "public interface ConstraintContext {\n Optional<TraversalConstraint> getConstraint();\n}", "List<IViewRelation> getConstraintRelations();", "com.microsoft.schemas.crm._2011.contracts.ArrayOfConstraintRelation addNewConstraints();", "TypeAssociation getAssocieCommeSujetInstanceObjet();", "void addAssociation(AssociationEnd association);", "public String getAssociationId() {\n return this.associationId;\n }", "@Optional\n Association<GebaeudeArtStaBuComposite> gebaeudeArtStaBu();", "@SuppressWarnings( \"unchecked\" )\n public static <T> NamedAssociationFunction<T> namedAssociation( NamedAssociation<T> association )\n {\n return ( (NamedAssociationReferenceHandler<T>) Proxy.getInvocationHandler( association ) ).namedAssociation();\n }", "public TournamentEditorConstraints getTournamentEditorConstraints();", "void readAssociations() {\n // proxy the collections for lazy loading\n Class c = getClass();\n for (Field f : c.getDeclaredFields()) {\n for (Annotation a : f.getAnnotations()) {\n if (a.annotationType().equals(HasMany.class)) {\n HasManyProxy proxyHandler = new HasManyProxy(this, f, (HasMany) a);\n associationProxies.add(proxyHandler);\n Classes.setFieldValue(this, f.getName(), Proxy.newProxyInstance(List.class.getClassLoader(),\n new Class[]{List.class}, proxyHandler));\n } else if (a.annotationType().equals(HasAndBelongsToMany.class)) {\n // TODO implement\n } else if (a.annotationType().equals(HasOne.class)) {\n // TODO implement\n } else if (a.annotationType().equals(BelongsTo.class)) {\n BelongsTo belongsTo = (BelongsTo) a;\n if (!(f.getGenericType() instanceof Class))\n throw new IllegalAnnotationException(\"@BelongsTo can only be applied to non-generic fields\");\n ActiveRecord ar = (ActiveRecord) Classes.newInstance(f.getGenericType());\n String fk = ActiveRecords.foriegnKey(f.getGenericType());\n if (!belongsTo.foreignKey().equals(\"\")) fk = belongsTo.foreignKey();\n System.out.println(\"foriegn key = \" + fk);\n Object fkValue = Classes.getFieldValue(this, fk);\n if (fkValue != null) {\n ar.read(fkValue);\n Classes.setFieldValue(this, f.getName(), ar);\n }\n }\n }\n }\n }", "public T caseAssociationType(AssociationType object) {\n\t\treturn null;\n\t}", "@Generated\n @Selector(\"isConstrained\")\n public native boolean isConstrained();", "void visitConstraintValue(ConstraintValue value);", "public <E extends io.cattle.platform.core.model.HaMembership> E into(E into);", "@Override\n\tpublic DEREncodable getValue(final UserDataVO subject, final CA ca, final CertificateProfile certProfile, final PublicKey userPublicKey, final PublicKey caPublicKey ) throws CertificateExtentionConfigurationException, CertificateExtensionException {\n\t\tBasicConstraints bc = new BasicConstraints(false);\n if ((certProfile.getType() == CertificateProfile.TYPE_SUBCA)\n || (certProfile.getType() == CertificateProfile.TYPE_ROOTCA)){ \t\n \tif(certProfile.getUsePathLengthConstraint()){\n \t\tbc = new BasicConstraints(certProfile.getPathLengthConstraint());\n \t}else{\n \t\tbc = new BasicConstraints(true);\n \t} \t\n }\n\t\treturn bc;\n\t}", "public void setAssociationId(String associationId) {\n this.associationId = associationId;\n }", "public static MappingRule getMappingRule(WrapperRuleJAXB wrapperRuleJAXB, String xmlOrJson) {\r\n\t\tMappingRuleJAXB mappingRuleJAXB = null;\r\n\t\tif (xmlOrJson.equals(\"xml\")) {\r\n\t\t\tmappingRuleJAXB = XmlJsonObjectConvertor.getMappingRuleFromXML(wrapperRuleJAXB.getJsonORxml());\r\n\t\t} else if (xmlOrJson.equals(\"json\")) {\r\n\t\t\tmappingRuleJAXB = XmlJsonObjectConvertor.getMappingRuleFromJSON(wrapperRuleJAXB.getJsonORxml());\r\n\t\t}\r\n\r\n\t\tMappingRule mappingRule = new MappingRule();\r\n\t\ttry {\r\n\t\t\tBeanUtils.copyProperties(mappingRule, mappingRuleJAXB);\r\n\t\t} catch (IllegalAccessException | InvocationTargetException e) {\r\n\t\t\te.printStackTrace();\r\n\t\t}\r\n\t\treturn mappingRule;\r\n\t}", "private void convert(AssignStatContext c, List<String> ssa) {\n\t\tString expr = getExpr(c.expr());\n\t\tString id = this.variableTrack.get(c.ID().getText());\n\t\tString newId = generateNewName(id);\n\t\tString constraint = \"(assert(= \" + newId + \" \" + expr + \"))\";\n\t\tssa.add(constraint);\n\t\t\n\t}", "Optional<CompositionSpaceToDraftAssociation> opt(UUID compositionSpaceId);", "protected <T> String resolveAssociationInsert(\n Class repositoryType,\n RuntimePersistentEntity<T> persistentEntity,\n RuntimeAssociation<T> association) {\n return associationInserts.computeIfAbsent(association, association1 -> {\n final SqlQueryBuilder queryBuilder = queryBuilders.getOrDefault(repositoryType, DEFAULT_SQL_BUILDER);\n return queryBuilder.buildJoinTableInsert(persistentEntity, association1);\n });\n }", "public interface FrequencyConstraintShapeType extends ExternalConstraintShapeType {\n}", "RelatedPerson<Person, Person> relatePerson(String person1, String person2, String relation);", "@Override\n\tprotected boolean addResolverSub(ConstraintNetwork metaVariable,\n\t\t\tConstraintNetwork metaValue) {\n\t\t\n\t\tfor (int i = 0; i < metaValue.getConstraints().length; i++) {\n\t\t\tif(metaValue.getConstraints()[i] instanceof UnaryRectangleConstraint)\n\t\t\t\t//this if will check for unboudned obj in order to create the goal\n\t\t\t\tif(((UnaryRectangleConstraint)metaValue.getConstraints()[i]).getType().equals(UnaryRectangleConstraint.Type.At)) \n\t\t\t\t\tif(((MetaSpatialConstraint2)this.metaConstraints.get(0)).isUnboundedBoundingBox(\n\t\t\t\t\t\t\t((UnaryRectangleConstraint)metaValue.getConstraints()[i]).getBounds()[0], \n\t\t\t\t\t\t\t((UnaryRectangleConstraint)metaValue.getConstraints()[i]).getBounds()[1], \n\t\t\t\t\t\t\t((UnaryRectangleConstraint)metaValue.getConstraints()[i]).getBounds()[2], \n\t\t\t\t\t\t\t((UnaryRectangleConstraint)metaValue.getConstraints()[i]).getBounds()[3]));\n//\t\t\t\t\t\tSystem.out.println(((UnaryRectangleConstraint)metaValue.getConstraints()[i]).getTo());\n\t\t\t\t\t\n\t\t}\n\t\treturn true;\n\t\t\n\t}", "@Override\n\tpublic void visit(OWLClassAssertionAxiom axiom) {\n\n\t\taddFact(RewritingVocabulary.ISA,//\n\t\t\t\taxiom.getIndividual().asOWLNamedIndividual().getIRI(), //\n\t\t\t\taxiom.getClassExpression().asOWLClass().getIRI());\n\t}", "public Collection getRoleConstraints(OSLSchema schema, AssociationIF assoc) {\n // find appropriate class\n AssociationClass klass = (AssociationClass) findClass(assoc, schema.getAssociationClasses());\n if (klass == null)\n return Collections.EMPTY_LIST;\n return klass.getRoleConstraints();\n }", "public InstConstraintVisitor(){}", "public FormalGenConstraint getConstraint() {\n return constraint;\n }", "@Override\r\n\tpublic void addAssociations(Criteria criteria) {\r\n\r\n\t\tif (immunization.getPatient() != null) {\r\n\t\t\tcriteria = criteria.add(Restrictions.eq(\"patient.id\", immunization\r\n\t\t\t\t\t.getPatient().getId()));\r\n\t\t}\r\n\r\n\t\tif (immunization.getVaccine() != null) {\r\n\t\t\tcriteria = criteria.add(Restrictions.eq(\"vaccine.id\", immunization\r\n\t\t\t\t\t.getVaccine().getId()));\r\n\t\t}\r\n\r\n\t}", "protected void createMimoentslotconstraintsAnnotations() {\n\t\tString source = \"mimo-ent-slot-constraints\";\n\t\taddAnnotation\n\t\t (getInvoice_InvoiceStatuses(),\n\t\t source,\n\t\t new String[] {\n\t\t\t \"statusDate\", \"*NOW\"\n\t\t });\n\t}", "public void addAssociation(String mPackage, Class type, RefObject a, RefObject b) throws CreationException {\n\t\t\n\t\ttrace.addTrace(TraceType.CREATION, \"Create Association of type \" + type.getSimpleName() + \" in target model.\");\n\t\t\n\t\tRefPackage pkg = loadBasePackage(mPackage);\n\t\tCollection<RefAssociation> assos = pkg.refAllAssociations();\n\t\tfor(RefAssociation ass:assos) {\n\t\t\t/* \n\t\t\t * The return type of java.lang.Class.getInterfaces()\n\t\t\t * has changed in Java 1.6.\n\t\t\t * To compile this file using Java 1.6 or later, change the\n\t\t\t * generic of the List 'interfaces' from List<Class> to\n\t\t\t * List<Class<?>>. \n\t\t\t */\n\t\t\tList<Class> interfaces = Arrays.asList(ass.getClass().getInterfaces());\n\t\t\tif(interfaces.contains(type)) {\n\t\t\t\tMethod add = null;\n\t\t\t\tMethod[] methods = ass.getClass().getMethods();\n\t\t\t\tfor(Method m : methods) {\n\t\t\t\t\tif (m.getName().equals(\"add\")) {\n\t\t\t\t\t\tadd = m;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tif (add == null) {\n\t\t\t\t\tthrow new CreationException(ADD_METHOD_NOT_FOUND + type.getSimpleName());\n\t\t\t\t}\n\t\t\t\n\t\t\t\tObject[] parameters = {a,b};\n\t\t\t\ttry {\n\t\t\t\t\tadd.invoke(ass, parameters);\n\t\t\t\t} catch (IllegalArgumentException e) {\n\t\t\t\t\tthrow new CreationException(ERROR_ADD_ASS + type.getSimpleName());\n\t\t\t\t} catch (IllegalAccessException e) {\n\t\t\t\t\tthrow new CreationException(ERROR_ADD_ASS + type.getSimpleName());\n\t\t\t\t} catch (InvocationTargetException e) {\n\t\t\t\t\tthrow new CreationException(ERROR_ADD_ASS + type.getSimpleName());\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t}\t\n\t\n\t\t\n\t\t}", "public void testAssociation() {\n \t\tString ID1 = \"iu.1\";\n \t\tString IDF1 = \"iu.fragment.1\";\n \t\tIInstallableUnit iu1 = createEclipseIU(ID1);\n \t\tIInstallableUnit iuf1 = createBundleFragment(IDF1);\n \t\tProfileChangeRequest req = new ProfileChangeRequest(createProfile(getName()));\n \t\treq.addInstallableUnits(iu1, iuf1);\n \t\tcreateTestMetdataRepository(new IInstallableUnit[] {iu1, iuf1});\n \t\tIQueryable<IInstallableUnit> additions = createPlanner().getProvisioningPlan(req, null, null).getAdditions();\n \t\t{\n \t\t\tIterator<IInstallableUnit> iterator = additions.query(QueryUtil.createIUQuery(ID1), null).iterator();\n \t\t\tassertTrue(\"Solution contains IU \" + ID1, iterator.hasNext());\n \t\t\tIInstallableUnit iu = iterator.next();\n \t\t\tassertEquals(\"Number of attached fragments to IU \" + ID1, 1, iu.getFragments().size());\n \t\t\tassertEquals(\"Attached fragment to IU \" + ID1, IDF1, iu.getFragments().iterator().next().getId());\n \t\t}\n \t\t{\n \t\t\tIterator<IInstallableUnit> iterator = additions.query(QueryUtil.createIUQuery(IDF1), null).iterator();\n \t\t\tassertTrue(\"Solution contains IU \" + IDF1, iterator.hasNext());\n \t\t\tIInstallableUnit iu = iterator.next();\n \t\t\tassertEquals(\"Number of attached fragments to IU \" + IDF1, 0, iu.getFragments().size());\n \t\t}\n \t\t//\t\tResolutionHelper rh = new ResolutionHelper(new Hashtable(), null);\n \t\t//\t\tHashSet set = new HashSet();\n \t\t//\t\tset.add(iu1);\n \t\t//\t\tset.add(iu2);\n \t\t//\t\tCollection result = rh.attachCUs(set);\n \t}", "void addConstraintEntity(IViewEntity entity);", "QueryConstraintType createQueryConstraintType();", "protected ValidationComponent createInverseMappingComponent (\n\t\tfinal RelationshipElement field)\n\t{\n\t\treturn new ValidationComponent ()\n\t\t{\n\t\t\tpublic void validate () throws ModelValidationException\n\t\t\t{\n\t\t\t\tModel model = getModel();\n\t\t\t\tRelationshipElement inverse = \n\t\t\t\t\tfield.getInverseRelationship(model);\n\n\t\t\t\tif ((inverse != null) && !isInverseMapping(field, inverse))\n\t\t\t\t{\n\t\t\t\t\tString fieldName = field.getName();\n\n\t\t\t\t\tthrow new ModelValidationException(\n\t\t\t\t\t\tmodel.getField(getClassName(), fieldName), \n\t\t\t\t\t\tI18NHelper.getMessage(getMessages(), \n\t\t\t\t\t\t\"util.validation.inverse_mapping_mismatch\", //NOI18N\n\t\t\t\t\t\tnew Object[]{fieldName, inverse.getName()}));\n\t\t\t\t}\n\t\t\t}\n\t\t\tprivate boolean hasMappingRows (MappingRelationshipElement field2)\n\t\t\t{\n\t\t\t\tif (field2 != null)\n\t\t\t\t{\n\t\t\t\t\tArrayList columns = field2.getColumns();\n\t\t\t\t\t\n\t\t\t\t\treturn ((columns != null) && !columns.isEmpty());\n\t\t\t\t}\n\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\tprivate boolean isInverseMapping (RelationshipElement jdoField1,\n\t\t\t\tRelationshipElement jdoField2)\n\t\t\t{\n\t\t\t\tMappingRelationshipElement field1 = \n\t\t\t\t\tgetMappingRelationship(jdoField1);\n\t\t\t\tMappingRelationshipElement field2 = \n\t\t\t\t\tgetMappingRelationship(jdoField2);\n\t\t\t\tboolean field1HasMapping = hasMappingRows(field1);\n\t\t\t\tboolean field2HasMapping = hasMappingRows(field2);\n\n\t\t\t\t// if both have rows, they must be exact inverses\n\t\t\t\tif (field1HasMapping && field2HasMapping)\n\t\t\t\t{\n\t\t\t\t\tboolean field1IsJoin = isJoin(field1);\n\n\t\t\t\t\tif (field1IsJoin == isJoin(field2))\n\t\t\t\t\t{\n\t\t\t\t\t\tArrayList pairs1 = field1.getColumns();\n\t\t\t\t\t\tArrayList pairs2 = field2.getColumns();\n\n\t\t\t\t\t\treturn ((!field1IsJoin) ? isInverse(pairs1, pairs2) :\n\t\t\t\t\t\t\t(isInverse(pairs1, \n\t\t\t\t\t\t\tfield2.getAssociatedColumns()) && \n\t\t\t\t\t\t\tisInverse(field1.getAssociatedColumns(), pairs2)));\n\t\t\t\t\t}\n\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\n\t\t\t\t// if neither have rows that's fine\n\t\t\t\treturn (field1HasMapping == field2HasMapping);\n\t\t\t}\n\t\t\tprivate boolean isInverse (ArrayList pairs1, ArrayList pairs2)\n\t\t\t{\n\t\t\t\tint i, size1 = pairs1.size(), size2 = pairs2.size();\n\n\t\t\t\tif (size1 == size2)\n\t\t\t\t{\n\t\t\t\t\tfor (i = 0; i < size1; i++)\n\t\t\t\t\t{\n\t\t\t\t\t\tString nextPair = (String)pairs1.get(i);\n\t\t\t\t\t\tString inversePair = (String)pairs2.get(i);\n\t\t\t\t\t\tint semicolonIndex1 = nextPair.indexOf(';');\n\t\t\t\t\t\tint semicolonIndex2 = inversePair.indexOf(';');\n\n\t\t\t\t\t\tif (((semicolonIndex1 == -1) || (semicolonIndex2 == -1))\n\t\t\t\t\t\t\t|| (!nextPair.substring(0, semicolonIndex1).equals(\n\t\t\t\t\t\t\tinversePair.substring(semicolonIndex2 + 1)) || \n\t\t\t\t\t\t\t!nextPair.substring(semicolonIndex1 + 1).equals(\n\t\t\t\t\t\t\tinversePair.substring(0, semicolonIndex2))))\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\treturn false;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\n\t\t\t\treturn false;\n\t\t\t}\n\t\t};\n\t}", "private void checkMappedByOneToOne(DeployBeanPropertyAssocOne<?> prop) {\n String mappedBy = prop.getMappedBy();\n // get the mappedBy property\n DeployBeanDescriptor<?> targetDesc = targetDescriptor(prop);\n DeployBeanPropertyAssocOne<?> mappedAssocOne = mappedOneToOne(prop, mappedBy, targetDesc);\n DeployTableJoin tableJoin = prop.getTableJoin();\n if (!tableJoin.hasJoinColumns()) {\n // define Join as the inverse of the mappedBy property\n DeployTableJoin otherTableJoin = mappedAssocOne.getTableJoin();\n otherTableJoin.copyWithoutType(tableJoin, true, tableJoin.getTable());\n }\n\n if (mappedAssocOne.isPrimaryKeyJoin()) {\n // bi-directional PrimaryKeyJoin ...\n mappedAssocOne.setPrimaryKeyJoin(false);\n prop.setPrimaryKeyExport();\n addPrimaryKeyJoin(prop);\n }\n }", "protected Command createChangeConstraintCommand( EditPart child, Object constraint ) {\n return null;\r\n }", "public void addRule(SkeletonJoint from, int relation, SkeletonJoint to)\n\t{\n\t\tBodyPoseRule rule = new BodyPoseRule(from, relation, to);\n\t\trules.add(rule);\n\t}", "@Override\n\tpublic InscriptionAssuranceVieDto toVo(InscriptionAssuranceVie bean) {\n\t\tInscriptionAssuranceVieDto iAV = new InscriptionAssuranceVieDto();\n\t\tif(StringUtil.isNotEmpty(StringUtil.toString(bean.getId()))){\n\t\t\tiAV.setId(StringUtil.toString(bean.getId()));\n\t }\n\t\tif(StringUtil.isNotEmpty(bean.getReference())){\n\t\t\tiAV.setReference(bean.getReference());\n\t }\n\t\tif(StringUtil.isNotEmpty(StringUtil.toString(bean.getPrix()))){\n\t\t\tiAV.setPrix(StringUtil.toString(bean.getPrix()));\n\t }\n\t\tif(StringUtil.isNotEmpty(StringUtil.toString(bean.getDateInscription()))){\n\t\t\tiAV.setDateInscription(StringUtil.toString(bean.getDateInscription()));\n\t }\n\t\tif(bean.getClient()!=null && client){\n\t\t\tiAV.setClient(clientConverter.toVo(bean.getClient()));\n }\n\t\tif(bean.getiAVPF()!=null && iAVPF){\n\t\t\tiAV.setiAVPF(iAVPFConverter.toVo(bean.getiAVPF()));\n }\n\t\treturn iAV;\n\t}", "private boolean createForeignKeyRelation(String server, String database,\n\t\t\tRelationship relationship)\n\t\t\tthrows ClassNotFoundException, SQLException {\n\t\tString fromColumn = relationship.getFromColumns().get(0).getName();\n\t\tString toColumn = relationship.getToColumns().get(0).getName();\n\t\tString fromTable = getNormalisedTableName(relationship.getFromTable()\n\t\t\t\t.getName());\n\t\tString toTable = getNormalisedTableName(relationship.getToTable()\n\t\t\t\t.getName());\n\t\tString command = (\"ALTER TABLE \\\"\" + toTable + \"\\\" ADD CONSTRAINT \"\n\t\t\t\t+ relationship.getName() + \" FOREIGN KEY (\\\"\" + toColumn\n\t\t\t\t+ \"\\\") REFERENCES \\\"\" + fromTable + \"\\\" (\\\"\" + fromColumn + \"\\\") ON UPDATE NO ACTION ON DELETE NO ACTION DEFERRABLE INITIALLY DEFERRED; \\n\");\n\t\treturn new QueryRunner(server, database)\n\t\t\t\t.runDBQuery(command);\n\t}", "private <A extends Annotation> List<ConstraintDescriptorImpl<?>> findConstraintAnnotations(Class<?> clazz, A annotation, ElementType type) {\n\t\tList<ConstraintDescriptorImpl<?>> constraintDescriptors = new ArrayList<ConstraintDescriptorImpl<?>>();\n\n\t\tList<Annotation> constraints = new ArrayList<Annotation>();\n\t\tClass<? extends Annotation> annotationType = annotation.annotationType();\n\t\tif ( constraintHelper.isConstraintAnnotation( annotationType )\n\t\t\t\t|| constraintHelper.isBuiltinConstraint( annotationType ) ) {\n\t\t\tconstraints.add( annotation );\n\t\t}\n\t\telse if ( constraintHelper.isMultiValueConstraint( annotationType ) ) {\n\t\t\tconstraints.addAll( constraintHelper.getMultiValueConstraints( annotation ) );\n\t\t}\n\n\t\tfor ( Annotation constraint : constraints ) {\n\t\t\tfinal ConstraintDescriptorImpl<?> constraintDescriptor = buildConstraintDescriptor(\n\t\t\t\t\tclazz, constraint, type\n\t\t\t);\n\t\t\tconstraintDescriptors.add( constraintDescriptor );\n\t\t}\n\t\treturn constraintDescriptors;\n\t}", "ForeignKey createForeignKey();", "public static List<Constraint> getAttributeConstraints(ServiceReference reference) {\n\t\tString keys[] = reference.getPropertyKeys();\n\t\tList<Constraint> attConstraints = new ArrayList<Constraint>();\n\t\tfor (String key : keys) {\n\t\t\tif (key != null && key.toLowerCase().startsWith(Attribute.SERVICE_CONSTRAINT) || key.toLowerCase().startsWith(Attribute.OPERATION_CONSTRAINT) ) {\n\t\t\t\tObject value = reference.getProperty(key);\n\t\t\t\tConstraint attConstraint = parse(key, value);\n\t\t\t\tif (attConstraint != null) {\n\t\t\t\t\tattConstraints.add(attConstraint);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn attConstraints;\n\t}", "public void setAccount(Account associatedAccount){\r\n\t\tthis.associatedAccount = associatedAccount;\r\n\t}", "public abstract\n ImmutableUniqueMemberConstraint getUniqueMemberConstraint();", "@Override\n public Constraint converConstrain(String classname, String parvarn1, String parvarn2, String parvarn3) throws ClassNotFoundException, SecurityException, NoSuchMethodException, IllegalArgumentException, InstantiationException, IllegalAccessException, InvocationTargetException {\n IntVar varConverX = new IntVar(); IntVar varConverY = new IntVar(); IntVar varConverZ = new IntVar(); varConverX.id = parvarn1;varConverY.id = parvarn2; varConverZ.id = parvarn3 ;\n Class<?> clasCon = Class.forName(classname);\n Constructor<?> constru2 = clasCon.getDeclaredConstructor(new Class<?>[] {JaCoP.core.IntVar.class,JaCoP.core.IntVar.class, JaCoP.core.IntVar.class});\n Constraint c = (Constraint) constru2.newInstance(varConverX,varConverY, varConverZ);\n return c;\n }", "public static boolean isAssignable(JvmAnnotationReference anAnnotation) {\n\t\treturn ACCEPTED_ANNOTATION_NAMES.contains(anAnnotation.getAnnotation().getQualifiedName());\n\t}", "Restriction generate(ValueStoreReader entityInstReader, String rule) throws UnifyException;", "private void addRelationshipConstraintConflicts(\n RelationshipConstraint constraint,\n org.hisp.dhis.dxf2.deprecated.tracker.trackedentity.RelationshipItem relationshipItem,\n String relationshipUid,\n ImportConflicts importConflicts) {\n RelationshipEntity entity = constraint.getRelationshipEntity();\n String itemUid = getUidOfRelationshipItem(relationshipItem);\n\n if (TRACKED_ENTITY_INSTANCE.equals(entity)) {\n TrackedEntity tei = trackedEntityInstanceCache.get(itemUid);\n\n if (tei == null) {\n importConflicts.addConflict(relationshipUid, \"TrackedEntity '\" + itemUid + \"' not found.\");\n } else if (!tei.getTrackedEntityType().equals(constraint.getTrackedEntityType())) {\n importConflicts.addConflict(\n relationshipUid, \"TrackedEntity '\" + itemUid + \"' has invalid TrackedEntityType.\");\n }\n } else if (PROGRAM_INSTANCE.equals(entity)) {\n Enrollment pi = programInstanceCache.get(itemUid);\n\n if (pi == null) {\n importConflicts.addConflict(relationshipUid, \"Enrollment '\" + itemUid + \"' not found.\");\n } else if (!pi.getProgram().equals(constraint.getProgram())) {\n importConflicts.addConflict(\n relationshipUid, \"Enrollment '\" + itemUid + \"' has invalid Program.\");\n }\n } else if (PROGRAM_STAGE_INSTANCE.equals(entity)) {\n Event psi = programStageInstanceCache.get(itemUid);\n\n if (psi == null) {\n importConflicts.addConflict(relationshipUid, \"Event '\" + itemUid + \"' not found.\");\n } else {\n if (constraint.getProgram() != null\n && !psi.getProgramStage().getProgram().equals(constraint.getProgram())) {\n importConflicts.addConflict(\n relationshipUid, \"Event '\" + itemUid + \"' has invalid Program.\");\n } else if (constraint.getProgramStage() != null\n && !psi.getProgramStage().equals(constraint.getProgramStage())) {\n importConflicts.addConflict(\n relationshipUid, \"Event '\" + itemUid + \"' has invalid ProgramStage.\");\n }\n }\n }\n }", "CompositionSpaceToDraftAssociation storeIfAbsent(CompositionSpaceToDraftAssociation association);", "private Rule toRule(RuleEntity entity) {\n Rule rule = new Rule();\n RuleIf ruleIf = new RuleIf();\n RuleThen ruleThen = new RuleThen();\n RuleThenAwardPoints ruleThenAwardPoints = new RuleThenAwardPoints();\n ruleThenAwardPoints.setAmount(entity.get_then().getAwardPoints().getAmount());\n ruleThenAwardPoints.setPointScale(URI.create(entity.get_then().getAwardPoints().getPointScale()));\n ruleThen.setAwardPoints(ruleThenAwardPoints);\n ruleThen.setAwardBadge(URI.create(entity.get_then().getAwardBadge()));\n ruleIf.setType(entity.get_if().getType());\n rule.setIf(ruleIf);\n rule.setThen(ruleThen);\n return rule;\n }", "@Override\r\n\tpublic void initialize(UniqueUsername constraintAnnotation) {\n\t\t\r\n\t}", "TypeAssociationEXT getConcerneUniteUnite();", "@Test\n public void testAddAss() {\n ArrayList<Association<String, String>> arrayAs = new ArrayList<>();\n String in=\"cat\";\n String es=\"gato\";\n Association h=new Association (in, es);\n arrayAs.add(h);\n in=\"ballon\";\n es=\"globo\";\n Association k=new Association (in, es);\n arrayAs.add(k);\n Diccionario instance = new Diccionario(arrayAs);\n }", "@Test\n public void testConvertPhenotypeAssociation() {\n assertThat( searchService.loadValueObject( SearchResult.from( PhenotypeAssociation.class, phenotypeAssociation, 1.0, \"test object\" ) ) )\n .extracting( \"resultObject\" )\n .isSameAs( phenotypeAssociation );\n assertThat( searchService.loadValueObjects( Collections.singleton( SearchResult.from( PhenotypeAssociation.class, phenotypeAssociation, 1.0, \"test object\" ) ) ) )\n .extracting( \"resultObject\" )\n .containsExactly( phenotypeAssociation );\n }", "public void setCoverable(entity.APDCoverable value);", "public void addConstraint(final PgConstraint constraint) {\n constraints.add(constraint);\n }" ]
[ "0.5510775", "0.52924275", "0.5094809", "0.48270616", "0.48160917", "0.48160917", "0.47952688", "0.47342783", "0.4672238", "0.46582177", "0.46023276", "0.45803928", "0.4576436", "0.4559461", "0.45512438", "0.44969672", "0.4488147", "0.44822723", "0.44542292", "0.44443333", "0.44270644", "0.4356389", "0.43487763", "0.43089947", "0.43076608", "0.42960626", "0.42906493", "0.4267765", "0.42301306", "0.41894168", "0.41795814", "0.41791946", "0.4167457", "0.41624397", "0.41580883", "0.41548565", "0.41429752", "0.414085", "0.4124466", "0.4119789", "0.41039366", "0.41013286", "0.40995604", "0.40945464", "0.40857744", "0.40756723", "0.40635696", "0.40595242", "0.40569508", "0.4035861", "0.4022127", "0.40185097", "0.4010007", "0.39998233", "0.3994247", "0.3992265", "0.39906067", "0.39859813", "0.39663392", "0.39650792", "0.39300373", "0.389195", "0.38864055", "0.38768145", "0.38650066", "0.3862038", "0.3860907", "0.3858801", "0.38551134", "0.38457948", "0.38301772", "0.38286862", "0.38238776", "0.3821572", "0.3821122", "0.38133526", "0.380266", "0.37946326", "0.3793763", "0.378555", "0.37828195", "0.37827042", "0.3782219", "0.37814212", "0.37803924", "0.37784535", "0.3777493", "0.3767758", "0.37601137", "0.37578407", "0.3755319", "0.3749337", "0.3738894", "0.37375337", "0.3736367", "0.3734305", "0.37322515", "0.37316266", "0.3731111", "0.37255982", "0.37243727" ]
0.0
-1
Changing from familiar A (with stillsuit) to familiar B when familiar C is our desired stillsuit familiar
@Test void respectsStillSuitFamiliar() { setupFakeClient(); var cleanups = new Cleanups( withFamiliar(FamiliarPool.GROUPIE), withEquipped(EquipmentManager.FAMILIAR, ItemPool.STILLSUIT), withFamiliarInTerrarium(FamiliarPool.BOWLET), withFamiliarInTerrarium(FamiliarPool.GREY_GOOSE), withProperty("stillsuitFamiliar", "Bowlet")); try (cleanups) { var newFamiliar = FamiliarData.registerFamiliar(FamiliarPool.GREY_GOOSE, 0); var req = new FamiliarRequest(newFamiliar); req.responseText = "You take"; req.processResults(); var requests = getRequests(); assertThat(requests, hasSize(2)); assertPostRequest( requests.get(0), "/familiar.php", "famid=" + FamiliarPool.GROUPIE + "&action=unequip&ajax=1"); assertPostRequest( requests.get(1), "/familiar.php", "action=equip&whichfam=" + FamiliarPool.BOWLET + "&whichitem=10932&ajax=1"); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void accusation() {\n\t\tNotebook notebook = turnController.getData().getCurrentTurn()\n\t\t\t\t.getPlayer().getNotebook();\n\t\tCard room = notebook.getViableCards(Card.Type.ROOM).get(0);\n\t\tCard suspect = notebook.getViableCards(Card.Type.SUSPECT).get(0);\n\t\tCard weapon = notebook.getViableCards(Card.Type.WEAPON).get(0);\n\n\t\tturnController.makeAccusation(room, suspect, weapon);\n\t}", "public String chooseSuit()\t{\n\t\tString choose = \"\";\n\t\tSystem.out.println(\"Choose a suit: h) hearts, d) diamonds, s) spades, c) clubs\");\n\t\tchoose = input.nextLine();\n\t\tswitch(choose.toLowerCase())\t{\n\t\tcase \"h\":\n\t\t\tchoose = \"Hearts\";\n\t\t\tbreak;\n\t\tcase \"d\":\n\t\t\tchoose = \"Diamonds\";\n\t\t\tbreak;\n\t\tcase \"s\":\n\t\t\tchoose = \"Spades\";\n\t\t\tbreak;\n\t\tcase \"c\":\n\t\t\tchoose = \"Clubs\";\n\t\t\tbreak;\n\t\tdefault:\n\t\t\tSystem.out.println(\"Try again!\");\n\t\t\tchooseSuit();\n\t\t\tbreak;\n\t\t}\n\t\treturn choose;\n\t}", "private void choosePrompt() {\r\n\t\tfor (int i = 0; i < mustChoose.size(); i++) {\r\n\t\t\tString prompt = \"**[Choose]** \";\r\n\t\t\t// Find the correct text to display\r\n\t\t\tif (mustChoose.get(i).contentEquals(\"Shrine\")) {\r\n\t\t\t\tprompt += \"**1** :moneybag: ~OR~ **1** :heart:\";\r\n\t\t\t} else if (mustChoose.get(i).contentEquals(\"Dragon Shrine\")) {\r\n\t\t\t\tprompt += \"**2** :moneybag: ~OR~ **1** :wastebasket:\";\r\n\t\t\t} else if (mustChoose.get(i).contentEquals(\"Treasure Hunter\")) {\r\n\t\t\t\tprompt += \"a card to replace in the dungeon row (4-9)\";\r\n\t\t\t} else if (mustChoose.get(i).contentEquals(\"Underworld Dealing\")) {\r\n\t\t\t\tprompt += \"**1** :moneybag: ~OR~ **BUY 2** __Secret Tome__ **FOR 7** :moneybag:\";\r\n\t\t\t} else if (mustChoose.get(i).contentEquals(\"Apothecary\")) {\r\n\t\t\t\tprompt += \"**3** :crossed_swords: **~OR~** **2** :moneybag: **~OR~** **1** :heart:\";\r\n\t\t\t} else if (mustChoose.get(i).contentEquals(\"Mister Whiskers\")) {\r\n\t\t\t\tprompt += \"**Dragon Attack** ~OR~ **-2** :warning:\";\r\n\t\t\t} else if (mustChoose.get(i).contentEquals(\"Wand of Wind\")) {\r\n\t\t\t\tif (GlobalVars.teleportRoomsPerRoom.length > 0) {\r\n\t\t\t\t\tprompt += \"**1** :crystal_ball: ~OR~ Take a **SECRET** from an adjacent room ``\"+\r\n\t\t\t\t\t\tUtils.arrayToString(GlobalVars.adjacentRoomsPerRoom[currentPlayer.getCurrentRoom()])+\" ┃ \"+\r\n\t\t\t\t\t\tUtils.arrayToString(GlobalVars.teleportRoomsPerRoom[currentPlayer.getCurrentRoom()])+\"``\";\r\n\t\t\t\t} else {\r\n\t\t\t\t\tprompt += \"**1** :crystal_ball: ~OR~ Take a **SECRET** from an adjacent room ``\"+\r\n\t\t\t\t\t\t\tUtils.arrayToString(GlobalVars.adjacentRoomsPerRoom[currentPlayer.getCurrentRoom()])+\"``\";\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tgameChannel.sendMessage(prompt).queue();\r\n\t\t}\r\n\t}", "private void decideWinner() {\n String winnerAnnouncement;\n if(player1Choice.equalsIgnoreCase(\"rock\") && player2Choice.equalsIgnoreCase(\"scissors\")) {\n winnerAnnouncement = \"Player: ROCK vs Computer: SCISSORS ----- PLAYER WINS\";\n } else if(player1Choice.equalsIgnoreCase(\"scissors\") && player2Choice.equalsIgnoreCase(\"rock\")) {\n winnerAnnouncement = \"Player: SCISSORS vs Computer: ROCK ----- COMPUTER WINS\";\n } else if(player1Choice.equalsIgnoreCase(\"paper\") && player2Choice.equalsIgnoreCase(\"rock\")) {\n winnerAnnouncement = \"Player: PAPER vs Computer: ROCK ----- PLAYER WINS\";\n } else if(player1Choice.equalsIgnoreCase(\"rock\") && player2Choice.equalsIgnoreCase(\"paper\")) {\n winnerAnnouncement = \"Player: ROCK vs Computer: PAPER ----- COMPUTER WINS\";\n } else if(player1Choice.equalsIgnoreCase(\"scissors\") && player2Choice.equalsIgnoreCase(\"paper\")) {\n winnerAnnouncement = \"Player: SCISSORS vs Computer: PAPER ----- PLAYER WINS\";\n } else if(player1Choice.equalsIgnoreCase(\"paper\") && player2Choice.equalsIgnoreCase(\"scissors\")) {\n winnerAnnouncement = \"Player: PAPER vs Computer: SCISSORS ----- COMPUTER WINS\";\n } else {\n winnerAnnouncement = \"Its a TIE ---- EVERYONE IS A LOSER\";\n }\n // Print out who won in this format: \"Player: ROCK vs Computer: SCISSORS ----- PLAYER WINS\"\n System.out.println(winnerAnnouncement);\n }", "@Override\n\tpublic void compete() {\n\t\tSystem.out.println(\"Pawan is competing as a swimming Athlete \");\n\t\t\n\t}", "public void aceChanger() {\n\t\t// Two aces in hand before move has been made\n\t\tif (hand.numOfCards() == 2 && isBusted()) {\n\t\t\thandIterator = new HandIterator(hand.getCards());\n\t\t\tCard c = hand.getCards().get(0);\n\t\t\tCard newAce = new Card(1, \"A\", c.getCardSuit());\n\t\t\thand.addCard(newAce);\n\t\t\thand.remove(c);\n\t\t// Ace in hand and set to 11, and hand has busted\n\t\t} else if (checkForAce() && isBusted() && hand.numOfCards() > 2) {\n\t\t\thandIterator = new HandIterator(hand.getCards());\n\t\t\twhile (handIterator.hasNext()) {\n\t\t\t\tCard c = (Card) handIterator.next();\n\t\t\t\tif (c.getCardValue() == 11) {\n\t\t\t\t\thand.addCard(new Card(1, \"A\", c.getCardSuit()));\n\t\t\t\t\thand.remove(c);\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t}\n\t\t// Ace in hand and total hand value is < 21\n//\t\t} else if (checkForAce() && !isBusted()) {\n//\t\t\tprintHand();\n//\t\t\tif (hand.numOfAces() == 1) {\n//\t\t\t\thandIterator = new HandIterator(hand.getCards());\n//\t\t\t\tSystem.out.println(\"You have an Ace card in your hand. Do you \"\n//\t\t\t\t\t\t+ \"want to set the value to 1 or 11?\");\n//\t\t\t\tint ans = scan.nextInt();\n//\t\t\t\twhile (handIterator.hasNext()) {\n//\t\t\t\t\tCard c = (Card) handIterator.next();\n//\t\t\t\t\tif (c.getCardName().equals(\"A\")) {\n//\t\t\t\t\t\twhile (ans != 1 && ans != 11) {\n//\t\t\t\t\t\t\tSystem.out.println(\"Invalid input. Try again.\");\n//\t\t\t\t\t\t\tans = scan.nextInt();\n//\t\t\t\t\t\t}\n//\t\t\t\t\t\thand.addCard(new Card(ans, \"A\", c.getCardSuit()));\n//\t\t\t\t\t\thand.remove(c);\n//\t\t\t\t\t\treturn;\n//\t\t\t\t\t}\n//\t\t\t\t}\n//\t\t\t} else {\n//\t\t\t\thandIterator = new HandIterator(hand.getCards());\n//\t\t\t\tSystem.out.println(\"You have multiple Ace cards in your hand.\"\n//\t\t\t\t\t\t+ \" Which card do you want to set the value for?\"\n//\t\t\t\t\t\t+ \" (Select by appropriate card suit.) Type exit to\"\n//\t\t\t\t\t\t+ \" make no changes.\");\n//\t\t\t\tString suit = scan.next();\n//\t\t\t\tif (suit.equalsIgnoreCase(\"exit\")) {\n//\t\t\t\t\treturn;\n//\t\t\t\t}\n//\t\t\t\twhile (handIterator.hasNext()) {\n//\t\t\t\t\tCard c = (Card) handIterator.next();\n//\t\t\t\t\tif (c.getCardName().equals(\"A\") && \n//\t\t\t\t\t\t\tc.getCardSuit().equalsIgnoreCase(suit)) {\n//\t\t\t\t\t\tSystem.out.println(\"Do you want to set the value to 1\"\n//\t\t\t\t\t\t\t\t+ \" or 11?\");\n//\t\t\t\t\t\tint ans = scan.nextInt();\n//\t\t\t\t\t\thand.addCard(new Card(ans, \"A\", c.getCardSuit()));\n//\t\t\t\t\t\thand.remove(c);\n//\t\t\t\t\t\treturn;\n//\t\t\t\t\t}\n//\t\t\t\t}\n//\t\t\t}\n\t\t}\n\t}", "ICard turnOver();", "public static void changePersonToPlay()\n {\n if (person_to_play == 1)\n {\n person_to_play = 2;\n }\n else if (person_to_play == 2)\n {\n person_to_play = 3;\n }\n else if (person_to_play == 3)\n {\n person_to_play = 4;\n }\n else if (person_to_play == 4)\n {\n person_to_play = 1;\n }\n }", "private void playagain() {\n Randomize r=new Randomize(t);\n r.number(5);\n wordchar=r.validWordScr();\n set=r.getMap();\n word.setText(null);\n grade.setText(null);\n \n DefaultTableModel model=(DefaultTableModel)correct.getModel();\n rowc=model.getRowCount()-1;\n while(rowc>=0)\n {model.removeRow(rowc); rowc--;}\n \n model=(DefaultTableModel)incorrect.getModel();\n rowi=model.getRowCount()-1;\n while(rowi>=0)\n {model.removeRow(rowi); rowi--;}\n \n initLetters();\n \n setc=new TreeMap<>();\n seti=new TreeMap<>();\n progress.setStringPainted(true);\n progress.setValue((int)((setc.size()/set.size())*100.0));\n progress.setString(\"0% [\"+setc.size()+\" Of \"+set.size()+\"]\");\n }", "public void makeHappy() {\n while (statusEnum() != TamagotchiMood.HAPPY) {\n if (!isHungry() && !isTired()) {\n play();\n } else if (isHungry() && !isTired()) {\n eat();\n } else {\n sleep();\n }\n }\n\n if (!muted) {\n System.out.println(\"I can do thing on my own now and will rule the world! MUHAHAHA!\");\n }\n }", "public static void main(String[] args) {\n\t\t\r\n\t\tScanner scan = new Scanner(System.in);\r\n\t\t\r\n\t\tint input = 0;\r\n\t\tint ai = 0;\r\n\t\tint win = 0;\r\n\t\tint defeat = 0;\r\n\t\tint draw = 0;\r\n\t\t\r\n\t\tString me = \"\";\r\n\t\tString com = \"\";\r\n\t\tSystem.out.println(\"★☆★☆★☆★☆가위바위보 게임입니다!★☆★☆★☆★☆\");\r\n\t\tfor(int i = 1 ; i < 4 ; i++) {\r\n\t\t\tSystem.out.println(\"\\t\\t\\t\\t\\t 최대횟수/남은횟수\");\r\n\t\t\tSystem.out.println(\"가위(1), 바위(2), 보(3) 중 하나를 입력하세요>>>\\t\\t3 / \" + i);\r\n\t\t\tinput = scan.nextInt();\r\n\t\t\t\r\n\t\t\t\r\n\t\t\tai = (int)(Math.random()*3) + 1;\r\n\t\t\t\r\n\t\t\tif (input == 1) me = \"가위\";\r\n\t\t\telse if (input == 2) me = \"바위\";\r\n\t\t\telse if (input == 3) me = \"보\";\r\n\t\t\telse System.out.println(\"잘못 입력하셨습니다\");\r\n\t\t\tif (ai == 1) com = \"가위\";\r\n\t\t\telse if (ai == 2) com = \"바위\";\r\n\t\t\telse if (ai == 3) com = \"보\";\r\n\t\t\t\r\n\t\t\tif(me != \"\") {\r\n\t\t\t\tSystem.out.println(\"컴퓨터도 선택 했습니다.\");\r\n\t\t\t\tSystem.out.println(\"당신은 \\\"\" + me + \"\\\" 상대는 \\\"\" + com + \"\\\" 을 선택했습니다\");\r\n\t\t\t\r\n\t\t\t\tswitch (input - ai) {\r\n\t\t\t\tcase -1 : case 2 : \r\n\t\t\t\t\tSystem.out.println(\"★☆저런~~ 졌네요★☆\\n\"); defeat += 1; \r\n\t\t\t\t\tSystem.out.println(\"전적 => 승리 [ \" + win + \" ]\\t패배 [ \" + defeat + \" ]\\t무승부 [ \" + draw + \" ]\");\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t\t\r\n\t\t\t\tcase -2 : case 1 : \r\n\t\t\t\t\tSystem.out.println(\"★☆오~~ 이겼네요★☆\\n\"); win += 1; \r\n\t\t\t\t\tSystem.out.println(\"전적 => 승리 [ \" + win + \" ]\\t패배 [ \" + defeat + \" ]\\t무승부 [ \" + draw + \" ]\");\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t\t\r\n\t\t\t\tcase 0 : \r\n\t\t\t\t\tSystem.out.println(\"★☆이런! 비겼네요★☆\\n\"); draw += 1;\r\n\t\t\t\t\tSystem.out.println(\"전적 => 승리 [ \" + win + \" ]\\t패배 [ \" + defeat + \" ]\\t무승부 [ \" + draw + \" ]\");\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t\t\r\n\t\t\t\tdefault : System.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\tif(win==defeat) {\r\n\t\t\tSystem.out.println(\"최종 결과 => 무승부 입니다\");\r\n\t\t} else if(win > defeat) {\r\n\t\t\tSystem.out.println(\"최종 결과 => 당신의 승리입니다\");\r\n\t\t} else if(win < defeat) {\r\n\t\t\tSystem.out.println(\"최종 결과 => 당신의 패배입니다\");\r\n\t\t} else {\r\n\t\t\tSystem.out.println(\"오류 입니다\");\r\n\t\t}\r\n\t\t\r\n\t\t\r\n\t}", "public void attack(String spell, character opponent){\n Random rand = new Random();\n int prob;\n String attack;\n \n prob = rand.nextInt(2); //we need two random numbers to allow us to use the two attacks:\n if(prob==0){\n attack = \"punch\";\n opponent.setHealth(opponent.getHealth() - 10);\n System.out.println(getName() + \" has landed \" + attack);\n System.out.println(opponent.getName() + \" health now \" + opponent.getHealth());\n }\n \n else if(prob==1){\n attack = \"kick\";\n opponent.setHealth(opponent.getHealth() - 15);\n System.out.println(getName() + \" has landed \" + attack);\n System.out.println(opponent.getName() + \" health now \" + opponent.getHealth());\n }\n \n \n }", "@Override\n\tpublic String performMove(){\n\t\tRandom random = new Random();\t\t\t\t\n\t\tchoice = random.nextInt(3);\t\t\t\t\t//Randomly generating the choices\n if(choice == 0){\n \treturn \"Rock\";\n }else if(choice == 1){\n \treturn \"Paper\";\n }else{\n \treturn \"Scissor\";\n }\n }", "@Override\r\n\tpublic void converse() {\n\t\t\r\n\t}", "public void FINAL_OUTCOME(boolean b) //the last state of the game. \r\n {\n if (b == true)\r\n System.out.println(\"Lucky you, you get another chance at life\");\r\n else\r\n System.out.println(\"I'm sorry but you for some reason can't get another chance at life.\");\r\n }", "public IChoice losesAgainst();", "@Override\n public void beHelpful() {\n this.playPiano();\n this.takeABow();\n }", "public PlayingCard(int newFace, int newSuit, boolean newUp){\n\t\tsuper(newFace, newSuit, newUp);\n\t}", "private PlayingCard chooseCard(HeartsGraphics g){\t\t\n\t\tHearts.setCurrentPlayer(this);\n\t\t\n\t\tif(number != PLAYER_ONE){\n\t\t\t// A.I. code\n\t\t\tint index;\n\t\t\t\n\t\t\tRandom r = new Random();\n\t\t\tindex = r.nextInt(hand.size());\t\t\t\n\t\t\t\n\t\t\treturn hand.get(index);\t\t\t\n\t\t} else {\n\t\t\treturn getCard(g);\n\t\t}\t\t\n\t}", "public void toss()//method to flip a coin object\r\n {//opening code for the toss method\r\n Random coinflip = new Random();//creating a new object of the random class named coinflip\r\n int rng = coinflip.nextInt(2);//assigning an integer rng using the random, to get an int between of 0 or 1\r\n if (rng == 0)//if statement saying if that rng integer comes out as 0 do the following\r\n {//opening code for if statement\r\n sideUp = \"Heads\";//if the integer is 0 assign the sideUp to the string Heads\r\n }//closing code for if statement\r\n else //if the integer comes up as anything that isn't 0 (which can only be 1)\r\n {//opening code for else statement\r\n sideUp = \"Tails\";//assigning the sideUp variable to a string called Tails\r\n }//closing code for else statement\r\n \r\n }", "private void switchDeck() {\n\t\tif (!isInMainDeck()) {\n\t\t\tactiveDeck = MAIN_DECK;\n\t\t\tsetCurrentDeck(mainDeck, charDeck);\n\t\t} else {\n\t\t\tactiveDeck = CHARACTER_DECK;\n\t\t\tsetCurrentDeck(charDeck, mainDeck);\n\t\t}\n\t\tcurrentDeck.updateHandpos(-1);\n\t}", "public void renewFamiliar() {\n\t\tif (summonedFamiliar != null && this.summonedFamiliar != null) {\n\t\t\tif (c.getInstance().specRestoreTimer < 300) {\n\t\t\t\tif (c.getItems().playerHasItem(summonedFamiliar.pouchId, 1)) {\n\t\t\t\t\tc.getInstance().specRestoreTimer = (((summonedFamiliar.timeLimit * 60) * 1000) / 600);\n\t\t\t\t\tc.sendMessage(\"You sacrifice a pouch to renew your familiar's strength.\");\n\t\t\t\t\tc.getItems().deleteItem(summonedFamiliar.pouchId, 1);\n\t\t\t\t} else {\n\t\t\t\t\tc.sendMessage(\"You need a pouch to sacrifice!\");\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tc.sendMessage(\"You still have excess time left on your current familiar!\");\n\t\t\t}\n\t\t}\n\t}", "public String advanceGame(){\n return (isAdvantage()) ? \"Advantage \" + getPlayerName() : \"Win for \" + getPlayerName();\n }", "public void turnRight() { turn(\"RIGHT\"); }", "public void play() {\n if (!isHungry()) {\n hunger += 2;\n mood += 2;\n fatigue += 3;\n\n if (!muted) {\n System.out.println(\"play\\t|\\tPlaying is fun!\");\n }\n }\n }", "public void catchCard(){\r\n changePlace(deck);\r\n changePlace(hand);\r\n }", "public void affichage() {\n if (blanc){\n System.out.print(\"Cb\");\n }\n else{\n System.out.print(\"Cn\");\n }\t\t\n }", "private void alternatePlayer(Piece current) {\n if (currPlayer == X) {\n currPlayer = O;\n }\n else currPlayer = X;\n }", "public void shuffle () {\n this.lives = 6;\n this.attempts.clear();\n this.victory = false;\n this.lose = false;\n Random r = new Random ();\n this._word = _dictionary[r.nextInt(_dictionary.length)];\n // this._word = _dictionary[2]; // Testing purposes\n this.hint.setLength(0);\n for (int i = 0; i < _word.length(); i++) {\n this.hint.append(\"_ \");\n } \n }", "@Override\n\tpublic void happen(int rollResult) {\n\t\tint i = 0;\n\t\tBoolean greaterThan2 = true;\n\t\twhile (i < 4){\n\t\t\tif (rollResult < 2 ){\n\t\t\t\tgreaterThan2 = false;\n\t\t\t\tswitch (i){\n\t\t\t\t\tcase 0: Game.getInstance().getCurrentCharacter().decrementKnowledge(); break;\n\t\t\t\t\tcase 1: Game.getInstance().getCurrentCharacter().decrementMight(); break;\n\t\t\t\t\tcase 2: Game.getInstance().getCurrentCharacter().decrementSanity(); break; \n\t\t\t\t\tcase 3: Game.getInstance().getCurrentCharacter().decrementSpeed(); break;\n\t\t\t\t}\n\t\t\t}\n\t\t\ti++;\n\t\t}\n\t\t\n\t\tif(greaterThan2){\n\t\t\tGame.getInstance().getCurrentCharacter().incrementKnowledge(); // TODO: Change this to allow player to choose trait\n\t\t}\n\t}", "@Test\n public void testEnchantedChangedWithSongOfTheDryads() {\n // Enchantment Creature — Horror\n // 0/0\n // Bestow {2}{B}{B}\n // Nighthowler and enchanted creature each get +X/+X, where X is the number of creature cards in all graveyards.\n addCard(Zone.HAND, playerA, \"Nighthowler\");\n addCard(Zone.BATTLEFIELD, playerA, \"Swamp\", 4);\n addCard(Zone.BATTLEFIELD, playerA, \"Silvercoat Lion\"); // {1}{W} 2/2 creature\n\n addCard(Zone.GRAVEYARD, playerA, \"Pillarfield Ox\");\n addCard(Zone.GRAVEYARD, playerB, \"Pillarfield Ox\");\n\n // Enchant permanent\n // Enchanted permanent is a colorless Forest land.\n addCard(Zone.BATTLEFIELD, playerB, \"Forest\", 3);\n addCard(Zone.HAND, playerB, \"Song of the Dryads\"); // Enchantment Aura {2}{G}\n\n castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, \"Nighthowler using bestow\", \"Silvercoat Lion\");\n\n castSpell(2, PhaseStep.PRECOMBAT_MAIN, playerB, \"Song of the Dryads\", \"Silvercoat Lion\");\n\n setStrictChooseMode(true);\n setStopAt(2, PhaseStep.BEGIN_COMBAT);\n execute();\n\n assertPermanentCount(playerB, \"Song of the Dryads\", 1);\n\n ManaOptions options = playerA.getAvailableManaTest(currentGame);\n Assert.assertEquals(\"Player should be able to create 1 green mana\", \"{G}\", options.getAtIndex(0).toString());\n\n assertPermanentCount(playerA, \"Nighthowler\", 1);\n assertPowerToughness(playerA, \"Nighthowler\", 2, 2);\n assertType(\"Nighthowler\", CardType.CREATURE, true);\n assertType(\"Nighthowler\", CardType.ENCHANTMENT, true);\n\n Permanent nighthowler = getPermanent(\"Nighthowler\");\n Assert.assertFalse(\"The unattached Nighthowler may not have the aura subtype.\", nighthowler.hasSubtype(SubType.AURA, currentGame));\n }", "@Test\n public void bestowCheckForCorrectCMC() {\n addCard(Zone.BATTLEFIELD, playerA, \"Island\", 7);\n // Enchantment Creature — Siren\n // 1/1\n // Bestow {5}{U}{U} (If you cast this card for its bestow cost, it's an Aura spell with enchant creature. It becomes a creature again if it's not attached to a creature.)\n // Flying\n // You control enchanted creature.\n // Enchanted creature gets +1/+1 and has flying.\n addCard(Zone.HAND, playerA, \"Hypnotic Siren\");\n // Instant {1}{U}\n // Counter target spell with converted mana cost 4 or greater.\n addCard(Zone.HAND, playerB, \"Disdainful Stroke\");\n addCard(Zone.BATTLEFIELD, playerB, \"Island\", 2);\n\n addCard(Zone.BATTLEFIELD, playerB, \"Silvercoat Lion\");\n\n // B can't cast counter spell due CMC\n castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, \"Hypnotic Siren using bestow\", \"Silvercoat Lion\");\n checkStackSize(\"after\", 1, PhaseStep.PRECOMBAT_MAIN, playerB, 1);\n checkPlayableAbility(\"after\", 1, PhaseStep.PRECOMBAT_MAIN, playerB, \"Cast Disdainful Stroke\", false);\n //castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerB, \"Disdainful Stroke\", \"Hypnotic Siren\");\n\n setStrictChooseMode(true);\n setStopAt(1, PhaseStep.BEGIN_COMBAT);\n execute();\n\n //\n assertHandCount(playerA, \"Hypnotic Siren\", 0);\n assertGraveyardCount(playerA, \"Hypnotic Siren\", 0);\n assertHandCount(playerB, \"Disdainful Stroke\", 1);\n assertPermanentCount(playerA, \"Hypnotic Siren\", 1);\n\n // because cast with bestow, Boon Satyr may not be tapped\n assertPermanentCount(playerA, \"Silvercoat Lion\", 1);\n assertPowerToughness(playerA, \"Silvercoat Lion\", 3, 3);\n\n }", "public void displayMessage()\n{\n // game should continue\n if ( gameStatus == CONTINUE )\n showStatus( \"Roll again.\" );\n\n // game won or lost\n else {\n\n if ( gameStatus == WON )\n showStatus( \"Player wins. \" +\n \"Click Roll Dice to play again.\" );\n else \n showStatus( \"Player loses. \" + \n \"Click Roll Dice to play again.\" );\n \n // next roll is first roll of new game\n firstRoll = true; \n }\n}", "@Override\n public void challengeMode() {\n super.setHP(2100);\n super.getFrontAttack().setBaseDamage(43.75);\n super.getRightAttack().setBaseDamage(43.75);\n super.getBackAttack().setBaseDamage(43.75);\n super.getBackAttack().setMainStatus(new Bleed(0.7));\n super.getBackAttack().setDescription(\"The Jyuratodus uses the razor fin on its tail to slice the area \" +\n \"behind it while flinging mud to the sides!\");\n super.getLeftAttack().setBaseDamage(43.75);\n }", "public static void interactivePlay() {\r\n\t\tint[][] board = createBoard();\r\n\t\tshowBoard(board);\r\n\r\n\t\tSystem.out.println(\"Welcome to the interactive Checkers Game !\");\r\n\r\n\t\tint strategy = getStrategyChoice();\r\n\t\tSystem.out.println(\"You are the first player (RED discs)\");\r\n\r\n\t\tboolean oppGameOver = false;\r\n\t\twhile (!gameOver(board, RED) && !oppGameOver) {\r\n\t\t\tboard = getPlayerFullMove(board, RED);\r\n\r\n\t\t\toppGameOver = gameOver(board, BLUE);\r\n\t\t\tif (!oppGameOver) {\r\n\t\t\t\tEnglishCheckersGUI.sleep(200);\r\n\r\n\t\t\t\tboard = getStrategyFullMove(board, BLUE, strategy);\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tint winner = 0;\r\n\t\tif (playerDiscs(board, RED).length == 0 | playerDiscs(board, BLUE).length == 0){\r\n\t\t\twinner = findTheLeader(board);\r\n\t\t}\r\n\r\n\t\tif (winner == RED) {\r\n\t\t\tSystem.out.println();\r\n\t\t\tSystem.out.println(\"\\t *************************\");\r\n\t\t\tSystem.out.println(\"\\t * You are the winner !! *\");\r\n\t\t\tSystem.out.println(\"\\t *************************\");\r\n\t\t}\r\n\t\telse if (winner == BLUE) {\r\n\t\t\tSystem.out.println(\"\\n======= You lost :( =======\");\r\n\t\t}\r\n\t\telse\r\n\t\t\tSystem.out.println(\"\\n======= DRAW =======\");\r\n\t}", "public AssistantJack(int answerSet) {\n\t\tthis();\n\t\tif(answerSet == 1) {\n\t\t\tthis.correctTheory = new Theory(1,1,1);\n\t\t}\n\t\telse if (answerSet == 2) {\n\t\t\tthis.correctTheory = new Theory(6, 10, 6);\n\t\t}\n\t\telse {\n\t\t\tRandom random = new Random();\n\t\t\tint weapon = random.nextInt(6) + 1;\n\t\t\tint location = random.nextInt(10) + 1;\n\t\t\tint person = random.nextInt(6) + 1;\n\t\t\tthis.correctTheory = new Theory(weapon, location, person);\n\t\t}\n\t}", "private void normalRoll(int face, int pos, Player currentPlayer){\n\n convertTextToSpeech(\"Position before dice roll\" + pos +\n m_board.getSquare(pos).getName());\n\n int newPos = pos + face;\n if (newPos >= 40) {\n convertTextToSpeech(\"You passed go and collected 200\");\n if(m_manageFunds){\n currentPlayer.addMoney(200);\n funds.setText(String.valueOf(currentPlayer.getMoney()));\n }\n newPos = newPos - 40;\n }\n\n currentPlayer.setCurrentPosition(newPos);\n\n //updatedPosition = (TextView) findViewById(R.id.updatedPosition);\n updatedPosition.setText(\"Updated Position:\" + newPos + \", \" +\n m_board.getSquare(newPos).getName());\n convertTextToSpeech(\"You rolled a\" + face);\n convertTextToSpeech(\"Position after dice roll\" + newPos +\n m_board.getSquare(newPos).getName());\n\n locationType = (TextView) findViewById(R.id.locationType);\n\n Square location = m_board.getSquare(newPos);\n String locName = location.getName();\n\n if (location instanceof PropertySquare) {\n locationType.setText(\"Landed on property\");\n buyProperty(currentPlayer, location);\n } else if (location instanceof CardSquare) {\n locationType.setText(\"Take a Card\");\n convertTextToSpeech(\"Take a card\");\n if(locName.equals(\"Chance\")){\n chance(currentPlayer);\n } else {\n communityChest(currentPlayer);\n }\n nextTurnRoll();\n } else if (location instanceof SpecialSquare) {\n locationType.setText(\"Landed on special square\");\n specialSquare(locName, currentPlayer);\n }\n }", "public void talkToCharacter(Room room)//Made by Lexi\n {\n if (currentRoom.getTitle().equals(\"outside\")) {\n System.out.println(\"All you need to do is unlock the door...\");\n System.out.println(\"Hint: use INSPECT to examine an item in detail.\");\n if (player.inventoryContains(key))\n {\n kitchen.setLocked(false);\n System.out.println(\"The door makes a loud click.\");\n }\n }\n \n \n else if (currentRoom.getTitle().equals(\"kitchen\")) {\n System.out.println(\"In order to move on to the next room, you must first find an item which can be found by solving this riddle: \");\n System.out.println(\"A box without hinges, key, or lid, yet golden treasure inside is hid.\");\n System.out.println(\"The answer is an item in this room that will help you escape and move on to the next room.\");\n if (player.inventoryContains(egg))\n {\n poolRoom.setLocked(false);\n System.out.println(\"The door makes a loud click.\");\n }\n }\n else if (currentRoom.getTitle().equals(\"pool room\")) {\n System.out.println(\"In order to escape this room you must solve this next riddle: \");\n System.out.println(\"Wash me and I am not clean. Don't wash me and then I'm clean. What I Am?\"); //water\n System.out.println(\"The answer to the riddle is where you'll find the object needed to escape this room... \");\n if (player.inventoryContains(snorkel))\n {\n library.setLocked(false);\n System.out.println(\"The door makes a loud click.\");\n }\n }\n else if (currentRoom.getTitle().equals(\"library\")) {\n System.out.println(\"In order to escape this room you must solve this next riddle: \");\n System.out.println(\"The objects, or people, have been removed from their previous localities through the power of a naturally moving phenomenon.\");\n System.out.println(\"Once you have figured out what item belongs to the answer of this riddle you will have escaped the building!\");\n if (player.inventoryContains(blueBook))\n {\n \n exitRoom.setLocked(false);\n System.out.println(\"The door makes a loud click.\");\n }\n }\n else {\n System.out.println(\"There is nobody here, so you talk to yourself...\");\n }\n }", "private void otherRolls() {\n\t\t// program tells that player should select dices to re-roll.\n\t\tdisplay.printMessage(\"Select the dice you wish to re-roll and click \"\n\t\t\t\t+ '\\\"' + \"Roll Again\" + '\\\"');\n\t\t// program will wait until player clicks \"roll again\" button.\n\t\tdisplay.waitForPlayerToSelectDice();\n\t\t// we randomly get six integers, from one to six, and we do it N_DICE\n\t\t// times and every time we write our random integer in the array.\n\t\tfor (int i = 0; i < N_DICE; i++) {\n\t\t\tif (display.isDieSelected(i) == true) {\n\t\t\t\tint dice = rgen.nextInt(1, 6);\n\t\t\t\tdiceResults[i] = dice;\n\t\t\t}\n\t\t}\n\t\t// program will display dice, that depends on our randomly taken\n\t\t// integers.\n\t\tdisplay.displayDice(diceResults);\n\t}", "public void consolidate()\n { \n if (WarCW.p1.cardsRemaining() < 2)\n {\n if ((WarCW.p1.isEmpty()) && (WarCW.p1e.cardsRemaining() == 0))\n {\n //YOU LOSE\n //end game \n temp = (\"P2 WINS! It took \" + WarCW.round + \". There were \" + WarCW.warNum + \" wars.\");\n \n sup = new JLabel(\"\");\n sup.setFont(new Font(\"ARIAL\",Font.BOLD,46));\n sup.setText(temp);\n \n button.setEnabled(false);\n }\n else\n {\n while (!(WarCW.p1e.isEmpty())) \n {\n WarCW.p1e.shuffle();\n WarCW.temp = WarCW.p1e.useCard();\n WarCW.p1.addCard(WarCW.temp);\n }\n }\n }\n if (WarCW.p2.cardsRemaining() < 2)\n {\n if ((WarCW.p2.isEmpty()) && (WarCW.p2e.cardsRemaining() == 0))\n {\n //YOU WIN\n //end game\n temp = (\"P1 WINS! It took \" + WarCW.round + \". There were \" + WarCW.warNum + \" wars.\");\n \n sup = new JLabel(\"\");\n sup.setFont(new Font(\"ARIAL\",Font.BOLD,46));\n sup.setText(temp);\n \n button.setEnabled(false);\n }\n else\n {\n while (!(WarCW.p2e.isEmpty())) \n {\n WarCW.p2e.shuffle();\n WarCW.temp = WarCW.p2e.useCard();\n WarCW.p2.addCard(WarCW.temp);\n }\n }\n }\n }", "public static void howToEN() {\r\n\t\tSystem.out.println(\"--INSTRUCTIONS--\");\r\n\t\tSystem.out.println(\"Roll two dice. Each die has six faces representing values 1, 2, …, and 6, respectively.\\n \"\r\n\t\t\t\t+ \"Check the sum of the two dice. If the sum is 2, 3, or 12 (called craps), you lose; if the sum is 7 or\\n\"\r\n\t\t\t\t+ \" 11 (called natural), you win; if the sum is another value (i.e., 4, 5, 6, 8, 9, or 10), a point is\\n \"\r\n\t\t\t\t+ \"established. Continue to roll the dice until either a 7 or the same point value is rolled. If 7 is\\n \"\r\n\t\t\t\t+ \"rolled, you lose. Otherwise, you win.\\n\");\r\n\t\tSystem.out.println(\"\\nPress 0 to go back...\");\r\n\t\tdo {\r\n\t\t\tint num = check();\r\n\t\t\tif (num != 0) {\t\t\t\t\t\t\t\t\t// ako broj nije nula, dati upozorenje\r\n\t\t\t\tSystem.out.println(\"My lord, you need to press 0 (z-e-r-o) to go back. Now do it:\");\r\n\t\t\t} else\r\n\t\t\t\tbreak;\r\n\t\t} while (true);\r\n\t\tmenuEN();\r\n\t}", "public String loseWeapon(String comp1Choice, String comp2Choice) {\n\n\t\t// Make two lists, one that contains the choices made and other with all weapons\n\t\tList<String> chosenWeaps = Arrays.asList(comp1Choice, comp2Choice);\n\t\tList<String> allWeaps = Arrays.asList(\"Rock\", \"Paper\", \"Scissors\");\n\n\t\t// Combine the two lists together in a union\n\t\tList<String> union = new ArrayList<String>(chosenWeaps);\n\t\tunion.addAll(allWeaps);\n\n\t\t// Find where they intersect, aka find where they both have the same\n\t\t// variables inside\n\t\tList<String> intersection = new ArrayList<String>(chosenWeaps);\n\t\tintersection.retainAll(allWeaps);\n\n\t\t// Remove everything that matches\n\t\tunion.removeAll(intersection);\n\n\t\tString newCompWeap = \"\";\n\n\t\t// Iterating through the union array\n\t\tfor (String newWeapon : union) {\n\n\t\t\tswitch (newWeapon) {\n\t\t\tcase \"Rock\":\n\t\t\t\tweapon = new Rock();\n\t\t\t\tbreak;\n\t\t\tcase \"Paper\":\n\t\t\t\tweapon = new Paper();\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\tweapon = new Scissors();\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tnewCompWeap = newWeapon;\n\t\t}\n\n\t\treturn newCompWeap;\n\t}", "public static void learnWithFlaschcards(Scanner input,String modality,Questions thisSession){\n Random rand=new Random();\n int randomNumber=rand.nextInt(thisSession.getLength());\n String answer;\n short forLength;\n String decision;\n boolean isPlaying=false;\n System.out.println(\" _______________________________________\\n\"+\n \"| FLASHCARDS |\\n\"+\n \"| Game |\\n\"+\n \"| Begins |\\n\"+\n \"|______________________________________|\");\n\n System.out.println(\"How many questions would you like your teacher to do?\");\n forLength=input.nextShort();\n \n System.out.println(\"Okay. Lets start!\\nRemember your answer has to be written exactly as you wrote it when you created your question set(upper and lower case won't affect the answer) .\");\n System.out.println(thisSession.getQuestion(randomNumber));\n input.nextLine();\n for (int i=0;i<forLength;i++){\n if (i!=0){\n System.out.println(thisSession.getQuestion(randomNumber));\n }\n answer=input.nextLine();\n if (answer.equals(thisSession.getAnswer(randomNumber))){ \n System.out.println(\"That's the answer!\");\n }else {\n System.out.println(\"Wrong. The answer is: \" + thisSession.getAnswer(randomNumber)); //agregar la devolucion de la respuesta.;\n }\n randomNumber=rand.nextInt(thisSession.getLength());\n }\n System.out.println(\"Thanks for playing! Returning to main menu...\");\n\n }", "@Override\n public String generateRoshambo(String input) {\n\n return \"Rock\";\n\n }", "@Override\n public void performTrick()\n {\n Random random = new Random();\n int rnd = random.nextInt(2);\n if(rnd == 0)\n {\n setPerformText(\"rolls in the mud\");\n }\n else\n {\n setPerformText(\"runs in circles\");\n }\n System.out.println(getPerformText());\n }", "public abstract Card giveFavor(int playerIndex);", "private void suitRule(Player p){\n if(((p.getPlayCard().getSuit() == trump.getSuit()) && (winner.getPlayCard().getSuit() == trump.getSuit()) )|| (winner.getPlayCard().getSuit() == p.getPlayCard().getSuit())){\n numberRule(p);\n }\nif(p.getPlayCard().getSuit() == trump.getSuit() && winner.getPlayCard().getSuit() != p.getPlayCard().getSuit()){\n setWinner(p);\n }\n\n }", "static private void TalkTo() {\n if (BSChristiansen.getCurrentRoom() == currentRoom) {\n System.out.println(BSChristiansen.getDescription() + \", yet he still gives you good advice:\\n\");\n System.out.println(BSChristiansen.getDialog(0));\n System.out.println(\"\");\n woundedSurvivor();\n } else if (mysteriousCrab.getCurrentRoom() == currentRoom && inventory.getInventory().containsKey(\"Shroom\")) {\n System.out.println(mysteriousCrab.getDescription() + \"\\n\" + mysteriousCrab.getDialog(0));\n } else {\n System.out.println(\"There is nobody to communicate with in this Room\");\n }\n\n }", "public void askPoets(){\n System.out.println(\"Walt Whitman William Shakespeare John Keats Emily Dickinson\");\n System.out.println(\"Pick a poet and press enter: \");\n\n String poet1_input = scanner.nextLine();\n if (poet1_input.toLowerCase().contains(\"whitman\") || poet1_input.toLowerCase().contains(\"withman\")){\n poet1 = \"Whitman\";\n }else if (poet1_input.toLowerCase().contains(\"shakespeare\") || poet1_input.toLowerCase().contains(\"shakespear\")){\n poet1 = \"Shakespeare\";\n }else if (poet1_input.toLowerCase().contains(\"keats\")){\n poet1 = \"Keats\";\n }else if (poet1_input.toLowerCase().contains(\"dickinson\") || poet1_input.toLowerCase().contains(\"dikcinson\")){\n poet1 = \"Dickinson\";\n }\n\n System.out.println(\"Pick another poet: \");\n String poet2_input = scanner.nextLine();\n if (poet2_input.toLowerCase().contains(\"whitman\") || poet2_input.toLowerCase().contains(\"withman\")){\n poet2 = \"Whitman\";\n }else if (poet2_input.toLowerCase().contains(\"shakespeare\") || poet2_input.toLowerCase().contains(\"shakespear\")){\n poet2 = \"Shakespeare\";\n }else if (poet2_input.toLowerCase().contains(\"keats\")){\n poet2 = \"Keats\";\n }else if (poet2_input.toLowerCase().contains(\"dickinson\") || poet2_input.toLowerCase().contains(\"dikcinson\")){\n poet2 = \"Dickinson\";\n }\n System.out.println();\n\n System.out.println(\"Choose a theme [Love / Death]: \");\n String theme_input = scanner.nextLine();\n if(theme_input.toLowerCase().contains(\"love\")){\n theme = \"Love\";\n }else if(theme_input.toLowerCase().contains(\"death\")){\n theme = \"Death\";\n }\n System.out.println(\"\\n(\" + poet1 + \" + \" + poet2 + \") * \" + theme + \". Coming right up! [Press Enter]\" );\n String ignore = scanner.nextLine();\n }", "public void flipCard() {\n this.faceUp = !faceUp;\n }", "@Override\n public void imprime(){\n System.out.println(\" ----- Arbol Splay ----- \");\n imprimeAS(super.getRaiz());\n }", "public void doComputerTurn() {\n Random rand = new Random();\n int randInt;\n\n if (!currentPlayer.isEmployed()) { // player not employed\n // moves (but suppresses popups) at random and update of player panel\n tryMove();\n\n if (!(currentPlayer.getLocation().getName() == \"trailer\")) {\n if (currentPlayer.getLocation().getName() == \"office\") { // in office\n // upgrade (but suppresses popups) at random and update of player panel\n tryUpgrade();\n \n } else { // in regular set\n // take role (but suppresses popups) at random and update of player panel\n tryTakeRole();\n }\n }\n endTurn();\n } else { // player is employed\n randInt = rand.nextInt(2); // get either 0 or 1\n if (randInt == 0) {\n // rehearse\n tryRehearse(); \n } else {\n // act\n tryAct();\n }\n\n endTurn();\n }\n }", "private static int coinFlip() {\n\t\tint num = (Math.random() <= 0.5) ? 1 : 2; \n\t\tString answer;\n\t\tif ( num == 1) {\n\t\t\tanswer = \"h\";\n\t\t}else {\n\t\t\tanswer = \"t\";\n\t\t}\n\t\t\n\t\t\n\t\tScanner input = new Scanner(System.in);\n\t\t\n System.out.print(\"Enter you guess (h = heads, t = tails):\");\n String guess = input.next();\n //change the guess to lower case to accept both capital or lower case answer\n guess.toLowerCase();\n \n //gain 50 points if win the toss\n if ( guess.equals(answer)) {\n \t//System.out.println(\"You won the toss, congratulation! +50 points\");\n \treturn 50;\n }else {\n \t //System.out.println(\"Wrong guess! 0 points\");\n \t return 0;\n }\n \n\t}", "private void renewWordLevel3()\n {\n givenWord = availableWords.randomWordLevel3();\n shuffedWord = availableWords.shuffleWord(givenWord);\n textViewShuffle.setText(shuffedWord);\n }", "public static void getBattleChoice() {\n \t\tMainGame.display.disp(\"What do you want to do?:\");\r\n \t\tMainGame.display.Enable(MainGame.display.attack, MainGame.display.defend, MainGame.display.heal);\r\n \t}", "private void remindGoal()\n {\n System.out.println(\"you have to Pick up all three items and get back outside!\");\n }", "@Test\n public void testModeAfterRollback() {\n addCard(Zone.BATTLEFIELD, playerA, \"Swamp\", 4);\n // At the beginning of your upkeep, choose one that hasn't been chosen\n // (1) - Demonic Pact deals 4 damage to any target and you gain 4 life;\n // (2) - Target opponent discards two cards\n // (3) - Draw two cards\n // (4) - You lose the game.\n addCard(Zone.HAND, playerA, \"Demonic Pact\"); // Enchantment {2}{B}{B}\n\n castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, \"Demonic Pact\");\n\n setModeChoice(playerA, \"1\");\n addTarget(playerA, playerB);\n\n rollbackTurns(3, PhaseStep.PRECOMBAT_MAIN, playerA, 0);\n\n setStopAt(3, PhaseStep.BEGIN_COMBAT);\n execute();\n\n assertHandCount(playerA, 1); // 1 from regular draws\n assertHandCount(playerB, 1); // 1 from regular draw\n\n assertLife(playerA, 24);\n assertLife(playerB, 16);\n\n }", "public void speak()\n\t {\n\t \tSystem.out.printf(\"%s chants: Four legs good, Two legs BETTER\\n\", this.getName());\n\t }", "public void findBestTwoCardHandName() {\n if (handContainsTheseTwoCards_With_AtLeastOneFromPlayerOriginalHand(14, 'x', 14) == true) {//aces, any suit\n bestHandFromCardsNickNameString = \"Pocket Rockets\";\n } else if (handContainsTheseTwoCards_With_AtLeastOneFromPlayerOriginalHand(13, 'y', 14) == true) {//king, then ace, same suit\n bestHandFromCardsNickNameString = \"Big Slick in a Suit\";\n } else if (handContainsTheseTwoCards_With_AtLeastOneFromPlayerOriginalHand(13, 'x', 14) == true) {\n bestHandFromCardsNickNameString = \"Full Auto\";\n } else if (handContainsTheseTwoCards_With_AtLeastOneFromPlayerOriginalHand(8, 'x', 14) == true) {\n bestHandFromCardsNickNameString = \"Dead Man's Hand\";\n } else if (handContainsTheseTwoCards_With_AtLeastOneFromPlayerOriginalHand(13, 'x', 13) == true) {\n bestHandFromCardsNickNameString = \"Cowboys King Kong\";\n } else if (handContainsTheseTwoCards_With_AtLeastOneFromPlayerOriginalHand(9, 'x', 14) == true) {\n bestHandFromCardsNickNameString = \"The Dog\";\n } else if (handContainsTheseTwoCards_With_AtLeastOneFromPlayerOriginalHand(12, 'x', 12) == true) {\n bestHandFromCardsNickNameString = \"Ladies\";\n } else if (handContainsTheseTwoCards_With_AtLeastOneFromPlayerOriginalHand(3, 'x', 12) == true) {\n bestHandFromCardsNickNameString = \"The Waiter\";\n } else if (handContainsTheseTwoCards_With_AtLeastOneFromPlayerOriginalHand(9, 'x', 9) == true) {\n bestHandFromCardsNickNameString = \"A German Dime\";\n } else if (allCards[0].value == allCards[1].value) {\n bestHandFromCardsNickNameString = \"Pocket Pair\";\n } else if (allCards[0].suit == allCards[1].suit) {\n bestHandFromCardsNickNameString = \"Flush Rush\";\n } else if (allCards[0].value == allCards[1].value + 1 || allCards[0].value + 1 == allCards[1].value || (allCards[0].value == 14 && allCards[1].value == 2) || (allCards[0].value == 2 && allCards[1].value == 14) ) {\n bestHandFromCardsNickNameString = \"Straight Bait\";\n } else if (allCards[0].value == 14 || allCards[1].value == 14) {\n bestHandFromCardsNickNameString = \"A Spike\";\n } else if (allCards[0].value == 13 || allCards[1].value == 13) {\n bestHandFromCardsNickNameString = \"A Dame\";\n } else if (allCards[0].value == 12 || allCards[1].value == 12) {\n bestHandFromCardsNickNameString = \"A Jackal\";\n } else if (allCards[0].value == 11 || allCards[1].value == 11) {\n bestHandFromCardsNickNameString = \"A Fishhook\";\n } else if (allCards[0].value == 10 || allCards[1].value == 10) {\n bestHandFromCardsNickNameString = \"A Sawbuck\";\n } else if (allCards[0].value == 9 || allCards[1].value == 9) {\n bestHandFromCardsNickNameString = \"Nina Ross\";\n } else {\n bestHandFromCardsNickNameString = \"Down on Your Luck\";\n }\n \n System.out.println(\"findBestTwoCardHandName---->>> \" + bestHandFromCardsNickNameString);\n\n }", "public PlayingCard(int newFace, int newSuit){\n\t\tsuper(newFace, newSuit);\n\t}", "@Override\n public void playWithTwoPlayers(Player player1, Player player2) {\n int[] combinationPlayer;\n int counter = config.getMaxTries();\n config.getMsgInfo().choiceGameBonus();\n config.getMsgInfo().counter(counter);\n\n // initialize a random number that both players will try to find\n IAPlayer ia = new IAPlayer(config);\n int[] defenseCombination = ia.initialiseCombination();\n if (config.isDevMode())\n config.getMsgCombination().devMode(defenseCombination);\n config.getMsgInfo().computer();\n\n // Proposition player1\n config.getMsgInfo().player1();\n combinationPlayer = player1.research(null);\n config.getMsgCombination().newAnswer(combinationPlayer);\n String[] clues = ia.clues(combinationPlayer);\n if (IsWin.winIf(clues)) {\n config.getMsgInfo().isWin();\n return;\n }\n config.getMsgCombination().cluesAre(clues);\n\n // Proposition player2\n config.getMsgInfo().player2();\n combinationPlayer = player2.research(null);\n config.getMsgCombination().newAnswer(combinationPlayer);\n String[] clews = ia.clues(combinationPlayer);\n if (IsWin.winIf(clews)) {\n config.getMsgInfo().isWin();\n return;\n }\n config.getMsgCombination().cluesAre(clews);\n\n counter--;\n config.getMsgInfo().counterLess(counter);\n\n do {\n // Proposition player1\n config.getMsgInfo().player1();\n combinationPlayer = player1.research(clues);\n config.getMsgCombination().newAnswer(combinationPlayer);\n clues = ia.clues(combinationPlayer);\n if (IsWin.winIf(clues)) {\n config.getMsgInfo().isWin();\n return;\n } else if (counter > 1) {\n config.getMsgCombination().cluesAre(clues);\n } else if (counter == 1) {\n if (!Arrays.equals(combinationPlayer, defenseCombination))\n config.getMsgInfo().notGood();\n }\n\n // Proposition player2\n config.getMsgInfo().player2();\n combinationPlayer = player2.research(clews);\n config.getMsgCombination().newAnswer(combinationPlayer);\n clews = ia.clues(combinationPlayer);\n if (IsWin.winIf(clews)) {\n config.getMsgInfo().isWin();\n return;\n } else if (counter > 1) {\n config.getMsgCombination().cluesAre(clews);\n } else if (counter == 1) {\n if (!Arrays.equals(combinationPlayer, defenseCombination))\n config.getMsgInfo().notGood();\n }\n\n counter--;\n if (counter >= 1)\n config.getMsgInfo().counterLess(counter);\n else {\n config.getMsgInfo().endGameDuel();\n config.getMsgCombination().finallyRevealSecretCombination(defenseCombination);\n break;\n }\n } while (true);\n }", "public String getSuit(){ return this.suit; }", "public void faceUp(){\r\n changePlace(hand);\r\n //do a magical work\r\n changePlace(graveYard);\r\n }", "private void renewWord() {\n givenWord = availableWords.randomWordLevel1();\n shuffedWord = availableWords.shuffleWord(givenWord);\n textViewShuffle.setText(shuffedWord);\n }", "public void PVAI(String name){ //for player vs ai\r\n \r\n welcome.remove(p1first);\r\n welcome.remove(p2first); //removing all necessary buttons\r\n welcome.remove(hORt);\r\n welcome.updateUI();\r\n \r\n if(choseEasyAI == true){ //for easy ai\r\n if(name.equals(name1)&&numTurns==0){\r\n instructions.setText(\"<html>\" + name1 + \"<html> you are going first! <br><br> Please click the column number you wish to place your checker in. </html>\");\r\n whoseTurn = 1; //when the user goes first\r\n welcome.remove(input);\r\n welcome.updateUI();\r\n canGo = true;\r\n }\r\n else if(numTurns==0){\r\n changeBoard(4, 3, color1, color2); //if the AI were to go first, set its checker in the middle (because thats always the best move)\r\n welcome.remove(input);\r\n welcome.updateUI();\r\n whoseTurn = 1; //AI's turn\r\n canGo = true;\r\n instructions.setText(\"<html>Please click the column number\"+\"</br>\"+\" you wish to place your checker in. </html>\");\r\n }\r\n }\r\n //FOR THE HARD AI\r\n else{\r\n AINumber = 4; //if the user chose HARD AI, and the user is going first\r\n if(name.equals(name1)&&numTurns==0){\r\n instructions.setText(\"<html>\" + name1 + \"<html> you are going first! <br><br> Please click the column number you wish to place your checker in. </html>\");\r\n whoseTurn = 1;\r\n welcome.remove(input);\r\n welcome.updateUI();\r\n canGo = true;\r\n }\r\n else{\r\n changeBoard(4,3,color1,color2);\r\n welcome.remove(input);\r\n welcome.updateUI();\r\n whoseTurn = 1; //users turn\r\n canGo = true;\r\n instructions.setText(\"<html>Please click the column number\"+\"</br>\"+\" you wish to place your checker in. </html>\");\r\n }\r\n }\r\n }", "public void RepeatWithVoiceSwitchTest(){\n testMaterialConstructor();\n ArrayList<String> voiceNames = new ArrayList<String>();\n voiceNames.add(\"Aziz\");\n voiceNames.add(\"Muneeza\");\n \n ArrayList<BarLineObject> objs = new ArrayList<BarLineObject>();\n objs.add(toAziz);\n objs.add(C);\n objs.add(E);\n objs.add(toMuneeza);\n objs.add(MC1);\n objs.add(toAziz);\n objs.add(C);\n objs.add(toMuneeza);\n objs.add(plainBar);\n objs.add(MC2);\n objs.add(endBar);\n objs.add(toAziz);\n objs.add(G);\n objs.add(repeatBar);\n \n Parser2 myParser2 = new Parser2(voiceNames,1,1);\n myParser2.parse(objs);\n ArrayList<Voice> voices = myParser2.getVoices();\n Song lalala = new Song(voices);\n SequencePlayer sqPlayer;\n try {\n sqPlayer = new SequencePlayer(140, lalala.getMinTicksPerQuarter());\n myPlayer MrAhmed = new myPlayer(\"C\", sqPlayer);\n lalala.addToPlayer(MrAhmed);\n sqPlayer.play(); \n } catch (MidiUnavailableException e) {\n e.printStackTrace();\n } catch (InvalidMidiDataException e) {\n e.printStackTrace();\n }\n }", "public boolean makeAccusation(CardChoice cardChoice) {\n boolean successful = (cardChoice.getRoom().equals(this.envelope.getRoom())\n && cardChoice.getWeapon().equals(this.envelope.getWeapon())\n && cardChoice.getSuspect().equals(this.envelope.getSuspect()));\n state = (successful) ? GameState.GameOver : GameState.InPlay;\n logMessage(currentPlayersTurn.getPiece().getName() + \" accused \" +\n cardChoice.getSuspect().getName() + \" of murder in the \" + cardChoice.getRoom().getName() + \" \\n with the \"\n + cardChoice.getWeapon().getName() + \" accusation success = \" + successful + \".\");\n if (!successful) {\n currentPlayersTurn.getPiece().setKicked(true);\n logMessage(currentPlayersTurn.getPiece().getName() + \" has been removed from the game.\");\n } else {\n // Player wins.\n winner = currentPlayersTurn.getPiece();\n logMessage(winner + \" has won the game.\");\n setState(GameState.GameOver);\n }\n endTurn();\n return successful;\n }", "private void discardPrompt() {\r\n\t\tfor (int i = 0; i < mustDiscard.size(); i++) {\r\n\t\t\tString prompt = \"**[Discard]** a card \";\r\n\t\t\tif (mustDiscard.get(i).contentEquals(\"Sleight of Hand\")) {\r\n\t\t\t\tprompt += \"to draw 2 cards\";\r\n\t\t\t} else if (mustDiscard.get(i).contentEquals(\"Apothecary\")) {\r\n\t\t\t\tprompt += \"to choose one: **3** :crossed_swords: **~OR~** **2** :moneybag: **~OR~** **1** :heart:\";\r\n\t\t\t}\r\n\t\t\tgameChannel.sendMessage(prompt).queue();\r\n\t\t}\r\n\t}", "public void updateDeck(String target){}", "private void jailRoll(int face, Player currentPlayer){\n if (face == 6) {\n convertTextToSpeech(\"You rolled a\" + face);\n convertTextToSpeech(\"You are now free, resume normal play on next turn\");\n currentPlayer.setJail(false);\n nextTurnRoll();\n } else {\n convertTextToSpeech(\"You rolled a\" + face);\n convertTextToSpeech(\"You did not roll a 6, serve your sentence\");\n m_jailCount++;\n if(m_jailCount==3){\n currentPlayer.setJail(false);\n convertTextToSpeech(\"You have served your sentence. \" +\n \"Resume normal play on next turn\");\n }\n nextTurnRoll();\n }\n }", "public void rollCup()\n {\n die1.rolldice();\n die2.rolldice();\n gui.setDice(die1.getFacevalue(), die2.getFacevalue());\n }", "public void changeLableText(int playerScore,int computerScore);", "public void changePlayer(int disc){\n if (AvailableMoves(disc)==0){\n lastDiscPlayed = disc;\n\n if(disc==B){\n System.out.println(\"B player has no availabe moves!\");\n }else {\n System.out.println(\"W player has no other moves!\");\n }\n }\n }", "public static void switchCard(String s){cl.show(cards,s);}", "private void renewWordLevel2()\n {\n givenWord = availableWords.randomWordLevel2();\n shuffedWord = availableWords.shuffleWord(givenWord);\n textViewShuffle.setText(shuffedWord);\n }", "public String chooseRole() {\n String[] roles = currentPlayer.getLocation().getRoleStrings();\n String result;\n if (currentPlayer.isComputer()) {\n // choose random role\n Random rand = new Random();\n int randInt = rand.nextInt(roles.length);\n result = roles[randInt];\n }\n else { // if current player is human\n // choose upgrade manually\n if(roles.length <= 0){\n view.showPopUp(currentPlayer.isComputer(), \"There are no more available roles on this card!\");\n result = \"\";\n }\n else{\n result = view.showRolePopUp(roles);\n }\n }\n\n\n return result;\n }", "public void boggartBattle (int points)\n {\n\tchar doesntmatter = IBIO.inputChar (\"Type anything to proceed on your journey: \");\n\tprintSlow (\"\\nAfter being completely confused out of your mind in Divination, you glance at your schedule and notice that\");\n\tprintSlow (\"Defence Against the Dark Arts is your next class! Although in the past, you haven't had much luck with\");\n\tprintSlow (\"Teachers in this subject, you have a really good feeling about this year.\");\n\tprintSlow (\"You walk into class just in time as your teacher begins his lecture...\\n\");\n\tprintSlow (\"Welcome Third Year Students of Hogwarts, to you very first Defence against The Dark Arts Class of the Year.\");\n\tprintSlow (\"My name is Remus Lupin, and for the duration of the year, I will be your guide to facing these awful Beasts\");\n\tprintSlow (\"Many of the challenges you may face throughout this course are designed pretty simply - To end your life\");\n\tprintSlow (\"Do not take these lightly, or you may not make it out alive!\");\n\tSystem.out.print (\"*Lupin Grins*\");\n\tprintSlow (\" Alright then, onto our first lesson against an evil we may face out in the real world, a boggart!\");\n\tprintSlow (\"These hide in cabinets, and will summon themselves as your greatest fear. The only way to defeat them is stare them in the eye, and shout...\");\n\tprintSlow (\"\\t\\t\\t\\t\\t\\tRiddikulus!\");\n\tprintSlow (\"For this challenge, your opponents will be controlled - you'll either face a dragon, aragog, a goblin, a death eater, or a dementor.\");\n\tprintSlow (\"\\nHarry my boy, you can be first up to the challenge, go ahead!\\n\");\n\tcabinet ();\n\tString evil = \"boggart\";\n\t//Generates your foe\n\tint randomnum = (int) (Math.random () * 5) + 1;\n\tString randomfoe = \"idk\";\n\tString foeText = \"idk\";\n\tif (randomnum == 1)\n\t{\n\t randomfoe = \"dragon\";\n\t foeText = \"You see before you something that reminds you of a Muggle-lizard, with large metallic scales and enormous wings.\\nThe foe seems warm, as if it might breath fire...\";\n\t}\n\n\n\telse if (randomnum == 2)\n\t{\n\t randomfoe = \"aragog\";\n\t foeText = \"The creature before you is an enormous spider, an adversary you've faced before, but barely escaped the clutches of.\\nThis creature seems like something Hagrid would keep around...\";\n\t}\n\n\n\telse if (randomnum == 3)\n\t{\n\t randomfoe = \"goblin\";\n\t foeText = \"The creature before you seems very old, carrying coins as if it could work for a bank.\\nAlthough initially not intimidating, you notice it's carrying a knife!\";\n\t}\n\n\n\telse if (randomnum == 4)\n\t{\n\t randomfoe = \"death eater\";\n\t foeText = \"A scary wizard appears before you, he is armed and seems to have a skull tattoo on his arm. This wizard looks to be aligned with Lord Voldemort...\";\n\t}\n\n\n\telse\n\t{\n\t randomfoe = \"dementor\";\n\t foeText = \"Your soul feels chilled as this ominous figure apppears from the wardrobe. This cloaked figure floats towards you, rather relatable to a muggle-ghost.\\nAs it gets closer, you feel increasingly weaker.\"; // fix\n\t}\n\n\n\tprintSlow (foeText);\n\tint scare = 0;\n\t//Add a timer if possible\n\twhile (!evil.equals (randomfoe) && scare < 5)\n\t{\n\t // If try is failed, add points and also generate an increasingly scary message\n\n\t evil = IBIO.inputString (\"\\nWhat do you see before you? (Answer in lowercase) \");\n\t scare++;\n\t String scaremsg = \"You almost get your head completely sliced off by the \" + randomfoe + \"!\";\n\t if (scare == 1)\n\t\tscaremsg = \"\\nYou stop the creature it it's tracks, it's unable to do anything before you identify it!\";\n\t else if (scare == 2)\n\t {\n\t\tscaremsg = \"\\nThe creature now attacks you, scraping your leg!\";\n\t\tpoints += 3;\n\t }\n\t else if (scare == 3)\n\t {\n\t\tscaremsg = \"\\nThe creature now attacks again, bruising your arm!\";\n\t\tpoints += 4;\n\t }\n\t else if (scare == 4)\n\t {\n\t\tscaremsg = \"\\nThe creature cuts into your neck, and it starts bleeding badly.\";\n\t\tpoints += 5;\n\t }\n\n\t printSlow (scaremsg);\n\t}\n\n\n\tif (scare >= 5)\n\t{\n\t printSlow (\"\\nCome on Harry, you hove to know by now that it's a \" + randomfoe + \"!\");\n\t points += 10;\n\t}\n\n\n\telse\n\t{\n\t printSlow (\"Good Job Harry!\");\n\t}\n\n\n\tString pword = \"not riddikulus\";\n\twhile ((!pword.equals (\"riddikulus\") && !pword.equals (\"Riddikulus\") && !pword.equals (\"riddikulus!\") && !pword.equals (\"Riddikulus!\")))\n\t{\n\t pword = IBIO.inputString (\"Now that you know that you're against a/an \" + randomfoe + \", how are you going to dispel it? \");\n\t points += 5;\n\t if (!pword.equals (\"riddikulus\") && !pword.equals (\"Riddikulus\") && !pword.equals (\"riddikulus!\") && !pword.equals (\"Riddikulus!\"))\n\t {\n\t\tprintSlow (\"\\nHarry my boy, think of something more.. Absurd!\");\n\t\tprintSlow (\"Try to recall my lesson!\\n\");\n\t }\n\t}\n\tif (scare == 0 || scare == 1)\n\t{\n\t printSlow (\"\\nAmazing job Harry my boy!, you're a natural, just like your father!\\n\\n~You sit through all your classmates as they try to deal with their biggest fears. Neville's grandmother scares you almost as much as she scares him!~\\nAlright, class dismissed. Good work today!\\n\");\n\t}\n\telse\n\t printSlow (\"\\nAmazing job Harry my boy!, you got it in \" + scare + \" tries!\\n\\n~You sit through all your classmates as they try to deal with their biggest fears. Neville's grandmother scares you almost as much as she scares him!~\\nAlright, class dismissed. Good work today!\\n\");\n }", "private void changeTurn() {\n if (turn == RED) {\n turn = YELLOW;\n } else {\n turn = RED;\n }\n }", "private String getSuitName() {\n String result;\n if (this.suit == 0) {\n result = \"Clubs\";\n } else if (this.suit == 1) {\n result = \"Diamonds\";\n } else if (this.suit == 2) {\n result = \"Hearts\";\n } else {\n result = \"Spades\";\n }\n return result;\n }", "public void decideResult() {\n\t\t\n\t\tif (mUser.getHandValue() < 22 && mUser.getHandValue() > mDealer.getHandValue()) {\n\t\t\tmResult = \"win\";\n\t\t}else if(mUser.getHandValue() < 22 && mUser.getHandValue() == mDealer.getHandValue()) {\n\t\t\tmResult = \"draw\";\n\t\t}else {\n\t\t\tmResult = \"lose\";\n\t\t}\n\t\t\n\t}", "public static String sameCardsChosen() {\n return \"You chose the same cards, pleas choose the second card again: \";\n }", "@Test\n public void bestowEnchantmentWillNotBeTapped() {\n addCard(Zone.BATTLEFIELD, playerA, \"Forest\", 6);\n addCard(Zone.BATTLEFIELD, playerA, \"Silent Artisan\");\n\n addCard(Zone.HAND, playerA, \"Boon Satyr\");\n\n // Enchantment {1}{W}\n // Creatures your opponents control enter the battlefield tapped.\n addCard(Zone.BATTLEFIELD, playerB, \"Imposing Sovereign\");\n\n castSpell(1, PhaseStep.POSTCOMBAT_MAIN, playerA, \"Boon Satyr using bestow\", \"Silent Artisan\");\n\n setStrictChooseMode(true);\n setStopAt(1, PhaseStep.END_TURN);\n execute();\n\n // because Boon Satyr is no creature on the battlefield, evolve may not trigger\n assertPermanentCount(playerA, \"Silent Artisan\", 1);\n assertPowerToughness(playerA, \"Silent Artisan\", 7, 7);\n // because cast with bestow, Boon Satyr may not be tapped\n assertTapped(\"Boon Satyr\", false);\n\n }", "@Override\n public void chew() {\n MessageUtility.logSound(name,\"Bleats and Stomps its legs, then chews\");\n }", "private void orange(){\n\t\tthis.arretes_fO();\n\t\tthis.coins_fO();\n\t\tthis.coins_a1O();\n\t\tthis.coins_a2O();\n\t\tthis.aretes_aO();\n\t\tthis.cube[40] = \"O\";\n\t}", "private String decideLetter(Cell c) {\n String s = \"\";\n if (!c.getHasBoat() && !c.getShotAt()) {\n s = \"-\";\n } else if (!c.getHasBoat() && c.getShotAt()) {\n s = \"M\";\n } else if (c.getHasBoat() && !c.getShotAt()) {\n s = \"B\";\n } else {\n s = \"H\";\n }\n return s;\n }", "@Override\r\n\tpublic String say() {\n\t\tif(livingBy==LivingBy.CAT) {\r\n\t\t\treturn \"Me ow\";\r\n\t\t}else if(livingBy==LivingBy.ROOSTER) {\r\n\t\t\treturn \"Cock-a-doodle-doo\";\r\n\t\t\t\r\n\t\t}else {\r\n\t\t\treturn \"Woof, woof\";\r\n\t\t}\r\n\t\t\r\n\t}", "private void humanTurn() \n {\n \n playTurn();\n }", "private void activateTraitByAI() {\n\t\tChampion AI = currentTask.getCurrentChamp();\n\t\t\n\t\tif(AI instanceof GryffindorWizard){\n\t\t\tactivateGryffindorTrait();\n\t\t\t\n\t\t}else if(AI instanceof HufflepuffWizard){\n\t\t\tactivateHufflepuffTrait();\n\t\t\t\n\t\t}else if(AI instanceof SlytherinWizard){\n\t\t\tint randomDirection = (int) (Math.random()*3);\n\t\t\tDirection direction;\n\t\t\tswitch(randomDirection){\n\t\t\tcase 0: direction = Direction.FORWARD; break;\n\t\t\tcase 1: direction = Direction.BACKWARD; break;\n\t\t\tcase 2: direction = Direction.RIGHT; break;\n\t\t\tdefault: direction = Direction.LEFT;\n\t\t\t}\n\t\t\tdirectionsInAction = new ArrayList<Direction>();\n\t\t\tdirectionsInAction.add(direction);\n\t\t\tactivateSlytherinTrait();\n\t\t\n\t\t}else if(AI instanceof RavenclawWizard){\n\t\t\tactivateRavenclawTrait();\t\n\t\t\t\n\t\t}\n\t\t\n\t}", "private void continueGame() {\n System.out.println(\"\\n\" + \"Do you want to play more games or quit?\\n\" + \"1. Lotto\\n\" + \"2. Small Lotto\\n\" + \"3. Quit\");\n input = scanner.next();\n changeGame();\n }", "public String getSuit()\r\n { return suit; }", "public static int game(int choise) { // in main method we send user's choice as parameter\n\t\t\t\t\t\t\t\t\t\t\t// to game method and in the method we decide who is winner for\n\t\t\t\t\t\t\t\t\t\t\t// every single game\n\t\tresult = 0;\n\n\t\tint num = new Random().nextInt(3); // gives us 0,1,2\n\t\tnum++; // we added to num 1 and did it same with user's choise. 1,2,3 ... 1=rock , 2=paper , 3 = scissors\n\n\t\tswitch (num) {\n\t\tcase 1:\n\t\t\tSystem.out.println(\"Comp : ROCK\");\n\t\t\tif (choise == 1) {\n\t\t\t\tSystem.out.println(\"User : ROCK \");\n\t\t\t\tresult = 1; // result 1 means no one is winner\n\t\t\t\tbreak;\n\t\t\t} else if (choise == 2) {\n\t\t\t\tSystem.out.println(\"User : PAPER \");\n\t\t\t\tresult = 2; // result 2 means user is winner\n\t\t\t\tbreak;\n\t\t\t} else\n\t\t\t\tSystem.out.println(\"User : SCISSORS \");\n\t\t\t\tresult = 3; // result 3 means computer is winner\n\t\t\t\tbreak;\n\t\tcase 2:\n\t\t\tSystem.out.println(\"Comp : PAPER\");\n\t\t\tif (choise == 1) {\n\t\t\t\tSystem.out.println(\"User : ROCK \");\n\t\t\t\tresult = 3;\n\t\t\t\tbreak;\n\t\t\t} else if (choise == 2) {\n\t\t\t\tSystem.out.println(\"User : PAPER \");\n\t\t\t\tresult = 1;\n\t\t\t\tbreak;\n\t\t\t} else\n\t\t\t\tSystem.out.println(\"User : SCISSORS \");\n\t\t\t\tresult = 2;\n\t\t\t\tbreak;\n\t\tcase 3:\n\t\t\tSystem.out.println(\"Comp : SCISSORS\");\n\t\t\tif (choise == 1) {\n\t\t\t\tSystem.out.println(\"User : ROCK \");\n\t\t\t\tresult = 2;\n\t\t\t\tbreak;\n\t\t\t} else if (choise == 2) {\n\t\t\t\tSystem.out.println(\"User : PAPER \");\n\t\t\t\tresult = 3;\n\t\t\t\tbreak;\n\t\t\t} else\n\t\t\t\tSystem.out.println(\"User : SCISSORS \");\n\t\t\t\tresult = 1;\n\t\t\t\tbreak;\n\t\t}\n\n\t\treturn result;\n\t}", "public void playRollingADie() {\n\t\tSystem.out.print(\"The pirates ask you to play 'Rolling a Die'. You have to predict what is the outcome. \" + \"\\n\" + \"You can choose between: \");\n\t\tArrayList<String> gameElements2 = new ArrayList<String>(3);\n\t\tgameElements2.add(\"Even\");\n\t\tgameElements2.add(\"Odd\");\n\t\tboolean state = false;\n\t\twhile (state == false) {\n\t\t\tSystem.out.println(\"(1) Even\");\n\t\t\tSystem.out.println(\"(2) Odd\");\n\t\t\ttry { \n\t\t\t\tint selectedAction = scanner.nextInt();\n\t\t\t\tif (selectedAction <= 2 && selectedAction > 0) {\n\t\t\t\tint decision = game.determineWinnningRollingADie();\n\t\t\t\tint piratesThrows = game.getWhatPiratesThrowRD(decision, gameElements2.get(selectedAction-1));\n\t\t\t\tSystem.out.println(\"The die is showing \" + piratesThrows);\n\t\t\t\tif (decision == 0) {\n\t\t\t\t\tstate = true;\n\t\t\t\t\tint piratesDemand = game.getPiratesDemand();\n\t\t\t\t\tSystem.out.println(\"You lose! Pirates demands: \" + piratesDemand + \" coins\");\n\t\t\t\t\tif (game.checkPirateSatisfaction()) {\n\t\t\t\t\t\tgame.removeAllGoods();\n\t\t\t\t\t\tgame.backToMain();\n\t\t\t\t\t}\n\t\t\t\t\telse {\n\t\t\t\t\t\tgame.removeAllGoods();\n\t\t\t\t\t\tint money = game.getMoney();\n\t\t\t\t\t\tgame.updateMoney(money * -1);\n\t\t\t\t\t\tgame.gameOver(\"You lose play rock paper scissor game! \\nthe pirate took all of your money and your items in your ship!\");\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tstate = true;\n\t\t\t\t\tSystem.out.println(\"You Win!! You can Continue your journey to your destination!\");\n\t\t\t\t\tgame.backToMain();\n\t\t\t\t}\n\t\t\t\t\n\t\t\t}\n\n\t\t\t\telse {\n\t\t\t\t\tSystem.out.println(\"Please choose from actions above\");\n\t\t\t\t}\n\t\t\t\t\n\t\t\t} catch (Exception e) {\n\t\t\t\tSystem.out.println(INPUT_REQUIREMENTS);\n\t\t\t\tscanner.nextLine();\n\t\t\t}\n\t\t\t\n\t\t}\n\t}", "private void doMatch() {\n // Remember how many games in this session\n mGameCounter++;\n\n PebbleDictionary resultDict = new PebbleDictionary();\n\n switch (mChoice) {\n case Keys.CHOICE_ROCK:\n switch(mP2Choice) {\n case Keys.CHOICE_ROCK:\n mInstructionView.setText(\"It's a tie!\");\n resultDict.addInt32(Keys.KEY_RESULT, Keys.RESULT_TIE);\n break;\n case Keys.CHOICE_PAPER:\n mInstructionView.setText(\"You lose!\");\n resultDict.addInt32(Keys.KEY_RESULT, Keys.RESULT_WIN); // Inform Pebble of opposite result\n break;\n case Keys.CHOICE_SCISSORS:\n mWinCounter++;\n mInstructionView.setText(\"You win! (\" + mWinCounter + \" of \" + mGameCounter + \")\");\n resultDict.addInt32(Keys.KEY_RESULT, Keys.RESULT_LOSE);\n break;\n }\n break;\n case Keys.CHOICE_PAPER:\n switch(mP2Choice) {\n case Keys.CHOICE_ROCK:\n mWinCounter++;\n mInstructionView.setText(\"You win! (\" + mWinCounter + \" of \" + mGameCounter + \")\");\n resultDict.addInt32(Keys.KEY_RESULT, Keys.RESULT_LOSE);\n break;\n case Keys.CHOICE_PAPER:\n mInstructionView.setText(\"It's a tie!\");\n resultDict.addInt32(Keys.KEY_RESULT, Keys.RESULT_TIE);\n break;\n case Keys.CHOICE_SCISSORS:\n mInstructionView.setText(\"You lose!\");\n resultDict.addInt32(Keys.KEY_RESULT, Keys.RESULT_WIN);\n break;\n }\n break;\n case Keys.CHOICE_SCISSORS:\n switch(mP2Choice) {\n case Keys.CHOICE_ROCK:\n mInstructionView.setText(\"You lose!\");\n resultDict.addInt32(Keys.KEY_RESULT, Keys.RESULT_WIN);\n break;\n case Keys.CHOICE_PAPER:\n mWinCounter++;\n mInstructionView.setText(\"You win! (\" + mWinCounter + \" of \" + mGameCounter + \")\");\n resultDict.addInt32(Keys.KEY_RESULT, Keys.RESULT_LOSE);\n break;\n case Keys.CHOICE_SCISSORS:\n mInstructionView.setText(\"It's a tie!\");\n resultDict.addInt32(Keys.KEY_RESULT, Keys.RESULT_TIE);\n break;\n }\n break;\n }\n\n // Inform Pebble of result\n PebbleKit.sendDataToPebble(getApplicationContext(), APP_UUID, resultDict);\n\n // Finally reset both\n mChoice = Keys.CHOICE_WAITING;\n mP2Choice = Keys.CHOICE_WAITING;\n\n // Leave announcement for 5 seconds\n mHandler.postDelayed(new Runnable() {\n\n @Override\n public void run() {\n updateUI();\n }\n\n }, 5000);\n }", "public void anotherChamp(ActionEvent event) {\n\t\tanotherButton.setText(\"Another Pick\");\n\n\t\tif (oldRecommendList.size() != 0) {\n\t\t\tString champ = oldRecommendList.remove(0);\n\t\t\tint kda = (int) Math.round(ChampionFrequency.kdaMap.get(champ));\n\t\t\tDate lastPlay = new java.util.Date((ChampionFrequency.lastPlay.get(champ)));\n\t\t\tSimpleDateFormat dt = new SimpleDateFormat(\"MM/dd\");\n\t\t\tString date = dt.format(lastPlay);\n\t\t\tString winLose = ChampionFrequency.winLose.get(champ) == 0 ? \"Win\" : \"Lose\";\n\t\t\tint recomVal = (int) Math.round(finalResult.get(champ));\n\t\t\toldLable.setText(\"KDA: \" + kda + \"\\n\" + \"Last Play: \" + date + \"\\n\" + \"Win/Lose: \" + winLose + \"\\n\"\n\t\t\t\t\t+ \"RecmdVal: \" + recomVal);\n\t\t\trecomTextField.setText(champ);\n\t\t\trecomTextField.setDisable(true);\n\t\t\tString url = \"http://ddragon.leagueoflegends.com/cdn/6.24.1/img/champion/\" + champ + \".png\";\n\t\t\tImage icon = new Image(url);\n\t\t\toldchampIcon.setImage(icon);\n\t\t\toldchampIcon.setSmooth(true);\n\t\t\toldchampIcon.setCache(true);\n\t\t}\n\t}", "public void rightGuess()\r\n\t{\r\n\t\tif(userWon())\r\n\t\t{\r\n\t\t\tSystem.out.println(PLAYER_WIN);\r\n\t\t\tSystem.exit(0);\r\n\t\t}\r\n\r\n\t\tSystem.out.println(\"good job! you've correctly guessed the panel \\n would you like to guess again? if so enter yes, if you would like to add your tile to your code, reply no\\n\\n\");\r\n\t\tString answer = sc.next();\r\n\t\tif(answer.compareTo(\"yes\") == 0 || answer.compareTo(\"Yes\") == 0)\r\n\t\t{\r\n\t\t\tuserTurn(false);\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\tif(userRanPan.getValue() == -1)\r\n\t\t\t\tnewGame.getUserHand().addDash(false,userRanPan);\r\n\t\t\telse\r\n\t\t\t\tnewGame.getUserHand().addPanel(userRanPan,false);\r\n\r\n\t\t\tuserGuess.clear();\r\n\t\t\tslide(previousGuess,userRanPan);\r\n\r\n\t\t\tif(userWon() == false)\r\n\t\t\t\tcompTurn(false);\r\n\t\t\telse\r\n\t\t\t{\r\n\t\t\t\tSystem.out.println(PLAYER_WIN);\r\n\t\t\t\tSystem.exit(0);\r\n\t\t\t}\r\n\t\t}\r\n\t\t//foo.repaint();\r\n\t}", "public String playTexasHoldEm() throws IOException {\n\n StringBuffer buffer = new StringBuffer();\n String input = FileReaderUtil.readInputFile();\n\n List<String> players = new ArrayList<>();\n List<Hand> hands = new ArrayList<>();\n Set<Integer> winners = new HashSet<>();\n String[] lines = input.split(\"\\n\");\n\n Hand highestHand = null;\n String[] highestCards = null;\n int highest = -1;\n int index = 0;\n\n for (String line : lines) {\n\n String[] cards = line.toUpperCase().split(\" \");\n players.add(line);\n\n if (cards.length == 7) {\n // Played until the end.\n Hand currHand = determineHand(cards);\n hands.add(currHand);\n\n if (highestHand == null) {\n highestHand = currHand;\n highest = index;\n highestCards = cards;\n\n winners.add(index);\n } else if (currHand.rank > highestHand.rank) {\n winners.clear();\n winners.add(index);\n\n highestHand = currHand;\n highest = index;\n highestCards = cards;\n } else if (currHand.rank == highestHand.rank) {\n\n int compare = breakTie(cards, highestCards);\n if (compare == 0) {\n // tied\n winners.add(highest);\n winners.add(index);\n } else if (compare < 0) {\n // current card wins\n winners.clear();\n winners.add(index);\n highest = index;\n highestCards = cards;\n }\n }\n } else {\n hands.add(null);\n }\n\n index++;\n }\n\n for (int i = 0; i < players.size(); i++) {\n String player = lines[i];\n Hand hand = hands.get(i);\n\n buffer.append(player);\n\n if (hand != null) {\n buffer.append(\" \").append(WordUtils.capitalizeFully(hand.formatted));\n }\n\n if (winners.contains(i)) {\n buffer.append(\" \").append(\"(winner)\");\n }\n\n buffer.append(\"\\n\");\n }\n\n return buffer.toString().trim();\n }", "public static char playRound() {\n\n String playerChoice = playerChoice();\n System.out.println(\"You chose: \" + playerChoice);\n\n Random rand = new Random();\n int compRand = rand.nextInt(3);\n String compChoice = new String();\n\n switch (compRand) {\n case 0:\n compChoice = \"rock\";\n break;\n case 1:\n compChoice = \"paper\";\n break;\n case 2:\n compChoice = \"scissors\";\n break;\n }\n\n char result = 'l';\n String resAnoun = \"Player loses!\";\n\n System.out.println(\"Player choice: \" + playerChoice + \" VS Computer Choice: \" + compChoice);\n\n if (playerChoice.equals(compChoice)) {\n result = 't';\n resAnoun = \"Draw!\";\n } else if (playerChoice.equals(\"rock\")) {\n if (compChoice.equals(\"scissors\")) {\n result = 'w';\n resAnoun = \"Player wins!\";\n }\n } else if (playerChoice.equals(\"paper\")) {\n if (compChoice.equals(\"rock\")) {\n result = 'w';\n resAnoun = \"Player wins!\";\n }\n } else if (playerChoice.equals(\"scissors\")) {\n if (compChoice.equals(\"paper\")) {\n result = 'w';\n resAnoun = \"Player wins!\";\n }\n }\n System.out.println(resAnoun);\n\n return result;\n }", "public void otherSentence()\n {\n // Receive the string from the other player\n if (other == 1)\n {\n record.append(\"Red: \" + theClientChat.recvString() + \"\\n\");\n }\n else\n {\n record.append(\"Yellow: \" + theClientChat.recvString() + \"\\n\");\n }\n }", "public static void hitCorrect()\n\t{\n\t\tplayersCards.add(deck.deal());\n\t\tcurrentValue();\n\t\tuserCardImg[playersCards.size()-1].setIcon(new ImageIcon(Gameplay.class.getResource(getCard(playersCards.get(playersCards.size()-1)))));\n\t\tresume();\n\t\tif(calculateHand(playersCards)>21 || playersCards.size()==4 || calculateHand(playersCards)==0)\n\t\t{\n\t\t\troundEnd();\n\t\t}\n\t\t\n\t}", "static void backtocheckpoint1_version2() {\n System.out.println(\"You arrived to the main entrance of challenge 1... Are you ready to restart this challenge?\");\n strings = responses.nextLine();\n if (strings.contains(\"n\")) {\n System.out.println(\"It's not an option\"); \n backtocheckpoint1_version2();\n }else if (strings.contains(\"y\")) { \n Door2challenge();\n }else {\n System.out.println(\"I don't understand...type it correctly\");\n backtocheckpoint1_version2();//in case the player types something else that the system can't read\n }\n \n \n \n }", "public void setTruthChallenge() {\n while (!(getActiveChallenge()).contains(\"Truth\")) {\n categories.get(indexOfActiveCategory).increaseIndexOfActiveChallenge();\n }\n }" ]
[ "0.5860045", "0.5730745", "0.57154375", "0.5650022", "0.56114304", "0.5558672", "0.55351967", "0.5527559", "0.5513566", "0.55078954", "0.5432807", "0.5419631", "0.5400201", "0.5394032", "0.53804576", "0.53663546", "0.5360106", "0.5333999", "0.5309072", "0.52965206", "0.5275355", "0.5274642", "0.5268282", "0.5256979", "0.5247625", "0.52454007", "0.52438086", "0.5234502", "0.52235425", "0.52048296", "0.520083", "0.51863897", "0.51844907", "0.5183902", "0.51778394", "0.51743823", "0.5171292", "0.5164128", "0.5163197", "0.5148377", "0.5142607", "0.51361233", "0.51348096", "0.51208717", "0.51148224", "0.51144946", "0.5109411", "0.5108684", "0.510866", "0.51086223", "0.5106578", "0.5102665", "0.5100955", "0.5100411", "0.50996435", "0.5099492", "0.50952655", "0.5091228", "0.5088438", "0.50794554", "0.50745654", "0.5071308", "0.50705355", "0.5066621", "0.5059636", "0.5050078", "0.5047648", "0.504246", "0.5042385", "0.503559", "0.503476", "0.5034585", "0.50300455", "0.50289434", "0.5026001", "0.5022573", "0.5018073", "0.501766", "0.50140655", "0.5013062", "0.50069827", "0.5000085", "0.4993996", "0.4990315", "0.49858168", "0.49838814", "0.49798018", "0.49752983", "0.4975047", "0.4971109", "0.49705014", "0.49649942", "0.49609652", "0.4960542", "0.496012", "0.4954763", "0.49529448", "0.495288", "0.4952829", "0.49524635", "0.49508375" ]
0.0
-1
Deque does not override equals, so Deque.equals is the identity of objects We need our own method to test deque eqality.
private static <T> boolean equalsDeque(Deque<T> queue1, Deque<T> queue2) { if (queue1.size() != queue2.size()) { return false; } List<T> copy1 = new ArrayList<>(queue1); List<T> copy2 = new ArrayList<>(queue2); return copy1.equals(copy2); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public boolean equals(Object object){\n \tif(object == this) return true;\n \tif(!(object instanceof AbstractQueue)) return false;\n \tAbstractQueue abstractQueue = (AbstractQueue) object;\n \tif(abstractQueue.size() != size()) return false;\n \treturn containsAll(abstractQueue);\n }", "@Override\r\n public boolean equals(Object object) {\n if (!(object instanceof Cheque)) {\r\n return false;\r\n }\r\n Cheque other = (Cheque) object;\r\n if ((this.idCheque == null && other.idCheque != null) || (this.idCheque != null && !this.idCheque.equals(other.idCheque))) {\r\n return false;\r\n }\r\n return true;\r\n }", "@Override\r\n public boolean equals(Object object) {\n if (!(object instanceof Cheque)) {\r\n return false;\r\n }\r\n Cheque other = (Cheque) object;\r\n if ((this.id == null && other.id != null) || (this.id != null && !this.id.equals(other.id))) {\r\n return false;\r\n }\r\n return true;\r\n }", "@Override\r\n public boolean equals(Object o) \r\n {\r\n if (o instanceof DoublyLinkedList<?>){\r\n DoublyLinkedList<?> dll = (DoublyLinkedList<?>) o;\r\n if (dll.size() != size) return false;\r\n Node<T> curr = getFirst();\r\n Node<?> ocurr = dll.getFirst();\r\n for(int i = 0; i < size; i++){\r\n if (curr.getValue() == null){\r\n if (ocurr.getValue() != null) return false;\r\n }\r\n else {\r\n if (!curr.getValue().equals(ocurr.getValue())) return false;\r\n }\r\n curr = curr.getNext();\r\n ocurr = ocurr.getNext();\r\n }\r\n return true;\r\n }\r\n else return false;\r\n }", "@Override\r\n\tpublic boolean equals(Object obj) {\n\t\tQueen te = (Queen) obj;\r\n\t\treturn (this.x==te.x)&&(this.y==te.y);\r\n\t}", "@Override\n public boolean equals(Object object) {\n if (this == object) {\n return true;\n }\n if (object == null || getClass() != object.getClass()) {\n return false;\n }\n Cons cons = (Cons) object;\n return Objects.equals(first, cons.first)\n && Objects.equals(restOfBag, cons.restOfBag);\n }", "@Override\n public boolean equals( Object obj ) {\n if (this == obj) {\n return true;\n }\n\n if (obj == null) {\n return false;\n }\n\n if (getClass() != obj.getClass()) {\n return false;\n }\n\n Deck other = (Deck)obj;\n // Due to the possibility of duplicates, deck comparison is a notch trickier.\n // Our approach is to count the cards in each deck then ensure that the cards\n // and counts are the same.\n return tally().equals(other.tally());\n }", "public void demoArrayDeque() {\n System.out.println(\"***Demonstrating an ArrayDeque\");\n Deque<String> veggies = new ArrayDeque<String>();\n //Add will throw an exception if the capacity is limited and its out of room\n //Our example, is variable capacity\n veggies.add(\"tomatoes\");\n veggies.addFirst(\"peppers\");\n veggies.add(\"eggplant\");\n veggies.add(\"squash\");\n veggies.add(\"cucumbers\");\n veggies.addLast(\"broccoli\");\n //Offer returns false if it can't add because it was out of room\n //But our example ArrayDeque is variable length, so they are functionally identical to\n //the add methods.\n veggies.offer(\"green beans\");\n veggies.offerFirst(\"beets\");\n veggies.offerLast(\"carrots\");\n //As with other collections, the size() method gives the size of the deque\n System.out.println(String.format(\"Length of veggies: %d\", veggies.size()));\n System.out.println();\n \n //Determine if the deque contains a given object\n System.out.println(String.format(\"Veggies contains 'beets': %b\", veggies.contains(\"beets\")));\n System.out.println();\n \n //element() shows but does not remove the first item, throw exception if empty\n System.out.println(String.format(\"First veggie (element()): %s\", veggies.element()));\n System.out.println(String.format(\"Length of veggies: %d\", veggies.size()));\n System.out.println();\n \n //getFirst() same as element()\n System.out.println(String.format(\"First veggie (getFirst()): %s\", veggies.getFirst()));\n System.out.println(String.format(\"Length of veggies: %d\", veggies.size()));\n System.out.println();\n \n //getLast() gets but doesn't remove last item, throws exception if empty\n System.out.println(String.format(\"Last veggie (getLast()): %s\", veggies.getLast()));\n System.out.println(String.format(\"Length of veggies: %d\", veggies.size()));\n System.out.println();\n \n //peek() gets but does not remove the first item, returns null if empty\n System.out.println(String.format(\"First veggie (peek()): %s\", veggies.peek()));\n System.out.println(String.format(\"Length of veggies: %d\", veggies.size()));\n System.out.println();\n \n //peekFirst() gets but does not remove the first item, returns null if empty\n System.out.println(String.format(\"First veggie (peekFirst()): %s\", veggies.peekFirst()));\n System.out.println(String.format(\"Length of veggies: %d\", veggies.size()));\n System.out.println();\n \n //peekLast() gets but doesn't remove last item, returns null if empty\n System.out.println(String.format(\"Last veggie (peekLast()): %s\", veggies.peekLast()));\n System.out.println(String.format(\"Length of veggies: %d\", veggies.size()));\n System.out.println();\n \n //Java 5 and above\n System.out.println(\"--Iterating using the Enhanced for loop\");\n for(String veggie : veggies) {\n System.out.println(veggie);\n }\n System.out.println();\n \n //poll() gets the first item and removes it, returns null if empty\n System.out.println(String.format(\"First veggie (poll()): %s\", veggies.poll()));\n System.out.println(String.format(\"Length of veggies: %d\", veggies.size()));\n System.out.println();\n \n //pollFirst() gets the first item and removes it, returns null if empty\n System.out.println(String.format(\"First veggie (pollFirst()): %s\", veggies.pollFirst()));\n System.out.println(String.format(\"Length of veggies: %d\", veggies.size()));\n System.out.println();\n \n //pollLast() gets the last item and removes it, returns null if empty\n System.out.println(String.format(\"Last veggie (pollLast()): %s\", veggies.pollLast()));\n System.out.println(String.format(\"Length of veggies: %d\", veggies.size()));\n System.out.println();\n \n System.out.println(\"--Iterating using the iterator\");\n for(Iterator<String> it = veggies.iterator(); it.hasNext();) {\n String veggie = it.next();\n System.out.println(veggie);\n }\n System.out.println();\n \n //pop() gets and removes the first item, throws an exception if empty\n System.out.println(String.format(\"First veggie (pop()): %s\", veggies.pop()));\n System.out.println(String.format(\"Length of veggies: %d\", veggies.size()));\n System.out.println();\n \n //iterates starting at the end of the deque\n System.out.println(\"--Iterating using the descending iterator\");\n for(Iterator<String> it = veggies.descendingIterator(); it.hasNext();) {\n String veggie = it.next();\n System.out.println(veggie);\n }\n System.out.println();\n\n //will throw exception for capacity restrictions\n veggies.push(\"cabbage\");\n \n //Java 8 and above\n System.out.println(\"--Iterating with forEach\");\n veggies.forEach(System.out::println);\n }", "public boolean equalStack(StackClass otherStack){\n \tif(this.size != otherStack.size)\n \treturn false;\n \telse{\n \twhile(!this.isEmpty()){\n \tif(this.pop() != otherStack.pop())\n \treturn false;\n \t} \n \t}\n \treturn true;\n\t}", "@Override\n public boolean equals(Object object) {\n if (!(object instanceof BanCheque)) {\n return false;\n }\n BanCheque other = (BanCheque) object;\n if ((this.chqSecuencia == null && other.chqSecuencia != null) || (this.chqSecuencia != null && !this.chqSecuencia.equals(other.chqSecuencia))) {\n return false;\n }\n return true;\n }", "@Override\n public boolean equals(Object obj) {\n return obj != null &&\n getClass() == obj.getClass() &&\n equalElements(getClass().cast(obj));\n }", "public boolean equals(Object other) {\r\n if (other == null || getClass() != other.getClass() || length != ((MoneyList) other).length)\r\n return false;\r\n\r\n MoneyNode nodeThis = first;\r\n MoneyNode nodeOther = ((MoneyList) other).first;\r\n while (nodeThis != null) {\r\n // Since the two linked lists are the same length,\r\n // they should reach null on the same iteration.\r\n\r\n if (nodeThis.data != nodeOther.data)\r\n return false;\r\n\r\n nodeThis = nodeThis.next;\r\n nodeOther = nodeOther.next;\r\n } // while\r\n\r\n return true;\r\n }", "public abstract Deque<E> d();", "public boolean equals( Object other ){\r\n\t\t if (!(other instanceof ChainedArrays))\r\n\t\t\t return false;\r\n\t\t Iterator<T> it1 = this.iterator();\r\n\t\t @SuppressWarnings(\"unchecked\")\r\n\t\t ChainedArrays<T> other_casted = (ChainedArrays<T>) other;\r\n\t\t Iterator<T> it2 = other_casted.iterator();\r\n\t\t boolean ans = true;\r\n\t\t while(it1.hasNext()&&it2.hasNext()){\r\n\t\t\t ans &= isEqual( it1.next( ), it2.next( ) );\r\n\t\t }\r\n\t\t return ans;\r\n\t}", "@Override\n public boolean equals(Object obj) {\n return this == obj;\n }", "@Override\n public boolean equals(Object other) {\n return this == other || (other instanceof Decouverte && hashCode() == other.hashCode());\n }", "public boolean deQueue() {\n if (isEmpty()) {\n return false;\n }\n if (head == tail) {\n head = -1;\n tail = -1;\n } else if (head >= size - 1) {\n head = 0;\n } else {\n head++;\n }\n return true;\n }", "@Override\n public boolean equals(final Object o) {\n if (this == o) {\n return true;\n }\n if (o == null || getClass() != o.getClass()) {\n return false;\n }\n LinkedList<T> that = (LinkedList<T>) o;\n if (numElement != that.numElement) {\n return false;\n }\n Node<T> iter = head;\n Node<T> iter2 = that.head;\n for (int index = 0; index < numElement; index++) {\n if (!iter.getData().equals(iter2.getData())) {\n return false;\n }\n iter = iter.getNext();\n iter2 = iter2.getNext();\n }\n return true;\n }", "public boolean isEmpty() { return front == rear; }", "public boolean equals(DoublyLinkedList<Element> list) {\n if(super.equals(list)) return true;\n else {\n if(this.size != list.size) return false;\n else {\n Node<Element> temp = header.getNextNode();\n Node<Element> other_temp = list.header.getNextNode();\n while (temp != last() && other_temp != list.last()) {\n if(!temp.getPreNode().equals(other_temp.getPreNode())\n || !temp.getContent().equals(other_temp.getContent())\n || !temp.getNextNode().equals(other_temp.getNextNode()))\n return false;\n temp = temp.getNextNode();\n other_temp = other_temp.getNextNode();\n }\n return true;\n }\n }\n }", "public boolean equals (Object obj) {\n\t\tif (this.size() != ((List) obj).size()) {\n\t\t\treturn false;\n\t\t}\n\t\telse {\n\t\t\tint i = 0;\n\t\t\tfor (ListNode p = myHead; p != null; p = p.myNext) {\n\t\t\t\tif (p.myItem != ((List) obj).get(i)) {\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t\ti++;\n\t\t\t}\n\t\t\treturn true;\n\t\t}\n\t}", "@Override\n public boolean equals(Object other) {\n return this == other;\n }", "@Override\n\t\tpublic boolean equals(Object other) {\n\t\t\tif(other instanceof Clique) {\n\t\t\t\tClique c = (Clique) other;\n\t\t\t\treturn c._variables.equals(this._variables);\n\t\t\t}\n\t\t\treturn false;\n\t\t}", "public BlaqDeque(){super();}", "@Override\n public boolean equals(Object obj) {\n return this == obj;\n }", "@Override\n\tpublic boolean equals(Card anotherCard){\n\t\t\n\t}", "public boolean equals(Object obj) {\n/* 319 */ if (obj == this) {\n/* 320 */ return true;\n/* */ }\n/* 322 */ if (!(obj instanceof SlidingCategoryDataset)) {\n/* 323 */ return false;\n/* */ }\n/* 325 */ SlidingCategoryDataset that = (SlidingCategoryDataset)obj;\n/* 326 */ if (this.firstCategoryIndex != that.firstCategoryIndex) {\n/* 327 */ return false;\n/* */ }\n/* 329 */ if (this.maximumCategoryCount != that.maximumCategoryCount) {\n/* 330 */ return false;\n/* */ }\n/* 332 */ if (!this.underlying.equals(that.underlying)) {\n/* 333 */ return false;\n/* */ }\n/* 335 */ return true;\n/* */ }", "@Override\r\n\tpublic boolean equals(Object obj) {\n\t\t\r\n\t\tif(obj instanceof BinaryTree) {\r\n\t\t\treturn deepEquals(this.getHead(), ((BinaryTree<T>) obj).getHead());\r\n\t\t}\r\n\t\treturn false;\r\n\t}", "@Override\r\n\tpublic boolean equals(Object other) {\r\n\t\treturn (this.iD - other.hashCode()) == 0;\r\n\t}", "public boolean equals(Object obj){\n if(!(obj instanceof Demoo)){\n return false;\n }\n Demoo p = (Demoo) obj;\n return this.num == p.num;\n }", "public final boolean equals (Object obj) {\n if (obj instanceof IntVector) {\n IntVector v = (IntVector)obj;\n if (isEmpty())\n return v.isEmpty();\n else\n return !v.isEmpty() &&\n head == v.head() &&\n tail.equals(tail);\n } else\n return false;\n }", "@Override\n public boolean equals(Object other) {\n if (other.getClass() == getClass()) {\n return hashCode() == other.hashCode();\n }\n\n return false;\n }", "@Override\n\tpublic boolean equals(Object obj) {\n\t\treturn this.hashCode() == obj.hashCode();\n\t}", "@Override\n\tpublic boolean equals(Object obj) {\n\t\treturn this.hashCode() == obj.hashCode();\n\t}", "@Override\n public boolean equals(\n Object object\n ){\n \tif(this == object) {\n \t\treturn true;\n \t}\n \tif(object instanceof Path) {\n \t\tPath that = (Path) object;\n \t\tif(this.size == that.size) {\n \t\t\tif(this.size == 0) {\n \t\t\t\treturn true;\n \t\t\t}\n \t\t\tif(this.base.equals(that.base)) {\n \t\t\t return \n \t\t\t this.parent == that.parent ||\n \t\t\t this.parent.equals(that.parent);\n \t\t\t}\n \t\t}\n \t}\n\t\treturn false;\n }", "public boolean equals(Object o) { return compareTo(o) == 0; }", "@Override\n public boolean equals(Object obj) {\n if (this == obj) return true;\n if (obj == null) return false;\n if (!(obj instanceof Vector)) return false;\n Vector oth = (Vector) obj;\n return head.equals(oth.head);\n }", "public boolean deQueue() {\n if(head == tail && queue[head] == null)\n return false;\n else if(head == tail){\n queue[head] = null;\n }else{\n int nexthead = head + 1 == queue.length ? 0 : head + 1;\n queue[head] = null;\n head = nexthead;\n }\n return true;\n }", "public boolean equals(Object pQueueEntryComparator)\n {\n\tif(pQueueEntryComparator instanceof DMSQueueEntryComparator)\n\t return true;\n\telse\n\t return false;\n }", "@Override\n public boolean equals(Object object) {\n if (!(object instanceof TraChequeDetale)) {\n return false;\n }\n TraChequeDetale other = (TraChequeDetale) object;\n if ((this.cdeId == null && other.cdeId != null) || (this.cdeId != null && !this.cdeId.equals(other.cdeId))) {\n return false;\n }\n return true;\n }", "public interface IDeque<T> {\n boolean isEmpty();\n int size();\n void pushLeft(T t);\n void pushRight(T t);\n T popLeft();\n T popRight();\n}", "public boolean equals(Object o)\n/* */ {\n/* 248 */ if (o == this) return true;\n/* 249 */ if (o == null) return false;\n/* 250 */ if (o.getClass() != getClass()) { return false;\n/* */ }\n/* 252 */ CollectionLikeType other = (CollectionLikeType)o;\n/* 253 */ return (this._class == other._class) && (this._elementType.equals(other._elementType));\n/* */ }", "public boolean contains(T e) {\n DLLNode<T> current = _front;\n for (int i = 0; i < _size; i++) {//Go through the queue until you do or dont find e\n if (current.getCargo().equals(e))\n return true;\n current = current.getNext();\n }\n return false;\n }", "public final boolean equal() {\n\t\tif (size > 1) {\n\t\t\tdouble topMostValue = pop();\n\t\t\tdouble secondTopMostValue = pop();\n\t\t\tif (topMostValue == secondTopMostValue) {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\t\treturn false;\n\t}", "public abstract boolean equals(Object other);", "public boolean orderedEquals( Deck otherDeck ) {\n if (this.cards.length == otherDeck.cards.length) {\n for (int i = 0; i < this.cards.length; i++ ) {\n if (!this.cards[i].equals(otherDeck.cards[i])) {\n return false;\n }\n }\n return true;\n }\n return false;\n }", "@Override\n public abstract boolean equals(Object obj);", "DequeIterator() {\n current = head; //head = head of deque\n }", "@Override\n\tpublic abstract boolean equals(Object other);", "public boolean equals(DoubleLinkedList other) {\n\n\t\tif (this.elements != other.elements) {\n\t\t\treturn false;\n\t\t}\n\t\tDLNode n = head;\n\t\tDLNode o = other.head;\n\n\t\tint nc = nodeCounter();\n\n\t\tfor (int i = 0; i < nc; i++) {\n\n\t\t\tif (n.val != o.val) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\tif (n.val == Integer.MIN_VALUE) {\n\t\t\t\tboolean check = n.list.equals(o.list);\n\t\t\t\tif (check) {\n\t\t\t\t\treturn check;\n\t\t\t\t}\n\n\t\t\t}\n\t\t\tn = n.next;\n\t\t\to = o.next;\n\n\t\t}\n\n\t\treturn true;\n\n\t}", "public Deque() {\n resetDeque();\n }", "@Override \n boolean equals(Object obj);", "private boolean findPath(TreeNode node, TreeNode target, Deque<TreeNode> deque) {\r\n \r\n if (node == null) return false;\r\n if (node.val == target.val) {\r\n deque.offerFirst(node);\r\n return true;\r\n }\r\n\r\n if (findPath(node.left, target, deque) || findPath(node.right, target, deque)) {\r\n deque.offerFirst(node);\r\n return true;\r\n }\r\n\r\n return false;\r\n }", "public boolean equals(Object other){\n if(other instanceof Node){\n return ((Node)other).getData().equals(this.data);\n } else {\n return false;\n }\n\n }", "@Test\n\tpublic void testDeckEquals() {\n\t\t\n\t\tStandardDeckClass oneDeck = new StandardDeckClass();\n\t\tStandardDeckClass testDeck = new StandardDeckClass();\n\t\t\n\t\tboolean isSame = oneDeck.equals(testDeck);\n\t\t\n\t\tassertEquals(\"equals method not working as expected\", true, isSame);\n\t\t\n\t}", "@Override\n boolean equals(Object obj);", "final public boolean equals (Object other)\n {\n\treturn compareTo (other) == 0;\n }", "@Override\n boolean equals(Object other);", "@Override\n public abstract boolean equals(Object other);", "@Override\n public abstract boolean equals(Object other);", "@Override\n public boolean equals(Object object) {\n if (!(object instanceof REPMQ)) {\n return false;\n }\n REPMQ other = (REPMQ) object;\n if ((this.mq001 == null && other.mq001 != null) || (this.mq001 != null && !this.mq001.equals(other.mq001))) {\n return false;\n }\n return true;\n }", "@Override\n\t\tpublic boolean equals(Object other) {\n\t\t\treturn Arrays.equals(state, ((MazeNode) other).state);\n\t\t}", "public static void main(String[] args) {\n\t\tDeque<String> myDeck = new ArrayDeque<String>();\r\n\r\n\t\t// Insert elements\r\n\t\tmyDeck.addLast(\"A1\");\r\n\t\tSystem.out.println(\"Deque: \" + myDeck);\r\n\t\tmyDeck.offerLast(\"B1\");\r\n\t\tSystem.out.println(\"Deque: \" + myDeck);\r\n\t\tmyDeck.addFirst(\"C1\");\r\n\t\tSystem.out.println(\"Deque: \" + myDeck);\r\n\t\tmyDeck.offerFirst(\"D1\");\r\n\t\tSystem.out.println(\"Deque: \" + myDeck);\r\n\r\n\t\t// Inspect elements at the head of the deque\r\n\t\tString headElement = myDeck.getFirst();\r\n\t\tSystem.out.printf(\"Head using getFirst(): %s\\n\", headElement);\r\n\t\theadElement = myDeck.peekFirst();\r\n\t\tSystem.out.printf(\"Head using peekFirst(): %s\\n\", headElement);\r\n\r\n\t\t// Inspect elements at the tail of the deque\r\n\t\tString tailElement = myDeck.getLast();\r\n\t\tSystem.out.printf(\"Tail using getLast(): %s\\n\", tailElement);\r\n\t\ttailElement = myDeck.peekLast();\r\n\t\tSystem.out.printf(\"Tail using peekLast(): %s\\n\", tailElement);\r\n\r\n\t\t// Remove elements\r\n\t\tString removedElement = myDeck.removeFirst();\r\n\t\tSystem.out.printf(\"#1 Removed Head Element: %s\\n\", removedElement);\r\n\t\tSystem.out.println(\"Deque: \" + myDeck);\r\n\t\theadElement = myDeck.peekFirst();\r\n\t\tSystem.out.printf(\"Head using peekFirst(): %s\\n\", headElement);\r\n\r\n\t\tremovedElement = myDeck.removeLast();\r\n\t\tSystem.out.printf(\"#2 Removed Tail Element: %s\\n\", removedElement);\r\n\t\tSystem.out.println(\"Deque: \" + myDeck);\r\n\t\theadElement = myDeck.peekLast();\r\n\t\tSystem.out.printf(\"Tail using peekLast(): %s\\n\", headElement);\r\n\t}", "@Override\n public final boolean equals(final Object other) {\n return super.equals(other);\n }", "public boolean delete(E obj){\r\n int count = 0; //variable to count how many instances show up\r\n int tmp = 0; //tmp is the new index in the array, only incremented if obj is not found\r\n\r\n boolean foundObj = false;\r\n\r\n for(int i = 0; i < currentSize; i++){\r\n if(((Comparable<E>)queue[i]).compareTo(obj) == 0){ //check to see if instance shows up\r\n count++; //found object to delete\r\n foundObj = true; //if instance is there, set flag to true\r\n }\r\n else\r\n queue[tmp++] = queue[i];\r\n //shift over the array at tmp++\r\n }\r\n \r\n currentSize -= count; //decrement size based on how many objects were removed\r\n\r\n return foundObj;\r\n }", "private boolean cycleCheck(Node current, Queue<Node> expanded){\n\n if( expanded.size() == 0){\n return false; //Because current is root\n }\n\n for(Node nodeInExpanded : expanded){\n\n if(current!=null && current.getDigit().getDigitString().equals(nodeInExpanded.getDigit().getDigitString())){\n //the digits are same so we check children.\n\n ArrayList<String> currentChildren = makeChildren(current);\n ArrayList<String> childrenOfExpanded = makeChildren(nodeInExpanded);\n\n int size;\n\n if(currentChildren.size() > childrenOfExpanded.size() ){\n size = childrenOfExpanded.size();\n }else if(currentChildren.size() < childrenOfExpanded.size()){\n size = currentChildren.size();\n }else{\n size = childrenOfExpanded.size();\n }\n /*\n I use the modulus operator so that I dont get a ArrayIndexOut of Bounds\n */\n\n if( currentChildren.size() == childrenOfExpanded.size()\n && currentChildren.get(0%size).equals(childrenOfExpanded.get(0%size))\n && currentChildren.get(1%size).equals(childrenOfExpanded.get(1%size))\n && currentChildren.get(2%size).equals(childrenOfExpanded.get(2%size))\n && currentChildren.get(3%size).equals(childrenOfExpanded.get(3%size))\n ){\n return true;\n }\n }\n }\n\n return false;\n }", "@Override\r\n\tpublic boolean equals(Object obj){\r\n\t\tClientPacket otherPacket = (ClientPacket)obj;\r\n\t\t\r\n\t\tif (otherPacket != null){\r\n\t\t\tif(type != otherPacket.type){\r\n\t\t\t\treturn false;\r\n\t\t\t}\r\n\t\t\tif(dataSize != otherPacket.dataSize){\r\n\t\t\t\treturn false;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif(!Arrays.equals(data, otherPacket.data)){\r\n\t\t\t\treturn false;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\treturn true;\r\n\t\t}\r\n\t\t\r\n\t\treturn super.equals(obj);\r\n\t}", "@Override\n public boolean equals(Object o) {\n return this == o;\n }", "@Override\n\tpublic boolean equals(Object other)\n\t{\n\t\tif (!(other instanceof Graph))\n\t\t{\n\t\t\treturn false;\n\t\t}\n\t\t@SuppressWarnings(\"unchecked\")\n\t\tGraph<N, ET> otherGraph = (Graph<N, ET>) other;\n\t\tList<N> otherNodeList = otherGraph.getNodeList();\n\t\tint thisNodeSize = nodeList.size();\n\t\tif (thisNodeSize != otherNodeList.size())\n\t\t{\n\t\t\t//\t\t\tSystem.err.println(\"Not equal node count\");\n\t\t\treturn false;\n\t\t}\n\t\t// (potentially wasteful, but defensive copy)\n\t\totherNodeList = new ArrayList<N>(otherNodeList);\n\t\tif (otherNodeList.retainAll(nodeList))\n\t\t{\n\t\t\t// Some nodes are not identical\n\t\t\t//\t\t\tSystem.err.println(\"Not equal node list\");\n\t\t\t//\t\t\tSystem.err.println(nodeList);\n\t\t\t//\t\t\tSystem.err.println(otherNodeList);\n\t\t\treturn false;\n\t\t}\n\t\t// Here, the node lists are identical...\n\t\tList<ET> otherEdgeList = otherGraph.getEdgeList();\n\t\tint thisEdgeSize = edgeList.size();\n\t\tif (thisEdgeSize != otherEdgeList.size())\n\t\t{\n\t\t\t//\t\t\tSystem.err.println(\"Not equal edge count\");\n\t\t\treturn false;\n\t\t}\n\t\t// (potentially wasteful, but defensive copy)\n\t\totherEdgeList = new ArrayList<ET>(otherEdgeList);\n\t\tif (otherEdgeList.retainAll(edgeList))\n\t\t{\n\t\t\t// Other Graph contains extra edges\n\t\t\t//\t\t\tSystem.err.println(\"not equal edge retain\");\n\t\t\t//\t\t\tSystem.err.println(edgeList);\n\t\t\t//\t\t\tSystem.err.println(otherEdgeList);\n\t\t\treturn false;\n\t\t}\n\t\treturn true;\n\t}", "@Override\n public boolean contains(Object o) {\n for (int i = 0; i < currentSize; i++) {\n if (container[i] == o) {\n return true;\n }\n }\n return false;\n }", "public Deque() {}", "public boolean equals(Object o) {\n\t\tNode p1, p2;\n\t\tLinkedList<E> that;\n\t\tE thisData, thatData;\n\n\t\tif (!(o instanceof LinkedList<?>))\n\t\t\treturn false;\n\n\t\tthat = (LinkedList<E>) o;\n\t\tif (that.size() != mSize)\n\t\t\treturn false;\n\n\t\tfor (p1 = mHead.next, p2 = that.mHead.next; p1 != mTail; p1 = p1.next, p2 = p2.next) {\n\t\t\tthisData = p1.data;\n\t\t\tthatData = p2.data;\n\t\t\t// we allow null values, so we have to test null==null first\n\t\t\tif (thisData == null || thatData == null) {\n\t\t\t\tif (thisData != null || thatData != null)\n\t\t\t\t\treturn false;\n\t\t\t} else {\n\t\t\t\tif (!thisData.equals(thatData))\n\t\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\t\treturn true;\n\t}", "@Override\n public boolean equals(Object object) {\n if (!(object instanceof Devolve)) {\n return false;\n }\n Devolve other = (Devolve) object;\n if ((this.devolveId == null && other.devolveId != null) || (this.devolveId != null && !this.devolveId.equals(other.devolveId))) {\n return false;\n }\n return true;\n }", "@Override public boolean equals(Object object);", "public boolean equals( Object obj );", "public boolean equals(Object o) {\n\t\tif(o != null) {\n\n\n\t\t\tif(getClass() != o.getClass()) return false;\n\t\t\tSinglyLinkedList other = (SinglyLinkedList) o;\n\t\t\tif(size != other.size()) {\n\t\t\t\tNode walkA = head;\n\t\t\t\tNode walkB = other.head;\n\n\t\t\t\twhile(walkA != null) {\n\t\t\t\t\tif(!walkA.getElement().equals(walkB.getElement())) return false;\n\t\t\t\t\twalkA = walkA.getNext();\n\t\t\t\t\twalkB = walkB.getNext();\n\t\t\t\t}\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\t\treturn false;\n\t}", "public final boolean equals(Object obj) {\r\n return this == obj;\r\n }", "@Override\n\tpublic boolean equal() {\n\t\treturn false;\n\t}", "public static boolean compareFringe(coordinate q, Queue<QueueNode> queue) {\n\t\t for(QueueNode node: queue) {\n\t\t\t //System.out.println(\"We are comparing q: \"+q.toString()+\" to node in list: \"+node.point.toString());\n\t\t\t if(q.equals(node.point)) {\n\t\t\t\t \t//System.out.println(\"In the fringe. Found intersect\");\n\t\t \t\treturn true; //returns true is in found, this is the intersect\n\t\t \t}\n\t\t }\n\t \treturn false; //not in fringe\n\t }", "public boolean equals(Object obj);", "@Override\n public boolean equals(Object other) {\n return super.equals(other);\n }", "public boolean contains(E obj){\r\n //simple binary search to see if object is there\r\n //best case: O(1), ave case: O(logn), worst case: O(n)\r\n int lo = 0;\r\n int hi = currentSize - 1;\r\n\r\n while(lo <= hi) {\r\n int mid = (lo + hi) / 2;\r\n if(((Comparable<E>)queue[mid]).compareTo(obj) < 0)\r\n hi = mid - 1;\r\n else if(((Comparable<E>)queue[mid]).compareTo(obj) > 0)\r\n lo = mid + 1;\r\n else\r\n return true;\r\n }\r\n return false;\r\n }", "public boolean contains(E e) {\n for (int i = startPos; i < queue.length; i++) {\n E value = (E) queue[i];\n if (value.equals(e)) return true;\n }\n\n return false;\n }", "public Deque() {\n\t\tfirst = null;\n\t\tlast = null;\n\t\tsize = 0;\n\t}", "@Test\n\tpublic void testDeckEqualsAgain() {\n\t\t\n\t\tStandardDeckClass oneDeck = new StandardDeckClass();\n\t\tVegasDeckClass testDeck = new VegasDeckClass();\n\t\t\n\t\tboolean isSame = oneDeck.equals(testDeck);\n\t\t\n\t\tassertEquals(\"equals method not working as expected\", false, isSame);\n\t}", "@Override\n public boolean equals(Object obj) {\n Pair temp = (Pair) obj;\n if(left == temp.left && right == temp.right) {\n return true;\n } else {\n return false;\n }\n }", "@Override\n public boolean equals (final Object o) {\n return\n (o instanceof Composition)\n &&\n super.equals(o)\n &&\n Arrays.equals(\n _reversedTerms, \n ((Composition) o)._reversedTerms); }", "@Override\n public final boolean equals( Object obj ) {\n return super.equals(obj);\n }", "public boolean equals(Object obj) {\n/* 1926 */ if (obj == this) {\n/* 1927 */ return true;\n/* */ }\n/* 1929 */ if (!(obj instanceof DateAxis)) {\n/* 1930 */ return false;\n/* */ }\n/* 1932 */ DateAxis that = (DateAxis)obj;\n/* 1933 */ if (!ObjectUtilities.equal(this.timeZone, that.timeZone)) {\n/* 1934 */ return false;\n/* */ }\n/* 1936 */ if (!ObjectUtilities.equal(this.locale, that.locale)) {\n/* 1937 */ return false;\n/* */ }\n/* 1939 */ if (!ObjectUtilities.equal(this.tickUnit, that.tickUnit)) {\n/* 1940 */ return false;\n/* */ }\n/* 1942 */ if (!ObjectUtilities.equal(this.dateFormatOverride, that.dateFormatOverride))\n/* */ {\n/* 1944 */ return false;\n/* */ }\n/* 1946 */ if (!ObjectUtilities.equal(this.tickMarkPosition, that.tickMarkPosition))\n/* */ {\n/* 1948 */ return false;\n/* */ }\n/* 1950 */ if (!ObjectUtilities.equal(this.timeline, that.timeline)) {\n/* 1951 */ return false;\n/* */ }\n/* 1953 */ return super.equals(obj);\n/* */ }", "public boolean isQueue() {\n return this == QUEUE;\n }", "public Deque() {\n first = null;\n last = null;\n }", "@Override\r\n \tpublic boolean equals(final Object obj) {\r\n \t\t// Insert code to compare the receiver and obj here.\r\n \t\t// This implementation forwards the message to super. You may replace or supplement this.\r\n \t\t// NOTE: obj might be an instance of any class\r\n \t\treturn super.equals(obj);\r\n \t}", "@Test\n public void testEquals(){\n DoubleLinkedList<Integer> list1 = new DoubleLinkedList<Integer>();\n DoubleLinkedList<Integer> list2 = new DoubleLinkedList<Integer>();\n DoubleLinkedList<Integer> list3 = new DoubleLinkedList<Integer>();\n //builing of lists\n list1.addToFront(1);\n list1.addToFront(2);\n list1.addToFront(3);\n list2.addToFront(1);\n list2.addToFront(2);\n list2.addToFront(3);\n list3.addToFront(3);\n list3.addToFront(2);\n list3.addToFront(1);\n assertTrue(\"testing with two equal lists\", list2.equals(list1));\n assertFalse(\"testing with two unequal lists\", list2.equals(list3));\n assertFalse(\"testing with one list and one string\", list1.equals(\"Hello\"));\n }", "@Test\n public void getFirst() {\n //getFirst and getLast are also relied on for the majority of this Junit.\n //if these are broken you can probably figure that out elsewhere\n String[] expect = new String[ArrayDeque.INITIAL_CAPACITY];\n //check first addFirst. should go to last index in arr\n expect[0] = \"a\";\n expect[1] = \"b\";\n expect[2] = \"c\";\n expect[3] = \"d\";\n expect[4] = \"e\";\n ard.addLast(\"a\");\n ard.addLast(\"b\");\n ard.addLast(\"c\");\n ard.addLast(\"d\");\n ard.addLast(\"e\");\n\n //getFirst and getLast are also relied on for the majority of this Junit.\n //if these are broken you can probably figure that out elsewhere\n assertEquals(\"a\", ard.getFirst());\n assertEquals(Arrays.toString(expect), Arrays.toString(ard.getBackingArray()));\n ard.removeFirst();\n expect[0] = null;\n assertEquals(\"b\", ard.getFirst());\n assertEquals(Arrays.toString(expect), Arrays.toString(ard.getBackingArray()));\n ard.addLast(\"after\");\n expect[5] = \"after\";\n assertEquals(Arrays.toString(expect), Arrays.toString(ard.getBackingArray()));\n for (int i = 0; i < 5; i++) {\n ard.addLast(\"more after\");\n expect[6 + i] = \"more after\";\n }\n assertEquals(\"b\", ard.getFirst());\n assertEquals(Arrays.toString(expect), Arrays.toString(ard.getBackingArray()));\n }", "public abstract boolean equals(Object o);", "public static void main(String[] args) {\n Queue<QueueData> q1 = new LinkedList<>();\n List<String> testArList = new ArrayList<>();\n testArList.add(0, \"1\");\n for (int i = 0; i < 10; i++){\n // ArrayList의 add와 같은 기능을 가졌다.\n // 하지만, 자료구조의 특성상, 특정 인덱스에 add하는 메소드는 없다.\n q1.add(new QueueData(i, (int) (Math.random() * 1000)));\n }\n System.out.println(q1);\n // peek() : 0번째 인덱스 즉 head에 해당하는 데이터를 살펴본다. 해당 데이터가 없을 경우\n // null이 출력된다. 검색된 데이터는 삭제되지 않고 그대로 남는다.\n System.out.println(q1.peek());\n System.out.println(\"peek\");\n System.out.println(q1);\n\n // element() : peek과 동일한 기능을 가졌지만, 차이점은 해당 데이터가 없을때,\n // 예외처리를 해준다.\n System.out.println(q1.element());\n System.out.println(\"element\");\n System.out.println(q1);\n\n // Enqueue : 추가\n q1.offer(new QueueData(q1.size(), (int) (Math.random() * 1000))); // 실패시 예외발생\n System.out.println(\"offer\");\n System.out.println(q1);\n q1.add(new QueueData(q1.size(), (int) (Math.random() * 1000))); // 실패시 false 리턴\n System.out.println(\"add\");\n System.out.println(q1);\n\n // Dequeue : 삭제\n q1.remove(); // 삭제 실패시, 예외 발생\n System.out.println(\"remove\");\n System.out.println(q1);\n System.out.println(\"poll\");\n q1.poll(); // 실패시 false 리턴\n System.out.println(q1);\n \n // 조건부 삭제\n System.out.println(\"remove if idx % 10 == 0\");\n q1.removeIf(queueData -> queueData.idx % 10 == 0);\n System.out.println(q1);\n\n // priority Queue(우선순위 큐)\n // 가장 가중치가 낮은 순서로 poll, peek()을 할 수 있는 자료구조다.\n // Min Heap로 데이터를 sort 시켜놓고 출력하는 자료구조.\n // 데이터의 크기를 뒤죽박죽 아무렇게 넣어도 의도에 따라 오름차순 혹은 내림차순으로\n // poll(), peek() 할 수 있다.\n Queue<QueueData> pQueue = new PriorityQueue<>();\n pQueue.add(new QueueData(0, (int) (Math.random() * 1000)));\n pQueue.add(new QueueData(9, (int) (Math.random() * 1000)));\n pQueue.add(new QueueData(2, (int) (Math.random() * 1000)));\n pQueue.add(new QueueData(5, (int) (Math.random() * 1000)));\n pQueue.add(new QueueData(4, (int) (Math.random() * 1000)));\n\n System.out.println(pQueue.poll());\n System.out.println(pQueue.poll());\n System.out.println(pQueue.poll());\n System.out.println(pQueue.poll());\n System.out.println(pQueue.remove()); // 더이상 삭제할 수 없을 때, 예외처리(프로그램 종료)\n System.out.println(pQueue.poll()); // 더이상 삭제할 수 없을 때, null 출력\n System.out.println(pQueue.size());\n }", "@Override\r\n\tpublic boolean equals(Object obj) {\n\t\treturn super.equals(obj);\r\n\t}", "@Override\r\n\tpublic boolean equals(Object obj) {\n\t\treturn super.equals(obj);\r\n\t}", "@Override\r\n\tpublic boolean equals(Object obj) {\n\t\treturn super.equals(obj);\r\n\t}", "public Deque() {\n first = null;\n last = null;\n size = 0;\n assert check();\n }" ]
[ "0.66431177", "0.63871366", "0.63044304", "0.62926054", "0.61687857", "0.60807186", "0.6008893", "0.5922882", "0.58910847", "0.58389884", "0.57949954", "0.579114", "0.57563424", "0.57542866", "0.5729672", "0.57076865", "0.57014817", "0.5697773", "0.56972295", "0.5683269", "0.56767833", "0.5672258", "0.56624776", "0.5640249", "0.5628319", "0.56093407", "0.5608846", "0.5589406", "0.5584032", "0.5570588", "0.5556392", "0.5551439", "0.5549923", "0.5549923", "0.55493927", "0.5541564", "0.55269784", "0.552375", "0.5516421", "0.5511271", "0.5499985", "0.54970616", "0.54918385", "0.5483642", "0.5483441", "0.54812497", "0.5481113", "0.5468634", "0.54666597", "0.5462727", "0.5460636", "0.54493546", "0.5445853", "0.5443066", "0.5442447", "0.543481", "0.54305065", "0.5428854", "0.54216087", "0.54216087", "0.54175127", "0.541638", "0.54104406", "0.54092926", "0.5405444", "0.5405263", "0.5404153", "0.5402677", "0.5401598", "0.54009986", "0.539983", "0.5395672", "0.5394692", "0.5394347", "0.5386519", "0.5384831", "0.5382704", "0.5375353", "0.53660667", "0.5356504", "0.53342474", "0.53339636", "0.5330552", "0.53266215", "0.5321891", "0.5320247", "0.53173226", "0.53155863", "0.5312265", "0.531011", "0.5307234", "0.5305957", "0.530327", "0.5296825", "0.52938944", "0.52923983", "0.5288563", "0.5288563", "0.5288563", "0.5288174" ]
0.80383456
0
Problem 67: Maximum path sum II By starting at the top of the triangle below and moving to adjacent numbers on the row below, the maximum total from top to bottom is 23. 3 7 4 2 4 6 8 5 9 3 That is, 3 + 7 + 4 + 9 = 23. Find the maximum total from top to bottom in p067_triangle.txt, a 15K text file containing a triangle with onehundred rows. NOTE: This is a much more difficult version of Problem 18. See also .
@Test public void shouldSolveProblem67() { assertThat(Euler67Test.solve("small_triangle.txt")).isEqualTo(23); assertThat(Euler67Test.solve("p067_triangle.txt")).isEqualTo(7273); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "int maxPathSum(int tri[][], int m, int n)\n {\n // loop for bottom-up calculation\n //i是row,j是column\n for (int i = m - 1; i >= 0; i--)\n {\n for (int j = 0; j <= i; j++)\n {\n // for each element, check both\n // elements just below the number\n // and below right to the number\n // add the maximum of them to it\n if (tri[i + 1][j] > tri[i + 1][j + 1])\n tri[i][j] += tri[i+1][j];\n else\n tri[i][j] += tri[i + 1][j + 1];\n }\n }\n\n // return the top element\n // which stores the maximum sum\n return tri[0][0];\n }", "public int maxPathSum(TreeNode root) {\n\t\t int[] max = new int[]{Integer.MIN_VALUE};\n\t\t helper(root,max);\n\t\t return max[0];\n\t }", "public int maxPathSum(TreeNode root) {\n helper(root);\n return max;\n }", "public int maxPathSum(TreeNode root) {\n\t\tint[] globalMax = new int[] {Integer.MIN_VALUE};\r\n\t\thelper(root, globalMax);\r\n\t\treturn globalMax[0];\r\n\t}", "public static List<Integer> findMaxPath(TreeNode root) {\n List<Integer> maxSumPath = new ArrayList<>();\n List<Integer> onePath = new ArrayList<>();\n int[] maxSumArray = new int[1];\n maxSumArray[0] = 0;\n\n recursiveHelperMaxSum(root, 0, onePath, maxSumPath, maxSumArray);\n // System.out.println(maxSumPath);\n return maxSumPath;\n }", "public int maxPathSum(TreeNode root) {\n helper(root); \n //run the function but don't use the final return value\n //only save the \"result\" when we run the function\n return result;\n }", "public int minimumTotal2(List<List<Integer>> triangle) {\n int n = triangle.size();\n int[][] dp = new int[n][n];\n dp[0][0] = triangle.get(0).get(0);\n for (int i = 1; i < n; i++) {\n List<Integer> row = triangle.get(i);\n dp[i][0] = dp[i - 1][0] + row.get(0);\n for (int j = 1; j < i; j++) {\n dp[i][j] = Math.min(dp[i - 1][j], dp[i - 1][j - 1]) + row.get(j);\n }\n dp[i][i] = dp[i - 1][i - 1] + row.get(i);\n }\n int min = Integer.MAX_VALUE;\n for (int i = 0; i < n; i++) {\n min = Math.min(min, dp[n - 1][i]);\n }\n return min;\n }", "public int maxPathSum(TreeNode root) {\n\t\tint[] maxSum = new int[1];\n\t\tmaxSum[0] = Integer.MIN_VALUE;\n\t\tmaxPathSum(root, maxSum);\n\t\treturn maxSum[0];\n\t}", "public static void main(String[] args)\n throws IOException {\n\n\n\n for (int[] row : getMatrix(getLines(FILENAME), \"\\\\s+\")) {\n\n\n\n String grid = Arrays.toString(row);\n\n System.out.println(grid);\n\n int product = 0;\n int largest = 0;\n\n // check right\n for (int i = 0; i < 20; i++) {\n for (int j = 0; j < 17; j++) {\n// product = grid[i][j] * grid[i][j + 1] * grid[i][j + 2] * grid[i][j + 3];\n if (product > largest) {\n largest = product;\n }\n }\n }\n\n // check down\n for (int i = 0; i < 17; i++) {\n for (int j = 0; j < 20; j++) {\n// product = grid[i][j] * grid[i + 1][j] * grid[i + 2][j] * grid[i + 3][j];\n if (product > largest) {\n largest = product;\n }\n }\n }\n\n // check diagonal right down\n for (int i = 0; i < 17; i++) {\n for (int j = 0; j < 17; j++) {\n// product = grid[i][j] * grid[i + 1][j + 1] * grid[i + 2][j + 2] * grid[i + 3][j + 3];\n if (product > largest) {\n largest = product;\n }\n }\n }\n\n // check diagonal right up\n for (int i = 0; i < 20; i++) {\n for (int j = 0; j < 17; j++) {\n// product = grid[i][j] * grid[i + 1][j - 1] * grid[i+ 2][j - 1] * grid[i + 3][j -3];\n if (product > largest) {\n largest = product;\n }\n }\n }\n\n System.out.println(product);\n\n }\n }", "public int getMaxLineSum() {\n int result = 0;\n int maxRowSum = getMaxRowSum();\n int maxColumnSum = getMaxColumnSum();\n int maxDiagonalSum = getMaxDiagonalSum();\n if (abs(maxRowSum) > abs(result))\n result = maxRowSum;\n if (abs(maxColumnSum) > abs(result))\n result = maxColumnSum;\n if (abs(maxDiagonalSum) > abs(result))\n result = maxDiagonalSum;\n return result;\n }", "public int maxPathSum(TreeNode root) {\n int maxSum[] = {Integer.MIN_VALUE};\n maxPathSum(root, maxSum);\n return maxSum[0] == Integer.MIN_VALUE ? 0 : maxSum[0];\n }", "public static void main(String[] args)\n {\n Scanner sc = new Scanner(System.in);\n int sum = sc.nextInt();\n int N = sc.nextInt();\n sc.nextLine();\n int [][] arr = new int[N][2];\n for(int i = 0;i<N;i++)\n {\n arr[i][0] = sc.nextInt();\n arr[i][1] = sc.nextInt();\n sc.nextLine();\n }\n //Arrays.sort(arr, new Comparator<int[]>() {\n // @Override\n // public int compare(int[] o1, int[] o2) {\n // return o1[1]-o2[1]; //按第二列价值排个序。\n // }\n //});\n int [][] dp = new int[N+1][sum+1];\n int [][] path = new int[N+1][sum+1];\n for(int i = 1;i<=N;i++)\n {\n for(int j = 1;j<=sum;j++)\n {\n if(j<arr[i-1][0])\n dp[i][j] = dp[i-1][j];\n else\n {\n if(dp[i-1][j]<dp[i-1][j-arr[i-1][0]]+arr[i-1][1])\n path[i][j] = 1;\n dp[i][j] = Math.max(dp[i-1][j],dp[i-1][j-arr[i-1][0]]+arr[i-1][1]);\n }\n }\n }\n System.out.println(dp[N][sum]);\n\n int i = N;\n int j = sum;\n while (i>0&&j>0)\n {\n if(path[i][j]==1)\n {\n System.out.print(1+\" \");\n j -=arr[i-1][0];\n }\n else\n {\n i--;\n System.out.print(0+\" \");\n }\n }\n\n\n // 改进版。只使用一维数组。\n // int [] f = new int[sum+1];\n // for(int i = 0;i<N;i++)\n // {\n // for (int j = sum;j>=0;j--)\n // {\n // if(j>=arr[i][0])\n // f[j] = Math.max(f[j], f[j-arr[i][0]]+arr[i][1]);\n // }\n // }\n // System.out.println(f[sum]);\n\n }", "public int minimumTotal(List<List<Integer>> triangle) {\n if(triangle == null || triangle.size() == 0) {\n return 0;\n }\n int len = triangle.size();\n List<Integer> last = triangle.get(len - 1);\n int lastLen = last.size();\n int[] memo = new int[lastLen];\n for(int i = 0; i < lastLen; i++) {\n memo[i] = last.get(i);\n }\n\n for(int i = len - 2; i >= 0; i--) {\n List<Integer> list = triangle.get(i);\n for(int j = 0; j < list.size(); j++) {\n memo[j] = Math.min(memo[j], memo[j + 1]) + list.get(j);\n }\n }\n return memo[0];\n }", "private Integer largestPath(BinaryNode node, Integer sum) {\n\n if (node == null) {\n return sum;\n } else {\n sum += (Integer)node.element;\n Integer sumR = largestPath(node.right, sum);\n Integer sumL = largestPath(node.left, sum);\n\n if (sumR > sumL) return sumR;\n else return sumL;\n }\n }", "public int minimumTotal(List<List<Integer>> triangle) {\n int n = triangle.size();\n int[] dp = new int[n+1];\n for(int i = n-1 ; i>=0 ; i--){\n for(int j = 0; j < triangle.get(i).size() ; j++){\n dp[j] = Math.min(dp[j],dp[j+1]) + triangle.get(i).get(j);\n }\n }\n return dp[0];\n }", "public static int minimumTotal(List<List<Integer>> triangle) {\n int row = triangle.size();\n int[] minlen = new int[row + 1];\n for (int level = row - 1; level >= 0; level--) {\n for (int i = 0; i <= level; i++) {\n minlen[i] = Math.min(minlen[i],minlen[i + 1]) + triangle.get(level).get(i);\n }\n }\n return minlen[0];\n }", "public int minimumTotal(List<List<Integer>> triangle) {\n int size = triangle.size();\n int[] dp = new int[size + 1];\n for (int i = size - 1; i >= 0; i--) {\n for (int j = 0; j < triangle.get(i).size(); j++) {\n dp[j] = Math.min(dp[j], dp[j + 1]) + triangle.get(i).get(j);\n }\n }\n return dp[0];\n }", "public int maxPathSumHelper(TreeNode root) {\n\n if(root == null) {\n return 0;\n }\n\n int leftSum = maxPathSumHelper(root.left);\n int rightSum = maxPathSumHelper(root.right);\n\n // Compare leftSum + rool.val with rightSum + root.val to select which values to send further\n int maxTillNow = Math.max(leftSum + root.val, rightSum + root.val);\n \n // Check if the root value is greater than any of the path\n maxTillNow = Math.max(maxTillNow, root.val);\n \n //if root + left + root.val is greater than any of the max till now\n int tempMax = Math.max(maxTillNow, leftSum + rightSum + root.val);\n\n finalMax = Math.max(tempMax, finalMax);\n\n return maxTillNow;\n }", "private static void findMaxSumMatrix(int[][] matrix) {\n int maxSum = Integer.MIN_VALUE;\n int row = 0;\n int col = 0;\n for (int rows = 0; rows <matrix.length - 2; rows++) {\n for (int column = 0; column <matrix[rows].length - 2; column++) {\n int currentItem = matrix[rows][column];\n int neighborItem = matrix[rows][column + 1];\n int nextNeighborItem = matrix[rows][column + 2];\n\n int currentDownNeighborItem = matrix[rows + 1][column];\n int downNeighborItem = matrix[rows + 1][column + 1];\n int nextDownNeighborItem = matrix[rows + 1][column + 2];\n\n int lastItem = matrix[rows + 2][column];\n int lastNeighborItem = matrix[rows + 2][column + 1];\n int nextLastNeighborItem = matrix[rows + 2][column + 2];\n\n int sum = getSum(currentItem, neighborItem, nextNeighborItem, currentDownNeighborItem, downNeighborItem, nextDownNeighborItem, lastItem, lastNeighborItem, nextLastNeighborItem);\n\n if(maxSum <=sum){\n maxSum = sum;\n row = rows;\n col = column;\n }\n }\n }\n System.out.println(\"Sum = \" + maxSum);\n System.out.printf(\"%s %s %s\\n\",matrix[row][col], matrix[row][col + 1],matrix[row][col + 2]);\n System.out.printf(\"%s %s %s\\n\",matrix[row + 1][col],matrix[row + 1][col + 1], matrix[row + 1][col + 2]);\n System.out.printf(\"%s %s %s\",matrix[row + 2][col], matrix[row + 2][col + 1], matrix[row + 2][col + 2]);\n }", "public static int maxPathSum(List<List<Integer>> board, int p, int q) {\n\t\tx=board.size();\n\t\ty=board.get(0).size();\n\t\tif(p!=0){\n\t\t\tantiInitG(board);\n\t\t\tp=0;\n\t\t}else {\n\t\t\tinitG(board);\n\t\t}\n\t\tint max=DFS(p,q);\n\t\treturn max;\n\t}", "public int maxPathSum(TreeNode root) {\n int tempMax = maxPathSumHelper(root);\n return finalMax;\n }", "public int minimumTotal (List <List <Integer>> triangle) {\n for (int i = triangle.size () - 2; i >= 0; i--) {\n List <Integer> aList = triangle.get (i);\n List <Integer> bList = triangle.get (i + 1);\n for (int j = 0; j <= aList.size (); j++) {\n aList.set (j, aList.get (i) + Math.min (bList.get (i), bList.get (i + 1)));\n }\n }\n return triangle.get (0).get (0);\n }", "static int maxSum()\n {\n // Find array sum and i*arr[i] with no rotation\n int arrSum = 0; // Stores sum of arr[i]\n int currVal = 0; // Stores sum of i*arr[i]\n for (int i=0; i<arr.length; i++)\n {\n arrSum = arrSum + arr[i];\n currVal = currVal+(i*arr[i]);\n }\n\n // Initialize result as 0 rotation sum\n int maxVal = currVal;\n\n // Try all rotations one by one and find\n // the maximum rotation sum.\n for (int j=1; j<arr.length; j++)\n {\n currVal = currVal + arrSum-arr.length*arr[arr.length-j];\n if (currVal > maxVal)\n maxVal = currVal;\n }\n\n // Return result\n return maxVal;\n }", "public static int minimumTotal(List<List<Integer>> triangle) {\n\t\tif (triangle.size() == 0 || triangle == null) {\n\t\t\treturn 0;\n\t\t}\n\n\t\tif (triangle.size() == 1) {\n\t\t\treturn triangle.get(0).get(0);\n\t\t}\n\t\t\n\t\tint[] sum = new int[triangle.size()];\n\t\t\n\t\tList<Integer> lowestLevel = triangle.get(triangle.size() - 1);\n\t\t\n\t\tfor (int i = 0; i < sum.length; i++) {\n\t\t\tsum[i] = lowestLevel.get(i);\n\t\t}\n\t\tfor (int i = triangle.size() - 2; i >= 0; i--) {\n\t\t\tList<Integer> level_i = triangle.get(i);\n\t\t\tfor (int j = 0; j <= i; j++) {\n\t\t\t\tsum[j] = level_i.get(j) + Math.min(sum[j], sum[j + 1]);\n\t\t\t}\n\t\t}\n\t\treturn sum[0];\n\t}", "public int maxSumSubmatrix(int[][] matrix, int target) {\n int row = matrix.length;\n if(row==0)return 0;\n int col = matrix[0].length;\n int m = Math.min(row,col);\n int n = Math.max(row,col);\n //indicating sum up in every row or every column\n boolean colIsBig = col>row;\n int res = Integer.MIN_VALUE;\n for(int i = 0;i<m;i++){\n int[] array = new int[n];\n // sum from row j to row i\n for(int j = i;j>=0;j--){\n int val = 0;\n TreeSet<Integer> set = new TreeSet<Integer>();\n set.add(0);\n //traverse every column/row and sum up\n for(int k = 0;k<n;k++){\n array[k]=array[k]+(colIsBig?matrix[j][k]:matrix[k][j]);\n val = val + array[k];\n //use TreeMap to binary search previous sum to get possible result \n Integer subres = set.ceiling(val-target);\n if(null!=subres){\n res=Math.max(res,val-subres);\n }\n set.add(val);\n }\n }\n }\n return res;\n}", "public static int maxPathSum2(BTreeNode root) {\n\t\tMyResult result = new MyResult();\n\t\tauxPathSum2(root, 0, result);\n\t\treturn result.maxsum;\n\t}", "static long journey(int[] path, int k) {\n calculateSumRecursive(path,k,0,0);\n return maxSum;\n }", "public int minimumTotal(ArrayList<ArrayList<Integer>> triangle) {\n int[] ret = new int[triangle.get(triangle.size()-1).size()];\n for (int i=0; i<ret.length; i++)\n ret[i] = triangle.get(triangle.size()-1).get(i);\n \n for (int i=triangle.size()-2; i>=0; i--){\n for (int j=0; j<triangle.get(i).size(); j++){\n ret[j] = Math.min(ret[j], ret[j+1])+triangle.get(i).get(j);\n }\n }\n \n return ret[0];\n }", "public static void main(String[] args) {\n Scanner sc = new Scanner(System.in);\n int max = Integer.MIN_VALUE;\n int temp;\n int[][] array = new int[6][6];\n for(int i=0; i<6; i++){\n for(int j=0; j<6; j++){\n array[i][j] = sc.nextInt();\n }\n }\n for(int i=0;i<4;i++){\n for(int j=0;j<4;j++){\n temp = array[i][j] + array[i][j+1] + array[i][j+2]\n + array[i+1][j+1]\n + array[i+2][j] + array[i+2][j+1] + array[i+2][j+2];\n max = Math.max(temp,max);\n }\n }\n System.out.println(max);\n }", "int maxPathSumHelper3(TreeNode root, int[] max){\n \tif (root.left == null && root.right == null){\n \t\tmax[0] = Math.max(max[0], root.val);\n \t\treturn root.val;\n \t}\n \tint value = root.val;\n \tint childMax = 0;\n \tif (root.left != null){\n \t\tint left = maxPathSumHelper3(root.left, max);\n \t\tif(left > 0){\n \t\t\tvalue += left;\n \t\t\tchildMax = Math.max(childMax, left);\n \t\t}\n \t}\n \t\n \tif (root.right != null){\n \t\tint right = maxPathSumHelper3(root.right, max);\n \t\tif (right > 0){\n \t\t\tvalue += right;\n \t\t\tchildMax = Math.max(childMax, right);\n \t\t}\n \t}\n \t\n \tmax[0] = Math.max(max[0], value);\n \treturn root.val + Math.max(0, childMax);\n \t \t\n }", "public int minimumTotal2D(List<List<Integer>> triangle) {\n if (triangle.size() == 0) return 0;\n int n = triangle.get(triangle.size() - 1).size();\n int[][] cache = new int[n][n];\n for (int i = 0; i < n; ++i) {\n cache[n-1][i] = triangle.get(triangle.size() - 1).get(i);\n }\n for (int i = n - 2; i >= 0; --i) {\n for (int j = 0; j < triangle.get(i).size(); ++j) {\n int cur = triangle.get(i).get(j);\n cache[i][j] = Math.min(cur + cache[i + 1][j], \n cur + cache[i + 1][j + 1]);\n }\n }\n return cache[0][0];\n }", "public int minimumTotal(ArrayList<ArrayList<Integer>> triangle) {\n int[] ret = new int[triangle.size()];\n for(int i=0; i<triangle.size(); i++){\n ArrayList<Integer> list = triangle.get(i);\n for(int j=list.size()-1; j>=0; j--){\n if (j==0)\n ret[j] = ret[j]+list.get(j);\n else if (j==list.size()-1)\n ret[j] = ret[j-1]+list.get(j);\n else \n ret[j] = Math.min(ret[j-1], ret[j])+list.get(j);\n }\n }\n \n int min = ret[0];\n for (int i=1; i<ret.length; i++)\n min = Math.min(min, ret[i]);\n return min;\n }", "public int minimumTotal(ArrayList<ArrayList<Integer>> triangle) {\n if (triangle.size() == 0)\n return 0;\n ArrayList<Integer> minimum = triangle.get(triangle.size()-1);\n int n = minimum.size();\n while (n-- > 1) {\n for (int i = 0; i < n; i++) {\n minimum.set(i, triangle.get(n-1).get(i) + Math.min(minimum.get(i), minimum.get(i+1)));\n }\n }\n return minimum.get(0);\n }", "public int minPathSum(int[][] grid) {\n if (grid==null || grid.length==0)\n return 0;\n int m = grid.length;\n int n = grid[0].length;\n for (int i=0; i<m; i++) {\n for (int j=0; j<n; j++) {\n if (i==0 && j==0)\n continue;\n int up = i > 0 ? grid[i-1][j] : Integer.MAX_VALUE;\n int left = j > 0 ? grid[i][j-1] : Integer.MAX_VALUE;\n grid[i][j] += (left > up ? up : left);\n }\n }\n return grid[m-1][n-1];\n }", "public static void main(String[] args) {\n Scanner scanner = new Scanner(System.in);\n int N = scanner.nextInt(), M = scanner.nextInt();\n int[][] graph = new int[N + 1][N + 1];\n\n for (int i = 0; i < M; i++) {\n int from = scanner.nextInt(), to = scanner.nextInt();\n int weight = scanner.nextInt();\n graph[from][to] = weight;\n }\n \n int[][][] dp = new int[N + 1][N + 1][N + 1];\n\n for (int i = 1; i <= N; i++) {\n for (int j = 1; j <= N; j++) {\n if (graph[i][j] != 0) {\n dp[0][i][j] = graph[i][j];\n } else {\n dp[0][i][j] = Integer.MAX_VALUE;\n }\n }\n }\n \n for (int k = 0; k <= N; k++) {\n for (int i = 1; i <= N; i++) {\n dp[k][i][i] = 0;\n }\n }\n\n for (int k = 1; k <= N; k++) {\n for (int i = 1; i <= N; i++) {\n for (int j = 1; j <= N; j++) {\n if (dp[k - 1][i][k] != Integer.MAX_VALUE && dp[k - 1][k][j] != Integer.MAX_VALUE) {\n dp[k][i][j] = Math.min(dp[k - 1][i][j], dp[k -1][i][k] + dp[k -1][k][j]);\n } else {\n dp[k][i][j] = dp[k - 1][i][j];\n }\n }\n }\n }\n\n int Q = scanner.nextInt();\n StringBuilder sb = new StringBuilder();\n for (int i = 0; i < Q; i++) {\n int from = scanner.nextInt(), to = scanner.nextInt();\n int res = dp[N][from][to] == Integer.MAX_VALUE ? -1 : dp[N][from][to];\n sb.append(res).append('\\n');\n }\n System.out.println(sb.toString());\n }", "public int longestPathInDiretion3dp(int[][] matrix) {\n int m = matrix.length, n = matrix[0].length;\n timeComplexityCount = 0;\n int[][] dp = new int[m][n+2];\n int max = 0;\n // initialize first line as 1\n for (int i = 0; i < n; i++) {\n if (matrix[0][i] == 0)\n dp[0][i+1] = 1;\n }\n for (int i = 0; i < m; i++) {\n int[] left = Arrays.copyOf(dp[i], n + 2), right = Arrays.copyOf(dp[i], n + 2);\n for (int j = 0; j < n; j++) {\n if (matrix[i][j] == 0)\n right[j+1] = Math.max(right[j+1], right[j] + 1);\n if (matrix[i][n-1-j] == 0)\n left[n-j] = Math.max(left[n-j], left[n-j+1] + 1);\n }\n for (int j = 0; j < n; j++) {\n dp[i][j + 1] = Math.max(left[j + 1], right[j + 1]);\n if (i < m - 1 && matrix[i+1][j] == 0)\n dp[i+1][j+1] = dp[i][j+1] + 1;\n else if (i == m - 1)\n max = Math.max(max, dp[i][j+1]);\n }\n }\n return max;\n }", "private String findMax(int[][] grid) {\n int max = 0, rx = 0, ry = 0, size = 0;\n for (int y = 1; y <= 300; y++) {\n for (int x = 1; x <= 300; x++) {\n // iterate over diameter, keep results in order to reuse them\n Map<Integer, Integer> squares = new HashMap<>(300);\n for (int d = 0; d <= 300 - Math.max(x, y); d++) {\n int current = 0;\n\n if (d == 0) {\n current += grid[y][x];\n } else {\n for (int offset = 0; offset < d; offset++) {\n current += grid[y + offset][x + d]; // skip inner square, get last column\n current += grid[y + d][x + offset]; // skip inner square, get last row\n }\n current += squares.get(d - 1); // add inner square of size (d-1)\n current += grid[y + d][x + d]; // add bottom-right corner cell\n }\n\n squares.put(d, current);\n\n if (current > max) {\n max = current;\n rx = x; ry = y;\n size = d;\n }\n }\n }\n }\n\n return rx + \",\" + ry + \",\" + (size + 1);\n }", "static int getMaxCoinValGeeks(int arr[], int n)\n {\n // Create a table to store solutions of subproblems\n int table[][] = new int[n][n];\n int gap, gapStartIndx, gapEndIndx, x, y, z;\n\n // Fill table using above recursive formula.\n // Note that the tableis filled in diagonal\n // fashion (similar to http://goo.gl/PQqoS),\n // from diagonal elements to table[0][n-1]\n // which is the result.\n for (gap = 0; gap < n; ++gap)\n {\n // both gapStartIndx and gapEndIndx are incremented in each loop iteration\n // for each gap, gapStartIndx keeps moving\n // gapEndIndx is always gap more than the gapStartIndx\n // when gap == 0, gapStartIndx = gapEndIndx\n // table[i,j] identifies the max value obtained by the player who picks first\n // first player = i to get val[i] , range of coins left = i+1, j\n // second player max value = table[i+1,j], range of coins left = i+2, j\n // first player max value = table[i+2,j]. So total value for player 1 is\n // val[i] + table[i+2, j]\n // first player picks j to get val[j], range of coins left i, j-1.\n // second player max = table[i, j-1] range of coins left i, j-2\n // first player max = table[i,j-2]\n // so for finding max value for a p\n for (gapStartIndx = 0, gapEndIndx = gap; gapEndIndx < n; ++gapStartIndx, ++gapEndIndx)\n {\n // Here x is value of F(i+2, j),\n // y is F(i+1, j-1) and z is\n // F(i, j-2) in above recursive formula\n // if gapStartIndx and gapEndIndx are two or more apart\n x = ((gapStartIndx + 2) <= gapEndIndx) ? table[gapStartIndx + 2][gapEndIndx] : 0;\n y = ((gapStartIndx + 1) <= (gapEndIndx - 1)) ? table[gapStartIndx +1 ][gapEndIndx - 1] : 0;\n z = (gapStartIndx <= (gapEndIndx - 2)) ? table[gapStartIndx][gapEndIndx - 2]: 0;\n\n table[gapStartIndx][gapEndIndx] = Math.max(arr[gapStartIndx] +\n Math.min(x, y), arr[gapEndIndx] +\n Math.min(y, z));\n }\n }\n\n return table[0][n - 1];\n }", "public int minPathSum(int[][] grid) {\n\t\tint m = grid.length;\n\t\tint n = grid[0].length;\n\t\tif (n < m) {\n\t\t\tint[] dp = new int[n];\n\t\t\tdp[n-1] = grid[m-1][n-1];\n\t\t\tfor(int i = n-2; i >= 0; i--) {\n\t\t\t\tdp[i] = grid[m-1][i] + dp[i+1];\n\t\t\t}\n\t\t\tfor(int i = m-2; i >= 0; i--) {\n\t\t\t\tfor(int j = n-1; j >= 0; j--) {\n\t\t\t\t\tif(j == n-1) {\n\t\t\t\t\t\tdp[j] += grid[i][j];\n\t\t\t\t\t} else {\n\t\t\t\t\t\tdp[j] = grid[i][j] + Math.min(dp[j], dp[j+1]);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn dp[0];\n\t\t} else {\n\t\t\tint[] dp = new int[m];\n\t\t\tdp[m-1] = grid[m-1][n-1];\n\t\t\tfor(int i = m-2; i >= 0; i--) {\n\t\t\t\tdp[i] = grid[i][n-1] + dp[i+1];\n\t\t\t}\n\t\t\tfor(int i = n-2; i >= 0; i--) {\n\t\t\t\tfor(int j = m-1; j >= 0; j--) {\n\t\t\t\t\tif(j == m-1) {\n\t\t\t\t\t\tdp[j] += grid[j][i];\n\t\t\t\t\t} else {\n\t\t\t\t\t\tdp[j] = grid[j][i] + Math.min(dp[j], dp[j+1]);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn dp[0];\n\t\t}\n\t}", "public static void main(String[] args) throws IOException {\n\t\tBufferedReader br = new BufferedReader(new FileReader(\"input.txt\"));\n\t\tString line = br.readLine();\n\t\tList<Integer> triangleRow = null;\n\t\tList<List<Integer>> triangle = new ArrayList<>();\n\t\twhile(line != null) {\n\t\t\tString[] nums = line.trim().split(\"\\\\s+\");\n\t\t\ttriangleRow = new ArrayList<>();\n\t\t\t\n\t\t\t\n\t\t\tfor(int i=0; i<nums.length; i++) {\n\t\t\t\ttriangleRow.add(Integer.parseInt(nums[i]));\n\t\t\t}\n\t\t\t\n\t\t\ttriangle.add(triangleRow);\n\t\t\t\n\t\t\tline = br.readLine();\n\t\t}\n\t\t\n\t\tbr.close();\n\t\t\n\t\tSystem.out.println(shortestPath(triangle));\n\t}", "private static void longestIncPath(int[][] matrix) {\n\t\t \n\t\t int total_elem = matrix.length * (matrix[0].length);\n\t ArrayList<ArrayList<Integer>> g = new ArrayList<ArrayList<Integer>>();\n\t int[] outdegree = new int[total_elem];\n\t int[][] dp = new int[matrix.length][matrix[0].length];\n\t int m = matrix[0].length;\n\t \n\t for(int i=0;i<matrix.length;i++){\n\t for(int j=0;j<matrix[0].length;j++){\n\t \tg.add(new ArrayList<Integer>());\n\t }\n\t }\n\t \n\t for(int i=0;i<matrix.length;i++){\n\t for(int j=0;j<matrix[0].length;j++){\n\t \n\t int left=-1;\n\t int right=-1;\n\t int up=-1;\n\t int down=-1;\n\t int curr = matrix[i][j];\n\t if(j-1>=0)\n\t left = matrix[i][j-1]; \n\t if(j+1<matrix[0].length)\n\t right = matrix[i][j+1];\n\t if(i-1>=0)\n\t up=matrix[i-1][j];\n\t if(i+1<matrix.length)\n\t down=matrix[i+1][j];\n\t \n\t if(left!=-1 && curr>left)\n\t addedge(g,(m*i+(j-1)),(m*i+j),outdegree);\n\t if(right!=-1 && curr>right)\n\t addedge(g,(m*i+(j+1)),(m*i+j),outdegree);\n\t if(up!=-1 && curr>up)\n\t addedge(g,(m*(i-1)+j),(m*i+j),outdegree);\n\t if(down!=-1 && curr>down)\n\t addedge(g,(m*(i+1)+j),(m*i+j),outdegree);\n\t \n\t \n\t }\n\t }\n\t \n\t Queue<Integer> q = new LinkedList<Integer>();\n\t \n\t for(int i:outdegree){\n\t if(i==0)\n\t q.add(i);\n\t }\n\t \n\t \n\t while(!q.isEmpty()){\n\t int temp = q.poll();\n\t int r = temp/m;\n\t int c = temp - r*m;\n\t int max=0;\n\t \n\t for(int i:g.get(temp)){\n\t int row = i/m;\n\t int col = i - r*m;\n\t max=Math.max(max,dp[row][col]+1);\n\t outdegree[i]--;\n\t if(outdegree[i]==0)\n\t q.add(i);\n\t }\n\t \n\t dp[r][c]=max;\n\t }\n\t \n\t\t\n\t}", "public static void main(String[] args) throws IOException {\n\t\tBufferedReader br= new BufferedReader(new InputStreamReader (System.in));\n\t\tBufferedWriter bw= new BufferedWriter(new OutputStreamWriter(System.out));\n\t\tString[] str;\n\t\tstr=br.readLine().split(\" \");\n\t\tint n=Integer.parseInt(str[0]);\n\t\tint m=Integer.parseInt(str[1]);\n\t\tint[][] num=new int[n][n];\n\t\tfor(int i=0;i<n;i++) {\n\t\t\tstr=br.readLine().split(\" \");\n\t\t\tfor(int j=0;j<n;j++) {num[i][j]=Integer.parseInt(str[j]);}\n\t\t}\n\t\tint [][] loc=new int[4][m];\n\t\tfor(int i=0;i<m;i++) {\n\t\t\tstr=br.readLine().split(\" \");\n\t\t\tloc[0][i]=Integer.parseInt(str[0])-1;\n\t\t\tloc[1][i]=Integer.parseInt(str[1])-1;\n\t\t\tloc[2][i]=Integer.parseInt(str[2])-1;\n\t\t\tloc[3][i]=Integer.parseInt(str[3])-1;\n\t\t}\n\t\tint[][] sumDP=new int[n][n];\n\t\tfor(int i=0;i<n;i++) {\n\t\t\tfor(int j=0;j<n;j++) {\n\t\t\t\tif(i==0) {\n\t\t\t\t\tif(j==0) sumDP[i][j]=num[i][j];\n\t\t\t\t\telse sumDP[i][j]=num[i][j]+sumDP[i][j-1];\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tif(j==0) sumDP[i][j]=num[i][j]+sumDP[i-1][j];\n\t\t\t\t\telse{\n\t\t\t\t\t\tsumDP[i][j]=num[i][j]+sumDP[i-1][j]+sumDP[i][j-1]-sumDP[i-1][j-1];\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tfor(int i=0;i<m;i++) {\n\t\t\tint x1=loc[0][i];\n\t\t\tint y1=loc[1][i];\n\t\t\tint x2=loc[2][i];\n\t\t\tint y2=loc[3][i];\n\t\t\tint ans;\n\t\t\tif(x1==0&&y1==0) ans=sumDP[x2][y2];\n\t\t\telse if(x1==0) ans=sumDP[x2][y2]-sumDP[x2][y1-1];\n\t\t\telse if(y1==0) ans=sumDP[x2][y2]-sumDP[x1-1][y2];\n\t\t\telse ans=sumDP[x2][y2]-sumDP[x1-1][y2]-sumDP[x2][y1-1]+sumDP[x1-1][y1-1];\n\t\t\tbw.write(String.valueOf(ans)+\"\\n\");\n\t\t}\n\t\t\n\t\tbr.close();\n\t\tbw.close();\n\t}", "public static void main(String args[]) throws IOException {\n int[] distance = new int[999 * 999]; // 999 is the max size of rows and cols\n int[] grid = new int[999 * 999];\n int tests = Integer.parseInt(getLine().trim());\n for (int i = 1; i <= tests; i++) {\n int rows = Integer.parseInt(getLine().trim());\n int cols = Integer.parseInt(getLine().trim());\n for (int r = 0; r < rows; r++) {\n StringTokenizer st = new StringTokenizer(getLine());\n for (int c = 0; c < cols; c++) {\n grid[r * cols + c] = Integer.parseInt(st.nextToken());\n }\n }\n\n int goal = (rows - 1) * cols + (cols - 1);\n int start = 0;\n Arrays.fill(distance, 0, rows * cols, INFINITY);\n distance[start] = grid[0];\n CustomPriorityQueue pq = new CustomPriorityQueue();\n pq.add(new Tuple(grid[0], start), grid[0]);\n while (!pq.isEmpty()) {\n Tuple current = pq.remove();\n if (distance[current.cell] < current.d); // we know shorter path already\n if (current.cell == goal) break;\n int r = current.cell / cols;\n int c = current.cell % cols;\n for (int j = 0; j < DELTA_R.length; j++) {\n int nr = r + DELTA_R[j];\n int nc = c + DELTA_C[j];\n if (nr < 0 || nr >= rows || nc < 0 || nc >= cols) continue; // out of bounds\n int next = nr * cols + nc;\n if (distance[next] > distance[current.cell] + grid[next]) {\n distance[next] = distance[current.cell] + grid[next];\n pq.add(new Tuple(distance[next], next), grid[next]);\n }\n }\n }\n\n out.println(distance[goal]);\n }\n out.close();\n }", "public static int kadaneMaxSum(int[] nums) {\n if(nums == null || nums.length == 0) return -1;\n\n int maxSoFar = 0, maxEndingHere = 0;\n for(int i = 0; i < nums.length; i++) {\n maxEndingHere += nums[i];\n\n if(maxEndingHere < 0) {\n maxEndingHere = 0;\n } else if(maxSoFar < maxEndingHere) {\n maxSoFar = maxEndingHere;\n }\n }\n\n System.out.println(\"kadane the maxsum is \" + maxSoFar);\n return maxSoFar;\n }", "public static void main(String args[]) {\n Node root = new Node(10);\n root.left = new Node(-2);\n root.right = new Node(7);\n root.left.left = new Node(8);\n root.left.right = new Node(-4);\n System.out.println(\"Following are the nodes \" +\n \"on maximum sum path\");\n int sum = maxSumPath(root);\n System.out.println();\n System.out.println(\"Sum of nodes is : \" + sum);\n }", "public static int calculate()\n {\n final List<Integer> oneToNine = IntStream.iterate(1, n -> n + 1)\n .limit(9)\n .boxed()\n .collect(toList());\n final List<List<Integer>> permutations = HeapPermutations.of(oneToNine);\n\n // System.out.println(permutations.size());\n //2- for each permutation\n // a. find all breaking 2 points to break\n // b. check first two sections' third is equal to the last section\n // c. if yes, add combintion to result, otherwise skip\n\n return permutations.stream()\n .flatMap(toTriples()) //find all combinations xx X yy = zz\n .filter(isPandigital()) // allow pandigital tripes through\n .map(Triple::getThird) // get the product\n .distinct() // get distinct products only given the problem statement does not allow repetition (see hint)\n .mapToInt(i -> i) // convert to primitive\n .sum(); // and finally get the sum\n }", "public static int minPathSum(int[][] grid) {\n if (grid == null || grid.length == 0 || grid[0].length == 0)\n return 0;\n for (int i = 0; i < grid.length; i++) {\n for (int j = 0; j < grid[0].length; j++) {\n if (i == 0 && j == 0) {\n } else if (i == 0 && j > 0)\n grid[i][j] += grid[i][j-1];\n else if (j == 0 && i > 0)\n grid[i][j] += grid[i-1][j];\n else \n grid[i][j] += Math.min(grid[i][j-1], grid[i-1][j]);\n }\n }\n return grid[grid.length-1][grid[0].length-1];\n }", "private int dfs(int[][] matrix, int i, int j, int last, int[][] memo) {\n if (i < 0 || i >= matrix.length || j < 0 || j >= matrix[0].length || matrix[i][j] <= last) {\n return 0;\n }\n if (memo[i][j] != 0) {\n return memo[i][j];\n }\n int maxLength = 0;\n maxLength = Math.max(maxLength, dfs(matrix, i - 1, j, matrix[i][j], memo));\n maxLength = Math.max(maxLength, dfs(matrix, i + 1, j, matrix[i][j], memo));\n maxLength = Math.max(maxLength, dfs(matrix, i, j - 1, matrix[i][j], memo));\n maxLength = Math.max(maxLength, dfs(matrix, i, j + 1, matrix[i][j], memo));\n memo[i][j] = maxLength + 1;\n return memo[i][j];\n }", "public int minFallingPathSum(int[][] A) {\n int minpath = 999999999;\n\n int[][] cache = new int[A.length][A[0].length];\n // you need to initialise the cache.\n\n for(int i = 0; i < A.length; i++ ){\n for(int j = 0; j < A[0].length; j++){\n cache[i][j] = -1;\n //initialises the cache to a default \"Untouched\" value.\n }\n }\n\n for(int i = 0; i < A[0].length; i ++){\n\n minpath = Math.min(minpath, minFallingPathSum(A,cache, i, 0 ));\n\n }\n\n return minpath;\n }", "public static void main(String[] args) {\n\t\tint[] a = { -2, -3, 4, -1, -2, 1, 5, -3 }; \n\t\t int size = a.length; \n\t int max_so_far = Integer.MIN_VALUE, max_ending_here=0;\n\t for (int i = 0; i < size; i++) { \n\t max_ending_here = max_ending_here + a[i]; \n\t if (max_so_far < max_ending_here) \n\t max_so_far = max_ending_here; \n\t if (max_ending_here < 0) \n\t max_ending_here = 0; \n\t } \n\t // System.out.println(max_so_far);\n\t int product=1,max=0;\n\t for (int i = 0; i < size; i++) {\n\t \t\n\t \tproduct=product*a[i];\n\t \tif(product>max)\n\t \t\tmax=product;\n\t \t if (product < 0) \n\t \t\t product = 1; \n\t \t\n\t }\n\t // System.out.println(max);\n\t \n\t Arrays.sort(a);\n\t int i=0,j=a.length-1;\n\t while(i<a.length &&j<a.length)\n\t {\n\t \t if(a[i]+a[j]==3)\n\t \t {\n\t \t\t System.out.println(a[i]+\" \"+a[j]);\n\t \t\t i++;j--;\n\t \t }\n\t \t else if(a[i]+a[j]>3)\n\t \t\t j--;\n\t \t else if(a[i]+a[j]<3)\n\t \t\t i++;\n\t }\n\t \n\t \n\t }", "public int maxDistance(int[][] grid) {\n boolean[][] visited = new boolean[grid.length][grid[0].length]; // mark which cells have been already been visited\n Queue<int[]> queue = new LinkedList<>();\n\n //put 1 cells into queue to start with and mark then visited\n for (int i = 0; i < grid.length; i++) {\n for (int j = 0; j < grid[0].length; j++) {\n if (grid[i][j] == 1) {\n queue.add(new int[]{i,j});\n visited[i][j] = true; //mark cell as visited\n }\n }\n }\n\n int distance = -1;\n int[][] directions = {{-1,0}, {0,1}, {1,0}, {0,-1}}; //all possible 4 directions\n while (!queue.isEmpty()) {\n int size = queue.size(); //since this is BFS we need to traverse level by level\n\n while (size > 0) { //iterate only till nodes in current level\n int[] pair = queue.poll();\n\n for (int[] direction : directions) { // check in all possible directions\n int x = pair[0] + direction[0];\n int y = pair[1] + direction[1];\n\n //if target cell is with in bounds and is not visited, add it to queue\n if (x >= 0 && x < grid.length && y >= 0 && y < grid[0].length && !visited[x][y]) {\n queue.add(new int[]{x,y});\n visited[x][y] = true;\n }\n }\n size--;\n }\n distance++; //increment the size only after level traversal is complete\n }\n\n //this is required because distance can be zero. This is possible if grid contains all 1's and all 1's are\n //consider level 1 as we are starting with them. So, need to return -1\n return distance == 0 ? -1 : distance;\n }", "public double largestTriangleArea(int[][] points) {\n int N = points.length;\n double area = 0f;\n for (int i = 0; i < N; i++) {\n for (int j = i + 1; j < N; j++) {\n for (int k = j + 1; k < N; k++) {\n area = Math.max(area, shoelaceFormula(points[i], points[j], points[k]));\n }\n }\n }\n return area;\n }", "public int findMaxDegree() {\n\t\tint gradoMax = 0;\n\t\t\n\t\tfor(String s : grafo.vertexSet()) {\n\t\t\tint grado = grafo.degreeOf(s);\n\t\t\t\n\t\t\tif(grado > gradoMax) {\n\t\t\t\tgradoMax = grado;\n\t\t\t\tverticeGradoMax = s;\n\t\t\t}\n\t\t\t\t\n\t\t}\n\t\treturn gradoMax;\n\t}", "private static int maxSum(int arr[]) {\n int sum = 0;\n Arrays.sort(arr);\n\n // Subtracting a1, a2, a3,....., a(n/2)-1,\n // an/2 twice and adding a(n/2)+1, a(n/2)+2,\n // a(n/2)+3,....., an - 1, an twice.\n for (int i = 0; i < arr.length / 2; i++) {\n sum -= (2 * arr[i]);\n sum += (2 * arr[arr.length - i - 1]);\n }\n\n return sum;\n }", "public int longestIncreasingPath(int[][] matrix) {\r\n\t\tif(matrix == null || matrix.length == 0 || matrix[0].length == 0) return 0;\r\n\t\tint m = matrix.length, n = matrix[0].length;\r\n\t\tint[][] dp = new int[m][n];\r\n\t\tint max = 0;\r\n\t\tfor(int i = 0; i < m; i++) {\r\n\t\t\tfor(int j = 0; j < n; j++) {\r\n\t\t\t\tmax = Math.max(max, findPath(matrix, i, j, dp));\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn max;\r\n\t}", "private static int LargestSubArraySum(int[] array) {\n\t\tint maximumSum=0;\n\t\tfor(int i=0; i< array.length; i++) {\n\t\t\tfor(int j=i; j < array.length; j++) {\n\t\t\t\t\n\t\t\t\tint sum=0;\n\t\t\t\tfor(int k=i; k<= j; k++) \n\t\t\t\t\tsum += array[k];\n\t\t\t\t\n\t\t\t\tmaximumSum=Math.max(maximumSum, sum);\n\t\t\t} \n\t\t}\n\t\treturn maximumSum;\n\t}", "private static int findMaxPointsFromTopLeftToBottomRight(char[][] matrix, int startingCellX, int startingCellY, int endCellX, int endCellY, int[][] memory) {\n if (!inRange(matrix, startingCellX, startingCellY)) {\n return 0;\n }\n\n/*\n if (visited[startingCellX][startingCellY]) {\n return 0;\n }\n*/\n\n if (memory[startingCellX][startingCellY] != -1) {\n return memory[startingCellX][startingCellY];\n }\n\n char ch = matrix[startingCellX][startingCellY];\n\n //visited[startingCellX][startingCellY] = true;\n\n if (ch == '#') {\n return 0;\n }\n\n if (startingCellX == endCellX && startingCellY == endCellY) {\n if (ch == '#' || ch == '.') {\n return 0;\n }\n return 1; // if '*'\n }\n\n if (ch == '*') {\n\n int maxPointsFromDown = findMaxPointsFromTopLeftToBottomRight(matrix, startingCellX + 1, startingCellY, endCellX, endCellY, memory);\n int maxPointsFromRight = findMaxPointsFromTopLeftToBottomRight(matrix, startingCellX, startingCellY + 1, endCellX, endCellY, memory);\n\n /* if (maxPointsFromRight < maxPointsFromDown) {\n if (inRange(matrix, startingCellX, startingCellY + 1)) {\n visited[startingCellX][startingCellY + 1] = false;\n }\n } else {\n if (inRange(matrix, startingCellX + 1, startingCellY)) {\n visited[startingCellX + 1][startingCellY] = false;\n }\n }\n*/\n int maxPoints = 1 + Math.max(maxPointsFromRight, maxPointsFromDown);\n\n // memoization for top-down approach\n memory[startingCellX][startingCellY] = maxPoints;\n\n return maxPoints;\n\n } else if (ch == '.') {\n\n int maxPointsFromDown = findMaxPointsFromTopLeftToBottomRight(matrix, startingCellX + 1, startingCellY, endCellX, endCellY, memory);\n int maxPointsFromRight = findMaxPointsFromTopLeftToBottomRight(matrix, startingCellX, startingCellY + 1, endCellX, endCellY, memory);\n\n /* if (maxPointsFromRight < maxPointsFromDown) {\n if (inRange(matrix, startingCellX, startingCellY + 1)) {\n visited[startingCellX][startingCellY + 1] = false;\n }\n } else {\n if (inRange(matrix, startingCellX + 1, startingCellY)) {\n visited[startingCellX + 1][startingCellY] = false;\n }\n }*/\n\n int maxPoints = Math.max(maxPointsFromRight, maxPointsFromDown);\n\n // memoization for top-down approach\n memory[startingCellX][startingCellY] = maxPoints;\n\n return maxPoints;\n } else { // if ch == '#'\n\n int maxPoints = 0;\n\n // memoization for top-down approach\n memory[startingCellX][startingCellY] = 0;\n\n return 0;\n }\n }", "public int best(){\n List<Integer> points = count();\n Integer max = 0;\n for (Integer p: points){\n if (p <= 21 && max < p){\n max = p;\n }\n }\n return max;\n }", "public int largest(int[][] matrix) {\n // Write your solution here\n if (matrix.length == 0 || matrix[0].length == 0) {\n return 0;\n }\n int[][] M1 = new int[matrix.length][matrix[0].length];\n leftToRight(matrix, M1);\n int[][] M2 = new int[matrix.length][matrix[0].length];\n rightToLeft(matrix, M2);\n int[][] M3 = new int[matrix.length][matrix[0].length];\n bottomToUp(matrix, M3);\n int[][] M4 = new int[matrix.length][matrix[0].length];\n upToBottom(matrix, M4);\n int global_max = 0;\n for (int i = 0; i < matrix.length; i++) {\n for (int j = 0; j < matrix[0].length; j++) {\n int arm = 0;\n int left = M1[i][j];\n int right = M2[i][j];\n arm = Math.min(left, right);\n int bottom = M3[i][j];\n arm = Math.min(arm, bottom);\n int up = M4[i][j];\n arm = Math.min(arm, up);\n if (arm > global_max) {\n global_max = arm;\n }\n }\n }\n return global_max;\n }", "private static int MaxSubarraySum(int[] a) {\n\t\t\n\t\tint max_so_for =Integer.MIN_VALUE;\n\t\tint max_ending_here = 0;;\n\t\t\n\t\tfor (int i = 0; i < a.length; i++) {\n\t\t\tmax_ending_here = max_ending_here + a[i];\n\t\t\t\n\t\t\tif(max_so_for < max_ending_here )\n\t\t\t\tmax_so_for = max_ending_here;\n\t\t\tif(max_ending_here < 0)\n\t\t\t\tmax_ending_here = 0;\n\t\t}\n\t\t\n\t\treturn max_so_for;\n\t}", "public int minPathSum(int[][] grid) {\n\t\treturn 0;\r\n }", "public int minPathSum(int[][] grid) {\n\t\treturn getMinPathSum(grid, grid.length - 1, grid[0].length - 1);\n\t}", "public static int minPathSum(int[][] grid) {\n return 0;\n }", "public static void main(String[] args) {\n\t\t\n\t\t\n\t\tSorting tree = new Sorting();\n\t\ttree.root = new Node2(10);\n\t\ttree.root.left = new Node2(-2); \n tree.root.right = new Node2(7); \n tree.root.left.left = new Node2(8); \n tree.root.left.right = new Node2(-4); \n int sum = tree.maxSumPath();\n System.out.println(sum);\n\n\t}", "public int findMax(){\n return nilaiMaks(this.root);\n }", "public static int triangleNumber_bs(int[] nums) {\n if (nums == null || nums.length < 3) {\n return 0;\n }\n\n Arrays.sort(nums);\n int ans = 0;\n int len = nums.length;\n for (int i = 0; i < len - 2; i++) {\n if (nums[i] <= 0) {\n continue;\n }\n for (int j = i + 1; j < len - 1; j++) {\n if (nums[j] <= 0) {\n continue;\n }\n\n int sum = nums[i] + nums[j];\n int right = binarySearch(nums, j + 1, sum);\n if (right > j) {\n ans += right - j;\n }\n }\n }\n\n return ans;\n }", "public int maxSubArraySum(int[] nums) {\n int maxSoFar = 0;\n int maxEndingHere = 0;\n\n for (int i = 0; i < nums.length; i++) {\n maxEndingHere = maxEndingHere + nums[i];\n if (maxEndingHere > maxSoFar)\n maxSoFar = maxEndingHere;\n if (maxEndingHere < 0)\n maxEndingHere = 0;\n }\n return maxSoFar;\n }", "public static int maxSum(int[] nums) {\n if(nums == null || nums.length == 0) return -1;\n\n int maxEndingHere = nums[0], maxSoFar = nums[0];\n for(int i = 1; i < nums.length; i++) {\n maxEndingHere = Math.max(maxEndingHere + nums[i], nums[i]);\n maxSoFar = Math.max(maxSoFar, maxEndingHere);\n }\n\n return maxSoFar;\n }", "public int triangleNumber(int[] nums) {\n Arrays.sort(nums);\n int count = 0;\n for (int i = 0; i < nums.length - 2; i++) {\n for (int j = i + 1; j < nums.length - 1; j++) {\n int k = j + 1;\n while (k < nums.length && nums[i] + nums[j] > nums[k]) {\n k++;\n }\n count += k - j - 1;\n }\n\n }\n return count;\n }", "public void findMaxComb() {\n\t\tHashMap<Integer, HashSet<Integer>> adj = new HashMap<Integer, HashSet<Integer>>();\n\t\tfor (int row=0; row< w; row++) {\n\t\t\tfor (int col=0; col<l; col++) {\n\t\t\t\tHashSet<Integer> hs = new HashSet<Integer>();\n\t\t\t\t//go left\n\t\t\t\tif (inBoard(row, col-1) && visited[row][col-1] != visited[row][col]) //in board and not equal\n\t\t\t\t\ths.add(visited[row][col-1]);\n\n\t\t\t\t//go up\n\t\t\t\tif (inBoard(row-1, col) && visited[row-1][col] != visited[row][col])\n\t\t\t\t\ths.add(visited[row-1][col]);\n\n\t\t\t\t//go right\n\t\t\t\tif (inBoard(row, col+1) && visited[row][col+1] != visited[row][col])\n\t\t\t\t\ths.add(visited[row][col+1]);\n\n\t\t\t\t//go down\n\t\t\t\tif (inBoard(row+1, col) && visited[row+1][col] != visited[row][col])\n\t\t\t\t\ths.add(visited[row+1][col]);\n\t\t\t\t\n\t\t\t\t\n\t\t\t\tif (adj.containsKey(visited[row][col])) {\n\t\t\t\t\tHashSet<Integer> tt = adj.get(visited[row][col]);\n\t\t\t\t\ttt.addAll(hs);//union, return boolen\n\t\t\t\t\tadj.put(visited[row][col], tt); \n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tadj.put(visited[row][col], hs);\n\t\t\t\t}\n\t\t\t\t\n\t\t\t}\n\t\t}\n\t\tint tempMax = 0;\n\t\tfor (Integer key : adj.keySet()) {\n\t\t\tfor (Integer ele : adj.get(key)) {\n\t\t\t\ttempMax = Math.max(tempMax, map.get(key) + map.get(ele));\n\t\t\t}\n\t\t}\n\t\tmaxComb = tempMax;\n\t}", "private static int maxSubSumN3(int[] a) {\n int maxSum = 0;\n\n for (int first = 0; first < a.length; first++) {\n for (int last = first; last < a.length; last++) {\n int thisSum = 0;\n\n for (int i = first; i <= last; i++)\n thisSum += a[i];\n\n if (thisSum > maxSum) {\n maxSum = thisSum;\n }\n }\n }\n\n return maxSum;\n }", "public int solution(int[] A) {\n int sum = 0;\n int max = 0;\n Map<Integer, Integer> countMap = new HashMap<>();\n for (int i = 0; i < A.length; i++) {\n int val = Math.abs(A[i]);\n sum += val;\n A[i] = val;\n max = Math.max(val, max);\n countMap.put(val, countMap.getOrDefault(val, 0) + 1);\n }\n int[] dp = new int[sum + 1];\n for (int i = 1; i < dp.length; i++) {\n dp[i] = -1;\n }\n int[] count = new int[max + 1];\n for (Map.Entry<Integer, Integer> countMapEntry : countMap.entrySet()) {\n count[countMapEntry.getKey()] = countMapEntry.getValue();\n }\n for (int i = 1; i < max + 1; i++) {\n if (count[i] > 0) {\n for (int j = 0; j < dp.length; j++) {\n if (dp[j] >= 0) {\n dp[j] = count[i];\n } else if (j >= i && dp[j - i] > 0) {\n dp[j] = dp[j - i] - 1;\n }\n }\n }\n }\n int half = sum / 2;\n for (int i = half; i >= 0; i--) {\n if (dp[i] >= 0) {\n return Math.abs((sum - i) - i);\n }\n }\n return -1;\n }", "public int longestPathInDiretion3dfs(int[][] matrix) {\n int m = matrix.length, n = matrix[0].length;\n maxI = 0;\n timeComplexityCount = 0;\n dp = new int[m][n][3];\n int max = 0;\n for (int i = 0; i < n; i++) {\n if (matrix[0][i] == 0)\n for (int d = 0; d < 3; d++) {\n max = Math.max(max, dfs(matrix, 0, i, d));\n }\n }\n logger.info(\"node visited count: {}; total {} nodes\", timeComplexityCount, m * n);\n return maxI == m - 1 ? max : 0;\n }", "private static int findBiggestArea(File inputFile) {\n\t\tchar[][] rowsArray = convertFileIntoArray(inputFile);\n\t int maxArea = getLargestBoundedArea(rowsArray);\n\t\treturn maxArea;\n\t}", "public static void main(String[] args) {\n\t\tScanner sc = new Scanner(System.in);\n\t\tint T;\n\t\tT=sc.nextInt();\n\t\tfor(int test_case = 1; test_case <= T; test_case++){\n\t\t\tN = sc.nextInt();//3~100,000\n//\t\t\tint Max = 0;\n//\t\t\tint n2 = space(N);\n//\t\t\tint[] arr = new int[n2*2 + 1];\n//\t\t\tfor(int i = n2, size = 0; size < N; i++, size++) {\n//\t\t\t\tarr[i] = sc.nextInt();\n//\t\t\t\tMax = Max < arr[i] ? arr[i] : Max;\n//\t\t\t}\n//\t\t\tint leftIdx = n2;\n//\t\t\tint rightIdx = n2 * 2 - 1;\n//\t\t\twhile(leftIdx != 1) {\n//\t\t\t\tfor(int i = leftIdx; i<=rightIdx; i = i + 2) {\n//\t\t\t\t\tarr[i/2] = arr[i] + arr[i+1];\n//\t\t\t\t\tMax = Max < arr[i/2] ? arr[i/2] : Max;\n//\t\t\t\t}\n//\t\t\t\trightIdx = leftIdx - 1;\n//\t\t\t\tleftIdx = leftIdx / 2;\n//\t\t\t}\n\t\t\tint[] arr = new int[N];\n\t\t\tint Max = 0;\n\t\t\tfor(int i=0;i<N;i++) {\n\t\t\t\tarr[i] = sc.nextInt();\n\t\t\t}\n\t\t\tMax = fastMaxSum(arr);\n\t\t\tSystem.out.println(\"#\" + test_case + \" \" + Max);\n\t\t}\n\t}", "public int maxSubArray3(int[] nums) {\n int length = nums.length;\n //dp[i]表示数组开始索引为i的子数组的和\n int[] dp = new int[length];\n int max = nums[0] - 1;\n for (int i = 0; i < length; i++) {\n for (int j = i; j < length; j++) {\n int sum = dp[i] + nums[j];\n dp[i] = sum;\n if (max < sum) {\n max = sum;\n }\n }\n }\n return max;\n }", "private static void solve() {\n\t\tList<Integer> rgtMax= new ArrayList<>();\n\t\tList<Integer> lftMax= new ArrayList<>();\n\t\t\n\t\tpopulateRgtMax(rgtMax);\n\t\tpopulateLftMax(lftMax);\n\t\t\t\t\n\t\tint area=findMaxArea(lftMax,rgtMax);\n\t\tSystem.out.println(area);\n\t\t\n\t}", "public static void main(String[] args) {\n\t\t\n\t\tString data = \"\\r\\n\" + \n\t\t\t\t\"3\\r\\n\" + \n\t\t\t\t\"5 2\\r\\n\" + \n\t\t\t\t\"13 32\\r\\n\" + \n\t\t\t\t\"100 1000\";\n\t\t\n\t\tScanner sc = new Scanner(data);\n\t\t\n\t\tint T = sc.nextInt();\n\t\tfor(int test_case = 1; test_case<=T; ++test_case) {\n\t\t\tint minji = sc.nextInt();\n\t\t\tint treasure = sc.nextInt();\n\t\t\tint answer = 0;\n\t\t\t\n\t\t\tint start = (minji<=treasure)? minji : treasure;\n\t\t\tint target = (minji>treasure)? minji : treasure;\n\t\t\t\n\t\t\tint line = 1;\n\t\t\tint left = 1;\n\t\t\tint right =1;\n\t\t\t\n\t\t\tint startLine = 0;\n\t\t\tint targetLine = 0;\n\t\t\t\n\t\t\twhile(startLine == 0 || targetLine == 0) {\n\t\t\t\tif(left <= start && right>= start) \n\t\t\t\t\tstartLine = line;\n\t\t\t\t\n\t\t\t\tif(left <= target && right>= target) {\n\t\t\t\t\ttargetLine = line;\n\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\n\t\t\t\tleft += line;\n\t\t\t\tright += (line + 1);\n\t\t\t\t\n\t\t\t\t++line;\n\t\t\t}\n\t\t\t\n\t\t\t//System.out.println(startLine + \" \" + targetLine);\n\t\t\t\n\t\t\tleft = start;\n\t\t\tright = start;\n\t\t\tline = startLine;\n\t\t\t\n\t\t\twhile(answer == 0) {\n\t\t\t\tif(targetLine == line) {\n\t\t\t\t\tif(left<=target && right>=target) {\n\t\t\t\t\t\tanswer = targetLine - startLine;\n\t\t\t\t\t}\n\t\t\t\t\telse {\n\t\t\t\t\t\tanswer = targetLine - startLine + Math.min(Math.abs(target - left),Math.abs(right - target));\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\t//System.out.println(left);\n\t\t\t\t\n\t\t\t\tleft += line;\n\t\t\t\tright += (line + 1);\n\t\t\t\t\n\t\t\t\t++line;\n\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t\tSystem.out.println(\"#\" + test_case + \" \" + answer);\n\t\t}\n\t}", "public static void main(String args[]) {\n MaxSumLeaves tree = new MaxSumLeaves();\n tree.root = new Node(-15);\n tree.root.left = new Node(5);\n tree.root.right = new Node(6);\n tree.root.left.left = new Node(-8);\n tree.root.left.right = new Node(1);\n tree.root.left.left.left = new Node(2);\n tree.root.left.left.right = new Node(6);\n tree.root.right.left = new Node(3);\n tree.root.right.right = new Node(9);\n tree.root.right.right.right = new Node(0);\n tree.root.right.right.right.left = new Node(4);\n tree.root.right.right.right.right = new Node(-1);\n tree.root.right.right.right.right.left = new Node(10);\n tree.maxPath(root);\n System.out.println(\"Max pathSum of the given binary tree is \"\n + tree.max);\n }", "static int findLargestSubtreeSum(Node root) {\n\t\t// If tree does not exist,\n\t\t// then answer is 0.\n\t\tif (root == null)\n\t\t\treturn 0;\n\n\t\t// Variable to store\n\t\t// maximum subtree sum.\n\t\tINT ans = new INT(-9999999, root);\n\n\t\t// Call to recursive function\n\t\t// to find maximum subtree sum.\n\t\tfindLargestSubtreeSumUtil(root, ans);\n\n\t\treturn ans.n.key;\n\t}", "public static int kadaneMaxSumPrintRange(int[] nums) {\n if(nums == null || nums.length == 0) return -1;\n\n int maxSoFar = 0, maxEndingHere = 0, maxStartIdx = 0, maxEndIdx = 0, start = 0;\n for(int i = 0; i < nums.length; i++) {\n maxEndingHere += nums[i];\n\n if(maxEndingHere < 0) {\n maxEndingHere = 0;\n start = i + 1;\n } else if(maxSoFar < maxEndingHere) {\n maxSoFar = maxEndingHere;\n maxStartIdx = start;\n maxEndIdx = i;\n }\n }\n\n System.out.format(\"kadane maxSubarray start at %d, end at %d\\n\", maxStartIdx, maxEndIdx);\n System.out.println(\"kadane the maxsum is \" + maxSoFar);\n return maxSoFar;\n }", "public static void main(String[] args) throws IOException {\n int max = 100000;\n BufferedReader br = new BufferedReader(new InputStreamReader(System.in));\n\n N = Integer.parseInt(br.readLine());\n\n int arr[] = new int[max+1];\n\n for (int p=2; p<=99999; p++)\n {\n if (arr[p] == 0)\n { arr[p] = 1;\n for (int i=p*2; i<=max; i += p) {\n arr[i]++;\n }\n }\n }\n\n int mat[][] = new int[6][max+1];\n// for (int i = 2; i < arr.length; i++) {\n// mat[arr[i]][i] = 1;\n// }\n\n for (int i = 1; i < 6; i++) {\n for (int j = 2; j < mat[0].length; j++) {\n if(arr[j] == i) {\n mat[i][j] = mat[i][j - 1]+1;\n } else {\n mat[i][j] = mat[i][j - 1];\n }\n }\n }\n\n\n for (int i = 0; i < N; i++) {\n String str[] = br.readLine().split(\" \");\n int a = Integer.parseInt(str[0]);\n int b = Integer.parseInt(str[1]);\n int k = Integer.parseInt(str[2]);\n int ans = mat[k][b]-mat[k][a-1];\n System.out.println(ans);\n }\n }", "public List<List<Integer>> threeSum(int[] nums) {\n Arrays.sort(nums);\n\n Set<List<Integer>> triplets = new HashSet<List<Integer>>();\n\n for (int i = 0; i < nums.length; i++) {\n // we choose the number at index i to pinpoint\n int a = nums[i];\n int deficit = 0 - a;\n\n // initialize our two pointers such that they're at either end of the\n // array and that they're not i\n int b = i == 0 ? 1 : 0;\n int c = i == nums.length - 1 ? nums.length - 2 : nums.length - 1;\n\n while (b < c) {\n // check if b and c add up to the deficit\n if (nums[b] + nums[c] == deficit) {\n // add it to the list\n List<Integer> triplet = new ArrayList<Integer>();\n\n triplet.add(a);\n triplet.add(nums[b]);\n triplet.add(nums[c]);\n\n Collections.sort(triplet);\n if (!triplets.contains(triplet)) {\n triplets.add(triplet);\n }\n\n\n // move pointer up and down\n c -= 1;\n if (c == i) {\n c -= 1;\n }\n\n b += 1;\n if (b == i) {\n b += 1;\n }\n } else if (nums[b] + nums[c] > deficit) {\n // if it's too large, bring top pointer down\n c -= 1;\n if (c == i) {\n c -= 1;\n }\n } else {\n // if it's too small, bring bottom pointer up\n b += 1;\n if (b == i) {\n b += 1;\n }\n }\n }\n }\n\n List<List<Integer>> last = new ArrayList<List<Integer>>(triplets);\n return last;\n }", "public int sumNumbers(TreeNode root) {\n int solution = 0;\n\n String currentPath = \"\";\n\n // execute a dfs to find the leaf nodes\n findLeafNodes(root, currentPath);\n\n // loop through all the paths, convert to int, add to solution\n for(String curr:rootToLeafs){\n // save the current string as an integer\n int currentVal = Integer.parseInt(curr);\n\n // add the current value to the solution\n solution+=currentVal;\n }\n\n // return the solution\n return solution;\n }", "private static void findMaxKi67(){\n int cellNum=0;//total cells in region\n Ki67=0;//total Ki67 in region\n float maxdivR=0;//tracks maximum Ki67 over all regions\n int[] inds = {0,0};//tracks indexes of maximum ki67\n for(int i=0;i<Data.aMX;i++){//loop over regions and find max activity\n for (int j = 0; j < Data.aMY; j++) {\n if(Data.activityMesh[i][j]>maxdivR){\n maxdivR=1.f*Data.activityMesh[i][j];\n inds[0]=i;\n inds[1]=j;\n }\n }\n }\n //redefine histology section based on maximum activity area\n Pars.histX=inds[0]*Pars.histSizeX;\n Pars.histY=inds[1]*Pars.histSizeY;\n for (int i = 0; i <cells.size(); i++) {//find %ki67 within max region\n Cell cell = (Cell) cells.get(i);\n //only count mass cells within the region of interest\n if(cell.mass && cell.x>=Pars.histX && cell.x<=Pars.histX+Pars.histSizeX && cell.y>=Pars.histY && cell.y<=Pars.histY+Pars.histSizeY) {\n Ki67+=cell.ki67;//add Ki67 val in area\n cellNum+=1;//add total cells in area\n }\n }\n Functions.writeFloat(Pars.outFile+\"data/Ki.txt\",Ki67/cellNum);//write to file\n }", "public static int goldMine(int arr[][]) {\n\t\tint f[][] = new int[arr.length][arr[0].length];\n\n\t\tfor (int row = 0; row <= arr.length - 1; row++) {\n\t\t\tf[row][arr[0].length - 1] = arr[row][arr[0].length - 1];\n\t\t}\n\n\t\tfor (int col = arr[0].length - 2; col >= 0; col--) {\n\t\t\tfor (int row = 0; row <= arr.length - 1; row++) {\n\t\t\t\tif (row == 0) {\n\t\t\t\t\tint tempcost = Math.max(f[row][col + 1], f[row + 1][col + 1]);\n\t\t\t\t\tf[row][col] = arr[row][col] + tempcost;\n\t\t\t\t} else if (row == arr.length - 1) {\n\t\t\t\t\tint tempcost = Math.max(f[row][col + 1], f[row - 1][col + 1]);\n\t\t\t\t\tf[row][col] = arr[row][col] + tempcost;\n\t\t\t\t} else {\n\t\t\t\t\tint tempcost = Math.max(f[row][col + 1], f[row - 1][col + 1]);\n\t\t\t\t\ttempcost = Math.max(tempcost, f[row + 1][col + 1]);\n\t\t\t\t\tf[row][col] = arr[row][col] + tempcost;\n\t\t\t\t}\n\n\t\t\t}\n\t\t}\n\t\tint max = Integer.MIN_VALUE;\n\t\tfor (int i = 0; i <= arr.length - 1; i++) {\n\t\t\tif (f[i][0] > max) {\n\t\t\t\tmax = f[i][0];\n\t\t\t}\n\t\t}\n\t\treturn max;\n\t}", "private int go(int a[]) {\n int n = a.length;\n int maxsofar = Integer.MIN_VALUE;\n int minsofar = Integer.MAX_VALUE;\n int curmin = 0, curmax = 0, total = 0;\n int ans = 0;\n\n for (int i = 0; i < n; i++) {\n curmax = Math.max(curmax + a[i], a[i]);\n curmin = Math.min(curmin + a[i], a[i]);\n maxsofar = Math.max(maxsofar, curmax);\n minsofar = Math.min(minsofar, curmin);\n total += a[i];\n }\n\n if (maxsofar > 0) {\n ans = Math.max(maxsofar, total - minsofar);\n } else {\n ans = maxsofar;\n }\n return ans;\n }", "public static void main(String[] args) throws IOException{\n\t\tScanner sc = new Scanner(System.in);\n\t\tint n = sc.nextInt();\n\t\tint m = sc.nextInt();\n\t\tint[] array = new int[n];\n\t\tfor(int i=0;i<n;i++)\n\t\t{\n\t\t\tarray[i] = sc.nextInt();\n\t\t}\n\t\tint[][] dp = new int[n][n];\n\t\tint[][] c = new int[n][n];\n\t\tfor(int i=0;i<n;i++)\n\t\t{\n\t\t\tint count=0,max=0;\n\t\t\tfor(int j=i;j<n;j++)\n\t\t\t{\n\t\t\t\tif(j==i){\n\t\t\t\t\tdp[i][j]=array[j];\n\t\t\t\t\tcount++;\n\t\t\t\t\tc[i][j]=count;\n\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\telse{\n\t\t\t\t\tif(array[j]==array[j-1]){\n\t\t\t\t\t\tcount++;\n\t\t\t\t\t\tif(max<count) {\n\t\t\t\t\t\t\tmax =count;\n\t\t\t\t\t\t\tdp[i][j]=array[j];\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse{\n\t\t\t\t\t\tdp[i][j]=dp[i][j-1];\n\t\t\t\t\t\t}\n\t\t\t\t\t\tc[i][j]=count;\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\tcount =1;\n\t\t\t\t\t\tdp[i][j] = dp[i][j-1];\n\t\t\t\t\t\tc[i][j]=count;\n\t\t\t\t\t\t\n\t\t\t\t\t}\t\n\t\t\t\t}\n\t\t\t\t//System.out.print(dp[i][j]+\" \");\n\t\t\t}\n\t\t\t//System.out.println();\n\t\t}\n\t\t\n\t\tfor(int i=0;i<m;i++)\n\t\t{\n\t\t\tint l = sc.nextInt()-1;\n\t\t\tint r = sc.nextInt()-1;\n\t\t\tint k = sc.nextInt();\n\t\t\tif(c[l][r]>k)\n\t\t\t{\n\t\t\t\tSystem.out.println(dp[l][r]);\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tSystem.out.println(-1);\n\t\t\t}\n\t\t}\n\t}", "public static void main(String args[]) throws Exception\t{\n Scanner sc = new Scanner(new FileInputStream(\"disposal_sample.txt\"));\n\n int T = sc.nextInt();\n for(int test_case = 0; test_case < T; test_case++) {\n\n int N = sc.nextInt();\n int M = sc.nextInt();\n\n\n int[] d = new int[N];\n Queue<Integer> Q = new LinkedList<>();\n int sum = 0;\n int len = 10000;\n\n\n for(int i=0;i<N;i++){\n int input = sc.nextInt();\n Q.add(input);\n sum += input;\n while(sum >= M){\n int size = Q.size();\n\n if(len > size)\n len = size;\n sum -= Q.remove();\n }\n }\n if(len == 10000)\n len = 0;\n\n\n /*\n for(int i=0;i<N;i++) {\n d[i] = sc.nextInt();\n }\n int front = 0;\n int back = 0;\n int sum = d[back];\n int len = Integer.MAX_VALUE;\n\n while(true) {\n\n if(sum < M){\n if(back == N-1)\n break;\n back++;\n sum += d[back];\n\n }\n else{\n if(front == back){\n len = 1;\n break;\n }\n\n int tempLen = (back - front)+1;\n if(len > tempLen) {\n len = tempLen;\n }\n sum -= d[front];\n front++;\n }\n\n }*/\n Answer = len;\n System.out.println(\"Case #\"+(test_case+1));\n System.out.println(Answer);\n }\n }", "private static Pair<Integer, Integer> getMaxSumHelper(Node root) {\n\t\t\n\t\tif(root.left_ == null && root.right_ == null) {\n\t\t\treturn new Pair<Integer, Integer>(root.data_, 0);\n\t\t}\n\t\t\n\t\tPair<Integer, Integer> lp = null;\n\t\tif(root.left_ != null) {\n\t\t\tlp = getMaxSumHelper(root.left_);\n\t\t}\n\t\t\n\t\tPair<Integer, Integer> rp = null;\n\t\tif(root.right_ != null) {\n\t\t\trp = getMaxSumHelper(root.right_);\n\t\t}\n\t\t\n\t\treturn new Pair<Integer, Integer>(\n\t\t\t\tlp.getValue()+rp.getValue()+root.data_, \t// root inclusiveSum + sum of children exclusiveSum\n\t\t\t\tlp.getKey()+rp.getKey());\t\t\t\t\t// root exclusiveSum -> sum of children inclusiveSum\n\t\t\n\t}", "public static int solution(int[] A, int k, int m) {\n int[] prefix = countingPrefixSums(A);\n\n int max = 0;\n for (int i = 0; i < Math.min(k, m); i++) {\n int first = k - i;\n int last = Math.max(k, Math.min(k + (m - i * 2), A.length - 1));\n max = Math.max(max, first > 0 ? prefix[last] - prefix[first - 1] : prefix[last]);\n }\n\n return max;\n }", "public List<List<Integer>> verticalTraversal(TreeNode root) {\n map= new HashMap();\n helper(root, 0, 0);\n\n List<List<Integer>> ans = new ArrayList();\n int max = Integer.MIN_VALUE;\n for(Map.Entry<Integer, List<Integer>> entry : map.entrySet()) {\n ans.add(entry.getValue());\n int sum =0;\n for(int val:entry.getValue()) sum+=val;\n if(sum>max) max=sum;\n }\n System.out.println(\"max sum .. \"+max);\n return ans;\n }", "public static void main(String[] args) throws FileNotFoundException {\n\t\tSystem.setIn(new FileInputStream(\"농작물수확하기.txt\"));\r\n\t\tScanner sc = new Scanner(System.in);\r\n\t\t\r\n\t\tint T = sc.nextInt();\r\n\t\t\r\n\t\tfor (int t = 1; t <= T; t++) {\r\n\t\t\t\r\n\t\t\tint N = sc.nextInt();\r\n\t\t\tint[][] arr = new int[N][N];\r\n\t\t\t\r\n\t\t\tfor (int i = 0; i < N; i++) {\r\n\t\t\t\tString str = sc.next();\r\n\t\t\t\t\r\n\t\t\t\tfor (int j = 0; j < N; j++) {\r\n\t\t\t\t\tarr[i][j] = str.charAt(j) - '0';\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tint sum = 0;\r\n\t\t\tint sum1 = 0;\r\n\t\t\tint sum2 = 0;\r\n\t\t\t\r\n\t\t\tfor (int i = 0; i < N; i++) {\r\n\t\t\t\tfor (int j = Math.abs(N/2-i); j < N-Math.abs(N/2-i); j++) {\r\n\t\t\t\t\tsum1 += arr[i][j];\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t\r\n\t\t\t\r\n\t\t\t\r\n\t\t\tSystem.out.println(\"#\" + t + \" \" + sum1);\r\n\t\t\t\r\n\t\t}\r\n\t}", "@Test\r\n public void testSimpleDeadEnd() {\r\n int[][] path =\r\n {{1, 1, 0, 0, 0, 0},\r\n {0, 1, 1, 0, 0, 0},\r\n {0, 0, 1, 1, 0, 0},\r\n {0, 0, 0, 0, 0, 0},\r\n {0, 0, 0, 0, 0, 0}};\r\n assertEquals(6, RecursiveMethods.maxPathLength(path));\r\n }", "public static void main(String[] args) throws Exception {\n File file = new File(\"/Users/Alinani/Desktop/Advent-of-code-2020/Day5/src/input.txt\");\n BufferedReader br = new BufferedReader(new FileReader(file));\n String st;\n int highest = 0, column = 0, row = 0;\n while((st = br.readLine()) != null) {\n if(st.charAt(0) == 'F') {\n if(st.charAt(1) == 'F') {\n if(st.charAt(2) == 'F') {\n if(st.charAt(3) == 'F') {\n if(st.charAt(4) == 'F') {\n if(st.charAt(5) == 'F') {\n if(st.charAt(6) == 'F') {\n row = 0;\n } else if(st.charAt(6) == 'B') {\n row = 1;\n }\n } else if(st.charAt(5) == 'B') {\n if(st.charAt(6) == 'F') {\n row = 2;\n } else if(st.charAt(6) == 'B') {\n row = 3;\n }\n }\n } else if(st.charAt(4) == 'B') {\n if(st.charAt(5) == 'F') {\n if(st.charAt(6) == 'F') {\n row = 4;\n } else if(st.charAt(6) == 'B') {\n row = 5;\n }\n } else if(st.charAt(5) == 'B') {\n if(st.charAt(6) == 'F') {\n row = 6;\n } else if(st.charAt(6) == 'B') {\n row = 7;\n }\n }\n }\n } else if(st.charAt(3) == 'B') {\n if(st.charAt(4) == 'F') {\n if(st.charAt(5) == 'F') {\n if(st.charAt(6) == 'F') {\n row = 8;\n } else if(st.charAt(6) == 'B') {\n row = 9;\n }\n } else if(st.charAt(5) == 'B') {\n if(st.charAt(6) == 'F') {\n row = 10;\n } else if(st.charAt(6) == 'B') {\n row = 11;\n }\n }\n } else if(st.charAt(4) == 'B') {\n if(st.charAt(5) == 'F') {\n if(st.charAt(6) == 'F') {\n row = 12;\n } else if(st.charAt(6) == 'B') {\n row = 13;\n }\n } else if(st.charAt(5) == 'B') {\n if(st.charAt(6) == 'F') {\n row = 14;\n } else if(st.charAt(6) == 'B') {\n row = 15;\n }\n }\n }\n }\n } else if(st.charAt(2) == 'B') {\n if(st.charAt(3) == 'F') {\n if(st.charAt(4) == 'F') {\n if(st.charAt(5) == 'F') {\n if(st.charAt(6) == 'F') {\n row = 16;\n } else if(st.charAt(6) == 'B') {\n row = 17;\n }\n } else if(st.charAt(5) == 'B') {\n if(st.charAt(6) == 'F') {\n row = 18;\n } else if(st.charAt(6) == 'B') {\n row = 19;\n }\n }\n } else if(st.charAt(4) == 'B') {\n if(st.charAt(5) == 'F') {\n if(st.charAt(6) == 'F') {\n row = 20;\n } else if(st.charAt(6) == 'B') {\n row = 21;\n }\n } else if(st.charAt(5) == 'B') {\n if(st.charAt(6) == 'F') {\n row = 22;\n } else if(st.charAt(6) == 'B') {\n row = 23;\n }\n }\n }\n } else if(st.charAt(3) == 'B') {\n if(st.charAt(4) == 'F') {\n if(st.charAt(5) == 'F') {\n if(st.charAt(6) == 'F') {\n row = 24;\n } else if(st.charAt(6) == 'B') {\n row = 25;\n }\n } else if(st.charAt(5) == 'B') {\n if(st.charAt(6) == 'F') {\n row = 26;\n } else if(st.charAt(6) == 'B') {\n row = 27;\n }\n }\n } else if(st.charAt(4) == 'B') {\n if(st.charAt(5) == 'F') {\n if(st.charAt(6) == 'F') {\n row = 28;\n } else if(st.charAt(6) == 'B') {\n row = 29;\n }\n } else if(st.charAt(5) == 'B') {\n if(st.charAt(6) == 'F') {\n row = 30;\n } else if(st.charAt(6) == 'B') {\n row = 31;\n }\n }\n }\n }\n }\n } else if(st.charAt(1) == 'B') {\n if(st.charAt(2) == 'F') {\n if(st.charAt(3) == 'F') {\n if(st.charAt(4) == 'F') {\n if(st.charAt(5) == 'F') {\n if(st.charAt(6) == 'F') {\n row = 32;\n } else if(st.charAt(6) == 'B') {\n row = 33;\n }\n } else if(st.charAt(5) == 'B') {\n if(st.charAt(6) == 'F') {\n row = 34;\n } else if(st.charAt(6) == 'B') {\n row = 35;\n }\n }\n } else if(st.charAt(4) == 'B') {\n if(st.charAt(5) == 'F') {\n if(st.charAt(6) == 'F') {\n row = 36;\n } else if(st.charAt(6) == 'B') {\n row = 37;\n }\n } else if(st.charAt(5) == 'B') {\n if(st.charAt(6) == 'F') {\n row = 38;\n } else if(st.charAt(6) == 'B') {\n row = 39;\n }\n }\n }\n } else if(st.charAt(3) == 'B') {\n if(st.charAt(4) == 'F') {\n if(st.charAt(5) == 'F') {\n if(st.charAt(6) == 'F') {\n row = 40;\n } else if(st.charAt(6) == 'B') {\n row = 41;\n }\n } else if(st.charAt(5) == 'B') {\n if(st.charAt(6) == 'F') {\n row = 42;\n } else if(st.charAt(6) == 'B') {\n row = 43;\n }\n }\n } else if(st.charAt(4) == 'B') {\n if(st.charAt(5) == 'F') {\n if(st.charAt(6) == 'F') {\n row = 44;\n } else if(st.charAt(6) == 'B') {\n row = 45;\n }\n } else if(st.charAt(5) == 'B') {\n if(st.charAt(6) == 'F') {\n row = 46;\n } else if(st.charAt(6) == 'B') {\n row = 47;\n }\n }\n }\n }\n } else if(st.charAt(2) == 'B') {\n if(st.charAt(3) == 'F') {\n if(st.charAt(4) == 'F') {\n if(st.charAt(5) == 'F') {\n if(st.charAt(6) == 'F') {\n row = 48;\n } else if(st.charAt(6) == 'B') {\n row = 49;\n }\n } else if(st.charAt(5) == 'B') {\n if(st.charAt(6) == 'F') {\n row = 50;\n } else if(st.charAt(6) == 'B') {\n row = 51;\n }\n }\n } else if(st.charAt(4) == 'B') {\n if(st.charAt(5) == 'F') {\n if(st.charAt(6) == 'F') {\n row = 52;\n } else if(st.charAt(6) == 'B') {\n row = 53;\n }\n } else if(st.charAt(5) == 'B') {\n if(st.charAt(6) == 'F') {\n row = 54;\n } else if(st.charAt(6) == 'B') {\n row = 55;\n }\n }\n }\n } else if(st.charAt(3) == 'B') {\n if(st.charAt(4) == 'F') {\n if(st.charAt(5) == 'F') {\n if(st.charAt(6) == 'F') {\n row = 56;\n } else if(st.charAt(6) == 'B') {\n row = 57;\n }\n } else if(st.charAt(5) == 'B') {\n if(st.charAt(6) == 'F') {\n row = 58;\n } else if(st.charAt(6) == 'B') {\n row = 59;\n }\n }\n } else if(st.charAt(4) == 'B') {\n if(st.charAt(5) == 'F') {\n if(st.charAt(6) == 'F') {\n row = 60;\n } else if(st.charAt(6) == 'B') {\n row = 61;\n }\n } else if(st.charAt(5) == 'B') {\n if(st.charAt(6) == 'F') {\n row = 62;\n } else if(st.charAt(6) == 'B') {\n row = 63;\n }\n }\n }\n }\n }\n }\n } else if(st.charAt(0) == 'B') {\n if(st.charAt(1) == 'F') {\n if(st.charAt(2) == 'F') {\n if(st.charAt(3) == 'F') {\n if(st.charAt(4) == 'F') {\n if(st.charAt(5) == 'F') {\n if(st.charAt(6) == 'F') {\n row = 64;\n } else if(st.charAt(6) == 'B') {\n row = 65;\n }\n } else if(st.charAt(5) == 'B') {\n if(st.charAt(6) == 'F') {\n row = 66;\n } else if(st.charAt(6) == 'B') {\n row = 67;\n }\n }\n } else if(st.charAt(4) == 'B') {\n if(st.charAt(5) == 'F') {\n if(st.charAt(6) == 'F') {\n row = 68;\n } else if(st.charAt(6) == 'B') {\n row = 69;\n }\n } else if(st.charAt(5) == 'B') {\n if(st.charAt(6) == 'F') {\n row = 70;\n } else if(st.charAt(6) == 'B') {\n row = 71;\n }\n }\n }\n } else if(st.charAt(3) == 'B') {\n if(st.charAt(4) == 'F') {\n if(st.charAt(5) == 'F') {\n if(st.charAt(6) == 'F') {\n row = 72;\n } else if(st.charAt(6) == 'B') {\n row = 73;\n }\n } else if(st.charAt(5) == 'B') {\n if(st.charAt(6) == 'F') {\n row = 74;\n } else if(st.charAt(6) == 'B') {\n row = 75;\n }\n }\n } else if(st.charAt(4) == 'B') {\n if(st.charAt(5) == 'F') {\n if(st.charAt(6) == 'F') {\n row = 76;\n } else if(st.charAt(6) == 'B') {\n row = 77;\n }\n } else if(st.charAt(5) == 'B') {\n if(st.charAt(6) == 'F') {\n row = 78;\n } else if(st.charAt(6) == 'B') {\n row = 79;\n }\n }\n }\n }\n } else if(st.charAt(2) == 'B') {\n if(st.charAt(3) == 'F') {\n if(st.charAt(4) == 'F') {\n if(st.charAt(5) == 'F') {\n if(st.charAt(6) == 'F') {\n row = 80;\n } else if(st.charAt(6) == 'B') {\n row = 81;\n }\n } else if(st.charAt(5) == 'B') {\n if(st.charAt(6) == 'F') {\n row = 82;\n } else if(st.charAt(6) == 'B') {\n row = 83;\n }\n }\n } else if(st.charAt(4) == 'B') {\n if(st.charAt(5) == 'F') {\n if(st.charAt(6) == 'F') {\n row = 84;\n } else if(st.charAt(6) == 'B') {\n row = 85;\n }\n } else if(st.charAt(5) == 'B') {\n if(st.charAt(6) == 'F') {\n row = 86;\n } else if(st.charAt(6) == 'B') {\n row = 87;\n }\n }\n }\n } else if(st.charAt(3) == 'B') {\n if(st.charAt(4) == 'F') {\n if(st.charAt(5) == 'F') {\n if(st.charAt(6) == 'F') {\n row = 88;\n } else if(st.charAt(6) == 'B') {\n row = 89;\n }\n } else if(st.charAt(5) == 'B') {\n if(st.charAt(6) == 'F') {\n row = 90;\n } else if(st.charAt(6) == 'B') {\n row = 91;\n }\n }\n } else if(st.charAt(4) == 'B') {\n if(st.charAt(5) == 'F') {\n if(st.charAt(6) == 'F') {\n row = 92;\n } else if(st.charAt(6) == 'B') {\n row = 93;\n }\n } else if(st.charAt(5) == 'B') {\n if(st.charAt(6) == 'F') {\n row = 94;\n } else if(st.charAt(6) == 'B') {\n row = 95;\n }\n }\n }\n }\n }\n } else if(st.charAt(1) == 'B') {\n if(st.charAt(2) == 'F') {\n if(st.charAt(3) == 'F') {\n if(st.charAt(4) == 'F') {\n if(st.charAt(5) == 'F') {\n if(st.charAt(6) == 'F') {\n row = 96;\n } else if(st.charAt(6) == 'B') {\n row = 97;\n }\n } else if(st.charAt(5) == 'B') {\n if(st.charAt(6) == 'F') {\n row = 98;\n } else if(st.charAt(6) == 'B') {\n row = 99;\n }\n }\n } else if(st.charAt(4) == 'B') {\n if(st.charAt(5) == 'F') {\n if(st.charAt(6) == 'F') {\n row = 100;\n } else if(st.charAt(6) == 'B') {\n row = 101;\n }\n } else if(st.charAt(5) == 'B') {\n if(st.charAt(6) == 'F') {\n row = 102;\n } else if(st.charAt(6) == 'B') {\n row = 103;\n }\n }\n }\n } else if(st.charAt(3) == 'B') {\n if(st.charAt(4) == 'F') {\n if(st.charAt(5) == 'F') {\n if(st.charAt(6) == 'F') {\n row = 104;\n } else if(st.charAt(6) == 'B') {\n row = 105;\n }\n } else if(st.charAt(5) == 'B') {\n if(st.charAt(6) == 'F') {\n row = 106;\n } else if(st.charAt(6) == 'B') {\n row = 107;\n }\n }\n } else if(st.charAt(4) == 'B') {\n if(st.charAt(5) == 'F') {\n if(st.charAt(6) == 'F') {\n row = 108;\n } else if(st.charAt(6) == 'B') {\n row = 109;\n }\n } else if(st.charAt(5) == 'B') {\n if(st.charAt(6) == 'F') {\n row = 110;\n } else if(st.charAt(6) == 'B') {\n row = 111;\n }\n }\n }\n }\n } else if(st.charAt(2) == 'B') {\n if(st.charAt(3) == 'F') {\n if(st.charAt(4) == 'F') {\n if(st.charAt(5) == 'F') {\n if(st.charAt(6) == 'F') {\n row = 112;\n } else if(st.charAt(6) == 'B') {\n row = 113;\n }\n } else if(st.charAt(5) == 'B') {\n if(st.charAt(6) == 'F') {\n row = 114;\n } else if(st.charAt(6) == 'B') {\n row = 115;\n }\n }\n } else if(st.charAt(4) == 'B') {\n if(st.charAt(5) == 'F') {\n if(st.charAt(6) == 'F') {\n row = 116;\n } else if(st.charAt(6) == 'B') {\n row = 117;\n }\n } else if(st.charAt(5) == 'B') {\n if(st.charAt(6) == 'F') {\n row = 118;\n } else if(st.charAt(6) == 'B') {\n row = 119;\n }\n }\n }\n } else if(st.charAt(3) == 'B') {\n if(st.charAt(4) == 'F') {\n if(st.charAt(5) == 'F') {\n if(st.charAt(6) == 'F') {\n row = 120;\n } else if(st.charAt(6) == 'B') {\n row = 121;\n }\n } else if(st.charAt(5) == 'B') {\n if(st.charAt(6) == 'F') {\n row = 122;\n } else if(st.charAt(6) == 'B') {\n row = 123;\n }\n }\n } else if(st.charAt(4) == 'B') {\n if(st.charAt(5) == 'F') {\n if(st.charAt(6) == 'F') {\n row = 124;\n } else if(st.charAt(6) == 'B') {\n row = 125;\n }\n } else if(st.charAt(5) == 'B') {\n if(st.charAt(6) == 'F') {\n row = 126;\n } else if(st.charAt(6) == 'B') {\n row = 127;\n }\n }\n }\n }\n }\n }\n }\n\n if(st.charAt(7) == 'L') {\n if(st.charAt(8) == 'L') {\n if(st.charAt(9) == 'L') {\n column = 0;\n } else if(st.charAt(9) == 'R') {\n column = 1;\n }\n } else if(st.charAt(8) == 'R') {\n if(st.charAt(9) == 'L') {\n column = 2;\n } else if(st.charAt(9) == 'R') {\n column = 3;\n }\n }\n } else if(st.charAt(7) == 'R') {\n if(st.charAt(8) == 'L') {\n if(st.charAt(9) == 'L') {\n column = 4;\n } else if(st.charAt(9) == 'R') {\n column = 5;\n }\n } else if(st.charAt(8) == 'R') {\n if(st.charAt(9) == 'L') {\n column = 6;\n } else if(st.charAt(9) == 'R') {\n column = 7;\n }\n }\n }\n int product = row * 8;\n int sum = product + column;\n if(sum > highest) {\n highest = sum;\n }\n }\n System.out.println(highest);\n }", "public static void main(String[] args) {\n int[][] array = new int[6][6];\n int sum=0, result=0, sub=0;\n Scanner sc = new Scanner(System.in);\n //System.out.println(\"Enter array elements\")\n for(int x=0 ; x < 6; x++){\n for( int y=0; y < 6; y++) {\n array[x][y]= sc.nextInt();\n }\n }\n //System.out.println(\"Desired Sum : \")\n for( int k=0; k < 4; k++){\n for( int m=0; m < 4; m++){\n for ( int i=k; i < k+3; i++ ){\n int j=0; \n for ( j=m; j < m+3; j++){\n if( i != k+1){\n sum += array[i][j];\n }\n else{\n sum += array[i][j+1];\n break;\n }\n }\n }\n result = Math.max(result, sum);\n sum = 0; \n }\n }\n System.out.println(result);\n \n }", "public int maximalSquare(char[][] matrix) {\n if(matrix == null || matrix.length < 1) return 0;\n int[][] dp = new int[matrix.length][matrix[0].length];\n int max = 0;\n for(int i = 0; i < matrix.length; i++) {\n for(int j = 0; j < matrix[0].length; j++) {\n if(matrix[i][j] == '0') continue;\n if(i > 0 && j > 0 && dp[i - 1][j - 1] > 0) {\n int pre = dp[i - 1][j - 1];\n int cur = 1;\n while (cur <= pre && matrix[i - cur][j] == '1' && matrix[i][j - cur] == '1') cur++;\n// dp[i][j] += (cur -1);\n dp[i][j] = cur;\n }\n max = Math.max(max, dp[i][j] * dp[i][j]);\n }\n }\n return max;\n }", "public static int maxSubsetSumNoAdjacent(int[] array) {\n\t\tint[] solution = array.clone();\n\t\t\n\t\t//edge cases\n\t\tif(array.length ==0){\n\t\t\treturn 0;\n\t\t}else if(array.length==1){\n\t\t\treturn array[0];\n\t\t}\n\t\t//base case\t\t\n\t\tsolution[1] = Math.max(array[0], array[1]);\n\t\t//Dynamic programming implemntation\n\t\tfor(int i=2; i< array.length; i++){\n\t\t\tsolution[i] = Math.max((solution[i-2] + array[i]), solution[i-1]);\n\t\t\t\n\t\t}\n return solution[array.length-1];\n }", "static int hourglassSum(int[][] arr) {\n int answer = 0 ;\n\n// validatable vertexes\n// i = 1,2,3,4\n// j = 1,2,3,4\n\n int[] adjacentArrX = {-1, -1,-1,0, 1,1,1};\n int[] adjacentArrY = {-1, 0, 1, 0, -1, 0, 1};\n\n for (int i = 1; i < 5; i++) {\n for (int j = 1; j < 5; j++) {\n int nowValue = Integer.MIN_VALUE;\n for (int r = 0; r < adjacentArrX.length; r++) {\n nowValue += arr[i + adjacentArrX[r]][j + adjacentArrY[r]];\n }\n answer = Math.max(answer, nowValue);\n }\n }\n\n\n return answer;\n\n }", "public static int triangleNumber_bf(int[] nums) {\n if (nums == null || nums.length <= 2) {\n return 0;\n }\n\n int ans = 0;\n int len = nums.length;\n for (int i = 0; i < len - 2; i++) {\n if (nums[i] <= 0) {\n continue;\n }\n\n for (int j = i + 1; j < len - 1; j++) {\n if (nums[j] <= 0) {\n continue;\n }\n\n for (int k = j + 1; k < len; k++) {\n if (nums[k] <= 0) {\n continue;\n }\n\n if (nums[i] + nums[j] > nums[k] && nums[i] + nums[k] > nums[j] && nums[j] + nums[k] > nums[i]) {\n ans++;\n }\n }\n }\n }\n\n return ans;\n }", "public static void main(String[] args) {\n\t\tint[] w = { 1, 4, 3 };\n\t\tint[] val = { 1500, 3000, 2000 };\n\t\tint m = 4;\n\t\tint n = val.length;\n\t\tint[][] v = new int[n + 1][m + 1];\n\t\tint[][] path = new int[n + 1][m + 1];\n\t\tfor (int i = 0; i < v.length; i++) {\n\t\t\tv[i][0] = 0;\n\t\t}\n\t\tfor (int i = 0; i < v[0].length; i++) {\n\t\t\tv[0][i] = 0;\n\t\t}\n\t\tfor (int i = 0; i < v.length; i++) {\n\t\t\tfor (int j = 0; j < v[i].length; j++) {\n\t\t\t\tSystem.out.print(v[i][j] + \" \");\n\t\t\t}\n\t\t\tSystem.out.println();\n\t\t}\n\t\tfor (int i = 1; i < v.length; i++) {\n\t\t\tfor (int j = 1; j < v[i].length; j++) {\n\t\t\t\tif(w[i-1]>j) {\n\t\t\t\t\tv[i][j]=v[i-1][j];\n\t\t\t\t}else {\n\t\t\t\t\tif(v[i-1][j]<val[i-1]+v[i-1][j-w[i-1]]) {\n\t\t\t\t\t\tv[i][j]=val[i-1]+v[i-1][j-w[i-1]];\n\t\t\t\t\t\tpath[i][j]=1;\n\t\t\t\t\t}else {\n\t\t\t\t\t\tv[i][j]=v[i-1][j];\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tfor (int[] i:v) {\n\t\t\tSystem.out.println(Arrays.toString(i));\n\t\t}\n\t}" ]
[ "0.7146464", "0.63628376", "0.6349485", "0.6343041", "0.62747794", "0.6235742", "0.6235154", "0.62337357", "0.61999625", "0.61959076", "0.6134079", "0.6121248", "0.6098351", "0.6087609", "0.60826945", "0.60807586", "0.60788846", "0.605662", "0.6027758", "0.6009006", "0.5998814", "0.5994572", "0.5960711", "0.59438413", "0.59287244", "0.59088206", "0.58441246", "0.58351296", "0.5833104", "0.5832293", "0.581835", "0.576173", "0.57323045", "0.57316595", "0.57218695", "0.5718613", "0.5709381", "0.5706654", "0.5667303", "0.5648681", "0.5625501", "0.5609187", "0.5601518", "0.5600391", "0.5588385", "0.5581346", "0.555826", "0.55143285", "0.54853165", "0.54836816", "0.5467173", "0.54655933", "0.54614955", "0.54522383", "0.54425126", "0.5442052", "0.54308754", "0.5423996", "0.5404153", "0.5402138", "0.54011846", "0.5381074", "0.5377973", "0.53776664", "0.53768295", "0.53668326", "0.5360911", "0.5354276", "0.5346876", "0.53414685", "0.53406847", "0.53364104", "0.5319584", "0.5319478", "0.5318548", "0.5312649", "0.53106785", "0.53051764", "0.53018427", "0.530085", "0.5279897", "0.5270338", "0.52639323", "0.5252874", "0.5252707", "0.5250744", "0.52457535", "0.5241622", "0.52397037", "0.52382344", "0.52191037", "0.5214921", "0.52134603", "0.52033573", "0.5202981", "0.5200406", "0.51990885", "0.519819", "0.519517", "0.51911336", "0.5178351" ]
0.0
-1
region ========== robot callback ==========
@Override public void onReceive() { //下班充电状态 boolean isRobotWorking = RobotManager.getInstance().isRobotWorking(); int robotStatus = RobotManager.getInstance().getRobotStatus(); boolean isCancellingCharge = RobotManager.getInstance().getIsCancellingCharge(); boolean isGoing2Charge = RobotManager.getInstance().getIsGoing2Charge(); int chargeState = RobotManager.getInstance().getChargeState(); if (robotStatus == 4) { if (isRobotWorking) { translateAnimator.start(); return; } } if (!isRobotWorking && robotStatus != 4 && !isCancellingCharge) { if (chargeState == 0) { translateAnimator.cancel(); choseImage(4); return; } } if (robotStatus != 2 && RobotManager.getInstance().battery.get() != -1 && RobotManager.getInstance().battery.get() <= ConstantValue.batteryThreshold && chargeState == 0) { translateAnimator.cancel(); choseImage(4); return; } else if ((robotStatus == 2) && isRobotWorking && RobotManager.getInstance().battery.get() >= ConstantValue.batteryCeil) { //充电完成开始巡游 //上班时间 LogcatHelper.logd(StatisticsConstant.STARTMOVE, "", StatisticsConstant.WORKENDCHARGE); RobotManager.getInstance().setRobotStatus(0); translateAnimator.start(); return; } else if (robotStatus == 2 && chargeState == 0) { RobotManager.getInstance().setRobotStatus(2); translateAnimator.cancel(); choseImage(4); return; } else if (robotStatus == 3 && chargeState == 0) { translateAnimator.cancel(); choseImage(4); return; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\n\tpublic void execute(Robot robot) {\n\t}", "@Override\n public void robotInit() {\n }", "@Override\n public void robotInit() {\n }", "@Override\n public void robotInit() {\n }", "public abstract void interagir (Robot robot);", "public void robotInit() {\n\n }", "public void robotInit() {\n\n }", "public abstract void interagir(Robot robot);", "@Override\r\n protected void executeCommand(MyRobot robot) {\n }", "@Override\n public void robotPeriodic() {\n }", "@Override\n public void robotPeriodic() {\n }", "@Override\n public void robotPeriodic() {\n }", "@Override\n public void robotPeriodic() {\n }", "@Override\n public void robotPeriodic() {\n }", "@Override\n public void robotPeriodic() {\n }", "@Override\n\tpublic void onInit(RobotAPI arg0) {\n\n\t}", "@Override\n public void robotPeriodic() {\n // m_driveTrain.run(gulce);\n\n\n\n // workingSerialCom.StringConverter(ros_string, 2);\n // RoboticArm.run( workingSerialCom.StringConverter(ros_string, 2));\n }", "@Override\n\tpublic void robotPeriodic() {\n\t}", "@Override\n\tpublic void robotPeriodic() {\n\t}", "public void robotInit() {\n System.out.println(\"Default robotInit() method... Override me!\");\n }", "@Override\n public void robotInit() {\n\n // BEGIN AUTOGENERATED CODE, SOURCE=ROBOTBUILDER ID=CONSTRUCTORS\n drive = new Drive();\n pDP = new PDP();\n\n // END AUTOGENERATED CODE, SOURCE=ROBOTBUILDER ID=CONSTRUCTORS\n // OI must be constructed after subsystems. If the OI creates Commands\n //(which it very likely will), subsystems are not guaranteed to be\n // constructed yet. Thus, their requires() statements may grab null\n // pointers. Bad news. Don't move it.\n oi = new OI();\n camera1 = CameraServer.getInstance().startAutomaticCapture(0);\n camera2 = CameraServer.getInstance().startAutomaticCapture(1);\n camera1.setConnectionStrategy(VideoSource.ConnectionStrategy.kKeepOpen);\n camera2.setConnectionStrategy(VideoSource.ConnectionStrategy.kKeepOpen);\n server = CameraServer.getInstance().getServer();\n flipped = true;\n server.setSource(camera1);\n vexGyro = new AnalogGyro(0);\n vexGyro.setSensitivity(.00175);\n //rightEncoder = new Encoder(0, 1, false);\n //leftEncoder = new Encoder(2, 3, true);\n // Add commands to Autonomous Sendable Chooser\n // BEGIN AUTOGENERATED CODE, SOURCE=ROBOTBUILDER ID=AUTONOMOUS\n\n chooser.setDefaultOption(\"Autonomous Command\", new AutonomousCommand());\n PixyCamBlock centerBlock = PixyCam2.GetCentermostBlock();\n if(centerBlock == null)\n {\n SmartDashboard.putString(\"target good? \", \"no, is null\");\n }\n else{\n String out = \"Center Block, X: \"+centerBlock.xCenter + \" Y: \"+centerBlock.yCenter;\n SmartDashboard.putString(\"center block data \", out);\n if (centerBlock.yCenter < 200){\n SmartDashboard.putString(\"target good?\", \"YES!!! ycenter less than 200\");\n }\n }\n \n \n\n\n \n \n // END AUTOGENERATED CODE, SOURCE=ROBOTBUILDER ID=AUTONOMOUS\n SmartDashboard.putData(\"Auto mode\", chooser);\n SmartDashboard.putBoolean(\"isFlipped\", flipped);\n SmartDashboard.putNumber(\"right encoder\", drive.getRightEncoder());\n SmartDashboard.putNumber(\"left encoder\", drive.getLeftEncoder());\n }", "@Override\n public void robotInit() {\n // Instantiate our RobotContainer. This will perform all our button bindings, and put our\n // autonomous chooser on the dashboard.\n m_robotContainer = new RobotContainer();\n \n left_motor_1= new CANSparkMax(2,MotorType.kBrushless);\n left_motor_2=new CANSparkMax(3,MotorType.kBrushless);\n right_motor_1=new CANSparkMax(5,MotorType.kBrushless);\n right_motor_2=new CANSparkMax(6,MotorType.kBrushless);\n ball_collection_motor=new CANSparkMax(4,MotorType.kBrushless);\n left_high_eject=new CANSparkMax(1, MotorType.kBrushless);\n right_high_eject=new CANSparkMax(7,MotorType.kBrushless);\n left_belt=new TalonSRX(9);\n right_belt=new TalonSRX(11);\n left_low_eject=new TalonSRX(8);\n right_low_eject=new TalonSRX(12);\n double_solenoid_1=new DoubleSolenoid(0,1);\n joystick=new Joystick(1);\n servo=new Servo(0);\n if_correted=false;\n xbox_controller=new XboxController(0);\n servo_angle=1;\n eject_speed=0;\n go_speed=0;\n turn_speed=0;\n high_eject_run=false;\n clockwise=false;\n left_motor_1.restoreFactoryDefaults();\n left_motor_2.restoreFactoryDefaults();\n right_motor_1.restoreFactoryDefaults();\n right_motor_2.restoreFactoryDefaults();\n \n left_motor_2.follow(left_motor_1);\n right_motor_1.follow(right_motor_2);\n servo.set(0);\n currentServoAngle = 0;\n factor = 0.01;\n pushed = false;\n //right_high_eject.follow(left_high_eject);\n //right_low_eject.follow(left_low_eject);\n\n }", "@Override\n public void walk() {\n System.out.println(\"the robot is walking ... \");\n }", "@Override\n\tpublic void testInit(IRobot robot) {\n\t}", "@Override\r\n \tprotected Robot getRobot() {\t\t\r\n \t\treturn null;\r\n \t}", "public void callback() {\n }", "void robotPeriodic();", "@Override\n public void robotInit() {\n m_driveTrain = new DriveTrain();\n m_oi = new OI(); \n encoder = new Encoder();\n JoystickDrive = new JoystickDrive();\n RoboticArm = new RoboticArm();\n Science = new Science();\n pid = new PID();\n inverse = new Inverse();\n\n // workingSerialCom = new serialComWorking();\n\n\n // while(true){\n // // ros_string = workingSerialCom.read();\n // // System.out.println(ros_string);\n // LeftFront = Robot.m_driveTrain.dr+iveTrainLeftFrontMotor.getSelectedSensorVelocity()*(10/4096);\n // RightFront = Robot.m_driveTrain.driveTrainRightFrontMotor.getSelectedSensorVelocity()*(10/4096);\n // LeftFront_ros = workingSerialCom.floattosString(LeftFront);\n // RigthFront_ros = workingSerialCom.floattosString(RightFront);\n\n // ros_string = workingSerialCom.read();\n // gulce = workingSerialCom.StringConverter(ros_string, 1);\n // System.out.println(gulce);\n // workingSerialCom.write(LeftFront_ros+RigthFront_ros+\"\\n\");\n // }\n // workingSerialCom.write(\"Yavuz\\n\");\n // // RoboticArm.run();\n // // m_driveTrain.run();\n // // workingSerialCom.StringConverter(ros_string, 3);\n }", "@Override\n\tpublic void robotInit() {\n\t\toi = new OI();\n\t\tdrivebase.calibrateGyro();\n\t\tSmartDashboard.putData(\"Zero Gyro\", new ZeroGyro());\n\t\tSmartDashboard.putData(\"Calibrate Gyro - WHILE ROBOT NOT MOVING\", new CalibrateGyro());\n\t\tchooser.addDefault(\"Default Prepare Gear Auto\", new PrepareGearManipulator());\n\t\t//shooterModeChooser.addDefault(\"Shooter at Nominal Preset when Pressed\", object);\n\t\t/*chooser.addObject(\"Left Gear Auto\", new LeftGearGroup());\n\t\tchooser.addObject(\"Center Gear Auto\", new CenterGearGroup());*/\n\t//\tchooser.addObject(\"Test Vision Auto\", new TurnTillPerpVision(true));\n\t//\tchooser.addObject(\"Testing turn gyro\", new RotateToGyroAngle(90,4));\n\t\t//chooser.addObject(\"DriveStraightTest\", new GoAndReturn());\n\t\t //UNNECESSARY AUTOS FOR TESTING ^\n\t\tchooser.addObject(\"Center Gear Encoder Auto (place)\", new DriveStraightCenter());\n\t\tchooser.addObject(\"Vision center TESTING!!!\", new TurnTillPerpVision());\n\t\tchooser.addObject(\"Boiler Auto RED\", new BoilerAuto(true));\n\t\tchooser.addObject(\"Boiler Auto BLUE\", new BoilerAuto(false));\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t//\tchooser.addObject(\"Center Gear Encoder Auto (do not place )\", new DriveToFace(false, false, false));\n\t\tchooser.addObject(\"Baseline\", new DriveToLeftRightFace(false,false,false,false));\n\t\tchooser.addObject(\"TEST DRIVETANK AUTO\", new DriveTimedTank(0.7,0.7,5));\n\t\tchooser.addObject(\"Side Gear Auto RIGHT (manual straight lineup)(place)(TURN AFTER AND START CYCLE)\", new DriveStraightSide(true,false));\n\n\t\tchooser.addObject(\"Side Gear Auto LEFT (manual straight lineup)(place)(TURN AFTER AND START CYCLE)\", new DriveStraightSide(true,true));\n\t\t//chooser.addObject(\"Side Gear Auto (place)\", new DriveToLeftRightFace(true,false,false,false));\n\t\t//chooser.addObject(\"Test DriveStraight Auto\", new DriveStraightPosition(10,5));\n\t\t//chooser.addObject(\"Center Gear Encoder Auto (place)\", new DriveStraightCenter());\n\t\t/*InterpreterGroup interp = new InterpreterGroup();\n\t\t(interp.init()){\n\t\t\tchooser.addObject(\"Interpreter\",interp);\n\t\t}*/\n\t\t// chooser.addObject(\"My Auto\", new MyAutoCommand());\n\t\tSmartDashboard.putData(\"Auto Chooser\", chooser);\n\n\t\tRobot.drivebase.leftDrive1.setPosition(0);\n \tRobot.drivebase.rightDrive1.setPosition(0);\n \t\n\t\t\n \tRobot.leds.initializei2cBus();\n \tbyte mode = 0;\n \tRobot.leds.setMode(mode);\n \tgearcamera = CameraServer.getInstance();\n\t\t\n \tUsbCamera gearUsb = gearcamera.startAutomaticCapture();\n \tgearUsb.setFPS(25);\n \tgearUsb.setResolution(256, 144);\n\n\t\t//NetworkTable.setClientMode();\n \t//NetworkTable.setIPAddress(\"raspberrypi.local\");\n\t\t\n\t\t\n\t\t/*\n\t\t * new Thread(() -> { UsbCamera goalcamera =\n\t\t * CameraServer.getInstance().startAutomaticCapture();\n\t\t * goalcamera.setResolution(320, 240); goalcamera.setFPS(30);\n\t\t * goalcamera.setBrightness(1); goalcamera.setExposureManual(1);\n\t\t * \n\t\t * CvSink goalCvSink = CameraServer.getInstance().getVideo();\n\t\t * \n\t\t * Mat source = new Mat();\n\t\t * \n\t\t * while(!Thread.interrupted()) { goalCvSink.grabFrame(source);\n\t\t * goaloutputmat = source; } }).start();\n\t\t * goalPipeline.process(goaloutputmat);\n\t\t * \n\t\t * new Thread(() -> { UsbCamera gearcamera =\n\t\t * CameraServer.getInstance().startAutomaticCapture();\n\t\t * gearcamera.setResolution(320, 240); gearcamera.setFPS(30);\n\t\t * gearcamera.setBrightness(1); gearcamera.setExposureManual(1);\n\t\t * \n\t\t * CvSink gearCvSink = CameraServer.getInstance().getVideo();\n\t\t * \n\t\t * Mat source = new Mat();\n\t\t * \n\t\t * while(!Thread.interrupted()) { gearCvSink.grabFrame(source);\n\t\t * gearoutputmat = source; } }).start();\n\t\t * gearPipeline.process(gearoutputmat);\n\t\t */\n\t}", "@Override\n\tpublic void callback() {\n\t}", "@Override\n\tpublic void robotInit() {\n\t\t\n\t\t//CameraServer.getInstance().startAutomaticCapture(); //Minimum required for camera\n\t\t\n\t\t//new Thread(() -> {\n UsbCamera camera = CameraServer.getInstance().startAutomaticCapture();\n camera.setResolution(640, 480);\n camera.setWhiteBalanceAuto();\n camera.setFPS(20);\n \n //CvSink cvSink = CameraServer.getInstance().getVideo();\n //CvSource outputStream = CameraServer.getInstance().putVideo(\"Blur\", 640, 480);\n /* \n Mat source = new Mat();\n Mat output = new Mat();\n \n while(!Thread.interrupted()) {\n cvSink.grabFrame(source);\n Imgproc.cvtColor(source, output, Imgproc.COLOR_BGR2GRAY);\n outputStream.putFrame(output);\n }*/\n //}).start();\n\t\t\n\t\t\n\t\t\n\t\t/**\n\t\t * 7780 long run\n\t\t */\n\t\t\n\t\tdriverStation = DriverStation.getInstance();\n\t\t// Initialize all subsystems\n\t\tm_drivetrain = new DriveTrain();\n\t\tm_pneumatics = new Pneumatics();\n\t\t\n\t\tm_pneumatics.createSolenoid(RobotMap.PNEUMATICS.GEARSHIFT_SOLENOID, \n\n\t\t\t\tRobotMap.PNEUMATICS.SOLENOID_ID_1, \n\n\t\t\t\tRobotMap.PNEUMATICS.SOLENOID_ID_2);\n\t\t\n\t\tm_pneumatics.createSolenoid(RobotMap.PNEUMATICS.FORKLIFT_SOLENOID, RobotMap.PNEUMATICS.SOLENOID_ID_3, RobotMap.PNEUMATICS.SOLENOID_ID_4);\n\t\t\n\t\tm_forklift = new ForkLift();\n\t\tm_intake = new Intake();\n\t\tm_oi = new OI();\n\n\t\t// instantiate the command used for the autonomous period\n\t\tm_autonomousCommand = new Autonomous();\n\t\tdriverXbox = m_oi.getDriverXboxControl();\n\t\toperatorXbox = m_oi.getDriverXboxControl();\n\t\tsetupAutoCommands();\n\t\t\n\t\t//chooser.addDefault(\"Left Long\",new LeftLong());\n\t\t\n\t\t//SmartDashboard.putData(\"Auto\",chooser);\n\n\t\t// Show what command your subsystem is running on the SmartDashboard\n\t\tSmartDashboard.putData(m_drivetrain);\n\t\tSmartDashboard.putData(m_forklift);\n\t\t\n\t}", "@Override\n\tpublic void testPeriodic(IRobot robot) {\n\t}", "@Override\n public void robotInit() {\n SmartDashboard.putBoolean(\"CLIMB\", false);\n SmartDashboard.putNumber(\"servo\", 0);\n // Instantiate our RobotContainer. This will perform all our button bindings, and put our\n // autonomous chooser on the dashboard.\n m_robotContainer = new RobotContainer();\n //coast.\n if (RobotMap.DRIVE_TRAIN_DRAGON_FLY_IS_AVAILABLE)\n getRobotContainer().getDriveTrain().setCANSparkMaxMotorsState(false, RobotMap.DRIVE_TRAIN_MIDDLE_WHEEL_PORT);\n\n getRobotContainer().configureButtonBindings();\n getRobotContainer().getTecbotSensors().initializeAllSensors();\n getRobotContainer().getTecbotSensors().getTecbotGyro().reset();\n\n Robot.getRobotContainer().getDriveTrain().setCANSparkMaxMotorsState(true, RobotMap.DRIVE_TRAIN_MIDDLE_WHEEL_PORT);\n Robot.getRobotContainer().getDriveTrain().setCANSparkMaxMotorsState(true, RobotMap.DRIVE_TRAIN_LEFT_CHASSIS_PORTS);\n Robot.getRobotContainer().getDriveTrain().setCANSparkMaxMotorsState(true, RobotMap.DRIVE_TRAIN_RIGHT_CHASSIS_PORTS);\n\n UsbCamera camera = CameraServer.getInstance().startAutomaticCapture();\n camera.setResolution(640, 480);\n\n m_chooser.addOption(\"Move 3 m\", new SpeedReductionStraight(3, .75, 0));\n m_chooser.addOption(\"Rotate 90 degrees\", new SpeedReductionTurn(90, .5));\n m_chooser.setDefaultOption(\"El chido\", new DR01D3K4());\n m_chooser.addOption(\"Collect, go back and shoot\", new CollectPowerCellsGoBackShoot());\n m_chooser.addOption(\"Transport\", new SequentialCommandGroup(new FrontIntakeSetRaw(.75),\n new TransportationSystemSetRaw(.5)));\n m_chooser.addOption(\"Shoot 3PCs n' Move\", new SHOOT_3_PCs_N_MOVE());\n SmartDashboard.putData(\"Auto Mode\", m_chooser);\n\n //camera.setExposureManual(79);\n\n\n }", "public void agregarRobot(Robot robot);", "@Override\n public void robotInit()\n {\n System.out.println(\"RoboRIO initializing...\");\n\n // initialize cameras\n camFront = CameraServer.getInstance().startAutomaticCapture(0);\n camBack = CameraServer.getInstance().startAutomaticCapture(1);\n camServForward = CameraServer.getInstance().getServer();\n camServReverse = CameraServer.getInstance().getServer();\n\n camServForward.setSource(camFront);\n //camServReverse.setSource(camBack);\n\n // init joysticks\n Joystick[] joysticks = getControllers();\n\n driveTrain = new DriveTrain();\n hatchArm = new HatchArm();\n cargoArm = new CargoArm();\n ramp = new Ramp();\n\n driver1 = new Buttons(joysticks[0]);\n driver2 = new Buttons(joysticks[1]);\n\n // init gyro\n // try\n // {\n // gyro = new AHRS(I2C.Port.kOnboard);\n // }\n // catch (RuntimeException ex)\n // {\n // // DriverStation.reportError(\"Error instantiating navX-MXP: \" + ex.getMessage(),\n // // true);\n // System.out.println(\"Error initializing gyro!\");\n // }\n\n // // update gyro info on smart dashboard\n // SmartDashboard.putNumber(\"X angle\", gyro.getYaw() + 180);\n // SmartDashboard.putNumber(\"Y angle\", gyro.getPitch() + 180);\n // SmartDashboard.putNumber(\"Z angle\", gyro.getRoll() + 180);\n \n // SmartDashboard.putNumber(\"X vel\", gyro.getVelocityX());\n // SmartDashboard.putNumber(\"Y vel\", gyro.getVelocityY());\n // SmartDashboard.putNumber(\"Z vel\", gyro.getVelocityZ());\n\n // SmartDashboard.putData(gyro);\n updateVars();\n updateShuffleboard();\n\n System.out.println(\"RoboRIO initialization complete.\");\n }", "public void callback();", "@Override\n\tpublic void robotInit() //starts once when the code is started\n\t{\n\t\tm_oi = new OI(); //further definition of OI\n\t\t\n\t\t// chooser.addObject(\"My Auto\", new MyAutoCommand());\n\t\t//SmartDashboard.putData(\"Auto mode\", m_chooser);\n\t\t\n\t\tnew Thread(() -> {\n\t\t\tUsbCamera camera1 = CameraServer.getInstance().startAutomaticCapture();\n\t\t\tcamera1.setResolution(640, 480);\n\t\t\tcamera1.setFPS(30);\n\t\t\tcamera1.setExposureAuto();\n\t\t\t\n\t\t\tCvSink cvSink = CameraServer.getInstance().getVideo();\n\t\t\tCvSource outputStream = CameraServer.getInstance().putVideo(\"Camera1\", 640, 480); \n\t\t\t//set up a new camera with this name in SmartDashboard (Veiw->Add->CameraServer Stream Viewer)\n\t\t\t\n\t\t\tMat source = new Mat();\n\t\t\tMat output = new Mat();\n\t\t\t\n\t\t\twhile(!Thread.interrupted())\n\t\t\t{\n\t\t\t\tcvSink.grabFrame(source);\n\t\t\t\tImgproc.cvtColor(source, output, Imgproc.COLOR_BGR2RGB);//this will show the video in black and white \n\t\t\t\toutputStream.putFrame(output);\n\t\t\t}\t\t\t\t\t\n\t\t}).start();//definition of camera, runs even when disabled\n\t\t\n\t\tdriveStick = new Joystick(0); //further definition of joystick\n\t\tgyroRotate.gyroInit(); //initializing the gyro - in Rotate_Subsystem\n\t\tultrasonic = new Ultrasonic_Sensor(); //further definition of ultrasonic\n\t\tRobotMap.encoderLeft.reset();\n\t\tRobotMap.encoderRight.reset();\n\t\tdriveToDistance.controllerInit();\n\t}", "protected void execute() {\n \tRobot.driveTrain.keepHeadingDrive(0, 0, targetDirection);\n }", "@Override\n protected void initialize() {\n Robot.collector.open();\n }", "public void robotInit() {\r\n CommandBase.init();\r\n OI.init();\r\n System.out.println(\"ROBOT READY!\");\r\n }", "@Override\n\t\t\t\t\tpublic void onConnectionFailed(Robot arg0) {\n\n\t\t\t\t\t}", "public static void main(String[] args){\n Robot robot = new DifferentialWheels();\n\n // Get the time step of the current world.\n int timeStep = (int) Math.round(robot.getBasicTimeStep());\n\n // Get references to, and enable, all required devices on the robot.\n Lidar lidar = robot.getLidar(\"lms291\");\n lidar.enable(timeStep);\n lidar.enablePointCloud();\n\n GPS gps = robot.getGPS(\"gps\");\n gps.enable(timeStep);\n\n Emitter emitter = robot.getEmitter(\"emitter\");\n emitter.setChannel(0);\n\n Compass compass = robot.getCompass(\"compass\");\n compass.enable(timeStep);\n\n Motor frontLeft = robot.getMotor(\"front_left_wheel\");\n frontLeft.setPosition(Double.POSITIVE_INFINITY);\n Motor frontRight = robot.getMotor(\"front_right_wheel\");\n frontRight.setPosition(Double.POSITIVE_INFINITY);\n Motor backLeft = robot.getMotor(\"back_left_wheel\");\n backLeft.setPosition(Double.POSITIVE_INFINITY);\n Motor backRight = robot.getMotor(\"back_right_wheel\");\n backRight.setPosition(Double.POSITIVE_INFINITY);\n\n TestTurnPB turnPBController = new TestTurnPB(gps, compass, emitter, frontLeft, frontRight, backLeft, backRight);\n System.out.println(\"current param : \" + turnPBController.toString());\n\n //Initialise Start and Goal Coordinates\n robot.step(timeStep);\n turnPBController.updateObstacleReadings(lidar.getPointCloud());\n turnPBController.isRunning = true;\n turnPBController.initMetrics();\n turnPBController.initPositions();\n //potBugController.initAlgorithm();\n turnPBController.runInit();\n\n //Iteration Count\n int itCount = 0;\n\n while (robot.step(timeStep*100) != -1) {\n //Check max iteration\n //while (itCount<DEFAULT_MAX_ITERATION_COUNT){\n //Update Turn Angles\n turnPBController.updateAngles();\n\n //Update Sensor Information\n turnPBController.updateObstacleReadings(lidar.getPointCloud());\n\n //Check if goal is reached and terminate as appropriate\n if (turnPBController.isGoalReached()){\n turnPBController.isRunning = false;\n turnPBController.setRobotSpeed(0,0);\n turnPBController.terminatePotBug();\n System.out.println(\"Goal Reached Successfully!\");\n }\n\n if(!turnPBController.isGoalReached() && turnPBController.isRunning){\n //Check for goal direction on forwards semi-circle\n if (!turnPBController.isObstruction()){\n\n turnPBController.setDriveMode(DEFAULT_DRIVE_MODE_TOWARDS_GOAL);\n //Move 'freely' to the next sample point, towards goal\n turnPBController.updateMetrics();\n\n } else {\n\n if (turnPBController.isClearToLeave()){\n\n if (turnPBController.isProgressAttained() &&\n turnPBController.isClearToLeave()){\n\n turnPBController.setDriveMode(DEFAULT_DRIVE_MODE_TOWARDS_GOAL);\n turnPBController.updateMetrics();\n\n }\n } else {\n\n if (turnPBController.hitPoint == null){\n\n turnPBController.setHitPoint();\n turnPBController.setDriveMode(DEFAULT_DRIVE_MODE_TOWARDS_CONTOUR);\n turnPBController.updateMetrics();\n\n } else {\n\n // engaged mode\n turnPBController.setDriveMode(DEFAULT_DRIVE_MODE_ALONG_CONTOUR);\n turnPBController.updateMetrics();\n\n }\n }\n }\n }\n //}\n }\n }", "public void robotInit() {\n chooser = new SendableChooser();\n chooser.addDefault(\"Default Auto\", defaultAuto);\n chooser.addObject(\"My Auto\", customAuto);\n SmartDashboard.putData(\"Auto choices\", chooser);\n \n // camera stuff\n robotCamera = CameraServer.getInstance();\n robotCamera.setQuality(50);\n robotCamera.startAutomaticCapture(\"cam0\");\n\n //our robot stuff\n // myChassis\t= new RobotDrive(0,1);\n leftSide\t= new VictorSP(1);\n rightSide\t= new VictorSP(0);\n spinWheels\t= new TalonSRX(2);\n armLifty\t= new TalonSRX(3);\n drivePad\t= new Joystick(0);\n statesPad\t= new Joystick(1);\n LiveWindow.addActuator(\"stud\", \"talonsrx\", armLifty);\n \n //arm position stuff\n armPosition\t\t= new AnalogInput(0);\n armPortSwitch\t= new DigitalInput(0);\n \n //solenoid stuff\n //solenoidThing = new Solenoid(1);\n \n //init button states\n lBPX\t\t\t= false;\n bIPX\t\t\t= false;\n \n //driver buttons\n ballSpitButton\t= 4;\n ballSuckButton\t= 2;\n \n //state machine variables\n defaultState\t\t= 0;\n portState\t\t\t= 1;\n chevellState\t\t= 2;\n ballGrabState\t\t= 10;\n driveState\t\t\t= 11;\n lowBarState\t\t\t= 8;\n rockState\t\t\t= driveState;\n roughState\t\t\t= driveState;\n moatState\t\t\t= driveState;\n rampartState\t\t= driveState;\n drawState\t\t\t= driveState;\n sallyState\t\t\t= driveState;\n liftOverride\t\t= 0.09;\n terrainStates\t\t= 0;\n autoLiftSpeed\t\t= 1.0;\n armLiftBuffer\t\t= 0.01;\n //port state variables\n portPosition1\t\t= 1.7;\n portPosition2\t\t= 0.9;\n portSwitch\t\t\t= 0;\n //chevell state variables\n chevellPosition1\t= 1.135;\n chevellPosition2\t= 2.0;\n chevellSwitch \t\t= 0;\n chevellWheelSpeed\t= 0.3;\n //ball grab state variables\n ballGrabPosition1\t= 1.35;\n ballGrabSwitch\t\t= 0;\n ballGrabWheelSpeed\t= -0.635;\n ballSpitWheelSpeed\t= 1.0;\n //lowbar state variables\n lowBarPosition\t\t= 1.6;\n lowBarSwitch\t\t= 0;\n //drive state variables\n driveSwitch\t\t\t= 1;\n \n }", "@Override\n\tpublic void robotInit() {\n\t\toi = new OI();\n\t\t\n\t\t// chooser.addObject(\"My Auto\", new MyAutoCommand());\n\t\tSmartDashboard.putData(\"Auto mode\", chooser);\n\t\tSystem.out.println(\"I am here\");\n\t\ttopRight = new CANTalon(1);\n\t\tmiddleRight = new CANTalon(3);\n\t\tbottomRight = new CANTalon(2);\n\t\ttopLeft = new CANTalon(5);\n\t\tmiddleLeft = new CANTalon(6);\n\t\tbottomLeft = new CANTalon(7);\n\t\tclimber = new CANTalon(4);\n\t\tshifter = new DoubleSolenoid(2,3);\n\t\tshifter.set(Value.kForward);\n\t\tbucket= new DoubleSolenoid(0, 1);\n\t\tclimber.reverseOutput(true);\n\t\t//Setting Followers\n\t\t//topRight is Right Side Master (TalonSRX #1)0.062, 0.00062, 0.62)\n\t\t//middleRight.reset();\n//\t\tmiddleRight.setProfile(0);\n//\t\tmiddleRight.setPID( 0.0, 0.0, 0.0);//TODO: make multiple profiles\n\t\t\n//\t\tmiddleRight.setFeedbackDevice(FeedbackDevice.CtreMagEncoder_Absolute);\n//\t\tmiddleRight.setEncPosition(0);\n//\t\tmiddleRight.setAllowableClosedLoopErr(10);\n\t\tmiddleRight.reverseSensor(true);\n//\t\tmiddleRight.configNominalOutputVoltage(+0f, -0f);\n//\t\tmiddleRight.configPeakOutputVoltage(+12f, -12f);\n\t\ttopRight.changeControlMode(TalonControlMode.Follower);\n\t\ttopRight.set(middleRight.getDeviceID());\n\t\ttopRight.reverseOutput(true);\n\t\tbottomRight.changeControlMode(TalonControlMode.Follower); //TalonSRX #3\n\t\tbottomRight.set(middleRight.getDeviceID());\n//\t\tmiddleRight.setProfile(1);\n//\t\tmiddleRight.setPID( 0.0, 0.0, 0.0);\n\t\t//climber is the climber Motor (TalonSRX #4)\n\t\t//TopLeft is Right Side Master (TalonSRX #5)\n\t\t//middleLeft.reset();\n\t\t//middleLeft.setProfile(0);\n//\t\tmiddleLeft.setPID(0.0, 0.00, 0.0);\n//\t\tmiddleLeft.setEncPosition(0);\n//\t\tmiddleLeft.setFeedbackDevice(FeedbackDevice.CtreMagEncoder_Absolute);\n//\t\tmiddleLeft.configNominalOutputVoltage(+0f, -0f);\n//\t\tmiddleLeft.configPeakOutputVoltage(+12f, -12f);\n\t\tmiddleLeft.reverseSensor(false);\n//\t\tmiddleLeft.setAllowableClosedLoopErr(10);\n\t\ttopLeft.changeControlMode(TalonControlMode.Follower); //TalonSRX #6\n\t\ttopLeft.set(middleLeft.getDeviceID());\n\t\ttopLeft.reverseOutput(true);\n\t\tbottomLeft.changeControlMode(TalonControlMode.Follower); //TalonSRX #7\n\t\tbottomLeft.set(middleLeft.getDeviceID());\n//\t\tmiddleLeft.setProfile(1);\n//\t\tmiddleLeft.setPID(0, 0, 0);\n\t\t//Sensors\n\t\timu = new ADIS16448IMU();\n\t\tclimberSubsystem = new ClimberSubsystem();\n\t\tbucketSubsystem = new BucketSubsystem();\n\t\tdriveSubsystem = new DriveSubsystem();\n\t}", "@Override\n public void robotInit() {\n\toi = new OI();\n\tgameData = new GameData();\n\tcubeVision.start();\n\n\tinitializeDashboard();\n }", "@Override\n public void runOpMode() {\n telemetry.addData(\"Status\", \"Simple Ready to run\"); //\n telemetry.update();\n telemetry.addData(\"Status\", \"Initialized\");\n\n /**\n * Initializes the library functions\n * Robot hardware and motor functions\n */\n robot = new Robot_1617(hardwareMap);\n motorFunctions = new MotorFunctions(-1, 1, 0, 1, .05);\n\n //servo wheels are flipped in configuration file\n robot.servoLeftWheel.setPosition(.45);\n robot.servoRightWheel.setPosition(.25);\n\n robot.servoLeftArm.setPosition(0);\n robot.servoRightArm.setPosition(0.7);\n\n robot.servoFlyAngle.setPosition(1);\n\n robot.servoElbow.setPosition(0.95);\n robot.servoShoulder.setPosition(0.1);\n\n robot.servoFeed.setPosition(.498);\n\n robot.servoPlaid.setPosition(.85);\n\n telemetry.addData(\"Servos: \", \"Initialized\");\n // Wait for the game to start (driver presses PLAY)\n waitForStart();\n\n sleep(5000);\n robot.motorLift.setPower(0);\n robot.servoFlyAngle.setPosition(0);\n sleep(500);\n robot.motorFlyLeft.setPower(.9);\n robot.motorFlyRight.setPower(1);\n sleep(250);\n robot.motorIntakeElevator.setPower(1);\n robot.servoFeed.setPosition(-1);\n telemetry.addData(\"Status\", \"Shooting\"); //\n telemetry.update();\n sleep(5000);\n robot.motorFlyLeft.setPower(0);\n robot.motorFlyRight.setPower(0);\n// sleep(5000); //no idea why this is here\n robot.motorIntakeElevator.setPower(0);\n robot.servoFeed.setPosition(.1);\n sleep(250);\n\n telemetry.addData(\"Status\", \"Driving\");\n telemetry.update();\n encoderDrive(1.0, 30, 30, 1);\n\n encoderDrive(1.0, 35, 35, 1);\n }", "public void robotInit() \n {\n RobotMap.init();\n\n driveTrain = new DriveTrain();\n gripper = new Gripper();\n verticalLift = new VerticalLift();\n\n // OI must be constructed after subsystems. If the OI creates Commands \n //(which it very likely will), subsystems are not guaranteed to be \n // constructed yet. Thus, their requires() statements may grab null \n // pointers. Bad news. Don't move it.\n\n oi = new OI();\n\n autonomousChooser = new SendableChooser();\n autonomousChooser.addDefault( \"Auto: Do Nothing\" , new DoNothing () );\n autonomousChooser.addObject ( \"Auto: Drive To Auto Zone\" , new DriveToAutoZone () );\n autonomousChooser.addObject ( \"Auto: Drive To Auto Zone (Bump)\" , new DriveToAutoZoneBump () );\n //autonomousChooser.addObject ( \"Auto: Get One (Long)\" , new GetOneLong () );\n //autonomousChooser.addObject ( \"Auto: Get One (Short)\" , new GetOneShort () );\n //autonomousChooser.addObject ( \"Auto: Get One Recycle Bin (Bump)\" , new GetOneRecycleBin () );\n autonomousChooser.addObject ( \"Auto: Get One Recycle Bin (Side)\" , new GetRecycleBinSide () );\n //autonomousChooser.addObject ( \"Auto: Get One Recycle Bin (Backwards)\" , new GetOneRecycleBinBackwards () );\n //autonomousChooser.addObject ( \"Auto: Get One Recycle Bin (Backwards, Bump)\", new GetOneRecycleBinBackwardsBump() );\n //autonomousChooser.addObject ( \"Auto: Get Two (Short)\" , new GetTwoShort () );\n //autonomousChooser.addObject ( \"Auto: Get Two Short (Special)\" , new GetTwoShortSpecial () );\n //autonomousChooser.addObject ( \"Auto: Get Two (Long, From left)\" , new TwoLongFromLeft () );\n //autonomousChooser.addObject ( \"Auto: Get Two (Long, From right)\" , new TwoLongFromRight () );\n autonomousChooser.addObject ( \"Auto: Get One Tote and Recycle Bin\" , new OneRecycleBinAndTote () );\n autonomousChooser.addObject ( \"Auto: Get One Tote and Recycle Bin (Bump)\" , new OneRecycleBinAndToteBump () );\n SmartDashboard.putData( \"Autonomous\", autonomousChooser );\n\n // instantiate the command used for the autonomous period\n //autonomousCommand = new RunAutonomousCommand();\n\n m_USBVCommand = new UpdateSBValuesCommand();\n m_USBVCommand.start();\n \n frame = NIVision.imaqCreateImage(NIVision.ImageType.IMAGE_RGB, 0);\n /*\n // the camera name (ex \"cam0\") can be found through the roborio web interface\n session = NIVision.IMAQdxOpenCamera(\"cam1\",\n NIVision.IMAQdxCameraControlMode.CameraControlModeController);\n NIVision.IMAQdxConfigureGrab(session);\n \n NIVision.IMAQdxStartAcquisition(session);\n */\n /*\n camServer = CameraServer.getInstance();//.startAutomaticCapture(\"cam1\");\n camServer.setQuality(30);\n \n cam = new USBCamera(\"cam1\");\n cam.openCamera();\n cam.setFPS(60);\n \n cam.setSize(320, 240);\n cam.updateSettings();\n */\n }", "@Override\n public void runOpMode() {\n hw = new RobotHardware(robotName, hardwareMap);\n rd = new RobotDrive(hw);\n rs=new RobotSense(hw, telemetry);\n /*rd.moveDist(RobotDrive.Direction.FORWARD, .5, .3);\n rd.moveDist(RobotDrive.Direction.REVERSE, .5, .3);\n rd.moveDist(RobotDrive.Direction.FORWARD, .5, 1);\n rd.moveDist(RobotDrive.Direction.REVERSE, .5, 1);*/\n telemetry.addData(\"Ready! \", \"Go Flamangos!\"); \n telemetry.update();\n\n //Starting the servos in the correct starting position\n /*hw.armRight.setPosition(1-.3);\n hw.armLeft.setPosition(.3);\n hw.level.setPosition(.3+.05);*/\n hw.f_servoLeft.setPosition(1);\n hw.f_servoRight.setPosition(0.5);\n \n rd.moveArm(hw.startPos());\n waitForStart();\n while (opModeIsActive()) {\n \n /*Starting close to the bridge on the building side\n Move under the bridge and push into the wall*/\n rd.moveDist(RobotDrive.Direction.LEFT,2,.5);\n rd.moveDist(RobotDrive.Direction.FORWARD, 10, .5);\n break;\n }\n }", "@Override\n\t\t\tpublic void callbackCall() {\n\t\t\t}", "public void onScannedRobot(ScannedRobotEvent e ) {\n\t\t// Replace the next line with any behavior you would like\n \n \n \n if (target==e.getName()) {\n \tdouble absBearing = e.getBearingRadians() + getHeadingRadians();\n \tsetTurnGunRightRadians(\n \t Utils.normalRelativeAngle(absBearing - \n \t getGunHeadingRadians())\n \t );\n \tfire(1);\n } else if (target==\"NULLNULLNULL\" ) {\n \ttarget=e.getName();\n }\n \n\t\tout.println(\"\\ntarget \"+target+\n\t\t\t\t\t\"\\nmy change \"+\n\t\t\t\t\t\"\\nmy radar \"+getRadarHeadingRadians());\n\t\t\n\t\t\n\t}", "@Override\n public void robotInit() {\n m_chooser.setDefaultOption(\"Default Auto\", kDefaultAuto);\n m_chooser.addOption(\"My Auto\", kCustomAuto);\n SmartDashboard.putData(\"Auto choices\", m_chooser);\n SmartDashboard.putData(leftMotor1);\n SmartDashboard.putData(leftMotor2);\n SmartDashboard.putData(rightMotor1);\n SmartDashboard.putData(rightMotor2);\n SmartDashboard.putData(firstMotor);\n SmartDashboard.putData(secondMotor);\n \n\n\n\n }", "Lift(final Robot ROBOT)\n {\n _robot = ROBOT;\n }", "protected void execute() {\n \tRobot.driveTrain.driveByArcade(_speed, 0);\n }", "@Override\n protected void execute() {\n Robot.driveTrain.drive(Robot.oi.joystick);\n }", "@Override\n protected void execute() {\n Robot.driveTrain.tankDrive(1);\n }", "@Override\n\t\t\t\t\t\t\t\t\tpublic void callback(int position) {\n\n\t\t\t\t\t\t\t\t\t}", "void robotStop();", "public Atendiendo(Robot robot){\n this.robot = robot;\n }", "public void handleSimStatusCompleted() {\n }", "@Override\n public void robotInit() {\n m_chooser.setDefaultOption(\"Default Auto\", kDefaultAuto);\n m_chooser.addOption(\"My Auto\", kCustomAuto);\n SmartDashboard.putData(\"Auto choices\", m_chooser);\n \n //Initialize Drive Train Motors/\n LeftFront = new WPI_TalonSRX(11);\n RightFront = new WPI_TalonSRX(13);\n LeftBack = new WPI_TalonSRX(10);\n RightBack = new WPI_TalonSRX(12);\n RobotDT = new MecanumDrive(LeftFront, LeftBack, RightFront, RightBack);\n \n //Initialize Xbox Controller or Joystick/\n xcontroller1 = new XboxController(0);\n xcontroller2 = new XboxController(1);\n \n //Initialize Cameras/\n RoboCam = CameraServer.getInstance();\n FrontCamera = RoboCam.startAutomaticCapture(0);\n BackCamera = RoboCam.startAutomaticCapture(1);\n\n //GPM Init/\n mGPM = new GPM();\n \n }", "protected void execute() {\n \tRobot.driveTrain.arcadeNoConstants(MOVE_SPEED_PERCENT, Robot.driveTrain.gyroPReturn(direction));\n }", "@Override\n\tpublic void robotInit() {\n\t\tdrive = new Drive();\n\t\tintake = new Intake();\n\t\tshooter = new Shooter();\n\t\taimShooter = new AimShooter();\n\t\tvision = new Vision();\n\t\tintakeRoller = new IntakeRoller();\n\t\taManipulators = new AManipulators();\n\t\tshooterLock = new ShooterLock();\n\n\t\t// autochooser\n\t\t// autoChooser = new SendableChooser();\n\n\t\toi = new OI();\n\t\t// instantiate the command used for the autonomous period\n\t\tlowGearCommand = new LowGear();\n\n\t\t// auto chooser commands\n\t\t// autoChooser.addDefault(\"FarLeftAuto\", new FarLeftAuto());\n\t\t// autoChooser.addObject(\"MidLeftAuto\", new MidLeftAuto());\n\t\t// autoChooser.addObject(\"MidAuto\", new MidAuto());\n\t\t// autoChooser.addObject(\"MidRightAuto\", new MidRightAuto());\n\t\t// autoChooser.addObject(\"FarRightAuto\", new FarRightAuto());\n\t\t// autoChooser.addObject(\"Uber Auto\", new UberAuto());\n\t\t// autoChooser.addObject(\"Paper Weight\", new PaperWeightAuto());\n\t\t//\n\t\t// SmartDashboard.putData(\"Autonomous\", autoChooser);\n\n\t\t// autonomousCommand = (Command) autoChooser.getSelected();\n\t\tautonomousCommand = new FarLeftAuto();\n\t\t// autonomousCommand = new MidAuto();\n\t\t// CameraServer.getInstance().startAutomaticCapture(\"cam3\");\n\t\t// autonomousCommand = new FarLeftAuto\n\n\t\tpovUpTrigger.whenActive(new MoveActuatorsUp());\n\t\tpovDownTrigger.whenActive(new MoveActuatorsDown());\n\t}", "void deployRobot(){\n\n //Robot going down\n //Can be omitted if for test purposes\n if(!autonomonTesting) {\n while (robot.mechLiftLeft.getCurrentPosition() < robot.MAX_LIFT_POSITION &&\n robot.mechLiftRight.getCurrentPosition() < robot.MAX_LIFT_POSITION && !isStopRequested()) {\n robot.liftMovement(robot.LIFT_SPEED, false);\n }\n telemetry.addData(\"Lift Position\", robot.mechLiftLeft.getCurrentPosition());\n }\n else{\n telemetry.addLine(\"Tesint mode, without lift\");\n }\n robot.liftMovement(0, false);\n telemetry.update();\n\n\n //tensor activation\n if (tfod != null) {\n tfod.activate();\n }\n\n //moving to get in position for TensorFlow scan\n\n //out of the hook\n robot.setDrivetrainPosition(-300, \"translation\", .6);\n\n //away from the lander\n robot.setDrivetrainPosition(800, \"strafing\", .3);\n\n //back to initial\n robot.setDrivetrainPosition(300, \"translation\", .6);\n\n }", "@Override\n protected void execute() {\n Robot.tapeAlignSys.enable();\n Robot.lidarAlignSys.enable();\n if (Robot.useDrive) {\n double joy_vals[] = Robot.oi.getJoyXYZ(joy);\n\n double x = joy_vals[0];\n double y = joy_vals[1] * m_forward_speed_limit;\n double z = joy_vals[2] * .5;\n\n if (!joy.getRawButton(5)) { // Button 5 is pid override\n // Get sensor feedback for strafe\n x = .5 * x + Robot.tapeAlignSys.get_pid_output();\n if (x > 1) { x = 1; }\n if (x < -1) { x= -1; }\n\n double distance = Robot.stormNetSubsystem.getLidarDistance();\n SmartDashboard.putNumber(\"Lidar distance (cm)\",distance);\n\n // Get Lidar alignment for Z axis\n// if (z < 100) { // only align if close\n// z = z + Robot.lidarAlignSys.get_pid_output();\n// if (z > 1) { z = 1; }\n// if (z < -1) { z= -1; }\n// }\n\n if (distance < m_distance_scale_factor) {\n // Modulate driver forward input\n if (y > 0 && distance < (m_target_distance + m_distance_scale_factor)) {\n y = y * ((distance - m_target_distance)/(m_distance_scale_factor)) ;\n if (y<0) y = 0;\n } \n }\t\n }\n Robot.drive.driveArcade(x,y,z);\n }\n }", "@Override\n protected void execute() {\n\n //directly map the speed from the joystick to the robot motor controllers. \n double leftSpeed = Robot.m_oi.leftJoystickY(Robot.m_oi.driverController);\n double rightSpeed = Robot.m_oi.rightJoystickY(Robot.m_oi.driverController);\n\n //provide a tolernce from the joystick input. \n //Some times if your not touching it it may read a very small value. We dont want the robot to think we are trying to drive it.\n double tolerance = 0.05;\n if(leftSpeed < tolerance && leftSpeed > -tolerance ){\n leftSpeed = 0.0;\n }\n if(rightSpeed < tolerance && rightSpeed > -tolerance){\n rightSpeed = 0.0;\n }\n\n //speed reduction\n if (Robot.m_oi.RB.get()) {\n releaseR = false;\n } else{\n if(releaseR == false) {\n toggleR = !toggleR;\n if (gear < MAXGEAR) {\n gear++;\n }\n releaseR = true;\n }\n }\n if (Robot.m_oi.LB.get()) {\n releaseL = false;\n } else{\n if(releaseL == false) {\n toggleL = !toggleL;\n if (gear > MINGEAR) {\n gear--;\n }\n releaseL = true;\n }\n }\n if (gear == 1){\n leftSpeed*=0.75;\n rightSpeed*=0.75;\n }\n if(gear == 2){\n leftSpeed*=0.5;\n rightSpeed*=0.5;\n }\n if(gear == 3){\n leftSpeed*=0.25;\n rightSpeed*=0.25;\n }\n Robot.WriteOut(\"Gear #: \" + gear);\n SmartDashboard.putNumber(\"gear\", gear );\n\n\n //pass the desired speed to the drive substem and make robot go!\n Robot.drive_subsystem.drive(-leftSpeed, -rightSpeed);\n }", "@Override\n protected void execute() \n {\n move(Robot.oi.mechJoystick);\n }", "@Override\n\tpublic void robotInit() {\n\t\tleftDriveBack = new VictorSP(0); // PWM Port, madke sure this is set correctly.\n\t\tleftDriveFront = new VictorSP(1);\n\t\t\n\t\trightDriveFront = new VictorSP(2);\n\t\trightDriveBack = new VictorSP(3);\n\t\t\n\t\tleftIntake = new Spark(5);\n\t\trightIntake = new Spark(6);\n\t\t\n\t\tarmMotor = new TalonSRX(10);\n\t\tarmMotor.setNeutralMode(NeutralMode.Brake);\n\t\tarmMotor.configSelectedFeedbackSensor(FeedbackDevice.CTRE_MagEncoder_Absolute, 0, 0);\n\t\tarmMotor.configPeakCurrentLimit(30, 0);\n\t\tarmMotor.configPeakCurrentDuration(250, 0);\n\t\tarmMotor.configContinuousCurrentLimit(20, 0);\n\t\tarmMotor.configClosedloopRamp(0.25, 0);\n\t\tarmMotor.configOpenloopRamp(0.375, 0);\n\t\tarmMotor.enableCurrentLimit(true);\n\t\t\n\t\tarmMotor.configPeakOutputForward(1.0, 0);\n\t\tarmMotor.configPeakOutputReverse(-1.0, 0);\n\t\t\n\t\tarmMotor.config_kP(0, 0.0, 0);\n\t\t\n\t\tarmSetpoint = armMotor.getSelectedSensorPosition(0);\n\t\t\n\t\tstick = new Joystick(0);\n\t\tstickReversed = false;\n\t\txbox = new XboxController(1); // USB port, set in driverstation.\n\t\t\n\t\tdriveCamera = CameraServer.getInstance().startAutomaticCapture(0);\n\t}", "protected void execute() {\n\t\t//System.out.println(\"Hello\");\n\t\tdouble rightVal = HumanInput.getJoystickAxis(HumanInput.rightJoystick,\n\t\t\t\tAxisType.kY);\n\t\t\n\t\tRobot.driveSys.set(rightVal, Robot.driveSys.talonFrontRight);\n\t\tRobot.driveSys.set(rightVal, Robot.driveSys.talonBackRight);\n\n\t\t\n\n\t\tdouble leftVal = HumanInput.getJoystickAxis(HumanInput.leftJoystick, AxisType.kY);\n\t\t\n\t\tRobot.driveSys.set(-leftVal, Robot.driveSys.talonFrontLeft);\n\t\tRobot.driveSys.set(-leftVal, Robot.driveSys.talonBackLeft);\n\t\t\n\t}", "protected void execute() {\n \tdouble currentAngle = driveTrain.gyro.getYaw();\n \tdriveTrain.drive.arcadeDrive(speed, 0);\n }", "public void robotInit() {\n // North.registerCommand(\"setSetpoint\", (params) -> ??, [\"Setpoint\"]);\n // North.registerCondition(\"atSetpoint\", elevator::atSetpoint);\n\n //NOTE: init(name, size, logic provider, drive & nav)\n North.init(/*NorthUtils.readText(\"name.txt\")*/ \"lawn chair\", 24/12, 24/12, drive);\n North.default_drive_controller = HoldController.I;\n\n UsbCamera camera = CameraServer.getInstance().startAutomaticCapture();\n camera.setResolution(640, 480);\n }", "@Override\n\tpublic void onSimulationComplete()\n\t{\n\t}", "@Override\n public void init() {\n telemetry.addData(\"Status\", \"Initialized\");\n\n // Initialize the hardware variables. Note that the strings used here as parameters\n // to 'get' must correspond to the names assigned during the robot configuration\n // step (using the FTC Robot Controller app on the phone).\n\n VinceHardwareBruinBot robot = new VinceHardwareBruinBot();\n // Inititalize last wheel speed\n for (int i = 0; i < lastwheelSpeeds.length; i++){\n lastwheelSpeeds[i] = 0;\n }\n robot.init(hardwareMap);\n {\n //init all drive wheels\n leftFrontDrive = robot.leftFrontDrive;\n rightFrontDrive = robot.rightFrontDrive;\n leftRearDrive = robot.leftRearDrive;\n rightRearDrive = robot.rightRearDrive;\n\n // init all other motors & servos\n intakeMotor = robot.intakeMotor;\n wobbleMotor = robot.wobbleMotor;\n ringShooterMotor = robot.ringShooterMotor;\n\n fireServo = robot.fireServo;\n\n //init imu\n imu = robot.imu;\n }\n initVuforiaNavigation();\n\n // Reset the wobble motor - Use a repeatable starting position\n wobbleMotor.setMode(DcMotor.RunMode.STOP_AND_RESET_ENCODER);\n /*\n // Get PID constants for wobble motor\n int motorIndex = ((robot.wobbleMotor).getPortNumber());\n DcMotorControllerEx motorControllerEx = (DcMotorControllerEx)robot.wobbleMotor.getController();\n PIDCoefficients pidModified = motorControllerEx.getPIDCoefficients(motorIndex, DcMotor.RunMode.RUN_TO_POSITION);\n\n // change coefficients using methods included with DcMotorEx class.\n PIDCoefficients pidNew = new PIDCoefficients(10, 2, 3);\n motorControllerEx.setPIDCoefficients(motorIndex, DcMotor.RunMode.RUN_TO_POSITION, pidNew);\n */\n //wobbleMotor.setPIDFCoefficients(DcMotor.RunMode.RUN_TO_POSITION,pidNew);\n // Tell the driver that initialization is complete.\n telemetry.addData(\"Status\", \"Initialized\");\n }", "public void implement(){\n this.rb.moveForward(1);\n \n \n if(this.rb.canPickThing()){\n this.rb.pickThing();\n }\n\n //turn the rb 90 degree to the south\n this.rb.turnLeft();\n\n //move the navigator 1 step ahead per move()\n this.rb.moveForward(1);\n\n //turn the navigator 90 degree to the east\n this.rb.turnRight();\n\n //move the navigator 1 step ahead per move()\n this.rb.moveForward(1);\n\n //turn the navigator 90 degree to the north\n this.rb.turnLeft();\n\n //move the navigator\n this.rb.moveForward(2);\n\n //turn Right the robot\n this.rb.turnRight();\n\n //stop at the starting position per move()\n this.rb.moveForward(1); \n \n this.rb.putThing();\n \n //move the navigator 1 step ahead per move()\n this.rb.moveForward(1);\n \n //turn the navigator 90 degree to the west\n this.rb.turnRight();\n \n this.rb.moveForward(1);\n \n this.rb.turnLeft();\n \n this.rb.moveForward(1);\n \n this.rb.turnRight();\n \n this.rb.moveForward(2);\n \n this.rb.turnLeft();\n }", "@Override\n public void robotInit() {\n m_oi = new OI();\n m_chooser.setDefaultOption(\"Default Auto\", new ExampleCommand());\n // chooser.addOption(\"My Auto\", new MyAutoCommand());\n SmartDashboard.putData(\"Auto mode\", m_chooser);\n\n Comp = new Compressor();\n\n //ClimbBack = new DoubleSolenoid(PCM_COMP_24V, 0, 1);\n //ClimbFront = new DoubleSolenoid(PCM_COMP_24V, 2, 3);\n LegFrontL = new VictorSPX(30);\n LegFrontR = new Spark(9);\n LegBackL = new VictorSPX(31);\n LegBackR = new VictorSPX(32);\n\n BackFootMover = new VictorSP(1);\n FrontFootMover = new Spark(2);\n //FeetMovers = new SpeedControllerGroup(BackFootMoverFootMover);\n\n MainRight = new CANSparkMax(9, MotorType.kBrushless);\n AltRight = new CANSparkMax(10, MotorType.kBrushless);\n MainLeft = new CANSparkMax(11, MotorType.kBrushless);\n AltLeft = new CANSparkMax(12, MotorType.kBrushless);\n\n MainRight.setIdleMode(IdleMode.kCoast);\n AltRight.setIdleMode(IdleMode.kCoast);\n MainLeft.setIdleMode(IdleMode.kCoast);\n AltLeft.setIdleMode(IdleMode.kCoast);\n\n AltLeft.follow(MainLeft);\n AltRight.follow(MainRight);\n\n Drive = new DifferentialDrive(MainLeft, MainRight);\n\n Lifter = new TalonSRX(6);\n Lifter.setNeutralMode(NeutralMode.Brake);\n Lifter.enableCurrentLimit(false);\n /*Lifter.configContinuousCurrentLimit(40);\n Lifter.configPeakCurrentLimit(50);\n Lifter.configPeakCurrentDuration(1500);*/\n //Lifter.configReverseSoftLimitEnable(true);\n //Lifter.configReverseSoftLimitThreshold(-27000);\n //Lifter.configForwardLimitSwitchSource(LimitSwitchSource.FeedbackConnector, LimitSwitchNormal.NormallyOpen);\n //Lifter.configClearPositionOnLimitF(true, 0);\n Lifter.selectProfileSlot(0, 0);\n LiftSetpoint = 0;\n\n LiftFollower = new TalonSRX(5);\n LiftFollower.follow(Lifter);\n LiftFollower.setNeutralMode(NeutralMode.Brake);\n\n ArmExtender = new Solenoid(0);\n ArmOpener = new Solenoid(1);\n ArmGrippers = new Spark(0);\n\n HatchSwitch0 = new DigitalInput(0);\n HatchSwitch1 = new DigitalInput(1);\n\n Accel = new BuiltInAccelerometer(Range.k2G);\n\n //Diagnostics = new DiagnosticsLogger();\n // Uncomment this line to enable diagnostics. Warning: this may\n // cause the robot to be slower than it is supposed to be because of lag.\n //Diagnostics.start();\n\n xbox = new XboxController(0);\n joystick = new Joystick(1);\n \n LiftRamp = new SRamp();\n SpeedRamp = new SRamp();\n\n NetworkTableInstance nt = NetworkTableInstance.getDefault();\n\n VisionTable = nt.getTable(\"ChickenVision\");\n TapeDetectedEntry = VisionTable.getEntry(\"tapeDetected\");\n TapePitchEntry = VisionTable.getEntry(\"tapePitch\");\n TapeYawEntry = VisionTable.getEntry(\"tapeYaw\");\n\n LedTable = nt.getTable(\"LedInfo\");\n LedScript = LedTable.getEntry(\"CurrentScript\");\n LedScriptArgument = LedTable.getEntry(\"ScriptArgument\");\n LedArmsClosed = LedTable.getEntry(\"ArmsClosed\");\n\n UsbCamera cam = CameraServer.getInstance().startAutomaticCapture();\n cam.setPixelFormat(PixelFormat.kMJPEG);\n cam.setResolution(320, 240);\n cam.setFPS(15);\n \n\n LedScript.setString(\"ColorWaves\");\n LedScriptArgument.setString(\"\");\n\n limits = new DigitalInput[8];\n\n for (int i = 0; i < limits.length; i++) {\n limits[i] = new DigitalInput(i + 2);\n }\n }", "@Override\n public void init() {\n robot = new MecanumBotHardware(true,true,true,true);\n robot.init(hardwareMap);\n int deg180=845;\n // Create the state machine and configure states.\n smDrive = new StateMachine(this, 16);\n smDrive.addStartState(new WaitState(\"wait\",0.1,\"MainDriveTeleop\"));\n smDrive.addState(new GigabyteTeleopDriveState(\"MainDriveTeleop\", robot));\n smDrive.addState(new SpinPose(\"90DegSpin\",(int)(deg180*0.5),robot,0.1f));\n smDrive.addState(new SpinPose(\"180DegSpin\",deg180,robot,0.1f));\n smDrive.addState(new SpinPose(\"270DegSpin\",(int)(deg180*1.5),robot,0.1f));\n\n smArm = new StateMachine(this, 16);\n smArm.addStartState(new WaitState(\"wait\",0.1,\"MainArmTeleop\"));\n smArm.addState(new GigabyteTeleopArmState(\"MainArmTeleop\", robot));\n smArm.addState(new ShoulderPose(\"Pose1\", robot,0, \"MainArmTeleop\"));//0.12\n smArm.addState(new ShoulderPose(\"Pose2\", robot,1079, \"MainArmTeleop\"));//0.05\n smArm.addState(new ShoulderPose(\"Pose3\", robot,2602, \"MainArmTeleop\"));//-0.17\n smArm.addState(new ShoulderPose(\"Pose4\", robot,3698, \"MainArmTeleop\" ));//-0.35\n // Init the state machine\n smDrive.init();\n smArm.init();\n }", "@Override\n\tpublic void onRuning(TAResponse response) {\n\n\t}", "@Override\r\n public void robotInit() {\r\n // Instantiate our RobotContainer. This will perform all our button bindings\r\n robotContainer = new RobotContainer();\r\n }", "public void onScannedRobot() {\r\n\t\t// Turn gun to point at the scanned robot\r\n\t\tturnGunTo(scannedAngle);\r\n\r\n\t\t// Fire!\r\n\t\tfire(1);\r\n\t}", "@Override\n\tprotected void execute() {\n\t\tdouble speed = Robot.oi.getSpeed();\n\t\tdouble turn = Robot.oi.getTurn();\n\t\tdouble leftSpeed;\n\t\tdouble rightSpeed;\n\n\t\tif (Robot.oi.getGyroReset()) {\n\t\t\tRobot.chassisSubsystem.resetGyroHeading();\n\t\t}\n\n\t\tif (Robot.oi.getGyroCalibrate()) {\n\t\t\tRobot.chassisSubsystem.calibrateGyro();\n\t\t}\n\n\t\t/**\n\t\t * If the chassisSubsystem says that we should be in high gear, switch\n\t\t * to high gear, otherwise, switch to low gear.\n\t\t */\n\t\tif (Robot.oi.getGearShiftButton() >= 0.5) {\n\t\t\tRobot.chassisSubsystem.setGear(Gear.HIGH);\n\t\t} else {\n\t\t\tRobot.chassisSubsystem.setGear(Gear.LOW);\n\t\t}\n\n\t\t\n\n\t\t/**\n\t\t * If the user is not turning, then follow the gyro using the GoStraight\n\t\t * command.\n\t\t */\n\t\t/*\n\t\t * if (Math.abs(turn) < 0.03) { Scheduler.getInstance().add(new\n\t\t * GoStraightCommand(Robot.chassisSubsystem.getCurrentAngle())); return;\n\t\t * }\n\t\t */\n\n\t\t/*\n\t\t * double defaultValue = 0; Robot.chassisSubsystem.resetGyroHeading();\n\t\t * double angle = Robot.oi.table.getNumber(\"angle\", defaultValue);\n\t\t * System.out.println(angle);\n\t\t * \n\t\t * if(Robot.oi.getAlignShotButton()) { Scheduler.getInstance().add(new\n\t\t * PivotToAngleCommand(angle)); return; }\n\t\t */\n\n\n\t\tdouble targetCenterX = 0;\n\t\tif (Robot.oi.getAutoAlignShotButton() && targetCenterX != RobotMap.NO_VISION_TARGET) {\n\t\t\tScheduler.getInstance().add(new AlignAndShootHighShotCommand(MatchPeriod.TELEOP));\n\t\t\treturn;\n\t\t}\n\t\t\n\t\tif (Robot.oi.getManualAlignShotButton()) {\n\t\t\tScheduler.getInstance().add(new AlignAndShootHighShotCommand(MatchPeriod.TELEOP));\n\t\t\treturn;\n\t\t}\n\n\t\t// Use the driver input to set the speed and direction.\n\t\tif (Math.abs(speed) < 0.03) {\n\t\t\tleftSpeed = turn / 2.0;\n\t\t\trightSpeed = -turn / 2.0;\n\t\t} else {\n\t\t\tleftSpeed = (turn < 0.0) ? speed * (1.0 + turn) : speed;\n\t\t\trightSpeed = (turn < 0.0) ? speed : speed * (1.0 - turn);\n\t\t}\n\n\t\tRobot.chassisSubsystem.setSpeed(leftSpeed, rightSpeed);\n\t}", "@Override\n\tpublic void robotInit() {\n\t\tdt = new DriveTrain();\n\t\t//Initialize drive Talons\n\t\tRobotMap.vspLeft = new WPI_TalonSRX(RobotMap.dtLeft);\n\t\tRobotMap.vspRight = new WPI_TalonSRX(RobotMap.dtRight);\n\t\t//Initialize drive slave Victors\n\t\t//RobotMap.slaveLeft = new WPI_VictorSPX(RobotMap.slaveDriveLeft);\n\t\t//RobotMap.slaveRight = new WPI_VictorSPX(RobotMap.slaveDriveRight);\n\t\t//Set drive slaves to follower mode\n\t\t//RobotMap.slaveLeft.follow(RobotMap.vspLeft);\n\t\t//RobotMap.slaveRight.follow(RobotMap.vspRight);\n\t\t//Initialize drive train\n\t\tRobotMap.rd = new DifferentialDrive(RobotMap.vspLeft, RobotMap.vspRight);\n\t\t//Initialize drive joystick\n\t\tRobotMap.stick = new Joystick(RobotMap.joystickPort);\n\t\t//Disabled drive safety\n\t\tRobotMap.vspLeft.setSafetyEnabled(false);\n\t\tRobotMap.vspRight.setSafetyEnabled(false);\n\t\tRobotMap.rd.setSafetyEnabled(false);\n\t\t//Initialize lift Talon\n\t\tRobotMap.liftTalon = new WPI_TalonSRX(5);\n\t\t//Initialize operator controller\n\t\tRobotMap.controller = new Joystick(RobotMap.controllerPort);\n\t\t//Initialize intake Victors\n\t\tRobotMap.intakeVictorLeft = new WPI_VictorSPX(RobotMap.intakeMaster);\n\t\tRobotMap.intakeVictorRight = new WPI_VictorSPX(RobotMap.intakeSlave);\n\t\t//Set right intake Victor to follow left intake Victor\n\t\tRobotMap.intakeVictorRight.follow(RobotMap.intakeVictorLeft);\n\t\t\n\t\tRobotMap.climberVictorLeft = new WPI_VictorSPX(RobotMap.climberLeftAddress);\n\t\tRobotMap.climberVictorRight = new WPI_VictorSPX(RobotMap.climberRightAddress);\n\t\t\n\t\tRobotMap.climberVictorRight.follow(RobotMap.climberVictorLeft);\n\t\t\n\t\tRobotMap.piston = new DoubleSolenoid(RobotMap.inChannel, RobotMap.outChannel);\n\t\t\n\t\tRobotMap.intakeLifter = new WPI_VictorSPX(2);\n\t\t\n\t\tRobotMap.liftTalon = new WPI_TalonSRX(RobotMap.liftTalonAddress);\n\t\t\n\t\tautoChooser = new SendableChooser();\n\t\tautoChooser.addDefault(\"Drive to baseline\" , new DriveToBaseline());\n\t\tautoChooser.addObject(\"Null auto\", new NullAuto());\n\t\tautoChooser.addObject(\"Switch from right\", new SwitchFromRight());\n\t\tautoChooser.addObject(\"Switch from left\", new SwitchFromLeft());\n\t\tautoChooser.addObject(\"PID from left\", new PIDfromLeft());\n\t\tautoChooser.addObject(\"PID from right\", new PIDfromRight());\n\t\tautoChooser.addObject(\"Scale from right\", new ScaleAutoRight());\n\t\tautoChooser.addObject(\"Scale from left\", new ScaleAutoLeft());\n\t\tautoChooser.addObject(\"PID tester\", new PIDTESTER());\n\t\tautoChooser.addObject(\"Joe use this one\", new leftOnly());\n\t\tSmartDashboard.putData(\"Autonomous mode chooser\", autoChooser);\n\t\t\n\t\t//RobotMap.liftVictor.follow(RobotMap.climberTalon);\n\t\t\n\t\tRobotMap.vspLeft.configSelectedFeedbackSensor(FeedbackDevice.CTRE_MagEncoder_Relative, 0, 0);\n\t\tRobotMap.vspRight.configSelectedFeedbackSensor(FeedbackDevice.CTRE_MagEncoder_Relative, 0, 0);\n\t\t\n\t\tRobotMap.intakeLifted = new DigitalInput(1);\n\t\tRobotMap.isAtTop = new DigitalInput(2);\n\t\tRobotMap.isAtBottom = new DigitalInput(0);\n\t\t\n\t\tRobotMap.vspLeft.configVelocityMeasurementPeriod(VelocityMeasPeriod.Period_100Ms, 1);\n\t\tRobotMap.vspRight.configVelocityMeasurementWindow(64, 1); \n\t\t\n\t\toi = new OI();\n\t}", "@Override\n public void init_loop() {\n\n\n if (robot.gyro.isCalibrating()) {\n telemetry.addData(\"we calibrating\", \"\");\n } else {\n telemetry.addData(\"Hell naw\", \"\");\n }\n telemetry.update();\n\n\n // Send telemetry message to signify robot waiting;\n // telemetry.addData(\"Say\", \"Dick\"); //\n // telemetry.update();\n\n // Wait for the game to start (driver presses PLAY)\n\n\n // run until the end of the match (driver presses STOP)\n }", "Robot getRobot(Position pos);", "public RobotInfo senseRobotInfo(Robot r) throws GameActionException;", "public void robotInit()\r\n {\r\n // Initialize all subsystems\r\n CommandBase.init();\r\n // instantiate the command used for the autonomous period\r\n //Initializes triggers\r\n mecanumDriveTrigger = new MechanumDriveTrigger();\r\n tankDriveTrigger = new TankDriveTrigger();\r\n resetGyro = new ResetGyro();\r\n }", "public void omniDrive() {\r\n \r\n }", "public void robotInit() {\n RobotMap.init();\n driveWithJoystick = new DriveTrain();\n \n oi = new OI();\n }", "@Override\n public void onScannedRobot(ScannedRobotEvent event) {\n super.onScannedRobot(event);\n }", "public void robotInit() {\n\t\t\n\t\tupdateDashboard();\n\t\t\n \tautoChooser = new SendableChooser();\n \tautoChooser.addDefault(\"Default Autonomous does nothing!\", new Default());\n \t// Default Autonomous does nothing\n \tautoChooser.addObject(\"Cross the Low Bar Don't Run This it doesn't work\", new LowBar());\n \tautoChooser.addObject(\"Cross Rough Patch/Stone Wall\", new Main());\n \tautoChooser.addObject(\"Cross the Low Bar, Experimental!\", new LowBarEx());\n \t//autoChooser.addObject(\"If Jonathan lied to us and we can cross twice\", new RoughPatch());\n \tCameraServer server = CameraServer.getInstance();\n\n \tserver.setQuality(50);\n \t\n \tSmartDashboard.putData(\"Autonomous\", autoChooser);\n\n \tserver.startAutomaticCapture(\"cam0\");\n \tLowBar.gyro.reset();\n \t\n \tDriverStation.reportWarning(\"The Robot is locked and loaded. Time to kick some ass guys!\", !(server.isAutoCaptureStarted()));\n\n\t}", "public void robotInit() {\n\t\toi = new OI();\n\t\t\n\t\tteleopCommand = new TeleopCommand();\n }", "@Override\n public void teleopPeriodic() {\n Scheduler.getInstance().run();\n // ros_string = workingSerialCom.read();\n // yavuz = workingSerialCom.StringConverter(ros_string, 2);\n // Inverse.Inverse(yavuz);\n\n // JoystickDrive.execute();\n\n\n\n // ros_string = workingSerialCom.read();\n // alt_yurur = workingSerialCom.StringConverter(ros_string, 1);\n // robot_kol = workingSerialCom.StringConverter(ros_string, 2);\n Full.Full(yavuz);\n \n }", "@Override\n public void init() {\n /* Initialize the hardware variables.\n * The init() method of the hardware class does all the work here\n */\n robot.init(hardwareMap);\n\n //ColorSensor colorSensor;\n //colorSensor = hardwareMap.get(ColorSensor.class, \"Sensor_Color\");\n\n // Send telemetry message to signify robot waiting;\n telemetry.addData(\"Say\", \"Hello Driver\"); //\n }", "public static void init() {\n driveLeft = new VictorSP(1);\r\n LiveWindow.addActuator(\"Drive\", \"Left\", (VictorSP) driveLeft);\r\n \r\n driveRight = new VictorSP(0);\r\n LiveWindow.addActuator(\"Drive\", \"Right\", (VictorSP) driveRight);\r\n \r\n driveMotors = new RobotDrive(driveLeft, driveRight);\r\n \r\n driveMotors.setSafetyEnabled(false);\r\n driveMotors.setExpiration(0.1);\r\n driveMotors.setSensitivity(0.5);\r\n driveMotors.setMaxOutput(1.0);\r\n\r\n driveEncoderLeft = new Encoder(0, 1, true, EncodingType.k1X);\r\n LiveWindow.addSensor(\"Drive\", \"EncoderLeft\", driveEncoderLeft);\r\n driveEncoderLeft.setDistancePerPulse(0.053855829);\r\n driveEncoderLeft.setPIDSourceType(PIDSourceType.kRate);\r\n driveEncoderRight = new Encoder(2, 3, false, EncodingType.k1X);\r\n LiveWindow.addSensor(\"Drive\", \"EncoderRight\", driveEncoderRight);\r\n driveEncoderRight.setDistancePerPulse(0.053855829);\r\n driveEncoderRight.setPIDSourceType(PIDSourceType.kRate);\r\n driveFrontSonar = new Ultrasonic(4, 5);\r\n LiveWindow.addSensor(\"Drive\", \"FrontSonar\", driveFrontSonar);\r\n \r\n shooterMotor = new VictorSP(3);\r\n LiveWindow.addActuator(\"Shooter\", \"Motor\", (VictorSP) shooterMotor);\r\n \r\n climberMotor = new Spark(2);\r\n LiveWindow.addActuator(\"Climber\", \"Motor\", (Spark) climberMotor);\r\n \r\n gearGrabReleaseSolonoid = new DoubleSolenoid(0, 0, 1);\r\n LiveWindow.addActuator(\"Gear\", \"GrabReleaseSolonoid\", gearGrabReleaseSolonoid);\r\n \r\n powerPanel = new PowerDistributionPanel(0);\r\n LiveWindow.addSensor(\"Power\", \"Panel\", powerPanel);\r\n \r\n cameraMountpan = new Servo(4);\r\n LiveWindow.addActuator(\"CameraMount\", \"pan\", cameraMountpan);\r\n \r\n cameraMounttilt = new Servo(5);\r\n LiveWindow.addActuator(\"CameraMount\", \"tilt\", cameraMounttilt);\r\n \r\n\r\n // END AUTOGENERATED CODE, SOURCE=ROBOTBUILDER ID=CONSTRUCTORS\r\n\t\tdriveSonarFront = new SonarMB1010(0);\r\n\t\tLiveWindow.addSensor(\"Drive\", \"SonarFront\", driveSonarFront);\r\n\r\n\t\t//driveGyro = new GyroADXRS453();\r\n\t\tdriveGyro = new ADXRS450_Gyro();\r\n\t\tLiveWindow.addSensor(\"Drive\", \"Gyro\", driveGyro);\r\n\t\tdriveGyro.calibrate();\r\n\t}", "@Override\n public void robotInit() {\n // Hardware.getInstance().init();\n hardware.init();\n\n controllerMap = ControllerMap.getInstance();\n controllerMap.controllerMapInit();\n\n controllerMap.intake.IntakeInit();\n\n m_chooser.setDefaultOption(\"Default Auto\", kDefaultAuto);\n m_chooser.addOption(\"My Auto\", kCustomAuto);\n SmartDashboard.putData(\"Auto choices\", m_chooser);\n\n intakeCam = CameraServer.getInstance().startAutomaticCapture(\"Driver Camera :)\", 0);\n intakeCam.setPixelFormat(PixelFormat.kMJPEG);\n intakeCam.setResolution(160, 120);\n intakeCam.setFPS(15);\n // climberCam = CameraServer.getInstance().startAutomaticCapture(1);\n\n }", "public void robotInit() {\n\t\t//Get preferences from robot flash memory\n\t\tprefs = Preferences.getInstance();\n\t\tarmCalMinPosition = prefs.getDouble(\"armCalMinPosition\", 0);\n\t\tarmCal90DegPosition = prefs.getDouble(\"armCal90DegPosition\", 0);\n\t\tif (armCalMinPosition==0 || armCal90DegPosition==0) {\n\t\t\tDriverStation.reportError(\"Error: Preferences missing from RoboRio for Shooter Arm position calibration. Shooter arm disabled.\", true);\n\t\t\tshooterArmEnabled = false;\n\t\t} else {\n\t\t\tshooterArmEnabled = true;\n\t\t}\n\t\t\n\t\ttry {\n\t\t\tdebugStream = new FileWriter(\"/home/lvuser/debug.log\", true);\n\t\t\tdebugStream.write(\"Robot program started\\n\");\n\t\t\tdebugStream.flush();\n\t\t} catch (IOException e) {\n\t\t\tSystem.out.println(\"Could not open debug file: \" + e);\n\t\t}\n\n\t\t//Instantiates the subsystems\n\t\tdriveTrain = new DriveTrain();\n\t\tshifter = new Shifter();\n\t\tshooterArm = new ShooterArm();\n\t\tshooter = new Shooter();\n\t\tintake = new Intake();\n\t\tvision = new Vision();\n\t\tpanel = new PowerDistributionPanel();\n\t\tarmPiston = new ArmPiston();\n\n\t\t// OI must be constructed after subsystems. If the OI creates Commands\n\t\t// (which it very likely will), subsystems are not guaranteed to be\n\t\t// constructed yet. Thus, their requires() statements may grab null\n\t\t// pointers. Bad news. Don't move it.\n\t\toi = new OI();\n\n intake.motorCurrentTrigger.whenActive(new IntakeMotorStop());\n\n timerLEDs.start();\n timerTilt.start();\n timerRumble.start();\n \n // instantiate the command used for the autonomous period\n\t\t//autonomousCommand = new AutonomousCommandGroup();\n\t\traiseArm90 = new ShooterArmMoveToSetLocation(90);\n\t\t\n\t\t// Display active commands and subsystem status on SmartDashboard\n\t\tSmartDashboard.putData(Scheduler.getInstance());\n\t\tSmartDashboard.putData(driveTrain);\n\t\tSmartDashboard.putData(shifter);\n\t\tSmartDashboard.putData(shooterArm);\n\t\tSmartDashboard.putData(shooter);\n\t\tSmartDashboard.putData(intake);\n\t\tSmartDashboard.putData(vision);\n\t\tSmartDashboard.putData(armPiston);\n\t}", "public void receivedDataFromRobot(int[] data) {}", "@Override\n public void robotInit() {\n m_chooser.setDefaultOption(\"Default Auto\", kDefaultAuto);\n m_chooser.addOption(\"My Auto\", kCustomAuto);\n SmartDashboard.putData(\"Auto choices\", m_chooser);\n //starts the dual cameras\n CameraServer.getInstance().startAutomaticCapture(0);\n CameraServer.getInstance().startAutomaticCapture(1);\n //auto start (disabled atm)\n //pressBoy.setClosedLoopControl(true);\n pressBoy.setClosedLoopControl(false);\n \n \n }", "public interface BWAPIEventListener {\n\n /**\n * connection to BWAPI established\n */\n void connected();\n\n /**\n * game has just started, game settings can be turned on here\n */\n void matchStart();\n\n /**\n * perform AI logic here\n */\n void matchFrame();\n\n /**\n * game has just terminated\n */\n void matchEnd(boolean winner);\n\n /**\n * keyPressed from within StarCraft\n */\n void keyPressed(int keyCode);\n\n // BWAPI callbacks\n void sendText(String text);\n\n void receiveText(String text);\n\n void playerLeft(int playerID);\n\n void nukeDetect(Position p);\n\n void nukeDetect();\n\n void unitDiscover(int unitID);\n\n void unitEvade(int unitID);\n\n void unitShow(int unitID);\n\n void unitHide(int unitID);\n\n void unitCreate(int unitID);\n\n void unitDestroy(int unitID);\n\n void unitMorph(int unitID);\n\n void unitRenegade(int unitID);\n\n void saveGame(String gameName);\n\n void unitComplete(int unitID);\n\n void playerDropped(int playerID);\n}", "@Override\n public void robotInit() {\n\t\t// set up logging\n\t\tlogger = EventLogging.getLogger(Robot.class, Level.INFO);\n\n // set up hardware\n RobotMap.init();\n\n // set up subsystems\n //initalized drive subsystem, which control motors to move robot\n driveSubsystem = new DriveSubsystem();\n\t\tbuttonSubstyem = new ButtonSubsystem();\n servoSubsystem = new ServoSubsystem();\n wingSubsystem = new WingSubsystem();\n flagSpinnerSubsystem = new FlagSpinnerSubsystem();\n // OI must be constructed after subsystems. If the OI creates Commands\n //(which it very likely will), subsystems are not guaranteed to be\n // constructed yet. Thus, their requires() statements may grab null\n // pointers. Bad news. Don't move it.\n oi = new OI();\n\n // Add commands to Autonomous Sendable Chooser\n chooser.addDefault(\"Autonomous Command\", new AutonomousCommand());\n SmartDashboard.putData(\"Auto mode\", chooser);\n }", "public void robotInit() {\n\t\toi = new OI();\n chooser = new SendableChooser();\n chooser.addDefault(\"Default Auto\", new ExampleCommand());\n// chooser.addObject(\"My Auto\", new MyfAutoCommand());\n SmartDashboard.putData(\"Auto mode\", chooser);\n \n //Drive\n //this.DriveTrain = new DriveTrain();\n \t//RobotMap.robotDrive1.arcadeDrive(oi.stickLeft);\n \n //Buttons\n // oi.button1.whenPressed(new SetMaxMotorOutput());\n \n //Ultrasonic\n sonic1 = new Ultrasonic(0,1);\n sonic1.setAutomaticMode(true);\n \n }", "@Override\n public void init() {\n /* Initialize the hardware variables.\n * The init() method of the hardware class does all the work here\n */\n robot.init(hardwareMap);\n // robot.leftBumper.setPosition(.5);\n // robot.leftStageTwo.setPosition(1);\n // robot.rightStageTwo.setPosition(0.1);\n robot.colorDrop.setPosition(0.45);\n robot.align.setPosition(0.95);\n\n // robot.rightBumper.setPosition(.7);\n\n // Send telemetry message to signify robot waiting;\n telemetry.addData(\"Say\", \"Hello Driver\"); //\n }", "@Override\n\tpublic void startWork() {\n\t\tSystem.out.println(\"Robot is working\");\n\t}" ]
[ "0.7460076", "0.7417423", "0.7417423", "0.7417423", "0.72715765", "0.72258985", "0.72258985", "0.71378434", "0.6962099", "0.6725089", "0.6725089", "0.6725089", "0.6725089", "0.6725089", "0.6725089", "0.66741955", "0.66063243", "0.65926605", "0.65926605", "0.65541226", "0.6461747", "0.63353014", "0.6324584", "0.63085973", "0.6274306", "0.6273866", "0.6259708", "0.6226485", "0.62168705", "0.61929953", "0.6174486", "0.61714107", "0.61532444", "0.6148748", "0.6145045", "0.6140972", "0.6129214", "0.6126057", "0.61228156", "0.61227494", "0.61200583", "0.6115465", "0.610143", "0.60915804", "0.6090516", "0.6078934", "0.60697395", "0.60440993", "0.60376716", "0.6031382", "0.6028528", "0.60279715", "0.6007661", "0.60055465", "0.6002004", "0.5999619", "0.59971935", "0.59944785", "0.5990439", "0.59888345", "0.59744453", "0.5970461", "0.5956015", "0.5928133", "0.5911225", "0.5901924", "0.5881025", "0.5878624", "0.58757496", "0.58604914", "0.58596396", "0.5852157", "0.5828533", "0.582377", "0.5817269", "0.5812269", "0.58064866", "0.5803753", "0.5803036", "0.5801792", "0.5794312", "0.57929975", "0.5781118", "0.57666063", "0.5762906", "0.5761817", "0.5758477", "0.57583237", "0.575811", "0.57556623", "0.57554096", "0.5746787", "0.5743562", "0.57370913", "0.5735574", "0.57309103", "0.57291126", "0.5726513", "0.5718223", "0.57141894", "0.57133895" ]
0.0
-1
Construtor de UsuarioAcaoUsuarioHelp que recebe um usuario e um usuario acao
public UsuarioAcaoUsuarioHelper(Usuario usuario, UsuarioAcao usuarioAcao) { this.usuario = usuario; this.usuarioAcao = usuarioAcao; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public Usuario(String usuario, String contrasena) {\n \tthis.usuario = usuario;\n \tthis.contrasena = contrasena;\n }", "public void altaUsuario();", "public Usuario(String nickUsuario, String nombreUsuario, String correoUsuario) {\r\n this.nickUsuario = nickUsuario;\r\n this.nombreUsuario = nombreUsuario;\r\n this.correoUsuario = correoUsuario;\r\n }", "public Usuario(String idUsuario, String contrasena) {\n\t\tsuper();\n\t\tthis.idUsuario = idUsuario;\n\t\tthis.contrasena = contrasena;\n\t}", "protected void accionUsuario() {\n\t\t\r\n\t}", "public java.lang.String getUsuario();", "public Usuario(int idUsuario, String nome, String email, String telefone, int motorista){\n\t\tthis.idUsuario = idUsuario;\n\t\tthis.nome = nome;\n\t\tthis.email = email;\n\t\tthis.telefone = telefone;\n\t\tthis.motorista = motorista;\n\t}", "public Usuario(String nickUsuario, String nombreUsuario, String correoUsuario, String passUsuario) {\r\n this.nickUsuario = nickUsuario;\r\n this.nombreUsuario = nombreUsuario;\r\n this.correoUsuario = correoUsuario;\r\n this.passUsuario = passUsuario;\r\n }", "public void setUsuario(String usuario) {\r\n this.usuario = usuario;\r\n \r\n }", "public Cgg_res_oficial_seguimiento_usuario(){}", "public UsuarioControlador() {\r\n\t\tsuper(Usuario.class);\r\n\t}", "public ControladorUsuario() {\n }", "public String getUsuario() {\r\n return usuario;\r\n }", "public String getUsuario() {\r\n return usuario;\r\n }", "public void setUsuario(String usuario) {\r\n this.usuario = usuario;\r\n }", "public void setUsuario(String usuario) {\r\n this.usuario = usuario;\r\n }", "public void setUsuario(Usuario usuario) {\n this.usuario = usuario;\n }", "public void setUsuario(Usuario usuario) {\n this.usuario = usuario;\n }", "public Usuario(String nombreUsuario, String correo, String telefono) {\n\t\tsuper();\n\t\tthis.nombreUsuario = nombreUsuario;\n\t\tthis.correo = correo;\n\t\tthis.telefono = telefono;\n\t}", "public String getUsuario() {\r\n return Usuario;\r\n }", "@Override\n\tpublic Usuario mostrar() {\n\t\tLOG.info(\"Mostrar los datos del usuario\");\n\t\treturn usuario;\n\t}", "public SigalPeticion reativarUsuario ( AccountTO usuario ) throws Exception {\n \n // Tratamento para controle de campos opicionais\n int totalParams = 11;\n boolean possuiCenttra = true;\n boolean possuiCodPerfil = true;\n\n if ( usuario.getCenttra() == null || usuario.getCenttra().trim().equals(\"\") ) {\n --totalParams;\n possuiCenttra = false;\n }\n\n if ( usuario.getCodperfil() == null || usuario.getCodperfil().trim().equals(\"\") ) {\n --totalParams;\n possuiCodPerfil = false;\n }\n\n SigalPeticion msgEnvio = SigalPeticion.getInstance( totalParams );\n\n msgEnvio.addParametro( --totalParams, new Parametro( \"FUNCION\", \"RE\" ) );\n\n msgEnvio.addParametro( --totalParams, new Parametro( IUsuarioXML.USUARIO,\n usuario.getUsuario() ) );\n msgEnvio.addParametro( --totalParams, new Parametro( IUsuarioXML.OFICINA,\n usuario.getOficina() ) );\n msgEnvio.addParametro( --totalParams, new Parametro( IUsuarioXML.NOMBREUSU,\n usuario.getNombreusu() ) );\n msgEnvio.addParametro( --totalParams, new Parametro( IUsuarioXML.PASSWORD,\n usuario.getPassword() ) );\n msgEnvio.addParametro( --totalParams, new Parametro( IUsuarioXML.NIVSEGUSU,\n usuario.getNivsegusu() ) );\n msgEnvio.addParametro( --totalParams, new Parametro( IUsuarioXML.CODIDIOMA,\n usuario.getCodidioma() ) );\n msgEnvio.addParametro( --totalParams, new Parametro( IUsuarioXML.FECACTIVA,\n usuario.getFecactivaForEASE() ) );\n msgEnvio.addParametro( --totalParams, new Parametro( IUsuarioXML.FECDESACT,\n usuario.getFecdesactForEASE() ) );\n\n // CAMPO OPICIONAL, alteração feita na especificação v. 5.0\n if ( possuiCenttra )\n msgEnvio.addParametro( --totalParams, new Parametro( IUsuarioXML.CENTTRA,\n usuario.getCenttra() ) );\n\n // CAMPO OPICIONAL, alteração feita na especificação v. 5.0\n if ( possuiCodPerfil ) {\n msgEnvio.addParametro( --totalParams, new Parametro( IUsuarioXML.CODPERFIL,\n usuario.getCodperfil() ) );\n }\n\n msgEnvio.setTipoOperacion( \"update\" );\n msgEnvio.setTransaccion( \"SGREUSU\" );\n\n return msgEnvio; \n }", "public TipoUsuario(int id_tipousuario, String usuario) {\n this.id_tipousuario = id_tipousuario;\n this.usuario = usuario;\n }", "public void setUsuario(Usuario usuario) {\r\n\t\tthis.usuario = usuario;\r\n\t}", "public UsuarioControlador() {\n }", "public OmsUsuario() {\n\t}", "public SigalPeticion getUsuarios() throws Exception {\n SigalPeticion msgEnvio = SigalPeticion.getInstance( 2 );\n\n msgEnvio.addParametro( 0, new Parametro( \"FUNCION\", \"CL\" ) ); \n msgEnvio.addParametro( 1, \n /**\n * Somente usuarios ATIVOS\n * N = Ativos\n * S = Ativos e Inativos\n */\n new Parametro( \"USUBAJAC\", \"N\" ) \n );\n\n msgEnvio.setTipoOperacion( \"view\" );\n msgEnvio.setTransaccion( \"SGCLUSU\" );\n\n return msgEnvio;\n }", "public SigalPeticion getUsuario( String usuarioLogin ) throws Exception {\n SigalPeticion msgEnvio = SigalPeticion.getInstance( 2 );\n\n msgEnvio.addParametro( 0, new Parametro( \"FUNCION\", \"CO\" ) );\n msgEnvio.addParametro( 1, new Parametro( \"USUARIOC\", usuarioLogin ) );\n\n msgEnvio.setTipoOperacion( \"select\" );\n msgEnvio.setTransaccion( \"SGCLUSU\" );\n\n return msgEnvio;\n }", "protected String getUsuario() {\n return this.usuario;\n }", "public void setUsuario(Usuario usuario) {\n\t\tthis.usuario = usuario;\n\t}", "public String usuarioconectado() {\n\t\tString nome;\n\t\tObject principal = SecurityContextHolder.getContext().getAuthentication().getPrincipal();\n\n\t\tif (principal instanceof UserDetails) {\n\t\t\tnome = ((UserDetails) principal).getUsername();\n\t\t} else {\n\t\t\tnome = principal.toString();\n\t\t}\n\t\t// System.out.println(nome);\n\t\treturn nome;\n\t}", "public String getUsuario() {\n\t\treturn this.usuario;\n\t}", "public void setUsuario(java.lang.String usuario) {\n this.usuario = usuario;\n }", "public Administrador(String nome, String endereco, String email, String telefone, String id_usuario, String senha_usuario) {\n super(nome, endereco, email, telefone, id_usuario, senha_usuario);\n }", "private void mostrarUsuario(Usuario usuario) {\n\t\tSystem.out.println(usuario.getId()+\" - \"+usuario.getNombre()+\" \"+usuario.getApellido()+\" / \"+usuario.getEdad()+\" / \"+usuario.getDni()+\" / \"+usuario.getFecha_nac());\r\n\t}", "public Almacen buscarAlmacenUsuario() throws Exception {\n\n logger.debug(\"Obteniendo almacen del usuario...!\");\n\n try {\n\n //Obtener manager inventario service\n ManagerInventarioServiceBusiness mgrInventario = getMgrInventarioService();\n\n //Retornar almacen del usuario\n return mgrInventario.buscarAlmacenUsuario();\n\n } catch (ManagerInventarioServiceBusinessException e) {\n logger.error(e.getMessage(), e);\n throw new Exception(e.getMessage(), e);\n } catch (RemoteException e) {\n logger.error(e.getMessage(), e);\n throw new Exception(e.getMessage(), e);\n }\n }", "public Usuario getUsuario() {\n return usuario;\n }", "public Usuario getUsuario() {\n return usuario;\n }", "public SigalPeticion habilitarUsuario( String usuarioLogin\n , String dataHabilitacao ) throws Exception {\n SigalPeticion msgEnvio = SigalPeticion.getInstance( 3 );\n\n msgEnvio.addParametro( 0, new Parametro( \"FUNCION\", \"HB\" ) );\n msgEnvio.addParametro( 1, new Parametro( \"USUARIO\", usuarioLogin ) );\n msgEnvio.addParametro( 2, new Parametro( \"FECDESACT\", dataHabilitacao ) );\n\n msgEnvio.setTipoOperacion( \"update\" );\n msgEnvio.setTransaccion( \"SGMOUSU\" );\n\n return msgEnvio;\n }", "public void setUsuario(java.lang.String newUsuario);", "public void setUsuario(String usuario) {\n\t\tthis.usuario = usuario;\n\t}", "public VentanaBuscarUsuarios(ControladorUsuario controladorUsuario, TelefonoDAO telefonoDAO) {\n initComponents();\n this.controladorUsuario = controladorUsuario;\n this.telefonoDAO = telefonoDAO;\n alerta16=\"No se ha encontrado el usuario con la cedula \";\n }", "public Usuario(String nome, String email, String celular, String classe,String identificacao,String status) {\n\t\t\n\t\tthis.nome = nome;\n\t\tthis.email = email;\n\t\tthis.celular = celular;\n\t\tthis.classe = classe;\n\t\tthis.identificacao = identificacao;\n\t\tthis.status = status;\n\t\t\n\t}", "public Usuario() {\r\n }", "public Usuario() {\r\n }", "private void actualizaUsuario() {\n\t\t\n\t\tInteger edad=miCoordinador.validarEdad(campoEdad.getText().trim());\n\t\t\n\t\tif (edad!=null) {\n\t\t\t\n\t\t\tUsuarioVo miUsuarioVo=new UsuarioVo();\n\t\t\t//se asigna cada dato... el metodo trim() del final, permite eliminar espacios al inicio y al final, en caso de que se ingresen datos con espacio\n\t\t\tmiUsuarioVo.setDocumento(campoDocumento.getText().trim());\n\t\t\tmiUsuarioVo.setNombre(campoNombre.getText().trim());\n\t\t\tmiUsuarioVo.setEdad(Integer.parseInt(campoEdad.getText().trim()));\n\t\t\tmiUsuarioVo.setProfesion(campoProfesion.getText().trim());\n\t\t\tmiUsuarioVo.setTelefono(campoTelefono.getText().trim());\n\t\t\tmiUsuarioVo.setDireccion(campoDireccion.getText().trim());\n\t\t\t\n\t\t\tString actualiza=\"\";\n\t\t\t//se llama al metodo validarCampos(), este retorna true o false, dependiendo de eso ingresa a una de las opciones\n\t\t\tif (miCoordinador.validarCampos(miUsuarioVo)) {\n\t\t\t\t//si se retornó true es porque todo está correcto y se llama a actualizar\n\t\t\t\tactualiza=miCoordinador.actualizaUsuario(miUsuarioVo);//en registro se almacena ok o error, dependiendo de lo que retorne el metodo\n\t\t\t}else{\n\t\t\t\tactualiza=\"mas_datos\";//si validarCampos() retorna false, entonces se guarda la palabra mas_datos para indicar que hace falta diligenciar los campos obligatorios\n\t\t\t}\n\t\t\t\n\t\t\t//si el registro es exitoso muestra un mensaje en pantalla, sino, se valida si necesita mas datos o hay algun error\n\t\t\tif (actualiza.equals(\"ok\")) {\n\t\t\t\tJOptionPane.showMessageDialog(null, \" Se ha Modificado Correctamente \",\"Confirmación\",JOptionPane.INFORMATION_MESSAGE);\t\t\t\n\t\t\t}else{\n\t\t\t\tif (actualiza.equals(\"mas_datos\")) {\n\t\t\t\t\tJOptionPane.showMessageDialog(null, \"Debe Ingresar los campos obligatorios\",\"Faltan Datos\",JOptionPane.WARNING_MESSAGE);\t\t\t\n\t\t\t\t}else{\n\t\t JOptionPane.showMessageDialog(null, \"Error al Modificar\",\"Error\",JOptionPane.ERROR_MESSAGE);\n\t\t\t\t}\n\t\t\t}\t\t\t\t\t\n\t\t\t\n\t\t}else{\n\t\t\tJOptionPane.showMessageDialog(null, \"Debe ingresar una edad Valida!!!\",\"Advertencia\",JOptionPane.ERROR_MESSAGE);\n\t\t}\n\n\t\t\t\t\n\t}", "public String getNombreUsuario() {\r\n return nombreUsuario;\r\n }", "@Name(\"creditoDisponivel\")\n public Endereco endereco(@Source Usuario u) {\n return new Endereco();\n }", "public Usuario(){\n nombre = null;\n apellidos = null;\n dni = null;\n email = null;\n tlf = null;\n nombreUsuario = null;\n tarjetaCredito = null;\n hashPasswd = null; \n fotoPerfil = null;\n direccion = null;\n valoracionMedia = -1;\n }", "protected void setUsuario(String usuario) {\n this.usuario = usuario;\n }", "public Cgg_res_oficial_seguimiento_usuario(\n\t\t\tString inCrosg_codigo,\n\t\t\tString inCrofm_codigo,\n\t\t\tString inCusu_codigo,\n\t\t\tString inCusu_nombres,\n\t\t\tString inCusu_apellidos\n\t\t){\n\t\t\tthis.setCROSG_CODIGO(inCrosg_codigo);\n\t\t\tthis.setCROFM_CODIGO(inCrofm_codigo);\n\t\t\tthis.setCROSG_CODIGO(inCrofm_codigo);\n\t\t\tthis.setCUSU_CODIGO(inCusu_codigo);\n\t\t\tthis.setCUSU_NOMBRES(inCusu_nombres);\n\t\t\tthis.setCUSU_APELLIDOS(inCusu_apellidos);\t\t\t\n\t\t}", "public UsuarioTO validarUsuario(UsuarioTO usuarioTO){\n\t\tUsuarioTO usuarioTOResul=null;\r\n\t\ttry {\r\n\r\n\t\t\tList<Object> ListaUsuario = userDAO.listar(usuarioTO);\r\n\r\n\t\t\tif (ListaUsuario.size() > 0){\r\n\r\n\t\t\t\tusuarioTOResul = (UsuarioTO) ListaUsuario.get(0);\r\n\t\t\t}\r\n\r\n\t\t} catch (IllegalArgumentException e) {\r\n\t\t\t// TODO Auto-generated catch block\r\n\t\t\te.printStackTrace();\r\n\t\t} catch (SecurityException e) {\r\n\t\t\t// TODO Auto-generated catch block\r\n\t\t\te.printStackTrace();\r\n\t\t} catch (ClassCastException e) {\r\n\t\t\t// TODO Auto-generated catch block\r\n\t\t\te.printStackTrace();\r\n\t\t} \r\n\r\n\t\treturn usuarioTOResul;\r\n\r\n\t}", "public java.lang.String getUsuario() {\n return usuario;\n }", "public String getPassUsuario() {\r\n return passUsuario;\r\n }", "public ControladorUsuario(UsuarioDAO usuarioDAO) {\n\n this.usuarioDAO = usuarioDAO;\n \n }", "public void crearUsuario(String cedula,String name ,String lastname ,String phone , String city ,String email,String password) throws BLException;", "public CambiarPassword(UsuarioVO usu) {\r\n\t\tsuper();\r\n\t\tusuario = usu;\r\n\t\tinitialize();\r\n\t}", "public MenuUsuario(ControladorUsuario1 controladorUsuario) {\n initComponents();\n controladorU=controladorUsuario;\n }", "public Usuario(String nombre, int edad) {\n this.rvNombreUsuario = nombre;\n this.rvEdadUsuario = edad;\n }", "@Override\n\tpublic Usuario edit(Usuario obj) {\n\t\treturn null;\n\t}", "public Usuario(String username,String contrasena,String email,ListaCancion canciones){\n this.username=username;\n this.contrasena=contrasena;\n this.email=email;\n this.canciones=canciones;\n favoritas=new ListaCancion();\n RegistrarListaCancion(canciones);\n hash=new HashMap<>();\n hash.put(username,contrasena);\n }", "public PantallaPrincipalEnfermeria(Usuario usuario) {\n initComponents();\n this.setResizable(false);\n Image icon = new ImageIcon(getClass().getResource(\"/Vistas/imagenes/pinaricono.jpg\")).getImage();\n setIconImage(icon);\n this.usuario = usuario;\n controladorEventos = new ControladorCalendario();\n personal = usuario.getPersonal();\n controlador = new ControladorConsultarSugerencia();\n this.setLocationRelativeTo(null);\n textodeBienvenida2.setText(\"Bienvenido \" + usuario.getPersonal().getNombre() + \" \" + usuario.getPersonal().getApellido() + \" Al area \" + usuario.getPersonal().getArea().getNombreArea());\n start();\n }", "public Usuario getUsuarioConectado() {\r\n\t\treturn this.usuarioConectado;\r\n\t}", "public Usuario () {\r\n\t\t\r\n\t\t\r\n\t}", "public void addUsuario(Usuario usuario) {\n\t\t\n\t}", "private void controladorUser(Controlador controlador){\n this.contUserCrearProyecto = controlador.getUserCrearProyecto();\n inicioUser.setControlCrearProyecto(contUserCrearProyecto);\n \n this.contUserCrearColectivo = controlador.getUserCrearColectivo();\n inicioUser.setControlCrearColectivo(contUserCrearColectivo);\n\n this.contInformes = controlador.getInformes();\n inicioUser.setControlSolicitarInformes(contInformes); \n \n this.contFiltrar = controlador.getFiltrar();\n inicioUser.setControlFiltrar(contFiltrar);\n\n this.contLimpiar = controlador.getLimpiarFiltro();\n inicioUser.setControlLimpiarFiltro(contLimpiar);\n }", "public abstract co.com.telefonica.atiempo.ejb.eb.UsuarioLocal getUsuario();", "public Cuenta(Usuario usuario) { // constructor que crea objetos tipo cuenta que recibe por parámetro\n //un objeto de tipo usuario\n\n this.usuario = usuario;\n saldo = 0;\n }", "public void crearUsuario(UsuarioDTO usuarioNuevo) throws Exception;", "public abstract Setusuario buscarUsuario(String nomUsuario);", "public FrmCadUsuario() {\n initComponents();\n Connection conexao = new Conexao().getConnection();\n\n txtId.setEnabled(false);\n lista = usuarioController.getUsuarios();\n if (lista.isEmpty()) {\n JOptionPane.showMessageDialog(null, \"Ainda não foram cadastrados usuários\");\n } else {\n mostrarDados();\n }\n }", "@POST\n\t@Path(\"/verificar\")\n\t@Consumes(MediaType.APPLICATION_FORM_URLENCODED)\n\t@Produces(MediaType.APPLICATION_JSON)\n\tpublic RespuestaDTO login(@FormParam(value = \"usuario\") String usuario,\n\t\t\t@FormParam(value = \"contrasenia\") String contrasenia) {\n\t\tUsuario u = loginEJB.buscarUsuario(usuario, contrasenia);\n\t\tif (u != null) {\n\t\t\tString token = UUID.randomUUID().toString();\n\t\t\ttokens.put(token, u.getId());\n\t\t\tLoginOutDTO obj = new LoginOutDTO(token, usuario, u.getId() + \"\");\n\t\t\treturn new RespuestaDTO(obj);\n\t\t} else {\n\t\t\treturn new RespuestaDTO(null, \"Usuario o contraseņa incorrectos\", \"-1\");\n\t\t}\n\t}", "public UsuarioForm(java.awt.Frame parent, boolean modal, Usuarios usuario) {\n super(parent, modal);\n initComponents(); \n this.usuario = usuario;\n llenarDatos();\n }", "public editarUsuarioBean() {\r\n }", "public String getIdUsuario() {\n\t\treturn idUsuario;\n\t}", "public String getIdUsuario() {\n\t\treturn idUsuario;\n\t}", "public void Usuarios() {\n\t\r\n}", "public String getNickName(){\n return nombreUsuario;\n }", "public Vector<Usuario> getUsuario() {\n\t\treturn usuario;\n\t}", "private boolean comprobarUsuario(String nombre, String contrasenia, String grupo) {\n\n return true;\n }", "public String getCorreoUsuario() {\r\n return correoUsuario;\r\n }", "public ResultadoDTO crearUsuario(UsuarioDTO UsuarioDTO)throws EntityExistsException, IllegalArgumentException;", "@Generated\n public Usuarios() {\n }", "private void btnAgregarUsuarioActionPerformed(java.awt.event.ActionEvent evt) {\n String v_nombre=\" \";\n\n if(txtNombreAU.getText().length()==0){\n Utilidades.mensajeInformacion(\"Digite un nombre, por favor\", \"Informacion\");\n return;\n }\n v_nombre=txtNombreAU.getText(); \n //Valido la contrasenia\n if(txtContraseniaAU.getText().length()==0){\n Utilidades.mensajeInformacion(\"Es obligatorio ingresar una contraseña\", \"Informacion\");\n return;\n }\n if(!validarContraseniaUsuario(txtContraseniaAU.getText())){\n return;\n }\n String v_contrasenia=txtContraseniaAU.getText();\n //Valido nombre completo\n if(txtNombreCompletoAU.getText().length()==0){\n Utilidades.mensajeInformacion(\"Es obligatorio ingresar el nombre completo\", \"Informacion\");\n return;\n }\n String v_nombreCompleto=txtNombreCompletoAU.getText();\n \n //Valido que se escogio un valor para el cargo\n int v_cargo=0;\n //10 = Administrador, 20=Funcionario\n if(rbtnAdministradorAU.isSelected()){\n v_cargo=10;\n }else if(rbtnFuncionarioAU.isSelected()){\n v_cargo=20;\n }else{\n Utilidades.mensajeInformacion(\"Escoga un cargo\", \"Informacion\");\n return;\n }\n \n //Creo y agreggo un usuario dependiendo del cargo escogido (Administrador o funcionario)\n try{\n boolean agregado=false;\n if(v_cargo==10){\n Administrador nuevoUsuario=new Administrador(v_nombre, v_contrasenia, v_nombreCompleto, null);\n agregado = administrador.agregarUsuario(nuevoUsuario);\n\n } \n if(v_cargo==20){\n Funcionario nuevoUsuario=new Funcionario(v_nombre, v_contrasenia, v_nombreCompleto, null);\n agregado = administrador.agregarUsuario(nuevoUsuario);\n }\n\n\n if(agregado){\n Utilidades.mensajeExito(\"Se agrego el Usuario\", \"Agregacion Exitosa\");\n limpiarCamposAgregarUsuario();\n }else{\n Utilidades.mensajeError(\"El Usuario a agregar ya existe\", \"Error\");\n }\n\n }catch (IOException ex) {\n Logger.getLogger(Funcionario.class.getName()).log(Level.SEVERE, null, ex);\n Utilidades.mensajeAdvertencia(\"Se ha interrumpido la conexion con el servidor\", \"Error\");\n }\n \n }", "@Override\r\n public String toString() {\r\n\t\tStringBuilder sb=new StringBuilder();\r\n\t\tsb.append(\"Usuario{\");\r\n\t\tsb.append(\"emailUsuario\" ).append(\"=\").append(emailUsuario).append(\"|\");\r\n\t\tsb.append(\"contrasenia\" ).append(\"=\").append(contrasenia).append(\"|\");\r\n\t\tsb.append(\"fechaCreacion\" ).append(\"=\").append(fechaCreacion).append(\"|\");\r\n\t\tsb.append(\"nombre\" ).append(\"=\").append(nombre).append(\"|\");\r\n\t\tsb.append(\"apellidoPaterno\" ).append(\"=\").append(apellidoPaterno).append(\"|\");\r\n\t\tsb.append(\"apellidoMaterno\" ).append(\"=\").append(apellidoMaterno).append(\"|\");\r\n\t\tsb.append(\"estatus\" ).append(\"=\").append(estatus).append(\"|\");\r\n\t\tsb.append(\"serialVersionUID=\").append(serialVersionUID).append(\"}\");\r\n\t\treturn sb.toString();\r\n\t}", "public NewUsuario getParametrosEntrada() {\r\n\t\treturn parametrosEntrada;\r\n\t}", "public alterarSenhaCliente() {\n }", "public java.lang.String getClaveUsuario() {\n return claveUsuario;\n }", "public int getIdUsuario() {\n return idUsuario;\n }", "@Override\r\n public void modificarUsuario(User u) {\r\n throw new UnsupportedOperationException(\"Not supported yet.\"); //To change body of generated methods, choose Tools | Templates.\r\n }", "Usuario validarUsuario(Usuario usuario) throws Exception;", "public void actionPerformed(ActionEvent arg0) {\n\t\t\t\tUsuarioPojo user = null;\r\n\t\t\t\tUsuarioPersistencia up = new UsuarioPersistencia();\r\n\r\n\t\t\t\t//int id = up.obtenerIdEmple();\r\n\t\t\t\tString usuarioMail = txtUsuario.getText();\r\n\t\t\t\tString password = new String(pwdPass.getPassword()); // DNI de momento\r\n\t\t\t\tString passwordC = new String(pwdConfPass.getPassword());\r\n\t\t\t\tString apenom = txtApenom.getText();\r\n\t\t\t\tString dni = txtDni.getText();\r\n\t\t\t\tint numSS = Integer.parseInt(txtSegSoc.getText());\r\n\t\t\t\tString cuenta = txtCuenta.getText();\r\n\r\n\t\t\t\tif (password.equals(passwordC)) {\r\n\t\t\t\t\t// creamos un objeto usuario si coinciden las contraseñas\r\n\t\t\t\t\tuser = new UsuarioPojo(apenom, numSS, cuenta, dni, usuarioMail, password);\r\n\t\t\t\t}\r\n\r\n\t\t\t\tif (user != null) {\r\n\t\t\t\t\t// insertaremos el usuario si coinciden las contraseñas\r\n\t\t\t\t\tup = new UsuarioPersistencia();\r\n\t\t\t\t\tint res = up.insertarUser(user);\r\n\r\n\t\t\t\t\tif (res == 1) { // se habrá registrado al usuario\r\n\t\t\t\t\t\tSystem.out.println(\"Insertado correctamente\");\r\n\t\t\t\t\t\tJOptionPane.showMessageDialog(null, \"Registro insertado correctamente\",\r\n\t\t\t\t\t\t\t\t\"Resultado del Registro\", JOptionPane.INFORMATION_MESSAGE);\r\n\t\t\t\t\t\tdispose(); // dispose cierra ventana actual, System.exit(0) sale del programa\r\n\t\t\t\t\t}\r\n\t\t\t\t} else {\r\n\t\t\t\t\t// mostramos msg si no coinciden las contraseñas, manteniendo el control en dreg\r\n\t\t\t\t\tSystem.out.println(\"No insertado\");\r\n\t\t\t\t\tJOptionPane.showMessageDialog(null, \"Contraseñas introducidas no coinciden\", \"Error de contraseña\",\r\n\t\t\t\t\t\t\tJOptionPane.WARNING_MESSAGE);\r\n\t\t\t\t\t// limpiamos campos de contraseña\r\n\t\t\t\t}\r\n\t\t\t}", "public UsuarioTable getUsuarioLogueado() {\n String usuario = FacesContext.getCurrentInstance().getExternalContext().getRemoteUser();\n return getUsuarioFacade().obtenerIDPorNombre(usuario);\n }", "public void cadastrarUsuario(View view){\n String textoNome= campoNome.getText().toString();\n String textoEmail= campoEmail.getText().toString();\n String textoSenha= campoSenha.getText().toString();\n\n\n if(!textoNome.isEmpty()){\n if(!textoEmail.isEmpty()){\n if(!textoSenha.isEmpty()){\n Usuario usuario = new Usuario();\n usuario.setNome(textoNome);\n usuario.setEmail(textoEmail);\n usuario.setSenha(textoSenha);\n salvarUsuario(usuario);\n\n home();\n finish();\n }else{ exibirMensagem(\"preencha sua senha\"); }\n }else{ exibirMensagem(\"preencha seu email\"); }\n }else{ exibirMensagem(\"Digite seu nome\"); }\n }", "public GrupoUsuarioDTO(Long idGrupoUsuario, String descripcion, String estado ) {\n super();\n this.idGrupoUsuario = idGrupoUsuario;\n this.descripcion = descripcion;\n this.estado = estado;\n }", "public int getId_usuario() {\n\treturn id_usuario;\n }", "@Override\n\tpublic Usuario createUsuario(Usuario usr) {\n\t\treturn null;\n\t}", "public String getId_usuario() {\n return id_usuario;\n }", "public Cliente registroUsuario(Ventana vis, Modelo mod) {\n\t\tJTextField dni = vis.panelLogin.textFieldDNI;\n\t\tJTextField nombre = vis.panelLogin.textFieldNombre;\n\t\tJTextField apellido = vis.panelLogin.textFieldApellido;\n\t\tDate fechaNac = vis.panelLogin.calendarioFechaNac.getDate();\n\t\tchar sexo = cambiarSexoAChar(vis.panelLogin.cmbBoxSexo);\n\t\tfinal char[] contra = vis.panelLogin.passFieldContrasenia.getPassword();\n\t\tif (validarSoloLetras(nombre) && validarSoloLetras(apellido) && (nombre.getText().length() > 0) && (apellido.getText().length() > 0) && validarDNI(dni) && validarFecha(fechaNac) && validarContrasenia(contra)) {\n\t\t\tif (comprobarDNIenBD(vis.panelLogin.textFieldDNI.getText(), mod) == false) {\n\t\t\t\treturn (new Cliente(dni.getText(), nombre.getText(), apellido.getText(), fechaNac, sexo, encriptarContra(contra)));\n\t\t\t} else {\n\t\t\t\tJOptionPane.showMessageDialog(null, \"El usuario introducido ya esta registrado, porfavor inicie sesion\", \"Usuario ya registrado\", JOptionPane.INFORMATION_MESSAGE);\n\t\t\t}\n\t\t}\n\t\treturn null;\n\t}", "public VentanaConsultaUser(Connection conexion){\n\t\tsuper(\"Consultas\");\n\t\n\t\tthis.conexion=conexion;\n\t\tthis.setSize(1000,1000);\n\t\tinicializarComponentes();\n\t\t//Evento\n\t\tthis.setDefaultCloseOperation(WindowConstants.DO_NOTHING_ON_CLOSE);\n\t\t this.addWindowListener(new WindowAdapter(){\n\t public void windowClosing(WindowEvent we){\n\t dispose();\n\t new Login();\n\t }\n\t });\n\t\ttablas.addActionListener(this);\n\t\tthis.setResizable(true);\n\t\tthis.setLocationRelativeTo(null);\n\t\tthis.setVisible(true);\n\t\t// Set default close\n\t}" ]
[ "0.6968886", "0.6896569", "0.6784948", "0.677561", "0.6701073", "0.6627332", "0.6582686", "0.6574203", "0.64368755", "0.64225245", "0.6414877", "0.6387678", "0.6379391", "0.6379391", "0.63732386", "0.63732386", "0.63485116", "0.63485116", "0.63408285", "0.6335758", "0.63304853", "0.63111955", "0.6294226", "0.6283282", "0.627645", "0.6274055", "0.62516856", "0.6228486", "0.6225407", "0.62013096", "0.617189", "0.61648655", "0.6131964", "0.6119813", "0.61176705", "0.611531", "0.6109232", "0.6109232", "0.6101962", "0.6098147", "0.6096903", "0.60849327", "0.6079424", "0.6073544", "0.6073544", "0.60460263", "0.60139185", "0.6007405", "0.60037804", "0.6000696", "0.59872353", "0.59817827", "0.5966027", "0.59574425", "0.59527135", "0.59437627", "0.5937623", "0.59342384", "0.5929691", "0.59247166", "0.5917067", "0.5906738", "0.589597", "0.58927834", "0.5886062", "0.58781266", "0.5867283", "0.5865045", "0.58634865", "0.58624136", "0.58523446", "0.58508444", "0.5846242", "0.58416265", "0.5841355", "0.5841355", "0.5834948", "0.5825774", "0.5825649", "0.58081686", "0.5804521", "0.5803717", "0.5802138", "0.57986826", "0.57883734", "0.578661", "0.57823366", "0.57753843", "0.5774582", "0.57709354", "0.576717", "0.576652", "0.5761328", "0.5761309", "0.57597536", "0.57567483", "0.57477015", "0.57471645", "0.57421154", "0.5741334" ]
0.7219739
0
TODO: place custom component creation code here
private void createUIComponents() { }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "Component createComponent();", "Component createComponent();", "@Override\n public void initComponent() {\n }", "@Override\n public void initComponent() {\n }", "Component getComponent() {\n/* 224 */ return this.component;\n/* */ }", "@Override\r\n public void initComponent() {\n }", "private void createUIComponents() {\n }", "private void createdComponent() {\r\n\r\n\t\tloadImage();\r\n\t\tresizeImage();\r\n\t\ttry {\r\n\t\t\tif (customFont == null) {\r\n\t\t\t\tcustomFont = FontLoader.getInstance().getXenipa();\r\n\t\t\t\tif (customFont == null) {\r\n\t\t\t\t\tcustomFont = new FontLoader().importFont();\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t} catch (FontFormatException e1) {\r\n\t\t\te1.printStackTrace();\r\n\t\t} catch (IOException e1) {\r\n\t\t\te1.printStackTrace();\r\n\t\t}\r\n\r\n\t\ttry {\r\n\t\t\tUIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());\r\n\t\t} catch (ClassNotFoundException e) {\r\n\t\t\te.printStackTrace();\r\n\t\t} catch (InstantiationException e) {\r\n\t\t\te.printStackTrace();\r\n\t\t} catch (IllegalAccessException e) {\r\n\t\t\te.printStackTrace();\r\n\t\t} catch (UnsupportedLookAndFeelException e) {\r\n\t\t\te.printStackTrace();\r\n\t\t}\r\n\t\tthis.init();\r\n\t\tthis.createpanel1();\r\n\t\tthis.createpanel2();\r\n\t\tthis.createpanel3();\r\n\t\tthis.createpanel4();\r\n\t\tthis.revalidate();\r\n\t}", "ComponentType createComponentType();", "private void initcomponent() {\n\r\n\t}", "public abstract void setupComponent();", "private void initComponents() {\n\t\t\n\t}", "private void initComponents() {\n\t\t\n\t}", "DsmlComponent createDsmlComponent();", "@Override\npublic void childComponentsAdditionStarted() {\n\t\n}", "private void createComponents(String label) {\n itsCombo = createComboBox();\n JScrollPane scroll = new JScrollPane(itsCombo);\n scroll.setPreferredSize(new Dimension(WIDTH, HEIGHT));\n\n LabeledComponent c = new LabeledComponent(\"Symbol\", itsCombo);\n itsComp = c;\n }", "public Component() {\n }", "@Override\n public void componentOpened() {\n }", "@Override\n public void componentOpened() {\n }", "@Override\n public void componentOpened() {\n }", "@Override\n public void componentOpened() {\n }", "@Override\n public void componentOpened() {\n }", "@Override\npublic void setUIComponent(VirtualComponent c) {\n\t\n}", "private Component createComponent(XmlNode node, String id) {\n\n Component comp = null;\n String tag = node.getTag();\n\n if (tag.equals(TAG_PANEL)) {\n comp = layoutContainer(new JPanel(), node, node.getChildren());\n } else if (tag.equals(TAG_BORDER)) {\n comp = layoutBorder(node, node.getChildren());\n } else if (tag.equals(TAG_TEXTINPUT)) {\n int cols = node.getAttribute(ATTR_COLS, -1);\n int rows = node.getAttribute(ATTR_ROWS, -1);\n String value = node.getAttribute(ATTR_VALUE, \"\");\n\n JTextComponent textComp;\n if (rows > 1) {\n if (cols < 0) {\n cols = 30;\n }\n textComp = new JTextArea(value, rows, cols);\n } else {\n if (cols == -1) {\n textComp = new JTextField(value);\n } else {\n textComp = new JTextField(value, cols);\n }\n ((JTextField) textComp).addActionListener(this);\n }\n comp = textComp;\n String action = node.getAttribute(ATTR_ACTION, (String) null);\n if (action != null) {\n componentToAction.put(textComp, action);\n }\n } else if (tag.equals(TAG_MENUITEM) || tag.equals(TAG_CBMENUITEM)) {\n String actionTemplate = null;\n JMenuItem mi;\n String label = node.getAttribute(ATTR_LABEL, \"\");\n String action = node.getAttribute(ATTR_ACTION);\n String value = node.getAttribute(ATTR_VALUE);\n String key = node.getAttribute(ATTR_KEY);\n if ((action == null) && (actionTemplate != null)\n && (value != null)) {\n action = GuiUtils.replace(actionTemplate, \"%value%\", value);\n }\n if ((key != null) && !key.startsWith(\"group:\")) {\n label = label + \" \" + key;\n }\n\n if (node.getTag().equals(TAG_CBMENUITEM)) {\n boolean initValue = node.getAttribute(ATTR_VALUE, true);\n JCheckBoxMenuItem cbmi = new JCheckBoxMenuItem(label,\n initValue);\n String group = node.getAttribute(ATTR_GROUP, (String) null);\n addToGroup(group, cbmi);\n mi = cbmi;\n if (action != null) {\n Hashtable actions = new Hashtable();\n actions.put(ATTR_ACTION, action);\n actions.put(ATTR_VALUE, new Boolean(initValue));\n componentToAction.put(cbmi, actions);\n cbmi.addItemListener(this);\n if ((group == null) || initValue) {\n itemStateChanged(new ItemEvent(cbmi, 0, cbmi,\n ItemEvent.ITEM_STATE_CHANGED));\n }\n }\n\n if (key != null) {\n if (key.startsWith(\"group:\")) {\n if (group != null) {\n key = key.substring(6);\n keyToComponent.put(key.toLowerCase(), group);\n }\n } else {\n keyToComponent.put(key.toLowerCase(), mi);\n }\n }\n } else {\n mi = new JMenuItem(label);\n if (action != null) {\n mi.setActionCommand(action);\n mi.addActionListener(this);\n if (key != null) {\n keyToComponent.put(key.toLowerCase(), mi);\n }\n }\n }\n if (id != null) {\n idToMenuItem.put(id, mi);\n }\n comp = mi;\n } else if (tag.equals(TAG_MENU)) {\n Vector children = node.getChildren();\n JMenu menu = new JMenu(node.getAttribute(ATTR_LABEL, \"\"));\n comp = menu;\n for (int i = 0; i < children.size(); i++) {\n XmlNode childElement = (XmlNode) children.get(i);\n if (childElement.getTag().equals(TAG_SEPARATOR)) {\n menu.addSeparator();\n\n continue;\n }\n Component childComponent = xmlToUi(childElement);\n if (childComponent == null) {\n continue;\n }\n menu.add(childComponent);\n }\n } else if (tag.equals(TAG_MENUBAR)) {\n Vector children = node.getChildren();\n JMenuBar menuBar = new JMenuBar();\n comp = menuBar;\n for (int i = 0; i < children.size(); i++) {\n XmlNode childElement = (XmlNode) children.get(i);\n Component childComponent = xmlToUi(childElement);\n if (childComponent == null) {\n continue;\n }\n menuBar.add(childComponent);\n }\n } else if (tag.equals(TAG_SPLITPANE)) {\n Vector xmlChildren = node.getChildren();\n if (xmlChildren.size() != 2) {\n throw new IllegalArgumentException(\n \"splitpane tag needs to have 2 children \" + node);\n }\n XmlNode leftNode = getReffedNode((XmlNode) xmlChildren.get(0));\n XmlNode rightNode = getReffedNode((XmlNode) xmlChildren.get(1));\n Component leftComponent = xmlToUi(leftNode);\n Component rightComponent = xmlToUi(rightNode);\n boolean continuous = node.getAttribute(ATTR_CONTINUOUS, true);\n int orientation = findValue(node.getAttribute(ATTR_ORIENTATION,\n (String) null), SPLITPANE_NAMES,\n SPLITPANE_VALUES);\n\n JSplitPane split = new JSplitPane(orientation, continuous,\n leftComponent, rightComponent);\n int divider = node.getAttribute(ATTR_DIVIDER, -1);\n if (divider != -1) {\n split.setDividerLocation(divider);\n }\n split.setOneTouchExpandable(\n node.getAttribute(ATTR_ONETOUCHEXPANDABLE, true));\n double resizeweight = node.getAttribute(ATTR_RESIZEWEIGHT, -1.0);\n if (resizeweight != -1.0) {\n split.setResizeWeight(resizeweight);\n }\n comp = split;\n } else if (tag.equals(TAG_LABEL)) {\n String label = node.getAttribute(ATTR_LABEL, \"\");\n comp = new JLabel(label, getAlign(node));\n } else if (tag.equals(TAG_IMAGE)) {\n comp = makeImageButton(node, null, null);\n } else if (tag.equals(TAG_SHAPEPANEL)) {\n comp = new ShapePanel(this, node);\n } else if (tag.equals(TAG_BUTTON)) {\n JButton b = new JButton(node.getAttribute(ATTR_LABEL, \"\"));\n b.setActionCommand(node.getAttribute(ATTR_ACTION, \"No action\"));\n b.addActionListener(this);\n comp = b;\n } else if (tag.equals(TAG_CHOICE)) {\n Choice b = new java.awt.Choice();\n String action = node.getAttribute(ATTR_ACTION,\n (String) null);\n int selected = node.getAttribute(ATTR_SELECTED, 0);\n Hashtable actions = new Hashtable();\n for (int i = 0; i < node.size(); i++) {\n XmlNode child = getReffedNode(node.get(i));\n if ( !child.getTag().equals(TAG_ITEM)) {\n throw new IllegalArgumentException(\"Bad choice item:\"\n + child);\n }\n b.add(child.getAttribute(ATTR_LABEL, \"\"));\n String value = child.getAttribute(ATTR_VALUE, (String) null);\n if (value != null) {\n actions.put(ATTR_VALUE + i, value);\n }\n String subAction = child.getAttribute(ATTR_ACTION,\n (String) null);\n if (subAction != null) {\n actions.put(ATTR_ACTION + i, subAction);\n }\n }\n comp = b;\n if (action != null) {\n actions.put(ATTR_ACTION, action);\n componentToAction.put(b, actions);\n b.select(selected);\n b.addItemListener(this);\n itemStateChanged(new ItemEvent(b, 0, b,\n ItemEvent.ITEM_STATE_CHANGED));\n }\n } else if (tag.equals(TAG_CHECKBOX)) {\n JCheckBox b = new JCheckBox(node.getAttribute(ATTR_LABEL, \"\"),\n node.getAttribute(ATTR_VALUE, false));\n String action = node.getAttribute(ATTR_ACTION, (String) null);\n comp = b;\n if (action != null) {\n componentToAction.put(comp, action);\n b.addItemListener(this);\n itemStateChanged(new ItemEvent(b, 0, b,\n ItemEvent.ITEM_STATE_CHANGED));\n }\n } else {\n comp = new JLabel(\"Unknown tag:\" + tag);\n System.err.println(\"Unknown tag:\" + node);\n }\n\n return comp;\n\n }", "public interface DomainBuilderComponent extends PropertyChangeListener {\n\t/**\n\t * get name of the component\n\t * @return\n\t */\n\tpublic String getName();\n\t\n\t/**\n\t * get icon for the component\n\t * @return\n\t */\n\tpublic Icon getIcon();\n\t\n\t\n\t/**\n\t * get component\n\t * @return\n\t */\n\tpublic Component getComponent();\n\t\n\t\n\t/**\n\t * get menu bar\n\t * @return\n\t */\n\tpublic JMenuBar getMenuBar();\n\t\n\t\n\t/**\n\t * load whatever resources one needs to get this piece working \n\t */\n\tpublic void load();\n\t\n\t/**\n\t * dispose of this component\n\t */\n\tpublic void dispose();\n}", "protected void createComponents() {\n sampleText = new JTextField(20);\n displayArea = new JLabel(\"\");\n displayArea.setPreferredSize(new Dimension(200, 75));\n displayArea.setMinimumSize(new Dimension(200, 75));\n }", "@Override\npublic void add(VirtualContainer parent, VirtualComponent comp, int pos) {\n\t\n}", "@Override\n public abstract String getComponentType();", "@Override\n\tpublic void setComponentLabel(String label) {\n\t\t\n\t}", "ViewComponent createViewComponent();", "@SuppressWarnings(\"unchecked\")\n private void create() {\n components.clear();\n\n if (content != null) {\n content.clearChildren();\n }\n else {\n content = new Container();\n content.setInsets(INSETS);\n }\n\n GuiComponent guiComponent = (GuiComponent) getReflectedItem().getValue();\n\n // let the user choose which type of backgroundComponent they want.\n Label label = content.addChild(new Label(\"Type\"), 0, 0);\n label.setTextHAlignment(HAlignment.Right);\n label.setInsets(INSETS);\n Container backgroundTypeContainer = content.addChild(new Container(), 0, 1);\n\n ColorRGBA oldColor = BackgroundUtils.getBackgroundColor(guiComponent);\n\n Button colorOnlyBgButton = backgroundTypeContainer.addChild(new Button(\"Color Only\"), 0, 0);\n colorOnlyBgButton.addClickCommands(source -> {\n if (!(guiComponent instanceof QuadBackgroundComponent)) {\n setValue(new QuadBackgroundComponent(oldColor));\n create();\n }\n });\n\n Button colorAndImageBgButton = backgroundTypeContainer.addChild(new Button(\"Color and Image\"), 0, 1);\n colorAndImageBgButton.addClickCommands(source -> {\n if (!(guiComponent instanceof TbtQuadBackgroundComponent)) {\n setValue(BackgroundComponents.gradient(oldColor));\n create();\n }\n });\n\n if (guiComponent instanceof QuadBackgroundComponent) {\n\n try {\n\n Method getter = QuadBackgroundComponent.class.getDeclaredMethod(\"getColor\");\n Method setter = QuadBackgroundComponent.class.getDeclaredMethod(\"setColor\", ColorRGBA.class);\n\n label = content.addChild(new Label(\"Color\"), 1, 0);\n label.setTextHAlignment(HAlignment.Right);\n label.setInsets(INSETS);\n\n ColorRGBAComponent bgColorComponent = new ColorRGBAComponent(guiComponent, getter, setter);\n content.addChild(bgColorComponent.getPanel(), 1, 1);\n components.add(bgColorComponent);\n\n // margin\n getter = QuadBackgroundComponent.class.getDeclaredMethod(\"getMargin\");\n setter = QuadBackgroundComponent.class.getDeclaredMethod(\"setMargin\", Vector2f.class);\n\n label = content.addChild(new Label(\"Margin\"), 2, 0);\n Vector2fComponent marginComponent = new Vector2fComponent(guiComponent, getter, setter);\n content.addChild(marginComponent.getPanel(), 2, 1);\n components.add(marginComponent);\n\n } catch (NoSuchMethodException e) {\n e.printStackTrace();\n }\n\n }\n else if (guiComponent instanceof TbtQuadBackgroundComponent) {\n\n TbtQuadBackgroundComponent backgroundComponent = (TbtQuadBackgroundComponent) guiComponent;\n\n try {\n Method getter = TbtQuadBackgroundComponent.class.getDeclaredMethod(\"getColor\");\n Method setter = TbtQuadBackgroundComponent.class.getDeclaredMethod(\"setColor\", ColorRGBA.class);\n\n label = content.addChild(new Label(\"Color\"), 1, 0);\n label.setTextHAlignment(HAlignment.Right);\n label.setInsets(INSETS);\n\n ColorRGBAComponent bgColorComponent = new ColorRGBAComponent(guiComponent, getter, setter);\n content.addChild(bgColorComponent.getPanel(), 1, 1);\n components.add(bgColorComponent);\n\n label = content.addChild(new Label(\"Image\"), 2, 0);\n label.setTextHAlignment(HAlignment.Right);\n label.setInsets(INSETS);\n\n Button browseImageButton = content.addChild(new Button(\"Select Background Image...\"), 2, 1);\n browseImageButton.setTextVAlignment(VAlignment.Center);\n browseImageButton.addClickCommands(source -> {\n\n JFileChooser jfc = new JFileChooser(FileSystemView.getFileSystemView().getHomeDirectory());\n jfc.setDialogTitle(\"Select a Background Image...\");\n jfc.setMultiSelectionEnabled(false);\n jfc.setFileSelectionMode(JFileChooser.FILES_ONLY);\n jfc.setAcceptAllFileFilterUsed(false);\n FileNameExtensionFilter filter = new FileNameExtensionFilter(\"PNG Images\", \"png\");\n jfc.addChoosableFileFilter(filter);\n int returnValue = jfc.showOpenDialog(null);\n\n if (returnValue == JFileChooser.APPROVE_OPTION) {\n\n File file = jfc.getSelectedFile();\n\n\n try {\n\n byte[] imageData = Files.readAllBytes(file.toPath());\n byte[] stringData = Base64.getEncoder().encode(imageData);\n\n String imageString = new String(stringData);\n\n // PanelBackground panelBackground = (PanelBackground) getReflectedProperty().getValue();\n // panelBackground.setBase64Image(imageString);\n\n Texture texture = new TextureUtils().fromBase64(imageString);\n\n backgroundComponent.setTexture(texture);\n\n\n } catch (IOException e) {\n e.printStackTrace();\n }\n }\n\n });\n\n // margin\n getter = TbtQuadBackgroundComponent.class.getDeclaredMethod(\"getMargin\");\n setter = TbtQuadBackgroundComponent.class.getDeclaredMethod(\"setMargin\", Vector2f.class);\n\n label = content.addChild(new Label(\"Margin\"), 3, 0);\n Vector2fComponent marginComponent = new Vector2fComponent(guiComponent, getter, setter);\n content.addChild(marginComponent.getPanel(), 3, 1);\n components.add(marginComponent);\n\n\n } catch (NoSuchMethodException e) {\n e.printStackTrace();\n }\n\n }\n\n//\n// this.content = new RollupPanel(\"\", contentContainer, null);\n// this.content.setOpen(false);\n//\n// // background Image\n// Container bgImageContainer = contentContainer.addChild(new Container(new SpringGridLayout(Axis.Y, Axis.X, FillMode.Last, FillMode.Last)), 0, 0);\n// Label bgImageLabel = bgImageContainer.addChild(new Label(\"Background Image\"), 0, 0);\n// bgImageLabel.setTextVAlignment(VAlignment.Center);\n// bgImageLabel.setInsets(new Insets3f(0.0F, 2.0F, 0.0F, 5.0F));\n// Button browseImageButton = bgImageContainer.addChild(new Button(\"Browse...\"), 0, 1);\n// Button removeImageButton = bgImageContainer.addChild(new Button(\"Remove\"), 0, 2);\n// bgImageContainer.addChild(new Container(), 0, 3);\n//\n// browseImageButton.addClickCommands(source -> {\n//\n// JFileChooser jfc = new JFileChooser(FileSystemView.getFileSystemView().getHomeDirectory());\n// jfc.setDialogTitle(\"Select a Background Image...\");\n// jfc.setMultiSelectionEnabled(false);\n// jfc.setFileSelectionMode(JFileChooser.FILES_ONLY);\n// jfc.setAcceptAllFileFilterUsed(false);\n// FileNameExtensionFilter filter = new FileNameExtensionFilter(\"PNG Images\", \"png\");\n// jfc.addChoosableFileFilter(filter);\n// int returnValue = jfc.showOpenDialog(null);\n//\n// if (returnValue == JFileChooser.APPROVE_OPTION) {\n//\n// File file = jfc.getSelectedFile();\n//\n// try {\n// byte[] imageData = Files.readAllBytes(file.toPath());\n// byte[] stringData = Base64.getEncoder().encode(imageData);\n//\n// String imageString = new String(stringData);\n//\n// PanelBackground panelBackground = (PanelBackground) getReflectedProperty().getValue();\n// panelBackground.setBase64Image(imageString);\n//\n// } catch (IOException e) {\n// e.printStackTrace();\n// }\n// }\n//\n// });\n//\n// removeImageButton.addClickCommands(source -> {\n// PanelBackground panelBackground = (PanelBackground) getReflectedProperty().getValue();\n// panelBackground.setBase64Image(\"\");\n// });\n//\n//\n// try {\n//\n// // color\n// Method get = PanelBackground.class.getMethod(\"getColor\");\n// Method set = PanelBackground.class.getMethod(\"setColor\", ColorRGBA.class);\n//\n// ColorRGBAComponent bgColorComponent = new ColorRGBAComponent(getReflectedProperty().getValue(), get, set);\n// bgColorComponent.setPropertyName(\"Color\");\n// contentContainer.addChild(bgColorComponent.getPanel());\n// components.add(bgColorComponent);\n//\n// // insetTop\n// get = PanelBackground.class.getMethod(\"getInsetTop\");\n// set = PanelBackground.class.getMethod(\"setInsetTop\", int.class);\n//\n// IntComponent insetTopComponent = new IntComponent(getReflectedProperty().getValue(), get, set);\n// insetTopComponent.setPropertyName(\"Inset Top\");\n// contentContainer.addChild(insetTopComponent.getPanel());\n// components.add(insetTopComponent);\n//\n// // insetLeft\n// get = PanelBackground.class.getMethod(\"getInsetLeft\");\n// set = PanelBackground.class.getMethod(\"setInsetLeft\", int.class);\n//\n// IntComponent insetLeftComponent = new IntComponent(getReflectedProperty().getValue(), get, set);\n// insetLeftComponent.setPropertyName(\"Inset Left\");\n// contentContainer.addChild(insetLeftComponent.getPanel());\n// components.add(insetLeftComponent);\n//\n// // insetBottom\n// get = PanelBackground.class.getMethod(\"getInsetBottom\");\n// set = PanelBackground.class.getMethod(\"setInsetBottom\", int.class);\n//\n// IntComponent insetBottomComponent = new IntComponent(getReflectedProperty().getValue(), get, set);\n// insetBottomComponent.setPropertyName(\"Inset Bottom\");\n// contentContainer.addChild(insetBottomComponent.getPanel());\n// components.add(insetBottomComponent);\n//\n// // insetRight\n// get = PanelBackground.class.getMethod(\"getInsetRight\");\n// set = PanelBackground.class.getMethod(\"setInsetRight\", int.class);\n//\n// IntComponent insetRightComponent = new IntComponent(getReflectedProperty().getValue(), get, set);\n// insetRightComponent.setPropertyName(\"Inset Right\");\n// contentContainer.addChild(insetRightComponent.getPanel());\n// components.add(insetRightComponent);\n//\n// // zOffset\n// get = PanelBackground.class.getMethod(\"getzOffset\");\n// set = PanelBackground.class.getMethod(\"setzOffset\", float.class);\n//\n// FloatComponent zOffsetComponent = new FloatComponent(getReflectedProperty().getValue(), get, set);\n// zOffsetComponent.setPropertyName(\"Z-Offset\");\n// contentContainer.addChild(zOffsetComponent.getPanel());\n// components.add(zOffsetComponent);\n//\n// } catch (NoSuchMethodException e) {\n// e.printStackTrace();\n// }\n\n\n }", "@Override\n public void componentOpened() {\n super.componentOpened();\n\n }", "private JComponent createComponent(ViewModel<?> model)\r\n {\r\n JComponent comp = ControllerFactory.createComponent(model, null);\r\n if (comp instanceof JCheckBox)\r\n {\r\n ((JCheckBox)comp).setText(null);\r\n }\r\n return comp;\r\n }", "private void createUIComponents() {\n editor = createEditor(project, document);\n splitter = new JBSplitter(0.4f);\n ((JBSplitter) splitter).setFirstComponent(editor.getComponent());\n// ((JBSplitter) splitter).setSecondComponent();\n }", "@Override\r\n public void addLayoutComponent(String s, Component component) {\r\n\r\n }", "@Override\n public JComponent getComponent () {\n return this;\n }", "@Override\npublic void add(VirtualComponent comp, int pos) {\n\t\n}", "protected abstract ActivityComponent setupComponent();", "public abstract Component getComponentByName(String name);", "private void createUIComponents() {\n valueTextField = new JTextField();\n FixedService f = new FixedService();\n valueTextField.setText(\"£ \" + f.getPrice(\"Fixed\"));\n valueTextField.setBorder(new EmptyBorder(0, 0, 0, 0));\n }", "private void createUIComponents() {\n bt1 = new JButton(\"Hola\");\n }", "private void initComponentsCustom() {\n SGuiUtils.setWindowBounds(this, 480, 300);\n\n moTextUnitSymbol.setTextSettings(jlUnitSymbol.getText(), 15, 1);\n moTextUnitName.setTextSettings(jlName.getText(), 150, 1);\n moTextShortName.setTextSettings(SGuiUtils.getLabelName(jlAnalysisShortName.getText()), 10, 1);\n moTextName.setTextSettings(SGuiUtils.getLabelName(jlName.getText()), 100, 1);\n moKeyAnalysisType.setKeySettings(miClient, SGuiUtils.getLabelName(jlAnalysisType), true);\n\n moFields.addField(moTextUnitSymbol);\n moFields.addField(moTextUnitName);\n \n moFields.addField(moTextShortName);\n moFields.addField(moTextName);\n \n moFields.addField(moKeyAnalysisType);\n\n moFields.setFormButton(jbSave);\n }", "private void createUIComponents() {\n this.selectorApplication = new AzureArtifactComboBox(project, true);\n this.selectorApplication.refreshItems();\n }", "String constructComponentName() {\n return base + nameCounter++;\n }", "protected abstract Component addContent();", "private void createComponentBox() {\r\n\t\tthis.componentBox = new Vector<String>();\r\n\t\tthis.componentBox.add(\"Sword\");\r\n\t\tthis.componentBox.add(\"Two-handed Sword\");\r\n\t\tthis.componentBox.add(\"Staff\");\r\n\t\tthis.componentBox.add(\"Axe\");\r\n\t\tthis.componentBox.add(\"Hammer\");\r\n\t\tthis.componentBox.add(\"Bow\");\r\n\t\tthis.componentBox.add(\"Crossbow\");\r\n\t\tthis.componentBox.add(\"Wand\");\r\n\t\tthis.componentBox.add(\"Spear\");\r\n\t\tthis.componentBox.add(\"Bottle\");\r\n\t}", "@Override\n\tprotected void createCompButtons() {\n\t\tbuildCompButtons();\n\t}", "private JComponent initComponent(Class compClass, String label) {\r\n\t\tJComponent comp = null;\r\n\t\tif (compClass == JLabel.class) {\r\n\t\t\tcomp = new JLabel(label);\t\t\t\r\n\t\t}\r\n\t\telse if (compClass == JTextField.class) {\r\n\t\t\tcomp = new JTextField();\t\t\t\r\n\t\t}\r\n\t\telse if (compClass == JComboBox.class) {\r\n\t\t\tcomp = new JComboBox();\r\n\t\t\t((JComboBox) comp).addActionListener(this);\r\n\t\t}\r\n\t\telse if (compClass == JButton.class) {\r\n\t\t\tcomp = new JButton(label);\r\n\t\t\t((JButton) comp).addActionListener(this);\r\n\t\t}\r\n\t\telse if (compClass == JRadioButton.class) {\r\n\t\t\tcomp = new JRadioButton(label);\r\n\t\t\t((JRadioButton) comp).addActionListener(this);\r\n\t\t}\r\n\t\telse if (compClass == JMenuItem.class) {\r\n\t\t\tcomp = new JMenuItem(label);\r\n\t\t\t((JMenuItem) comp).addActionListener(this);\r\n\t\t}\r\n\t\telse if (compClass == JCheckBox.class) {\r\n\t\t\tcomp = new JCheckBox(label);\r\n\t\t\t((JCheckBox) comp).addActionListener(this);\r\n\t\t}\r\n\t\tcomp.setFont(tahoma);\r\n\t\treturn comp;\r\n\t}", "private void initComponent() {\n\t\taddGrid();\n\t\taddToolBars();\n\t}", "protected void onComponentRendered()\n\t{\n\t}", "@Override\n\tpublic Component getComponent() {\n\t\treturn toolbox;\n\t}", "public interface ConfigurableComponentProvider extends ComponentProvider {\n\n}", "ISModifyComponent createISModifyComponent();", "public Component() {\n\t\tlocation = new Point(0, 0);\n\t\tsize = new Dimension(100, 80);\n\t\tproperties = new LinkedHashMap<>();\n\t\tsubJobContainer= new LinkedHashMap<>();\n\t\tleftPortCount = 0;\n\t\trightPortCount = 0;\n\t\tbottomPortCount = 0;\n\t\tinputLinksHash = new Hashtable<String, ArrayList<Link>>();\n\n\t\tinputLinks = new ArrayList<Link>();\n\t\toutputLinksHash = new Hashtable<String, ArrayList<Link>>();\n\t\toutputLinks = new ArrayList<Link>();\n\t\tinputportTerminals = new ArrayList<String>();\n\t\toutputPortTerminals = new ArrayList<String>();\n\t\twatcherTerminals = new HashMap();\n\t\tnewInstance = true;\n\t\tvalidityStatus = ValidityStatus.WARN.name();\n\t\tcomponentName = DynamicClassProcessor.INSTANCE.getClazzName(this\n\t\t\t\t.getClass());\n\n\t\tcomponentLabel = new ComponentLabel(componentName);\n\t\tcomponentLabelMargin = 16;\n\n\t\tprefix = XMLConfigUtil.INSTANCE.getComponent(componentName)\n\t\t\t\t.getDefaultNamePrefix();\n\t\t\n\t\tdefaultPrefix=XMLConfigUtil.INSTANCE.getComponent(componentName)\n\t\t\t\t.getDefaultNamePrefix();\n\t\tinitPortSettings();\n\t\ttoolTipErrorMessages = new LinkedHashMap<>();\n\t\tstatus = ComponentExecutionStatus.BLANK;\n\t}", "public ConverterComponent() {\n\t}", "ViewComponentPart createViewComponentPart();", "public interface PIComponent {\n\t\n\t\n\t/**\n\t * returns the current height of the component.\n\t * @return the components height\n\t */\n\tpublic float getHeight();\n\t\n\t\n\t/**\n\t * returns the current width of the component.\n\t * @return the components width\n\t */\n\tpublic float getWidth();\n\t\n\t\n\t/**\n\t * Resizes the component so that it has width width and height height. \n\t * @param width the new width of the component\n \t * @param height the new height of the component\n\t */\n\tpublic void setSize(float width, float height);\n\t\n\t\n\t/**\n\t * Returns the current x coordinate of the components origin.\n\t * @return the current x coordinate of the components origin\n\t */\n\tpublic float getX();\n\t\n\t\n\t/**\n\t * Returns the current y coordinate of the components origin.\n\t * @return the current y coordinate of the components origin\n\t */\n\tpublic float getY();\n\t\n\t\n\t/**\n\t * sets the location of the component\n\t * @param x the x value\n\t * @param y the y value\n\t */\n\tpublic void setLocation(float x, float y);\n\t\n\n\t/**\n\t * checks if the components contains x and y for the sake of e.g. mouse processing. \n\t * @param x the x coordinate of the point\n\t * @param y the y coordinate of the point\n\t * @return true if the component contains x and y\n\t */\n\tpublic boolean contains(float x, float y);\n\t\n\t\n\t/**\n\t * returns the component's unique id.\n\t * @return the component's unique id. \n\t */\n\tpublic UUID getComponentId();\n\t\n\t\n\t/**\n\t * to draw the component onto the canvas\n\t */\n\tpublic void draw();\n\n}", "public ExampleComponent(Component parent) {\n super(parent);\n }", "void addComponents();", "void addComponent(Component component);", "private void initComponents() {\n rootLayout = new Grid();\n rootLayout.setWidth(new Extent(100, Extent.PERCENT));\n rootLayout.setSize(2);\n add(rootLayout);\n Empsn_Label= new nextapp.echo2.app.Label();\n Empsn_Label.setText(\"N_TIME_BEAR.EMPSN\");\n rootLayout.add(Empsn_Label);\n \n Empsn_DscField = new dsc.echo2app.component.DscField();\n Empsn_DscField.setId(\"Empsn_DscField\");\n Empsn_DscField.setWidth(new Extent(4, Extent.CM));\n rootLayout.add(Empsn_DscField);\n \n\t}", "@Override\npublic void childComponentsAdded(boolean hasProperties) {\n\t\n}", "@Override\n public Component getComponent() {\n if (component == null) {\n component = new PubMLSTVisualPanel2();\n }\n component.setPreferredSize(new java.awt.Dimension(480,340));\n return component;\n }", "@Override\n\tpublic Component getComponent() {\n\t\treturn this;\n\t}", "public void add(Component c){}", "Builder setComponent(String component);", "public void addComponent(String name, Component newComp);", "public interface Datum {\n\n Component createComponent(ComponentContext c);\n}", "public GuiComponent(String componentName) {\n\t\tsuper(componentName);\n\t}", "private void createComponents() {\r\n // create a title\r\n indexTitle = new JLabel(\"Indexing\");\r\n indexTitle.setFont(new Font(\"Tahoma\", Font.BOLD, 15));\r\n\r\n dirUrl = new JTextField();\r\n dirUrl.setColumns(70);\r\n dirUrl.setEditable(false);\r\n\r\n openDir = new JButton(\"Open Dir\");\r\n fileChooser = new JFileChooser();\r\n\r\n startIndexing = new JButton(\"Start\");\r\n startIndexing.setPreferredSize(new Dimension(95, 22));\r\n\r\n indexProgress = new JProgressBar();\r\n //progressBar.setStringPainted(true);\r\n // progressBar.setString(\"Indexing State..\");\r\n\r\n addExistingCheck = new JCheckBox();\r\n }", "public void addComponent(Component c);", "@Override\n public Component getUiComponent() {\n return this;\n }", "ComponentsType createComponentsType();", "ComponentBuilder named(String label);", "public ComponentsFactory() {\n\t\tsuper();\n\t}", "protected Component generateComp(String compName) {\n\t\treturn null;\n\t}", "private void createUIComponents() {\n table = new ShareTraderTable();\n }", "@Override\r\n\tpublic void componentActivated(AbstractComponent arg0) {\n\r\n\t}", "public void manageComponent() {\n menu = new JMenuBar();\n mainbox = new JScrollPane();\n toolbox = new JPanel();\n paintBox = new JPanel();\n optionbox = new JPanel();\n statusbar = new JPanel();\n paintModule = new PaintModule();\n\n // component setting\n createToolBox(toolbox);\n createMenu(menu);\n createOptionBox(optionbox);\n createStatusBar(statusbar);\n this.setLayout(new BorderLayout());\n\n // add component to container\n paintBox.add(paintModule);\n mainbox.setViewportView(paintBox);\n\n\n this.add(menu, BorderLayout.NORTH);\n this.add(mainbox, BorderLayout.CENTER);\n this.add(toolbox, BorderLayout.WEST);\n this.add(optionbox, BorderLayout.EAST);\n this.add(statusbar, BorderLayout.SOUTH);\n\n }", "@Override\r\n\t\t\tpublic void componentAdded(ContainerEvent arg0){}", "String getComponentName();", "String getComponentName();", "private void createComponents() {\n\n add(createSetDataPanel(), BorderLayout.NORTH);\n add(createResourcesListAndButtonsPanel(), BorderLayout.CENTER);\n }" ]
[ "0.748043", "0.748043", "0.710925", "0.710925", "0.70801723", "0.70445067", "0.69780385", "0.6929074", "0.69076335", "0.6886755", "0.67288405", "0.65718913", "0.65718913", "0.65703416", "0.65284145", "0.65241957", "0.6444727", "0.643084", "0.643084", "0.643084", "0.643084", "0.63960147", "0.6384356", "0.63791186", "0.63755465", "0.63584095", "0.6355117", "0.6350047", "0.63453037", "0.6342518", "0.6338044", "0.63329166", "0.632944", "0.6305833", "0.6300628", "0.6298501", "0.6290578", "0.6284852", "0.62778133", "0.6261838", "0.6259183", "0.62277776", "0.6226062", "0.6224614", "0.6218576", "0.62125236", "0.6197752", "0.6191626", "0.6160474", "0.6154159", "0.6135396", "0.6133078", "0.61322415", "0.61233544", "0.611821", "0.6104217", "0.610001", "0.6092981", "0.6086858", "0.6080753", "0.60695434", "0.6068635", "0.6048626", "0.6042294", "0.6040294", "0.60402536", "0.60389113", "0.60387844", "0.6035159", "0.6034891", "0.60347074", "0.6032865", "0.60247046", "0.6014248", "0.60073996", "0.6006098", "0.5998663", "0.5990762", "0.5983335", "0.59783345", "0.5970002", "0.5970002", "0.5945725" ]
0.69689584
21
Part of ExtraGeometricShape API
public interface GeometricShape { double area(); double perimeter(); void drawShape(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\n\tpublic void getShape() {\n\n\t}", "public String whatShape();", "Shape getShape();", "public Shape getShape();", "public Shape getShape() { return shape; }", "public int getMyShape(){ return myShape;}", "public abstract int[] getShape();", "ShapeType getShapeType();", "Shape newShape(GraphicalObject g) throws RemoteException;", "public Shape getShape() {\n\treturn shape;\n }", "public Shape getShape() {\n return shape;\n }", "protected Shape getShape()\n {\n return null;\n }", "public void setShape(Info shape) {\n \n }", "IShape getCurrentShape();", "@Override\n\tpublic void BuildShape(Graphics g) {\n\t\t\n\t}", "public Info getInfo() {\n super.fillInfo(shape);\n return this.shape;\n }", "protected abstract boolean isShapeSimple();", "int getShapeId();", "public interface FlatGeometry {\r\n}", "void drawShape(Shape s) {\n }", "public abstract Geometry computeGeometry();", "public interface IShapeGenerator {\n\n Point getPoint(Integer i);\n String getCreatedShape();\n}", "String getShapeName();", "public Shape getShape() {\r\n\t\t\treturn shape;\r\n\t\t}", "void displayShape(Shape shape);", "public Shape getShape()\n {\n return Shape.this;\n }", "public RMPoint convertedPointFromShape(RMPoint aPoint, RMShape aShape)\n{\n return convertPointFromShape(new RMPoint(aPoint), aShape);\n}", "private void setShape(){\n // 0 - index of the vertex at the top of the polygon\n shapex[0] = x + MathUtils.cos(radians) * 8;\n shapey[0] = y + MathUtils.sin(radians) * 8;\n\n // 1 - index of the vertex at the bottom left of the polygon\n shapex[1] = x + MathUtils.cos(radians - 4 * 3.1415f / 5) * 8;\n shapey[1] = y + MathUtils.sin(radians - 4 * 3.1415f / 5) * 8;\n\n // 2 - index of the vertex at the bottom right of the polygon\n shapex[2] = x + MathUtils.cos(radians + 4 * 3.1415f / 5) * 8;\n shapey[2] = y + MathUtils.sin(radians + 4 * 3.1415f / 5) * 8;\n }", "public Shape getShape() {\n\t\treturn shape;\n\t}", "public NewShape() {\r\n\t\tsuper();\r\n\t}", "public interface Shape {\n\n String getDescription();\n}", "abstract void geometryMethod();", "public void assignShape() {\n\t\t\n\t}", "public void setMyShape(int shapeIndex){this.myShape = shapeIndex;}", "public interface ShapeTemplate { #\n\t//Show/hide when rendering\n\tpublic void show();\n\tpublic void hide();\n\tpublic boolean getVisible();\n\t\n\t//Storage/retreival of shape mesh\n\tpublic char[][] regenCharTable();\n\tpublic char[][] getCharTable();\n\tpublic String[] getStringTable();\n\t\n\t//Internal storage of current rendered position\n\tpublic Position getPosition();\n\tpublic void setPosition(int x, int y);\n\t\n\t//Width/height accessor properties\n\tpublic int getWidth();\n\tpublic int getHeight();\n\t\n\t//Fill\n\tpublic char getFillChar();\n\tpublic void setFillChar(char newChar);\n\tpublic boolean getFilled();\n\tpublic void setFilled(boolean isFilled);\n\t\n\t//ToString\n\tpublic String toString();\n}", "@Override\n Shape getShape() {\n return Shape.Square;\n }", "@Override\n\tprotected Shape getShape() {\n\t\treturn null;\n\t}", "@Override\n public Shape getShape(String shapeType){\n\t\treturn null;\n }", "@DISPID(1610940422) //= 0x60050006. The runtime will prefer the VTID if present\n @VTID(28)\n Factory shapeFactory();", "AbstractShape(String name, double x, double y, double w, double h, int r, int g, int b) {\n this.name = name;\n this.x = x;\n this.y = y;\n this.w = w;\n this.h = h;\n this.r = r;\n this.g = g;\n this.b = b;\n }", "void addShape(IShape shape);", "public Shape getAreaColision();", "IShape getShape(String name);", "public interface Shape {\n\n double size();\n Color color();\n\n\n}", "public Shape getMyShape() {\n\t\treturn myShape;\n\t}", "String getShapeLabel();", "abstract Shape nodeShape(String node, Graphics2D g2d);", "public Shape getShape() {\n return null;\n }", "public Object getPersistentShape(int _shape)\n/* 215: */ {\n/* 216:302 */ switch (_shape)\n/* 217: */ {\n/* 218: */ case 0: \n/* 219:303 */ return this.presentation;\n/* 220: */ case -1: \n/* 221:304 */ return this.icon;\n/* 222: */ }\n/* 223:306 */ return null;\n/* 224: */ }", "public BoundingShape getBoundingShape() {\n\treturn boundingShape;\n }", "void add(Shape aShape);", "public RMPoint convertedPointToShape(RMPoint aPoint, RMShape aShape)\n{\n return convertPointToShape(new RMPoint(aPoint), aShape);\n}", "public int[] getShape() {\n return shape;\n }", "public interface ShapeV1 {\n public double area();\n public double perimeter();\n}", "public abstract com.jme.scene.Geometry getJMEGeometry();", "public abstract Point location( Solid shape ) throws DataException, FeatureException, InvalidXMLException,\n LocationException, MountingException, ReferenceException\n ;", "public ShapeType getShape() {\n\t\treturn this.shape;\n\t}", "public interface ShapeOperations {\n\n /**\n * Computes the difference between this Shape and the input Shape <code>s</code> and puts the\n * result back into this Shape. The difference is the points that are in this Shape but not in\n * the input Shape.\n * \n * @param s the Shape to compute the difference from.\n */\n public void difference(Shape s);\n\n /**\n * Computes the intersection between this Shape and the input Shape <code>s</code> and puts the\n * result back into this Shape. The intersection is the points that are in both this Shape and\n * in the input Shape.\n * \n * @param s the Shape to compute the intersection from.\n */\n public void intersect(Shape s);\n\n /**\n * Computes the union between this Shape and the input Shape <code>s</code> and puts the result\n * back into this Shape. The union is the points that are in either this Shape or in the input\n * Shape.\n * \n * @param s the Shape to compute the union from.\n */\n public void union(Shape s);\n\n}", "public Shape getShape() {\n\t\treturn this;\n\t}", "public Shape getShape() \n {\n return new EllipseShape(new Extent(3,3), Color.RED,true);\n }", "public Shape getShape() {\n\t\treturn null;\n\t}", "public void drawShape(Shape shape);", "public FireShapes getShape() {\r\n\t\treturn shape;\r\n\t}", "public interface TwoDimensionalShape extends Shape {\r\n\tdouble getPerimeter();\r\n double getArea();\r\n}", "public interface Shape {\n\t/**\n\t * Calculates and returns the area of the object\n\t * @return\n\t */\n\tpublic abstract double getArea();\n\t\n\t/**\n\t * Returns the Color of the object.\n\t * @return\n\t */\n\tpublic abstract Color getColor();\n\t\n\t/**\n\t * Sets the Color of the object.\n\t * @param color\n\t */\n\tpublic abstract void setColor(Color color);\n\t\n\t/**\n\t * Returns true if the object is filled with color, otherwise false.\n\t * @return\n\t */\n\tpublic abstract boolean getFilled();\n\t\n\t/**\n\t * Sets the filled state of the object.\n\t * @param filled\n\t */\n\tpublic abstract void setFilled(boolean filled);\n\t\n\t/**\n\t * Moves the shape by the x and y amounts specified in the Point.\n\t * @param point\n\t */\n\tpublic abstract void move(Point point);\t\n}", "@Override\r\n\tpublic void accept(ShapeElementVisitor visitor) {\n\t\tvisitor.visit(this);\r\n\t}", "protodef.b_math.coord getCoordInfo();", "protected abstract Geometry decode(Object o);", "public interface IPolygon {\n // Returns the text telling what shape it is\n public String whatShape();\n\n // Returns the numbers of sides\n public int noOfSides();\n\n // Returns the array of lengths of all sides\n public double[] getSides();\n\n // Returns the area of the shape\n public double area();\n\n // Returns the perimeter of the shape\n public double perimeter();\n}", "public Rectangle getShape(){\n return myRectangle;\n }", "public String getShapeType(){\n\t\treturn shapeType;\n\t}", "public EpsShape(Shape shape) {\n\t\tthis(shape,false);\n\t}", "@Override\n\tprotected Shape getShape() {\n\t\tRectangle2D ellipse = new Rectangle2D.Double(this.getX(), this.getY(), this.getDimension(), this.getDimension()/2);\n\t return ellipse;\n\t}", "public abstract Shape createPath();", "@Override\n public void generateShape() {\n AffineTransform tx = new AffineTransform();\n tx.rotate(-this.getRotation(), this.getX(), this.getY());\n this.shape = tx.createTransformedShape(new Ellipse2D.Double(\n this.getX() + this.getWidth() / 2 - D / 2,\n this.getY() + this.getHeight() / 2 - D / 2,\n D, D));\n }", "private static void addShaped()\n {}", "@Override\n\tpublic int getShapeId()\n\t{\n\t\treturn shapeId;\n\t}", "public void interface1(){\n noStroke();\n fill(10,100);//light gray\n rect(0,60,600,590);\n fill(220);//gray\n noStroke();\n beginShape();\n vertex(365,40);\n vertex(600,40);\n vertex(600,80);\n vertex(365,80);\n vertex(345,60);\n endShape(CLOSE);\n fill(19,70,100,100);//dark blue\n rect(0,110,600,215);\n rect(0,380,600,215);\n}", "Geometry getGeometry();", "public String toString() {\n\t\t\treturn shape;\n\t\t}", "protected abstract void setShapes();", "public interface SceneShape\n{\n /**\n Draws this item.\n @param g2 the graphics context\n */\n\n void draw(Graphics2D g2);\n\n /**\n Tests whether this item contains a given point.\n @param p a point\n @return true if this item contains p\n */\n\n boolean contains(Polygon p);\n\n /**\n Moves this item.\n */\n\n void move();\n\n}", "protected Shape() {}", "public interface IShape {\n\n /**\n * Adds a new motion to the list if it does not overlap with any existing motion, and add the\n * keyframes that align with the start and end points of this motion.\n *\n * @param motion the motion to be added\n * @throws IllegalArgumentException if the motion overlaps with an existing motion in the list\n */\n void addMotion(IMotion motion);\n\n /**\n * Add the given keyframe to this animation, and edit the motions to align with the new keyframe.\n *\n * @param keyframe the keyframe to be added.\n */\n void addKeyframe(IKeyframe keyframe);\n\n /**\n * Removes the keyframe and reformats motions at the given time.\n *\n * @param time the tick to remove the keyframe at\n */\n void removeKeyframe(int time);\n\n /**\n * Adds the given keyframe to this shape, overwriting the one at the time it has.\n *\n * @param newKeyframe the new keyframe to add.\n */\n void editKeyframe(IKeyframe newKeyframe);\n\n /**\n * Returns all the motions of this shape object.\n *\n * @return a list containing all motions.\n */\n List<IMotion> getMotions();\n\n /**\n * Returns all keyframes of this shape object.\n *\n * @return a list containing all keyframes.\n */\n List<IKeyframe> getKeyframes();\n\n /**\n * Calculates the current position of this shape at the given tick, and sets the values.\n *\n * @param tick the tick to calculate position at\n * @throws IllegalArgumentException if tick is not positive or if no motion runs at that tick\n */\n void calculateMotionAtTick(int tick);\n\n /**\n * Returns a string containing the name of the type of shape this object is.\n *\n * @return the string representing the name of the type of this object.\n */\n String getType();\n\n /**\n * Gets dimensions field of this Shape.\n *\n * @return the dimension field\n */\n Dimension getDimensions();\n\n /**\n * Gets the color field of this Shape.\n *\n * @return the color field\n */\n Color getColor();\n\n /**\n * Gets the position field of this Shape.\n *\n * @return the position field\n */\n Point getPosition();\n\n /**\n * Checks that there are no gaps in the run time of this shape's motions.\n *\n * @return true if there are no gaps, false otherwise\n */\n boolean isPlayable();\n\n /**\n * Returns the final tick value for this shape.\n *\n * @return the final tick value\n */\n int getFinalTick();\n\n /**\n * Returns the first tick motions start for this shape.\n *\n * @return the first tick value.\n */\n int getFirstTick();\n\n /**\n * Gets the name of this shape.\n *\n * @return the name\n */\n String getName();\n\n /**\n * Checks if this shape has a motion during this time.\n *\n * @param tick the tick to check\n * @return if the shape has a motion\n */\n boolean isRunningDuringTick(int tick);\n\n}", "@Override\n\tpublic String getShape() {\n\t\treturn \"Rectangle\";\n\t}", "public interface Displayer {\n \n /**\n * This is displayShape method.\n * \n * @param shape - object's shape type\n */\n void displayShape(Shape shape);\n}", "public SimpleGeometricObject() {\r\n this.dateCreated = new java.util.Date();\r\n }", "public interface Shape {\n float getArea();\n float getPerimeter();\n void printMe();\n}", "public interface CurveSegment extends GenericCurve {\n\n /**\n * @return the number of points building the curve segment\n */\n int getNumberOfPoints();\n\n /**\n * @return all positions of the segement as array of Point\n */\n Position[] getPositions();\n\n /**\n * @param index\n * to get the curve\n * @return the curve position at the submitted index\n */\n Position getPositionAt( int index );\n\n /**\n * reverses the direction of the curvesegment\n */\n void reverse();\n\n /**\n * @return the coordinate system of the curve segment\n */\n CoordinateSystem getCoordinateSystem();\n\n /**\n * The Boolean valued operation \"intersects\" shall return TRUE if this Geometry intersects another Geometry. Within\n * a Complex, the Primitives do not intersect one another. In general, topologically structured data uses shared\n * geometric objects to capture intersection information.\n * \n * @param gmo\n * @return true if this geometry intersects with given geometry.\n */\n boolean intersects( Geometry gmo );\n\n /**\n * The Boolean valued operation \"contains\" shall return TRUE if this Geometry contains another Geometry.\n * \n * @param gmo\n * @return true if this geometry contains given geometry.\n */\n boolean contains( Geometry gmo );\n\n}", "public interface CompositeShapeInt\n{\n /**\n Add a shape to this composite shape.\n @param aShape the shape to add\n */\n void add(Shape aShape);\n\n /**\n Returns an integer Rectangle that completely encloses the Shape.\n Note that there is no guarantee that the returned Rectangle is the\n smallest bounding box that encloses the Shape, only that the Shape\n lies entirely within the indicated Rectangle.\n */\n Rectangle getBounds();\n\n /**\n Draws this CompositeShape at the relative position to the top left corner of the bounding box.\n @param g2 the graphics context\n */\n void draw (Graphics2D g);\n\n}", "protected MapShapeAdapter getShapeAdapter() {\r\n return shapeAdapter;\r\n }", "private Shape createPath(final Geometry geom) {\n return new LiteShape(geom, true, maxDistance);\n }", "public void addPolyGon() {\n abstractEditor.drawNewShape(new ESurfaceDT());\n }", "public interface SVGMutableShapeDef<W, F> extends SVGShapeDef<W, F>,\n MutableShapeDef<W> {\n\n /**\n * The width of the SVG view's bounding box.\n * The way shape views are being updated to achieve new width\n * is up to each implementations.\n * @param element The model instance.\n * @return The shape's width.\n */\n double getWidth(final W element);\n\n /**\n * The height of the SVG view's bounding box.\n * The way shape views are being updated to achieve new height\n * is up to each implementations.\n * @param element The model instance.\n * @return The shape's height.\n */\n double getHeight(final W element);\n\n /**\n * If the SVGShape is composed by some\n * SVGShapeView instances, this method allows\n * to display or make not visible each of\n * the inner views as from the <code>element</code>\n * instance's state at runtime.\n * @param viewName The name of the inner SVGSHapeVie.\n * @param element The definition instance.\n * @return Whether the <code>viewName</code> inner SVGShapeView, which\n * the shape is composed by, has to be displayed.\n */\n boolean isSVGViewVisible(final String viewName,\n final W element);\n}", "@Override\n public FillableShape getShape()\n {\n return FillableShape.this;\n }", "public Ellipse2D getShape()\r\n {\r\n if(this.stable){\r\n return new Ellipse2D.Double(x, y, XSIZE*2, YSIZE*2);\r\n }\r\n else\r\n return new Ellipse2D.Double(x, y, XSIZE, YSIZE);\r\n }", "@Override\r\n public void setShape (Shape shape)\r\n {\r\n setShape(shape, Evaluation.ALGORITHM);\r\n }", "@Override\n\tpublic void geometry(Geometry geometry) {\n\t\t\n\t}", "private void drawShape(Graphics g, IShape shape) {\r\n Color color = shape.getColor();\r\n if (shape.getPosition() != null) {\r\n int x = shape.getPosition().getX();\r\n int y = shape.getPosition().getY();\r\n int width = shape.getWidth();\r\n int height = shape.getHeight();\r\n\r\n\r\n switch (shape.getShapeType()) {\r\n case \"Ellipse\":\r\n g.setColor(color);\r\n g.fillOval(x, y, width, height);\r\n g.drawOval(x, y, width, height);\r\n break;\r\n case \"Rectangle\":\r\n g.setColor(color);\r\n g.fillRect(x, y, width, height);\r\n g.drawRect(x, y, width, height);\r\n break;\r\n case \"Plus\":\r\n g.setColor(color);\r\n int width1 = width ;\r\n int height2 = height;\r\n int height1 = height / 2;\r\n int width2 = width / 2;\r\n int x1 = x;\r\n int y1 = y + height / 4;\r\n int x2 = x + width / 4;\r\n int y2 = y;\r\n g.fillRect(x1, y1, width1, height1);\r\n g.fillRect(x2, y2, width2, height2);\r\n break;\r\n default:\r\n return;\r\n }\r\n }\r\n }", "@DISPID(1610940423) //= 0x60050007. The runtime will prefer the VTID if present\n @VTID(29)\n Factory hybridShapeFactory();" ]
[ "0.7153197", "0.71498644", "0.7118603", "0.709525", "0.6991791", "0.6625716", "0.66196024", "0.6613871", "0.6566468", "0.655689", "0.6549852", "0.65216774", "0.6513352", "0.6511739", "0.65091795", "0.64738697", "0.6443819", "0.6394517", "0.6389456", "0.6384129", "0.6379634", "0.63785475", "0.6351152", "0.62981683", "0.6288571", "0.62879163", "0.62876916", "0.6258755", "0.625654", "0.6255066", "0.6252239", "0.6226177", "0.6211498", "0.6207625", "0.62033594", "0.61801594", "0.61592704", "0.61379486", "0.61213434", "0.6110698", "0.610933", "0.61034024", "0.60947233", "0.60927916", "0.6092762", "0.60888565", "0.6085846", "0.60811687", "0.6072006", "0.6062924", "0.60555804", "0.6052766", "0.60507166", "0.60277563", "0.60262734", "0.6018433", "0.6015943", "0.60106033", "0.60048825", "0.6003403", "0.5997983", "0.5991695", "0.5983629", "0.59668654", "0.59523094", "0.59490794", "0.5942473", "0.5935752", "0.5930742", "0.5921966", "0.59148216", "0.5881283", "0.5878064", "0.58691716", "0.58579826", "0.5857549", "0.585734", "0.58480144", "0.5840119", "0.5837399", "0.58356714", "0.58342355", "0.58335626", "0.58198476", "0.5814667", "0.581023", "0.58039105", "0.57951844", "0.5795033", "0.57738715", "0.5769252", "0.57683855", "0.5761753", "0.5761284", "0.57549375", "0.5752153", "0.5730655", "0.5723306", "0.5715943", "0.57141817" ]
0.66971606
5
fill the form for selected Dispatch table row
public void fillTextFieldValues(DispatchVO dispatchVO) { try { billingName.setText(dispatchVO.getBillingName()); companyName.setText(dispatchVO.getCompanyName()); ((TextField)calendar2.getChildren().get(0)).setText(dispatchVO.getDispatchDate()); ((TextField)calendar.getChildren().get(0)).setText(dispatchVO.getInvoiceDate()); FreightAmount.setText(String.valueOf(dispatchVO.getFreightAmount())); numberOfItems.setText(String.valueOf(dispatchVO.getNoOfItems())); Freightmode.setText(dispatchVO.getFreightMode()); invoiceNo.setText(dispatchVO.getInvoiceNo()); shippingTo.setText(dispatchVO.getShippingTo()); trackingNo.setText(dispatchVO.getTrackingNo()); transporter.setText(dispatchVO.getTransporter()); receiver.setText(dispatchVO.getCustomerEmail()); ProductDispatchModifyController.this.dispatchVO=dispatchVO; emailDetails = dispatchDAO.getDispatchOptionDefaultValues(); body.setText(emailDetails.get(CommonConstants.KEY_DISPATCH_MESSAGE)); } catch (Exception e) { e.printStackTrace(); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void populateForm(Appointment row){\n selectedRow = row;\n idText.setText(Integer.toString(row.getId()));\n titleText.setText(row.getTitle());\n descriptionText.setText(row.getDescription());\n for(Location item : locationCombo.getItems()){\n if(item.getCity_state().equals(row.getLocation())){\n locationCombo.getSelectionModel().select(item);\n break;\n }\n }\n for(Contact person : contactCombo.getItems()){\n if(person.getName().equals(row.getContact())){\n contactCombo.getSelectionModel().select(person);\n break;\n }\n }\n for(Type meeting : typeCombo.getItems()){\n if(meeting.getAppointment_type().equals(row.getType())){\n typeCombo.getSelectionModel().select(meeting);\n break;\n }\n }\n for(Customer cust : customerCombo.getItems()){\n if(cust.getId() == row.getCustomer()){\n customerCombo.getSelectionModel().select(cust);\n break;\n }\n }\n for(User user : userCombo.getItems()){\n if(user.getId() == row.getUser()){\n userCombo.getSelectionModel().select(user);\n break;\n }\n }\n startLDT = LocalDateTime.parse(row.getStart(), formatter);\n endLDT = LocalDateTime.parse(row.getEnd(), formatter);\n dateBox.setValue(startLDT.toLocalDate());\n setPrevSpinner = true;\n setSpinners();\n }", "public void rowField()\n\t{ \n\t\tviewTable.addMouseListener(new MouseAdapter() {\n\t\t\tpublic void mouseClicked(MouseEvent e)\n\t\t\t{\n\t\t\t\tint c;\n\t\t\t\tString id ,oldname,oladdress,oldcontact,oldemail,oldusername, oldpassword;\n\t\t\t\tDefaultTableModel viewTablemodel = (DefaultTableModel)viewTable.getModel();\n\t\t\t\tc=viewTable.getSelectedRow();\n\t\t\t\tid= viewTablemodel.getValueAt(c, 1).toString();\n\t\t\t\toldname= viewTablemodel.getValueAt(c,2).toString();\n\t\t\t\toldcontact= viewTablemodel.getValueAt(c,3).toString();\n\t\t\t\toladdress= viewTablemodel.getValueAt(c,4).toString();\n\t\t\t\toldemail= viewTablemodel.getValueAt(c,5).toString();\n\t\t\t\toldusername= viewTablemodel.getValueAt(c,6).toString();\n\t\t\t\toldpassword= viewTablemodel.getValueAt(c,7).toString();\n\t\t\t\tupdatePanel(id, oldname, oldcontact, oladdress, oldemail, oldusername, oldpassword);\n\t\t\t\tsetRowCount(viewTable.getSelectedRow());\n\t\t\t}\n\t\t});\n\t}", "private void selectedRowInvoice(){\r\n //numOrdenInv = tb_factura.getSelectionModel().getSelectedIndex();\r\n }", "private void populateForm() {\n Part selectedPart = (Part) PassableData.getPartData();\n partPrice.setText(String.valueOf(selectedPart.getPrice()));\n partName.setText(selectedPart.getName());\n inventoryCount.setText(String.valueOf(selectedPart.getStock()));\n partId.setText(String.valueOf(selectedPart.getId()));\n maximumInventory.setText(String.valueOf(selectedPart.getMax()));\n minimumInventory.setText(String.valueOf(selectedPart.getMin()));\n\n if (PassableData.isOutsourced()) {\n Outsourced part = (Outsourced) selectedPart;\n variableTextField.setText(part.getCompanyName());\n outsourced.setSelected(true);\n\n } else if (!PassableData.isOutsourced()) {\n InHouse part = (InHouse) selectedPart;\n variableTextField.setText(String.valueOf(part.getMachineId()));\n inHouse.setSelected(true);\n }\n\n\n }", "private void jTable1MouseClicked(java.awt.event.MouseEvent evt) {\n int indexrow=jTable1.getSelectedRow();\n DefaultTableModel model = (DefaultTableModel)jTable1.getModel();\n id=model.getValueAt(indexrow,0).toString();\n txt_id.setText(model.getValueAt(indexrow,0).toString());\n txt_class.setText(model.getValueAt(indexrow,1).toString());\n txt_section.setText(model.getValueAt(indexrow, 2).toString());\n }", "@Override\n\t\t\tpublic void actionPerformed(ActionEvent e) {\n\t\t\t\tSystem.out.println(\"btnUpdate\");\n\t\t\t\tint i = table.getSelectedRow();\n\t\t\t\tif (i >= 0) {\n\t\t\t\t\tSystem.out.println(\"row-update-select\" + i);\n\t\t\t\t\tSystem.out.println(\"row-update-supp-id\" + textSuppD.getText());\n\t\t\t\t\tint suppID = Integer.parseInt(textSuppD.getText().trim());\n\t\t\t\t\tString suppName = textSuppName.getText();\n\t\t\t\t\tString suppAddr = textSuppAddr.getText();\n\t\t\t\t\tString suppPhone = textSuppPhone.getText();\n\t\t\t\t\tString suppEmail = textSuppEmail.getText();\n\n\t\t\t\t\tDatabase db = new Database();\n\t\t\t\t\tSuppliersDAO suppDAO = new SuppliersDAO(db);\n\t\t\t\t\tSuppliersModel suppModel = new SuppliersModel();\n\t\t\t\t\tsuppModel.setSuppliers_id(suppID);\n\t\t\t\t\tsuppModel.setName(suppName);\n\t\t\t\t\tsuppModel.setAddress(suppAddr);\n\t\t\t\t\tsuppModel.setPhone(suppPhone);\n\t\t\t\t\tsuppModel.setEmail(suppEmail);\n\n\t\t\t\t\tsuppDAO.Update(suppModel);\n\n\t\t\t\t\tdb.commit();\n\t\t\t\t\tdb.close();\n\n\t\t\t\t\tsetTableGet(i, model);\n\t\t\t\t} else {\n\n\t\t\t\t}\n\t\t\t}", "public void dataSelect(){\n //deklarasi variabel\n int i = tblKembali.getSelectedRow();\n \n //uji adakah data di tabel?\n if(i == -1){\n //tidak ada yang terpilih atau dipilih.\n return;\n }\n txtNama.setText(\"\"+model.getValueAt(i,0));\n txtAlamat.setText(\"\"+model.getValueAt(i,1));\n txtNo.setText(\"\"+model.getValueAt(i,2));\n txtKamera.setText(\"\"+model.getValueAt(i,3));\n txtKode.setText(\"\"+model.getValueAt(i,4));\n txtdisewa.setText(\"\"+model.getValueAt(i,5));\n txtLama.setText(\"\"+model.getValueAt(i,6));\n txtLambat.setText(\"\"+model.getValueAt(i,7));\n \n }", "public frmFanArtist() {\n setTitle(\"Fan Your Artist!\");\n initComponents();\n FanController.updateFormData(slctArtist, jTable1);\n jTable1.getSelectionModel().addListSelectionListener(new ListSelectionListener() {\n public void valueChanged(ListSelectionEvent event) {\n // do some actions here, for example\n // print first column value from selected row\n try{\n System.out.println(jTable1.getValueAt(jTable1.getSelectedRow(), 1).toString());\n formArtist = (Artist) jTable1.getValueAt(jTable1.getSelectedRow(), 1);\n \n updateData();\n }\n catch(Exception e){\n \n }\n }\n });\n }", "private void jTable1MouseClicked(java.awt.event.MouseEvent evt) {\n DefaultTableModel model = (DefaultTableModel)jTable1.getModel();\n // get the selected row index\n int selectedRowIndex = jTable1.getSelectedRow();\n // set the selected row data into jtextfields\n ID_USER =Integer.parseInt(model.getValueAt(selectedRowIndex, 0).toString()) ; \n CL_USER =model.getValueAt(selectedRowIndex, 1).toString(); \n\n }", "private void fillContactDetails(int aSelectedRow) throws SQLException {\n \n switch (this.pStatus) {\n case New:\n //Empty all the fields for the new entry.\n txtFirstName.setText(\"\");\n txtMiddleName.setText(\"\");\n txtLastName.setText(\"\");\n dtpBirthday.setDate(null);\n rdoUndefined.setSelected(true);\n txtStreet.setText(\"\");\n txtPostcode.setText(\"\");\n txtCity.setText(\"\");\n txtCountry.setText(\"\");\n txtAvailability.setText(\"\");\n txtComment.setText(\"\");\n lblDateCreatedVal.setText(\"\");\n lblDateModifiedVal.setText(\"\");\n // TODO: Empty the availabilities.\n break;\n \n case View:\n //Get access to the table data.\n clsContactsTableModel mModel = (clsContactsTableModel) tblContacts.getModel();\n //Get the entire contact details.\n clsContactsDetails mContactsDetails = mModel.getContactDetails(aSelectedRow);\n //Set the values into the fields.\n txtFirstName.setText(mContactsDetails.getFirstName());\n txtMiddleName.setText(mContactsDetails.getMiddleName());\n txtLastName.setText(mContactsDetails.getLastName());\n dtpBirthday.setDate(mContactsDetails.getBirthday());\n switch (mContactsDetails.getGender()) {\n case \"m\":\n rdoMale.setSelected(true);\n break;\n case \"f\":\n rdoFemale.setSelected(true);\n break;\n default:\n rdoUndefined.setSelected(true);\n break;\n }\n txtStreet.setText(mContactsDetails.getStreet());\n txtPostcode.setText(mContactsDetails.getPostcode());\n txtCity.setText(mContactsDetails.getCity());\n txtCountry.setText(mContactsDetails.getCountry());\n txtAvailability.setText(mContactsDetails.getAvailability());\n txtComment.setText(mContactsDetails.getComment());\n //Convert Date to readable format.\n SimpleDateFormat mDateConversion = new SimpleDateFormat(\"yyyy-MM-dd HH:mm:ss\");\n lblDateCreatedVal.setText(mDateConversion.format(mContactsDetails.getDateCreated()));\n lblDateModifiedVal.setText(mDateConversion.format(mContactsDetails.getDateModified()));\n break;\n \n }\n }", "private void recordTableMouseClicked(MouseEvent e) {\n\n //fetching the index from jtable\n DefaultTableModel df=(DefaultTableModel) recordTable.getModel();\n int index=recordTable.getSelectedRow();\n txtCustNo.setText(df.getValueAt(index,0).toString());\n txtCustName.setText(df.getValueAt(index,1).toString());\n txtCustDeposit.setText(df.getValueAt(index,2).toString());\n txtYears.setText(df.getValueAt(index,3).toString());\n cboSavings.setSelectedItem(df.getValueAt(index,4).toString());\n }", "@Override\n public void handle(MouseEvent event) {\n if(event.getClickCount() == 2){\n //abrir la ventana\n try {\n FXMLLoader fxmlLoader = new FXMLLoader(\n PersonaController.class.getResource(\n \"personaForm.fxml\"\n )\n );\n Parent root = (Parent) fxmlLoader.load();\n Stage stage =new Stage();\n stage.setScene(new Scene(root));\n\n //pasar el objeto seleccionado\n Persona selecionado = personasTable.getSelectionModel().getSelectedItem();\n // recuperar el controlador de Persona\n PersonaController controller = fxmlLoader.getController();\n controller.setPersona(selecionado);\n\n stage.showAndWait();\n\n //actualizar el registro en la tabla\n int index = personasTable.getItems().indexOf(selecionado);\n personasTable.getItems().set(index, selecionado);\n\n\n }catch (IOException ex){\n System.out.println(\"No se pudo cargar el form\");\n }\n }\n }", "private void datos() {\n int row;\n row = vista.tblClientes.getSelectedRow();\n cvo.setId_cliente(Integer.parseInt(vista.tblClientes.getValueAt(row, 0).toString()));\n vista.txtNombre.setText(String.valueOf(vista.tblClientes.getValueAt(row, 1)));\n vista.txtApellido.setText(String.valueOf(vista.tblClientes.getValueAt(row, 2)));\n vista.txtDireccion.setText(String.valueOf(vista.tblClientes.getValueAt(row, 3)));\n vista.txtCorreo.setText(String.valueOf(vista.tblClientes.getValueAt(row, 4)));\n vista.txtClave.setText(String.valueOf(vista.tblClientes.getValueAt(row, 5)));\n }", "protected void select() {\n\t\tcleanValues();\n\t\tint row = m_table.getSelectedRow();\n\t\tboolean enabled = row != -1;\n\t\tif (enabled)\n\t\t{\n\t\t\tInteger ID = m_table.getSelectedRowKey();\n\t\t\tif (ID != null)\n\t\t\t{\n\t\t\t\tm_C_Order_ID = ID.intValue();\n\t\t\t}\n\t\t}\n\t\tlog.info(\"ID=\" + m_C_Order_ID); \n\t}", "private void selectDetailWithMouse() {\n int selectedRowIndex=jt.convertRowIndexToModel(jt.getSelectedRow());\n String[] choices={\"Update Row\",\"Delete\",\"Cancel\"};\n int option=JOptionPane.showOptionDialog(rootPane, \"Product ID: \"+jtModel.getValueAt(selectedRowIndex, 0).toString()+\"\\n\"+\"Product Name: \"+jtModel.getValueAt(selectedRowIndex,1), \"View Data\", WIDTH, HEIGHT,null , choices, NORMAL);\n if(option==0)\n {\n tfPaintId.setText(jtModel.getValueAt(selectedRowIndex,0).toString());\n tfName.setText(jtModel.getValueAt(selectedRowIndex, 1).toString());\n tfPrice.setText(jtModel.getValueAt(selectedRowIndex, 2).toString());\n tfColor.setText(jtModel.getValueAt(selectedRowIndex, 3).toString());\n tfQuantity.setText(jtModel.getValueAt(selectedRowIndex, 8).toString());\n rwCombo.setSelectedItem(jtModel.getValueAt(selectedRowIndex, 4));\n typeCombo.setSelectedItem(jtModel.getValueAt(selectedRowIndex, 6));\n bCombo.setSelectedItem(jtModel.getValueAt(selectedRowIndex, 5));\n switch(jtModel.getValueAt(selectedRowIndex, 7).toString()) {\n case \"High\":\n high.setSelected(true);\n break;\n case \"Mild\":\n mild.setSelected(true);\n break;\n case \"Medium\":\n medium.setSelected(true);\n break;\n }\n }\n else if(option==1)\n {\n jtModel.removeRow(selectedRowIndex);\n JOptionPane.showMessageDialog(rootPane,\" Detail successfully deleted\");\n }\n else \n {\n \n } \n }", "private void loadForm() {\n service.getReasons(refusalReasons);\n service.getVacEligibilty(vacElig);\n service.getVacSites(vacSites);\n service.getReactions(vacReactions);\n service.getOverrides(vacOverrides);\n updateComboValues();\n \n selPrv = \"\";\n selLoc = \"\";\n \n //datGiven.setDateConstraint(new SimpleDateConstraint(SimpleDateConstraint.NO_NEGATIVE, DateUtil.addDays(patient.getBirthDate(), -1, true), null, BgoConstants.TX_BAD_DATE_DOB));\n datGiven.setDateConstraint(getConstraintDOBDate());\n datEventDate.setConstraint(getConstraintDOBDate());\n radFacility.setLabel(service.getParam(\"Caption-Facility\", \"&Facility\"));\n if (immunItem != null) {\n \n txtVaccine.setValue(immunItem.getVaccineName());\n txtVaccine.setAttribute(\"ID\", immunItem.getVaccineID());\n txtVaccine.setAttribute(\"DATA\", immunItem.getVaccineID() + U + immunItem.getVaccineName());\n setEventType(immunItem.getEventType());\n \n radRefusal.setDisabled(!radRefusal.isChecked());\n radHistorical.setDisabled(!radHistorical.isChecked());\n radCurrent.setDisabled(!radCurrent.isChecked());\n \n visitIEN = immunItem.getVisitIEN();\n if (immunItem.getProvider() != null) {\n txtProvider.setText(FhirUtil.formatName(immunItem.getProvider().getName()));\n txtProvider.setAttribute(\"ID\", immunItem.getProvider().getId().getIdPart());\n selPrv = immunItem.getProvider().getId().getIdPart() + U + U + immunItem.getProvider().getName();\n }\n switch (immunItem.getEventType()) {\n case REFUSAL:\n ListUtil.selectComboboxItem(cboReason, immunItem.getReason());\n txtComment.setText(immunItem.getComment());\n datEventDate.setValue(immunItem.getDate());\n break;\n case HISTORICAL:\n datEventDate.setValue(immunItem.getDate());\n txtLocation.setValue(immunItem.isImmunization() ? immunItem.getLocationName() : \"\");\n txtLocation.setAttribute(\"ID\", immunItem.isImmunization() ? immunItem.getLocationID() : \"\");\n selLoc = immunItem.getLocationID() + U + U + immunItem.getLocationName();\n radOther.setSelected(txtLocation.getAttribute(\"ID\") != null\n ? txtLocation.getAttribute(\"ID\").toString().isEmpty() : false);\n txtAdminNote.setText(immunItem.getAdminNotes());\n ZKUtil.disableChildren(fraDate, true);\n ZKUtil.disableChildren(fraHistorical, true);\n default:\n service.getLot(lotNumbers, getVaccineID());\n loadComboValues(cboLot, lotNumbers, comboRenderer);\n loadVaccination();\n txtLocation.setValue(immunItem.isImmunization() ? immunItem.getLocationName() : \"\");\n txtLocation.setAttribute(\"ID\", immunItem.isImmunization() ? immunItem.getLocationID() : \"\");\n selLoc = immunItem.getLocationID() + U + U + immunItem.getLocationName();\n radOther.setSelected(txtLocation.getAttribute(\"ID\") != null\n ? txtLocation.getAttribute(\"ID\").toString().isEmpty() : false);\n ListUtil.selectComboboxItem(cboLot, immunItem.getLot());\n ListUtil.selectComboboxItem(cboSite, StrUtil.piece(immunItem.getInjSite(), \"~\", 2));\n spnVolume.setText(immunItem.getVolume());\n datGiven.setDate(immunItem.getDate());\n datVIS.setValue(immunItem.isImmunization() ? immunItem.getVISDate() : null);\n ListUtil.selectComboboxItem(cboReaction, immunItem.getReaction());\n ListUtil.selectComboboxData(cboOverride, immunItem.getVacOverride());\n txtAdminNote.setText(immunItem.getAdminNotes());\n cbCounsel.setChecked(immunItem.wasCounseled());\n }\n } else {\n IUser user = UserContext.getActiveUser();\n Practitioner provider = new Practitioner();\n provider.setId(user.getLogicalId());\n provider.setName(FhirUtil.parseName(user.getFullName()));\n txtProvider.setValue(FhirUtil.formatName(provider.getName()));\n txtProvider.setAttribute(\"ID\", VistAUtil.parseIEN(provider)); //provider.getId().getIdPart());\n selPrv = txtProvider.getAttribute(\"ID\") + U + U + txtProvider.getValue();\n Location location = new Location();\n location.setName(\"\");\n location.setId(\"\");\n datGiven.setDate(getBroker().getHostTime());\n onClick$btnVaccine(null);\n \n if (txtVaccine.getValue().isEmpty()) {\n close(true);\n return;\n }\n \n Encounter encounter = EncounterContext.getActiveEncounter();\n if (!EncounterUtil.isPrepared(encounter)) {\n setEventType(EventType.HISTORICAL);\n radCurrent.setDisabled(true);\n } else {\n if (isCategory(encounter, \"E\")) {\n setEventType(EventType.HISTORICAL);\n Date date = encounter == null ? null : encounter.getPeriod().getStart();\n datEventDate.setValue(DateUtil.stripTime(date == null ? getBroker().getHostTime() : date));\n radCurrent.setDisabled(true);\n txtLocation.setText(user.getSecurityDomain().getName());\n PromptDialog.showInfo(user.getSecurityDomain().getLogicalId());\n txtLocation.setAttribute(\"ID\", user.getSecurityDomain().getLogicalId());\n \n } else {\n if (isVaccineInactive()) {\n setEventType(EventType.HISTORICAL);\n radCurrent.setDisabled(true);\n } else {\n setEventType(EventType.CURRENT);\n radCurrent.setDisabled(false);\n }\n }\n }\n selectItem(cboReason, NONESEL);\n }\n btnSave.setLabel(immunItem == null ? \"Add\" : \"Save\");\n btnSave.setTooltiptext(immunItem == null ? \"Add record\" : \"Save record\");\n txtVaccine.setFocus(true);\n }", "@Override\n\t\t\tpublic void mouseClicked(MouseEvent e)\n\t\t\t{\n\t\t\t\t\n\t\t\t\tDefaultTableModel model=(DefaultTableModel)table.getModel();\n\t\t\t\tint i=table.getSelectedRow();\n\t\t\t\t\n\t\t\t\ttxtCustomerName.setText(model.getValueAt(i,0).toString());\n\t\t\t\ttxtAddress.setText(model.getValueAt(i,1).toString());\n\t\t\t\ttxtContact.setText(model.getValueAt(i,2).toString());\n\t\t\t\ttxtProduct.setText(model.getValueAt(i,3).toString());\n\t\t\t\ttxtSerialNo.setText(model.getValueAt(i,4).toString());\n\t\t\t\ttxtModuleNo.setText(model.getValueAt(i,5).toString());\n\t\t\t\ttxtComplaintNo.setText(model.getValueAt(i,6).toString());\n\t\t\t\tCategorycomboBox.setSelectedItem(model.getValueAt(i,7).toString());\n\t\t\t}", "@FXML\n public void clicaTblCidade(){\n \tCidade sel = tblCidade.getSelectionModel().getSelectedItem();\n \ttxtNome.setText(sel.getNome());\n \ttxtUf.getSelectionModel().select(sel.getUf());\n }", "public void mouseClicked(MouseEvent arg0){\n int r = table.getSelectedRow();\r\n if(r>=0){ \r\n// deletebtnButton.setEnabled(true);\r\n deletebtn.setEnabled(true); \r\n\r\n //Fetching records from Table on Fields\r\n idField.setText(\"\"+table.getModel().getValueAt(r,0));\r\n \t}\r\n }", "public ManageProductForm() {\r\n \r\n initComponents();\r\n getContentPane().setBackground(BG_DARK_ALT);\r\n \r\n listCategory();\r\n \r\n modelContentList = (DefaultTableModel)tblContentList.getModel();\r\n \r\n // Align numeric column to the right\r\n rightRenderer.setHorizontalAlignment(JLabel.RIGHT);\r\n tblContentList.getColumnModel().getColumn(4).setCellRenderer(rightRenderer);\r\n tblContentList.getColumnModel().getColumn(5).setCellRenderer(rightRenderer);\r\n tblContentList.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);\r\n \r\n lblRealID.setVisible(false);\r\n \r\n tblContentList.getSelectionModel().addListSelectionListener(new ListSelectionListener() {\r\n @Override\r\n public void valueChanged(ListSelectionEvent e) {\r\n int curRow = tblContentList.getSelectedRow();\r\n if(curRow > -1){\r\n lblProductID.setText(tblContentList.getValueAt(curRow, 0).toString());\r\n tbxCode.setText(tblContentList.getValueAt(curRow, 1).toString());\r\n tbxName.setText(tblContentList.getValueAt(curRow, 2).toString());\r\n \r\n // Set combobox selection\r\n String category = tblContentList.getValueAt(curRow, 3).toString();\r\n for (int i = 0; i < cmbCategory.getItemCount(); i++) {\r\n if (cmbCategory.getItemAt(i).equals(category)) {\r\n cmbCategory.setSelectedIndex(i);\r\n break;\r\n }\r\n }\r\n tbxCost.setText(tblContentList.getValueAt(curRow, 4).toString().replace(\",\", \"\"));\r\n tbxPrice.setText(tblContentList.getValueAt(curRow, 5).toString().replace(\",\", \"\"));\r\n tbxDescription.setText(tblContentList.getValueAt(curRow, 6).toString());\r\n \r\n lblRealID.setText(tblContentList.getValueAt(curRow, 7).toString());\r\n cmbStatus.setSelectedItem(tblContentList.getValueAt(curRow, 8).toString());\r\n\r\n setFrameState(frameState.SELECTED);\r\n }\r\n } \r\n });\r\n }", "private void toEdit() {\n int i=jt.getSelectedRow();\n if(toCount()==0)\n {\n JOptionPane.showMessageDialog(rootPane,\"No data has been added to the details\");\n }\n else if(i==-1)\n {\n JOptionPane.showMessageDialog(rootPane,\"No item has been selected for the update\");\n }\n else\n {\n if(tfPaintId.getText().isEmpty())\n {\n JOptionPane.showMessageDialog(rootPane,\"Please! Enter the Paint ID\");\n }\n else if(tfName.getText().isEmpty())\n {\n JOptionPane.showMessageDialog(rootPane,\"Please! Enter the Product name\");\n }\n else if(rwCombo.getSelectedItem().toString().equals(\"Select\"))\n {\n JOptionPane.showMessageDialog(rootPane,\"Please! Select the raw materials used\");\n }\n else if(bCombo.getSelectedItem().toString().equals(\"Select\"))\n {\n JOptionPane.showMessageDialog(rootPane,\"Please! select the brand you want\");\n }\n else if(tfPrice.getText().isEmpty())\n {\n JOptionPane.showMessageDialog(rootPane,\"Please! Enter the price\");\n }\n else if(tfColor.getText().isEmpty())\n {\n JOptionPane.showMessageDialog(rootPane,\"Please! Enter the colour\");\n }\n else if(typeCombo.getSelectedItem().toString().equals(\"Select\"))\n {\n JOptionPane.showMessageDialog(rootPane,\"Select something from paint type\");\n }\n else if(getQuality()==null) \n {\n JOptionPane.showMessageDialog(rootPane,\"Quality is not selected\");\n }\n else if(tfQuantity.getText().isEmpty())\n {\n JOptionPane.showMessageDialog(rootPane,\"Please! Enter the quantity\");\n }\n else\n {\n try\n {\n jtModel.setValueAt(tfPaintId.getText(),i,0);\n jtModel.setValueAt(tfName.getText(),i,1);\n jtModel.setValueAt(Integer.valueOf(tfPrice.getText()),i,2);\n jtModel.setValueAt(tfColor.getText(),i,3);\n jtModel.setValueAt(rwCombo.getSelectedItem(),i,4);\n jtModel.setValueAt(bCombo.getSelectedItem(),i,5);\n jtModel.setValueAt(typeCombo.getSelectedItem(),i,6);\n jtModel.setValueAt(getQuality(),i,7);\n jtModel.setValueAt(Integer.valueOf(tfQuantity.getText()),i,8);\n JOptionPane.showMessageDialog(rootPane,\"Successfully updated the data in details\");\n toClear();\n }\n catch(Exception ex)\n {\n JOptionPane.showMessageDialog(rootPane,\"Excepted integer but entered another character at price or quantity.\");\n }\n }\n }\n }", "@Override\n\t\t\tpublic void mouseClicked(MouseEvent arg0) {\n\t\t\t\tint selectedRow = table.getSelectedRow();//获得选中行的索引\n\t\t\t\tif(selectedRow!= -1) //是否存在选中行\n\t\t\t {\n\t\t\t Object oa = tableModel.getValueAt(selectedRow, 0);\n\t\t\t Object ob = tableModel.getValueAt(selectedRow, 1);\n\t\t\t comboBox_1.setSelectedItem(oa.toString());\n\t\t\t textField2.setText(ob.toString());\n\t\t\t }\n\t\t\t else{\n\t\t\t textField2.setText(\"\");\n\t\t\t }\n\t\t\t}", "@Override\r\n\t\t\tpublic void handle(CellEditEvent<Products, String> arg0) {\n\t\t\t\targ0.getTableView().getItems().get(arg0.getTablePosition().getRow()).setName(arg0.getNewValue());\r\n\t\t\t\tProducts data=(Products) tbl_view.getSelectionModel().getSelectedItem();\r\n\t\t\t\tSystem.out.println(data.toString());\r\n\t\t\t\tConnectionManager.queryInsert(conn, \"UPDATE dbo.product SET name='\"+data.getName()+\"' WHERE id=\"+data.getId());\r\n\t\t\t\ttxt_cost.clear();\r\n\t\t\t\ttxt_date.clear();\r\n\t\t\t\ttxt_name.clear();\r\n\t\t\t\ttxt_price.clear();\r\n\t\t\t\ttxt_qty.clear();\r\n\t\t\t\ttxt_reorder.clear();\r\n\t\t\t\ttxt_search.clear();\r\n\t\t\t\tfetchData(FETCH_DATA);\r\n\t\t\t}", "public void getRow(MouseEvent e) {\n\t\tconn = MySqlConnection.ConnectDb();\n\t\tindex = tableTransactions.getSelectionModel().getSelectedIndex();\n\n\t\tif (index <= -1)\n\t\t\treturn;\n\n\t\ttxt_transactionID.setText(col_transactionID.getCellData(index).toString());\n\t\ttxt_date.setPromptText(col_date.getCellData(index).toString());\n\t\ttxt_description.setText(col_description.getCellData(index).toString());\n\t\ttxt_category.setPromptText(col_category.getCellData(index).toString());\n\t\ttxt_amount.setText(col_amount.getCellData(index).toString());\n\t}", "@Override\r\n\t\t\t\t\t\t\t\tpublic void handle(ActionEvent arg0) {\n\r\n\t\t\t\t\t\t\t\t\tProducts data=(Products) tbl_view.getItems().get(getIndex());\r\n\t\t\t\t\t\t\t\t\t//\t\t\t\t\t\t\t\t\tProducts data=(Products) tbl_view.getSelectionModel().getSelectedItem();\r\n\t\t\t\t\t\t\t\t\tSystem.out.println(data.toString());\r\n\t\t\t\t\t\t\t\t\tif(ConnectionManager.queryInsert(conn, \"DELETE FROM dbo.product WHERE id=\"+data.getId())>0) {\r\n\t\t\t\t\t\t\t\t\t\ttxt_cost.clear();\r\n\t\t\t\t\t\t\t\t\t\ttxt_date.clear();\r\n\t\t\t\t\t\t\t\t\t\ttxt_name.clear();\r\n\t\t\t\t\t\t\t\t\t\ttxt_price.clear();\r\n\t\t\t\t\t\t\t\t\t\ttxt_qty.clear();\r\n\t\t\t\t\t\t\t\t\t\ttxt_reorder.clear();\r\n\t\t\t\t\t\t\t\t\t\ttxt_search.clear();\r\n\t\t\t\t\t\t\t\t\t\tfetchData(FETCH_DATA);\r\n\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t}", "private void tblEmpMouseClicked(java.awt.event.MouseEvent evt) {\n int totalRows = tblEmp.getRowCount();\n int totalCols = tblEmp.getColumnCount();\n\n int row = tblEmp.getSelectedRow();\n TableModel tm = tblEmp.getModel();\n\n initialUsername = (String) tm.getValueAt(row, 0);\n\n txtUsername.setText((String) tm.getValueAt(row, 0));\n txtfname.setText((String) tm.getValueAt(row, 1));\n txtlname.setText((String) tm.getValueAt(row, 2));\n String gender = (String) tm.getValueAt(row, 3);\n txtage.setText((String) tm.getValueAt(row, 4));\n txtemail.setText((String) tm.getValueAt(row, 5));\n txtcontact.setText((String) tm.getValueAt(row, 6));\n txtaddress.setText((String) tm.getValueAt(row, 7));\n txtcity.setText((String) tm.getValueAt(row, 8));\n txtstate.setText((String) tm.getValueAt(row, 9));\n txtcountry.setText((String) tm.getValueAt(row, 10));\n txtpincode.setText((String) tm.getValueAt(row, 11));\n Timestamp hireDate = (Timestamp) tm.getValueAt(row, 12);\n txthiredate.setDate(hireDate);\n cbvalid.setSelected((boolean) tm.getValueAt(row, 13));\n Timestamp dob = (Timestamp) tm.getValueAt(row, 14);\n txtdob.setDate(dob);\n\n if (gender.equalsIgnoreCase(\"male\")) {\n rbmale.setSelected(true);\n } else {\n rbfemale.setSelected(true);\n }\n\n jtab.setSelectedIndex(1);\n\n }", "private void selectedRowGuide(){\r\n xy log_guide_rel_inv = tb_guias.getSelectionModel().getSelectedItem(); \r\n loadTables(log_guide_rel_inv.getGuias());\r\n loadCarga(log_guide_rel_inv.getGuias());\r\n \r\n List<Fxp_Archguid_gfc> data = Ln.getList_log_Archguid_gfc(Ln.getInstance().find_Archguid_gfc(log_guide_rel_inv.getGuias()));\r\n\r\n tp_factura.setText(\r\n \"Relación de Guia / Facturas / Clientes \" + \r\n \" - \" + \r\n data.size() + \" / \" + \r\n data.get(0).getNumfact() + \" / \" + \r\n data.get(0).getNumclie());\r\n\r\n tp_factura.setExpanded(true);\r\n \r\n }", "public ViewTicketDetails() {\n initComponents();\n bindTableTicket();\n preparePopupMenu();\n selected_row=-1;\n }", "@Override\n public void focusGained(FocusEvent fe) {\n if (!table.getSelectionModel().isSelectionEmpty()) \n Order.selectedBookingIDRow = (int) table.getValueAt(table.getSelectedRow(), 0);\n }", "@Override\n\t\t\tpublic void mouseClicked(MouseEvent e)\n\t\t\t{\n\t\t\t\tDefaultTableModel model=(DefaultTableModel)tblCustomer.getModel();\n\t\t\t\tint i=tblCustomer.getSelectedRow();\n\t\t\t\ttxtInvoiceNo.setText(model.getValueAt(i,0).toString());\n\t\t\t\ttxtDate.setText(model.getValueAt(i,1).toString());\n\t\t\t\ttxtTime.setText(model.getValueAt(i,2).toString());\n\t\t\t\ttxtSearch.setText(model.getValueAt(i,2).toString());\n\t\t\t\ttxtAddress.setText(model.getValueAt(i,2).toString());\n\t\t\t\ttxtContact.setText(model.getValueAt(i,2).toString());\n\t\t\t\ttxtTotalAmmount.setText(model.getValueAt(i,4).toString());\n\t\t\t\ttxtPaidAmmount.setText(model.getValueAt(i,5).toString());\n\t\t\t\ttxtPendingAmmount.setText(model.getValueAt(i,6).toString());\n\t\t\t\t\n\t\t\t\tshowDataInvoiceNo();\n\t\t\t\t\n\t\t\t\t//set data to the JTextFeilds to the JTextfields\n\t\t\t\ttry {\n\t\t\t\t\tcon=DriverManager.getConnection(\"jdbc:mysql://localhost:3306/MundheElectronics1\",\"root\",\"vishakha\");\n\t\t\t\t\tString s=\"select *from ProductsData where Invoice_No=?\";\n\t\t\t\t ps=con.prepareStatement(s);\n\t\t\t\t ps.setString(1,txtInvoiceNo.getText());\n\t\t\t\t rs=ps.executeQuery();\n\t\t\t\t if(rs.next())\n\t\t\t\t {\n\t\t\t\t \tString Date=rs.getString(\"Date\");\n\t\t\t\t\t\ttxtDate.setText(Date);\n\t\t\t\t\t\tString Time=rs.getString(\"Time\");\n\t\t\t\t\t\ttxtTime.setText(Time);\n\t\t\t\t\t\tString Customer_Name=rs.getString(\"Customer_Name\");\n\t\t\t\t\t\ttxtSearch.setText(Customer_Name);\n\t\t\t\t\t\tString Address=rs.getString(\"Address\");\n\t\t\t\t\t\ttxtAddress.setText(Address);\n\t\t\t\t\t\tString Contact=rs.getString(\"Contact\");\n\t\t\t\t\t\ttxtContact.setText(Contact);\n\t\t\t\t\t\tString Total_Ammount=rs.getString(\"Total_Ammount\");\n\t\t\t\t\t\ttxtTotalAmmount.setText(Total_Ammount);\n\t\t\t\t\t\tString Pending_Ammount=rs.getString(\"Pending_Ammount\");\n\t\t\t\t\t\ttxtPendingAmmount.setText(Pending_Ammount);\n\t\t\t\t\t\tString Paid_Ammount=rs.getString(\"Paid_Ammount\");\n\t\t\t\t//\t\tSystem.out.println(Paid_Ammount);\n\t\t\t\t\t\ttxtPaidAmmount.setText(Paid_Ammount);\n\t\t\t\t\t\n\t\t\t\t }\n\t\t\t\t else\n\t\t\t\t {\n\t\t\t\t //\tJOptionPane.showMessageDialog(null,\"Sorry! this Invoice is not Exist.\");\t\n\t\t\t\t }\n\t\t\t\t \n\t\t\t\t} catch (SQLException e3) {\n\t\t\t\t\t// TODO Auto-generated catch block\n\t\t\t\t\te3.printStackTrace();\n\t\t\t\t}\n\t\t\t\tshowDataInvoiceNo();\n\t\t\t}", "@Override\n\t\t\tpublic void onClick(View v) {\n\t\t\t\tTableRow selected=null;\n\t\t\t\tfor(int i=0;i<table.getChildCount() && selected==null;i++){\n\t\t\t\t\tTableRow row = (TableRow)table.getChildAt(i);\n\t\t\t\t\tif(row.isSelected()){\n\t\t\t\t\t\tselected=row;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tif(selected==null){\n\t\t\t\t\t//Creamos un toast para avisar\n\t\t\t\t\tResources res = getResources();\n\t\t\t\t\tString text = String.format(res.getString(R.string.selectBill));\n\t\t\t\t\tToast msg = Toast.makeText(getBaseContext(),text, Toast.LENGTH_LONG);\n\t\t\t\t\tmsg.show();\n\t\t\t\t}\n\t\t\t\telse{\n\t\t\t\t\tTextView idFactura = (TextView) selected.getChildAt(1);\n\t\t\t\t\tTextView nameClient = (TextView) selected.getChildAt(0);\n\t\t\t\t\t\n\t\t\t\t\tGlobalStatic data = (GlobalStatic) getApplicationContext();\n\t\t\t\t\t\n\t\t\t\t\tdata.cliente = data.getCliente((String)nameClient.getText());\n\t\t\t\t\tdata.factura = data.getFacturasId(data.cliente, Integer.parseInt((String)idFactura.getText()));\n\n\t\t\t\t\tIntent intent = new Intent(DiarySelection.this,BillForm.class);\n\t\t\t\t\tstartActivity(intent);\n\t\t\t\t}\n\t\t\t}", "private void setDataForTicket(){\n int rowId = ticketGui.getSelectedRowId();\n Ticket ticket = controller.getTicketById(rowId);\n\n // setting the data from the ticket i got to the popup gui\n clientNameTextField.setText(ticket.getClientName());\n starIdTextField.setText(ticket.getStarId());\n emailTextField.setText(ticket.getEmail());\n phoneNumberTextField.setText(ticket.getPhoneNumber());\n deviceModelTextField.setText(ticket.getModel());\n descriptionTextArea.setText(ticket.getDescription());\n clubMemberNameTextField.setText(ticket.getMemberName());\n resolutionTextArea.setText(ticket.getResolution());\n\n }", "private void setInfo(int row)\n {\n String ID=table.getModel().getValueAt(row, 0).toString();\n String Name=table.getModel().getValueAt(row, 1).toString(); \n idText.setText(ID);\n nameText.setText(Name);\n }", "private void butEditFeeSched_Click(Object sender, System.EventArgs e) throws Exception {\n long selectedSched = 0;\n if (listFeeSched.SelectedIndex != -1)\n {\n selectedSched = FeeSchedC.getListShort()[listFeeSched.SelectedIndex].FeeSchedNum;\n }\n \n FormFeeScheds FormF = new FormFeeScheds();\n FormF.ShowDialog();\n DataValid.setInvalid(InvalidType.FeeScheds,InvalidType.Fees,InvalidType.ProcCodes);\n //Fees.Refresh();\n //ProcedureCodes.RefreshCache();\n changed = true;\n fillFeeSchedules();\n for (int i = 0;i < FeeSchedC.getListShort().Count;i++)\n {\n if (FeeSchedC.getListShort()[i].FeeSchedNum == selectedSched)\n {\n listFeeSched.SelectedIndex = i;\n }\n \n }\n fillGrid();\n SecurityLogs.MakeLogEntry(Permissions.Setup, 0, \"Fee Schedules\");\n }", "private void Table_MajorRoadMouseClicked(java.awt.event.MouseEvent evt) {\n int number = Table_MajorRoad.getSelectedRow();\n \n localauid.setText(Table_MajorRoad.getValueAt(number, 0).toString());\n countpntid.setText(Table_MajorRoad.getValueAt(number, 1).toString());\n roadname.setText(Table_MajorRoad.getValueAt(number, 2).toString());\n pedalcy.setText(Table_MajorRoad.getValueAt(number, 3).toString());\n cartaxi.setText(Table_MajorRoad.getValueAt(number, 4).toString());\n lgvss.setText(Table_MajorRoad.getValueAt(number, 5).toString());\n years.setText(Table_MajorRoad.getValueAt(number, 6).toString());\n hour.setText(Table_MajorRoad.getValueAt(number, 7).toString());\n eastings.setText(Table_MajorRoad.getValueAt(number, 8).toString());\n northings.setText(Table_MajorRoad.getValueAt(number, 9).toString());\n linklengthm.setText(Table_MajorRoad.getValueAt(number, 10).toString());\n \n \n \n \n }", "public void mouseClicked(MouseEvent e) {\n\t\t\t\tint row = table.getSelectionModel().getLeadSelectionIndex();\r\n\t\t\t\tif (e.getClickCount() == 1) {\r\n\t\t\t\t\tif(productBySearch.size() > 0){\r\n\t\t \t\tfor(int i = 0; i < productBySearch.size(); i++){\r\n\t\t \t\t\tif(String.valueOf(model.getValueAt(row, id_column)).equals(String.valueOf(productBySearch.get(i).getID()))){\r\n\t\t \t\t\t\ttextField_name_input.setText(productBySearch.get(i).getName());\r\n\t\t \t\t\t\ttextField_description_input.setText(productBySearch.get(i).getDescription());\r\n\t\t \t\t\t\ttextField_quantity_input.setText(String.valueOf(productBySearch.get(i).getQuantity()));\r\n\t\t \t\t\t\tbreak;\r\n\t\t \t\t\t}\r\n\t\t \t\t}\r\n\t\t \t}\r\n\t\t\t\t}\r\n\t\t\t}", "private void bomSelected(int selectedRow){\n \tbomDet=new inventorycontroller.function.BillOfMaterialProcessor(dbInterface1)\n \t .getBomDescForPoMaster(jTable1.getModel().getValueAt(selectedRow, 3).toString());\n \t\n \tadjustAddedQty(); //* adjusts the item qty. which are already added.\n \t\n \tjTable2.setModel(new javax.swing.table.DefaultTableModel(\n bomDet,\n new String [] {\n \"Select\", \"Material\", \"Reqd. Quantity\", \"Purchase Requirement\", \"Remark\"\n }\n ) {\n Class[] types = new Class [] {\n \tjava.lang.Boolean.class, \n \tjava.lang.String.class, \n java.lang.Long.class, \n java.lang.Long.class,\n java.lang.String.class\n };\n \n public Class getColumnClass(int columnIndex) {\n return types [columnIndex];\n }\n\n public boolean isCellEditable(int rowIndex, int columnIndex) {\n return columnIndex==0 ? true : false ;\n }\n });\n }", "private void select(int row, int column) {\n \n if (recordList != null && entryForm != null) {\n currentColumn = column;\n if (currentRow != row) {\n currentRow = row;\n recordList.setSelectedIndex(row);\n }\n recordForm.setFocusAt(column);\n }\n \n }", "private void azzeraInsertForm() {\n\t\tviewInserimento.getCmbbxTipologia().setSelectedIndex(-1);\n\t\tviewInserimento.getTxtFieldDataI().setText(\"\");\n\t\tviewInserimento.getTxtFieldValore().setText(\"\");\n\t\tviewInserimento.getTxtFieldDataI().setBackground(Color.white);\n\t\tviewInserimento.getTxtFieldValore().setBackground(Color.white);\n\t}", "public static void ChkForm() throws ClassNotFoundException, SQLException {\r\n try (Statement s = DBConnect.connection.createStatement()) {\r\n String selTable3 = \"SELECT Store As str, Form_Name As frm, Date_Created As dte, Status As st FROM existing_forms WHERE Status = 'In-Process' AND Form_Name LIKE 'ebas_\" + GtStore.store + \"_0%' OR 'ebas_\" + GtStore.store + \"_1%'\";\r\n s.execute(selTable3);\r\n try (ResultSet rs3 = s.getResultSet()) {\r\n if (rs3.next()) {\r\n //rs3.next();\r\n EBAS.Date_Label.setText(\"Date Started: \" + rs3.getString(\"dte\"));\r\n nwFrm = \"no\";\r\n StFrmNm = rs3.getString(\"frm\");\r\n StFrmSt = rs3.getString(\"st\");\r\n gtDB();\r\n } else {\r\n nwFrm = \"yes\";\r\n }\r\n }\r\n }\r\n }", "void fillEditTransactionForm(Transaction transaction);", "@Override\r\n\t\tpublic void actionPerformed(ActionEvent e) {\n\t\t\tint row = Integer.valueOf(e.getActionCommand());\r\n\t\t\t//LibriTableModel model = (LibriTableModel) table.getModel();\r\n\t\t\tModelMethods.aggiungiCarrello(row);\r\n\t\t\tVenditeView.aggiornaLabels();\r\n\t\t\tLibriJPanJTab.refresh();\r\n\t\t}", "@Override\n\t\t\tpublic void focusGained(FocusEvent e) {\n\t\t\t\tint index = table.getSelectedRow();\n\t\t\t\t\n\t\t\t\tif (index >= 0 && index < table.getRowCount()) {\n\t\t\t\t\t\n\t\t\t\t\t Server ServerConnection;\n\t\t String courseID = (String) table.getValueAt(index, 0);\n\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\tServerConnection = new Server();\n\t\t\t\t\t\t\tString query = \"select * from course_attend where StudentID ='\" + ClientID + \"' and courseID ='\"+courseID+\"'\";\n\t\t\t \t\tResultSet data = ServerConnection.ExecuteQuery(query);\n\t\t\t \t\tif (data.next()) {\n\t\t\t \t\t\tscoreTable.setValue((String)table.getValueAt(index, 1), data.getString(\"practice_point\"), data.getString(\"theory_point\"), data.getString(\"overall\"), data.getString(\"pass_status\"));\n\t\t\t \t\t}\n\t\t\t\t\t\t} catch (SQLException 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\n\t\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}", "private void jButton13ActionPerformed(java.awt.event.ActionEvent evt) {\n selectedDataSupplier();\n\n String id_sup=jTable2.getValueAt(Globaltemp,0).toString();\n\n Supplier Sup= new Supplier(Ed_NamaSup.getText(),Ed_AlamatSup.getText(),Ed_TelpSup.getText());\n int selectedOption = JOptionPane.showConfirmDialog(null,\n \"Apakah Anda yakin ingin mengedit item tersebut?\",\n \"Peringatan\",\n JOptionPane.YES_NO_OPTION);\n if (selectedOption == JOptionPane.YES_OPTION)\n {\n JOptionPane.showMessageDialog(null, \"Perubahan data supplier berhasil disimpan\");\n this.EditDataSupplier.setVisible(false);\n con.editSupplier(Sup,id_sup);\n enablein();\n ClearText();\n showTable();\n }\n\n }", "@Override\n\t\t\tpublic void onClick(View v) {\n\t\t\t\tTableRow selected=null;\n\t\t\t\tfor(int i=0;i<table.getChildCount() && selected==null;i++){\n\t\t\t\t\tTableRow row = (TableRow)table.getChildAt(i);\n\t\t\t\t\tif(row.isSelected()){\n\t\t\t\t\t\tselected=row;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t//Si no se ha seleccionado ninguna columna\n\t\t\t\tif(selected==null){\n\t\t\t\t\t//Creamos un toast para avisar\n\t\t\t\t\tResources res = getResources();\n\t\t\t\t\tString text = String.format(res.getString(R.string.selectBill));\n\t\t\t\t\tToast msg = Toast.makeText(getBaseContext(),text, Toast.LENGTH_LONG);\n\t\t\t\t\tmsg.show();\n\t\t\t\t}\n\n\t\t\t\telse{\n\t\t\t\t\t//Obtenemos los datos necesarios para\n\t\t\t\t\t//Localizar la factura a imprimir\n\t\t\t\t\tTextView idFactura = (TextView) selected.getChildAt(1);\n\t\t\t\t\tTextView nameClient = (TextView) selected.getChildAt(0);\n\t\t\t\t\t\n\t\t\t\t\tGlobalStatic data = (GlobalStatic) getApplicationContext();\n\t\t\t\t\tdata.cliente = data.getCliente((String)nameClient.getText());\n\t\t\t\t\tdata.factura = data.getFacturasId(data.cliente, Integer.parseInt((String)idFactura.getText()));\n\t\t\t\t\t//Creamos el pdf y lo imprimimos\n\t\t\t\t\ttry {\n\t\t\t\t\t\tdata.crearFacturaDiaria(data);\n\t\t\t\t\t} catch (Exception e) {\n\t\t\t\t\t\t// TODO Auto-generated catch block\n\t\t\t\t\t\te.printStackTrace();\n\t\t\t\t\t}\n\t\t\t\t\t//Creamos un toast para avisar\n\t\t\t\t\tResources res = getResources();\n\t\t\t\t\tString text = String.format(res.getString(R.string.printing));\n\t\t\t\t\tToast msg = Toast.makeText(getBaseContext(),text, Toast.LENGTH_LONG);\n\t\t\t\t\tmsg.show();\n\t\t\t\t\n\t\t\t\t}\n\t\t\t}", "public void performTambah() {\n\n dialogEntry.postInit();\n dialogEntry.clearFields();\n dialogEntry.setRowToBeEdited(-1);\n //dialogEntry.clearFields ();\n dialogEntry.show(true); // -- modal dialog ya, jd harus menunggu..\n //if (isDirty()) {\n loadTable();\n // TODO : select last item added\n //}\n }", "@Override\r\n\t\t\tpublic void handle(CellEditEvent<Products, String> arg0) {\n\t\t\t\targ0.getTableView().getItems().get(arg0.getTablePosition().getRow()).setQuantity(arg0.getNewValue());\r\n\t\t\t\tProducts data=(Products) tbl_view.getSelectionModel().getSelectedItem();\r\n\t\t\t\tSystem.out.println(data.toString());\r\n\t\t\t\tConnectionManager.queryInsert(conn, \"UPDATE dbo.product SET quantity='\"+data.getQuantity()+\"' WHERE id=\"+data.getId());\r\n\t\t\t\ttxt_cost.clear();\r\n\t\t\t\ttxt_date.clear();\r\n\t\t\t\ttxt_name.clear();\r\n\t\t\t\ttxt_price.clear();\r\n\t\t\t\ttxt_qty.clear();\r\n\t\t\t\ttxt_reorder.clear();\r\n\t\t\t\ttxt_search.clear();\r\n\t\t\t\tfetchData(FETCH_DATA);\r\n\t\t\t}", "public void tabla_campos() {\n int rec = AgendarA.tblAgricultor.getSelectedRow();// devuelve un entero con la posicion de la seleccion en la tabla\n ccAgricultor = AgendarA.tblAgricultor.getValueAt(rec, 1).toString();\n crearModeloAgenda();\n }", "private void autoFillForm(String sID) {\n\t\ttry {\n\t\t\tString st=\"SELECT * FROM services WHERE ServiceId=\"+sID;\n\t\t\tConnection con=serviceCentreDBConnection.connect();\n\t\t\tPreparedStatement ps=con.prepareStatement(st);\n\t\t\tResultSet rs=ps.executeQuery();\n\t\t\twhile(rs.next()) {\n\t\t\t\tString rgno=rs.getString(\"regNo\");\n\t\t\t\tString sType=rs.getString(\"serviceType\");\n\t\t\t\tString sCost=rs.getString(\"serviceCost\");\n\t\t\t\tString pDate=rs.getString(\"pickupDate\");\n\t\t\t\tString sDate=rs.getString(\"submitDate\");\n\t\t\t\tString nDate=rs.getString(\"nextDate\");\n\t\t\t\trg.setText(rgno);\n\t\t\t\tsc.setText(sCost);\n\t\t\t\tpd.setText(pDate);\n\t\t\t\tsd.setText(sDate);\n\t\t\t\tnd.setText(nDate);\n\t\t\t\tif(sType.equalsIgnoreCase(\"Free\"))\n\t\t\t\t\t{stype.setSelectedItem(\"Free\");;}\n\t\t\t\telse {stype.setSelectedItem(\"Paid\");;}\n\t\t\t\t\n\t\t\t}\n\t\t} catch (SQLException e) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\te.printStackTrace();\n\t\t}\n\t\t\n\t\t\n\t}", "private void tablaproveedorMouseClicked(java.awt.event.MouseEvent evt) {\n int fila = tablaproveedor.getSelectedRow();\n if(fila >= 0 && tablaproveedor.getValueAt(fila, 0) != null) {\n txtProveedorCodigo.setText(String.valueOf(tablaproveedor.getValueAt(fila, 0)));\n txtProveedor.setText((String)tablaproveedor.getValueAt(fila, 1));\n this.dispose();\n } else {\n txtProveedorCodigo.setText(\"\");\n txtProveedor.setText(\"\");\n }\n }", "private void jTablePesquisaMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jTablePesquisaMouseClicked\n // Salva a posição da linha selecionada na tabela de pesquisa\n int linhaSelecionada = jTablePesquisa.getSelectedRow();\n Object id_genero = jTablePesquisa.getValueAt(linhaSelecionada, 1);\n System.out.println(id_genero);\n Integer id_generow = (Integer) id_genero;\n jT0Id.setText(jTablePesquisa.getValueAt(linhaSelecionada, 0).toString());\n jComboBox1.setSelectedItem(id_generow);\n //jComboBox1.setName(jTablePesquisa.getValueAt(linhaSelecionada, 1).toString());\n jT2Exemplar.setText((String) jTablePesquisa.getValueAt(linhaSelecionada, 2));\n jT3Autor.setText((String) jTablePesquisa.getValueAt(linhaSelecionada, 3));\n jT4Edicao.setText(jTablePesquisa.getValueAt(linhaSelecionada, 4).toString());\n jT5Ano.setText(jTablePesquisa.getValueAt(linhaSelecionada, 5).toString());\n jT6Status.setText((String) jTablePesquisa.getValueAt(linhaSelecionada, 6));\n\n // Ao selecionar um registro, os campos são ativados possibilitando fazer alterações\n habilitaCampos();\n }", "@Override\n public void actionPerformed(ActionEvent e) {\n customer = guiControl.getController().getAccountControl().vecAcc.searchCustomer(Integer.parseInt(textField1.getText()));\n String valued = \"\";\n if (customer.getValued() == 1) {\n valued += \"Valued\";\n } else {\n valued += \"Regular\";\n }\n //Creates the table model so that a table can be dispalyed\n defaultTableModel = new DefaultTableModel();\n table1.setModel(defaultTableModel);\n //Sets the column names\n defaultTableModel.addColumn(\"Account Number\");\n defaultTableModel.addColumn(\"Name\");\n defaultTableModel.addColumn(\"Phone\");\n defaultTableModel.addColumn(\"Customer Type\");\n //Checks to see if a customer name exists or not. If it doeesnt exist then it shows N/A as the\n if (customer.getName().equals(\"\")) {\n defaultTableModel.addRow(new Object[]{\"N/A\", \"N/A\", \"N/A\", \"N/A\"});\n } else {\n //Otherwise gets the values from customer class, and adds them as the rows\n defaultTableModel.addRow(new Object[]{\n customer.getAccountNo(), customer.getName(), customer.getPhone(), valued\n });\n }\n }", "@Override\n\t\t\tpublic void actionPerformed(ActionEvent e) {\n\t\t\t\t\n\t\t\t\tint RowNum=jt.getSelectedRow();\n\t\t\t\tif(RowNum==-1){\n\t\t\t\t\tJOptionPane.showMessageDialog(jt, \"请选择一行\");\n\t\t\t\t return ;\n\t\t\t }\n\t\t \n\t\t String info=((String)mit.getValueAt(RowNum, 1));\n\t\t \n\t\t\t\tString majorNewIn=JOptionPane.showInputDialog(\"请修改专业\",info);\n\t\t\t\tif(majorNewIn!=null)\n\t\t\t\t{\n\t\t\t\t\tif(!majorNewIn.equals(\"\")){\n\t\t\t\t\t\t\n\t\t\t\t\t\tString majorIdSql=\"select id from majorinfo where majorName='\"+Tool.string2UTF8(info)+\"'\";\n\t\t\t\t\t\tString majorid=SqlModel.getInfo(majorIdSql);\n\t\t\t\t\t\t\n\t\t\t\t\t\tString mclassSql=\"update classinfo set major='\"+Tool.string2UTF8(majorNewIn)+\"' where major='\"+Tool.string2UTF8(info)+\"'\";\n\t\t\t\t\t\tString mjobSql=\"update jobinfo set major='\"+Tool.string2UTF8(majorNewIn)+\"' where major='\"+Tool.string2UTF8(info)+\"'\";\n\t\t\t\t\t\tString mmajorSql=\"update majorinfo set majorName='\"+Tool.string2UTF8(majorNewIn)+\"' where id='\"+majorid+\"'\";\n\t\t\t\t\t\t\n\t\t\t\t\t\tSqlModel.updateInfo(mclassSql);\n\t\t\t\t\t\tSqlModel.updateInfo(mjobSql);\n\t\t\t\t\t\tif(SqlModel.updateInfo(mmajorSql)){\n\t\t\t\t\t\t\trefresh(jt);\n\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\tJOptionPane.showMessageDialog(null, \"修改失败\");\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t \n\t\t\t}", "@Override\n public void formPopulated(FormEvent fe) {\n formObject = FormContext.getCurrentInstance().getFormReference();\n\n formObject.setNGValue(\"purchasestatus\", \"\");\n formObject.setNGValue(\"purchaseremarks\", \"\");\n formObject.setNGValue(\"previousstatus\", \"\");\n formObject.setNGValue(\"returnpo\", \"\");\n\n String previousactivity = formObject.getNGValue(\"previousactivity\");\n if (previousactivity.equalsIgnoreCase(\"Initiator\")\n || previousactivity.equalsIgnoreCase(\"StoreMaker\")\n || previousactivity.equalsIgnoreCase(\"StoreChecker\")\n || previousactivity.equalsIgnoreCase(\"AccountsMaker\")\n || previousactivity.equalsIgnoreCase(\"AccountsChecker\")) {\n formObject.addComboItem(\"purchasestatus\", \"Hold\", \"Hold\");\n formObject.addComboItem(\"purchasestatus\", \"Exception Cleared\", \"Exception Cleared\");\n }\n\n if (previousactivity.equalsIgnoreCase(\"QualityMaker\")\n || previousactivity.equalsIgnoreCase(\"QualityChecker\")) {\n formObject.addComboItem(\"purchasestatus\", \"Hold\", \"Hold\");\n formObject.addComboItem(\"purchasestatus\", \"Replacement or Exchange\", \"Replacement or Exchange\");\n formObject.addComboItem(\"purchasestatus\", \"Purchase Return\", \"Purchase Return\");\n }\n\n formObject.clear(\"proctype\");\n Query = \"select HeadName from supplypoheadmaster order by HeadName asc\";\n System.out.println(\"Query is \" + Query);\n result = formObject.getDataFromDataSource(Query);\n for (int i = 0; i < result.size(); i++) {\n formObject.addComboItem(\"proctype\", result.get(i).get(0), result.get(i).get(0));\n }\n }", "public void actionPerformed(ActionEvent e) {\n\r\n\t\tDataBrowserUIPanel browser = app.getOrCreateDataBrowser();\r\n\t\t\r\n\t\tif (dbdt != null) {\r\n\t\t\tbrowser.doLookupFromExternal(dbGroupName, dbdt, fieldValue, null, null);\r\n\t\t}\r\n\t\tif (dbdr != null) {\r\n\t\t\tDataBrowserDefinedTable dbdt2 = (DataBrowserDefinedTable)app.appsh.getDataManagerList(DataBrowserDefinedTable.class).getByPrimaryKey(dbdr.toTable);\r\n\t\t\tbrowser.doLookupFromExternal(dbGroupName, dbdt2, fieldValue, null, null);\r\n\t\t}\r\n\t//\tapp.appsh.getTabManager().setSelectedTab(browser.getKey());\r\n\t}", "private void tblCutiMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_tblCutiMouseClicked\n int row = tblCuti.getSelectedRow();\n txtCutiID.setText(tblCuti.getValueAt(row, 0).toString());\n txtTglAwal.setText(tblCuti.getValueAt(row, 1).toString());\n txtTglAkhir.setText(tblCuti.getValueAt(row, 2).toString());\n txtKet.setText(tblCuti.getValueAt(row, 3).toString());\n cmbCutiKhususID.setSelectedItem(tblCuti.getValueAt(row, 4).toString());\n }", "@Override\r\n\t\t\tpublic void handle(CellEditEvent<Products, String> arg0) {\n\t\t\t\targ0.getTableView().getItems().get(arg0.getTablePosition().getRow()).setExpiry_date(arg0.getNewValue());\r\n\t\t\t\tProducts data=(Products) tbl_view.getSelectionModel().getSelectedItem();\r\n\t\t\t\tSystem.out.println(data.toString());\r\n\t\t\t\tConnectionManager.queryInsert(conn, \"UPDATE dbo.product SET expiry_date='\"+data.getExpiry_date()+\"' WHERE id=\"+data.getId());\r\n\t\t\t\ttxt_cost.clear();\r\n\t\t\t\ttxt_date.clear();\r\n\t\t\t\ttxt_name.clear();\r\n\t\t\t\ttxt_price.clear();\r\n\t\t\t\ttxt_qty.clear();\r\n\t\t\t\ttxt_reorder.clear();\r\n\t\t\t\ttxt_search.clear();\r\n\t\t\t\tfetchData(FETCH_DATA);\r\n\t\t\t}", "@Override\n\t\t\tpublic void mouseClicked(MouseEvent arg0) {\n\t\t\t\tint row = table2.getSelectedRow();\n\t\t\t\tint col = table2.getSelectedColumn();\n\t\t\t\tString mamon = (String) table2.getValueAt(row, 0);\n\t\t\t\tString tenmon = (String) table2.getValueAt(row, 1);\n\t\t\t\tString magv2 = (String) table2.getValueAt(row, 2);\n\t\t\t\tString hocki = (String) table2.getValueAt(row, 3);\n\t\t\t\tString makhoa = (String) table2.getValueAt(row, 4);\n\n\t\t\t\ttxt_mamon.setText(mamon);\n\t\t\t\t// cb_tenmon.setSelectedItem(tenmon);\n\t\t\t\tsetSelectedValue(cb_tenmon, tenmon);\n\t\t\t\ttxt_magv2.setText(magv2);\n\t\t\t\ttxt_hocki.setText(hocki);\n\t\t\t\ttxt_makhoa.setText(makhoa);\n\n\t\t\t}", "public void mouseClicked(MouseEvent e) {\n\t\t\tif(e.getClickCount()==2) {\n\t\t\t\tif(table.getSelectedColumn()!=-1){\n\t\t\t\t\t\n\t\t\t\tString\ts=(String) model.getValueAt(table.getSelectedRow(), 0);\n\t\t\t\tString c=(String) model.getValueAt(table.getSelectedRow(), 1);\n\t\t\t\tif(c.equals(\"到达单\")) \t{\n\t\t\t\t\tArrivalListBL al=new ArrivalListBL();\n\t\t\t\t\ttry {\n\t\t\t\t\t\tnew InvoiceUI_ArrivalListEdit(al.inquiry(s),false);\n\t\t\t\t\t} catch (IOException e1) {\n\t\t\t\t\t\t// TODO Auto-generated catch block\n\t\t\t\t\t\te1.printStackTrace();\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t}\t\t\t\n\t\t\t\telse\tif(c.equals(\"营业厅收入单\")) {\n\t\t\t\t\tIncomeListBL il=new IncomeListBL();\n\t\t\t\t\ttry {\n\t\t\t\t\t\tnew InvoiceUI_IncomeListEdit(il.inquiry(s),false);\n\t\t\t\t\t} catch (IOException e1) {\n\t\t\t\t\t\t// TODO Auto-generated catch block\n\t\t\t\t\t\te1.printStackTrace();\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\telse\tif(c.equals(\"营业厅装车单\")) {\n\t\t\t\t\tLoadingListBL ll=new LoadingListBL();\n\t\t\t\t\ttry {\n\t\t\t\t\t\tnew InvoiceUI_LoadingListEdit(ll.inquiry(s),false);\n\t\t\t\t\t} catch (IOException e1) {\n\t\t\t\t\t\t// TODO Auto-generated catch block\n\t\t\t\t\t\te1.printStackTrace();\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\telse\tif(c.equals(\"中转中心装车单\")) {\n\t\t\t\t\tLoadingListZZBL zc=new LoadingListZZBL();\n\t\t\t\t\ttry {\n\t\t\t\t\t\t\n\t\t\t\t\t\tnew InvoiceUI_LoadingListZZEdit(zc.inquiry(s),false);\n\t\t\t\t\t} catch (IOException e1) {\n\t\t\t\t\t\t// TODO Auto-generated catch block\n\t\t\t\t\t\te1.printStackTrace();\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\telse\tif(c.equals(\"中转中心接收单\")) {\n\t\t\t\t\tRecivalListBL rl=new RecivalListBL();\n\t\t\t\t\ttry {\n\t\t\t\t\t\tnew InvoiceUI_RecivalListEdit(rl.inquiry(s),false);\n\t\t\t\t\t} catch (IOException e1) {\n\t\t\t\t\t\t// TODO Auto-generated catch block\n\t\t\t\t\t\te1.printStackTrace();\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\telse\tif(c.equals(\"快递员派件单\")) {\n\t\t\t\t\tSendingListBL sl=new SendingListBL();\n\t\t\t\t\ttry {\n\t\t\t\t\t\tnew InvoiceUI_SendingListEdit(sl.inquiry(s),false);\n\t\t\t\t\t} catch (IOException e1) {\n\t\t\t\t\t\t// TODO Auto-generated catch block\n\t\t\t\t\t\te1.printStackTrace();\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\telse{\n\t\t\t\t\tTransferListBL tl=new TransferListBL();\n\t\t\t\t\ttry {\n\t\t\t\t\t\tnew InvoiceUI_TransferListEdit(tl.inquiry(s),false);\n\t\t\t\t\t} catch (IOException e1) {\n\t\t\t\t\t\t// TODO Auto-generated catch block\n\t\t\t\t\t\te1.printStackTrace();\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\t}\t\t\t\n\t\t\t\t\t}\n\t\t\t}\t\n\t\t}", "@Override\n\t\t\tpublic void mouseClicked(MouseEvent arg0) {\n\t\t\t\tint row = table.getSelectedRow();\n\t\t\t\tint col = table.getSelectedColumn();\n\t\t\t\tString masv = (String) table.getValueAt(row, 0);\n\t\t\t\tString hoten = (String) table.getValueAt(row, 1);\n\t\t\t\tString ngaysinh = (String) table.getValueAt(row, 2);\n\t\t\t\tString gioitinh = (String) table.getValueAt(row, 3);\n\t\t\t\tString diachi = (String) table.getValueAt(row, 4);\n\t\t\t\tString malop = (String) table.getValueAt(row, 5);\n\t\t\t\ttxt_masv.setText(masv);\n\t\t\t\ttxt_hoten.setText(hoten);\n\t\t\t\ttxt_ngaysinh.setText(ngaysinh);\n\t\t\t\ttxt_gioitinh.setText(gioitinh);\n\t\t\t\ttxt_diachi.setText(diachi);\n\t\t\t\ttxt_malop.setText(malop);\n\t\t\t}", "private void tblaktivitasMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_tblaktivitasMouseClicked\n //txttanggal.setText(tblaktivitas.getValueAt(tblaktivitas.getSelectedRow(),0).toString());\n txtgrup.setSelectedItem(tblaktivitas.getValueAt(tblaktivitas.getSelectedRow(),0).toString());\n txtcompart.setSelectedItem(tblaktivitas.getValueAt(tblaktivitas.getSelectedRow(),1).toString());\n txtaktivitas.setText(tblaktivitas.getValueAt(tblaktivitas.getSelectedRow(),2).toString());\n txtha.setText(tblaktivitas.getValueAt(tblaktivitas.getSelectedRow(),3).toString());\n txtharga.setText(tblaktivitas.getValueAt(tblaktivitas.getSelectedRow(),4).toString());\n }", "private void remindersTableMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_remindersTableMouseClicked\n // define date format for String conversion\n DateFormat df = new SimpleDateFormat(\"MMM dd, yyyy\");\n // pull current table model\n DefaultTableModel model = (DefaultTableModel) remindersTable.getModel();\n\n // get boolean value of radio button group (bill/income) & set matching value in form\n if ((model.getValueAt(remindersTable.getSelectedRow(), 0).equals(true))\n || (model.getValueAt(remindersTable.getSelectedRow(), 0).equals(\"true\"))) {\n income_Rad.setSelected(true);\n } else {\n bill_Rad.setSelected(true);\n }\n try {\n // Update dueDate jDateChooser with populated table data\n dueDate_date.setDate(df.parse((String) model.getValueAt(remindersTable.getSelectedRow(), 1)));\n } catch (ParseException ex) {\n Logger.getLogger(MoneyMinderDesktopMainGui.class.getName()).log(Level.SEVERE, null, ex);\n }\n // Update title jtextField with populated table data\n ToFrom_Txt.setText(model.getValueAt(remindersTable.getSelectedRow(), 2).toString());\n // Update amount jtextField with populated table data\n Amount_Txt.setText(model.getValueAt(remindersTable.getSelectedRow(), 3).toString().replace(\"-\", \"\"));\n // Update category jComboBox with populated table data\n category_comb.setSelectedItem(model.getValueAt(remindersTable.getSelectedRow(), 4).toString());\n // Update frequency jComboBox with populated table data\n frequency_comb.setSelectedItem(model.getValueAt(remindersTable.getSelectedRow(), 5).toString());\n // Update endBy jDateChooser with populated table data\n try {\n endBy_date.setDate(df.parse((String) model.getValueAt(remindersTable.getSelectedRow(), 6)));\n } catch (ParseException ex) {\n Logger.getLogger(MoneyMinderDesktopMainGui.class.getName()).log(Level.SEVERE, null, ex);\n }\n }", "@Override\n public void actionPerformed(ActionEvent e) {\n try{\n if(e.getActionCommand().equalsIgnoreCase(\"comboDepartmentName\")){\n Object[][] departmentdata= issueReturnModel.getRespectiveDepartment(mainview.getUserId());\n JComboBox dep = (JComboBox)e.getSource();\n if(dep.getSelectedItem().equals(\"SELECT\")){\n issueReturnView.setDepartmentId(0);\n issueReturnView.refreshJTable(new DefaultTableModel());\n \n }\n else{\n for(Object[] dat:departmentdata){\n if(dat[1].equals(dep.getSelectedItem())){\n issueReturnView.setDepartmentId(Integer.parseInt(dat[0].toString()));\n //loading the repective item according to department \n issueReturnView.refreshJTable(issueReturnModel.getResturantItemList(issueReturnView.getDepartmentId()));\n break;\n \n }\n }\n }\n }\n }\n catch(Exception se){\n JOptionPane.showMessageDialog(issueReturnView, se+\"from ComboListener\"+getClass().getName());\n }\n }", "public void action_call(ActionEvent actionEvent) {\n ViewObject searchVO=am.getPOCHeaderView1();\n ViewObject pocvo=am.getpocSearchVo1();\n String poc_id=null;\n int Buyer=0;\n int org=0;\n String orgname=null;\n try{\n poc_id=pocvo.getCurrentRow().getAttribute(\"PocId\").toString();\n }\n catch(Exception e) {\n poc_id=null;\n }\n \n int pram=1;\n am.getDBTransaction().commit();\n /***ViewObject oder=am.getOrderRecapSummary1();\n ViewObject oder=am.getorder_recap_new_view1();\n oder.setNamedWhereClauseParam(\"param\",pram);\n oder.setWhereClause(\"SEASON = '\"+season+\"' AND BUYER_ID = '\"+Buyer+\"' AND ORG_ID= '\"+org+\"'\");\n **/\n \n \n searchVO.setNamedWhereClauseParam(\"param\",pram);\n searchVO.setWhereClause(\"POC_ID = '\"+poc_id+\"'\");\n \n \n \n searchVO.executeQuery();\n \n \n AdfFacesContext.getCurrentInstance().addPartialTarget(pocTable); \n \n \n \n \n \n }", "public void valueChanged(ListSelectionEvent event) {\n try{\n System.out.println(jTable1.getValueAt(jTable1.getSelectedRow(), 1).toString());\n formArtist = (Artist) jTable1.getValueAt(jTable1.getSelectedRow(), 1);\n \n updateData();\n }\n catch(Exception e){\n \n }\n }", "public MantendorContrato() {\n initComponents();\n this.jTableContratos.setModel(this.showData());\n \n lblClienteid.setVisible(false);\n lblContratoId.setVisible(false);\n ClienteService cs = new ClienteService();\n \n String array = cs.getCliente(); \n JSONObject obj = new JSONObject(array); \n Usuario u = new Usuario();\n JSONArray data = obj.getJSONArray(\"data\"); \n for (int i = 0; i < data.length(); i++) {\n JSONObject row = data.getJSONObject(i);\n cmbClienteContrato.addItem(\n new ClienteCombobox(row.getInt(\"cliente_id\"), row.getString(\"cliente_nombre\"))\n );\n }\n \n this.jTableContratos.getSelectionModel().addListSelectionListener(new ListSelectionListener(){\n public void valueChanged(ListSelectionEvent event) {\n // do some actions here, for example\n // print first column value from selected row\n String contratoId = jTableContratos.getValueAt(jTableContratos.getSelectedRow(), 0).toString(); \n String clienteId = jTableContratos.getValueAt(jTableContratos.getSelectedRow(), 6).toString(); \n String activo = jTableContratos.getValueAt(jTableContratos.getSelectedRow(), 8).toString(); \n \n \n if(activo.equalsIgnoreCase(\"1\")){\n radioActivoEdit.setSelected(true);\n }else if(activo.equalsIgnoreCase(\"0\")){\n radioInactivoEdit.setSelected(true);\n }\n \n lblClienteid.setText(clienteId);\n lblContratoId.setText(contratoId);\n \n }\n }); \n }", "public MainUI() {\n initComponents();\n \n donationsTbl.setModel(model);\n \n donationsTbl.addMouseListener(new java.awt.event.MouseAdapter() {\n @Override\n public void mouseClicked(java.awt.event.MouseEvent evt) {\n int row = donationsTbl.rowAtPoint(evt.getPoint());\n if (row >= 0) {\n selectedRow = row; //preserving the selected row\n //System.out.println(\"*** clicked row: \" + row);\n donationTitleFld.setText(model.getValueAt(row, 0).toString());\n donationTypeFld.setSelectedItem(model.getValueAt(row, 1).toString());\n donationValueFld.setSelectedItem(model.getValueAt(row, 2).toString());\n }\n }\n });\n }", "public void onTableClicked(){\n\t\tint row = table.getSelectedRow();\n//\t\tthis.messageBox(row+\"\");\n\t\tTParm parm = table.getParmValue();\n\t\tadmDate = parm.getValue(\"ADM_DATE\", row);\n\t\tdeptCode = parm.getValue(\"DEPT_CODE\", row);\n\t\tdeCode = parm.getValue(\"DR_CODE\", row);\n\t\tclinictypeCode = parm.getValue(\"CLINICTYPE_CODE\", row);\n\t\ttime = parm.getValue(\"START_TIME\", row);\n\t\tcrmId = parm.getValue(\"CRM_ID\", row);\n//\t\tSystem.out.println(\"time==\"+time);\n\t\t\n\t}", "@Override\r\n\t\t\tpublic void handle(CellEditEvent<Products, String> arg0) {\n\t\t\t\targ0.getTableView().getItems().get(arg0.getTablePosition().getRow()).setCost(arg0.getNewValue());\r\n\t\t\t\tProducts data=(Products) tbl_view.getSelectionModel().getSelectedItem();\r\n\t\t\t\tSystem.out.println(data.toString());\r\n\t\t\t\tConnectionManager.queryInsert(conn, \"UPDATE dbo.product SET cost='\"+data.getCost()+\"' WHERE id=\"+data.getId());\r\n\t\t\t\ttxt_cost.clear();\r\n\t\t\t\ttxt_date.clear();\r\n\t\t\t\ttxt_name.clear();\r\n\t\t\t\ttxt_price.clear();\r\n\t\t\t\ttxt_qty.clear();\r\n\t\t\t\ttxt_reorder.clear();\r\n\t\t\t\ttxt_search.clear();\r\n\t\t\t\tfetchData(FETCH_DATA);\r\n\t\t\t}", "@Override\n public void handle(MouseEvent event) {\n int i = tabela.getSelectionModel().getSelectedIndex();\n key = String.valueOf(colunaId.getCellData(i));\n txtNome.setText(colunaNome.getCellData(i));\n txtLogin.setText(colunaLogin.getCellData(i));\n txtSenha.setText(colunaSenha.getCellData(i));\n }", "public formArticulo() {\r\n initComponents();\r\n this.tableModel = (javax.swing.table.DefaultTableModel)tblArt.getModel();\r\n }", "private void tbLinhaSelecionada(JTable tb) {\n if (tb.getSelectedRow() != -1) {\n cidadeBean.setId(lista.get(tbCidades.getSelectedRow()).getId());\n tfCidade.setText(lista.get(tbCidades.getSelectedRow()).getCidade());\n cbUf.setSelectedItem(lista.get(tbCidades.getSelectedRow()).getUf());\n btEditar.setEnabled(true);\n btExcluir.setEnabled(true);\n operacao = 2;\n } else {\n limparCampos();\n editarCampos(false);\n reiniciaBotoes();\n }\n }", "@Override\n public void mouseClicked(MouseEvent e) {\n int fila_point = jTable_clientes.rowAtPoint(e.getPoint());\n //punto exacto de la fila donde este precionando\n\n //evento para las columnas\n int columna_point = 0;//solo porqwue queremos obtener el id de cada cliente paara la consulta en la BD\n\n //indicaciones al programa de cuando ya se tengas los dos valores osea que si el usuario dio click en las columns que tiene datos entonces\n if (fila_point > -1) {\n IDcliente_update = (int) model.getValueAt(fila_point, columna_point);\n\n //conexion entre faces cuando se toque algun dato en la tabla\n InformacionCliente informacion_cliente = new InformacionCliente();\n informacion_cliente.setVisible(true);\n \n \n }\n }", "public tiendaJF() {\n initComponents();\n \n boolean conectado = tiendaBo.conectar();\n ResultSet rs = tiendaBo.listar();\n if(!conectado)///Mensaje de error\n JOptionPane.showMessageDialog(null, \"Falló conexion a BD\");\n \n jTableProductos.addMouseListener(new MouseAdapter() {\n public void mousePressed(MouseEvent Mouse_evt){\n JTable jTableProductos = (JTable) Mouse_evt.getSource();\n Point point = Mouse_evt.getPoint();\n int row = jTableProductos.rowAtPoint(point);\n if (Mouse_evt.getClickCount()==1){\n campo1.setText(jTableProductos.getValueAt(jTableProductos.getSelectedRow(), 8).toString());\n }\n }\n });\n }", "@Override\n\t\t\tpublic void mouseClicked(MouseEvent e) {\n\t\t\t\tint row = table1.getSelectedRow();\n\t\t\t\tint col = table1.getSelectedColumn();\n\t\t\t\tString magv = (String) table1.getValueAt(row, 0);\n\t\t\t\tString tengv = (String) table1.getValueAt(row, 1);\n\t\t\t\tString gioitinh = (String) table1.getValueAt(row, 2);\n\t\t\t\tString phone = (String) table1.getValueAt(row, 3);\n\t\t\t\tString email = (String) table1.getValueAt(row, 4);\n\t\t\t\tString phanloaigv = (String) table1.getValueAt(row, 5);\n\t\t\t\ttxt_magv.setText(magv);\n\t\t\t\ttxt_tengv.setText(tengv);\n\t\t\t\ttxt_gioitinhgv.setText(gioitinh);\n\t\t\t\ttxt_phone.setText(phone);\n\t\t\t\ttxt_email.setText(email);\n\n\t\t\t\ttxt_phanloaigv.setText(phanloaigv);\n\n\t\t\t}", "public abstract void addSelectorForm();", "@Override\r\n\t\t\tpublic void handle(CellEditEvent<Products, String> arg0) {\n\t\t\t\targ0.getTableView().getItems().get(arg0.getTablePosition().getRow()).setPrice(arg0.getNewValue());\r\n\t\t\t\tProducts data=(Products) tbl_view.getSelectionModel().getSelectedItem();\r\n\t\t\t\tSystem.out.println(data.toString());\r\n\t\t\t\tConnectionManager.queryInsert(conn, \"UPDATE dbo.product SET price='\"+data.getPrice()+\"' WHERE id=\"+data.getId());\r\n\t\t\t\ttxt_cost.clear();\r\n\t\t\t\ttxt_date.clear();\r\n\t\t\t\ttxt_name.clear();\r\n\t\t\t\ttxt_price.clear();\r\n\t\t\t\ttxt_qty.clear();\r\n\t\t\t\ttxt_reorder.clear();\r\n\t\t\t\ttxt_search.clear();\r\n\t\t\t\tfetchData(FETCH_DATA);\r\n\t\t\t}", "private void selectTableRow () {\n int selectedRow = itemTable.getSelectedRow();\n if (selectedRow >= 0 && selectedRow < clubEventList.size()) {\n boolean modOK = modIfChanged();\n if (modOK) {\n position = clubEventList.positionUsingListIndex (selectedRow);\n positionAndDisplay();\n }\n }\n }", "public void updateUserSelTable() {\n\t\n\t\tUserSelDietTable.getSelectionModel().removeListSelectionListener(lsl_userT);\n\t\tdtm = new DefaultTableModel();\n\t\tudI=new UserDietDAOImpl();\n\t\tdtm.addColumn(\"Id\");\t\t\n\t\tdtm.addColumn(\"Diet Id\");\n\t\tdtm.addColumn(\"Meal Type\");\n\t\tdtm.addColumn(\"Food Name\");\n\t\tdtm.addColumn(\"Calories (g)\");\n\t\tdtm.addColumn(\"Date\");\n\t\tdtm.addColumn(\"Author\");\n\t\tArrayList<UserDiet> dietList=new ArrayList<UserDiet>();\n\t\tif(currentUEmail.length>0)\n\t\t{\n\t\t\tString currDate=(String) comboBoxDate.getSelectedItem();\t\t\t\n\t\t\tSystem.out.println(currDate+\" item count \"+comboBoxDate.getItemCount());\n\t\tdietList =udI.getUserDietList(currentUEmail[0],currDate);\n\t\t}\n\t\tfor (UserDiet ud : dietList) {\t\n\t\t\tdtm.addRow(ud.getVector());\n\t\t}\n\t\tUserSelDietTable.setModel(dtm);\n\n\t\tUserSelDietTable.getSelectionModel().addListSelectionListener(lsl_userT);\n\n\n\t}", "@Override\n\tpublic void mouseClicked(MouseEvent arg0) {\n\t\tint rowSelected = table1.getSelectedRow();\n\n\t\ttxtMa.setText((String) table1.getValueAt(rowSelected, 0));\n\t\ttxtTen.setText((String) table1.getValueAt(rowSelected, 1));\n\t\ttxtTuoi.setText((String) table1.getValueAt(rowSelected, 2));\n\t\ttxtSdt.setText((String) table1.getValueAt(rowSelected, 3));\n\t\ttxtDiaChi.setText((String) table1.getValueAt(rowSelected, 4));\n\t\ttxtEmail.setText((String) table1.getValueAt(rowSelected, 5));\n\t}", "private void setTable(int row)\n {\n table.setValueAt(idText.getText(), row, 0);\n table.setValueAt(nameText.getText(), row, 1);\n }", "@Override\n\tpublic void selectionChanged(ActionEvent e) {\n\t\tif (dm != null && dm.getRowSelected() >= 0) {\n\t\t\trowList.removeListSelectionListener(rowSelectListener); \n\t\t\t// disable listener temporarily to prevent looping.\n\t\t\t\n\t\t\tint row = dm.getRowSelected();\n\t\t\tint column = dm.getColSelected();\n\t\t\trowElements.get(column).requestFocus();\n\t\t\tfor (int i = 0; i < rowElements.size(); i++) {\n\t\t\t\tString value = dm.getValue(i, row);\n\t\t\t\trowElements.get(i).setText(value);\n\t\t\t}\n\t\t\trowList.setSelectedIndex(row);\n\t\t\trowList.addListSelectionListener(rowSelectListener);\n\t\t}\n\t}", "private void tblSachMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_tblSachMouseClicked\n int row = tblSach.getSelectedRow();\n txbMaSach.setText(tblSach.getValueAt(row, 0).toString());\n txbTenSach.setText(tblSach.getValueAt(row, 1).toString());\n cbTheLoai.setSelectedItem(tblSach.getValueAt(row, 2));\n tbxTacGia.setText(tblSach.getValueAt(row, 3).toString());\n txbSoLuong.setText(tblSach.getValueAt(row, 5).toString());\n txbGia.setText(tblSach.getValueAt(row, 4).toString());\n cbxNXB.setSelectedItem(tblSach.getValueAt(row, 6));\n controlTxb(false);\n }", "@Override\n public void actionPerformed(ActionEvent e) {\n tableModel.addRow(new Object[] { idf.getText(), lnamef.getText(), fnamef.getText(), vtypef.getText(),\n vdatef.getText(), vlocationf.getText() });\n idf.setText(\"\");\n lnamef.setText(\"\");\n fnamef.setText(\"\");\n vtypef.setText(\"\");\n vdatef.setText(\"\");\n vlocationf.setText(\"\");\n\n p.remove(layout.getLayoutComponent(BorderLayout.CENTER));\n p.add(sp, BorderLayout.CENTER);\n p.repaint();\n p.revalidate();\n }", "@Override\n public void actionPerformed(ActionEvent e) {\n int selection = statsTable.getSelectedRow();\n if (selection != -1) {\n int modelIndex = statsTable.getRowSorter().convertRowIndexToModel(selection);\n String set = (String) statsTable.getModel().getValueAt(modelIndex, 0);\n int index = map.getSettlement(set);\n String number = JOptionPane.showInputDialog(\"Please enter number of Dose Vaccine to add :\");\n map.getSettlements()[index].setNumberVaccineDose(Integer.parseInt(number));\n }\n else\n JOptionPane.showMessageDialog(new JFrame(), \"Select a row!\", \"Statistics Error\",\n JOptionPane.ERROR_MESSAGE);\n }", "public View(String frmWel) {\n super(\"View Data\");\n initComponents();\n con=javaconnect.ConnecrDb();\n nameField.setText(frmWel);\n updateTable();\n \n }", "@Override\n public void onRowDblClick(GridPanel grid, int rowIndex, EventObject e) {\n Record[] records = cbSelectionModel.getSelections();\n\n\n selecionado = records[0].getAsString(\"idmarca\");\n String enlTemp = \"funcion=reportemarcaHTML&idmarca=\" + selecionado;\n verReporte(enlTemp);\n// \n }", "private void fillExistingCustomer() {\n idField.setText(String.valueOf(existingCustomer.getCustomerID()));\n nameField.setText(existingCustomer.getCustomerName());\n String[] splitAddress = existingCustomer.getAddress().split(\", \");\n addressField.setText(splitAddress[0]);\n if ( splitAddress.length > 1 ) {\n cityField.setText(splitAddress[1]);\n }\n postalField.setText(existingCustomer.getPostalCode());\n phoneField.setText(existingCustomer.getPhone());\n\n FirstLevelDivision division = getDivisionByID(existingCustomer.getDivisionID());\n divisionComboBox.getSelectionModel().select(division);\n countryComboBox.getSelectionModel().select(getCountryByID(division.getCountryID()));\n }", "@Override\n\t\t\tpublic void actionPerformed(ActionEvent arg0) {\n\t\t\t\tMyButtonEditor.this.fireEditingCanceled(); \n\t\t\t\t//查看详情\n\t\t\t\t\n\t\t\t\tif(mdtjf!=null){\n\t\t\t\t\tmdtjf.dispose();\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t\tMyTableModel model = (MyTableModel) jtb.getModel();\n\t\t\t\t\t\n\t\t\t\t\tVector<List<String>> data = model.getTableData();\n\t\t\t\t\t\n\t\t\t\t\tVector<List<String>> newData = new Vector<List<String>>();\n\t\t\t\t\t\n\t\t\t\t\tList<String> list = data.get(jtb.getSelectedRow());\n\t\t\t\t\t\n\t\t\t\t\tString name = list.get(0).split(\"×\")[0];\n\t\t\t\t\t\n\t\t\t\t\tList<String> newList = new ArrayList<String>();\n\t\t\t\t\t\n\t\t\t\t\t//添加菜名\n\t\t\t\t\tnewList.add(name);\n\t\t\t\t\t//添加份数为1份,即查看每份所需材料,Order中已对数据进行处理,故无需管后面几项\n\t\t\t\t\t//Order中处理只根据菜名和份数,即可算出所需的所有东西\n\t\t\t\t\t//这里直接添加菜名+份数1份,利用order可查看1份菜品所需的材料\n\t\t\t\t\tnewList.add(\"1\");\n\t\t\t\t\t\n\t\t\t\t\tnewData.add(newList);\n\t\t\t\t\t\n\t\t\t\t\tMyTableModel newModel = new MyTableModel(jf);\n\t\t\t\t\tnewModel.setTableData(newData);\n\t\t\t\t\t\n\t\t\t\t\tOrder order = new Order(jf, newModel, ALL_DISHES);\n\t\t\t\t\t\n\t\t\t\t\tmdtjf = new MyDetailTableJF(order);\n\t\t\t\t\tmdtjf.setVisible(true);\n\t\t\t\t\t\n\t\t\t}", "AbiFormsForm selectByPrimaryKey(Integer idField);", "@Override\n\t\t\tpublic void actionPerformed(ActionEvent e) {\n\t\t\t\tSystem.out.println(\"addActionListener\");\n\t\t\t\tDatabase db = new Database();\n\t\t\t\tSuppliersDAO suppDAO = new SuppliersDAO(db);\n\t\t\t\tSuppliersModel suppModel = new SuppliersModel();\n\n\t\t\t\tString suppName = textSuppName.getText();\n\t\t\t\tString suppAddr = textSuppAddr.getText();\n\t\t\t\tString suppPhone = textSuppPhone.getText();\n\t\t\t\tString suppEmail = textSuppEmail.getText();\n\n\t\t\t\tsuppModel.setName(suppName);\n\t\t\t\tsuppModel.setAddress(suppAddr);\n\t\t\t\tsuppModel.setPhone(suppPhone);\n\t\t\t\tsuppModel.setEmail(suppEmail);\n\n\t\t\t\tint return_id = suppDAO.Add(suppModel);\n\t\t\t\tdb.commit();\n\t\t\t\tdb.close();\n\n\t\t\t\tdb = new Database();\n\n\t\t\t\tsuppDAO = new SuppliersDAO(db);\n\t\t\t\tSystem.out.println(\"addActionListener 1\");\n\t\t\t\tsuppModel = suppDAO.FindByID(return_id);\n\t\t\t\tSystem.out.println(\"addActionListener 2\");\n\t\t\t\tdb.close();\n\n\t\t\t\trow[0] = suppModel.getSuppliers_id();\n\t\t\t\trow[1] = suppModel.getName();\n\t\t\t\trow[2] = suppModel.getAddress();\n\t\t\t\trow[3] = suppModel.getPhone();\n\t\t\t\trow[4] = suppModel.getEmail();\n\t\t\t\trow[5] = suppModel.getTime_reg();\n\n\t\t\t\tmodel.addRow(row);\n\t\t\t}", "@Override\n\t\t\tpublic void actionPerformed(ActionEvent e) {\n\t\t\t\teditRow();\n\t\t\t}", "@Override\n\t\t\tpublic void actionPerformed(ActionEvent e) {\n\t\t\t\teditRow();\n\t\t\t}", "protected abstract void onAddRow(AjaxRequestTarget target, Form<?> form);", "@Override\n\tpublic void mouseClicked(MouseEvent e) {\n\t\tint row=table.getSelectedRow();\n\t\ttry {\n\t\t\ttxtmakhhm.setText(table.getValueAt(row, 0).toString());\n\t\t\t\n\t\t\tjava.util.Date date=new SimpleDateFormat(\"yyyy-MM-dd\").parse((String) table.getValueAt(row, 5).toString());\n\t\t\tjdcNgaytra.setDate(date);\n\t\t\t\n\t\t\ttxtTinhtrang.setText(table.getValueAt(row, 6).toString());\n\t\t\tif(txtTinhtrang.getText().equalsIgnoreCase(\"\"))\n\t\t\t\ttxtTinhtrang.setText(\"\");\n\t\t\t\n\t\t\ttxtGhichu.setText(table.getValueAt(row, 7).toString());\n\t\t\tif(txtGhichu.getText().equalsIgnoreCase(\"\"))\n\t\t\t\ttxtGhichu.setText(\"\");\n\t\t\t\n\t\t} catch (Exception e2) {\n\t\t\t// TODO: handle exception\n\t\t}\n\t\t\n\t\t\n\t\t\n\t}", "private void teaTableMousePressedAction(MouseEvent evt) {\n //throw new UnsupportedOperationException(\"Not supported yet.\"); //To change body of generated methods, choose Tools | Templates.\n int row = teaTable.getSelectedRow();\n this.teaIDText.setText((String)teaTable.getValueAt(row, 0));\n this.teaNameText.setText((String)teaTable.getValueAt(row, 1));\n this.teaCollegeText.setText((String)teaTable.getValueAt(row, 3));\n this.teaDepartmentText.setText((String)teaTable.getValueAt(row, 4));\n this.teaTypeText.setText((String)teaTable.getValueAt(row, 5));\n this.teaPhoneText.setText((String)teaTable.getValueAt(row, 6));\n this.teaRemarkText.setText((String)teaTable.getValueAt(row, 7));\n }", "@Override\n public void actionPerformed(ActionEvent e) {\n int row = table.convertRowIndexToModel( table.getEditingRow() );\n }", "public void actionPerformed(ActionEvent e) {\n setTitle(\"Читатели\");\n ResultSet rs = DBConnection.executeQuery(\"select * from readers\");\n model = new ResultSetTableModel(rs);\n model.setColumnNameLabel(\"Фамилия Имя Отчество\", 1);\n model.setColumnNameLabel(\"Паспорт\", 2);\n model.setColumnNameLabel(\"Дата рождения\", 3);\n model.setColumnNameLabel(\"Телефон\", 4);\n model.setColumnNameLabel(\"Образование\", 5);\n model.setColumnNameLabel(\"Учёная степень\", 6);\n model.setColumnNameLabel(\"Зал\", 7);\n jTable3.setModel(model);\n \n\n ResultSet rs2 = DBConnection.executeQuery(\"select id,name from rooms\");\n jTable3.getColumnModel().getColumn(7).setCellEditor(MyJComboCell.generate(rs2,\"id\",\"name\"));\n jTable3.getColumnModel().getColumn(7).setCellRenderer(new MyCellRenderer(rs2,\"id\",\"name\"));\n }", "private void btn_cadActionPerformed(java.awt.event.ActionEvent evt) {\n \n CDs_dao c = new CDs_dao();\n TabelaCDsBean p = new TabelaCDsBean();\n \n TabelaGeneroBean ge = (TabelaGeneroBean) g_box.getSelectedItem();\n TabelaArtistaBean au = (TabelaArtistaBean) g_box2.getSelectedItem();\n\n //p.setId(Integer.parseInt(id_txt.getText()));\n p.setTitulo(nm_txt.getText());\n p.setPreco(Double.parseDouble(vr_txt.getText()));\n p.setGenero(ge);\n p.setArtista(au);\n c.create(p);\n\n nm_txt.setText(\"\");\n //isqn_txt.setText(\"\");\n vr_txt.setText(\"\");\n cd_txt.setText(\"\");\n g_box.setSelectedIndex(0);\n g_box2.setSelectedIndex(0);\n \n }", "private void submitActionPerformed(java.awt.event.ActionEvent evt) {\n try {\n\n Class.forName(\"oracle.jdbc.driver.OracleDriver\");\n Connection connection = DriverManager.getConnection(\"jdbc:oracle:thin:@localhost:1521:orcl\", \"batman\", \"54928\");\n String query = \"insert into COMPANY_DETAILS(COMPANY_NAME,COMPANY_ID)VALUES(?,?)\";\n PreparedStatement pst;\n pst = connection.prepareStatement(query);\n pst.setString(1, compname.getText());\n pst.setString(2, compid.getText());\n \n \n pst.executeUpdate();\n JOptionPane.showMessageDialog(null, \"inserted successfully\");\n\n } catch (Exception e) {\n JOptionPane.showMessageDialog(null, e);\n\n } // TODO add your h\n showTableData();\n \n }", "int insertSelective(AbiFormsForm record);" ]
[ "0.7247318", "0.65746385", "0.64743716", "0.64085245", "0.6406176", "0.6371497", "0.6370284", "0.63110644", "0.6310701", "0.6298929", "0.62855524", "0.6250644", "0.62362814", "0.6162334", "0.6159715", "0.6157286", "0.61442995", "0.61153996", "0.60926914", "0.6088303", "0.60750395", "0.60594803", "0.60575384", "0.6057105", "0.6056601", "0.6032425", "0.60301435", "0.601478", "0.60093147", "0.5991751", "0.5979697", "0.59782326", "0.5964231", "0.59599876", "0.59357977", "0.59143335", "0.58967346", "0.58865464", "0.5884732", "0.5882686", "0.5858428", "0.5846663", "0.5840584", "0.58236766", "0.5817301", "0.5811301", "0.5794642", "0.5794245", "0.5792412", "0.57819", "0.57707924", "0.5769128", "0.57644147", "0.5757801", "0.5735271", "0.5733853", "0.5726603", "0.57167524", "0.5711842", "0.5700367", "0.56936866", "0.5685606", "0.56816643", "0.56794757", "0.5677936", "0.5675365", "0.5673934", "0.567297", "0.5668506", "0.56607723", "0.5658452", "0.5656623", "0.5655447", "0.56473374", "0.5645508", "0.56420004", "0.5639193", "0.56370884", "0.56329876", "0.5625845", "0.5624748", "0.5621315", "0.56202763", "0.5617541", "0.56153595", "0.5603794", "0.56036115", "0.5603039", "0.5595978", "0.5593549", "0.5585855", "0.5582999", "0.5582999", "0.55790704", "0.5566839", "0.5566107", "0.55658257", "0.55643165", "0.55623895", "0.555775", "0.5557321" ]
0.0
-1
update the product dispatch Entry
public void updateDispatch() { try { DispatchVO dispatchVO = new DispatchVO(); dispatchVO.setBillingName(billingName.getText()); dispatchVO.setCompanyName(companyName.getText()); dispatchVO.setDispatchDate(((TextField)calendar2.getChildren().get(0)).getText()); dispatchVO.setInvoiceDate(((TextField)calendar.getChildren().get(0)).getText()); dispatchVO.setFreightAmount(Double.parseDouble(FreightAmount.getText())); dispatchVO.setNoOfItems(Integer.parseInt(numberOfItems.getText())); dispatchVO.setFreightMode(Freightmode.getText()); dispatchVO.setInvoiceNo(invoiceNo.getText()); dispatchVO.setShippingTo(shippingTo.getText()); dispatchVO.setTrackingNo(trackingNo.getText()); dispatchVO.setTransporter(transporter.getText()); dispatchVO.setId(ProductDispatchModifyController.this.dispatchVO.getId()); dispatchDAO.updateDispatch(dispatchVO); message.setText(CommonConstants.DISPATCH_UPDATE); message.getStyleClass().remove("failure"); message.getStyleClass().add("success"); message.setVisible(true); } catch (Exception e) { e.printStackTrace(); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void update(Product product) {\n\n\t}", "@Override\n\tpublic void update(ExportProduct exportProduct) {\n\t\t\n\t}", "@Override\n public void updateProductCounter() {\n\n }", "public UpdateProduct() {\n\t\tsuper();\t\t\n\t}", "Product updateProductInStore(Product product);", "@Override\n public void updateProduct(TradingQuote tradingQuote) {\n }", "@Override\r\n\tpublic int updateProduct(Product product) {\n\t\treturn 0;\r\n\t}", "public void updateProduct() throws ApplicationException {\n Session session = HibernateUtil.getSessionFactory().getCurrentSession();\n\n try {\n session.beginTransaction();\n Menu updateProduct = (Menu) session.get(Menu.class, menuFxObjectPropertyEdit.getValue().getIdProduct());\n\n updateProduct.setName(menuFxObjectPropertyEdit.getValue().getName());\n updateProduct.setPrice(menuFxObjectPropertyEdit.getValue().getPrice());\n\n session.update(updateProduct);\n session.getTransaction().commit();\n } catch (RuntimeException e) {\n session.getTransaction().rollback();\n SQLException sqlException = getCauseOfClass(e, SQLException.class);\n throw new ApplicationException(sqlException.getMessage());\n }\n\n initMenuList();\n }", "@Override\n\tpublic void updateProduct(ProductVO vo) {\n\n\t}", "public void updateProductViewCount(Product product) {\n\r\n\t}", "public boolean update(Product product);", "void setUpdatedProduct(ObservableList<MotorCycleProduct> productSelected, String updatedPartNumber, String updatedName, Integer updatedQuantity, Double updatedPrice, String updatedCategory, String updatedDate);", "void update(Product product) throws IllegalArgumentException;", "private void updateSoldProductInfo() { public static final String COL_SOLD_PRODUCT_CODE = \"sells_code\";\n// public static final String COL_SOLD_PRODUCT_SELL_ID = \"sells_id\";\n// public static final String COL_SOLD_PRODUCT_PRODUCT_ID = \"sells_product_id\";\n// public static final String COL_SOLD_PRODUCT_PRICE = \"product_price\";\n// public static final String COL_SOLD_PRODUCT_QUANTITY = \"quantity\";\n// public static final String COL_SOLD_PRODUCT_TOTAL_PRICE = \"total_price\";\n// public static final String COL_SOLD_PRODUCT_PENDING_STATUS = \"pending_status\";\n//\n\n for (ProductListModel product : products){\n soldProductInfo.storeSoldProductInfo(new SoldProductModel(\n printInfo.getInvoiceTv(),\n printInfo.getInvoiceTv(),\n product.getpCode(),\n product.getpPrice(),\n product.getpSelectQuantity(),\n printInfo.getTotalAmountTv(),\n paymentStatus+\"\"\n ));\n\n }\n }", "@Override\n\tpublic boolean update(ProductCategory procate) {\n\t\treturn false;\n\t}", "@Override\r\n\tpublic Product updateProduct(Product s) {\n\t\treturn null;\r\n\t}", "public void update(Product prod) {\n\t\tentities.put(prod.getName(), prod);\n\t\tif (prod.quantity==0) {\n\t\t\tavailableProducts.remove(prod.getName());\n\t\t}\n\t}", "@Override\n\tpublic Product update(Product entity) {\n\t\treturn null;\n\t}", "void updateOfProductById(long id);", "@Override\r\n\tpublic void ManageProduct() {\n\t\tint id = this.view.enterId();\r\n\t\tString name = this.view.enterName();\r\n\t\tfloat price = this.view.enterPrice();\r\n\t\tint quantity = this.view.enterQuantity();\r\n\t\t\r\n\t\tthis.model.updProduct(id, name, price, quantity);\r\n\t}", "public void updateProduct(Product catalog) throws BackendException;", "private void updateContent() {\n if (product != null) {\n etProductName.setText(product.getName());\n etPrice.setText(product.getPrice().toString());\n }\n }", "public boolean update(Product p){\n ContentValues contvalu= new ContentValues();\n //contvalu.put(\"date_created\", \"datetime('now')\");\n contvalu.put(\"name\",p.getName());\n contvalu.put(\"feature\",p.getFeature());\n contvalu.put(\"price\",p.getPrice());\n return (cx.update(\"Product\",contvalu,\"id=\"+p.getId(),null))>0;\n//-/-update2-////\n\n\n }", "@Override\n\tpublic int update(ProductDTO dto) {\n\t\treturn 0;\n\t}", "public static void updateProduct(Product productUpdate){\r\n for(int i: productInvMap.keySet()){\r\n Product p = productInvMap.get(i);\r\n if(p.getProductID() == productUpdate.getProductID()){\r\n productInvMap.put(i,productUpdate);\r\n }\r\n }\r\n \r\n }", "@Override\n public void updateItem(P_CK t) {\n \n }", "void updateInformation();", "@Override\r\n\t\t\tpublic void handle(CellEditEvent<Products, String> arg0) {\n\t\t\t\targ0.getTableView().getItems().get(arg0.getTablePosition().getRow()).setName(arg0.getNewValue());\r\n\t\t\t\tProducts data=(Products) tbl_view.getSelectionModel().getSelectedItem();\r\n\t\t\t\tSystem.out.println(data.toString());\r\n\t\t\t\tConnectionManager.queryInsert(conn, \"UPDATE dbo.product SET name='\"+data.getName()+\"' WHERE id=\"+data.getId());\r\n\t\t\t\ttxt_cost.clear();\r\n\t\t\t\ttxt_date.clear();\r\n\t\t\t\ttxt_name.clear();\r\n\t\t\t\ttxt_price.clear();\r\n\t\t\t\ttxt_qty.clear();\r\n\t\t\t\ttxt_reorder.clear();\r\n\t\t\t\ttxt_search.clear();\r\n\t\t\t\tfetchData(FETCH_DATA);\r\n\t\t\t}", "@Override\r\n\tpublic void prodUpdate(ProductVO vo) {\n\t\tadminDAO.prodUpdate(vo);\r\n\t}", "@Override\r\n\t\t\tpublic void handle(CellEditEvent<Products, String> arg0) {\n\t\t\t\targ0.getTableView().getItems().get(arg0.getTablePosition().getRow()).setQuantity(arg0.getNewValue());\r\n\t\t\t\tProducts data=(Products) tbl_view.getSelectionModel().getSelectedItem();\r\n\t\t\t\tSystem.out.println(data.toString());\r\n\t\t\t\tConnectionManager.queryInsert(conn, \"UPDATE dbo.product SET quantity='\"+data.getQuantity()+\"' WHERE id=\"+data.getId());\r\n\t\t\t\ttxt_cost.clear();\r\n\t\t\t\ttxt_date.clear();\r\n\t\t\t\ttxt_name.clear();\r\n\t\t\t\ttxt_price.clear();\r\n\t\t\t\ttxt_qty.clear();\r\n\t\t\t\ttxt_reorder.clear();\r\n\t\t\t\ttxt_search.clear();\r\n\t\t\t\tfetchData(FETCH_DATA);\r\n\t\t\t}", "@Override\n public void itemRPClassUpdate(RPObject entity) {\n }", "public allProductUpdate() {\n initComponents();\n }", "public abstract void onUpdatePatchset(TicketModel ticket);", "@Override\n\tpublic void update(Recipe entity) {\n\t\t\n\t}", "public void updateDb(View view) {\n String productName = getIntent().getStringExtra(\"product\");\n Product p = db.getProductByName(productName);\n p.setName(name.getText().toString());\n p.setAvail(availSpinner.getSelectedItem().toString());\n p.setDescription(desc.getText().toString());\n p.setPrice(new BigDecimal(price.getText().toString()));\n p.setWeight(Double.parseDouble(weight.getText().toString()));\n db.updateProduct(p);\n finish();\n }", "@Override\r\n\tpublic void updatePurchaseOrder(PurchaseOrder por) {\n ht.update(por);\r\n\t}", "@Override\n\tpublic boolean updateProduct(Product p) {\n\t\treturn false;\n\t}", "@Override\n\tpublic String updateProduct() throws AdminException {\n\t\treturn null;\n\t}", "private void updateProduct(String productId, double reviewRating) {\n\t\tMap<String, Double> details = products.containsKey(productId)? products.get(productId): new HashMap<String, Double>();\n\t\tDouble numberOfReviews = details.containsKey(NUMBEROFREVIEWS)? details.get(NUMBEROFREVIEWS): 0.0;\n\t\tDouble totalRatings = details.containsKey(TOTALRATINGS)? details.get(TOTALRATINGS): 0.0;\n\n\t\tdetails.put(NUMBEROFREVIEWS, numberOfReviews + 1);\n\t\tdetails.put(TOTALRATINGS, totalRatings + reviewRating);\n\t\t\n\t\tList<Double> list = productRatings.containsKey(productId)? productRatings.get(productId): new ArrayList<Double>();\n\t\tlist.add(reviewRating);\n\t\t\n\t\tproducts.put(productId, details);\n\t\tproductRatings.put(productId, list);\n\t}", "@Override\r\n\t\t\tpublic void handle(CellEditEvent<Products, String> arg0) {\n\t\t\t\targ0.getTableView().getItems().get(arg0.getTablePosition().getRow()).setCost(arg0.getNewValue());\r\n\t\t\t\tProducts data=(Products) tbl_view.getSelectionModel().getSelectedItem();\r\n\t\t\t\tSystem.out.println(data.toString());\r\n\t\t\t\tConnectionManager.queryInsert(conn, \"UPDATE dbo.product SET cost='\"+data.getCost()+\"' WHERE id=\"+data.getId());\r\n\t\t\t\ttxt_cost.clear();\r\n\t\t\t\ttxt_date.clear();\r\n\t\t\t\ttxt_name.clear();\r\n\t\t\t\ttxt_price.clear();\r\n\t\t\t\ttxt_qty.clear();\r\n\t\t\t\ttxt_reorder.clear();\r\n\t\t\t\ttxt_search.clear();\r\n\t\t\t\tfetchData(FETCH_DATA);\r\n\t\t\t}", "@Override\n\t\tpublic void update() {\n\n\t\t}", "@Override\n\t\tpublic void update() {\n\n\t\t}", "@Override\n\t\tpublic void update() {\n\n\t\t}", "public void updateProducts()\n {\n ObservableList<Product> inventoryProducts = this.inventory.getAllProducts();\n\n // Configure product table and bind with inventory products\n productIDColumn.setCellValueFactory(new PropertyValueFactory<Product, String>(\"id\"));\n productNameColumn.setCellValueFactory(new PropertyValueFactory<Product, String>(\"name\"));\n productInventoryColumn.setCellValueFactory(new PropertyValueFactory<Product, String>(\"stock\"));\n productPriceColumn.setCellValueFactory(new PropertyValueFactory<Product, String>(\"price\"));\n\n productTable.setItems(inventoryProducts);\n // Unselect parts in table after part is updated\n productTable.getSelectionModel().clearSelection();\n productTable.getSelectionModel().setSelectionMode(SelectionMode.MULTIPLE);\n }", "@Override\r\n\t\t\tpublic void handle(CellEditEvent<Products, String> arg0) {\n\t\t\t\targ0.getTableView().getItems().get(arg0.getTablePosition().getRow()).setPrice(arg0.getNewValue());\r\n\t\t\t\tProducts data=(Products) tbl_view.getSelectionModel().getSelectedItem();\r\n\t\t\t\tSystem.out.println(data.toString());\r\n\t\t\t\tConnectionManager.queryInsert(conn, \"UPDATE dbo.product SET price='\"+data.getPrice()+\"' WHERE id=\"+data.getId());\r\n\t\t\t\ttxt_cost.clear();\r\n\t\t\t\ttxt_date.clear();\r\n\t\t\t\ttxt_name.clear();\r\n\t\t\t\ttxt_price.clear();\r\n\t\t\t\ttxt_qty.clear();\r\n\t\t\t\ttxt_reorder.clear();\r\n\t\t\t\ttxt_search.clear();\r\n\t\t\t\tfetchData(FETCH_DATA);\r\n\t\t\t}", "private void updateDatFile() {\n\t\tIOService<?> ioManager = new IOService<Entity>();\n\t\ttry {\n\t\t\tioManager.writeToFile(FileDataWrapper.productMap.values(), new Product());\n\t\t\tioManager = null;\n\t\t} catch (Exception ex) {\n\t\t\tDisplayUtil.displayValidationError(buttonPanel, StoreConstants.ERROR + \" saving new product\");\n\t\t\tioManager = null;\n\t\t}\n\t}", "public void update(Product product) {\n\t\tif (product != null) {\n\t\t\tsearchHelper.update(product, TokenizePatterns.FROM_START, product.getProductNbr(), product.getIngredients());\n\t\t\tsearchHelper.add(product, TokenizePatterns.ALL, product.getName());\n\n\t\t\t// Add active/deactive state afterwards\n\t\t\tif (product.isActive()) {\n\t\t\t\tsearchHelper.add(product, TokenizePatterns.WORD, \"aktiv\");\n\t\t\t} else {\n\t\t\t\tsearchHelper.add(product, TokenizePatterns.WORD, \"inaktiv\");\n\t\t\t}\n\t\t}\n\t}", "@FXML\n\tpublic void updateProduct(ActionEvent event) {\n\t\tProduct productToUpdate = restaurant.returnProduct(LabelProductName.getText());\n\t\tif (!txtUpdateProductName.getText().equals(\"\") && !txtUpdateProductPrice.getText().equals(\"\")\n\t\t\t\t&& selectedIngredients.isEmpty() == false) {\n\n\t\t\ttry {\n\t\t\t\tproductToUpdate.setName(txtUpdateProductName.getText());\n\t\t\t\tproductToUpdate.setPrice(txtUpdateProductPrice.getText());\n\t\t\t\tproductToUpdate.setSize(ComboUpdateSize.getValue());\n\t\t\t\tproductToUpdate.setType(toProductType(ComboUpdateType.getValue()));\n\t\t\t\tproductToUpdate.setIngredients(toIngredient(selectedIngredients));\n\n\t\t\t\tproductToUpdate.setEditedByUser(restaurant.returnUser(empleadoUsername));\n\n\t\t\t\trestaurant.saveProductsData();\n\t\t\t\tproductOptions.clear();\n\t\t\t\tproductOptions.addAll(restaurant.getStringReferencedIdsProducts());\n\t\t\t\tDialog<String> dialog = createDialog();\n\t\t\t\tdialog.setContentText(\"Producto actualizado satisfactoriamente\");\n\t\t\t\tdialog.setTitle(\"Proceso Satisfactorio\");\n\t\t\t\tdialog.show();\n\n\t\t\t\ttxtUpdateProductName.setText(\"\");\n\t\t\t\ttxtUpdateProductPrice.setText(\"\");\n\t\t\t\tComboUpdateSize.setValue(\"\");\n\t\t\t\tComboUpdateType.setValue(\"\");\n\t\t\t\tChoiceUpdateIngredients.setValue(\"\");\n\t\t\t\tLabelProductName.setText(\"\");\n\n\t\t\t} catch (IOException e) {\n\t\t\t\te.printStackTrace();\n\t\t\t\tDialog<String> dialog = createDialog();\n\t\t\t\tdialog.setContentText(\"No se pudo guardar la actualización de los productos\");\n\t\t\t\tdialog.setTitle(\"Error al guardar datos\");\n\t\t\t\tdialog.show();\n\t\t\t}\n\n\t\t\ttry {\n\t\t\t\tFXMLLoader optionsFxml = new FXMLLoader(getClass().getResource(\"Options-window.fxml\"));\n\t\t\t\toptionsFxml.setController(this);\n\t\t\t\tParent opWindow = optionsFxml.load();\n\t\t\t\tmainPaneLogin.getChildren().setAll(opWindow);\n\t\t\t} catch (IOException e) {\n\t\t\t\te.printStackTrace();\n\t\t\t}\n\t\t} else {\n\t\t\tDialog<String> dialog = createDialog();\n\t\t\tdialog.setContentText(\"Todos los campos deben ser llenados\");\n\t\t\tdialog.setTitle(\"Error al guardar datos\");\n\t\t\tdialog.show();\n\t\t}\n\n\t}", "public void handleModifyProducts()\n {\n FXMLLoader fxmlLoader = new FXMLLoader(getClass().getResource(\"/UI/Views/product.fxml\"));\n Parent root = null;\n try {\n root = (Parent) fxmlLoader.load();\n\n if (getProductToModify() != null)\n {\n // Get controller and configure controller settings\n ProductController productController = fxmlLoader.getController();\n productController.setModifyProducts(true);\n productController.setProductToModify(getProductToModify());\n productController.setInventory(inventory);\n productController.setHomeController(this);\n productController.updateParts();\n\n // Spin up product form\n Stage stage = new Stage();\n stage.initModality(Modality.APPLICATION_MODAL);\n stage.initStyle(StageStyle.DECORATED);\n stage.setTitle(\"Modify Products\");\n stage.setScene(new Scene(root));\n stage.show();\n }\n else\n {\n Alert alert = new Alert(Alert.AlertType.ERROR);\n alert.setTitle(\"Input Invalid\");\n alert.setHeaderText(\"No product was selected!\");\n alert.setContentText(\"Please select a product to modify from the product table!\");\n alert.show();\n }\n\n } catch (IOException e) {\n e.printStackTrace();\n }\n }", "@Allow(Permission.UpdateCatalog)\n public Product updateProduct(UpdateProductInput input, DataFetchingEnvironment dfe) {\n RequestContext ctx = RequestContext.fromDataFetchingEnvironment(dfe);\n ProductEntity productEntity = this.productService.update(ctx, input);\n return BeanMapper.map(productEntity, Product.class);\n }", "@Override\n\tpublic void update(Category entity) {\n\n\t}", "public void update(){}", "public void update(){}", "public void updateDataComp() {\n\t\tdataEntryDao.updateDataComp();\n\t}", "@PutMapping(\"/update\")\r\n\tpublic ProductDetails updateProduct(@RequestBody @Valid UpdateProduct request) {\r\n\t\r\n\t\tProduct product = productService.searchProduct(request.getProduct_Id());\r\n\t\tproduct.setProduct_Name(request.getProduct_Name());\r\n\t\tproduct.setProduct_Price(request.getProduct_Price());\r\n\t\tproduct.setProduct_Quantity(request.getProduct_Quantity());\r\n\t\tproduct.setProduct_Availability(request.isProduct_Availability());\r\n\t\treturn productUtil.toProductDetails(productService.updateProduct(product));\r\n\t}", "public void updateInfo() {\n\t}", "@Override\n\tpublic void update(Object entidade) {\n\t\t\n\t}", "@Override\r\n\t\t\tpublic void handle(CellEditEvent<Products, String> arg0) {\n\t\t\t\targ0.getTableView().getItems().get(arg0.getTablePosition().getRow()).setReorder_level(arg0.getNewValue());\r\n\t\t\t\tProducts data=(Products) tbl_view.getSelectionModel().getSelectedItem();\r\n\t\t\t\tSystem.out.println(data.toString());\r\n\t\t\t\tConnectionManager.queryInsert(conn, \"UPDATE dbo.product SET reorder_level='\"+data.getReorder_level()+\"' WHERE id=\"+data.getId());\r\n\t\t\t\ttxt_cost.clear();\r\n\t\t\t\ttxt_date.clear();\r\n\t\t\t\ttxt_name.clear();\r\n\t\t\t\ttxt_price.clear();\r\n\t\t\t\ttxt_qty.clear();\r\n\t\t\t\ttxt_reorder.clear();\r\n\t\t\t\ttxt_search.clear();\r\n\t\t\t\tfetchData(FETCH_DATA);\r\n\t\t\t}", "private void updateProduct(HttpServletRequest request, HttpServletResponse response) throws Exception {\n\t\tCookie[] theCookieLoop=request.getCookies();//tạo một cái mảng cookie có \n\t\tString idProduct=null;\n\t\t\t\t\t\t\t//có tên là theCookieloop sau đó lấy ra các đối tượng trong mảng Cookie\n\t\t\tif(theCookieLoop !=null) {\n\t\t\t\tfor(Cookie tempCookie:theCookieLoop)//dùng để duyệt qu các mảng cookie \n\t\t\t\t{\n\t\t\t\t\tif(\"ID\".equals(tempCookie.getName())) {\n\t\t\t\t\t\tidProduct=tempCookie.getValue();\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\t\t\n\t\t\tString location =request.getParameter(\"linkIMG\");\n\t\t\tif(location.equals(\"false\")) {\n\t\t\t\tPart part = request.getPart(\"linkImage\");\n\t\t\t\tString fileName = extractFileName(part);\n\t\t\t\tString savePath = \"G:\\\\java\\\\WebBuyPhoneJavaFull\\\\WebBuyPhone\\\\WebContent\\\\admin\" +File.separator + SAVE_DIR;\n\t\t\t\tpart.write(savePath + File.separator + fileName);\n\t\t\t\tlocation=\"Image/\"+fileName;\n\t\t\t}\n\t\t\t\tdaoPageAdmin.UpdateProduct(idProduct, request.getParameter(\"NameProduct\")\n\t\t\t\t\t\t, Double.parseDouble(request.getParameter(\"PriceProduct\")), location,\n\t\t\t\t\t\t request.getParameter(\"Newfeature\"), request.getParameter(\"DetailsProduct\"),request.getParameter(\"Screen\"), request.getParameter(\"Operating\"),\n\t\t\t\t\t\t request.getParameter(\"FrontCamera\"), request.getParameter(\"RearCamera\"),request.getParameter(\"CPU\"), request.getParameter(\"RAM\"),\n\t\t\t\t\t\t request.getParameter(\"InternalMemory\"), request.getParameter(\"MemoryStick\"),request.getParameter(\"SIM\"), request.getParameter(\"BatteryCapacity\"));\n\t\t\t\n\t\t\t\n\t\tloadProduct(request, response);\n\t}", "@Override\n\tpublic Representation updateDetails(Representation entity,\n\t\t\tProductCategoryColumnParametersJsonObject obj) {\n\t\treturn null;\n\t}", "@Override\r\n\t\tpublic void update() {\n\t\t\t\r\n\t\t}", "@Override\r\n\t\tpublic void update() {\n\t\t\t\r\n\t\t}", "@Override\r\n\tpublic int updateProductById(HashMap<String, Object> map) {\n\t\tProduct product = (Product) map.get(\"product\");\r\n\t\tdao.updateProductById(product);\r\n\t\tList<ProductOption> oldList = (List<ProductOption>) map.get(\"oldList\");\r\n\t\tfor(int idx=0; idx<oldList.size(); idx++){\r\n\t\t\toldList.get(idx).setProductId(product.getProductId());\r\n\t\t\tdao.updateProductOptionById(oldList.get(idx));\r\n\t\t}\r\n\t\tList<ProductOption> newList = (List<ProductOption>) map.get(\"newList\");\r\n\t\tif(map.get(\"newList\")!=null){\r\n\t\t\tfor(int idx=0; idx<newList.size(); idx++){\r\n\t\t\t\tnewList.get(idx).setProductId(product.getProductId());\r\n\t\t\t\toptionDao.insertOption(newList.get(idx));\r\n\t\t\t}\r\n\t\t}\r\n\t\tif( map.get(\"image\")!=null){\r\n\t\t\tProductDetailImage image = ((ProductDetailImage) map.get(\"image\"));\r\n\t\t\tdao.updateDetailImageById(image);\r\n\t\t}\r\n\t\treturn 0;\r\n\t}", "public void Editproduct(Product objproduct) {\n\t\t\n\t}", "public static int update(Product p) {\n ConnectionPool pool = ConnectionPool.getInstance();\n Connection connection = pool.getConnection();\n PreparedStatement ps = null;\n System.out.println(\"DBSetup @ LINE 127\");\n String query = \"UPDATE product SET productCode = ?, productName = ?, catalogCategory = ?,\"\n + \"description = ?, price = ?, imageURL = ? \"\n + \" WHERE productCode = ?\";\n try {\n ps = connection.prepareStatement(query);\n ps.setString(1, p.getProductCode());\n ps.setString(2, p.getProductName());\n ps.setString(3, p.getCatalogCategory());\n ps.setString(4, p.getDescription());\n ps.setFloat(5, p.getPrice());\n ps.setString(6, p.getImageURL());\n ps.setString(7, p.getProductCode());\n return ps.executeUpdate();\n } catch (SQLException e) {\n System.out.println(e);\n return 0;\n } finally {\n DBUtil.closePreparedStatement(ps);\n pool.freeConnection(connection);\n }\n }", "Product editProduct(Product product);", "@FXML\n\t private void updateProductPrice (ActionEvent actionEvent) throws SQLException, ClassNotFoundException {\n\t try {\n\t ProductDAO.updateProdPrice(prodIdText.getText(),newPriceText.getText());\n\t resultArea.setText(\"Price has been updated for, product id: \" + prodIdText.getText() + \"\\n\");\n\t } catch (SQLException e) {\n\t resultArea.setText(\"Problem occurred while updating price: \" + e);\n\t }\n\t }", "public void update(GeneralProduct generalProduct) {\n general_product_dao.update(generalProduct);\n }", "private void updateProductHandler(RoutingContext routingContext) {\n\n HttpServerResponse httpServerResponse = routingContext.response();\n\n try {\n Long productId = Long.parseLong(routingContext.request().getParam(\"productId\"));\n Instant start = Instant.now();\n\n logger.info(\"Received the update request for the productid \" + productId + \" at \" + start);\n\n JsonObject productJson = routingContext.getBodyAsJson();\n Product inputProduct = new Product(productJson);\n inputProduct.setId(productId);\n\n logger.info(\"The input product \" + inputProduct.toString());\n\n // Create future for DB call\n Future<Product> productDBPromise =\n Future.future(promise -> callDBService(promise, inputProduct, DBAction.UPDATE));\n\n productDBPromise.setHandler(\n dbResponse -> {\n if (dbResponse.succeeded()) {\n\n Product updatedProduct = dbResponse.result();\n logger.info(\"The updated product is \" + updatedProduct.toString());\n Gson gson = new GsonBuilder().create();\n String json = gson.toJson(updatedProduct);\n\n Long duration = Duration.between(start, Instant.now()).toMillis();\n logger.info(\"Total time taken to process the request \" + duration + \" milli-seconds\");\n\n httpServerResponse.setStatusCode(SUCCESS_CODE);\n httpServerResponse.end(new JsonObject(json).encodePrettily());\n } else {\n logger.error(dbResponse.cause());\n httpServerResponse.setStatusCode(INTERNAL_SERVER_ERROR);\n httpServerResponse.end(\n \"Error due to \"\n + dbResponse.cause().getMessage()\n + \". Please try again after sometime.\");\n }\n });\n\n } catch (Exception e) {\n\n logger.error(e);\n httpServerResponse.setStatusCode(INTERNAL_SERVER_ERROR);\n httpServerResponse.end(\n \"Error due to \" + e.getMessage() + \". Please try again after sometime.\");\n }\n }", "@Override\r\n\tpublic Long update(Producto entity) throws Exception {\n\t\treturn productRepository.update(entity);\r\n\t}", "public void updateProduct(SiteProduct product) {\n dataProvider.save(product);\n }", "@FXML\n\t private void updateProductCuloare (ActionEvent actionEvent) throws SQLException, ClassNotFoundException {\n\t try {\n\t ProductDAO.updateProdCuloare(prodIdText.getText(),newCuloareText.getText());\n\t resultArea.setText(\"Colour has been updated for, product id: \" + prodIdText.getText() + \"\\n\");\n\t } catch (SQLException e) {\n\t resultArea.setText(\"Problem occurred while updating colour: \" + e);\n\t }\n\t }", "void update(Information info);", "public void Update(StokContract entity) {\n\t\t\n\t}", "public void update( )\n {\n FormPortletHome.getInstance( ).update( this );\n }", "private void updateProduct(boolean rebuild) {\n\n // Save the product.\n PshUtil.savePshData(pshData);\n\n // Build report and display.\n if (rebuild) {\n previewProduct = PshUtil.buildPshReport(pshData);\n previewText.setText(previewProduct);\n }\n }", "@FXML\n\tprivate void handleEditProducts() {\n\t\tboolean okClicked = showProducts();\n\t\tsaveCurrentAcknowledgment();\n\t\tsetAcknowledgment(acknowledgment);\n\t}", "private void saveProduct() {\n //Delegating to the Presenter to trigger focus loss on listener registered Views,\n //in order to persist their data\n mPresenter.triggerFocusLost();\n\n //Retrieving the data from the views and the adapter\n String productName = mEditTextProductName.getText().toString().trim();\n String productSku = mEditTextProductSku.getText().toString().trim();\n String productDescription = mEditTextProductDescription.getText().toString().trim();\n ArrayList<ProductAttribute> productAttributes = mProductAttributesAdapter.getProductAttributes();\n mCategoryOtherText = mEditTextProductCategoryOther.getText().toString().trim();\n\n //Delegating to the Presenter to initiate the Save process\n mPresenter.onSave(productName,\n productSku,\n productDescription,\n mCategoryLastSelected,\n mCategoryOtherText,\n productAttributes\n );\n }", "@Override\n\tpublic void dispenseChange(String productCode) {\n\t\t\n\t}", "@Override\r\n\tpublic void update() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void update() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void update() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void update() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void update() {\n\t\t\r\n\t}", "void setProduct(x0401.oecdStandardAuditFileTaxPT1.ProductDocument.Product product);", "@Override\r\n\tpublic void update(Product product) {\n\t\tproductMapper.updateByPrimaryKeySelective(product);\r\n\t}", "public void updateView()\n {\n // Get width and height of display\n DisplayMetrics metrics = new DisplayMetrics();\n getWindowManager().getDefaultDisplay().getMetrics(metrics);\n int width = metrics.widthPixels;\n int height = metrics.heightPixels;\n \n // Get details widgets from layout \n ImageView productImage = findViewById(R.id.product_image);\n TextView productTitle = findViewById(R.id.product_title);\n TextView productDescription = findViewById(R.id.product_description); \n RatingBar productRating = findViewById(R.id.product_rating);\n TextView productNumReviews = findViewById(R.id.product_num_reviews);\n TextView productPrice = findViewById(R.id.product_price);\n productQuantityTextView = findViewById(R.id.product_quantity);\n\n // Setup quantity\n productQuantity = 1;\n productQuantityTextView.setText(Integer.toString(productQuantity));\n Button incrementQuantityButton = findViewById(R.id.quantity_plus);\n incrementQuantityButton.setOnClickListener(new addButtonOnClickListener());\n Button decrementQuantityButton = findViewById(R.id.quantity_minus);\n decrementQuantityButton.setOnClickListener(new subtractButtonOnClickListener());\n\n // Resize image view\n productImage.setMinimumWidth(width);\n productImage.setMaxHeight(height / 2);\n\n // Display product details\n productTitle.setText(activeProduct.getName());\n productImage.setImageBitmap(activeProduct.getImage());\n productDescription.setText(activeProduct.getDescription());\n productRating.setRating((float) activeProduct.getRating());\n productNumReviews.setText(Integer.toString(activeProduct.getNumReviews()));\n DecimalFormat decimalFormat = new DecimalFormat(\"$#,##0.00\");\n productPrice.setText(String.valueOf(decimalFormat.format(activeProduct.getPrice())));\n\n // Add on click listener for add item to cart push button\n Button addItemButton = findViewById(R.id.add_to_cart);\n addItemButton.setOnClickListener(new ViewButtonHandler());\n }", "public void updateQuantity(Product p, String distCenter, int quantity){\r\n\t\tp.distCenters.put(distCenter, p.distCenters.get(distCenter) + quantity);\r\n\t\tp.quantity += quantity;\r\n\t}", "@Override\r\n\tpublic void k_update(ManufacturersVO MANUFACTURERSVO) {\n\t\t\r\n\t}", "private void modifyExec(){\r\n\t\ttry {\r\n\t\t\tList<HashMap<String,String>> selectedDatas=ViewUtil.getSelectedData(jTable1);\r\n\t\t\tif(selectedDatas.size()!=1){\r\n\t\t\t\tJOptionPane.showMessageDialog(null, \"Please select 1 item to Modify\", \"Error\", JOptionPane.ERROR_MESSAGE);\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\t\t\tMap<String,String>selectedMap=NameConverter.convertViewMap2PhysicMap(selectedDatas.get(0), \"Discount\");\r\n\t\t\tDiscountBean selectedDiscountBean=new DiscountBean();\r\n\t\t\tBeanUtil.transMap2Bean(selectedMap, selectedDiscountBean);\r\n\t\t\tViewManager.goToSubFunctionScreen(new AddDiscountPanel(selectedDiscountBean,AddDiscountPanel.MODIFY_DISCOUNT));\r\n\t\t} catch (ServiceNotFoundException e) {\r\n\t\t\te.printStackTrace();\r\n\t\t}\r\n\t}", "public void update()\n {\n modifier = coral.getCurrentSubject();\n modified = new Date();\n try\n {\n persistence.save(this);\n }\n catch(SQLException e)\n {\n throw new BackendException(\"failed to update resource's persitent image\", e);\n }\n try\n {\n Resource impl = coral.getStore().getResource(getId());\n coralEventHub.getGlobal().fireResourceChangeEvent(impl, modifier);\n }\n catch(EntityDoesNotExistException e)\n {\n throw new BackendException(\"inconsistent data\", e);\n }\n }", "@Override\n\tpublic void updateProductState(ProductState productState) {\n\t\tlogger.info(\"productStateServiceMong update productState with id : \" + productState.getId());\n\t\tproductStateDAO.updateProductState(productState);\n\n\t}", "@Override\r\n public final void update() {\r\n\r\n logger.entering(this.getClass().getName(), \"update\");\r\n\r\n setFilterMap();\r\n\r\n logger.exiting(this.getClass().getName(), \"update\");\r\n\r\n }", "protected void updateCartInfoUI() {\n SharedPref.putCartitesmQty(getContext(), mCartInfo.getSummaryQty());\n this.updateCartTotal();\n// updateMenu();\n }", "ProductView updateProduct(int productId, EditProductBinding productToEdit) throws ProductException;", "@Override\r\n\t\t\tpublic void handle(CellEditEvent<Products, String> arg0) {\n\t\t\t\targ0.getTableView().getItems().get(arg0.getTablePosition().getRow()).setExpiry_date(arg0.getNewValue());\r\n\t\t\t\tProducts data=(Products) tbl_view.getSelectionModel().getSelectedItem();\r\n\t\t\t\tSystem.out.println(data.toString());\r\n\t\t\t\tConnectionManager.queryInsert(conn, \"UPDATE dbo.product SET expiry_date='\"+data.getExpiry_date()+\"' WHERE id=\"+data.getId());\r\n\t\t\t\ttxt_cost.clear();\r\n\t\t\t\ttxt_date.clear();\r\n\t\t\t\ttxt_name.clear();\r\n\t\t\t\ttxt_price.clear();\r\n\t\t\t\ttxt_qty.clear();\r\n\t\t\t\ttxt_reorder.clear();\r\n\t\t\t\ttxt_search.clear();\r\n\t\t\t\tfetchData(FETCH_DATA);\r\n\t\t\t}", "@Override\n\tpublic Map<String, Object> update(StoreBase entity) {\n\t\treturn null;\n\t}", "@Override\n\tpublic void update(DhtmlxGridForm f) throws Exception {\n\t\t\n\t}", "@Override\r\n\tpublic void update() {\r\n\r\n\t}", "public void setProduct(entity.APDProduct value);" ]
[ "0.65198606", "0.63947153", "0.63925314", "0.6091512", "0.606209", "0.6053426", "0.60054564", "0.59571254", "0.5941203", "0.59186417", "0.5910952", "0.5839801", "0.5826946", "0.5818009", "0.57598037", "0.57594985", "0.57443315", "0.5731345", "0.5730667", "0.5721329", "0.5700587", "0.56839585", "0.56757504", "0.5662381", "0.5597956", "0.5584301", "0.555339", "0.553664", "0.55352765", "0.5527876", "0.5522993", "0.5521535", "0.5517298", "0.5507922", "0.55077034", "0.5491952", "0.5468653", "0.5468177", "0.54648864", "0.54451555", "0.5439374", "0.5439374", "0.5439374", "0.54302645", "0.5428756", "0.5427473", "0.5406426", "0.540307", "0.5401529", "0.5400179", "0.5398905", "0.5393427", "0.5393427", "0.53899354", "0.5388802", "0.5383218", "0.53808534", "0.5368226", "0.5362437", "0.5360157", "0.5358267", "0.5358267", "0.5357823", "0.5348863", "0.5340986", "0.53371936", "0.5328287", "0.5325803", "0.53204995", "0.5318288", "0.5317684", "0.53137094", "0.5312851", "0.5294721", "0.5292022", "0.52837926", "0.52812856", "0.5270759", "0.5269373", "0.5268806", "0.5268806", "0.5268806", "0.5268806", "0.5268806", "0.52568674", "0.5249983", "0.52471846", "0.52468824", "0.5244126", "0.52364427", "0.5233583", "0.5233285", "0.52320755", "0.5228364", "0.5227069", "0.5225454", "0.5224695", "0.5216809", "0.520784", "0.5206961" ]
0.7241309
0
Prevents other classes from declaring new Elevator()
public static Elevator getInstance() { return instance; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public Elevator() {\n\t\t\n \tsuper(\"Elevator\", RobotConstants.ELEVATOR_P, RobotConstants.ELEVATOR_I, RobotConstants.ELEVATOR_D);\n \t\t\n\t\t// TODO Auto-generated constructor stub\n\t}", "Elevator() {\n _currentFloor = Floor.FIRST;\n _passengersOnboard = 0;\n _directionOfTravel = DirectionOfTravel.UP;\n\n }", "public Elevator() {\n currentFloor = 1;\n elevatorState = IDLE;\n request = null;\n }", "public Elevator() {\n\t\tthis.motor = new Motor(this);\n\t\tthis.door = new Door(false);\n\t\tthis.elevatorButtons = new HashMap<Integer, ElevatorButton>();\n\t\t\n\t\tgenerateElevatorButtons();\n\n\t\tstate = new ElevatorState(Floor.MINIMUM_FLOOR_NUM, Direction.STATIONARY, Floor.MINIMUM_FLOOR_NUM);\n\t}", "public void Elevator() {\n // Use these to get going:\n // setSetpoint() - Sets where the PID controller should move the system\n // to\n // enable() - Enables the PID controller.\n \t\n }", "public Elevator(int elevatorID) {\n this.elevatorID = elevatorID;\n currentFloor = 0;\n }", "private UserInteraction() {\n\t\tthis.elevatorManager = ElevatorManager.getInstance();\n\t}", "protected ElevatorController(Elevator elevator) {\n\t\tthis.elevator = elevator;\n\t}", "public Elevator() {\n boolean elevatorInvert = false;\n boolean elevatorPhase = false;\n spx = new SpectrumVictorSPX(Constants.ELEVATOR_SPX);\n srx = new LeaderTalonSRX(Constants.ELEVATOR_SRX, spx);\n srx.setNeutralMode(NeutralMode.Brake);\n srx.configSelectedFeedbackSensor(FeedbackDevice.CTRE_MagEncoder_Relative);\n srx.setSensorPhase(elevatorPhase);\n srx.setInverted(elevatorInvert);\n\n // Enable Soft Limits\n srx.configForwardSoftLimitEnable(false);\n srx.configForwardSoftLimitThreshold(posUpLimit);\n srx.configForwardLimitSwitchSource(LimitSwitchSource.FeedbackConnector, LimitSwitchNormal.NormallyOpen);\n \n srx.configReverseSoftLimitEnable(false);\n srx.configReverseSoftLimitThreshold(posDownLimit);\n srx.configReverseLimitSwitchSource(LimitSwitchSource.FeedbackConnector, LimitSwitchNormal.NormallyOpen);\n\n srx.setStatusFramePeriod(StatusFrameEnhanced.Status_13_Base_PIDF0, 10);\n srx.setStatusFramePeriod(StatusFrameEnhanced.Status_10_MotionMagic, 10);\n\n // Set Ramp Rate and voltage compensation\n srx.configClosedloopRamp(0.25);\n srx.configVoltageCompSaturation(11.5);\n srx.enableVoltageCompensation(true);\n setMotionMagicParams();\n }", "public interface Elevator {\n public static final int UP = 1, LEVEL = 0, DOWN = -1, ERROR = -2;\n /** Returns the minimal floor number to which this Elevator can reach(often a negative value).\n * This is the same value as the lowest floor in the building - this elevator belongs to. */\n public int getMinFloor();\n /** Returns the maximal floor number to which this Elevator can reach.\n * This is the same value as the highest floor in the building - this elevator belongs to. */\n public int getMaxFloor();\n /** Returns the time (in seconds it takes the Elevator to open its doors. */\n public double getTimeForOpen();\n /** Returns the time (in seconds it takes the Elevator to close its doors */\n public double getTimeForClose();\n /** Returns the Elavator's current state: {UP, DOWN, LEVEL, ERROR} the state \"LEVEL\" mark that the elevator has reached the floor -\n * and is now ready to load / unload and get new orders. */\n public int getState(); // UP, DOWN, LEVEL, ERROR\n /** Returns the Elevator's current position (floor) as an Integer. */\n public int getPos();\n /** Moves the elevator form the current position to the destination floor. */\n public boolean goTo(int floor);\n /** Allows the elevator to stop in an intermidiate floor between src and dest, assumeing the elevator has not yer pass the desired floor in which it needs to stop. */\n public boolean stop(int floor);\n /** Returns the speed (in floor per second), e.g. if the Elevator speed is 0.4 - it takes it 2.5 seconds to pass a single floor. */\n public double getSpeed();\n /** Return the time in seconds that it takes the elevator to start moving in full speed (assumed to be a fixed value). */\n public double getStartTime();\n /** Return the time in seconds that it takes the elevator to stop moving in full speed (assumed to be a fixed value).*/\n public double getStopTime();\n /**\n * @return the id of this elevator (simple index as in the building).\n * Note: this index should be the same as in the elevator allocation algorithm.\n */\n public int getID();\n}", "public static Elevator getInstance() {\n if (mInstance == null) {\n mInstance = new Elevator();\n return mInstance;\n } else\n return mInstance;\n }", "public Elevator(final int id) {\n this.id = id;\n }", "public\tElevator(){\t\t\t\t\t\t\n\t\tcurrentFloor = 1;\n\t\tcurrentDirection = \"UP\";\n\t\ttotalPassengers = 0;\n\t\ttotalPassDestFloor = new int[8];\n\t\tdestRequest = new char[8];\n\t\t \n\t}", "public MovingGuest() \n {\n // Deferred to subclasses.\n }", "public Eleve() {\r\n\t\tsuper();\r\n\t}", "public Person(ElevatorController elevatorController){\n this.id = idGenerator.getAndIncrement();\n this.arrivalTime = setArrivalTime();\n this.arrivalFloor = setArrivalFloor();\n\t\t this.destinationFloor = setDestinationFloor();\n this.baggageWeight = setLuggageWeight();\n this.personWeight = setPassengerWeight();\n this.random = new Random();\n this.elevatorController = elevatorController;\n }", "public ElevatorScene() {\t\t\n\t\tif(exitedCount == null) {\n\t\t\texitedCount = new ArrayList<Integer>();\n\t\t} else {\n\t\t\texitedCount.clear();\n\t\t}\n\t\t\n\t\televators = new ArrayList<Elevator>();\n\t\tpersonCount = new ArrayList<Integer>();\n\t\t\n\t\texitedCountMutex = new Semaphore(1);\n\t\tsem = new Semaphore(6);\n\t\t\n\t\t\n\t\tnumberOfPeopleWaiting = 0;\n\t}", "abstract void move_elevator();", "private Road()\n\t{\n\t\t\n\t}", "abstract void classRooms();", "public ElevatorUI() {\n initComponents();\n }", "public static void main(String[] args) {\n Elevator theElevator = new Elevator();\n\n theElevator.boardPassenger(2);\n theElevator.boardPassenger(2);\n theElevator.boardPassenger(3);\n\n System.out.println(theElevator);\n\n for(int i=1;i<21;i++){\n theElevator.move();\n }\n \n\n \n\n }", "public RailRoad() {}", "private Rekenhulp()\n\t{\n\t}", "public Person(ElevatorControllerGUI elevatorController){\n this.id = idGenerator.getAndIncrement();\n this.arrivalTime = random.nextInt((30-1)+1)+1; \n this.arrivalFloor = random.nextInt((4-2)+1)+2; \n\t\t this.destinationFloor = random.nextInt((10-5)+1)+5; \n\t\t this.baggageWeight = setLuggageWeight();\n this.personWeight = setPassengerWeight();\n this.random = new Random();\n this.elevatorControllerGUI = elevatorController;\n }", "public ElevatorSimulation(){ \n for (int onFloor = 0; onFloor< 5; onFloor++){\n passengerArrivals.add(new ArrayList<PassengerArrival>());\n }\n \n parseFile();\n\n for (int i = 0; i < a; i++){\n elevatorArray[i] = new Elevator(i+1, aBuildingManager);\n threadArray[i] = new Thread(elevatorArray[i]);\n\n }\n writeToConsoleLock = new ReentrantLock();\n \n }", "private TetrisMain() {\r\n //prevents instantiation\r\n }", "public Investigator() {}", "@Override\n protected void initialize() {\n System.out.println(\"elevator down initialized\");\n }", "public PIDElevator() {\n \tsuper(\"PIDElevator\", Kp, Ki, Kd);\n \tenco = new Encoder(RobotMap.ENCODER_A_CHANNEL, RobotMap.ENCODER_B_CHANNEL, true);\n enco.reset();\n \n //outputOne = new DigitalOutput(RobotMap.ARDUINO_PIN_ONE);\n //outputTwo = new DigitalOutput(RobotMap.ARDUINO_PIN_TWO);\n //outputThree = new DigitalOutput(RobotMap.ARDUINO_PIN_THREE);\n\n \t\n \tsetAbsoluteTolerance(10);\n \tgetPIDController().setContinuous(false);\n // Use these to get going:\n // setSetpoint() - Sets where the PID controller should move the system\n // to\n // enable() - Enables the PID controller.\n \televMotor = new CANTalon(RobotMap.ELEV_TALON);\n \t\n //button = new DigitalInput(0); \n \tbottom_hallEffect = new DigitalInput(RobotMap.HALL_EFFECT_PORT);\n \ttop_limitSwitch = new DigitalInput(RobotMap.TOP_LIMIT_SWITCH);\n \t\n \t//wire = new I2C(Port.kOnboard, 4);\n \t\n \tBrakeEngaged = new Solenoid(1, RobotMap.BRAKE_IN);\n \tBrakeDisengaged = new Solenoid(1, RobotMap.BRAKE_OUT);\n \tenable();\n }", "private ATCres() {\r\n // prevent to instantiate this class\r\n }", "private void initializeElevatorMotor()\n {\n Rectangle base = new Rectangle(shaftWidth*.3, location, shaftWidth*.4, floorHeight*.8);\n Rectangle latch = new Rectangle(shaftWidth*.45, location-5, shaftWidth*.1, floorHeight*.2);\n\n elevator = Shape.union(base, latch);\n elevator.setFill(Color.valueOf(\"#C0C0C0\"));\n\n elevatorTranslate = 0;\n elevatorOffset = 0;\n elevatorSpeed = 20;\n\n motorTimeline = new Timeline(new KeyFrame(Duration.millis(elevatorSpeed), e -> {\n if(location+elevatorOffset <= shaftHeight-60 && location+elevatorOffset >= 10) {\n if(location <= destination && location >= destination-10)\n {\n// System.out.println(location + \" OF \" + (destination) + \" / \" + (destination-10) + \" \" + (10 - destination/floorHeight));\n// System.out.println(\"EARLY STOP\");\n motorTimeline.pause();\n }\n\n elevatorTranslate += elevatorOffset;\n location += elevatorOffset;\n\n elevator.setTranslateY(elevatorTranslate);\n frame.setTranslateY(elevatorTranslate);\n leftDoor.setTranslateY(elevatorTranslate);\n rightDoor.setTranslateY(elevatorTranslate);\n }\n else motorTimeline.pause();\n }));\n motorTimeline.setCycleCount(Animation.INDEFINITE);\n }", "VehicleClass() {}", "public Elevator duplicate() {\n //Duplicate queue\n LinkedList<ElevatorQueueObject> newQueue = new LinkedList<ElevatorQueueObject>();\n for (int i = 0; i < queue.size(); i++) {\n newQueue.add(i, queue.get(i));\n }\n \n //Duplicate currentPassengers\n LinkedList<Passenger> lcp = new LinkedList<Passenger>();\n for (int i = 0; i < currentPassengers.size(); i++) {\n lcp.add(i, currentPassengers.get(i));\n }\n \n return new Elevator(specs, floors, zonedFloors, newQueue, lcp, waitingTime, \n currentFloor, BigInteger.ZERO, BigInteger.ZERO, BigDecimal.ZERO, BigInteger.ZERO);\n }", "Elevage createElevage();", "public interface ElevatorSelectionStrategy {\n\tElevator getElevatorFor(Passenger passenger, Floor departureFloor, Environment env);\n}", "private TMCourse() {\n\t}", "protected Problem() {/* intentionally empty block */}", "Classroom() {}", "public OfferingException() {\n }", "public Elevator(ElevatorSpecs spec, int[] floors, float currentFloor) {\n specs = spec;\n this.floors = floors;\n currentPassengers = new LinkedList<Passenger>();\n queue = new LinkedList<ElevatorQueueObject>();\n waitingTime = 0;\n this.currentFloor = currentFloor;\n distancePerFloor = (float)specs.getBuildingHeight() / (float)specs.getFloors();\n totalWaitTime = new BigInteger(\"0\");\n totalTravelTime = new BigInteger(\"0\");\n totalTravelDistance = new BigDecimal(\"0\");\n passengersServed = new BigInteger(\"0\"); \n zonedFloors = floors; \n }", "private ObjectMacroFront() {\n\n throw new InternalException(\"this class may not have instances\");\n }", "private TetrisMain() {\r\n //ensure uninstantiability\r\n }", "private Supervisor() {\r\n\t}", "@Override\n public void disabledInit() {\n\t// new SetElevator(0).start();\n\tif (autonomousCommand != null)\n\t autonomousCommand.cancel();\n\tScheduler.getInstance().removeAll();\n }", "@SuppressWarnings(\"unused\")\r\n\tprivate TransporterException(){\r\n\t\t\r\n\t}", "@Test\n\tpublic void returnNullWhenNoneIdel() {\n\t\t\n\t\twhen(elevatorRepository.getElevators()).thenReturn(elevators);\n\t\tElevator elevator = elevatorAllocateService.requestElevator(task);\n\t\tassertNull(elevator);\n\t}", "private void delayElevator() {\n try {\n Thread.sleep(MOVEMENT_DELAY);\n } catch (InterruptedException ex) {\n Logger.getLogger(Elevator.class.getName()).log(Level.SEVERE, null, ex);\n }\n }", "@Override\n\tpublic void classroom() {\n\t\t\n\t}", "@Override\r\n\t\tpublic Elevator checkElevator(String id){\n\t\t\tElevator Elevator = mongoTemplate.findById(id, Elevator.class, \"ElevatorCollection\");\r\n\t\t\treturn Elevator;\r\n\t\t}", "private CheckingTools() {\r\n super();\r\n }", "private InstalledOfficeManagerHolder() {\n throw new AssertionError(\"Utility class must not be instantiated\");\n }", "public Lane() {\n\t}", "public Armor() {\n super();\n}", "@Override\n\tpublic void startEating() {\n\t\tthrow new RuntimeException(\"Robot cant eat\");\n\t}", "protected Doodler() {\n\t}", "public Gate(){\n\n }", "private Airbag safeInstantiateAirbag() {\n Airbag airbag;\n\n try { \n // Check if airbag module is available\n // It is not safe to instantiate or use a type from an optional module.\n airbag = new Airbag();\n }\n catch (NoClassDefFoundError exception) {\n // The airbag module is not available\n airbag = null;\n }\n\n return airbag;\n }", "protected Approche() {\n }", "public Building() {\n mElevators = new ArrayList<>();\n mFloors = new ArrayList<>();\n }", "protected Vertex() {\n\t\tisInDepot = false;\n\t}", "private DarthSidious(){\n }", "private EagerlySinleton()\n\t{\n\t}", "private DungeonBotsMain() {\n\t\t// Does nothing.\n\t}", "private Validations() {\n\t\tthrow new IllegalAccessError(\"Shouldn't be instantiated.\");\n\t}", "public EatTime() {\n }", "public ElectricBike() {\n\t\tsuper();\n\t}", "public AirAndPollen() {\n\n\t}", "@SuppressWarnings(\"unused\")\r\n private Rental() {\r\n }", "private Arena() {}", "protected EvilFigure() {\r\n side = EVIL;\r\n }", "protected MenuTools() {\r\n\t\tthis(null);\r\n\t}", "public void registerElevator(Integer elevatorID, int startFloor) {\n if (elevatorControllers.size() == ELEVATORS_LIMIT || elevatorControllers.containsKey(elevatorID)) {\n System.err.println(\"Failed to register elevator with ID: \" + elevatorID.toString());\n return;\n }\n Elevator elevator = new Elevator(elevatorID, startFloor);\n ElevatorController controller = new ElevatorController(elevator);\n elevatorControllers.put(elevatorID, controller);\n }", "public static void main(String args[]){\n\t\tElevator E1 = new Elevator();\n\t\tE1.F[3].setPassengersWaiting(4);\n\t\tE1.F[5].setPassengersWaiting(3);\n\t\tE1.F[6].setPassengersWaiting(4);\n\t\t\n\t\ttry {E1.boardPassengers(2,2,3);}\n\t\tcatch (ElevatorFullException exc){\n\t\t\tSystem.out.println(\"ELEVATOR IS AT ITS FULL CAPACITY\");\n\t\t\t}\n\t\tE1.registerRequest();\n\n\t\tE1.move();\n\t\tSystem.out.println(\"------------------------------------------------------------------------\");\n\t\tE1.move();\n\t\tSystem.out.println(\"------------------------------------------------------------------------\");\n\t\tE1.move();\n\t\tSystem.out.println(\"------------------------------------------------------------------------\");\n\t\tE1.move();\n\t}", "private TbusRoadGraph() {}", "private MazeBuilder() {\n\t}", "private E() {}", "protected Betaling()\r\n\t{\r\n\t\t\r\n\t}", "private GestionTour() {}", "@Override\n public BeingBlocker newBeing() {\n // Return a new BeingBlocker instance.\n // TODO -- you fill in here replacing this statement with\n // your solution.\n throw new UnsupportedOperationException(\"Replace this\");\n }", "public void stopElevator(Elevator elevator) {\n\t\televatorManager.stopElevator(elevator);\n\t}", "public TypeOfLeave() {\n initComponents();\n }", "private UsineJoueur() {}", "private Fight() { }", "private CollisionLogic() {}", "@Override\n public boolean isInstantiable() {\n return false;\n }", "public Elevator(int id, int maximumLoad, int currentFloorId) {\n\t\tthis.id = id;\n\t\tthis.currentFloorId = currentFloorId;\n\t\tthis.doorStatus = ElevatorDoorStatus.CLOSED;\n\t\tthis.currentDirection = ElevatorStatus.STATIONARY;\n\t}", "private InterpreterDependencyChecks() {\r\n\t\t// Hides default constructor\r\n\t}", "private Elevator(ElevatorSpecs s, int[] f, int[] z, LinkedList<ElevatorQueueObject> q, \n LinkedList<Passenger> c, int w, float cf, BigInteger twt, BigInteger ttt,\n BigDecimal ttd, BigInteger ps) {\n specs = s;\n floors = f;\n queue = q;\n currentPassengers = c;\n waitingTime = w;\n currentFloor = cf;\n distancePerFloor = (float)specs.getBuildingHeight() / (float)specs.getFloors();\n totalWaitTime = twt;\n totalTravelTime = ttt;\n totalTravelDistance = ttd;\n passengersServed = ps;\n zonedFloors = z;\n }", "private FlyWithWings(){\n\t\t\n\t}", "public void unloadPassengers(Elevator ev1) throws ElevatorFullException\n { \n // Unload passengers from elevator\n\t//---------------------------------- \n int unloading= ev1.passengersForFloor(floorNum);\n ev1.unloadPassenger(unloading);\n System.out.println(\"unloaded \" + unloading + \" passenger(s).\");\n\n\n\t// If the passengers are unloading onto floor #1, we assume that\n\t// they'll leave the building once they exit the elevator.\n\t//--------------------------------------------------------------- \n\tif(floorNum != 1)\n\t{ occupants+= unloading;\n\t}\n\n\n\t// With the exception of passengers that were just unloaded, load\n\t// current floor occupants onto the elevator. According to the spec,\n\t// every occupant on a floor will be boarded with a destination of\n\t// baseFloor.\n\t//---------------------------------------------------------------------- \n\tint boarding= occupants - unloading;\n\tif(boarding > 0)\n\t{ for(int i=1; i<=boarding; i++)\n\t { try\n\t { ev1.boardPassenger(ev1.baseFloor);\n\t occupants--;\n }\n\t\tcatch (ElevatorFullException e)\n\t\t{ System.out.print(\"ElevatorFullException Caught:\");\n\t\t System.out.print(\" leaving \" + occupants + \" occupants on the floor; \");\n\t\t System.out.print(\" will return later.\\n\");\n\t\t i=boarding+1; //break out of boarding loop. \n\t\t}\n\t }\n }\n\n\n\t// For this simulation, we assume that all unloaded passengers will\n\t// be ready to leave the building on the next elevator run. Thus we\n\t// will signal the elevator to return for them.\n\t//--------------------------------------------------------------------- \n\tif(occupants >= 1)\n\t{ ev1.registerRequest(floorNum);\n\t}\n\n\n // show status of floor before proceeding.\n System.out.println(this);\n System.out.println(ev1 + \"\\n\");\n }", "private TedCorrigendumHandler() {\n throw new AssertionError();\n }", "private RestaurantManager() {\n }", "public ElevatorTask(Elevator elevator, int floorId, ElevatorRequestType type) {\n\t\tthis.elevator = elevator;\n\t\tthis.floorId = floorId;\n\t\tthis.type = type;\n\t}", "public HanoiTower(){\n\n }", "private Example() {\n\t\tthrow new Error(\"no instantiation is permitted\");\n\t}", "public WaiterAgent(String name, RestaurantGui gui, AStarTraversal aStar,\n\t\t Restaurant restaurant, Table[] tables) {\n\tsuper();\n\tthis.gui = gui;//main gui\n\tthis.name = name;\n\tthis.aStar = aStar;\n\tthis.restaurant = restaurant;//the layout for astar\n\twaiter = new Waiter(name.substring(0,2), new Color(255, 0, 0), restaurant);\n\t//currentPosition = new Position(3,13);\n\tcurrentPosition = new Position(waiter.getX(), waiter.getY());\n\tcurrentPosition.moveInto(aStar.getGrid());\n\toriginalPosition = currentPosition;//save this for moving into\n\tthis.tables = tables;\n\n\tString query =\n \"1 (?person)(and (person ?person)(hasname ?person \\\"\" + name+\"\\\"))\";\n loomInstance = PowerloomHelper.retrieve1(query);\n if (loomInstance!=null){\n PowerloomHelper.getloomMap().put(loomInstance, this);\n System.out.println(\"Found person in knowledge base: \" + loomInstance);\n }\n else {\n System.out.println(\"No waiter found. Instantiating...\");\n loomInstance = PowerloomHelper.instantiate(\"person\",this);//puts it in map\n\n String h = PowerloomHelper.instantiate(\"home\",null);\n query = \"(and (workingWaiter \" + loomInstance + \")\"\n +\"(haslocation \" +h+\" \"+gui.getneighborhoodInstance()\n +\") (lives \"+ loomInstance+\" \"+h+\")(hasname \"\n + loomInstance+\" \\\"\"+name+\"\\\"))\";\n print(\"asserting facts about new instance:\"+query);\n PLI.sAssertProposition(query, PowerloomHelper.getWorkingModule(), null);\n }\n\n }", "@SuppressWarnings(\"unused\")\n private Booking() {\n }", "public void stopElevators(){\n\t\tfor(int liftNum=0;liftNum<NUM_OF_ELEVATORS;liftNum++){\n\t\t\tlift[liftNum].stopElevator();\n\t\t}\n\t}", "private Alarms() {}" ]
[ "0.7113158", "0.6979307", "0.6836662", "0.66299915", "0.6477612", "0.6283978", "0.62791157", "0.6277008", "0.62382966", "0.62228113", "0.61681515", "0.61362916", "0.60709107", "0.59309167", "0.59078115", "0.58487433", "0.5804337", "0.57463384", "0.5688458", "0.56149286", "0.5597786", "0.55887806", "0.5576711", "0.5571927", "0.55571973", "0.5549494", "0.55464053", "0.5534094", "0.55286276", "0.5521951", "0.5506739", "0.5502222", "0.5502186", "0.5498802", "0.5464354", "0.54525006", "0.5449846", "0.542369", "0.54083526", "0.54082143", "0.540132", "0.53865755", "0.53746676", "0.5368947", "0.5367878", "0.53665185", "0.5358455", "0.5332107", "0.5320796", "0.5318156", "0.5311548", "0.53106713", "0.5302657", "0.5296996", "0.52946115", "0.5289943", "0.5277921", "0.5261173", "0.52564377", "0.52519566", "0.5242873", "0.5235541", "0.5227521", "0.5225214", "0.5224894", "0.5222446", "0.5218747", "0.5213576", "0.52097267", "0.5209359", "0.5208101", "0.5190478", "0.5175186", "0.51650965", "0.51640654", "0.5160537", "0.5157156", "0.5147131", "0.5138657", "0.513745", "0.5136078", "0.5128478", "0.51139355", "0.5113378", "0.5112116", "0.511187", "0.51094157", "0.50950515", "0.50922304", "0.5090422", "0.5090384", "0.5089919", "0.5079332", "0.5077566", "0.50767547", "0.50728005", "0.50644606", "0.50561064", "0.50546485", "0.50544196" ]
0.61818635
10
double angle = 41(voltage 2.5) + 21.9;
public void raise(){ elevatorTalon1.set(basePWM); elevatorTalon2.set(basePWM * pwmModifier); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "double getAngle();", "double getAngle();", "public double getAngle();", "public double getAngle() { return angle; }", "public void setAngle( double a ) { angle = a; }", "Angle createAngle();", "public double getAngle()\n {\n return (AngleAverage);\n }", "public float getXAngle(){\n Point project=new Point(0,accel.y,accel.z);\n\n float angl=(float)Math.asin(project.y / project.module())* PreferenceHelper.sensetivity;\n //float angl=(float)Math.acos(accel.z/accel.module())*100f;\n if(Float.isNaN(angl)) angl=0.5f;\n return (float)(Math.rint( toFlowX(angl)/1.0) * 1.0);\n }", "private double getRawAngle() {\n return (m_pot.getVoltage() / Constants.AIO_MAX_VOLTAGE) * Constants.Hood.POT_SCALE;\n }", "public double getAngle(){\n\t\treturn this.angle;\n\t}", "private int DirectionCalculation(int angle)\r\n\t{\t\r\n\t\treturn (int) ((angle/14.28)+1); //Angle divided by (100/(parts-1)) = 1-8\r\n\t}", "public double getAngle() {\n return angle;\n }", "public double getAngle() {\n return angle;\n }", "public int getAngle() {\r\n return angle;\r\n }", "double getAngle(int id);", "private double getAngle() {\n double normal= Math.sqrt(((getgAxis(ADXL345_I2C.Axes.kX))*(getgAxis(ADXL345_I2C.Axes.kX)))+((getgAxis(ADXL345_I2C.Axes.kY))*(getgAxis(ADXL345_I2C.Axes.kY))));\n\n return MathUtils.atan(normal / getgAxis(ADXL345_I2C.Axes.kZ));\n }", "double getCalibratedLevelAngle();", "public double getAngle ()\n {\n return angle_;\n }", "public double angleTo(Point point){\n \treturn facingVector.angleDegrees(vectorTo(point));\n }", "public int getAngle(){\n\t\treturn (int)angle;\n\t}", "public double toAngle()\n\t{\n\t\treturn Math.toDegrees(Math.atan2(y, x));\n\t}", "private float calculateAngle() {\r\n\r\n\t\tdouble angleTemp = Math.atan2(Target.getY() - y, Target.getX() - x);\r\n\t\t// I needed to use wikipedia to get this i\r\n\t\t// did not learn this in math and needed\r\n\t\t// to use a couplle youtube tutorials to\r\n\t\t// find out how to do the math in java\r\n\t\t// aswell thank fully one had the exact\r\n\t\t// way of doing this\r\n\t\treturn (float) Math.toDegrees(angleTemp) + 90;\r\n\t}", "public double nextAngle()\n {\n return nextAngle();\n }", "EDataType getAngleDegrees();", "public float calculateCelestialAngle(long par1, float par3)\n {\n return 0.5F;\n }", "public double getAngle() {\n\t\treturn angle;\n\t}", "public double getAngle() {\n\t\treturn angle;\n\t}", "public double getMyAngle() {\n return myAngle- STARTING_ANGLE;\n }", "public float getAngle() {\n return angle;\n }", "void setAngle(double angle);", "public double betweenAngle(Coordinates a, Coordinates b, Coordinates origin);", "public double getAngle() {\n\t\treturn navx.getAngle();\n\t}", "private double degToRadian(double angle)\n\t{\n\t\treturn angle/180*Math.PI;\n\t}", "public double getAngle() {\n\t\treturn this.position[2];\n\t}", "public int getAngle() {\r\n\t\treturn angle;\r\n\t}", "public int getCurrentAngle(){\n return flatbed.currentAngle;\n }", "double adjust_angle_rotation(double angle) {\n double temp;\n temp=angle;\n if(temp>90) {\n temp=180-temp;\n }\n return temp;\n }", "@Test\r\n public void testCalculateAngle1() {\r\n System.out.println(\"calculateAngle1\");\r\n DialDraw instance = new TachometerDraw();\r\n instance.setValue(36);\r\n double expResult = Math.toRadians(115.2);\r\n double result = instance.calculateAngle();\r\n assertEquals(result, expResult, 0.0001);\r\n }", "public double getStartAngle();", "private double getAngle(){\n //Get a new angle measurement\n angles = imu.getAngularOrientation(AxesReference.INTRINSIC, AxesOrder.ZYX, AngleUnit.DEGREES);\n //Get the difference between current angle measurement and last angle measurement\n double deltaAngle = angles.firstAngle - lastAngles.firstAngle;\n\n //Process the angle to keep it within (-180,180)\n //(Once angle passes +180, it will rollback to -179, and vice versa)\n if (deltaAngle < -180)\n deltaAngle += 360;\n else if (deltaAngle > 180)\n deltaAngle -= 360;\n\n //Add the change in angle since last measurement (deltaAngle)\n //to the change in angle since last reset (globalAngle)\n globalAngle += deltaAngle;\n //Set last angle measurement to current angle measurement\n lastAngles = angles;\n\n return globalAngle;\n }", "public double getAngle() {\n\t\treturn armMotor.getEncPosition();\n\t}", "public float getAngle() {\n return angle;\n }", "public double ang()\n {\n \treturn Math.atan(y/x);\n }", "public double getAngle() {\n\t\treturn 180 * (this.N - 2) / this.N;\n\t}", "public static double rotation()\r\n\t{\r\n\t\treturn -(mxp.getAngle()/45);\r\n\t}", "public double angle() {\n return Math.atan2(_y,_x);\n }", "@Test\r\n public void testCalculateAngle4() {\r\n System.out.println(\"calculateAngle4\");\r\n DialDraw instance = new TachometerDraw();\r\n instance.setValue(90);\r\n double expResult = Math.toRadians(18);\r\n double result = instance.calculateAngle();\r\n assertEquals(result, expResult, 0.0001);\r\n }", "@Override\n\tpublic float calculateCelestialAngle(long par1, float par3) {\n\t\treturn 2.0F;\n\t}", "public double getAngle() {\n\treturn CVector.heading(v1, v2);\n }", "public void rotateToAngle(double angle) {\n controlState = ControlState.POSITION;\n outputPosition = -angle * TurretConstants.TICKS_PER_DEGREE;\n }", "public static double getAngle() {\n return NetworkTableInstance.getDefault().getTable(\"limelight\").getEntry(\"ts\").getDouble(0);\n }", "public double betweenAngle(Coordinates vectorA, Coordinates vectorB);", "void setAngle(int id, double value);", "public void setAngle(float angle){\n\n\t}", "public float getAngle() {\n if(vectorAngle < 0 )\n return (float) Math.toDegrees(Math.atan(longComponent / latComponent));\n else\n return vectorAngle;\n\n }", "public abstract void steer(double angle);", "public double getAngle() {\n if (r == 0) {\n if (i == 0)\n return 0;// error?\n if (i > 0)\n return p2;\n else\n return -p2;\n }\n double d = Math.atan(i / r);\n if (r >= 0) {\n return d;\n }\n if (i >= 0)\n return Math.PI + d;\n return d + Math.PI;\n }", "public double getAngle () {\n return super.getAngle() % 360D;\n }", "@Override\n public void reAngle() {\n }", "public float calculateCelestialAngle(long par1, float par3) {\n\t\treturn 0.0F;\n\t}", "private double getAngle()\n {\n Orientation angles = imu.getAngularOrientation(AxesReference.INTRINSIC, AxesOrder.ZYX, AngleUnit.DEGREES);\n return angles.firstAngle;\n }", "public void goToAngle(){\n currentAngle = getAverageVoltage2(); \r\n if (Math.abs(elevationTarget - currentAngle) <= .1){//TODO: check angle\r\n off();\r\n // System.out.println(\"off\");\r\n } else if (elevationTarget > currentAngle && elevationTarget < maxLimit){\r\n raise();\r\n //System.out.println(\"raise\");\r\n } else if (elevationTarget < currentAngle && elevationTarget > minLimit){\r\n //System.out.println(\"lower\");\r\n } \r\n \r\n }", "public double getGyroAngle() {\n double[] ypr = new double[3];\n gyro.GetYawPitchRoll(ypr);\n return ypr[0];\n }", "private double getAngle(double y, double x) {\n\t\tdouble angle = Math.atan2(y, x);\n\t\tif (angle < 0)\n\t\t\tangle += 2 * Math.PI;\n\t\treturn angle;\n\t}", "@Test\r\n public void testCalculateAngle2() {\r\n System.out.println(\"calculateAngle2\");\r\n DialDraw instance = new TachometerDraw();\r\n instance.setValue(0);\r\n double expResult = Math.toRadians(180);\r\n double result = instance.calculateAngle();\r\n assertEquals(result, expResult, 0.0001);\r\n }", "void getAngles(double[] values);", "@Test\r\n public void testCalculateAngle5() {\r\n System.out.println(\"calculateAngle5\");\r\n DialDraw instance = new TachometerDraw();\r\n instance.setValue(50);\r\n double expResult = Math.toRadians(90);\r\n double result = instance.calculateAngle();\r\n assertEquals(result, expResult, 0.0001);\r\n }", "public double findAngle() {\n return 0d;\n }", "public void setAngle(double a) {\n\t\tangle= a;\n\t}", "float getWindingConnectionAngle();", "public double angle()\n {\n return Math.atan2(this.y, this.x);\n }", "public double getDistance(){\n return sensor.getVoltage()*100/2.54 - 12;\n }", "public String polarRotation(double angle, double newAngle)\n {\n angle = angle + newAngle;\n \n String str = \"Rotated polar point:\" + angle;\n return str;\n }", "public static double angle(ThreeVector v1,ThreeVector v2) {\r\n\t\tdouble a = (scalarProduct(v1,v2))/(v1.magnitude()*v2.magnitude());\r\n\t\tdouble b = Math.acos(a);\r\n\t\treturn Math.toDegrees(b);\r\n\t}", "public void rotate(float angle);", "public static int vectorAngle(Point p) {\n \treturn (Math.round((float)Math.toDegrees(Math.atan2(p.x, p.y))));\n\t}", "public double getAngle() {\n return Math.atan2(sinTheta, cosTheta);\n }", "@Override\n public void onSensorChanged(SensorEvent event) {\n theta = (float) Math.toDegrees(Math.atan(event.values[1] / event.values[2]));\n\n\n }", "public static int convertAngle(double angle) {\n // Using convertDistance method to calculate constant rotation of the robot + scaling\n return convertDistance((Math.PI * BASE_WIDTH * angle / 360.0) * 100) / 100;\n }", "public int getGyroAngle() {\r\n \treturn (int)Math.round(gyro.getAngle());\r\n }", "public double angle(int i)\n {\n return PdVector.angle(get(i), get((i + 1) % 3), get((i + 2) % 3)) * (Math.PI / 180);\n }", "public double getAngleYZ() {\r\n\t\tdouble l = this.lenght();\r\n\t\tif (l==0)\r\n\t\t\treturn 0;\r\n\t\treturn Math.asin(this.x/l);\r\n\t}", "public int getAngle(){\n\t\tif(!resetCoordinates()&&robot.imu1.isGyroCalibrated()){\n\t\t\trobot.angles=robot.imu1.getAngularOrientation(AxesReference.INTRINSIC, AxesOrder.ZYX, AngleUnit.DEGREES);\n\t\t\tdouble currentAngle=robot.angles.firstAngle;\n\t\t\tint finalAngle= robot.startingAngle+(int)Math.round(currentAngle);\n\t\t\tif(finalAngle<0){\n\t\t\t\treturn 360+finalAngle;\n\t\t\t}\n\t\t\treturn finalAngle;\n\n\t\t}\n\t\telse if(!resetCoordinates()&&robot.imu.isGyroCalibrated()){\n\t\t\trobot.angles=robot.imu.getAngularOrientation(AxesReference.INTRINSIC, AxesOrder.YZX, AngleUnit.DEGREES);\n\t\t\tdouble currentAngle=robot.angles.firstAngle;\n\t\t\tint finalAngle= robot.startingAngle+(int)Math.round(currentAngle);\n\t\t\tif(finalAngle<0){\n\t\t\t\treturn 360+finalAngle;\n\t\t\t}\n\t\t\treturn finalAngle;\n\n\t\t}\n\t\telse if(resetCoordinates()){\n\t\t\tdouble oldAngle = robot.rotation.thirdAngle;\n\t\t\tdouble posAngle = oldAngle;\n\t\t\tint finalAngle;\n\t\t\tif (oldAngle < 0) posAngle = 360 - Math.abs(oldAngle);\n\t\t\tif((int) (Math.round(posAngle)) - 45 < 0){\n\t\t\t\tfinalAngle = 360-(int)Math.round(posAngle);\n\t\t\t}\n\t\t\telse{\n\t\t\t\tfinalAngle = (int) (Math.round(posAngle)) - 45;\n\t\t\t}\n\t\t\treturn finalAngle;\n\t\t}\n\t\telse{\n\t\t\treturn 10000;\n\t\t}\n\t}", "AngleResource inclination();", "public double getAngleXY() {\r\n\t\tdouble l = this.lenght();\r\n\t\tif (l==0)\r\n\t\t\treturn 0;\r\n\t\treturn Math.asin(this.z/l);\r\n\t}", "AngleSmaller createAngleSmaller();", "public float getAngle() {\n return mAngle;\n }", "@Test\r\n public void testCalculateAngle3() {\r\n System.out.println(\"calculateAngle3\");\r\n DialDraw instance = new TachometerDraw();\r\n instance.setValue(100);\r\n double expResult = Math.toRadians(0);\r\n double result = instance.calculateAngle();\r\n assertEquals(result, expResult, 0.0001);\r\n }", "public static double convertAngle(double angle) {\n // Reuse convertDistance() for calculating correct angle\n return convertDistance(Math.PI * BASE_WIDTH * angle / 360.0);\n }", "public static double getAngle( GameObject one, GameObject two )\n {\n return Math.atan2( getDeltaY( one, two ), +getDeltaX( one, two ) );\n }", "double getVelComp(double vel, double angle)\n {\n angle = Math.toRadians(angle);\n double cos = Math.cos(angle);\n double sin = Math.sin(angle);\n ux = vel*cos;\n uy = vel*sin;\n this.angle = angle; \n return ux;\n }", "public void calculateAngleAndRotate(){\n\t\tdouble cumarea = 0;\n\t\tdouble sina = 0;\n\t\tdouble cosa = 0;\n\t\tdouble area, angle;\n\t\tfor (int n = 0; n < rt.size();n++) {\n\t\t\tarea = rt.getValueAsDouble(rt.getColumnIndex(\"Area\"),n);\n\t\t\tangle = 2*rt.getValueAsDouble(rt.getColumnIndex(\"Angle\"),n);\n\t\t\tsina = sina + area*Math.sin(angle*Math.PI/180);\n\t\t\tcosa = cosa + area*Math.cos(angle*Math.PI/180);\n\t\t\tcumarea = cumarea+area;\n\t\t}\n\t\taverageangle = Math.abs(0.5*(180/Math.PI)*Math.atan2(sina/cumarea,cosa/cumarea)); // this is the area weighted average angle\n\t\t// rotate the data \n\t\tIJ.run(ActiveImage,\"Select All\",\"\");\n\t\tActiveImageConverter.convertToGray32();\n\t\tIJ.run(ActiveImage,\"Macro...\", \"code=[v= x*sin(PI/180*\"+averageangle+\")+y*cos(PI/180*\"+averageangle+\")]\");\n\t\treturn;\n\t}", "public void updateAngle(){\n\t\tif (turnUp && (angle < 180) ){\n\t\t\tangle+=1;\n\t\t}\n\t\tif (turnDown && (angle > 0)){\n\t\t\tangle-=1;\n\t\t}\n\t}", "public double getAngle() {\n try {\n switch(Coordinates.angleUnit()) {\n case Coordinates.RADIAN:\n\treturn Double.parseDouble(deg.getText().trim());\n case Coordinates.DEGRE:\n\treturn Math.PI * Double.parseDouble(deg.getText().trim()) / 180.0;\n case Coordinates.DEGMN:\n\tString d = deg.getText().trim();\n\tif(d.length() == 0)\n\t d = \"0\";\n\tString m = mn.getText().trim();\n\tif(m.length() == 0)\n\t m = \"0\";\n\treturn Coordinates.parseAngle(d + \"11\" + m + \"'\");\n case Coordinates.DEGMNSEC:\n\td = deg.getText().trim();\n\tif(d.length() == 0)\n\t d = \"0\";\n\tm = mn.getText().trim();\n\tif(m.length() == 0)\n\t m = \"0\";\n\tString s = sec.getText().trim();\n\tif(s.length() == 0)\n\t s = \"0\";\n\treturn Coordinates.parseAngle(d + \"11\" + m + \"'\" + s + \"\\\"\");\n }\n }\n catch(NumberFormatException e) {\n }\n return 0.0;\n }", "public int calculatePWMfromAngle(double angle) {\n return (int) restrict((angle + 1.04)/.00180, min, max);\n }", "private double getPolarAngle(double refX, double refY, double px, double py) {\n\t\tdouble tethaRadian = -1;\n\t\tif ((px - refX) > 0 && (refY - py) >= 0) {\n\t\t\ttethaRadian = Math.atan((refY - py) / (px - refX));\n\t\t} else if ((px - refX) > 0 && (refY - py) < 0) {\n\t\t\ttethaRadian = Math.atan((refY - py) / (px - refX)) + 2 * Math.PI;\n\t\t} else if ((px - refX) < 0) {\n\t\t\ttethaRadian = Math.atan((refY - py) / (px - refX)) + Math.PI;\n\t\t} else if ((px - refX) == 0 && (refY - py) > 0) {\n\t\t\ttethaRadian = Math.PI / 2;\n\t\t} else if ((px - refX) == 0 && (refY - py) < 0) {\n\t\t\ttethaRadian = 3 * Math.PI / 2;\n\t\t}\n\t\treturn tethaRadian;\n\t}", "public static double reverseAngle(double angle) {\n return 180 - angle;\n }", "Point rotate (double angle);", "private int getAngle(int amountOfCars) {\n\t\tint total = model.getNumberOfFloors() * model.getNumberOfRows() * model.getNumberOfPlaces();\n\t\tdouble angle = 1.0 * (double) amountOfCars / (double) total * 360.0;\n\t\treturn (int) angle;\n\t}", "public AccOrientation calculateAngle(SensorEvent event) {\t\t\n\t final int _DATA_X = 0;\n\t final int _DATA_Y = 1;\n\t final int _DATA_Z = 2;\n\t // Angle around x-axis thats considered almost perfect vertical to hold\n\t // the device\n\t final int PIVOT = 20;\n\t // Angle around x-asis that's considered almost too vertical. Beyond\n\t // this angle will not result in any orientation changes. f phone faces uses,\n\t // the device is leaning backward.\n\t final int PIVOT_UPPER = 65;\n\t // Angle about x-axis that's considered negative vertical. Beyond this\n\t // angle will not result in any orientation changes. If phone faces uses,\n\t // the device is leaning forward.\n\t final int PIVOT_LOWER = -10;\n\t // Upper threshold limit for switching from portrait to landscape\n\t final int PL_UPPER = 295;\n\t // Lower threshold limit for switching from landscape to portrait\n\t final int LP_LOWER = 320;\n\t // Lower threshold limt for switching from portrait to landscape\n\t final int PL_LOWER = 270;\n\t // Upper threshold limit for switching from landscape to portrait\n\t final int LP_UPPER = 359;\n\t // Minimum angle which is considered landscape\n\t final int LANDSCAPE_LOWER = 235;\n\t // Minimum angle which is considered portrait\n\t final int PORTRAIT_LOWER = 60;\n\t \n\t // Internal value used for calculating linear variant\n\t final float PL_LF_UPPER =\n\t ((float)(PL_UPPER-PL_LOWER))/((float)(PIVOT_UPPER-PIVOT));\n\t final float PL_LF_LOWER =\n\t ((float)(PL_UPPER-PL_LOWER))/((float)(PIVOT-PIVOT_LOWER));\n\t // Internal value used for calculating linear variant\n\t final float LP_LF_UPPER =\n\t ((float)(LP_UPPER - LP_LOWER))/((float)(PIVOT_UPPER-PIVOT));\n\t final float LP_LF_LOWER =\n\t ((float)(LP_UPPER - LP_LOWER))/((float)(PIVOT-PIVOT_LOWER));\n\t \n\t int mSensorRotation = -1; \n\t \n\t\t\tfinal boolean VERBOSE = true;\n float[] values = event.values;\n float X = values[_DATA_X];\n float Y = values[_DATA_Y];\n float Z = values[_DATA_Z];\n float OneEightyOverPi = 57.29577957855f;\n float gravity = (float) Math.sqrt(X*X+Y*Y+Z*Z);\n float zyangle = (float)Math.asin(Z/gravity)*OneEightyOverPi;\n int rotation = -1;\n float angle = (float)Math.atan2(Y, -X) * OneEightyOverPi;\n int orientation = 90 - (int)Math.round(angle);\n AccOrientation result = new AccOrientation();\n \n while (orientation >= 360) {\n orientation -= 360;\n } \n while (orientation < 0) {\n orientation += 360;\n }\n result.orientation = orientation;\n result.angle = zyangle; \n result.threshold = 0;\n if ((zyangle <= PIVOT_UPPER) && (zyangle >= PIVOT_LOWER)) {\n // Check orientation only if the phone is flat enough\n // Don't trust the angle if the magnitude is small compared to the y value\n \t/*\n float angle = (float)Math.atan2(Y, -X) * OneEightyOverPi;\n int orientation = 90 - (int)Math.round(angle);\n normalize to 0 - 359 range\n while (orientation >= 360) {\n orientation -= 360;\n } \n while (orientation < 0) {\n orientation += 360;\n }\n mOrientation.setText(String.format(\"Orientation: %d\", orientation));\n */ \n // Orientation values between LANDSCAPE_LOWER and PL_LOWER\n // are considered landscape.\n // Ignore orientation values between 0 and LANDSCAPE_LOWER\n // For orientation values between LP_UPPER and PL_LOWER,\n // the threshold gets set linearly around PIVOT.\n if ((orientation >= PL_LOWER) && (orientation <= LP_UPPER)) {\n float threshold;\n float delta = zyangle - PIVOT;\n if (mSensorRotation == ROTATION_090) {\n if (delta < 0) {\n // Delta is negative\n threshold = LP_LOWER - (LP_LF_LOWER * delta);\n } else {\n threshold = LP_LOWER + (LP_LF_UPPER * delta);\n }\n rotation = (orientation >= threshold) ? ROTATION_000 : ROTATION_090;\n if (mShowLog) \n \tLog.v(TAG, String.format(\"CASE1. %2.4f %d %2.4f %d\", delta, orientation, threshold, rotation));\n } else {\n if (delta < 0) {\n // Delta is negative\n threshold = PL_UPPER+(PL_LF_LOWER * delta);\n } else {\n threshold = PL_UPPER-(PL_LF_UPPER * delta);\n }\n rotation = (orientation <= threshold) ? ROTATION_090: ROTATION_000;\n if (mShowLog)\n \tLog.v(TAG, String.format(\"CASE2. %2.4f %d %2.4f %d\", delta, orientation, threshold, rotation));\n }\n result.threshold = threshold;\n } else if ((orientation >= LANDSCAPE_LOWER) && (orientation < LP_LOWER)) {\n rotation = ROTATION_090;\n if (mShowLog)\n \tLog.v(TAG, String.format(\"CASE3. 90 (%d)\", orientation));\n } else if ((orientation >= PL_UPPER) || (orientation <= PORTRAIT_LOWER)) {\n rotation = ROTATION_000;\n if (mShowLog)\n \tLog.v(TAG, String.format(\"CASE4. 00 (%d)\", orientation)); \n } else {\n \tif (mShowLog)\n \t\tLog.v(TAG, \"CASE5. \"+orientation);\n }\n if ((rotation != -1) && (rotation != mSensorRotation)) {\n mSensorRotation = rotation;\n if (mSensorRotation == ROTATION_000) {\n \t\t//setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_PORTRAIT);\n \tif (mShowLog)\n \t\tLog.w(TAG, \"Rotation: 00\");\n }\n else if (mSensorRotation == ROTATION_090) \n {\n \t\t//setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE);\n \tif (mShowLog)\n \t\tLog.w(TAG, \"Rotation: 90\");\n } \n }\n result.rotation = rotation;\n } else {\n \t//Log.v(TAG, String.format(\"Invalid Z-Angle: %2.4f (%d %d)\", zyangle, PIVOT_LOWER, PIVOT_UPPER));\n }\t\n return result;\n\t\t}", "public double angle(final Vec4 o) {\n return Math.asin(Math.sqrt(normalized().cross(o.normalized()).lengthSq()));\n }" ]
[ "0.76924956", "0.76924956", "0.75361204", "0.72229415", "0.7133982", "0.70445997", "0.6908647", "0.6899063", "0.68352973", "0.67860734", "0.6756129", "0.67514956", "0.67514956", "0.6742802", "0.67391866", "0.67205966", "0.66889113", "0.668849", "0.6686682", "0.6678265", "0.66664404", "0.6639367", "0.66180784", "0.6606123", "0.66055113", "0.66010183", "0.66010183", "0.6597791", "0.65917605", "0.6580423", "0.65720695", "0.6563702", "0.65594614", "0.65277416", "0.65254295", "0.6503594", "0.64853376", "0.64793676", "0.6460057", "0.6447138", "0.64454556", "0.64379704", "0.6425895", "0.6424719", "0.64158374", "0.63990176", "0.6385869", "0.6383689", "0.6365228", "0.63445026", "0.63337314", "0.63216", "0.6301799", "0.63015103", "0.62984174", "0.62967825", "0.6296522", "0.6289189", "0.62851727", "0.62836707", "0.62808263", "0.627995", "0.62562513", "0.6254839", "0.62484354", "0.6226434", "0.6226128", "0.62255895", "0.62217414", "0.6210388", "0.6206862", "0.619479", "0.6191106", "0.6188603", "0.61733997", "0.61700964", "0.61691374", "0.61647254", "0.6154072", "0.61498487", "0.6144916", "0.61317456", "0.61225426", "0.61131656", "0.611294", "0.61093384", "0.61046076", "0.61035067", "0.6099106", "0.60977566", "0.60967106", "0.6089406", "0.6086867", "0.60728437", "0.6047104", "0.60379463", "0.6026779", "0.6022303", "0.6022169", "0.6020802", "0.6016391" ]
0.0
-1
need to evaluate buffer(arraysize)
public void createDataSet(){ final Thread thread = new Thread(new Runnable() { public void run(){ while(true){//we want this running always, it is ok running while robot is disabled. whileCount++; currentVoltage = angleMeter.getVoltage(); //gets the non-average voltage of the sensor runningTotalVoltage[currentIndex] = currentVoltage;//store the new data point currentIndex = (currentIndex + 1) % arraySize;//currentIndex is the index to be changed if (bufferCount < arraySize) { bufferCount++;//checks to see if the array is full of data points } } } }); thread.start(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected abstract int getNextBufferSize(E[] paramArrayOfE);", "int getBufferSize();", "long arrayLength();", "public int size() { return buffer.length; }", "byte [] getBuffer ();", "public abstract int sizeOf(byte[] array, int offset, int length);", "public int getBufferSize() {\n return count;\n }", "protected int populateBuffer()\n {\n interlock.beginReading();\n // System.out.println(\"populateBuffer: 2\");\n return byteBuffer.limit();\n }", "public static native int Capacity(long lpjFbxArrayVector2);", "public int getBufferSize() {\n\t\treturn 0;\n\t}", "int getArrayLength();", "int getArrayLength();", "protected abstract void getAtLeastBytes(ByteBuffer inputBuffer, int len) throws IOException;", "public int bufferSize(int arrayLength) {\r\n return arrayLength * (precision.isDouble() ? Sizeof.cl_double : Sizeof.cl_float); \r\n }", "abstract public Buffer createBufferFromData(byte[] data, int size);", "public int arraySize();", "@Override\n public int getBufferSize() {\n return 0;\n }", "public int getBufferSize() {\n\t\treturn buffer.length;\n\t}", "int fixedSize();", "boolean isFull() {return pointer==size;}", "private int getBufferWidth() {\n\t\treturn this.f2[0].length;\n\t}", "@Override\n\tpublic int getBufferSize() {\n\t\treturn 0;\n\t}", "long[] getBuffer() {\n\t\treturn buffer;\n\t}", "private int loadData() {\n if (position >= numRecords * 2)\n return -1;\n int bufferPos = 0;\n int capacity = byteBuffer.capacity();\n while (bufferPos < capacity && position < numRecords * 2) {\n long curRecordAddress = sortedArray.get(position);\n int recordLen = Platform.getInt(null, curRecordAddress);\n // length + keyprefix + record length\n int length = Integer.BYTES + Long.BYTES + recordLen;\n if (length > capacity) {\n logger.error(\"single record size exceeds PMem read buffer. Please increase buffer size.\");\n }\n if (bufferPos + length <= capacity) {\n long curKeyPrefix = sortedArray.get(position + 1);\n if (length > bytes.length) {\n bytes = new byte[length];\n }\n Platform.putLong(bytes, Platform.BYTE_ARRAY_OFFSET, curKeyPrefix);\n Platform.copyMemory(null, curRecordAddress, bytes, Platform.BYTE_ARRAY_OFFSET + Long.BYTES, length - Long.BYTES);\n byteBuffer.put(bytes, 0, length);\n bufferPos += length;\n position += 2;\n } else {\n break;\n }\n }\n return bufferPos;\n }", "short getQ( byte[] buffer, short offset );", "int getBytesInBufferAvailable() {\n if (this.count == this.pos) return 0;\n else return this.buf.length - this.pos;\n }", "protected abstract long getCurrentBufferCapacity(long paramLong);", "public static IntBuffer createIntBuffer(int size) {\n/* 477 */ ByteBuffer temp = ByteBuffer.allocateDirect(4 * size);\n/* 478 */ temp.order(ByteOrder.nativeOrder());\n/* */ \n/* 480 */ return temp.asIntBuffer();\n/* */ }", "Buffer slice();", "UINT SafeArrayGetElemsize(SAFEARRAY psa);", "private E[] getNextBuffer(E[] buffer, long mask)\r\n/* 187: */ {\r\n/* 188:438 */ long offset = nextArrayOffset(mask);\r\n/* 189:439 */ E[] nextBuffer = (Object[])UnsafeRefArrayAccess.lvElement(buffer, offset);\r\n/* 190:440 */ UnsafeRefArrayAccess.soElement(buffer, offset, null);\r\n/* 191:441 */ return nextBuffer;\r\n/* 192: */ }", "public long length() {\r\n return 1 + 4 + buffer.length;\r\n }", "private final byte[] readBuffer( int size ) throws IOException {\n byte[] buffer = new byte[ size ];\n\n int read = 0;\n while ( read < size ) {\n int next = dataSource.read( buffer, read, size - read );\n if ( next < 0 ) throw new IOException( \"End of Stream\" );\n read += next;\n\t}\n return buffer;\n }", "public static void bufferoverflowExample() {\n\t\tint[] intArray = new int[5];\n\t\tfor(int i = 0 ;i < 10 ; i++) \n\t\t{\n\t\t\tintArray[i] = i++;\n\t\t\tSystem.out.println(\"value of intArray[i] = \" + intArray[i]);\n\t\t}\n\t}", "public void testNIO_byte_array() throws Exception {\n byteBufferTest(ByteBuffer.allocate(12));\n }", "CharArrayBuffer getBuffer()\n ;", "public static native int Size(long lpjFbxArrayVector2);", "public float getSize() {\n return bufSize;\n }", "public boolean verifyBuffer(Buffer buffer) {\n if (buffer.isDiscard()) {\n return true;\n }\n Object data = buffer.getData();\n if (buffer.getLength() < 0) {\n System.err.println(\"warning: data length shouldn't be negative: \" + buffer.getLength());\n }\n if (data == null) {\n System.err.println(\"warning: data buffer is null\");\n if (buffer.getLength() != 0) {\n System.err.println(\"buffer advertized length = \" + buffer.getLength() + \" but data buffer is null!\");\n return false;\n }\n } else if (data instanceof byte[]) {\n if (buffer.getLength() > ((byte[]) data).length) {\n System.err.println(\"buffer advertized length = \" + buffer.getLength() + \" but actual length = \" + ((byte[]) data).length);\n return false;\n }\n } else if ((data instanceof int[]) && buffer.getLength() > ((int[]) data).length) {\n System.err.println(\"buffer advertized length = \" + buffer.getLength() + \" but actual length = \" + ((int[]) data).length);\n return false;\n }\n return true;\n }", "private E newBufferPoll(E[] nextBuffer, long index)\r\n/* 200: */ {\r\n/* 201:451 */ long offset = newBufferAndOffset(nextBuffer, index);\r\n/* 202:452 */ E n = UnsafeRefArrayAccess.lvElement(nextBuffer, offset);\r\n/* 203:453 */ if (n == null) {\r\n/* 204:455 */ throw new IllegalStateException(\"new buffer must have at least one element\");\r\n/* 205: */ }\r\n/* 206:457 */ UnsafeRefArrayAccess.soElement(nextBuffer, offset, null);\r\n/* 207:458 */ soConsumerIndex(index + 2L);\r\n/* 208:459 */ return n;\r\n/* 209: */ }", "protected int getArraySize(){\r\n\t \treturn numElems;\r\n\t \t//return arraySize;\r\n\t }", "public int getTrueSize() {\n int len = ArrayFuncs.computeSize(dataArray);\n return len;\n }", "public int length(){ return this.isUpgraded ? this.linkArray.length() : this.nativeArray.size(); }", "public void testNIO_int_array() throws Exception {\n int[] intArray = new int[8];\n IntBuffer ib = IntBuffer.wrap(intArray);\n intBufferTest(ib);\n }", "float getSize(float[] sizes);", "int getLocalSize();", "private int getBufferHeight() {\n\t\treturn this.f2.length;\n\t}", "public int getLength(){\r\n\t \treturn arraySize;\r\n\t }", "public byte[] getBuffer( int size )\n {\n byte [] result = null;\n \n if (size < 0)\n {\n throw new INTERNAL (\"Unable to cache and create buffer of negative size. Possible overflow issue.\");\n }\n \n final int log = calcLog(size);\n \n if (log > maxManagedBufferSize)\n {\n try\n {\n if (time < 0)\n {\n // Defaults to returning asked for size\n result = new byte[size];\n }\n else\n {\n synchronized(this)\n {\n // Using cache so do below determination\n if (bufferMax == null || bufferMax.length < size)\n {\n // Autocache really large values for speed\n bufferMax = new byte[size];\n }\n // Else return the cached buffer\n result = bufferMax;\n bufferMax = null;\n }\n }\n }\n catch (OutOfMemoryError e)\n {\n throw new NO_MEMORY(e.toString());\n }\n }\n else\n {\n int index = (log > MIN_CACHE ? log - MIN_CACHE : 0);\n final Collection s = bufferPool[index];\n result = doFetchBuffer(s);\n \n if (result == null)\n {\n // .. = 1 << MIN_CACHE + 1\n // 64 = 1 << 5 + 1\n // 128 = 1 << 6 + 1\n // 255 = 1 << 7 + 1\n // 512 = 1 << 8 + 1\n // 1024 = 1 << 9 + 1\n // 2048 = 1 << 10 + 1\n result = new byte[ ( log > MIN_CACHE ? 1 << log + 1 : 1024 ) - 1];\n }\n }\n return result;\n }", "public int getSize() {\r\n return array.length;\r\n }", "protected abstract Buffer doCreateBuffer(int size)\n throws BadParameterException, NoSuccessException;", "private char[] size() {\n\t\treturn null;\n\t}", "int sizeOfTrafficVolumeArray();", "@Override\n public void setBufferSize(int arg0) {\n\n }", "private static int getBytes(long r23) {\n /*\n java.lang.ThreadLocal<byte[]> r0 = TEMP_NUMBER_BUFFER\n java.lang.Object r0 = r0.get()\n byte[] r0 = (byte[]) r0\n r1 = 20\n if (r0 != 0) goto L_0x0013\n byte[] r0 = new byte[r1]\n java.lang.ThreadLocal<byte[]> r2 = TEMP_NUMBER_BUFFER\n r2.set(r0)\n L_0x0013:\n r2 = -9223372036854775808\n r4 = 54\n r5 = 57\n r6 = 45\n r7 = 53\n r8 = 56\n r9 = 55\n r10 = 51\n r11 = 50\n r12 = 0\n r13 = 48\n r14 = 1\n int r15 = (r23 > r2 ? 1 : (r23 == r2 ? 0 : -1))\n if (r15 != 0) goto L_0x0076\n r0[r12] = r6\n r0[r14] = r5\n r2 = 2\n r0[r2] = r11\n r2 = 3\n r0[r2] = r11\n r2 = 4\n r0[r2] = r10\n r2 = 5\n r0[r2] = r10\n r2 = 6\n r0[r2] = r9\n r2 = 7\n r0[r2] = r11\n r2 = 8\n r0[r2] = r13\n r2 = 9\n r0[r2] = r10\n r2 = 10\n r0[r2] = r4\n r2 = 11\n r0[r2] = r8\n r2 = 12\n r0[r2] = r7\n r2 = 13\n r3 = 52\n r0[r2] = r3\n r2 = 14\n r0[r2] = r9\n r2 = 15\n r0[r2] = r9\n r2 = 16\n r0[r2] = r7\n r2 = 17\n r0[r2] = r8\n r2 = 18\n r0[r2] = r13\n r2 = 19\n r0[r2] = r8\n return r1\n L_0x0076:\n r1 = 0\n int r3 = (r23 > r1 ? 1 : (r23 == r1 ? 0 : -1))\n if (r3 != 0) goto L_0x007f\n r0[r12] = r13\n return r14\n L_0x007f:\n if (r3 >= 0) goto L_0x0088\n r0[r12] = r6\n long r15 = java.lang.Math.abs(r23)\n goto L_0x008b\n L_0x0088:\n r14 = 0\n r15 = r23\n L_0x008b:\n r17 = 9\n r19 = 10\n r21 = 1\n int r3 = (r15 > r17 ? 1 : (r15 == r17 ? 0 : -1))\n if (r3 > 0) goto L_0x0099\n r17 = r21\n goto L_0x017e\n L_0x0099:\n r17 = 99\n int r3 = (r15 > r17 ? 1 : (r15 == r17 ? 0 : -1))\n if (r3 > 0) goto L_0x00a3\n r17 = r19\n goto L_0x017e\n L_0x00a3:\n r17 = 999(0x3e7, double:4.936E-321)\n int r3 = (r15 > r17 ? 1 : (r15 == r17 ? 0 : -1))\n if (r3 > 0) goto L_0x00ad\n r17 = 100\n goto L_0x017e\n L_0x00ad:\n r17 = 9999(0x270f, double:4.94E-320)\n int r3 = (r15 > r17 ? 1 : (r15 == r17 ? 0 : -1))\n if (r3 > 0) goto L_0x00b7\n r17 = 1000(0x3e8, double:4.94E-321)\n goto L_0x017e\n L_0x00b7:\n r17 = 99999(0x1869f, double:4.9406E-319)\n int r3 = (r15 > r17 ? 1 : (r15 == r17 ? 0 : -1))\n if (r3 > 0) goto L_0x00c2\n r17 = 10000(0x2710, double:4.9407E-320)\n goto L_0x017e\n L_0x00c2:\n r17 = 999999(0xf423f, double:4.94065E-318)\n int r3 = (r15 > r17 ? 1 : (r15 == r17 ? 0 : -1))\n if (r3 > 0) goto L_0x00ce\n r17 = 100000(0x186a0, double:4.94066E-319)\n goto L_0x017e\n L_0x00ce:\n r17 = 9999999(0x98967f, double:4.940656E-317)\n int r3 = (r15 > r17 ? 1 : (r15 == r17 ? 0 : -1))\n if (r3 > 0) goto L_0x00da\n r17 = 1000000(0xf4240, double:4.940656E-318)\n goto L_0x017e\n L_0x00da:\n r17 = 99999999(0x5f5e0ff, double:4.9406564E-316)\n int r3 = (r15 > r17 ? 1 : (r15 == r17 ? 0 : -1))\n if (r3 > 0) goto L_0x00e6\n r17 = 10000000(0x989680, double:4.9406565E-317)\n goto L_0x017e\n L_0x00e6:\n r17 = 999999999(0x3b9ac9ff, double:4.940656453E-315)\n int r3 = (r15 > r17 ? 1 : (r15 == r17 ? 0 : -1))\n if (r3 > 0) goto L_0x00f2\n r17 = 100000000(0x5f5e100, double:4.94065646E-316)\n goto L_0x017e\n L_0x00f2:\n r17 = 9999999999(0x2540be3ff, double:4.940656458E-314)\n int r3 = (r15 > r17 ? 1 : (r15 == r17 ? 0 : -1))\n if (r3 > 0) goto L_0x0100\n r17 = 1000000000(0x3b9aca00, double:4.94065646E-315)\n goto L_0x017e\n L_0x0100:\n r17 = 99999999999(0x174876e7ff, double:4.94065645836E-313)\n int r3 = (r15 > r17 ? 1 : (r15 == r17 ? 0 : -1))\n if (r3 > 0) goto L_0x0110\n r17 = 10000000000(0x2540be400, double:4.9406564584E-314)\n goto L_0x017e\n L_0x0110:\n r17 = 999999999999(0xe8d4a50fff, double:4.940656458408E-312)\n int r3 = (r15 > r17 ? 1 : (r15 == r17 ? 0 : -1))\n if (r3 > 0) goto L_0x011f\n r17 = 100000000000(0x174876e800, double:4.9406564584E-313)\n goto L_0x017e\n L_0x011f:\n r17 = 9999999999999(0x9184e729fff, double:4.940656458412E-311)\n int r3 = (r15 > r17 ? 1 : (r15 == r17 ? 0 : -1))\n if (r3 > 0) goto L_0x012e\n r17 = 1000000000000(0xe8d4a51000, double:4.94065645841E-312)\n goto L_0x017e\n L_0x012e:\n r17 = 99999999999999(0x5af3107a3fff, double:4.9406564584124E-310)\n int r3 = (r15 > r17 ? 1 : (r15 == r17 ? 0 : -1))\n if (r3 > 0) goto L_0x013d\n r17 = 10000000000000(0x9184e72a000, double:4.9406564584125E-311)\n goto L_0x017e\n L_0x013d:\n r17 = 999999999999999(0x38d7ea4c67fff, double:4.94065645841246E-309)\n int r3 = (r15 > r17 ? 1 : (r15 == r17 ? 0 : -1))\n if (r3 > 0) goto L_0x014c\n r17 = 100000000000000(0x5af3107a4000, double:4.94065645841247E-310)\n goto L_0x017e\n L_0x014c:\n r17 = 9999999999999999(0x2386f26fc0ffff, double:5.431165199810527E-308)\n int r3 = (r15 > r17 ? 1 : (r15 == r17 ? 0 : -1))\n if (r3 > 0) goto L_0x015b\n r17 = 1000000000000000(0x38d7ea4c68000, double:4.940656458412465E-309)\n goto L_0x017e\n L_0x015b:\n r17 = 99999999999999999(0x16345785d89ffff, double:5.620395787888204E-302)\n int r3 = (r15 > r17 ? 1 : (r15 == r17 ? 0 : -1))\n if (r3 > 0) goto L_0x016a\n r17 = 10000000000000000(0x2386f26fc10000, double:5.431165199810528E-308)\n goto L_0x017e\n L_0x016a:\n r17 = 999999999999999999(0xde0b6b3a763ffff, double:7.832953389245684E-242)\n int r3 = (r15 > r17 ? 1 : (r15 == r17 ? 0 : -1))\n if (r3 > 0) goto L_0x0179\n r17 = 100000000000000000(0x16345785d8a0000, double:5.620395787888205E-302)\n goto L_0x017e\n L_0x0179:\n r17 = 1000000000000000000(0xde0b6b3a7640000, double:7.832953389245686E-242)\n L_0x017e:\n long r1 = r15 / r17\n int r3 = (int) r1\n switch(r3) {\n case 0: goto L_0x01b6;\n case 1: goto L_0x01af;\n case 2: goto L_0x01aa;\n case 3: goto L_0x01a5;\n case 4: goto L_0x019e;\n case 5: goto L_0x0199;\n case 6: goto L_0x0194;\n case 7: goto L_0x018f;\n case 8: goto L_0x018a;\n case 9: goto L_0x0185;\n default: goto L_0x0184;\n }\n L_0x0184:\n goto L_0x01bb\n L_0x0185:\n int r3 = r14 + 1\n r0[r14] = r5\n goto L_0x01ba\n L_0x018a:\n int r3 = r14 + 1\n r0[r14] = r8\n goto L_0x01ba\n L_0x018f:\n int r3 = r14 + 1\n r0[r14] = r9\n goto L_0x01ba\n L_0x0194:\n int r3 = r14 + 1\n r0[r14] = r4\n goto L_0x01ba\n L_0x0199:\n int r3 = r14 + 1\n r0[r14] = r7\n goto L_0x01ba\n L_0x019e:\n int r3 = r14 + 1\n r6 = 52\n r0[r14] = r6\n goto L_0x01ba\n L_0x01a5:\n int r3 = r14 + 1\n r0[r14] = r10\n goto L_0x01ba\n L_0x01aa:\n int r3 = r14 + 1\n r0[r14] = r11\n goto L_0x01ba\n L_0x01af:\n int r3 = r14 + 1\n r6 = 49\n r0[r14] = r6\n goto L_0x01ba\n L_0x01b6:\n int r3 = r14 + 1\n r0[r14] = r13\n L_0x01ba:\n r14 = r3\n L_0x01bb:\n int r3 = (r17 > r21 ? 1 : (r17 == r21 ? 0 : -1))\n if (r3 != 0) goto L_0x01c0\n goto L_0x01d8\n L_0x01c0:\n java.lang.Long.signum(r17)\n long r1 = r1 * r17\n long r15 = r15 - r1\n r1 = 0\n int r3 = (r15 > r1 ? 1 : (r15 == r1 ? 0 : -1))\n if (r3 != 0) goto L_0x01d9\n L_0x01cc:\n int r1 = (r17 > r21 ? 1 : (r17 == r21 ? 0 : -1))\n if (r1 <= 0) goto L_0x01d8\n int r1 = r14 + 1\n r0[r14] = r13\n long r17 = r17 / r19\n r14 = r1\n goto L_0x01cc\n L_0x01d8:\n return r14\n L_0x01d9:\n long r17 = r17 / r19\n goto L_0x017e\n */\n throw new UnsupportedOperationException(\"Method not decompiled: com.unboundid.util.ByteStringBuffer.getBytes(long):int\");\n }", "int readBytes(TclObject obj, int bytesToRead, IntPtr offsetPtr) {\n final boolean debug = false;\n int toRead, srcOff, srcLen, offset, length;\n ChannelBuffer buf;\n IntPtr srcRead, dstWrote;\n byte[] src, dst;\n\n offset = offsetPtr.i;\n \n buf = inQueueHead;\n src = buf.buf;\n srcOff = buf.nextRemoved;\n srcLen = buf.nextAdded - buf.nextRemoved;\n if (debug) {\n System.out.println(\"readBytes() : src buffer len is \" + buf.buf.length);\n System.out.println(\"readBytes() : buf.nextRemoved is \" + buf.nextRemoved);\n System.out.println(\"readBytes() : buf.nextAdded is \" + buf.nextAdded);\n }\n\n toRead = bytesToRead;\n if (toRead > srcLen) {\n\t toRead = srcLen;\n if (debug)\n System.out.println(\"readBytes() : toRead set to \" + toRead);\n }\n\n length = TclByteArray.getLength(null, obj);\n dst = TclByteArray.getBytes(null, obj);\n if (debug) {\n System.out.println(\"readBytes() : toRead is \" + toRead);\n System.out.println(\"readBytes() : length is \" + length);\n System.out.println(\"readBytes() : array length is \" + dst.length);\n }\n\n if (toRead > length - offset - 1) {\n if (debug) {\n System.out.println(\"readBytes() : TclObject too small\");\n }\n\n // Double the existing size of the object or make enough room to\n // hold all the characters we may get from the source buffer,\n // whichever is larger.\n\n length = offset * 2;\n if (offset < toRead) {\n length = offset + toRead + 1;\n }\n dst = TclByteArray.setLength(null, obj, length);\n }\n\n if (needNL) {\n needNL = false;\n if ((srcLen == 0) || (src[srcOff] != '\\n')) {\n dst[offset] = (byte) '\\r';\n offsetPtr.i += 1;\n return 1;\n }\n dst[offset++] = (byte) '\\n';\n srcOff++;\n srcLen--;\n toRead--;\n }\n\n srcRead = new IntPtr(srcLen);\n dstWrote = new IntPtr(toRead);\n\n if (translateEOL(dst, offset, src, srcOff, dstWrote, srcRead) != 0) {\n if (dstWrote.i == 0) {\n return -1;\n }\n }\n\n buf.nextRemoved += srcRead.i;\n offsetPtr.i += dstWrote.i;\n return dstWrote.i;\n }", "public int capacity()\r\n/* 81: */ {\r\n/* 82:116 */ ensureAccessible();\r\n/* 83:117 */ return this.array.length;\r\n/* 84: */ }", "private int zzMaxBufferLen() {\n return Integer.MAX_VALUE;\n }", "private int zzMaxBufferLen() {\n return Integer.MAX_VALUE;\n }", "private void testSize(ArrayGenerator generator) {\n assertEquals(generator.getSize(), generator.getArray().length);\n }", "int size() {\n int basic = ((offset() + 4) & ~3) - offset() + 8;\n /* Add 8*number of offsets */\n return basic + targetsOp.length*8;\n }", "private int ensureBuffer(int offset, int length) throws IOException {\n\t\tfinal int lastPos = offset + length - 1;\n\t\tfinal int desiredSize = ((lastPos / BUFFER_SIZE) + 1) * BUFFER_SIZE;\n\t\tfinal int currentSize = this.buffer.length;\n\n\t\tif (desiredSize > currentSize) {\n\t\t\tfinal byte[] readBuffer = new byte[desiredSize - currentSize];\n\t\t\tfinal int count = this.in.read(readBuffer);\n\n\t\t\tif (count > 0) {\n\t\t\t\tfinal byte[] newBuffer = new byte[currentSize + count];\n\t\t\t\tSystem.arraycopy(this.buffer, 0, newBuffer, 0, currentSize);\n\t\t\t\tSystem.arraycopy(readBuffer, 0, newBuffer, currentSize, count);\n\t\t\t\tthis.buffer = newBuffer;\n\t\t\t}\n\t\t\treturn (lastPos < this.buffer.length) ? length : length - (lastPos - this.buffer.length + 1);\n\t\t}\n\t\treturn length;\n\t}", "public byte[] getData()\r\n/* 20: */ {\r\n/* 21:60 */ byte[] data = new byte[2];\r\n/* 22: */ \r\n/* 23:62 */ IntegerHelper.getTwoBytes(this.calcCount, data, 0);\r\n/* 24: */ \r\n/* 25:64 */ return data;\r\n/* 26: */ }", "int sizeOfBridgeElementArray();", "default int getPackedArraySizeFast(int inputLength) {\n return (int) Math.ceil((double) inputLength * ( (double) maxBitLength() / 8.000 ) );\n }", "private E newBufferPeek(E[] nextBuffer, long index)\r\n/* 212: */ {\r\n/* 213:464 */ long offset = newBufferAndOffset(nextBuffer, index);\r\n/* 214:465 */ E n = UnsafeRefArrayAccess.lvElement(nextBuffer, offset);\r\n/* 215:466 */ if (null == n) {\r\n/* 216:468 */ throw new IllegalStateException(\"new buffer must have at least one element\");\r\n/* 217: */ }\r\n/* 218:470 */ return n;\r\n/* 219: */ }", "public abstract int[] findEmptyBlock(int processSize);", "public int nioBufferCount()\r\n/* 295: */ {\r\n/* 296:309 */ return 1;\r\n/* 297: */ }", "int getLostedSize();", "public int getLocalSize();", "int sizeOfReferenceRangeArray();", "public boolean isFull() {\n return size == k;\n}", "private long newBufferAndOffset(E[] nextBuffer, long index)\r\n/* 222: */ {\r\n/* 223:475 */ this.consumerBuffer = nextBuffer;\r\n/* 224:476 */ this.consumerMask = (LinkedArrayQueueUtil.length(nextBuffer) - 2 << 1);\r\n/* 225:477 */ return LinkedArrayQueueUtil.modifiedCalcElementOffset(index, this.consumerMask);\r\n/* 226: */ }", "public boolean isFull() {\n return (e+1)%buf.length == b;\n }", "void setBufferSize(int bufferSize);", "int size() {\n\t\treturn array.length;\n\t}", "private boolean isFull() {\n\t\treturn (size == bq.length);\n\t}", "int read(byte[] buffer, int bufferOffset, int length) throws IOException;", "short getDQ1( byte[] buffer, short offset );", "public synchronized int getOutputCount() {\n return buffers.length;\n }", "private int getBufferSize() {\n int maxBandOff = bandOffsets[0];\n for (int i = 1; i < bandOffsets.length; i++) {\n maxBandOff = Math.max(maxBandOff, bandOffsets[i]);\n }\n\n if (maxBandOff < 0 || maxBandOff > (Integer.MAX_VALUE - 1)) {\n throw new IllegalArgumentException(\"Invalid band offset\");\n }\n\n if (pixelStride < 0 || pixelStride > (Integer.MAX_VALUE / width)) {\n throw new IllegalArgumentException(\"Invalid pixel stride\");\n }\n\n if (scanlineStride < 0 || scanlineStride > (Integer.MAX_VALUE / height)) {\n throw new IllegalArgumentException(\"Invalid scanline stride\");\n }\n\n int size = maxBandOff + 1;\n\n int val = pixelStride * (width - 1);\n\n if (val > (Integer.MAX_VALUE - size)) {\n throw new IllegalArgumentException(\"Invalid pixel stride\");\n }\n\n size += val;\n\n val = scanlineStride * (height - 1);\n\n if (val > (Integer.MAX_VALUE - size)) {\n throw new IllegalArgumentException(\"Invalid scan stride\");\n }\n\n size += val;\n\n return size;\n }", "public static native long nativeAssetGetLength(long j);", "public int length() { return 1+maxidx; }", "@Override\n public synchronized int getSize() {\n return mArray.size();\n }", "public static int size_reading() {\n return (16 / 8);\n }", "short getPQ( byte[] buffer, short offset );", "private void arraySize(MyArrayList list, Results results) {\r\n int size = -123;\r\n size = list.size();\r\n if(size != -123) {\r\n results.storeNewResult(\"ArraySize test case: PASSED\");\r\n }\r\n else {\r\n results.storeNewResult(\"ArraySize test case: FAILED\");\r\n }\r\n }", "int memSize() {\n return super.memSize() + 4 * 4; }", "int getSampleSize();", "private FloatBuffer createBuffer(int size)\n {\n // Need to allocate a byte buffer 4 times the size requested because the\n // size is treated as bytes, not number of floats.\n ByteBuffer buf = ByteBuffer.allocateDirect(size * 4);\n buf.order(ByteOrder.nativeOrder());\n FloatBuffer ret_val = buf.asFloatBuffer();\n\n return ret_val;\n }", "static void readBytes(ByteBufAllocator allocator, ByteBuffer buffer, int position, int length, OutputStream out) throws IOException {\n if (buffer.hasArray()) {\n out.write((byte[])buffer.array(), (int)(position + buffer.arrayOffset()), (int)length);\n return;\n }\n int chunkLen = Math.min((int)length, (int)8192);\n buffer.clear().position((int)position);\n if (length <= 1024 || !allocator.isDirectBufferPooled()) {\n ByteBufUtil.getBytes((ByteBuffer)buffer, (byte[])ByteBufUtil.threadLocalTempArray((int)chunkLen), (int)0, (int)chunkLen, (OutputStream)out, (int)length);\n return;\n }\n ByteBuf tmpBuf = allocator.heapBuffer((int)chunkLen);\n try {\n byte[] tmp = tmpBuf.array();\n int offset = tmpBuf.arrayOffset();\n ByteBufUtil.getBytes((ByteBuffer)buffer, (byte[])tmp, (int)offset, (int)chunkLen, (OutputStream)out, (int)length);\n return;\n }\n finally {\n tmpBuf.release();\n }\n }", "public int DataMemorySize() { return DATA_MEMORY_SIZE; }", "public LlvmValue visit(ArrayLength n){\n\t\t\n\t\tint index = 0;\n\t\tchar type_char;\n\t\tSystem.out.format(\"arraylength:******\\n\");\n\n\t\t//System.out.format(\"****n, n.array: %s \\n%s\\n\",n,n.array);\n\t\t\n\t\t//Desce para o array, e pega o registrador que aponta para ela\n\t\tLlvmValue array = n.array.accept(this);\n\t\t\n\t\t//System.out.format(\"array e array.type: %s \\n%s\\n\",array,array.type);\n\t\t\n\t\tStringBuilder type = new StringBuilder();\n\t\ttype.append(array.type.toString());\n\t\t\n\t\t//System.out.format(\"type: %s\\n\",type);\n\t\t\n\t\tStringBuilder lengths = new StringBuilder();\n\t\t\n\t\t//Temos que verificar se a array foi alocada dinamicamente ou estaticamente, para poder\n\t\t//alterar a forma de pegar o length.\n\t\tif(array.type.toString().contains(\"* *\")){\n\t\t\t//Dinamicamente... nesse caso alocamos o primeiro slot da array para colocar o tamanho\n\t\t\t//System.out.format(\"array declarada dinamicamente... carregando tamanho do primeiro endereco\\n\");\n\t\t\t\n\t\t\t//Carregando tamanho do inicio da array\n\t\t\tLinkedList<LlvmValue> offsets = new LinkedList<LlvmValue>();\n\t\t\t\n\t\t\t//Offsets do getelementptr\n\t\t\toffsets.add(new LlvmIntegerLiteral(0));\n\t\t\t\n\t\t\t//Registrador onde receberemos o pointer para o array (**)\n\t\t\tLlvmRegister length_ptr = new LlvmRegister(new LlvmPointer(LlvmPrimitiveType.I32PTR));\n\n\t\t\t//Pegando o endereco da array\n\t\t\tassembler.add(new LlvmGetElementPointer(length_ptr, array, offsets));\n\t\t\t\n\t\t\t//Registrador no qual vamos carregar a array (*)\n\t\t\tLlvmRegister array_reg = new LlvmRegister(new LlvmPointer(LlvmPrimitiveType.I32));\n\t\t\t\n\t\t\t//Array carregada\n\t\t\tassembler.add(new LlvmLoad(array_reg, length_ptr));\n\t\t\t\n\t\t\t//Registrador no qual vamos carregar o primeiro elemento da array\n\t\t\tLlvmRegister array_size = new LlvmRegister(LlvmPrimitiveType.I32);\n\t\t\t\n\t\t\t//Carrega o size do endereco inicial da array.\n\t\t\tassembler.add(new LlvmLoad(array_size, array_reg));\n\t\t\t\n\t\t\treturn array_size;\n\t\t}\n\t\telse{\n\t\t\t//estaticamente. dessa forma conseguimos retirar o tamanho da array pelo tipo dela.\n\t\t\t//agora vamos parsear esse tamanho, em busca do tamanho total da string...\n\t\t\t\n\t\t\twhile(true){\n\t\t\t\ttype_char = type.charAt(index);\n\t\t\t\tif(type_char=='i'){\n\t\t\t\t\t//System.out.format(\"fim\\n\");\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\t//System.out.format(\"char atual:%c\\n\",type.charAt(index));\n\t\t\t\tif(type_char=='x'){\n\t\t\t\t\t//System.out.format(\"x\\n\");\n\t\t\t\t\tlengths.append(\" \");\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t//Achei um numero...\n\t\t\t\tif(type_char != 'x' && type_char != ' ' && type_char != '['){\n\t\t\t\t\t//System.out.format(\"numero: %c\\n\", type_char);\n\t\t\t\t\tlengths.append(type_char);\n\t\t\t\t}\n\t\t\t\tif(type_char == '['){\n\t\t\t\t\t//System.out.format(\"[\\n\");\n\t\t\t\t}\n\t\t\t\tif(type_char == ' '){\n\t\t\t\t\t//System.out.format(\"space\\n\");\n\t\t\t\t}\n\t\t\t\tindex++;\n\t\t\t}\n\t\t\t\n\t\t\t//System.out.format(\"lengths: %s\\n\", lengths);\n\t\t\t//System.out.format(\"lengths.length: %s\\n\", lengths.length());\n\t\t\tindex = 0;\n\t\t\t\n\t\t\tStringBuilder length = new StringBuilder();\n\t\t\tint total_length = 1;\n\t\t\twhile(index < lengths.length()){\n\t\t\t\ttype_char = lengths.charAt(index);\n\t\t\t\tif(type_char == '\\0'){\n\t\t\t\t\t//System.out.format(\"fim\\n\");\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tif(type_char!=' '){\n\t\t\t\t\tlength.append(type_char);\n\t\t\t\t}else{\n\t\t\t\t\t//System.out.format(\"space\\n\");\n\t\t\t\t\t//para cada nivel de array, multiplicamos pelo nivel anterior.\n\t\t\t\t\t//por exemplo, se for [10 x [20 x i32]] fica 10x20\n\t\t\t\t\ttotal_length = total_length * Integer.parseInt(length.toString());\n\t\t\t\t\t//System.out.format(\"total_length: %d\\n\",total_length);\n\t\t\t\t\tlength = new StringBuilder();\n\t\t\t\t}\n\t\t\t\tindex++;\n\t\t\t}\n\t\t\t\n\t\t\tLlvmIntegerLiteral length_final = new LlvmIntegerLiteral(total_length);\n\t\t\t\n\t\t\treturn length_final;\n\t\t}\n\t}", "abstract protected int getCapacity();", "int ibwrt (int ud, ByteBuffer buf, long cnt);", "private static void buffer() {\n\t\tSystem.out.println(\"bafor\"+Runtime.getRuntime().freeMemory());\n\t\tByteBuffer mBuffer=ByteBuffer.allocate(10240000);\n\t\tSystem.out.println(\"bafor\"+Runtime.getRuntime().freeMemory());\n// mBuffer.clear();\n System.out.println(\"bafor\"+Runtime.getRuntime().freeMemory());\n\t}", "public int getSize() {\n return memory.length;\n }", "int sizeOfStarArray();", "public interface ProductionBuffer {\n\t\n\tpublic int getMaxBufferSize();\n\t\n\tpublic int getCurrentBufferSize();\n\t\n\tpublic boolean isFull();\n\t\n\tpublic boolean isEmpty();\n\t\n\t//Add to the back of the buffer\n\tpublic boolean add(BufferSlot bs);\n\t\n\t//Remove from the front of the buffer\n\tpublic BufferSlot remove();\n\t\n\t//empties the buffer\n\tpublic void clear();\n\n}", "public byte[] getData() {\n try {\n int n2 = (int)this.len.get();\n if (this.buf == null) {\n return null;\n }\n if (n2 <= this.buf.length) return this.buf.get(n2);\n Log.w(TAG, \"getData: expected length (\" + n2 + \") > buffer length (\" + this.buf.length + \")\");\n throw new IllegalArgumentException(\"Blob:getData - size is larger than the real buffer length\");\n }\n catch (Exception exception) {\n Log.e(TAG, \"getData exception!\");\n exception.printStackTrace();\n return null;\n }\n }", "@Test\r\n public void ArraySizeTest() {\r\n System.out.println(\"arraySize\");\r\n String[] string = {\"1\",\"2\",\"3\"};\r\n\r\n int expResult = 3;\r\n int result = instance.arraySize(string);\r\n assertEquals(expResult, result);\r\n }" ]
[ "0.7119176", "0.6966537", "0.67025083", "0.6649932", "0.6311945", "0.6138498", "0.61368746", "0.606775", "0.6045907", "0.6017483", "0.5959112", "0.5959112", "0.5942242", "0.590583", "0.5897187", "0.58950627", "0.5860655", "0.5851561", "0.5843976", "0.58295053", "0.5828415", "0.5823415", "0.58222914", "0.5818033", "0.5816079", "0.5807695", "0.5790389", "0.5786345", "0.57726866", "0.57451934", "0.5697019", "0.5693079", "0.56925803", "0.5682415", "0.567609", "0.5663828", "0.5645097", "0.56407094", "0.56315494", "0.5618246", "0.5616828", "0.56148756", "0.56132543", "0.5607854", "0.56025124", "0.55976605", "0.5592136", "0.5562765", "0.5554506", "0.55521697", "0.5548205", "0.5544663", "0.5543264", "0.55356216", "0.5527561", "0.5521482", "0.55111927", "0.55072075", "0.55072075", "0.55019116", "0.5497152", "0.54965144", "0.5473447", "0.5469612", "0.5468972", "0.5467746", "0.5460544", "0.5458198", "0.54569215", "0.54545593", "0.54516727", "0.54512066", "0.54490936", "0.544266", "0.5438281", "0.54280704", "0.54268956", "0.5426552", "0.5413421", "0.53971696", "0.5396845", "0.5395811", "0.5390829", "0.5388138", "0.53839636", "0.53829205", "0.5375607", "0.53564036", "0.5354781", "0.5353568", "0.5346804", "0.53436494", "0.5328766", "0.53268534", "0.5322296", "0.5322031", "0.53203887", "0.5319889", "0.53083134", "0.5299315", "0.52973473" ]
0.0
-1
at the moment elevatorTarget is a voltage, TODO: make some sort of conversion from voltage to angle
public void goToAngle(){ currentAngle = getAverageVoltage2(); if (Math.abs(elevationTarget - currentAngle) <= .1){//TODO: check angle off(); // System.out.println("off"); } else if (elevationTarget > currentAngle && elevationTarget < maxLimit){ raise(); //System.out.println("raise"); } else if (elevationTarget < currentAngle && elevationTarget > minLimit){ //System.out.println("lower"); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public float getMotor_ang_target_velocity() throws IOException\n\t{\n\t\tif ((__io__pointersize == 8)) {\n\t\t\treturn __io__block.readFloat(__io__address + 132);\n\t\t} else {\n\t\t\treturn __io__block.readFloat(__io__address + 124);\n\t\t}\n\t}", "public double getAngleToTarget(){\n return 0d;\n }", "public float getVelAngle() {\n\t\tif (velocity.y == 0f && velocity.x == 0f)\n\t\t\treturn restrictAngle((float) Math.random() * float2pi);\n\t\tfloat result = (float) Math.atan2(velocity.y, velocity.x);\n\t\treturn restrictAngle(result);\n\t}", "private float calculateAngle() {\r\n\r\n\t\tdouble angleTemp = Math.atan2(Target.getY() - y, Target.getX() - x);\r\n\t\t// I needed to use wikipedia to get this i\r\n\t\t// did not learn this in math and needed\r\n\t\t// to use a couplle youtube tutorials to\r\n\t\t// find out how to do the math in java\r\n\t\t// aswell thank fully one had the exact\r\n\t\t// way of doing this\r\n\t\treturn (float) Math.toDegrees(angleTemp) + 90;\r\n\t}", "private void initializeElevatorMotor()\n {\n Rectangle base = new Rectangle(shaftWidth*.3, location, shaftWidth*.4, floorHeight*.8);\n Rectangle latch = new Rectangle(shaftWidth*.45, location-5, shaftWidth*.1, floorHeight*.2);\n\n elevator = Shape.union(base, latch);\n elevator.setFill(Color.valueOf(\"#C0C0C0\"));\n\n elevatorTranslate = 0;\n elevatorOffset = 0;\n elevatorSpeed = 20;\n\n motorTimeline = new Timeline(new KeyFrame(Duration.millis(elevatorSpeed), e -> {\n if(location+elevatorOffset <= shaftHeight-60 && location+elevatorOffset >= 10) {\n if(location <= destination && location >= destination-10)\n {\n// System.out.println(location + \" OF \" + (destination) + \" / \" + (destination-10) + \" \" + (10 - destination/floorHeight));\n// System.out.println(\"EARLY STOP\");\n motorTimeline.pause();\n }\n\n elevatorTranslate += elevatorOffset;\n location += elevatorOffset;\n\n elevator.setTranslateY(elevatorTranslate);\n frame.setTranslateY(elevatorTranslate);\n leftDoor.setTranslateY(elevatorTranslate);\n rightDoor.setTranslateY(elevatorTranslate);\n }\n else motorTimeline.pause();\n }));\n motorTimeline.setCycleCount(Animation.INDEFINITE);\n }", "public void updateAngle() {\n\t\tfloat ak = 0;\n\t\tfloat gk = 0;\n\t\tak = (float) (pathBoardRectangles.get(curTargetPathCellIndex).getCenterX() - x);\n\t\tgk = (float) (pathBoardRectangles.get(curTargetPathCellIndex).getCenterY() - y);\n\t\tangleDesired = (float) Math.toDegrees(Math.atan2(ak*-1, gk));\n\t\t// if the angle and the angleDesired are opposites the Vector point into the opposite direction\n\t\t// this means the angle will be the angle of the longer vector which is always angle\n\t\t// so if that happens the angleDesired is offset so this won't happen\n\t\tangle = Commons.calculateAngleAfterRotation(angle, angleDesired, rotationDelay);\n\t}", "public void goTo(final double target){\n final Thread thread = new Thread(new Runnable() {\r\n public void run(){\r\n goToFlag = false;\r\n currentAngle = stringPot.getVoltage(); //change happened here\r\n shootTarget = target;\r\n while(target > currentAngle && target < maxLimit && currentAngle < maxLimit && canRun && elevateFlag){\r\n currentAngle = stringPot.getVoltage();//change happened here\r\n System.out.println(\"raise \" + target);\r\n raise();\r\n if(target < currentAngle){\r\n elevateFlag = false;\r\n break;\r\n }\r\n }\r\n while(target < currentAngle && target > minLimit && currentAngle > minLimit && canRun && elevateFlag){\r\n currentAngle = stringPot.getVoltage();//change happened here\r\n System.out.println(\"lower \" + target);\r\n lower();\r\n if(target > currentAngle){\r\n elevateFlag = false;\r\n break;\r\n }\r\n }\r\n //System.out.println(\"off\");\r\n off();\r\n }\r\n });\r\n thread.start();\r\n }", "public double getTargetAngle(){\n return lastKnownAngle;\n }", "private double getRawAngle() {\n return (m_pot.getVoltage() / Constants.AIO_MAX_VOLTAGE) * Constants.Hood.POT_SCALE;\n }", "public void approachTargetWithVision() {\n final double STEER_P = 0.005; \n final double DRIVE_P = 0.05; \n final double DESIRED_TARGET_AREA = 4; // Area of the target when the robot reaches the wall\n final double MAX_DRIVE = 0.75; // Simple speed limit so we don't drive too fast\n final double STEER_I = 0.005;\n final double DRIVE_I = 0.0;\n final double STEER_D = 0.02;\n final double xError;\n final double aError;\n double DRIVE_INTEGRAL = 0;\n\n \n\n double tv = NetworkTableInstance.getDefault().getTable(\"limelight\").getEntry(\"tv\").getDouble(0);\n double tx = NetworkTableInstance.getDefault().getTable(\"limelight\").getEntry(\"tx\").getDouble(0);\n double ta = NetworkTableInstance.getDefault().getTable(\"limelight\").getEntry(\"ta\").getDouble(0);\n xError = tx;\n aError = (DESIRED_TARGET_AREA - ta);\n // SmartDashboard.putNumber(\"TA\", ta);\n // SmartDashboard.putNumber(\"TA Error\", aError);\n SmartDashboard.putNumber(\"TX Error\", xError);\n STEER_INTEGRAL = STEER_INTEGRAL + (xError*0.02);\n DRIVE_INTEGRAL = DRIVE_INTEGRAL + (aError * 0.02);\n STEER_DERIVATIVE = (xError - STEER_ERROR_PRIOR)/0.02;\n SmartDashboard.putNumber(\"Integral\", STEER_INTEGRAL);\n SmartDashboard.putNumber(\"Derivative\", STEER_DERIVATIVE);\n SmartDashboard.putNumber(\"TA\", ta);\n\n\n if (tv < 1.0) {\n m_LimelightHasValidTarget = false;\n drive_cmd = 0.0;\n steer_cmd = 0.0;\n } else {\n m_LimelightHasValidTarget = true;\n // Start with proportional steering\n steer_cmd = (xError * STEER_P) + (STEER_INTEGRAL * STEER_I) + (STEER_DERIVATIVE * STEER_D);\n\n // try to drive forward until the target area reaches our desired area\n drive_cmd = (aError * DRIVE_P) + (DRIVE_INTEGRAL * DRIVE_I);\n // don't let the robot drive too fast into the goal\n if (drive_cmd > MAX_DRIVE){\n drive_cmd = MAX_DRIVE;\n }\n }\n\n Robot.driveTrain.setLeftMotors(-drive_cmd - steer_cmd);\n Robot.driveTrain.setRightMotors(-drive_cmd + steer_cmd);\n\n STEER_ERROR_PRIOR = xError;\n\n }", "public float getMotor_lin_target_velocity() throws IOException\n\t{\n\t\tif ((__io__pointersize == 8)) {\n\t\t\treturn __io__block.readFloat(__io__address + 128);\n\t\t} else {\n\t\t\treturn __io__block.readFloat(__io__address + 120);\n\t\t}\n\t}", "private double getElevatorSpeed()\n {\n // if second speed is toggled use second instead of main speed\n if (useSecondSpeed)\n {\n return mSecondSpeed * mDirection * -1;\n }\n else\n { // else just use main speed\n return mSpeed * mDirection * -1;\n }\n }", "@Override\n public void robotInit() {\n m_chooser.setDefaultOption(\"Default Auto\", kDefaultAuto);\n m_chooser.addOption(\"My Auto\", kCustomAuto);\n SmartDashboard.putData(\"Auto choices\", m_chooser);\n\n /* lets grab the 360 degree position of the MagEncoder's absolute position */\n /* mask out the bottom12 bits, we don't care about the wrap arounds */ \n\t\tint absolutePosition = elevator.getSelectedSensorPosition(0) & 0xFFF;\n \n /* use the low level API to set the quad encoder signal */\n elevator.setSelectedSensorPosition(absolutePosition, Constants.kPIDLoopIdx, Constants.kTimeoutMs);\n\n /* choose the sensor and sensor direction */\n elevator.configSelectedFeedbackSensor(FeedbackDevice.CTRE_MagEncoder_Relative, \n Constants.kPIDLoopIdx, Constants.kTimeoutMs);\n\n /* Ensure sensor is positive when output is positive */\n elevator.setSensorPhase(false);\n\n /**\n * Set based on what direction you want forward/positive to be.\n * This does not affect sensor phase. \n */ \n //elevator.setInverted(Constants.kMotorInvert);\n \n /* Config the peak and nominal outputs, 12V means full */\n elevator.configNominalOutputForward(0, Constants.kTimeoutMs);\n elevator.configNominalOutputReverse(0, Constants.kTimeoutMs);\n //elevator.configPeakOutputForward(1, Constants.kTimeoutMs);\n elevator.configNominalOutputForward(0.5);\n //elevator.configPeakOutputForward(1, Constants.kTimeoutMs);\n elevator.configPeakOutputForward(0.5);\n elevator.configPeakOutputReverse(-1, Constants.kTimeoutMs);\n \n /**\n * Config the allowable closed-loop error, Closed-Loop output will be\n * neutral within this range. See Table in Section 17.2.1 for native\n * units per rotation.\n */\n //elevator.configAllowableClosedloopError(0, Constants.kPIDLoopIdx, Constants.kTimeoutMs);\n \n /* Config Position Closed Loop gains in slot0, typically kF stays zero. */\n elevator.config_kF(Constants.kPIDLoopIdx, 0.0, Constants.kTimeoutMs);\n elevator.config_kP(Constants.kPIDLoopIdx, 0.5, Constants.kTimeoutMs);\n elevator.config_kI(Constants.kPIDLoopIdx, 0.0, Constants.kTimeoutMs);\n elevator.config_kD(Constants.kPIDLoopIdx, 0.0, Constants.kTimeoutMs);\n\n\n }", "public void setMotor_ang_target_velocity(float motor_ang_target_velocity) throws IOException\n\t{\n\t\tif ((__io__pointersize == 8)) {\n\t\t\t__io__block.writeFloat(__io__address + 132, motor_ang_target_velocity);\n\t\t} else {\n\t\t\t__io__block.writeFloat(__io__address + 124, motor_ang_target_velocity);\n\t\t}\n\t}", "public void reviseMotorSpeed() {\n\t\tmHandler.removeMessages(EVAL_MOTOR_SPEED);\n\t\tlong starttime = System.currentTimeMillis();\n\n\t\t//Retrieve current orientation.\t\t\n\t\t\n\t\tmAzimuth = mStatus.getReadingField(AZIMUTH);\t\t\n\t\tmPitchDeg = mStatus.getReadingField(PITCH);\n\t\tmRollDeg = -mStatus.getReadingField(ROLL);\n\t\t\n\t\tdouble[] errors = new double[4];\n\t\tsynchronized (mAngleTarget) {\n\t\t\t//logArray(\"mAngleTarget\", mAngleTarget);\n\t\t\terrors[0] = mAngleTarget[0] - mRollDeg;\n\t\t\terrors[1] = mAngleTarget[1] - mPitchDeg;\n\t\t\terrors[2] = mAngleTarget[2] - mStatus.getGpsField(dALT);\n\t\t\terrors[3] = mAngleTarget[3] - mAzimuth;\n\t\t\t//logArray(\"errors\", errors);\n\t\t}\n\t\t\n\t\t@SuppressWarnings(\"unused\")\n\t\tString errs = \"errors: \";\n\t\tfor (int i = 0; i < 4; i++) {\n\t\t\terrs += errors[i] + \": \";\n\t\t}\n\t\t//Log.v(TAG, errs);\n\t\t//For azimuth, multiple possibilities exist for error, each equally valid; but only the error nearest zero makes practical sense.\n\t\tif (errors[3] > 180.0)\n\t\t\terrors[3] -= 360.0;\n\t\tif (errors[3] < -180.0)\n\t\t\terrors[3] += 360.0;\n\t\t\n\t\t\n\t\tfor (int i = 0; i < 4; i++) {\n\t\t\t//Calculate proportional errors\n\t\t\tdouble err = errors[i];//mTarget[i] - mCurrent[i];\n\t\t\t\n\n\t\t\t//Calculate derivative errors.\n\t\t\tlong timeInterval = starttime - mLastUpdate;\n\t\t\tif (timeInterval != 0) {\n\t\t\t\tmErrors[i][2] = (err - mErrors[i][0]) * 1000.0 / timeInterval;\n\t\t\t} else {\n\t\t\t\tmErrors[i][2] = 0.0;\n\t\t\t}\n\t\t\t\n\t\t\t\n\t\t\t//Mark proportional error\n\t\t\tmErrors[i][0] = err;\n\t\t\t/*if (i == 2)\n\t\t\t\tLog.v(TAG, \"guid, dalt err is \" + err);*/\n\t\t\t//Update integral errors\n\t\t\tmErrors[i][1] -= mIntegralErrors[i][mIntegralIndex];\n\t\t\tmIntegralErrors[i][mIntegralIndex] = err;\n\t\t\tmErrors[i][1] += err;\n\t\t\tmIntegralIndex = ++mIntegralIndex % PIDREPS;\n\t\t\t\n\t\t\t//Calculate changes in output\n\t\t\tfor (int j = 0; j < 3; j++) {\n\t\t\t\tmControlVars[i] += mErrors[i][j] * mGain[i][j];\n\t\t\t}\n\t\t}\n\t\tif (mGuidanceMode.get() == MANUAL) {\n\t\t\tsynchronized (mAngleTarget) {\n\t\t\t\tmControlVars[2] = mAngleTarget[2];\n\t\t\t}\n\t\t}\n\t\tmLastUpdate = starttime;\n\t\t\n\t\t// Constrain control vars:\n\t\tmControlVars[0] = constrainValue(mControlVars[0], -1, 1);\n\t\tmControlVars[1] = constrainValue(mControlVars[1], -1, 1);\n\t\tmControlVars[2] = constrainValue(mControlVars[2], 0, 1);\n\t\tmControlVars[3] = constrainValue(mControlVars[3], -2, 2);\n\t\t\n\t\t/*String vars = \"Control vars: \";\n\t\tfor (int i = 0; i < 4; i++) {\n\t\t\tvars += mControlVars[i] + \": \";\n\t\t}\n\t\tLog.v(TAG, vars);*/\n\t\t\n\t\tcontrolVarsToMotorSpeeds();\n\t\t\n\t\t//Send motor values to motors here:\n\t\tupdateMotors();\n\t\tupdateAngleTarget();\n\t\t//Log.v(TAG, \"motors: \" + mMotorSpeed[0] + \", \" + mMotorSpeed[1] + \", \" + mMotorSpeed[2] + \", \" + mMotorSpeed[3]);\n\t\t//Sleep a while\n\t\tlong timetonext = (1000 / PIDREPS) - (System.currentTimeMillis() - starttime);\n\t\t//Log.v(TAG, \"time to next: \" + timetonext);\n\t\tint currentMode = mGuidanceMode.get();\n\t\tif ((currentMode == MANUAL) || (currentMode == AUTOPILOT)) {\n\t\t\tif (timetonext > 0)\n\t\t\t\tmHandler.sendEmptyMessageDelayed(EVAL_MOTOR_SPEED, timetonext);\n\t\t\telse {\n\t\t\t\tLog.e(TAG, \"Guidance too slow\");\n\t\t\t\tmHandler.sendEmptyMessage(EVAL_MOTOR_SPEED);\n\t\t\t}\n\t\t}\n\t}", "private Vector2 findTarget() \r\n\t{\r\n\t\tVector2 tempVector = new Vector2(1,1);\r\n\t\ttempVector.setLength(Constants.RANGEDSPEED); //TODO make so it can be changed when level difficulty increases\r\n\t\ttempVector.setAngle(rotation + 90);\r\n\t\treturn tempVector;\r\n\t}", "@Override\n\tpublic boolean onTarget() {\n\t\treturn super.onTarget(mAngleTolerance);\n\t}", "public Elevator() {\n boolean elevatorInvert = false;\n boolean elevatorPhase = false;\n spx = new SpectrumVictorSPX(Constants.ELEVATOR_SPX);\n srx = new LeaderTalonSRX(Constants.ELEVATOR_SRX, spx);\n srx.setNeutralMode(NeutralMode.Brake);\n srx.configSelectedFeedbackSensor(FeedbackDevice.CTRE_MagEncoder_Relative);\n srx.setSensorPhase(elevatorPhase);\n srx.setInverted(elevatorInvert);\n\n // Enable Soft Limits\n srx.configForwardSoftLimitEnable(false);\n srx.configForwardSoftLimitThreshold(posUpLimit);\n srx.configForwardLimitSwitchSource(LimitSwitchSource.FeedbackConnector, LimitSwitchNormal.NormallyOpen);\n \n srx.configReverseSoftLimitEnable(false);\n srx.configReverseSoftLimitThreshold(posDownLimit);\n srx.configReverseLimitSwitchSource(LimitSwitchSource.FeedbackConnector, LimitSwitchNormal.NormallyOpen);\n\n srx.setStatusFramePeriod(StatusFrameEnhanced.Status_13_Base_PIDF0, 10);\n srx.setStatusFramePeriod(StatusFrameEnhanced.Status_10_MotionMagic, 10);\n\n // Set Ramp Rate and voltage compensation\n srx.configClosedloopRamp(0.25);\n srx.configVoltageCompSaturation(11.5);\n srx.enableVoltageCompensation(true);\n setMotionMagicParams();\n }", "public float getAltitudeAngle()\n {\n return altitude_slider.getValue() / ANGLE_SCALE_FACTOR;\n }", "protected void rotateTo(double target) {\n robot.rightFront.setDirection(REVERSE);\n robot.rightBack.setDirection(REVERSE);\n\n while (opModeIsActive() && robot.rightFront.getDirection() != REVERSE) {\n idle();\n }\n\n if (target < 0) target += 360;\n\n double heading = get360Heading();\n while (opModeIsActive() && !withinRange(heading, target)) {\n // Run Dubberke-Richards logic\n if (Math.abs(heading - target) <= 180) {\n if (heading-target >= 0) {\n rotateRight();\n } else {\n rotateLeft();\n }\n } else { // |heading-target| > 180\n if (heading-target<0) {\n rotateRight();\n } else {\n rotateLeft();\n }\n }\n\n // Update heading for next loop\n heading = get360Heading();\n\n telemetry.addData(\"Heading\", heading);\n telemetry.update();\n }\n\n halt();\n }", "private double getGyroError(double targetAngle) {\n double error = targetAngle - imu.getAngularOrientation(AxesReference.INTRINSIC, AxesOrder.XZY, AngleUnit.DEGREES).thirdAngle;\n\n // keep the error on a range of -179 to 180\n while(opModeIsActive() && error > 180) error -= 360;\n while(opModeIsActive() && error <= -180) error += 360;\n\n return error;\n }", "public float getXAngle(){\n Point project=new Point(0,accel.y,accel.z);\n\n float angl=(float)Math.asin(project.y / project.module())* PreferenceHelper.sensetivity;\n //float angl=(float)Math.acos(accel.z/accel.module())*100f;\n if(Float.isNaN(angl)) angl=0.5f;\n return (float)(Math.rint( toFlowX(angl)/1.0) * 1.0);\n }", "double getVelComp(double vel, double angle)\n {\n angle = Math.toRadians(angle);\n double cos = Math.cos(angle);\n double sin = Math.sin(angle);\n ux = vel*cos;\n uy = vel*sin;\n this.angle = angle; \n return ux;\n }", "float getNominalVoltageOutOfPhase();", "@Override\n public double chooseGunAngle(double bulletPower, Point2D.Double myLocation, double absoluteBearingToEnemy) {\n if (enemyLateralVelocity != 0)\n {\n if (enemyLateralVelocity < 0)\n enemyDirection = -1;\n else\n enemyDirection = 1;\n }\n\n double guessfactor = chooseGuessFactor(bulletPower, myLocation);\n\n return Utils.normalAbsoluteAngle(absoluteBearingToEnemy + enemyDirection * guessfactor * MathUtils.maxEscapeAngle(Rules.getBulletSpeed(bulletPower)));\n }", "private double angleTo(Point2D that) {\r\n double dx = that.x - this.x;\r\n double dy = that.y - this.y;\r\n return Math.atan2(dy, dx);\r\n }", "void vibrate(double radiansFromNorth, double radiansOfArch, double durationInMS) throws IOException;", "public float getAngle() {\n if(vectorAngle < 0 )\n return (float) Math.toDegrees(Math.atan(longComponent / latComponent));\n else\n return vectorAngle;\n\n }", "private void calculateMotorOutputs(int angle, int strength) {\n Point cart_point = polarToCart(angle,strength);\n\n final double max_motor_speed = 1024.0;\n final double min_motor_speed = 600.0;\n\n final double max_joy_val = 100;\n\n final double fPivYLimit = 24.0; // 32.0 was originally recommended\n\n // TEMP VARIABLES\n double nMotPremixL; // Motor (left) premixed output (-100..+99)\n double nMotPremixR; // Motor (right) premixed output (-100..+99)\n int nPivSpeed; // Pivot Speed (-100..+99)\n double fPivScale; // Balance scale b/w drive and pivot ( 0..1 )\n\n\n // Calculate Drive Turn output due to Joystick X input\n if (cart_point.y >= 0) {\n // Forward\n nMotPremixL = (cart_point.x>=0)? max_joy_val : (max_joy_val + cart_point.x);\n nMotPremixR = (cart_point.x>=0)? (max_joy_val - cart_point.x) : max_joy_val;\n } else {\n // Reverse\n nMotPremixL = (cart_point.x>=0)? (max_joy_val - cart_point.x) : max_joy_val;\n nMotPremixR = (cart_point.x>=0)? max_joy_val : (max_joy_val + cart_point.x);\n }\n\n // Scale Drive output due to Joystick Y input (throttle)\n nMotPremixL = nMotPremixL * cart_point.y/max_joy_val;\n nMotPremixR = nMotPremixR * cart_point.y/max_joy_val;\n\n // Now calculate pivot amount\n // - Strength of pivot (nPivSpeed) based on Joystick X input\n // - Blending of pivot vs drive (fPivScale) based on Joystick Y input\n nPivSpeed = cart_point.x;\n fPivScale = (Math.abs(cart_point.y)>fPivYLimit)? 0.0 : (1.0 - Math.abs(cart_point.y)/fPivYLimit);\n\n // Calculate final mix of Drive and Pivot, produces normalised values between -1 and 1\n double motor_a_prescale = ( (1.0-fPivScale)*nMotPremixL + fPivScale*( nPivSpeed) ) /100;\n double motor_b_prescale = ( (1.0-fPivScale)*nMotPremixR + fPivScale*(-nPivSpeed) ) /100;\n\n // convert normalised values to usable motor range\n motor_a = (int)( motor_a_prescale * (max_motor_speed - min_motor_speed) + (Math.signum(motor_a_prescale)*min_motor_speed) );\n motor_b = (int)( motor_b_prescale * (max_motor_speed - min_motor_speed) + (Math.signum(motor_b_prescale)*min_motor_speed) );\n\n }", "float getVoltageStepIncrementOutOfPhase();", "int getOutputVoltage();", "public void outputToDashboard() {\n\n double theta = Math.toRadians(getAngleToTarget()); // we rename these for sake of sanity with the math\n double phi = Math.toRadians(getHeightAngleToTarget());\n double depthToTarget = getDistanceToTarget() * Math.cos(phi) * Math.cos(theta);\n double lengthToTarget = getDistanceToTarget() * Math.cos(phi) * Math.sin(theta);\n double heightToTarget = getDistanceToTarget() * Math.sin(phi);\n\n //from here we can add value to depth height and length easily because we are relative to the back hole in its basis.\n double depthToThreePointGoal = depthToTarget + Config.fieldVisionDepthOfThreePointHoleFromVisionTarget;\n double lengthToThreePointGoal = lengthToTarget;\n double heightToThreePointGoal = heightToTarget + Config.fieldVisionHeightOfThreePointHoleFromVisionTarget;\n\n double threePointHoleDistance = Math.sqrt(depthToThreePointGoal * depthToThreePointGoal + lengthToThreePointGoal * lengthToThreePointGoal + heightToThreePointGoal * heightToThreePointGoal);\n //WE'LL NEED THESE LATER HOLD ON TO THE FORMULAE FOR NOW\n double threePointHoleTx = Math.toDegrees(Math.asin(heightToThreePointGoal / threePointHoleDistance)); //aka adjusted phi, aka the angle we need to rotate by to be facing the 3 point goal\n double threePointHoleTy = Math.toDegrees(Math.atan2(lengthToThreePointGoal, depthToThreePointGoal)); //this and distance become the arm angle and power.\n\n SmartDashboard.putNumber(\"Three Point Hole Distance\", threePointHoleDistance);\n SmartDashboard.putNumber(\"Tx (Adjusted)\", threePointHoleTx);\n SmartDashboard.putNumber(\"Ty (Adjusted)\", threePointHoleTy);\n SmartDashboard.putNumber(\"Vision Distance\", getDistanceToTarget());\n SmartDashboard.putNumber(\"Distance to Alliance Wall (Depth)\", depthToTarget);\n }", "private void calculateVelocity() {\n\t\tthis.velocity = Math.sqrt((this.roughRange *this.roughRange * this.gravity_Math)\n\t\t\t\t/ ((this.roughRange * Math.sin(2 * angle)) + (2\n\t\t\t\t\t\t* Constant.heroBaseHeight * Math.cos(angle) * Math\n\t\t\t\t\t\t\t.cos(angle))));\n\t\t\n\t}", "public void setTurretTargetAngle(double target){\r\n\t\tturretTarget = target;\r\n\t}", "public int getVoltage ()\n {\n return _voltage;\n }", "public void adjustShooterAngleManual() {\n\n // If the driver pushes the Square Button on the PS4 Controller,\n // set the worm drive motors to go backwards (lower it).\n if (PS4.getRawButton(PS4_X_BUTTON) == true) {\n\n wormDriveMotors.set(-0.2);\n\n // If the driver pushes the Triangle Button on the PS4 Controller,\n // set the worm drive motors to go forwards (raise it up).\n } else if (PS4.getRawButton(PS4_SQUARE_BUTTON) == true) {\n\n wormDriveMotors.set(0.4);\n }\n\n // If the driver is an idiot and is pressing BOTH the Square Button AND the\n // Triangle Button at the same time, OR (||) if the driver is pushing neither\n // button, set the motor speed to 0.\n else if (((PS4.getRawButton(PS4_X_BUTTON) == true) && (PS4.getRawButton(PS4_SQUARE_BUTTON) == true))\n || ((PS4.getRawButton(PS4_X_BUTTON) == false) && (PS4.getRawButton(PS4_SQUARE_BUTTON) == false))) {\n\n wormDriveMotors.set(0);\n }\n\n }", "public int getCurrentAngle(){\n return flatbed.currentAngle;\n }", "double getCalibratedLevelAngle();", "int getInputVoltageRaw();", "public void pivotTo(float targetAngle){\n float currentAngle = tracker.getAbsoluteAngle();\n if(Math.abs(currentAngle - targetAngle) > 180){ // must cross the line theta = 0\n if(currentAngle > targetAngle){\n pivotClockwise(360 - (currentAngle - targetAngle)); } else if(targetAngle > currentAngle){\n pivotCounterclockwise(360 - (targetAngle - currentAngle));\n }\n } else{\n if(currentAngle > targetAngle){\n pivotCounterclockwise(currentAngle - targetAngle);\n } else if(targetAngle > currentAngle){\n pivotClockwise(targetAngle - currentAngle);\n }\n }\n }", "public static double calculateAngleInDegrees(Vector3D sourceLocation, Vector3D listenerLocation, Speaker speakerPojo) {\n Vector listener = listenerLocation.toLa4j();\n Vector source = sourceLocation.toLa4j();\n Vector speaker = speakerPojo.getPosition().toLa4j();\n double angle = calculateAngleInDegrees(listener, source, speaker);\n // In case of the listener being at exactly the same position as either the source or the speaker,\n // there is no angle (NaN), so fall back to a default value.\n if (angle == Double.NaN) {\n if (listener.equals(source)) {\n // If the listener is 'in' the source, all speakers are equal.\n angle = 0;\n } else {\n // If the listener is 'in' the speaker, 'disable' that speaker by giving it the max angle.\n angle = 180;\n }\n }\n return angle;\n }", "double getVx() { return vel[0]; }", "public MoverToAngle(\n final double aTarget,\n final double aTargetTolerance,\n final PIDController aDistanceController,\n final PIDController aAngleController\n ) {\n mTargetAngle = aTarget;\n mTargetTolerance = aTargetTolerance;\n mDistanceController = aDistanceController;\n mDistanceController.reset();\n mAngleController = aAngleController;\n mAngleController.reset();\n \n mSpeed = 0;\n mTurnRate = 0;\n }", "@Override\n public void initialize() {\n setPoint = (((targetAngle + driveSubsystem.getHeading() + 180) % 360) - 180);\n }", "public AccOrientation calculateAngle(SensorEvent event) {\t\t\n\t final int _DATA_X = 0;\n\t final int _DATA_Y = 1;\n\t final int _DATA_Z = 2;\n\t // Angle around x-axis thats considered almost perfect vertical to hold\n\t // the device\n\t final int PIVOT = 20;\n\t // Angle around x-asis that's considered almost too vertical. Beyond\n\t // this angle will not result in any orientation changes. f phone faces uses,\n\t // the device is leaning backward.\n\t final int PIVOT_UPPER = 65;\n\t // Angle about x-axis that's considered negative vertical. Beyond this\n\t // angle will not result in any orientation changes. If phone faces uses,\n\t // the device is leaning forward.\n\t final int PIVOT_LOWER = -10;\n\t // Upper threshold limit for switching from portrait to landscape\n\t final int PL_UPPER = 295;\n\t // Lower threshold limit for switching from landscape to portrait\n\t final int LP_LOWER = 320;\n\t // Lower threshold limt for switching from portrait to landscape\n\t final int PL_LOWER = 270;\n\t // Upper threshold limit for switching from landscape to portrait\n\t final int LP_UPPER = 359;\n\t // Minimum angle which is considered landscape\n\t final int LANDSCAPE_LOWER = 235;\n\t // Minimum angle which is considered portrait\n\t final int PORTRAIT_LOWER = 60;\n\t \n\t // Internal value used for calculating linear variant\n\t final float PL_LF_UPPER =\n\t ((float)(PL_UPPER-PL_LOWER))/((float)(PIVOT_UPPER-PIVOT));\n\t final float PL_LF_LOWER =\n\t ((float)(PL_UPPER-PL_LOWER))/((float)(PIVOT-PIVOT_LOWER));\n\t // Internal value used for calculating linear variant\n\t final float LP_LF_UPPER =\n\t ((float)(LP_UPPER - LP_LOWER))/((float)(PIVOT_UPPER-PIVOT));\n\t final float LP_LF_LOWER =\n\t ((float)(LP_UPPER - LP_LOWER))/((float)(PIVOT-PIVOT_LOWER));\n\t \n\t int mSensorRotation = -1; \n\t \n\t\t\tfinal boolean VERBOSE = true;\n float[] values = event.values;\n float X = values[_DATA_X];\n float Y = values[_DATA_Y];\n float Z = values[_DATA_Z];\n float OneEightyOverPi = 57.29577957855f;\n float gravity = (float) Math.sqrt(X*X+Y*Y+Z*Z);\n float zyangle = (float)Math.asin(Z/gravity)*OneEightyOverPi;\n int rotation = -1;\n float angle = (float)Math.atan2(Y, -X) * OneEightyOverPi;\n int orientation = 90 - (int)Math.round(angle);\n AccOrientation result = new AccOrientation();\n \n while (orientation >= 360) {\n orientation -= 360;\n } \n while (orientation < 0) {\n orientation += 360;\n }\n result.orientation = orientation;\n result.angle = zyangle; \n result.threshold = 0;\n if ((zyangle <= PIVOT_UPPER) && (zyangle >= PIVOT_LOWER)) {\n // Check orientation only if the phone is flat enough\n // Don't trust the angle if the magnitude is small compared to the y value\n \t/*\n float angle = (float)Math.atan2(Y, -X) * OneEightyOverPi;\n int orientation = 90 - (int)Math.round(angle);\n normalize to 0 - 359 range\n while (orientation >= 360) {\n orientation -= 360;\n } \n while (orientation < 0) {\n orientation += 360;\n }\n mOrientation.setText(String.format(\"Orientation: %d\", orientation));\n */ \n // Orientation values between LANDSCAPE_LOWER and PL_LOWER\n // are considered landscape.\n // Ignore orientation values between 0 and LANDSCAPE_LOWER\n // For orientation values between LP_UPPER and PL_LOWER,\n // the threshold gets set linearly around PIVOT.\n if ((orientation >= PL_LOWER) && (orientation <= LP_UPPER)) {\n float threshold;\n float delta = zyangle - PIVOT;\n if (mSensorRotation == ROTATION_090) {\n if (delta < 0) {\n // Delta is negative\n threshold = LP_LOWER - (LP_LF_LOWER * delta);\n } else {\n threshold = LP_LOWER + (LP_LF_UPPER * delta);\n }\n rotation = (orientation >= threshold) ? ROTATION_000 : ROTATION_090;\n if (mShowLog) \n \tLog.v(TAG, String.format(\"CASE1. %2.4f %d %2.4f %d\", delta, orientation, threshold, rotation));\n } else {\n if (delta < 0) {\n // Delta is negative\n threshold = PL_UPPER+(PL_LF_LOWER * delta);\n } else {\n threshold = PL_UPPER-(PL_LF_UPPER * delta);\n }\n rotation = (orientation <= threshold) ? ROTATION_090: ROTATION_000;\n if (mShowLog)\n \tLog.v(TAG, String.format(\"CASE2. %2.4f %d %2.4f %d\", delta, orientation, threshold, rotation));\n }\n result.threshold = threshold;\n } else if ((orientation >= LANDSCAPE_LOWER) && (orientation < LP_LOWER)) {\n rotation = ROTATION_090;\n if (mShowLog)\n \tLog.v(TAG, String.format(\"CASE3. 90 (%d)\", orientation));\n } else if ((orientation >= PL_UPPER) || (orientation <= PORTRAIT_LOWER)) {\n rotation = ROTATION_000;\n if (mShowLog)\n \tLog.v(TAG, String.format(\"CASE4. 00 (%d)\", orientation)); \n } else {\n \tif (mShowLog)\n \t\tLog.v(TAG, \"CASE5. \"+orientation);\n }\n if ((rotation != -1) && (rotation != mSensorRotation)) {\n mSensorRotation = rotation;\n if (mSensorRotation == ROTATION_000) {\n \t\t//setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_PORTRAIT);\n \tif (mShowLog)\n \t\tLog.w(TAG, \"Rotation: 00\");\n }\n else if (mSensorRotation == ROTATION_090) \n {\n \t\t//setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE);\n \tif (mShowLog)\n \t\tLog.w(TAG, \"Rotation: 90\");\n } \n }\n result.rotation = rotation;\n } else {\n \t//Log.v(TAG, String.format(\"Invalid Z-Angle: %2.4f (%d %d)\", zyangle, PIVOT_LOWER, PIVOT_UPPER));\n }\t\n return result;\n\t\t}", "int getInputVoltage();", "@Override\n public void onSensorChanged(SensorEvent event) {\n theta = (float) Math.toDegrees(Math.atan(event.values[1] / event.values[2]));\n\n\n }", "public double getdegRotationToTarget() {\n NetworkTableEntry tx = m_table.getEntry(\"tx\");\n double x = tx.getDouble(0.0);\n return x;\n }", "double getVy() { return vel[1]; }", "int getOutputVoltageRaw();", "public double getAngle() {\n\t\treturn armMotor.getEncPosition();\n\t}", "public void turnAbsolute(int target)\n {\n int heading = 360 - mrGyro.getHeading(); //Set variables to gyro readings\n double turnSpeed = 0.15;\n\n while (Math.abs(heading - target) > 45)\n { //Continue while the robot direction is further than three degrees from the target\n if (heading > target) //if gyro is positive, we will turn right\n {\n movePower(\"left\", 0.5, 0.01);\n }\n\n if (heading < target)\n {\n movePower(\"right\", 0.5, 0.01);\n }\n heading = 360 - mrGyro.getHeading(); //Set variables to gyro readings\n telemetry.addData(\"heading\", String.format(\"%03d\", heading));\n telemetry.update();\n }\n while (Math.abs(heading - target) > 10)\n { //Continue while the robot direction is further than three degrees from the target\n if (heading > target) //if gyro is positive, we will turn right\n {\n movePower(\"left\", 0.1, 0.01);\n }\n\n if (heading < target)\n {\n movePower(\"right\", 0.1, 0.01);\n }\n heading = 360 - mrGyro.getHeading(); //Set variables to gyro readings\n telemetry.addData(\"heading\", String.format(\"%03d\", heading));\n telemetry.update();\n }\n while (Math.abs(heading - target) > 5)\n { //Continue while the robot direction is further than three degrees from the target\n if (heading > target) //if gyro is positive, we will turn right\n {\n movePower(\"left\", 0.01, 0.01);\n }\n\n if (heading < target)\n {\n movePower(\"right\", 0.01, 0.01);\n }\n heading = 360 - mrGyro.getHeading(); //Set variables to gyro readings\n telemetry.addData(\"heading\", String.format(\"%03d\", heading));\n telemetry.update();\n }\n stop();\n }", "private float calculateAngles(){\n\t\t// First we will move the current angle heading into the previous angle heading slot.\n\t\tdata.PID.headings[0] = data.PID.headings[1];\n\t\t// Then, we assign the new angle heading.\n\t\tdata.PID.headings[1] = data.imu.getAngularOrientation().firstAngle;\n\n\t\t// Finally we calculate a computedTarget from the current angle heading.\n\t\tdata.PID.computedTarget = data.PID.headings[1] + (data.PID.IMURotations * 360);\n\n\t\t// Now we determine if we need to re-calculate the angles.\n\t\tif(data.PID.headings[0] > 300 && data.PID.headings[1] < 60) {\n\t\t\tdata.PID.IMURotations++; //rotations of 360 degrees\n\t\t\tcalculateAngles();\n\t\t} else if(data.PID.headings[0] < 60 && data.PID.headings[1] > 300) {\n\t\t\tdata.PID.IMURotations--;\n\t\t\tcalculateAngles();\n\t\t}\n\t\treturn data.PID.headings[1];\n\t}", "public static double bestDirTurn(double startAngle, double targetAngle) {\n double delta = (targetAngle - startAngle + 540) % 360 - 180;\n return delta;\n }", "EDataType getVoltage();", "double getVerDist(double initial_ver_vel, double time)\n {\n uy = initial_ver_vel;\n t = time;\n y = (uy*t) +(g*t*t)/2; \n return y;\n }", "void object_upper_eyes_level_calc(){\n down_angle=Math.abs(down_angle);\n up_angle=Math.abs(up_angle);\n\n angle_with_ground=90-angle_with_ground;\n distance_from_object=human_length*Math.tan(Math.toRadians(angle_with_ground));\n double part=distance_from_object*Math.tan(Math.toRadians(down_angle));\n double all=distance_from_object*Math.tan(Math.toRadians(up_angle));\n length_of_object=all-part;\n object_height_from_ground=human_length+part;\n ORI.setText(\"length_of_object :\\n\" +String.valueOf(String.format(\"%.2f\",(length_of_object/100))) +\" M\"+ \"\\n\" + \"distance_from_object :\\n\" + String.valueOf(String.format(\"%.2f\",(distance_from_object/100)))+\" M\" + \"\\n\"+\"height_from_ground :\\n\" + String.valueOf(String.format(\"%.2f\",(object_height_from_ground/100)))+\" M\");\n ORI.setVisibility(View.VISIBLE);\n }", "double getVz() { return vel[2]; }", "public void setAngle( double a ) { angle = a; }", "private double getVelocity() {\n \tif (currentState == DriveState.accelerating) {\n \t\treturn acceleration * timer.get();\n \t}\n \telse if (currentState == DriveState.cruisung) {\n \t\treturn maxVelocity;\n \t}\n \telse if (currentState == DriveState.decelerating) {\n \t\treturn maxVelocity - acceleration * (timer.get());\n \t}\n \t\t\n \treturn 0;\n }", "public void angleTurn(float angle, int timeout){\n\t\tcalculateAngles();\n\n\t\t// Get the current program time and starting encoder position before we start our drive loop\n\t\tfloat StartTime = data.time.currentTime();\n\t\tfloat StartPosition = data.drive.leftDrive.getCurrentPosition();\n\n\t\t// Reset our Integral and Derivative data.\n\t\tdata.PID.integralData.clear();\n\t\tdata.PID.derivativeData.clear();\n\n\n\t\t// Manually calculate our first target\n\t\tdata.PID.target = (calculateAngles() + (data.PID.IMURotations * 360)) + angle;\n\n\t\t// We need to keep track of how much time passes between a loop.\n\t\tfloat LoopTime = data.time.currentTime();\n\n\t\t// This is the main loop of our straight drive.\n\t\t// We use encoders to form a loop that corrects rotation until we reach our target.\n\t\twhile(StartTime + timeout > data.time.currentTime()){\n\n\t\t\t// Record the time since the previous loop.\n\t\t\tLoopTime = data.time.timeFrom(LoopTime);\n\t\t\t// Calculate our angles. This method may modify the input Rotations.\n\t\t\t//IMURotations =\n\t\t\tcalculateAngles();\n\t\t\t// Calculate our PID\n\t\t\tcalculatePID(LoopTime);\n\n\t\t\t// Calculate the Direction to travel to correct any rotational errors.\n\t\t\tfloat Direction = ((data.PID.I * data.PID.ITuning) / 2000) + ((data.PID.P * data.PID.PTuning) / 2000) + ((data.PID.D * data.PID.DTuning) / 2000);;\n\n\t\t\tif(Math.abs(Direction) <= 0.03f) {\n\t\t\t\tbreak;\n\t\t\t}\n\n\t\t\tdata.drive.rightDrive.setPower(data.drive.POWER_CONSTANT - (Direction));\n\t\t\tdata.drive.leftDrive.setPower(data.drive.POWER_CONSTANT + (Direction));\n\t\t}\n\t\t// Our drive loop has completed! Stop the motors.\n\t\tdata.drive.rightDrive.setPower(0);\n\t\tdata.drive.leftDrive.setPower(0);\n\t}", "public double getDistance(){\n return sensor.getVoltage()*100/2.54 - 12;\n }", "AngleResource inclination();", "private void calculateLocation()\r\n\t{\r\n\t\tdouble leftAngleSpeed \t= this.angleMeasurementLeft.getAngleSum() / ((double)this.angleMeasurementLeft.getDeltaT()/1000); //degree/seconds\r\n\t\tdouble rightAngleSpeed \t= this.angleMeasurementRight.getAngleSum() / ((double)this.angleMeasurementRight.getDeltaT()/1000); //degree/seconds\r\n\r\n\t\tdouble vLeft\t= (leftAngleSpeed * Math.PI * LEFT_WHEEL_RADIUS ) / 180 ; //velocity of left wheel in m/s\r\n\t\tdouble vRight\t= (rightAngleSpeed * Math.PI * RIGHT_WHEEL_RADIUS) / 180 ; //velocity of right wheel in m/s\t\t\r\n\t\tdouble w \t\t= (vRight - vLeft) / WHEEL_DISTANCE; //angular velocity of robot in rad/s\r\n\t\t\r\n\t\tDouble R \t= new Double(( WHEEL_DISTANCE / 2 ) * ( (vLeft + vRight) / (vRight - vLeft) ));\t\t\t\t\t\t\t\t\r\n\t\t\r\n\t\tdouble ICCx = 0;\r\n\t\tdouble ICCy = 0;\r\n\r\n\t\tdouble W_xResult \t\t= 0;\r\n\t\tdouble W_yResult \t\t= 0;\r\n\t\tdouble W_angleResult \t= 0;\r\n\t\t\r\n\t\tdouble E_xResult \t\t= 0;\r\n\t\tdouble E_yResult \t\t= 0;\r\n\t\tdouble E_angleResult \t= 0;\r\n\t\t\r\n\t\t//short axe = 0;\r\n\t\t\r\n\t\tdouble deltaT = ((double)this.angleMeasurementLeft.getDeltaT())/1000;\r\n\t\t\r\n\t\t// Odometry calculations\r\n\t\tif (R.isNaN()) \t\t\t\t//robot don't move\r\n\t\t{\r\n\t\t\tW_xResult\t\t= this.pose.getX();\r\n\t\t\tW_yResult\t\t= this.pose.getY();\r\n\t\t\tW_angleResult \t= this.pose.getHeading();\r\n\t\t} \r\n\t\telse if (R.isInfinite()) \t//robot moves straight forward/backward, vLeft==vRight\r\n\t\t{ \r\n\t\t\tW_xResult\t\t= this.pose.getX() + vLeft * Math.cos(this.pose.getHeading()) * deltaT;\r\n\t\t\tW_yResult\t\t= this.pose.getY() + vLeft * Math.sin(this.pose.getHeading()) * deltaT;\r\n\t\t\tW_angleResult \t= this.pose.getHeading();\r\n\t\t} \r\n\t\telse \r\n\t\t{\t\t\t\r\n\t\t\tICCx = this.pose.getX() - R.doubleValue() * Math.sin(this.pose.getHeading());\r\n\t\t\tICCy = this.pose.getY() + R.doubleValue() * Math.cos(this.pose.getHeading());\r\n\t\t\r\n\t\t\tW_xResult \t\t= Math.cos(w * deltaT) * (this.pose.getX()-ICCx) - Math.sin(w * deltaT) * (this.pose.getY() - ICCy) + ICCx;\r\n\t\t\tW_yResult \t\t= Math.sin(w * deltaT) * (this.pose.getX()-ICCx) + Math.cos(w * deltaT) * (this.pose.getY() - ICCy) + ICCy;\r\n\t\t\tW_angleResult \t= this.pose.getHeading() + w * deltaT;\r\n\t\t}\r\n\t\t\r\n\t\tthis.pose.setLocation((float)W_xResult, (float)W_yResult);\r\n\t\tthis.pose.setHeading((float)W_angleResult);\r\n\t\t\r\n\t\t// Conversion to grads\r\n\t\tW_angleResult = W_angleResult/Math.PI*180;\r\n\t\t\r\n\t\t// Get the heading axe\r\n\t\t//axe = getHeadingAxe();\r\n\t\tgetHeadingAxe();\r\n\t\t\r\n\t\t// Verify the coordinates and the heading angle\r\n\t\tif (Po_Corn == 1)\r\n\t\t{\r\n\t\t\tswitch (Po_CORNER_ID)\r\n\t\t\t{\r\n\t\t\t\tcase 0:\r\n\t\t\t\t\tE_xResult = 0;\r\n\t\t\t\t\tE_yResult = 0;\r\n\t\t\t\t\tPo_ExpAng = 0;\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase 1:\r\n\t\t\t\t\tE_xResult = 1.8;\r\n\t\t\t\t\tE_yResult = 0.11;\r\n\t\t\t\t\tPo_ExpAng = 90;\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase 2:\r\n\t\t\t\t\tE_xResult = 1.6;\r\n\t\t\t\t\tE_yResult = 0.6;\r\n\t\t\t\t\tPo_ExpAng = 180;\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase 3:\r\n\t\t\t\t\tE_xResult = 1.5;\r\n\t\t\t\t\tE_yResult = 0.45;\r\n\t\t\t\t\tPo_ExpAng = 270;\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase 4:\r\n\t\t\t\t\tE_xResult = 1.5;\r\n\t\t\t\t\tE_yResult = 0.3;\r\n\t\t\t\t\tPo_ExpAng = 180;\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase 5:\r\n\t\t\t\t\tE_xResult = 0.3;\r\n\t\t\t\t\tE_yResult = 0.3;\r\n\t\t\t\t\tPo_ExpAng = 90;\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase 6:\r\n\t\t\t\t\tE_xResult = 0.3;\r\n\t\t\t\t\tE_yResult = 0.6;\r\n\t\t\t\t\tPo_ExpAng = 180;\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase 7:\r\n\t\t\t\t\tE_xResult = 0;\r\n\t\t\t\t\tE_yResult = 0.6;\r\n\t\t\t\t\tPo_ExpAng = 270;\r\n\t\t\t\t\tbreak;\t\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tE_angleResult = W_angleResult;\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\tint block = 0;\r\n\t\t\t// white = 0, black = 2, grey = 1\r\n\t\t\tif ((lineSensorLeft == 0) && (lineSensorRight == 0) && (block == 0)) \t// Robot moves on the black line\r\n\t\t\t{\r\n\t\t\t\tswitch (Po_CORNER_ID)\t\t\t\t\t\t\t\t// Even numbers - x, Odd numbers - y\r\n\t\t\t\t{\r\n\t\t\t\tcase 0: \r\n\t\t\t\t\tif (this.pose.getX() < 1.6)\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tE_angleResult = Po_ExpAng;\r\n\t\t\t\t\t\tE_yResult = 0;\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tE_angleResult = W_angleResult;\r\n\t\t\t\t\t\tE_yResult = W_yResult;\r\n\t\t\t\t\t}\r\n\t\t\t\t\tE_xResult = W_xResult;\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t\t\r\n\t\t\t\tcase 1: \r\n\t\t\t\t\tif (this.pose.getY() < 0.4)\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tE_angleResult = Po_ExpAng;\r\n\t\t\t\t\t\tE_xResult = 1.8;\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tE_angleResult = W_angleResult; \r\n\t\t\t\t\t\tE_xResult = W_xResult;\r\n\t\t\t\t\t}\r\n\t\t\t\t\tE_yResult = W_yResult;\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t\t\r\n\t\t\t\tcase 2:\r\n\t\t\t\t\tif (this.pose.getX() > 1.65)\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tE_angleResult = Po_ExpAng;\r\n\t\t\t\t\t\tE_yResult = 0.6;\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tE_angleResult = W_angleResult;\r\n\t\t\t\t\t\tE_yResult = W_yResult;\r\n\t\t\t\t\t}\r\n\t\t\t\t\tE_xResult = W_xResult;\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t\t\r\n\t\t\t\tcase 3:\r\n\t\t\t\t\tif (this.pose.getY() > 0.4)\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tE_angleResult = Po_ExpAng;\r\n\t\t\t\t\t\tE_xResult = 1.5; \r\n\t\t\t\t\t}\r\n\t\t\t\t\telse\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tE_angleResult = W_angleResult; \r\n\t\t\t\t\t\tE_xResult = W_xResult;\r\n\t\t\t\t\t}\r\n\t\t\t\t\tE_yResult = W_yResult;\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t\t\r\n\t\t\t\tcase 4: \r\n\t\t\t\t\tif (this.pose.getX() > 0.4)\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tE_angleResult = Po_ExpAng;\r\n\t\t\t\t\t\tE_yResult = 0.3;\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tE_angleResult = W_angleResult;\r\n\t\t\t\t\t\tE_yResult = W_yResult;\r\n\t\t\t\t\t}\r\n\t\t\t\t\tE_xResult = W_xResult;\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t\t\r\n\t\t\t\tcase 5:\r\n\t\t\t\t\tif (this.pose.getY() < 0.5)\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tE_angleResult = Po_ExpAng;\r\n\t\t\t\t\t\tE_xResult = 0.3;\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tE_angleResult = W_angleResult; \r\n\t\t\t\t\t\tE_xResult = W_xResult;\r\n\t\t\t\t\t}\r\n\t\t\t\t\tE_yResult = W_yResult;\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t\t\r\n\t\t\t\tcase 6: \r\n\t\t\t\t\tif (this.pose.getX() > 0.1)\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tE_angleResult = Po_ExpAng;\r\n\t\t\t\t\t\tE_yResult = 0.6;\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tE_angleResult = W_angleResult;\r\n\t\t\t\t\t\tE_yResult = W_yResult;\r\n\t\t\t\t\t}\r\n\t\t\t\t\tE_xResult = W_xResult;\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t\t\r\n\t\t\t\tcase 7:\r\n\t\t\t\t\tif (this.pose.getY() > 0.1)\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tE_angleResult = Po_ExpAng;\r\n\t\t\t\t\t\tE_xResult = 0;\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tE_angleResult = W_angleResult; \r\n\t\t\t\t\t\tE_xResult = W_xResult;\r\n\t\t\t\t\t}\r\n\t\t\t\t\tE_yResult = W_yResult;\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t\t\r\n\t\t\t\tdefault: \r\n\t\t\t\t\tE_angleResult = W_angleResult;\r\n\t\t\t\t\tE_yResult = W_yResult;\r\n\t\t\t\t\tE_xResult = W_xResult;\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\telse if(((lineSensorLeft == 0) && (lineSensorRight == 2)) || ((lineSensorLeft == 2) && (lineSensorRight == 0)))\r\n\t\t\t{\r\n\t\t\t\tE_xResult = W_xResult;\r\n\t\t\t\tE_yResult = W_yResult;\r\n\t\t\t\t\r\n\t \tif (W_angleResult >= TRSH_W)\r\n\t \t{\r\n\t \t\tE_angleResult = TRSH_W;\r\n\t \t}\r\n\t \telse if (W_angleResult >= (360 - TRSH_W))\r\n\t \t{\r\n\t \t\tE_angleResult = 360 - TRSH_W;\r\n\t \t}\r\n\t \telse\r\n\t \t{\r\n\t \t\tE_angleResult = W_angleResult;\r\n\t \t}\r\n\t \t\r\n\t \t// test\r\n\t \tE_angleResult = W_angleResult;\r\n\t\t\t}\r\n\t\t\telse if(((lineSensorLeft == 0) && (lineSensorRight == 1)) || ((lineSensorLeft == 1) && (lineSensorRight == 0)))\r\n\t\t\t{\r\n\t\t\t\tE_xResult = W_xResult;\r\n\t\t\t\tE_yResult = W_yResult;\r\n\t\t\t\t\r\n\t \tif (W_angleResult >= TRSH_G)\r\n\t \t{\r\n\t \t\tE_angleResult = TRSH_G;\r\n\t \t}\r\n\t \telse if (W_angleResult >= (360 - TRSH_G))\r\n\t \t{\r\n\t \t\tE_angleResult = 360 - TRSH_G;\r\n\t \t}\r\n\t \telse\r\n\t \t{\r\n\t \t\tE_angleResult = W_angleResult;\r\n\t \t}\r\n\t \t\r\n\t \t// test\r\n\t \tE_angleResult = W_angleResult;\r\n\t\t\t}\r\n\t\t\telse\r\n\t\t\t{\r\n\t\t\t\tE_xResult = W_xResult;\r\n\t\t\t\tE_yResult = W_yResult;\r\n\t\t\t\tE_angleResult = W_angleResult;\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\tLCD.drawString(\"AngRs: \" + (E_angleResult), 0, 7);\r\n\t\t\r\n\t\t// Conversion to rads\r\n\t\tW_angleResult = W_angleResult*Math.PI/180;\r\n\t\tE_angleResult = E_angleResult*Math.PI/180;\r\n\t\t\r\n\t\tif ((Po_CORNER_ID == 3) && (100*this.pose.getY() < 45))\r\n\t\t{\r\n\t\t\tE_angleResult = 3*Math.PI/180;;\r\n\t\t}\r\n\t\t\r\n\t\tthis.pose.setLocation((float)E_xResult, (float)E_yResult);\r\n\t\tthis.pose.setHeading((float)E_angleResult);\r\n\t\t\r\n\t\t/*\r\n\t\t// Integration deviation correction\r\n\t\tthis.pose.setLocation((float)(W_xResult), (float)(W_yResult + (0.01*22.4)/175));\r\n\t\tthis.pose.setHeading((float)((W_angleResult + 14/175)*Math.PI/180));\r\n\t\t*/\r\n\t}", "public double getdegVerticalToTarget() {\n NetworkTableEntry ty = m_table.getEntry(\"ty\");\n double y = ty.getDouble(0.0);\n return y;\n }", "public double getAngleBetween(Vector other){\n\t\treturn Math.acos(dot(other)/(magnitude() * other.magnitude()));\n\t}", "void take_angles() {\n\n rolls+=String.valueOf((Math.toDegrees(orientation[2]))%360+90)+\"\\n\";\n if(!touch_ground_switch.isChecked()&&angle_with_ground==0)\n angle_with_ground=adjust_angle_rotation(Math.toDegrees(orientation[2]) % 360 + 90);\n else if (down_angle == 0)\n down_angle=adjust_angle_rotation(Math.toDegrees(orientation[2]) % 360 + 90);\n else if(up_angle==0)\n {\n up_angle=adjust_angle_rotation(Math.toDegrees(orientation[2]) % 360 + 90);\n touch_ground_switch.setVisibility(View.INVISIBLE);\n if(!touch_ground_switch.isChecked())\n object_calculations_doesnt_touch_ground();\n else\n object_calculations_touch_ground();\n }\n}", "protected double findAngleToEnemy(Movable enemy){\n\t\tdouble enemyX = enemy.getX() - x;\n\t\tdouble enemyY = enemy.getY() - y;\n\t\treturn Math.atan2(enemyX, enemyY);\n\t}", "double getAngle();", "double getAngle();", "void object_on_eyes_level_calc(){\n down_angle=Math.abs(down_angle);\n up_angle=Math.abs(up_angle);\n angle_with_ground=90-angle_with_ground;\n distance_from_object=human_length*Math.tan(Math.toRadians(angle_with_ground));\n double part_down=distance_from_object*Math.tan(Math.toRadians(down_angle));\n double part_up=distance_from_object*Math.tan(Math.toRadians(up_angle));\n length_of_object=part_down+part_up;\n object_height_from_ground=human_length-part_down;\n ORI.setText(\"length_of_object :\\n\" +String.valueOf(String.format(\"%.2f\",(length_of_object/100)))\n +\" M\"+ \"\\n\" + \"distance_from_object :\\n\" + String.valueOf(String.format(\"%.2f\",(distance_from_object/100)))+\n \" M\" + \"\\n\"+\"height_from_ground :\\n\" + String.valueOf(String.format(\"%.2f\",(object_height_from_ground/100)))+\" M\");\n ORI.setVisibility(View.VISIBLE);\n }", "public void gyroDrive ( double speed,\n double distance,\n double angle) {\n\n int newLeftTarget;\n int newRightTarget;\n int moveCounts;\n double max;\n double error;\n double steer;\n double leftSpeed;\n double rightSpeed;\n\n // Ensure that the opmode is still active\n if (opModeIsActive()) {\n\n // Determine new target position, and pass to motor controller\n moveCounts = (int)(distance * COUNTS_PER_INCH);\n newLeftTarget = leftMotor.getCurrentPosition() + moveCounts;\n newRightTarget = rightMotor.getCurrentPosition() + moveCounts;\n\n // Set Target and Turn On RUN_TO_POSITION\n leftMotor.setTargetPosition(newLeftTarget);\n rightMotor.setTargetPosition(newRightTarget);\n\n leftMotor.setMode(DcMotor.RunMode.RUN_TO_POSITION);\n rightMotor.setMode(DcMotor.RunMode.RUN_TO_POSITION);\n\n // start motion.\n speed = Range.clip(Math.abs(speed), 0.0, 1.0);\n leftMotor.setPower(speed);\n rightMotor.setPower(speed);\n\n // keep looping while we are still active, and BOTH motors are running.\n while (opModeIsActive() &&\n (leftMotor.isBusy() && rightMotor.isBusy())) {\n\n // adjust relative speed based on heading error.\n error = getError(angle);\n steer = getSteer(error, P_DRIVE_COEFF);\n\n // if driving in reverse, the motor correction also needs to be reversed\n if (distance < 0)\n steer *= -1.0;\n\n leftSpeed = speed - steer;\n rightSpeed = speed + steer;\n\n // Normalize speeds if any one exceeds +/- 1.0;\n max = Math.max(Math.abs(leftSpeed), Math.abs(rightSpeed));\n if (max > 1.0)\n {\n leftSpeed /= max;\n rightSpeed /= max;\n }\n\n leftMotor.setPower(leftSpeed);\n rightMotor.setPower(rightSpeed);\n\n // Display drive status for the driver.\n telemetry.addData(\"Err/St\", \"%5.1f/%5.1f\", error, steer);\n telemetry.addData(\"Target\", \"%7d:%7d\", newLeftTarget, newRightTarget);\n telemetry.addData(\"Actual\", \"%7d:%7d\", leftMotor.getCurrentPosition(),\n rightMotor.getCurrentPosition());\n telemetry.addData(\"Speed\", \"%5.2f:%5.2f\", leftSpeed, rightSpeed);\n telemetry.update();\n }\n\n // Stop all motion;\n\n rightMotor.setPower(0);\n leftMotor.setPower(0);\n\n // Turn off RUN_TO_POSITION\n leftMotor.setMode(DcMotor.RunMode.RUN_USING_ENCODER);\n rightMotor.setMode(DcMotor.RunMode.RUN_USING_ENCODER);\n }\n }", "public double getAdvanced_RotationToTarget(Advanced_Target raw) {\n NetworkTableEntry txRaw = m_table.getEntry(\"tx\" + Integer.toString(raw.getValue()));\n double x = txRaw.getDouble(0.0);\n return x;\n }", "public float getTargetRotation ()\n {\n return _targetRotation;\n }", "double getVerVel(double initial_ver_vel, double time)\n {\n uy = initial_ver_vel;\n t = time;\n vy = uy - (g*t);\n return vy;\n }", "public double getAngle();", "public double getAngle() { return angle; }", "public void gyroDrive ( double speed,\n double distance,\n double angle) {\n\n\n // Ensure that the opmode is still activ\n\n // Determine new target position, and pass to motor controller\n moveCounts = (int)(distance * COUNTS_PER_INCH);\n newLeftTarget = leftmotor.getCurrentPosition() + moveCounts;\n newRightTarget = rightmotor.getCurrentPosition() + moveCounts;\n\n // Set Target and Turn On RUN_TO_POSITION\n leftmotor.setTargetPosition(newLeftTarget);\n rightmotor.setTargetPosition(newRightTarget);\n\n leftmotor.setMode(DcMotor.RunMode.RUN_TO_POSITION);\n rightmotor.setMode(DcMotor.RunMode.RUN_TO_POSITION);\n\n // start motion.\n speed = Range.clip(Math.abs(speed), 0.0, 1.0);\n\n maxSpeed = speed;\n speed = INCREMENT;\n rampUp = true;\n\n leftmotor.setPower(speed);\n rightmotor.setPower(speed);\n\n // keep looping while we are still active, and BOTH motors are running.\n while ((leftmotor.isBusy() && rightmotor.isBusy())) {\n if (rampUp){\n speed += INCREMENT ;\n if (speed >= maxSpeed ) {\n speed = maxSpeed;\n }\n }\n\n // adjust relative speed based on heading error.\n error = getError(angle);\n steer = getSteer(error, P_DRIVE_COEFF);\n\n // if driving in reverse, the motor correction also needs to be reversed\n if (distance < 0)\n steer *= -1.0;\n\n leftSpeed = speed - steer;\n rightSpeed = speed + steer;\n\n // Normalize speeds if either one exceeds +/- 1.0;\n max = Math.max(Math.abs(leftSpeed), Math.abs(rightSpeed));\n if (max > 1.0)\n {\n leftSpeed /= max;\n rightSpeed /= max;\n }\n\n leftmotor.setPower(leftSpeed);\n rightmotor.setPower(rightSpeed);\n }\n\n // Stop all motion;\n leftmotor.setPower(0);\n rightmotor.setPower(0);\n\n // Turn off RUN_TO_POSITION\n leftmotor.setMode(DcMotor.RunMode.RUN_USING_ENCODER);\n rightmotor.setMode(DcMotor.RunMode.RUN_USING_ENCODER);\n\n gyroHold(TURN_SPEED,angle,0.166);\n\n }", "private static double angulo(Point2D.Double p2,Point2D.Double p1){\n \t\n return Math.atan2(p2.x - p1.x, p2.y - p1.y);\n }", "public Elevator() {\n\t\t\n \tsuper(\"Elevator\", RobotConstants.ELEVATOR_P, RobotConstants.ELEVATOR_I, RobotConstants.ELEVATOR_D);\n \t\t\n\t\t// TODO Auto-generated constructor stub\n\t}", "@Override\n public double getPIDInput()\n {\n return target.getCurrentAngle();\n }", "protected long travel() {\n\n return Math.round(((1 / Factory.VERTEX_PER_METER_RATIO) / (this.speed / 3.6)) * 1000);\n }", "public float getBaseVerticalViewAngle() {\n \treturn mCamera.getParameters().getVerticalViewAngle();\n }", "public interface Elevator {\n public static final int UP = 1, LEVEL = 0, DOWN = -1, ERROR = -2;\n /** Returns the minimal floor number to which this Elevator can reach(often a negative value).\n * This is the same value as the lowest floor in the building - this elevator belongs to. */\n public int getMinFloor();\n /** Returns the maximal floor number to which this Elevator can reach.\n * This is the same value as the highest floor in the building - this elevator belongs to. */\n public int getMaxFloor();\n /** Returns the time (in seconds it takes the Elevator to open its doors. */\n public double getTimeForOpen();\n /** Returns the time (in seconds it takes the Elevator to close its doors */\n public double getTimeForClose();\n /** Returns the Elavator's current state: {UP, DOWN, LEVEL, ERROR} the state \"LEVEL\" mark that the elevator has reached the floor -\n * and is now ready to load / unload and get new orders. */\n public int getState(); // UP, DOWN, LEVEL, ERROR\n /** Returns the Elevator's current position (floor) as an Integer. */\n public int getPos();\n /** Moves the elevator form the current position to the destination floor. */\n public boolean goTo(int floor);\n /** Allows the elevator to stop in an intermidiate floor between src and dest, assumeing the elevator has not yer pass the desired floor in which it needs to stop. */\n public boolean stop(int floor);\n /** Returns the speed (in floor per second), e.g. if the Elevator speed is 0.4 - it takes it 2.5 seconds to pass a single floor. */\n public double getSpeed();\n /** Return the time in seconds that it takes the elevator to start moving in full speed (assumed to be a fixed value). */\n public double getStartTime();\n /** Return the time in seconds that it takes the elevator to stop moving in full speed (assumed to be a fixed value).*/\n public double getStopTime();\n /**\n * @return the id of this elevator (simple index as in the building).\n * Note: this index should be the same as in the elevator allocation algorithm.\n */\n public int getID();\n}", "public void raise(){\r\n elevatorTalon1.set(basePWM);\r\n elevatorTalon2.set(basePWM * pwmModifier);\r\n }", "private String accelConversion() {\n int reading = record[15] & 255;\n double voltage = (reading * 3.33) / 256;\n //return formatter.format(reading);\n return formatter.format((voltage / .290)*9.806);\n }", "public boolean turretAngleOnTarget() {\n return this.turretPIDController.atSetpoint();\n }", "void object_below_eyes_level_calc(){\n down_angle=Math.abs(down_angle);\n up_angle=Math.abs(up_angle);\n angle_with_ground=90-angle_with_ground;\n distance_from_object=human_length*Math.tan(Math.toRadians(angle_with_ground));\n double all=distance_from_object*Math.tan(Math.toRadians(down_angle));\n double part=distance_from_object*Math.tan(Math.toRadians(up_angle));\n length_of_object=all-part;\n object_height_from_ground=human_length-all;\n ORI.setText(\"length_of_object :\\n\" +String.valueOf(String.format(\"%.2f\",(length_of_object/100))) +\" M\"+ \"\\n\" + \"distance_from_object :\\n\" + String.valueOf(String.format(\"%.2f\",(distance_from_object/100)))+\" M\" + \"\\n\"+\"height_from_ground :\\n\" + String.valueOf(String.format(\"%.2f\",(object_height_from_ground/100)))+\" M\");\n ORI.setVisibility(View.VISIBLE);\n }", "public abstract void steer(double angle);", "public Rotation to(Bearing target) {\n int diff = ((target.getValue() - this.getValue() + 8) % 8);\n switch (diff) {\n case 0:\n return Rotation.NONE;\n case 2:\n return Rotation.R90;\n case 4:\n return Rotation.R180;\n case 6:\n return Rotation.L90;\n default:\n throw new RuntimeException();\n// throw new RuntimeException(\"Not implemented...\");\n }\n }", "public AngleIF() {\n \t\t//_navx = new navx();\n \t\t//roboAccel = new RoboRioAccelerometers();\n \t}", "@Override\n public void reAngle() {\n }", "private double getAngle() {\n double normal= Math.sqrt(((getgAxis(ADXL345_I2C.Axes.kX))*(getgAxis(ADXL345_I2C.Axes.kX)))+((getgAxis(ADXL345_I2C.Axes.kY))*(getgAxis(ADXL345_I2C.Axes.kY))));\n\n return MathUtils.atan(normal / getgAxis(ADXL345_I2C.Axes.kZ));\n }", "private double getAngle(){\n //Get a new angle measurement\n angles = imu.getAngularOrientation(AxesReference.INTRINSIC, AxesOrder.ZYX, AngleUnit.DEGREES);\n //Get the difference between current angle measurement and last angle measurement\n double deltaAngle = angles.firstAngle - lastAngles.firstAngle;\n\n //Process the angle to keep it within (-180,180)\n //(Once angle passes +180, it will rollback to -179, and vice versa)\n if (deltaAngle < -180)\n deltaAngle += 360;\n else if (deltaAngle > 180)\n deltaAngle -= 360;\n\n //Add the change in angle since last measurement (deltaAngle)\n //to the change in angle since last reset (globalAngle)\n globalAngle += deltaAngle;\n //Set last angle measurement to current angle measurement\n lastAngles = angles;\n\n return globalAngle;\n }", "public double angleBetween(Vector other) {\n double t = (getX()*other.getY() - getY()*other.getX());\n if(t == 0)\n return 0;\n t/=Math.abs(t);\n return t * Math.acos(scalar(other)/(length()*other.length()));\n }", "public String getUnitOfViewAngle() {\n \treturn \"degrees\";\n }", "public double toAngle()\n\t{\n\t\treturn Math.toDegrees(Math.atan2(y, x));\n\t}", "@Override\n\tpublic double calculateVelocity() {\n\t\tdouble result = distance / time + velocitySame - velocityReverse;\n\t\treturn result;\n\t}", "@Override\n public double getVelocity()\n {\n final String funcName = \"getVelocity\";\n double velocity = encoder.getVelocity() * encoderSign / 60.0;\n\n if (debugEnabled)\n {\n dbgTrace.traceEnter(funcName, TrcDbgTrace.TraceLevel.API);\n dbgTrace.traceExit(funcName, TrcDbgTrace.TraceLevel.API, \"=%f\", velocity);\n }\n\n return velocity;\n }", "protected void reachedTargetRotation ()\n {\n // clear turn direction\n ((Agent)_actor).setTurnDirection(0);\n\n // notify the behavior\n _behavior.reachedTargetRotation();\n }" ]
[ "0.6090433", "0.60391736", "0.6011782", "0.59853214", "0.59464693", "0.59402347", "0.5883112", "0.5776017", "0.5770762", "0.5676026", "0.55945", "0.54980415", "0.54864514", "0.5450998", "0.5432336", "0.5399394", "0.5397244", "0.5394043", "0.53805083", "0.5377813", "0.53753096", "0.5373386", "0.5364069", "0.5351341", "0.5329018", "0.53260607", "0.5297721", "0.5297561", "0.527821", "0.5255742", "0.5238983", "0.52234185", "0.5222939", "0.5213099", "0.52043045", "0.5191563", "0.51905555", "0.5186632", "0.5183751", "0.51771927", "0.51573557", "0.5155203", "0.51520044", "0.51501584", "0.51486516", "0.51456183", "0.5144735", "0.5140828", "0.51301044", "0.5125298", "0.51216036", "0.51158357", "0.51155066", "0.5108414", "0.5104435", "0.5102516", "0.5094269", "0.50865805", "0.50856733", "0.50812525", "0.5080324", "0.5077037", "0.5074267", "0.5071308", "0.50657165", "0.5063588", "0.5063119", "0.5062853", "0.5054419", "0.5054419", "0.50449175", "0.504478", "0.504466", "0.5019501", "0.5010851", "0.5006645", "0.50016356", "0.50008243", "0.49989346", "0.49986523", "0.49951532", "0.49913514", "0.49907687", "0.49840164", "0.49825746", "0.4979469", "0.4979455", "0.4977898", "0.49729934", "0.49700928", "0.49699026", "0.496827", "0.4960759", "0.4954615", "0.49510917", "0.49484354", "0.4944645", "0.4941716", "0.49393556", "0.49372196" ]
0.66960365
0
NOW uses StringPot.getVoltage to read voltage to move elevator, changes marked below
public void goTo(final double target){ final Thread thread = new Thread(new Runnable() { public void run(){ goToFlag = false; currentAngle = stringPot.getVoltage(); //change happened here shootTarget = target; while(target > currentAngle && target < maxLimit && currentAngle < maxLimit && canRun && elevateFlag){ currentAngle = stringPot.getVoltage();//change happened here System.out.println("raise " + target); raise(); if(target < currentAngle){ elevateFlag = false; break; } } while(target < currentAngle && target > minLimit && currentAngle > minLimit && canRun && elevateFlag){ currentAngle = stringPot.getVoltage();//change happened here System.out.println("lower " + target); lower(); if(target > currentAngle){ elevateFlag = false; break; } } //System.out.println("off"); off(); } }); thread.start(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public int getVoltage ()\n {\n return _voltage;\n }", "int getInputVoltageRaw();", "private static float getVoltage(String id) throws IOException, InterruptedException, NumberFormatException {\n return pi4jSystemInfoConnector.getVoltage(id);\r\n\r\n }", "EDataType getVoltage();", "int getInputVoltage();", "public void updateVoltage(double newVoltage) {\r\n\t\toutString = \"V\" + newVoltage + \"\\n\";\r\n\t\tmyPort.write(outString);\r\n\t\tmyPort.write('\\n');\r\n\t\tSystem.out.println(outString);\r\n\t}", "public void setVoltage(String vol, int upload_stat){//12.8V\n\t\tif(baseAct.serviceConn){\n//\t\t\tvolVal.setText(vol);\n\t\t\tString volDigit = \"\";\n\t\t\tfloat volF;\n\t\t\tlong volExp;\n\t\t\tif(vol.contains(\"v\") || vol.contains(\"V\"))\n\t\t\t\tvolDigit = vol.substring(0, vol.length()-1);\n\t\t\telse\n\t\t\t\tvolDigit = vol;\n\t\t\tvolF = Float.parseFloat(volDigit);\n\t\t\tif(volF < 13.01){\n\t\t\t\tvolExp = Preference.getInstance(baseAct.getApplicationContext()).getVolExp();\n\t\t\t\tif(volExp != 0){\n\t\t\t\t\tdouble volExpD = Double.longBitsToDouble(volExp);\t\t\n\t\t\t\t\tdouble expTime = (volExpD*(volF-10.5));\n\t\t\t\t\tlong expTimeL = (long) expTime;\n\t\t\t\t\tint day = 0, hr = 0;\n\t\t\t\t\tString notice = baseAct.getResources().getString(R.string.bat_expire_time);\n\t\t\t\t\tString expTimeStr = \"\";\n\t\t\t\t\t\n\t\t\t\t\tif((day = (int) (expTimeL/86400)) > 0){\n\t\t\t\t\t\texpTimeStr = expTimeStr + day + baseAct.getResources().getString(R.string.bat_day);\n\t\t\t\t\t\texpTimeL %= 86400;\n\t\t\t\t\t}\n\t\t\t\t\tif((hr = (int) (expTimeL/3600)) > 0){\n\t\t\t\t\t\texpTimeStr = expTimeStr + hr + baseAct.getResources().getString(R.string.bat_hour);\t\t\t\t\t\n\t\t\t\t\t}\n\t\t\t\t\tif(!expTimeStr.equals(\"\")){\n\t\t\t\t\t\tint rank = (int) ((volF-10.5)*6/(13-10.5));\n//\t\t\t\t\t\tif(day > 0)\n//\t\t\t\t\t\t\tbaseAct.tips_s.setBatteryInfo(Base.BAT_NORMAL, rank, notice+expTimeStr);\n//\t\t\t\t\t\telse\n//\t\t\t\t\t\t\tbaseAct.tips_s.setBatteryInfo(Base.BAT_LOW, rank, notice+expTimeStr);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif(upload_stat != 0)\n\t\t\t\t\tbaseAct.uploadVoltage(volDigit);\n\t\t\t}\n\t\t\t\n\t\t\tbaseAct.curVoltage = Float.parseFloat(volDigit);\n\t\t}\n\t\telse\n\t\t\tsaveBatteryVol(vol);\n\t}", "public synchronized float getVoltage(){\n\t\t getData(REG_MMXCOMMAND, buf, 1);\n\t\t // 37 is the constant given by Mindsensors support 5/2011 to return millivolts. KPT\n return (37f*(buf[0]&0xff))*.001f;\n\t}", "public void setVoltage(double voltage) {\n\t\tthis.voltage = voltage;\n\t}", "public double getVoltage() {\n\t\treturn this.voltage;\n\t}", "private String fixBattery(double voltage) {\n String volt = \"\" + voltage;\n String[] volts = volt.split(\"\\\\.\");\n String first = volts[0];\n String last = volts[1];\n if (volts[0].length() < 2) {\n first = \"0\" + volts[0];\n }\n if (volts[1].length() < 2) {\n last = volts[1] + \"0\";\n }\n return first + \".\" + last;\n }", "public static double getVoltage(LinearOpMode myLOM) {\n HardwareMap hardwareMap = myLOM.hardwareMap;\n\n // Use enum to access the voltage sensor without knowing its \n // name in the hardwareMap. Only one sensor will be found.\n List <VoltageSensor> voltageSensors;\n voltageSensors = hardwareMap.getAll(VoltageSensor.class);\n\n // make sure there is a sensor\n if (voltageSensors.size() > 0) {\n \n // iterate one time\n for (VoltageSensor myVoltageSensor : voltageSensors) {\n batteryVoltage = myVoltageSensor.getVoltage();\n } // end FOR loop\n } // end IF\n \n // provide voltage value to the calling Block\n return batteryVoltage;\n \n }", "int getOutputVoltage();", "int getOutputVoltageRaw();", "public void update (Elevator e, int name) {\n elevator = e;\n // Update the numerical information\n getInfo ();\n // Create a label for its current condition\n buildStrings (name, currCap, maxCap, currFloor, state);\n slider.setValue (currFloor);\n }", "private double getVelocity() {\n \tif (currentState == DriveState.accelerating) {\n \t\treturn acceleration * timer.get();\n \t}\n \telse if (currentState == DriveState.cruisung) {\n \t\treturn maxVelocity;\n \t}\n \telse if (currentState == DriveState.decelerating) {\n \t\treturn maxVelocity - acceleration * (timer.get());\n \t}\n \t\t\n \treturn 0;\n }", "private void configVelocityControl() {\n //config remote sensors\n //sets the sensor to be a quad encoder, sets our feedback device to be that sensor\n m_masterMotor.configSelectedFeedbackSensor(TalonSRXFeedbackDevice.CTRE_MagEncoder_Relative, RobotMap.PID_PRIMARY_SLOT, RobotMap.LAUNCHER_CONFIG_TIMEOUT_MS);\n\n //zero the encoders on every init\n zeroEncoder();\n\n //sets whether our motor is inverted\n //this is currently false but can be switched based on testing\n m_masterMotor.setInverted(RobotMap.LAUNCHER_MASTER_INVERTED);\n m_masterMotor.setSensorPhase(RobotMap.LAUNCHER_MASTER_INVERTED);\n\n //this sets how often we pull data from our sensor\n m_masterMotor.setStatusFramePeriod(StatusFrame.Status_2_Feedback0, RobotMap.LAUNCHER_FEEDBACK_PERIOD_MS, RobotMap.LAUNCHER_CONFIG_TIMEOUT_MS);\n\n //this configs the deadband for the PID output. Any output with an absolute value less than this will be treated as zero\n m_masterMotor.configNeutralDeadband(0, RobotMap.LAUNCHER_CONFIG_TIMEOUT_MS);\n\n //this sets the peak output for our motor controller.\n m_masterMotor.configPeakOutputForward(RobotMap.LAUNCHER_PID_PEAK_OUTPUT, RobotMap.LAUNCHER_CONFIG_TIMEOUT_MS);\n //this does the same thing but for the reverse direction\n m_masterMotor.configPeakOutputReverse(0, RobotMap.LAUNCHER_CONFIG_TIMEOUT_MS);\n \n //sets the period of the velocity sample\n //effectively this defines the amount of time used to calculate the velocity\n m_masterMotor.configVelocityMeasurementPeriod(RobotMap.VELOCITY_MEASUREMENT_PERIOD, RobotMap.LAUNCHER_CONFIG_TIMEOUT_MS);\n\n //Sets the number of samples used in the rolling average for calculating velocity\n m_masterMotor.configVelocityMeasurementWindow(RobotMap.LAUNCHER_VELOCITY_MEASUREMENT_WINDOW, RobotMap.LAUNCHER_CONFIG_TIMEOUT_MS);\n \n //set p, i, d, f values\n //the zero is the PID slot, in this case it is zero for the primary PID\n //the launcher has no auxillary or turning PID control\n m_masterMotor.config_kP(RobotMap.PID_PRIMARY_SLOT, RobotMap.LAUNCHER_P);\n m_masterMotor.config_kI(RobotMap.PID_PRIMARY_SLOT, RobotMap.LAUNCHER_I);\n m_masterMotor.config_kD(RobotMap.PID_PRIMARY_SLOT, RobotMap.LAUNCHER_D);\n m_masterMotor.config_kF(RobotMap.PID_PRIMARY_SLOT, RobotMap.LAUNCHER_F);\n\n //this sets the acceptable amount of Integral error, where if the absolute accumulated error exceeds this ammount, it resets to zero\n //this is designed to prevent the PID from going crazy if we move too far from our target\n m_masterMotor.config_IntegralZone(RobotMap.PID_PRIMARY_SLOT, RobotMap.LAUNCHER_I_ZONE, RobotMap.LAUNCHER_CONFIG_TIMEOUT_MS);\n\n //sets the max output of the motor specifically within closed loop control\n m_masterMotor.configClosedLoopPeakOutput(RobotMap.PID_PRIMARY_SLOT, RobotMap.LAUNCHER_PID_PEAK_OUTPUT, RobotMap.LAUNCHER_CONFIG_TIMEOUT_MS);\n\n //this configures an allowable error in closed loop control\n //any error less than this is treated as zero.\n m_masterMotor.configAllowableClosedloopError(RobotMap.PID_PRIMARY_SLOT, RobotMap.LAUNCHER_ACCEPTABLE_ERROR, RobotMap.LAUNCHER_CONFIG_TIMEOUT_MS);\n\n //configures the period for closed loop calculations in MS \n //should be increased if the can bus is haveing issues\n m_masterMotor.configClosedLoopPeriod(RobotMap.PID_PRIMARY_SLOT, RobotMap.LAUNCHER_CLOSED_LOOP_PERIOD_MS, RobotMap.LAUNCHER_CONFIG_TIMEOUT_MS);\n\n //configures ramp speed\n m_masterMotor.configOpenloopRamp(RobotMap.LAUNCHER_OPEN_LOOP_RAMP_TIME_S);\n m_masterMotor.configClosedloopRamp(0);\n\n //sets our closed loop control to use our primary PID slot\n m_masterMotor.selectProfileSlot(RobotMap.PID_PRIMARY_SLOT, 0);\n }", "public float getMotor_lin_target_velocity() throws IOException\n\t{\n\t\tif ((__io__pointersize == 8)) {\n\t\t\treturn __io__block.readFloat(__io__address + 128);\n\t\t} else {\n\t\t\treturn __io__block.readFloat(__io__address + 120);\n\t\t}\n\t}", "public void configVelocityControl() {\n leftDrive.configTeleopVelocity();\n rightDrive.configTeleopVelocity();\n }", "protected void calcVelocity()\n\t{}", "public void liftArm(){armLifty.set(-drivePad.getThrottle());}", "@Override\n public void robotPeriodic() {\n //This prints Data to the Driver Station\n SmartDashboard.putString(\"DB/String 2\", \"\" + elevator.getSensorCollection().getQuadraturePosition());\n //SmartDashboard.putString(\"DB/String 7\", \"\" + rightEncoder.getDistance());\n }", "private void updateLinearDrive() {\n// double rotations = (getLeftRotations() + getRightRotations()) / 2;\n// linearDriveDistance = Conversion.rotationsToInches(rotations, Constants.driveWheelDiameter);\n// double angleController = turnControl.getOutput(linearDriveMultiplier * (navX.getAngle() - linearDriveTargetAngle));\n// double driveController = driveControl.getOutput(linearDriveTargetDistance - linearDriveDistance);\n// setOutput(driveController + angleController, driveController - angleController);\n }", "double getMotorVelocity( MotorName m ) {\n double vol = 0.0;\n if( motor_read_mode_==MotorBulkReadMode.BULK_READ_MANUAL && loop_cnt_!=last_motor_read_loop_id_ ) {\n // Important Step 4: If you are using MANUAL mode, you must clear the BulkCache once per control cycle\n for( LynxModule module : all_hubs_ ) {\n module.clearBulkCache();\n }\n }\n switch ( m ) {\n case MOTOR_LF:\n vol = motorLF_.getVelocity();\n break;\n case MOTOR_LB:\n vol = motorLB_.getVelocity();\n break;\n case MOTOR_RF:\n vol = motorRF_.getVelocity();\n break;\n case MOTOR_RB:\n vol = motorRB_.getVelocity();\n break;\n case MOTOR_LEFT_INTAKE:\n vol = motor_left_intake_.getVelocity();\n break;\n case MOTOR_RIGHT_INTAKE:\n vol = motor_right_intake_.getVelocity();\n break;\n case MOTOR_LIFT:\n vol = motor_lift_.getVelocity();\n break;\n default:\n break;\n }\n last_motor_read_loop_id_ = loop_cnt_ ;\n return vol;\n }", "public void outputToDrive(double rightVoltage, double leftVoltage){\n\t\tif (Constants.Drive.headingInvert) {\n\t\t\tConstants.Drive.left1.setVoltage(leftVoltage);\n\t\t\tConstants.Drive.left2.setVoltage(leftVoltage);\n\t\t\tConstants.Drive.right1.setVoltage(-rightVoltage);\n\t\t\tConstants.Drive.right2.setVoltage(-rightVoltage);\n\t\t} else {\n\t\t\tConstants.Drive.left1.setVoltage(-leftVoltage);\n\t\t\tConstants.Drive.left2.setVoltage(-leftVoltage);\n\t\t\tConstants.Drive.right1.setVoltage(rightVoltage);\n\t\t\tConstants.Drive.right2.setVoltage(rightVoltage);\n\t\t}\n }", "public double getDistance(){\n return sensor.getVoltage()*100/2.54 - 12;\n }", "public void raise(){\r\n elevatorTalon1.set(basePWM);\r\n elevatorTalon2.set(basePWM * pwmModifier);\r\n }", "public Elevator() {\n boolean elevatorInvert = false;\n boolean elevatorPhase = false;\n spx = new SpectrumVictorSPX(Constants.ELEVATOR_SPX);\n srx = new LeaderTalonSRX(Constants.ELEVATOR_SRX, spx);\n srx.setNeutralMode(NeutralMode.Brake);\n srx.configSelectedFeedbackSensor(FeedbackDevice.CTRE_MagEncoder_Relative);\n srx.setSensorPhase(elevatorPhase);\n srx.setInverted(elevatorInvert);\n\n // Enable Soft Limits\n srx.configForwardSoftLimitEnable(false);\n srx.configForwardSoftLimitThreshold(posUpLimit);\n srx.configForwardLimitSwitchSource(LimitSwitchSource.FeedbackConnector, LimitSwitchNormal.NormallyOpen);\n \n srx.configReverseSoftLimitEnable(false);\n srx.configReverseSoftLimitThreshold(posDownLimit);\n srx.configReverseLimitSwitchSource(LimitSwitchSource.FeedbackConnector, LimitSwitchNormal.NormallyOpen);\n\n srx.setStatusFramePeriod(StatusFrameEnhanced.Status_13_Base_PIDF0, 10);\n srx.setStatusFramePeriod(StatusFrameEnhanced.Status_10_MotionMagic, 10);\n\n // Set Ramp Rate and voltage compensation\n srx.configClosedloopRamp(0.25);\n srx.configVoltageCompSaturation(11.5);\n srx.enableVoltageCompensation(true);\n setMotionMagicParams();\n }", "public float getMotor_ang_target_velocity() throws IOException\n\t{\n\t\tif ((__io__pointersize == 8)) {\n\t\t\treturn __io__block.readFloat(__io__address + 132);\n\t\t} else {\n\t\t\treturn __io__block.readFloat(__io__address + 124);\n\t\t}\n\t}", "@Override\n public double getVelocity()\n {\n final String funcName = \"getVelocity\";\n double velocity = encoder.getVelocity() * encoderSign / 60.0;\n\n if (debugEnabled)\n {\n dbgTrace.traceEnter(funcName, TrcDbgTrace.TraceLevel.API);\n dbgTrace.traceExit(funcName, TrcDbgTrace.TraceLevel.API, \"=%f\", velocity);\n }\n\n return velocity;\n }", "private void initializeElevatorMotor()\n {\n Rectangle base = new Rectangle(shaftWidth*.3, location, shaftWidth*.4, floorHeight*.8);\n Rectangle latch = new Rectangle(shaftWidth*.45, location-5, shaftWidth*.1, floorHeight*.2);\n\n elevator = Shape.union(base, latch);\n elevator.setFill(Color.valueOf(\"#C0C0C0\"));\n\n elevatorTranslate = 0;\n elevatorOffset = 0;\n elevatorSpeed = 20;\n\n motorTimeline = new Timeline(new KeyFrame(Duration.millis(elevatorSpeed), e -> {\n if(location+elevatorOffset <= shaftHeight-60 && location+elevatorOffset >= 10) {\n if(location <= destination && location >= destination-10)\n {\n// System.out.println(location + \" OF \" + (destination) + \" / \" + (destination-10) + \" \" + (10 - destination/floorHeight));\n// System.out.println(\"EARLY STOP\");\n motorTimeline.pause();\n }\n\n elevatorTranslate += elevatorOffset;\n location += elevatorOffset;\n\n elevator.setTranslateY(elevatorTranslate);\n frame.setTranslateY(elevatorTranslate);\n leftDoor.setTranslateY(elevatorTranslate);\n rightDoor.setTranslateY(elevatorTranslate);\n }\n else motorTimeline.pause();\n }));\n motorTimeline.setCycleCount(Animation.INDEFINITE);\n }", "public static void getValuationSlot() {\n float locX = M.evaluateLoc.x;\n float locY = M.evaluateLoc.y;\n M.lastZoneValuation = M.evaluateLoc.distanceTo(M.finalMove) * M.moveVectorStr; //Desire to move towards our main goal\n float test1;\n float test2;\n switch (angledRectangleCount) {\n default:\n case 20:\n if (M.evaluateLoc.isWithinDistance(Z20_center, Z20_maxdist)) {\n test1 = Float.sum(locX * Z20_p21x, locY * Z20_p21y);\n if (test1 >= Z20_dotsection2 && test1 <= Z20_p21MagSquared) {\n test2 = Float.sum(locX * Z20_p41x, locY * Z20_p41y);\n if (test2 >= Z20_dotsection4 && test2 <= Z20_p41MagSquared) {\n M.lastZoneValuation = Float.sum(M.lastZoneValuation, Z20_desire);\n if (M.lastZoneValuation < cutoff) return;\n }\n }\n }\n case 19:\n if (M.evaluateLoc.isWithinDistance(Z19_center, Z19_maxdist)) {\n test1 = Float.sum(locX * Z19_p21x, locY * Z19_p21y);\n if (test1 >= Z19_dotsection2 && test1 <= Z19_p21MagSquared) {\n test2 = Float.sum(locX * Z19_p41x, locY * Z19_p41y);\n if (test2 >= Z19_dotsection4 && test2 <= Z19_p41MagSquared) {\n M.lastZoneValuation = Float.sum(M.lastZoneValuation, Z19_desire);\n if (M.lastZoneValuation < cutoff) return;\n }\n }\n }\n case 18:\n if (M.evaluateLoc.isWithinDistance(Z18_center, Z18_maxdist)) {\n test1 = Float.sum(locX * Z18_p21x, locY * Z18_p21y);\n if (test1 >= Z18_dotsection2 && test1 <= Z18_p21MagSquared) {\n test2 = Float.sum(locX * Z18_p41x, locY * Z18_p41y);\n if (test2 >= Z18_dotsection4 && test2 <= Z18_p41MagSquared) {\n M.lastZoneValuation = Float.sum(M.lastZoneValuation, Z18_desire);\n if (M.lastZoneValuation < cutoff) return;\n }\n }\n }\n case 17:\n if (M.evaluateLoc.isWithinDistance(Z17_center, Z17_maxdist)) {\n test1 = Float.sum(locX * Z17_p21x, locY * Z17_p21y);\n if (test1 >= Z17_dotsection2 && test1 <= Z17_p21MagSquared) {\n test2 = Float.sum(locX * Z17_p41x, locY * Z17_p41y);\n if (test2 >= Z17_dotsection4 && test2 <= Z17_p41MagSquared) {\n M.lastZoneValuation = Float.sum(M.lastZoneValuation, Z17_desire);\n if (M.lastZoneValuation < cutoff) return;\n }\n }\n }\n case 16:\n if (M.evaluateLoc.isWithinDistance(Z16_center, Z16_maxdist)) {\n test1 = Float.sum(locX * Z16_p21x, locY * Z16_p21y);\n if (test1 >= Z16_dotsection2 && test1 <= Z16_p21MagSquared) {\n test2 = Float.sum(locX * Z16_p41x, locY * Z16_p41y);\n if (test2 >= Z16_dotsection4 && test2 <= Z16_p41MagSquared) {\n M.lastZoneValuation = Float.sum(M.lastZoneValuation, Z16_desire);\n if (M.lastZoneValuation < cutoff) return;\n }\n }\n }\n case 15:\n if (M.evaluateLoc.isWithinDistance(Z15_center, Z15_maxdist)) {\n test1 = Float.sum(locX * Z15_p21x, locY * Z15_p21y);\n if (test1 >= Z15_dotsection2 && test1 <= Z15_p21MagSquared) {\n test2 = Float.sum(locX * Z15_p41x, locY * Z15_p41y);\n if (test2 >= Z15_dotsection4 && test2 <= Z15_p41MagSquared) {\n M.lastZoneValuation = Float.sum(M.lastZoneValuation, Z15_desire);\n if (M.lastZoneValuation < cutoff) return;\n }\n }\n }\n case 14:\n if (M.evaluateLoc.isWithinDistance(Z14_center, Z14_maxdist)) {\n test1 = Float.sum(locX * Z14_p21x, locY * Z14_p21y);\n if (test1 >= Z14_dotsection2 && test1 <= Z14_p21MagSquared) {\n test2 = Float.sum(locX * Z14_p41x, locY * Z14_p41y);\n if (test2 >= Z14_dotsection4 && test2 <= Z14_p41MagSquared) {\n M.lastZoneValuation = Float.sum(M.lastZoneValuation, Z14_desire);\n if (M.lastZoneValuation < cutoff) return;\n }\n }\n }\n case 13:\n if (M.evaluateLoc.isWithinDistance(Z13_center, Z13_maxdist)) {\n test1 = Float.sum(locX * Z13_p21x, locY * Z13_p21y);\n if (test1 >= Z13_dotsection2 && test1 <= Z13_p21MagSquared) {\n test2 = Float.sum(locX * Z13_p41x, locY * Z13_p41y);\n if (test2 >= Z13_dotsection4 && test2 <= Z13_p41MagSquared) {\n M.lastZoneValuation = Float.sum(M.lastZoneValuation, Z13_desire);\n if (M.lastZoneValuation < cutoff) return;\n }\n }\n }\n case 12:\n if (M.evaluateLoc.isWithinDistance(Z12_center, Z12_maxdist)) {\n test1 = Float.sum(locX * Z12_p21x, locY * Z12_p21y);\n if (test1 >= Z12_dotsection2 && test1 <= Z12_p21MagSquared) {\n test2 = Float.sum(locX * Z12_p41x, locY * Z12_p41y);\n if (test2 >= Z12_dotsection4 && test2 <= Z12_p41MagSquared) {\n M.lastZoneValuation = Float.sum(M.lastZoneValuation, Z12_desire);\n if (M.lastZoneValuation < cutoff) return;\n }\n }\n }\n case 11:\n if (M.evaluateLoc.isWithinDistance(Z11_center, Z11_maxdist)) {\n test1 = Float.sum(locX * Z11_p21x, locY * Z11_p21y);\n if (test1 >= Z11_dotsection2 && test1 <= Z11_p21MagSquared) {\n test2 = Float.sum(locX * Z11_p41x, locY * Z11_p41y);\n if (test2 >= Z11_dotsection4 && test2 <= Z11_p41MagSquared) {\n M.lastZoneValuation = Float.sum(M.lastZoneValuation, Z11_desire);\n if (M.lastZoneValuation < cutoff) return;\n }\n }\n }\n case 10:\n if (M.evaluateLoc.isWithinDistance(Z10_center, Z10_maxdist)) {\n test1 = Float.sum(locX * Z10_p21x, locY * Z10_p21y);\n if (test1 >= Z10_dotsection2 && test1 <= Z10_p21MagSquared) {\n test2 = Float.sum(locX * Z10_p41x, locY * Z10_p41y);\n if (test2 >= Z10_dotsection4 && test2 <= Z10_p41MagSquared) {\n M.lastZoneValuation = Float.sum(M.lastZoneValuation, Z10_desire);\n if (M.lastZoneValuation < cutoff) return;\n }\n }\n }\n case 9:\n if (M.evaluateLoc.isWithinDistance(Z9_center, Z9_maxdist)) {\n test1 = Float.sum(locX * Z9_p21x, locY * Z9_p21y);\n if (test1 >= Z9_dotsection2 && test1 <= Z9_p21MagSquared) {\n test2 = Float.sum(locX * Z9_p41x, locY * Z9_p41y);\n if (test2 >= Z9_dotsection4 && test2 <= Z9_p41MagSquared) {\n M.lastZoneValuation = Float.sum(M.lastZoneValuation, Z9_desire);\n if (M.lastZoneValuation < cutoff) return;\n }\n }\n }\n case 8:\n if (M.evaluateLoc.isWithinDistance(Z8_center, Z8_maxdist)) {\n test1 = Float.sum(locX * Z8_p21x, locY * Z8_p21y);\n if (test1 >= Z8_dotsection2 && test1 <= Z8_p21MagSquared) {\n test2 = Float.sum(locX * Z8_p41x, locY * Z8_p41y);\n if (test2 >= Z8_dotsection4 && test2 <= Z8_p41MagSquared) {\n M.lastZoneValuation = Float.sum(M.lastZoneValuation, Z8_desire);\n if (M.lastZoneValuation < cutoff) return;\n }\n }\n }\n case 7:\n if (M.evaluateLoc.isWithinDistance(Z7_center, Z7_maxdist)) {\n test1 = Float.sum(locX * Z7_p21x, locY * Z7_p21y);\n if (test1 >= Z7_dotsection2 && test1 <= Z7_p21MagSquared) {\n test2 = Float.sum(locX * Z7_p41x, locY * Z7_p41y);\n if (test2 >= Z7_dotsection4 && test2 <= Z7_p41MagSquared) {\n M.lastZoneValuation = Float.sum(M.lastZoneValuation, Z7_desire);\n if (M.lastZoneValuation < cutoff) return;\n }\n }\n }\n case 6:\n if (M.evaluateLoc.isWithinDistance(Z6_center, Z6_maxdist)) {\n test1 = Float.sum(locX * Z6_p21x, locY * Z6_p21y);\n if (test1 >= Z6_dotsection2 && test1 <= Z6_p21MagSquared) {\n test2 = Float.sum(locX * Z6_p41x, locY * Z6_p41y);\n if (test2 >= Z6_dotsection4 && test2 <= Z6_p41MagSquared) {\n M.lastZoneValuation = Float.sum(M.lastZoneValuation, Z6_desire);\n if (M.lastZoneValuation < cutoff) return;\n }\n }\n }\n case 5:\n if (M.evaluateLoc.isWithinDistance(Z5_center, Z5_maxdist)) {\n test1 = Float.sum(locX * Z5_p21x, locY * Z5_p21y);\n if (test1 >= Z5_dotsection2 && test1 <= Z5_p21MagSquared) {\n test2 = Float.sum(locX * Z5_p41x, locY * Z5_p41y);\n if (test2 >= Z5_dotsection4 && test2 <= Z5_p41MagSquared) {\n M.lastZoneValuation = Float.sum(M.lastZoneValuation, Z5_desire);\n if (M.lastZoneValuation < cutoff) return;\n }\n }\n }\n case 4:\n if (M.evaluateLoc.isWithinDistance(Z4_center, Z4_maxdist)) {\n test1 = Float.sum(locX * Z4_p21x, locY * Z4_p21y);\n if (test1 >= Z4_dotsection2 && test1 <= Z4_p21MagSquared) {\n test2 = Float.sum(locX * Z4_p41x, locY * Z4_p41y);\n if (test2 >= Z4_dotsection4 && test2 <= Z4_p41MagSquared) {\n M.lastZoneValuation = Float.sum(M.lastZoneValuation, Z4_desire);\n if (M.lastZoneValuation < cutoff) return;\n }\n }\n }\n case 3:\n if (M.evaluateLoc.isWithinDistance(Z3_center, Z3_maxdist)) {\n test1 = Float.sum(locX * Z3_p21x, locY * Z3_p21y);\n if (test1 >= Z3_dotsection2 && test1 <= Z3_p21MagSquared) {\n test2 = Float.sum(locX * Z3_p41x, locY * Z3_p41y);\n if (test2 >= Z3_dotsection4 && test2 <= Z3_p41MagSquared) {\n M.lastZoneValuation = Float.sum(M.lastZoneValuation, Z3_desire);\n if (M.lastZoneValuation < cutoff) return;\n }\n }\n }\n case 2:\n if (M.evaluateLoc.isWithinDistance(Z2_center, Z2_maxdist)) {\n test1 = Float.sum(locX * Z2_p21x, locY * Z2_p21y);\n if (test1 >= Z2_dotsection2 && test1 <= Z2_p21MagSquared) {\n test2 = Float.sum(locX * Z2_p41x, locY * Z2_p41y);\n if (test2 >= Z2_dotsection4 && test2 <= Z2_p41MagSquared) {\n M.lastZoneValuation = Float.sum(M.lastZoneValuation, Z2_desire);\n if (M.lastZoneValuation < cutoff) return;\n }\n }\n }\n case 1:\n if (M.evaluateLoc.isWithinDistance(Z1_center, Z1_maxdist)) {\n test1 = Float.sum(locX * Z1_p21x, locY * Z1_p21y);\n if (test1 >= Z1_dotsection2 && test1 <= Z1_p21MagSquared) {\n test2 = Float.sum(locX * Z1_p41x, locY * Z1_p41y);\n if (test2 >= Z1_dotsection4 && test2 <= Z1_p41MagSquared) {\n M.lastZoneValuation = Float.sum(M.lastZoneValuation, Z1_desire);\n if (M.lastZoneValuation < cutoff) return;\n }\n }\n }\n case 0:\n }\n switch (circleCount) {\n case 20:\n if (M.evaluateLoc.isWithinDistance(Z20c_center, Z20c_size)) {\n M.lastZoneValuation = Float.sum(M.lastZoneValuation, Z20c_desire);\n if (M.lastZoneValuation < cutoff) return;\n }\n case 19:\n if (M.evaluateLoc.isWithinDistance(Z19c_center, Z19c_size)) {\n M.lastZoneValuation = Float.sum(M.lastZoneValuation, Z19c_desire);\n if (M.lastZoneValuation < cutoff) return;\n }\n case 18:\n if (M.evaluateLoc.isWithinDistance(Z18c_center, Z18c_size)) {\n M.lastZoneValuation = Float.sum(M.lastZoneValuation, Z18c_desire);\n if (M.lastZoneValuation < cutoff) return;\n }\n case 17:\n if (M.evaluateLoc.isWithinDistance(Z17c_center, Z17c_size)) {\n M.lastZoneValuation = Float.sum(M.lastZoneValuation, Z17c_desire);\n if (M.lastZoneValuation < cutoff) return;\n }\n case 16:\n if (M.evaluateLoc.isWithinDistance(Z16c_center, Z16c_size)) {\n M.lastZoneValuation = Float.sum(M.lastZoneValuation, Z16c_desire);\n if (M.lastZoneValuation < cutoff) return;\n }\n case 15:\n if (M.evaluateLoc.isWithinDistance(Z15c_center, Z15c_size)) {\n M.lastZoneValuation = Float.sum(M.lastZoneValuation, Z15c_desire);\n if (M.lastZoneValuation < cutoff) return;\n }\n case 14:\n if (M.evaluateLoc.isWithinDistance(Z14c_center, Z14c_size)) {\n M.lastZoneValuation = Float.sum(M.lastZoneValuation, Z14c_desire);\n if (M.lastZoneValuation < cutoff) return;\n }\n case 13:\n if (M.evaluateLoc.isWithinDistance(Z13c_center, Z13c_size)) {\n M.lastZoneValuation = Float.sum(M.lastZoneValuation, Z13c_desire);\n if (M.lastZoneValuation < cutoff) return;\n }\n case 12:\n if (M.evaluateLoc.isWithinDistance(Z12c_center, Z12c_size)) {\n M.lastZoneValuation = Float.sum(M.lastZoneValuation, Z12c_desire);\n if (M.lastZoneValuation < cutoff) return;\n }\n case 11:\n if (M.evaluateLoc.isWithinDistance(Z11c_center, Z11c_size)) {\n M.lastZoneValuation = Float.sum(M.lastZoneValuation, Z11c_desire);\n if (M.lastZoneValuation < cutoff) return;\n }\n case 10:\n if (M.evaluateLoc.isWithinDistance(Z10c_center, Z10c_size)) {\n M.lastZoneValuation = Float.sum(M.lastZoneValuation, Z10c_desire);\n if (M.lastZoneValuation < cutoff) return;\n }\n case 9:\n if (M.evaluateLoc.isWithinDistance(Z9c_center, Z9c_size)) {\n M.lastZoneValuation = Float.sum(M.lastZoneValuation, Z9c_desire);\n if (M.lastZoneValuation < cutoff) return;\n }\n case 8:\n if (M.evaluateLoc.isWithinDistance(Z8c_center, Z8c_size)) {\n M.lastZoneValuation = Float.sum(M.lastZoneValuation, Z8c_desire);\n if (M.lastZoneValuation < cutoff) return;\n }\n case 7:\n if (M.evaluateLoc.isWithinDistance(Z7c_center, Z7c_size)) {\n M.lastZoneValuation = Float.sum(M.lastZoneValuation, Z7c_desire);\n if (M.lastZoneValuation < cutoff) return;\n }\n case 6:\n if (M.evaluateLoc.isWithinDistance(Z6c_center, Z6c_size)) {\n M.lastZoneValuation = Float.sum(M.lastZoneValuation, Z6c_desire);\n if (M.lastZoneValuation < cutoff) return;\n }\n case 5:\n if (M.evaluateLoc.isWithinDistance(Z5c_center, Z5c_size)) {\n M.lastZoneValuation = Float.sum(M.lastZoneValuation, Z5c_desire);\n if (M.lastZoneValuation < cutoff) return;\n }\n case 4:\n if (M.evaluateLoc.isWithinDistance(Z4c_center, Z4c_size)) {\n M.lastZoneValuation = Float.sum(M.lastZoneValuation, Z4c_desire);\n if (M.lastZoneValuation < cutoff) return;\n }\n case 3:\n if (M.evaluateLoc.isWithinDistance(Z3c_center, Z3c_size)) {\n M.lastZoneValuation = Float.sum(M.lastZoneValuation, Z3c_desire);\n }\n case 2:\n if (M.evaluateLoc.isWithinDistance(Z2c_center, Z2c_size)) {\n M.lastZoneValuation = Float.sum(M.lastZoneValuation, Z2c_desire);\n }\n case 1:\n if (M.evaluateLoc.isWithinDistance(Z1c_center, Z1c_size)) {\n M.lastZoneValuation = Float.sum(M.lastZoneValuation, Z1c_desire);\n }\n case 0:\n }\n switch (vectorCircleCount) {\n case 20:\n if (M.evaluateLoc.isWithinDistance(Z20vc_center, Z20vc_size)) {\n M.lastZoneValuation = Float.sum(M.lastZoneValuation, Float.sum(Z20vc_baseDesire, M.evaluateLoc.distanceTo(Z20vc_center) * Z20vc_distanceDesire));\n if (M.lastZoneValuation < cutoff) return;\n }\n case 19:\n if (M.evaluateLoc.isWithinDistance(Z19vc_center, Z19vc_size)) {\n M.lastZoneValuation = Float.sum(M.lastZoneValuation, Float.sum(Z19vc_baseDesire, M.evaluateLoc.distanceTo(Z19vc_center) * Z19vc_distanceDesire));\n if (M.lastZoneValuation < cutoff) return;\n }\n case 18:\n if (M.evaluateLoc.isWithinDistance(Z18vc_center, Z18vc_size)) {\n M.lastZoneValuation = Float.sum(M.lastZoneValuation, Float.sum(Z18vc_baseDesire, M.evaluateLoc.distanceTo(Z18vc_center) * Z18vc_distanceDesire));\n if (M.lastZoneValuation < cutoff) return;\n }\n case 17:\n if (M.evaluateLoc.isWithinDistance(Z17vc_center, Z17vc_size)) {\n M.lastZoneValuation = Float.sum(M.lastZoneValuation, Float.sum(Z17vc_baseDesire, M.evaluateLoc.distanceTo(Z17vc_center) * Z17vc_distanceDesire));\n if (M.lastZoneValuation < cutoff) return;\n }\n case 16:\n if (M.evaluateLoc.isWithinDistance(Z16vc_center, Z16vc_size)) {\n M.lastZoneValuation = Float.sum(M.lastZoneValuation, Float.sum(Z16vc_baseDesire, M.evaluateLoc.distanceTo(Z16vc_center) * Z16vc_distanceDesire));\n if (M.lastZoneValuation < cutoff) return;\n }\n case 15:\n if (M.evaluateLoc.isWithinDistance(Z15vc_center, Z15vc_size)) {\n M.lastZoneValuation = Float.sum(M.lastZoneValuation, Float.sum(Z15vc_baseDesire, M.evaluateLoc.distanceTo(Z15vc_center) * Z15vc_distanceDesire));\n if (M.lastZoneValuation < cutoff) return;\n }\n case 14:\n if (M.evaluateLoc.isWithinDistance(Z14vc_center, Z14vc_size)) {\n M.lastZoneValuation = Float.sum(M.lastZoneValuation, Float.sum(Z14vc_baseDesire, M.evaluateLoc.distanceTo(Z14vc_center) * Z14vc_distanceDesire));\n if (M.lastZoneValuation < cutoff) return;\n }\n case 13:\n if (M.evaluateLoc.isWithinDistance(Z13vc_center, Z13vc_size)) {\n M.lastZoneValuation = Float.sum(M.lastZoneValuation, Float.sum(Z13vc_baseDesire, M.evaluateLoc.distanceTo(Z13vc_center) * Z13vc_distanceDesire));\n if (M.lastZoneValuation < cutoff) return;\n }\n case 12:\n if (M.evaluateLoc.isWithinDistance(Z12vc_center, Z12vc_size)) {\n M.lastZoneValuation = Float.sum(M.lastZoneValuation, Float.sum(Z12vc_baseDesire, M.evaluateLoc.distanceTo(Z12vc_center) * Z12vc_distanceDesire));\n if (M.lastZoneValuation < cutoff) return;\n }\n case 11:\n if (M.evaluateLoc.isWithinDistance(Z11vc_center, Z11vc_size)) {\n M.lastZoneValuation = Float.sum(M.lastZoneValuation, Float.sum(Z11vc_baseDesire, M.evaluateLoc.distanceTo(Z11vc_center) * Z11vc_distanceDesire));\n if (M.lastZoneValuation < cutoff) return;\n }\n case 10:\n if (M.evaluateLoc.isWithinDistance(Z10vc_center, Z10vc_size)) {\n M.lastZoneValuation = Float.sum(M.lastZoneValuation, Float.sum(Z10vc_baseDesire, M.evaluateLoc.distanceTo(Z10vc_center) * Z10vc_distanceDesire));\n if (M.lastZoneValuation < cutoff) return;\n }\n case 9:\n if (M.evaluateLoc.isWithinDistance(Z9vc_center, Z9vc_size)) {\n M.lastZoneValuation = Float.sum(M.lastZoneValuation, Float.sum(Z9vc_baseDesire, M.evaluateLoc.distanceTo(Z9vc_center) * Z9vc_distanceDesire));\n if (M.lastZoneValuation < cutoff) return;\n }\n case 8:\n if (M.evaluateLoc.isWithinDistance(Z8vc_center, Z8vc_size)) {\n M.lastZoneValuation = Float.sum(M.lastZoneValuation, Float.sum(Z8vc_baseDesire, M.evaluateLoc.distanceTo(Z8vc_center) * Z8vc_distanceDesire));\n if (M.lastZoneValuation < cutoff) return;\n }\n case 7:\n if (M.evaluateLoc.isWithinDistance(Z7vc_center, Z7vc_size)) {\n M.lastZoneValuation = Float.sum(M.lastZoneValuation, Float.sum(Z7vc_baseDesire, M.evaluateLoc.distanceTo(Z7vc_center) * Z7vc_distanceDesire));\n if (M.lastZoneValuation < cutoff) return;\n }\n case 6:\n if (M.evaluateLoc.isWithinDistance(Z6vc_center, Z6vc_size)) {\n M.lastZoneValuation = Float.sum(M.lastZoneValuation, Float.sum(Z6vc_baseDesire, M.evaluateLoc.distanceTo(Z6vc_center) * Z6vc_distanceDesire));\n if (M.lastZoneValuation < cutoff) return;\n }\n case 5:\n if (M.evaluateLoc.isWithinDistance(Z5vc_center, Z5vc_size)) {\n M.lastZoneValuation = Float.sum(M.lastZoneValuation, Float.sum(Z5vc_baseDesire, M.evaluateLoc.distanceTo(Z5vc_center) * Z5vc_distanceDesire));\n if (M.lastZoneValuation < cutoff) return;\n }\n case 4:\n if (M.evaluateLoc.isWithinDistance(Z4vc_center, Z4vc_size)) {\n M.lastZoneValuation = Float.sum(M.lastZoneValuation, Float.sum(Z4vc_baseDesire, M.evaluateLoc.distanceTo(Z4vc_center) * Z4vc_distanceDesire));\n if (M.lastZoneValuation < cutoff) return;\n }\n case 3:\n if (M.evaluateLoc.isWithinDistance(Z3vc_center, Z3vc_size)) {\n M.lastZoneValuation = Float.sum(M.lastZoneValuation, Float.sum(Z3vc_baseDesire, M.evaluateLoc.distanceTo(Z3vc_center) * Z3vc_distanceDesire));\n }\n case 2:\n if (M.evaluateLoc.isWithinDistance(Z2vc_center, Z2vc_size)) {\n M.lastZoneValuation = Float.sum(M.lastZoneValuation, Float.sum(Z2vc_baseDesire, M.evaluateLoc.distanceTo(Z2vc_center) * Z2vc_distanceDesire));\n }\n case 1:\n if (M.evaluateLoc.isWithinDistance(Z1vc_center, Z1vc_size)) {\n M.lastZoneValuation = Float.sum(M.lastZoneValuation, Float.sum(Z1vc_baseDesire, M.evaluateLoc.distanceTo(Z1vc_center) * Z1vc_distanceDesire));\n }\n case 0:\n }\n //Rarely used, should be optimized the same way if this becomes more common\n for (int i = M.squareIndexMinusOne; i >= 0; i--) {\n ZoneSquare zone = M.squares[i];\n if (zone.left < locX && locX < zone.right && locY < zone.top && locY > zone.bot) {\n M.lastZoneValuation += zone.desire;\n }\n }\n }", "public void changeToLoGear() {\n\t\tspeedShifter.set(DoubleSolenoid.Value.kForward); // forward is low gear,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// port 1\n\t\tSystem.out.println(\"switch\");\n\t}", "private double getElevatorSpeed()\n {\n // if second speed is toggled use second instead of main speed\n if (useSecondSpeed)\n {\n return mSecondSpeed * mDirection * -1;\n }\n else\n { // else just use main speed\n return mSpeed * mDirection * -1;\n }\n }", "public void reviseMotorSpeed() {\n\t\tmHandler.removeMessages(EVAL_MOTOR_SPEED);\n\t\tlong starttime = System.currentTimeMillis();\n\n\t\t//Retrieve current orientation.\t\t\n\t\t\n\t\tmAzimuth = mStatus.getReadingField(AZIMUTH);\t\t\n\t\tmPitchDeg = mStatus.getReadingField(PITCH);\n\t\tmRollDeg = -mStatus.getReadingField(ROLL);\n\t\t\n\t\tdouble[] errors = new double[4];\n\t\tsynchronized (mAngleTarget) {\n\t\t\t//logArray(\"mAngleTarget\", mAngleTarget);\n\t\t\terrors[0] = mAngleTarget[0] - mRollDeg;\n\t\t\terrors[1] = mAngleTarget[1] - mPitchDeg;\n\t\t\terrors[2] = mAngleTarget[2] - mStatus.getGpsField(dALT);\n\t\t\terrors[3] = mAngleTarget[3] - mAzimuth;\n\t\t\t//logArray(\"errors\", errors);\n\t\t}\n\t\t\n\t\t@SuppressWarnings(\"unused\")\n\t\tString errs = \"errors: \";\n\t\tfor (int i = 0; i < 4; i++) {\n\t\t\terrs += errors[i] + \": \";\n\t\t}\n\t\t//Log.v(TAG, errs);\n\t\t//For azimuth, multiple possibilities exist for error, each equally valid; but only the error nearest zero makes practical sense.\n\t\tif (errors[3] > 180.0)\n\t\t\terrors[3] -= 360.0;\n\t\tif (errors[3] < -180.0)\n\t\t\terrors[3] += 360.0;\n\t\t\n\t\t\n\t\tfor (int i = 0; i < 4; i++) {\n\t\t\t//Calculate proportional errors\n\t\t\tdouble err = errors[i];//mTarget[i] - mCurrent[i];\n\t\t\t\n\n\t\t\t//Calculate derivative errors.\n\t\t\tlong timeInterval = starttime - mLastUpdate;\n\t\t\tif (timeInterval != 0) {\n\t\t\t\tmErrors[i][2] = (err - mErrors[i][0]) * 1000.0 / timeInterval;\n\t\t\t} else {\n\t\t\t\tmErrors[i][2] = 0.0;\n\t\t\t}\n\t\t\t\n\t\t\t\n\t\t\t//Mark proportional error\n\t\t\tmErrors[i][0] = err;\n\t\t\t/*if (i == 2)\n\t\t\t\tLog.v(TAG, \"guid, dalt err is \" + err);*/\n\t\t\t//Update integral errors\n\t\t\tmErrors[i][1] -= mIntegralErrors[i][mIntegralIndex];\n\t\t\tmIntegralErrors[i][mIntegralIndex] = err;\n\t\t\tmErrors[i][1] += err;\n\t\t\tmIntegralIndex = ++mIntegralIndex % PIDREPS;\n\t\t\t\n\t\t\t//Calculate changes in output\n\t\t\tfor (int j = 0; j < 3; j++) {\n\t\t\t\tmControlVars[i] += mErrors[i][j] * mGain[i][j];\n\t\t\t}\n\t\t}\n\t\tif (mGuidanceMode.get() == MANUAL) {\n\t\t\tsynchronized (mAngleTarget) {\n\t\t\t\tmControlVars[2] = mAngleTarget[2];\n\t\t\t}\n\t\t}\n\t\tmLastUpdate = starttime;\n\t\t\n\t\t// Constrain control vars:\n\t\tmControlVars[0] = constrainValue(mControlVars[0], -1, 1);\n\t\tmControlVars[1] = constrainValue(mControlVars[1], -1, 1);\n\t\tmControlVars[2] = constrainValue(mControlVars[2], 0, 1);\n\t\tmControlVars[3] = constrainValue(mControlVars[3], -2, 2);\n\t\t\n\t\t/*String vars = \"Control vars: \";\n\t\tfor (int i = 0; i < 4; i++) {\n\t\t\tvars += mControlVars[i] + \": \";\n\t\t}\n\t\tLog.v(TAG, vars);*/\n\t\t\n\t\tcontrolVarsToMotorSpeeds();\n\t\t\n\t\t//Send motor values to motors here:\n\t\tupdateMotors();\n\t\tupdateAngleTarget();\n\t\t//Log.v(TAG, \"motors: \" + mMotorSpeed[0] + \", \" + mMotorSpeed[1] + \", \" + mMotorSpeed[2] + \", \" + mMotorSpeed[3]);\n\t\t//Sleep a while\n\t\tlong timetonext = (1000 / PIDREPS) - (System.currentTimeMillis() - starttime);\n\t\t//Log.v(TAG, \"time to next: \" + timetonext);\n\t\tint currentMode = mGuidanceMode.get();\n\t\tif ((currentMode == MANUAL) || (currentMode == AUTOPILOT)) {\n\t\t\tif (timetonext > 0)\n\t\t\t\tmHandler.sendEmptyMessageDelayed(EVAL_MOTOR_SPEED, timetonext);\n\t\t\telse {\n\t\t\t\tLog.e(TAG, \"Guidance too slow\");\n\t\t\t\tmHandler.sendEmptyMessage(EVAL_MOTOR_SPEED);\n\t\t\t}\n\t\t}\n\t}", "public void armDrive(double pivValue, double fwdValue){\n if (pivValue!=0) {\n pivValue = pivValue / 6;\n left_drive.setPower(pivValue);\n right_drive.setPower(-pivValue);\n }else {\n fwdValue = fwdValue / 6;\n left_drive.setPower(fwdValue);\n right_drive.setPower(fwdValue);\n }\n\n }", "void easy_ride_from_70kmh_down (double min_lift) { \n double start_speed = 70; // kmh\n double pitch = 0;\n double min_drag = 10000.0;\n double step = -10;\n velocity = start_speed;\n for (int count = 0; count < 10000; count++) {\n trace(\"velocity: \" + velocity + \" step: \" + step);\n steady_flight_at_given_speed(5, 0);\n double total_drag = total_drag();\n double foil_lift = foil_lift();\n if (Math.abs(step) < 0.01) break;\n if ((step < 0 && velocity+step <= 0) ||\n // (step > 0 && velocity >= 70) ||\n foil_lift < load ||\n total_drag > min_drag) { // can't pivot because of local max of drag before taking off.... \n velocity -= step;\n step *= 0.5;\n } else {\n velocity += step;\n min_drag = total_drag;\n }\n }\n make_cruising_info(min_lift, min_drag, velocity); \n System.out.println(\"\\nDone!\\n----------------\\n\" + cruising_info);\n }", "public PIDElevator() {\n \tsuper(\"PIDElevator\", Kp, Ki, Kd);\n \tenco = new Encoder(RobotMap.ENCODER_A_CHANNEL, RobotMap.ENCODER_B_CHANNEL, true);\n enco.reset();\n \n //outputOne = new DigitalOutput(RobotMap.ARDUINO_PIN_ONE);\n //outputTwo = new DigitalOutput(RobotMap.ARDUINO_PIN_TWO);\n //outputThree = new DigitalOutput(RobotMap.ARDUINO_PIN_THREE);\n\n \t\n \tsetAbsoluteTolerance(10);\n \tgetPIDController().setContinuous(false);\n // Use these to get going:\n // setSetpoint() - Sets where the PID controller should move the system\n // to\n // enable() - Enables the PID controller.\n \televMotor = new CANTalon(RobotMap.ELEV_TALON);\n \t\n //button = new DigitalInput(0); \n \tbottom_hallEffect = new DigitalInput(RobotMap.HALL_EFFECT_PORT);\n \ttop_limitSwitch = new DigitalInput(RobotMap.TOP_LIMIT_SWITCH);\n \t\n \t//wire = new I2C(Port.kOnboard, 4);\n \t\n \tBrakeEngaged = new Solenoid(1, RobotMap.BRAKE_IN);\n \tBrakeDisengaged = new Solenoid(1, RobotMap.BRAKE_OUT);\n \tenable();\n }", "public\tElevator(){\t\t\t\t\t\t\n\t\tcurrentFloor = 1;\n\t\tcurrentDirection = \"UP\";\n\t\ttotalPassengers = 0;\n\t\ttotalPassDestFloor = new int[8];\n\t\tdestRequest = new char[8];\n\t\t \n\t}", "@Override\n public void robotInit() {\n m_chooser.setDefaultOption(\"Default Auto\", kDefaultAuto);\n m_chooser.addOption(\"My Auto\", kCustomAuto);\n SmartDashboard.putData(\"Auto choices\", m_chooser);\n\n /* lets grab the 360 degree position of the MagEncoder's absolute position */\n /* mask out the bottom12 bits, we don't care about the wrap arounds */ \n\t\tint absolutePosition = elevator.getSelectedSensorPosition(0) & 0xFFF;\n \n /* use the low level API to set the quad encoder signal */\n elevator.setSelectedSensorPosition(absolutePosition, Constants.kPIDLoopIdx, Constants.kTimeoutMs);\n\n /* choose the sensor and sensor direction */\n elevator.configSelectedFeedbackSensor(FeedbackDevice.CTRE_MagEncoder_Relative, \n Constants.kPIDLoopIdx, Constants.kTimeoutMs);\n\n /* Ensure sensor is positive when output is positive */\n elevator.setSensorPhase(false);\n\n /**\n * Set based on what direction you want forward/positive to be.\n * This does not affect sensor phase. \n */ \n //elevator.setInverted(Constants.kMotorInvert);\n \n /* Config the peak and nominal outputs, 12V means full */\n elevator.configNominalOutputForward(0, Constants.kTimeoutMs);\n elevator.configNominalOutputReverse(0, Constants.kTimeoutMs);\n //elevator.configPeakOutputForward(1, Constants.kTimeoutMs);\n elevator.configNominalOutputForward(0.5);\n //elevator.configPeakOutputForward(1, Constants.kTimeoutMs);\n elevator.configPeakOutputForward(0.5);\n elevator.configPeakOutputReverse(-1, Constants.kTimeoutMs);\n \n /**\n * Config the allowable closed-loop error, Closed-Loop output will be\n * neutral within this range. See Table in Section 17.2.1 for native\n * units per rotation.\n */\n //elevator.configAllowableClosedloopError(0, Constants.kPIDLoopIdx, Constants.kTimeoutMs);\n \n /* Config Position Closed Loop gains in slot0, typically kF stays zero. */\n elevator.config_kF(Constants.kPIDLoopIdx, 0.0, Constants.kTimeoutMs);\n elevator.config_kP(Constants.kPIDLoopIdx, 0.5, Constants.kTimeoutMs);\n elevator.config_kI(Constants.kPIDLoopIdx, 0.0, Constants.kTimeoutMs);\n elevator.config_kD(Constants.kPIDLoopIdx, 0.0, Constants.kTimeoutMs);\n\n\n }", "float getVoltageStepIncrementOutOfPhase();", "public void updateState() {\n //check if arrived\n if (destinations.contains(currentFloor)) {\n destinations.removeIf(n -> (n == currentFloor));\n System.out.println(\"\\t\\tElevator #\" + id + \": Arrived at floor #\" + currentFloor + \".\");\n }\n\n // take stock of assigned stops and change direction if required\n if (destinations.isEmpty()) {\n currentDirection = Direction.STOP;\n } else if ((currentDirection == Direction.UP && Collections.max(destinations) < currentFloor)) {\n currentDirection = Direction.DOWN;\n Collections.sort(destinations);\n Collections.reverse(destinations);\n } else if (currentDirection == Direction.DOWN && Collections.min(destinations) > currentFloor){\n currentDirection = Direction.UP;\n Collections.sort(destinations);\n }\n\n //Decide which way to go if the elevator is stopped and has gained a destination\n if (currentDirection == Direction.STOP && destinations.size() != 0) {\n int destinationFloor = Integer.MAX_VALUE;\n for (final Integer d : destinations) {\n if (Math.abs(currentFloor - d) < Math.abs(currentFloor - destinationFloor)) {\n destinationFloor = d;\n }\n }\n\n currentDirection = (destinationFloor > currentFloor ? Direction.UP : Direction.DOWN);\n }\n\n // update current floor\n if (currentDirection == Direction.DOWN) {\n currentFloor--;\n System.out.println(\"\\t\\tElevator #\" + id + \": Moved down to floor #\" + currentFloor + \".\");\n } else if (currentDirection == Direction.UP) {\n currentFloor++;\n System.out.println(\"\\t\\tElevator #\" + id + \": Moved up to floor #\" + currentFloor + \".\");\n }\n }", "@Override\n\tprotected void onStart() {\n \tElevator.getInstance().setMotorValue(val);\n }", "protected void computeTranslationVelocityCommand() { // (Solution)\n\t\tdouble translationError = targetRange - desiredFixationDistance; // (Solution)\n\t\tif (Math.abs(translationError) < translationErrorTolerance) // (Solution)\n\t\t\ttranslationVelocityCommand = 0.0; // (Solution)\n\t\telse\n\t\t\t// (Solution)\n\t\t\ttranslationVelocityCommand = // (Solution)\n\t\t\tMath.max(-translationVelocityMax, // (Solution)\n\t\t\t\t\tMath.min(translationVelocityMax, // (Solution)\n\t\t\t\t\t\t\ttranslationError * translationVelocityGain)); // (Solution)\n\t}", "public void ascend() {\n \t\n elevator1.set(0.9);\n elevator2.set(0.9); \n }", "float getNominalVoltageOutOfPhase();", "double find_min_takeoff_v_old_algorithm_aux (double min_lift, double max_drag, double speed, double speed_step, double pitch_init, double pitch_step) {\n double pitch = pitch_init;\n double pitch_limit = aoa_max*0.7;\n {\n trace(\"speed_step: \" + speed_step + \" pitch_step: \" + pitch_step);\n for (; speed < v_max; speed += speed_step) {\n velocity = speed;\n // if the startimg pitch guess when at this point was too high, \n // drag will be too big at this point; then reduce pitch\n while (pitch > aoa_min/2) {\n craft_pitch = pitch;\n //computeFlowAndRegenPlotAndAdjust();\n recomp_all_parts();\n if (total_drag() >= max_drag)\n pitch = Math.max(pitch_init, craft_pitch - Math.abs(craft_pitch/4));\n else \n break; // while (pitch > aoa_min/2)\n } \n \n trace(\"for() speed: \" + speed + \" pitch: \" + pitch);\n for (;pitch < pitch_limit; pitch += pitch_step) {\n craft_pitch = pitch;\n //computeFlowAndRegenPlotAndAdjust();\n recomp_all_parts();\n if (total_drag() >= max_drag) {\n // stop increasing pitch, won't work. need more speed\n trace(\"too much drag. speed: \" + speed + \" pitch: \" + pitch + \" lift \" + foil_lift());\n pitch = Math.max(pitch_init, craft_pitch - Math.abs(craft_pitch/4));\n break; // for (pitch...)\n }\n if (foil_lift() >= min_lift) {\n if (speed_step > 0.25) {\n trace(\"request reiterate. speed: \" + speed + \" pitch: \" + pitch + \" lift \" + foil_lift() + \" speed_step: \" + speed_step);\n return Math.max(0, velocity - speed_step); // request to reiterate\n } else {\n // done!\n make_min_takeoff_speed_info(min_lift, max_drag, velocity); \n System.out.println(\"\\nDone!\\n----------------\\n\" + min_takeoff_speed_info);\n return -1;\n }\n } \n }\n // need to start from lowest pitch?\n if (pitch >= pitch_limit) pitch = pitch_init;\n }\n }\n return -2; // can not find solution\n }", "public double getVelocityRPM();", "public char[] voltages_GET()\n {return voltages_GET(new char[10], 0);}", "public double getCurrentPot(){\n\t\treturn currentPot;\n\t}", "public void Elevator() {\n // Use these to get going:\n // setSetpoint() - Sets where the PID controller should move the system\n // to\n // enable() - Enables the PID controller.\n \t\n }", "private String tempConversion() {\n int reading = ((record[17] & 255) + ((record[21] & 0x30) << 4));\n\n double voltage = (reading * 3.3) / 1024;\n return formatter.format((voltage - .6) / .01);\n\n }", "void easy_ride (double min_lift) { \n double pitch = 0;\n double min_drag = 10000.0;\n double step = 2;\n for (int count = 0; count < 10000; count++) {\n trace(\"velocity: \" + velocity + \" step: \" + step);\n steady_flight_at_given_speed(5, 0);\n double total_drag = total_drag();\n double foil_lift = foil_lift();\n if (Math.abs(step) < 0.01) break;\n if (//(step < 0 && velocity+step <= 0) ||\n (step > 0 && velocity >= 70) ||\n foil_lift < load ||\n total_drag > min_drag) { // can't pivot because of local max of drag before taking off.... \n velocity -= step;\n step *= 0.5;\n } else {\n velocity += step;\n min_drag = total_drag;\n }\n }\n make_cruising_info(min_lift, min_drag, velocity); \n System.out.println(\"\\nDone!\\n----------------\\n\" + cruising_info);\n }", "private void doVels() {\n\t\tthis.launchPerVel = Math.sqrt((2d * body.getGm() * this.launchApoAlt) / (this.launchPerAlt * this.a));\n\t\tthis.launchApoVel = Math.sqrt((2d * body.getGm() * this.launchPerAlt) / (this.launchApoAlt * this.a));\n\t}", "@Override\n public void teleopPeriodic() {\n\t\t/* xbox processing */\n\t\tdouble leftYstick = xbox.getY(Hand.kLeft);\n\t\tboolean buttonA = xbox.getAButton();\n boolean buttonB = xbox.getBButton();\n boolean buttonX = xbox.getXButton();\n boolean buttonY = xbox.getYButton();\n\n\t\t/* Get Talon/Victor's current output percentage */\n\t\tdouble motorOutput = elevator.getMotorOutputPercent();\n\n\t\t/* Deadband gamepad */\n\t\tif (Math.abs(leftYstick) < 0.10) {\n\t\t\t/* Within 10% of zero */\n\t\t\tleftYstick = 0;\n }\n\n\t\t/* Prepare line to print */\n\t\t_sb.append(\"\\tout:\"); _sb.append((int) (motorOutput * 100)); _sb.append(\"%\"); // Percent\n\t\t_sb.append(\"\\tpos:\"); _sb.append(elevator.getSelectedSensorPosition(0)); _sb.append(\"u\"); // Native units\n\n\t\t/**\n\t\t * When button 1 is pressed, perform Position Closed Loop to selected position,\n\t\t * indicated by Joystick position x10, [-10, 10] rotations\n\t\t */\n\t\t//if (!_lastButton1 && buttonA) {\n if (buttonB) {\n\t\t\t/* Position Closed Loop */\n\t\t\t/* 10 Rotations * 4096 u/rev in either direction */\n\t\t\ttargetPositionRotations = 5000; // 2* 4096; //leftYstick * 10.0 * 4096;\n\t\t\televator.set(ControlMode.Position, targetPositionRotations);\n\t\t}\n if (buttonX) {\n\t\t\t/* Position Closed Loop */\n\t\t\t/* 10 Rotations * 4096 u/rev in either direction */\n\t\t\ttargetPositionRotations = 3000; //2* 4096; //leftYstick * 10.0 * 4096;\n\t\t\televator.set(ControlMode.Position, -targetPositionRotations);\n\t\t}\n\n\t\t/* When button 2 is held, just straight drive */\n\t\tif (buttonA) {\n /* Percent Output */\n\t\t elevator.set(ControlMode.PercentOutput, leftYstick);\n }\n \n if (buttonY) {\n elevator.setSelectedSensorPosition(0); // reset to zero\n elevator.getSensorCollection().setQuadraturePosition(0, 10);\n elevator.set(ControlMode.PercentOutput, 0);\n }\n// else{\n //}\n\n\t\t/* If Talon is in position closed-loop, print some more info */\n\t\tif (elevator.getControlMode() == ControlMode.Position) {\n /* Append more signals to print when in speed mode. */\n\t\t\t_sb.append(\"\\terr:\"); _sb.append(elevator.getClosedLoopError(0)); _sb.append(\"u\");\t// Native Units\n\t\t\t_sb.append(\"\\ttrg:\"); _sb.append(targetPositionRotations); _sb.append(\"u\");\t// Native Units\n\t\t}\n\n\t\t/**\n\t\t * Print every ten loops, printing too much too fast is generally bad\n\t\t * for performance.\n\t\t */\n\t\tif (++_loops >= 10) {\n\t\t\t_loops = 0;\n\t\t\tSystem.out.println(_sb.toString());\n\t\t}\n\n\t\t/* Reset built string for next loop */\n\t\t_sb.setLength(0);\n\t\t\n\t\t/* Save button state for on press detect */\n\t\t//_lastButton1 = buttonA;\n }", "static int getVelocity(){return currentVelocity;}", "double getVerVel(double initial_ver_vel, double time)\n {\n uy = initial_ver_vel;\n t = time;\n vy = uy - (g*t);\n return vy;\n }", "public void variation() {\r\n\t\t\r\n\t\tSystem.out.println(\"Line & Score\");\r\n\t\tSystem.out.println(\"Elevator Up\");\r\n\t\tElevator.setTargetPos(TeleopHandler.ElevatorStates.SCALE_POSITION_L);\r\n\t\tElevator.run(0);\r\n\t\tif(time.get()<5)\r\n\t\t\tDrive.runAt(0.25, 0.25);\r\n\t\telse {\r\n\t\t\tDrive.runAt(0, 0);\r\n\t\t\tSystem.out.println(\"Outtaking Cube\");\r\n\t\t\tIntake.run(TeleopHandler.IntakeStates.SLOW_OUTTAKING);\r\n\t\t}\r\n\t\t\t\r\n\t}", "private void driveLeft() {\n setSpeed(MIN_SPEED, MAX_SPEED);\n }", "static void set_ksl_tl(FM_OPL OPL, int slot, int v) {\n OPL_CH CH = OPL.P_CH[slot / 2];\n OPL_SLOT SLOT = CH.SLOT[slot & 1];\n int ksl = v >> 6;\n /* 0 / 1.5 / 3 / 6 db/OCT */\n\n /*RECHECK*/\n SLOT.ksl = (ksl != 0 ? 3 - ksl : 31);\n SLOT.TL = (int) ((v & 0x3f) * (0.75 / EG_STEP));\n /* 0.75db step */\n\n if ((OPL.mode & 0x80) == 0) {\n /* not CSM latch total level */\n\n SLOT.TLL = (int) (SLOT.TL + (CH.ksl_base >> SLOT.ksl));\n }\n }", "private synchronized void updatePathFollower() {\n TrajectoryStatus leftUpdate = pathFollower\n .getLeftVelocity(leftDrive.getPosition(), leftDrive.getSpeed(), -navX.getYaw());\n TrajectoryStatus rightUpdate = pathFollower\n .getRightVelocity(rightDrive.getPosition(), rightDrive.getSpeed(), -navX.getYaw());\n leftStatus = leftUpdate;\n rightStatus = rightUpdate;\n if (isEncodersConnected()) {\n setVelocitySetpoint(\n new DriveSignal(leftUpdate.getOutput(), rightUpdate.getOutput(), brakePath),\n leftUpdate.getArbFeed(), rightUpdate.getArbFeed());\n } else {\n leftDrive.set(ControlMode.PercentOutput,\n ((1.0 / MkMath.RPMToInchesPerSec(DRIVE.RIGHT_RPM_MAX)) * leftUpdate.getOutput()), false,\n leftUpdate.getArbFeed());\n rightDrive.set(ControlMode.PercentOutput,\n ((1.0 / MkMath.RPMToInchesPerSec(DRIVE.LEFT_RPM_MAX)) * rightUpdate.getOutput()), false,\n rightUpdate.getArbFeed());\n }\n }", "@Override\r\n\tpublic void pass(Vehicle veh) {\r\n if (qCur == 0)\r\n vCur = veh.v;\r\n else\r\n vCur = ((vCur*qCur)+veh.v)/(qCur+1);\t// add velocity to average\r\n qCur++;\r\n }", "public interface Elevator {\n public static final int UP = 1, LEVEL = 0, DOWN = -1, ERROR = -2;\n /** Returns the minimal floor number to which this Elevator can reach(often a negative value).\n * This is the same value as the lowest floor in the building - this elevator belongs to. */\n public int getMinFloor();\n /** Returns the maximal floor number to which this Elevator can reach.\n * This is the same value as the highest floor in the building - this elevator belongs to. */\n public int getMaxFloor();\n /** Returns the time (in seconds it takes the Elevator to open its doors. */\n public double getTimeForOpen();\n /** Returns the time (in seconds it takes the Elevator to close its doors */\n public double getTimeForClose();\n /** Returns the Elavator's current state: {UP, DOWN, LEVEL, ERROR} the state \"LEVEL\" mark that the elevator has reached the floor -\n * and is now ready to load / unload and get new orders. */\n public int getState(); // UP, DOWN, LEVEL, ERROR\n /** Returns the Elevator's current position (floor) as an Integer. */\n public int getPos();\n /** Moves the elevator form the current position to the destination floor. */\n public boolean goTo(int floor);\n /** Allows the elevator to stop in an intermidiate floor between src and dest, assumeing the elevator has not yer pass the desired floor in which it needs to stop. */\n public boolean stop(int floor);\n /** Returns the speed (in floor per second), e.g. if the Elevator speed is 0.4 - it takes it 2.5 seconds to pass a single floor. */\n public double getSpeed();\n /** Return the time in seconds that it takes the elevator to start moving in full speed (assumed to be a fixed value). */\n public double getStartTime();\n /** Return the time in seconds that it takes the elevator to stop moving in full speed (assumed to be a fixed value).*/\n public double getStopTime();\n /**\n * @return the id of this elevator (simple index as in the building).\n * Note: this index should be the same as in the elevator allocation algorithm.\n */\n public int getID();\n}", "private void updateLightSensorValues()\n {\n sendMessage((byte)Constants.LIGHTSENSVAL,(byte)Constants.REQ);\n try {\n Thread.sleep(4000);\n } catch(InterruptedException ex) {\n Thread.currentThread().interrupt();\n }\n sendMessage((byte)Constants.POTVAL, (byte)Constants.REQ);\n if(progPotToggleButton.isChecked())\n {\n int x =0;\n try {\n x = Integer.parseInt(progValueEditText.getText().toString());\n if(x>=0 && x<256)\n sendMessage((byte)Constants.PROGVAL,(byte)x);\n try {\n Thread.sleep(4000);\n } catch(InterruptedException ex) {\n Thread.currentThread().interrupt();\n }\n sendMessage((byte)Constants.USEPOT,(byte)Constants.NO);\n } catch (NumberFormatException e) {\n messageView.append(\"int för helvete\");\n }\n }else\n sendMessage((byte)Constants.USEPOT,(byte)Constants.YES);\n\n }", "static void resetVelocity(){currentVelocity = INITIAL_SPEED;}", "EDataType getVoltagePerReactivePower();", "public void elevatorMove(double percent) {\n // percent = percent > 0 ? percent : 0.5 * percent; <- makes it go down slower\n var scaledValue = MathHelper.limit(percent + Constants.Elevator.HOLD_PERCENT, -1, 1);\n elevatorSpark.set(scaledValue);\n }", "@Override\n\tpublic double calculateVelocity(Parrot parrot) {\n\t\treturn (parrot.getisNailed()) ? 0 : parrot.getBaseSpeed(parrot.getVoltage());\n\t}", "public final flipsParser.loiterCommandValue_return loiterCommandValue() throws RecognitionException {\n flipsParser.loiterCommandValue_return retval = new flipsParser.loiterCommandValue_return();\n retval.start = input.LT(1);\n\n CommonTree root_0 = null;\n\n Token At135=null;\n flipsParser.time_return time130 = null;\n\n flipsParser.speed_return speed131 = null;\n\n flipsParser.throttle_return throttle132 = null;\n\n flipsParser.loiterDirection_return loiterDirection133 = null;\n\n flipsParser.radius_return radius134 = null;\n\n flipsParser.waypoint_return waypoint136 = null;\n\n flipsParser.altitude_return altitude137 = null;\n\n\n CommonTree At135_tree=null;\n RewriteRuleTokenStream stream_At=new RewriteRuleTokenStream(adaptor,\"token At\");\n RewriteRuleSubtreeStream stream_waypoint=new RewriteRuleSubtreeStream(adaptor,\"rule waypoint\");\n try {\n // flips.g:281:2: ( time | speed | throttle | loiterDirection | radius | At waypoint -> waypoint | altitude )\n int alt52=7;\n alt52 = dfa52.predict(input);\n switch (alt52) {\n case 1 :\n // flips.g:281:4: time\n {\n root_0 = (CommonTree)adaptor.nil();\n\n pushFollow(FOLLOW_time_in_loiterCommandValue1360);\n time130=time();\n\n state._fsp--;\n\n adaptor.addChild(root_0, time130.getTree());\n\n }\n break;\n case 2 :\n // flips.g:282:4: speed\n {\n root_0 = (CommonTree)adaptor.nil();\n\n pushFollow(FOLLOW_speed_in_loiterCommandValue1365);\n speed131=speed();\n\n state._fsp--;\n\n adaptor.addChild(root_0, speed131.getTree());\n\n }\n break;\n case 3 :\n // flips.g:283:4: throttle\n {\n root_0 = (CommonTree)adaptor.nil();\n\n pushFollow(FOLLOW_throttle_in_loiterCommandValue1370);\n throttle132=throttle();\n\n state._fsp--;\n\n adaptor.addChild(root_0, throttle132.getTree());\n\n }\n break;\n case 4 :\n // flips.g:284:4: loiterDirection\n {\n root_0 = (CommonTree)adaptor.nil();\n\n pushFollow(FOLLOW_loiterDirection_in_loiterCommandValue1375);\n loiterDirection133=loiterDirection();\n\n state._fsp--;\n\n adaptor.addChild(root_0, loiterDirection133.getTree());\n\n }\n break;\n case 5 :\n // flips.g:285:4: radius\n {\n root_0 = (CommonTree)adaptor.nil();\n\n pushFollow(FOLLOW_radius_in_loiterCommandValue1380);\n radius134=radius();\n\n state._fsp--;\n\n adaptor.addChild(root_0, radius134.getTree());\n\n }\n break;\n case 6 :\n // flips.g:286:4: At waypoint\n {\n At135=(Token)match(input,At,FOLLOW_At_in_loiterCommandValue1385); \n stream_At.add(At135);\n\n pushFollow(FOLLOW_waypoint_in_loiterCommandValue1387);\n waypoint136=waypoint();\n\n state._fsp--;\n\n stream_waypoint.add(waypoint136.getTree());\n\n\n // AST REWRITE\n // elements: waypoint\n // token labels: \n // rule labels: retval\n // token list labels: \n // rule list labels: \n // wildcard labels: \n retval.tree = root_0;\n RewriteRuleSubtreeStream stream_retval=new RewriteRuleSubtreeStream(adaptor,\"rule retval\",retval!=null?retval.tree:null);\n\n root_0 = (CommonTree)adaptor.nil();\n // 287:2: -> waypoint\n {\n adaptor.addChild(root_0, stream_waypoint.nextTree());\n\n }\n\n retval.tree = root_0;\n }\n break;\n case 7 :\n // flips.g:288:4: altitude\n {\n root_0 = (CommonTree)adaptor.nil();\n\n pushFollow(FOLLOW_altitude_in_loiterCommandValue1397);\n altitude137=altitude();\n\n state._fsp--;\n\n adaptor.addChild(root_0, altitude137.getTree());\n\n }\n break;\n\n }\n retval.stop = input.LT(-1);\n\n retval.tree = (CommonTree)adaptor.rulePostProcessing(root_0);\n adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);\n\n }\n catch (RecognitionException re) {\n reportError(re);\n recover(input,re);\n \tretval.tree = (CommonTree)adaptor.errorNode(input, retval.start, input.LT(-1), re);\n\n }\n finally {\n }\n return retval;\n }", "public void resetPot() {\n m_minRawAngle = getRawAngle();\n }", "public double lhv(){\n return comp.getLHV() * (molarMass()/1000) * (1000/PhysicalProperties.MOLAR_VOLUME);\n }", "int getVpotNum();", "public float getCurrVelocity() {\n /*\n // Can't load method instructions: Load method exception: bogus opcode: 00e3 in method: android.widget.OppoScroller.getCurrVelocity():float, dex: \n */\n throw new UnsupportedOperationException(\"Method not decompiled: android.widget.OppoScroller.getCurrVelocity():float\");\n }", "double getBatteryVoltage(boolean first_reading) {\n double result = Double.POSITIVE_INFINITY;\n for (VoltageSensor sensor : hardwareMap.voltageSensor) {\n double voltage = sensor.getVoltage();\n if (voltage > 0) {\n result = Math.min(result, voltage);\n if(first_reading) break; // return the first valid reading (>0.0) to minimize overhead\n }\n }\n return result;\n }", "private String accelConversion() {\n int reading = record[15] & 255;\n double voltage = (reading * 3.33) / 256;\n //return formatter.format(reading);\n return formatter.format((voltage / .290)*9.806);\n }", "public void descend() {\n \t\n elevator1.set(-0.9);\n elevator2.set(-0.9); \n }", "@Override\n\tpublic double getSelectedSensorVelocity() {\n return encoder.getVelocity();\n\t}", "@Override\n\tpublic void autonomousPeriodic() {\n\t\tSmartDashboard.putNumber(\"Arm Pot Value\", Robot.arm.getArmPot());\n\n\t\tScheduler.getInstance().run();\n\t\t\n\t\tif(!elevator.getBottomElevatorLimit()) {\n\t\t\televator.resetElevatorMag();\n\t\t}\n\t}", "double a_right_back_drive_power ()\n {\n double l_return = 0.0;\n\n if (right_back_drv_Motor != null)\n {\n l_return = right_back_drv_Motor.getPower ();\n }\n\n return l_return;\n\n }", "@Override\n protected void execute() {\n System.out.println(\"Elevator PID Loop:\");\n System.out.println(\"\\t - Current Position: \" + Robot.m_elevator.getEncoder().getPosition());\n \n SmartDashboard.putNumber(\"elevator/pos\", Robot.m_elevator.getEncoder().getPosition());\n // SmartDashboard.putNumber(\"elevator/target\", pos);\n //SmartDashboard.putNumber(\"elevator/error\", Math.abs(Robot.m_elevator.getEncoder().getPosition() - pos));\n // System.out.println(\"\\t - Error: \" + Robot.m)\n }", "public void updateGrade() throws SimulationStopException{\r\n /*if(realtime){\r\n double[] pos1 = gps.getPos();\r\n \r\n double []pos2 = gps.getPos();\r\n double product = (6378100)*Math.PI/18000;\r\n grade = (pos1[2]-pos2[2])/\r\n Math.sqrt(Math.pow((pos1[1]-pos2[1])*product,2) +\r\n Math.pow((pos1[0]-pos2[0])*product,2));\r\n }*/\r\n if(time.isRunning()){\r\n\r\n try {\r\n \t//calculate grade\r\n \tif(index!=0){\r\n grade = ((roadData[altIndex][index] - roadData[altIndex][index-1])/\r\n (roadData[distIndex][index] - roadData[distIndex][index-1]));\r\n \t}\r\n \r\n // calculate orientation (used for wind and turns)\r\n /* Understandable version...\r\n * product = 60/0.5399555*1000\r\n *\r\n * distLat = (tempLat - lat)*product;\r\n * distLon = (tempLon - lon)*product*Math.cos((tempLat + lat)/2*Math.PI/180);\r\n * carAngle = atan(distLon/distLat) + PI/2\r\n * */\r\n \r\n carAngle = Math.atan((roadData[lonIndex][index]-roadData[lonIndex][index+1])\r\n \t\t*Math.cos((roadData[latIndex][index]+roadData[latIndex][index+1])/2*Math.PI/180)/\r\n (roadData[latIndex][index]-roadData[latIndex][index+1])) + Math.PI/2;\r\n while(carAngle>Math.PI*2){\r\n \tcarAngle-=Math.PI*2;\r\n }\r\n\r\n index++;\r\n segsLeft--;\r\n // if we hit a control point, stop for ctrlTimeLength seconds of time\r\n if(roadData[distIndex][index]>ctrlPts[ctrlIndex]&&ctrlIndex<=ctrlPts.length){\r\n time.ctrlPointHit(ctrlTimeLength);\r\n System.out.println(\"Control Point: \" + roadData[distIndex][index]);\r\n ctrlIndex++;\r\n }\r\n }\r\n catch (IndexOutOfBoundsException e) {\r\n throw new SimulationStopException(\"Simulation stopped at control point \"+ctrlIndex);\r\n // Is this message right!?\r\n }\r\n }\r\n }", "public void update(IFloorModel floor, IElevatorModel elevator) {\n\t\tif(floor == null || elevator == null) {\n\t\t\tthrow new NullPointerException(\"MainGuiController.update() NullPointerException\");\n\t\t}\n\t\t\n\t\t//if there are no elevators, do nothing on update. Nothing should or can be updated\n\t\tif(listview_elevators.getItems().isEmpty()) {\n\t\t\treturn;\n\t\t}\n\t\t\n\t\t//get current selected elevator\n\t\t//getSelectedIndex() returned -1 if no line is selected\n\t\tif(selectedElevator < 0) {\n\t\t\tthrow new IllegalStateException(\"MainGuiController.update() listview_elevators no line selected!\");\n\t\t}\n\t\t//check if the selected elevator is in manual or automatic mode -> set checkbox and button to right state.\n\t\tif(autoModeAlgo.checkIfInAutoMode(selectedElevator)) {\n\t\t\tcheckbox_manual_mode.setSelected(false);\n\t\t\tbutton_send_to_floor.setDisable(true);\n\t\t}\n\t\telse {\n\t\t\tcheckbox_manual_mode.setSelected(true);\n\t\t\tbutton_send_to_floor.setDisable(false);\n\t\t}\n\t\t\n\t\t//update gui with new values from the given elevator\n\t\t//elevator data\n\t\tPlatform.runLater(() -> {\n\t\t\tInteger targetReranged = elevator.getTarget() + 1;\n\t\t\tlabel_target_text.setText(targetReranged.toString());\n\t\t\tInteger positionReranged = elevator.getPosition() + 1;\n\t\t\tlabel_position_text.setText(positionReranged.toString());\n\t\t\t\n\t\t\tString direction = elevator.getDirection().toString();\n\t\t\tdirection = direction.substring(direction.lastIndexOf('_') + 1);\n\t\t\tdirection = direction.substring(0,1).toUpperCase() + direction.substring(1).toLowerCase();\n\t\t\tlabel_direction_text.setText(direction);\n\t\t\t\n\t\t\tlabel_payload_text.setText(elevator.getPayload().toString());\n\t\t\tInteger speedAbs = Math.abs(elevator.getSpeed());\n\t\t\tlabel_speed_text.setText(speedAbs.toString());\n\t\t\t\n\t\t\tString doorsState = elevator.getDoors().toString();\n\t\t\tdoorsState = doorsState.substring(doorsState.lastIndexOf('_') + 1); \t//get the last part of the enum, this contains the state.\n\t\t\tdoorsState = doorsState.substring(0,1).toUpperCase() + doorsState.substring(1).toLowerCase();\t//all to lower, except the first character\n\t\t\tlabel_doors_text.setText(doorsState);\n\t\t});\n\t\t\n\t\tString floorListViewPrefix = \"Floor \";\n\t\t//stops\n\t\tList<Integer> stops = elevator.getStopsList();\n\t\tif (stops == null) {\n\t\t\tthrow new NullPointerException(\"MainGuiController.update() stops\");\n\t\t}\n\t\tObservableList<String> stopsOl = FXCollections.observableArrayList();\n\t\tfor (Integer e : stops) {\n\t\t\tstopsOl.add(floorListViewPrefix + (e+1));\n\t\t}\n\t\tPlatform.runLater(() -> listview_stops.getItems().setAll(stopsOl));\n\t\t\n\t\t//not serviced floors\n\t\tList<Integer> ignoredFloors = elevator.getIgnoredFloorsList();\n\t\tif (ignoredFloors == null) {\n\t\t\tthrow new NullPointerException(\"MainGuiController.register() ignoredFloors\");\n\t\t}\n\t\tObservableList<String> ignoredFloorsOl = FXCollections.observableArrayList();\n\t\tfor (Integer e : ignoredFloors) {\n\t\t\tignoredFloorsOl.add(floorListViewPrefix + (e+1));\n\t\t}\n\t\tPlatform.runLater(() -> listview_no_service.getItems().setAll(ignoredFloorsOl));\n\t\t\n\t\t//calls\n\t\tList<Integer> callsUp = floor.getUpButtonsList();\n\t\tif (callsUp == null) {\n\t\t\tthrow new NullPointerException(\"MainGuiController.update() callsUp\");\n\t\t}\n\t\tObservableList<String> callsUpOl = FXCollections.observableArrayList();\n\t\tfor (Integer e : callsUp) {\n\t\t\tcallsUpOl.add(floorListViewPrefix + (e+1));\n\t\t}\n\t\tPlatform.runLater(() -> listview_calls_up.getItems().setAll(callsUpOl));\n\t\t\n\t\tList<Integer> callsDown = floor.getDownButtonsList();\n\t\tif (callsDown == null) {\n\t\t\tthrow new NullPointerException(\"MainGuiController.update() callsDown\");\n\t\t}\n\t\tObservableList<String> callsDownOl = FXCollections.observableArrayList();\n\t\tfor (Integer e : callsDown) {\n\t\t\tcallsDownOl.add(floorListViewPrefix + (e+1));\n\t\t}\n\t\tPlatform.runLater(() -> listview_calls_down.getItems().setAll(callsDownOl));\n\t}", "double a_right_front_drive_power ()\n {\n double l_return = 0.0;\n\n if (right_front_drv_Motor != null)\n {\n l_return = right_front_drv_Motor.getPower ();\n }\n\n return l_return;\n\n }", "@Override\n\tpublic double calculateVelocity() {\n\t\tdouble result = distance / time + velocitySame - velocityReverse;\n\t\treturn result;\n\t}", "private void visionDrive(double throttle) {\n if(limelight.isValidTarget()) {\n// DriverStation.reportWarning(\"\"+SmartDashboard.getNumber(\"Vision P\", Constants.visionDriveP),false);\n// visionDrive.setP(SmartDashboard.getNumber(\"Vision P\", Constants.visionDriveP));\n// visionDrive.setI(SmartDashboard.getNumber(\"Vision I\", Constants.visionDriveI));\n// visionDrive.setD(SmartDashboard.getNumber(\"Vision D\", Constants.visionDriveD));\n// visionDrive.setMaxIOutput(.225);\n double error = limelight.getCenter().x;\n double output = Constants.outsideP * -error;\n if(Math.abs(error) < 4) {\n// SmartDashboard.putString(\"In PID?\", \"PID\");\n output = visionDrive.getOutput(error);\n left.set(ControlMode.PercentOutput, throttle - output);\n right.set(ControlMode.PercentOutput, throttle + output);\n// SmartDashboard.putNumber(\"PID Output\", output);\n }\n else if(Math.abs(error) < 7 && Math.abs(error) > 2){\n double val = .2;\n if (error < 0){\n// SmartDashboard.putString(\"In PID?\", \"1\");\n left.set(ControlMode.PercentOutput, -val);\n right.set(ControlMode.PercentOutput, val);\n }\n else if (error > 0){\n// SmartDashboard.putString(\"In PID?\", \"2\");\n left.set(ControlMode.PercentOutput, val);\n right.set(ControlMode.PercentOutput, -val);\n }\n }\n else if (error < 0){\n// SmartDashboard.putString(\"In PID?\", \"3\");\n left.set(ControlMode.PercentOutput, -.25);\n right.set(ControlMode.PercentOutput, .25);\n }\n else if (error > 0){\n// SmartDashboard.putString(\"In PID?\", \"4\");\n left.set(ControlMode.PercentOutput, .25);\n right.set(ControlMode.PercentOutput, -.25);\n }\n\n SmartDashboard.putNumber(\"Error\", error);\n } else {\n visionDrive.reset();\n setOutput(0, 0);\n }\n }", "public boolean encoderDrive(int encoderDelta, driveStyle drive, double motorPower, double timeout, DcMotor[] motors)\n {\n\n\n switch(drive)\n {\n case FORWARD:\n {\n double encoderReadingLB = motors[2].getCurrentPosition();\n motors[0].setPower(setPower(0, -motorPower, 0)[0]);\n motors[1].setPower(setPower(0, -motorPower, 0)[1]);\n motors[2].setPower(setPower(0, -motorPower, 0)[2]);\n motors[3].setPower(setPower(0, -motorPower, 0)[3]);\n\n while (motors[2].getCurrentPosition() >= (-encoderDelta + encoderReadingLB))\n {\n\n }\n\n\n motors[0].setPower(setPower(-motorPower, 0, 0)[0]);\n motors[1].setPower(setPower(-motorPower, 0, 0)[1]);\n motors[2].setPower(setPower(-motorPower, 0, 0)[2]);\n motors[3].setPower(setPower(-motorPower, 0, 0)[3]);\n\n break;\n\n\n }\n\n case BACKWARD:\n {\n double encoderReadingLB = motors[2].getCurrentPosition();\n motors[0].setPower(setPower(0, motorPower, 0)[0]);\n motors[1].setPower(setPower(0, motorPower, 0)[1]);\n motors[2].setPower(setPower(0, motorPower, 0)[2]);\n motors[3].setPower(setPower(0, motorPower, 0)[3]);\n\n while (motors[2].getCurrentPosition() <= (encoderDelta + encoderReadingLB))\n {\n\n }\n\n\n motors[0].setPower(setPower(-motorPower, 0, 0)[0]);\n motors[1].setPower(setPower(-motorPower, 0, 0)[1]);\n motors[2].setPower(setPower(-motorPower, 0, 0)[2]);\n motors[3].setPower(setPower(-motorPower, 0, 0)[3]);\n\n break;\n }\n\n case STRAFE_LEFT:\n {\n double encoderReadingLB = motors[2].getCurrentPosition();\n motors[0].setPower(setPower(-motorPower, 0, 0)[0]);\n motors[1].setPower(setPower(-motorPower, 0, 0)[1]);\n motors[2].setPower(setPower(-motorPower, 0, 0)[2]);\n motors[3].setPower(setPower(-motorPower, 0, 0)[3]);\n\n while (motors[2].getCurrentPosition() >= (encoderReadingLB - encoderDelta))\n {\n\n }\n\n\n motors[0].setPower(setPower(-motorPower, 0, 0)[0]);\n motors[1].setPower(setPower(-motorPower, 0, 0)[1]);\n motors[2].setPower(setPower(-motorPower, 0, 0)[2]);\n motors[3].setPower(setPower(-motorPower, 0, 0)[3]);\n\n break;\n }\n\n case STRAFE_RIGHT:\n {\n double encoderReadingLB = motors[2].getCurrentPosition();\n motors[0].setPower(setPower(motorPower, 0, 0)[0]);\n motors[1].setPower(setPower(motorPower, 0, 0)[1]);\n motors[2].setPower(setPower(motorPower, 0, 0)[2]);\n motors[3].setPower(setPower(motorPower, 0, 0)[3]);\n\n while (motors[2].getCurrentPosition() >= (-encoderDelta + encoderReadingLB))\n {\n\n }\n\n\n motors[0].setPower(setPower(-motorPower, 0, 0)[0]);\n motors[1].setPower(setPower(-motorPower, 0, 0)[1]);\n motors[2].setPower(setPower(-motorPower, 0, 0)[2]);\n motors[3].setPower(setPower(-motorPower, 0, 0)[3]);\n\n break;\n }\n\n case FORWARD_LEFT:\n {\n double encoderReadingLB = motors[2].getCurrentPosition();\n motors[0].setPower(setPower(-motorPower, -motorPower, 0)[0]);\n motors[1].setPower(setPower(-motorPower, -motorPower, 0)[1]);\n motors[2].setPower(setPower(-motorPower, -motorPower, 0)[2]);\n motors[3].setPower(setPower(-motorPower, -motorPower, 0)[3]);\n\n while (motors[2].getCurrentPosition() <= (encoderDelta + encoderReadingLB))\n {\n\n }\n\n\n motors[0].setPower(setPower(-motorPower, 0, 0)[0]);\n motors[1].setPower(setPower(-motorPower, 0, 0)[1]);\n motors[2].setPower(setPower(-motorPower, 0, 0)[2]);\n motors[3].setPower(setPower(-motorPower, 0, 0)[3]);\n\n break;\n }\n\n case FORWARD_RIGHT:\n {\n double encoderReadingRB = motors[1].getCurrentPosition();\n motors[0].setPower(setPower(motorPower, -motorPower, 0)[0]);\n motors[1].setPower(setPower(motorPower, -motorPower, 0)[1]);\n motors[2].setPower(setPower(motorPower, -motorPower, 0)[2]);\n motors[3].setPower(setPower(motorPower, -motorPower, 0)[3]);\n\n while (motors[1].getCurrentPosition() >= (-encoderDelta + encoderReadingRB))\n {\n\n }\n\n\n motors[0].setPower(setPower(-motorPower, 0, 0)[0]);\n motors[1].setPower(setPower(-motorPower, 0, 0)[1]);\n motors[2].setPower(setPower(-motorPower, 0, 0)[2]);\n motors[3].setPower(setPower(-motorPower, 0, 0)[3]);\n\n break;\n }\n\n case BACKWARD_LEFT:\n {\n double encoderReadingRB = motors[1].getCurrentPosition();\n motors[0].setPower(setPower(-motorPower, motorPower, 0)[0]);\n motors[1].setPower(setPower(-motorPower, motorPower, 0)[1]);\n motors[2].setPower(setPower(-motorPower, motorPower, 0)[2]);\n motors[3].setPower(setPower(-motorPower, motorPower, 0)[3]);\n\n while (motors[1].getCurrentPosition() <= (encoderDelta + encoderReadingRB))\n {\n\n }\n\n\n motors[0].setPower(setPower(-motorPower, 0, 0)[0]);\n motors[1].setPower(setPower(-motorPower, 0, 0)[1]);\n motors[2].setPower(setPower(-motorPower, 0, 0)[2]);\n motors[3].setPower(setPower(-motorPower, 0, 0)[3]);\n\n break;\n }\n\n case BACKWARD_RIGHT:\n {\n double encoderReadingLB = motors[2].getCurrentPosition();\n motors[0].setPower(setPower(motorPower, motorPower, 0)[0]);\n motors[1].setPower(setPower(motorPower, motorPower, 0)[1]);\n motors[2].setPower(setPower(motorPower, motorPower, 0)[2]);\n motors[3].setPower(setPower(motorPower, motorPower, 0)[3]);\n\n while (motors[2].getCurrentPosition() >= (-encoderDelta + encoderReadingLB))\n {\n\n }\n\n\n motors[0].setPower(setPower(-motorPower, 0, 0)[0]);\n motors[1].setPower(setPower(-motorPower, 0, 0)[1]);\n motors[2].setPower(setPower(-motorPower, 0, 0)[2]);\n motors[3].setPower(setPower(-motorPower, 0, 0)[3]);\n\n break;\n }\n\n case PIVOT_LEFT:\n {\n double encoderReadingLB = motors[2].getCurrentPosition();\n motors[0].setPower(setPower(0, 0, -motorPower)[0]);\n motors[1].setPower(setPower(0, 0, -motorPower)[1]);\n motors[2].setPower(setPower(0, 0, -motorPower)[2]);\n motors[3].setPower(setPower(0, 0, -motorPower)[3]);\n\n while (motors[2].getCurrentPosition() >= (-encoderDelta + encoderReadingLB))\n {\n\n }\n\n\n motors[0].setPower(setPower(-motorPower, 0, 0)[0]);\n motors[1].setPower(setPower(-motorPower, 0, 0)[1]);\n motors[2].setPower(setPower(-motorPower, 0, 0)[2]);\n motors[3].setPower(setPower(-motorPower, 0, 0)[3]);\n\n break;\n }\n\n case PIVOT_RIGHT:\n {\n double encoderReadingLB = motors[2].getCurrentPosition();\n motors[0].setPower(setPower(0, 0, motorPower)[0]);\n motors[1].setPower(setPower(0, 0, motorPower)[1]);\n motors[2].setPower(setPower(0, 0, motorPower)[2]);\n motors[3].setPower(setPower(0, 0, motorPower)[3]);\n\n while (motors[2].getCurrentPosition() <= (encoderDelta + encoderReadingLB))\n {\n\n }\n\n\n motors[0].setPower(setPower(-motorPower, 0, 0)[0]);\n motors[1].setPower(setPower(-motorPower, 0, 0)[1]);\n motors[2].setPower(setPower(-motorPower, 0, 0)[2]);\n motors[3].setPower(setPower(-motorPower, 0, 0)[3]);\n\n break;\n }\n\n\n }\n\n return true;\n }", "@Override\r\n public int run() {\n if (robot.rightDrive.isBusy() && robot.leftDrive.isBusy()) {\r\n robot.leftDrive.setPower(leftSpeed);\r\n robot.rightDrive.setPower(rightSpeed);\r\n\r\n /*telemetry.addData(\"MoveByEncoder To\", \"Left: (%2f), Right (%2f)\",\r\n leftTarget, rightTarget);\r\n telemetry.addData(\"MoveByEncoder At\", \"Left: (%2f), Right (%2f)\",\r\n robot.leftDrive.getCurrentPosition(), robot.rightDrive.getCurrentPosition());\r\n telemetry.update();*/\r\n\r\n telemetry.addData(\"Left Pos\", robot.leftDrive.getCurrentPosition());\r\n telemetry.addData(\"Right Pos\", robot.rightDrive.getCurrentPosition());\r\n telemetry.update();\r\n\r\n return 0;\r\n\r\n }\r\n\r\n return nextPos;\r\n }", "public void drive(double power_cap, double target_distance, double target_acceleration,\n double target_velocity) {\n TL.resetMotor();\n TR.resetMotor();\n BL.resetMotor();\n BR.resetMotor();\n\n // Required Stop Condition\n int success_count = TL.getSuccess_count();\n\n // \"PID\" Loop\n while((opModeIsActive() && !isStopRequested()) && (success_count < 90)){\n success_count = TL.getSuccess_count();\n // IMU PID STUFF\n imu.imu_iter(0.00000001);\n double imu_correction = imu.getCorrection();\n telemetry.addData(\"IMU Correction -> \", imu_correction);\n telemetry.addData(\"Global Angle ->\", imu.getGlobalAngle());\n if (!MotorPlus.isWithin(0.0195, imu_correction, 0.0)){\n // If correction is needed, we correct the angle\n TL.addExternalResponse(-imu_correction);\n TR.addExternalResponse(imu_correction);\n BL.addExternalResponse(-imu_correction);\n BR.addExternalResponse(imu_correction);\n } else {\n TL.addExternalResponse(0.0);\n TR.addExternalResponse(0.0);\n BL.addExternalResponse(0.0);\n BR.addExternalResponse(0.0);\n }\n\n // Supplying the \"targets\" to the Motors\n TL.actuate(power_cap, target_distance, target_acceleration, target_velocity);\n TR.actuate(power_cap, target_distance, target_acceleration, target_velocity);\n BL.actuate(power_cap, target_distance, target_acceleration, target_velocity);\n BR.actuate(power_cap, target_distance, target_acceleration, target_velocity);\n\n // Telemetry Stuff\n telemetry.addData(\"TL, TR, BL, and BR Vels -> \", TL.getCurrent_velocity());\n telemetry.addData(\"Success Count TL -> \", TL.getSuccess_count());\n telemetry.update();\n }\n }", "public void testVelocityNumerically() {\n // crud, I don't know, how much can we expect velocity and finite differences to agree?\n double bound = dt*dt*velocity*velocity; // sure, let's go with that. Keep in mind this changes with sampling rates, velocity, the order of the function, etc.\n double endtime = racetrack.getPerimeter() / racetrack.getVelocity();\n differentiatePosition(racetrack, 0.0, endtime, dt, bound);\n }", "public double getCurrentVelocity( )\r\n {\r\n return Math.sqrt( this.h_velocity * this.h_velocity + this.v_velocity * this.v_velocity );\r\n }", "double a_left_back_drive_power()\n {\n double l_return = 0.0;\n if (left_back_drv_Motor != null)\n {\n l_return = left_back_drv_Motor.getPower ();\n }\n\n return l_return;\n\n }", "@Override\n\tpublic double GetValue() {\n\t\tdouble spot = inputs.getSpot();\n\t\tdouble strike = inputs.getStrike();\n\t\tdouble vol = inputs.getVol();\n\t\tint noSteps=inputs.getNoSteps();\n\t\tdouble expiry=inputs.getExpiry();\n\t OptionType type=inputs.getType();\n\t ExerciseType exercise=inputs.getExercise();\n\t InterestRate interestRate=inputs.getR();\n\t\t\n\t double timestep = expiry/noSteps;\n\t double DF = Math.exp(-interestRate.GetRate(1.)*timestep);\n\t double temp1 = Math.exp((interestRate.GetRate(1.) + vol * vol)*timestep);\n\t double temp2 = 0.5 * (DF + temp1);\n\t double up = temp2 + Math.sqrt(temp2*temp2 - 1);\n\t double down = 1/ up;\n\t double probaUp = (Math.exp(interestRate.GetRate(1.) * timestep) - down)/(up -down) ;\n\t double probaDown = 1 - probaUp;\n\n\t //stock price tree\n\t\tstockPrice[0][0]=spot;\n\t for (int n = 1; n <= noSteps; n ++) {\n for (int j = n; j > 0; j--){\n \tstockPrice[j][n] = up * stockPrice[j-1][n-1];\n }\n \t\tstockPrice[0][n] = down * stockPrice[0][n-1];\n }\n\t \n\t //last column set payoffs\n\t\tfor (int j = 0; j <= noSteps; j++) {\n\t\t\t\tif(type.equals(OptionType.CALL)) {\n\t\t\t\t\tpayOff[j][noSteps] = Math.max(this.stockPrice[j][noSteps] - strike, .0);\n\t\t\t\t}else {\n\t\t\t\t\tpayOff[j][noSteps] = Math.max(strike - this.stockPrice[j][noSteps], .0);\n\t\t\t\t}\n\t\t}\n\n\t\t\n\t //payoff tree in backwardation\n\t \n\t for (int i = noSteps ; i >= 1; i--) {\n for (int j = 0; j <= i-1; j++) {\n\t \tif(exercise.equals(ExerciseType.AMERICAN)) { \n\t //American\t\n\t \t\tif(type.equals(OptionType.CALL)) {\n\t \t\t\t\tpayOff[j][i-1] = Math.max(DF * (probaUp * payOff[j+1][i] + probaDown * payOff[j][i]) ,\n\t \t\t\t\tMath.max(this.stockPrice[j][i-1] - strike, .0));\n\t \t\t\t\n\t \t\t}else \tpayOff[j][i-1] = Math.max(DF * (probaUp * payOff[j+1][i] + probaDown * payOff[j][i]) ,\n\t \t\t\t\tMath.max(strike - this.stockPrice[j][i-1] , .0));\n\t \t}else { \n\t \t\t\t//European put and call option\n\t \t\t\t\tpayOff[j][i-1] = DF * (probaUp * payOff[j+1][i] + probaDown * payOff[j][i]);\n\t }\n }\n }\n\t \n\t double deltaUp = (payOff[0][2]-payOff[1][2])/(stockPrice[0][2]-stockPrice[1][2]);\n\t double deltaDown = (payOff[1][2]-payOff[2][2])/(stockPrice[1][2]-stockPrice[2][2]);\n\t delta = (deltaUp + deltaDown) /2;\n\t gamma = (deltaUp-deltaDown)/((stockPrice[0][2]-stockPrice[2][2])/2);\n\t theta = (payOff[1][2]-payOff[0][0])/(365*2*timestep);//time in days\n\t \n\t long rounded = Math.round(payOff[0][0]*10000);\n\t return rounded/10000.0;\n\t}", "double getVx() { return vel[0]; }", "@Override\n public void robotPeriodic() {\n\n SmartDashboard.putString(\"DB/String 0\", \": \" + ControllerMap.driverMode);\n SmartDashboard.putString(\"DB/String 3\",\n \"pot value: \" + String.valueOf(Intake.getInstance().potentiometer.getVoltage()));\n SmartDashboard.putString(\"DB/String 7\", \"Zero position: \" + Intake.getInstance().getStartingWristEncoderValue());\n SmartDashboard.putString(\"DB/String 8\",\n \"wrist encoder: \" + String.valueOf(Hardware.intakeWrist.getSensorCollection().getQuadraturePosition()));\n SmartDashboard.putString(\"DB/String 9\",\n \"Corrected wrist: \" + String.valueOf(Intake.getInstance().getCorrectedWristEncoderValue()));\n // SmartDashboard.putString(\"DB/String 4\", \"pot value: \" +\n // String.valueOf(intake.potentiometer.getValue()));\n // SmartDashboard.putString(\"DB/String 9\", \"pot voltage: \" +\n // String.valueOf(intake.potentiometer.getVoltage()));\n }", "public double getVelocity() {\n return mV;\n }", "public static final native int getChargingVoltage();", "public DJIBatteryCell (int voltage)\n {\n _voltage = voltage;\n }", "@Override\n public void teleopPeriodic() {\n\n double l = left.calculate((int)rightEnc.get());\n double r = right.calculate((int)rightEnc.get());\n\n double gyro_heading = gyro.getYaw(); // Assuming the gyro is giving a value in degrees\n double desired_heading = Pathfinder.r2d(left.getHeading()); // Should also be in degrees\n\n double angleDifference = Pathfinder.boundHalfDegrees(desired_heading - gyro_heading);\n double turn = 0.8 * (-1.0/80.0) * angleDifference;\n\n //left1.set(l + turn);\n //right1.set(r - turn);\n left1.set(0);\n right1.set(0);\n System.out.println(\"Get: \" + rightEnc.get() + \" Raw: \" + rightEnc.getRaw());\n\n }", "protected void execute() {\n\t\tdouble tempSpeed = Math.abs(elSpeed);\n\t\tdirection = newPosition.getValue() > Robot.elevator.getCurrentPosition().getValue()\n\t\t\t\t? RelativeDirection.ZAxis.UP : RelativeDirection.ZAxis.DOWN;\n\n\t\tif (direction == RelativeDirection.ZAxis.DOWN) {\n\t\t\ttempSpeed = -tempSpeed;\n\t\t}\n\n\t\tRobot.elevator.setElevatorSpeed(tempSpeed);\n\t}", "void easy_ride_old (double min_lift, double start_speed) { \n double pitch = 0;\n double min_drag = 10000.0;\n double min_drag_speed = -1;\n for (double speed = start_speed; speed < v_max; speed += 0.5) {\n velocity = speed;\n trace(\"velocity: \" + velocity);\n for (pitch = 0; pitch <= aoa_max; pitch += 0.1) {\n craft_pitch = pitch;\n //computeFlowAndRegenPlotAndAdjust();\n recomp_all_parts();\n // if (total_drag() >= max_drag) {\n // trace(\"warning speed: \" + speed + \" pitch: \" + pitch + \" lift \" + foil_lift());\n // return;\n // }\n if (foil_lift() >= min_lift) {\n double drag = total_drag();\n if (min_drag > drag) {\n min_drag = drag;\n min_drag_speed = velocity;\n break;\n } else {\n // drag goes up now. can be done now, but\n // as a heuristic, now try from the upepr limit, and then find range:\n max_speed(min_lift, min_drag + 2, false);\n if (velocity < min_drag_speed) {\n // something went wrong (iteration stepped over the sweets spot etc)\n // so we take min_lift, min_drag, and min_drag_speed as is\n make_cruising_info(min_lift, min_drag, min_drag_speed); \n System.out.println(\"\\nDone!\\n----------------\\n\" + cruising_info);\n } else {\n // done, report with average of min_drag_speed and velocity\n make_cruising_info(min_lift, min_drag+1, (min_drag_speed+velocity)/2); \n trace(\"done with refinement! \");\n System.out.println(\"\\nDone!\\n----------------\\n\" + cruising_info);\n }\n return;\n }\n }\n }\n }\n }" ]
[ "0.62110615", "0.6157675", "0.6144578", "0.6116419", "0.6108388", "0.6083458", "0.59643775", "0.59516025", "0.58610225", "0.5853645", "0.5801797", "0.57941157", "0.5786057", "0.5771829", "0.5746114", "0.5696335", "0.56524754", "0.56392545", "0.5624028", "0.5602416", "0.5548448", "0.55474615", "0.5441177", "0.5439805", "0.54322314", "0.5431381", "0.5428327", "0.54178303", "0.53937685", "0.538288", "0.53642493", "0.53641826", "0.53575903", "0.53492874", "0.5345391", "0.53428537", "0.5341541", "0.5318358", "0.53121775", "0.5305846", "0.5298028", "0.5296037", "0.52948606", "0.529217", "0.5283039", "0.52824324", "0.5279778", "0.5267456", "0.524954", "0.52441174", "0.523278", "0.5225846", "0.52222043", "0.5219436", "0.52174246", "0.5207995", "0.5201813", "0.5198055", "0.5196431", "0.5193014", "0.51895124", "0.51886225", "0.51875514", "0.5178449", "0.5176625", "0.51715696", "0.51698583", "0.51692903", "0.5167546", "0.5166135", "0.5165705", "0.51639175", "0.51618975", "0.51604605", "0.51553726", "0.5154957", "0.5146683", "0.514642", "0.5144688", "0.51398426", "0.51388776", "0.5137576", "0.5136956", "0.51336026", "0.5133439", "0.512556", "0.5123629", "0.512133", "0.5117248", "0.5108996", "0.51070774", "0.5102882", "0.509816", "0.5095358", "0.5092203", "0.509156", "0.509134", "0.5084131", "0.508269", "0.50747526" ]
0.6051373
6
Get a Single universite
@GetMapping("/get/{id}") public universites getUniversiteById(@PathVariable Long id) { return IF.getId(id); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static Univers get(){\n if (instance == null)\n {\n instance = new Univers();\n }\n return instance;\n }", "Uom getUom();", "public Unite obtenirUnite(String unite) {\n\t\t\tUnite resultat = null;\n\t\t\t\n\t\t\tswitch (unite) {\n\t\t\tcase \"heure\":\n\t\t\t\tresultat = new Heure();\n\t\t\t\tbreak ;\n\t\t\tcase \"Portion\":\n\t\t\t\tresultat = new Portion();\n\t\t\t\tbreak ;\n\t\t\tcase \"minute\":\n\t\t\t\tresultat = new Minute();\n\t\t\t\tbreak ;\n\t\t\tcase \"personne\":\n\t\t\t\tresultat = new Personne();\n\t\t\t\tbreak ;\n\t\t\tcase \"tasse\":\n\t\t\t\tresultat = new Tasse();\n\t\t\t\tbreak ;\n\t\t\tcase \"cuillere a soupe\":\n\t\t\t\tresultat = new Cuillere_a_soupe();\n\t\t\t\tbreak ;\n\t\t\tcase \"cuillere a the\":\n\t\t\t\tresultat = new Cuillere_a_the();\n\t\t\t\tbreak ;\n\t\t\tdefault:\n\t\t\t\tresultat = null;\n\t\t\t}\n\t\t\treturn resultat ;\n\t\t}", "public Usinas findOne(String id) {\n log.debug(\"Request to get Usinas : {}\", id);\n return usinasRepository.findOne(id);\n }", "@SuppressWarnings(\"unchecked\")\n\tpublic U accessObject()\n\t{\n\t\treturn (primaryKey == null)?(null):\n\t\t (U)bean(GetUnity.class).getUnited(primaryKey);\n\t}", "protected Utente fetchSingleResult(ResultSet rs) throws SQLException\n\t{\n\t\tif (rs.next()) {\n\t\t\tUtente dto = new Utente();\n\t\t\tpopulateDto( dto, rs);\n\t\t\treturn dto;\n\t\t} else {\n\t\t\treturn null;\n\t\t}\n\t\t\n\t}", "V get(UniqueId uniqueId);", "Corretor findOne(Long id);", "default <RT> RT uniqueResult(Expression<RT> projection) {\n\t\treturn select(projection).fetchOne();\n\t}", "public UniquelyIdentifiable getObjectFromUID(String s) throws UIDException {\n return null;\r\n }", "public Object getUnique() throws HibException;", "T readOne(int id);", "String getUnidade();", "public static MySingleTon getInstance(){\n if(myObj == null){\n myObj = new MySingleTon();\n }\n return myObj;\n }", "T get(final UniqueId uniqueId) {\n _readLock.lock();\n try {\n return _uniqueIdMap.get(uniqueId);\n } finally {\n _readLock.unlock();\n }\n }", "@Override\r\n\tpublic Invigilate getOne(Integer no) {\n\t\treturn invigilateMapper.selectByPrimaryKey(no);\r\n\t}", "public Jode single() {\n return single(false);\n }", "public Optional<E> one() {\n return Optional.ofNullable(queryOne());\n }", "java.lang.String getUserIdOne();", "public static SingleObject getInstance(){\n return instance;\n }", "public String getEntityOneGUID()\n {\n return entityOneGUID;\n }", "public static Uniqueid getInstance() {\n if (uniqueid == null) {\n uniqueid = new Uniqueid();\n }\n return uniqueid;\n }", "public <T extends Object> T one() throws DBException {\n List values = list();\n return values.size() > 0 ? (T) values.get(0) : null;\n }", "T findOne(Long id);", "private IntentionCriminelle getSingle(List<IntentionCriminelle> intentionCriminelle) {\n if (intentionCriminelle.isEmpty()) {\n return null;\n }\n if (intentionCriminelle.size() > 1) {\n throw new IllegalStateException(\"Error : several ic with same name\");\n }\n return intentionCriminelle.get(0);\n }", "@Override\r\n\tpublic Unit getUnit(String uuid) {\n\r\n\t\treturn unitRepo.getUnit(uuid);\r\n\t}", "@Override\n\tpublic UtenteBase getUtente(String username) {\n\t\tDB db = getDB();\n\t\tMap<Long, UtenteBase> users = db.getTreeMap(\"users\");\n\t\tlong hashCode = (long) username.hashCode();\n\t\tif(users.containsKey(hashCode))\n\t\t\treturn users.get(hashCode);\n\t\telse\n\t\t\treturn null; \n\t}", "String getUid();", "public E queryOne() {\n limit(2);\n List<E> result = queryList();\n if (result.size() != 1) {\n return null;\n } else {\n return result.get(0);\n }\n }", "public T getFirst();", "public T getFirst();", "public static SingleObject getInstance(){\n\t\treturn instance;\n\t}", "@Override\n public CerereDePrietenie findOne(Long aLong) {\n// String SQL = \"SELECT id,id_1,id_2,status,datac\"\n// + \"FROM cereredeprietenie \"\n// + \"WHERE id = ?\";\n//\n// try (Connection conn = connect();\n// PreparedStatement pstmt = conn.prepareStatement(SQL)) {\n//\n// pstmt.setInt(1, Math.toIntExact(aLong));\n// ResultSet rs = pstmt.executeQuery();\n//\n// while(rs.next()) {\n// Long id = rs.getLong(\"id\");\n// Long id_1 = rs.getLong(\"id_1\");\n// Long id_2 = rs.getLong(\"id_2\");\n//\n// String status = rs.getString(\"status\");\n// LocalDateTime data = rs.getObject( 5,LocalDateTime.class);\n//\n// Utilizator u1=repository.findOne(id_1);\n// Utilizator u2=repository.findOne(id_2);\n//\n// CerereDePrietenie u =new CerereDePrietenie(u1,u2);\n// u.setId(id);\n// u.setStatus(status);\n// u.setData(data);\n// return u;\n// }\n//\n//\n// } catch (SQLException ex) {\n// System.out.println(ex.getMessage());\n// }\n//\n// return null;\n List<CerereDePrietenie> list=new ArrayList<>();\n findAll().forEach(list::add);\n for(CerereDePrietenie cerere: list){\n if(cerere.getId() == aLong)\n return cerere;\n }\n return null;\n }", "public String getUniversalId() {\r\n return unid;\r\n }", "public SignUpModel getSingleUser(int id) {\n\t\tSignUpModel data = signUpRepo.findById(id);\n\treturn data;\n\t}", "T get(ID id);", "T getById(ID id);", "public ID getUid() {\n return (ID) get(\"uid\");\n }", "@Override\r\n\tpublic int single() {\n\t\treturn 0;\r\n\t}", "U getCreateby();", "public static SingleObject getInstance()\r\n {\r\n return instance;\r\n }", "public boolean getSingle() {\n checkWidget();\n return single;\n }", "User getOne(long id) throws NotFoundException;", "@Override\n\tpublic Utente get(Long id) throws Exception {\n\t\treturn null;\n\t}", "public Reference individual() {\n return getObject(Reference.class, FhirPropertyNames.PROPERTY_INDIVIDUAL);\n }", "public OidDt getUidElement() { \n\t\tif (myUid == null) {\n\t\t\tmyUid = new OidDt();\n\t\t}\n\t\treturn myUid;\n\t}", "public OidDt getUidElement() { \n\t\tif (myUid == null) {\n\t\t\tmyUid = new OidDt();\n\t\t}\n\t\treturn myUid;\n\t}", "public OidDt getUidElement() { \n\t\tif (myUid == null) {\n\t\t\tmyUid = new OidDt();\n\t\t}\n\t\treturn myUid;\n\t}", "E getById(long id);", "private Trouser getRandomTrouser() {\n String selectQuery = \"SELECT * FROM \" + TrouserEntry.TABLE_NAME + \" ORDER BY RANDOM() LIMIT 1\";\n\n SQLiteDatabase db = this.getReadableDatabase();\n Cursor c = db.rawQuery(selectQuery, null);\n\n // Extract shirt details\n if (c.moveToFirst()) {\n int trouserId = c.getInt((c.getColumnIndex(TrouserEntry._ID)));\n String trouserPath = c.getString(c.getColumnIndex(TrouserEntry.IMG_PATH));\n\n c.close();\n return new Trouser(trouserId, trouserPath);\n } else {\n return null;\n }\n }", "long getUid();", "long getUid();", "@Override\n\tpublic boolean getSingle() {\n\t\treturn force_single;\n\t}", "int getUid();", "int getUid();", "public UUID getUuid();", "public static SingleTon createSingleTonObject() {\r\n\t\tif(ston == null) {\r\n\t\t\tston=new SingleTon();\r\n\t\t}\r\n\t\treturn ston;\r\n\t}", "@Override\n @Transactional(readOnly = true)\n public Optional<OraganizationalUnit> findOne(Long id) {\n log.debug(\"Request to get OraganizationalUnit : {}\", id);\n return oraganizationalUnitRepository.findById(id);\n }", "Identifiable item();", "public OidDt getUid() { \n\t\tif (myUid == null) {\n\t\t\tmyUid = new OidDt();\n\t\t}\n\t\treturn myUid;\n\t}", "public OidDt getUid() { \n\t\tif (myUid == null) {\n\t\t\tmyUid = new OidDt();\n\t\t}\n\t\treturn myUid;\n\t}", "public OidDt getUid() { \n\t\tif (myUid == null) {\n\t\t\tmyUid = new OidDt();\n\t\t}\n\t\treturn myUid;\n\t}", "User get(String name);", "@Override\n\tpublic Translator getOne(UUID id) {\n\t\treturn null;\n\t}", "public UserDoc getUser(String un) {\n\n // accessing registeredUser table (collection)\n MongoCollection<Document> collRU = db.getCollection(\"registeredUser\");\n\n // ----- get document of given username from registeredData -----\n UserDoc doc = new UserDoc();\n\n System.out.println(\"\\nPrint \" + un + \"\\'s data\\n--------------------\\n\");\n FindIterable<Document> docOne = collRU.find(Filters.eq(\"username\", un)); // find document by filters\n MongoCursor<Document> cursor1 = docOne.iterator(); // set up cursor to iterate rows of documents\n try {\n while (cursor1.hasNext()) {\n doc.doc = cursor1.next();\n return doc;\n }\n } finally {\n cursor1.close();\n }\n\n return null;\n }", "Optional<ValueType> getSingle(KeyType key);", "@GetMapping(\"/uoms/{id}\")\n @Timed\n public ResponseEntity<UomDTO> getUom(@PathVariable String id) {\n log.debug(\"REST request to get Uom : {}\", id);\n UomDTO uomDTO = uomService.findOne(id);\n return ResponseUtil.wrapOrNotFound(Optional.ofNullable(uomDTO));\n }", "public Guid getGuid() {\n return localGuid;\n }", "Publication getPubli();", "T getById(int id);", "User getOne(String username) throws NotFoundException;", "public static Pregnancy getOne(Connection conn, String uuid) throws SQLException, ServletException, ObjectNotFoundException {\r\n \tPregnancy item = null;\r\n \tString sql;\r\n \tArrayList values;\r\n \tsql = \"SELECT id, patient_id AS patientId, date_pregnancy_begin AS datePregnancyBegin, \" +\r\n \t\"pregnancy_begin_encounter_id AS pregnancyBeginEncounter, date_pregnancy_end AS datePregnancyEnd, \" +\r\n \t\"last_modified AS lastModified, created AS created, last_modified_by AS lastModifiedBy, \" +\r\n \t\"created_by AS createdBy, site_id AS siteId, created_site_id AS createdSiteId,\" +\r\n \t\"labour_admission_encounter_id AS labourAdmissionEncounterId, date_labour_admission AS dateActiveLabour, \" +\r\n \t\"import_pregnancy_id AS importPregnancyId, uuid, \" +\r\n\t\t\"pregnancy_begin_encounter_uuid AS pregnancyBeginEncounterUuid, pregnancy_end_encounter_id AS pregnancyEndEncounter, \" +\r\n\t\t\"pregnancy_end_encounter_uuid AS pregnancyEndEncounterUuid, \" +\r\n \t\"labour_admission_encounter_uuid AS labourAdmissionEncounterUuid \" +\r\n \t\"FROM pregnancy WHERE uuid=?\";\r\n \tvalues = new ArrayList();\r\n \tvalues.add(uuid);\r\n \titem = (Pregnancy) DatabaseUtils.getZEPRSBean(conn, Pregnancy.class, sql, values);\r\n \treturn item;\r\n }", "public PanneauG obtenirPanneauSud() {\r\n\t\tif (panneauSud != null)\r\n\t\t\treturn panneauSud;\r\n\t\treturn null;\r\n\t}", "User findOneById(long id);", "Reserva Obtener();", "Optional<QnowUser> findOne(Long id);", "@Override\n public Single<Curso> get() {\n return null;\n }", "long getToUid();", "Uom getCurrencyUom();", "User getUser(User user) ;", "public <T extends BaseEntity> T findOne(T entity) {\n T resultEntity = null;\n List<T> results = select(entity);\n if (results != null && !results.isEmpty()) {\n resultEntity = results.get(0);\n }\n return resultEntity;\n }", "@Override\n\tpublic java.lang.String getUuid() {\n\t\treturn _second.getUuid();\n\t}", "public <U extends T> U get();", "public E queryFirst() {\n ValueHolder<E> result = ValueHolder.of(null);\n limit(1);\n doIterate(r -> {\n result.set(r);\n return false;\n });\n\n return result.get();\n }", "public Purse getPurse(){\n return purses.get(0);\n }", "T findOne(I id);", "public IdentifierDt getIdentifierFirstRep() {\n\t\tif (getIdentifier().isEmpty()) {\n\t\t\treturn addIdentifier();\n\t\t}\n\t\treturn getIdentifier().get(0); \n\t}", "public UUID getSoul() {\n return soul;\n }", "T getbyId(I id);", "Livre findOne(Long id);", "T getById(Long id);", "User get(Key id);", "public String getUniversityName(int uniId)\n {\n String universityName = null;\n PreparedStatement ps;\n try {\n if (con != null) {\n String sql = \"SELECT name from university where university.id = (?)\";\n ps = con.prepareStatement(sql);\n ps.setLong(1, uniId);\n\n ResultSet rs = ps.executeQuery();\n if (rs.next()) {\n universityName = rs.getString(1);\n }\n }\n } catch (SQLException sqle) {\n System.out.println(\"Kann mich nicht verbinden\");\n sqle.printStackTrace();\n }\n return universityName;\n }", "User findOne(Long id);", "@Override\n public Lekar findOne(Long id) {\n return lekarRepozitorijum.getOne(id);\n }", "public User getUserFromUname(String u_Name){\n return userDao.getUserFromUsername(u_Name).get(0); \n }", "UUID getUUID();", "public Object searchSingle() {\n \tQuery query = em.createQuery(\"Select e FROM Student e WHERE e.studentId = :id\");\r\n \tquery.setParameter(\"id\", 1);\r\n \tStudent result = (Student)query.getSingleResult();\r\n \t \r\n \t// Query for a single data element.\r\n// \tQuery query = em.createQuery(\"Select MAX(e.grade) FROM Student e\");\r\n// \tBigDecimal result = (BigDecimal)query.getSingleResult();\r\n \t\r\n// \tQuery query = em.createQuery(\"Select e FROM Student e JOIN e.projectList u WHERE u.name = :name\");\r\n// \tquery.setParameter(\"name\", \"student_example\");\r\n// \tStudent result = (Student)query.getSingleResult();\r\n \t\r\n\r\n\r\n \t\r\n \treturn result;\r\n }", "java.lang.String getUid();", "java.lang.String getUid();" ]
[ "0.6575715", "0.6428483", "0.6190924", "0.60813797", "0.59892666", "0.5971465", "0.58886826", "0.58730793", "0.5864574", "0.5810155", "0.5747685", "0.57326275", "0.5720502", "0.5712698", "0.5711781", "0.57073236", "0.5666577", "0.5658766", "0.5601346", "0.55816233", "0.55808145", "0.5577234", "0.55766", "0.55534697", "0.55403715", "0.5514198", "0.55102897", "0.550974", "0.5507981", "0.5504667", "0.5504667", "0.5504487", "0.5504117", "0.5502547", "0.55025154", "0.5500491", "0.5484182", "0.54719156", "0.54637915", "0.5451834", "0.5450984", "0.54417074", "0.5438161", "0.54271483", "0.5426926", "0.5410358", "0.5410358", "0.5410358", "0.54089284", "0.5408289", "0.54056716", "0.54056716", "0.5401455", "0.5398945", "0.5398945", "0.5396969", "0.5394632", "0.5382825", "0.53826606", "0.538177", "0.538177", "0.538177", "0.53786707", "0.5371901", "0.5354174", "0.5353754", "0.53470194", "0.5340133", "0.5337423", "0.53366005", "0.5329911", "0.53249496", "0.5321458", "0.53186136", "0.531559", "0.53154325", "0.53109026", "0.5304555", "0.5303689", "0.530328", "0.5298634", "0.5296117", "0.52860445", "0.52834654", "0.52818793", "0.52805865", "0.5279001", "0.52704686", "0.52702284", "0.52687484", "0.5266189", "0.52650553", "0.52632445", "0.526318", "0.5255312", "0.5253594", "0.52522343", "0.5249826", "0.52478033", "0.52478033" ]
0.581925
9
TODO: Warning this method won't work in the case the id fields are not set
@Override public boolean equals(Object object) { if (!(object instanceof Sucessor)) { return false; } Sucessor other = (Sucessor) object; if ((this.idsucessor == null && other.idsucessor != null) || (this.idsucessor != null && !this.idsucessor.equals(other.idsucessor))) { return false; } return true; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private void setId(Integer id) { this.id = id; }", "private Integer getId() { return this.id; }", "public void setId(int id){ this.id = id; }", "public void setId(Long id) {this.id = id;}", "public void setId(Long id) {this.id = id;}", "public void setID(String idIn) {this.id = idIn;}", "public void setId(int id) { this.id = id; }", "public void setId(int id) { this.id = id; }", "public int getId() { return id; }", "public int getId() { return id; }", "public int getId() { return id; }", "public int getId() { return id; }", "public int getId() { return id; }", "public int getId() { return id; }", "public void setId(long id) { this.id = id; }", "public void setId(long id) { this.id = id; }", "public int getId(){ return id; }", "public int getId() {return id;}", "public int getId() {return Id;}", "public int getId(){return id;}", "public void setId(long id) {\n id_ = id;\n }", "private int getId() {\r\n\t\treturn id;\r\n\t}", "public Integer getId(){return id;}", "public int id() {return id;}", "public long getId(){return this.id;}", "public int getId(){\r\n return this.id;\r\n }", "@Override public String getID() { return id;}", "public Long id() { return this.id; }", "public Integer getId() { return id; }", "@Override\n\tpublic Integer getId() {\n return id;\n }", "@Override\n public Long getId () {\n return id;\n }", "@Override\n public long getId() {\n return id;\n }", "public Long getId() {return id;}", "public Long getId() {return id;}", "public String getId(){return id;}", "@Override\r\n\tpublic Long getId() {\n\t\treturn null;\r\n\t}", "public Integer getId() { return this.id; }", "@Override\r\n public int getId() {\n return id;\r\n }", "@Override\n\t\tpublic long getId() {\n\t\t\treturn 0;\n\t\t}", "public int getId() {\n return id;\n }", "public long getId() { return _id; }", "public int getId() {\n/* 35 */ return this.id;\n/* */ }", "public long getId() { return id; }", "public long getId() { return id; }", "public void setId(Long id) \n {\n this.id = id;\n }", "@Override\n\tpublic Long getId() {\n\t\treturn null;\n\t}", "@Override\n\tpublic Long getId() {\n\t\treturn null;\n\t}", "public void setId(String id) {\n this.id = id;\n }", "@Override\n\tpublic void setId(Long id) {\n\t}", "public Long getId() {\n return id;\n }", "public long getId() { return this.id; }", "public int getId()\n {\n return id;\n }", "public void setId(int id){\r\n this.id = id;\r\n }", "@Test\r\n\tpublic void testSetId() {\r\n\t\tbreaku1.setId(5);\r\n\t\texternu1.setId(6);\r\n\t\tmeetingu1.setId(7);\r\n\t\tteachu1.setId(8);\r\n\r\n\t\tassertEquals(5, breaku1.getId());\r\n\t\tassertEquals(6, externu1.getId());\r\n\t\tassertEquals(7, meetingu1.getId());\r\n\t\tassertEquals(8, teachu1.getId());\r\n\t}", "protected abstract String getId();", "@Override\n\tpublic int getId(){\n\t\treturn id;\n\t}", "public int getID() {return id;}", "public int getID() {return id;}", "public String getId() { return id; }", "public String getId() { return id; }", "public String getId() { return id; }", "public int getId ()\r\n {\r\n return id;\r\n }", "@Override\n public int getField(int id) {\n return 0;\n }", "public void setId(Long id)\n/* */ {\n/* 66 */ this.id = id;\n/* */ }", "public int getId(){\r\n return localId;\r\n }", "void setId(int id) {\n this.id = id;\n }", "@Override\n public Integer getId() {\n return id;\n }", "@Override\n\tpublic Object selectById(Object id) {\n\t\treturn null;\n\t}", "private void clearId() {\n \n id_ = 0;\n }", "private void clearId() {\n \n id_ = 0;\n }", "private void clearId() {\n \n id_ = 0;\n }", "private void clearId() {\n \n id_ = 0;\n }", "private void clearId() {\n \n id_ = 0;\n }", "private void clearId() {\n \n id_ = 0;\n }", "private void clearId() {\n \n id_ = 0;\n }", "@Override\n public int getId() {\n return id;\n }", "@Override\n public int getId() {\n return id;\n }", "public void setId(int id)\n {\n this.id=id;\n }", "@Override\r\n public int getID()\r\n {\r\n\treturn id;\r\n }", "@Override\n\tpublic Integer getId() {\n\t\treturn null;\n\t}", "public int getId()\r\n {\r\n return id;\r\n }", "public void setId(Long id){\n this.id = id;\n }", "@java.lang.Override\n public int getId() {\n return id_;\n }", "@java.lang.Override\n public int getId() {\n return id_;\n }", "private void clearId() {\n \n id_ = 0;\n }", "final protected int getId() {\n\t\treturn id;\n\t}", "public abstract Long getId();", "public void setId(Long id) \r\n {\r\n this.id = id;\r\n }", "@Override\n public long getId() {\n return this.id;\n }", "public String getId(){ return id.get(); }", "@SuppressWarnings ( \"unused\" )\n private void setId ( final Long id ) {\n this.id = id;\n }", "public void setId(long id){\n this.id = id;\n }", "public void setId(long id){\n this.id = id;\n }", "public void setId(Integer id)\r\n/* */ {\r\n/* 122 */ this.id = id;\r\n/* */ }", "public Long getId() \n {\n return id;\n }", "@Override\n\tpublic void setId(int id) {\n\n\t}", "public void test_getId() {\n assertEquals(\"'id' value should be properly retrieved.\", id, instance.getId());\n }", "@Override\r\n\tpublic Object getId() {\n\t\treturn null;\r\n\t}", "public int getID(){\n return id;\n }", "public int getId()\n {\n return id;\n }", "public String getID(){\n return Id;\n }" ]
[ "0.6896886", "0.6838461", "0.67056817", "0.66419715", "0.66419715", "0.6592331", "0.6579151", "0.6579151", "0.6574321", "0.6574321", "0.6574321", "0.6574321", "0.6574321", "0.6574321", "0.65624106", "0.65624106", "0.65441847", "0.65243006", "0.65154546", "0.6487427", "0.6477893", "0.6426692", "0.6418966", "0.6416817", "0.6401561", "0.63664836", "0.63549376", "0.63515353", "0.6347672", "0.6324549", "0.6319196", "0.6301484", "0.62935394", "0.62935394", "0.62832105", "0.62710917", "0.62661785", "0.6265274", "0.6261401", "0.6259253", "0.62559646", "0.6251244", "0.6247282", "0.6247282", "0.6245526", "0.6238957", "0.6238957", "0.6232451", "0.62247443", "0.6220427", "0.6219304", "0.6211484", "0.620991", "0.62023336", "0.62010616", "0.6192621", "0.61895776", "0.61895776", "0.61893976", "0.61893976", "0.61893976", "0.6184292", "0.618331", "0.61754644", "0.6173718", "0.6168409", "0.6166131", "0.6161708", "0.6157667", "0.6157667", "0.6157667", "0.6157667", "0.6157667", "0.6157667", "0.6157667", "0.61556244", "0.61556244", "0.61430943", "0.61340135", "0.6128617", "0.6127841", "0.61065215", "0.61043483", "0.61043483", "0.6103568", "0.61028486", "0.61017346", "0.6101399", "0.6098963", "0.6094214", "0.6094", "0.6093529", "0.6093529", "0.6091623", "0.60896", "0.6076881", "0.60723215", "0.6071593", "0.6070138", "0.6069936", "0.6069529" ]
0.0
-1
Created by PC on 2017/6/19.
public interface BlogService { List<Blog> queryRecentBlogs(); Map<String,Object> queryBlogs(final String blogType,final String title,String pageStr,String limitStr); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private stendhal() {\n\t}", "@Override\n public void perish() {\n \n }", "public final void mo51373a() {\n }", "private static void cajas() {\n\t\t\n\t}", "@Override\n\tpublic void grabar() {\n\t\t\n\t}", "@Override\r\n\tpublic void tires() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void bicar() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void bicar() {\n\t\t\r\n\t}", "public void mo38117a() {\n }", "@Override\n\tpublic void comer() {\n\t\t\n\t}", "public void mo4359a() {\n }", "public Pitonyak_09_02() {\r\n }", "@Override\n\tpublic void create () {\n\n\t}", "@Override\n\tpublic void create() {\n\t\t\n\t}", "@Override\n public void func_104112_b() {\n \n }", "@Override\n\tprotected void getExras() {\n\n\t}", "@Override\r\n\tpublic void comer() \r\n\t{\n\t\t\r\n\t}", "protected MetadataUGWD() {/* intentionally empty block */}", "@Override\n public void memoria() {\n \n }", "@Override\r\n\tpublic void dormir() {\n\t\t\r\n\t}", "private TMCourse() {\n\t}", "public void create() {\n\t\t\n\t}", "Petunia() {\r\n\t\t}", "private Rekenhulp()\n\t{\n\t}", "public void mo6081a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "@Override\n\tpublic void gravarBd() {\n\t\t\n\t}", "@SuppressWarnings(\"unused\")\n private void generateInfo()\n {\n }", "@Override\n\tpublic void entrenar() {\n\t\t\n\t}", "@Override\r\n\tpublic void rozmnozovat() {\n\t}", "@Override\n\tpublic void create() {\n\n\t}", "private void poetries() {\n\n\t}", "@Override\n protected void getExras() {\n }", "@Override\r\n\tpublic void dibujar() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void dibujar() {\n\t\t\r\n\t}", "@Override\n public int describeContents() { return 0; }", "@Override\r\n\t\t\tpublic void annadir() {\n\r\n\t\t\t}", "@Override\r\n\tpublic void create() {\n\t\t\r\n\t}", "public void mo55254a() {\n }", "@Override\r\n\tpublic void create() {\n\r\n\t}", "@Override\n public void inizializza() {\n\n super.inizializza();\n }", "private void m50366E() {\n }", "public void mo12930a() {\n }", "@Override\n\tpublic void anular() {\n\n\t}", "private ReportGenerationUtil() {\n\t\t\n\t}", "private MetallicityUtils() {\n\t\t\n\t}", "@Override\n public void init() {\n\n }", "private void init() {\n\n\t}", "private UsineJoueur() {}", "protected void mo6255a() {\n }", "@Override\n protected void initialize() {\n\n \n }", "public void gored() {\n\t\t\n\t}", "public void mo21877s() {\n }", "@Override\r\n\tpublic void anularFact() {\n\t\t\r\n\t}", "Constructor() {\r\n\t\t \r\n\t }", "private void kk12() {\n\n\t}", "@Override\n protected void initialize() \n {\n \n }", "@Override\r\n\t\t\tpublic void ayuda() {\n\r\n\t\t\t}", "@Override\n protected void initialize() {\n }", "@Override\n protected void initialize() {\n }", "@Override\n protected void initialize() {\n }", "@Override\n protected void initialize() {\n }", "@Override\n protected void initialize() {\n }", "@Override\n protected void initialize() {\n }", "@Override\n\tpublic void nadar() {\n\t\t\n\t}", "@Override\n\tpublic void sacrifier() {\n\t\t\n\t}", "@SuppressWarnings(\"unused\")\n\tprivate void version() {\n\n\t}", "@Override\n\tprotected void interr() {\n\t}", "@Override\n void init() {\n }", "@Override\r\n\t\tpublic void init() {\n\t\t\t\r\n\t\t}", "@Override\r\n\tpublic void publierEnchere() {\n\t\t\r\n\t}", "public final void mo91715d() {\n }", "@Override\n public void init() {\n }", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "public void mo12628c() {\n }", "private Platform() {\n\t\t\n\t}", "public void mo21779D() {\n }", "private Singletion3() {}", "public void mo3376r() {\n }", "public void mo9848a() {\n }", "public void mo21878t() {\n }", "public void designBasement() {\n\t\t\r\n\t}", "private MApi() {}", "protected boolean func_70814_o() { return true; }", "public void mo1531a() {\n }", "@Override\n\tprotected void initialize() {\n\t\t\n\t}", "@Override\n\tprotected void initialize() {\n\t\t\n\t}", "private final zzgy zzgb() {\n }", "zzang mo29839S() throws RemoteException;", "private void init() {\n\n\n\n }", "public void mo21785J() {\n }" ]
[ "0.61050093", "0.60063565", "0.5844682", "0.5805753", "0.57926714", "0.57793975", "0.57273006", "0.57273006", "0.57096153", "0.5681316", "0.56770754", "0.5666835", "0.5651114", "0.5643596", "0.56272364", "0.5619586", "0.56175923", "0.56138885", "0.5603158", "0.560202", "0.5594166", "0.5591425", "0.5587195", "0.55810124", "0.55801064", "0.5568039", "0.5568039", "0.5568039", "0.5568039", "0.5568039", "0.5568039", "0.5568039", "0.55673337", "0.5523106", "0.55141973", "0.55103445", "0.55049443", "0.54903984", "0.5460034", "0.54587597", "0.54587597", "0.54558814", "0.54461426", "0.5441849", "0.543729", "0.54350543", "0.5429343", "0.5417361", "0.5411878", "0.54067355", "0.54041946", "0.53960884", "0.5393887", "0.5391924", "0.5388642", "0.538763", "0.53862065", "0.53814346", "0.53802353", "0.5377927", "0.537553", "0.5366743", "0.5361187", "0.5358401", "0.53564084", "0.53564084", "0.53564084", "0.53564084", "0.53564084", "0.53564084", "0.53555095", "0.53477293", "0.5344904", "0.53367966", "0.53270745", "0.53236187", "0.53208303", "0.5319594", "0.5307666", "0.5302476", "0.5302476", "0.5302476", "0.5302476", "0.5302476", "0.5302349", "0.5291489", "0.5288213", "0.5285562", "0.5284261", "0.52827585", "0.5281461", "0.5279236", "0.527298", "0.52708435", "0.5267287", "0.5267059", "0.5267059", "0.52666384", "0.5264523", "0.5256723", "0.52564615" ]
0.0
-1