query
stringlengths
7
33.1k
document
stringlengths
7
335k
metadata
dict
negatives
sequencelengths
3
101
negative_scores
sequencelengths
3
101
document_score
stringlengths
3
10
document_rank
stringclasses
102 values
File METHODS method to get all files from a particular folder path
public File[] getAllFiles(String sFolderPath) { File[] files = null; ArrayList<File> altemp = new ArrayList<File>(); try { File folder = new File(sFolderPath); files = folder.listFiles(); for (int i = 0; i < files.length; i++) { if (files[i].isFile()) { altemp.add(files[i]); } } files = null; files = altemp.toArray(new File[altemp.size()]); } catch (Exception e) { files = null; } finally { return files; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "List<Path> getFiles();", "File[] getFilesInFolder(String path) {\n return new File(path).listFiles();\n }", "public static void getAllFiles()\n\t{\n\t\t//Getting the File Name\n\n\t\tList<String> fileNames = FileManager.getAllFiles(folderpath);\n\t\n\t\tfor(String f:fileNames)\n\t\tSystem.out.println(f);\n\t\n\t}", "List<String> getFiles(String path) throws IOException;", "public abstract List<LocalFile> getAllFiles();", "static Stream<File> allFilesIn(File folder) \r\n\t{\r\n\t\tFile[] children = folder.listFiles();\r\n\t\tStream<File> descendants = Arrays.stream(children).filter(File::isDirectory).flatMap(Program::allFilesIn);\r\n\t\treturn Stream.concat(descendants, Arrays.stream(children).filter(File::isFile));\r\n\t}", "public List listFiles(String path);", "private File[] getResourceFolderFiles(String folder) {\n\t\tClassLoader loader = Thread.currentThread().getContextClassLoader();\n\t\tURL url = loader.getResource(folder);\n\t\tString path = url.getPath();\n\n\t\treturn new File(path).listFiles();\n\n\t}", "public File[] getFiles(File folder) {\n\t\treturn folder.listFiles();\n\t}", "private List<String> getFiles(String path){\n workDir = Environment.getExternalStorageDirectory().getAbsolutePath() + path;\n List<String> files = new ArrayList<String>();\n File file = new File(workDir);\n File[] fs = file.listFiles();\n for(File f:fs)\n if (f.isFile())\n files.add(String.valueOf(f).substring(workDir.length()));\n return files;\n }", "public List<File> getFiles();", "public List<File> getFiles(String dir)\r\n\t{\r\n\t\tList<File> result = null;\r\n\t\tFile folder = new File(dir);\r\n\t\tif (folder.exists() && folder.isDirectory())\r\n\t\t{\r\n\t\t\tFile[] listOfFiles = folder.listFiles(); \r\n\t\t\t \r\n\t\t\tresult = new ArrayList<File>();\r\n\t\t\tfor (File file : listOfFiles)\r\n\t\t\t{\r\n\t\t\t\tif (file.isFile())\r\n\t\t\t\t\tresult.add(file);\r\n\t\t\t}\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\tlogger.error(\"check to make sure that \" + dir + \" exists and you have permission to read its contents\");\r\n\t\t}\r\n\t\t\r\n\t\treturn result;\r\n\t}", "AntiIterator<FsPath> listFilesAndDirectories(FsPath dir);", "public static List<String> getFiles(String path) {\n\t try {\n\t\t\tURI uri = getResource(path).toURI();\n\t\t String absPath = getResource(\"..\").getPath();\n\t\t\tPath myPath;\n\t\t\tif (uri.getScheme().equals(\"jar\")) {\n\t\t\t FileSystem fileSystem = FileSystems.newFileSystem(uri, Collections.<String, Object>emptyMap());\n\t\t\t myPath = fileSystem.getPath(path);\n\t\t\t \n\t\t\t} else {\n\t\t\t myPath = Paths.get(uri);\n\t\t\t}\n\t\t\t\n\t\t\t List<String> l = Files.walk(myPath)\t\n\t\t\t \t\t\t\t\t .map(filePath -> pathAbs2Rel(absPath, filePath))\n\t\t\t \t .collect(Collectors.toList());\n\t\t\t return l;\n\t\t} catch (URISyntaxException | IOException e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t return null;\n\t \n\t}", "private File[] getFilesInDirectory() {\n\t\t//Show Directory Dialog\n\t\tDirectoryChooser dc = new DirectoryChooser();\n\t\tdc.setTitle(\"Select Menu File Directory\");\n\t\tString folderPath = dc.showDialog(menuItemImport.getParentPopup().getScene().getWindow()).toString();\n\t\t\n\t\t//Update Folder location text\n\t\ttxtFolderLocation.setText(\"Import Folder: \" + folderPath);\n\t\t//Now return a list of all the files in the directory\n\t\tFile targetFolder = new File(folderPath);\n\t\t\n\t\treturn targetFolder.listFiles(); //TODO: This returns the names of ALL files in a dir, including subfolders\n\t}", "List<String> getFiles(String path, String searchPattern) throws IOException;", "private static List<File> listChildFiles(File dir) throws IOException {\n\t\t List<File> allFiles = new ArrayList<File>();\n\t\t \n\t\t File[] childFiles = dir.listFiles();\n\t\t for (File file : childFiles) {\n\t\t if (file.isFile()) {\n\t\t allFiles.add(file);\n\t\t } else {\n\t\t List<File> files = listChildFiles(file);\n\t\t allFiles.addAll(files);\n\t\t }\n\t\t }\n\t\t return allFiles;\n\t\t }", "protected File[] getFiles() {\r\n DirectoryScanner scanner = new DirectoryScanner(rootDir,true,\"*.xml\");\r\n List<File> files = scanner.list();\r\n return files.toArray(new File[files.size()]);\r\n }", "public abstract List<String> getFiles( );", "public static File[] getFilesInDirectory(String path) {\n File f = new File(path);\n File[] file = f.listFiles();\n return file;\n }", "public static void listOfFiles(File dirPath){\n\t\tFile filesList[] = dirPath.listFiles();\r\n \r\n\t\t// For loop on each item in array \r\n for(File file : filesList) {\r\n if(file.isFile()) {\r\n System.out.println(file.getName());\r\n } else {\r\n \t // Run the method on each nested folder\r\n \t listOfFiles(file);\r\n }\r\n }\r\n }", "List<File> list(String directory) throws FindException;", "private static File[] filesMiner(String path) {\n try {\n File directoryPath = new File(path);\n FileFilter onlyFile = new FileFilter() {\n @Override\n public boolean accept(File pathname) {\n return pathname.isFile();\n }\n }; // filter directories\n return directoryPath.listFiles(onlyFile);\n } catch (Exception e) {\n System.err.println(UNKNOWN_ERROR_WHILE_ACCESSING_FILES);\n return null;\n }\n\n }", "public List<String> getFiles();", "public void getImagesFromFolder() {\n File file = new File(Environment.getExternalStorageDirectory().toString() + \"/saveclick\");\n if (file.isDirectory()) {\n fileList = file.listFiles();\n for (int i = 0; i < fileList.length; i++) {\n files.add(fileList[i].getAbsolutePath());\n Log.i(\"listVideos\", \"file\" + fileList[0]);\n }\n }\n }", "public void listFiles(String path) {\r\n String files;\r\n File folder = new File(path);\r\n File[] listOfFiles = folder.listFiles();\r\n\r\n for (int i = 0; i < listOfFiles.length; i++) {\r\n\r\n if (listOfFiles[i].isFile()) {\r\n files = listOfFiles[i].getName();\r\n if (files.endsWith(\".png\") || files.endsWith(\".PNG\")\r\n || files.endsWith(\".gif\") || files.endsWith(\".GIF\")) {\r\n //System.out.println(files);\r\n pathList.add(path+\"\\\\\");\r\n fileList.add(files);\r\n }\r\n }\r\n \r\n else {\r\n listFiles(path+\"\\\\\"+listOfFiles[i].getName());\r\n }\r\n }\r\n }", "List<String> getFiles(String path, String searchPattern, String searchOption) throws IOException;", "@GetMapping(\"/files\")\n public ResponseEntity<List<FileInfo>> getListFiles() {\n List<FileInfo> fileInfos = storageService.loadAll().map(path -> {\n String filename = path.getFileName().toString();\n String url = MvcUriComponentsBuilder\n .fromMethodName(FilesController.class, \"getFile\", path.getFileName().toString()).build().toString();\n\n return new FileInfo(filename, url);\n }).collect(Collectors.toList());\n\n return ResponseEntity.status(HttpStatus.OK).body(fileInfos);\n }", "@GetMapping(\"/all\")\r\n\tpublic List<FileModel> getListFiles() {\r\n\t\treturn fileRepository.findAll();\r\n\t}", "private ArrayList<String> listFilesForFolder(File folder, TaskListener listener) {\n \tArrayList<String> lista = new ArrayList<String>();\n \tif(folder.exists()){\n\t \tFile[] listOfFiles = folder.listFiles();\n\t\t\t if(listOfFiles != null){\t\n\t\t\t\tfor (File file : listOfFiles) {\n\t\t\t\t\t if (file.isDirectory()) {\t\n\t\t\t\t \tlista.add(file.getName());\n\t\t\t\t }\n\t\t\t\t}\n\t\t\t }\n\t\t}\n\t\treturn lista;\n\t}", "public static List<String> getFilesFromDirectory(){\n File wordTextFolder = new File(FOLDER_OF_TEXT_FILES.toString());\n File[] filesInsideFolder = wordTextFolder.listFiles();\n List<String> paths = new ArrayList<>();\n String name;\n\n for (File txtFile : filesInsideFolder){\n paths.add( txtFile.getPath() );\n name = txtFile.getName();\n name = name.substring(0, name.lastIndexOf('.'));\n\n if(name.length() > Table.maxFileNameLength){\n Table.setMaxFileNameLength(name.length());\n }\n }\n return paths;\n }", "public static List<String> getFile(String path){\n File file = new File(path);\n // get the folder list\n File[] array = file.listFiles();\n\n List<String> fileName = new ArrayList<>();\n\n for(int i=0;i<array.length;i++){\n if(array[i].isFile()){\n // only take file name\n fileName.add(array[i].getName());\n }else if(array[i].isDirectory()){\n getFile(array[i].getPath());\n }\n }\n return fileName;\n }", "@Test\n public void listFilesTest() throws ApiException {\n Integer devid = null;\n String path = null;\n List<FileOnDevice> response = api.listFiles(devid, path);\n\n // TODO: test validations\n }", "void getFilesInfoInFolder(String pathToFolder) {\n File[] listOfFiles = getFilesInFolder(pathToFolder);\n for (int i = 0; i < listOfFiles.length; i++) {\n if (listOfFiles[i].isFile()) {\n System.out.println(\"File \" + listOfFiles[i].getName());\n continue;\n }\n\n if (listOfFiles[i].isDirectory()) {\n System.out.println(\"Directory \" + listOfFiles[i].getName());\n }\n }\n }", "public ScanResult getFilesRecursively() {\n\n final ScanResult scanResult = new ScanResult();\n try {\n Files.walkFileTree(this.basePath, new SimpleFileVisitor<Path>() {\n @Override\n public FileVisitResult visitFile(Path file, BasicFileAttributes attrs) throws IOException {\n if (!attrs.isDirectory() && PICTURE_MATCHER.accept(file.toFile())) {\n scanResult.addEntry(convert(file));\n System.out.println(file.toFile());\n }\n return FileVisitResult.CONTINUE;\n }\n });\n } catch (IOException e) {\n // intentional fallthrough\n }\n\n return new ScanResult();\n }", "private List<DMTFile> listFilesRecursive(String path) {\n\t\tList<DMTFile> list = new ArrayList<DMTFile>();\n\t\tDMTFile file = getFile(path); //Get the real file\n\t\t\n\t\tif (null != file ){ //It checks if the file exists\n\t\t\tif (! file.isDirectory()){\n\t\t\t\tlist.add(file);\n\t\t\t} else {\n\t\t\t\tDMTFile[] files = listFilesWithoutConsoleMessage(file.getPath());\n\t\t\t\tfor (int x = 0; x < files.length; x++) {\n\t\t\t\t\tDMTFile childFile = files[x];\t\t \n\t\t\t\t\tif (childFile.isDirectory()){\n\t\t\t\t\t\tlist.addAll(listFilesRecursive(childFile.getPath()));\t\t\t\t\t\n\t\t\t\t\t} else {\n\t\t\t\t\t\tlist.add(childFile);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn list;\n\t}", "protected abstract HashMap<String, InputStream> getFilesByPath(\n\t\t\tfinal String path);", "private File[] getFiles() {\n\n if (mPPTFilePath == null) {\n mPPTFilePath = getArguments().getString(PPTPathString);\n }\n\n String Path = mPPTFilePath;\n File mFile = new File(Path);\n if (mFile.exists() && mFile.isDirectory() && mFile.listFiles()!=null) {\n\n return mFile.listFiles();\n } else {\n Log.d(TAG, \"File==null\");\n return null;\n }\n }", "private List<String> returnFiles(int selection) {\n\t\tString path = System.getProperty(\"user.dir\");\n\t\tList<String> allImages = new ArrayList<String>();\n\t\tpath += this.setFolderPath(selection);\n\t\tFile[] files = new File(path).listFiles();\n\n\t\tfor (File file : files) {\n\t\t\tif (file.isFile() && isCorrectFile(file)) {\n\t\t\t\tallImages.add(file.getAbsolutePath());\n\t\t\t}\n\t\t}\n\t\treturn allImages;\n\t}", "@Override\n\tpublic List<File> getAll() {\n\t\t return getSession().\n\t createQuery(\"from File f\", File.class).\n\t getResultList();\n\t}", "private static ArrayList<File> getFilesFromSubfolders(String directoryName, ArrayList<File> files) {\n\n File directory = new File(directoryName);\n\n // get all the files from a directory\n File[] fList = directory.listFiles();\n for (File file : fList) {\n if (file.isFile() && file.getName().endsWith(\".json\")) {\n files.add(file);\n } else if (file.isDirectory()) {\n getFilesFromSubfolders(file.getAbsolutePath(), files);\n }\n }\n return files;\n }", "public static List<String> getAllFiles(String dirPath) {\n\n\t\tList<String> files = new ArrayList<>();\n\t\tFile folder = new File(dirPath);\n\t\tFile[] listOfFiles = folder.listFiles();\n\n\t\tfor (int i = 0; i < listOfFiles.length; i++) {\n\t\t\tFile file = listOfFiles[i];\n\t\t\tString filePath = file.getPath();\n\t\t\tif (file.isFile()) {\n\n\t\t\t\tif (!file.isHidden() && !file.getName().startsWith(\"_\"))\n\t\t\t\t\tfiles.add(filePath);\n\t\t\t} else if (file.isDirectory()) {\n\n\t\t\t\tfiles.addAll(getAllFiles(filePath));\n\t\t\t}\n\t\t}\n\n\t\treturn files;\n\t}", "public List<Path> getAllPaths();", "public ArrayList<String> getDirFiles(String filePath){\n ArrayList<String> results = new ArrayList<String>();\n File[] files = new File(filePath).listFiles();\n\n for (File file : files){\n if (file.isFile()) {\n results.add(file.getName());\n }\n }\n return results;\n }", "public List<String> listFilesForFolder(File folder) {\n\t\tList<String> fileList= new ArrayList<String>();\n\t for (final File fileEntry : folder.listFiles()) {\n\t if (fileEntry.isDirectory()) {\n\t listFilesForFolder(fileEntry);\n\t } else {\n\t \tfileList.add(fileEntry.getName());\n\t }\n\t }\n\t return fileList;\n\t}", "private static void getFile(String path){\n File file = new File(path); \r\n // get the folder list \r\n File[] array = file.listFiles();\r\n // flag = array.length;\r\n \r\n for(int i=0;i<array.length;i++){ \r\n if(array[i].isFile()){ \r\n // only take file name \r\n //System.out.println(\"^^^^^\" + array[i].getName()); \r\n // take file path and name \r\n //System.out.println(\"#####\" + array[i]); \r\n // take file path and name \r\n System.out.println(\"*****\" + array[i].getPath()); \r\n\t\t\tcalculate_Ave(array[i].getPath());\r\n } \r\n }\r\n}", "public static void goThroughFilesForFolder(final File folder) throws Exception {\r\n\r\n\t\t/*\r\n\t\t * char[] filePath;\r\n\t\t// *Files.walk(Paths.get(\"E:/Studying/eclipse/workspace/Thesis/PMIDs\")).\r\n\t\t * Files.walk(Paths.get(\"E:/Studying/Box Sync/workspace/Thesis/PMIDs\")).\r\n\t\t * forEach(filePath -> { if (Files.isRegularFile(filePath)) {\r\n\t\t * System.out.println(filePath); } }\r\n\t\t */\r\n\t\t// /*\r\n\t\tfor (final File fileEntry : folder.listFiles()) {\r\n\t\t\tif (fileEntry.isDirectory()) {\r\n\t\t\t\tgoThroughFilesForFolder(fileEntry);\r\n\t\t\t} else {\r\n\t\t\t\tprocessFile(fileEntry);\r\n\t\t\t\t// System.out.println(fileEntry.getName());\r\n\t\t\t}\r\n\t\t}\r\n\t\t// */\r\n\t}", "public static File[] getFiles() /*throws IOException*/ {\n\n String os = (System.getProperty(\"os.name\")).toUpperCase();\n File path;\n if (os.contains(\"WIN\")) {\n path = new File(System.getenv(\"APPDATA\")+\"\\\\SudokuGR04\");\n }\n else\n {\n path = new File(System.getProperty(\"user.home\" + \"/Library/Application Support/SudokuGR04\" ));\n }\n\n FileFilter fileFilter = dir -> {\n return dir.isFile();\n };\n //in the files-array there is a list of all files in the dir\n files = path.listFiles(fileFilter);\n return files;\n }", "public List<File> findAll() {\n\t\treturn files;\n\t}", "public static ArrayList<String> listFilesInFolder(String pFolderPath) {\n return listFilesInFolder(pFolderPath, false, null);\n }", "void listingFiles(String remoteFolder);", "public Stream<Path> loadAll() {\n\t\ttry\n\t\t{\n\t\t\tSystem.out.println(\"File Retrived\");\n\t\t\treturn Files.walk(this.path, 1).filter(path->!path.equals(this.path)).map(this.path::relativize);\n\t\t}catch(Exception e)\n\t\t{\n\t\t\te.printStackTrace();\n\t\t\tSystem.out.println(\"File Retrived Error\");\n\t\t}\n\t\treturn null;\n\t}", "public static File[] readFileFolder(String filepath) throws FileNotFoundException, IOException {\n File file = new File(filepath);\n if (file.isDirectory()) {\n File[] filelist = file.listFiles();\n return filelist;\n }\n \n return null;\n }", "public File[] getFiles(String mkey) {\n\t\tFile last;\n\t\tint i = 0;\n\t\tArrayList<File> v = new ArrayList<>();\n\t\twhile (true) {\n\t\t\tlast = getFile(mkey + i);\n\t\t\ti++;\n\t\t\tif (last == null)\n\t\t\t\tbreak;\n\t\t\tv.add(last);\n\t\t}\n\t\tif (v.size() != 0) {\n\t\t\tFile[] path = new File[v.size()];\n\t\t\treturn v.toArray(path);\n\t\t} else {\n\t\t\treturn (File[]) getDefault(mkey);\n\t\t}\n\t}", "public Files files();", "private List<String> scoutForFiles(FileType fileType, Path path) {\n\t\tfinal List<String> filesFound = new ArrayList<>();\n\n\t\t// Create a stream of Paths for the contents of the directory\n\t\ttry (Stream<Path> walk = Files.walk(path)) {\n\n\t\t\t// Filter the stream to find only Paths that match the filetype we are looking\n\t\t\tfilesFound.addAll(walk.map(x -> x.toString())\n\t\t\t\t.filter(f -> f.endsWith(fileType.suffix)).collect(Collectors.toList()));\n\t\t} catch (IOException e) {\n\t\t\tthrow new MessagePassableException(EventKey.ERROR_EXTERNAL_DIR_NOT_READABLE, e, path.toString());\n\t\t}\n\n\t\treturn filesFound;\n\t}", "@Override\n public List<GEMFile> getLocalFiles(String directory) {\n File dir = new File(directory);\n List<GEMFile> resultList = Lists.newArrayList();\n File[] fList = dir.listFiles();\n if (fList != null) {\n for (File file : fList) {\n if (file.isFile()) {\n resultList.add(new GEMFile(file.getName(), file.getParent()));\n } else {\n resultList.addAll(getLocalFiles(file.getAbsolutePath()));\n }\n }\n gemFileState.put(STATE_SYNC_DIRECTORY, directory);\n }\n return resultList;\n }", "public void getFiles()\n\t{\n\t\tif(fileList.size() == 0)\n\t\t{\n\t\t\tSystem.out.println(\"There is no file or file not found\");\n\t\t}\n\t\tfor(int i = 0; i < fileList.size(); i++)\n\t\t{\n\t\t\tSystem.out.println(\"File is at: \" + fileList.get(i));\n\t\t}\n\t}", "private List<File> getFileList(File root){\n\t List<File> returnable = new ArrayList<File>();\n\t if(root.exists()){\n\t\t for(File currentSubFile : root.listFiles()){\n\t\t\t if(currentSubFile.isDirectory()){\n\t\t\t\t returnable.addAll(getFileList(currentSubFile));\n\t\t\t } else {\n\t\t\t\t returnable.add(currentSubFile);\n\t\t\t }\n\t\t }\n\t }\n\t return returnable;\n }", "private ArrayList<File> getFilesInDirectory(String directoryPath, boolean omitHiddenFiles) {\n //---------- get all files in the provided directory ----------\n ArrayList<File> filesInFolder = new ArrayList<>();\n\n File folder = new File(directoryPath);\n for (File f : folder.listFiles()) {\n if (!f.isHidden() || !omitHiddenFiles)\n filesInFolder.add(f);\n }\n\n //sort the list of files\n Collections.sort(filesInFolder);\n return filesInFolder;\n }", "public List<FileManagerFile> getFiles() throws Exception {\n\n if (files == null) { // defer loading files list until requested.\n cacheFoldersFiles();\n }\n return files;\n }", "private static String[] getAllFiles(File directory, String extension) {\n // TODO: extension has to be .txt, .doc or .docx\n File[] files = directory.listFiles(File::isFile);\n String[] filepaths = new String[files.length];\n String regex = \"^.*\" + extension + \"$\";\n for (int i = 0; i < filepaths.length; i++) {\n if (files[i].getPath().matches(regex)) {\n filepaths[i] = files[i].getPath();\n }\n }\n writeOutput(\"The folder \" + directory + \" contains \" + filepaths.length + \" \" + extension + \" file(s).\" + \"\\n\");\n return filepaths;\n }", "private List<Path> listSourceFiles(Path dir) throws IOException {\n\t\tList<Path> result = new ArrayList<>();\n\t\ttry (DirectoryStream<Path> stream = Files.newDirectoryStream(dir, \"*.json\")) {\n\t\t\tfor (Path entry: stream) {\n\t\t\t\tresult.add(entry);\n\t\t\t}\n\t\t} catch (DirectoryIteratorException ex) {\n\t\t\t// I/O error encounted during the iteration, the cause is an IOException\n\t\t\tthrow ex.getCause();\n\t\t}\n\t\treturn result;\n\t}", "public static List<CMSFile> getFolderChildren(String path){\n return CMSFile.find(\"name NOT LIKE '\" + path + \"%/%' and name like '\" + path + \"%'\").fetch();\n }", "public File[] listFiles() {\n\n\t\tFileFilter Ff = f -> true;\n\t\treturn this.listFiles(Ff);\n\t}", "public ArrayList<String> getFiles() {\n\n\t\tif (m_db == null)\n\t\t\treturn new ArrayList<String>();\n\n\t\t//\n\t\t// query database\n\t\t//\n\t\tCursor cursor = m_db.query(FILE_TABLE_NAME,\n\t\t\t\tnew String[] { FILE_FIELD_PATH }, null, null, null, null, null);\n\n\t\t//\n\t\t// construct array list\n\t\t//\n\t\tArrayList<String> list = new ArrayList<String>();\n\n\t\t//\n\t\t// collect result set\n\t\t//\n\t\tcollectResultSet(cursor, list);\n\n\t\t//\n\t\t// close cursor\n\t\t//\n\t\tcursor.close();\n\n\t\t//\n\t\t// done\n\t\t//\n\t\treturn list;\n\t}", "public abstract List<File> listFiles() throws AccessException;", "public File[] showFiles(String filePath) throws FileNotFoundException {\r\n File folder = new File(filePath);\r\n File[] listOfFiles = folder.listFiles();\r\n if (listOfFiles == null) {\r\n throw new FileNotFoundException(\"No files found in directory\");\r\n }\r\n for (int i = 0; i < listOfFiles.length; i++) {\r\n if (listOfFiles[i].isFile()) {\r\n System.out.println(\"(\"+i+\") \" + listOfFiles[i].getName());\r\n }\r\n }\r\n return listOfFiles;\r\n }", "private void readFiles(final File folder, final List<File> fileList) {\n\t\tfor (final File fileEntry : folder.listFiles()) {\n\t\t\tif (fileEntry.isDirectory()) {\n\t\t\t\treadFiles(fileEntry, fileList);\n\t\t\t} else {\n\t\t\t\tfileList.add(fileEntry);\n\t\t\t}\n\t\t}\n\t}", "private List<File> getContents(String whichFiles) {\n List<File> result = new ArrayList<File>();\n Files f1 = mService.files();\n Files.List request = null;\n\n do {\n try { \n request = f1.list();\n // get the language folders from drive\n request.setQ(whichFiles);\n FileList fileList = request.execute();\n \n result.addAll(fileList.getItems());\n request.setPageToken(fileList.getNextPageToken());\n } catch (UserRecoverableAuthIOException e) {\n startActivityForResult(e.getIntent(), REQUEST_AUTHORIZATION);\n } catch (IOException e) {\n e.printStackTrace();\n if (request != null) \n request.setPageToken(null);\n }\n } while ((request.getPageToken() != null) \n && (request.getPageToken().length() > 0));\n \n return result;\n }", "private static List<String> loadDocuments(String path) throws Exception {\n\t\tFile folder = new File(path);\n\t\tArrayList<String> documents = new ArrayList<String>();\n\t\tfor (final File fileEntry : folder.listFiles()) {\n\t\t\tSystem.out.println(fileEntry.getName());\n\t\t\tif (fileEntry.isFile() && !fileEntry.isHidden()) {\n\t\t\t\tString content = getTextFromHtml(fileEntry);\n\t\t\t\tdocuments.add(content);\n\t\t\t}\n\t\t}\n\t\treturn documents;\n\t}", "static void viewFiles()\r\n\t {\n\t\t File directoryPath = new File(\"D:\\\\java_project\");\r\n\t File filesList[] = directoryPath.listFiles();\r\n System.out.println(\"List of files and directories in the specified directory:\");\r\n\t for(File file : filesList) \r\n\t {\r\n\t System.out.println(\"File name: \"+file.getName());\r\n\t System.out.println(\"File path: \"+file.getAbsolutePath());\r\n\t System.out.println(\"Size :\"+file.getTotalSpace());\r\n\t System.out.println(\"last time file is modified :\"+new Date(file.lastModified()));\r\n System.out.println(\" \");\r\n\t }\r\n }", "private static ArrayList<String> getImagesInFileSystem() {\n\t\t// get file list in database\n\t\tArrayList<String> fileNameList = new ArrayList<String>();\n\t\t\n\t\tFile folder = new File(IMAGE_DIRECTORY);\n\t File[] listOfFiles = folder.listFiles();\n\t \n\t for (File currFile : listOfFiles) {\n\t if (currFile.isFile() && !currFile.getName().startsWith(\".\")) {\n\t \t fileNameList.add(currFile.getName());\n\t }\n\t }\n\t \n\t return fileNameList;\n\t}", "public ArrayList<FileDesc> getAllFiles() {\n\n\t\tArrayList<FileDesc> result = new ArrayList<FileDesc>();\n\n\t\ttry {\n\t\t\tjava.sql.PreparedStatement ps = ((org.inria.jdbc.Connection) db).prepareStatement(TCell_QEP_IDs.QEP.EP_getAllFiles);\n\t\t\tResultSet rs = ps.executeQuery();\n\t\t\t\n\t\t\tString query = \"SELECT FILEGID, TYPE, DESCRIPTION FROM FILE\";\n\t\t\tSystem.out.println(\"Executing query : \" + query);\t\t\t\n\n\t\t\t\n\t\t\twhile (rs.next() == true) {\n\t\t\t\tString fileGID = rs.getString(1);\n\t\t\t\tString type = rs.getString(2);\n\t\t\t\tString Description = rs.getString(3);\n\t\t\t\tresult.add(new FileDesc(fileGID, \"\", \"\", \"\", type, Description));\n\t\t\t}\n\t\t} catch (Exception e) {\n\t\t\te.printStackTrace();\n\t\t} finally {\n\t\t\t// Uncomment when the close function will be implemented\n\t\t\t// attemptToClose(ps);\n\t\t\t\n\t\t}\n\n\t\treturn result;\n\t}", "private static String files()\n\t{\n\t\tString path = dirpath + \"\\\\Server\\\\\";\n\t\tFile folder = new File(path);\n\t\tFile[] listOfFiles = folder.listFiles();\n\t\tString msg1 = \"\";\n\n\t\tfor (int i = 0; i < listOfFiles.length; i++)\n\t\t{\n\t\t\tif (listOfFiles[i].isFile())\n\t\t\t{\n\t\t\t\tmsg1 = msg1 + \"&\" + listOfFiles[i].getName();\n\t\t\t}\n\t\t}\n\t\tmsg1 = msg1 + \"#\" + path + \"\\\\\";\n\t\treturn msg1;\n\t}", "public static ArrayList<String> listFilesInFolder(String pFolderPath, boolean pIncludeSubfolders,\n String pExtension) {\n ArrayList<String> list = new ArrayList<String>();\n\n /*\n * depth = 0 -> only the specified file/folder is returned. To get all\n * files inside a folder, depth must be set to 1.\n */\n int depth = 1;\n if (pIncludeSubfolders) {\n depth = Integer.MAX_VALUE;\n }\n\n String matcherString = \"glob:**\";\n if (!ObjectUtils.isObjectEmpty(pExtension)) {\n matcherString += \".\" + pExtension;\n }\n PathMatcher matcher = FileSystems.getDefault().getPathMatcher(matcherString);\n\n try (Stream<Path> paths = Files.walk(Paths.get(pFolderPath), depth)) {\n // paths.filter(Files::isRegularFile).filter(path ->\n // matcher.matches(path))\n // .forEach(path ->\n // System.out.println(path.normalize().toString()));\n paths.filter(Files::isRegularFile).filter(path -> matcher.matches(path))\n .forEach(path -> list.add(path.normalize().toString()));\n } catch (IOException e) {\n LogUtils.logError(DirectoryUtils.class, \"IOException while listing files in folder [\" + pFolderPath + \"]\",\n e);\n }\n\n return list;\n }", "public List getAll() throws FileNotFoundException, IOException;", "@Test\n public void filesGetTest() throws ApiException {\n Integer limit = null;\n Integer offset = null;\n List<FileInfo> response = api.filesGet(limit, offset);\n\n // TODO: test validations\n }", "public ArrayList<String> getList(String path) throws Exception {\n\t\t\t\n\t\t\tSmbFile file = new SmbFile(path, new NtlmPasswordAuthentication(null, user, pass));\n\t\t\tArrayList<String> fileList = new ArrayList<String>();\n\t\t\t\n\t\t\tSmbFile[] fArr = file.listFiles();\n\t\t\t\n\t\t\tfor(int a=0;a<fArr.length;a++) {\n\t\t\t\tif(accept(fArr[a]) == true) {\n\t\t\t\t\tfileList.add(fArr[a].getName());\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn fileList;\n\t\t}", "public void getPeerFiles(){\n\t\t\n\t\tFile[] files = new File(path).listFiles();\n\t\tfor (File file : files) {\n\t\t\tfileNames.add(file.getName());\n\t\t}\n\t\tSystem.out.println(\"Number of Files Registerd to the server - \"+fileNames.size());\n\t\tSystem.out.println(\"To search for file give command: get <Filename>\");\n\t\tSystem.out.println(\"To refresh type command: refresh\");\n\t\tSystem.out.println(\"To disconnect type command: disconnect\");\n\t}", "public String[] getFilesFromFolder(String folder, String filter) {\n\t\ttry\n\t\t{\n\t\t\tfinal String f = filter;\n\t\t\tFilenameFilter filnameFilter = new FilenameFilter() {\n\n\t\t\t\t@Override\n\t\t\t\tpublic boolean accept(File dir, String name) {\n\t\t\t\t\tif( name.toLowerCase().endsWith(f))\n\t\t\t\t\t\treturn true;\n\t\t\t\t\telse\n\t\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t};\n\t\t\tif(! folder.endsWith(\"/\"))\n\t\t\t\tfolder += \"/\";\n\t\t\t\n\t\t\tString[] files = FileIO.getFiles(this.getServletContext().getRealPath(folder), filnameFilter);\t\t\t\n\t\t\t\t\t\n\t\t\treturn files;\n\t\t}\n\t\tcatch (Exception e)\n\t\t{\n\t\t\treturn null;\n\t\t}\n\t}", "GitFile[] getFilesImpl() throws Exception\n {\n TreeWalk twalk = new TreeWalk(getRepo()); twalk.addTree(_rev);\n List <GitFile> files = new ArrayList();\n while(twalk.next()) {\n ObjectId id = twalk.getObjectId(0);\n RevObject rid = getRevObject(id);\n String path = _path + (_path.length()>1? \"/\" : \"\") + twalk.getNameString();\n GitFile child = rid instanceof RevTree? new GitTree((RevTree)rid, path) : new GitBlob((RevBlob)rid, path);\n files.add(child);\n }\n return files.toArray(new GitFile[files.size()]);\n }", "java.util.List<entities.Torrent.FileInfo>\n getFilesList();", "public static Set<File> getFiles(File dir, final FileFilter filter) {\n // Get files in this folder\n File[] files = dir.listFiles(new FileFilter() {\n @Override\n public boolean accept(File pathname) {\n return !pathname.isDirectory() && filter.accept(pathname);\n }\n });\n \n Set<File> allFiles = new HashSet<>(files.length);\n //if (files != null) {\n allFiles.addAll(Arrays.asList(files));\n //}\n\n // Get files in sub directories\n File[] directories = dir.listFiles(new FileFilter() {\n @Override\n public boolean accept(File pathname) {\n return pathname.isDirectory();\n }\n });\n \n //if (directories != null) {\n for (File directory : directories) {\n allFiles.addAll(getFiles(directory, filter));\n }\n //}\n\n return allFiles;\n }", "private static void iteratorFilePath(File file){\n while(file.isDirectory()){\n for(File f : file.listFiles()){\n System.out.println(f.getPath());\n iteratorFilePath(f);\n }\n break;\n }\n }", "public static File[] findFiles(String fileName) {\n List<File> fileList_ = new ArrayList<File>();\n if(fileRepoPath_ != null)\n listFiles(new File(fileRepoPath_),fileName, fileList_);\n if(fileList_.size()==0) {\n try {\n \t Enumeration<URL> en_ = FileFinder.class.getClassLoader().getResources(fileName);\n \t while(en_.hasMoreElements()) {\n \t fileList_.add(new File(en_.nextElement().getFile().replaceAll(\"%20\",\" \")));\n \t }\n \t } \n \t catch(IOException e) { }\n }\n \treturn (File[])fileList_.toArray(new File[fileList_.size()]);\n }", "public Set<String> getSourceFiles(String folder) throws Exception {\n final List<String> extensions = new LinkedList<String>(Arrays.asList(EXTENSIONS));\n\n folder = PathUtil.getWellFormedPath(folder);\n\n if (PathUtil.isRelativePath(folder)) {\n folder = PathUtil.getAbsolutePathFromRelativetoCurrentPath(folder);\n }\n\n File file = new File(folder);\n Set<String> pathsForSourceFiles = new HashSet<String>();\n for (String filePath : FileUtils.getAllFilesInFolderAndSubFolders(file, extensions)) {\n pathsForSourceFiles.add(filePath);\n }\n\n return pathsForSourceFiles;\n }", "public ArrayList<ImageFile> getAllImagesUnderDirectory() throws IOException {\n return allImagesUnderDirectory;\n }", "public List <WebFile> getChildFiles()\n{\n if(_type==FileType.SOURCE_DIR) return getSourceDirChildFiles();\n return _file.getFiles();\n}", "private void cacheFoldersFiles() throws Exception {\n\n ArrayList<FileManagerFile> files = new ArrayList<FileManagerFile>();\n if (fileCount > 0) {\n SimpleDateFormat formatter = new SimpleDateFormat(\"yyyy-MM-dd'T'HH:mm:ss\");\n formatter.setTimeZone(TimeZone.getTimeZone(\"GMT\"));\n\n int offset = 0;\n int count = 1000;\n List<FileManagerFile> filelist;\n\n do {\n filelist = connection.getFileManager().getFileManagerFiles(count, offset);\n offset += count;\n for (FileManagerFile file : filelist) {\n if (file.getFolderId() == id) {\n files.add(file);\n }\n }\n } while (filelist.size() > 0 && files.size() < fileCount);\n }\n this.files = files;\n }", "public String[] listFiles() throws FileSystemUtilException \r\n\t{\r\n\t\tString remoteDir = null;\r\n\t\tString remoteFileName = null;\r\n\t\tString command = null;\r\n\t\tint signal = -1;\r\n\t\tlogger.debug(\"Begin: \"+getClass().getName()+\":listFiles()\");\r\n\t\t\r\n\t\ttry\r\n\t\t{\r\n\t\t\tconnect(); \r\n\t\t\t\r\n\t\t\tint lastSeperatorIndex = -1;\r\n\t\r\n\t\t\tif(remoteFilePath.lastIndexOf(\"/\") != -1){\r\n\t\t\t\tlastSeperatorIndex = remoteFilePath.lastIndexOf(\"/\");\r\n\t\t\t}else if(remoteFilePath.lastIndexOf(\"\\\\\") != -1){\r\n\t\t\t\tlastSeperatorIndex = remoteFilePath.lastIndexOf(\"\\\\\");\r\n\t\t\t}\r\n\t\t\tif(lastSeperatorIndex == remoteFilePath.length()-1)\r\n\t\t\t{\r\n\t\t\t\tremoteDir = remoteFilePath;\r\n\t\t\t\tremoteFileName = \"\";\r\n\t\t\t\tlogger.debug(\"file path ends with / - directory is \"+remoteDir+\" , filename is \"+remoteFileName);\r\n\t\t\t\tcommand = \"cd \"+remoteDir;\t\t\t\r\n\t\t\t\tsignal = executeSimpleCommand(command);\r\n\t\r\n\t\t\t\tif(signal != 0)\r\n\t\t\t\t{\r\n\t\t\t\t\t//invlid directory/file\r\n\t\t\t\t\tthrow new FileSystemUtilException(\"ET0017\");\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\telse\r\n\t\t\t{\r\n\t\t\t\tremoteDir = remoteFilePath.substring(0,lastSeperatorIndex+1);\r\n\t\t\t\tremoteFileName = remoteFilePath.substring(lastSeperatorIndex+1,remoteFilePath.length());\r\n\t\t\t\tlogger.debug(\"file path not ends with / - directory is \"+remoteDir+\" , filename is \"+remoteFileName);\r\n\t\t\t\tcommand = \"cd \"+remoteDir;\r\n\t\t\t\tsignal = executeSimpleCommand(command);\r\n\t\t\t\tif(signal != 0)\r\n\t\t\t\t{\r\n\t\t\t\t\t//invlid directory/file\r\n\t\t\t\t\tthrow new FileSystemUtilException(\"ET0017\");\r\n\t\t\t\t}\r\n\t\t\t\t\t\t\t\r\n\t\t\t\tif(!remoteFileName.startsWith(\"*.\") && !remoteFileName.endsWith(\".*\"))\r\n\t\t\t\t{\r\n\t\t\t\t\tlogger.debug(\"file/directory name \"+remoteFileName+\" not started with *. or ends wirh .*\");\r\n\t\t\t\t\tcommand = \"cd \"+remoteDir+remoteFileName;\r\n\t\t\t\t\tsignal = executeSimpleCommand(command);\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\tif(signal != 0)\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tboolean isFile = false;\r\n\t\t\t\t\t\tcommand = \"ls \"+remoteDir;\r\n\t\t\t\t\t\texecuteSimpleCommand(command);\r\n\t\t\t\t\t\tString[] tempFileNames = getFileNamesArray(output);\r\n\t\t\t\t\t\tfor(int j = 0; j < tempFileNames.length; j++)\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\tif(remoteFileName.equals(tempFileNames[j]))\r\n\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\tisFile = true;\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tif(!isFile)\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t//invlid directory/file\r\n\t\t\t\t\t\t\tthrow new FileSystemUtilException(\"ET0017\");\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tlogger.debug(remoteFileName+\" is a file\");\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\tlogger.debug(remoteFileName+\" is a directory\");\r\n\t\t\t\t\t\tremoteDir = remoteDir+remoteFileName;\r\n\t\t\t\t\t\tremoteFileName = \"\";\r\n\t\t\t\t\t}\t\t\t\t\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tlogger.debug(\"Before getting list of files : current dir \"+remoteDir+\" getting files list for \"+remoteFileName);\r\n\t\t\tcommand = \"cd \"+remoteDir+\";ls -F \"+remoteFileName;\r\n\t\t\tsignal = executeSimpleCommand(command);\r\n\t\t\tdisconnect();\r\n\t\t\tif(signal != 0)\r\n\t\t\t{\t\t\t \r\n\t\t\t\tthrow new FileSystemUtilException(\"ET0017\");\r\n\t\t\t}\r\n\t\t\tString[] filesList = getFileNamesArray(output);\t\t\r\n\t\t\tlogger.debug(\"End: \"+getClass().getName()+\":listFiles()\");\r\n\t\t\treturn filesList;\r\n\t\t}\r\n\t\t\r\n\t\tcatch(FileSystemUtilException e)\r\n\t\t{\r\n\t\t disconnect();\r\n\t\t if(e.getMessage() != null && e.getMessage().equals(\"FL0071\")){\r\n\t\t \tthrow new FileSystemUtilException(\"FL0071\");\r\n\t\t }\r\n\t\t\tthrow new FileSystemUtilException(e.getErrorCode(),e.getException());\r\n\t\t}\r\n\t\t\r\n\t}", "public List<String> getDownloadableFiles() throws IOException {\n List<String> fileNameList = new ArrayList<>();\n Files.walk(Paths.get(this.sharedFolder)).forEach(ruta -> {\n if (Files.isRegularFile(ruta)) {\n fileNameList.add(ruta.getFileName().toString());\n }\n });\n return fileNameList;\n }", "private static String[] findFiles(String dirpath) {\n\t\tString fileSeparator = System.getProperty(\"file.separator\");\n\t\tVector<String> fileListVector = new Vector<String>();\n\t\tFile targetDir = null;\n\t\ttry {\n\t\t\ttargetDir = new File(dirpath);\n\t\t\tif (targetDir.isDirectory())\n\t\t\t\tfor (String val : targetDir.list(new JavaFilter()))\n\t\t\t\t\tfileListVector.add(dirpath + fileSeparator + val);\n\t\t} catch(Exception e) {\n\t\t\tlogger.error(e);\n\t\t\tSystem.exit(1);\n\t\t}\n\t\t\n\t\tString fileList = \"\";\n\t\tfor (String filename : fileListVector) {\n\t\t\tString basename = filename.substring(filename.lastIndexOf(fileSeparator) + 1);\n\t\t\tfileList += \"\\t\" + basename;\n\t\t}\n\t\tif (fileList.equals(\"\")) \n\t\t\tfileList += \"none.\";\n\t\tlogger.trace(\"Unpackaged source files found in dir \" + dirpath + fileSeparator + \": \" + fileList);\n\t\t\n\t\treturn (String[]) fileListVector.toArray(new String[fileListVector.size()]);\n\t}", "private static Collection<File> listFiles(File directory, FilenameFilter filter, boolean recurse) {\n\t\tVector<File> files = new Vector<File>();\n\t\tFile[] entries = directory.listFiles();\n\n\t\tfor (File entry : entries) {\n\t\t\tif (filter == null || filter.accept(directory, entry.getName()))\n\t\t\t\tfiles.add(entry);\n\t\t\tif (recurse && entry.isDirectory())\n\t\t\t\tfiles.addAll(listFiles(entry, filter, recurse));\n\t\t}\n\t\treturn files;\n\t}", "@Override\n @Transactional(readOnly = true)\n public List<FileDTO> findAll() {\n log.debug(\"Request to get all Files\");\n return fileRepository.findAll().stream().map(FileMapper::toDto)\n .collect(Collectors.toCollection(LinkedList::new));\n }", "public Set<FilesetFile> getAllFiles() {\n\t\treturn allFiles;\n\t}", "private void getAllFiles(File dir, List<File> fileList) throws IOException {\r\n File[] files = dir.listFiles();\r\n if(files != null){\r\n for (File file : files) {\r\n // Do not add the directories that we need to skip\r\n if(!isDirectoryToSkip(file.getName())){\r\n fileList.add(file);\r\n if (file.isDirectory()) {\r\n getAllFiles(file, fileList);\r\n }\r\n }\r\n }\r\n }\r\n }", "@Override\n public Iterable<File> list(File storageDirectory, FilenameFilter filter) {\n\treturn null;\n }", "private void getDirectoryContents() {\n\t File directory = Utilities.prepareDirectory(\"Filtering\");\n\t if(directory.exists()) {\n\t FilenameFilter filter = new FilenameFilter() {\n\t public boolean accept(File dir, String filename) {\n\t return filename.contains(\".pcm\") || filename.contains(\".wav\");\n\t }\n\t };\n\t fileList = directory.list(filter);\n\t }\n\t else {\n\t fileList = new String[0];\n\t }\n\t}", "protected Set<File> getDataFiles(File directory){\n\t\tSet<File> files = new HashSet<File>();\n\t\t\n\t\tfor(File file : directory.listFiles()){\n\t\t\tif(file.isDirectory()){\n\t\t\t\tfiles.addAll(this.getDataFiles(file));\n\t\t\t} else {\n\t\t\t\tif(file.getName().equals(DATA_FILE)){\n\t\t\t\t\tfiles.add(file);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn files;\n\t}" ]
[ "0.7929717", "0.7857711", "0.7686616", "0.76187545", "0.7608877", "0.7545611", "0.7470408", "0.7363753", "0.7326148", "0.72024333", "0.7142466", "0.7128243", "0.71114594", "0.7023966", "0.6996091", "0.69944555", "0.6969765", "0.6969691", "0.6945279", "0.69046366", "0.68852943", "0.68702734", "0.6866221", "0.68562436", "0.6849034", "0.6835873", "0.68188655", "0.68187773", "0.67604285", "0.6752546", "0.67442834", "0.6743332", "0.674089", "0.6727833", "0.6712596", "0.67048633", "0.6703033", "0.66949564", "0.66758007", "0.665665", "0.66209143", "0.66193223", "0.6614301", "0.6608113", "0.6584743", "0.6546245", "0.6534921", "0.6496597", "0.64833647", "0.6470402", "0.64553654", "0.64408314", "0.6434063", "0.6422241", "0.64171165", "0.64112914", "0.64049935", "0.639846", "0.63956696", "0.6394681", "0.63699603", "0.6368113", "0.63435197", "0.633734", "0.63354814", "0.63018215", "0.6298965", "0.62983096", "0.62940156", "0.6282943", "0.62817514", "0.6281493", "0.6280662", "0.62723565", "0.6271817", "0.62680703", "0.6264077", "0.6257928", "0.6252088", "0.62388504", "0.623543", "0.62341505", "0.6223783", "0.6223024", "0.62144727", "0.6191221", "0.6190768", "0.6184682", "0.61830837", "0.617046", "0.6151195", "0.61508805", "0.61399186", "0.6136005", "0.6131377", "0.6129016", "0.6128073", "0.6121387", "0.61072797", "0.6106065" ]
0.7322117
9
method to read complete file in string from classpath inside jar based on class object
public String ReadFile_FromClassPath(String sFileName) { String stemp = null; try { InputStream is = getClass().getClassLoader().getResourceAsStream(sFileName); stemp = getStringFromInputStream(is); } catch (Exception e) { stemp = null; throw new Exception("ReadFile_FromClassPath : " + e.toString()); } finally { return stemp; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "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 }", "@Override\n public Class getJavaClass() throws IOException, ClassNotFoundException {\n open();\n URL url;\n int p = path.lastIndexOf('/');\n int p2 = path.substring(0,p-1).lastIndexOf('/');\n\n File f = new File(path.substring(0,p2));\n url = f.toURI().toURL();\n URL[] urls = new URL[1];\n urls[0] = url;\n ClassLoader loader = new URLClassLoader(urls);\n\n String cls = path.substring(p2 + 1, path.lastIndexOf('.')).replace('/', '.');\n\n if (cfile.getParentFile().getParentFile().getName().equals(\"production\")) {\n cls = cls.substring(cls.lastIndexOf('.') + 1);\n }\n\n\n\n return loader.loadClass(cls);\n }", "private String loadAsString(final String path) {\n try (InputStream inputStream = Thread.currentThread()\n .getContextClassLoader().getResourceAsStream(path)) {\n return new Scanner(inputStream).useDelimiter(\"\\\\A\").next();\n } catch (IOException e) {\n throw new RuntimeException(\"Unable to close input stream.\", e);\n }\n }", "protected String readTestFile(String path) throws IOException {\n return FileUtils.readClasspathFile(path);\n }", "private static String open(@NonNull String path) throws Exception {\n ClassLoader loader = ClassLoader.getSystemClassLoader();\n InputStream stream = loader.getResourceAsStream(path);\n final StringBuilder stringBuilder = new StringBuilder();\n int i;\n byte[] b = new byte[4096];\n while ((i = stream.read(b)) != -1) {\n stringBuilder.append(new String(b, 0, i));\n }\n return stringBuilder.toString();\n }", "java.lang.String getOutputjar();", "public static String readAll(String filename) throws FileNotFoundException, IOException {\n String JAR = jarPrefix();\n boolean fromJar = false;\n if (filename.startsWith(JAR)) {\n fromJar = true;\n filename = filename.substring(JAR.length()).replace('\\\\', '/');\n }\n InputStream fis = null;\n int now = 0, max = 4096;\n if (!fromJar) {\n long maxL = new File(filename).length();\n max = (int) maxL;\n if (max != maxL)\n throw new IOException(\"File too big to fit in memory\");\n }\n byte[] buf;\n try {\n buf = new byte[max];\n fis = fromJar ? Util.class.getClassLoader().getResourceAsStream(filename) : new FileInputStream(filename);\n if (fis == null)\n throw new FileNotFoundException(\"File \\\"\" + filename + \"\\\" cannot be found\");\n while (true) {\n if (now >= max) {\n max = now + 4096;\n if (max < now)\n throw new IOException(\"File too big to fit in memory\");\n byte[] buf2 = new byte[max];\n if (now > 0)\n System.arraycopy(buf, 0, buf2, 0, now);\n buf = buf2;\n }\n int r = fis.read(buf, now, max - now);\n if (r < 0)\n break;\n now = now + r;\n }\n } catch (OutOfMemoryError ex) {\n System.gc();\n throw new IOException(\"There is insufficient memory.\");\n } finally {\n close(fis);\n }\n CodingErrorAction r = CodingErrorAction.REPORT;\n CodingErrorAction i = CodingErrorAction.IGNORE;\n ByteBuffer bbuf;\n String ans = \"\";\n try {\n // We first try UTF-8;\n bbuf = ByteBuffer.wrap(buf, 0, now);\n ans = Charset.forName(\"UTF-8\").newDecoder().onMalformedInput(r).onUnmappableCharacter(r).decode(bbuf).toString();\n } catch (CharacterCodingException ex) {\n try {\n // if that fails, we try using the platform's default charset\n bbuf = ByteBuffer.wrap(buf, 0, now);\n ans = Charset.defaultCharset().newDecoder().onMalformedInput(r).onUnmappableCharacter(r).decode(bbuf).toString();\n } catch (CharacterCodingException ex2) {\n // if that also fails, we try using \"ISO-8859-1\" which should\n // always succeed but may map some characters wrong\n bbuf = ByteBuffer.wrap(buf, 0, now);\n ans = Charset.forName(\"ISO-8859-1\").newDecoder().onMalformedInput(i).onUnmappableCharacter(i).decode(bbuf).toString();\n }\n }\n return convertLineBreak(ans);\n }", "private static String p_readFromResource(String path) {\n StringBuffer content = new StringBuffer();\n\n InputStream istream = NamedTemplate.class.getResourceAsStream(path);\n\n if (istream != null) {\n BufferedReader reader = new BufferedReader(new InputStreamReader(istream));\n\n try {\n String line = reader.readLine();\n while (line != null) {\n content.append(line).append(\"\\n\");\n\n line = reader.readLine();\n }\n } catch (IOException e) {\n logger.error(\"NamedTemplate: unable to read template from \" + path, e);\n }\n } else {\n return null;\n }\n\n return content.toString();\n }", "private String jarName(){\n // determine the name of this class\n String className=\"/\"+this.getClass().getName().replace('.','/')+\".class\";\n // find out where the class is on the filesystem\n String classFile=this.getClass().getResource(className).toString();\n\n if( (classFile==null) || !(classFile.startsWith(\"jar:\")) ) return null;\n \n // trim out parts and set this to be forwardslash\n classFile=classFile.substring(5,classFile.indexOf(className));\n classFile=FilenameUtil.setForwardSlash(classFile);\n\n // chop off a little bit more\n classFile=classFile.substring(4,classFile.length()-1);\n \n return FilenameUtil.URLSpacetoSpace(classFile);\n }", "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}", "public static String readFileFromClasspath(final String filePath) throws IOException\n\t{\n\t\treturn readFileFromInputStream(FileUtil.class.getResourceAsStream(filePath));\n\t}", "public String getClassPath();", "private String getStringFromResource(String resourcePath) {\n String str = \"\";\n ClassLoader classloader = getClass().getClassLoader();\n if (classloader == null) {\n return str;\n }\n if (logger.isTraceEnabled()) {\n URL resourceurl = classloader.getResource(resourcePath);\n logger.trace(\"URL=\" + resourceurl.toString());\n }\n InputStream instream = classloader.getResourceAsStream(resourcePath);\n if (instream == null) {\n logger.warn(\"Could not read resource from path \" + resourcePath);\n return null;\n }\n try {\n str = stringFromInputStream(instream);\n } catch (IOException ioe) {\n logger.warn(\"Could not create string from stream: \", ioe);\n return null;\n }\n return str;\n }", "@Test\n void findSourceJar() {\n Class<?> klass = org.apache.commons.io.FileUtils.class;\n var codeSource = klass.getProtectionDomain().getCodeSource();\n if (codeSource != null) {\n System.out.println(codeSource.getLocation());\n }\n }", "public List<Clazz> loadAndScanJar()\n\t\t\tthrows ClassNotFoundException, ZipException, IOException {\n\t\tsuper.addURL(new File(path).toURI().toURL());\n\t\tList<Clazz> representations=new ArrayList<Clazz>();\n\n\t\t// Count the classes loaded\n\t\t// Your jar file\n\t\tFile f = new File(path);\n\n\t\tJarFile jar = new JarFile(path);\n\t\t// Getting the files into the jar\n\t\tEnumeration<? extends JarEntry> enumeration = jar.entries();\n\n\t\t// Iterates into the files in the jar file\n\t\twhile (enumeration.hasMoreElements()) {\n\t\t\tZipEntry zipEntry = enumeration.nextElement();\n\t\t\t// Is this a class?\n\t\t\tif (zipEntry.getName().endsWith(\".class\")) {\n\t\t\t\t// Relative path of file into the jar.\n\t\t\t\tString className = zipEntry.getName();\n\t\t\t\t// Complete class name\n\t\t\t\tclassName = className.replace(\".class\", \"\").replace(\"/\", \".\");\n\t\t\t\t// Load class definition from JVM\n\t\t\t\tClass<?> clazz = this.loadClass(className);\n\t\t\t\ttry {\n\t\t\t\t\t\tClazz actual = new Clazz(clazz.getName());\n\t\t\t\t\t\tfor (java.lang.reflect.Method m : clazz.getMethods()) {\n\t\t\t\t\t\t\tactual.addMethod(m.getReturnType().getName(), m.getName(), getScope(m.getModifiers()),\n\t\t\t\t\t\t\t\t\tModifier.isAbstract(m.getModifiers()), Modifier.isStatic(m.getModifiers()));\n\t\t\t\t\t\t}\n\t\t\t\t\t\tfor (java.lang.reflect.Field m : clazz.getFields()) {\n\t\t\t\t\t\t\tactual.addVariable(m.getType().getName(), m.getName(), getScope(m.getModifiers()),\n\t\t\t\t\t\t\t\t\tModifier.isStatic(m.getModifiers()));\n\t\t\t\t\t\t}\n\t\t\t\t\t\trepresentations.add(actual);\n\n\t\t\t\t} catch (ClassCastException e) {\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tjar.close();\n\t\treturn representations;\n\t}", "public String getClassName(String path);", "String resolveClassPath(String classPath);", "public ClassFile getClassFile(String name) throws IOException {\n if (name.indexOf('.') > 0) {\n int i = name.lastIndexOf('.');\n String pathname = name.replace('.', File.separatorChar) + \".class\";\n if (baseFileName.equals(pathname) ||\n baseFileName.equals(pathname.substring(0, i) + \"$\" +\n pathname.substring(i+1, pathname.length()))) {\n return readClassFile(path);\n }\n } else {\n if (baseFileName.equals(name.replace('/', File.separatorChar) + \".class\")) {\n return readClassFile(path);\n }\n }\n return null;\n }", "public File findJarFileForClass(String type, String name) throws ClassNotFoundException {\n // On cherche la classe demandee parmi celles repertoriees lors du lancement de Kalimucho\n // Si on ne la trouve pas on recree la liste (cas ou le fichier jar aurait ete ajoute apres le demarrage)\n // Si on la trouve on revoie le fichier jar la contenant sinon on leve une exception\n int index=0;\n boolean trouve = false;\n while ((index<types.length) && (!trouve)) { // recherche du type\n if (type.equals(types[index])) trouve = true;\n else index++;\n }\n if (!trouve) throw new ClassNotFoundException(); // type introuvable\n else { // le type est connu on cherche la classe\n int essais = 0;\n while (essais != 2) {\n String fich = classesDisponibles[index].get(name);\n if (fich != null) { // classe repertoriee dans la liste\n essais = 2; // on renvoie le fichier\n return new File(Parameters.COMPONENTS_REPOSITORY+\"/\"+type+\"/\"+fich);\n }\n else { // la classe n'est pas dans la liste\n essais++;\n if (essais == 1) { // si on ne l'a pas deja fait on recree la liste a partir du depot\n rescanRepository();\n }\n }\n }\n throw new ClassNotFoundException(); // Classe introuvable meme apres avoir recree la liste\n }\n }", "public static String get(String file) throws IOException {\n\n\t\tClassLoader classLoader = FileIO.class.getClassLoader();\n\t\tInputStream inputStream = new FileInputStream(classLoader.getResource(\n\t\t\t\tfile).getFile());\n\t\treturn IOUtils.toString(inputStream);\n\n\t}", "static JsonResource forClasspath( ClassLoader classLoader, String name ) {\n final ClassLoader loader = classLoader == null ? Thread.currentThread().getContextClassLoader() : classLoader;\n return new JsonResource() {\n @Override\n public <T> T readFrom( ReadMethod<T> consumer ) throws IOException {\n InputStream stream = loader.getResourceAsStream(name);\n if ( stream == null )\n throw new FileNotFoundException(\"Resource \" + name + \" not found\");\n try {\n return consumer.read( stream );\n } finally {\n stream.close();\n }\n }\n };\n }", "private Object readObject(String path)\n throws IOException, ClassNotFoundException {\n InputStream file = new FileInputStream(path);\n InputStream buffer = new BufferedInputStream(file);\n ObjectInput input = new ObjectInputStream(buffer);\n Object inputObj = input.readObject();\n input.close();\n return inputObj;\n }", "private JavaRuntimeMock(String resource) {\n\n\t\t// open test resource for reading\n\t\ttry (InputStream is = TestUtils.getResourceAsStream(resource)) {\n\t\t\tDataInputStream dis = new DataInputStream(new GZIPInputStream(is));\n\n\t\t\t// read compressed class definitions\n\t\t\tint numClassDefs = dis.readInt();\n\t\t\tfor (int c = 0; c < numClassDefs; c++) {\n\t\t\t\tClassDef classDef = ClassDefUtils.read(dis);\n\t\t\t\tString className = classDef.getClassName();\n\t\t\t\tclassDefs.put(className, classDef);\n\t\t\t\tString packageName = classDef.getPackageName();\n\t\t\t\tpackageNames.add(packageName);\n\t\t\t}\n\n\t\t\t// read excluded class names\n\t\t\tint numExcludedClassNames = dis.readInt();\n\t\t\tfor (int i = 0; i < numExcludedClassNames; i++) {\n\t\t\t\tString className = dis.readUTF();\n\t\t\t\texcludedClassNames.add(className);\n\t\t\t\tString packageName = getPackageName(className);\n\t\t\t\tpackageNames.add(packageName);\n\t\t\t}\n\n\t\t} catch (IOException e) {\n\t\t\tthrow new TestDataException(e);\n\t\t}\n\t}", "private PcePath getPcePath(String resourceName) throws IOException {\n InputStream jsonStream = PcePathCodecTest.class\n .getResourceAsStream(resourceName);\n ObjectMapper mapper = new ObjectMapper();\n JsonNode json = mapper.readTree(jsonStream);\n assertThat(json, notNullValue());\n PcePath pcePath = pcePathCodec.decode((ObjectNode) json, context);\n assertThat(pcePath, notNullValue());\n return pcePath;\n }", "private static String getJarFilePath() throws URISyntaxException, UnsupportedEncodingException {\n\n\t\tFile jarFile;\n\n\t\t// if (codeSource.getLocation() != null) {\n\t\t// jarFile = new File(codeSource.getLocation().toURI());\n\t\t// } else {\n\t\tString path = ConfigurationLocator.class.getResource(ConfigurationLocator.class.getSimpleName() + \".class\")\n\t\t\t\t.getPath();\n\t\tString jarFilePath = path.substring(path.indexOf(\":\") + 1, path.indexOf(\"!\"));\n\t\tjarFilePath = URLDecoder.decode(jarFilePath, \"UTF-8\");\n\t\tjarFile = new File(jarFilePath);\n\t\t// }\n\t\treturn jarFile.getParentFile().getAbsolutePath();\n\t}", "protected static String getResourceAsString(Class<?> clazz, String location) {\n try (InputStream resourceStream = clazz.getResourceAsStream(location)) {\n return IoUtils.toUtf8String(resourceStream);\n } catch (IOException e) {\n throw new RuntimeException(e);\n }\n }", "public String getJarLocation();", "private Document getDocumentInClassPath()throws Exception{\r\n\t\t\r\n\t\tDocumentBuilderFactory builderFactory = DocumentBuilderFactory.newInstance();\r\n\t\tDocumentBuilder builder = builderFactory.newDocumentBuilder();\r\n\t\t\r\n\t\tDocument doc = builder.parse(ServiceLoader.class.getResourceAsStream(\"/\"+FILE_NAME));\r\n\t\t\r\n\t\treturn doc;\r\n\t}", "private String readResource(String name) throws IOException {\n ClassLoader cl = Thread.currentThread().getContextClassLoader();\n try (InputStream in = cl.getResourceAsStream(name)) {\n return new String(EncodingUtils.readAll(in), StandardCharsets.US_ASCII);\n }\n }", "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 readObject() throws ClassNotFoundException, IOException;", "private byte[] getClassBytes(String slashedName) {\n URL url = Thread.currentThread().getContextClassLoader().getResource(\n slashedName + \".class\");\n if (url == null) {\n logger.log(TreeLogger.DEBUG, \"Unable to find \" + slashedName\n + \" on the classPath\");\n return null;\n }\n String urlStr = url.toExternalForm();\n if (slashedName.equals(mainClass)) {\n // initialize the mainUrlBase for later use.\n mainUrlBase = urlStr.substring(0, urlStr.lastIndexOf('/'));\n } else {\n assert mainUrlBase != null;\n if (!mainUrlBase.equals(urlStr.substring(0, urlStr.lastIndexOf('/')))) {\n logger.log(TreeLogger.DEBUG, \"Found \" + slashedName + \" at \" + urlStr\n + \" The base location is different from that of \" + mainUrlBase\n + \" Not loading\");\n return null;\n }\n }\n \n // url != null, we found it on the class path.\n try {\n URLConnection conn = url.openConnection();\n return Util.readURLConnectionAsBytes(conn);\n } catch (IOException ignored) {\n logger.log(TreeLogger.DEBUG, \"Unable to load \" + urlStr\n + \", in trying to load \" + slashedName);\n // Fall through.\n }\n return null;\n }", "@Override\n \tprotected File deriveLocalFileCodeBase(Class<?> baseClass)\n \t{\n \t\t// setup codeBase\n \t\tif (baseClass == null)\n \t\t\tbaseClass = this.getClass();\n \n \t\tPackage basePackage = baseClass.getPackage();\n \t\tString packageName = basePackage.getName();\n \t\tString packageNameAsPath = packageName.replace('.', Files.sep);\n \n \t\tString pathName = System.getProperty(\"user.dir\") + Files.sep;\n \t\tFile path = new File(pathName);\n \t\tString pathString = path.getAbsolutePath();\n \n \t\t// println(\"looking for \" + packageNameAsPath +\" in \" + pathString);\n \n \t\tint packageIndex = pathString.lastIndexOf(packageNameAsPath);\n \t\tif (packageIndex != -1)\n \t\t{\n \t\t\tpathString = pathString.substring(0, packageIndex);\n \t\t\tpath = new File(pathString + Files.sep);\n \t\t}\n \n \t\tcodeBase = new ParsedURL(path);\n \t\tprintln(\"codeBase=\" + codeBase);\n \t\treturn path;\n \t}", "public static String fileToString(Class<?> loader, String fileLocation) throws IOException {\n return IOUtils.toString(loader.getClassLoader().getResource(fileLocation), Charset.defaultCharset());\n }", "public static InputStream getStreamFromClassPath(String path) {\n\t\treturn ResourceUtils.class.getClassLoader().getResourceAsStream(path);\n\t}", "public void initFromClasspath() throws IOException {\n \t\tcontactNames = loadFromClassPath(\"contactNames\");\n \t\tgroupNames = loadFromClassPath(\"groupNames\");\n \t\tmessageWords = loadFromClassPath(\"messageWords\");\n \t}", "public InputStream openStream(String str) {\n return Thread.currentThread().getContextClassLoader().getResourceAsStream(str);\n }", "public ClassPath getClassPath();", "static byte[] readResource(String name) throws IOException {\n byte[] buf = new byte[1024];\n\n InputStream in = Main.class.getResourceAsStream(name);\n ByteArrayOutputStream bout = new ByteArrayOutputStream();\n int n;\n while ((n = in.read(buf)) > 0) {\n bout.write(buf, 0, n);\n }\n try { in.close(); } catch (Exception ignored) { } \n\n return bout.toByteArray();\n }", "public static String[] getResourceListing(Class<?> clazz, String path) throws\r\n URISyntaxException, IOException {\r\n URL dirURL = clazz.getClassLoader().getResource(path);\r\n\r\n if (dirURL != null && dirURL.getProtocol().equals(\"file\")) {\r\n /* A file path: easy enough */\r\n return new File(dirURL.toURI()).list();\r\n }\r\n\r\n if (dirURL == null) {\r\n /*\r\n * In case of a jar file, we can't actually find a directory. Have\r\n * to assume the same jar as clazz.\r\n */\r\n String me = clazz.getName().replace(\".\", \"/\") + \".class\";\r\n dirURL = clazz.getClassLoader().getResource(me);\r\n }\r\n\r\n if (dirURL != null && dirURL.getProtocol().equals(\"jar\")) {\r\n /* A JAR path */\r\n String jarPath = dirURL.getPath().substring(5, dirURL.getPath().indexOf(\"!\")); //strip out only the JAR file\r\n JarFile jar = new JarFile(URLDecoder.decode(jarPath, \"UTF-8\"));\r\n\r\n LOGGER.debug(\"Listing files in \" + jarPath);\r\n\r\n Enumeration<JarEntry> entries = jar.entries(); //gives ALL entries in jar\r\n Set<String> result = new HashSet<>(); //avoid duplicates in case it is a subdirectory\r\n while (entries.hasMoreElements()) {\r\n String name = entries.nextElement().getName();\r\n if (name.startsWith(path)) { //filter according to the path\r\n LOGGER.debug(\"Found in jar \" + name);\r\n String entry = name.replace(path + \"/\", \"\");\r\n LOGGER.debug(\"Keeping \" + entry);\r\n result.add(entry);\r\n }\r\n }\r\n jar.close();\r\n return result.toArray(new String[0]);\r\n\r\n } else {\r\n\r\n InputStream inputstream = clazz.getResourceAsStream(\"/\" + path);\r\n if (inputstream != null) {\r\n final InputStreamReader isr = new InputStreamReader(inputstream, StandardCharsets.UTF_8);\r\n final BufferedReader br = new BufferedReader(isr);\r\n\r\n Set<String> result = new HashSet<>(); //avoid duplicates in case it is a subdirectory\r\n String filename = null;\r\n while ((filename = br.readLine()) != null) {\r\n result.add(filename);\r\n }\r\n return result.toArray(new String[0]);\r\n }\r\n\r\n }\r\n\r\n throw new UnsupportedOperationException(\"Cannot list files for URL \" + dirURL);\r\n }", "public Resource load(IFile f);", "private static List<Class<?>>\n getClassNameFromJar(JarFile jarFile, String packageName, boolean isRecursion, String postfix) throws ClassNotFoundException {\n LOG.info(\"get Class List from jar \" + jarFile.getName());\n\n List<Class<?>> lc = new ArrayList<>();\n\n lc = jarFile.stream()\n .filter(f -> !f.isDirectory())\n .map(f -> f.getName().replace(\"/\", \".\"))\n .filter(f -> f.startsWith(packageName) && f.endsWith(postfix) && !f.contains(\"$\"))\n .map(f -> f.replace(postfix, \"\"))\n .map(f -> {\n try {\n return Class.forName(f);\n } catch (ClassNotFoundException e) {\n LOG.error(\"cast classstr \" + f + \" to class failed\");\n throw new RuntimeException(e);\n }\n })\n .collect(Collectors.toList());\n\n return lc;\n }", "public String[] ReadAllFileLines_FromClassPath(String sFileName) {\n String[] satemp = null;\n\n try {\n InputStream is = getClass().getClassLoader().getResourceAsStream(sFileName);\n satemp = getStringArrayFromInputStream(is);\n\n } catch (Exception e) {\n satemp = null;\n throw new Exception(\"ReadAllFileLines_FromClassPath : \" + e.toString());\n } finally {\n return satemp;\n }\n }", "@SuppressWarnings(\"deprecation\")\r\n\tpublic static URL findResourceInClassPath(String resourceName) {\r\n\r\n\t\tURL url;\r\n\r\n\t\t// Tries to locate the resource with the class loader\r\n\t\turl = ClassLoader.getSystemResource(resourceName);\r\n\t\tif (url != null)\r\n\t\t\treturn url;\r\n\r\n\t\t// Tries to locate the resource in the main directory\r\n\t\turl = FileLoader.class.getResource(resourceName);\r\n\t\tif (url != null)\r\n\t\t\treturn url;\r\n\r\n\t\t// Tries to locate the resource in the class list\r\n\t\tString path = FileLoader.class.getResource(FileLoader.class.getSimpleName() + \".class\").getPath();\r\n\t\tif( path != null ) {\r\n\t\t\tString pathParts[] = path.split(\"!\");\r\n\t\t\tpath = pathParts[0];\r\n\t\t\tpathParts = path.split(\"file:\");\r\n\t\t\tif( pathParts.length > 1 ) {\r\n\t\t\t\tpath = pathParts[1];\r\n\t\t\t} else {\r\n\t\t\t\tpath = pathParts[0];\r\n\t\t\t}\r\n\t\t\tif( path.contains(\"/lib/\")) {\r\n\t\t\t\tFile f = new File(path);\r\n\t\t\t\tf = f.getParentFile().getParentFile();\r\n\t\t\t\tf = new File(f.getPath() + File.separator + \"classes\" + File.separator + resourceName);\r\n\t\t\t\tif( f.exists()) {\r\n\t\t\t\t\ttry {\r\n\t\t\t\t\t\treturn f.toURL();\r\n\t\t\t\t\t} catch( Exception e) {}\r\n\t\t\t\t}\r\n\t\t\t} else {\r\n\t\t\t\tFile f = new File(path);\r\n\t\t\t\ttry {\r\n\t\t\t\t\tf = f.getParentFile().getParentFile().getParentFile();\r\n\t\t\t\t\tf = new File(f.getPath() + File.separator + resourceName);\r\n\t\t\t\t\tif( f.exists()) {\r\n\t\t\t\t\t\ttry {\r\n\t\t\t\t\t\t\treturn f.toURL();\r\n\t\t\t\t\t\t} catch(Exception e) {}\r\n\t\t\t\t\t}\r\n\t\t\t\t} catch(NullPointerException npe) {}\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\treturn null;\r\n\t}", "public interface ClasspathFileInterface \r\n{\r\n \r\n public boolean exists ();\r\n public String getName ();\r\n public String getAbsolutePath ();\r\n public InputStream openInputStream () throws IOException;\r\n \r\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 }", "public static String getAsString(String filePath) {\n\t\tInputStream is = FileUtil.class.getResourceAsStream(filePath);\n\t\treturn getAsString(is);\n\t}", "private static InputStream readFile(String path)\n\t{\n\t\tInputStream input = NativeLibraryLoader.class.getResourceAsStream(\"/\" + path);\n\t\tif (input == null)\n\t\t{\n\t\t\tthrow new RuntimeException(\"Unable to find file: \" + path);\n\t\t}\n\t\treturn input;\n\t}", "public String[] readClasses();", "public byte[] getResource(String name) {\r\n /*\r\n * if (classNameReplacementChar == '\\u0000') { // '/' is used to map the\r\n * package to the path name= name.replace('.', '/') ; } else {\r\n * Replace '.' with custom char, such as '_' name= name.replace('.',\r\n * classNameReplacementChar) ; }\r\n */\r\n if (htJarContents.get(name) == null) {\r\n return null;\r\n }\r\n System.out.println(\">> Cached jar resource name \" + name + \" size is \"\r\n + ((byte[]) htJarContents.get(name)).length + \" bytes\");\r\n\r\n return (byte[]) htJarContents.get(name);\r\n }", "public Serializable readObject(){\n Serializable loadedObject = null;\n try {\n FileInputStream fileIn = new FileInputStream(name);\n ObjectInputStream in = new ObjectInputStream(fileIn);\n loadedObject = (Serializable) in.readObject();\n in.close();\n fileIn.close();\n System.out.println(\"Data loaded from: \"+ name);\n } \n catch (IOException i) {\n System.out.println(\"File not found.\");\n } \n catch (ClassNotFoundException c) {\n System.out.println(\"Class not found\");\n }\n return loadedObject;\n }", "public static String readTemplate(Class c, String resourceName)\n {\n InputStream stream = c.getResourceAsStream(resourceName);\n Scanner sc = new Scanner(stream);\n String text = sc.useDelimiter(\"\\\\A\").next();\n sc.close();\n try {\n stream.close();\n } catch (IOException e) {\n e.printStackTrace();\n }\n return text;\n }", "public String readFileIntoString(String filepath) throws IOException;", "public static JARArchive createDefaultJar(Class<?> aClass) {\n JARArchive archive = ShrinkWrap.create(JARArchive.class);\n ClassLoader cl = aClass.getClassLoader();\n\n Set<CodeSource> codeSources = new HashSet<>();\n\n URLPackageScanner.Callback callback = (className, asset) -> {\n ArchivePath classNamePath = AssetUtil.getFullPathForClassResource(className);\n ArchivePath location = new BasicPath(\"\", classNamePath);\n archive.add(asset, location);\n\n try {\n Class<?> cls = cl.loadClass(className);\n codeSources.add(cls.getProtectionDomain().getCodeSource());\n } catch (ClassNotFoundException | NoClassDefFoundError e) {\n e.printStackTrace();\n }\n };\n\n URLPackageScanner scanner = URLPackageScanner.newInstance(\n true,\n cl,\n callback,\n aClass.getPackage().getName());\n\n scanner.scanPackage();\n\n Set<String> prefixes = codeSources.stream().map(e -> e.getLocation().toExternalForm()).collect(Collectors.toSet());\n\n try {\n List<URL> resources = Collections.list(cl.getResources(\"\"));\n\n resources.stream()\n .filter(e -> {\n for (String prefix : prefixes) {\n if (e.toExternalForm().startsWith(prefix)) {\n return true;\n }\n }\n return false;\n })\n .filter(e -> e.getProtocol().equals(\"file\"))\n .map(e -> getPlatformPath(e.getPath()))\n .map(e -> Paths.get(e))\n .filter(e -> Files.isDirectory(e))\n .forEach(e -> {\n try {\n Files.walkFileTree(e, new SimpleFileVisitor<Path>() {\n public FileVisitResult visitFile(Path file, BasicFileAttributes attrs) throws IOException {\n if (!file.toString().endsWith(\".class\")) {\n Path location = e.relativize(file);\n archive.add(new FileAsset(file.toFile()), javaSlashize(location));\n }\n return super.visitFile(file, attrs);\n }\n });\n } catch (IOException e1) {\n }\n });\n\n } catch (IOException e) {\n throw new RuntimeException(e);\n }\n return archive;\n }", "ITaskFactory<?> load(String classname);", "public String getClassPath(Object ClassObject) {\n try {\n String temp = null;\n temp = new File(ClassObject.getClass().getProtectionDomain().getCodeSource().getLocation().getPath()).getParent();\n temp = URLDecoder.decode(temp, \"UTF-8\");\n return temp;\n } catch (Exception e) {\n return \"\";\n }\n }", "@Test\n @Disabled(\"Not work in Java >=9\")\n void printAllClassJars() {\n var sysClassLoader = org.apache.commons.io.FileUtils.class.getClassLoader();\n var urLs = ((URLClassLoader) sysClassLoader).getURLs();\n for (var url : urLs) {\n System.out.println(url.getFile());\n }\n }", "public StringBuilder getClassPathDescription() {\n\n // load the jars from the classpath\n StringBuilder classPathLog = new StringBuilder();\n String[] classpathArray = getClassPathArray();\n\n if (classpathArray.length == 0) {\n return classPathLog;\n }\n\n // Make a map containing folders as keys and jar names as values\n Map<String, List<String>> classPathMap = new HashMap<String, List<String>>();\n for (int i = 0; i < classpathArray.length; i++) {\n String jarFullPath = classpathArray[i].replace(\"\\\\\", \"/\");\n String absPath = jarFullPath.substring(0, jarFullPath.lastIndexOf('/') + 1);\n String simpleJarName = jarFullPath.substring(jarFullPath.lastIndexOf('/') + 1,\n jarFullPath.length());\n if (classPathMap.containsKey(absPath)) {\n classPathMap.get(absPath).add(simpleJarName);\n } else {\n classPathMap.put(absPath, new ArrayList<String>(Arrays.asList(simpleJarName)));\n }\n }\n\n // append instances of same jar one after another\n for (String path : new TreeSet<String>(classPathMap.keySet())) {\n classPathLog.append(\"\\n\");\n classPathLog.append(path);\n List<String> jarList = classPathMap.get(path);\n Collections.sort(jarList);\n for (String lib : jarList) {\n classPathLog.append(\"\\n\\t\");\n classPathLog.append(lib);\n }\n }\n return classPathLog;\n }", "private void loadJarsFromManifestFile( ClassLoader classLoader ) throws IOException {\n\n Enumeration<URL> manifestUrls = ((URLClassLoader) classLoader).findResources(\"META-INF/MANIFEST.MF\");\n Manifest manifest = null;\n URL manifestElement = null;\n\n if (manifestUrls != null) {\n while (manifestUrls.hasMoreElements()) {\n manifestElement = manifestUrls.nextElement();\n try (InputStream is = manifestElement.openStream()) {\n manifest = new Manifest(is);\n\n // get the 'Class-Path' value from the MANIFEST.MF file\n String manifestClassPathValue = manifest.getMainAttributes().getValue(\"Class-Path\");\n if (manifestClassPathValue != null) {\n log.trace(\"Parsing MANIFEST file \\\"\" + manifestElement.getPath());\n String[] arr = manifestClassPathValue.split(\" \");\n for (int i = 0; i < arr.length; i++) {\n // add listed jars from MANIFEST file to the map\n String jarSimpleName = getJarSimpleName(arr[i]);\n String manifestFile = manifestElement.getFile();\n manifestFile = manifestFile.replace(\"\\\\\", \"/\");\n\n if (manifestFile.startsWith(\"file:/\")) {\n manifestFile = manifestFile.substring(\"file:/\".length());\n }\n\n manifestFile = manifestFile.substring(0,\n manifestFile.indexOf(\"!/META-INF/MANIFEST.MF\"));\n manifestFile = manifestFile.substring(0, manifestFile.lastIndexOf('/'));\n\n if (!StringUtils.isNullOrEmpty(jarSimpleName)) {\n String jarAbsolutePath = \"\";\n if (arr[i].startsWith(\"file\")) {\n jarAbsolutePath = arr[i].substring(6, arr[i].length());\n } else {\n jarAbsolutePath = manifestFile + \"/\" + arr[i];\n }\n if (new File(jarAbsolutePath).exists()) {\n addJarToMap(jarAbsolutePath);\n } else {\n log.trace(\"File \\\"\" + jarAbsolutePath\n + \"\\\" is defined in /META-INF/MANIFEST.MF \\\"\"\n + manifestElement.getPath() + \"\\\", but does not exist!\");\n }\n }\n }\n }\n } catch (IOException ioe) {\n log.error(\"Unable to read the MANIFEST.MF file\", ioe);\n }\n }\n }\n }", "public static Object loadFromClassPath(String path) throws SlickException {\n\t\tObject o = new Object();\n\t\tInputStream in = IO_Object.class.getClassLoader().getResourceAsStream(path);\n\t\tObjectInputStream inStream;\n\t\ttry {\n\t\t\tinStream = new ObjectInputStream(in);\n\t\t\to = inStream.readObject();\n\t\t\tinStream.close();\n\t\t\treturn o;\n\t\t} catch (Exception ex) {\n\t\t\tthrow new SlickException(ex.getMessage(), ex.getCause());\n\t\t}\n\t\t\n\t}", "static String readResource(String name) throws IOException {\n InputStream is = Server.class.getResourceAsStream(name);\n String value = new Scanner(is).useDelimiter(\"\\\\A\").next();\n is.close();\n return value;\n }", "public String getPathToJarFolder(){\n Class cls = ReadWriteFiles.class;\r\n ProtectionDomain domain = cls.getProtectionDomain();\r\n CodeSource source = domain.getCodeSource();\r\n URL url = source.getLocation();\r\n try {\r\n URI uri = url.toURI();\r\n path = uri.getPath();\r\n \r\n // get path without the jar\r\n String[] pathSplitArray = path.split(\"/\");\r\n path = \"\";\r\n for(int i = 0; i < pathSplitArray.length-1;i++){\r\n path += pathSplitArray[i] + \"/\";\r\n }\r\n \r\n return path;\r\n \r\n } catch (URISyntaxException ex) {\r\n LoggingAspect.afterThrown(ex);\r\n return null;\r\n }\r\n }", "public static File getFile(String resourceOrFile, Class<?> cls,\n boolean deleteTmpOnExit) throws FileNotFoundException {\n try {\n\n // jar:file:/home/.../blue.jar!/path/to/file.xml\n URI uri = getURL(resourceOrFile, cls).toURI();\n String uriStr = uri.toString();\n if (uriStr.startsWith(\"jar\")) {\n\n if (uriStr.endsWith(\"/\")) {\n throw new UnsupportedOperationException(\n \"cannot unjar directories, only files\");\n }\n\n String jarPath = uriStr.substring(4, uriStr.indexOf(\"!\"))\n .replace(\"file:\", \"\");\n String filePath = uriStr.substring(uriStr.indexOf(\"!\") + 2);\n\n JarFile jarFile = new JarFile(jarPath);\n assert (jarFile.size() > 0) : \"no jarFile at \" + jarPath;\n\n Enumeration<JarEntry> entries = jarFile.entries();\n\n while (entries.hasMoreElements()) {\n\n JarEntry jarEntry = entries.nextElement();\n if (jarEntry.toString().equals(filePath)) {\n InputStream input = jarFile.getInputStream(jarEntry);\n assert (input != null) : \"empty is for \" + jarEntry;\n return tmpFileFromStream(input, filePath,\n deleteTmpOnExit);\n }\n }\n assert (false) : \"file\" + filePath + \" not found in \" + jarPath;\n return null;\n } else {\n return new File(uri);\n }\n\n } catch (URISyntaxException e) {\n throw new FileNotFoundException(resourceOrFile);\n } catch (IOException e) {\n throw new FileNotFoundException(resourceOrFile);\n }\n }", "void implementJar(Class<?> token, Path jarFile) throws ImplerException;", "private static InputStream getStream(String inResName) {\n\n ClassLoader loader = Thread.currentThread().getContextClassLoader();\n InputStream is = loader.getResourceAsStream(inResName);\n if (is == null) {\n log.error(\"Resource '\" + inResName + \"' not found in classpath\");\n }\n return is;\n\n }", "public static Object readObjectFromFile(String filename)\n/* */ throws IOException, ClassNotFoundException\n/* */ {\n/* 122 */ return readObjectFromFile(new File(filename));\n/* */ }", "public String readResource(String resourcePath) throws IOException {\n InputStream resourceStream = this.getClass().getResourceAsStream(resourcePath);\n StringBuilder builder = new StringBuilder();\n int ch;\n while ((ch = resourceStream.read()) != -1) {\n builder.append((char) ch);\n }\n return builder.toString();\n }", "private String getInstanceFromFile() throws IOException{\n StringBuilder instance = new StringBuilder();\n boolean over = false;\n while(!over){\n char c = (char) reader.read();\n if(c == '\\n')\n over = true;\n else\n instance.append(c);\n }\n return instance.toString();\n }", "protected abstract String getResourcePath();", "private List<String> readSrc(){\n //daclarations\n InputStream stream;\n List<String> lines;\n String input;\n BufferedReader reader;\n StringBuilder buf;\n\n //Inlezen van bestand\n stream = this.getClass().getResourceAsStream(RESOURCE);\n lines = new LinkedList<>();\n\n // laad de tekst in \n reader = new BufferedReader(new InputStreamReader(stream));\n buf = new StringBuilder();\n\n if(stream != null){\n try{\n while((input = reader.readLine()) != null){\n buf.append(input);\n System.out.println(input);\n lines.add(input);\n }\n } catch(IOException ex){\n System.out.println(ex);// anders schreeuwt hij in mijn gezicht:\n }\n }\n return lines;\n }", "private static <T> InputStream getPropertiesFile(Class<T> clazz, ULocale locale) {\r\n String localeStr = \"\";\r\n if(locale != null) {\r\n localeStr = '_' + locale.getName();\r\n }\r\n String filePath = clazz.getName().replace(DOT, SLASH) + localeStr + PROPERTIES_EXT;\r\n return clazz.getClassLoader().getResourceAsStream(filePath);\r\n }", "private InputStream findStreamInClasspathOrFileSystem(String url) throws IOException {\n\t\tInputStream is = this.getClass().getClassLoader().getResourceAsStream(url);\n\t\t// if not found in the CLASSPATH, load from the file system\n\t\tif (is == null)\n\t\t\tis = new FileInputStream(url);\n\t\treturn is;\n\t}", "public static String readFromFile(String filename) {\n InputStream is = ResourceUtils.class.getClassLoader().getResourceAsStream(filename);\n return convertStreamToString(is);\n\n }", "public interface CartridgeLoader {\n\n public abstract InputStream getFile(String the_target)\n throws FileNotFoundException, IOException;\n\n}", "protected static InputStream inputStreamFromClasspath(String path) {\n return Thread.currentThread().getContextClassLoader().getResourceAsStream(path);\n }", "public static String getJarPath() {\n String classPath = \"/\" + JavaUtils.class.getName();\n classPath = classPath.replace(\".\", \"/\") + \".class\";\n try {\n URL url = JavaUtils.class.getResource(classPath);\n String path = URLDecoder.decode(url.getPath(), \"UTF-8\");\n path = URLDecoder.decode(new URL(path).getPath(), \"UTF-8\");\n int bang = path.indexOf(\"!\");\n if (bang >= 0) {\n path = path.substring(0, bang);\n }\n return path;\n } catch (Exception e) {\n ReportingUtils.logError(e, \"Unable to get path of jar\");\n return \"\";\n }\n }", "public void loadClassAndPrint() throws MalformedURLException {\n\t\tURL url = this.getClass().getResource(\"/\");\n\t\tSystem.out.println(url);\n\n\t\tURLClassLoader urlClassLoader = new URLClassLoader(new URL[]{url}, null);\n\n//\t\tURL classUrl = urlClassLoader.findResource(\"ConsolePrintString.class\");\n//\t\tSystem.out.println(classUrl);\n\n\t\ttry {\n\t\t\tClass<?> printStringClass = urlClassLoader.loadClass(\"com.classloader.changed.ConsolePrintString\");\n\t\t\tprintClassLoaderInfo(printStringClass.getClassLoader());\n\t\t\tObject object = printStringClass.newInstance();\n\n\t\t\tMethod method = printStringClass.getDeclaredMethod(\"print\", String.class);\n\t\t\tmethod.invoke(object, \"test\");\n\n//\t\t\tprintStringClass.getMethod(\"print\").invoke(object, \"test\");\n//\t\t\tPrintString printString = (PrintString) printStringClass.newInstance();\n//\t\t\tprintString.print(\"test message\");\n\t\t}\n\t\tcatch (Exception e) {\n\t\t\te.printStackTrace();\n\t\t\tthrow new RuntimeException(e);\n\t\t}\n\t}", "private static File extractFromJar(String resource, String fileName, String suffix) throws IOException {\n URL res = Main.class.getResource(resource);\n\n // put this jar in a file system so that we can load jars from there\n File tmp;\n try {\n tmp = File.createTempFile(fileName,suffix);\n } catch (IOException e) {\n String tmpdir = System.getProperty(\"java.io.tmpdir\");\n IOException x = new IOException(\"Hudson has failed to create a temporary file in \" + tmpdir);\n x.initCause(e);\n throw x;\n }\n InputStream is = res.openStream();\n try {\n OutputStream os = new FileOutputStream(tmp);\n try {\n copyStream(is,os);\n } finally {\n os.close();\n }\n } finally {\n is.close();\n }\n tmp.deleteOnExit();\n return tmp;\n }", "private BufferedImage readImageDataFromClasspath(String fileName)\n\t\t\tthrows IOException {\n\t\tInputStream in = this.getClass().getClassLoader().getResourceAsStream(\n\t\t\t\tfileName);\n\n\t\treturn ImageIO.read(in);\n\t}", "<T> T readJson(FsPath path, Class<T> clazz);", "java.lang.String getClasspath(int index);", "java.lang.String getClasspath(int index);", "public void ExtractFileFromJar()\n\t{\n\t\tString thisDir = getClass().getResource(\"\").getPath();\n\t\t\n\t\tif(thisDir.contains(\"file:\")) //Mac system path\n\t\t\tthisDir= thisDir.replace(\"file:\", \"\");\n\t\telse //Windows system path \"/C:/\", we need to get rid of the first '/'\n\t\t\tthisDir= thisDir.substring(1);\n\t\t\n\t\t//System.out.println(\"thisDir is \"+thisDir);\n\t\tString jarPath = thisDir.replace(\"!/data/\", \"\"); //Get path of jar file\n\t\tint lastSlashIndex = jarPath.lastIndexOf(\"/\");\n\t\tjarFileName = new String(jarPath.substring(lastSlashIndex+1));\n\t\tdestDir = thisDir.replace(jarFileName+\"!/data/\", \"\"); //Set destDir as the current folder in which jar file sits\n\n\t\t//Find Jar file\n\t\ttry {\n\t\t\tFile jarFile = new File(jarPath);\n\t\t\tif (jarFile.isDirectory() || !jarFile.exists()) { //If we cant find jar File in this jarPath\n\t\t\t\t//In windows it is like this \"C:/Users/Esheen/Desktop/ConnChem_1.1.0/Simulation/data/\" \n\t\t\t\tFile newJarfile = new File(jarPath);\n\t\t\t\tString parent = newJarfile.getParentFile().getParent();\n\t\t\t\tparent = parent.concat(new String(\"\\\\\"+jarFileName));\n\t\t\t\t\n\t\t\t\tjarPath= new String(parent);\n\t\t\t\t\n\t\t\t} \n\t\t\tjava.util.jar.JarFile jar = new java.util.jar.JarFile(jarPath);\n\t\t\t\n\t\t\t//Unzip database from jar file\n\t\t\tZipEntry entry = jar.getEntry(\"data/chemdb\");\n\t\t\tFile outputFile = new File(destDir, dbFileName);\n\t\t\t\n\t\t\t\tif (entry.isDirectory()) { // if its a directory, create it\n\t\t\t\t\toutputFile.mkdir();\n\t\t\t\t}\n\t\t\t\tInputStream in = jar.getInputStream(entry);\n\t\t\t\tFileOutputStream fos = new java.io.FileOutputStream(outputFile);\n\t\t\t\twhile (in.available() > 0) { // write contents of 'is' to 'fos'\n\t\t\t\t\tfos.write(in.read());\n\t\t\t\t}\n\t\t\t\tfos.close();\n\t\t\t\tin.close();\n\n\t\t\t\n\t\t} catch (IOException e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t}", "public static void loadFileFromClasspath(final String aFile)\n\t{\n\t\ttry\n\t\t{\n\t\t\tfinal PathMatchingResourcePatternResolver resolver = new PathMatchingResourcePatternResolver(classLoader);\n\t\t\tfinal Resource resource = resolver.getResource(aFile);\n\t\t\tif (resource == null)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tfinal InputStream inputStream = resource.getInputStream();\n\t\t\tcreateTransformer(inputStream, resource.getDescription());\n\t\t}\n\t\tcatch (final Exception e)\n\t\t{\n\t\t\tlogger.warn(\"Unable to load file \" + aFile, e);\n\t\t}\n\n\t}", "public void load() throws ClassNotFoundException, IOException;", "private InputSource classpathLookup(ResourceLocation matchingEntry) {\n\n InputSource source = null;\n\n Path cp = classpath;\n if (cp != null) {\n cp = classpath.concatSystemClasspath(\"ignore\");\n } else {\n cp = (new Path(getProject())).concatSystemClasspath(\"last\");\n }\n AntClassLoader loader = getProject().createClassLoader(cp);\n\n //\n // for classpath lookup we ignore the base directory\n //\n InputStream is\n = loader.getResourceAsStream(matchingEntry.getLocation());\n\n if (is != null) {\n source = new InputSource(is);\n URL entryURL = loader.getResource(matchingEntry.getLocation());\n String sysid = entryURL.toExternalForm();\n source.setSystemId(sysid);\n log(\"catalog entry matched a resource in the classpath: '\"\n + sysid + \"'\", Project.MSG_DEBUG);\n }\n\n return source;\n }", "@Override\n public InputStream open() throws IOException {\n return getClass().getClassLoader().getResourceAsStream(name);\n }", "private static InputStream getResourceAsStream(final String filename) throws IOException {\n\t\t// Try to load resource from jar\n\t\tInputStream stream = TextureLoader.class.getResourceAsStream(filename);\n\t\t// If not found in jar, then load from disk\n\t\tif (stream == null) {\n\t\t\treturn new BufferedInputStream( new FileInputStream(filename) );\n\t\t} else {\n\t\t\treturn stream;\n\t\t}\n\t}", "protected abstract InputStream getStream(String resource);", "public Resource load(String filename) throws MalformedURLException;", "private Object loadObject(File dir) throws FileNotFoundException, IOException, ClassNotFoundException {\r\n FileInputStream fis = new FileInputStream(dir);\r\n ObjectInputStream ois = new ObjectInputStream(fis);\r\n Object tmp = ois.readObject();\r\n ois.close();\r\n return tmp;\r\n }", "public JPClass getParsedClass(File f) throws Exception;", "private Object getFile(String path) throws Exception {\t\t\t\n\t\t \n\t\t FileInputStream fileIn = new FileInputStream(path);\n ObjectInputStream objectIn = new ObjectInputStream(fileIn);\n\n Object obj = objectIn.readObject();\n objectIn.close();\n \n return obj;\t\t\n\t}", "public static void main(String[] args) throws IOException {\n\n\t\t// get path to rt.jar file\n\t\tString rtPath = args[0];\n\t\tFile rtFile = new File(rtPath);\n\t\tif (!rtFile.isFile()) {\n\t\t\tSystem.err.println(\"File not found: \" + rtFile.getAbsolutePath());\n\t\t\tSystem.exit(1);\n\t\t}\n\n\t\t// load all classes from rt.jar file into memory\n\t\tClasspathLoader loader = LoaderBuilder.create().forClassLoader(\"Runtime\").buildClasspathLoader();\n\t\tClasspath classpath = loader.load(Collections.singletonList(rtFile));\n\t\tJarFile jarFile = classpath.getJarFiles().get(0);\n\t\tList<ClassDef> classDefs = jarFile.getClassDefs();\n\n\t\t// list of packages which will be added to resource file\n\t\tList<String> includedPackageNames = Arrays.asList(\n\t\t\t\t\"com.sun.net.httpserver\", \"com.sun.xml.internal.ws.addressing\",\n\t\t\t\t\"java.applet\", \"java.awt\", \"java.beans\", \"java.io\", \"java.lang\", \"java.math\", \"java.net\", \"java.nio\", \"java.rmi\", \"java.security\", \"java.sql\", \"java.text\", \"java.time\", \"java.util\",\n\t\t\t\t\"javax.activation\", \"javax.annotation\", \"javax.imageio\", \"javax.jws\", \"javax.management\", \"javax.naming\", \"javax.net\", \"javax.script\", \"javax.security.auth\", \"javax.sql\", \"javax.transaction\", \"javax.xml\",\n\t\t\t\t\"org.w3c.dom\", \"org.xml.sax\",\n\t\t\t\t\"sun.misc\"\n\t\t);\n\n\t\t// split into included classes (class defs) and excluded classes (names)\n\t\tList<ClassDef> includedClassDefs = new ArrayList<>();\n\t\tList<String> excludedClassNames = new ArrayList<>();\n\t\tfor (ClassDef classDef : classDefs) {\n\t\t\tString className = classDef.getClassName();\n\t\t\tboolean include = includedPackageNames.stream().anyMatch(p -> className.startsWith(p + \".\"));\n\t\t\tif (include) {\n\t\t\t\tincludedClassDefs.add(classDef);\n\t\t\t} else {\n\t\t\t\texcludedClassNames.add(className);\n\t\t\t}\n\t\t}\n\n\t\t// open compressed output stream to test resource file\n\t\tString resourcePath = \"./src/test/resources/classes-oracle-jdk-1.8.0_144.dat.gz\";\n\t\tFile resourceFile = new File(resourcePath);\n\t\ttry (FileOutputStream fos = new FileOutputStream(resourceFile)) {\n\t\t\ttry (GZIPOutputStream zos = new GZIPOutputStream(fos)) {\n\t\t\t\ttry (DataOutputStream dos = new DataOutputStream(zos)) {\n\t\t\t\t\t// write list of included class definitions\n\t\t\t\t\tdos.writeInt(includedClassDefs.size());\n\t\t\t\t\tfor (ClassDef classDef : includedClassDefs) {\n\t\t\t\t\t\tClassDefUtils.write(classDef, dos);\n\t\t\t\t\t}\n\t\t\t\t\t// write list of excluded class names\n\t\t\t\t\tdos.writeInt(excludedClassNames.size());\n\t\t\t\t\tfor (String className : excludedClassNames) {\n\t\t\t\t\t\tdos.writeUTF(className);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tSystem.out.println(\"Runtime file : \" + rtFile.getAbsolutePath());\n\t\tSystem.out.println(\"Total classes found: \" + classDefs.size());\n\t\tSystem.out.println(\"Included classes : \" + includedClassDefs.size());\n\t\tSystem.out.println(\"Excluded classes : \" + excludedClassNames.size());\n\t\tSystem.out.println(\"Resource file : \" + resourceFile.getAbsolutePath());\n\t\tSystem.out.println(\"Final file size : \" + FileUtils.formatFileSize(resourceFile.length()));\n\t}", "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 }", "@Override\n public void load() throws IOException, ClassNotFoundException {\n \n }", "private void readObject(final ObjectInputStream in) throws IOException, ClassNotFoundException {\n try {\n location = IOHelper.readData(new StreamInputSource(in));\n } catch (final IOException | ClassNotFoundException e) {\n throw e;\n } catch (final Exception e) {\n throw new IOException(e);\n }\n }", "ResourceLocation resolve(String path);", "private static URL[] findJARs() {\n\tFilenameFilter filter = new FilenameFilter() {\n\t\tpublic boolean accept(File dir, String name) {\n\t\t\tString lcname = name.toLowerCase();\n//System.out.println(lcname+\" => \"+(lcname.endsWith(\".jar\") && !lcname.startsWith(\"multivalent\")));\n\t\t\treturn lcname.endsWith(\".jar\") && !lcname.startsWith(\"multivalent\")/*no snapshots*/ && new File(dir, name).canRead();\n\t\t}\n\t};\n\n\t// look for JARs in same directory (or, during development, in c:/temp)\n//\tFile dir;\n\tString jar = URIs.decode/*in case space in path*/(Multivalent.class.getResource(\"Multivalent.class\").toString());\n//System.out.println(\"Bootstrap res = \"+jar);\n\tString top;\n\tif (jar.startsWith(\"jar:\")) { // deployment: e.g., \"jar:file:/C:/temp/Multivalent20011127.jar!/multivalent/Multivalent.class\"\n\t\tjar = jar.substring(\"jar:file:\".length(), jar.indexOf('!'));\n\t\ttop = jar.substring(0, jar.lastIndexOf('/')+1);\n\t//} else if (new File(\"/c:/temp\").exists()) { // my development => CLASSPATH\n\t//\ttop = \"/c:/temp\";\n\t\t// CLASSPATH is selfsame JAR -- ignore as ClassLoader gets anyhow\n\n\t} else { // others' development: e.g., \"file:/D:/prj/Multivalent/www/jar/multivalent/Multivalent.class\"\n\t\tint inx = jar.lastIndexOf('/'); // chop \"Multivalent.class\"\n\t\tinx = jar.lastIndexOf('/', inx-1); // chop \"multivalent\"\n\n\t\tjar = jar.substring(\"file:\".length(), inx+1);\n//System.out.println(\"jar = \"+jar);\n\t\ttop = jar;\n\t}\n\n\n\tList urls = new ArrayList(20);\n\n\tif (standalone_) System.out.println(\"Searching for JARs in \"+top);\n\ttry {\n\t\tFile[] f = new File(top).listFiles(filter);\n\t\tfor (int i=0,imax=f.length; i<imax; i++) {\n\t\t\turls.add(f[i].toURI().toURL());\n\t\t\tif (standalone_) System.out.println(\"\\t\"+f[i]);\n\t\t}\n\t} catch (MalformedURLException canthappen) { System.err.println(canthappen/*f[i]*/); System.err.println(\"Move to different directory\"); }\n\n\treturn (URL[])urls.toArray(new URL[0]);\n }", "public Object readObject(String path) throws Exception{\n FileInputStream fis = new FileInputStream(path);\n ObjectInputStream ois = new ObjectInputStream(fis);\n\n return ois.readObject();\n }" ]
[ "0.6325339", "0.6014968", "0.5947269", "0.5944533", "0.5803251", "0.57674164", "0.5734069", "0.5725754", "0.5712476", "0.5680995", "0.56615853", "0.5655229", "0.5650052", "0.56497824", "0.56489956", "0.5648792", "0.5617679", "0.5595867", "0.55602896", "0.55496764", "0.55493206", "0.5518989", "0.5500054", "0.5498824", "0.54577184", "0.5455013", "0.54518294", "0.54488844", "0.5445677", "0.5437458", "0.5432204", "0.54239726", "0.5405171", "0.53969896", "0.5394677", "0.53895503", "0.53745884", "0.5367559", "0.5366473", "0.5347276", "0.53248096", "0.53240544", "0.5323128", "0.53159934", "0.53149635", "0.53005195", "0.52964747", "0.5285235", "0.5282136", "0.52701634", "0.5269339", "0.52631205", "0.52623576", "0.5254717", "0.5242214", "0.52395856", "0.52277446", "0.52260345", "0.52247477", "0.5219586", "0.52149355", "0.5198753", "0.5196316", "0.5187059", "0.5183959", "0.5178349", "0.51766443", "0.517396", "0.51710933", "0.51552534", "0.515393", "0.51536894", "0.5149607", "0.5142156", "0.5136399", "0.51179063", "0.51112723", "0.51027906", "0.5102498", "0.51023364", "0.51016665", "0.51016665", "0.50949335", "0.5093992", "0.50894946", "0.5087003", "0.5085633", "0.5072227", "0.5065027", "0.50607944", "0.5048073", "0.5043143", "0.5042076", "0.50413823", "0.50282735", "0.5022966", "0.50203115", "0.5019432", "0.5017475", "0.50145817" ]
0.6419711
0
method to read complete file in string[] array from classpath inside jar based on class object
public String[] ReadAllFileLines_FromClassPath(String sFileName) { String[] satemp = null; try { InputStream is = getClass().getClassLoader().getResourceAsStream(sFileName); satemp = getStringArrayFromInputStream(is); } catch (Exception e) { satemp = null; throw new Exception("ReadAllFileLines_FromClassPath : " + e.toString()); } finally { return satemp; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public String[] readClasses();", "public List<Clazz> loadAndScanJar()\n\t\t\tthrows ClassNotFoundException, ZipException, IOException {\n\t\tsuper.addURL(new File(path).toURI().toURL());\n\t\tList<Clazz> representations=new ArrayList<Clazz>();\n\n\t\t// Count the classes loaded\n\t\t// Your jar file\n\t\tFile f = new File(path);\n\n\t\tJarFile jar = new JarFile(path);\n\t\t// Getting the files into the jar\n\t\tEnumeration<? extends JarEntry> enumeration = jar.entries();\n\n\t\t// Iterates into the files in the jar file\n\t\twhile (enumeration.hasMoreElements()) {\n\t\t\tZipEntry zipEntry = enumeration.nextElement();\n\t\t\t// Is this a class?\n\t\t\tif (zipEntry.getName().endsWith(\".class\")) {\n\t\t\t\t// Relative path of file into the jar.\n\t\t\t\tString className = zipEntry.getName();\n\t\t\t\t// Complete class name\n\t\t\t\tclassName = className.replace(\".class\", \"\").replace(\"/\", \".\");\n\t\t\t\t// Load class definition from JVM\n\t\t\t\tClass<?> clazz = this.loadClass(className);\n\t\t\t\ttry {\n\t\t\t\t\t\tClazz actual = new Clazz(clazz.getName());\n\t\t\t\t\t\tfor (java.lang.reflect.Method m : clazz.getMethods()) {\n\t\t\t\t\t\t\tactual.addMethod(m.getReturnType().getName(), m.getName(), getScope(m.getModifiers()),\n\t\t\t\t\t\t\t\t\tModifier.isAbstract(m.getModifiers()), Modifier.isStatic(m.getModifiers()));\n\t\t\t\t\t\t}\n\t\t\t\t\t\tfor (java.lang.reflect.Field m : clazz.getFields()) {\n\t\t\t\t\t\t\tactual.addVariable(m.getType().getName(), m.getName(), getScope(m.getModifiers()),\n\t\t\t\t\t\t\t\t\tModifier.isStatic(m.getModifiers()));\n\t\t\t\t\t\t}\n\t\t\t\t\t\trepresentations.add(actual);\n\n\t\t\t\t} catch (ClassCastException e) {\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tjar.close();\n\t\treturn representations;\n\t}", "private static URL[] findJARs() {\n\tFilenameFilter filter = new FilenameFilter() {\n\t\tpublic boolean accept(File dir, String name) {\n\t\t\tString lcname = name.toLowerCase();\n//System.out.println(lcname+\" => \"+(lcname.endsWith(\".jar\") && !lcname.startsWith(\"multivalent\")));\n\t\t\treturn lcname.endsWith(\".jar\") && !lcname.startsWith(\"multivalent\")/*no snapshots*/ && new File(dir, name).canRead();\n\t\t}\n\t};\n\n\t// look for JARs in same directory (or, during development, in c:/temp)\n//\tFile dir;\n\tString jar = URIs.decode/*in case space in path*/(Multivalent.class.getResource(\"Multivalent.class\").toString());\n//System.out.println(\"Bootstrap res = \"+jar);\n\tString top;\n\tif (jar.startsWith(\"jar:\")) { // deployment: e.g., \"jar:file:/C:/temp/Multivalent20011127.jar!/multivalent/Multivalent.class\"\n\t\tjar = jar.substring(\"jar:file:\".length(), jar.indexOf('!'));\n\t\ttop = jar.substring(0, jar.lastIndexOf('/')+1);\n\t//} else if (new File(\"/c:/temp\").exists()) { // my development => CLASSPATH\n\t//\ttop = \"/c:/temp\";\n\t\t// CLASSPATH is selfsame JAR -- ignore as ClassLoader gets anyhow\n\n\t} else { // others' development: e.g., \"file:/D:/prj/Multivalent/www/jar/multivalent/Multivalent.class\"\n\t\tint inx = jar.lastIndexOf('/'); // chop \"Multivalent.class\"\n\t\tinx = jar.lastIndexOf('/', inx-1); // chop \"multivalent\"\n\n\t\tjar = jar.substring(\"file:\".length(), inx+1);\n//System.out.println(\"jar = \"+jar);\n\t\ttop = jar;\n\t}\n\n\n\tList urls = new ArrayList(20);\n\n\tif (standalone_) System.out.println(\"Searching for JARs in \"+top);\n\ttry {\n\t\tFile[] f = new File(top).listFiles(filter);\n\t\tfor (int i=0,imax=f.length; i<imax; i++) {\n\t\t\turls.add(f[i].toURI().toURL());\n\t\t\tif (standalone_) System.out.println(\"\\t\"+f[i]);\n\t\t}\n\t} catch (MalformedURLException canthappen) { System.err.println(canthappen/*f[i]*/); System.err.println(\"Move to different directory\"); }\n\n\treturn (URL[])urls.toArray(new URL[0]);\n }", "public static String[] getResourceListing(Class<?> clazz, String path) throws\r\n URISyntaxException, IOException {\r\n URL dirURL = clazz.getClassLoader().getResource(path);\r\n\r\n if (dirURL != null && dirURL.getProtocol().equals(\"file\")) {\r\n /* A file path: easy enough */\r\n return new File(dirURL.toURI()).list();\r\n }\r\n\r\n if (dirURL == null) {\r\n /*\r\n * In case of a jar file, we can't actually find a directory. Have\r\n * to assume the same jar as clazz.\r\n */\r\n String me = clazz.getName().replace(\".\", \"/\") + \".class\";\r\n dirURL = clazz.getClassLoader().getResource(me);\r\n }\r\n\r\n if (dirURL != null && dirURL.getProtocol().equals(\"jar\")) {\r\n /* A JAR path */\r\n String jarPath = dirURL.getPath().substring(5, dirURL.getPath().indexOf(\"!\")); //strip out only the JAR file\r\n JarFile jar = new JarFile(URLDecoder.decode(jarPath, \"UTF-8\"));\r\n\r\n LOGGER.debug(\"Listing files in \" + jarPath);\r\n\r\n Enumeration<JarEntry> entries = jar.entries(); //gives ALL entries in jar\r\n Set<String> result = new HashSet<>(); //avoid duplicates in case it is a subdirectory\r\n while (entries.hasMoreElements()) {\r\n String name = entries.nextElement().getName();\r\n if (name.startsWith(path)) { //filter according to the path\r\n LOGGER.debug(\"Found in jar \" + name);\r\n String entry = name.replace(path + \"/\", \"\");\r\n LOGGER.debug(\"Keeping \" + entry);\r\n result.add(entry);\r\n }\r\n }\r\n jar.close();\r\n return result.toArray(new String[0]);\r\n\r\n } else {\r\n\r\n InputStream inputstream = clazz.getResourceAsStream(\"/\" + path);\r\n if (inputstream != null) {\r\n final InputStreamReader isr = new InputStreamReader(inputstream, StandardCharsets.UTF_8);\r\n final BufferedReader br = new BufferedReader(isr);\r\n\r\n Set<String> result = new HashSet<>(); //avoid duplicates in case it is a subdirectory\r\n String filename = null;\r\n while ((filename = br.readLine()) != null) {\r\n result.add(filename);\r\n }\r\n return result.toArray(new String[0]);\r\n }\r\n\r\n }\r\n\r\n throw new UnsupportedOperationException(\"Cannot list files for URL \" + dirURL);\r\n }", "@Test\n @Disabled(\"Not work in Java >=9\")\n void printAllClassJars() {\n var sysClassLoader = org.apache.commons.io.FileUtils.class.getClassLoader();\n var urLs = ((URLClassLoader) sysClassLoader).getURLs();\n for (var url : urLs) {\n System.out.println(url.getFile());\n }\n }", "private void loadJarsFromManifestFile( ClassLoader classLoader ) throws IOException {\n\n Enumeration<URL> manifestUrls = ((URLClassLoader) classLoader).findResources(\"META-INF/MANIFEST.MF\");\n Manifest manifest = null;\n URL manifestElement = null;\n\n if (manifestUrls != null) {\n while (manifestUrls.hasMoreElements()) {\n manifestElement = manifestUrls.nextElement();\n try (InputStream is = manifestElement.openStream()) {\n manifest = new Manifest(is);\n\n // get the 'Class-Path' value from the MANIFEST.MF file\n String manifestClassPathValue = manifest.getMainAttributes().getValue(\"Class-Path\");\n if (manifestClassPathValue != null) {\n log.trace(\"Parsing MANIFEST file \\\"\" + manifestElement.getPath());\n String[] arr = manifestClassPathValue.split(\" \");\n for (int i = 0; i < arr.length; i++) {\n // add listed jars from MANIFEST file to the map\n String jarSimpleName = getJarSimpleName(arr[i]);\n String manifestFile = manifestElement.getFile();\n manifestFile = manifestFile.replace(\"\\\\\", \"/\");\n\n if (manifestFile.startsWith(\"file:/\")) {\n manifestFile = manifestFile.substring(\"file:/\".length());\n }\n\n manifestFile = manifestFile.substring(0,\n manifestFile.indexOf(\"!/META-INF/MANIFEST.MF\"));\n manifestFile = manifestFile.substring(0, manifestFile.lastIndexOf('/'));\n\n if (!StringUtils.isNullOrEmpty(jarSimpleName)) {\n String jarAbsolutePath = \"\";\n if (arr[i].startsWith(\"file\")) {\n jarAbsolutePath = arr[i].substring(6, arr[i].length());\n } else {\n jarAbsolutePath = manifestFile + \"/\" + arr[i];\n }\n if (new File(jarAbsolutePath).exists()) {\n addJarToMap(jarAbsolutePath);\n } else {\n log.trace(\"File \\\"\" + jarAbsolutePath\n + \"\\\" is defined in /META-INF/MANIFEST.MF \\\"\"\n + manifestElement.getPath() + \"\\\", but does not exist!\");\n }\n }\n }\n }\n } catch (IOException ioe) {\n log.error(\"Unable to read the MANIFEST.MF file\", ioe);\n }\n }\n }\n }", "public void initFromClasspath() throws IOException {\n \t\tcontactNames = loadFromClassPath(\"contactNames\");\n \t\tgroupNames = loadFromClassPath(\"groupNames\");\n \t\tmessageWords = loadFromClassPath(\"messageWords\");\n \t}", "public static <T extends Serializable> T[] deserialize(Class<T[]> tClass, String name) {\n T[] result = null;\n\n try {\n FileInputStream fileInputStream = new FileInputStream(BASE_DIRECTORY + name);\n ObjectInputStream objectInputStream = new ObjectInputStream(fileInputStream);\n result = tClass.cast(objectInputStream.readObject());\n objectInputStream.close();\n } catch (IOException e) {\n Logger.internalLog(\"SERIALIZER\", \"Could not find previous data.\");\n } catch (ClassNotFoundException e) {\n Logger.internalLog(\"SERIALIZER\", \"Something went wrong.\");\n }\n\n return result;\n }", "protected ArrayList<char[]> jarToFile(File file) throws IOException {\n\t\tJarFile jarFile = new JarFile(file);\n\t\tEnumeration<JarEntry> entries = jarFile.entries();\n\t\tArrayList<char[]> fileList = new ArrayList<char[]>();\n\t\tJarEntry curentry = null;\n\t\t\n\t\twhile (entries.hasMoreElements()){\n\t\t\tcurentry = entries.nextElement();\n\t\t\tif (isJavaFile(curentry)) {\n\t\t\t\tfileList.add(new File(curentry.getName().toString()));\n\t\t\t}\n\t\t\telse if (curentry.getName().endsWith(\".class\") || curentry.isDirectory()) {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t}\n\t\tjarFile.close();\n\t\treturn fileList;\n\t}", "@SuppressWarnings(\"unchecked\")\n @Override\n public Object[] resolvePath(String path) {\n if (path.startsWith( WEB_APP )) {\n String webpath = \"/\" + path.split( \":\" )[1];\n\n if (isJar( webpath )) {\n logger.debug( \"Found jar: {}\", webpath );\n\n return new InputStream[] { servletContext.getResourceAsStream( webpath ) };\n }\n\n Set<String> paths = servletContext.getResourcePaths( webpath );\n\n if (paths.size() > 0) {\n Iterator<String> itr = paths.iterator();\n List<InputStream> streams = new ArrayList<InputStream>();\n\n while (itr.hasNext()) {\n String source = itr.next();\n\n if (isJar( source )) {\n InputStream stream = servletContext.getResourceAsStream( source );\n\n if (stream != null) {\n logger.debug( \"Found jar: {}\", source );\n\n streams.add( stream );\n }\n }\n }\n\n return streams.toArray( new InputStream[streams.size()] );\n }\n\n }\n\n return null;\n }", "protected String[] readInFile(String filename) {\n Vector<String> fileContents = new Vector<String>();\n try {\n InputStream gtestResultStream1 = getClass().getResourceAsStream(File.separator +\n TEST_TYPE_DIR + File.separator + filename);\n BufferedReader reader = new BufferedReader(new InputStreamReader(gtestResultStream1));\n String line = null;\n while ((line = reader.readLine()) != null) {\n fileContents.add(line);\n }\n }\n catch (NullPointerException e) {\n CLog.e(\"Gest output file does not exist: \" + filename);\n }\n catch (IOException e) {\n CLog.e(\"Unable to read contents of gtest output file: \" + filename);\n }\n return fileContents.toArray(new String[fileContents.size()]);\n }", "public static String[] listFilesAsArray() {\n\t\t// Recursively find all .java files\n\t\tFile path = new File(Project.pathWorkspace());\n\t\tFilenameFilter filter = new FilenameFilter() {\n\n\t\t\tpublic boolean accept(File directory, String fileName) {\n\t\t\t\treturn fileName.endsWith(\".java\");\n\t\t\t}\n\t\t};\n\t\tCollection<File> files = listFiles(path, filter, true);\n\n\t\tArrayList<File> t = new ArrayList<File>(files);\n\t\tfor (int i = 0; i < t.size(); i++) {\n\t\t\tString s = t.get(i).getAbsolutePath();\n\t\t\tif (s.contains(\"XX\") || s.contains(\"testingpackage\") || s.contains(\"datageneration\")) {\n\t\t\t\tt.remove(t.get(i));\n\t\t\t\ti--;\n\t\t\t}\n\t\t}\n\t\tfiles = t;\n\n\t\t// Convert the Collection into an array\n\t\tFile[] allJavaFiles = new File[files.size()];\n\t\tfiles.toArray(allJavaFiles);\n\n\t\tString[] allTestClasses = new String[allJavaFiles.length];\n\t\tString temp = \"\";\n\n\t\t// convert file path to full package declaration for the class\n\t\tfor (int i = 0; i < allJavaFiles.length; i++) {\n\t\t\ttemp = allJavaFiles[i].toString();\n\t\t\ttemp = temp.replace(\".java\", \"\").replace(\"\\\\\", \".\"); // remove .java convert backslash\n\t\t\tif (temp.indexOf(\"com.textura\") < 0) {\n\t\t\t\tallTestClasses[i] = \"null\";\n\t\t\t} else {\n\t\t\t\ttemp = temp.substring(temp.indexOf(\"com.textura\"));\n\t\t\t\ttemp = temp.replace(\"com.\", \"\");\n\t\t\t\tallTestClasses[i] = temp;\n\t\t\t}\n\t\t}\n\t\treturn allTestClasses;\n\t}", "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 }", "private byte[] createImageArray(Object parentClass, String path, int fileSize) {\r\n \r\n int count = 0;\r\n \r\n BufferedInputStream imgStream = new BufferedInputStream(this.getClass().getResourceAsStream(path));\r\n \r\n if (imgStream != null) {\r\n \r\n byte buff[] = new byte[fileSize];\r\n \r\n try {\r\n count = imgStream.read(buff);\r\n } catch (IOException e) {\r\n strErrorMsg = \"Error de lecutra del archivo: \" + path;\r\n System.out.println(strErrorMsg + \" \" + e.getMessage());\r\n }\r\n \r\n try {\r\n imgStream.close();\r\n } catch (IOException e) {\r\n strErrorMsg = \"Error al cerrar el archivo: \" + path;\r\n System.out.println(strErrorMsg + \" \" + e.getMessage());\r\n }\r\n \r\n if (count <= 0) {\r\n \r\n strErrorMsg = \"Error del archivo: \" + path;\r\n\r\n return null;\r\n \r\n }\r\n \r\n return buff;\r\n \r\n } else {\r\n \r\n strErrorMsg = \"No se puede encontrar el archivo: \" + path;\r\n System.out.println(strErrorMsg + \" \" );\r\n return null;\r\n \r\n }\r\n \r\n }", "static URL[] getClassPath() throws MalformedURLException {\n List<URL> classPaths = new ArrayList<>();\n\n classPaths.add(new File(\"target/test-classes\").toURI().toURL());\n\n // Add this test jar which has some frontend resources used in tests\n URL jar = getTestResource(\"jar-with-frontend-resources.jar\");\n classPaths.add(jar);\n\n // Add other paths already present in the system classpath\n ClassLoader classLoader = ClassLoader.getSystemClassLoader();\n URL[] urls = URLClassLoader.newInstance(new URL[] {}, classLoader)\n .getURLs();\n for (URL url : urls) {\n classPaths.add(url);\n }\n return classPaths.toArray(new URL[0]);\n }", "private static URL[] expandWildcardClasspath() {\n List<URL> ret = new ArrayList<URL>();\n int numBaseXJars = 0;\n String classpath = System.getProperty(\"java.class.path\");\n String[] classpathEntries = classpath.split(System.getProperty(\"path.separator\"));\n for( String currCP : classpathEntries ) {\n File classpathFile = new File(currCP);\n URI uri = classpathFile.toURI();\n URL currURL = null;\n try {\n currURL = uri.toURL();\n } catch (MalformedURLException e) {\n System.out.println(\"Ignoring classpath entry: \" + currCP);\n }\n if( currCP.endsWith( \"*\" ) ) {\n // This URL needs to be expanded\n try {\n File currFile = new File( URLDecoder.decode( currURL.getFile(), \"UTF-8\" ) );\n // Search the parent path for any files that end in .jar\n File[] expandedJars = currFile.getParentFile().listFiles(\n new FilenameFilter() {\n public boolean accept( File aDir, String aName ) {\n return aName.endsWith( \".jar\" );\n }\n } );\n // Add the additional jars to the new search path\n if( expandedJars != null ) {\n for( File currJar : expandedJars ) {\n ret.add( currJar.toURI().toURL() );\n if( currJar.getName().matches(BASEX_LIB_MATCH) ) {\n ++numBaseXJars;\n }\n }\n } else {\n // could not expand due to some error, we can try to\n // proceed with out these jars\n System.out.println( \"WARNING: could not expand classpath at: \"+currFile.toString() );\n }\n } catch( Exception e ) {\n // could not expand due to some error, we can try to\n // proceed with out these jars\n e.printStackTrace();\n }\n }\n else {\n // Just use this unmodified\n ret.add( currURL );\n if( currURL.getFile().matches(BASEX_LIB_MATCH) ) {\n ++numBaseXJars;\n }\n }\n }\n // we've had trouble finding multiple jars of the BaseX of different versions\n // so if we find more than we will accept the one that matches the \"prefered\" version\n // which is hard coded to the version used when this workspace was created\n if( numBaseXJars > 1 ) {\n for( Iterator<URL> it = ret.iterator(); it.hasNext(); ) {\n URL currURL = it.next();\n if( currURL.getFile().matches(BASEX_LIB_MATCH) && !currURL.getFile().matches(PREFERED_BASEX_VER) ) {\n it.remove();\n --numBaseXJars;\n }\n }\n }\n if( numBaseXJars == 0 ) {\n System.out.println( \"WARNING: did not recongnize any BaseX jars in classpath. This may indicate missing jars or duplicate version mismatch.\");\n }\n return ret.toArray( new URL[ 0 ] );\n }", "private static List<Class<?>>\n getClassNameFromJar(JarFile jarFile, String packageName, boolean isRecursion, String postfix) throws ClassNotFoundException {\n LOG.info(\"get Class List from jar \" + jarFile.getName());\n\n List<Class<?>> lc = new ArrayList<>();\n\n lc = jarFile.stream()\n .filter(f -> !f.isDirectory())\n .map(f -> f.getName().replace(\"/\", \".\"))\n .filter(f -> f.startsWith(packageName) && f.endsWith(postfix) && !f.contains(\"$\"))\n .map(f -> f.replace(postfix, \"\"))\n .map(f -> {\n try {\n return Class.forName(f);\n } catch (ClassNotFoundException e) {\n LOG.error(\"cast classstr \" + f + \" to class failed\");\n throw new RuntimeException(e);\n }\n })\n .collect(Collectors.toList());\n\n return lc;\n }", "@Classpath\n @Incremental\n public abstract ConfigurableFileCollection getJavaResourceFiles();", "String[] getResourceListing(Class<?> clazz, String path) throws URISyntaxException, IOException{\n\t\tURL dirURL = clazz.getClassLoader().getResource(path);\n\t\tif(dirURL != null && dirURL.getProtocol().equals(\"file\")){\n\t\t\t/* A file path: easy enough */\n\t\t\treturn new File(dirURL.toURI()).list();\n\t\t}\n\t\tif(dirURL == null){\n\t\t\t// In case of a jar file, we can't actually find a directory. Have to assume the same jar as clazz.\n\t\t\tfinal String me = clazz.getName().replace(\".\", \"/\") + \".class\";\n\t\t\tdirURL = clazz.getClassLoader().getResource(me);\n\t\t}\n\t\tif(dirURL.getProtocol().equals(\"jar\")){\n\t\t\t// A JAR path\n\t\t\tfinal String jarPath = dirURL.getPath().substring(5, dirURL.getPath().indexOf(\"!\")); // strip out only the JAR file\n\t\t\tfinal JarFile jar = new JarFile(URLDecoder.decode(jarPath, \"UTF-8\"));\n\t\t\tfinal Enumeration<JarEntry> entries = jar.entries(); // gives ALL entries in jar\n\t\t\tfinal Set<String> result = new HashSet<>(); // avoid duplicates in case it is a subdirectory\n\t\t\twhile(entries.hasMoreElements()){\n\t\t\t\tfinal String name = entries.nextElement().getName();\n\t\t\t\tif(name.startsWith(path)){ // filter according to the path\n\t\t\t\t\tString entry = name.substring(path.length());\n\t\t\t\t\tint checkSubdir = entry.indexOf(\"/\");\n\t\t\t\t\tif(checkSubdir >= 0){\n\t\t\t\t\t\t// if it is a subdirectory, we just return the directory name\n\t\t\t\t\t\tentry = entry.substring(0, checkSubdir);\n\t\t\t\t\t}\n\t\t\t\t\tresult.add(entry);\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn result.toArray(new String[result.size()]);\n\t\t}\n\t\tthrow new UnsupportedOperationException(\"Cannot list files for URL \" + dirURL);\n\t}", "public abstract List<T> readObj(String path);", "public static String readAll(String filename) throws FileNotFoundException, IOException {\n String JAR = jarPrefix();\n boolean fromJar = false;\n if (filename.startsWith(JAR)) {\n fromJar = true;\n filename = filename.substring(JAR.length()).replace('\\\\', '/');\n }\n InputStream fis = null;\n int now = 0, max = 4096;\n if (!fromJar) {\n long maxL = new File(filename).length();\n max = (int) maxL;\n if (max != maxL)\n throw new IOException(\"File too big to fit in memory\");\n }\n byte[] buf;\n try {\n buf = new byte[max];\n fis = fromJar ? Util.class.getClassLoader().getResourceAsStream(filename) : new FileInputStream(filename);\n if (fis == null)\n throw new FileNotFoundException(\"File \\\"\" + filename + \"\\\" cannot be found\");\n while (true) {\n if (now >= max) {\n max = now + 4096;\n if (max < now)\n throw new IOException(\"File too big to fit in memory\");\n byte[] buf2 = new byte[max];\n if (now > 0)\n System.arraycopy(buf, 0, buf2, 0, now);\n buf = buf2;\n }\n int r = fis.read(buf, now, max - now);\n if (r < 0)\n break;\n now = now + r;\n }\n } catch (OutOfMemoryError ex) {\n System.gc();\n throw new IOException(\"There is insufficient memory.\");\n } finally {\n close(fis);\n }\n CodingErrorAction r = CodingErrorAction.REPORT;\n CodingErrorAction i = CodingErrorAction.IGNORE;\n ByteBuffer bbuf;\n String ans = \"\";\n try {\n // We first try UTF-8;\n bbuf = ByteBuffer.wrap(buf, 0, now);\n ans = Charset.forName(\"UTF-8\").newDecoder().onMalformedInput(r).onUnmappableCharacter(r).decode(bbuf).toString();\n } catch (CharacterCodingException ex) {\n try {\n // if that fails, we try using the platform's default charset\n bbuf = ByteBuffer.wrap(buf, 0, now);\n ans = Charset.defaultCharset().newDecoder().onMalformedInput(r).onUnmappableCharacter(r).decode(bbuf).toString();\n } catch (CharacterCodingException ex2) {\n // if that also fails, we try using \"ISO-8859-1\" which should\n // always succeed but may map some characters wrong\n bbuf = ByteBuffer.wrap(buf, 0, now);\n ans = Charset.forName(\"ISO-8859-1\").newDecoder().onMalformedInput(i).onUnmappableCharacter(i).decode(bbuf).toString();\n }\n }\n return convertLineBreak(ans);\n }", "public File findJarFileForClass(String type, String name) throws ClassNotFoundException {\n // On cherche la classe demandee parmi celles repertoriees lors du lancement de Kalimucho\n // Si on ne la trouve pas on recree la liste (cas ou le fichier jar aurait ete ajoute apres le demarrage)\n // Si on la trouve on revoie le fichier jar la contenant sinon on leve une exception\n int index=0;\n boolean trouve = false;\n while ((index<types.length) && (!trouve)) { // recherche du type\n if (type.equals(types[index])) trouve = true;\n else index++;\n }\n if (!trouve) throw new ClassNotFoundException(); // type introuvable\n else { // le type est connu on cherche la classe\n int essais = 0;\n while (essais != 2) {\n String fich = classesDisponibles[index].get(name);\n if (fich != null) { // classe repertoriee dans la liste\n essais = 2; // on renvoie le fichier\n return new File(Parameters.COMPONENTS_REPOSITORY+\"/\"+type+\"/\"+fich);\n }\n else { // la classe n'est pas dans la liste\n essais++;\n if (essais == 1) { // si on ne l'a pas deja fait on recree la liste a partir du depot\n rescanRepository();\n }\n }\n }\n throw new ClassNotFoundException(); // Classe introuvable meme apres avoir recree la liste\n }\n }", "@Classpath\n @Incremental\n public abstract ConfigurableFileCollection getFeatureJavaResourceFiles();", "private void loadJarsFromClasspath() {\n\n loadedJarsMap.clear();\n\n ClassLoader classLoader = getClass().getClassLoader();\n URL[] urls = null;\n do {\n //check if the class loader is instance of URL and cast it\n if (classLoader instanceof URLClassLoader) {\n urls = ((URLClassLoader) classLoader).getURLs();\n } else {\n // if the ClassLoader is not instance of URLClassLoader we will break the cycle and log a message\n log.info(\"ClassLoader \" + classLoader\n + \" is not instance of URLClassLoader, so it will skip it.\");\n\n // if the ClassLoader is from JBoss, it is instance of BaseClassLoader,\n // we can take the ClassPath from a public method -> listResourceCache(), from JBoss-classloader.jar\n // this ClassLoader is empty, we will get the parent\n classLoader = classLoader.getParent();\n continue;\n }\n try {\n loadJarsFromManifestFile(classLoader);\n } catch (IOException ioe) {\n log.warn(\"MANIFEST.MF is loaded, so we will not search for duplicated jars!\");\n }\n\n // add all jars from ClassPath to the map\n for (int i = 0; i < urls.length; i++) {\n addJarToMap(urls[i].getFile());\n }\n\n // get the parent classLoader\n classLoader = classLoader.getParent();\n } while (classLoader != null);\n\n if (loadedJarsMap.isEmpty()) {\n // jars are not found, so probably no URL ClassLoaders are found\n throw new RuntimeException(\"Most probrably specific server is used without URLClassLoader instances!\");\n }\n }", "private List<String> readSrc(){\n //daclarations\n InputStream stream;\n List<String> lines;\n String input;\n BufferedReader reader;\n StringBuilder buf;\n\n //Inlezen van bestand\n stream = this.getClass().getResourceAsStream(RESOURCE);\n lines = new LinkedList<>();\n\n // laad de tekst in \n reader = new BufferedReader(new InputStreamReader(stream));\n buf = new StringBuilder();\n\n if(stream != null){\n try{\n while((input = reader.readLine()) != null){\n buf.append(input);\n System.out.println(input);\n lines.add(input);\n }\n } catch(IOException ex){\n System.out.println(ex);// anders schreeuwt hij in mijn gezicht:\n }\n }\n return lines;\n }", "public String ReadFile_FromClassPath(String sFileName) {\n String stemp = null;\n\n try {\n InputStream is = getClass().getClassLoader().getResourceAsStream(sFileName);\n stemp = getStringFromInputStream(is);\n\n } catch (Exception e) {\n stemp = null;\n throw new Exception(\"ReadFile_FromClassPath : \" + e.toString());\n } finally {\n return stemp;\n }\n }", "private Object[] fetchTextFile(String filePathString){\n try (Stream<String> stream = Files.lines(Paths.get(filePathString))) {\n return stream.toArray();\n }\n catch (IOException ioe){\n System.out.println(\"Could not find file at \" + filePathString);\n return null;\n }\n\n }", "String [][] importData (String path);", "public static List<String> mainReadFile(String[] args) throws IOException, URISyntaxException {\n List<String> exmp = new ArrayList<>();\n File initialFile = resolveFileFromResources(args[0]);\n // System.out.println(initialFile);\n ObjectMapper obM = getObjectMapper();\n Trades[] exmpTrade = obM.readValue(initialFile, Trades[].class);\n for (Trades trade : exmpTrade) {\n exmp.add(trade.getSymbol());\n }\n printJsonObject(exmp);\n //return Collections.emptyList();\n return exmp;\n }", "private void readSourceData() throws Exception {\n\t\tthis.fileDataList = new ArrayList<String>();\n\t\tReader reader = new Reader(this.procPath);\n\t\treader.running();\n\t\tthis.fileDataList = reader.getFileDataList();\n\t}", "private void addJarClasses(final Path location) {\n try (final JarFile jarFile = new JarFile(location.toFile())) {\n final Enumeration<JarEntry> entries = jarFile.entries();\n while (entries.hasMoreElements()) {\n final String entryName = entries.nextElement().getName();\n if (entryName.endsWith(\".class\"))\n classes.add(convertToQualifiedName(entryName));\n }\n } catch (IOException e) {\n throw new IllegalArgumentException(\"Could not read jar-file '\" + location + \"', reason: \" + e.getMessage());\n }\n }", "private URL[] urlsFromJARs(final String[] jarNames) throws MalformedURLException {\n URL[] urls = new URL[jarNames.length];\n for(int i = 0; i < urls.length; i++) {\n urls[i] = new URL(translateCodebase()+jarNames[i]);\n }\n return (urls);\n }", "static byte[] readResource(String name) throws IOException {\n byte[] buf = new byte[1024];\n\n InputStream in = Main.class.getResourceAsStream(name);\n ByteArrayOutputStream bout = new ByteArrayOutputStream();\n int n;\n while ((n = in.read(buf)) > 0) {\n bout.write(buf, 0, n);\n }\n try { in.close(); } catch (Exception ignored) { } \n\n return bout.toByteArray();\n }", "public static void main(String[] args) {\n\t\n\tList<Class<?>> test_classes = new ArrayList<Class<?>>(); //List of loaded classes\n\tList<String> class_names = new ArrayList<String>(); \n\tString[] jar_pathes = new String[args.length -1];\n\tSystem.arraycopy(args, 0, jar_pathes, 0, args.length-1);\n\t\n\tfor (String jar_path : jar_pathes) {\t\n\t\ttry {\n\t\t\tJarFile jarFile = new java.util.jar.JarFile(jar_path);\n\t\t\tEnumeration<JarEntry> jar_entries_enum = jarFile.entries();\n\t\t\t\n\t\t\tURL[] urls = { new URL(\"jar:file:\" + jar_pathes[0]+\"!/\") };\n\t\t\tURLClassLoader cl = URLClassLoader.newInstance(urls);\n\t\t\t\n\t\t\twhile (jar_entries_enum.hasMoreElements()) {\n\t\t JarEntry jar_entry = (JarEntry) jar_entries_enum.nextElement();\n\t\t if(jar_entry.isDirectory() || !jar_entry.getName().endsWith(\".class\")) {\n\t\t \tcontinue;\n\t\t }\n\n\t\t\t String className = jar_entry.getName().substring(0,jar_entry.getName().length()-6); //-6 == len(\".class\")\n\t\t\t className = className.replace('/', '.');\n\t\t\t \n\t\t\t Class<?> c = cl.loadClass(className);\n\t\t\t if (TestCase.class.isAssignableFrom(c) || has_annotations(c)){ \n\t\t\t \ttest_classes.add(c);\n\t\t\t \tclass_names.add(className);\n\t\t\t\t}\t\n\t\t\t}\n\t\t\tjarFile.close();\n\t\t} catch (IOException e) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\te.printStackTrace();\n\t\t} catch (ClassNotFoundException e1) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\te1.printStackTrace();\n\t\t}\n\t\t}\n\t\n\tif (test_classes.isEmpty())\n\t{\n\t\tSystem.err.println(\"There is nothing to test.\");\n\t\tSystem.exit(1);\n\t}\n\telse{\n\t\tSystem.out.println(Arrays.toString(class_names.toArray()));\n\t\t\n\tJUnitCore runner = new JUnitCore();\n\tCustomListener custom_listener = new CustomListener();\n\tcustom_listener.reporter = new Reporter(args[args.length-1]);\n\trunner.addListener(custom_listener);\n\trunner.run(test_classes.toArray(new Class[test_classes.size()]));\n\t\t}\n\t}", "private void readFromFile(String path) throws ClassNotFoundException {\n\t\ttry {\n\t\t\tInputStream file = new FileInputStream(path);\n\t\t\tInputStream buffer = new BufferedInputStream(file);\n\t\t\tObjectInput input = new ObjectInputStream(buffer);\n\n\t\t\ttagList = (HashMap<String, Integer>) input.readObject();\n\t\t\tinput.close();\n\t\t} catch (IOException ex) {\n\t\t\tSystem.out.println(\"Cannot read from input.\");\n\t\t}\n\t}", "public void addFakeClassPathToRead(String path) {\n StringTokenizer stoken = new StringTokenizer(path, System.getProperty(\"path.separator\") );\n while (stoken.hasMoreTokens()) {\n filesToReadVec.addElement(new File((String)stoken.nextElement()));\n }\n }", "@Override\r\n\tpublic void loadContents(String[] contents) {\n\t\t\r\n\t}", "public static JARArchive createDefaultJar(Class<?> aClass) {\n JARArchive archive = ShrinkWrap.create(JARArchive.class);\n ClassLoader cl = aClass.getClassLoader();\n\n Set<CodeSource> codeSources = new HashSet<>();\n\n URLPackageScanner.Callback callback = (className, asset) -> {\n ArchivePath classNamePath = AssetUtil.getFullPathForClassResource(className);\n ArchivePath location = new BasicPath(\"\", classNamePath);\n archive.add(asset, location);\n\n try {\n Class<?> cls = cl.loadClass(className);\n codeSources.add(cls.getProtectionDomain().getCodeSource());\n } catch (ClassNotFoundException | NoClassDefFoundError e) {\n e.printStackTrace();\n }\n };\n\n URLPackageScanner scanner = URLPackageScanner.newInstance(\n true,\n cl,\n callback,\n aClass.getPackage().getName());\n\n scanner.scanPackage();\n\n Set<String> prefixes = codeSources.stream().map(e -> e.getLocation().toExternalForm()).collect(Collectors.toSet());\n\n try {\n List<URL> resources = Collections.list(cl.getResources(\"\"));\n\n resources.stream()\n .filter(e -> {\n for (String prefix : prefixes) {\n if (e.toExternalForm().startsWith(prefix)) {\n return true;\n }\n }\n return false;\n })\n .filter(e -> e.getProtocol().equals(\"file\"))\n .map(e -> getPlatformPath(e.getPath()))\n .map(e -> Paths.get(e))\n .filter(e -> Files.isDirectory(e))\n .forEach(e -> {\n try {\n Files.walkFileTree(e, new SimpleFileVisitor<Path>() {\n public FileVisitResult visitFile(Path file, BasicFileAttributes attrs) throws IOException {\n if (!file.toString().endsWith(\".class\")) {\n Path location = e.relativize(file);\n archive.add(new FileAsset(file.toFile()), javaSlashize(location));\n }\n return super.visitFile(file, attrs);\n }\n });\n } catch (IOException e1) {\n }\n });\n\n } catch (IOException e) {\n throw new RuntimeException(e);\n }\n return archive;\n }", "java.util.List<java.lang.String>\n getClasspathList();", "public String[] getFileName();", "public StringBuilder getClassPathDescription() {\n\n // load the jars from the classpath\n StringBuilder classPathLog = new StringBuilder();\n String[] classpathArray = getClassPathArray();\n\n if (classpathArray.length == 0) {\n return classPathLog;\n }\n\n // Make a map containing folders as keys and jar names as values\n Map<String, List<String>> classPathMap = new HashMap<String, List<String>>();\n for (int i = 0; i < classpathArray.length; i++) {\n String jarFullPath = classpathArray[i].replace(\"\\\\\", \"/\");\n String absPath = jarFullPath.substring(0, jarFullPath.lastIndexOf('/') + 1);\n String simpleJarName = jarFullPath.substring(jarFullPath.lastIndexOf('/') + 1,\n jarFullPath.length());\n if (classPathMap.containsKey(absPath)) {\n classPathMap.get(absPath).add(simpleJarName);\n } else {\n classPathMap.put(absPath, new ArrayList<String>(Arrays.asList(simpleJarName)));\n }\n }\n\n // append instances of same jar one after another\n for (String path : new TreeSet<String>(classPathMap.keySet())) {\n classPathLog.append(\"\\n\");\n classPathLog.append(path);\n List<String> jarList = classPathMap.get(path);\n Collections.sort(jarList);\n for (String lib : jarList) {\n classPathLog.append(\"\\n\\t\");\n classPathLog.append(lib);\n }\n }\n return classPathLog;\n }", "private ArrayList<char[]> getFileAsResourceByCharsNewLineDelineated(Class c){\n ArrayList<char[]> charLines = new ArrayList<char[]>();\n try{\n s = new Scanner(c.getResourceAsStream(resourceName)); \n while (s.hasNextLine()){\n char[] line = s.nextLine().toCharArray();\n charLines.add(line);\n }\n } catch(Exception e){\n e.printStackTrace();\n }\n return charLines;\n }", "@Test\n void findSourceJar() {\n Class<?> klass = org.apache.commons.io.FileUtils.class;\n var codeSource = klass.getProtectionDomain().getCodeSource();\n if (codeSource != null) {\n System.out.println(codeSource.getLocation());\n }\n }", "public List<File> getClasspathElements() {\n\t\tthis.parseSystemClasspath();\n\t return classpathElements;\n\t}", "List readFile(String pathToFile);", "public interface ReaderFromFile {\n\t\n\tpublic List<Data> readDataFromFile (String filename);\n}", "private void readClasses(SB_SingletonBook book) throws SB_FileException\r\n\t{\r\n\t for (Class javaClass : SB_ClassMap.getBaseJavaClasses()) {\r\n\t addJavaClass(book, javaClass.getSimpleName(), javaClass.getName());\r\n\t }\r\n\t \r\n\t List<String> importedClasses = _dataModel.getJavaScript().getImportedJavaClasses();\r\n\t\tfor( String javaClassName : importedClasses) {\r\n\t\t\tString classPackage = javaClassName;\r\n\t\t\tString className = javaClassName.substring(javaClassName.lastIndexOf('.') + 1);\r\n\t\t\taddJavaClass(book, className, classPackage);\r\n\t }\r\n\t\t\r\n\t\t//Now that all classes read in, convert class descriptions\r\n\t\ttry\r\n\t\t{\r\n\t\t book.getUserClassMap().convertClassDescriptions(book);\r\n\t\t}\r\n\t\tcatch(SB_Exception ex)\r\n\t\t{\r\n\t\t throw new SB_FileException(ex.toString());\r\n\t\t}\r\n\t}", "@Override\r\n public void dirToPath(String[] arr) {\n\r\n }", "public static List<String> getFiles(String path) {\n\t try {\n\t\t\tURI uri = getResource(path).toURI();\n\t\t String absPath = getResource(\"..\").getPath();\n\t\t\tPath myPath;\n\t\t\tif (uri.getScheme().equals(\"jar\")) {\n\t\t\t FileSystem fileSystem = FileSystems.newFileSystem(uri, Collections.<String, Object>emptyMap());\n\t\t\t myPath = fileSystem.getPath(path);\n\t\t\t \n\t\t\t} else {\n\t\t\t myPath = Paths.get(uri);\n\t\t\t}\n\t\t\t\n\t\t\t List<String> l = Files.walk(myPath)\t\n\t\t\t \t\t\t\t\t .map(filePath -> pathAbs2Rel(absPath, filePath))\n\t\t\t \t .collect(Collectors.toList());\n\t\t\t return l;\n\t\t} catch (URISyntaxException | IOException e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t return null;\n\t \n\t}", "java.lang.String getOutputjar();", "java.util.List<java.lang.String>\n getClasspathList();", "java.lang.String getClasspath(int index);", "java.lang.String getClasspath(int index);", "private void readFileToArray(FileInputStream fis, Warship[] wsArr) throws Exception {\n\t\tScanner scanner = null;\n\t\ttry {\n\t\t\tscanner = new Scanner(fis);\n\t\t\tint i = 0;\n\t\t\twhile (scanner.hasNextLine()) {\n\t\t\t\twsArr[i] = this.getWarship(scanner.nextLine());\n\t\t\t\ti++;\n\t\t\t}\n\t\t} catch (Exception e) {\n\t\t\tthrow new Exception(e.getMessage());\n\t\t} finally {\n\t\t\tif (scanner != null) {\n\t\t\t\tscanner.close();\n\t\t\t}\n\t\t}\n\t}", "public String[] read()\n {\n ArrayList<String> input = new ArrayList<String>();\n try\n {\n dir = new File(contextRef.getFilesDir(), filename);\n if (dir.exists())\n {\n Scanner contacts = new Scanner(dir);\n while (contacts.hasNextLine())\n {\n input.add(contacts.nextLine());\n }\n contacts.close();\n }\n }catch (Exception ex)\n {\n //debug(\"read file contents failure\");\n debug = \"test read failure\";\n }\n return input.toArray(new String[1]);\n }", "public abstract byte[] getBytes(String path) throws IOException, ClassNotFoundException;", "private void createCache(byte[] buf) throws IOException {\n\t\tByteArrayInputStream bais = null;\n\t\tJarInputStream jis = null;\n\t\tbyte[] buffer = new byte[1024 * 4];\n\t\t\n\t\ttry {\n\t\t\tbais = new ByteArrayInputStream(buf);\n\t\t\tjis = new JarInputStream(bais);\n\t\t\tAttributes attr = jis.getManifest().getMainAttributes();\n\t\t\tmainClassName = attr != null ? attr.getValue(Attributes.Name.MAIN_CLASS) : null;\n\t\t\t\n\t\t\tfor (JarEntry entry = null; (entry = jis.getNextJarEntry()) != null; ) {\n\t\t\t\tString name = entry.getName();\n\t\t\t\t\n\t\t\t\tif (!entry.isDirectory()) {\n\t\t\t\t\tByteArrayOutputStream byteStream = new ByteArrayOutputStream();\n\t\t\t\t\t\n\t\t\t\t\tfor (int n = 0; -1 != (n = jis.read(buffer)); ) {\n\t\t\t\t\t\tbyteStream.write(buffer, 0, n);\n\t\t\t }\n\t\t\t\t\t\n\t\t\t\t\tif (name.endsWith(\".class\")) {\n\t\t\t\t\t\tString className = name.substring(0, name.indexOf('.')).replace('/', '.');\n\t\t\t\t\t\tresources.put(className, byteStream.toByteArray());\n\t\t\t\t\t} else {\n\t\t\t\t\t\tresources.put(name, byteStream.toByteArray());\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\tbyteStream.close();\n\t\t\t\t}\n\t\t\t}\n\t\t} catch (Exception e) {\n\t\t\te.printStackTrace();\n\t\t} finally {\n\t\t\tIOUtils.closeQuietly(jis);\n\t\t\tIOUtils.closeQuietly(bais);\n\t\t}\n\t}", "@Override\r\n\tpublic ArrayList<String> readResourceFiles(String packageName,\r\n\t\t\tArrayList<String> resourceList) {\n\t\treturn null;\r\n\t}", "private String[] loadFile(String filename) {\n\t\treturn loadFile(filename, new String[0], System.lineSeparator());\n\t}", "private ArrayList<char[]> getJavaFileList(String inputDir){\n\t\ttry {\n\t\t\treturn subdirectoriesToFiles(inputDir, new ArrayList<char[]>());\n\t\t} catch (IOException e) {\n\t\t\te.printStackTrace();\n\t\t\treturn null;\n\t\t}\n\t}", "@Override\n public Class getJavaClass() throws IOException, ClassNotFoundException {\n open();\n URL url;\n int p = path.lastIndexOf('/');\n int p2 = path.substring(0,p-1).lastIndexOf('/');\n\n File f = new File(path.substring(0,p2));\n url = f.toURI().toURL();\n URL[] urls = new URL[1];\n urls[0] = url;\n ClassLoader loader = new URLClassLoader(urls);\n\n String cls = path.substring(p2 + 1, path.lastIndexOf('.')).replace('/', '.');\n\n if (cfile.getParentFile().getParentFile().getName().equals(\"production\")) {\n cls = cls.substring(cls.lastIndexOf('.') + 1);\n }\n\n\n\n return loader.loadClass(cls);\n }", "public static IOException [] releaseLoader(URLClassLoader classLoader, Vector<String> jarsClosed) {\n \n IOException[] result = null;\n \n try { \n init();\n\n /* Records all IOExceptions thrown while closing jar files. */\n Vector<IOException> ioExceptions = new Vector<IOException>();\n\n if (jarsClosed != null) {\n jarsClosed.clear();\n }\n\n URLClassPath ucp = (URLClassPath) jcpField.get(classLoader);\n ArrayList loaders = (ArrayList) loadersField.get(ucp);\n Stack urls = (Stack) urlsField.get(ucp);\n HashMap lmap = (HashMap) lmapField.get(ucp);\n\n /*\n *The urls variable in the URLClassPath object holds URLs that have not yet\n *been used to resolve a resource or load a class and, therefore, do\n *not yet have a loader associated with them. Clear the stack so any\n *future requests that might incorrectly reach the loader cannot be \n *resolved and cannot open a jar file after we think we've closed \n *them all.\n */\n synchronized(urls) {\n urls.clear();\n }\n\n /*\n *Also clear the map of URLs to loaders so the class loader cannot use\n *previously-opened jar files - they are about to be closed.\n */\n synchronized(lmap) {\n lmap.clear();\n }\n\n /*\n *The URLClassPath object's path variable records the list of all URLs that are on\n *the URLClassPath's class path. Leave that unchanged. This might\n *help someone trying to debug why a released class loader is still used.\n *Because the stack and lmap are now clear, code that incorrectly uses a\n *the released class loader will trigger an exception if the \n *class or resource would have been resolved by the class\n *loader (and no other) if it had not been released. \n *\n *The list of URLs might provide some hints to the person as to where\n *in the code the class loader was set up, which might in turn suggest\n *where in the code the class loader needs to stop being used.\n *The URLClassPath does not use the path variable to open new jar \n *files - it uses the urls Stack for that - so leaving the path variable\n *will not by itself allow the class loader to continue handling requests.\n */\n\n /*\n *For each loader, close the jar file associated with that loader. \n *\n *The URLClassPath's use of loaders is sync-ed on the entire URLClassPath \n *object.\n */\n synchronized (ucp) {\n for (Object o : loaders) {\n if (o != null) {\n /*\n *If the loader is a JarLoader inner class and its jarFile\n *field is non-null then try to close that jar file. Add\n *it to the list of closed files if successful.\n */\n if (jarLoaderInnerClass.isInstance(o)) {\n try {\n JarFile jarFile = (JarFile) jarFileField.get(o);\n try {\n if (jarFile != null) {\n jarFile.close();\n if (jarsClosed != null) {\n jarsClosed.add(jarFile.getName());\n }\n }\n } catch (IOException ioe) {\n /*\n *Wrap the IOException to identify which jar \n *could not be closed and add it to the list\n *of IOExceptions to be returned to the caller.\n */\n String jarFileName = (jarFile == null) ? getMessage(\"classloaderutil.jarFileNameNotAvailable\") : jarFile.getName();\n String msg = getMessage(\"classloaderutil.errorClosingJar\", jarFileName);\n IOException newIOE = new IOException(msg);\n newIOE.initCause(ioe);\n ioExceptions.add(newIOE);\n \n /*\n *Log the error also.\n */\n getLogger().log(Level.WARNING, msg, ioe);\n }\n } catch (Throwable thr) {\n getLogger().log(Level.WARNING, \"classloaderutil.errorReleasingJarNoName\", thr);\n }\n }\n }\n }\n /*\n *Now clear the loaders ArrayList.\n */\n loaders.clear();\n }\n result = ioExceptions.toArray(new IOException[ioExceptions.size()]);\n } catch (Throwable thr) {\n getLogger().log(Level.WARNING, \"classloaderutil.errorReleasingLoader\", thr);\n result = null;\n }\n \n return result;\n }", "@Override\n\t\tpublic List<InJarResourceImpl> getContents(InJarResourceImpl serializationArtefact) {\n\t\t\treturn serializationArtefact.getContents(false);\n\t\t}", "public static ArrayList<File> getJars(File dir) {\r\n\t\treturn getFiles(dir, \".jar\");\r\n\t}", "private static void indexFromJarFile(InputStream in) throws IOException {\n\n\t\tZipInputStream zis = new ZipInputStream(in);\n\t\tZipEntry e;\n\n\t\twhile((e = zis.getNextEntry()) != null) {\n\n\t\t\tString name = e.getName();\n\t\t\tzis.closeEntry();\n\n\t\t\tif(name.contains(relationRepositoryPath) && name.endsWith(classExtension)) {\n\n\t\t\t\taddToIndex(name.replace(jarFileRelationRepositoryPath, \"\"));\n\t\t\t}\n\t\t}\n\t\tin.close();\n\t}", "public synchronized <T> T[] toArray(T[] a) {\r\n // fall back on teh file\r\n FileReader fr = null;\r\n BufferedReader br = null;\r\n try {\r\n fr = new FileReader(getToggleFile());\r\n br = new BufferedReader(fr);\r\n for (String line = br.readLine(); line != null; line = br.readLine()) {\r\n// String[] parts = line.split(\"~\");\r\n// // make a new pfp\r\n// ProjectFilePart pfp = new ProjectFilePart(parts[0].replace(\"\\\\~\", \"~\"), BigHash.createHashFromString(parts[1]), Base16.decode(parts[2]));\r\n ProjectFilePart pfp = convertToProjectFilePart(line);\r\n // buffer it\r\n buf.add(pfp);\r\n }\r\n } catch (Exception e) {\r\n throw new RuntimeException(e);\r\n } finally {\r\n IOUtil.safeClose(br);\r\n IOUtil.safeClose(fr);\r\n }\r\n return (T[]) buf.toArray(a);\r\n }", "private ArrayList<String> getJARList() {\n String[] jars = getJARNames();\n return new ArrayList<>(Arrays.asList(jars));\n }", "@PostConstruct\n private void loadFiles() {\n \n\n File dir = new File(Constants.DIR_PATH);\n File[] files = dir.listFiles(); //stores list of files in given paths\n String line=\"\";\n\n for(File file : files){\n try {\n br = new BufferedReader(new FileReader(file));\n br.readLine();\n while((line=br.readLine())!=null){\n\n String []token=line.split(Constants.DELIMETER);\n String fileName=file.getName().toUpperCase();\n\n FlightData newflight = new FlightData(fileName.substring(0,fileName.lastIndexOf(\".\")),token[0],token[1],token[2],token[3],token[4],token[5],Double.parseDouble(token[6]),token[7],token[8]);\n flightDataDao.insertFlightData(newflight);\n }\n\n } catch (FileNotFoundException e) {\n e.printStackTrace();\n } catch (IOException e) {\n e.printStackTrace();\n }\n }\n\n }", "@Classpath\n @Incremental\n public abstract ConfigurableFileCollection getJniFolders();", "private Map<String, CartridgeClasspathData> setupCartridgeClassPaths() {\n\t\tthis.cartridgeClassPaths = new HashMap<String, CartridgeClasspathData>();\n\n\t\tFile cartridgeDir = PluginHelper.getInstance().getCartridgeDir();\n\n\t\tList<File> jarFiles = FileHelper.findFiles(cartridgeDir.getPath(), new CartridgeJarFilter(), false);\n\t\tfor (File file : jarFiles) {\n\t\t\tthis.cartridgeClassPaths.put(CartridgeClasspathData.getClasspathKey(file),\n\t\t\t\t\tnew CartridgeClasspathData(file, true));\n\t\t}\n\n\t\tList<File> linkFiles = FileHelper.findFiles(cartridgeDir.getPath(), new CartridgeLinkFilter(), false);\n\t\tfor (File file : linkFiles) {\n\t\t\tString path = this.readLinkFile(file);\n\t\t\tif (path != null) {\n\t\t\t\tLogHelper.info(\"using cartridges: \" + path + \" via linkfile: \" + file);\n\t\t\t\tthis.cartridgeClassPaths.put(CartridgeClasspathData.getClasspathKey(new File(path)),\n\t\t\t\t\t\tnew CartridgeClasspathData(new File(path), true));\n\t\t\t}\n\t\t}\n\n\t\treturn this.cartridgeClassPaths;\n\t}", "public static void main(String[] args) throws IOException {\n\n\t\t// get path to rt.jar file\n\t\tString rtPath = args[0];\n\t\tFile rtFile = new File(rtPath);\n\t\tif (!rtFile.isFile()) {\n\t\t\tSystem.err.println(\"File not found: \" + rtFile.getAbsolutePath());\n\t\t\tSystem.exit(1);\n\t\t}\n\n\t\t// load all classes from rt.jar file into memory\n\t\tClasspathLoader loader = LoaderBuilder.create().forClassLoader(\"Runtime\").buildClasspathLoader();\n\t\tClasspath classpath = loader.load(Collections.singletonList(rtFile));\n\t\tJarFile jarFile = classpath.getJarFiles().get(0);\n\t\tList<ClassDef> classDefs = jarFile.getClassDefs();\n\n\t\t// list of packages which will be added to resource file\n\t\tList<String> includedPackageNames = Arrays.asList(\n\t\t\t\t\"com.sun.net.httpserver\", \"com.sun.xml.internal.ws.addressing\",\n\t\t\t\t\"java.applet\", \"java.awt\", \"java.beans\", \"java.io\", \"java.lang\", \"java.math\", \"java.net\", \"java.nio\", \"java.rmi\", \"java.security\", \"java.sql\", \"java.text\", \"java.time\", \"java.util\",\n\t\t\t\t\"javax.activation\", \"javax.annotation\", \"javax.imageio\", \"javax.jws\", \"javax.management\", \"javax.naming\", \"javax.net\", \"javax.script\", \"javax.security.auth\", \"javax.sql\", \"javax.transaction\", \"javax.xml\",\n\t\t\t\t\"org.w3c.dom\", \"org.xml.sax\",\n\t\t\t\t\"sun.misc\"\n\t\t);\n\n\t\t// split into included classes (class defs) and excluded classes (names)\n\t\tList<ClassDef> includedClassDefs = new ArrayList<>();\n\t\tList<String> excludedClassNames = new ArrayList<>();\n\t\tfor (ClassDef classDef : classDefs) {\n\t\t\tString className = classDef.getClassName();\n\t\t\tboolean include = includedPackageNames.stream().anyMatch(p -> className.startsWith(p + \".\"));\n\t\t\tif (include) {\n\t\t\t\tincludedClassDefs.add(classDef);\n\t\t\t} else {\n\t\t\t\texcludedClassNames.add(className);\n\t\t\t}\n\t\t}\n\n\t\t// open compressed output stream to test resource file\n\t\tString resourcePath = \"./src/test/resources/classes-oracle-jdk-1.8.0_144.dat.gz\";\n\t\tFile resourceFile = new File(resourcePath);\n\t\ttry (FileOutputStream fos = new FileOutputStream(resourceFile)) {\n\t\t\ttry (GZIPOutputStream zos = new GZIPOutputStream(fos)) {\n\t\t\t\ttry (DataOutputStream dos = new DataOutputStream(zos)) {\n\t\t\t\t\t// write list of included class definitions\n\t\t\t\t\tdos.writeInt(includedClassDefs.size());\n\t\t\t\t\tfor (ClassDef classDef : includedClassDefs) {\n\t\t\t\t\t\tClassDefUtils.write(classDef, dos);\n\t\t\t\t\t}\n\t\t\t\t\t// write list of excluded class names\n\t\t\t\t\tdos.writeInt(excludedClassNames.size());\n\t\t\t\t\tfor (String className : excludedClassNames) {\n\t\t\t\t\t\tdos.writeUTF(className);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tSystem.out.println(\"Runtime file : \" + rtFile.getAbsolutePath());\n\t\tSystem.out.println(\"Total classes found: \" + classDefs.size());\n\t\tSystem.out.println(\"Included classes : \" + includedClassDefs.size());\n\t\tSystem.out.println(\"Excluded classes : \" + excludedClassNames.size());\n\t\tSystem.out.println(\"Resource file : \" + resourceFile.getAbsolutePath());\n\t\tSystem.out.println(\"Final file size : \" + FileUtils.formatFileSize(resourceFile.length()));\n\t}", "protected String readTestFile(String path) throws IOException {\n return FileUtils.readClasspathFile(path);\n }", "static JsonResource forClasspath( ClassLoader classLoader, String name ) {\n final ClassLoader loader = classLoader == null ? Thread.currentThread().getContextClassLoader() : classLoader;\n return new JsonResource() {\n @Override\n public <T> T readFrom( ReadMethod<T> consumer ) throws IOException {\n InputStream stream = loader.getResourceAsStream(name);\n if ( stream == null )\n throw new FileNotFoundException(\"Resource \" + name + \" not found\");\n try {\n return consumer.read( stream );\n } finally {\n stream.close();\n }\n }\n };\n }", "ArrayList retrievestudentdata() throws ClassNotFoundException;", "private void scanRepository(String type, HashMap<String, String> liste) {\n String chemin = new String(Parameters.COMPONENTS_REPOSITORY+\"/\"+type);\n//System.out.println(\"explore : \"+chemin);\n File depot = new File(chemin);\n File[] fichiers = depot.listFiles(); // liste des fichiers contenus dans ce repertoire\n for (int i = 0; i<fichiers.length; i++) { // explorer ces fichiers\n if (fichiers[i].isFile()) { // c'est un fichier\n if (fichiers[i].getName().endsWith(\".jar\")) { // c'est un fichier .jar\n try {\n JarFile accesJar = new JarFile(fichiers[i]);\n Manifest manifest = accesJar.getManifest(); // recuperer le manifest de ce fichier\n // Recuperer le nom de la classe du composant metier (dans ce manifest)\n String classeCM = manifest.getMainAttributes().getValue(KalimuchoClassLoader.BC_CLASS);\n liste.put(classeCM, fichiers[i].getName());\n//System.out.println(\"ajoute : (\"+classeCM+\" , \"+fichiers[i].getName()+\")\");\n }\n catch (IOException ioe) {\n System.err.println(\"Can't access to jar file \"+fichiers[i].getName()+\" in \"+chemin);\n }\n }\n }\n }\n }", "java.util.List<com.google.devtools.kythe.proto.Java.JarDetails.Jar> \n getJarList();", "private void loadPluginsJar(String jarname){\r\n\t\tURL[] urlList = new URL[1];\r\n\t\ttry{\r\n\t\t\tURL jarUrl = new URL(\"file:\"+jarname+\".jar\");\r\n\t\t\turlList[0] = jarUrl;\r\n\t\t}catch(MalformedURLException e){\r\n\t\t\tLogger.getLogger(LOGGER_NAME).warning(\"Plugin '\"+jarname+\"' could not be loaded (invalid path)\");\r\n\t\t}\r\n\t\t\r\n\t\tURLClassLoader classLoader = new URLClassLoader(urlList);\r\n\t\ttry{\r\n\t\t\tJarFile jfile = new JarFile(jarname+\".jar\");\r\n\t\t\t\r\n\t\t\t// walk through all files of the jar\r\n\t\t\tEnumeration<JarEntry> entries = jfile.entries();\r\n\t\t\twhile(entries.hasMoreElements()){\r\n\t\t\t\tJarEntry entry = entries.nextElement();\r\n\t\t\t\tif(entry.isDirectory() || !entry.getName().endsWith(\".class\")){\r\n\t\t\t\t\tcontinue; // we only care for classes\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\tString className = entry.getName().substring(0,entry.getName().length()-6).replace('/', '.');\r\n\t\t\t\t\r\n\t\t\t\tClass<IKomorebiPlugin> pluginClass = null;\r\n\t\t\t\ttry {\r\n\t\t\t\t\tClass<?> cl = classLoader.loadClass(className);\r\n\t\t\t\t\tif(!IKomorebiPlugin.class.isAssignableFrom(cl)){\r\n\t\t\t\t\t\tcontinue; // only care about PlugIn classes\r\n\t\t\t\t\t}\r\n\t\t\t\t\t\r\n\t\t\t\t\tpluginClass = (Class<IKomorebiPlugin>) cl;\r\n\t\t\t\t} catch (ClassNotFoundException e) {\r\n\t\t\t\t\tLogger.getLogger(LOGGER_NAME).warning(\"Error while registering PlugIns of '\"+jarname+\"': \"+\r\n\t\t\t\t className+\" could not be loaded\");\r\n\t\t\t\t\tcontinue;\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\ttryRegisterPlugin(jarname, pluginClass);\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tjfile.close();\r\n\t\t}catch(IOException e){\r\n\t\t\tLogger.getLogger(LOGGER_NAME).warning(\"Plugin '\"+jarname+\"' could not be loaded (does not exist)\");\r\n\t\t}finally{\r\n\t\t\tif(classLoader != null){\r\n\t\t\t\ttry {\r\n\t\t\t\t\tclassLoader.close();\r\n\t\t\t\t} catch (IOException e) {\r\n\t\t\t\t\tLogger.getLogger(LOGGER_NAME).warning(\"Potential resource leak: class loader could not be closed (reason: \"+e.getMessage()+\")\");\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t}", "private void processJar(JarFile jf) throws Exception {\n\t\tfor (Enumeration<JarEntry> e = jf.entries(); e.hasMoreElements();) {\n\t\t\tJarEntry entry = e.nextElement();\n\t\t\tString s = entry.getName();\n\t\t\tif (s.endsWith(\".class\")) {\n\t\t\t\tfor (String pref : prefixes) {\n\t\t\t\t\tif (s.startsWith(pref)) {\n\t\t\t\t\t\ts = s.replaceAll(\".class\", \"\").replaceAll(\"/\", \".\");\n\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\tp.process(s);\n\t\t\t\t\t\t} catch (Exception ex) {\n\t\t\t\t\t\t\tSystem.out.println(\"ERROR processing class \" + s\n\t\t\t\t\t\t\t\t\t+ \" in \" + jf.getName());\n\t\t\t\t\t\t\tSystem.out.println(entry);\n\t\t\t\t\t\t\tthrow ex;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t}\n\t}", "public String getClassPath();", "public void scanClasspath() {\n List<String> classNames = new ArrayList<>(Collections.list(dexFile.entries()));\n\n ClassLoader classLoader = org.upacreekrobotics.dashboard.ClasspathScanner.class.getClassLoader();\n\n for (String className : classNames) {\n if (filter.shouldProcessClass(className)) {\n try {\n Class klass = Class.forName(className, false, classLoader);\n\n filter.processClass(klass);\n } catch (ClassNotFoundException e) {\n e.printStackTrace();\n } catch (NoClassDefFoundError e) {\n e.printStackTrace();\n }\n }\n }\n }", "@Override\n protected Resource[] getTestBundles() {\n List<Resource> resources = new ArrayList<Resource>(Arrays.asList(super.getTestBundles()));\n for (Iterator<Resource> it = resources.iterator(); it.hasNext(); ) {\n String fn = it.next().getFilename();\n if (fn.startsWith(\"cxf-dosgi-ri-dsw-cxf\") && fn.endsWith(\".jar\")) {\n it.remove();\n }\n }\n return resources.toArray(new Resource[resources.size()]);\n }", "static public ArrayList<ChineseCharacter> readFromFile()\r\n\t {\n \t \r\n\t\t InputStream stream = LoadCharactersFromFile.class.getClassLoader().getResourceAsStream(\"files/charactersSet1.txt\");\r\n\t\t\t\t \r\n\t\t\t\r\n\t System.out.println(\"==========> \"+stream != null);\r\n\t // stream = LoadCharactersFromFile.class.getClassLoader().getResourceAsStream(\"SomeTextFile.txt\");\r\n\t // System.out.println(stream != null);\r\n\t \t// getResourceAsStream(\"file.txt\")\r\n\t \t \r\n\t // Resource resource = new ClassPathResource(\"com/example/Foo.class\");\r\n\t \r\n\t String filePath = stream.toString();\r\n\t\t \r\n\t System.out.println(\"filePath: \"+filePath);\r\n\t BufferedReader br = new BufferedReader(new InputStreamReader(stream));\r\n\t String line = \"\";\r\n\t String cvsSplitBy = \",\";\r\n\r\n\t \r\n\t \r\n\t ArrayList<ChineseCharacter> chineseCharacterArraylist = new ArrayList<ChineseCharacter>() ;\r\n\t int charactercount =0;\r\n\t try {\r\n\r\n\t // br = new BufferedReader(new FileReader(filePath));\r\n\t int count = 1;\r\n\t int listLength = 0;\r\n\t \r\n\t // ChineseCharacter character;\r\n\t String listtitle = \"\";\r\n\t ArrayList<String> pinyinlistArray = new ArrayList<String>();\r\n\t \r\n\t ArrayList<Character> hanzilistArray = new ArrayList<Character>() ;\r\n\t int linecount = 0;\r\n\t \r\n\t while ((line = br.readLine()) != null) \r\n\t {\r\n\t \t linecount++;\r\n\t\t\t \r\n\t \t \r\n\t\t\t //listtitle: characters: pinyin: \r\n\t\t\t // use comma as separator\r\n\t\t\t \r\n\t\t\t if(count ==1)\r\n\t\t\t {\r\n\t\t\t \t \r\n\t\t\t \t String[] listtitleLine = line.split(cvsSplitBy);\r\n\t\t\t\t if(listtitleLine[0].equals(\"listtitle:\"))\r\n\t\t\t\t {\t\r\n\t\t\t\t \t \r\n\t\t\t\t \t listtitle = listtitleLine[1];\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\t \r\n\t\t\t\t if(linecount==1)\r\n\t\t\t\t {\r\n\t\t\t\t \t listtitle = listtitleLine[1];\r\n\t\t\t\t \t \r\n\t\t\t\t\t System.out.println(\"linecount==1, Linetype: \" + listtitleLine[0] + \" value: \" + listtitle);\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 }//if(count ==1)\r\n\t\t\t \r\n\t\t\t if(count ==2)\r\n\t\t\t {\r\n\t\t\t \t String[] charactersLine = line.split(cvsSplitBy);\r\n\t\t\t\t if(charactersLine[0].equals(\"characters:\"))\r\n\t\t\t\t {\t\r\n\t\t\t\t \t listLength = charactersLine.length;\r\n\t\t\t\t \r\n\t\t\t\t \t for(int i =0; i<listLength-1; i++)\r\n\t\t\t \t\t\t {\r\n\t\t\t\t \t\t charactersLine[i+1] = charactersLine[i+1].replace(\" \", \"\");\r\n\t\t\t\t \t\t// charactersLine[i+1] = charactersLine[i+1].replace(\",\", \"\");//remove all comma\r\n\t\t\t\t \t\t \r\n\t\t\t\t \t\t hanzilistArray.add(charactersLine[i+1].charAt(0));\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 System.out.print(\"\\n\"); \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 }//if(count ==2)\r\n\t\t\t \r\n\t\t\t if(count ==3)\r\n\t\t\t {\r\n\t\t\t \t String[] pinyinLine = line.split(cvsSplitBy);\r\n\t\t\t\t if(pinyinLine[0].equals(\"pinyin:\"))\r\n\t\t\t\t {\t\r\n\t\t\t\t \t //check pinyin and characters have same no. of elements\r\n\t\t\t\t \t if (listLength == pinyinLine.length)\r\n\t\t\t\t \t {\r\n\t\t\t\t \t\t \r\n\t\t\t\t\t\t\t \r\n\t\t\t\t\t\t\t for(int i =0; i<listLength-1; i++)\r\n\t\t\t\t\t \t\t\t {\r\n\t\t\t\t\t\t\t \t \r\n\t\t\t\t\t\t\t \t pinyinlistArray.add(pinyinLine[i+1]);\r\n\t\t\t\t\t \t\t\t\t\r\n\t\t\t\t\t \t\t\t\t \r\n\t\t\t\t\t \t\t\t\t ChineseCharacter character = new ChineseCharacter(listtitle,hanzilistArray.get(i),pinyinlistArray.get(i)); \r\n\t\t\t\t\t \t\t\t\t \r\n\t\t\t\t\t \t\t\t\t chineseCharacterArraylist.add(charactercount, character);;\r\n\t\t\t\t\t \t\t\t\t// chineseCharacters[charactercount] = character;\r\n\t\t\t\t\t \t\t\t\t \r\n\t\t\t\t\t \t\t\t\t charactercount++; \r\n\t\t\t\t\t \t\t\t }\r\n\t\t\t\t\t\t\t \r\n\t\t\t\t\t\t\t \r\n\t\t\t\t\t\t\t \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.println(\"listLength != pinyinLine.length!!..unable to add list: \"+ listtitle);\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 hanzilistArray.clear();\r\n\t \t\t\t\t pinyinlistArray.clear(); \r\n\t\t\t }//if(count ==3)\r\n\t\t\t \r\n\t\t\t \r\n\t\t\t if(count == 3) { count = 1;}\r\n\t\t\t else{ count++;}\r\n\t\t\t \r\n\t\t\t \r\n\t }//while\r\n\r\n\t \r\n\t \r\n\t \r\n\t \r\n\t }\r\n\t catch (FileNotFoundException e) \r\n\t {\r\n\t e.printStackTrace();\r\n\t } \r\n\t catch (IOException e) \r\n\t {\r\n\t e.printStackTrace();\r\n\t } finally \r\n\t {\r\n\t if (br != null) \r\n\t {\r\n\t try \r\n\t {\r\n\t br.close();\r\n\t } catch (IOException e) \r\n\t {\r\n\t e.printStackTrace();\r\n\t }\r\n\t }\r\n\t }\r\n\t\t \r\n\t \r\n\t return chineseCharacterArraylist;\r\n\t }", "protected abstract void generateClassFiles(ClassDoc[] arr, ClassTree classtree);", "public URL[] getJARs() throws MalformedURLException {\n return (urlsFromJARs(getJARNames()));\n }", "private static Class[] getClasses(String packageName)\n throws ClassNotFoundException, IOException {\n ClassLoader classLoader = Thread.currentThread().getContextClassLoader();\n assert classLoader != null;\n String path = packageName.replace('.', '/');\n Enumeration<URL> resources = classLoader.getResources(path);\n List<File> dirs = new ArrayList<File>();\n while (resources.hasMoreElements()) {\n URL resource = resources.nextElement();\n dirs.add(new File(resource.getFile()));\n }\n ArrayList<Class> classes = new ArrayList<Class>();\n for (File directory : dirs) {\n classes.addAll(findClasses(directory, packageName));\n }\n return classes.toArray(new Class[classes.size()]);\n }", "public void readExternal(ObjectInput in)\n\t\tthrows IOException, ClassNotFoundException\n\t{\n\t\tarray = new Object[ArrayUtil.readArrayLength(in)];\n\t\tArrayUtil.readArrayItems(in, array);\n\t}", "public static String[] makeClassArray(String inClass) {\n\n\t\tFile inFile = new File(inClass); // assigns inClass as \"infile\" for the purposes of copying in iris species data\n\n\t\t// Variables\n\t\tString[] classArray = new String[75]; // sets output array\n\t\tString line = \"\";\n\t\tint row = 0;\n\n\t\ttry {\n\t\t\tScanner scanFile = new Scanner(inFile);\n\n\t\t\twhile (scanFile.hasNextLine()) { // reads single csv file line (should just be one line)\n\n\t\t\t\tline = scanFile.nextLine();\n\t\t\t\tString[] tempLine = line.split(\",\"); // tempLine array, splitting each line of input file\n\n\t\t\t\tclassArray[row] = tempLine[tempLine.length - 1]; // only write in col index[4]\n\t\t\t\trow++;\n\t\t\t}\n\n\t\t\tscanFile.close();\n\n\t\t} catch (FileNotFoundException e) {\n\t\t\te.printStackTrace();\n\t\t}\n\n\t\treturn classArray; // 1D array String output of species \n\n\t}", "private void init() {\n\t\tMvcs.scanPackagePath = analyseScanPath();\n\t\tif(StringHandler.isEmpty(Mvcs.scanPackagePath))\n\t\t\tthrow new RuntimeException(\"No scan path has been set! you need to setup ScanPackage annotation\");\n\t\t\n\t\t//put all class into the list\n\t\tList<String> allClassNames = scanAllClassNames();\n\t\tif(StringHandler.isEmpty(allClassNames)) //some loader may have no return value \n\t\t\treturn ;\n\t\t\n\t\tfor(String pkgPath : allClassNames){\n\t\t\tlist.add(ClassUtil.getClass(pkgPath));\n\t\t}\n\t}", "private void loadClassesFromJar(final String runnableID, final File jarfile) {\n \n mTaskCache.get(runnableID).taskClasses = new LinkedList<Class>();\n \n Log.i(TAG,\n \"XXX: Calling DexClassLoader with jarfile: \" + jarfile.getAbsolutePath());\n final File tmpDir = mContext.getDir(\"dex\", 0);\n \n mTaskCache.get(runnableID).classLoader = new DexClassLoader(\n jarfile.getAbsolutePath(),\n tmpDir.getAbsolutePath(),\n null,\n BackgroundService.class.getClassLoader());\n // mTaskCache.get(mCurrentRunnableID).classLoader = mTaskCache.get(runnableID).classLoader;\n // setRunnableID(runnableID); \n \n // load all available classes\n String path = jarfile.getPath();\n \n \n try {\n // load dexfile\n DexFile dx = DexFile.loadDex(\n path,\n File.createTempFile(\"opt\", \"dex\", mContext.getCacheDir()).getPath(),\n 0);\n \n // extract all available classes\n for (Enumeration<String> classNames = dx.entries(); classNames.hasMoreElements();) {\n String className = classNames.nextElement();\n Log.i(TAG, String.format(\"found class: %s\", className));\n try {\n // TODO: do only forName() here?\n // final Class<Object> loadedClass = (Class<Object>) mClassLoaderWrapper.get().loadClass(className);\n final Class<Object> loadedClass = (Class<Object>) mTaskCache.get(runnableID).classLoader.loadClass(className);\n Log.i(TAG, String.format(\"Loaded class: %s\", className));\n // add associated classes to task class list\n if (loadedClass == null) {\n Log.e(TAG, \"EEEEEE loadedClass is null\");\n }\n if (mTaskCache.get(runnableID) == null) {\n Log.e(TAG, \"EEEEEE no mapentry found\");\n }\n if (mTaskCache.get(runnableID).taskClasses == null) {\n Log.e(TAG, \"EEEEEE taskClasses empty\");\n }\n mTaskCache.get(runnableID).taskClasses.add(loadedClass);\n // add task class to task list\n if (DistributedRunnable.class.isAssignableFrom(loadedClass)) {\n mTaskCache.get(runnableID).taskClass = loadedClass;\n }\n }\n catch (ClassNotFoundException ex) {\n Log.getStackTraceString(ex);\n }\n }\n }\n catch (IOException e) {\n System.out.println(\"Error opening \" + path);\n }\n // notify listeners\n for (JobCenterHandler handler : mHandlerList) {\n handler.onBinaryReceived(runnableID);\n }\n }", "private String[] readFile(BufferedReader reader) throws IOException {\r\n // Read each line in the file, add it to the ArrayList lines\r\n ArrayList<String> lines = new ArrayList<String>();\r\n String line;\r\n while ((line = reader.readLine()) != null) {\r\n lines.add(line);\r\n }\r\n reader.close();\r\n // Convert the list to an array of type String and return\r\n String[] ret = new String[1];\r\n return (lines.toArray(ret));\r\n }", "static List<String> fileReader(String fileName){\n \n \n //Read a file and store the content in a string array.\n File f = new File(fileName);\n BufferedReader reader = null;\n String tempString = null;\n List<String> fileContent = new ArrayList<String>();\n //String[] fileContent = null;\n //int i = 0;\n \n try {\n reader = new BufferedReader(new FileReader(f));\n while ((tempString = reader.readLine()) != null){\n //while ((fileContent[i] = reader.readLine()) != null){\n fileContent.add(tempString);\n //i++;\n }\n reader.close();\n } catch (FileNotFoundException e) {\n // TODO Auto-generated catch block\n e.printStackTrace();\n } catch (IOException e) {\n // TODO Auto-generated catch block\n e.printStackTrace();\n }\n finally{\n if (reader != null){\n try{\n reader.close();\n }\n catch(IOException e){\n e.printStackTrace();\n }\n }\n }\n \n return fileContent;\n \n }", "private String[] readFile(String location) {\n\t\ttry {\n\t\t\tBufferedReader reader = new BufferedReader(new FileReader(location));\n\t\t\tArrayList<String> document = new ArrayList<String>();\n\t\t\tString currLine;\n\n\t\t\t// continue to append until the end of file has been reached\n\t\t\twhile ((currLine = reader.readLine()) != null) {\n\t\t\t\t// avoiding empty strings\n\t\t\t\tif (!currLine.isEmpty())\n\t\t\t\t\tdocument.add(currLine);\n\t\t\t}\n\t\t\treader.close();\n\t\t\treturn document.toArray(new String[1]);\n\n\t\t} catch (IOException e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t\t// sadly neccessary default return case\n\t\treturn new String[0];\n\t}", "@SuppressWarnings({\"unchecked\"})\n public static Collection<String> getResourceLines(Class resourceLocation, String resource) {\n InputStream input = null;\n Collection<String> lines;\n try {\n input = resourceLocation.getResourceAsStream(resource);\n lines = IOUtils.readLines(input);\n } catch (IOException e) {\n throw new RuntimeException(e); //NOSONAR\n } finally {\n IOUtils.closeQuietly(input);\n }\n return lines;\n }", "String[] readFile(String path) {\n ArrayList<String> list = new ArrayList<>();\n String[] output = null;\n Scanner reader;\n File file;\n\n try {\n file = new File(path);\n reader = new Scanner(file);\n while (reader.hasNextLine()) {\n list.add(reader.nextLine());\n }\n output = new String[list.size()];\n for (int i = 0; i < list.size(); i++) output[i] = list.get(i);\n reader.close();\n } catch (FileNotFoundException e) {\n System.out.println(\"File not found exception\");\n }\n return output;\n }", "private static WebSite[] getClassPathSitesForClassPaths(String[] classPaths)\n {\n // Create sites\n List<WebSite> classFileSites = new ArrayList<>();\n\n // Add JRE jar file site\n WebURL jreURL = WebURL.getURL(List.class);\n assert (jreURL != null);\n WebSite jreSite = jreURL.getSite();\n classFileSites.add(jreSite);\n\n // Try again for Swing (different site for Java 9+: jrt:/java.desktop/javax/swing/JFrame.class)\n Class<?> swingClass = null;\n try { swingClass = Class.forName(\"javax.swing.JFrame\"); }\n catch (Exception ignore) { }\n if (swingClass != null) {\n WebURL swingURL = WebURL.getURL(swingClass);\n assert (swingURL != null);\n WebSite swingSite = swingURL.getSite();\n if (swingSite != jreSite)\n classFileSites.add(swingSite);\n }\n\n // Add project class path sites (build dirs, jar files)\n for (String classPath : classPaths) {\n\n // Get URL for class path\n WebURL classPathURL = WebURL.getURL(classPath);\n if (classPathURL == null) {\n System.err.println(\"ClassTree.getClassFileSitesForResolver: Can't resolve class path entry: \" + classPath);\n continue;\n }\n\n // Get site for class path entry and add to sites\n WebSite classPathSite = classPathURL.getAsSite();\n classFileSites.add(classPathSite);\n }\n\n // Return array\n return classFileSites.toArray(new WebSite[0]);\n }", "public static ArrayList B() {\n int n10;\n ArrayList<String[]> arrayList = new ArrayList<String[]>();\n Object object = Environment.getRootDirectory().getAbsoluteFile();\n ((StringBuilder)((Object)arrayList)).append(object);\n object = File.separator;\n ((StringBuilder)((Object)arrayList)).append((String)object);\n Object object2 = \"etc\";\n ((StringBuilder)((Object)arrayList)).append((String)object2);\n ((StringBuilder)((Object)arrayList)).append((String)object);\n object = \"vold.fstab\";\n ((StringBuilder)((Object)arrayList)).append((String)object);\n arrayList = ((StringBuilder)((Object)arrayList)).toString();\n Object object3 = new File((String)((Object)arrayList));\n arrayList = new ArrayList<String[]>();\n boolean bl2 = ((File)object3).exists();\n if (!bl2) {\n return arrayList;\n }\n object = new ArrayList();\n try {\n object.clear();\n Object object4 = new FileReader((File)object3);\n object2 = new BufferedReader((Reader)object4);\n while ((object3 = ((BufferedReader)object2).readLine()) != null) {\n object4 = \"dev_mount\";\n n10 = ((String)object3).startsWith((String)object4);\n if (n10 == 0) continue;\n object.add(object3);\n }\n ((BufferedReader)object2).close();\n object.trimToSize();\n }\n catch (IOException iOException) {}\n object3 = object.iterator();\n while (bl2 = object3.hasNext()) {\n int n11;\n object = (String)object3.next();\n if (object == null || (object = object.split((String)(object2 = \" \"))) == null || (n11 = ((String[])object).length) < (n10 = 4) || (object = object[n11 = 2]) == null || (n11 = (int)(((File)(object2 = new File((String)object))).exists() ? 1 : 0)) == 0) continue;\n arrayList.add((String[])object);\n }\n return arrayList;\n }", "private BufferedImage readImageDataFromClasspath(String fileName)\n\t\t\tthrows IOException {\n\t\tInputStream in = this.getClass().getClassLoader().getResourceAsStream(\n\t\t\t\tfileName);\n\n\t\treturn ImageIO.read(in);\n\t}", "public static void addAllJarFromClassPath(FlexoResourceCenterService rcService) throws IOException {\n\t\tfor (JarFile file : getClassPathJarFiles()) {\n\t\t\taddJarFile(file, rcService);\n\t\t}\n\t}", "@Classpath\n @InputFiles\n public FileCollection getClasspath() {\n return _classpath;\n }", "public void parse(final Path path) {\n try (FileChannel fileChannel = FileChannel.open(path, StandardOpenOption.READ)) {\n // map class file to the memory\n // by choosing big endian, high order bytes must be put to the buffer before low order bytes\n ByteBuffer byteBuffer = fileChannel.map(FileChannel.MapMode.READ_ONLY, 0, fileChannel.size())\n .order(ByteOrder.BIG_ENDIAN);\n System.out.printf(\"Classfile %s\\n\", path.toString());\n parseConstantPool(byteBuffer);\n } catch (IOException e) {\n e.printStackTrace();\n }\n }" ]
[ "0.7006697", "0.6276295", "0.6058555", "0.59936947", "0.5784446", "0.5748443", "0.5682245", "0.5657504", "0.5618818", "0.55921066", "0.5555699", "0.5555438", "0.5545898", "0.55306274", "0.5519419", "0.5513427", "0.5509308", "0.5474391", "0.5467838", "0.5463271", "0.5447416", "0.5445699", "0.541991", "0.53875667", "0.5360921", "0.53520465", "0.5339752", "0.53081733", "0.5302773", "0.5284123", "0.52711296", "0.5244586", "0.52226335", "0.52057636", "0.51774174", "0.5170337", "0.5166027", "0.5160779", "0.5158115", "0.51521856", "0.5143149", "0.5130768", "0.5123184", "0.5113481", "0.5108075", "0.5107758", "0.5100461", "0.50993204", "0.5098027", "0.5094818", "0.50946647", "0.50945103", "0.50945103", "0.50884247", "0.50866824", "0.5082516", "0.508135", "0.50783074", "0.5072183", "0.50715756", "0.50700057", "0.5067318", "0.5065587", "0.5062695", "0.5054455", "0.50534576", "0.5048836", "0.5048703", "0.5037545", "0.50342774", "0.5027483", "0.501895", "0.5017973", "0.5009159", "0.50060976", "0.5002731", "0.4999587", "0.49926835", "0.49871695", "0.49832478", "0.49744037", "0.49684906", "0.49681646", "0.49631327", "0.49588042", "0.49564537", "0.4954716", "0.49507374", "0.49493408", "0.4946124", "0.49445245", "0.49438775", "0.49396467", "0.4938758", "0.4938093", "0.49365747", "0.49313378", "0.49285215", "0.49246076", "0.491994" ]
0.65122986
1
method reads all lines of a files into a String array from a file on HDD
public String[] ReadAllFileLines(String sFilePath) throws Exception { File f = null; FileInputStream fstream = null; DataInputStream in = null; BufferedReader br = null; String strLine = ""; String[] stemp = null; StringBuffer strbuff = new StringBuffer(); try { //getting file oject f = new File(sFilePath); if (f.exists()) { //get object for fileinputstream fstream = new FileInputStream(f); // Get the object of DataInputStream in = new DataInputStream(fstream); //get object for bufferreader br = new BufferedReader(new InputStreamReader(in, "UTF-8")); //Read File Line By Line while ((strLine = br.readLine()) != null) { strbuff.append(strLine + "##NL##"); } stemp = strbuff.toString().split("##NL##"); } else { throw new Exception("File Not Found!!"); } return stemp; } catch (Exception e) { throw new Exception("ReadAllFileLines : " + e.toString()); } finally { //Close the input stream try { br.close(); } catch (Exception e) { } try { fstream.close(); } catch (Exception e) { } try { in.close(); } catch (Exception e) { } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private String[] readFile(BufferedReader reader) throws IOException {\r\n // Read each line in the file, add it to the ArrayList lines\r\n ArrayList<String> lines = new ArrayList<String>();\r\n String line;\r\n while ((line = reader.readLine()) != null) {\r\n lines.add(line);\r\n }\r\n reader.close();\r\n // Convert the list to an array of type String and return\r\n String[] ret = new String[1];\r\n return (lines.toArray(ret));\r\n }", "String[] readFile(String path) {\n ArrayList<String> list = new ArrayList<>();\n String[] output = null;\n Scanner reader;\n File file;\n\n try {\n file = new File(path);\n reader = new Scanner(file);\n while (reader.hasNextLine()) {\n list.add(reader.nextLine());\n }\n output = new String[list.size()];\n for (int i = 0; i < list.size(); i++) output[i] = list.get(i);\n reader.close();\n } catch (FileNotFoundException e) {\n System.out.println(\"File not found exception\");\n }\n return output;\n }", "public String[] getFile() throws IOException {\n\t\n\t\n\ttry {\n\tFileReader reader = new FileReader(path);\n\tBufferedReader textReader = new BufferedReader(reader); // creates buffered file reader again\n\t\n\tint numberOfLines = getLines(); // calls the method above to know how many lines there are\n\tString[ ] textData = new String[numberOfLines]; //creates an array the size of the amount of lines the file has\n\t\n\tfor (int i=0; i < numberOfLines; i++) {\n\t\ttextData[ i ] = textReader.readLine(); // go through file and read each line into its own array space\n\t\t}\n\t\n\ttextReader.close( ); //reader is done\n\treturn textData; // return array\n\t} catch (IOException e) {\n\t\tString[] exceptionString = new String[1];\n\t\texceptionString[0] = \"nothing\";\n\t\treturn exceptionString;\n\t}\n}", "String[] readFile(File file) {\n ArrayList<String> list = new ArrayList<>();\n String[] output = null;\n Scanner reader = null;\n try {\n if (file.isFile()) {\n reader = new Scanner(file);\n while (reader.hasNextLine()) {\n list.add(reader.nextLine());\n }\n }\n } catch (FileNotFoundException e) {\n System.out.println(\"File not found exception\");\n }\n output = new String[list.size()];\n for (int i = 0; i < list.size(); i++) output[i] = list.get(i);\n reader.close();\n return output;\n }", "public String[] read()\n {\n ArrayList<String> input = new ArrayList<String>();\n try\n {\n dir = new File(contextRef.getFilesDir(), filename);\n if (dir.exists())\n {\n Scanner contacts = new Scanner(dir);\n while (contacts.hasNextLine())\n {\n input.add(contacts.nextLine());\n }\n contacts.close();\n }\n }catch (Exception ex)\n {\n //debug(\"read file contents failure\");\n debug = \"test read failure\";\n }\n return input.toArray(new String[1]);\n }", "@SuppressWarnings(\"resource\")\n \tpublic String[] readTextFileOutputLinesArray(String path, String fileName) throws IOException{\n \t BufferedReader in = new BufferedReader(new FileReader(path + File.separator + fileName));\n \t String str=null;\n \t ArrayList<String> lines = new ArrayList<String>();\n \t while ((str = in.readLine()) != null) {\n \t if (!str.contains(\"helper\") && (str.length() != 0)) { lines.add(str); }\n \t }\n \t String[] linesArray = lines.toArray(new String[lines.size()]);\n \t return linesArray;\n \t}", "static List<String> fileReader(String fileName){\n \n \n //Read a file and store the content in a string array.\n File f = new File(fileName);\n BufferedReader reader = null;\n String tempString = null;\n List<String> fileContent = new ArrayList<String>();\n //String[] fileContent = null;\n //int i = 0;\n \n try {\n reader = new BufferedReader(new FileReader(f));\n while ((tempString = reader.readLine()) != null){\n //while ((fileContent[i] = reader.readLine()) != null){\n fileContent.add(tempString);\n //i++;\n }\n reader.close();\n } catch (FileNotFoundException e) {\n // TODO Auto-generated catch block\n e.printStackTrace();\n } catch (IOException e) {\n // TODO Auto-generated catch block\n e.printStackTrace();\n }\n finally{\n if (reader != null){\n try{\n reader.close();\n }\n catch(IOException e){\n e.printStackTrace();\n }\n }\n }\n \n return fileContent;\n \n }", "public static String[] readAllLines() {\n ArrayList<String> lines = new ArrayList<String>();\n while (hasNextLine()) {\n lines.add(readLine());\n }\n return lines.toArray(new String[lines.size()]);\n }", "private Object[] fetchTextFile(String filePathString){\n try (Stream<String> stream = Files.lines(Paths.get(filePathString))) {\n return stream.toArray();\n }\n catch (IOException ioe){\n System.out.println(\"Could not find file at \" + filePathString);\n return null;\n }\n\n }", "private List<String> readFile(String path) throws IOException {\n return Files.readAllLines (Paths.get (path), StandardCharsets.UTF_8);\n }", "public String[] readLines() {\n\t\tVector linesVector = new Vector(); ;\n\t\ttry {\n\t\t\tFileReader fr = new FileReader(file);\n\t\t\tBufferedReader b = new BufferedReader(fr);\n\t\t\tboolean eof = false;\n\t\t\twhile (!eof) {\n\t\t\t\tString line = b.readLine();\n\t\t\t\tif (line == null) {\n\t\t\t\t\teof = true;\n\t\t\t\t} else {\n\t\t\t\t\tlinesVector.add(line);\n\t\t\t\t}\n\t\t\t}\n\t\t\tb.close();\n\t\t} catch (IOException e) {\n\t\t\tthrow new IllegalArgumentException(\"File \" + file.getName() +\n\t\t\t\t\" is unreadable : \" + e.toString());\n\t\t}\n\t\tString[] lines = new String[linesVector.size()];\n\t\tfor (int i = 0; i < lines.length; i++) {\n\t\t\tlines[i] = (String) (linesVector.get(i));\n\t\t}\n\t\treturn lines;\n\t}", "static String[] copy(Scanner file, int lines){\t\t\n\t\tString[] array = new String[lines];\n\t\tfor(int i = 0; file.hasNextLine(); i++){\n\t\t array[i] = file.nextLine();\n\t\t}\n\t\treturn array;\n\t}", "public List<String> readFileContents(String filePath) throws APIException;", "public static String[] getLines(String filename)\n throws IOException {\n\n\n try (\n FileInputStream inStream = new FileInputStream(filename);\n InputStreamReader reader = new InputStreamReader(inStream);\n BufferedReader buffer = new BufferedReader(reader)\n ) {\n List<String> lines = new LinkedList<>();\n for (String line = buffer.readLine();\n line != null;\n line = buffer.readLine()) {\n line = line.trim();\n if (!line.isEmpty()) {\n lines.add(line);\n }\n }\n return lines.toArray(new String[0]);\n }\n }", "private static String[] readLines(InputStream f) throws IOException {\n\t\tBufferedReader r = new BufferedReader(new InputStreamReader(f, \"US-ASCII\"));\n\t\tArrayList<String> lines = new ArrayList<String>();\n\t\tString line;\n\t\twhile ((line = r.readLine()) != null)\n\t\t\tlines.add(line);\n\t\treturn lines.toArray(new String[0]);\n\t}", "public String readMultipleFromFiles()\n {\n String result = \"\";\n try\n {\n FileReader fileReader = new FileReader(filename);\n try\n {\n StringBuffer stringBuffer = new StringBuffer();\n Scanner scanner = new Scanner(fileReader);\n while (scanner.hasNextLine())\n {\n stringBuffer.append(scanner.nextLine()).append(\"\\n\");\n }\n stringBuffer.delete(stringBuffer.length() - 1, stringBuffer.length());\n result = stringBuffer.toString();\n } finally\n {\n fileReader.close();\n }\n } catch (FileNotFoundException e)\n {\n System.out.println(\"There is no such file called \" + filename);\n } catch (IOException e)\n {\n System.out.println(\"read \" + filename + \" error!!!\");\n } catch (NumberFormatException e)\n {\n System.out.println(\"content in file \" + filename + \" is error\");\n }\n return result;\n }", "public String[] openFile() throws IOException\n\t{\n\t\t//Creates a FileReader and BufferedReader to read from the file that you pass it\n\t\tFileReader fr = new FileReader(path);\n\t\tBufferedReader textReader = new BufferedReader(fr);\n\t\t\n\t\t//Set the variable to the number of lines in the text file through the function in this class that is defined below\n\t\tnumberOfLines = readLines();\n\t\t//Creates an array of strings with size of how many lines of data there are in the file\n\t\tString[] textData = new String[numberOfLines];\n\t\t\n\t\t//Loop to read the lines from the text file for the song data\n\t\tfor (int i = 0; i < numberOfLines; i++)\n\t\t{\n\t\t\t//Read data from song file and into the string list\n\t\t\ttextData[i] = textReader.readLine();\n\t\t}\n\t\t\n\t\t//Close the BufferedReader that was opened\n\t\ttextReader.close();\n\t\t\n\t\t//Return the read data from the text file in the form of a string array\n\t\treturn textData;\n\t}", "protected String[] readInFile(String filename) {\n Vector<String> fileContents = new Vector<String>();\n try {\n InputStream gtestResultStream1 = getClass().getResourceAsStream(File.separator +\n TEST_TYPE_DIR + File.separator + filename);\n BufferedReader reader = new BufferedReader(new InputStreamReader(gtestResultStream1));\n String line = null;\n while ((line = reader.readLine()) != null) {\n fileContents.add(line);\n }\n }\n catch (NullPointerException e) {\n CLog.e(\"Gest output file does not exist: \" + filename);\n }\n catch (IOException e) {\n CLog.e(\"Unable to read contents of gtest output file: \" + filename);\n }\n return fileContents.toArray(new String[fileContents.size()]);\n }", "private static String[] readFile(String path) throws FileNotFoundException{\n\t\tjava.io.File file = new java.io.File(path);\n\t\tjava.util.Scanner sc = new java.util.Scanner(file); \n\t\tStringBuilder content = new StringBuilder();\n\t\twhile (sc.hasNextLine()) {\n\t\t String line = sc.nextLine();\n\t\t if (!line.startsWith(\"!--\")){\n\t\t \tline = line.trim();\n\t\t \tString[] lineContent = line.split(\"/\");\n\t\t \tfor (String entry : lineContent){\n\t\t \t\tcontent.append(entry);\n\t\t \t\tcontent.append(\"/\");\n\t\t \t}\n\t\t \tcontent.append(\"!\");\n\t\t }\n\t\t}\n\t\tsc.close();\n\t\treturn content.toString().split(\"!\");\n\t}", "public List<String> readFile() {\n \n try {\n ensureFileExists();\n return Files.readAllLines(filePath);\n } catch (FileNotFoundException ex) {\n return new ArrayList<>();\n } catch (IOException ex) {\n ex.printStackTrace();\n return new ArrayList<>();\n }\n }", "private static String[] readFile(String file){\n\t\ttry{\n\t\t\tBufferedReader in = new BufferedReader(new FileReader(file));\n\t\t\tString line;\n\t\t\tString data = \"\";\n\t\t\twhile((line = in.readLine()) != null){\n\t\t\t\tdata = data + '\\n' + line;\t\t\t}\n\t\t\tin.close();\n\t\t\tString[] data_array = data.split(\"\\\\n\");\n\t\t\treturn data_array;\n\t\t}\n\t\tcatch(IOException e){\n\t\t\tSystem.out.println(e);\n\t\t}\n\t\tString[] shouldNeverReturn = new String[1];\n\t\treturn shouldNeverReturn;\n\t}", "List readFile(String pathToFile);", "@SuppressWarnings(\"resource\")\n \tpublic String[] readTextFileOutputLinesArray(String fileName) throws IOException{\n \t BufferedReader in = new BufferedReader(new FileReader(Common.testOutputFileDir + fileName));\n \t String str=null;\n \t ArrayList<String> lines = new ArrayList<String>();\n \t while ((str = in.readLine()) != null) {\n \t if (!str.contains(\"helper\") && (str.length() != 0)) { lines.add(str); }\n \t }\n \t String[] linesArray = lines.toArray(new String[lines.size()]);\n \t return linesArray;\n \t}", "public static ArrayList<String> readToString(String filePath) {\n\t\tFile file = new File(filePath);\n\t\tArrayList<String> res = new ArrayList<String>();\n\t\tif (!file.exists()) {\n\t\t\treturn res;\n\t\t}\n\t\ttry {\n\t\t\tFileReader fr = new FileReader(file);\n\t\t\tBufferedReader br = new BufferedReader(fr);\n\t\t\tString str = null;\n\t\t\twhile ((str = br.readLine()) != null) {\n\t\t\t\tres.add(str);\n\t\t\t}\n\t\t\tfr.close();\n\t\t\tbr.close();\n\t\t} catch (Exception e) {\n\t\t\tSystem.out.println(e);\n\t\t}\n\t\treturn res;\n\t}", "public ArrayList<String> createStringArray() throws Exception {\n ArrayList<String> stringsFromFile = new ArrayList<>();\n while (reader.hasNext()) {\n stringsFromFile.add(reader.nextLine());\n }\n return stringsFromFile;\n }", "public static String[] DataCollection(String a) throws FileNotFoundException {\n\tFile file = new File(a); \n \tScanner sc = new Scanner(file); \n \n // Counter variable to count the number of entries in text file\n\tint counter = 0;\n\n\t\n \n\tString[] data = new String[2976];\n // While loop to take in data from text file \n\twhile(sc.hasNextLine())\n\t{\n\t\n\tsc.useDelimiter(\"\\\\Z\"); \n\t\n\t// Inserting data in each line to array\n\tdata[counter] = sc.nextLine();\n\tcounter = counter + 1;\n\t\n\t}\n\treturn data;\n \t}", "public String[] ReadAllFileLines_FromClassPath(String sFileName) {\n String[] satemp = null;\n\n try {\n InputStream is = getClass().getClassLoader().getResourceAsStream(sFileName);\n satemp = getStringArrayFromInputStream(is);\n\n } catch (Exception e) {\n satemp = null;\n throw new Exception(\"ReadAllFileLines_FromClassPath : \" + e.toString());\n } finally {\n return satemp;\n }\n }", "public static List<String> readIn(String filename) throws Exception {\r\n Path filePath = new File(filename).toPath();\r\n Charset charset = Charset.defaultCharset(); \r\n List<String> stringList = Files.readAllLines(filePath, charset);\r\n\r\n return stringList;\r\n }", "public List<String> readFileIntoList(String sourceFilepath) throws IOException {\n List<String> lines = new ArrayList<>();\n URL url = new URL(sourceFilepath);\n BufferedReader reader = new BufferedReader(new InputStreamReader(url.openStream()));\n String line = null;\n while ((line = reader.readLine()) != null) {\n lines.add(line);\n }\n reader.close();\n return lines;\n }", "private List<String> readFile() throws FileNotFoundException {\t\n\t\tList<String> itemsLines = new ArrayList<>();\n\t\tFile inputFile = new File(filePath);\t\n\t\ttry (Scanner newScanner = new Scanner(inputFile)) {\n\t\t\twhile(newScanner.hasNextLine()) {\n\t\t\t\titemsLines.add(newScanner.nextLine());\n\t\t\t}\t\n\t\t}\n\t\treturn itemsLines;\n\t}", "public String[] readFile() {\n\t\t\n\t\tFile file = null;\n\t\tString[] contenu = new String[2];\n\t\tMonFileChooser ouvrir = new MonFileChooser();\n\t\tint resultat = ouvrir.showOpenDialog(null);\n\t\tif (resultat == MonFileChooser.APPROVE_OPTION) {\n\t\t\tfile = ouvrir.getSelectedFile();\n\t\t\tcontenu[0]=file.getName();\n\t\t\n\t\t\n\t\t\ttry {\n\t\t\t\tString fileContent = null;\n\t\t\t\tcontenu[1] = \"\";\n\t\t\t\tBufferedReader br = new BufferedReader(new FileReader(file)); \n\t\t\t\twhile((fileContent = br.readLine()) != null) {\n\t\t\t\t\tif (fileContent != null)\n\t\t\t\t\tcontenu[1] += fileContent+\"\\n\";\n\t\t\t}\n\t\t\t br.close();\n\t\t\t} catch (FileNotFoundException e) {\n\t\t\t\te.printStackTrace();\n\t\t\t} catch (IOException e) {\n\t\t\t\te.printStackTrace();\n\t\t\t}\n\t\t\topenFiles.add(file);\n\t\t}\n\t\treturn contenu;\t\n\t}", "public static String[] readFile() throws FileNotFoundException {\r\n\t\tScanner scan = new Scanner(new File(\"H:/My Documents/Eclipse/wordlist.txt\"));\r\n\t\tArrayList<String> a = new ArrayList<String>();\r\n\t\twhile (scan.hasNextLine()) {\r\n\t\t\ta.add(scan.nextLine());\r\n\t\t}\r\n\t\tString[] w = new String[a.size()];\r\n\t\tfor (int i = 0; i < a.size(); i++) {\r\n\t\t\tw[i] = a.get(i);\r\n\t\t}\r\n\t\tscan.close();\r\n\t\treturn w;\r\n\t}", "List<String> obtenerlineas(String archivo) throws FileException;", "protected List<String> readFile()\n {\n // Base size 620 for Google KML icons. This might be slow for larger\n // sets.\n List<String> lines = New.list(620);\n try (BufferedReader reader = new BufferedReader(\n new InputStreamReader(getClass().getResourceAsStream(myImageList), StringUtilities.DEFAULT_CHARSET)))\n {\n for (String line = reader.readLine(); line != null; line = reader.readLine())\n {\n lines.add(line);\n }\n }\n catch (IOException e)\n {\n LOGGER.warn(e.getMessage());\n }\n return lines;\n }", "private ArrayList<String> readReturnFileContents(String fileName){\n String startingDir = System.getProperty(\"user.dir\");\n BufferedReader reader = null;\n String line = \"\";\n ArrayList<String> wholeFile = new ArrayList<String>();\n try {\n reader = new BufferedReader(new FileReader(startingDir + \"/\" + fileName));\n while ((line = reader.readLine()) != null) {\n wholeFile.add(line);\n }\n } catch (FileNotFoundException fnfe) {\n System.out.println(fnfe.getMessage());\n System.exit(1);\n } catch (NullPointerException npe) {\n System.out.println(npe.getMessage());\n System.exit(1);\n } catch (Exception ex) {\n System.out.println(ex.getMessage());\n System.exit(1);\n }\n return wholeFile;\n }", "private List<String> getLine() throws FileNotFoundException {\n List<String> lines = new ArrayList<>();\n File f = new File(path);\n Scanner s = new Scanner(f);\n while(s.hasNext()){\n lines.add(s.nextLine());\n }\n return lines;\n }", "public String[] readAllLines(){\n\t\tArrayList<String> lines=new ArrayList<>();\n\t\twhile (hasNestLine())\n\t\t\tlines.add(readLine());\n\t\treturn lines.toArray(new String[lines.size()]);\n\t}", "public static List<String> readFile(String fileName){\r\n \r\n List<String> lines = Collections.emptyList();\r\n\r\n try{\r\n lines = Files.readAllLines(Paths.get(fileName));\r\n }\r\n\r\n catch(IOException err){\r\n err.printStackTrace();\r\n }\r\n\r\n return lines;\r\n }", "public List<String> readFileIntoList(String filepath) throws IOException;", "public static List<String> readFile(String filepath) {\n BufferedReader reader = null;\n List<String> fileLines = new ArrayList<String>();\n try {\n File file = new File(filepath);\n String encoding = \"UTF8\";\n reader = new BufferedReader(new InputStreamReader(new FileInputStream(file), encoding));\n \n String line = reader.readLine();\n while (line != null) {\n fileLines.add(line);\n line = reader.readLine();\n }\n } catch (UnsupportedEncodingException e) {\n e.printStackTrace();\n } catch (FileNotFoundException e) {\n e.printStackTrace();\n } catch (IOException e) {\n e.printStackTrace();\n } finally {\n try {\n reader.close();\n } catch (IOException e) {\n // Ignore exception because reader was not initialized\n }\n }\n return fileLines;\n }", "private String[] readFile(String location) {\n\t\ttry {\n\t\t\tBufferedReader reader = new BufferedReader(new FileReader(location));\n\t\t\tArrayList<String> document = new ArrayList<String>();\n\t\t\tString currLine;\n\n\t\t\t// continue to append until the end of file has been reached\n\t\t\twhile ((currLine = reader.readLine()) != null) {\n\t\t\t\t// avoiding empty strings\n\t\t\t\tif (!currLine.isEmpty())\n\t\t\t\t\tdocument.add(currLine);\n\t\t\t}\n\t\t\treader.close();\n\t\t\treturn document.toArray(new String[1]);\n\n\t\t} catch (IOException e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t\t// sadly neccessary default return case\n\t\treturn new String[0];\n\t}", "public static String[] getLines (final String pFilename) throws FileNotFoundException {\n\t\tFile file = new File (pFilename); \n\t\tScanner scanner = new Scanner (file); \n\t\t\n\t\tArrayList<String> lines = new ArrayList<String> (); \n\t\twhile (scanner.hasNextLine()) {\n\t\t\tString line = scanner.nextLine(); \n\t\t\tif (!line.isEmpty())\n\t\t\t\tlines.add(line); \n\t\t}\n\t\tscanner.close(); \n\t\t\n\t\treturn lines.toArray(new String [0]); \n\t}", "public static ArrayList<String> loadFileStrings(File f) {\n\t\tArrayList<String> fileStrings = new ArrayList<String>();\n\t\ttry {\n\t\t\tBufferedReader br = new BufferedReader(new FileReader(f));\n\t\t\tString line;\n\t\t\twhile ((line = br.readLine()) != null)\n\t\t\t\tfileStrings.add(line);\n\t\t\tbr.close();\n\t\t} catch(Exception e) {\n\t\t\te.printStackTrace();\n\t\t\tSystem.exit(0);\n\t\t}\n\t\treturn fileStrings;\n\t}", "public static List<String> getData(String fileNameLocation) {\n\t\tString fileName = fileNameLocation;\n\t\t// ArrayList r = new ArrayList();\n\t\tList<String> readtext = new ArrayList();\n\t\t// This will reference one line at a time\n\t\tString line = null;\n\t\ttry {\n\t\t\t// - FileReader for text files in your system's default encoding\n\t\t\t// (for example, files containing Western European characters on a\n\t\t\t// Western European computer).\n\t\t\t// - FileInputStream for binary files and text files that contain\n\t\t\t// 'weird' characters.\n\t\t\tFileReader fileReader = new FileReader(fileName);\n\t\t\t// Always wrap FileReader in BufferedReader.\n\t\t\tBufferedReader bufferedReader = new BufferedReader(fileReader);\n\t\t\tint index = 0;\n\t\t\twhile ((line = bufferedReader.readLine()) != null) {\n\t\t\t\treadtext.add(line);\n\t\t\t\t// System.out.println(line);\n\t\t\t}\n\t\t\t// Always close files.\n\t\t\tbufferedReader.close();\n\t\t} catch (FileNotFoundException ex) {\n\t\t\tSystem.out.println(\"Unable to open file '\" + fileName + \"'\");\n\t\t} catch (IOException ex) {\n\t\t\tSystem.out.println(\"Error reading file '\" + fileName + \"'\");\n\t\t\t// Or we could just do this: // ex.printStackTrace(); }\n\t\t}\n\t\t// System.out.println(\"Results after stored to array\" +\n\t\t// readtext..toString());\n\t\t// for (String string : readtext) {\n\t\t// System.out.println(string);\n\t\t// }\n\t\treturn readtext;\n\t}", "public ArrayList<String> readFile() {\n data = new ArrayList<>();\n String line = \"\";\n boolean EOF = false;\n\n try {\n do {\n line = input.readLine();\n if(line == null) {\n EOF = true;\n } else {\n data.add(line);\n }\n } while(!EOF);\n } catch(IOException io) {\n System.out.println(\"Error encountered.\");\n }\n return data;\n }", "private static List<String> readFile(File file) throws IOException {\n return Files.readAllLines(file.toPath());\n }", "private static List<String> readFile(File file) throws IOException {\n return Files.readAllLines(file.toPath());\n }", "private static ArrayList<String> readFile() throws ApplicationException {\r\n\r\n ArrayList<String> bookList = new ArrayList<>();\r\n\r\n File sourceFile = new File(FILE_TO_READ);\r\n try (BufferedReader input = new BufferedReader(new FileReader(sourceFile))) {\r\n\r\n if (sourceFile.exists()) {\r\n LOG.debug(\"Reading book data\");\r\n String oneLine = input.readLine();\r\n\r\n while ((oneLine = input.readLine()) != null) {\r\n\r\n bookList.add(oneLine);\r\n\r\n }\r\n input.close();\r\n } else {\r\n throw new ApplicationException(\"File \" + FILE_TO_READ + \" does not exsit\");\r\n }\r\n } catch (IOException e) {\r\n LOG.error(e.getStackTrace());\r\n }\r\n\r\n return bookList;\r\n\r\n }", "public static String[] readStrings() {\n return readAllStrings();\n }", "public ArrayList<String> loadLines(String filename) {\n ArrayList<String> lines = new ArrayList<String>();\n String[] rawLines = loadStrings(filename);\n for(String str : rawLines) {\n if(str != null && !str.isEmpty()){\n lines.add(str);\n }\n }\n return lines;\n }", "public static List<String> loadLinesFromFile(String path) {\n\t\tPath Filepath = Paths.get(path);\n\t\ttry {\n\t\t\tList<String> lines = Files.readAllLines(Filepath);\n\t\t\treturn lines;\n\t\t} catch (IOException e) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\te.printStackTrace();\n\t\t}\n\t\treturn new ArrayList<String>();\n\t}", "private ArrayList<char[]> getFileAsResourceByCharsNewLineDelineated(Class c){\n ArrayList<char[]> charLines = new ArrayList<char[]>();\n try{\n s = new Scanner(c.getResourceAsStream(resourceName)); \n while (s.hasNextLine()){\n char[] line = s.nextLine().toCharArray();\n charLines.add(line);\n }\n } catch(Exception e){\n e.printStackTrace();\n }\n return charLines;\n }", "public static List<String> readLines(String path) {\n ArrayList<String> lines = new ArrayList<>();\n\n //open file\n File file = new File(path);\n\n //Error if not readable\n if (!file.canRead()) {\n System.err.println(\"File \" + file.getAbsolutePath() + \" could not be read!\");\n System.exit(1);\n }\n\n //Return lines\n try {\n BufferedReader inputStream;\n inputStream = new BufferedReader(new FileReader(file));\n String line;\n while ((line = inputStream.readLine()) != null) {\n lines.add(line);\n }\n\n inputStream.close();\n } catch (FileNotFoundException ex) {\n System.err.println(file.getAbsolutePath() + \" not found!\");\n System.exit(1);\n } catch (IOException ex) {\n System.err.println(ex);\n System.exit(1);\n }\n\n return lines;\n }", "private String[] readFile(String path) throws StorageException {\r\n try {\r\n return readFile(new BufferedReader(new FileReader(new File(path))));\r\n } catch (Exception exception) {\r\n throw new StorageException(\"Cannot read file \" + path + \":\" + exception.getMessage());\r\n }\r\n }", "public static String[] readFile(String fn) {\n\n try {\n\n FileReader fr = new FileReader(fn); // read the file\n // store contents in a buffer\n BufferedReader bfr = new BufferedReader(fr);\n // an string array list for storing each line of content\n ArrayList<String> content = new ArrayList<String>();\n String p = null; // temper string for passing each line of contents\n while ((p = bfr.readLine()) != null) {\n content.add(p);\n }\n\n // String array for storing content\n String[] context = new String[content.size()];\n\n for (int i = 0; i < content.size(); i++) {\n context[i] = content.get(i);\n }\n\n bfr.close(); // close the buffer\n return context;\n\n } catch (FileNotFoundException e) {\n System.out.println(\"File not found: \" + e.getMessage());\n System.exit(0);\n } catch (IOException e) {\n // TODO Auto-generated catch block\n System.out.println(\"I/O Ooops: \" + e.getMessage());\n System.exit(0);\n }\n\n // If an exception occurred we will get to here as the return statement\n // above was not executed\n // so setup a paragraphs array to return which contains the empty string\n String[] context = new String[1];\n context[0] = \"\";\n return context;\n\n }", "private String[] loadFile(String filename) {\n\t\treturn loadFile(filename, new String[0], System.lineSeparator());\n\t}", "static List<String> fileToList(){\n List<String> contacts = null;\n try {\n Path contactsListPath = Paths.get(\"contacts\",\"contacts.txt\");\n contacts = Files.readAllLines(contactsListPath);\n } catch (IOException ioe){\n ioe.printStackTrace();\n }\n return contacts;\n }", "public void readFile(String filePath) {\n\n\t\tFile file = new File(filePath);\n\t\t\n\t\ttry {\n\t\t\tScanner sc = new Scanner(file);\n \t while(sc.hasNextLine() ) {\t\t \t \n\t\t \t String line = sc.nextLine();\t\t \t \n\t\t \t linesArray.add( line.split(\",\") );\t\n\t\t \t \n\t\t\t}\n\t\t \t\t \n\t\t} catch (FileNotFoundException e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t\t\t\t\n\t\n\t}", "public static List<String> readListOfStringsFromFile(String filePath) throws IOException {\n List<String> list = new ArrayList<>();\n Files.lines(Paths.get(filePath), StandardCharsets.UTF_8).forEach(list::add);\n return list;\n }", "static List<String> readDataFile(String filePath) throws Exception {\n\t\t// System.out.println(filePath);\n\t\tList<String> sortList = new ArrayList<String>();\n\n\t\tFileReader file = new FileReader(new File(filePath));\n\n\t\tBufferedReader bufRead = new BufferedReader(file);\n\n\t\tfor (long line = 0; line < linesPerFile; line++) {\n\n\t\t\tsortList.add((bufRead.readLine().toString()));\n\t\t}\n\n\t\tbufRead.close();\n\t\treturn sortList;\n\t}", "public static ArrayList<String> readLines(String fileName){\n\t\treturn read(fileName, false);\n\t}", "public ArrayList<String> fileRead(String fileName) {\n String line = null;\n ArrayList<String> list = new ArrayList<>();\n try {\n // FileReader reads text files in the default encoding.\n FileReader fileReader = new FileReader(fileName);\n\n // Always wrap FileReader in BufferedReader.\n BufferedReader bufferedReader = new BufferedReader(fileReader);\n\n while ((line = bufferedReader.readLine()) != null) {\n list.add(line);\n }\n\n // Always close files.\n bufferedReader.close();\n } catch (FileNotFoundException ex) {\n System.out.println(\"Unable to open file '\" + fileName + \"'\");\n\n } catch (IOException ex) {\n System.out.println(\"Error reading file '\" + fileName + \"'\");\n }\n return list;\n }", "private ArrayList<String> readEntriesFromFile(String nameOfFile){\n\t\tArrayList<String> foundEntries = new ArrayList<String>();\n\t\t\n\t\ttry{\n\t\t\tFile file = new File(nameOfFile); \n\t\t\tScanner fileIn = new Scanner(file);\n\t\t\twhile (fileIn.hasNext()){\n\t\t\t\tString currentLine = fileIn.nextLine();\n\t\t\t\tfoundEntries.add(currentLine);\n\t\t\t} \n\t\t\tfileIn.close();\n\t\t}catch (IOException e){\n\t\t}\n\t\t\n\t\tif(foundEntries.size()==0){\n\t\t return null;\n\t\t}else{\n\t\t\treturn foundEntries;\n\t\t}\n\t}", "public static String readAllStrings(String fileName) throws FileNotFoundException{\r\n StringBuilder sb=new StringBuilder();\r\n fileExists(fileName);\r\n log.fine(\"Reading of all strings from file: \"+fileName);\r\n try {\r\n BufferedReader in=new BufferedReader(new FileReader(fileName));\r\n try {\r\n String s;\r\n while ((s=in.readLine())!=null){\r\n sb.append(s);\r\n sb.append(\"\\n\");\r\n }\r\n }finally {\r\n in.close();\r\n }\r\n }catch (IOException e){\r\n throw new RuntimeException(e);\r\n }\r\n return sb.toString();\r\n }", "public static void read6() {\n List<String> list = new ArrayList<>();\n\n try (BufferedReader br = Files.newBufferedReader(Paths.get(filePath))) {\n\n //br returns as stream and convert it into a List\n list = br.lines().collect(Collectors.toList());\n\n } catch (IOException e) {\n e.printStackTrace();\n }\n\n list.forEach(System.out::println);\n }", "public static List<String> readFileAsList(String filePath) {\n\n\t\tBufferedReader readFile = null;\n\t\tString line = null;\n\t\tList<String> fileContents = new ArrayList<String>();\n\t\ttry {\n\t\t\treadFile = new BufferedReader((new FileReader(filePath)));\n\t\t\twhile ((line = readFile.readLine()) != null)\n\t\t\t\tfileContents.add(line);\n\t\t\treadFile.close();\n\t\t\treturn fileContents;\n\t\t} catch (FileNotFoundException e) {\n\t\t\tSystem.out.println(\"Unable to find file: \" + filePath);\n\t\t\te.printStackTrace();\n\t\t} catch (IOException e) {\n\t\t\tSystem.out.println(\"Unable to read file: \" + filePath);\n\t\t\te.printStackTrace();\n\t\t}\n\t\treturn fileContents;\n\t}", "public static List<String> readAllLines(String filePath) {\n\t\ttry {\n\t\t\treturn (List<String>)FileUtils.readLines(new File(filePath));\n\t\t} catch (IOException e) {\n\t\t\tthrow new FileDoesntExistException(filePath);\n\t\t}\n\t}", "public List<String> readFileByLine(String filePath, String fileName) {\n\t\tList<String> contents = new ArrayList<String>();\n\t\t\n\t\t//filePath가 url이냐 local dir이냐에 따라 로직 달라짐\n\t\tboolean isUrlPath;\n\t\tif (filePath.contains(\"://\")) {\n\t\t\tisUrlPath = true;\n\t\t} else {\n\t\t\tisUrlPath = false;\n\t\t}\n\t\t\n\t\tBufferedReader br = null;\n\t\ttry {\n\t\t\tif (isUrlPath) {\n\t\t\t\t\n\t\t\t\tURL url = new URL(filePath+fileName);\n\t\t\t\tURLConnection connection = url.openConnection();\n\t\t\t\tbr = new BufferedReader(new InputStreamReader(connection.getInputStream()));\n\t\t\t\t\n\t\t\t} else {\n\t\t\t\t\n\t\t\t\tFile targetFile = new File(filePath, fileName);\n\t\t\t\tif(!targetFile.exists()) {\n\t\t\t\t\treturn contents;\n\t\t\t\t} else {\n\t\t\t\t\tbr = new BufferedReader(new FileReader(targetFile));\n\t\t\t\t}\n\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t\tString line = null;\n\t\t\tdo {\n\t\t\t\tline = br.readLine();\n\t\t\t\tif (line != null) {\n\t\t\t\t\tline = new String( line.getBytes(\"utf-8\"));\n\t\t\t\t\tcontents.add(line);\n\t\t\t\t}\n\t\t\t} while (line != null);\n\t\t\t\n\t\t} catch (FileNotFoundException e) {\n\t\t\te.printStackTrace();\n\t\t} catch (IOException e) {\n\t\t\te.printStackTrace();\t\n\t\t} finally {\n\t\t\tif (br != null)\n\t\t\t\ttry {\n\t\t\t\t\tbr.close();\n\t\t\t\t} catch (IOException e) {\n\t\t\t\t\te.printStackTrace();\n\t\t\t\t}\n\t\t}\n\t\treturn contents;\n\t}", "public String readLines() {\n\n String fileAsString;\n fileAsString = read();\n StringBuilder newString = new StringBuilder();\n if (fileAsString != null) {\n if (fromLine == toLine) {\n\n newString = new StringBuilder(fileAsString.split(\"\\n\")[fromLine - 1]);\n return newString.toString();\n } else {\n if (toLine > fileAsString.split(\"\\n\").length) {\n toLine = fileAsString.split(\"\\n\").length;\n }\n ;\n for (int i = fromLine - 1; i < toLine; i++) {\n\n newString.append(fileAsString.split(\"\\n\")[i]).append(\"\\n\");\n\n\n }\n }\n\n }\n\n\n return newString.toString();\n }", "private String[] readFile(InputStream stream) throws StorageException {\r\n try {\r\n return readFile(new BufferedReader(new InputStreamReader(stream)));\r\n } catch (Exception exception) {\r\n throw new StorageException(\"Cannot read file \");\r\n }\r\n }", "public static ArrayList<String> textToStr(String path) throws IOException {\n ArrayList<String> lines = new ArrayList<>();\n try{\n File file = new File(path);\n FileReader fr = new FileReader(file);\n BufferedReader bufr = new BufferedReader(fr);\n String line = \"\";\n while((line = bufr.readLine()) != null){\n if(line.trim() != null && line.trim().length() > 0){\n lines.add(line.trim());\n }\n }\n return lines;\n }\n catch (Exception e){\n System.out.println(\"The path is wrong or the input file does not exist. Try again.\\n\");\n return null;\n }\n }", "public Vector<String> read(String path) throws FileNotFoundException, IOException {\n file = new File(path);\n fread = new FileReader(file);\n buf = new BufferedReader(fread);\n\n String temp;\n Vector<String> working = new Vector<String>();\n\n while (true) {\n temp = buf.readLine();\n\n if (temp == null) {\n break;\n } else {\n working.add(temp);\n }\n }\n\n return working;\n }", "public String readFile(){\r\n StringBuffer str = new StringBuffer(); //StringBuffer is a mutable string\r\n Charset charset = Charset.forName(\"UTF-8\"); //UTF-8 character encoding\r\n Path file = Paths.get(filename + \".txt\");\r\n try (BufferedReader reader = Files.newBufferedReader(file, charset)) { // Buffer: a memory area that buffered streams read\r\n String line = null;\r\n while ((line = reader.readLine()) != null) { //Readers and writers are on top of streams and converts bytes to characters and back, using a character encoding\r\n str.append(line + \"\\n\");\r\n }\r\n }\r\n catch (IOException x) {\r\n System.err.format(\"IOException: %s%n\", x);\r\n }\r\n return str.toString();\r\n }", "public ArrayList<String> readFromFile(String fileName) throws IOException {\n\t\tBufferedReader reader = new BufferedReader(new FileReader(fileName));\n\t ArrayList<String> retour = new ArrayList<String>();\n\t String line = null;\n\t while((line = reader.readLine()) != null) \n\t \tretour.add(line);\n\t \n\t reader.close();\n\t return retour; \n\t}", "public List<String[]> readArticlesFromDirectory(String path) throws FileNotFoundException, IOException {\n List<String[]> res = new ArrayList();\n final File directory = new File(path);\n for(final File article : directory.listFiles()) {\n BufferedReader br = new BufferedReader(new FileReader(article));\n String line;\n String[] str = new String[2];\n int label = 0;\n while((line = br.readLine()) != null) {\n if(label == 0) {\n str[0] = line;\n str[1] = \"\";\n label ++; \n }\n str[1] += line;\n }\n \n res.add(str);\n }\n return res;\n }", "protected List<List<String>> readFile() throws FileNotFoundException {\n\n List<List<String>> list = new ArrayList<>();\n\n File dire = new File(dir);\n File file = new File(dire, filename);\n\n try (Scanner in = new Scanner(file)) {\n\n while (in.hasNextLine()) {\n \n String line = in.nextLine();\n \n String temp[] = line.split(delimiter);\n \n list.add(Arrays.asList(temp));\n }\n in.close();\n } catch (IOException e) {\n System.out.println(\"Error reading file!\");\n }\n return list;\n }", "public static ArrayList<String> Readfile(String fileName) {\n\t\t\t\t\t// This will reference one line at a time\n\t\t\t\t\tArrayList<String> doc = new ArrayList<String>();\n\t\t\t\t\tString line = null;\n\t\t\t\t\tString fileNamehere = fileName;\n\t\t\t\t\ttry {\n\t\t\t\t\t\t// FileReader reads text files in the default encoding.\n\t\t\t\t\t\tFileReader fileReader = new FileReader(fileName);\n\n\t\t\t\t\t\t// Always wrap FileReader in BufferedReader.\n\t\t\t\t\t\tBufferedReader bufferedReader = new BufferedReader(fileReader);\n\n\t\t\t\t\t\twhile ((line = bufferedReader.readLine()) != null) {\n\t\t\t\t\t\t\tdoc.add(line);\n\t\t\t\t\t\t}\n\t\t\t\t\t\t// Always close files.\n\t\t\t\t\t\tbufferedReader.close();\n\t\t\t\t\t} catch (FileNotFoundException ex) {\n\t\t\t\t\t\tSystem.out.println(\"file not found '\" + fileName + \"'\");\n\t\t\t\t\t} catch (IOException ex) {\n\t\t\t\t\t\tex.printStackTrace();\n\t\t\t\t\t}\n\t\t\t\t\treturn doc;\n\t}", "public ArrayList<String> readFromFile(){\n ArrayList<String> results = new ArrayList<>();\n //Wrap code in a try/ catch to help with exception handling.\n try{\n //Create a object of Scanner class\n Scanner s = new Scanner(new FileReader(path));\n //While loop for iterating thru the file.\n // Reads the data and adds it to the ArrayList.\n while(s.hasNext()) {\n String c1 = s.next();\n String c2 = s.next();\n String w = s.next();\n results.add(c1);\n results.add(c2);\n results.add(w);\n }return results;\n\n }//File not found exception block.\n catch(FileNotFoundException e){\n System.out.println(e);\n }\n return results;//default return.\n }", "public List<String> getStrings(String fileName) throws IOException {\n\n List<String> items = readFile (fileName);\n String text = String.join (\"\", items);\n\n return normalizeCsv (text + \" \");\n }", "private void ReadInputFile(String filePath){\n String line;\n\n try{\n BufferedReader br = new BufferedReader(new FileReader(filePath));\n while((line = br.readLine()) != null){\n //add a return at each index\n inputFile.add(line + \"\\r\");\n }\n\n\n }catch(IOException ex){\n System.out.print(ex);\n }\n\n }", "private String[] getTxt(String[] allFiles) {\n int numTxtFiles = 0;\n\n for(int i = 0; i<allFiles.length; i++) {\n try {//May be exceptions if the tring is shorter than 4 characters and not a .txt\n String end = allFiles[i].substring(allFiles[i].length()-4);\n\n if(end.contentEquals(\".txt\")) {\n numTxtFiles++;\n }\n\n }catch(Exception e) {}\n\n }\n\n String[] txtFiles = new String[numTxtFiles];\n int pos = 0;\n\n for(int i = 0; i<allFiles.length; i++) {\n try {//May be exceptions if the tring is shorter than 4 characters and not a .txt\n String end = allFiles[i].substring(allFiles[i].length()-4);\n\n if(end.contentEquals(\".txt\")) {\n txtFiles[pos] = allFiles[i];\n pos++;\n }\n\n }catch(Exception e) {}\n\n }\n\n return txtFiles;\n }", "public static List<List<String>> readFile() {\r\n List<List<String>> out = new ArrayList<>();\r\n File dir = new File(\"./tmp/data\");\r\n dir.mkdirs();\r\n File f = new File(dir, \"storage.txt\");\r\n try {\r\n f.createNewFile();\r\n Scanner s = new Scanner(f);\r\n while (s.hasNext()) {\r\n String[] tokens = s.nextLine().split(\"%%%\");\r\n List<String> tokenss = new ArrayList<>(Arrays.asList(tokens));\r\n out.add(tokenss);\r\n }\r\n return out;\r\n } catch (IOException e) {\r\n throw new Error(\"Something went wrong: \" + e.getMessage());\r\n }\r\n }", "default String[][] txtReader(String fileString) {\n\t\ttry {\n\t\t\tScanner myReader = new Scanner(new File(fileString));\n\t\t\tArrayList<String[]> lines = new ArrayList<>();\n\n\t\t\twhile (myReader.hasNextLine()) {\n\t\t\t\tString[] splitted = myReader.nextLine().split(\" \");\n\t\t\t\tlines.add(splitted);\n\t\t\t}\n\n\t\t\tString[][] result = new String[lines.size()][];\n\t\t\tfor (int i = 0; i < result.length; i++) {\n\t\t\t\tresult[i] = lines.get(i);\n\t\t\t}\n\t\t\treturn result;\n\t\t} catch (Exception e) {\n\t\t\tSystem.out.println(\"file is not occurred \" + e.getMessage());\n\t\t}\n\t\treturn null;\n\n\t}", "private ArrayList<String> readFileAndCountLines(File fileName) throws IOException\n\t{\n\t\tString line = \"\";\n\t\tFileReader strm_reader = null;\n\t\tBufferedReader bffr_reader = null;\n\t\tArrayList<String> fileContents = new ArrayList<String>();\n\t\t\n\t\ttry\n\t\t{\n\t\t\tstrm_reader = new FileReader(fileName);\t\n\t\t\tbffr_reader = new BufferedReader(strm_reader);\n\t\t\t\n\t\t\twhile((line = bffr_reader.readLine()) != null)\n\t\t\t{\n\t\t\t\t//Add the contents of a file in a variable\n\t\t\t\tfileContents.add(line);\n\t\t\t\t//Counts the number of routers\n\t\t\t\tfileLineCount++;\n\t\t\t}\n\t\t\tif(fileContents.isEmpty())\n\t\t\t\tSystem.out.println(\"The File is Empty!\");\n\t\t}\n\t\tcatch(Exception e)\n\t\t{\n\t\t\tSystem.out.println(\"File not Found!\");\n\t\t}\n\t\tfinally\n\t\t{\n\t\t\tif(bffr_reader != null)\n\t\t\t\tbffr_reader.close();\n\t\t\tif(strm_reader != null)\n\t\t\t\tstrm_reader.close();\n\t\t}\n\t\treturn fileContents;\n\t}", "public String readFileBufferedReader() {\n String result = \"\";\n BufferedReader in = null;\n try {\n in = new BufferedReader(new FileReader(new File(ALICE_PATH)));\n\n for (String x = in.readLine(); x != null; x = in.readLine()) {\n result = result + x + '\\n';\n }\n\n } catch (IOException e) {\n }\n\n if(in != null)try {\n in.close();\n } catch (IOException e) {\n }\n\n return result;\n }", "public static ArrayList<String> leerTXT(String path) {\n\t\t\n\t\tFile archivo = new File(path);\n\t\tFileReader fr;\n\t\tBufferedReader br;\n\t\tArrayList<String> lineas = new ArrayList<String>();\n\t\t\n\t\ttry {\n\t\t\t\n\t\t\tfr = new FileReader(archivo);\n\t\t\tbr = new BufferedReader(fr);\n\t\t\t\n\t\t\t\n\t\t\tString linea = \"\";\n\t\t\t\n\t\t\twhile((linea = br.readLine()) != null) {\n\t\t\t\tlineas.add(linea);\n\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t\t\n\t\t\tbr.close();\n\t\t\tfr.close();\n\t\t\t\n\t\t\t\n\t\t} catch (Exception e) {\n\t\t\tJOptionPane.showMessageDialog(null, \"Ha sucedido un error leyendo el archivo \" + e);\n\t\t}\n\t\t\n\t\treturn lineas;\n\t}", "private static List<String[]> readInput(String filePath) {\n List<String[]> result = new ArrayList<>();\n int numOfObject = 0;\n\n try {\n Scanner sc = new Scanner(new File(filePath));\n sc.useDelimiter(\"\");\n if (sc.hasNext()) {\n numOfObject = Integer.parseInt(sc.nextLine());\n }\n for (int i=0;i<numOfObject;i++) {\n if (sc.hasNext()) {\n String s = sc.nextLine();\n if (s.trim().isEmpty()) {\n continue;\n }\n result.add(s.split(\" \"));\n }\n }\n sc.close();\n }\n catch (FileNotFoundException e) {\n System.out.println(\"FileNotFoundException\");\n }\n return result;\n }", "public ArrayList<String> readFile(File file) {\n\t\tArrayList<String> al = new ArrayList<String>();\n\t\ttry {\n\t\t\tif (file.exists()) {\n\t\t\t\tFileReader fr = new FileReader(file);\n\t\t\t\tBufferedReader br = new BufferedReader(fr);\n\t\t\t\tString line;\n\t\t\t\tbr.readLine();\n\t\t\t\twhile((line = br.readLine()) != null) {\n\t\t\t\t\tal.add(line);\n\t\t\t\t\tSystem.out.println(line);\n\t\t\t\t}\n\t\t\t\tbr.close();\n\t\t\t}\n\t\t} catch (IOException e) {\t\n\t\t\t}\n\t\treturn al;\n\t\t}", "static List<String> read() {\n String fileName = getFilePath();\n List<String> urls = new ArrayList<>();\n \n if (Files.notExists(Paths.get(fileName))) {\n return urls;\n }\n \n try (Stream<String> stream = Files.lines(Paths.get(fileName))) {\n urls = stream\n // Excludes lines that start with # as that is used for comments\n // and must start with http:// as that is required by crawler4j.\n .filter(line -> !line.startsWith(\"#\") &&\n line.startsWith(\"http://\") || line.startsWith(\"https://\"))\n .map(String::trim)\n .map(String::toLowerCase)\n .collect(Collectors.toList());\n } catch (IOException e) {\n e.printStackTrace();\n }\n \n return urls;\n }", "public static List<Server> readFile() {\n String fileName = \"servers.txt\";\n\n List<Server> result = new LinkedList<>();\n try (Scanner sc = new Scanner(createFile(fileName))) {\n\n while (sc.hasNextLine()) {\n String line = sc.nextLine();\n result.add(lineProcessing(line));\n\n }\n\n } catch (FileNotFoundException e) {\n System.out.println(\"File is not found\");\n } catch (MyException e) {\n System.out.println(\"File is corrupted\");\n }\n return result;\n }", "public static String[] readLines(String url) throws IOException {\r\n\r\n BufferedReader bufferedReader = new BufferedReader(new FileReader(url));\r\n List<String> lines = null;\r\n try {\r\n lines = new ArrayList();\r\n String line;\r\n while ((line = bufferedReader.readLine()) != null) {\r\n lines.add(line);\r\n }\r\n\r\n } catch (Exception e) {\r\n e.printStackTrace();\r\n }\r\n return lines.toArray(new String[lines.size()]);\r\n\r\n }", "public static String allRows(String filePath) {\n\t\tArrayList<String> allRows = new ArrayList<String>();\n\t\ttry { // to catch IOException from read\n\t\t\tBufferedReader input = new BufferedReader(new FileReader(filePath));\n\t\t\tfor (int i = 0; i < LineCount.lineCount(filePath); i++) {\n\t\t\t\tallRows.add(input.readLine());\n\t\t\t}\n\t\t} catch (IOException e) {\n\t\t\tMain.debug.LOGWarning(e.toString());\n\t\t}\n\t\t\n\t\treturn allRows.toString();\n\t}", "public static List<String> readLines( String resources, String fileName) {\n List<String> resultList = new ArrayList<String>();\n File textFile = new File( resources, fileName );\n BufferedReader br = null;\n \n try{\n //System.out.println(\"debug: textFile.getCanonicalPath() : \" + \n // textFile.getCanonicalPath() );\n \n br = new BufferedReader( \n new InputStreamReader( \n new FileInputStream( textFile )));\n String lineOfText;\n while( (lineOfText = br.readLine()) != null ) {\n resultList.add( lineOfText );\n }\n\n } catch( IOException ioe) {\n System.err.println(\"BufferedReader does not read\");\n } finally { \n try { \n br.close(); \n } catch (IOException ioe) {\n System.err.println(\"BufferedReader did not close \" +\n \"properly.\");\n }\n }\n\n \n return resultList;\n }", "@Override\n\tpublic void ReadTextFile() {\n\t\t// Using a programmer-managed byte-array\n\t\ttry (FileInputStream in = new FileInputStream(inFileStr)) {\n\t\t\tstartTime = System.nanoTime();\n\t\t\tbyte[] byteArray = new byte[bufferSize];\n\t\t\tint bytesCount;\n\t\t\twhile ((bytesCount = in.read(byteArray)) != -1) {\n\t\t\t\tsnippets.add(new String(byteArray));\n\t\t\t}\n\t\t\tin.close();\n\t\t} catch (IOException ex) {\n\t\t\tex.printStackTrace();\n\t\t}\n\t}", "private ArrayList<String> readStringsFromFile(File f, String stringSeparator)\r\n\t\t\tthrows EasyCorrectionException {\r\n\t\tArrayList<String> contentOfFile = new ArrayList<String>();\r\n\t\tbyte[] buffer = new byte[(int) f.length()];\r\n\t\tBufferedInputStream stream = null;\r\n\t\ttry {\r\n\t\t\tstream = new BufferedInputStream(new FileInputStream(f));\r\n\t\t\tstream.read(buffer);\r\n\t\t} catch (IOException e) {\r\n\t\t\tthrow new EasyCorrectionException(\"The file \" + f.getName()\r\n\t\t\t\t\t+ \" could not be read during the Output Comparison!\");\r\n\t\t} finally {\r\n\t\t\ttry {\r\n\t\t\t\tif (stream != null) {\r\n\t\t\t\t\tstream.close();\r\n\t\t\t\t}\r\n\t\t\t} catch (IOException e) {\r\n\t\t\t\tthrow new EasyCorrectionException(\"The file \" + f.getName()\r\n\t\t\t\t\t\t+ \" could not be closed during the Output Comparison!\");\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tfor (String string : new String(buffer).split(stringSeparator)) {\r\n\t\t\tcontentOfFile.add(string);\r\n\t\t}\r\n\r\n\t\treturn contentOfFile;\r\n\t}", "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}", "private List<String> readFile(String fileName)\n {\n try\n {\n String file = new String(Files.readAllBytes(Paths.get(fileName)), Charset.forName(\"ISO-8859-1\"));\n file = file\n .toLowerCase()\n .replaceAll(\"[^\\\\w]+\", \" \")\n .replaceAll(\"[0-9]\", \"\");\n Tokenizer tokenizer = SimpleTokenizer.INSTANCE;\n String[] tokens = tokenizer.tokenize(file);\n return Arrays.asList(tokens);\n }\n catch (IOException e)\n {\n e.printStackTrace();\n }\n return new ArrayList<>();\n }", "public void readfiles1(String file_name){\n \n\n try{\n File fname1 = new File(file_name);\n Scanner sc = new Scanner(fname1);\n \n while (sc.hasNext()){\n String temp = sc.nextLine();\n String[] sts = temp.split(\" \");\n outs.addAll(Arrays.asList(sts));\n\n }\n\n // for (int i = 0;i<outs.size();i++){\n // System.out.println(outs.get(i));\n //}\n\n }catch(Exception ex){\n System.out.println(ex.getMessage());\n }\n }", "public List<String> fileToVariable(String path) throws IOException{\n\t\tBufferedReader br = new BufferedReader(new FileReader(path));\n\t\tList<String> sentences = null;\n\t\ttry{\n\t\t\tsentences = Files.readAllLines(new File(path), Charset.forName(\"utf-8\"));\n\t\t} finally {\n\t\t\tbr.close();\n\t\t}\n\t\treturn sentences ;\n\t}", "public String readFileContents(String filename) {\n return null;\n\n }" ]
[ "0.7789185", "0.76824576", "0.751451", "0.74439406", "0.74428594", "0.71342593", "0.71101594", "0.705629", "0.705571", "0.70327044", "0.70028716", "0.6966114", "0.69469845", "0.69423294", "0.6937069", "0.6919193", "0.69176036", "0.6837711", "0.6789965", "0.6776568", "0.67670554", "0.67318904", "0.6731111", "0.6701751", "0.6700319", "0.668774", "0.6678627", "0.6676775", "0.667539", "0.6666104", "0.6664125", "0.66631013", "0.66569424", "0.665683", "0.66289765", "0.66154784", "0.6591166", "0.65881294", "0.65681165", "0.6548363", "0.653635", "0.6530119", "0.6508604", "0.65034", "0.64903617", "0.6487439", "0.6487439", "0.64818376", "0.6471396", "0.6470179", "0.64561504", "0.64480805", "0.64399576", "0.6430097", "0.6428555", "0.6428309", "0.64275897", "0.64068496", "0.64036757", "0.6365849", "0.63608545", "0.6360424", "0.63301337", "0.63278455", "0.631755", "0.63162255", "0.63121426", "0.630468", "0.62826985", "0.6282614", "0.6281866", "0.6273261", "0.62490726", "0.6248615", "0.6248395", "0.6247946", "0.62473184", "0.62425476", "0.62376404", "0.62358624", "0.62306803", "0.6227693", "0.6227403", "0.6227114", "0.6225238", "0.6205807", "0.6204533", "0.6204257", "0.62036943", "0.6178243", "0.61751425", "0.61740965", "0.6173056", "0.6168181", "0.61432624", "0.6119337", "0.61133397", "0.6096729", "0.6090258", "0.60859406" ]
0.7201649
5
method reads all file into a string variable from a file on HDD
public String ReadFile(String sFilePath) throws Exception { File f = null; FileInputStream fstream = null; String stemp = ""; try { //getting file oject f = new File(sFilePath); //get object for fileinputstream fstream = new FileInputStream(f); //getting byte array length byte data[] = new byte[fstream.available()]; //getting file stream data into byte array fstream.read(data); //storing byte array data into String stemp = new String(data); return stemp; } catch (Exception e) { throw new Exception("ReadFile : " + e.toString()); } finally { try { fstream.close(); } catch (Exception e) { } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private static String readFileToString(String filePath) throws IOException {\n\t\tStringBuilder fileData = new StringBuilder(1000);\n\t\tBufferedReader reader = new BufferedReader(new FileReader(filePath));\n\t\tchar[] buf = new char[10];\n\t\tint numRead = 0;\n\t\twhile ((numRead = reader.read(buf)) != -1) {\n\t\t\tString readData = String.valueOf(buf, 0, numRead);\n\t\t\tfileData.append(readData);\n\t\t\tbuf = new char[1024];\n\t\t}\n\t\treader.close();\n\t\treturn fileData.toString();\t\n\t}", "public String readFileIntoString(String filepath) throws IOException;", "static String readFile(String path) throws IOException{\n\t\tFileInputStream fs = new FileInputStream(path);\n\t\tStringBuffer sb = new StringBuffer();\n\t\t// read a file\n\t\tint singleByte = fs.read(); // read singleByte\n\t\twhile(singleByte!=-1){\n\t\t\tsb.append((char)singleByte);\n\t\t\t///System.out.print((char)singleByte);\n\t\t\tsingleByte = fs.read();\n\t\t}\n\t\tfs.close(); // close the file\n\t\treturn sb.toString();\n\t}", "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}", "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 readFile(){\r\n StringBuffer str = new StringBuffer(); //StringBuffer is a mutable string\r\n Charset charset = Charset.forName(\"UTF-8\"); //UTF-8 character encoding\r\n Path file = Paths.get(filename + \".txt\");\r\n try (BufferedReader reader = Files.newBufferedReader(file, charset)) { // Buffer: a memory area that buffered streams read\r\n String line = null;\r\n while ((line = reader.readLine()) != null) { //Readers and writers are on top of streams and converts bytes to characters and back, using a character encoding\r\n str.append(line + \"\\n\");\r\n }\r\n }\r\n catch (IOException x) {\r\n System.err.format(\"IOException: %s%n\", x);\r\n }\r\n return str.toString();\r\n }", "public static String getStringFromFile(String filename) {\r\n try {\r\n FileInputStream fis = new FileInputStream(filename);\r\n int available = fis.available();\r\n byte buffer[] = new byte[available];\r\n fis.read(buffer);\r\n fis.close();\r\n\r\n String tmp = new String(buffer);\r\n //System.out.println(\"\\nfrom file:\"+filename+\":\\n\"+tmp);\r\n return tmp;\r\n\r\n } catch (Exception ex) {\r\n // System.out.println(ex);\r\n // ex.printStackTrace();\r\n return \"\";\r\n } // endtry\r\n }", "public String readFromFile(String path) {\n BufferedReader br = null;\n String returnString =\"\";\n try {\n String sCurrentLine;\n br = new BufferedReader(new FileReader(path));\n while ((sCurrentLine = br.readLine()) != null) {\n returnString+=sCurrentLine;\n }\n } catch (IOException e) {\n e.printStackTrace();\n } finally {\n try {\n if (br != null)br.close();\n } catch (IOException ex) {\n ex.printStackTrace();\n }\n }\n return returnString;\n }", "private static String readFile(String path) throws IOException {\n\t\ttry (BufferedReader br = new BufferedReader(new FileReader(new File(path)))) {\n\t\t\tStringBuilder input = new StringBuilder();\n\t\t\tString tmp; while ((tmp = br.readLine()) != null) input.append(tmp+\"\\n\");\n\t\t\treturn input.toString();\n\t\t}\n\t}", "public static String readFileToString (File file) {\n try {\n final var END_OF_FILE = \"\\\\z\";\n var input = new Scanner(file);\n input.useDelimiter(END_OF_FILE);\n var result = input.next();\n input.close();\n return result;\n }\n catch(IOException e){\n return \"\";\n }\n }", "String getFile();", "String getFile();", "String getFile();", "private static String file2string(String file) {\n StringBuilder sb = new StringBuilder();\n try {\n BufferedReader br = new BufferedReader(new FileReader(new File(file)));\n String line;\n\n while ((line = br.readLine()) != null) {\n sb.append(line);\n }\n } catch (Exception e) {\n e.printStackTrace();\n }\n return (sb != null) ? sb.toString() : \"\";\n }", "public String readMultipleFromFiles()\n {\n String result = \"\";\n try\n {\n FileReader fileReader = new FileReader(filename);\n try\n {\n StringBuffer stringBuffer = new StringBuffer();\n Scanner scanner = new Scanner(fileReader);\n while (scanner.hasNextLine())\n {\n stringBuffer.append(scanner.nextLine()).append(\"\\n\");\n }\n stringBuffer.delete(stringBuffer.length() - 1, stringBuffer.length());\n result = stringBuffer.toString();\n } finally\n {\n fileReader.close();\n }\n } catch (FileNotFoundException e)\n {\n System.out.println(\"There is no such file called \" + filename);\n } catch (IOException e)\n {\n System.out.println(\"read \" + filename + \" error!!!\");\n } catch (NumberFormatException e)\n {\n System.out.println(\"content in file \" + filename + \" is error\");\n }\n return result;\n }", "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 }", "public static String loadFileAsString(String filePath) throws java.io.IOException{\n\t StringBuffer fileData = new StringBuffer(1000);\n\t BufferedReader reader = new BufferedReader(new FileReader(filePath));\n\t char[] buf = new char[1024];\n\t int numRead=0;\n\t while((numRead=reader.read(buf)) != -1){\n\t String readData = String.valueOf(buf, 0, numRead);\n\t fileData.append(readData);\n\t }\n\t reader.close();\n\t return fileData.toString();\n\t}", "private static String loadFile(String path){\n try {\n\n BufferedReader reader = new BufferedReader(new FileReader(path));\n StringBuilder sb = new StringBuilder();\n\n String line;\n while((line = reader.readLine()) != null){\n sb.append(line);\n sb.append('\\n');\n }\n\n reader.close();\n return sb.toString();\n\n } catch (FileNotFoundException e) {\n e.printStackTrace();\n return null;\n } catch (IOException e) {\n e.printStackTrace();\n return null;\n }\n }", "public String readFileContents(String filename) {\n return null;\n\n }", "private static String readFile(String filePath) {\n\t\tFile file = new File(filePath);\n\t\tString fileElements;\n\t\tFileInputStream in = null;\n\t\t\n\t\tif(file.exists()){\n\t\t\ttry {\n\t\t\t\tin = new FileInputStream(file);\n\t\t\t\tbyte[] fileBytes = new byte[(int)file.length()];\n\t\t\t\tin.read(fileBytes);\n\t\t\t\tfileElements = new String(fileBytes);\n\t\t\t} catch (FileNotFoundException e) {\n\t\t\t\te.printStackTrace();\n\t\t\t\tfileElements = \"\";\n\t\t\t} catch(IOException io){\n\t\t\t\tio.printStackTrace();\n\t\t\t\tfileElements = \"\";\n\t\t\t}\n\t\t}else{\n\t\t\tfileElements=\"\";\n\t\t}\n\t\treturn fileElements;\n\t}", "private static String readFile(File file) {\n String result = \"\";\n\n try (BufferedReader bufferedReader = new BufferedReader(\n new FileReader(file))) {\n result = bufferedReader.readLine();\n } catch (IOException e) {\n e.printStackTrace();\n }\n return result;\n }", "private static String fileToString(String path) throws IOException {\n\n\t\tbyte[] encoded = Files.readAllBytes(Paths.get(path));\n\t\treturn new String(encoded, StandardCharsets.UTF_8);\n\t}", "private String readFile(String file) throws IOException {\n StringBuilder contentBuilder = new StringBuilder();\n\n try (Stream<String> stream = Files.lines(Paths.get(file), StandardCharsets.UTF_8)) {\n stream.forEach(s -> contentBuilder.append(s));\n }\n\n return contentBuilder.toString();\n\n }", "public static void demoReadAll(){\n try{\n //Read entire file bytes. Return in byte format. Don't need to close() after use. \n byte[] b = Files.readAllBytes(Paths.get(\"country.txt\"));\n String s = new String(b);\n System.out.println(s);\n }\n catch(IOException e){\n e.printStackTrace();\n }\n }", "private static String readFileContents(File file) throws FileNotFoundException {\n StringBuilder fileContents = new StringBuilder((int) file.length());\n\n try (Scanner scanner = new Scanner(file)) {\n while (scanner.hasNext()) {\n fileContents.append(scanner.next());\n }\n return fileContents.toString();\n }\n }", "public final String getStringFromFile(final int length) throws IOException {\r\n\r\n if (length <= 0) {\r\n return new String(\"\");\r\n }\r\n\r\n byte[] b = new byte[length];\r\n raFile.readFully(b);\r\n final String s = new String(b);\r\n b = null;\r\n return s;\r\n }", "public static String loadAFileToStringDE1(File f) throws IOException {\n InputStream is = null;\n String ret = null;\n try {\n is = new BufferedInputStream( new FileInputStream(f) );\n long contentLength = f.length();\n ByteArrayOutputStream outstream = new ByteArrayOutputStream( contentLength > 0 ? (int) contentLength : 1024);\n byte[] buffer = new byte[4096];\n int len;\n while ((len = is.read(buffer)) > 0) {\n outstream.write(buffer, 0, len);\n } \n outstream.close();\n ret = outstream.toString();\n //byte[] ba = outstream.toByteArray();\n //ret = new String(ba);\n } finally {\n if(is!=null) {try{is.close();} catch(Exception e){} }\n }\n// long endTime = System.currentTimeMillis();\n// System.out.println(\"方法1用时\"+ (endTime-beginTime) + \"ms\");\n return ret; \n }", "private static String readFile(String file) throws IOException { //Doesn't work - possible error with FileReader\n //BufferedReader reader = new BufferedReader(new FileReader(file));\n //FileReader reader=new FileReader(file);\n\n\n FileReader file2 = new FileReader(file);\n System.out.println(\"Inside readFile\");\n BufferedReader buffer = new BufferedReader(file2);\n\n\n\n //String line = null;\n String line=\"\";\n\n StringBuilder stringBuilder = new StringBuilder();\n String ls = System.getProperty(\"line.separator\");\n try {\n while ((line = buffer.readLine()) != null) {\n System.out.println(line);\n stringBuilder.append(line);\n stringBuilder.append(ls);\n }\n return stringBuilder.toString();\n\n }finally{\n buffer.close();//https://stackoverflow.com/questions/326390/how-do-i-create-a-java-string-from-the-contents-of-a-file\n }\n /*Scanner scanner = null;\n scanner = new Scanner(file);\n StringBuilder stringBuilder = new StringBuilder();\n while (scanner.hasNextLine()) {\n String line = scanner.nextLine();\n stringBuilder.append(line);\n\n System.out.println(\"line: \"+line);\n }\n return stringBuilder.toString();*/\n\n }", "List readFile(String pathToFile);", "@Override\n\tpublic String readBlob() throws PersistBlobException {\n\t\tlog.debug(\"readString: \");\n\t\ttry {\n\t\t\tString contents = FileUtils.readFileToString(new File(full_file_name), \"UTF-8\");\n\t\t\tlog.debug(\"returned string: \"+contents);\n\t\t\treturn contents;\n\t\t} catch (IOException e) {\n\t\t\tthrow new PersistBlobException(\"can not read string\",e);\n\t\t}\n\n\t}", "private String readFully(String filename) throws IOException{\n\t\tBufferedReader reader = new BufferedReader(new FileReader(filename));\n\t\tStringBuilder buf=new StringBuilder();\n\t\tchar[] data=new char[8192];\n\t\tint num=reader.read(data);\n\t\twhile(num>-1){\n\t\t\tbuf.append(data,0,num);\n\t\t\tnum=reader.read(data);\n\t\t}\n\t\treturn buf.toString();\n\t}", "public String readFromFile(String filePath){\n String fileData = \"\";\n try{\n File myFile = new File(filePath);\n Scanner myReader = new Scanner(myFile);\n while (myReader.hasNextLine()){\n String data = myReader.nextLine();\n fileData += data+\"\\n\";\n }\n myReader.close();\n } catch(FileNotFoundException e) {\n System.out.println(\"An error occurred.\");\n e.printStackTrace();\n }\n return fileData;\n }", "private static String ReadFile(String filePath) {\n StringBuilder sb = new StringBuilder();\n try {\n BufferedReader r = new BufferedReader(new FileReader(filePath));\n String line;\n while ((line = r.readLine()) != null) {\n sb.append(line);\n }\n } catch (Exception e) {\n System.out.println(e.getStackTrace());\n }\n return sb.toString();\n\n }", "@SuppressWarnings(\"unused\")\n private String readFile(File f) throws IOException {\n BufferedReader reader = new BufferedReader(new FileReader(f));\n String line = reader.readLine();\n StringBuilder builder = new StringBuilder();\n while (line != null) {\n builder.append(line).append('\\n');\n line = reader.readLine();\n }\n reader.close();\n return builder.toString();\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}", "private String readStringFromFile(final File file) {\n try {\n FileInputStream fin = new FileInputStream(file);\n BufferedReader reader = new BufferedReader(new InputStreamReader(fin));\n StringBuilder sb = new StringBuilder();\n String line = null;\n while ((line = reader.readLine()) != null) {\n sb.append(line).append(\"\\n\");\n }\n reader.close();\n String result = sb.toString();\n fin.close();\n return result;\n } catch (IOException ioEx) {\n Log.e(TAG, \"Error reading String from a file: \" + ioEx.getLocalizedMessage());\n }\n return null;\n }", "public static String readFileAsString(String fileName) {\n String text = \"\";\n\n try {\n text = new String(Files.readAllBytes(Paths.get(fileName)));\n } catch (IOException e) {\n e.printStackTrace();\n }\n\n return text;\n }", "public String readFile(String fName) {\n String msg=\"\";\n try {\n File theFile = new File(fName);\n InputStreamReader iStream = new InputStreamReader(new FileInputStream(theFile));\n int length = (int)theFile.length();\n char input[] = new char[length];\n iStream.read(input);\n msg = new String(input);\n } catch (IOException e) {\n e.printStackTrace();\n } // catch\n return msg;\n }", "public String ReadFile() throws IOException {\n File file = context.getFilesDir();\n File textfile = new File(file + \"/\" + this.fileName);\n\n FileInputStream input = context.openFileInput(this.fileName);\n byte[] buffer = new byte[(int)textfile.length()];\n\n input.read(buffer);\n\n return new String(buffer);\n }", "private static String readFile(String fileName) throws IOException {\n\t\tReader reader = new FileReader(fileName);\n\n\t\ttry {\n\t\t\t// Create a StringBuilder instance\n\t\t\tStringBuilder sb = new StringBuilder();\n\n\t\t\t// Buffer for reading\n\t\t\tchar[] buffer = new char[1024];\n\n\t\t\t// Number of read chars\n\t\t\tint k = 0;\n\n\t\t\t// Read characters and append to string builder\n\t\t\twhile ((k = reader.read(buffer)) != -1) {\n\t\t\t\tsb.append(buffer, 0, k);\n\t\t\t}\n\n\t\t\t// Return read content\n\t\t\treturn sb.toString();\n\t\t} finally {\n\t\t\ttry {\n\t\t\t\treader.close();\n\t\t\t} catch (IOException ioe) {\n\t\t\t\t// Ignore\n\t\t\t}\n\t\t}\n\t}", "private static String readFileToString(File fileToRead) {\n\t\tString out = null;\n\t\ttry {\n\t\t\tout = FileUtils.readFileToString(fileToRead);\n\t\t} catch (IOException e) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\te.printStackTrace();\n\t\t}\n\t\treturn out;\n\t}", "public static String readFileAsString(String filePath) {\n\t\tbyte[] buffer = new byte[(int) new File(filePath).length()];\n\t\tBufferedInputStream f = null;\n\t\ttry {\n\t\t\tFile file = new File(filePath);\n\t\t\tfor (int attempt = 0; attempt < 3; attempt++) {\n\t\t\t\tif (file.exists()) {\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tThread.sleep(2);\n\t\t\t}\n\n\t\t\tif (!file.exists()) {\n\t\t\t\tSystem.err.println(\"\\nfile not found: \" + filePath);\n\t\t\t\tthrow new FileNotFoundException(\"Could not find file: \" + filePath);\n\t\t\t}\n\n\t\t\tf = new BufferedInputStream(new FileInputStream(filePath));\n\t\t\tf.read(buffer);\n\t\t} catch (IOException e) {\n\t\t\tthrow new UncheckedExecutionException(e);\n\t\t} catch (InterruptedException e) {\n\t\t\te.printStackTrace();\n\t\t} finally {\n\t\t\tif (f != null)\n\t\t\t\ttry {\n\t\t\t\t\tf.close();\n\t\t\t\t} catch (IOException ignored) {\n\t\t\t\t}\n\t\t}\n\t\treturn new String(buffer);\n\t}", "public static String loadAFileToStringDE2(File f) throws IOException {\n InputStream is = null;\n String ret = null;\n try {\n is = new FileInputStream(f) ;\n long contentLength = f.length();\n byte[] ba = new byte[(int)contentLength];\n is.read(ba);\n ret = new String(ba);\n } finally {\n if(is!=null) {try{is.close();} catch(Exception e){} }\n }\n// long endTime = System.currentTimeMillis();\n// System.out.println(\"方法2用时\"+ (endTime-beginTime) + \"ms\");\n return ret; \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 }", "private String readFile(String path, Charset encoding) throws IOException \r\n\t{\r\n\t\tbyte[] encoded = Files.readAllBytes(Paths.get(path));\r\n\t\treturn new String(encoded, encoding);\r\n\t}", "private String getFileContent(java.io.File fileObj) {\n String returned = \"\";\n try {\n java.io.BufferedReader reader = new java.io.BufferedReader(new java.io.FileReader(fileObj));\n while (reader.ready()) {\n returned = returned + reader.readLine() + lineSeparator;\n }\n } catch (FileNotFoundException ex) {\n JTVProg.logPrint(this, 0, \"файл [\" + fileObj.getName() + \"] не найден\");\n } catch (IOException ex) {\n JTVProg.logPrint(this, 0, \"[\" + fileObj.getName() + \"]: ошибка ввода/вывода\");\n }\n return returned;\n }", "public static String getFileContentsAsString(String filename) {\n\n // Java uses Paths as an operating system-independent specification of the location of files.\n // In this case, we're looking for files that are in a directory called 'data' located in the\n // root directory of the project, which is the 'current working directory'.\n final Path path = FileSystems.getDefault().getPath(\"Resources\", filename);\n\n try {\n // Read all of the bytes out of the file specified by 'path' and then convert those bytes\n // into a Java String. Because this operation can fail if the file doesn't exist, we\n // include this in a try/catch block\n return new String(Files.readAllBytes(path));\n } catch (IOException e) {\n // Since we couldn't find the file, there is no point in trying to continue. Let the\n // user know what happened and exit the run of the program. Note: we're only exiting\n // in this way because we haven't talked about exceptions and throwing them in CS 126 yet.\n System.out.println(\"Couldn't find file: \" + filename);\n System.exit(-1);\n return null; // note that this return will never execute, but Java wants it there.\n }\n }", "String readText(FsPath path);", "public static String givestring(String file_name)\n\t {\n\t \tString s=\"\";\n\t \tString r=\"\";\n\t \tFile file=new File(file_name);\n\t \ttry\n\t \t{\n\t \t\tScanner scan=new Scanner(file);\n\t \t\twhile(scan.hasNextLine())\n\t \t\t{\n\t \t\t\ts=scan.nextLine();\n\t \t\t\ts=checkString(s);\n\t \t\t\tr+=s;\n\t \t\t}\n\t \t}\n\t \tcatch (FileNotFoundException e)\n\t \t {\n System.out.println(\"Sorry Invalid file name\");\n // System.out.println(\"Please try again\");\n // Scanner sc=new Scanner(System.in);\n // String ss=sc.nextLine();\n // givestring(ss);\n \t\t }\n\t \n // System.out.println(r);\nreturn r;\n\t }", "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 static String getStringFromFile(String filename) {\r\n BufferedReader br = null;\r\n StringBuilder sb = new StringBuilder();\r\n try {\r\n br = new BufferedReader(new FileReader(filename));\r\n try {\r\n String s;\r\n while ((s = br.readLine()) != null) {\r\n sb.append(s);\r\n sb.append(\"\\n\");\r\n }\r\n } finally {\r\n br.close();\r\n }\r\n } catch (IOException ex) {\r\n ex.printStackTrace();\r\n }\r\n\r\n return sb.toString();\r\n }", "String[] readFile(String path) {\n ArrayList<String> list = new ArrayList<>();\n String[] output = null;\n Scanner reader;\n File file;\n\n try {\n file = new File(path);\n reader = new Scanner(file);\n while (reader.hasNextLine()) {\n list.add(reader.nextLine());\n }\n output = new String[list.size()];\n for (int i = 0; i < list.size(); i++) output[i] = list.get(i);\n reader.close();\n } catch (FileNotFoundException e) {\n System.out.println(\"File not found exception\");\n }\n return output;\n }", "public static String readAllString(String filename) {\n\t\ttry {\n\t\t\tFileInputStream fis = new FileInputStream(filename);\n\t\t\t// readAll closes\n\t\t\treturn readAllString(fis);\n\t\t} catch (FileNotFoundException fnf) {\n\t\t\tthrow new WrappedException(fnf);\n\t\t}\n\t}", "private static String readAllBytesJava7(String filePath) {\n String content = \"\";\n\n try {\n content = new String(Files.readAllBytes(Paths.get(filePath)));\n } catch (IOException e) {\n e.printStackTrace();\n }\n\n return content;\n }", "public static String readFileAsString(String filePath, String encoding) {\n\t\tbyte[] buffer = new byte[(int) new File(filePath).length()];\n\t\tBufferedInputStream f = null;\n\t\ttry {\n\t\t\tFile file = new File(filePath);\n\t\t\tfor (int attempt = 0; attempt < 3; attempt++) {\n\t\t\t\tif (file.exists()) {\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tThread.sleep(2);\n\t\t\t}\n\n\t\t\tif (!file.exists()) {\n\t\t\t\tSystem.err.println(\"\\nfile not found: \" + filePath);\n\t\t\t\tthrow new FileNotFoundException(\"Could not find file: \" + filePath);\n\t\t\t}\n\n\t\t\tf = new BufferedInputStream(new FileInputStream(filePath));\n\t\t\tf.read(buffer);\n\t\t} catch (IOException e) {\n\t\t\tthrow new UncheckedExecutionException(e);\n\t\t} catch (InterruptedException e) {\n\t\t\te.printStackTrace();\n\t\t} finally {\n\t\t\tif (f != null)\n\t\t\t\ttry {\n\t\t\t\t\tf.close();\n\t\t\t\t} catch (IOException ignored) {\n\t\t\t\t}\n\t\t}\n\t\tString contents = null;\n\t\ttry {\n\t\t\tcontents = new String(buffer, encoding);\n\t\t} catch (UnsupportedEncodingException e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t\treturn contents;\n\t}", "public String readFile(String filePath)\n {\n String result = \"\";\n try {\n\n FileReader reader = new FileReader(filePath);\n Scanner scanner = new Scanner(reader);\n\n while(scanner.hasNextLine())\n {\n result += scanner.nextLine();\n }\n reader.close();\n }\n catch(FileNotFoundException ex)\n {\n System.out.println(\"File not found. Please contact the administrator.\");\n }\n catch (Exception ex)\n {\n System.out.println(\"Some error occurred. Please contact the administrator.\");\n }\n return result;\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 String readFile (String pathOfFileSelected) {\n\n File file = new File(pathOfFileSelected);\n\n StringBuilder text = new StringBuilder();\n\n try {\n BufferedReader br = new BufferedReader(new FileReader(file));\n String line;\n\n while ((line = br.readLine()) != null) {\n text.append(line);\n text.append('\\n');\n }\n br.close();\n Log.d(TAG, \"readFile: text: \" +text.toString());\n return text.toString().trim();\n }\n catch (IOException e) {\n Log.e(TAG, \"readFile: \",e );\n return null;\n }\n }", "public String readFile(String Path, String File_name) {\n\t\tFile f1 = new File( Path + \"/\" + File_name);\n\t\t String str = \"\";\n\t\t String res = \"\";\n\t try {\n\t // открываем поток для чтения\n\t BufferedReader br = new BufferedReader(new FileReader(f1));\n\t \n\t // читаем содержимое\n\t while ((str = br.readLine()) != null) {\n\t Log.d(LOG_TAG, str);\n\t res+=str;\n\t }\n\t //res=str;\n\t \n\t } catch (FileNotFoundException e) {\n\t e.printStackTrace();\n\t } catch (IOException e) {\n\t e.printStackTrace();\n\t }\n\t return res;\n\t }", "public static String readFile(String filePath) throws IOException {\n\t\tString readString = \"\";\n\t\tRandomAccessFile file = new RandomAccessFile(filePath, \"r\");\n\t\tFileChannel channel = file.getChannel();\n\t\tByteBuffer buffer = ByteBuffer.allocate(1024);\n\t\twhile (channel.read(buffer) > 0) {\n\t\t\tbuffer.flip();\n\t\t\tfor (int i = 0; i < buffer.limit(); i++)\n\t\t\t\treadString += (char) buffer.get();\n\t\t\tbuffer.clear();\n\t\t}\n\t\tchannel.close();\n\t\tfile.close();\n\t\treturn readString;\n\t}", "public static String readFile(String filePath) throws java.io.IOException {\r\n\t\tStringBuffer fileData = new StringBuffer(1000);\r\n\t\tBufferedReader reader = new BufferedReader(new FileReader(filePath));\r\n\t\tchar[] buf = new char[1024];\r\n\t\tint numRead = 0;\r\n\t\twhile ((numRead = reader.read(buf)) != -1) {\r\n\t\t\tString readData = String.valueOf(buf, 0, numRead);\r\n\t\t\tfileData.append(readData);\r\n\t\t\tbuf = new char[1024];\r\n\t\t}\r\n\t\treader.close();\r\n\t\treturn fileData.toString();\r\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 }", "public static String readOneString(String fileName)throws FileNotFoundException{\r\n StringBuilder sb=new StringBuilder();\r\n fileExists(fileName);\r\n log.fine(\"Reading one string from file: \"+fileName);\r\n try {\r\n BufferedReader in=new BufferedReader(new FileReader(fileName));\r\n try {\r\n String s;\r\n s=in.readLine();\r\n if(s==null){\r\n return null;\r\n }\r\n sb.append(s);\r\n }finally {\r\n in.close();\r\n }\r\n }catch (IOException e){\r\n throw new RuntimeException(e);\r\n }\r\n return sb.toString();\r\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 String getStringFile(){\n return fileView(file);\n }", "public String readFile(File file) {\r\n\t\tString line;\r\n\t\tString allText = \"\";\r\n\r\n\t\ttry (BufferedReader br = new BufferedReader(new FileReader(file))) {\r\n\r\n\t\t\twhile ((line = br.readLine()) != null) {\r\n\r\n\t\t\t\tallText += line + \"\\n\";\r\n\r\n\t\t\t}\r\n\r\n\t\t} catch (FileNotFoundException e) {\r\n\r\n\t\t\te.printStackTrace();\r\n\t\t} catch (IOException e) {\r\n\r\n\t\t\te.printStackTrace();\r\n\t\t}\r\n\r\n\t\treturn allText;\r\n\t}", "public String readFileBufferedReader() {\n String result = \"\";\n BufferedReader in = null;\n try {\n in = new BufferedReader(new FileReader(new File(ALICE_PATH)));\n\n for (String x = in.readLine(); x != null; x = in.readLine()) {\n result = result + x + '\\n';\n }\n\n } catch (IOException e) {\n }\n\n if(in != null)try {\n in.close();\n } catch (IOException e) {\n }\n\n return result;\n }", "public void readFile();", "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 }", "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 static String readAllStrings(String fileName) throws FileNotFoundException{\r\n StringBuilder sb=new StringBuilder();\r\n fileExists(fileName);\r\n log.fine(\"Reading of all strings from file: \"+fileName);\r\n try {\r\n BufferedReader in=new BufferedReader(new FileReader(fileName));\r\n try {\r\n String s;\r\n while ((s=in.readLine())!=null){\r\n sb.append(s);\r\n sb.append(\"\\n\");\r\n }\r\n }finally {\r\n in.close();\r\n }\r\n }catch (IOException e){\r\n throw new RuntimeException(e);\r\n }\r\n return sb.toString();\r\n }", "private static String loadFile(File file) throws IOException {\n\t\tBufferedReader br = new BufferedReader(new FileReader(file));\n\t\treturn br.readLine();\n\t}", "private static String readFromFile(ArrayList diretorios, String sessionId)\n\t{\n\t StringBuffer result = new StringBuffer();\n\t \n\t try\n\t {\n\t //Verificando na lista de diretorios se o arquivo pode ser encontrado. \n\t for(int i = 0; i < diretorios.size(); i++)\n\t {\n\t\t String fileName = (String)diretorios.get(i) + File.separator + sessionId;\n\t\t File fileExtrato = new File(fileName);\n\t\t \n\t\t if(fileExtrato.exists())\n\t\t {\n\t\t //Lendo o XML do arquivo.\n\t\t FileReader reader = new FileReader(fileExtrato);\n\t\t char[] buffer = new char[new Long(fileExtrato.length()).intValue()];\n\t\t int bytesRead = 0;\n\t \n\t\t while((bytesRead = reader.read(buffer)) != -1)\n\t\t {\n\t\t result.append(buffer);\n\t\t }\n\t \n\t\t reader.close();\n\t\t break;\n\t\t }\n\t }\n\t }\n\t catch(Exception e)\n\t {\n\t e.printStackTrace();\n\t }\n\t \n\t return (result.length() > 0) ? result.toString() : null;\n\t}", "String[] readFile(File file) {\n ArrayList<String> list = new ArrayList<>();\n String[] output = null;\n Scanner reader = null;\n try {\n if (file.isFile()) {\n reader = new Scanner(file);\n while (reader.hasNextLine()) {\n list.add(reader.nextLine());\n }\n }\n } catch (FileNotFoundException e) {\n System.out.println(\"File not found exception\");\n }\n output = new String[list.size()];\n for (int i = 0; i < list.size(); i++) output[i] = list.get(i);\n reader.close();\n return output;\n }", "public static String readFile(String path) throws IOException {\n BufferedReader reader = new BufferedReader(new FileReader(path));\n\n String line;\n StringBuilder builder = new StringBuilder();\n\n while ((line = reader.readLine()) != null) {\n builder.append(line);\n }\n\n return builder.toString();\n }", "public static String readFile(String path) {\n String contents = \"\";\n try {\n BufferedReader br = new BufferedReader(new FileReader(path));\n\n StringBuilder sb = new StringBuilder();\n String line = br.readLine();\n while (line != null) {\n sb.append(line);\n sb.append(System.lineSeparator());\n line = br.readLine();\n }\n contents = sb.toString();\n br.close();\n } catch (Exception e) {\n System.out.println(e.toString());\n System.exit(1);\n }\n return contents;\n }", "private static java.lang.String readStringFromFile(java.io.File r9) {\n /*\n r5 = 0\n r3 = 0\n java.io.FileReader r4 = new java.io.FileReader // Catch:{ FileNotFoundException -> 0x0059, IOException -> 0x0038 }\n r4.<init>(r9) // Catch:{ FileNotFoundException -> 0x0059, IOException -> 0x0038 }\n r7 = 128(0x80, float:1.794E-43)\n char[] r0 = new char[r7] // Catch:{ FileNotFoundException -> 0x001b, IOException -> 0x0056, all -> 0x0053 }\n java.lang.StringBuilder r6 = new java.lang.StringBuilder // Catch:{ FileNotFoundException -> 0x001b, IOException -> 0x0056, all -> 0x0053 }\n r6.<init>() // Catch:{ FileNotFoundException -> 0x001b, IOException -> 0x0056, all -> 0x0053 }\n L_0x0010:\n int r1 = r4.read(r0) // Catch:{ FileNotFoundException -> 0x001b, IOException -> 0x0056, all -> 0x0053 }\n if (r1 <= 0) goto L_0x002a\n r7 = 0\n r6.append(r0, r7, r1) // Catch:{ FileNotFoundException -> 0x001b, IOException -> 0x0056, all -> 0x0053 }\n goto L_0x0010\n L_0x001b:\n r2 = move-exception\n r3 = r4\n L_0x001d:\n java.lang.String r7 = \"PluginNativeHelper\"\n java.lang.String r8 = \"cannot find file to read\"\n com.tencent.component.utils.log.LogUtil.d(r7, r8, r2) // Catch:{ all -> 0x0048 }\n if (r3 == 0) goto L_0x0029\n r3.close() // Catch:{ IOException -> 0x004f }\n L_0x0029:\n return r5\n L_0x002a:\n java.lang.String r5 = r6.toString() // Catch:{ FileNotFoundException -> 0x001b, IOException -> 0x0056, all -> 0x0053 }\n if (r4 == 0) goto L_0x005b\n r4.close() // Catch:{ IOException -> 0x0035 }\n r3 = r4\n goto L_0x0029\n L_0x0035:\n r7 = move-exception\n r3 = r4\n goto L_0x0029\n L_0x0038:\n r2 = move-exception\n L_0x0039:\n java.lang.String r7 = \"PluginNativeHelper\"\n java.lang.String r8 = \"error occurs while reading file\"\n com.tencent.component.utils.log.LogUtil.d(r7, r8, r2) // Catch:{ all -> 0x0048 }\n if (r3 == 0) goto L_0x0029\n r3.close() // Catch:{ IOException -> 0x0046 }\n goto L_0x0029\n L_0x0046:\n r7 = move-exception\n goto L_0x0029\n L_0x0048:\n r7 = move-exception\n L_0x0049:\n if (r3 == 0) goto L_0x004e\n r3.close() // Catch:{ IOException -> 0x0051 }\n L_0x004e:\n throw r7\n L_0x004f:\n r7 = move-exception\n goto L_0x0029\n L_0x0051:\n r8 = move-exception\n goto L_0x004e\n L_0x0053:\n r7 = move-exception\n r3 = r4\n goto L_0x0049\n L_0x0056:\n r2 = move-exception\n r3 = r4\n goto L_0x0039\n L_0x0059:\n r2 = move-exception\n goto L_0x001d\n L_0x005b:\n r3 = r4\n goto L_0x0029\n */\n throw new UnsupportedOperationException(\"Method not decompiled: com.tencent.component.plugin.PluginNativeHelper.readStringFromFile(java.io.File):java.lang.String\");\n }", "private static String readFile(String file) throws IOException {\n\n\t\tString line = null;\n\t\tStringBuilder stringBuilder = new StringBuilder();\n\t\tString ls = System.getProperty(\"line.separator\");\n\n\t\ttry (BufferedReader reader = new BufferedReader(new FileReader(file))) {\n\t\t\twhile ((line = reader.readLine()) != null) {\n\t\t\t\tstringBuilder.append(line);\n\t\t\t\tstringBuilder.append(ls);\n\t\t\t}\n\t\t}\n\n\t\treturn stringBuilder.toString();\n\t}", "public static String read(String filename) throws IOException {\n // Reading input by lines:\n BufferedReader in = new BufferedReader(new FileReader(filename));\n// BufferedInputStream in2 = new BufferedInputStream(new FileInputStream(filename));\n String s;\n int s2;\n StringBuilder sb = new StringBuilder();\n while((s = in.readLine())!= null)\n sb.append( s + \"\\n\");\n// sb.append((char) s2);\n in.close();\n return sb.toString();\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}", "public static String read(String filepath) throws IOException {\n BufferedReader bf=new BufferedReader(new FileReader(new File(filepath)));\n String s;\n StringBuilder sb=new StringBuilder();\n while((s=bf.readLine())!=null)\n sb.append(s+ \"\\n\");\n bf.close();\n return sb.toString();\n }", "public static String getStoredString(String filePath, int chars) throws IOException {\r\n\r\n\t\tFile f1 = new File(filePath);\r\n\t\tFileReader fr = new FileReader(f1);\r\n\t\tchar[] chras = new char[chars];\r\n\t\tfr.read(chras);\r\n\t\tString s = new String(chras);\r\n\t\tSystem.out.println(\"The stored String is : \" + s);\r\n\t\tfr.close();\r\n\t\treturn s;\r\n\r\n\t}", "public String read(String filePath) throws IOException {\r\n\t\t//read file into stream\r\n\t\t\treturn new String(Files.readAllBytes(Paths.get(filePath)));\r\n\t}", "public static String readWholeFile(String filename) {\n\t\t \n\t\t \n\t\t \n\t\ttry {\n\t\t\tScanner scanner = new Scanner(new File(filename));\n\t\t\t //scanner.useDelimiter(\"\\\\Z\");\n\t\t\t String returnString = \"\";\n\t\t\t while (scanner.hasNextLine()) {\n\t\t\t\t returnString += scanner.nextLine();\n\t\t\t\t returnString += System.lineSeparator();\n\t\t\t }\n\t\t\t \n\t\t\t return returnString;\n\t\t} catch (FileNotFoundException e) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\te.printStackTrace();\n\t\t\treturn null;\n\t\t}\n\t\t \n\t\t \n\t\t }", "public String read() throws Exception {\r\n\t\tBufferedReader reader = null;\r\n\t\tStringBuffer sb = new StringBuffer();\r\n\t\ttry {\r\n\t\t\tif (input==null) input = new FileInputStream(file);\r\n\t\t\treader = new BufferedReader(new InputStreamReader(input,charset));\r\n\t\t\tchar[] c= null;\r\n\t\t\twhile (reader.read(c=new char[8192])!=-1) {\r\n\t\t\t\tsb.append(c);\r\n\t\t\t}\r\n\t\t\tc=null;\r\n\t\t} catch (Exception e) {\r\n\t\t\tthrow e;\r\n\t\t} finally {\r\n\t\t\treader.close();\r\n\t\t}\r\n\t\treturn sb.toString().trim();\r\n\t}", "public static String readFile(Path path) {\n\t\tif (path != null) {\n\t\t\tbyte[] bytes = toByteArray(path);\n\t\t\tif (bytes != null) {\n\t\t\t\treturn new String(bytes, StandardCharsets.UTF_8);\n\t\t\t}\n\t\t}\n\t\treturn \"\";\n\t}", "String readFile( String filename ) {\n try {\n FileReader fileReader = new FileReader( filename );\n BufferedReader bufferedReader = new BufferedReader( fileReader );\n StringBuilder stringBuilder = new StringBuilder();\n String line = bufferedReader.readLine();\n while( line != null ) {\n stringBuilder.append( line );\n stringBuilder.append( \"\\n\" );\n line = bufferedReader.readLine();\n }\n bufferedReader.close();\n fileReader.close();\n return stringBuilder.toString();\n } catch( Exception e ) {\n playerObjects.getLogFile().WriteLine( Formatting.exceptionToStackTrace( e ) );\n return null;\n }\n }", "public String readFileIntoString(String sourceFilepath) throws IOException {\n StringBuilder sb = new StringBuilder();\n URL url = new URL(sourceFilepath);\n BufferedReader reader = new BufferedReader(new InputStreamReader(url.openStream()));\n String line = null;\n while ((line = reader.readLine()) != null) {\n sb.append(line + \"\\n\");\n }\n reader.close();\n return sb.toString();\n }", "public static String localFileToString(String fileName) throws IOException\n\t{\n\t\tBufferedReader br = new BufferedReader(new FileReader(fileName));\n\t\ttry\n\t {\n\t StringBuilder sb = new StringBuilder();\n\t String line = br.readLine();\n\n\t while (line != null)\n\t {\n\t sb.append(line);\n\t sb.append(\"\\n\");\n\t line = br.readLine();\n\t }\n\t \n\t return sb.toString();\n\t }\n\t finally\n\t {\n\t br.close();\n\t }\n\t}", "public String read() {\n\t\tStringBuffer text = new StringBuffer((int)file.length());\n\t\ttry {\n\t\t\tFileReader fr = new FileReader(file);\n\t\t\tBufferedReader b = new BufferedReader(fr);\n\t\t\tboolean eof = false;\n\t\t\tString line;\n\t\t\tString ret = \"\\n\";\n\t\t\twhile (!eof) {\n\t\t\t\tline = b.readLine();\n\t\t\t\tif (line == null) {\n\t\t\t\t\teof = true;\n\t\t\t\t} else {\n\t\t\t\t\ttext.append(line);\n\t\t\t\t\ttext.append(ret);\n\t\t\t\t}\n\t\t\t}\n\t\t\tb.close();\n\t\t} catch (IOException e) {\n\t\t\tthrow new IllegalArgumentException(\"File \" + file.getName() +\n\t\t\t\t\" is unreadable : \" + e.toString());\n\t\t}\n\t\treturn text.toString();\n\t}", "private void read() {\n\n\t\t\t\tString road=getActivity().getFilesDir().getAbsolutePath()+\"product\"+\".txt\";\n\n\t\t\t\ttry {\n\t\t\t\t\tFile file = new File(road); \n\t\t\t\t\tFileInputStream fis = new FileInputStream(file); \n\t\t\t\t\tint length = fis.available(); \n\t\t\t\t\tbyte [] buffer = new byte[length]; \n\t\t\t\t\tfis.read(buffer); \n\t\t\t\t\tString res1 = EncodingUtils.getString(buffer, \"UTF-8\"); \n\t\t\t\t\tfis.close(); \n\t\t\t\t\tjson(res1.toString());\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}", "public static String randomAccessRead() {\n String s = \"\";\n try {\n RandomAccessFile f = new RandomAccessFile(FILES_TEST_PATH, \"r\");\n f.skipBytes(14);\n s = f.readLine();\n f.close();\n } catch(Exception e) {\n e.printStackTrace();\n }\n return s;\n }", "public String FetchDataFromFile(File file) {\r\n\t\tStringBuilder sb=new StringBuilder();\r\n\t\ttry {\r\n\t\t\tScanner sc=new Scanner(file);\r\n\t\t\twhile(sc.hasNextLine()){\r\n\t\t\t\tsb.append(sc.nextLine());\r\n\t\t\t}\r\n\t\t} catch (FileNotFoundException e) {\r\n\t\t\te.printStackTrace();\r\n\t\t}\r\n\t\treturn sb.toString();\r\n\t}", "public static String read(String path) {\r\n\t\t\r\n\t\t// open the file\r\n\t\tFile file = new File(path);\r\n\t\t\r\n\t\t\r\n\t\t// if the file does not exist return null\r\n\t\tif (!file.exists())\r\n\t\t\treturn null;\r\n\t\t\r\n\t\t\r\n\t\t\r\n\t\tString content = \"\";\r\n\t\t\r\n\t\t// write to the file\r\n\t\ttry {\r\n\t\t\t// open stream\r\n\t\t\tFileReader fReader = new FileReader(file);\r\n\t\t\tBufferedReader bufferedReader = new BufferedReader(fReader);\r\n\t\t\t\r\n\t\t\t\r\n\t\t\t// read all the content of the file\r\n\t\t\tString current = bufferedReader.readLine();\r\n\t\t\twhile (current != null) {\r\n\t\t\t\tcontent = content.concat(current + \"\\n\");\r\n\t\t\t\tcurrent = bufferedReader.readLine();\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t// close anything was opened\r\n\t\t\tbufferedReader.close();\r\n\t\t\tfReader.close();\r\n\r\n\t\t} catch (Exception e) {\r\n\r\n\t\t}\r\n\t\t\r\n\t\treturn content;\r\n\t}", "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 }", "@Override\n public String read(String elementId) throws IOException {\n\n File file = new File(mDataFolder, elementId);\n FileInputStream fileInputStream;\n try {\n fileInputStream = new FileInputStream(file);\n } catch (FileNotFoundException e) {\n Logger.d(e.getMessage());\n return null;\n }\n\n StringBuilder fileContent = new StringBuilder();\n\n byte[] buffer = new byte[1024];\n int n;\n\n try {\n while ((n = fileInputStream.read(buffer)) != -1) {\n fileContent.append(new String(buffer, 0, n));\n }\n return fileContent.toString();\n } catch (IOException e) {\n Logger.e(e, \"Can't read file\");\n throw e;\n }\n }", "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 fileToString(String file){\n String path = new File(\"./Users/Colin/AndroidStudioProjects/FlightCompare/app/json/flights.json\").getAbsolutePath();\n File fileObj = new File(path);\n Log.d(\"Reading JSON file\", \"File exists: \" + fileObj.exists());\n Log.d(\"Reading JSON file\", \"File is directory: \" + fileObj.isDirectory());\n Log.d(\"Reading JSON file\", \"File can read: \" + fileObj.canRead());\n Log.d(\"Reading JSON file\", \"Current directory: \" + path);\n Log.d(\"Reading JSON file\", \"The path is: \" + file);\n try(Scanner in = new Scanner(new File(file))){\n StringBuilder sb = new StringBuilder();\n while(in.hasNextLine()){\n sb.append(in.nextLine());\n sb.append('\\n');\n }\n in.close();\n\n return sb.toString();\n }\n catch (FileNotFoundException ex){\n ex.printStackTrace();\n }\n return null;\n }", "public static String read(String filename) {\n StringBuilder sb = new StringBuilder();\n try {\n FileReader fr = new FileReader(new File(filename));\n BufferedReader br = new BufferedReader(fr);\n String s;\n while ((s = br.readLine()) != null) {\n sb.append(s).append(\"\\n\");\n }\n br.close();\n fr.close();\n } catch (FileNotFoundException ex) {\n } catch (IOException ex) {\n }\n return sb.toString();\n }", "public static String readFile(File file) {\n FileInputStream fis = null;\n try {\n fis = new FileInputStream(file);\n byte[] b = Utils.readBytes(fis);\n return new String(b, StandardCharsets.UTF_8);\n } catch (IOException e) {\n e.printStackTrace();\n }finally {\n if(fis != null) {\n try {\n fis.close();\n } catch (IOException e) {\n e.printStackTrace();\n }\n }\n }\n return null;\n }" ]
[ "0.7443202", "0.7315426", "0.72186536", "0.71853745", "0.71615785", "0.715444", "0.7134137", "0.7115979", "0.70603216", "0.7052144", "0.7031198", "0.7031198", "0.7031198", "0.7022255", "0.70151436", "0.70098585", "0.6947592", "0.692079", "0.6920743", "0.69100094", "0.6906119", "0.6865808", "0.68447655", "0.6820949", "0.67997766", "0.6799558", "0.6795035", "0.67896837", "0.6768016", "0.6736788", "0.67347896", "0.67291504", "0.67213494", "0.67077917", "0.6694311", "0.6679269", "0.66778284", "0.6662884", "0.66624445", "0.66564745", "0.6656406", "0.6655436", "0.66549665", "0.66453946", "0.6639389", "0.66352904", "0.6610218", "0.66036594", "0.65835303", "0.6581393", "0.6580235", "0.65787274", "0.65649784", "0.65642583", "0.6563396", "0.6562564", "0.65613604", "0.6557321", "0.65548253", "0.65547127", "0.6554084", "0.6545535", "0.6535217", "0.6528378", "0.65249", "0.65199643", "0.6515439", "0.6514868", "0.65077245", "0.6507024", "0.6502977", "0.6497664", "0.6492048", "0.649129", "0.6478329", "0.6476238", "0.6473248", "0.6470172", "0.64684474", "0.6467524", "0.6457795", "0.6452704", "0.6449857", "0.6437203", "0.64354277", "0.6430272", "0.6405633", "0.63993174", "0.6397643", "0.63937795", "0.63846326", "0.6384565", "0.6383911", "0.6382103", "0.63670796", "0.63667965", "0.6360497", "0.6357655", "0.63499427", "0.6344541" ]
0.6924612
17
method copies a file from one location to other location
public int Copy(final String sSourceFile, final String sDestinationtFile, final int EXISITING_FILE_ACTION) throws Exception { OutputStream out = null; InputStream in = null; File fSrc = null; File fDest = null; File fDestDir = null; byte[] buf = null; int len = 0; int iFileCopied = 0; boolean bProcess = false; try { buf = new byte[4096]; //reating source file object fSrc = new File(sSourceFile); if (!fSrc.exists()) { throw new Exception("Source File Does not exists!! :" + sSourceFile); } //creating output file object fDest = new File(sDestinationtFile); //check for folder/directory if (fSrc.isDirectory()) { File[] fSubFiles = fSrc.listFiles(); //creating destination directory if (!fDest.exists()) { fDest.mkdirs(); } for (int i = 0; i < fSubFiles.length; i++) { String sSourceSubFile = sSourceFile + File.separator + fSubFiles[i].getName(); String sDestinationtSubFile = sDestinationtFile + File.separator + fSubFiles[i].getName(); iFileCopied = iFileCopied + Copy(sSourceSubFile, sDestinationtSubFile, EXISITING_FILE_ACTION); } //check for file } else { //creating input stream of source file in = new FileInputStream(fSrc); //check for destination file parent directory fDestDir = fDest.getParentFile(); if (!fDestDir.exists()) { fDestDir.mkdirs(); } //check for exisitng file //REPLACE EXISITNG FILE if (fDest.exists() && EXISITING_FILE_ACTION == FILE_REPLACE) { bProcess = true; out = new FileOutputStream(fDest); //APPEND EXISITNG FILE } else if (fDest.exists() && EXISITING_FILE_ACTION == FILE_APPEND) {//For Append the file. bProcess = true; out = new FileOutputStream(fDest, true); //COPY WITH TIMESTAMP WITH EXISITNG FILE } else if (fDest.exists() && EXISITING_FILE_ACTION == FILE_COPY_WITH_TIMESTAMP) {//For Append the file. bProcess = true; String sTimeStamp = fDest.lastModified() + "_"; fDest = new File(fDest.getParent() + File.separator + sTimeStamp + fDest.getName()); out = new FileOutputStream(fDest); //DO NOTHING EXISITNG FILE } else if (fDest.exists() && EXISITING_FILE_ACTION == FILE_DO_NOTHING) {//For Append the file. bProcess = false; //file does not exists } else if (!fDest.exists()) { bProcess = true; out = new FileOutputStream(fDest, true); } //loop to read buffer & copy in output file while ((len = in.read(buf)) > 0 && bProcess) { out.write(buf, 0, len); } iFileCopied = iFileCopied + 1; } return iFileCopied; } catch (Exception e) { throw e; } finally { try { in.close(); } catch (Exception e) { } try { out.close(); } catch (Exception e) { } in = null; out = null; fSrc = null; fDest = null; fDestDir = null; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "void copyFile(String sourceFile, String destinationFile) throws IOException;", "public void copyOne(String from, String to) {\n\t\tFile source = new File(from);\n\t\tif (sourceExists(source)) {\n\t\t\tFile target = new File(to);\n\t\t\ttry{\n\t\t\t\tif(!targetExists(target)){\n\t\t\t\t\tFiles.copy(source.toPath(), target.toPath());\n\t\t\t\t\tSystem.out.println(\"File \" + target.getName()\n\t\t\t\t\t\t\t+ \" COPIED!\");\n\t\t\t\t} else if (target.exists() && confirmReplace()) {\n\t\t\t\t\tFiles.copy(source.toPath(), target.toPath(),\n\t\t\t\t\t\t\tREPLACE_EXISTING);\n\t\t\t\t\tSystem.out.println(\"File \" + target.getName() + \" REPLACED!\");\n\t\t\t\t}else{\n\t\t\t\t\tSystem.out.println(\"File WASN'T copied!\");\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}\n\t}", "public static void copyFile(String from, String to) throws IOException{\r\n Path src = Paths.get(from); // set path of source directory from parent function\r\n Path dest = Paths.get(to); // set path of destination directory from parent function\r\n Files.copy(src, dest); //inbuilt function to copy files\r\n \r\n }", "void copyFile(String sourceFile, String destinationFile, boolean overwrite) throws IOException;", "private static void copyFile(String from, String to)\n\t{\n\t\tFile inputFile;\n\t File outputFile;\n\t\tint fIndex = from.indexOf(\"file:\");\n\t\tint tIndex = to.indexOf(\"file:\");\n\t\tif(fIndex < 0)\n\t\t\tinputFile = new File(from);\n\t\telse\n\t\t\tinputFile = new File(from.substring(fIndex + 5, from.length()));\n\t\tif(tIndex < 0)\n\t\t\toutputFile = new File(to);\n\t\telse\n\t\t\toutputFile = new File(to.substring(tIndex + 5, to.length())); \n\t\tcopyFile(inputFile, outputFile);\t\t\n\t}", "private static void copyFile(File scrFile, File file) {\n\t\r\n}", "private void copyFile(String source, String destination) throws IOException {\n File inputFile = new File(source);\n File outputFile = new File(destination);\n\t\n BufferedInputStream in = new BufferedInputStream(\n\t\t\t\t new FileInputStream(inputFile));\n BufferedOutputStream out = new BufferedOutputStream(\n\t\t\t\t new FileOutputStream(outputFile));\n int c;\n\tbyte[] tmp = new byte[4096];\n\t\n while ((c = in.read(tmp, 0, 4096)) != -1)\n\t out.write(tmp, 0, c);\n\t\n in.close();\n out.close();\n }", "private static void copyFile(File in, File out)\n\t{\n\t\ttry\n\t\t{\n\t\t\tFileChannel inChannel = new\tFileInputStream(in).getChannel();\n\t\t\tFileChannel outChannel = new FileOutputStream(out).getChannel();\n\t\t\tinChannel.transferTo(0, inChannel.size(), outChannel);\n\t\t\tinChannel.close();\n\t\t\toutChannel.close();\t\t\t\n\t\t} catch (Exception e)\n\t\t{\n\t\t\tDebug.e(\"RFO.copyFile(): \" + e);\n\t\t}\n\n\t}", "private void copy(File src, File dst) throws IOException \r\n {\r\n InputStream in = new FileInputStream(src);\r\n OutputStream out = new FileOutputStream(dst);\r\n \r\n // Transfer bytes from in to out\r\n byte[] buf = new byte[1024];\r\n int len;\r\n while ((len = in.read(buf)) > 0) \r\n {\r\n out.write(buf, 0, len);\r\n }\r\n in.close();\r\n out.close();\r\n }", "public void copy(){\n\t\tFileInputStream is = null;\n\t\tFileOutputStream os = null;\n\t\ttry {\n\t\t\tis = new FileInputStream(source);\n\t\t\tos = new FileOutputStream(dest);\n\t\t\tif(dest.exists())\n\t\t\t\tdest.delete();\n\t\t\tint i = -1;\n\t\t\twhile((i = is.read()) != -1)\n\t\t\t\tos.write(i);\n\t\t\tsource.deleteOnExit();\n\t\t} catch (IOException e) {\n\t\t\tJOptionPane.showMessageDialog(null, e);\n\t\t} finally {\n\t\t\tif(is != null)\n\t\t\t\ttry {\n\t\t\t\t\tis.close();\n\t\t\t\t} catch (IOException ignored) {}\n\t\t\tif(os != null)\n\t\t\t\ttry {\n\t\t\t\t\tos.close();\n\t\t\t\t} catch (IOException e) {\n\t\t\t\t\tJOptionPane.showMessageDialog(null, e);\n\t\t\t\t}\n\t\t}\n\t}", "public static void copyFile(String from, String to) throws IOException{\r\n Path src = Paths.get(from);\r\n Path dest = Paths.get(to);\r\n Files.copy(src, dest, StandardCopyOption.REPLACE_EXISTING);\r\n }", "public void copy(String name, String oldPath, String newPath);", "private void copyFile(InputStream ins, OutputStream outs) throws IOException {\n byte[] buffer = new byte[1024];\n int read;\n while((read = ins.read(buffer)) != -1) {\n outs.write(buffer, 0, read);\n }\n }", "public void copy(String file1, String file2) throws FileNotFoundException{\r\n\t\tFile original = new File(file1);\r\n\t\tFile copied = new File(file2);\r\n\t\t\r\n\t\tScanner input = new Scanner(original);\r\n\t\tPrintWriter output = new PrintWriter(copied);//writes new file\r\n\t\t\r\n\t\twhile(input.hasNextLine()){\r\n\t\t\tString next = input.nextLine();\r\n\t\t\toutput.println(next);\t\t\t\r\n\t\t}\r\n\t\toutput.close();\r\n\t\tinput.close();\r\n\t}", "public static void copyFile(File source, File destination) throws IOException {\n\tFileChannel sourceChannel = null;\n\tFileChannel destinationChannel = null;\n\ttry {\n\t if (destination.exists()) {\n\t\tdestination.delete();\n\t }\n\t sourceChannel = new FileInputStream(source).getChannel();\n\t destinationChannel = new FileOutputStream(destination).getChannel();\n\t int maxCount = (64 * 1024 * 1024) - (32 * 1024);// magic number for Windows, 64Mb - 32Kb\n\t long size = sourceChannel.size();\n\t long position = 0;\n\t while (position < size) {\n\t\tposition += sourceChannel.transferTo(position, maxCount, destinationChannel);\n\t }\n\t} catch (IOException e) {\n\t throw e;\n\t} finally {\n\t if (null != sourceChannel) {\n\t\tsourceChannel.close();\n\t }\n\t if (null != destinationChannel) {\n\t\tdestinationChannel.close();\n\t }\n\t}\n }", "private void copyFile(String source, String destination, Environment env) throws IOException, InvalidPathException {\n\t\tPath sourcePath = Paths.get(source);\n\t\tPath destinationPath = Paths.get(destination);\n\n\t\tif (sourcePath.equals(destinationPath)) {\n\t\t\tenv.writeln(\"The source and the destination can not be equal.\");\n\t\t\treturn;\n\t\t}\n\t\tif (!Files.exists(sourcePath)) {\n\t\t\tenv.writeln(\"The specified file does not exist.\");\n\t\t\treturn;\n\t\t}\n\t\tif (Files.isDirectory(sourcePath)) {\n\t\t\tenv.writeln(\"Copy command can not copy a directory.\");\n\t\t\treturn;\n\t\t}\n\t\tif (Files.isDirectory(destinationPath)) {\n\t\t\tdestinationPath = Paths.get(destinationPath.toString(), sourcePath.getFileName().toString());\n\t\t}\n\t\tif (Files.exists(destinationPath)) {\n\t\t\tenv.write(\n\t\t\t\t\t\"There already is a file with the same name at the specified destination. \\nDo you want to overwrite it? [y/n] \");\n\n\t\t\twhile (true) {\n\t\t\t\tString answer;\n\t\t\t\ttry {\n\t\t\t\t\tanswer = env.readLine().trim();\n\t\t\t\t} catch (ShellIOException ex) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tif (answer.equals(\"n\")) {\n\t\t\t\t\tenv.writeln(\"Operation canceled.\");\n\t\t\t\t\treturn;\n\t\t\t\t} else if (answer.equals(\"y\")) {\n\t\t\t\t\tenv.writeln(\"Operation confirmed.\");\n\t\t\t\t\tbreak;\n\t\t\t\t} else {\n\t\t\t\t\tenv.writeln(\"Invalid answer. Answer 'y' for 'yes' or 'n' for 'no'.\");\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tBufferedInputStream inputStream = new BufferedInputStream(Files.newInputStream(sourcePath));\n\t\tBufferedOutputStream outputStream = new BufferedOutputStream(Files.newOutputStream(destinationPath));\n\t\twhile (true) {\n\t\t\tint b = inputStream.read();\n\t\t\tif (b == -1) {\n\t\t\t\tbreak;\n\t\t\t}\n\n\t\t\toutputStream.write(b);\n\t\t}\n\n\t\tinputStream.close();\n\t\toutputStream.close();\n\t}", "void copyFile(File sourcefile, File targetfile) throws Exception {\n\t\tif(targetfile.exists()) targetfile.delete();\n\t\ttargetfile.createNewFile();\n\t\tFileChannel source = null;\n\t\tFileChannel target = null;\n\t\ttry{\n\t\t\tsource = new FileInputStream(sourcefile).getChannel();\n\t\t\ttarget = new FileOutputStream(targetfile).getChannel();\n\t\t\ttarget.transferFrom(source, 0, source.size());\n\t\t}\n\t\tfinally{\n\t\t\tif(source!=null) source.close();\n\t\t\tif(target!=null) target.close();\n\t\t}\n\t\ttargetfile.setLastModified(sourcefile.lastModified());\n\t}", "static void copyFile(File src, File dest) throws IOException {\r\n\t\tFileInputStream fis = new FileInputStream(src);\r\n\t\tFileOutputStream fos = new FileOutputStream (dest);\r\n\t\tbyte[] bytes = new byte[4*1048576];\r\n\t\tint numRead;\r\n\t\twhile ((numRead = fis.read(bytes)) > 0) {\r\n\t\t\tfos.write(bytes, 0, numRead);\r\n\t\t}\r\n\t\tfis.close();\r\n\t\tfos.close();\r\n\t}", "private void copyFile( final File source, final File target )\n throws MojoExecutionException\n {\n if ( source.exists() == false )\n {\n throw new MojoExecutionException( \"Source file '\" + source.getAbsolutePath() + \"' does not exist!\" );\n }\n if ( target.exists() == true )\n {\n throw new MojoExecutionException( \"Target file '\" + source.getAbsolutePath() + \"' already existing!\" );\n }\n\n try\n {\n this.logger.debug( \"Copying file from '\" + source.getAbsolutePath() + \"' to \" + \"'\"\n + target.getAbsolutePath() + \"'.\" );\n PtFileUtil.copyFile( source, target );\n }\n catch ( PtException e )\n {\n throw new MojoExecutionException( \"Could not copy file from '\" + source.getAbsolutePath() + \"' to \" + \"'\"\n + target.getAbsolutePath() + \"'!\", e );\n }\n }", "@SuppressWarnings(\"resource\")\r\n\tpublic static synchronized void copyFile(File source, File dest)\r\n\t\t\tthrows IOException {\r\n\t\tFileChannel srcChannel = null;\r\n\t\tFileChannel dstChannel = null;\r\n\t\ttry {\r\n\t\t\tsrcChannel = new FileInputStream(source).getChannel();\r\n\t\t\tdstChannel = new FileOutputStream(dest).getChannel();\r\n\t\t\tdstChannel.transferFrom(srcChannel, 0, srcChannel.size());\r\n\t\t} finally {\r\n\t\t\tsrcChannel.close();\r\n\t\t\tdstChannel.close();\r\n\t\t}\r\n\t}", "public void copyFile(String src, String dst) throws IOException {\n\n\t\tFile srcFile = new File(src);\n\t\tFile dstFile = new File(dst);\n\n\t\tcopyFile(srcFile, dstFile);\n\t}", "private static void cp(File f1,File f2) throws IOException{\n\t\tFileInputStream fi=new FileInputStream(f1);\r\n\t\tFileOutputStream fo=new FileOutputStream(f2);\r\n\t\tBufferedOutputStream bof=new BufferedOutputStream(fo);\r\n\t\tBufferedInputStream bis=new BufferedInputStream(fi);\r\n\t\tbyte[] buffer=new byte[1024];\r\n\t\tint off=0;\r\n\t\tint length=1024;\r\n\t\twhile(true){\r\n\t\t\tif(fi.available()<1024){\r\n\t\t\t\tlength=fi.available();}\r\n\t\tbis.read(buffer, off, length);\r\n\t\tbof.write(buffer, off, length);\r\n//\t\tfi.read(buffer, off,length);\r\n//\t\tfo.write(buffer, off, length);\r\n\t\tif(length<1024){\r\n\t\t\tSystem.out.println(f1+\"-->\"+f2+\"复制完成!\");\r\n\t\t\tbof.flush();\r\n\t\t\tfi.close();\r\n\t\t\tfo.close();\r\n\t\t\treturn;}\r\n\t\t}\r\n\t\t\r\n\t}", "public boolean copy(String path, InputStream is) throws SystemException;", "public Path copie(String source, String destination) throws IOException {\n Path root = Paths.get(source);\n Path cible = Paths.get(destination);\n\n Path copy;\n copy = Files.copy(root, cible.resolve(root.getFileName()), StandardCopyOption.REPLACE_EXISTING, StandardCopyOption.COPY_ATTRIBUTES);\n\n return copy;\n }", "public static void copy(File file, File file2) {\n Throwable th;\n Throwable th2;\n Throwable th3;\n Throwable th4 = null;\n FileInputStream fileInputStream = new FileInputStream(file);\n FileOutputStream fileOutputStream = new FileOutputStream(file2);\n byte[] bArr = new byte[1024];\n while (true) {\n int read = fileInputStream.read(bArr);\n if (read > 0) {\n fileOutputStream.write(bArr, 0, read);\n } else {\n fileOutputStream.close();\n fileInputStream.close();\n return;\n }\n }\n throw th2;\n if (th4 == null) {\n }\n throw th;\n throw th;\n if (th3 != null) {\n try {\n fileOutputStream.close();\n } catch (Throwable th5) {\n }\n } else {\n fileOutputStream.close();\n }\n throw th2;\n }", "private static void copyFiles(File source, File dest) throws IOException {\n\t\tif(!source.equals(dest))\n\t\t\tFileUtils.copyFile(source, dest);\n\t}", "public void copyFile(String destination, String fileName, InputStream in) {\r\n try {\r\n // write the inputStream to a FileOutputStream\r\n OutputStream out = new FileOutputStream(new File(destination + fileName));\r\n int read = 0;\r\n byte[] bytes = new byte[1024];\r\n while ((read = in.read(bytes)) != -1) {\r\n out.write(bytes, 0, read);\r\n }\r\n in.close();\r\n out.flush();\r\n out.close();\r\n } catch (IOException e) {\r\n System.out.println(e.getMessage());\r\n }\r\n }", "public void copyFile(String oldPath, String newPath) {\n\t\ttry {\n\t\t\tint byteread = 0;\n\t\t\tFile oldfile = new File(oldPath);\n\t\t\tif (oldfile.exists()) {\n\t\t\t\tFileInputStream oldStream = new FileInputStream(oldPath);\n\t\t\t\tFileOutputStream newStream = new FileOutputStream(newPath);\n\t\t\t\tbyte[] buffer = new byte[1024];\n\t\t\t\twhile ((byteread = oldStream.read(buffer)) != -1) {\n\t\t\t\t\tnewStream.write(buffer, 0, byteread);\n\t\t\t\t}\n\t\t\t\tnewStream.close();\n\t\t\t\toldStream.close();\n\t\t\t}\n\t\t} catch (Exception e) {\n\t\t\tSystem.out.println(\"\");\n\t\t\te.printStackTrace();\n\t\t}\n\t}", "@Test(groups = \"Integration\")\n public void testCopyFileTo() throws Exception {\n File dest = Os.newTempFile(getClass(), \".dest.tmp\");\n File src = Os.newTempFile(getClass(), \".src.tmp\");\n try {\n Files.write(\"abc\", src, Charsets.UTF_8);\n host.copyTo(src, dest);\n assertEquals(\"abc\", Files.readFirstLine(dest, Charsets.UTF_8));\n } finally {\n src.delete();\n dest.delete();\n }\n }", "public static void copyFile(InputStream in, File to) throws IOException {\r\n FileOutputStream out = new FileOutputStream(to);\r\n int len;\r\n byte[] buffer = new byte[4096];\r\n while ((len = in.read(buffer)) != -1) {\r\n out.write(buffer, 0, len);\r\n }\r\n out.close();\r\n in.close();\r\n }", "public static void copyFile(File from, File to) throws IOException {\r\n FileInputStream in = new FileInputStream(from);\r\n copyFile(in, to);\r\n }", "private int copy(String from, String to, int flag) {\n\n File fromFile = new File(rootPath + from);\n if (!fromFile.exists()) {\n return ERROR_FILE_NOT_EXIST;\n }\n\n if ((flag & FLAG_FORCE) != 0) {\n delete(to);\n }\n\n if (createFile(to) < 0) {\n return ERROR_FILE_ALREADY_EXIST;\n }\n\n File toFile = new File(rootPath + to);\n if (!toFile.setWritable(true)) {\n return ERROR;\n }\n\n try {\n BufferedInputStream inputStream = new BufferedInputStream(new FileInputStream(fromFile));\n BufferedOutputStream outputStream = new BufferedOutputStream(new FileOutputStream(toFile));\n byte[] buf = new byte[BUF_SIZE];\n // TODO : it limits file size to INTEGER!!\n int offset = 0;\n int read = 0;\n while((read = inputStream.read(buf)) >= 0) {\n outputStream.write(buf, offset, read);\n offset += read;\n }\n inputStream.close();\n outputStream.close();\n } catch (FileNotFoundException e) {\n // file not found\n return ERROR_FILE_NOT_EXIST;\n } catch (IOException e) {\n // IO Exception\n return ERROR;\n }\n\n return OK;\n }", "public static IStatus copyFile(String from, String to) {\n \t\ttry {\n \t\t\treturn copyFile(new FileInputStream(from), to);\n \t\t} catch (Exception e) {\n \t\t\tTrace.trace(Trace.SEVERE, \"Error copying file\", e);\n \t\t\treturn new Status(IStatus.ERROR, TomcatPlugin.PLUGIN_ID, 0, NLS.bind(Messages.errorCopyingFile, new String[] {to, e.getLocalizedMessage()}), e);\n \t\t}\n \t}", "public static final void copy(String source, String destination) {\n File sourceFile = new File(source);\n File destFile = new File(destination);\n\n if (destFile.exists()) {\n // Information error all ready exist the file\n }\n\n if (!sourceFile.exists()) {\n // General Server Error\n }\n\n if (sourceFile.isDirectory()) {\n copyDirectory(source, destination);\n } else {\n copyFile(source, destination);\n }\n\n //delete source folder after copy-paste\n }", "public static void copyFile(File src, File dst) throws IOException {\n InputStream in = new FileInputStream(src);\n OutputStream out = new FileOutputStream(dst);\n byte[] buf = new byte[1024];\n int len;\n while ((len = in.read(buf)) > 0) out.write(buf, 0, len);\n in.close();\n out.close();\n }", "private static void copyFile(Path srcPath, Path destPath) throws IOException {\n try (FileWriter outputStream = new FileWriter(destPath.toFile().getAbsolutePath(), false);\n FileReader inputStream = new FileReader(srcPath.toFile().getAbsolutePath())) {\n int i;\n while ((i = inputStream.read()) != -1) {\n outputStream.write(toChars(i));\n }\n }\n }", "public static void copyFile(File oldLocation, File newLocation) throws IOException {\n\t\tif (oldLocation.exists()) {\n\t\t\tBufferedInputStream reader = new BufferedInputStream(new FileInputStream(oldLocation));\n\t\t\tBufferedOutputStream writer = new BufferedOutputStream(new FileOutputStream(newLocation, false));\n\t\t\ttry {\n\t\t\t\tbyte[] buff = new byte[8192];\n\t\t\t\tint numChars;\n\t\t\t\twhile ((numChars = reader.read(buff, 0, buff.length)) != -1) {\n\t\t\t\t\twriter.write(buff, 0, numChars);\n\t\t\t\t}\n\t\t\t} catch (IOException ex) {\n\t\t\t\tthrow new IOException(\n\t\t\t\t\t\t\"IOException when transferring \" + oldLocation.getPath() + \" to \" + newLocation.getPath());\n\t\t\t} finally {\n\t\t\t\ttry {\n\t\t\t\t\tif (reader != null) {\n\t\t\t\t\t\twriter.close();\n\t\t\t\t\t\treader.close();\n\t\t\t\t\t}\n\t\t\t\t} catch (IOException ex) {\n\t\t\t\t\tSystem.out.println(\"Error closing files when transferring \" + oldLocation.getPath() + \" to \"\n\t\t\t\t\t\t\t+ newLocation.getPath());\n\t\t\t\t}\n\t\t\t}\n\t\t} else {\n\t\t\tthrow new IOException(\"Old location does not exist when transferring \" + oldLocation.getPath() + \" to \"\n\t\t\t\t\t+ newLocation.getPath());\n\t\t}\n\t}", "public static void main(String[] args) {\n Scanner scanner = new Scanner(System.in);\n System.out.println(\"Add the location of the source file\");\n String location1 = scanner.next();\n System.out.println(\"Add the location of the destination file\");\n String location2 = scanner.next();\n System.out.println(copyFile(location1, location2));\n }", "public static IStatus copyFile(URL from, String to) {\n \t\ttry {\n \t\t\treturn copyFile(from.openStream(), to);\n \t\t} catch (Exception e) {\n \t\t\tTrace.trace(Trace.SEVERE, \"Error copying file\", e);\n \t\t\treturn new Status(IStatus.ERROR, TomcatPlugin.PLUGIN_ID, 0, NLS.bind(Messages.errorCopyingFile, new String[] {to, e.getLocalizedMessage()}), e);\n \t\t}\n \t}", "static void copyFile(File srcFile, File destFile) {\n\t\ttry {\n\t\t\tLong start = System.currentTimeMillis();\n\t\t\tdestFile.createNewFile();\n\t\t\tInputStream oInStream = new FileInputStream(srcFile);\n\t\t\tOutputStream oOutStream = new FileOutputStream(destFile);\n\n\t\t\t// Transfer bytes from in to out\n\t\t\tbyte[] oBytes = new byte[1024];\n\t\t\tint nLength;\n\t\t\tBufferedInputStream oBuffInputStream = \n\t\t\t\t\tnew BufferedInputStream( oInStream );\n\t\t\twhile ((nLength = oBuffInputStream.read(oBytes)) > 0) {\n\t\t\t\toOutStream.write(oBytes, 0, nLength);\n\t\t\t}\n\t\t\toInStream.close();\n\t\t\toOutStream.close();\n\t\t\tLong end = System.currentTimeMillis();\n\t\t\tSystem.out.println((end-start));\n\t\t} catch (IOException e) {\n\t\t\tlogger.info(\"Error in creating the excels :\" +e.getMessage());\n\t\t\te.printStackTrace();\n\t\t}\n\n\t}", "private void migrate (String name)\t{\n\t\ttry{\n\t\t\tFile f1 = new File( sourceDir + name);\n\t\t\t\n\t\t\tif (!f1.exists())\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tFile f2 = new File(targetDir +name);\n\t\t\t\n\t\t InputStream in = new FileInputStream(f1);\n\t\t \n\t\t OutputStream out = new FileOutputStream(f2);\n\n\t\t byte[] buf = new byte[1024];\n\t\t int len;\n\t\t while ((len = in.read(buf)) > 0){\n\t\t out.write(buf, 0, len);\n\t\t }\n\t\t in.close();\n\t\t out.close();\n\t\t System.out.println(\"File copied.\");\n\t\t }\n\t\t catch(FileNotFoundException ex){\n\t\t System.out.println(ex.getMessage() + \" in the specified directory.\");\n\t\t System.exit(0);\n\t\t }\n\t\t catch(IOException e){\n\t\t System.out.println(e.getMessage()); \n\t\t }\n\t}", "public void copyFile(String inputFile, String outputFile)\r\n\t{\r\n\t\tif(new File(inputFile).exists())\r\n\t\t{\r\n\t\t\ttry\r\n\t\t\t{\r\n\t\t\t\tInputStream in = new FileInputStream(inputFile);\r\n\t\t\t\tOutputStream out = new FileOutputStream(outputFile);\r\n\t\t\t\t// Transfer bytes from in to out\r\n\t\t\t\tbyte[] buf = new byte[1024];\r\n\t\t\t\tint length;\r\n\t\t\t\twhile ((length = in.read(buf)) > 0)\r\n\t\t\t\t{\r\n\t\t\t\t\tout.write(buf, 0, length);\r\n\t\t\t\t}\r\n\t\t\t\tin.close();\r\n\t\t\t\tout.close();\r\n\t\t\t\tSystem.out.println(inputFile + \" file copied to \" + outputFile);\r\n\t\t\t\tLog.info(inputFile + \" file copied.\");\r\n\t\t\t}\r\n\t\t\tcatch(IOException e) \r\n\t\t\t{\r\n\t\t\t\te.printStackTrace();\r\n\t\t\t}\r\n\t\t}\t\t\r\n\t}", "public void copyFile(File src, File dst) throws IOException {\n File file = new File(dst + File.separator + src.getName());\n file.createNewFile();\n Log.i(\"pictureSelect\", \"Dest file: \" + file.getAbsolutePath());\n\n InputStream in = new FileInputStream(src);\n OutputStream out = new FileOutputStream(file);\n\n // Transfer bytes from in to out\n byte[] buf = new byte[1024];\n int len;\n while ((len = in.read(buf)) > 0) {\n out.write(buf, 0, len);\n }\n in.close();\n out.close();\n scanSD(file);\n }", "public static void copyFile(File src, File dst) throws IOException {\n if (!src.exists()) {\n throw new IOException(\"Source file does not exist: \" + src);\n }\n \n String dstAbsPath = dst.getAbsolutePath();\n String dstDir = dstAbsPath.substring(0, dstAbsPath.lastIndexOf(File.separator));\n File dir = new File(dstDir);\n if (!dir.exists() && !dir.mkdirs()) {\n throw new IOException(\"Fail to create the directory: \" + dir.getAbsolutePath());\n }\n\n try (InputStream in = new FileInputStream(src); OutputStream out = new FileOutputStream(dst)) {\n\n // Transfer bytes from in to out\n byte[] buf = new byte[10240];\n int len;\n while ((len = in.read(buf)) > 0) {\n out.write(buf, 0, len);\n }\n } catch (IOException e) {\n logger.warn(\"Unable to copy file \" + e.getMessage(), e);\n throw new IOException(\"Unable to copy file \", e);\n }\n }", "public void copyFile(File src, File dst) throws IOException {\n\t\tInputStream in = new FileInputStream(src);\n\t\tOutputStream out = new FileOutputStream(dst);\n\n\t\t// Transfer bytes from in to out\n\t\tbyte[] buf = new byte[1024];\n\t\tint len;\n\t\twhile ((len = in.read(buf)) > 0) {\n\t\t\tif(logger.isDebugEnabled())\n\t\t\t\tlogger.debug(\"Copiando fichero \" + src.getAbsolutePath() + \" a \"\n\t\t\t\t\t+ dst.getAbsolutePath());\n\t\t\tout.write(buf, 0, len);\n\t\t}\n\t\tin.close();\n\t\tout.close();\n\t}", "public void copyImageFile() throws IOException {\n Path sourcePath = imageFile.toPath();\n\n String selectFileName = imageFile.getName();\n\n Path targetPath = Paths.get(\"/Users/houumeume/IdeaProjects/Assignment2/image/\" + selectFileName);\n\n //copy the file to the new directory\n Files.copy(sourcePath, targetPath, StandardCopyOption.REPLACE_EXISTING);\n\n //update the imageFile to point to the new File\n imageFile = new File(targetPath.toString());\n }", "public static IStatus copyFile(InputStream in, String to) {\n \t\tOutputStream out = null;\n \t\n \t\ttry {\n \t\t\tout = new FileOutputStream(to);\n \t\n \t\t\tint avail = in.read(buf);\n \t\t\twhile (avail > 0) {\n \t\t\t\tout.write(buf, 0, avail);\n \t\t\t\tavail = in.read(buf);\n \t\t\t}\n \t\t\treturn Status.OK_STATUS;\n \t\t} catch (Exception e) {\n \t\t\tTrace.trace(Trace.SEVERE, \"Error copying file\", e);\n \t\t\treturn new Status(IStatus.ERROR, TomcatPlugin.PLUGIN_ID, 0, NLS.bind(Messages.errorCopyingFile, new String[] {to, e.getLocalizedMessage()}), e);\n \t\t} finally {\n \t\t\ttry {\n \t\t\t\tif (in != null)\n \t\t\t\t\tin.close();\n \t\t\t} catch (Exception ex) {\n \t\t\t\t// ignore\n \t\t\t}\n \t\t\ttry {\n \t\t\t\tif (out != null)\n \t\t\t\t\tout.close();\n \t\t\t} catch (Exception ex) {\n \t\t\t\t// ignore\n \t\t\t}\n \t\t}\n \t}", "public static void copyFile(final String fromPath, final String toPath) throws IOException {\n FileUtils.copyFileToDirectory(new File(fromPath), new File(toPath));\n }", "public static void Copy(File toCopy, File destination) throws IOException {\n\t\tInputStream in = new BufferedInputStream(new FileInputStream(toCopy));\n\t\tOutputStream out = new BufferedOutputStream(new FileOutputStream(destination));\n\n\t\tbyte[] buffer = new byte[1024];\n\t\tint lengthRead;\n\t\twhile ((lengthRead = in.read(buffer)) > 0) {\n\t\t\tout.write(buffer, 0, lengthRead);\n\t\t\tout.flush();\n\t\t}\n\t\tout.close();\n\t\tin.close();\n\t}", "public void moveFile(String url) throws IOException {\n\n\t\tSystem.out.println(\"folder_temp : \" + folder_temp);\n\t\tPath Source = Paths.get(folder_temp + url);\n\t\tPath Destination = Paths.get(folder_photo + url);\n\t\tSystem.out.println(\"folder_photo : \" + folder_photo);\n\n\t\tif (Files.exists(Source)) {\n\t\t\t// Files.move(Source, Destination,\n\t\t\t// StandardCopyOption.REPLACE_EXISTING);\n\t\t\t// cpie du fichiet au lieu de deplaacer car il est enn coiurs\n\t\t\t// d'utilisation\n\t\t\tFiles.copy(Source, Destination, StandardCopyOption.REPLACE_EXISTING);\n\t\t}\n\n\t}", "public String copy(MultipartFile file) throws IOException;", "public void copyFileTo(String sourceFilename, String targetFilename)\r\n\tthrows FileNotFoundException, IOException {\r\n\t\tString theFileContent = readStringFromFile(sourceFilename);\r\n\t\toverwriteStringToFile(theFileContent, targetFilename);\r\n\t}", "public static void main(String[] args) throws IOException {\n\t\tString sourcePathHdfs=args[0];\n\t\tString destinationPath=args[1];\n\t\tnew CopyToLocal().copyToLocal(sourcePathHdfs, destinationPath);\n\t\t\n\t}", "private void copyFolder(File sourceFolder, File destinationFolder) throws IOException {\n //Check if sourceFolder is a directory or file\n //If sourceFolder is file; then copy the file directly to new location\n if (sourceFolder.isDirectory()) {\n //Verify if destinationFolder is already present; If not then create it\n if (!destinationFolder.exists()) {\n destinationFolder.mkdir();\n logAppend(\"Directory created :: \" + destinationFolder);\n nothingDone=false;\n }\n\n //Get all files from source directory\n String files[] = sourceFolder.list();\n\n //Iterate over all files and copy them to destinationFolder one by one\n for (String file : files) {\n\n File srcFile = new File(sourceFolder, file);\n File destFile = new File(destinationFolder, file);\n\n //Recursive function call\n copyFolder(srcFile, destFile);\n }\n } else {\n\n long dateSrc = sourceFolder.lastModified();\n long dateDest = destinationFolder.lastModified();\n\n if (dateSrc > dateDest) {\n //Copy the file content from one place to another\n Files.copy(sourceFolder.toPath(), destinationFolder.toPath(), StandardCopyOption.REPLACE_EXISTING);\n logAppend(\"File copied :: \" + destinationFolder);\n nothingDone=false;\n }\n\n }\n }", "public static void copy(String destdir, String pathfile) throws Exception {\r\n \t\tFile file = new File(pathfile);\r\n \t\tFile destDir = new File(destdir);\r\n \t\tcopy(destDir, file);\r\n\t}", "public boolean copyTo (String destinationFile) {\r\n\t\tlogger.debug(\"(File)From \"+this.fullPath+ \" To \"+destinationFile);\r\n\t\ttry {\r\n\t\t\tFile source = new File(this.fullPath);\r\n\t\t\tFiles.copy(source.toPath(),Paths.get(destinationFile),NOFOLLOW_LINKS);\r\n\t\t\t// Prévoir une procédure de recréation du lien copy de lien\r\n\t\t} catch (IOException e) {\r\n\t\t\te.printStackTrace();\r\n\t\t\treturn false;\r\n\t\t}\r\n\t\treturn true;\r\n\t}", "public static boolean copyFile(String src, String dst) {\n FileChannel inChannel = null;\n FileChannel outChannel = null;\n try {\n inChannel = new FileInputStream(new File(src)).getChannel();\n outChannel = new FileOutputStream(new File(dst)).getChannel();\n inChannel.transferTo(0, inChannel.size(), outChannel);\n } catch (FileNotFoundException e) {\n MessageGenerator.briefError(\"ERROR could not find/access file(s): \" + src + \" and/or \" + dst);\n return false;\n } catch (IOException e) {\n MessageGenerator.briefError(\"ERROR copying file: \" + src + \" to \" + dst);\n return false;\n } finally {\n try {\n if (inChannel != null)\n inChannel.close();\n if (outChannel != null)\n outChannel.close();\n } catch (IOException e) {\n MessageGenerator.briefError(\"Error closing files involved in copying: \" + src + \" and \" + dst);\n return false;\n }\n }\n return true;\n }", "public static void copyFileSourceToDestination(File src, File dest) throws IOException {\n\t\tInputStream is = null;\n\t\tOutputStream os = null;\n\t\ttry {\n\t\t\tis = new FileInputStream(src);\n\t\t\tos = new FileOutputStream(dest);\n\t\t\t// buffer size 1K\n\t\t\tbyte[] buf = new byte[1024];\n\t\t\tint bytesRead;\n\t\t\twhile ((bytesRead = is.read(buf)) > 0) {\n\t\t\t\tos.write(buf, 0, bytesRead);\n\t\t\t}\n\t\t} finally {\n\t\t\tis.close();\n\t\t\tos.close();\n\t\t}\n\t}", "private static void copyFile(InputStream is, OutputStream os) throws IOException {\n\n final byte[] buf = new byte[4096];\n int cnt = is.read(buf, 0, buf.length);\n while (cnt >= 0) {\n os.write(buf, 0, cnt);\n cnt = is.read(buf, 0, buf.length);\n }\n os.flush();\n }", "final public VFile copyTo(VDir parentDir) throws VlException\n {\n //return (VFile)doCopyMoveTo(parentDir,null,false /*,options*/);\n return (VFile)this.getTransferManager().doCopyMove(this,parentDir,null,false); \n }", "public void copy(String scrpath,String destpath) throws IOException \n\t{\n\t\ttry {\n\t\t\tInputStream in=new FileInputStream(scrpath);\n\t\t\tFileOutputStream out=new FileOutputStream(destpath);\n\t\t\tbyte[] buffer=new byte[1024];\n\t\t\tint length=0;\n\t\t\twhile((length=in.read(buffer))>0) {\n\t\t\t\tSystem.out.println(length);\n\t\t\t\tout.write(buffer,0,length);\n\t\t\t}\n\t\t\tin.close();\n\t\t\tout.close();\n\t\t\t\n\t\t} catch (FileNotFoundException e) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\te.printStackTrace();\n\t\t}\n\t}", "private void copyOrMoveFile(File file, File dir,boolean isCopy) throws IOException {\n File newFile = new File(dir, file.getName());\n FileChannel outChannel = null;\n FileChannel inputChannel = null;\n try {\n outChannel = new FileOutputStream(newFile).getChannel();\n inputChannel = new FileInputStream(file).getChannel();\n inputChannel.transferTo(0, inputChannel.size(), outChannel);\n inputChannel.close();\n if(!isCopy)\n file.delete();\n } finally {\n if (inputChannel != null) inputChannel.close();\n if (outChannel != null) outChannel.close();\n }\n }", "public void copyFile(InputStream inputStream, OutputStream outputStream) throws IOException\n {\n byte[] buffer = new byte[1024];\n int length;\n while ((length = inputStream.read(buffer)) > 0)\n outputStream.write(buffer, 0, length);\n inputStream.close();\n outputStream.close();\n }", "private static boolean backupAndCopyFile(File templateDir, File toDir, String filename) {\n File to = new File(toDir, filename);\n boolean rv = backupFile(to);\n File from = new File(templateDir, filename);\n boolean rv2 = WorkingDir.copyFile(from, to);\n return rv && rv2;\n }", "private static boolean copyDirectory(File from, File to)\n {\n return copyDirectory(from, to, (byte[])null);\n }", "final public VFile copyTo(VFile targetFile) throws VlException\n {\n //return (VFile)doCopyMoveTo(parentDir,null,false /*,options*/);\n return (VFile)this.getTransferManager().doCopyMove(this,targetFile,false); \n }", "public void mergeFiles(File fichero1, File fichero2, File destino) throws IOException {\n String choice = \"\";\n try (BufferedReader bfr1 = new BufferedReader(new FileReader(fichero1));\n BufferedReader bfr2 = new BufferedReader(new FileReader(fichero2));) {\n\n if (destino.exists()) {\n System.out.print(\"Ya existe el fichero de destino ¿Deseas sobreescribirlo?Escribe si o no: \");\n choice = Utils.getString();\n }\n if (choice.equalsIgnoreCase(\"si\")) {\n BufferedWriter bw = new BufferedWriter(new FileWriter(destino));\n copiarFicheros(bw, bfr1);\n copiarFicheros(bw, bfr2);\n }\n\n } catch (IOException ex) {\n System.out.println(\"Ha ocurrido un error inesperado vuelve a intentarlo\");\n }\n }", "@Test(groups = \"Integration\")\n public void testCopyStreamTo() throws Exception {\n String contents = \"abc\";\n File dest = new File(Os.tmp(), \"sssMachineLocationTest_dest.tmp\");\n try {\n host.copyTo(Streams.newInputStreamWithContents(contents), dest.getAbsolutePath());\n assertEquals(\"abc\", Files.readFirstLine(dest, Charsets.UTF_8));\n } finally {\n dest.delete();\n }\n }", "public static void copyFile(File sourceFile, File destFile)\n throws IOException {\n if (!destFile.exists()) {\n destFile.createNewFile();\n }\n FileChannel source = null;\n FileChannel destination = null;\n try {\n source = new FileInputStream(sourceFile).getChannel();\n destination = new FileOutputStream(destFile).getChannel();\n destination.transferFrom(source, 0, source.size());\n } catch (Exception e) {} finally {\n if (source != null) {\n source.close();\n }\n if (destination != null) {\n destination.close();\n }\n }\n }", "public static void smartCopyDirectory(String from, String to, IProgressMonitor monitor) {\n \t\ttry {\n \t\t\tFile fromDir = new File(from);\n \t\t\tFile toDir = new File(to);\n \t\n \t\t\tFile[] fromFiles = fromDir.listFiles();\n \t\t\tint fromSize = fromFiles.length;\n \t\n \t\t\tmonitor = ProgressUtil.getMonitorFor(monitor);\n \t\t\tmonitor.beginTask(NLS.bind(Messages.copyingTask, new String[] {from, to}), 550);\n \t\n \t\t\tFile[] toFiles = null;\n \t\n \t\t\t// delete old files and directories from this directory\n \t\t\tif (toDir.exists() && toDir.isDirectory()) {\n \t\t\t\ttoFiles = toDir.listFiles();\n \t\t\t\tint toSize = toFiles.length;\n \t\n \t\t\t\t// check if this exact file exists in the new directory\n \t\t\t\tfor (int i = 0; i < toSize; i++) {\n \t\t\t\t\tString name = toFiles[i].getName();\n \t\t\t\t\tboolean isDir = toFiles[i].isDirectory();\n \t\t\t\t\tboolean found = false;\n \t\t\t\t\tfor (int j = 0; j < fromSize; j++) {\n \t\t\t\t\t\tif (name.equals(fromFiles[j].getName()) && isDir == fromFiles[j].isDirectory())\n \t\t\t\t\t\t\tfound = true;\n \t\t\t\t\t}\n \t\n \t\t\t\t\t// delete file if it can't be found or isn't the correct type\n \t\t\t\t\tif (!found) {\n \t\t\t\t\t\tif (isDir)\n \t\t\t\t\t\t\tPublishUtil.deleteDirectory(toFiles[i], null);\n \t\t\t\t\t\telse\n \t\t\t\t\t\t\ttoFiles[i].delete();\n \t\t\t\t\t}\n \t\t\t\t\tif (monitor.isCanceled())\n \t\t\t\t\t\treturn;\n \t\t\t\t}\n \t\t\t} else {\n \t\t\t\tif (toDir.isFile())\n \t\t\t\t\ttoDir.delete();\n \t\t\t\ttoDir.mkdir();\n \t\t\t}\n \t\t\tmonitor.worked(50);\n \t\n \t\t\t// cycle through files and only copy when it doesn't exist\n \t\t\t// or is newer\n \t\t\ttoFiles = toDir.listFiles();\n \t\t\tint toSize = toFiles.length;\n \t\t\tint dw = 0;\n \t\t\tif (toSize > 0)\n \t\t\t\tdw = 500 / toSize;\n \t\n \t\t\tfor (int i = 0; i < fromSize; i++) {\n \t\t\t\tFile current = fromFiles[i];\n \t\n \t\t\t\t// check if this is a new or newer file\n \t\t\t\tboolean copy = true;\n \t\t\t\tif (!current.isDirectory()) {\n \t\t\t\t\tString name = current.getName();\n \t\t\t\t\tlong mod = current.lastModified();\n \t\t\t\t\tfor (int j = 0; j < toSize; j++) {\n \t\t\t\t\t\tif (name.equals(toFiles[j].getName()) && mod <= toFiles[j].lastModified())\n \t\t\t\t\t\t\tcopy = false;\n \t\t\t\t\t}\n \t\t\t\t}\n \t\n \t\t\t\tif (copy) {\n \t\t\t\t\tString fromFile = current.getAbsolutePath();\n \t\t\t\t\tString toFile = to;\n \t\t\t\t\tif (!toFile.endsWith(File.separator))\n \t\t\t\t\t\ttoFile += File.separator;\n \t\t\t\t\ttoFile += current.getName();\n \t\t\t\t\tif (current.isFile()) {\n \t\t\t\t\t\tcopyFile(fromFile, toFile);\n \t\t\t\t\t\tmonitor.worked(dw);\n \t\t\t\t\t} else if (current.isDirectory()) {\n \t\t\t\t\t\tmonitor.subTask(NLS.bind(Messages.copyingTask, new String[] {fromFile, toFile}));\n \t\t\t\t\t\tsmartCopyDirectory(fromFile, toFile, ProgressUtil.getSubMonitorFor(monitor, dw));\n \t\t\t\t\t}\n \t\t\t\t}\n \t\t\t\tif (monitor.isCanceled())\n \t\t\t\t\treturn;\n \t\t\t}\n \t\t\tmonitor.worked(500 - dw * toSize);\n \t\t\tmonitor.done();\n \t\t} catch (Exception e) {\n \t\t\tTrace.trace(Trace.SEVERE, \"Error smart copying directory \" + from + \" - \" + to, e);\n \t\t}\n \t}", "public static void copyPath(Path source, Path target) {\n try {\n Files.copy(source, target);\n if (Files.isDirectory(source)) {\n try (Stream<Path> files = Files.list(source)) {\n files.forEach(p -> copyPath(p, target.resolve(p.getFileName())));\n }\n }\n } catch (IOException e) { e.printStackTrace(); }\n }", "public static void main(String[] args) \r\n\t {\n\t FileInputStream ins = null;\r\n\t FileOutputStream outs = null;\r\n\t \r\n\t try\r\n\t {\r\n\t \t //input file -->abc.txt\r\n\t File infile =new File(\"C:\\\\Users\\\\omsai\\\\Desktop\\\\abc.txt\");\r\n\t \r\n\t //output file -->outfile\r\n\t File outfile =new File(\"C:\\\\Users\\\\omsai\\\\Desktop\\\\copy.txt\");\r\n\t \r\n\t ins = new FileInputStream(infile);\r\n\t outs = new FileOutputStream(outfile);\r\n\t \r\n\t byte[] buffer = new byte[1024];\r\n\t int length;\r\n\t \r\n\t //copy contents of inputfile to output file\r\n\t while ((length = ins.read(buffer)) > 0) {\r\n\t outs.write(buffer, 0, length);\r\n\t } \r\n\t \r\n\t //close input and output files\r\n\t ins.close();\r\n\t outs.close();\r\n\t \r\n\t \r\n\t System.out.println(\"File copied successfully!!\");\r\n\t } \r\n\t \r\n\t catch(IOException ioe) \r\n\t {\r\n\t ioe.printStackTrace();\r\n\t } \r\n\t }", "public static void copyFileOrDirectory(String source, String destination) throws KubernetesPluginException {\n File src = new File(source);\n File dst = new File(destination);\n try {\n // if source is file\n if (Files.isRegularFile(Paths.get(source))) {\n if (Files.isDirectory(dst.toPath())) {\n // if destination is directory\n FileUtils.copyFileToDirectory(src, dst);\n } else {\n // if destination is file\n FileUtils.copyFile(src, dst);\n }\n } else if (Files.isDirectory(Paths.get(source))) {\n FileUtils.copyDirectory(src, dst);\n }\n } catch (IOException e) {\n throw new KubernetesPluginException(\"Error while copying file\", e);\n }\n }", "void moveFile(String pathToFile, String pathDirectory);", "@Test\n public void testCopyFile() throws Exception {\n System.out.println(\"copyFile with existing source image file\");\n String sourcePath = System.getProperty(\"user.dir\")+fSeparator+\"src\"+fSeparator+\"test\"+fSeparator+\n \"java\"+fSeparator+\"resources\"+fSeparator+\"testImg.jpg\";\n File source = new File(sourcePath);\n \n File dest = new File(folder.toString()+fSeparator+\"Images\");\n FilesDao instance = new FilesDao();\n boolean result;\n try{\n instance.copyFile(source, dest);\n File copiedFile = new File(dest+fSeparator+\"testImg.jpg\");\n if(copiedFile.exists())\n result = true;\n else\n result = false;\n }catch(Exception ex){\n result = false;\n }\n boolean expResult = true;\n assertEquals(\"Some message\",expResult,result);\n }", "public static void moveFile(Component parentComponent, String source, String destination)\r\n {\r\n File des = new File(destination);\r\n File src = new File(source);\r\n try(FileOutputStream fout = new FileOutputStream(des); FileInputStream in = new FileInputStream(src))\r\n {\r\n BufferedInputStream bin = new BufferedInputStream(in);\r\n byte[] pic = new byte[(int)src.length()];\r\n bin.read(pic, 0, pic.length - 1);\r\n des.createNewFile();\r\n fout.write(pic, 0, pic.length - 1);\r\n fout.flush();\r\n JOptionPane.showMessageDialog(parentComponent, \"File Successfully Copied!\");\r\n }\r\n catch(IOException xcp)\r\n {\r\n xcp.printStackTrace(System.err);\r\n }\r\n }", "public static long copyFile(File source, File dest) throws IOException {\n\n\t\tif (source.isDirectory() || dest.isDirectory())\n\t\t\tthrow new IOException(\"wont copy directories\");\n\t\tInputStream i = null;\n\t\ttry {\n\t\t\ti = getInputStreamFromFile(source);\n\n\t\t\t// create parent directories\n\t\t\tif (dest.getParentFile().mkdirs()) {\n\t\t\t\t// all good\n\t\t\t} else\n\t\t\t\tthrow new IOException(\"\\\"\" + dest + \"\\\" cannot be created\");\n\t\t\treturn writeStreamToFile(i, dest);\n\n\t\t} finally {\n\t\t\tif (i != null)\n\t\t\t\ti.close();\n\t\t}\n\t}", "final public VFile copyTo(VDir parentDir,String newName) throws VlException\n {\n return (VFile)this.getTransferManager().doCopyMove(this,parentDir,newName,false);\n //return (VFile)doCopyMoveTo(parentDir,newName,false /*,options*/);\n }", "private File copyResources(String srcFileName, File sourceDir, File destinationDir) throws MojoExecutionException {\n File srcFile = new File(sourceDir.getAbsolutePath()+File.separator+srcFileName);\n if (srcFile.exists()) {\n getLog().info(\"Copying \"+srcFile.getName()+\"...\");\n try {\n File destFile = new File(destinationDir.getAbsolutePath()+File.separator+srcFile.getName());\n if (srcFile.isDirectory()) {\n FileUtils.copyDirectory(srcFile, destFile, false);\n } else {\n FileUtils.copyFile(srcFile, destFile, false);\n }\n return destFile;\n } catch (IOException ex) {\n throw new MojoExecutionException(\"Error copying resource '\"+srcFile.getName()+\"'\", ex);\n }\n } else {\n getLog().warn(\"No source file '\"+srcFile.getName()+\"' to copy\");\n return null;\n }\n }", "final public VFile copyToFile(VRL destinationVrl) throws VlException\n {\n return (VFile)this.getTransferManager().doCopyMove(this,destinationVrl,false); \n }", "public static void main(String[] args) {\n\t\ttry {\n\t\t\tcopy(new RandomAccessFile(\"copyfrom.jpg\", \"r\"), new RandomAccessFile(\"copyto.jpg\",\"rw\"));\n\t\t} catch (FileNotFoundException e) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\te.printStackTrace();\n\t\t} catch (IOException e) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\te.printStackTrace();\n\t\t}\n\t}", "private boolean copyFile(FileInputStream srcStream, String filePath) {\n FileChannel srcChannel;\n FileOutputStream destStream;\n Throwable th;\n if (srcStream != null) {\n if (filePath != null) {\n FileOutputStream destStream2 = null;\n FileChannel dstChannel = null;\n FileChannel dstChannel2 = null;\n try {\n destStream2 = new FileOutputStream(createDestFile(filePath));\n FileChannel srcChannel2 = srcStream.getChannel();\n try {\n FileChannel dstChannel3 = destStream2.getChannel();\n try {\n srcChannel2.transferTo(0, srcChannel2.size(), dstChannel3);\n boolean isSuccess = true;\n try {\n srcChannel2.close();\n } catch (IOException e) {\n isSuccess = false;\n Log.e(TAG, \"rcChannel close error, IOException:\");\n }\n try {\n destStream2.close();\n } catch (IOException e2) {\n isSuccess = false;\n Log.e(TAG, \"destStream close error, IOException:\");\n }\n if (dstChannel3 != null) {\n try {\n dstChannel3.close();\n } catch (IOException e3) {\n Log.e(TAG, \"dstChannel close error, IOException:\");\n return false;\n }\n }\n return isSuccess;\n } catch (FileNotFoundException e4) {\n dstChannel2 = dstChannel3;\n dstChannel = srcChannel2;\n boolean isSuccess2 = false;\n Log.e(TAG, \"copyFile FileNotFoundException.\");\n if (dstChannel != null) {\n try {\n dstChannel.close();\n } catch (IOException e5) {\n isSuccess2 = false;\n Log.e(TAG, \"rcChannel close error, IOException:\");\n }\n }\n if (destStream2 != null) {\n try {\n destStream2.close();\n } catch (IOException e6) {\n Log.e(TAG, \"destStream close error, IOException:\");\n isSuccess2 = false;\n }\n }\n if (dstChannel2 == null) {\n return isSuccess2;\n }\n dstChannel2.close();\n return isSuccess2;\n } catch (IOException e7) {\n dstChannel2 = dstChannel3;\n dstChannel = srcChannel2;\n boolean isSuccess3 = false;\n try {\n Log.e(TAG, \"init IO error, IOException:\");\n if (dstChannel != null) {\n try {\n dstChannel.close();\n } catch (IOException e8) {\n isSuccess3 = false;\n Log.e(TAG, \"rcChannel close error, IOException:\");\n }\n }\n if (destStream2 != null) {\n try {\n destStream2.close();\n } catch (IOException e9) {\n Log.e(TAG, \"destStream close error, IOException:\");\n isSuccess3 = false;\n }\n }\n if (dstChannel2 == null) {\n return isSuccess3;\n }\n try {\n dstChannel2.close();\n return isSuccess3;\n } catch (IOException e10) {\n Log.e(TAG, \"dstChannel close error, IOException:\");\n return false;\n }\n } catch (Throwable th2) {\n srcChannel = dstChannel2;\n destStream = destStream2;\n th = th2;\n }\n } catch (Throwable th3) {\n destStream = destStream2;\n th = th3;\n srcChannel = dstChannel3;\n dstChannel = srcChannel2;\n if (dstChannel != null) {\n try {\n dstChannel.close();\n } catch (IOException e11) {\n Log.e(TAG, \"rcChannel close error, IOException:\");\n }\n }\n if (destStream != null) {\n try {\n destStream.close();\n } catch (IOException e12) {\n Log.e(TAG, \"destStream close error, IOException:\");\n }\n }\n if (srcChannel != null) {\n try {\n srcChannel.close();\n } catch (IOException e13) {\n Log.e(TAG, \"dstChannel close error, IOException:\");\n }\n }\n throw th;\n }\n } catch (FileNotFoundException e14) {\n dstChannel = srcChannel2;\n boolean isSuccess22 = false;\n Log.e(TAG, \"copyFile FileNotFoundException.\");\n if (dstChannel != null) {\n }\n if (destStream2 != null) {\n }\n if (dstChannel2 == null) {\n }\n } catch (IOException e15) {\n dstChannel = srcChannel2;\n boolean isSuccess32 = false;\n Log.e(TAG, \"init IO error, IOException:\");\n if (dstChannel != null) {\n }\n if (destStream2 != null) {\n }\n if (dstChannel2 == null) {\n }\n } catch (Throwable th4) {\n dstChannel = srcChannel2;\n srcChannel = null;\n destStream = destStream2;\n th = th4;\n if (dstChannel != null) {\n }\n if (destStream != null) {\n }\n if (srcChannel != null) {\n }\n throw th;\n }\n } catch (FileNotFoundException e16) {\n boolean isSuccess222 = false;\n Log.e(TAG, \"copyFile FileNotFoundException.\");\n if (dstChannel != null) {\n }\n if (destStream2 != null) {\n }\n if (dstChannel2 == null) {\n }\n } catch (IOException e17) {\n boolean isSuccess322 = false;\n Log.e(TAG, \"init IO error, IOException:\");\n if (dstChannel != null) {\n }\n if (destStream2 != null) {\n }\n if (dstChannel2 == null) {\n }\n }\n }\n }\n return false;\n }", "public static void copy(URL src, File dst) throws IOException {\n\n try (InputStream in = src.openStream()) {\n try (OutputStream out = new FileOutputStream(dst)) {\n dst.mkdirs();\n copy(in, out);\n }\n }\n }", "@Override\n\tpublic void transferTo(File dest) throws IOException, IllegalStateException {\n\n\t}", "private void copyInputFile(String originalFilePath, String destinationFilePath) {\n String inputType = ((DataMapperDiagramEditor) workBenchPart.getSite().getWorkbenchWindow().getActivePage()\n .getActiveEditor()).getInputSchemaType();\n\n if (null != originalFilePath && null != destinationFilePath\n && (inputType.equals(\"XML\") || inputType.equals(\"JSON\") || inputType.equals(\"CSV\"))) {\n File originalFile = new File(originalFilePath);\n File copiedFile = new File(destinationFilePath);\n try {\n FileUtils.copyFile(originalFile, copiedFile);\n assert (copiedFile).exists();\n\t\t\t\tassert (Files.readAllLines(originalFile.toPath(), Charset.defaultCharset())\n\t\t\t\t\t\t.equals(Files.readAllLines(copiedFile.toPath(), Charset.defaultCharset())));\n } catch (IOException e) {\n log.error(\"IO error occured while saving the datamapper input file!\", e);\n }\n } else if (null != destinationFilePath) {\n clearContent(new File(destinationFilePath));\n }\n }", "public void transferTo(File dest) throws IOException, IllegalStateException {\r\n mFile.transferTo(dest);\r\n }", "@Test\n public void testCopyFileUsingStream() throws Exception {\n long start = System.nanoTime();\n CopyFile.copyFileUsingStream(sourceFile, streamDestFile);\n System.out.println(\"Time taken by file stream using:\" + (System.nanoTime() - start) / 1000);\n }", "@Test\n public void testCopyFileUsingApacheCommonsIO() throws Exception {\n long start = System.nanoTime();\n CopyFile.copyFileUsingApacheCommonsIO(sourceFile, apacheDestFile);\n System.out.println(\"Time taken by apache using:\" + (System.nanoTime() - start) / 1000);\n }", "public static void copyFiles(File src, File dest) throws IOException {\n if (!src.exists()) {\n throw new IOException(\"copyFiles: Can not find source: \" + src.getAbsolutePath() + \".\");\n } else if (!src.canRead()) { //check to ensure we have rights to the source...\n throw new IOException(\"copyFiles: No right to source: \" + src.getAbsolutePath() + \".\");\n }\n //is this a directory copy?\n if (src.isDirectory()) {\n if (!dest.exists()) { //does the destination already exist?\n //if not we need to make it exist if possible (note this is mkdirs not mkdir)\n if (!dest.mkdirs()) {\n throw new IOException(\"copyFiles: Could not create direcotry: \" + dest.getAbsolutePath() + \".\");\n }\n }\n //get a listing of files...\n String list[] = src.list();\n //copy all the files in the list.\n for (int i = 0; i < list.length; i++) {\n File dest1 = new File(dest, list[i]);\n File src1 = new File(src, list[i]);\n copyFiles(src1, dest1);\n }\n } else {\n //This was not a directory, so lets just copy the file\n try {\n copy(new FileInputStream(src), new FileOutputStream(dest));\n } catch (IOException e) { //Error copying file...\n IOException wrapper = new IOException(\"copyFiles: Unable to copy file: \"\n + src.getAbsolutePath() + \"to\" + dest.getAbsolutePath() + \".\");\n wrapper.initCause(e);\n wrapper.setStackTrace(e.getStackTrace());\n throw wrapper;\n }\n }\n }", "private boolean copyFile(File dest) {\n\t\tboolean result = false;\n\n\t\ttry {\n\t\t\tif (this.exists()) {\n\t\t\t\tif (!dest.exists()) dest.mkdirs();\n\t\t\t\t\n\t\t\t\tif (this.isDirectory() && dest.isDirectory()) {\n\t\t\t\t\tdest = new File(dest.getAbsolutePath().replace(\"\\\\\", \"/\") + \"/\" + this.getName());\n\t\t\t\t\tdest.mkdirs();\n\t\t\t\t\t\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tif (this.isFile() && dest.isDirectory()) {\n\t\t\t\t\tdest = new File(dest.getAbsolutePath().replace(\"\\\\\", \"/\") + \"/\" + this.getName());\n\t\t\t\t\tdest.createNewFile();\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tif (this.isDirectory() && dest.isFile()) {\n\t\t\t\t\tdest = new File(dest.getParent().replace(\"\\\\\", \"/\") + \"/\" + this.getName());\n\t\t\t\t\tdest.mkdirs();\n\t\t\t\t\t\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tif (this.isFile() && dest.isFile()) {\n\t\t\t\t\tif (dest.exists()) {\n\t\t\t\t\t\tdest = new File(dest.getParent().replace(\"\\\\\", \"/\") + \"/\" + this.getName());\n\t\t\t\t\t\tdest.createNewFile();\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\tif (this.getName().equals(dest.getName())) {\n\t\t\t\t\t\t//targetFile.deleteOnExit();\n\t\t\t\t\t\t//targetFile = new File(targetFile.getAbsolutePath());\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tBufferedInputStream inBuff = null;\n\t\t\t\tBufferedOutputStream outBuff = null;\n\t\t\t\t\n\t\t\t\ttry{\n\t\t\t\t\tinBuff = new BufferedInputStream(new FileInputStream(this));\n\t\t\t\t\toutBuff = new BufferedOutputStream(new FileOutputStream(dest));\n\n\t\t\t\t\tbyte[] b = new byte[1024 * 5];\n\t\t\t\t\tint length;\n\t\t\t\t\twhile ((length = inBuff.read(b)) != -1) {\n\t\t\t\t\t\toutBuff.write(b, 0, length);\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\toutBuff.flush();\n\t\t\t\t\t\n\t\t\t\t\tresult = true;\n\t\t\t\t} catch(Exception e) {\n\t\t\t\t\te.printStackTrace();\n\t\t\t\t}finally{\n\t\t\t\t\ttry {\n\t\t\t\t\t\tif (inBuff != null) inBuff.close();\n\t\t\t\t\t\tif (outBuff != null) outBuff.close();\n\t\t\t\t\t} catch (IOException e) {\n\t\t\t\t\t\te.printStackTrace();\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t} catch (IOException e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t\t\n\t\treturn result;\n\t}", "public void copyFile(@NonNull File sourceFile, @NonNull File destFile) throws IOException {\n if (!destFile.getParentFile().exists()) {\n if (!destFile.getParentFile().mkdirs())\n Log.e(ConstantVariables.ERR, ConstantVariables.DIR_NOT_CREATED);\n } else {\n Log.e(ConstantVariables.ERR, ConstantVariables.DIR_ALREADY_EXISTS);\n }\n\n if (!destFile.exists()) {\n if (!destFile.createNewFile())\n Log.e(ConstantVariables.ERR, ConstantVariables.FILE_NOT_CREATED);\n } else\n Log.e(ConstantVariables.ERR, ConstantVariables.FILE_ALREADY_EXISTS);\n\n try (\n FileChannel source = new FileInputStream(sourceFile).getChannel();\n FileChannel destination = new FileOutputStream(destFile).getChannel();\n ) {\n destination.transferFrom(source, 0, source.size());\n }\n }", "public boolean copyFile(final Uri source, final Uri target)\n\t\t\tthrows IOException\n\t{\n\t\tInputStream inStream = null;\n\t\tOutputStream outStream = null;\n\n\t\tUsefulDocumentFile destinationDoc = getDocumentFile(target, false, true);\n\t\tUsefulDocumentFile.FileData destinationData = destinationDoc.getData();\n\t\tif (!destinationData.exists)\n\t\t{\n\t\t\tdestinationDoc.getParentFile().createFile(null, destinationData.name);\n\t\t\t// Note: destinationData is invalidated upon creation of the new file, so make a direct call following\n\t\t}\n\t\tif (!destinationDoc.exists())\n\t\t{\n\t\t\tthrow new WritePermissionException(\n\t\t\t\t\t\"Write permission not found. This indicates a SAF write permission was requested. \" +\n\t\t\t\t\t\"The app should store any parameters necessary to resume write here.\");\n\t\t}\n\n\t\ttry\n\t\t{\n\t\t\tinStream = FileUtil.getInputStream(this, source);\n\t\t\toutStream = getContentResolver().openOutputStream(target);\n\n\t\t\tUtil.copy(inStream, outStream);\n\t\t}\n\t\tcatch(ArithmeticException e)\n\t\t{\n\t\t\tLog.d(TAG, \"File larger than 2GB copied.\");\n\t\t}\n\t\tcatch(Exception e)\n\t\t{\n\t\t\tthrow new IOException(\"Failed to copy \" + source.getPath() + \": \" + e.toString());\n\t\t}\n\t\tfinally\n\t\t{\n\t\t\tUtil.closeSilently(inStream);\n\t\t\tUtil.closeSilently(outStream);\n\t\t}\n\t\treturn true;\n\t}", "public boolean copyTo( final String _dest )\n\t{\n\t\tfinal FileStream destination = GlobalFileSystem.getFile( new File( _dest ).getParent() ) ;\n\t\tif( destination.exists() == false && destination.mkdirs() == false )\n\t\t{\n\t\t\tSystem.out.println( \"Failed to create directories.\" ) ;\n\t\t\treturn false ;\n\t\t}\n\n\t\tfinal FileStream stream = GlobalFileSystem.getFile( _dest ) ;\n\t\tif( stream == null )\n\t\t{\n\t\t\tSystem.out.println( \"Unable to acquire file stream for: \" + _dest ) ;\n\t\t\treturn false ;\n\t\t}\n\n\t\ttry( final ByteInStream in = getByteInStream() ;\n\t\t\t final ByteOutStream out = stream.getByteOutStream() )\n\t\t{\n\t\t\tif( out == null )\n\t\t\t{\n\t\t\t\treturn false ;\n\t\t\t}\n\n\t\t\tint length = 0 ;\n\t\t\tfinal byte[] buffer = new byte[48] ;\n\n\t\t\twhile( ( length = in.readBytes( buffer, 0, buffer.length ) ) > 0 )\n\t\t\t{\n\t\t\t\tout.writeBytes( buffer, 0, length ) ;\n\t\t\t}\n\n\t\t\treturn true ;\n\t\t}\n\t\tcatch( Exception ex )\n\t\t{\n\t\t\treturn false ;\n\t\t}\n\t}", "void moveFile(String sourceName, String destinationName, boolean overwrite) throws IOException;", "@Override\n public void copyBlockdata(URI destination) throws IOException {\n getFileIoProvider().nativeCopyFileUnbuffered(\n getVolume(), getBlockFile(), new File(destination), true);\n }", "public static void copy(File destDir, File file) throws Exception {\r\n \t\tString name = file.getName();\r\n \t\tif (!destDir.exists()) destDir.mkdirs();\r\n \t\tFile oldFile = new File(destDir.getAbsolutePath() + File.separatorChar + name);\r\n \t\tif (oldFile.exists()) oldFile.delete();\r\n\t\tFile fileout = new File(destDir.getAbsolutePath() + File.separatorChar + name);\r\n\t FileInputStream fileinstr = new FileInputStream(file);\r\n\t FileOutputStream fileoutstr = new FileOutputStream(fileout);\r\n\t BufferedOutputStream bufout = new BufferedOutputStream(fileoutstr); \r\n\t byte [] b = new byte[1024];\r\n\t\tint len = 0;\r\n\t\twhile ( (len=fileinstr.read(b))!= -1 ) {\r\n\t\t bufout.write(b,0,len);\r\n\t\t}\r\n\t\tbufout.flush();\r\n\t\tbufout.close();\r\n\t\tfileinstr.close();\r\n\t}", "public void copyFileChannel(String inputFile, String outputFile) throws IOException {\n\t\tFileInputStream inputStream = new FileInputStream(inputFile);\n\t\tFileOutputStream outputStream = new FileOutputStream(outputFile);\n\n\t\tFileChannel inChannel = inputStream.getChannel();\n\t\tFileChannel outChannel = outputStream.getChannel();\n\n\t\tinChannel.transferTo(0, inChannel.size(), outChannel);\n\n\t\tinputStream.close();\n\t\toutputStream.close();\n\t}", "public void copyFileToSafe(String sourceFilename, String targetFilename) {\r\n\t\tfinal String fileContent = readStringFromFileSafe(sourceFilename);\r\n\t\ttry {\r\n\t\t\toverwriteStringToFile(fileContent, targetFilename);\r\n\t\t} catch (FileNotFoundException e) {\r\n\t\t\thandleFileNotFoundException(e, targetFilename);\r\n\t\t} catch (IOException e) {\r\n\t\t\thandleIOException(e, targetFilename);\r\n\t\t}\r\n\t}", "public void execute(Request request, Response response, boolean do_copy) throws IOException, HTTPException {\n\t\t\n\t\tURI uri = request.getUri();\n\t\tIDirectory source_parent = getParent(uri); // Get the parent directory of the source location.\n\t\tString source_base_name = UriUtil.baseName(uri); // Get the name of the location within that directory.\n\t\tString if_header = request.getHeader(HTTP.HEADER_IF); // Get the If header.\n\t\tString lock_token = getLockTokenFromIfHeader(if_header);\n\t\t\n\t\tDiagnostic.trace(\"Source name = \" + source_base_name, Diagnostic.RUN);\n\t\t\n\t\t// Deal with the destination location.\n\t\tString destination_header = request.getHeader(HTTP.HEADER_DESTINATION);\n\t\tif (destination_header == null) throw new HTTPException(\"No destination specified\");\n\t\t\n\t\ttry {\n\t\t\tURI destination_file_path = new URI(destination_header); // Get the file path of the destination location.\n\t\t\tIDirectory destination_parent = getParent(destination_file_path); // Get the parent directory of that location.\n\t\t\tString destination_base_name = UriUtil.baseName(destination_file_path); // Get the name of the location within that directory.\n\t\t\t\n\t\t\t// Should overwrite unless flag explicitly set to false in header.\n\t\t\t// See RFC 2518 8.8.6/7.\n\t\t\tboolean overwrite = shouldOverwrite(request);\n\t\t\t\n\t\t\t// Remember whether destination is non-null, for setting result code.\n\t\t\tboolean destination_not_null = destination_parent.contains(destination_base_name);\n\t\t\t\n\t\t\t// If a lock token was specified in an If header, the file must be currently locked with the given token.\n\t\t\tif (lock_token != null) lock_manager.checkWhetherLockedWithToken(uri, lock_token);\n\t\t\t\n\t\t\t// TODO check if the destination is locked, in which case must have lock token. Ditto for source in case of move.\n\t\t\t\n\t\t\t// Either copy the object or move it.\n\t\t\tif (do_copy) {\n\t\t\t\tfile_system.copyObject(source_parent, source_base_name, destination_parent, destination_base_name, overwrite);\n\t\t\t} else {\n\t\t\t\tfile_system.moveObject(source_parent, source_base_name, destination_parent, destination_base_name, overwrite);\n\t\t\t}\n\t\t\t\n\t\t\tif (destination_not_null) response.setStatusCode(HTTP.RESPONSE_NO_CONTENT);\n\t\t\telse response.setStatusCode(HTTP.RESPONSE_CREATED);\n\t\t\t\n\t\t\tresponse.close();\n\t\t}\n\t\tcatch (LockUseException e) {\n handleLockException(lock_token, e);\n\t\t}\n\t\tcatch (BindingAbsentException e) {\n\t\t\tthrow new HTTPException(\"Source object not found\", HTTP.RESPONSE_NOT_FOUND, true);\n\t\t}\n\t\tcatch (BindingPresentException e) {\n\t\t\tthrow new HTTPException(\"Destination non-null with no-overwrite\", HTTP.RESPONSE_PRECONDITION_FAILED, true);\n\t\t}\n\t\tcatch (PersistenceException e) {\n\t\t\tthrow new HTTPException(\"Couldn't create copy\", HTTP.RESPONSE_INTERNAL_SERVER_ERROR, true);\n\t\t}\n\t\tcatch (URISyntaxException e) {\n\t\t\tthrow new HTTPException(\"Invalid destination path\", HTTP.RESPONSE_BAD_REQUEST, true);\n\t\t}\n\t}", "public void CopySimFile() throws IOException {\n\t\t\n\t\tif(IsOutpathGiven) {\n\t\t\tString name = getSimulationName();\t\n\t\t\tint l = name.length();\n\t\t\tString sim_name = name.substring(0, l-7); // \"_FOLDER\" contains 7 character\n\t\t\tString txtfile = sim_name + \".txt\";\n\t\t\t\n\t\t\tFileSystem fileSys = FileSystems.getDefault();\n\t\t\tjava.nio.file.Path srcPath = fileSys.getPath(inpath + \"\\\\\" + txtfile);\n\t\t\tjava.nio.file.Path destPath = fileSys.getPath(outpath + \"\\\\\" + txtfile);\n\t\t\ttry {\t\t \n\t\t\t Files.copy(srcPath, destPath, StandardCopyOption.REPLACE_EXISTING);\n\t\t\t System.out.println(\"Succesfully Copied the simFile.\");\n\t\t\t \t\t \n\t\t\t } catch (IOException ioe) {\n\t\t\t ioe.printStackTrace();\n\t\t\t }\n\t\t}\n\t\telse {\n\t\t\tSystem.out.println(\"Default simulation location already has the simFile.\");\n\t\t}\n\t\t\t\n\t}" ]
[ "0.768934", "0.7509614", "0.75014025", "0.74984944", "0.74289006", "0.73592585", "0.735723", "0.7223716", "0.72134626", "0.7110795", "0.70647675", "0.70055", "0.6993118", "0.6974994", "0.68959504", "0.686023", "0.68559253", "0.68356717", "0.68333817", "0.6817528", "0.6721393", "0.67135966", "0.6696284", "0.6664467", "0.66265345", "0.6596514", "0.657918", "0.6577313", "0.65552086", "0.6525743", "0.6521609", "0.65172523", "0.64985746", "0.6485878", "0.6473575", "0.64673334", "0.6450268", "0.638939", "0.63802886", "0.6330323", "0.6318039", "0.63126093", "0.6300414", "0.6295548", "0.62901264", "0.6288078", "0.62838733", "0.6254031", "0.62532115", "0.62528265", "0.6248778", "0.62348974", "0.62278855", "0.6205674", "0.61638165", "0.613467", "0.6091973", "0.60834646", "0.60795224", "0.607828", "0.60661256", "0.60373145", "0.60370165", "0.60227466", "0.60146797", "0.6011385", "0.6010574", "0.5998571", "0.599537", "0.59679115", "0.59635675", "0.59596664", "0.5954563", "0.5952566", "0.59522283", "0.5947795", "0.5946695", "0.5937262", "0.5927007", "0.59241766", "0.59136385", "0.5902703", "0.58952624", "0.5883401", "0.58665633", "0.5862442", "0.5844919", "0.58370626", "0.58331037", "0.5825384", "0.58226526", "0.5816315", "0.57901996", "0.57792145", "0.57667845", "0.5756119", "0.57540923", "0.5749006", "0.57455957", "0.5733183" ]
0.6182848
54
method moves a file from one location to other location
public int Move(String sSourcePath, String sDestinationPath, int EXISTING_FILE_ACTION) { int iRetVal = 0; int iCopyCount = 0; int iDeleteCount = 0; try { //check if source & destination path are same. if (sSourcePath.equalsIgnoreCase(sDestinationPath)) { iRetVal = 0; } //copying file for movement iCopyCount = Copy(sSourcePath, sDestinationPath, EXISTING_FILE_ACTION); if (iCopyCount > 0) { iDeleteCount = Delete(sSourcePath); } if (iCopyCount == iDeleteCount) { iRetVal = iCopyCount; } else if (iCopyCount > iDeleteCount) { iRetVal = iDeleteCount; } else if (iCopyCount < iDeleteCount) { iRetVal = iCopyCount; } } catch (Exception exp) { println("move : " + exp.toString()); iRetVal = 0; } finally { return iRetVal; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "void moveFile(String pathToFile, String pathDirectory);", "void moveFile(String sourceName, String destinationName, boolean overwrite) throws IOException;", "void move(Path repoRoot, Path source, Path target);", "public static void main(String[] args){\nFile from = new File(\"d:/prac/shubha.txt\");\r\n//rename and change the file and folder\r\nFile to = new File(\"d:/prac/Sub1/shubha.txt\");\r\n//Rename\r\nif (from.renameTo(to))\r\nSystem.out.println(\"Successfully Moved the file\");\r\nelse\r\nSystem.out.println(\"Error while moving the file\");\r\n}", "public void moveFile(String url) throws IOException {\n\n\t\tSystem.out.println(\"folder_temp : \" + folder_temp);\n\t\tPath Source = Paths.get(folder_temp + url);\n\t\tPath Destination = Paths.get(folder_photo + url);\n\t\tSystem.out.println(\"folder_photo : \" + folder_photo);\n\n\t\tif (Files.exists(Source)) {\n\t\t\t// Files.move(Source, Destination,\n\t\t\t// StandardCopyOption.REPLACE_EXISTING);\n\t\t\t// cpie du fichiet au lieu de deplaacer car il est enn coiurs\n\t\t\t// d'utilisation\n\t\t\tFiles.copy(Source, Destination, StandardCopyOption.REPLACE_EXISTING);\n\t\t}\n\n\t}", "private void moveToFinal(String imageName, String sourceDirectory,\n\t\t\t\tString destinationDirectory) {\n\t\t\t// TODO Auto-generated method stub\n\t\t\ttry {\n\n\t\t\t\tFile afile = new File(sourceDirectory + imageName);\n\t\t\t\tFile bfile = new File(destinationDirectory + imageName);\n\t\t\t\tif (afile.renameTo(bfile)) {\n\t\t\t\t\tSystem.out.println(\"File is moved successful!\");\n\t\t\t\t} else {\n\t\t\t\t\tSystem.out.println(\"File is failed to move!\");\n\t\t\t\t}\n\n\t\t\t} catch (Exception e) {\n\t\t\t\te.printStackTrace();\n\t\t\t}\n\n\t\t}", "public void moveDirectory(String source, String target) throws IOException{\n Path sourceFilePath = Paths.get(PWD.getPath()+\"/\"+source);\n Path targetFilePath = Paths.get(PWD.getPath()+\"/\"+target);\n //using builtin move function which uses Paths\n Files.move(sourceFilePath,targetFilePath);\n }", "public static void moveFile(File source, File destination) throws Exception {\n\tif (destination.exists()) {\n\t destination.delete();\n\t}\n\tsource.renameTo(destination);\n }", "private void moveFilesToDiffDirectory(Path sourcePath, Path destinationPath) {\n try {\n Files.move(sourcePath, destinationPath,\n StandardCopyOption.REPLACE_EXISTING);\n } catch (IOException e) {\n //moving file failed.\n e.printStackTrace();\n }\n }", "static boolean localMove(File source, File target) {\n\t\tif (target.exists())\n\t\t\tif (!target.delete()) {\n\t\t\t\tlogConsole(0, target.getPath() + \" delete failed\", null);\n\t\t\t\treturn false;\n\t\t\t}\n\t\tif (source != null)\n\t\t\tif (!source.renameTo(target)) {\n\t\t\t\tlogConsole(0, target.getPath() + \" rename failed\", null);\n\t\t\t\treturn false;\n\t\t\t}\n\t\treturn true;\n\t}", "public void move(String targetNodeId, String targetPath);", "@Override\r\n\tpublic boolean moveFile(String srcfilePath, String destfilePath) throws FileSystemUtilException {\r\n\t\tlogger.debug(\"Begin: \" + getClass().getName() + \":moveFile()\");\r\n\t\ttry {\r\n\t\t\tconnect(); \r\n\t\t\tString command = \"mv \" + srcfilePath + \" \" + destfilePath;\r\n\t\t\tint results = executeSimpleCommand(command);\r\n\t\t\tdisconnect();\r\n\t\t\tlogger.debug(\"End: \" + getClass().getName() + \":moveFile()\");\r\n\t\t\tif (results == 0) {\r\n\t\t\t\treturn true;\r\n\t\t\t} else {\r\n\t\t\t\treturn false;\r\n\t\t\t}\r\n\r\n\t\t} catch (FileSystemUtilException e) {\r\n\t\t\tdisconnect();\r\n\t\t\tthrow e;\r\n\t\t}\r\n\r\n\t}", "@Test\r\n public void moveToFileWithSameName() {\r\n currentDirectory.addNewFile(\"file\");\r\n Dir dirWithFile = currentDirectory.getSubDirectoryByName(\"child\");\r\n File fileWithContents = dirWithFile.getFileByName(\"file\");\r\n fileWithContents.setContent(\"content\");\r\n command.executeCommand(\"file\", \"child/file\", root, currentDirectory);\r\n File fileInRoot = currentDirectory.getFileByName(\"file\");\r\n // content in file in root is removed\r\n assertTrue(fileInRoot.getContents().equals(\"\"));\r\n }", "@Override\r\n\tpublic void move(String srcAbsPath, String destAbsPath)\r\n\t\t\tthrows ItemExistsException, PathNotFoundException,\r\n\t\t\tVersionException, ConstraintViolationException, LockException,\r\n\t\t\tRepositoryException {\n\t\t\r\n\t}", "public boolean moveFile(final Uri source, final Uri target) throws IOException\n\t{\n\t\tif (FileUtil.isFileScheme(target) && FileUtil.isFileScheme(target))\n\t\t{\n\t\t\tFile from = new File(source.getPath());\n\t\t\tFile to = new File(target.getPath());\n\t\t\treturn moveFile(from, to);\n\t\t}\n\t\telse\n\t\t{\n\t\t\tboolean success = copyFile(source, target);\n\t\t\tif (success) {\n\t\t\t\tsuccess = deleteFile(source);\n\t\t\t}\n\t\t\treturn success;\n\t\t}\n\t}", "final public VFile moveTo(VFile targetFile) throws VlException\n {\n return (VFile)this.getTransferManager().doCopyMove(this,targetFile,true); \n }", "final public VFile moveTo(VDir parentDir,String newName) throws VlException\n {\n return (VFile)this.getTransferManager().doCopyMove(this,parentDir,newName,true); \n //return (VFile)doCopyMoveTo(parentDir, newName,true);\n }", "void moveFileToDirectoryNotValidFiles(String pathToFile);", "void moveFileToDirectoryWithConvertedFiles(String pathToFile);", "private void moveFile(File mp3, String finishDir, String artist, String album){\n\t\tString destinationFolder = finishDir + \"\\\\\" + \"Sorted Music\\\\\" + \n\t\t\t\tartist.substring(0, 1).toUpperCase() + \"\\\\\" + artist;\n\t\tnew File(destinationFolder).mkdir();\n\t\tdestinationFolder += \"\\\\\" + album;\n\t\tnew File(destinationFolder).mkdir();\n\t\t\n\t\tmp3.renameTo(new File(destinationFolder + \"\\\\\" + mp3.getName()));\n\t}", "protected void moveUploadIntoPlace(String fileUpload, String targetPath) {\n\t\tFileSystem fileSystem = Mesh.vertx().fileSystem();\n\t\tfileSystem.moveBlocking(fileUpload, targetPath);\n\t\tif (log.isDebugEnabled()) {\n\t\t\tlog.debug(\"Moved upload file from {\" + fileUpload + \"} to {\" + targetPath + \"}\");\n\t\t}\n\t\t// log.error(\"Failed to move upload file from {\" + fileUpload.uploadedFileName() + \"} to {\" + targetPath + \"}\", error);\n\t}", "@Override\r\n\tpublic void move(String from, String to) {\n\t\t\r\n\t}", "protected void move()\n {\n // Find a location to move to.\n Debug.print(\"Fish \" + toString() + \" attempting to move. \");\n Location nextLoc = nextLocation();\n\n // If the next location is different, move there.\n if ( ! nextLoc.equals(location()) )\n {\n // Move to new location.\n Location oldLoc = location();\n changeLocation(nextLoc);\n\n // Update direction in case fish had to turn to move.\n Direction newDir = environment().getDirection(oldLoc, nextLoc);\n changeDirection(newDir);\n Debug.println(\" Moves to \" + location() + direction());\n }\n else\n Debug.println(\" Does not move.\");\n }", "private void migrate (String name)\t{\n\t\ttry{\n\t\t\tFile f1 = new File( sourceDir + name);\n\t\t\t\n\t\t\tif (!f1.exists())\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tFile f2 = new File(targetDir +name);\n\t\t\t\n\t\t InputStream in = new FileInputStream(f1);\n\t\t \n\t\t OutputStream out = new FileOutputStream(f2);\n\n\t\t byte[] buf = new byte[1024];\n\t\t int len;\n\t\t while ((len = in.read(buf)) > 0){\n\t\t out.write(buf, 0, len);\n\t\t }\n\t\t in.close();\n\t\t out.close();\n\t\t System.out.println(\"File copied.\");\n\t\t }\n\t\t catch(FileNotFoundException ex){\n\t\t System.out.println(ex.getMessage() + \" in the specified directory.\");\n\t\t System.exit(0);\n\t\t }\n\t\t catch(IOException e){\n\t\t System.out.println(e.getMessage()); \n\t\t }\n\t}", "private void copyOrMoveFile(File file, File dir,boolean isCopy) throws IOException {\n File newFile = new File(dir, file.getName());\n FileChannel outChannel = null;\n FileChannel inputChannel = null;\n try {\n outChannel = new FileOutputStream(newFile).getChannel();\n inputChannel = new FileInputStream(file).getChannel();\n inputChannel.transferTo(0, inputChannel.size(), outChannel);\n inputChannel.close();\n if(!isCopy)\n file.delete();\n } finally {\n if (inputChannel != null) inputChannel.close();\n if (outChannel != null) outChannel.close();\n }\n }", "public OutputResponse mv(String oldPath, String newPath){\n String command = String.format(\"mv -b %s %s\", oldPath, newPath); // By default, backup\n return jobTarget.runCommand( command );\n }", "final public VFile moveTo(VDir parentDir) throws VlException\n {\n return (VFile)this.getTransferManager().doCopyMove(this,parentDir,null,true); \n //return (VFile)doCopyMoveTo(parentDir, null,true);\n }", "void relocateLogFile(Path destinationPath) throws IOException;", "private void moveBundle(InputStream in, File newFile) {\n String fileName = newFile.getName();\n try {\n FileOutputStream out = new FileOutputStream(newFile);\n byte[] buffer = new byte[1024];\n int read;\n while ((read = in.read(buffer)) != -1) {\n out.write(buffer, 0, read);\n }\n in.close();\n out.flush();\n out.close();\n Log.i(\"BundleMover\", fileName + \" copied to \" + bundleLocation);\n } catch (Exception e) {\n Log.e(\"BundleMover\", \"ERROR: \" + e.getMessage());\n e.printStackTrace();\n }\n }", "public boolean moveFile(final File source, final File target) throws WritePermissionException\n\t{\n\t\t// First try the normal rename.\n\t\tif (source.renameTo(target)) {\n\t\t\treturn true;\n\t\t}\n\n\t\tboolean success = copyFile(source, target);\n\t\tif (success) {\n\t\t\tsuccess = deleteFile(source);\n\t\t}\n\t\treturn success;\n\t}", "private boolean doSingleFileMove(Path src, Path dst) throws IOException {\n RecoverableWriter writer;\n try {\n writer = fileSystem.createRecoverableWriter();\n } catch (UnsupportedOperationException ignore) {\n // Some writer not support RecoverableWriter, so fallback to per record moving.\n // For example, see the constructor of HadoopRecoverableWriter. Although it not support\n // RecoverableWriter, but HadoopPathBasedBulkFormatBuilder can support streaming\n // writing.\n return false;\n }\n\n RecoverableFsDataOutputStream out = writer.open(dst);\n try (FSDataInputStream in = fileSystem.open(src)) {\n IOUtils.copyBytes(in, out, false);\n } catch (Throwable t) {\n out.close();\n throw t;\n }\n out.closeForCommit().commit();\n return true;\n }", "private void moveShapeDone() {\n System.out.println(\"moving file to \" + BUFFER_DONE_PATH\n + currentFileName);\n File file = new File(BUFFER_ACC_PATH + currentFileName);\n File newFile = new File(BUFFER_DONE_PATH + currentFileName);\n file.renameTo(newFile);\n }", "public static void moveFile(Component parentComponent, String source, String destination)\r\n {\r\n File des = new File(destination);\r\n File src = new File(source);\r\n try(FileOutputStream fout = new FileOutputStream(des); FileInputStream in = new FileInputStream(src))\r\n {\r\n BufferedInputStream bin = new BufferedInputStream(in);\r\n byte[] pic = new byte[(int)src.length()];\r\n bin.read(pic, 0, pic.length - 1);\r\n des.createNewFile();\r\n fout.write(pic, 0, pic.length - 1);\r\n fout.flush();\r\n JOptionPane.showMessageDialog(parentComponent, \"File Successfully Copied!\");\r\n }\r\n catch(IOException xcp)\r\n {\r\n xcp.printStackTrace(System.err);\r\n }\r\n }", "public void copyOne(String from, String to) {\n\t\tFile source = new File(from);\n\t\tif (sourceExists(source)) {\n\t\t\tFile target = new File(to);\n\t\t\ttry{\n\t\t\t\tif(!targetExists(target)){\n\t\t\t\t\tFiles.copy(source.toPath(), target.toPath());\n\t\t\t\t\tSystem.out.println(\"File \" + target.getName()\n\t\t\t\t\t\t\t+ \" COPIED!\");\n\t\t\t\t} else if (target.exists() && confirmReplace()) {\n\t\t\t\t\tFiles.copy(source.toPath(), target.toPath(),\n\t\t\t\t\t\t\tREPLACE_EXISTING);\n\t\t\t\t\tSystem.out.println(\"File \" + target.getName() + \" REPLACED!\");\n\t\t\t\t}else{\n\t\t\t\t\tSystem.out.println(\"File WASN'T copied!\");\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}\n\t}", "@Override\n\tpublic void moveObject(String sourceBucketName, String sourceObjectPath, String destinationBucketName,\n\t\t\tString destinationObjectPath) {\n\t\t\n\t}", "private void copyOrMove(Action action, Path dir) throws IOException {\n\n try {\n if (action == Action.COPY) {\n Path newdir = target.resolve(source.relativize(dir));\n Files.copy(dir, newdir, copyMoveOptions);\n } else if (action == Action.MOVE) {\n Path newdir = target.resolve(source.relativize(dir));\n Files.move(dir, newdir, copyMoveOptions);\n }\n } catch (AtomicMoveNotSupportedException e) {\n // Remove the atomic move from the list and try again\n List<CopyOption> optionsTemp = Arrays.asList(copyMoveOptions);\n optionsTemp.remove(StandardCopyOption.ATOMIC_MOVE);\n copyMoveOptions = optionsTemp.toArray(new CopyOption[optionsTemp.size()]);\n\n copyOrMove(action, dir);\n }\n\n }", "private static void moveFiles(String src, String dest, int Num) // \n\t{\n\t File directoryPath = new File(src);\n\t \n\t // Creating filter for directories files, to select files only\n\t FileFilter fileFilter = new FileFilter(){\n\t public boolean accept(File dir) \n\t { \n\t if (dir.isFile()) \n\t {\n\t return true;\n\t } \n\t else \n\t {\n\t return false;\n\t }\n\t }\n\t }; \n\t \n\t // Get list of files in the source folder\n\t File[] list = directoryPath.listFiles(fileFilter);\n\t \n\t int i = 0;\n\t \n\t // Move Num file to destination folder\n\t while ((i < Num) && (i < list.length))\n\t {\n\t \tString srcFileName = src + \"/\" + list[i].getName();\n\t \tString destFileName = dest + \"/\" + list[i].getName();\n\t \tmoveFile(srcFileName, destFileName);\n\t \ti++;\t \t\n\t } \n\t}", "private static String moveFiles(File origen, Long id, String pref) throws Exception{\n\n String customImgPath = Play.applicationPath.getAbsolutePath()+\"/public/images/custom/\";\n\n String destinationName = origen.getName();\n if(destinationName.lastIndexOf(\".\") != -1 && destinationName.lastIndexOf(\".\") != 0)\n destinationName = \"u\"+id + \"_\"+pref+ Calendar.getInstance().getTimeInMillis() + \".\" +destinationName.substring(destinationName.lastIndexOf(\".\")+1);\n\n File destination = new File(customImgPath, destinationName);\n\n if(destination.exists()){\n destination.delete();\n }\n FileUtils.moveFile(origen, destination);\n\n return destinationName;\n }", "public void transferTo(File dest) throws IOException, IllegalStateException {\r\n mFile.transferTo(dest);\r\n }", "public void objServiceMove(String sourceObjectPathString,\r\n\t\t\tString targetLocPathString, String sourceLocPathString)\r\n\t\t\t\t\tthrows ServiceException {\n\t\tObjectPath objPath = new ObjectPath(sourceObjectPathString);\r\n\t\tObjectIdentity<ObjectPath> docToCopy = new ObjectIdentity<ObjectPath>();\r\n\t\tdocToCopy.setValue(objPath);\r\n\t\tdocToCopy.setRepositoryName(REPOSITORY_NAME);\r\n\r\n\t\t// identify the folder to move from\r\n\t\tObjectPath fromFolderPath = new ObjectPath();\r\n\t\tfromFolderPath.setPath(sourceLocPathString);\r\n\t\tObjectIdentity<ObjectPath> fromFolderIdentity = new ObjectIdentity<ObjectPath>();\r\n\t\tfromFolderIdentity.setValue(fromFolderPath);\r\n\t\tfromFolderIdentity.setRepositoryName(REPOSITORY_NAME);\r\n\t\tObjectLocation fromLocation = new ObjectLocation();\r\n\t\tfromLocation.setObjectIdentity(fromFolderIdentity);\r\n\r\n\t\t// identify the folder to move to\r\n\t\tObjectPath folderPath = new ObjectPath();\r\n\t\tfolderPath.setPath(targetLocPathString);\r\n\t\tObjectIdentity<ObjectPath> toFolderIdentity = new ObjectIdentity<ObjectPath>();\r\n\t\ttoFolderIdentity.setValue(folderPath);\r\n\t\ttoFolderIdentity.setRepositoryName(REPOSITORY_NAME);\r\n\t\tObjectLocation toLocation = new ObjectLocation();\r\n\t\ttoLocation.setObjectIdentity(toFolderIdentity);\r\n\r\n\t\tOperationOptions operationOptions = null;\r\n\t\tthis.objectService.move(new ObjectIdentitySet(docToCopy),\r\n\t\t\t\tfromLocation, toLocation, new DataPackage(), operationOptions);\r\n\r\n\t}", "@Override\n\tpublic void transferTo(File dest) throws IOException, IllegalStateException {\n\n\t}", "public void testMoveFileWithReplace() throws Exception {\n IPackageFragment fragment = getRoot().createPackageFragment(\"org.test\", true, null);\n IPackageFragment otherFragment = getRoot().createPackageFragment(\"org.test1\", true, null);\n IFile file = ((IFolder) fragment.getResource()).getFile(\"x.properties\");\n String content = \"A file with no references\";\n file.create(getStream(content), true, null);\n setReadOnly(file);\n IFile file2 = ((IFolder) otherFragment.getResource()).getFile(\"x.properties\");\n file2.create(getStream(content), true, null);\n setReadOnly(file2);\n IMovePolicy policy = ReorgPolicyFactory.createMovePolicy(new IResource[] { file }, new IJavaElement[] {});\n assertTrue(policy.canEnable());\n JavaMoveProcessor javaMoveProcessor = new JavaMoveProcessor(policy);\n javaMoveProcessor.setDestination(ReorgDestinationFactory.createDestination(otherFragment));\n javaMoveProcessor.setReorgQueries(new MockReorgQueries());\n RefactoringStatus status = performRefactoring(new MoveRefactoring(javaMoveProcessor), true);\n if (status != null)\n assertTrue(status.toString(), status.isOK());\n Collection<IPath> validatedEditPaths = RefactoringTestRepositoryProvider.getValidatedEditPaths(getRoot().getJavaProject().getProject());\n assertEquals(1, validatedEditPaths.size());\n // replaced\n assertTrue(validatedEditPaths.contains(file2.getFullPath()));\n }", "private static void mover(String nombre, String directorio) {\n\t\tFile archivo = new File(nombre);\n\t\tFile dir = new File(directorio);\n\t\tboolean correcto = archivo.renameTo(new File(dir, \n\t\t\t\tarchivo.getName()));\n\t\tif (!correcto) {\n\t\t\tSystem.out.println(\"--> El fichero no se ha podido \" +\n\t\t\t\t\t\"mover\");\n\t\t}\n\t}", "public String moveFileToOtherBucket(AmazonS3 s3Client) {\n s3Client.copyObject(bucket1, key, bucket2, key);\n\n return \"File Moved to Other Bucket\";\n }", "@Override\n\tpublic void domove(String filename) {\n\n\t\tFile starfile = new File(\"D://FileRec/\" + filename);\n\n\t\tFile endDirection = new File(\"D://FileRec//docx\");\n\t\tif (!endDirection.exists()) {\n\t\t\tendDirection.mkdirs();\n\t\t}\n\n\t\tFile endfile = new File(endDirection + File.separator + starfile.getName());\n\n\t\ttry {\n\t\t\tif (starfile.renameTo(endfile)) {\n\t\t\t\tSystem.out.println(\"转移成功\");\n\t\t\t} else {\n\t\t\t\tSystem.out.println(\"转移失败,或许是重名\");\n\t\t\t}\n\t\t} catch (Exception e) {\n\t\t\tSystem.out.println(\"文件移动出现异常\");\n\t\t}\n\t}", "private void moveArquivos(File arquivoOrdem) throws IOException\n\t{\n\t\t/* Busca o nome do diretorio destino definido nas configuracoes */\n\t\tString dirHistorico = getPropriedade(\"ordemVoucher.diretorioHistorico\");\n\t\t\n\t\t/* Move todos os arquivos de caixa da ordem */\n\t\tString arquivosCaixa[] = getNomeArquivosCaixa(arquivoOrdem);\n\t\tfor (int i=0; i < arquivosCaixa.length; i++)\n\t\t{\n\t\t\t/* Cria a referencia para o arquivo origem */\n\t\t\tString dirOrigem = getPropriedade(\"ordemVoucher.dirArquivos\");\n\t\t\tString nomArqOrigem\t= dirOrigem+System.getProperty(\"file.separator\")+arquivosCaixa[i];\n\t\t\tFile arquivoOrigem = new File(nomArqOrigem);\n\t\t\t/* Cria a referencia para o arquivo destino */\n\t\t\tFile arquivoDestino = new File(dirHistorico+System.getProperty(\"file.separator\")+arquivoOrigem.getName());\n\t\t\t/* Move o arquivo origem para destino */\n\t\t\tif (!renomeiaArquivo(arquivoOrigem,arquivoDestino))\n\t\t\t\tSystem.out.println(\"Nao foi possivel mover o arquivo de:\"+arquivoOrigem.getAbsolutePath()+\" para:\"+arquivoDestino.getAbsolutePath());\n\t\t\telse\n\t\t\t\tSystem.out.println(\"Arquivo \"+arquivoOrigem.getName()+\" foi movido para: \"+arquivoDestino.getAbsolutePath());\n\t\t}\n\n\t\t/* Move o arquivo da ordem */\n\t\tFile destino = new File(dirHistorico+System.getProperty(\"file.separator\")+arquivoOrdem.getName());\n\t\tif (!renomeiaArquivo(arquivoOrdem,destino))\n\t\t\tSystem.out.println(\"Nao foi possivel mover o arquivo de:\"+arquivoOrdem.getAbsolutePath()+\" para:\"+destino.getAbsolutePath());\n\t\telse\n\t\t\tSystem.out.println(\"Arquivo \"+arquivoOrdem.getName()+\" foi movido para: \"+destino.getAbsolutePath()); \n\t}", "public static void move(String piece, int startFile, int startRank,\n int endFile, int endRank) {\n setBoardStateSquare(startFile, startRank, \" \");\n setBoardStateSquare(endFile, endRank, piece);\n }", "public void move(String direction);", "public void move(String source, String dest)\n throws ItemExistsException, PathNotFoundException, VersionException, ConstraintViolationException, LockException, RepositoryException {\n if (!(repository.getDataSource() instanceof ExternalDataSource.Writable)) {\n throw new UnsupportedRepositoryOperationException();\n }\n if (source.equals(dest)) {\n return;\n }\n ExternalData oldData = repository.getDataSource().getItemByPath(source);\n ((ExternalDataSource.Writable) repository.getDataSource()).move(source, dest);\n ExternalData newData = repository.getDataSource().getItemByPath(dest);\n if (oldData.getId().equals(newData.getId())) {\n return;\n }\n getRepository()\n .getStoreProvider()\n .getIdentifierMappingService()\n .updateExternalIdentifier(oldData.getId(), newData.getId(), getRepository().getProviderKey(),\n getRepository().getDataSource().isSupportsHierarchicalIdentifiers());\n }", "private static void copyFile(String from, String to)\n\t{\n\t\tFile inputFile;\n\t File outputFile;\n\t\tint fIndex = from.indexOf(\"file:\");\n\t\tint tIndex = to.indexOf(\"file:\");\n\t\tif(fIndex < 0)\n\t\t\tinputFile = new File(from);\n\t\telse\n\t\t\tinputFile = new File(from.substring(fIndex + 5, from.length()));\n\t\tif(tIndex < 0)\n\t\t\toutputFile = new File(to);\n\t\telse\n\t\t\toutputFile = new File(to.substring(tIndex + 5, to.length())); \n\t\tcopyFile(inputFile, outputFile);\t\t\n\t}", "private boolean sourceTableMoveObjTable(HttpServletRequest request,String username,String sourceFolder,String ojbFolder,String fileName,String fileType) throws Exception{\n boolean result=false;\n try {\n String sourcePath=request.getSession().getServletContext().getRealPath(\"/\")+REPOSITORY+\"\\\\\"+username+\"\\\\\"+PERSISTENT+\"\\\\\"+sourceFolder;\n String objPath=request.getSession().getServletContext().getRealPath(\"/\")+REPOSITORY+\"\\\\\"+username+\"\\\\\"+PERSISTENT+\"\\\\\"+ojbFolder;\n System.out.println(sourcePath+\"\\\\\"+fileName+\".\"+fileType);\n System.out.println(objPath+\"\\\\\"+fileName+\".\"+fileType);\n File newFile=new File(objPath,fileName+\".\"+fileType);\n File newFilePath=new File(objPath);\n File oldFile=new File(sourcePath,fileName+\".\"+fileType);\n File oldFilePath=new File(sourcePath);\n if(!newFilePath.exists()){\n throw new Exception(\"目标路径不存在!\");\n }\n if(!oldFilePath.exists()){\n throw new Exception(\"源路径不存在!\");\n }\n if(newFile.exists()){\n throw new Exception(\"文件已经在目标路径中存在了!\");\n }\n if(!oldFile.exists()){\n throw new Exception(\"源表不存在!\");\n }\n //文件从源路径移动到目标路径\n Files.copy(oldFile.toPath(),newFile.toPath());\n oldFile.delete();\n result=true;\n }catch (IOException io){\n io.printStackTrace();\n throw new IOException(\"文件移动失败!\");\n }\n return result;\n }", "public void moveToDestination(Move move) {\r\n\t\tx = move.getToX();\r\n\t\ty = move.getToY();\r\n\r\n\t}", "FileMoveVisitor(Path source, Path target) throws FileMoveException {\n\t\t\n\t\tif (source == null || target == null) {\n\t\t\tthrow new FileMoveException(\"Sourch path and target path cannot be empty\");\n\t\t}\n\t\t\n\t\tthis.source = source;\n\t\tthis.target = target;\n\t}", "public void moveEntry (String oldPath, String newPath) throws IOException\n\t{\n\t\tString alt = prepareLocation (oldPath);\n\t\tString neu = prepareLocation (newPath);\n\t\t\n\t\tArchiveEntry entry = getEntryByLocation (alt);\n\t\tif (entry == null)\n\t\t\tthrow new IOException (\"no such entry in archive\");\n\t\t\n\t\tboolean wasMain = mainEntries.contains (entry);\n\t\tentries.remove (alt);\n\t\t\n\t\tPath neuPath = zipfs.getPath (neu).normalize ();\n\t\tFiles.createDirectories (neuPath.getParent ());\n\t\tFiles.move (zipfs.getPath (alt).normalize (), neuPath,\n\t\t\tStandardCopyOption.ATOMIC_MOVE);\n\t\tArchiveEntry newEntry = new ArchiveEntry (this, neuPath,\n\t\t\tentry.getFormat ());\n\t\t\n\t\tentries.put (neu, newEntry);\n\t\tif (wasMain)\n\t\t{\n\t\t\taddMainEntry (newEntry);\n\t\t}\n\t\t\n\t\t// move meta data\n\t\tList<MetaDataObject> meta = entry.getDescriptions ();\n\t\tfor (MetaDataObject m : meta)\n\t\t{\n\t\t\tnewEntry.addDescription (m);\n\t\t}\n\t\t\n\t}", "public void move(){\n\t\t\n\t}", "private void moveToDestination() throws IOException {\n\t\tfloat x = dataInputStream.readFloat();\n\t\tfloat z = dataInputStream.readFloat();\n\t\t\n\t\tLCD.drawString(\"x: \"+x, 0, onLCDPositionY++);\n\t\tLCD.refresh();\n\t\tLCD.drawString(\"z: \"+z, 0, onLCDPositionY++);\n\t\tLCD.refresh();\n\t\t\n\t\tpose = poseProvider.getPose();\n\t\tPoint destination = new Point(x,z);\n\t\tfloat angle = pose.angleTo(destination);\n\t\t\n\t\t\n\t\tLCD.drawInt((int) pose.getHeading(), 0, onLCDPositionY++);\n\t\t\n\t\t\n\t\tclassPilot.rotate(angle - pose.getHeading());\n\t\tclassPilot.travel(pose.distanceTo(destination));\n\t}", "public static void copyFile(String from, String to) throws IOException{\r\n Path src = Paths.get(from); // set path of source directory from parent function\r\n Path dest = Paths.get(to); // set path of destination directory from parent function\r\n Files.copy(src, dest); //inbuilt function to copy files\r\n \r\n }", "void copyFile(String sourceFile, String destinationFile) throws IOException;", "public static void copyFile(File oldLocation, File newLocation) throws IOException {\n\t\tif (oldLocation.exists()) {\n\t\t\tBufferedInputStream reader = new BufferedInputStream(new FileInputStream(oldLocation));\n\t\t\tBufferedOutputStream writer = new BufferedOutputStream(new FileOutputStream(newLocation, false));\n\t\t\ttry {\n\t\t\t\tbyte[] buff = new byte[8192];\n\t\t\t\tint numChars;\n\t\t\t\twhile ((numChars = reader.read(buff, 0, buff.length)) != -1) {\n\t\t\t\t\twriter.write(buff, 0, numChars);\n\t\t\t\t}\n\t\t\t} catch (IOException ex) {\n\t\t\t\tthrow new IOException(\n\t\t\t\t\t\t\"IOException when transferring \" + oldLocation.getPath() + \" to \" + newLocation.getPath());\n\t\t\t} finally {\n\t\t\t\ttry {\n\t\t\t\t\tif (reader != null) {\n\t\t\t\t\t\twriter.close();\n\t\t\t\t\t\treader.close();\n\t\t\t\t\t}\n\t\t\t\t} catch (IOException ex) {\n\t\t\t\t\tSystem.out.println(\"Error closing files when transferring \" + oldLocation.getPath() + \" to \"\n\t\t\t\t\t\t\t+ newLocation.getPath());\n\t\t\t\t}\n\t\t\t}\n\t\t} else {\n\t\t\tthrow new IOException(\"Old location does not exist when transferring \" + oldLocation.getPath() + \" to \"\n\t\t\t\t\t+ newLocation.getPath());\n\t\t}\n\t}", "protected abstract void moveTo(final float x, final float y);", "public void moveObject(\n String repositoryId,\n String sourceLocation,\n String sourceName,\n String publicType,\n String destinationLocation\n ) throws Exception {\n val treesDao = context.getBean(TreesDao.class, iomConnection);\n val srcTrees = treesDao.getTreesByPath(repositoryId, sourceLocation);\n val dstTrees = treesDao.getTreesByPath(repositoryId, destinationLocation);\n \n if (srcTrees.size() == 0) {\n throw new Exception(\"Source location is not found: \" + sourceLocation);\n }\n if (dstTrees.size() == 0) {\n throw new Exception(\"Destination location is not found: \" + destinationLocation);\n }\n val srcTree = srcTrees.get(0);\n val dstTree = dstTrees.get(0);\n // check if locations match\n if (srcTree.getId().equals(dstTree.getId())) return;\n // check source and destination folder permissions\n val authorizationDao = context.getBean(AuthorizationDao.class, iomConnection);\n if (!authorizationDao.isAuthorized(\"Tree\", srcTree.getId(), AuthorizationDao.PERMISSION_WRITE_MEMBER_METADATA)) {\n throw new Exception(\"Current user is not authorized for changing source folder content\");\n }\n if (!authorizationDao.isAuthorized(\"Tree\", dstTree.getId(), AuthorizationDao.PERMISSION_WRITE_MEMBER_METADATA)) {\n throw new Exception(\"Current user is not authorized for changing destination folder content\");\n }\n\n val srcSearchParams = new SearchParams();\n srcSearchParams.setLocationFolderIds(treesDao.collectTreeIds(srcTrees, false).toArray(new String[0]));\n srcSearchParams.setNameEquals(sourceName);\n srcSearchParams.setPublicTypes(new String[] { publicType });\n\n val searchDao = context.getBean(SearchDao.class, iomConnection);\n val srcObjects = searchDao.getFilteredObjects(repositoryId, srcSearchParams);\n if (srcObjects.size() == 0) {\n throw new Exception(\"Source object with name '\" + sourceName + \"' was not found in location '\" + sourceLocation + \"'\");\n }\n if (srcObjects.size() > 1) {\n throw new Exception(\"More than one object with name '\" + sourceName + \"' was found in location '\" + sourceLocation + \"'\");\n }\n\n String template = \"<MULTIPLE_REQUESTS>%s</MULTIPLE_REQUESTS>\";\n\n String updateTemplate = \"\"\n + \"<UpdateMetadata>\"\n + \" <Metadata>\"\n + \" <Tree Id='%1$s'>\"\n + \" <Members Function='%2$s'>%3$s</Members>\"\n + \" </Tree>\"\n + \" </Metadata>\"\n + \" <NS>SAS</NS>\"\n + \" <Flags>\" + MetadataUtil.OMI_TRUSTED_CLIENT + \"</Flags>\"\n + \" <Options/>\"\n + \"</UpdateMetadata>\"\n ;\n\n String srcObjectXml = srcObjects.get(0).toObjRefXml();\n\n String cutRequest = String.format(updateTemplate, srcTree.getId(), \"Remove\", srcObjectXml);\n String pasteRequest = String.format(updateTemplate, dstTree.getId(), \"Append\", srcObjectXml);\n\n String request = String.format(template, cutRequest + pasteRequest);\n\n IOMI iOMI = iomConnection.getIOMIConnection();\n val outputMeta = new StringHolder();\n int rs = iOMI.DoRequest(request, outputMeta);\n if (rs != 0) {\n throw new Exception(\"DoRequest returned \" + rs + \" instead of 0\");\n }\n }", "public int move(int from, int to) {\n // Gracefully handle items beyond end\n final int size = mItems.size();\n from = constrain(from, 0, size - 1);\n to = constrain(to, 0, size - 1);\n\n final Path item = mItems.remove(from);\n mItems.add(to, item);\n return to;\n }", "public void fileRename(String sourcePath, String targetPath) {\n\t \tFile file = new File(sourcePath); \n\t \tfile.renameTo(new File(targetPath));\n\t \t}", "public void moveCoverageFileToLocalBase() throws IOException {\n\t\tString projectName = DataManager.getProjectVersion();\n\t\tif(projectName.contains(\"_Old\")){\n\t\t\tprojectName = projectName.replace(\"_Old\", \"\");\n\t\t}\n\t\tString origin = ajdtHandler.getFullProjectPath(projectName);\n\t\torigin += slash + \"report\" + slash;\n\t\tString destiny = DataManager.getCurrentPath();\n\t//\tJavaIO.copy(origin, destiny, \"coveragePriorJ.xml\");\n\t\tJavaIO.copyAll(new File(origin), new File(destiny), true);\n\t}", "public void testMove() throws RepositoryException{\n String src = \"src\";\n String dest=\"dest\";\n \n session.move(src, dest);\n sessionControl.replay();\n sfControl.replay();\n \n jt.move(src, dest);\n }", "public abstract void moveTo(double x, double y);", "public static void moveLocalFiles(String sourcePath, String destinationPath) throws Exception {\n\t //Get all csv files from open ar based on filenamefilter\n\t File source = new File(sourcePath);\n\t File destination = new File(destinationPath);\n\t File[] files = source.listFiles(new FilenameFilter(\"csv\"));\n\t if (null != files && files.length > 0) {\n\t\tfor (File file : files) {\n\t\t moveFile(file, new File(destination, file.getName()));\n\t\t}\n\t } else {\n\t }\n }", "void moveDisk(char fromRod, char toRod) {\n Rod fromThisRod = null;\n Rod toThisRod = null;\n for(int i = 0; i < listOfRods.size(); i++){\n if(listOfRods.get(i).getRodName() == fromRod)\n fromThisRod = listOfRods.get(i);\n else if((listOfRods.get(i).getRodName() == toRod))\n toThisRod = listOfRods.get(i);\n }\n try {\n toThisRod.addDisk(fromThisRod.removeTopMostDisk());\n }\n catch(NullPointerException rodIsNull){\n Display.displayWithNextLine(\"Rod you are trying to reach is null!\");\n }\n }", "public void moveTo(int x, int y) {\n\t\tx2 = x;\n\t\ty2 = y;\n\t}", "public String moveFileUp() {\r\n\t\tlog.debug(\"Item file Id::\"+itemObjectId);\r\n\t\t\r\n\t\tIrUser user = userService.getUser(userId, false);\r\n\t\tif( !item.getOwner().equals(user) && !user.hasRole(IrRole.ADMIN_ROLE) && \r\n\t\t\t\t!institutionalCollectionPermissionHelper.isInstitutionalCollectionAdmin(user, genericItemId))\r\n\t\t{\r\n\t\t return \"accessDenied\";\r\n\t\t}\r\n\t\t\r\n\t\tItemObject moveUpItemObject = item.getItemObject(itemObjectId, itemObjectType);\r\n\t\titem.moveItemObject(moveUpItemObject, moveUpItemObject.getOrder() - 1);\r\n\t\t\r\n\t\t// Save the item\r\n\t\titemService.makePersistent(item);\r\n\r\n\t\treturn SUCCESS;\r\n\t\t\r\n\t}", "private static void copyFile(File in, File out)\n\t{\n\t\ttry\n\t\t{\n\t\t\tFileChannel inChannel = new\tFileInputStream(in).getChannel();\n\t\t\tFileChannel outChannel = new FileOutputStream(out).getChannel();\n\t\t\tinChannel.transferTo(0, inChannel.size(), outChannel);\n\t\t\tinChannel.close();\n\t\t\toutChannel.close();\t\t\t\n\t\t} catch (Exception e)\n\t\t{\n\t\t\tDebug.e(\"RFO.copyFile(): \" + e);\n\t\t}\n\n\t}", "public boolean moveToFinalLocation() {\n\n if (tempFile==null)\n return false;\n\n if (RecDir==null || RecSubdir==null) {\n Log.getInstance().write(Log.LOGLEVEL_ERROR, \"RecordingEpisode.moveToFinalLocation: null Dir or SubDir = \" + RecDir + \":\" + RecSubdir);\n\n if (!tempFile.delete()) {\n Log.getInstance().write(Log.LOGLEVEL_WARN, \"RecordingEpisode.moveToFinalLocation: Failed to delete tempFile.\");\n }\n\n return false;\n }\n\n File DestPath = new File(RecDir + File.separator + RecSubdir);\n\n if (DestPath==null) {\n Log.getInstance().write(Log.LOGLEVEL_ERROR, \"RecordingEpisode.moveToFinalLocation: null DestPath = \" + RecDir + \":\" + RecSubdir);\n\n if (!tempFile.delete()) {\n Log.getInstance().write(Log.LOGLEVEL_WARN, \"RecordingEpisode.moveToFinalLocation: Failed to delete tempFile.\");\n }\n\n return false;\n }\n\n if (!DestPath.isDirectory()) {\n if (!DestPath.mkdir()) {\n Log.getInstance().write(Log.LOGLEVEL_ERROR, \"RecordingEpisode.moveToFinalLocation: Could not create directory \" + DestPath);\n\n if (!tempFile.delete()) {\n Log.getInstance().write(Log.LOGLEVEL_ERROR, \"RecordingEpisode.moveToFinalLocation: Failed to delete tempFile.\");\n }\n return false;\n }\n }\n\n NewFile = this.getUniqueFile();\n\n if (NewFile==null) {\n Log.getInstance().write(Log.LOGLEVEL_ERROR, \"RecordingEpisode.moveToFinalLocation: Could not create unique file.\");\n\n if (!tempFile.delete()) {\n Log.getInstance().write(Log.LOGLEVEL_WARN, \"RecordingEpisode.moveToFinalLocation: Failed to delete tempFile.\");\n }\n\n return false;\n }\n\n Log.getInstance().write(Log.LOGLEVEL_TRACE, \"RecordingEpisode.moveToFinalLocation: Moving = \" + tempFile.getAbsolutePath() + \"->\" + NewFile.getAbsolutePath());\n\n if (!tempFile.renameTo(NewFile)) {\n Log.getInstance().write(Log.LOGLEVEL_ERROR, \"RecordingEpisode.moveToFinalLocation: Moving failed.\");\n }\n\n if (!tempFile.delete()) {\n Log.getInstance().write(Log.LOGLEVEL_WARN, \"RecordingEpisode.moveToFinalLocation: Failed to delete tempFile.\");\n }\n\n return true;\n }", "public void moveTo(double x, double y)\n {\n\t_closedPath = false;\n\tPoint2D pos = transformedPoint(x,y);\n\t_startx = pos.getX();\n\t_starty = pos.getY();\n\t_currentx = pos.getX();\n\t_currenty = pos.getY();\n\t_currentPath.clear();\n }", "public void copy(String name, String oldPath, String newPath);", "public boolean move(String dest) {\n\t\treturn this.move(new File(dest));\n\t}", "public void moveTo(Folder targetFolder) {\n if (targetFolder != this.parent) {\n Path sourcePath = this.toPath();\n this.parent.getValue().remove(this);\n String newName = this.newName(targetFolder);\n\n Path targetPath = new File(targetFolder.getPath() + File.separator + newName).toPath();\n\n try {\n Files.move(sourcePath, targetPath);\n } catch (IOException e) {\n }\n\n this.name = newName;\n targetFolder.addImage(this);\n }\n }", "public void moveCard(int pileId, int pos, int destPileId) {\n \t\tCard c = mTable.get(pileId).takeCard(pos);\n \t\tif (c != null) {\n \t\t\tmTable.get(destPileId).addCard(c);\n \t\t\tsendUpdatedState();\n \t\t}\n \t}", "public void move() {\n process(2);\n }", "public void move();", "public void move();", "public void moveBinaryFile(InternalActionContext ac, String uuid, String segmentedPath) {\n\t\tMeshUploadOptions uploadOptions = Mesh.mesh().getOptions().getUploadOptions();\n\t\tFile uploadFolder = new File(uploadOptions.getDirectory(), segmentedPath);\n\t\tFile targetFile = new File(uploadFolder, uuid + \".bin\");\n\t\tString targetPath = targetFile.getAbsolutePath();\n\n\t\tcheckUploadFolderExists(uploadFolder);\n\t\tdeletePotentialUpload(targetPath);\n\t\tmoveUploadIntoPlace(ac.get(\"sourceFile\"), targetPath);\n\t\t// Since this function can be called multiple times (if a transaction fails), we have to\n\t\t// update the path so that moving the file works again.\n\t\tac.put(\"sourceFile\", targetPath);\n\t}", "public void move() {\n\r\n\t}", "public void move(String direction) {\n \n }", "private void moveShapeDenied() {\n System.out.println(\"moving file to \" + BUFFER_DENIED_PATH\n + currentFileName);\n File file = new File(BUFFER_ACC_PATH + currentFileName);\n File newFile = new File(BUFFER_DENIED_PATH + currentFileName);\n file.renameTo(newFile);\n }", "public boolean moveTo(Object target);", "void copyFile(String sourceFile, String destinationFile, boolean overwrite) throws IOException;", "private void copyFile( final File source, final File target )\n throws MojoExecutionException\n {\n if ( source.exists() == false )\n {\n throw new MojoExecutionException( \"Source file '\" + source.getAbsolutePath() + \"' does not exist!\" );\n }\n if ( target.exists() == true )\n {\n throw new MojoExecutionException( \"Target file '\" + source.getAbsolutePath() + \"' already existing!\" );\n }\n\n try\n {\n this.logger.debug( \"Copying file from '\" + source.getAbsolutePath() + \"' to \" + \"'\"\n + target.getAbsolutePath() + \"'.\" );\n PtFileUtil.copyFile( source, target );\n }\n catch ( PtException e )\n {\n throw new MojoExecutionException( \"Could not copy file from '\" + source.getAbsolutePath() + \"' to \" + \"'\"\n + target.getAbsolutePath() + \"'!\", e );\n }\n }", "public boolean moveUnit(Position from, Position to);", "public void movePiece(Coordinate from, Coordinate to);", "void move(Board b, Square target, int[] position, String imagepath);", "public static boolean moveFileToWorkDir(FileInfo fileInfo) {\n\t\tboolean skip = true;\n\t\tPath source = Paths.get(fileInfo.getOrgPath());\n\t\tMessages.sprintf(\"DEBUG1: \" + source);\n\n\t\tif (!Files.exists(source) && !Files.exists(Paths.get(fileInfo.getWorkDir()))\n\t\t|| Main.getProcessCancelled()) {\n\t\t\tMain.setProcessCancelled(true);\n\t\t\treturn false;\n\t\t}\n\t\tif(fileInfo.getDestination_Path().isBlank() || fileInfo.getDestination_Path().isEmpty()) {\n\t\t\tMessages.warningText(\"Destination path is not definied\");\n\t\t\treturn false;\n\t\t}\n\n\t\tPath dest = FileUtils.getFileNameDate(fileInfo, fileInfo.getWorkDir());\n\n\t\tif (!Files.exists(dest.getParent())) {\n\t\t\ttry {\n\t\t\t\tFiles.createDirectories(dest.getParent());\n\t\t\t} catch (Exception e) {\n\t\t\t\te.printStackTrace();\n\t\t\t\tMessages.sprintfError(\"Can't create directories: \" + dest.getParent());\n\t\t\t\tMessages.errorSmth(ERROR, \"Can't create directories\", e, Misc.getLineNumber(), true);\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\t\ttry {\n\t\t\tif (Files.exists(dest) && Files.size(dest) != Files.size(source)) {\n\t\t\t\ttry {\n\t\t\t\t\tPath dest_temp = FileUtils.renameFile(source, dest);\n\t\t\t\t\tif (dest_temp != null && !Files.exists(dest_temp)) {\n\t\t\t\t\t\tdest = dest_temp;\n\t\t\t\t\t\tskip = false;\n\t\t\t\t\t} else {\n\t\t\t\t\t\tskip = true;\n\t\t\t\t\t}\n\t\t\t\t} catch (IOException e) {\n\t\t\t\t\te.printStackTrace();\n\t\t\t\t\tMain.setProcessCancelled(true);\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tskip = false;\n\t\t\t\tMessages.sprintf(\"DST: \" + dest + \" source: \" + source + \" size: \" + Files.size(source));\n\t\t\t}\n\t\t} catch (IOException e1) {\n\t\t\te1.printStackTrace();\n\t\t\treturn false;\n\t\t}\n\n\t\tif (!skip) {\n\t\t\tif (source != null && dest != null)\n\t\t\t\ttry {\n\t\t\t\t\tPath target = Files.move(source, dest);\n\t\t\t\t\tMessages.sprintf(\"Source dest: \" + source + \" TARGET: \" + target);\n\t\t\t\t} catch (IOException e) {\n\t\t\t\t\te.printStackTrace();\n\t\t\t\t\tMain.setProcessCancelled(true);\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t}", "public void connect(File file, long position, long size) throws FileNotFoundException;", "void moveFolder(Long sourceId, Long targetFolderId, List<SolutionParam> solutions);", "void copyFile(File sourcefile, File targetfile) throws Exception {\n\t\tif(targetfile.exists()) targetfile.delete();\n\t\ttargetfile.createNewFile();\n\t\tFileChannel source = null;\n\t\tFileChannel target = null;\n\t\ttry{\n\t\t\tsource = new FileInputStream(sourcefile).getChannel();\n\t\t\ttarget = new FileOutputStream(targetfile).getChannel();\n\t\t\ttarget.transferFrom(source, 0, source.size());\n\t\t}\n\t\tfinally{\n\t\t\tif(source!=null) source.close();\n\t\t\tif(target!=null) target.close();\n\t\t}\n\t\ttargetfile.setLastModified(sourcefile.lastModified());\n\t}", "public void copy(){\n\t\tFileInputStream is = null;\n\t\tFileOutputStream os = null;\n\t\ttry {\n\t\t\tis = new FileInputStream(source);\n\t\t\tos = new FileOutputStream(dest);\n\t\t\tif(dest.exists())\n\t\t\t\tdest.delete();\n\t\t\tint i = -1;\n\t\t\twhile((i = is.read()) != -1)\n\t\t\t\tos.write(i);\n\t\t\tsource.deleteOnExit();\n\t\t} catch (IOException e) {\n\t\t\tJOptionPane.showMessageDialog(null, e);\n\t\t} finally {\n\t\t\tif(is != null)\n\t\t\t\ttry {\n\t\t\t\t\tis.close();\n\t\t\t\t} catch (IOException ignored) {}\n\t\t\tif(os != null)\n\t\t\t\ttry {\n\t\t\t\t\tos.close();\n\t\t\t\t} catch (IOException e) {\n\t\t\t\t\tJOptionPane.showMessageDialog(null, e);\n\t\t\t\t}\n\t\t}\n\t}", "private void move() {\n System.out.println(\"current dir= \" + head.dir);\n addToHead();\n deleteFromTail();\n }", "int move(int pileSize) ;", "protected void moveToDestination(){\n\t\tqueue.clear();\n\t\twhile (destination[0] < 0){\n\t\t\tqueue.add(\"MOVE S\");\n\t\t\tdestination[0] += 1;\n\t\t}\n\t\twhile (destination[0] > 0){\n\t\t\tqueue.add(\"MOVE N\");\n\t\t\tdestination[0] -= 1;\n\t\t}\n\t\twhile (destination[1] < 0){\n\t\t\tqueue.add(\"MOVE E\");\n\t\t\tdestination[1] += 1;\n\t\t}\n\t\twhile (destination[1] > 0){\n\t\t\tqueue.add(\"MOVE W\");\n\t\t\tdestination[1] -= 1;\n\t\t}\n\t\tdestination = null;\n\t}", "public static void moveFile(File toMove, File target) throws IOException {\n\n\t\tif (toMove.renameTo(target))\n\t\t\treturn;\n\n\t\tif (toMove.isDirectory()) {\n\t\t\ttarget.mkdirs();\n\t\t\tcopyRecursively(toMove, target);\n\t\t\tdeleteRecursively(toMove);\n\t\t} else {\n\t\t\tcopyFile(toMove, target);\n\t\t\tdeleteFile(toMove);\n\t\t}\n\t}", "@Test\n public void testMoveFolder() {\n System.out.println(\"moveFolder\");\n String folderToMove = \"\";\n String destinationFolder = \"\";\n FileSystemStorage instance = null;\n instance.moveFolder(folderToMove, destinationFolder);\n // TODO review the generated test code and remove the default call to fail.\n fail(\"The test case is a prototype.\");\n }" ]
[ "0.7839009", "0.7024468", "0.6842362", "0.67757", "0.67627406", "0.672159", "0.6603478", "0.6538548", "0.6396593", "0.63799673", "0.6372421", "0.630987", "0.62827754", "0.62509054", "0.6212487", "0.62085253", "0.6194852", "0.61936414", "0.6186201", "0.6155985", "0.61506945", "0.61361974", "0.612745", "0.61184317", "0.60460955", "0.602408", "0.60160387", "0.60059637", "0.5996929", "0.59907526", "0.59853977", "0.59532315", "0.5943567", "0.59155786", "0.58953303", "0.5868969", "0.5857498", "0.584098", "0.57940674", "0.57914865", "0.57784903", "0.5776832", "0.5752589", "0.5739227", "0.5718273", "0.571609", "0.57114476", "0.5704762", "0.5700355", "0.5696367", "0.5691379", "0.56596154", "0.5632647", "0.5619729", "0.56124026", "0.5601036", "0.56006116", "0.5576571", "0.5571959", "0.55445457", "0.5544245", "0.5536061", "0.5530774", "0.55307597", "0.55296314", "0.55266064", "0.5524806", "0.5524312", "0.5522108", "0.55187625", "0.55163044", "0.5507726", "0.54971296", "0.54961133", "0.54937875", "0.54843134", "0.54778206", "0.5475437", "0.5462411", "0.5462411", "0.5461468", "0.5459863", "0.54471177", "0.54408747", "0.54284346", "0.54281557", "0.5420789", "0.5420745", "0.54190534", "0.54176605", "0.54131466", "0.54067194", "0.5405255", "0.5402959", "0.54021686", "0.53952026", "0.5389034", "0.5381176", "0.5380086", "0.53784853" ]
0.6025278
25
method to delete file or folder
public int Delete(String sTargetPath) throws Exception { File ftarget = null; int iRetVal = 0; try { ftarget = new File(sTargetPath); if (ftarget.isDirectory()) { File[] fsubtargets = ftarget.listFiles(); for (int i = 0; i < fsubtargets.length; i++) { iRetVal = iRetVal + Delete(sTargetPath + File.separator + fsubtargets[i].getName()); } ftarget.delete();; } else { ftarget.delete(); } return iRetVal; } catch (Exception e) { throw e; } finally { ftarget = null; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "void deleteFile(FsPath path);", "public void deleteFile(File f);", "@Override\n public void delete(File file) {\n }", "public File delete(File f) throws FileDAOException;", "public void delete_File(){\n context.deleteFile(Constant.FILE_NAME);\n }", "void deleteFile(FileReference fileReferece);", "void fileDeleted(String path);", "public void delete() throws Exception {\n\n getConnection().do_Delete(new URL(getConnection().getFilemanagerfolderendpoint() + \"/\" + getId()),\n getConnection().getApikey());\n }", "boolean deleteFile(File f);", "public boolean delete(String filename);", "private void deleteFile() {\n\t\tFile dir = getFilesDir();\n\t\tFile file = new File(dir, FILENAME);\n\t\tfile.delete();\n\t}", "protected synchronized void delete()\n {\n if (this.file.exists())\n {\n this.file.delete();\n }\n }", "public static void delete(File file) throws IOException {\n String method = \"delete() - \";\n if ((file != null) && (file.exists())) {\n if (file.isDirectory()) {\n if (file.list().length == 0) {\n file.delete();\n }\n else {\n String files[] = file.list();\n for (String current : files) {\n File fileToDelete = new File(file, current);\n delete(fileToDelete);\n if (file.list().length == 0) {\n file.delete();\n }\n }\n }\n }\n else {\n file.delete();\n }\n }\n else {\n throw new IOException(method \n + \"The input file is null or does not exist.\");\n }\n }", "@Override\n\tpublic boolean delete() {\n\t\tboolean result = false;\n\t\ttry{\n\t\t\tif (this.exists()) {\n\t\t\t\tif (this.isDirectory()) {\n\t\t\t\t\tif (this.listFiles() != null) {\n\t\t\t\t\t\tfor (java.io.File file : this.listFiles()) {\n\t\t\t\t\t\t\tif (file.isDirectory()) ((File) file).delete();\n\t\t\t\t\t\t\telse if (file.isFile()) super.delete();\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\tsuper.delete();\n\t\t\t\t} else if (this.isFile()) super.delete();\n\t\t\t}\n\t\t\t\n\t\t\tresult = true;\n\t\t} catch(Exception e) {\n\t\t\te.printStackTrace();\n\t\t}\n\n\t\treturn result;\n\t}", "private void deleteFile() {\r\n actionDelete(dataModelArrayList.get(position));\r\n }", "@RequestMapping(value=\"/my_files\", method = RequestMethod.DELETE)\n @ResponseBody\n public AppResponse delete(@RequestParam String path) throws IOException, InvalidValueException,FilePathAccessDeniedException {\n\n String username = CSQLUserContext.getCurrentUser().getUsername();\n if(validator.isValidAndUserHasAccess(username, path)){\n return fileSystemService.delete(path, true);\n }\n\n return AppResponse.error();\n }", "public static void main(String[] args){\nFile filez = new File(\"d:/prac/sub1\");\r\ndeleteFolder(filez);\r\n}", "@Override\r\n\tpublic int fileDelete(int no) {\n\t\treturn sqlSession.delete(namespace + \"fileDelete\", no);\r\n\t}", "abstract public void remove( String path )\r\n throws Exception;", "public boolean delete(String path, boolean recurse) throws SystemException;", "@Override\n\tpublic void delete()\n\t{\n\t\tcachedContent = null;\n\t\tFile outputFile = getStoreLocation();\n\t\tif ((outputFile != null) && outputFile.exists())\n\t\t{\n\t\t\tif (Files.remove(outputFile) == false)\n\t\t\t{\n\t\t\t\tlog.error(\"failed to delete file: \" + outputFile.getAbsolutePath());\n\t\t\t}\n\t\t}\n\t}", "@Override\n public void delete(String id) {\n log.debug(\"Request to delete File : {}\", id);\n fileRepository.delete(id);\n }", "public boolean deleteFile(String inKey) throws NuxeoException;", "private void deleteFileOrFolder(File fileOrFolder) {\n if (fileOrFolder != null) {\n if (fileOrFolder.isDirectory()) {\n for (File item : fileOrFolder.listFiles()) {\n deleteFileOrFolder(item);\n }\n }\n if (!fileOrFolder.delete()) {\n fileOrFolder.deleteOnExit();\n }\n }\n }", "public void deleteData(String filename, SaveType type);", "public int deleteFile(String datastore, String filename) throws HyperVException;", "public boolean delete()\n\t{\n\t\treturn deleteRecursive( file ) ;\n\t}", "public void delete();", "public void delete();", "public void delete();", "public void delete();", "public void delete();", "public void delete();", "public boolean delete();", "public void deleteFile() {\n\t\tif (JOptionPane.showConfirmDialog(desktopPane,\n\t\t\t\t\"Are you sure? this action is permanent!\") != JOptionPane.YES_OPTION)\n\t\t\treturn;\n\n\t\tEllowFile file = null;\n\t\tTreePath paths[] = getSelectionModel().getSelectionPaths();\n\t\tif (paths == null)\n\t\t\treturn;\n\t\tfor (TreePath path : paths) {\n\t\t\tDefaultMutableTreeNode node = (DefaultMutableTreeNode) path\n\t\t\t\t\t.getLastPathComponent();\n\t\t\tfile = (EllowFile) node.getUserObject();\n\t\t\tEllowynProject project = file.parentProject;\n\t\t\tfile.deleteAll();\n\t\t\tif (!file.isProjectFile && project != null)\n\t\t\t\tproject.rebuild(); // don't rebuild the project if the project\n\t\t\t\t\t\t\t\t\t// itself is deleted\n\t\t\tdesktopPane.closeFrames(file);\n\t\t\tmodel.removeNodeFromParent(node);\n\t\t}\n\t}", "private void deleteImage(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {\n\t\tint id= Integer.parseInt(request.getParameter(\"fileId\"));\n\t\tFiles file= new FilesDAO().view(id);\n\t\t//Logic to delete the file from the database\n\t\t\n\t\tnew FilesDAO().delete(id);\n\t\t\n\t\t\n\t\t//Logic to delete file from the file system\n\t\t\n\t\tFile fileOnDisk= new File(path+file.getFileName());\n\t\tif(fileOnDisk.delete()) {\n\t\t\tSystem.out.println(\"File deleted from the folder\");\n\t\t}\n\t\telse {\n\t\t\tSystem.out.println(\"Sorr! file couldn't get deleted from the folder\");\n\t\t}\n\t\tlistingPage(request, response);\n\t}", "@Override\r\n\tpublic void deleteFileData(Long id) {\n\t\t\r\n\t}", "private static void deleteFileOrDir(File file)\n {\n if (file.isDirectory())\n {\n File[] childs = file.listFiles();\n for (int i = 0;i < childs.length;i++)\n {\n deleteFileOrDir(childs[i]);\n }\n }\n file.delete();\n }", "public static void deleteFile()\n\t{\n\t\t//Variable Declaration\n\t\tString fileName;\n\t\tScanner obj = new Scanner(System.in);\n\t\t\n\t\t//Read file name from user\n\t\tSystem.out.println(\"Enter file name to delete:\");\n\t\tfileName= obj.nextLine();\n\t\t\n\t\t//Deleting the file\n\t\tboolean isDeleted = FileManager.deleteFile(folderpath, fileName);\n\t\t\n\t\tif(isDeleted)\n\t\t\tSystem.out.println(\"File deleted successfully\");\n\t\telse\n\t\t\tSystem.out.println(\"File not found! Enter valid file name.\");\n\t}", "public void delete() throws IOException {\n\t\tclose();\n\t\tdeleteContents(directory);\n\t}", "@Override\r\n public void deleteFolder(long id) {\n this.folderRepository.deleteById(id);; \r\n }", "private static void deleteFile(String fileName) {\n\t\tFile f = new File(fileName);\n\n\t\t// Make sure the file or directory exists and isn't write protected\n\t\tif (!f.exists())\n\t\t\treturn;\n\t\t// throw new IllegalArgumentException(\"Delete: no such file or directory: \" + fileName);\n\n\t\tif (!f.canWrite())\n\t\t\tthrow new IllegalArgumentException(\"Delete: write protected: \"\n\t\t\t\t\t+ fileName);\n\n\t\t// If it is a directory, make sure it is empty\n\t\tif (f.isDirectory()) {\n\t\t\tString[] files = f.list();\n\t\t\tif (files.length > 0)\n\t\t\t\tthrow new IllegalArgumentException(\n\t\t\t\t\t\t\"Delete: directory not empty: \" + fileName);\n\t\t}\n\n\t\t// Attempt to delete it\n\t\tboolean success = f.delete();\n\n\t\tif (!success)\n\t\t\tthrow new IllegalArgumentException(\"Delete: deletion failed\");\n\t}", "public void delete(String so_cd);", "public void delete() throws AlreadyDeletedException{\r\n\tif (this.isDeleted() == false) {\r\n\t\tDirectory ref = this.getDir();\r\n \tref.remove(this);\r\n \tthis.setDelete(true);\t\r\n \tthis.setModificationTime();\r\n\t}\r\n\telse {\r\n\t\tthrow new AlreadyDeletedException(this);\t\r\n\t\t\r\n\t}\r\n}", "alluxio.proto.journal.File.DeleteFileEntry getDeleteFile();", "@AfterClass(groups ={\"All\"})\n\tpublic void deleteFolder() {\n\t\ttry {\n\t\t\tUserAccount account = dciFunctions.getUserAccount(suiteData);\n\t\t\tUniversalApi universalApi = dciFunctions.getUniversalApi(suiteData, account);\n\t\t\tif(suiteData.getSaasApp().equalsIgnoreCase(\"Salesforce\")){\n\t\t\t\tfor(String id:uploadId){\n\t\t\t\t\tMap<String,String> fileInfo = new HashMap<String,String> ();\n\t\t\t\t\tfileInfo.put(\"fileId\", id);\n\t\t\t\t\tdciFunctions.deleteFile(universalApi, suiteData, fileInfo);\n\t\t\t\t}\n\t\t\t}else{\n\t\t\t\tdciFunctions.deleteFolder(universalApi, suiteData, folderInfo);\n\t\t\t}\n\t\t} catch (Exception ex) {\n\t\t\tLogger.info(\"Issue with Delete Folder Operation \" + ex.getLocalizedMessage());\n\t\t}\n\t}", "@Test\n public void testDeleteFolder() {\n System.out.println(\"deleteFolder\");\n String folder = \"\";\n FileSystemStorage instance = null;\n instance.deleteFolderAndAllContents(folder);\n // TODO review the generated test code and remove the default call to fail.\n fail(\"The test case is a prototype.\");\n }", "public void delete(){\r\n\r\n }", "private void deleteFile(java.io.File file) {\n if (file.isDirectory()) {\n for (java.io.File f : file.listFiles()) \n deleteFile(f);\n }\n \n if (!file.delete())\n try {\n throw new FileNotFoundException(\"Failed to delete file: \" + file.getName());\n } catch (FileNotFoundException e) {\n System.err.println(\"Delete of file \" + file.getAbsolutePath() + \" failed\");\n e.printStackTrace();\n }\n }", "public void deleteFile(long id)\r\n \t{\r\n \t\tif (this.logger!= null) \r\n \t\t\tlogger.debug(\"calling deleteFile(\"+id+\") was called...\");\r\n \t\t\r\n \t\tExtFileObjectDAO extFileDao= externalFileMgrDao.getExtFileObj(id);\r\n \t\tString fileSrc= this.externalDataFolder + \"/\"+ extFileDao.getBranch() + \"/\"+ extFileDao.getFileName();\r\n \t\tFile dFile= new File(fileSrc);\r\n \t\tif (!dFile.delete())\r\n \t\t\tthrow new ExternalFileMgrException(ERR_DELETE + fileSrc);\r\n \t\texternalFileMgrDao.deleteExtFileObj(id);\r\n \t}", "protected abstract boolean deleteCheckedFiles();", "public static void delete(File file) {\n\n\t\tif (file.isDirectory()) {\n\n\t\t\t// directory is empty, then delete it\n\t\t\tif (file.list().length == 0) {\n\n\t\t\t\tfile.delete();\n\t\t\t\t// System.out.println(\"Directory is deleted : \" +\n\t\t\t\t// file.getAbsolutePath());\n\n\t\t\t} else {\n\n\t\t\t\t// list all the directory contents\n\t\t\t\tString files[] = file.list();\n\n\t\t\t\tfor (String temp : files) {\n\t\t\t\t\t// construct the file structure\n\t\t\t\t\tFile fileDelete = new File(file, temp);\n\n\t\t\t\t\t// recursive delete\n\t\t\t\t\tdelete(fileDelete);\n\t\t\t\t}\n\n\t\t\t\t// check the directory again, if empty then delete it\n\t\t\t\tif (file.list().length == 0) {\n\t\t\t\t\tfile.delete();\n\t\t\t\t\t// System.out.println(\"Directory is deleted : \" +\n\t\t\t\t\t// file.getAbsolutePath());\n\t\t\t\t}\n\t\t\t}\n\n\t\t} else {\n\t\t\t// if file, then delete it\n\t\t\tfile.delete();\n\t\t\t// System.out.println(\"File is deleted : \" +\n\t\t\t// file.getAbsolutePath());\n\t\t}\n\t}", "private void delete(File file) {\n if (file.isDirectory()) {\n cleanDirectory(file);\n }\n file.delete();\n }", "void folderDeleted(String remoteFolder);", "public static void deleteFolder(String path){\n List<CMSFile> files = CMSFile.find(\"name like '\" + path + \"%'\").fetch();\n for (CMSFile file: files){\n if (file.data != null && file.data.exists()) {\n file.data.getFile().delete();\n }\n file.delete();\n }\n }", "public static void delete(File f) {\n delete_(f, false);\n }", "boolean delete();", "public abstract void delete();", "public abstract void delete();", "@Override\r\n\tpublic void remFile(String path) {\n\t\t\r\n\t}", "public void doDelete(HttpServletRequest req, HttpServletResponse resp, String filepath) throws IOException {\n\t\tStorage storage = StorageOptions.getDefaultInstance().getService();\n\t storage.delete(BUCKET, filepath);\n\t}", "public static native boolean remove(String path) throws IOException;", "void delete(InformationResourceFile file);", "public static void deleteFolder(File folder) {\r\nFile[] files = folder.listFiles();\r\nif(files!=null) { //some JVMs return null for empty dirs\r\nfor(File f: files) {\r\nif(f.isDirectory()) {\r\ndeleteFolder(f);\r\n} else {\r\nf.delete();\r\n}\r\n}\r\n}\r\nfolder.delete();\r\n}", "private void deleteResource() {\n }", "@Override\n\tpublic void fileDelete(int file_num) {\n\t\tworkMapper.fileDelete(file_num);\n\t}", "public void delete() {\n\n }", "boolean hasDeleteFile();", "public void deleteFile(int id) {\n\t\tString sql = \"delete from file where file_id=\"+id;\n\t\tthis.getJdbcTemplate().update(sql);\n\t}", "public static void delete(File d) {\n\t\tif (d.isDirectory()) {\n\t\t\tfor (File f: d.listFiles()) delete(f);\n\t\t\td.delete();\n\t\t} else d.delete();\n\t}", "public void delete() {\n if (tempFile != null) {\n tempFile.delete();\n }\n }", "public static void delete(String source) {\n Path directory = Paths.get(source);\n try {\n Files.walkFileTree(directory, new SimpleFileVisitor<Path>() {\n @Override\n public FileVisitResult visitFile(final Path file, final BasicFileAttributes attrs)\n throws IOException {\n Files.delete(file);\n return CONTINUE;\n }\n\n @Override\n public FileVisitResult visitFileFailed(final Path file, final IOException e) {\n return handleException(e);\n }\n\n private FileVisitResult handleException(final IOException e) {\n e.printStackTrace(); // replace with more robust error handling\n return TERMINATE;\n }\n\n @Override\n public FileVisitResult postVisitDirectory(final Path dir, final IOException e)\n throws IOException {\n if (e != null) {\n return handleException(e);\n }\n Files.delete(dir);\n return CONTINUE;\n }\n });\n } catch (IOException ex) {\n Logger.getLogger(FolderManager.class.getName()).log(Level.SEVERE, null, ex);\n delete(source);\n }\n }", "public abstract void delete() throws ArchEException;", "public void deleteFile(IAttachment file)\n throws OculusException;", "@Override\r\n\tpublic void qnaFileDelete(int qnaFileIdx) {\n\t\t\r\n\t}", "public static void deleteFile(File file){\r\n if(file.isFile()){\r\n file.delete();\r\n return;\r\n }\r\n if(file.isDirectory()){\r\n File[] childFile = file.listFiles();\r\n if(childFile == null || childFile.length == 0){\r\n file.delete();\r\n return;\r\n }\r\n for(File f : childFile){\r\n deleteFile(f);\r\n }\r\n file.delete();\r\n }\r\n }", "@Override\n\tpublic void delete(File file) {\n\t\tthis.getSession().delete(file);\n\t}", "public void deleteImgFromDirectory1(String fileName) {\n File f = new File(fileName);\r\n\r\n // Mi assicuro che il file esista\r\n if (!f.exists()) {\r\n throw new IllegalArgumentException(\"Il File o la Directory non esiste: \" + fileName);\r\n }\r\n\r\n // Mi assicuro che il file sia scrivibile\r\n if (!f.canWrite()) {\r\n throw new IllegalArgumentException(\"Non ho il permesso di scrittura: \" + fileName);\r\n }\r\n\r\n // Se è una cartella verifico che sia vuota\r\n if (f.isDirectory()) {\r\n String[] files = f.list();\r\n if (files.length > 0) {\r\n throw new IllegalArgumentException(\"La Directory non è vuota: \" + fileName);\r\n }\r\n }\r\n\r\n // Profo a cancellare\r\n boolean success = f.delete();\r\n\r\n // Se si è verificato un errore...\r\n if (!success) {\r\n throw new IllegalArgumentException(\"Cancellazione fallita\");\r\n }\r\n }", "public void delete() {\n\n\t}", "void deleteDirectory(String path, boolean recursive) throws IOException;", "public int remove(String pathname) throws YAPI_Exception\n {\n byte[] json = new byte[0];\n String res;\n json = sendCommand(String.format(Locale.US, \"del&f=%s\",pathname));\n res = _json_get_key(json, \"res\");\n //noinspection DoubleNegation\n if (!(res.equals(\"ok\"))) { throw new YAPI_Exception( YAPI.IO_ERROR, \"unable to remove file\");}\n return YAPI.SUCCESS;\n }", "void deleteCoverDirectory() {\n\n try {\n\n Log.i(\"Deleting Covr Directory\", cover_directory.toString());\n FileUtils.deleteDirectory(cover_directory);\n } catch (IOException e) {\n\n }\n\n }", "@Override\r\n public void onClick(View view) {\n deleteFile();\r\n deleteDialog.dismiss();\r\n }", "@Override\r\n\tpublic ServerResponse2 deleteById(Integer id) {\n\t\tint flag = folderMapper.deleteById(id,0);\r\n\t\tif(flag>0) {\r\n\t\t\treturn ServerResponse2.createBySuccess();\r\n\t\t}else {\r\n\t\t\treturn ServerResponse2.createByError();\r\n\t\t}\r\n\t}", "private void delete() {\n\n\t}", "protected abstract void doDelete();", "public void deleteFile(String filePath){\n File myFile = new File(filePath);\n if (myFile.exists()) {\n myFile.delete();\n System.out.println(\"File successfully deleted.\");\n } else {\n System.out.println(\"File does not exists\");\n }\n }", "private void recDelete(File file) {\n if (!file.exists()) {\n return;\n }\n if (file.isDirectory()) {\n File[] list = file.listFiles();\n if (list != null) {\n for (File f : list) {\n recDelete(f);\n }\n }\n }\n file.delete();\n }", "void delete(LogicalDatastoreType store, P path);", "int deleteByPrimaryKey(Integer fileId);", "public void delete() {\n\t\tclose();\n\t\t// delete the files of the container\n\t\tfor (int i=0; i<BlockFileContainer.getNumberOfFiles(); i++)\n\t\t\tfso.deleteFile(prefix+EXTENSIONS[i]);\n\t}", "public String do_rmdir(String pathOnServer) throws RemoteException {\r\n\t\tString directoryPath = pathOnServer;\r\n\t\tString message;\r\n\t\t\r\n\t\t\tFile dir = new File(directoryPath);\r\n\t\t\tif (!dir.isDirectory()) {\r\n\t\t\t\tmessage = \"Invalid directory\";\t}\t\r\n\t\t\telse {\r\n\t\t\t\t\r\n\t\t\tif(dir.list().length>0) {\r\n\r\n\t\t\tFile[] filesList = dir.listFiles();\r\n\t\t\t//Deleting Directory Content\r\n\t\t\tfor(File file : filesList){\r\n\t\t\t\tSystem.out.println(\"Deleting \"+file.getName());\r\n\t\t\t\tfile.delete();\r\n\t\t\t}}\r\n\t\t\tif (dir.delete()) message =\"Successfully deleted the Directory: \" + directoryPath ;\r\n\t\t\telse message =\"Error deleting the directory: \" + directoryPath ;\r\n\t\t\t}//else end \r\n\t\treturn message;\r\n\t}", "boolean removeDocument(String path);", "public DeleteTResponse remove(String path, boolean recursive, DeleteTOptions options) throws alluxio.thrift.AlluxioTException, org.apache.thrift.TException;", "@PreAuthorize(\"hasPermission(#file, 'delete')\")\n public void delete(File file) {\n fileRepository.delete(file);\n }", "public void delete_file(String file_name) throws Exception{\n\t\tFile file = new File(file_name);\n\t\tif (file.exists() && file.isFile()) file.delete();\n\t\telse if(file.isDirectory()){\n\t\t\tfor(File f : file.listFiles()){\n\t\t\t\tdelete_file(f.getAbsolutePath());\n\t\t\t}\n\t\t\tfile.delete();\n\t\t}\n\t}", "private void delete(String name) {\n File f = new File(name);\n if (f.exists()) {\n f.delete();\n }\n }", "@PreAuthorize(\"hasRole('ROLE_ROOT')\")\n\tpublic void deleteFileUploads();", "public void delete() {\r\n Log.d(LOG_TAG, \"delete()\");\r\n for (int i = 0; i < mNumSegments; i++) {\r\n File chunk = new File(getFileNameForIndex(i));\r\n if (chunk.delete()) {\r\n Log.d(LOG_TAG, \"Deleted file \" + chunk.getAbsolutePath());\r\n }\r\n }\r\n new File(mBaseFileName + \".zip\").delete();\r\n }", "int deleteByExample(AvwFileprocessExample example);", "public void delete(String path) throws IOException {\n Path destionationPath = new Path(path);\n\n if (!hdfs.exists(destionationPath)) {\n throw new IOException(\"File/directory doesn't exists!\");\n }\n hdfs.delete(destionationPath, true);\n }" ]
[ "0.79961836", "0.7981843", "0.742981", "0.7385635", "0.7371089", "0.7363688", "0.72884446", "0.72842765", "0.7282068", "0.7192046", "0.71865976", "0.71690595", "0.7079669", "0.7070663", "0.7068429", "0.70496064", "0.7006267", "0.6913713", "0.689668", "0.6895886", "0.6884393", "0.68832403", "0.68107784", "0.6801949", "0.6794965", "0.67855084", "0.67545843", "0.6754221", "0.6754221", "0.6754221", "0.6754221", "0.6754221", "0.6754221", "0.6736374", "0.669708", "0.6696799", "0.6691832", "0.6683216", "0.66721237", "0.6664155", "0.6659721", "0.66551644", "0.66525733", "0.6576268", "0.6560866", "0.6553672", "0.6553363", "0.653976", "0.65391296", "0.65390384", "0.6538427", "0.6521101", "0.64980114", "0.64712644", "0.6442034", "0.64364016", "0.6429415", "0.64252883", "0.64252883", "0.6419011", "0.640973", "0.6399049", "0.6397116", "0.6393726", "0.63921434", "0.6389575", "0.63881934", "0.63732773", "0.636323", "0.63619393", "0.6352609", "0.6344812", "0.6328971", "0.6322143", "0.6314532", "0.63125616", "0.6306443", "0.62990844", "0.6296348", "0.62960035", "0.6280406", "0.6271059", "0.6266848", "0.62645125", "0.6263356", "0.6259911", "0.62577486", "0.62575173", "0.6252931", "0.6252213", "0.62454337", "0.6240303", "0.6238997", "0.6238831", "0.6234462", "0.62339884", "0.6233767", "0.62237", "0.62150544", "0.62148035", "0.6193709" ]
0.0
-1
method to read INI file (WINDOWS format)
public String ReadINI(String Section, String Key, String FilePath) { String sValue = ""; int iRetVal = -2; String[] FileLines = null; String sTemp = ""; boolean bKeyFound = false; boolean bSectionFound = false; int i = 0; int counter = 0; try { FileLines = ReadAllFileLines(FilePath); for (i = 0; i < FileLines.length; i++) { sTemp = FileLines[i].trim(); if (sTemp.charAt(0) == '[' && sTemp.charAt(sTemp.length() - 1) == ']') { if (sTemp.substring(1, sTemp.length() - 1).equalsIgnoreCase(Section)) { bSectionFound = true; counter = i + 1; while (!bKeyFound) { } } } if (bKeyFound) { break; } } if (!bKeyFound) { throw new Exception(" : Section :" + Section + " : key : " + Key + " :Not found"); } } catch (Exception exp) { iRetVal = -2; } return sValue; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public ReadConfigFile (){\n\t\ttry {\n\t\t\tinput = ReadConfigFile.class.getClassLoader().getResourceAsStream(Constant.CONFIG_PROPERTIES_DIRECTORY);\n\t\t\tprop = new Properties();\n\t\t\tprop.load(input);\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t}catch ( IOException e ) {\n\t\t\te.printStackTrace();\n\t\t}\n\t\t\t\t\n\t}", "public void readConfigFile() throws IOException {\r\n Wini iniFileParser = new Wini(new File(configFile));\r\n\r\n databaseDialect = iniFileParser.get(DATABASESECTION, \"dialect\", String.class);\r\n databaseDriver = iniFileParser.get(DATABASESECTION, \"driver\", String.class);\r\n databaseUrl = iniFileParser.get(DATABASESECTION, \"url\", String.class);\r\n databaseUser = iniFileParser.get(DATABASESECTION, \"user\", String.class);\r\n databaseUserPassword = iniFileParser.get(DATABASESECTION, \"userPassword\", String.class);\r\n\r\n repositoryName = iniFileParser.get(REPOSITORYSECTION, \"name\", String.class);\r\n\r\n partitions = iniFileParser.get(DEFAULTSECTION, \"partitions\", Integer.class);\r\n logFilename = iniFileParser.get(DEFAULTSECTION, \"logFilename\", String.class);\r\n logLevel = iniFileParser.get(DEFAULTSECTION, \"logLevel\", String.class);\r\n\r\n maxNGramSize = iniFileParser.get(FEATURESSECTION, \"maxNGramSize\", Integer.class);\r\n maxNGramFieldSize = iniFileParser.get(FEATURESSECTION, \"maxNGramFieldSize\", Integer.class);\r\n String featureGroupsString = iniFileParser.get(FEATURESSECTION, \"featureGroups\", String.class);\r\n\r\n if ( databaseDialect == null )\r\n throw new IOException(\"Database dialect not found in config\");\r\n if ( databaseDriver == null )\r\n throw new IOException(\"Database driver not found in config\");\r\n if ( databaseUrl == null )\r\n throw new IOException(\"Database URL not found in config\");\r\n if ( databaseUser == null )\r\n throw new IOException(\"Database user not found in config\");\r\n if ( databaseUserPassword == null )\r\n throw new IOException(\"Database user password not found in config\");\r\n\r\n if (repositoryName == null)\r\n throw new IOException(\"Repository name not found in config\");\r\n\r\n if (partitions == null)\r\n partitions = 250;\r\n if ( logFilename == null )\r\n logFilename = \"FeatureExtractor.log\";\r\n if ( logLevel == null )\r\n logLevel = \"INFO\";\r\n\r\n if ( featureGroupsString != null ) {\r\n featureGroups = Arrays.asList(featureGroupsString.split(\"\\\\s*,\\\\s*\"));\r\n }\r\n if (maxNGramSize == null)\r\n maxNGramSize = 5;\r\n if (maxNGramFieldSize == null)\r\n maxNGramFieldSize = 500;\r\n\r\n }", "private void parseINI() throws IOException{\n // If the labtainersPath not set in the main.ini file, set it to the System environmenta variable LABTAINER_DIR \n labtainerPath = pathProperties.getProperty(\"labtainerPath\");\n if(labtainerPath == null || labtainerPath.isEmpty()){\n System.out.println(\"No labtainer path set yet\");\n labtainerPath = System.getenv(\"LABTAINER_DIR\");\n FileOutputStream out = new FileOutputStream(iniFile);\n writeValueToINI(out, \"labtainerPath\", System.getenv(\"LABTAINER_DIR\"));\n }\n else{\n labtainerPath.trim();\n }\n\n // If textEditorPref is empty, set it to 'vi' and write to the main.ini file\n textEditorPref = pathProperties.getProperty(\"textEditor\");\n if(textEditorPref == null || textEditorPref.isEmpty()){\n textEditorPref = \"vi\";\n FileOutputStream out = new FileOutputStream(iniFile);\n writeValueToINI(out, \"textEditor\", textEditorPref);\n }\n else{\n textEditorPref.trim();\n }\n\n updateLabtainersPath();\n\n // If a lab has been loaded before then load that lab\n String iniPrevLab = pathProperties.getProperty(\"prevLab\");\n if(iniPrevLab != null && !iniPrevLab.isEmpty()){\n File prevLab = new File(iniPrevLab);\n if(prevLab.isDirectory())\n openLab(prevLab);\n }\n }", "private static void readConfigFile() {\n\n BufferedReader input = null;\n try {\n input = new BufferedReader(new FileReader(getConfigFile()));\n String sLine = null;\n while ((sLine = input.readLine()) != null) {\n final String[] sTokens = sLine.split(\"=\");\n if (sTokens.length == 2) {\n m_Settings.put(sTokens[0], sTokens[1]);\n }\n }\n }\n catch (final FileNotFoundException e) {\n }\n catch (final IOException e) {\n }\n finally {\n try {\n if (input != null) {\n input.close();\n }\n }\n catch (final IOException e) {\n Sextante.addErrorToLog(e);\n }\n }\n\n }", "public static void parseIni() {\r\n\t\t//Find the indexes of the division headers.\r\n\t\tint namesIndex = findIndex(\"[names]\");\r\n\t\tint defaultIndex = findIndex(\"[defaults]\");\r\n\t\tint soundIndex = findIndex(\"[sounds]\");\r\n\t\t\r\n\t\t//Extract the information from the ini Array List.\r\n\t\tnames = extractSettings(namesIndex);\r\n\t\tdefaults = extractSettings(defaultIndex);\r\n\t\tsounds = extractSettings(soundIndex);\r\n\r\n\t\t//Sort the names Array List and copy it to the main names Array List.\r\n\t\tCollections.sort(names);\r\n\t\tMain.names = names;\r\n\t\t\r\n\t\t//Set the sounds to their variables.\r\n\t\tsetSounds();\r\n\t\t\r\n\t\t//Set the default game configurations.\r\n\t\tsetDefaults();\r\n\r\n\t}", "private void loadConfig()\n {\n File config = new File(\"config.ini\");\n\n if (config.exists())\n {\n try\n {\n BufferedReader in = new BufferedReader(new FileReader(config));\n\n configLine = Integer.parseInt(in.readLine());\n configString = in.readLine();\n socketSelect = (in.readLine()).split(\",\");\n in.close();\n }\n catch (Exception e)\n {\n System.exit(1);\n }\n }\n else\n {\n System.exit(1);\n }\n }", "public void loadConfig(){\r\n File config = new File(\"config.ini\");\r\n if(config.exists()){\r\n try {\r\n Scanner confRead = new Scanner(config);\r\n \r\n while(confRead.hasNextLine()){\r\n String line = confRead.nextLine();\r\n if(line.indexOf('=')>0){\r\n String setting,value;\r\n setting = line.substring(0,line.indexOf('='));\r\n value = line.substring(line.indexOf('=')+1,line.length());\r\n \r\n //Perform the actual parameter check here\r\n if(setting.equals(\"romfile\")){\r\n boolean result;\r\n result = hc11_Helpers.loadBinary(new File(value.substring(value.indexOf(',')+1,value.length())),board,\r\n Integer.parseInt(value.substring(0,value.indexOf(',')),16));\r\n if(result)\r\n System.out.println(\"Loaded a rom file.\");\r\n else\r\n System.out.println(\"Error loading rom file.\");\r\n }\r\n }\r\n }\r\n confRead.close();\r\n } catch (FileNotFoundException ex) {\r\n ex.printStackTrace();\r\n }\r\n }\r\n }", "public int getIni() {\r\n return ini;\r\n }", "public String getIniLocation() {\n return iniLocation;\n }", "public String readConfiguration(String path);", "public static void main(String[] args) throws FileNotFoundException {\n\r\n\t\r\n\t\tProperties property = new Properties();\r\n\t\t\r\n\t\tFileInputStream input=new FileInputStream(\"C:\\\\Users\\\\MY PC\\\\Desktop\\\\java\\\\SeleniumJava\\\\src\\\\Config\\\\Config.properties.exe\");\r\n\t\tproperty.load(input);\r\n\t\tSystem.out.println(property.getProperty(\"browser\"));\r\n\t\tSystem.out.println(property.getProperty(\"url\"));\r\n\t\t\r\n\t\t\r\n\t\r\n\t}", "private static void readCommonInfoConfigFile() {\n\t\t// reading from common.cfg\n\t\ttry {\n\n\t\t\tScanner commonInfoScanner = new Scanner(new FileReader(commonInfoFile));\n\t\t\twhile (commonInfoScanner.hasNextLine()) {\n\t\t\t\tString commonInfoLine = commonInfoScanner.nextLine();\n\t\t\t\tString[] commonInfoLineSplitBySpaceArray = commonInfoLine.split(\"[ ]+\");\n\t\t\t\tswitch (commonInfoLineSplitBySpaceArray[0]) {\n\t\t\t\tcase ConfigurationSetup.FILE_NAME:\n\t\t\t\t\tfileName = commonInfoLineSplitBySpaceArray[1];\n\t\t\t\t\tbreak;\n\t\t\t\tcase ConfigurationSetup.FILE_SIZE:\n\t\t\t\t\tfileSize = Integer.parseInt(commonInfoLineSplitBySpaceArray[1]);\n\t\t\t\t\tbreak;\n\t\t\t\tcase ConfigurationSetup.NUMBER_OF_PREFERRED_NEIGHBORS_K:\n\t\t\t\t\tnumberOfPreferredNeighbors = Integer.parseInt(commonInfoLineSplitBySpaceArray[1]);\n\t\t\t\t\tbreak;\n\t\t\t\tcase ConfigurationSetup.OPTIMISTIC_UNCHOKING_INTERVAL_M:\n\t\t\t\t\toptimisticUnchokingInterval = Integer.parseInt(commonInfoLineSplitBySpaceArray[1]);\n\t\t\t\t\tbreak;\n\t\t\t\tcase ConfigurationSetup.PIECE_SIZE:\n\t\t\t\t\tpieceSize = Integer.parseInt(commonInfoLineSplitBySpaceArray[1]);\n\t\t\t\t\tbreak;\n\t\t\t\tcase ConfigurationSetup.UNCHOKING_INTERVAL_P:\n\t\t\t\t\tunchokingInterval = Integer.parseInt(commonInfoLineSplitBySpaceArray[1]);\n\t\t\t\t\tbreak;\n\t\t\t\tdefault:\n\t\t\t\t\tSystem.err.println(\"\\nError in reading Common.cfg. Illegal parameter encountered.\\n\");\n\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tnumberOfPieces = (int) Math.ceil((float) fileSize / pieceSize);\n\n\t\t\tcommonInfoScanner.close();\n\n\t\t} catch (Exception e) { // FileNotFoundException\n\t\t\t// TODO Auto-generated catch block\n\t\t\te.printStackTrace();\n\t\t}\n\t}", "@Nullable\n private static Map<Integer, String> readNwsoSubCenter(String path) {\n Map<Integer, String> result = new HashMap<>();\n\n try (InputStream is = GribResourceReader.getInputStream(path);\n BufferedReader br = new BufferedReader(new InputStreamReader(is, StandardCharsets.UTF_8))) {\n while (true) {\n String line = br.readLine();\n if (line == null) {\n break;\n }\n if ((line.isEmpty()) || line.startsWith(\"#\")) {\n continue;\n }\n\n StringBuilder lineb = new StringBuilder(line);\n StringUtil2.removeAll(lineb, \"'+,/\");\n String[] flds = lineb.toString().split(\"[:]\");\n\n int val = Integer.parseInt(flds[0].trim()); // must have a number\n String name = flds[1].trim() + \": \" + flds[2].trim();\n\n result.put(val, name);\n }\n return Collections.unmodifiableMap(result); // all at once - thread safe\n\n } catch (IOException ioError) {\n logger.warn(\"An error occurred in Grib1Tables while trying to open the table \" + path + \" : \" + ioError);\n return null;\n }\n }", "private static int getConfigFromFile(){\n\t\tint ret = -1;\n\t\ttry(BufferedReader r = new BufferedReader(new FileReader(\"./configFile\"))){\n\t\t\tTCPIP = new String(r.readLine().split(\":\")[1]);\n\t\t\tTCPSERVERPORT = Integer.parseInt((r.readLine().split(\":\")[1]));\n\t\t\tMCPORT = Integer.parseInt((r.readLine().split(\":\")[1]));\n\t\t\tMCIP = new String(r.readLine().split(\":\")[1]);\n\t\t\tRMISERVERPORT = Integer.parseInt((r.readLine().split(\":\")[1]));\n\t\t\tret = 0;\n\t\t} catch (FileNotFoundException e) {\n\t\t\tSystem.out.println(\"Config file not found. Please put it in the execution directory then restart.\");\n\t\t} catch(NumberFormatException e){\n\t\t\tSystem.out.println(\"Config file has an unsupported format. Please check it and restart.\");\n\t\t} catch (IOException e) {\n\t\t\tSystem.out.println(\"Some error occurred while reading from config file: \"+e.getMessage()+\"\\nPlease restart.\");\n\t\t}\n\t\treturn ret;\n\t}", "private void loadWiperConfig(String mSubPath,boolean bQuiet)\n {\n FileReader mWiperConfigReader;\n\n // Environment.getRootDirectory() = /system\".\n final File mFileName = new File(Environment.getRootDirectory(), mSubPath);\n try\n {\n mWiperConfigReader = new FileReader(mFileName);\n }\n catch (FileNotFoundException e)\n {\n if (!bQuiet)\n {\n Log.e(TAG, \"wiperconfig file read/open error \" + mFileName);\n }\n bWiperConfigReadError = true;\n return;\n }\n\n try\n {\n XmlPullParser mParser = Xml.newPullParser();\n mParser.setInput(mWiperConfigReader);\n\n XmlUtils.beginDocument(mParser, \"wiperconfig\");\n\n while (true)\n {\n XmlUtils.nextElement(mParser);\n\n String szName = mParser.getName();\n if (!\"configparam\".equals(szName))\n {\n break;\n }\n\n szUsername = mParser.getAttributeValue(null, \"username\");\n szRealm = mParser.getAttributeValue(null, \"realm\");\n\n String szHighFreqPeriodMs = mParser.getAttributeValue(null, \"highFreqPeriodMs\");\n lHighFreqPeriodMs = Long.parseLong(szHighFreqPeriodMs);\n\n String szLowFreqPeriodMs = mParser.getAttributeValue(null, \"lowFreqPeriodMs\");\n lLowFreqPeriodMs = Long.parseLong(szLowFreqPeriodMs);\n\n szTilingPath = mParser.getAttributeValue(null, \"tilingPath\");\n\n String szMaxDataSizePerSession = mParser.getAttributeValue(null, \"maxDataSizePerSession\");\n lMaxDataSizePerSession = Long.parseLong(szMaxDataSizePerSession);\n\n String szMaxDataSizeTotal = mParser.getAttributeValue(null, \"maxDataSizeTotal\");\n lMaxDataSizeTotal = Long.parseLong(szMaxDataSizeTotal);\n\n String szNetworkPvdEnabled = mParser.getAttributeValue(null, \"networkPvdEnabled\");\n bNetworkPvdEnabled = Boolean.parseBoolean(szNetworkPvdEnabled);\n\n }\n }\n catch (XmlPullParserException e)\n {\n Log.e(TAG, \"WiperConfig parsing exception \", e);\n bWiperConfigReadError = true;\n }\n catch (IOException e)\n {\n Log.e(TAG, \"WiperConfig parsing exception\", e);\n bWiperConfigReadError = true;\n }\n\n if(Config.LOGV)\n {\n Log.v(TAG,\"WiperConfig uname:\"+szUsername+\", realm:\"+szRealm+\",hi:\"+lHighFreqPeriodMs+\",lo:\"+lLowFreqPeriodMs+\":tPath:\"+szTilingPath);\n }\n return;\n }", "private native void init (String configFile) throws IOException;", "public static void main(String[] args)throws Throwable {\n FileLib flib = new FileLib();\n flib.readPropertyData(\"./data/config.properties\", \"browser\");\n // System.out.println(value); \n\t}", "public void readMachineDescription(String filename){readMachineDescription(new File(filename));}", "@Override\n\tpublic void load(Reader reader)\n\t{\n\t\tString os = System.getProperty(\"os.name\", \"?\").toLowerCase();\n\t\tif (os.startsWith(\"linux\"))\n\t\t\tos = \"linux\";\n\t\telse if (os.startsWith(\"windows\"))\n\t\t\tos = \"windows\";\n\t\telse if (os.startsWith(\"sun\"))\n\t\t\tos = \"sun\";\n\t\telse if (os.startsWith(\"mac\"))\n\t\t\tos = \"mac\";\n\t\t\n\t\t\n\t\tString line, key, value;\n\t\tint i,j;\n\t\tScanner input = new Scanner(reader);\n\t\twhile (input.hasNext())\n\t\t{\n\t\t\tline = getNextLine(input);\n\t\t\tif (line.length() > 0)\n\t\t\t{\n\t\t\t\twhile (line.endsWith(\" \\\\\") || line.endsWith(\"\\t\\\\\"))\n\t\t\t\t\tline = line.substring(0, line.length()-1) + getNextLine(input);\n\t\t\t\t\n\t\t\t\t// find index of the first occurrence of either '=' or ':'\n\t\t\t\ti=line.indexOf('=');\n\t\t\t\tj=line.indexOf(':');\n\t\t\t\tif (j >= 0 && j < i)\n\t\t\t\t\ti = j;\n\t\t\t\t\n\t\t\t\t// split line into key and value substrings.\n\t\t\t\t// Note: key must have at least one character.\n\t\t\t\tif (i > 0)\n\t\t\t\t{\n\t\t\t\t\tkey = line.substring(0, i).trim();\n\t\t\t\t\t\n\t\t\t\t\tboolean skip = false;\n\t\t\t\t\tfor (String op : new String[] {\"linux\", \"windows\", \"sun\", \"mac\"})\n\t\t\t\t\t{\n\t\t\t\t\t\tif (key.startsWith(\"<\"+op+\">\"))\n\t\t\t\t\t\t{ \n\t\t\t\t\t\t\tif (os.equals(op))\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tkey = key.substring((\"<\"+op+\">\").length()).trim();\n\t\t\t\t\t\t\t\tskip = false;\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\telse \n\t\t\t\t\t\t\t\tskip = true;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tif (skip)\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\tvalue = line.substring(i+1).trim();\n\t\t\t\t\n\t\t\t\t\t// The following two if statements provide backward compatibility for old GMP property files\n\t\t\t\t\t// that added double '\\' characters in file names and directory names. As soon as all of \n\t\t\t\t\t// our property files no longer contain double backslash characters, we should get rid of this.\n\t\t\t\t\t// if value starts with 4 backslash characters, eg., \\\\\\\\fig2\\\\GMPSys\\\\filename\n\t\t\t\t\t// then replace all double backslashes with single backslashes, eg., \\\\fig2\\GMPSys\\filename\n\t\t\t\t\tif (value.startsWith(\"\\\\\\\\\\\\\\\\\"))\n\t\t\t\t\t{\n\t\t\t\t\t\ti=value.indexOf(\"\\\\\\\\\");\n\t\t\t\t\t\twhile (i >= 0)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tvalue = value.substring(0,i)+value.substring(i+1);\n\t\t\t\t\t\t\ti=value.indexOf(\"\\\\\\\\\");\n\t\t\t\t\t\t}\n\t\t\t\t\t\tvalue = \"\\\\\"+value;\n\t\t\t\t\t}\n\n\t\t\t\t\t// if value starts with a character followed by \":\\\\\", eg., c:\\\\GMPSys\\\\filename\n\t\t\t\t\t// then replace all double backslashes with single backslashes, eg., c:\\GMPSys\\filename\n\t\t\t\t\tif (value.length() >= 4 && value.charAt(1)==':' && value.charAt(2) == '\\\\' && value.charAt(3) == '\\\\')\n\t\t\t\t\t{\n\t\t\t\t\t\ti=value.indexOf(\"\\\\\\\\\");\n\t\t\t\t\t\twhile (i >= 0)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tvalue = value.substring(0,i)+value.substring(i+1);\n\t\t\t\t\t\t\ti=value.indexOf(\"\\\\\\\\\");\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\tsetProperty(key, value);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\tif (getProperty(\"includePropertyFile\") != null)\n\t\t{\n\t\t\ttry\n\t\t\t{\n\t\t\t\tFile includeFile = getFile(\"includePropertyFile\");\n\t\t\t\tremove(\"includePropertyFile\");\n\t\t\t\tload(new FileReader(includeFile));\n\t\t\t} \n\t\t\tcatch (PropertiesPlusException e)\n\t\t\t{\n\t\t\t\te.printStackTrace();\n\t\t\t\tSystem.exit(1);\n\t\t\t} \n\t\t\tcatch (FileNotFoundException e)\n\t\t\t{\n\t\t\t\te.printStackTrace();\n\t\t\t\tSystem.exit(1);\n\t\t\t}\n\t\t}\n\t}", "String getConfigFileName();", "Collection<String> readConfigs();", "public static void createIni() {\r\n\t\t//Clear the contents of the ini array list if not null.\r\n\t\tif (Main.ini != null) Main.ini.clear();\r\n\t\t\r\n\t\t//Start putting in the data.\r\n\t\tMain.ini.add(\"[Names]\");\r\n\t\t\r\n\t\t//Loop through the entire names array list.\r\n\t\tfor (int i = 0; i < names.size(); i++) {\r\n\t\t\tMain.ini.add(names.get(i));\r\n\t\t}\r\n\t\t\r\n\t\t//Start putting in the data.\r\n\t\tMain.ini.add(\"\");\r\n\t\tMain.ini.add(\"[Defaults]\");\r\n\t\t\r\n\t\t//Loop through the entire defaults array list.\r\n\t\tfor (int i = 0; i < defaults.size(); i++) {\r\n\t\t\tMain.ini.add(defaults.get(i));\r\n\t\t}\r\n\t\t\r\n\t\t//Start putting in the data.\r\n\t\tMain.ini.add(\"\");\r\n\t\tMain.ini.add(\"[Sounds]\");\r\n\t\t\r\n\t\t//Loop through the entire names array list.\r\n\t\tfor (int i = 0; i < sounds.size(); i++) {\r\n\t\t\tMain.ini.add(sounds.get(i));\r\n\t\t}\r\n\t}", "private void initiate(){try{\n\t//String dataIni = run.class.getResource(\"../util/DataBase.ini\").getFile();\n //FileInputStream fin=new FileInputStream(dataIni); // 打开文件,从根目录开始寻找\n//\tFileInputStream fin=new FileInputStream(\"src/util/DataBase.ini\"); // 打开文件,从根目录开始寻找\n//\tProperties props=new Properties(); // 建立属性类,读取ini文件\n//\tprops.load(fin); \n//\tdriver=props.getProperty(\"driver\"); //根据键读取值\n//\turl=props.getProperty(\"url\");\n//\tusername=props.getProperty(\"username\");\n//\tuserpassword=props.getProperty(\"userpassword\");\n\t}\n\tcatch(Exception e){e.printStackTrace();}\n\t}", "public static void read_paramenters() {\n\t\ttry {\n\t\t // TODO CA: check that this work on Windows!\n String home = System.getProperty(\"user.home\");\n File parametersFile = new File(home + \"/\" + parametersFilename);\n\t\t\tScanner sc = new Scanner(parametersFile);\n\t\t\twhile (sc.hasNext()) {\n\t\t\t\tinitialize_parameters(sc.nextLine());\n\t\t\t}\n\t\t\tsc.close();\n\t\t} catch (FileNotFoundException e) {\n\t\t\tSystem.out.println(\"Error: File \" + parametersFilename + \" not found!\");\n\t\t\tSystem.out.println(\"Make sure that file \" + parametersFilename + \" is in the correct format!\");\n\t\t\tSystem.out.println(\"The format of the file is:\");\n\t\t\tSystem.out.println(\"host ap-dev.cs.ucy.ac.cy\");\n\t\t\tSystem.out.println(\"port 43\");\n\t\t\tSystem.out.println(\"cache res/\");\n\t\t\tSystem.out.println(\"access_token <api_key> \" +\n \"[The API key has be generated based on your google account through the anyplace architect]\");\n\t\t\t// TODO CA: when this error is shown, prompt, with Y or N to initialize that file with defaults\n // if yes, then read parameters again\n\t\t\tSystem.exit(-1);\n\t\t}\n\t}", "public void loadConfigurationFromDisk() {\r\n try {\r\n FileReader fr = new FileReader(CONFIG_FILE);\r\n BufferedReader rd = new BufferedReader(fr);\r\n\r\n String line;\r\n while ((line = rd.readLine()) != null) {\r\n if (line.startsWith(\"#\")) continue;\r\n if (line.equalsIgnoreCase(\"\")) continue;\r\n\r\n StringTokenizer str = new StringTokenizer(line, \"=\");\r\n if (str.countTokens() > 1) {\r\n String aux;\r\n switch (str.nextToken().trim()) {\r\n case \"system.voidchain.protocol_version\":\r\n aux = str.nextToken().trim();\r\n if (aux != null)\r\n this.protocolVersion = aux;\r\n continue;\r\n case \"system.voidchain.transaction.max_size\":\r\n aux = str.nextToken().trim();\r\n if (aux != null)\r\n this.transactionMaxSize = Integer.parseInt(aux);\r\n continue;\r\n case \"system.voidchain.block.num_transaction\":\r\n aux = str.nextToken().trim();\r\n if (aux != null)\r\n this.numTransactionsInBlock = Integer.parseInt(aux);\r\n continue;\r\n case \"system.voidchain.storage.data_file_extension\":\r\n if (firstRun) {\r\n aux = str.nextToken().trim();\r\n if (aux != null)\r\n this.dataFileExtension = aux;\r\n }\r\n continue;\r\n case \"system.voidchain.storage.block_file_base_name\":\r\n if (firstRun) {\r\n aux = str.nextToken().trim();\r\n if (aux != null)\r\n this.blockFileBaseName = aux;\r\n }\r\n continue;\r\n case \"system.voidchain.storage.wallet_file_base_name\":\r\n if (firstRun) {\r\n aux = str.nextToken().trim();\r\n if (aux != null)\r\n this.walletFileBaseName = aux;\r\n }\r\n continue;\r\n case \"system.voidchain.storage.data_directory\":\r\n if (firstRun) {\r\n aux = str.nextToken().trim();\r\n if (aux != null) {\r\n aux = aux.replace('/', File.separatorChar);\r\n if (!aux.endsWith(File.separator))\r\n //aux = aux.substring(0, aux.length() - 1);\r\n aux = aux.concat(File.separator);\r\n this.dataDirectory = aux;\r\n }\r\n }\r\n continue;\r\n case \"system.voidchain.storage.block_file_directory\":\r\n if (firstRun) {\r\n aux = str.nextToken().trim();\r\n if (aux != null) {\r\n aux = aux.replace('/', File.separatorChar);\r\n if (!aux.endsWith(File.separator))\r\n //aux = aux.substring(0, aux.length() - 1);\r\n aux = aux.concat(File.separator);\r\n this.blockFileDirectory = aux;\r\n }\r\n }\r\n continue;\r\n case \"system.voidchain.storage.wallet_file_directory\":\r\n if (firstRun) {\r\n aux = str.nextToken().trim();\r\n if (aux != null) {\r\n aux = aux.replace('/', File.separatorChar);\r\n if (!aux.endsWith(File.separator))\r\n //aux = aux.substring(0, aux.length() - 1);\r\n aux = aux.concat(File.separator);\r\n this.walletFileDirectory = aux;\r\n }\r\n }\r\n continue;\r\n case \"system.voidchain.memory.block_megabytes\":\r\n aux = str.nextToken().trim();\r\n if (aux != null)\r\n this.memoryUsedForBlocks = Integer.parseInt(aux);\r\n continue;\r\n case \"system.voidchain.sync.block_sync_port\":\r\n if (firstRun) {\r\n aux = str.nextToken().trim();\r\n if (aux != null)\r\n this.blockSyncPort = Integer.parseInt(aux);\r\n }\r\n continue;\r\n case \"system.voidchain.crypto.ec_param\":\r\n aux = str.nextToken().trim();\r\n if (aux != null)\r\n this.ecParam = aux;\r\n continue;\r\n case \"system.voidchain.core.block_proposal_timer\":\r\n aux = str.nextToken().trim();\r\n if (aux != null)\r\n this.blockProposalTimer = Integer.parseInt(aux) * 1000;\r\n continue;\r\n case \"system.voidchain.blockchain.chain_valid_timer\":\r\n aux = str.nextToken().trim();\r\n if (aux != null)\r\n this.blockchainValidTimer = Integer.parseInt(aux) * 1000;\r\n continue;\r\n }\r\n }\r\n }\r\n\r\n fr.close();\r\n rd.close();\r\n\r\n if (this.firstRun)\r\n this.firstRun = false;\r\n } catch (IOException e) {\r\n logger.error(\"Could not load configuration\", e);\r\n }\r\n }", "private List<Integer> readConfigFile(String filename) {\n\n Scanner input;\n try {\n input = new Scanner(this.getClass().getClassLoader().getResourceAsStream(filename));\n input.useDelimiter(\",|\\\\n\");\n } catch (NullPointerException e){\n throw new IllegalArgumentException(filename + \" cannot be found\", e);\n }\n\n checkConfigFile(filename);\n\n return parseFile(input);\n }", "public ByteArrayInputStream getPkcs11ConfigInputStream()\r\n {\n String _pkcs11file = getPkcs11FilePath();\r\n String _currentprofile = getCurrentProfiledir();\r\n ByteArrayInputStream bais = null;\r\n\r\n if (OS.isWindowsUpperEqualToNT())\r\n {\r\n bais = new ByteArrayInputStream((\"name = NSS\\r\" + \"library = \" + _pkcs11file + \"\\r\"\r\n + \"attributes= compatibility\" + \"\\r\" + \"slot=2\\r\" + \"nssArgs=\\\"\"\r\n + \"configdir='\" + _currentprofile.replace(\"\\\\\", \"/\") + \"' \" + \"certPrefix='' \"\r\n + \"keyPrefix='' \" + \"secmod=' secmod.db' \" + \"flags=readOnly\\\"\\r\").getBytes());\r\n }\r\n else if (OS.isLinux() || OS.isMac())\r\n {\r\n /*\r\n * TODO:With Linux is pending to test what's up with the white spaces in the path.\r\n */\r\n\r\n bais = new ByteArrayInputStream((\"name = NSS\\r\" + \"library = \" + _pkcs11file + \"\\n\"\r\n + \"attributes= compatibility\" + \"\\n\" + \"slot=2\\n\" + \"nssArgs=\\\"\"\r\n + \"configdir='\" + _currentprofile + \"' \" + \"certPrefix='' \" + \"keyPrefix='' \"\r\n + \"secmod=' secmod.db' \" + \"flags=readOnly\\\"\\n\").getBytes());\r\n }\r\n\r\n return bais;\r\n }", "public File getConfigurationFile();", "public static void main(String[] args) throws IOException {\n\t\tFileReader fr = new FileReader(\"config.properties\");\n\t\tMyBufferedReader mybr = new MyBufferedReader(fr);\n\t\tint a = 0;\n\t\twhile ((a = mybr.myRead()) != -1) {\n\t\t\tSystem.out.print((char)97);\n\t\t}\n\n\t}", "private InputStream wrapAndEscapeConfigFile(File file) throws IOException {\n List<String> strings = FileUtils.readLines(file, StandardCharsets.UTF_8);\n for (int i = 0; i < strings.size(); i++) {\n strings.set(i, strings.get(i).replace(\"\\\\\", \"\\\\\\\\\"));\n }\n\n ByteArrayOutputStream outputStream = new ByteArrayOutputStream((int) (file.length() + 50));\n PrintStream printStream = new PrintStream(outputStream, true, StandardCharsets.UTF_8.name());\n for (String line : strings) {\n printStream.println(line);\n }\n\n printStream.flush();\n return new ByteArrayInputStream(outputStream.toByteArray());\n }", "public static ChebiConfig readFromFile() throws IOException{\n return readFromInputStream(ChebiConfig.class.getClassLoader()\n .getResourceAsStream(\"chebi-adapter.properties\"));\n }", "public static void ReadConfig() throws IOException\r\n {\r\n ReadConfiguration read= new ReadConfiguration(\"settings/FabulousIngest.properties\");\r\n \t \r\n fedoraStub =read.getvalue(\"fedoraStub\");\r\n \t username = read.getvalue(\"fedoraUsername\");\r\n \t password =read.getvalue(\"fedoraPassword\");\r\n \t pidNamespace =read.getvalue(\"pidNamespace\");\r\n \t contentAltID=read.getvalue(\"contentAltID\");\r\n \t \r\n \t \r\n \t ingestFolderActive =read.getvalue(\"ingestFolderActive\");\r\n \t ingestFolderInActive =read.getvalue(\"ingestFolderInActive\");\r\n \t\r\n logFileNameInitial=read.getvalue(\"logFileNameInitial\");\r\n \r\n DataStreamID=read.getvalue(\"DataStreamID\");\r\n \t DataStreamLabel=read.getvalue(\"DataStreamLabel\");\r\n \r\n \r\n \r\n }", "public static void init(String propfile, String processname, String args[]) throws Exception\r\n\t{\r\n\t\tif(initdone)\r\n\t\t{\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\t// Standard file encoding\r\n\t\tSystem.setProperty(\"file.encoding\", Constant.ENCODE_UTF8);\r\n\r\n\t\tLOG.init();\r\n\r\n\t\tlog = LOG.getLog(Option.class);\r\n\r\n\t\tlog.info(\"BINROOT \" + Locator.findBinROOT());\r\n\r\n\t\t// Properties parsen\r\n\t\ttry\r\n\t\t{\r\n\t\t\t// XML Configfile\r\n\t\t\tconfig = new XMLConfiguration();\r\n\t\t\tconfig.setEncoding(\"UTF8\");\r\n\t\t\tconfig.setDelimiterParsingDisabled(true);\r\n\r\n\t\t\tif(Validation.notEmpty(propfile))\r\n\t\t\t{\r\n\t\t\t\t// Include von externen Configfiles: <import file=\"ALIAS\" /> \r\n\t\t\t\tGrouper includer = new Grouper(\"<import file=\\\"(.*?)\\\".?/>\", Pattern.CASE_INSENSITIVE | Pattern.MULTILINE);\r\n\r\n\t\t\t\tString org = new String(Tool.readchararray(Locator.findBinROOT() + propfile));\r\n\r\n\t\t\t\tString[] includefile = includer.matchall(org);\r\n\r\n\t\t\t\tfor(int i = 0; i < includefile.length; i = i + 2)\r\n\t\t\t\t{\r\n\t\t\t\t\ttry\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\t// read include file\r\n\t\t\t\t\t\tString include = new String(Tool.readchararray(Locator.findBinROOT() + includefile[i + 1]));\r\n\r\n\t\t\t\t\t\torg = org.replace(includefile[i], include.trim());\r\n\t\t\t\t\t}\r\n\t\t\t\t\tcatch(Exception e)\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tlog.error(\"Configfile missing\", e);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\r\n\t\t\t\tconfig.load(new ByteArrayInputStream(org.trim().getBytes(\"UTF8\")));\r\n\r\n\t\t\t\tstage = config.getString(\"staging\", \"test\");\r\n\r\n\t\t\t\treplace = new Replacer(\"\\\\$\\\\{staging\\\\}\");\r\n\r\n\t\t\t\tSystem.out.println(\"FOUND STAGE: [\" + stage + \"]\");\r\n\t\t\t}\r\n\r\n\t\t\t// Property Configfile\r\n\t\t\t// config = new PropertiesConfiguration(\"TestServer.properties\");\r\n\t\t}\r\n\t\tcatch(Exception e)\r\n\t\t{\r\n\t\t\tlog.error(e);\r\n\t\t\tthrow e;\r\n\t\t}\r\n\r\n\t\tboolean hascmd = isClassInPath(\"org.apache.commons.cli.CommandLineParser\",\r\n\t\t \"Commandline parser disabled Lib is missing!\");\r\n\t\tif(hascmd && options != null)\r\n\t\t{\r\n\t\t\t// keine default options mehr\r\n\t\t\t// initDefaultOptions(); \r\n\r\n\t\t\ttry\r\n\t\t\t{\r\n\t\t\t\tcmd = new PosixParser().parse(options, args);\r\n\t\t\t\t//cmd = new GnuParser().parse(options, args);\r\n\t\t\t\t//cmd = new BasicParser().parse(options, args);\r\n\t\t\t}\r\n\t\t\tcatch(Exception e)\r\n\t\t\t{\r\n\t\t\t\te.printStackTrace();\r\n\t\t\t\tprintHelp(processname);\r\n\t\t\t}\r\n\r\n\t\t\tif(cmd.hasOption(HELP))\r\n\t\t\t{\r\n\t\t\t\tprintHelp(processname);\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\t// DB initialisieren\r\n\r\n\t\tif(isClassInPath(\"gawky.database.DB\",\r\n\t\t \"DB wurde nicht gefunden Parameter werden ignoriert!\"))\r\n\t\t{\r\n\t\t\tDB.init();\r\n\t\t}\r\n\r\n\t\tinitdone = true;\r\n\r\n\t\treturn;\r\n\t}", "void readPreferences(InputStream prefin) {\n\t// line-based, <command> <args>, \"#\" starts comment, lines can be blank\n\tBufferedReader prefr = new BufferedReader(new InputStreamReader(prefin));\n\tStreamTokenizer st = new StreamTokenizer(prefr);\n\tst.eolIsSignificant(true);\n\tst.resetSyntax();\n\tst.whitespaceChars(0,' '); st.wordChars(' '+1, 0x7e);\n\tst.commentChar('#'); st.slashSlashComments(true); st.slashStarComments(true);\n\tst.quoteChar('\"');\n\n\ttry {\n\tString key, val;\n\tfor (int token=st.nextToken(); token!=StreamTokenizer.TT_EOF; ) {\n\t\tif (token==StreamTokenizer.TT_EOL) { token=st.nextToken(); continue; }\n\t\tString cmd = st.sval;\n\t\tif (cmd!=null) cmd=cmd.intern();\n\t\tst.nextToken(); key=st.sval; st.nextToken(); val=st.sval;\t// for now all commands have same syntax\n\t\tif (\"mediaadaptor\"==cmd) {\n//System.out.println(\"media adaptor \"+key+\" => \"+val);\n\t\t\tadaptor_.put(key.toLowerCase(), val); // not case sensitive\n\t\t} else if (\"remap\"==cmd) {\n//System.out.println(\"behavior remap \"+key+\" => \"+val);\n\t\t\tberemap_.put(key, val);\n\t\t\t//berevmap_.put(val, key); // reverse map for when save out => NO, keep logical name and associated behavior separate\n\t\t} else if (\"set\"==cmd) {\n\t\t\tputPreference(key, val);\n\t\t}\n\t\tdo { token=st.nextToken(); } while (token!=StreamTokenizer.TT_EOL && token!=';' && token!=StreamTokenizer.TT_EOF);\n\t}\n\tprefr.close();\n\t} catch (IOException ignore) {\nSystem.err.println(\"can't read prefs \"+ignore);\n\t}\n }", "private static ArrayList<String> loadParameters() throws IOException {\r\n BufferedReader br = new BufferedReader(new FileReader(new File(\"conf.data\")));\r\n\r\n ArrayList<String> params = new ArrayList<>();\r\n\r\n String param;\r\n while ((param = br.readLine()) != null ){\r\n params.add(param);\r\n }\r\n\r\n return params;\r\n }", "public void readInit(String filename) {\n\t\ttry {\n\t\t\tprefs = new IniPreferences(new Ini(new File(filename)));\n\t\t} catch (IOException e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t\tif (prefs != null) {\n\t\t\ttry {\n\t\t\t\tif (prefs.nodeExists(MODNAME)) {\n\t\t\t\t\tport = Integer.valueOf(prefs.node(MODNAME).get(\"port\", \"9099\"));\n\t\t\t\t}\n\t\t\t} catch (BackingStoreException ex) {\n\t\t\t\tex.printStackTrace();\n\t\t\t}\n\t\t}\n\t}", "private static void processIncludedConfig() {\n String configName = \"config.\" + getRunMode() + \".properties\";\n\n //relative path cannot be recognized and not figure out the reason, so here use absolute path instead\n InputStream configStream = Configuration.class.getResourceAsStream(\"/\" + configName);\n if (configStream == null) {\n log.log(Level.WARNING, \"configuration resource {0} is missing\", configName);\n return;\n }\n\n try (InputStreamReader reader = new InputStreamReader(configStream, StandardCharsets.UTF_8)) {\n Properties props = new Properties();\n props.load(reader);\n CONFIG_VALUES.putAll(props);\n } catch (IOException e) {\n log.log(Level.WARNING, \"Unable to process configuration {0}\", configName);\n }\n\n }", "@Test\n public void testFileReading() throws Exception {\n String[] args = new String[1];\n args[0] = testFile;\n ConferenceManager.main(args);\n\n }", "private static List<String> readConfFile(File configFile) {\n List<String> lines = new ArrayList<>();\n if (null != configFile) {\n Path filePath = configFile.toPath();\n Charset charset = Charset.forName(\"UTF-8\");\n try {\n lines = Files.readAllLines(filePath, charset);\n } catch (IOException e) {\n logger.log(Level.SEVERE, \"Error reading config file contents. {}\", configFile.getAbsolutePath());\n }\n }\n return lines;\n }", "public String readConfig(Context context) {\n\n String ret = \"\";\n\n try {\n InputStream inputStream = context.openFileInput(\"config.txt\");\n\n if (inputStream != null) {\n InputStreamReader inputStreamReader = new InputStreamReader(inputStream);\n BufferedReader bufferedReader = new BufferedReader(inputStreamReader);\n String receiveString = \"\";\n StringBuilder stringBuilder = new StringBuilder();\n\n while ((receiveString = bufferedReader.readLine()) != null) {\n stringBuilder.append(receiveString);\n }\n\n inputStream.close();\n ret = stringBuilder.toString();\n }\n } catch (FileNotFoundException e) {\n Log.e(\"Config\", \"File not found: \" + e.toString());\n } catch (IOException e) {\n Log.e(\"Config\", \"Can not read file: \" + e.toString());\n }\n\n return ret;\n }", "public void readData(String infile) throws Exception {\r\n \t\tScanner in = new Scanner(new FileReader(infile));\r\n \t}", "public static void initialize() {\n // check to see if the name of an alternate configuration\n // file has been specified. This can be done, for example,\n // java -Dfilesys.conf=myfile.txt program-name parameter ...\n String propertyFileName = System.getProperty(\"filesys.conf\");\n if (propertyFileName == null)\n propertyFileName = \"filesys.conf\";\n Properties properties = new Properties();\n try {\n FileInputStream in = new FileInputStream(propertyFileName);\n properties.load(in);\n in.close();\n } catch (FileNotFoundException e) {\n System.err.println(PROGRAM_NAME + \": error opening properties file\");\n System.exit(EXIT_FAILURE);\n } catch (IOException e) {\n System.err.println(PROGRAM_NAME + \": error reading properties file\");\n System.exit(EXIT_FAILURE);\n }\n\n // get the root file system properties\n String rootFileSystemFilename =\n properties.getProperty(\"filesystem.root.filename\", \"filesys.dat\");\n String rootFileSystemMode =\n properties.getProperty(\"filesystem.root.mode\", \"rw\");\n\n // get the current process properties\n short uid = 1;\n try {\n uid = Short.parseShort(properties.getProperty(\"process.uid\", \"1\"));\n } catch (NumberFormatException e) {\n System.err.println(PROGRAM_NAME +\n \": invalid number for property process.uid in configuration file\");\n System.exit(EXIT_FAILURE);\n }\n\n short gid = 1;\n try {\n gid = Short.parseShort(properties.getProperty(\"process.gid\", \"1\"));\n } catch (NumberFormatException e) {\n System.err.println(PROGRAM_NAME +\n \": invalid number for property process.gid in configuration file\");\n System.exit(EXIT_FAILURE);\n }\n\n short umask = 0002;\n try {\n umask = Short.parseShort(\n properties.getProperty(\"process.umask\", \"002\"), 8);\n } catch (NumberFormatException e) {\n System.err.println(PROGRAM_NAME +\n \": invalid number for property process.umask in configuration file\");\n System.exit(EXIT_FAILURE);\n }\n\n String dir = \"/root\";\n dir = properties.getProperty(\"process.dir\", \"/root\");\n\n try {\n MAX_OPEN_FILES = Integer.parseInt(properties.getProperty(\n \"kernel.max_open_files\", \"20\"));\n } catch (NumberFormatException e) {\n System.err.println(PROGRAM_NAME +\n \": invalid number for property kernel.max_open_files in configuration file\");\n System.exit(EXIT_FAILURE);\n }\n\n try {\n ProcessContext.MAX_OPEN_FILES = Integer.parseInt(\n properties.getProperty(\"process.max_open_files\", \"10\"));\n } catch (NumberFormatException e) {\n System.err.println(PROGRAM_NAME +\n \": invalid number for property process.max_open_files in configuration file\");\n System.exit(EXIT_FAILURE);\n }\n\n // create open file array\n openFiles = new FileDescriptor[MAX_OPEN_FILES];\n\n // create the first process\n process = new ProcessContext(uid, gid, dir, umask);\n processCount++;\n\n // open the root file system\n try {\n openFileSystems[ROOT_FILE_SYSTEM] = new FileSystem(\n rootFileSystemFilename, rootFileSystemMode);\n } catch (IOException e) {\n System.err.println(PROGRAM_NAME + \": unable to open root file system\");\n System.exit(EXIT_FAILURE);\n }\n\n }", "public static void read(String configFile){\n\t\ttry {\n\t\t\tif(configFile.startsWith(\"$setu\")){\n\t\t\t\t\n\t\t\t\tString path=AppProperties.getProperty(\"setu\");\n\t\t\t\tif((path.substring(path.length()-1)).equals(\"/\")){\n\t\t\t\t\tpath=path.substring(0,path.length()-1);\n\t\t\t\t}\n\t\t\t\tconfigFile=path.concat(configFile.substring(5));\n\t\t\t}\n\n\t\t\tBufferedReader bcfr = new BufferedReader(new InputStreamReader(new FileInputStream(configFile), \"UTF8\"));\n\t\t\tString varPrefix = \"\";\n\t\t\tString varName;\n\t\t\tString value;\n\t\t\tint indexOfEqual;\n\t\t\tString line = null;\n\t\t\tconfig = new HashMap<String,String>();\n\t\t\twhile((line = bcfr.readLine()) != null){\n\t\t\t\tif(line.equals(\"\"))\n\t\t\t\t\tcontinue;\n\t\t\t\tif(line.startsWith(\"[\") && line.trim().endsWith(\"]\")){\n\t\t\t\t\tvarPrefix = line.substring(1, line.indexOf(\"]\"))+\".\";\n\t\t\t\t}\n\t\t\t\telse{\n\t\t\t\t\tindexOfEqual = line.indexOf(\"=\");\n\t\t\t\t\tvarName = line.substring(0, indexOfEqual).trim();\n\t\t\t\t\tvalue = line.substring(indexOfEqual + 1).trim();\n\t\t\t\t\tconfig.put(varPrefix + varName, value);\n\t\t\t\t}\n\t\t\t}\n\t\t} catch (UnsupportedEncodingException e) {\n\t\t\te.printStackTrace();\n\t\t} catch (FileNotFoundException e) {\n\t\t\te.printStackTrace();\n\t\t} catch (IOException e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t}", "private File findConfigurationFile(String fileName) throws UnsupportedEncodingException {\r\n\r\n String directory = getConfigurationDirectory();\r\n if (directory == null) {\r\n return null;\r\n }\r\n\r\n String path = directory + fileName;\r\n\r\n File configFile = new File(path);\r\n if (configFile.exists() && configFile.isFile()) {\r\n return configFile;\r\n }\r\n\r\n return null;\r\n }", "public static void loadConfig() throws IOException {\n\t\t// initialize hash map\n\t\tserverOptions = new HashMap<>();\n\t\t// Get config from file system\n\t\tClass<ConfigurationHandler> configurationHandler = ConfigurationHandler.class;\n\t\tInputStream inputStream = configurationHandler.getResourceAsStream(\"/Config/app.properties\");\n\t\tInputStreamReader isReader = new InputStreamReader(inputStream);\n\t //Creating a BufferedReader object\n\t BufferedReader reader = new BufferedReader(isReader);\n\t String str;\n\t while((str = reader.readLine())!= null){\n\t \t if (str.contains(\"=\")) {\n\t \t\t String[] config = str.split(\" = \", 2);\n\t \t serverOptions.put(config[0], config[1]);\n\t \t }\n\t }\n\t}", "File getPropertiesFile();", "public int lookupReadFileExtension(String extension);", "public static void main(String[] args) throws IOException {\n\t\tProperties prop = new Properties();\r\n\t\t\t \r\n\t\tFileInputStream ip = new FileInputStream(\"C:\\\\Users\\\\PC User1\\\\git\\\\VedantAutomation\\\\\"\r\n\t\t\t\t+ \"VedantAutomation\\\\config.properties\");\r\n\t\t\r\n\t\tprop.load(ip);\r\n\t\t\r\n\t\tSystem.out.print(prop.get(\"browser\"));\r\n\t\t\r\n\r\n\t}", "public ConfigFileReader(){\r\n\t\t \r\n\t\t BufferedReader reader;\r\n\t\t try {\r\n\t\t\t reader = new BufferedReader(new FileReader(propertyFilePath));\r\n\t\t\t properties = new Properties();\r\n\t\t\t try {\r\n\t\t\t\t properties.load(reader);\r\n\t\t\t\t reader.close();\r\n\t\t\t } catch (IOException e) {\r\n\t\t\t\t e.printStackTrace();\r\n\t\t\t }\r\n\t\t } catch (FileNotFoundException e) {\r\n\t\t\t e.printStackTrace();\r\n\t\t\t throw new RuntimeException(\"configuration.properties not found at \" + propertyFilePath);\r\n\t \t } \r\n\t }", "private static void readCitProperties(String fileName) {\n/* */ try {\n/* 91 */ ResourceLocation e = new ResourceLocation(fileName);\n/* 92 */ InputStream in = Config.getResourceStream(e);\n/* */ \n/* 94 */ if (in == null) {\n/* */ return;\n/* */ }\n/* */ \n/* */ \n/* 99 */ Config.dbg(\"CustomItems: Loading \" + fileName);\n/* 100 */ Properties props = new Properties();\n/* 101 */ props.load(in);\n/* 102 */ in.close();\n/* 103 */ useGlint = Config.parseBoolean(props.getProperty(\"useGlint\"), true);\n/* */ }\n/* 105 */ catch (FileNotFoundException var4) {\n/* */ \n/* */ return;\n/* */ }\n/* 109 */ catch (IOException var5) {\n/* */ \n/* 111 */ var5.printStackTrace();\n/* */ } \n/* */ }", "private boolean readSettings() {\n try {\n String encoded = mProject.getPersistentProperty(CONFIG_INCLUDES);\n if (encoded != null) {\n mIncludes = decodeMap(encoded);\n\n // Set up a reverse map, pointing from included files to the files that\n // included them\n mIncludedBy = new HashMap<String, List<String>>(2 * mIncludes.size());\n for (Map.Entry<String, List<String>> entry : mIncludes.entrySet()) {\n // File containing the <include>\n String includer = entry.getKey();\n // Files being <include>'ed by the above file\n List<String> included = entry.getValue();\n setIncludedBy(includer, included);\n }\n\n return true;\n }\n } catch (CoreException e) {\n AdtPlugin.log(e, \"Can't read include settings\");\n }\n\n return false;\n }", "private void parseClientConfigFile(){\n\n boolean isClientFile = false; //states if the config-file is a clients file\n String line = \"\";\n\n try{\n buffReader = new BufferedReader(new FileReader (new File(logFileName) ));\n\n while( buffReader.ready()) {\n line = buffReader.readLine().trim();\n //check to see if <client> tag exists\n if (line.startsWith(\"<client>\")){\n isClientFile = true;\n }\n \n if (isClientFile){\n if (line.startsWith(\"<name>\")){\n this.name = line.substring(6, line.length()-7);\n } else if (line.startsWith(\"<key>\")){\n this.key = line.substring(5, line.length()-6);\n } else if (line.startsWith(\"<serverip>\")){\n this.serverIpString = line.substring(10, line.length()-11);\n } else if (line.startsWith(\"<serverport>\")){\n this.serverPort = Integer.valueOf(line.substring(12, line.length()-13));\n } else if (line.startsWith(\"<clientListenPort>\")){\n clientListenPort = Integer.valueOf(line.substring(18, line.length()-19));\n }\n else\n continue;\n } else\n initializeNA();\n }\n\n } catch (FileNotFoundException fnfEx){\n ClientInterface.getjTextArea1().append(\"Could not FIND client's Configuration File.\");\n initializeNA();\n } catch (IOException ioEx){\n ClientInterface.getjTextArea1().append(\"Could not OPEN client's Configuration File.\");\n initializeNA();\n }\n }", "public ConfigFileReader(){\r\n\t\tBufferedReader reader;\r\n\t\ttry {\r\n\t\t\treader = new BufferedReader(new FileReader(propertyFilePath));\r\n\t\t\tproperties = new Properties();\r\n\t\t\ttry {\r\n\t\t\t\tproperties.load(reader);\r\n\t\t\t\treader.close();\r\n\t\t\t}catch(IOException e) {\r\n\t\t\t\te.printStackTrace();\r\n\t\t\t}\r\n\t\t}catch(FileNotFoundException ex) {\r\n\t\t\tSystem.out.println(\"Configuration.properties not found at \"+propertyFilePath);\r\n\t\t}\r\n\t}", "public static void main(String[] args) throws IOException {\n File f=new File(\"D:\\\\selenium\\\\filehandlingtest\\\\file\\\\Test.properties\");\n FileInputStream fis=new FileInputStream(f);\n Properties prop=new Properties();\n prop.load(fis);\n System.out.println (prop.getProperty(\"domain\"));\n \n Enumeration e= prop.keys();\n\n while (e.hasMoreElements()){\n \tString key = (String) e.nextElement();\n \tSystem.out.println(key+\"----\"+prop.get(key));\n \t\n }\n\t}", "public static void main(String[] args) {\n\t\tString configFileName = args[0];\r\n\t\tScanner input = new Scanner(System.in);\r\n\t\t// Read File\r\n\t\tRIP_v2 reader = new RIP_v2();\r\n\t\treader.readFile(configFileName);\r\n\t}", "protected void config_read(String fileParam) {\r\n\t\tFile inputFile = new File(fileParam);\r\n\r\n\t\tif (inputFile == null || !inputFile.exists()) {\r\n\t\t\tSystem.out.println(\"parameter \" + fileParam\r\n\t\t\t\t\t+ \" file doesn't exists!\");\r\n\t\t\tSystem.exit(-1);\r\n\t\t}\r\n\t\t// begin the configuration read from file\r\n\t\ttry {\r\n\t\t\tFileReader file_reader = new FileReader(inputFile);\r\n\t\t\tBufferedReader buf_reader = new BufferedReader(file_reader);\r\n\t\t\t// FileWriter file_write = new FileWriter(outputFile);\r\n\r\n\t\t\tString line;\r\n\r\n\t\t\tdo {\r\n\t\t\t\tline = buf_reader.readLine();\r\n\t\t\t} while (line.length() == 0); // avoid empty lines for processing ->\r\n\t\t\t\t\t\t\t\t\t\t\t// produce exec failure\r\n\t\t\tString out[] = line.split(\"algorithm = \");\r\n\t\t\t// alg_name = new String(out[1]); //catch the algorithm name\r\n\t\t\t// input & output filenames\r\n\t\t\tdo {\r\n\t\t\t\tline = buf_reader.readLine();\r\n\t\t\t} while (line.length() == 0);\r\n\t\t\tout = line.split(\"inputData = \");\r\n\t\t\tout = out[1].split(\"\\\\s\\\"\");\r\n\t\t\tinput_train_name = new String(out[0].substring(1,\r\n\t\t\t\t\tout[0].length() - 1));\r\n\t\t\tinput_test_name = new String(out[1].substring(0,\r\n\t\t\t\t\tout[1].length() - 1));\r\n\t\t\tif (input_test_name.charAt(input_test_name.length() - 1) == '\"')\r\n\t\t\t\tinput_test_name = input_test_name.substring(0,\r\n\t\t\t\t\t\tinput_test_name.length() - 1);\r\n\r\n\t\t\tdo {\r\n\t\t\t\tline = buf_reader.readLine();\r\n\t\t\t} while (line.length() == 0);\r\n\t\t\tout = line.split(\"outputData = \");\r\n\t\t\tout = out[1].split(\"\\\\s\\\"\");\r\n\t\t\toutput_train_name = new String(out[0].substring(1,\r\n\t\t\t\t\tout[0].length() - 1));\r\n\t\t\toutput_test_name = new String(out[1].substring(0,\r\n\t\t\t\t\tout[1].length() - 1));\r\n\t\t\tif (output_test_name.charAt(output_test_name.length() - 1) == '\"')\r\n\t\t\t\toutput_test_name = output_test_name.substring(0,\r\n\t\t\t\t\t\toutput_test_name.length() - 1);\r\n\r\n\t\t\t// parameters\r\n\t\t\tdo {\r\n\t\t\t\tline = buf_reader.readLine();\r\n\t\t\t} while (line.length() == 0);\r\n\t\t\tout = line.split(\"k = \");\r\n\t\t\tnneigh = (new Integer(out[1])).intValue(); // parse the string into\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t// a double\r\n\r\n\t\t\tdo {\r\n\t\t\t\tline = buf_reader.readLine();\r\n\t\t\t} while (line.length() == 0);\r\n\t\t\tout = line.split(\"enn = \");\r\n\t\t\tennNeighbors = (new Integer(out[1])).intValue(); // parse the string\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// into a\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// integer\r\n\r\n\t\t\tdo {\r\n\t\t\t\tline = buf_reader.readLine();\r\n\t\t\t} while (line.length() == 0);\r\n\t\t\tout = line.split(\"eta = \");\r\n\t\t\tcleanThreshold = (new Double(out[1])).doubleValue(); // parse the\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// string\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// into a\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// double\r\n\r\n\t\t\tfile_reader.close();\r\n\r\n\t\t} catch (IOException e) {\r\n\t\t\tSystem.out.println(\"IO exception = \" + e);\r\n\t\t\te.printStackTrace();\r\n\t\t\tSystem.exit(-1);\r\n\t\t}\r\n\t}", "private void readFromFile(){\n\t\t\n\t\ttry {\n\t\t\tFile file=new File(\"controller.txt\");\n\t\t\tFileInputStream fin;\n\t\t\tfin = new FileInputStream(file);\n\t\t\tDataInputStream din=new DataInputStream(fin);\n\t\t\tBufferedReader br=new BufferedReader(new InputStreamReader(din));\n\t\t\t\n\t\t\tfor(int i=0; i<2; i++){\n\t\t\t\tif(i==0)\n\t\t\t\t\tcodedUserName=br.readLine();\n\t\t\t\telse \n\t\t\t\t\tcodedPassword=br.readLine();\n\t\t\t}\n\t\t\t\n\t\t} catch (FileNotFoundException e) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\te.printStackTrace();\n\t\t} catch (IOException e) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\te.printStackTrace();\n\t\t}\n\t\t\n\t}", "protected abstract String getCommandLine() throws ConfigException;", "private void loadConfig() throws IOException {\r\n final boolean hasPropertiesFile = configFile != null && configFile.exists() \r\n && configFile.canRead() && configFile.isFile();\r\n if (hasPropertiesFile) {\r\n Properties props = new Properties();\r\n FileInputStream fis = null;\r\n try {\r\n fis = new FileInputStream(configFile);\r\n props.load(fis);\r\n Iterator<Object> keys = props.keySet().iterator();\r\n envVariables = new ArrayList<Variable>();\r\n while (keys.hasNext()) {\r\n String key = (String) keys.next();\r\n if (key.equalsIgnoreCase(GRKeys.GDAL_CACHEMAX)) {\r\n // Setting GDAL_CACHE_MAX Environment variable if available\r\n String cacheMax = null;\r\n try {\r\n cacheMax = (String) props.get(GRKeys.GDAL_CACHEMAX);\r\n if (cacheMax != null) {\r\n int gdalCacheMaxMemory = Integer.parseInt(cacheMax); // Only for validation\r\n Variable var = new Variable();\r\n var.setKey(GRKeys.GDAL_CACHEMAX);\r\n var.setValue(cacheMax);\r\n envVariables.add(var);\r\n }\r\n } catch (NumberFormatException nfe) {\r\n if (LOGGER.isLoggable(Level.WARNING)) {\r\n LOGGER.log(Level.WARNING, \"Unable to parse the specified property as a number: \"\r\n + cacheMax, nfe);\r\n }\r\n }\r\n } else if (key.equalsIgnoreCase(GRKeys.GDAL_DATA)\r\n || key.equalsIgnoreCase(GRKeys.GDAL_LOGGING_DIR)\r\n || key.equalsIgnoreCase(GRKeys.TEMP_DIR)) {\r\n // Parsing specified folder path\r\n String path = (String) props.get(key);\r\n if (path != null) {\r\n final File directory = new File(path);\r\n if (directory.exists() && directory.isDirectory()\r\n && ((key.equalsIgnoreCase(GRKeys.GDAL_DATA) && directory.canRead()) || directory.canWrite())) {\r\n Variable var = new Variable();\r\n var.setKey(key);\r\n var.setValue(path);\r\n envVariables.add(var);\r\n \r\n } else {\r\n if (LOGGER.isLoggable(Level.WARNING)) {\r\n LOGGER.log(Level.WARNING, \"The specified folder for \" + key + \" variable isn't valid, \"\r\n + \"or it doesn't exist or it isn't a readable directory or it is a \" \r\n + \"destination folder which can't be written: \" + path);\r\n }\r\n }\r\n }\r\n } else if (key.equalsIgnoreCase(GRKeys.EXECUTION_TIMEOUT)) {\r\n // Parsing execution timeout\r\n String timeout = null;\r\n try {\r\n timeout = (String) props.get(GRKeys.EXECUTION_TIMEOUT);\r\n if (timeout != null) {\r\n executionTimeout = Long.parseLong(timeout); // Only for validation\r\n }\r\n } catch (NumberFormatException nfe) {\r\n if (LOGGER.isLoggable(Level.WARNING)) {\r\n LOGGER.log(Level.WARNING, \"Unable to parse the specified property as a number: \"\r\n + timeout, nfe);\r\n }\r\n }\r\n } else if (key.equalsIgnoreCase(GRKeys.GDAL_WARP_PARAMS)\r\n || key.equalsIgnoreCase(GRKeys.GDAL_TRANSLATE_PARAMS)) {\r\n // Parsing gdal operations custom option parameters\r\n String param = (String) props.get(key);\r\n if (param != null) {\r\n if (key.equalsIgnoreCase(GRKeys.GDAL_WARP_PARAMS)) {\r\n gdalWarpingParameters = param.trim();\r\n } else {\r\n gdalTranslateParameters = param.trim();\r\n }\r\n }\r\n } else if (key.endsWith(\"PATH\")) {\r\n // Dealing with properties like LD_LIBRARY_PATH, PATH, ...\r\n String param = (String) props.get(key);\r\n if (param != null) {\r\n Variable var = new Variable();\r\n var.setKey(key);\r\n var.setValue(param);\r\n envVariables.add(var);\r\n }\r\n }\r\n }\r\n \r\n } catch (FileNotFoundException e) {\r\n if (LOGGER.isLoggable(Level.WARNING)) {\r\n LOGGER.log(Level.WARNING, \"Unable to parse the config file: \" + configFile.getAbsolutePath(), e);\r\n }\r\n \r\n } catch (IOException e) {\r\n if (LOGGER.isLoggable(Level.WARNING)) {\r\n LOGGER.log(Level.WARNING, \"Unable to parse the config file: \" + configFile.getAbsolutePath(), e);\r\n }\r\n } finally {\r\n if (fis != null) {\r\n try {\r\n fis.close();\r\n } catch (Throwable t) {\r\n // Does nothing\r\n }\r\n }\r\n }\r\n }\r\n }", "public abstract String getPropertyFile();", "public static void main(String[] args) throws IOException\r\n\t{\n\t\tFileInputStream fis=new FileInputStream(\"D:\\\\QSpiders_2019\\\\html\\\\config.properties.txt\");\r\n\t\t//Create an object of Properties class since getproperty() is a non-static method\r\n\t\tProperties prop=new Properties();\r\n\t\t//load the file into Properties class\r\n\t\tprop.load(fis);\r\n\t\t//read the data from Properties file using Key\r\n\t\tString URL =prop.getProperty(\"url\");\r\n\t\tSystem.out.println(URL);\r\n\t\tSystem.out.println(prop.getProperty(\"username\"));\r\n\t\tSystem.out.println(prop.getProperty(\"password\"));\r\n\t\tSystem.out.println(prop.getProperty(\"browser\"));\r\n\r\n\t}", "public ArrayList<HashMap<String, String>> getIniContent() {\n return this.sections;\n }", "public ConfigProperties read(File fFile) throws GUIReaderException { \n if ( fFile == null || fFile.getName().trim().equalsIgnoreCase(\"\") ) /*no filename for input */\n {\n throw new GUIReaderException\n (\"No input filename specified\",GUIReaderException.EXCEPTION_NO_FILENAME);\n }\n else /* start reading from config file */\n {\n try{ \n URL url = fFile.toURI().toURL();\n \n Map global = new HashMap(); \n Map pm = loader(url, global);\n ConfigProperties cp = new ConfigProperties ();\n cp.setGlobal(global);\n cp.setProperty(pm);\n return cp;\n \n }catch(IOException e){\n throw new GUIReaderException(\"IO Exception during read\",GUIReaderException.EXCEPTION_IO);\n }\n }\n }", "private String getNuclideLibrary(String LscIniPath) {\n\t\tTxtFileReader txtFileReader = null;\n\t\t;\n\t\ttry {\n\t\t\ttxtFileReader = new TxtFileReader(LscIniPath);\n\t\t} catch (Exception e) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\te.printStackTrace();\n\t\t}\n\t\tnuclidesLibrary = txtFileReader.nuclideLibrary;\n/*\t\tif (nuclidesLibrary != null)\n\t\t\tSystem.out.println(\"nuclidesLibrary has been got: \"\n\t\t\t\t\t+ nuclidesLibrary);*/\n\n\t\treturn nuclidesLibrary;\n\t}", "List<String> getConfigFilePaths();", "private void initPath() {\n this.IniFile = new IniFile();\n String configPath = this.getApplicationContext().getFilesDir()\n .getParentFile().getAbsolutePath();\n if (configPath.endsWith(\"/\") == false) {\n configPath = configPath + \"/\";\n }\n this.appIniFile = configPath + constants.USER_CONFIG_FILE_NAME;\n }", "public static native int getCustomSettings(byte[] info);", "private static String getConfigFile() {\n\n final String sPath = getUserFolder();\n\n return sPath + File.separator + \"sextante.settings\";\n\n }", "private static int[] internal16Readin(String name) {\n try {\n BufferedReader br = new BufferedReader(new InputStreamReader(FileUtils.getResourceInputStream(\"/luts/\" + name)));\n String strLine;\n\n int[] intArray = new int[65536];\n int counter = 0;\n while ((strLine = br.readLine()) != null) {\n\n String[] array = strLine.split(\" \");\n\n for (int i = 0; i < array.length; i++) {\n if (array[i].equals(\" \") || array[i].equals(\"\")) {\n\n } else {\n intArray[counter] = Integer.parseInt(array[i]);\n counter++;\n }\n }\n }\n br.close();\n return intArray;\n } catch (Exception e) {// Catch exception if any\n System.err.println(\"Error open internal color table \" + name);\n e.printStackTrace();\n return null;\n }\n }", "private void loadParameters() throws IOException {\n\t\tBufferedReader reader = new BufferedReader(\n\t\t\t\tnew InputStreamReader(new BufferedInputStream(Files.newInputStream(path))));\n\n\t\tdo {\n\t\t\tString line = reader.readLine();\n\t\t\tif (line == null || line.equals(\"\")) {\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tif (line.startsWith(\"--\") || line.startsWith(\" \")) {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tString[] tokens = line.trim().split(\"\\\\s+\");\n\t\t\tparameters.put(Parameter.valueOf(tokens[0]), tokens[1]);\n\t\t} while (true);\n\n\t}", "private void readData() {\n try (BufferedReader br = new BufferedReader(new InputStreamReader(getClass().getClassLoader().getResourceAsStream(fileName)))) {\n String line;\n while ((line = br.readLine()) != null) {\n String[] parts = line.split(\",\");\n int zip = Integer.parseInt(parts[0]);\n String name = parts[1];\n\n zipMap.put(zip, name);\n }\n } catch (IOException e) {\n e.printStackTrace();\n }\n }", "static String readResource(String name) throws IOException {\n InputStream is = Server.class.getResourceAsStream(name);\n String value = new Scanner(is).useDelimiter(\"\\\\A\").next();\n is.close();\n return value;\n }", "private static InputStream readFile(String path)\n\t{\n\t\tInputStream input = NativeLibraryLoader.class.getResourceAsStream(\"/\" + path);\n\t\tif (input == null)\n\t\t{\n\t\t\tthrow new RuntimeException(\"Unable to find file: \" + path);\n\t\t}\n\t\treturn input;\n\t}", "private double[] getSettings() {\n\t\t\n\t\tdouble[] params;\n\t\tString inLine, fileName = \"settings.txt\";\n\t\tString[] tokens;\n\t\t\n\t\tint numParams = 8;\n\t\tparams = new double[numParams];\n\t\t\n\t\t// Perform the read in a catch block in case of exceptions\n\t\ttry {\n\t\t\n\t\t\t// Create a new buffered reader\n\t\t\tFile inFile = new File(fileName);\n\t\t\tFileInputStream fis = new FileInputStream(inFile);\n\t\t\tInputStreamReader isr = new InputStreamReader(fis, \"UTF8\");\n\t\t\tBufferedReader br = new BufferedReader(isr);\n\t\t\t\n\t\t\t// Loop over the lines, reading the parameters into the array\n\t\t\tfor(int i = 0; i < numParams; i++) {\n\t\t\t\tinLine = br.readLine();\n\t\t\t\ttokens = inLine.split(\"=\");\n\t\t\t\tparams[i] = Double.parseDouble(tokens[1].replaceAll(\" \", \"\"));\n\t\t\t}\n\t\t\t\n\t\t\t// Close the reader\n\t\t\tbr.close();\n\t\t}\n\n\t\t// Catch errors\n\t\tcatch(Exception e) {\n\t\t\tSystem.out.println(\"Error reading from settings file.\");\n\t\t\tSystem.exit(0);\n\t\t}\t\n\t\treturn params;\n\t}", "public static Scanner openInput(String fname){\n\t Scanner infile = null;\n\t try {\n\t infile = new Scanner(new File(fname));\n\t } catch(FileNotFoundException e) {\n\t System.out.printf(\"Cannot open file '%s' for input\\n\", fname);\n\t System.exit(0);\n\t }\n\t return infile;\n\t }", "@Test\r\n public void introspectConfiguration() {\r\n HelpConfigStreamConsumer consumer = new HelpConfigStreamConsumer();\r\n consumer.consumeLine(\"iMaker 09.24.01, 10-Jun-2009.\");\r\n consumer.consumeLine(\"Finding available configuration file(s):\");\r\n consumer.consumeLine(\"/epoc32/rom/config/platform/product/image_conf_product.mk\");\r\n consumer.consumeLine(\"/epoc32/rom/config/platform/product/image_conf_product_ui.mk\");\r\n consumer.consumeLine(\"X:/epoc32/rom/config/platform/product/image_conf_product.mk\");\r\n consumer.consumeLine(\"X:/epoc32/rom/config/platform/product/image_conf_product_ui.mk\");\r\n consumer.consumeLine(\"\");\r\n \r\n // Verifying string output\r\n String[] expected = new String[4];\r\n expected[0] = \"/epoc32/rom/config/platform/product/image_conf_product.mk\";\r\n expected[1] = \"/epoc32/rom/config/platform/product/image_conf_product_ui.mk\";\r\n expected[2] = \"X:/epoc32/rom/config/platform/product/image_conf_product.mk\";\r\n expected[3] = \"X:/epoc32/rom/config/platform/product/image_conf_product_ui.mk\";\r\n assertArrayEquals(expected, consumer.getConfigurations().toArray(new String[4]));\r\n\r\n // Verifying the file output\r\n File[] expectedFile = new File[4];\r\n if (new File(\"/epoc32/rom/config/platform/product/image_conf_product.mk\").isAbsolute()) {\r\n // Unix like os\r\n expectedFile[0] = new File(\"/epoc32/rom/config/platform/product/image_conf_product.mk\");\r\n expectedFile[1] = new File(\"/epoc32/rom/config/platform/product/image_conf_product_ui.mk\");\r\n expectedFile[2] = new File(new File(\".\"), \"X:/epoc32/rom/config/platform/product/image_conf_product.mk\");\r\n expectedFile[3] = new File(new File(\".\"), \"X:/epoc32/rom/config/platform/product/image_conf_product_ui.mk\");\r\n } else {\r\n // Windows like os\r\n expectedFile[0] = new File(new File(\".\"), \"/epoc32/rom/config/platform/product/image_conf_product.mk\");\r\n expectedFile[1] = new File(new File(\".\"), \"/epoc32/rom/config/platform/product/image_conf_product_ui.mk\");\r\n expectedFile[2] = new File(\"X:/epoc32/rom/config/platform/product/image_conf_product.mk\");\r\n expectedFile[3] = new File(\"X:/epoc32/rom/config/platform/product/image_conf_product_ui.mk\");\r\n }\r\n assertArrayEquals(expectedFile, consumer.getConfigurations(new File(\".\")).toArray(new File[4]));\r\n }", "public StringTokenizer getNIC() {\n\n String targetFile = \"/etc/path_to_inst\";\n StringTokenizer nicTokStrg = null;\n\n try {\n\n FileReader fr = new FileReader(targetFile);\n BufferedReader br = new BufferedReader(fr);\n\n String line = null;\n String nicStrg = \" \";\n\n while((line = br.readLine()) != null) {\n StringTokenizer tokStrg = new StringTokenizer(line, \"\\\"\");\n\n if(tokStrg.countTokens() == 3) {\n\n String notUsed = tokStrg.nextToken();\n String indexStrg = tokStrg.nextToken().trim();\n String nameStrg = tokStrg.nextToken().trim();\n\n if(nameStrg.equals(\"le\") || nameStrg.equals(\"hme\")) {\n nicStrg = nicStrg + \" \" + nameStrg + indexStrg;\n }\n }\n }\n\n if(nicStrg.trim().length() > 0) {\n nicTokStrg = new StringTokenizer(nicStrg);\n }\n fr.close();\n\n } catch(FileNotFoundException f) {\n //ignore\n //setLabel(targetFile + \" not found.\");\n }\n catch(IOException g) {\n //setLabel(\"Error reading \" + targetFile );\n }\n\n return nicTokStrg;\n }", "public void read() {\n\t\tconfigfic = new Properties();\n\t\tInputStream input = ConfigReader.class.getClassLoader().getResourceAsStream(\"source/config.properties\");\n\t\t// on peut remplacer ConfigReader.class par getClass()\n\t\ttry {\n\t\t\tconfigfic.load(input);\n\t\t} catch (IOException e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t}", "String readConfig(String parameter, SignedObject accessToken) throws RemoteException, rmi.AuthenticationException;", "public InputReader() throws FileNotFoundException, TransformerConfigurationException {\n this.csvlocation = System.getProperty(Static.SYSYEM_PROPERTY_FILE);\n this.templatelocation = System.getProperty(Static.SYSTEM_PROPERTY_TEMPLATE_FILE);\n init();\n }", "protected String readFile(int resourceFile) {\n Context context = getContext();\n if (context != null) {\n try {\n InputStream is = context.getResources().openRawResource(resourceFile);\n return Okio.buffer(Okio.source(is)).readString(Charset.defaultCharset());\n } catch (IOException e) {\n Log.e(TAG, \"Failed to read config\", e);\n }\n }\n return \"\";\n }", "protected String readUnicodeInputStream(InputStream in) throws IOException {\n\t\tUnicodeReader reader = new UnicodeReader(in, null);\n\t\tString data = FileCopyUtils.copyToString(reader);\n\t\treader.close();\n\t\treturn data;\n\t}", "protected synchronized Hashtable getMappingsFromFile() throws Exception {\n\n \t\n\t\tInputStream path = null;\n\n\t\tpath = getClass().getResourceAsStream(\"../../../config/mappings.txt\");\n\n\t\tSystem.out.println(\"Path is - \" + path);\n\n\t\tBufferedReader reader = new BufferedReader(new InputStreamReader(path));\n/*\t\tStringBuilder sb = new StringBuilder();\n\t\tString line1 = null;\n\t\twhile ((line1 = reader.readLine()) != null) {\n\t\t\tsb.append(line1 + \"\\n\");\n\t\t}\n*/\t\t//System.out.println(\"String is - \" + sb.toString());\n\t\t\n/* \tFile f = new File(\"src/edu/ucsd/crbs/incf/components/services/emage/mappings.txt\");\n System.out.println(\"Mapping - \" + f.getAbsolutePath());\n\n*/ /*if(sb.toString().trim().equals(\"\") || sb.toString() == null ) {\n System.err.println(\"bisel.ReadMappings cannot find mapping file\");\n System.exit(1);\n }*/\n\n Hashtable mappings = new Hashtable(17, new Float(1.25).floatValue());\n\n\n //BufferedReader br = new BufferedReader(new FileReader(f));\n String line = reader.readLine();\n while(line != null) { \n StringTokenizer st = new StringTokenizer(line, \"*\");\n String aba = st.nextToken();\n String emap = st.nextToken();\n mappings.put(aba, emap);\n line = reader.readLine();\n }\n\n reader.close();\n return mappings;\n }", "public Long getInfile_()\n{\nreturn getInputDataItemId(\"infile_\");\n}", "private static Scanner determineInputSource(String[] args) throws FileNotFoundException{\n if (args.length > 0) {\n //Reading from file\n return new Scanner(new File(args[0]));\n }\n else {\n //Reading from standard Input\n return new Scanner(System.in);\n }\n }", "private BufferedReader inFromFile(String indexFullName) \n {\n try \n { return new BufferedReader( new FileReader( new File( indexFullName ) ) ); } \n catch (FileNotFoundException e) \n {\n log.warn( \"could not find index file \" + indexFullName + \": no bindings created\" );\n return new BufferedReader( new EmptyReader() );\n }\n }", "static String read ()\r\n \t{\r\n \t\tString sinput;\r\n \r\n \t\ttry\r\n \t\t{\r\n \t\t\tsinput = br.readLine();\r\n \t\t}\r\n \t\tcatch (IOException e)\r\n \t\t{\r\n \t\t\tErrorLog.addError(\"Input exception occured in command line interface!\");\r\n \t\t\treturn null; //Menu will exit when fed a null\r\n \t\t}\r\n \t\treturn sinput;\r\n \t}", "protected String readSettings() {\n String output = \"\";\n for (String setting: settings.keySet()) {\n String value = settings.get(setting);\n output += setting + \":\" + value + \"\\n\";\n }\n return output;\n }", "private void getEnvironment(Environment env, FileProcess file) {\n\t\tint t = 0;\n\t\tboolean setReg = false, setFlag = false, setMem = false;\n\t\twhile (true) {\n\t\t\tString temp = file.getLineAt(t);\n\n\t\t\tif (temp == null || temp == \"\") {\n\t\t\t\treturn;\n\t\t\t} else if (temp.contains(\"Register\")) {\n\t\t\t\ttemp = temp.substring(temp.indexOf(\":\") + 1, temp.length());\n\t\t\t\tString[] reg = temp.split(\",\");\n\t\t\t\tfor (int i = 0; i < reg.length; i++) {\n\t\t\t\t\treg[i] = reg[i].replace(\" \", \"\");\n\t\t\t\t\tString r[] = reg[i].split(\"=\");\n\n\t\t\t\t\tenv.getRegister().setRegisterValue(r[0], new LongValue(Long.parseLong(r[1], 16)));\t\t\t\t\t\n\t\t\t\t}\n\t\t\t\tsetReg = true;\n\t\t\t} else if (temp.contains(\"Flag\")) {\n\t\t\t\ttemp = temp.substring(temp.indexOf(\":\") + 1, temp.length());\n\t\t\t\tString[] reg = temp.split(\",\");\n\t\t\t\tfor (int i = 0; i < reg.length; i++) {\n\t\t\t\t\treg[i] = reg[i].replace(\" \", \"\");\n\t\t\t\t\tString r[] = reg[i].split(\"=\");\n\n\t\t\t\t\tif (r[1].toLowerCase().contains(\"true\")) {\n\t\t\t\t\t\tenv.getFlag().setFlagValue(r[0], new BooleanValue(true));\n\t\t\t\t\t} else {\n\t\t\t\t\t\tenv.getFlag().setFlagValue(r[0], new BooleanValue(false));\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tsetFlag = true;\n\t\t\t} else if (temp.contains(\"Memory\")) {\n\t\t\t\ttemp = temp.substring(temp.indexOf(\":\") + 1, temp.length());\n\t\t\t\tString[] reg = temp.split(\",\");\n\t\t\t\tfor (int i = 0; i < reg.length; i++) {\n\t\t\t\t\treg[i] = reg[i].replace(\" \", \"\");\n\t\t\t\t\tString r[] = reg[i].split(\"=\");\n\t\t\t\t\tString addr = r[0].replace(\"0x\", \"\");\n\t\t\t\t\tlong x = Long.parseLong(addr, 16);\n\t\t\t\t\tbyte y = (byte) Long.parseLong(reduce(r[1], 8), 16);\n\t\t\t\t\tenv.getMemory().setByteMemoryValue(x, new LongValue(y));\n\t\t\t\t}\n\t\t\t\tsetMem = true;\n\t\t\t} \n\t\t\tt++;\n\t\t\t\n\t\t\tif (setReg && setFlag && setMem) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\n\t}", "private void ini_Translations()\r\n\t{\r\n\t\tLogger.DEBUG(\"ini_Translations\");\r\n\t\tnew Translation(\"data\", FileType.Internal);\r\n\t\ttry\r\n\t\t{\r\n\t\t\tTranslation.LoadTranslation(\"data/lang/en-GB/strings.ini\");\r\n\t\t}\r\n\t\tcatch (IOException e)\r\n\t\t{\r\n\t\t\te.printStackTrace();\r\n\t\t}\r\n\t}", "private void ReadTextFile(String FilePath) {\n\t\t\n\t\t\n\t}", "public static void readInFile(Scanner inFile) {\n\t\twhile(inFile.hasNext()) {\n\t\t\tString strIn = inFile.nextLine();\n\t\t\tSystem.out.println(strIn);\n\t\t}\n\t\tinFile.close();\n\t}", "static Map<String, String> readPasswdFile (File pwdFile) throws IOException {\n\t\tBufferedReader r = new BufferedReader(new FileReader(pwdFile));\n\t\tHashtable users = new Hashtable();\n\t\tString l = r.readLine();\n\t\twhile (l != null) {\n\t\t\tint hash = l.indexOf('#');\n\t\t\tif (hash != -1)\n\t\t\t\tl = l.substring(0, hash);\n\t\t\tl = l.trim();\n\t\t\tif (l.length() != 0) {\n\t\t\t\tStringTokenizer t = new StringTokenizer(l, \":\");\n\t\t\t\tString user = t.nextToken();\n\t\t\t\tString password = t.nextToken();\n\t\t\t\tusers.put(user, password);\n\t\t\t}\n\t\t\tl = r.readLine();\n\t\t}\n\t\tr.close();\n\t\treturn users;\n\t}", "public static void main(String[] args) {\n\t\tpublic static CfgSingletonfactory getpropertiesfromFile() {\r\n\t\t\t\r\n\t\t}\r\n\r\n\t}", "public In(){\n\t\tscanner=new Scanner(new BufferedInputStream(System.in),CHARSET_NAME);\n\t\tscanner.useLocale(LOCALE);\n\t}", "public Properties loadConfig(){\n\t\tprintln(\"Begin loadConfig \");\n\t\tProperties prop = null;\n\t\t prop = new Properties();\n\t\ttry {\n\t\t\t\n\t\t\tprop.load(new FileInputStream(APIConstant.configFullPath));\n\n\t } catch (Exception ex) {\n\t ex.printStackTrace();\n\t println(\"Exception \"+ex.toString());\n\t \n\t }\n\t\tprintln(\"End loadConfig \");\n\t\treturn prop;\n\t\t\n\t}", "String readCfg(File cfgFile)\n { this.fileCfg = cfgFile;\n String sError = null;\n BufferedReader reader = null;\n try{\n reader = new BufferedReader(new FileReader(cfgFile));\n } catch(FileNotFoundException exc){ sError = \"TabSelector - cfg file not found; \" + cfgFile; }\n if(reader !=null){\n try{ \n listAllFavorPathFolders.clear();\n String sLine;\n int posSep;\n //List<GralFileSelector.FavorPath> list = null;\n FcmdFavorPathSelector.FavorFolder favorTabInfo = null;\n StringPart spLine = new StringPart();\n StringBuilder uLine = new StringBuilder(1000);\n //boolean bAll = true;\n while( sError == null && (sLine = reader.readLine()) !=null){\n if(sLine.contains(\"$\")){\n uLine.append(sLine.trim());\n spLine.assignReplaceEnv(uLine);\n sLine = uLine.toString();\n } else {\n sLine = sLine.trim();\n spLine.assign(sLine);\n }\n if(sLine.length() >0){\n if( sLine.startsWith(\"==\")){\n posSep = sLine.indexOf(\"==\", 2); \n //a new division\n final String sDiv = sLine.substring(2,posSep).trim();\n final int pos1 = sDiv.indexOf(':');\n final String sLabel = pos1 >=0 ? sDiv.substring(0, pos1).trim() : sDiv;\n final int pos2 = sDiv.indexOf(',');\n //sDivText is the same as sLabel if pos1 <0 \n final String sDivText = pos2 >=0 ? sDiv.substring(pos1+1, pos2).trim() : sDiv.substring(pos1+1).trim(); \n final String sSelect = pos2 >=0 ? sDiv.substring(pos2): \"\";\n favorTabInfo = null; //selectListOverview.get(sDiv);\n if(favorTabInfo == null){\n favorTabInfo = new FcmdFavorPathSelector.FavorFolder(sLabel, sDivText);\n if(sSelect.indexOf('l')>=0){ favorTabInfo.mMainPanel |=1;}\n if(sSelect.indexOf('m')>=0){ favorTabInfo.mMainPanel |=2;}\n if(sSelect.indexOf('r')>=0){ favorTabInfo.mMainPanel |=4;}\n listAllFavorPathFolders.add(favorTabInfo);\n }\n ///\n /*\n if(sDiv.equals(\"left\")){ list = panelLeft.selectListAllFavorites; }\n else if(sDiv.equals(\"mid\")){ list = panelMid.selectListAllFavorites; }\n else if(sDiv.equals(\"right\")){ list = panelRight.selectListAllFavorites; }\n else if(sDiv.equals(\"all\")){ list = selectAll; }\n else { sError = \"Error in cfg file: ==\" + sDiv + \"==\"; }\n */\n } else if(favorTabInfo !=null){ \n String[] sParts = sLine.trim().split(\",\");\n if(sParts.length < 2){ \n sError = \"SelectTab format error; \" + sLine; \n } else {\n //info. = sParts[0].trim();\n String selectName = sParts[0].trim();\n String path = sParts[1].trim();\n GralFileSelector.FavorPath favorPathInfo = new GralFileSelector.FavorPath(selectName, path, main.fileCluster);\n if(sParts.length >2){\n final String actTabEntry = sParts[2].trim();\n //final String actTab;\n /*\n final int posColon = actTabEntry.indexOf(':');\n if(posColon >0){\n String sPanelChars = actTabEntry.substring(0, posColon);\n actTab = actTabEntry.substring(posColon+1).trim();\n if(sPanelChars.indexOf('l')>=0){ info.mMainPanel |= 1; } \n if(sPanelChars.indexOf('m')>=0){ info.mMainPanel |= 2; } \n if(sPanelChars.indexOf('r')>=0){ info.mMainPanel |= 4; } \n } else {\n actTab = actTabEntry.trim();\n }\n info.label = actTab;\n */\n }\n //info.active = cActive;\n //list.add(info);\n favorTabInfo.listfavorPaths.add(favorPathInfo);\n }\n }\n }\n uLine.setLength(0);\n }//while\n spLine.close();\n } \n catch(IOException exc){ sError = \"selectTab - cfg file read error; \" + cfgFile; }\n catch(IllegalArgumentException exc){ sError = \"selectTab - cfg file error; \" + cfgFile + exc.getMessage(); }\n catch(Exception exc){ sError = \"selectTab - any exception; \" + cfgFile + exc.getMessage(); }\n try{ reader.close(); reader = null; } catch(IOException exc){} //close is close.\n }\n return sError;\n }", "public Map<String, File> getInLines() {\r\n\t\treturn inLines;\r\n\t}", "public static String[] getUserInput() throws IOException{\n\t\t//Declare variables to read the file.\n\t\tFileInputStream inFile;\n\t\tInputStreamReader inReader;\n\t\tBufferedReader reader;\n\t\t\n\t\t//The test file that I used in order to run the program.\n\t\tString input = \"test.txt\";\n\t\t\n\t\t//Process the file, get it into a bufferedreader\n\t\tinFile = new FileInputStream (input);\n\t\tinReader = new InputStreamReader(inFile);\n\t\treader = new BufferedReader(inReader);\n\n\t\t//The only reason I do this thing where I make a big long string and then break it up\n\t\t//Is because I wasn't too sure about the rules surrounding things we haven't learned (Arrays)\n\t\tString fileData = \"\";\n\t\t\n\t\t//If there's more data, add the line to the end of the FileData String, with a space in between.\n\t\twhile(reader.ready()){\n\t\t\tfileData += (reader.readLine() + \" \");\n\t\t}\n\t\t\n\t\t//Then, break that line up into an array using the split function.\n\t\treturn breakInput(fileData);\n\t}", "private static void readSiteConfig() {\n\n\t\ttry(BufferedReader br = new BufferedReader(new FileReader(\"SiteConfiguration.txt\"))) {\n\t\t\twhile (br.ready()) {\n\t\t\t\tString line = br.readLine().strip().toUpperCase();\n\t\t\t\tSite readSite = new Site(line);\n\n\t\t\t\tsites.putIfAbsent(readSite.getSiteName(), readSite);\n\t\t\t}\n\t\t}catch (IOException ioe) {\n\t\t\tlogger.log(Level.WARNING, \"Could not read SiteConfig file properly! \" + ioe);\n\t\t}\n\t}" ]
[ "0.5890178", "0.5688023", "0.5680303", "0.56350964", "0.55298495", "0.5502592", "0.54222655", "0.5376899", "0.5368613", "0.5353768", "0.5326466", "0.5249664", "0.52364993", "0.51919025", "0.51643157", "0.5143627", "0.5138968", "0.5132742", "0.5049769", "0.504556", "0.5035538", "0.50261897", "0.5010582", "0.500523", "0.49886283", "0.49828228", "0.49691293", "0.49367875", "0.49361762", "0.4932313", "0.49167198", "0.49162337", "0.49143803", "0.490884", "0.49064547", "0.49034393", "0.48992983", "0.4877701", "0.48662668", "0.48638728", "0.48005122", "0.47904715", "0.47903508", "0.477987", "0.47597185", "0.4751228", "0.47417414", "0.47153407", "0.47137633", "0.4706411", "0.4692073", "0.46890575", "0.4680676", "0.4678997", "0.46731186", "0.46476752", "0.46454972", "0.46414295", "0.46214414", "0.46124658", "0.46114218", "0.46112567", "0.46008274", "0.45930263", "0.45912543", "0.4582908", "0.4582741", "0.4582517", "0.4574218", "0.45726475", "0.45677927", "0.45661435", "0.4559072", "0.4548547", "0.4545001", "0.45383283", "0.4535486", "0.45189607", "0.4517476", "0.45047757", "0.45011574", "0.4500207", "0.450012", "0.44991505", "0.4498012", "0.44956136", "0.44886118", "0.44824395", "0.44778523", "0.4474261", "0.4473967", "0.4472641", "0.4454586", "0.44485494", "0.443922", "0.4433984", "0.44324026", "0.4431921", "0.4431448", "0.4430826" ]
0.53927517
7
end READINI method to get file extension of a file
public String getFileExtension(File objFile) { String sFileName = null; String sExtension = null; try { if (!objFile.exists()) { throw new Exception("File does not exists"); } sFileName = objFile.getName(); int i = sFileName.lastIndexOf('.'); if (i > 0) { sExtension = sFileName.substring(i + 1).trim(); } } catch (Exception e) { println("Methods.getFileExtension : " + e.toString()); sExtension = ""; } finally { return sExtension; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public int lookupReadFileExtension(String extension);", "String getFileExtension();", "public String getReadFileExtension(int formatIndex);", "private static char getFileExt(String file) {\r\n \treturn file.charAt(file.indexOf('.')+1);\r\n }", "public String getFileExtension();", "protected abstract String getFileExtension();", "public String getExt() {\n\t\treturn IpmemsFile.getFileExtension(file);\n\t}", "private static String getFileExtension(String fileName) {\r\n\t\tString ext = IConstants.emptyString;\r\n\t\tint mid = fileName.lastIndexOf(\".\");\r\n\t\text = fileName.substring(mid + 1, fileName.length());\r\n\t\tSystem.out.println(\"File Extension --\" + ext);\r\n\t\treturn ext;\r\n\t}", "private String getExtension(java.io.File file){\n String name = file.getName();\n int idx = name.lastIndexOf(\".\");\n if (idx > -1) return name.substring(idx+1);\n else return \"\";\n }", "private String getTypeFromExtension()\n {\n String filename = getFileName();\n String ext = \"\";\n\n if (filename != null && filename.length() > 0)\n {\n int index = filename.lastIndexOf('.');\n if (index >= 0)\n {\n ext = filename.substring(index + 1);\n }\n }\n\n return ext;\n }", "public abstract String getFileExtension();", "String getExtension();", "String getFileExtensionByFileString(String name);", "private static String getFileExtension(File cFile) {\n\t\tString oldname = cFile.getName();\r\n\t\tString extension = oldname.substring(oldname.lastIndexOf(\".\"));\r\n\t\treturn extension;\r\n\t}", "public int lookupWriteFileExtension(String extension);", "@Override\r\n public String getExtension() {\r\n if (extension == null) {\r\n getBaseName();\r\n final int pos = baseName.lastIndexOf('.');\r\n // if ((pos == -1) || (pos == baseName.length() - 1))\r\n // [email protected]: Review of patch from [email protected]\r\n // do not treat file names like\r\n // .bashrc c:\\windows\\.java c:\\windows\\.javaws c:\\windows\\.jedit c:\\windows\\.appletviewer\r\n // as extension\r\n if (pos < 1 || pos == baseName.length() - 1) {\r\n // No extension\r\n extension = \"\";\r\n } else {\r\n extension = baseName.substring(pos + 1).intern();\r\n }\r\n }\r\n return extension;\r\n }", "public String getFileExtension() {\n return toString().toLowerCase();\n }", "private String getFileExtension(String fileName) {\n return fileName.substring(fileName.lastIndexOf('.') + 1);\n }", "private String getExtension(File aFile) {\n String ext = null;\n String s = aFile.getName();\n int i = s.lastIndexOf('.');\n\n if (i > 0 && i < s.length() - 1) {\n ext = s.substring(i + 1).toLowerCase();\n }\n\n return ext;\n }", "public String extension() {\n int dot = fullPath.lastIndexOf(extensionSeparator);\n return fullPath.substring(dot + 1);\n }", "private String getFileExtension(File f) {\n String fileName = f.getName();\n return getFileExtension(fileName);\n }", "public static String getFileExtension() {\n return fileExtension;\n }", "public String getWriteFileExtension(int formatIndex);", "public static String getExt(File song)\n\t{\n\t\treturn song.getName().substring(song.getName().lastIndexOf('.') + 1);\n\t}", "private String getExtension(File f) {\n\t\tString e = null;\n\t\tString s = f.getName();\n\t\tint i = s.lastIndexOf('.');\n\n\t\tif (i > 0 && i < s.length() - 1) {\n\t\t\te = s.substring(i + 1).toLowerCase();\n\t\t}\n\t\treturn e;\n\t}", "public String getExtension() {\r\n\t\t\tfinal String filename = path.getName();\r\n\t\t\tfinal int dotIndex = filename.lastIndexOf('.');\r\n\t\t\tif (dotIndex >= 0) {\r\n\t\t\t\tif (dotIndex == filename.length() - 1) {\r\n\t\t\t\t\treturn \"\"; // dot is the last char in filename\r\n\t\t\t\t} else {\r\n\t\t\t\t\treturn filename.substring(dotIndex + 1);\r\n\t\t\t\t}\r\n\t\t\t} else {\r\n\t\t\t\treturn \"\"; // no dot in filename\r\n\t\t\t}\r\n\t\t}", "public String getFileExtension() {\r\n return Generator.ANIMALSCRIPT_FORMAT_EXTENSION;\r\n }", "public String getFileExtension() {\r\n\t\treturn this.fileExtension;\r\n\t}", "java.lang.String getExtensionText();", "public static String getExtension(File file) {\r\n String ext = null;\r\n String s = file.getName();\r\n int i = s.lastIndexOf('.');\r\n if(i > 0 && i < s.length() - 1) {\r\n ext = s.substring(i + 1).toLowerCase();\r\n }\r\n return ext;\r\n }", "public final String getExtension(File f) {\n\t String ext = null;\n\t String s = f.getName();\n\t int i = s.lastIndexOf('.');\n\n\t if (i > 0 && i < s.length() - 1) {\n\t ext = s.substring(i+1).toLowerCase();\n\t }\n\t return ext;\n\t }", "public static String getFileExtension(String f) {\n\t\tif (f == null) return \"\";\n\t\tint lastIndex = f.lastIndexOf('.');\n\t\treturn lastIndex > 0 ? f.substring(lastIndex + 1) : \"\";\n\t}", "public String getExtension() {\n\t\t\n\t\tString result = null;\n\t\t\n\t\tif(this.get(this.lenght - 1).contains(\".\"))\n\t\t{\n\t\t\tString temp = this.get(this.lenght - 1);\n\t\t\t\n\t\t\tString[] parts = temp.split(\"\\\\.\");\n\t\t\t\n\t\t\tresult = parts[parts.length - 1];\n\t\t}\n\t\telse\n\t\t\tresult = \"\";\n\t\t\n\n\t\treturn result;\n\t}", "public static String getExtension(final String file) throws IOException {\n return FilenameUtils.getExtension(file);\n }", "public String fileExtension() {\r\n return getContent().fileExtension();\r\n }", "public String getExtension(File f) {\n\t\t\tString ext = null;\n\t\t\tString s = f.getName();\n\t\t\tint i = s.lastIndexOf('.');\n\n\t\t\tif (i > 0 && i < s.length() - 1)\n\t\t\t\text = s.substring(i + 1).toLowerCase();\n\t\t\treturn ext;\n\t\t}", "private String getExtension(String path){\n System.out.println(\"Начато получение расширения: \");\n if (path.contains(\".\")){\n int dot = path.lastIndexOf(\".\");\n System.out.println(\"return \"+path.substring(dot, path.length()));\n return path.substring(dot, path.length());\n } else {\n// System.out.println(\"return \\\"\\\"\");\n return \"\";\n }\n }", "public static String getExtension(File f) {\n String ext = null;\n String s = f.getName();\n int i = s.lastIndexOf(\".\");\n ext = s.substring(i+1).toLowerCase();\n return ext;\n }", "String getOutputExtension();", "final public String getExtension()\n\t{\n\t\treturn this.getLocation().getExtension(); \n\t}", "public String getFileExtension(File file) {\n String name = file.getName();\n try {\n return name.substring(name.lastIndexOf(\".\") + 1);\n } catch (Exception e) {\n return \"\";\n }\n }", "public static String getExtension(File file) {\n\t\tString ext = null;\n\t\tString fileName = file.getName();\n\t\tint i = fileName.lastIndexOf('.');\n\n\t\tif (i > 0 && i < fileName.length() - 1) {\n\t\t\text = fileName.substring(i+1).toLowerCase();\n\t\t}\n\t\treturn ext;\n\t}", "public final String getExtension(File f) {\n String ext = null;\n String s = f.getName();\n int i = s.lastIndexOf('.');\n\n if (i > 0 && i < s.length() - 1) {\n ext = s.substring(i+1).toLowerCase();\n }\n return ext;\n }", "public static String getExtension(File f) {\n String ext = null;\n String s = f.getName();\n int i = s.lastIndexOf('.');\n\n if (i > 0 && i < s.length() - 1) {\n ext = s.substring(i + 1).toLowerCase();\n }\n\n return ext;\n }", "public static String getExtn(String fileName)\r\n\t{\r\n\t\tString res=\"\";\r\n\t\tfor(int i=fileName.length()-1;i>=0;i--)\r\n\t\t{\r\n\t\t\tif(fileName.charAt(i)!='.')\r\n\t\t\t\tres=fileName.charAt(i)+res;\r\n\t\t\telse \r\n\t\t\t\tbreak;\r\n\t\t}\r\n\t\treturn res;\r\n\t}", "public String getDefaultExtension() {\n return \"ino\";\n }", "public static String getFileExtension(String filePath) {\n if (filePath == null || filePath.isEmpty()) {\n return \"\";\n }\n\n int extenPosi = filePath.lastIndexOf(\".\");\n int filePosi = filePath.lastIndexOf(File.separator);\n if (extenPosi == -1) {\n return \"\";\n }\n return (filePosi >= extenPosi) ? \"\" : filePath.substring(extenPosi + 1);\n }", "public static String getFileExtension(File f) {\r\n\tfinal int idx = f.getName().indexOf(\".\");\r\n\tif (idx == -1)\r\n\t return \"\";\r\n\telse\r\n\t return f.getName().substring(idx + 1);\r\n }", "public String getOutputExtension(String inputExtension);", "public static String getFileExtension(File f) {\n\t\tString fileName = f.getName();\n\t\tint lastIndex = fileName.lastIndexOf('.');\n\t\treturn lastIndex > 0 ? fileName.substring(lastIndex + 1) : \"\";\n\t}", "private String retrieveFileExtension(String targetFile)\r\n\t{\r\n\t\tString result = \"\";\r\n\t\tfor (int index = targetFile.length(); index > 0; index--)\r\n\t\t{\r\n\t\t\tif (targetFile.charAt(index - 1) == '.')\r\n\t\t\t{\r\n\t\t\t\tresult = targetFile.substring(index, targetFile.length());\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t}\r\n\t\tif (result.equals(targetFile))\r\n\t\t\treturn \"\";\r\n\t\treturn result;\r\n\t}", "public final String getCurrentExt() {\n FileFilter filter = this.getFileFilter();\n if (filter instanceof ExtensionFileFilter) {\n return ((ExtensionFileFilter)filter).getExt();\n }\n return null;\n }", "public static String GetFileExtension(String filePath) {\n\n\t\tint index = filePath.lastIndexOf('.');\n\t\tif (index > 0) {\n\t\t\treturn filePath.substring(index + 1);\n\t\t}\n\n\t\treturn \"\";\n\t}", "private static String getFileTagsBasedOnExt(String fileExt) {\n String fileType = new Tika().detect(fileExt).replaceAll(\"/.*\", \"\");\n return Arrays.asList(EXPECTED_TYPES).contains(fileType) ? fileType : null;\n }", "@CheckForNull\n String getPreferredExtension();", "private String extensions() {\n return Arrays.stream(f.getName().split(\"\\\\.\")).skip(1).collect(Collectors.joining(\".\"));\n }", "private String getFileExtension(String mimeType) {\n mimeType = mimeType.toLowerCase();\n if (mimeType.equals(\"application/msword\")) {\n return \".doc\";\n }\n if (mimeType.equals(\"application/vnd.ms-excel\")) {\n return \".xls\";\n }\n if (mimeType.equals(\"application/pdf\")) {\n return \".pdf\";\n }\n if (mimeType.equals(\"text/plain\")) {\n return \".txt\";\n }\n\n return \"\";\n }", "public String getExtension() {\n return extension;\n }", "public String getExtension() {\n return extension;\n }", "private static String getExtensionOrFileName(String filename, boolean extension) {\n\n\t\tString fileWithExt = new File(filename).getName();\n\t\tStringTokenizer s = new StringTokenizer(fileWithExt, \".\");\n\t\tif (extension) {\n\t\t\ts.nextToken();\n\t\t\treturn s.nextToken();\n\t\t} else\n\t\t\treturn s.nextToken();\n\t}", "public static String getExtension(final File file) throws IOException {\n return FilenameUtils.getExtension(file.getName());\n }", "public static FileFormat getFileFormat(String ext)\r\n {\r\n return getFileFormat(ext, null);\r\n }", "public static String getFileExtension(File aFile) {\n\t\tString returnMe = aFile.getName().substring(\n\t\t\t\taFile.getName().lastIndexOf('.') + 1);\n\t\treturn returnMe;\n\t}", "public static String getFileExtension(URL url) {\n\t\tString fileName = url.getFile();\n\t\tint lastIndex = fileName.lastIndexOf('.');\n\t\treturn lastIndex > 0 ? fileName.substring(lastIndex + 1) : \"\";\n\t}", "public static String sourceExtension()\n {\n read_if_needed_();\n \n return _ext; \n }", "public static String getExtension(String img) {\n String[] arr = img.split(\"\\\\.\");\n return arr[arr.length - 1];\n }", "public String getExtension() {\n return extension;\n }", "public static String getFileExtension(File file) {\r\n String fileName = file.getName();\r\n if(fileName.lastIndexOf(\".\") != -1 && fileName.lastIndexOf(\".\") != 0)\r\n return fileName.substring(fileName.lastIndexOf(\".\")+1).toLowerCase();\r\n else return \"\";\r\n }", "@Pure\n\tpublic String getScriptFileExtension() {\n\t\treturn this.fileExtension;\n\t}", "public String getFileExt(File fileName) {\n return fileName.getName()\n .substring(fileName.getName().lastIndexOf('.'));\n }", "protected String getExtension() {\n\t\treturn \"\";\n\t}", "public static String GetFileExtension(String hint) {\n int dotIndex = hint.lastIndexOf(\".\");\n if (dotIndex > 0) {\n return hint.substring(dotIndex + 1).toLowerCase();\n }\n return \"\";\n }", "public static String getFileExtension(String filename) {\n\t\tif(filename.indexOf(\".\") == -1)\n\t\t\treturn \"\";\n\t\t\n\t\treturn \".\"+filename.substring(filename.lastIndexOf(\".\")+1);\n\t}", "String validateAllowedExtensions(File fileNamePath) {\n\t\tString fileName = fileNamePath.getName();\r\n\t\t\r\n\t\t//Get the index based on the extension into the string\r\n\t\tint lastIndex = fileName.lastIndexOf(\".\");\r\n\t\t\r\n\t\t//Get substring/extension from the string\r\n\t\tString extension = fileName.substring(lastIndex).toUpperCase();\r\n\t\t\r\n\t\tif (extension.equalsIgnoreCase(\"GIF\")) {\r\n\t\t\treturn extension;\r\n\t\t}\r\n\t\t\r\n\t\tif (extension.equalsIgnoreCase(\"JPG\")) {\r\n\t\t\treturn extension;\r\n\t\t}\r\n\t\t\r\n\t\tif (extension.equalsIgnoreCase(\"TXT\")) {\r\n\t\t\treturn extension;\r\n\t\t}\r\n\t\t\r\n\t\t// There is no extension for the file\r\n\t\tif (lastIndex == -1) {\r\n\t\t\treturn \"\";\r\n\t\t}\r\n\t\t\r\n\t\t// No valid extension\r\n\t\treturn \"\";\r\n\t\t\r\n\t}", "public String getExtension(File f) {\n\t if(f != null) {\n\t String filename = f.getName();\n\t int i = filename.lastIndexOf('.');\n\t if(i>0 && i<filename.length()-1) {\n\t\t return filename.substring(i+1).toLowerCase();\n\t }\n\t }\n\t return null;\n }", "public static String getFileExtension(String fileName) {\n return fileName.trim().substring(fileName.indexOf('.'));\n }", "private void getDetailsOfFiles(){\n\t\tString path = tfile.getAbsolutePath();\n\t\t\n\t\ttype = path.substring(path.lastIndexOf('.')+1);\n\t\t\n\t\tif(path.contains(\"/\")){\n\t\t\tfileName = path.substring(path.lastIndexOf(\"/\")+1);\n\t\t}else if(path.contains(\"\\\\\")){\n\t\t\tfileName = path.substring(path.lastIndexOf(\"\\\\\")+1);\n\t\t}\n\t}", "String getContentType(String fileExtension);", "public String getDefaultInputExtension();", "public String getExtension(String url) {\n\t\tint dotIndex = url.lastIndexOf('.');\n\t\tString extension = null;\n\t\tif (dotIndex > 0) {\n\t\t\textension = url.substring(dotIndex + 1);\n\t\t}\n\t\treturn extension;\n\t}", "public abstract String getFileFormatName();", "public static String getSlideFileExtension(String slideRef) {\n\t\t// Determine the file extension for this slide\n\t\treturn FilenameUtils.getExtension(slideRef);\n\t}", "public String getExtensions()\n {\n return ext;\n }", "public static String getFileExtension(String filename) {\n\t\t\n\t\tint periodIndex = filename.lastIndexOf(\".\");\n\t\t\n\t\tif(periodIndex == -1) {\n\t\t\treturn null;\n\t\t}\n\t\t\n\t\tif(periodIndex == filename.length() - 1) {\n\t\t\treturn null;\n\t\t}\n\t\t\n\t\treturn filename.substring(periodIndex + 1, filename.length());\n\t}", "public String getFormatByExtension(String fileExtenstion) throws DataServiceException{\r\n\t\tString format = \"\";\r\n\t\tformat = (String)queryForObject(\"document.query_format\",fileExtenstion);\r\n\t\treturn format;\r\n\t}", "default String fileExtension() {\n\t\treturn \".json\";\n\t}", "public static String extractExtension(String filename)\n\t{\n\t\treturn ImageWriterFilter.extractExtension(filename);\n\t}", "String getSkipExtension();", "public static String getFileExtention(String file_path)\n {\n String file_name = getFileName(file_path);\n int index = file_name.lastIndexOf(46);\n\n if (index >= 0)\n return file_name.substring(index + 1);\n\n return \"\";\n }", "public String getExtName(String szMIMEType)\r\n { \r\n if (szMIMEType == null)\r\n return null;\r\n\r\n Object extension = m_hashTableExt.get(szMIMEType);\r\n\r\n if (extension == null) \r\n return null;\r\n return (String)extension;\r\n }", "private String retrieveFileNameWithOutExt(String targetFile)\r\n\t{\r\n\t\tfor (int index = targetFile.length(); index > 0; index--)\r\n\t\t{\r\n\t\t\tif (targetFile.charAt(index - 1) == '.')\r\n\t\t\t{\r\n\t\t\t\ttargetFile = targetFile.substring(0, index - 1);\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn targetFile;\r\n\t}", "public String getDataFileExtension() {\r\n return dataFileExtension;\r\n }", "public List<String> getFileExtensions()\n/* */ {\n/* 619 */ if ((useRegisteredSuffixPatternMatch()) && (this.contentNegotiationManager != null)) {\n/* 620 */ return this.contentNegotiationManager.getAllFileExtensions();\n/* */ }\n/* 622 */ return null;\n/* */ }", "public static String getFileExtension(File f) {\n String name = f.getName();\n int index = name.lastIndexOf(\".\");\n if(index == -1) return null;\n \n // the file must have a name other than the extension\n if(index == 0) return null;\n \n // if the last character of the string is the \".\", then there's\n // no extension\n if(index == (name.length()-1)) return null;\n \n return name.substring(index+1);\n }", "public static String getExt(String name) {\n\t\tif (name == null) return null;\n\t\tint s = name.lastIndexOf('.');\n\t\treturn s == -1 ? null : s == 0 ? name : name.substring(s);\n\t}", "@Internal(\"Represented as part of archiveName\")\n public String getExtension() {\n return extension;\n }", "default String getFileExtension() {\n return \"bin\";\n }", "public static String defaultFileExtension() {\n return \"dot\";\n }", "@XmlElement\n @Nullable\n public String getFileExtension() {\n return this.fileExtension;\n }", "public String findExtension(String lang) {\n if (lang == null)\n return \".txt\";\n else if (lang.equals(\"C++\"))\n return \".cpp\";\n else if (lang.equals(\"C\"))\n return \".c\";\n else if (lang.equals(\"PYT\"))\n return \".py\";\n else if (lang.equals(\"JAV\"))\n return \".java\";\n else\n return \".txt\";\n }" ]
[ "0.75096524", "0.7453803", "0.74021757", "0.7398774", "0.7342182", "0.71963286", "0.71880794", "0.7173616", "0.7138183", "0.7102335", "0.70659584", "0.7053923", "0.70193297", "0.6866675", "0.684527", "0.67864954", "0.67847335", "0.67681336", "0.67617553", "0.6751575", "0.6748448", "0.6741213", "0.67409736", "0.6730523", "0.6712584", "0.6680013", "0.6639436", "0.662329", "0.66171837", "0.66039515", "0.6594629", "0.6559938", "0.6548799", "0.6548777", "0.6542257", "0.65289295", "0.6515238", "0.6507015", "0.6506505", "0.6503858", "0.6491732", "0.64901024", "0.6477921", "0.64736164", "0.6436558", "0.64217347", "0.6402024", "0.63978356", "0.6389712", "0.6371861", "0.6369177", "0.63660866", "0.6360581", "0.6351889", "0.6344881", "0.6336453", "0.63145375", "0.63144237", "0.63144237", "0.6310482", "0.62905693", "0.6286131", "0.62765205", "0.62764096", "0.6265457", "0.6257884", "0.6253958", "0.624524", "0.6232216", "0.62176466", "0.6180323", "0.6125403", "0.6119928", "0.61122525", "0.6099565", "0.6095244", "0.6085555", "0.6078231", "0.60746056", "0.60486317", "0.6035511", "0.60330945", "0.6019827", "0.6016163", "0.6008585", "0.5978967", "0.5976236", "0.596386", "0.59486175", "0.59479904", "0.5943717", "0.59366405", "0.5920115", "0.59136075", "0.5886443", "0.58851886", "0.58718365", "0.585772", "0.5840205", "0.5823903" ]
0.6811519
15
method to sort file object by ites name
public File[] SortFilesByName(final File[] Files, final boolean bCaseSensitive, final boolean bSortDesecnding) { File[] faFiles = null; Comparator<File> comparator = null; try { faFiles = Files.clone(); if (faFiles == null) { throw new Exception("Null File Array Object"); } //check if array consists of more than 1 file if (faFiles.length > 1) { //creating Comparator comparator = new Comparator<File>() { @Override protected Object clone() throws CloneNotSupportedException { return super.clone(); //To change body of generated methods, choose Tools | Templates. } @Override public int compare(File objFile1, File objFile2) { String Str1 = objFile1.getName(); String Str2 = objFile2.getName(); if (bCaseSensitive) { int iRetVal = objFile1.getName().compareTo(objFile2.getName()); return iRetVal; } else { int iRetVal = objFile1.getName().compareToIgnoreCase(objFile2.getName()); return iRetVal; } } }; //Sorting Array if (bSortDesecnding) {//Descending } else {//Ascending Arrays.sort(faFiles, comparator); } } } catch (Exception e) { faFiles = null; } finally { return faFiles; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\n public int compare(File o1, File o2) {\n if (desc) {\n return -o1.getFileName().compareTo(o2.getFileName());\n }\n return o1.getFileName().compareTo(o2.getFileName());\n }", "private void sort() {\n setFiles(getFileStreamFromView());\n }", "public void sortByName(String file) throws FileNotFoundException, IOException, ParseException {\n\t\tarrayList = pareseFile(file);\n\t\tFile file1 = new File(file);\n\t\t/*\n\t\t * for (int i = 0; i < arrayList.size(); i++) { JSONObject\n\t\t * person1=(JSONObject)arrayList.get(i); //person1.get(\"lastName\");\n\t\t * arrayList.sort((Person.CompareByName)person1); }\n\t\t */\n\t\t// mapper.writeValue(file1, arrayList);\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(\"lastName\").toString()).compareToIgnoreCase(person2.get(\"lastName\").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 int compareTo (Object o) {\n return getFileName ().compareTo (((Page)o).getFileName());\n }", "public static File[] getSortedFiles(File[] files){\n Arrays.sort(files, new Comparator<File>() {\t\n \tpublic int compare(File o1, File o2){\n \t\tint n1 = getPageSequenceNumber(o1.getName());\n \t\tint n2 = getPageSequenceNumber(o2.getName());\n \t\treturn n1 - n2;\n \t}\n });\n \n return files;\n\t}", "@Override\n\tpublic int compare(File f1, File f2) {\n\t\treturn f1.compareTo(f2);\n\t}", "private static File[] sortFileList(File[] list, String sort_method) {\n // sort the file list based on sort_method\n // if sort based on name\n if (sort_method.equalsIgnoreCase(\"name\")) {\n Arrays.sort(list, new Comparator<File>() {\n public int compare(File f1, File f2) {\n return (f1.getName()).compareTo(f2.getName());\n }\n });\n }\n else if (sort_method.equalsIgnoreCase(\"size\")) {\n Arrays.sort(list, new Comparator<File>() {\n public int compare(File f1, File f2) {\n return Long.valueOf(f1.length()).compareTo(f2.length());\n }\n });\n }\n else if (sort_method.equalsIgnoreCase(\"time\")) {\n Arrays.sort(list, new Comparator<File>() {\n public int compare(File f1, File f2) {\n return Long.valueOf(f1.lastModified()).compareTo(f2.lastModified());\n }\n });\n }\n return list;\n }", "private static File[] sortFileList(File[] list, String sort_method) {\n // sort the file list based on sort_method\n // if sort based on name\n if (sort_method.equalsIgnoreCase(\"name\")) {\n Arrays.sort(list, new Comparator<File>() {\n public int compare(File f1, File f2) {\n return (f1.getName()).compareTo(f2.getName());\n }\n });\n } else if (sort_method.equalsIgnoreCase(\"size\")) {\n Arrays.sort(list, new Comparator<File>() {\n public int compare(File f1, File f2) {\n return Long.valueOf(f1.length()).compareTo(f2.length());\n }\n });\n } else if (sort_method.equalsIgnoreCase(\"time\")) {\n Arrays.sort(list, new Comparator<File>() {\n public int compare(File f1, File f2) {\n return Long.valueOf(f1.lastModified()).compareTo(f2.lastModified());\n }\n });\n }\n return list;\n }", "public String sortBy();", "@Override\n public void sortCurrentList(FileSortHelper sort) {\n }", "public static void ascendingOrder(File folder) {\n try {\n\n folder.exists();\n File[] listOfFiles = folder.listFiles();\n Arrays.sort(listOfFiles);\n if (listOfFiles.length > 0) {\n for(int i = 0; i < listOfFiles.length; i++) {\n\n System.out.println(\"File :\" + listOfFiles[i].getName());\n }\n } else {\n System.out.println(\"No Files in the folder\");\n }\n } catch (Exception e) {\n System.out.println(e.getMessage());\n }\n }", "public ArrayList<String> getSortedNames() throws Exception {\n FileReader fileReader = new FileReader();\n // Tell FileReader the file path\n fileReader.setFilePath(\"src/main/java/ex41/base/exercise41_input.txt\");\n // use FileReader to get an Arraylist and store it\n ArrayList<String> names = fileReader.getStrings();\n // call sort method to sort arraylist and return that\n return sort(names);\n }", "public static List<File> sortByName(List<File> files) {\n\t\tComparator<File> comp = new Comparator<File>() {\n\t\t\t@Override\n\t\t\tpublic int compare(File file1, File file2) {\n\t\t\t\treturn file1.getName().compareTo(file2.getName());\n\t\t\t}\n\t\t};\n\t\tCollections.sort(files, comp);\n\t\treturn files;\n\t}", "public String doSort();", "public void testCompareViaSort() throws Exception {\n\n String correctlySortedNames[] = {\n \"0000_aaa\",\n \"0000_bbb\",\n \"1111DC_U_022107_L99_Sum.lsm\",\n \"6325DC_U_022107_L0_Sum.lsm\",\n \"6325DC_U_022107_L1_Sum.lsm\",\n \"6325DC_U_022107_L2_Sum.lsm\",\n \"6325DC_U_022107_L8_Sum.lsm\",\n \"6325DC_U_022107_L9_Sum.lsm\",\n \"6325DC_U_022107_L10_Sum.lsm\",\n \"6325DC_U_022107_L11_Sum.lsm\",\n \"6325DC_U_022107_L20_Sul.lsm\",\n \"6325DC_U_022107_L20_Sum.lsm\",\n \"6325DC_U_022107_L20_Sun.lsm\",\n \"6325DC_U_022107_L21_Sum.lsm\",\n \"6325DC_U_022107_L22_Sum.lsm\",\n \"6325DC_U_022107_L99_Sum.lsm\",\n \"6325DC_U_022107_L111_Sum.lsm\",\n \"6325DC_U_022107_L222_Sum.lsm\",\n \"7777DC_U_022107_L22_Sum.lsm\",\n \"9999_aaa\",\n \"9999_bbb\" \n };\n\n FileTarget[] targets = new FileTarget[correctlySortedNames.length];\n\n int index = 0;\n for (String name : correctlySortedNames) {\n int reverseOrder = targets.length - 1 - index;\n File file = new File(name);\n targets[reverseOrder] = new FileTarget(file);\n index++;\n }\n\n Arrays.sort(targets, new LNumberComparator());\n\n index = 0;\n for (FileTarget target : targets) {\n assertEquals(\"name \" + index + \" of \" + targets.length +\n \" was not sorted correctly\",\n correctlySortedNames[index], target.getName());\n index++;\n }\n }", "@Override\n public int compare(FileNameExtensionFilter ext1, FileNameExtensionFilter ext2)\n {\n return ext1.getDescription().toLowerCase().compareTo(ext2.getDescription().toLowerCase());\n }", "public File[] SortFilesByDate(final File[] Files, final boolean bSortDesecnding) {\n\n File[] faFiles = null;\n Comparator<File> comparator = null;\n\n try {\n faFiles = Files.clone();\n if (faFiles == null) {\n throw new Exception(\"Null File Array Object\");\n }\n\n //check if array consists of more than 1 file\n if (faFiles.length > 1) {\n\n //creating Comparator\n comparator = new Comparator<File>() {\n\n @Override\n protected Object clone() throws CloneNotSupportedException {\n return super.clone(); //To change body of generated methods, choose Tools | Templates.\n }\n\n @Override\n public int compare(File objFile1, File objFile2) {\n String Str1 = objFile1.getName();\n String Str2 = objFile2.getName();\n if (bSortDesecnding) {\n int iRetVal = objFile1.getName().compareTo(objFile2.getName());\n return iRetVal;\n } else {\n int iRetVal = objFile1.getName().compareToIgnoreCase(objFile2.getName());\n return iRetVal;\n }\n }\n };\n\n //Sorting Array\n Arrays.sort(faFiles, comparator);\n }\n\n } catch (Exception e) {\n faFiles = null;\n } finally {\n return faFiles;\n }\n\n }", "public static <T extends FileData> void sortFileDataByOrder(List<T> fileDataToSort) {\n Collections.sort(fileDataToSort, new Comparator<T>() {\n public int compare(T o1, T o2) {\n int ret = Integer.valueOf(o1.getOrder()).compareTo(o2.getOrder());\n if (ret != 0) {\n return ret;\n }\n return OID.compareOids(o1.getUniqueOid(), o2.getUniqueOid());\n }\n });\n }", "private void sortFileToScreen() throws FileNotFoundException {\n Scanner file = new Scanner(new File(FILE_NAME));\n while (file.hasNext()) {\n addToOrderedList(file.nextInt());\n }\n file.close();\n printList();\n }", "public static void sortFiles(List<File> files)\r\n\t{\r\n\t\t/*\r\n\t\t * bubblesort algorithm\r\n\t\t */\r\n\t\tboolean changesMade = true;\r\n\t\t\r\n\t\twhile (changesMade)\r\n\t\t{\r\n\t\t\tchangesMade = false;\r\n\t\t\t\r\n\t\t\tfor(int x=1; x<files.size(); x++)\r\n\t\t\t{\r\n\t\t\t\t/*\r\n\t\t\t\t * if file at index x has a lower number than the file\r\n\t\t\t\t * at index x-1\r\n\t\t\t\t */\r\n\t\t\t\tif(getFileNum(files.get(x)) < getFileNum(files.get(x-1)))\r\n\t\t\t\t{\r\n\t\t\t\t\t/*\r\n\t\t\t\t\t * put this file in the previous index\r\n\t\t\t\t\t */\r\n\t\t\t\t\tFile tempFile = files.get(x);\r\n\t\t\t\t\tfiles.remove(x);\r\n\t\t\t\t\tfiles.add(x-1, tempFile);\r\n\t\t\t\t\t\r\n\t\t\t\t\t//indicate changes were made\r\n\t\t\t\t\tchangesMade = true;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t\r\n\t\t}\r\n\t\t\r\n\t}", "@Override\n\tpublic int compareTo(File pathname) {\n\t\treturn this.index - new IndexedFile(pathname.getAbsolutePath()).index;\n\t}", "ArrayList<String> sortFiles(String[] allFiles){\n\n ArrayList<String> tempArrayList = new ArrayList<String>();\n ArrayList<String> returnArrayList = new ArrayList<String>();\n String[] tempArray = allFiles;\n String[] returnArray;\n\n int numOfFiles = tempArray.length;\n\n //delete nonneeded files\n for(int k = 0; k < numOfFiles; k++){\n if (tempArray[k].startsWith(\"G-\") || tempArray[k].startsWith(\"M-\") || tempArray[k].startsWith(\"I-\")){\n tempArrayList.add(tempArray[k]);\n }\n }\n\n returnArray = new String[tempArrayList.size()];\n for(int i = 0; i < tempArrayList.size(); i++){\n returnArray[i] = tempArrayList.get(i);\n }\n\n //if 0 return empty array\n if (returnArray.length < 2){\n return returnArrayList;\n }\n\n //bubble sort\n for (int i = 0; i < returnArray.length-1; i++){\n for (int j = 0; j < returnArray.length-i-1; j++){\n //get string of full number from file\n String tempFirst = returnArray[j].split(\"_\")[2] + returnArray[j].split(\"_\")[3];\n String tempSecond = returnArray[j+1].split(\"_\")[2] + returnArray[j+1].split(\"_\")[3];\n //take out csv if it is not a subgraph\n if (!tempFirst.contains(\"_subgraph_\")){\n tempFirst = tempFirst.substring(0,14);\n }\n if (!tempSecond.contains(\"_subgraph_\")){\n tempSecond = tempSecond.substring(0,14);\n }\n //get int of string\n long tempFirstNum = Long.parseLong(tempFirst);\n long tempSecondNum = Long.parseLong(tempSecond);\n //compare and swap if bigger\n if (tempFirstNum >= tempSecondNum)\n {\n String temp = returnArray[j];\n returnArray[j] = returnArray[j+1];\n returnArray[j+1] = temp;\n }\n }\n }\n\n //add elements to arraylist with newest date being first\n for(int k = returnArray.length-1; k >= 0; k--){\n returnArrayList.add(returnArray[k]);\n System.out.println(allFiles[k]);\n }\n\n return returnArrayList;\n }", "protected void sortCode() {\n for (int i = 1; i < codeCount; i++) {\n int who = i;\n for (int j = i + 1; j < codeCount; j++) {\n if (code[j].getFileName().compareTo(code[who].getFileName()) < 0) {\n who = j; // this guy is earlier in the alphabet\n }\n }\n if (who != i) { // swap with someone if changes made\n SketchCode temp = code[who];\n code[who] = code[i];\n code[i] = temp;\n }\n }\n }", "@Override\n public int compareTo(final ModelFile o) {\n final ModelFile otherModelFile = ((ModelFile) o);\n return this.file.getFullPath().toString().compareTo(otherModelFile.file.getFullPath().toString());\n }", "public File sort(String path){\n try {\r\n File file = new File(path);\r\n BufferedReader readStream = new BufferedReader(new FileReader(file));\r\n String currentLine;\r\n int index = 0;\r\n int fileNumber = 1;\r\n while((currentLine = readStream.readLine()) != null){\r\n tempArray[index++] = currentLine;//read next line into the temporary array\r\n if(index >= limit){//check whether the number of lines stored in the temp has reached the maximum allowed\r\n Arrays.sort(tempArray);//sort tempArray\r\n Writer writeStream = null;//create a writer\r\n String currentFileName = \"temp\" + fileNumber + \".txt\";//this name is passed to the buffered writer\r\n writeStream = new BufferedWriter(new OutputStreamWriter(new FileOutputStream(currentFileName)));//create a new temporary file to be written to\r\n fileArrayList.add(new File(currentFileName));//add file to list\r\n for(String line : tempArray){// write the lines currently stored in the array into the newly created file\r\n writeStream.write(line);\r\n writeStream.write(\"\\n\");\r\n }\r\n writeStream.close();//close the output stream\r\n index = 0;//reset\r\n ++fileNumber;//increment the file number so that the next block of lines is written to a different file name\r\n }\r\n\r\n\r\n }\r\n readStream.close();\r\n }catch(Exception e){\r\n System.out.println(e.getMessage() + \" occurred during split\");\r\n }\r\n\r\n //merge temporary files and write to output file\r\n try {\r\n System.out.println(Arrays.toString(fileArrayList.toArray()));\r\n fileArrayList.trimToSize();\r\n int sortedFileID = 0;//used to differentiate between temporary files while merging\r\n int head = 0;//used to access file names stored in array list from the start\r\n int tail = fileArrayList.size() - 1;//used to access file names stored in array list from the end\r\n while(fileArrayList.size() > 1) {\r\n sortedFileID++;//increment to create a unique file name\r\n String mergedFileName = \"sorted\"+sortedFileID+\".txt\";\r\n File firstFile = fileArrayList.get(head);\r\n File secondFile = fileArrayList.get(tail);\r\n System.out.println(head + \" + \" + tail);\r\n //merge first and second\r\n File combinedFile = mergeFiles(firstFile, secondFile, mergedFileName);\r\n //delete both temporary files once they are merged\r\n\r\n if(!secondFile.delete()){\r\n System.out.println(\"warning file could not be deleted\");\r\n }\r\n if(!firstFile.delete()){\r\n System.out.println(\"warning file could not be deleted\");\r\n }\r\n fileArrayList.set(head, combinedFile);//replace the first of the two merged files with the new combined file\r\n fileArrayList.remove(tail);//remove the second of the two merged files\r\n head++;//increment both indexes one position closer towards the center of the array list\r\n tail--;\r\n if(head >= tail){//check if there are no remaining files between the head and the tail\r\n head = 0;//reset to the beginning of the array list\r\n fileArrayList.trimToSize();\r\n tail = fileArrayList.size() - 1;//reset to the end of the array list\r\n }\r\n }\r\n }catch(Exception e){\r\n System.out.println(e.getMessage() + \" occurred during merge\");\r\n }\r\n //after iteratively merging head and tail, and storing the result at the head index\r\n //the final resulting file that combines all temporary files will be stored at index (0)\r\n return fileArrayList.get(0);//return the final combined file\r\n }", "public static void main(String[] args) throws FileNotFoundException, IOException {\n BufferedReader br = new BufferedReader(new FileReader(\"D:\\\\name-sorter\\\\unsorted-names-list.txt\"));\n \n // Step 5: Create an ArrayList to hold the Person objects.\n ArrayList<Person> listPersonNames = new ArrayList<Person>();\n \n // Step 6 : Read every person record from input text file. For each person record, \n // create one person object and add that person object into listPersonNames.\n String line = br.readLine();\n \n while(line != null){\n String[] names = line.split(\" \");\n\n String givenNames = \"\";\n for(int a=0; a < names.length-1; a++){\n givenNames += names[a];\n givenNames += \" \";\n }\n \n String lastName = names[names.length-1];\n \n listPersonNames.add(new Person(givenNames, lastName));\n \n line = br.readLine();\n }\n \n // Step 7 : Sort the ArrayList listPersonNames using Collections.sort() method by passing \n // NamesCompare object to sort the text file.\n Collections.sort(listPersonNames, new NamesCompare());\n \n // Step 8 : Create BufferedWriter object to write the records into output text file.\n BufferedWriter writer = new BufferedWriter(new FileWriter(\"D:\\\\name-sorter\\\\sorted-names-list.txt\"));\n \n // Step 9 : Write each listPersonNames into output text file.\n for (Person person : listPersonNames){\n writer.write(person.givenNames);\n writer.write(\" \"+person.lastName);\n writer.newLine();\n \n System.out.println(person.givenNames+\" \"+person.lastName);\n }\n \n // Step 10 : Close the resources.\n br.close();\n writer.close();\n }", "public static void sort(File input, File output) throws IOException {\n ExternalSort.mergeSortedFiles(ExternalSort.sortInBatch(input), output);\n }", "private Stream<File> sort(final Stream<File> fileStream) {\n return fileStream.sorted(new FileMetaDataComparator(callback.orderByProperty().get(),\n callback.orderDirectionProperty().get()));\n }", "public FileMergeSort() {\r\n }", "@Override\r\n\tpublic int compare(FileBean bean1, FileBean bean2) {\r\n\t\t// TODO Auto-generated method stub\r\n\t\treturn bean1.compareTo(bean2);\r\n\t}", "static void doSort(int location) throws Exception {\n\n\t\tList<String> sortedList = null;\n\n\t\tsortedList = readDataFile(DividedfileList.get(location));\n\t\tCollections.sort(sortedList);\n\t\twriteFile(sortedList, location);\n\t\tsortedList.clear();\n\n\t}", "@Override\r\n\tpublic int compareTo(FileBean bean) {\r\n\t\tif(this.getLocation().compareTo(bean.getLocation()) > 0){\r\n\t\t\treturn 1;\r\n\t\t}else if(this.getLocation().compareTo(bean.getLocation()) < 0){\r\n\t\t\treturn -1;\r\n\t\t} else{\r\n\t\t\treturn 0;\r\n\t\t}\r\n\t}", "public static void main(String[] args) {\n\n File folder = new File(\"D:\\\\UNSORTED TBW\\\\\");\n File[] listOfFiles = folder.listFiles();\n String defaultPath = \"D:\\\\UNSORTED TBW\\\\\";\n\n\n //for loop for each file in the list\n for (int i = 0; i < listOfFiles.length; i++) {\n if (listOfFiles[i].isFile()) {\n\n //splits file name with - Only want the name before - so we call for 0.\n //This is the deafult way of show my shows are sorted.\n // also adds a - in the string in case there is no - in file\n String fileName = listOfFiles[i].getName() + \"-\";\n String[] names = fileName.split(\"-\");\n //System.out.print(names[0]+\"\\n\");\n Path folderPath = Paths.get(defaultPath + names[0].trim() + \"\\\\\");\n System.out.print(folderPath + \"\\n\");\n File directory = new File(String.valueOf(folderPath));\n\n //checks if directory exists. if does not exist, make new directory.\n if (!directory.exists()) {\n //makes a directory if not exists\n directory.mkdir();\n }\n //sets initial file directory\n File dirA = listOfFiles[i];\n //renames the file path of the file i nthe if loop\n //returns a user response if successful or not\n if (dirA.renameTo(new File(String.valueOf(folderPath) + \"\\\\\" + dirA.getName()))) {\n System.out.print(\"Move success\");\n } else {\n System.out.print(\"Failed\");\n }\n }\n }\n }", "public int compare(File file, File file2) {\n if (file == null || file2 == null || file.lastModified() >= file2.lastModified()) {\n return (file == null || file2 == null || file.lastModified() != file2.lastModified()) ? 1 : 0;\n }\n return -1;\n }", "public int compare(File file, File file2) {\n if (file.lastModified() > file2.lastModified()) {\n return 1;\n }\n if (file.lastModified() == file2.lastModified()) {\n return 0;\n }\n return -1;\n }", "public int compareTo(AppFile aAF)\n{\n if(_priority!=aAF._priority) return _priority>aAF._priority? -1 : 1;\n return _file.compareTo(aAF._file);\n}", "@Override\n public void sort() throws IOException {\n long i = 0;\n // j represents the turn of writing the numbers either to g1 or g2 (or viceversa)\n long j = 0;\n long runSize = (long) Math.pow(2, i);\n long size;\n\n long startTime = System.currentTimeMillis();\n\n System.out.println(\"Strart sorting \"+ this.inputFileName);\n\n while(i <= Math.ceil(Math.log(this.n) / Math.log(2))){\n j = 0;\n do{\n size = merge(runSize, destinationFiles[(int)j % 2]);\n j += 1;\n }while (size/2 == runSize);\n\n System.out.println(\"iteration: \" + i + \", Run Size:\" + runSize + \", Total time elapsed: \" + (System.currentTimeMillis() - startTime));\n i += 1;\n runSize = (long) Math.pow(2, i);\n swipe();\n }\n System.out.println(\"The file has been sorted! Total time elapsed: \"+(System.currentTimeMillis() - startTime));\n\n destinationFiles[0].close();\n destinationFiles[1].close();\n originFiles[0].close();\n originFiles[1].close();\n\n createFile(OUT_PATH +inputFileName);\n copyFile(new File(originFileNames[0]), new File(\"out/TwoWayMergesort/OUT_\"+inputFileName));\n\n }", "void sortName()\r\n\t{\r\n\t\tCollections.sort(this, this.ContactNameComparator);\r\n\t}", "public int compare(File file, File file2) {\n int i = ((file.lastModified() - file2.lastModified()) > 0 ? 1 : ((file.lastModified() - file2.lastModified()) == 0 ? 0 : -1));\n if (i > 0) {\n return 1;\n }\n return i == 0 ? 0 : -1;\n }", "@Override\r\n\t\t\tpublic int compare(File o1, File o2) {\n\t\t\t\treturn Long.compare(o2.lastModified(), o1.lastModified());\r\n\t\t\t}", "@Override\r\n\t\t\tpublic int compare(File o1, File o2) {\n\t\t\t\treturn Long.compare(o1.lastModified(), o2.lastModified());\r\n\t\t\t}", "public int compare(File file, File file2) {\n if (file == null || file2 == null || file.lastModified() >= file2.lastModified()) {\n return (file == null || file2 == null || file.lastModified() != file2.lastModified()) ? 1 : 0;\n }\n return -1;\n }", "public int compare(File file, File file2) {\n int i = ((file.lastModified() - file2.lastModified()) > 0 ? 1 : ((file.lastModified() - file2.lastModified()) == 0 ? 0 : -1));\n if (i > 0) {\n return 1;\n }\n return i == 0 ? 0 : -1;\n }", "public int compare(File file, File file2) {\n int i = ((file.lastModified() - file2.lastModified()) > 0 ? 1 : ((file.lastModified() - file2.lastModified()) == 0 ? 0 : -1));\n if (i > 0) {\n return 1;\n }\n return i == 0 ? 0 : -1;\n }", "private static void sortNoun() throws Exception{\r\n\t\tBufferedReader[] brArray = new BufferedReader[ actionNumber ];\r\n\t\tBufferedWriter[] bwArray = new BufferedWriter[ actionNumber ];\r\n\t\tString line = null;\r\n\t\tfor(int i = 0; i < actionNameArray.length; ++i){\r\n\t\t\tSystem.out.println(\"sorting for \" + actionNameArray[ i ]);\r\n\t\t\tbrArray[ i ] = new BufferedReader( new FileReader(TFIDF_URL + actionNameArray[ i ] + \".tfidf\"));\r\n\t\t\tHashMap<String, Double> nounTFIDFMap = new HashMap<String, Double>();\r\n\t\t\tint k = 0;\r\n\t\t\t// 1. Read tfidf data\r\n\t\t\twhile((line = brArray[ i ].readLine())!=null){\r\n\t\t\t\tnounTFIDFMap.put(nounList.get(k), Double.parseDouble(line));\r\n\t\t\t\tk++;\r\n\t\t\t}\r\n\t\t\tbrArray[ i ].close();\r\n\t\t\t// 2. Rank according to tfidf\r\n\t\t\tValueComparator bvc = new ValueComparator(nounTFIDFMap);\r\n\t\t\tTreeMap<String, Double> sortedMap = new TreeMap<String, Double>(bvc);\r\n\t\t\tsortedMap.putAll(nounTFIDFMap);\r\n\t\t\t\r\n\t\t\t// 3. Write to disk\r\n\t\t\tbwArray[ i ] = new BufferedWriter(new FileWriter( SORTED_URL + actionNameArray[ i ] + \".sorted\"));\r\n\t\t\tfor(String nounKey : sortedMap.keySet()){\r\n\t\t\t\tbwArray[ i ].append(nounKey + \"\\t\" + nounTFIDFMap.get(nounKey) + \"\\n\");\r\n\t\t\t}\r\n\t\t\tbwArray[ i ].close();\r\n\t\t}\r\n\t}", "public void f4(List<Book> a) {\r\n Collections.sort(a, new Comparator<Book>() {\r\n @Override\r\n public int compare(Book o1, Book o2) {\r\n String txt1[] = o1.getName().split(\" \");\r\n String txt2[] = o2.getName().split(\" \");\r\n String lastName1 = txt1[txt1.length - 1];\r\n String lastName2 = txt2[txt2.length - 1];\r\n return lastName1.compareToIgnoreCase(lastName2);\r\n }\r\n });\r\n\r\n }", "public void sort () {\n\t\t\n\t\t// Clear iterator\n\t\titer = null;\n\t\t\n\t\tCollections.sort(this.pathObjects, new Comparator<PathObject>() {\n\t\t @Override\n\t\t public int compare(PathObject lhs, PathObject rhs) {\n\t\t // -1 - less than, 1 - greater than, 0 - equal, all inversed for descending\n\t\t return Double.compare(lhs.getClassProbability(), rhs.getClassProbability()); // Use double compare to safely handle NaN and Infinity\n\t\t }\n\t\t});\n\t\t\n\t\titer = this.pathObjects.iterator();\n\t}", "public int getResourceSort(@Param(\"id\") String id);", "private Sort sortByLastNameAsc() {\n return new Sort(Sort.Direction.ASC, \"remName\");\n }", "@Override\n public int compare(File arg0, File arg1) {\n long diff = arg0.lastModified() - arg1.lastModified();\n if (diff > 0)\n return -1;\n else if (diff == 0)\n return 0;\n else\n return 1;\n }", "public void step3(){\n\n Collections.sort(names,(String a, String b) -> a.compareTo(b));\n }", "public void step1(){\n\n Collections.sort(names, new Comparator<String>() {\n @Override\n public int compare(String a, String b) {\n return b.compareTo(a);\n }\n });\n }", "public void sort() {\n }", "private String doSortOrder(SlingHttpServletRequest request) {\n RequestParameter sortOnParam = request.getRequestParameter(\"sortOn\");\n RequestParameter sortOrderParam = request.getRequestParameter(\"sortOrder\");\n String sortOn = \"sakai:filename\";\n String sortOrder = \"ascending\";\n if (sortOrderParam != null\n && (sortOrderParam.getString().equals(\"ascending\") || sortOrderParam.getString()\n .equals(\"descending\"))) {\n sortOrder = sortOrderParam.getString();\n }\n if (sortOnParam != null) {\n sortOn = sortOnParam.getString();\n }\n return \" order by @\" + sortOn + \" \" + sortOrder;\n }", "private void sortTravelContactsByName() {\n Collections.sort(this.contacts, new Comparator<User>(){\n public int compare(User obj1, User obj2) {\n // ## Ascending order\n return obj1.getSortingStringName().compareToIgnoreCase(obj2.getSortingStringName());\n }\n });\n }", "public int compare(File file, File file2) {\n return Long.valueOf(file.lastModified()).compareTo(Long.valueOf(file2.lastModified()));\n }", "public TextFileComparator(String f1, String f2) {\n\t\tfileName1 = f1;\n\t\tfileName2 = f2;\n\t\tcompareFiles();\n\t}", "public void sort() {\n documents.sort();\n }", "private void testZipfileOrder(Path out) throws IOException {\n ZipFile outZip = new ZipFile(out.toFile());\n Enumeration<? extends ZipEntry> entries = outZip.entries();\n int index = 0;\n LinkedList<String> entryNames = new LinkedList<>();\n // We expect classes*.dex files first, in order, then the rest of the files, in order.\n while(entries.hasMoreElements()) {\n ZipEntry entry = entries.nextElement();\n if (!entry.getName().startsWith(\"classes\") || !entry.getName().endsWith(\".dex\")) {\n entryNames.add(entry.getName());\n continue;\n }\n if (index == 0) {\n Assert.assertEquals(\"classes.dex\", entry.getName());\n } else {\n Assert.assertEquals(\"classes\" + (index + 1) + \".dex\", entry.getName());\n }\n index++;\n }\n // Everything else should be sorted according to name.\n String[] entriesUnsorted = entryNames.toArray(StringUtils.EMPTY_ARRAY);\n String[] entriesSorted = entryNames.toArray(StringUtils.EMPTY_ARRAY);\n Arrays.sort(entriesSorted);\n Assert.assertArrayEquals(entriesUnsorted, entriesSorted);\n }", "public void sortPaths(List<String> paths){\n //System.out.println(\"Received LIST: \"+Arrays.toString(paths.toArray()));\n Collections.sort(paths, new Comparator<String>() {\n\n @Override\n public int compare(String o1, String o2) {\n int s1 = Integer.valueOf(o1.substring(1));\n int s2 = Integer.valueOf(o2.substring(1));\n return s2-s1;\n }\n\n });\n //System.out.println(\"AFTER SORTING LIST: \"+Arrays.toString(paths.toArray()));\n }", "public static List<File> sortInBatch(File file, Comparator<String> cmp) throws IOException \r\n\t{\r\n\t\tList<File> files = new ArrayList<File>();\r\n\t\tBufferedReader fbr = new BufferedReader(new FileReader(file));\r\n\t\tlong blocksize = estimateBestSizeOfBlocks(file);// in bytes\r\n\t\ttry{\r\n\t\t\tList<String> tmplist = new ArrayList<String>();\r\n\t\t\tString line = \"\";\r\n\t\t\ttry {\r\n\t\t\t\twhile(line != null) {\r\n\t\t\t\t\tlong currentblocksize = 0; //in bytes\r\n\t\t\t\t\twhile((currentblocksize < blocksize) &&((line = fbr.readLine()) != null) )//as long as you have 2MB\r\n\t\t\t\t\t{ \r\n\t\t\t\t\t\ttmplist.add(line);\r\n\t\t\t\t\t\tcurrentblocksize += line.length(); //2+40; //java uses 16 bits per character + 40 bytes of overhead (estimated)\r\n\t\t\t\t\t}\r\n\t\t\t\t\tfiles.add(sortAndSave(tmplist,cmp));\r\n\t\t\t\t\ttmplist.clear();\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tcatch(EOFException oef) {\r\n\t\t\t\tif(tmplist.size()>0) {\r\n\t\t\t\t\tfiles.add(sortAndSave(tmplist,cmp));\r\n\t\t\t\t\ttmplist.clear();\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t} \r\n\t\tfinally {\r\n\t\t\tfbr.close();\r\n\t\t}\r\n\t\treturn files;\r\n\t}", "protected void sortResources()\n {\n PriorityComparator priorityComparator = new PriorityComparator();\n List<Resource> resources = getResources();\n Collections.sort(resources, priorityComparator);\n }", "public static void userSort(ArrayList<FileData> fromFile, int primary_sort, int secondary_sort, int primary_order, int secondary_order)\n {\n \n // user wants to sort by primary = state code and secondary = county code\n if(primary_sort == 1 && secondary_sort == 2) \n {\n if(primary_order == 1 && secondary_order == 1){// user wants both primary and secondary in ascending order\n Collections.sort(fromFile, new Sort_State_Code());\n Collections.sort(fromFile,new Sort_County_Code());\n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo()); // print the sorted information by state and county code\n }\n }\n else if(primary_order == 2 && secondary_order == 2){ // user wants both primary and secondary in decending order\n Collections.sort(fromFile,new Sort_County_Code().reversed());\n Collections.sort(fromFile, new Sort_State_Code().reversed()); \n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==1){// primary is ascending\n Collections.sort(fromFile, new Sort_State_Code());\n Collections.sort(fromFile,new Sort_County_Code().reversed()); \n for(int i=0; i<fromFile.size(); i++){\n System.out.println(fromFile.get(i).printInfo());\n }\n }\n else if(primary_order==2){//primary is descending\n Collections.sort(fromFile, new Sort_State_Code().reversed()); \n Collections.sort(fromFile,new Sort_County_Code()); \n for(int i=0; i<fromFile.size(); i++){\n System.out.println(fromFile.get(i).printInfo());\n } \n } \n }\n // user wants to sort by primary = county code and secondary = state code\n if(primary_sort == 2 && secondary_sort == 1){\n if(primary_order == 1 && secondary_order == 1){\n //primary and seconary is ascending\n Collections.sort(fromFile, new Sort_State_Code());\n Collections.sort(fromFile,new Sort_County_Code());\n \n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n else if(primary_order == 2 && secondary_order == 2){\n //both descending\n Collections.sort(fromFile, new Sort_State_Code().reversed()); \n Collections.sort(fromFile,new Sort_County_Code().reversed());\n \n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==1){//primary is ascending\n Collections.sort(fromFile, new Sort_State_Code().reversed()); \n Collections.sort(fromFile,new Sort_County_Code()); // primary sort\n \n for(int i=0; i<fromFile.size(); i++){\n System.out.println(fromFile.get(i).printInfo());\n }\n }\n else if(primary_order==2){//primary is descending\n Collections.sort(fromFile, new Sort_State_Code());\n Collections.sort(fromFile,new Sort_County_Code().reversed()); // primary sort\n for(int i=0; i<fromFile.size(); i++){\n System.out.println(fromFile.get(i).printInfo());\n } \n } \n }\n if(primary_sort==1&&secondary_sort==3){\n if(primary_order==1&&secondary_order==1){\n //primary and second is ascending\n Collections.sort(fromFile,new Sort_State_Name());\n Collections.sort(fromFile, new Sort_State_Code());\n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==2&&secondary_order==2){\n //both descending\n Collections.sort(fromFile,new Sort_State_Name().reversed());\n Collections.sort(fromFile, new Sort_State_Code().reversed()); \n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==1){\n //secondary is descending\n Collections.sort(fromFile,new Sort_State_Name().reversed());\n Collections.sort(fromFile, new Sort_State_Code()); \n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo()); // print the sorted information by state and county code\n }\n }\n else if(primary_order==2){\n //primary is descending\n Collections.sort(fromFile,new Sort_State_Name());\n Collections.sort(fromFile, new Sort_State_Code().reversed()); \n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo()); // print the sorted information by state and county code\n } \n } \n }\n \n if(primary_sort==3&&secondary_sort==1){\n if(primary_order==1&&secondary_order==1){\n //primary and second is ascending\n \n Collections.sort(fromFile, new Sort_State_Code());\n Collections.sort(fromFile,new Sort_State_Name());\n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==2&&secondary_order==2){\n //both descending\n Collections.sort(fromFile, new Sort_State_Code().reversed());\n Collections.sort(fromFile,new Sort_State_Name().reversed());\n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==1){\n //secondary is descending\n Collections.sort(fromFile,new Sort_State_Code().reversed());\n Collections.sort(fromFile, new Sort_State_Name()); \n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo()); // print the sorted information by state and county code\n }\n }\n else if(primary_order==2){\n //primary is descending\n Collections.sort(fromFile,new Sort_State_Code());\n Collections.sort(fromFile, new Sort_State_Name().reversed()); \n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n } \n } \n }\n \n if(primary_sort==1&&secondary_sort==4){\n if(primary_order==1&&secondary_order==1){\n //primary and second is ascending\n Collections.sort(fromFile, new Sort_County_Name());\n Collections.sort(fromFile,new Sort_State_Code());\n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==2&&secondary_order==2){\n //both descending\n Collections.sort(fromFile, new Sort_County_Name().reversed());\n Collections.sort(fromFile,new Sort_State_Code().reversed());\n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==1){\n //secondary is descending\n Collections.sort(fromFile,new Sort_County_Name().reversed());\n Collections.sort(fromFile, new Sort_State_Code()); \n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n else if(primary_order==2){\n //primary is descending\n Collections.sort(fromFile,new Sort_County_Name());\n Collections.sort(fromFile, new Sort_State_Code().reversed()); \n for(int i=0; i<fromFile.size(); i++){\n System.out.println(fromFile.get(i).printInfo());\n } \n } \n }\n \n if(primary_sort==4&&secondary_sort==1){\n if(primary_order==1&&secondary_order==1){\n //primary and second is ascending\n Collections.sort(fromFile, new Sort_State_Code());\n Collections.sort(fromFile,new Sort_County_Name());\n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==2&&secondary_order==2){\n //both descending\n \n Collections.sort(fromFile, new Sort_State_Code().reversed());\n Collections.sort(fromFile,new Sort_County_Name().reversed());\n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==1){\n //secondary is descending\n Collections.sort(fromFile,new Sort_State_Code().reversed());\n Collections.sort(fromFile, new Sort_County_Name()); \n for(int i=0; i<fromFile.size(); i++){\n System.out.println(fromFile.get(i).printInfo());\n }\n }\n else if(primary_order==2){\n //primary is descending\n Collections.sort(fromFile,new Sort_State_Code());\n Collections.sort(fromFile, new Sort_County_Name().reversed()); \n for(int i=0; i<fromFile.size(); i++){\n System.out.println(fromFile.get(i).printInfo());\n } \n } \n } \n if(primary_sort==1&&secondary_sort==5){\n if(primary_order==1&&secondary_order==1){\n //primary and second is ascending\n Collections.sort(fromFile, new SortFirstConfirmCount());\n Collections.sort(fromFile,new Sort_State_Code());\n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n else if(primary_order==2&&secondary_order==2){\n //both descending\n Collections.sort(fromFile,new SortFirstConfirmCount().reversed());\n Collections.sort(fromFile, new Sort_State_Code().reversed());\n \n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==1){\n //secondary is descending\n Collections.sort(fromFile, new SortFirstConfirmCount().reversed());\n Collections.sort(fromFile,new Sort_State_Code());\n \n for(int i=0; i<fromFile.size(); i++){\n System.out.println(fromFile.get(i).printInfo());\n }\n }\n else if(primary_order==2){\n //primary is descending\n Collections.sort(fromFile,new SortFirstConfirmCount());\n Collections.sort(fromFile, new Sort_State_Code().reversed()); \n for(int i=0; i<fromFile.size(); i++){\n System.out.println(fromFile.get(i).printInfo());\n } \n } \n }\n \n if(primary_sort==5&&secondary_sort==1){\n if(primary_order==1&&secondary_order==1){\n //primary and second is ascending\n Collections.sort(fromFile,new Sort_State_Code());\n Collections.sort(fromFile, new SortFirstConfirmCount());\n for(int i=0; i<fromFile.size(); i++){\n System.out.println(fromFile.get(i).printInfo());\n } \n }\n \n else if(primary_order==2&&secondary_order==2){\n //both descending\n Collections.sort(fromFile, new Sort_State_Code().reversed());\n Collections.sort(fromFile,new SortFirstConfirmCount().reversed());\n for(int i=0; i<fromFile.size(); i++){\n System.out.println(fromFile.get(i).printInfo());\n } \n }\n \n else if(primary_order==1){\n //secondary is descending\n Collections.sort(fromFile,new Sort_State_Code().reversed());\n Collections.sort(fromFile, new SortFirstConfirmCount());\n \n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo()); // print the sorted information \n }\n }\n else if(primary_order==2){\n //primary is descending\n Collections.sort(fromFile,new Sort_State_Code());\n Collections.sort(fromFile, new SortFirstConfirmCount().reversed()); \n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo()); // print the sorted information \n } \n } \n }\n \n \n if(primary_sort==1&&secondary_sort==6){\n if(primary_order==1&&secondary_order==1){\n //primary and second is ascending\n \n Collections.sort(fromFile, new SortSecondConfirmCount());\n Collections.sort(fromFile,new Sort_State_Code());\n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo()); \n }\n }\n \n else if(primary_order==2&&secondary_order==2){\n //both descending\n Collections.sort(fromFile,new SortSecondConfirmCount().reversed());\n Collections.sort(fromFile, new Sort_State_Code().reversed());\n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo()); \n }\n }\n \n else if(primary_order==1){\n //secondary is descending\n Collections.sort(fromFile, new SortSecondConfirmCount().reversed());\n Collections.sort(fromFile,new Sort_State_Code());\n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo()); // print the sorted information by state and county code\n }\n }\n else if(primary_order==2){\n //primary is descending\n Collections.sort(fromFile,new SortSecondConfirmCount());\n Collections.sort(fromFile, new Sort_State_Code().reversed()); \n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo()); // print the sorted information by state and county code\n } \n } \n }\n \n if(primary_sort==6&&secondary_sort==1){\n if(primary_order==1&&secondary_order==1){\n //primary and second is ascending\n Collections.sort(fromFile,new Sort_State_Code());\n Collections.sort(fromFile, new SortSecondConfirmCount());\n \n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==2&&secondary_order==2){\n //both descending\n Collections.sort(fromFile, new Sort_State_Code().reversed());\n Collections.sort(fromFile,new SortSecondConfirmCount().reversed());\n \n \n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==1){\n //secondary is descending\n Collections.sort(fromFile,new Sort_State_Code().reversed());\n Collections.sort(fromFile, new SortSecondConfirmCount());\n \n \n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n else if(primary_order==2){\n //primary is descending\n Collections.sort(fromFile,new Sort_State_Code());\n Collections.sort(fromFile, new SortSecondConfirmCount().reversed()); \n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n } \n } \n }\n \n if(primary_sort==1&&secondary_sort==7){\n if(primary_order==1&&secondary_order==1){\n //primary and second is ascending\n \n Collections.sort(fromFile, new SortThirdConfirmCount());\n Collections.sort(fromFile,new Sort_State_Code());\n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==2&&secondary_order==2){\n //both descending\n Collections.sort(fromFile,new SortThirdConfirmCount().reversed());\n Collections.sort(fromFile, new Sort_State_Code().reversed());\n \n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==1){\n //secondary is descending\n Collections.sort(fromFile, new SortThirdConfirmCount().reversed());\n Collections.sort(fromFile,new Sort_State_Code());\n \n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n else if(primary_order==2){\n //primary is descending\n Collections.sort(fromFile,new SortThirdConfirmCount());\n Collections.sort(fromFile, new Sort_State_Code().reversed()); \n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n } \n } \n }\n \n if(primary_sort==7&&secondary_sort==1){\n if(primary_order==1&&secondary_order==1){\n //primary and second is ascending\n Collections.sort(fromFile,new Sort_State_Code());\n Collections.sort(fromFile, new SortThirdConfirmCount());\n \n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==2&&secondary_order==2){\n //both descending\n Collections.sort(fromFile, new Sort_State_Code().reversed());\n Collections.sort(fromFile,new SortThirdConfirmCount().reversed());\n \n \n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==1){\n //secondary is descending\n Collections.sort(fromFile,new Sort_State_Code().reversed());\n Collections.sort(fromFile, new SortThirdConfirmCount());\n \n \n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n else if(primary_order==2){\n //primary is descending\n Collections.sort(fromFile,new Sort_State_Code());\n Collections.sort(fromFile, new SortThirdConfirmCount().reversed()); \n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n } \n } \n }\n \n if(primary_sort==1&&secondary_sort==8){\n if(primary_order==1&&secondary_order==1){\n //primary and second is ascending\n \n Collections.sort(fromFile, new SortFourthConfirmCount());\n Collections.sort(fromFile,new Sort_State_Code());\n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==2&&secondary_order==2){\n //both descending\n Collections.sort(fromFile,new SortFourthConfirmCount().reversed());\n Collections.sort(fromFile, new Sort_State_Code().reversed());\n \n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==1){\n //secondary is descending\n Collections.sort(fromFile, new SortFourthConfirmCount().reversed());\n Collections.sort(fromFile,new Sort_State_Code());\n \n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n else if(primary_order==2){\n //primary is descending\n Collections.sort(fromFile,new SortFourthConfirmCount());\n Collections.sort(fromFile, new Sort_State_Code().reversed()); \n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n } \n } \n }\n \n \n if(primary_sort==8&&secondary_sort==1){\n if(primary_order==1&&secondary_order==1){\n //primary and second is ascending\n Collections.sort(fromFile,new Sort_State_Code());\n Collections.sort(fromFile, new SortFourthConfirmCount());\n \n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==2&&secondary_order==2){\n //both descending\n Collections.sort(fromFile, new Sort_State_Code().reversed());\n Collections.sort(fromFile,new SortFourthConfirmCount().reversed());\n \n \n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==1){\n //secondary is descending\n Collections.sort(fromFile,new Sort_State_Code().reversed());\n Collections.sort(fromFile, new SortFourthConfirmCount());\n \n \n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n else if(primary_order==2){\n //primary is descending\n Collections.sort(fromFile,new Sort_State_Code());\n Collections.sort(fromFile, new SortFourthConfirmCount().reversed()); \n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n } \n } \n }\n \n if(primary_sort==2&&secondary_sort==3){\n if(primary_order==1&&secondary_order==1){\n //primary and second is ascending\n \n Collections.sort(fromFile, new Sort_State_Name());\n Collections.sort(fromFile,new Sort_County_Code());\n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==2&&secondary_order==2){\n //both descending\n Collections.sort(fromFile,new Sort_State_Name().reversed());\n Collections.sort(fromFile, new Sort_County_Code().reversed());\n \n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==1){\n //secondary is descending\n Collections.sort(fromFile, new Sort_State_Name().reversed());\n Collections.sort(fromFile,new Sort_County_Code());\n \n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n else if(primary_order==2){\n //primary is descending\n Collections.sort(fromFile,new Sort_State_Name());\n Collections.sort(fromFile, new Sort_County_Code().reversed()); \n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n } \n } \n }\n \n if(primary_sort==3&&secondary_sort==2){\n if(primary_order==1&&secondary_order==1){\n //primary and second is ascending\n \n Collections.sort(fromFile, new Sort_County_Code());\n Collections.sort(fromFile,new Sort_State_Name());\n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==2&&secondary_order==2){\n //both descending\n Collections.sort(fromFile,new Sort_County_Code().reversed());\n Collections.sort(fromFile, new Sort_State_Name().reversed());\n \n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==1){\n //secondary is descending\n Collections.sort(fromFile, new Sort_County_Code().reversed());\n Collections.sort(fromFile,new Sort_State_Name());\n \n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n else if(primary_order==2){\n //primary is descending\n Collections.sort(fromFile,new Sort_County_Code());\n Collections.sort(fromFile, new Sort_State_Name().reversed()); \n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n } \n } \n }\n \n if(primary_sort==2&&secondary_sort==4){\n if(primary_order==1&&secondary_order==1){\n //primary and second is ascending\n \n Collections.sort(fromFile, new Sort_County_Name());\n Collections.sort(fromFile,new Sort_County_Code());\n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==2&&secondary_order==2){\n //both descending\n Collections.sort(fromFile,new Sort_County_Name().reversed());\n Collections.sort(fromFile, new Sort_County_Code().reversed());\n \n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==1){\n //secondary is descending\n Collections.sort(fromFile, new Sort_County_Name().reversed());\n Collections.sort(fromFile,new Sort_County_Code());\n \n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n else if(primary_order==2){\n //primary is descending\n Collections.sort(fromFile,new Sort_County_Name());\n Collections.sort(fromFile, new Sort_County_Code().reversed()); \n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n } \n } \n }\n \n if(primary_sort==4&&secondary_sort==2){\n if(primary_order==1&&secondary_order==1){\n //primary and second is ascending\n \n Collections.sort(fromFile, new Sort_County_Code());\n Collections.sort(fromFile,new Sort_County_Name());\n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==2&&secondary_order==2){\n //both descending\n Collections.sort(fromFile,new Sort_County_Code().reversed());\n Collections.sort(fromFile, new Sort_County_Name().reversed());\n \n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==1){\n //secondary is descending\n Collections.sort(fromFile, new Sort_County_Code().reversed());\n Collections.sort(fromFile,new Sort_County_Name());\n \n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n else if(primary_order==2){\n //primary is descending\n Collections.sort(fromFile,new Sort_County_Code());\n Collections.sort(fromFile, new Sort_County_Name().reversed()); \n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n } \n } \n }\n \n if(primary_sort==2&&secondary_sort==5){\n if(primary_order==1&&secondary_order==1){\n //primary and second is ascending\n \n \n Collections.sort(fromFile,new SortFirstConfirmCount());\n Collections.sort(fromFile, new Sort_County_Code());\n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==2&&secondary_order==2){\n //both descending\n \n Collections.sort(fromFile, new SortFirstConfirmCount().reversed());\n Collections.sort(fromFile,new Sort_County_Code().reversed());\n \n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==1){\n //secondary is descending\n \n Collections.sort(fromFile,new SortFirstConfirmCount().reversed());\n Collections.sort(fromFile, new Sort_County_Code());\n \n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n else if(primary_order==2){\n //primary is descending\n \n Collections.sort(fromFile, new SortFirstConfirmCount());\n Collections.sort(fromFile,new Sort_County_Code().reversed());\n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n } \n } \n }\n \n if(primary_sort==5&&secondary_sort==2){\n if(primary_order==1&&secondary_order==1){\n //primary and second is ascending\n \n Collections.sort(fromFile, new Sort_County_Code());\n Collections.sort(fromFile,new SortFirstConfirmCount());\n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==2&&secondary_order==2){\n //both descending\n Collections.sort(fromFile,new Sort_County_Code().reversed());\n Collections.sort(fromFile, new SortFirstConfirmCount().reversed());\n \n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==1){\n //secondary is descending\n Collections.sort(fromFile, new Sort_County_Code().reversed());\n Collections.sort(fromFile,new SortFirstConfirmCount());\n \n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n else if(primary_order==2){\n //primary is descending\n Collections.sort(fromFile,new Sort_County_Code());\n Collections.sort(fromFile, new SortFirstConfirmCount().reversed()); \n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n } \n } \n } \n \n if(primary_sort==2&&secondary_sort==6){\n if(primary_order==1&&secondary_order==1){\n //primary and second is ascending\n \n \n Collections.sort(fromFile,new SortSecondConfirmCount());\n Collections.sort(fromFile, new Sort_County_Code());\n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==2&&secondary_order==2){\n //both descending\n \n Collections.sort(fromFile, new SortSecondConfirmCount().reversed());\n Collections.sort(fromFile,new Sort_County_Code().reversed());\n \n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==1){\n //secondary is descending\n \n Collections.sort(fromFile,new SortSecondConfirmCount().reversed());\n Collections.sort(fromFile, new Sort_County_Code());\n \n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n else if(primary_order==2){\n //primary is descending\n \n Collections.sort(fromFile, new SortSecondConfirmCount());\n Collections.sort(fromFile,new Sort_County_Code().reversed());\n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n } \n } \n } \n if(primary_sort==6&&secondary_sort==2){\n if(primary_order==1&&secondary_order==1){\n //primary and second is ascending\n \n Collections.sort(fromFile, new Sort_County_Code());\n Collections.sort(fromFile,new SortSecondConfirmCount());\n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==2&&secondary_order==2){\n //both descending\n Collections.sort(fromFile,new Sort_County_Code().reversed());\n Collections.sort(fromFile, new SortSecondConfirmCount().reversed());\n \n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==1){\n //secondary is descending\n Collections.sort(fromFile, new Sort_County_Code().reversed());\n Collections.sort(fromFile,new SortSecondConfirmCount());\n \n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n else if(primary_order==2){\n //primary is descending\n Collections.sort(fromFile,new Sort_County_Code());\n Collections.sort(fromFile, new SortSecondConfirmCount().reversed()); \n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n } \n } \n } \n \n if(primary_sort==2&&secondary_sort==7){\n if(primary_order==1&&secondary_order==1){\n //primary and second is ascending\n \n \n Collections.sort(fromFile,new SortThirdConfirmCount());\n Collections.sort(fromFile, new Sort_County_Code());\n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==2&&secondary_order==2){\n //both descending\n \n Collections.sort(fromFile, new SortThirdConfirmCount().reversed());\n Collections.sort(fromFile,new Sort_County_Code().reversed());\n \n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==1){\n //secondary is descending\n \n Collections.sort(fromFile,new SortThirdConfirmCount().reversed());\n Collections.sort(fromFile, new Sort_County_Code());\n \n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n else if(primary_order==2){\n //primary is descending\n \n Collections.sort(fromFile, new SortThirdConfirmCount());\n Collections.sort(fromFile,new Sort_County_Code().reversed());\n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n } \n } \n } \n if(primary_sort==7&&secondary_sort==2){\n if(primary_order==1&&secondary_order==1){\n //primary and second is ascending\n \n Collections.sort(fromFile, new Sort_County_Code());\n Collections.sort(fromFile,new SortThirdConfirmCount());\n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==2&&secondary_order==2){\n //both descending\n Collections.sort(fromFile,new Sort_County_Code().reversed());\n Collections.sort(fromFile, new SortThirdConfirmCount().reversed());\n \n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==1){\n //secondary is descending\n Collections.sort(fromFile, new Sort_County_Code().reversed());\n Collections.sort(fromFile,new SortThirdConfirmCount());\n \n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n else if(primary_order==2){\n //primary is descending\n Collections.sort(fromFile,new Sort_County_Code());\n Collections.sort(fromFile, new SortThirdConfirmCount().reversed()); \n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n } \n } \n }\n \n if(primary_sort==2&&secondary_sort==8){\n if(primary_order==1&&secondary_order==1){\n //primary and second is ascending\n \n \n Collections.sort(fromFile,new SortFourthConfirmCount());\n Collections.sort(fromFile, new Sort_County_Code());\n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==2&&secondary_order==2){\n //both descending\n \n Collections.sort(fromFile, new SortFourthConfirmCount().reversed());\n Collections.sort(fromFile,new Sort_County_Code().reversed());\n \n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==1){\n //secondary is descending\n \n Collections.sort(fromFile,new SortFourthConfirmCount().reversed());\n Collections.sort(fromFile, new Sort_County_Code());\n \n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n else if(primary_order==2){\n //primary is descending\n \n Collections.sort(fromFile, new SortFourthConfirmCount());\n Collections.sort(fromFile,new Sort_County_Code().reversed());\n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n } \n } \n } \n if(primary_sort==8&&secondary_sort==2){\n if(primary_order==1&&secondary_order==1){\n //primary and second is ascending\n \n Collections.sort(fromFile, new Sort_County_Code());\n Collections.sort(fromFile,new SortFourthConfirmCount());\n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==2&&secondary_order==2){\n //both descending\n Collections.sort(fromFile,new Sort_County_Code().reversed());\n Collections.sort(fromFile, new SortFourthConfirmCount().reversed());\n \n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==1){\n //secondary is descending\n Collections.sort(fromFile, new Sort_County_Code().reversed());\n Collections.sort(fromFile,new SortFourthConfirmCount());\n \n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n else if(primary_order==2){\n //primary is descending\n Collections.sort(fromFile,new Sort_County_Code());\n Collections.sort(fromFile, new SortFourthConfirmCount().reversed()); \n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n } \n } \n } \n \n if(primary_sort==3&&secondary_sort==4){\n if(primary_order==1&&secondary_order==1){\n //primary and second is ascending\n \n \n Collections.sort(fromFile,new Sort_County_Name());\n Collections.sort(fromFile, new Sort_State_Name());\n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==2&&secondary_order==2){\n //both descending\n \n Collections.sort(fromFile, new Sort_County_Name().reversed());\n Collections.sort(fromFile,new Sort_State_Name().reversed());\n \n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==1){\n //secondary is descending\n \n Collections.sort(fromFile,new Sort_County_Name().reversed());\n Collections.sort(fromFile, new Sort_State_Name());\n \n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n else if(primary_order==2){\n //primary is descending\n \n Collections.sort(fromFile, new Sort_County_Name());\n Collections.sort(fromFile,new Sort_State_Name().reversed());\n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n } \n } \n }\n if(primary_sort==4&&secondary_sort==3){\n if(primary_order==1&&secondary_order==1){\n //primary and second is ascending\n \n Collections.sort(fromFile, new Sort_State_Name());\n Collections.sort(fromFile,new Sort_County_Name());\n \n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==2&&secondary_order==2){\n //both descending\n Collections.sort(fromFile,new Sort_State_Name().reversed());\n Collections.sort(fromFile, new Sort_County_Name().reversed());\n \n \n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==1){\n //secondary is descending\n Collections.sort(fromFile, new Sort_State_Name().reversed());\n Collections.sort(fromFile,new Sort_County_Name());\n \n \n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n else if(primary_order==2){\n //primary is descending\n Collections.sort(fromFile,new Sort_State_Name());\n Collections.sort(fromFile, new Sort_County_Name().reversed());\n \n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n } \n } \n }\n \n if(primary_sort==3&&secondary_sort==5){\n if(primary_order==1&&secondary_order==1){\n //primary and second is ascending\n \n \n Collections.sort(fromFile,new SortFirstConfirmCount());\n Collections.sort(fromFile, new Sort_State_Name());\n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==2&&secondary_order==2){\n //both descending\n \n Collections.sort(fromFile, new SortFirstConfirmCount().reversed());\n Collections.sort(fromFile,new Sort_State_Name().reversed());\n \n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==1){\n //secondary is descending\n \n Collections.sort(fromFile,new SortFirstConfirmCount().reversed());\n Collections.sort(fromFile, new Sort_State_Name());\n \n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n else if(primary_order==2){\n //primary is descending\n \n Collections.sort(fromFile, new SortFirstConfirmCount());\n Collections.sort(fromFile,new Sort_State_Name().reversed());\n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n } \n } \n }\n if(primary_sort==5&&secondary_sort==3){\n if(primary_order==1&&secondary_order==1){\n //primary and second is ascending\n \n Collections.sort(fromFile, new Sort_State_Name());\n Collections.sort(fromFile,new SortFirstConfirmCount());\n \n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==2&&secondary_order==2){\n //both descending\n Collections.sort(fromFile,new Sort_State_Name().reversed());\n Collections.sort(fromFile, new SortFirstConfirmCount().reversed());\n \n \n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==1){\n //secondary is descending\n Collections.sort(fromFile, new Sort_State_Name().reversed());\n Collections.sort(fromFile,new SortFirstConfirmCount());\n \n \n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n else if(primary_order==2){\n //primary is descending\n Collections.sort(fromFile,new Sort_State_Name());\n Collections.sort(fromFile, new SortFirstConfirmCount().reversed());\n \n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n } \n } \n }\n \n if(primary_sort==3&&secondary_sort==6){\n if(primary_order==1&&secondary_order==1){\n //primary and second is ascending\n Collections.sort(fromFile, new Sort_State_Name());\n Collections.sort(fromFile,new SortSecondConfirmCount());\n \n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==2&&secondary_order==2){\n //both descending\n \n Collections.sort(fromFile, new SortSecondConfirmCount().reversed());\n Collections.sort(fromFile,new Sort_State_Name().reversed());\n \n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==1){\n //secondary is descending\n \n Collections.sort(fromFile,new SortSecondConfirmCount().reversed());\n Collections.sort(fromFile, new Sort_State_Name());\n \n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n else if(primary_order==2){\n //primary is descending\n Collections.sort(fromFile, new SortSecondConfirmCount());\n Collections.sort(fromFile,new Sort_State_Name().reversed());\n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n } \n } \n }\n if(primary_sort==6&&secondary_sort==3){\n if(primary_order==1&&secondary_order==1){\n //primary and second is ascending\n \n Collections.sort(fromFile, new Sort_State_Name());\n Collections.sort(fromFile,new SortSecondConfirmCount());\n \n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==2&&secondary_order==2){\n //both descending\n Collections.sort(fromFile,new Sort_State_Name().reversed());\n Collections.sort(fromFile, new SortSecondConfirmCount().reversed());\n \n \n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==1){\n //secondary is descending\n Collections.sort(fromFile, new Sort_State_Name().reversed());\n Collections.sort(fromFile,new SortSecondConfirmCount());\n \n \n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n else if(primary_order==2){\n //primary is descending\n Collections.sort(fromFile,new Sort_State_Name());\n Collections.sort(fromFile, new SortSecondConfirmCount().reversed());\n \n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n } \n } \n }\n \n if(primary_sort==3&&secondary_sort==7){\n if(primary_order==1&&secondary_order==1){\n //primary and second is ascending\n \n \n Collections.sort(fromFile,new SortThirdConfirmCount());\n Collections.sort(fromFile, new Sort_State_Name());\n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==2&&secondary_order==2){\n //both descending\n \n Collections.sort(fromFile, new SortThirdConfirmCount().reversed());\n Collections.sort(fromFile,new Sort_State_Name().reversed());\n \n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==1){\n //secondary is descending\n \n Collections.sort(fromFile,new SortThirdConfirmCount().reversed());\n Collections.sort(fromFile, new Sort_State_Name());\n \n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n else if(primary_order==2){\n //primary is descending\n \n Collections.sort(fromFile, new SortThirdConfirmCount());\n Collections.sort(fromFile,new Sort_State_Name().reversed());\n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n } \n } \n }\n if(primary_sort==7&&secondary_sort==3){\n if(primary_order==1&&secondary_order==1){\n //primary and second is ascending\n \n Collections.sort(fromFile, new Sort_State_Name());\n Collections.sort(fromFile,new SortThirdConfirmCount());\n \n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==2&&secondary_order==2){\n //both descending\n Collections.sort(fromFile,new Sort_State_Name().reversed());\n Collections.sort(fromFile, new SortThirdConfirmCount().reversed());\n \n \n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==1){\n //secondary is descending\n Collections.sort(fromFile, new Sort_State_Name().reversed());\n Collections.sort(fromFile,new SortThirdConfirmCount());\n \n \n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n else if(primary_order==2){\n //primary is descending\n Collections.sort(fromFile,new Sort_State_Name());\n Collections.sort(fromFile, new SortThirdConfirmCount().reversed());\n \n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n } \n } \n }\n \n if(primary_sort==3&&secondary_sort==8){\n if(primary_order==1&&secondary_order==1){\n //primary and second is ascending\n \n \n Collections.sort(fromFile,new SortFourthConfirmCount());\n Collections.sort(fromFile, new Sort_State_Name());\n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==2&&secondary_order==2){\n //both descending\n \n Collections.sort(fromFile, new SortFourthConfirmCount().reversed());\n Collections.sort(fromFile,new Sort_State_Name().reversed());\n \n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==1){\n //secondary is descending\n \n Collections.sort(fromFile,new SortFourthConfirmCount().reversed());\n Collections.sort(fromFile, new Sort_State_Name());\n \n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n else if(primary_order==2){\n //primary is descending\n \n Collections.sort(fromFile, new SortFourthConfirmCount());\n Collections.sort(fromFile,new Sort_State_Name().reversed());\n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n } \n } \n }\n if(primary_sort==8&&secondary_sort==3){\n if(primary_order==1&&secondary_order==1){\n //primary and second is ascending\n \n Collections.sort(fromFile, new Sort_State_Name());\n Collections.sort(fromFile,new SortFourthConfirmCount());\n \n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==2&&secondary_order==2){\n //both descending\n Collections.sort(fromFile,new Sort_State_Name().reversed());\n Collections.sort(fromFile, new SortFourthConfirmCount().reversed());\n \n \n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==1){\n //secondary is descending\n Collections.sort(fromFile, new Sort_State_Name().reversed());\n Collections.sort(fromFile,new SortFourthConfirmCount());\n \n \n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n else if(primary_order==2){\n //primary is descending\n Collections.sort(fromFile,new Sort_State_Name());\n Collections.sort(fromFile, new SortFourthConfirmCount().reversed());\n \n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n } \n } \n }\n \n if(primary_sort==4&&secondary_sort==5){\n if(primary_order==1&&secondary_order==1){\n //primary and second is ascending\n \n Collections.sort(fromFile, new SortFirstConfirmCount());\n Collections.sort(fromFile,new Sort_County_Name());\n \n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==2&&secondary_order==2){\n //both descending\n Collections.sort(fromFile,new SortFirstConfirmCount().reversed());\n Collections.sort(fromFile, new Sort_County_Name().reversed());\n \n \n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==1){\n //secondary is descending\n Collections.sort(fromFile, new SortFirstConfirmCount().reversed());\n Collections.sort(fromFile,new Sort_County_Name());\n \n \n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n else if(primary_order==2){\n //primary is descending\n Collections.sort(fromFile,new SortFirstConfirmCount());\n Collections.sort(fromFile, new Sort_County_Name().reversed());\n \n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n } \n } \n }\n \n if(primary_sort==5&&secondary_sort==4){\n if(primary_order==1&&secondary_order==1){\n //primary and second is ascending\n \n Collections.sort(fromFile, new Sort_County_Name());\n Collections.sort(fromFile,new SortFirstConfirmCount());\n \n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==2&&secondary_order==2){\n //both descending\n Collections.sort(fromFile,new Sort_County_Name().reversed());\n Collections.sort(fromFile, new SortFirstConfirmCount().reversed());\n \n \n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==1){\n //secondary is descending\n Collections.sort(fromFile, new Sort_County_Name().reversed());\n Collections.sort(fromFile,new SortFirstConfirmCount());\n \n \n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n else if(primary_order==2){\n //primary is descending\n Collections.sort(fromFile,new Sort_County_Name());\n Collections.sort(fromFile, new SortFirstConfirmCount().reversed());\n \n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n } \n } \n }\n \n if(primary_sort==4&&secondary_sort==6){\n if(primary_order==1&&secondary_order==1){\n //primary and second is ascending\n \n Collections.sort(fromFile, new SortSecondConfirmCount());\n Collections.sort(fromFile,new Sort_County_Name());\n \n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==2&&secondary_order==2){\n //both descending\n Collections.sort(fromFile,new SortSecondConfirmCount().reversed());\n Collections.sort(fromFile, new Sort_County_Name().reversed());\n \n \n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==1){\n //secondary is descending\n Collections.sort(fromFile, new SortSecondConfirmCount().reversed());\n Collections.sort(fromFile,new Sort_County_Name());\n \n \n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n else if(primary_order==2){\n //primary is descending\n Collections.sort(fromFile,new SortSecondConfirmCount());\n Collections.sort(fromFile, new Sort_County_Name().reversed());\n \n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n } \n } \n }\n \n if(primary_sort==6&&secondary_sort==4){\n if(primary_order==1&&secondary_order==1){\n //primary and second is ascending\n \n Collections.sort(fromFile, new Sort_County_Name());\n Collections.sort(fromFile,new SortSecondConfirmCount());\n \n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==2&&secondary_order==2){\n //both descending\n Collections.sort(fromFile,new Sort_County_Name().reversed());\n Collections.sort(fromFile, new SortSecondConfirmCount().reversed());\n \n \n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==1){\n //secondary is descending\n Collections.sort(fromFile, new Sort_County_Name().reversed());\n Collections.sort(fromFile,new SortSecondConfirmCount());\n \n \n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n else if(primary_order==2){\n //primary is descending\n Collections.sort(fromFile,new Sort_County_Name());\n Collections.sort(fromFile, new SortSecondConfirmCount().reversed());\n \n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n } \n } \n }\n \n if(primary_sort==4&&secondary_sort==7){\n if(primary_order==1&&secondary_order==1){\n //primary and second is ascending\n \n Collections.sort(fromFile, new SortThirdConfirmCount());\n Collections.sort(fromFile,new Sort_County_Name());\n \n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==2&&secondary_order==2){\n //both descending\n Collections.sort(fromFile,new SortThirdConfirmCount().reversed());\n Collections.sort(fromFile, new Sort_County_Name().reversed());\n \n \n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==1){\n //secondary is descending\n Collections.sort(fromFile, new SortThirdConfirmCount().reversed());\n Collections.sort(fromFile,new Sort_County_Name());\n \n \n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n else if(primary_order==2){\n //primary is descending\n Collections.sort(fromFile,new SortThirdConfirmCount());\n Collections.sort(fromFile, new Sort_County_Name().reversed());\n \n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n } \n } \n }\n \n if(primary_sort==7&&secondary_sort==4){\n if(primary_order==1&&secondary_order==1){\n //primary and second is ascending\n \n Collections.sort(fromFile, new Sort_County_Name());\n Collections.sort(fromFile,new SortThirdConfirmCount());\n \n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==2&&secondary_order==2){\n //both descending\n Collections.sort(fromFile,new Sort_County_Name().reversed());\n Collections.sort(fromFile, new SortThirdConfirmCount().reversed());\n \n \n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==1){\n //secondary is descending\n Collections.sort(fromFile, new Sort_County_Name().reversed());\n Collections.sort(fromFile,new SortThirdConfirmCount());\n \n \n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n else if(primary_order==2){\n //primary is descending\n Collections.sort(fromFile,new Sort_County_Name());\n Collections.sort(fromFile, new SortThirdConfirmCount().reversed());\n \n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n } \n } \n }\n \n if(primary_sort==4&&secondary_sort==8){\n if(primary_order==1&&secondary_order==1){\n //primary and second is ascending\n \n Collections.sort(fromFile, new SortFourthConfirmCount());\n Collections.sort(fromFile,new Sort_County_Name());\n \n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==2&&secondary_order==2){\n //both descending\n Collections.sort(fromFile,new SortFourthConfirmCount().reversed());\n Collections.sort(fromFile, new Sort_County_Name().reversed());\n \n \n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==1){\n //secondary is descending\n Collections.sort(fromFile, new SortFourthConfirmCount().reversed());\n Collections.sort(fromFile,new Sort_County_Name());\n \n \n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n else if(primary_order==2){\n //primary is descending\n Collections.sort(fromFile,new SortFourthConfirmCount());\n Collections.sort(fromFile, new Sort_County_Name().reversed());\n \n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n } \n } \n }\n \n if(primary_sort==8&&secondary_sort==4){\n if(primary_order==1&&secondary_order==1){\n //primary and second is ascending\n \n Collections.sort(fromFile, new Sort_County_Name());\n Collections.sort(fromFile,new SortFourthConfirmCount());\n \n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==2&&secondary_order==2){\n //both descending\n Collections.sort(fromFile,new Sort_County_Name().reversed());\n Collections.sort(fromFile, new SortFourthConfirmCount().reversed());\n \n \n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==1){\n //secondary is descending\n Collections.sort(fromFile, new Sort_County_Name().reversed());\n Collections.sort(fromFile,new SortFourthConfirmCount());\n \n \n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n else if(primary_order==2){\n //primary is descending\n Collections.sort(fromFile,new Sort_County_Name());\n Collections.sort(fromFile, new SortFourthConfirmCount().reversed());\n \n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n } \n } \n }\n \n if(primary_sort==5&&secondary_sort==6){\n if(primary_order==1&&secondary_order==1){\n //primary and second is ascending\n \n Collections.sort(fromFile, new SortSecondConfirmCount());\n Collections.sort(fromFile,new SortFirstConfirmCount());\n \n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==2&&secondary_order==2){\n //both descending\n Collections.sort(fromFile,new SortSecondConfirmCount().reversed());\n Collections.sort(fromFile, new SortFirstConfirmCount().reversed());\n \n \n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==1){\n //secondary is descending\n Collections.sort(fromFile, new SortSecondConfirmCount().reversed());\n Collections.sort(fromFile,new SortFirstConfirmCount());\n \n \n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n else if(primary_order==2){\n //primary is descending\n Collections.sort(fromFile,new SortSecondConfirmCount());\n Collections.sort(fromFile, new SortFirstConfirmCount().reversed());\n \n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n } \n } \n }\n \n if(primary_sort==6&&secondary_sort==5){\n if(primary_order==1&&secondary_order==1){\n //primary and second is ascending\n \n Collections.sort(fromFile, new SortFirstConfirmCount());\n Collections.sort(fromFile,new SortSecondConfirmCount());\n \n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==2&&secondary_order==2){\n //both descending\n Collections.sort(fromFile,new SortFirstConfirmCount().reversed());\n Collections.sort(fromFile, new SortSecondConfirmCount().reversed());\n \n \n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==1){\n //secondary is descending\n Collections.sort(fromFile, new SortFirstConfirmCount().reversed());\n Collections.sort(fromFile,new SortSecondConfirmCount());\n \n \n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n else if(primary_order==2){\n //primary is descending\n Collections.sort(fromFile,new SortFirstConfirmCount());\n Collections.sort(fromFile, new SortSecondConfirmCount().reversed());\n \n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n } \n } \n }\n \n if(primary_sort==5&&secondary_sort==7){\n if(primary_order==1&&secondary_order==1){\n //primary and second is ascending\n \n Collections.sort(fromFile, new SortThirdConfirmCount());\n Collections.sort(fromFile,new SortFirstConfirmCount());\n \n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==2&&secondary_order==2){\n //both descending\n Collections.sort(fromFile,new SortThirdConfirmCount().reversed());\n Collections.sort(fromFile, new SortFirstConfirmCount().reversed());\n \n \n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==1){\n //secondary is descending\n Collections.sort(fromFile, new SortThirdConfirmCount().reversed());\n Collections.sort(fromFile,new SortFirstConfirmCount());\n \n \n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n else if(primary_order==2){\n //primary is descending\n Collections.sort(fromFile,new SortThirdConfirmCount());\n Collections.sort(fromFile, new SortFirstConfirmCount().reversed());\n \n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n } \n } \n }\n \n if(primary_sort==7&&secondary_sort==5){\n if(primary_order==1&&secondary_order==1){\n //primary and second is ascending\n \n Collections.sort(fromFile, new SortFirstConfirmCount());\n Collections.sort(fromFile,new SortThirdConfirmCount());\n \n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==2&&secondary_order==2){\n //both descending\n Collections.sort(fromFile,new SortFirstConfirmCount().reversed());\n Collections.sort(fromFile, new SortThirdConfirmCount().reversed());\n \n \n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==1){\n //secondary is descending\n Collections.sort(fromFile, new SortFirstConfirmCount().reversed());\n Collections.sort(fromFile,new SortThirdConfirmCount());\n \n \n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n else if(primary_order==2){\n //primary is descending\n Collections.sort(fromFile,new SortFirstConfirmCount());\n Collections.sort(fromFile, new SortThirdConfirmCount().reversed());\n \n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n } \n } \n }\n \n if(primary_sort==5&&secondary_sort==8){\n if(primary_order==1&&secondary_order==1){\n //primary and second is ascending\n \n Collections.sort(fromFile, new SortFourthConfirmCount());\n Collections.sort(fromFile,new SortFirstConfirmCount());\n \n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==2&&secondary_order==2){\n //both descending\n Collections.sort(fromFile,new SortFourthConfirmCount().reversed());\n Collections.sort(fromFile, new SortFirstConfirmCount().reversed());\n \n \n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==1){\n //secondary is descending\n Collections.sort(fromFile, new SortFourthConfirmCount().reversed());\n Collections.sort(fromFile,new SortFirstConfirmCount());\n \n \n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n else if(primary_order==2){\n //primary is descending\n Collections.sort(fromFile,new SortFourthConfirmCount());\n Collections.sort(fromFile, new SortFirstConfirmCount().reversed());\n \n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n } \n } \n }\n \n if(primary_sort==8&&secondary_sort==5){\n if(primary_order==1&&secondary_order==1){\n //primary and second is ascending\n \n Collections.sort(fromFile, new SortFirstConfirmCount());\n Collections.sort(fromFile,new SortFourthConfirmCount());\n \n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==2&&secondary_order==2){\n //both descending\n Collections.sort(fromFile,new SortFirstConfirmCount().reversed());\n Collections.sort(fromFile, new SortFourthConfirmCount().reversed());\n \n \n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==1){\n //secondary is descending\n Collections.sort(fromFile, new SortFirstConfirmCount().reversed());\n Collections.sort(fromFile,new SortFourthConfirmCount());\n \n \n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n else if(primary_order==2){\n //primary is descending\n Collections.sort(fromFile,new SortFirstConfirmCount());\n Collections.sort(fromFile, new SortFourthConfirmCount().reversed());\n \n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n } \n } \n }\n if(primary_sort==6&&secondary_sort==7){\n if(primary_order==1&&secondary_order==1){\n //primary and second is ascending\n \n Collections.sort(fromFile, new SortThirdConfirmCount());\n Collections.sort(fromFile,new SortSecondConfirmCount());\n \n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==2&&secondary_order==2){\n //both descending\n Collections.sort(fromFile,new SortThirdConfirmCount().reversed());\n Collections.sort(fromFile, new SortSecondConfirmCount().reversed());\n \n \n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==1){\n //secondary is descending\n Collections.sort(fromFile, new SortThirdConfirmCount().reversed());\n Collections.sort(fromFile,new SortSecondConfirmCount());\n \n \n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n else if(primary_order==2){\n //primary is descending\n Collections.sort(fromFile,new SortThirdConfirmCount());\n Collections.sort(fromFile, new SortSecondConfirmCount().reversed());\n \n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n } \n } \n }\n if(primary_sort==7&&secondary_sort==6){\n if(primary_order==1&&secondary_order==1){\n //primary and second is ascending\n \n Collections.sort(fromFile, new SortSecondConfirmCount());\n Collections.sort(fromFile,new SortThirdConfirmCount());\n \n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==2&&secondary_order==2){\n //both descending\n Collections.sort(fromFile,new SortSecondConfirmCount().reversed());\n Collections.sort(fromFile, new SortThirdConfirmCount().reversed());\n \n \n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==1){\n //secondary is descending\n Collections.sort(fromFile, new SortSecondConfirmCount().reversed());\n Collections.sort(fromFile,new SortThirdConfirmCount());\n \n \n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n else if(primary_order==2){\n //primary is descending\n Collections.sort(fromFile,new SortSecondConfirmCount());\n Collections.sort(fromFile, new SortThirdConfirmCount().reversed());\n \n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n } \n } \n }\n if(primary_sort==6&&secondary_sort==8){\n if(primary_order==1&&secondary_order==1){\n //primary and second is ascending\n \n Collections.sort(fromFile, new SortFourthConfirmCount());\n Collections.sort(fromFile,new SortSecondConfirmCount());\n \n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==2&&secondary_order==2){\n //both descending\n Collections.sort(fromFile,new SortFourthConfirmCount().reversed());\n Collections.sort(fromFile, new SortSecondConfirmCount().reversed());\n \n \n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==1){\n //secondary is descending\n Collections.sort(fromFile, new SortFourthConfirmCount().reversed());\n Collections.sort(fromFile,new SortSecondConfirmCount());\n \n \n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n else if(primary_order==2){\n //primary is descending\n Collections.sort(fromFile,new SortFourthConfirmCount());\n Collections.sort(fromFile, new SortSecondConfirmCount().reversed());\n \n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n } \n } \n }\n if(primary_sort==8&&secondary_sort==6){\n if(primary_order==1&&secondary_order==1){\n //primary and second is ascending\n \n Collections.sort(fromFile, new SortSecondConfirmCount());\n Collections.sort(fromFile,new SortFourthConfirmCount());\n \n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==2&&secondary_order==2){\n //both descending\n Collections.sort(fromFile,new SortSecondConfirmCount().reversed());\n Collections.sort(fromFile, new SortFourthConfirmCount().reversed());\n \n \n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==1){\n //secondary is descending\n Collections.sort(fromFile, new SortSecondConfirmCount().reversed());\n Collections.sort(fromFile,new SortFourthConfirmCount());\n \n \n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n else if(primary_order==2){\n //primary is descending\n Collections.sort(fromFile,new SortSecondConfirmCount());\n Collections.sort(fromFile, new SortFourthConfirmCount().reversed());\n \n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n } \n } \n }\n if(primary_sort==7&&secondary_sort==8){\n if(primary_order==1&&secondary_order==1){\n //primary and second is ascending\n \n Collections.sort(fromFile, new SortFourthConfirmCount());\n Collections.sort(fromFile,new SortThirdConfirmCount());\n \n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==2&&secondary_order==2){\n //both descending\n Collections.sort(fromFile,new SortFourthConfirmCount().reversed());\n Collections.sort(fromFile, new SortThirdConfirmCount().reversed());\n \n \n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==1){\n //secondary is descending\n Collections.sort(fromFile, new SortFourthConfirmCount().reversed());\n Collections.sort(fromFile,new SortThirdConfirmCount());\n \n \n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n else if(primary_order==2){\n //primary is descending\n Collections.sort(fromFile,new SortFourthConfirmCount());\n Collections.sort(fromFile, new SortThirdConfirmCount().reversed());\n \n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n } \n } \n }\n if(primary_sort==8&&secondary_sort==7){\n if(primary_order==1&&secondary_order==1){\n //primary and second is ascending\n \n Collections.sort(fromFile, new SortThirdConfirmCount());\n Collections.sort(fromFile,new SortFourthConfirmCount());\n \n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==2&&secondary_order==2){\n //both descending\n Collections.sort(fromFile,new SortThirdConfirmCount().reversed());\n Collections.sort(fromFile, new SortFourthConfirmCount().reversed());\n \n \n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==1){\n //secondary is descending\n Collections.sort(fromFile, new SortThirdConfirmCount().reversed());\n Collections.sort(fromFile,new SortFourthConfirmCount());\n \n \n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n else if(primary_order == 2){\n //primary is descending\n Collections.sort(fromFile,new SortThirdConfirmCount());\n Collections.sort(fromFile, new SortFourthConfirmCount().reversed());\n \n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n } \n } \n }\n }", "public static void userSort(ArrayList<String>list) throws FileNotFoundException{\r\n\t\tCollections.sort(list, new Comparator<String>(){\r\n\t\t\t@Override\r\n\t\t\tpublic int compare(String o1, String o2) {\r\n\t\t\t\t// TODO Auto-generated method stub\r\n\t\t\t\t//Take the first string, split according to \";\", and store in an arraylist\r\n\t\t\t\tString[] values = o1.split(\";\");\r\n\t\t\t\t//Take the second string and do the same thing\r\n\t\t\t\tString[] values2 = o2.split(\";\");\r\n\t\t\t\t//Compare strings according to their integer values\r\n\t\t\t\treturn Integer.valueOf(values[0].replace(\"\\\"\", \"\")).compareTo(Integer.valueOf(values2[0].replace(\"\\\"\", \"\")));\r\n\t\t\t}\r\n\t\t});\r\n\t\t//Output sorted ArrayList to a text file\r\n\t\t@SuppressWarnings(\"resource\")\r\n\t\tPrintStream out = new PrintStream(new FileOutputStream(\"SortedUsers.txt\"));\r\n\t\t\tfor(int i = 0; i < list.size(); i++){\r\n\t\t\t\tout.println(list.get(i));\r\n\t\t\t}\r\n\t}", "static void mergeSortedFiles() throws IOException {\n\n\t\tBufferedReader[] bufReaderArray = new BufferedReader[noOfFiles];\n\t\tList<String> intermediateList = new ArrayList<String>();\n\t\tList<String> lineDataList = new ArrayList<String>();\n\n\t\tfor (int file = 0; file < noOfFiles; file++) {\n\t\t\tbufReaderArray[file] = new BufferedReader(new FileReader(DividedfileList.get(file)));\n\n\t\t\tString fileLine = bufReaderArray[file].readLine();\n\n\t\t\tif (fileLine != null) {\n\t\t\t\tintermediateList.add(fileLine.substring(0, 10));\n\t\t\t\tlineDataList.add(fileLine);\n\t\t\t}\n\t\t}\n\n\t\tBufferedWriter bufw = new BufferedWriter(new FileWriter(Outputfilepath));\n\n\t\t// Merge files into one file\n\n\t\tfor (long lineNumber = 0; lineNumber < totalLinesInMainFile; lineNumber++) {\n\t\t\tString sortString = intermediateList.get(0);\n\t\t\tint sortFile = 0;\n\n\t\t\tfor (int iter = 0; iter < noOfFiles; iter++) {\n\t\t\t\tif (sortString.compareTo(intermediateList.get(iter)) > 0) {\n\t\t\t\t\tsortString = intermediateList.get(iter);\n\t\t\t\t\tsortFile = iter;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tbufw.write(lineDataList.get(sortFile) + \"\\r\\n\");\n\t\t\tintermediateList.set(sortFile, \"-1\");\n\t\t\tlineDataList.set(sortFile, \"-1\");\n\n\t\t\tString nextString = bufReaderArray[sortFile].readLine();\n\n\t\t\tif (nextString != null) {\n\t\t\t\tintermediateList.set(sortFile, nextString.substring(0, 10));\n\t\t\t\tlineDataList.set(sortFile, nextString);\n\t\t\t} else {\n\t\t\t\tlineNumber = totalLinesInMainFile;\n\n\t\t\t\tList<String> ListToWrite = new ArrayList<String>();\n\n\t\t\t\tfor (int file = 0; file < intermediateList.size(); file++) {\n\t\t\t\t\tif (lineDataList.get(file) != \"-1\")\n\t\t\t\t\t\tListToWrite.add(lineDataList.get(file));\n\n\t\t\t\t\twhile ((sortString = bufReaderArray[file].readLine()) != null) {\n\t\t\t\t\t\tListToWrite.add(sortString);\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tCollections.sort(ListToWrite);\n\t\t\t\tint index = 0;\n\t\t\t\twhile (index < ListToWrite.size()) {\n\t\t\t\t\tbufw.write(ListToWrite.get(index) + \"\\r\\n\");\n\t\t\t\t\tindex++;\n\t\t\t\t}\n\n\t\t\t}\n\t\t}\n\t\tbufw.close();\n\t\tfor (int file = 0; file < noOfFiles; file++)\n\t\t\tbufReaderArray[file].close();\n\t}", "public static void mergesort (File A) throws IOException {\r\n\t\tFile copy = File.createTempFile(\"Mergesort\", \".bin\");\r\n\t\tcopyFile (A, copy);\r\n\r\n\t\tRandomAccessFile src = new RandomAccessFile(A, \"rw\");\r\n\t\tRandomAccessFile dest = new RandomAccessFile(copy, \"rw\");\r\n\t\tFileChannel srcC = src.getChannel();\r\n\t\tFileChannel destC = dest.getChannel();\r\n\t\tMappedByteBuffer srcMap = srcC.map (FileChannel.MapMode.READ_WRITE, 0, src.length());\r\n\t\tMappedByteBuffer destMap = destC.map (FileChannel.MapMode.READ_WRITE, 0, dest.length());\r\n\r\n\t\tmergesort (destMap, srcMap, 0, (int) A.length());\r\n\t\t\r\n\t\tsrc.close();\r\n\t\tdest.close();\r\n\t\tcopy.deleteOnExit();\r\n\t}", "public Files(){\n this.fileNameArray.add(\"bridge_1.txt\");\n this.fileNameArray.add(\"bridge_2.txt\");\n this.fileNameArray.add(\"bridge_3.txt\");\n this.fileNameArray.add(\"bridge_4.txt\");\n this.fileNameArray.add(\"bridge_5.txt\");\n this.fileNameArray.add(\"bridge_6.txt\");\n this.fileNameArray.add(\"bridge_7.txt\");\n this.fileNameArray.add(\"bridge_8.txt\");\n this.fileNameArray.add(\"bridge_9.txt\");\n this.fileNameArray.add(\"ladder_1.txt\");\n this.fileNameArray.add(\"ladder_2.txt\");\n this.fileNameArray.add(\"ladder_3.txt\");\n this.fileNameArray.add(\"ladder_4.txt\");\n this.fileNameArray.add(\"ladder_5.txt\");\n this.fileNameArray.add(\"ladder_6.txt\");\n this.fileNameArray.add(\"ladder_7.txt\");\n this.fileNameArray.add(\"ladder_8.txt\");\n this.fileNameArray.add(\"ladder_9.txt\");\n }", "@Override\n public int compareTo(Item o) {\n return name.compareTo(o.getName());\n }", "public void step2(){\n\n Collections.sort(names,(String a,String b) -> {\n return a.compareTo(b);\n });\n }", "public void sort() throws IOException {\n for(int i = 0; i < 32; i++)\n {\n if(i%2 == 0){\n filePointer = file;\n onePointer = one;\n }else{\n filePointer = one;\n onePointer = file;\n }\n filePointer.seek(0);\n onePointer.seek(0);\n zero.seek(0);\n zeroCount = oneCount = 0;\n for(int j = 0; j < totalNumbers; j++){\n int n = filePointer.readInt();\n sortN(n,i);\n }\n //Merging\n onePointer.seek(oneCount*4);\n zero.seek(0L);\n for(int j = 0; j < zeroCount; j++){\n int x = zero.readInt();\n onePointer.writeInt(x);\n }\n //One is merged\n }\n }", "public String name_of_sort()\r\n\t{\r\n\t\treturn \"Merge sort\";\r\n\t}", "@Test\n public void testStoreFileAlphabetical() {\n\n File file1 = new File(\"c\");\n File file2 = new File(\"b\");\n File file3 = new File(\"a\");\n parent.storeFile(file1);\n parent.storeFile(file2);\n parent.storeFile(file3);\n ArrayList<File> output = parent.getStoredFiles();\n ArrayList<File> expected = new ArrayList<File>();\n expected.add(file3);\n expected.add(file2);\n expected.add(file1);\n assertEquals(output, expected);\n }", "private void sortItems(List<Transaction> theList) {\n\t\tloadList(theList);\r\n\t\tCollections.sort(theList, new Comparator<Transaction>() {\r\n\t\t\tpublic int compare(Transaction lhs, Transaction rhs) {\r\n\t\t\t\t// String lhsName = lhs.getName();\r\n\t\t\t\t// String rhsName = rhs.getName();\r\n\r\n\t\t\t\treturn 0;\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t}", "@Override\n public int compareTo(Snippet o) {\n return this.name.compareTo(o.name);\n }", "@Override\n\tpublic int compareTo(Photo p) {\n\t\treturn (new Date(this.f.lastModified())).compareTo(new Date(p.getFile().lastModified()));\n\t}", "public void sort(Comparator<? super AudioFile> comparator) {\n Collections.sort(mObjects, comparator);\n if (mNotifyOnChange) notifyDataSetChanged();\n }", "public void sortGivenArray_name(){\n movieList = quickSort(movieList);\n }", "private void sortAlphabet()\n {\n for(int i = 0; i < movieList.size(); i++){\n for(int j = 1; j < movieList.size() - i; j++)\n {\n Movie a = movieList.get(j-1);\n Movie b = movieList.get(j);\n int result = a.getTitle().compareTo(b.getTitle());\n if(result > 0)\n {\n movieList.set(j-1, b);\n movieList.set(j, a);\n }\n }\n }\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 FileNameComparator(boolean desc) {\n this.desc = desc;\n }", "public static LinkedList<String> sortFilesByDate(LinkedList<String> mainDirectories, String subDirectory, Text text) {\n\t\t// Read the directories and sort the files\n\t\tLinkedList<String> sortedFileNames = new LinkedList<String>();\n\t\tComparator<File> comparator = new FileComparator();\n\t\tPriorityQueue<File> files = new PriorityQueue<File>(20, comparator);\n\t\twhile (!mainDirectories.isEmpty()) {\n\t\t\treadAndSortDirectoryFilesByDate(mainDirectories.removeFirst(), text,\n\t\t\t\t\tfiles, subDirectory);\n\t\t}\n\t\t// Transform Files priority queues list into String list\n\t\twhile (!files.isEmpty()) {\n\t\t\tsortedFileNames.addLast(files.remove().toString());\n\t\t}\n\t\treturn sortedFileNames;\n\t}", "public int compareTo(myclass p) {\n //deal with name 'all'\n if(this.getName().compareTo(\"all\")==0 && p.getName().compareTo(\"all\")!=0)\n return 1;\n else if (this.getName().compareTo(\"all\")!=0 && p.getName().compareTo(\"all\")==0)\n return -1;\n //deal with filename\n else if (this.getName().compareTo(p.getName()) < 0) {\n return -1;\n } else if (this.getName().compareTo(p.getName()) > 0) {\n return 1;}\n else{\n //deal with value\n if (this.x > p.x) {\n return -1;\n } else if (this.x < p.x) {\n return 1;\n } else {\n //deal with word\n if (this.getY().compareTo(p.getY()) < 0) {\n return -1;\n } else if (this.getY().compareTo(p.getY()) > 0) {\n return 1;\n } else {\n return 0;\n }\n\n }}\n }", "public void sort() {\r\n\t\tCollections.sort(parts);\r\n\t}", "public static void sort(String f1, String f2) throws FileNotFoundException, IOException {\n\t\tDataInputStream input = new DataInputStream(new BufferedInputStream(new FileInputStream(new File(f1))));\n\t\tfileSize = (int) input.available()/4;\n\t\tif (fileSize == 0){ input.close(); return;} //file is empty\t\n\t\t\n\t\tRandomAccessFile f1a = new RandomAccessFile(f1,\"rw\");\n\t\tRandomAccessFile f2a = new RandomAccessFile(f2,\"rw\");\n\t\tDataOutputStream f1d = new DataOutputStream(new BufferedOutputStream(new FileOutputStream(f1a.getFD())));\n\t\tDataOutputStream f2d = new DataOutputStream(new BufferedOutputStream(new FileOutputStream(f2a.getFD())));\n\t\t\n\t\t//perform quicksort on partitions of quickSortSize\n\t\tquickSortSize = (int) (Math.min(quickSortSize, fileSize)); \n\t\tint numDivisions = (int) (Math.floor(fileSize/quickSortSize));\n\t\tint excess = (int) (fileSize%(numDivisions*quickSortSize));\n\t\tint[] tmp = new int[quickSortSize];\n\t\tfor (int j = 0; j < numDivisions; j++){\n\t\t\tfor (int i = 0; i< quickSortSize; i++){\n\t\t\t\ttmp[i] = input.readInt();\n\t\t\t}\n\t\t\tquickSort(tmp);\n\t\t\tfor (int i: tmp){\n\t\t\t\tf2d.writeInt(i);\n\t\t\t}\n\t\t}\n\t\ttmp = new int[excess];\n\t\tfor (int i = 0; i< excess; i++){\n\t\t\ttmp[i] = input.readInt();\n\t\t}\n\t\tquickSort(tmp);\n\t\tfor (int i: tmp){\n\t\t\tf2d.writeInt(i);\n\t\t}\n\t\tf2d.flush();\n\t\tinput.close();\n\t\t\n\t\t//Perform Merge sort on the larger partitions\n\t\tint iteration = (int) Math.ceil(Math.log(fileSize/(quickSortSize))/Math.log(2));\n\t\tfor (int i = 0; i < iteration; i++){\n\t\t\tint size = (int) Math.pow(2, i)*quickSortSize;\n\t\t\tif (i%2 == 0){ \n\t\t\t\tf1a.seek(0);\n\t\t\t\tstepSorter(f2, f1d, size);\n\t\t\t} else {\n\t\t\t\tf2a.seek(0);\n\t\t\t\tstepSorter(f1, f2d, size);\n\t\t\t}\n\t\t}\n\n\t\t//Copies f2 to f1 if the iteration ends with f2\n\t\tif (iteration%2==0){\n\t\t\tFileChannel source = null;\n\t\t\tFileChannel destination = null;\n\t\t\ttry {\n\t\t\t\tsource = new FileInputStream(f2).getChannel();\n\t\t\t\tdestination = new FileOutputStream(f1).getChannel();\n\t\t destination.transferFrom(source, 0, source.size());\n\t\t }\n\t\t finally {\n\t\t if(source != null) {\n\t\t source.close();\n\t\t }\n\t\t if(destination != null) {\n\t\t destination.close();\n\t\t }\n\t\t }\n\t\t}\n\t\tf1a.close();\n\t\tf2a.close();\n\t\tf1d.close();\n\t\tf2d.close();\n\t}", "public static String parseSortClassName(final String name) {\n final int index = name.lastIndexOf('.');\n return name.substring(index + 1, name.length());\n }", "java.lang.String getFileNames(int index);", "java.lang.String getFileNames(int index);", "void sort();", "void sort();", "public static void sortInputExternalMerge() {\r\n\t\tExternalMultiwayMerge merge = new ExternalMultiwayMerge();\r\n\t\tmerge.sort(inputFile, M, d);\r\n\t}", "@Override\n public int compare(SongInfo o1, SongInfo o2) {\n return o1.getSongName().compareTo(o2.getSongName());\n }", "private SortOrder(String strName) { m_strName = strName; }", "public void sortEmployeeByName() {\r\n\t\tfor (int indexI = 0; indexI < emp.size() - 1; indexI++) {\r\n\t\t\t\r\n\t\t\tfor (int indexJ = 0; indexJ < emp.size() - indexI - 1; indexJ++) {\r\n\t\t\t\r\n\t\t\t\tif ((emp.get(indexJ).name).compareTo(emp.get(indexJ + 1).name) > 0) {\r\n\t\t\t\t\tEmployee temp1 = emp.get(indexJ);\r\n\t\t\t\t\tEmployee temp2 = emp.get(indexJ + 1);\r\n\t\t\t\t\temp.set(indexJ, temp2);\r\n\t\t\t\t\temp.set(indexJ + 1, temp1);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t}", "public int compareTo(Object arg) {\n\t\tFileSystem temp = (FileSystem) arg;\n\t\treturn(_mount.compareTo(temp.getMountPoint()));\n\t}", "public void step4(){\n\n Collections.sort(names,(a,b)->b.compareTo(a));\n\n\n System.out.println(\"names sorted are :\"+names);\n }", "@Override\n protected Comparator<? super UsagesInFile> getRefactoringIterationComparator() {\n return new Comparator<UsagesInFile>() {\n @Override\n public int compare(UsagesInFile o1, UsagesInFile o2) {\n int result = comparePaths(o1.getFile(), o2.getFile());\n if (result != 0) {\n return result;\n }\n int imports1 = countImports(o1.getUsages());\n int imports2 = countImports(o2.getUsages());\n return imports1 > imports2 ? -1 : imports1 == imports2 ? 0 : 1;\n }\n\n private int comparePaths(PsiFile o1, PsiFile o2) {\n String path1 = o1.getVirtualFile().getCanonicalPath();\n String path2 = o2.getVirtualFile().getCanonicalPath();\n return path1 == null && path2 == null ? 0 : path1 == null ? -1 : path2 == null ? 1 : path1.compareTo(path2);\n }\n\n private int countImports(Collection<UsageInfo> usages) {\n int result = 0;\n for (UsageInfo usage : usages) {\n if (FlexMigrationUtil.isImport(usage)) {\n ++result;\n }\n }\n return result;\n }\n };\n }", "public int compareFiles(File file1, File file2)\n\t\t\tthrows FileNotFoundException {\n\t\treturn _order.compareFiles(file1, file2) * (_reverse ? -1 : 1);\n\t}", "public List<String> sortFilesByExtensions(String[] listOfFileNames) throws DirectoryException{\r\n\t\tList<String> orginalList = new CopyOnWriteArrayList<>(Arrays.asList(listOfFileNames));\r\n\t\tSet<String> setOfuniqueExtension = new TreeSet<>();\r\n\r\n\t\tfor (String item : listOfFileNames) {\r\n\t\t\tif (item.contains(\".\")) {\r\n\t\t\t\tString[] split = item.split(HelperContstants.DELIMETER);\r\n\t\t\t\tString temp = \".\" + split[split.length - 1];\r\n\t\t\t\tsetOfuniqueExtension.add(temp);\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tList<String> finalListOfAllFiles = new LinkedList<>();\r\n\t\tsetOfuniqueExtension.stream().forEach((s1) -> {\r\n\t\t\tfor (int i = 0; i < orginalList.size(); i++) {\r\n\t\t\t\tif (orginalList.get(i).contains(s1)) {\r\n\t\t\t\t\tfinalListOfAllFiles.add(orginalList.get(i));\r\n\t\t\t\t\torginalList.remove(orginalList.get(i));\r\n\t\t\t\t\ti--;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t\torginalList.stream().filter((s1) -> (!finalListOfAllFiles.contains(s1))).forEach((s1) -> {\r\n\t\t\tfinalListOfAllFiles.add(s1);\r\n\t\t});\r\n\r\n\t\treturn finalListOfAllFiles;\r\n\t}", "private void mapSortedFiles(String file1, String file2) {\n\t\tString file1Copy = tempPath + tempFileName.getTempFileName(sourcePath1, \"Mapper\");\r\n\t\tString file2Copy = tempPath + tempFileName.getTempFileName(sourcePath2, \"Mapper\");\r\n\r\n\t\tcreateFileCopy(new File(file1).toPath(), file1Copy);\r\n\t\tcreateFileCopy(new File(file2).toPath(), file2Copy);\r\n\r\n\t\ttry {\r\n\t\t\tLineIterator file1Iterator = FileUtils.lineIterator(new File(file1));\r\n\r\n\t\t\tLineIterator file2Iterator = FileUtils.lineIterator(new File(file2));\r\n\r\n\t\t\tint leftIndex = 0;\r\n\t\t\tint rightIndex = 0;\r\n\r\n\t\t\twhile (file1Iterator.hasNext()) {\r\n\r\n\t\t\t\tString left = file1Iterator.nextLine();\r\n\t\t\t\tString right = file2Iterator.nextLine();\r\n\r\n\t\t\t\tString leftSortKey = getSortKey(left);\r\n\t\t\t\tString rightSortKey = getSortKey(right);\r\n\t\t\t\t\r\n\t\t\t\tleftIndex++;\r\n\t\t\t\trightIndex++;\r\n\t\t\t\t\r\n\r\n\t\t\t\twhile (leftSortKey.compareTo(rightSortKey) > 0) {\r\n\t\t\t\t\t\r\n\t\t\t\t\t//System.out.println(leftSortKey +\", \" + rightSortKey);\r\n\r\n\t\t\t\t\tList<String> lines = Files.readAllLines(Paths.get(file1Copy));\r\n\t\t\t\t\tlines.add(leftIndex-1, getEmptyLine());\r\n\t\t\t\t\tFiles.write(Paths.get(file1Copy), lines);\r\n\r\n\t\t\t\t\trightIndex++;\r\n\t\t\t\t\tright = file2Iterator.nextLine();\r\n\t\t\t\t\trightSortKey = getSortKey(right);\r\n\r\n\t\t\t\t}\r\n\r\n\t\t\t\twhile (leftSortKey.compareTo(rightSortKey) < 0) {\r\n\t\t\t\t\t\r\n\t\t\t\t\t//System.out.println(leftSortKey +\", \" + rightSortKey);\r\n\r\n\t\t\t\t\tList<String> lines = Files.readAllLines(Paths.get(file2Copy));\r\n\t\t\t\t\tlines.add(rightIndex-1, getEmptyLine());\r\n\t\t\t\t\tFiles.write(Paths.get(file2Copy), lines);\r\n\r\n\t\t\t\t\tleftIndex++;\r\n\t\t\t\t\tleft = file1Iterator.nextLine();\r\n\t\t\t\t\tleftSortKey = getSortKey(left);\r\n\r\n\t\t\t\t}\r\n\r\n\t\t\t}\r\n\r\n\t\t} catch (IOException e) {\r\n\t\t\tSystem.out.println(\"Temp file was not found: \" + e.getMessage());\r\n\t\t}\r\n\r\n\t}", "public static ArrayList<File> sortOsmFiles(Set<File> files) {\n File[] sortingArray = files.toArray(new File[0]);\n Arrays.sort(sortingArray, LastModifiedFileComparator.LASTMODIFIED_COMPARATOR);\n ArrayList<File> sortedList = new ArrayList<>();\n for(int i = 0; i < sortingArray.length; i++) {\n sortedList.add(sortingArray[i]);\n }\n\n return sortedList;\n }" ]
[ "0.72009665", "0.71134895", "0.6819677", "0.68182033", "0.67074585", "0.66604745", "0.65176404", "0.6513625", "0.635522", "0.63166666", "0.62951475", "0.62918425", "0.623394", "0.62075645", "0.6191847", "0.61697865", "0.61366004", "0.60549265", "0.6052062", "0.60381526", "0.60376215", "0.6017515", "0.6002576", "0.5991571", "0.5964107", "0.5934093", "0.5930779", "0.5928894", "0.5921", "0.5909519", "0.58911455", "0.58842224", "0.58840084", "0.5869654", "0.5861985", "0.58531076", "0.5832058", "0.58219934", "0.5819763", "0.58008975", "0.5799532", "0.5798579", "0.5798187", "0.5798187", "0.5780974", "0.57623154", "0.57534254", "0.57530785", "0.5745548", "0.57425237", "0.57308894", "0.5716989", "0.56918305", "0.56917244", "0.56807387", "0.5675417", "0.5663396", "0.5659953", "0.5652879", "0.5652262", "0.56266385", "0.5620707", "0.561829", "0.56053454", "0.55946887", "0.5585851", "0.55634165", "0.5560522", "0.55512327", "0.55456144", "0.55402523", "0.5532478", "0.55151546", "0.55110884", "0.5509097", "0.55062735", "0.5485258", "0.5477738", "0.5475744", "0.5468974", "0.54647887", "0.5461454", "0.5460172", "0.5459788", "0.54593486", "0.54574955", "0.54574955", "0.5445314", "0.5445314", "0.54447955", "0.5441721", "0.5419604", "0.5417013", "0.5401712", "0.5400197", "0.53912944", "0.5387989", "0.53855896", "0.53837025", "0.53824973" ]
0.6506237
8
method to sort file object by ites name
public File[] SortFilesByDate(final File[] Files, final boolean bSortDesecnding) { File[] faFiles = null; Comparator<File> comparator = null; try { faFiles = Files.clone(); if (faFiles == null) { throw new Exception("Null File Array Object"); } //check if array consists of more than 1 file if (faFiles.length > 1) { //creating Comparator comparator = new Comparator<File>() { @Override protected Object clone() throws CloneNotSupportedException { return super.clone(); //To change body of generated methods, choose Tools | Templates. } @Override public int compare(File objFile1, File objFile2) { String Str1 = objFile1.getName(); String Str2 = objFile2.getName(); if (bSortDesecnding) { int iRetVal = objFile1.getName().compareTo(objFile2.getName()); return iRetVal; } else { int iRetVal = objFile1.getName().compareToIgnoreCase(objFile2.getName()); return iRetVal; } } }; //Sorting Array Arrays.sort(faFiles, comparator); } } catch (Exception e) { faFiles = null; } finally { return faFiles; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\n public int compare(File o1, File o2) {\n if (desc) {\n return -o1.getFileName().compareTo(o2.getFileName());\n }\n return o1.getFileName().compareTo(o2.getFileName());\n }", "private void sort() {\n setFiles(getFileStreamFromView());\n }", "public void sortByName(String file) throws FileNotFoundException, IOException, ParseException {\n\t\tarrayList = pareseFile(file);\n\t\tFile file1 = new File(file);\n\t\t/*\n\t\t * for (int i = 0; i < arrayList.size(); i++) { JSONObject\n\t\t * person1=(JSONObject)arrayList.get(i); //person1.get(\"lastName\");\n\t\t * arrayList.sort((Person.CompareByName)person1); }\n\t\t */\n\t\t// mapper.writeValue(file1, arrayList);\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(\"lastName\").toString()).compareToIgnoreCase(person2.get(\"lastName\").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 int compareTo (Object o) {\n return getFileName ().compareTo (((Page)o).getFileName());\n }", "public static File[] getSortedFiles(File[] files){\n Arrays.sort(files, new Comparator<File>() {\t\n \tpublic int compare(File o1, File o2){\n \t\tint n1 = getPageSequenceNumber(o1.getName());\n \t\tint n2 = getPageSequenceNumber(o2.getName());\n \t\treturn n1 - n2;\n \t}\n });\n \n return files;\n\t}", "@Override\n\tpublic int compare(File f1, File f2) {\n\t\treturn f1.compareTo(f2);\n\t}", "private static File[] sortFileList(File[] list, String sort_method) {\n // sort the file list based on sort_method\n // if sort based on name\n if (sort_method.equalsIgnoreCase(\"name\")) {\n Arrays.sort(list, new Comparator<File>() {\n public int compare(File f1, File f2) {\n return (f1.getName()).compareTo(f2.getName());\n }\n });\n }\n else if (sort_method.equalsIgnoreCase(\"size\")) {\n Arrays.sort(list, new Comparator<File>() {\n public int compare(File f1, File f2) {\n return Long.valueOf(f1.length()).compareTo(f2.length());\n }\n });\n }\n else if (sort_method.equalsIgnoreCase(\"time\")) {\n Arrays.sort(list, new Comparator<File>() {\n public int compare(File f1, File f2) {\n return Long.valueOf(f1.lastModified()).compareTo(f2.lastModified());\n }\n });\n }\n return list;\n }", "private static File[] sortFileList(File[] list, String sort_method) {\n // sort the file list based on sort_method\n // if sort based on name\n if (sort_method.equalsIgnoreCase(\"name\")) {\n Arrays.sort(list, new Comparator<File>() {\n public int compare(File f1, File f2) {\n return (f1.getName()).compareTo(f2.getName());\n }\n });\n } else if (sort_method.equalsIgnoreCase(\"size\")) {\n Arrays.sort(list, new Comparator<File>() {\n public int compare(File f1, File f2) {\n return Long.valueOf(f1.length()).compareTo(f2.length());\n }\n });\n } else if (sort_method.equalsIgnoreCase(\"time\")) {\n Arrays.sort(list, new Comparator<File>() {\n public int compare(File f1, File f2) {\n return Long.valueOf(f1.lastModified()).compareTo(f2.lastModified());\n }\n });\n }\n return list;\n }", "public File[] SortFilesByName(final File[] Files, final boolean bCaseSensitive, final boolean bSortDesecnding) {\n\n File[] faFiles = null;\n Comparator<File> comparator = null;\n\n try {\n faFiles = Files.clone();\n if (faFiles == null) {\n throw new Exception(\"Null File Array Object\");\n }\n\n //check if array consists of more than 1 file\n if (faFiles.length > 1) {\n\n //creating Comparator\n comparator = new Comparator<File>() {\n\n @Override\n protected Object clone() throws CloneNotSupportedException {\n return super.clone(); //To change body of generated methods, choose Tools | Templates.\n }\n\n @Override\n public int compare(File objFile1, File objFile2) {\n String Str1 = objFile1.getName();\n String Str2 = objFile2.getName();\n\n if (bCaseSensitive) {\n int iRetVal = objFile1.getName().compareTo(objFile2.getName());\n return iRetVal;\n } else {\n int iRetVal = objFile1.getName().compareToIgnoreCase(objFile2.getName());\n return iRetVal;\n }\n }\n };\n\n //Sorting Array\n if (bSortDesecnding) {//Descending\n\n } else {//Ascending\n Arrays.sort(faFiles, comparator);\n }\n }\n\n } catch (Exception e) {\n faFiles = null;\n } finally {\n return faFiles;\n }\n\n }", "public String sortBy();", "@Override\n public void sortCurrentList(FileSortHelper sort) {\n }", "public static void ascendingOrder(File folder) {\n try {\n\n folder.exists();\n File[] listOfFiles = folder.listFiles();\n Arrays.sort(listOfFiles);\n if (listOfFiles.length > 0) {\n for(int i = 0; i < listOfFiles.length; i++) {\n\n System.out.println(\"File :\" + listOfFiles[i].getName());\n }\n } else {\n System.out.println(\"No Files in the folder\");\n }\n } catch (Exception e) {\n System.out.println(e.getMessage());\n }\n }", "public ArrayList<String> getSortedNames() throws Exception {\n FileReader fileReader = new FileReader();\n // Tell FileReader the file path\n fileReader.setFilePath(\"src/main/java/ex41/base/exercise41_input.txt\");\n // use FileReader to get an Arraylist and store it\n ArrayList<String> names = fileReader.getStrings();\n // call sort method to sort arraylist and return that\n return sort(names);\n }", "public static List<File> sortByName(List<File> files) {\n\t\tComparator<File> comp = new Comparator<File>() {\n\t\t\t@Override\n\t\t\tpublic int compare(File file1, File file2) {\n\t\t\t\treturn file1.getName().compareTo(file2.getName());\n\t\t\t}\n\t\t};\n\t\tCollections.sort(files, comp);\n\t\treturn files;\n\t}", "public String doSort();", "public void testCompareViaSort() throws Exception {\n\n String correctlySortedNames[] = {\n \"0000_aaa\",\n \"0000_bbb\",\n \"1111DC_U_022107_L99_Sum.lsm\",\n \"6325DC_U_022107_L0_Sum.lsm\",\n \"6325DC_U_022107_L1_Sum.lsm\",\n \"6325DC_U_022107_L2_Sum.lsm\",\n \"6325DC_U_022107_L8_Sum.lsm\",\n \"6325DC_U_022107_L9_Sum.lsm\",\n \"6325DC_U_022107_L10_Sum.lsm\",\n \"6325DC_U_022107_L11_Sum.lsm\",\n \"6325DC_U_022107_L20_Sul.lsm\",\n \"6325DC_U_022107_L20_Sum.lsm\",\n \"6325DC_U_022107_L20_Sun.lsm\",\n \"6325DC_U_022107_L21_Sum.lsm\",\n \"6325DC_U_022107_L22_Sum.lsm\",\n \"6325DC_U_022107_L99_Sum.lsm\",\n \"6325DC_U_022107_L111_Sum.lsm\",\n \"6325DC_U_022107_L222_Sum.lsm\",\n \"7777DC_U_022107_L22_Sum.lsm\",\n \"9999_aaa\",\n \"9999_bbb\" \n };\n\n FileTarget[] targets = new FileTarget[correctlySortedNames.length];\n\n int index = 0;\n for (String name : correctlySortedNames) {\n int reverseOrder = targets.length - 1 - index;\n File file = new File(name);\n targets[reverseOrder] = new FileTarget(file);\n index++;\n }\n\n Arrays.sort(targets, new LNumberComparator());\n\n index = 0;\n for (FileTarget target : targets) {\n assertEquals(\"name \" + index + \" of \" + targets.length +\n \" was not sorted correctly\",\n correctlySortedNames[index], target.getName());\n index++;\n }\n }", "@Override\n public int compare(FileNameExtensionFilter ext1, FileNameExtensionFilter ext2)\n {\n return ext1.getDescription().toLowerCase().compareTo(ext2.getDescription().toLowerCase());\n }", "public static <T extends FileData> void sortFileDataByOrder(List<T> fileDataToSort) {\n Collections.sort(fileDataToSort, new Comparator<T>() {\n public int compare(T o1, T o2) {\n int ret = Integer.valueOf(o1.getOrder()).compareTo(o2.getOrder());\n if (ret != 0) {\n return ret;\n }\n return OID.compareOids(o1.getUniqueOid(), o2.getUniqueOid());\n }\n });\n }", "private void sortFileToScreen() throws FileNotFoundException {\n Scanner file = new Scanner(new File(FILE_NAME));\n while (file.hasNext()) {\n addToOrderedList(file.nextInt());\n }\n file.close();\n printList();\n }", "public static void sortFiles(List<File> files)\r\n\t{\r\n\t\t/*\r\n\t\t * bubblesort algorithm\r\n\t\t */\r\n\t\tboolean changesMade = true;\r\n\t\t\r\n\t\twhile (changesMade)\r\n\t\t{\r\n\t\t\tchangesMade = false;\r\n\t\t\t\r\n\t\t\tfor(int x=1; x<files.size(); x++)\r\n\t\t\t{\r\n\t\t\t\t/*\r\n\t\t\t\t * if file at index x has a lower number than the file\r\n\t\t\t\t * at index x-1\r\n\t\t\t\t */\r\n\t\t\t\tif(getFileNum(files.get(x)) < getFileNum(files.get(x-1)))\r\n\t\t\t\t{\r\n\t\t\t\t\t/*\r\n\t\t\t\t\t * put this file in the previous index\r\n\t\t\t\t\t */\r\n\t\t\t\t\tFile tempFile = files.get(x);\r\n\t\t\t\t\tfiles.remove(x);\r\n\t\t\t\t\tfiles.add(x-1, tempFile);\r\n\t\t\t\t\t\r\n\t\t\t\t\t//indicate changes were made\r\n\t\t\t\t\tchangesMade = true;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t\r\n\t\t}\r\n\t\t\r\n\t}", "@Override\n\tpublic int compareTo(File pathname) {\n\t\treturn this.index - new IndexedFile(pathname.getAbsolutePath()).index;\n\t}", "ArrayList<String> sortFiles(String[] allFiles){\n\n ArrayList<String> tempArrayList = new ArrayList<String>();\n ArrayList<String> returnArrayList = new ArrayList<String>();\n String[] tempArray = allFiles;\n String[] returnArray;\n\n int numOfFiles = tempArray.length;\n\n //delete nonneeded files\n for(int k = 0; k < numOfFiles; k++){\n if (tempArray[k].startsWith(\"G-\") || tempArray[k].startsWith(\"M-\") || tempArray[k].startsWith(\"I-\")){\n tempArrayList.add(tempArray[k]);\n }\n }\n\n returnArray = new String[tempArrayList.size()];\n for(int i = 0; i < tempArrayList.size(); i++){\n returnArray[i] = tempArrayList.get(i);\n }\n\n //if 0 return empty array\n if (returnArray.length < 2){\n return returnArrayList;\n }\n\n //bubble sort\n for (int i = 0; i < returnArray.length-1; i++){\n for (int j = 0; j < returnArray.length-i-1; j++){\n //get string of full number from file\n String tempFirst = returnArray[j].split(\"_\")[2] + returnArray[j].split(\"_\")[3];\n String tempSecond = returnArray[j+1].split(\"_\")[2] + returnArray[j+1].split(\"_\")[3];\n //take out csv if it is not a subgraph\n if (!tempFirst.contains(\"_subgraph_\")){\n tempFirst = tempFirst.substring(0,14);\n }\n if (!tempSecond.contains(\"_subgraph_\")){\n tempSecond = tempSecond.substring(0,14);\n }\n //get int of string\n long tempFirstNum = Long.parseLong(tempFirst);\n long tempSecondNum = Long.parseLong(tempSecond);\n //compare and swap if bigger\n if (tempFirstNum >= tempSecondNum)\n {\n String temp = returnArray[j];\n returnArray[j] = returnArray[j+1];\n returnArray[j+1] = temp;\n }\n }\n }\n\n //add elements to arraylist with newest date being first\n for(int k = returnArray.length-1; k >= 0; k--){\n returnArrayList.add(returnArray[k]);\n System.out.println(allFiles[k]);\n }\n\n return returnArrayList;\n }", "protected void sortCode() {\n for (int i = 1; i < codeCount; i++) {\n int who = i;\n for (int j = i + 1; j < codeCount; j++) {\n if (code[j].getFileName().compareTo(code[who].getFileName()) < 0) {\n who = j; // this guy is earlier in the alphabet\n }\n }\n if (who != i) { // swap with someone if changes made\n SketchCode temp = code[who];\n code[who] = code[i];\n code[i] = temp;\n }\n }\n }", "@Override\n public int compareTo(final ModelFile o) {\n final ModelFile otherModelFile = ((ModelFile) o);\n return this.file.getFullPath().toString().compareTo(otherModelFile.file.getFullPath().toString());\n }", "public File sort(String path){\n try {\r\n File file = new File(path);\r\n BufferedReader readStream = new BufferedReader(new FileReader(file));\r\n String currentLine;\r\n int index = 0;\r\n int fileNumber = 1;\r\n while((currentLine = readStream.readLine()) != null){\r\n tempArray[index++] = currentLine;//read next line into the temporary array\r\n if(index >= limit){//check whether the number of lines stored in the temp has reached the maximum allowed\r\n Arrays.sort(tempArray);//sort tempArray\r\n Writer writeStream = null;//create a writer\r\n String currentFileName = \"temp\" + fileNumber + \".txt\";//this name is passed to the buffered writer\r\n writeStream = new BufferedWriter(new OutputStreamWriter(new FileOutputStream(currentFileName)));//create a new temporary file to be written to\r\n fileArrayList.add(new File(currentFileName));//add file to list\r\n for(String line : tempArray){// write the lines currently stored in the array into the newly created file\r\n writeStream.write(line);\r\n writeStream.write(\"\\n\");\r\n }\r\n writeStream.close();//close the output stream\r\n index = 0;//reset\r\n ++fileNumber;//increment the file number so that the next block of lines is written to a different file name\r\n }\r\n\r\n\r\n }\r\n readStream.close();\r\n }catch(Exception e){\r\n System.out.println(e.getMessage() + \" occurred during split\");\r\n }\r\n\r\n //merge temporary files and write to output file\r\n try {\r\n System.out.println(Arrays.toString(fileArrayList.toArray()));\r\n fileArrayList.trimToSize();\r\n int sortedFileID = 0;//used to differentiate between temporary files while merging\r\n int head = 0;//used to access file names stored in array list from the start\r\n int tail = fileArrayList.size() - 1;//used to access file names stored in array list from the end\r\n while(fileArrayList.size() > 1) {\r\n sortedFileID++;//increment to create a unique file name\r\n String mergedFileName = \"sorted\"+sortedFileID+\".txt\";\r\n File firstFile = fileArrayList.get(head);\r\n File secondFile = fileArrayList.get(tail);\r\n System.out.println(head + \" + \" + tail);\r\n //merge first and second\r\n File combinedFile = mergeFiles(firstFile, secondFile, mergedFileName);\r\n //delete both temporary files once they are merged\r\n\r\n if(!secondFile.delete()){\r\n System.out.println(\"warning file could not be deleted\");\r\n }\r\n if(!firstFile.delete()){\r\n System.out.println(\"warning file could not be deleted\");\r\n }\r\n fileArrayList.set(head, combinedFile);//replace the first of the two merged files with the new combined file\r\n fileArrayList.remove(tail);//remove the second of the two merged files\r\n head++;//increment both indexes one position closer towards the center of the array list\r\n tail--;\r\n if(head >= tail){//check if there are no remaining files between the head and the tail\r\n head = 0;//reset to the beginning of the array list\r\n fileArrayList.trimToSize();\r\n tail = fileArrayList.size() - 1;//reset to the end of the array list\r\n }\r\n }\r\n }catch(Exception e){\r\n System.out.println(e.getMessage() + \" occurred during merge\");\r\n }\r\n //after iteratively merging head and tail, and storing the result at the head index\r\n //the final resulting file that combines all temporary files will be stored at index (0)\r\n return fileArrayList.get(0);//return the final combined file\r\n }", "public static void main(String[] args) throws FileNotFoundException, IOException {\n BufferedReader br = new BufferedReader(new FileReader(\"D:\\\\name-sorter\\\\unsorted-names-list.txt\"));\n \n // Step 5: Create an ArrayList to hold the Person objects.\n ArrayList<Person> listPersonNames = new ArrayList<Person>();\n \n // Step 6 : Read every person record from input text file. For each person record, \n // create one person object and add that person object into listPersonNames.\n String line = br.readLine();\n \n while(line != null){\n String[] names = line.split(\" \");\n\n String givenNames = \"\";\n for(int a=0; a < names.length-1; a++){\n givenNames += names[a];\n givenNames += \" \";\n }\n \n String lastName = names[names.length-1];\n \n listPersonNames.add(new Person(givenNames, lastName));\n \n line = br.readLine();\n }\n \n // Step 7 : Sort the ArrayList listPersonNames using Collections.sort() method by passing \n // NamesCompare object to sort the text file.\n Collections.sort(listPersonNames, new NamesCompare());\n \n // Step 8 : Create BufferedWriter object to write the records into output text file.\n BufferedWriter writer = new BufferedWriter(new FileWriter(\"D:\\\\name-sorter\\\\sorted-names-list.txt\"));\n \n // Step 9 : Write each listPersonNames into output text file.\n for (Person person : listPersonNames){\n writer.write(person.givenNames);\n writer.write(\" \"+person.lastName);\n writer.newLine();\n \n System.out.println(person.givenNames+\" \"+person.lastName);\n }\n \n // Step 10 : Close the resources.\n br.close();\n writer.close();\n }", "public static void sort(File input, File output) throws IOException {\n ExternalSort.mergeSortedFiles(ExternalSort.sortInBatch(input), output);\n }", "private Stream<File> sort(final Stream<File> fileStream) {\n return fileStream.sorted(new FileMetaDataComparator(callback.orderByProperty().get(),\n callback.orderDirectionProperty().get()));\n }", "public FileMergeSort() {\r\n }", "@Override\r\n\tpublic int compare(FileBean bean1, FileBean bean2) {\r\n\t\t// TODO Auto-generated method stub\r\n\t\treturn bean1.compareTo(bean2);\r\n\t}", "static void doSort(int location) throws Exception {\n\n\t\tList<String> sortedList = null;\n\n\t\tsortedList = readDataFile(DividedfileList.get(location));\n\t\tCollections.sort(sortedList);\n\t\twriteFile(sortedList, location);\n\t\tsortedList.clear();\n\n\t}", "@Override\r\n\tpublic int compareTo(FileBean bean) {\r\n\t\tif(this.getLocation().compareTo(bean.getLocation()) > 0){\r\n\t\t\treturn 1;\r\n\t\t}else if(this.getLocation().compareTo(bean.getLocation()) < 0){\r\n\t\t\treturn -1;\r\n\t\t} else{\r\n\t\t\treturn 0;\r\n\t\t}\r\n\t}", "public static void main(String[] args) {\n\n File folder = new File(\"D:\\\\UNSORTED TBW\\\\\");\n File[] listOfFiles = folder.listFiles();\n String defaultPath = \"D:\\\\UNSORTED TBW\\\\\";\n\n\n //for loop for each file in the list\n for (int i = 0; i < listOfFiles.length; i++) {\n if (listOfFiles[i].isFile()) {\n\n //splits file name with - Only want the name before - so we call for 0.\n //This is the deafult way of show my shows are sorted.\n // also adds a - in the string in case there is no - in file\n String fileName = listOfFiles[i].getName() + \"-\";\n String[] names = fileName.split(\"-\");\n //System.out.print(names[0]+\"\\n\");\n Path folderPath = Paths.get(defaultPath + names[0].trim() + \"\\\\\");\n System.out.print(folderPath + \"\\n\");\n File directory = new File(String.valueOf(folderPath));\n\n //checks if directory exists. if does not exist, make new directory.\n if (!directory.exists()) {\n //makes a directory if not exists\n directory.mkdir();\n }\n //sets initial file directory\n File dirA = listOfFiles[i];\n //renames the file path of the file i nthe if loop\n //returns a user response if successful or not\n if (dirA.renameTo(new File(String.valueOf(folderPath) + \"\\\\\" + dirA.getName()))) {\n System.out.print(\"Move success\");\n } else {\n System.out.print(\"Failed\");\n }\n }\n }\n }", "public int compare(File file, File file2) {\n if (file == null || file2 == null || file.lastModified() >= file2.lastModified()) {\n return (file == null || file2 == null || file.lastModified() != file2.lastModified()) ? 1 : 0;\n }\n return -1;\n }", "public int compare(File file, File file2) {\n if (file.lastModified() > file2.lastModified()) {\n return 1;\n }\n if (file.lastModified() == file2.lastModified()) {\n return 0;\n }\n return -1;\n }", "public int compareTo(AppFile aAF)\n{\n if(_priority!=aAF._priority) return _priority>aAF._priority? -1 : 1;\n return _file.compareTo(aAF._file);\n}", "@Override\n public void sort() throws IOException {\n long i = 0;\n // j represents the turn of writing the numbers either to g1 or g2 (or viceversa)\n long j = 0;\n long runSize = (long) Math.pow(2, i);\n long size;\n\n long startTime = System.currentTimeMillis();\n\n System.out.println(\"Strart sorting \"+ this.inputFileName);\n\n while(i <= Math.ceil(Math.log(this.n) / Math.log(2))){\n j = 0;\n do{\n size = merge(runSize, destinationFiles[(int)j % 2]);\n j += 1;\n }while (size/2 == runSize);\n\n System.out.println(\"iteration: \" + i + \", Run Size:\" + runSize + \", Total time elapsed: \" + (System.currentTimeMillis() - startTime));\n i += 1;\n runSize = (long) Math.pow(2, i);\n swipe();\n }\n System.out.println(\"The file has been sorted! Total time elapsed: \"+(System.currentTimeMillis() - startTime));\n\n destinationFiles[0].close();\n destinationFiles[1].close();\n originFiles[0].close();\n originFiles[1].close();\n\n createFile(OUT_PATH +inputFileName);\n copyFile(new File(originFileNames[0]), new File(\"out/TwoWayMergesort/OUT_\"+inputFileName));\n\n }", "void sortName()\r\n\t{\r\n\t\tCollections.sort(this, this.ContactNameComparator);\r\n\t}", "public int compare(File file, File file2) {\n int i = ((file.lastModified() - file2.lastModified()) > 0 ? 1 : ((file.lastModified() - file2.lastModified()) == 0 ? 0 : -1));\n if (i > 0) {\n return 1;\n }\n return i == 0 ? 0 : -1;\n }", "@Override\r\n\t\t\tpublic int compare(File o1, File o2) {\n\t\t\t\treturn Long.compare(o2.lastModified(), o1.lastModified());\r\n\t\t\t}", "@Override\r\n\t\t\tpublic int compare(File o1, File o2) {\n\t\t\t\treturn Long.compare(o1.lastModified(), o2.lastModified());\r\n\t\t\t}", "public int compare(File file, File file2) {\n if (file == null || file2 == null || file.lastModified() >= file2.lastModified()) {\n return (file == null || file2 == null || file.lastModified() != file2.lastModified()) ? 1 : 0;\n }\n return -1;\n }", "public int compare(File file, File file2) {\n int i = ((file.lastModified() - file2.lastModified()) > 0 ? 1 : ((file.lastModified() - file2.lastModified()) == 0 ? 0 : -1));\n if (i > 0) {\n return 1;\n }\n return i == 0 ? 0 : -1;\n }", "public int compare(File file, File file2) {\n int i = ((file.lastModified() - file2.lastModified()) > 0 ? 1 : ((file.lastModified() - file2.lastModified()) == 0 ? 0 : -1));\n if (i > 0) {\n return 1;\n }\n return i == 0 ? 0 : -1;\n }", "private static void sortNoun() throws Exception{\r\n\t\tBufferedReader[] brArray = new BufferedReader[ actionNumber ];\r\n\t\tBufferedWriter[] bwArray = new BufferedWriter[ actionNumber ];\r\n\t\tString line = null;\r\n\t\tfor(int i = 0; i < actionNameArray.length; ++i){\r\n\t\t\tSystem.out.println(\"sorting for \" + actionNameArray[ i ]);\r\n\t\t\tbrArray[ i ] = new BufferedReader( new FileReader(TFIDF_URL + actionNameArray[ i ] + \".tfidf\"));\r\n\t\t\tHashMap<String, Double> nounTFIDFMap = new HashMap<String, Double>();\r\n\t\t\tint k = 0;\r\n\t\t\t// 1. Read tfidf data\r\n\t\t\twhile((line = brArray[ i ].readLine())!=null){\r\n\t\t\t\tnounTFIDFMap.put(nounList.get(k), Double.parseDouble(line));\r\n\t\t\t\tk++;\r\n\t\t\t}\r\n\t\t\tbrArray[ i ].close();\r\n\t\t\t// 2. Rank according to tfidf\r\n\t\t\tValueComparator bvc = new ValueComparator(nounTFIDFMap);\r\n\t\t\tTreeMap<String, Double> sortedMap = new TreeMap<String, Double>(bvc);\r\n\t\t\tsortedMap.putAll(nounTFIDFMap);\r\n\t\t\t\r\n\t\t\t// 3. Write to disk\r\n\t\t\tbwArray[ i ] = new BufferedWriter(new FileWriter( SORTED_URL + actionNameArray[ i ] + \".sorted\"));\r\n\t\t\tfor(String nounKey : sortedMap.keySet()){\r\n\t\t\t\tbwArray[ i ].append(nounKey + \"\\t\" + nounTFIDFMap.get(nounKey) + \"\\n\");\r\n\t\t\t}\r\n\t\t\tbwArray[ i ].close();\r\n\t\t}\r\n\t}", "public void f4(List<Book> a) {\r\n Collections.sort(a, new Comparator<Book>() {\r\n @Override\r\n public int compare(Book o1, Book o2) {\r\n String txt1[] = o1.getName().split(\" \");\r\n String txt2[] = o2.getName().split(\" \");\r\n String lastName1 = txt1[txt1.length - 1];\r\n String lastName2 = txt2[txt2.length - 1];\r\n return lastName1.compareToIgnoreCase(lastName2);\r\n }\r\n });\r\n\r\n }", "public void sort () {\n\t\t\n\t\t// Clear iterator\n\t\titer = null;\n\t\t\n\t\tCollections.sort(this.pathObjects, new Comparator<PathObject>() {\n\t\t @Override\n\t\t public int compare(PathObject lhs, PathObject rhs) {\n\t\t // -1 - less than, 1 - greater than, 0 - equal, all inversed for descending\n\t\t return Double.compare(lhs.getClassProbability(), rhs.getClassProbability()); // Use double compare to safely handle NaN and Infinity\n\t\t }\n\t\t});\n\t\t\n\t\titer = this.pathObjects.iterator();\n\t}", "public int getResourceSort(@Param(\"id\") String id);", "private Sort sortByLastNameAsc() {\n return new Sort(Sort.Direction.ASC, \"remName\");\n }", "@Override\n public int compare(File arg0, File arg1) {\n long diff = arg0.lastModified() - arg1.lastModified();\n if (diff > 0)\n return -1;\n else if (diff == 0)\n return 0;\n else\n return 1;\n }", "public void step3(){\n\n Collections.sort(names,(String a, String b) -> a.compareTo(b));\n }", "public void step1(){\n\n Collections.sort(names, new Comparator<String>() {\n @Override\n public int compare(String a, String b) {\n return b.compareTo(a);\n }\n });\n }", "public void sort() {\n }", "private String doSortOrder(SlingHttpServletRequest request) {\n RequestParameter sortOnParam = request.getRequestParameter(\"sortOn\");\n RequestParameter sortOrderParam = request.getRequestParameter(\"sortOrder\");\n String sortOn = \"sakai:filename\";\n String sortOrder = \"ascending\";\n if (sortOrderParam != null\n && (sortOrderParam.getString().equals(\"ascending\") || sortOrderParam.getString()\n .equals(\"descending\"))) {\n sortOrder = sortOrderParam.getString();\n }\n if (sortOnParam != null) {\n sortOn = sortOnParam.getString();\n }\n return \" order by @\" + sortOn + \" \" + sortOrder;\n }", "private void sortTravelContactsByName() {\n Collections.sort(this.contacts, new Comparator<User>(){\n public int compare(User obj1, User obj2) {\n // ## Ascending order\n return obj1.getSortingStringName().compareToIgnoreCase(obj2.getSortingStringName());\n }\n });\n }", "public int compare(File file, File file2) {\n return Long.valueOf(file.lastModified()).compareTo(Long.valueOf(file2.lastModified()));\n }", "public TextFileComparator(String f1, String f2) {\n\t\tfileName1 = f1;\n\t\tfileName2 = f2;\n\t\tcompareFiles();\n\t}", "public void sort() {\n documents.sort();\n }", "private void testZipfileOrder(Path out) throws IOException {\n ZipFile outZip = new ZipFile(out.toFile());\n Enumeration<? extends ZipEntry> entries = outZip.entries();\n int index = 0;\n LinkedList<String> entryNames = new LinkedList<>();\n // We expect classes*.dex files first, in order, then the rest of the files, in order.\n while(entries.hasMoreElements()) {\n ZipEntry entry = entries.nextElement();\n if (!entry.getName().startsWith(\"classes\") || !entry.getName().endsWith(\".dex\")) {\n entryNames.add(entry.getName());\n continue;\n }\n if (index == 0) {\n Assert.assertEquals(\"classes.dex\", entry.getName());\n } else {\n Assert.assertEquals(\"classes\" + (index + 1) + \".dex\", entry.getName());\n }\n index++;\n }\n // Everything else should be sorted according to name.\n String[] entriesUnsorted = entryNames.toArray(StringUtils.EMPTY_ARRAY);\n String[] entriesSorted = entryNames.toArray(StringUtils.EMPTY_ARRAY);\n Arrays.sort(entriesSorted);\n Assert.assertArrayEquals(entriesUnsorted, entriesSorted);\n }", "public void sortPaths(List<String> paths){\n //System.out.println(\"Received LIST: \"+Arrays.toString(paths.toArray()));\n Collections.sort(paths, new Comparator<String>() {\n\n @Override\n public int compare(String o1, String o2) {\n int s1 = Integer.valueOf(o1.substring(1));\n int s2 = Integer.valueOf(o2.substring(1));\n return s2-s1;\n }\n\n });\n //System.out.println(\"AFTER SORTING LIST: \"+Arrays.toString(paths.toArray()));\n }", "public static List<File> sortInBatch(File file, Comparator<String> cmp) throws IOException \r\n\t{\r\n\t\tList<File> files = new ArrayList<File>();\r\n\t\tBufferedReader fbr = new BufferedReader(new FileReader(file));\r\n\t\tlong blocksize = estimateBestSizeOfBlocks(file);// in bytes\r\n\t\ttry{\r\n\t\t\tList<String> tmplist = new ArrayList<String>();\r\n\t\t\tString line = \"\";\r\n\t\t\ttry {\r\n\t\t\t\twhile(line != null) {\r\n\t\t\t\t\tlong currentblocksize = 0; //in bytes\r\n\t\t\t\t\twhile((currentblocksize < blocksize) &&((line = fbr.readLine()) != null) )//as long as you have 2MB\r\n\t\t\t\t\t{ \r\n\t\t\t\t\t\ttmplist.add(line);\r\n\t\t\t\t\t\tcurrentblocksize += line.length(); //2+40; //java uses 16 bits per character + 40 bytes of overhead (estimated)\r\n\t\t\t\t\t}\r\n\t\t\t\t\tfiles.add(sortAndSave(tmplist,cmp));\r\n\t\t\t\t\ttmplist.clear();\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tcatch(EOFException oef) {\r\n\t\t\t\tif(tmplist.size()>0) {\r\n\t\t\t\t\tfiles.add(sortAndSave(tmplist,cmp));\r\n\t\t\t\t\ttmplist.clear();\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t} \r\n\t\tfinally {\r\n\t\t\tfbr.close();\r\n\t\t}\r\n\t\treturn files;\r\n\t}", "protected void sortResources()\n {\n PriorityComparator priorityComparator = new PriorityComparator();\n List<Resource> resources = getResources();\n Collections.sort(resources, priorityComparator);\n }", "public static void userSort(ArrayList<FileData> fromFile, int primary_sort, int secondary_sort, int primary_order, int secondary_order)\n {\n \n // user wants to sort by primary = state code and secondary = county code\n if(primary_sort == 1 && secondary_sort == 2) \n {\n if(primary_order == 1 && secondary_order == 1){// user wants both primary and secondary in ascending order\n Collections.sort(fromFile, new Sort_State_Code());\n Collections.sort(fromFile,new Sort_County_Code());\n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo()); // print the sorted information by state and county code\n }\n }\n else if(primary_order == 2 && secondary_order == 2){ // user wants both primary and secondary in decending order\n Collections.sort(fromFile,new Sort_County_Code().reversed());\n Collections.sort(fromFile, new Sort_State_Code().reversed()); \n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==1){// primary is ascending\n Collections.sort(fromFile, new Sort_State_Code());\n Collections.sort(fromFile,new Sort_County_Code().reversed()); \n for(int i=0; i<fromFile.size(); i++){\n System.out.println(fromFile.get(i).printInfo());\n }\n }\n else if(primary_order==2){//primary is descending\n Collections.sort(fromFile, new Sort_State_Code().reversed()); \n Collections.sort(fromFile,new Sort_County_Code()); \n for(int i=0; i<fromFile.size(); i++){\n System.out.println(fromFile.get(i).printInfo());\n } \n } \n }\n // user wants to sort by primary = county code and secondary = state code\n if(primary_sort == 2 && secondary_sort == 1){\n if(primary_order == 1 && secondary_order == 1){\n //primary and seconary is ascending\n Collections.sort(fromFile, new Sort_State_Code());\n Collections.sort(fromFile,new Sort_County_Code());\n \n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n else if(primary_order == 2 && secondary_order == 2){\n //both descending\n Collections.sort(fromFile, new Sort_State_Code().reversed()); \n Collections.sort(fromFile,new Sort_County_Code().reversed());\n \n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==1){//primary is ascending\n Collections.sort(fromFile, new Sort_State_Code().reversed()); \n Collections.sort(fromFile,new Sort_County_Code()); // primary sort\n \n for(int i=0; i<fromFile.size(); i++){\n System.out.println(fromFile.get(i).printInfo());\n }\n }\n else if(primary_order==2){//primary is descending\n Collections.sort(fromFile, new Sort_State_Code());\n Collections.sort(fromFile,new Sort_County_Code().reversed()); // primary sort\n for(int i=0; i<fromFile.size(); i++){\n System.out.println(fromFile.get(i).printInfo());\n } \n } \n }\n if(primary_sort==1&&secondary_sort==3){\n if(primary_order==1&&secondary_order==1){\n //primary and second is ascending\n Collections.sort(fromFile,new Sort_State_Name());\n Collections.sort(fromFile, new Sort_State_Code());\n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==2&&secondary_order==2){\n //both descending\n Collections.sort(fromFile,new Sort_State_Name().reversed());\n Collections.sort(fromFile, new Sort_State_Code().reversed()); \n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==1){\n //secondary is descending\n Collections.sort(fromFile,new Sort_State_Name().reversed());\n Collections.sort(fromFile, new Sort_State_Code()); \n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo()); // print the sorted information by state and county code\n }\n }\n else if(primary_order==2){\n //primary is descending\n Collections.sort(fromFile,new Sort_State_Name());\n Collections.sort(fromFile, new Sort_State_Code().reversed()); \n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo()); // print the sorted information by state and county code\n } \n } \n }\n \n if(primary_sort==3&&secondary_sort==1){\n if(primary_order==1&&secondary_order==1){\n //primary and second is ascending\n \n Collections.sort(fromFile, new Sort_State_Code());\n Collections.sort(fromFile,new Sort_State_Name());\n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==2&&secondary_order==2){\n //both descending\n Collections.sort(fromFile, new Sort_State_Code().reversed());\n Collections.sort(fromFile,new Sort_State_Name().reversed());\n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==1){\n //secondary is descending\n Collections.sort(fromFile,new Sort_State_Code().reversed());\n Collections.sort(fromFile, new Sort_State_Name()); \n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo()); // print the sorted information by state and county code\n }\n }\n else if(primary_order==2){\n //primary is descending\n Collections.sort(fromFile,new Sort_State_Code());\n Collections.sort(fromFile, new Sort_State_Name().reversed()); \n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n } \n } \n }\n \n if(primary_sort==1&&secondary_sort==4){\n if(primary_order==1&&secondary_order==1){\n //primary and second is ascending\n Collections.sort(fromFile, new Sort_County_Name());\n Collections.sort(fromFile,new Sort_State_Code());\n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==2&&secondary_order==2){\n //both descending\n Collections.sort(fromFile, new Sort_County_Name().reversed());\n Collections.sort(fromFile,new Sort_State_Code().reversed());\n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==1){\n //secondary is descending\n Collections.sort(fromFile,new Sort_County_Name().reversed());\n Collections.sort(fromFile, new Sort_State_Code()); \n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n else if(primary_order==2){\n //primary is descending\n Collections.sort(fromFile,new Sort_County_Name());\n Collections.sort(fromFile, new Sort_State_Code().reversed()); \n for(int i=0; i<fromFile.size(); i++){\n System.out.println(fromFile.get(i).printInfo());\n } \n } \n }\n \n if(primary_sort==4&&secondary_sort==1){\n if(primary_order==1&&secondary_order==1){\n //primary and second is ascending\n Collections.sort(fromFile, new Sort_State_Code());\n Collections.sort(fromFile,new Sort_County_Name());\n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==2&&secondary_order==2){\n //both descending\n \n Collections.sort(fromFile, new Sort_State_Code().reversed());\n Collections.sort(fromFile,new Sort_County_Name().reversed());\n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==1){\n //secondary is descending\n Collections.sort(fromFile,new Sort_State_Code().reversed());\n Collections.sort(fromFile, new Sort_County_Name()); \n for(int i=0; i<fromFile.size(); i++){\n System.out.println(fromFile.get(i).printInfo());\n }\n }\n else if(primary_order==2){\n //primary is descending\n Collections.sort(fromFile,new Sort_State_Code());\n Collections.sort(fromFile, new Sort_County_Name().reversed()); \n for(int i=0; i<fromFile.size(); i++){\n System.out.println(fromFile.get(i).printInfo());\n } \n } \n } \n if(primary_sort==1&&secondary_sort==5){\n if(primary_order==1&&secondary_order==1){\n //primary and second is ascending\n Collections.sort(fromFile, new SortFirstConfirmCount());\n Collections.sort(fromFile,new Sort_State_Code());\n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n else if(primary_order==2&&secondary_order==2){\n //both descending\n Collections.sort(fromFile,new SortFirstConfirmCount().reversed());\n Collections.sort(fromFile, new Sort_State_Code().reversed());\n \n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==1){\n //secondary is descending\n Collections.sort(fromFile, new SortFirstConfirmCount().reversed());\n Collections.sort(fromFile,new Sort_State_Code());\n \n for(int i=0; i<fromFile.size(); i++){\n System.out.println(fromFile.get(i).printInfo());\n }\n }\n else if(primary_order==2){\n //primary is descending\n Collections.sort(fromFile,new SortFirstConfirmCount());\n Collections.sort(fromFile, new Sort_State_Code().reversed()); \n for(int i=0; i<fromFile.size(); i++){\n System.out.println(fromFile.get(i).printInfo());\n } \n } \n }\n \n if(primary_sort==5&&secondary_sort==1){\n if(primary_order==1&&secondary_order==1){\n //primary and second is ascending\n Collections.sort(fromFile,new Sort_State_Code());\n Collections.sort(fromFile, new SortFirstConfirmCount());\n for(int i=0; i<fromFile.size(); i++){\n System.out.println(fromFile.get(i).printInfo());\n } \n }\n \n else if(primary_order==2&&secondary_order==2){\n //both descending\n Collections.sort(fromFile, new Sort_State_Code().reversed());\n Collections.sort(fromFile,new SortFirstConfirmCount().reversed());\n for(int i=0; i<fromFile.size(); i++){\n System.out.println(fromFile.get(i).printInfo());\n } \n }\n \n else if(primary_order==1){\n //secondary is descending\n Collections.sort(fromFile,new Sort_State_Code().reversed());\n Collections.sort(fromFile, new SortFirstConfirmCount());\n \n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo()); // print the sorted information \n }\n }\n else if(primary_order==2){\n //primary is descending\n Collections.sort(fromFile,new Sort_State_Code());\n Collections.sort(fromFile, new SortFirstConfirmCount().reversed()); \n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo()); // print the sorted information \n } \n } \n }\n \n \n if(primary_sort==1&&secondary_sort==6){\n if(primary_order==1&&secondary_order==1){\n //primary and second is ascending\n \n Collections.sort(fromFile, new SortSecondConfirmCount());\n Collections.sort(fromFile,new Sort_State_Code());\n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo()); \n }\n }\n \n else if(primary_order==2&&secondary_order==2){\n //both descending\n Collections.sort(fromFile,new SortSecondConfirmCount().reversed());\n Collections.sort(fromFile, new Sort_State_Code().reversed());\n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo()); \n }\n }\n \n else if(primary_order==1){\n //secondary is descending\n Collections.sort(fromFile, new SortSecondConfirmCount().reversed());\n Collections.sort(fromFile,new Sort_State_Code());\n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo()); // print the sorted information by state and county code\n }\n }\n else if(primary_order==2){\n //primary is descending\n Collections.sort(fromFile,new SortSecondConfirmCount());\n Collections.sort(fromFile, new Sort_State_Code().reversed()); \n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo()); // print the sorted information by state and county code\n } \n } \n }\n \n if(primary_sort==6&&secondary_sort==1){\n if(primary_order==1&&secondary_order==1){\n //primary and second is ascending\n Collections.sort(fromFile,new Sort_State_Code());\n Collections.sort(fromFile, new SortSecondConfirmCount());\n \n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==2&&secondary_order==2){\n //both descending\n Collections.sort(fromFile, new Sort_State_Code().reversed());\n Collections.sort(fromFile,new SortSecondConfirmCount().reversed());\n \n \n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==1){\n //secondary is descending\n Collections.sort(fromFile,new Sort_State_Code().reversed());\n Collections.sort(fromFile, new SortSecondConfirmCount());\n \n \n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n else if(primary_order==2){\n //primary is descending\n Collections.sort(fromFile,new Sort_State_Code());\n Collections.sort(fromFile, new SortSecondConfirmCount().reversed()); \n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n } \n } \n }\n \n if(primary_sort==1&&secondary_sort==7){\n if(primary_order==1&&secondary_order==1){\n //primary and second is ascending\n \n Collections.sort(fromFile, new SortThirdConfirmCount());\n Collections.sort(fromFile,new Sort_State_Code());\n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==2&&secondary_order==2){\n //both descending\n Collections.sort(fromFile,new SortThirdConfirmCount().reversed());\n Collections.sort(fromFile, new Sort_State_Code().reversed());\n \n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==1){\n //secondary is descending\n Collections.sort(fromFile, new SortThirdConfirmCount().reversed());\n Collections.sort(fromFile,new Sort_State_Code());\n \n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n else if(primary_order==2){\n //primary is descending\n Collections.sort(fromFile,new SortThirdConfirmCount());\n Collections.sort(fromFile, new Sort_State_Code().reversed()); \n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n } \n } \n }\n \n if(primary_sort==7&&secondary_sort==1){\n if(primary_order==1&&secondary_order==1){\n //primary and second is ascending\n Collections.sort(fromFile,new Sort_State_Code());\n Collections.sort(fromFile, new SortThirdConfirmCount());\n \n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==2&&secondary_order==2){\n //both descending\n Collections.sort(fromFile, new Sort_State_Code().reversed());\n Collections.sort(fromFile,new SortThirdConfirmCount().reversed());\n \n \n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==1){\n //secondary is descending\n Collections.sort(fromFile,new Sort_State_Code().reversed());\n Collections.sort(fromFile, new SortThirdConfirmCount());\n \n \n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n else if(primary_order==2){\n //primary is descending\n Collections.sort(fromFile,new Sort_State_Code());\n Collections.sort(fromFile, new SortThirdConfirmCount().reversed()); \n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n } \n } \n }\n \n if(primary_sort==1&&secondary_sort==8){\n if(primary_order==1&&secondary_order==1){\n //primary and second is ascending\n \n Collections.sort(fromFile, new SortFourthConfirmCount());\n Collections.sort(fromFile,new Sort_State_Code());\n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==2&&secondary_order==2){\n //both descending\n Collections.sort(fromFile,new SortFourthConfirmCount().reversed());\n Collections.sort(fromFile, new Sort_State_Code().reversed());\n \n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==1){\n //secondary is descending\n Collections.sort(fromFile, new SortFourthConfirmCount().reversed());\n Collections.sort(fromFile,new Sort_State_Code());\n \n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n else if(primary_order==2){\n //primary is descending\n Collections.sort(fromFile,new SortFourthConfirmCount());\n Collections.sort(fromFile, new Sort_State_Code().reversed()); \n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n } \n } \n }\n \n \n if(primary_sort==8&&secondary_sort==1){\n if(primary_order==1&&secondary_order==1){\n //primary and second is ascending\n Collections.sort(fromFile,new Sort_State_Code());\n Collections.sort(fromFile, new SortFourthConfirmCount());\n \n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==2&&secondary_order==2){\n //both descending\n Collections.sort(fromFile, new Sort_State_Code().reversed());\n Collections.sort(fromFile,new SortFourthConfirmCount().reversed());\n \n \n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==1){\n //secondary is descending\n Collections.sort(fromFile,new Sort_State_Code().reversed());\n Collections.sort(fromFile, new SortFourthConfirmCount());\n \n \n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n else if(primary_order==2){\n //primary is descending\n Collections.sort(fromFile,new Sort_State_Code());\n Collections.sort(fromFile, new SortFourthConfirmCount().reversed()); \n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n } \n } \n }\n \n if(primary_sort==2&&secondary_sort==3){\n if(primary_order==1&&secondary_order==1){\n //primary and second is ascending\n \n Collections.sort(fromFile, new Sort_State_Name());\n Collections.sort(fromFile,new Sort_County_Code());\n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==2&&secondary_order==2){\n //both descending\n Collections.sort(fromFile,new Sort_State_Name().reversed());\n Collections.sort(fromFile, new Sort_County_Code().reversed());\n \n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==1){\n //secondary is descending\n Collections.sort(fromFile, new Sort_State_Name().reversed());\n Collections.sort(fromFile,new Sort_County_Code());\n \n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n else if(primary_order==2){\n //primary is descending\n Collections.sort(fromFile,new Sort_State_Name());\n Collections.sort(fromFile, new Sort_County_Code().reversed()); \n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n } \n } \n }\n \n if(primary_sort==3&&secondary_sort==2){\n if(primary_order==1&&secondary_order==1){\n //primary and second is ascending\n \n Collections.sort(fromFile, new Sort_County_Code());\n Collections.sort(fromFile,new Sort_State_Name());\n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==2&&secondary_order==2){\n //both descending\n Collections.sort(fromFile,new Sort_County_Code().reversed());\n Collections.sort(fromFile, new Sort_State_Name().reversed());\n \n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==1){\n //secondary is descending\n Collections.sort(fromFile, new Sort_County_Code().reversed());\n Collections.sort(fromFile,new Sort_State_Name());\n \n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n else if(primary_order==2){\n //primary is descending\n Collections.sort(fromFile,new Sort_County_Code());\n Collections.sort(fromFile, new Sort_State_Name().reversed()); \n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n } \n } \n }\n \n if(primary_sort==2&&secondary_sort==4){\n if(primary_order==1&&secondary_order==1){\n //primary and second is ascending\n \n Collections.sort(fromFile, new Sort_County_Name());\n Collections.sort(fromFile,new Sort_County_Code());\n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==2&&secondary_order==2){\n //both descending\n Collections.sort(fromFile,new Sort_County_Name().reversed());\n Collections.sort(fromFile, new Sort_County_Code().reversed());\n \n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==1){\n //secondary is descending\n Collections.sort(fromFile, new Sort_County_Name().reversed());\n Collections.sort(fromFile,new Sort_County_Code());\n \n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n else if(primary_order==2){\n //primary is descending\n Collections.sort(fromFile,new Sort_County_Name());\n Collections.sort(fromFile, new Sort_County_Code().reversed()); \n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n } \n } \n }\n \n if(primary_sort==4&&secondary_sort==2){\n if(primary_order==1&&secondary_order==1){\n //primary and second is ascending\n \n Collections.sort(fromFile, new Sort_County_Code());\n Collections.sort(fromFile,new Sort_County_Name());\n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==2&&secondary_order==2){\n //both descending\n Collections.sort(fromFile,new Sort_County_Code().reversed());\n Collections.sort(fromFile, new Sort_County_Name().reversed());\n \n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==1){\n //secondary is descending\n Collections.sort(fromFile, new Sort_County_Code().reversed());\n Collections.sort(fromFile,new Sort_County_Name());\n \n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n else if(primary_order==2){\n //primary is descending\n Collections.sort(fromFile,new Sort_County_Code());\n Collections.sort(fromFile, new Sort_County_Name().reversed()); \n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n } \n } \n }\n \n if(primary_sort==2&&secondary_sort==5){\n if(primary_order==1&&secondary_order==1){\n //primary and second is ascending\n \n \n Collections.sort(fromFile,new SortFirstConfirmCount());\n Collections.sort(fromFile, new Sort_County_Code());\n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==2&&secondary_order==2){\n //both descending\n \n Collections.sort(fromFile, new SortFirstConfirmCount().reversed());\n Collections.sort(fromFile,new Sort_County_Code().reversed());\n \n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==1){\n //secondary is descending\n \n Collections.sort(fromFile,new SortFirstConfirmCount().reversed());\n Collections.sort(fromFile, new Sort_County_Code());\n \n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n else if(primary_order==2){\n //primary is descending\n \n Collections.sort(fromFile, new SortFirstConfirmCount());\n Collections.sort(fromFile,new Sort_County_Code().reversed());\n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n } \n } \n }\n \n if(primary_sort==5&&secondary_sort==2){\n if(primary_order==1&&secondary_order==1){\n //primary and second is ascending\n \n Collections.sort(fromFile, new Sort_County_Code());\n Collections.sort(fromFile,new SortFirstConfirmCount());\n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==2&&secondary_order==2){\n //both descending\n Collections.sort(fromFile,new Sort_County_Code().reversed());\n Collections.sort(fromFile, new SortFirstConfirmCount().reversed());\n \n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==1){\n //secondary is descending\n Collections.sort(fromFile, new Sort_County_Code().reversed());\n Collections.sort(fromFile,new SortFirstConfirmCount());\n \n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n else if(primary_order==2){\n //primary is descending\n Collections.sort(fromFile,new Sort_County_Code());\n Collections.sort(fromFile, new SortFirstConfirmCount().reversed()); \n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n } \n } \n } \n \n if(primary_sort==2&&secondary_sort==6){\n if(primary_order==1&&secondary_order==1){\n //primary and second is ascending\n \n \n Collections.sort(fromFile,new SortSecondConfirmCount());\n Collections.sort(fromFile, new Sort_County_Code());\n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==2&&secondary_order==2){\n //both descending\n \n Collections.sort(fromFile, new SortSecondConfirmCount().reversed());\n Collections.sort(fromFile,new Sort_County_Code().reversed());\n \n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==1){\n //secondary is descending\n \n Collections.sort(fromFile,new SortSecondConfirmCount().reversed());\n Collections.sort(fromFile, new Sort_County_Code());\n \n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n else if(primary_order==2){\n //primary is descending\n \n Collections.sort(fromFile, new SortSecondConfirmCount());\n Collections.sort(fromFile,new Sort_County_Code().reversed());\n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n } \n } \n } \n if(primary_sort==6&&secondary_sort==2){\n if(primary_order==1&&secondary_order==1){\n //primary and second is ascending\n \n Collections.sort(fromFile, new Sort_County_Code());\n Collections.sort(fromFile,new SortSecondConfirmCount());\n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==2&&secondary_order==2){\n //both descending\n Collections.sort(fromFile,new Sort_County_Code().reversed());\n Collections.sort(fromFile, new SortSecondConfirmCount().reversed());\n \n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==1){\n //secondary is descending\n Collections.sort(fromFile, new Sort_County_Code().reversed());\n Collections.sort(fromFile,new SortSecondConfirmCount());\n \n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n else if(primary_order==2){\n //primary is descending\n Collections.sort(fromFile,new Sort_County_Code());\n Collections.sort(fromFile, new SortSecondConfirmCount().reversed()); \n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n } \n } \n } \n \n if(primary_sort==2&&secondary_sort==7){\n if(primary_order==1&&secondary_order==1){\n //primary and second is ascending\n \n \n Collections.sort(fromFile,new SortThirdConfirmCount());\n Collections.sort(fromFile, new Sort_County_Code());\n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==2&&secondary_order==2){\n //both descending\n \n Collections.sort(fromFile, new SortThirdConfirmCount().reversed());\n Collections.sort(fromFile,new Sort_County_Code().reversed());\n \n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==1){\n //secondary is descending\n \n Collections.sort(fromFile,new SortThirdConfirmCount().reversed());\n Collections.sort(fromFile, new Sort_County_Code());\n \n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n else if(primary_order==2){\n //primary is descending\n \n Collections.sort(fromFile, new SortThirdConfirmCount());\n Collections.sort(fromFile,new Sort_County_Code().reversed());\n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n } \n } \n } \n if(primary_sort==7&&secondary_sort==2){\n if(primary_order==1&&secondary_order==1){\n //primary and second is ascending\n \n Collections.sort(fromFile, new Sort_County_Code());\n Collections.sort(fromFile,new SortThirdConfirmCount());\n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==2&&secondary_order==2){\n //both descending\n Collections.sort(fromFile,new Sort_County_Code().reversed());\n Collections.sort(fromFile, new SortThirdConfirmCount().reversed());\n \n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==1){\n //secondary is descending\n Collections.sort(fromFile, new Sort_County_Code().reversed());\n Collections.sort(fromFile,new SortThirdConfirmCount());\n \n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n else if(primary_order==2){\n //primary is descending\n Collections.sort(fromFile,new Sort_County_Code());\n Collections.sort(fromFile, new SortThirdConfirmCount().reversed()); \n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n } \n } \n }\n \n if(primary_sort==2&&secondary_sort==8){\n if(primary_order==1&&secondary_order==1){\n //primary and second is ascending\n \n \n Collections.sort(fromFile,new SortFourthConfirmCount());\n Collections.sort(fromFile, new Sort_County_Code());\n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==2&&secondary_order==2){\n //both descending\n \n Collections.sort(fromFile, new SortFourthConfirmCount().reversed());\n Collections.sort(fromFile,new Sort_County_Code().reversed());\n \n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==1){\n //secondary is descending\n \n Collections.sort(fromFile,new SortFourthConfirmCount().reversed());\n Collections.sort(fromFile, new Sort_County_Code());\n \n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n else if(primary_order==2){\n //primary is descending\n \n Collections.sort(fromFile, new SortFourthConfirmCount());\n Collections.sort(fromFile,new Sort_County_Code().reversed());\n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n } \n } \n } \n if(primary_sort==8&&secondary_sort==2){\n if(primary_order==1&&secondary_order==1){\n //primary and second is ascending\n \n Collections.sort(fromFile, new Sort_County_Code());\n Collections.sort(fromFile,new SortFourthConfirmCount());\n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==2&&secondary_order==2){\n //both descending\n Collections.sort(fromFile,new Sort_County_Code().reversed());\n Collections.sort(fromFile, new SortFourthConfirmCount().reversed());\n \n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==1){\n //secondary is descending\n Collections.sort(fromFile, new Sort_County_Code().reversed());\n Collections.sort(fromFile,new SortFourthConfirmCount());\n \n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n else if(primary_order==2){\n //primary is descending\n Collections.sort(fromFile,new Sort_County_Code());\n Collections.sort(fromFile, new SortFourthConfirmCount().reversed()); \n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n } \n } \n } \n \n if(primary_sort==3&&secondary_sort==4){\n if(primary_order==1&&secondary_order==1){\n //primary and second is ascending\n \n \n Collections.sort(fromFile,new Sort_County_Name());\n Collections.sort(fromFile, new Sort_State_Name());\n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==2&&secondary_order==2){\n //both descending\n \n Collections.sort(fromFile, new Sort_County_Name().reversed());\n Collections.sort(fromFile,new Sort_State_Name().reversed());\n \n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==1){\n //secondary is descending\n \n Collections.sort(fromFile,new Sort_County_Name().reversed());\n Collections.sort(fromFile, new Sort_State_Name());\n \n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n else if(primary_order==2){\n //primary is descending\n \n Collections.sort(fromFile, new Sort_County_Name());\n Collections.sort(fromFile,new Sort_State_Name().reversed());\n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n } \n } \n }\n if(primary_sort==4&&secondary_sort==3){\n if(primary_order==1&&secondary_order==1){\n //primary and second is ascending\n \n Collections.sort(fromFile, new Sort_State_Name());\n Collections.sort(fromFile,new Sort_County_Name());\n \n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==2&&secondary_order==2){\n //both descending\n Collections.sort(fromFile,new Sort_State_Name().reversed());\n Collections.sort(fromFile, new Sort_County_Name().reversed());\n \n \n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==1){\n //secondary is descending\n Collections.sort(fromFile, new Sort_State_Name().reversed());\n Collections.sort(fromFile,new Sort_County_Name());\n \n \n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n else if(primary_order==2){\n //primary is descending\n Collections.sort(fromFile,new Sort_State_Name());\n Collections.sort(fromFile, new Sort_County_Name().reversed());\n \n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n } \n } \n }\n \n if(primary_sort==3&&secondary_sort==5){\n if(primary_order==1&&secondary_order==1){\n //primary and second is ascending\n \n \n Collections.sort(fromFile,new SortFirstConfirmCount());\n Collections.sort(fromFile, new Sort_State_Name());\n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==2&&secondary_order==2){\n //both descending\n \n Collections.sort(fromFile, new SortFirstConfirmCount().reversed());\n Collections.sort(fromFile,new Sort_State_Name().reversed());\n \n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==1){\n //secondary is descending\n \n Collections.sort(fromFile,new SortFirstConfirmCount().reversed());\n Collections.sort(fromFile, new Sort_State_Name());\n \n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n else if(primary_order==2){\n //primary is descending\n \n Collections.sort(fromFile, new SortFirstConfirmCount());\n Collections.sort(fromFile,new Sort_State_Name().reversed());\n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n } \n } \n }\n if(primary_sort==5&&secondary_sort==3){\n if(primary_order==1&&secondary_order==1){\n //primary and second is ascending\n \n Collections.sort(fromFile, new Sort_State_Name());\n Collections.sort(fromFile,new SortFirstConfirmCount());\n \n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==2&&secondary_order==2){\n //both descending\n Collections.sort(fromFile,new Sort_State_Name().reversed());\n Collections.sort(fromFile, new SortFirstConfirmCount().reversed());\n \n \n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==1){\n //secondary is descending\n Collections.sort(fromFile, new Sort_State_Name().reversed());\n Collections.sort(fromFile,new SortFirstConfirmCount());\n \n \n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n else if(primary_order==2){\n //primary is descending\n Collections.sort(fromFile,new Sort_State_Name());\n Collections.sort(fromFile, new SortFirstConfirmCount().reversed());\n \n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n } \n } \n }\n \n if(primary_sort==3&&secondary_sort==6){\n if(primary_order==1&&secondary_order==1){\n //primary and second is ascending\n Collections.sort(fromFile, new Sort_State_Name());\n Collections.sort(fromFile,new SortSecondConfirmCount());\n \n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==2&&secondary_order==2){\n //both descending\n \n Collections.sort(fromFile, new SortSecondConfirmCount().reversed());\n Collections.sort(fromFile,new Sort_State_Name().reversed());\n \n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==1){\n //secondary is descending\n \n Collections.sort(fromFile,new SortSecondConfirmCount().reversed());\n Collections.sort(fromFile, new Sort_State_Name());\n \n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n else if(primary_order==2){\n //primary is descending\n Collections.sort(fromFile, new SortSecondConfirmCount());\n Collections.sort(fromFile,new Sort_State_Name().reversed());\n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n } \n } \n }\n if(primary_sort==6&&secondary_sort==3){\n if(primary_order==1&&secondary_order==1){\n //primary and second is ascending\n \n Collections.sort(fromFile, new Sort_State_Name());\n Collections.sort(fromFile,new SortSecondConfirmCount());\n \n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==2&&secondary_order==2){\n //both descending\n Collections.sort(fromFile,new Sort_State_Name().reversed());\n Collections.sort(fromFile, new SortSecondConfirmCount().reversed());\n \n \n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==1){\n //secondary is descending\n Collections.sort(fromFile, new Sort_State_Name().reversed());\n Collections.sort(fromFile,new SortSecondConfirmCount());\n \n \n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n else if(primary_order==2){\n //primary is descending\n Collections.sort(fromFile,new Sort_State_Name());\n Collections.sort(fromFile, new SortSecondConfirmCount().reversed());\n \n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n } \n } \n }\n \n if(primary_sort==3&&secondary_sort==7){\n if(primary_order==1&&secondary_order==1){\n //primary and second is ascending\n \n \n Collections.sort(fromFile,new SortThirdConfirmCount());\n Collections.sort(fromFile, new Sort_State_Name());\n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==2&&secondary_order==2){\n //both descending\n \n Collections.sort(fromFile, new SortThirdConfirmCount().reversed());\n Collections.sort(fromFile,new Sort_State_Name().reversed());\n \n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==1){\n //secondary is descending\n \n Collections.sort(fromFile,new SortThirdConfirmCount().reversed());\n Collections.sort(fromFile, new Sort_State_Name());\n \n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n else if(primary_order==2){\n //primary is descending\n \n Collections.sort(fromFile, new SortThirdConfirmCount());\n Collections.sort(fromFile,new Sort_State_Name().reversed());\n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n } \n } \n }\n if(primary_sort==7&&secondary_sort==3){\n if(primary_order==1&&secondary_order==1){\n //primary and second is ascending\n \n Collections.sort(fromFile, new Sort_State_Name());\n Collections.sort(fromFile,new SortThirdConfirmCount());\n \n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==2&&secondary_order==2){\n //both descending\n Collections.sort(fromFile,new Sort_State_Name().reversed());\n Collections.sort(fromFile, new SortThirdConfirmCount().reversed());\n \n \n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==1){\n //secondary is descending\n Collections.sort(fromFile, new Sort_State_Name().reversed());\n Collections.sort(fromFile,new SortThirdConfirmCount());\n \n \n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n else if(primary_order==2){\n //primary is descending\n Collections.sort(fromFile,new Sort_State_Name());\n Collections.sort(fromFile, new SortThirdConfirmCount().reversed());\n \n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n } \n } \n }\n \n if(primary_sort==3&&secondary_sort==8){\n if(primary_order==1&&secondary_order==1){\n //primary and second is ascending\n \n \n Collections.sort(fromFile,new SortFourthConfirmCount());\n Collections.sort(fromFile, new Sort_State_Name());\n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==2&&secondary_order==2){\n //both descending\n \n Collections.sort(fromFile, new SortFourthConfirmCount().reversed());\n Collections.sort(fromFile,new Sort_State_Name().reversed());\n \n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==1){\n //secondary is descending\n \n Collections.sort(fromFile,new SortFourthConfirmCount().reversed());\n Collections.sort(fromFile, new Sort_State_Name());\n \n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n else if(primary_order==2){\n //primary is descending\n \n Collections.sort(fromFile, new SortFourthConfirmCount());\n Collections.sort(fromFile,new Sort_State_Name().reversed());\n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n } \n } \n }\n if(primary_sort==8&&secondary_sort==3){\n if(primary_order==1&&secondary_order==1){\n //primary and second is ascending\n \n Collections.sort(fromFile, new Sort_State_Name());\n Collections.sort(fromFile,new SortFourthConfirmCount());\n \n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==2&&secondary_order==2){\n //both descending\n Collections.sort(fromFile,new Sort_State_Name().reversed());\n Collections.sort(fromFile, new SortFourthConfirmCount().reversed());\n \n \n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==1){\n //secondary is descending\n Collections.sort(fromFile, new Sort_State_Name().reversed());\n Collections.sort(fromFile,new SortFourthConfirmCount());\n \n \n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n else if(primary_order==2){\n //primary is descending\n Collections.sort(fromFile,new Sort_State_Name());\n Collections.sort(fromFile, new SortFourthConfirmCount().reversed());\n \n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n } \n } \n }\n \n if(primary_sort==4&&secondary_sort==5){\n if(primary_order==1&&secondary_order==1){\n //primary and second is ascending\n \n Collections.sort(fromFile, new SortFirstConfirmCount());\n Collections.sort(fromFile,new Sort_County_Name());\n \n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==2&&secondary_order==2){\n //both descending\n Collections.sort(fromFile,new SortFirstConfirmCount().reversed());\n Collections.sort(fromFile, new Sort_County_Name().reversed());\n \n \n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==1){\n //secondary is descending\n Collections.sort(fromFile, new SortFirstConfirmCount().reversed());\n Collections.sort(fromFile,new Sort_County_Name());\n \n \n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n else if(primary_order==2){\n //primary is descending\n Collections.sort(fromFile,new SortFirstConfirmCount());\n Collections.sort(fromFile, new Sort_County_Name().reversed());\n \n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n } \n } \n }\n \n if(primary_sort==5&&secondary_sort==4){\n if(primary_order==1&&secondary_order==1){\n //primary and second is ascending\n \n Collections.sort(fromFile, new Sort_County_Name());\n Collections.sort(fromFile,new SortFirstConfirmCount());\n \n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==2&&secondary_order==2){\n //both descending\n Collections.sort(fromFile,new Sort_County_Name().reversed());\n Collections.sort(fromFile, new SortFirstConfirmCount().reversed());\n \n \n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==1){\n //secondary is descending\n Collections.sort(fromFile, new Sort_County_Name().reversed());\n Collections.sort(fromFile,new SortFirstConfirmCount());\n \n \n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n else if(primary_order==2){\n //primary is descending\n Collections.sort(fromFile,new Sort_County_Name());\n Collections.sort(fromFile, new SortFirstConfirmCount().reversed());\n \n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n } \n } \n }\n \n if(primary_sort==4&&secondary_sort==6){\n if(primary_order==1&&secondary_order==1){\n //primary and second is ascending\n \n Collections.sort(fromFile, new SortSecondConfirmCount());\n Collections.sort(fromFile,new Sort_County_Name());\n \n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==2&&secondary_order==2){\n //both descending\n Collections.sort(fromFile,new SortSecondConfirmCount().reversed());\n Collections.sort(fromFile, new Sort_County_Name().reversed());\n \n \n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==1){\n //secondary is descending\n Collections.sort(fromFile, new SortSecondConfirmCount().reversed());\n Collections.sort(fromFile,new Sort_County_Name());\n \n \n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n else if(primary_order==2){\n //primary is descending\n Collections.sort(fromFile,new SortSecondConfirmCount());\n Collections.sort(fromFile, new Sort_County_Name().reversed());\n \n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n } \n } \n }\n \n if(primary_sort==6&&secondary_sort==4){\n if(primary_order==1&&secondary_order==1){\n //primary and second is ascending\n \n Collections.sort(fromFile, new Sort_County_Name());\n Collections.sort(fromFile,new SortSecondConfirmCount());\n \n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==2&&secondary_order==2){\n //both descending\n Collections.sort(fromFile,new Sort_County_Name().reversed());\n Collections.sort(fromFile, new SortSecondConfirmCount().reversed());\n \n \n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==1){\n //secondary is descending\n Collections.sort(fromFile, new Sort_County_Name().reversed());\n Collections.sort(fromFile,new SortSecondConfirmCount());\n \n \n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n else if(primary_order==2){\n //primary is descending\n Collections.sort(fromFile,new Sort_County_Name());\n Collections.sort(fromFile, new SortSecondConfirmCount().reversed());\n \n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n } \n } \n }\n \n if(primary_sort==4&&secondary_sort==7){\n if(primary_order==1&&secondary_order==1){\n //primary and second is ascending\n \n Collections.sort(fromFile, new SortThirdConfirmCount());\n Collections.sort(fromFile,new Sort_County_Name());\n \n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==2&&secondary_order==2){\n //both descending\n Collections.sort(fromFile,new SortThirdConfirmCount().reversed());\n Collections.sort(fromFile, new Sort_County_Name().reversed());\n \n \n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==1){\n //secondary is descending\n Collections.sort(fromFile, new SortThirdConfirmCount().reversed());\n Collections.sort(fromFile,new Sort_County_Name());\n \n \n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n else if(primary_order==2){\n //primary is descending\n Collections.sort(fromFile,new SortThirdConfirmCount());\n Collections.sort(fromFile, new Sort_County_Name().reversed());\n \n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n } \n } \n }\n \n if(primary_sort==7&&secondary_sort==4){\n if(primary_order==1&&secondary_order==1){\n //primary and second is ascending\n \n Collections.sort(fromFile, new Sort_County_Name());\n Collections.sort(fromFile,new SortThirdConfirmCount());\n \n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==2&&secondary_order==2){\n //both descending\n Collections.sort(fromFile,new Sort_County_Name().reversed());\n Collections.sort(fromFile, new SortThirdConfirmCount().reversed());\n \n \n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==1){\n //secondary is descending\n Collections.sort(fromFile, new Sort_County_Name().reversed());\n Collections.sort(fromFile,new SortThirdConfirmCount());\n \n \n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n else if(primary_order==2){\n //primary is descending\n Collections.sort(fromFile,new Sort_County_Name());\n Collections.sort(fromFile, new SortThirdConfirmCount().reversed());\n \n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n } \n } \n }\n \n if(primary_sort==4&&secondary_sort==8){\n if(primary_order==1&&secondary_order==1){\n //primary and second is ascending\n \n Collections.sort(fromFile, new SortFourthConfirmCount());\n Collections.sort(fromFile,new Sort_County_Name());\n \n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==2&&secondary_order==2){\n //both descending\n Collections.sort(fromFile,new SortFourthConfirmCount().reversed());\n Collections.sort(fromFile, new Sort_County_Name().reversed());\n \n \n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==1){\n //secondary is descending\n Collections.sort(fromFile, new SortFourthConfirmCount().reversed());\n Collections.sort(fromFile,new Sort_County_Name());\n \n \n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n else if(primary_order==2){\n //primary is descending\n Collections.sort(fromFile,new SortFourthConfirmCount());\n Collections.sort(fromFile, new Sort_County_Name().reversed());\n \n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n } \n } \n }\n \n if(primary_sort==8&&secondary_sort==4){\n if(primary_order==1&&secondary_order==1){\n //primary and second is ascending\n \n Collections.sort(fromFile, new Sort_County_Name());\n Collections.sort(fromFile,new SortFourthConfirmCount());\n \n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==2&&secondary_order==2){\n //both descending\n Collections.sort(fromFile,new Sort_County_Name().reversed());\n Collections.sort(fromFile, new SortFourthConfirmCount().reversed());\n \n \n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==1){\n //secondary is descending\n Collections.sort(fromFile, new Sort_County_Name().reversed());\n Collections.sort(fromFile,new SortFourthConfirmCount());\n \n \n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n else if(primary_order==2){\n //primary is descending\n Collections.sort(fromFile,new Sort_County_Name());\n Collections.sort(fromFile, new SortFourthConfirmCount().reversed());\n \n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n } \n } \n }\n \n if(primary_sort==5&&secondary_sort==6){\n if(primary_order==1&&secondary_order==1){\n //primary and second is ascending\n \n Collections.sort(fromFile, new SortSecondConfirmCount());\n Collections.sort(fromFile,new SortFirstConfirmCount());\n \n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==2&&secondary_order==2){\n //both descending\n Collections.sort(fromFile,new SortSecondConfirmCount().reversed());\n Collections.sort(fromFile, new SortFirstConfirmCount().reversed());\n \n \n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==1){\n //secondary is descending\n Collections.sort(fromFile, new SortSecondConfirmCount().reversed());\n Collections.sort(fromFile,new SortFirstConfirmCount());\n \n \n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n else if(primary_order==2){\n //primary is descending\n Collections.sort(fromFile,new SortSecondConfirmCount());\n Collections.sort(fromFile, new SortFirstConfirmCount().reversed());\n \n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n } \n } \n }\n \n if(primary_sort==6&&secondary_sort==5){\n if(primary_order==1&&secondary_order==1){\n //primary and second is ascending\n \n Collections.sort(fromFile, new SortFirstConfirmCount());\n Collections.sort(fromFile,new SortSecondConfirmCount());\n \n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==2&&secondary_order==2){\n //both descending\n Collections.sort(fromFile,new SortFirstConfirmCount().reversed());\n Collections.sort(fromFile, new SortSecondConfirmCount().reversed());\n \n \n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==1){\n //secondary is descending\n Collections.sort(fromFile, new SortFirstConfirmCount().reversed());\n Collections.sort(fromFile,new SortSecondConfirmCount());\n \n \n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n else if(primary_order==2){\n //primary is descending\n Collections.sort(fromFile,new SortFirstConfirmCount());\n Collections.sort(fromFile, new SortSecondConfirmCount().reversed());\n \n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n } \n } \n }\n \n if(primary_sort==5&&secondary_sort==7){\n if(primary_order==1&&secondary_order==1){\n //primary and second is ascending\n \n Collections.sort(fromFile, new SortThirdConfirmCount());\n Collections.sort(fromFile,new SortFirstConfirmCount());\n \n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==2&&secondary_order==2){\n //both descending\n Collections.sort(fromFile,new SortThirdConfirmCount().reversed());\n Collections.sort(fromFile, new SortFirstConfirmCount().reversed());\n \n \n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==1){\n //secondary is descending\n Collections.sort(fromFile, new SortThirdConfirmCount().reversed());\n Collections.sort(fromFile,new SortFirstConfirmCount());\n \n \n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n else if(primary_order==2){\n //primary is descending\n Collections.sort(fromFile,new SortThirdConfirmCount());\n Collections.sort(fromFile, new SortFirstConfirmCount().reversed());\n \n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n } \n } \n }\n \n if(primary_sort==7&&secondary_sort==5){\n if(primary_order==1&&secondary_order==1){\n //primary and second is ascending\n \n Collections.sort(fromFile, new SortFirstConfirmCount());\n Collections.sort(fromFile,new SortThirdConfirmCount());\n \n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==2&&secondary_order==2){\n //both descending\n Collections.sort(fromFile,new SortFirstConfirmCount().reversed());\n Collections.sort(fromFile, new SortThirdConfirmCount().reversed());\n \n \n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==1){\n //secondary is descending\n Collections.sort(fromFile, new SortFirstConfirmCount().reversed());\n Collections.sort(fromFile,new SortThirdConfirmCount());\n \n \n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n else if(primary_order==2){\n //primary is descending\n Collections.sort(fromFile,new SortFirstConfirmCount());\n Collections.sort(fromFile, new SortThirdConfirmCount().reversed());\n \n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n } \n } \n }\n \n if(primary_sort==5&&secondary_sort==8){\n if(primary_order==1&&secondary_order==1){\n //primary and second is ascending\n \n Collections.sort(fromFile, new SortFourthConfirmCount());\n Collections.sort(fromFile,new SortFirstConfirmCount());\n \n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==2&&secondary_order==2){\n //both descending\n Collections.sort(fromFile,new SortFourthConfirmCount().reversed());\n Collections.sort(fromFile, new SortFirstConfirmCount().reversed());\n \n \n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==1){\n //secondary is descending\n Collections.sort(fromFile, new SortFourthConfirmCount().reversed());\n Collections.sort(fromFile,new SortFirstConfirmCount());\n \n \n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n else if(primary_order==2){\n //primary is descending\n Collections.sort(fromFile,new SortFourthConfirmCount());\n Collections.sort(fromFile, new SortFirstConfirmCount().reversed());\n \n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n } \n } \n }\n \n if(primary_sort==8&&secondary_sort==5){\n if(primary_order==1&&secondary_order==1){\n //primary and second is ascending\n \n Collections.sort(fromFile, new SortFirstConfirmCount());\n Collections.sort(fromFile,new SortFourthConfirmCount());\n \n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==2&&secondary_order==2){\n //both descending\n Collections.sort(fromFile,new SortFirstConfirmCount().reversed());\n Collections.sort(fromFile, new SortFourthConfirmCount().reversed());\n \n \n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==1){\n //secondary is descending\n Collections.sort(fromFile, new SortFirstConfirmCount().reversed());\n Collections.sort(fromFile,new SortFourthConfirmCount());\n \n \n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n else if(primary_order==2){\n //primary is descending\n Collections.sort(fromFile,new SortFirstConfirmCount());\n Collections.sort(fromFile, new SortFourthConfirmCount().reversed());\n \n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n } \n } \n }\n if(primary_sort==6&&secondary_sort==7){\n if(primary_order==1&&secondary_order==1){\n //primary and second is ascending\n \n Collections.sort(fromFile, new SortThirdConfirmCount());\n Collections.sort(fromFile,new SortSecondConfirmCount());\n \n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==2&&secondary_order==2){\n //both descending\n Collections.sort(fromFile,new SortThirdConfirmCount().reversed());\n Collections.sort(fromFile, new SortSecondConfirmCount().reversed());\n \n \n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==1){\n //secondary is descending\n Collections.sort(fromFile, new SortThirdConfirmCount().reversed());\n Collections.sort(fromFile,new SortSecondConfirmCount());\n \n \n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n else if(primary_order==2){\n //primary is descending\n Collections.sort(fromFile,new SortThirdConfirmCount());\n Collections.sort(fromFile, new SortSecondConfirmCount().reversed());\n \n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n } \n } \n }\n if(primary_sort==7&&secondary_sort==6){\n if(primary_order==1&&secondary_order==1){\n //primary and second is ascending\n \n Collections.sort(fromFile, new SortSecondConfirmCount());\n Collections.sort(fromFile,new SortThirdConfirmCount());\n \n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==2&&secondary_order==2){\n //both descending\n Collections.sort(fromFile,new SortSecondConfirmCount().reversed());\n Collections.sort(fromFile, new SortThirdConfirmCount().reversed());\n \n \n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==1){\n //secondary is descending\n Collections.sort(fromFile, new SortSecondConfirmCount().reversed());\n Collections.sort(fromFile,new SortThirdConfirmCount());\n \n \n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n else if(primary_order==2){\n //primary is descending\n Collections.sort(fromFile,new SortSecondConfirmCount());\n Collections.sort(fromFile, new SortThirdConfirmCount().reversed());\n \n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n } \n } \n }\n if(primary_sort==6&&secondary_sort==8){\n if(primary_order==1&&secondary_order==1){\n //primary and second is ascending\n \n Collections.sort(fromFile, new SortFourthConfirmCount());\n Collections.sort(fromFile,new SortSecondConfirmCount());\n \n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==2&&secondary_order==2){\n //both descending\n Collections.sort(fromFile,new SortFourthConfirmCount().reversed());\n Collections.sort(fromFile, new SortSecondConfirmCount().reversed());\n \n \n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==1){\n //secondary is descending\n Collections.sort(fromFile, new SortFourthConfirmCount().reversed());\n Collections.sort(fromFile,new SortSecondConfirmCount());\n \n \n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n else if(primary_order==2){\n //primary is descending\n Collections.sort(fromFile,new SortFourthConfirmCount());\n Collections.sort(fromFile, new SortSecondConfirmCount().reversed());\n \n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n } \n } \n }\n if(primary_sort==8&&secondary_sort==6){\n if(primary_order==1&&secondary_order==1){\n //primary and second is ascending\n \n Collections.sort(fromFile, new SortSecondConfirmCount());\n Collections.sort(fromFile,new SortFourthConfirmCount());\n \n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==2&&secondary_order==2){\n //both descending\n Collections.sort(fromFile,new SortSecondConfirmCount().reversed());\n Collections.sort(fromFile, new SortFourthConfirmCount().reversed());\n \n \n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==1){\n //secondary is descending\n Collections.sort(fromFile, new SortSecondConfirmCount().reversed());\n Collections.sort(fromFile,new SortFourthConfirmCount());\n \n \n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n else if(primary_order==2){\n //primary is descending\n Collections.sort(fromFile,new SortSecondConfirmCount());\n Collections.sort(fromFile, new SortFourthConfirmCount().reversed());\n \n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n } \n } \n }\n if(primary_sort==7&&secondary_sort==8){\n if(primary_order==1&&secondary_order==1){\n //primary and second is ascending\n \n Collections.sort(fromFile, new SortFourthConfirmCount());\n Collections.sort(fromFile,new SortThirdConfirmCount());\n \n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==2&&secondary_order==2){\n //both descending\n Collections.sort(fromFile,new SortFourthConfirmCount().reversed());\n Collections.sort(fromFile, new SortThirdConfirmCount().reversed());\n \n \n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==1){\n //secondary is descending\n Collections.sort(fromFile, new SortFourthConfirmCount().reversed());\n Collections.sort(fromFile,new SortThirdConfirmCount());\n \n \n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n else if(primary_order==2){\n //primary is descending\n Collections.sort(fromFile,new SortFourthConfirmCount());\n Collections.sort(fromFile, new SortThirdConfirmCount().reversed());\n \n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n } \n } \n }\n if(primary_sort==8&&secondary_sort==7){\n if(primary_order==1&&secondary_order==1){\n //primary and second is ascending\n \n Collections.sort(fromFile, new SortThirdConfirmCount());\n Collections.sort(fromFile,new SortFourthConfirmCount());\n \n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==2&&secondary_order==2){\n //both descending\n Collections.sort(fromFile,new SortThirdConfirmCount().reversed());\n Collections.sort(fromFile, new SortFourthConfirmCount().reversed());\n \n \n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==1){\n //secondary is descending\n Collections.sort(fromFile, new SortThirdConfirmCount().reversed());\n Collections.sort(fromFile,new SortFourthConfirmCount());\n \n \n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n else if(primary_order == 2){\n //primary is descending\n Collections.sort(fromFile,new SortThirdConfirmCount());\n Collections.sort(fromFile, new SortFourthConfirmCount().reversed());\n \n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n } \n } \n }\n }", "public static void userSort(ArrayList<String>list) throws FileNotFoundException{\r\n\t\tCollections.sort(list, new Comparator<String>(){\r\n\t\t\t@Override\r\n\t\t\tpublic int compare(String o1, String o2) {\r\n\t\t\t\t// TODO Auto-generated method stub\r\n\t\t\t\t//Take the first string, split according to \";\", and store in an arraylist\r\n\t\t\t\tString[] values = o1.split(\";\");\r\n\t\t\t\t//Take the second string and do the same thing\r\n\t\t\t\tString[] values2 = o2.split(\";\");\r\n\t\t\t\t//Compare strings according to their integer values\r\n\t\t\t\treturn Integer.valueOf(values[0].replace(\"\\\"\", \"\")).compareTo(Integer.valueOf(values2[0].replace(\"\\\"\", \"\")));\r\n\t\t\t}\r\n\t\t});\r\n\t\t//Output sorted ArrayList to a text file\r\n\t\t@SuppressWarnings(\"resource\")\r\n\t\tPrintStream out = new PrintStream(new FileOutputStream(\"SortedUsers.txt\"));\r\n\t\t\tfor(int i = 0; i < list.size(); i++){\r\n\t\t\t\tout.println(list.get(i));\r\n\t\t\t}\r\n\t}", "static void mergeSortedFiles() throws IOException {\n\n\t\tBufferedReader[] bufReaderArray = new BufferedReader[noOfFiles];\n\t\tList<String> intermediateList = new ArrayList<String>();\n\t\tList<String> lineDataList = new ArrayList<String>();\n\n\t\tfor (int file = 0; file < noOfFiles; file++) {\n\t\t\tbufReaderArray[file] = new BufferedReader(new FileReader(DividedfileList.get(file)));\n\n\t\t\tString fileLine = bufReaderArray[file].readLine();\n\n\t\t\tif (fileLine != null) {\n\t\t\t\tintermediateList.add(fileLine.substring(0, 10));\n\t\t\t\tlineDataList.add(fileLine);\n\t\t\t}\n\t\t}\n\n\t\tBufferedWriter bufw = new BufferedWriter(new FileWriter(Outputfilepath));\n\n\t\t// Merge files into one file\n\n\t\tfor (long lineNumber = 0; lineNumber < totalLinesInMainFile; lineNumber++) {\n\t\t\tString sortString = intermediateList.get(0);\n\t\t\tint sortFile = 0;\n\n\t\t\tfor (int iter = 0; iter < noOfFiles; iter++) {\n\t\t\t\tif (sortString.compareTo(intermediateList.get(iter)) > 0) {\n\t\t\t\t\tsortString = intermediateList.get(iter);\n\t\t\t\t\tsortFile = iter;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tbufw.write(lineDataList.get(sortFile) + \"\\r\\n\");\n\t\t\tintermediateList.set(sortFile, \"-1\");\n\t\t\tlineDataList.set(sortFile, \"-1\");\n\n\t\t\tString nextString = bufReaderArray[sortFile].readLine();\n\n\t\t\tif (nextString != null) {\n\t\t\t\tintermediateList.set(sortFile, nextString.substring(0, 10));\n\t\t\t\tlineDataList.set(sortFile, nextString);\n\t\t\t} else {\n\t\t\t\tlineNumber = totalLinesInMainFile;\n\n\t\t\t\tList<String> ListToWrite = new ArrayList<String>();\n\n\t\t\t\tfor (int file = 0; file < intermediateList.size(); file++) {\n\t\t\t\t\tif (lineDataList.get(file) != \"-1\")\n\t\t\t\t\t\tListToWrite.add(lineDataList.get(file));\n\n\t\t\t\t\twhile ((sortString = bufReaderArray[file].readLine()) != null) {\n\t\t\t\t\t\tListToWrite.add(sortString);\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tCollections.sort(ListToWrite);\n\t\t\t\tint index = 0;\n\t\t\t\twhile (index < ListToWrite.size()) {\n\t\t\t\t\tbufw.write(ListToWrite.get(index) + \"\\r\\n\");\n\t\t\t\t\tindex++;\n\t\t\t\t}\n\n\t\t\t}\n\t\t}\n\t\tbufw.close();\n\t\tfor (int file = 0; file < noOfFiles; file++)\n\t\t\tbufReaderArray[file].close();\n\t}", "public static void mergesort (File A) throws IOException {\r\n\t\tFile copy = File.createTempFile(\"Mergesort\", \".bin\");\r\n\t\tcopyFile (A, copy);\r\n\r\n\t\tRandomAccessFile src = new RandomAccessFile(A, \"rw\");\r\n\t\tRandomAccessFile dest = new RandomAccessFile(copy, \"rw\");\r\n\t\tFileChannel srcC = src.getChannel();\r\n\t\tFileChannel destC = dest.getChannel();\r\n\t\tMappedByteBuffer srcMap = srcC.map (FileChannel.MapMode.READ_WRITE, 0, src.length());\r\n\t\tMappedByteBuffer destMap = destC.map (FileChannel.MapMode.READ_WRITE, 0, dest.length());\r\n\r\n\t\tmergesort (destMap, srcMap, 0, (int) A.length());\r\n\t\t\r\n\t\tsrc.close();\r\n\t\tdest.close();\r\n\t\tcopy.deleteOnExit();\r\n\t}", "public Files(){\n this.fileNameArray.add(\"bridge_1.txt\");\n this.fileNameArray.add(\"bridge_2.txt\");\n this.fileNameArray.add(\"bridge_3.txt\");\n this.fileNameArray.add(\"bridge_4.txt\");\n this.fileNameArray.add(\"bridge_5.txt\");\n this.fileNameArray.add(\"bridge_6.txt\");\n this.fileNameArray.add(\"bridge_7.txt\");\n this.fileNameArray.add(\"bridge_8.txt\");\n this.fileNameArray.add(\"bridge_9.txt\");\n this.fileNameArray.add(\"ladder_1.txt\");\n this.fileNameArray.add(\"ladder_2.txt\");\n this.fileNameArray.add(\"ladder_3.txt\");\n this.fileNameArray.add(\"ladder_4.txt\");\n this.fileNameArray.add(\"ladder_5.txt\");\n this.fileNameArray.add(\"ladder_6.txt\");\n this.fileNameArray.add(\"ladder_7.txt\");\n this.fileNameArray.add(\"ladder_8.txt\");\n this.fileNameArray.add(\"ladder_9.txt\");\n }", "@Override\n public int compareTo(Item o) {\n return name.compareTo(o.getName());\n }", "public void step2(){\n\n Collections.sort(names,(String a,String b) -> {\n return a.compareTo(b);\n });\n }", "public void sort() throws IOException {\n for(int i = 0; i < 32; i++)\n {\n if(i%2 == 0){\n filePointer = file;\n onePointer = one;\n }else{\n filePointer = one;\n onePointer = file;\n }\n filePointer.seek(0);\n onePointer.seek(0);\n zero.seek(0);\n zeroCount = oneCount = 0;\n for(int j = 0; j < totalNumbers; j++){\n int n = filePointer.readInt();\n sortN(n,i);\n }\n //Merging\n onePointer.seek(oneCount*4);\n zero.seek(0L);\n for(int j = 0; j < zeroCount; j++){\n int x = zero.readInt();\n onePointer.writeInt(x);\n }\n //One is merged\n }\n }", "public String name_of_sort()\r\n\t{\r\n\t\treturn \"Merge sort\";\r\n\t}", "@Test\n public void testStoreFileAlphabetical() {\n\n File file1 = new File(\"c\");\n File file2 = new File(\"b\");\n File file3 = new File(\"a\");\n parent.storeFile(file1);\n parent.storeFile(file2);\n parent.storeFile(file3);\n ArrayList<File> output = parent.getStoredFiles();\n ArrayList<File> expected = new ArrayList<File>();\n expected.add(file3);\n expected.add(file2);\n expected.add(file1);\n assertEquals(output, expected);\n }", "private void sortItems(List<Transaction> theList) {\n\t\tloadList(theList);\r\n\t\tCollections.sort(theList, new Comparator<Transaction>() {\r\n\t\t\tpublic int compare(Transaction lhs, Transaction rhs) {\r\n\t\t\t\t// String lhsName = lhs.getName();\r\n\t\t\t\t// String rhsName = rhs.getName();\r\n\r\n\t\t\t\treturn 0;\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t}", "@Override\n public int compareTo(Snippet o) {\n return this.name.compareTo(o.name);\n }", "@Override\n\tpublic int compareTo(Photo p) {\n\t\treturn (new Date(this.f.lastModified())).compareTo(new Date(p.getFile().lastModified()));\n\t}", "public void sort(Comparator<? super AudioFile> comparator) {\n Collections.sort(mObjects, comparator);\n if (mNotifyOnChange) notifyDataSetChanged();\n }", "public void sortGivenArray_name(){\n movieList = quickSort(movieList);\n }", "private void sortAlphabet()\n {\n for(int i = 0; i < movieList.size(); i++){\n for(int j = 1; j < movieList.size() - i; j++)\n {\n Movie a = movieList.get(j-1);\n Movie b = movieList.get(j);\n int result = a.getTitle().compareTo(b.getTitle());\n if(result > 0)\n {\n movieList.set(j-1, b);\n movieList.set(j, a);\n }\n }\n }\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 FileNameComparator(boolean desc) {\n this.desc = desc;\n }", "public static LinkedList<String> sortFilesByDate(LinkedList<String> mainDirectories, String subDirectory, Text text) {\n\t\t// Read the directories and sort the files\n\t\tLinkedList<String> sortedFileNames = new LinkedList<String>();\n\t\tComparator<File> comparator = new FileComparator();\n\t\tPriorityQueue<File> files = new PriorityQueue<File>(20, comparator);\n\t\twhile (!mainDirectories.isEmpty()) {\n\t\t\treadAndSortDirectoryFilesByDate(mainDirectories.removeFirst(), text,\n\t\t\t\t\tfiles, subDirectory);\n\t\t}\n\t\t// Transform Files priority queues list into String list\n\t\twhile (!files.isEmpty()) {\n\t\t\tsortedFileNames.addLast(files.remove().toString());\n\t\t}\n\t\treturn sortedFileNames;\n\t}", "public int compareTo(myclass p) {\n //deal with name 'all'\n if(this.getName().compareTo(\"all\")==0 && p.getName().compareTo(\"all\")!=0)\n return 1;\n else if (this.getName().compareTo(\"all\")!=0 && p.getName().compareTo(\"all\")==0)\n return -1;\n //deal with filename\n else if (this.getName().compareTo(p.getName()) < 0) {\n return -1;\n } else if (this.getName().compareTo(p.getName()) > 0) {\n return 1;}\n else{\n //deal with value\n if (this.x > p.x) {\n return -1;\n } else if (this.x < p.x) {\n return 1;\n } else {\n //deal with word\n if (this.getY().compareTo(p.getY()) < 0) {\n return -1;\n } else if (this.getY().compareTo(p.getY()) > 0) {\n return 1;\n } else {\n return 0;\n }\n\n }}\n }", "public void sort() {\r\n\t\tCollections.sort(parts);\r\n\t}", "public static void sort(String f1, String f2) throws FileNotFoundException, IOException {\n\t\tDataInputStream input = new DataInputStream(new BufferedInputStream(new FileInputStream(new File(f1))));\n\t\tfileSize = (int) input.available()/4;\n\t\tif (fileSize == 0){ input.close(); return;} //file is empty\t\n\t\t\n\t\tRandomAccessFile f1a = new RandomAccessFile(f1,\"rw\");\n\t\tRandomAccessFile f2a = new RandomAccessFile(f2,\"rw\");\n\t\tDataOutputStream f1d = new DataOutputStream(new BufferedOutputStream(new FileOutputStream(f1a.getFD())));\n\t\tDataOutputStream f2d = new DataOutputStream(new BufferedOutputStream(new FileOutputStream(f2a.getFD())));\n\t\t\n\t\t//perform quicksort on partitions of quickSortSize\n\t\tquickSortSize = (int) (Math.min(quickSortSize, fileSize)); \n\t\tint numDivisions = (int) (Math.floor(fileSize/quickSortSize));\n\t\tint excess = (int) (fileSize%(numDivisions*quickSortSize));\n\t\tint[] tmp = new int[quickSortSize];\n\t\tfor (int j = 0; j < numDivisions; j++){\n\t\t\tfor (int i = 0; i< quickSortSize; i++){\n\t\t\t\ttmp[i] = input.readInt();\n\t\t\t}\n\t\t\tquickSort(tmp);\n\t\t\tfor (int i: tmp){\n\t\t\t\tf2d.writeInt(i);\n\t\t\t}\n\t\t}\n\t\ttmp = new int[excess];\n\t\tfor (int i = 0; i< excess; i++){\n\t\t\ttmp[i] = input.readInt();\n\t\t}\n\t\tquickSort(tmp);\n\t\tfor (int i: tmp){\n\t\t\tf2d.writeInt(i);\n\t\t}\n\t\tf2d.flush();\n\t\tinput.close();\n\t\t\n\t\t//Perform Merge sort on the larger partitions\n\t\tint iteration = (int) Math.ceil(Math.log(fileSize/(quickSortSize))/Math.log(2));\n\t\tfor (int i = 0; i < iteration; i++){\n\t\t\tint size = (int) Math.pow(2, i)*quickSortSize;\n\t\t\tif (i%2 == 0){ \n\t\t\t\tf1a.seek(0);\n\t\t\t\tstepSorter(f2, f1d, size);\n\t\t\t} else {\n\t\t\t\tf2a.seek(0);\n\t\t\t\tstepSorter(f1, f2d, size);\n\t\t\t}\n\t\t}\n\n\t\t//Copies f2 to f1 if the iteration ends with f2\n\t\tif (iteration%2==0){\n\t\t\tFileChannel source = null;\n\t\t\tFileChannel destination = null;\n\t\t\ttry {\n\t\t\t\tsource = new FileInputStream(f2).getChannel();\n\t\t\t\tdestination = new FileOutputStream(f1).getChannel();\n\t\t destination.transferFrom(source, 0, source.size());\n\t\t }\n\t\t finally {\n\t\t if(source != null) {\n\t\t source.close();\n\t\t }\n\t\t if(destination != null) {\n\t\t destination.close();\n\t\t }\n\t\t }\n\t\t}\n\t\tf1a.close();\n\t\tf2a.close();\n\t\tf1d.close();\n\t\tf2d.close();\n\t}", "public static String parseSortClassName(final String name) {\n final int index = name.lastIndexOf('.');\n return name.substring(index + 1, name.length());\n }", "java.lang.String getFileNames(int index);", "java.lang.String getFileNames(int index);", "void sort();", "void sort();", "public static void sortInputExternalMerge() {\r\n\t\tExternalMultiwayMerge merge = new ExternalMultiwayMerge();\r\n\t\tmerge.sort(inputFile, M, d);\r\n\t}", "@Override\n public int compare(SongInfo o1, SongInfo o2) {\n return o1.getSongName().compareTo(o2.getSongName());\n }", "private SortOrder(String strName) { m_strName = strName; }", "public void sortEmployeeByName() {\r\n\t\tfor (int indexI = 0; indexI < emp.size() - 1; indexI++) {\r\n\t\t\t\r\n\t\t\tfor (int indexJ = 0; indexJ < emp.size() - indexI - 1; indexJ++) {\r\n\t\t\t\r\n\t\t\t\tif ((emp.get(indexJ).name).compareTo(emp.get(indexJ + 1).name) > 0) {\r\n\t\t\t\t\tEmployee temp1 = emp.get(indexJ);\r\n\t\t\t\t\tEmployee temp2 = emp.get(indexJ + 1);\r\n\t\t\t\t\temp.set(indexJ, temp2);\r\n\t\t\t\t\temp.set(indexJ + 1, temp1);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t}", "public int compareTo(Object arg) {\n\t\tFileSystem temp = (FileSystem) arg;\n\t\treturn(_mount.compareTo(temp.getMountPoint()));\n\t}", "public void step4(){\n\n Collections.sort(names,(a,b)->b.compareTo(a));\n\n\n System.out.println(\"names sorted are :\"+names);\n }", "@Override\n protected Comparator<? super UsagesInFile> getRefactoringIterationComparator() {\n return new Comparator<UsagesInFile>() {\n @Override\n public int compare(UsagesInFile o1, UsagesInFile o2) {\n int result = comparePaths(o1.getFile(), o2.getFile());\n if (result != 0) {\n return result;\n }\n int imports1 = countImports(o1.getUsages());\n int imports2 = countImports(o2.getUsages());\n return imports1 > imports2 ? -1 : imports1 == imports2 ? 0 : 1;\n }\n\n private int comparePaths(PsiFile o1, PsiFile o2) {\n String path1 = o1.getVirtualFile().getCanonicalPath();\n String path2 = o2.getVirtualFile().getCanonicalPath();\n return path1 == null && path2 == null ? 0 : path1 == null ? -1 : path2 == null ? 1 : path1.compareTo(path2);\n }\n\n private int countImports(Collection<UsageInfo> usages) {\n int result = 0;\n for (UsageInfo usage : usages) {\n if (FlexMigrationUtil.isImport(usage)) {\n ++result;\n }\n }\n return result;\n }\n };\n }", "public int compareFiles(File file1, File file2)\n\t\t\tthrows FileNotFoundException {\n\t\treturn _order.compareFiles(file1, file2) * (_reverse ? -1 : 1);\n\t}", "public List<String> sortFilesByExtensions(String[] listOfFileNames) throws DirectoryException{\r\n\t\tList<String> orginalList = new CopyOnWriteArrayList<>(Arrays.asList(listOfFileNames));\r\n\t\tSet<String> setOfuniqueExtension = new TreeSet<>();\r\n\r\n\t\tfor (String item : listOfFileNames) {\r\n\t\t\tif (item.contains(\".\")) {\r\n\t\t\t\tString[] split = item.split(HelperContstants.DELIMETER);\r\n\t\t\t\tString temp = \".\" + split[split.length - 1];\r\n\t\t\t\tsetOfuniqueExtension.add(temp);\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tList<String> finalListOfAllFiles = new LinkedList<>();\r\n\t\tsetOfuniqueExtension.stream().forEach((s1) -> {\r\n\t\t\tfor (int i = 0; i < orginalList.size(); i++) {\r\n\t\t\t\tif (orginalList.get(i).contains(s1)) {\r\n\t\t\t\t\tfinalListOfAllFiles.add(orginalList.get(i));\r\n\t\t\t\t\torginalList.remove(orginalList.get(i));\r\n\t\t\t\t\ti--;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t\torginalList.stream().filter((s1) -> (!finalListOfAllFiles.contains(s1))).forEach((s1) -> {\r\n\t\t\tfinalListOfAllFiles.add(s1);\r\n\t\t});\r\n\r\n\t\treturn finalListOfAllFiles;\r\n\t}", "private void mapSortedFiles(String file1, String file2) {\n\t\tString file1Copy = tempPath + tempFileName.getTempFileName(sourcePath1, \"Mapper\");\r\n\t\tString file2Copy = tempPath + tempFileName.getTempFileName(sourcePath2, \"Mapper\");\r\n\r\n\t\tcreateFileCopy(new File(file1).toPath(), file1Copy);\r\n\t\tcreateFileCopy(new File(file2).toPath(), file2Copy);\r\n\r\n\t\ttry {\r\n\t\t\tLineIterator file1Iterator = FileUtils.lineIterator(new File(file1));\r\n\r\n\t\t\tLineIterator file2Iterator = FileUtils.lineIterator(new File(file2));\r\n\r\n\t\t\tint leftIndex = 0;\r\n\t\t\tint rightIndex = 0;\r\n\r\n\t\t\twhile (file1Iterator.hasNext()) {\r\n\r\n\t\t\t\tString left = file1Iterator.nextLine();\r\n\t\t\t\tString right = file2Iterator.nextLine();\r\n\r\n\t\t\t\tString leftSortKey = getSortKey(left);\r\n\t\t\t\tString rightSortKey = getSortKey(right);\r\n\t\t\t\t\r\n\t\t\t\tleftIndex++;\r\n\t\t\t\trightIndex++;\r\n\t\t\t\t\r\n\r\n\t\t\t\twhile (leftSortKey.compareTo(rightSortKey) > 0) {\r\n\t\t\t\t\t\r\n\t\t\t\t\t//System.out.println(leftSortKey +\", \" + rightSortKey);\r\n\r\n\t\t\t\t\tList<String> lines = Files.readAllLines(Paths.get(file1Copy));\r\n\t\t\t\t\tlines.add(leftIndex-1, getEmptyLine());\r\n\t\t\t\t\tFiles.write(Paths.get(file1Copy), lines);\r\n\r\n\t\t\t\t\trightIndex++;\r\n\t\t\t\t\tright = file2Iterator.nextLine();\r\n\t\t\t\t\trightSortKey = getSortKey(right);\r\n\r\n\t\t\t\t}\r\n\r\n\t\t\t\twhile (leftSortKey.compareTo(rightSortKey) < 0) {\r\n\t\t\t\t\t\r\n\t\t\t\t\t//System.out.println(leftSortKey +\", \" + rightSortKey);\r\n\r\n\t\t\t\t\tList<String> lines = Files.readAllLines(Paths.get(file2Copy));\r\n\t\t\t\t\tlines.add(rightIndex-1, getEmptyLine());\r\n\t\t\t\t\tFiles.write(Paths.get(file2Copy), lines);\r\n\r\n\t\t\t\t\tleftIndex++;\r\n\t\t\t\t\tleft = file1Iterator.nextLine();\r\n\t\t\t\t\tleftSortKey = getSortKey(left);\r\n\r\n\t\t\t\t}\r\n\r\n\t\t\t}\r\n\r\n\t\t} catch (IOException e) {\r\n\t\t\tSystem.out.println(\"Temp file was not found: \" + e.getMessage());\r\n\t\t}\r\n\r\n\t}", "public static ArrayList<File> sortOsmFiles(Set<File> files) {\n File[] sortingArray = files.toArray(new File[0]);\n Arrays.sort(sortingArray, LastModifiedFileComparator.LASTMODIFIED_COMPARATOR);\n ArrayList<File> sortedList = new ArrayList<>();\n for(int i = 0; i < sortingArray.length; i++) {\n sortedList.add(sortingArray[i]);\n }\n\n return sortedList;\n }" ]
[ "0.72009665", "0.71134895", "0.6819677", "0.68182033", "0.67074585", "0.66604745", "0.65176404", "0.6513625", "0.6506237", "0.635522", "0.63166666", "0.62951475", "0.62918425", "0.623394", "0.62075645", "0.6191847", "0.61697865", "0.60549265", "0.6052062", "0.60381526", "0.60376215", "0.6017515", "0.6002576", "0.5991571", "0.5964107", "0.5934093", "0.5930779", "0.5928894", "0.5921", "0.5909519", "0.58911455", "0.58842224", "0.58840084", "0.5869654", "0.5861985", "0.58531076", "0.5832058", "0.58219934", "0.5819763", "0.58008975", "0.5799532", "0.5798579", "0.5798187", "0.5798187", "0.5780974", "0.57623154", "0.57534254", "0.57530785", "0.5745548", "0.57425237", "0.57308894", "0.5716989", "0.56918305", "0.56917244", "0.56807387", "0.5675417", "0.5663396", "0.5659953", "0.5652879", "0.5652262", "0.56266385", "0.5620707", "0.561829", "0.56053454", "0.55946887", "0.5585851", "0.55634165", "0.5560522", "0.55512327", "0.55456144", "0.55402523", "0.5532478", "0.55151546", "0.55110884", "0.5509097", "0.55062735", "0.5485258", "0.5477738", "0.5475744", "0.5468974", "0.54647887", "0.5461454", "0.5460172", "0.5459788", "0.54593486", "0.54574955", "0.54574955", "0.5445314", "0.5445314", "0.54447955", "0.5441721", "0.5419604", "0.5417013", "0.5401712", "0.5400197", "0.53912944", "0.5387989", "0.53855896", "0.53837025", "0.53824973" ]
0.61366004
17
PROPERTY File METHODS method reads all property in file in hashmap
public HashMap<String, String> readPropertyFile(String propertyFilePath) throws Exception { File propertyFile = null; InputStream inputStream = null; Properties properties = null; HashMap<String, String> propertyMap = new HashMap<String, String>(); try { //creating file object propertyFile = new File(propertyFilePath); //check if property file exists on hard drive if (propertyFile.exists()) { inputStream = new FileInputStream(propertyFile); // check if the file exists in web environment or relative to class path } else { inputStream = getClass().getClassLoader().getResourceAsStream(propertyFilePath); } if (inputStream == null) { throw new Exception("FILE NOT FOUND : inputStream = null : " + propertyFilePath); } properties = new Properties(); properties.load(inputStream); Enumeration enuKeys = properties.keys(); while (enuKeys.hasMoreElements()) { String key = (String) enuKeys.nextElement(); String value = properties.getProperty(key); //System.out.print("key = "+key + " : value = "+value); propertyMap.put(key, value); } if (propertyMap == null) { throw new Exception("readPropertyFile : propertyMap = null"); } return propertyMap; } catch (Exception e) { throw new Exception("readPropertyFile : " + e.toString()); } finally { try { inputStream.close(); } catch (Exception e) { } try { properties = null; } catch (Exception e) { } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public Map<String, String> fetchPropertyFromFile()\n {\n Map<String, String> components = new HashMap<>();\n Properties props = new Properties();\n InputStream in = null;\n try {\n in = new FileInputStream(\"/slog/properties/LogAnalyzer.properties\");\n props.load(in);\n in.close();\n } catch (FileNotFoundException e) {\n e.printStackTrace();\n }\n\n catch (IOException e) {\n e.printStackTrace();\n }\n// Add component config , logname RegEx pattern to a Map. This map will be used to search matching files and forming logstash command\n for (String key : props .stringPropertyNames())\n {\n System.out.println(key + \" = \" + props .getProperty(key));\n components.put (key, props.getProperty(key));\n }\n\n return components;\n }", "@Override\n public Map<String, String> readProperty(String fileName) {\n Map<String, String> result = new HashMap<>();\n Properties prop = new Properties();\n InputStream input;\n try {\n input = FullPropertyReader.class.getClassLoader().getResourceAsStream(fileName);\n prop.load(input);\n Set<String> strings = prop.stringPropertyNames();\n for (String string : strings) {\n result.put(string, prop.getProperty(string));\n }\n } catch (IOException e) {\n throw new PropertyReaderException(\"Trouble in FullPropertyReader\", e);\n }\n return result;\n }", "File getPropertiesFile();", "private void getPropValues() {\n Properties prop = new Properties();\n \n InputStream inputStream = getClass().getClassLoader().getResourceAsStream(propFileName);\n try {\n prop.load(inputStream);\n } catch (IOException ex) {\n Logger.getLogger(PropResources.class.getName()).log(Level.SEVERE, null, ex);\n }\n if (inputStream == null) {\n try {\n throw new FileNotFoundException(\"ERROR: property file '\" + propFileName + \"' not found in the classpath\");\n } catch (FileNotFoundException ex) {\n Logger.getLogger(PropResources.class.getName()).log(Level.SEVERE, null, ex);\n }\n }\n // get property values\n this.defaultDirectory = prop.getProperty(\"defaultDirectory\");\n this.topicsFile = this.defaultDirectory + prop.getProperty(\"topics\");\n this.scripturesFile = this.defaultDirectory + prop.getProperty(\"scriptures\");\n this.defaultJournalXML = this.defaultDirectory + prop.getProperty(\"defaultJournalXML\");\n this.defaultJournalTxt = this.defaultDirectory + prop.getProperty(\"defaultJournalTxt\");\n }", "@SuppressWarnings(\"unchecked\")\n private void loadProperties()\n {\n File f = getPropertiesFile();\n if (!f.exists())\n return;\n \n m_props = (Map<String, Object>) PSConfigUtils.loadObjectFromFile(f);\n }", "public static void extractValues() throws IOException{\n GenerateFile generateFile = new GenerateFile();\n Stream<String> fileStream1 = createStreamFromPath(\"src\"+File.separator+\"test.properties\");\n logger.info(fileStream1.toString());\n Set<String> extractedKeys = generateFile.extractvalsFromPropertiesFile(fileStream1);\n List<String> newString = new ArrayList<>(extractedKeys);\n System.out.println(extractedKeys);\n generateFile.createFileFromList(newString,\"values.txt\");\n }", "private static void readCitProperties(String fileName) {\n/* */ try {\n/* 91 */ ResourceLocation e = new ResourceLocation(fileName);\n/* 92 */ InputStream in = Config.getResourceStream(e);\n/* */ \n/* 94 */ if (in == null) {\n/* */ return;\n/* */ }\n/* */ \n/* */ \n/* 99 */ Config.dbg(\"CustomItems: Loading \" + fileName);\n/* 100 */ Properties props = new Properties();\n/* 101 */ props.load(in);\n/* 102 */ in.close();\n/* 103 */ useGlint = Config.parseBoolean(props.getProperty(\"useGlint\"), true);\n/* */ }\n/* 105 */ catch (FileNotFoundException var4) {\n/* */ \n/* */ return;\n/* */ }\n/* 109 */ catch (IOException var5) {\n/* */ \n/* 111 */ var5.printStackTrace();\n/* */ } \n/* */ }", "protected void readProperties() throws RepositoryException {\n try {\n log.debug(\"Reading meta file: \" + this.metaFile);\n this.properties = new HashMap();\n BufferedReader reader = new BufferedReader(new FileReader(this.metaFile));\n String line;\n while ((line = reader.readLine()) != null) {\n line = line.trim();\n String name;\n String typeName;\n String value;\n try {\n name = line.substring(0, line.indexOf(\"<\")).trim();\n typeName = line.substring(line.indexOf(\"<\")+1, line.indexOf(\">\")).trim();\n value = line.substring(line.indexOf(\":\")+1).trim();\n } catch (StringIndexOutOfBoundsException e) {\n throw new RepositoryException(\"Error while parsing meta file: \" + this.metaFile \n + \" at line \" + line);\n }\n Property property = new DefaultProperty(name, PropertyType.getType(typeName), this);\n property.setValueFromString(value);\n this.properties.put(name, property);\n }\n reader.close();\n } catch (IOException e) {\n throw new RepositoryException(\"Error while reading meta file: \" + metaFile + \": \" \n + e.getMessage());\n }\n }", "public void loadProperties(){\n\n\ttry{\n\t prop.load(file);\n // get the property value and print it out\n host = prop.getProperty(\"host\");\n\t port = prop.getProperty(\"port\");\n\t sslmode = prop.getProperty(\"sslmode\");\n\t source = prop.getProperty(\"source\");\n dbname = prop.getProperty(\"dbname\");\n help_url_prefix = prop.getProperty(\"base.help.url\");\n password = prop.getProperty(\"password\");\n\t user = prop.getProperty(\"user\");\t \n\t temp_dir = new File(System.getProperty(\"java.io.tmpdir\")).toString();\n\t working_dir = new File(System.getProperty(\"user.dir\")).toString();\n\t file.close();\n\t}catch(IOException ioe){\n\t\t\n\t} \n\t \n }", "public ArrayList<Property> getProperties() {\r\n\t\ttry {\r\n\t\t\tproperties.clear();\r\n\t\t\tFileInputStream fis = new FileInputStream(PROPERTY_FILEPATH);\r\n \tObjectInputStream ois = new ObjectInputStream(fis);\r\n \t\r\n \tProperty obj = null;\r\n \twhile ((obj=(Property)ois.readObject())!=null) {\r\n \t\tproperties.add(obj);\r\n \t}\r\n \tois.close();\r\n }\r\n\t\tcatch (EOFException e) {\r\n\t\t\tSystem.out.println(\"End of file reached.\");\r\n }\r\n catch (ClassNotFoundException e) {\r\n \te.printStackTrace();\r\n }\r\n catch (IOException e) {\r\n \te.printStackTrace();\r\n }\r\n\t\treturn properties;\r\n\t}", "public Map executeFileLoader(String propertyFile) {\r\n\t\t\r\n\t\tProperties propertyVals = new Properties();\r\n\t\ttry {\r\n\t\t\tInputStream inputStream = getClass().getClassLoader().getResourceAsStream(propertyFile);\r\n\t\t\tpropertyVals.load(inputStream);\r\n\t\t\t\t\r\n\t\t\tString URL =\tpropertyVals.getProperty(\"URL\");\r\n\t\t\tString Depth =\tpropertyVals.getProperty(\"Depth\");\r\n\t\t\tfactorVals = new HashMap<String, String>();\r\n\t\t\t\r\n\t\t\tfor(int i=0; i<2; i++)\r\n\t\t\t{\r\n\t\t\t\tif(i==0)\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tfactorVals.put(\"URL\", URL);\r\n\t\t\t\t\t}\t\r\n\t\t\t\telse\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tfactorVals.put(\"Depth\", Depth);\r\n\t\t\t\t\t}\r\n\t\t\t}\r\n\t\t\r\n\t\t} \r\n\t\tcatch (IOException e) {\r\n\t\t\tSystem.out.println(\"File not Found.\");\r\n\t\t\te.printStackTrace();\r\n\t\t}\r\n\t\treturn factorVals;\t\r\n\t}", "public abstract String getPropertyFile();", "public ReadPropertyFile()\n\t{\n\t prob = new Properties(); \n\t \n\t try\n\t {\n\t FileInputStream fis = new FileInputStream(\".//config.properties\");\n\t prob.load(fis);\n\t }\n\t catch(FileNotFoundException e)\n\t {\n\t\t System.out.println(e.getMessage());\n\t }\n catch(IOException e)\n\t {\n \t System.out.println(e.getMessage());\n\t }\n\t}", "public Map getProperties();", "@Override\n public Properties loadProperties(String filename) {\n return testProperties;\n }", "public static Map<String, String> getPropertiesMap(String filename) throws IOException{\n Map<String, String> map = new LinkedHashMap();\n Properties p = new Properties();\n loadProperties(p, filename);\n Set<String> keys = p.stringPropertyNames();\n for (String k : keys) {\n map.put(k, p.getProperty(k));\n }\n return map;\n }", "private void loadProperties(){\n try {\n input = new FileInputStream(fileName);\n properties.load(input);\n } catch (IOException e) {\n System.out.println(\"--- FAILED TO LOAD GAME ---\");\n e.printStackTrace();\n } finally {\n if (input != null) {\n try {\n input.close();\n } catch (IOException e) {\n System.out.println(\"--- FAILED TO CLOSE INTPUT ---\");\n e.printStackTrace();\n }\n }\n }\n }", "private static Properties getProperties(final String filename) throws IOException, FileNotFoundException {\r\n \r\n final Properties result = new Properties();\r\n final InputStream propertiesStream = getInputStream(filename);\r\n result.load(propertiesStream);\r\n return result;\r\n }", "private void loadPropertyFiles() {\n if ( _sax_panel != null ) {\n _property_files = ( ( SAXTreeModel ) _sax_panel.getModel() ).getPropertyFiles();\n if ( _property_files == null )\n return ;\n HashMap filelist = new HashMap();\n ArrayList resolved = new ArrayList();\n Iterator it = _property_files.keySet().iterator();\n while ( it.hasNext() ) {\n Object o = it.next();\n if ( o == null )\n continue;\n File f = null;\n if ( o instanceof File ) {\n f = ( File ) o;\n Long lastModified = ( Long ) _property_files.get( f );\n filelist.put( f, lastModified );\n }\n else if ( _project != null ) {\n String value = o.toString();\n String filename = value;\n if ( value.startsWith( \"${\" ) && value.endsWith( \"}\" ) ) {\n filename = filename.substring( 2, filename.length() - 1 );\n }\n filename = _project.getProperty( filename );\n if ( filename != null )\n f = new File( filename );\n if ( f != null && !f.exists() ) {\n f = new File( _project.getBaseDir(), filename );\n }\n if ( f != null && f.exists() ) {\n filelist.put( f, new Long( f.lastModified() ) );\n resolved.add( value );\n }\n // see issue #21, Ant standard is to quietly ignore files not found\n //else\n // _logger.warning( \"Unable to find property file for \" + value );\n }\n }\n it = resolved.iterator();\n while ( it.hasNext() ) {\n filelist.remove( it.next() );\n }\n _property_files = filelist;\n }\n }", "public Map<String, String> getProperties() {\n\t\tif (propertiesReader == null) {\n\t\t\tpropertiesReader = new PropertyFileReader();\n\t\t}\n\t\tpropertyMap = propertiesReader.getPropertyMap();\n\t\tlog.info(\"fetched all properties\");\n\t\treturn propertyMap;\n\t}", "public void getPropValues() throws IOException {\r\n try {\r\n Properties prop = new Properties();\r\n String path = System.getProperty(\"user.dir\") +\"\\\\src\\\\es\\\\udc\\\\redes\\\\webserver\\\\resources\\\\\";\r\n\t String filename = \"config.properties\";\r\n inputStream = new FileInputStream(path+filename);\r\n if (inputStream != null) {\r\n prop.load(inputStream);\r\n } else {\r\n\t\tthrow new FileNotFoundException(\"property file '\"+path + filename + \"' not found\");\r\n }\r\n\t // get the property value and set in attributes\r\n\t this.PORT = prop.getProperty(\"PORT\");\r\n this.DIRECTORY_INDEX = prop.getProperty(\"DIRECTORY_INDEX\");\r\n this.DIRECTORY = System.getProperty(\"user.dir\")+ prop.getProperty(\"DIRECTORY\");\r\n this.ALLOW = prop.getProperty(\"ALLOW\");\r\n this.HOSTNAME = prop.getProperty(\"HOSTNAME\");\r\n System.out.println();\r\n } catch (Exception e) {\r\n\t\tSystem.out.println(\"Exception: \" + e);\r\n\t} finally {\r\n\t\tinputStream.close();\r\n\t}\r\n }", "private synchronized void readProperties()\n {\n \n String workPath = \"webserver\";\n try\n {\n workPath = (String) SageTV.api(\"GetProperty\", new Object[]{\"nielm/webserver/root\",\"webserver\"});\n }\n catch (InvocationTargetException e)\n {\n System.out.println(e);\n }\n \n // check if called within 30 secs (to prevent to much FS access)\n if (fileLastReadTime + 30000 > System.currentTimeMillis())\n {\n return;\n }\n\n // check if file has recently been loaded\n File propsFile=new File(workPath,\"extenders.properties\");\n if (fileLastReadTime >= propsFile.lastModified())\n {\n return;\n }\n\n if (propsFile.canRead())\n {\n BufferedReader in = null;\n contextNames.clear();\n try\n {\n in = new BufferedReader(new FileReader(propsFile));\n String line;\n Pattern p = Pattern.compile(\"([^=]+[^=]*)=(.*)\");\n while (null != (line = in.readLine()))\n {\n line = line.trim();\n if ((line.length() > 0) && (line.charAt(0) != '#'))\n {\n Matcher m =p.matcher(line.trim());\n if (m.matches())\n {\n contextNames.put(m.group(1).trim(), m.group(2).trim());\n }\n else\n {\n System.out.println(\"Invalid line in \"+propsFile+\"\\\"\"+line+\"\\\"\");\n }\n }\n }\n fileLastReadTime=System.currentTimeMillis();\n\n }\n catch (IOException e)\n {\n System.out.println(\"Exception occurred trying to load properties file: \"+propsFile+\"-\" + e);\n }\n finally\n {\n if (in != null)\n {\n try\n {\n in.close();\n }\n catch (IOException e) {}\n }\n }\n } \n }", "void readProperties(java.util.Properties p) {\n }", "public abstract Properties getProperties();", "public File getPropertyFile() { return propertyFile; }", "StringMap getProperties();", "@Test\r\n\t\tpublic static void Properties() \r\n\r\n\t\t{\r\n\t\t\ttry{\r\n\t\t\t\tprop = new Properties();\r\n\t\t\t\tfile = new File(\"C:\\\\Users\\\\vardhan\\\\eclipse-workspace\\\\com.makemytrip\\\\prop.properties\");\r\n\t\t\t\tfilereader = new FileReader(file);\r\n\t\t\t\tprop.load(filereader);\r\n\t\t\t\t\r\n\t\t\t }\r\n\t\t\r\n\t\t\r\n\t\t\tcatch(Exception e)\r\n\t\t\t{\r\n\t\t\t\tSystem.out.println(e.getMessage());\r\n\t\t\t\r\n\t\t\t}\r\n\t\t}", "public void refresh() {\n try (InputStream stream = new FileInputStream(file)) {\n Map<String, String> properties = new HashMap<>();\n Properties props = new Properties();\n props.load(stream);\n for (String key : props.stringPropertyNames()) {\n properties.put(key, props.getProperty(key));\n }\n LOG.log(Level.FINEST, \"Loaded properties from \" + file);\n this.properties = properties;\n } catch (IOException e) {\n LOG.log(Level.FINEST, \"Cannot load properties from \" + file, e);\n }\n }", "public abstract void readFromFile(String key, String value);", "void setPropertiesFile(File file);", "Map<String, String> getProperties();", "Map<String, String> getProperties();", "private static void storePropsFile() {\n try {\n FileOutputStream fos = new FileOutputStream(propertyFile);\n props.store(fos, null);\n fos.close();\n } catch (IOException ex) {\n Debugger.logMessage(ex);\n }\n }", "private static void loadPropertiesFile() {\n checkNotNull(propertyFileName, \"propertyFileName cannot be null\");\n String currentDir = new File(\"\").getAbsolutePath();\n propertyFile = currentDir + \"/\" + propertyFileName;\n File propFile = new File(propertyFile);\n try {\n propFile.createNewFile();\n } catch (IOException ex) {\n Debugger.logMessage(ex);\n }\n\n props = new Properties();\n try {\n FileInputStream fis = new FileInputStream(propertyFile);\n props.load(fis);\n fis.close();\n } catch (IOException ex) {\n Debugger.logMessage(ex);\n }\n }", "private void loadData() {\n\n \tInputStream inputStream = this.getClass().getResourceAsStream(propertyFilePath);\n \n //Read configuration.properties file\n try {\n //prop.load(new FileInputStream(propertyFilePath));\n \tprop.load(inputStream);\n //prop.load(this.getClass().getClassLoader().getResourceAsStream(\"configuration.properties\"));\n } catch (IOException e) {\n System.out.println(\"Configuration properties file cannot be found\");\n }\n \n //Get properties from configuration.properties\n browser = prop.getProperty(\"browser\");\n testsiteurl = prop.getProperty(\"testsiteurl\");\n defaultUserName = prop.getProperty(\"defaultUserName\");\n defaultPassword = prop.getProperty(\"defaultPassword\");\n }", "protected void fillMapFromProperties(Properties props)\n {\n Enumeration<?> en = props.propertyNames();\n\n while (en.hasMoreElements())\n {\n String propName = (String) en.nextElement();\n\n // ignore map, pattern_map; they are handled separately\n if (!propName.startsWith(\"map\") &&\n !propName.startsWith(\"pattern_map\"))\n {\n String propValue = props.getProperty(propName);\n String fieldDef[] = new String[4];\n fieldDef[0] = propName;\n fieldDef[3] = null;\n if (propValue.startsWith(\"\\\"\"))\n {\n // value is a constant if it starts with a quote\n fieldDef[1] = \"constant\";\n fieldDef[2] = propValue.trim().replaceAll(\"\\\"\", \"\");\n }\n else\n // not a constant\n {\n // split it into two pieces at first comma or space\n String values[] = propValue.split(\"[, ]+\", 2);\n if (values[0].startsWith(\"custom\") || values[0].equals(\"customDeleteRecordIfFieldEmpty\") ||\n values[0].startsWith(\"script\"))\n {\n fieldDef[1] = values[0];\n\n // parse sections of custom value assignment line in\n // _index.properties file\n String lastValues[];\n // get rid of empty parens\n if (values[1].indexOf(\"()\") != -1)\n values[1] = values[1].replace(\"()\", \"\");\n\n // index of first open paren after custom method name\n int parenIx = values[1].indexOf('(');\n\n // index of first unescaped comma after method name\n int commaIx = Utils.getIxUnescapedComma(values[1]);\n\n if (parenIx != -1 && commaIx != -1 && parenIx < commaIx) {\n // remainder should be split after close paren\n // followed by comma (optional spaces in between)\n lastValues = values[1].trim().split(\"\\\\) *,\", 2);\n\n // Reattach the closing parenthesis:\n if (lastValues.length == 2) lastValues[0] += \")\";\n }\n else\n // no parens - split comma preceded by optional spaces\n lastValues = values[1].trim().split(\" *,\", 2);\n\n fieldDef[2] = lastValues[0].trim();\n\n fieldDef[3] = lastValues.length > 1 ? lastValues[1].trim() : null;\n // is this a translation map?\n if (fieldDef[3] != null && fieldDef[3].contains(\"map\"))\n {\n try\n {\n fieldDef[3] = loadTranslationMap(props, fieldDef[3]);\n }\n catch (IllegalArgumentException e)\n {\n logger.error(\"Unable to find file containing specified translation map (\" + fieldDef[3] + \")\");\n throw new IllegalArgumentException(\"Error: Problems reading specified translation map (\" + fieldDef[3] + \")\");\n }\n }\n } // end custom\n else if (values[0].equals(\"xml\") ||\n values[0].equals(\"raw\") ||\n values[0].equals(\"date\") ||\n values[0].equals(\"json\") ||\n values[0].equals(\"json2\") ||\n values[0].equals(\"index_date\") ||\n values[0].equals(\"era\"))\n {\n fieldDef[1] = \"std\";\n fieldDef[2] = values[0];\n fieldDef[3] = values.length > 1 ? values[1].trim() : null;\n // NOTE: assuming no translation map here\n if (fieldDef[2].equals(\"era\") && fieldDef[3] != null)\n {\n try\n {\n fieldDef[3] = loadTranslationMap(props, fieldDef[3]);\n }\n catch (IllegalArgumentException e)\n {\n logger.error(\"Unable to find file containing specified translation map (\" + fieldDef[3] + \")\");\n throw new IllegalArgumentException(\"Error: Problems reading specified translation map (\" + fieldDef[3] + \")\");\n }\n }\n }\n else if (values[0].equalsIgnoreCase(\"FullRecordAsXML\") ||\n values[0].equalsIgnoreCase(\"FullRecordAsMARC\") ||\n values[0].equalsIgnoreCase(\"FullRecordAsJson\") ||\n values[0].equalsIgnoreCase(\"FullRecordAsJson2\") ||\n values[0].equalsIgnoreCase(\"FullRecordAsText\") ||\n values[0].equalsIgnoreCase(\"DateOfPublication\") ||\n values[0].equalsIgnoreCase(\"DateRecordIndexed\"))\n {\n fieldDef[1] = \"std\";\n fieldDef[2] = values[0];\n fieldDef[3] = values.length > 1 ? values[1].trim() : null;\n // NOTE: assuming no translation map here\n }\n else if (values.length == 1)\n {\n fieldDef[1] = \"all\";\n fieldDef[2] = values[0];\n fieldDef[3] = null;\n }\n else\n // other cases of field definitions\n {\n String values2[] = values[1].trim().split(\"[ ]*,[ ]*\", 2);\n fieldDef[1] = \"all\";\n if (values2[0].equals(\"first\") ||\n (values2.length > 1 && values2[1].equals(\"first\")))\n fieldDef[1] = \"first\";\n\n if (values2[0].startsWith(\"join\"))\n fieldDef[1] = values2[0];\n\n if ((values2.length > 1 && values2[1].startsWith(\"join\")))\n fieldDef[1] = values2[1];\n\n if (values2[0].equalsIgnoreCase(\"DeleteRecordIfFieldEmpty\") ||\n (values2.length > 1 && values2[1].equalsIgnoreCase(\"DeleteRecordIfFieldEmpty\")))\n fieldDef[1] = \"DeleteRecordIfFieldEmpty\";\n\n fieldDef[2] = values[0];\n fieldDef[3] = null;\n\n // might we have a translation map?\n if (!values2[0].equals(\"all\") &&\n !values2[0].equals(\"first\") &&\n !values2[0].startsWith(\"join\") &&\n !values2[0].equalsIgnoreCase(\"DeleteRecordIfFieldEmpty\"))\n {\n fieldDef[3] = values2[0].trim();\n if (fieldDef[3] != null)\n {\n try\n {\n fieldDef[3] = loadTranslationMap(props, fieldDef[3]);\n }\n catch (IllegalArgumentException e)\n {\n logger.error(\"Unable to find file containing specified translation map (\" + fieldDef[3] + \")\");\n throw new IllegalArgumentException(\"Error: Problems reading specified translation map (\" + fieldDef[3] + \")\");\n }\n }\n }\n } // other cases of field definitions\n\n } // not a constant\n\n fieldMap.put(propName, fieldDef);\n\n } // if not map or pattern_map\n\n } // while enumerating through property names\n\n // verify that fieldMap is valid\n verifyCustomMethodsAndTransMaps();\n }", "Map<String, String> properties();", "Map<String, String> properties();", "void load() {\n\t\ttry {\n\t\t\tfinal FileInputStream fis = new FileInputStream(propertyFile);\n\t\t\tfinal Properties newProperties = new Properties();\n\t\t\tnewProperties.load(fis);\n\t\t\ttimeLastRead = propertyFile.lastModified();\n\t\t\tproperties = newProperties;\n\t\t\tfis.close();\n\t\t} catch (final Exception e) {\n\t\t\tlogger.info(\"Property file \" + propertyFile + \" \" + e.getMessage());\n\t\t}\n\t}", "@SuppressWarnings(\"IfStatementWithIdenticalBranches\")\n public final String getPropertyFromFile(final String key) {\n final var file = this.getPropertyCatalog();\n String data = \"\";\n File prop = new File(file);\n if (!prop.exists() || prop.length() == 0) {\n data = \"Refuse.Missing property file.\";\n } else {\n try (BufferedReader reader = new BufferedReader(\n new FileReader(file))) {\n String line;\n while ((line = reader.readLine()) != null) {\n if (line.contains(\"=\") && line.contains(key)) {\n if (line.split(\"=\").length >= 2) {\n data = line.split(\"=\")[1];\n break;\n } else {\n data = \"abuse parameter.\";\n break;\n }\n }\n }\n } catch (IOException e) {\n data = \"Refuse.Mistake in-out property file.\";\n }\n }\n return data;\n }", "protected synchronized Hashtable getMappingsFromFile() throws Exception {\n\n \t\n\t\tInputStream path = null;\n\n\t\tpath = getClass().getResourceAsStream(\"../../../config/mappings.txt\");\n\n\t\tSystem.out.println(\"Path is - \" + path);\n\n\t\tBufferedReader reader = new BufferedReader(new InputStreamReader(path));\n/*\t\tStringBuilder sb = new StringBuilder();\n\t\tString line1 = null;\n\t\twhile ((line1 = reader.readLine()) != null) {\n\t\t\tsb.append(line1 + \"\\n\");\n\t\t}\n*/\t\t//System.out.println(\"String is - \" + sb.toString());\n\t\t\n/* \tFile f = new File(\"src/edu/ucsd/crbs/incf/components/services/emage/mappings.txt\");\n System.out.println(\"Mapping - \" + f.getAbsolutePath());\n\n*/ /*if(sb.toString().trim().equals(\"\") || sb.toString() == null ) {\n System.err.println(\"bisel.ReadMappings cannot find mapping file\");\n System.exit(1);\n }*/\n\n Hashtable mappings = new Hashtable(17, new Float(1.25).floatValue());\n\n\n //BufferedReader br = new BufferedReader(new FileReader(f));\n String line = reader.readLine();\n while(line != null) { \n StringTokenizer st = new StringTokenizer(line, \"*\");\n String aba = st.nextToken();\n String emap = st.nextToken();\n mappings.put(aba, emap);\n line = reader.readLine();\n }\n\n reader.close();\n return mappings;\n }", "public static String readPropertyFile(String pathofFile, String Key)\r\n\t\t{\r\n\t\t\tString value = \"\";\r\n\t\t\treturn value;\r\n\t\t}", "public static void main(String[] args) throws IOException {\n File f=new File(\"D:\\\\selenium\\\\filehandlingtest\\\\file\\\\Test.properties\");\n FileInputStream fis=new FileInputStream(f);\n Properties prop=new Properties();\n prop.load(fis);\n System.out.println (prop.getProperty(\"domain\"));\n \n Enumeration e= prop.keys();\n\n while (e.hasMoreElements()){\n \tString key = (String) e.nextElement();\n \tSystem.out.println(key+\"----\"+prop.get(key));\n \t\n }\n\t}", "void loadPropertiesFile()\n\t{\n\t\tlogger.info(\"Fetching the properties files\");\n\t\t\n\t\tconfigProp=new Properties(); \n\t\ttry{\tconfigProp.load(loadFile(\"Config.properties\"));\t\t} \n\t\tcatch (IOException e){\tAssert.assertTrue(\"Cannot initialise the Config properties file, Check if the file is corrupted\", false);\t}\t\t\t\n\t}", "public void readProperties() {\r\n File directory = new File(OptionItems.XML_DEFINITION_PATH);\r\n if (directory.exists()) {\r\n propertyParserXML.readPropertyDefinition(configData.getPropertyList());\r\n propertyParserXML.processPropertyDependency();\r\n }\r\n Log.info(\"info.progress_control.load_property_description\");\r\n }", "void loadProperties(File propertiesFile) throws IOException\n {\n // Load the properties.\n LOGGER.info(\"Loading properties from \\\"{}\\\" file...\", propertiesFile);\n try (InputStreamReader inputStreamReader = new InputStreamReader(new FileInputStream(propertiesFile), \"UTF-8\"))\n {\n properties.load(inputStreamReader);\n }\n\n // Log all properties except for password.\n StringBuilder propertiesStringBuilder = new StringBuilder();\n for (Object key : properties.keySet())\n {\n String propertyName = key.toString();\n propertiesStringBuilder.append(propertyName).append('=')\n .append(HERD_PASSWORD_PROPERTY.equalsIgnoreCase(propertyName) ? \"***\" : properties.getProperty(propertyName)).append('\\n');\n }\n LOGGER.info(\"Successfully loaded properties:%n{}\", propertiesStringBuilder.toString());\n }", "public static void loadProperties(String filename) {\n\n if (filename.equals(\"\")) {\n return;\n }\n propfilename = userhome + FS + filename;\n File f = new File(propfilename);\n if (f.exists()) {\n //loadProperties(propfilename);\n } else {\n propfilename = userhome + FS + \"Properties\" + FS + filename;\n f = new File(propfilename);\n if (f.exists()) {\n //loadProperties(propfilename);\n }\n }\n\n try {\n try (FileInputStream i = new FileInputStream(propfilename)) {\n prop.load(i);\n //prtProperties();\n }\n } catch (FileNotFoundException e) {\n System.out.println(\" ** Properties file not found=\" + propfilename + \" userhome=\" + userhome + \" \" + System.getProperty(\"user.home\"));\n saveProperties();\n } catch (IOException e) {\n System.out.println(\"IOException reading properties file=\" + propfilename);\n System.exit(1);\n }\n }", "public final void loadPropertiesFromFile(final String fileName)\n {\n\n Properties tempProp = PropertyLoader.loadProperties(fileName);\n fProp.putAll(tempProp);\n\n }", "public static Properties file2Properties(File file) {\r\n Properties props = new Properties();\r\n FileInputStream stream = null;\r\n InputStreamReader streamReader = null;\r\n\r\n\r\n try {\r\n stream = new FileInputStream(file);\r\n streamReader = new InputStreamReader(stream, charSet);\r\n props.load(streamReader);\r\n } catch (IOException ex) {\r\n Logger.getLogger(RunProcessor.class.getName()).log(Level.SEVERE, null, ex);\r\n }\r\n\r\n return props;\r\n }", "private void GetRequiredProperties() {\r\n\r\n\r\n\t\t\r\n\t\tProperties prop = new Properties();\r\n\t\t\r\n try {\r\n \r\n File file = new File(fileToRead);\r\n \r\n if (file.exists()) {\r\n logger.info(\"Config file exists\");\r\n } else {\r\n logger.error(\"Exception :: GetRequiredProperties :: Config file not found\");\r\n throw new RuntimeException(\"Exception :: GetRequiredProperties :: Config file not found\");\r\n }\r\n \r\n prop.load(new FileInputStream(file));\r\n\r\n } catch (Exception e) {\r\n\r\n logger.error(\"Exception :: GetRequiredProperties :: \" + e.getMessage(), e);\r\n\r\n throw new RuntimeException(\"Exception :: GetRequiredProperties :: \" + e.getMessage());\r\n }\r\n\r\n\t sifUrl = prop.getProperty(\"MDM_SIF_URL\");\r\n\t orsId = prop.getProperty(\"MDM_ORS_ID\");\r\n\t username = prop.getProperty(\"MDM_USER_NAME\");\r\n\t password = prop.getProperty(\"MDM_PASSWORD\");\r\n\t \r\n\t logger.info(\"SIF URL ::\" + sifUrl);\r\n\t logger.info(\"ORS ID ::\" + orsId );\r\n\t logger.info(\"User Id ::\" + username);\r\n\t logger.info(\"Password ::\" + password);\r\n\t \r\n\t\r\n\t}", "@SuppressWarnings({ \"unchecked\", \"rawtypes\" })\n public static Map<String, String>loadPropertiesAsMap(final String filePath)\n throws FileNotFoundException, IOException {\n final Properties properties = loadProperties(filePath);\n return new HashMap<String, String>((Map) properties);\n }", "private Properties loadProperties(String fileName){\r\n\t\t\r\n\t\tProperties prop = new Properties();\r\n\t\tInputStream input = null;\r\n\r\n\t\ttry {\r\n\r\n\t\t\tinput = new FileInputStream(fileName);\r\n\t\t\tprop.load(input);\r\n\r\n\t\t} catch (IOException ex) {\r\n\t\t\tex.printStackTrace();\r\n\t\t} finally {\r\n\t\t\tif (input != null) {\r\n\t\t\t\ttry {\r\n\t\t\t\t\tinput.close();\r\n\t\t\t\t} catch (IOException e) {\r\n\t\t\t\t\te.printStackTrace();\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn prop;\t \r\n\t}", "private void loadPropertyFile(InputStream stream) throws IOException{\n\t\tproperties = new Properties();\n\t\tproperties.load(stream);\n\t}", "public static Properties getProperties(String filename)\r\n/* 13: */ {\r\n/* 14:26 */ Properties properties = new Properties();\r\n/* 15: */ try\r\n/* 16: */ {\r\n/* 17:29 */ properties.load(new FileInputStream(System.getProperty(\"user.dir\") + \"/properties/\" + filename));\r\n/* 18: */ }\r\n/* 19: */ catch (IOException ex)\r\n/* 20: */ {\r\n/* 21:31 */ logger.error(\"Can't load properties file: \" + filename, ex);\r\n/* 22: */ }\r\n/* 23:33 */ return properties;\r\n/* 24: */ }", "private static String getProperty(String key)\r\n/* 70: */ throws IOException\r\n/* 71: */ {\r\n/* 72: 71 */ log.finest(\"OSHandler.getProperty\");\r\n/* 73: 72 */ File propsFile = getPropertiesFile();\r\n/* 74: 73 */ FileInputStream fis = new FileInputStream(propsFile);\r\n/* 75: 74 */ Properties props = new Properties();\r\n/* 76: 75 */ props.load(fis);\r\n/* 77: 76 */ String value = props.getProperty(key);\r\n/* 78: 77 */ fis.close();\r\n/* 79: 78 */ log.finest(\"Key=\" + key + \" Value=\" + value);\r\n/* 80: 79 */ return value;\r\n/* 81: */ }", "public void loadObjectData(String datafile) {\n\t\tProperties databaseAddData = new Properties();\n\t\ttry {\n\t\t\tdatabaseAddData.load(new FileInputStream(langFile));\n\t\t} catch (Exception e) {}\n\t\t//put values from the properties file into hashmap\n\t\tthis.properties.put(\"PROPERTY\", databaseAddData.getProperty(\"PROPERTY\"));\n\t}", "public static Properties loadProperties(String filePath)\n {\n \tProperties listProperties = new Properties();\n\t\t//System.out.println(filePath);\n\n\t\tFileInputStream file = null;\n\t\ttry \n\t\t{\n\t\t\tfile = new FileInputStream(filePath);\n\t\t\t\n\t\t} \n\t\tcatch (FileNotFoundException e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t\t\n\t\ttry \n\t\t{\n\t\t\t listProperties.load(file);\n\t\t} \n\t\tcatch (IOException e) \n\t\t{\n\t\t\te.printStackTrace();\n\t\t}\n\t\treturn listProperties;\n }", "protected Properties loadData() {\n/* 362 */ Properties mapData = new Properties();\n/* */ try {\n/* 364 */ mapData.load(WorldMapView.class.getResourceAsStream(\"worldmap-small.properties\"));\n/* 365 */ } catch (IOException e) {\n/* 366 */ e.printStackTrace();\n/* */ } \n/* */ \n/* 369 */ return mapData;\n/* */ }", "public static synchronized void refreshProperties(File file) {\n var prop = new Properties();\n FileInputStream input;\n try {\n input = new FileInputStream(file);\n prop.load(input);\n input.close();\n } catch (IOException e) {\n throw new PropertyReadException(e.getMessage(), e);\n }\n\n prop.forEach((key, value) -> checkSystemPropertyAndFillIfNecessary(valueOf(key),\n nonNull(value) ? valueOf(value) : EMPTY));\n arePropertiesRead = true;\n }", "private void getProperties() {\n\t\tProperties menu_properties = new Properties();\n\t\tInputStream input = null;\n\t\ttry {\n\t\t\tinput = new FileInputStream(PROPERTY_FILENAME);\n\t\t\tmenu_properties.load(input);\n\t\t\ttitle = menu_properties.getProperty(TITLE_PROPERTY);\n\t\t\tscreen_width = Integer.parseInt(menu_properties.getProperty(WIDTH_PROPERTY));\n\t\t\tscreen_height = Integer.parseInt(menu_properties.getProperty(HEIGHT_PROPERTY));\n\t\t} catch (IOException ex) {\n\t\t\tSystem.err.println(\"Display file input does not exist!\");\n\t\t} catch (Exception ey) {\n\t\t\tSystem.err.println(\"The properties for the display could not be retrieved completely.\");\n \t} finally {\n \t\tif (input != null) {\n \t\t\ttry {\n \t\t\t\tinput.close();\n \t\t\t} catch (IOException e) {\n \t\t\t\tSystem.err.println(\"Display file input cannot close!\");\n \t\t\t}\n \t\t}\n \t}\n }", "public static void loadPropertyFile() throws IOException {\n\t\tPropertyFileReader.property = new Properties();\n\t\tPropertyFileReader.targetPlatform = System.getProperty(\"targetPlatform\");\n\t\tPropertyFileReader.targetDevice = System.getProperty(\"targetDevice\");\n\n\t\t// Load the property file based on platform and device\n\n\t\tif (PropertyFileReader.targetPlatform.equalsIgnoreCase(\"android\")) {\n\t\t\tfinal File file = new File(String.valueOf(System.getProperty(\"user.dir\"))\n\t\t\t\t\t+ \"\\\\src\\\\main\\\\resources\\\\testdata\\\\\" + PropertyFileReader.targetPlatform + \"\\\\\"\n\t\t\t\t\t+ PropertyFileReader.targetDevice + \"\\\\capabilities.properties\");\n\t\t\tPropertyFileReader.filereader = new FileReader(file);\n\t\t\tPropertyFileReader.property.load(PropertyFileReader.filereader);\n\t\t}\n\n\t\tif (PropertyFileReader.targetPlatform.equalsIgnoreCase(\"iOS\")) {\n\t\t\t// To do in case of iOS\n\t\t}\n\t}", "@Override\r\n\tpublic void setPropFile(Properties prop) {\n\t\t\r\n\t}", "public static Properties readProperties(String filePath){\n try {\n FileInputStream fileInputStream= new FileInputStream(filePath);\n properties=new Properties();\n properties.load(fileInputStream);\n fileInputStream.close();\n\n } catch (FileNotFoundException e) {\n e.printStackTrace();\n } catch (IOException e) {\n e.printStackTrace();\n }\n return properties;\n }", "public ReadConfigFile (){\n\t\ttry {\n\t\t\tinput = ReadConfigFile.class.getClassLoader().getResourceAsStream(Constant.CONFIG_PROPERTIES_DIRECTORY);\n\t\t\tprop = new Properties();\n\t\t\tprop.load(input);\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t}catch ( IOException e ) {\n\t\t\te.printStackTrace();\n\t\t}\n\t\t\t\t\n\t}", "public static void readProperties(String propFilename){\n\t\tString propertiesFilename = propFilename;\n\t\tProperties properties = new Properties();\n\n\t\tFileInputStream in;\n\t\ttry {\n\t\t\tin = new FileInputStream(propertiesFilename);\n\t\t\tproperties.load(in);\n\t\t\tin.close();\n\t\t} catch (Exception e) {\n\t\t\tSystem.out.println(\"Error reading properties \"+propertiesFilename);\n\t\t\tSystem.exit(1);\n\t\t\te.printStackTrace();\n\t\t}\n\n\t\tString path=\"Not set\";\n\t\tint popSize=0;\n\t\tint features=0;\n\t\tint maxGenerations=0;\n\t\tboolean log=false;\n\t\tboolean debug=false;\n\t\tboolean printbest=false;\n\t\tboolean cwd=false;\n\t\tboolean arrcache=false;\n\t\tdouble addSubRangeH;\n\t\tdouble divMultRangeH;\n\t\tdouble randomThicknessRange;\n\t\tdouble randomVelocityRange;\n\n\t\tdouble addSubRangeVS;\n\t\tdouble divMultRangeVS;\n\n\t\tint zThreshold=0;\n\t\tboolean useThreshold = true;\n\n\tif(properties.containsKey(\"path\")){\n\t\tpath = ((String)properties.get(\"path\"));\n\t\tif(properties.containsKey(\"cwd\")){\n\t\t\tcwd = Boolean.parseBoolean((String)properties.get(\"cwd\"));\n\t\t}\n\t\tc.path=path;\n\t\tc.setPaths(cwd);\n\t}else{\n\t\tSystem.out.println(\"Path : \"+path);\n\t\tSystem.exit(1);\n\t}if(properties.containsKey(\"populationSize\")){\n\t\tpopSize = Integer.parseInt((String)properties.get(\"populationSize\"));\n\t\tc.populationSize =popSize;\n\t}if(properties.containsKey(\"printBest\")){\n\t\tprintbest = Boolean.parseBoolean((String)properties.get(\"printBest\"));\n\t\tc.printBest=printbest;\n\t}if(properties.containsKey(\"maxGenerations\")){\n\t\tmaxGenerations = Integer.parseInt((String)properties.get(\"maxGenerations\"));\n\t\tc.maxGenerations=maxGenerations;\n\t}if(properties.containsKey(\"log\")){\n\t\tlog = Boolean.parseBoolean((String)properties.get(\"log\"));\n\t\tc.log=log;\n\t}if(properties.containsKey(\"debug\")){\n\t\tdebug = Boolean.parseBoolean((String)properties.get(\"debug\"));\n\t\tc.debug=debug;\n\t}if(properties.containsKey(\"features\")){\n\t\tfeatures = Integer.parseInt((String)properties.get(\"features\"));\n\t\tc.features=features;\n\t}if(properties.containsKey(\"addSubRangeH\")){\n\t\taddSubRangeH = Double.parseDouble((String)properties.get(\"addSubRangeH\"));\n\t\tc.addSubRangeH=addSubRangeH;\n\t}if(properties.containsKey(\"addSubRangeVS\")){\n\t\taddSubRangeVS = Double.parseDouble((String)properties.get(\"addSubRangeVS\"));\n\t\tc.addSubRangeVS=addSubRangeVS;\n\t}if(properties.containsKey(\"divMultRangeH\")){\n\t\tdivMultRangeH = Double.parseDouble((String)properties.get(\"divMultRangeH\"));\n\t\tc.divMultRangeH=divMultRangeH;\n\t}if(properties.containsKey(\"divMultRangeVS\")){\n\t\tdivMultRangeVS = Double.parseDouble((String)properties.get(\"divMultRangeVS\"));\n\t\tc.divMultRangeVS=divMultRangeVS;\n\t}if(properties.containsKey(\"randomThicknessRange\")){\n\t\trandomThicknessRange = Double.parseDouble((String)properties.get(\"randomThicknessRange\"));\n\t\tc.randomThicknessRange=randomThicknessRange;\n\t}if(properties.containsKey(\"randomVelocityRange\")){\n\t\trandomVelocityRange = Double.parseDouble((String)properties.get(\"randomVelocityRange\"));\n\t\tc.randomVelocityRange=randomVelocityRange;\n\t}if(properties.containsKey(\"zThreshold\")){\n\t\tzThreshold = Integer.parseInt((String)properties.get(\"zThreshold\"));\n\t\tc.zThreshold=zThreshold;\n\t}if(properties.containsKey(\"useThreshold\")){\n\t\tuseThreshold = Boolean.parseBoolean((String)properties.get(\"useThreshold\"));\n\t\tc.useThreshold=useThreshold;\n\t}\n\n\tSystem.out.println(\" Debug? \"+debug + \" | Log? \"+ log + \" | printBest? \"+ printbest);\n\tSystem.out.println(\"Pop: \"+c.populationSize+\" | Max Gens: \"+ maxGenerations+ \"\\nPath: \"+c.path);\n\tSystem.out.println(\"randomThicknessRange :\"+c.randomThicknessRange+\" randomVelocityRange :\"+c.randomVelocityRange);\n\tSystem.out.println(\"AddSubRange H :\"+c.addSubRangeH+\" VS :\"+c.addSubRangeVS);\n\tSystem.out.println(\"divMultRange H :\"+c.divMultRangeH+\" VS :\"+c.divMultRangeVS);\n\tSystem.out.println(\"Threshold ? \"+c.useThreshold+\" : \"+c.zThreshold);\n\t}", "public static void main(String[] args)throws Throwable {\n FileLib flib = new FileLib();\n flib.readPropertyData(\"./data/config.properties\", \"browser\");\n // System.out.println(value); \n\t}", "private void readProperties() throws Exception{\n\t\t InputStream fisGlobal=null,fisModul=null; \n\t\t propiedades = new Properties();\n try {\n \t // Path directorio de configuracion\n \t String pathConf = System.getProperty(\"ad.path.properties\");\n \t \n \t // Propiedades globales\n \t fisGlobal = new FileInputStream(pathConf + \"sistra/global.properties\");\n \t propiedades.load(fisGlobal);\n \t\t \n \t // Propiedades modulo\n \t\t fisModul = new FileInputStream(pathConf + \"sistra/plugins/plugin-firma.properties\");\n \t\t propiedades.load(fisModul);\n \t \t \t\t \n } catch (Exception e) {\n \t propiedades = null;\n throw new Exception(\"Excepcion accediendo a las propiedadades del modulo\", e);\n } finally {\n try{if (fisGlobal != null){fisGlobal.close();}}catch(Exception ex){}\n try{if (fisModul != null){fisModul.close();}}catch(Exception ex){}\n }\t\t\n\t}", "private static Properties readPropertiesFile(String fileName) throws IOException\n {\n LOG.log(Level.FINE, \"Searching for {0} file...\", fileName);\n try (final InputStream stream = SmartProperties.class.getClassLoader().getResourceAsStream(fileName))\n {\n Properties properties = new Properties();\n properties.load(stream);\n LOG.log(Level.FINE, \"{0} loaded successfully\", fileName);\n return properties;\n }\n }", "public String accessLocationPropFile(){\n\t\tProperties prop = new Properties();\n\t\tString loc=\"\";\n\t\ttry {\n\t\t\t//load a properties file\n\t\t\tprop.load(new FileInputStream(\"C:/Users/SARA/Desktop/OpenMRS/de/DeIdentifiedPatientDataExportModule/api/src/main/resources/config1.properties\"));\n\t\t\tInteger a = getRandomBetween(1, 3);\n\t\t\tloc = prop.getProperty(a.toString());\n\n\t\t} catch (IOException ex) {\n\t\t\tlog.error(\"IOException in accessing Location File\", ex);\n\t\t}\n\t\treturn loc;\n\t}", "private void writeProperties() {\n propsMutex.writeAccess(new Runnable() {\n public void run() {\n OutputStream out = null;\n FileLock lock = null;\n try {\n FileObject pFile = file.getPrimaryFile();\n FileObject myFile = FileUtil.findBrother(pFile, extension);\n if (myFile == null) {\n myFile = FileUtil.createData(pFile.getParent(), pFile.getName() + \".\" + extension);\n }\n lock = myFile.lock();\n out = new BufferedOutputStream(myFile.getOutputStream(lock));\n props.store(out, \"\");\n out.flush();\n lastLoaded = myFile.lastModified();\n logger.log(Level.FINE, \"Written AssetData properties for {0}\", file);\n } catch (IOException e) {\n Exceptions.printStackTrace(e);\n } finally {\n if (out != null) {\n try {\n out.close();\n } catch (IOException ex) {\n Exceptions.printStackTrace(ex);\n }\n }\n if (lock != null) {\n lock.releaseLock();\n }\n }\n }\n });\n }", "protected static Properties loadFileAsProperty(File file) throws FileNotFoundException, IOException {\r\n\t\tProperties result = new Properties();\r\n\t\tresult.load(new FileReader(file));\r\n\t\treturn result;\r\n\t}", "public void extractProperties(File file) {\n\t\tFile input = file;\n\t\tBufferedReader stream;\n\t\ttry {\n\t\t\tString line;\n\t\t\tMatcher m_title, m_subtitle, m_spacing;\n\t\t\tStringBuffer extractable = new StringBuffer();\n\t\t\tstream = new BufferedReader(new FileReader(input));\n\t\t\t\n\t\t\t/* Read all comment lines from the input file and concatenate them */\n\t\t\twhile ((line = stream.readLine()) != null) {\n\t\t\t\tline = line.replaceAll(\"\\\\s+$\", \"\");\n\t\t\t\tTabString temp = new TabString(line);\n\t\t\t\tif (!line.isEmpty()) {\n\t\t\t\t\tif (temp.checkError() == TabString.ERROR_COMMENT)\n\t\t\t\t\t\textractable.append(\"%\" + line + \"%\");\n\t\t\t\t\telse\n\t\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t}\n\t\t\t/* Return if nothing was found */\n\t\t\tif (extractable.length() == 0) {\n\t\t\t\tstream.close();\n\t\t\t\treturn;\n\t\t\t}\n\t\t\t\n\t\t\tm_title = TITLE_PATTERN.matcher(extractable.toString());\n\t\t\tm_subtitle = SUBTITLE_PATTERN.matcher(extractable.toString());\n\t\t\tm_spacing = SPACING_PATTERN.matcher(extractable.toString());\n\t\t\t\n\t\t\t/* Set the title to the extracted title */\n\t\t\tif (m_title.find())\n\t\t\t\tthis.setTitle(m_title.group(VALUE_POSITION));\n\t\t\t\n\t\t\t/* Set the subtitle to the extracted subtitle */\n\t\t\tif (m_subtitle.find())\n\t\t\t\tthis.setSubtitle(m_subtitle.group(VALUE_POSITION));\n\t\t\t\n\t\t\t/* Set the spacing to the extracted spacing */\n\t\t\tif (m_spacing.find())\n\t\t\t\tthis.setSpacing(Float.parseFloat(m_spacing.group(VALUE_POSITION)));\n\t\t\t\t\n\t\t\tstream.close();\n\t\t\t\n\t\t} catch (FileNotFoundException e) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\te.printStackTrace();\n\t\t} catch (IOException e) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\te.printStackTrace();\n\t\t}\n\t}", "@SuppressWarnings(\"unchecked\")\r\n\tprivate void readMapFromFile() {\r\n\t\ttry {\r\n\t\t\tType type = new TypeToken<HashMap<String, Country>>() {}.getType();\r\n\t\t\tthis.daoMap = (HashMap<String, Country>) gson.fromJson(new FileReader(path), type);\r\n\t\t} catch (JsonSyntaxException | JsonIOException | FileNotFoundException e) {\r\n\t\t\te.printStackTrace();\r\n\t\t\t\r\n\t\t}\r\n\r\n\t}", "public Properties getProperties();", "static void getProps() throws Exception {\r\n\t\tFileReader fileReader = new FileReader(\"C:\\\\repos\\\\test\\\\src\\\\main\\\\java\\\\test\\\\config.properties\");\r\n\t\tProperties properties = new Properties();\r\n\r\n\t\tproperties.load(fileReader);\r\n\r\n\t\tSystem.out.println(\"By using File Reader: \" + properties.getProperty(\"username\"));\r\n\r\n\t}", "private void read() {\n // Read the properties from the project\n EditableProperties sharedProps = antProjectHelper.getProperties(AntProjectHelper.PROJECT_PROPERTIES_PATH);\n EditableProperties privateProps = antProjectHelper.getProperties(AntProjectHelper.PRIVATE_PROPERTIES_PATH);\n final ProjectConfiguration cfgs[] = configHelper.getConfigurations().toArray(new ProjectConfiguration[0]);\n final ProjectConfiguration confs[] = new ProjectConfiguration[cfgs.length];\n System.arraycopy(cfgs, 0, confs, 0, cfgs.length);\n setConfigurations(confs);\n // Initialize the property map with objects\n properties.put(J2ME_PROJECT_NAME, new PropertyInfo(new PropertyDescriptor(J2ME_PROJECT_NAME, true, DefaultPropertyParsers.STRING_PARSER), ProjectUtils.getInformation(project).getDisplayName()));\n for (PropertyDescriptor pd:PROPERTY_DESCRIPTORS) {\n EditableProperties ep = pd.isShared() ? sharedProps : privateProps;\n String raw = ep.getProperty( pd.getName());\n properties.put( pd.getName(), new PropertyInfo( pd, raw == null ? pd.getDefaultValue() : raw));\n for (int j=0; j<devConfigs.length; j++) {\n final PropertyDescriptor clone = pd.clone(CONFIG_PREFIX + devConfigs[j].getDisplayName() + '.' + pd.getName());\n raw = ep.getProperty(clone.getName());\n if (raw != null) {\n properties.put(clone.getName(), new PropertyInfo(clone, raw));\n }\n }\n }\n }", "public static void loadPropertyFile() {\r\n\t\t\r\n\t\tif (loaded) {\r\n\t\t\tthrow new IllegalStateException(\"Properties have already been loaded!\"); \r\n\t\t}\r\n\t\tloaded = true; \r\n\t\t\r\n\t\t// if property file was specified, use it instead of standard property\r\n\t\t// file\r\n\r\n\t\tString file = STANDARD_PROPERTY_FILE;\r\n\r\n\t\tif (System.getProperty(PROPERTY_WHERE_TO_FIND_PROPERTY_FILE) != null\r\n\t\t\t\t&& System.getProperty(PROPERTY_WHERE_TO_FIND_PROPERTY_FILE)\r\n\t\t\t\t\t\t.length() != 0) {\r\n\t\t\tfile = System.getProperty(PROPERTY_WHERE_TO_FIND_PROPERTY_FILE);\r\n\t\t}\r\n\r\n\t\t// load property file\r\n\t\ttry {\r\n\t\t\tProperties props = System.getProperties();\r\n\t\t\tprops.load(ClassLoader.getSystemResourceAsStream(file));\r\n\t\t\tSystem.setProperties(props);\r\n\t\t} catch (IOException e) {\r\n\t\t\tthrow new RuntimeException(\"Property file was not found: \" + file\r\n\t\t\t\t\t+ \"! It must be located in the CLASSPATH and \"\r\n\t\t\t\t\t+ \"either be named 'chord.properties' or its name \"\r\n\t\t\t\t\t+ \"be specified by -Dchord.properties.file='filename'\", e);\r\n\t\t} catch (NullPointerException e) {\r\n\t\t\tthrow new RuntimeException(\"Property file was not found: \" + file\r\n\t\t\t\t\t+ \"! It must be located in the CLASSPATH and \"\r\n\t\t\t\t\t+ \"either be named 'chord.properties' or its name \"\r\n\t\t\t\t\t+ \"be specified by -Dchord.properties.file='filename'\", e);\r\n\t\t}\r\n\r\n\t}", "private Properties loadPropertiesFile(String file) {\n\t\tFileInputStream fis = null;\n\t\ttry {\n\t\t\tfis = new FileInputStream(file);\n\t\t\tif (fis != null) {\n\t\t\t\tProperties props = new Properties();\n\t\t\t\tprops.load(fis);\n\t\t\t\treturn props;\n\t\t\t}\n\t\t\tSystem.err.println(\"Cannot load \" + file\n\t\t\t\t\t+ \" , file input stream object is null\");\n\t\t} catch (java.io.IOException ioe) {\n\t\t\tSystem.err.println(\"Cannot load \" + file + \", error reading file\");\n\t\t}\n\t\treturn null;\n\t}", "public ArrayList<Pair> getAllProperties(String filePath2, Object keyResource) {\n\t\tModel model = ModelFactory.createDefaultModel();\n\t\tmodel.read(filePath2);\n\n\t\t/*\n\t\t * String queryString =\n\t\t * \"PREFIX : <http://extbi.lab.aau.dk/ontology/business/>\\r\\n\" +\n\t\t * \"PREFIX rdfs: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>\\r\\n\" +\n\t\t * \"PREFIX afn: <http://jena.apache.org/ARQ/function#>\\r\\n\" +\n\t\t * \"SELECT ?v ?extrLabel ?o\\r\\n\" + \"WHERE\\r\\n\" +\n\t\t * \" {\t?v\ta\t:Municipality ;\\r\\n\" + \"\t?p\t?o\\r\\n\" +\n\t\t * \"\tBIND(afn:localname(?p) AS ?extrLabel)\\r\\n\" + \"}\";\n\t\t */\n\n\t\tString queryString = \"SELECT ?p ?o WHERE {?s ?p ?o. \" + \"FILTER regex(str(?s), '\" + keyResource.toString()\n\t\t\t\t+ \"')}\";\n\t\t\n\t\tQuery query = QueryFactory.create(queryString);\n\t\tQueryExecution qe = QueryExecutionFactory.create(query, model);\n\t\tResultSet results = ResultSetFactory.copyResults(qe.execSelect());\n\t\t\n\t\tArrayList<Pair> propertylist = new ArrayList<>();\n\t\t\n\t\twhile (results.hasNext()) {\n\t\t\tQuerySolution querySolution = (QuerySolution) results.next();\n\t\t\t\n\t\t\tRDFNode property = querySolution.get(\"p\");\n\t\t\tRDFNode value = querySolution.get(\"o\");\n\t\t\t\n\t\t\tString propertyString = property.toString();\n\t\t\tpropertyString = new StringBuilder(propertyString).reverse().toString();\n\t\t\t\n\t\t\tString regEx = \"(.*?)/(.*?)$\";\n\t\t\tPattern pattern = Pattern.compile(regEx);\n\t\t\tMatcher matcher = pattern.matcher(propertyString);\n\t\t\t\n\t\t\twhile (matcher.find()) {\n\t\t\t\tpropertyString = matcher.group(1);\n\t\t\t\tpropertyString = new StringBuilder(propertyString).reverse().toString();\n\t\t\t\t\n\t\t\t\tPair pair = new Pair();\n\t\t\t\tpair.setKey(propertyString);\n\t\t\t\tpair.setValue(value);\n\t\t\t\tpropertylist.add(pair);\n\t\t\t}\n\t\t}\n\t\t\n\t\tqe.close();\n\t\t\n\t\treturn propertylist;\n\t}", "private static void readAndWriteProperties(String name) throws IOException {\n System.out.println(name);\n boolean firstLine = true;\n fileReader = new BufferedReader(new FileReader(PATH + name));\n fileWriter = new BufferedWriter(new FileWriter(PATH + \"/uid/\" + name));\n String line;\n while ((line = fileReader.readLine()) != null) {\n if (!firstLine) {\n String[] lineTokens = LINE_TOKEN_SEPARATOR.split(line);\n long globalID = vertexList.get(3).get(Long.parseLong(lineTokens[0]));\n String writeLine = \"\";\n for (int i = 0; i < lineTokens.length; i++) {\n if (i == 0) {\n writeLine += globalID;\n } else {\n writeLine += lineTokens[i];\n }\n writeLine += \"|\";\n }\n fileWriter.write(writeLine);\n fileWriter.newLine();\n } else {\n fileWriter.write(line);\n fileWriter.newLine();\n firstLine = false;\n }\n }\n fileReader.close();\n fileWriter.close();\n }", "public ReadProperties(String filename) {\n\n\t\ttry {\n\t\t\tInputStream in = new FileInputStream(filename);\n\n\t\t\tprop = new Properties();\n\n\t\t\tprop.load(in);\n\n\t\t} catch (Exception e) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\te.printStackTrace();\n\t\t}\n\t}", "Properties getProperties();", "public static Map readingFilesMap(String file) {\n\n Stream<String> lines = null;\n try {\n lines = Files.lines(Paths.get(file));\n } catch (IOException e) {\n e.printStackTrace();\n }\n\n /* lines = lines.filter(line -> line.trim().length() > 0)\n .map(line -> line.substring(line.lastIndexOf(\" \")));\n*/\n Map map = lines.collect(Collectors.toMap(\n line -> line.substring(line.lastIndexOf(\" \")),\n line -> line.substring(0, line.lastIndexOf(\" \"))\n ));//.forEach(System.out::print);\n //lines.forEach(Collections.list());\n\n map.forEach((k, v) -> {\n System.out.println(\"key:\"+k+ \" Value=\"+v);\n } );\n return map;\n\n //set.forEach(System.out::print);\n\n\n }", "private void loadProperties() {\n Path path = getSamplePropertiesPath();\n LOG.info(\"Loading Properties from {}\", path.toString());\n try {\n FileInputStream fis = new FileInputStream(getSamplePropertiesPath().toFile());\n Properties properties = new Properties();\n properties.load(fis);\n\n String privateKey = properties.getProperty(PRIVATE_KEY);\n this.credentials = Credentials.create(privateKey);\n this.contract1Address = properties.getProperty(CONTRACT1_ADDRESS);\n this.contract2Address = properties.getProperty(CONTRACT2_ADDRESS);\n this.contract3Address = properties.getProperty(CONTRACT3_ADDRESS);\n this.contract4Address = properties.getProperty(CONTRACT4_ADDRESS);\n this.contract5Address = properties.getProperty(CONTRACT5_ADDRESS);\n this.contract6Address = properties.getProperty(CONTRACT6_ADDRESS);\n\n } catch (IOException ioEx) {\n // By the time we have reached the loadProperties method, we should be sure the file\n // exists. As such, just throw an exception to stop.\n throw new RuntimeException(ioEx);\n }\n }", "private static Map<String, String> readPropertiesIntoMap(Properties properties) {\n Map<String, String> dataFromProperties = new HashMap<>();\n\n for (Map.Entry<Object, Object> pair : properties.entrySet()) {\n String key = (String) pair.getKey();\n String value = (String) pair.getValue();\n\n dataFromProperties.put(key, value);\n }\n return dataFromProperties;\n }", "private static Properties readProps() {\n Path[] candidatePaths = {\n Paths.get(System.getProperty(\"user.home\"), \".sourcegraph-jetbrains.properties\"),\n Paths.get(System.getProperty(\"user.home\"), \"sourcegraph-jetbrains.properties\"),\n };\n\n for (Path path : candidatePaths) {\n try {\n return readPropsFile(path.toFile());\n } catch (IOException e) {\n // no-op\n }\n }\n // No files found/readable\n return new Properties();\n }", "String getPropertyValue(String filename, String lang, String key);", "public File getPropertiesFile() {\n return propertiesFile;\n }", "@Override\n\tpublic void load(Reader reader)\n\t{\n\t\tString os = System.getProperty(\"os.name\", \"?\").toLowerCase();\n\t\tif (os.startsWith(\"linux\"))\n\t\t\tos = \"linux\";\n\t\telse if (os.startsWith(\"windows\"))\n\t\t\tos = \"windows\";\n\t\telse if (os.startsWith(\"sun\"))\n\t\t\tos = \"sun\";\n\t\telse if (os.startsWith(\"mac\"))\n\t\t\tos = \"mac\";\n\t\t\n\t\t\n\t\tString line, key, value;\n\t\tint i,j;\n\t\tScanner input = new Scanner(reader);\n\t\twhile (input.hasNext())\n\t\t{\n\t\t\tline = getNextLine(input);\n\t\t\tif (line.length() > 0)\n\t\t\t{\n\t\t\t\twhile (line.endsWith(\" \\\\\") || line.endsWith(\"\\t\\\\\"))\n\t\t\t\t\tline = line.substring(0, line.length()-1) + getNextLine(input);\n\t\t\t\t\n\t\t\t\t// find index of the first occurrence of either '=' or ':'\n\t\t\t\ti=line.indexOf('=');\n\t\t\t\tj=line.indexOf(':');\n\t\t\t\tif (j >= 0 && j < i)\n\t\t\t\t\ti = j;\n\t\t\t\t\n\t\t\t\t// split line into key and value substrings.\n\t\t\t\t// Note: key must have at least one character.\n\t\t\t\tif (i > 0)\n\t\t\t\t{\n\t\t\t\t\tkey = line.substring(0, i).trim();\n\t\t\t\t\t\n\t\t\t\t\tboolean skip = false;\n\t\t\t\t\tfor (String op : new String[] {\"linux\", \"windows\", \"sun\", \"mac\"})\n\t\t\t\t\t{\n\t\t\t\t\t\tif (key.startsWith(\"<\"+op+\">\"))\n\t\t\t\t\t\t{ \n\t\t\t\t\t\t\tif (os.equals(op))\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tkey = key.substring((\"<\"+op+\">\").length()).trim();\n\t\t\t\t\t\t\t\tskip = false;\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\telse \n\t\t\t\t\t\t\t\tskip = true;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tif (skip)\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\tvalue = line.substring(i+1).trim();\n\t\t\t\t\n\t\t\t\t\t// The following two if statements provide backward compatibility for old GMP property files\n\t\t\t\t\t// that added double '\\' characters in file names and directory names. As soon as all of \n\t\t\t\t\t// our property files no longer contain double backslash characters, we should get rid of this.\n\t\t\t\t\t// if value starts with 4 backslash characters, eg., \\\\\\\\fig2\\\\GMPSys\\\\filename\n\t\t\t\t\t// then replace all double backslashes with single backslashes, eg., \\\\fig2\\GMPSys\\filename\n\t\t\t\t\tif (value.startsWith(\"\\\\\\\\\\\\\\\\\"))\n\t\t\t\t\t{\n\t\t\t\t\t\ti=value.indexOf(\"\\\\\\\\\");\n\t\t\t\t\t\twhile (i >= 0)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tvalue = value.substring(0,i)+value.substring(i+1);\n\t\t\t\t\t\t\ti=value.indexOf(\"\\\\\\\\\");\n\t\t\t\t\t\t}\n\t\t\t\t\t\tvalue = \"\\\\\"+value;\n\t\t\t\t\t}\n\n\t\t\t\t\t// if value starts with a character followed by \":\\\\\", eg., c:\\\\GMPSys\\\\filename\n\t\t\t\t\t// then replace all double backslashes with single backslashes, eg., c:\\GMPSys\\filename\n\t\t\t\t\tif (value.length() >= 4 && value.charAt(1)==':' && value.charAt(2) == '\\\\' && value.charAt(3) == '\\\\')\n\t\t\t\t\t{\n\t\t\t\t\t\ti=value.indexOf(\"\\\\\\\\\");\n\t\t\t\t\t\twhile (i >= 0)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tvalue = value.substring(0,i)+value.substring(i+1);\n\t\t\t\t\t\t\ti=value.indexOf(\"\\\\\\\\\");\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\tsetProperty(key, value);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\tif (getProperty(\"includePropertyFile\") != null)\n\t\t{\n\t\t\ttry\n\t\t\t{\n\t\t\t\tFile includeFile = getFile(\"includePropertyFile\");\n\t\t\t\tremove(\"includePropertyFile\");\n\t\t\t\tload(new FileReader(includeFile));\n\t\t\t} \n\t\t\tcatch (PropertiesPlusException e)\n\t\t\t{\n\t\t\t\te.printStackTrace();\n\t\t\t\tSystem.exit(1);\n\t\t\t} \n\t\t\tcatch (FileNotFoundException e)\n\t\t\t{\n\t\t\t\te.printStackTrace();\n\t\t\t\tSystem.exit(1);\n\t\t\t}\n\t\t}\n\t}", "private Properties loadProperties(String propertyFile) {\n\t\toAuthProperties = new Properties();\n\t\ttry {\n\t\t\toAuthProperties.load(App.class.getResourceAsStream(propertyFile));\n\t\t} catch (IOException e) {\n\t\t\tSystem.err.println(\"Unable to read \" + propertyFile\n\t\t\t\t\t+ \" configuration. Make sure you have a properly formatted \" + propertyFile + \" file.\");\n\t\t\treturn null;\n\t\t}\n\t\treturn oAuthProperties;\n\t}", "public static void main(String[] args) throws IOException {\n\n String path = System.getProperty(\"user.dir\")+\"\\\\Files\\\\Config2.properties\";\n FileInputStream fileInputStream=new FileInputStream(path);\n Properties properties=new Properties();\n properties.load(fileInputStream);\n System.out.println(properties.get(\"browser\"));\n System.out.println(properties.get(\"url\"));\n System.out.println(properties.get(\"username\"));\n System.out.println(properties.get(\"password\"));\n //fileInputStream.close();\n FileOutputStream fileOutputStream=new FileOutputStream(path);\n Properties properties1=new Properties();\n properties.store(fileOutputStream,\"Masoud\");\n\n\n\n\n }", "public void testReadCustomPropertiesFromFiles() throws Throwable\n {\n final AllDataFilesTester.TestTask task = new AllDataFilesTester.TestTask()\n {\n public void runTest(final File file) throws FileNotFoundException,\n IOException, NoPropertySetStreamException,\n MarkUnsupportedException,\n UnexpectedPropertySetTypeException\n {\n /* Read a test document <em>doc</em> into a POI filesystem. */\n final POIFSFileSystem poifs = new POIFSFileSystem(new FileInputStream(file));\n final DirectoryEntry dir = poifs.getRoot();\n DocumentEntry dsiEntry = null;\n try\n {\n dsiEntry = (DocumentEntry) dir.getEntry(DocumentSummaryInformation.DEFAULT_STREAM_NAME);\n }\n catch (FileNotFoundException ex)\n {\n /*\n * A missing document summary information stream is not an error\n * and therefore silently ignored here.\n */\n }\n\n /*\n * If there is a document summry information stream, read it from\n * the POI filesystem, else create a new one.\n */\n DocumentSummaryInformation dsi;\n if (dsiEntry != null)\n {\n final DocumentInputStream dis = new DocumentInputStream(dsiEntry);\n final PropertySet ps = new PropertySet(dis);\n dsi = new DocumentSummaryInformation(ps);\n }\n else\n dsi = PropertySetFactory.newDocumentSummaryInformation();\n final CustomProperties cps = dsi.getCustomProperties();\n \n if (cps == null)\n /* The document does not have custom properties. */\n return;\n\n for (final Iterator i = cps.entrySet().iterator(); i.hasNext();)\n {\n final Map.Entry e = (Entry) i.next();\n final CustomProperty cp = (CustomProperty) e.getValue();\n cp.getName();\n cp.getValue();\n }\n }\n };\n\n final String dataDirName = System.getProperty(\"HPSF.testdata.path\");\n final File dataDir = new File(dataDirName);\n final File[] docs = dataDir.listFiles(new FileFilter()\n {\n public boolean accept(final File file)\n {\n return file.isFile() && file.getName().startsWith(\"Test\");\n }\n });\n\n for (int i = 0; i < docs.length; i++)\n {\n task.runTest(docs[i]);\n }\n }", "Map<String, Object> properties();", "public void load(Map<String, String> props) {\n if (props != null && props.size() > 0) {\n for (String key : props.keySet()) {\n if (isSupported(key)) {\n String suffix = getSuffix(key);\n String value = props.get(key);\n loadProperty(suffix, value);\n }\n }\n }\n }", "static void getProp() throws Exception {\r\n\r\n\t\tFileInputStream fileInputStream = new FileInputStream(\r\n\t\t\t\t\"C:\\\\repos\\\\test\\\\src\\\\main\\\\java\\\\test\\\\config.properties\");\r\n\r\n\t\tProperties properties = new Properties();\r\n\t\tproperties.load(fileInputStream);\r\n\r\n\t\tSystem.out.println(\"By using File Input stream class: \" + properties.getProperty(\"username\"));\r\n\r\n\t}", "PropertiesTask setProperties( File propertiesFile );", "private void loadProperties() {\n\t\tInputStream propsFile;\n\t\tProperties tempProp = new Properties();\n\n\t\ttry {\n\t\t\t//propsFile = new FileInputStream(\"plugins\\\\balloonplugin\\\\BalloonSegmentation.properties\");\n\t\t\tpropsFile = getClass().getResourceAsStream(\"/BalloonSegmentation.properties\");\n\t\t\ttempProp.load(propsFile);\n\t\t\tpropsFile.close();\n\n\t\t\t// load properties\n\t\t\tinit_channel = Integer.parseInt(tempProp.getProperty(\"init_channel\"));\t\t\t\t// initial channel selected for segmenting the cell architecture 1 - red, 2 - green, 3 - blue\n\t\t\tinit_max_pixel = Integer.parseInt(tempProp.getProperty(\"init_max_pixel\"));\t\t\t// initial max pixel intensity used for finding the doundaries of the colony of cells\n\t\t\tinit_HL = Integer.parseInt(tempProp.getProperty(\"init_HL\"));\t\t\t\t\t\t// initial H*L factor used finding seeds in the population\n\t\t\tinit_min_I = Integer.parseInt(tempProp.getProperty(\"init_min_I\"));\t\t\t\t\t// initial pixel intensity when balloon algorithm starts\n\t\t\tinit_max_I = Integer.parseInt(tempProp.getProperty(\"init_max_I\"));\t\t\t\t\t// final pixel intensity when balloon algorithm stops\n\n\t\t}\n\t\tcatch (IOException ioe) {\n\t\t\tIJ.error(\"I/O Exception: cannot read .properties file\");\n\t\t}\n\t}", "protected void loadKeys() {\n\t\tArrayList<String> lines = ContentLoader.getAllLinesOptList(this.keyfile);\n\t\tfor (String line : lines) {\n\t\t\tString[] parts = line.split(\"=\");\n\t\t\ttry {\n\t\t\t\tint fileID = Integer.parseInt(parts[0].trim());\n\t\t\t\tString restLine = parts[1].trim();\n\t\t\t\tString ccMethodName = restLine;\n\t\t\t\tif (restLine.indexOf('/') > 0) {\n\t\t\t\t\tint leftHashIndex = restLine.indexOf('/');\n\t\t\t\t\tccMethodName = restLine.substring(0, leftHashIndex).trim();\n\t\t\t\t}\n\t\t\t\t// String key = parts[0] + \".java\";\n\t\t\t\tkeyMap.put(fileID, ccMethodName);\n\t\t\t} catch (Exception exc) {\n\t\t\t\tSystem.err.println(line);\n\t\t\t}\n\t\t}\n\t}", "public Iterator<String> getUserDefinedProperties();", "public static boolean readFromFile()\n\t{\n\t\ttry (BufferedReader bufferedReader = new BufferedReader(new FileReader(SAVE_LOCATION)))\n\t\t{\n\t\t\t// Stores the value of the current line in the file\n\t\t\tString currentLine = null;\n\t\t\t\n\t\t\t// Stores the alias and value separated by the \":\"\n\t\t\tString[] lineSplit;\n\t\t\t\n\t\t\t// Stores the alias and value from the line into their own variable\n\t\t\tString alias, value;\n\t\t\t\n\t\t\twhile ((currentLine = bufferedReader.readLine()) != null)\n\t\t\t{\n\t\t\t\t// Ignore the line if it starts with a comment\n\t\t\t\tif (currentLine.startsWith(COMMENT)) continue;\n\t\t\t\t\n\t\t\t\t// Gets the alias and value from either side of the \":\"\n\t\t\t\tlineSplit = currentLine.split(\":\");\n\t\t\t\t\n\t\t\t\t// Ignore if line is incorrectly formatted\n\t\t\t\tif (lineSplit.length == 0) continue;\n\t\t\t\t\n\t\t\t\t// Gets the alias and value of the line to store in the property\n\t\t\t\t// Removes any unnecessary trailing spaces and converts to lower case\n\t\t\t\talias = lineSplit[0].trim().toLowerCase();\n\t\t\t\tvalue = lineSplit[1].trim().toLowerCase();\n\t\t\t\t\n\t\t\t\t// Gets the current property object\n\t\t\t\t// Associated from the alias found on the current line\n\t\t\t\tProperty property = CustomCrosshairMod.INSTANCE.getCrosshair().properties.get(alias);\n\t\t\t\t\n\t\t\t\t// Checks whether there is a property with the current alias\n\t\t\t\tif (property != null)\n\t\t\t\t{\n\t\t\t\t\t// Updates the property value with the new value from the config file\n\t\t\t\t\tCustomCrosshairMod.INSTANCE.getCrosshair().properties.set(alias, property.setValue(value));\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\treturn true;\n\t\t}\n\t\tcatch (Exception e)\n\t\t{\n\t\t\treturn false;\n\t\t}\n\t}" ]
[ "0.7476791", "0.7301177", "0.67913854", "0.6789095", "0.6730097", "0.6692692", "0.6629852", "0.6611769", "0.65903527", "0.6540004", "0.65357023", "0.6500552", "0.643584", "0.6434237", "0.63981193", "0.63562244", "0.63448566", "0.63410044", "0.63219285", "0.6321135", "0.63180596", "0.6290084", "0.6287994", "0.6265296", "0.62564045", "0.62529606", "0.6250294", "0.62404305", "0.6229679", "0.6202815", "0.6191262", "0.6191262", "0.61851466", "0.61835814", "0.6163903", "0.6161622", "0.6151367", "0.6151367", "0.6149631", "0.6145676", "0.6128093", "0.61179686", "0.61138844", "0.61120135", "0.6101355", "0.6076409", "0.60680723", "0.60550886", "0.6042195", "0.6040721", "0.6014405", "0.6011363", "0.6010822", "0.6007311", "0.60041285", "0.59972775", "0.5990156", "0.596313", "0.59516925", "0.59461075", "0.5939399", "0.59392774", "0.5935336", "0.5933138", "0.5929008", "0.5928059", "0.5917307", "0.5912263", "0.5907556", "0.5907134", "0.59031105", "0.5900194", "0.5893456", "0.58900315", "0.5885567", "0.5885207", "0.58815527", "0.58733124", "0.5872752", "0.58480763", "0.5836639", "0.58341146", "0.58315545", "0.583118", "0.58232343", "0.5820567", "0.58168334", "0.5815456", "0.5809923", "0.57975495", "0.57965374", "0.57918024", "0.5791565", "0.5791262", "0.5781021", "0.57793367", "0.57709163", "0.576825", "0.5760106", "0.57492983" ]
0.7230381
2
method to a particular property from a property file
public String readProperty(String property, String sFilePath) throws Exception { try { return readPropertyFile(sFilePath).get(property); } catch (Exception e) { throw new Exception("readProperty : " + e.toString()); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "String getProperty(String property);", "String getProperty();", "String getProperty();", "String getProperty();", "java.lang.String getProperty();", "Property getProperty();", "Property getProperty();", "public abstract String getPropertyFile();", "public String getProperty();", "@Override\r\n\tpublic void setPropFile(Properties prop) {\n\t\t\r\n\t}", "String getPropertyValue(String filename, String lang, String key);", "String getProperty(String name);", "String getProperty(String key);", "String getProperty(String key);", "String getProperty(String key);", "protected abstract void loadProperty(String key, String value);", "public File getPropertyFile() { return propertyFile; }", "public void setProperty(String property) {\n }", "Object getProperty(String key);", "public String getProperty(String name);", "String fetchProperty(String property)\n\t{\n\t\tif(configProp==null)\n\t\t\tloadPropertiesFile();\n\t\t\n\t\treturn(configProp.getProperty(property));\n\t}", "Object getPropertytrue();", "Object getProperty(String name);", "@SuppressWarnings(\"IfStatementWithIdenticalBranches\")\n public final String getPropertyFromFile(final String key) {\n final var file = this.getPropertyCatalog();\n String data = \"\";\n File prop = new File(file);\n if (!prop.exists() || prop.length() == 0) {\n data = \"Refuse.Missing property file.\";\n } else {\n try (BufferedReader reader = new BufferedReader(\n new FileReader(file))) {\n String line;\n while ((line = reader.readLine()) != null) {\n if (line.contains(\"=\") && line.contains(key)) {\n if (line.split(\"=\").length >= 2) {\n data = line.split(\"=\")[1];\n break;\n } else {\n data = \"abuse parameter.\";\n break;\n }\n }\n }\n } catch (IOException e) {\n data = \"Refuse.Mistake in-out property file.\";\n }\n }\n return data;\n }", "void setPropertiesFile(File file);", "int getProperty1();", "int getProperty2();", "PropertiesTask setProperty( String key, String value );", "public String accessLocationPropFile(){\n\t\tProperties prop = new Properties();\n\t\tString loc=\"\";\n\t\ttry {\n\t\t\t//load a properties file\n\t\t\tprop.load(new FileInputStream(\"C:/Users/SARA/Desktop/OpenMRS/de/DeIdentifiedPatientDataExportModule/api/src/main/resources/config1.properties\"));\n\t\t\tInteger a = getRandomBetween(1, 3);\n\t\t\tloc = prop.getProperty(a.toString());\n\n\t\t} catch (IOException ex) {\n\t\t\tlog.error(\"IOException in accessing Location File\", ex);\n\t\t}\n\t\treturn loc;\n\t}", "public String getPropertyPath();", "public String getPropertyPath();", "Property findProperty(String propertyName);", "@Override\n public Object getProperty(String name) {\n name = name.toLowerCase();\n return this.properties.get(name);\n }", "Object getProperty(String requestedProperty) {\n return properties.getProperty(requestedProperty);\n }", "public abstract boolean getProperty(String propertyName);", "private void getPropValues() {\n Properties prop = new Properties();\n \n InputStream inputStream = getClass().getClassLoader().getResourceAsStream(propFileName);\n try {\n prop.load(inputStream);\n } catch (IOException ex) {\n Logger.getLogger(PropResources.class.getName()).log(Level.SEVERE, null, ex);\n }\n if (inputStream == null) {\n try {\n throw new FileNotFoundException(\"ERROR: property file '\" + propFileName + \"' not found in the classpath\");\n } catch (FileNotFoundException ex) {\n Logger.getLogger(PropResources.class.getName()).log(Level.SEVERE, null, ex);\n }\n }\n // get property values\n this.defaultDirectory = prop.getProperty(\"defaultDirectory\");\n this.topicsFile = this.defaultDirectory + prop.getProperty(\"topics\");\n this.scripturesFile = this.defaultDirectory + prop.getProperty(\"scriptures\");\n this.defaultJournalXML = this.defaultDirectory + prop.getProperty(\"defaultJournalXML\");\n this.defaultJournalTxt = this.defaultDirectory + prop.getProperty(\"defaultJournalTxt\");\n }", "@Override\r\n\tpublic void setProperty(Properties prop) {\n\t}", "public abstract String metadata(String property);", "@Test\r\n\t\tpublic static void Properties() \r\n\r\n\t\t{\r\n\t\t\ttry{\r\n\t\t\t\tprop = new Properties();\r\n\t\t\t\tfile = new File(\"C:\\\\Users\\\\vardhan\\\\eclipse-workspace\\\\com.makemytrip\\\\prop.properties\");\r\n\t\t\t\tfilereader = new FileReader(file);\r\n\t\t\t\tprop.load(filereader);\r\n\t\t\t\t\r\n\t\t\t }\r\n\t\t\r\n\t\t\r\n\t\t\tcatch(Exception e)\r\n\t\t\t{\r\n\t\t\t\tSystem.out.println(e.getMessage());\r\n\t\t\t\r\n\t\t\t}\r\n\t\t}", "void setKarafPropertiesFileLocation(String propFile);", "private String getValueFromProperty(String key) {\n\t\treturn properties.getProperty(key);\n\n\t}", "public static String getPropertyFromFile(String propName)throws ISException{\n InputStream inputStream;\n Properties prop = new Properties();\n try {\n inputStream = new FileInputStream(new File(System.getenv(\"conf.home\")+\"\\\\application.properties\"));\n prop.load(inputStream);\n if(prop==null){\n throw new ISException(\"getProperty: Cannot open property file!\");\n }\n return prop.getProperty(propName);\n } catch(Exception e){\n throw new ISException(\"getProperty: Cannot open property file!\");\n }\n }", "public String getProperty(String propertyName) throws CoreException;", "int getProperty0();", "@Before(order=0)\n\tpublic void getProperty() {\n\t\tconfigReader = new ConfigReaders();\n\t\tprop = configReader.init_prop();\n\t\t\n\t}", "public Object getProperty (String index) ;", "@Override\n\tpublic String getProperty(String property)\n\t{\n\t\tString value = super.getProperty(property.trim());\n\t\tif (value == null)\n\t\t\treturn null;\n\t\t\n\t\taddRequestedProperty(property, value);\n\t\t\t\t\n\t\tint i1 = value.indexOf(\"<property:\");\n\t\twhile (i1 >= 0)\n\t\t{\n\t\t\tint i2 = value.substring(i1).indexOf(\">\")+i1;\n\t\t\tif (i2 < 0)\n\t\t\t\ti2 = value.length();\n\t\t\t\n\t\t\tif (i2 > i1+10)\n\t\t\t{\n\t\t\t\tString p = value.substring(i1+10, i2);\n\t\t\t\tif (super.containsKey(p))\n\t\t\t\t{\n\t\t\t\t\tString v = super.getProperty(p);\n\t\t\t\t\tvalue = value.substring(0,i1)+v+value.substring(i2+1);\n\t\t\t\t} \n\t\t\t\telse\n\t\t\t\t\treturn \"ERROR: Property \"+p+\" is not specified in the properties file\";\n\t\t\t}\n\t\t\ti1 = value.indexOf(\"<property:\");\n\t\t}\n\n\t\ti1 = value.indexOf(\"<env:\");\n\t\twhile (i1 >= 0)\n\t\t{\n\t\t\tint i2 = value.indexOf(\">\");\n\t\t\tif (i2 > i1+5)\n\t\t\t{\n\t\t\t\tString p = value.substring(i1+5, i2);\n\t\t\t\tString v = System.getenv(p);\n\t\t\t\tif (v != null)\n\t\t\t\t\tvalue = value.substring(0,i1)+v+value.substring(i2+1);\n\t\t\t\telse\n\t\t\t\t\treturn \"ERROR: Property \"+p+\" is not specified in the user's environment\";\n\t\t\t}\n\t\t\ti1 = value.indexOf(\"<env:\");\n\t\t}\n\n\t\treturn value.trim();\n\t}", "public HashMap<String, String> readPropertyFile(String propertyFilePath) throws Exception {\n File propertyFile = null;\n InputStream inputStream = null;\n Properties properties = null;\n HashMap<String, String> propertyMap = new HashMap<String, String>();\n try {\n\n //creating file object\n propertyFile = new File(propertyFilePath);\n\n //check if property file exists on hard drive\n if (propertyFile.exists()) {\n inputStream = new FileInputStream(propertyFile);\n // check if the file exists in web environment or relative to class path\n } else {\n inputStream = getClass().getClassLoader().getResourceAsStream(propertyFilePath);\n }\n\n if (inputStream == null) {\n throw new Exception(\"FILE NOT FOUND : inputStream = null : \" + propertyFilePath);\n }\n\n properties = new Properties();\n properties.load(inputStream);\n Enumeration enuKeys = properties.keys();\n while (enuKeys.hasMoreElements()) {\n\n String key = (String) enuKeys.nextElement();\n String value = properties.getProperty(key);\n\n //System.out.print(\"key = \"+key + \" : value = \"+value);\n propertyMap.put(key, value);\n }\n if (propertyMap == null) {\n throw new Exception(\"readPropertyFile : propertyMap = null\");\n }\n\n return propertyMap;\n } catch (Exception e) {\n throw new Exception(\"readPropertyFile : \" + e.toString());\n } finally {\n try {\n inputStream.close();\n } catch (Exception e) {\n }\n try {\n properties = null;\n } catch (Exception e) {\n }\n }\n }", "File getPropertiesFile();", "@Override\n public Map<String, String> readProperty(String fileName) {\n Map<String, String> result = new HashMap<>();\n Properties prop = new Properties();\n InputStream input;\n try {\n input = FullPropertyReader.class.getClassLoader().getResourceAsStream(fileName);\n prop.load(input);\n Set<String> strings = prop.stringPropertyNames();\n for (String string : strings) {\n result.put(string, prop.getProperty(string));\n }\n } catch (IOException e) {\n throw new PropertyReaderException(\"Trouble in FullPropertyReader\", e);\n }\n return result;\n }", "public Map<String, String> fetchPropertyFromFile()\n {\n Map<String, String> components = new HashMap<>();\n Properties props = new Properties();\n InputStream in = null;\n try {\n in = new FileInputStream(\"/slog/properties/LogAnalyzer.properties\");\n props.load(in);\n in.close();\n } catch (FileNotFoundException e) {\n e.printStackTrace();\n }\n\n catch (IOException e) {\n e.printStackTrace();\n }\n// Add component config , logname RegEx pattern to a Map. This map will be used to search matching files and forming logstash command\n for (String key : props .stringPropertyNames())\n {\n System.out.println(key + \" = \" + props .getProperty(key));\n components.put (key, props.getProperty(key));\n }\n\n return components;\n }", "public String prop(String name);", "void readProperties(java.util.Properties p) {\n }", "PropertiesTask setProperties( File propertiesFile );", "public void setPropertyFileName(String propertyfileName)\r\n\t{\r\n\t\t// propertyfileName = propertyFileName;\r\n\t\tpropertyFileName = propertyfileName;\r\n\t}", "public static void loadPropertyFile() {\r\n\t\t\r\n\t\tif (loaded) {\r\n\t\t\tthrow new IllegalStateException(\"Properties have already been loaded!\"); \r\n\t\t}\r\n\t\tloaded = true; \r\n\t\t\r\n\t\t// if property file was specified, use it instead of standard property\r\n\t\t// file\r\n\r\n\t\tString file = STANDARD_PROPERTY_FILE;\r\n\r\n\t\tif (System.getProperty(PROPERTY_WHERE_TO_FIND_PROPERTY_FILE) != null\r\n\t\t\t\t&& System.getProperty(PROPERTY_WHERE_TO_FIND_PROPERTY_FILE)\r\n\t\t\t\t\t\t.length() != 0) {\r\n\t\t\tfile = System.getProperty(PROPERTY_WHERE_TO_FIND_PROPERTY_FILE);\r\n\t\t}\r\n\r\n\t\t// load property file\r\n\t\ttry {\r\n\t\t\tProperties props = System.getProperties();\r\n\t\t\tprops.load(ClassLoader.getSystemResourceAsStream(file));\r\n\t\t\tSystem.setProperties(props);\r\n\t\t} catch (IOException e) {\r\n\t\t\tthrow new RuntimeException(\"Property file was not found: \" + file\r\n\t\t\t\t\t+ \"! It must be located in the CLASSPATH and \"\r\n\t\t\t\t\t+ \"either be named 'chord.properties' or its name \"\r\n\t\t\t\t\t+ \"be specified by -Dchord.properties.file='filename'\", e);\r\n\t\t} catch (NullPointerException e) {\r\n\t\t\tthrow new RuntimeException(\"Property file was not found: \" + file\r\n\t\t\t\t\t+ \"! It must be located in the CLASSPATH and \"\r\n\t\t\t\t\t+ \"either be named 'chord.properties' or its name \"\r\n\t\t\t\t\t+ \"be specified by -Dchord.properties.file='filename'\", e);\r\n\t\t}\r\n\r\n\t}", "protected String getProperty(String prop) {\n\t\tLogManager mgr = LogManager.getLogManager();\n\t\tif (name.length() > 0) {\n\t\t\tString key = String.format(\"%s(\\\"%s\\\").%s\", getClass().getName(), name, prop);\t\t\t\n\t\t\tString val = mgr.getProperty(key);\n\t\t\tif (val != null)\n\t\t\t\treturn val;\t\t\t\n\t\t}\t\t\n\t\treturn mgr.getProperty(getClass().getName() + \".\" + prop);\t\t\t\n\t}", "public abstract String GetProperty(Slice property);", "private String getProperty(\n String name\n ) {\n return properties.getProperty(\n String.format(\"%s%s\", propertiesPrefix, name)\n );\n }", "public static String getPropertyValue(String key){\n return properties.getProperty(key);\n }", "@Override\r\n\tpublic String getProperty(String key) {\r\n\t\t\r\n\t\treturn Settings.getProperty(key);\r\n\t\t\r\n\t}", "public static String getProperty(String propertyName){\r\n String val = userProps.getProperty(propertyName);\r\n\r\n if (val == null)\r\n return jinProps.getProperty(propertyName);\r\n else\r\n return val;\r\n }", "public static void main(String... args) {\n // lookup a file sspecified in the properties file\n String propertyName = \"PPI_INTACT_FILE\";\n String filePath = FrameworkPropertyService.INSTANCE.getStringProperty(propertyName);\n edu.jhu.fcriscu1.als.graphdb.util.AsyncLoggingService.logInfo(\"Property: \" +propertyName +\" value: \"+filePath);\n // look up a resource file\n propertyName = \"TEST_PROACT_ADVERSE_EVENT_FILE\";\n FrameworkPropertyService.INSTANCE.getOptionalResourcePath(propertyName)\n .ifPresent(path -> System.out.println(\"Resource path = \" +path.toString()));\n // look up bad property - should get error message\n propertyName = \"XXXXXXXXXX\";\n String badValue = FrameworkPropertyService.INSTANCE.getStringProperty(propertyName);\n }", "public void loadProperties(){\n\n\ttry{\n\t prop.load(file);\n // get the property value and print it out\n host = prop.getProperty(\"host\");\n\t port = prop.getProperty(\"port\");\n\t sslmode = prop.getProperty(\"sslmode\");\n\t source = prop.getProperty(\"source\");\n dbname = prop.getProperty(\"dbname\");\n help_url_prefix = prop.getProperty(\"base.help.url\");\n password = prop.getProperty(\"password\");\n\t user = prop.getProperty(\"user\");\t \n\t temp_dir = new File(System.getProperty(\"java.io.tmpdir\")).toString();\n\t working_dir = new File(System.getProperty(\"user.dir\")).toString();\n\t file.close();\n\t}catch(IOException ioe){\n\t\t\n\t} \n\t \n }", "public void registerProperty(File propertiesFile, String key, String value) {\n\t\tSystem.out.println(\"enter method registerProperty(\" + \"File propertiesFile, String key, String value)\");\n\t\tPropertiesConfiguration propertiesConfiguration = null;\n\t\ttry {\n\t\t\tpropertiesConfiguration = new PropertiesConfiguration(propertiesFile);\n\t\t\tpropertiesConfiguration.setProperty(key, value);\n\t\t\tpropertiesConfiguration.save();\n\n\t\t} catch (ConfigurationException e) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\te.printStackTrace();\n\t\t}\n\t}", "public String getProperty(Class type, String key);", "public void setPropertyFile(String value) {\n File f = (new File(value)).getAbsoluteFile();\n if (f.isDirectory()) {\n throw new IllegalArgumentException(\n String.format(\"The file %s is a directory.\", f));\n }\n File parent = f.getParentFile();\n if (parent != null) {\n if (!parent.isDirectory()) {\n throw new IllegalArgumentException(\n String.format(\"The directory %s does not exist.\", parent));\n }\n }\n propertyFile = f.getPath();\n }", "public int getPropertyInt(String key);", "public String getPropertyFile() {\n return propertyFile;\n }", "public void setProperty(String prop, Object value)\r\n {\r\n\tswitch(prop)\r\n\t{\r\n\t case \"name\":\r\n\t\tname = value.toString();\r\n\t\tbreak;\r\n\t case \"description\":\r\n\t\tdesc = value.toString();\r\n\t\tbreak;\r\n\t case \"type\":\r\n\t\tsetType(value.toString());\r\n\t\tbreak;\r\n\t case \"level\":\r\n\t\tlevel = (Integer) value;\r\n\t\tbreak;\r\n\t case \"rarity\":\r\n\t\trare = Rarity.valueOf(value.toString().toUpperCase());\r\n\t\tbreak;\r\n\t case \"vendor_value\":\r\n\t\tvendorValue = (Integer) value;\r\n\t\tbreak;\r\n\t case \"game_types\":\r\n\t\taddGameType(value.toString());\r\n\t\tbreak;\r\n\t case \"flags\":\r\n\t\taddFlag(value.toString());\r\n\t\tbreak;\r\n\t case \"restrictions\":\r\n\t\taddRestriction(value.toString());\r\n\t\tbreak;\r\n\t case \"id\":\r\n\t\tid = (Integer) value;\r\n\t\tbreak;\r\n\t case \"icon\":\r\n\t\ttry {\r\n\t\t icon = new URL(value.toString());\r\n\t\t}\r\n\t\tcatch(MalformedURLException e) {\r\n\t\t e.printStackTrace();\r\n\t\t}\r\n\t\tbreak;\r\n\t}\r\n }", "public interface IPropertiesHandler {\n\n /**\n * <p>\n * Returns property value from property value\n * </p>\n * @param filename name of resource bundle\n * @param lang localization\n * @param key property key\n * @return value for specific key and localization or only key if no value was found\n */\n String getPropertyValue(String filename, String lang, String key);\n}", "public ReadPropertyFile()\n\t{\n\t prob = new Properties(); \n\t \n\t try\n\t {\n\t FileInputStream fis = new FileInputStream(\".//config.properties\");\n\t prob.load(fis);\n\t }\n\t catch(FileNotFoundException e)\n\t {\n\t\t System.out.println(e.getMessage());\n\t }\n catch(IOException e)\n\t {\n \t System.out.println(e.getMessage());\n\t }\n\t}", "void setMyProperty1(Integer a) {}", "public void getConfigProperty() {\n Properties properties = new Properties();\n try(InputStream input = new FileInputStream(\"config.properties\");){\n properties.load(input);\n logger.info(\"BASE URL :\" + properties.getProperty(\"BASEURL\"));\n setBaseUrl(properties.getProperty(\"BASEURL\"));\n setLoginMode(properties.getProperty(\"LOGINMODE\"));\n setProjectId(properties.getProperty(\"PROJECTID\"));\n setReportId(properties.getProperty(\"REPORTID\"));\n if (!(properties.getProperty(\"PASSWORD\").trim().equals(\"\"))) {\n setPassword(properties.getProperty(\"PASSWORD\"));\n }\n if (!(properties.getProperty(\"USERNAME\").trim().equals(\"\"))) {\n setUserName(properties.getProperty(\"USERNAME\"));\n }\n }catch(IOException ex) {\n logger.debug(\"Failed to fetch value from configure file: \", ex);\n }\n\n }", "public Property(String configFileName) {\r\n\r\n\t\tpositive = new String[] { \"fun\", \"happy\", \"positive\" };\r\n\t\tnegative = new String[] { \"sad\", \"bad\", \"angry\" };\r\n\t\tstop = new String[] { \"a\", \"an\", \"the\" };\r\n\t\tscoringmethod = 0;\r\n\t\tmindistance = 0.5;\r\n\r\n\t\tif (configFileName == null) {\r\n\t\t\tthrow new NullPointerException();\r\n\t\t}\r\n\t\tScanner in = null;\r\n\t\tScanner scan = null;\r\n\t\ttry {\r\n\t\t\tFile conf = new File(configFileName);\r\n\t\t\tin = new Scanner(conf);\r\n\t\t\twhile (in.hasNextLine()) {\r\n\t\t\t\tString line = in.nextLine().replace('=', ',');\r\n\t\t\t\tscan = new Scanner(line);\r\n\t\t\t\tscan.useDelimiter(\",\");\r\n\t\t\t\tString firstWord = scan.next();\r\n\t\t\t\tif (firstWord.equals(\"positive\")) {\r\n\t\t\t\t\tpositive = termsArray(scan);\r\n\t\t\t\t} else if (firstWord.equals(\"negative\")) {\r\n\t\t\t\t\tnegative = termsArray(scan);\r\n\t\t\t\t} else if (firstWord.equals(\"stop\")) {\r\n\t\t\t\t\tstop = termsArray(scan);\r\n\t\t\t\t} else if (firstWord.equals(\"scoringmethod\")) {\r\n\t\t\t\t\tString next = scan.next();\r\n\t\t\t\t\tscoringmethod = Integer.parseInt(next);\r\n\t\t\t\t} else if (firstWord.equals(\"mindistance\")) {\r\n\t\t\t\t\tString next = scan.next();\r\n\t\t\t\t\tmindistance = Double.parseDouble(next);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t} catch (NumberFormatException ex) {\r\n\t\t\tSystem.out.println(ex.getMessage());\r\n\t\t\tpositive = new String[] { \"fun\", \"happy\", \"positive\" };\r\n\t\t\tnegative = new String[] { \"sad\", \"bad\", \"angry\" };\r\n\t\t\tstop = new String[] { \"a\", \"an\", \"the\" };\r\n\t\t\tscoringmethod = 0;\r\n\t\t\tmindistance = 0.5;\r\n\t\t} catch (IOException ex) {\r\n\t\t\tSystem.out.println(ex.getMessage());\r\n\t\t\tpositive = new String[] { \"fun\", \"happy\", \"positive\" };\r\n\t\t\tnegative = new String[] { \"sad\", \"bad\", \"angry\" };\r\n\t\t\tstop = new String[] { \"a\", \"an\", \"the\" };\r\n\t\t\tscoringmethod = 0;\r\n\t\t\tmindistance = 0.5;\r\n\t\t} finally{\r\n\t\t\tif(scan != null)\r\n\t\t\t\tscan.close();\r\n\t\t}\r\n\t}", "private static String getProperty(String key)\r\n/* 70: */ throws IOException\r\n/* 71: */ {\r\n/* 72: 71 */ log.finest(\"OSHandler.getProperty\");\r\n/* 73: 72 */ File propsFile = getPropertiesFile();\r\n/* 74: 73 */ FileInputStream fis = new FileInputStream(propsFile);\r\n/* 75: 74 */ Properties props = new Properties();\r\n/* 76: 75 */ props.load(fis);\r\n/* 77: 76 */ String value = props.getProperty(key);\r\n/* 78: 77 */ fis.close();\r\n/* 79: 78 */ log.finest(\"Key=\" + key + \" Value=\" + value);\r\n/* 80: 79 */ return value;\r\n/* 81: */ }", "public abstract Object getProperty(String property) throws SOAPException;", "PropertiesTask setTargetFile( File propertiesFile );", "@Override\r\n\tpublic String getProp(final String propName) {\n\t\treturn exec(new Callable<String>() {\r\n\t\t\t@Override\r\n\t\t\tpublic String call() throws Exception {\r\n\t\t\t\treturn System.getProperty(propName);\r\n\t\t\t}\r\n\t\t});\r\n\t}", "public AlertApi.AlertObject getProperty(String prop) \n throws AlertException {\n AlertApi.AlertObject obj = null;\n AlertTreeNodeLeaf leaf = null;\n synchronized(AlertCorrelationEngine.class) {\n leaf = (AlertTreeNodeLeaf) propertiesMap.get(prop);\n }\n if (leaf != null) {\n String [] pathElements = leaf.parsePath();\n try {\n int nodeid = Integer.parseInt(pathElements[0]);\n int index = getIndexFromNodeId(nodeid);\n AlertNode curNode = getNodeFromIndex(index);\n if (curNode != null && curNode.isValid()) {\n obj = leaf.getAlertObject();\n return obj;\n }\n } catch (NumberFormatException nb) {\n logger.severe(\"invalid leaf, nodeid = \" + pathElements[0]);\n }\n }\n if (obj == null) {\n throw (new AlertException(\"property \" + prop + \" does not exist\"));\n }\n // To please compiler.\n return null;\n }", "String get(String kind, String name, String property);", "public String getProperty(int property) {\n\t\treturn activity.getString(R.string.input);\n\t}", "public String getProperty(String name){\r\n\t\treturn properties.getProperty(name);\r\n\t}", "public String getStringProperty(String propertyName) ;", "@Override\n public Object getProperty(String property) {\n for (Map.Entry<String, RequiredFunctionalExtension> requiredBehaviorEntry : myRequiredBehaviorById.entrySet()) {\n Object prop = requiredBehaviorEntry.getValue().getProperty(property);\n if (prop != null) {\n return prop;\n }\n }\n return null;\n }", "public void setupProp() {\r\n\t\tprop = new Properties();\r\n\t\tInputStream in = getClass().getResourceAsStream(\"C:/Users/Marcus/git/EmailProgram/EmailProgram/resources/config.properties\");\r\n\t\ttry {\r\n\t\t\tprop.load(in);\r\n\t\t\tFileInputStream fin = new FileInputStream(\"C:/Users/Marcus/git/EmailProgram/EmailProgram/resources/config.properties\");\r\n\t\t\tObjectInputStream ois = new ObjectInputStream(fin);\r\n\t\t\tdblogic = (PatronDBLogic) ois.readObject();\r\n\t\t\tois.close();\r\n\r\n\t\t} catch (IOException | ClassNotFoundException e) {\r\n\t\t\te.printStackTrace();\r\n\t\t}\r\n\t}", "private static void loadPropertiesFile() {\n checkNotNull(propertyFileName, \"propertyFileName cannot be null\");\n String currentDir = new File(\"\").getAbsolutePath();\n propertyFile = currentDir + \"/\" + propertyFileName;\n File propFile = new File(propertyFile);\n try {\n propFile.createNewFile();\n } catch (IOException ex) {\n Debugger.logMessage(ex);\n }\n\n props = new Properties();\n try {\n FileInputStream fis = new FileInputStream(propertyFile);\n props.load(fis);\n fis.close();\n } catch (IOException ex) {\n Debugger.logMessage(ex);\n }\n }", "PropertyRegistry getPropertyRegistry();", "PropertyRule createPropertyRule();", "public static String fetchMyProperties(String req) throws Exception {\n\n String val;\n\n FileReader reader = new FileReader(\"src\\\\test\\\\java\\\\resources\\\\westpac.properties\");\n Properties p = new Properties();\n p.load(reader);\n val = p.getProperty(req);\n\n return val;// returning the requested value.\n }", "public static String getPropertyValue(String filename,String variable) {\n\t\tProperties prop = new Properties();\n\t\tInputStream input = null;\n\t\tString result;\n\t\tString home = System.getProperty(\"conf.dir\");\n\t\ttry {\n\t\t\tinput = new FileInputStream(home+\"/\"+filename);\n\t\t\tprop.load(input);\n\t\t\tresult=prop.getProperty(variable);\n\t\t} catch (IOException e) {\n\t\t\tlogger.error(\"Error occured while getting properties: \",e);\n\t\t\tresult=null;\n\t\t}\n\t\treturn result;\n\t}", "private static void storePropsFile() {\n try {\n FileOutputStream fos = new FileOutputStream(propertyFile);\n props.store(fos, null);\n fos.close();\n } catch (IOException ex) {\n Debugger.logMessage(ex);\n }\n }", "public String getPropertyFile()\n\t{\n\t\treturn propertyFile;\n\t}", "public static String loadProperty(String key) {\n Properties prop = new Properties();\n InputStream is;\n\n try {\n is = new FileInputStream(\"./config.properties\");\n prop.load(is);\n } catch (IOException e) {\n System.out.println(\"Error al cargar el archivo\");\n }\n\n return prop.getProperty(key);\n }", "public static String getPropertyFromCustomConfiguration(String propertyFile, String propertyName) throws InternalErrorException {\n log.trace(\"Entering getPropertyFromCustomConfiguration: propertyFile='\" + propertyFile + \"' propertyName='\" + propertyName + \"'\");\n notNull(propertyName, \"propertyName\");\n notNull(propertyFile, \"propertyFile\");\n\n // Load properties file with configuration\n Properties properties = new Properties();\n try {\n // Get the path to the perun.properties file\n BufferedInputStream is = new BufferedInputStream(new FileInputStream(Utils.configurationsLocations + propertyFile));\n properties.load(is);\n is.close();\n\n String property = properties.getProperty(propertyName);\n if (property == null) {\n throw new InternalErrorException(\"Property \" + propertyName + \" cannot be found in the configuration file: \"+propertyFile);\n }\n return property;\n } catch (FileNotFoundException e) {\n throw new InternalErrorException(\"Cannot find \"+propertyFile+\" file\", e);\n } catch (IOException e) {\n throw new InternalErrorException(\"Cannot read \"+propertyFile+\" file\", e);\n }\n }", "static void getProp() throws Exception {\r\n\r\n\t\tFileInputStream fileInputStream = new FileInputStream(\r\n\t\t\t\t\"C:\\\\repos\\\\test\\\\src\\\\main\\\\java\\\\test\\\\config.properties\");\r\n\r\n\t\tProperties properties = new Properties();\r\n\t\tproperties.load(fileInputStream);\r\n\r\n\t\tSystem.out.println(\"By using File Input stream class: \" + properties.getProperty(\"username\"));\r\n\r\n\t}", "public final String readProperty(final String key){\n return mProperties.getProperty(key);\n }", "private int getInt(String whatProperty, String levelConfigFilePath) {\n return getInt(levelConfig, whatProperty, levelConfigFilePath);\n }", "public void setProperty(String property) {\n \t\t_property = property;\n \t}", "String getPropertyExists();" ]
[ "0.7129801", "0.70056397", "0.70056397", "0.70056397", "0.69209814", "0.68375874", "0.68375874", "0.66906387", "0.6630672", "0.6615635", "0.65789497", "0.65649605", "0.6555834", "0.6555834", "0.6555834", "0.65128046", "0.64407593", "0.6324859", "0.6308422", "0.62779206", "0.6258306", "0.62344474", "0.6212729", "0.62007964", "0.6186436", "0.6151546", "0.615136", "0.6125963", "0.60669905", "0.60487735", "0.60487735", "0.6039535", "0.599417", "0.59833014", "0.5965709", "0.5936113", "0.59236526", "0.590226", "0.5896951", "0.5891835", "0.58899534", "0.5889397", "0.5884643", "0.58774424", "0.58766454", "0.58638155", "0.5858992", "0.58490294", "0.5842836", "0.58418584", "0.58395547", "0.58360666", "0.5835152", "0.5828629", "0.582435", "0.5809526", "0.58001614", "0.5795907", "0.5786109", "0.57833326", "0.57653135", "0.57595825", "0.5758889", "0.5751788", "0.5742789", "0.5738591", "0.5727386", "0.5692826", "0.56902546", "0.5688719", "0.5687406", "0.568148", "0.5679317", "0.5677067", "0.56721413", "0.5671596", "0.56713265", "0.56666493", "0.5662078", "0.5661392", "0.5646274", "0.5642454", "0.5638661", "0.5629825", "0.5617895", "0.5611064", "0.5604278", "0.560297", "0.5599217", "0.55949324", "0.55877674", "0.55810195", "0.55805653", "0.5577227", "0.55751514", "0.5568948", "0.5565928", "0.55641115", "0.55522597", "0.55514336" ]
0.61531824
25
DATE TIME METHODS method to get current system date and time in particular format
public String getCurrentDateTime(String sDateFormat) throws Exception { SimpleDateFormat formatter = null; String dateNow = ""; String sDefaultDateFormat = "yyyy:MM:dd:HH:mm"; try { if (sDateFormat == null) { sDateFormat = ""; } if (!sDateFormat.trim().equalsIgnoreCase("")) { sDefaultDateFormat = sDateFormat; } Calendar currentDate = Calendar.getInstance(); formatter = new SimpleDateFormat(sDefaultDateFormat); dateNow = formatter.format(currentDate.getTime()); dateNow.trim(); return dateNow; } catch (Exception exp) { println("getCurrentDateTime : " + exp.toString()); throw exp; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public String getSystemDateTime() {\n\t\tjava.text.SimpleDateFormat sdfDate = new java.text.SimpleDateFormat(\"yyyy/MM/dd\");\n java.text.SimpleDateFormat sdfTime = new java.text.SimpleDateFormat(\"HH:mm\");\n Date now = new Date();\n String strDate = sdfDate.format(now);\n String strTime = sdfTime.format(now);\n System.out.println(\"Date: \" + strDate);\n System.out.println(\"Time: \" + strTime); \n return \"date\"+strDate+\" \"+strTime;\n\t}", "private static String getFormattedCurrentDateAndTime(){\n StringBuilder dateAndTime = new StringBuilder();\n LocalDateTime now = LocalDateTime.now();\n\n String hour = Integer.toString(now.getHour());\n String minute = Integer.toString(now.getMinute());\n\n if (hour.length() == 1){\n hour = \"0\" + hour;\n }\n if (minute.length() == 1){\n minute = \"0\" + minute;\n }\n\n //Creates \"XX/XX/XX @ XX:XX\" format (24 hours)\n dateAndTime.append(now.getMonthValue()).append(\"/\").\n append(now.getDayOfMonth()).append(\"/\").\n append(now.getYear()).append(\" @ \").\n append(hour).append(\":\").\n append(minute);\n\n return dateAndTime.toString();\n }", "public String getCurrentDateAndTime(){\n return dateTimeFormatter.format(current);\n }", "public static String getDateAndTime() {\n Calendar JCalendar = Calendar.getInstance();\n String JMonth = JCalendar.getDisplayName(Calendar.MONTH, Calendar.SHORT, Locale.UK);\n String JDate = JCalendar.getDisplayName(Calendar.DATE, Calendar.LONG, Locale.UK);\n String JHour = JCalendar.getDisplayName(Calendar.HOUR, Calendar.LONG, Locale.UK);\n String JSec = JCalendar.getDisplayName(Calendar.SECOND, Calendar.LONG, Locale.UK);\n\n return JDate + \"th \" + JMonth + \"/\" + JHour + \".\" + JSec + \"/24hours\";\n }", "public static String currentDateTime() {\r\n Calendar c = Calendar.getInstance();\r\n return String.format(\"%tB %te, %tY%n%tl:%tM %tp%n\", c, c, c, c, c, c);\r\n }", "public static String datetimeNow(){\n return now(DATETIME_FORMAT_PATTERN);\n }", "public static String getDate()\r\n {\r\n Date now = new Date();\r\n DateFormat df = new SimpleDateFormat (\"yyyy-MM-dd'T'hh-mm-ss\");\r\n String currentTime = df.format(now);\r\n return currentTime; \r\n \r\n }", "private String getDateTime() {\n SimpleDateFormat sdf = new SimpleDateFormat(\"[yyyy/MM/dd - HH:mm:ss]\");\n return sdf.format(new Date());\n }", "private String getDateTime() {\n SimpleDateFormat sdf = new SimpleDateFormat(\"[yyyy/MM/dd - HH:mm:ss]\");\n return sdf.format(new Date());\n }", "private String getDateTime() {\n SimpleDateFormat sdf = new SimpleDateFormat(\"[yyyy/MM/dd - HH:mm:ss]\");\n return sdf.format(new Date());\n }", "private String getCurrentTime() {\n DateFormat dateFormat = new SimpleDateFormat(\"dd/MM/yyyy HH:mm:ss\");\n Date date = new Date();\n return dateFormat.format(date);\n }", "public static String getNowTime(){\r\n\t\tDate date = new Date();\r\n\t\tDateFormat format = new SimpleDateFormat(\"yyyy-MM-dd HH:mm:ss\");\r\n\t\tString time = format.format(date);\r\n\t\treturn time;\r\n\t}", "public static String getTime() {\r\n\r\n\t\t//Gets current date and time\r\n\t\tDateFormat dateFormat = new SimpleDateFormat(\"yyyy-MM-dd HH:mm:ss\");\r\n\t\tDate date = new Date();\r\n\t\tcurrDateTime = dateFormat.format(date);\r\n\t\treturn currDateTime;\r\n\t}", "public static String getDateTime(){\n String pattern = \"MM/dd/yyyy HH:mm:ss\";\n DateFormat df = new SimpleDateFormat(pattern);\n Date today = Calendar.getInstance().getTime();\n String todayAsString = df.format(today);\n return todayAsString;\n }", "public String getTimeAndDate() {\n\t\t\tDateFormat dateFormat = new SimpleDateFormat(\"dd MMM hh:mm\");\n\t\t\tCalendar cal = Calendar.getInstance();\n\t\t\tString dateAndTime = dateFormat.format(cal.getTime());\n\t\t\treturn dateAndTime;\n\t\t}", "public static String getSystemDate()\n {\n\t DateFormat dateFormat= new SimpleDateFormat(\"_ddMMyyyy_HHmmss\");\n\t Date date = new Date();\n\t return dateFormat.format(date);\n }", "public static String getDateTime() {\n\t\tString sDateTime=\"\";\n\t\ttry {\n\t\t\tSimpleDateFormat sdfDate = new SimpleDateFormat(\"dd-MM-yyyy\");\n\t\t\tSimpleDateFormat sdfTime = new SimpleDateFormat(\"HH:mm:ss\");\n\t\t\tDate now = new Date();\n\t\t\tString strDate = sdfDate.format(now);\n\t\t\tString strTime = sdfTime.format(now);\n\t\t\tstrTime = strTime.replace(\":\", \"-\");\n\t\t\tsDateTime = \"D\" + strDate + \"_T\" + strTime;\n\t\t} catch (Exception e) {\n\t\t\tSystem.err.println(e);\n\t\t}\n\t\treturn sDateTime;\n\t}", "private String currentDateTime() {\n DateFormat df = new SimpleDateFormat(\"yyyy-MM-dd'T'HH:mm:ss.SSSZ\");\n String date = df.format(Calendar.getInstance().getTime());\n return date;\n }", "public String getCurrentDateTime(){\n SimpleDateFormat simpleDateFormat = new SimpleDateFormat(\n \"yyyy-MM-dd HH:mm:ss\", Locale.getDefault()\n );\n Date date = new Date();\n return simpleDateFormat.format(date);\n }", "private static String getTime() {\n\t\tDate getDate = new Date();\n\t\tString timeFormat = \"M/d/yy hh:mma\";\n\t\tSimpleDateFormat sdf = new SimpleDateFormat(timeFormat);\n\t\treturn \"[\" + sdf.format(getDate) + \"]\\t\";\n\t}", "private void getDateTime() {\n String todayDateTime = String.valueOf(Calendar.getInstance().getTime());\n\n // Calendar.getInstance().getTime() returns a long string of various data for today, split and access what we need\n String[] splitTime = todayDateTime.split(\" \");\n\n dayDate = splitTime[1] + \" \" + splitTime[2] + \" \" + splitTime[5]; // Month, Day, Year\n dayTime = splitTime[3];\n }", "private String getDateTime() {\n DateFormat dateFormat = new SimpleDateFormat(\"MM/dd/yyyy HH:mm\");\n Date date = new Date();\n return dateFormat.format(date);\n }", "public static String getCurrentDateTime() {\n String format = null;\n format = sdfNormal.format(new Date());\n return format;\n }", "public static String getCurrentDateTime()\n\t{\n\t\treturn getDateTime(new Date());\n\t}", "private String getCurrentDate() {\n DateFormat dateFormat = new SimpleDateFormat(\"yyyy/MM/dd HH:mm:ss\");\n Calendar cal = Calendar.getInstance();\n return dateFormat.format(cal.getTime());\n }", "private static String getDate()\n\t{\n\t\tString dateString = null;\n\t\tDate sysDate = new Date( System.currentTimeMillis() );\n\t\tSimpleDateFormat sdf = new SimpleDateFormat(\"dd-MM-yy HH:mm:ss\");\n\t\tdateString = sdf.format(sysDate);\n\t\treturn dateString;\n\t}", "public String getDateTime() {\n\t\t\n\t\tDateTimeFormatter dateTimeFormatter = DateTimeFormatter.ofPattern(\"yyyy/MM/dd HH:mm:ss\"); \n\t\t\n\t\tLocalDateTime currentDateTime = LocalDateTime.now(); \n\t\t\n\t\treturn dateTimeFormatter.format(currentDateTime);\n\t}", "public String getSystemTime() {\n return DateFormat.getDateTimeInstance().format(new Date().getTime());\n }", "public String getCurrentTime() {\r\n DateTimeFormatter dtf = DateTimeFormatter.ofPattern(\"dd/MM/yyyy HH:mm:ss\"); //https://www.javatpoint.com/java-get-current-date\r\n LocalDateTime now = LocalDateTime.now();\r\n return dtf.format(now);\r\n }", "public static String getDateString(){\n\t\t\tCalendar now = Calendar.getInstance();\n\t\t\tSimpleDateFormat sdf = new SimpleDateFormat(\"yyyy-MM-dd__HH-mm-ss\");\n\t\t\treturn sdf.format(now.getTime());\n\t }", "private String currentTime()\t{\n\t\tCalendar c = Calendar.getInstance(); \n\n\t\tString seconds;\n\t\tif(c.get(Calendar.SECOND) < 10)\t{\n\t\t\tseconds = \"0\"+Integer.toString(c.get(Calendar.SECOND));\n\t\t} else {\n\t\t\tseconds = Integer.toString(c.get(Calendar.SECOND));\n\t\t}\n\n\t\tString minutes;\n\t\tif(c.get(Calendar.MINUTE) < 10)\t{\n\t\t\tminutes = \"0\"+Integer.toString(c.get(Calendar.MINUTE));\n\t\t} else {\n\t\t\tminutes = Integer.toString(c.get(Calendar.MINUTE));\n\t\t}\n\n\t\tString hours;\n\t\tif(c.get(Calendar.HOUR_OF_DAY) < 10)\t{\n\t\t\thours = \"0\"+Integer.toString(c.get(Calendar.HOUR_OF_DAY));\n\t\t} else {\n\t\t\thours = Integer.toString(c.get(Calendar.HOUR_OF_DAY));\n\t\t}\n\n\t\tString day;\n\t\tif(c.get(Calendar.DATE) < 10)\t{\n\t\t\tday = \"0\"+Integer.toString(c.get(Calendar.DATE));\n\t\t} else {\n\t\t\tday = Integer.toString(c.get(Calendar.DATE));\n\t\t}\n\n\t\tString month;\n\t\tif((c.get(Calendar.MONTH)+1) < 10)\t{\n\t\t\tmonth = \"0\"+Integer.toString(c.get(Calendar.MONTH)+1);\n\t\t} else {\n\t\t\tmonth = Integer.toString(c.get(Calendar.MONTH)+1);\n\t\t}\n\n\t\tString year;\n\t\tif(c.get(Calendar.YEAR) < 10)\t{\n\t\t\tyear = \"0\"+Integer.toString(c.get(Calendar.YEAR));\n\t\t} else {\n\t\t\tyear = Integer.toString(c.get(Calendar.YEAR));\n\t\t}\n\n\t\treturn day+\"/\"+month+\"/\"+year + \" \"+hours+\":\"+minutes+\":\"+seconds;\t\n\t}", "public static String getDateTime() {\n\t\treturn new SimpleDateFormat(\"dd/MM/yyyy HH:mm:ss\").format(new Date());\n\t}", "public String getTime() {\n String pattern = \"yyyy-MM-dd HH:mm:ss\";\n SimpleDateFormat simpleDateFormat = new SimpleDateFormat(pattern);\n\n String date = simpleDateFormat.format(new Date());\n return date;\n }", "String getTime(){\n\t\tCalendar c = Calendar.getInstance();\n int mseconds = c.get(Calendar.MILLISECOND);\n String currentDateandTime = mDateFormat.format(new Date()) + String.format(\"-%04d\", mseconds);\n \n return currentDateandTime;\n\t}", "private String getCurrentTimestamp() {\n\n String mytime = java.text.DateFormat.getTimeInstance().format(Calendar.getInstance().getTime());\n String mydate =java.text.DateFormat.getDateTimeInstance().format(Calendar.getInstance().getTime());\n return mytime;\n }", "public static String now(){\n return now(DATE_FORMAT_PATTERN);\n }", "public String getCurrentTime(String timeForm) {\n DateFormat timeFormat = new SimpleDateFormat(timeForm);\n\n //get current date time with Date()\n Date time = new Date();\n\n // Now format the date\n String time1 = timeFormat.format(time);\n\n return time1;\n }", "public static String getCurrentTime() {\r\n\t\tDate date = new Date();\r\n\t\treturn date.toString();\r\n\t}", "private String getDate()\r\n\t{\r\n\t\tCalendar cal = Calendar.getInstance();\r\n\t\tSimpleDateFormat sdf = new SimpleDateFormat(\"yyyy-MM-dd HH:mm\");\r\n\t\treturn sdf.format(cal.getTime());\r\n\t}", "private static String getDate() {\n return new SimpleDateFormat(\"yyyyMMddHHmmss\").format\n (new Date(System.currentTimeMillis()));\n }", "@Test\n\tpublic void systemDate_Get()\n\t{\n\t\tDateFormat dateFormat = new SimpleDateFormat(\"MM-dd-yyyy\");\n\t\t\n\t\t// Created object of Date, to get system current date\n\t\tDate date = new Date();\n\t\t\n\t\tString currDate = dateFormat.format(date);\n\t\t\n\t\tSystem.out.println(\"Today's date is : \"+currDate);\n\n\t}", "String getCurTime();", "@SimpleFunction(description = \"Gets the current time.\"\n + \"It is formatted correctly for iSENSE\")\n public String GetTime() {\n Calendar cal = Calendar.getInstance();\n SimpleDateFormat sdf = new SimpleDateFormat(\"yyyy-MM-dd'T'HH:mm:ss.SSSZ\");\n return sdf.format(cal.getTime()).toString();\n }", "public static String fn_GetCurrentTimeStamp() {\n\t\tDate dte = new Date();\n\t\tDateFormat df = DateFormat.getDateTimeInstance();\n\t\tString strdte = df.format(dte);\n\t\tstrdte = strdte.replaceAll(\":\", \"_\");\n\t\treturn strdte;\n\t}", "public static String now() {\n // TODO: move this method to DateUtils\n return fromCalendar(GregorianCalendar.getInstance());\n }", "public static String getCurrentTime()\n\t{\n\t\treturn getTime(new Date());\n\t}", "public String getSystemTime() {\n\t\tSimpleDateFormat dateTimeInGMT = new SimpleDateFormat(\"dd-MMM-yyyy hh\");\n\t\t// Setting the time zoneS\n\t\tdateTimeInGMT.setTimeZone(TimeZone.getTimeZone(\"America/New_York\"));\n\t\tString timeZone = dateTimeInGMT.format(new Date());\n\t\treturn timeZone;\n\n\t}", "private static String time() throws Exception {\n\t\tDateFormat dateFormat = new SimpleDateFormat(\"HH-mm-ss \");\n\t\t// get current date time with Date()\n\t\tDate date = new Date();\n\t\t// Now format the date\n\t\tString date1 = dateFormat.format(date);\n\t\t// System.out.println(date1);\n\t\treturn date1;\n\t}", "public static String getCurrentTime(){\n Calendar calendar = Calendar.getInstance(TimeZone.getTimeZone(\"Asia/Singapore\"));\n Date currentDate = calendar.getTime();\n return currentDate.toString();\n }", "public static final String CurrentTime() {\n\t\t\n\t\tfinal SimpleDateFormat DF = new SimpleDateFormat(\"HH:mm:ss\");\n\t\treturn DF.format(new Date());\n\t}", "public static String getDate() {\n\t\tString\ttoday=\"\";\n\n\t\tCalendar Datenow=Calendar.getInstance();\n\t\tSimpleDateFormat formatter = new SimpleDateFormat(\"yyyy-MM-dd HH:mm:ss\");\n\t today = formatter.format(Datenow.getTime());\n\n\t return today;\n\t}", "public Date getSystemDateTime(){\n\t\tDate systemDate = new Date();\t\t\n\t\treturn systemDate;\n\t}", "public static String getCurrentDateTimeFull() {\n\t\t\t\t// DateFormat dateFormat = new SimpleDateFormat(\"yyyy-MM-dd HH:mm:ss\");\n\t\t\t\t// need to change after the date format is decided\n\t\t\t\tDateFormat dateFormat = new SimpleDateFormat(\"yyyy-MM-dd HH:mm:ss\");\n\t\t\t\tDate date = new Date();\n\t\t\t\treturn dateFormat.format(date);\n\t\t\t}", "public static String getTimeString() {\n SimpleDateFormat formatter = new SimpleDateFormat(\"EEE MMM dd HH:mm:ss yyyy\");\n return formatter.format(new java.util.Date());\n }", "private String getTodayDate(){\n // get current Date and Time for product_info table\n Date date = Calendar.getInstance().getTime();\n DateFormat dateFormat = new SimpleDateFormat(\"yyyy-MM-dd hh:MM\", Locale.getDefault());\n return dateFormat.format(date);\n }", "private static String currentTimestamp()\r\n {\n \r\n long currentTime = System.currentTimeMillis();\r\n sCalendar.setTime(new Date(currentTime));\r\n \r\n String str = \"\";\r\n str += sCalendar.get(Calendar.YEAR) + \"-\";\r\n \r\n final int month = sCalendar.get(Calendar.MONTH) + 1;\r\n if (month < 10)\r\n {\r\n str += 0;\r\n }\r\n str += month + \"-\";\r\n \r\n final int day = sCalendar.get(Calendar.DAY_OF_MONTH);\r\n if (day < 10)\r\n {\r\n str += 0;\r\n }\r\n str += day;\r\n \r\n str += \"T\";\r\n \r\n final int hour = sCalendar.get(Calendar.HOUR_OF_DAY);\r\n if (hour < 10)\r\n {\r\n str += 0;\r\n }\r\n str += hour + \":\";\r\n \r\n final int minute = sCalendar.get(Calendar.MINUTE);\r\n if (minute < 10)\r\n {\r\n str += 0;\r\n }\r\n str += minute + \":\";\r\n \r\n final int second = sCalendar.get(Calendar.SECOND);\r\n if (second < 10)\r\n {\r\n str += 0;\r\n }\r\n str += second + \".\";\r\n \r\n final int milli = sCalendar.get(Calendar.MILLISECOND);\r\n str += milli;\r\n \r\n str += \"Z\";\r\n \r\n return str;\r\n }", "private String getFecha() {\n\t\tLocalDateTime myDateObj = LocalDateTime.now();\n\t\tDateTimeFormatter myFormatObj = DateTimeFormatter.ofPattern(\"dd-MM-yyyy HH:mm:ss\");\n\t\tString formattedDate = myDateObj.format(myFormatObj);\n \n\t\treturn formattedDate;\n }", "public static String getDate() {\n return getDate(System.currentTimeMillis());\n }", "public static String getToday() {\n return getToday(\"yyyy-MM-dd HH:mm:ss\");\n }", "public static String getCurrentTime(String format) {\n\t\tString dateString = \"0000\";\n\t\ttry {\n\t\t\tSimpleDateFormat formatter = new SimpleDateFormat(format);\n\t\t\tDate d = new Date();\n\t\t\tdateString = formatter.format(d);\n\t\t} catch (Exception ex) {\n\t\t\tex.printStackTrace();\n\t\t}\n\t\treturn dateString;\n\t}", "public static String now() {\n return dateTimeFormatZ.format(new Date());\n }", "java.lang.String getTime();", "public String getSystemDate() {\n\t\tDate date = new Date();\n\t\treturn date.toString();\n\t}", "public static String getYYYYMMDDHHMMSS()\r\n/* 56: */ {\r\n/* 57: 68 */ String nowTime = \"\";\r\n/* 58: 69 */ Date now = new Date();\r\n/* 59: 70 */ SimpleDateFormat formatter = new SimpleDateFormat(\"yyyyMMddHHmmss\");\r\n/* 60: 71 */ nowTime = formatter.format(now);\r\n/* 61: 72 */ return nowTime;\r\n/* 62: */ }", "public static String getCurrentDate()\n\t{\n\t\treturn getDate(new Date());\n\t}", "public String getTimeString() {\n int hour = date.get(Calendar.HOUR);\n int minute = date.get(Calendar.MINUTE);\n\n String AM_PM = \"PM\";\n if (date.get(Calendar.AM_PM) == Calendar.AM) AM_PM = \"AM\";\n\n String hour_fixed = String.valueOf(hour);\n if (hour == 0) hour_fixed = \"12\";\n\n String minute_fixed = String.valueOf(minute);\n while (minute_fixed.length() < 2) {\n minute_fixed = \"0\" + minute_fixed;\n }\n\n return hour_fixed + \":\" + minute_fixed + ' ' + AM_PM;\n }", "String timeStamp() {\n\n\t\tCalendar now = Calendar.getInstance();\n\n\t\t String y = String.valueOf(now.get(now.YEAR));\n\t\t String mo = String.valueOf(now.get(now.MONTH)+1);\n\t\t String d = String.valueOf(now.get(now.DAY_OF_MONTH));\n\t\t String h = String.valueOf(now.get(now.HOUR_OF_DAY));\n\t\t String m = String.valueOf(now.get(now.MINUTE));\n\t\t String s = String.valueOf(now.get(now.SECOND));\n\t\t String ms = String.valueOf(now.get(now.MILLISECOND));\n\n\n\t return h + m + s + ms;\n\n\n\n }", "public static String getDateTime() {\n Calendar cal = Calendar.getInstance(TimeZone.getTimeZone(\"UTC\"));\n Date currentLocalTime = cal.getTime();\n SimpleDateFormat df = new SimpleDateFormat(\"yyyy-MM-dd HH:mm:ss.SSS\");\n df.setTimeZone(TimeZone.getTimeZone(\"UTC\"));\n String date = df.format(currentLocalTime);\n return date;\n }", "private static String timeFor(Date date)\n\t{\n\t\tDateFormat df = new InternetDateFormat();\n\t\tString theTime = df.format(date);\n\t\treturn theTime;\n\t}", "private String getDate() {\n\t\tSimpleDateFormat parseFormat = new SimpleDateFormat(\"hh:mm a\");\n\t\tDate date = new Date();\n\t\tString s = parseFormat.format(date);\n\t\treturn s;\n\t}", "protected final static String getDateStamp() {\n\n\t\treturn\n\n\t\tnew SimpleDateFormat(\"MMM d, yyyy h:mm:ss a zzz\").format(new Date());\n\n\t}", "public static String getNowAsTimestamp() {\r\n\r\n DateFormat dateFormat = new SimpleDateFormat(DATE_FORMAT_PATTERN);\r\n dateFormat.setTimeZone(TimeZone.getTimeZone(\"UTC\"));\r\n return dateFormat.format(new Date()).replaceAll(\"\\\\+0000\", \"Z\").replaceAll(\"([+-][0-9]{2}):([0-9]{2})\", \"$1$2\");\r\n }", "public static void currentDateTime() {\n // Just the date\n LocalDate date = LocalDate.now();\n System.out.println(\"LocalDate now: \" + date);\n\n // Just the time\n LocalTime time = LocalTime.now();\n System.out.println(\"LocalTime now: \" + time);\n\n // Date and time\n LocalDateTime dateTime = LocalDateTime.now();\n System.out.println(\"LocalDateTime now: \" + dateTime);\n\n // Date, time and time zone! Fancy\n ZonedDateTime zonedDateTime = ZonedDateTime.now();\n System.out.println(\"ZonedDateTime now: \" + zonedDateTime);\n System.out.println();\n }", "@RequiresApi(api = Build.VERSION_CODES.N)\n private String getDateTime() {\n DateFormat dateFormat = new SimpleDateFormat(\"yyyy/MM/dd HH:mm:ss\");\n Date date = new Date();\n return dateFormat.format(date);\n }", "public String getTime(){\r\n\t\tDate date = new GregorianCalendar().getTime();\r\n\r\n\t\tString time= new SimpleDateFormat(\"HH:mm:ss\").format(date.getTime());\r\n\t\t\r\n\t\treturn time;\r\n\t}", "public static Date currentDate() {\n Date currentDate = new Date();\n SimpleDateFormat format = new SimpleDateFormat(\"yyyy-MM-dd HH:mm:ss\");\n format.setTimeZone(TimeZone.getTimeZone(\"gmt\"));\n String strTime = format.format(currentDate);\n\n SimpleDateFormat formatLocal = new SimpleDateFormat(\"yyyy-MM-dd HH:mm:ss\");\n\n try {\n currentDate = formatLocal.parse(strTime);\n } catch (ParseException e) {\n e.printStackTrace();\n }\n\n return currentDate;\n }", "public static String now() {\n\t\t\treturn fromCalendar(GregorianCalendar.getInstance());\n\t\t}", "public synchronized static DateFormat getTimeFormat()\n\t{\n\t\treturn TIME_FORMAT;\n\t}", "public String getTimestamp() \n{\n Calendar now = Calendar.getInstance();\n return String.format(\"20%1$ty-%1$tm-%1$td_%1$tHh%1$tMm%1$tSs\", now);\n}", "public String getNow() {\n\t\treturn new Date().toString();\n\t}", "public static String getCurrentDate() {\n DateTimeFormatter dtf = DateTimeFormatter.ofPattern(\"dd/MM/yyyy\"); \n LocalDateTime now = LocalDateTime.now(); \n return dtf.format(now);\n }", "public static void main(String[] args) throws Exception {\n Calendar cal = Calendar.getInstance();\n SimpleDateFormat simpleformat = new SimpleDateFormat(\"E, dd MMM yyyy HH:mm:ss Z\");\n System.out.println(\"Today's date and time = \"+simpleformat.format(cal.getTime()));\n // displaying date\n simpleformat = new SimpleDateFormat(\"dd/MMMM/yyyy\");\n String str = simpleformat.format(new Date());\n System.out.println(\"Current Date = \"+str);\n // current time\n simpleformat = new SimpleDateFormat(\"HH:mm:ss\");\n String strTime = simpleformat.format(new Date());\n System.out.println(\"Current Time = \"+strTime);\n // displaying hour in HH format\n simpleformat = new SimpleDateFormat(\"HH\");\n String strHour = simpleformat.format(new Date());\n System.out.println(\"Hour in HH format = \"+strHour);\n\n\n\n //formato ideal\n simpleformat = new SimpleDateFormat(\"dd/MM/yyyy - HH:mm:ss\");\n String strTimeDay = simpleformat.format(new Date());\n System.out.println(\"Dia e Hora = \" + strTimeDay);\n\n }", "public String getCurrentDateTimeHourMinSec() {\n\t\t\t\t// DateFormat dateFormat = new SimpleDateFormat(\"yyyy-MM-dd HH:mm:ss\");\n\t\t\t\t// need to change after the date format is decided\n\t\t\t\tDateFormat dateFormat = new SimpleDateFormat(\"yyyy-MM-dd HH:mm:ss\");\n\t\t\t\tDate date = new Date();\n\t\t\t\treturn dateFormat.format(date);\n\t\t\t}", "public void getCurrentDate(){\n Date now = new Date(); //get todays date \n \n SimpleDateFormat formatter = new SimpleDateFormat( \"MM/dd/yyyy\" ); \n System.out.println ( \"The current date is: \" + formatter.format( now ) ); \n \n month = (String) formatter.format( now ).subSequence(0, 2);\n day = (String) formatter.format( now ).subSequence(3, 5);\n year = (String) formatter.format( now ).subSequence(6, 10);\n \n System.out.println(\"month: \" + month);\n System.out.println(\"day: \" + day);\n System.out.println(\"year: \" + year);\n \n }", "public String getDateTimeFormated(Context context){\n SimpleDateFormat sdf = new SimpleDateFormat(\"dd/MM/yyyy HH:mm:ss\"\n , context.getResources().getConfiguration().locale);\n sdf.setTimeZone(TimeZone.getDefault());\n return sdf.format(new Date(mDateTime));\n //setting the dateformat to dd/MM/yyyy HH:mm:ss which is how the date is displayed when a dream is saved\n }", "public static String getCurrentDate() {\n\n long now = System.currentTimeMillis();\n if ((now - currentDateGenerated) > 1000) {\n synchronized (format) {\n if ((now - currentDateGenerated) > 1000) {\n currentDateGenerated = now;\n currentDate = format.format(new Date(now));\n }\n }\n }\n return currentDate;\n\n }", "public static String getTime()\n {\n Date time = new Date();\n SimpleDateFormat timeFormat = new SimpleDateFormat(\"HH:mm:ss\");\n return timeFormat.format(time);\n }", "public String getDateTime(){\n LocalDateTime ldt = LocalDateTime.ofInstant(Instant.ofEpochMilli(this.datePosted), ZoneId.systemDefault());\n String dateOnly = ldt.toString().substring(0, 10);\n String timeOnly = ldt.toString().substring(11, ldt.toString().length()-4);\n return dateOnly + \" at \" + timeOnly;\n }", "private static String getTimeStamp()\r\n\t{\r\n\t\tDateFormat dateFormat = new SimpleDateFormat(\"yyyy-MM-dd_HH.mm.ss\");\r\n\t\tDate date = new Date();\r\n\t\treturn dateFormat.format(date);\r\n\t}", "private static String getStamp() {\n\t\t\t return new SimpleDateFormat(\"yyyyMMddHHmmss\").format(new Date());\r\n\t\t}", "public static String getCurrentTimeStamp(){\n try {\n\n SimpleDateFormat dateFormat = new SimpleDateFormat(\"yyyy-MM-dd HH:mm:ss\");\n\n // Find todays date\n String currentDateTime = dateFormat.format(new Date());\n\n return currentDateTime;\n } catch (Exception e) {\n e.printStackTrace();\n\n return null;\n }\n }", "public String getTime() {\n return dateTime.format(c.getTime());\n }", "public String getCurrentTimeHourMinSec() {\n\t\t\t\t// DateFormat dateFormat = new SimpleDateFormat(\"yyyy-MM-dd HH:mm:ss\");\n\t\t\t\t// need to change after the date format is decided\n\t\t\t\tDateFormat dateFormat = new SimpleDateFormat(\"HH:mm:ss\");\n\t\t\t\tDate date = new Date();\n\t\t\t\treturn dateFormat.format(date);\n\t\t\t}", "private String getcurrentTimeStamp() {\n\t\tDateTimeFormatter format = DateTimeFormatter\n\t\t\t\t.ofPattern(RidGeneratorPropertyConstant.TIMESTAMP_FORMAT.getProperty());\n\t\treturn LocalDateTime.now().format(format);\n\t}", "public static String getCurrentDate() {\n\t\tDateFormat df = new SimpleDateFormat(\"yyyy-MM-dd\");\n\t\tDate dateobj = new Date();\n\t\treturn df.format(dateobj);\n\t}", "public String getTime() {\n\t}", "public static String getTimeString() {\n\t\treturn getTimeString(time);\n\t}", "public Date getDateNow(){\n\t\tconfigDefaults(getProp(LOCALE), getProp(TIME_ZONE), null);\r\n\t\t\r\n\t\t// o time millis é sempre GMT 0, a transformação fica por conta do Date\r\n\t\treturn new Date(System.currentTimeMillis()+getProp(TIME_CORRECTION));\r\n\t}", "public synchronized static DateFormat getDateTimeFormat()\n\t{\n\t\treturn DATE_TIME_FORMAT;\n\t}", "protected Date getCurrentDateAndTime() {\n\t\tDate date = new Date();\n\t\tDate updatedDate = new Date((date.getTime() + (1000 * 60 * 60 * 24)));//(1000 * 60 * 60 * 24)=24 hrs. **** 120060 = 2 mins\n\t\treturn updatedDate;\n\t}", "public static String currentTimestamp()\n {\n \n long currentTime = System.currentTimeMillis();\n sCalendar.setTime(new Date(currentTime));\n \n String str = \"\";\n str += sCalendar.get(Calendar.YEAR) + \"-\";\n \n final int month = sCalendar.get(Calendar.MONTH) + 1;\n if (month < 10)\n {\n str += 0;\n }\n str += month + \"-\";\n \n final int day = sCalendar.get(Calendar.DAY_OF_MONTH);\n if (day < 10)\n {\n str += 0;\n }\n str += day;\n \n str += \"T\";\n \n final int hour = sCalendar.get(Calendar.HOUR_OF_DAY);\n if (hour < 10)\n {\n str += 0;\n }\n str += hour + \":\";\n \n final int minute = sCalendar.get(Calendar.MINUTE);\n if (minute < 10)\n {\n str += 0;\n }\n str += minute + \":\";\n \n final int second = sCalendar.get(Calendar.SECOND);\n if (second < 10)\n {\n str += 0;\n }\n str += second + \".\";\n \n final int milli = sCalendar.get(Calendar.MILLISECOND);\n str += milli;\n \n str += \"Z\";\n \n return str;\n }" ]
[ "0.8151964", "0.7662089", "0.75817394", "0.74278396", "0.73835087", "0.7377022", "0.73517925", "0.7344778", "0.7344778", "0.734355", "0.7324122", "0.73170125", "0.72956777", "0.72884023", "0.726845", "0.7264958", "0.7235881", "0.72350633", "0.71953565", "0.715077", "0.7147717", "0.7132619", "0.71204823", "0.71173364", "0.7101915", "0.7072666", "0.70638895", "0.7044283", "0.7039712", "0.7039171", "0.70323575", "0.7032104", "0.70230126", "0.7016891", "0.6990107", "0.6982364", "0.6964768", "0.6931851", "0.69251126", "0.6923673", "0.69075114", "0.6882183", "0.68766963", "0.6850313", "0.6832484", "0.6808529", "0.6786055", "0.6773365", "0.6760673", "0.67493325", "0.67476606", "0.67380846", "0.67199415", "0.67162377", "0.6711002", "0.671099", "0.66988045", "0.66931343", "0.6671613", "0.66657287", "0.6654734", "0.6652201", "0.66435385", "0.6640834", "0.66402507", "0.66384083", "0.66376895", "0.66362727", "0.66284734", "0.66246283", "0.6623785", "0.6622065", "0.66205543", "0.6615935", "0.6582592", "0.6571958", "0.65596205", "0.65420675", "0.65349436", "0.65342385", "0.6509475", "0.6502033", "0.64957833", "0.6473882", "0.64615923", "0.64566505", "0.6442157", "0.6419366", "0.6415036", "0.64148045", "0.64128995", "0.6396296", "0.6376262", "0.6371649", "0.63657284", "0.63613033", "0.6360834", "0.63553476", "0.6350423", "0.6336923", "0.6329887" ]
0.0
-1
method to get date time format in particular format of a calender refernce
public String getDateFormated(Calendar objCalendar, String sDateFormat) throws Exception { SimpleDateFormat formatter = null; String sDate = ""; String sDefaultDateFormat = "yyyy:MM:dd HH:mm:ss"; try { if (sDateFormat == null) { sDateFormat = ""; } sDateFormat = sDateFormat.trim(); if (!sDateFormat.trim().equalsIgnoreCase("")) { sDefaultDateFormat = sDateFormat; } formatter = new SimpleDateFormat(sDefaultDateFormat); sDate = formatter.format(objCalendar.getTime()); sDate.trim(); return sDate; } catch (Exception exp) { println("getCurrentDateTime : " + exp.toString()); throw exp; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public String formatCalDate(Calendar cal) {\n if (cal != null) return SDF_TYPE_1.format(cal.getTime());\n return \"\";\n }", "DateFormat getDisplayDateFormat();", "DateFormat getSourceDateFormat();", "private String formatCalendar(Calendar c)\r\n\t{\n\t\t\tDate tasktime = c.getTime(); \r\n\t\t\r\n\t\tSimpleDateFormat df = new SimpleDateFormat(\"MMMMM d yyyy\"); \r\n\t \r\n\t\treturn df.format(tasktime); \r\n\t}", "public String formatCalTime(Calendar cal) {\n return SDF_TYPE_2.format(cal.getTime());\n }", "java.lang.String getToDate();", "public String format (Date date , String dateFormat) ;", "private String getDateString(Calendar cal) {\n Calendar current = Calendar.getInstance();\n String date = \"\";\n if (cal.get(Calendar.DAY_OF_YEAR) == current.get(Calendar.DAY_OF_YEAR)) {\n date = getResources().getString(R.string.content_today) + String.format(\" %02d:%02d\", cal.get(Calendar.HOUR_OF_DAY), cal.get(Calendar.MINUTE));\n } else if ((cal.get(Calendar.DAY_OF_YEAR) - 1) == current.get(Calendar.DAY_OF_YEAR)) {\n date = getResources().getString(R.string.content_yesterday) + String.format(\" %02d:%02d\", cal.get(Calendar.HOUR_OF_DAY), cal.get(Calendar.MINUTE));\n } else if ((cal.get(Calendar.DAY_OF_YEAR) - 2) == current.get(Calendar.DAY_OF_YEAR)\n && getResources().getConfiguration().locale.equals(new Locale(\"vn\"))) {\n date = getResources().getString(R.string.content_before_yesterday) + String.format(\" %02d:%02d\", cal.get(Calendar.HOUR_OF_DAY), cal.get(Calendar.MINUTE));\n } else {\n date = String.format(\"%02d-%02d-%02d %02d:%02d\", mCal.get(Calendar.DAY_OF_MONTH), mCal.get(Calendar.MONTH) + 1, mCal.get(Calendar.YEAR), cal.get(Calendar.HOUR_OF_DAY), cal.get(Calendar.MINUTE));\n }\n\n return date;\n }", "java.lang.String getFoundingDate();", "public void getREFDT()//get reference date\n\t{\n\t\ttry\n\t\t{\n\t\t\tDate L_strTEMP=null;\n\t\t\tM_strSQLQRY = \"Select CMT_CCSVL,CMT_CHP01,CMT_CHP02 from CO_CDTRN where CMT_CGMTP='S\"+cl_dat.M_strCMPCD_pbst+\"' and CMT_CGSTP = 'FGXXREF' and CMT_CODCD='DOCDT'\";\n\t\t\tResultSet L_rstRSSET = cl_dat.exeSQLQRY2(M_strSQLQRY);\n\t\t\tif(L_rstRSSET != null && L_rstRSSET.next())\n\t\t\t{\n\t\t\t\tstrREFDT = L_rstRSSET.getString(\"CMT_CCSVL\").trim();\n\t\t\t\tL_rstRSSET.close();\n\t\t\t\tM_calLOCAL.setTime(M_fmtLCDAT.parse(strREFDT)); // Convert Into Local Date Format\n\t\t\t\tM_calLOCAL.add(Calendar.DATE,+1); // Increase Date from +1 with Locked Date\n\t\t\t\tstrREFDT = M_fmtLCDAT.format(M_calLOCAL.getTime()); // Assign Date to Veriable \n\t\t\t\t//System.out.println(\"REFDT = \"+strREFDT);\n\t\t\t}\n\t\t}\n\t\tcatch(Exception L_EX)\n\t\t{\n\t\t\tsetMSG(L_EX,\"getREFDT\");\n\t\t}\n\t}", "public static String getTimeString(Calendar calendar, String format) {\n String val = \"\";\n\n SimpleDateFormat dateFormat = getSimpleDateFormat(format);\n Date date = calendar.getTime();\n\n try {\n val = dateFormat.format(date);\n } catch (Exception e) {\n Log.e(\"getTimeString\", \"ex1\" + e+\"==\"+format);\n\n e.printStackTrace();\n }\n\n return val;\n }", "private String easyDateFormat(final String format) {\n Date today = new Date();\n SimpleDateFormat formatter = new SimpleDateFormat(format);\n String datenewformat = formatter.format(today);\n return datenewformat;\n }", "private String getTimeFormat() {\r\n return mData.getConfiguration(\"x-labels-time-format\", \"yyyy-MM-dd\");\r\n }", "@Override\npublic final String toString() {\n\t if(shortFormat) {\n\t\t return toShortString();\n\t }\n if (calValue != null) {\n return dfMedium.get().format(calValue.getTime());\n }\n else {\n return \"\";\n }\n }", "public static String dateToStringFormat(Calendar calendar, String format){\n SimpleDateFormat simpleDateFormat = new SimpleDateFormat(format);\n return simpleDateFormat.format(calendar.getTime());\n }", "private static String getDateStr() {\n\t\tDate date = Calendar.getInstance().getTime();\n\t\tDateFormat dateFormat = new SimpleDateFormat(\"MMddyyy\");\n\t\tString dateStr = dateFormat.format(date);\n\t\treturn dateStr;\n\t}", "java.lang.String getDate();", "public static String getDisplayDateTimeFormat(Date val) {\n\n\t\tif (val != null) {\n\n\t\t\tSimpleDateFormat format = new SimpleDateFormat(\"dd/MM/yyyy h:mm a\");\n\t\t\treturn \"\" + format.format(val);\n\n\t\t} else {\n\n\t\t\treturn null;\n\n\t\t}\n\n\t}", "public String getFormatDate() {\n String formatDate = servletRequest.getHeader(ConstantsCustomers.CUSTOMER_FORMAT_DATE);\n if (StringUtil.isEmpty(formatDate)) {\n formatDate = jwtTokenUtil.getFormatDateFromToken();\n }\n if (StringUtil.isEmpty(formatDate)) {\n formatDate = ConstantsCustomers.APP_DATE_FORMAT_ES;\n }\n return formatDate;\n }", "private String getFormattedDate(Integer format) {\n Date date = new Date(format * 1000L);\n DateFormat dateFormat = new SimpleDateFormat(\"yyyy-MM-dd HH:mm:ss.SSS\");\n dateFormat.setTimeZone(TimeZone.getTimeZone(\"Etc/UTC\"));\n Log.e(\"time\",dateFormat.format(date));\n return dateFormat.format(date);\n }", "public static String displayTimeDate(Calendar cal)\n\t{\n\t\tString out = \"\";\n\t\tint year = cal.get(Calendar.YEAR);\n\t\tint month = cal.get(Calendar.MONTH) + 1;\n\t\tint day = cal.get(Calendar.DAY_OF_MONTH);\n\t\tint hour = cal.get(Calendar.HOUR_OF_DAY);\n\t\tint minute = cal.get(Calendar.MINUTE);\n\t\tint second = cal.get(Calendar.SECOND);\n\t\tint zone = cal.get(Calendar.ZONE_OFFSET) / (60 * 60 * 1000) * 4;\n\t\t\n\t\tString year_str = String.valueOf(year);\n\t\tString month_str = String.valueOf(month);\n\t\tString day_str = String.valueOf(day);\n\t\tString hour_str = String.valueOf(hour);\n\t\tString minute_str = String.valueOf(minute);\n\t\tString second_str = String.valueOf(second);\n\t\tString zone_str = String.valueOf(zone);\n\t\t\n\t\tif (year_str.length() < 2) year_str = \"0\" + year_str;\n\t\tif (month_str.length() < 2) month_str = \"0\" + month_str;\n\t\tif (day_str.length() < 2) day_str = \"0\" + day_str;\n\t\tif (hour_str.length() < 2) hour_str = \"0\" + hour_str;\n\t\tif (minute_str.length() < 2) minute_str = \"0\" + minute_str;\n\t\tif (second_str.length() < 2) second_str = \"0\" + second_str;\n\t\t\n\t\tout = hour_str + \":\" + minute_str + \":\" + second_str + \" \";\n\t\tout = out + day_str + \"-\" + month_str + \"-\" + year_str; //+\" GMT\"+zone_str ;\n\t\treturn out;\n\t}", "public static String getDateString(Calendar cal) {\n\t\tString month = Integer.toString(cal.get(Calendar.MONTH)+1);\n\t\tString day = Integer.toString(cal.get(Calendar.DAY_OF_MONTH));\n\t\tString year = Integer.toString(cal.get(Calendar.YEAR));\n\t\treturn month + \"/\" + day + \"/\" + year;\n\t}", "public String getDateConvert() {\n SimpleDateFormat dateFormat1 = new SimpleDateFormat(\"MMM dd yyyy - hh:mm\");\n SimpleDateFormat dateFormat2 = new SimpleDateFormat(\"a\");\n String date = dateFormat1.format(this.timePost) + dateFormat2.format(this.timePost).toLowerCase();\n return date;\n }", "public String getDateString(Calendar c){\n\n //get all time data\n String mYear = Integer.toString(c.get(Calendar.YEAR));\n int mMonth = c.get(Calendar.MONTH);\n String mDay = Integer.toString(c.get(Calendar.DAY_OF_MONTH));\n String mMinute = Integer.toString(c.get(Calendar.MINUTE));\n String mHour = Integer.toString(c.get(Calendar.HOUR));\n String mSecond= Integer.toString(c.get(Calendar.SECOND));\n\n //create string for Month in words and get it based off the int\n String mMonthWord= null;\n switch(mMonth){\n case 0:\n mMonthWord= \"Jan\";\n break;\n case 1:\n mMonthWord= \"Feb\";\n break;\n case 2:\n mMonthWord= \"March\";\n break;\n case 3:\n mMonthWord= \"April\";\n break;\n case 4:\n mMonthWord= \"May\";\n break;\n case 5:\n mMonthWord= \"June\";\n break;\n case 6:\n mMonthWord= \"July\";\n break;\n case 7:\n mMonthWord= \"August\";\n break;\n case 8:\n mMonthWord= \"Sept\";\n break;\n case 9:\n mMonthWord= \"Oct\";\n break;\n case 10:\n mMonthWord= \"Nov\";\n break;\n case 11:\n mMonthWord= \"Dec\";\n }\n\n //return the DateTime String for Display\n return mHour+\":\"+mMinute+\":\"+mSecond+\" \"+mMonthWord+ \" \"+mDay+\" \"+mYear;\n\n }", "public String getDateAsString(){\n\t\t//\tGet Date\n Date date = getDate();\n if(date != null)\n \treturn backFormat.format(date);\n\t\treturn null;\n\t}", "protected abstract DateFormat getDateFormat();", "@org.jetbrains.annotations.NotNull()\n public static final java.lang.String getFormattedDate(@org.jetbrains.annotations.NotNull()\n java.util.Calendar $this$getFormattedDate, @org.jetbrains.annotations.NotNull()\n java.lang.String format) {\n return null;\n }", "String getDateString(Context context) {\n int flags = DateUtils.FORMAT_NO_NOON_MIDNIGHT | DateUtils.FORMAT_SHOW_TIME |\n DateUtils.FORMAT_ABBREV_ALL | DateUtils.FORMAT_SHOW_DATE |\n DateUtils.FORMAT_CAP_AMPM;\n return DateUtils.formatDateTime(context, mDeliveryTime, flags);\n }", "public String getDateTimeFormated(Context context){\n SimpleDateFormat sdf = new SimpleDateFormat(\"dd/MM/yyyy HH:mm:ss\"\n , context.getResources().getConfiguration().locale);\n sdf.setTimeZone(TimeZone.getDefault());\n return sdf.format(new Date(mDateTime));\n //setting the dateformat to dd/MM/yyyy HH:mm:ss which is how the date is displayed when a dream is saved\n }", "public String ConvertDate(){\r\n//\t\tDate date=JavaUtils.getSystemDate();\r\n//\t DateFormat df = new SimpleDateFormat(\"yyyy/MM/dd\");\r\n\t String pattern = \"yyyy-MM-dd\";\r\n\t SimpleDateFormat simpleDateFormat = new SimpleDateFormat(pattern);\r\n\r\n\t String date = simpleDateFormat.format(new Date());\r\n//\t System.out.println(date);\r\n\t \r\n//\t String s = df.format(date);\r\n//\t String result = s;\r\n//\t try {\r\n//\t date=df.parse(result);\r\n//\t } catch (ParseException e) {\r\n//\t // TODO Auto-generated catch block\r\n//\t e.printStackTrace();\r\n//\t }\r\n\t return date;\r\n\t }", "public static String getDisplayDateFormat(Date val) {\n\n\t\tif (val != null) {\n\n\t\t\tSimpleDateFormat format = new SimpleDateFormat(\"dd/MM/yyyy\");\n\t\t\treturn \"\" + format.format(val);\n\n\t\t} else {\n\n\t\t\treturn null;\n\n\t\t}\n\n\t}", "public static String getFormattedDate(String dateStr, String toformat)\r\n\t{\r\n\t\tString mName = \"getFormattedDate()\";\r\n\t\tIDateFormatter dateFormatter = null;\r\n\t\tDateFormatConfig dateFormat = null;\r\n\t\tString formattedDate = null;\r\n\t\tdateFormat = getDateFormat(toformat);\r\n\t\ttry\r\n\t\t{\r\n\t\t\tdateFormatter = (IDateFormatter) ResourceLoaderUtils.createInstance(dateFormat.getFormatterClass(),\r\n\t\t\t\t\t(Object[]) null);\r\n\t\t\tformattedDate = dateFormatter.formatDate(dateStr, dateFormat.getJavaDateFormat());\r\n\t\t} catch (Exception exp)\r\n\t\t{\r\n\t\t\tlogger.cterror(\"CTBAS00112\", exp, mName);\r\n\r\n\t\t}\r\n\t\treturn formattedDate;\r\n\t}", "@SuppressWarnings(\"deprecation\")\n \tprivate CharSequence getFormatClockTime(long clockTime) {\n\t\tSimpleDateFormat formatter1 = new SimpleDateFormat (\"yyyy/MM/dd\");\n\t\tSimpleDateFormat formatter2 = new SimpleDateFormat (\"MM/dd\");\n\t\tSimpleDateFormat formatter3 = new SimpleDateFormat (\"HH:mm\");\n \t\tDate dateNow = new Date();\n\t\tDate dateClock = new Date(clockTime);\n \t\tString format = \"\";\n\t\tif((dateNow.getYear() == dateClock.getYear()) && (dateNow.getMonth() ==\n\t\t\t\tdateClock.getMonth()) && (dateNow.getDate() == dateClock.getDate())){\n\t\t\tformat = formatter3.format(dateClock);\n\t\t}\n\t\telse if(dateNow.getYear() == dateClock.getYear()){\n\t\t\tformat = formatter2.format(dateClock);\n\t\t}\n\t\telse{\n\t\t\tformat = formatter1.format(dateClock);\n \t\t}\n \t\treturn format;\n \t}", "String dateToCalendarString(TimeConverter converter, AbsoluteDate date);", "String getFormat();", "String getFormat();", "String getFormat();", "public static String getDateString(){\n\t\t\tCalendar now = Calendar.getInstance();\n\t\t\tSimpleDateFormat sdf = new SimpleDateFormat(\"yyyy-MM-dd__HH-mm-ss\");\n\t\t\treturn sdf.format(now.getTime());\n\t }", "public static String getFormattedTime(Context context, Calendar time) {\n final String skeleton = DateFormat.is24HourFormat(context) ? \"EHm\" : \"Ehma\";\n final String pattern = DateFormat.getBestDateTimePattern(Locale.getDefault(), skeleton);\n return (String) DateFormat.format(pattern, time);\n }", "private String getDateTime() {\n SimpleDateFormat sdf = new SimpleDateFormat(\"[yyyy/MM/dd - HH:mm:ss]\");\n return sdf.format(new Date());\n }", "private String getDateTime() {\n SimpleDateFormat sdf = new SimpleDateFormat(\"[yyyy/MM/dd - HH:mm:ss]\");\n return sdf.format(new Date());\n }", "public String getFormatDate()\n {\n return formatDate;\n }", "java.lang.String getFromDate();", "String getSpokenDateString(Context context) {\n int flags = DateUtils.FORMAT_SHOW_TIME | DateUtils.FORMAT_SHOW_DATE;\n return DateUtils.formatDateTime(context, mDeliveryTime, flags);\n }", "public static String formatDateToDD_MM_YY_hh_mm(Calendar calDate)\r\n\t{\r\n\t\tint day = calDate.get(Calendar.DAY_OF_MONTH);\r\n\t\tint month = calDate.get(Calendar.MONTH)+1;\r\n\t\tString year = String.valueOf(calDate.get(Calendar.YEAR)).substring(2);\r\n\t\tint hour = calDate.get(Calendar.HOUR_OF_DAY);\r\n\t\tint minute = calDate.get(Calendar.MINUTE);\r\n\t\t\r\n\t\treturn appendLeadingZero(day) + \"/\" + appendLeadingZero(month) + \"/\" + year + \" \" + appendLeadingZero(hour) + \":\" + appendLeadingZero(minute);\r\n\t}", "private String getFormattedDate(String date) {\n SimpleDateFormat dateFormat = new SimpleDateFormat(getString(R.string.received_import_date_format));\n SimpleDateFormat desiredDateFormat = new SimpleDateFormat(getString(R.string.desired_import_date_format));\n Date parsedDate;\n try {\n parsedDate = dateFormat.parse(date);\n return desiredDateFormat.format(parsedDate);\n } catch (ParseException e) {\n // Return an empty string in case of issues parsing the date string received.\n e.printStackTrace();\n return \"\";\n }\n }", "private static java.text.SimpleDateFormat getFormatter() {\r\n\r\n\t\treturn getDBLayer().getDateFormatter();\r\n\t}", "public static String getDateTime(){\n String pattern = \"MM/dd/yyyy HH:mm:ss\";\n DateFormat df = new SimpleDateFormat(pattern);\n Date today = Calendar.getInstance().getTime();\n String todayAsString = df.format(today);\n return todayAsString;\n }", "public static java.lang.String getDateFormat() {\r\n\t\treturn getDBLayer().getDateFormat();\r\n\t}", "String getDate();", "String getDate();", "public static String formatDate(Calendar date, DateFormat format) {\n\n switch (format) {\n case COMPLETE_DATE_FORMAT:\n format = DateFormat.COMPLETE_DATE_FORMAT;\n break;\n case DAY_FORMAT:\n format = DateFormat.DAY_FORMAT;\n break;\n }\n\n SimpleDateFormat dateFormatter = new SimpleDateFormat(format.getFormat(), Locale.US);\n\n return dateFormatter.format(date.getTime());\n }", "private String leerFecha() {\n\t\ttry {\n\t\t\tSimpleDateFormat sdf = new SimpleDateFormat(\"YYYY/MM/dd\");\n\t\t\treturn sdf.format(txtFecha.getDate());\n\t\t} catch (Exception e) {\n\t\t\tJOptionPane.showMessageDialog(this, \"Seleccione una fecha válida\", \"Aviso\", 2);\n\t\t\treturn null;\n\t\t}\n\t}", "private static SimpleDateFormat getDateFormat() {\r\n\t\tif(dateFormat == null)\r\n\t\t\tdateFormat = new SimpleDateFormat(\"dd/MM/yyyy\");\r\n\t\treturn dateFormat;\r\n\t}", "private String getFecha() {\n\t\tLocalDateTime myDateObj = LocalDateTime.now();\n\t\tDateTimeFormatter myFormatObj = DateTimeFormatter.ofPattern(\"dd-MM-yyyy HH:mm:ss\");\n\t\tString formattedDate = myDateObj.format(myFormatObj);\n \n\t\treturn formattedDate;\n }", "private String getDateTime() {\n SimpleDateFormat sdf = new SimpleDateFormat(\"[yyyy/MM/dd - HH:mm:ss]\");\n return sdf.format(new Date());\n }", "public String DateFormatted(){\n\t\tSimpleDateFormat simDate = new SimpleDateFormat(\"E, dd/MM/yy hh:mm:ss a\");\n\t\treturn simDate.format(date.getTime());\n\t}", "public static String dateDisplay(Calendar cal) {\n\t\tLONGDAYS[] arrayOfDays = LONGDAYS.values();\n\t\tString toReturn = cal.get(Calendar.MONTH)+1 + \"/\" + cal.get(Calendar.DAY_OF_MONTH);\n\t\ttoReturn = arrayOfDays[cal.get(Calendar.DAY_OF_WEEK)-1] + \" \" + toReturn;\n\t\treturn toReturn;\n\t}", "@Override\n\tpublic String[] getFormats() {\n\t\treturn new String[] {\"yyyy-MM-dd'T'HH:mm:ss\",\"yyyy-MM-dd HH:mm:ss\",\"yyyy-MM-dd HH:mm\",\"yyyy-MM-dd'T'HH:mm\",\"yyyy-MM-dd HH\", \"yyyy-MM-dd\" };\n\t}", "@Override\r\n\t\t\t\tpublic String valueToString(Object value) throws ParseException {\n\t\t\t\t\tif(value != null) {\r\n\t\t\t\t\tCalendar cal=(Calendar) value;\r\n\t\t\t\t\tSimpleDateFormat format = new SimpleDateFormat(\"dd-MMM-yyyy\");\r\n\t\t\t\t\tString strDate=format.format(cal.getTime());\r\n\t\t\t\t\treturn strDate;\r\n\t\t\t\t\t}\r\n\t\t\t\t\treturn \" \";\r\n\t\t\t\t}", "java.lang.String getDatesEmployedText();", "private String getDate(Calendar c) {\n\t\t\n\t\tStringBuffer sb = new StringBuffer();\n\t\t\n\t\tsb.append(EventHelper.getMonth(c));\n\t\tsb.append(\" \");\n\t\tsb.append(EventHelper.getDate(c));\n\t\t\n\t\treturn sb.toString();\n\t\t\n\t}", "public static String formatDate(Calendar calDate)\r\n\t{\r\n\t\tint intDate = calDate.get(Calendar.DAY_OF_MONTH);\r\n\t\tString dateSuffix = getDateSuffix(intDate);\r\n\t\treturn getCalendarMonthString(calDate.get(Calendar.MONTH))+\" \"+ intDate + dateSuffix + \" \" + calDate.get(Calendar.YEAR);\r\n\t}", "java.lang.String getStartDateYYYYMMDD();", "public SimpleDateFormat getDateFormat(HttpServletRequest req) {\n\t\treturn new SimpleDateFormat(DateUtil.getDatePattern(getResourceBundle(req)), Constants.DEF_LOCALE_NUMBER);\n\t}", "public String getEntryDateString() {\n SimpleDateFormat sdf = new SimpleDateFormat(\"yyyy MMM dd\");\n return sdf.format(entryDate.getTime());\n }", "public String getFechatxt(Date d){\n \n try {\n String formato = selectorfecha.getDateFormatString();\n //Formato\n \n SimpleDateFormat sdf = new SimpleDateFormat(formato);\n String txtfechap = sdf.format(d);\n return txtfechap;\n } catch (NullPointerException ex) {\n JOptionPane.showMessageDialog(this, \"Al menos selecciona una fecha válida!\", \"Error!\", JOptionPane.INFORMATION_MESSAGE);\n return null;\n\n }\n\n\n \n }", "public static String formatDateToDD_MM_YYYY_hh_mm(Calendar calDate)\r\n\t{\r\n\t\tint day = calDate.get(Calendar.DAY_OF_MONTH);\r\n\t\tint month = calDate.get(Calendar.MONTH)+1;\r\n\t\tString year = String.valueOf(calDate.get(Calendar.YEAR));\r\n\t\tint hour = calDate.get(Calendar.HOUR_OF_DAY);\r\n\t\tint minute = calDate.get(Calendar.MINUTE);\r\n\t\t\r\n\t\treturn appendLeadingZero(day) + \"/\" + appendLeadingZero(month) + \"/\" + year + \" \" + appendLeadingZero(hour) + \":\" + appendLeadingZero(minute);\r\n\t}", "public String retornaData(){\n\t\tCalendar calendar = new GregorianCalendar();\n\t\tSimpleDateFormat df = new SimpleDateFormat(\"dd/MM/yyyy\");\n\t\tDate date = new Date();\n\t\tcalendar.setTime(date);\n\t\treturn df.format(calendar.getTime());\n\t}", "public static DateFormatConfig getDateFormat(String toformat)\r\n\t{\r\n\t\tString mName = \"getDateFormat()\";\r\n\t\tDateFormatConfig dateFormat = null;\r\n\t\t// look up in DateFormatRegistry with toformat(dateId) and it returns DateFormatConfig object\r\n\t\tDateFormatRegistry datefrmtRegistry = DateFormatRegistry.getInstance();\r\n\t\ttry\r\n\t\t{\r\n\t\t\tdateFormat = (DateFormatConfig) datefrmtRegistry.lookup(toformat);\r\n\t\t} catch (Exception e)\r\n\t\t{\r\n\t\t\tlogger.cterror(\"CTBAS00110\", e, mName);\r\n\t\t}\r\n\t\treturn dateFormat;\r\n\r\n\t}", "public String getSystemDateTime() {\n\t\tjava.text.SimpleDateFormat sdfDate = new java.text.SimpleDateFormat(\"yyyy/MM/dd\");\n java.text.SimpleDateFormat sdfTime = new java.text.SimpleDateFormat(\"HH:mm\");\n Date now = new Date();\n String strDate = sdfDate.format(now);\n String strTime = sdfTime.format(now);\n System.out.println(\"Date: \" + strDate);\n System.out.println(\"Time: \" + strTime); \n return \"date\"+strDate+\" \"+strTime;\n\t}", "public String getFormatedDate() {\n DateFormat displayFormat = new SimpleDateFormat(\"EEEE', ' dd. MMMM yyyy\", Locale.GERMAN);\n return displayFormat.format(mEvent.getTime());\n }", "public static DateFormat defaultFormat() {\n return convertFormat(Locale.getDefault(), \"dd/MM/yyyy hh:mma\");\n }", "public String changeDateTimeFormat(String dateStr) {\n String inputPattern = \"MMM-dd-yyyy hh:mm a\";\n String outputPattern = \"MMMM dd, yyyy hh:mm a\";\n SimpleDateFormat inputFormat = new SimpleDateFormat(inputPattern);\n SimpleDateFormat outputFormat = new SimpleDateFormat(outputPattern);\n\n Date date = null;\n String str = null;\n\n try {\n date = inputFormat.parse(dateStr);\n str = outputFormat.format(date);\n } catch (ParseException e) {\n e.printStackTrace();\n }\n return str;\n\n }", "private String getDateTime() {\n SimpleDateFormat dateFormat = new SimpleDateFormat(\"dd.MM.yyyy\", Locale.GERMANY);\n Date date = new Date();\n return dateFormat.format(date);\n }", "String dateToString(TimeConverter converter, AbsoluteDate date);", "public static String convertDateFormat (String dateStr, String fromFormatPattern, String toFormatPattern) {\n\t\tDateFormat fromFormat = new SimpleDateFormat(fromFormatPattern);\n\t\tDateFormat toFormat = new SimpleDateFormat(toFormatPattern);\n\t\ttoFormat.setLenient(false);\n\t\tDate date;\n\t\ttry {\n\t\t\tdate = fromFormat.parse(dateStr);\n\t\t\treturn toFormat.format(date);\n\t\t} catch (ParseException e) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\tLog.d(\"ERROR\", \"Date formatting Error\");\n\t\t}\n\t\treturn null;\n\t}", "protected String getRentDateString() { return \"\" + dateFormat.format(this.rentDate); }", "private String getActivationDate(String csStatChng) {\r\n\t\t\r\n\t\tString activationDate = \"\";\r\n\t\t\r\n\t\tif (csStatChng != null) {\r\n\t\t\tint lastIndexOf = csStatChng.lastIndexOf(ACTIVATE_STATE);\r\n\t\t\t\r\n\t\t\ttry {\r\n\t\t\t\tactivationDate = DateFormat.format(csStatChng.substring(lastIndexOf-6, lastIndexOf), \"yymmdd\", \"dd/mm/yyyy\");\r\n\t\t\t} catch (ParseException e) {\r\n\t\t\t\tlog.error(\"Erro encontrado no XML de resposta do Infobus.\", e);\r\n\t\t\t\tthrow new ErrorMessageException(\"Erro encontrado no XML de resposta do Infobus.\", e);\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\treturn activationDate;\t\r\n\t}", "public String getTimeAndDate() {\n\t\t\tDateFormat dateFormat = new SimpleDateFormat(\"dd MMM hh:mm\");\n\t\t\tCalendar cal = Calendar.getInstance();\n\t\t\tString dateAndTime = dateFormat.format(cal.getTime());\n\t\t\treturn dateAndTime;\n\t\t}", "public String getStringDate(){\n String finalDate = \"\";\n Locale usersLocale = Locale.getDefault();\n DateFormatSymbols dfs = new DateFormatSymbols(usersLocale);\n String weekdays[] = dfs.getWeekdays();\n int day = date.get(Calendar.DAY_OF_WEEK);\n String nameOfDay = weekdays[day];\n\n finalDate += nameOfDay + \" \" + date.get(Calendar.DAY_OF_MONTH) + \", \";\n\n String months[] = dfs.getMonths();\n int month = date.get(Calendar.MONTH);\n String nameOfMonth = months[month];\n\n finalDate += nameOfMonth + \", \" + date.get(Calendar.YEAR);\n\n return finalDate;\n }", "public synchronized static DateFormat getDateTimeFormat()\n\t{\n\t\treturn DATE_TIME_FORMAT;\n\t}", "public SimpleDateFormat getDateFormat(int displayType, Language language, String pattern) {\n\t\treturn null;\n\t}", "public String getDateCreationLibelle() {\n\t\tDateTimeFormatter format = DateTimeFormatter.ofPattern(\"dd/MM/yyyy hh:mm:ss\");\n\t\treturn this.dateCreation.format(format);\n\t}", "public String getDateFormatString() {\n return this.dateFormatString;\n }", "public static String convertCalToBrokerTime(Calendar cal) {\r\n String result = \"\";\r\n Calendar gmtCal = DTUtil.convertToLondonCal(cal);\r\n SimpleDateFormat format1 = new SimpleDateFormat(\"yyyyMMdd HH:mm:ss\");\r\n String timeFMString = format1.format(gmtCal.getTime()) + \" GMT\";\r\n result = timeFMString;\r\n return result;\r\n }", "@Override\n\tpublic StringBuffer format(Calendar cal, final StringBuffer toAppendTo, final FieldPosition pos) {\n\t\tTimeZone backupTZ = null;\n\t\tif (cal != calendar && !cal.getType().equals(calendar.getType())) {\n\t\t\t// Different calendar type\n\t\t\t// We use the time and time zone from the input calendar, but\n\t\t\t// do not use the input calendar for field calculation.\n\t\t\tcalendar.setTimeInMillis(cal.getTimeInMillis());\n\t\t\tbackupTZ = calendar.getTimeZone();\n\t\t\tcalendar.setTimeZone(cal.getTimeZone());\n\t\t\tcal = calendar;\n\t\t}\n\t\tStringBuffer result = format(cal, capitalizationSetting, toAppendTo, pos, null);\n\t\tif (backupTZ != null) {\n\t\t\t// Restore the original time zone\n\t\t\tcalendar.setTimeZone(backupTZ);\n\t\t}\n\t\treturn result;\n\t}", "public String getGUITimestampFormat();", "public static String getDateFormatForFileName() {\n final DateFormat sdf = new SimpleDateFormat(\"yyyyMMdd_HH-mm-ss\");\n return sdf.format(new Date());\n }", "public static String formatterDate(Date date){\n\t\tString retour = null;\n\t\tif(date != null){\n\t\t\tretour = dfr.format(date);\n\t\t}\n\t\treturn retour;\n\t}", "@Method(selector = \"stringFromDate:toDate:\")\n public native String format(NSDate fromDate, NSDate toDate);", "protected String getDateTimeString(String input) {\n String result;\n DateTimeFormatter datePattern = DateTimeFormatter.ofPattern(\"MMM dd yyyy\");\n if (dateTime == null) {\n result = input;\n } else {\n String date = getDate().format(datePattern);\n String time = getTime().toString();\n result = date + Constants.SPACE + time;\n }\n return result;\n }", "public static String TimeFormate() {\n\t\tString time;\n\t\tSimpleDateFormat dateFormat1 = new SimpleDateFormat();\n\t dateFormat1.setTimeZone(TimeZone.getTimeZone(\"US/Eastern\"));\n\t Calendar cal = Calendar.getInstance();\n\t cal.add(Calendar.MINUTE, 3);\n String n=dateFormat1.format(cal.getTime());\n //n=\"03/09/20 8:30 AM\";\n System.out.println(\"Full Date = \" +n);\n int colonindex=n.indexOf(\":\");\n //System.out.println(\": placed= \" +colonindex);\n //String tt =n.substring(colonindex, n.length());\n //System.out.println(\"tt= \" +tt);\n String tt1 =n.substring(colonindex-2,colonindex-1);\n System.out.println(\"tt1= \" +tt1);\n if(tt1.equals(\"1\")) {\n \t time=n.substring(colonindex-2, n.length());\n \t System.out.println(\"Time with two digits in hours= \" +time);\n }\n else {\n \t time=n.substring(colonindex-1, n.length());\n \t System.out.println(\"Time with one digit in hours= \" +time);\n }\n return time;\n\t}", "public static String convertDateToSend(String gotdate){\n Calendar calendar = Calendar.getInstance();\n calendar.setTimeInMillis(Long.parseLong(gotdate));\n SimpleDateFormat inputFormat = new SimpleDateFormat(\"yyyyMMddHHmmss\");\n SimpleDateFormat outputFormat = new SimpleDateFormat(\"dd MMM yyyy\");\n /*Date parsedDate = null;\n try {\n parsedDate = inputFormat.parse(gotdate);\n } catch (ParseException e) {\n e.printStackTrace();\n }*/\n String formattedDate = outputFormat.format(calendar.getTime());\n return formattedDate;\n }", "public String getDateFormats()\n {\n return dateFormats;\n }", "private static String getReadableDateString(Context context, long timeInMillis) {\n int flags = DateUtils.FORMAT_SHOW_DATE\n | DateUtils.FORMAT_NO_YEAR\n | DateUtils.FORMAT_SHOW_WEEKDAY;\n\n return DateUtils.formatDateTime(context, timeInMillis, flags);\n }", "public static String getDateAndTimeString(String format, Date date)\r\n\t{\r\n\r\n\t\tSimpleDateFormat simpleDateFormat = new SimpleDateFormat(format);\r\n\t\tString dateandtime = \"\";\r\n\t\ttry\r\n\t\t{\r\n\t\t\tdateandtime = simpleDateFormat.format(date);\r\n\t\t} catch (Exception e)\r\n\t\t{\r\n\t\t\tlogger.cterror(\"CTBAS00119\", e, format);\r\n\t\t}\r\n\t\treturn dateandtime;\r\n\t}", "public static String getDisplayFullDateFormat(Date val) {\n\n\t\tif (val != null) {\n\n\t\t\tSimpleDateFormat format = new SimpleDateFormat(\n\t\t\t\t\t\"EEEE, MMMMM dd, yyyy\");\n\t\t\treturn \"\" + format.format(val);\n\n\t\t} else {\n\n\t\t\treturn null;\n\n\t\t}\n\n\t}", "private static String getTime() {\n\t\tDate getDate = new Date();\n\t\tString timeFormat = \"M/d/yy hh:mma\";\n\t\tSimpleDateFormat sdf = new SimpleDateFormat(timeFormat);\n\t\treturn \"[\" + sdf.format(getDate) + \"]\\t\";\n\t}", "private String ObtenerFechaActual() {\n SimpleDateFormat simpleDateFormat = new SimpleDateFormat(\"dd/mm/yyyy\");\n Calendar calendar = GregorianCalendar.getInstance();\n return String.valueOf(simpleDateFormat.format(calendar.getTime()));\n }" ]
[ "0.69490564", "0.68759006", "0.67171377", "0.66043967", "0.6568671", "0.6440583", "0.6418776", "0.6369004", "0.6311322", "0.62576216", "0.6242972", "0.62424606", "0.62273467", "0.6185505", "0.61707014", "0.6167024", "0.615411", "0.614449", "0.6142602", "0.6117073", "0.6091437", "0.60863", "0.6083741", "0.60825884", "0.6082033", "0.60766757", "0.60678416", "0.60639054", "0.6056275", "0.6055445", "0.6043589", "0.6016331", "0.6012674", "0.5999053", "0.5998397", "0.5998397", "0.5998397", "0.5996505", "0.5990175", "0.59856856", "0.59856856", "0.59820575", "0.59769744", "0.5974735", "0.5965137", "0.5960159", "0.5952831", "0.59485996", "0.5948591", "0.5935385", "0.5935385", "0.59280354", "0.59262526", "0.59192806", "0.59162563", "0.59093904", "0.5903474", "0.5889418", "0.5871231", "0.58670765", "0.5856011", "0.5840555", "0.5837592", "0.5817601", "0.58135706", "0.5803635", "0.58003217", "0.57693106", "0.5767637", "0.5767204", "0.57667005", "0.57291293", "0.5728296", "0.57275975", "0.57194746", "0.57068974", "0.57026076", "0.56881386", "0.56833816", "0.56710833", "0.5667278", "0.56669664", "0.56559163", "0.56546474", "0.5650938", "0.56489074", "0.5645762", "0.5645495", "0.56332666", "0.5627719", "0.5626058", "0.5624185", "0.56145024", "0.5602239", "0.56005484", "0.55964065", "0.55945957", "0.55916667", "0.55897534", "0.5576414" ]
0.5903315
57
method to get calender object based on datetime provided as parameter
public Calendar GetCalendar(String sDateTime) throws Exception { String YYYY = "", MM = "", DD = "", hh = "", mm = "", ss = ""; Calendar calendarInstance = null; try { //considering deafult date format as YYYY-MM-DD hh:mm:ss (e.g 2012-11-21 23:59:30) sDateTime = sDateTime.trim(); if (sDateTime.equalsIgnoreCase("")) { throw new Exception("Blank datetime value"); } YYYY = sDateTime.substring(0, 4); MM = sDateTime.substring(5, 7); DD = sDateTime.substring(8, 10); hh = sDateTime.substring(11, 13); mm = sDateTime.substring(14, 16); ss = sDateTime.substring(17, 19); MM = "" + (Integer.parseInt(MM) - 1); if (MM.length() < 2) { MM = "0" + MM; } calendarInstance = Calendar.getInstance(); calendarInstance.set(Integer.parseInt(YYYY), Integer.parseInt(MM), Integer.parseInt(DD), Integer.parseInt(hh), Integer.parseInt(mm), Integer.parseInt(ss)); return calendarInstance; } catch (Exception e) { throw new Exception("SetCalendar : " + e.toString()); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "Calendar getCalendar();", "abstract public Date getServiceAppointment();", "Date getForDate();", "public StockDate GetCalendar()\r\n\t{\r\n\t\treturn date;\r\n\t}", "public static Calendar getCalender(Date date) {\n\n Calendar calendar = Calendar.getInstance();\n\n if (date != null) {\n long millis = date.getTime();\n calendar.setTimeInMillis(millis);\n }\n\n return calendar;\n }", "private Date getFrom(RuleTypes.HistoricRequirements ph) {\n Calendar date = new GregorianCalendar();\n date.set(Calendar.HOUR_OF_DAY, 0);\n date.set(Calendar.MINUTE, 0);\n date.set(Calendar.SECOND, 0);\n date.set(Calendar.MILLISECOND, 0);\n int today;\n\n switch(ph) {\n case TODAY:\n return date.getTime();\n case YESTERDAY:\n date.add(Calendar.DAY_OF_MONTH, -1);\n return date.getTime();\n case THIS_WEEK:\n today = date.get(Calendar.DAY_OF_WEEK);\n date.add(Calendar.DAY_OF_WEEK,-today+Calendar.MONDAY);\n return date.getTime();\n case LAST_WEEK:\n today = date.get(Calendar.DAY_OF_WEEK);\n date.add(Calendar.DAY_OF_WEEK,-today+Calendar.MONDAY);\n date.add(Calendar.DAY_OF_MONTH, -7);\n return date.getTime();\n case THIS_MONTH:\n date.set(Calendar.DAY_OF_MONTH, date.getActualMinimum(Calendar.DAY_OF_MONTH));\n return date.getTime();\n case LAST_MONTH:\n date.set(Calendar.DAY_OF_MONTH, date.getActualMinimum(Calendar.DAY_OF_MONTH));\n date.add(Calendar.MONTH, -1);\n return date.getTime();\n case T12_HRS:\n date = new GregorianCalendar();\n date.add(Calendar.HOUR, -12);\n return date.getTime();\n case T24_HRS:\n date = new GregorianCalendar();\n date.add(Calendar.HOUR, -24);\n return date.getTime();\n case T2_DAYS:\n date = new GregorianCalendar();\n date.add(Calendar.HOUR, -48);\n return date.getTime();\n case T3_DAYS:\n date = new GregorianCalendar();\n date.add(Calendar.HOUR, -72);\n return date.getTime();\n case T4_DAYS:\n date = new GregorianCalendar();\n date.add(Calendar.HOUR, -96);\n return date.getTime();\n case T5_DAYS:\n date = new GregorianCalendar();\n date.add(Calendar.HOUR, -120);\n return date.getTime();\n case T6_DAYS:\n date = new GregorianCalendar();\n date.add(Calendar.HOUR, -144);\n return date.getTime();\n case T7_DAYS:\n date = new GregorianCalendar();\n date.add(Calendar.HOUR, -168);\n return date.getTime();\n }\n return null;\n }", "public Calendar toCalendar(){\r\n\t\tSimpleDateFormat[] formats = new SimpleDateFormat[] {\r\n\t\t\t\tYYYY_MM_DD_FORMATTER, YYYY_MMT_DD_T_HH_MM_FORMATTER,\r\n\t\t\t\tYYYY_MMT_DD_T_HH_MM_SS_FORMATTER };\r\n\t\tfor (SimpleDateFormat format : formats) {\r\n\t\t\ttry {\r\n\t\t\t\tDate date = format.parse(this.timeString);\r\n\t\t\t\tCalendar calendar = Calendar.getInstance();\r\n\t\t\t\tcalendar.setTime(date);\r\n\t\t\t\treturn calendar;\r\n\t\t\t} catch (ParseException e) {\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn null;\r\n\t}", "Calendar registeredAt();", "public Calendar calendario(Date date) {\r\n Calendar calendar = Calendar.getInstance();\r\n calendar.setTime(date);\r\n return calendar;\r\n }", "public PickDateTime(Calendar cal) {\n\t\tjbInit();\n\t}", "public interface DateInfo {\n\n String getDateFormat();\n\n Calendar getTodayCalendar();\n\n}", "public static Calendar getCalendar(Date date) {\n\t\tCalendar cal = Calendar.getInstance();\r\n\t\tif (date != null) {\r\n\t\t\tcal.setTime(date);\r\n\t\t} else {\r\n\t\t\tcal.setTime(new Date());\r\n\t\t}\r\n\t\treturn cal;\r\n\t}", "public static GregorianCalendar getCalendar(String dateTime)\n\t{\n\t\tGregorianCalendar gc = new GregorianCalendar();\n\t\tDate date = parseDateTime(dateTime);\n\t\tgc.setTime(date);\n\t\t\n\t\treturn gc;\n\t}", "private void createCalendar() {\n myCALENDAR = Calendar.getInstance();\r\n DAY = myCALENDAR.get(Calendar.DAY_OF_MONTH);\r\n MONTH = myCALENDAR.get(Calendar.MONTH) + 1;\r\n YEAR = myCALENDAR.get(Calendar.YEAR);\r\n HOUR = myCALENDAR.get(Calendar.HOUR_OF_DAY);\r\n MINUTE = myCALENDAR.get(Calendar.MINUTE);\r\n SECOND = myCALENDAR.get(Calendar.SECOND);\r\n }", "Calendar getArrivalDateAndTime();", "public Calendar getCurrentMonthCalendarObj() throws Throwable{\r\n\r\n\t\tString dateInput = \"01/\"+month+\"/\"+year;\t\t\t\r\n\t\tDateFormat df = new SimpleDateFormat(\"dd/MMMM/yyyy\");\r\n\t\tDate startDate = df.parse(dateInput);\r\n\t\tCalendar c = Calendar.getInstance(); // this takes current date\r\n\t c.setTime(startDate); // set date to specified in arguement\r\n\t\treturn c;\r\n\t}", "private void getIntialCalender() {\n\n\t\ttry {\n\n\t\t\tc = Calendar.getInstance();\n\t\t\tString[] fields = Global_variable.str_booking_date.split(\"[-]\");\n\n\t\t\tString str_year = fields[0];\n\t\t\tString str_month = fields[1];\n\t\t\tString str_day = fields[2];\n\n\t\t\tSystem.out.println(\"!!!!\" + fields[0]);\n\t\t\tSystem.out.println(\"!!!!\" + fields[1]);\n\t\t\tSystem.out.println(\"!!!!!\" + fields[2]);\n\n\t\t\tif (str_year.length() != 0) {\n\t\t\t\tyear = Integer.parseInt(str_year);\n\t\t\t} else {\n\t\t\t\tyear = c.get(Calendar.YEAR);\n\t\t\t}\n\n\t\t\tif (str_month.length() != 0) {\n\t\t\t\tmonth = Integer.parseInt(str_month) - 1;\n\t\t\t} else {\n\t\t\t\tmonth = c.get(Calendar.MONTH);\n\t\t\t}\n\n\t\t\tif (str_year.length() != 0) {\n\t\t\t\tday = Integer.parseInt(str_day);\n\t\t\t} else {\n\t\t\t\tday = c.get(Calendar.DAY_OF_MONTH);\n\t\t\t}\n\n\t\t\tString[] fields1 = Global_variable.str_booking_time.split(\"[:]\");\n\n\t\t\tString str_hour = fields1[0];\n\t\t\tString str_minutes = fields1[1];\n\n\t\t\tSystem.out.println(\"!!!!!\" + fields1[0]);\n\t\t\tSystem.out.println(\"!!!!!\" + fields1[1]);\n\n\t\t\tif (str_hour.length() != 0) {\n\t\t\t\thour = Integer.parseInt(str_hour);\n\t\t\t} else {\n\t\t\t\thour = c.get(Calendar.HOUR_OF_DAY);\n\t\t\t}\n\n\t\t\tif (str_minutes.length() != 0) {\n\t\t\t\tminutes = Integer.parseInt(str_minutes);\n\t\t\t} else {\n\t\t\t\tminutes = c.get(Calendar.MINUTE);\n\t\t\t}\n\n\t\t\tcurrDate = new java.sql.Date(System.currentTimeMillis());\n\n\t\t\tSimpleDateFormat sdf = new SimpleDateFormat(\"yyyy-MM-dd\");\n\t\t\tCalendar c1 = Calendar.getInstance();\n\t\t\tc1.setTime(new Date()); // Now use today date.\n\t\t\tc1.add(Calendar.DATE, 30); // Adding 30 days\n\t\t\toutput = sdf.format(c1.getTime());\n\t\t\tSystem.out.println(\"!!!!!!!!!!!!!!!\" + output);\n\n\t\t} catch (NullPointerException e) {\n\t\t\te.printStackTrace();\n\t\t}\n\n\t}", "public static Calendar getCalendar(Date date) {\n Calendar cal = Calendar.getInstance();\n cal.setTime(date);\n return cal;\n }", "public void get_fecha(){\n //Obtenemos la fecha\n Calendar c1 = Calendar.getInstance();\n fecha.setCalendar(c1);\n }", "public static Calendar getCalender(String val, String format) {\n Calendar calendar = Calendar.getInstance();\n\n SimpleDateFormat dateFormat = getSimpleDateFormat(format);\n\n try {\n\n Date date = dateFormat.parse(val);\n if (date != null) {\n long millis = date.getTime();\n calendar.setTimeInMillis(millis);\n }\n } catch (Exception e) {\n\n Log.e(\"getCalender\", \"ex1\"+\"===\"+val+\"===\"+format+\"===\"+ e);\n e.printStackTrace();\n }\n\n return calendar;\n }", "protected Calendar getCurrentCalendar() {\n Calendar current = new Calendar();\n\n java.util.Calendar calendar = java.util.Calendar.getInstance();\n SimpleDateFormat dateFormatHour = new SimpleDateFormat(\"H\");\n SimpleDateFormat dateFormatWeekDay = new SimpleDateFormat(\"E\");\n SimpleDateFormat dateFormatMonth = new SimpleDateFormat(\"MMM\");\n\n current.setHour(dateFormatHour.format(calendar.getTime()).toString());\n current.setWeekday(dateFormatWeekDay.format(calendar.getTime()));\n current.setMonth(dateFormatMonth.format(calendar.getTime()));\n\n return current;\n }", "public Calendar getCal() {\n return cal;\n }", "public Calendar getCalendar() {\n Calendar c = Calendar.getInstance();\n c.setTime(cal.getTime());\n return c;\n }", "public Calendar getCalendar() {\n return cal;\n }", "public static Calendar getCalender(Long val) {\n\n Calendar calendar = Calendar.getInstance();\n calendar.setTimeInMillis(val);\n\n return calendar;\n }", "abstract GregorianCalendar getThreadLocalCalendar();", "Calendar toCalendar();", "Calendar toCalendar();", "DateCalculator<E> getDateCalculator(String name, String holidayHandlerType);", "public static Date createDate(int yyyy, int month, int day) {\n/* 75 */ CALENDAR.clear();\n/* 76 */ CALENDAR.set(yyyy, month - 1, day);\n/* 77 */ return CALENDAR.getTime();\n/* */ }", "public static Date createDate(int yyyy, int month, int day, int hour, int min) {\n/* 93 */ CALENDAR.clear();\n/* 94 */ CALENDAR.set(yyyy, month - 1, day, hour, min);\n/* 95 */ return CALENDAR.getTime();\n/* */ }", "public static final Calendar getCalendar(int date, int month, int year) {\r\n\t\tCalendar cal = Calendar.getInstance(); // locale-specific\r\n\t\t// cal.setTime(dateObject);\r\n\t\tcal.set(Calendar.HOUR_OF_DAY, 0);\r\n\t\tcal.set(Calendar.MINUTE, 0);\r\n\t\tcal.set(Calendar.SECOND, 0);\r\n\t\tcal.set(Calendar.MILLISECOND, 0);\r\n\r\n\t\tcal.set(Calendar.DATE, date);\r\n\t\tcal.set(Calendar.MONTH, month);\r\n\t\tcal.set(Calendar.YEAR, year);\r\n\t\treturn cal;\r\n\t}", "public Calendar forDate(Date date) {\r\n\r\n\t\tCalendar c2 = Calendar.getInstance(baseCalendar.getTimeZone());\r\n\t\tc2.setTime(date);\r\n\r\n\t\treturn c2;\t\t\r\n\t}", "private Calendar setAssignmentDeadlineCalendar() {\n SimpleDateFormat sdf = new SimpleDateFormat(\"dd/MM/yyyy HHmm\");\n Date date = null;\n try {\n date = sdf.parse(assignmentDeadline);\n } catch (ParseException e) {\n e.printStackTrace();\n }\n Calendar assignmentDeadlineCalendar = Calendar.getInstance();\n assignmentDeadlineCalendar.setTime(date);\n return assignmentDeadlineCalendar;\n }", "private Calendar createNewCalendar(String dateAndTime) {\n // initiate a calendar\n Calendar calendar = Calendar.getInstance();\n // take the given dateandTime string and split it into the different values\n String date = dateAndTime.split(\" \")[0];\n String time = dateAndTime.split(\" \")[1];\n int year = Integer.valueOf(date.split(\"-\")[0]);\n int month = Integer.valueOf(date.split(\"-\")[1]) - 1;\n int day = Integer.valueOf(date.split(\"-\")[2]);\n int hour = Integer.valueOf(time.split(\":\")[0]);\n int min = Integer.valueOf(time.split(\":\")[1]);\n // set the calendar to the wanted values\n calendar.set(year, month, day, hour, min);\n return calendar;\n }", "public abstract CalendarEvent getEventById(User user, String id);", "public BwCalendar getCalendar() {\n if (calendar == null) {\n calendar = new BwCalendar();\n }\n\n return calendar;\n }", "public static Calendar dateToCalendar(Date date){ \r\n Calendar cal = Calendar.getInstance();\r\n cal.setTime(date);\r\n return cal;\r\n }", "private static Calendar createCalendar(int year, int month, int date) {\r\n\t\tCalendar calendar = Calendar.getInstance();\r\n\t\tcalendar.setLenient(false);\r\n\t\tcalendar.set(Calendar.YEAR, year);\r\n\t\tcalendar.set(Calendar.MONTH, month - 1);\r\n\t\tcalendar.set(Calendar.DAY_OF_MONTH, date);\r\n\t\tcalendar.set(Calendar.MINUTE, 0);\r\n\t\tcalendar.set(Calendar.HOUR_OF_DAY, 0);\r\n\t\tcalendar.set(Calendar.SECOND, 0);\r\n\t\treturn calendar;\r\n\t}", "public Calendar getDate() {\r\n return (Calendar) selectedDate;\r\n }", "public ICalendar getCalendar() {\n return calendar;\n }", "@Override\n\tpublic org.sakaiproject.calendar.api.Calendar getCalendar(String ref)\n\t\t\tthrows IdUnusedException, PermissionException {\n\t\tSite site = null;\n\t\tif (ref == null){\n\t\t\tsite = getSite();\n\t\t}\n\t\telse{\n\t\t\tsite = getSite(ref);\n\t\t}\n\t\t// We use the e-mail id of the site creator since the Google calendar is created under this id.\n\t\tCalendar googleClient = getGoogleClient(site.getCreatedBy().getEmail());\n\t\treturn new SakaiGCalendarImpl(googleClient);\n\t}", "private static Calendar getCalendar(final Long timeInMilliseconds, final TimeZone timeZone) {\n\n final Calendar calendar = Calendar.getInstance(timeZone);\n calendar.setTimeInMillis(timeInMilliseconds);\n\n return calendar;\n }", "@Override\n\tpublic YFCDocument invoke(YFCDocument inXml) {\n\t\tYFCElement calInEle = inXml.getDocumentElement();\n\t\tList<String> exceptionList = new ArrayList<>();\n\t\tYFCIterable<YFCElement> eleCalendar = calInEle.getChildren(XMLLiterals.CALENDAR);\n\t\tString organizationCode = \"\";\n\t\tfor(YFCElement eleCal : eleCalendar) {\n\t\t\tif(XmlUtils.isVoid(organizationCode)) {\n\t\t\t\torganizationCode=eleCal.getAttribute(XMLLiterals.ORGANIZATION_CODE);\n\t\t\t\tString sEffectiveFromDate = dateFormatter(eleCal.getAttribute(XMLLiterals.EFFECTIVE_FROM_DATE));\n\t\t\t\tcreateCalendarInputDoc(organizationCode,sEffectiveFromDate);\n\t\t\t}\n\t\t\telse if(!organizationCode.equals(eleCal.getAttribute(XMLLiterals.ORGANIZATION_CODE))) {\n\t\t\t\tcreateCalendar(exceptionList);\n\t\t\t\tcreateResourcePool(organizationCode);\n\t\t\t\torganizationCode=eleCal.getAttribute(XMLLiterals.ORGANIZATION_CODE);\n\t\t\t\tString sEffectiveFromDate = dateFormatter(eleCal.getAttribute(XMLLiterals.EFFECTIVE_FROM_DATE));\n\t\t\t\tcreateCalendarInputDoc(organizationCode,sEffectiveFromDate);\n\t\t\t}\n\t\t\tString sSerSlotShiftStartTime = eleCal.getAttribute(XMLLiterals.SHIFT_START_TIME);\n\t\t\tString sSerSlotShiftEndTime = eleCal.getAttribute(XMLLiterals.SHIFT_END_TIME);\n\t \t\t\ttry {\n\t \t\t\t\tif(EXCEPTION_TIME.equals(sSerSlotShiftStartTime) && EXCEPTION_TIME.equals(sSerSlotShiftEndTime)) \n\t \t\t\t\t\texceptionList.add(dateFormatter(eleCal.getAttribute(XMLLiterals.EFFECTIVE_FROM_DATE)));\n\t \t\t\t\telse\n\t \t\t\t\t\tsetShiftValues(eleCal);\n\t \t\t\t}\n\t \t\t\tcatch (ParseException e) {\n\t \t\t\t\tthrow ExceptionUtil.getYFSException(ExceptionLiterals.ERRORCODE_INVALID_DATE, e);\n\t \t\t\t}\n\t\t}\n\t\tcreateCalendar(exceptionList);\n\t\tcreateResourcePool(organizationCode);\n\t\treturn docCreateCalenderInXml;\n\t}", "private Calendar getCalFromString(final String calString) {\n\t\tfinal Calendar ret = new GregorianCalendar(1970, 0, 1, 0, 0, 0);\n\t\tfinal SimpleDateFormat isoDateFormat = new SimpleDateFormat(\n\t\t\t\t\"yyyy-MM-dd HH:mm\", Locale.getDefault());\n\t\ttry {\n\t\t\tret.setTime(isoDateFormat.parse(calString.concat(\" 00:00\")));\n\t\t\tret.setTime(isoDateFormat.parse(calString));\n\t\t} catch (ParseException e) { \n\t\t\t// the code will definitely throw an exception, but we don't care\n\t\t\t// any suggestions how to better handle this?\n\t\t}\n\n\t\treturn ret;\n\t}", "Calendar occurredAt();", "private Calendar createCalendar() {\n Calendar cal = Calendar.getInstance();\n\n // clear all aspects of the time that are not used\n cal.set(Calendar.MILLISECOND, 0);\n\n return cal;\n }", "Date getStartDay();", "public Calendar getDate(){\n return date;\n }", "public void setCalendar(Calendar cal) {\n this.cal = cal;\n }", "@Test\n public void getterCalendar(){\n ScheduleEntry entry = new ScheduleEntry();\n entry.setCalendar(calendar);\n entry.setDepartureTime(DepartureTime);\n Assert.assertEquals(2018,calendar.getYear());\n Assert.assertEquals(4,calendar.getMonth());\n Assert.assertEquals(25,calendar.getDayOfMonth());\n }", "public Calendar getStartDate() {\n \t\tCalendar cal = Calendar.getInstance();\n \t\tcal.setTimeInMillis(startTime);\n \t\t\n\t\treturn cal;\n\t}", "public Calendario getCalendar(){\r\n\t\treturn calendar;\r\n\t}", "@org.jetbrains.annotations.NotNull()\n public static final android.app.DatePickerDialog getDatePicker(@org.jetbrains.annotations.NotNull()\n java.util.Calendar $this$getDatePicker, @org.jetbrains.annotations.NotNull()\n android.content.Context context, @org.jetbrains.annotations.NotNull()\n android.app.DatePickerDialog.OnDateSetListener onDateSetListener) {\n return null;\n }", "private static com.google.api.services.calendar.Calendar getCalendarService() throws IOException\n{\n Credential cred = authorize();\n com.google.api.services.calendar.Calendar.Builder bldr =\n new com.google.api.services.calendar.Calendar.Builder(HTTP_TRANSPORT,JSON_FACTORY,cred);\n bldr.setApplicationName(APPLICATION_NAME);\n\n com.google.api.services.calendar.Calendar cal = bldr.build();\n\n return cal;\n}", "static synchronized BasisGoogleCalendar getCalendar(UpodWorld w)\n{\n if (DATA_STORE_DIR == null) return null;\n if (cal_service == null) {\n try {\n\t cal_service = getCalendarService();\n }\n catch (IOException e) {\n\t BasisLogger.logE(\"GOOGLECAL: Authorization problem with calendar api: \" + e);\n\t DATA_STORE_DIR = null;\n\t HTTP_TRANSPORT = null;\n\t DATA_STORE_FACTORY = null;\n\t return null;\n }\n }\n\n BasisGoogleCalendar rslt = the_calendars.get(w);\n if (rslt == null) {\n rslt = new BasisGoogleCalendar();\n the_calendars.put(w,rslt);\n }\n\n return rslt;\n}", "public abstract Date computeFirstFireTime(Calendar calendar);", "static public Calibration getCalFromName(String name_in) {\r\n for (Calibration cal : registeredCals) {\r\n if (cal.name.equals(name_in)) {\r\n return cal;\r\n }\r\n }\r\n return null;\r\n }", "public static Date getDate(DateTime dateTime) \n\t{\n\t\tCalendar calendar;\n\t\tDate date = null;\n\t\t\n\t\tassert (dateTime != null);\n\t\tif(dateTime != null)\n\t\t{\n\t\t\tcalendar = Calendar.getInstance();\n\t\t\t\n\t\t\tif ((dateTime.getStyle() & SWT.CALENDAR) != 0 ||\n\t\t\t\t\t(dateTime.getStyle() & SWT.DATE) != 0) \n\t\t\t{\n\t\t\t\tdate = getDate(dateTime.getYear(), dateTime.getMonth(), dateTime.getDay(), \n\t\t\t\t\t\tcalendar.get(Calendar.HOUR_OF_DAY), \n\t\t\t\t\t\tcalendar.get(Calendar.MINUTE), \n\t\t\t\t\t\tcalendar.get(Calendar.SECOND));\t\t\t\n\t\t\t}\n\t\t\telse if ((dateTime.getStyle() & SWT.TIME) != 0) \n\t\t\t{\n\t\t\t\tdate = getDate(calendar.get(Calendar.YEAR), \n\t\t\t\t\t\tcalendar.get(Calendar.MONTH), calendar.get(Calendar.DAY_OF_MONTH), \n\t\t\t\t\t\tdateTime.getHours(), dateTime.getMinutes(), dateTime.getSeconds());\t\t\t\n\t\t\t}\n\t\t\telse\n\t\t\t{\t\t\t\n\t\t\t\tdate = getDate(dateTime.getYear(), dateTime.getMonth(), dateTime.getDay(), \n\t\t\t\t\tdateTime.getHours(), dateTime.getMinutes(), dateTime.getSeconds());\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn date;\n\t}", "private Date getTo(RuleTypes.HistoricRequirements ph) {\n Calendar date = new GregorianCalendar();\n date.set(Calendar.HOUR_OF_DAY, 0);\n date.set(Calendar.MINUTE, 0);\n date.set(Calendar.SECOND, 0);\n date.set(Calendar.MILLISECOND, 0);\n int today;\n\n Calendar now = new GregorianCalendar();\n\n switch(ph) {\n case TODAY:\n return now.getTime();\n case YESTERDAY:\n return date.getTime();\n case THIS_WEEK:\n return now.getTime();\n case LAST_WEEK:\n today = date.get(Calendar.DAY_OF_WEEK);\n date.add(Calendar.DAY_OF_WEEK,-today+Calendar.SUNDAY);\n return date.getTime();\n case THIS_MONTH:\n return now.getTime();\n case LAST_MONTH:\n date.add(Calendar.MONTH, -1);\n date.set(Calendar.DAY_OF_MONTH, date.getActualMaximum(Calendar.DAY_OF_MONTH));\n return date.getTime();\n case T12_HRS:\n return now.getTime();\n case T24_HRS:\n return now.getTime();\n case T2_DAYS:\n return now.getTime();\n case T3_DAYS:\n return now.getTime();\n case T4_DAYS:\n return now.getTime();\n case T5_DAYS:\n return now.getTime();\n case T6_DAYS:\n return now.getTime();\n case T7_DAYS:\n return now.getTime();\n }\n return null;\n\n }", "public void setCalendar(Calendar cal) {\n this.cal = cal;\n }", "public void setCalendar(Calendar cal) {\n this.cal = cal;\n }", "public Entry(Calendar date){\n this.date = date; \n }", "java.util.Calendar getLastrun();", "public void setupCalendar() { \n\t\tcal = whenIsIt();\n\t\tLocale here = Locale.US;\n\t\tthisMonth = cal.getDisplayName(2, Calendar.LONG_STANDALONE, here);\n\t\tdate = cal.get(5); //lesson learned: if it's a number do this\n\t\t//ADD CODE FOR ORDINALS HERE\n\t\tyear = cal.get(1);\n\t\tthisHour = cal.get(10);\n\t\tthisMinute = cal.get(12);\n\t\tthisSecond = cal.get(13);\n\t\tamPm = cal.getDisplayName(9, Calendar.SHORT, here);\n\t\tthisDay = thisMonth +\" \"+ addOrdinal(date) + \", \" + year;\n\t\tcurrentTime = fix.format(thisHour) + \":\" + fix.format(thisMinute) + \":\" + fix.format(thisSecond) + \" \" + amPm;\n\t}", "@SuppressWarnings(\"deprecation\")\r\n\tprivate void createCalendarEntry(){\r\n\t\t\r\n\t\tUri calendars = Uri.parse(CALENDAR_URI);\r\n\t\t \r\n\t\tCursor managedCursor = managedQuery(calendars, projection, null, null, null);\r\n\t\tString calName = \"\"; \r\n\t\tString calId = \"\"; \r\n\t\tif (managedCursor.moveToFirst()) {\r\n\t\t\t \r\n\t\t\t int idColumn = managedCursor.getColumnIndex(projection[0]);\r\n\t\t\t int nameColumn = managedCursor.getColumnIndex(projection[1]); \r\n\t\t\t \r\n\t\t\t do {\r\n\t\t\t calName = managedCursor.getString(nameColumn);\r\n\t\t\t calId = managedCursor.getString(idColumn);\r\n\t\t\t if (calName.contains(\"gmail\"))\r\n\t\t\t \tbreak;\r\n\t\t\t } while (managedCursor.moveToNext());\r\n\t }\r\n\t\t\r\n\t\tlong start = System.currentTimeMillis() + 120000;\r\n\t\tlong duration = DURATION + start;\r\n\t\t\r\n\t\tContentValues values = new ContentValues();\r\n\t\tvalues.put(DATE_START, start);\r\n\t\tvalues.put(DATE_END, duration);\r\n\t\tvalues.put(EVENT_TITLE, ocrData.getMedicine().getMedicine());\r\n\t\tvalues.put(EVENT_DESCRIPTION, \"Take \" + ocrData.getPatient2Medicine().getFrequencyOfIntake() \r\n\t\t\t\t+ \" by \" + ocrData.getPatient2Medicine().getMode());\r\n\t\tvalues.put(CALENDAR_ID, calId);\r\n\t\tvalues.put(EVENT_RULE, \"FREQ=\" + ocrData.getPatient2Medicine().getFrequencyOfIntake() + \";\");\r\n\t\tvalues.put(HAS_ALARM, 1);\r\n\t\t\r\n\t\tContentResolver cr = getContentResolver();\r\n\t\tUri event = cr.insert(Uri.parse(EVENT_URI), values);\r\n\t\t\r\n\t\tvalues = new ContentValues();\r\n\t\tvalues.put(\"event_id\", Long.parseLong(event.getLastPathSegment()));\r\n\t\tvalues.put(\"method\", 1);\r\n\t\tvalues.put(\"minutes\", 10 );\r\n\t\tcr.insert(Uri.parse(REMINDER_URI), values);\r\n\t}", "public Calendar getCalendar() {\n return _calendar;\n }", "public void initCalendarFirst() {\n getCurrentDate();\n mCalendar.setOnDateChangedListener(new OnDateSelectedListener() {\n @Override\n public void onDateSelected(@NonNull MaterialCalendarView widget, @NonNull CalendarDay select, boolean selected) {\n mSelectedDate = select.toString();\n String string[] = mSelectedDate.split(\"\\\\{|\\\\}\");\n String s = string[1]; //2017-8-14\n String string1[] = s.split(\"-\");\n int tempMonth = Integer.parseInt(string1[1]);\n String month = Integer.toString(tempMonth + 1);\n mDate1 = string1[0] + \"-\" + month + \"-\" + string1[2];\n }\n });\n }", "java.util.Calendar getStartTime();", "@SuppressLint(\"SimpleDateFormat\")\n\tprivate void getCalenderView() {\n\n\t\ttry {\n\n\t\t\tDatePickerDialog dpd = new DatePickerDialog(this,\n\t\t\t\t\tnew DatePickerDialog.OnDateSetListener() {\n\n\t\t\t\t\t\t@Override\n\t\t\t\t\t\tpublic void onDateSet(DatePicker view,\n\t\t\t\t\t\t\t\tint selectedyear, int monthOfYear,\n\t\t\t\t\t\t\t\tint dayOfMonth) {\n\t\t\t\t\t\t\t// TODO Auto-generated method stub\n\n\t\t\t\t\t\t\tyear = selectedyear;\n\t\t\t\t\t\t\tmonth = monthOfYear;\n\t\t\t\t\t\t\tday = dayOfMonth;\n\t\t\t\t\t\t\ttry {\n\n\t\t\t\t\t\t\t\tDate date = new SimpleDateFormat(\"yyyy-MM-dd\")\n\t\t\t\t\t\t\t\t\t\t.parse(year + \"-\" + (month + 1) + \"-\"\n\t\t\t\t\t\t\t\t\t\t\t\t+ day);\n\n\t\t\t\t\t\t\t\tDateFormat outputFormatter = new SimpleDateFormat(\n\t\t\t\t\t\t\t\t\t\t\"yyyy-MM-dd\");\n\t\t\t\t\t\t\t\tString selectedDate = outputFormatter\n\t\t\t\t\t\t\t\t\t\t.format(date); // Output : 01/20/2012\n\n\t\t\t\t\t\t\t\tSystem.out.println(\"!!!!!!selectedDate...\"\n\t\t\t\t\t\t\t\t\t\t+ selectedDate);\n\n\t\t\t\t\t\t\t\t// Date currDate=new Date();\n\n\t\t\t\t\t\t\t\tSystem.out.println(\"!!!!!!!!!currDate.\"\n\t\t\t\t\t\t\t\t\t\t+ currDate);\n\t\t\t\t\t\t\t\tSystem.out\n\t\t\t\t\t\t\t\t\t\t.println(\"output.compareTo(currDate)..\"\n\t\t\t\t\t\t\t\t\t\t\t\t+ selectedDate\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.compareTo(currDate\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.toString()));\n\n\t\t\t\t\t\t\t\tif (selectedDate.compareTo(currDate.toString()) >= 0\n\t\t\t\t\t\t\t\t\t\t&& selectedDate.compareTo(output\n\t\t\t\t\t\t\t\t\t\t\t\t.toString()) <= 0) {\n\t\t\t\t\t\t\t\t\t// then do your work\n\t\t\t\t\t\t\t\t\t// Display Selected date in textbox\n\n\t\t\t\t\t\t\t\t\tDateFormat outputFormatter1 = new SimpleDateFormat(\n\t\t\t\t\t\t\t\t\t\t\t\"yyyy-MM-dd\");\n\t\t\t\t\t\t\t\t\tString date_formating = outputFormatter1\n\t\t\t\t\t\t\t\t\t\t\t.format(date);\n\n\t\t\t\t\t\t\t\t\tSystem.out\n\t\t\t\t\t\t\t\t\t\t\t.println(\"!!!!!!!!!after_formating..\"\n\t\t\t\t\t\t\t\t\t\t\t\t\t+ outputFormatter1\n\t\t\t\t\t\t\t\t\t\t\t\t\t+ \"!!!!!\" + date_formating);\n\n\t\t\t\t\t\t\t\t\trf_booking_date_box.setText(selectedDate);\n\t\t\t\t\t\t\t\t\tBooking_Screen_TabLayout.rf_booking_date_header.setText(selectedDate);\n\n\t\t\t\t\t\t\t\t\t// rf_booking_date_box.setText(year + \"-\" +\n\t\t\t\t\t\t\t\t\t// (month + 1)\n\t\t\t\t\t\t\t\t\t// + \"-\" + day);\n\n\t\t\t\t\t\t\t\t\tGlobal_variable.str_Date = date_formating;\n\n\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t// show message\n\n\t\t\t\t\t\t\t\t\tToast.makeText(\n\t\t\t\t\t\t\t\t\t\t\tgetApplicationContext(),\n\t\t\t\t\t\t\t\t\t\t\tgetString(R.string.str_invalid_date),\n\t\t\t\t\t\t\t\t\t\t\tToast.LENGTH_SHORT).show();\n\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t} catch (java.text.ParseException e) {\n\t\t\t\t\t\t\t\t// TODO Auto-generated catch block\n\t\t\t\t\t\t\t\te.printStackTrace();\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t}\n\t\t\t\t\t}, year, month, day);\n\t\t\tdpd.getDatePicker().setMinDate(c.getTimeInMillis());\n\n\t\t\tc.add(Calendar.MONTH, 1);\n\n\t\t\tdpd.getDatePicker().setMaxDate(c.getTimeInMillis());\n\n\t\t\tc.add(Calendar.MONTH, -1);\n\n\t\t\tSystem.out.println(\"!!!!!pankaj\" + c.getTimeInMillis());\n\t\t\t// dpd.getDatePicker().setMaxDate(c.);\n\t\t\tdpd.show();\n\t\t\tdpd.setCancelable(false);\n\t\t\tdpd.setCanceledOnTouchOutside(false);\n\n\t\t} catch (NullPointerException e) {\n\t\t\te.printStackTrace();\n\t\t}\n\n\t}", "public Calendar startOfDay() {\r\n\t\t\r\n\t\tCalendar c2 = Calendar.getInstance(baseCalendar.getTimeZone());\r\n\t\tc2.clear();\r\n\t\tc2.set(baseCalendar.get(Calendar.YEAR), \r\n\t\t\t\tbaseCalendar.get(Calendar.MONTH),\r\n\t\t\t\tbaseCalendar.get(Calendar.DATE));\r\n\r\n\t\treturn c2;\t\t\r\n\t}", "public Calendar() {\n }", "public static Calendar convertStringDateTimeToCalendar(String strCal)\r\n\t{\r\n\t\t//\"dd/mm/yyyy hh:mm\"\r\n\t\tCalendar c = new GregorianCalendar();\r\n\t\t\r\n\t\tString[] arrSlash = strCal.split(\"/\");\r\n\t\t\r\n\t\t//arrCal is now {DD,MM,YYYY HH:MM}\r\n\t\t\r\n\t\tint day = Integer.parseInt(arrSlash[0]);\r\n\t\tint month = Integer.parseInt(arrSlash[1]);\r\n\t\t\r\n\t\tString[] arrSpace = arrSlash[2].split(\" \");\r\n\t\t\r\n\t\t//arrSpace is now {YYYY,HH:MM}\r\n\t\t\r\n\t\tint year = Integer.parseInt(arrSpace[0]);\r\n\t\t\r\n\t\tString[] arrColon = arrSpace[1].split(\":\");\r\n\t\t\r\n\t\t//arrColon is now {HH,MM}\r\n\t\t\r\n\t\tint hour = Integer.parseInt(arrColon[0]);\r\n\t\tint minute = Integer.parseInt(arrColon[1]);\r\n\t\t\r\n\t\t//set values to object\r\n\t\tc.set(Calendar.DAY_OF_MONTH, day);\r\n\t\tc.set(Calendar.MONTH, month-1);\r\n\t\tc.set(Calendar.YEAR, year);\r\n\t\tc.set(Calendar.HOUR_OF_DAY, hour);\r\n\t\tc.set(Calendar.MINUTE, minute);\r\n\t\t\r\n\t\treturn c;\r\n\t}", "public static Calendar createCalendar(int year, int month, int day, int hrs, int min, int secs, TimeZone tz) {\r\n Calendar usaCal = Calendar.getInstance(tz);\r\n usaCal.clear();\r\n usaCal.set(year, month, day, hrs, min, secs);\r\n return usaCal;\r\n }", "public void setCalDay() {\n\t\tfloat goal_bmr;\n\t\tif(gender==\"male\") {\n\t\t\tgoal_bmr= (float) (10 * (weight+loseGainPerWeek) + 6.25 * height - 5 * age + 5);\n\t\t}\n\t\telse {\n\t\t\tgoal_bmr=(float) (10 * (weight+loseGainPerWeek) + 6.25 * height - 5 * age - 161);\n\t\t}\n\t\tswitch (gymFrequency) {\n\t\tcase 0:calDay = goal_bmr*1.2;\n\t\t\t\tbreak;\n\t\tcase 1:\n\t\tcase 2:\n\t\tcase 3:calDay = goal_bmr*1.375;\n\t\t\t\tbreak;\n\t\tcase 4:\n\t\tcase 5:calDay = goal_bmr*1.55;\n\t\t\n\t\t\t\tbreak;\n\t\tcase 6:\n\t\tcase 7:calDay = goal_bmr*1.725;\n\t\t\t\tbreak;\n\t\t}\n\t}", "private Calendar convertDateToCalendar(Date date) {\n Calendar calendar = GregorianCalendar.getInstance();\n calendar.setTime(date);\n return calendar;\n }", "public static Calendar parseCalendar(DateFormat format, String dateStr) throws ParseException {\n\t\tCalendar calendar = Calendar.getInstance();\n\t\tcalendar.setTime(parseDate(format, dateStr));\n\t\treturn calendar;\n\t}", "CalendarDate selectByPrimaryKey(String calendardate);", "public final synchronized Date getDate(int parameterIndex, Calendar cal) \n throws SQLException\n {\n return getCallableStatement().getDate(parameterIndex, cal);\n }", "public Date getUTCDate(String timeZone, Calendar cal);", "@NonNull public static CalendarDay today() {\n return from(LocalDate.now());\n }", "Date getEventFiredAt();", "private static Calendar createCalendar(int year, int month, int date,\r\n\t\t\tint hour, int minute) {\r\n\t\tCalendar calendar = createCalendar(year, month, date);\r\n\t\tcalendar.set(Calendar.HOUR_OF_DAY, hour);\r\n\t\tcalendar.set(Calendar.MINUTE, minute);\r\n\t\treturn calendar;\r\n\t}", "public BwCalendar getMeetingCal() {\n return meetingCal;\n }", "public Calendar toDate() {\n Calendar cal = Calendar.getInstance();\n if (year != null) {\n cal.set(Calendar.YEAR, year);\n }\n if (month != null) {\n cal.set(Calendar.MONTH, TimeConstants.getMonthIndex(month));\n }\n if (day != null) {\n cal.set(Calendar.DAY_OF_MONTH, day);\n }\n return cal;\n }", "public static Calendar getFechaHoy(){\n\n Calendar cal = new GregorianCalendar();\n cal.set(Calendar.HOUR_OF_DAY,0);\n cal.set(Calendar.MINUTE, 0);\n cal.set(Calendar.SECOND, 0);\n cal.set(Calendar.MILLISECOND, 0);\n\n return cal;\n }", "public interface OnDatePickListener {\n public void OnDatePick(Calendar pickedDate);\n}", "private Calendar chooseCalendar(SignupSite site) throws PermissionException {\n\t\tCalendar calendar = sakaiFacade.getAdditionalCalendar(site.getSiteId());\n\t\tif (calendar == null) {\n\t\t\tcalendar = sakaiFacade.getCalendar(site.getSiteId());\n\t\t}\n\t\treturn calendar;\n\t}", "Calendar getDepartureDateAndTime();", "public Calendar calcEasterDate(){\n a = year% 19;\n b = (int) Math.floor(year/100);\n c = year % 100;\n d = (int) Math.floor(b/4);\n e = b % 4;\n f = (int) Math.floor((b + 8) / 25);\n g = (int) Math.floor((b - f + 1) / 3);\n h = (19*a + b - d - g + 15) % 30;\n i = (int) Math.floor(c/4);\n k = c%4;\n L = (32 + 2*e + 2*i - h - k) % 7;\n m = (int) Math.floor((a + 11*h + 22*L) / 451);\n month = (int) Math.floor((h + L - 7*m + 114) / 31);\n day = (((h + L - (7*m) + 114) % 31) + 1);\n Calendar instance = Calendar.getInstance();\n instance.set(year, month, day);\n return instance;\n }", "public Calendar getDataCell(Object cellObject, Class<?> objectType, ISheetSession<?, ?> session) throws SpreadsheetConverterException {\n\t\tHSSFCell cell = (HSSFCell) cellObject;\n\t\tCalendar instance = Calendar.getInstance();\n\t\tinstance.setTime(cell.getDateCellValue());\n\t\treturn instance;\n\t}", "public void setTodayCalendar()\n {\n this.currentCalendar = Calendar.getInstance();\n }", "public static void getCalendar(Calendar cal, QuoteShort q) {\n\t\tcal.set(q.getYear(), q.getMonth()-1, q.getDay(), q.getHh(), q.getMm(),q.getSs());\r\n\t}", "public static Calendar dateToCalendar(Date dteStart, TimeZone tz) {\r\n Calendar cal = Calendar.getInstance(tz);\r\n cal.clear();\r\n int year = dteStart.getYear() + 1900;\r\n int month = dteStart.getMonth();\r\n DateFormat formatter = new SimpleDateFormat(\"dd\");\r\n String strDay = formatter.format(dteStart);\r\n int day = Integer.parseInt(strDay);\r\n int hrs = dteStart.getHours();\r\n int min = dteStart.getMinutes();\r\n int secs = dteStart.getSeconds();\r\n cal.set(Calendar.YEAR, year);\r\n cal.set(Calendar.MONTH, month);\r\n cal.set(Calendar.DAY_OF_MONTH, day);\r\n cal.set(Calendar.HOUR_OF_DAY, hrs);\r\n cal.set(Calendar.MINUTE, min);\r\n cal.set(Calendar.SECOND, secs);\r\n return cal;\r\n }", "KitCalculatorsFactory<E> registerHolidays(String calendarName, HolidayCalendar<E> holidaysCalendar);", "Calendar getTimeStamp();", "Date getInvoicedDate();", "public Calendar getCalendar() {\n return this.calendar;\n }", "public Calendar getDate()\n {\n return date;\n }", "public CalendarioFecha obtenerPorEvento(Reservacion reservacion) throws Exception { \n\t \n\t\t CalendarioFecha datos = new CalendarioFecha(); \n\t\t Session em = sesionPostgres.getSessionFactory().openSession(); \t\n\t try { \t\n\t\t datos = (CalendarioFecha) em.createCriteria(CalendarioFecha.class).add(Restrictions.eq(\"reservacion\", reservacion))\n\t\t \t\t.add(Restrictions.eq(\"activo\", true)).uniqueResult(); \n\t } catch (Exception e) { \n\t \n\t throw new Exception(e.getMessage(),e.getCause());\n\t } finally { \n\t em.close(); \n\t } \n\t \n\t return datos; \n\t}" ]
[ "0.6794745", "0.6074519", "0.60162", "0.5916132", "0.5846541", "0.583389", "0.5817498", "0.5745974", "0.5743449", "0.5739673", "0.5733557", "0.5716298", "0.56778944", "0.56441855", "0.56382746", "0.56309164", "0.562867", "0.5593988", "0.5593951", "0.55739814", "0.5572599", "0.55575174", "0.55256546", "0.5525353", "0.55033696", "0.5501205", "0.5464124", "0.5464124", "0.54534847", "0.54473215", "0.54456264", "0.54021496", "0.5399308", "0.53817225", "0.5368839", "0.5360699", "0.5353867", "0.5335597", "0.53321505", "0.5321029", "0.53200966", "0.53123534", "0.53096384", "0.5301511", "0.5247749", "0.5244606", "0.5238628", "0.52337795", "0.52319646", "0.52216583", "0.5202346", "0.51903224", "0.51886094", "0.5179031", "0.5167168", "0.5163068", "0.51585215", "0.51544464", "0.5153557", "0.5149616", "0.51377594", "0.51377594", "0.51349753", "0.51289856", "0.5128335", "0.51281136", "0.5113566", "0.51135075", "0.51072866", "0.5096938", "0.5096582", "0.50940645", "0.5092913", "0.5088311", "0.5085457", "0.5062302", "0.5050962", "0.50361156", "0.5032717", "0.503074", "0.5024243", "0.5019646", "0.5018381", "0.5012268", "0.50110453", "0.5009914", "0.5002215", "0.4999059", "0.499819", "0.4996241", "0.49898222", "0.4986763", "0.4983439", "0.49792537", "0.49752662", "0.4963675", "0.49375996", "0.49361995", "0.49359468", "0.4920738" ]
0.5654493
13
method to differnece between two dates dates in
public int getDifferenceInDate(String sPreviousDate, String sCurrentDate) { Calendar calPrevious = null; Calendar calCurrent = null; String[] arrTempDate = null; long longPreviousDate = 0; long longCurrentTime = 0; int timeDelay = 0; try { if (sPreviousDate.contains(":") && sCurrentDate.contains(":")) { arrTempDate = sPreviousDate.split(":"); calPrevious = Calendar.getInstance(); calPrevious.set(Integer.parseInt(arrTempDate[0]), (Integer.parseInt(arrTempDate[1]) - 1), Integer.parseInt(arrTempDate[2]), Integer.parseInt(arrTempDate[3]), Integer.parseInt(arrTempDate[4])); arrTempDate = sCurrentDate.split(":"); calCurrent = Calendar.getInstance(); calCurrent.set(Integer.parseInt(arrTempDate[0]), (Integer.parseInt(arrTempDate[1]) - 1), Integer.parseInt(arrTempDate[2]), Integer.parseInt(arrTempDate[3]), Integer.parseInt(arrTempDate[4])); longPreviousDate = Long.parseLong(new SimpleDateFormat("yyyyMMddHHmm").format(calPrevious.getTime())); longCurrentTime = Long.parseLong(new SimpleDateFormat("yyyyMMddHHmm").format(calCurrent.getTime())); ///println("Previous Time In Int= "+longPreviousDate); //println("Current Time In Int= "+longCurrentTime); if (longCurrentTime > longPreviousDate) { while (true) { timeDelay++; calCurrent.add(Calendar.MINUTE, -1); longCurrentTime = Long.parseLong(new SimpleDateFormat("yyyyMMddHHmm").format(calCurrent.getTime())); //println("Previous Time In Int= "+longPreviousDate); //println("Current Time In Int= "+longCurrentTime); if (longCurrentTime < longPreviousDate) { break; } } } } } catch (Exception e) { println("getDifferenceInDate : Exception : " + e.toString()); } finally { return timeDelay; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static void dateDifference(){\r\n\t\t\r\n\t\tLocalDate firstDate = LocalDate.of(2013, 3, 20);\r\n\t\tLocalDate secondDate = LocalDate.of(2015, 8, 12);\r\n\t\t\r\n\t\tPeriod diff = Period.between(firstDate, secondDate);\r\n\t\tSystem.out.println(\"The Difference is ::\"+diff.getDays());\r\n\t}", "public static void DateDiff(Date date1, Date date2) {\n int diffDay = diff(date1, date2);\n System.out.println(\"Different Day : \" + diffDay);\n }", "DateDiff(Datum date1, Datum date2)\r\n\t{\r\n\t\t// Return when equal\r\n\t\tif (date1.equals(date2))\r\n\t\t{\r\n\t\t\treturn;\r\n\t\t}\r\n\t\t// Switch Min / Max\r\n\t\tDatum Maxdate = date1.kleinerDan(date2) ? date2 : date1;\r\n\t\tDatum minDate = date1.kleinerDan(date2) ? date1 : date2;\r\n\t\tminDate = new Datum(minDate); //Cloned for calculations\r\n\r\n\t\t// Not in same month or year? -> Add 1 month\r\n\t\twhile (minDate.getMonth() != Maxdate.getMonth()\r\n\t\t\t\t|| minDate.getYear() != Maxdate.getYear())\r\n\t\t{\r\n\t\t\t//Get the days of the month being processed.\r\n\t\t\tint dim = Maanden.get(minDate.getMonth()).GetLength(minDate.getYear());\r\n\t\t\tminDate.veranderDatum(dim); // Add 1 month\r\n\t\t\tdays += dim; //add days\r\n\t\t\tmonths++; // add one month\r\n\t\t}\r\n\t\t// Add or subtract remaining days (in same month)\r\n\t\tdays += Maxdate.getDay() - minDate.getDay();\r\n\t\t//Subtract one month if the MaxDay is bigger then MinDay\r\n\t\tmonths -= (Maxdate.getDay() < minDate.getDay() ? 1 : 0);\r\n\t}", "public int getDifference(DaysBetween dt1, DaysBetween dt2)\n {\n // COUNT TOTAL NUMBER OF DAYS BEFORE FIRST DATE 'dt1'\n \n // initialize count using years and day\n int n1 = dt1.y * 365 + dt1.d;\n \n // Add days for months in given date\n for (int i = 0; i < dt1.m - 1; i++) \n {\n n1 += monthDays[i];\n }\n \n // Since every leap year is of 366 days,\n // Add a day for every leap year\n n1 += countLeapYears(dt1);\n \n // SIMILARLY, COUNT TOTAL NUMBER OF DAYS BEFORE 'dt2'\n int n2 = dt2.y * 365 + dt2.d;\n for (int i = 0; i < dt2.m - 1; i++)\n {\n n2 += monthDays[i];\n }\n n2 += countLeapYears(dt2);\n \n // return difference between two counts\n return (n2 - n1);\n }", "public long days(Date date2) {\n\t\tlong getDaysDiff =0;\n\t\t DateFormat simpleDateFormat = new SimpleDateFormat(\"dd-MM-yyyy\");\n\n\t\t Date currentDate = new Date();\n\t\t Date date1 = null;\n\t\t Date date3 = null;\n\n\t\t\n\n\t\t try {\n\t\t String startDate = simpleDateFormat.format(date2);\n\t\t String endDate = simpleDateFormat.format(currentDate);\n\n\t\t date1 = simpleDateFormat.parse(startDate);\n\t\t date3 = simpleDateFormat.parse(endDate);\n\n\t\t long getDiff = date3.getTime() - date1.getTime();\n\n\t\t getDaysDiff = getDiff / (24 * 60 * 60 * 1000);\n\t\t \n\t\t \n\t\t \n\t\t } catch (Exception e) {\n\t\t e.printStackTrace();\n\t\t }\n\t\t return getDaysDiff;\n\n}", "public static long getDiffDays(Date date1,Date date2) {\n Calendar calendar1= Calendar.getInstance();\n Calendar calendar2 = Calendar.getInstance();\n\n calendar1.setTime(date1);\n calendar2.setTime(date2);\n\n long msDiff = calendar1.getTimeInMillis()-calendar2.getTimeInMillis();\n long daysDiff = TimeUnit.MILLISECONDS.toDays(msDiff);\n Log.e(\"Amarneh\",\"diffDays>>\"+daysDiff);\n return daysDiff;\n }", "@Test\n @ExcludeIn({ DB2, HSQLDB, SQLITE, TERADATA })\n public void date_diff2() {\n SQLQuery<?> query = query().from(Constants.employee).orderBy(Constants.employee.id.asc());\n LocalDate localDate = new LocalDate(1970, 1, 10);\n java.sql.Date date = new java.sql.Date(localDate.toDateMidnight().getMillis());\n int years = query.select(SQLExpressions.datediff(year, date, Constants.employee.datefield)).fetchFirst();\n int months = query.select(SQLExpressions.datediff(month, date, Constants.employee.datefield)).fetchFirst();\n // weeks\n int days = query.select(SQLExpressions.datediff(day, date, Constants.employee.datefield)).fetchFirst();\n int hours = query.select(SQLExpressions.datediff(hour, date, Constants.employee.datefield)).fetchFirst();\n int minutes = query.select(SQLExpressions.datediff(minute, date, Constants.employee.datefield)).fetchFirst();\n int seconds = query.select(SQLExpressions.datediff(second, date, Constants.employee.datefield)).fetchFirst();\n Assert.assertEquals(949363200, seconds);\n Assert.assertEquals(15822720, minutes);\n Assert.assertEquals(263712, hours);\n Assert.assertEquals(10988, days);\n Assert.assertEquals(361, months);\n Assert.assertEquals(30, years);\n }", "public static int diff(Date date1, Date date2) {\n Calendar c1 = Calendar.getInstance();\n Calendar c2 = Calendar.getInstance();\n\n c1.setTime(date1);\n c2.setTime(date2);\n int diffDay = 0;\n\n if (c1.before(c2)) {\n diffDay = countDiffDay(c1, c2);\n } else {\n diffDay = countDiffDay(c2, c1);\n }\n\n return diffDay;\n }", "@Test\n\tpublic void differenceBetweenDates() throws Exception {\n\t\tAssert.assertTrue(DateDifferentHelper.differenceBeteweenDates(ACTUAL_DATE));\n\t}", "public long difference() {\n long differenceBetweenDate = ChronoUnit.DAYS.between(startDate.toInstant(), endDate.toInstant());\n\n return differenceBetweenDate;\n\n }", "public int[] diff(Date d) {\r\n\t\tint arr[] = new int[3];\r\n\t\tarr[0] = Math.abs(this.days - d.days);\r\n\t\tarr[1] = Math.abs(this.months - d.months);\r\n\t\tarr[2] = Math.abs(this.years - d.years);\r\n\t\treturn arr;\r\n\t}", "public static String dateDiff(Date date1, Date date2) {\n long lower = Math.min(date1.getTime(), date2.getTime());\n long upper = Math.max(date1.getTime(), date2.getTime());\n long diff = upper - lower;\n\n long days = diff / (24 * 60 * 60 * 1000);\n long hours = diff / (60 * 60 * 1000) % 24;\n long minutes = diff / (60 * 1000) % 60;\n long seconds = diff / 1000 % 60;\n\n return String.format(\"%02d:%02d:%02d:%02d\", days, hours, minutes, seconds);\n\t}", "private int getDifferenceDays(Date d1, Date d2) {\n int daysdiff = 0;\n long diff = d2.getTime() - d1.getTime();\n long diffDays = diff / (24 * 60 * 60 * 1000) + 1;\n daysdiff = (int) diffDays;\n return daysdiff;\n }", "public static void main(String[] args) {\n\t\t\tCalendar ca1 = Calendar.getInstance();\r\n\t Calendar ca2 = Calendar.getInstance();\r\n\t // Set the date for both of the calendar to get difference\r\n\t ca1.set(1980,2,20);\r\n\t ca2.set(2014, 2, 25);\r\n\r\n\t // Get date in milliseconds\r\n\t long milisecond1 = ca1.getTimeInMillis();\r\n\t long milisecond2 = ca2.getTimeInMillis();\r\n\r\n\t // Find date difference in milliseconds\r\n\t long diffInMSec = milisecond2 - milisecond1;\r\n\r\n\t // Find date difference in days \r\n\t // (24 hours 60 minutes 60 seconds 1000 millisecond)\r\n\t long diffOfDays = diffInMSec / (24 * 60 * 60 * 1000);\r\n\r\n\t System.out.println(\"Date Difference in : \" + diffOfDays + \" days.\");\r\n\r\n\t}", "private long getDaysBetween(LocalDateTime d1, LocalDateTime d2) {\n return d1.until(d2,DAYS);\n }", "public static long getDateDiffer(Calendar cal1, Calendar cal2){\n long millis1 = cal1.getTimeInMillis();\n long millis2 = cal2.getTimeInMillis();\n\n // Calculate difference in milliseconds\n long diff = millis2 - millis1;\n\n // Calculate difference in seconds\n long diffSeconds = diff / 1000;\n\n // Calculate difference in minutes\n long diffMinutes = diff / (60 * 1000);\n\n // Calculate difference in hours\n long diffHours = diff / (60 * 60 * 1000);\n\n // Calculate difference in days\n long diffDays = diff / (24 * 60 * 60 * 1000);\n\n System.out.println(\"In milliseconds: \" + diff + \" milliseconds.\");\n System.out.println(\"In seconds: \" + diffSeconds + \" seconds.\");\n System.out.println(\"In minutes: \" + diffMinutes + \" minutes.\");\n System.out.println(\"In hours: \" + diffHours + \" hours.\");\n System.out.println(\"In days: \" + diffDays + \" days.\");\n\n return diffDays;\n }", "public long dayDiffCalculator(String a, String b){\n\n long dateDiff = 0;\n\n Date d1 = null;\n Date d2 = null;\n\n try{\n d1 = sdf.parse(a);\n d2 = sdf.parse(b);\n\n long diff = d2.getTime() - d1.getTime();\n\n long diffSeconds = diff / 1000 % 60;\n long diffMinutes = diff / (60 * 1000) % 60;\n long diffHours = diff / (60 * 60 * 1000) % 24;\n long diffDays = diff / (24 * 60 * 60 * 1000);\n\n dateDiff = diffDays;\n\n } catch (Exception e){}\n\n return dateDiff;\n }", "public long getDifference(Date startDate, Date endDate){\n\n //milliseconds\n long different = endDate.getTime() - startDate.getTime();\n\n System.out.println(\"startDate : \" + startDate);\n System.out.println(\"endDate : \"+ endDate);\n System.out.println(\"different : \" + different);\n\n long secondsInMilli = 1000;\n long minutesInMilli = secondsInMilli * 60;\n long hoursInMilli = minutesInMilli * 60;\n long daysInMilli = hoursInMilli * 24;\n\n long elapsedDays = different / daysInMilli;\n different = different % daysInMilli;\n\n long elapsedHours = different / hoursInMilli;\n different = different % hoursInMilli;\n\n long elapsedMinutes = different / minutesInMilli;\n different = different % minutesInMilli;\n\n long elapsedSeconds = different / secondsInMilli;\n\n System.out.printf(\n \"%d days, %d hours, %d minutes, %d seconds%n\",\n elapsedDays,\n elapsedHours, elapsedMinutes, elapsedSeconds);\n\n return elapsedMinutes;\n }", "public static int CalcularDiferenciaDiasFechas(Date fecha1, Date fecha2){\n Calendar cal1 = Calendar.getInstance();\r\n Calendar cal2 = Calendar.getInstance();\r\n cal1.setTime(fecha1);\r\n cal2.setTime(fecha2);\r\n // conseguir la representacion de la fecha en milisegundos\r\n long milis1 = cal1.getTimeInMillis();\r\n long milis2 = cal2.getTimeInMillis();\r\n // calcular la diferencia en milisengundos\r\n long diff = milis2 - milis1;\r\n // calcular la diferencia en horas\r\n Long diffHours = diff / (24 * 60 * 60 * 1000);\r\n return diffHours.intValue();\r\n }", "protected double difftime(double t2, double t1) {\n\t\treturn t2 - t1;\n\t}", "public static void main(String[] args) {\n LocalDate endofCentury = LocalDate.of(2014, 01, 01);\n LocalDate now = LocalDate.now();\n\n Period diff = Period.between(endofCentury, now);\n\n System.out.printf(\"Difference is %d years, %d months and %d days old\",\n diff.getYears(), diff.getMonths(), diff.getDays());\n\n\n //-----------------------------------------------------------------\n // java.time.temporal.ChronoUnit example to know the difference in days/months/years\n LocalDate dateOfBirth = LocalDate.of(1980, Month.JULY, 4);\n LocalDate currentDate = LocalDate.now();\n long diffInDays = ChronoUnit.DAYS.between(dateOfBirth, currentDate);\n long diffInMonths = ChronoUnit.MONTHS.between(dateOfBirth, currentDate);\n long diffInYears = ChronoUnit.YEARS.between(dateOfBirth, currentDate);\n\n\n LocalDateTime dateTime1 = LocalDateTime.of(1988, 7, 4, 0, 0);\n LocalDateTime dateTime2 = LocalDateTime.now();\n long diffInNano1 = ChronoUnit.NANOS.between(dateTime1, dateTime2);\n long diffInSeconds1 = ChronoUnit.SECONDS.between(dateTime1, dateTime2);\n long diffInMilli1 = ChronoUnit.MILLIS.between(dateTime1, dateTime2);\n long diffInMinutes1 = ChronoUnit.MINUTES.between(dateTime1, dateTime2);\n long diffInHours1 = ChronoUnit.HOURS.between(dateTime1, dateTime2);\n\n //-----------------------------------------------------------------\n // java.time.Duration example to know the difference in millis/seconds/minutes etc\n LocalDateTime dateTime3 = LocalDateTime.of(1988, 7, 4, 0, 0);\n LocalDateTime dateTime4 = LocalDateTime.now();\n int diffInNano2 = java.time.Duration.between(dateTime3, dateTime4).getNano();\n long diffInSeconds2 = java.time.Duration.between(dateTime3, dateTime4).getSeconds();\n long diffInMilli2 = java.time.Duration.between(dateTime3, dateTime4).toMillis();\n long diffInMinutes2 = java.time.Duration.between(dateTime3, dateTime4).toMinutes();\n long diffInHours2 = java.time.Duration.between(dateTime3, dateTime4).toHours();\n }", "public V difference(V v1, V v2);", "public long differenceBetweenDates(Date uno, Date due) {\r\n Calendar c1 = Calendar.getInstance();\r\n Calendar c2 = Calendar.getInstance();\r\n c1.setTime(uno);\r\n c2.setTime(due);\r\n\r\n long giorni = (c2.getTime().getTime() - c1.getTime().getTime()) / (24 * 3600 * 1000);\r\n\r\n return giorni;\r\n }", "public static void main(String[] args) {\n\t\tString start_date = \"10-01-2018 01:10:20\"; \r\n\r\n\t\tString end_date = \"10-06-2020 06:30:50\"; \r\n\r\n\tfindDifference(start_date, end_date);\r\n\r\n\t}", "public static double diff() {\n System.out.println(\"Enter minuend\");\n double a = getNumber();\n System.out.println(\"Enter subtrahend\");\n double b = getNumber();\n\n return a - b;\n }", "@RequiresApi(api = Build.VERSION_CODES.O)\n public int daysBetweenDates(LocalDate date1, LocalDate date2) {\n Period period = Period.between(date1, date2);\n int diff = period.getDays();\n return diff;\n }", "public long getDifference(DateTime dt) {\n return (this.date.getTime() - dt.date.getTime()) / 1000;\r\n }", "public static double diff(double a, double b) {\n return a - b;\n }", "private long dateDiffInNumberOfDays(LocalDate startDate, LocalDate endDate) {\n\n return ChronoUnit.DAYS.between(startDate, endDate);\n }", "private static long getDateDiff(Date date1, Date date2, TimeUnit timeUnit) {\n long diffInMillies = date2.getTime() - date1.getTime();\n return timeUnit.convert(diffInMillies, TimeUnit.MILLISECONDS);\n }", "public long printDifferenceDay(Date startDate, Date endDate){\n\n //milliseconds\n long different = endDate.getTime() - startDate.getTime();\n\n long secondsInMilli = 1000;\n long minutesInMilli = secondsInMilli * 60;\n long hoursInMilli = minutesInMilli * 60;\n long daysInMilli = hoursInMilli * 24;\n\n double elapsedDays = (double) Math.ceil((different / daysInMilli) + 0.5);\n different = different % daysInMilli;\n\n long elapsedHours = different / hoursInMilli;\n different = different % hoursInMilli;\n\n long elapsedMinutes = different / minutesInMilli;\n different = different % minutesInMilli;\n\n long elapsedSeconds = different / secondsInMilli;\n\n return (long) elapsedDays;\n //System.out.printf(\"%d days, %d hours, %d minutes, %d seconds%n\",elapsedDays,elapsedHours, elapsedMinutes, elapsedSeconds);\n\n }", "@Test\n public void shouldDisplayDaysExcludingWeekEndsSubday() {\n LocalDate date = LocalDate.of(2018,11,25);\n LocalDate newDate = LocalDate.of(2018,11,21);\n int offset = 2;\n int direction = -1;\n System.out.println(calcDate(date,offset,direction));\n\n assertEquals(newDate,calcDate(date,offset,direction),\"Should be equal\");\n\n }", "public int trimestre(LocalDate d);", "private int backDays(Calendar startDate, int delta) {\n Calendar newDate = (Calendar) startDate.clone();\n newDate.add(Calendar.DAY_OF_MONTH, -delta);\n return DateUtil.convertCalToInt(newDate);\n }", "public static void printDifference(Date startDate, Date endDate) {\n\n //milliseconds\n long different = endDate.getTime() - startDate.getTime();\n\n System.out.println(\"startDate : \" + startDate);\n System.out.println(\"endDate : \" + endDate);\n System.out.println(\"different : \" + different);\n\n long secondsInMilli = 1000;\n long minutesInMilli = secondsInMilli * 60;\n long hoursInMilli = minutesInMilli * 60;\n long daysInMilli = hoursInMilli * 24;\n\n long elapsedDays = different / daysInMilli;\n different = different % daysInMilli;\n\n long elapsedHours = different / hoursInMilli;\n different = different % hoursInMilli;\n\n long elapsedMinutes = different / minutesInMilli;\n different = different % minutesInMilli;\n\n long elapsedSeconds = different / secondsInMilli;\n\n System.out.printf(\n \"%d days, %d hours, %d minutes, %d seconds%n\",\n elapsedDays,\n elapsedHours, elapsedMinutes, elapsedSeconds);\n\n }", "private static int hoursDifference(Date date1, Date date2,TypeDate typeDate) {\n\n\t\tfinal int MILLI_TO_HOUR = 1000 * 60 * 60;\n\t\tfinal int MILLI_TO_DAY = MILLI_TO_HOUR*24;\n\t\tfinal int MILLI_TO_WEEK = MILLI_TO_DAY*7;\n\n\t\tint result=0;\n\t\tswitch (typeDate) {\n\n\t\tcase HOUR:\n\t\t\tresult= (int) (date2.getTime() - date1.getTime()) / MILLI_TO_HOUR;\n\t\t\tbreak;\n\n\t\tcase DAY:\n\t\t\tresult= (int) (date2.getTime() - date1.getTime()) / MILLI_TO_DAY;\n\t\t\tbreak;\n\n\t\tcase WEEK:\n\t\t\tresult= (int) (date2.getTime() - date1.getTime()) / MILLI_TO_WEEK;\n\t\t\tbreak;\n\n\t\t}\n\t\treturn result;\n\t}", "public int differneceInYears(MyDate comparedDate) {\n int diff = 0;\n int cyear = 0;\n int cmonth = 0;\n int cday = 0;\n\n if (earlier(comparedDate) == false) {\n \n cyear = comparedDate.year;\n cmonth = comparedDate.month;\n cday = comparedDate.day;\n\n while (true) {\n if (this.year == cyear && this.month == cmonth && this.day == cday) {\n break;\n }\n \n cday++;\n diff++;\n \n if (cday == 31) {\n cmonth++;\n cday = 1;\n }\n\n if (cday == 1 && cmonth == 13) {\n cmonth = 1;\n cyear++;\n }\n }\n return diff / 360;\n\n } else {\n \n cyear = this.year;\n cmonth = this.month;\n cday = this.day;\n\n while (true) {\n if (comparedDate.year == cyear && comparedDate.month == cmonth && comparedDate.day == cday) {\n break;\n }\n\n cday++;\n diff++;\n \n if (cday == 31) {\n cmonth++;\n cday = 1;\n }\n\n if (cday == 1 && cmonth == 13) {\n cmonth = 1;\n cyear++;\n }\n\n }\n return diff / 360;\n }\n\n }", "public static void main(String[] args){\n\n\n DateTimeFormatter formatter1 = DateTimeFormat.forPattern(\"yyyy-MM-dd\");\n DateTime d1 = DateTime.parse(\"2018-05-02\",formatter1);\n DateTime d2 = DateTime.parse(\"2018-05-01\",formatter1);\n System.out.println(Days.daysIn(new Interval(d2,d1)).getDays());\n }", "private static int dateDiff(final Date startDate, final Date endDate, final int field) {\n if (startDate == null) {\n throw new NullPointerException(\"start\");\n }\n\n if (endDate == null) {\n throw new NullPointerException(\"end\");\n }\n\n final Calendar start = Dates.toUTCCalendarWithoutTime(startDate);\n final Calendar end = Dates.toUTCCalendarWithoutTime(endDate);\n int elapsed = 0;\n\n if (start.before(end)) {\n while (start.before(end)) {\n start.add(field, 1);\n elapsed++;\n }\n } else if (start.after(end)) {\n while (start.after(end)) {\n start.add(field, -1);\n elapsed--;\n }\n }\n\n return elapsed;\n }", "public static String calcualte_timeDifference(String datetobeFormatted) {\n\n int days = 0,hours = 0,minutes = 0,seconds = 0,weeks=0;\n try {\n Calendar c = Calendar.getInstance();\n SimpleDateFormat df_current = new SimpleDateFormat(\"yyyy-MM-dd HH:mm:ss\");\n String formattedDate = df_current.format(c.getTime());\n Date date_current = df_current.parse(formattedDate);\n\n SimpleDateFormat df = new SimpleDateFormat(\"yyyy-MM-dd HH:mm:ss\");\n Date date = df.parse(datetobeFormatted);\n\n\n DateTime dt1 = new DateTime(date);\n DateTime dt2 = new DateTime(date_current);\n\n days = Days.daysBetween(dt1, dt2).getDays();\n hours = Hours.hoursBetween(dt1, dt2).getHours() % 24;\n minutes = Minutes.minutesBetween(dt1, dt2).getMinutes() % 60;\n seconds = Seconds.secondsBetween(dt1, dt2).getSeconds() % 60;\n weeks = Weeks.weeksBetween(dt1, dt2).getWeeks();\n\n\n Log.i(\"Date \",datetobeFormatted);\n Log.i(\"Days \",(Days.daysBetween(dt1, dt2).getDays() + \" days, \"));\n //Log.i(\"Days \",Hours.hoursBetween(dt1, dt2).getHours() % 24 + \" hours, \");\n //Log.i(\"Days \",Minutes.minutesBetween(dt1, dt2).getMinutes() % 60 + \" minutes, \");\n\n\n\n } catch (ParseException e) {\n e.printStackTrace();\n }\n if(weeks>1)\n {\n return weeks+\"w\";\n }else\n {\n return days+\"d\";\n }\n /* else if(hours>1 && days<1)\n {\n return hours+\"h\";\n }\n else if(minutes>1 && hours<1)\n {\n return minutes+\"m\";\n }else\n {\n return seconds+\"s\";\n }*/\n }", "public static long dateDiff(String dateString1, String dateString2) throws TestingException, ParseException {\n\n\t\tdateString1 = dateString1.replaceAll(\"T\", \" \");\n\t\tdateString2 = dateString2.replaceAll(\"T\", \" \");\n\t\tSimpleDateFormat format = new SimpleDateFormat(\"yyyy-MM-dd HH:mm:ss\");\n\n\t\tdateString1 = formatDateTime(dateString1, \"yyyy-MM-dd HH:mm:ss\");\n\t\tdateString2 = formatDateTime(dateString2, \"yyyy-MM-dd HH:mm:ss\");\n\n\t\tDate date1 = format.parse(dateString1);\n\t\tDate date2 = format.parse(dateString2);\n\n\t\tlong ret = date2.getTime() - date1.getTime();\n\t\treturn ret / 1000;\n\t}", "public static long getDateDiff(java.util.Date date1, java.util.Date date2, TimeUnit timeUnit) {\n\t long diffInMillies = date2.getTime() - date1.getTime();\n\t return timeUnit.convert(diffInMillies, timeUnit);\n\t}", "public static int differenceBetweenDatesInYears(Date first, Date last){\n Calendar firstCal = getCalendar(first);\n Calendar lastCal = getCalendar(last);\n int diff = lastCal.get(Calendar.YEAR) - firstCal.get(Calendar.YEAR);\n if (firstCal.get(Calendar.MONTH) > lastCal.get(Calendar.MONTH) ||\n (firstCal.get(Calendar.MONTH) == lastCal.get(Calendar.MONTH) && firstCal.get(Calendar.DATE) > lastCal.get(Calendar.DATE))) {\n diff--;\n }\n return diff;\n }", "public static int countDiffDay(Calendar c1, Calendar c2) {\n int returnInt = 0;\n while (!c1.after(c2)) {\n c1.add(Calendar.DAY_OF_MONTH, 1);\n returnInt++;\n }\n\n if (returnInt > 0) {\n returnInt = returnInt - 1;\n }\n\n return (returnInt);\n }", "public static int[] getElapsedTime(Date first, Date second) {\n if (first.compareTo(second) == 1 ) {\n return null;\n }\n int difDays = 0;\n int difHours = 0;\n int difMinutes = 0;\n\n Calendar c = Calendar.getInstance();\n c.setTime(first);\n int h1 = c.get(Calendar.HOUR_OF_DAY);\n int m1 = c.get(Calendar.MINUTE);\n\n c.setTime(second);\n int h2 = c.get(Calendar.HOUR_OF_DAY);\n int m2 = c.get(Calendar.MINUTE);\n\n if (sameDay(first, second)) {\n difHours = h2 - h1;\n } else {\n difDays = getNumberOfDays(first, second)-1;\n if (h1 >= h2) {\n difDays--;\n difHours = (24 - h1) + h2;\n } else {\n difHours = h2 - h1;\n }\n }\n\n if (m1 >= m2) {\n difHours--;\n difMinutes = (60 - m1) + m2;\n } else {\n difMinutes = m2 - m1;\n }\n\n int[] result = new int[3];\n result[0] = difDays;\n result[1] = difHours;\n result[2] = difMinutes;\n return result;\n }", "public static long getDateDiff(Date date1, Date date2, TimeUnit timeUnit) {\n\t\t long diffInMillies = date2.getTime() - date1.getTime();\n\t\t return timeUnit.convert(diffInMillies,TimeUnit.MILLISECONDS);\n\t\t}", "public static String calFormatDateDifference(final Date start, final Date end) {\r\n\t\tlong l1 = start.getTime();\r\n\t\tlong l2 = end.getTime();\r\n\t\tlong diff = l2 - l1;\r\n\r\n\t\tlong secondInMillis = 1000;\r\n\t\tlong minuteInMillis = secondInMillis * 60;\r\n\t\tlong hourInMillis = minuteInMillis * 60;\r\n\t\tlong dayInMillis = hourInMillis * 24;\r\n\t\tlong yearInMillis = dayInMillis * 365;\r\n\r\n\t\tlong elapsedYears = diff / yearInMillis;\r\n\t\tdiff = diff % yearInMillis;\r\n\t\tlong elapsedDays = diff / dayInMillis;\r\n\t\tdiff = diff % dayInMillis;\r\n\t\tlong elapsedHours = diff / hourInMillis;\r\n\t\tdiff = diff % hourInMillis;\r\n\t\tlong elapsedMinutes = diff / minuteInMillis;\r\n\t\tdiff = diff % minuteInMillis;\r\n\t\tlong elapsedSeconds = diff / secondInMillis;\r\n\t\t\r\n\t\treturn elapsedYears + \" years, \" + elapsedDays + \" days, \" + elapsedHours + \" hrs, \" + elapsedMinutes + \" mins, \" + elapsedSeconds + \" secs\";\r\n\t}", "private long daysBetween() throws ParseException {\n Scanner input = new Scanner(System.in);\n System.out.println(\"Enter the date of when you rented the game dd/MM/yyyy:\");\n String dateReturn = input.nextLine();\n Date date = new SimpleDateFormat(\"dd/MM/yyyy\").parse(dateReturn);\n long interval = new Date().getTime() - date.getTime();\n return TimeUnit.DAYS.convert(interval, TimeUnit.MILLISECONDS);\n }", "@SuppressWarnings(\"unchecked\")\n\t@Override\n\tpublic Integer getDateDiffWorkingDays(Date dateFrom, Date dateTo) {\n\t\tString sql = dateFrom.after(dateTo)\n\t\t\t\t? \"select count(*) * -1 from calendar where id_date >= :dateTo and id_date < :dateFrom and holiday = 0\"\n\t\t\t\t\t\t: \"select count(*) from calendar where id_date > :dateFrom and id_date <= :dateTo and holiday = 0\";\n\t\tQuery query = entityManager.createNativeQuery(sql);\n\t\tquery.setParameter(\"dateFrom\", dateFrom);\n\t\tquery.setParameter(\"dateTo\", dateTo);\n\t\treturn Utils.isNull(Utils.first(query.getResultList()), (Integer) null);\n\t}", "public static long daysDifference(String newDate, String oldDate) throws ParseException {\n SimpleDateFormat simpleDateFormat =\n new SimpleDateFormat(\"yyyy-MM-dd hh:mm:ss\");\n\n Date dOld = simpleDateFormat.parse(oldDate);\n Date dNew = simpleDateFormat.parse(newDate);\n long different = dNew.getTime() - dOld.getTime();\n return TimeUnit.DAYS.convert(different, TimeUnit.MILLISECONDS);\n }", "public double getDifference()\n {\n return first - second;\n }", "@Test\r\n public void testCalculDureeEffectiveLocation() {\r\n LocalDate date1 = LocalDate.parse(\"2018-04-02\");\r\n LocalDate date2 = LocalDate.parse(\"2018-04-10\");\r\n\r\n int res1 = DateUtil.calculDureeEffectiveLocation(Date.from(date1.atStartOfDay(ZoneId.systemDefault()).toInstant()),\r\n Date.from(date2.atStartOfDay(ZoneId.systemDefault()).toInstant()));\r\n assertEquals(7, res1);\r\n\r\n date1 = LocalDate.parse(\"2018-01-10\");\r\n date2 = LocalDate.parse(\"2018-01-17\");\r\n\r\n int res2 = DateUtil.calculDureeEffectiveLocation(Date.from(date1.atStartOfDay(ZoneId.systemDefault()).toInstant()),\r\n Date.from(date2.atStartOfDay(ZoneId.systemDefault()).toInstant()));\r\n assertEquals(5, res2);\r\n\r\n date1 = LocalDate.parse(\"2018-04-30\");\r\n date2 = LocalDate.parse(\"2018-05-09\");\r\n\r\n int res3 = DateUtil.calculDureeEffectiveLocation(Date.from(date1.atStartOfDay(ZoneId.systemDefault()).toInstant()),\r\n Date.from(date2.atStartOfDay(ZoneId.systemDefault()).toInstant()));\r\n assertEquals(6, res3);\r\n }", "public static int diferenciaFechas(Date f1, Date f2){\n \n long difMili = f1.getTime() - f2.getTime();\n long dif = (difMili / (1000*60*60*24));\n return (int) dif;\n }", "public int daysBetweenDates(String date1, String date2) {\n\n return 0;\n }", "public static long substract(Date source, Date target) {\n long t = STARDARD_FROM_TIMEMILLS;\n long sTimeMills = source.getTime() - t;\n long tTimeMills = target.getTime() - t;\n if (sTimeMills < tTimeMills) {\n long temp = sTimeMills;\n sTimeMills = tTimeMills;\n tTimeMills = temp;\n }\n long start = sTimeMills / TIME_MILLS_ONE_DAY;\n long end = tTimeMills / TIME_MILLS_ONE_DAY;\n return start - end;\n }", "boolean wasSooner (int[] date1, int[] date2) {\n\n// loops through year, then month, then day if previous value is the same\n for (int i = 2; i > -1; i--) {\n if (date1[i] > date2[i])\n return false;\n if (date1[i] < date2[i])\n return true;\n }\n return true;\n }", "public String[] getStarDate2(){\n\t\tstardate = new String[3];\n\t\t\n\t\tCalendar originaldate = Calendar.getInstance(TimeZone.getTimeZone(\"gmt\"));\n\t\tCalendar instancedate = Calendar.getInstance(TimeZone.getTimeZone(\"gmt\"));\n\t\t\t\t\n\t\t//originaldate.set(2008, 8, 8, 0, 0, 0);\n\t\toriginaldate.set(2162, 0, 4, 0, 0, 0);\n\t\t\n\t\t/*instancedate.add(Calendar.HOUR, 7);\n\t\tinstancedate.add(Calendar.MINUTE, 33);\n\t\tinstancedate.add(Calendar.YEAR, 156);\n\t\tinstancedate.add(Calendar.HOUR, -6*24);\n\t\tinstancedate.add(Calendar.MONTH, -3);*/\n\t\t\n\t\t\n\t\t// Get the represented date in milliseconds\n\t\tlong milis1 = originaldate.getTimeInMillis();\n\t\tlong milis2 = instancedate.getTimeInMillis();\n\t\t\n\t\t// Calculate difference in milliseconds\n\t\tlong diff = milis2 - milis1;\n\t\t \n\t\t// Calculate difference in seconds\n\t\tlong diffSeconds = diff / 1000;\n\t\t \n\t\t// Calculate difference in minutes\n\t\t//long diffMinutes = diff / (60 * 1000);\n\t\t\n\t\t// Calculate difference in hours\n\t\t//long diffHours = diff / (60 * 60 * 1000);\n\t\t\n\t\t// Calculate difference in days\n\t\t//long diffDays = diff / (24 * 60 * 60 * 1000);\n\t\t\n\t\t//double dec = -280000 - ((double)diffSeconds / 17280.0f);\n\t\tdouble dec = ((double)diffSeconds / 17280.0f);\n\t\t\t\t\n\t\tint mantel = (int)Math.ceil(dec/10000.0f);\n\t\t\t\t\n\t\tdouble kropp = (dec + (-(mantel-1)*10000.0f));\n\t\t\n\t\tif(kropp >= 10000) mantel += 2; //Fixing rounding error\n\t\t\n\t\tdouble mantelkropp = ((mantel-1) * 10000.0f) - kropp;\n\t\t\n\t\t/*Log.v(TAG, \"Diff: \" + Long.toString(diff));\n\t\t\n\t\tLog.v(TAG, \"Diff: \" + Double.toString(dec));\n\t\t\n\t\tLog.v(TAG, \"Diff: \" + Integer.toString(mantel));\n\t\t\n\t\tLog.v(TAG, \"Diff: \" + Double.toString(kropp));\n\t\t\n\t\tLog.v(TAG, \"Diff: \" + Double.toString(mantelkropp));*/\n\t\t\n\t\tdec = mantelkropp;\n\t\t\n\t\tDecimalFormat maxDigitsFormatter;\n\t\tif(dec < 0)\n\t\t\tmaxDigitsFormatter = new DecimalFormat(\"#000000.0000\");\n\t\telse\n\t\t\tmaxDigitsFormatter = new DecimalFormat(\"0000000.0000\");\n \n try {\n\t stardate[0] = \"[\" + (maxDigitsFormatter.format(dec)).substring(0, 3) + \"]\";\n\t stardate[1] = \" 0\" + (maxDigitsFormatter.format(dec)).substring(3, 9);\n\t stardate[2] = \"\" + (maxDigitsFormatter.format(dec)).substring(9, 11);\n } catch(StringIndexOutOfBoundsException sbe) {\n \tif(DEBUG) Log.v(TAG, \"Could not format \" + sbe);\n \tif(DEBUG) Log.v(TAG, maxDigitsFormatter.format(dec));\n \tstardate[2] = \"--\"; \t \n }\n \n Log.v(TAG, \"Stardate: \" + stardate[0] + stardate[1] + stardate[2]);\n return stardate;\n\t\t\n\t}", "public static void main(String[] args) {\n DateMidnight start = new DateMidnight(\"2019-07-01\");\n DateMidnight end = new DateMidnight(\"2019-07-22\");\n\n // Get days between the start date and end date.\n int days = Days.daysBetween(start, end).getDays();\n\n // Print the result.\n System.out.println(\"Days between \" +\n start.toString(\"yyyy-MM-dd\") + \" and \" +\n end.toString(\"yyyy-MM-dd\") + \" = \" +\n days + \" day(s)\");\n\n // Using LocalDate object.\n LocalDate date1 = LocalDate.parse(\"2019-07-01\");\n LocalDate date2 = LocalDate.now();\n days = Days.daysBetween(date1, date2).getDays();\n\n // Print the result.\n System.out.println(\"Days between \" +\n date1.toString(\"yyyy-MM-dd\") + \" and \" +\n date2.toString(\"yyyy-MM-dd\") + \" = \" +\n days + \" day(s)\");\n }", "public static long CalcularDiferenciaHorasFechas(Date fecha1, Date fecha2){\n Calendar cal1 = Calendar.getInstance();\r\n Calendar cal2 = Calendar.getInstance();\r\n cal1.setTime(fecha1);\r\n cal2.setTime(fecha2);\r\n // conseguir la representacion de la fecha en milisegundos\r\n long milis1 = cal1.getTimeInMillis();\r\n long milis2 = cal2.getTimeInMillis();\r\n // calcular la diferencia en milisengundos\r\n long diff = milis2 - milis1;\r\n // calcular la diferencia en horas\r\n long diffHours = diff / (60 * 60 * 1000);\r\n return diffHours;\r\n }", "@GET\n @Path(\"difference\")\n @Produces(MediaType.APPLICATION_JSON)\n public DukesAgeDifferenceResult getAgeDifference(@QueryParam(\"date\") String date) throws ParseException {\n int ageDifference;\n\n Calendar theirBirthday = new GregorianCalendar();\n Calendar dukesBirthday = new GregorianCalendar(1995, Calendar.MAY, 23);\n\n // Set the Calendar object to the passed-in Date\n theirBirthday.setTime(new SimpleDateFormat(\"yyyy-mm-dd\").parse(date));\n\n // Subtract the user's age from Duke's age\n ageDifference = dukesBirthday.get(Calendar.YEAR)\n - theirBirthday.get(Calendar.YEAR);\n logger.log(Level.INFO, \"Raw ageDifference is: {0}\", ageDifference);\n\n // Check to see if Duke's birthday occurs before the user's. If so,\n // subtract one from the age difference\n if (dukesBirthday.before(theirBirthday) && (ageDifference > 0)) {\n ageDifference--;\n }\n\n // Check to see if Duke's birthday occurs after the user's when the user \n // is younger. If so, subtract one from the age difference\n if (dukesBirthday.after(theirBirthday) && (ageDifference < 0)) {\n ageDifference++;\n }\n\n DukesAgeDifferenceResult result = new DukesAgeDifferenceResult();\n result.setAgeDifference(ageDifference);\n result.setHost(getLocalHostAddress());\n return result;\n }", "private int getDays() {\n\t\tlong arrival = arrivalDate.toEpochDay();\n\t\tlong departure = departureDate.toEpochDay();\n\t\tint days = (int) Math.abs(arrival - departure);\n\n\t\treturn days;\n\t}", "public static void main(String[] args) {\n\t\t\r\n\t\tLocalDate date1 = LocalDate.of(2017, 4, 12);\r\n\t\tLocalDate date2 = LocalDate.now();\r\n\t\t\r\n\t\tSystem.out.println(\"Date 1:\"+date1);\r\n\t\tSystem.out.println(\"Date 2:\"+date2+\"\\n\");\r\n\t\t\r\n\t\tPeriod p = Period.between(date1, date2);\r\n\t\t\r\n\t\tSystem.out.println(\"Years(Difference): \"+p.getYears());\r\n\t\tSystem.out.println(\"Months(Difference): \"+p.getMonths());\r\n\t\tSystem.out.println(\"Days(Difference): \"+p.getDays());\r\n\r\n\t}", "public static void main(String[] args) {\nDate d1 = new Date( 2019, 02, 22);\nSystem.out.println(d1);\n\n\nDate d2= new Date();\nSystem.out.println(d2);\nDate d3 = new Date(2000,11,11);\nSystem.out.println(d3);\nint a = d1.compareTo(d3);\nSystem.out.println(a);\nboolean b = d1.after(d2);\n\tSystem.out.println(b);\n\t}", "@Test \n\tpublic void testDaysBetween2() {\n\t\tDaysBetween d = new DaysBetween();\n\t\tLocalDate currentDate = LocalDate.now();\n\t\tLocalDate eventDate = LocalDate.of(2020, Month.OCTOBER, 20);\n\t\tlong days = d.CountDaysBetween(currentDate, eventDate);\n\t\t\n\t}", "private boolean isEqualDate(DateStruct d1, DateStruct d2)\n {\n boolean isEqual = false;\n if ( d1.year == d2.year && d1.month == d2.month && d1.day == d2.day )\n {\n isEqual = true;\n }\n return isEqual;\n }", "public int betweenDates() {\n return Period.between(arrivalDate, departureDate).getDays();\n }", "public int getDateRmain() throws ParseException {\n String[] dateParts = description.split(\"<br />\");\n\n\n SimpleDateFormat sdf = new SimpleDateFormat(\"E, dd MMMMM yyyy - HH:mm\");\n String start = dateParts[0];\n Date st = sdf.parse(start.split(\": \")[1]);\n String end = dateParts[1];\n Date ed = sdf.parse(end.split(\": \")[1]);\n Date now = Calendar.getInstance().getTime();\n\n //long daysRemain1=(e.getTime()-s.getTime()+1000000)/(3600*24*1000);\n long diffInMillies = Math.abs(ed.getTime() - st.getTime());\n long diff = TimeUnit.DAYS.convert(diffInMillies, TimeUnit.MILLISECONDS);\n\n dateRmain = (int)diff;\n return dateRmain;\n }", "@Test\n public void nbDaysBetweenSameYear(){\n Date date = new Date(1,Month.january,1970);\n assertEquals(date.nbDaysBetween(new Date(31,Month.december,1970)),364);\n }", "private String getTimestampDifference(){\r\n Log.d(TAG, \"getTimestampDifference: getting timestamp difference.\");\r\n\r\n String difference = \"\";\r\n Calendar c = Calendar.getInstance();\r\n SimpleDateFormat sdf = new SimpleDateFormat(\"yyyy-MM-dd'T'HH:mm:ss'Z'\", Locale.UK);\r\n sdf.setTimeZone(TimeZone.getTimeZone(\"Asia/Dubai\"));//google 'android list of timezones'\r\n Date today = c.getTime();\r\n sdf.format(today);\r\n Date timestamp;\r\n\r\n final String photoTimestamp = mJobPhoto.getDate_created();\r\n try{\r\n timestamp = sdf.parse(photoTimestamp);\r\n difference = String.valueOf(Math.round(((today.getTime() - timestamp.getTime()) / 1000 / 60 / 60 / 24 )));\r\n }catch (ParseException e){\r\n Log.e(TAG, \"getTimestampDifference: ParseException: \" + e.getMessage() );\r\n difference = \"0\";\r\n }\r\n return difference;\r\n }", "@Test\n public void shouldDisplayDaysExcludingWeekEndsSaturday() {\n LocalDate date = LocalDate.of(2018,11,17);\n LocalDate newDate = LocalDate.of(2018,11,26);\n int offset = 5;\n int direction = 1;\n System.out.println(calcDate(date,offset,direction));\n\n assertEquals(newDate,calcDate(date,offset,direction),\"Should be equal\");\n\n }", "public static void main(String[] args) {\n Date dt1 = new Date();\n System.out.println(dt1);\n \n //get the milli secs in Long from January 1st 1970 00:00:00 GMT... and then create the date Obj from that\n long millisecs = System.currentTimeMillis();\n System.out.println(millisecs);\n Date dt2 = new Date(millisecs);\n System.out.println(dt2);\n System.out.println(\"=========================\");\n\n millisecs = dt2.getTime();//convert dateObj back to millisecs\n System.out.println(millisecs);\n System.out.println(\"dt2.toString(): \" + dt2.toString());\n System.out.println(\"=========================\");\n\n //check if after?\n System.out.println(dt1.after(dt2)); \n System.out.println(dt2.after(dt1));\n //check if before?\n System.out.println(dt1.before(dt2));\n System.out.println(dt2.before(dt1));\n\n\n\n System.out.println(\"=========================\");\n\n // compare 2 date Objects\n //returns 0 if the obj Date is equal to parameter's Date.\n //returns < 0 if obj Date is before the Date para.\n //returns > 0 if obj Date is after the Date para.\n int result = dt1.compareTo(dt2);\n System.out.println(\"dt1 < dt2: \" + result);\n result = dt2.compareTo(dt1);\n System.out.println(\"dt2 > dt1: \" + result);\n\n System.out.println(\"=========================\");\n\n //return true/false on testing equality\n System.out.println(dt1.equals(dt2));\n System.out.println(dt2.equals(dt1));\n System.out.println(\"=========================\");\n\n\n\n\n\n }", "@Test\n public void getBetweenDaysTest(){\n\n Date bDate = DateUtil.parse(\"2021-03-01\", DatePattern.NORM_DATE_PATTERN);//yyyy-MM-dd\n System.out.println(\"bDate = \" + bDate);\n Date eDate = DateUtil.parse(\"2021-03-15\", DatePattern.NORM_DATE_PATTERN);\n System.out.println(\"eDate = \" + eDate);\n List<DateTime> dateList = DateUtil.rangeToList(bDate, eDate, DateField.DAY_OF_YEAR);//创建日期范围生成器\n List<String> collect = dateList.stream().map(e -> e.toString(\"yyyy-MM-dd\")).collect(Collectors.toList());\n System.out.println(\"collect = \" + collect);\n\n }", "public ArrayList<RdV> afficherRdV(LocalDate d1, LocalDate d2) {\n ArrayList<RdV> plage_RdV = new ArrayList();\n if (this.getAgenda() != null) {\n for (RdV elem_agenda : this.getAgenda()) {\n //si le rdv inscrit dans l'agenda est compris entre d1 et d2\n //d1<elem_agenda<d2 (OU d2<elem_agenda<d1 si d2<d1)\n if ((elem_agenda.getDate().isAfter(d1) && elem_agenda.getDate().isBefore(d2))\n || (elem_agenda.getDate().isAfter(d2) && elem_agenda.getDate().isBefore(d1))) {\n plage_RdV.add(elem_agenda);\n }\n }\n //on print la liste de rdv avant tri\n System.out.print(plage_RdV);\n //on print la liste de rdv avant tri\n System.out.print(\"\\n\");\n Collections.sort(plage_RdV);\n System.out.print(plage_RdV);\n\n }\n\n return plage_RdV;\n\n }", "public void calculateVacationDays(){\n }", "@Override\n public long dateCompare(LocalDate localDate1, LocalDate localDate2) {\n return localDate1.until(localDate2, ChronoUnit.MONTHS);\n }", "public static int getNumberOfDays(Date first, Date second)\n {\n Calendar c = Calendar.getInstance();\n int result = 0;\n int compare = first.compareTo(second);\n if (compare > 0) return 0;\n if (compare == 0) return 1;\n\n c.setTime(first);\n int firstDay = c.get(Calendar.DAY_OF_YEAR);\n int firstYear = c.get(Calendar.YEAR);\n int firstDays = c.getActualMaximum(Calendar.DAY_OF_YEAR);\n\n c.setTime(second);\n int secondDay = c.get(Calendar.DAY_OF_YEAR);\n int secondYear = c.get(Calendar.YEAR);\n\n // if dates in the same year\n if (firstYear == secondYear)\n {\n result = secondDay-firstDay+1;\n }\n\n // different years\n else\n {\n // days from the first year\n result += firstDays - firstDay + 1;\n\n // add days from all years between the two dates years\n for (int i = firstYear+1; i< secondYear; i++)\n {\n c.set(i,0,0);\n result += c.getActualMaximum(Calendar.DAY_OF_YEAR);\n }\n\n // days from last year\n result += secondDay;\n }\n\n return result;\n }", "@Test\n public void howManyDaysOlderIsBillThanPaul(){\n Contact Paul = ContactsFilter.filterByName(\"Paul Robinson\",allContacts).get(0);\n Contact Bill = ContactsFilter.filterByName(\"Bill McKnight\",allContacts).get(0);\n\n assertEquals(2862, TimeUnit.MILLISECONDS.toDays(ContactsFilter.findBirthDateDiff(Paul,Bill)));\n\n }", "public static void main(String[] args) throws ParseException {\n\t\tSimpleDateFormat format = new SimpleDateFormat(\"MM/dd/yyyy\");\n\t\tScanner scanner = new Scanner(System.in);\n\t\tSystem.out.println(\"This program will calculate duration between two dates in years, months, and days.\");\n\t\tSystem.out.println(\"Please enter two dates in the format mm/dd/yyyy\");\n\t\tDate userDate1 = format.parse(scanner.nextLine());\n\t\tDate userDate2 = format.parse(scanner.nextLine());\n\t\tscanner.close();\n\n\t\t// Calculates difference in milliseconds and then convert to days, months,\n\t\t// years.\n\t\tlong diff = userDate1.getTime() - userDate2.getTime();\n\t\tlong diffDays = TimeUnit.DAYS.convert(diff, TimeUnit.MILLISECONDS);\n\t\tdiffDays = Math.abs(diffDays);\n\t\tlong diffYears = diffDays / 365;\n\t\tlong diffMonths = diffDays / 30;\n\n\t\t// Prints output\n\t\tSystem.out.println(\n\t\t\t\t\"The difference is: \" + diffDays + \" days, \" + diffMonths + \" months, and \" + diffYears + \" years.\");\n\n\n\n\t}", "public static int daysDiff(Date earlierDate, Date laterDate) {\n\t\tif (earlierDate == null || laterDate == null)\n\t\t\treturn 0;\n\t\treturn (int) (((laterDate.getTime() / 60000) - (earlierDate.getTime() / 60000)) / (60 * 24));\n\t}", "@Override\n public final long daysInEffect(final LocalDate comparison) {\n return ChronoUnit.DAYS.between(this.getStartDate(), comparison);\n }", "public static float diffDate(String timeStart, String timeStop) throws Exception {\n SimpleDateFormat sdf = new SimpleDateFormat(DATE_FORMAT, Locale.ENGLISH);\n Date firstDate = sdf.parse(timeStart);\n Date secondDate = sdf.parse(timeStop);\n long diffInMilliSeconds = Math.abs(secondDate.getTime() - firstDate.getTime());\n return TimeUnit.MINUTES.convert(diffInMilliSeconds, TimeUnit.MILLISECONDS) / 60f;\n }", "static int[] Differenz(int[] a, int[] b){\n int i = a.length - 1;\n int[] c = new int [a.length];\n Arrays.fill(c, 0);\n while (i >= 0){\n if ((a[i] - b[i]) < 0){\n c[i] = (a[i] + 10) - b[i];\n c[i-1]--;\n }\n else c[i] = a[i] - b[i];\n i--;\n }\n return c;\n }", "public static long CountDaysBetween(String D1, String D2) {\n\t\tfinal DateTimeFormatter formatter = DateTimeFormatter.ofPattern(\"yyyy/MM/dd\");\n\t\tfinal LocalDate firstDate = LocalDate.parse(D1, formatter);\n\t\tfinal LocalDate secondDate = LocalDate.parse(D2, formatter);\n\t\tfinal long days = ChronoUnit.DAYS.between(firstDate, secondDate);\n\t\t// System.out.println(\"Days between: \" + days);\n\t\treturn days;\n\t}", "public Interval diff(Interval other) {\n\t\treturn this.plus(other.mul(new Interval(\"-1\", \"-1\")));\n\t}", "public static void main(String[] args) {\n\t\tDate date1 = new Date();\n\t\tDate date2 = new Date();\n\t\tSimpleDateFormat sdateFormat = new SimpleDateFormat(\"MM/dd/yyyy\");\n\t\tScanner sc = new Scanner(System.in);\n\n\t\tSystem.out.print(\"Enter the first date (MM/dd/yyyy): \");\n\t\ttry {\n\t\t\tdate1 = sdateFormat.parse(sc.nextLine());\n\t\t} catch (ParseException e) {\n\t\t\te.printStackTrace();\n\t\t}\n\n\t\tSystem.out.print(\"Enter the second date (MM/dd/yyyy): \");\n\t\ttry {\n\t\t\tdate2 = sdateFormat.parse(sc.nextLine());\n\t\t} catch (ParseException e) {\n\t\t\te.printStackTrace();\n\t\t}\n\n\t\t// find the absolute difference in millisecond (the order of the two dates\n\t\t// doesn't matter)\n\t\tlong diff = Math.abs(date2.getTime() - date1.getTime());\n\t\t// using TimeUnit to convert milliseconds to days\n\t\tint days = (int) TimeUnit.MILLISECONDS.toDays(diff);\n\n\t\t// display the difference\n\t\tSystem.out.printf(\"The difference in days between two dates is %d days\", days);\n\t\t\n\t\t//close the scanner\n\t\tsc.close();\n\n\t}", "public static long daysBetween(Date startDate, Date endDate) {\r\n\t Calendar sDate = getDatePart(startDate);\r\n\t Calendar eDate = getDatePart(endDate);\r\n\r\n\t long daysBetween = 0;\r\n\t while (sDate.before(eDate)) {\r\n\t sDate.add(Calendar.DAY_OF_MONTH, 1);\r\n\t daysBetween++;\r\n\t }\r\n\t return daysBetween;\r\n\t}", "public static int getNoOfDaysBetweenDates(Date fromDate, Date toDate) {\n\t\tint noOfDays = 0;\n\t\tif(fromDate.compareTo(toDate)>0){\n\t\tnoOfDays = fromDate.subtract(toDate);\n\t\tnoOfDays = -(noOfDays + 1);\n\t\t}else if(fromDate.compareTo(toDate)==0){\n\t\t\tnoOfDays = fromDate.subtract(toDate);\n\t\t\tnoOfDays = noOfDays + 1;\n\t\t}else{\n\t\t\tnoOfDays = toDate.subtract(fromDate);\n\t\t\tnoOfDays = noOfDays + 1;\n\t\t}\n\t\treturn noOfDays;\n\t}", "public static void main(String[] args) throws ParseException {\n String pattern = \"yyyy-MM-dd HH:mm:ss\";\n SimpleDateFormat sf = new SimpleDateFormat(pattern);\n Date yesterday = sf.parse(\"2016-12-11 23:59:59\");\n Date todayBegin = sf.parse(\"2016-12-12 00:00:00\");\n Date today1 = sf.parse(\"2016-12-12 00:00:01\");\n Date todayend = sf.parse(\"2016-12-12 23:23:59\");\n\n System.out.println(sf.format(yesterday) + \" is before \" + sf.format(todayBegin) + \":\" + yesterday.before(todayBegin));\n System.out.println(sf.format(todayBegin) + \" is before \" + sf.format(today1) + \":\" + todayBegin.before(today1));\n System.out.println(sf.format(todayBegin) + \" is before \" + sf.format(todayend) + \":\" + todayBegin.before(todayend));\n System.out.println(sf.format(today1) + \" is before \" + sf.format(todayend) + \":\" + today1.before(todayend));\n }", "private static int compareDateTime(XMLGregorianCalendar dt1, XMLGregorianCalendar dt2) {\n // Returns codes are -1/0/1 but also 2 for \"Indeterminate\"\n // which occurs when one has a timezone and one does not\n // and they are less then 14 hours apart.\n\n // F&O has an \"implicit timezone\" - this code implements the XMLSchema\n // compare algorithm.\n\n int x = dt1.compare(dt2) ;\n return convertComparison(x) ;\n }", "public static int compareDates(String date1, String date2) {\r\n int cmpResult = -11111; // ERROR\r\n try {\r\n HISDate d1 = HISDate.valueOf(date1);\r\n HISDate d2 = HISDate.valueOf(date2);\r\n cmpResult = d1.compare(d2);\r\n } catch (Exception e) {\r\n logger.error(\"compareDates(): Mindestens einer der zwei Datumswerte ist ungueltig: \" + date1 + \", \" + date2);\r\n cmpResult = -11111;\r\n }\r\n return cmpResult;\r\n }", "@Test\n public void shouldDisplayDaysExcludingWeekEndsSaturdayPlus5Days() {\n LocalDate date = LocalDate.of(2018,11,24);\n LocalDate newDate = LocalDate.of(2018,11,16);\n int offset = 5;\n int direction = -1;\n System.out.println(calcDate(date,offset,direction));\n\n assertEquals(newDate,calcDate(date,offset,direction),\"Should be equal\");\n\n }", "private ArrayList<DateData> getDaysBetweenDates(Date startDate, Date endDate) {\n\n String language = UserDTO.getUserDTO().getLanguage();\n ArrayList<DateData> dataArrayList = new ArrayList<>();\n Calendar calendar = new GregorianCalendar();\n calendar.setTime(startDate);\n\n while (calendar.getTime().before(endDate)) {\n Date result = calendar.getTime();\n try {\n int day = Integer.parseInt((String) android.text.format.DateFormat.format(\"dd\", result));\n int month = Integer.parseInt((String) android.text.format.DateFormat.format(\"MM\", result));\n int year = Integer.parseInt((String) android.text.format.DateFormat.format(\"yyyy\", result));\n dataArrayList.add(new DateData(day, month, year, \"middle\"));\n calendar.add(Calendar.DATE, 1);\n } catch (Exception e) {\n e.printStackTrace();\n }\n }\n\n int day = Integer.parseInt((String) android.text.format.DateFormat.format(\"dd\", endDate));\n int month = Integer.parseInt((String) android.text.format.DateFormat.format(\"MM\", endDate));\n int year = Integer.parseInt((String) android.text.format.DateFormat.format(\"yyyy\", endDate));\n if (language.equalsIgnoreCase(Constant.ENGLISH_LANGUAGE_CODE)) {\n dataArrayList.add(new DateData(day, month, year, \"right\"));\n } else {\n dataArrayList.add(new DateData(day, month, year, \"left\"));\n }\n\n DateData dateData = dataArrayList.get(0);\n if (language.equalsIgnoreCase(Constant.ENGLISH_LANGUAGE_CODE)) {\n dateData.setBackground(\"left\");\n\n } else {\n dateData.setBackground(\"right\");\n }\n dataArrayList.set(0, dateData);\n return dataArrayList;\n }", "public static long getDiffInMilliSeconds(Date date1, Date date2){\n return date1.getTime() - date2.getTime();\n }", "Pair<Date, Date> getForDatesFrame();", "double getAgeDays();", "public static int verschilJaren(final Date datum1, final Date datum2)\n\t{\n\t\tif (datum1 == null)\n\t\t{\n\t\t\tthrow new IllegalArgumentException(\"datum1 is leeg.\");\n\t\t}\n\t\tif (datum2 == null)\n\t\t{\n\t\t\tthrow new IllegalArgumentException(\"datum2 is leeg.\");\n\t\t}\n\t\tCalendar calendar0 = Calendar.getInstance();\n\t\tCalendar calendar1 = Calendar.getInstance();\n\t\tif (datum1.before(datum2))\n\t\t{\n\t\t\tcalendar0.setTime(datum1);\n\t\t\tcalendar1.setTime(datum2);\n\t\t}\n\t\telse\n\t\t{\n\t\t\tcalendar0.setTime(datum2);\n\t\t\tcalendar1.setTime(datum1);\n\t\t}\n\t\tint jaren0 = calendar0.get(Calendar.YEAR);\n\t\tint jaren1 = calendar1.get(Calendar.YEAR);\n\n\t\tint maanden0 = calendar0.get(Calendar.MONTH);\n\t\tint maanden1 = calendar1.get(Calendar.MONTH);\n\n\t\tint dag0 = calendar0.get(Calendar.DAY_OF_MONTH);\n\t\tint dag1 = calendar1.get(Calendar.DAY_OF_MONTH);\n\n\t\tint jarenVerschil = jaren1 - jaren0;\n\t\tint maandenVerschil = maanden1 - maanden0;\n\n\t\tif (dag0 > dag1)\n\t\t{\n\t\t\tmaandenVerschil -= 1;\n\t\t}\n\n\t\tif (maandenVerschil < 0)\n\t\t{\n\t\t\tjarenVerschil -= 1;\n\t\t}\n\t\treturn Math.abs(jarenVerschil);\n\t}", "public static boolean isRevdate(java.sql.Date date1,int CUST_ID,int MOVIE_ID) {\n SimpleDateFormat formatter1 = new SimpleDateFormat(\"yyyy-MM-dd\");\n java.util.Date date11 = null;\n try {\n date11 = formatter1.parse(\"1970-06-06\");\n } catch (ParseException e) {\n e.printStackTrace();\n }\n long r_date = date1.getTime();\n irate_Connection om = new irate_Connection();\n om.startConnection(\"user1\", \"password\", dbName);\n conn = om.getConnection();\n s = om.getStatement();\n irate_DQL dql = new irate_DQL(conn, s);\n java.sql.Date date2 = dql.atten(CUST_ID, MOVIE_ID);\n if(date2 == date11)\n return false;\n long a_date = date2.getTime();\n long diffinmill = r_date - a_date;\n long diff = TimeUnit.DAYS.convert(diffinmill,TimeUnit.MILLISECONDS);\n if(diff > 7 || diff <= 0)\n return false;\n else\n return true;\n }", "private double getSolutionDifference(int[] solution1, int[] solution2){\n double solutionDifference = 0;\n double solutionValue1 = calculateSolutionValue(solution1);\n double solutionValue2 = calculateSolutionValue(solution2);\n\n if(solutionValue1 >= solutionValue2){\n solutionDifference = solutionValue1 - solutionValue2;\n }\n else{\n solutionDifference = solutionValue2 - solutionValue1;\n }\n\n return solutionDifference;\n }", "public static String calculateFeedbackDays(String dataPublicare, String dataFeedback){\n DateTimeFormatter fmt = DateTimeFormatter.ofPattern(\"dd.MM.yyyy\");\n try {\n LocalDate startDate = LocalDate.parse(dataPublicare, fmt);\n LocalDate endDate = LocalDate.parse(dataFeedback, fmt);\n // Range = End date - Start date\n Long range = ChronoUnit.DAYS.between(startDate, endDate);\n\n return range.toString();\n }catch (Exception e){\n e.printStackTrace();\n }\n return \"0\";\n }", "public static Interval subtraction(Interval in1, Interval in2){\r\n //in1.print();\r\n //in2.print();\r\n return new Interval(in1.getFirstExtreme()-in2.getSecondExtreme(),in1.getSecondExtreme()-in2.getFirstExtreme(),in1.getFEincluded()=='['&&in2.getSEincluded()==']'?in1.getFEincluded():'(',in1.getSEincluded()==']'&&in2.getFEincluded()=='['?in1.getSEincluded():')');\r\n }" ]
[ "0.76062906", "0.725268", "0.7223506", "0.71618104", "0.7089453", "0.6867889", "0.6769124", "0.6747556", "0.6741762", "0.66403586", "0.6541047", "0.6536395", "0.6417829", "0.63999885", "0.6391146", "0.63283527", "0.6322493", "0.6288747", "0.62638074", "0.62602127", "0.6255076", "0.6238453", "0.6210895", "0.6198716", "0.61735046", "0.61708546", "0.6146619", "0.61283827", "0.6104321", "0.60691386", "0.60372394", "0.60204643", "0.6019571", "0.5993482", "0.5982655", "0.5963599", "0.5950034", "0.59316474", "0.5905307", "0.5883768", "0.58825725", "0.581455", "0.58080304", "0.579664", "0.5783531", "0.5778968", "0.5759653", "0.57577896", "0.57499665", "0.5749495", "0.5740736", "0.5728763", "0.5728099", "0.57190764", "0.5683493", "0.5669852", "0.56605005", "0.5652126", "0.56420314", "0.56147623", "0.5612086", "0.5611406", "0.55910707", "0.5585139", "0.5585125", "0.557265", "0.55649716", "0.5551257", "0.5548447", "0.55390924", "0.55072033", "0.550292", "0.54900295", "0.5488737", "0.54845804", "0.5478769", "0.54748476", "0.54714096", "0.54574025", "0.54478705", "0.5436156", "0.5426975", "0.54192144", "0.5386965", "0.5386514", "0.5382257", "0.5381942", "0.5365789", "0.53508735", "0.5346952", "0.533973", "0.53377134", "0.53375846", "0.5325637", "0.5324135", "0.5324066", "0.5318717", "0.53127337", "0.53098744", "0.5304373" ]
0.5782085
45
/generic metod to get list of YYYYMM between two dates in (yyyymmdd) format
public ArrayList<String> getYYYYMMList(String dateFrom, String dateTo) throws Exception { ArrayList<String> yyyyMMList = new ArrayList<String>(); try { Calendar calendar = Calendar.getInstance(); calendar.set(Integer.parseInt(dateFrom.split("-")[0]), Integer.parseInt(dateFrom.split("-")[1]) - 1, Integer.parseInt(dateFrom.split("-")[2])); String yyyyTo = dateTo.split("-")[0]; String mmTo = Integer.parseInt(dateTo.split("-")[1]) + ""; if (mmTo.length() < 2) { mmTo = "0" + mmTo; } String yyyymmTo = yyyyTo + mmTo; while (true) { String yyyy = calendar.get(Calendar.YEAR) + ""; String mm = (calendar.get(Calendar.MONTH) + 1) + ""; if (mm.length() < 2) { mm = "0" + mm; } yyyyMMList.add(yyyy + mm); if ((yyyy + mm).trim().toUpperCase().equalsIgnoreCase(yyyymmTo)) { break; } calendar.add(Calendar.MONTH, 1); } return yyyyMMList; } catch (Exception e) { throw new Exception("getYYYYMMList : dateFrom(yyyy-mm-dd)=" + dateFrom + " : dateTo(yyyy-mm-dd)" + dateTo + " : " + e.toString()); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Test\n public void getBetweenDaysTest(){\n\n Date bDate = DateUtil.parse(\"2021-03-01\", DatePattern.NORM_DATE_PATTERN);//yyyy-MM-dd\n System.out.println(\"bDate = \" + bDate);\n Date eDate = DateUtil.parse(\"2021-03-15\", DatePattern.NORM_DATE_PATTERN);\n System.out.println(\"eDate = \" + eDate);\n List<DateTime> dateList = DateUtil.rangeToList(bDate, eDate, DateField.DAY_OF_YEAR);//创建日期范围生成器\n List<String> collect = dateList.stream().map(e -> e.toString(\"yyyy-MM-dd\")).collect(Collectors.toList());\n System.out.println(\"collect = \" + collect);\n\n }", "List<Map<String, Object>> betweenDateFind(String date1, String date2) throws ParseException;", "List<Book> getBooksFromPeriod(LocalDate from,LocalDate to);", "public List<Reserva> getReservasPeriod(String dateOne, String dateTwo){\n /**\n * Instancia de SimpleDateFormat para dar formato correcto a fechas.\n */\n SimpleDateFormat parser = new SimpleDateFormat(\"yyyy-MM-dd\");\n /**\n * Crear nuevos objetos Date para recibir fechas fomateadas.\n */\n Date dateOneFormatted = new Date();\n Date dateTwoFormatted = new Date();\n /**\n * Intentar convertir las fechas a objetos Date; mostrar registro de\n * la excepción si no se puede.\n */\n try {\n dateOneFormatted = parser.parse(dateOne);\n dateTwoFormatted = parser.parse(dateTwo);\n } catch (ParseException except) {\n except.printStackTrace();\n }\n /**\n * Si la fecha inicial es anterior a la fecha final, devuelve una lista\n * de Reservas creadas dentro del intervalo de fechas; si no, devuelve\n * un ArrayList vacío.\n */\n if (dateOneFormatted.before(dateTwoFormatted)){\n return repositorioReserva.findAllByStartDateAfterAndStartDateBefore\n (dateOneFormatted, dateTwoFormatted);\n } else {\n return new ArrayList<>();\n }\n }", "public static void main(String[] args) {\n DataFactory df = new DataFactory();\n Date minDate = df.getDate(2000, 1, 1);\n Date maxDate = new Date();\n \n for (int i = 0; i <=1400; i++) {\n Date start = df.getDateBetween(minDate, maxDate);\n Date end = df.getDateBetween(start, maxDate);\n System.out.println(\"Date range = \" + dateToString(start) + \" to \" + dateToString(end));\n }\n\n}", "private static String dateRangeRestriction(String startDate, String endDate){\r\n String restriction = \"\";\r\n String[] startDateParts = startDate.split(\"/\");\r\n String[] endDateParts = endDate.split(\"/\");\r\n int prevYear = Integer.parseInt(endDateParts[0]) - 1; //year previus to End year\r\n int nextYear = Integer.parseInt(startDateParts[0]) + 1; //year next to End year\r\n if(prevYear-nextYear > 1){ // For intermediate years we may not care about days and months\r\n restriction += \" PubDate-Year:[\" + nextYear + \" TO \" + prevYear + \"] OR \";\r\n }\r\n if(endDateParts[0].equals(startDateParts[0])){ // Year of start and end is the same\r\n restriction += \"( +PubDate-Year:\" + endDateParts[0] \r\n + \" +PubDate-Month:[\" + startDateParts[1] + \" TO \" + endDateParts[1] \r\n + \"] +PubDate-Day:[\" + startDateParts[2] + \" TO \" + endDateParts[2] + \"])\";\r\n } else {\r\n restriction += \"( +PubDate-Year:\" + endDateParts[0] \r\n + \" +PubDate-Month:[ 01 TO \" + endDateParts[1] \r\n + \"] +PubDate-Day:[ 01 TO \" + endDateParts[2] + \"]) OR \"\r\n + \"( +PubDate-Year:\" + startDateParts[0] \r\n + \" +PubDate-Month:[ \" + startDateParts[1] + \" TO 12\" \r\n + \"] +PubDate-Day:[ \" + startDateParts[2] + \" TO 31 ])\";\r\n }\r\n restriction = \"(\" + restriction + \")\";\r\n return restriction;\r\n }", "List<LocalDate> getAvailableDates(@Future LocalDate from, @Future LocalDate to);", "public String[] DateOrder(String DateOne,String DateTwo){\n int DateOneValue=Integer.parseInt(DateOne);\n int DateTwoValue=Integer.parseInt(DateTwo);\n\n if(DateOneValue<DateTwoValue){\n if(DateOneValue<10){\n DateOne=CheckedDate.substring(0,4)+CheckedDate.substring(4,6)+\"0\"+DateOneValue;}\n\n else{\n DateOne=CheckedDate.substring(0,4)+CheckedDate.substring(4,6)+\"\"+DateOneValue;\n }\n if(DateTwoValue<10){\n DateTwo=CheckedDate.substring(0,4)+CheckedDate.substring(4,6)+\"0\"+DateTwoValue;\n }\n\n else{\n DateTwo=CheckedDate.substring(0,4)+CheckedDate.substring(4,6)+\"\"+DateTwoValue;\n }\n String Dates[]={DateOne,DateTwo};\n return Dates;\n }\n\n else{\n int nextmonth=Integer.parseInt(CheckedDate.substring(4,6))+1;\n int year=Integer.parseInt(CheckedDate.substring(0,4));\n int k=1;\n if(nextmonth==13){\n year=year+1;\n nextmonth=1;\n\n }\n String month=\"\";\n String n=\"\";\n\n if(nextmonth<10){\n n=\"\"+\"0\"+nextmonth;\n }\n\n else{\n n=\"\"+nextmonth;\n }\n int prevmonth=nextmonth-1;\n\n if(prevmonth<10){\n month=\"0\"+prevmonth;\n }\n\n else{\n month=month+prevmonth;\n }\n\n\n if(DateOneValue<10){\n DateOne=CheckedDate.substring(0,4)+month+\"0\"+DateOneValue;}\n\n else{\n DateOne=CheckedDate.substring(0,4)+month+\"\"+DateOneValue;\n }\n if(DateTwoValue<10){\n DateTwo=\"\"+year+\"\"+n+\"0\"+DateTwoValue;\n }\n\n else{\n DateTwo=year+\"\"+n+\"\"+DateTwoValue;\n }\n\n String Dates[]={DateOne,DateTwo};\n return Dates;\n }\n\n }", "public List<String> getAccountBetweenDate(String first_date, String second_date) throws Exception{\n Session session= sessionFactory.getCurrentSession();\n List<String> accountList= session.createQuery(\"select account_no from Account where date(opening_date) BETWEEN '\"+first_date+\"' AND '\"+second_date+\"'\",String.class).list();\n return AccountDto.AccountBtwDate(accountList);\n }", "private List<String> makeListOfDates(HashSet<Calendar> workDays) {\n //SimpleDateFormat sdf = new SimpleDateFormat(\"dd/MM/YYYY\");\n SimpleDateFormat sdf = new SimpleDateFormat();\n List<String> days = new ArrayList<>();\n for (Calendar date : workDays) {\n //SimpleDateFormat sdf = new SimpleDateFormat(\"dd/MM/YYYY\");\n days.add(sdf.format(date.getTime()));\n }\n\n return days;\n }", "public static String dateBetweenParse(Date start, Date end) {\r\n String result = \"\";\r\n long temp;\r\n temp = DateUtil.between(start, end, DateUnit.DAY);\r\n result += temp + \"day\";\r\n start = DateUtil.offset(start, DateField.DAY_OF_YEAR, (int) temp);\r\n\r\n temp = DateUtil.between(start, end, DateUnit.HOUR);\r\n result += temp + \"hour\";\r\n start = DateUtil.offset(start, DateField.HOUR, (int) temp);\r\n\r\n temp = DateUtil.between(start, end, DateUnit.MINUTE);\r\n result += temp + \"minute\";\r\n start = DateUtil.offset(start, DateField.MINUTE, (int) temp);\r\n\r\n temp = DateUtil.between(start, end, DateUnit.SECOND);\r\n result += temp + \"second\";\r\n start = DateUtil.offset(start, DateField.SECOND, (int) temp);\r\n\r\n return result;\r\n }", "public static ArrayList<String> datespanToList(String datePattern,String dateSpan)\n\t{\n\t\tArrayList<String> listDate = new ArrayList<String>();\n\t\tString fromDate = \"\";\n\t\tString toDate = \"\";\n\t\tint index = dateSpan.indexOf(\"-\");\n\t\tif(index!=-1)\n\t\t{\n\t\t\tfromDate = dateSpan.substring(0,index);\n//\t\t\tSystem.out.println(\"fromDate=\"+fromDate);\n\t\t\ttoDate = dateSpan.substring(index+1);\n//\t\t\tSystem.out.println(\"toDate=\"+toDate);\n\t\t\tif(fromDate.compareTo(toDate)>0)\n\t\t\t\treturn listDate;\n\t\t\tCalendar c = Calendar.getInstance();\n\t\t\tDate d;\n\t\t\ttry {\n\t\t\t\tSimpleDateFormat sf = new SimpleDateFormat(datePattern);\n\t\t\t\td = sf.parse(fromDate);\n\t\t\t\tc.setTime(d);\n//\t\t\t\tSystem.out.println(TimeOperator.timeFormatConvert(\"yyMMdd\",c.getTime()));\n\t\t\t\tString tempDate = \"\";\n\t\t\t\tfor(int i=1;i<5000;i++)//should not be more than 5000 days!\n\t\t\t\t{\n\t\t\t\t\ttempDate = TimeOperator.timeFormatConvert(datePattern,c.getTime());\n\t\t\t\t\tlistDate.add(tempDate);\n\t\t\t\t\tif(toDate.equals(tempDate))\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tc.add(Calendar.DAY_OF_MONTH, 1);\n\t\t\t\t}\n\t\t\t} catch (ParseException e) {\n\t\t\t\te.printStackTrace();\n\t\t\t}\n\t\t}\n\t\telse\n\t\t\tlistDate.add(dateSpan);\n\t\treturn listDate;\n\t}", "public void compareStartEndDate() {\n String[] startDateArray = startDate.split(dateOperator);\n String[] endDateArray = endDate.split(dateOperator);\n \n // Compares year first, then month, and then day.\n if (Integer.parseInt(startDateArray[2]) > Integer.parseInt(endDateArray[2])) {\n endDate = endDateArray[0] +\"/\"+ endDateArray[1] +\"/\"+ startDateArray[2];\n } else if (Integer.parseInt(startDateArray[2]) == Integer.parseInt(endDateArray[2])) {\n if (Integer.parseInt(startDateArray[1]) > Integer.parseInt(endDateArray[1])) {\n endDate = endDateArray[0] +\"/\"+endDateArray[1] +\"/\"+(Integer.parseInt(startDateArray[2])+1);\n } else if (Integer.parseInt(startDateArray[1]) == Integer.parseInt(endDateArray[1]) && \n Integer.parseInt(startDateArray[0]) > Integer.parseInt(endDateArray[0])) {\n endDate = endDateArray[0] +\"/\"+endDateArray[1] +\"/\"+(Integer.parseInt(startDateArray[2])+1);\n }\n }\n }", "public Set<String> getListOfMonths(String startDate, String endDate) {\n HashSet<String> set = new HashSet<String>();\n String first = getEndOfMonth(startDate);\n String last = getEndOfMonth(endDate);\n String current = last;\n\n set.add(current.substring(0, 6));\n\n while (!current.equals(first)) {\n Integer dateYear = Integer.parseInt(current.substring(0, 4));\n Integer dateMonth = Integer.parseInt(current.substring(4, 6)) - 1;\n Integer dateDay = Integer.parseInt(current.substring(6));\n\n Calendar c = new GregorianCalendar();\n c.set(dateYear, dateMonth, dateDay);\n c.add(Calendar.MONTH, -1);\n Date lastWeek = c.getTime();\n Calendar cal = Calendar.getInstance();\n cal.setTime(lastWeek);\n int year = cal.get(Calendar.YEAR);\n String month = String.format(\"%02d\", cal.get(Calendar.MONTH) + 1);\n String day = String.format(\"%02d\", cal.get(Calendar.DAY_OF_MONTH));\n\n current = getEndOfMonth(year + month + day);\n\n set.add(current.substring(0, 6));\n }\n\n return set;\n }", "public List<Reservation>reporteFechas(String date1, String date2){\n\n\t\t\tSimpleDateFormat parser = new SimpleDateFormat(\"yyyy-MM-dd\");\n\t\t\tDate dateOne = new Date();\n\t\t\tDate dateTwo = new Date();\n\n\t\t\ttry {\n\t\t\t\tdateOne = parser.parse(date1);\n\t\t\t\tdateTwo = parser.parse(date2);\n\t\t\t} catch (ParseException e) {\n\n\t\t\t\te.printStackTrace();\n\t\t\t}\n\t\t\tif(dateOne.before(dateTwo)){\n\t\t\t\treturn repositoryR.reporteFechas(dateOne, dateTwo);\n\t\t\t}else{\n\t\t\t\treturn new ArrayList<>();\n\t\t\t}\n\n\t \t\n\t }", "java.lang.String getStartDateYYYYMMDD();", "@Test\n void calculatePeriodRangeOver2Years() throws ParseException {\n LocalDate testDateStart = LocalDate.parse(\"2013-03-07\");\n LocalDate testDateEnd = LocalDate.parse(\"2017-12-17\");\n Map<String, String> periodMap = datesHelper.calculatePeriodRange(testDateStart, testDateEnd, false);\n assertEquals(\"57 months\", periodMap.get(PERIOD_START));\n assertEquals(\"17 December 2017\", periodMap.get(PERIOD_END));\n }", "private ArrayList<String> parseDays(String y, String startMonth, String endMonth, String weekDays) {\n\t\t\t\tArrayList<String> result = new ArrayList<>();\n\t\t\t\tint year = Integer.parseInt(y);\n\t\t\t\tint startM = Integer.parseInt(startMonth) - 1;\n\t\t\t\tint endM = Integer.parseInt(endMonth) - 1;\n\n\t\t\t\tMap<String, Integer> weekMap = new HashMap<>();\n\t\t\t\tweekMap.put(\"S\", 1);\n\t\t\t\tweekMap.put(\"M\", 2);\n\t\t\t\tweekMap.put(\"T\", 3);\n\t\t\t\tweekMap.put(\"W\", 4);\n\t\t\t\tweekMap.put(\"H\", 5);\n\t\t\t\tweekMap.put(\"F\", 6);\n\t\t\t\tweekMap.put(\"A\", 7);\n\n\t\t\t\tSet<Integer> set = new HashSet<>();\n\t\t\t\tfor (int i = 0; i < weekDays.length(); i++) {\n\t\t\t\t\tset.add(weekMap.get(weekDays.substring(i, i + 1)));\n\t\t\t\t}\n\n\t\t\t\tCalendar cal = new GregorianCalendar(year, startM, 1);\n\t\t\t\tdo {\n\t\t\t\t\tint day = cal.get(Calendar.DAY_OF_WEEK);\n\t\t\t\t\tif (set.contains(day)) {\n\t\t\t\t\t\tresult.add(\"\" + y + parseToTwoInteger((cal.get(Calendar.MONTH) + 1))\n\t\t\t\t\t\t\t\t+ parseToTwoInteger(cal.get(Calendar.DAY_OF_MONTH)));\n\t\t\t\t\t}\n\t\t\t\t\tcal.add(Calendar.DAY_OF_YEAR, 1);\n\t\t\t\t} while (cal.get(Calendar.MONTH) <= endM);\n\n\t\t\t\treturn result;\n\n\t\t\t}", "@Query(value = FIND_BOOKED_DATES)\n\tpublic List<BookingDate> getBooking(Date startDate, Date endDate);", "protected List<String> getAxisList(Date startDate, Date endDate, int calendarField) {\n List<String> stringList = new ArrayList<String>();\n SimpleDateFormat simpleDateFormat = new SimpleDateFormat(\"yyyy-MM-dd\");\n Date tempDate = startDate;\n Calendar tempCalendar = Calendar.getInstance();\n tempCalendar.setTime(tempDate);\n\n while (tempDate.before(endDate)) {\n stringList.add(simpleDateFormat.format(tempDate));\n tempCalendar.add(calendarField, 1);\n tempDate = tempCalendar.getTime();\n }\n\n return stringList;\n }", "@SuppressLint(\"SimpleDateFormat\")\n public static List<String> getDaysBetweenDates(String startDate, String endDate)\n throws ParseException {\n List<String> dates = new ArrayList<>();\n\n DateFormat df = new SimpleDateFormat(\"dd.MM.yyyy\");\n\n Calendar calendar = new GregorianCalendar();\n calendar.setTime(new SimpleDateFormat(\"dd.MM.yyyy\").parse(startDate));\n\n while (calendar.getTime().before(new SimpleDateFormat(\"dd.MM.yyyy\").parse(endDate)))\n {\n Date result = calendar.getTime();\n dates.add(df.format(result));\n calendar.add(Calendar.DATE, 1);\n }\n dates.add(endDate);\n return dates;\n }", "public DateRange getDateRange();", "public List<String> getListOfWeekEnds(String startDate, String endDate) {\n ArrayList<String> list = new ArrayList<String>();\n String first = getEndOfWeek(startDate);\n String last = getEndOfWeek(endDate);\n String current = last;\n\n list.add(current);\n\n int count = 1;\n\n while (current.compareTo(first) > 0) {\n Integer dateYear = Integer.parseInt(current.substring(0, 4));\n Integer dateMonth = Integer.parseInt(current.substring(4, 6)) - 1;\n Integer dateDay = Integer.parseInt(current.substring(6));\n\n Calendar c = new GregorianCalendar();\n c.set(dateYear, dateMonth, dateDay);\n\n if (count <= 4) {\n c.add(Calendar.DAY_OF_MONTH, -7);\n } else if (count <= 16) {\n c.add(Calendar.MONTH, -1);\n } else {\n c.add(Calendar.YEAR, -1);\n }\n\n Date lastWeek = c.getTime();\n Calendar cal = Calendar.getInstance();\n cal.setTime(lastWeek);\n int year = cal.get(Calendar.YEAR);\n String month = String.format(\"%02d\", cal.get(Calendar.MONTH) + 1);\n String day = String.format(\"%02d\", cal.get(Calendar.DAY_OF_MONTH));\n\n current = year + month + day;\n\n list.add(current);\n count++;\n }\n\n return list;\n }", "@Test\n void calculatePeriodLessThanOneMonth() throws ParseException {\n LocalDate testDateStart = LocalDate.parse(\"2015-03-07\");\n LocalDate testDateEnd = LocalDate.parse(\"2015-04-01\");\n Map<String, String> periodMap = datesHelper.calculatePeriodRange(testDateStart, testDateEnd, false);\n assertEquals(\"1 month\", periodMap.get(PERIOD_START));\n assertEquals(\"1 April 2015\", periodMap.get(PERIOD_END));\n }", "public List<String> getListOfAllWeekEnds(String startDate, String endDate) {\n ArrayList<String> list = new ArrayList<String>();\n String first = getEndOfWeek(startDate);\n String last = getEndOfWeek(endDate);\n String current = last;\n\n list.add(current);\n\n while (!current.equals(first)) {\n Integer dateYear = Integer.parseInt(current.substring(0, 4));\n Integer dateMonth = Integer.parseInt(current.substring(4, 6)) - 1;\n Integer dateDay = Integer.parseInt(current.substring(6));\n\n Calendar c = new GregorianCalendar();\n c.set(dateYear, dateMonth, dateDay);\n c.add(Calendar.DAY_OF_MONTH, -7);\n Date lastWeek = c.getTime();\n Calendar cal = Calendar.getInstance();\n cal.setTime(lastWeek);\n int year = cal.get(Calendar.YEAR);\n String month = String.format(\"%02d\", cal.get(Calendar.MONTH) + 1);\n String day = String.format(\"%02d\", cal.get(Calendar.DAY_OF_MONTH));\n\n current = year + month + day;\n\n list.add(current);\n }\n\n return list;\n }", "java.lang.String getEndDateYYYY();", "java.lang.String getStartDateYYYY();", "public void GetAvailableDates()\n\t{\n\t\topenDates = new ArrayList<TimePeriod>(); \n\t\t\n\t\ttry\n\t\t{\n\t\t\tConnector con = new Connector();\n\t\t\t\n\t\t\tString query = \"SELECT startDate, endDate FROM Available WHERE available_hid = '\"+hid+\"'\"; \n\t\t\tResultSet rs = con.stmt.executeQuery(query);\n\t\t\t\n\t\t\twhile(rs.next())\n\t\t\t{\n\t\t\t\tTimePeriod tp = new TimePeriod(); \n\t\t\t\ttp.stringStart = rs.getString(\"startDate\"); \n\t\t\t\ttp.stringEnd = rs.getString(\"endDate\"); \n\t\t\t\ttp.StringToDate();\n\t\t\t\t\n\t\t\t\topenDates.add(tp); \n\t\t\t}\n\t\t\tcon.closeConnection(); \n\t\t}\n\t\tcatch(Exception e)\n\t\t{\n\t\t\tSystem.out.println(e.getMessage());\n\t\t}\n\t}", "@Query(value = \"SELECT DATE(created_on),value FROM lost_products WHERE created_on >= ? AND created_on<= ?\", nativeQuery = true)\n List<Object[]> getLostsBetweenDates(LocalDate startDate, LocalDate endDate);", "private ArrayList<DateData> getDaysBetweenDates(Date startDate, Date endDate) {\n\n String language = UserDTO.getUserDTO().getLanguage();\n ArrayList<DateData> dataArrayList = new ArrayList<>();\n Calendar calendar = new GregorianCalendar();\n calendar.setTime(startDate);\n\n while (calendar.getTime().before(endDate)) {\n Date result = calendar.getTime();\n try {\n int day = Integer.parseInt((String) android.text.format.DateFormat.format(\"dd\", result));\n int month = Integer.parseInt((String) android.text.format.DateFormat.format(\"MM\", result));\n int year = Integer.parseInt((String) android.text.format.DateFormat.format(\"yyyy\", result));\n dataArrayList.add(new DateData(day, month, year, \"middle\"));\n calendar.add(Calendar.DATE, 1);\n } catch (Exception e) {\n e.printStackTrace();\n }\n }\n\n int day = Integer.parseInt((String) android.text.format.DateFormat.format(\"dd\", endDate));\n int month = Integer.parseInt((String) android.text.format.DateFormat.format(\"MM\", endDate));\n int year = Integer.parseInt((String) android.text.format.DateFormat.format(\"yyyy\", endDate));\n if (language.equalsIgnoreCase(Constant.ENGLISH_LANGUAGE_CODE)) {\n dataArrayList.add(new DateData(day, month, year, \"right\"));\n } else {\n dataArrayList.add(new DateData(day, month, year, \"left\"));\n }\n\n DateData dateData = dataArrayList.get(0);\n if (language.equalsIgnoreCase(Constant.ENGLISH_LANGUAGE_CODE)) {\n dateData.setBackground(\"left\");\n\n } else {\n dateData.setBackground(\"right\");\n }\n dataArrayList.set(0, dateData);\n return dataArrayList;\n }", "private String[] _filesBetween(Date begin, Date end, String[] files) {\n\n ArrayList list = new ArrayList(files.length);\n\n for (int i = 0; i < files.length; ++i) {\n File f = new File(files[i]);\n Date date = new Date(f.lastModified());\n if (date.before(end) && date.after(begin)) {\n list.add(files[i]);\n }\n }\n list.trimToSize();\n\n if (list.size() == 0)\n return null;\n\n String[] newlist = new String[0];\n newlist = (String[]) list.toArray(newlist); \n\n return newlist;\n }", "@Override\r\n\tpublic Student[] getBetweenBirthDates(Date firstDate, Date lastDate) {\n\t\treturn null;\r\n\t}", "public List<Forum> getListForumCreatedBetweenDateByIdForum(Date minDate,Date maxDate);", "private List<Long> makeListOfDatesLong(HashSet<Calendar> workDays) {\n List<Long> days = new ArrayList<>();\n if (workDays != null) {\n for (Calendar date : workDays) {\n //SimpleDateFormat sdf = new SimpleDateFormat(\"dd/MM/YYYY\");\n //days.add(sdf.format(date.getTime()));\n days.add(date.getTimeInMillis());\n }\n }\n return days;\n }", "public List<String> recordedDateList();", "public List<Book> getBooksFilteredByDate(GregorianCalendar startDate, GregorianCalendar endDate)\r\n\t{\r\n\t\tList<Book> books = new ArrayList<Book>();\r\n\t\tif(startDate.compareTo(endDate) != -1) {\r\n\t\t\tbooks = null;\r\n\t\t}\r\n\t\tfor(Book book : items) {\r\n\t\t\tGregorianCalendar date = book.getPubDate();\r\n\t\t\tboolean beforeEnd = true;\r\n\t\t\tif(endDate != null) {\r\n\t\t\t\tbeforeEnd = date.compareTo(endDate) == -1;\r\n\t\t\t}\r\n\t\t\tboolean afterStart = date.compareTo(startDate) > -1;\r\n\t\t\tif(beforeEnd && afterStart) {\r\n\t\t\t\tbooks.add(book);\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn books;\r\n\t}", "public List<DateType> toDateList() {\n List<DateType> result = new ArrayList<>();\n if (fromDate != null) {\n result.add(fromDate);\n }\n if (toDate != null) {\n result.add(toDate);\n }\n if (fromToDate != null) {\n result.add(fromToDate);\n }\n return result;\n }", "public List<Integer> getBookedRooms(Date fromDate, Date toDate)\r\n {\r\n String fDate = DateFormat.getDateInstance(DateFormat.SHORT).format(fromDate);\r\n String tDate = DateFormat.getDateInstance(DateFormat.SHORT).format(toDate);\r\n \r\n List<Integer> bookedRooms = new LinkedList<>();\r\n \r\n Iterator<Booking> iter = bookings.iterator();\r\n \r\n while(iter.hasNext())\r\n {\r\n Booking booking = iter.next();\r\n String bookingFromDate = DateFormat.getDateInstance(DateFormat.SHORT).format\r\n (booking.getFromDate());\r\n \r\n String bookingToDate = DateFormat.getDateInstance(DateFormat.SHORT).format\r\n (booking.getToDate());\r\n \r\n if(!booking.getCancelled() && !(fDate.compareTo(bookingToDate) == 0) \r\n && fDate.compareTo(bookingToDate) <= 0 &&\r\n bookingFromDate.compareTo(fDate) <= 0 && bookingFromDate.compareTo(tDate) <= 0)\r\n { \r\n List<Integer> b = booking.getRoomNr();\r\n bookedRooms.addAll(b);\r\n }\r\n }// End of while\r\n \r\n return bookedRooms;\r\n }", "private void getDateStartEnd(BudgetRecyclerView budget) {\n String viewByDate = budget.getDate();\n String[] dateArray = viewByDate.split(\"-\");\n for (int i = 0; i < dateArray.length; i++) {\n dateArray[i] = dateArray[i].trim();\n }\n startDate = CalendarSupport.convertStringToDate(dateArray[0]);\n endDate = CalendarSupport.convertStringToDate(dateArray[1]);\n }", "public void GetFileDates (long in_start_date, long in_end_date) {\n\n\n\n\n}", "public List<GLJournalApprovalVO> getAllPeriod(String ClientId, String FromDate, String ToDate) {\n String sqlQuery = \"\";\n PreparedStatement st = null;\n ResultSet rs = null;\n List<GLJournalApprovalVO> list = null;\n try {\n list = new ArrayList<GLJournalApprovalVO>();\n sqlQuery = \" SELECT c_period.c_period_id AS ID,to_char(c_period.startdate,'dd-MM-YYYY'),c_period.name,c_period.periodno FROM c_period WHERE \"\n + \" AD_CLIENT_ID IN (\" + ClientId\n + \") and c_period.startdate>=TO_DATE(?) and c_period.enddate<=TO_DATE(?) order by c_period.startdate \";\n st = conn.prepareStatement(sqlQuery);\n st.setString(1, FromDate);\n st.setString(2, ToDate);\n log4j.debug(\"period:\" + st.toString());\n rs = st.executeQuery();\n while (rs.next()) {\n GLJournalApprovalVO VO = new GLJournalApprovalVO();\n VO.setId(rs.getString(1));\n VO.setStartdate(rs.getString(2));\n VO.setName(rs.getString(3));\n VO.setPeriod(rs.getString(4));\n list.add(VO);\n\n }\n } catch (Exception e) {\n log4j.error(\"Exception in getOrgs()\", e);\n }\n return list;\n }", "@Test\n void calculatePeriod12Months() throws ParseException {\n LocalDate testDateStart = LocalDate.parse(\"2016-08-12\");\n\n System.out.println(\"periodStartDate: \" + testDateStart);\n\n LocalDate testDateEnd = LocalDate.parse(\"2017-08-23\");\n\n System.out.println(\"periodEndDate: \" + testDateStart);\n Map<String, String> periodMap = datesHelper.calculatePeriodRange(testDateStart, testDateEnd, false);\n assertNull(periodMap.get(PERIOD_START));\n assertEquals(\"2017\", periodMap.get(PERIOD_END));\n\n }", "public static void main(String[] args) throws Exception {\n\t\tSystem.out.println(getMonthList(\"20161102\", \"20161101\"));\r\n//\t\tSystem.out.println(getMonthList(\"20161001\", \"20161101\"));\r\n//\t\tSystem.out.println(getDateList(\"20161001\", \"20161101\"));\r\n\t}", "public ArrayList<String> createDate(String quarter, String year) {\r\n\t\tArrayList<String> date = new ArrayList<>();\r\n\t\tString startDate = \"\";\r\n\t\tString endDate = \"\";\r\n\t\tif (quarter.equals(\"January - March\")) {\r\n\t\t\tstartDate = year + \"-01-01\";\r\n\t\t\tendDate = year + \"-03-31\";\r\n\t\t} else if (quarter.equals(\"April - June\")) {\r\n\t\t\tstartDate = year + \"-04-01\";\r\n\t\t\tendDate = year + \"-06-30\";\r\n\t\t} else if (quarter.equals(\"July - September\")) {\r\n\t\t\tstartDate = year + \"-07-01\";\r\n\t\t\tendDate = year + \"-09-30\";\r\n\t\t} else {\r\n\t\t\tstartDate = year + \"-10-01\";\r\n\t\t\tendDate = year + \"-12-31\";\r\n\t\t}\r\n\t\tdate.add(startDate);\r\n\t\tdate.add(endDate);\r\n\t\treturn date;\r\n\t}", "public static void main(String[] args){\n\n\n DateTimeFormatter formatter1 = DateTimeFormat.forPattern(\"yyyy-MM-dd\");\n DateTime d1 = DateTime.parse(\"2018-05-02\",formatter1);\n DateTime d2 = DateTime.parse(\"2018-05-01\",formatter1);\n System.out.println(Days.daysIn(new Interval(d2,d1)).getDays());\n }", "List<Bug> getCompletedBugsBetweenDates(Integer companyId, Date since, Date until);", "@Override\n public List<Event> searchByInterval(Date leftDate, Date rightDate) {\n TypedQuery<EventAdapter> query = em.createQuery(\n \"SELECT e FROM EventAdapter e \"\n + \"WHERE e.dateBegin BETWEEN :leftDate and :rightDate \"\n + \"ORDER BY e.id\", EventAdapter.class)\n .setParameter(\"leftDate\", leftDate)\n .setParameter(\"rightDate\", rightDate);\n\n return query.getResultList()\n .parallelStream()\n .map(EventAdapter::getEvent)\n .collect(Collectors.toList());\n }", "private List<String> findEmptyRoomsInRange(String startDate, String endDate) {\n /* startDate indices = 1,3,6 \n endDate indices = 2,4,5 */\n String emptyRoomsQuery = \"select r1.roomid \" +\n \"from rooms r1 \" +\n \"where r1.roomid NOT IN (\" +\n \"select roomid\" +\n \"from reservations\" + \n \"where roomid = r1.roomid and ((checkin <= to_date('?', 'DD-MON-YY') and\" +\n \"checkout > to_date('?', 'DD-MON-YY')) or \" +\n \"(checkin >= to_date('?', 'DD-MON-YY') and \" +\n \"checkin < to_date('?', 'DD-MON-YY')) or \" +\n \"(checkout < to_date('?', 'DD-MON-YY') and \" +\n \"checkout > to_date('?', 'DD-MON-YY'))));\";\n\n try {\n PreparedStatement erq = conn.prepareStatement(emptyRoomsQuery);\n erq.setString(1, startDate);\n erq.setString(3, startDate);\n erq.setString(6, startDate);\n erq.setString(2, endDate);\n erq.setString(4, endDate);\n erq.setString(5, endDate);\n ResultSet emptyRoomsQueryResult = erq.executeQuery();\n List<String> emptyRooms = getEmptyRoomsFromResultSet(emptyRoomsQueryResult);\n return emptyRooms;\n } catch (SQLException e) {\n System.out.println(\"Empty rooms query failed.\")\n }\n return null;\n}", "public static void main(String args[]){\n\t\tTimeUtil.getBetweenDays(\"2019-01-01\",TimeUtil.dateToStr(new Date(), \"-\"));\n\t\t\n\t\t/*\tTimeUtil tu=new TimeUtil();\n\t\t\tString r=tu.ADD_DAY(\"2009-12-20\", 20);\n\t\t\tSystem.err.println(r);\n\t\t\tString [] a= TimeUtil.getPerNyyMMdd(\"20080808\", \"4\",9);\n\t\t\tfor(int i=0;i<a.length;i++){\n\t\t\t\tSystem.out.println(a[i]);\n\t\t\t}\n\t\t\t\n\t\t\t\n\t\t\tSystem.out.println(TimeUtil.getPerNyyMMdd(\"20080808\", \"1\",9));\n\t\t\tSystem.out.println(TimeUtil.getPerNyyMMdd(\"20080808\", \"2\",3));\n\t\t\tSystem.out.println(TimeUtil.getPerNyyMMdd(\"20080808\", \"3\",3));\n\t\t\tSystem.out.println(TimeUtil.getPerNyyMMdd(\"20080808\", \"4\",3));\n\t*/\n\t\tTimeUtil tu=new TimeUtil();\n\t//\tString newDate = TimeUtil.getDateOfCountMonth(\"2011-03-31\", 6);\n\t//\tSystem.out.println(newDate);\n//\t\tSystem.err.println(tu.getDateTime(\"\")+\"|\");\n\t\t\n\t\t}", "@Override\r\n\tpublic ArrayList<SalesReturnBillPO> getBillsByDate(String from, String to) throws RemoteException {\n\t\tArrayList<SalesReturnBillPO> bills=new ArrayList<SalesReturnBillPO>();\r\n\t\ttry{\r\n\t\t\tStatement s=DataHelper.getInstance().createStatement();\r\n\t\t\tResultSet r=s.executeQuery(\"SELECT * FROM \"+billTableName+\r\n\t\t\t\t\t\" WHERE generateTime>'\"+from+\"' AND generateTime<DATEADD(DAY,1,\"+\"'\"+to+\"');\");\r\n\t\t\twhile(r.next()){\r\n\t\t\t\tSalesReturnBillPO bill=new SalesReturnBillPO();\r\n\t\t\t\tbill.setCustomerId(r.getString(\"SRBCustomerID\"));\r\n\t\t\t\tbill.setDate(r.getString(\"generateTime\").split(\" \")[0]);\r\n\t\t\t\tbill.setId(r.getString(\"SRBID\"));\r\n\t\t\t\tbill.setOperatorId(r.getString(\"SRBOperatorID\"));\r\n\t\t\t\tbill.setOriginalSBId(r.getString(\"SRBOriginalSBID\"));\r\n\t\t\t\tbill.setOriginalSum(r.getDouble(\"SRBReturnSum\"));\r\n\t\t\t\tbill.setRemark(r.getString(\"SRBRemark\"));\r\n\t\t\t\tbill.setReturnSum(r.getDouble(\"SRBReturnSum\"));\r\n\t\t\t\tbill.setSalesManName(r.getString(\"SRBSalesmanName\"));\r\n\t\t\t\tbill.setState(r.getInt(\"SRBCondition\"));\r\n\t\t\t\tbill.setTime(r.getString(\"generateTime\").split(\" \")[1]);\t\t\t\t\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tfor(int i=0;i<bills.size();i++){\r\n\t\t\t\tStatement s1=DataHelper.getInstance().createStatement();\r\n\t\t\t\tResultSet r1=s1.executeQuery(\"SELECT * FROM \"+recordTableName+\r\n\t\t\t\t\t\t\" WHERE SRRID=\"+bills.get(i).getId()+\";\");\r\n\t\t\t\tArrayList<SalesItemsPO> items=new ArrayList<SalesItemsPO>();\r\n\t\t\t\t\r\n\t\t\t\twhile(r1.next()){\r\n\t\t\t\t\tSalesItemsPO item=new SalesItemsPO(\r\n\t\t\t\t\t\t\tr1.getString(\"SRRComID\"),\r\n\t\t\t\t\t\t\tr1.getString(\"SRRRemark\"),\r\n\t\t\t\t\t\t\tr1.getInt(\"SRRComQuantity\"),\r\n\t\t\t\t\t\t\tr1.getDouble(\"SRRPrice\"),\r\n\t\t\t\t\t\t\tr1.getDouble(\"SRRComSum\"));\r\n\t\t\t\t\titems.add(item);\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\tbills.get(i).setSalesReturnBillItems(items);;\r\n\r\n\t\t\t}\r\n\r\n\t\t}catch(Exception e){\r\n\t\t\te.printStackTrace();\r\n\t\t\treturn null;\r\n\t\t}\r\n\t\treturn bills;\r\n\t}", "@RequestMapping(\"/getBookSale\")\n public List<BookSale> getBookSale(@RequestParam(\"start\")String start,\n @RequestParam(\"end\")String end) {\n// String str1 = \"2020-2-05 16:16:57\";\n// String str2 = \"2020-6-20 16:16:57\";\n Timestamp time1 = Timestamp.valueOf(start);\n Timestamp time2 = Timestamp.valueOf(end);\n System.out.println(start);\n System.out.println(end);\n\n return orderService.getBookSale(time1, time2);\n }", "public static String[] getDateRangeFromToday(int minimum_threshold, int maximum_threshold) {\n String minimum, maximum;\n\n Calendar c = Calendar.getInstance();\n c.add(Calendar.DAY_OF_MONTH, minimum_threshold - 1);\n minimum = c.get(Calendar.YEAR) + \"-\" +\n String.format(\"%02d\", (c.get(Calendar.MONTH) + 1)) + \"-\" +\n String.format(\"%02d\", (c.get(Calendar.DAY_OF_MONTH)));\n\n c = Calendar.getInstance();\n c.add(Calendar.DAY_OF_MONTH, maximum_threshold - 1);\n maximum = c.get(Calendar.YEAR) + \"-\" +\n String.format(\"%02d\", (c.get(Calendar.MONTH) + 1)) + \"-\" +\n String.format(\"%02d\", (c.get(Calendar.DAY_OF_MONTH)));\n\n return new String[] {minimum, maximum};\n }", "protected ArrayList<Attraction> TryParseDate(String i, ArrayList<Attraction> toRunOn) throws Exception {\n String[] dates = i.split(\"-\");\n ArrayList<Attraction> toReturn = new ArrayList<>();\n SimpleDateFormat Simp = new SimpleDateFormat(\"dd/mm/yy\", Locale.US);\n SimpleDateFormat simpe2 = new SimpleDateFormat(\"dd/mm/yyyy\", Locale.US);\n\n try {\n if (dates.length == 2 && !dates[0].equals(\"\") && !dates[1].equals(\"\")) {\n java.util.Date first = Simp.parse(dates[0]);\n java.util.Date second = Simp.parse(dates[1]);\n for (Attraction item : toRunOn) {\n java.util.Date s = simpe2.parse(item.getStartDate());\n java.util.Date e = simpe2.parse(item.getEndDate());\n if ((first.before(s) || first.compareTo(s) == 0) && (e.before(second) || e.compareTo(second) == 0))\n toReturn.add(item);\n }\n } else {\n if (dates[0].equals(\"\")) {\n java.util.Date second = Simp.parse(dates[1]);\n for (Attraction item : toRunOn) {\n java.util.Date e = simpe2.parse(item.getEndDate());\n if ((e.before(second) || e.compareTo(second) == 0))\n toReturn.add(item);\n }\n } else {\n try {\n java.util.Date first = Simp.parse(dates[0]);\n for (Attraction item : toRunOn) {\n java.util.Date s = simpe2.parse(item.getStartDate());\n if ((first.before(s) || first.compareTo(s) == 0))\n toReturn.add(item);\n }\n } catch (Exception e) {\n return new ArrayList<>();\n }\n }\n }\n }catch (Exception e){\n\n }\n return toReturn;\n }", "public List<Login> getUsers(Date startDate, Date endDate);", "Pair<Date, Date> getForDatesFrame();", "public List<String> getDates() {\n\n List<String> listDate = new ArrayList<>();\n\n Calendar calendarToday = Calendar.getInstance();\n SimpleDateFormat simpleDateFormat = new SimpleDateFormat(\"yyyy-MM-dd\", Locale.ENGLISH);\n String today = simpleDateFormat.format(calendarToday.getTime());\n\n Calendar calendarDayBefore = Calendar.getInstance();\n calendarDayBefore.setTime(calendarDayBefore.getTime());\n\n int daysCounter = 0;\n\n while (daysCounter <= 7) {\n\n if (daysCounter == 0) { // means that its present day\n listDate.add(today);\n } else { // subtracts 1 day after each pass\n calendarDayBefore.add(Calendar.DAY_OF_MONTH, -1);\n Date dateMinusOneDay = calendarDayBefore.getTime();\n String oneDayAgo = simpleDateFormat.format(dateMinusOneDay);\n\n listDate.add(oneDayAgo);\n\n }\n\n daysCounter++;\n }\n\n return listDate;\n\n }", "List<Appointment> getAppointmentOfNMonth(int month);", "public List<String> getMonthsList(){\n Calendar now = Calendar.getInstance();\n int year = now.get(Calendar.YEAR);\n\n String months[] = {\"JANUARY\", \"FEBRUARY\", \"MARCH\", \"APRIL\",\n \"MAY\", \"JUNE\", \"JULY\", \"AUGUST\", \"SEPTEMBER\",\n \"OCTOBER\", \"NOVEMBER\", \"DECEMBER\"};\n\n List<String> mList = new ArrayList<>();\n\n //3 months of previous year to view the attendances\n for(int i=9; i<months.length; i++){\n mList.add(months[i]+\" \"+(year-1));\n }\n\n //Months of Current Year\n for(int i=0; i<=(now.get(Calendar.MONTH)); i++){\n mList.add(months[i]+\" \"+year);\n }\n\n return mList;\n }", "private ArrayList<String> parseBusinessYears(String fiscalYearEnd) {\n\n Calendar todayCalendar = GregorianCalendar.getInstance();\n\n Calendar geschaeftsjahresendeCalendar = GregorianCalendar.getInstance();\n geschaeftsjahresendeCalendar.set(\n todayCalendar.get(Calendar.YEAR),\n Integer.parseInt(fiscalYearEnd.substring(3, 5)) - 1,\n Integer.parseInt(fiscalYearEnd.substring(0, 2)),\n 23, 59, 59);\n log.info(geschaeftsjahresendeCalendar.getTime().toString());\n\n\n String nextYearString = null;\n String currentYearString = null;\n String lastYearString = null;\n String twoYearsAgoString = null;\n String threeYearsAgoString = null;\n\n int inTwoYears = todayCalendar.get(Calendar.YEAR) + 2;\n int nextYear = todayCalendar.get(Calendar.YEAR) + 1;\n int currentYear = todayCalendar.get(Calendar.YEAR);\n int lastYear = todayCalendar.get(Calendar.YEAR) - 1;\n int twoYearsAgo = todayCalendar.get(Calendar.YEAR) - 2;\n int threeYearsAgo = todayCalendar.get(Calendar.YEAR) - 3;\n int fourYearsAgo = todayCalendar.get(Calendar.YEAR) - 4;\n\n if (fiscalYearEnd.equals(\"31.12.\")) {\n nextYearString = nextYear + \"e\";\n currentYearString = currentYear + \"e\";\n lastYearString = String.valueOf(lastYear);\n twoYearsAgoString = String.valueOf(twoYearsAgo);\n threeYearsAgoString = String.valueOf(threeYearsAgo);\n } else if (todayCalendar.before(geschaeftsjahresendeCalendar)){\n nextYearString = String.valueOf(currentYear).substring(2, 4) + \"/\" + String.valueOf(nextYear).substring(2, 4) + \"e\";\n currentYearString = String.valueOf(lastYear).substring(2, 4) + \"/\" + String.valueOf(currentYear).substring(2, 4) + \"e\";\n lastYearString = String.valueOf(twoYearsAgo).substring(2, 4) + \"/\" + String.valueOf(lastYear).substring(2, 4);\n twoYearsAgoString = String.valueOf(threeYearsAgo).substring(2, 4) + \"/\" + String.valueOf(twoYearsAgo).substring(2, 4);\n threeYearsAgoString = String.valueOf(fourYearsAgo).substring(2, 4) + \"/\" + String.valueOf(threeYearsAgo).substring(2, 4);\n } else if (todayCalendar.after(geschaeftsjahresendeCalendar)) {\n nextYearString = String.valueOf(nextYear).substring(2, 4) + \"/\" + String.valueOf(inTwoYears).substring(2, 4) + \"e\";\n currentYearString = String.valueOf(currentYear).substring(2, 4) + \"/\" + String.valueOf(nextYear).substring(2, 4) + \"e\";\n lastYearString = String.valueOf(lastYear).substring(2, 4) + \"/\" + String.valueOf(currentYear).substring(2, 4);\n twoYearsAgoString = String.valueOf(twoYearsAgo).substring(2, 4) + \"/\" + String.valueOf(lastYear).substring(2, 4);\n threeYearsAgoString = String.valueOf(threeYearsAgo).substring(2, 4) + \"/\" + String.valueOf(twoYearsAgo).substring(2, 4);\n }\n\n ArrayList<String> jahresArray = new ArrayList<>();\n jahresArray.addAll(Arrays.asList(nextYearString, currentYearString, lastYearString, twoYearsAgoString, threeYearsAgoString));\n\n log.info(jahresArray.toString());\n\n return jahresArray;\n }", "@GetMapping(\"/get\")\n public List<Task> getTasksBetweenDateAndTime(@RequestParam(\"dstart\") @DateTimeFormat(iso = DateTimeFormat.ISO.DATE) LocalDate dateStart,\n @RequestParam(\"dend\") @DateTimeFormat(iso = DateTimeFormat.ISO.DATE) LocalDate dateEnd,\n @RequestParam(value = \"number\", required = false, defaultValue = \"0\") int number) {\n return taskService.filterTasks(dateStart, dateEnd, number);\n }", "@Transactional(readOnly = true)\n public List<Employee> findBetween(Date firstBirthDate, Date lastBirthDate) {\n logger.debug(\"find employee range : {}\", SearshRange(firstBirthDate, lastBirthDate));\n return employeeDao.findBetween(firstBirthDate, lastBirthDate);\n }", "public List<moneytree.persist.db.generated.tables.pojos.Income> fetchRangeOfTransactionDate(LocalDate lowerInclusive, LocalDate upperInclusive) {\n return fetchRange(Income.INCOME.TRANSACTION_DATE, lowerInclusive, upperInclusive);\n }", "public static Date[] getRangeDateTimes(List dateTimes, Date dateTime, boolean millisecondIgnored)\n\t{\n\t\tfor (int i = 0; i < dateTimes.size() - 1; i++)\n\t\t{\n\t\t\tDate dateTime1 = (Date) dateTimes.get(i);\n\t\t\tDate dateTime2 = (Date) dateTimes.get(i + 1);\n\t\t\t\n\t\t\tlong time = dateTime.getTime();\n\t\t\tlong time1 = dateTime1.getTime();\n\t\t\tlong time2 = dateTime2.getTime();\n\t\t\t\n\t\t\tif (millisecondIgnored)\n\t\t\t{\n\t\t\t\ttime1 = time1 - time1 % 1000;\n\t\t\t\ttime2 = time2 - time2 % 1000;\n\t\t\t}\n\t\t\t\n\t\t\tif (time >= time1 && time <= time2)\n\t\t\t{\n\t\t\t\treturn new Date[] {dateTime1, dateTime2};\n\t\t\t}\t\n\t\t}\n\t\t\n\t\treturn null;\n\t}", "public ArrayList<RdV> afficherRdV(LocalDate d1, LocalDate d2) {\n ArrayList<RdV> plage_RdV = new ArrayList();\n if (this.getAgenda() != null) {\n for (RdV elem_agenda : this.getAgenda()) {\n //si le rdv inscrit dans l'agenda est compris entre d1 et d2\n //d1<elem_agenda<d2 (OU d2<elem_agenda<d1 si d2<d1)\n if ((elem_agenda.getDate().isAfter(d1) && elem_agenda.getDate().isBefore(d2))\n || (elem_agenda.getDate().isAfter(d2) && elem_agenda.getDate().isBefore(d1))) {\n plage_RdV.add(elem_agenda);\n }\n }\n //on print la liste de rdv avant tri\n System.out.print(plage_RdV);\n //on print la liste de rdv avant tri\n System.out.print(\"\\n\");\n Collections.sort(plage_RdV);\n System.out.print(plage_RdV);\n\n }\n\n return plage_RdV;\n\n }", "@RequestMapping(path = \"/availability\", method = RequestMethod.GET)\n public List<ReservationDTO> getAvailability(\n @RequestParam(value = \"start_date\", required = false)\n @DateTimeFormat(iso = ISO.DATE) LocalDate startDate,\n @RequestParam(value = \"end_date\", required = false)\n @DateTimeFormat(iso = ISO.DATE) LocalDate endDate) {\n\n Optional<LocalDate> optStart = Optional.ofNullable(startDate);\n Optional<LocalDate> optEnd = Optional.ofNullable(endDate);\n\n if (!optStart.isPresent() && !optEnd.isPresent()) {\n //case both are not present, default time is one month from now\n startDate = LocalDate.now();\n endDate = LocalDate.now().plusMonths(1);\n } else if (optStart.isPresent() && !optEnd.isPresent()) {\n //case only start date is present, default time is one month from start date\n endDate = startDate.plusMonths(1);\n } else if (!optStart.isPresent()) {\n //case only end date is present, default time is one month before end date\n startDate = endDate.minusMonths(1);\n } // if both dates are present, do nothing just use them\n\n List<Reservation> reservationList = this.service\n .getAvailability(startDate, endDate);\n\n return reservationList.stream().map(this::parseReservation).collect(Collectors.toList());\n }", "static void test(String type, String name, int startYear, int endYear) {\n DateResult dates02 = new DateResult();\n\n String text = name + \" 1年 2月 3日\";\n System.out.println(text);\n\n// try {\n// dates01 = DateV1Shim.interpDate(text);\n// } catch (Exception e) {\n// System.out.println(\" V1.ext: \" + e.getMessage());\n// }\n\n try {\n dates02 = DateUtil.interpDate(text, \"zh\", null, null, null);\n } catch (Exception e) {\n System.out.println(\" V2.ext: \" + e.getMessage());\n }\n\n results.add(\"\");\n// for (GenDateInterpResult date : dates01) {\n// results.add(text + \"|Date 1.0|\" + date.getDate().toGEDCOMX() + \"|\" + date.getAttrAsString(DateMetadata.ATTR_MATCH_TYPE));\n// results.add(text + \"|Date 1.0|\" + type + \"|\" + date.getDate().toGEDCOMX() + \"|\" + startYear + \"|\" + endYear);\n// }\n\n for (GenDateInterpResult date : dates02.getDates()) {\n// results.add(text + \"|Date 2.0|\" + date.getDate().toGEDCOMX() + \"|\" + date.getAttrAsString(DateMetadata.ATTR_MATCH_TYPE));\n if (date.getDate() instanceof GenSimpleDate) {\n GenSimpleDate sDate = (GenSimpleDate)date.getDate();\n if (sDate.getYear() >= startYear-1 && sDate.getYear() <= endYear+1) {\n// results.add(text + \"|Date 2.0|\" + type + \"|\" + date.getDate().toGEDCOMX() + \"|\" + startYear + \"|\" + endYear);\n results.add(text + \"|\" + type + \"|\" + date.getDate().toGEDCOMX() + \"|\" + startYear + \"|\" + endYear);\n }\n }\n }\n }", "public ObservableList<Date> getStudentDays(int studentID);", "public List<TimeSheet> getTimeSheetsBetweenTwoDateForAllEmp(LocalDate startDate, LocalDate endDate) {\n log.info(\"Inside TimeSheetService#getTimeSheetByPid Method\");\n return timeSheetRepository.getTimeSheets(startDate, endDate);\n }", "public Map<String, Long> getWorkingDays(String startDate) {\n Map<String, Long> mapYearAndMonth = new HashMap<>();\n DateTimeFormatter formatter = DateTimeFormatter.ofPattern(\"yyyyMMdd\");\n // convert String to LocalDate\n LocalDate startDateLocal = LocalDate.parse(startDate, formatter);\n long monthsBetween = ChronoUnit.MONTHS.between(startDateLocal, LocalDate.now());\n long yearsBetween = ChronoUnit.YEARS.between(startDateLocal, LocalDate.now());\n mapYearAndMonth.put(\"year\", yearsBetween);\n mapYearAndMonth.put(\"month\", monthsBetween - yearsBetween * 12);\n return mapYearAndMonth;\n }", "public static void main(String[] args) {\n\n\t\tLocalDate current =LocalDate.now();\n\tLocalDate ld =\tLocalDate.of(1989, 11, 30);\n\t\t\n\tPeriod pd =\tPeriod.between(current, ld);\n\tSystem.out.println(pd.getYears());\n\t}", "@Query(\n value = \"SELECT d\\\\:\\\\:date\\n\" +\n \"FROM generate_series(\\n\" +\n \" :startDate\\\\:\\\\:timestamp without time zone,\\n\" +\n \" :endDate\\\\:\\\\:timestamp without time zone,\\n\" +\n \" '1 day'\\n\" +\n \" ) AS gs(d)\\n\" +\n \"WHERE NOT EXISTS(\\n\" +\n \" SELECT\\n\" +\n \" FROM bookings\\n\" +\n \" WHERE bookings.date_range @> d\\\\:\\\\:date\\n\" +\n \" );\",\n nativeQuery = true)\n List<Date> findAvailableDates(@Param(\"startDate\") LocalDate startDate, @Param(\"endDate\") LocalDate endDate);", "DateRange extractPeriod() throws InvalidDateRangeException {\r\n DateRange dr = null;\r\n int indexOfFrom = Arrays.asList(lowerParams).lastIndexOf(\"from\");\r\n int indexOfTo = Arrays.asList(lowerParams).lastIndexOf(\"to\");\r\n if (indexOfFrom >= 0 && indexOfTo >= 0) {\r\n paramsFromIndex = indexOfFrom;\r\n if (indexOfTo + 1 < lowerParams.length) {\r\n /*\r\n * Parse start date\r\n */\r\n String[] startCandidates = Arrays.copyOfRange(lowerParams,\r\n indexOfFrom + 1, indexOfTo);\r\n\r\n DateTime start = DateUtil.parse(startCandidates);\r\n\r\n if (start != null && start.getHour() == null) {\r\n start = initTimeToStartOfDay(start);\r\n }\r\n\r\n /*\r\n * Parsed end date\r\n */\r\n String[] endCandidates = Arrays.copyOfRange(lowerParams, indexOfTo + 1,\r\n lowerParams.length);\r\n DateTime end = DateUtil.parse(endCandidates);\r\n\r\n if (end != null && end.getHour() == null) {\r\n end = initTimeToEndOfDay(end);\r\n }\r\n\r\n if (start != null && end != null) {\r\n dr = new DateRange(start, end);\r\n }\r\n }\r\n }\r\n return dr;\r\n }", "public ArrayList<Event> getCalendarEventsBetween(Calendar startingDate, Calendar endingDate)\n {\n ArrayList<Event> list = new ArrayList<>();\n\n for(int i = 0; i < events.size(); i++)\n {\n Calendar eventCalendar = events.get(i).getCalendar();\n\n if(isSame(startingDate, eventCalendar) || isSame(endingDate, eventCalendar) ||\n (eventCalendar.before(endingDate) && eventCalendar.after(startingDate)))\n {\n list.add(events.get(i));\n }\n }\n return list;\n }", "public static List<LogEntry> getAllByDates ( final String user, final String startDate, final String endDate ) {\n // Parse the start string for year, month, and day.\n final String[] startDateArray = startDate.split( \"-\" );\n final int startYear = Integer.parseInt( startDateArray[0] );\n final int startMonth = Integer.parseInt( startDateArray[1] );\n final int startDay = Integer.parseInt( startDateArray[2] );\n\n // Parse the end string for year, month, and day.\n final String[] endDateArray = endDate.split( \"-\" );\n final int endYear = Integer.parseInt( endDateArray[0] );\n final int endMonth = Integer.parseInt( endDateArray[1] );\n final int endDay = Integer.parseInt( endDateArray[2] );\n\n // Get calendar instances for start and end dates.\n final Calendar start = Calendar.getInstance();\n start.clear();\n final Calendar end = Calendar.getInstance();\n end.clear();\n\n // Set their values to the corresponding start and end date.\n start.set( startYear, startMonth, startDay );\n end.set( endYear, endMonth, endDay );\n\n // Check if the start date happens after the end date.\n if ( start.compareTo( end ) > 0 ) {\n System.out.println( \"Start is after End.\" );\n // Start is after end, return empty list.\n return new ArrayList<LogEntry>();\n }\n\n // Add 1 day to the end date. EXCLUSIVE boundary.\n end.add( Calendar.DATE, 1 );\n\n\n // Get all the log entries for the currently logged in users.\n final List<LogEntry> all = LoggerUtil.getAllForUser( user );\n // Create a new list to return.\n final List<LogEntry> dateEntries = new ArrayList<LogEntry>();\n\n // Compare the dates of the entries and the given function parameters.\n for ( int i = 0; i < all.size(); i++ ) {\n // The current log entry being looked at in the all list.\n final LogEntry e = all.get( i );\n\n // Log entry's Calendar object.\n final Calendar eTime = e.getTime();\n // If eTime is after (or equal to) the start date and before the end\n // date, add it to the return list.\n if ( eTime.compareTo( start ) >= 0 && eTime.compareTo( end ) < 0 ) {\n dateEntries.add( e );\n }\n }\n // Return the list.\n return dateEntries;\n }", "public static List<Row> filterDate(List<Row> inputList, LocalDateTime startOfDateRange, LocalDateTime endOfDateRange) {\n\t\t//checks to ensure that the start of the range (1st LocalDateTime input) is before the end of the range (2nd LocalDateTime input)\n\t\tif(startOfDateRange.compareTo(endOfDateRange) > 0) {\n\t\t\t//if not, then send an error and return empty list\n\t\t\tGUI.sendError(\"Error: start of date range must be before end of date range.\");\n\t\t\treturn Collections.emptyList();\n\t\t}\n\n\t\tList<Row> outputList = new ArrayList<>();\n\n\t\t//iterate through inputList, adding all rows that fall within the specified date range to the outputList\n\t\tfor(Row row : inputList) {\n\t\t\tif(row.getDispatchTime().compareTo(startOfDateRange) >= 0 && row.getDispatchTime().compareTo(endOfDateRange) <= 0) {\n\t\t\t\toutputList.add(row);\n\t\t\t}\n\t\t}\n\n\t\t//outputList is returned after being populated\n\t\treturn outputList;\n\t}", "static ArrayList arrayDate(String day, String dayNo, String month, String year){\n ArrayList<String> arraySplit = new ArrayList<>();\n\n arraySplit.add(day.replace(\",\",\"\"));//Monday\n arraySplit.add(dayNo.replace(\",\",\"\"));//23\n arraySplit.add(month.replace(\",\",\"\"));//March\n arraySplit.add(year.replace(\",\",\"\"));//2015\n return arraySplit;\n }", "private List<Date> getTestDates() {\n List<Date> testDates = new ArrayList<Date>();\n TimeZone.setDefault(TimeZone.getTimeZone(\"Europe/London\"));\n\n GregorianCalendar calendar = new GregorianCalendar(2010, 0, 1);\n testDates.add(new Date(calendar.getTimeInMillis()));\n\n calendar = new GregorianCalendar(2010, 0, 2);\n testDates.add(new Date(calendar.getTimeInMillis()));\n\n calendar = new GregorianCalendar(2010, 1, 1);\n testDates.add(new Date(calendar.getTimeInMillis()));\n\n calendar = new GregorianCalendar(2011, 0, 1);\n testDates.add(new Date(calendar.getTimeInMillis()));\n\n return testDates;\n }", "@Test\n public void getLessonMonths() throws Exception {\n ActiveAndroid.initialize(this);\n List<String> mmyy = Arrays.asList(\"10/17\", \"11/17\", \"12/17\", \"01/18\");\n List<Lesson> lessons = createLessons();\n ArrayList<String> result = mHomePresenter.getLessonMonths(lessons);\n\n assertEquals(mmyy, result);\n }", "public static void main(String[] args) {\n\t\tMonthDay month=MonthDay.now();\n\t\tLocalDate d=month.atYear(2015);\n\t\tSystem.out.println(d);\n\t\tMonthDay m=MonthDay.parse(\"--02-29\");\n\t\tboolean b=m.isValidYear(2019);\n\t\tSystem.out.println(b);\n\t\tlong n= month.get(ChronoField.MONTH_OF_YEAR);\n\t\tSystem.out.println(\"month of the year is:\"+n);\n\t\tValueRange r1=month.range(ChronoField.MONTH_OF_YEAR);\n\t\tSystem.out.println(r1);\n\t\tValueRange r2=month.range(ChronoField.DAY_OF_MONTH);\n\t\tSystem.out.println(r2);\n\n\t}", "public void testQueryDateRange() throws Exception {\n //db.expense.find({ date: { $gte:ISODate(\"2018-02-19T14:00:00Z\"), $lt: ISODate(\"2018-03-19T20:00:00Z\") } })\n /*BasicQuery query = new BasicQuery(\"{ date: { $gte:ISODate(\\\"2018-02-19T14:00:00Z\\\"), $lt: ISODate(\\\"2018-02-27T20:00:00Z\\\") } }\");\n List<Expense> expenses = mongoOperation.find(query, Expense.class);\n\n for(Expense e: expenses){\n System.out.println(e.toString());\n }*/\n // query.addCriteria(Criteria.where(\"age\").lt(50).gt(20));\n //List<User> users = mongoTemplate.find(query,User.class);\n SimpleDateFormat sdf = new SimpleDateFormat(\"dd/MM/yyyy\");\n Date d1 = sdf.parse(\"01/01/2018\");\n Date d2 = sdf.parse(\"01/02/2018\");\n\n\n List<Expense> expenses = expenseRepository.findByDateBetween(d1, d2);\n\n for (Expense e : expenses) {\n System.out.println(e.toString());\n }\n\n }", "String printListDate(String date);", "public List<XMLGregorianCalendar> convertDateList(List<Date> alist){\n\t\tList<XMLGregorianCalendar> blist = new ArrayList<XMLGregorianCalendar>(alist.size());\n\t\tfor(int i=0; i < alist.size(); i++){\n\t\t\tblist.add( this.getDate(alist.get(i)) );\n\t\t}\n\t\treturn blist;\n\t}", "@Test\n public void findReservationBetweenTest() {\n Collection<Reservation> expected = new HashSet<>();\n expected.add(reservation1);\n expected.add(reservation2);\n expected.add(reservation3);\n expected.add(reservation4);\n Mockito.when(reservationDao.findReservationBetween(Mockito.any(LocalDate.class), Mockito.any(LocalDate.class)))\n .thenReturn(expected);\n Collection<Reservation> result = reservationService.findReservationsBetween(LocalDate.now().minusDays(4),\n LocalDate.now().plusDays(15));\n Assert.assertEquals(result.size(), 4);\n Assert.assertTrue(result.contains(reservation1));\n Assert.assertTrue(result.contains(reservation2));\n Assert.assertTrue(result.contains(reservation3));\n Assert.assertTrue(result.contains(reservation4));\n }", "@RequestMapping(value = \"/getEmployeesReportBetweenDates\", method = RequestMethod.POST)\r\n public @ResponseBody String getEmployeesReportBetweenDates(\r\n @RequestParam(\"fromDate\") String fromDate, @RequestParam(\"toDate\") String toDate) {\r\n logger.info(\"inside ReportGenerationController getEmployeesReportBetweenDates()\");\r\n\r\n return reportGenerationService.getEmployeesReportBetweenDates(new Date(Long.valueOf(fromDate)),\r\n new Date(Long.valueOf(toDate)));\r\n }", "public static List delimitDateTime(Date startDateTime, Date endDateTime, int delimitedSecond)\n\t\tthrows IllegalArgumentException\n\t{\n\t\tlong interval = endDateTime.getTime() - startDateTime.getTime();\n\t\tlong delimitedMillisecond = delimitedSecond * 1000;\n\t\t\n\t\tif (interval < delimitedMillisecond)\n\t\t{\n\t\t\tthrow new IllegalArgumentException();\n\t\t}\n\t\t\n\t\tint splitCount = (int) (interval / delimitedMillisecond);\n\t\t\n\t\tList dateTimes = new ArrayList();\n\t\tdateTimes.add(startDateTime);\n\t\t\n\t\tfor (int i = 0; i < splitCount; i++)\n\t\t{\n\t\t\tDate lastDateTime = (Date) dateTimes.get(dateTimes.size() - 1);\n\t\t\tDate dateTime = new Date(lastDateTime.getTime() + delimitedMillisecond);\n\t\t\tdateTimes.add(dateTime);\n\t\t}\n\t\t\n\t\tDate lastDateTime = (Date) dateTimes.get(dateTimes.size() - 1);\n\t\t\n\t\tif (lastDateTime.getTime() < endDateTime.getTime())\n\t\t{\n\t\t\tDate dateTime = new Date(lastDateTime.getTime() + delimitedMillisecond);\n\t\t\tdateTimes.add(dateTime);\n\t\t}\n\t\t\n\t\treturn dateTimes;\n\t}", "private boolean checkStartDateBeforeEndDate(String startDate, String endDate) {\n SimpleDateFormat date = new SimpleDateFormat(\"ddMMyy\");\n Date startingDate = null;\n try {\n startingDate = date.parse(startDate);\n } catch (ParseException e) {\n e.printStackTrace();\n }\n Date endingDate = null;\n try {\n endingDate = date.parse(endDate);\n } catch (ParseException e) {\n e.printStackTrace();\n }\n if (startingDate.before(endingDate)) {\n return true;\n } else {\n return false;\n }\n }", "static public Vector<File> searchDateFiles(File dir, Date beginDate, Date endDate, String prefix) {\n\n\t\tVector<File> toReturn=new Vector<File>();\n\n\t\t// if directory ha files \n\t\tif(dir.isDirectory() && dir.list()!=null && dir.list().length!=0){\n\n//\t\t\tserach only files starting with prefix\n\n\t\t\t// get sorted array\n\t\t\tFile[] files=getSortedArray(dir, prefix);\n\n\t\t\tif (files == null){\n\t\t\t\tthrow new SpagoBIServiceException(SERVICE_NAME, \"Missing files in specified interval\");\n\t\t\t}\n\n\t\t\t// cycle on all files\n\t\t\tboolean exceeded = false;\n\t\t\tfor (int i = 0; i < files.length && !exceeded; i++) {\n\t\t\t\tFile childFile = files[i];\n\n\t\t\t\t// extract date from file Name\n\t\t\t\tDate fileDate=null;\n\t\t\t\ttry {\n\t\t\t\t\tfileDate = extractDate(childFile.getName(), prefix);\n\t\t\t\t} catch (ParseException e) {\n\t\t\t\t\t// TODO Auto-generated catch block\n\t\t\t\t\tlogger.error(\"error in parsing log file date, file will be ignored!\",e);\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\t// compare beginDate and timeDate, if previous switch file, if later see end date\n\t\t\t\t// compare then end date, if previous then endDate add file, else exit\n\n\t\t\t\t// if fileDate later than begin Date\n\t\t\t\tif(fileDate !=null && fileDate.after(beginDate)){\n\t\t\t\t\t// if end date later than file date\n\t\t\t\t\tif(endDate.after(fileDate)){\n\t\t\t\t\t\t// it is in the interval, add to list!\n\t\t\t\t\t\ttoReturn.add(childFile);\n\t\t\t\t\t}\n\t\t\t\t\telse { // if file date is later then end date, we are exceeding interval\n\t\t\t\t\t\texceeded = true;\n\t\t\t\t\t}\n\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn toReturn;\n\t}", "@Override\n public void onDateRangeSelected(int startDay, int startMonth, int startYear, int endDay, int endMonth, int endYear) {\n DateFormat df = DateFormat.getDateInstance(DateFormat.MEDIUM, Locale.getDefault());\n Calendar c = Calendar.getInstance();\n Calendar c2 = Calendar.getInstance();\n c.set(startYear,startMonth,startDay);\n c2.set(endYear, endMonth,endDay);\n\n String dataInicio = \"Start \" + df.format(c.getTime()) + \"\\n\";\n String dataFim = \" End \" + df.format(c2.getTime()) ;\n\n txt_inform.setText(dataInicio);\n txt_inform.append(dataFim);\n\n }", "private DateRangeFormatter calcCustomTimeFrame(int fromD, int fromM, int fromY, int toD, int toM, int toY) {\n\t\tif (reportRequest.getTimeFrame().getType() != TimeFrameType.CUSTOMIZED) return null;\n\t\t\n\t\tRange<Integer> correctDayRange = null;\n\t\tRange<Integer> days30 = new Range<Integer>(1, 30);\n\t\tRange<Integer> days31 = new Range<Integer>(1, 31);\n\t\tRange<Integer> days28 = new Range<Integer>(1, 28);\n\t\tRange<Integer> days29 = new Range<Integer>(1, 29);\n\t\tRange<Integer> months = new Range<Integer>(1, 12);\n\t\t\n\t\tLocalDate now = LocalDate.now();\n\t\tRange<Integer> years = new Range<Integer>(now.getYear() - 10, now.getYear() + 1);\n\t\t\n\t\t//check start year\n\t\tif (!years.intersects(fromY)) return null;\n\t\t\n\t\t//check start month\n\t\tif (!months.intersects(fromM)) return null;\n\t\t\n\t\t//check start day\n\t\tswitch(fromM) {\n\t\t\tcase 1: correctDayRange = days31; break;\n\t\t\tcase 2: {\n\t\t\t\t//check leap year\n\t\t\t\tif (fromY % 4 == 0) correctDayRange = days29;\n\t\t\t\telse correctDayRange = days28;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tcase 3: correctDayRange = days31; break;\n\t\t\tcase 4: correctDayRange = days30; break;\n\t\t\tcase 5: correctDayRange = days31; break;\n\t\t\tcase 6: correctDayRange = days30; break;\n\t\t\tcase 7: correctDayRange = days31; break;\n\t\t\tcase 8: correctDayRange = days31; break;\n\t\t\tcase 9: correctDayRange = days30; break;\n\t\t\tcase 10: correctDayRange = days31; break;\n\t\t\tcase 11: correctDayRange = days30; break;\n\t\t\tcase 12: correctDayRange = days31; break;\n\t\t}\n\t\t\n\t\tif (!correctDayRange.intersects(fromD)) return null;\n\t\t\n\t\t//check end year\n\t\tif (!years.intersects(toY)) return null;\n\t\t\n\t\t//check end month\n\t\tif (!months.intersects(toM)) return null;\n\t\t\n\t\t//check end day\n\t\tswitch(toM) {\n\t\t\tcase 1: correctDayRange = days31; break;\n\t\t\tcase 2: {\n\t\t\t\t//check leap year\n\t\t\t\tif (toY % 4 == 0) correctDayRange = days29;\n\t\t\t\telse correctDayRange = days28;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tcase 3: correctDayRange = days31; break;\n\t\t\tcase 4: correctDayRange = days30; break;\n\t\t\tcase 5: correctDayRange = days31; break;\n\t\t\tcase 6: correctDayRange = days30; break;\n\t\t\tcase 7: correctDayRange = days31; break;\n\t\t\tcase 8: correctDayRange = days31; break;\n\t\t\tcase 9: correctDayRange = days30; break;\n\t\t\tcase 10: correctDayRange = days31; break;\n\t\t\tcase 11: correctDayRange = days30; break;\n\t\t\tcase 12: correctDayRange = days31; break;\n\t\t}\n\t\t\n\t\tif (!correctDayRange.intersects(toD)) return null;\n\t\telse {\n\t\t\tLocalDate start = LocalDate.of(fromY, fromM, fromD);\n\t\t\tLocalDate end = LocalDate.of(toY, toM, toD);\n\t\t\treturn new DateRangeFormatter(start, end);\n\t\t}\n\t}", "@RequestMapping(\n value = \"/{start}/{end}\",\n method = RequestMethod.GET\n )\n public final Iterable<Entry> filter(\n @PathVariable @DateTimeFormat(iso = ISO.DATE) final Date start,\n @PathVariable @DateTimeFormat(iso = ISO.DATE) final Date end\n ) {\n if (end.before(start)) {\n throw new IllegalArgumentException(\"Start date must be before end\");\n }\n final List<Entry> result = new LinkedList<Entry>();\n List<Entry> entries = SecurityUtils.actualUser().getEntries();\n if (entries == null) {\n entries = Collections.emptyList();\n }\n for (final Entry entry : entries) {\n if (entry.getDate().after(start)\n && entry.getDate().before(end)) {\n result.add(entry);\n }\n }\n return result;\n }", "@RequestMapping(value = \"/getReportByNameBetweenDates\", method = RequestMethod.POST)\r\n public @ResponseBody String getReportByNameDates(@RequestParam(\"employeeId\") String employeeId,\r\n @RequestParam(\"fromDate\") String fromDate, @RequestParam(\"toDate\") String toDate) {\r\n logger.info(\"inside ReportGenerationController getReportByNameDates()\");\r\n\r\n return reportGenerationService.getReportByNameDates(employeeId,\r\n new Date(Long.valueOf(fromDate)), new Date(Long.valueOf(toDate)));\r\n }", "@GetMapping(\"/fechaBetween/{fecha1}/{fecha2}\")\n\tList<ReservasEntity> findByFechaBetween(@PathVariable(\"fecha1\") @DateTimeFormat(pattern = \"yyyy-MM-dd\") Date fecha1,\n\t\t\t@PathVariable(\"fecha2\") @DateTimeFormat(pattern = \"yyyy-MM-dd\") Date fecha2) {\n\t\treturn reservaRepo.findByFechaBetween(fecha1, fecha2);\n\t}", "public static LocalDate tryParseDateFromRange(List<String> datesWithoutYear, int dateIdx) {\n if (dateIdx >= datesWithoutYear.size() || dateIdx < 0) {\n throw new IllegalStateException(\"dateIdx is out of bounds or the list is empty\");\n }\n\n LocalDate today = LocalDate.now();\n int currentYear = today.getYear();\n\n String firstDateString = datesWithoutYear.get(FIRST_IDX);\n LocalDate currentDate = parseDayMonthStringWithYear(firstDateString, currentYear);\n if (currentDate.isBefore(today) && currentDate.getMonth() == Month.JANUARY) {\n currentDate = currentDate.plusYears(1);\n currentYear++;\n }\n\n for (int idx = 1; idx <= dateIdx; idx++) {\n String currDayMonth = datesWithoutYear.get(idx);\n LocalDate tempDate = parseDayMonthStringWithYear(currDayMonth, currentYear);\n\n if (tempDate.isBefore(currentDate) || tempDate.isEqual(currentDate)) {\n tempDate = tempDate.plusYears(1);\n currentYear++;\n }\n\n currentDate = tempDate;\n }\n\n return currentDate;\n }", "public List<Idea> getIdeasPublishedBetween(Calendar start, Calendar end) throws DataAccessException {\n List<Idea> ret = new ArrayList<>();\n if (!start.after(end)) {\n try {\n String queryStr = \"select i from Idea i \"\n + \"where i.publishedDate > start and \"\n + \"i.publishedDate < end\";\n Object res = em.createQuery(queryStr)\n .getResultList();\n ret = (List<Idea>) res;\n } catch (PersistenceException | EJBException pe) {\n throw new DataAccessException(pe, \"Error getting ideas between dates\");\n }\n }\n return ret;\n }", "@Override\r\n\tpublic void getPhotosByDate(String start, String end) {\n\t\tDate begin=null;\r\n\t\tDate endz=null;\r\n\t\t/*check if valid dates have been passed for both of the variables*/\r\n\t\ttry {\r\n\t\t\tDateFormat dateFormat = new SimpleDateFormat(\"MM/dd/yyyy\");\r\n\t\t\tdateFormat.setLenient(false);\r\n\t\t\tbegin = dateFormat.parse(start);\r\n\t\t\tendz = dateFormat.parse(end);\r\n\t\t\t}\r\n\t\t\tcatch (ParseException e) {\r\n\t\t\t String error=\"Error: Invalid date for one of inputs\";\r\n\t\t\t setErrorMessage(error);\r\n\t\t\t showError();\r\n\t\t\t return;\r\n\t\t\t}\r\n\t\tif(begin.after(endz)){\r\n\t\t\tString error=\"Error: Invalid dates! Your start is after your end\";\r\n\t\t\t setErrorMessage(error);\r\n\t\t\t showError();\r\n\t\t\t return;\r\n\t\t}\r\n\t\t/*I don't need the this if but I'm going to keep it\r\n\t\t * to grind your gears*/\r\n\t\tif(endz.before(begin)){\r\n\t\t\tString error=\"Error: Invalid dates! Your end date is before your start\";\r\n\t\t\t setErrorMessage(error);\r\n\t\t\t showError();\r\n\t\t\t return;\r\n\t\t}\r\n\t\tString listPhotos=\"\";\r\n\t\tList<IAlbum> album1=model.getUser(userId).getAlbums();\r\n\t\tString success=\"\";\r\n\t\tString albumNames=\"\";\r\n\t//\tInteractiveControl.PhotoCompare comparePower=new InteractiveControl.PhotoCompare();\r\n\t\tfor(int i=0; i<album1.size();i++){\r\n\t\t\tIAlbum temp=album1.get(i);\r\n\t\t\tList<IPhoto> photoList=temp.getPhotoList();\r\n\t\t\tInteractiveControl.PhotoCompare comparePower=new InteractiveControl.PhotoCompare();\r\n\t\t\tCollections.sort(photoList, comparePower);\r\n\t\t\tfor(int j=0; j<photoList.size();j++){\r\n\t\t\t\tif(photoList.get(j).getDate().after(begin) && photoList.get(j).getDate().before(endz)){\r\n\t\t\t\t\t/* getPAlbumNames(List<IAlbum> albums, String photoId)*/\r\n\t\t\t\t\talbumNames=getPAlbumNames(album1, photoList.get(j).getFileName());\r\n\t\t\t\t\tlistPhotos=listPhotos+\"\"+photoList.get(j).getCaption()+\" - \"+albumNames+\"- Date: \"+photoList.get(j).getDateString()+\"\\n\";\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\tsuccess=\"Photos for user \"+userId+\" in range \"+start+\" to \"+end+\":\\n\"+listPhotos;\r\n\t\tsetErrorMessage(success);\r\n\t\tshowError();\r\n\t\t\r\n\r\n\t}", "public int dateSearch(String o1_date, String o1_time, String o2_date, String o2_time) {\n\n int yearStartUser = Integer.valueOf(o1_date.substring(6));\n int monthStartUser = Integer.valueOf(o1_date.substring(3, 5));\n int dayStartUser = Integer.valueOf(o1_date.substring(0, 2));\n\n int yearEnd = Integer.valueOf(o2_date.substring(6));\n int monthEnd = Integer.valueOf(o2_date.substring(3, 5));\n int dayEnd = Integer.valueOf(o2_date.substring(0, 2));\n\n if (yearEnd > yearStartUser)\n return 1;\n if (yearEnd == yearStartUser && monthEnd > monthStartUser)\n return 1;\n if (yearEnd == yearStartUser && monthEnd == monthStartUser && dayEnd > dayStartUser)\n return 1;\n if (yearEnd == yearStartUser && monthEnd == monthStartUser && dayEnd == dayStartUser){\n if (o2_time.compareTo(o1_time)>0)return 1;\n if (o2_time.compareTo(o1_time)==0)return 0;\n\n }\n\n\n\n return -1;\n }", "@Override\n public List<String> getListOfDates() throws FlooringMasteryPersistenceException {\n \n List<String> listOfDates = new ArrayList<>();\n String dateToLoad = \"\"; \n String fileDirectory = System.getProperty(\"user.dir\"); // get the directory of where java was ran (this project's folder)\n \n File folder = new File(fileDirectory); // turn the directory string into a file\n File[] listOfFiles = folder.listFiles(); // get the list of files in the directory\n \n \n for (int i = 0; i < listOfFiles.length; i++) {\n if (listOfFiles[i].isFile()) {\n \n String nameOfFile = listOfFiles[i].getName(); // get the name of the file\n String numbersOnly = nameOfFile.replaceAll(\"[\\\\D]\", \"\"); // replace all non-number characters with whitespace\n\n if(numbersOnly.equals(\"\")){ // if there were no numbers in the file name (ex. pom.xml), do nothing\n \n }else{\n int dateOfFile = Integer.parseInt(numbersOnly); // get the numbers part of the file name\n int lengthOfdate = String.valueOf(dateOfFile).length(); // get the length of the int by converting it to a String and using .length\n if(lengthOfdate < numbersOnly.length()){ // if the leading 0 got chopped off when parsing\n dateToLoad = \"0\"+ dateOfFile; // add it back\n }else{\n dateToLoad = Integer.toString(dateOfFile); // otherwise if there were no leading 0s, set to the String version of dateOfFile, NOT dateToLoad, as that will have the previous date\n }\n listOfDates.add(dateToLoad);\n }\n \n }\n \n }\n \n return listOfDates;\n\n }", "@Override\n\tpublic List<Besoin> BesionByDate (String dateStart, String dateEnd) {\n\t\treturn dao.BesionByDate(dateStart, dateEnd);\n\t}", "public void showBookingsByDates(JTextArea output, Date fromDate, Date toDate)\r\n {\r\n output.setText(\"Bookinger mellom \" \r\n + (DateFormat.getDateInstance(DateFormat.MEDIUM).format(fromDate)) \r\n + \" og \" + (DateFormat.getDateInstance(DateFormat.MEDIUM).format(toDate)) + \"\\n\\n\");\r\n \r\n Iterator<Booking> iter = bookings.iterator();\r\n \r\n while(iter.hasNext())\r\n {\r\n Booking booking = iter.next();\r\n \r\n if((booking.getToDate().compareTo(toDate) >= 0 &&\r\n booking.getFromDate().compareTo(fromDate) <= 0) ||\r\n (booking.getToDate().compareTo(toDate) <= 0) && \r\n booking.getFromDate().compareTo(fromDate) >= 0)\r\n {\r\n output.append(booking.toString() \r\n + \"\\n*******************************************************\\n\");\r\n }//End of if\r\n }// End of while\r\n }", "private void validateDateRange(String startDateStr, String endDateStr) {\n Date startDate = null;\n Date endDate = null;\n DateFormat dateFormat = new SimpleDateFormat(\"yyyy-MM-dd\");\n \n try {\n if ((startDateStr != null) && (endDateStr != null)) {\n startDate = dateFormat.parse(startDateStr);\n endDate = dateFormat.parse(endDateStr);\n \n if ((startDate != null) && (endDate != null) && (startDate.after(endDate))) {\n throw new IllegalArgumentException(\n \"The date range is invalid. Start date ('\" + startDateStr + \n \"') should be less than end date ('\" + endDateStr + \"').\"); \t\n }\n }\n }\n catch (ParseException e) {\n logger.warn(\"Couldn't parse date string: \" + e.getMessage());\n }\n \n }" ]
[ "0.69182944", "0.68233705", "0.6758164", "0.63741404", "0.6268255", "0.61234254", "0.6007859", "0.59714454", "0.58655995", "0.5824826", "0.5817367", "0.5809082", "0.58020675", "0.5801842", "0.5787706", "0.57384115", "0.56784254", "0.56509507", "0.56492096", "0.56474215", "0.5615436", "0.5614922", "0.5606923", "0.5570486", "0.5536282", "0.5523494", "0.551393", "0.5495609", "0.54879445", "0.5473648", "0.5445514", "0.54109246", "0.54022413", "0.54020834", "0.5390777", "0.5377731", "0.5372609", "0.53707516", "0.5356675", "0.53427774", "0.53308386", "0.53276145", "0.53218853", "0.5320984", "0.53145254", "0.5314431", "0.5312685", "0.53066605", "0.52931845", "0.5284483", "0.5283577", "0.5279145", "0.52725595", "0.52601093", "0.5238078", "0.5226947", "0.5213839", "0.5202589", "0.51948214", "0.5190506", "0.5183334", "0.5177793", "0.51727164", "0.51615185", "0.5156546", "0.5151734", "0.5145842", "0.51442516", "0.5139455", "0.51336443", "0.51242423", "0.51214164", "0.5115708", "0.5098783", "0.50944537", "0.50884753", "0.5086697", "0.5077065", "0.50621516", "0.5059178", "0.5057249", "0.50539476", "0.5046732", "0.50341797", "0.5025121", "0.5023885", "0.50227064", "0.5002038", "0.4997738", "0.49967593", "0.49942094", "0.4993796", "0.49928924", "0.4980753", "0.49780095", "0.49612206", "0.49587306", "0.49474272", "0.49454844", "0.49444237" ]
0.755372
0
method to get date in specific format from date in (yyyymmdd) format
public String getDDMMMYYYYDate(String date) throws Exception { HashMap<Integer, String> month = new HashMap<Integer, String>(); month.put(1, "Jan"); month.put(2, "Feb"); month.put(3, "Mar"); month.put(4, "Apr"); month.put(5, "May"); month.put(6, "Jun"); month.put(7, "Jul"); month.put(8, "Aug"); month.put(9, "Sep"); month.put(10, "Oct"); month.put(11, "Nov"); month.put(12, "Dec"); try { String[] dtArray = date.split("-"); return dtArray[1] + "-" + month.get(Integer.parseInt(dtArray[1])) + "-" + dtArray[0]; } catch (Exception e) { throw new Exception("getDDMMMYYYYDate : " + date + " : " + e.toString()); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "java.lang.String getStartDateYYYYMMDD();", "private static String convertToDDMMYYYY(Date date) {\n\t\tString returnStr = \"\";\n\t\ttry {\n\t\tDateFormat format1 = new SimpleDateFormat(\"dd/MM/yyyy\");\n\t\treturnStr = format1.format(date);\n\t\t\n\t\t} catch (Exception e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t\treturn returnStr;\n\t}", "public static String getDate() {\n\t\tDate date = new Date();\n\t\tSimpleDateFormat formatter = new SimpleDateFormat(\"ddMMYYYY\");\n\t\tString strDate = formatter.format(date);\n\t\treturn strDate;\n\t}", "private static String getDateStr() {\n\t\tDate date = Calendar.getInstance().getTime();\n\t\tDateFormat dateFormat = new SimpleDateFormat(\"MMddyyy\");\n\t\tString dateStr = dateFormat.format(date);\n\t\treturn dateStr;\n\t}", "java.lang.String getFromDate();", "java.lang.String getToDate();", "public static String getYYYYMMDD()\r\n/* 65: */ {\r\n/* 66: 81 */ String nowTime = \"\";\r\n/* 67: 82 */ Date now = new Date();\r\n/* 68: 83 */ SimpleDateFormat formatter = new SimpleDateFormat(\"yyyyMMdd\");\r\n/* 69: 84 */ nowTime = formatter.format(now);\r\n/* 70: 85 */ return nowTime;\r\n/* 71: */ }", "public String ConvertDate(){\r\n//\t\tDate date=JavaUtils.getSystemDate();\r\n//\t DateFormat df = new SimpleDateFormat(\"yyyy/MM/dd\");\r\n\t String pattern = \"yyyy-MM-dd\";\r\n\t SimpleDateFormat simpleDateFormat = new SimpleDateFormat(pattern);\r\n\r\n\t String date = simpleDateFormat.format(new Date());\r\n//\t System.out.println(date);\r\n\t \r\n//\t String s = df.format(date);\r\n//\t String result = s;\r\n//\t try {\r\n//\t date=df.parse(result);\r\n//\t } catch (ParseException e) {\r\n//\t // TODO Auto-generated catch block\r\n//\t e.printStackTrace();\r\n//\t }\r\n\t return date;\r\n\t }", "public String getDate(){\n String d=\"\";\n String m=\"\";\n if(day<10){\n d=0+(String.valueOf(day));\n }\n else{\n d=String.valueOf(day);\n }\n\n if(month<10){\n m=0+(String.valueOf(month));\n }\n else{\n m=String.valueOf(month);\n }\n //returning day/month/year\n return (d+\"/\"+m+\"/\"+String.valueOf(year));\n }", "public static String dateConv(int date) {\n\t\tDate mills = new Date(date*1000L); \n\t\tString pattern = \"dd-MM-yyyy\";\n\t\tSimpleDateFormat simpleDateFormat = new SimpleDateFormat(pattern);\n\t\tsimpleDateFormat.setTimeZone(TimeZone.getTimeZone(\"GMT+1\"));\n\t\tString formattedDate = simpleDateFormat.format(mills);\n\t\treturn formattedDate;\n\t}", "public static String dateToString(Date date){\n\t\tSimpleDateFormat formatter = new SimpleDateFormat(\"MMddyy\");\n\t\treturn formatter.format(date);\n\t}", "java.lang.String getDate();", "public static String dateStr(String input ){\n String mm = input.substring(0,2);\n String dd = input.substring(3,5);\n String yyyy = input.substring(6,10);\n return dd + \" - \" + mm + \" - \" + yyyy;\n }", "public String convertDateToString(){\n\t\tString aDate = \"\";\n\t\taDate += Integer.toString(day);\n\t\taDate += \"/\";\n\t\taDate += Integer.toString(month);\n\t\taDate += \"/\";\n\t\taDate += Integer.toString(year);\n\t\treturn aDate;\n\t}", "String getDate();", "String getDate();", "public static String ddmmyyyyToyyyymmddd(String strDate) {\n DateFormat formatter = new SimpleDateFormat(\"dd-MM-yyyy\");\n Date date = null;\n try {\n date = (Date) formatter.parse(strDate);\n } catch (ParseException e) {\n e.printStackTrace();\n }\n SimpleDateFormat newFormat = new SimpleDateFormat(\"yyyy-MM-dd\");\n String finalString = newFormat.format(date);\n return finalString;\n }", "public static String formatDate(String date){\n String formatedDate = date;\n if (!date.matches(\"[0-9]{2}-[0-9]{2}-[0-9]{4}\")){\n if (date.matches(\"[0-9]{1,2}/[0-9]{1,2}/([0-9]{2}|[0-9]{4})\"))\n formatedDate = date.replace('/', '-');\n if (date.matches(\"[0-9]{1,2}.[0-9]{1,2}.([0-9]{2}|[0-9]{4})\")){\n if (formatedDate.matches(\"[0-9]{1}.[0-9]{1,2}.([0-9]{2}|[0-9]{4})\"))\n formatedDate = \"0\" + formatedDate;\n if (formatedDate.matches(\"[0-9]{2}.[0-9]{1}.([0-9]{2}|[0-9]{4})\"))\n formatedDate = formatedDate.substring(0, 3) + \"0\" + \n formatedDate.substring(3);\n if (formatedDate.matches(\"[0-9]{2}.[0-9]{2}.[0-9]{2}\")){\n String thisYear = String.valueOf(LocalDate.now().getYear());\n String century = thisYear.substring(0,2);\n /* If the last two digits of the date are larger than the two last digits of \n * the current date, then we can suppose that the year corresponds to the last \n * century.\n */ \n if (Integer.valueOf(formatedDate.substring(6)) > Integer.valueOf(thisYear.substring(2)))\n century = String.valueOf(Integer.valueOf(century) - 1);\n formatedDate = formatedDate.substring(0, 6) + century +\n formatedDate.substring(6); \n }\n }\n }\n return formatedDate;\n }", "public static String formatDate(Date date) {\n\t\tString newstring = new SimpleDateFormat(\"MM-dd-yyyy\").format(date);\n\t\treturn newstring;\n\t}", "public static String getFormattedMonthDay(String dateStr){\n\n Pattern fixDate = Pattern.compile(\"(\\\\d{4})(\\\\d{1,2})(\\\\d{1,2})\");\n Matcher correctDate = fixDate.matcher(dateStr);\n correctDate.find();\n\n String Nowiscorrect = String.format(\"%s/%s/%s\",\n correctDate.group(1),\n correctDate.group(2),\n correctDate.group(3));\n\n String MonthAndDay = currentDate.getdateWithMonthLetters(Nowiscorrect);\n\n\n Pattern rtl_CHARACTERS = Pattern.compile(\"^[۱-۹]+\");\n Matcher findTheYear = rtl_CHARACTERS.matcher(MonthAndDay);\n boolean isDone = findTheYear.find();\n\n return isDone ? findTheYear.replaceAll(\"\") : \"\";\n\n }", "public static String getddmmyyDate(String dt) {\n String dd = \"\", mm = \"\", yy = \"\";\n int i = 0;\n try {\n for (String retval : dt.split(\"-\")) {\n if (i == 0)\n yy = retval;\n else if (i == 1)\n mm = retval;\n else\n dd = retval;\n\n i++;\n }\n return (yy + \"-\" + mm + \"-\" + dd).toString();\n } catch (Exception e) {\n e.printStackTrace();\n return \"\";\n }\n }", "public static String convert( Date date )\r\n {\r\n SimpleDateFormat simpleDateFormat = new SimpleDateFormat( \"yyyy-MM-dd\" );\r\n\r\n return simpleDateFormat.format( date );\r\n }", "private String formatDate(Date date) {\n String resultDate;\n SimpleDateFormat dateFormat;\n dateFormat = new SimpleDateFormat(\"dd/MM/yyyy\");\n resultDate = dateFormat.format(date);\n return resultDate;\n }", "public static Date getFirstDate(Date date ) throws ParseException{ \n\t\tString format = \"yyyyMM\";\n\t\tdate = formatStrtoDate( format(date, format) + \"01\", format + \"dd\");\n\t\treturn date;\n\t}", "public static String formatDate(Date date) {\n final SimpleDateFormat formatter = new SimpleDateFormat(\"MM-dd-yyyy\");\n return formatter.format(date);\n }", "private String makeDateString(int day, int month, int year) {\n String str_month = \"\" + month;\n String str_day = \"\" + day;\n if (month < 10) {\n str_month = \"0\" + month;\n }\n if (day < 10) {\n str_day = \"0\" + day;\n }\n return year + \"-\" + str_month + \"-\" + str_day;\n }", "private String getFormattedDate(String date) {\n SimpleDateFormat dateFormat = new SimpleDateFormat(getString(R.string.received_import_date_format));\n SimpleDateFormat desiredDateFormat = new SimpleDateFormat(getString(R.string.desired_import_date_format));\n Date parsedDate;\n try {\n parsedDate = dateFormat.parse(date);\n return desiredDateFormat.format(parsedDate);\n } catch (ParseException e) {\n // Return an empty string in case of issues parsing the date string received.\n e.printStackTrace();\n return \"\";\n }\n }", "public String getFormatedDate(Date date) {\r\n\t\tSimpleDateFormat sdf=new SimpleDateFormat(\"dd/mm/yyyy\");\r\n\t\treturn sdf.format(date);\r\n\t}", "public String convertDateFormate(String dt) {\n String formatedDate = \"\";\n if (dt.equals(\"\"))\n return \"1970-01-01\";\n String[] splitdt = dt.split(\"-\");\n formatedDate = splitdt[2] + \"-\" + splitdt[1] + \"-\" + splitdt[0];\n \n return formatedDate;\n \n }", "public static String yyyymmdddToddmmyyyy(String strDate) {\n DateFormat formatter = new SimpleDateFormat(\"yyyy-MM-dd\");\n Date date = null;\n try {\n date = (Date) formatter.parse(strDate);\n } catch (ParseException e) {\n e.printStackTrace();\n }\n SimpleDateFormat newFormat = new SimpleDateFormat(\"dd-MM-yyyy\");\n String finalString = newFormat.format(date);\n return finalString;\n }", "public static String date_d(String sourceDate,String format) throws ParseException {\n SimpleDateFormat sdf_ = new SimpleDateFormat(\"yyyy-MM-dd\");\n SimpleDateFormat sdfNew_ = new SimpleDateFormat(format);\n return sdfNew_.format(sdf_.parse(sourceDate));\n }", "private String formatDate(final Date date) {\r\n\t\tfinal Calendar calendar = Calendar.getInstance();\r\n\t\tcalendar.setTime(date);\r\n\r\n\t\tfinal String dayOfMonth = formatDayOfMonth(calendar);\r\n\t\tfinal String month = formatMonth(calendar);\r\n\t\tfinal String year = String.valueOf(calendar.get(Calendar.YEAR));\r\n\r\n\t\treturn String.format(\"%s/%s/%s\", year, month, dayOfMonth);\r\n\t}", "public static String convertDateFormat(String date) {\n DateFormat originalFormat = new SimpleDateFormat(\"yyyy-MM-dd\");\n DateFormat targetFormat = new SimpleDateFormat(\"MMMM dd, yyyy\", Locale.ENGLISH);\n Date oldDate;\n try {\n oldDate = originalFormat.parse(date);\n } catch (ParseException e) {\n e.printStackTrace();\n return null;\n }\n return targetFormat.format(oldDate);\n }", "private String convertDate(String date){\r\n String arrDate[] = date.split(\"/\");\r\n date = arrDate[2] + \"-\" + arrDate[1] + \"-\" + arrDate[0];\r\n return date;\r\n }", "private String toDate(Date appDate) throws ParseException {\n\t\tCalendar cal = Calendar.getInstance();\n\t\tcal.setTime(appDate);\n\t\tString formatedDate = cal.get(Calendar.DATE) + \"/\" + (cal.get(Calendar.MONTH) + 1) + \"/\" + cal.get(Calendar.YEAR);\n\t\tSystem.out.println(\"formatedDate : \" + formatedDate); \n\t\treturn formatedDate;\n\t}", "private static Date getFormattedDate(String date){\n\t\tString dateStr = null;\n\t\tif(date.length()<11){\n\t\t\tdateStr = date+\" 00:00:00.0\";\n\t\t}else{\n\t\t\tdateStr = date;\n\t\t}\n\t\tDate formattedDate = null;\n\t\ttry {\n\t\t\tformattedDate = new SimpleDateFormat(\"yyyy-MM-dd HH:mm:ss.S\").parse(dateStr);\n\t\t} catch (ParseException e) {\n\t\t\tCommonUtilities.createErrorLogFile(e);\n\t\t}\n\t\treturn formattedDate;\n\n\t}", "public static Date strToDate(String strDate)\r\n/* 127: */ {\r\n/* 128:178 */ SimpleDateFormat formatter = new SimpleDateFormat(\"yyyyMMdd\");\r\n/* 129:179 */ ParsePosition pos = new ParsePosition(0);\r\n/* 130:180 */ Date strtodate = formatter.parse(strDate, pos);\r\n/* 131:181 */ return strtodate;\r\n/* 132: */ }", "public java.sql.Date format(String date) {\n int i = 0;\n int dateAttr[];\n dateAttr = new int[3];\n for(String v : date.split(\"/\")) {\n dateAttr[i] = Integer.parseInt(v);\n i++;\n }\n\n GregorianCalendar gcalendar = new GregorianCalendar();\n gcalendar.set(dateAttr[2], dateAttr[0]-1, dateAttr[1]); // Year,Month,Day Of Month\n java.sql.Date sdate = new java.sql.Date(gcalendar.getTimeInMillis());\n return sdate;\n }", "java.lang.String getStartDateYYYY();", "java.lang.String getFoundingDate();", "public String changeDateFormat(String dateStr) {\n String inputPattern = \"MMM-dd-yyyy\";\n String outputPattern = \"MMMM dd, yyyy\";\n SimpleDateFormat inputFormat = new SimpleDateFormat(inputPattern);\n SimpleDateFormat outputFormat = new SimpleDateFormat(outputPattern);\n\n Date date = null;\n String str = null;\n\n try {\n date = inputFormat.parse(dateStr);\n str = outputFormat.format(date);\n } catch (ParseException e) {\n e.printStackTrace();\n }\n return str;\n\n }", "public String getDateString(Date date) {\n Calendar cal = Calendar.getInstance();\n\n cal.setTime(date);\n int year = cal.get(Calendar.YEAR);\n String month = String.format(\"%02d\", cal.get(Calendar.MONTH) + 1);\n String day = String.format(\"%02d\", cal.get(Calendar.DAY_OF_MONTH));\n return year + month + day;\n }", "private String stringifyDate(Date date){\n\t\tDateFormat dateFormatter = new SimpleDateFormat(\"yyyy-MM-dd\");\t\t\n\t\treturn dateFormatter.format(date);\n\t}", "public String convertDayToString(Date date) {\n SimpleDateFormat formatDate = new SimpleDateFormat(\"yyyy-MM-dd\");\n return formatDate.format(date);\n }", "public String getDateString() {\n int year = date.get(Calendar.YEAR);\n int month = date.get(Calendar.MONTH); // month is stored from 0-11 so adjust +1 for final display\n int day_of_month = date.get(Calendar.DAY_OF_MONTH);\n return String.valueOf(month + 1) + '/' + String.valueOf(day_of_month) + '/' + year;\n }", "private String formatDate(String dateString) {\n DateTimeFormatter dateTimeFormatter = DateTimeFormatter.ofPattern(\"LLL dd, yyyy\");\n LocalDate localDate = LocalDate.parse(dateString.substring(0, 10));\n return dateTimeFormatter.format(localDate);\n }", "public static String convertDateToSend(String gotdate){\n Calendar calendar = Calendar.getInstance();\n calendar.setTimeInMillis(Long.parseLong(gotdate));\n SimpleDateFormat inputFormat = new SimpleDateFormat(\"yyyyMMddHHmmss\");\n SimpleDateFormat outputFormat = new SimpleDateFormat(\"dd MMM yyyy\");\n /*Date parsedDate = null;\n try {\n parsedDate = inputFormat.parse(gotdate);\n } catch (ParseException e) {\n e.printStackTrace();\n }*/\n String formattedDate = outputFormat.format(calendar.getTime());\n return formattedDate;\n }", "public String toDate(Date date) {\n DateFormat df = DateFormat.getDateInstance();\r\n String fecha = df.format(date);\r\n return fecha;\r\n }", "public static String getDate(Date date)\n\t{\n\t\treturn getFormatString(date, getDateFormat());\n\t}", "public static String getDate()\n {\n Date date = new Date();\n SimpleDateFormat dateFormat = new SimpleDateFormat(\"yyyy-MM-dd\");\n return dateFormat.format(date);\n }", "private String YYYYMMDD(String str) {\n\t\tString[] s = str.split(\"/\");\n\t\treturn s[0] + parseToTwoInteger(Integer.parseInt(s[1].trim())) + parseToTwoInteger(Integer.parseInt(s[2].trim()));\n\t}", "private String getDate(String str) {\n String[] arr = str.split(\"T\");\n DateFormat formatter = new SimpleDateFormat(\"yyyy-mm-d\", Locale.US);\n Date date = null;\n try {\n date = formatter.parse(arr[0]);\n } catch (java.text.ParseException e) {\n Log.e(LOG_TAG, \"Could not parse date\", e);\n }\n SimpleDateFormat dateFormatter = new SimpleDateFormat(\"MMM d, yyyy\", Locale.US);\n\n return dateFormatter.format(date);\n }", "public String getStringDate(){\n String finalDate = \"\";\n Locale usersLocale = Locale.getDefault();\n DateFormatSymbols dfs = new DateFormatSymbols(usersLocale);\n String weekdays[] = dfs.getWeekdays();\n int day = date.get(Calendar.DAY_OF_WEEK);\n String nameOfDay = weekdays[day];\n\n finalDate += nameOfDay + \" \" + date.get(Calendar.DAY_OF_MONTH) + \", \";\n\n String months[] = dfs.getMonths();\n int month = date.get(Calendar.MONTH);\n String nameOfMonth = months[month];\n\n finalDate += nameOfMonth + \", \" + date.get(Calendar.YEAR);\n\n return finalDate;\n }", "private String getDate(int year, int month, int day) {\n return new StringBuilder().append(month).append(\"/\")\n .append(day).append(\"/\").append(year).toString();\n }", "public static String convertDateToStandardFormat(String inComingDateformat, String date)\r\n\t{\r\n\t\tString cmName = \"DateFormatterManaager.convertDateToStandardFormat(String,String)\";\r\n\t\tString returnDate = \"\";\r\n\t\ttry\r\n\t\t{\r\n\t\t\tif (date != null && !date.trim().equals(\"\"))\r\n\t\t\t{\r\n\t\t\t\tif (inComingDateformat != null && !inComingDateformat.trim().equals(\"\"))\r\n\t\t\t\t{\r\n\t\t\t\t\tSimpleDateFormat sdf = new SimpleDateFormat(inComingDateformat);\r\n\t\t\t\t\tDate parsedDate = sdf.parse(date);\r\n\t\t\t\t\tSimpleDateFormat standardsdf = new SimpleDateFormat(\"dd/MM/yyyy\");\r\n\t\t\t\t\treturnDate = standardsdf.format(parsedDate);\r\n\t\t\t\t} else\r\n\t\t\t\t{\r\n\t\t\t\t\treturnDate = date;\r\n\t\t\t\t\tlogger.cterror(\"CTBAS00113\", cmName, date);\r\n\t\t\t\t}\r\n\t\t\t} else\r\n\t\t\t{\r\n\t\t\t\tlogger.ctdebug(\"CTBAS00114\", cmName);\r\n\t\t\t}\r\n\t\t} catch (ParseException pe) // just in case any runtime exception occurred just return input datestr as it is\r\n\t\t{\r\n\t\t\treturnDate = date;\r\n\t\t\tlogger.cterror(\"CTBAS00115\", pe, cmName, date, inComingDateformat);\r\n\t\t}\r\n\t\treturn returnDate;\r\n\t}", "public static String convertDate(String input) {\n String res = \"\";\n\n String[] s = input.split(\" \");\n\n res += s[2] + \"-\";\n switch (s[1]) {\n case \"January\":\n res += \"01\";\n break;\n case \"February\":\n res += \"02\";\n break;\n case \"March\":\n res += \"03\";\n break;\n case \"April\":\n res += \"04\";\n break;\n case \"May\":\n res += \"05\";\n break;\n case \"June\":\n res += \"06\";\n break;\n case \"July\":\n res += \"07\";\n break;\n case \"August\":\n res += \"08\";\n break;\n case \"September\":\n res += \"09\";\n break;\n case \"October\":\n res += \"10\";\n break;\n case \"November\":\n res += \"11\";\n break;\n case \"December\":\n res += \"12\";\n break;\n default:\n res += \"00\";\n break;\n }\n\n res += \"-\";\n if (s[0].length() == 1) {\n res += \"0\" + s[0];\n }\n else {\n res += s[0];\n }\n return res;\n }", "public String dar_fecha(){\n Date date = new Date();\n DateFormat dateFormat = new SimpleDateFormat(\"dd/MM/yyyy\");\n return dateFormat.format(date).toString();\n\n }", "public static String formatDate(Date d) {\n\t\tint month = d.getMonth() + 1;\n\t\tint dayOfMonth = d.getDate();\n\t\tint year = d.getYear() + 1900;\n\t\tString y = \"\" + year;\n\t\tString m = \"\" + month;\n\t\tString dom = \"\" + dayOfMonth;\n\t\tif (month < 10) {\n\t\t\tm = \"0\" + m;\n\t\t}\n\t\tif (dayOfMonth < 10) {\n\t\t\tdom = \"0\" + dom;\n\t\t}\n\t\treturn m + \"/\" + dom + \"/\" + y.substring(2);\n\t}", "public String getEntryDateString() {\n SimpleDateFormat sdf = new SimpleDateFormat(\"yyyy MMM dd\");\n return sdf.format(entryDate.getTime());\n }", "public String getDateConvert() {\n SimpleDateFormat dateFormat1 = new SimpleDateFormat(\"MMM dd yyyy - hh:mm\");\n SimpleDateFormat dateFormat2 = new SimpleDateFormat(\"a\");\n String date = dateFormat1.format(this.timePost) + dateFormat2.format(this.timePost).toLowerCase();\n return date;\n }", "public Date formatForDate(String data) throws ParseException{\n //definindo a forma da Data Recebida\n DateFormat formatUS = new SimpleDateFormat(\"dd-MM-yyyy\");\n return formatUS.parse(data);\n }", "public String formatDate(Date date) {\n\t\tString formattedDate;\n\t\tif (date != null) {\n\t\t\tformattedDate = simpleDateFormat.format(date);\n\t\t\tformattedDate = formattedDate.substring(0,\n\t\t\t\t\tformattedDate.length() - 5);\n\t\t} else {\n\t\t\tformattedDate = Constants.EMPTY_STRING;\n\t\t}\n\t\treturn formattedDate;\n\t}", "private String createDate(){\n SimpleDateFormat date = new SimpleDateFormat(\"EEE, MMM d, yyyy\");\n String stringDate = date.format(new Date()); \n return stringDate;\n }", "public static String getStrDate(Date date) {\n //TODO get date\n SimpleDateFormat formatter;\n if (DateUtils.isToday(date.getTime())) {\n formatter = new SimpleDateFormat(\"HH:mm\");\n return formatter.format(date);\n }\n formatter = new SimpleDateFormat(\"MMM dd\");\n return formatter.format(date);\n }", "public static String convertDate(String dbDate) throws ParseException //yyyy-MM-dd\n {\n String convertedDate = \"\";\n\n Date date = new SimpleDateFormat(\"yyyy-MM-dd\").parse(dbDate);\n\n convertedDate = new SimpleDateFormat(\"MM/dd/yyyy\").format(date);\n\n return convertedDate ;\n }", "public String getDateString(){\n return Utilities.dateToString(date);\n }", "public static String formatDateForQuery(java.util.Date date){\n return (new SimpleDateFormat(\"yyyy-MM-dd\")).format(date);\n }", "static String getReadableDate(LocalDate date){\r\n\t\tString readableDate = null;\r\n\t\t//convert only if non-null\r\n\t\tif(null != date){\r\n\t\t\t//convert date to readable form\r\n\t\t\treadableDate = date.toString(\"MM/dd/yyyy\");\r\n\t\t}\r\n\t\t\r\n\t\treturn readableDate;\r\n\t}", "private static String getDate() {\n Scanner input = new Scanner(System.in);\n\n String monthName = input.next();\n int month = monthNum(monthName);\n int day = input.nextInt();\n String date = \"'2010-\" + month + \"-\" + day + \"'\";\n return date;\n }", "public static String dateOnly() throws Exception {\n\t\tDateFormat dateFormat = new SimpleDateFormat(\"dd-MM-yyyy\");\n\t\t// get current date time with Date()\n\t\tDate date = new Date();\n\t\t// Now format the date\n\t\tString date1 = dateFormat.format(date);\n\t\t// System.out.println(date1);\n\t\treturn date1;\n\t}", "public static String dateStr(String str)\n {\n String month = str.split(\"/\")[0];\n String day = str.split(\"/\")[1];\n String year = str.split(\"/\")[2];\n return day + \"-\" + month + \"-\" + year;\n }", "public String toString() { //toString method\n String startDateString2= \"\"; //Initialize\n try{\n Date date1 = new SimpleDateFormat(\"yyyyMMdd\").parse(full_Date);\n DateFormat df2 = new SimpleDateFormat(\"MMM dd, yyyy\");\n startDateString2 = df2.format(date1);\n \n return startDateString2;\n }catch(ParseException e){\n e.printStackTrace();\n }\n return startDateString2;\n \n}", "public String format (Date date , String dateFormat) ;", "public static Object changeDateFormat(String date)\r\n\t{\n\t\tString temp=\"\";\r\n\t\tint len = date.length();\r\n\t\tfor(int i=0;i<len;i++)\r\n\t\t{\r\n\t\t\tchar ch = date.charAt(i);\r\n\t\t\tif(ch == ',')\r\n\t\t\t{\r\n\t\t\t\ttemp = temp+'/';\r\n\t\t\t}\r\n\t\t\telse\r\n\t\t\t{\r\n\t\t\t\ttemp = temp+ch;\r\n\t\t\t}\r\n\t\t}\r\n\t\tString n=\"\"+temp.charAt(3)+temp.charAt(4);\r\n\t\tint month=Integer.parseInt(n);\r\n\t\tString m=\"\";\r\n\t\tswitch(month)\r\n\t\t{\r\n\t\t\tcase 1:\r\n\t\t\t\tm=\"jan\";\r\n\t\t\t\tbreak;\r\n\t\t\tcase 2:\r\n\t\t\t\tm=\"feb\";\r\n\t\t\t\tbreak;\r\n\t\t\tcase 3:\r\n\t\t\t\tm=\"mar\";\r\n\t\t\t\tbreak;\r\n\t\t\tcase 4:\r\n\t\t\t\tm=\"apr\";\r\n\t\t\t\tbreak;\r\n\t\t\tcase 5:\r\n\t\t\t\tm=\"may\";\r\n\t\t\t\tbreak;\r\n\t\t\tcase 6:\r\n\t\t\t\tm=\"jun\";\r\n\t\t\t\tbreak;\r\n\t\t\tcase 7:\r\n\t\t\t\tm=\"jul\";\r\n\t\t\t\tbreak;\r\n\t\t\tcase 8:\r\n\t\t\t\tm=\"aug\";\r\n\t\t\t\tbreak;\r\n\t\t\tcase 9:\r\n\t\t\t\tm=\"sep\";\r\n\t\t\t\tbreak;\r\n\t\t\tcase 10:\r\n\t\t\t\tm=\"oct\";\r\n\t\t\t\tbreak;\r\n\t\t\tcase 11:\r\n\t\t\t\tm=\"nov\";\r\n\t\t\t\tbreak;\r\n\t\t\tcase 12:\r\n\t\t\t\tm=\"dec\";\r\n\t\t\t\tbreak;\r\n\t\t\tdefault:\r\n\t\t\t\tSystem.out.println(\"Enter a valid month\");\r\n\t\t\t}\r\n\t\t\tString s=(temp.substring(0, 3)+ m +temp.substring(5));\r\n\t\t\treturn s;\r\n\t\t}", "public static String getDateString(int year, int month, int day_of_month) {\r\n String dateString;\r\n if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {\r\n dateString = LocalDate.of(year, month, day_of_month).toString();\r\n } else {\r\n Calendar calendar = Calendar.getInstance();\r\n calendar.set(year, month + 1, day_of_month);\r\n dateString = DATE_FORMATTER_ISO_8601.format(calendar.getTime());\r\n }\r\n return dateString;\r\n }", "public static String getStrUtilDate(java.util.Date date){\n\t\tif(date==null)\n\t\t\treturn fechaNula();\n\t\tString strDate=\"\";\n\t\t\n\t\tif(getDia(date)<10)\n\t\t\tstrDate+=\"0\"+getDia(date);\n\t\telse\n\t\t\tstrDate+=getDia(date);\n\t\tif(getMes(date)<10)\n\t\t\tstrDate+=\"/\"+\"0\"+getMes(date);\n\t\telse\n\t\t\tstrDate+=\"/\"+getMes(date);\n\t\tstrDate+=\"/\"+getAnio(date);\n\t\treturn strDate;\n\t}", "public static String getLegibleDate(Date date) {\n\n\t\tSimpleDateFormat simpleDateFormat = new SimpleDateFormat(\"dd/MM/yy\"); // \"d MMM yyyy hh:mm aaa\"\n\t\tString dateInit = simpleDateFormat.format(date);\n\n\t\n\n\t\treturn dateInit;\n\t}", "public static String formartDate(String mDate) {\n\t\t\t// TODO Auto-generated method stub\n\t\t\t\n\t\t\tSimpleDateFormat inSDF = new SimpleDateFormat(\"mm/dd/yyyy\");\n\t\t\t SimpleDateFormat outSDF = new SimpleDateFormat(\"yyyy-mm-dd\");\n\n\t\t\t \n\t\t\t String outDate = \"\";\n\t\t\t \n\t\t\t if (mDate != null) {\n\t\t\t try {\n\t\t\t Date date = inSDF.parse(mDate);\n\t\t\t outDate = outSDF.format(date);\n\t\t\t \n\t\t\t \n\t\t\t } catch (Exception ex){ \n\t\t\t \tex.printStackTrace();\n\t\t\t }\n\t\t\t }\n\t\t\t return outDate;\n\t\t}", "public String convertDateToString(Date date) {\n\t\tString dateTime = SDF.format(date);\n\t\treturn dateTime;\t\n\t}", "public static String formatterDate(Date date){\n\t\tString retour = null;\n\t\tif(date != null){\n\t\t\tretour = dfr.format(date);\n\t\t}\n\t\treturn retour;\n\t}", "private String formatDate(Date dateObject) {\r\n SimpleDateFormat dateFormat = new SimpleDateFormat(\"LLL dd, yyyy\");\r\n return dateFormat.format(dateObject);\r\n }", "private String formatDate(Date dateObject) {\n SimpleDateFormat dateFormat = new SimpleDateFormat(\"LLL dd, yyyy\");\n return dateFormat.format(dateObject);\n }", "private static String dateFormatter(String date) {\n\t\tString[] dateArray = date.split(AnalyticsUDFConstants.SPACE_SEPARATOR);\n\t\ttry {\n\t\t\t// convert month which is in the format of string to an integer\n\t\t\tDate dateMonth = new SimpleDateFormat(AnalyticsUDFConstants.MONTH_FORMAT, Locale.ENGLISH).parse(dateArray[1]);\n\t\t\tCalendar cal = Calendar.getInstance();\n\t\t\tcal.setTime(dateMonth);\n\t\t\t// months begin from 0, therefore add 1\n\t\t\tint month = cal.get(Calendar.MONTH) + 1;\n\t\t\tString dateString = dateArray[5] + AnalyticsUDFConstants.DATE_SEPARATOR + month + AnalyticsUDFConstants.DATE_SEPARATOR + dateArray[2];\n\t\t\tDateFormat df = new SimpleDateFormat(AnalyticsUDFConstants.DATE_FORMAT_WITHOUT_TIME);\n\t\t\treturn df.format(df.parse(dateString));\n\t\t} catch (ParseException e) {\n\t\t\treturn null;\n\t\t}\n\t}", "public static String getFormattedDate(String dateStr, String toformat)\r\n\t{\r\n\t\tString mName = \"getFormattedDate()\";\r\n\t\tIDateFormatter dateFormatter = null;\r\n\t\tDateFormatConfig dateFormat = null;\r\n\t\tString formattedDate = null;\r\n\t\tdateFormat = getDateFormat(toformat);\r\n\t\ttry\r\n\t\t{\r\n\t\t\tdateFormatter = (IDateFormatter) ResourceLoaderUtils.createInstance(dateFormat.getFormatterClass(),\r\n\t\t\t\t\t(Object[]) null);\r\n\t\t\tformattedDate = dateFormatter.formatDate(dateStr, dateFormat.getJavaDateFormat());\r\n\t\t} catch (Exception exp)\r\n\t\t{\r\n\t\t\tlogger.cterror(\"CTBAS00112\", exp, mName);\r\n\r\n\t\t}\r\n\t\treturn formattedDate;\r\n\t}", "Date getForDate();", "DateFormat getSourceDateFormat();", "public static String formatDate(Date date){\n\t\tCalendar now = Calendar.getInstance(); // Gets the current date and time\n\t\tint currentYear = now.get(Calendar.YEAR);\n\t\tint dateYear = Integer.parseInt(new SimpleDateFormat(\"yyyy\").format(date));\n\n\t\tif (dateYear <= currentYear){\n\t\t\treturn new SimpleDateFormat(\"E MMM dd HH:mm\").format(date);\n\t\t} else {\n\t\t\treturn new SimpleDateFormat(\"E yyyy MMM dd HH:mm\").format(date);\n\t\t}\n\t}", "private String easyDateFormat(final String format) {\n Date today = new Date();\n SimpleDateFormat formatter = new SimpleDateFormat(format);\n String datenewformat = formatter.format(today);\n return datenewformat;\n }", "static String localDate(String date){\n Date d = changeDateFormat(date, \"dd/MM/yyyy\");\n DateFormat dateFormat = DateFormat.getDateInstance(DateFormat.FULL, Locale.getDefault());\n return dateFormat.format(d);\n }", "public static String getDbDateString(Date date){\n SimpleDateFormat sdf = new SimpleDateFormat(DATE_FORMAT);\n return sdf.format(date);\n }", "public static String formatDate(Date date) {\n\t\tDateFormat dateFormat = DateFormat.getDateTimeInstance(DateFormat.SHORT, DateFormat.MEDIUM);\n\n\t\tif (dateFormat instanceof SimpleDateFormat) {\n\t\t\tSimpleDateFormat sdf = (SimpleDateFormat) dateFormat;\n\t\t\t// we want short date format but with 4 digit year\n\t\t\tsdf.applyPattern(sdf.toPattern().replaceAll(\"y+\", \"yyyy\").concat(\" z\"));\n\t\t}\n\n\t\treturn dateFormat.format(date);\n\t}", "public static String FormatDate(int day, int month, int year) {\r\n String jour = Integer.toString(day);\r\n String mois = Integer.toString(month + 1);\r\n if (jour.length() == 1) {\r\n jour = \"0\" + jour;\r\n }\r\n\r\n if (mois.length() == 1) {\r\n mois = \"0\" + mois;\r\n }\r\n return jour + \"/\" + mois + \"/\" + Integer.toString(year);\r\n }", "public static String dateTran(String dateOri){\n\t\tDateFormat formatter1 ; \n\t\tDate date ; \n\t\tString newDate=null;\n\t\tformatter1 = new SimpleDateFormat(\"yyyy-MM-dd\");\n\t\ttry {\n\t\t\tdate=formatter1.parse(dateOri);\n\t\t\tSimpleDateFormat formatter = new SimpleDateFormat ( \"M/d/yy\" );\n\t\t\tnewDate = formatter.format(date);\n\t\t} catch (ParseException e) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\te.printStackTrace();\n\t\t}\n\t\treturn newDate;\n\t}", "private String formatDate(String date)\n\t{\n\t\tif(date == null || date.isEmpty())\n\t\t{\n\t\t\treturn \"\";\n\t\t}\n\t\telse\n\t\t{\n\t\t\tString[] dateSplit = date.split(\"/\");\n\t\t\tif(dateSplit.length != 3)\n\t\t\t{\n\t\t\t\treturn \"\";\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\treturn getMonthName(dateSplit[0]) + \" \"+ dateSplit[1]+\", \"+ dateSplit[2];\n\t\t\t}\n\t\t}\n\t}", "public static String formatDateToDD_MM_YY_hh_mm(Calendar calDate)\r\n\t{\r\n\t\tint day = calDate.get(Calendar.DAY_OF_MONTH);\r\n\t\tint month = calDate.get(Calendar.MONTH)+1;\r\n\t\tString year = String.valueOf(calDate.get(Calendar.YEAR)).substring(2);\r\n\t\tint hour = calDate.get(Calendar.HOUR_OF_DAY);\r\n\t\tint minute = calDate.get(Calendar.MINUTE);\r\n\t\t\r\n\t\treturn appendLeadingZero(day) + \"/\" + appendLeadingZero(month) + \"/\" + year + \" \" + appendLeadingZero(hour) + \":\" + appendLeadingZero(minute);\r\n\t}", "public static String getDbDateString(Date date){\n SimpleDateFormat sdf = new SimpleDateFormat(DATE_FORMAT);\n return sdf.format(date);\n }", "public static String formartDateMpesa(String mDate) {\n\t\t\tSimpleDateFormat inSDF = new SimpleDateFormat(\"yyyy-MM-dd HH:mm:ss\");\n\t\t\tSimpleDateFormat outSDF = new SimpleDateFormat(\"dd-MM-yyyy\");\n\n\t\t\t String outDate = \"\";\n\t\t\t if (mDate != null) {\n\t\t\t try {\n\t\t\t Date date = inSDF.parse(mDate);\n\t\t\t outDate = outSDF.format(date);\n\t\t\t } catch (Exception ex){ \n\t\t\t \tex.printStackTrace();\n\t\t\t }\n\t\t\t }\n\t\t\t return outDate;\n\t\t}", "public static String dateToString(Date date)\r\n/* 19: */ {\r\n/* 20: 23 */ return sdfDate.format(date);\r\n/* 21: */ }", "public String dateFormatter(String fromDate) {\n\t\tString newDateString=\"\";\n\t\ttry {\n\t\t\tfinal String oldFormat = \"yyyy/MM/dd\";\n\t\t\tfinal String newFormat = \"yyyy-MM-dd\";\n\t\t\tSimpleDateFormat sdf = new SimpleDateFormat(oldFormat);\n\t\t\tDate d = sdf.parse(fromDate);\n\t\t\tsdf.applyPattern(newFormat);\n\t\t\tnewDateString = sdf.format(d);\n\t\t} catch(Exception exp) {\n\t\t\tthrow ExceptionUtil.getYFSException(ExceptionLiterals.ERRORCODE_INVALID_DATE, exp);\n\t\t}\n\t\treturn newDateString;\n\t}", "private String formatReleaseDate(String releaseDate) {\n SimpleDateFormat format = new SimpleDateFormat(\"yyyy-MM-dd\");\n Date dateObject;\n try {\n dateObject = format.parse(releaseDate);\n }\n catch (ParseException pe) {\n Log.e(LOG_TAG, \"Error while retrieving movie information\");\n return releaseDate;\n }\n format = new SimpleDateFormat(\"LLL dd, yyyy\");\n\n return format.format(dateObject);\n }" ]
[ "0.7505692", "0.74831", "0.71497864", "0.7100741", "0.7060008", "0.7032896", "0.69488615", "0.69283664", "0.67949367", "0.67374325", "0.6701828", "0.66903484", "0.6680801", "0.6672087", "0.66618437", "0.66618437", "0.6646981", "0.6637739", "0.6616386", "0.66159993", "0.6558603", "0.65491647", "0.6542221", "0.6502955", "0.647481", "0.64605254", "0.6460382", "0.64490575", "0.64474", "0.64371103", "0.6436934", "0.6427901", "0.64221203", "0.6397399", "0.6378359", "0.63557917", "0.63514704", "0.63391024", "0.6338372", "0.6326763", "0.63266605", "0.63173413", "0.63123", "0.6300633", "0.62991565", "0.62922853", "0.6290002", "0.62830174", "0.62653655", "0.6259568", "0.62564313", "0.62550515", "0.6252769", "0.62502664", "0.62416494", "0.6228555", "0.6227428", "0.6209387", "0.62092817", "0.6200524", "0.6195562", "0.6189544", "0.6188885", "0.61875397", "0.6186456", "0.61850935", "0.6180172", "0.6179608", "0.6177949", "0.61747366", "0.6172352", "0.6162149", "0.6158518", "0.61377186", "0.6129589", "0.61203796", "0.6114693", "0.6107376", "0.61037356", "0.60988957", "0.608642", "0.6082052", "0.6072076", "0.6059536", "0.605547", "0.60475624", "0.60398877", "0.603837", "0.6029221", "0.6027376", "0.6018167", "0.60165066", "0.60097635", "0.600513", "0.6000593", "0.59996104", "0.59990853", "0.5998999", "0.59899837", "0.59876615" ]
0.6931925
7
method to convert date to unixtimestamp format
public long DateStringToUnixTimeStamp(String sDateTime) { DateFormat formatter; Date date = null; long unixtime = 0; formatter = new SimpleDateFormat("yyyy-MM-dd hh:mm:ss"); try { date = formatter.parse(sDateTime); unixtime = date.getTime() / 1000L; } catch (Exception ex) { ex.printStackTrace(); unixtime = 0; } return unixtime; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@ExecFunction(name = \"unix_timestamp\", argTypes = {}, returnType = \"INT\")\n public static Expression unixTimestamp() {\n return new IntegerLiteral((int) (System.currentTimeMillis() / 1000L));\n }", "void fromUnixtime(HplsqlParser.Expr_func_paramsContext ctx) {\n int cnt = getParamCount(ctx);\n if (cnt == 0) {\n evalNull();\n return;\n }\n long epoch = evalPop(ctx.func_param(0).expr()).longValue();\n String format = \"yyyy-MM-dd HH:mm:ss\";\n if (cnt > 1) {\n format = evalPop(ctx.func_param(1).expr()).toString();\n }\n evalString(new SimpleDateFormat(format).format(new Date(epoch * 1000)));\n }", "Long timestamp();", "public String unixTimeToDate(String unixSeconds)\n {\n Date date = new java.util.Date(Long.parseLong(unixSeconds)*1000L);\n // the format of your date\n SimpleDateFormat sdf = new java.text.SimpleDateFormat(\"yyyy-MM-dd HH:mm:ss z\");\n // give a timezone reference for formatting (see comment at the bottom)\n sdf.setTimeZone(java.util.TimeZone.getTimeZone(\"GMT+7\"));\n String formattedDate = sdf.format(date);\n System.out.println(formattedDate);\n\n return formattedDate;\n }", "void unixTimestamp(HplsqlParser.Expr_func_paramsContext ctx) {\n evalVar(new Var(System.currentTimeMillis()/1000));\n }", "public static long convertToTimestamp(String timestamp) {\n return LocalDateTime.parse(timestamp, FORMATTER).toInstant(ZoneOffset.UTC).toEpochMilli();\n }", "private long convertDate(String date) {\n\tDateFormat fm = new SimpleDateFormat(\"yyyy-mm-dd HH:mm:ss\");\n\tString dateS = date;\n\tString[] dateArray = dateS.split(\"T\");\n\tdateS = \"\";\n\tfor (String s : dateArray) {\n\t if (dateS != \"\") {\n\t\tdateS += \" \" + s;\n\t } else {\n\t\tdateS += s;\n\t }\n\t}\n\tdateArray = dateS.split(\"Z\");\n\tdateS = \"\";\n\tfor (String s : dateArray) {\n\t dateS += s;\n\t}\n\tDate d = null;\n\ttry {\n\t d = fm.parse(dateS);\n\t} catch (ParseException e) {\n\t if (parent.globals._DEBUG)\n\t\te.printStackTrace();\n\t}\n\treturn d.getTime();\n }", "public static long toLong( Date date ) {\n return date == null ? 0 : Functions.toLong( date );\n }", "Date getTimestamp();", "long getTimestamp();", "long getTimestamp();", "long getTimestamp();", "long getTimestamp();", "long getTimestamp();", "long getTimestamp();", "long getTimestamp();", "long getTimestamp();", "long getTimestamp();", "long getTimestamp();", "long getTimestamp();", "long getTimestamp();", "long getTimestamp();", "long getTimestamp();", "long getTimestamp();", "long getTimestamp();", "@TypeConverter\n public static String toTimestamp(Date date) {\n if (date != null) {\n return df.format(date);\n }\n return null;\n }", "private long makeTimestamp() {\n return new Date().getTime();\n }", "protected long readTimestampFromString(String value) {\r\n\t\t return Long.parseLong(value);\r\n\t\t }", "@Override\n\tpublic Timestamp convert(Date source) {\n\t\treturn new Timestamp(source.getTime());\n\t}", "@TypeConverter\n public Date toDate(long l){\n return new Date(l);\n }", "public static void main(String[] args) throws ParseException {\n\t Long t = Long.parseLong(\"1540452984\");\r\n Timestamp ts = new Timestamp(1540453766);\r\n DateFormat sdf = new SimpleDateFormat(\"yyyy-MM-dd HH:mm:ss\");\r\n //方法一:优势在于可以灵活的设置字符串的形式。\r\n String tsStr = sdf.format(ts);// 2017-01-15 21:17:04\r\n System.out.println(tsStr);\r\n\t}", "public ToUnixNano() {\n super(\"to_unix_nano\", Public.PUBLIC, org.jooq.impl.SQLDataType.BIGINT);\n\n setReturnParameter(RETURN_VALUE);\n addInParameter(TS);\n }", "public static String convertTimestampToReadable(long timestamp) {\n java.text.DateFormat formatter = new SimpleDateFormat(\"dd.MM.yy HH:mm\");\n formatter.setTimeZone(TimeZone.getTimeZone(\"UTC\"));\n String dateFormatted = formatter.format(timestamp);\n\n return dateFormatted;\n }", "long getTimestamp();", "public static String convertDateToSend(String gotdate){\n Calendar calendar = Calendar.getInstance();\n calendar.setTimeInMillis(Long.parseLong(gotdate));\n SimpleDateFormat inputFormat = new SimpleDateFormat(\"yyyyMMddHHmmss\");\n SimpleDateFormat outputFormat = new SimpleDateFormat(\"dd MMM yyyy\");\n /*Date parsedDate = null;\n try {\n parsedDate = inputFormat.parse(gotdate);\n } catch (ParseException e) {\n e.printStackTrace();\n }*/\n String formattedDate = outputFormat.format(calendar.getTime());\n return formattedDate;\n }", "public static long convertToLong(String value) {\r\n Validate.notEmpty(value, \"String date representation must not be null or empty\");\r\n\r\n Date result = null;\r\n String dateFormat = ResourceUtil.getMessageResourceString(\"application.pattern.timestamp\");\r\n SimpleDateFormat simpleDateFormat = new SimpleDateFormat(dateFormat);\r\n try {\r\n result = simpleDateFormat.parse(value);\r\n } catch (ParseException ex) {\r\n LOGGER.error(ex.getMessage(), ex);\r\n throw new IllegalArgumentException(ex);\r\n }\r\n\r\n return result.getTime();\r\n }", "public static String convertToString(long value) {\r\n Date date = convertToDate(value);\r\n\r\n String dateFormat = ResourceUtil.getMessageResourceString(\"application.pattern.timestamp\");\r\n SimpleDateFormat simpleDateFormat = new SimpleDateFormat(dateFormat);\r\n String result = simpleDateFormat.format(date);\r\n\r\n return result;\r\n }", "Date getTimeStamp();", "@TypeConverter\n public Long fromDate(Date date) {\n if (date == null) { return null; }\n return date.getTime();\n }", "public long getTimeStampL() {\n\t\treturn Long.parseLong(timeStamp);\n\t}", "long getTimeStamp();", "private java.sql.Timestamp convert(java.util.Date date){\r\n \tjava.sql.Timestamp result = null;\r\n \tif(date!=null){\r\n \t\tresult = new java.sql.Timestamp(date.getTime()); \t\t\r\n \t}\r\n \treturn result;\r\n }", "public static int getDayFromTimestamp(long unixtime){\n \tCalendar c = Calendar.getInstance();\n \tc.setTimeInMillis(unixtime);\n \treturn c.get(Calendar.DATE);\n }", "private void updateDateTxtV()\n {\n String dateFormat =\"EEE, d MMM yyyy\";\n SimpleDateFormat sdf = new SimpleDateFormat(dateFormat, Locale.CANADA);\n dateStr = sdf.format(cal.getTime());\n dateTxtV.setText(dateStr);\n\n //unix datetime for saving in db\n dateTimeUnix = cal.getTimeInMillis() / 1000L;\n }", "public static final Function<Timestamp,Date> timestampToDate() {\r\n return TIMESTAMP_TO_DATE;\r\n }", "long getDate();", "private String unixToHHMMSS(String unixTime){\r\n\t\tlong unixSeconds = Long.parseLong(unixTime);\r\n\t\tDate date = new Date(unixSeconds*1000L); // convert seconds to milliseconds\r\n\t\tSimpleDateFormat sdf = new SimpleDateFormat(\"HH:mm:ss\"); // date format\r\n\r\n\t\tString formattedDate = sdf.format(date);\r\n\t\treturn formattedDate;\r\n\t}", "public static Date formaterStampTilDato(Timestamp timestamp) {\r\n\t\tDate date = new Date(timestamp.getTime());\r\n\t\treturn date;\r\n\t}", "public static String timestampOf(Date date) {\n if (date == null) {\n return null;\n }\n\n return formatDate(date, TIMESTAMP_FORMAT);\n }", "static public String getTimeStamp(long timestamp) {\n SimpleDateFormat sdf = new SimpleDateFormat(\"yyyy.MM.dd-HH:mm:ss\", Locale.US);\n return sdf.format(new Date(timestamp));\n }", "public long getTimestamp();", "public long getTimestamp();", "public static Date convertToDate(long value) {\r\n return new Date(value);\r\n }", "Timestamp toTimestamp( Date date )\n {\n return date != null ? new Timestamp( date.getTime() ) : null;\n }", "int getTimestamp();", "public Timestamp changeDateFormat(String inputDate) {\n String input = inputDate;\n\n String INPUT_FORMAT = \"yyyy-MM-dd\";\n String OUTPUT_FORMAT = \"yyyy-MM-dd HH:mm:ss.SSS\";\n\n DateFormat inputFormatter = new SimpleDateFormat(INPUT_FORMAT);\n DateFormat outputFormatter = new SimpleDateFormat(OUTPUT_FORMAT);\n\n java.util.Date date = null;\n String output = null;\n Timestamp ts = null;\n try {\n date = inputFormatter.parse(input);\n\n output = outputFormatter.format(date);\n\n ts = Timestamp.valueOf(output);\n } catch (Exception e) {\n e.printStackTrace();\n }\n\n return ts;\n }", "protected static java.sql.Timestamp getConvertedTimestamp(java.util.Date date) {\n\t\tif (date == null) {\n\t\t\treturn null;\n\t\t} else {\n\t\t\treturn new java.sql.Timestamp(date.getTime());\n\t\t}\n\t}", "public static String longToStringDate(long l)\r\n/* 212: */ {\r\n/* 213:293 */ SimpleDateFormat sdf = new SimpleDateFormat(\"yyyy-MM-dd hh:mm:ss\");\r\n/* 214:294 */ String date = sdf.format(new Date(l * 1000L));\r\n/* 215:295 */ return date;\r\n/* 216: */ }", "@TypeConverter\n public long fromDate(Date mDate){\n return mDate.getTime();\n }", "public static long dateFun( java.sql.Date v ) {\n return v == null ? -1L : Functions.toLong( v );\n }", "public long getTimestamp()\r\n {\r\n return safeConvertLong(getAttribute(\"timestamp\"));\r\n }", "private String getDate(long timeStamp) {\n\n try {\n DateFormat sdf = new SimpleDateFormat(\"MMM d, yyyy\", getResources().getConfiguration().locale);\n Date netDate = (new Date(timeStamp * 1000));\n return sdf.format(netDate);\n } catch (Exception ex) {\n return \"xx\";\n }\n }", "private String getDate(long timeStamp) {\n\n try {\n DateFormat sdf = new SimpleDateFormat(\"MMM d, yyyy\", getResources().getConfiguration().locale);\n Date netDate = (new Date(timeStamp * 1000));\n return sdf.format(netDate);\n } catch (Exception ex) {\n return \"xx\";\n }\n }", "public static String longToDate(Long lo) throws ParseException {\n\n SimpleDateFormat sdf=new SimpleDateFormat(\"yyyy-MM-dd HH:mm:ss\");//这个是你要转成后的时间的格式\n String sd = sdf.format(new Date(lo)); // 时间戳转换成时间\n System.out.println(sd);//打印出你要的时间\n\n return sd;\n }", "public static java.sql.Timestamp convertToTimestamp(java.util.Date uDate) {\n\t\tif (uDate == null) {\n\t\t\treturn null;\n\t\t} else {\n\t\t\tjava.sql.Timestamp timeStamp = new Timestamp(uDate.getTime());\n\t\t\treturn timeStamp;\n\t\t}\n\n\t}", "public String convertCalendarMillisecondsAsLongToDate(long fingerprint) {\n\t\t\t\tDateFormat format = new SimpleDateFormat(\"yyyy-MM-dd\"); // not \"yyyy-MM-dd HH:mm:ss\"\n\t\t\t\tDate date = new Date(fingerprint);\n\t\t\t\treturn format.format(date);\n\t\t\t}", "private static String formatDate(long date) {\n Date systemDate = new java.util.Date(date * 1000L);\n // the format of your date\n SimpleDateFormat sdf = new java.text.SimpleDateFormat(\"yyyy-MM-dd HH:mm:ss\");\n // give a timezone reference for formatting (see comment at the bottom)\n sdf.setTimeZone(java.util.TimeZone.getTimeZone(\"GMT-4\"));\n String formattedDate = sdf.format(systemDate);\n return formattedDate;\n }", "public Date getNormalizedDate(Date date)\n/* */ {\n/* 208 */ return new Date(date.getTime());\n/* */ }", "public static String getDateFromTimestamp(long timestamp) {\n\n Calendar cal = Calendar.getInstance(Locale.ENGLISH);\n cal.setTimeInMillis(timestamp * 1000);\n return DateFormat.format(\"dd-MMM-yyyy\", cal).toString();\n }", "public static String Milisec2DDMMYYYY(long ts) {\n\t\tif (ts == 0) {\n\t\t\treturn \"\";\n\t\t} else {\n\t\t\tjava.util.Calendar calendar = java.util.Calendar.getInstance();\n\t\t\tcalendar.setTime(new java.util.Date(ts));\n\n\t\t\tString strTemp = Integer.toString(calendar\n\t\t\t\t\t.get(calendar.DAY_OF_MONTH));\n\t\t\tif (calendar.get(calendar.DAY_OF_MONTH) < 10) {\n\t\t\t\tstrTemp = \"0\" + strTemp;\n\t\t\t}\n\t\t\tif (calendar.get(calendar.MONTH) + 1 < 10) {\n\t\t\t\treturn strTemp + \"/0\" + (calendar.get(calendar.MONTH) + 1)\n\t\t\t\t\t\t+ \"/\" + calendar.get(calendar.YEAR);\n\t\t\t} else {\n\t\t\t\treturn strTemp + \"/\" + (calendar.get(calendar.MONTH) + 1) + \"/\"\n\t\t\t\t\t\t+ calendar.get(calendar.YEAR);\n\t\t\t}\n\t\t}\n\t}", "public static Long TimeToLong(Date date)\n\t{\n\t\tif(date==null)\n\t\t\treturn 0L;\n\t\t\n\t\treturn date.getTime();\n\t}", "public static long dateToTime(String s) {\n\t\tSimpleDateFormat simpledateformat = new SimpleDateFormat(\"yyyyMMddHHmmss\");\n\t\tlong l;\n\t\ttry {\n\t\t\tl = simpledateformat.parse(s).getTime();\n\t\t} catch (ParseException e) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\te.printStackTrace();\n\t\t\tl = System.currentTimeMillis();\n\t\t}\n\n\t\treturn l;\n\n\t}", "public static void main(String[] args) {\n\t\tDate date=new Date(Long.parseLong(\"1438842265000\"));\n\t\tSystem.err.println(new SimpleDateFormat(\"yyyy-MM-dd HH:mm:ss\").format(date));\n\t}", "public static String timestamp(){\n\t\tDate date = new Date();\n\t\tDateFormat hourdateFormat = new SimpleDateFormat(\"dd/MM/yyyy HH:mm:ss \");\n\t\treturn hourdateFormat.format(date);\n\t}", "void get_timestamp (int reversed)\n{\n BytePtr str = new BytePtr(20);\n int i;\n\n if (timestamp != 0) return;\n str.at(19, (byte)0);\n if (reversed != 0)\n for (i=19; i-- != 0; ) str.at(i, (byte)CTOJ.fgetc(ifp));\n else\n CTOJ.fread (str, 19, 1, ifp);\n\n int year = ( str.at(0) - '0')*1000 + (str.at(1) - '0')*100 + (str.at(2) - '0' )*10 + str.at(3) - '0';\n int mon = (str.at(5) - '0')*10 + str.at(6)-'0';\n int day = (str.at(8) - '0')*10 + str.at(9)-'0';\n int hour = (str.at(11) - '0')*10 + str.at(12)-'0';\n int min = (str.at(14) - '0')*10 + str.at(15)-'0';\n int sec = (str.at(17) - '0')*10 + str.at(18)-'0';\n \n Calendar cal = new GregorianCalendar();\n cal.set(year,mon-1,day,hour,min,sec);\n timestamp = cal.getTimeInMillis();\n}", "public static String formatDate(java.sql.Timestamp timestamp) {\n if (timestamp == null)\n return \"\";\n DateFormat df = DateFormat.getDateTimeInstance(DateFormat.LONG, DateFormat.FULL);\n java.util.Date date = timestamp;\n return df.format(date);\n }", "public static String getDateTimeForFeedback(long unixTime) throws Exception {\n StringBuilder builder = new StringBuilder();\n Date quakeTime = new Date((long) unixTime);\n SimpleDateFormat dateTimeFormatter = new SimpleDateFormat(\"MM/dd/yyyy HH:mm:ss\");\n if (quakeTime != null) {\n String quakeTimeS = dateTimeFormatter.format(quakeTime);\n if (quakeTimeS != null) {\n builder.append(quakeTimeS);\n }\n }\n return builder.toString();\n }", "public long getTimestampMillisecUTC();", "public static String[] getUserFriendlyDate(long ts) {\n Date date = new Date(ts);\r\n Calendar calendar = Calendar.getInstance();\r\n calendar.setTime(date);\r\n\r\n String year = null;\r\n String month = null;\r\n String day = null;\r\n\r\n String hour = null;\r\n String minute = null;\r\n String second = null;\r\n\r\n int iyear = calendar.get(Calendar.YEAR);\r\n int imonth = calendar.get(Calendar.MONTH)+1;\r\n int iday = calendar.get(Calendar.DAY_OF_MONTH);\r\n month = Integer.toString(imonth);\r\n day = Integer.toString(iday);\r\n if(month.length() == 1) {month = \"0\"+month;}\r\n if(day.length() == 1) {day = \"0\"+day;}\r\n String dateString = new String(iyear + \"/\" + month + \"/\" + day);\r\n\r\n int ihour = calendar.get(Calendar.HOUR_OF_DAY);\r\n int iminute = calendar.get(Calendar.MINUTE);\r\n int isecond = calendar.get(Calendar.SECOND);\r\n hour = Integer.toString(ihour);\r\n minute = Integer.toString(iminute);\r\n second = Integer.toString(isecond);\r\n if(hour.length() == 1) {hour = \"0\"+hour;}\r\n if(minute.length() == 1) {minute = \"0\"+minute;}\r\n if(second.length() == 1) {second = \"0\"+second;}\r\n String timeString = new String(hour + \":\" + minute + \":\" + second);\r\n\r\n return new String[] {dateString, timeString};\r\n }", "public static long longTimestamp() {\n return now().getTime();\n }", "public String generateTimeStamp() {\t\t\r\n\t\t\tCalendar now = Calendar.getInstance();\r\n\t\t\tint year = now.get(Calendar.YEAR);\r\n\t\t\tint month = now.get(Calendar.MONTH) + 1;\r\n\t\t\tint day = now.get(Calendar.DATE);\r\n\t\t\tint hour = now.get(Calendar.HOUR_OF_DAY); // 24 hour format\r\n\t\t\tint minute = now.get(Calendar.MINUTE);\r\n\t\t\tint second = now.get(Calendar.SECOND);\r\n\t\t\t\r\n\t\t\tString date = new Integer(year).toString() + \"y\";\r\n\t\t\t\r\n\t\t\tif(month<10)date = date + \"0\"; // zero padding single digit months to aid sorting.\r\n\t\t\tdate = date + new Integer(month).toString() + \"m\"; \r\n\r\n\t\t\tif(day<10)date = date + \"0\"; // zero padding to aid sorting.\r\n\t\t\tdate = date + new Integer(day).toString() + \"d\";\r\n\r\n\t\t\tif(hour<10)date = date + \"0\"; // zero padding to aid sorting.\r\n\t\t\tdate = date + new Integer(hour).toString() + \"_\"; \r\n\r\n\t\t\tif(minute<10)date = date + \"0\"; // zero padding to aid sorting.\r\n\t\t\tdate = date + new Integer(minute).toString() + \"_\"; \r\n\r\n\t\t\tif(second<10)date = date + \"0\"; // zero padding to aid sorting.\r\n\t\t\tdate = date + new Integer(second).toString() + \"x\";\r\n\t\t\t\r\n\t\t\t// add the random number just to be sure we avoid name collisions\r\n\t\t\tRandom rand = new Random();\r\n\t\t\tdate = date + rand.nextInt(1000);\r\n\t\t\treturn date;\r\n\t\t}", "public static java.sql.Date convertToTimestamp(Timestamp convert) {\n\t\tCalendar c = Calendar.getInstance();\n\t\tc.setTimeInMillis(convert.getTime());\n\t\tjava.sql.Date d = new java.sql.Date(c.getTimeInMillis());\n\t\treturn d;\n\t}", "String getTimestamp();", "String getTimestamp();", "public static String dateConv(int date) {\n\t\tDate mills = new Date(date*1000L); \n\t\tString pattern = \"dd-MM-yyyy\";\n\t\tSimpleDateFormat simpleDateFormat = new SimpleDateFormat(pattern);\n\t\tsimpleDateFormat.setTimeZone(TimeZone.getTimeZone(\"GMT+1\"));\n\t\tString formattedDate = simpleDateFormat.format(mills);\n\t\treturn formattedDate;\n\t}", "public static String longToYYYYMMDD(long longTime)\r\n/* 143: */ {\r\n/* 144:206 */ SimpleDateFormat formatter = new SimpleDateFormat(\"yyyyMMdd\");\r\n/* 145:207 */ Date strtodate = new Date(longTime);\r\n/* 146:208 */ return formatter.format(strtodate);\r\n/* 147: */ }", "public static String formattedDate(long timestamp) {\n Calendar cal = Calendar.getInstance();\n cal.setTimeInMillis(timestamp*1000);\n DateFormat dateFormat = new SimpleDateFormat(\"dd.MM.yyyy HH:mm:ss\");\n return dateFormat.format(cal.getTime());\n\n }", "public static java.util.Date convertToUDate(java.sql.Timestamp timeStamp) {\n\t\tif (timeStamp == null) {\n\t\t\treturn null;\n\t\t} else {\n\t\t\tjava.util.Date uDate = new Date(timeStamp.getTime());\n\t\t\treturn uDate;\n\t\t}\n\t}", "public static Date LongTotime(Long lDate)\n\t{\n\t\tif(lDate==0)\n\t\t\treturn new Date(1970,1,1);\n\t\telse\n\t\t\treturn new Date(lDate);\n\t}", "private static String getTimeStamp()\r\n\t{\r\n\t\tDateFormat dateFormat = new SimpleDateFormat(\"yyyy-MM-dd_HH.mm.ss\");\r\n\t\tDate date = new Date();\r\n\t\treturn dateFormat.format(date);\r\n\t}", "java.lang.String getTimestamp();", "java.lang.String getTimestamp();", "public static String timeStamp()\n {\n DateFormat format = new SimpleDateFormat(\"ddMMyyHHmmSS\");\n return format.format(new Date());\n }", "public static String createTimeStamp(){\n return new SimpleDateFormat( \"yyyy.MM.dd.HH.mm.ss\").format(new Date());\n }", "public static String calcDateStringFromTimestamp(String s, long timestamp) {\n Calendar cal = Calendar.getInstance(Locale.ENGLISH);\n cal.setTimeInMillis(timestamp);\n String date = DateFormat.format(s, cal).toString();\n return date;\n }", "public static void main(String[] args) {\n\n\t\t SimpleDateFormat sf = new SimpleDateFormat(\"yyyyMMddHHmmssSSS\");\n\t\t// for(int i=0; i<100; i++) {\n\t\t// String strDT = sf.format(new Date(System.currentTimeMillis()));\n\t\t// System.out.println(strDT);\n\t\t// }\n\n\t\t\n\t\tDate oldDate = new Date();\n\t\tCalendar gcal = new GregorianCalendar();\n\t\tgcal.setTime(oldDate);\n\t\tgcal.add(Calendar.SECOND, -4468);\n\t\tDate newDate = gcal.getTime();\n\t\tSystem.out.println(sf.format(oldDate));\n\t\tSystem.out.println(sf.format(newDate));\n\t}", "public static long normalizeDate(long startDate) {\n Time time = new Time();\n time.setToNow();\n int julianDay = Time.getJulianDay(startDate, time.gmtoff);\n return time.setJulianDay(julianDay);\n }", "public static String formatDate(long date) {\r\n\t\tSimpleDateFormat sdf = new SimpleDateFormat();\r\n\t\treturn sdf.format(new Date(date));\r\n\t}", "public String convertCalendarMillisecondsAsLongToDatePublication(long fingerprint) {\n\t\t\tDateFormat dateFormat = new SimpleDateFormat(\"MMM dd, yyyy\");\n\t\t Date date = new Date(fingerprint);\n\t\t return dateFormat.format(date);\n\t\t\t}", "public static long normalizeDate(long startDate) {\n Time time = new Time();\n time.set(startDate);\n int julianDay = Time.getJulianDay(startDate, time.gmtoff);\n return time.setJulianDay(julianDay);\n }" ]
[ "0.66079235", "0.622985", "0.6095874", "0.60657614", "0.5902506", "0.58582556", "0.5853266", "0.58117", "0.58025813", "0.5800931", "0.5800931", "0.5800931", "0.5800931", "0.5800931", "0.5800931", "0.5800931", "0.5800931", "0.5800931", "0.5800931", "0.5800931", "0.5800931", "0.5800931", "0.5800931", "0.5800931", "0.5800931", "0.57909876", "0.57734376", "0.5741121", "0.57310313", "0.57281286", "0.57060677", "0.566744", "0.5659784", "0.56513464", "0.5620697", "0.5566614", "0.55624247", "0.555983", "0.55407286", "0.553059", "0.5522178", "0.5520583", "0.5504117", "0.54973966", "0.54785305", "0.5471779", "0.5471487", "0.5438632", "0.54366606", "0.54282093", "0.5418459", "0.5418459", "0.53936017", "0.5393404", "0.5388659", "0.537969", "0.53756976", "0.53702104", "0.5367933", "0.53542274", "0.5351846", "0.5321212", "0.5321212", "0.53067255", "0.5299999", "0.5287277", "0.52872354", "0.52617264", "0.5243838", "0.5237377", "0.52349645", "0.52072257", "0.5204936", "0.51928616", "0.5186405", "0.51774436", "0.51659596", "0.51643294", "0.5148582", "0.51332253", "0.51322854", "0.5130161", "0.51266086", "0.51266086", "0.5123837", "0.51013595", "0.5100706", "0.5086004", "0.5080755", "0.5052161", "0.50451267", "0.50451267", "0.50445515", "0.5043077", "0.50379634", "0.50083023", "0.50039005", "0.49970168", "0.49931815", "0.49889165" ]
0.6295605
1
method to get current GMT seconds
public int getGMTOffSetSeconds() throws Exception { return getGMTOffSetSeconds(""); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static long getCurrentGMTTime() {\n\n\t\tTimeZone timezone = TimeZone.getTimeZone(STANDARD_TIME_ZONE);\n\t\tlong currentTime = System.currentTimeMillis();\n\t\treturn currentTime - timezone.getOffset(currentTime);\n\t}", "public double getSystemTimeSec() {\n\treturn getSystemTime() / Math.pow(10, 9);\n}", "long getCurrentTimeMs();", "private long timeNow()\n {\n // The value of 3506716800000000L is the BAT as at midnight on\n // 1-Jan-1970, which is the base of the time that the system\n // gives us. It has to be adjusted for leap seconds though.\n return (System.currentTimeMillis() * 1000L) + DUTC.get() * 1000000L + 3506716800000000L;\n }", "public static String getGMTTime() {\r\n\t\treturn getGMTTime(\"HH:mm:ss\");\r\n\t}", "public final native int getUTCSeconds() /*-{\n return this.getUTCSeconds();\n }-*/;", "String getCurTime();", "double getClientTime();", "public static Date getLocalUTCTime(){\r\n\t\tfinal Calendar cal=Calendar.getInstance();\r\n\t\tfinal int zoneOffset=cal.get(Calendar.ZONE_OFFSET);\r\n\t\tfinal int dstOffset=cal.get(Calendar.DST_OFFSET);\r\n\t\tcal.add(Calendar.MILLISECOND, -(zoneOffset+dstOffset));\r\n\t\treturn cal.getTime();\r\n\t}", "public long getCurrentSystemTime() {\n return getSystemTime() - startSystemTimeNano;\n }", "public static long getTime() {\n\t\treturn (Sys.getTime() * 1000) / Sys.getTimerResolution();\n\t}", "int getTime();", "int getTime();", "public long getTime() {\n\t\treturn (Sys.getTime() * 1000) / Sys.getTimerResolution();\n\t}", "private static Timestamp getCurrentTimeInSeconds() {\n\t\tLong mseconds = System.currentTimeMillis();\n\t\tmseconds = mseconds - mseconds % 1000;\n\t\treturn new Timestamp(mseconds);\n\t}", "public double getUserTimeSec() {\n\treturn getUserTime() / Math.pow(10, 9);\n}", "public int getSystemTime() {\n\t\treturn this.systemTime;\n\t}", "public float getTimeSeconds() { return getTime()/1000f; }", "public float getCurrentTime()\r\n\t{\r\n\t\tcurrenttime = Calendar.getInstance();\r\n\t\treturn currenttime.getTimeInMillis();\r\n\t}", "int getTtiSeconds();", "double getTime();", "java.lang.String getServerTime();", "long getTime();", "long getTime();", "long getTime();", "long getTime();", "long getTime();", "long getTime();", "long getTime();", "long getTime();", "long getTime();", "long getTime();", "long getTime();", "long getTime();", "public int getTimeOfSession();", "public static float getCurrentTime(){\n return (float)(System.currentTimeMillis()-t0)/1000.0f;\r\n }", "public long getTime();", "String getTime(){\n\t\tCalendar c = Calendar.getInstance();\n int mseconds = c.get(Calendar.MILLISECOND);\n String currentDateandTime = mDateFormat.format(new Date()) + String.format(\"-%04d\", mseconds);\n \n return currentDateandTime;\n\t}", "public static long getSecondsSinceEpoch() {\n return System.currentTimeMillis() / 1000L;\n }", "@Override\n\tpublic long getCurrentTime() {\n\t\treturn 0;\n\t}", "public long getCurrentUserTime() {\n return getUserTime() - startUserTimeNano;\n }", "public double getTime();", "@SimpleFunction(description = \"Gets the current time.\"\n + \"It is formatted correctly for iSENSE\")\n public String GetTime() {\n Calendar cal = Calendar.getInstance();\n SimpleDateFormat sdf = new SimpleDateFormat(\"yyyy-MM-dd'T'HH:mm:ss.SSSZ\");\n return sdf.format(cal.getTime()).toString();\n }", "public long getEventTime();", "public static String getCurrentTime()\n\t{\n\t\treturn getTime(new Date());\n\t}", "long ctime() {\n return ctime;\n }", "public String getCurrentSeconds() {\n\t\t\t\t// DateFormat dateFormat = new SimpleDateFormat(\"yyyy-MM-dd HH:mm\");\n\t\t\t\t// need to change after the date format is decided\n\t\t\t\tDateFormat dateFormat = new SimpleDateFormat(\"ss\");\n\t\t\t\tDate date = new Date();\n\t\t\t\treturn dateFormat.format(date);\n\t\t\t}", "public static long currentTimeInSecond() {\n return Instant.now().getEpochSecond();\n }", "Time getTime();", "private static String currentTimestamp()\r\n {\n \r\n long currentTime = System.currentTimeMillis();\r\n sCalendar.setTime(new Date(currentTime));\r\n \r\n String str = \"\";\r\n str += sCalendar.get(Calendar.YEAR) + \"-\";\r\n \r\n final int month = sCalendar.get(Calendar.MONTH) + 1;\r\n if (month < 10)\r\n {\r\n str += 0;\r\n }\r\n str += month + \"-\";\r\n \r\n final int day = sCalendar.get(Calendar.DAY_OF_MONTH);\r\n if (day < 10)\r\n {\r\n str += 0;\r\n }\r\n str += day;\r\n \r\n str += \"T\";\r\n \r\n final int hour = sCalendar.get(Calendar.HOUR_OF_DAY);\r\n if (hour < 10)\r\n {\r\n str += 0;\r\n }\r\n str += hour + \":\";\r\n \r\n final int minute = sCalendar.get(Calendar.MINUTE);\r\n if (minute < 10)\r\n {\r\n str += 0;\r\n }\r\n str += minute + \":\";\r\n \r\n final int second = sCalendar.get(Calendar.SECOND);\r\n if (second < 10)\r\n {\r\n str += 0;\r\n }\r\n str += second + \".\";\r\n \r\n final int milli = sCalendar.get(Calendar.MILLISECOND);\r\n str += milli;\r\n \r\n str += \"Z\";\r\n \r\n return str;\r\n }", "public static long getCurrentUTCTime() {\n final Calendar calendar = Calendar.getInstance(TimeZone.getTimeZone(DEFAULT_TIMEZONE));\n return calendar.getTimeInMillis();\n }", "public static long time() {\n return date().getTime();\n }", "public int getTime(){\n return (timerStarted > 0) ? (int) ((System.currentTimeMillis() - timerStarted) / 1000L) : 0;\n }", "DateTime getTime();", "public long getServerStartTime() {\r\n return 0;\r\n }", "public static String getTime() {\r\n\r\n\t\t//Gets current date and time\r\n\t\tDateFormat dateFormat = new SimpleDateFormat(\"yyyy-MM-dd HH:mm:ss\");\r\n\t\tDate date = new Date();\r\n\t\tcurrDateTime = dateFormat.format(date);\r\n\t\treturn currDateTime;\r\n\t}", "public long getSystemStartTime() {\n return (this.systemStartTime);\n }", "public static int getTime() {\n\t\treturn time;\n\t}", "public double getTimeYgGcs() {\n return timeYgGcs;\n }", "private static long getCurrentTime() {\n return (new Date()).getTime();\n }", "public static long todayStartTimeInSecond() {\n return LocalDateTime.of(LocalDate.now(), LocalTime.MIN).toEpochSecond(getStandardOffset());\n }", "private ZonedDateTime timestamp() {\n return Instant.now().atZone(ZoneId.of(\"UTC\")).minusMinutes(1);\n }", "private long _getUTCSeconds(long dmy, long hms)\n {\n \n /* time of day [TOD] */\n int HH = (int)((hms / 10000L) % 100L);\n int MM = (int)((hms / 100L) % 100L);\n int SS = (int)(hms % 100L);\n long TOD = (HH * 3600L) + (MM * 60L) + SS;\n \n /* current UTC day */\n long DAY;\n if (dmy > 0L) {\n int yy = (int)(dmy % 100L) + 2000;\n int mm = (int)((dmy / 100L) % 100L);\n int dd = (int)((dmy / 10000L) % 100L);\n long yr = ((long)yy * 1000L) + (long)(((mm - 3) * 1000) / 12);\n DAY = ((367L * yr + 625L) / 1000L) - (2L * (yr / 1000L))\n + (yr / 4000L) - (yr / 100000L) + (yr / 400000L)\n + (long)dd - 719469L;\n } else {\n // we don't have the day, so we need to figure out as close as we can what it should be.\n long utc = DateTime.getCurrentTimeSec();\n long tod = utc % DateTime.DaySeconds(1);\n DAY = utc / DateTime.DaySeconds(1);\n long dif = (tod >= TOD)? (tod - TOD) : (TOD - tod); // difference should be small (ie. < 1 hour)\n if (dif > DateTime.HourSeconds(12)) { // 12 to 18 hours\n // > 12 hour difference, assume we've crossed a day boundary\n if (tod > TOD) {\n // tod > TOD likely represents the next day\n DAY++;\n } else {\n // tod < TOD likely represents the previous day\n DAY--;\n }\n }\n }\n \n /* return UTC seconds */\n long sec = DateTime.DaySeconds(DAY) + TOD;\n return sec;\n \n }", "public float getCurrentTime () {\n\t\treturn timer;\n\t}", "public Date getGmtUpdate() {\n return gmtUpdate;\n }", "LocalTime getTime();", "public String getTime() {\n\t\t\tDateFormat dateFormat = new SimpleDateFormat(\"HH:mm:ss\");\n\t\t\tCalendar cal = Calendar.getInstance();\n\t\t\tString time = dateFormat.format(cal.getTime());\n\t\t\treturn time;\n\t\t}", "int getSignOnTime();", "private long getSystemTime() {\n ThreadMXBean bean = ManagementFactory.getThreadMXBean();\n return bean.isCurrentThreadCpuTimeSupported() ? (bean.getCurrentThreadCpuTime() - bean.getCurrentThreadUserTime()) : 0L;\n }", "public static String getDateTime() {\n Calendar cal = Calendar.getInstance(TimeZone.getTimeZone(\"UTC\"));\n Date currentLocalTime = cal.getTime();\n SimpleDateFormat df = new SimpleDateFormat(\"yyyy-MM-dd HH:mm:ss.SSS\");\n df.setTimeZone(TimeZone.getTimeZone(\"UTC\"));\n String date = df.format(currentLocalTime);\n return date;\n }", "java.lang.String getTime();", "public static int getNowTime() {\n\t\tSimpleDateFormat timeFormat = new SimpleDateFormat(\"HHmmss\");\n\t\treturn Integer.parseInt(timeFormat.format(new Date()));\n\t}", "public static long getSystemTime( ) {\n ThreadMXBean bean = ManagementFactory.getThreadMXBean( );\n return bean.isCurrentThreadCpuTimeSupported( ) ?\n (bean.getCurrentThreadCpuTime( ) - bean.getCurrentThreadUserTime( )) : 0L;\n\n }", "public Date getTimeNow() {\r\n return timeNow;\r\n }", "public static String getTimeStamp() {\r\n\r\n\t\tlong now = (System.currentTimeMillis() - startTime) / 1000;\r\n\r\n\t\tlong hours = (now / (60 * 60)) % 24;\r\n\t\tnow -= (hours / (60 * 60)) % 24;\r\n\r\n\t\tlong minutes = (now / 60) % 60;\r\n\t\tnow -= (minutes / 60) % 60;\r\n\r\n\t\tlong seconds = now % 60;\r\n\r\n\t return String.format(\"%02d:%02d:%02d\", hours, minutes, seconds);\r\n\t}", "private Date getSamoaNow() {\n\t\t// Get the current datetime in UTC\n\t\tCalendar calendar = Calendar.getInstance();\n\t\tcalendar.setTime(new Date());\n\t\t\n\t\t// Get the datetime minus 11 hours (Samoa is UTC-11)\n\t\tcalendar.add(Calendar.HOUR_OF_DAY, -11);\n\t\t\n\t\treturn calendar.getTime();\n\t}", "DateTime nowUtc();", "private static Duration localSystemTimezoneDuration() {\n ZonedDateTime zdt = ZonedDateTime.now();\n int tzDurationInSeconds = zdt.getOffset().getTotalSeconds();\n Duration dur = NodeFunctions.duration(tzDurationInSeconds);\n return dur;\n }", "public static long now() {\n return System.nanoTime();\n }", "public String getSystemTime() {\n return DateFormat.getDateTimeInstance().format(new Date().getTime());\n }", "public int getTotalTime();", "public static String getCurrentTime(){\n Calendar calendar = Calendar.getInstance(TimeZone.getTimeZone(\"Asia/Singapore\"));\n Date currentDate = calendar.getTime();\n return currentDate.toString();\n }", "public static long getTime() \r\n {\r\n return System.nanoTime(); \r\n }", "public double getTimeYgFullGcs() {\n return timeYgFullGcs;\n }", "long getStartTime();", "public int getGMTOffSetSeconds(String GMT) throws Exception {\n int RawOffSet = 0;\n double iTracker = 0.0;\n try {\n\n iTracker = 0.0;\n //check for null & blank GMT,, return server deafult GMT\n if (GMT == null) {\n return RawOffSet = TimeZone.getDefault().getRawOffset() / 1000;\n } //null GMT\n if (GMT.trim().equalsIgnoreCase(\"\")) {\n return RawOffSet = TimeZone.getDefault().getRawOffset() / 1000;\n } //invalid GMT value\n\n iTracker = 1.0;\n //check for validations of GMT string\n\n if (!GMT.contains(\":\")) {\n throw new Exception(\"Invalid GMT , does noit contains ':' colon ## \");\n } //invalid GMT value\n\n iTracker = 2.0;\n String[] saTemp = GMT.trim().toUpperCase().split(\":\"); //\n if (saTemp.length != 2) {\n throw new Exception(\"Invalid GMT, : slpit length is not equal to 2 ## \");\n } //invalid GMT value\n\n iTracker = 3.0;\n String HH = saTemp[0].trim();\n String MM = saTemp[1].trim();\n boolean isNegativeGMT = false;\n\n iTracker = 4.0;\n if (HH.contains(\"-\")) {\n isNegativeGMT = true;\n }\n HH = HH.replaceAll(\"-\", \"\").trim().toUpperCase();\n HH = HH.replaceAll(\"[+]\", \"\").trim().toUpperCase();\n\n iTracker = 5.0;\n int iHH = Integer.parseInt(HH);\n int iMM = Integer.parseInt(MM);\n\n if (iHH > 11) {\n throw new Exception(\"invalid GMT : HH > 11 ##\");\n }\n if (iHH < -11) {\n throw new Exception(\"invalid GMT : HH < -11 ##\");\n }\n\n if (iMM < 0) {\n throw new Exception(\"invalid GMT : MM < 0 ##\");\n }\n if (iMM > 59) {\n throw new Exception(\"invalid GMT : MM > 59 ##\");\n }\n\n iTracker = 6.0;\n RawOffSet = (iHH * 60 * 60) + (iMM * 60);\n if (isNegativeGMT) {\n RawOffSet = RawOffSet * -1;\n }\n\n iTracker = 7.0;\n return RawOffSet;\n\n } catch (Exception e) {\n println(\"getGMTOffSetSeconds : \" + e.toString() + \" : \" + GMT);\n throw new Exception(\"getGMTOffSetSeconds : \" + e.toString());\n }\n\n }", "Long timestamp();", "@Override\r\n\tpublic String gettime() {\n\t\treturn user.gettime();\r\n\t}", "private String currentTime()\t{\n\t\tCalendar c = Calendar.getInstance(); \n\n\t\tString seconds;\n\t\tif(c.get(Calendar.SECOND) < 10)\t{\n\t\t\tseconds = \"0\"+Integer.toString(c.get(Calendar.SECOND));\n\t\t} else {\n\t\t\tseconds = Integer.toString(c.get(Calendar.SECOND));\n\t\t}\n\n\t\tString minutes;\n\t\tif(c.get(Calendar.MINUTE) < 10)\t{\n\t\t\tminutes = \"0\"+Integer.toString(c.get(Calendar.MINUTE));\n\t\t} else {\n\t\t\tminutes = Integer.toString(c.get(Calendar.MINUTE));\n\t\t}\n\n\t\tString hours;\n\t\tif(c.get(Calendar.HOUR_OF_DAY) < 10)\t{\n\t\t\thours = \"0\"+Integer.toString(c.get(Calendar.HOUR_OF_DAY));\n\t\t} else {\n\t\t\thours = Integer.toString(c.get(Calendar.HOUR_OF_DAY));\n\t\t}\n\n\t\tString day;\n\t\tif(c.get(Calendar.DATE) < 10)\t{\n\t\t\tday = \"0\"+Integer.toString(c.get(Calendar.DATE));\n\t\t} else {\n\t\t\tday = Integer.toString(c.get(Calendar.DATE));\n\t\t}\n\n\t\tString month;\n\t\tif((c.get(Calendar.MONTH)+1) < 10)\t{\n\t\t\tmonth = \"0\"+Integer.toString(c.get(Calendar.MONTH)+1);\n\t\t} else {\n\t\t\tmonth = Integer.toString(c.get(Calendar.MONTH)+1);\n\t\t}\n\n\t\tString year;\n\t\tif(c.get(Calendar.YEAR) < 10)\t{\n\t\t\tyear = \"0\"+Integer.toString(c.get(Calendar.YEAR));\n\t\t} else {\n\t\t\tyear = Integer.toString(c.get(Calendar.YEAR));\n\t\t}\n\n\t\treturn day+\"/\"+month+\"/\"+year + \" \"+hours+\":\"+minutes+\":\"+seconds;\t\n\t}", "public float getCurrentTime()\n\t{\n\t\treturn currentTime;\n\t}", "public static final String CurrentTime() {\n\t\t\n\t\tfinal SimpleDateFormat DF = new SimpleDateFormat(\"HH:mm:ss\");\n\t\treturn DF.format(new Date());\n\t}", "public final long getLocalTimeStamp()\n {\n return getTimeStamp( TimeZone.getDefault());\n }", "UtcT time_stamp () throws BaseException;", "public static long getTime() {\r\n\t\treturn System.currentTimeMillis();\r\n\t}", "long getCurrentTimeMs() {\n return System.currentTimeMillis();\n }", "public static long getSystemTime () {\n\n ThreadMXBean bean = ManagementFactory.getThreadMXBean();\n return bean.isCurrentThreadCpuTimeSupported()?\n (bean.getCurrentThreadCpuTime() - bean.getCurrentThreadUserTime()): 0L;\n }", "public static String getNowTime(){\r\n\t\tDate date = new Date();\r\n\t\tDateFormat format = new SimpleDateFormat(\"yyyy-MM-dd HH:mm:ss\");\r\n\t\tString time = format.format(date);\r\n\t\treturn time;\r\n\t}", "public static Date getDateNowSingl(){\n\t\tconfigDefaultsTimeZoneAndLocale();\r\n\t\t\r\n\t\t// o time millis é sempre GMT 0, a transformação fica por conta do Date\r\n\t\treturn new Date(System.currentTimeMillis()+getPropDefaultForAll(TIME_CORRECTION));\r\n\t}", "public static Calendar getCurrentTime(String argGMT) {\r\n\t\treturn DateToCalendar(getTime(argGMT));\r\n\t}", "public static String getCurrentTime() {\r\n\t\tDate date = new Date();\r\n\t\treturn date.toString();\r\n\t}", "int getStartTime();" ]
[ "0.7545283", "0.71840405", "0.70763093", "0.7045088", "0.69520104", "0.69124174", "0.68477094", "0.6784231", "0.6757396", "0.6755154", "0.67538804", "0.6750216", "0.6750216", "0.6717372", "0.6685781", "0.6653546", "0.6622547", "0.65796965", "0.6562136", "0.65435237", "0.65378827", "0.65272427", "0.65205723", "0.65205723", "0.65205723", "0.65205723", "0.65205723", "0.65205723", "0.65205723", "0.65205723", "0.65205723", "0.65205723", "0.65205723", "0.65205723", "0.65101326", "0.65061074", "0.6498369", "0.6489819", "0.6452481", "0.6452159", "0.64426327", "0.6442402", "0.6433074", "0.64284754", "0.6427487", "0.6417005", "0.6416521", "0.64139444", "0.63687974", "0.63550484", "0.6344473", "0.63385844", "0.63362384", "0.63313735", "0.6329956", "0.6327854", "0.6314725", "0.63068897", "0.62827086", "0.6279507", "0.6276396", "0.6265045", "0.62632465", "0.62622595", "0.62516165", "0.62498623", "0.62448025", "0.6232367", "0.6230656", "0.6225501", "0.6225435", "0.6225337", "0.6223532", "0.6221751", "0.6220656", "0.622042", "0.6218169", "0.62164414", "0.62162584", "0.6212298", "0.62087715", "0.6207224", "0.6203362", "0.6199479", "0.61885333", "0.61869144", "0.61852485", "0.61821324", "0.61819226", "0.61796784", "0.6176435", "0.61761844", "0.61745125", "0.61737025", "0.6173133", "0.617038", "0.61633", "0.61569697", "0.61548626", "0.61513513", "0.61510813" ]
0.0
-1
method to get GMT seconds for a particular GMT (04:30. +11:15)
public int getGMTOffSetSeconds(String GMT) throws Exception { int RawOffSet = 0; double iTracker = 0.0; try { iTracker = 0.0; //check for null & blank GMT,, return server deafult GMT if (GMT == null) { return RawOffSet = TimeZone.getDefault().getRawOffset() / 1000; } //null GMT if (GMT.trim().equalsIgnoreCase("")) { return RawOffSet = TimeZone.getDefault().getRawOffset() / 1000; } //invalid GMT value iTracker = 1.0; //check for validations of GMT string if (!GMT.contains(":")) { throw new Exception("Invalid GMT , does noit contains ':' colon ## "); } //invalid GMT value iTracker = 2.0; String[] saTemp = GMT.trim().toUpperCase().split(":"); // if (saTemp.length != 2) { throw new Exception("Invalid GMT, : slpit length is not equal to 2 ## "); } //invalid GMT value iTracker = 3.0; String HH = saTemp[0].trim(); String MM = saTemp[1].trim(); boolean isNegativeGMT = false; iTracker = 4.0; if (HH.contains("-")) { isNegativeGMT = true; } HH = HH.replaceAll("-", "").trim().toUpperCase(); HH = HH.replaceAll("[+]", "").trim().toUpperCase(); iTracker = 5.0; int iHH = Integer.parseInt(HH); int iMM = Integer.parseInt(MM); if (iHH > 11) { throw new Exception("invalid GMT : HH > 11 ##"); } if (iHH < -11) { throw new Exception("invalid GMT : HH < -11 ##"); } if (iMM < 0) { throw new Exception("invalid GMT : MM < 0 ##"); } if (iMM > 59) { throw new Exception("invalid GMT : MM > 59 ##"); } iTracker = 6.0; RawOffSet = (iHH * 60 * 60) + (iMM * 60); if (isNegativeGMT) { RawOffSet = RawOffSet * -1; } iTracker = 7.0; return RawOffSet; } catch (Exception e) { println("getGMTOffSetSeconds : " + e.toString() + " : " + GMT); throw new Exception("getGMTOffSetSeconds : " + e.toString()); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public String getDateTime(Calendar cal, int GMT_OFFSET_SECONDS, String DATE_TIME_FORMAT) throws Exception {\n\n String sRetVal = \"\";\n String DefaultFormat = \"yyyyMMddHHmmss\";\n int GMT_OFFSET_DIFF = 0;\n try {\n\n //check for valid Calender values\n if (cal == null) {\n cal = Calendar.getInstance();\n }\n\n //check for valid FORMAT values\n if (DATE_TIME_FORMAT == null) {\n DATE_TIME_FORMAT = DefaultFormat;\n }\n if (DATE_TIME_FORMAT.trim().toUpperCase().equalsIgnoreCase(\"\")) {\n DATE_TIME_FORMAT = DefaultFormat;\n }\n\n //check GMT RAW OFF SET difference\n int CURR_GMT_OFFSET = TimeZone.getDefault().getRawOffset() / 1000;\n //in case Current GMT is GREATER THAN provided GMT\n if (CURR_GMT_OFFSET > GMT_OFFSET_SECONDS && GMT_OFFSET_SECONDS != 0) {\n if (GMT_OFFSET_SECONDS < 0) {\n GMT_OFFSET_DIFF = GMT_OFFSET_SECONDS - CURR_GMT_OFFSET;\n } else {\n GMT_OFFSET_DIFF = GMT_OFFSET_SECONDS - CURR_GMT_OFFSET;\n }\n\n //in case Current GMT is SMALLER THAN provided GMT\n } else if (CURR_GMT_OFFSET < GMT_OFFSET_SECONDS && GMT_OFFSET_SECONDS != 0) {\n if (GMT_OFFSET_SECONDS < 0) {\n GMT_OFFSET_DIFF = GMT_OFFSET_SECONDS - CURR_GMT_OFFSET;\n } else {\n GMT_OFFSET_DIFF = GMT_OFFSET_SECONDS - CURR_GMT_OFFSET;\n }\n }\n\n if (CURR_GMT_OFFSET == GMT_OFFSET_SECONDS) {\n GMT_OFFSET_DIFF = 0;\n }\n\n //setting calender datetime as per GMT\n cal.add(Calendar.SECOND, GMT_OFFSET_DIFF);\n\n //using SimpleDateFormat class\n sRetVal = new SimpleDateFormat(DATE_TIME_FORMAT).format(cal.getTime());\n return sRetVal;\n\n } catch (Exception e) {\n println(\"getDateTime : \" + GMT_OFFSET_SECONDS + \" : \" + e.toString());\n throw new Exception(\"getDateTime : \" + GMT_OFFSET_SECONDS + \" : \" + e.toString());\n } finally {\n }\n\n }", "public static long getCurrentGMTTime() {\n\n\t\tTimeZone timezone = TimeZone.getTimeZone(STANDARD_TIME_ZONE);\n\t\tlong currentTime = System.currentTimeMillis();\n\t\treturn currentTime - timezone.getOffset(currentTime);\n\t}", "public static String getGMTTime() {\r\n\t\treturn getGMTTime(\"HH:mm:ss\");\r\n\t}", "private long _getUTCSeconds(long dmy, long hms)\n {\n \n /* time of day [TOD] */\n int HH = (int)((hms / 10000L) % 100L);\n int MM = (int)((hms / 100L) % 100L);\n int SS = (int)(hms % 100L);\n long TOD = (HH * 3600L) + (MM * 60L) + SS;\n \n /* current UTC day */\n long DAY;\n if (dmy > 0L) {\n int yy = (int)(dmy % 100L) + 2000;\n int mm = (int)((dmy / 100L) % 100L);\n int dd = (int)((dmy / 10000L) % 100L);\n long yr = ((long)yy * 1000L) + (long)(((mm - 3) * 1000) / 12);\n DAY = ((367L * yr + 625L) / 1000L) - (2L * (yr / 1000L))\n + (yr / 4000L) - (yr / 100000L) + (yr / 400000L)\n + (long)dd - 719469L;\n } else {\n // we don't have the day, so we need to figure out as close as we can what it should be.\n long utc = DateTime.getCurrentTimeSec();\n long tod = utc % DateTime.DaySeconds(1);\n DAY = utc / DateTime.DaySeconds(1);\n long dif = (tod >= TOD)? (tod - TOD) : (TOD - tod); // difference should be small (ie. < 1 hour)\n if (dif > DateTime.HourSeconds(12)) { // 12 to 18 hours\n // > 12 hour difference, assume we've crossed a day boundary\n if (tod > TOD) {\n // tod > TOD likely represents the next day\n DAY++;\n } else {\n // tod < TOD likely represents the previous day\n DAY--;\n }\n }\n }\n \n /* return UTC seconds */\n long sec = DateTime.DaySeconds(DAY) + TOD;\n return sec;\n \n }", "public String getUTCTime(String timeZone, Calendar cal);", "@Deprecated\n public static long getGMTSecond(String argDateTime, String argInFormat) {\n SimpleDateFormat simpleDateFormat = new SimpleDateFormat(argInFormat, Locale.ENGLISH);\n simpleDateFormat.setTimeZone(TimeZone.getTimeZone(\"UTC\"));\n try {\n //Date date = simpleDateFormat.parse(simpleDateFormat.format(argDateTime));\n DateFormat dateFormat = new SimpleDateFormat(argInFormat);\n Date date = simpleDateFormat.parse(argDateTime);\n return date.getTime() / 1000;\n } catch (ParseException ex) {\n //ex.printStackTrace();\n return System.currentTimeMillis() / 1000;\n }\n }", "private static Date getTime(String argGMT) {\r\n\t\tSimpleDateFormat dateFormatGmt = new SimpleDateFormat(\r\n\t\t\t\t\"yyyy-MMM-dd HH:mm:ss\");\r\n\t\tdateFormatGmt.setTimeZone(TimeZone.getTimeZone(argGMT));\r\n\r\n\t\t// Local time zone\r\n\t\tSimpleDateFormat dateFormatLocal = new SimpleDateFormat(\r\n\t\t\t\t\"yyyy-MMM-dd HH:mm:ss\");\r\n\r\n\t\t// Time in GMT\r\n\t\ttry {\r\n\t\t\treturn dateFormatLocal.parse(dateFormatGmt.format(new Date()));\r\n\t\t} catch (ParseException e) {\r\n\t\t\te.printStackTrace();\r\n\t\t}\r\n\t\treturn null;\r\n\t}", "public static Date getLocalUTCTime(){\r\n\t\tfinal Calendar cal=Calendar.getInstance();\r\n\t\tfinal int zoneOffset=cal.get(Calendar.ZONE_OFFSET);\r\n\t\tfinal int dstOffset=cal.get(Calendar.DST_OFFSET);\r\n\t\tcal.add(Calendar.MILLISECOND, -(zoneOffset+dstOffset));\r\n\t\treturn cal.getTime();\r\n\t}", "public double getSystemTimeSec() {\n\treturn getSystemTime() / Math.pow(10, 9);\n}", "public static String getGMTTime(String format) {\r\n\t\tfinal Date currentTime = new Date();\r\n\r\n\t\tfinal SimpleDateFormat sdf = new SimpleDateFormat(format);\r\n\r\n\t\tsdf.setTimeZone(TimeZone.getTimeZone(\"GMT\"));\r\n\t\treturn sdf.format(currentTime);\r\n\t}", "public final native int getUTCSeconds() /*-{\n return this.getUTCSeconds();\n }-*/;", "int getTtiSeconds();", "private static Duration localSystemTimezoneDuration() {\n ZonedDateTime zdt = ZonedDateTime.now();\n int tzDurationInSeconds = zdt.getOffset().getTotalSeconds();\n Duration dur = NodeFunctions.duration(tzDurationInSeconds);\n return dur;\n }", "public String getDateTime(Calendar calendar, String GMT, String DATE_TIME_FORMAT) throws Exception {\n int GMT_OFFSET_SECONDS = 0;\n try {\n GMT_OFFSET_SECONDS = getGMTOffSetSeconds(GMT);\n return getDateTime(calendar, GMT_OFFSET_SECONDS, DATE_TIME_FORMAT);\n } catch (Exception e) {\n throw new Exception(\"getDateTime : Invalid GMT :\" + GMT + \" : \" + e.toString());\n }\n }", "private Date cvtToGmt( Date date )\r\n\t\t{\r\n\t\t TimeZone tz = TimeZone.getDefault();\r\n\t\t Date ret = new Date( date.getTime() - tz.getRawOffset() );\r\n\r\n\t\t // if we are now in DST, back off by the delta. Note that we are checking the GMT date, this is the KEY.\r\n\t\t if ( tz.inDaylightTime( ret ))\r\n\t\t {\r\n\t\t Date dstDate = new Date( ret.getTime() - tz.getDSTSavings() );\r\n\r\n\t\t // check to make sure we have not crossed back into standard time\r\n\t\t // this happens when we are on the cusp of DST (7pm the day before the change for PDT)\r\n\t\t if ( tz.inDaylightTime( dstDate ))\r\n\t\t {\r\n\t\t ret = dstDate;\r\n\t\t }\r\n\t\t }\r\n\r\n\t\t return ret;\r\n\t\t}", "public static String ShowTimeinGMT(Calendar cal) {\n\t\tCalendar calendar = cal;\n\t\tStringBuilder _ret = new StringBuilder();\n\n\t\tif (cal == null) {\n\t\t\tcalendar = Calendar.getInstance(TimeZone.getTimeZone(\"GMT\"));\n\t\t}\n\n\t\t_ret.append(calendar.get(Calendar.DATE) + \"-\" + (calendar.get(Calendar.MONTH) + 1) + \"-\"\n\t\t\t\t+ calendar.get(Calendar.YEAR) + \" T \" + calendar.get(Calendar.HOUR_OF_DAY) + \":\"\n\t\t\t\t+ calendar.get(Calendar.MINUTE) + \":\" + calendar.get(Calendar.SECOND));\n\t\treturn _ret.toString();\n\t}", "public double getRotRms() {\n\t\treturn 3600.0 * Math.sqrt(1000.0 * rotInt / (double) (updateTimeStamp - startTime));\n\t}", "int getUserTimeZoneCode();", "public SDate getLocalTimeFromUTC(int iyear, int imonth, int iday, int ihour, int imin, double dsec,\n\t\t\tdouble d_timezone) {\n\t\t// public SDate swe_utc_time_zone(\n\t\t// int iyear, int imonth, int iday,\n\t\t// int ihour, int imin, double dsec,\n\t\t// double d_timezone) {\n\t\tint iyear_out, imonth_out, iday_out, ihour_out, imin_out;\n\t\tdouble dsec_out;\n\t\tdouble tjd, d;\n\t\tboolean have_leapsec = false;\n\t\tdouble dhour;\n\t\tif (dsec >= 60.0) {\n\t\t\thave_leapsec = true;\n\t\t\tdsec -= 1.0;\n\t\t}\n\t\tdhour = ((double) ihour) + ((double) imin) / 60.0 + dsec / 3600.0;\n\t\ttjd = swe_julday(iyear, imonth, iday, 0, SE_GREG_CAL);\n\t\tdhour -= d_timezone;\n\t\tif (dhour < 0.0) {\n\t\t\ttjd -= 1.0;\n\t\t\tdhour += 24.0;\n\t\t}\n\t\tif (dhour >= 24.0) {\n\t\t\ttjd += 1.0;\n\t\t\tdhour -= 24.0;\n\t\t}\n\t\t// swe_revjul(tjd + 0.001, SE_GREG_CAL, iyear_out, imonth_out, iday_out,\n\t\t// &d);\n\t\tIDate dt = swe_revjul(tjd + 0.001, SE_GREG_CAL);\n\t\tiyear_out = dt.year;\n\t\timonth_out = dt.month;\n\t\tiday_out = dt.day;\n\t\tihour_out = (int) dhour;\n\t\td = (dhour - (double) ihour_out) * 60;\n\t\timin_out = (int) d;\n\t\tdsec_out = (d - (double) imin_out) * 60;\n\t\tif (have_leapsec)\n\t\t\tdsec_out += 1.0;\n\t\treturn new SDate(iyear_out, imonth_out, iday_out, ihour_out, imin_out, dsec_out);\n\t}", "int getExpiryTimeSecs();", "double getClientTime();", "public String getTimeZoneGmt() {\n return timeZoneGmt;\n }", "public LocalDateTime convertToGMT(ZonedDateTime time){\n ZoneId gmtZoneID = ZoneId.of(\"Etc/UTC\");\n ZonedDateTime gmtTime = time.withZoneSameInstant(gmtZoneID);\n return gmtTime.toLocalDateTime();\n }", "private static int convertTimeToSecs(String time){\n if (time == null) return 0;\n String hours = time.substring(0, 2);\n String mins = time.substring(3,5);\n return Integer.parseInt(hours)*3600 + Integer.parseInt(mins)*60;\n }", "public double getSecs( );", "public double getUserTimeSec() {\n\treturn getUserTime() / Math.pow(10, 9);\n}", "EDataType getSeconds();", "static long currentNTP(long localOffset) {\n long curr = System.currentTimeMillis() + OFFSET + localOffset;\n // this integer represents milliseconds. Need to move the\n // decimal point between seconds and fraction to pos 31/32\n long secs = curr / 1000L;\n double dFrac = (curr % 1000L) / 1000.0;\n long lfrac = (long) (dFrac * SCALE);\n return (secs << 32) | (lfrac & 0xFFFFFFFFL);\n //TODO: standard recommends filling low-end bits with random data.\n \n }", "public int getMinutes(){\n return (int) ((totalSeconds%3600)/60);\n }", "public static String epochToTimeGMT(long epoch)\n\t{\n\t\tSimpleDateFormat dateFormatGmt = new SimpleDateFormat(\"HHmm\");\n\t\tdateFormatGmt.setTimeZone(TimeZone.getTimeZone(\"GMT\"));\n\t\treturn dateFormatGmt.format(epoch);\n\t}", "public static void main(String [] args)\n\t{\n\tSystem.out.println(\"Enter your GMT ofset (ei: -5): \");\n Scanner input = new Scanner(System.in);\n long totalMilliSeconds=System.currentTimeMillis(); \n long totalSeconds=totalMilliSeconds/1000; \n int second=(int)(totalSeconds%60); \n long totalMinutes=totalSeconds/60; \n int minute=(int)(totalMinutes%60); \n long totalHours=totalMinutes/60; \n int hour=(int)((totalHours - 8)%24); \n //print result\n\tSystem.out.println(\"The current time is: \"+ hour + \":\" + minute + \":\" + second);\n\t}", "public String getGMTString() {\n\t\treturn \"test GMT timezone\";\n\t}", "java.lang.String getTimeZone();", "private void normalGmtStringToMinutes() {\n int i = Integer.parseInt(gmtString.substring(4, 6));\n offsetMinutes = i * 60;\n i = Integer.parseInt(gmtString.substring(7));\n offsetMinutes += i;\n if (gmtString.charAt(3) == MINUS) {\n offsetMinutes *= -1;\n }\n }", "public static long getLocalTZA(ZoneId localTimeZoneId) {\n ZoneOffset localTimeZoneOffset = localTimeZoneId.getRules().getOffset(Instant.ofEpochMilli(0));\n return localTimeZoneOffset.getTotalSeconds() * 1000L;\n }", "public float getTimeSeconds() { return getTime()/1000f; }", "public static Calendar getCurrentTime(String argGMT) {\r\n\t\treturn DateToCalendar(getTime(argGMT));\r\n\t}", "public String gmtToLocal(String gmtTime) {\n\t\tString localTime = \"\";\n\t\tcurrentFormat = new SimpleDateFormat(\"yyyy-MM-dd'T'HH:mm:ss'Z'\");\n\t\tcurrentFormat.setTimeZone(TimeZone.getTimeZone(\"UTC\"));\n\t\tDate date = null;\n\t\t\n\t\ttry {\n\t\t\t//date = currentFormat.parse(gmtTime);\n\t\t\tdate = parseDate(gmtTime,true);\n\t\t\n\t\t\n\t\t} catch (Exception e) {\n\t\t\tLogs.show(e);\n\t\t\t \n\t\t}\n\t\tcalendar = Calendar.getInstance();\n\t\tcurrentFormat.setTimeZone(calendar.getTimeZone());\n\t\tlocalTime = currentFormat.format(date);\n\t\treturn localTime;\n\t}", "int getTime();", "int getTime();", "private int getSecondsFromTimeString(String text) {\n int timeInSeconds = -1;\n if ( text != null && !\"\".equals(text) ) {\n int ipos = text.indexOf(\"Date:\");\n String txtDate = (ipos >= 0 ? text.substring(ipos+5).trim() : text.trim());\n ipos = text.lastIndexOf(\":\");\n if ( ipos > 0 ) {\n int endPos = ipos + 3;\n ipos = text.lastIndexOf(\":\",ipos-1);\n if ( ipos > 0 ) {\n int startPos = ipos - 2;\n if ( startPos >= 0 && endPos > startPos ) {\n text = text.substring(startPos, endPos);\n String[] values = text.split(\":\");\n if ( values.length > 2 ) {\n int hours = Integer.valueOf(values[0]);\n int minutes = Integer.valueOf(values[1]);\n int seconds = Integer.valueOf(values[2]);\n timeInSeconds = (hours * 3600) + (minutes * 60) + seconds;\n }\n }\n }\n }\n }\n return timeInSeconds;\n }", "public String getDateTime(Calendar calendar, String GMT) throws Exception {\n return getDateTime(calendar, GMT, \"\");\n }", "public int getSeconds(){\n return (int) (totalSeconds%60);\n }", "private long timeNow()\n {\n // The value of 3506716800000000L is the BAT as at midnight on\n // 1-Jan-1970, which is the base of the time that the system\n // gives us. It has to be adjusted for leap seconds though.\n return (System.currentTimeMillis() * 1000L) + DUTC.get() * 1000000L + 3506716800000000L;\n }", "public long getPlayerTimeOffset ( ) {\n\t\treturn extract ( handle -> handle.getPlayerTimeOffset ( ) );\n\t}", "int getPaceSeconds() {\r\n\t\tint m = getContents(minutes);\r\n\t\tint s = getContents(seconds);\r\n\t\treturn 60*m +s;\r\n\t}", "java.lang.String getServerTime();", "java.util.Calendar getStartTime();", "private String timeConversion() {\n Calendar local = Calendar.getInstance();\n Calendar GMT = Calendar.getInstance(TimeZone.getTimeZone(\"GMT\"));\n\n //Time from the PINPoint\n int hours, minutes, seconds, day, month, year;\n hours = (record[10] & 0xF8) >> 3;\n minutes = ((record[10] & 0x07) << 3) + ((record[11] & 0xE0) >> 5);\n seconds = ((record[11] & 0x1F) << 1) + ((record[12] & 0x80) >> 7);\n seconds += (record[12] & 0x7F) / 100;\n day = (record[13] & 0xF8) >> 3;\n month = ((record[13] & 0x07) << 1) + ((record[14] & 0x80) >> 7);\n year = (record[14] & 0x7F) + 2000;\n \n month--; //Months in java are 0-11, PINPoint = 1-12;\n\n //Set GMTs time to be the time from the PINPoint\n GMT.set(Calendar.DAY_OF_MONTH, day);\n GMT.set(Calendar.MONTH, month);\n GMT.set(Calendar.YEAR, year);\n GMT.set(Calendar.HOUR_OF_DAY, hours);\n GMT.set(Calendar.MINUTE, minutes);\n GMT.set(Calendar.SECOND, seconds);\n\n //Local is set to GMTs time but with the correct timezone\n local.setTimeInMillis(GMT.getTimeInMillis());\n\n //Set Local time to be the time converted from GMT\n int lHours, lMinutes, lSeconds, lDay, lMonth, lYear;\n lHours = local.get(Calendar.HOUR_OF_DAY);\n lMinutes = local.get(Calendar.MINUTE);\n lSeconds = local.get(Calendar.SECOND);\n lDay = local.get(Calendar.DAY_OF_MONTH);\n lMonth = local.get(Calendar.MONTH);\n\n lMonth++; //Months in java are 0-11, humans read 1-12\n\n lYear = local.get(Calendar.YEAR);\n\n return hR(lMonth) + \"/\" + hR(lDay) + \"/\" + lYear + \" \" + hR(lHours) + \":\" + hR(lMinutes) + \":\" + hR(lSeconds);\n }", "private Date getSamoaNow() {\n\t\t// Get the current datetime in UTC\n\t\tCalendar calendar = Calendar.getInstance();\n\t\tcalendar.setTime(new Date());\n\t\t\n\t\t// Get the datetime minus 11 hours (Samoa is UTC-11)\n\t\tcalendar.add(Calendar.HOUR_OF_DAY, -11);\n\t\t\n\t\treturn calendar.getTime();\n\t}", "public Date getUTCDate(String timeZone, Calendar cal);", "public double readClock()\n {\n return (System.currentTimeMillis() - startingTime) / 1000.0;\n }", "String getTime(){\n\t\tCalendar c = Calendar.getInstance();\n int mseconds = c.get(Calendar.MILLISECOND);\n String currentDateandTime = mDateFormat.format(new Date()) + String.format(\"-%04d\", mseconds);\n \n return currentDateandTime;\n\t}", "int getEvalTm();", "double getTime();", "T getEventTime();", "public Calendar calculateStartTime(ConfigProperties cprop){\n\t\tCalendar d = Calendar.getInstance();\n\t\tString sd = cprop.getProperty(\"TIME.startdate\");\n\t\tString st = cprop.getProperty(\"TIME.starttime\");\n\t\t\n\t\t//SD defined\n\t\tif(sd!=null){\n\t\t\td.setTime(df.parse(sd,new ParsePosition(0)));\n\t\t}\n\t\t//SD not defined, use current date\n\t\t\n\t\t//ST defined\n\t\tif(st!=null){\n\t\t\tCalendar t = Calendar.getInstance();\n\t\t\tt.setTime(tf.parse(st,new ParsePosition(0)));\n\t\t\t//take the starttime and add it to the startdate\n\t\t\td.add(Calendar.HOUR_OF_DAY,t.get(Calendar.HOUR_OF_DAY));\n\t\t\td.add(Calendar.MINUTE,t.get(Calendar.MINUTE));\n\t\t\td.add(Calendar.SECOND,t.get(Calendar.SECOND));\n\t\t}\n\t\t//ST not defined use current plus a small delay to avoid misfires\n\t\telse {\n\t\t\td.add(Calendar.SECOND,START_DELAY);\n\t\t}\n\t\treturn d;\n\n\t}", "static long getSecondsPart(Duration d) {\n long u = d.getSeconds() % 60;\n\n return u;\n }", "public long getEventTime();", "public static long getSecondsSinceEpoch() {\n return System.currentTimeMillis() / 1000L;\n }", "public int getTotalTime();", "private static final int implicitTimezoneMinutes() { return 0; }", "int getRecurrenceTimeZoneCode();", "public String[] getStarDate2(){\n\t\tstardate = new String[3];\n\t\t\n\t\tCalendar originaldate = Calendar.getInstance(TimeZone.getTimeZone(\"gmt\"));\n\t\tCalendar instancedate = Calendar.getInstance(TimeZone.getTimeZone(\"gmt\"));\n\t\t\t\t\n\t\t//originaldate.set(2008, 8, 8, 0, 0, 0);\n\t\toriginaldate.set(2162, 0, 4, 0, 0, 0);\n\t\t\n\t\t/*instancedate.add(Calendar.HOUR, 7);\n\t\tinstancedate.add(Calendar.MINUTE, 33);\n\t\tinstancedate.add(Calendar.YEAR, 156);\n\t\tinstancedate.add(Calendar.HOUR, -6*24);\n\t\tinstancedate.add(Calendar.MONTH, -3);*/\n\t\t\n\t\t\n\t\t// Get the represented date in milliseconds\n\t\tlong milis1 = originaldate.getTimeInMillis();\n\t\tlong milis2 = instancedate.getTimeInMillis();\n\t\t\n\t\t// Calculate difference in milliseconds\n\t\tlong diff = milis2 - milis1;\n\t\t \n\t\t// Calculate difference in seconds\n\t\tlong diffSeconds = diff / 1000;\n\t\t \n\t\t// Calculate difference in minutes\n\t\t//long diffMinutes = diff / (60 * 1000);\n\t\t\n\t\t// Calculate difference in hours\n\t\t//long diffHours = diff / (60 * 60 * 1000);\n\t\t\n\t\t// Calculate difference in days\n\t\t//long diffDays = diff / (24 * 60 * 60 * 1000);\n\t\t\n\t\t//double dec = -280000 - ((double)diffSeconds / 17280.0f);\n\t\tdouble dec = ((double)diffSeconds / 17280.0f);\n\t\t\t\t\n\t\tint mantel = (int)Math.ceil(dec/10000.0f);\n\t\t\t\t\n\t\tdouble kropp = (dec + (-(mantel-1)*10000.0f));\n\t\t\n\t\tif(kropp >= 10000) mantel += 2; //Fixing rounding error\n\t\t\n\t\tdouble mantelkropp = ((mantel-1) * 10000.0f) - kropp;\n\t\t\n\t\t/*Log.v(TAG, \"Diff: \" + Long.toString(diff));\n\t\t\n\t\tLog.v(TAG, \"Diff: \" + Double.toString(dec));\n\t\t\n\t\tLog.v(TAG, \"Diff: \" + Integer.toString(mantel));\n\t\t\n\t\tLog.v(TAG, \"Diff: \" + Double.toString(kropp));\n\t\t\n\t\tLog.v(TAG, \"Diff: \" + Double.toString(mantelkropp));*/\n\t\t\n\t\tdec = mantelkropp;\n\t\t\n\t\tDecimalFormat maxDigitsFormatter;\n\t\tif(dec < 0)\n\t\t\tmaxDigitsFormatter = new DecimalFormat(\"#000000.0000\");\n\t\telse\n\t\t\tmaxDigitsFormatter = new DecimalFormat(\"0000000.0000\");\n \n try {\n\t stardate[0] = \"[\" + (maxDigitsFormatter.format(dec)).substring(0, 3) + \"]\";\n\t stardate[1] = \" 0\" + (maxDigitsFormatter.format(dec)).substring(3, 9);\n\t stardate[2] = \"\" + (maxDigitsFormatter.format(dec)).substring(9, 11);\n } catch(StringIndexOutOfBoundsException sbe) {\n \tif(DEBUG) Log.v(TAG, \"Could not format \" + sbe);\n \tif(DEBUG) Log.v(TAG, maxDigitsFormatter.format(dec));\n \tstardate[2] = \"--\"; \t \n }\n \n Log.v(TAG, \"Stardate: \" + stardate[0] + stardate[1] + stardate[2]);\n return stardate;\n\t\t\n\t}", "public static double parse_time(String s) {\n double tm = -1;\n String patternStr = \"[:]\";\n String [] fields2 = s.split(patternStr);\n if (fields2.length >= 3) {\n tm = parse_double(fields2[2]) + 60 * parse_double(fields2[1]) + 3600 * parse_double(fields2[0]); // hrs:min:sec\n } else if (fields2.length == 2) {\n tm = parse_double(fields2[1]) + 60 * parse_double(fields2[0]); // min:sec\n } else if (fields2.length == 1){\n tm = parse_double(fields2[0]); //getColumn(_sec, head[TM_CLK]);\n }\n return tm;\n }", "@Override\n public int getTimeForNextTicInSeconds() {\n int seconds = Calendar.getInstance().get(Calendar.SECOND);\n return 60 - seconds;\n }", "public static double getSecondsTime() {\n\t\treturn (TimeUtils.millis() - time) / 1000.0;\n\t}", "public int sessionTime(String player){\n \t\tif( BeardStat.loginTimes.containsKey(player)){\n \t\t\treturn Integer.parseInt(\"\"+BeardStat.loginTimes.get(player)/1000L);\n \t\t\t\n \t\t}\n \t\treturn 0;\n \t}", "public static Date getDateGMT(Date date) {\n Date dateGMT = new Date();\n if (date != null) {\n TimeZone timeZone = TimeZone.getTimeZone(\"ICT\");\n GregorianCalendar gregorianCalendar = new GregorianCalendar(timeZone);\n gregorianCalendar.setTime(date);\n gregorianCalendar.set(GregorianCalendar.HOUR, -8);\n dateGMT = gregorianCalendar.getTime();\n }\n return dateGMT;\n }", "long getCurrentTimeMs();", "public static String getDateTimeGMT(String format, String timeZone) throws Exception {\n SimpleDateFormat dateFormatGmt = new SimpleDateFormat(format);\n dateFormatGmt.setTimeZone(TimeZone.getTimeZone(timeZone));\n return dateFormatGmt.format(new Date());\n }", "public static String getTime(Long start){\n\t\tLong now =System.currentTimeMillis()/1000; \n\t\tLong date = (now - start)/(3600*24);\n\t\t//\t\tLog.e(\"TimeTypeUtil\", \"停车的天数为:\"+ date);\n\t\tLong hour = ((now-start)%86400)/3600;\n\t\tLong minute = ((now-start)%3600)/60;\n\t\tString result = \"\";\n\t\tif (date == 0) {\n\t\t\tif(hour==0)\n\t\t\t\tresult =minute+\"分钟\";\n\t\t\telse \n\t\t\t\tresult =hour+\"小时\"+minute+\"分钟\";\n\t\t}else{\n\t\t\tresult =date+\"天\"+hour+\"小时\"+minute+\"分钟\";\n\t\t}\n\t\treturn result;\n\t}", "public static long getTime() {\n\t\treturn (Sys.getTime() * 1000) / Sys.getTimerResolution();\n\t}", "@Contract(pure = true)\n\tpublic int getSecondsFromMinute() {\n\t\treturn (getSeconds() - getMinutes() * 60);\n\t}", "BigInteger getResponse_time();", "public static int totalSeconds(ZoneId zone, LocalDateTime dateTime){\n\t\treturn zone.getRules().getOffset(dateTime).getTotalSeconds();\n\t}", "private static long convertTimeToSeconds(String time) {\n\n\t\tString[] timeArray = time.split(\":\");\n\t\tint hours = Integer.parseInt(timeArray[0]);\n\t\tint minutes = Integer.parseInt(timeArray[1]);\n\t\tint seconds = Integer.parseInt(timeArray[2]);\n\n\t\treturn (hours * 3600) + (minutes * 60) + seconds;\n\t}", "private double calculateTime(final @NonNull DateTime shiftStartTime) {\n final DateTime currentDate = new DateTime();\n final Seconds seconds = Seconds.secondsBetween(shiftStartTime, currentDate);\n final double secondsDouble = seconds.getSeconds();\n return secondsDouble / 3600;\n }", "java.lang.String getTime();", "public java.sql.Time getDEPARTURE_FROM_LOC_TIME()\n {\n \n return __DEPARTURE_FROM_LOC_TIME;\n }", "public static int parseTimeForDB(Calendar c){\n return Integer.parseInt(c.get(Calendar.HOUR_OF_DAY) + \"\"\n + (c.get(Calendar.MINUTE) < 10 ? 0 + \"\" + c.get(Calendar.MINUTE) : c.get(Calendar.MINUTE)));\n }", "long getTime();", "long getTime();", "long getTime();", "long getTime();", "long getTime();", "long getTime();", "long getTime();", "long getTime();", "long getTime();", "long getTime();", "long getTime();", "long getTime();", "public int getTimeOfSession();", "java.util.Calendar getEndTime();", "@Override\r\n\tpublic int getPlayTimeSeconds() {\r\n\t\treturn this.minutes * 60 + this.seconds;\r\n\t}", "public float getSecondsElapsed() { return _startTime==0? 0 : (System.currentTimeMillis() - _startTime)/1000f; }", "UtcT time_stamp () throws BaseException;", "public static long todayStartTimeInSecond() {\n return LocalDateTime.of(LocalDate.now(), LocalTime.MIN).toEpochSecond(getStandardOffset());\n }", "public static long calculateBySecondsCompareNow(long timeday) {\n\t\tSimpleDateFormat formatter = new SimpleDateFormat(\"yyyyMMddHHmmss\");\n\t\tParsePosition pos = new ParsePosition(0);\n\t\tDate dt1 = formatter.parse(String.valueOf(timeday), pos);\n\t\tDate date = new Date();\n\t\treturn dt1.getTime() - date.getTime();\n\t\t\n\t}" ]
[ "0.64769423", "0.6401977", "0.63143307", "0.58708954", "0.58332235", "0.5777432", "0.57045084", "0.56802946", "0.56704664", "0.56666917", "0.56608194", "0.54846895", "0.547865", "0.5463407", "0.5456175", "0.5436994", "0.54154617", "0.5409956", "0.5380168", "0.5374342", "0.53184414", "0.5314864", "0.5310165", "0.5307009", "0.5298635", "0.52889204", "0.5276137", "0.52446264", "0.5239941", "0.5229488", "0.5220283", "0.5216158", "0.51782495", "0.51649743", "0.5158511", "0.5145636", "0.5138116", "0.512144", "0.5112634", "0.5112634", "0.51036036", "0.5083497", "0.5074929", "0.507173", "0.5050411", "0.50335455", "0.50284094", "0.5017205", "0.50078887", "0.4990548", "0.49818835", "0.4969632", "0.49621078", "0.49616906", "0.49560404", "0.49549347", "0.49497056", "0.4947547", "0.4944214", "0.4941198", "0.49405965", "0.49345785", "0.49344733", "0.49186534", "0.4912458", "0.49118048", "0.49112138", "0.49069706", "0.49046147", "0.4904307", "0.490124", "0.48788956", "0.487196", "0.4870969", "0.48612925", "0.48600686", "0.4859575", "0.4849026", "0.48486155", "0.48466453", "0.484154", "0.48403558", "0.48403558", "0.48403558", "0.48403558", "0.48403558", "0.48403558", "0.48403558", "0.48403558", "0.48403558", "0.48403558", "0.48403558", "0.48403558", "0.48391932", "0.48374307", "0.48348597", "0.48316103", "0.4827084", "0.48222315", "0.48212653" ]
0.67704934
0
end getGMTOffSetSeconds method to get date in YYYYMMDDhhmmss format
public String getDateTime() throws Exception { return getDateTime(null, 0, ""); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static String getYYYYMMDDHHMMSS()\r\n/* 56: */ {\r\n/* 57: 68 */ String nowTime = \"\";\r\n/* 58: 69 */ Date now = new Date();\r\n/* 59: 70 */ SimpleDateFormat formatter = new SimpleDateFormat(\"yyyyMMddHHmmss\");\r\n/* 60: 71 */ nowTime = formatter.format(now);\r\n/* 61: 72 */ return nowTime;\r\n/* 62: */ }", "public int getGMTOffSetSeconds() throws Exception {\n return getGMTOffSetSeconds(\"\");\n }", "private static String getStamp() {\n\t\t\t return new SimpleDateFormat(\"yyyyMMddHHmmss\").format(new Date());\r\n\t\t}", "EDataType getSeconds();", "int getTtiSeconds();", "private long _getUTCSeconds(long dmy, long hms)\n {\n \n /* time of day [TOD] */\n int HH = (int)((hms / 10000L) % 100L);\n int MM = (int)((hms / 100L) % 100L);\n int SS = (int)(hms % 100L);\n long TOD = (HH * 3600L) + (MM * 60L) + SS;\n \n /* current UTC day */\n long DAY;\n if (dmy > 0L) {\n int yy = (int)(dmy % 100L) + 2000;\n int mm = (int)((dmy / 100L) % 100L);\n int dd = (int)((dmy / 10000L) % 100L);\n long yr = ((long)yy * 1000L) + (long)(((mm - 3) * 1000) / 12);\n DAY = ((367L * yr + 625L) / 1000L) - (2L * (yr / 1000L))\n + (yr / 4000L) - (yr / 100000L) + (yr / 400000L)\n + (long)dd - 719469L;\n } else {\n // we don't have the day, so we need to figure out as close as we can what it should be.\n long utc = DateTime.getCurrentTimeSec();\n long tod = utc % DateTime.DaySeconds(1);\n DAY = utc / DateTime.DaySeconds(1);\n long dif = (tod >= TOD)? (tod - TOD) : (TOD - tod); // difference should be small (ie. < 1 hour)\n if (dif > DateTime.HourSeconds(12)) { // 12 to 18 hours\n // > 12 hour difference, assume we've crossed a day boundary\n if (tod > TOD) {\n // tod > TOD likely represents the next day\n DAY++;\n } else {\n // tod < TOD likely represents the previous day\n DAY--;\n }\n }\n }\n \n /* return UTC seconds */\n long sec = DateTime.DaySeconds(DAY) + TOD;\n return sec;\n \n }", "public float getTimeSeconds() { return getTime()/1000f; }", "public String convertCalendarMillisecondsAsLongToDateTimeHourMinSec(long fingerprint) {\n\t\t\t\tDateFormat format = new SimpleDateFormat(\"yyyy-MM-dd HH:mm:ss\");\n\t\t\t\tDate date = new Date(fingerprint);\n\t\t\t\treturn format.format(date);\n\t\t\t}", "long getTimeInMilliSeconds();", "public static void main(String[] args) {\n\n\t\t SimpleDateFormat sf = new SimpleDateFormat(\"yyyyMMddHHmmssSSS\");\n\t\t// for(int i=0; i<100; i++) {\n\t\t// String strDT = sf.format(new Date(System.currentTimeMillis()));\n\t\t// System.out.println(strDT);\n\t\t// }\n\n\t\t\n\t\tDate oldDate = new Date();\n\t\tCalendar gcal = new GregorianCalendar();\n\t\tgcal.setTime(oldDate);\n\t\tgcal.add(Calendar.SECOND, -4468);\n\t\tDate newDate = gcal.getTime();\n\t\tSystem.out.println(sf.format(oldDate));\n\t\tSystem.out.println(sf.format(newDate));\n\t}", "String timeStamp() {\n\n\t\tCalendar now = Calendar.getInstance();\n\n\t\t String y = String.valueOf(now.get(now.YEAR));\n\t\t String mo = String.valueOf(now.get(now.MONTH)+1);\n\t\t String d = String.valueOf(now.get(now.DAY_OF_MONTH));\n\t\t String h = String.valueOf(now.get(now.HOUR_OF_DAY));\n\t\t String m = String.valueOf(now.get(now.MINUTE));\n\t\t String s = String.valueOf(now.get(now.SECOND));\n\t\t String ms = String.valueOf(now.get(now.MILLISECOND));\n\n\n\t return h + m + s + ms;\n\n\n\n }", "long getTimeInMillis();", "private static String getTimeStamp()\r\n\t{\r\n\t\tDateFormat dateFormat = new SimpleDateFormat(\"yyyy-MM-dd_HH.mm.ss\");\r\n\t\tDate date = new Date();\r\n\t\treturn dateFormat.format(date);\r\n\t}", "public double getUserTimeSec() {\n\treturn getUserTime() / Math.pow(10, 9);\n}", "public static String getTimeStamp() {\r\n\r\n\t\tlong now = (System.currentTimeMillis() - startTime) / 1000;\r\n\r\n\t\tlong hours = (now / (60 * 60)) % 24;\r\n\t\tnow -= (hours / (60 * 60)) % 24;\r\n\r\n\t\tlong minutes = (now / 60) % 60;\r\n\t\tnow -= (minutes / 60) % 60;\r\n\r\n\t\tlong seconds = now % 60;\r\n\r\n\t return String.format(\"%02d:%02d:%02d\", hours, minutes, seconds);\r\n\t}", "String getTime(){\n\t\tCalendar c = Calendar.getInstance();\n int mseconds = c.get(Calendar.MILLISECOND);\n String currentDateandTime = mDateFormat.format(new Date()) + String.format(\"-%04d\", mseconds);\n \n return currentDateandTime;\n\t}", "long getTimeStamp();", "public void setDateAndTime(int d,int m,int y,int h,int n,int s);", "public String getTimestamp() \n{\n Calendar now = Calendar.getInstance();\n return String.format(\"20%1$ty-%1$tm-%1$td_%1$tHh%1$tMm%1$tSs\", now);\n}", "public int getGMTOffSetSeconds(String GMT) throws Exception {\n int RawOffSet = 0;\n double iTracker = 0.0;\n try {\n\n iTracker = 0.0;\n //check for null & blank GMT,, return server deafult GMT\n if (GMT == null) {\n return RawOffSet = TimeZone.getDefault().getRawOffset() / 1000;\n } //null GMT\n if (GMT.trim().equalsIgnoreCase(\"\")) {\n return RawOffSet = TimeZone.getDefault().getRawOffset() / 1000;\n } //invalid GMT value\n\n iTracker = 1.0;\n //check for validations of GMT string\n\n if (!GMT.contains(\":\")) {\n throw new Exception(\"Invalid GMT , does noit contains ':' colon ## \");\n } //invalid GMT value\n\n iTracker = 2.0;\n String[] saTemp = GMT.trim().toUpperCase().split(\":\"); //\n if (saTemp.length != 2) {\n throw new Exception(\"Invalid GMT, : slpit length is not equal to 2 ## \");\n } //invalid GMT value\n\n iTracker = 3.0;\n String HH = saTemp[0].trim();\n String MM = saTemp[1].trim();\n boolean isNegativeGMT = false;\n\n iTracker = 4.0;\n if (HH.contains(\"-\")) {\n isNegativeGMT = true;\n }\n HH = HH.replaceAll(\"-\", \"\").trim().toUpperCase();\n HH = HH.replaceAll(\"[+]\", \"\").trim().toUpperCase();\n\n iTracker = 5.0;\n int iHH = Integer.parseInt(HH);\n int iMM = Integer.parseInt(MM);\n\n if (iHH > 11) {\n throw new Exception(\"invalid GMT : HH > 11 ##\");\n }\n if (iHH < -11) {\n throw new Exception(\"invalid GMT : HH < -11 ##\");\n }\n\n if (iMM < 0) {\n throw new Exception(\"invalid GMT : MM < 0 ##\");\n }\n if (iMM > 59) {\n throw new Exception(\"invalid GMT : MM > 59 ##\");\n }\n\n iTracker = 6.0;\n RawOffSet = (iHH * 60 * 60) + (iMM * 60);\n if (isNegativeGMT) {\n RawOffSet = RawOffSet * -1;\n }\n\n iTracker = 7.0;\n return RawOffSet;\n\n } catch (Exception e) {\n println(\"getGMTOffSetSeconds : \" + e.toString() + \" : \" + GMT);\n throw new Exception(\"getGMTOffSetSeconds : \" + e.toString());\n }\n\n }", "public double getSystemTimeSec() {\n\treturn getSystemTime() / Math.pow(10, 9);\n}", "UtcT time_stamp () throws BaseException;", "long getTimestamp();", "long getTimestamp();", "long getTimestamp();", "long getTimestamp();", "long getTimestamp();", "long getTimestamp();", "long getTimestamp();", "long getTimestamp();", "long getTimestamp();", "long getTimestamp();", "long getTimestamp();", "long getTimestamp();", "long getTimestamp();", "long getTimestamp();", "long getTimestamp();", "long getTimestamp();", "long getStartTimestamp();", "private static String getDate() {\n return new SimpleDateFormat(\"yyyyMMddHHmmss\").format\n (new Date(System.currentTimeMillis()));\n }", "public final native double setUTCSeconds(int seconds) /*-{\n this.setUTCSeconds(seconds);\n return this.getTime();\n }-*/;", "long getTimestamp();", "public String getCurrentSeconds() {\n\t\t\t\t// DateFormat dateFormat = new SimpleDateFormat(\"yyyy-MM-dd HH:mm\");\n\t\t\t\t// need to change after the date format is decided\n\t\t\t\tDateFormat dateFormat = new SimpleDateFormat(\"ss\");\n\t\t\t\tDate date = new Date();\n\t\t\t\treturn dateFormat.format(date);\n\t\t\t}", "int getTimestamp();", "public final native double setSeconds(int seconds) /*-{\n this.setSeconds(seconds);\n return this.getTime();\n }-*/;", "public static long getSecondsSinceEpoch() {\n return System.currentTimeMillis() / 1000L;\n }", "private long determineTimestamp(DdfMarketBase m) {\n\n\t\tlong millis = millisCST;\n\n\t\tint type = getSymbolType(m.getSymbol());\n\n\t\tif ((type > 200) && (type < 300)) {\n\t\t\t// Equity, add 1 Hour\n\t\t\tmillis += 60 * 60 * 1000;\n\t\t}\n\n\t\tif (_type == MasterType.Delayed) {\n\t\t\tmillis -= m.getDelay() * 60 * 1000;\n\t\t}\n\n\t\treturn millis;\n\t}", "String dateToString(int year, int month, int day, int hour, int minute, double seconds);", "public int getSeconds(){\r\n return Seconds;\r\n }", "long getCreateTime();", "long getCreateTime();", "public String getYYYYMMDDhhmmssTime(Long time) {\n\t\tString result = \"\";\n\t\tSimpleDateFormat sdf = new SimpleDateFormat(\"YYYYMMDDhhmmss\");\n\t\tresult = sdf.format(new Date(time));\n\t\treturn result;\n\t}", "private void getTimestamps() {\n \t\tCalendar calendar = new GregorianCalendar(2007,Calendar.JANUARY,1);\n \t\tcalendar.set(2000 + yy, mm - 1, dd, HH, MM);\n \t\tString[] tempstr = new String[6];\n \n \t\tfor(int i = 0; i < r.length; i++) {\n \t\t\tif(calendar.get(Calendar.YEAR) < 10) {\n \t\t\t\ttempstr[0] = \"0\" + str(calendar.get(Calendar.YEAR));\n \t\t\t}\n \t\t\telse {\n \t\t\t\ttempstr[0] = str(calendar.get(Calendar.YEAR));\n \t\t\t}\n \t\t\tif(calendar.get(Calendar.MONTH) < 9) {\n \t\t\t\ttempstr[1] = \"0\" + str(calendar.get(Calendar.MONTH) + 1);\n \t\t\t}\n \t\t\telse {\n \t\t\t\ttempstr[1] = str(calendar.get(Calendar.MONTH) + 1);\n \t\t\t}\n \t\t\tif(calendar.get(Calendar.DATE) < 10) {\n \t\t\t\ttempstr[2] = \"0\" + str(calendar.get(Calendar.DATE));\n \t\t\t}\n \t\t\telse {\n \t\t\t\ttempstr[2] = str(calendar.get(Calendar.DATE));\n \t\t\t}\n \t\t\tif(calendar.get(Calendar.HOUR) < 12) {\n \t\t\t\tif(calendar.get(Calendar.AM_PM) == 1) {\n \t\t\t\t\ttempstr[3] = str(calendar.get(Calendar.HOUR) + 12);\n \t\t\t\t}\n \t\t\t\telse if(calendar.get(Calendar.HOUR) < 10) {\n \t\t\t\t\ttempstr[3] = \"0\" + str(calendar.get(Calendar.HOUR));\n \t\t\t\t}\n \t\t\t\telse {\n \t\t\t\t\ttempstr[3] = str(calendar.get(Calendar.HOUR));\n \t\t\t\t}\n \t\t\t}\n \t\t\telse {\n \t\t\t\ttempstr[3] = str(calendar.get(Calendar.HOUR));\n \t\t\t}\n \t\t\tif(calendar.get(Calendar.MINUTE) < 10) {\n \t\t\t\ttempstr[4] = \"0\" + str(calendar.get(Calendar.MINUTE));\n \t\t\t}\n \t\t\telse {\n \t\t\t\ttempstr[4] = str(calendar.get(Calendar.MINUTE));\n \t\t\t}\n \t\t\tif(calendar.get(Calendar.SECOND) < 10) {\n \t\t\t\ttempstr[5] = \"0\" + str(calendar.get(Calendar.SECOND));\n \t\t\t}\n \t\t\telse {\n \t\t\t\ttempstr[5] = str(calendar.get(Calendar.SECOND));\n \t\t\t}\n \t\t\t\n \t\t\t//LightMaskClient.appendMainText(\"\\nGettings time\");\n \t\t\t//matTime[i] = calendar.getTimeInMillis();\n \t\t\t//LightMaskClient.appendMainText(\"\\nGot time\" + matTime[i]);\n \n \t\t\t//timestamps[i] = tempstr[3] + \":\" + tempstr[4] + \":\" + tempstr[5] + \" \" + tempstr[1] + \"/\" + tempstr[2] + \"/\" + tempstr[0];\n \t\t\ttimestamps[i] = tempstr[1] + \"/\" + tempstr[2] + \"/\" + tempstr[0] + \" \" + tempstr[3] + \":\" + tempstr[4] + \":\" + tempstr[5];\n \t\t\t//LightMaskClient.appendMainText(\"\\n\" + timestamps[i]);\n \t\t\tcalendar.add(Calendar.SECOND, period);\n \t\t}\n \t}", "private String getFormattedDate(Integer format) {\n Date date = new Date(format * 1000L);\n DateFormat dateFormat = new SimpleDateFormat(\"yyyy-MM-dd HH:mm:ss.SSS\");\n dateFormat.setTimeZone(TimeZone.getTimeZone(\"Etc/UTC\"));\n Log.e(\"time\",dateFormat.format(date));\n return dateFormat.format(date);\n }", "public int getSeconds(){\n return (int) (totalSeconds%60);\n }", "static public double getSeconds(java.util.Date date){\n\treturn (double) (date.getTime()/1000L); \n }", "Date getTimeStamp();", "public String getDateTime(Calendar cal, int GMT_OFFSET_SECONDS, String DATE_TIME_FORMAT) throws Exception {\n\n String sRetVal = \"\";\n String DefaultFormat = \"yyyyMMddHHmmss\";\n int GMT_OFFSET_DIFF = 0;\n try {\n\n //check for valid Calender values\n if (cal == null) {\n cal = Calendar.getInstance();\n }\n\n //check for valid FORMAT values\n if (DATE_TIME_FORMAT == null) {\n DATE_TIME_FORMAT = DefaultFormat;\n }\n if (DATE_TIME_FORMAT.trim().toUpperCase().equalsIgnoreCase(\"\")) {\n DATE_TIME_FORMAT = DefaultFormat;\n }\n\n //check GMT RAW OFF SET difference\n int CURR_GMT_OFFSET = TimeZone.getDefault().getRawOffset() / 1000;\n //in case Current GMT is GREATER THAN provided GMT\n if (CURR_GMT_OFFSET > GMT_OFFSET_SECONDS && GMT_OFFSET_SECONDS != 0) {\n if (GMT_OFFSET_SECONDS < 0) {\n GMT_OFFSET_DIFF = GMT_OFFSET_SECONDS - CURR_GMT_OFFSET;\n } else {\n GMT_OFFSET_DIFF = GMT_OFFSET_SECONDS - CURR_GMT_OFFSET;\n }\n\n //in case Current GMT is SMALLER THAN provided GMT\n } else if (CURR_GMT_OFFSET < GMT_OFFSET_SECONDS && GMT_OFFSET_SECONDS != 0) {\n if (GMT_OFFSET_SECONDS < 0) {\n GMT_OFFSET_DIFF = GMT_OFFSET_SECONDS - CURR_GMT_OFFSET;\n } else {\n GMT_OFFSET_DIFF = GMT_OFFSET_SECONDS - CURR_GMT_OFFSET;\n }\n }\n\n if (CURR_GMT_OFFSET == GMT_OFFSET_SECONDS) {\n GMT_OFFSET_DIFF = 0;\n }\n\n //setting calender datetime as per GMT\n cal.add(Calendar.SECOND, GMT_OFFSET_DIFF);\n\n //using SimpleDateFormat class\n sRetVal = new SimpleDateFormat(DATE_TIME_FORMAT).format(cal.getTime());\n return sRetVal;\n\n } catch (Exception e) {\n println(\"getDateTime : \" + GMT_OFFSET_SECONDS + \" : \" + e.toString());\n throw new Exception(\"getDateTime : \" + GMT_OFFSET_SECONDS + \" : \" + e.toString());\n } finally {\n }\n\n }", "@Override\n\tpublic String getTimestamp()\n\t{\n\t\treturn new SimpleDateFormat(\"yyyy/MM/dd HH:mm:ss.SSS\").format(new Date());\n\t}", "public int getSeconds()\n {\n return seconds;\n }", "public ImagingStudy setDateTimeWithSecondsPrecision( Date theDate) {\n\t\tmyDateTime = new DateTimeDt(theDate); \n\t\treturn this; \n\t}", "public static String formatTime(int seconds){\n\t\tTimeZone tz = TimeZone.getTimeZone(\"UTC\");\n\t SimpleDateFormat df = new SimpleDateFormat(\"HH:mm:ss\");\n\t df.setTimeZone(tz);\n\t return df.format(new Date((long)(seconds * 1000)));\n\t}", "public static void main(String[] args) {\n System.out.println(new Date().getTime());\n\n // 2016-12-16 11:48:08\n Calendar calendar = Calendar.getInstance();\n calendar.set(2016, 11, 16, 12, 0, 1);\n System.out.println(calendar.getTime());\n Date date=new Date();\n SimpleDateFormat simpleDateFormat=new SimpleDateFormat(\"yyyy-MM-dd HH:mm:ss\");\n System.out.println(simpleDateFormat.format(date));\n\n\n }", "@java.lang.Override\n public int getTtiSeconds() {\n return ttiSeconds_;\n }", "long getTime();", "long getTime();", "long getTime();", "long getTime();", "long getTime();", "long getTime();", "long getTime();", "long getTime();", "long getTime();", "long getTime();", "long getTime();", "long getTime();", "String getTimestamp();", "String getTimestamp();", "public int getSecond() {\n return dateTime.getSecond();\n }", "static public java.util.Date getDate(double seconds){\n\treturn new java.util.Date(1000L * ((long)(seconds))); \n }", "int getCreateTime();", "public long getTimestampMillisecUTC();", "public static long dateToTime(String s) {\n\t\tSimpleDateFormat simpledateformat = new SimpleDateFormat(\"yyyyMMddHHmmss\");\n\t\tlong l;\n\t\ttry {\n\t\t\tl = simpledateformat.parse(s).getTime();\n\t\t} catch (ParseException e) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\te.printStackTrace();\n\t\t\tl = System.currentTimeMillis();\n\t\t}\n\n\t\treturn l;\n\n\t}", "public double getTimeYgFullGcs() {\n return timeYgFullGcs;\n }", "public Date getSOHTimestamp() {\r\n/* 265 */ return this._SOHTimestamp;\r\n/* */ }", "public final native double setUTCSeconds(int seconds, int millis) /*-{\n this.setUTCSeconds(seconds, millis);\n return this.getTime();\n }-*/;", "private static Timestamp getCurrentTimeInSeconds() {\n\t\tLong mseconds = System.currentTimeMillis();\n\t\tmseconds = mseconds - mseconds % 1000;\n\t\treturn new Timestamp(mseconds);\n\t}", "private static String hhhmmss(double totalseconds)\n {\n final int SECONDS_PER_MINUTE = 60;\n final int SECONDS_PER_HOUR = SECONDS_PER_MINUTE * 60;\n\n int hours = (int) (totalseconds / SECONDS_PER_HOUR);\n int minutes = (int) ((totalseconds % SECONDS_PER_HOUR)) / SECONDS_PER_MINUTE;\n double seconds = totalseconds % SECONDS_PER_MINUTE;\n\n return String.format(\"%d:%02d:%05.2f\", hours, minutes, seconds);\n }", "private static String hhhmmss(double totalseconds)\n {\n final int SECONDS_PER_MINUTE = 60;\n final int SECONDS_PER_HOUR = SECONDS_PER_MINUTE * 60;\n\n int hours = (int) (totalseconds / SECONDS_PER_HOUR);\n int minutes = (int) ((totalseconds % SECONDS_PER_HOUR)) / SECONDS_PER_MINUTE;\n double seconds = totalseconds % SECONDS_PER_MINUTE;\n\n return String.format(\"%d:%02d:%05.2f\", hours, minutes, seconds);\n }", "public static String Milisec2DDMMYYYY(long ts) {\n\t\tif (ts == 0) {\n\t\t\treturn \"\";\n\t\t} else {\n\t\t\tjava.util.Calendar calendar = java.util.Calendar.getInstance();\n\t\t\tcalendar.setTime(new java.util.Date(ts));\n\n\t\t\tString strTemp = Integer.toString(calendar\n\t\t\t\t\t.get(calendar.DAY_OF_MONTH));\n\t\t\tif (calendar.get(calendar.DAY_OF_MONTH) < 10) {\n\t\t\t\tstrTemp = \"0\" + strTemp;\n\t\t\t}\n\t\t\tif (calendar.get(calendar.MONTH) + 1 < 10) {\n\t\t\t\treturn strTemp + \"/0\" + (calendar.get(calendar.MONTH) + 1)\n\t\t\t\t\t\t+ \"/\" + calendar.get(calendar.YEAR);\n\t\t\t} else {\n\t\t\t\treturn strTemp + \"/\" + (calendar.get(calendar.MONTH) + 1) + \"/\"\n\t\t\t\t\t\t+ calendar.get(calendar.YEAR);\n\t\t\t}\n\t\t}\n\t}", "long getCurrentTimeMs();", "public static void main(String[] args) {\r\n\t\tDate now = new Date();\r\n\t\tSimpleDateFormat sdf = \r\n\t\tnew SimpleDateFormat(\"yyyy-MM-dd HH:mm:ss\");\r\n\tString str = sdf.format(now);\r\n\tSystem.out.println(str);\r\n\tlong time = now.getTime();\r\n\ttime += 48954644;\r\n\tnow.setTime(time);\r\n\tSystem.out.println(sdf.format(now));\r\n\tDate dat = null;\r\n\ttry {\r\n\t\tdat = sdf.parse(str);\r\n\t} catch (ParseException e) {\r\n\t\t// TODO Auto-generated catch block\r\n\t\te.printStackTrace();\r\n\t}\r\n\tSystem.out.println(dat);\r\n\t\r\n\r\n}", "public final native int getUTCSeconds() /*-{\n return this.getUTCSeconds();\n }-*/;", "long getDateTime();", "public Series setDateTimeWithSecondsPrecision( Date theDate) {\n\t\tmyDateTime = new DateTimeDt(theDate); \n\t\treturn this; \n\t}", "protected String toXSTime() {\n\t\treturn String.format(\"%s,%s,%s,%s\",\"{0:00}:{1:00}:{2:00}\",\n\t\t\t\tthis.getHours(), this\n\t\t\t\t.getMinutes(), this.getSeconds());\n\t}", "java.lang.String getTime();", "public double getSecs( );", "@java.lang.Override\n public int getTtiSeconds() {\n return ttiSeconds_;\n }", "public void setTs(long value) {\n this.ts = value;\n }", "void get_timestamp (int reversed)\n{\n BytePtr str = new BytePtr(20);\n int i;\n\n if (timestamp != 0) return;\n str.at(19, (byte)0);\n if (reversed != 0)\n for (i=19; i-- != 0; ) str.at(i, (byte)CTOJ.fgetc(ifp));\n else\n CTOJ.fread (str, 19, 1, ifp);\n\n int year = ( str.at(0) - '0')*1000 + (str.at(1) - '0')*100 + (str.at(2) - '0' )*10 + str.at(3) - '0';\n int mon = (str.at(5) - '0')*10 + str.at(6)-'0';\n int day = (str.at(8) - '0')*10 + str.at(9)-'0';\n int hour = (str.at(11) - '0')*10 + str.at(12)-'0';\n int min = (str.at(14) - '0')*10 + str.at(15)-'0';\n int sec = (str.at(17) - '0')*10 + str.at(18)-'0';\n \n Calendar cal = new GregorianCalendar();\n cal.set(year,mon-1,day,hour,min,sec);\n timestamp = cal.getTimeInMillis();\n}" ]
[ "0.6478995", "0.6288667", "0.60737693", "0.587249", "0.58722466", "0.5862005", "0.58078223", "0.57988113", "0.57947344", "0.5755224", "0.57315856", "0.5656006", "0.56427175", "0.5636676", "0.5633332", "0.56275564", "0.5603452", "0.55977744", "0.5579716", "0.55752325", "0.55721384", "0.5557025", "0.5529082", "0.5529082", "0.5529082", "0.5529082", "0.5529082", "0.5529082", "0.5529082", "0.5529082", "0.5529082", "0.5529082", "0.5529082", "0.5529082", "0.5529082", "0.5529082", "0.5529082", "0.5529082", "0.55240166", "0.55089355", "0.55061316", "0.55048156", "0.5497292", "0.54894906", "0.54837346", "0.5477766", "0.5472665", "0.54695773", "0.5452756", "0.5450075", "0.5450075", "0.5446736", "0.5442362", "0.54372245", "0.5432178", "0.5429778", "0.5426852", "0.54221267", "0.5404641", "0.54032415", "0.5396473", "0.53751206", "0.5372912", "0.536748", "0.5360106", "0.5360106", "0.5360106", "0.5360106", "0.5360106", "0.5360106", "0.5360106", "0.5360106", "0.5360106", "0.5360106", "0.5360106", "0.5360106", "0.53503686", "0.53503686", "0.5349583", "0.5345934", "0.53429496", "0.53414875", "0.53357804", "0.5335719", "0.5334469", "0.53328747", "0.53326154", "0.5323204", "0.5323204", "0.53183305", "0.53167295", "0.53094745", "0.5308077", "0.5307789", "0.5305888", "0.53044313", "0.53041595", "0.53031766", "0.5291375", "0.5289954", "0.5289932" ]
0.0
-1
methoid to get date time in particular format wrt GMT, default is yyyyMMddHHmmss
public String getDateTime(String DATE_TIME_FORMAT) throws Exception { return getDateTime(null, null, DATE_TIME_FORMAT); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static String getGMTTime() {\r\n\t\treturn getGMTTime(\"HH:mm:ss\");\r\n\t}", "public String getDateTime(Calendar cal, int GMT_OFFSET_SECONDS, String DATE_TIME_FORMAT) throws Exception {\n\n String sRetVal = \"\";\n String DefaultFormat = \"yyyyMMddHHmmss\";\n int GMT_OFFSET_DIFF = 0;\n try {\n\n //check for valid Calender values\n if (cal == null) {\n cal = Calendar.getInstance();\n }\n\n //check for valid FORMAT values\n if (DATE_TIME_FORMAT == null) {\n DATE_TIME_FORMAT = DefaultFormat;\n }\n if (DATE_TIME_FORMAT.trim().toUpperCase().equalsIgnoreCase(\"\")) {\n DATE_TIME_FORMAT = DefaultFormat;\n }\n\n //check GMT RAW OFF SET difference\n int CURR_GMT_OFFSET = TimeZone.getDefault().getRawOffset() / 1000;\n //in case Current GMT is GREATER THAN provided GMT\n if (CURR_GMT_OFFSET > GMT_OFFSET_SECONDS && GMT_OFFSET_SECONDS != 0) {\n if (GMT_OFFSET_SECONDS < 0) {\n GMT_OFFSET_DIFF = GMT_OFFSET_SECONDS - CURR_GMT_OFFSET;\n } else {\n GMT_OFFSET_DIFF = GMT_OFFSET_SECONDS - CURR_GMT_OFFSET;\n }\n\n //in case Current GMT is SMALLER THAN provided GMT\n } else if (CURR_GMT_OFFSET < GMT_OFFSET_SECONDS && GMT_OFFSET_SECONDS != 0) {\n if (GMT_OFFSET_SECONDS < 0) {\n GMT_OFFSET_DIFF = GMT_OFFSET_SECONDS - CURR_GMT_OFFSET;\n } else {\n GMT_OFFSET_DIFF = GMT_OFFSET_SECONDS - CURR_GMT_OFFSET;\n }\n }\n\n if (CURR_GMT_OFFSET == GMT_OFFSET_SECONDS) {\n GMT_OFFSET_DIFF = 0;\n }\n\n //setting calender datetime as per GMT\n cal.add(Calendar.SECOND, GMT_OFFSET_DIFF);\n\n //using SimpleDateFormat class\n sRetVal = new SimpleDateFormat(DATE_TIME_FORMAT).format(cal.getTime());\n return sRetVal;\n\n } catch (Exception e) {\n println(\"getDateTime : \" + GMT_OFFSET_SECONDS + \" : \" + e.toString());\n throw new Exception(\"getDateTime : \" + GMT_OFFSET_SECONDS + \" : \" + e.toString());\n } finally {\n }\n\n }", "public static String getGMTTime(String format) {\r\n\t\tfinal Date currentTime = new Date();\r\n\r\n\t\tfinal SimpleDateFormat sdf = new SimpleDateFormat(format);\r\n\r\n\t\tsdf.setTimeZone(TimeZone.getTimeZone(\"GMT\"));\r\n\t\treturn sdf.format(currentTime);\r\n\t}", "public static String getDateTime() {\n Calendar cal = Calendar.getInstance(TimeZone.getTimeZone(\"UTC\"));\n Date currentLocalTime = cal.getTime();\n SimpleDateFormat df = new SimpleDateFormat(\"yyyy-MM-dd HH:mm:ss.SSS\");\n df.setTimeZone(TimeZone.getTimeZone(\"UTC\"));\n String date = df.format(currentLocalTime);\n return date;\n }", "private static Date getTime(String argGMT) {\r\n\t\tSimpleDateFormat dateFormatGmt = new SimpleDateFormat(\r\n\t\t\t\t\"yyyy-MMM-dd HH:mm:ss\");\r\n\t\tdateFormatGmt.setTimeZone(TimeZone.getTimeZone(argGMT));\r\n\r\n\t\t// Local time zone\r\n\t\tSimpleDateFormat dateFormatLocal = new SimpleDateFormat(\r\n\t\t\t\t\"yyyy-MMM-dd HH:mm:ss\");\r\n\r\n\t\t// Time in GMT\r\n\t\ttry {\r\n\t\t\treturn dateFormatLocal.parse(dateFormatGmt.format(new Date()));\r\n\t\t} catch (ParseException e) {\r\n\t\t\te.printStackTrace();\r\n\t\t}\r\n\t\treturn null;\r\n\t}", "public static String getYYYYMMDDHHMMSS()\r\n/* 56: */ {\r\n/* 57: 68 */ String nowTime = \"\";\r\n/* 58: 69 */ Date now = new Date();\r\n/* 59: 70 */ SimpleDateFormat formatter = new SimpleDateFormat(\"yyyyMMddHHmmss\");\r\n/* 60: 71 */ nowTime = formatter.format(now);\r\n/* 61: 72 */ return nowTime;\r\n/* 62: */ }", "public LocalDateTime convertToGMT(ZonedDateTime time){\n ZoneId gmtZoneID = ZoneId.of(\"Etc/UTC\");\n ZonedDateTime gmtTime = time.withZoneSameInstant(gmtZoneID);\n return gmtTime.toLocalDateTime();\n }", "public String getTime() {\n String pattern = \"yyyy-MM-dd HH:mm:ss\";\n SimpleDateFormat simpleDateFormat = new SimpleDateFormat(pattern);\n\n String date = simpleDateFormat.format(new Date());\n return date;\n }", "public static String ShowTimeinGMT(Calendar cal) {\n\t\tCalendar calendar = cal;\n\t\tStringBuilder _ret = new StringBuilder();\n\n\t\tif (cal == null) {\n\t\t\tcalendar = Calendar.getInstance(TimeZone.getTimeZone(\"GMT\"));\n\t\t}\n\n\t\t_ret.append(calendar.get(Calendar.DATE) + \"-\" + (calendar.get(Calendar.MONTH) + 1) + \"-\"\n\t\t\t\t+ calendar.get(Calendar.YEAR) + \" T \" + calendar.get(Calendar.HOUR_OF_DAY) + \":\"\n\t\t\t\t+ calendar.get(Calendar.MINUTE) + \":\" + calendar.get(Calendar.SECOND));\n\t\treturn _ret.toString();\n\t}", "private static String getDate() {\n return new SimpleDateFormat(\"yyyyMMddHHmmss\").format\n (new Date(System.currentTimeMillis()));\n }", "String getTime(){\n\t\tCalendar c = Calendar.getInstance();\n int mseconds = c.get(Calendar.MILLISECOND);\n String currentDateandTime = mDateFormat.format(new Date()) + String.format(\"-%04d\", mseconds);\n \n return currentDateandTime;\n\t}", "public String getDateTime(Calendar calendar, String GMT, String DATE_TIME_FORMAT) throws Exception {\n int GMT_OFFSET_SECONDS = 0;\n try {\n GMT_OFFSET_SECONDS = getGMTOffSetSeconds(GMT);\n return getDateTime(calendar, GMT_OFFSET_SECONDS, DATE_TIME_FORMAT);\n } catch (Exception e) {\n throw new Exception(\"getDateTime : Invalid GMT :\" + GMT + \" : \" + e.toString());\n }\n }", "public String getGMTString() {\n\t\treturn \"test GMT timezone\";\n\t}", "public static String getTimeString() {\n SimpleDateFormat formatter = new SimpleDateFormat(\"EEE MMM dd HH:mm:ss yyyy\");\n return formatter.format(new java.util.Date());\n }", "public static String getDateTime() {\n\t\tString sDateTime=\"\";\n\t\ttry {\n\t\t\tSimpleDateFormat sdfDate = new SimpleDateFormat(\"dd-MM-yyyy\");\n\t\t\tSimpleDateFormat sdfTime = new SimpleDateFormat(\"HH:mm:ss\");\n\t\t\tDate now = new Date();\n\t\t\tString strDate = sdfDate.format(now);\n\t\t\tString strTime = sdfTime.format(now);\n\t\t\tstrTime = strTime.replace(\":\", \"-\");\n\t\t\tsDateTime = \"D\" + strDate + \"_T\" + strTime;\n\t\t} catch (Exception e) {\n\t\t\tSystem.err.println(e);\n\t\t}\n\t\treturn sDateTime;\n\t}", "public String getSystemDateTime() {\n\t\tjava.text.SimpleDateFormat sdfDate = new java.text.SimpleDateFormat(\"yyyy/MM/dd\");\n java.text.SimpleDateFormat sdfTime = new java.text.SimpleDateFormat(\"HH:mm\");\n Date now = new Date();\n String strDate = sdfDate.format(now);\n String strTime = sdfTime.format(now);\n System.out.println(\"Date: \" + strDate);\n System.out.println(\"Time: \" + strTime); \n return \"date\"+strDate+\" \"+strTime;\n\t}", "java.lang.String getTime();", "public static String getSystemDate()\n {\n\t DateFormat dateFormat= new SimpleDateFormat(\"_ddMMyyyy_HHmmss\");\n\t Date date = new Date();\n\t return dateFormat.format(date);\n }", "private String getDate()\r\n\t{\r\n\t\tCalendar cal = Calendar.getInstance();\r\n\t\tSimpleDateFormat sdf = new SimpleDateFormat(\"yyyy-MM-dd HH:mm\");\r\n\t\treturn sdf.format(cal.getTime());\r\n\t}", "public String getDateTime(Calendar calendar, String GMT) throws Exception {\n return getDateTime(calendar, GMT, \"\");\n }", "private String getFormattedDate(Integer format) {\n Date date = new Date(format * 1000L);\n DateFormat dateFormat = new SimpleDateFormat(\"yyyy-MM-dd HH:mm:ss.SSS\");\n dateFormat.setTimeZone(TimeZone.getTimeZone(\"Etc/UTC\"));\n Log.e(\"time\",dateFormat.format(date));\n return dateFormat.format(date);\n }", "public String getSystemTime() {\n\t\tSimpleDateFormat dateTimeInGMT = new SimpleDateFormat(\"dd-MMM-yyyy hh\");\n\t\t// Setting the time zoneS\n\t\tdateTimeInGMT.setTimeZone(TimeZone.getTimeZone(\"America/New_York\"));\n\t\tString timeZone = dateTimeInGMT.format(new Date());\n\t\treturn timeZone;\n\n\t}", "private String getDateTime() {\n SimpleDateFormat sdf = new SimpleDateFormat(\"[yyyy/MM/dd - HH:mm:ss]\");\n return sdf.format(new Date());\n }", "private String getDateTime() {\n SimpleDateFormat sdf = new SimpleDateFormat(\"[yyyy/MM/dd - HH:mm:ss]\");\n return sdf.format(new Date());\n }", "private String getDateTime() {\n SimpleDateFormat sdf = new SimpleDateFormat(\"[yyyy/MM/dd - HH:mm:ss]\");\n return sdf.format(new Date());\n }", "public static Date getDateNowSingl(){\n\t\tconfigDefaultsTimeZoneAndLocale();\r\n\t\t\r\n\t\t// o time millis é sempre GMT 0, a transformação fica por conta do Date\r\n\t\treturn new Date(System.currentTimeMillis()+getPropDefaultForAll(TIME_CORRECTION));\r\n\t}", "private static String getDate()\n\t{\n\t\tString dateString = null;\n\t\tDate sysDate = new Date( System.currentTimeMillis() );\n\t\tSimpleDateFormat sdf = new SimpleDateFormat(\"dd-MM-yy HH:mm:ss\");\n\t\tdateString = sdf.format(sysDate);\n\t\treturn dateString;\n\t}", "private static String timeFor(Date date)\n\t{\n\t\tDateFormat df = new InternetDateFormat();\n\t\tString theTime = df.format(date);\n\t\treturn theTime;\n\t}", "public static Date getDateGMT(Date date) {\n Date dateGMT = new Date();\n if (date != null) {\n TimeZone timeZone = TimeZone.getTimeZone(\"ICT\");\n GregorianCalendar gregorianCalendar = new GregorianCalendar(timeZone);\n gregorianCalendar.setTime(date);\n gregorianCalendar.set(GregorianCalendar.HOUR, -8);\n dateGMT = gregorianCalendar.getTime();\n }\n return dateGMT;\n }", "DateTime getTime();", "public static String getDate()\r\n {\r\n Date now = new Date();\r\n DateFormat df = new SimpleDateFormat (\"yyyy-MM-dd'T'hh-mm-ss\");\r\n String currentTime = df.format(now);\r\n return currentTime; \r\n \r\n }", "public String getTimeString() {\n int hour = date.get(Calendar.HOUR);\n int minute = date.get(Calendar.MINUTE);\n\n String AM_PM = \"PM\";\n if (date.get(Calendar.AM_PM) == Calendar.AM) AM_PM = \"AM\";\n\n String hour_fixed = String.valueOf(hour);\n if (hour == 0) hour_fixed = \"12\";\n\n String minute_fixed = String.valueOf(minute);\n while (minute_fixed.length() < 2) {\n minute_fixed = \"0\" + minute_fixed;\n }\n\n return hour_fixed + \":\" + minute_fixed + ' ' + AM_PM;\n }", "OffsetDateTime creationTime();", "public static String getNowAsTimestamp() {\r\n\r\n DateFormat dateFormat = new SimpleDateFormat(DATE_FORMAT_PATTERN);\r\n dateFormat.setTimeZone(TimeZone.getTimeZone(\"UTC\"));\r\n return dateFormat.format(new Date()).replaceAll(\"\\\\+0000\", \"Z\").replaceAll(\"([+-][0-9]{2}):([0-9]{2})\", \"$1$2\");\r\n }", "private String getFecha() {\n\t\tLocalDateTime myDateObj = LocalDateTime.now();\n\t\tDateTimeFormatter myFormatObj = DateTimeFormatter.ofPattern(\"dd-MM-yyyy HH:mm:ss\");\n\t\tString formattedDate = myDateObj.format(myFormatObj);\n \n\t\treturn formattedDate;\n }", "public static String getDateString(){\n\t\t\tCalendar now = Calendar.getInstance();\n\t\t\tSimpleDateFormat sdf = new SimpleDateFormat(\"yyyy-MM-dd__HH-mm-ss\");\n\t\t\treturn sdf.format(now.getTime());\n\t }", "String getCreated_at();", "String timeStamp() {\n\n\t\tCalendar now = Calendar.getInstance();\n\n\t\t String y = String.valueOf(now.get(now.YEAR));\n\t\t String mo = String.valueOf(now.get(now.MONTH)+1);\n\t\t String d = String.valueOf(now.get(now.DAY_OF_MONTH));\n\t\t String h = String.valueOf(now.get(now.HOUR_OF_DAY));\n\t\t String m = String.valueOf(now.get(now.MINUTE));\n\t\t String s = String.valueOf(now.get(now.SECOND));\n\t\t String ms = String.valueOf(now.get(now.MILLISECOND));\n\n\n\t return h + m + s + ms;\n\n\n\n }", "public String getTimeAndDate() {\n\t\t\tDateFormat dateFormat = new SimpleDateFormat(\"dd MMM hh:mm\");\n\t\t\tCalendar cal = Calendar.getInstance();\n\t\t\tString dateAndTime = dateFormat.format(cal.getTime());\n\t\t\treturn dateAndTime;\n\t\t}", "private String getDateTime() {\n DateFormat dateFormat = new SimpleDateFormat(\"MM/dd/yyyy HH:mm\");\n Date date = new Date();\n return dateFormat.format(date);\n }", "public static String getDateTimeGMT(String format, String timeZone) throws Exception {\n SimpleDateFormat dateFormatGmt = new SimpleDateFormat(format);\n dateFormatGmt.setTimeZone(TimeZone.getTimeZone(timeZone));\n return dateFormatGmt.format(new Date());\n }", "OffsetDateTime timeCreated();", "java.lang.String getToDate();", "private static String getStamp() {\n\t\t\t return new SimpleDateFormat(\"yyyyMMddHHmmss\").format(new Date());\r\n\t\t}", "@Deprecated\n public static String getGMTToLocalTime(String argDateTime, String argInFormat, String argOutFormat) {\n DateFormat dateFormat = new SimpleDateFormat(argInFormat, Locale.getDefault());\n SimpleDateFormat simpleDateFormat = new SimpleDateFormat(argOutFormat);\n //simpleDateFormat.setTimeZone(TimeZone.getTimeZone(Locale));\n //simpleDateFormat.setTimeZone(TimeZone.getDefault());\n dateFormat.setTimeZone(TimeZone.getTimeZone(\"GMT\"));\n simpleDateFormat.setTimeZone(TimeZone.getDefault());\n //System.out.println(\"-----+ \" + TimeZone.getDefault());\n try {\n Date date = dateFormat.parse(argDateTime);\n return simpleDateFormat.format(date);\n } catch (ParseException ex) {\n //ex.printStackTrace();\n return null;\n }\n //https://medium.com/@kosta.palash/converting-date-time-considering-time-zone-android-b389ff9d5c49\n //https://www.tutorialspoint.com/java/util/calendar_settimezone.htm\n //writeDate.setTimeZone(TimeZone.getTimeZone(\"GMT+04:00\"));\n //https://vectr.com/tmp/a1hCr4Gvwc/aaegiGLyoI\n //http://inloop.github.io/svg2android/\n }", "public Date getDate() {\n Calendar calendar = Calendar.getInstance(TimeZone.getTimeZone(\"GMT\"));\n calendar.set(Calendar.YEAR, year);\n calendar.set(Calendar.MONTH, month - 1); // MONTH is zero based\n calendar.set(Calendar.DAY_OF_MONTH, day);\n calendar.set(Calendar.HOUR_OF_DAY, hour);\n calendar.set(Calendar.MINUTE, minute);\n calendar.set(Calendar.SECOND, 0);\n calendar.set(Calendar.MILLISECOND, 0);\n return calendar.getTime();\n }", "public String getTime() {\n boolean pastNoon = hour >= 12;\n if(pastNoon && hour == 12) {\n return hour + \"pm\";\n }\n else if(pastNoon) {\n return (hour - 12) + \"pm\";\n }\n else if(hour == 0) {\n return \"12am\";\n }\n else {\n return hour + \"am\";\n }\n }", "public Date getDateNow(){\n\t\tconfigDefaults(getProp(LOCALE), getProp(TIME_ZONE), null);\r\n\t\t\r\n\t\t// o time millis é sempre GMT 0, a transformação fica por conta do Date\r\n\t\treturn new Date(System.currentTimeMillis()+getProp(TIME_CORRECTION));\r\n\t}", "private Date cvtToGmt( Date date )\r\n\t\t{\r\n\t\t TimeZone tz = TimeZone.getDefault();\r\n\t\t Date ret = new Date( date.getTime() - tz.getRawOffset() );\r\n\r\n\t\t // if we are now in DST, back off by the delta. Note that we are checking the GMT date, this is the KEY.\r\n\t\t if ( tz.inDaylightTime( ret ))\r\n\t\t {\r\n\t\t Date dstDate = new Date( ret.getTime() - tz.getDSTSavings() );\r\n\r\n\t\t // check to make sure we have not crossed back into standard time\r\n\t\t // this happens when we are on the cusp of DST (7pm the day before the change for PDT)\r\n\t\t if ( tz.inDaylightTime( dstDate ))\r\n\t\t {\r\n\t\t ret = dstDate;\r\n\t\t }\r\n\t\t }\r\n\r\n\t\t return ret;\r\n\t\t}", "public static String displayTimeDate(Calendar cal)\n\t{\n\t\tString out = \"\";\n\t\tint year = cal.get(Calendar.YEAR);\n\t\tint month = cal.get(Calendar.MONTH) + 1;\n\t\tint day = cal.get(Calendar.DAY_OF_MONTH);\n\t\tint hour = cal.get(Calendar.HOUR_OF_DAY);\n\t\tint minute = cal.get(Calendar.MINUTE);\n\t\tint second = cal.get(Calendar.SECOND);\n\t\tint zone = cal.get(Calendar.ZONE_OFFSET) / (60 * 60 * 1000) * 4;\n\t\t\n\t\tString year_str = String.valueOf(year);\n\t\tString month_str = String.valueOf(month);\n\t\tString day_str = String.valueOf(day);\n\t\tString hour_str = String.valueOf(hour);\n\t\tString minute_str = String.valueOf(minute);\n\t\tString second_str = String.valueOf(second);\n\t\tString zone_str = String.valueOf(zone);\n\t\t\n\t\tif (year_str.length() < 2) year_str = \"0\" + year_str;\n\t\tif (month_str.length() < 2) month_str = \"0\" + month_str;\n\t\tif (day_str.length() < 2) day_str = \"0\" + day_str;\n\t\tif (hour_str.length() < 2) hour_str = \"0\" + hour_str;\n\t\tif (minute_str.length() < 2) minute_str = \"0\" + minute_str;\n\t\tif (second_str.length() < 2) second_str = \"0\" + second_str;\n\t\t\n\t\tout = hour_str + \":\" + minute_str + \":\" + second_str + \" \";\n\t\tout = out + day_str + \"-\" + month_str + \"-\" + year_str; //+\" GMT\"+zone_str ;\n\t\treturn out;\n\t}", "private String getDate() {\n\t\tSimpleDateFormat parseFormat = new SimpleDateFormat(\"hh:mm a\");\n\t\tDate date = new Date();\n\t\tString s = parseFormat.format(date);\n\t\treturn s;\n\t}", "public static String epochToTimeGMT(long epoch)\n\t{\n\t\tSimpleDateFormat dateFormatGmt = new SimpleDateFormat(\"HHmm\");\n\t\tdateFormatGmt.setTimeZone(TimeZone.getTimeZone(\"GMT\"));\n\t\treturn dateFormatGmt.format(epoch);\n\t}", "UtcT time_stamp () throws BaseException;", "public String getTime(){\r\n\t\tDate date = new GregorianCalendar().getTime();\r\n\r\n\t\tString time= new SimpleDateFormat(\"HH:mm:ss\").format(date.getTime());\r\n\t\t\r\n\t\treturn time;\r\n\t}", "public String getUTCTime(String timeZone, Calendar cal);", "protected final static String getDateStamp() {\n\n\t\treturn\n\n\t\tnew SimpleDateFormat(\"MMM d, yyyy h:mm:ss a zzz\").format(new Date());\n\n\t}", "public Date getGmtCreated() {\n return gmtCreated;\n }", "public static Date getLocalUTCTime(){\r\n\t\tfinal Calendar cal=Calendar.getInstance();\r\n\t\tfinal int zoneOffset=cal.get(Calendar.ZONE_OFFSET);\r\n\t\tfinal int dstOffset=cal.get(Calendar.DST_OFFSET);\r\n\t\tcal.add(Calendar.MILLISECOND, -(zoneOffset+dstOffset));\r\n\t\treturn cal.getTime();\r\n\t}", "public static String getUTCDate(){\n \t SimpleDateFormat sdf = new SimpleDateFormat(\"MM-dd-yyyy hh:mm\");\n \t Calendar cal = Calendar.getInstance(TimeZone.getTimeZone(\"UTC\"));\n \t return sdf.format(cal.getTime());\n }", "public static String getNowTime(){\r\n\t\tDate date = new Date();\r\n\t\tDateFormat format = new SimpleDateFormat(\"yyyy-MM-dd HH:mm:ss\");\r\n\t\tString time = format.format(date);\r\n\t\treturn time;\r\n\t}", "private static String getTime() {\n\t\tDate getDate = new Date();\n\t\tString timeFormat = \"M/d/yy hh:mma\";\n\t\tSimpleDateFormat sdf = new SimpleDateFormat(timeFormat);\n\t\treturn \"[\" + sdf.format(getDate) + \"]\\t\";\n\t}", "java.lang.String getServerTime();", "public String getTimestamp() \n{\n Calendar now = Calendar.getInstance();\n return String.format(\"20%1$ty-%1$tm-%1$td_%1$tHh%1$tMm%1$tSs\", now);\n}", "public static String getTime() {\r\n\r\n\t\t//Gets current date and time\r\n\t\tDateFormat dateFormat = new SimpleDateFormat(\"yyyy-MM-dd HH:mm:ss\");\r\n\t\tDate date = new Date();\r\n\t\tcurrDateTime = dateFormat.format(date);\r\n\t\treturn currDateTime;\r\n\t}", "private String formatTimeToICS(LocalDateTime date) {\n return DateTimeFormatter.ofPattern(\"YYYYMMddTHHmmss\").format(date);\n }", "public static long getCurrentGMTTime() {\n\n\t\tTimeZone timezone = TimeZone.getTimeZone(STANDARD_TIME_ZONE);\n\t\tlong currentTime = System.currentTimeMillis();\n\t\treturn currentTime - timezone.getOffset(currentTime);\n\t}", "public String getAnserTime() {\r\n \tString time=null;\r\n\t\tif(anserTime!=null){\r\n\t\t\tSimpleDateFormat sf=new SimpleDateFormat(\"yyyy-MM-dd HH:mm:ss\");\r\n\t\t\ttime=sf.format(anserTime);\r\n\t\t}\r\n return time;\r\n }", "private String dateFormat(String date) {\n SimpleDateFormat df = new SimpleDateFormat(\"yyyy-MM-dd'T'HH:mm:ss.SSS'Z'\", Locale.ENGLISH);\n df.setTimeZone(TimeZone.getTimeZone(\"UTC\"));\n Date serverDate = null;\n String formattedDate = null;\n try {\n serverDate = df.parse(date);\n SimpleDateFormat outputFormat = new SimpleDateFormat(\"MMM dd yyyy, hh:mm\");\n\n outputFormat.setTimeZone(TimeZone.getDefault());\n\n formattedDate = outputFormat.format(serverDate);\n } catch (ParseException e) {\n e.printStackTrace();\n }\n return formattedDate;\n }", "Date getAccessTime();", "private static String getTimeStamp()\r\n\t{\r\n\t\tDateFormat dateFormat = new SimpleDateFormat(\"yyyy-MM-dd_HH.mm.ss\");\r\n\t\tDate date = new Date();\r\n\t\treturn dateFormat.format(date);\r\n\t}", "public Date getGmtLogin() {\n return gmtLogin;\n }", "public String getYYYYMMDDhhmmssTime(Long time) {\n\t\tString result = \"\";\n\t\tSimpleDateFormat sdf = new SimpleDateFormat(\"YYYYMMDDhhmmss\");\n\t\tresult = sdf.format(new Date(time));\n\t\treturn result;\n\t}", "public static String getDateTime() {\n\t\treturn new SimpleDateFormat(\"dd/MM/yyyy HH:mm:ss\").format(new Date());\n\t}", "public String getTime() {\n\t}", "private String currentDateTime() {\n DateFormat df = new SimpleDateFormat(\"yyyy-MM-dd'T'HH:mm:ss.SSSZ\");\n String date = df.format(Calendar.getInstance().getTime());\n return date;\n }", "public String getDateTime(){\n LocalDateTime ldt = LocalDateTime.ofInstant(Instant.ofEpochMilli(this.datePosted), ZoneId.systemDefault());\n String dateOnly = ldt.toString().substring(0, 10);\n String timeOnly = ldt.toString().substring(11, ldt.toString().length()-4);\n return dateOnly + \" at \" + timeOnly;\n }", "public Date getFormattedDate() {\r\n\t\tlog.debug(\"formatting \" + getDateTime());\r\n\t\ttry {\r\n\t\t\tDateFormat df = new SimpleDateFormat(\"yyyy-MM-dd'T'HH:mm:ss.mmmX\");\r\n\t\t\tif (Objects.nonNull(getDateTime())) {\r\n\t\t\t\treturn df.parse(getDateTime());\r\n\t\t\t}\r\n\t\t} catch (Exception e) {\r\n\t\t\tlog.warn(\"Illegal date format; returning epoch datetime.\");\r\n\t\t}\r\n\t\treturn new Date(0);\r\n\t}", "public static String getDateTime(){\n String pattern = \"MM/dd/yyyy HH:mm:ss\";\n DateFormat df = new SimpleDateFormat(pattern);\n Date today = Calendar.getInstance().getTime();\n String todayAsString = df.format(today);\n return todayAsString;\n }", "public String getDateTimeFormated(Context context){\n SimpleDateFormat sdf = new SimpleDateFormat(\"dd/MM/yyyy HH:mm:ss\"\n , context.getResources().getConfiguration().locale);\n sdf.setTimeZone(TimeZone.getDefault());\n return sdf.format(new Date(mDateTime));\n //setting the dateformat to dd/MM/yyyy HH:mm:ss which is how the date is displayed when a dream is saved\n }", "public String getTimeZoneGmt() {\n return timeZoneGmt;\n }", "java.lang.String getDate();", "public static String convertCalToBrokerTime(Calendar cal) {\r\n String result = \"\";\r\n Calendar gmtCal = DTUtil.convertToLondonCal(cal);\r\n SimpleDateFormat format1 = new SimpleDateFormat(\"yyyyMMdd HH:mm:ss\");\r\n String timeFMString = format1.format(gmtCal.getTime()) + \" GMT\";\r\n result = timeFMString;\r\n return result;\r\n }", "private String timeConversion() {\n Calendar local = Calendar.getInstance();\n Calendar GMT = Calendar.getInstance(TimeZone.getTimeZone(\"GMT\"));\n\n //Time from the PINPoint\n int hours, minutes, seconds, day, month, year;\n hours = (record[10] & 0xF8) >> 3;\n minutes = ((record[10] & 0x07) << 3) + ((record[11] & 0xE0) >> 5);\n seconds = ((record[11] & 0x1F) << 1) + ((record[12] & 0x80) >> 7);\n seconds += (record[12] & 0x7F) / 100;\n day = (record[13] & 0xF8) >> 3;\n month = ((record[13] & 0x07) << 1) + ((record[14] & 0x80) >> 7);\n year = (record[14] & 0x7F) + 2000;\n \n month--; //Months in java are 0-11, PINPoint = 1-12;\n\n //Set GMTs time to be the time from the PINPoint\n GMT.set(Calendar.DAY_OF_MONTH, day);\n GMT.set(Calendar.MONTH, month);\n GMT.set(Calendar.YEAR, year);\n GMT.set(Calendar.HOUR_OF_DAY, hours);\n GMT.set(Calendar.MINUTE, minutes);\n GMT.set(Calendar.SECOND, seconds);\n\n //Local is set to GMTs time but with the correct timezone\n local.setTimeInMillis(GMT.getTimeInMillis());\n\n //Set Local time to be the time converted from GMT\n int lHours, lMinutes, lSeconds, lDay, lMonth, lYear;\n lHours = local.get(Calendar.HOUR_OF_DAY);\n lMinutes = local.get(Calendar.MINUTE);\n lSeconds = local.get(Calendar.SECOND);\n lDay = local.get(Calendar.DAY_OF_MONTH);\n lMonth = local.get(Calendar.MONTH);\n\n lMonth++; //Months in java are 0-11, humans read 1-12\n\n lYear = local.get(Calendar.YEAR);\n\n return hR(lMonth) + \"/\" + hR(lDay) + \"/\" + lYear + \" \" + hR(lHours) + \":\" + hR(lMinutes) + \":\" + hR(lSeconds);\n }", "public static String getYYYYMMDD()\r\n/* 65: */ {\r\n/* 66: 81 */ String nowTime = \"\";\r\n/* 67: 82 */ Date now = new Date();\r\n/* 68: 83 */ SimpleDateFormat formatter = new SimpleDateFormat(\"yyyyMMdd\");\r\n/* 69: 84 */ nowTime = formatter.format(now);\r\n/* 70: 85 */ return nowTime;\r\n/* 71: */ }", "String getDate();", "String getDate();", "java.lang.String getTimeZone();", "@Override\n\tpublic String asString(Object object) {\n\t\t// at this point object is a Date\n\n\t\tCalendar calendar = Calendar.getInstance(TimeZone.getTimeZone(\"GMT\"));\n\t\tcalendar.setTime((Date) object);\n\n\t\tStringBuilder builder = new StringBuilder();\n\n\t\tint year = calendar.get(Calendar.YEAR);\n\t\tif (calendar.get(Calendar.ERA) == 0) {\n\t\t\t// https://en.wikipedia.org/wiki/ISO_8601\n\t\t\t// by convention 1 BC is labeled +0000, 2 BC is labeled −0001, ...\n\n\t\t\tif (year > 1) {\n\t\t\t\tbuilder.append('-');\n\t\t\t}\n\t\t\t--year;\n\t\t}\n\n\t\tbuilder.append(String.format(\"%04d\", year));\n\t\tbuilder.append('-');\n\t\tbuilder.append(String.format(\"%02d\", calendar.get(Calendar.MONTH) + 1));\n\t\tbuilder.append('-');\n\t\tbuilder.append(String.format(\"%02d\", calendar.get(Calendar.DATE)));\n\t\tbuilder.append('T');\n\t\tbuilder.append(String.format(\"%02d\", calendar.get(Calendar.HOUR_OF_DAY)));\n\t\tbuilder.append(':');\n\t\tbuilder.append(String.format(\"%02d\", calendar.get(Calendar.MINUTE)));\n\t\tbuilder.append(':');\n\t\tbuilder.append(String.format(\"%02d\", calendar.get(Calendar.SECOND)));\n\t\tbuilder.append('Z');\n\n\t\treturn builder.toString();\n\t}", "private String getISO8601Timestamp(long date) {\n SimpleDateFormat format = new SimpleDateFormat(TIMESTAMP_FORMAT);\n // Convert the date into YYYY-MM-DDThh:mm:ss.sss\n String result = format.format(date);\n // Get default time zone in +/-hhmm format\n TimeZone tz = TimeZone.getDefault();\n int offset = tz.getRawOffset();\n // Convert the timezone format from +/-hhmm to +/-hh:mm\n String formatTimeZone = String.format(TIMEZONE_FORMAT, offset >= 0 ? \"+\" : \"-\", offset / 3600000, (offset / 60000) % 60);\n return result + formatTimeZone;\n }", "public String getTimeString() {\n DateFormat format = new SimpleDateFormat(\"HH:mm\");\n return format.format(mDate);\n }", "public static Date currentDate() {\n Date currentDate = new Date();\n SimpleDateFormat format = new SimpleDateFormat(\"yyyy-MM-dd HH:mm:ss\");\n format.setTimeZone(TimeZone.getTimeZone(\"gmt\"));\n String strTime = format.format(currentDate);\n\n SimpleDateFormat formatLocal = new SimpleDateFormat(\"yyyy-MM-dd HH:mm:ss\");\n\n try {\n currentDate = formatLocal.parse(strTime);\n } catch (ParseException e) {\n e.printStackTrace();\n }\n\n return currentDate;\n }", "public static String getDateAndTime() {\n Calendar JCalendar = Calendar.getInstance();\n String JMonth = JCalendar.getDisplayName(Calendar.MONTH, Calendar.SHORT, Locale.UK);\n String JDate = JCalendar.getDisplayName(Calendar.DATE, Calendar.LONG, Locale.UK);\n String JHour = JCalendar.getDisplayName(Calendar.HOUR, Calendar.LONG, Locale.UK);\n String JSec = JCalendar.getDisplayName(Calendar.SECOND, Calendar.LONG, Locale.UK);\n\n return JDate + \"th \" + JMonth + \"/\" + JHour + \".\" + JSec + \"/24hours\";\n }", "public String getLastmodifiedTimeView() {\r\n if (lastmodifiedTime != null) {\r\n lastmodifiedTimeView = DateUtils.dateToStr(lastmodifiedTime, DateUtils.YMD_DASH);\r\n }\r\n return lastmodifiedTimeView;\r\n }", "String getDateString(Context context) {\n int flags = DateUtils.FORMAT_NO_NOON_MIDNIGHT | DateUtils.FORMAT_SHOW_TIME |\n DateUtils.FORMAT_ABBREV_ALL | DateUtils.FORMAT_SHOW_DATE |\n DateUtils.FORMAT_CAP_AMPM;\n return DateUtils.formatDateTime(context, mDeliveryTime, flags);\n }", "long getDateTime();", "long getCreateTime();", "long getCreateTime();", "private static String buildSequence() {\n\t\tSimpleDateFormat dateFormatGMT = new SimpleDateFormat(\"yyyyMMddHHmmssSSS\");\n\t\tdateFormatGMT.setTimeZone(TimeZone.getTimeZone(\"GMT\")); // set to Greenwich mean time.\n\t\treturn dateFormatGMT.format(new Date());\n\t}", "public Date getSystemDateTime(){\n\t\tDate systemDate = new Date();\t\t\n\t\treturn systemDate;\n\t}", "@RequiresApi(api = Build.VERSION_CODES.N)\n private String getDateTime() {\n DateFormat dateFormat = new SimpleDateFormat(\"yyyy/MM/dd HH:mm:ss\");\n Date date = new Date();\n return dateFormat.format(date);\n }", "public String gmtToLocal(String gmtTime) {\n\t\tString localTime = \"\";\n\t\tcurrentFormat = new SimpleDateFormat(\"yyyy-MM-dd'T'HH:mm:ss'Z'\");\n\t\tcurrentFormat.setTimeZone(TimeZone.getTimeZone(\"UTC\"));\n\t\tDate date = null;\n\t\t\n\t\ttry {\n\t\t\t//date = currentFormat.parse(gmtTime);\n\t\t\tdate = parseDate(gmtTime,true);\n\t\t\n\t\t\n\t\t} catch (Exception e) {\n\t\t\tLogs.show(e);\n\t\t\t \n\t\t}\n\t\tcalendar = Calendar.getInstance();\n\t\tcurrentFormat.setTimeZone(calendar.getTimeZone());\n\t\tlocalTime = currentFormat.format(date);\n\t\treturn localTime;\n\t}" ]
[ "0.7136102", "0.669008", "0.66894984", "0.6586164", "0.6544667", "0.65070444", "0.65006006", "0.6496049", "0.6464054", "0.6458278", "0.6394899", "0.639099", "0.63766927", "0.63752294", "0.63696957", "0.63510954", "0.63416", "0.6297777", "0.62913066", "0.6290827", "0.62898815", "0.6265442", "0.62649614", "0.62649614", "0.6252676", "0.62150127", "0.62097055", "0.61868787", "0.6182419", "0.61350715", "0.613014", "0.61180097", "0.6114964", "0.6113781", "0.61134744", "0.6112557", "0.6095926", "0.60955286", "0.6092992", "0.60918045", "0.60873044", "0.60695124", "0.6068287", "0.60582095", "0.6056424", "0.60548943", "0.6053275", "0.6050919", "0.6037747", "0.6021497", "0.60042727", "0.6000263", "0.6000199", "0.6000136", "0.5996164", "0.5989904", "0.59656364", "0.596385", "0.5958359", "0.5955087", "0.5949979", "0.59450424", "0.5944841", "0.59418976", "0.59391373", "0.5919225", "0.59143084", "0.5902551", "0.5901605", "0.5894264", "0.5890054", "0.58840126", "0.5875127", "0.5870056", "0.58641547", "0.5848675", "0.5844896", "0.58427536", "0.5833534", "0.5830857", "0.5816921", "0.5804078", "0.57980883", "0.57800674", "0.5774246", "0.5774246", "0.5764876", "0.57645184", "0.576425", "0.5752767", "0.57512456", "0.5748189", "0.57421696", "0.5735927", "0.5735111", "0.5730922", "0.5730922", "0.57277507", "0.57211596", "0.57178164", "0.57135713" ]
0.0
-1
method to get date in YYYYMMDDhhmmss format
public String getDateTime(Calendar calendar) throws Exception { return getDateTime(calendar, 0, ""); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static String getYYYYMMDDHHMMSS()\r\n/* 56: */ {\r\n/* 57: 68 */ String nowTime = \"\";\r\n/* 58: 69 */ Date now = new Date();\r\n/* 59: 70 */ SimpleDateFormat formatter = new SimpleDateFormat(\"yyyyMMddHHmmss\");\r\n/* 60: 71 */ nowTime = formatter.format(now);\r\n/* 61: 72 */ return nowTime;\r\n/* 62: */ }", "public static String getYYYYMMDD()\r\n/* 65: */ {\r\n/* 66: 81 */ String nowTime = \"\";\r\n/* 67: 82 */ Date now = new Date();\r\n/* 68: 83 */ SimpleDateFormat formatter = new SimpleDateFormat(\"yyyyMMdd\");\r\n/* 69: 84 */ nowTime = formatter.format(now);\r\n/* 70: 85 */ return nowTime;\r\n/* 71: */ }", "private static String getDate() {\n return new SimpleDateFormat(\"yyyyMMddHHmmss\").format\n (new Date(System.currentTimeMillis()));\n }", "public String getYYYYMMDDhhmmssTime(Long time) {\n\t\tString result = \"\";\n\t\tSimpleDateFormat sdf = new SimpleDateFormat(\"YYYYMMDDhhmmss\");\n\t\tresult = sdf.format(new Date(time));\n\t\treturn result;\n\t}", "public static String timeStamp()\n {\n DateFormat format = new SimpleDateFormat(\"ddMMyyHHmmSS\");\n return format.format(new Date());\n }", "private static String getDateStr() {\n\t\tDate date = Calendar.getInstance().getTime();\n\t\tDateFormat dateFormat = new SimpleDateFormat(\"MMddyyy\");\n\t\tString dateStr = dateFormat.format(date);\n\t\treturn dateStr;\n\t}", "public static String getSystemDate()\n {\n\t DateFormat dateFormat= new SimpleDateFormat(\"_ddMMyyyy_HHmmss\");\n\t Date date = new Date();\n\t return dateFormat.format(date);\n }", "private static String getStamp() {\n\t\t\t return new SimpleDateFormat(\"yyyyMMddHHmmss\").format(new Date());\r\n\t\t}", "public static String getDateString(){\n\t\t\tCalendar now = Calendar.getInstance();\n\t\t\tSimpleDateFormat sdf = new SimpleDateFormat(\"yyyy-MM-dd__HH-mm-ss\");\n\t\t\treturn sdf.format(now.getTime());\n\t }", "public static String randomDate() {\n DateFormat format = new SimpleDateFormat(\"ddMMyyHHmmss\");\n return format.format(new Date());\n }", "public static String generateDate()\r\n\t{\r\n\t\tDate d = new Date();\r\n\t\tSimpleDateFormat datef = new SimpleDateFormat(\"YYYY_MM_dd_ss\");\r\n\t\treturn datef.format(d);\r\n\r\n\r\n\t}", "String timeStamp() {\n\n\t\tCalendar now = Calendar.getInstance();\n\n\t\t String y = String.valueOf(now.get(now.YEAR));\n\t\t String mo = String.valueOf(now.get(now.MONTH)+1);\n\t\t String d = String.valueOf(now.get(now.DAY_OF_MONTH));\n\t\t String h = String.valueOf(now.get(now.HOUR_OF_DAY));\n\t\t String m = String.valueOf(now.get(now.MINUTE));\n\t\t String s = String.valueOf(now.get(now.SECOND));\n\t\t String ms = String.valueOf(now.get(now.MILLISECOND));\n\n\n\t return h + m + s + ms;\n\n\n\n }", "public static String getDate() {\n\t\tDate date = new Date();\n\t\tSimpleDateFormat formatter = new SimpleDateFormat(\"ddMMYYYY\");\n\t\tString strDate = formatter.format(date);\n\t\treturn strDate;\n\t}", "public String generateTimeStamp() {\t\t\r\n\t\t\tCalendar now = Calendar.getInstance();\r\n\t\t\tint year = now.get(Calendar.YEAR);\r\n\t\t\tint month = now.get(Calendar.MONTH) + 1;\r\n\t\t\tint day = now.get(Calendar.DATE);\r\n\t\t\tint hour = now.get(Calendar.HOUR_OF_DAY); // 24 hour format\r\n\t\t\tint minute = now.get(Calendar.MINUTE);\r\n\t\t\tint second = now.get(Calendar.SECOND);\r\n\t\t\t\r\n\t\t\tString date = new Integer(year).toString() + \"y\";\r\n\t\t\t\r\n\t\t\tif(month<10)date = date + \"0\"; // zero padding single digit months to aid sorting.\r\n\t\t\tdate = date + new Integer(month).toString() + \"m\"; \r\n\r\n\t\t\tif(day<10)date = date + \"0\"; // zero padding to aid sorting.\r\n\t\t\tdate = date + new Integer(day).toString() + \"d\";\r\n\r\n\t\t\tif(hour<10)date = date + \"0\"; // zero padding to aid sorting.\r\n\t\t\tdate = date + new Integer(hour).toString() + \"_\"; \r\n\r\n\t\t\tif(minute<10)date = date + \"0\"; // zero padding to aid sorting.\r\n\t\t\tdate = date + new Integer(minute).toString() + \"_\"; \r\n\r\n\t\t\tif(second<10)date = date + \"0\"; // zero padding to aid sorting.\r\n\t\t\tdate = date + new Integer(second).toString() + \"x\";\r\n\t\t\t\r\n\t\t\t// add the random number just to be sure we avoid name collisions\r\n\t\t\tRandom rand = new Random();\r\n\t\t\tdate = date + rand.nextInt(1000);\r\n\t\t\treturn date;\r\n\t\t}", "public static String getTimestamp() {\r\n\t\t\r\n\t\treturn new SimpleDateFormat(\"yyyyMMddHHmmss\").format(new Date());\r\n\t}", "String getTime(){\n\t\tCalendar c = Calendar.getInstance();\n int mseconds = c.get(Calendar.MILLISECOND);\n String currentDateandTime = mDateFormat.format(new Date()) + String.format(\"-%04d\", mseconds);\n \n return currentDateandTime;\n\t}", "public static String getDateId() {\n Date date = new Date();\n String dateFormatStyle = \"yy-MM-dd-HH-mm-ss\";\n SimpleDateFormat sdf = new SimpleDateFormat(dateFormatStyle);\n String dateFormat = sdf.format(date);\n String[] formatedDate = dateFormat.split(\"-\");\n int i = 0;\n String year = formatedDate[i];\n String month = formatedDate[++i];\n String cDate = formatedDate[++i];\n String hour = formatedDate[++i];\n String minute = formatedDate[++i];\n String second = formatedDate[++i];\n return alphanum[Integer.parseInt(year)]\n .concat(alphanum[Integer.parseInt(month)])\n .concat(alphanum[Integer.parseInt(cDate)])\n .concat(alphanum[Integer.parseInt(hour)])\n .concat(alphanum[Integer.parseInt(minute)])\n .concat(alphanum[Integer.parseInt(second)]);\n }", "private static String getTimeStamp()\r\n\t{\r\n\t\tDateFormat dateFormat = new SimpleDateFormat(\"yyyy-MM-dd_HH.mm.ss\");\r\n\t\tDate date = new Date();\r\n\t\treturn dateFormat.format(date);\r\n\t}", "private static String getDate()\n\t{\n\t\tString dateString = null;\n\t\tDate sysDate = new Date( System.currentTimeMillis() );\n\t\tSimpleDateFormat sdf = new SimpleDateFormat(\"dd-MM-yy HH:mm:ss\");\n\t\tdateString = sdf.format(sysDate);\n\t\treturn dateString;\n\t}", "String getDate();", "String getDate();", "public String getDate(){\n String d=\"\";\n String m=\"\";\n if(day<10){\n d=0+(String.valueOf(day));\n }\n else{\n d=String.valueOf(day);\n }\n\n if(month<10){\n m=0+(String.valueOf(month));\n }\n else{\n m=String.valueOf(month);\n }\n //returning day/month/year\n return (d+\"/\"+m+\"/\"+String.valueOf(year));\n }", "protected final static String getDateStamp() {\n\n\t\treturn\n\n\t\tnew SimpleDateFormat(\"MMM d, yyyy h:mm:ss a zzz\").format(new Date());\n\n\t}", "String dateToString(int year, int month, int day, int hour, int minute, double seconds);", "public static String createTimeStamp(){\n return new SimpleDateFormat( \"yyyy.MM.dd.HH.mm.ss\").format(new Date());\n }", "public static String getDateTime() {\n\t\tString sDateTime=\"\";\n\t\ttry {\n\t\t\tSimpleDateFormat sdfDate = new SimpleDateFormat(\"dd-MM-yyyy\");\n\t\t\tSimpleDateFormat sdfTime = new SimpleDateFormat(\"HH:mm:ss\");\n\t\t\tDate now = new Date();\n\t\t\tString strDate = sdfDate.format(now);\n\t\t\tString strTime = sdfTime.format(now);\n\t\t\tstrTime = strTime.replace(\":\", \"-\");\n\t\t\tsDateTime = \"D\" + strDate + \"_T\" + strTime;\n\t\t} catch (Exception e) {\n\t\t\tSystem.err.println(e);\n\t\t}\n\t\treturn sDateTime;\n\t}", "public String getTimestamp() \n{\n Calendar now = Calendar.getInstance();\n return String.format(\"20%1$ty-%1$tm-%1$td_%1$tHh%1$tMm%1$tSs\", now);\n}", "private String getDate()\r\n\t{\r\n\t\tCalendar cal = Calendar.getInstance();\r\n\t\tSimpleDateFormat sdf = new SimpleDateFormat(\"yyyy-MM-dd HH:mm\");\r\n\t\treturn sdf.format(cal.getTime());\r\n\t}", "long getDate();", "public static String getTimeString() {\n SimpleDateFormat formatter = new SimpleDateFormat(\"EEE MMM dd HH:mm:ss yyyy\");\n return formatter.format(new java.util.Date());\n }", "java.lang.String getDate();", "public static String longToYYYYMMDDHHMM(long longTime)\r\n/* 157: */ {\r\n/* 158:232 */ SimpleDateFormat formatter = new SimpleDateFormat(\"yyyyMMdd HH:mm\");\r\n/* 159:233 */ Date strtodate = new Date(longTime);\r\n/* 160:234 */ return formatter.format(strtodate);\r\n/* 161: */ }", "private static String buildSequence() {\n\t\tSimpleDateFormat dateFormatGMT = new SimpleDateFormat(\"yyyyMMddHHmmssSSS\");\n\t\tdateFormatGMT.setTimeZone(TimeZone.getTimeZone(\"GMT\")); // set to Greenwich mean time.\n\t\treturn dateFormatGMT.format(new Date());\n\t}", "java.lang.String getStartDateYYYYMMDD();", "public String getTime() {\n String pattern = \"yyyy-MM-dd HH:mm:ss\";\n SimpleDateFormat simpleDateFormat = new SimpleDateFormat(pattern);\n\n String date = simpleDateFormat.format(new Date());\n return date;\n }", "private String getDateFromLong(Long msec) {\n DateFormat df = DateFormat.getDateTimeInstance();\n return df.format(new Date(msec));\n }", "public String getUserDateString() {\n\t\tString[] tmpArr = this.getUserDate();\n\t\tString year = tmpArr[0];\n\t\tString month = tmpArr[1];\n\t\tString day = tmpArr[2];\n\t\tString out = year + \"/\" + month + \"/\" + day;\n\t\treturn out;\n\t}", "public static String getDate() {\n return getDate(System.currentTimeMillis());\n }", "private String getFormattedDate(Integer format) {\n Date date = new Date(format * 1000L);\n DateFormat dateFormat = new SimpleDateFormat(\"yyyy-MM-dd HH:mm:ss.SSS\");\n dateFormat.setTimeZone(TimeZone.getTimeZone(\"Etc/UTC\"));\n Log.e(\"time\",dateFormat.format(date));\n return dateFormat.format(date);\n }", "public static String getPrintToFileTime() {\n @SuppressLint(\"SimpleDateFormat\") SimpleDateFormat sdf = new SimpleDateFormat(\"yyyyMMdd_HHmmss\");\n return sdf.format(System.currentTimeMillis());\n }", "public static String getDate()\r\n {\r\n Date now = new Date();\r\n DateFormat df = new SimpleDateFormat (\"yyyy-MM-dd'T'hh-mm-ss\");\r\n String currentTime = df.format(now);\r\n return currentTime; \r\n \r\n }", "private String formatTimeToICS(LocalDateTime date) {\n return DateTimeFormatter.ofPattern(\"YYYYMMddTHHmmss\").format(date);\n }", "public static String longToYYYYMMDD(long longTime)\r\n/* 143: */ {\r\n/* 144:206 */ SimpleDateFormat formatter = new SimpleDateFormat(\"yyyyMMdd\");\r\n/* 145:207 */ Date strtodate = new Date(longTime);\r\n/* 146:208 */ return formatter.format(strtodate);\r\n/* 147: */ }", "private String getDateTime() {\n SimpleDateFormat sdf = new SimpleDateFormat(\"[yyyy/MM/dd - HH:mm:ss]\");\n return sdf.format(new Date());\n }", "public static String timestamp(){\n\t\tDate date = new Date();\n\t\tDateFormat hourdateFormat = new SimpleDateFormat(\"dd/MM/yyyy HH:mm:ss \");\n\t\treturn hourdateFormat.format(date);\n\t}", "java.lang.String getToDate();", "public static String Milisec2DDMMYYYY(long ts) {\n\t\tif (ts == 0) {\n\t\t\treturn \"\";\n\t\t} else {\n\t\t\tjava.util.Calendar calendar = java.util.Calendar.getInstance();\n\t\t\tcalendar.setTime(new java.util.Date(ts));\n\n\t\t\tString strTemp = Integer.toString(calendar\n\t\t\t\t\t.get(calendar.DAY_OF_MONTH));\n\t\t\tif (calendar.get(calendar.DAY_OF_MONTH) < 10) {\n\t\t\t\tstrTemp = \"0\" + strTemp;\n\t\t\t}\n\t\t\tif (calendar.get(calendar.MONTH) + 1 < 10) {\n\t\t\t\treturn strTemp + \"/0\" + (calendar.get(calendar.MONTH) + 1)\n\t\t\t\t\t\t+ \"/\" + calendar.get(calendar.YEAR);\n\t\t\t} else {\n\t\t\t\treturn strTemp + \"/\" + (calendar.get(calendar.MONTH) + 1) + \"/\"\n\t\t\t\t\t\t+ calendar.get(calendar.YEAR);\n\t\t\t}\n\t\t}\n\t}", "private String getDateTime() {\n SimpleDateFormat sdf = new SimpleDateFormat(\"[yyyy/MM/dd - HH:mm:ss]\");\n return sdf.format(new Date());\n }", "private String getDateTime() {\n SimpleDateFormat sdf = new SimpleDateFormat(\"[yyyy/MM/dd - HH:mm:ss]\");\n return sdf.format(new Date());\n }", "private static String timeFor(Date date)\n\t{\n\t\tDateFormat df = new InternetDateFormat();\n\t\tString theTime = df.format(date);\n\t\treturn theTime;\n\t}", "public static String convertDateToSend(String gotdate){\n Calendar calendar = Calendar.getInstance();\n calendar.setTimeInMillis(Long.parseLong(gotdate));\n SimpleDateFormat inputFormat = new SimpleDateFormat(\"yyyyMMddHHmmss\");\n SimpleDateFormat outputFormat = new SimpleDateFormat(\"dd MMM yyyy\");\n /*Date parsedDate = null;\n try {\n parsedDate = inputFormat.parse(gotdate);\n } catch (ParseException e) {\n e.printStackTrace();\n }*/\n String formattedDate = outputFormat.format(calendar.getTime());\n return formattedDate;\n }", "public static String ShowDate(){\n Date date = new Date();\n SimpleDateFormat sdf = new SimpleDateFormat(\"HH:mm:ss.SS a\");\n String HH_MM = sdf.format(date);\n return HH_MM;\n }", "public String getTimeStamp() {\n Calendar instance = Calendar.getInstance();\n SimpleDateFormat sdf = new SimpleDateFormat(\"MMM-dd-yyyy-HH:mm:ss:ms\");\n return sdf.format(instance.getTime());\n }", "private String getDate(long timeStamp) {\n\n try {\n DateFormat sdf = new SimpleDateFormat(\"MMM d, yyyy\", getResources().getConfiguration().locale);\n Date netDate = (new Date(timeStamp * 1000));\n return sdf.format(netDate);\n } catch (Exception ex) {\n return \"xx\";\n }\n }", "private String getDate(long timeStamp) {\n\n try {\n DateFormat sdf = new SimpleDateFormat(\"MMM d, yyyy\", getResources().getConfiguration().locale);\n Date netDate = (new Date(timeStamp * 1000));\n return sdf.format(netDate);\n } catch (Exception ex) {\n return \"xx\";\n }\n }", "public static String date(Long time, Context context){\n\t\t\n //FORMAT TIME\n\t\tString res = \"\";\n Long tsLong = System.currentTimeMillis()/1000;\t\n \tlong dv = Long.valueOf(time)*1000;// its need to be in milisecond\n \tDate df = new java.util.Date(dv);\n \t//LESS THAN 24\n \tif((tsLong-time)<86400){\n \t\tDateFormat timeFormat = android.text.format.DateFormat.getTimeFormat(context);\n \t\tres = timeFormat.format(df);\n \t}else{\n \t\tDateFormat dateFormat = android.text.format.DateFormat.getMediumDateFormat(context);\n \t\tres = dateFormat.format(df);\n \t}\t\n \tif(time.equals(0l)){\n \t\t\n \t\tres = context.getResources().getString(R.string.never);\n \t}\n \treturn res;\n\t}", "public String getNiceDate(){\n\t\treturn sDateFormat.format(mTime);\n\t}", "public static String getTimeStamp() {\n\t\tDate date = new Date();\n\t\treturn date.toString().replaceAll(\":\", \"_\").replaceAll(\" \", \"_\");\n\n\t}", "private String getDateTime() {\n DateFormat dateFormat = new SimpleDateFormat(\"MM/dd/yyyy HH:mm\");\n Date date = new Date();\n return dateFormat.format(date);\n }", "public String generateLocalDateTime() {\n LocalDateTime localDateTime = LocalDateTime.now();\n DateTimeFormatter dateTimeFormatter = DateTimeFormatter.ofPattern(\"yyyyMMddHHmmss\");\n String formatLocalDateTime = localDateTime.format(dateTimeFormatter);\n return formatLocalDateTime;\n }", "public static String getDateTime(){\n String pattern = \"MM/dd/yyyy HH:mm:ss\";\n DateFormat df = new SimpleDateFormat(pattern);\n Date today = Calendar.getInstance().getTime();\n String todayAsString = df.format(today);\n return todayAsString;\n }", "public String getUniqTime(){\n String timeStamp = new SimpleDateFormat(\"yyyyMMdd_HHmmss\").format(Calendar.getInstance().getTime());\n return timeStamp;\n }", "public static String dateConv(int date) {\n\t\tDate mills = new Date(date*1000L); \n\t\tString pattern = \"dd-MM-yyyy\";\n\t\tSimpleDateFormat simpleDateFormat = new SimpleDateFormat(pattern);\n\t\tsimpleDateFormat.setTimeZone(TimeZone.getTimeZone(\"GMT+1\"));\n\t\tString formattedDate = simpleDateFormat.format(mills);\n\t\treturn formattedDate;\n\t}", "java.lang.String getTime();", "public String getDateString(){\n return Utilities.dateToString(date);\n }", "public static String getNowTime(){\r\n\t\tDate date = new Date();\r\n\t\tDateFormat format = new SimpleDateFormat(\"yyyy-MM-dd HH:mm:ss\");\r\n\t\tString time = format.format(date);\r\n\t\treturn time;\r\n\t}", "public static String getDate()\n {\n Date date = new Date();\n SimpleDateFormat dateFormat = new SimpleDateFormat(\"yyyy-MM-dd\");\n return dateFormat.format(date);\n }", "public static String getDateFormatForFileName() {\n final DateFormat sdf = new SimpleDateFormat(\"yyyyMMdd_HH-mm-ss\");\n return sdf.format(new Date());\n }", "public static String getPrintToDirectoryTime() {\n @SuppressLint(\"SimpleDateFormat\") SimpleDateFormat sdf = new SimpleDateFormat(\"MMdd\");\n return sdf.format(System.currentTimeMillis());\n }", "public String getSystemDateTime() {\n\t\tjava.text.SimpleDateFormat sdfDate = new java.text.SimpleDateFormat(\"yyyy/MM/dd\");\n java.text.SimpleDateFormat sdfTime = new java.text.SimpleDateFormat(\"HH:mm\");\n Date now = new Date();\n String strDate = sdfDate.format(now);\n String strTime = sdfTime.format(now);\n System.out.println(\"Date: \" + strDate);\n System.out.println(\"Time: \" + strTime); \n return \"date\"+strDate+\" \"+strTime;\n\t}", "private String getDate() {\n\t\tSimpleDateFormat parseFormat = new SimpleDateFormat(\"hh:mm a\");\n\t\tDate date = new Date();\n\t\tString s = parseFormat.format(date);\n\t\treturn s;\n\t}", "public String getTimeAndDate() {\n\t\t\tDateFormat dateFormat = new SimpleDateFormat(\"dd MMM hh:mm\");\n\t\t\tCalendar cal = Calendar.getInstance();\n\t\t\tString dateAndTime = dateFormat.format(cal.getTime());\n\t\t\treturn dateAndTime;\n\t\t}", "public static int getNowDate() {\n\t\tSimpleDateFormat dateFormat = new SimpleDateFormat(\"yyMMdd\");\n\t\treturn Integer.parseInt(dateFormat.format(new Date()));\n\t}", "public static String getDateTime() {\n\t\treturn new SimpleDateFormat(\"dd/MM/yyyy HH:mm:ss\").format(new Date());\n\t}", "private static String formatDate(long date) {\n Date systemDate = new java.util.Date(date * 1000L);\n // the format of your date\n SimpleDateFormat sdf = new java.text.SimpleDateFormat(\"yyyy-MM-dd HH:mm:ss\");\n // give a timezone reference for formatting (see comment at the bottom)\n sdf.setTimeZone(java.util.TimeZone.getTimeZone(\"GMT-4\"));\n String formattedDate = sdf.format(systemDate);\n return formattedDate;\n }", "public String getDateCreationLibelle() {\n\t\tDateTimeFormatter format = DateTimeFormatter.ofPattern(\"dd/MM/yyyy hh:mm:ss\");\n\t\treturn this.dateCreation.format(format);\n\t}", "long getDateTime();", "long getCreateTime();", "long getCreateTime();", "private String makeDateString(int day, int month, int year) {\n String str_month = \"\" + month;\n String str_day = \"\" + day;\n if (month < 10) {\n str_month = \"0\" + month;\n }\n if (day < 10) {\n str_day = \"0\" + day;\n }\n return year + \"-\" + str_month + \"-\" + str_day;\n }", "public static synchronized String utilDateToString(java.util.Date date) {\r\n\r\n SimpleDateFormat sdf = new SimpleDateFormat(\"yyyy-MM-dd HH:mm:ss\");\r\n return sdf.format(date.getTime());\r\n }", "private String getFecha() {\n\t\tLocalDateTime myDateObj = LocalDateTime.now();\n\t\tDateTimeFormatter myFormatObj = DateTimeFormatter.ofPattern(\"dd-MM-yyyy HH:mm:ss\");\n\t\tString formattedDate = myDateObj.format(myFormatObj);\n \n\t\treturn formattedDate;\n }", "public static String longToStringDate(long l)\r\n/* 212: */ {\r\n/* 213:293 */ SimpleDateFormat sdf = new SimpleDateFormat(\"yyyy-MM-dd hh:mm:ss\");\r\n/* 214:294 */ String date = sdf.format(new Date(l * 1000L));\r\n/* 215:295 */ return date;\r\n/* 216: */ }", "public String getDateString() {\n int year = date.get(Calendar.YEAR);\n int month = date.get(Calendar.MONTH); // month is stored from 0-11 so adjust +1 for final display\n int day_of_month = date.get(Calendar.DAY_OF_MONTH);\n return String.valueOf(month + 1) + '/' + String.valueOf(day_of_month) + '/' + year;\n }", "public static String getTimestamp() {\n\t\tCalendar cal = Calendar.getInstance();\n\t\t//define the format of time stamp\n\t\tSimpleDateFormat sdf = new SimpleDateFormat(\"yyyy-MM-dd HH:mm:ss\");\n\t\treturn sdf.format(cal.getTime());\n\n\t}", "long getContactRegistrationDate();", "public String getDate()\n {\n return day + \"/\" + month + \"/\" + year;\n }", "public static String getTimeStamp() {\r\n\r\n\t\tlong now = (System.currentTimeMillis() - startTime) / 1000;\r\n\r\n\t\tlong hours = (now / (60 * 60)) % 24;\r\n\t\tnow -= (hours / (60 * 60)) % 24;\r\n\r\n\t\tlong minutes = (now / 60) % 60;\r\n\t\tnow -= (minutes / 60) % 60;\r\n\r\n\t\tlong seconds = now % 60;\r\n\r\n\t return String.format(\"%02d:%02d:%02d\", hours, minutes, seconds);\r\n\t}", "public String date() throws Exception {\n\t\tDateFormat dateFormat = new SimpleDateFormat(\"dd_MM_yyyy_HH_mm_ss\");\n\t\t// get current date time with Date()\n\t\tDate date = new Date();\n\t\t// Now format the date\n\t\tString date1 = dateFormat.format(date);\n\t\t// System.out.println(date1);\n\t\treturn date1;\n\t}", "public static String dateToString(Date date){\n\t\tSimpleDateFormat formatter = new SimpleDateFormat(\"MMddyy\");\n\t\treturn formatter.format(date);\n\t}", "public void createDate(){\n SimpleDateFormat sdf = new SimpleDateFormat(\"yyyy_MM_dd\"); //TODO -HHmm si dejo diagonales separa bonito en dia, pero para hacer un armado de excel creo que debo hacer un for mas\n currentDateandTime = sdf.format(new Date());\n Log.e(TAG, \"todays date is: \"+currentDateandTime );\n\n}", "private static String getTime() {\n\t\tDate getDate = new Date();\n\t\tString timeFormat = \"M/d/yy hh:mma\";\n\t\tSimpleDateFormat sdf = new SimpleDateFormat(timeFormat);\n\t\treturn \"[\" + sdf.format(getDate) + \"]\\t\";\n\t}", "private static String time() throws Exception {\n\t\tDateFormat dateFormat = new SimpleDateFormat(\"HH-mm-ss \");\n\t\t// get current date time with Date()\n\t\tDate date = new Date();\n\t\t// Now format the date\n\t\tString date1 = dateFormat.format(date);\n\t\t// System.out.println(date1);\n\t\treturn date1;\n\t}", "public static String generate4DigitPin() {\n\t\tString longTime = String.valueOf(Calendar.getInstance().getTimeInMillis());\n\t\tint len = longTime.length();\n\n\t\treturn longTime.substring(len - 4);\n\t}", "public static String getTime() {\r\n\r\n\t\t//Gets current date and time\r\n\t\tDateFormat dateFormat = new SimpleDateFormat(\"yyyy-MM-dd HH:mm:ss\");\r\n\t\tDate date = new Date();\r\n\t\tcurrDateTime = dateFormat.format(date);\r\n\t\treturn currDateTime;\r\n\t}", "public static String getDate() {\n\t\tString\ttoday=\"\";\n\n\t\tCalendar Datenow=Calendar.getInstance();\n\t\tSimpleDateFormat formatter = new SimpleDateFormat(\"yyyy-MM-dd HH:mm:ss\");\n\t today = formatter.format(Datenow.getTime());\n\n\t return today;\n\t}", "public static String timestamp() {\n\t\tString t = new SimpleDateFormat(\"yyyy-MM-dd HH-mm-ss\").format(new Date());\n\t\t// File f=new\n\t\t// File(String.format(\"%s.%s\",t,RandomStringUtils.randomAlphanumeric(8)));\n\t\tSystem.out.println(\"Time is :\" + t);\n\t\treturn t;\n\t}", "@RequiresApi(api = Build.VERSION_CODES.N)\n private String getDateTime() {\n DateFormat dateFormat = new SimpleDateFormat(\"yyyy/MM/dd HH:mm:ss\");\n Date date = new Date();\n return dateFormat.format(date);\n }", "public String ConvertDate(){\r\n//\t\tDate date=JavaUtils.getSystemDate();\r\n//\t DateFormat df = new SimpleDateFormat(\"yyyy/MM/dd\");\r\n\t String pattern = \"yyyy-MM-dd\";\r\n\t SimpleDateFormat simpleDateFormat = new SimpleDateFormat(pattern);\r\n\r\n\t String date = simpleDateFormat.format(new Date());\r\n//\t System.out.println(date);\r\n\t \r\n//\t String s = df.format(date);\r\n//\t String result = s;\r\n//\t try {\r\n//\t date=df.parse(result);\r\n//\t } catch (ParseException e) {\r\n//\t // TODO Auto-generated catch block\r\n//\t e.printStackTrace();\r\n//\t }\r\n\t return date;\r\n\t }", "public Date getFormattedDate() {\r\n\t\tlog.debug(\"formatting \" + getDateTime());\r\n\t\ttry {\r\n\t\t\tDateFormat df = new SimpleDateFormat(\"yyyy-MM-dd'T'HH:mm:ss.mmmX\");\r\n\t\t\tif (Objects.nonNull(getDateTime())) {\r\n\t\t\t\treturn df.parse(getDateTime());\r\n\t\t\t}\r\n\t\t} catch (Exception e) {\r\n\t\t\tlog.warn(\"Illegal date format; returning epoch datetime.\");\r\n\t\t}\r\n\t\treturn new Date(0);\r\n\t}", "java.lang.String getFromDate();" ]
[ "0.7913427", "0.7624351", "0.7570983", "0.7238402", "0.716994", "0.71474934", "0.71142495", "0.7045356", "0.68999505", "0.68808347", "0.68446964", "0.6823716", "0.67602795", "0.67547303", "0.66501004", "0.66459817", "0.6574838", "0.6561677", "0.65386903", "0.6499834", "0.6499834", "0.6477983", "0.6472012", "0.6463344", "0.6458026", "0.64560276", "0.64346254", "0.64249796", "0.6413888", "0.64131844", "0.63742286", "0.6350309", "0.63447416", "0.6343309", "0.63366944", "0.631947", "0.62881964", "0.6268692", "0.62432384", "0.6219873", "0.62166697", "0.6213337", "0.62032783", "0.6193788", "0.61792135", "0.6165873", "0.6162572", "0.6159276", "0.6159276", "0.6148757", "0.6145845", "0.6139401", "0.61076224", "0.609793", "0.609793", "0.60860544", "0.60732526", "0.6063838", "0.6045407", "0.6042757", "0.60378325", "0.6031987", "0.60055673", "0.5998928", "0.59966016", "0.5989229", "0.5983423", "0.5980044", "0.59701663", "0.59300876", "0.5928164", "0.591092", "0.5906778", "0.5899577", "0.5894416", "0.5893528", "0.58914804", "0.58663905", "0.58663905", "0.58646", "0.58608025", "0.5855508", "0.5852153", "0.58257264", "0.58152056", "0.580741", "0.58019716", "0.57953864", "0.57920766", "0.5782527", "0.57804763", "0.57747304", "0.5773093", "0.57711506", "0.5762821", "0.5757149", "0.5753295", "0.57462305", "0.5739345", "0.57356113", "0.5731094" ]
0.0
-1
method to get date in YYYYMMDDhhmmss format
public String getDateTime(Calendar calendar, String GMT) throws Exception { return getDateTime(calendar, GMT, ""); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static String getYYYYMMDDHHMMSS()\r\n/* 56: */ {\r\n/* 57: 68 */ String nowTime = \"\";\r\n/* 58: 69 */ Date now = new Date();\r\n/* 59: 70 */ SimpleDateFormat formatter = new SimpleDateFormat(\"yyyyMMddHHmmss\");\r\n/* 60: 71 */ nowTime = formatter.format(now);\r\n/* 61: 72 */ return nowTime;\r\n/* 62: */ }", "public static String getYYYYMMDD()\r\n/* 65: */ {\r\n/* 66: 81 */ String nowTime = \"\";\r\n/* 67: 82 */ Date now = new Date();\r\n/* 68: 83 */ SimpleDateFormat formatter = new SimpleDateFormat(\"yyyyMMdd\");\r\n/* 69: 84 */ nowTime = formatter.format(now);\r\n/* 70: 85 */ return nowTime;\r\n/* 71: */ }", "private static String getDate() {\n return new SimpleDateFormat(\"yyyyMMddHHmmss\").format\n (new Date(System.currentTimeMillis()));\n }", "public String getYYYYMMDDhhmmssTime(Long time) {\n\t\tString result = \"\";\n\t\tSimpleDateFormat sdf = new SimpleDateFormat(\"YYYYMMDDhhmmss\");\n\t\tresult = sdf.format(new Date(time));\n\t\treturn result;\n\t}", "public static String timeStamp()\n {\n DateFormat format = new SimpleDateFormat(\"ddMMyyHHmmSS\");\n return format.format(new Date());\n }", "private static String getDateStr() {\n\t\tDate date = Calendar.getInstance().getTime();\n\t\tDateFormat dateFormat = new SimpleDateFormat(\"MMddyyy\");\n\t\tString dateStr = dateFormat.format(date);\n\t\treturn dateStr;\n\t}", "public static String getSystemDate()\n {\n\t DateFormat dateFormat= new SimpleDateFormat(\"_ddMMyyyy_HHmmss\");\n\t Date date = new Date();\n\t return dateFormat.format(date);\n }", "private static String getStamp() {\n\t\t\t return new SimpleDateFormat(\"yyyyMMddHHmmss\").format(new Date());\r\n\t\t}", "public static String getDateString(){\n\t\t\tCalendar now = Calendar.getInstance();\n\t\t\tSimpleDateFormat sdf = new SimpleDateFormat(\"yyyy-MM-dd__HH-mm-ss\");\n\t\t\treturn sdf.format(now.getTime());\n\t }", "public static String randomDate() {\n DateFormat format = new SimpleDateFormat(\"ddMMyyHHmmss\");\n return format.format(new Date());\n }", "public static String generateDate()\r\n\t{\r\n\t\tDate d = new Date();\r\n\t\tSimpleDateFormat datef = new SimpleDateFormat(\"YYYY_MM_dd_ss\");\r\n\t\treturn datef.format(d);\r\n\r\n\r\n\t}", "String timeStamp() {\n\n\t\tCalendar now = Calendar.getInstance();\n\n\t\t String y = String.valueOf(now.get(now.YEAR));\n\t\t String mo = String.valueOf(now.get(now.MONTH)+1);\n\t\t String d = String.valueOf(now.get(now.DAY_OF_MONTH));\n\t\t String h = String.valueOf(now.get(now.HOUR_OF_DAY));\n\t\t String m = String.valueOf(now.get(now.MINUTE));\n\t\t String s = String.valueOf(now.get(now.SECOND));\n\t\t String ms = String.valueOf(now.get(now.MILLISECOND));\n\n\n\t return h + m + s + ms;\n\n\n\n }", "public static String getDate() {\n\t\tDate date = new Date();\n\t\tSimpleDateFormat formatter = new SimpleDateFormat(\"ddMMYYYY\");\n\t\tString strDate = formatter.format(date);\n\t\treturn strDate;\n\t}", "public String generateTimeStamp() {\t\t\r\n\t\t\tCalendar now = Calendar.getInstance();\r\n\t\t\tint year = now.get(Calendar.YEAR);\r\n\t\t\tint month = now.get(Calendar.MONTH) + 1;\r\n\t\t\tint day = now.get(Calendar.DATE);\r\n\t\t\tint hour = now.get(Calendar.HOUR_OF_DAY); // 24 hour format\r\n\t\t\tint minute = now.get(Calendar.MINUTE);\r\n\t\t\tint second = now.get(Calendar.SECOND);\r\n\t\t\t\r\n\t\t\tString date = new Integer(year).toString() + \"y\";\r\n\t\t\t\r\n\t\t\tif(month<10)date = date + \"0\"; // zero padding single digit months to aid sorting.\r\n\t\t\tdate = date + new Integer(month).toString() + \"m\"; \r\n\r\n\t\t\tif(day<10)date = date + \"0\"; // zero padding to aid sorting.\r\n\t\t\tdate = date + new Integer(day).toString() + \"d\";\r\n\r\n\t\t\tif(hour<10)date = date + \"0\"; // zero padding to aid sorting.\r\n\t\t\tdate = date + new Integer(hour).toString() + \"_\"; \r\n\r\n\t\t\tif(minute<10)date = date + \"0\"; // zero padding to aid sorting.\r\n\t\t\tdate = date + new Integer(minute).toString() + \"_\"; \r\n\r\n\t\t\tif(second<10)date = date + \"0\"; // zero padding to aid sorting.\r\n\t\t\tdate = date + new Integer(second).toString() + \"x\";\r\n\t\t\t\r\n\t\t\t// add the random number just to be sure we avoid name collisions\r\n\t\t\tRandom rand = new Random();\r\n\t\t\tdate = date + rand.nextInt(1000);\r\n\t\t\treturn date;\r\n\t\t}", "public static String getTimestamp() {\r\n\t\t\r\n\t\treturn new SimpleDateFormat(\"yyyyMMddHHmmss\").format(new Date());\r\n\t}", "String getTime(){\n\t\tCalendar c = Calendar.getInstance();\n int mseconds = c.get(Calendar.MILLISECOND);\n String currentDateandTime = mDateFormat.format(new Date()) + String.format(\"-%04d\", mseconds);\n \n return currentDateandTime;\n\t}", "public static String getDateId() {\n Date date = new Date();\n String dateFormatStyle = \"yy-MM-dd-HH-mm-ss\";\n SimpleDateFormat sdf = new SimpleDateFormat(dateFormatStyle);\n String dateFormat = sdf.format(date);\n String[] formatedDate = dateFormat.split(\"-\");\n int i = 0;\n String year = formatedDate[i];\n String month = formatedDate[++i];\n String cDate = formatedDate[++i];\n String hour = formatedDate[++i];\n String minute = formatedDate[++i];\n String second = formatedDate[++i];\n return alphanum[Integer.parseInt(year)]\n .concat(alphanum[Integer.parseInt(month)])\n .concat(alphanum[Integer.parseInt(cDate)])\n .concat(alphanum[Integer.parseInt(hour)])\n .concat(alphanum[Integer.parseInt(minute)])\n .concat(alphanum[Integer.parseInt(second)]);\n }", "private static String getTimeStamp()\r\n\t{\r\n\t\tDateFormat dateFormat = new SimpleDateFormat(\"yyyy-MM-dd_HH.mm.ss\");\r\n\t\tDate date = new Date();\r\n\t\treturn dateFormat.format(date);\r\n\t}", "private static String getDate()\n\t{\n\t\tString dateString = null;\n\t\tDate sysDate = new Date( System.currentTimeMillis() );\n\t\tSimpleDateFormat sdf = new SimpleDateFormat(\"dd-MM-yy HH:mm:ss\");\n\t\tdateString = sdf.format(sysDate);\n\t\treturn dateString;\n\t}", "String getDate();", "String getDate();", "public String getDate(){\n String d=\"\";\n String m=\"\";\n if(day<10){\n d=0+(String.valueOf(day));\n }\n else{\n d=String.valueOf(day);\n }\n\n if(month<10){\n m=0+(String.valueOf(month));\n }\n else{\n m=String.valueOf(month);\n }\n //returning day/month/year\n return (d+\"/\"+m+\"/\"+String.valueOf(year));\n }", "protected final static String getDateStamp() {\n\n\t\treturn\n\n\t\tnew SimpleDateFormat(\"MMM d, yyyy h:mm:ss a zzz\").format(new Date());\n\n\t}", "String dateToString(int year, int month, int day, int hour, int minute, double seconds);", "public static String createTimeStamp(){\n return new SimpleDateFormat( \"yyyy.MM.dd.HH.mm.ss\").format(new Date());\n }", "public static String getDateTime() {\n\t\tString sDateTime=\"\";\n\t\ttry {\n\t\t\tSimpleDateFormat sdfDate = new SimpleDateFormat(\"dd-MM-yyyy\");\n\t\t\tSimpleDateFormat sdfTime = new SimpleDateFormat(\"HH:mm:ss\");\n\t\t\tDate now = new Date();\n\t\t\tString strDate = sdfDate.format(now);\n\t\t\tString strTime = sdfTime.format(now);\n\t\t\tstrTime = strTime.replace(\":\", \"-\");\n\t\t\tsDateTime = \"D\" + strDate + \"_T\" + strTime;\n\t\t} catch (Exception e) {\n\t\t\tSystem.err.println(e);\n\t\t}\n\t\treturn sDateTime;\n\t}", "public String getTimestamp() \n{\n Calendar now = Calendar.getInstance();\n return String.format(\"20%1$ty-%1$tm-%1$td_%1$tHh%1$tMm%1$tSs\", now);\n}", "private String getDate()\r\n\t{\r\n\t\tCalendar cal = Calendar.getInstance();\r\n\t\tSimpleDateFormat sdf = new SimpleDateFormat(\"yyyy-MM-dd HH:mm\");\r\n\t\treturn sdf.format(cal.getTime());\r\n\t}", "long getDate();", "public static String getTimeString() {\n SimpleDateFormat formatter = new SimpleDateFormat(\"EEE MMM dd HH:mm:ss yyyy\");\n return formatter.format(new java.util.Date());\n }", "java.lang.String getDate();", "public static String longToYYYYMMDDHHMM(long longTime)\r\n/* 157: */ {\r\n/* 158:232 */ SimpleDateFormat formatter = new SimpleDateFormat(\"yyyyMMdd HH:mm\");\r\n/* 159:233 */ Date strtodate = new Date(longTime);\r\n/* 160:234 */ return formatter.format(strtodate);\r\n/* 161: */ }", "private static String buildSequence() {\n\t\tSimpleDateFormat dateFormatGMT = new SimpleDateFormat(\"yyyyMMddHHmmssSSS\");\n\t\tdateFormatGMT.setTimeZone(TimeZone.getTimeZone(\"GMT\")); // set to Greenwich mean time.\n\t\treturn dateFormatGMT.format(new Date());\n\t}", "java.lang.String getStartDateYYYYMMDD();", "public String getTime() {\n String pattern = \"yyyy-MM-dd HH:mm:ss\";\n SimpleDateFormat simpleDateFormat = new SimpleDateFormat(pattern);\n\n String date = simpleDateFormat.format(new Date());\n return date;\n }", "private String getDateFromLong(Long msec) {\n DateFormat df = DateFormat.getDateTimeInstance();\n return df.format(new Date(msec));\n }", "public String getUserDateString() {\n\t\tString[] tmpArr = this.getUserDate();\n\t\tString year = tmpArr[0];\n\t\tString month = tmpArr[1];\n\t\tString day = tmpArr[2];\n\t\tString out = year + \"/\" + month + \"/\" + day;\n\t\treturn out;\n\t}", "public static String getDate() {\n return getDate(System.currentTimeMillis());\n }", "private String getFormattedDate(Integer format) {\n Date date = new Date(format * 1000L);\n DateFormat dateFormat = new SimpleDateFormat(\"yyyy-MM-dd HH:mm:ss.SSS\");\n dateFormat.setTimeZone(TimeZone.getTimeZone(\"Etc/UTC\"));\n Log.e(\"time\",dateFormat.format(date));\n return dateFormat.format(date);\n }", "public static String getPrintToFileTime() {\n @SuppressLint(\"SimpleDateFormat\") SimpleDateFormat sdf = new SimpleDateFormat(\"yyyyMMdd_HHmmss\");\n return sdf.format(System.currentTimeMillis());\n }", "public static String getDate()\r\n {\r\n Date now = new Date();\r\n DateFormat df = new SimpleDateFormat (\"yyyy-MM-dd'T'hh-mm-ss\");\r\n String currentTime = df.format(now);\r\n return currentTime; \r\n \r\n }", "private String formatTimeToICS(LocalDateTime date) {\n return DateTimeFormatter.ofPattern(\"YYYYMMddTHHmmss\").format(date);\n }", "public static String longToYYYYMMDD(long longTime)\r\n/* 143: */ {\r\n/* 144:206 */ SimpleDateFormat formatter = new SimpleDateFormat(\"yyyyMMdd\");\r\n/* 145:207 */ Date strtodate = new Date(longTime);\r\n/* 146:208 */ return formatter.format(strtodate);\r\n/* 147: */ }", "private String getDateTime() {\n SimpleDateFormat sdf = new SimpleDateFormat(\"[yyyy/MM/dd - HH:mm:ss]\");\n return sdf.format(new Date());\n }", "public static String timestamp(){\n\t\tDate date = new Date();\n\t\tDateFormat hourdateFormat = new SimpleDateFormat(\"dd/MM/yyyy HH:mm:ss \");\n\t\treturn hourdateFormat.format(date);\n\t}", "java.lang.String getToDate();", "public static String Milisec2DDMMYYYY(long ts) {\n\t\tif (ts == 0) {\n\t\t\treturn \"\";\n\t\t} else {\n\t\t\tjava.util.Calendar calendar = java.util.Calendar.getInstance();\n\t\t\tcalendar.setTime(new java.util.Date(ts));\n\n\t\t\tString strTemp = Integer.toString(calendar\n\t\t\t\t\t.get(calendar.DAY_OF_MONTH));\n\t\t\tif (calendar.get(calendar.DAY_OF_MONTH) < 10) {\n\t\t\t\tstrTemp = \"0\" + strTemp;\n\t\t\t}\n\t\t\tif (calendar.get(calendar.MONTH) + 1 < 10) {\n\t\t\t\treturn strTemp + \"/0\" + (calendar.get(calendar.MONTH) + 1)\n\t\t\t\t\t\t+ \"/\" + calendar.get(calendar.YEAR);\n\t\t\t} else {\n\t\t\t\treturn strTemp + \"/\" + (calendar.get(calendar.MONTH) + 1) + \"/\"\n\t\t\t\t\t\t+ calendar.get(calendar.YEAR);\n\t\t\t}\n\t\t}\n\t}", "private String getDateTime() {\n SimpleDateFormat sdf = new SimpleDateFormat(\"[yyyy/MM/dd - HH:mm:ss]\");\n return sdf.format(new Date());\n }", "private String getDateTime() {\n SimpleDateFormat sdf = new SimpleDateFormat(\"[yyyy/MM/dd - HH:mm:ss]\");\n return sdf.format(new Date());\n }", "private static String timeFor(Date date)\n\t{\n\t\tDateFormat df = new InternetDateFormat();\n\t\tString theTime = df.format(date);\n\t\treturn theTime;\n\t}", "public static String convertDateToSend(String gotdate){\n Calendar calendar = Calendar.getInstance();\n calendar.setTimeInMillis(Long.parseLong(gotdate));\n SimpleDateFormat inputFormat = new SimpleDateFormat(\"yyyyMMddHHmmss\");\n SimpleDateFormat outputFormat = new SimpleDateFormat(\"dd MMM yyyy\");\n /*Date parsedDate = null;\n try {\n parsedDate = inputFormat.parse(gotdate);\n } catch (ParseException e) {\n e.printStackTrace();\n }*/\n String formattedDate = outputFormat.format(calendar.getTime());\n return formattedDate;\n }", "public static String ShowDate(){\n Date date = new Date();\n SimpleDateFormat sdf = new SimpleDateFormat(\"HH:mm:ss.SS a\");\n String HH_MM = sdf.format(date);\n return HH_MM;\n }", "public String getTimeStamp() {\n Calendar instance = Calendar.getInstance();\n SimpleDateFormat sdf = new SimpleDateFormat(\"MMM-dd-yyyy-HH:mm:ss:ms\");\n return sdf.format(instance.getTime());\n }", "private String getDate(long timeStamp) {\n\n try {\n DateFormat sdf = new SimpleDateFormat(\"MMM d, yyyy\", getResources().getConfiguration().locale);\n Date netDate = (new Date(timeStamp * 1000));\n return sdf.format(netDate);\n } catch (Exception ex) {\n return \"xx\";\n }\n }", "private String getDate(long timeStamp) {\n\n try {\n DateFormat sdf = new SimpleDateFormat(\"MMM d, yyyy\", getResources().getConfiguration().locale);\n Date netDate = (new Date(timeStamp * 1000));\n return sdf.format(netDate);\n } catch (Exception ex) {\n return \"xx\";\n }\n }", "public static String date(Long time, Context context){\n\t\t\n //FORMAT TIME\n\t\tString res = \"\";\n Long tsLong = System.currentTimeMillis()/1000;\t\n \tlong dv = Long.valueOf(time)*1000;// its need to be in milisecond\n \tDate df = new java.util.Date(dv);\n \t//LESS THAN 24\n \tif((tsLong-time)<86400){\n \t\tDateFormat timeFormat = android.text.format.DateFormat.getTimeFormat(context);\n \t\tres = timeFormat.format(df);\n \t}else{\n \t\tDateFormat dateFormat = android.text.format.DateFormat.getMediumDateFormat(context);\n \t\tres = dateFormat.format(df);\n \t}\t\n \tif(time.equals(0l)){\n \t\t\n \t\tres = context.getResources().getString(R.string.never);\n \t}\n \treturn res;\n\t}", "public String getNiceDate(){\n\t\treturn sDateFormat.format(mTime);\n\t}", "public static String getTimeStamp() {\n\t\tDate date = new Date();\n\t\treturn date.toString().replaceAll(\":\", \"_\").replaceAll(\" \", \"_\");\n\n\t}", "private String getDateTime() {\n DateFormat dateFormat = new SimpleDateFormat(\"MM/dd/yyyy HH:mm\");\n Date date = new Date();\n return dateFormat.format(date);\n }", "public String generateLocalDateTime() {\n LocalDateTime localDateTime = LocalDateTime.now();\n DateTimeFormatter dateTimeFormatter = DateTimeFormatter.ofPattern(\"yyyyMMddHHmmss\");\n String formatLocalDateTime = localDateTime.format(dateTimeFormatter);\n return formatLocalDateTime;\n }", "public static String getDateTime(){\n String pattern = \"MM/dd/yyyy HH:mm:ss\";\n DateFormat df = new SimpleDateFormat(pattern);\n Date today = Calendar.getInstance().getTime();\n String todayAsString = df.format(today);\n return todayAsString;\n }", "public String getUniqTime(){\n String timeStamp = new SimpleDateFormat(\"yyyyMMdd_HHmmss\").format(Calendar.getInstance().getTime());\n return timeStamp;\n }", "public static String dateConv(int date) {\n\t\tDate mills = new Date(date*1000L); \n\t\tString pattern = \"dd-MM-yyyy\";\n\t\tSimpleDateFormat simpleDateFormat = new SimpleDateFormat(pattern);\n\t\tsimpleDateFormat.setTimeZone(TimeZone.getTimeZone(\"GMT+1\"));\n\t\tString formattedDate = simpleDateFormat.format(mills);\n\t\treturn formattedDate;\n\t}", "java.lang.String getTime();", "public String getDateString(){\n return Utilities.dateToString(date);\n }", "public static String getNowTime(){\r\n\t\tDate date = new Date();\r\n\t\tDateFormat format = new SimpleDateFormat(\"yyyy-MM-dd HH:mm:ss\");\r\n\t\tString time = format.format(date);\r\n\t\treturn time;\r\n\t}", "public static String getDate()\n {\n Date date = new Date();\n SimpleDateFormat dateFormat = new SimpleDateFormat(\"yyyy-MM-dd\");\n return dateFormat.format(date);\n }", "public static String getDateFormatForFileName() {\n final DateFormat sdf = new SimpleDateFormat(\"yyyyMMdd_HH-mm-ss\");\n return sdf.format(new Date());\n }", "public static String getPrintToDirectoryTime() {\n @SuppressLint(\"SimpleDateFormat\") SimpleDateFormat sdf = new SimpleDateFormat(\"MMdd\");\n return sdf.format(System.currentTimeMillis());\n }", "public String getSystemDateTime() {\n\t\tjava.text.SimpleDateFormat sdfDate = new java.text.SimpleDateFormat(\"yyyy/MM/dd\");\n java.text.SimpleDateFormat sdfTime = new java.text.SimpleDateFormat(\"HH:mm\");\n Date now = new Date();\n String strDate = sdfDate.format(now);\n String strTime = sdfTime.format(now);\n System.out.println(\"Date: \" + strDate);\n System.out.println(\"Time: \" + strTime); \n return \"date\"+strDate+\" \"+strTime;\n\t}", "private String getDate() {\n\t\tSimpleDateFormat parseFormat = new SimpleDateFormat(\"hh:mm a\");\n\t\tDate date = new Date();\n\t\tString s = parseFormat.format(date);\n\t\treturn s;\n\t}", "public String getTimeAndDate() {\n\t\t\tDateFormat dateFormat = new SimpleDateFormat(\"dd MMM hh:mm\");\n\t\t\tCalendar cal = Calendar.getInstance();\n\t\t\tString dateAndTime = dateFormat.format(cal.getTime());\n\t\t\treturn dateAndTime;\n\t\t}", "public static int getNowDate() {\n\t\tSimpleDateFormat dateFormat = new SimpleDateFormat(\"yyMMdd\");\n\t\treturn Integer.parseInt(dateFormat.format(new Date()));\n\t}", "public static String getDateTime() {\n\t\treturn new SimpleDateFormat(\"dd/MM/yyyy HH:mm:ss\").format(new Date());\n\t}", "private static String formatDate(long date) {\n Date systemDate = new java.util.Date(date * 1000L);\n // the format of your date\n SimpleDateFormat sdf = new java.text.SimpleDateFormat(\"yyyy-MM-dd HH:mm:ss\");\n // give a timezone reference for formatting (see comment at the bottom)\n sdf.setTimeZone(java.util.TimeZone.getTimeZone(\"GMT-4\"));\n String formattedDate = sdf.format(systemDate);\n return formattedDate;\n }", "public String getDateCreationLibelle() {\n\t\tDateTimeFormatter format = DateTimeFormatter.ofPattern(\"dd/MM/yyyy hh:mm:ss\");\n\t\treturn this.dateCreation.format(format);\n\t}", "long getDateTime();", "long getCreateTime();", "long getCreateTime();", "private String makeDateString(int day, int month, int year) {\n String str_month = \"\" + month;\n String str_day = \"\" + day;\n if (month < 10) {\n str_month = \"0\" + month;\n }\n if (day < 10) {\n str_day = \"0\" + day;\n }\n return year + \"-\" + str_month + \"-\" + str_day;\n }", "public static synchronized String utilDateToString(java.util.Date date) {\r\n\r\n SimpleDateFormat sdf = new SimpleDateFormat(\"yyyy-MM-dd HH:mm:ss\");\r\n return sdf.format(date.getTime());\r\n }", "private String getFecha() {\n\t\tLocalDateTime myDateObj = LocalDateTime.now();\n\t\tDateTimeFormatter myFormatObj = DateTimeFormatter.ofPattern(\"dd-MM-yyyy HH:mm:ss\");\n\t\tString formattedDate = myDateObj.format(myFormatObj);\n \n\t\treturn formattedDate;\n }", "public static String longToStringDate(long l)\r\n/* 212: */ {\r\n/* 213:293 */ SimpleDateFormat sdf = new SimpleDateFormat(\"yyyy-MM-dd hh:mm:ss\");\r\n/* 214:294 */ String date = sdf.format(new Date(l * 1000L));\r\n/* 215:295 */ return date;\r\n/* 216: */ }", "public String getDateString() {\n int year = date.get(Calendar.YEAR);\n int month = date.get(Calendar.MONTH); // month is stored from 0-11 so adjust +1 for final display\n int day_of_month = date.get(Calendar.DAY_OF_MONTH);\n return String.valueOf(month + 1) + '/' + String.valueOf(day_of_month) + '/' + year;\n }", "public static String getTimestamp() {\n\t\tCalendar cal = Calendar.getInstance();\n\t\t//define the format of time stamp\n\t\tSimpleDateFormat sdf = new SimpleDateFormat(\"yyyy-MM-dd HH:mm:ss\");\n\t\treturn sdf.format(cal.getTime());\n\n\t}", "long getContactRegistrationDate();", "public String getDate()\n {\n return day + \"/\" + month + \"/\" + year;\n }", "public static String getTimeStamp() {\r\n\r\n\t\tlong now = (System.currentTimeMillis() - startTime) / 1000;\r\n\r\n\t\tlong hours = (now / (60 * 60)) % 24;\r\n\t\tnow -= (hours / (60 * 60)) % 24;\r\n\r\n\t\tlong minutes = (now / 60) % 60;\r\n\t\tnow -= (minutes / 60) % 60;\r\n\r\n\t\tlong seconds = now % 60;\r\n\r\n\t return String.format(\"%02d:%02d:%02d\", hours, minutes, seconds);\r\n\t}", "public String date() throws Exception {\n\t\tDateFormat dateFormat = new SimpleDateFormat(\"dd_MM_yyyy_HH_mm_ss\");\n\t\t// get current date time with Date()\n\t\tDate date = new Date();\n\t\t// Now format the date\n\t\tString date1 = dateFormat.format(date);\n\t\t// System.out.println(date1);\n\t\treturn date1;\n\t}", "public static String dateToString(Date date){\n\t\tSimpleDateFormat formatter = new SimpleDateFormat(\"MMddyy\");\n\t\treturn formatter.format(date);\n\t}", "public void createDate(){\n SimpleDateFormat sdf = new SimpleDateFormat(\"yyyy_MM_dd\"); //TODO -HHmm si dejo diagonales separa bonito en dia, pero para hacer un armado de excel creo que debo hacer un for mas\n currentDateandTime = sdf.format(new Date());\n Log.e(TAG, \"todays date is: \"+currentDateandTime );\n\n}", "private static String getTime() {\n\t\tDate getDate = new Date();\n\t\tString timeFormat = \"M/d/yy hh:mma\";\n\t\tSimpleDateFormat sdf = new SimpleDateFormat(timeFormat);\n\t\treturn \"[\" + sdf.format(getDate) + \"]\\t\";\n\t}", "private static String time() throws Exception {\n\t\tDateFormat dateFormat = new SimpleDateFormat(\"HH-mm-ss \");\n\t\t// get current date time with Date()\n\t\tDate date = new Date();\n\t\t// Now format the date\n\t\tString date1 = dateFormat.format(date);\n\t\t// System.out.println(date1);\n\t\treturn date1;\n\t}", "public static String generate4DigitPin() {\n\t\tString longTime = String.valueOf(Calendar.getInstance().getTimeInMillis());\n\t\tint len = longTime.length();\n\n\t\treturn longTime.substring(len - 4);\n\t}", "public static String getTime() {\r\n\r\n\t\t//Gets current date and time\r\n\t\tDateFormat dateFormat = new SimpleDateFormat(\"yyyy-MM-dd HH:mm:ss\");\r\n\t\tDate date = new Date();\r\n\t\tcurrDateTime = dateFormat.format(date);\r\n\t\treturn currDateTime;\r\n\t}", "public static String getDate() {\n\t\tString\ttoday=\"\";\n\n\t\tCalendar Datenow=Calendar.getInstance();\n\t\tSimpleDateFormat formatter = new SimpleDateFormat(\"yyyy-MM-dd HH:mm:ss\");\n\t today = formatter.format(Datenow.getTime());\n\n\t return today;\n\t}", "public static String timestamp() {\n\t\tString t = new SimpleDateFormat(\"yyyy-MM-dd HH-mm-ss\").format(new Date());\n\t\t// File f=new\n\t\t// File(String.format(\"%s.%s\",t,RandomStringUtils.randomAlphanumeric(8)));\n\t\tSystem.out.println(\"Time is :\" + t);\n\t\treturn t;\n\t}", "@RequiresApi(api = Build.VERSION_CODES.N)\n private String getDateTime() {\n DateFormat dateFormat = new SimpleDateFormat(\"yyyy/MM/dd HH:mm:ss\");\n Date date = new Date();\n return dateFormat.format(date);\n }", "public String ConvertDate(){\r\n//\t\tDate date=JavaUtils.getSystemDate();\r\n//\t DateFormat df = new SimpleDateFormat(\"yyyy/MM/dd\");\r\n\t String pattern = \"yyyy-MM-dd\";\r\n\t SimpleDateFormat simpleDateFormat = new SimpleDateFormat(pattern);\r\n\r\n\t String date = simpleDateFormat.format(new Date());\r\n//\t System.out.println(date);\r\n\t \r\n//\t String s = df.format(date);\r\n//\t String result = s;\r\n//\t try {\r\n//\t date=df.parse(result);\r\n//\t } catch (ParseException e) {\r\n//\t // TODO Auto-generated catch block\r\n//\t e.printStackTrace();\r\n//\t }\r\n\t return date;\r\n\t }", "public Date getFormattedDate() {\r\n\t\tlog.debug(\"formatting \" + getDateTime());\r\n\t\ttry {\r\n\t\t\tDateFormat df = new SimpleDateFormat(\"yyyy-MM-dd'T'HH:mm:ss.mmmX\");\r\n\t\t\tif (Objects.nonNull(getDateTime())) {\r\n\t\t\t\treturn df.parse(getDateTime());\r\n\t\t\t}\r\n\t\t} catch (Exception e) {\r\n\t\t\tlog.warn(\"Illegal date format; returning epoch datetime.\");\r\n\t\t}\r\n\t\treturn new Date(0);\r\n\t}", "java.lang.String getFromDate();" ]
[ "0.7913427", "0.7624351", "0.7570983", "0.7238402", "0.716994", "0.71474934", "0.71142495", "0.7045356", "0.68999505", "0.68808347", "0.68446964", "0.6823716", "0.67602795", "0.67547303", "0.66501004", "0.66459817", "0.6574838", "0.6561677", "0.65386903", "0.6499834", "0.6499834", "0.6477983", "0.6472012", "0.6463344", "0.6458026", "0.64560276", "0.64346254", "0.64249796", "0.6413888", "0.64131844", "0.63742286", "0.6350309", "0.63447416", "0.6343309", "0.63366944", "0.631947", "0.62881964", "0.6268692", "0.62432384", "0.6219873", "0.62166697", "0.6213337", "0.62032783", "0.6193788", "0.61792135", "0.6165873", "0.6162572", "0.6159276", "0.6159276", "0.6148757", "0.6145845", "0.6139401", "0.61076224", "0.609793", "0.609793", "0.60860544", "0.60732526", "0.6063838", "0.6045407", "0.6042757", "0.60378325", "0.6031987", "0.60055673", "0.5998928", "0.59966016", "0.5989229", "0.5983423", "0.5980044", "0.59701663", "0.59300876", "0.5928164", "0.591092", "0.5906778", "0.5899577", "0.5894416", "0.5893528", "0.58914804", "0.58663905", "0.58663905", "0.58646", "0.58608025", "0.5855508", "0.5852153", "0.58257264", "0.58152056", "0.580741", "0.58019716", "0.57953864", "0.57920766", "0.5782527", "0.57804763", "0.57747304", "0.5773093", "0.57711506", "0.5762821", "0.5757149", "0.5753295", "0.57462305", "0.5739345", "0.57356113", "0.5731094" ]
0.0
-1
methoid to get date time in particular format wrt GMT,default is yyyyMMddHHmmss
public String getDateTime(Calendar calendar, String GMT, String DATE_TIME_FORMAT) throws Exception { int GMT_OFFSET_SECONDS = 0; try { GMT_OFFSET_SECONDS = getGMTOffSetSeconds(GMT); return getDateTime(calendar, GMT_OFFSET_SECONDS, DATE_TIME_FORMAT); } catch (Exception e) { throw new Exception("getDateTime : Invalid GMT :" + GMT + " : " + e.toString()); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static String getGMTTime() {\r\n\t\treturn getGMTTime(\"HH:mm:ss\");\r\n\t}", "public String getDateTime(Calendar cal, int GMT_OFFSET_SECONDS, String DATE_TIME_FORMAT) throws Exception {\n\n String sRetVal = \"\";\n String DefaultFormat = \"yyyyMMddHHmmss\";\n int GMT_OFFSET_DIFF = 0;\n try {\n\n //check for valid Calender values\n if (cal == null) {\n cal = Calendar.getInstance();\n }\n\n //check for valid FORMAT values\n if (DATE_TIME_FORMAT == null) {\n DATE_TIME_FORMAT = DefaultFormat;\n }\n if (DATE_TIME_FORMAT.trim().toUpperCase().equalsIgnoreCase(\"\")) {\n DATE_TIME_FORMAT = DefaultFormat;\n }\n\n //check GMT RAW OFF SET difference\n int CURR_GMT_OFFSET = TimeZone.getDefault().getRawOffset() / 1000;\n //in case Current GMT is GREATER THAN provided GMT\n if (CURR_GMT_OFFSET > GMT_OFFSET_SECONDS && GMT_OFFSET_SECONDS != 0) {\n if (GMT_OFFSET_SECONDS < 0) {\n GMT_OFFSET_DIFF = GMT_OFFSET_SECONDS - CURR_GMT_OFFSET;\n } else {\n GMT_OFFSET_DIFF = GMT_OFFSET_SECONDS - CURR_GMT_OFFSET;\n }\n\n //in case Current GMT is SMALLER THAN provided GMT\n } else if (CURR_GMT_OFFSET < GMT_OFFSET_SECONDS && GMT_OFFSET_SECONDS != 0) {\n if (GMT_OFFSET_SECONDS < 0) {\n GMT_OFFSET_DIFF = GMT_OFFSET_SECONDS - CURR_GMT_OFFSET;\n } else {\n GMT_OFFSET_DIFF = GMT_OFFSET_SECONDS - CURR_GMT_OFFSET;\n }\n }\n\n if (CURR_GMT_OFFSET == GMT_OFFSET_SECONDS) {\n GMT_OFFSET_DIFF = 0;\n }\n\n //setting calender datetime as per GMT\n cal.add(Calendar.SECOND, GMT_OFFSET_DIFF);\n\n //using SimpleDateFormat class\n sRetVal = new SimpleDateFormat(DATE_TIME_FORMAT).format(cal.getTime());\n return sRetVal;\n\n } catch (Exception e) {\n println(\"getDateTime : \" + GMT_OFFSET_SECONDS + \" : \" + e.toString());\n throw new Exception(\"getDateTime : \" + GMT_OFFSET_SECONDS + \" : \" + e.toString());\n } finally {\n }\n\n }", "public static String getGMTTime(String format) {\r\n\t\tfinal Date currentTime = new Date();\r\n\r\n\t\tfinal SimpleDateFormat sdf = new SimpleDateFormat(format);\r\n\r\n\t\tsdf.setTimeZone(TimeZone.getTimeZone(\"GMT\"));\r\n\t\treturn sdf.format(currentTime);\r\n\t}", "public static String getDateTime() {\n Calendar cal = Calendar.getInstance(TimeZone.getTimeZone(\"UTC\"));\n Date currentLocalTime = cal.getTime();\n SimpleDateFormat df = new SimpleDateFormat(\"yyyy-MM-dd HH:mm:ss.SSS\");\n df.setTimeZone(TimeZone.getTimeZone(\"UTC\"));\n String date = df.format(currentLocalTime);\n return date;\n }", "public static String getYYYYMMDDHHMMSS()\r\n/* 56: */ {\r\n/* 57: 68 */ String nowTime = \"\";\r\n/* 58: 69 */ Date now = new Date();\r\n/* 59: 70 */ SimpleDateFormat formatter = new SimpleDateFormat(\"yyyyMMddHHmmss\");\r\n/* 60: 71 */ nowTime = formatter.format(now);\r\n/* 61: 72 */ return nowTime;\r\n/* 62: */ }", "public String getTime() {\n String pattern = \"yyyy-MM-dd HH:mm:ss\";\n SimpleDateFormat simpleDateFormat = new SimpleDateFormat(pattern);\n\n String date = simpleDateFormat.format(new Date());\n return date;\n }", "private static String getDate() {\n return new SimpleDateFormat(\"yyyyMMddHHmmss\").format\n (new Date(System.currentTimeMillis()));\n }", "public String getSystemDateTime() {\n\t\tjava.text.SimpleDateFormat sdfDate = new java.text.SimpleDateFormat(\"yyyy/MM/dd\");\n java.text.SimpleDateFormat sdfTime = new java.text.SimpleDateFormat(\"HH:mm\");\n Date now = new Date();\n String strDate = sdfDate.format(now);\n String strTime = sdfTime.format(now);\n System.out.println(\"Date: \" + strDate);\n System.out.println(\"Time: \" + strTime); \n return \"date\"+strDate+\" \"+strTime;\n\t}", "public static String getDateTime() {\n\t\tString sDateTime=\"\";\n\t\ttry {\n\t\t\tSimpleDateFormat sdfDate = new SimpleDateFormat(\"dd-MM-yyyy\");\n\t\t\tSimpleDateFormat sdfTime = new SimpleDateFormat(\"HH:mm:ss\");\n\t\t\tDate now = new Date();\n\t\t\tString strDate = sdfDate.format(now);\n\t\t\tString strTime = sdfTime.format(now);\n\t\t\tstrTime = strTime.replace(\":\", \"-\");\n\t\t\tsDateTime = \"D\" + strDate + \"_T\" + strTime;\n\t\t} catch (Exception e) {\n\t\t\tSystem.err.println(e);\n\t\t}\n\t\treturn sDateTime;\n\t}", "String getTime(){\n\t\tCalendar c = Calendar.getInstance();\n int mseconds = c.get(Calendar.MILLISECOND);\n String currentDateandTime = mDateFormat.format(new Date()) + String.format(\"-%04d\", mseconds);\n \n return currentDateandTime;\n\t}", "private static Date getTime(String argGMT) {\r\n\t\tSimpleDateFormat dateFormatGmt = new SimpleDateFormat(\r\n\t\t\t\t\"yyyy-MMM-dd HH:mm:ss\");\r\n\t\tdateFormatGmt.setTimeZone(TimeZone.getTimeZone(argGMT));\r\n\r\n\t\t// Local time zone\r\n\t\tSimpleDateFormat dateFormatLocal = new SimpleDateFormat(\r\n\t\t\t\t\"yyyy-MMM-dd HH:mm:ss\");\r\n\r\n\t\t// Time in GMT\r\n\t\ttry {\r\n\t\t\treturn dateFormatLocal.parse(dateFormatGmt.format(new Date()));\r\n\t\t} catch (ParseException e) {\r\n\t\t\te.printStackTrace();\r\n\t\t}\r\n\t\treturn null;\r\n\t}", "private String getFormattedDate(Integer format) {\n Date date = new Date(format * 1000L);\n DateFormat dateFormat = new SimpleDateFormat(\"yyyy-MM-dd HH:mm:ss.SSS\");\n dateFormat.setTimeZone(TimeZone.getTimeZone(\"Etc/UTC\"));\n Log.e(\"time\",dateFormat.format(date));\n return dateFormat.format(date);\n }", "public static String getSystemDate()\n {\n\t DateFormat dateFormat= new SimpleDateFormat(\"_ddMMyyyy_HHmmss\");\n\t Date date = new Date();\n\t return dateFormat.format(date);\n }", "public static String ShowTimeinGMT(Calendar cal) {\n\t\tCalendar calendar = cal;\n\t\tStringBuilder _ret = new StringBuilder();\n\n\t\tif (cal == null) {\n\t\t\tcalendar = Calendar.getInstance(TimeZone.getTimeZone(\"GMT\"));\n\t\t}\n\n\t\t_ret.append(calendar.get(Calendar.DATE) + \"-\" + (calendar.get(Calendar.MONTH) + 1) + \"-\"\n\t\t\t\t+ calendar.get(Calendar.YEAR) + \" T \" + calendar.get(Calendar.HOUR_OF_DAY) + \":\"\n\t\t\t\t+ calendar.get(Calendar.MINUTE) + \":\" + calendar.get(Calendar.SECOND));\n\t\treturn _ret.toString();\n\t}", "public static String getTimeString() {\n SimpleDateFormat formatter = new SimpleDateFormat(\"EEE MMM dd HH:mm:ss yyyy\");\n return formatter.format(new java.util.Date());\n }", "private String getDate()\r\n\t{\r\n\t\tCalendar cal = Calendar.getInstance();\r\n\t\tSimpleDateFormat sdf = new SimpleDateFormat(\"yyyy-MM-dd HH:mm\");\r\n\t\treturn sdf.format(cal.getTime());\r\n\t}", "public LocalDateTime convertToGMT(ZonedDateTime time){\n ZoneId gmtZoneID = ZoneId.of(\"Etc/UTC\");\n ZonedDateTime gmtTime = time.withZoneSameInstant(gmtZoneID);\n return gmtTime.toLocalDateTime();\n }", "private String getDateTime() {\n SimpleDateFormat sdf = new SimpleDateFormat(\"[yyyy/MM/dd - HH:mm:ss]\");\n return sdf.format(new Date());\n }", "private String getDateTime() {\n SimpleDateFormat sdf = new SimpleDateFormat(\"[yyyy/MM/dd - HH:mm:ss]\");\n return sdf.format(new Date());\n }", "private String getDateTime() {\n SimpleDateFormat sdf = new SimpleDateFormat(\"[yyyy/MM/dd - HH:mm:ss]\");\n return sdf.format(new Date());\n }", "public String getSystemTime() {\n\t\tSimpleDateFormat dateTimeInGMT = new SimpleDateFormat(\"dd-MMM-yyyy hh\");\n\t\t// Setting the time zoneS\n\t\tdateTimeInGMT.setTimeZone(TimeZone.getTimeZone(\"America/New_York\"));\n\t\tString timeZone = dateTimeInGMT.format(new Date());\n\t\treturn timeZone;\n\n\t}", "java.lang.String getTime();", "private static String getDate()\n\t{\n\t\tString dateString = null;\n\t\tDate sysDate = new Date( System.currentTimeMillis() );\n\t\tSimpleDateFormat sdf = new SimpleDateFormat(\"dd-MM-yy HH:mm:ss\");\n\t\tdateString = sdf.format(sysDate);\n\t\treturn dateString;\n\t}", "public String getGMTString() {\n\t\treturn \"test GMT timezone\";\n\t}", "public static String getDateString(){\n\t\t\tCalendar now = Calendar.getInstance();\n\t\t\tSimpleDateFormat sdf = new SimpleDateFormat(\"yyyy-MM-dd__HH-mm-ss\");\n\t\t\treturn sdf.format(now.getTime());\n\t }", "private static String timeFor(Date date)\n\t{\n\t\tDateFormat df = new InternetDateFormat();\n\t\tString theTime = df.format(date);\n\t\treturn theTime;\n\t}", "String timeStamp() {\n\n\t\tCalendar now = Calendar.getInstance();\n\n\t\t String y = String.valueOf(now.get(now.YEAR));\n\t\t String mo = String.valueOf(now.get(now.MONTH)+1);\n\t\t String d = String.valueOf(now.get(now.DAY_OF_MONTH));\n\t\t String h = String.valueOf(now.get(now.HOUR_OF_DAY));\n\t\t String m = String.valueOf(now.get(now.MINUTE));\n\t\t String s = String.valueOf(now.get(now.SECOND));\n\t\t String ms = String.valueOf(now.get(now.MILLISECOND));\n\n\n\t return h + m + s + ms;\n\n\n\n }", "public static Date getDateNowSingl(){\n\t\tconfigDefaultsTimeZoneAndLocale();\r\n\t\t\r\n\t\t// o time millis é sempre GMT 0, a transformação fica por conta do Date\r\n\t\treturn new Date(System.currentTimeMillis()+getPropDefaultForAll(TIME_CORRECTION));\r\n\t}", "public static String getDate()\r\n {\r\n Date now = new Date();\r\n DateFormat df = new SimpleDateFormat (\"yyyy-MM-dd'T'hh-mm-ss\");\r\n String currentTime = df.format(now);\r\n return currentTime; \r\n \r\n }", "private static String getStamp() {\n\t\t\t return new SimpleDateFormat(\"yyyyMMddHHmmss\").format(new Date());\r\n\t\t}", "private String getFecha() {\n\t\tLocalDateTime myDateObj = LocalDateTime.now();\n\t\tDateTimeFormatter myFormatObj = DateTimeFormatter.ofPattern(\"dd-MM-yyyy HH:mm:ss\");\n\t\tString formattedDate = myDateObj.format(myFormatObj);\n \n\t\treturn formattedDate;\n }", "private String getDateTime() {\n DateFormat dateFormat = new SimpleDateFormat(\"MM/dd/yyyy HH:mm\");\n Date date = new Date();\n return dateFormat.format(date);\n }", "String getCreated_at();", "public String getTimeAndDate() {\n\t\t\tDateFormat dateFormat = new SimpleDateFormat(\"dd MMM hh:mm\");\n\t\t\tCalendar cal = Calendar.getInstance();\n\t\t\tString dateAndTime = dateFormat.format(cal.getTime());\n\t\t\treturn dateAndTime;\n\t\t}", "java.lang.String getToDate();", "public static String getNowAsTimestamp() {\r\n\r\n DateFormat dateFormat = new SimpleDateFormat(DATE_FORMAT_PATTERN);\r\n dateFormat.setTimeZone(TimeZone.getTimeZone(\"UTC\"));\r\n return dateFormat.format(new Date()).replaceAll(\"\\\\+0000\", \"Z\").replaceAll(\"([+-][0-9]{2}):([0-9]{2})\", \"$1$2\");\r\n }", "public String getDateTime(Calendar calendar, String GMT) throws Exception {\n return getDateTime(calendar, GMT, \"\");\n }", "public static Date getDateGMT(Date date) {\n Date dateGMT = new Date();\n if (date != null) {\n TimeZone timeZone = TimeZone.getTimeZone(\"ICT\");\n GregorianCalendar gregorianCalendar = new GregorianCalendar(timeZone);\n gregorianCalendar.setTime(date);\n gregorianCalendar.set(GregorianCalendar.HOUR, -8);\n dateGMT = gregorianCalendar.getTime();\n }\n return dateGMT;\n }", "public String getTimeString() {\n int hour = date.get(Calendar.HOUR);\n int minute = date.get(Calendar.MINUTE);\n\n String AM_PM = \"PM\";\n if (date.get(Calendar.AM_PM) == Calendar.AM) AM_PM = \"AM\";\n\n String hour_fixed = String.valueOf(hour);\n if (hour == 0) hour_fixed = \"12\";\n\n String minute_fixed = String.valueOf(minute);\n while (minute_fixed.length() < 2) {\n minute_fixed = \"0\" + minute_fixed;\n }\n\n return hour_fixed + \":\" + minute_fixed + ' ' + AM_PM;\n }", "public static String displayTimeDate(Calendar cal)\n\t{\n\t\tString out = \"\";\n\t\tint year = cal.get(Calendar.YEAR);\n\t\tint month = cal.get(Calendar.MONTH) + 1;\n\t\tint day = cal.get(Calendar.DAY_OF_MONTH);\n\t\tint hour = cal.get(Calendar.HOUR_OF_DAY);\n\t\tint minute = cal.get(Calendar.MINUTE);\n\t\tint second = cal.get(Calendar.SECOND);\n\t\tint zone = cal.get(Calendar.ZONE_OFFSET) / (60 * 60 * 1000) * 4;\n\t\t\n\t\tString year_str = String.valueOf(year);\n\t\tString month_str = String.valueOf(month);\n\t\tString day_str = String.valueOf(day);\n\t\tString hour_str = String.valueOf(hour);\n\t\tString minute_str = String.valueOf(minute);\n\t\tString second_str = String.valueOf(second);\n\t\tString zone_str = String.valueOf(zone);\n\t\t\n\t\tif (year_str.length() < 2) year_str = \"0\" + year_str;\n\t\tif (month_str.length() < 2) month_str = \"0\" + month_str;\n\t\tif (day_str.length() < 2) day_str = \"0\" + day_str;\n\t\tif (hour_str.length() < 2) hour_str = \"0\" + hour_str;\n\t\tif (minute_str.length() < 2) minute_str = \"0\" + minute_str;\n\t\tif (second_str.length() < 2) second_str = \"0\" + second_str;\n\t\t\n\t\tout = hour_str + \":\" + minute_str + \":\" + second_str + \" \";\n\t\tout = out + day_str + \"-\" + month_str + \"-\" + year_str; //+\" GMT\"+zone_str ;\n\t\treturn out;\n\t}", "OffsetDateTime creationTime();", "DateTime getTime();", "protected final static String getDateStamp() {\n\n\t\treturn\n\n\t\tnew SimpleDateFormat(\"MMM d, yyyy h:mm:ss a zzz\").format(new Date());\n\n\t}", "public String getTime() {\n boolean pastNoon = hour >= 12;\n if(pastNoon && hour == 12) {\n return hour + \"pm\";\n }\n else if(pastNoon) {\n return (hour - 12) + \"pm\";\n }\n else if(hour == 0) {\n return \"12am\";\n }\n else {\n return hour + \"am\";\n }\n }", "public Date getDateNow(){\n\t\tconfigDefaults(getProp(LOCALE), getProp(TIME_ZONE), null);\r\n\t\t\r\n\t\t// o time millis é sempre GMT 0, a transformação fica por conta do Date\r\n\t\treturn new Date(System.currentTimeMillis()+getProp(TIME_CORRECTION));\r\n\t}", "public String getTime(){\r\n\t\tDate date = new GregorianCalendar().getTime();\r\n\r\n\t\tString time= new SimpleDateFormat(\"HH:mm:ss\").format(date.getTime());\r\n\t\t\r\n\t\treturn time;\r\n\t}", "private String getDate() {\n\t\tSimpleDateFormat parseFormat = new SimpleDateFormat(\"hh:mm a\");\n\t\tDate date = new Date();\n\t\tString s = parseFormat.format(date);\n\t\treturn s;\n\t}", "private static String getTimeStamp()\r\n\t{\r\n\t\tDateFormat dateFormat = new SimpleDateFormat(\"yyyy-MM-dd_HH.mm.ss\");\r\n\t\tDate date = new Date();\r\n\t\treturn dateFormat.format(date);\r\n\t}", "public static String getNowTime(){\r\n\t\tDate date = new Date();\r\n\t\tDateFormat format = new SimpleDateFormat(\"yyyy-MM-dd HH:mm:ss\");\r\n\t\tString time = format.format(date);\r\n\t\treturn time;\r\n\t}", "public String getTimestamp() \n{\n Calendar now = Calendar.getInstance();\n return String.format(\"20%1$ty-%1$tm-%1$td_%1$tHh%1$tMm%1$tSs\", now);\n}", "OffsetDateTime timeCreated();", "private Date cvtToGmt( Date date )\r\n\t\t{\r\n\t\t TimeZone tz = TimeZone.getDefault();\r\n\t\t Date ret = new Date( date.getTime() - tz.getRawOffset() );\r\n\r\n\t\t // if we are now in DST, back off by the delta. Note that we are checking the GMT date, this is the KEY.\r\n\t\t if ( tz.inDaylightTime( ret ))\r\n\t\t {\r\n\t\t Date dstDate = new Date( ret.getTime() - tz.getDSTSavings() );\r\n\r\n\t\t // check to make sure we have not crossed back into standard time\r\n\t\t // this happens when we are on the cusp of DST (7pm the day before the change for PDT)\r\n\t\t if ( tz.inDaylightTime( dstDate ))\r\n\t\t {\r\n\t\t ret = dstDate;\r\n\t\t }\r\n\t\t }\r\n\r\n\t\t return ret;\r\n\t\t}", "private String formatTimeToICS(LocalDateTime date) {\n return DateTimeFormatter.ofPattern(\"YYYYMMddTHHmmss\").format(date);\n }", "public static String getTime() {\r\n\r\n\t\t//Gets current date and time\r\n\t\tDateFormat dateFormat = new SimpleDateFormat(\"yyyy-MM-dd HH:mm:ss\");\r\n\t\tDate date = new Date();\r\n\t\tcurrDateTime = dateFormat.format(date);\r\n\t\treturn currDateTime;\r\n\t}", "private String dateFormat(String date) {\n SimpleDateFormat df = new SimpleDateFormat(\"yyyy-MM-dd'T'HH:mm:ss.SSS'Z'\", Locale.ENGLISH);\n df.setTimeZone(TimeZone.getTimeZone(\"UTC\"));\n Date serverDate = null;\n String formattedDate = null;\n try {\n serverDate = df.parse(date);\n SimpleDateFormat outputFormat = new SimpleDateFormat(\"MMM dd yyyy, hh:mm\");\n\n outputFormat.setTimeZone(TimeZone.getDefault());\n\n formattedDate = outputFormat.format(serverDate);\n } catch (ParseException e) {\n e.printStackTrace();\n }\n return formattedDate;\n }", "@Deprecated\n public static String getGMTToLocalTime(String argDateTime, String argInFormat, String argOutFormat) {\n DateFormat dateFormat = new SimpleDateFormat(argInFormat, Locale.getDefault());\n SimpleDateFormat simpleDateFormat = new SimpleDateFormat(argOutFormat);\n //simpleDateFormat.setTimeZone(TimeZone.getTimeZone(Locale));\n //simpleDateFormat.setTimeZone(TimeZone.getDefault());\n dateFormat.setTimeZone(TimeZone.getTimeZone(\"GMT\"));\n simpleDateFormat.setTimeZone(TimeZone.getDefault());\n //System.out.println(\"-----+ \" + TimeZone.getDefault());\n try {\n Date date = dateFormat.parse(argDateTime);\n return simpleDateFormat.format(date);\n } catch (ParseException ex) {\n //ex.printStackTrace();\n return null;\n }\n //https://medium.com/@kosta.palash/converting-date-time-considering-time-zone-android-b389ff9d5c49\n //https://www.tutorialspoint.com/java/util/calendar_settimezone.htm\n //writeDate.setTimeZone(TimeZone.getTimeZone(\"GMT+04:00\"));\n //https://vectr.com/tmp/a1hCr4Gvwc/aaegiGLyoI\n //http://inloop.github.io/svg2android/\n }", "public String getAnserTime() {\r\n \tString time=null;\r\n\t\tif(anserTime!=null){\r\n\t\t\tSimpleDateFormat sf=new SimpleDateFormat(\"yyyy-MM-dd HH:mm:ss\");\r\n\t\t\ttime=sf.format(anserTime);\r\n\t\t}\r\n return time;\r\n }", "private static String getTime() {\n\t\tDate getDate = new Date();\n\t\tString timeFormat = \"M/d/yy hh:mma\";\n\t\tSimpleDateFormat sdf = new SimpleDateFormat(timeFormat);\n\t\treturn \"[\" + sdf.format(getDate) + \"]\\t\";\n\t}", "public String getDateTimeFormated(Context context){\n SimpleDateFormat sdf = new SimpleDateFormat(\"dd/MM/yyyy HH:mm:ss\"\n , context.getResources().getConfiguration().locale);\n sdf.setTimeZone(TimeZone.getDefault());\n return sdf.format(new Date(mDateTime));\n //setting the dateformat to dd/MM/yyyy HH:mm:ss which is how the date is displayed when a dream is saved\n }", "public static String getUTCDate(){\n \t SimpleDateFormat sdf = new SimpleDateFormat(\"MM-dd-yyyy hh:mm\");\n \t Calendar cal = Calendar.getInstance(TimeZone.getTimeZone(\"UTC\"));\n \t return sdf.format(cal.getTime());\n }", "UtcT time_stamp () throws BaseException;", "public static String getDateTimeGMT(String format, String timeZone) throws Exception {\n SimpleDateFormat dateFormatGmt = new SimpleDateFormat(format);\n dateFormatGmt.setTimeZone(TimeZone.getTimeZone(timeZone));\n return dateFormatGmt.format(new Date());\n }", "public String getYYYYMMDDhhmmssTime(Long time) {\n\t\tString result = \"\";\n\t\tSimpleDateFormat sdf = new SimpleDateFormat(\"YYYYMMDDhhmmss\");\n\t\tresult = sdf.format(new Date(time));\n\t\treturn result;\n\t}", "public Date getDate() {\n Calendar calendar = Calendar.getInstance(TimeZone.getTimeZone(\"GMT\"));\n calendar.set(Calendar.YEAR, year);\n calendar.set(Calendar.MONTH, month - 1); // MONTH is zero based\n calendar.set(Calendar.DAY_OF_MONTH, day);\n calendar.set(Calendar.HOUR_OF_DAY, hour);\n calendar.set(Calendar.MINUTE, minute);\n calendar.set(Calendar.SECOND, 0);\n calendar.set(Calendar.MILLISECOND, 0);\n return calendar.getTime();\n }", "public static String getDateTime(){\n String pattern = \"MM/dd/yyyy HH:mm:ss\";\n DateFormat df = new SimpleDateFormat(pattern);\n Date today = Calendar.getInstance().getTime();\n String todayAsString = df.format(today);\n return todayAsString;\n }", "public static Date getLocalUTCTime(){\r\n\t\tfinal Calendar cal=Calendar.getInstance();\r\n\t\tfinal int zoneOffset=cal.get(Calendar.ZONE_OFFSET);\r\n\t\tfinal int dstOffset=cal.get(Calendar.DST_OFFSET);\r\n\t\tcal.add(Calendar.MILLISECOND, -(zoneOffset+dstOffset));\r\n\t\treturn cal.getTime();\r\n\t}", "java.lang.String getServerTime();", "private String currentDateTime() {\n DateFormat df = new SimpleDateFormat(\"yyyy-MM-dd'T'HH:mm:ss.SSSZ\");\n String date = df.format(Calendar.getInstance().getTime());\n return date;\n }", "public Date getGmtCreated() {\n return gmtCreated;\n }", "public String getDateTime(){\n LocalDateTime ldt = LocalDateTime.ofInstant(Instant.ofEpochMilli(this.datePosted), ZoneId.systemDefault());\n String dateOnly = ldt.toString().substring(0, 10);\n String timeOnly = ldt.toString().substring(11, ldt.toString().length()-4);\n return dateOnly + \" at \" + timeOnly;\n }", "public static String epochToTimeGMT(long epoch)\n\t{\n\t\tSimpleDateFormat dateFormatGmt = new SimpleDateFormat(\"HHmm\");\n\t\tdateFormatGmt.setTimeZone(TimeZone.getTimeZone(\"GMT\"));\n\t\treturn dateFormatGmt.format(epoch);\n\t}", "public String getUTCTime(String timeZone, Calendar cal);", "public static String getDateTime() {\n\t\treturn new SimpleDateFormat(\"dd/MM/yyyy HH:mm:ss\").format(new Date());\n\t}", "public String getTime() {\n\t}", "java.lang.String getDate();", "public Date getSystemDateTime(){\n\t\tDate systemDate = new Date();\t\t\n\t\treturn systemDate;\n\t}", "public Date getGmtLogin() {\n return gmtLogin;\n }", "Date getAccessTime();", "public static String getYYYYMMDD()\r\n/* 65: */ {\r\n/* 66: 81 */ String nowTime = \"\";\r\n/* 67: 82 */ Date now = new Date();\r\n/* 68: 83 */ SimpleDateFormat formatter = new SimpleDateFormat(\"yyyyMMdd\");\r\n/* 69: 84 */ nowTime = formatter.format(now);\r\n/* 70: 85 */ return nowTime;\r\n/* 71: */ }", "public static String convertCalToBrokerTime(Calendar cal) {\r\n String result = \"\";\r\n Calendar gmtCal = DTUtil.convertToLondonCal(cal);\r\n SimpleDateFormat format1 = new SimpleDateFormat(\"yyyyMMdd HH:mm:ss\");\r\n String timeFMString = format1.format(gmtCal.getTime()) + \" GMT\";\r\n result = timeFMString;\r\n return result;\r\n }", "private String getISO8601Timestamp(long date) {\n SimpleDateFormat format = new SimpleDateFormat(TIMESTAMP_FORMAT);\n // Convert the date into YYYY-MM-DDThh:mm:ss.sss\n String result = format.format(date);\n // Get default time zone in +/-hhmm format\n TimeZone tz = TimeZone.getDefault();\n int offset = tz.getRawOffset();\n // Convert the timezone format from +/-hhmm to +/-hh:mm\n String formatTimeZone = String.format(TIMEZONE_FORMAT, offset >= 0 ? \"+\" : \"-\", offset / 3600000, (offset / 60000) % 60);\n return result + formatTimeZone;\n }", "String getDate();", "String getDate();", "String getDateString(Context context) {\n int flags = DateUtils.FORMAT_NO_NOON_MIDNIGHT | DateUtils.FORMAT_SHOW_TIME |\n DateUtils.FORMAT_ABBREV_ALL | DateUtils.FORMAT_SHOW_DATE |\n DateUtils.FORMAT_CAP_AMPM;\n return DateUtils.formatDateTime(context, mDeliveryTime, flags);\n }", "public Date getFormattedDate() {\r\n\t\tlog.debug(\"formatting \" + getDateTime());\r\n\t\ttry {\r\n\t\t\tDateFormat df = new SimpleDateFormat(\"yyyy-MM-dd'T'HH:mm:ss.mmmX\");\r\n\t\t\tif (Objects.nonNull(getDateTime())) {\r\n\t\t\t\treturn df.parse(getDateTime());\r\n\t\t\t}\r\n\t\t} catch (Exception e) {\r\n\t\t\tlog.warn(\"Illegal date format; returning epoch datetime.\");\r\n\t\t}\r\n\t\treturn new Date(0);\r\n\t}", "public static long getCurrentGMTTime() {\n\n\t\tTimeZone timezone = TimeZone.getTimeZone(STANDARD_TIME_ZONE);\n\t\tlong currentTime = System.currentTimeMillis();\n\t\treturn currentTime - timezone.getOffset(currentTime);\n\t}", "private static String getDateStr() {\n\t\tDate date = Calendar.getInstance().getTime();\n\t\tDateFormat dateFormat = new SimpleDateFormat(\"MMddyyy\");\n\t\tString dateStr = dateFormat.format(date);\n\t\treturn dateStr;\n\t}", "public static Date currentDate() {\n Date currentDate = new Date();\n SimpleDateFormat format = new SimpleDateFormat(\"yyyy-MM-dd HH:mm:ss\");\n format.setTimeZone(TimeZone.getTimeZone(\"gmt\"));\n String strTime = format.format(currentDate);\n\n SimpleDateFormat formatLocal = new SimpleDateFormat(\"yyyy-MM-dd HH:mm:ss\");\n\n try {\n currentDate = formatLocal.parse(strTime);\n } catch (ParseException e) {\n e.printStackTrace();\n }\n\n return currentDate;\n }", "private static String buildSequence() {\n\t\tSimpleDateFormat dateFormatGMT = new SimpleDateFormat(\"yyyyMMddHHmmssSSS\");\n\t\tdateFormatGMT.setTimeZone(TimeZone.getTimeZone(\"GMT\")); // set to Greenwich mean time.\n\t\treturn dateFormatGMT.format(new Date());\n\t}", "public String getDateTime() {\n\t\t\n\t\tDateTimeFormatter dateTimeFormatter = DateTimeFormatter.ofPattern(\"yyyy/MM/dd HH:mm:ss\"); \n\t\t\n\t\tLocalDateTime currentDateTime = LocalDateTime.now(); \n\t\t\n\t\treturn dateTimeFormatter.format(currentDateTime);\n\t}", "private String timeConversion() {\n Calendar local = Calendar.getInstance();\n Calendar GMT = Calendar.getInstance(TimeZone.getTimeZone(\"GMT\"));\n\n //Time from the PINPoint\n int hours, minutes, seconds, day, month, year;\n hours = (record[10] & 0xF8) >> 3;\n minutes = ((record[10] & 0x07) << 3) + ((record[11] & 0xE0) >> 5);\n seconds = ((record[11] & 0x1F) << 1) + ((record[12] & 0x80) >> 7);\n seconds += (record[12] & 0x7F) / 100;\n day = (record[13] & 0xF8) >> 3;\n month = ((record[13] & 0x07) << 1) + ((record[14] & 0x80) >> 7);\n year = (record[14] & 0x7F) + 2000;\n \n month--; //Months in java are 0-11, PINPoint = 1-12;\n\n //Set GMTs time to be the time from the PINPoint\n GMT.set(Calendar.DAY_OF_MONTH, day);\n GMT.set(Calendar.MONTH, month);\n GMT.set(Calendar.YEAR, year);\n GMT.set(Calendar.HOUR_OF_DAY, hours);\n GMT.set(Calendar.MINUTE, minutes);\n GMT.set(Calendar.SECOND, seconds);\n\n //Local is set to GMTs time but with the correct timezone\n local.setTimeInMillis(GMT.getTimeInMillis());\n\n //Set Local time to be the time converted from GMT\n int lHours, lMinutes, lSeconds, lDay, lMonth, lYear;\n lHours = local.get(Calendar.HOUR_OF_DAY);\n lMinutes = local.get(Calendar.MINUTE);\n lSeconds = local.get(Calendar.SECOND);\n lDay = local.get(Calendar.DAY_OF_MONTH);\n lMonth = local.get(Calendar.MONTH);\n\n lMonth++; //Months in java are 0-11, humans read 1-12\n\n lYear = local.get(Calendar.YEAR);\n\n return hR(lMonth) + \"/\" + hR(lDay) + \"/\" + lYear + \" \" + hR(lHours) + \":\" + hR(lMinutes) + \":\" + hR(lSeconds);\n }", "@RequiresApi(api = Build.VERSION_CODES.N)\n private String getDateTime() {\n DateFormat dateFormat = new SimpleDateFormat(\"yyyy/MM/dd HH:mm:ss\");\n Date date = new Date();\n return dateFormat.format(date);\n }", "public String getTimeZoneGmt() {\n return timeZoneGmt;\n }", "long getCreateTime();", "long getCreateTime();", "public String getLastmodifiedTimeView() {\r\n if (lastmodifiedTime != null) {\r\n lastmodifiedTimeView = DateUtils.dateToStr(lastmodifiedTime, DateUtils.YMD_DASH);\r\n }\r\n return lastmodifiedTimeView;\r\n }", "public Date getSentAt() {\n SimpleDateFormat sdf = new SimpleDateFormat(\"yyyy-MM-dd'T'HH:mm:ss'Z'\");\n Date d = null;\n try {\n d = sdf.parse(creationDate);\n } catch (ParseException e) {\n e.printStackTrace();\n }\n return d;\n }", "public String gmtToLocal(String gmtTime) {\n\t\tString localTime = \"\";\n\t\tcurrentFormat = new SimpleDateFormat(\"yyyy-MM-dd'T'HH:mm:ss'Z'\");\n\t\tcurrentFormat.setTimeZone(TimeZone.getTimeZone(\"UTC\"));\n\t\tDate date = null;\n\t\t\n\t\ttry {\n\t\t\t//date = currentFormat.parse(gmtTime);\n\t\t\tdate = parseDate(gmtTime,true);\n\t\t\n\t\t\n\t\t} catch (Exception e) {\n\t\t\tLogs.show(e);\n\t\t\t \n\t\t}\n\t\tcalendar = Calendar.getInstance();\n\t\tcurrentFormat.setTimeZone(calendar.getTimeZone());\n\t\tlocalTime = currentFormat.format(date);\n\t\treturn localTime;\n\t}", "long getDateTime();", "public String getTimeStamp() {\n Calendar instance = Calendar.getInstance();\n SimpleDateFormat sdf = new SimpleDateFormat(\"MMM-dd-yyyy-HH:mm:ss:ms\");\n return sdf.format(instance.getTime());\n }" ]
[ "0.7024169", "0.6679906", "0.66180986", "0.66126585", "0.65786195", "0.65542835", "0.6532641", "0.647099", "0.6465074", "0.64573383", "0.6453273", "0.64484704", "0.64291435", "0.6421075", "0.6414333", "0.64066654", "0.6394108", "0.639107", "0.639107", "0.6356067", "0.6350347", "0.63209933", "0.6319997", "0.63052297", "0.6269134", "0.6252874", "0.62448555", "0.62434024", "0.6238423", "0.62323797", "0.62141186", "0.6176626", "0.61739016", "0.61639035", "0.61609465", "0.61584765", "0.6147309", "0.614529", "0.6136885", "0.61062086", "0.6092304", "0.6081823", "0.6076688", "0.60718215", "0.6070708", "0.60634714", "0.60602987", "0.60548455", "0.6039555", "0.6037657", "0.60256076", "0.6024393", "0.60178673", "0.60106677", "0.6009674", "0.60090154", "0.6004545", "0.6003932", "0.59950125", "0.59914804", "0.5985963", "0.5975247", "0.5973838", "0.5971149", "0.5969728", "0.5965364", "0.595055", "0.5945495", "0.59440064", "0.5935725", "0.59289086", "0.5917147", "0.5906038", "0.5893735", "0.58875525", "0.58844566", "0.58833414", "0.58814305", "0.58794934", "0.5860207", "0.5849991", "0.5847717", "0.5847717", "0.58474046", "0.5832742", "0.58288485", "0.5821547", "0.58178264", "0.5800704", "0.57995576", "0.5797829", "0.57814467", "0.57813036", "0.57707375", "0.57707375", "0.5758272", "0.5754738", "0.5754563", "0.57476276", "0.5744902" ]
0.6280659
24
methoid to get date time in particular format wrt GMT, default is yyyyMMddHHmmss
public String getDateTime(Calendar cal, int GMT_OFFSET_SECONDS, String DATE_TIME_FORMAT) throws Exception { String sRetVal = ""; String DefaultFormat = "yyyyMMddHHmmss"; int GMT_OFFSET_DIFF = 0; try { //check for valid Calender values if (cal == null) { cal = Calendar.getInstance(); } //check for valid FORMAT values if (DATE_TIME_FORMAT == null) { DATE_TIME_FORMAT = DefaultFormat; } if (DATE_TIME_FORMAT.trim().toUpperCase().equalsIgnoreCase("")) { DATE_TIME_FORMAT = DefaultFormat; } //check GMT RAW OFF SET difference int CURR_GMT_OFFSET = TimeZone.getDefault().getRawOffset() / 1000; //in case Current GMT is GREATER THAN provided GMT if (CURR_GMT_OFFSET > GMT_OFFSET_SECONDS && GMT_OFFSET_SECONDS != 0) { if (GMT_OFFSET_SECONDS < 0) { GMT_OFFSET_DIFF = GMT_OFFSET_SECONDS - CURR_GMT_OFFSET; } else { GMT_OFFSET_DIFF = GMT_OFFSET_SECONDS - CURR_GMT_OFFSET; } //in case Current GMT is SMALLER THAN provided GMT } else if (CURR_GMT_OFFSET < GMT_OFFSET_SECONDS && GMT_OFFSET_SECONDS != 0) { if (GMT_OFFSET_SECONDS < 0) { GMT_OFFSET_DIFF = GMT_OFFSET_SECONDS - CURR_GMT_OFFSET; } else { GMT_OFFSET_DIFF = GMT_OFFSET_SECONDS - CURR_GMT_OFFSET; } } if (CURR_GMT_OFFSET == GMT_OFFSET_SECONDS) { GMT_OFFSET_DIFF = 0; } //setting calender datetime as per GMT cal.add(Calendar.SECOND, GMT_OFFSET_DIFF); //using SimpleDateFormat class sRetVal = new SimpleDateFormat(DATE_TIME_FORMAT).format(cal.getTime()); return sRetVal; } catch (Exception e) { println("getDateTime : " + GMT_OFFSET_SECONDS + " : " + e.toString()); throw new Exception("getDateTime : " + GMT_OFFSET_SECONDS + " : " + e.toString()); } finally { } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static String getGMTTime() {\r\n\t\treturn getGMTTime(\"HH:mm:ss\");\r\n\t}", "public static String getGMTTime(String format) {\r\n\t\tfinal Date currentTime = new Date();\r\n\r\n\t\tfinal SimpleDateFormat sdf = new SimpleDateFormat(format);\r\n\r\n\t\tsdf.setTimeZone(TimeZone.getTimeZone(\"GMT\"));\r\n\t\treturn sdf.format(currentTime);\r\n\t}", "public static String getDateTime() {\n Calendar cal = Calendar.getInstance(TimeZone.getTimeZone(\"UTC\"));\n Date currentLocalTime = cal.getTime();\n SimpleDateFormat df = new SimpleDateFormat(\"yyyy-MM-dd HH:mm:ss.SSS\");\n df.setTimeZone(TimeZone.getTimeZone(\"UTC\"));\n String date = df.format(currentLocalTime);\n return date;\n }", "private static Date getTime(String argGMT) {\r\n\t\tSimpleDateFormat dateFormatGmt = new SimpleDateFormat(\r\n\t\t\t\t\"yyyy-MMM-dd HH:mm:ss\");\r\n\t\tdateFormatGmt.setTimeZone(TimeZone.getTimeZone(argGMT));\r\n\r\n\t\t// Local time zone\r\n\t\tSimpleDateFormat dateFormatLocal = new SimpleDateFormat(\r\n\t\t\t\t\"yyyy-MMM-dd HH:mm:ss\");\r\n\r\n\t\t// Time in GMT\r\n\t\ttry {\r\n\t\t\treturn dateFormatLocal.parse(dateFormatGmt.format(new Date()));\r\n\t\t} catch (ParseException e) {\r\n\t\t\te.printStackTrace();\r\n\t\t}\r\n\t\treturn null;\r\n\t}", "public static String getYYYYMMDDHHMMSS()\r\n/* 56: */ {\r\n/* 57: 68 */ String nowTime = \"\";\r\n/* 58: 69 */ Date now = new Date();\r\n/* 59: 70 */ SimpleDateFormat formatter = new SimpleDateFormat(\"yyyyMMddHHmmss\");\r\n/* 60: 71 */ nowTime = formatter.format(now);\r\n/* 61: 72 */ return nowTime;\r\n/* 62: */ }", "public LocalDateTime convertToGMT(ZonedDateTime time){\n ZoneId gmtZoneID = ZoneId.of(\"Etc/UTC\");\n ZonedDateTime gmtTime = time.withZoneSameInstant(gmtZoneID);\n return gmtTime.toLocalDateTime();\n }", "public String getTime() {\n String pattern = \"yyyy-MM-dd HH:mm:ss\";\n SimpleDateFormat simpleDateFormat = new SimpleDateFormat(pattern);\n\n String date = simpleDateFormat.format(new Date());\n return date;\n }", "public static String ShowTimeinGMT(Calendar cal) {\n\t\tCalendar calendar = cal;\n\t\tStringBuilder _ret = new StringBuilder();\n\n\t\tif (cal == null) {\n\t\t\tcalendar = Calendar.getInstance(TimeZone.getTimeZone(\"GMT\"));\n\t\t}\n\n\t\t_ret.append(calendar.get(Calendar.DATE) + \"-\" + (calendar.get(Calendar.MONTH) + 1) + \"-\"\n\t\t\t\t+ calendar.get(Calendar.YEAR) + \" T \" + calendar.get(Calendar.HOUR_OF_DAY) + \":\"\n\t\t\t\t+ calendar.get(Calendar.MINUTE) + \":\" + calendar.get(Calendar.SECOND));\n\t\treturn _ret.toString();\n\t}", "private static String getDate() {\n return new SimpleDateFormat(\"yyyyMMddHHmmss\").format\n (new Date(System.currentTimeMillis()));\n }", "String getTime(){\n\t\tCalendar c = Calendar.getInstance();\n int mseconds = c.get(Calendar.MILLISECOND);\n String currentDateandTime = mDateFormat.format(new Date()) + String.format(\"-%04d\", mseconds);\n \n return currentDateandTime;\n\t}", "public String getDateTime(Calendar calendar, String GMT, String DATE_TIME_FORMAT) throws Exception {\n int GMT_OFFSET_SECONDS = 0;\n try {\n GMT_OFFSET_SECONDS = getGMTOffSetSeconds(GMT);\n return getDateTime(calendar, GMT_OFFSET_SECONDS, DATE_TIME_FORMAT);\n } catch (Exception e) {\n throw new Exception(\"getDateTime : Invalid GMT :\" + GMT + \" : \" + e.toString());\n }\n }", "public String getGMTString() {\n\t\treturn \"test GMT timezone\";\n\t}", "public static String getTimeString() {\n SimpleDateFormat formatter = new SimpleDateFormat(\"EEE MMM dd HH:mm:ss yyyy\");\n return formatter.format(new java.util.Date());\n }", "public static String getDateTime() {\n\t\tString sDateTime=\"\";\n\t\ttry {\n\t\t\tSimpleDateFormat sdfDate = new SimpleDateFormat(\"dd-MM-yyyy\");\n\t\t\tSimpleDateFormat sdfTime = new SimpleDateFormat(\"HH:mm:ss\");\n\t\t\tDate now = new Date();\n\t\t\tString strDate = sdfDate.format(now);\n\t\t\tString strTime = sdfTime.format(now);\n\t\t\tstrTime = strTime.replace(\":\", \"-\");\n\t\t\tsDateTime = \"D\" + strDate + \"_T\" + strTime;\n\t\t} catch (Exception e) {\n\t\t\tSystem.err.println(e);\n\t\t}\n\t\treturn sDateTime;\n\t}", "public String getSystemDateTime() {\n\t\tjava.text.SimpleDateFormat sdfDate = new java.text.SimpleDateFormat(\"yyyy/MM/dd\");\n java.text.SimpleDateFormat sdfTime = new java.text.SimpleDateFormat(\"HH:mm\");\n Date now = new Date();\n String strDate = sdfDate.format(now);\n String strTime = sdfTime.format(now);\n System.out.println(\"Date: \" + strDate);\n System.out.println(\"Time: \" + strTime); \n return \"date\"+strDate+\" \"+strTime;\n\t}", "java.lang.String getTime();", "public static String getSystemDate()\n {\n\t DateFormat dateFormat= new SimpleDateFormat(\"_ddMMyyyy_HHmmss\");\n\t Date date = new Date();\n\t return dateFormat.format(date);\n }", "private String getDate()\r\n\t{\r\n\t\tCalendar cal = Calendar.getInstance();\r\n\t\tSimpleDateFormat sdf = new SimpleDateFormat(\"yyyy-MM-dd HH:mm\");\r\n\t\treturn sdf.format(cal.getTime());\r\n\t}", "public String getDateTime(Calendar calendar, String GMT) throws Exception {\n return getDateTime(calendar, GMT, \"\");\n }", "private String getFormattedDate(Integer format) {\n Date date = new Date(format * 1000L);\n DateFormat dateFormat = new SimpleDateFormat(\"yyyy-MM-dd HH:mm:ss.SSS\");\n dateFormat.setTimeZone(TimeZone.getTimeZone(\"Etc/UTC\"));\n Log.e(\"time\",dateFormat.format(date));\n return dateFormat.format(date);\n }", "public String getSystemTime() {\n\t\tSimpleDateFormat dateTimeInGMT = new SimpleDateFormat(\"dd-MMM-yyyy hh\");\n\t\t// Setting the time zoneS\n\t\tdateTimeInGMT.setTimeZone(TimeZone.getTimeZone(\"America/New_York\"));\n\t\tString timeZone = dateTimeInGMT.format(new Date());\n\t\treturn timeZone;\n\n\t}", "private String getDateTime() {\n SimpleDateFormat sdf = new SimpleDateFormat(\"[yyyy/MM/dd - HH:mm:ss]\");\n return sdf.format(new Date());\n }", "private String getDateTime() {\n SimpleDateFormat sdf = new SimpleDateFormat(\"[yyyy/MM/dd - HH:mm:ss]\");\n return sdf.format(new Date());\n }", "private String getDateTime() {\n SimpleDateFormat sdf = new SimpleDateFormat(\"[yyyy/MM/dd - HH:mm:ss]\");\n return sdf.format(new Date());\n }", "public static Date getDateNowSingl(){\n\t\tconfigDefaultsTimeZoneAndLocale();\r\n\t\t\r\n\t\t// o time millis é sempre GMT 0, a transformação fica por conta do Date\r\n\t\treturn new Date(System.currentTimeMillis()+getPropDefaultForAll(TIME_CORRECTION));\r\n\t}", "private static String getDate()\n\t{\n\t\tString dateString = null;\n\t\tDate sysDate = new Date( System.currentTimeMillis() );\n\t\tSimpleDateFormat sdf = new SimpleDateFormat(\"dd-MM-yy HH:mm:ss\");\n\t\tdateString = sdf.format(sysDate);\n\t\treturn dateString;\n\t}", "private static String timeFor(Date date)\n\t{\n\t\tDateFormat df = new InternetDateFormat();\n\t\tString theTime = df.format(date);\n\t\treturn theTime;\n\t}", "public static Date getDateGMT(Date date) {\n Date dateGMT = new Date();\n if (date != null) {\n TimeZone timeZone = TimeZone.getTimeZone(\"ICT\");\n GregorianCalendar gregorianCalendar = new GregorianCalendar(timeZone);\n gregorianCalendar.setTime(date);\n gregorianCalendar.set(GregorianCalendar.HOUR, -8);\n dateGMT = gregorianCalendar.getTime();\n }\n return dateGMT;\n }", "DateTime getTime();", "public static String getDate()\r\n {\r\n Date now = new Date();\r\n DateFormat df = new SimpleDateFormat (\"yyyy-MM-dd'T'hh-mm-ss\");\r\n String currentTime = df.format(now);\r\n return currentTime; \r\n \r\n }", "public String getTimeString() {\n int hour = date.get(Calendar.HOUR);\n int minute = date.get(Calendar.MINUTE);\n\n String AM_PM = \"PM\";\n if (date.get(Calendar.AM_PM) == Calendar.AM) AM_PM = \"AM\";\n\n String hour_fixed = String.valueOf(hour);\n if (hour == 0) hour_fixed = \"12\";\n\n String minute_fixed = String.valueOf(minute);\n while (minute_fixed.length() < 2) {\n minute_fixed = \"0\" + minute_fixed;\n }\n\n return hour_fixed + \":\" + minute_fixed + ' ' + AM_PM;\n }", "OffsetDateTime creationTime();", "public static String getNowAsTimestamp() {\r\n\r\n DateFormat dateFormat = new SimpleDateFormat(DATE_FORMAT_PATTERN);\r\n dateFormat.setTimeZone(TimeZone.getTimeZone(\"UTC\"));\r\n return dateFormat.format(new Date()).replaceAll(\"\\\\+0000\", \"Z\").replaceAll(\"([+-][0-9]{2}):([0-9]{2})\", \"$1$2\");\r\n }", "private String getFecha() {\n\t\tLocalDateTime myDateObj = LocalDateTime.now();\n\t\tDateTimeFormatter myFormatObj = DateTimeFormatter.ofPattern(\"dd-MM-yyyy HH:mm:ss\");\n\t\tString formattedDate = myDateObj.format(myFormatObj);\n \n\t\treturn formattedDate;\n }", "public static String getDateString(){\n\t\t\tCalendar now = Calendar.getInstance();\n\t\t\tSimpleDateFormat sdf = new SimpleDateFormat(\"yyyy-MM-dd__HH-mm-ss\");\n\t\t\treturn sdf.format(now.getTime());\n\t }", "String getCreated_at();", "String timeStamp() {\n\n\t\tCalendar now = Calendar.getInstance();\n\n\t\t String y = String.valueOf(now.get(now.YEAR));\n\t\t String mo = String.valueOf(now.get(now.MONTH)+1);\n\t\t String d = String.valueOf(now.get(now.DAY_OF_MONTH));\n\t\t String h = String.valueOf(now.get(now.HOUR_OF_DAY));\n\t\t String m = String.valueOf(now.get(now.MINUTE));\n\t\t String s = String.valueOf(now.get(now.SECOND));\n\t\t String ms = String.valueOf(now.get(now.MILLISECOND));\n\n\n\t return h + m + s + ms;\n\n\n\n }", "public String getTimeAndDate() {\n\t\t\tDateFormat dateFormat = new SimpleDateFormat(\"dd MMM hh:mm\");\n\t\t\tCalendar cal = Calendar.getInstance();\n\t\t\tString dateAndTime = dateFormat.format(cal.getTime());\n\t\t\treturn dateAndTime;\n\t\t}", "private String getDateTime() {\n DateFormat dateFormat = new SimpleDateFormat(\"MM/dd/yyyy HH:mm\");\n Date date = new Date();\n return dateFormat.format(date);\n }", "public static String getDateTimeGMT(String format, String timeZone) throws Exception {\n SimpleDateFormat dateFormatGmt = new SimpleDateFormat(format);\n dateFormatGmt.setTimeZone(TimeZone.getTimeZone(timeZone));\n return dateFormatGmt.format(new Date());\n }", "OffsetDateTime timeCreated();", "java.lang.String getToDate();", "private static String getStamp() {\n\t\t\t return new SimpleDateFormat(\"yyyyMMddHHmmss\").format(new Date());\r\n\t\t}", "@Deprecated\n public static String getGMTToLocalTime(String argDateTime, String argInFormat, String argOutFormat) {\n DateFormat dateFormat = new SimpleDateFormat(argInFormat, Locale.getDefault());\n SimpleDateFormat simpleDateFormat = new SimpleDateFormat(argOutFormat);\n //simpleDateFormat.setTimeZone(TimeZone.getTimeZone(Locale));\n //simpleDateFormat.setTimeZone(TimeZone.getDefault());\n dateFormat.setTimeZone(TimeZone.getTimeZone(\"GMT\"));\n simpleDateFormat.setTimeZone(TimeZone.getDefault());\n //System.out.println(\"-----+ \" + TimeZone.getDefault());\n try {\n Date date = dateFormat.parse(argDateTime);\n return simpleDateFormat.format(date);\n } catch (ParseException ex) {\n //ex.printStackTrace();\n return null;\n }\n //https://medium.com/@kosta.palash/converting-date-time-considering-time-zone-android-b389ff9d5c49\n //https://www.tutorialspoint.com/java/util/calendar_settimezone.htm\n //writeDate.setTimeZone(TimeZone.getTimeZone(\"GMT+04:00\"));\n //https://vectr.com/tmp/a1hCr4Gvwc/aaegiGLyoI\n //http://inloop.github.io/svg2android/\n }", "public Date getDate() {\n Calendar calendar = Calendar.getInstance(TimeZone.getTimeZone(\"GMT\"));\n calendar.set(Calendar.YEAR, year);\n calendar.set(Calendar.MONTH, month - 1); // MONTH is zero based\n calendar.set(Calendar.DAY_OF_MONTH, day);\n calendar.set(Calendar.HOUR_OF_DAY, hour);\n calendar.set(Calendar.MINUTE, minute);\n calendar.set(Calendar.SECOND, 0);\n calendar.set(Calendar.MILLISECOND, 0);\n return calendar.getTime();\n }", "public String getTime() {\n boolean pastNoon = hour >= 12;\n if(pastNoon && hour == 12) {\n return hour + \"pm\";\n }\n else if(pastNoon) {\n return (hour - 12) + \"pm\";\n }\n else if(hour == 0) {\n return \"12am\";\n }\n else {\n return hour + \"am\";\n }\n }", "public Date getDateNow(){\n\t\tconfigDefaults(getProp(LOCALE), getProp(TIME_ZONE), null);\r\n\t\t\r\n\t\t// o time millis é sempre GMT 0, a transformação fica por conta do Date\r\n\t\treturn new Date(System.currentTimeMillis()+getProp(TIME_CORRECTION));\r\n\t}", "private Date cvtToGmt( Date date )\r\n\t\t{\r\n\t\t TimeZone tz = TimeZone.getDefault();\r\n\t\t Date ret = new Date( date.getTime() - tz.getRawOffset() );\r\n\r\n\t\t // if we are now in DST, back off by the delta. Note that we are checking the GMT date, this is the KEY.\r\n\t\t if ( tz.inDaylightTime( ret ))\r\n\t\t {\r\n\t\t Date dstDate = new Date( ret.getTime() - tz.getDSTSavings() );\r\n\r\n\t\t // check to make sure we have not crossed back into standard time\r\n\t\t // this happens when we are on the cusp of DST (7pm the day before the change for PDT)\r\n\t\t if ( tz.inDaylightTime( dstDate ))\r\n\t\t {\r\n\t\t ret = dstDate;\r\n\t\t }\r\n\t\t }\r\n\r\n\t\t return ret;\r\n\t\t}", "public static String displayTimeDate(Calendar cal)\n\t{\n\t\tString out = \"\";\n\t\tint year = cal.get(Calendar.YEAR);\n\t\tint month = cal.get(Calendar.MONTH) + 1;\n\t\tint day = cal.get(Calendar.DAY_OF_MONTH);\n\t\tint hour = cal.get(Calendar.HOUR_OF_DAY);\n\t\tint minute = cal.get(Calendar.MINUTE);\n\t\tint second = cal.get(Calendar.SECOND);\n\t\tint zone = cal.get(Calendar.ZONE_OFFSET) / (60 * 60 * 1000) * 4;\n\t\t\n\t\tString year_str = String.valueOf(year);\n\t\tString month_str = String.valueOf(month);\n\t\tString day_str = String.valueOf(day);\n\t\tString hour_str = String.valueOf(hour);\n\t\tString minute_str = String.valueOf(minute);\n\t\tString second_str = String.valueOf(second);\n\t\tString zone_str = String.valueOf(zone);\n\t\t\n\t\tif (year_str.length() < 2) year_str = \"0\" + year_str;\n\t\tif (month_str.length() < 2) month_str = \"0\" + month_str;\n\t\tif (day_str.length() < 2) day_str = \"0\" + day_str;\n\t\tif (hour_str.length() < 2) hour_str = \"0\" + hour_str;\n\t\tif (minute_str.length() < 2) minute_str = \"0\" + minute_str;\n\t\tif (second_str.length() < 2) second_str = \"0\" + second_str;\n\t\t\n\t\tout = hour_str + \":\" + minute_str + \":\" + second_str + \" \";\n\t\tout = out + day_str + \"-\" + month_str + \"-\" + year_str; //+\" GMT\"+zone_str ;\n\t\treturn out;\n\t}", "private String getDate() {\n\t\tSimpleDateFormat parseFormat = new SimpleDateFormat(\"hh:mm a\");\n\t\tDate date = new Date();\n\t\tString s = parseFormat.format(date);\n\t\treturn s;\n\t}", "public static String epochToTimeGMT(long epoch)\n\t{\n\t\tSimpleDateFormat dateFormatGmt = new SimpleDateFormat(\"HHmm\");\n\t\tdateFormatGmt.setTimeZone(TimeZone.getTimeZone(\"GMT\"));\n\t\treturn dateFormatGmt.format(epoch);\n\t}", "UtcT time_stamp () throws BaseException;", "public String getTime(){\r\n\t\tDate date = new GregorianCalendar().getTime();\r\n\r\n\t\tString time= new SimpleDateFormat(\"HH:mm:ss\").format(date.getTime());\r\n\t\t\r\n\t\treturn time;\r\n\t}", "public String getUTCTime(String timeZone, Calendar cal);", "protected final static String getDateStamp() {\n\n\t\treturn\n\n\t\tnew SimpleDateFormat(\"MMM d, yyyy h:mm:ss a zzz\").format(new Date());\n\n\t}", "public Date getGmtCreated() {\n return gmtCreated;\n }", "public static Date getLocalUTCTime(){\r\n\t\tfinal Calendar cal=Calendar.getInstance();\r\n\t\tfinal int zoneOffset=cal.get(Calendar.ZONE_OFFSET);\r\n\t\tfinal int dstOffset=cal.get(Calendar.DST_OFFSET);\r\n\t\tcal.add(Calendar.MILLISECOND, -(zoneOffset+dstOffset));\r\n\t\treturn cal.getTime();\r\n\t}", "public static String getUTCDate(){\n \t SimpleDateFormat sdf = new SimpleDateFormat(\"MM-dd-yyyy hh:mm\");\n \t Calendar cal = Calendar.getInstance(TimeZone.getTimeZone(\"UTC\"));\n \t return sdf.format(cal.getTime());\n }", "public static String getNowTime(){\r\n\t\tDate date = new Date();\r\n\t\tDateFormat format = new SimpleDateFormat(\"yyyy-MM-dd HH:mm:ss\");\r\n\t\tString time = format.format(date);\r\n\t\treturn time;\r\n\t}", "private static String getTime() {\n\t\tDate getDate = new Date();\n\t\tString timeFormat = \"M/d/yy hh:mma\";\n\t\tSimpleDateFormat sdf = new SimpleDateFormat(timeFormat);\n\t\treturn \"[\" + sdf.format(getDate) + \"]\\t\";\n\t}", "java.lang.String getServerTime();", "public String getTimestamp() \n{\n Calendar now = Calendar.getInstance();\n return String.format(\"20%1$ty-%1$tm-%1$td_%1$tHh%1$tMm%1$tSs\", now);\n}", "public static String getTime() {\r\n\r\n\t\t//Gets current date and time\r\n\t\tDateFormat dateFormat = new SimpleDateFormat(\"yyyy-MM-dd HH:mm:ss\");\r\n\t\tDate date = new Date();\r\n\t\tcurrDateTime = dateFormat.format(date);\r\n\t\treturn currDateTime;\r\n\t}", "private String formatTimeToICS(LocalDateTime date) {\n return DateTimeFormatter.ofPattern(\"YYYYMMddTHHmmss\").format(date);\n }", "public static long getCurrentGMTTime() {\n\n\t\tTimeZone timezone = TimeZone.getTimeZone(STANDARD_TIME_ZONE);\n\t\tlong currentTime = System.currentTimeMillis();\n\t\treturn currentTime - timezone.getOffset(currentTime);\n\t}", "public String getAnserTime() {\r\n \tString time=null;\r\n\t\tif(anserTime!=null){\r\n\t\t\tSimpleDateFormat sf=new SimpleDateFormat(\"yyyy-MM-dd HH:mm:ss\");\r\n\t\t\ttime=sf.format(anserTime);\r\n\t\t}\r\n return time;\r\n }", "private String dateFormat(String date) {\n SimpleDateFormat df = new SimpleDateFormat(\"yyyy-MM-dd'T'HH:mm:ss.SSS'Z'\", Locale.ENGLISH);\n df.setTimeZone(TimeZone.getTimeZone(\"UTC\"));\n Date serverDate = null;\n String formattedDate = null;\n try {\n serverDate = df.parse(date);\n SimpleDateFormat outputFormat = new SimpleDateFormat(\"MMM dd yyyy, hh:mm\");\n\n outputFormat.setTimeZone(TimeZone.getDefault());\n\n formattedDate = outputFormat.format(serverDate);\n } catch (ParseException e) {\n e.printStackTrace();\n }\n return formattedDate;\n }", "Date getAccessTime();", "private static String getTimeStamp()\r\n\t{\r\n\t\tDateFormat dateFormat = new SimpleDateFormat(\"yyyy-MM-dd_HH.mm.ss\");\r\n\t\tDate date = new Date();\r\n\t\treturn dateFormat.format(date);\r\n\t}", "public Date getGmtLogin() {\n return gmtLogin;\n }", "public String getYYYYMMDDhhmmssTime(Long time) {\n\t\tString result = \"\";\n\t\tSimpleDateFormat sdf = new SimpleDateFormat(\"YYYYMMDDhhmmss\");\n\t\tresult = sdf.format(new Date(time));\n\t\treturn result;\n\t}", "public static String getDateTime() {\n\t\treturn new SimpleDateFormat(\"dd/MM/yyyy HH:mm:ss\").format(new Date());\n\t}", "public String getTime() {\n\t}", "private String currentDateTime() {\n DateFormat df = new SimpleDateFormat(\"yyyy-MM-dd'T'HH:mm:ss.SSSZ\");\n String date = df.format(Calendar.getInstance().getTime());\n return date;\n }", "public String getDateTime(){\n LocalDateTime ldt = LocalDateTime.ofInstant(Instant.ofEpochMilli(this.datePosted), ZoneId.systemDefault());\n String dateOnly = ldt.toString().substring(0, 10);\n String timeOnly = ldt.toString().substring(11, ldt.toString().length()-4);\n return dateOnly + \" at \" + timeOnly;\n }", "public Date getFormattedDate() {\r\n\t\tlog.debug(\"formatting \" + getDateTime());\r\n\t\ttry {\r\n\t\t\tDateFormat df = new SimpleDateFormat(\"yyyy-MM-dd'T'HH:mm:ss.mmmX\");\r\n\t\t\tif (Objects.nonNull(getDateTime())) {\r\n\t\t\t\treturn df.parse(getDateTime());\r\n\t\t\t}\r\n\t\t} catch (Exception e) {\r\n\t\t\tlog.warn(\"Illegal date format; returning epoch datetime.\");\r\n\t\t}\r\n\t\treturn new Date(0);\r\n\t}", "public static String getDateTime(){\n String pattern = \"MM/dd/yyyy HH:mm:ss\";\n DateFormat df = new SimpleDateFormat(pattern);\n Date today = Calendar.getInstance().getTime();\n String todayAsString = df.format(today);\n return todayAsString;\n }", "public String getDateTimeFormated(Context context){\n SimpleDateFormat sdf = new SimpleDateFormat(\"dd/MM/yyyy HH:mm:ss\"\n , context.getResources().getConfiguration().locale);\n sdf.setTimeZone(TimeZone.getDefault());\n return sdf.format(new Date(mDateTime));\n //setting the dateformat to dd/MM/yyyy HH:mm:ss which is how the date is displayed when a dream is saved\n }", "public String getTimeZoneGmt() {\n return timeZoneGmt;\n }", "java.lang.String getDate();", "public static String convertCalToBrokerTime(Calendar cal) {\r\n String result = \"\";\r\n Calendar gmtCal = DTUtil.convertToLondonCal(cal);\r\n SimpleDateFormat format1 = new SimpleDateFormat(\"yyyyMMdd HH:mm:ss\");\r\n String timeFMString = format1.format(gmtCal.getTime()) + \" GMT\";\r\n result = timeFMString;\r\n return result;\r\n }", "private String timeConversion() {\n Calendar local = Calendar.getInstance();\n Calendar GMT = Calendar.getInstance(TimeZone.getTimeZone(\"GMT\"));\n\n //Time from the PINPoint\n int hours, minutes, seconds, day, month, year;\n hours = (record[10] & 0xF8) >> 3;\n minutes = ((record[10] & 0x07) << 3) + ((record[11] & 0xE0) >> 5);\n seconds = ((record[11] & 0x1F) << 1) + ((record[12] & 0x80) >> 7);\n seconds += (record[12] & 0x7F) / 100;\n day = (record[13] & 0xF8) >> 3;\n month = ((record[13] & 0x07) << 1) + ((record[14] & 0x80) >> 7);\n year = (record[14] & 0x7F) + 2000;\n \n month--; //Months in java are 0-11, PINPoint = 1-12;\n\n //Set GMTs time to be the time from the PINPoint\n GMT.set(Calendar.DAY_OF_MONTH, day);\n GMT.set(Calendar.MONTH, month);\n GMT.set(Calendar.YEAR, year);\n GMT.set(Calendar.HOUR_OF_DAY, hours);\n GMT.set(Calendar.MINUTE, minutes);\n GMT.set(Calendar.SECOND, seconds);\n\n //Local is set to GMTs time but with the correct timezone\n local.setTimeInMillis(GMT.getTimeInMillis());\n\n //Set Local time to be the time converted from GMT\n int lHours, lMinutes, lSeconds, lDay, lMonth, lYear;\n lHours = local.get(Calendar.HOUR_OF_DAY);\n lMinutes = local.get(Calendar.MINUTE);\n lSeconds = local.get(Calendar.SECOND);\n lDay = local.get(Calendar.DAY_OF_MONTH);\n lMonth = local.get(Calendar.MONTH);\n\n lMonth++; //Months in java are 0-11, humans read 1-12\n\n lYear = local.get(Calendar.YEAR);\n\n return hR(lMonth) + \"/\" + hR(lDay) + \"/\" + lYear + \" \" + hR(lHours) + \":\" + hR(lMinutes) + \":\" + hR(lSeconds);\n }", "public static String getYYYYMMDD()\r\n/* 65: */ {\r\n/* 66: 81 */ String nowTime = \"\";\r\n/* 67: 82 */ Date now = new Date();\r\n/* 68: 83 */ SimpleDateFormat formatter = new SimpleDateFormat(\"yyyyMMdd\");\r\n/* 69: 84 */ nowTime = formatter.format(now);\r\n/* 70: 85 */ return nowTime;\r\n/* 71: */ }", "String getDate();", "String getDate();", "java.lang.String getTimeZone();", "@Override\n\tpublic String asString(Object object) {\n\t\t// at this point object is a Date\n\n\t\tCalendar calendar = Calendar.getInstance(TimeZone.getTimeZone(\"GMT\"));\n\t\tcalendar.setTime((Date) object);\n\n\t\tStringBuilder builder = new StringBuilder();\n\n\t\tint year = calendar.get(Calendar.YEAR);\n\t\tif (calendar.get(Calendar.ERA) == 0) {\n\t\t\t// https://en.wikipedia.org/wiki/ISO_8601\n\t\t\t// by convention 1 BC is labeled +0000, 2 BC is labeled −0001, ...\n\n\t\t\tif (year > 1) {\n\t\t\t\tbuilder.append('-');\n\t\t\t}\n\t\t\t--year;\n\t\t}\n\n\t\tbuilder.append(String.format(\"%04d\", year));\n\t\tbuilder.append('-');\n\t\tbuilder.append(String.format(\"%02d\", calendar.get(Calendar.MONTH) + 1));\n\t\tbuilder.append('-');\n\t\tbuilder.append(String.format(\"%02d\", calendar.get(Calendar.DATE)));\n\t\tbuilder.append('T');\n\t\tbuilder.append(String.format(\"%02d\", calendar.get(Calendar.HOUR_OF_DAY)));\n\t\tbuilder.append(':');\n\t\tbuilder.append(String.format(\"%02d\", calendar.get(Calendar.MINUTE)));\n\t\tbuilder.append(':');\n\t\tbuilder.append(String.format(\"%02d\", calendar.get(Calendar.SECOND)));\n\t\tbuilder.append('Z');\n\n\t\treturn builder.toString();\n\t}", "private String getISO8601Timestamp(long date) {\n SimpleDateFormat format = new SimpleDateFormat(TIMESTAMP_FORMAT);\n // Convert the date into YYYY-MM-DDThh:mm:ss.sss\n String result = format.format(date);\n // Get default time zone in +/-hhmm format\n TimeZone tz = TimeZone.getDefault();\n int offset = tz.getRawOffset();\n // Convert the timezone format from +/-hhmm to +/-hh:mm\n String formatTimeZone = String.format(TIMEZONE_FORMAT, offset >= 0 ? \"+\" : \"-\", offset / 3600000, (offset / 60000) % 60);\n return result + formatTimeZone;\n }", "public String getTimeString() {\n DateFormat format = new SimpleDateFormat(\"HH:mm\");\n return format.format(mDate);\n }", "public static Date currentDate() {\n Date currentDate = new Date();\n SimpleDateFormat format = new SimpleDateFormat(\"yyyy-MM-dd HH:mm:ss\");\n format.setTimeZone(TimeZone.getTimeZone(\"gmt\"));\n String strTime = format.format(currentDate);\n\n SimpleDateFormat formatLocal = new SimpleDateFormat(\"yyyy-MM-dd HH:mm:ss\");\n\n try {\n currentDate = formatLocal.parse(strTime);\n } catch (ParseException e) {\n e.printStackTrace();\n }\n\n return currentDate;\n }", "public static String getDateAndTime() {\n Calendar JCalendar = Calendar.getInstance();\n String JMonth = JCalendar.getDisplayName(Calendar.MONTH, Calendar.SHORT, Locale.UK);\n String JDate = JCalendar.getDisplayName(Calendar.DATE, Calendar.LONG, Locale.UK);\n String JHour = JCalendar.getDisplayName(Calendar.HOUR, Calendar.LONG, Locale.UK);\n String JSec = JCalendar.getDisplayName(Calendar.SECOND, Calendar.LONG, Locale.UK);\n\n return JDate + \"th \" + JMonth + \"/\" + JHour + \".\" + JSec + \"/24hours\";\n }", "public String getLastmodifiedTimeView() {\r\n if (lastmodifiedTime != null) {\r\n lastmodifiedTimeView = DateUtils.dateToStr(lastmodifiedTime, DateUtils.YMD_DASH);\r\n }\r\n return lastmodifiedTimeView;\r\n }", "String getDateString(Context context) {\n int flags = DateUtils.FORMAT_NO_NOON_MIDNIGHT | DateUtils.FORMAT_SHOW_TIME |\n DateUtils.FORMAT_ABBREV_ALL | DateUtils.FORMAT_SHOW_DATE |\n DateUtils.FORMAT_CAP_AMPM;\n return DateUtils.formatDateTime(context, mDeliveryTime, flags);\n }", "long getDateTime();", "long getCreateTime();", "long getCreateTime();", "private static String buildSequence() {\n\t\tSimpleDateFormat dateFormatGMT = new SimpleDateFormat(\"yyyyMMddHHmmssSSS\");\n\t\tdateFormatGMT.setTimeZone(TimeZone.getTimeZone(\"GMT\")); // set to Greenwich mean time.\n\t\treturn dateFormatGMT.format(new Date());\n\t}", "public Date getSystemDateTime(){\n\t\tDate systemDate = new Date();\t\t\n\t\treturn systemDate;\n\t}", "@RequiresApi(api = Build.VERSION_CODES.N)\n private String getDateTime() {\n DateFormat dateFormat = new SimpleDateFormat(\"yyyy/MM/dd HH:mm:ss\");\n Date date = new Date();\n return dateFormat.format(date);\n }", "public String gmtToLocal(String gmtTime) {\n\t\tString localTime = \"\";\n\t\tcurrentFormat = new SimpleDateFormat(\"yyyy-MM-dd'T'HH:mm:ss'Z'\");\n\t\tcurrentFormat.setTimeZone(TimeZone.getTimeZone(\"UTC\"));\n\t\tDate date = null;\n\t\t\n\t\ttry {\n\t\t\t//date = currentFormat.parse(gmtTime);\n\t\t\tdate = parseDate(gmtTime,true);\n\t\t\n\t\t\n\t\t} catch (Exception e) {\n\t\t\tLogs.show(e);\n\t\t\t \n\t\t}\n\t\tcalendar = Calendar.getInstance();\n\t\tcurrentFormat.setTimeZone(calendar.getTimeZone());\n\t\tlocalTime = currentFormat.format(date);\n\t\treturn localTime;\n\t}" ]
[ "0.7136102", "0.66894984", "0.6586164", "0.6544667", "0.65070444", "0.65006006", "0.6496049", "0.6464054", "0.6458278", "0.6394899", "0.639099", "0.63766927", "0.63752294", "0.63696957", "0.63510954", "0.63416", "0.6297777", "0.62913066", "0.6290827", "0.62898815", "0.6265442", "0.62649614", "0.62649614", "0.6252676", "0.62150127", "0.62097055", "0.61868787", "0.6182419", "0.61350715", "0.613014", "0.61180097", "0.6114964", "0.6113781", "0.61134744", "0.6112557", "0.6095926", "0.60955286", "0.6092992", "0.60918045", "0.60873044", "0.60695124", "0.6068287", "0.60582095", "0.6056424", "0.60548943", "0.6053275", "0.6050919", "0.6037747", "0.6021497", "0.60042727", "0.6000263", "0.6000199", "0.6000136", "0.5996164", "0.5989904", "0.59656364", "0.596385", "0.5958359", "0.5955087", "0.5949979", "0.59450424", "0.5944841", "0.59418976", "0.59391373", "0.5919225", "0.59143084", "0.5902551", "0.5901605", "0.5894264", "0.5890054", "0.58840126", "0.5875127", "0.5870056", "0.58641547", "0.5848675", "0.5844896", "0.58427536", "0.5833534", "0.5830857", "0.5816921", "0.5804078", "0.57980883", "0.57800674", "0.5774246", "0.5774246", "0.5764876", "0.57645184", "0.576425", "0.5752767", "0.57512456", "0.5748189", "0.57421696", "0.5735927", "0.5735111", "0.5730922", "0.5730922", "0.57277507", "0.57211596", "0.57178164", "0.57135713" ]
0.669008
1
Maths calculation METHODS methods checks if a particular string is an integer
public boolean isInteger(String sIntString) { int i = 0; try { i = Integer.parseInt(sIntString); return true; } catch (Exception e) { return false; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "boolean isInt(TextField input);", "public static boolean isInteger(String s)\r\n {\r\n if (s == null || s.length() == 0)\r\n return false;\r\n \r\n //integer regular expression\r\n String regex = \"[-|+]?\\\\d+\";\r\n if (!s.matches(regex))\r\n return false;\r\n \r\n if (s.startsWith(\"+\"))\r\n s = s.substring(1);\r\n \r\n //try convert the string to an int\r\n //if it can not be converted, then return false\r\n try\r\n {\r\n Integer.parseInt(s);\r\n }catch(Exception e)\r\n {\r\n return false;\r\n }\r\n \r\n return true;\r\n }", "private int isInteger(String s) {\r\n\t\t\tint retInt;\r\n\t\t try { \r\n\t\t \tretInt = Integer.parseInt(s); \r\n\t\t } catch(NumberFormatException e) { \r\n\t\t return -1; \r\n\t\t } catch(NullPointerException e) {\r\n\t\t return -1;\r\n\t\t }\r\n\t\t // only got here if we didn't return false\r\n\t\t return retInt;\r\n\t\t}", "private boolean isInteger(String userInput){\n if (userInput.matches(\"[0-9]+\")) {\n return true;\n }\n return false;\n }", "public int myAtoi(String str) {\n\t\tboolean isStarted = false;\n\t\tint startPos = str.length();\n\t\tint endPos = str.length();\n\t\tif (str == null || str.length() == 0) {\n\t\t\treturn 0;\n\t\t}\n\t\tchar[] s = str.toCharArray();\n\t\tfor (int i = 0; i < s.length; i++) {\n\t\t\tif (s[i] == ' ') {\n\t\t\t\tif (!isStarted) {\n\t\t\t\t\tcontinue;\n\t\t\t\t} else {\n\t\t\t\t\tendPos = i;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (isValidNumber(s[i])) {\n\t\t\t\tif (!isStarted) {\n\t\t\t\t\tisStarted = true;\n\t\t\t\t\tstartPos = i;\n\t\t\t\t}\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tif (isValidChar(i, s[i], str)) {\n\t\t\t\tisStarted = true;\n\t\t\t\tstartPos = i;\n\t\t\t} else {\n\t\t\t\tif (!isStarted) {\n\t\t\t\t\treturn 0;\n\t\t\t\t} else {\n\t\t\t\t\tendPos = i;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tString valueStr = str.substring(startPos, endPos);\n\t\tvalueStr = (valueStr.equals(\"+\") || valueStr.equals(\"-\") || valueStr.isEmpty()) ? \"0\" : valueStr;\n\t\treturn filterOverflow(Double.valueOf(valueStr));\n\t}", "public boolean isAnInt(String str) {\r\n \ttry {\r\n \t\tInteger.parseInt(str);\r\n \t} catch (NumberFormatException e) {\r\n \t\treturn false;\r\n \t}\r\n \treturn true;\r\n }", "private boolean isInt(String str) { \n\t try { \n\t int d = Integer.parseInt(str); \n\t } catch(NumberFormatException nfe) { \n\t return false; \n\t } \n\t return true; \n\t}", "private boolean isInt(String num) {\n boolean isInt;\n try {\n Integer.parseInt(num);\n isInt = true;\n } catch (Exception e) {\n isInt = false;\n }\n return isInt;\n }", "private boolean isStringAnInt(String s) {\n // false if string is null\n if (s == null) {\n return false;\n }\n // if scanner get parse string for int then return true\n try {\n Scanner sc = new Scanner(s);\n int num = sc.nextInt();\n }\n // return false if it throws an exception\n catch (Exception e) {\n return false;\n }\n return true;\n }", "public boolean isInt(String text)\r\n {\r\n try\r\n {\r\n int ans = Integer.parseInt(text);\r\n return true;\r\n }\r\n catch(NumberFormatException e)\r\n {\r\n return false;\r\n }\r\n }", "private boolean isInt (String s) {\n\t\ttry {\n\t\t\tif(Integer.parseInt(s) < 0) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\t\tcatch(NumberFormatException e) {\n\t\t\treturn false;\n\t\t}\n\t\tcatch(NullPointerException e) {\n\t\t\treturn false;\n\t\t}\n\t\t\n\t\treturn true;\n\t}", "private boolean checkInt(String str) {\n\t\ttry {\n\t\t\tint integer = Integer.parseInt(str);\n\t\t\tif(integer>=0&&integer<100000){\n\t\t\t\treturn true;\n\t\t\t}\n\t\t\telse {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t} catch(Exception e) {\n\t\t\treturn false;\n\t\t}\n\t}", "private boolean isInteger(String s)\n{\n\t boolean isNumber = true;\n\ttry{\n\t\t\tint n = Integer.parseInt(s);\n\t }catch(NumberFormatException n)\n\t {\n\t\t isNumber = false;\n\t }\n\n\treturn isNumber;\n}", "public static boolean isInt(String s){\n boolean flag = true;\n flag = ((s.charAt(0) >= '0' && s.charAt(0) <= '9') || s.charAt(0) == '-' || s.charAt(0) == '+' );\n int i = 1;\n while(flag && i < s.length()){\n flag = (s.charAt(i) >= '0' && s.charAt(i) <= '9' );\n i++;\n }\n return flag;\n }", "private static boolean stringTest(String s){\n try{ //depending on whether this is successful or not will return the relevant value\n Integer.parseInt(s);\n return true;\n } catch (NumberFormatException ex){\n return false;\n }\n }", "private boolean isInteger(String str)\r\n {\r\n try\r\n {\r\n int i = Integer.parseInt(str);\r\n } catch (NumberFormatException nfe)\r\n {\r\n MyLogger.log(Level.INFO, LOG_CLASS_NAME + \"Non numeric value. Value was: {0}\", str);\r\n return false;\r\n }\r\n return true;\r\n }", "private static boolean isInteger(String s) {\r\n try {\r\n Integer.parseInt(s);\r\n return true;\r\n } catch (Exception ex) {\r\n return false;\r\n }\r\n }", "private boolean checkInteger(String str) {\n try {\n return Integer.parseInt(str) <= 30; // Check if the entered value is an Integer and <= 30;\n } catch (NumberFormatException e) {\n return false;\n }\n }", "public boolean isInteger(String x){\n try{\n Integer.parseInt(x);\n \n }\n catch(NumberFormatException e){\n return false;\n }\n return true;\n }", "public static boolean IS_INTEGER(String t) {\n\n return (t.equals(Feature.INTEGER));\n }", "public static boolean isInt(String str)\r\n\t{\r\n\t\tif (str == null) {\r\n\t\t\treturn false;\r\n\t\t}\r\n\t\tint length = str.length();\r\n\t\tif (length == 0) {\r\n\t\t\treturn false;\r\n\t\t}\r\n\t\tint i = 0;\r\n\t\tif (str.charAt(0) == '-') {\r\n\t\t\tif (length == 1) {\r\n\t\t\t\treturn false;\r\n\t\t\t}\r\n\t\t\ti = 1;\r\n\t\t}\r\n\t\tfor (; i < length; i++) {\r\n\t\t\tchar c = str.charAt(i);\r\n\t\t\tif (c < '0' || c > '9') {\r\n\t\t\t\treturn false;\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn true;\r\n\t}", "private static boolean isPositiveInteger(String s){\n\t\ttry{\n\t\t\t//If the token is an integer less than 0 return false\n\t\t\tif(Integer.parseInt(s) < 0){\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\t\t//If an exception occurs return false\n\t\tcatch(NumberFormatException e){\n\t\t\treturn false;\n\t\t}\n\t\t//otherwise return true\n\t\treturn true;\n\t}", "private boolean isInteger(String a) {\n try \n {\n Integer.parseInt(a);\n return true;\n }\n catch(Exception e) {\n return false;\n }\n }", "public static boolean isInteger(String s) {\n\t try { \n\t Integer.parseInt(s); \n\t } catch(NumberFormatException e) { \n\t return false; \n\t }\n\t return true;\n\t}", "public boolean checkInt( String s ) {\n \tchar[] c = s.toCharArray();\n \tboolean d = true;\n\n \tfor ( int i = 0; i < c.length; i++ )\n \t // verifica se o char não é um dígito\n \t if ( !Character.isDigit( c[ i ] ) ) {\n \t d = false;\n \t break;\n \t }\n \treturn d;\n \t}", "public static boolean isInt(String strNum) {\n try {\n int d = Integer.parseInt(strNum);\n } catch (NumberFormatException | NullPointerException nfe) {\n System.out.println(\"Invalid data format\");\n log.error(nfe);\n return false;\n }\n return true;\n }", "@Test\n public void testIsValidInteger() {\n System.out.println(\"isValidInteger\");\n String integer = \"6.8\";\n boolean expResult = false;\n boolean result = ValidVariables.isValidInteger(integer);\n assertEquals(expResult, result);\n }", "public static boolean isInteger(String s) {\n\t\ttry { \n\t\t\tInteger.parseInt(s); \n\t\t} catch(NumberFormatException e) { \n\t\t\treturn false; \n\t\t} catch(NullPointerException e) {\n\t\t\treturn false;\n\t\t}\n\t\t// only got here if we didn't return false\n\t\treturn true;\n\t}", "public static boolean isInteger(String s) {\n\t return isInteger(s,10);\n\t}", "public boolean isInteger();", "public boolean isInteger(String input){\r\n try{\r\n Integer.parseInt(input);\r\n } catch (NumberFormatException e){\r\n return false;\r\n } catch (NullPointerException e){\r\n return false;\r\n }\r\n return true;\r\n }", "public static boolean isInt(String str) {\n\t\ttry {\n\t\t\tint f = Integer.parseInt(str);\n\t\t} catch (Exception e) {\n\t\t\treturn false;\n\t\t}\n\n\t\treturn true;\n\t}", "public boolean checkInput(String str)\n {\n try\n {\n Integer.parseInt(str);\n } \n catch(NumberFormatException ex)\n {\n return false;\n } \n return true;\n }", "public static Boolean Int(String arg){\n\t\tif(arg == arg.replaceAll(\"\\\\D\",\"\")){\n\t\t\treturn true;\n\t\t} else {\n\t\t\treturn false;\n\t\t}\n\t}", "public static boolean isInteger(String string) {\r\n\t try {\r\n\t Integer.valueOf(string);\r\n\t return true;\r\n\t } catch (NumberFormatException e) {\r\n\t return false;\r\n\t }\r\n\t}", "public static boolean isInt(String pram)\r\n {\r\n try{\r\n Integer.parseInt(pram);\r\n return true;\r\n }catch(NumberFormatException e){\r\n return false;\r\n }\r\n }", "public boolean isInt(String value) {\n try {\n Integer.parseInt(value);\n return true;\n } catch (Exception e) {\n return false;\n }\n }", "public static boolean isInteger(String s) {\n\t try { Integer.parseInt(s); }\n\t catch(NumberFormatException e) { return false; }\n\t catch(NullPointerException e) { return false; }\n\t // only gets here if the entered String is Integer:\n\t return true;\n\t}", "public static boolean isIntValid (String str) {\r\n try {Integer.parseInt(str);} catch (NumberFormatException e) {return false;}\r\n return true;\r\n }", "public static boolean isInteger(String input) {\n try {\n Integer.parseInt(input);\n return true;\n } catch (Exception e) {\n return false;\n }\n\n }", "public static boolean isInteger(String s) {\n return isInteger(s,10);\n }", "public boolean isNumeric(String str){\n try {\n int i = Integer.parseInt(str);\n } catch (NumberFormatException nfe) {\n return false;\n }\n return true;\n }", "public static boolean isInteger(String str) {\n if (str == null || str.isEmpty() || str.equals(\"-\"))\n return false;\n\n int startIndex = str.startsWith(\"-\") ? 1 : 0;\n for (int i = startIndex; i < str.length(); i++)\n if (Character.digit(str.charAt(i), 10) < 0)\n return false;\n return true;\n }", "public static boolean is_int(String s) {\n try {\n Integer.parseInt(s);\n return true;\n } catch (NumberFormatException e) {\n return false;\n }\n }", "private static boolean validateInteger(String intString) {\n try {\n Integer.parseInt(intString);\n } catch (NumberFormatException e) {\n // Not a valid integer\n return false;\n }\n return true;\n }", "public static boolean isInteger(String str){\n try {\n int d = Integer.parseInt(str);\n } catch (NumberFormatException nfe) {\n return false;\n }\n return true;\n }", "public static boolean isNumeric(String string) { \r\n\t\ttry { \r\n\t\t\tint testNumber = Integer.parseInt(string); \r\n\t\t} catch(NumberFormatException e) { \r\n\t\t\treturn false; \r\n\t\t} \r\n\t\t\r\n\t\treturn true; \r\n\t}", "public static boolean isInteger(String s) {\n\t\ttry {\n\t\t\tInteger.parseInt(s);\n\t\t} catch (NumberFormatException e) {\n\t\t\treturn false;\n\t\t}\n\t\treturn true;\n\t}", "public static boolean isInt(String val){\n\t try\n\t {\n\t Integer.parseInt(val);\n\t return true;\n\t } catch (NumberFormatException ex)\n\t {\n\t \tSystem.out.println(\"Please enter integer\");\n\t return false;\n\t }\n\t \n\t}", "public static boolean isInteger(String str) {\n\t\ttry {\n\t\t\tInteger.parseInt(str);\n\t\t} catch (NumberFormatException e) {\n\t\t\treturn false;\n\t\t}\n\t\treturn true;\n\t}", "@Test\n void checkIsTrueForStringWithNumbers() {\n // Act, Assert\n assertTrue(IsNumeric.check(\"3\"));\n assertTrue(IsNumeric.check(\"0\"));\n assertTrue(IsNumeric.check(\"-0f\"));\n assertTrue(IsNumeric.check(\"3.8f\"));\n assertTrue(IsNumeric.check(\"-3.87F\"));\n assertTrue(IsNumeric.check(\"-3\"));\n assertTrue(IsNumeric.check(\"32f\"));\n assertTrue(IsNumeric.check(\"15D\"));\n assertTrue(IsNumeric.check(\"3.2\"));\n assertTrue(IsNumeric.check(\"0.2\"));\n assertTrue(IsNumeric.check(\"-0.28\"));\n assertTrue(IsNumeric.check(\"0.24D\"));\n assertTrue(IsNumeric.check(\"0.379d\"));\n }", "public static boolean isInteger(String s) {\r\n\t\ttry {\r\n\t\t\tInteger.parseInt(s);\r\n\t\t} catch (NumberFormatException e) {\r\n\t\t\treturn false;\r\n\t\t} catch (NullPointerException e) {\r\n\t\t\treturn false;\r\n\t\t}\r\n\t\treturn true;\r\n\t}", "public static boolean isValidInt(String s)\n {\n for (int i = 0; i < s.length(); i++)\n {\n if (!Character.isDigit(s.charAt(i)))\n {\n return false;\n }\n }\n return true;\n }", "public boolean isInteger() {\n try {\n Integer.parseInt(txt.getText());\n return true;\n } catch (Exception e) {\n return error(\"El valor debe ser un numero entero!\");\n }\n }", "private int ProcessInstruction(String input) {\n\t\tif (InputFileChecks.isStringInteger(input)) {\n\t\t\tint inputVal = Integer.parseInt(input);\n\t\t\tif (inputVal >=0 && inputVal <= 6) {\n\t\t\t\treturn inputVal;\n\t\t\t}\n\t\t}\n\t\tSystem.out.println(\"Please return a proper input. Input provided: \" + input + \". Please input a from 0-6\");\n\t\treturn -1;\n\t}", "private boolean isInteger(String element) {\r\n try {\r\n Integer.valueOf(element);\r\n } catch (NumberFormatException e) {\r\n return false;\r\n }\r\n return true;\r\n }", "public boolean isNumber(String in) \n\t{\n\t\ttry \n\t\t{\n\t\t\tInteger.parseInt(in);\n\t\t\treturn true;\n\t\t}\n\t\tcatch (Exception e) \n\t\t{\n\t\t\treturn false;\n\t\t}\n\t}", "private boolean tryParseInt(String str) {\n try {\n Integer.parseInt(str);\n } catch (Exception ex) {\n return false;\n }\n return true;\n }", "public static boolean isInt(String check) {\n\t\treturn check.matches(\"\\\\d+\");\n\t}", "public static boolean isINT(final String token) {\n\t\t// Check for empty or 1-size strings.\n\t\tif (token.length() < 2)\n\t\t\treturn false;\n\n\t\t// verify all chars are 0-9.\n\t\tfor (int i = 0; i < token.length(); i++) {\n\t\t\tif (!digits.contains(Character.toString(token.charAt(i)))) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\n\t\t// Passes all tests!\n\t\treturn true;\n\t}", "private static boolean isValidDigit(String strInput) {\n boolean isValid = true;\n if (isPrimitive(strInput)) {\n int input = Integer.parseInt(strInput);\n if (input < 1 || input > 255) {\n log.debug(\"Wrong config input value: {}\", strInput);\n isValid = false;\n } else {\n isValid = true;\n }\n\n } else {\n isValid = false;\n }\n\n return isValid;\n }", "private static int i(String s) {\n return Integer.parseInt(s);\n }", "public int nextInt() {\n int result = 0;\n this.inputStr = this.s.nextLine();\n String help = \"\";\n boolean positivSign = true;\n\n for (int i = 0; i < this.inputStr.length(); i++) {\n // only by digits the help string get the char\n // --> 12w3 == 123\n if (inputStr.charAt(i) >= '0' && inputStr.charAt(i) <= '9') {\n help += inputStr.charAt(i);\n }// the sign will also read but only when it is befor the number\n // --> -12w3 == -123 | 12-3 == 123\n // positivSign is a flag for the sign\n else if (inputStr.charAt(i) == '-' && help.isEmpty()) {\n positivSign = false;\n }\n }\n\n // convert the String into an int\n // 123 == 1*10^2 + 2*10^1 + 3*10^0\n for (int i = 0, j = help.length() - 1; i < help.length(); i++, j--) {\n if (help.charAt(i) >= '0' && help.charAt(i) <= '9') {\n result += Math.pow(10, j) * (help.charAt(i) - '0');\n }\n }\n if (positivSign) {\n return result;\n }\n return result * -1;\n }", "private boolean isNumeric(String s) {\n return java.util.regex.Pattern.matches(\"\\\\d+\", s);\n }", "public int calculate(String s) {\n final int len = s.length();\n final List<Object> notations = new ArrayList<>();\n final Stack<Operator> operatorStack = new Stack<>();\n for (int i = 0; i < len; i++) {\n final char ch = s.charAt(i);\n\n // case1: AS Space\n if (ch == SPACE) continue;\n \n // case2: AS operator\n Operator operator = Operator.parse(ch);\n if (operator != null) {\n while (!operatorStack.isEmpty() && operatorStack.peek().priority >= operator.priority) {\n notations.add(operatorStack.pop());\n }\n operatorStack.add(operator);\n continue;\n }\n\n // case3: AS integer\n int num = ch - '0';\n\n while (i + 1 < len && isDigit(s.charAt(i + 1))) {\n i++;\n num = num * 10 + (s.charAt(i) - '0');\n }\n notations.add(num);\n }\n // \n while (!operatorStack.isEmpty()) notations.add(operatorStack.pop());\n\n final Stack<CalculateFrame> stack = new Stack<>();\n Integer result = 0;\n for (int i = notations.size() - 1; i >= 0; i--) {\n final Object obj = notations.get(i);\n\n if (obj instanceof Operator) {\n stack.add(new CalculateFrame((Operator)obj));\n } else {\n result = (Integer)obj;\n \n\n while (!stack.isEmpty()) {\n stack.peek().setArg(result);\n if (!stack.peek().canCalculate()) break;\n\n result = stack.pop().calculate();\n }\n }\n }\n\n return result;\n }", "private static boolean isNumeric(String str){\n return NumberUtils.isNumber(str);\n }", "@Test\n public void testDigits() {\n final String result = calc.type(\"1 + 2 - 3\")\n .press_equalBtn()\n .result();\n\n Assert.assertEquals(result, \"0\");\n }", "private boolean isNumber( String test ) {\n\treturn test.matches(\"\\\\d+\");\n }", "public static boolean isInteger(String s) {\n try {\n Integer.parseInt(s);\n } catch(NumberFormatException e) {\n return false;\n } catch(NullPointerException e) {\n return false;\n }\n return true;\n }", "public boolean isNumber(String sIn)\r\n {\r\n int parseNumber = -1;\r\n \r\n try{\r\n parseNumber = Integer.parseInt(sIn);\r\n }catch(Exception e){\r\n return false;\r\n }\r\n \r\n return true;\r\n }", "private static boolean isNumeric(String str){\n return str.matches(\"-?\\\\d+(\\\\.\\\\d+)?\"); //match a number with optional '-' and decimal.\n }", "public abstract boolean isNumeric();", "private static boolean isNumeric(String cadena)\n\t {\n\t\t try \n\t\t {\n\t\t\t Integer.parseInt(cadena);\n\t\t\t return true;\n\t\t } catch (NumberFormatException nfe)\n\t\t {\n\t\t\t return false;\n\t\t }\n\t }", "public static boolean isInteger(String value) {\n\t\ttry {\n\t\t\tInteger.parseInt(value);\n\t\t}\n\t\t \n\t\tcatch(NumberFormatException e) {\n\t\t\treturn false;\n\t\t}\n\t\t\n\t\treturn true;\n\t}", "public static int parseInt(String string) {\n return (int) Double.parseDouble(string);\n }", "static Integer stringToInt(String s){\n int result = 0;\n for(int i = 0; i < s.length(); i++){\n //If the character is not a digit\n if(!Character.isDigit(s.charAt(i))){\n return null;\n }\n //Otherwise convert the digit to a number and add it to result\n result += (s.charAt(i) - '0') * Math.pow(10, s.length()-1-i);\n }\n return result;\n }", "static int stringToNumber(String value)throws IllegalArgumentException{\r\n\t\tif (!isNumber(value))\r\n\t\t\tthrow new IllegalArgumentException(\"This is not a number!\");\r\n\t\tint number = 0;\r\n\t\tfor (int i = 0; i < value.length(); i++)\r\n\t\t\tnumber += (value.charAt(i)-48)* Math.pow(10, value.length()-1-i);\r\n\t\treturn number;\r\n\t}", "public static int myAtoi(String s) {\n int n = s.length();\n if (n == 0) {\n return 0;\n }\n int i = 0;\n char[] c = s.toCharArray();\n\n //去除空格\n while (i < n && c[i] == ' ') {\n i++;\n }\n //极端情况 \" \"\n if (i == n) {\n return 0;\n }\n //判断符号\n int sign = 1;\n if (c[i] == '-') {\n sign = -1;\n i++;\n } else if (c[i] == '+') {\n i++;\n }\n //遍历\n int res = 0;\n while (i<n){\n char cur = c[i];\n if(cur< '0' || cur > '9'){\n break;\n }\n //提前判断乘以10 + 上当前数字是否越界\n if (res > Integer.MAX_VALUE / 10 || (res == Integer.MAX_VALUE / 10 && (cur - '0') > Integer.MAX_VALUE % 10)) {\n return Integer.MAX_VALUE;\n }\n if (res < Integer.MIN_VALUE / 10 || (res == Integer.MIN_VALUE / 10 && (cur - '0') > -(Integer.MIN_VALUE % 10))) {\n return Integer.MIN_VALUE;\n }\n res = res*10 + sign*(cur-'0');\n i++;\n }\n return res;\n\n\n }", "public int myAtoi(String str) {\n\n\t\t// 去除前后空格\n\t\tstr = str.trim();\n\n\t\tif (str.equals(\"\"))\n\t\t\treturn 0;\n\n\t\tString s = \"\";\n\t\tint symbol = -1;\n\n\t\tfor (int i = 0, j = 0; i < 12 && i < str.length(); i++) {\n\n\t\t\tif (i == 0) {\n\t\t\t\tchar ch = str.charAt(i);\n\n\t\t\t\tif (str.charAt(i) > '9' || str.charAt(i) < '0')\n\t\t\t\t\tif (str.charAt(i) != '+' && str.charAt(i) != '-')\n\t\t\t\t\t\treturn 0;\n\t\t\t}\n\n\t\t\tif (i > 1 && s.equals(\"\"))\n\t\t\t\treturn 0;\n\n\t\t\tif (str.charAt(i) <= '9' && str.charAt(i) >= '0') {\n\t\t\t\ts += str.charAt(i);\n\t\t\t\tif (symbol < 0)\n\t\t\t\t\tsymbol = i;\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tif (i > j)\n\t\t\t\tbreak;\n\t\t\tj++;\n\t\t}\n\n\t\tif (s.equals(\"\"))\n\t\t\treturn 0;\n\n\t\tif (symbol > 0 && str.charAt(symbol - 1) == '-') {\n\t\t\ts = \"-\" + s;\n\t\t\tif (s.length() > 11 || Long.parseLong(s) <= Integer.MIN_VALUE)\n\t\t\t\treturn Integer.MIN_VALUE;\n\t\t\telse\n\t\t\t\treturn Integer.parseInt(s);\n\t\t}\n\n\t\tif (s.length() > 10 || Long.parseLong(s) >= Integer.MAX_VALUE) {\n\t\t\treturn Integer.MAX_VALUE;\n\t\t}\n\n\t\treturn Integer.parseInt(s);\n\t}", "public static boolean isNumber(String text)\r\n\t{\r\n\t\ttry\r\n\t\t{\r\n\t\t\tInteger.parseInt(text);\r\n\t\t\treturn true;\r\n\t\t}\r\n\t\tcatch(NumberFormatException e)\r\n\t\t{\r\n\t\t\treturn false;\r\n\t\t}\r\n\t}", "public static int getInt(String str){\n int num=0;\n int count = 0;\n if (str.length() == 7)\n return 0;\n for (int i = str.length()-8; i >= 0; i --){\n if (str.charAt(i) == '1') {\n num += Math.pow(2, count);\n }\n count ++;\n }\n return num;\n }", "public int solveWordProblem(String string) {\n\t\t// what is Integer (plus|added to|minus|subtracted by|multiplied by|divided by|) Integer ?\n\t\tstring = string.toLowerCase();\n\t\tif (!string.matches(\n\t\t\t\t\"(\\\\s{0,1})(what)(\\\\s{0,1})(is)(\\\\s{0,1})(\\\\-?[0-9]{1,})(\\\\s{0,1})(plus|added\\\\s{0,1}to|minus|subtracted\\\\s{0,1}by|multiplied\\\\s{0,1}by|divided\\\\s{0,1}by)(\\\\s{0,1})(\\\\-?[0-9]{1,})(\\\\s{0,1})(\\\\?)?\"))\n\t\t\tthrow new IllegalArgumentException();\n\n\t\tList<String> entries = new ArrayList<String>(Arrays.asList((string.toLowerCase().split(\"(what|by|is|\\\\?| )\"))));\n\t\tentries.removeAll(Arrays.asList(\"\"));\n\n\t\tswitch (entries.get(1)) {\n\t\tcase \"plus\":\n\t\tcase \"added\":\n\t\t\treturn Integer.parseInt(entries.get(0)) + Integer.parseInt(entries.get(2));\n\t\tcase \"minus\":\n\t\tcase \"subtracted\":\n\t\t\treturn Integer.parseInt(entries.get(0)) - Integer.parseInt(entries.get(2));\n\t\tcase \"multiplied\":\n\t\t\treturn Integer.parseInt(entries.get(0)) * Integer.parseInt(entries.get(2));\n\t\tcase \"divided\":\n\t\t\tif (Integer.parseInt(entries.get(2)) == 0)\n\t\t\t\tthrow new IllegalArgumentException();\n\t\t\treturn Integer.parseInt(entries.get(0)) / Integer.parseInt(entries.get(2));\n\t\tdefault:\n\t\t\tthrow new IllegalArgumentException();\n\t\t}\n\t}", "boolean hasInt();", "private static boolean isNumeric(String str)\t{\n\n\t\treturn str.matches(\"-?\\\\d+(\\\\.\\\\d+)?\"); \n\t\t\t// match a number with optional '-' and decimal.\n\t}", "public static boolean isInteger(String str) {\n if (str == null || str.isEmpty()) {\n return false;\n }\n int length = str.length();\n if (length == 0) {\n return false;\n }\n int i = 0;\n if (str.charAt(0) == '-') {\n if (length == 1) {\n return false;\n }\n i = 1;\n }\n for (; i < length; i++) {\n char c = str.charAt(i);\n if (c <= '/' || c >= ':') {\n return false;\n }\n }\n return true;\n }", "public static int parseInt(String s){\r\n\t\tint a =0;\r\n\t\ttry {\r\n\t\t a = Integer.parseInt(s);\r\n\t\t} catch (NumberFormatException e) {\r\n\t\t System.out.println(\"To use this function you have to enter string that is a number, otherwise it will return 0.\");\r\n\t\t}\r\n\t\treturn a;\r\n\t}", "private boolean isInteger(String value){\n try{\n Integer.parseInt(value);\n }catch(NumberFormatException exc)\n {\n // Show the error message.\n Alert alert = new Alert(Alert.AlertType.INFORMATION);\n alert.setTitle(\"Не верно указано затраченное время!\");\n alert.setHeaderText(null);\n alert.setContentText(\"Введите целое число затраченного времени!\\nЗатраченное время не может превышать 2147483647 (245000 лет)!\");\n alert.showAndWait();\n return false;\n }\n return true;\n }", "public boolean isArmstrongNumber(int input) {\n\t\t\n\t\t//Convert input to a string format\n\t\tString inputValue = String.valueOf(input);\n\t\t\n\t\t//Iterate across the string\n\t\t//Raise the value of the int within the string to the power of the length of the string\n\t\t//Add this value to a temp value \n\t\t\n\t\tint temp = 0;\n\t\tfor(int i=0; i<inputValue.length(); i++) {\t\t\n\t\t\ttemp += Math.round(Math.pow(Character.getNumericValue(inputValue.charAt(i)),inputValue.length()));\n\t\t}\n\t\t\n\t\t//Check whether or not the obtained value matches the initial input\n\t\t\n\t\tif(input == temp) {\n\t\t\treturn true;\n\t\t}\t\t\n\t\treturn false;\n\t}", "public int atoi(String input) {\n\t\n\t\tfinal int maxDiv10 = Integer.MAX_VALUE / 10;\n\t\t\n\t\tif(input == null) {\n\t\t\treturn 0;\n\t\t}\n\t\t\n\t\tint len = input.length();\n\t\tint index = 0;\n\t\tint sign = 1;\n\t\tint res = 0;\n\t\t\n\t\t//if white space just continue\n\t\twhile(index < len && Character.isWhitespace(input.charAt(index))) {\n\t\t\tindex++;\n\t\t}\n\t\t\n\t\t//check if still in bounds\n\t\tif(index == len) {\n\t\t\treturn 0;\n\t\t}\n\t\t\n\t\t//signal \n\t\tif(input.charAt(index) == '-') {\n\t\t\tsign = -1;\n\t\t\t//continue\n\t\t\tindex++;\n\t\t}\n\t\telse if(input.charAt(index) == '+') {\n\t\t\tsign = 1;\n\t\t\tindex++;\n\t\t}\n\n\t\twhile(index < len && Character.isDigit(input.charAt(index))) {\n\t\t\tint digit = Character.getNumericValue(input.charAt(index));\n\t\t\t\n\t\t\t//if result greater than max or equal to it \n\t\t\tif(res > maxDiv10 || res == maxDiv10 && digit >= 8) {\n\t\t\t\treturn sign == 1 ? Integer.MAX_VALUE : Integer.MIN_VALUE;\n\t\t\t}\n\t\t\tres = res * 10 + digit;\n\t\t\tindex++;\n\t\t}\n\t\treturn sign * res;\n\t}", "public static int validInt(String message){\n boolean success = false;\n int value = -1;\n do {\n try {\n value = (int)readNumber(message, \"int\");\n success = true;\n } catch (InputMismatchException e){\n System.out.println(\"Debe introducir un valor numérico... \");\n }\n } while(!success);\n return value;\n }", "public static int checkValidity (String stringChoice) {\n int choice;\n Scanner parser = new Scanner(stringChoice);\n String modStringChoice = stringChoice.replaceAll(\"[\\\\d]\", \"\");\n if (modStringChoice.length() == 0 && parser.hasNextInt()) {\n choice = parser.nextInt();\n }\n else {\n choice = -1;\n }\n parser.close();\n return choice;\n }", "public static int calculate1(String s) {\n\t\tList<String> tokens = tokenize(s);\n\t\tint sign = 1;\n\t\tint res = 0;\n\t\tStack<Integer> st = new Stack<Integer>();\n\t\tfor(String token: tokens) {\n\t\t\ttoken = token.trim();\n\t\t\tif(token.equals(\"+\"))\n\t\t\t\tsign = 1;\n\t\t\telse if(token.equals(\"-\"))\n\t\t\t\tsign = -1;\n\t\t\telse if(token.equals(\"(\")) {\n\t\t\t\tst.push(res);\n\t\t\t\tst.push(sign);\n\t\t\t\tres = 0;\n\t\t\t\tsign = 1;\n\t\t\t} else if(token.equals(\")\")) {\n\t\t\t\tres = st.pop() * res + st.pop();\n\t\t\t} else {\n\t\t\t\tres += sign*Integer.parseInt(token);\n\t\t\t}\n\t\t}\n\t\treturn res;\n }", "private static boolean isNumber( char i ) {\n\t\tif ( Character.isDigit(i) ) return true; \n\t\tthrow new IllegalArgumentException(\"The weight of the route should be a number, now it's '\"+ i +\"'\");\n\t}", "public static boolean isNumber(String text) {\r\n\t\ttry {\r\n\t\t\tInteger.parseInt(text);\r\n\t\t} catch(NumberFormatException e) {\r\n\t\t\treturn false;\r\n\t\t}\r\n\t\treturn true;\r\n\t}", "public int atoi(String str)\n {\n if(str==null)\n return 0;\n str=str.trim();\n if(str.isEmpty())\n return 0;\n int result=0;\n\n boolean negative=false;\n int i=0;\n if(str.charAt(0)=='-' || str.charAt(0)=='+')\n {\n i++;\n if(str.charAt(0)=='-')\n negative=true;\n }\n for(; i<str.length(); i++)\n {\n char c=str.charAt(i);\n //return the result before non-digit char\n if(!Character.isDigit(c))\n break;\n //now begin to check corner case for boundary values\n if(!negative && result > Integer.MAX_VALUE/10)\n return Integer.MAX_VALUE;\n if(!negative && result==Integer.MAX_VALUE/10 && (c-'0')>=7)\n return Integer.MAX_VALUE;\n if(negative && -result < Integer.MIN_VALUE/10)\n return Integer.MIN_VALUE;\n if(negative && -result == Integer.MIN_VALUE/10 && (c-'0')>=8)\n return Integer.MIN_VALUE;\n result=result*10 + (c-'0');\n }\n return negative? -result : result;\n }", "private int getNumberFromString(String text){\n\t\t\n\t\tint result = 0;\n\t\t\n\t\tfor(int i=text.length() - 1, j=0; i >= 0 ; i--, j++){\n\t\t\t\n\t\t\tresult += (Character.getNumericValue(text.charAt(i))) * Math.pow(10, j);\n\t\t}\n\t\t\n\t\treturn result;\n\t}", "public static int strToInt(String s) {\n int result = 0;\n boolean negative = false;\n int i = 0, len = s.length();\n int limit = -Integer.MAX_VALUE;\n int multmin;\n int digit;\n if (len > 0) {\n char firstChar = s.charAt(0);\n if (firstChar < '0') { // Possible leading \"+\" or \"-\"\n if (firstChar == '-') {\n negative = true;\n limit = Integer.MIN_VALUE;\n } else if (firstChar != '+')\n return 0;\n\n if (len == 1) // Cannot have lone \"+\" or \"-\"\n return 0;\n i++;\n }\n multmin = limit / 10;\n while (i < len) {\n // Accumulating negatively avoids surprises near MAX_VALUE\n digit = s.charAt(i++) - '0';\n if (digit < 0||digit > 9) {\n return 0;\n }\n if (result < multmin) {\n return 0;\n }\n result *= 10;\n if (result < limit + digit) {\n return 0;\n }\n result -= digit;\n }\n } else {\n return 0;\n }\n return negative ? result : -result;\n }", "public static boolean isNumeric(String str) {\n try {\n Integer d = Integer.parseInt(str);\n } catch (NumberFormatException nfe) {\n return false;\n }\n return true;\n }", "private static int extractInt(String str) {\n\n String num = \"\";\n for (int i = 0; i < str.length(); i++) {\n if (java.lang.Character.isDigit(str.charAt(i))) num += str.charAt(i);\n }\n return (num.equals(\"\")) ? 0 : java.lang.Integer.parseInt(num);\n\n }", "public static int checkInt() {\n\t\tboolean is_Nb = false; int i = 0;\r\n\t\tdo {\r\n\t\t\ttry {\r\n\t\t\t\ti = Integer.parseInt(scan.nextLine());\r\n\t\t\t\tis_Nb= true;\r\n\t\t\t\tif(i<0) {\r\n\t\t\t\t\tSystem.out.println(\"Enter a positive number\");\r\n\t\t\t\t\tis_Nb = false;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tcatch(NumberFormatException e) {\r\n\t\t\t\tSystem.out.println(\"Enter a number\");\r\n\t\t\t}\r\n\t\t}while(!is_Nb);\r\n\t\treturn i;\r\n\t}" ]
[ "0.69623077", "0.68579835", "0.68458027", "0.68072206", "0.67937106", "0.6790145", "0.67725796", "0.6763845", "0.667392", "0.66652256", "0.6642521", "0.6618178", "0.661464", "0.65937537", "0.6571019", "0.6559598", "0.65516645", "0.65373313", "0.6524987", "0.65175956", "0.65172255", "0.6490897", "0.6486622", "0.6455346", "0.6452758", "0.645209", "0.6447223", "0.64319444", "0.6421531", "0.6420606", "0.6399285", "0.63972867", "0.63756275", "0.6358488", "0.6356834", "0.6349927", "0.6347635", "0.6345004", "0.6335799", "0.63297325", "0.63118976", "0.6309785", "0.6305708", "0.6305515", "0.62991405", "0.6296836", "0.62890095", "0.6274997", "0.62391794", "0.62239456", "0.62219524", "0.6221456", "0.62166953", "0.62162656", "0.62143785", "0.6195049", "0.6180433", "0.6172073", "0.6169225", "0.61676687", "0.61645335", "0.61587274", "0.6149684", "0.61359024", "0.6131433", "0.61244184", "0.6115903", "0.610834", "0.6105627", "0.6101948", "0.60924697", "0.6088687", "0.60753953", "0.6069824", "0.6069748", "0.6060813", "0.60603535", "0.60590017", "0.6054403", "0.60470605", "0.6045142", "0.6019218", "0.60181737", "0.6016802", "0.59891254", "0.5988329", "0.59790933", "0.59744877", "0.5972121", "0.597136", "0.59682864", "0.5959882", "0.5958464", "0.5945419", "0.5945412", "0.59385276", "0.5932185", "0.5924227", "0.592114", "0.59208834" ]
0.63575375
34
method checks if a particular string is a decimal value
public boolean isDecimal(String sDecimalString) { return true; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static boolean isDecimalNumber(String string) {\n\t\ttry {\n\t\t\tDouble.parseDouble(string);\n\t\t\treturn true;\n\t\t} catch (Exception e) {\n\t\t\treturn false;\n\t\t}\n\n\t}", "public boolean countDecimals(String assetValue){\n\n int count = 0;\n for(int i = 0; i < assetValue.length(); i++){\n\n if(assetValue.charAt(i) == '.'){\n count++;\n if(count > 1)\n return false;\n\n }\n\n }\n return true;\n }", "public static boolean isNumber(String input) {\n boolean hasDecimal = false;\n for (int i = 0; i < input.length(); i++) {\n char test = input.charAt(i);\n if (test == '-' && i == 0)\n continue; // Allow negative indicator.\n\n if (test == '.') {\n if (!hasDecimal) {\n hasDecimal = true;\n continue;\n } else {\n return false; // Multiple decimal = invalid number.\n }\n }\n\n if (!Character.isDigit(test))\n return false; // Character isn't a digit, so it can't be a number.\n }\n\n return true;\n }", "public static boolean isDouble(String s){\n boolean flag = true;\n int countPonto = 0;\n if(s.charAt(0) == '.' || s.charAt(0) == ',')\n countPonto++;\n else \n flag = ((s.charAt(0) >= '0' && s.charAt(0) <= '9') || s.charAt(0) == '-' || s.charAt(0) == '+' );\n int i = 1;\n while(flag && i < s.length() && countPonto <=1){\n if(s.charAt(i) == '.' || s.charAt(i) == ',')\n countPonto++;\n else \n flag = (s.charAt(i) >= '0' && s.charAt(i) <= '9' );\n i++;\n }\n flag = flag&&(countPonto<=1) ? true:false;\n return flag;\n }", "public static boolean BasicDecimalNumberValidation(String text) {\n return BasicDecimalNumberValidation(text, 2);\n }", "private boolean isNumber(String s) {\n\t\ttry {\n\t\t\tDouble.parseDouble(s);\n\t\t} catch (NumberFormatException nfe) {\n\t\t\treturn false;\n\t\t}\n\t\treturn true;\n\t}", "public static boolean isPositiveDecimal(CharSequence seq) {\n PositiveDecimalCheck pdc = new PositiveDecimalCheck();\n return is(seq, pdc) && pdc.dotCount == 1\n // do not match, e.g. '100.'\n && seq.charAt(seq.length() - 1) != '.';\n\n }", "public static boolean numbersWithDecimalCheck(String decimalNum)\r\n\t{\r\n\t\treturn decimalNum.matches(\"[0-9]+([,.][0-9]{1,2})?\");\r\n\t}", "@Test\n public void testIsValidDecimal() {\n FieldVerifier service = new FieldVerifier();\n boolean result = service.isValidDecimal(1);\n assertEquals(true, result);\n }", "protected boolean isNumber(String s)\r\n\t{\r\n\t\ttry\r\n\t\t{\r\n\t\t\tDouble.parseDouble(s);\r\n\t\t\treturn true;\r\n\t\t}\r\n\t\tcatch(NumberFormatException ex)\r\n\t\t{\r\n\t\t\treturn false;\r\n\t\t}\r\n\t}", "public static boolean isParsable(String inString)\n\t{\n\t\tboolean blnParsable= true; //tells if the value can be parsed \n\t\ttry\n\t\t{\n\t\t\tDouble.parseDouble (inString);\n\t\t}\n\t\tcatch(NumberFormatException e)\n\t\t{\n\t\t\tblnParsable = false;\n\t\t}\n\t\treturn blnParsable;\n\t}", "private boolean isDecimalEqualToZero(String doubleValue) {\n\t\tif (doubleValue.contains(\"%\")) {\n\t\t\treturn false;\n\t\t}\n\t\tString[] n = doubleValue.split(\"\\\\.\");\n\t\tif(n.length > 1) {\n\t\t\t// get the value to right of decimal point\n\t\t\tint d = Integer.parseInt(n[1]);\n\t\t\treturn d == 0;\n\t\t}\n\t\telse {\n\t\t\treturn true;\n\t\t}\n\t\t\n\t}", "private boolean okay( String s )\n {\n try{\n double x = Double.parseDouble( s );\n return true;\n }\n catch(Exception e)\n {\n return false;\n }\n }", "public boolean isValid(String s) {\n if (s.contains(\".\")) {\n String[] part = s.split(\"\\\\.\");\n if (!part[0].equals(\"0\") && part[0].startsWith(\"0\")) {\n return false;\n } else {\n return !part[1].endsWith(\"0\");\n }\n } else {\n /*\n if the point has no decimal points, we can return true if the string is 0 or if it does not start with\n 0 since 01, 04, 06, etc. are not valid\n */\n if (s.equals(\"0\")) {\n return true;\n } else {\n return !s.startsWith(\"0\");\n }\n }\n }", "private static boolean isNumeric(String str) { \n\t\ttry { \n\t\t\tDouble.parseDouble(str); \n\t\t} \n\t\tcatch(NumberFormatException nfe) { \n\t\t\treturn false; \n\t\t} \n\t\treturn true; \n\t}", "private boolean checkIfObjectIsDecimal(Object[] values)\n\t{\n\t\tfor (Object o : values)\n\t\t{\n\t\t\tif (o != null)\n\t\t\t{\n\t\t\t\ttry\n\t\t\t\t{\n\t\t\t\t\tDouble.parseDouble(o.toString());\n\t\t\t\t//\treturn true;\n\t\t\t\t}\n\t\t\t\tcatch (NumberFormatException e)\n\t\t\t\t{\n\t\t\t\t\t// it's text :)\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn true;\n\t}", "private static boolean isNumeric(String str){\n return str.matches(\"-?\\\\d+(\\\\.\\\\d+)?\"); //match a number with optional '-' and decimal.\n }", "private static boolean isNumeric(String str) {\n // The regular expression can match all numbers, including negative numbers\n Pattern pattern = Pattern.compile(\"-?[0-9]+(\\\\.[0-9]+)?\");\n String bigStr;\n try {\n bigStr = new BigDecimal(str).toString();\n } catch (Exception e) {\n return false;\n }\n // matcher是全匹配\n Matcher isNum = pattern.matcher(bigStr);\n return isNum.matches();\n }", "public static boolean ComprobarNumero(String str) {\n try {\n double d = Double.parseDouble(str);\n return true;\n } catch (NumberFormatException nfe) {\n \treturn false;\n }\n }", "private static boolean isNumeric(String str)\t{\n\n\t\treturn str.matches(\"-?\\\\d+(\\\\.\\\\d+)?\"); \n\t\t\t// match a number with optional '-' and decimal.\n\t}", "private boolean validateBidPrice(String value){\n boolean isValid = true;\n\n if (value == null || value.isEmpty()) {\n isValid = false;\n } else {\n\n try {\n Float valueFloat = Float.valueOf(value);\n } catch (NumberFormatException e) {\n isValid = false;\n }\n\n if (isValid && value.contains(\".\")) {\n String[] priceParts = value.split(\"\\\\.\");\n if (priceParts[1].length() > 2) {\n isValid = false;\n }\n }\n }\n\n return isValid;\n }", "public boolean isDecimal() {\n return false;\n }", "public static boolean isNumericString(String value) {\n\t try {\n\t\t if (Double.parseDouble(value) > 0) {\n\t\t return true;\n\t\t }\n\t } catch (NumberFormatException nfe) {\n\t return false;\n\t }\n\t return false;\n\t}", "public boolean isNumeric(String str) {\n try {\n Double.parseDouble(str);\n } catch (NumberFormatException nfe) {\n return false;\n }\n return true;\n }", "private boolean decimals() {\r\n return OPT(GO() && decimal() && decimals());\r\n }", "public String check_after_decimal_point(double decimal) {\n String result = null;\n String[] after_point = String.valueOf(decimal).split(\"[:.]\");\n if (after_point[after_point.length - 1].equals(\"0\")) {\n result = after_point[0];\n } else {\n result = String.valueOf(decimal).replace(\".\", \",\");\n }\n return result;\n }", "public static boolean isNumeric(String str)\n {\n return str.matches(\"-?\\\\d+(\\\\.\\\\d+)?\"); //match a number with optional '-' and decimal.\n }", "private static boolean isNumeric(String str)\n\t{\n\t\ttry\n\t\t{\n\t\t\tdouble d = Double.parseDouble(str);\n\t\t}\n\t\tcatch (NumberFormatException nfe)\n\t\t{\n\t\t\treturn false;\n\t\t}\n\t\treturn true;\n\t}", "public static boolean isNumeric(String str)\n {\n return str.matches(\"-?\\\\d+(\\\\.\\\\d+)?\"); //match a number with optional '-' and decimal.\n }", "public boolean isNumber(String s) {\n\t\tif (s==null) {\n\t\t\treturn false;\n\t\t}\n\t\t\n\t s = s.trim(); \n\t //avoid \"3e\" which is false\n\t if (s.length() > 0 && s.charAt(s.length() - 1) == 'e') {\n\t \treturn false; \n\t }\n\t \n\t String[] parts = s.split(\"e\");\n\t if (parts.length == 0 || parts.length > 2) {\n\t \treturn false;\n\t }\n\t //check the part before e\n\t boolean res = isValid(parts[0], false); \n\t \n\t //check the part after e, and second half can not have any dot\n\t if (parts.length > 1) {\n\t \tres = res && isValid(parts[1], true);\n\t }\n\t \n\t return res;\n\t}", "public static boolean isDouble(String valor) {\n boolean valido = false;\n if (!valor.endsWith(\".\")) {\n try {\n double cantidad = Double.parseDouble(valor);\n if (cantidad > 0) {\n valido = true;\n }\n } catch (NullPointerException | NumberFormatException e) {\n System.out.println(\"No es un caracter double\");\n }\n }\n\n return valido;\n }", "public static boolean esDouble(String string) {\n\t\tint cantp=0;\n\t\tint pos=0;\n\t\twhile (pos<string.length()) {\n\t\t\tif(string.charAt(pos)=='.')\n\t\t\t\tcantp++;\n\t\t\tpos++;\n\t\t}\n\t\tif(cantp<=1)\n\t\t\treturn true;\n\t\telse\n\t\t\treturn false;\n\t}", "private boolean isDouble(String str)\r\n {\r\n try\r\n {\r\n double i = Double.parseDouble(str);\r\n } catch (NumberFormatException nfe)\r\n {\r\n MyLogger.log(Level.INFO, LOG_CLASS_NAME + \"Non numeric value. Value was: {0}\", str);\r\n return false;\r\n }\r\n return true;\r\n }", "public boolean isNumber(String str) {\n\t\treturn str.matches(\"-?\\\\d+(\\\\.\\\\d+)?\");\n\t}", "public boolean isDecimalType(Class<?> type) {\n\t\tif (this.isSimpleField(type)) {\n\t\t\tString typename = type.getName().toLowerCase();\n\t\t\tif (typename.startsWith(\"java.lang\") || typename.startsWith(\"java.math\")) {\n\t\t\t\ttypename = typename.substring(10);\n\t\t\t}\n\t\t\treturn (DEC_FIELDS.indexOf(typename) >= 0);\n\t\t} else {\n\t\t\treturn false;\n\t\t}\n\t}", "public static boolean isDigit(final String str) {\n if (str == null || str.length() == 0) {\n return false;\n }\n\n for (var i = 0; i < str.length(); i++) {\n if (!Character.isDigit(str.charAt(i)) && str.charAt(i) != '.') {\n return false;\n }\n }\n return true;\n }", "private boolean checkDouble(String str) {\n\t\tint i = 0, flag = 0;\n\t\tchar ch;\n\n\t\tif (str.length() == 0)\n\t\t\treturn false;\n\n\t\twhile (i < str.length()) {\n\t\t\tch = str.charAt(i);\n\n\t\t\tif (ch == '-' && flag == 0) {\n\t\t\t\tflag = 1;\n\t\t\t} else if (ch >= '0' && ch <= '9' && (flag <= 2)) {\n\t\t\t\tflag = 2;\n\t\t\t} else if (ch == '.' && (flag < 3)) {\n\t\t\t\tflag = 3;\n\t\t\t} else if (ch >= '0' && ch <= '9' && (flag == 3 || flag == 4)) {\n\t\t\t\tflag = 4;\n\t\t\t} else if (whiteSpace(ch) && (flag == 2 || flag == 4)) {\n\t\t\t\tflag = 5;\n\t\t\t} else if (!(whiteSpace(ch) && flag == 0)) {\n\t\t\t\treturn false;\n\t\t\t}\n\n\t\t\ti++;\n\t\t}\n\t\tif (flag < 2)\n\t\t\treturn false;\n\t\treturn true;\n\t}", "public static boolean isNumber(String text) {\n try {\n Double.parseDouble(text);\n return true;\n } catch (NumberFormatException e) {\n return false;\n }\n }", "static boolean isDouble(String str) {\n\t\n\t\ttry {\n\t\t\tDouble.parseDouble(str);\n\t\t} \n\t\tcatch (NumberFormatException e) {\n\t\t\treturn false;\n\t\t}\n\n\t\treturn true;\n\t}", "public static boolean numberFormatIsValid(String value) {\n return value.matches(\"^(([0-9]{1,3}[.][0-9]{1,2})|([0-9]{1,3}))$\");\n }", "public boolean checkFormat(String inputPrice){\n // integer followed by a \".\" followed by 2 single digits\n String format = \"((\\\\d+)(.)(\\\\d)(\\\\d))\";\n if(inputPrice.matches(format))\n return true;\n\n return false;\n }", "public boolean isNumber1(String s) {\n\t\tif (s==null) {\n\t\t\treturn false;\n\t\t}\n\t\t\n\t\ts = s.trim(); // Get rid of leading and trailing whitespaces\n if (s.isEmpty()) {\n \treturn false;\n }\n \n boolean isFractional = false; // Indicate appearance of '.'\n boolean isExponential = false; // Indicate appearance of 'e/E'\n boolean valid = false; // Indicate whether preceding digits are valid\n boolean expoBefore = false; // Indicate whether the preceding digit is 'e/E'\n boolean validFrac = true; // Indicate whether the number is a vaild fraction (true by default)\n boolean validExpo = true; // Indicate whether the number is a valid exponential (true by default)\n \n int i = 0;\n if (s.charAt(0) == '+' || s.charAt(0) == '-') // Consider sign\n i = 1;\n \n // Process each digit in sequence\n for (; i < s.length(); i++) {\n char c = s.charAt(i);\n //2e-1, 2e+1\n if (c == '+' || c == '-') { // +/- is valid only after e/E\n if (!expoBefore) {\n \treturn false;\n } \n expoBefore = false;\n valid = false;\n } else if (c == 'e' || c == 'E') { // Only one e/E is valid; preceding digits should be valid\n if (isExponential || !valid) {\n \treturn false;\n } \n isExponential = true;\n valid = false;\n expoBefore = true;\n validExpo = false;\n } else if (c == '.') { // Only one '.' is valid; cannot appear as an exponential\n if (isFractional || isExponential) {\n \treturn false;\n } \n isFractional = true;\n // Must have fractional part\n if (!valid) {\n \tvalidFrac = false;\n } \n } else if (c >= '0' && c <='9') { // Regular digits\n valid = true;\n expoBefore = false;\n validFrac = true;\n validExpo = true;\n } else {\n return false;\n }\n }\n \n // After reaching the end, make sure the number is indeed valid\n if (!valid || !validFrac || !validExpo) {\n \t return false;\n } else {\n \t return true; \n }\n \n }", "public static boolean isNumber(String val)\n {\n\t if(val == null || val.trim().isEmpty())\n\t {\n\t\t return false;\n\t }\n\t else\n\t {\n\t\t Pattern patternForNumber = Pattern.compile(\"^[+-]?(([0-9]+\\\\.?[0-9]+)|[0-9]+)\");\n\t\t return patternForNumber.matcher(val).matches();\n\t }\n }", "public boolean isNum(String cad){\n try{\n Integer.parseInt(cad);\n return true;\n }catch(NumberFormatException nfe){\n System.out.println(\"Solo se aceptan valores numericos\");\n return false;\n }\n }", "public static boolean BasicDecimalNumberValidation(String text, int decimalDigits) {\n String pattern = \"^-?\\\\d*\\\\.?\\\\d{1,\" + decimalDigits + \"}$\";\n return text.matches(pattern);\n }", "private static boolean isNumber(String value){\r\n\t\tfor (int i = 0; i < value.length(); i++){\r\n\t\t\tif (value.charAt(i) < '0' || value.charAt(i) > '9')\r\n\t\t\t\treturn false;\r\n\t\t}\r\n\t\treturn true;\r\n\t}", "@Test\n public void testIsNotValidDecimal2() {\n FieldVerifier service = new FieldVerifier();\n boolean result = service.isValidDecimal(0);\n assertEquals(false, result);\n }", "private boolean isNumeric(String s) {\n return java.util.regex.Pattern.matches(\"\\\\d+\", s);\n }", "public static boolean isDoubleValid (String str) {\r\n try {Double.parseDouble(str);} catch (NumberFormatException e) {return false;}\r\n return true;\r\n }", "public boolean validateFieldInput(String input) {\n\t\tboolean valid = false;\n\t if (input.matches(\"^[0-9]{1,8}([.][0-9]{1,4})?$\") && Double.valueOf(input) >0.0) {\n\t \t\n\t \tvalid = true;\n\t }\n\t \n\t return valid;\n\t}", "public static boolean isNumeric(String value) {\n // Procedimiento para monitorear e informar sobre la excepcion\n try {\n //Se realiza asignacion de dato numerico\n Float.parseFloat(value);\n return true;\n\n }\n //Mostrar mensaje de error\n catch(NumberFormatException e){\n JOptionPane.showMessageDialog(null,Constantes.TXT_Msg_Error,\n \"Error\",\n JOptionPane.ERROR_MESSAGE);\n\n return false;\n\n }\n\n }", "private String filterDecimalString(String string) {\n return string\n .replaceAll(\"[^0-9.]\", \"\")\n .replaceFirst(\"\\\\.\", \"@\")\n .replaceAll(\"\\\\.\", \"\")\n .replaceFirst(\"@\", \".\");\n }", "public static boolean is_double(String s) {\n try {\n double v = Double.parseDouble(s);\n return v <= v; // strange, but this filters out NaN's\n } catch (NumberFormatException e) {\n return false;\n }\n }", "@Test\n public void testIsNotValidDecimal() {\n FieldVerifier service = new FieldVerifier();\n boolean result = service.isValidDecimal(-1);\n assertEquals(false, result);\n }", "public static boolean isNumeric(String aString) {\r\n if (aString == null) {\r\n return false;\r\n } else if (aString.isEmpty()) {\r\n return false;\r\n } else if (aString.indexOf(\".\") != aString.lastIndexOf(\".\")) {\r\n return false;\r\n } else {\r\n int counter = 0;\r\n for ( char c : aString.toCharArray()) {\r\n if ( Character.isDigit(c)) {\r\n counter++;\r\n }\r\n }\r\n return counter == aString.length();\r\n// if (counter == aString.length()) {\r\n// return true;\r\n// }\r\n// return false;\r\n }\r\n }", "public static boolean isNumericInternational(String str)\n {\n try\n {\n double d = Double.parseDouble(str);\n }\n catch(NumberFormatException nfe)\n {\n return false;\n }\n return true;\n }", "private boolean isValidDouble(String text) {\r\n \ttry {\r\n \t\tDouble value = Double.valueOf(text);\r\n \t} catch (NumberFormatException e) {\r\n \t\treturn false;\r\n \t}\r\n \treturn true;\r\n }", "private static boolean checkIfIsDouble(String num) {\n try {\n Double.parseDouble(num);\n return true;\n } catch (NumberFormatException e) {\n return false;\n }\n }", "public static boolean isFloatNoExponent(String str)\n {\n int len = str.length();\n if (len == 0)\n {\n return false;\n }\n\n // skip first char if sign char\n char c = str.charAt(0);\n int i = ((c == '-') || (c == '+')) ? 1 : 0;\n\n // is it only a sign?\n if (i >= len)\n {\n return false;\n }\n\n boolean decimalPointFound = false;\n\n do\n {\n c = str.charAt(i);\n if (c == '.')\n {\n // is this a second dot?\n if (decimalPointFound)\n {\n return false;\n }\n\n decimalPointFound = true;\n }\n else if (!Character.isDigit(c))\n {\n return false;\n }\n\n i++;\n }\n while (i < len);\n\n return true;\n }", "private static boolean isNumeric(String cadena)\n\t {\n\t\t try \n\t\t {\n\t\t\t Integer.parseInt(cadena);\n\t\t\t return true;\n\t\t } catch (NumberFormatException nfe)\n\t\t {\n\t\t\t return false;\n\t\t }\n\t }", "private static boolean validAmount(String amount) {\n int numOfDots = countOccurrences(amount, '.');\n if(numOfDots > 1){\n return false;\n }\n int numOfDollarSigns = countOccurrences(amount, '$');\n if(numOfDollarSigns > 1){\n return false;\n }\n for(int i = 0; i < amount.length(); i++){\n if(amount.charAt(i) != '$' && amount.charAt(i) != '.' && !Character.isDigit(amount.charAt(i))){\n return false;\n }\n }\n return true;\n }", "@Test\n void checkIsTrueForStringWithNumbers() {\n // Act, Assert\n assertTrue(IsNumeric.check(\"3\"));\n assertTrue(IsNumeric.check(\"0\"));\n assertTrue(IsNumeric.check(\"-0f\"));\n assertTrue(IsNumeric.check(\"3.8f\"));\n assertTrue(IsNumeric.check(\"-3.87F\"));\n assertTrue(IsNumeric.check(\"-3\"));\n assertTrue(IsNumeric.check(\"32f\"));\n assertTrue(IsNumeric.check(\"15D\"));\n assertTrue(IsNumeric.check(\"3.2\"));\n assertTrue(IsNumeric.check(\"0.2\"));\n assertTrue(IsNumeric.check(\"-0.28\"));\n assertTrue(IsNumeric.check(\"0.24D\"));\n assertTrue(IsNumeric.check(\"0.379d\"));\n }", "private static int numOfDecimalDigit(String text) {\n\t\treturn text.substring(text.indexOf(\".\") + 1, text.length()).length();\r\n\t}", "public static boolean isNumber(String token) {\n boolean toret = true;\n\n try {\n Double.parseDouble(token);\n }\n catch(Exception e)\n {\n toret = false;\n }\n\n return toret;\n }", "private static boolean isDouble(String input) {\n\t\ttry {\n\t\t\tDouble.parseDouble(input);\n\t\t\treturn true;\n\t\t} catch (Exception ex) {}\n\t\treturn false;\n\t}", "public boolean isNumeric(String strNum) {\n if (strNum == null) {\n return false;\n }\n try {\n double d = Double.parseDouble(strNum);\n } catch (NumberFormatException nfe) {\n return false;\n }\n return true;\n }", "public static boolean isNumeric(String cadena){ \r\n try {\r\n Integer.parseInt(cadena);\r\n return true;\r\n } catch (NumberFormatException e){\t\r\n System.out.println(e.getMessage());\r\n return false;\r\n }\r\n }", "public boolean checkName(String name)\n\t{\n\t\tboolean number=true;\t\t//We are assuming that name will be a String \t\t\n\t\ttry \n\t\t{\t\t\n\t\t\tDouble num=Double.parseDouble(name); //if s contains sting then it will not be parse and it will throw exception\t\n\t\t}\n\t\tcatch(NumberFormatException e)\n\t\t{\n\t\t\tnumber=false;\n\t\t\treturn number;\n\t\t}\t\t\n\t\treturn number;\n\t}", "public static boolean isDouble(String strNum) {\n try {\n double d = Double.parseDouble(strNum);\n } catch (NumberFormatException | NullPointerException nfe) {\n System.out.println(\"Invalid data format\");\n log.error(nfe);\n return false;\n }\n return true;\n }", "public static boolean isNumericRegex(String str)\n {\n return str.matches(\"-?\\\\d+(\\\\.\\\\d+)?\"); //match a number with optional '-' and decimal.\n }", "private boolean isValid(String input){\n return input.length() == 10 && input.matches(\"-?\\\\d+(\\\\.\\\\d+)?\");\n //check its digits\n }", "public boolean tryParseDouble(String value)\n {\n try {\n Double.parseDouble(value);\n return true;\n } catch(NumberFormatException e) {\n return false;\n }\n }", "private boolean isBadDecimal(StratmasDecimal d)\n {\n for (StratmasObject walker = d; walker != null; \n walker = walker.getParent()) {\n if (walker.getType().canSubstitute(\"Shape\")) {\n return true;\n }\n }\n\n return false;\n }", "public boolean isNumeric(String cadena) {\n try {\r\n Integer.parseInt(cadena);\r\n return true;\r\n } catch (NumberFormatException nfe) {\r\n return false;\r\n }\r\n }", "private static boolean isNumeric(String str){\n return NumberUtils.isNumber(str);\n }", "public static boolean isNumeric(String string) { \r\n\t\ttry { \r\n\t\t\tint testNumber = Integer.parseInt(string); \r\n\t\t} catch(NumberFormatException e) { \r\n\t\t\treturn false; \r\n\t\t} \r\n\t\t\r\n\t\treturn true; \r\n\t}", "public static boolean isDouble(String value) {\n\n if (value == null) {\n return false;\n }\n\n boolean valid = false;\n try {\n Double.parseDouble(value);\n valid = true;\n } catch (RuntimeException exc) {\n // could not parse into double, false will be returned\n }\n return valid;\n }", "public boolean isNumeric(String str){\n try {\n int i = Integer.parseInt(str);\n } catch (NumberFormatException nfe) {\n return false;\n }\n return true;\n }", "public static boolean isNumeric(String strNum) {\n if (strNum == null) {\n return false;\n }\n try {\n double d = Double.parseDouble(strNum);\n } catch (NumberFormatException nfe) {\n return false;\n }\n return true;\n }", "public static double ensureDecimal(String rawValue, int place) {\r\n\t\tString returnValue = \"\";\r\n\t\tif (rawValue.indexOf(\".\") == -1) {\r\n\t\t\treturnValue = rawValue.substring(0, (place - 1)) + \".\"\r\n\t\t\t\t\t+ rawValue.substring(place - 1);\r\n\t\t\t// System.out.println(returnValue);\r\n\t\t\treturn (Double.parseDouble(returnValue));\r\n\t\t} else\r\n\t\t\treturn Double.parseDouble(rawValue);\r\n\t}", "private static boolean validNumber(String thing) {\n\t\treturn validDouble(thing);\n\t}", "public static boolean isNumeric(String str) {\n try {\n Integer d = Integer.parseInt(str);\n } catch (NumberFormatException nfe) {\n return false;\n }\n return true;\n }", "public static boolean isNumeric(String cadena) {\n try {\n Integer.parseInt(cadena);\n return true;\n } catch (NumberFormatException ex) {\n return false;\n }\n }", "public static boolean isNumber(String s, int radix) {\n try {\n new BigDecimal(new BigInteger(s, radix));\n\n return true;\n } catch (Exception e) {\n }\n\n return false;\n }", "private static boolean isValidDigit(String strInput) {\n boolean isValid = true;\n if (isPrimitive(strInput)) {\n int input = Integer.parseInt(strInput);\n if (input < 1 || input > 255) {\n log.debug(\"Wrong config input value: {}\", strInput);\n isValid = false;\n } else {\n isValid = true;\n }\n\n } else {\n isValid = false;\n }\n\n return isValid;\n }", "public boolean isNumber(String s)\r\n {\r\n if (s == null)\r\n {\r\n return false;\r\n }\r\n s = s.trim();\r\n ValidNumberStateMachine vnsm = new ValidNumberStateMachine(s);\r\n return vnsm.isValid();\r\n }", "public void testGetNumericValue2() {\n ValueString vs = new ValueString(\"2.8\");\n\n assertEquals(\"2.8\", vs.getString());\n assertEquals(2.8D, vs.getNumber(), 0.0D);\n assertNull(vs.getDate()); // will fail parsing\n assertEquals(false, vs.getBoolean());\n assertEquals(0, vs.getInteger());\n assertEquals(2.8D, vs.getBigNumber().doubleValue(), 0.1D);\n }", "public boolean isNumber(String stringItem) {\n Float floatItem = (float) 0.0;\n try {\n floatItem = Float.valueOf(stringItem);\n } // try\n catch (NumberFormatException IOError) {\n return false;\n } // catch\n return true;\n }", "public static boolean checkIfNumeric(Object toBeChecked)\r\n\t{\r\n\t\ttry {\r\n\t\t\tDouble.parseDouble((String) toBeChecked);\r\n\t\t\treturn true;\r\n\t\t} catch (ClassCastException e) {\r\n\t\t\treturn true;\r\n\t\t} catch (NumberFormatException e) {\r\n\t\t\treturn false;\r\n\t\t}\r\n\t}", "public boolean isNumeric(String str){\r\n\t Pattern pattern = Pattern.compile(\"[0-9]*\");\r\n\t return pattern.matcher(str).matches(); \r\n\t}", "public static boolean isDouble(String str) {\n\t\ttry {\n\t\t\tdouble f = Double.parseDouble(str);\n\t\t} catch (Exception e) {\n\t\t\treturn false;\n\t\t}\n\n\t\treturn true;\n\t}", "@Override\r\n public boolean verify(JComponent arg0) {\r\n \r\n this.field = (JFormattedTextField) arg0;\r\n boolean result = false;\r\n this.value = this.field.getText();\r\n result = Input.isNumericWithDecimal(this.value);\r\n \r\n //if it is numeric with a decimal\r\n if(result == true){\r\n \r\n //Split string on decimal\r\n String[] array = this.value.split(\"\\\\.\");\r\n if (array[0].length() < 12 && array[1].length() < 3) {\r\n result = true;\r\n }\r\n else{\r\n result = false;\r\n }\r\n \r\n }\r\n //check for reasonable length and if value is only numeric\r\n else if (this.value.length() < 12 && Input.isNumeric(this.value)) {\r\n result = true;\r\n }\r\n \r\n return result;\r\n }", "private String doubleChecker(String s) {\n\t\tString newS = \"\";\n\t\tfor(int i = 0; i < s.length(); i++) {\n\t\t\tif((s.charAt(i) > 47 && s.charAt(i) < 58) || s.charAt(i) == '.') {\n\t\t\t\tnewS += s.charAt(i);\n\t\t\t}\n\t\t}\n\t\treturn newS;\n\t}", "private void parseDecimalBAT(String str) throws NumberFormatException\n {\n // The value.\n long theValue;\n\n // Try to parse the string as a decimal long.\n try {\n theValue = Long.parseLong(str);\n } catch (NumberFormatException e) {\n throw new NumberFormatException(\"bad absolute time: \\\"\" + str + \"\\\"\");\n }\n\n // Check for a negative number and reject if so.\n if (theValue <= 0) {\n throw new NumberFormatException(\"bad absolute time: \\\"\" + str + \"\\\"\");\n }\n\n // Set the value in the object.\n itsValue = theValue;\n }", "@Test\n void checkIsTrueForStringWithNumbersWithSpacesAtTheBeginningAndEnd() {\n // Act, Assert\n assertTrue(IsNumeric.check(\" 3\"));\n assertTrue(IsNumeric.check(\"32 \"));\n assertTrue(IsNumeric.check(\" 3.2 \"));\n assertTrue(IsNumeric.check(\" -0.2\"));\n assertTrue(IsNumeric.check(\" -0.2d\"));\n assertTrue(IsNumeric.check(\"0.24D \"));\n assertTrue(IsNumeric.check(\"0.28 \"));\n assertTrue(IsNumeric.check(\" 3.8f\"));\n assertTrue(IsNumeric.check(\"-3.87F \"));\n }", "public static boolean containsOnlyDigitsV1(String str) {\n\n if (str == null || str.isBlank()) {\n // or throw IllegalArgumentException\n return false;\n }\n \n for (int i = 0; i < str.length(); i++) {\n if (!Character.isDigit(str.charAt(i))) {\n return false;\n }\n }\n \n return true;\n }", "private boolean isNumeric(String s)\n {\n for (int i = 0; i < s.length(); ++i)\n {\n if (!Character.isDigit(s.charAt(i)))\n {\n return false;\n }\n }\n return true;\n }", "public static boolean isFLOAT(final String token) {\n\n\t\tint indexOfDot = token.indexOf(dot);\n\n\t\t// Check for empty or 1-size strings.\n\t\tif (token.length() < 2 || indexOfDot <= 0)\n\t\t\treturn false;\n\n\t\t// Check left side\n\t\tString lChars = token.substring(0, indexOfDot);\n\t\t// verify all chars are 0-9.\n\t\tfor (int i = 0; i < lChars.length(); i++) {\n\t\t\tif (!digits.contains(Character.toString(lChars.charAt(i)))) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\n\t\t// if right side exists, check it\n\t\tif (indexOfDot != token.length() - 1) {\n\t\t\tlChars = token.substring(indexOfDot + 1);\n\t\t\t// verify all chars are 0-9.\n\t\t\tfor (int i = 0; i < lChars.length(); i++) {\n\t\t\t\tif (!digits.contains(Character.toString(lChars.charAt(i)))) {\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// Passes all tests!\n\t\treturn true;\n\t}", "public boolean isFloat(String value) {\n try {\n Float.parseFloat(value);\n return true;\n } catch (Exception e) {\n return false;\n }\n }", "public boolean isNum(String x) {\n\t\tfor (int i = 0; i < x.length(); i++) {\n\t\t\tchar c = x.charAt(i);\n\t\t\tif ((c == '-' || c == '+') && x.length() > 1)\n\t\t\t\tcontinue;\n\t\t\tif ((int) c > 47 && (int) c < 58)\n\t\t\t\tcontinue;\n\t\t\telse\n\t\t\t\treturn false;\n\t\t}\n\t\treturn true;\n\t}" ]
[ "0.7745456", "0.7077546", "0.6957247", "0.69045377", "0.68851817", "0.68773526", "0.6794734", "0.67535853", "0.6733808", "0.6705036", "0.66283846", "0.6623698", "0.66006273", "0.6578927", "0.6567979", "0.65628076", "0.6534059", "0.6528588", "0.6438526", "0.6432925", "0.6427403", "0.64116895", "0.6392208", "0.63915986", "0.6376438", "0.6375649", "0.63620853", "0.63570744", "0.63534486", "0.6335343", "0.63259906", "0.63033205", "0.62546957", "0.62522596", "0.6239988", "0.6230456", "0.61956275", "0.61905414", "0.6185683", "0.6182689", "0.61813277", "0.6169978", "0.6160813", "0.61604494", "0.615304", "0.6150522", "0.61418366", "0.6138788", "0.61386335", "0.6129086", "0.61259836", "0.61216795", "0.61209077", "0.60951823", "0.6089203", "0.60799676", "0.60609233", "0.60501087", "0.6041824", "0.60155135", "0.6013344", "0.6004093", "0.59873635", "0.5979603", "0.5979509", "0.59640574", "0.59634596", "0.59426343", "0.5929125", "0.5926956", "0.592311", "0.5910943", "0.5901987", "0.58954555", "0.5892972", "0.5881916", "0.5876937", "0.5870116", "0.58580387", "0.58351386", "0.5804972", "0.579849", "0.5781768", "0.57766956", "0.5769051", "0.5759414", "0.5757332", "0.57513356", "0.5751001", "0.5732206", "0.57256615", "0.57255214", "0.57158726", "0.56883305", "0.56801325", "0.5679968", "0.5675288", "0.5665049", "0.5657035", "0.5656453" ]
0.7809409
0
check if a string is numeric
public boolean isNumeric(String sNumericString) { try { for (char c : sNumericString.toCharArray()) { if (!Character.isDigit(c)) { return false; } } return true; } catch (Exception e) { return false; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private static boolean isNumeric(String str) { \n\t\ttry { \n\t\t\tDouble.parseDouble(str); \n\t\t} \n\t\tcatch(NumberFormatException nfe) { \n\t\t\treturn false; \n\t\t} \n\t\treturn true; \n\t}", "private static boolean isNumeric(String str){\n return str.matches(\"-?\\\\d+(\\\\.\\\\d+)?\"); //match a number with optional '-' and decimal.\n }", "private static boolean isNumeric(String str)\t{\n\n\t\treturn str.matches(\"-?\\\\d+(\\\\.\\\\d+)?\"); \n\t\t\t// match a number with optional '-' and decimal.\n\t}", "private boolean isNumeric(String s) {\n return java.util.regex.Pattern.matches(\"\\\\d+\", s);\n }", "private static boolean isNumeric(String str){\n return NumberUtils.isNumber(str);\n }", "private static boolean isNumeric(String str)\n\t{\n\t\ttry\n\t\t{\n\t\t\tdouble d = Double.parseDouble(str);\n\t\t}\n\t\tcatch (NumberFormatException nfe)\n\t\t{\n\t\t\treturn false;\n\t\t}\n\t\treturn true;\n\t}", "public boolean isNumeric(String str){\n try {\n int i = Integer.parseInt(str);\n } catch (NumberFormatException nfe) {\n return false;\n }\n return true;\n }", "public static boolean isNumeric(String str)\n {\n return str.matches(\"-?\\\\d+(\\\\.\\\\d+)?\"); //match a number with optional '-' and decimal.\n }", "public static boolean isNumeric(String str)\n {\n return str.matches(\"-?\\\\d+(\\\\.\\\\d+)?\"); //match a number with optional '-' and decimal.\n }", "private static boolean isNumeric(String cadena)\n\t {\n\t\t try \n\t\t {\n\t\t\t Integer.parseInt(cadena);\n\t\t\t return true;\n\t\t } catch (NumberFormatException nfe)\n\t\t {\n\t\t\t return false;\n\t\t }\n\t }", "public boolean isNumeric(String str) {\n try {\n Double.parseDouble(str);\n } catch (NumberFormatException nfe) {\n return false;\n }\n return true;\n }", "public boolean isNumeric(String strNum) {\n if (strNum == null) {\n return false;\n }\n try {\n double d = Double.parseDouble(strNum);\n } catch (NumberFormatException nfe) {\n return false;\n }\n return true;\n }", "public static boolean isNumeric(String string) { \r\n\t\ttry { \r\n\t\t\tint testNumber = Integer.parseInt(string); \r\n\t\t} catch(NumberFormatException e) { \r\n\t\t\treturn false; \r\n\t\t} \r\n\t\t\r\n\t\treturn true; \r\n\t}", "public static boolean isNumeric(String str) {\n try {\n Integer d = Integer.parseInt(str);\n } catch (NumberFormatException nfe) {\n return false;\n }\n return true;\n }", "public static boolean isNumeric(String strNum) {\n if (strNum == null) {\n return false;\n }\n try {\n double d = Double.parseDouble(strNum);\n } catch (NumberFormatException nfe) {\n return false;\n }\n return true;\n }", "public boolean isNumeric(String str){\r\n\t Pattern pattern = Pattern.compile(\"[0-9]*\");\r\n\t return pattern.matcher(str).matches(); \r\n\t}", "public static boolean isNumeric(String strNum) {\n if (strNum == null) {\n return false;\n }\n try {\n Integer d = Integer.parseInt(strNum);\n } catch (NumberFormatException nfe) {\n return false;\n }\n return true;\n }", "public static boolean isNumericString(String value) {\n\t try {\n\t\t if (Double.parseDouble(value) > 0) {\n\t\t return true;\n\t\t }\n\t } catch (NumberFormatException nfe) {\n\t return false;\n\t }\n\t return false;\n\t}", "public boolean isNum(String cad){\n try{\n Integer.parseInt(cad);\n return true;\n }catch(NumberFormatException nfe){\n System.out.println(\"Solo se aceptan valores numericos\");\n return false;\n }\n }", "public static boolean isNumeric(String cadena){ \r\n try {\r\n Integer.parseInt(cadena);\r\n return true;\r\n } catch (NumberFormatException e){\t\r\n System.out.println(e.getMessage());\r\n return false;\r\n }\r\n }", "private boolean isNumeric(String s)\n {\n for (int i = 0; i < s.length(); ++i)\n {\n if (!Character.isDigit(s.charAt(i)))\n {\n return false;\n }\n }\n return true;\n }", "public static boolean isNumeric(String input) {\n\t\ttry {\n\t\t\tInteger.parseInt(input);\n\t\t\treturn true;\n\t\t}\n\t\tcatch (NumberFormatException e) {\n\t\t\t// string is not numeric\n\t\t\treturn false;\n\t\t}\n\t}", "public static boolean isNumeric(String num) {\n\t\ttry {\n\t\t\tdouble d = Double.parseDouble(num);\n\t\t} catch (NumberFormatException e) {\n\t\t\treturn false;\n\t\t}\n\t\treturn true;\n\t}", "private boolean stringIsNumeric(String str) {\n\t\tfor(char c : str.toCharArray()) {\n\t\t\tif(!Character.isDigit(c)) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn true;\n\t}", "public static boolean isNumeric(String strNum) {\r\n if (strNum == null) {\r\n return true;\r\n }\r\n try {\r\n Integer.parseInt(strNum);\r\n } catch (NumberFormatException nfe) {\r\n return true;\r\n }\r\n return false;\r\n }", "public boolean isNumeric(String cadena) {\n try {\r\n Integer.parseInt(cadena);\r\n return true;\r\n } catch (NumberFormatException nfe) {\r\n return false;\r\n }\r\n }", "public boolean isNum() \n\t{ \n\t try \n\t { \n\t int d = Integer.parseInt(numeric); \n\t } \n\t catch(NumberFormatException nfe) \n\t { \n\t return false; \n\t } \n\t return true; \n\t}", "private boolean isNumber(String s) {\n\t\ttry {\n\t\t\tDouble.parseDouble(s);\n\t\t} catch (NumberFormatException nfe) {\n\t\t\treturn false;\n\t\t}\n\t\treturn true;\n\t}", "protected boolean isNumber(String s)\r\n\t{\r\n\t\ttry\r\n\t\t{\r\n\t\t\tDouble.parseDouble(s);\r\n\t\t\treturn true;\r\n\t\t}\r\n\t\tcatch(NumberFormatException ex)\r\n\t\t{\r\n\t\t\treturn false;\r\n\t\t}\r\n\t}", "public static boolean isNumeric(String str) {\n\t\ttry {\n\t\t\tInteger.parseInt(str.trim().substring(0, 1));\n\t\t\treturn true;\n\t\t} catch (NumberFormatException e) {\n\t\t\treturn false;\n\t\t}\n\t}", "public static boolean isNumeric(String cadena) {\n try {\n Integer.parseInt(cadena);\n return true;\n } catch (NumberFormatException ex) {\n return false;\n }\n }", "public static boolean isNumeric(String str) {\n if (isBlank(str)) {\n return false;\n }\n\n char[] charArray = str.toCharArray();\n\n for (char c : charArray) {\n if (!Character.isDigit(c)) {\n return false;\n }\n }\n\n return true;\n }", "public static boolean isNumeric(String str)\n {\n return str.chars().allMatch( Character::isDigit );\n }", "public static boolean isNumericRegex(String str)\n {\n return str.matches(\"-?\\\\d+(\\\\.\\\\d+)?\"); //match a number with optional '-' and decimal.\n }", "private boolean isNumber(String str) {\r\n int ASCII_0 = 48;\r\n int ASCII_9 = 57;\r\n if (str.equals(\"\")) {\r\n return false;\r\n }\r\n for (int i = 0; i < str.length(); i++) {\r\n int chr = str.charAt(i);\r\n if (chr < ASCII_0 || chr > ASCII_9) {\r\n return false;\r\n }\r\n }\r\n return true;\r\n }", "public abstract boolean isNumeric();", "public static boolean isNumericInternational(String str)\n {\n try\n {\n double d = Double.parseDouble(str);\n }\n catch(NumberFormatException nfe)\n {\n return false;\n }\n return true;\n }", "public boolean isNumber(String str) {\n\t\treturn str.matches(\"-?\\\\d+(\\\\.\\\\d+)?\");\n\t}", "public static boolean isNumeric(final String input) {\n\t\tif (input == null || input.isEmpty())\n\t\t\treturn false;\n\n\t\tfor (int i = 0; i < input.length(); i++)\n\t\t\tif (!Character.isDigit(input.charAt(i)))\n\t\t\t\treturn false;\n\n\t\treturn true;\n\t}", "private static boolean isNumeric(String str) {\n // The regular expression can match all numbers, including negative numbers\n Pattern pattern = Pattern.compile(\"-?[0-9]+(\\\\.[0-9]+)?\");\n String bigStr;\n try {\n bigStr = new BigDecimal(str).toString();\n } catch (Exception e) {\n return false;\n }\n // matcher是全匹配\n Matcher isNum = pattern.matcher(bigStr);\n return isNum.matches();\n }", "public boolean isNum(String x) {\n\t\tfor (int i = 0; i < x.length(); i++) {\n\t\t\tchar c = x.charAt(i);\n\t\t\tif ((c == '-' || c == '+') && x.length() > 1)\n\t\t\t\tcontinue;\n\t\t\tif ((int) c > 47 && (int) c < 58)\n\t\t\t\tcontinue;\n\t\t\telse\n\t\t\t\treturn false;\n\t\t}\n\t\treturn true;\n\t}", "private static boolean isNumber(String value){\r\n\t\tfor (int i = 0; i < value.length(); i++){\r\n\t\t\tif (value.charAt(i) < '0' || value.charAt(i) > '9')\r\n\t\t\t\treturn false;\r\n\t\t}\r\n\t\treturn true;\r\n\t}", "private boolean isNotNumeric(String s) {\n return s.matches(\"(.*)\\\\D(.*)\");\n }", "public static boolean isNumber(String text) {\n try {\n Double.parseDouble(text);\n return true;\n } catch (NumberFormatException e) {\n return false;\n }\n }", "@Test\n void checkIsTrueForStringWithNumbers() {\n // Act, Assert\n assertTrue(IsNumeric.check(\"3\"));\n assertTrue(IsNumeric.check(\"0\"));\n assertTrue(IsNumeric.check(\"-0f\"));\n assertTrue(IsNumeric.check(\"3.8f\"));\n assertTrue(IsNumeric.check(\"-3.87F\"));\n assertTrue(IsNumeric.check(\"-3\"));\n assertTrue(IsNumeric.check(\"32f\"));\n assertTrue(IsNumeric.check(\"15D\"));\n assertTrue(IsNumeric.check(\"3.2\"));\n assertTrue(IsNumeric.check(\"0.2\"));\n assertTrue(IsNumeric.check(\"-0.28\"));\n assertTrue(IsNumeric.check(\"0.24D\"));\n assertTrue(IsNumeric.check(\"0.379d\"));\n }", "public boolean isNumber(String str)\r\n\t{\r\n\t\tfor(int i = 0; i < str.length(); i++)\r\n\t\t{\r\n\t\t\tif(!Character.isDigit(str.charAt(i)))\r\n\t\t\t\treturn false;\r\n\t\t}\r\n\t\treturn true;\r\n\t}", "public static boolean isNumber(String s) \r\n{ \r\n for (int i = 0; i < s.length(); i++) \r\n if (Character.isDigit(s.charAt(i)) \r\n == false) \r\n return false; \r\n\r\n return true; \r\n}", "public static Boolean isNumeric(String text)\n {\n //This checks for negative numbers...\n if (text.startsWith(\"-\"))\n {\n text = text.substring(1, text.length());\n }\n\n for (char c : text.toCharArray())\n {\n if (!Character.isDigit(c))\n {\n return false;\n }\n }\n return true;\n }", "protected boolean isNumeric(final String id) {\n\t\tfinal NumberFormat formatter = NumberFormat.getInstance();\n\t\tfinal ParsePosition pos = new ParsePosition(0);\n\t\tformatter.parse(id, pos);\n\t\treturn id.length() == pos.getIndex();\n\t}", "public static boolean isNumber(final String s) {\r\n\t\tfor (int i = 0; i < s.length(); i++) {\r\n\t\t\tif (!Character.isDigit(s.charAt(i))) {\r\n\t\t\t\treturn false;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\treturn true;\r\n\t}", "public static boolean isNumeric(String aString) {\r\n if (aString == null) {\r\n return false;\r\n } else if (aString.isEmpty()) {\r\n return false;\r\n } else if (aString.indexOf(\".\") != aString.lastIndexOf(\".\")) {\r\n return false;\r\n } else {\r\n int counter = 0;\r\n for ( char c : aString.toCharArray()) {\r\n if ( Character.isDigit(c)) {\r\n counter++;\r\n }\r\n }\r\n return counter == aString.length();\r\n// if (counter == aString.length()) {\r\n// return true;\r\n// }\r\n// return false;\r\n }\r\n }", "public static boolean ComprobarNumero(String str) {\n try {\n double d = Double.parseDouble(str);\n return true;\n } catch (NumberFormatException nfe) {\n \treturn false;\n }\n }", "public static boolean isNumeric(String value) {\n // Procedimiento para monitorear e informar sobre la excepcion\n try {\n //Se realiza asignacion de dato numerico\n Float.parseFloat(value);\n return true;\n\n }\n //Mostrar mensaje de error\n catch(NumberFormatException e){\n JOptionPane.showMessageDialog(null,Constantes.TXT_Msg_Error,\n \"Error\",\n JOptionPane.ERROR_MESSAGE);\n\n return false;\n\n }\n\n }", "public static boolean isNumber(String string) {\n\n\t\ttry {\n\t\t\tLong.parseLong(string);\n\t\t\treturn true;\n\t\t} catch (Exception e) {\n\t\t\treturn false;\n\t\t}\n\n\t}", "public static boolean isNumber(String text)\r\n\t{\r\n\t\ttry\r\n\t\t{\r\n\t\t\tInteger.parseInt(text);\r\n\t\t\treturn true;\r\n\t\t}\r\n\t\tcatch(NumberFormatException e)\r\n\t\t{\r\n\t\t\treturn false;\r\n\t\t}\r\n\t}", "public static boolean isNumber(String text) {\r\n\t\ttry {\r\n\t\t\tInteger.parseInt(text);\r\n\t\t} catch(NumberFormatException e) {\r\n\t\t\treturn false;\r\n\t\t}\r\n\t\treturn true;\r\n\t}", "public static boolean isNumber(String str){\n try {\n Integer.parseInt(str);\n } catch(NumberFormatException e) {\n return false;\n } catch(NullPointerException e) {\n return false;\n }\n return true;\n }", "private static boolean validNumber(String thing) {\n\t\treturn validDouble(thing);\n\t}", "public static final boolean isNumber(String str) {\n\t\treturn isNumber(str,true);\n\t}", "public boolean isNumber(String in) \n\t{\n\t\ttry \n\t\t{\n\t\t\tInteger.parseInt(in);\n\t\t\treturn true;\n\t\t}\n\t\tcatch (Exception e) \n\t\t{\n\t\t\treturn false;\n\t\t}\n\t}", "@Test\n void checkIsTrueForStringWithNumbersWithSpacesAtTheBeginningAndEnd() {\n // Act, Assert\n assertTrue(IsNumeric.check(\" 3\"));\n assertTrue(IsNumeric.check(\"32 \"));\n assertTrue(IsNumeric.check(\" 3.2 \"));\n assertTrue(IsNumeric.check(\" -0.2\"));\n assertTrue(IsNumeric.check(\" -0.2d\"));\n assertTrue(IsNumeric.check(\"0.24D \"));\n assertTrue(IsNumeric.check(\"0.28 \"));\n assertTrue(IsNumeric.check(\" 3.8f\"));\n assertTrue(IsNumeric.check(\"-3.87F \"));\n }", "private boolean isNumber( String test ) {\n\treturn test.matches(\"\\\\d+\");\n }", "public boolean isNumber(String s)\r\n {\r\n if (s == null)\r\n {\r\n return false;\r\n }\r\n s = s.trim();\r\n ValidNumberStateMachine vnsm = new ValidNumberStateMachine(s);\r\n return vnsm.isValid();\r\n }", "public static boolean isNumber(String str){\n return str != null && numberPattern.matcher(str).matches();\n }", "@Test\n public void isNumeric() {\n assertTrue(Deadline.isNumeric(VALID_YEAR_2018));\n\n //contains other symbols -> false\n assertFalse(Deadline.isNumeric(INVALID_YEAR_WITH_SYMBOLS));\n\n //contains alphabets -> false\n assertFalse(Deadline.isNumeric(INVALID_YEAR_WITH_ALPHABETS));\n\n //contains space -> false\n assertFalse(Deadline.isNumeric(INVALID_YEAR_WITH_SPACE));\n }", "public boolean isNumeric() {\n return this.isInteger() || this.isDecimal() || this.isDouble();\n }", "public static boolean isNumber(String input) {\n boolean hasDecimal = false;\n for (int i = 0; i < input.length(); i++) {\n char test = input.charAt(i);\n if (test == '-' && i == 0)\n continue; // Allow negative indicator.\n\n if (test == '.') {\n if (!hasDecimal) {\n hasDecimal = true;\n continue;\n } else {\n return false; // Multiple decimal = invalid number.\n }\n }\n\n if (!Character.isDigit(test))\n return false; // Character isn't a digit, so it can't be a number.\n }\n\n return true;\n }", "private boolean valid_numbers(String nr)\n\t{\n\t\t// loop through the string, char by char\n\t\tfor(int i = 0; i < nr.length();i++)\n\t\t{\n\t\t\t// if the char is not a numeric value or negative\n\t\t\tif(Character.getNumericValue(nr.charAt(i)) < 0)\n\t\t\t{\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\t\t// if it did not return false in the loop, return true\n\t\treturn true;\n\t}", "public static boolean isNumber(String val)\n {\n\t if(val == null || val.trim().isEmpty())\n\t {\n\t\t return false;\n\t }\n\t else\n\t {\n\t\t Pattern patternForNumber = Pattern.compile(\"^[+-]?(([0-9]+\\\\.?[0-9]+)|[0-9]+)\");\n\t\t return patternForNumber.matcher(val).matches();\n\t }\n }", "public static boolean checkIfNumeric(Object toBeChecked)\r\n\t{\r\n\t\ttry {\r\n\t\t\tDouble.parseDouble((String) toBeChecked);\r\n\t\t\treturn true;\r\n\t\t} catch (ClassCastException e) {\r\n\t\t\treturn true;\r\n\t\t} catch (NumberFormatException e) {\r\n\t\t\treturn false;\r\n\t\t}\r\n\t}", "public static boolean isNumeric(char c)\n\t{\n\t\tif (c >= '0' && c <= '9')\n\t\t\treturn true;\n\t\telse if (c == '.')\n\t\t\treturn true;\n\t\telse if (c == '-')\n\t\t\treturn true;\n\t\telse\n\t\t\treturn false;\n\t}", "public static boolean isNumeric(char num) {\n\t\treturn isNumeric(String.valueOf(num));\n\t}", "public static boolean isDigit(final String str) {\n if (str == null || str.length() == 0) {\n return false;\n }\n\n for (var i = 0; i < str.length(); i++) {\n if (!Character.isDigit(str.charAt(i)) && str.charAt(i) != '.') {\n return false;\n }\n }\n return true;\n }", "public boolean isNumber(String sIn)\r\n {\r\n int parseNumber = -1;\r\n \r\n try{\r\n parseNumber = Integer.parseInt(sIn);\r\n }catch(Exception e){\r\n return false;\r\n }\r\n \r\n return true;\r\n }", "public static boolean isNumber(String token) {\n boolean toret = true;\n\n try {\n Double.parseDouble(token);\n }\n catch(Exception e)\n {\n toret = false;\n }\n\n return toret;\n }", "private boolean containsOnlyNumbers(String inputString)\r\n {\r\n inputString = inputString.trim();\r\n if (inputString.equals(null))\r\n return false;\r\n else\r\n for (int i = 0; i < inputString.length(); i++)\r\n if (!(inputString.charAt(i) >= '0' && inputString.charAt(i) <= '9'))\r\n return false;\r\n return true;\r\n }", "public static boolean isNumber(String string) {\n if (string == null || string.isEmpty()) {\n return false;\n }\n int i = 0;\n if (string.charAt(0) == '-') {\n if (string.length() > 1) {\n i++;\n } else {\n return false;\n }\n }\n for (; i < string.length(); i++) {\n if (!Character.isDigit(string.charAt(i))) {\n return false;\n }\n }\n return true;\n}", "public static boolean isNumeric(String field) {\r\n\t\tif (isEmpty(field))\r\n\t\t\treturn true;\r\n\t\telse\r\n\t\t\tfield = field.trim();\r\n\t\tif (field.trim().matches(\"[0-9\\\\-\\\\(\\\\)\\\\ ]*\")) {\r\n\t\t\treturn true;\r\n\t\t}\r\n\t\treturn false;\r\n\t}", "public static final boolean isNumeric(char c, int i) {\r\n return NUMERIC_FORMAT_CHARS.indexOf(c) >= 0 || (i <= 2 && NUMERIC_FORMAT_CHARS2.indexOf(c) >= 0);\r\n }", "@Test\n public void isNumericNegetive() {\n Boolean bool = Utils.isNumeric(\"123a\");\n Assert.assertEquals(false, bool);\n }", "public static boolean isNumeric(String userInput) {\n return Pattern.matches(Constants.ID_VALIDATION, userInput);\n }", "@Test\n void checkIsFalseForStringWithNumbersAndOtherChars() {\n // Act, Assert\n assertFalse(IsNumeric.check(\"a3\"));\n assertFalse(IsNumeric.check(\"3l\"));\n assertFalse(IsNumeric.check(\"345L\"));\n assertFalse(IsNumeric.check(\"32b\"));\n assertFalse(IsNumeric.check(\"*3.2 \"));\n assertFalse(IsNumeric.check(\"/0.2\"));\n assertFalse(IsNumeric.check(\"0.28L\"));\n assertFalse(IsNumeric.check(\"0.28.\"));\n assertFalse(IsNumeric.check(\"3.2.4\"));\n assertFalse(IsNumeric.check(\"0x400\"));\n assertFalse(IsNumeric.check(\"0.24Dd\"));\n }", "public static boolean isNumber(String val){\n\t\t\n\t\tfor(int i=0;i<val.length();i++){\n\t\t\tif((val.charAt(i) >= '0' && val.charAt(i) <= '9') || (val.charAt(i) >= 'A' && val.charAt(i) <= 'F') || (val.charAt(i) >= 97 && val.charAt(i) <= 102)){\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\telse\n\t\t\t\treturn false;\n\t\t}\n\t\treturn true;\n\t}", "boolean isNumeric(char pChar)\n{\n\n //check each possible number\n if (pChar == '0') {return true;}\n if (pChar == '1') {return true;}\n if (pChar == '2') {return true;}\n if (pChar == '3') {return true;}\n if (pChar == '4') {return true;}\n if (pChar == '5') {return true;}\n if (pChar == '6') {return true;}\n if (pChar == '7') {return true;}\n if (pChar == '8') {return true;}\n if (pChar == '9') {return true;}\n\n return false; //not numeric\n\n}", "public boolean isNumber(String num)\t{\n\t\tfor(int i=0;i<13;i++)\t{\n\t\t\tif(Integer.parseInt(num)==i)\t{\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\t\treturn false;\n\t}", "private static boolean isNumber( char i ) {\n\t\tif ( Character.isDigit(i) ) return true; \n\t\tthrow new IllegalArgumentException(\"The weight of the route should be a number, now it's '\"+ i +\"'\");\n\t}", "public boolean isDigit(String s)\r\n\t\t{\n\t\t\tfor(char c : s.toCharArray())\r\n\t\t\t{\r\n\t\t\t if(!(Character.isDigit(c)))\r\n\t\t\t {\r\n\t\t\t return false;\r\n\t\t\t }\r\n\t\t\t}\r\n\t\t\t//return false;\r\n\t\t\treturn true;\r\n\t\t}", "public boolean isNumber(String stringItem) {\n Float floatItem = (float) 0.0;\n try {\n floatItem = Float.valueOf(stringItem);\n } // try\n catch (NumberFormatException IOError) {\n return false;\n } // catch\n return true;\n }", "public static boolean isnumber(char c) {\n\t\tif (c=='0'||c=='1'||c=='2'||c=='3'||c=='4'||c=='5'||c=='6'||c=='7'||c=='8'||c=='9') {\n\t\t\treturn true;// return true if that char is number\n\t\t}\n\t\telse { //else return false\n\t\t\treturn false;\n\t\t}\n\t}", "public static boolean validNumericTextEntryStr(String str, boolean allowDouble)\n\t{\n\t\tif(allowDouble)\n\t\t\treturn str.matches(\"^[0-9]+((\\\\.|,)[0-9]*|)$\");\n\t\telse\n\t\t\treturn str.matches(\"^[0-9]+$\");\n\t}", "public static boolean numbersCheck(String num)\r\n\t{\r\n\t\treturn num.matches(\"[0-9]+\");\r\n\t}", "public static boolean isInt(String strNum) {\n try {\n int d = Integer.parseInt(strNum);\n } catch (NumberFormatException | NullPointerException nfe) {\n System.out.println(\"Invalid data format\");\n log.error(nfe);\n return false;\n }\n return true;\n }", "public static boolean isNumber(String s, int radix) {\n try {\n new BigDecimal(new BigInteger(s, radix));\n\n return true;\n } catch (Exception e) {\n }\n\n return false;\n }", "public boolean isNumber(String s) {\n\t\tif (s==null) {\n\t\t\treturn false;\n\t\t}\n\t\t\n\t s = s.trim(); \n\t //avoid \"3e\" which is false\n\t if (s.length() > 0 && s.charAt(s.length() - 1) == 'e') {\n\t \treturn false; \n\t }\n\t \n\t String[] parts = s.split(\"e\");\n\t if (parts.length == 0 || parts.length > 2) {\n\t \treturn false;\n\t }\n\t //check the part before e\n\t boolean res = isValid(parts[0], false); \n\t \n\t //check the part after e, and second half can not have any dot\n\t if (parts.length > 1) {\n\t \tres = res && isValid(parts[1], true);\n\t }\n\t \n\t return res;\n\t}", "private boolean isInteger(String str)\r\n {\r\n try\r\n {\r\n int i = Integer.parseInt(str);\r\n } catch (NumberFormatException nfe)\r\n {\r\n MyLogger.log(Level.INFO, LOG_CLASS_NAME + \"Non numeric value. Value was: {0}\", str);\r\n return false;\r\n }\r\n return true;\r\n }", "private boolean isNumber(String number){\n\t\ttry{\r\n\t\t\tFloat.parseFloat(number);\r\n\t\t}catch(Exception e){\r\n\t\t\treturn false;// if the user input is not number it throws flase\r\n\t\t}\r\n\t\treturn true;\r\n\t}", "private static boolean areNumbers(String s) {\n boolean isADigit = false;//only changed once everything has been checked\n //checks if places 0-2 are numbers and 3 is a \"-\"\n for(int i = 0; i < 3; i++) {\n if(Character.isDigit(s.charAt(i)) && s.charAt(3) == '-') {\n isADigit = true;\n }\n }\n //checks if places 4-5 are numbers and 6 is a \"-\"\n for(int i = 4; i < 6; i++) {\n if(Character.isDigit(s.charAt(i)) && s.charAt(6) == '-') {\n isADigit = true;\n }\n }\n //checks if places 7-10 are numbers\n for(int i = 7; i < 11; i++) {\n if(Character.isDigit(s.charAt(i))) {\n isADigit = true;\n }\n }\n return isADigit;\n }", "private static boolean checkIfIsDouble(String num) {\n try {\n Double.parseDouble(num);\n return true;\n } catch (NumberFormatException e) {\n return false;\n }\n }", "public boolean isNumber(String input) {\r\n\t\tif (input == null || input.isEmpty())\r\n\t\t\treturn false;\r\n\t\tif (input.charAt(0) == '-')\r\n\t\t\treturn false;\r\n\t\tfor (int i = 0; i < input.length(); i++) {\r\n\t\t\tif (Character.isDigit(input.charAt(i)) == false)\r\n\t\t\t\treturn false;\r\n\t\t\tif (Integer.parseInt(input) < 1 || Integer.parseInt(input) > 7)\r\n\t\t\t\treturn false;\r\n\t\t}\r\n\t\treturn true;\r\n\t}", "@Test\n public void isNumeric() {\n Boolean bool = Utils.isNumeric(\"123\");\n Assert.assertEquals(true, bool);\n }" ]
[ "0.8357487", "0.8356089", "0.83044535", "0.8295829", "0.82601696", "0.8255934", "0.82348186", "0.8218124", "0.8212148", "0.81751126", "0.81592023", "0.8143244", "0.8140167", "0.808156", "0.80768335", "0.80741787", "0.8033325", "0.79852915", "0.7952806", "0.79472846", "0.7945415", "0.79381496", "0.7936089", "0.79339033", "0.7932317", "0.78830564", "0.7877236", "0.7861252", "0.78317827", "0.7826785", "0.77920055", "0.77815515", "0.775531", "0.7743725", "0.77233195", "0.77210337", "0.77187747", "0.770199", "0.76785415", "0.76615155", "0.7650026", "0.76276773", "0.7618876", "0.7607844", "0.75615245", "0.75514495", "0.7507629", "0.75061435", "0.7490813", "0.7488117", "0.7484567", "0.7411165", "0.740947", "0.7398999", "0.7391263", "0.7327052", "0.73215723", "0.7313742", "0.7297934", "0.72978413", "0.72566986", "0.72454256", "0.7241258", "0.7202914", "0.7198813", "0.7194492", "0.71873075", "0.71856445", "0.7156671", "0.7140796", "0.7108323", "0.7102499", "0.7073356", "0.7072143", "0.7049751", "0.70420927", "0.70412797", "0.7031765", "0.70312274", "0.7002809", "0.6990817", "0.6984702", "0.6984485", "0.69833934", "0.6952164", "0.693158", "0.69297206", "0.6884984", "0.68763506", "0.6862008", "0.6855281", "0.68518215", "0.6847051", "0.6827097", "0.6820061", "0.6802039", "0.6796777", "0.6780429", "0.67748624", "0.6763699" ]
0.7504515
48
methods to convert double variable to string
public String DoubleToString(double dValue) { String sValue = ""; try { sValue = String.format("%.4f", dValue); } catch (Exception e) { sValue = ""; } finally { return sValue; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "static String double2String (Double a){\n String s = \"\"+a;\n String[] arr = s.split(\"\\\\.\");\n if (arr[1].length()==1) s+=\"0\";\n return s;\n }", "public String format(double number);", "private static String toPsString(double d) {\n return \"(\" + d + \")\";\n }", "public static String DoubleToString(double DoubleValue){\n Double doublee = new Double(DoubleValue);\n return doublee.toString(); \n }", "private String doubleToDecimalString(double toFormat){\r\n\r\n String d = \"\";\r\n DecimalFormat df = new DecimalFormat(\"0.00\");\r\n d = df.format(toFormat);\r\n\r\n return d;\r\n }", "public String toString() {\n\t\treturn String.valueOf(mDouble);\n\t}", "String doubleWrite();", "public static String doubleToString(double d) {\n\t\n\t\tString result = \"\";\n\t\t\n\t\tresult = (new Double(d)).toString();\n\t\n\t\treturn result;\n\t}", "private static String DoubleToBinaryString(double data){\n long longData = Double.doubleToLongBits(data);\n //A long is 64-bit\n return String.format(\"%64s\", Long.toBinaryString(longData)).replace(' ', '0');\n }", "String floatWrite();", "static protected String[] double2String(double[][] d){ // Borrowed from JMatLink\r\nString encodeS[]=new String[d.length]; // String vector\r\n// for all rows\r\nfor (int n=0; n<d.length; n++){\r\nbyte b[] = new byte[d[n].length];\r\n// convert row from double to byte\r\nfor (int i=0; i<d[n].length ;i++) b[i]=(byte)d[n][i];\r\n\r\n// convert byte to String\r\ntry { encodeS[n] = new String(b, \"UTF8\");}\r\ncatch (UnsupportedEncodingException e) { e.printStackTrace(); }\r\n}\r\nreturn encodeS;\r\n}", "protected static String fastDoubleToString(double val, int precision) {\n\t\tStringBuilder sb = new StringBuilder();\n\t\tif (val < 0) {\n\t\t\tsb.append('-');\n\t\t\tval = -val;\n\t\t}\n\t\tlong exp = POW10[precision];\n\t\tlong lval = (long)(val * exp + 0.5);\n\t\tsb.append(lval / exp).append('.');\n\t\tlong fval = lval % exp;\n\t\tfor (int p = precision - 1; p > 0 && fval < POW10[p] && fval>0; p--) {\n\t\t\tsb.append('0');\n\t\t}\n\t\tsb.append(fval);\n\t\tint i = sb.length()-1;\n\t\twhile(sb.charAt(i)=='0' && sb.charAt(i-1)!='.')\n\t\t{\n\t\t\tsb.deleteCharAt(i);\n\t\t\ti--;\n\t\t}\n\t\treturn sb.toString();\n\t}", "private double formatDouble(double number){\r\n return Double.parseDouble(String.format(\"%.2f\", number));\r\n }", "public static void main(String[] args) {\n\t\tdouble dnum = 99.9999; \r\n\t\t\r\n\t\t//convert double to string using valueOf() method\r\n\t\tString str = String.valueOf(dnum); \r\n\t\t\t\r\n\t\t//displaying output string after conversion\r\n\t\tSystem.out.println(\"My String is: \"+str);\r\n\r\n\t}", "private String getOutputValue(double value, boolean enablePrecision) {\n if(enablePrecision) {\n switch(this.getPrecisionType()) {\n case FLOAT7:\n return DECIMAL_FORMAT.format(value);\n case FLOAT16:\n return \"\" + toFloat(fromFloat((float) value));\n case DOUBLE64:\n return value + \"\";\n case FLOAT32:\n default:\n return ((float) value) + \"\";\n }\n } else {\n return ((float) value) + \"\";\n }\n }", "public static String formatDouble(double a)\n {\n DecimalFormat f = new DecimalFormat(\"0.00\");\n\n return f.format(a, new StringBuffer(\"\"), new FieldPosition(0)).toString();\n }", "String doubleRead();", "public String form(double x)\n {\n String r;\n\n if (precision < 0)\n {\n precision = 6;\n }\n\n int s = 1;\n\n if (x < 0)\n {\n x = -x;\n s = -1;\n }\n\n if (fmt == 'f')\n {\n r = fixed_format(x);\n }\n else if ((fmt == 'e') || (fmt == 'E') || (fmt == 'g') || (fmt == 'G'))\n {\n r = exp_format(x);\n }\n else\n {\n throw new java.lang.IllegalArgumentException();\n }\n\n return pad(sign(s, r));\n }", "public void print(double someDouble) {\r\n print(someDouble + \"\");\r\n }", "@Override\n public String toString() {\n String strValue = \n (value instanceof Double) ? \n String.format(\"%.4f\", value) : \n value.toString();\n String strWeight = String.format(\"%.4f\", w);\n return \"{value: \" + strValue + \", weight: \" + strWeight + \"}\";\n }", "private static String formatDouble(final double value) {\n\t\treturn String.format(\"%.5f\", value);\n\t}", "public static String doubleFormat(double d) {\n return (d == (long) d) ? (String.valueOf((int)d)) : (String.format(\"%s\",d));\n }", "static public String numberToString(double number) {\n long wholeNumber = (long) number;\n if (number == wholeNumber) {\n return String.valueOf(wholeNumber);\n } else {\n return String.valueOf(number);\n }\n }", "private static String format2(double d) {\n return new DecimalFormat(\"#.00\").format(d);\n }", "public static String convertDoubleToBinary2(double num) {\n if (num <= 0 || num >= 1) {\n throw new IllegalArgumentException();\n }\n \n double frac = 0.5;\n StringBuilder sb = new StringBuilder();\n sb.append(\".\");\n while (Double.compare(num, 0) > 0) {\n if (sb.length() >= 32) {\n return ERROR_MESSAGE;\n }\n if (Double.compare(num, frac) >= 0) {\n sb.append(1);\n num -= frac;\n } else {\n sb.append(0);\n }\n frac /= 2;\n }\n return sb.toString();\n }", "private String normalizeDouble(Double value) {\n\n String valueSign = (value < 0) ? \"-\" : \"0\";\n String expSign = \"0\";\n Integer finalExp = 0;\n\n DecimalFormat df = new DecimalFormat(DECIMAL_FORMAT);\n String[] splits = df.format(value).split(\"E\");\n\n // if there's an exponent, complement it\n if(splits.length > 1) {\n\n String exponent = splits[1];\n\n if(exponent.startsWith(\"-\")) {\n\n expSign = \"-\";\n exponent = exponent.replace(\"-\", \"\");\n finalExp = 999 - Integer.parseInt(exponent);\n }\n\n else {\n finalExp = Integer.parseInt(exponent);\n }\n }\n\n return String.format(\"%s%s%03d %s\", valueSign, expSign, finalExp, splits[0]);\n }", "public static String nice( double x )\n {\n double y = Math.abs(x);\n\n // using very naive tolerance (assuming scaling around 1)!\n if( y <= tiny )\n return \"0\";\n\n if( y < 0.00001 )\n return expFormat.format( x );\n else if( y < 1 )\n return formats[0].format( x );\n else if( y < 10 )\n return formats[1].format( x );\n else if( y < 100 )\n return formats[2].format( x );\n else if( y < 1000 )\n return formats[3].format( x );\n else if( y < 10000 )\n return formats[4].format( x );\n else if( y < 100000 )\n return formats[5].format( x );\n else\n return expFormat.format( x );\n }", "String format(double balance);", "public static String convertDoubleToBinary1(double num) {\n if (num <= 0 || num >= 1) {\n throw new IllegalArgumentException();\n }\n \n StringBuilder sb = new StringBuilder();\n sb.append(\".\");\n while (Double.compare(num, 0) != 0) {\n if (sb.length() >= 32) {\n return ERROR_MESSAGE;\n }\n num *= 2;\n if (Double.compare(num, 1) >= 0) {\n sb.append(1);\n num = num - 1;\n } else {\n sb.append(0);\n }\n }\n return sb.toString();\n }", "private String format(double number, NFRuleSet ruleSet)\n/* */ {\n/* 1731 */ StringBuffer result = new StringBuffer();\n/* 1732 */ ruleSet.format(number, result, 0);\n/* 1733 */ postProcess(result, ruleSet);\n/* 1734 */ return result.toString();\n/* */ }", "public static String format(double value) {\n \tif(Double.valueOf(value).equals(Double.NaN)) return \"NaN\";\n \t\n if (value == 0) {\n return basicFormat.format(value);\n } else if (Math.abs(value) < 1E-4 || Math.abs(value) > 1E6)\n return scienceFormat.format(value);\n else\n return basicFormat.format(value);\n }", "R format(O value);", "public String AToDa(double a) {\n // da = 10*a\n double da = a*10;\n return check_after_decimal_point(da);\n }", "public static String formatDouble(double number) {\n if (number == (long) number) {\n return String.format(\"%d\", (long) number);\n } else {\n return String.format(\"%.1f\", number).toString();\n }\n }", "private double convert(double d){\n\t\tDecimalFormatSymbols symbols = DecimalFormatSymbols.getInstance();\n\t\tsymbols.setDecimalSeparator('.');\n\t\tDecimalFormat df = new DecimalFormat(\"#.##\",symbols); \n\t\treturn Double.valueOf(df.format(d));\n\t}", "public static String formatDoubleAmount(double amount){\n NumberFormat formatter = new DecimalFormat(\"$#,###,##0.00;($#,###,##0.00)\");\n return formatter.format(amount); \n }", "public String getScriptOfParametersDouble() {\r\n\t\tString str = \"\";\r\n\r\n\t\tfor (DataVariable var : dataTestModel) {\r\n\t\t\tif (var.getType().equals(\"double\") || var.getType().equals(\"int\")) {\r\n\t\t\t\tstr += var.getName() + \",\";\r\n\t\t\t}\r\n\t\t}\r\n\t\tif (str.endsWith(\",\")) {\r\n\t\t\tstr = str.substring(0, str.length() - 1);\r\n\t\t}\r\n\t\treturn str;\r\n\t}", "void writeDouble(double value);", "public String AToDaa(double a) {\n // daa = a/10\n double daa = a/10;\n return check_after_decimal_point(daa);\n }", "@Override\n\tpublic String toString() {\n\t\tdouble value = getValue();\n\t\tint round = (int)(value* 1000);\n\t\tvalue = ((double)round)/1000; \n\t\tif (value >= 0)\n\t\t\treturn \"+\" + value;\n\t\telse\n\t\t\treturn \"\" + value;\n\t}", "public static String doubleToString(double val, int precision) {\r\n\r\n\t\tif (Double.isNaN(val) || Double.isInfinite(val))\r\n\t\t\treturn Double.toString(val);\r\n\r\n\t\tString origStr = String.valueOf(val);\r\n\r\n\t\t// find out the exponent\r\n\t\tint expnPos = origStr.lastIndexOf('e');\r\n\r\n\t\tif ((expnPos > 0)\r\n\t\t\t\t&& ((Math.abs(val) > Long.MAX_VALUE) || (Math.abs(val) < Math\r\n\t\t\t\t\t\t.pow(10.0, -precision)))) {\r\n\t\t\tString expnStr = origStr.substring(expnPos + 1);\r\n\r\n\t\t\tdouble base = val\r\n\t\t\t\t\t/ Math.pow(10.0, Double.valueOf(expnStr).doubleValue());\r\n\r\n\t\t\treturn baseToString(base, precision) + \"e\" + expnStr;\r\n\t\t} else {\r\n\t\t\treturn baseToString(val, precision);\r\n\t\t}\r\n\t}", "public String getString (String variable){ // Strongly inspired in JMatLink\r\n if (matlabEng==null) return \"\";\r\n matlabEng.engEvalString(id,\"EjsengGetCharArrayD=double(\" + variable +\")\" );\r\n double[][] arrayD = matlabEng.engGetArray(id,\"EjsengGetCharArrayD\");\r\n if (arrayD==null) return null;\r\n matlabEng.engEvalString(id,\"clear EjsengGetCharArrayD\");\r\n String value[] = double2String(arrayD);\r\n if (value.length<=0) return null;\r\n return value[0];\r\n }", "public static String promoConverter(double value,int decimalDigits)\n {\n return String.format(\"%.2f\", value);\n\n }", "private void serializeDouble(final double number, final StringBuffer buffer)\n {\n buffer.append(\"d:\");\n buffer.append(number);\n buffer.append(';');\n }", "private double formatDoubleWithTwoDeci(double value) {\r\n \treturn Math.floor(value*1e2)/1e2;\r\n }", "String getValueFormatted();", "private String stringRepresentationOfSign(double value) {\n int sign = 0;\n if (value < 0) sign = -1;\n else if (value > 0) sign = 1;\n else if (value == 0.0) sign = 1;\n \n\tint t = signLength() * (sign + 1);\n\treturn signString.substring (t, t + signLength());\n }", "private String literal(Number num) {\n int i = num.intValue();\n double d = num.doubleValue();\n \n if (i == d) {\n return String.valueOf(i);\n } else {\n // TODO: proper number formatting should be used\n return num.toString();\n }\n }", "private String getFormattedPrice(double unformattedPrice) {\n String formattedData = String.format(\"%.02f\", unformattedPrice);\n return formattedData;\n }", "public static String formatDoubleDot2(double d) {\n DecimalFormat df = new DecimalFormat(\"0.00\");//格式化小数\n return df.format(d);\n }", "public static String formatDouble(double value, int precision){\n\t\tString result;\n\t\tif(((int)value) > 9999 || ((int)value) < -9999){\n\t\t\tresult = new DecimalFormat(\"0.######E0\").format(value);\n\t\t}\n\t\telse\n\t\t\tresult = String.valueOf(roundDouble(value, precision));\n\t\treturn result == null ? \"-\" : result;\n\t}", "public StringBuffer format(double number, StringBuffer toAppendTo, FieldPosition ignore)\n/* */ {\n/* 1101 */ toAppendTo.append(format(number, this.defaultRuleSet));\n/* 1102 */ return toAppendTo;\n/* */ }", "public static String toString( double number,\n double upLimit,\n double loLimit,\n int precision)\n {\n // If number less than decimalLimit, or equal to zero, use decimal style\n if( number == 0.0 ||\n (Math.abs(number) <= upLimit && Math.abs(number) > loLimit) )\n {\n switch (precision){\n case 1 : return dec1.format(number);\n case 2 : return dec2.format(number);\n default: return dec1.format(number);\n }\n\n } else{\n // Create the format for Scientific Notation with E\n switch (precision){\n case 1 : return sci1.format(number);\n case 2 : return sci2.format(number);\n default: return sci1.format(number);\n }\n }\n }", "static public String toStringLong(double val, boolean includeDecimal)\r\n {\r\n _workingHolder.setData(val, false);\r\n\r\n java.text.DecimalFormat secFormat = null;\r\n if (includeDecimal)\r\n secFormat = df;\r\n else\r\n secFormat = df2;\r\n\r\n String res = df3.format(_workingHolder.deg) + DEGREE_SYMBOL +\r\n df2.format(_workingHolder.min) + \"\\'\" +\r\n secFormat.format(_workingHolder.sec) + \"\\\"\";\r\n\r\n // just check we're not at origin\r\n if(val != 0)\r\n \t res += _workingHolder.hem + \"\";\r\n\r\n return res;\r\n }", "@Override\n public String toString() {\n return new GsonBuilder().serializeSpecialFloatingPointValues().create().toJson(this);\n }", "static double formatNumber(double d) {\n\tDecimalFormat df= new DecimalFormat(COMMA_SEPERATED);\n\tSystem.out.println(\"number \"+df.format(d));\n\treturn d;\n\t\n\t\n\t}", "private String LightConversion() {\n\n int exponent = ((raw[19] & 0xC0) >> 6) + ((raw[20] & 0x03) << 2);\n int mantissa = ((raw[20] & 0xFC) >> 2) + ((raw[21] & 0x03) << 6);\n double value = (Math.pow(2.0, exponent)) * mantissa * 0.025;\n\n return Double.valueOf(threeDForm.format(value)) + \"\";\n\n }", "public String getPriceString() {\n\t\treturn Utils.formatCurrencyNumber(price);//Double.toString(price.doubleValue()); //price.toString();\n\t}", "double getDoubleValue2();", "private String unitString(final double value, final String units, final Locale locale)\n\t{\n\t\treturn StringValue.valueOf(value, locale) + units;\n\t}", "Double getDoubleValue();", "public static void main(String[] args) {\n\n double i = 47456.23456;\n String r1 = String.format(\"i have %,6.2f\", i);\n System.out.println(r1);\n String r2 = String.format(\"i have %,6.1f\", 4.12);\n System.out.println(r2);\n String r3 = String.format(\"i have %c\", 42);\n System.out.println(r3);\n String r4 = String.format(\"i have %x\", 42);\n System.out.println(r4);\n\n\n }", "public String toString(){\n StringBuilder string = new StringBuilder();\n for(double s : scores)string.append(s + \" \");\n return string.toString();\n }", "@Override\r\n\tpublic String toString() {\n\t\treturn \"(\" + Double.toString(x) + \", \" + Double.toString(y) + \", \" + Double.toString(z) + \")\";\r\n\t\t// String.format is cleaner, but Double.toString appears to have behavior closer to that of the old editor\r\n//\t\treturn String.format(\"(%f, %f, %f)\", x, y, z);\r\n\t}", "@Override public String toDot() {\r\n return value.toDot(); \r\n }", "public abstract void getDoubleImpl(String str, double d, Resolver<Double> resolver);", "public static String formatPrice(Double price) {\n if (price == null) return \"\";\n return formatPrice(price.doubleValue());\n }", "public String getModifiedNumber(BigDecimal bd) {\r\n String str = \"\";\r\n String temp = \"\";\r\n str = bd.toString();\r\n double num = Double.parseDouble(str);\r\n double doubleVal;\r\n\r\n NumberFormat nFormat = NumberFormat.getInstance(Locale.US);\r\n nFormat.setMaximumFractionDigits(1);\r\n nFormat.setMinimumFractionDigits(1);\r\n\r\n /*\r\n * if ((num / getPowerOfTen(12)) > 0.99) // check for Trillion {\r\n * doubleVal = (num / getPowerOfTen(12)); temp =\r\n * String.valueOf(truncate(doubleVal)) + \"Tn\"; } else if ((num /\r\n * getPowerOfTen(9)) > 0.99) // check for Billion { doubleVal = (num /\r\n * getPowerOfTen(9)); temp = String.valueOf(truncate(doubleVal)) + \"Bn\";\r\n * } else\r\n */\r\n if ((num / getPowerOfTen(6)) > 0.99) // check for Million\r\n {\r\n doubleVal = (num / getPowerOfTen(6));\r\n //temp = String.valueOf(truncate(doubleVal)) + \"M\";\r\n temp= nFormat.format(doubleVal) + \"M\";\r\n } else if ((num / getPowerOfTen(3)) > 0.99) // check for K\r\n {\r\n doubleVal = (num / getPowerOfTen(3));\r\n //temp = String.valueOf(truncate(doubleVal)) + \"K\";\r\n temp =nFormat.format(doubleVal) + \"K\";\r\n } else {\r\n //temp = String.valueOf(num);\r\n temp = nFormat.format(num);\r\n }\r\n return temp;\r\n }", "static public String toStringLat(double val, boolean includeDecimal)\r\n {\r\n _workingHolder.setData(val, true);\r\n\r\n java.text.DecimalFormat secFormat = null;\r\n if (includeDecimal)\r\n secFormat = df;\r\n else\r\n secFormat = df2;\r\n\r\n String res = \" \" + df2.format(_workingHolder.deg) + DEGREE_SYMBOL +\r\n df2.format(_workingHolder.min) + \"\\'\" +\r\n secFormat.format(_workingHolder.sec) + \"\\\"\";\r\n\r\n // just check we're not at origin\r\n if(val != 0)\r\n \t res += _workingHolder.hem + \"\";\r\n\r\n // hack: when the degs symbol appears in the third character of the string, when\r\n // we write to Metafile the following (4th) character is swapped for a y.\r\n\r\n // when the degs symbol appears as the 4th character, however, the string\r\n // writes perfectly to metafile\r\n\r\n // consequently we insert a space at the front of the string to artificially\r\n // put the deg symbol in the 4th character.\r\n\r\n return res;\r\n }", "public static double formatDouble(double value){\r\n\t\ttry{\r\n\t\tDecimalFormat df = new DecimalFormat(\"####0.00\");\r\n\t\tvalue = Double.valueOf(df.format(value));\r\n\t\t}catch(Exception e){System.out.println(\"Error in formatDouble for value : \" + value + \" error : \" + e.getMessage());}\r\n\t\treturn value;\r\n\t}", "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 }", "private String numberFormatter(double input) {\n // Formatters\n NumberFormat sciFormatter = new DecimalFormat(\"0.#####E0\"); // Scientific notation\n NumberFormat commaFormatter = new DecimalFormat(\"###,###,###,###.###############\"); // Adding comma\n\n // If input is in scientific notation already\n if ((String.valueOf(input)).indexOf(\"E\") > 0) {\n return sciFormatter.format(input); // make the scientific notation neater\n }\n\n // If input is not in scientific notation\n // Number of digits of integer and decimal of input\n String[] splitter = String.format(\"%f\", input).split(\"\\\\.\");\n int intDigits = splitter[0].length(); // Before Decimal Count\n int decDigits;// After Decimal Count\n if (splitter[1].equals(\"000000\")){\n decDigits = 0;\n } else {\n decDigits= splitter[1].length();\n }\n\n if ((intDigits + decDigits) > 9) {\n return sciFormatter.format(input);\n }\n return commaFormatter.format(input);\n }", "public static String format(double amount) {\n DecimalFormat formatter = new DecimalFormat(\"#,##0.00\");\n String formatted = formatter.format(amount);\n\n if (formatted.endsWith(\".\")) {\n formatted = formatted.substring(0, formatted.length() - 1);\n }\n\n return Common.formatted(formatted, Constants.Nodes.Major.getStringList(), Constants.Nodes.Minor.getStringList());\n }", "private static String formatCost(double cost) {\n\t\tif (cost <= 1d)\n\t\t\treturn new Double(cost).toString();\n\n\t\treturn \"NaN\";\n\t}", "private String arrayToString(double[] a) {\n StringBuffer buffy = new StringBuffer();\n for (int i=0; i<a.length; i++) {\n buffy.append(a[i]+\"\\t\");\n }\n return buffy.toString();\n }", "private String arrayToString(double[] a) {\n StringBuffer buffy = new StringBuffer();\n for (int i=0; i<a.length; i++) {\n buffy.append(a[i]+\"\\t\");\n }\n return buffy.toString();\n }", "public StringBuffer format(double val, StringBuffer toAppendTo, FieldPosition pos) {\n\t\t\treturn formattedStringBuffer( val );\n }", "public String toStringSpeed(){\r\n String strout = \"\";\r\n strout = String.format(\"%.2f\", this.getSpeed());\r\n return strout;\r\n }", "public static String getParryString(double result) {\n/* 2412 */ String toReturn = \"easily\";\n/* 2413 */ if (result < 10.0D) {\n/* 2414 */ toReturn = \"barely\";\n/* 2415 */ } else if (result < 30.0D) {\n/* 2416 */ toReturn = \"skillfully\";\n/* 2417 */ } else if (result < 60.0D) {\n/* 2418 */ toReturn = \"safely\";\n/* 2419 */ } return toReturn;\n/* */ }", "String getFloat_lit();", "public void printer(double x);", "public static String formatQuantity(Double quantity) {\n if (quantity == null)\n return \"\";\n else\n return formatQuantity(quantity.doubleValue());\n }", "public double getDouble();", "public String getStringValueOf(double value) {\n\t\tif (this.numeric) {\n\t\t\treturn Double.toString(value);\n\n\t\t} else {\n\t\t\tint index = (int) value;\n\t\t\tint currentIndex = 0;\n\t\t\tIterator<String> it = discreteLevels.iterator();\n\n\t\t\twhile (it.hasNext()) {\n\t\t\t\tString next = it.next();\n\t\t\t\tif (currentIndex == index) {\n\t\t\t\t\treturn next;\n\t\t\t\t}\n\t\t\t\tcurrentIndex++;\n\t\t\t}\n\t\t\tthrow new CorruptDataException(this);\n\t\t}\n\t}", "private String defaultFormat(double d) {\n\t\tString str = \"\" + d;\n\t\tint availableSpace = getSize().width - 2 * PIXEL_MARGIN;\n\t\tFontMetrics fm = getFontMetrics(getFont());\n\t\tif (fm.stringWidth(str) <= availableSpace) return str;\n\t\tint eIndex = str.indexOf(\"E\");\n\t\tString suffix = \"\";\n\t\tif (eIndex != -1) {\n\t\t\tsuffix = str.substring(eIndex);\n\t\t\tstr = str.substring(0, eIndex);\n\t\t\ttry {\n\t\t\t\td = parser.parse(str).doubleValue();\n\t\t\t} catch (ParseException ex) {\n\t\t\t\tthrow new ErrorException(ex);\n\t\t\t}\n\t\t}\n\t\tNumberFormat standard = NumberFormat.getNumberInstance(Locale.US);\n\t\tstandard.setGroupingUsed(false);\n\t\tString head = str.substring(0, str.indexOf('.') + 1);\n\t\tint fractionSpace = availableSpace - fm.stringWidth(head + suffix);\n\t\tif (fractionSpace > 0) {\n\t\t\tint fractionDigits = fractionSpace / fm.stringWidth(\"0\");\n\t\t\tstandard.setMaximumFractionDigits(fractionDigits);\n\t\t\treturn standard.format(d) + suffix;\n\t\t}\n\t\tstr = \"\";\n\t\twhile (fm.stringWidth(str + \"#\") <= availableSpace) {\n\t\t\tstr += \"#\";\n\t\t}\n\t\treturn str;\n\t}", "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 String formatDoubles(double value) {\r\n\t\treturn String.format(\"%-5.1f\", value);\r\n\t}", "public static String getFormattedAmount(double amount) {\n DecimalFormat df = new DecimalFormat(\".00\");\n String formattedAmount = df.format(amount).replaceAll(\",\", \"\")\n .replaceAll(\"\\\\.\", \"\");\n return formattedAmount;\n }", "private String formatDec(double number) {\n String returnString = \"\";\n DecimalFormat df = new DecimalFormat(\"#.##\");\n df.setRoundingMode(RoundingMode.HALF_UP);\n returnString = df.format(number);\n int dotPosition = returnString.lastIndexOf(\".\");\n if (dotPosition == -1) {\n returnString += \".00\";\n } else {\n if (returnString.substring(dotPosition, returnString.length() - 1).length() == 1) {\n returnString += \"0\";\n }\n }\n return returnString;\n }", "public static String formatNumber(double num) {\n\t\tNumberFormat.getNumberInstance(Locale.US).format(35634646);\n\t\tNumberFormat formatter = NumberFormat.getNumberInstance(Locale.US);\n\t\treturn formatter.format(num);\n\t}", "protected static String cleanFormat(Double d) {\n\t\tif(d<0) return \"-\"+cleanFormat(d*-1.0);\n\t\tString result = String.format(Locale.US, \"%f\", d).replaceAll(\"([\\\\.])?0+$\",\"\");\n\t\tif(Math.abs(Double.parseDouble(result)-d) < 0.000001) return result;\n\t\tSystem.err.print(\"warning: String.format(\"+d+\")=\\\"\"+result+\"\\\"\");\n\t\tresult=\"\";\n\t\tint dimension = (int)Math.log10(d);\n\t\tif(dimension<0) result=\"0.\";\n\t\twhile(d>(double)Float.MIN_VALUE) {\n\t\t\t// System.err.print(\"cleanFormat(\"+d+\")=\");\n\t\t\tdouble base = Math.pow(10.0, (double)dimension);\n\t\t\tresult=result+(int)(d/base);\n\t\t\tif(d % base>(double)Float.MIN_VALUE) {\n\t\t\t\td=d % base;\n\t\t\t\tif(dimension==0 && d>(double)Float.MIN_VALUE)\n\t\t\t\t\tresult=result+\".\";\n\t\t\t\tdimension--;\n\t\t\t} else d=(double)Float.MIN_VALUE;\n\t\t\t// System.err.println(result);\n\t\t}\n\t\tSystem.err.println(\" => \\\"\"+result+\"\\\"\");\n\t\treturn result;\n\t}", "static public String roundNumberToString(double number) {\n long wholeNumber = (long) number;\n if (number == wholeNumber) {\n return String.valueOf(wholeNumber);\n } else {\n return String.format(\"%.2f\", number);\n }\n }", "Double getValue();", "private String formatMagnitude(double magnitude) {\n DecimalFormat magnitudeFormat = new DecimalFormat(\"0.0\");\n return magnitudeFormat.format(magnitude);\n }", "public abstract double fromBasicUnit(double valueJTextInsert);", "double getDoubleValue3();", "public static String doubleArrayToString (double[] arr, int d) {\n\t\tString str = \"\";\n\t\tif (d == 0) return str;\n\n\t\tstr += arr[0];\n\t\tfor (int i=1; i<d; i++) {\n\t\t\tstr += \"\\t\" + arr[i];\n\t\t}\n\t\treturn str;\n\t}", "@Override\n public void onChanged(Double aDouble) {\n if (aDouble*1000 < 1) {\n etOutputValue.setText(\"0.0\");\n } else {\n DecimalFormat decimalFormat = new DecimalFormat(\"#,##0.###\");\n etOutputValue.setText(decimalFormat.format(aDouble));\n }\n }", "double getDoubleValue1();", "double getEDouble();" ]
[ "0.78063637", "0.74658585", "0.72760344", "0.72488034", "0.71758735", "0.7102762", "0.7037083", "0.69285846", "0.67604744", "0.66724443", "0.65734553", "0.65208364", "0.64972275", "0.6475562", "0.64665097", "0.64458144", "0.6443086", "0.6441451", "0.6434726", "0.6422785", "0.64083415", "0.640532", "0.63996357", "0.63786525", "0.6365577", "0.6349393", "0.63133454", "0.62869924", "0.6272261", "0.6269347", "0.62393135", "0.62007207", "0.61970043", "0.6194637", "0.6193971", "0.6189468", "0.61881745", "0.6170556", "0.6155436", "0.6130411", "0.61061716", "0.6100479", "0.6091542", "0.6080764", "0.6080432", "0.6079204", "0.6070931", "0.60691255", "0.6066915", "0.6034421", "0.60298944", "0.6023646", "0.6007317", "0.5991274", "0.598549", "0.59677947", "0.5965603", "0.5961852", "0.59503084", "0.59323144", "0.5928768", "0.5925412", "0.5924751", "0.5918359", "0.59163994", "0.589543", "0.5893959", "0.58907264", "0.5882678", "0.587688", "0.5876803", "0.5872608", "0.58464426", "0.5843828", "0.58428645", "0.58428645", "0.58358103", "0.58353525", "0.5818757", "0.58186257", "0.581601", "0.5813119", "0.5800798", "0.5796524", "0.5794608", "0.5790516", "0.5781155", "0.57611424", "0.576099", "0.5759232", "0.5752398", "0.5745841", "0.57457227", "0.57446635", "0.57412654", "0.57343066", "0.57272756", "0.57268345", "0.5724164", "0.5724046" ]
0.6657111
10
method to convert float variable to string
public String FloatToString(float dValue) { String sValue = ""; try { sValue = String.format("%.4f", dValue); } catch (Exception e) { sValue = ""; } finally { return sValue; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "String floatWrite();", "public String floatToString(float amount){\n return Float.toString(amount);\n }", "public static String FloatToString(float FloatValue){\n Float floatee = new Float(FloatValue);\n return floatee.toString(); \n }", "public String toFloatString() {\n\t\treturn this.toFloatString(DEFAULT_NUM_DECIMALS);\n\t}", "String getFloat_lit();", "@Override\r\n\tpublic String toString() {\n\t\treturn \"float\";\r\n\t}", "public static String floatToString(float value) {\n\t\tif(Float.isNaN(value)) {\n\t\t\treturn \" --- \";\n\t\t}\n\t\treturn String.format(\"%.2f\", value);\n\t}", "public String toFloatString(int numDecimals) {\n\t\t// cast each to float so we don't lose precision from ints\n\t\tfloat result = (float)this.numerator / (float)this.denominator;\n\t\t\n\t\treturn String.format(\"%.\"+ numDecimals +\"f\", result); // + \"\" converts it to a string \n\t}", "String floatRead();", "@Override\n public String toGraphProperty(Float value) {\n return value.toString();\n }", "@Override\n public String toString() {\n return new GsonBuilder().serializeSpecialFloatingPointValues().create().toJson(this);\n }", "@Override\n public String toString() {\n return new Apfloat(this.value).toString(true);\n }", "@Override\n protected String formatValue(Object value) {\n String formatted = \"float\".equals(format) ? formatWithDigits(value, this.digits) : String.valueOf(value);\n return formatted + \" \" + this.unitText;\n }", "public void write(float f) {\n write(String.valueOf(f));\n }", "private static String FloatToBinaryString(float data){\n int intData = Float.floatToIntBits(data);\n return String.format(\"%32s\", Integer.toBinaryString(intData)).replace(' ', '0');\n }", "static public String nf(float num) {\n\t\tif (formatFloat==null) nfInitFormats();\n\t\tformatFloat.setMinimumIntegerDigits(1);\n\t\tformatFloat.setMaximumFractionDigits(3);\n\n\t\treturn formatFloat.format(num).replace(\",\", \".\");\n\t}", "public void print(float someFloat) {\r\n print(someFloat + \"\");\r\n }", "public static String floatFormat(float number) {\r\n\t\tBigDecimal bd = new BigDecimal(number);\r\n\t\tBigDecimal rounded = bd.setScale(2, BigDecimal.ROUND_HALF_UP);\r\n\t\treturn \"\"+rounded;\r\n\t}", "@Override\n\tpublic String toString() {\n\t\tdouble value = getValue();\n\t\tint round = (int)(value* 1000);\n\t\tvalue = ((double)round)/1000; \n\t\tif (value >= 0)\n\t\t\treturn \"+\" + value;\n\t\telse\n\t\t\treturn \"\" + value;\n\t}", "public String format(double number);", "String getFloatingPointEncoding();", "void mo9698a(String str, float f);", "public static String formatQuantity(float quantity) {\n return formatQuantity((double) quantity);\n }", "void writeFloat(float value);", "@Override\n public String toString() {\n String strValue = \n (value instanceof Double) ? \n String.format(\"%.4f\", value) : \n value.toString();\n String strWeight = String.format(\"%.4f\", w);\n return \"{value: \" + strValue + \", weight: \" + strWeight + \"}\";\n }", "private String getOutputValue(double value, boolean enablePrecision) {\n if(enablePrecision) {\n switch(this.getPrecisionType()) {\n case FLOAT7:\n return DECIMAL_FORMAT.format(value);\n case FLOAT16:\n return \"\" + toFloat(fromFloat((float) value));\n case DOUBLE64:\n return value + \"\";\n case FLOAT32:\n default:\n return ((float) value) + \"\";\n }\n } else {\n return ((float) value) + \"\";\n }\n }", "public static String formatQuantity(Float quantity) {\n if (quantity == null)\n return \"\";\n else\n return formatQuantity(quantity.doubleValue());\n }", "@Override\n public String getFormattedValue(float value, Entry entry, int dataSetIndex, ViewPortHandler viewPortHandler) {\n return \"\";\n }", "@Override\n public String getFormattedValue(float value, AxisBase axis) {\n String percent=Float.toString(value);\n percent = percent.substring(0,percent.length()-2);\n return percent+\"%\";\n }", "private String convertFahrenheitToCelsius(double f) {\n double c = (f - 32.0) * (5.0 / 9.0);\n DecimalFormat numberFormat = new DecimalFormat(\"#.0\");\n return numberFormat.format(c);\n }", "private String getProgressString(float progress) {\n if (mIsFloatProgress) {\n return FormatUtils.fastFormat(progress, mScale);\n }\n return String.valueOf(Math.round(progress));\n }", "public String getEmisora(){\n return Float.toString(emisora);\n }", "static String double2String (Double a){\n String s = \"\"+a;\n String[] arr = s.split(\"\\\\.\");\n if (arr[1].length()==1) s+=\"0\";\n return s;\n }", "public static String getRounfOF(Float target) {\n\n return new DecimalFormat(\"0.00\").format(target);\n\n }", "@Override\n public String getFormattedValue(float value, AxisBase axis) {\n try {\n return dateFormat.parse(\"\" + value).toString();\n } catch (ParseException e) {\n e.printStackTrace();\n }\n return null;\n }", "public String getRoundedValue(final float value) {\n\t\tfinal BigDecimal bigDecimal = new BigDecimal(value).setScale(decimalPlaces, BigDecimal.ROUND_HALF_EVEN);\n\t\treturn bigDecimal.toString();\n\t}", "public String toAsmCode(){\n\t\tif(value<0) //for drive label with value<0, we add _n if value is <0\n\t\t\treturn \".FloatLiteral_n\"+ getStringValue().substring(1,getStringValue().length());\n\t\telse\n\t\t\treturn \".FloatLiteral_\"+ getStringValue();\n\t}", "@Override\n public String getFormattedValue(float value, AxisBase axis) {\n return convertDate((long)value + base);\n }", "public static String getStringFromList(ArrayList<Float> list){\n\t\tString t = \"\";\n\t\tfor(int i = 0; i < list.size(); i++){\n\t\t\tif(Float.isNaN((float)list.get(i))){\n\t\t\t\t//t += \"\";\n\t\t\t}\n\t\t\telse{\n\t\t\t\tt+=BigDecimal.valueOf((double)list.get(i))+\",\";\n\t\t\t}\n\t\t}\n\t\treturn t;\n\t}", "float getEFloat();", "public String toString() {\n\t\t double Fahrehgeit = this.getFahrenheit();\n\t\t double celcius = this.getCelcius();\n\t\t return Math.round(celcius)+\" celcius = \"+ Math.round(Fahrehgeit)+\" Fahrenheit\";\n\t }", "public String getPosicion(){\n return Float.toString(posicion);\n }", "public String toStringSpeed(){\r\n String strout = \"\";\r\n strout = String.format(\"%.2f\", this.getSpeed());\r\n return strout;\r\n }", "public static String format(float val, String pattern)\n {\n return format(Float.valueOf(val), pattern);\n }", "private static String curencyFormatterString(Float value) {\n\t\treturn NumberFormat.getCurrencyInstance().format(value).replace(\"$\", \"\");\n\t}", "R format(O value);", "private String simplify(){\r\n return Utility.getStringFromKey(recipient) + Float.toString(value) + parentId;\r\n }", "public String toString()\n {\n String s = \"\";\n for (Point2D.Float p : points) {\n if (s.length() > 0) s += \", \";\n s += round(p.x) + \"f\" + \",\" + round(p.y) + \"f\";\n }\n return s;\n }", "@Override\n public String getFormattedValue(float value, AxisBase axis) {\n return mValues.get((int) value);\n }", "float getValue();", "float getValue();", "float getValue();", "public abstract void getFloatImpl(String str, double d, Resolver<Double> resolver);", "private String doubleToDecimalString(double toFormat){\r\n\r\n String d = \"\";\r\n DecimalFormat df = new DecimalFormat(\"0.00\");\r\n d = df.format(toFormat);\r\n\r\n return d;\r\n }", "public String toString() {\n\t\treturn String.valueOf(mDouble);\n\t}", "public static String floatFormat(String number) {\r\n\t\tBigDecimal bd = new BigDecimal(number);\r\n\t\tBigDecimal rounded = bd.setScale(2, BigDecimal.ROUND_HALF_UP);\r\n\t\treturn \"\"+rounded;\r\n\t}", "String getValueFormatted();", "@Override\r\n\tpublic String toString() {\n\t\treturn \"(\" + Double.toString(x) + \", \" + Double.toString(y) + \", \" + Double.toString(z) + \")\";\r\n\t\t// String.format is cleaner, but Double.toString appears to have behavior closer to that of the old editor\r\n//\t\treturn String.format(\"(%f, %f, %f)\", x, y, z);\r\n\t}", "public void prueba(){\r\n //Float f = Float.parseFloat(jtfValor.getText());\r\n String s = \"100.000,5\";\r\n \r\n String d = s.replace(\".\",\"\");\r\n // s.replaceAll(\",\", \".\");\r\n // s.trim();\r\n System.out.println(d);\r\n \r\n }", "public static String floatFormat(int number) {\r\n\t\tBigDecimal bd = new BigDecimal(number);\r\n\t\tBigDecimal rounded = bd.setScale(2, BigDecimal.ROUND_HALF_UP);\r\n\t\treturn \"\"+rounded;\r\n\t}", "public String getValue() {\n if (mValue == null) {\n float[] values = mValues;\n mValue = String.format(mTextFmt, values[0], values[1], values[2]);\n }\n return mValue == null ? \"??\" : mValue;\n }", "String format(double balance);", "@Override public String toDot() {\r\n return value.toDot(); \r\n }", "private static String toPsString(double d) {\n return \"(\" + d + \")\";\n }", "public abstract float mo70722e(String str);", "void writeFloat(float v) throws IOException;", "public String toString() {\r\n if(this.getImag() < 0)\r\n return String.format(\"%.1f - %.1fi\", this.getReal(), this.getImag() * -1); // imaginary to positive for output only\r\n return String.format(\"%.1f + %.1fi\", this.getReal(), this.getImag());\r\n }", "public abstract void mo70714b(String str, float f);", "public abstract void mo70718c(String str, float f);", "public String getDollarString()\n\t{\n\t\treturn String.format(\"%01.2f\", (float)CurrentValue/100.0f);\n\t}", "private String LightConversion() {\n\n int exponent = ((raw[19] & 0xC0) >> 6) + ((raw[20] & 0x03) << 2);\n int mantissa = ((raw[20] & 0xFC) >> 2) + ((raw[21] & 0x03) << 6);\n double value = (Math.pow(2.0, exponent)) * mantissa * 0.025;\n\n return Double.valueOf(threeDForm.format(value)) + \"\";\n\n }", "T println(float data) throws PrintingException;", "public static String nice( double x )\n {\n double y = Math.abs(x);\n\n // using very naive tolerance (assuming scaling around 1)!\n if( y <= tiny )\n return \"0\";\n\n if( y < 0.00001 )\n return expFormat.format( x );\n else if( y < 1 )\n return formats[0].format( x );\n else if( y < 10 )\n return formats[1].format( x );\n else if( y < 100 )\n return formats[2].format( x );\n else if( y < 1000 )\n return formats[3].format( x );\n else if( y < 10000 )\n return formats[4].format( x );\n else if( y < 100000 )\n return formats[5].format( x );\n else\n return expFormat.format( x );\n }", "private String formatNumber(BigDecimal num) {\n return num.toPlainString();\n }", "protected static String fastDoubleToString(double val, int precision) {\n\t\tStringBuilder sb = new StringBuilder();\n\t\tif (val < 0) {\n\t\t\tsb.append('-');\n\t\t\tval = -val;\n\t\t}\n\t\tlong exp = POW10[precision];\n\t\tlong lval = (long)(val * exp + 0.5);\n\t\tsb.append(lval / exp).append('.');\n\t\tlong fval = lval % exp;\n\t\tfor (int p = precision - 1; p > 0 && fval < POW10[p] && fval>0; p--) {\n\t\t\tsb.append('0');\n\t\t}\n\t\tsb.append(fval);\n\t\tint i = sb.length()-1;\n\t\twhile(sb.charAt(i)=='0' && sb.charAt(i-1)!='.')\n\t\t{\n\t\t\tsb.deleteCharAt(i);\n\t\t\ti--;\n\t\t}\n\t\treturn sb.toString();\n\t}", "static public String nf(float num, int lead, int decimal) {\n\t\tif (formatFloat==null) nfInitFormats();\n\t\tformatFloat.setMinimumIntegerDigits(lead);\n\t\tformatFloat.setMaximumFractionDigits(decimal);\n\t\tformatFloat.setMinimumFractionDigits(decimal);\n\n\t\treturn formatFloat.format(num).replace(\",\", \".\");\n\t}", "@Override\n\tpublic String toString() {\n\t\treturn String.format(\"%s with p=%.2f, r=%.2f and f=%.2f\", this.getClass().getSimpleName(), this.p, this.r, this.f);\n\t}", "public String toString() {\n \tString fOneString=f1.toString();\n \tString fTwoSring=f2.toString();\n \treturn \"f(x)=\"+fTwoSring+\"(\"+fOneString+\")\";\n }", "public abstract void mo70705a(String str, float f);", "public T caseFloat(org.uis.lenguajegrafico.lenguajegrafico.Float object)\n {\n return null;\n }", "@Override\n public String getFormattedValue(float value, AxisBase axis) {\n return mFormat.format(new Date((long) value));\n }", "@Override\r\n\tpublic float getFloat(String string) {\n\t\treturn 0;\r\n\t}", "public static final SourceModel.Expr showFloat(SourceModel.Expr f) {\n\t\t\treturn \n\t\t\t\tSourceModel.Expr.Application.make(\n\t\t\t\t\tnew SourceModel.Expr[] {SourceModel.Expr.Var.make(Functions.showFloat), f});\n\t\t}", "static String getStringValue(Object uazFactorValueObj) {\n String uazFactorValue;\n if (uazFactorValueObj instanceof Double) {\n LOGGER.trace(\"transforming a double value\");\n uazFactorValue = uazFactorValueObj.toString();\n }\n if (uazFactorValueObj instanceof Integer) {\n LOGGER.trace(\"transforming an integer value \");\n uazFactorValue = uazFactorValueObj.toString();\n } else if (uazFactorValueObj instanceof String) {\n LOGGER.trace(\"string value, no need to transform\");\n uazFactorValue = uazFactorValueObj.toString();\n } else {\n // TODO checked before entering this function!\n // LOGGER.warn(\" the type of the uaz feature for ALU is not recognized, the analysis may not be correct!\");\n LOGGER.trace(\"assuming the factor value is a string\");\n uazFactorValue = uazFactorValueObj.toString();\n }\n return uazFactorValue;\n }", "public void setFloatValue(float v)\n {\n this.setValue(String.valueOf(v));\n }", "public String serialize()\n {\n return String.format(\"invuln=%b, flying=%b, canfly=%b, instabuild=%b, flyspeed=%.4f, walkspped=%.4f\", new Object[] {Boolean.valueOf(this.func_149112_c()), Boolean.valueOf(this.func_149106_d()), Boolean.valueOf(this.func_149105_e()), Boolean.valueOf(this.func_149103_f()), Float.valueOf(this.func_149101_g()), Float.valueOf(this.func_149107_h())});\n }", "@Override\n public String toString()\n {\n return String.format(\"(%f,%f,%f,%f)\", kP, kI, kD, kF);\n }", "public String toString(){\r\n String str;\r\n if( this.denominator==1 ){\r\n str = String.valueOf(numerator);\r\n }else{\r\n str = String.valueOf(numerator) + \"/\" + String.valueOf(denominator);\r\n }\r\n return(str);\r\n }", "public static String getNoDecimal(float temp) {\n\n BigDecimal bigDecimal = new BigDecimal(String.valueOf(temp));\n bigDecimal = bigDecimal.setScale(0, BigDecimal.ROUND_HALF_UP);\n DecimalFormat decimalFormat = new DecimalFormat();\n decimalFormat.applyPattern(\"#,##0\");\n\n return decimalFormat.format(bigDecimal);\n }", "public String toString() {\n return label + \"(\" + MathUtil.doubleString(value, 1) + \")\\tweight: \" + MathUtil.doubleString(weight, 2) + \"\\tFeatureVector: \" + featureVector.toString();\n }", "@Test\n public void toStringTest() {\n float[] a = new float[] {1.001f, 2.0f, 3.1f, 4.2f, 5.3f, 6.0f}; \n float[] a2 = new float[] {3.1f, 4.2f, 5.3f, 6.0f}; \n String expect = \"(3.1, 4.2, 5.3, 6.0)\";\n String result = Vec4f.toString(a, 2);\n String result2 = Vec4f.toString(a2);\n //System.out.println(\"string = \"+result);\n assertTrue(result.equals(expect));\n assertTrue(result2.equals(expect));\n \n }", "@Override\n\tpublic String toString() {\n\t\tif (imaginary == 0) {\n\t\t\treturn String.format(\"%.3f\", real);\n\t\t}\n\t\tif (real == 0) {\n\t\t\treturn String.format(\"%.3fi\", imaginary);\n\t\t}\n\n\t\tif (imaginary < 0) {\n\t\t\treturn String.format(\"%.3f - %.3fi\", real, -imaginary);\n\t\t} else {\n\t\t\treturn String.format(\"%.3f + %.3fi\", real, imaginary);\n\t\t}\n\t}", "@Override\r\n public void updateValue(String s) {\r\n //Covert from string to float\r\n this.value = Float.valueOf(s);\r\n }", "public String detectaDoble(double numero){\n\t\treturn numero % 1.0 != 0 ? String.format(\"%s\", numero) : String.format(\"%.0f\", numero);\n\t}", "private String getDestCoordinate(Float coord) {\r\n if (coord != null) {\r\n return String.valueOf(coord);\r\n } else {\r\n return \"\";\r\n }\r\n }", "double getFloatingPointField();", "public static float getValueFloat()\n {\n return Util.valueFloat;\n }", "T print(float data) throws PrintingException;", "public static String getCssText(short unit, float value) {\n \t\tif (unit < 0 || unit >= UNITS.length) {\n \t\t\tthrow new DOMException(DOMException.SYNTAX_ERR, \"\");\n \t\t}\n \t\tString s = String.valueOf(value);\n \t\tif (s.endsWith(\".0\")) {\n \t\t\ts = s.substring(0, s.length() - 2);\n \t\t}\n \t\treturn s + UNITS[unit - CSSPrimitiveValue.CSS_NUMBER];\n \t}", "private String stringRepresentationOfSign(double value) {\n int sign = 0;\n if (value < 0) sign = -1;\n else if (value > 0) sign = 1;\n else if (value == 0.0) sign = 1;\n \n\tint t = signLength() * (sign + 1);\n\treturn signString.substring (t, t + signLength());\n }" ]
[ "0.7784302", "0.74763626", "0.74667746", "0.73443073", "0.7036597", "0.69662154", "0.69163173", "0.66371864", "0.66072285", "0.6591713", "0.65915734", "0.6562504", "0.6510275", "0.63948876", "0.6362903", "0.6335125", "0.6288329", "0.62839854", "0.623604", "0.6205764", "0.62007946", "0.614797", "0.613564", "0.61334825", "0.612471", "0.61155653", "0.6107459", "0.61033064", "0.6074887", "0.60691804", "0.6045957", "0.6045655", "0.6044668", "0.60311204", "0.60266095", "0.6004034", "0.59786105", "0.5936151", "0.5920432", "0.58952355", "0.58889884", "0.58841056", "0.58825064", "0.58751166", "0.5855419", "0.58455914", "0.5834357", "0.58264613", "0.5825071", "0.58090425", "0.58090425", "0.58090425", "0.5785833", "0.578441", "0.57488364", "0.57487905", "0.5728637", "0.5722109", "0.5721999", "0.5719042", "0.5716664", "0.571223", "0.57071847", "0.57049996", "0.57003194", "0.5687188", "0.5683728", "0.56714106", "0.5668671", "0.56450784", "0.56389886", "0.56199247", "0.5608349", "0.5597608", "0.55927026", "0.5591815", "0.5586706", "0.5584633", "0.55842954", "0.55825615", "0.5571277", "0.5567666", "0.5565822", "0.5564646", "0.5562487", "0.5559054", "0.5553638", "0.5546493", "0.5543641", "0.55373037", "0.5526408", "0.5526113", "0.5512346", "0.5503642", "0.54932666", "0.5487861", "0.54860604", "0.54824317", "0.54820037", "0.5481965" ]
0.6769275
7
method to calculate average of integer list
public double calculateAverage(List<Integer> list) { double sum = 0; double avg = 0.0; try { if (list.isEmpty()) { throw new Exception("Empty List"); } //loop for values to calculate average for (Integer mark : list) { sum = sum + mark; } avg = sum / list.size(); } catch (Exception e) { avg = 0.0; } return avg; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private static int getAverage(ArrayList<Integer> inList) \n\t{\n\t\tint add = 0; \n\t\tint mean = 0; \n\t\tfor(int pos = 0; pos < inList.size(); ++pos)\n\t\t{\n\t\t\tadd = add + inList.get(pos);\n\t\t\t\n\t\t}\n\t\t\n\t\tmean = add/inList.size(); \n\t\t\n\t\treturn mean; \n\t\t\n\t}", "public static double getAvg(List<Integer> list) {\n int sum = 0;\n for (int i = 0; i != list.size(); ++i) {\n sum += list.get(i);\n }\n return (double)sum / list.size();\n }", "private double computeMean(List<Integer> intList) {\n double count = 0;\n for (Integer i : intList) {\n count += i;\n }\n return count / intList.size();\n }", "public static double average(ArrayList<Integer> list) {\n double average = (double) sum(list);\n return average / list.size();\n }", "double avg(){\n\t\tdouble sum = 0.0;\n\t\tfor(int i=0;i<num.length;i++)\n\t\t\tsum+=num[i].doubleValue();\n\t\treturn sum/num.length;\n\t}", "public static double findMean(ArrayList<Integer> arr) {\n\t\tint length = arr.size();\n\t\tint sum = 0;\n\t\tfor(int i : arr) { sum += i; }\n\t\treturn (double)sum/length;\n\t}", "public double average(){\n double avg = 0;\n double sum = 0;\n for (T t : arr) {\n // sum += t.doubleValue();\n }\n\n return sum / arr.length;\n }", "public double average() {\n double average = 0;\n for (int i = 0; i < studentList.size(); i++) {\n Student student = studentList.get(i);\n average += student.average();\n }\n average /= studentList.size();\n return average;\n }", "@Override\n public Double average() {\n return (sum() / (double) count());\n }", "public static double average(ArrayList<Double> nums){\n double sum = 0.0;\n for(Double num : nums){\n sum += num;\n }\n return sum / nums.size();\n }", "public double average(){\r\n\t\t//create variable to hold the values\r\n\t\tdouble average = 0;\r\n\t\t\r\n\t\tfor (int i = 0; i < this.data.length; i++){\r\n\t\t\t//add current index\r\n\t\t\taverage += this.data[i];\r\n\t\t\t}\r\n\t\treturn (average/this.data.length);\r\n\t}", "public Double computeAverage(){\n\t\tdouble total = 0; //double used to keep total value of elements in arr to determine average\n\t\t\n\t\tfor(int i = 0; i < arr.length; i++)//loop through array and add the total\n\t\t{\n\t\t\ttotal += arr[i].doubleValue(); //add current value of element in arr to total's value\n\t\t}\n\t\t\n\t\tDouble result = total/arr.length; //returns the average as a Double\n\t\t\n\t\treturn result;\n\t}", "float average(int[] input) {\n\t\tfloat average = 0;\n\t\tint sum = 0;\n\t\tfor (int index = 0; index < input.length; index++) {\t\t//loop to get sum of numbers\n\t\t\tsum = sum + input[index];\n\t\t}\n\t\taverage = (float) sum / (input.length);\t\t//average calculation\n\t\treturn average;\n\t}", "static double calculateAverage(int[] array) {\n\n double sum = 0;\n\n for (int i = 0; i < array.length; i++) {\n\n sum = sum + (double) array[i];\n\n\n }\n\n return sum / array.length;//returning average\n\n }", "public double calcAvg() {\n\t\treturn (double)calcSum() / data.size();\n }", "public int average() {\n int total = 0;\n\n for (int score : scores) {\n total += score;\n }\n\n return total / scores.length;\n }", "public double getAverage(){\n double total = 0;\n for(double s : scores)total += s;\n return total/scores.length;\n }", "public int average()\n {\n int average = 0;\n int sum = 0;\n\n for ( int index = 0; index < data.length; index++ )\n {\n sum = sum + data[index];\n }\n average = sum / data.length;\n\n return average;\n }", "double average() { // used double b/c I want decimal places\n\t\tint sum = 0;\n\t\tfor (int i = 0; i < array.length; i++) {\n\t\t\tsum = sum + array[i];\n\t\t}\n\t\tdouble average = (double) sum / array.length;\n\t\treturn average;\n\n\t}", "public double getAverage(){\r\n\t\tdouble sum=0;\r\n\t\tfor(Iterator<T> it=this.iterator();it.hasNext();){\r\n\t\t\tsum+=it.next().doubleValue();\r\n\t\t}\r\n\t\treturn sum/this.size();\r\n\t}", "public void getAvg()\n {\n this.avg = sum/intData.length;\n }", "public double average(ArrayList<Double> x) {\n double sum = 0;\n double round;\n for (int i = 0; i < x.size(); i++) {\n sum += x.get(i);\n }\n round = sum / x.size() * 100;\n round = Math.round(round);\n round /= 100;\n return round;\n }", "public static int average(int[]data){\n \n int sum = 0;\n int n = 0;\n for(int i = 0; i < data.length-1; i++) {\n \n n++;\n sum += data[i];\n }\n\n return sum/n;\n }", "private float calculateAverage(List<Float> tempVoltages) {\r\n\t\t\r\n\t\tfloat runningTotal = 0;\r\n\t\tfor(float i : tempVoltages){\r\n\t\t\trunningTotal += i;\r\n\t\t}\r\n\t\trunningTotal /= tempVoltages.size();\r\n\t\treturn runningTotal;\r\n\t}", "double average();", "double average(double[] doubles) {\n double total = 0.0;\n //int count = 0;\n for (double d: doubles) {\n total = total + d;\n //count = count + 1;\n }\n //return total / count;\n return total / doubles.length;\n }", "public float getAverageBetweenPoint(){\n return getMetric()/list.size();\n }", "public double getAverage(){\n int total = 0; //inicializa o total\n \n //soma notas de um aluno\n for(int grade: grades){\n total += grade;\n }\n \n return (double) total/grades.length;\n }", "@Override\n\tpublic int avg() {\n\t\treturn (this.sum()/3);\n\t}", "public double mean (List<? extends Number> a){\n\t\tint sum = sum(a);\n\t\tdouble mean = 0;\n\t\tmean = sum / (a.size() * 1.0);\n\t\treturn mean;\n\t}", "public double getAverage(){\n return getTotal()/array.length;\n }", "public static double GetAverage(List<Long> longList) {\n double curAvg = 0;\n for (int i = 0; i < longList.size(); i++) {\n curAvg += (longList.get(i) - curAvg) / (double)i;\n }\n return curAvg;\n }", "public double averageVolume() {\r\n \r\n double total = 0;\r\n int index = 0;\r\n if (list.size() == 0) {\r\n return 0; \r\n }\r\n while (index < list.size()) {\r\n total += list.get(index).volume();\r\n index++;\r\n }\r\n if (index == 0)\r\n {\r\n total = 0;\r\n }\r\n else\r\n {\r\n total = total / index;\r\n }\r\n \r\n return total;\r\n }", "static double average(double[] data){\n\n // Initializing total placeholder \n double total = 0;\n\n // Traversing data array and adding to total sum\n for (double d : data) {\n total += d;\n }\n\n // Computing average\n double average = (double) total / data.length;\n\n return average;\n }", "public double average(int first, int last){\n double final = 0;\n for(int i = first; i < last; i++){\n final += scores[i];\n }\n return final/(last-first+1);\n}", "public void findAverage(int[] arr){\n int sum = 0;\n for(int val : arr){\n sum += val;\n }\n System.out.println( \"Average: \" + sum / arr.length);\n }", "public static double avg(ExpressionContext context, List nodeset) {\n if ((nodeset == null) || (nodeset.size() == 0)) {\n return Double.NaN;\n }\n\n JXPathContext rootContext = context.getJXPathContext();\n rootContext.getVariables().declareVariable(\"nodeset\", nodeset);\n\n Double value = (Double) rootContext.getValue(\"sum($nodeset) div count($nodeset)\", Double.class);\n\n return value.doubleValue();\n }", "private INDArray computeVectorAverage(List<float[]> embeddingsList)\r\n {\r\n INDArray sum = Nd4j.zeros(embeddingsList.get(0).length);\r\n\r\n for (float[] vec : embeddingsList) {\r\n INDArray nd = Nd4j.create(vec);\r\n sum = sum.add(nd);\r\n }\r\n sum = sum.div(embeddingsList.size());\r\n return sum;\r\n }", "public double calculateAverage(List<Double> list, String s) {\n double sum = 0;\n double avg = 0.0;\n try {\n if (list.isEmpty()) {\n throw new Exception(\"Empty List\");\n }\n\n //loop for values to calculate average\n for (Double mark : list) {\n sum = sum + mark;\n }\n avg = sum / list.size();\n\n } catch (Exception e) {\n avg = 0.0;\n }\n return avg;\n }", "public Integer average(int[] arr3){\n\t\tSystem.out.println(\"Get Average\");\n\t\tint sum = 0;\n\t\tfor(int d = 0; d < arr3.length; d++){\n\t\t\tsum += arr3[d];\n\t\t}\n\t\tSystem.out.println(sum/arr3.length);\n\t\treturn 0;\n\t}", "private double calcAverage(int startIndex, int endIndex) {\n\t\t\n\t\t// total for the scores\n\t\tdouble total = 0;\n\t\t\n\t\t// loop between indexes and add the scores\n\t\tfor (int i = startIndex; i < endIndex; i++) \n\t\t\ttotal += scores.get(i);\n\t\t\n\t\t// return the average\n\t\treturn total / (endIndex - startIndex);\n\t}", "private static <T> int getAverageOf(final Collection<T> collection, Function<T, Integer> func) {\n BigDecimal sum = BigDecimal.ZERO;\n for (T t: collection) {\n sum = sum.add(new BigDecimal(func.apply(t)));\n }\n return sum.divide(new BigDecimal(collection.size()), RoundingMode.DOWN).intValue();\n }", "public static double getArrayListDoubleMean(ArrayList<Double> list) {\n\t\treturn 0;\n\t}", "public static double average(int[] arr)\n {\n // your code goes here\n\t\tdouble sum =0;\n int i;\n for(i=0;i< arr.length;i++)\n {\n sum+=arr[i];\n }\n\t\t\n\t\treturn sum/arr.length; \n\t}", "public double averagePrice() {\r\n\t\tdouble sum = 0;\r\n\t\tfor(Integer price : ticketPrice) {\r\n\t\t\tsum+=price;\r\n\t\t}\r\n\t\treturn sum/ticketPrice.size();\r\n\t}", "public static double meanOf(Iterable<? extends Number> values) {\n/* 393 */ return meanOf(values.iterator());\n/* */ }", "public int average(int[] array_of_notes){\r\n int avg=0;\r\n for (int array_of_note : array_of_notes) {\r\n avg += array_of_note;\r\n }\r\n avg /= array_of_notes.length;\r\n return avg;\r\n }", "public static double avg(int[] arr) {\n double sum = 0.0;\n for (int a : arr) sum += a;\n return sum / arr.length;\n }", "public static void main(String[] args) {\n\n float d = (float)sum(3.0f, (float)2.0);\n System.out.println(d);\n\n double d2=avg(3.0,2.0);\n System.out.println(d2);\n//\n// int[] list={1,2};\n// list={2,3};\n\n\n\n }", "private List<Double> sumMeanX(List<Business> business, double avg) {\n\t\tList<Double> sumMean = new ArrayList<Double>();\n\n\t\tfor (Business biz : business) {\n\t\t\tint price = biz.getPrice();\n\t\t\tsumMean.add(price - avg);\n\t\t}\n\t\treturn sumMean;\n\t}", "public static int average(int[] array){\n int sum = 0;\n for (int i = 0; i < array.length; i++) {\n sum += array[i];\n }\n return sum/array.length;\n }", "public ArrayList<Double> averageSalaries(){\n\t\tArrayList<Double> averageSalaries = new ArrayList<Double>();\n for(int i=0;i<allSalaries.size();i++) {\n \ttry {\n \t\tdouble averageEmployee=average(allSalaries.get(i));\n \t\taverageSalaries.add(averageEmployee);\n \t}catch(IllegalArgumentException e) {\n \t\tSystem.out.println(\"There is something wrong with input\");\n \t} \t\n\t\t}\n return averageSalaries;\n\t}", "public int getAverage() { return (int)Math.ceil(getSumOfMarks()/ numberOfCourses); }", "private float calculateMean()\n { \n int numberEmployees = employees.size();\n float total = 0, meanGrossPay = 0;\n // Create an array of all gross pays\n float[] allGrossPay = new float[numberEmployees];\n \n // Call method to return an array of float containing all gross pays\n allGrossPay = calculateAllGrossPay();\n // Find total gross pay\n for (int i = 0; i < numberEmployees; i++)\n {\n total += allGrossPay[i];\n }\n // Find mean and return it\n if (numberEmployees > 0)\n {\n meanGrossPay = total/numberEmployees;\n \n }\n return meanGrossPay;\n }", "public static Double mean(ArrayList<Double> values) {\n\t\tDouble total = 0.0;\n\t\t// iterate through the values and add to the total\n\t\tfor (int i = 0; i < values.size(); i++) {\n\t\t\ttotal += values.get(i);\n\t\t}\n\t\t// return the total devided by the number of values\n\t\treturn total / values.size();\n\t}", "public double getAverage()\n {\n return getSum() / 2.0;\n }", "static double averageDoubleArray(double[] inputArray) {\n\t\tdouble doubleSum = 00.00;\n\t\tfor (double element : inputArray) { \n\t\t\tdoubleSum += element;\n\t\t}\n\t\tdouble average = doubleSum / inputArray.length; \n\t\treturn average;\n\t}", "@Override\n\tpublic double avg() {\n\t\treturn total()/4.0;\n\t}", "public double getAverageGrade(){\n double totalGrade = 0;\n double averageGrade = 0;\n // for loop to iterate over the array\n for(int i = 0; i<students.size(); i++){\n totalGrade += students.get(i).getGrades();\n } // end for\n \n averageGrade = totalGrade / students.size();\n return averageGrade;\n }", "public double averageOfArray() {\n double sum = 0;\n double average = 0;\n int i;\n for (i = 0; i < sirDeLa1La100.length; i++) {\n sum = sum + sirDeLa1La100[i];\n }\n average = sum / sirDeLa1La100.length;\n return average;\n }", "public double getAvg(){\n double avg=0;\n for(int x=0; x<max; x++){\n avg=avg+times[x];\n }\n avg=avg/max;\n return avg;\n }", "public static double getAverage(int start, double[] d) {\n double average = 0;\n for (int i = 0; i < 110; i++) {\n average = average + d[i];\n }\n return average / 110;\n }", "public void parseAverages(){\r\n\t\tfor(int i = 1; i < x.size(); i++){\r\n\t\t\tdouble avg = (x.get(i) + x.get(i-1)) / 2;\r\n\t\t\tx.set(i, avg);\r\n\t\t}\r\n\t}", "public static double getAverage(int[][] numbers) {\n int totalNumberOfElements = 10; // (2 rows * 5 column)\n return getTotal(numbers) / totalNumberOfElements;\n }", "public double average()\n\t{\n\t\tif (arraySize > 0)\n\t\t{\n\t\t\tdouble sum = this.sum();\n\t\t\treturn sum / arraySize;\n\t\t}\n\t\tSystem.out.println(\"Syntax error, array is empty.\");\n\t\treturn -1;\n\t}", "public double mean()\n {\n double sum = 0.0;\n for(int t = 0; t<size; t++)\n sum += x[t];\n return sum/size;\n }", "public static int\n /**\n * \n * @param left\n * an integer\n * @param right\n * an integer\n * @return the average of left and right. The number will round towards zero\n * if the average is not a whole number\n * @pre both left and right numbers should not be greater than\n * Integer.Max_Value or smaller than Integer.Min_Value\n */\n average (int left, int right)\n {\n /**\n * In the original program, it was possible that the sum of left and right\n * exceeds Integer.Max_Value or Integer.Min_Value even when either left or\n * right is within the boundaries. Therefore, we solve this problem by\n * dividing the left and right numbers first, and then sum them up.\n */\n double avg = left / 2.0 + right / 2.0;\n return (int) avg;\n }", "public void computeAverageOfRepeats() {\n\t\t\n\t\texperimentsAvg_ = new ArrayList<Experiment>();\n\t\t\n\t\tfor (int i=0; i<experiments_.size(); i++)\n\t\t\texperimentsAvg_.add(experiments_.get(i).computeAverageOfRepeats());\n\t}", "public static double average(int[] array) {\n\t\tif (array.length == 0) {\n\t\t\treturn 0;\n\t\t}\n\t\tdouble avg = 0;\n\t\tfor (int i = 0; i < array.length; i++) {\n\t\t\tavg += array[i];\n\t\t}\n\t\treturn avg / array.length;\n\t}", "public static void calculateAvg(double[] avgPArr, int itemNum) {\n\n for (int i = 0; i < avgPArr.length; i++)\n avgPArr[i] /= itemNum;\n\n }", "private void calculateAverages(){\n for (int i=0; i<40; i=i+4){\n totalGoalsScored1 += Integer.parseInt(vectorResults[i]);\n }\n averageGoalsScored1 = totalGoalsScored1/numberItems;\n //Total and average scored goals of team 2\n for (int i=2; i<40; i=i+4){\n totalGoalsScored2 += Integer.parseInt(vectorResults[i]);\n }\n averageGoalsScored2 = totalGoalsScored2/numberItems;\n //Total and average received goals of team 1\n for (int i=1; i<40; i=i+4){\n totalGoalsReceived1 += Integer.parseInt(vectorResults[i]);\n }\n averageGoalsReceived1 = totalGoalsReceived1/numberItems;\n //Total and average received goals of team 2\n for (int i=3; i<40; i=i+4){\n totalGoalsReceived2 += Integer.parseInt(vectorResults[i]);\n }\n averageGoalsReceived2 = totalGoalsReceived2/numberItems;\n }", "double getMeanPrice() {\n List<Double> allPrices = new ArrayList<>();\n\n for (Firm firm : firms) {\n List<Double> pricesOfFirm = firm.getPrices();\n allPrices.addAll(pricesOfFirm.subList(pricesOfFirm.size() - SimulationManager.sizeOfExaminationInterval, pricesOfFirm.size()));\n }\n\n return Calculation.round(Calculation.getMean(allPrices), 2);\n }", "public double averageVolume() {\r\n double listAvgVolume = 0.0;\r\n if (list.size() != 0) {\r\n listAvgVolume = totalVolume() / list.size();\r\n }\r\n return listAvgVolume;\r\n }", "private double getAvg() {\n\n double sum = 0;\n\n for (Map.Entry<Integer, Double> entry : values.entrySet()) {\n sum += entry.getValue();\n }\n\n if (values.size() > 0) {\n return sum / values.size();\n } else {\n throw new IllegalStateException(\"no values\");\n }\n }", "public long calulateAverageTime()\r\n {\r\n long sum = 0;\r\n long avgTime = 0;\r\n\r\n //Get the sum of all the times \r\n for(long time : this.listOfTimes)\r\n {\r\n sum += time;\r\n }//end for \r\n\r\n //calculate the average time \r\n if(this.gamesCompleted>0)\r\n avgTime = sum / this.gamesCompleted;\r\n else\r\n avgTime = sum;\r\n\r\n return avgTime;\r\n }", "public static double average (double ... numbers)\r\n\t{", "public static double average(int[] theArray) {\n\n double answer;\n double sum = IntegerArrays.sum(theArray);\n answer = sum / theArray.length;\n\n return answer;\n\n }", "private double calcAvgX(List<Business> business) {\n\t\tdouble avg = 0.0;\n\t\tint count = 0;\n\t\tfor (int i = 0; i < business.size(); i++) {\n\t\t\tavg += business.get(i).getPrice();\n\t\t\tcount++;\n\t\t}\n\n\t\treturn avg / count;\n\t}", "public static <T extends Number> double computeAverage(ArrayList<T> nData, boolean isPositiveNumber) {\r\n double sum = computeSum(nData, isPositiveNumber); // compute sum of list data by calling computeSum and store in sum variable\r\n int counter = 0; // initialize counter for check list data is positive or not \r\n for (int i = 0; i < nData.size(); i++) {\r\n if (isPositiveNumber || nData.get(i).doubleValue() >= 0) // check value is positive or not\r\n counter++; // Increment of counter by 1 when data vlaue id positive\r\n }\r\n \r\n if (counter == 0) // check counter value is 0 or not\r\n throw new IllegalArgumentException(\"no values are > 0\"); // throw IllegalArgumentException if counter is 0\r\n \r\n return sum / counter; // return average of all list data / total posotive number\r\n }", "private double average(LinkedList<Double> lastSums2) {\n\t\tOptionalDouble average = lastSums2.stream().mapToDouble(a -> a).average();\n\t\treturn average.getAsDouble();\n\t}", "public double average(double alternative) {\n int cnt = 0;\n double sum = 0.0;\n\n // Compute the average of all values\n for (Number number : this) {\n if (number == null) continue;\n if (Double.isNaN(number.doubleValue())) continue;\n\n sum += number.doubleValue();\n cnt++;\n }\n\n // If we haven't had any element, return 0\n if (cnt == 0) return alternative;\n return sum / cnt;\n }", "private static int getAverageOfPerson(final Collection<Person> persons, Function<Person, Integer> func) {\n BigDecimal sum = BigDecimal.ZERO;\n for (Person p: persons) {\n sum = sum.add(new BigDecimal(func.apply(p)));\n }\n return sum.divide(new BigDecimal(persons.size()), RoundingMode.DOWN).intValue();\n }", "public static long average(long[] arr) {\n if (arr.length == 0) return 0;\n long divideSum = 0;\n long modSum = 0;\n final long size = arr.length;\n \n for (int i = 0; i < arr.length; i++) {\n divideSum += arr[i] / size;\n modSum += arr[i] % size;\n }\n\n return divideSum - (size - 1) + (modSum + size * (size - 1)) / size;\n }", "public List<KeyValue<Integer>> getAvg() {\n\t\tList<KeyValue<Integer>> result = new ArrayList<KeyValue<Integer>>();\n\t\tJavaRDD<Document> rdd = dal.getRDD();\n\t\tList<Tuple2<String, Iterable<Document>>> list = rdd.groupBy(new Function<Document, String>() {\n\t\t\t// 分组\n\t\t\t/**\n\t\t\t * \n\t\t\t */\n\t\t\tprivate static final long serialVersionUID = 1L;\n\n\t\t\tpublic String call(Document v1) throws Exception {\n\t\t\t\tString province = v1.getString(\"province\");\n\t\t\t\tDouble price = v1.getDouble(\"unitPrice\");\n\t\t\t\tif (v1.getString(\"province\") != null && price > 0) {\n\t\t\t\t\treturn province;\n\t\t\t\t}\n\t\t\t\treturn \"other\";\n\t\t\t}\n\t\t}).collect();\n\t\tfor (Tuple2<String, Iterable<Document>> tuple2 : list) {\n\t\t\t// 循环遍历,统计平均数\n\t\t\tif (tuple2._1.equals(\"other\")) {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tIterator<Document> iterator = tuple2._2.iterator();\n\t\t\tList<Double> prices = new ArrayList<Double>();\n\t\t\twhile (iterator.hasNext()) {\n\t\t\t\tprices.add(iterator.next().getDouble(\"unitPrice\"));\n\t\t\t}\n\t\t\tdouble sum = dal.getSparkContext().parallelize(prices).reduce(new Function2<Double, Double, Double>() {\n\n\t\t\t\t/**\n\t\t\t\t * \n\t\t\t\t */\n\t\t\t\tprivate static final long serialVersionUID = 1L;\n\n\t\t\t\tpublic Double call(Double v1, Double v2) throws Exception {\n\t\t\t\t\treturn v1 + v2;\n\t\t\t\t}\n\t\t\t});\n\t\t\tresult.add(new KeyValue<Integer>(tuple2._1, (int) sum / prices.size()));\n\t\t}\n\t\t// dal.destroy();\n\t\treturn result;\n\t}", "public double getAverage() {\n int total = 0;\n\n // sum grades of the student\n for (int grade : grades)\n total += grade;\n\n // return average of the grade\n return (double) total / grades.length;\n }", "private Tuple avgGradeReduce(List<Tuple> input) {\n int sum = 0;\n String className = input.get(0).fst();\n \n for(Tuple classAndGrade : input) {\n sum += Integer.parseInt(classAndGrade.snd());\n }\n \n Integer average = Math.round((float) sum / input.size());\n \n lolligag();\n \n // output <same class, average grade from all kids>\n return new Tuple(className, average.toString());\n }", "public static double calculateAverage (Scanner read){\n int sum = 0;\n int num;\n while(read.hasNextInt()){\n num = read.nextInt();\n sum += num;\n }\n \n return sum/5.0;\n }", "@Override\n public double findAverage() {\n double average = 0;\n for (Student key : map.keySet()) {\n average += map.get(key).getValue();\n }\n average /= map.keySet().size();\n return average;\n }", "public int calAvg(int sum, int count) {\r\n\t\tif(count == 0)\r\n\t\t\treturn 0;\r\n\t\treturn ((int)(sum/count));\r\n\t}", "public double getGradeAverage() {\n int gradesTotal = 0;\n for (int grade : grades) {\n gradesTotal += grade;\n }\n return gradesTotal / grades.size();\n }", "public static double average(Scanner s){\n\t\t\n\t\tint count = 0;\n\t\tint sum = 0;\n\t\t\n\t\twhile(s.hasNextInt()){\n\t\t\t\n\t\t\tsum += s.nextInt();\n\t\t\tcount++;\n\t\t} \n\t\t\n\t\treturn sum/(double)count; //type cast count to double to avoid integer division\n\n\t}", "public static double Average(int[][] matrix){\n double total = 0;\n double promedio =0;\n double divisor = 0;\n \n for(int i=0; i<matrix.length; i++){\n for (int j=0;j<matrix[i].length;j++ ) {\n \n total += matrix[i][j];\n } \n divisor = matrix[i].length * matrix.length; \n promedio = total / divisor; \n }\n \n return promedio;\n }", "public double average() {\n return average(0.0);\n }", "public static void main(String[] args) {\n int a[] = { 1, 6, 8, 9, 3, 4 };\n int count = 0;\n float Average;\n int size1 = a.length;\n for (int i = 0; i < size1; i++) {\n count = count + a[i];\n\n }\n Average = count / size1;\n System.out.println(\"Average of number is: \" + Average);\n\n }", "public float calcAverage(){\n if(totalReviews > 0)\n return (float) (totalScore*1.0/totalReviews);\n else return 0;\n }", "public double averageSurfaceArea() {\r\n \r\n double total = 0;\r\n int index = 0;\r\n if (list.size() == 0) {\r\n return 0; \r\n }\r\n while (index < list.size()) {\r\n total += list.get(index).surfaceArea();\r\n index++;\r\n }\r\n if (index == 0)\r\n {\r\n total = 0;\r\n }\r\n else\r\n {\r\n total = total / index;\r\n }\r\n return total;\r\n }", "public void findAvg()\n {\n for(int i = 0; i <= scores.length-1; i++)\n {\n for (int j = 0; j <= scores[0].length-1; j++)\n {\n total += scores[i][j];\n }\n }\n System.out.println(\"The class average test score is \" + \n total/24 + \".\");\n }", "private static double meanVal(double[] arrayOfSamples){\n\t\tdouble total = 0;\n\t\t for (double i :arrayOfSamples){\n\t\t \ttotal += i;\n\t\t }\n\t return total/arrayOfSamples.length;\n\t}", "public float uGetAvgRating(ArrayList<Integer> movies) {\n\t\tfloat sum = 0;\n\t\tint n = 0;\n\t\t\n\t\tfor (int m : movies) {\n\t\t\t// lookup in ratings\n\t\t\tsum += ((float)ratings.get(m) / 10f);\n\t\t\tn++;\n\t\t}\n\t\t\n\t\treturn sum / n;\n\t}", "public float averageAnswers() {\n\t\tfloat out = 0;\n\t\t\n\t\tIterator<SolveResult> iter = super.iterator();\n\t\t\n\t\twhile(iter.hasNext()) {\n\t\t\tSolveResult thisResult = iter.next();\n\t\t\tfloat clues = ResultSet.clueCount(thisResult.puzzle);\n\t\t\tfloat cardinality = thisResult.puzzle.getCardinality();\n\t\t\tfloat conflicts = thisResult.puzzle.conflictCount();\n\t\t\t\n\t\t\tif(!(cardinality - clues - conflicts < 0)) {\n\t\t\t\tout += ((cardinality - clues - conflicts) / (81 - clues));\n\t\t\t}\n\t\t}\n\t\treturn out / super.size();\n\t}" ]
[ "0.84028214", "0.82216233", "0.8216388", "0.7996866", "0.7607684", "0.7581997", "0.75749105", "0.748946", "0.7422218", "0.74160326", "0.73957694", "0.7345884", "0.73450327", "0.73190373", "0.7264247", "0.72619575", "0.7246804", "0.72112226", "0.7171354", "0.7164925", "0.7145982", "0.71350694", "0.7127865", "0.7089508", "0.7084413", "0.69944644", "0.6967302", "0.694603", "0.693789", "0.6925589", "0.69040686", "0.6901494", "0.6892857", "0.6872949", "0.6841651", "0.6815841", "0.68026906", "0.67628384", "0.67550564", "0.6748865", "0.6739982", "0.67292035", "0.66998106", "0.66971636", "0.66962695", "0.6681988", "0.6676886", "0.66757464", "0.6671909", "0.6654325", "0.6638735", "0.6599689", "0.65909386", "0.65895635", "0.658198", "0.65736294", "0.65399563", "0.65365523", "0.65252393", "0.6501477", "0.6481084", "0.6475924", "0.64756346", "0.6450472", "0.6450167", "0.64475787", "0.64459294", "0.64287114", "0.64031935", "0.6391091", "0.6373984", "0.6348183", "0.6347471", "0.63466597", "0.63443875", "0.63440955", "0.6335846", "0.6329568", "0.63281393", "0.6324937", "0.631349", "0.6303022", "0.6299809", "0.62921417", "0.62794685", "0.6278945", "0.6266184", "0.62660134", "0.6262936", "0.62624514", "0.626012", "0.6257964", "0.6246038", "0.6241988", "0.622441", "0.6217057", "0.6214657", "0.6209607", "0.6204654", "0.6197227" ]
0.82732224
1
method to calculate average of double list
public double calculateAverage(List<Double> list, String s) { double sum = 0; double avg = 0.0; try { if (list.isEmpty()) { throw new Exception("Empty List"); } //loop for values to calculate average for (Double mark : list) { sum = sum + mark; } avg = sum / list.size(); } catch (Exception e) { avg = 0.0; } return avg; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static double average(ArrayList<Double> nums){\n double sum = 0.0;\n for(Double num : nums){\n sum += num;\n }\n return sum / nums.size();\n }", "public static double getArrayListDoubleMean(ArrayList<Double> list) {\n\t\treturn 0;\n\t}", "public double average(){\n double avg = 0;\n double sum = 0;\n for (T t : arr) {\n // sum += t.doubleValue();\n }\n\n return sum / arr.length;\n }", "double average(double[] doubles) {\n double total = 0.0;\n //int count = 0;\n for (double d: doubles) {\n total = total + d;\n //count = count + 1;\n }\n //return total / count;\n return total / doubles.length;\n }", "public double average(ArrayList<Double> x) {\n double sum = 0;\n double round;\n for (int i = 0; i < x.size(); i++) {\n sum += x.get(i);\n }\n round = sum / x.size() * 100;\n round = Math.round(round);\n round /= 100;\n return round;\n }", "public double average() {\n double average = 0;\n for (int i = 0; i < studentList.size(); i++) {\n Student student = studentList.get(i);\n average += student.average();\n }\n average /= studentList.size();\n return average;\n }", "public double calculateAverage(List<Integer> list) {\n double sum = 0;\n double avg = 0.0;\n try {\n if (list.isEmpty()) {\n throw new Exception(\"Empty List\");\n }\n\n //loop for values to calculate average\n for (Integer mark : list) {\n sum = sum + mark;\n }\n avg = sum / list.size();\n\n } catch (Exception e) {\n avg = 0.0;\n }\n return avg;\n }", "double avg(){\n\t\tdouble sum = 0.0;\n\t\tfor(int i=0;i<num.length;i++)\n\t\t\tsum+=num[i].doubleValue();\n\t\treturn sum/num.length;\n\t}", "public static double getAvg(List<Integer> list) {\n int sum = 0;\n for (int i = 0; i != list.size(); ++i) {\n sum += list.get(i);\n }\n return (double)sum / list.size();\n }", "public static double average(ArrayList<Integer> list) {\n double average = (double) sum(list);\n return average / list.size();\n }", "public Double computeAverage(){\n\t\tdouble total = 0; //double used to keep total value of elements in arr to determine average\n\t\t\n\t\tfor(int i = 0; i < arr.length; i++)//loop through array and add the total\n\t\t{\n\t\t\ttotal += arr[i].doubleValue(); //add current value of element in arr to total's value\n\t\t}\n\t\t\n\t\tDouble result = total/arr.length; //returns the average as a Double\n\t\t\n\t\treturn result;\n\t}", "public double getAverage(){\r\n\t\tdouble sum=0;\r\n\t\tfor(Iterator<T> it=this.iterator();it.hasNext();){\r\n\t\t\tsum+=it.next().doubleValue();\r\n\t\t}\r\n\t\treturn sum/this.size();\r\n\t}", "private static int getAverage(ArrayList<Integer> inList) \n\t{\n\t\tint add = 0; \n\t\tint mean = 0; \n\t\tfor(int pos = 0; pos < inList.size(); ++pos)\n\t\t{\n\t\t\tadd = add + inList.get(pos);\n\t\t\t\n\t\t}\n\t\t\n\t\tmean = add/inList.size(); \n\t\t\n\t\treturn mean; \n\t\t\n\t}", "public static Double mean(ArrayList<Double> values) {\n\t\tDouble total = 0.0;\n\t\t// iterate through the values and add to the total\n\t\tfor (int i = 0; i < values.size(); i++) {\n\t\t\ttotal += values.get(i);\n\t\t}\n\t\t// return the total devided by the number of values\n\t\treturn total / values.size();\n\t}", "static double averageDoubleArray(double[] inputArray) {\n\t\tdouble doubleSum = 00.00;\n\t\tfor (double element : inputArray) { \n\t\t\tdoubleSum += element;\n\t\t}\n\t\tdouble average = doubleSum / inputArray.length; \n\t\treturn average;\n\t}", "static double average(double[] data){\n\n // Initializing total placeholder \n double total = 0;\n\n // Traversing data array and adding to total sum\n for (double d : data) {\n total += d;\n }\n\n // Computing average\n double average = (double) total / data.length;\n\n return average;\n }", "double average() { // used double b/c I want decimal places\n\t\tint sum = 0;\n\t\tfor (int i = 0; i < array.length; i++) {\n\t\t\tsum = sum + array[i];\n\t\t}\n\t\tdouble average = (double) sum / array.length;\n\t\treturn average;\n\n\t}", "double average();", "public double average(){\r\n\t\t//create variable to hold the values\r\n\t\tdouble average = 0;\r\n\t\t\r\n\t\tfor (int i = 0; i < this.data.length; i++){\r\n\t\t\t//add current index\r\n\t\t\taverage += this.data[i];\r\n\t\t\t}\r\n\t\treturn (average/this.data.length);\r\n\t}", "public float getAverageBetweenPoint(){\n return getMetric()/list.size();\n }", "@Override\n public Double average() {\n return (sum() / (double) count());\n }", "public double calcAvg() {\n\t\treturn (double)calcSum() / data.size();\n }", "private double average(LinkedList<Double> lastSums2) {\n\t\tOptionalDouble average = lastSums2.stream().mapToDouble(a -> a).average();\n\t\treturn average.getAsDouble();\n\t}", "public double getAverage(){\n double total = 0;\n for(double s : scores)total += s;\n return total/scores.length;\n }", "public ArrayList<Double> averageSalaries(){\n\t\tArrayList<Double> averageSalaries = new ArrayList<Double>();\n for(int i=0;i<allSalaries.size();i++) {\n \ttry {\n \t\tdouble averageEmployee=average(allSalaries.get(i));\n \t\taverageSalaries.add(averageEmployee);\n \t}catch(IllegalArgumentException e) {\n \t\tSystem.out.println(\"There is something wrong with input\");\n \t} \t\n\t\t}\n return averageSalaries;\n\t}", "public double mean (List<? extends Number> a){\n\t\tint sum = sum(a);\n\t\tdouble mean = 0;\n\t\tmean = sum / (a.size() * 1.0);\n\t\treturn mean;\n\t}", "private float calculateAverage(List<Float> tempVoltages) {\r\n\t\t\r\n\t\tfloat runningTotal = 0;\r\n\t\tfor(float i : tempVoltages){\r\n\t\t\trunningTotal += i;\r\n\t\t}\r\n\t\trunningTotal /= tempVoltages.size();\r\n\t\treturn runningTotal;\r\n\t}", "private double computeMean(List<Integer> intList) {\n double count = 0;\n for (Integer i : intList) {\n count += i;\n }\n return count / intList.size();\n }", "public double getAverage(){\n return getTotal()/array.length;\n }", "public static void main(String[] args) {\n\n float d = (float)sum(3.0f, (float)2.0);\n System.out.println(d);\n\n double d2=avg(3.0,2.0);\n System.out.println(d2);\n//\n// int[] list={1,2};\n// list={2,3};\n\n\n\n }", "private INDArray computeVectorAverage(List<float[]> embeddingsList)\r\n {\r\n INDArray sum = Nd4j.zeros(embeddingsList.get(0).length);\r\n\r\n for (float[] vec : embeddingsList) {\r\n INDArray nd = Nd4j.create(vec);\r\n sum = sum.add(nd);\r\n }\r\n sum = sum.div(embeddingsList.size());\r\n return sum;\r\n }", "double getMeanPrice() {\n List<Double> allPrices = new ArrayList<>();\n\n for (Firm firm : firms) {\n List<Double> pricesOfFirm = firm.getPrices();\n allPrices.addAll(pricesOfFirm.subList(pricesOfFirm.size() - SimulationManager.sizeOfExaminationInterval, pricesOfFirm.size()));\n }\n\n return Calculation.round(Calculation.getMean(allPrices), 2);\n }", "private List<Double> sumMeanX(List<Business> business, double avg) {\n\t\tList<Double> sumMean = new ArrayList<Double>();\n\n\t\tfor (Business biz : business) {\n\t\t\tint price = biz.getPrice();\n\t\t\tsumMean.add(price - avg);\n\t\t}\n\t\treturn sumMean;\n\t}", "public static double sum(ArrayList<Double> list){\r\n\t\tdouble sum = 0;\r\n\t\tfor(int i = 0; i < list.size(); i++){\r\n\t\t\tsum += list.get(i);\r\n\t\t}\r\n\t\t\r\n\t\treturn sum;\r\n\t\t\r\n\t}", "public static double findMean(ArrayList<Integer> arr) {\n\t\tint length = arr.size();\n\t\tint sum = 0;\n\t\tfor(int i : arr) { sum += i; }\n\t\treturn (double)sum/length;\n\t}", "public double average(double alternative) {\n int cnt = 0;\n double sum = 0.0;\n\n // Compute the average of all values\n for (Number number : this) {\n if (number == null) continue;\n if (Double.isNaN(number.doubleValue())) continue;\n\n sum += number.doubleValue();\n cnt++;\n }\n\n // If we haven't had any element, return 0\n if (cnt == 0) return alternative;\n return sum / cnt;\n }", "public double getAverage(){\n int total = 0; //inicializa o total\n \n //soma notas de um aluno\n for(int grade: grades){\n total += grade;\n }\n \n return (double) total/grades.length;\n }", "public double averageVolume() {\r\n \r\n double total = 0;\r\n int index = 0;\r\n if (list.size() == 0) {\r\n return 0; \r\n }\r\n while (index < list.size()) {\r\n total += list.get(index).volume();\r\n index++;\r\n }\r\n if (index == 0)\r\n {\r\n total = 0;\r\n }\r\n else\r\n {\r\n total = total / index;\r\n }\r\n \r\n return total;\r\n }", "public static double GetAverage(List<Long> longList) {\n double curAvg = 0;\n for (int i = 0; i < longList.size(); i++) {\n curAvg += (longList.get(i) - curAvg) / (double)i;\n }\n return curAvg;\n }", "public static double meanOf(Iterable<? extends Number> values) {\n/* 393 */ return meanOf(values.iterator());\n/* */ }", "public double std(ArrayList<Double> x) {\n double sum = 0;\n double round;\n for (int i = 0; i < x.size(); i++) {\n sum += Math.pow((x.get(i) - average(x)), 2) / x.size();\n }\n round = Math.sqrt(sum) * 100;\n round = Math.round(round);\n round /= 100;\n return round;\n\n\n }", "public static double avg(ExpressionContext context, List nodeset) {\n if ((nodeset == null) || (nodeset.size() == 0)) {\n return Double.NaN;\n }\n\n JXPathContext rootContext = context.getJXPathContext();\n rootContext.getVariables().declareVariable(\"nodeset\", nodeset);\n\n Double value = (Double) rootContext.getValue(\"sum($nodeset) div count($nodeset)\", Double.class);\n\n return value.doubleValue();\n }", "public static double average (double ... numbers)\r\n\t{", "public double averagePrice() {\r\n\t\tdouble sum = 0;\r\n\t\tfor(Integer price : ticketPrice) {\r\n\t\t\tsum+=price;\r\n\t\t}\r\n\t\treturn sum/ticketPrice.size();\r\n\t}", "public double getAverage()\n {\n return getSum() / 2.0;\n }", "public static double avgDoublesArray(double array[])\n\t{\n\t\tdouble avg = 0;\n\t\tfor (int i = 0; i < array.length; i++)\n\t\t\tavg += array[i];\n\t\t\n\t\tavg = avg / array.length;\n\t\treturn avg;\n\t}", "private static double meanVal(double[] arrayOfSamples){\n\t\tdouble total = 0;\n\t\t for (double i :arrayOfSamples){\n\t\t \ttotal += i;\n\t\t }\n\t return total/arrayOfSamples.length;\n\t}", "private double getAvg() {\n\n double sum = 0;\n\n for (Map.Entry<Integer, Double> entry : values.entrySet()) {\n sum += entry.getValue();\n }\n\n if (values.size() > 0) {\n return sum / values.size();\n } else {\n throw new IllegalStateException(\"no values\");\n }\n }", "public static double getArrayListDoubleVariance(ArrayList<Double> list) {\n\t\treturn 0;\n\t}", "public static double average (double ... s4){\n double suma = 0.0;\n for (double value : s4) {\n suma += value;\n }\n return suma / s4.length;\n }", "public void parseAverages(){\r\n\t\tfor(int i = 1; i < x.size(); i++){\r\n\t\t\tdouble avg = (x.get(i) + x.get(i-1)) / 2;\r\n\t\t\tx.set(i, avg);\r\n\t\t}\r\n\t}", "public double mean()\n {\n double sum = 0.0;\n for(int t = 0; t<size; t++)\n sum += x[t];\n return sum/size;\n }", "public double mean(double data[]) {\r\n\t\tdouble mean = 0;\r\n\t\ttry {\r\n\t\t\tfor(int i=0;i<data.length;i++) {\r\n\t\t\t\tmean =mean+data[i];\r\n\t\t\t}\r\n\t\t\tmean = mean / data.length;\r\n\t\t}\r\n\t\tcatch(Exception e) {\r\n\t\t\tDataMaster.logger.warning(e.toString());\r\n\t\t\t//e.printStackTrace();\r\n\t\t}\r\n\t\treturn mean;\r\n\t}", "@Override\n\tpublic double avg() {\n\t\treturn total()/4.0;\n\t}", "public double averageOfArray() {\n double sum = 0;\n double average = 0;\n int i;\n for (i = 0; i < sirDeLa1La100.length; i++) {\n sum = sum + sirDeLa1La100[i];\n }\n average = sum / sirDeLa1La100.length;\n return average;\n }", "public double getAverageGrade(){\n double totalGrade = 0;\n double averageGrade = 0;\n // for loop to iterate over the array\n for(int i = 0; i<students.size(); i++){\n totalGrade += students.get(i).getGrades();\n } // end for\n \n averageGrade = totalGrade / students.size();\n return averageGrade;\n }", "public void getAvg()\n {\n this.avg = sum/intData.length;\n }", "public double average() {\n return average(0.0);\n }", "public static double avg(double[] array) {\r\n\t\tdouble ret = sum(array);\r\n\t\treturn ret / array.length;\r\n\t}", "public static double average(double[] array){\n double sum = 0;\n for (int i = 0; i < array.length; i++) {\n sum += array[i];\n }\n return sum/array.length;\n }", "static double calculateAverage(int[] array) {\n\n double sum = 0;\n\n for (int i = 0; i < array.length; i++) {\n\n sum = sum + (double) array[i];\n\n\n }\n\n return sum / array.length;//returning average\n\n }", "public double averageSurfaceArea() {\r\n \r\n double total = 0;\r\n int index = 0;\r\n if (list.size() == 0) {\r\n return 0; \r\n }\r\n while (index < list.size()) {\r\n total += list.get(index).surfaceArea();\r\n index++;\r\n }\r\n if (index == 0)\r\n {\r\n total = 0;\r\n }\r\n else\r\n {\r\n total = total / index;\r\n }\r\n return total;\r\n }", "private float calculateMean()\n { \n int numberEmployees = employees.size();\n float total = 0, meanGrossPay = 0;\n // Create an array of all gross pays\n float[] allGrossPay = new float[numberEmployees];\n \n // Call method to return an array of float containing all gross pays\n allGrossPay = calculateAllGrossPay();\n // Find total gross pay\n for (int i = 0; i < numberEmployees; i++)\n {\n total += allGrossPay[i];\n }\n // Find mean and return it\n if (numberEmployees > 0)\n {\n meanGrossPay = total/numberEmployees;\n \n }\n return meanGrossPay;\n }", "public static void calculateAvg(double[] avgPArr, int itemNum) {\n\n for (int i = 0; i < avgPArr.length; i++)\n avgPArr[i] /= itemNum;\n\n }", "public double[] mean() {\n\t\tdouble[] mean = null;\n\t\tif(instances != null) {\n\t\t\tmean = new double[instances.get(0).length];\n\t\t\tfor(double[] instance : instances) {\n\t\t\t\tfor(int d=0; d<mean.length; d++) {\n\t\t\t\t\tmean[d] += instance[d];\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tdouble n = instances.size();\n\t\t\tfor(int d=0; d<mean.length; d++) {\n\t\t\t\tmean[d] /= n;\n\t\t\t}\n\t\t}\n\t\treturn mean;\n\t}", "private Double getMean(Double[] values) {\n double sum = 0;\n int count = 0;\n for (Double d: values) {\n if (d != null) {\n sum += d;\n ++count;\n }\n }\n return count == 0 ? null : (sum / count);\n }", "private double calculateAverage(Candle[] cd) {\n double sum = 0; \r\n for(Candle c : cd) {\r\n sum += c.getClose();\r\n }\r\n return sum/cd.length;\r\n \r\n }", "public static void main(String[] args) {\n\t\t List<Product> list = new ArrayList<>();\r\n\t list.add(new Product(1, 1.58));\r\n\t list.add(new Product(2, 1.45));\r\n\t list.add(new Product(3, 2.25));\r\n\t list.add(new Product(4, 2.58));\r\n\r\n\t Double ans = list.stream().filter(p -> p.price < 2.5).mapToDouble\r\n\t (p -> p.price).average().orElse(0);\r\n\r\n\t System.out.println(ans);\r\n\t}", "@Override\n\tpublic int avg() {\n\t\treturn (this.sum()/3);\n\t}", "public double averageVolume() {\r\n double listAvgVolume = 0.0;\r\n if (list.size() != 0) {\r\n listAvgVolume = totalVolume() / list.size();\r\n }\r\n return listAvgVolume;\r\n }", "public static Double calculateAverageGrade(List<Student> students) {\n return -1.;\n }", "private double calcAvgX(List<Business> business) {\n\t\tdouble avg = 0.0;\n\t\tint count = 0;\n\t\tfor (int i = 0; i < business.size(); i++) {\n\t\t\tavg += business.get(i).getPrice();\n\t\t\tcount++;\n\t\t}\n\n\t\treturn avg / count;\n\t}", "public double average(int first, int last){\n double final = 0;\n for(int i = first; i < last; i++){\n final += scores[i];\n }\n return final/(last-first+1);\n}", "public int average()\n {\n int average = 0;\n int sum = 0;\n\n for ( int index = 0; index < data.length; index++ )\n {\n sum = sum + data[index];\n }\n average = sum / data.length;\n\n return average;\n }", "public double getAverage() {\n int total = 0;\n\n // sum grades of the student\n for (int grade : grades)\n total += grade;\n\n // return average of the grade\n return (double) total / grades.length;\n }", "public static double getAverage(int start, double[] d) {\n double average = 0;\n for (int i = 0; i < 110; i++) {\n average = average + d[i];\n }\n return average / 110;\n }", "protected abstract List<Double> calcScores();", "double getMeanProfit() {\n ArrayList<Double> allProfits = new ArrayList<>();\n\n for (Firm firm : firms) {\n List<Double> profitsOfFirm = firm.getProfits();\n allProfits.addAll(profitsOfFirm.subList(profitsOfFirm.size() - SimulationManager.sizeOfExaminationInterval, profitsOfFirm.size()));\n }\n\n return Calculation.round(Calculation.getMean(allProfits), 2);\n }", "private double calcAverage(int startIndex, int endIndex) {\n\t\t\n\t\t// total for the scores\n\t\tdouble total = 0;\n\t\t\n\t\t// loop between indexes and add the scores\n\t\tfor (int i = startIndex; i < endIndex; i++) \n\t\t\ttotal += scores.get(i);\n\t\t\n\t\t// return the average\n\t\treturn total / (endIndex - startIndex);\n\t}", "@Override\n public double findAverage() {\n double average = 0;\n for (Student key : map.keySet()) {\n average += map.get(key).getValue();\n }\n average /= map.keySet().size();\n return average;\n }", "public double getGradeAverage() {\n int gradesTotal = 0;\n for (int grade : grades) {\n gradesTotal += grade;\n }\n return gradesTotal / grades.size();\n }", "public synchronized double getAverage() {\n return average;\n }", "public List<KeyValue<Integer>> getAvg() {\n\t\tList<KeyValue<Integer>> result = new ArrayList<KeyValue<Integer>>();\n\t\tJavaRDD<Document> rdd = dal.getRDD();\n\t\tList<Tuple2<String, Iterable<Document>>> list = rdd.groupBy(new Function<Document, String>() {\n\t\t\t// 分组\n\t\t\t/**\n\t\t\t * \n\t\t\t */\n\t\t\tprivate static final long serialVersionUID = 1L;\n\n\t\t\tpublic String call(Document v1) throws Exception {\n\t\t\t\tString province = v1.getString(\"province\");\n\t\t\t\tDouble price = v1.getDouble(\"unitPrice\");\n\t\t\t\tif (v1.getString(\"province\") != null && price > 0) {\n\t\t\t\t\treturn province;\n\t\t\t\t}\n\t\t\t\treturn \"other\";\n\t\t\t}\n\t\t}).collect();\n\t\tfor (Tuple2<String, Iterable<Document>> tuple2 : list) {\n\t\t\t// 循环遍历,统计平均数\n\t\t\tif (tuple2._1.equals(\"other\")) {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tIterator<Document> iterator = tuple2._2.iterator();\n\t\t\tList<Double> prices = new ArrayList<Double>();\n\t\t\twhile (iterator.hasNext()) {\n\t\t\t\tprices.add(iterator.next().getDouble(\"unitPrice\"));\n\t\t\t}\n\t\t\tdouble sum = dal.getSparkContext().parallelize(prices).reduce(new Function2<Double, Double, Double>() {\n\n\t\t\t\t/**\n\t\t\t\t * \n\t\t\t\t */\n\t\t\t\tprivate static final long serialVersionUID = 1L;\n\n\t\t\t\tpublic Double call(Double v1, Double v2) throws Exception {\n\t\t\t\t\treturn v1 + v2;\n\t\t\t\t}\n\t\t\t});\n\t\t\tresult.add(new KeyValue<Integer>(tuple2._1, (int) sum / prices.size()));\n\t\t}\n\t\t// dal.destroy();\n\t\treturn result;\n\t}", "public double getAvg(){\n double avg=0;\n for(int x=0; x<max; x++){\n avg=avg+times[x];\n }\n avg=avg/max;\n return avg;\n }", "public int average() {\n int total = 0;\n\n for (int score : scores) {\n total += score;\n }\n\n return total / scores.length;\n }", "public double arithmeticalMean(double[] arr) {\n return 0;\n }", "public static double mean(double[] x){\n\n //Declares and intializes mean and total to 0;\n double mean = 0;\n double total = 0;\n\n //Takes the total of all the numbers in every index\n for(int i = 0; i < x.length; i++){\n total += x[i];\n }\n //Divides total by 10\n mean = total / 10;\n\n //returns mean\n return mean;\n\n }", "double getMeanQuantity() {\n ArrayList<Double> allQuantities = new ArrayList<>();\n\n for (Firm firm : firms) {\n List<Double> quantitiesOfFirm = firm.getQuantities();\n allQuantities.addAll(quantitiesOfFirm.subList(quantitiesOfFirm.size() - SimulationManager.sizeOfExaminationInterval, quantitiesOfFirm.size()));\n }\n\n return Calculation.round(Calculation.getMean(allQuantities), 2);\n }", "public void average(){\n\t\tfor(PlayerWealthDataAccumulator w : _wealthData.values()){\n\t\t\tw.average();\n\t\t}\n\t}", "public static void main(String[] args) {\n\n ArrayList<Double> number = new ArrayList<>();\n Scanner in = new Scanner(System.in);\n System.out.println(\"Enter a number to calculate average\");\n\n String[] token = in.nextLine().split(\"\\\\s\");\n\n for (int i = 0; i < token.length; i++) {\n number.add(Double.parseDouble(token[i]));\n if (number.size() == 0) {\n System.out.println(\"No Average\");\n } else {\n double total = 0;\n for (double element :\n number) {\n\n\n total = total + element;\n }\n double average = total / number.size();\n System.out.println(\"the average is: \" + average);\n }\n }\n }", "public double merge( Double topLevelResult, List<Double> recursiveResult ) {\n /* Accumulate the total similarity in recursive_average */\n Double recursive_average = 0.;\n for( Double d : recursiveResult ) {\n recursive_average += d;\n }\n\n /* Divide by length of the list to get the average */\n recursive_average /= recursiveResult.size();\n\n /* Return the average of toplevel and recursive average */\n return ( topLevelResult + recursive_average ) / 2;\n\n }", "double getAvgTreatment();", "private double avgNonEmpty() {\n\t\tdouble percent = 0;\n\t\t\n\t\tfor (LinkedList<WordCode<K, V>> ll : myBuckets) {\n\t\t\tif (ll.size() != 0) percent++;\n\t\t}\n\t\treturn (numEntries / percent);\n\t}", "public ArrayList<Double> getAverageFitnesses() { return avgFitnesses; }", "private List<Double> sumMeanY(List<Review> Reviews, double avgY) {\n\t\tList<Double> sumMean = new ArrayList<Double>();\n\t\tfor (Review review : Reviews) {\n\t\t\tsumMean.add(review.getNumStars() - avgY);\n\t\t}\n\n\t\treturn sumMean;\n\t}", "public double getMean() {\n double timeWeightedSum = 0;\n\n for (int i = 0; i < accumulate.size() - 1; i++) {\n timeWeightedSum += accumulate.get(i).value\n * (accumulate.get(i + 1).timeOfChange\n - accumulate.get(i).timeOfChange);\n\n }\n LOG_HANDLER.logger.finer(\"timeWeightedSum Value: \" + timeWeightedSum\n + \"totalOfQuueueEntries: \" + totalOfQueueEntries);\n return timeWeightedSum / totalOfQueueEntries;\n }", "public abstract double divideForAvg(S o, Long l);", "public static double meanOf(Iterator<? extends Number> values) {\n/* 407 */ Preconditions.checkArgument(values.hasNext());\n/* 408 */ long count = 1L;\n/* 409 */ double mean = ((Number)values.next()).doubleValue();\n/* 410 */ while (values.hasNext()) {\n/* 411 */ double value = ((Number)values.next()).doubleValue();\n/* 412 */ count++;\n/* 413 */ if (Doubles.isFinite(value) && Doubles.isFinite(mean)) {\n/* */ \n/* 415 */ mean += (value - mean) / count; continue;\n/* */ } \n/* 417 */ mean = StatsAccumulator.calculateNewMeanNonFinite(mean, value);\n/* */ } \n/* */ \n/* 420 */ return mean;\n/* */ }", "public void computeAverageOfRepeats() {\n\t\t\n\t\texperimentsAvg_ = new ArrayList<Experiment>();\n\t\t\n\t\tfor (int i=0; i<experiments_.size(); i++)\n\t\t\texperimentsAvg_.add(experiments_.get(i).computeAverageOfRepeats());\n\t}", "public static Double median(List<Double> list) {\r\n if (list == null || list.size() == 0) {\r\n throw new Error(\"Mean of an empty list is undefined\");\r\n }\r\n int size = list.size();\r\n Collections.sort(list);\r\n double median = 0.0;\r\n if (size % 2 == 0) {\r\n median = (list.get(size / 2) + list.get((size / 2) - 1)) / 2.0;\r\n } else {\r\n median = list.get(size / 2);\r\n }\r\n return median;\r\n }" ]
[ "0.8160761", "0.79379696", "0.7841702", "0.7792062", "0.77336407", "0.77079916", "0.76984966", "0.7680299", "0.7657294", "0.7594179", "0.7539824", "0.75120825", "0.7496666", "0.74832547", "0.74752706", "0.743621", "0.74298537", "0.7426118", "0.7419833", "0.7417377", "0.73827344", "0.73603284", "0.7340494", "0.73385674", "0.72485244", "0.71708", "0.71430373", "0.7117725", "0.70950925", "0.7041046", "0.7030121", "0.6979112", "0.6955483", "0.6945533", "0.6941054", "0.6933821", "0.69220555", "0.6905805", "0.6893818", "0.68874764", "0.68554515", "0.6848632", "0.68482846", "0.6828008", "0.682722", "0.6822768", "0.67953855", "0.67922026", "0.67860264", "0.6757817", "0.67478114", "0.672718", "0.67012554", "0.667614", "0.6654141", "0.6636206", "0.6622432", "0.66161615", "0.65983516", "0.65955955", "0.657684", "0.6554145", "0.65446144", "0.65435463", "0.65362096", "0.65205216", "0.65167224", "0.65067303", "0.6498635", "0.6494321", "0.6480161", "0.64721066", "0.64424294", "0.6439413", "0.6435547", "0.64177656", "0.63890195", "0.63830066", "0.6370523", "0.636006", "0.635781", "0.6337113", "0.6323171", "0.6323047", "0.63166517", "0.63129693", "0.63083327", "0.6294091", "0.6282574", "0.6273263", "0.627219", "0.6267001", "0.6266372", "0.6247598", "0.62461746", "0.6228563", "0.6225568", "0.6215915", "0.6194545", "0.6187003" ]
0.76047736
9
ENCRYPTION / DECRYPTION METHODS method to encode string into md5 hash
public String get_Md5_Hash(String sStringToEncode) throws Exception { String sRetval = ""; StringBuffer sb = new StringBuffer(); try { MessageDigest md = MessageDigest.getInstance("MD5"); byte[] messageDigest = md.digest(sStringToEncode.getBytes("UTF-8")); BigInteger number = new BigInteger(1, messageDigest); String hashtext = number.toString(16); sRetval = hashtext; } catch (Exception e) { throw new Exception("get_Md5_Hash : " + e); } return sRetval; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static String str2MD5(String strs) {\n StringBuffer sb = new StringBuffer();\n try {\n MessageDigest digest = MessageDigest.getInstance(\"MD5\");\n byte[] bs = digest.digest(strs.getBytes());\n /*\n * after encryption is -128 to 127 ,is not safe\n * use it to binary operation,get new encryption result\n *\n * 0000 0011 0000 0100 0010 0000 0110 0001\n * &0000 0000 0000 0000 0000 0000 1111 1111\n * ---------------------------------------------\n * 0000 0000 0000 0000 0000 0000 0110 0001\n *\n * change to 16 bit\n */\n for (byte b : bs) {\n int x = b & 255;\n String s = Integer.toHexString(x);\n if (x < 16) {\n sb.append(\"0\");\n }\n sb.append(s);\n }\n\n } catch (Exception e) {\n System.out.println(\"encryption lose\");\n }\n return sb.toString();\n }", "public String encodeByMD5(String string) {\n\t\t\tif (string == null) {\r\n\t\t\t\treturn null;\r\n\t\t\t}\r\n\t\t\ttry {\r\n\t\t\t\tMessageDigest messageDigest = MessageDigest.getInstance(\"MD5\");\r\n\t\t\t\t\r\n\t\t\t\t//使用平台的默认字符集将此 String 编码为 byte 序列,并将结果存储到一个新的 byte 数组中。\r\n\t\t\t\t//将byte数组给摘要\r\n\t\t\t\tmessageDigest.update(string.getBytes());\r\n\t\t\t\t//通过执行诸如填充之类的最终操作完成哈希计算。在调用此方法之后,摘要被重置。 \r\n\t\t\t\t//返回:\r\n\t\t\t\t//存放哈希值结果的 byte 数组。\r\n\t\t\t\t\r\n\t\t\t\treturn getFormattedText(messageDigest.digest());\r\n\t\t\t} catch (Exception e) {\r\n\t\t\t\tthrow new RuntimeException(e);\r\n\t\t\t}\r\n\t\t}", "public static String encryptMD5(String st) {\n MessageDigest messageDigest;\n byte[] digest = new byte[0];\n try {\n messageDigest = MessageDigest.getInstance(DefaultValueConstants.DEFAULT_ENCRYPTING_ALGORITHM);\n messageDigest.reset();\n messageDigest.update(st.getBytes());\n digest = messageDigest.digest();\n } catch (NoSuchAlgorithmException e) {\n log.error(e);\n }\n BigInteger bigInt = new BigInteger(1, digest);\n String md5Hex = bigInt.toString(16);\n while (md5Hex.length() < 32) {\n md5Hex = \"0\" + md5Hex;\n }\n return md5Hex;\n }", "public String Crypt(String s);", "private String toMD5(String password)\n {\n try {\n MessageDigest m = MessageDigest.getInstance(\"MD5\");\n \n m.update(password.getBytes(),0,password.length());\n \n return new BigInteger(1, m.digest()).toString(16);\n } catch (NoSuchAlgorithmException ex) {\n Logger.getLogger(User.class.getName()).log(Level.SEVERE, null, ex);\n }\n return \"\";\n }", "protected static String md5(final String string) {\n try {\n final MessageDigest m = MessageDigest.getInstance(\"MD5\");\n m.update(string.getBytes(), 0, string.length());\n return new BigInteger(1, m.digest()).toString(16);\n } catch (NoSuchAlgorithmException e) {\n return \"\";\n }\n }", "public static String encryptPw(String string) throws NoSuchAlgorithmException {\n\n if (isBlankOrNull(string)) return \"\";\n\n MessageDigest md = MessageDigest.getInstance(\"MD5\");\n md.update(string.getBytes());\n byte[] digest = md.digest();\n\n String hashedString = DatatypeConverter\n .printHexBinary(digest).toUpperCase();\n\n return hashedString;\n }", "public static String encryptedByMD5(String password) {\n StringBuilder result = new StringBuilder();\n try {\n byte[] pass = MessageDigest\n .getInstance(\"MD5\")\n .digest(password.getBytes());\n\n for (byte b : pass) {\n int salt = b & 0xCA; //Salt\n String saltString = Integer.toHexString(salt);\n if (1 == saltString.length()) {\n result.append(\"0\");\n }\n result.append(saltString);\n }\n return result.toString();\n } catch (NoSuchAlgorithmException e) {\n LOG.error(\"No MD5 Algorithm in this System! \", e);\n throw new RuntimeException(\"Could not encrypt the user password in this system!\", e);\n }\n }", "private String md5(final String s)\n\t{\n\t\ttry {\n\t\t\t// Create MD5 Hash\n\t\t\tMessageDigest digest = MessageDigest.getInstance(\"MD5\");\n\t\t\tdigest.update(s.getBytes());\n\t\t\tbyte messageDigest[] = digest.digest();\n\n\t\t\t// Create Hex String\n\t\t\tStringBuffer hexString = new StringBuffer();\n\t\t\tfor (int i=0; i<messageDigest.length; i++) {\n\t\t\t\tString h = Integer.toHexString(0xFF & messageDigest[i]);\n\t\t\t\twhile (h.length() < 2) h = \"0\" + h;\n\t\t\t\thexString.append(h);\n\t\t\t}\n\t\t\treturn hexString.toString();\n\t\t} catch(NoSuchAlgorithmException e) {\n\t\t\t//Logger.logStackTrace(TAG,e);\n\t\t}\n\t\treturn \"\";\n\t}", "public static String crypt(String str) {\n if (str == null || str.length() == 0) {\n throw new IllegalArgumentException(\"String to encript cannot be null or zero length\");\n }\n StringBuffer hexString = new StringBuffer();\n try {\n MessageDigest md = MessageDigest.getInstance(\"MD5\");\n md.update(str.getBytes());\n byte[] hash = md.digest();\n for (int i = 0; i < hash.length; i++) {\n if ((0xff & hash[i]) < 0x10) {\n hexString.append(\"0\" + Integer.toHexString((0xFF & hash[i])));\n } else {\n hexString.append(Integer.toHexString(0xFF & hash[i]));\n }\n }\n } catch (NoSuchAlgorithmException e) {\n e.printStackTrace();\n }\n return hexString.toString();\n }", "public static String encryptMD5ToString(final String data) {\n if (data == null || data.length() == 0) return \"\";\n return encryptMD5ToString(data.getBytes());\n }", "private String encryptPassword(String password) {\n\t\tbyte[] defaultBytes = password.getBytes();\r\n StringBuffer hexString = new StringBuffer();\r\n try{\r\n MessageDigest algorithm = MessageDigest.getInstance(\"MD5\");\r\n algorithm.reset();\r\n algorithm.update(defaultBytes);\r\n byte messageDigest[] = algorithm.digest();\r\n for (int i=0;i<messageDigest.length;i++) {\r\n String hex = Integer.toHexString(0xFF & messageDigest[i]);\r\n if(hex.length()==1)\r\n hexString.append('0');\r\n hexString.append(hex);\r\n }\r\n }catch (Exception e){e.printStackTrace();}\r\n\t\tpassword = hexString.toString();\r\n\t\t//System.out.println(password);\r\n\t\treturn password;\r\n\t}", "public static String encriptar(String input){\n try {\n\n MessageDigest md = MessageDigest.getInstance(\"MD5\");\n\n byte[] messageDigest = md.digest(input.getBytes());\n\n BigInteger no = new BigInteger(1, messageDigest);\n\n String hashtext = no.toString(16);\n while (hashtext.length() < 32) {\n hashtext = \"0\" + hashtext;\n }\n return hashtext;\n }\n\n catch (NoSuchAlgorithmException e) {\n throw new RuntimeException(e);\n }\n }", "Encryption encryption();", "private String encrypt_password(String password)\r\n\t{\r\n\t\tString generated_password = null;\r\n try\r\n {\r\n\r\n MessageDigest md = MessageDigest.getInstance(\"MD5\");\r\n md.update(password.getBytes());\r\n byte[] bytes = md.digest();\r\n StringBuilder sb = new StringBuilder();\r\n for(int i=0; i< bytes.length ;i++)\r\n {\r\n sb.append(Integer.toString((bytes[i] & 0xff) + 0x100, 16).substring(1));\r\n }\r\n generated_password=sb.toString();\r\n }\r\n catch (NoSuchAlgorithmException e)\r\n {\r\n \r\n }\r\n return generated_password;\r\n\t}", "public static String md5(final String data) {\n return ByteString.encodeUtf8(data).md5().hex().toLowerCase();\n }", "public static String hash(String in) {\r\n\t\treturn DigestUtils.md5Hex(in.getBytes());\r\n\t}", "public static byte[] encryptMD5(final byte[] data) {\n return hashTemplate(data, \"MD5\");\n }", "private static String md5(final String s) {\n final String MD5 = \"MD5\";\n try {\n // Create MD5 Hash\n MessageDigest digest = java.security.MessageDigest\n .getInstance(MD5);\n digest.update(s.getBytes());\n byte messageDigest[] = digest.digest();\n\n // Create Hex String\n StringBuilder hexString = new StringBuilder();\n for (byte aMessageDigest : messageDigest) {\n String h = Integer.toHexString(0xFF & aMessageDigest);\n while (h.length() < 2)\n h = \"0\" + h;\n hexString.append(h);\n }\n return hexString.toString();\n\n } catch (NoSuchAlgorithmException e) {\n e.printStackTrace();\n }\n return \"\";\n }", "public String md5(String s) {\n try {\n // Create MD5 Hash\n MessageDigest digest = java.security.MessageDigest.getInstance(\"MD5\");\n digest.update(s.getBytes());\n byte messageDigest[] = digest.digest();\n\n // Create Hex String\n StringBuffer hexString = new StringBuffer();\n for (int i = 0; i < messageDigest.length; i++)\n hexString.append(Integer.toHexString(0xFF & messageDigest[i]));\n return hexString.toString();\n\n } catch (NoSuchAlgorithmException e) {\n e.printStackTrace();\n }\n return \"\";\n }", "static String PlaintextToHashedPassword(String password) throws InvalidKeySpecException, NoSuchAlgorithmException {\n String hashedPassword = null;\n try {\n // Create MessageDigest instance for MD5\n MessageDigest md = MessageDigest.getInstance(\"MD5\");\n\n //Add password bytes to digest\n md.update(password.getBytes());\n\n //Get the hash's bytes\n byte[] bytes = md.digest();\n\n //This bytes[] has bytes in decimal format;\n //Convert it to hexadecimal format\n StringBuilder sb = new StringBuilder();\n for(int i=0; i< bytes.length ;i++)\n {\n sb.append(Integer.toString((bytes[i] & 0xff) + 0x100, 16).substring(1));\n }\n //Get complete hashed password in hex format\n hashedPassword = sb.toString();\n }\n catch (NoSuchAlgorithmException e)\n {\n e.printStackTrace();\n }\n\n return hashedPassword;\n }", "public static String getMD5Hash(String string) {\r\n\t\tMessageDigest digest;\r\n\t\ttry {\r\n\t\t\tdigest = java.security.MessageDigest.getInstance(\"MD5\");\r\n\t\t\tdigest.update(string.getBytes());\r\n\t\t\tfinal byte[] hash = digest.digest();\r\n\t\t\tfinal StringBuilder result = new StringBuilder(hash.length);\r\n\t\t\tfor (int i = 0; i < hash.length; i++) {\r\n\t\t\t\tresult.append(Integer.toString((hash[i] & 0xff) + 0x100, 16)\r\n\t\t\t\t\t\t.substring(1));\r\n\t\t\t}\r\n\t\t\treturn result.toString();\r\n\t\t} catch (final NoSuchAlgorithmException e) {\r\n\t\t\te.printStackTrace();\r\n\t\t\treturn \"error\";\r\n\t\t}\r\n\t}", "@Test\n public void md5Checksum() throws NoSuchAlgorithmException {\n String string = Utils.md5Checksum(\"abcde fghijk lmn op\");\n Assert.assertEquals(\"1580420c86bbc3b356f6c40d46b53fc8\", string);\n }", "public String getHash(final String password) throws NoSuchAlgorithmException, UnsupportedEncodingException {\n final MessageDigest digest = MessageDigest.getInstance(\"MD5\");\n byte[] md5hash;\n digest.update(password.getBytes(\"utf-8\"), 0, password.length());\n md5hash = digest.digest();\n return convertToHex(md5hash);\n }", "public static String encryptMD5ToString(final byte[] data) {\n return bytes2HexString(encryptMD5(data));\n }", "public static String md5(String pass)\n {\n try{\n MessageDigest md=MessageDigest.getInstance(\"MD5\");\n byte[] messageDigest=md.digest(pass.getBytes());\n BigInteger num=new BigInteger(1,messageDigest);\n String hashText=num.toString(16);\n while(hashText.length()<32)\n {\n hashText=\"0\"+hashText;\n } \n return hashText; \n }\n catch(Exception e)\n { \n throw new RuntimeException(e);\n } \n }", "public MD5Hash(String s) {\n\t\tif(s.length() != 32) throw new IllegalArgumentException(\"Hash must have 32 characters\");\n\t\thashString = s;\n\t}", "public static String EncoderByMd5(String source){\n String sCode = null;\n try{\n MessageDigest md5=MessageDigest.getInstance(\"MD5\"); \n sCode = Base64.encode(md5.digest(source.getBytes(\"UTF-8\"))); \n }\n catch(UnsupportedEncodingException e1){}\n catch(NoSuchAlgorithmException e2){}\n \n return sCode;\n }", "private String getHash(String text) {\n\t\ttry {\n\t\t\tString salt = new StringBuffer(this.email).reverse().toString();\n\t\t\ttext += salt;\n\t\t\tMessageDigest m = MessageDigest.getInstance(\"MD5\");\n\t\t\tm.reset();\n\t\t\tm.update(text.getBytes());\n\t\t\tbyte[] digest = m.digest();\n\t\t\tBigInteger bigInt = new BigInteger(1, digest);\n\t\t\tString hashedText = bigInt.toString(16);\n\t\t\twhile (hashedText.length() < 32) {\n\t\t\t\thashedText = \"0\" + hashedText;\n\t\t\t}\n\t\t\treturn hashedText;\n\t\t} catch (Exception e) {\n\t\t\te.getStackTrace();\n\t\t\treturn text;\n\t\t}\n\t}", "private String md5(String input) {\r\n\t\tString md5 = null;\r\n\t\tif (null == input)\r\n\t\t\treturn null;\r\n\r\n\t\ttry {\r\n\t\t\tMessageDigest digest = MessageDigest.getInstance(\"MD5\");\r\n\t\t\tdigest.update(input.getBytes(), 0, input.length());\r\n\t\t\tmd5 = new BigInteger(1, digest.digest()).toString(16);\r\n\t\t} catch (NoSuchAlgorithmException e) {\r\n\r\n\t\t\te.printStackTrace();\r\n\t\t}\r\n\t\treturn md5;\r\n\t}", "public static String encodePassword(String password) {\r\n\t\t\r\n\t\tbyte[] uniqueKey = password.getBytes();\r\n\t\tbyte[] hash = null;\r\n\t\ttry {\r\n\t\t\thash = MessageDigest.getInstance(\"MD5\").digest(uniqueKey);\r\n\t\t} catch (NoSuchAlgorithmException e) {\r\n\t\t\te.printStackTrace();\r\n\t\t}\r\n\t\tStringBuffer hashString = new StringBuffer();\r\n\t\tfor ( int i = 0; i < hash.length; ++i ) {\r\n\t\t\tString hex = Integer.toHexString(hash[i]);\r\n\t\t\tif ( hex.length() == 1 ) {\r\n\t\t\t hashString.append('0');\r\n\t\t\t hashString.append(hex.charAt(hex.length()-1));\r\n\t\t\t} else {\r\n\t\t\t hashString.append(hex.substring(hex.length()-2));\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\treturn hashString.toString();\r\n\t}", "public String encrypt(String value) throws Exception\n {\n if ( key == null )\n {\n throw new Exception(\"CodecUtil must be initialised with the storeKey first.\");\n }\n try\n {\n Cipher pbeCipher = Cipher.getInstance(\"PBEWithMD5AndDES\");\n pbeCipher.init(Cipher.ENCRYPT_MODE, key, new PBEParameterSpec(salt, 20));\n return base64Encode(pbeCipher.doFinal(value.getBytes(\"UTF-8\")));\n }\n catch (Exception e)\n {\n throw new Exception(\"Encryption error :\" + e.getMessage());\n }\n }", "private static String md5(String str) {\n\n if (str == null) {\n return null;\n }\n\n MessageDigest messageDigest = null;\n\n try {\n messageDigest = MessageDigest.getInstance(HttpConf.signType);\n messageDigest.reset();\n messageDigest.update(str.getBytes(HttpConf.charset));\n } catch (NoSuchAlgorithmException e) {\n\n return str;\n } catch (UnsupportedEncodingException e) {\n return str;\n }\n\n byte[] byteArray = messageDigest.digest();\n\n StringBuffer md5StrBuff = new StringBuffer();\n\n for (int i = 0; i < byteArray.length; i++) {\n if (Integer.toHexString(0xFF & byteArray[i]).length() == 1) {\n md5StrBuff.append(\"0\").append(Integer.toHexString(0xFF & byteArray[i]));\n } else {\n md5StrBuff.append(Integer.toHexString(0xFF & byteArray[i]));\n }\n }\n\n return md5StrBuff.toString();\n }", "public static String encodePassword(String password) {\n\t\tString encodedPassword = null;\n\t\ttry {\n\t\t\tencodedPassword = encodePassword(password, \"MD5\");\n\t\t} catch (NoSuchAlgorithmException e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t\treturn encodedPassword;\n\t}", "public static String md5(String str) {\n MessageDigest messageDigest = null;\n try {\n messageDigest = MessageDigest.getInstance(\"MD5\");\n messageDigest.reset();\n messageDigest.update(str.getBytes(\"UTF-8\"));\n } catch (NoSuchAlgorithmException | UnsupportedEncodingException e) {\n // do nothing\n }\n byte[] byteArray = messageDigest.digest();\n StringBuffer md5StrBuff = new StringBuffer();\n for (int i = 0; i < byteArray.length; i++) {\n if (Integer.toHexString(0xFF & byteArray[i]).length() == 1)\n md5StrBuff.append(\"0\").append(Integer.toHexString(0xFF & byteArray[i]));\n else\n md5StrBuff.append(Integer.toHexString(0xFF & byteArray[i]));\n }\n return md5StrBuff.toString();\n }", "public String encriptarPassword(String password)\r\n\t{\r\n\t\tString passwordencriptadomd=\"\";\r\n\t\tString passwordencriptadosh=\"\";\r\n\t\tfor (int i = 0; i < 4; i++) {\r\n\t\t\tif(i==0){\r\n\t\t\t\tpasswordencriptadomd=Encriptar.getStringMessageDigest(password, Encriptar.MD5);\r\n\t\t\t\tpasswordencriptadosh=Encriptar.getStringMessageDigest(passwordencriptadomd, Encriptar.SHA1);\r\n\t\t\t}else{\r\n\t\t\t\tpasswordencriptadomd=Encriptar.getStringMessageDigest(passwordencriptadosh, Encriptar.MD5);\r\n\t\t\t\tpasswordencriptadosh=Encriptar.getStringMessageDigest(passwordencriptadomd, Encriptar.SHA1);\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn passwordencriptadosh;\r\n\t}", "private static String MD5Password(String password) {\n String md = org.apache.commons.codec.digest.DigestUtils.md5Hex(password);\n return md;\n }", "String encryptQueryString(String query) throws EncryptionException;", "public static String md5(String password){\n byte[] data = messageDigest.digest(password.getBytes());\n return byteToHex(data);\n }", "public static String md5PasswordCrypt(String password) throws AutoDeployException {\n try {\n byte[] hash = MessageDigest.getInstance(\"MD5\").digest(password.getBytes());\n StringBuffer hashString = new StringBuffer();\n for (int i = 0; i < hash.length; i++) {\n String hex = Integer.toHexString(hash[i]);\n if (hex.length() == 1) {\n hashString.append('0');\n hashString.append(hex.charAt(hex.length() - 1));\n } else {\n hashString.append(hex.substring(hex.length() - 2));\n }\n }\n return hashString.toString();\n } catch (Exception e) {\n log.error(\"Can't crypt the password due to an unexpected error : \" + e.getMessage());\n throw new AutoDeployException(\"Cant' crypt the password due to an unexpected error : \" + e.getMessage());\n }\n }", "private static byte[] m14295fl(String str) {\n try {\n MessageDigest instance = MessageDigest.getInstance(\"MD5\");\n if (instance == null) {\n return str.getBytes();\n }\n instance.update(str.getBytes());\n return instance.digest();\n } catch (NoSuchAlgorithmException e) {\n e.printStackTrace();\n return str.getBytes();\n }\n }", "String hash(String input) throws IllegalArgumentException, EncryptionException;", "public static String createMd5(String value)\r\n\t{ \r\n\t\ttry \r\n\t\t{\r\n\t\t\tMessageDigest md = MessageDigest.getInstance(\"MD5\");\t\t\t\r\n\t\t\tbyte[] hashInBytes = md.digest(value.getBytes(StandardCharsets.UTF_8));\r\n\t\t\tStringBuilder sb = new StringBuilder();\r\n\t for (byte b : hashInBytes) \r\n\t {\r\n\t sb.append(String.format(\"%02x\", b));\r\n\t }\r\n\t return sb.toString();\r\n\t\t}\r\n\t\tcatch(Exception ex)\r\n\t\t{\r\n\t\t\t\r\n\t\t}\r\n\t\treturn \"\";\r\n\t}", "public static String getMD5(String s) {\n try {\n MessageDigest m = MessageDigest.getInstance(\"MD5\");\n m.update(s.getBytes(), 0, s.length());\n return \"\" + new BigInteger(1, m.digest()).toString(16);\n } catch (NoSuchAlgorithmException e) {\n logger.error(\"MD5 is not supported !!!\");\n }\n return s;\n }", "public String md5(String md5StringInput) {\n try {\n java.security.MessageDigest md = java.security.MessageDigest.getInstance(\"MD5\");\n byte[] array = md.digest(md5StringInput.getBytes());\n StringBuffer sb = new StringBuffer();\n for (int i = 0; i < array.length; ++i) {\n sb.append(Integer.toHexString((array[i] & 0xFF) | 0x100).substring(1,3));\n }\n return sb.toString();\n } catch (java.security.NoSuchAlgorithmException e) {\n }\n return null;\n }", "public static String calcHash(String input) {\n try {\n MessageDigest md = MessageDigest.getInstance(\"MD5\");\n md.update(input.toLowerCase().getBytes(\"UTF8\"));\n byte[] digest = md.digest();\n StringBuilder sb = new StringBuilder();\n for (byte b : digest) {\n sb.append(hexDigit(b>>4));\n sb.append(hexDigit(b));\n }\n return sb.toString();\n } catch (Exception ex) {\n throw new RuntimeException(ex.getMessage(), ex);\n }\n }", "public static String encode(String string, String encodingName) {\r\n\t\tString encodedString = \"\";\r\n\t\tif (encodingName.equalsIgnoreCase(\"base64\")) {\r\n\t\t\tbyte[] byteArray = Base64.encodeBase64(string.getBytes());\r\n\t\t\tencodedString = new String(byteArray);\r\n\r\n\t\t} else if (encodingName.equalsIgnoreCase(\"PBEWithMD5AndDES\")) {\r\n\t\t\t// Key generation for enc and desc\r\n\t\t\tKeySpec keySpec = new PBEKeySpec(secretKey.toCharArray(), salt, iterationCount);\r\n\t\t\tSecretKey key = null;\r\n\t\t\tString charSet = \"UTF-8\";\r\n\t\t\tbyte[] in = null;\r\n\t\t\tbyte[] out = null;\r\n\t\t\ttry {\r\n\t\t\t\tkey = SecretKeyFactory.getInstance(\"PBEWithMD5AndDES\").generateSecret(keySpec);\r\n\t\t\t\tAlgorithmParameterSpec paramSpec = new PBEParameterSpec(salt, iterationCount);\r\n\t\t\t\tecipher = Cipher.getInstance(key.getAlgorithm());\r\n\t\t\t\tecipher.init(Cipher.ENCRYPT_MODE, key, paramSpec);\r\n\t\t\t\tin = string.getBytes(charSet);\r\n\t\t\t\tout = ecipher.doFinal(in);\r\n\t\t\t} catch (InvalidKeySpecException | NoSuchAlgorithmException | NoSuchPaddingException | InvalidKeyException\r\n\t\t\t\t\t| InvalidAlgorithmParameterException | UnsupportedEncodingException | IllegalBlockSizeException\r\n\t\t\t\t\t| BadPaddingException e) {\r\n\t\t\t\tlog.error(\"encode :\" + e.getMessage());\r\n\t\t\t}\r\n\t\t\tencodedString = new Base64().encodeAsString(out);\r\n\t\t\tif (encodedString.indexOf(\"/\", 0) > -1) {\r\n\t\t\t\tencodedString = encodedString.replace('/', '(');\r\n\t\t\t}\r\n\t\t} else if (encodingName.equalsIgnoreCase(\"DES/ECB/PKCS5Padding\")) {\r\n\t\t\ttry {\r\n\t\t\t\t// Get a cipher object.\r\n\t\t\t\tCipher cipher = Cipher.getInstance(\"DES/ECB/PKCS5Padding\");\r\n\t\t\t\tcipher.init(Cipher.ENCRYPT_MODE, generateKey());\r\n\r\n\t\t\t\t// Gets the raw bytes to encrypt, UTF8 is needed for\r\n\t\t\t\t// having a standard character set\r\n\t\t\t\tbyte[] stringBytes = string.getBytes(\"UTF8\");\r\n\r\n\t\t\t\t// encrypt using the cypher\r\n\t\t\t\tbyte[] raw = cipher.doFinal(stringBytes);\r\n\r\n\t\t\t\t// converts to base64 for easier display.\r\n\t\t\t\tBASE64Encoder encoder = new BASE64Encoder();\r\n\t\t\t\tencodedString = encoder.encode(raw);\r\n\t\t\t} catch (NoSuchAlgorithmException | NoSuchPaddingException | InvalidKeyException\r\n\t\t\t\t\t| UnsupportedEncodingException | IllegalBlockSizeException | BadPaddingException e) {\r\n\t\t\t\tlog.error(\"encode :\" + e.getMessage());\r\n\t\t\t}\r\n\r\n\t\t}\r\n\t\treturn encodedString;\r\n\t}", "private static String getKeyByMd5(String url) {\n String key;\n try {\n MessageDigest messageDigest = MessageDigest.getInstance(\"MD5\");\n messageDigest.update(url.getBytes());\n key = md5Encryption(messageDigest.digest());\n return key;\n } catch (NoSuchAlgorithmException e) {\n e.printStackTrace();\n key = String.valueOf(url.hashCode());\n }\n return key;\n }", "private static String md5(byte[] b) {\n try {\n MessageDigest md = MessageDigest.getInstance(\"MD5\");\n md.reset();\n md.update(b);\n byte[] digest = md.digest();\n StringBuffer sb = new StringBuffer();\n for (int i=0; i<digest.length; i++) {\n String a = Integer.toHexString(0xff & digest[i]);\n if (a.length() == 1) a = \"0\" + a;\n sb.append(a);\n }\n return sb.toString();\n }\n catch (NoSuchAlgorithmException e) { writeLog(e); }\n return null;\n }", "private String computeDigest(boolean paramBoolean, String paramString1, char[] paramArrayOfchar, String paramString2, String paramString3, String paramString4, String paramString5, String paramString6, String paramString7) throws NoSuchAlgorithmException {\n/* 470 */ String str1, str3, str5, str2 = this.params.getAlgorithm();\n/* 471 */ boolean bool = str2.equalsIgnoreCase(\"MD5-sess\");\n/* */ \n/* 473 */ MessageDigest messageDigest = MessageDigest.getInstance(bool ? \"MD5\" : str2);\n/* */ \n/* 475 */ if (bool) {\n/* 476 */ if ((str1 = this.params.getCachedHA1()) == null) {\n/* 477 */ str3 = paramString1 + \":\" + paramString2 + \":\";\n/* 478 */ String str7 = encode(str3, paramArrayOfchar, messageDigest);\n/* 479 */ String str6 = str7 + \":\" + paramString5 + \":\" + paramString6;\n/* 480 */ str1 = encode(str6, (char[])null, messageDigest);\n/* 481 */ this.params.setCachedHA1(str1);\n/* */ } \n/* */ } else {\n/* 484 */ String str = paramString1 + \":\" + paramString2 + \":\";\n/* 485 */ str1 = encode(str, paramArrayOfchar, messageDigest);\n/* */ } \n/* */ \n/* */ \n/* 489 */ if (paramBoolean) {\n/* 490 */ str3 = paramString3 + \":\" + paramString4;\n/* */ } else {\n/* 492 */ str3 = \":\" + paramString4;\n/* */ } \n/* 494 */ String str4 = encode(str3, (char[])null, messageDigest);\n/* */ \n/* */ \n/* 497 */ if (this.params.authQop()) {\n/* 498 */ str5 = str1 + \":\" + paramString5 + \":\" + paramString7 + \":\" + paramString6 + \":auth:\" + str4;\n/* */ }\n/* */ else {\n/* */ \n/* 502 */ str5 = str1 + \":\" + paramString5 + \":\" + str4;\n/* */ } \n/* */ \n/* */ \n/* 506 */ return encode(str5, (char[])null, messageDigest);\n/* */ }", "public String getHashString()\n\t{\n\t\treturn md5.getHashString();\n\t}", "public static String getMd5(String input) {\n try {\n MessageDigest md = MessageDigest.getInstance(\"MD5\");\n\n byte[] messageDigest = md.digest(input.getBytes());\n\n BigInteger no = new BigInteger(1, messageDigest);\n\n String hashtext = no.toString(16);\n while (hashtext.length() < 32) {\n hashtext = \"0\" + hashtext;\n }\n return hashtext;\n } catch (NoSuchAlgorithmException e) {\n throw new RuntimeException(e);\n }\n }", "public static String md5(String message) {\n String digest = null;\n try {\n MessageDigest md = MessageDigest.getInstance(\"MD5\");\n byte[] hash = md.digest(message.getBytes(\"UTF-8\"));\n\n //converting byte array to HexadecimalString\n StringBuilder sb = new StringBuilder(2 * hash.length);\n for (byte b : hash) {\n sb.append(String.format(\"%02x\", b & 0xff));\n }\n digest = sb.toString();\n } catch (UnsupportedEncodingException ex) {\n log.error(\"UnsupportedEncodingException\",ex);\n } catch (NoSuchAlgorithmException ex) {\n log.error(\"NoSuchAlgorithmException\",ex);\n }\n\n return digest;\n }", "public static String getEncodedPassword(String clearTextPassword) throws NoSuchAlgorithmException {\n\t\tMessageDigest md = MessageDigest.getInstance(\"MD5\");\n\t\tmd.update(clearTextPassword.getBytes());\n\t\t// byte[] theDigest = md.digest();\n\t\t// return new BASE64Encoder().encode(theDigest);\n\t\treturn clearTextPassword;\n\t}", "private String md5(String message) throws java.security.NoSuchAlgorithmException\n\t{\n\t\tMessageDigest md5 = null;\n\t\ttry {\n\t\t\tmd5 = MessageDigest.getInstance(\"MD5\");\n\t\t}\n\t\tcatch (java.security.NoSuchAlgorithmException ex) {\n\t\t\tex.printStackTrace();\n\t\t\tthrow ex;\n\t\t}\n\t\tbyte[] dig = md5.digest((byte[]) message.getBytes());\n\t\tStringBuffer code = new StringBuffer();\n\t\tfor (int i = 0; i < dig.length; ++i)\n\t\t{\n\t\t\tcode.append(Integer.toHexString(0x0100 + (dig[i] & 0x00FF)).substring(1));\n\t\t}\n\t\treturn code.toString();\n\t}", "String encrypt(String input) {\n\t\treturn BaseEncoding.base64().encode(input.getBytes());\n\t}", "public static String encode(String mdp)\n\t {\n\t byte[] uniqueKey = mdp.getBytes();\n\t byte[] hash = null;\n\n\t try\n\t {\n\t hash = MessageDigest.getInstance(\"MD5\").digest(uniqueKey);\n\t }\n\t catch (NoSuchAlgorithmException e)\n\t {\n\t throw new Error(\"No MD5 support in this VM.\");\n\t }\n\n\t StringBuilder hashString = new StringBuilder();\n\t for (int i = 0; i < hash.length; i++)\n\t {\n\t String hex = Integer.toHexString(hash[i]);\n\t if (hex.length() == 1)\n\t {\n\t hashString.append('0');\n\t hashString.append(hex.charAt(hex.length() - 1));\n\t }\n\t else\n\t hashString.append(hex.substring(hex.length() - 2));\n\t }\n\t return hashString.toString();\n\t }", "public static String encryptHmacMD5ToString(final String data, final String key) {\n if (data == null || data.length() == 0 || key == null || key.length() == 0) return \"\";\n return encryptHmacMD5ToString(data.getBytes(), key.getBytes());\n }", "public String getMD5() {\n return hash;\n }", "public static String toMD5(final String str) {\n\t\treturn MD5.toMD5(str);\n\n\t\t//linux下常有不同结果故弃之\n\t\t//return CryptTool.md5Digest(str);\n\t}", "public static String getHashString(String inputString) {\n MessageDigest md;\n byte[] hash;\n try {\n md = MessageDigest.getInstance(\"MD5\");\n } catch (java.security.NoSuchAlgorithmException e) {\n throw new RuntimeException(e);\n }\n try {\n hash = md.digest(inputString.getBytes(\"UTF-8\"));\n } catch (java.io.UnsupportedEncodingException e) {\n throw new RuntimeException(e);\n }\n StringBuilder sb = new StringBuilder();\n for(byte b : hash){\n sb.append(String.format(\"%02x\", b & 0xff));\n }\n return sb.toString();\n }", "public static String computeMD5Hash(String password) {\n StringBuffer MD5Hash = new StringBuffer();\n\n try {\n // Create MD5 Hash\n MessageDigest digest = MessageDigest.getInstance(\"MD5\");\n digest.update(password.getBytes());\n byte messageDigest[] = digest.digest();\n\n for (int i = 0; i < messageDigest.length; i++)\n {\n String h = Integer.toHexString(0xFF & messageDigest[i]);\n while (h.length() < 2)\n h = \"0\" + h;\n MD5Hash.append(h);\n }\n\n }\n catch (NoSuchAlgorithmException e)\n {\n e.printStackTrace();\n }\n\n return MD5Hash.toString();\n }", "public static String getMobileAdminPasswordMD5(){\n\t\treturn \"e3e6c68051fdfdf177c8933bfd76de48\";\n\t}", "static String md5test(String text,String returnType) {\n String result=null;\n if (returnType.equals(\"str\")){\n result = DigestUtils.md5Hex(text);\n System.out.println(result); // 5d41402abc4b2a76b9719d911017c592\n }else if(returnType.equals(\"byteArray\")){\n byte[] res = DigestUtils.md5(text);\n System.out.println(byteToHex(res));// 5d41402abc4b2a76b9719d911017c592\n }\n //new String((byte[]) res)\n return result;\n}", "public static String encode2StringWithMD5(String origin) {\n return encode2String(origin, MD5Utils.MD5);\n }", "public static String getmd5(String saltedPassword) {\n\t\tmd5MessageDigest.get().update(saltedPassword.getBytes());\n\t\treturn toHex(md5MessageDigest.get().digest());\n\t}", "String encryptString(String toEncrypt) throws NoUserSelectedException;", "public static String getMD5(String string) throws NoSuchAlgorithmException, IOException {\n MessageDigest md5;\n md5 = MessageDigest.getInstance(\"MD5\");\n\n try (DigestInputStream stream = new DigestInputStream(new ByteArrayInputStream(string.getBytes()), md5)) {\n byte[] buffer = new byte[8192];\n while (true) {\n if ((stream.read(buffer) == -1)) break;\n }\n StringBuilder sb = new StringBuilder();\n for (byte b : md5.digest()) {\n sb.append(Integer.toString((b & 0xff) + 0x100, 16).substring(1));\n }\n return sb.toString();\n }\n }", "public static String encryptHmacMD5ToString(final byte[] data, final byte[] key) {\n return bytes2HexString(encryptHmacMD5(data, key));\n }", "private static byte[] generateMD5(String info) throws\n UnsupportedEncodingException, NoSuchAlgorithmException {\n byte[] inputData = info.getBytes(\"UTF-8\");\n MessageDigest md = MessageDigest.getInstance(\"MD5\");\n md.update(inputData);\n byte[] digest= md.digest();\n return digest;\n }", "protected String getMd5Hash(String token) {\n\n MessageDigest m;\n\t\ttry {\n\t\t\tm = MessageDigest.getInstance(\"MD5\");\n\t\t} catch (NoSuchAlgorithmException e) {\n\t\t\tthrow new IllegalStateException(e);\n\t\t}\n m.update(token.getBytes());\n \n byte[] digest = m.digest();\n BigInteger bigInt = new BigInteger(1,digest);\n String hashtext = bigInt.toString(16);\n \n // Now we need to zero pad it if you actually want the full 32 chars.\n while(hashtext.length() < 32 ){\n hashtext = \"0\"+hashtext;\n }\n \n return hashtext;\n\t}", "public String encrypt(String geheimtext);", "public static String encrypt(String input) {\n\t\tBase64.Encoder encoder = Base64.getMimeEncoder();\n String message = input;\n String key = encoder.encodeToString(message.getBytes());\n return key;\n\t}", "public String encode( String password );", "private String hashKey(String key) throws NoSuchAlgorithmException {\n MessageDigest md = MessageDigest.getInstance(\"MD5\");\n byte[] hashInBytes = md.digest(key.getBytes(StandardCharsets.UTF_8));\n StringBuilder sb = new StringBuilder();\n for (int i = 0; i < hashInBytes.length; i++) {\n sb.append(Integer.toString((hashInBytes[i] & 0xff) + 0x100, 16).substring(1));\n }\n String s = sb.toString();\n return s;\n }", "private String m34493b(String str) {\n MessageDigest a = m34492a(\"MD5\");\n a.update(str.getBytes(\"UTF-8\"));\n return m34494b(a.digest());\n }", "public abstract String encryptMsg(String msg);", "public static String hashPass(String value) throws NoSuchAlgorithmException\n\t{\n\t\t//There are many algos are available for hashing i)MD5(message digest) ii)SHA(Secured hash algo)\n\t\tMessageDigest md=MessageDigest.getInstance(\"MD5\");\n\t md.update(value.getBytes());\n\t \n\t byte[] hashedpass=md.digest();\n\t StringBuilder hashpass=new StringBuilder();\n\t for(byte b:hashedpass)\n\t {\n\t \t//Convert to hexadecimal format\n\t hashpass.append(String.format(\"%02x\",b));\n\t }\n\t return hashpass.toString();\n\t}", "public static String hash(String data) {\n\t MessageDigest md;\n\t\ttry {\n\t\t\tmd = MessageDigest.getInstance(\"MD5\");\n\t\t md.update(data.getBytes());\n\t\t byte[] digest = md.digest();\n\t\t char[] HEX_ARRAY = \"0123456789ABCDEF\".toCharArray();\n\t char[] hexChars = new char[digest.length * 2];\n\t for (int j = 0; j < digest.length; j++) {\n\t int v = digest[j] & 0xFF;\n\t hexChars[j * 2] = HEX_ARRAY[v >>> 4];\n\t hexChars[j * 2 + 1] = HEX_ARRAY[v & 0x0F];\n\t }\n\t return new String(hexChars);\n\t\t} catch (NoSuchAlgorithmException e) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\te.printStackTrace();\n\t\t}\n\n return null;\n\t}", "String getHashAlgorithm();", "byte[] encrypt(String plaintext);", "public String hashing(String password) {\n\n\t\tString hashedPassword = null;\n\n\t\tMessageDigest md;\n\t\ttry {\n\t\t\tmd = MessageDigest.getInstance(\"MD5\");\n\t\t\tmd.update(password.getBytes());\n\t\t\tbyte[] digest = md.digest();\n\t\t\tStringBuffer sb = new StringBuffer();\n\t\t\tfor (byte b : digest) {\n\t\t\t\tsb.append(String.format(\"%02x\", b & 0xff));\n\t\t\t}\n\t\t\thashedPassword = sb.toString();\n\t\t} catch (NoSuchAlgorithmException e) {\n\t\t\te.printStackTrace();\n\t\t}\n\n\t\treturn hashedPassword;\n\t}", "Map<String, String> decryptQueryString(String encrypted) throws EncryptionException;", "String getMessageDigestAlgorithm();", "public Object invoke() {\n \t\tString plaintxt = plaintext;\n \t\treturn md5 != null ? md5.digest( plaintxt != null ? plaintxt.getBytes() : null ) : null;\n }", "public static final String encrypt(String password) {\r\n\t\t \r\n\t\tMessageDigest md = null;\r\n\t\t \r\n\t\ttry { \r\n\t\t\tmd = MessageDigest.getInstance(\"SHA\"); //step 2 \r\n\t\t} catch(NoSuchAlgorithmException e) {\r\n\t\t\tthrow new IllegalStateException(\"User : encrypting the password does not have the algorithm in the env.\", e); \r\n\t\t}\r\n\t\t \r\n\t\ttry { \r\n\t\t\tmd.update(password.getBytes(\"UTF-8\")); //step 3 \r\n\t\t} catch(UnsupportedEncodingException e) { \r\n\t\t\tthrow new IllegalStateException(\"User : encrypting the password with unsupport encoding in the env.\", e); \r\n\t\t}\r\n\r\n byte raw[] = md.digest(); //step 4\r\n String hash = Base64.encodeBytes(raw); //step 5\r\n return hash; //step 6\r\n\t}", "public static String getHashed_pw(String password) {\r\n\t\tbyte[] plainText = password.getBytes();\r\n MessageDigest md = null;\r\n try {\r\n md = MessageDigest.getInstance(\"MD5\");\r\n } \r\n catch (Exception e) {\r\n System.err.println(e.toString());\r\n }\r\n \tmd.reset();\r\n\t\tmd.update(plainText);\r\n\t\tbyte[] encodedPassword = md.digest();\r\n\r\n\t\tStringBuilder sb = new StringBuilder();\r\n\t\tfor (int i = 0; i < encodedPassword.length; i++) {\r\n\t\t\tif ((encodedPassword[i] & 0xff) < 0x10) {\r\n\t\t\t\tsb.append(\"0\");\r\n\t\t\t}\r\n\t\t\tsb.append(Long.toString(encodedPassword[i] & 0xff, 16));\r\n\t\t}\r\n\t\treturn sb.toString();\r\n\t}", "public static String encryptMD5ToString(final String data, final String salt) {\n if (data == null && salt == null) return \"\";\n if (salt == null) return bytes2HexString(encryptMD5(data.getBytes()));\n if (data == null) return bytes2HexString(encryptMD5(salt.getBytes()));\n return bytes2HexString(encryptMD5((data + salt).getBytes()));\n }", "public String getMd5Hash() {\n return md5Hash;\n }", "public String getHash(String str) throws Exception{\n\t\t\n\t\tMessageDigest md = MessageDigest.getInstance(\"MD5\");\n md.update(str.getBytes());\n \n byte byteData[] = md.digest();\n \n //convert the byte to hex format method 1\n StringBuffer sb = new StringBuffer();\n for (int i = 0; i < byteData.length; i++) {\n sb.append(Integer.toString((byteData[i] & 0xff) + 0x100, 16).substring(1));\n }\n \n String hex = sb.toString();\n System.out.println(hex);\n return hex; \n}", "String getSaltedHash();", "public static String hash_password(String password) throws Exception\r\n\t{\r\n\t\t// Digest the password with MD5 algorithm\r\n\t\tMessageDigest md = MessageDigest.getInstance(\"MD5\");\r\n\t\tmd.update(password.getBytes());\r\n\t\t \r\n\t\tbyte byte_data[] = md.digest();\r\n\t\t \r\n\t\t//convert the bytes to hex format \r\n\t\tStringBuffer sb = new StringBuffer();\r\n\t\t \r\n\t\tfor (int i = 0; i < byte_data.length; i++) \r\n\t\t{\r\n\t\t\tsb.append(Integer.toString((byte_data[i] & 0xff) + 0x100, 16).substring(1));\r\n\t\t}\r\n\t\t \r\n\t\t//System.out.println(\"Hashed password: \" + sb.toString());\r\n\t\treturn sb.toString();\r\n\t}", "public String MD5(String md5) {\n try {\n java.security.MessageDigest md = java.security.MessageDigest.getInstance(\"MD5\");\n byte[] array = md.digest(md5.getBytes());\n StringBuffer sb = new StringBuffer();\n for (int i = 0; i < array.length; ++i) {\n sb.append(Integer.toHexString((array[i] & 0xFF) | 0x100).substring(1,3));\n }\n return sb.toString();\n } catch (java.security.NoSuchAlgorithmException e) {\n }\n return null;\n }", "public static String encrypt(String string)\n\t{\n\t\tif(string == null) {\n\t\t\treturn null;\n\t\t} else {\n\t\t\treturn DigestUtils.sha256Hex(string + salt);\n\t\t}\n\t}", "public String Decrypt(String s);", "String getDigestAlgorithm();", "public String getMD5(String txt){\n String md5output;\n md5output = txt;\n try {\n MessageDigest m = MessageDigest.getInstance(\"MD5\");\n m.reset();\n m.update(md5output.getBytes());\n byte[] digest = m.digest();\n BigInteger bigInt = new BigInteger(1,digest);\n md5output = bigInt.toString(16);\n } catch (Exception e) {\n md5output = null;\n } finally{\n return md5output;\n }\n \n }", "String decrypt(String input) {\n\t\treturn new String(BaseEncoding.base64().decode(input));\n\t}", "private String encriptarClave(String clave, UMD5 mo) {\r\n\t\ttry{\r\n\t\t\t//UMD5 md = UMD5.getInstance();\r\n\t\t\t\r\n\t\t\tlog.info(\"clave:\"+clave);\r\n\t\t\tclave=mo.hashData(clave.getBytes()).toLowerCase();\r\n\t\t\tlog.info(\"clave:\"+clave);\r\n\t\t\t}catch(Exception e){\r\n\t\t\t\te.printStackTrace();\r\n\t\t\t}\r\n\t\t/*fin\r\n\t\t * */\r\n\t\treturn clave;\r\n\t}", "public static byte[] computeMD5Hash(byte[] data) throws NoSuchAlgorithmException, IOException {\n return computeMD5Hash(new ByteArrayInputStream(data));\n }" ]
[ "0.7021336", "0.6877267", "0.66857", "0.66574025", "0.65487653", "0.65465635", "0.65256363", "0.6507957", "0.6504943", "0.64985204", "0.6477323", "0.6476254", "0.64545494", "0.64154065", "0.63714945", "0.63667816", "0.6360527", "0.6347052", "0.63217926", "0.63119936", "0.62965035", "0.6263438", "0.62387395", "0.62266594", "0.62239945", "0.62173235", "0.6216505", "0.61931604", "0.6190455", "0.61895293", "0.6187124", "0.6173691", "0.61598366", "0.6151469", "0.6139614", "0.61129", "0.61113757", "0.6111036", "0.6097983", "0.6090504", "0.6087765", "0.6082096", "0.6081567", "0.6077564", "0.6037191", "0.6037188", "0.60286313", "0.6028361", "0.6027869", "0.6021808", "0.60136247", "0.5987542", "0.5986182", "0.59773433", "0.5975273", "0.59220034", "0.5896055", "0.58723617", "0.5867303", "0.58654106", "0.5862848", "0.5845031", "0.583843", "0.582996", "0.5819852", "0.5819228", "0.5810584", "0.5755654", "0.5754578", "0.5749963", "0.5749492", "0.5748257", "0.5746313", "0.573314", "0.57006717", "0.5699622", "0.56760925", "0.56582004", "0.5646638", "0.5646156", "0.5635521", "0.56339866", "0.5616455", "0.560847", "0.55963653", "0.5590926", "0.5582996", "0.5530796", "0.5525632", "0.5515856", "0.55061656", "0.55021983", "0.5497735", "0.54646987", "0.5454481", "0.54455054", "0.5429555", "0.54182595", "0.54168785", "0.5415231" ]
0.6177471
31
Compression METHODS method to zip any file
public boolean ZipFile(String sSourceFilePath, String sDestinationZipFilePath, boolean bReplaceExisting) { byte[] buffer = new byte[30720]; FileInputStream fin = null; FileOutputStream fout = null; ZipOutputStream zout = null; int length; String sZipEntryFileName = ""; File objFile = null; try { //check for source file if (sSourceFilePath.trim().equalsIgnoreCase("")) { throw new Exception("Invalid Source File : " + sSourceFilePath); } objFile = new File(sSourceFilePath); if (!objFile.exists()) { throw new Exception("Source file not found : " + sSourceFilePath); } //check for destination Zip file if (sDestinationZipFilePath.trim().equalsIgnoreCase("") || sDestinationZipFilePath == null) { String stmp_Path = objFile.getAbsolutePath(); String stmp_Name = objFile.getName(); if (stmp_Name.contains(".")) { //check for removing extension int indx = 0; try { indx = stmp_Name.indexOf(".", stmp_Name.length() - 5); } catch (Exception e) { indx = 0; } if (indx <= 0) { indx = stmp_Name.length(); } stmp_Name = stmp_Name.substring(0, indx); stmp_Name = stmp_Name + ".zip"; } sDestinationZipFilePath = stmp_Path + File.separator + stmp_Name; } objFile = new File(sDestinationZipFilePath); if (objFile.exists()) { if (bReplaceExisting) { objFile.delete(); } else { throw new Exception("Destination ZipFile Already exists : " + sDestinationZipFilePath); } } //Zipping File sZipEntryFileName = sSourceFilePath.substring(sSourceFilePath.lastIndexOf("\\") + 1); fout = new FileOutputStream(sDestinationZipFilePath); zout = new ZipOutputStream(fout); fin = new FileInputStream(sSourceFilePath); zout.putNextEntry(new ZipEntry(sZipEntryFileName)); while ((length = fin.read(buffer)) > 0) { zout.write(buffer, 0, length); } return true; } catch (Exception exp) { println("Src = " + sSourceFilePath + " : Dest = " + sDestinationZipFilePath + " : " + exp.toString()); return false; } finally { try { fin.close(); } catch (Exception exp) { } try { zout.closeEntry(); } catch (Exception exp) { } try { zout.close(); } catch (Exception exp) { } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "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 ZipCompressor(){}", "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 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 }", "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}", "@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 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 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}", "void compress( File input, File output, int level, int language )\r\n throws CompressionException;", "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 interface IZipStrategy {\n\n void zip();\n}", "public interface CompressionService {\n public static final String ARCHIVE_EXTENSION = \"zip\";\n /**\n * Compresses given directory into zip file\n *\n * @param directory the content to compress\n * @param size default archive size\n *\n * @return zipped archive/s\n */\n List<File> compress(File directory, int size);\n}", "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 }", "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}", "public static boolean generateZipFile(ArrayList<String> sourcesFilenames, String destinationDir, String zipFilename){\n byte[] buf = new byte[1024]; \r\n\r\n try \r\n {\r\n // VER SI HAY QUE CREAR EL ROOT PATH\r\n boolean result = (new File(destinationDir)).mkdirs();\r\n\r\n String zipFullFilename = destinationDir + \"/\" + zipFilename;\r\n\r\n System.out.println(result);\r\n\r\n // Create the ZIP file \r\n ZipOutputStream out = new ZipOutputStream(new FileOutputStream(zipFullFilename)); \r\n \r\n // Compress the files \r\n for (String filename: sourcesFilenames) { \r\n FileInputStream in = new FileInputStream(filename); \r\n // Add ZIP entry to output stream. \r\n File file = new File(filename); //\"Users/you/image.jpg\"\r\n out.putNextEntry(new ZipEntry(file.getName())); //\"image.jpg\" \r\n // Transfer bytes from the file to the ZIP file \r\n int len; \r\n while ((len = in.read(buf)) > 0) { \r\n out.write(buf, 0, len); \r\n } \r\n // Complete the entry \r\n out.closeEntry(); \r\n in.close(); \r\n } // Complete the ZIP file \r\n out.close();\r\n\r\n return true;\r\n } \r\n catch (Exception e) \r\n { \r\n System.out.println(e);\r\n return false;\r\n } \r\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 }", "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 File getZip() {\r\n try {\r\n close(); // if the file is currently open close it\r\n Log.d(LOG_TAG, \"getZip()\");\r\n File zipFile = new File(mBaseFileName + \".zip\");\r\n zipFile.delete();\r\n ZipOutputStream zipStream = new ZipOutputStream(new FileOutputStream(zipFile));\r\n for (int i = 0; i < mNumSegments; i++) {\r\n File chunk = new File(getFileNameForIndex(i));\r\n if (chunk.exists()) {\r\n FileInputStream fis = new FileInputStream(chunk);\r\n writeToZipFile(zipStream, fis, chunk.getName());\r\n }\r\n }\r\n zipStream.close();\r\n return zipFile;\r\n } catch (Exception e) {\r\n Log.e(LOG_TAG, \"Failed to create zip file\", e);\r\n }\r\n\r\n return null;\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 createZipEntry(ZipOutputStream out, String fileName, byte[] content) throws IOException\n\t{\n\t\tZipEntry entry = new ZipEntry(fileName);\n\t\tentry.setMethod(ZipEntry.DEFLATED);\n\t\tout.putNextEntry(entry);\n\t\tout.write(content);\n\t}", "public static void main(String[] args) throws IOException {\n\t\tFile targetFile = new File(\"D:\\\\program\\\\360cse\\\\360Chrome\\\\test.zip\");\n\t\tFile sourceFiles = new File(\"D:\\\\temple\\\\sysMenu-add.html\");\n\t\tboolean flag = compressZip(false, targetFile, sourceFiles);\n\t\tSystem.out.println(flag);\n\t}", "List<File> compress(File directory, int size);", "@Test\n public void testDERIVATIVE_COMPRESS_CRC() throws IOException {\n// ZipMeVariables.getSINGLETON().setCRC___(true);\n// ZipMeVariables.getSINGLETON().setCOMPRESS___(true);\n// ZipMeVariables.getSINGLETON().setDERIVATIVE_COMPRESS_CRC___(true);\n\t Configuration.CRC=true;\n\t Configuration.COMPRESS=true;\n\t Configuration.DERIVATIVE_COMPRESS_CRC=true;\n if(Configuration.CRC && Configuration.COMPRESS && Configuration.DERIVATIVE_COMPRESS_CRC) { \n ZipOutputStream zout = new ZipOutputStream(new FileOutputStream(new File(\n homeDir + \"/files/src.zip\")));\n zout.crc.update(1);\n ZipEntry ze = new ZipEntry(\"C://\");\n zout.putNextEntry(ze);\n zout.hook41();\n assertTrue(zout.crc.crc == 0);\n\n zout.write(new byte[32], 0, 31);\n assertTrue(zout.size == 31);\n zout.closeEntry();\n assertTrue(ze.getCrc() == zout.crc.crc);\n }\n }", "public void tozip() {\r\n\t\t//session.setAttribute(Constant.USER_SESSION_KEY, null);\r\n\t\tList<Netlog> result = null;\r\n\t\tInteger total = null;\r\n\t\ttry {\r\n\t\t\t\r\n\t\t\t\tresult = (List<Netlog>)netlogDao.findNetlogByPage(1,10000);\r\n\t\t\t\ttotal= result.size();\r\n\t\t\t\t//total= netlogDao.findNetlogCount();\r\n\t\t\t\r\n\t\t} catch (SQLException e1) {\r\n\t\t\t// TODO Auto-generated catch block\r\n\t\t\te1.printStackTrace();\r\n\t\t}\r\n\t\tNetlogs netlogs = new Netlogs(result);\r\n\t\tString path = this.getClass().getClassLoader().getResource(\"\").getPath();\r\n\t\tSystem.out.println(path);\r\n\t\tpath = path.replace(\"WEB-INF/classes/\", \"\");\r\n\t\tString path1 = path + \"netlog/\";\r\n\t\tLong time = System.currentTimeMillis()/1000;\r\n\t\tXml2Java.beanToXML(netlogs,path1+\"145-330000-\"+time.toString()+\"-00001-WA-SOURCE_NETLOG_0001-0.xml\");\r\n\r\n\t\tZipUtil.ZipMultiFile(path1, path+\"145-353030334-330300-330300-netlog-00001.zip\");\r\n\t}", "@Override\n public byte[] compress(byte[] bytes) throws IOException\n {\n try (BinaryIO io = new BinaryIO())\n {\n io.write32Bits(LZW_TAG);\n\n LZWDictionary dict = new LZWDictionary();\n int bitsize = 9, index = -1, newIndex;\n\n for (byte b : bytes)\n {\n newIndex = dict.get(index, b);\n\n if (newIndex > 0)\n index = newIndex;\n else\n {\n io.writeBits(index, bitsize);\n bitsize = dict.put(index, b);\n index = dict.get(-1, b);\n }\n if (dict.isFull())\n dict.reset();\n }\n io\n .writeBits(index, bitsize)\n .write32Bits(0); // EoF marker\n\n return io.getBytesOut();\n }\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 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}", "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 }", "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 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 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 }", "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 }", "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 void convertToZip(String input, String output) throws ZipException {\n\t\tZipFile zip = new ZipFile(output); \n\t ZipParameters parameters = new ZipParameters();\n parameters.setCompressionMethod(Zip4jConstants.COMP_DEFLATE);\n parameters.setCompressionLevel(Zip4jConstants.DEFLATE_LEVEL_NORMAL); \n\t zip.addFolder(input, parameters);\n\t}", "List<CompressResult> compress(Path input, Path output, int maxSizeInMB) throws IOException;", "public static void zip(File src, OutputStream os) throws IOException {\n\t\tzip(src, os, Charset.defaultCharset().name(), true);\n\t}", "public static void zip(File src, boolean includeSrc) throws IOException {\n\t\tzip(src, Charset.defaultCharset().name(), includeSrc);\n\t}", "public static void zip(File src, File destDir, String charSetName, boolean includeSrc) throws IOException {\n\t\tString fileName = src.getName();\n\t\tif (!src.isDirectory()) {\n\t\t\tint pos = fileName.lastIndexOf(\".\");\n\t\t\tif (pos > 0) {\n\t\t\t\tfileName = fileName.substring(0, pos);\n\t\t\t}\n\t\t}\n\t\t\n\t\tfileName += \".zip\";\n\t\tensureDirectory(destDir);\n\t\t\n\t\tFile zippedFile = new File(destDir, fileName);\n\t\tif (!zippedFile.exists())\n\t\t\tzippedFile.createNewFile();\n\t\t\n\t\tzip(src, new FileOutputStream(zippedFile), charSetName, includeSrc);\n\t}", "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 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 }", "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 }", "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 }", "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}", "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 }", "List<CompressResult> decompress(Path input, Path output) throws IOException;", "private void writeArchive(Content content) throws Exception {\n\t\tString path = open();\n\t\tTranslateContent translate = new TranslateContent(content, path);\n\t\ttranslate.writeArchive();\n\n\t\t// compress archive file if +C used\n\t\tif (content.isCompressed()) {\n\t\t\tcompressArchive();\n\t\t}\n\t}", "public static boolean compress(File folder, File output){\n // Create zip output stream\n try {\n ZipOutputStream zos = new ZipOutputStream(new FileOutputStream(output));\n zipFolder(zos, folder);\n return true;\n } catch (FileNotFoundException e) {\n e.printStackTrace();\n } catch (IOException e) {\n e.printStackTrace();\n }\n\n return false;\n }", "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 }", "@Test\n @Ignore(\"Zip file compare have some problem\")\n public void testOutputCompressDelimitedMode() throws Throwable {\n testCompressFile(false);\n }", "public ZipFileWriter(String zipFile) throws FileNotFoundException {\r\n\t\tFileOutputStream fos = new FileOutputStream(zipFile);\r\n\t\t// ajout du checksum\r\n\t\tCheckedOutputStream checksum = new CheckedOutputStream(fos,\r\n\t\t\t\tnew Adler32());\r\n\t\tthis.zos = new ZipOutputStream(new BufferedOutputStream(checksum));\r\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 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 }", "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}", "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 }", "@Override\n\tpublic void Compress() {\n\t\t\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 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 static void writeZipOneFile(File directoryToZip, String fileName) {\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.replace(\".xls\", \"\")+\".zip\");\r\n\t\t\tZipOutputStream zos = new ZipOutputStream(fos);\r\n\r\n\t\t\tFile file = new File(directoryToZip + \"\\\\\"+ fileName);\r\n\t\t\taddToZip(directoryToZip, file, zos);\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 int serialize (IDataOutput stream ,boolean includeAdler32 ,boolean centralDir =false ,int centralDirOffset =0){\r\n\t\t\tif(stream == null) { return 0; }\r\n\t\t\tif(centralDir) {\r\n\t\t\t\t// Write central directory file header signature\r\n\t\t\t\tstream.writeUnsignedInt(FZip.SIG_CENTRAL_FILE_HEADER);\r\n\t\t\t\t// Write \"version made by\" host (usually 0) and number (always 2.0)\r\n\t\t\t\tstream.writeShort((_versionHost << 8) | 0x14);\r\n\t\t\t} else {\r\n\t\t\t\t// Write local file header signature\r\n\t\t\t\tstream.writeUnsignedInt(FZip.SIG_LOCAL_FILE_HEADER);\r\n\t\t\t}\r\n\t\t\t// Write \"version needed to extract\" host (usually 0) and number (always 2.0)\r\n\t\t\tstream.writeShort((_versionHost << 8) | 0x14);\r\n\t\t\t// Write the general purpose flag\r\n\t\t\t// - no encryption\r\n\t\t\t// - normal deflate\r\n\t\t\t// - no data descriptors\r\n\t\t\t// - no compressed patched data\r\n\t\t\t// - unicode as specified in _filenameEncoding\r\n\t\t\tstream.writeShort((_filenameEncoding == \"utf-8\") ? 0x0800 : 0);\r\n\t\t\t// Write compression method (always deflate)\r\n\t\t\tstream.writeShort(isCompressed ? COMPRESSION_DEFLATED : COMPRESSION_NONE);\r\n\t\t\t// Write date\r\n\t\t\tDate d =(_date != null) ? _date : new Date();\r\n\t\t\tint msdosTime =uint(d.getSeconds ())| (uint(d.getMinutes()) << 5) | (uint(d.getHours()) << 11);\r\n\t\t\tint msdosDate =uint(d.getDate ())| (uint(d.getMonth() + 1) << 5) | (uint(d.getFullYear() - 1980) << 9);\r\n\t\t\tstream.writeShort(msdosTime);\r\n\t\t\tstream.writeShort(msdosDate);\r\n\t\t\t// Write CRC32\r\n\t\t\tstream.writeUnsignedInt(_crc32);\r\n\t\t\t// Write compressed size\r\n\t\t\tstream.writeUnsignedInt(_sizeCompressed);\r\n\t\t\t// Write uncompressed size\r\n\t\t\tstream.writeUnsignedInt(_sizeUncompressed);\r\n\t\t\t// Prep filename\r\n\t\t\tByteArray ba =new ByteArray ();\r\n\t\t\tba.endian = Endian.LITTLE_ENDIAN;\r\n\t\t\tif (_filenameEncoding == \"utf-8\") {\r\n\t\t\t\tba.writeUTFBytes(_filename);\r\n\t\t\t} else {\r\n\t\t\t\tba.writeMultiByte(_filename, _filenameEncoding);\r\n\t\t\t}\r\n\t\t\tint filenameSize =ba.position ;\r\n\t\t\t// Prep extra fields\r\n\t\t\tfor(int i0 = 0; i0 < _extraFields .size(); i0++)\r\n\t\t\t{\r\n\t\t\t\t\theaderId = _extraFields .get(i0);\r\n\t\t\t\tif(extraBytes != null) {\r\n\t\t\t\t\tba.writeShort(uint(headerId));\r\n\t\t\t\t\tba.writeShort(uint(extraBytes.length()));\r\n\t\t\t\t\tba.writeBytes(extraBytes);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tif (includeAdler32) {\r\n\t\t\t\tif (!_hasAdler32) {\r\n\t\t\t\t\tboolean compressed =isCompressed ;\r\n\t\t\t\t\tif (compressed) { uncompress(); }\r\n\t\t\t\t\t_adler32 = ChecksumUtil.Adler32(_content, 0, _content.length());\r\n\t\t\t\t\t_hasAdler32 = true;\r\n\t\t\t\t\tif (compressed) { compress(); }\r\n\t\t\t\t}\r\n\t\t\t\tba.writeShort(0xdada);\r\n\t\t\t\tba.writeShort(4);\r\n\t\t\t\tba.writeUnsignedInt(_adler32);\r\n\t\t\t}\r\n\t\t\tint extrafieldsSize =ba.position -filenameSize ;\r\n\t\t\t// Prep comment (currently unused)\r\n\t\t\tif(centralDir && _comment.length > 0) {\r\n\t\t\t\tif (_filenameEncoding == \"utf-8\") {\r\n\t\t\t\t\tba.writeUTFBytes(_comment);\r\n\t\t\t\t} else {\r\n\t\t\t\t\tba.writeMultiByte(_comment, _filenameEncoding);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tint commentSize =ba.position -filenameSize -extrafieldsSize ;\r\n\t\t\t// Write filename and extra field sizes\r\n\t\t\tstream.writeShort(filenameSize);\r\n\t\t\tstream.writeShort(extrafieldsSize);\r\n\t\t\tif(centralDir) {\r\n\t\t\t\t// Write comment size\r\n\t\t\t\tstream.writeShort(commentSize);\r\n\t\t\t\t// Write disk number start (always 0)\r\n\t\t\t\tstream.writeShort(0);\r\n\t\t\t\t// Write file attributes (always 0)\r\n\t\t\t\tstream.writeShort(0);\r\n\t\t\t\tstream.writeUnsignedInt(0);\r\n\t\t\t\t// Write relative offset of local header\r\n\t\t\t\tstream.writeUnsignedInt(centralDirOffset);\r\n\t\t\t}\r\n\t\t\t// Write filename, extra field and comment\r\n\t\t\tif(filenameSize + extrafieldsSize + commentSize > 0) {\r\n\t\t\t\tstream.writeBytes(ba);\r\n\t\t\t}\r\n\t\t\t// Write file\r\n\t\t\tint fileSize =0;\r\n\t\t\tif(!centralDir && _content.length > 0) {\r\n\t\t\t\tif(isCompressed) {\r\n\t\t\t\t\tif(HAS_UNCOMPRESS || HAS_INFLATE) {\r\n\t\t\t\t\t\tfileSize = _content.length;\r\n\t\t\t\t\t\tstream.writeBytes(_content, 0, fileSize);\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\tfileSize = _content.length - 6;\r\n\t\t\t\t\t\tstream.writeBytes(_content, 2, fileSize);\r\n\t\t\t\t\t}\r\n\t\t\t\t} else {\r\n\t\t\t\t\tfileSize = _content.length;\r\n\t\t\t\t\tstream.writeBytes(_content, 0, fileSize);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tint size =30+filenameSize +extrafieldsSize +commentSize +fileSize ;\r\n\t\t\tif(centralDir) {\r\n\t\t\t\tsize += 16;\r\n\t\t\t}\r\n\t\t\treturn size;\r\n\t\t}", "public void compress() {\r\n fCharBuffer.compress();\r\n fStyleBuffer.compress();\r\n fParagraphBuffer.compress();\r\n }", "public static void compressDir(String path) throws Exception {\n\t\tFile compressDir = new File(path);\n\t\t// The output compressed file\n\t\tFile outputZip = new File(compressDir.getPath() + \".zip\");\n\n\t\t// Compressed file(.zip) output file stream\n\t\tFileOutputStream zipFileOutputStream = new FileOutputStream(outputZip);\n\n\t\t// ZipOutputStream used for compressing\n\t\tZipOutputStream zipOutputStream = new ZipOutputStream(\n\t\t\t\tzipFileOutputStream);\n\n\t\t// Do compress recursively\n\t\trecursionZip(compressDir, zipOutputStream, compressDir.getParent()\n\t\t\t\t+ \"/\");\n\n\t\t// Close ZipOutputStream\n\t\tzipOutputStream.close();\n\t\t// Close FileOutputStream\n\t\tzipFileOutputStream.close();\n\t}", "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 static void zip(File src, String charSetName, boolean includeSrc) throws IOException {\n\t\tzip(src, src.getParentFile(), charSetName, includeSrc);\n\t}", "public static ByteArrayOutputStream archiveFile(ArrayList<Integer> bytes, HashMap<Integer, String> dictionary) throws IOException {\n ByteArrayOutputStream result = new ByteArrayOutputStream();\n StringBuilder buffer = new StringBuilder();\n //writing all info and dictionary into the file\n result.write(ByteBuffer.allocate(BYTES_FOR_TABLE_SIZE).putInt(dictionary.size()).array());\n result.write(ByteBuffer.allocate(BYTES_FOR_FILE_SIZE).putInt(bytes.size()).array());\n result.write(convertMapToArray(dictionary));\n\n //writing each byte into the file\n for (int i = 0; i < bytes.size(); i++) {\n if (dictionary.containsKey(bytes.get(i))){\n buffer.append(dictionary.get(bytes.get(i)));\n }\n while (buffer.length() >= BYTE_SIZE){\n result.write(Integer.parseUnsignedInt(buffer.substring(0, BYTE_SIZE), 2));\n if (buffer.length() == BYTE_SIZE){\n buffer = new StringBuilder();\n }else {\n buffer = new StringBuilder(buffer.substring(BYTE_SIZE));\n }\n }\n }\n if (buffer.length() != 0){ //adding zeroes if needed\n StringBuilder remainedZeros = new StringBuilder();\n for (int i = 0; i < BYTE_SIZE - buffer.length(); i++) {\n remainedZeros.append(\"0\");\n }\n result.write(Integer.parseUnsignedInt(String.valueOf(buffer.append(remainedZeros))));\n }\n return result;\n }", "public static void zipFiles(String output, File... files) {\n try (ZipOutputStream zipOut = new ZipOutputStream(new FileOutputStream(output))) {\n for (File fileToZip : files) {\n zipOut.putNextEntry(new ZipEntry(fileToZip.getName()));\n Files.copy(fileToZip.toPath(), zipOut);\n }\n } catch (FileNotFoundException e) {\n LOGGER.error(\"Unable to find file for archive operation!\", e);\n } catch (IOException e) {\n LOGGER.error(\"IO exception for archive operation!\", e);\n }\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 }", "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}", "private ZipEntry processEntry( ZipFile zip, ZipEntry inputEntry ) throws IOException{\n /*\n First, some notes.\n On MRJ 2.2.2, getting the size, compressed size, and CRC32 from the\n ZipInputStream does not work for compressed (deflated) files. Those calls return -1.\n For uncompressed (stored) files, those calls do work.\n However, using ZipFile.getEntries() works for both compressed and \n uncompressed files.\n \n Now, from some simple testing I did, it seems that the value of CRC-32 is\n independent of the compression setting. So, it should be easy to pass this \n information on to the output entry.\n */\n String name = inputEntry .getName();\n if ( ! (inputEntry .isDirectory() || name .endsWith( \".class\" )) ) {\n try {\n InputStream input = zip.getInputStream( zip .getEntry( name ) );\n String className = ClassNameReader .getClassName( input );\n input .close();\n if ( className != null ) {\n name = className .replace( '.', '/' ) + \".class\";\n }\n } catch( IOException ioe ) {}\n }\n ZipEntry outputEntry = new ZipEntry( name );\n outputEntry.setTime(inputEntry .getTime() );\n outputEntry.setExtra(inputEntry.getExtra());\n outputEntry.setComment(inputEntry.getComment());\n outputEntry.setTime(inputEntry.getTime());\n if (compression){\n outputEntry.setMethod(ZipEntry.DEFLATED);\n //Note, don't need to specify size or crc for compressed files.\n } else {\n outputEntry.setMethod(ZipEntry.STORED);\n outputEntry.setCrc(inputEntry.getCrc());\n outputEntry.setSize(inputEntry.getSize());\n }\n return outputEntry;\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 }", "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}", "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 String compactaOrdem(File ordem, String[] arquivosCaixa) throws IOException\n\t{\n\t\t/* Define referencias aos streams de arquivos a serem utilizados */\n\t\t/* Buffer a ser utilizado para leitura dos arquivos de caixa */\n\t\tBufferedInputStream buffOrigem \t= null;\n\t\t/* Esta referencia e do arquivo final (zip) do processo */\n\t\tFileOutputStream \tarqDestino \t= new FileOutputStream(getNomeArquivoCompactado(ordem));\n\t\tZipOutputStream \tarqSaida \t= new ZipOutputStream (new BufferedOutputStream(arqDestino));\n\n\t\t/* Define o buffer de dados com o tamanho sendo definido no\n\t\t * arquivo de configuracao\n\t\t */\n\t\tint sizeBuffer = Integer.parseInt(getPropriedade(\"ordemVoucher.tamanhoBufferArquivos\"));\n\t\tbyte data[] = new byte[sizeBuffer];\n\n\t\tString extArqCriptografado = getPropriedade(\"ordemVoucher.extensaoArquivoCriptografado\");\n\t\t\n\t\t/* Faz a varredura dos arquivos de caixa que serao utilizados\n\t\t * para a compactacao. Lembrando que o nome e o mesmo do arquivo da\n\t\t * ordem com a extensao pgp devido ao utilitario de criptografia\n\t\t */\n\t\tSystem.out.println(\"Iniciando compactacao para o arquivo:\"+getNomeArquivoCompactado(ordem));\n\t\tfor (int i=0; i<arquivosCaixa.length; i++) \n\t\t{\n\t\t\tString nomArqOrigem\t\t\t= arquivosCaixa[i] + extArqCriptografado;\n\t\t\tSystem.out.println(\"Incluindo arquivo de ordem \"+nomArqOrigem+\" no arquivo compactado...\");\n\n\t\t\tFile arquivoOrigem\t\t\t= new File(nomArqOrigem);\n\t\t\tFileInputStream fileInput \t= new FileInputStream(arquivoOrigem);\n\t\t \tbuffOrigem \t\t\t\t\t= new BufferedInputStream(fileInput, sizeBuffer);\n\t\t \tZipEntry entry \t\t\t\t= new ZipEntry(arquivoOrigem.getName());\n\t\t \tarqSaida.putNextEntry(entry);\n\t\t \tint count;\n\t\t\twhile((count = buffOrigem.read(data, 0, sizeBuffer)) != -1) \n\t\t\t arqSaida.write(data, 0, count);\n\t\t\t \n\t\t buffOrigem.close();\n\t\t}\n\t\tarqSaida.close();\n\t\tSystem.out.println(\"Termino da compactacao do arquivo.\");\t\n\t\treturn getNomeArquivoCompactado(ordem); \n\t}", "public static void createFileToZip(BufferedImage image, String path, int name,ZipOutputStream zipOS) throws FileNotFoundException, IOException {\n //Create the jpeg image\n File f = new File(path+Integer.toString(name)+\".jpg\");\n //Create the inputstream\n FileInputStream fis = new FileInputStream(f);\n //Create a zipentry for the file we are gonna include to the zip\n ZipEntry zipEntry = new ZipEntry(path+Integer.toString(name)+\".jpg\");\n //Store the image into the zip as an array of bytes\n zipOS.putNextEntry(zipEntry);\n byte[] bytes = new byte[1024];\n int length;\n while ((length = fis.read(bytes)) >= 0) {\n zipOS.write(bytes, 0, length);\n }\n zipOS.closeEntry();\n fis.close();\n }", "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 }", "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}", "public void compressFile(String fileToCompress, String compressFile) throws IOException {\n try (\n FileInputStream fin = new FileInputStream(fileToCompress);\n FileOutputStream fout = new FileOutputStream(compressFile);\n DeflaterOutputStream dos = new DeflaterOutputStream(fout)) {\n int i;\n while ((i = fin.read()) != -1) {\n dos.write((byte) i);\n dos.flush();\n }\n }\n }", "public void startNewFile(String fileName, int sequenceNumber) throws Exception {\n\n try {\n \n \tif(sequenceNumber == 1)\n \t {\n \t // This is the first zip file for this data. \n \t // Just use the name passed in\n \t this.outputFileName = fileName;\n \t }\n \telse\n \t {\n \t\t// This is not the first zip file for this data\n \t\t// Append a number (e.g. _1 _2) to the file name\n \t\tint dotIndex = fileName.lastIndexOf('.');\n \t\tString beforeDot = fileName.substring(0, dotIndex);\n \t\toutputFileName=beforeDot+\"_part-\"+sequenceNumber+\".zip\";\n \t }\n \t\t\n \t// Add file to the list to be returned\n fileList.add(outputFileName); \t\n \t\n logger.debug(\"output file \" + outputFileName);\n\n FileOutputStream dest = new FileOutputStream(outputFileName);\n logger.debug(\"dest file \" + dest);\n this.out = new ZipOutputStream(new BufferedOutputStream(dest));\n\n\n // Set Default Compression level\n out.setLevel(ZipFiles.DEFAULT_COMPRESSION);\n out.setMethod(ZipOutputStream.DEFLATED);\n this.data = new byte[ZipFiles.BUFFER];\n } catch (FileNotFoundException e) {\n logger.error(\"File \" + outputFileName + \" not found !!\", e);\n throw new Exception(\"File \" + outputFileName + \" not found !!\", e);\n }\n\n }", "@Test\n @Ignore(\"Zip file compare have some problem\")\n public void testOutputCompressCsvMode() throws Throwable {\n testCompressFile(true);\n }", "public ZipFile mo305b() throws IOException {\n return new ZipFile(this.f340a);\n }", "@Test\n public void compress1() throws IOException {\n byte[] compressed = Utils.compress(null);\n Assert.assertEquals(compressed.length, 0);\n }", "byte[] deflate(byte[] data) throws IOException;", "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 }", "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}", "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 }", "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 zipDirectory(String sourceDirectoryPath, String zipOutputPath, Boolean ifAbsolutePath, Boolean ifProtect, int maxZipMbSizeToProtect) throws Exception {\t\t \n\t\t if(ifAbsolutePath) { zipOutputPath = zipDirectoryFullPath(sourceDirectoryPath, zipOutputPath); }\n\t\t else { zipOutputPath = zipDirectoryInternalPath(sourceDirectoryPath, zipOutputPath); }\t\t \n\t\t if(fileSizeMB(zipOutputPath) < maxZipMbSizeToProtect) {\n\t\t\t if(ifProtect){ fileRename(zipOutputPath,zipOutputPath.replace(\".zip\",\".renameToZip\")); }\n\t\t\t }\n\t\t }", "public static void zipFiles(String target, String... entries) {\n\t byte[] buf = new byte[1024];\n\t ZipOutputStream out = null;\n\t try {\n\t out = new ZipOutputStream(new FileOutputStream(target));\n\t for (String entry : entries) {\n\t FileInputStream in = new FileInputStream(entry);\n\t entry = entry.substring(entry.lastIndexOf(\"/\") + 1);\n\t out.putNextEntry(new ZipEntry(entry));\n\t int len;\n\t while ((len = in.read(buf)) > 0) {\n\t out.write(buf, 0, len);\n\t }\n\t out.closeEntry();\n\t in.close();\n\t }\n\t out.close();\n\t } catch (IOException e) {\n\t \tLogger.e(\"FileUtil\", \"zip file io error\", e);\n\t } finally {\n\t \tif (null != out) {\n\t \t\ttry {\n\t\t\t\t\tout.close();\n\t\t\t\t} catch (IOException e) {\n\t\t\t\t\tLogger.e(\"FileUtil\", \"close zip out stream error\", e);\n\t\t\t\t}\n\t \t}\n\t }\n\t}", "@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 static byte[] fileToZipBytes(final File file) throws IOException {\n\n if (file == null || !file.exists()) {\n throw new IllegalArgumentException(\"File must not be null\");\n }\n\n if (file.isFile() && file.getName().endsWith(\".zip\")) {\n\n // This is zip already\n return FileUtils.readFileToByteArray(file);\n\n } else {\n\n // Non zip file, needs to be zipped\n final ByteArrayOutputStream baos = new ByteArrayOutputStream();\n final ZipOutputStream zos = new ZipOutputStream(baos);\n appendFile(zos, null, file);\n zos.close();\n\n return baos.toByteArray();\n\n }\n \n }", "private void createTar() {\n File tgzFile = new File(\".\" + File.separator + Arguments.JRE_DEFAULT_NAME);\n File tgzMd5File = new File(tgzFile.getPath() + \".md5\");\n if (tgzFile.exists()) {\n tgzFile.delete();\n m_logger.debug(\"Removed the old tgz file\");\n }\n if (tgzMd5File.exists()) {\n tgzMd5File.delete();\n m_logger.debug(\"Removed the old md5 file\");\n }\n\n try {\n m_logger.debug(\"Starting zip\");\n tgzFile.createNewFile();\n TarArchiveOutputStream tgzStream = new TarArchiveOutputStream(new GZIPOutputStream(\n new BufferedOutputStream(new FileOutputStream(tgzFile))));\n addFileToTarGz(tgzStream, m_jreLocation, \"\");\n tgzStream.finish();\n tgzStream.close();\n m_logger.debug(\"Finished zip, starting md5 hash\");\n\n Platform.runLater(() -> fileLabel.setText(\"Generating md5 hash\"));\n String md5Hash = MainApp.hashFile(tgzFile);\n OutputStream md5Out = new BufferedOutputStream(new FileOutputStream(tgzMd5File));\n md5Out.write(md5Hash.getBytes());\n md5Out.flush();\n md5Out.close();\n m_logger.debug(\"Finished md5 hash, hash is \" + md5Hash);\n final boolean interrupted = Thread.interrupted();\n\n // Show the connect roboRio screen\n Platform.runLater(() -> {\n if (!interrupted) {\n m_args.setArgument(Arguments.Argument.JRE_TAR, tgzFile.getAbsolutePath());\n moveNext(Arguments.Controller.CONNECT_ROBORIO_CONTROLLER);\n }\n });\n } catch (IOException | NoSuchAlgorithmException e) {\n m_logger.error(\"Could not create the tar gz file. Do we have write permissions to the current working directory?\", e);\n showErrorScreen(e);\n }\n }", "public static byte[] compressBytes(byte[] data) {\n\t\t\tDeflater deflater = new Deflater();\n\t\t\tdeflater.setInput(data);\n\t\t\tdeflater.finish();\n\t\t\tByteArrayOutputStream outputStream = new ByteArrayOutputStream(data.length);\n\t\t\tbyte[] buffer = new byte[1024];\n\t\t\twhile (!deflater.finished()) {\n\t\t\t\tint count = deflater.deflate(buffer);\n\t\t\t\toutputStream.write(buffer, 0, count);\n\t\t\t}\n\t\t\ttry {\n\t\t\t\toutputStream.close();\n\t\t\t} catch (IOException e) {\n\t\t\t}\n\t\t\tSystem.out.println(\"Compressed Image Byte Size - \" + outputStream.toByteArray().length);\n\t\t\treturn outputStream.toByteArray();\n\t\t}", "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 }", "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 }", "@Deprecated\n/* */ public void addCompression() {\n/* 162 */ List<COSName> filters = getFilters();\n/* 163 */ if (filters == null)\n/* */ {\n/* 165 */ if (this.stream.getLength() > 0L) {\n/* */ \n/* 167 */ OutputStream out = null;\n/* */ \n/* */ try {\n/* 170 */ byte[] bytes = IOUtils.toByteArray((InputStream)this.stream.createInputStream());\n/* 171 */ out = this.stream.createOutputStream((COSBase)COSName.FLATE_DECODE);\n/* 172 */ out.write(bytes);\n/* */ }\n/* 174 */ catch (IOException e) {\n/* */ \n/* */ \n/* 177 */ throw new RuntimeException(e);\n/* */ }\n/* */ finally {\n/* */ \n/* 181 */ IOUtils.closeQuietly(out);\n/* */ }\n/* */ \n/* */ } else {\n/* */ \n/* 186 */ filters = new ArrayList<COSName>();\n/* 187 */ filters.add(COSName.FLATE_DECODE);\n/* 188 */ setFilters(filters);\n/* */ } \n/* */ }\n/* */ }", "public static void zipFile(final Path path, final Path baseForName, final ZipOutputStream zio, \n\t\t\tfinal boolean recursive, final Predicate<Path> filter) throws IOException {\n\t\tif (Files.isRegularFile(path) && (filter == null || filter.test(path))) {\n\t\t\tString name = baseForName == null ? path.toString() : baseForName.relativize(path).toString() ;\n\t\t\tname = name.replace('\\\\', '/');\n\t\t\tfinal ZipEntry entry = new ZipEntry(name); \n\t\t\tzio.putNextEntry(entry);\n\t\t\tfinal byte[] buffer = new byte[4096];\n\t\t\tint length;\n\t\t\ttry (final InputStream in = Files.newInputStream(path)) {\n\t\t\t\twhile ((length = in.read(buffer)) >= 0) {\n\t\t\t\t\tzio.write(buffer, 0 , length);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif (!recursive || !Files.isDirectory(path))\n\t\t\treturn;\n\t\tFiles.walkFileTree(path, new java.nio.file.SimpleFileVisitor<Path>() {\n\t\t\t\n\t\t\t@Override\n\t\t\tpublic FileVisitResult visitFile(Path file, BasicFileAttributes attrs) throws IOException {\n\t\t\t\tif (filter != null && Files.isDirectory(file)) {\n\t\t\t\t\tif (!filter.test(file))\n\t\t\t\t\t\treturn FileVisitResult.SKIP_SUBTREE;\n\t\t\t\t\telse\n\t\t\t\t\t\treturn FileVisitResult.CONTINUE;\n\t\t\t\t}\n\t\t\t\tif (!Files.isRegularFile(file) || (filter != null && !filter.test(file)))\n\t\t\t\t\treturn FileVisitResult.CONTINUE;\n\t\t\t\tfinal Path relativeBase = baseForName != null ? baseForName : path;\n\t\t\t\tfinal Path relativePath = relativeBase.relativize(file);\n\t\t\t\tfinal ZipEntry entry = new ZipEntry(relativePath.toString().replace('\\\\', '/')); // TODO check\n\t\t\t\tzio.putNextEntry(entry);\n\t\t\t\tfinal byte[] buffer = new byte[4096];\n\t\t\t\tint length;\n\t\t\t\ttry (final InputStream in = Files.newInputStream(file)) {\n\t\t\t\t\twhile ((length = in.read(buffer)) >= 0) {\n\t\t\t\t\t\tzio.write(buffer, 0 , length);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\treturn FileVisitResult.CONTINUE;\n\t\t\t}\n\t\t\t\n\t\t\t@Override\n\t\t\tpublic FileVisitResult visitFileFailed(Path file, IOException exc) throws IOException {\n\t\t\t\tLoggerFactory.getLogger(ZipUtils.class).warn(\"File visit failed: {}\"\n\t\t\t\t\t\t+ \". {}\", file, exc.toString());\n\t\t\t\treturn FileVisitResult.CONTINUE;\n\t\t\t}\n\t\t\t\n\t\t});\n\t}", "@AutoEscape\n\tpublic String getZip();", "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 }", "protected void createFile (ZipFile file, ZipEntry entry, File target)\n {\n if (_buffer == null) {\n _buffer = new byte[COPY_BUFFER_SIZE];\n }\n\n // make sure the file's parent directory exists\n File pdir = target.getParentFile();\n if (!pdir.exists() && !pdir.mkdirs()) {\n log.warning(\"Failed to create parent for '\" + target + \"'.\");\n }\n\n try (InputStream in = file.getInputStream(entry);\n FileOutputStream fout = new FileOutputStream(target)) {\n\n int total = 0, read;\n while ((read = in.read(_buffer)) != -1) {\n total += read;\n fout.write(_buffer, 0, read);\n updateProgress(total);\n }\n\n } catch (IOException ioe) {\n log.warning(\"Error creating '\" + target + \"': \" + ioe);\n }\n }", "public native int getCompression() throws MagickException;", "private static void writeFile(ZipInputStream zipIn, String filePath) throws IOException {\n\n String parent = filePath.replace(filePath.substring(filePath.lastIndexOf('/')), \"\");\n createParents(parent);\n\n BufferedOutputStream bos = null;\n\n try {\n bos = new BufferedOutputStream(new FileOutputStream(filePath));\n byte[] bytesIn = new byte[BUFFER_SIZE];\n\n int read = 0;\n while ((read = zipIn.read(bytesIn)) != -1) {\n bos.write(bytesIn, 0, read);\n }\n\n } catch (IOException e) {\n System.err.println(e.getMessage());\n Errors.setUnzipperError(true);\n\n } finally {\n if (bos != null) {\n bos.close();\n }\n }\n }" ]
[ "0.7265806", "0.70647603", "0.66470194", "0.6545827", "0.6426159", "0.6393275", "0.6293023", "0.6287428", "0.6269959", "0.6259811", "0.6189281", "0.6176582", "0.61472696", "0.61250395", "0.61150146", "0.60793203", "0.6078917", "0.6055336", "0.60493124", "0.6036569", "0.60125434", "0.5955948", "0.5947762", "0.5926085", "0.59085935", "0.59064305", "0.5897478", "0.587798", "0.58335596", "0.5797617", "0.579668", "0.5792427", "0.57900846", "0.5790019", "0.57693094", "0.57549655", "0.5726454", "0.5724376", "0.570329", "0.5690402", "0.56821775", "0.56749547", "0.56545323", "0.5644141", "0.5611616", "0.55798686", "0.5578089", "0.5556694", "0.55550337", "0.5548882", "0.5538387", "0.55324113", "0.55253136", "0.55245566", "0.5519078", "0.5502089", "0.5477124", "0.54639554", "0.54541427", "0.5447993", "0.5444862", "0.5433567", "0.54242724", "0.542381", "0.5410979", "0.54083645", "0.5389794", "0.5388412", "0.53871906", "0.53694403", "0.5368795", "0.535861", "0.53577024", "0.5352079", "0.5344294", "0.5340719", "0.53292334", "0.53199255", "0.53173846", "0.5305474", "0.53041375", "0.5296006", "0.52858883", "0.52856606", "0.52645445", "0.5260278", "0.5249222", "0.5237753", "0.52365017", "0.51995283", "0.51932013", "0.5190313", "0.51878417", "0.51819366", "0.5181906", "0.5180813", "0.51786184", "0.51758075", "0.5162711", "0.5159614" ]
0.63442427
6
Initialize and update both lists
@FXML /** * Initializes lists for combo boxes * @author Yuxi Sun */ void initialize(){ endOptions = FXCollections.observableArrayList(); startOptions = FXCollections.observableArrayList(); T3_startYear_ComboBox.setItems(startOptions); T3_endYear_ComboBox.setItems(endOptions); //perform link with T3_row_structure and fxml table T3_name_TableColumn.setCellValueFactory(new PropertyValueFactory<>("name")); T3_start_rank_TableColumn.setCellValueFactory(new PropertyValueFactory<>("startRank")); T3_start_year_TableColumn.setCellValueFactory(new PropertyValueFactory<>("startYear")); T3_end_rank_TableColumn.setCellValueFactory(new PropertyValueFactory<>("endRank")); T3_end_year_TableColumn.setCellValueFactory(new PropertyValueFactory<>("endYear")); T3_trend_TableColumn.setCellValueFactory(new PropertyValueFactory<>("trend")); this.t3_rows = FXCollections.<T3_row_structure>observableArrayList(); T3_output_Table.setItems(t3_rows); //set type options types = FXCollections.observableArrayList(DatasetHandler.getTypes()); T3_type_ComboBox.setItems(types); T3_type_ComboBox.setValue("human"); //set country options based on the default of usa countries = FXCollections.observableArrayList(DatasetHandler.getCountries("human")); T3_country_ComboBox.setItems(countries); T3_country_ComboBox.setValue("usa"); //update ranges according to default Pair<String,String> validRange = DatasetHandler.getValidRange("human","usa"); T3_startYear_ComboBox.setValue(validRange.getKey()); T3_endYear_ComboBox.setValue(validRange.getValue()); selectCountry(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private void initializeLists() {\n this.sensorsPm10 = new ArrayList<>();\n this.sensorsTempHumid = new ArrayList<>();\n }", "public void init() {\n l0 = new EmptyList();\n l1 = FListInteger.add(l0, new Integer(5));\n l2 = FListInteger.add(l1, new Integer(4));\n l3 = FListInteger.add(l2, new Integer(7));\n l4 = new EmptyList();\n l5 = FListInteger.add(l2, new Integer(7));\n }", "private void initList() {\n\n }", "private static void initializeLists() {\n\t\t\n\t\t//read from serialized files to assign array lists\n\t\t//customerList = (ArrayList<Customer>) readObject(customerFile);\n\t\t//employeeList = (ArrayList<Employee>) readObject(employeeFile);\n\t\t//applicationList = (ArrayList<Application>) readObject(applicationFile);\n\t\t//accountList = (ArrayList<BankAccount>) readObject(accountFile);\n\t\t\n\t\t//read from database to assign array lists\n\t\temployeeList = (ArrayList<Employee>)employeeDao.readAll();\n\t\tcustomerList = (ArrayList<Customer>)customerDao.readAll();\n\t\taccountList = (ArrayList<BankAccount>) accountDao.readAll();\n\t\tapplicationList = (ArrayList<Application>)applicationDao.readAll();\n\t\t\n\t\tassignBankAccounts();\n\t}", "public void refreshLists() {\n refreshCitizenList();\n refreshPlayerList();\n }", "private void initLists() {\r\n listPanel.removeAll();\r\n\r\n memoryLists = new JList[this.memoryBlocks.size()];\r\n memoryUpdateState = new boolean[this.memoryBlocks.size()];\r\n this.lastChanged = new int[this.memoryBlocks.size()];\r\n\r\n for (int i = 0; i < this.memoryBlocks.size(); i++) {\r\n this.lastChanged[i] = -1;\r\n memoryLists[i] = this.addList((MemoryBlock) memoryBlocks.get(i));\r\n\r\n // redraw first time\r\n memoryUpdateState[i] = true;\r\n }\r\n\r\n this.updateLists();\r\n }", "private void updateLists() {\r\n for (int i = 0; i < this.memoryLists.length; i++) {\r\n MemoryBlock memBlock = (MemoryBlock) memoryBlocks.get(i);\r\n\r\n if (memBlock.isChanged(this.lastChanged[i]) || memoryUpdateState[i]) {\r\n Vector<MemoryInt> memVector = memBlock.getMemoryVector();\r\n\r\n if (memVector != null) memoryLists[i].setListData(memVector);\r\n\r\n // if memory block has changed, do also redraw next time\r\n // in order to remove indication\r\n memoryUpdateState[i] = memBlock.isChanged(this.lastChanged[i]);\r\n this.lastChanged[i] = memBlock.lastChanged();\r\n }\r\n }\r\n }", "public void initialize() {\n\n list.add(user1);\n list.add(user2);\n list.add(user3);\n }", "public void setList(DList2 list1){\r\n list = list1;\r\n }", "public void initializeListings() {\n\t listings = new ArrayList<Listing>();\n\t Listings listingsToStore = Listings.getInstance();\n\t Iterator<Saveable> listingIterator = listingsToStore.iterator();\n\t\n\t int counter = 0;\n\t while (listingIterator.hasNext()) {\n\t\t Listing currentListing = listingsToStore.getListing(counter);\n\t\t for (int i = 0; i < listingIds.size(); i++) {\n\t\t\t \n\t\t\t if (currentListing.getInternalId() == listingIds.get(i)) {\n\t\t\t\t \n\t\t\t\t listings.add(currentListing);\n\t\t\t }\n\t\t }\n\t\t counter++;\n\t\t listingIterator.next();\n\t }\n\t \n }", "public void initialize() {\r\n\t\tfor (iPhone iphone : iphoneList) {\r\n\t\t\tadd(iphone);\r\n\t\t}\r\n\t}", "private void initializeLists() {\n\t\tif (tiles == null) {\n\t\t\ttiles = new ArrayList<Tile>(gridSize * gridSize);\n\t\t} else {\n\t\t\t// Be sure to clean up old tiles\n\t\t\tfor (int i = 0; i < tiles.size(); i++) {\n\t\t\t\ttiles.get(i).freeBitmap();\n\t\t\t\ttiles = new ArrayList<Tile>(gridSize * gridSize);\n\t\t\t}\n\t\t}\n\t\ttileViews = new ArrayList<TileView>(gridSize * gridSize);\n\t\ttableRow = new ArrayList<TableRow>(gridSize);\n\n\t\tfor (int row = 0; row < gridSize; row++) {\n\t\t\ttableRow.add(new TableRow(context));\n\t\t}\n\n\t}", "private void initList() {\n\n\t\tfor (int i = 0; i < lstPool.size(); i++) {\n\t\t\tpoolList.add(createPool(\"nomPool\", lstPool.get(i).getNomPool()));\n\t\t}\n\t}", "public Merge() {\r\n this.listsOfSorted = new LinkedList<>();\r\n\r\n }", "public void setList(ArrayList<Song> theSongs) {\n songs1 = theSongs;\n songsNumber = songs1.size();\n }", "public void initializeList() {\n listitems.clear();\n int medicationsSize = Medications.length;\n for(int i =0;i<medicationsSize;i++){\n Medication Med = new Medication(Medications[i]);\n listitems.add(Med);\n }\n\n }", "void assignToLists() {\n\n int lastOuterIndex = -1;\n int lastRightIndex = -1;\n for (int i = 0; i < rangeVariables.length; i++) {\n if (rangeVariables[i].isLeftJoin) {\n lastOuterIndex = i;\n }\n if(rangeVariables[i].isRightJoin) {\n lastOuterIndex = i;\n lastRightIndex = i;\n }\n\n if (lastOuterIndex == i) {\n joinExpressions[i].addAll(tempJoinExpressions[i]);\n } else {\n for (int j = 0; j < tempJoinExpressions[i].size(); j++) {\n assignToJoinLists(\n (Expression) tempJoinExpressions[i].get(j),\n joinExpressions, lastOuterIndex + 1);\n }\n }\n }\n\n for (int i = 0; i < queryExpressions.size(); i++) {\n assignToWhereLists((Expression) queryExpressions.get(i),\n whereExpressions, lastRightIndex);\n }\n }", "public void init(List<ClientDownloadItem> list) {\n if (list != null) {\n mItemlist.clear();\n mItemlist.addAll(list);\n Log.i(TAG, \"mItemlist.size = \" + mItemlist.size());\n notifyDataSetChanged();\n }\n }", "@Override\n public void updateLists(ItemList userItemList, ItemList auctionItemList) {\n this.auctionItemList = auctionItemList;\n this.userItemList = userItemList;\n updateJList();\n }", "public void setUpList(List upList) {\n\t\tthis.upList = upList;\n\t}", "@Test\n public void initializeFromAnotherCollectionWhenCreating() {\n List<Integer> lst1 = new ArrayList<>(List.of(3, 1, 2));\n assertThat(lst1).hasSize(3);\n\n // create and initialize an ArrayList from Arrays.asList\n List<Integer> lst2 = new ArrayList<>(Arrays.asList(3, 1, 2));\n assertThat(lst2).hasSize(3);\n\n // create and initialize an ArrayList from Java 9+ Set.of\n List<Integer> lst3 = new ArrayList<>(Set.of(5, 4, 6));\n assertThat(lst3).hasSize(3);\n\n // create and initialize from an existing collection\n List<Integer> lst4 = new ArrayList<>(lst3);\n assertThat(lst4).hasSize(3);\n }", "private void initList(CartInfo ci) {\n\t\t\t\t\n\t\t\t\t\n\t\t\t}", "public void updateList(List<?> listOfObjects){\n this.radioObjects = listOfObjects;\n }", "ArrayList<Float> polaczListy (ArrayList<Float> L1, ArrayList<Float> L2)\n\t{\n\t\tint i=L1.size();\n\t\twhile(i<Stale.horyzontCzasowy)\n\t\t{\n\t\t\tL1.add(L2.get(i));\n\t\t\ti++;\n\t\t}\n\t\t\n\t\treturn L1;\n\t}", "private void initList() {\n tempShopList=wdh.getTempShopList();\n final String[] listIndex=new String[tempShopList.size()];\n \n // System.out.println(tempShopList.size());\n \n for(int i=0;i<tempShopList.size();i++)\n listIndex[i]=String.valueOf(i+1); \n \n// jList1=new JList(listIndex);\n// jScrollPane1=new JScrollPane(jList1);\n// jScrollPane1.setViewportView(jList1);\n \n \n jList1.setModel(new javax.swing.AbstractListModel() {\n String[] strings1 = listIndex;\n public int getSize() { return strings1.length; }\n public Object getElementAt(int i) { return strings1[i]; }\n });\n jScrollPane1.setViewportView(jList1);\n \n }", "static List<StateRef> append(List<StateRef> l1, List<StateRef> l2) {\n l1.addAll(l2);\n return l1;\n }", "private void loadLists() {\n }", "private List<View> m9533a(List<View> list, List<View> list2) {\n LinkedList linkedList = new LinkedList();\n if (list != null && !list.isEmpty()) {\n int size = list.size();\n for (int i = 0; i < size; i++) {\n linkedList.add(list.get(i));\n }\n }\n if (list2 != null && !list2.isEmpty()) {\n int size2 = list2.size();\n for (int i2 = 0; i2 < size2; i2++) {\n linkedList.add(list2.get(i2));\n }\n }\n return linkedList;\n }", "public void initialize()\r\n {\n \t\tSystem.out.println(\"*** Initializing asserted list ...\");\r\n \t\treload();\r\n \t\tSystem.out.println(\"*** ... List loaded\");\r\n }", "public static void initializeUserList() {\r\n\t\tUser newUser1 = new User(1, \"Elijah Hickey\", \"snhuEhick\", \"4255\", \"Admin\");\r\n\t\tuserList.add(newUser1);\r\n\t\t\r\n\t\tUser newUser2 = new User(2, \"Bob Ross\", \"HappyClouds\", \"200\", \"Employee\");\r\n\t\tuserList.add(newUser2);\r\n\t\t\r\n\t\tUser newUser3 = new User(3, \"Jane Doe\", \"unknown person\", \"0\", \"Intern\");\r\n\t\tuserList.add(newUser3);\r\n\t}", "@Override\n\tvoid initialize() {\n\t\tdisplayedLabels.getItems().addAll(comboItems);\n\t\tdisplayedLabels.getSelectionModel().select(0);\n\t\tdisplayedLabels.valueProperty().addListener((oo, old, newValue) ->\n\t\t\t\tchangeLabelsInListView(newValue.getIndex())\n\t\t);\n\t\t\n\t\tfirstListView.getItems().addAll(fieldItems);\n\t\tsecondListView.getItems().addAll(fieldItems);\n\t\tpairsListView.getSelectionModel().setSelectionMode(SelectionMode.MULTIPLE);\n\t\treadPreviousPairs();\n\t\tinitializeContextMenus();\n\t\tinitializeKeyBoardActions();\n\t\ttranslatePairFields();\n\t}", "public void update (List<Dependency> list)\n {\n this.list.clear();\n this.list.addAll(list);\n notifyDataSetChanged();\n }", "@Before\r\n\tpublic void setList() {\r\n\t\tthis.list = new DoubleList();\r\n\t\tfor (int i = 0; i < 15; i++) {\r\n\t\t\tlist.add(new Munitions(i, i + 1, \"iron\"));\r\n\t\t}\r\n\t}", "public void populateList() {\n }", "private void updateEmptyLists() {\n \n for(int i = 0; i < this.allLists.size(); i++) {\n if(this.allLists.get(i).size() == 0) {\n for(int c = 0; c < this.dataTable.getRowCount(); c++) {\n this.allLists.get(i).add(\"\");\n }\n }\n }\n }", "private void initList() {\n long now = System.nanoTime();\n loadConfig();\n SlogEx.d(TAG, \"load config use:\" + (System.nanoTime() - now));\n }", "public final void addToInitList() {\n\t\tEngine.getSingleton().addToInitList(this);\n\t}", "private void init() {\r\n head = new DLList.Node<T>(null);\r\n head.setNext(tail);\r\n tail = new DLList.Node<T>(null);\r\n tail.setPrevious(head);\r\n size = 0;\r\n }", "private synchronized void init(){\n _2_zum_vorbereiten.addAll(spielzeilenRepo.find_B_ZurVorbereitung());\n _3_vorbereitet.addAll(spielzeilenRepo.find_C_Vorbereitet());\n _4_spielend.addAll(spielzeilenRepo.find_D_Spielend());\n }", "public void updateInterpList(){\n System.out.println(\"updating list\");\n tableVals = FXCollections.observableArrayList();\n for(InterpreterStaff interp: getInterpreterStaff()){\n tableVals.add(new InterpreterTableAdapter(interp));\n }\n InterpInfoTable.setItems(tableVals);\n }", "private static void init() {\n Friend friend0 = new Friend(\"Arne\", \"Andersen\", \"95123900\", \"Postveien 0\");\n Friend friend1 = new Friend(\"Berit\", \"Bertnsen\", \"95123901\", \"Postveien 1\");\n Friend friend2 = new Friend(\"Carl\", \"Carlsen\", \"95123902\", \"Postveien 2\");\n Friend friend3 = new Friend(\"Dora\", \"Danielsen\", \"95123903\", \"Postveien 3\");\n Friend friend4 = new Friend(\"Erik\", \"Erickson\", \"95123904\", \"Postveien 4\");\n Friend friend5 = new Friend(\"Fred\", \"Freddson\", \"95123905\", \"Postveien 5\");\n\n friendList.addFirst(friend1);\n friendList.addFirst(friend5);\n friendList.addFirst(friend3);\n friendList.addFirst(friend0);\n friendList.addFirst(friend2);\n friendList.addFirst(friend4);\n }", "private void updateList() {\r\n\t\tlistaStaff.setItems(FXCollections.observableArrayList(service\r\n\t\t\t\t.getStaff()));\r\n\t}", "public void setData1(ArrayList<CurrencyModel> currencyModelArrayList){\n if (items != null) {\n CurrDiffCallback postDiffCallback = new CurrDiffCallback(currencyModelArrayList, items);\n DiffUtil.DiffResult diffResult = DiffUtil.calculateDiff(postDiffCallback);\n\n items.clear();\n items.addAll(currencyModelArrayList);\n diffResult.dispatchUpdatesTo(this);\n Log.d(TAG, \"setData: dispatched to adapter\");\n } else {\n // first initialization\n items = currencyModelArrayList;\n }\n }", "public void updateList() {\n if (getActivity().getClass().getName().contains(\"BookmarksActivity\")) {\n\n // Call the create right after initializing the helper, just in case\n // the user has never run the app before.\n mDbNodeHelper.createDatabase();\n\n // Get a list of bookmarked node titles.\n loadBookmarks();\n\n // Close the database\n mDbNodeHelper.close();\n\n // Clear the old ListView.\n setListAdapter(null);\n\n // Initialize a new model object\n CategoryModel[] bookmarksModel = new CategoryModel[nodes.length];\n\n for (int i = 0; i < nodes.length; i++) {\n bookmarksModel[i] = new CategoryModel(nodes[i].id, nodes[i].title);\n }\n\n // Create a new list adapter based on our new updated array.\n ListAdapter bookmarksAdapter = new CategoryModelListAdapter(mActivity, bookmarksModel);\n\n // set the new list adapter, thus updating the list display.\n setListAdapter(bookmarksAdapter);\n }\n else if (getActivity().getClass().getName().contains(\"BrowseActivity\")) {\n\n // Call the create right after initializing the helper, just in case\n // the user has never run the app before.\n mDbNodeHelper.createDatabase();\n\n // Get a list of bookmarked node titles.\n loadList();\n\n // Close the database\n mDbNodeHelper.close();\n\n // Clear the old ListView.\n setListAdapter(null);\n\n // Initialize a new model object\n CategoryModel[] bookmarksModel = new CategoryModel[nodes.length];\n\n for (int i = 0; i < nodes.length; i++) {\n bookmarksModel[i] = new CategoryModel(nodes[i].id, nodes[i].title);\n }\n\n // Create a new list adapter based on our new updated array.\n ListAdapter bookmarksAdapter = new CategoryModelListAdapter(mActivity, bookmarksModel);\n\n // set the new list adapter, thus updating the list display.\n setListAdapter(bookmarksAdapter);\n }\n }", "private void prepareTheList()\n {\n int count = 0;\n for (String imageName : imageNames)\n {\n RecyclerUtils pu = new RecyclerUtils(imageName, imageDescription[count] ,images[count]);\n recyclerUtilsList.add(pu);\n count++;\n }\n }", "private void fillStatusList() {\n StatusList = new ArrayList<>();\n StatusList.add(new StatusItem(\"Single\"));\n StatusList.add(new StatusItem(\"Married\"));\n }", "public void init(){\n obsSongs = FXCollections.observableArrayList(bllfacade.getAllSongs());\n obsPlaylists = FXCollections.observableArrayList(bllfacade.getAllPlaylists());\n \n \n ClTitle.setCellValueFactory(new PropertyValueFactory<>(\"title\"));\n ClArtist.setCellValueFactory(new PropertyValueFactory<>(\"artist\"));\n ClCategory.setCellValueFactory(new PropertyValueFactory<>(\"genre\"));\n ClTime.setCellValueFactory(new PropertyValueFactory<>(\"time\"));\n lstSongs.setItems(obsSongs); \n \n ClName.setCellValueFactory(new PropertyValueFactory<>(\"name\"));\n ClSongs.setCellValueFactory(new PropertyValueFactory<>(\"totalSongs\"));\n ClPTime.setCellValueFactory(new PropertyValueFactory<>(\"totalTime\"));\n lstPlaylists.setItems(obsPlaylists);\n }", "public static void fillArrayList(List<String> list1){\n\t\tlist1.add(new String(\"Will\"));\n\t\tlist1.add(new String(\"John\"));\n\t\tlist1.add(new String(\"James\"));\n\t\tlist1.add(new String(\"Frank\"));\n\t\tlist1.add(new String(\"Fred\"));\n\t\tlist1.add(new String(\"Jake\"));\n\t\tlist1.add(new String(\"Winston\"));\n\t\tlist1.add(new String(\"Wally\"));\n\t\tlist1.add(new String(\"Karen\"));\n\t\tlist1.add(new String(\"Mary\"));\n\t\tlist1.add(new String(\"Michelle\"));\n\t\tlist1.add(new String(\"Micheal\"));\n\t\tlist1.add(new String(\"Mick\"));\n\t\tlist1.add(new String(\"Valdez\"));\n\t}", "public void setItems(List<T> items) {\n log.debug(\"set items called\");\n synchronized (listsLock){\n filteredList = new ArrayList<T>(items);\n originalList = null;\n updateFilteringAndSorting();\n }\n }", "private void init() {\n\t\thead = -1;\n\t\tnumElements = 0;\n\t}", "public void updateList() \n { \n model.clear();\n for(int i = ScholarshipTask.repository.data.size() - 1; i >= 0; i--) \n {\n model.addElement(ScholarshipTask.repository.data.get(i));\n }\n }", "public ListReferenceBased() {\r\n\t numItems = 0; // declares numItems is 0\r\n\t head = null; // declares head is null\r\n }", "private void initReferences() {\n trails = new ArrayList<>();\n keys = new ArrayList<>();\n trailAdapter = new TrailAdapter(this, R.layout.trail_row_layout, trails);\n floatingActionButton = (FloatingActionButton) findViewById(R.id.fab);\n trailListView = (ListView) findViewById(R.id.trail_list);\n trailEmptyText = (TextView) findViewById(R.id.empty_value);\n trailListView.setEmptyView(trailEmptyText);\n trailListView.setAdapter(trailAdapter);\n }", "void reinitialize() {\n super.reinitialize();\n head = tail = null;\n }", "private void fillData() {\n adapter = new ListViewAdapter();\n listview01.setAdapter(adapter);\n }", "private void initializeList() {\n findViewById(R.id.label_operation_in_progress).setVisibility(View.GONE);\n adapter = new MapPackageListAdapter();\n listView.setAdapter(adapter);\n listView.setVisibility(View.VISIBLE);\n listView.setOnItemClickListener(new AdapterView.OnItemClickListener() {\n \n @Override\n public void onItemClick(AdapterView<?> parent, final View view, final int position, long id) {\n List<DownloadPackage> childPackages = searchByParentCode(currentPackages.get(position).getCode());\n if (childPackages.size() > 0) {\n currentPackages = searchByParentCode(currentPackages.get(position).getCode());\n adapter.notifyDataSetChanged();\n }\n }\n });\n }", "void testListMethods(Tester t) {\n IList<Integer> mt = new Empty<Integer>();\n IList<Integer> l1 = new Cons<Integer>(1,\n new Cons<Integer>(2, new Cons<Integer>(3, \n new Cons<Integer>(4, mt))));\n\n t.checkExpect(mt.len(), 0);\n t.checkExpect(l1.len(), 4);\n\n t.checkExpect(mt.append(l1), l1);\n t.checkExpect(l1.append(mt), l1);\n\n t.checkExpect(mt.getData(), null);\n t.checkExpect(l1.getData(), 1);\n\n t.checkExpect(l1.getNext(), new Cons<Integer>(2 , new Cons<Integer>(3 , \n new Cons<Integer>(4 , mt))));\n }", "private void setEverything(){\r\n int listLength = propertyList.length -1;\r\n arrayIterator = new ArrayIterator<>(propertyList, listLength+1);\r\n\r\n this.priceTree = new SearchTree<>(new PriceComparator());\r\n this.stockTree = new SearchTree<>(new StockComparator());\r\n this.ratingTree = new SearchTree<>(new RatingComparator());\r\n this.deliveryTree= new SearchTree<>(new DeliveryTimeComparator());\r\n\r\n this.foodArray = new ArrayQueue<>();\r\n this.restaurantArray = new ArrayQueue<>();\r\n\r\n // Fill arrays from property list.\r\n createFoodArray();\r\n arrayIterator.setCurrent(0); //Since the restaurantArray will use the same iterator\r\n createRestaurantArray();\r\n\r\n // Fill Binary Search Trees\r\n createFoodTrees();\r\n createRestaurantTrees();\r\n }", "public MutiList() {\n\t\tsuper();\n\t\tthis.myList = new ArrayList<>();\n\t}", "private void prepareArrayLists() {\n mArrQueries = new ArrayList<>(Arrays.asList(DiscoverConstants.RESTAURANT, DiscoverConstants.MUSEUM, DiscoverConstants.HOTEL, DiscoverConstants.CLUB));\n mArrRecyclerViews = new ArrayList<>(Arrays.asList(rvRestaurants, rvMuseums, rvHotels, rvClubs));\n mArrAdapters = new ArrayList<>(Arrays.asList(mAdapterRestaurants, mAdapterMuseums, mAdapterHotels, mAdapterClubs));\n mArrBusinesses = new ArrayList<>(Arrays.asList(mRestaurants, mMuseums, mHotels, mClubs));\n }", "@Override\r\n\tpublic void update(List<GroupMember> list) {\n\t\tif(list == null) return;\r\n\t\tfor(int i=0;i<list.size();i++)\r\n\t\t\tupdate(list.get(i));\r\n\t}", "private void initialize() {\n this.pm10Sensors = new ArrayList<>();\n this.tempSensors = new ArrayList<>();\n this.humidSensors = new ArrayList<>();\n }", "private void init() {\n\n\t\tinitializeLists();\n\t\tcreateTiles();\n\t\tcreateTileViews();\n\t\tshuffleTiles();\n\n\t}", "public void updateUserLists()\n\t{\n\t\tfor (CIntentionCell cell : cells.values())\n\t\t{\n\t\t\tcell.updateUserList();\n\t\t}\n\t}", "public void setNewList(List<Item> items) {\n if (mUseIdDistributor) {\n IdDistributor.checkIds(items);\n }\n mItems = new ArrayList<>(items);\n mapPossibleTypes(mItems);\n getFastAdapter().notifyAdapterDataSetChanged();\n }", "private void restList() {\n for (Processus tmp : listOfProcess) {\n tmp.resetProcess();\n }\n }", "public void updateItemsList(List<Image> list) {\n\n\t\tthis.itemsList = list;\n\n\t}", "@Test\r\n public void testNotificationSetEqualElement() {\r\n ObservableList first = FXCollections.observableArrayList(getPerson1());\r\n ObservableList second = FXCollections.observableArrayList(getPerson2());\r\n int index = 0;\r\n assertEquals(\"sanity: \", first.get(index), second.get(index));\r\n ListChangeReport report = new ListChangeReport(first);\r\n first.set(index, second.get(index));\r\n assertEquals(\"list must have fired on setting equal item\", 1, report.getEventCount());\r\n \r\n }", "public void updatePhysicianList() {\n Log.d(LOG_TAG, \"updatePhysicianList() \");\n if (caseDataInterface != null) { // if called before it is attached/initialized ...prevent\n nearbyPhysicianList = loadPhysicianList();\n setUpPhysicianList(LayoutInflater.from(getContext()), nearbyPhysicianListLayout);\n\n }\n\n\n }", "private void initView(List<PersonWrapper> listOfPersons) {\n adapter = new PersonAdapter(context, listOfPersons);\n mPersonsView.setAdapter(adapter);\n adapter.notifyDataSetChanged();\n }", "public AntigooSync(ArrayList<BlockPos> updateList) {\n this.antigooList = updateList;\n }", "private void testSet() {\n init();\n assertTrue(\"l2.set(l2, 0, 39)\", \n FListInteger.get(l2.set(l2, 0, 39), 0) == 39);\n assertTrue(\"l2.set(l2, 0, 51)\", \n FListInteger.get(l2.set(l2, 0, 51), 0) == 51);\n assertTrue(\"l1.set(l1, 0, 10101)\",\n FListInteger.get(l1.set(l1, 0, 10101), 0) == 10101);\n }", "@SuppressWarnings({ \"rawtypes\" })\n @Override\n public void init(MsgList providedMsgList) {\n \n }", "private void updates() {\n \tDBPeer.fetchTableRows();\n DBPeer.fetchTableIndexes();\n \n for (Update update: updates) {\n \tupdate.init();\n }\n }", "private void fillContentListWithDefaultValues(List<Content> contentList, Integer start, Integer prevLastIndex) {\n\n\t\tfor (int i = start; i < prevLastIndex; i++)\n\t\t\tcontentList.add(null);\n\t}", "private static List concatList(List x, List y) {\n List ret = new ArrayList<Long>(x);\n ret.addAll(y);\n return ret;\n }", "private static List concatList(List x, List y) {\n List ret = new ArrayList<Long>(x);\n ret.addAll(y);\n return ret;\n }", "public void test2_updateSingletonList() {\n ArrayList<Participant> dummyList = new ArrayList<>();\n Participant dummy1 = new Participant(\"UpdateDummy1\");\n Participant dummy2 = new Participant(\"UpdateDummy2\");\n Participant dummy3 = new Participant(\"UpdateDummy3\");\n Participant dummy4 = new Participant(\"UpdateDummy4\");\n\n dummyList.add(dummy1);\n dummyList.add(dummy2);\n dummyList.add(dummy3);\n dummyList.add(dummy4);\n\n // add test users into the server\n apt.execute(dummy1, dummy2, dummy3, dummy4);\n\n // attempt to obtain all of these participants within the singleton list\n ParticipantController.updateSingletonList();\n\n for (Participant found : dummyList) {\n if (instance.getParticipantList().contains(found)) {\n assertTrue(true);\n } else {\n assertTrue(\"Not all found\", false);\n }\n }\n\n\n }", "@Override\r\n\tprotected void init() {\n\t\tupdateValues();\r\n\t}", "@Override\n public void refreshList(ArrayList<String> newList){\n }", "private void setupVariables() {\n activeCourseList = new ArrayList<>();\n activeScheduleList = new ArrayList<>();\n\n scanner = new Scanner(System.in);\n reader = new JsonReader(\"./data/ScheduleList.json\",\n \"./data/CourseList.json\");\n\n loadLists();\n }", "public ListIterator() {current=first.next;}", "protected void updateTypeList() {\n\t sequenceLabel.setText(\"Sequence = \" + theDoc.theSequence.getId());\n\t typeList.setListData(theDoc.theTypes);\n\t signalList.setListData(nullSignals);\n\t valueField.setEnabled(false);\n\t valueList.setEnabled(false);\n }", "protected void newPlayerList() {\n int len = getPlayerCount();\n mPlayerStartList = new PlayerStart[ len ];\n for(int i = 0; i < len; i++) {\n mPlayerStartList[i] = new PlayerStart( 0.f, 0.f );\n }\n }", "private Lists() { }", "@SuppressWarnings(\"unchecked\")\r\n public void createList() {\r\n items = new int[MAX_LIST];\r\n NumItems = 0;\r\n }", "public abstract void setList(List<T> items);", "private void loadLists() {\n loadSavedCourses();\n loadSavedSchedules();\n }", "private void updatePlayerList() \n\t{\n\t\tplayerStatus.clear();\n\n\t\tfor(Player thisPlayer: players) // Add the status of each player to the default list model.\n\t\t{\n\t\t\tplayerStatus.addElement(thisPlayer.toString());\n\t\t}\n\n\t}", "private void init()\n {\n List<Integer> hourList = new ArrayList<>();\n for (int i = 0; i < 24; i++)\n hourList.add(i);\n ObservableList hourObList = FXCollections.observableList(hourList);\n eventHour.getItems().clear();\n eventHour.setItems(hourObList);\n\n List<Integer> minList = new ArrayList<>();\n for (int i = 0; i < 60; i++)\n minList.add(i);\n ObservableList minObList = FXCollections.observableList(minList);\n eventMinute.getItems().clear();\n eventMinute.setItems(minObList);\n }", "public void updateList(){\r\n preyFragmentAdapter=new PreyFragmentAdapter(CPreyArrayList,this);\r\n recyclerView.setAdapter(preyFragmentAdapter);\r\n LinearLayoutManager a=new LinearLayoutManager(this.getContext());\r\n recyclerView.setLayoutManager(a);\r\n\r\n\r\n }", "public static void initializeClientList() {\r\n\t\tClient newClient1 = new Client(1, \"Bob Jones\", \"Brokerage\");\r\n\t\tclientList.add(newClient1);\r\n\t\t\r\n\t\tClient newClient2 = new Client(2, \"Sarah Davis\", \"Retirement\");\r\n\t\tclientList.add(newClient2);\r\n\t\t\r\n\t\tClient newClient3 = new Client(3, \"Amy Friendly\", \"Brokerage\");\r\n\t\tclientList.add(newClient3);\r\n\t\t\r\n\t\tClient newClient4 = new Client(4, \"Johnny Smith\", \"Brokerage\");\r\n\t\tclientList.add(newClient4);\r\n\t\t\r\n\t\tClient newClient5 = new Client(5, \"Carol Spears\", \"Retirement\");\r\n\t\tclientList.add(newClient5);\r\n\t}", "public void reUpdateTargetList(CopyOnWriteArrayList<Balloon> newList) {\r\n\t\tballoons = newList;\r\n\t}", "private void updateListView() {\n adapter = new TableItemAdapter(this, tableItems);\n this.listView.setAdapter(adapter);\n }", "public ListHolder()\n {\n this.list = new TestList(15, false);\n }", "public void refershData(ArrayList<SquareLiveModel> contents) {\n\t\tlistData = contents;\n\t\tnotifyDataSetChanged();\n\t}", "private void initListFavorite() {\n favoritesList = mApiService.getFavorites();\n mRecyclerView.setAdapter(new MyNeighbourRecyclerViewAdapter(favoritesList, this));\n }", "private void setUpList() {\n\n\n Contents s1 = new Contents(R.drawable.bishist,\"Bishisht Bhatta\",\"+977-9849849525\", Color.parseColor(\"#074e87\"));\n list.add(s1);\n Contents s2 = new Contents(R.drawable.sagar,\"Sagar Pant\",\"+977-9865616888\",Color.parseColor(\"#074e87\"));\n list.add(s2);\n Contents s3 = new Contents(R.drawable.rabins,\"Rabin Nath\",\"+977-9848781007\",Color.parseColor(\"#074e87\"));\n list.add(s3);\n\n\n }", "private void populateBasicLists() {\n // TODO chathuranga change following\n districtList = districtDAO.getDistrictNames(language, user);\n // TODO chathuranga when search by all district option\n /* if (districtId == 0) {\n if (!districtList.isEmpty()) {\n districtId = districtList.keySet().iterator().next();\n logger.debug(\"first allowed district in the list {} was set\", districtId);\n }\n }*/\n dsDivisionList = dsDivisionDAO.getDSDivisionNames(districtId, language, user);\n mrDivisionList = mrDivisionDAO.getMRDivisionNames(dsDivisionId, language, user);\n }", "public void initial_list_original(){\n \tFile file = new File(original_directory_conf);\n \tif(file.exists()){\n \t\tArrayList<String> original_directory_list = new ArrayList<String>();\n original_directory_list = read_from_file.readFromFile(original_directory_conf);\n for(int i = 0; i < original_directory_list.size(); i++){\n \tdefault_list_model1.addElement(original_directory_list.get(i));\n }\n list_original.setModel(default_list_model1);\n scroll_pane.repaint();\n \t}else{\n \t\treturn;\n \t}\n \t\n }", "private void updateList() {\n Model.instace.getAllArticles(new ArticleFirebase.GetAllArticlesAndObserveCallback() {\n @Override\n public void onComplete(List<Article> list) {\n data.clear();\n data = list;\n adapter.notifyDataSetChanged();\n }\n\n @Override\n public void onCancel() {\n\n }\n });\n }" ]
[ "0.6763302", "0.67242837", "0.66436714", "0.6613499", "0.63594645", "0.6338379", "0.63098484", "0.62913513", "0.62773794", "0.6195416", "0.61506027", "0.61342335", "0.60942173", "0.6074803", "0.6031514", "0.6014207", "0.58929324", "0.58774304", "0.586888", "0.58687943", "0.58572006", "0.58407295", "0.58161926", "0.5804963", "0.57842", "0.57689804", "0.5762796", "0.5758265", "0.57560855", "0.5734363", "0.5721217", "0.5716112", "0.56947356", "0.5694716", "0.5694523", "0.56936467", "0.5673881", "0.56702465", "0.5660931", "0.5656417", "0.56514823", "0.5643359", "0.56022346", "0.55829775", "0.55704796", "0.5559991", "0.55587023", "0.5554903", "0.5541962", "0.5540741", "0.5536095", "0.55289614", "0.55229616", "0.55211914", "0.55162275", "0.5513092", "0.55112714", "0.5494966", "0.549075", "0.5470961", "0.5463994", "0.54502755", "0.54459566", "0.54399383", "0.54378754", "0.54263973", "0.54184496", "0.5415222", "0.5414057", "0.5412364", "0.5411395", "0.5402325", "0.5398785", "0.53976715", "0.539708", "0.53965855", "0.53965855", "0.53951603", "0.5391939", "0.53887427", "0.53886366", "0.5384656", "0.5378422", "0.53782254", "0.53740156", "0.5372563", "0.5368586", "0.5365811", "0.53656805", "0.5364796", "0.5364757", "0.5359223", "0.5356017", "0.5353219", "0.53418374", "0.5337523", "0.5333114", "0.5333093", "0.53280413", "0.53273416", "0.532387" ]
0.0
-1
Call this when a value from type list is selected. Clears country, startYear, endYear comboBoxes
@FXML void selectType() { //hide all errors hideErrors(); //get countries from /type/metadata.txt //Reset range string T3_startYear_ComboBox.setValue(""); T3_endYear_ComboBox.setValue(""); //update country list String type = T3_type_ComboBox.getValue(); // getting type countries.clear(); for (String country: DatasetHandler.getCountries(type)){ countries.add(country); } T3_country_ComboBox.setValue(""); //clearing the StartYear and EndYear values and lists }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@FXML\n void selectCountry() {\n \t//hide all errors\n \thideErrors();\n \t//Getting start year and end year limits from /type/country/metadata.txt\n if (isComboBoxEmpty(T3_country_ComboBox.getValue())){\n //if nothing has been selected do nothing\n return;\n }\n String type = T3_type_ComboBox.getValue(); // getting type\n String country = T3_country_ComboBox.getValue(); // getting country\n //update ranges\n Pair<String,String> validRange = DatasetHandler.getValidRange(type,country);\n\n //update relevant menus\n\n int start = Integer.parseInt(validRange.getKey());\n int end = Integer.parseInt(validRange.getValue());\n //set up end list\n endOptions.clear();\n startOptions.clear();\n for (int i = start; i <= end ; ++i){\n endOptions.add(Integer.toString(i));\n startOptions.add(Integer.toString(i));\n }\n //set up comboBox default values and valid lists\n T3_startYear_ComboBox.setValue(Integer.toString(start));\n T3_endYear_ComboBox.setValue(Integer.toString(end));\n }", "private void periodTypeComboBoxActionPerformed(java.awt.event.ActionEvent evt) {\n\n // Determining selection and filling\n switch (periodTypeComboBox.getSelectedItem().toString()) {\n case \"Monthly\":\n unitLabel.setText(\"Month:\");\n dates = new ArrayList<>();\n\n // Adding dates\n monthlyTotals.stream().forEach((w) -> {\n dates.add(w.getDate());\n });\n\n Collections.sort(dates, MonthComparator.ascending(MonthComparator.getComparator(MonthComparator.DATE_SORT)));\n Collections.reverse(dates);\n\n // Removing duplicate dates\n set = new LinkedHashSet<>(dates);\n\n // Setting model\n periodComboBox.setModel(new javax.swing.DefaultComboBoxModel<>(set.toArray()));\n periodComboBox.setEnabled(true);\n periodComboBox.setSelectedIndex(0);\n break;\n case \"Yearly\":\n unitLabel.setText(\"Year:\");\n dates = new ArrayList<>();\n\n // Adding dates\n yearlyTotals.stream().map((w) -> {\n dates.add(w.getDate());\n return w;\n }).forEach((w) -> {\n periodList.add(w);\n });\n Collections.sort(dates);\n Collections.reverse(dates);\n\n // Removing duplicate dates\n set = new LinkedHashSet<>(dates);\n\n // Setting model\n periodComboBox.setModel(new javax.swing.DefaultComboBoxModel<>(set.toArray()));\n periodComboBox.setEnabled(true);\n periodComboBox.setSelectedIndex(0);\n break;\n case \"Historical\":\n unitLabel.setText(\"\");\n periodComboBox.setModel(new javax.swing.DefaultComboBoxModel<>());\n periodComboBox.addItem(\"\");\n periodComboBox.setEnabled(false);\n periodComboBox.setSelectedIndex(0);\n break;\n\n // No selection, do not fill\n default:\n periodComboBox.setModel(new javax.swing.DefaultComboBoxModel<>());\n break;\n }\n }", "protected void typesReset() {\n\t valueList.setListData(nullValues);\n\t valueField.setEnabled(false);\n\t valueList.setEnabled(false);\t \t \n }", "public void CountryComboSelect(){\n errorLabel.setText(\"\");\n ObservableList<Divisions> divisionsList = DivisionsImp.getAllDivisions();\n ObservableList<Divisions> filteredDivisions = FXCollections.observableArrayList();\n if (countryCombo.getValue() != null){\n int countryId = countryCombo.getValue().getCountryId();\n for(Divisions division : divisionsList){\n if(division.getCountryId() == countryId){\n filteredDivisions.add(division);\n }\n }\n divisionCombo.setItems(filteredDivisions);\n divisionCombo.setValue(null);\n }\n }", "public BlackRockCityMapUI ()\n {\n initComponents ();\n cbYear.setSelectedItem (\"2023\");\n\n }", "public void loadYear()\r\n\t{\r\n \t try{\r\n\r\n\t\t \t\tcboYear.removeAllItems();\r\n\t\t \t }catch(Exception ce){System.out.println(ce);}\r\n\r\n\r\n \t cboYear.addItem(\"Select a Year\");\r\n\r\n\t\t for(int i=2000;i<=2099;i++)\r\n\t\t {\r\n\t\t\tcboYear.addItem(String.valueOf(i));\r\n\t\t }\r\n\r\n\t}", "private void comboBoxUpdate(){\n\t\tString docType = (String) combBoxDocumentTypes.getSelectedItem();\n\t\tif(!docType.isEmpty()){\n\t\t\tchangeConditionsSetsFromRadioButton(profilingConditionsInformations.getConditionSetsNames(docType));\n\t\t}else{\n\t\t\tchangeConditionsSetsFromRadioButton(new HashSet<String>());\n\t\t}\n\t\tif(docType.equals(DocBookTypes.DOCBOOK4) || docType.equals(DocBookTypes.DOCBOOK5)){\n\t\t\tremoveDocumentTypeButton.setEnabled(false);\n\t\t}else{\n\t\t\tremoveDocumentTypeButton.setEnabled(true);\n\t\t}\n\n\t}", "private void fillComboBox() {\n List<String> times = this.resultSimulation.getTimes();\n this.timesComboBox.getItems().addAll(times);\n this.timesComboBox.getSelectionModel().select(0);\n }", "private void buildComboBoxes() {\n buildCountryComboBox();\n buildDivisionComboBox();\n }", "private void clearFields() {\n orderNo.clear();\n orderNo.setPromptText(\"9XXXXXX\");\n if (rbProductType.isEmpty()) {\n rbListAddElement();\n }\n for (int i = 0; i < rbProductType.size(); i++) {\n rbProductType.get(i).setSelected(false);\n }\n if (cbWorker.isEmpty()) {\n cbListAddElement();\n }\n for (int i = 0; i < cbWorker.size(); i++) {\n cbWorker.get(i).setSelected(false);\n }\n UserDAO userDAO = new UserDAO();\n User user = userDAO.getUser(logname.getText());\n for (int i = 0; i < cbWorker.size(); i++) {\n if(cbWorker.get(i).getText().equals(user.getNameSurname())) {\n cbWorker.get(i).setSelected(true);\n } else {\n cbWorker.get(i).setSelected(false);\n }\n }\n plannedTime.clear();\n actualTime.clear();\n comboStatus.valueProperty().set(null);\n }", "public void valueChanged(ListSelectionEvent e) \n\t{\n\t\tif(!e.getValueIsAdjusting())\n\t\t{\n\t\t\t// gets values from your jList and added it to a list\n\t\t\tList values = spotView.getCountryJList().getSelectedValuesList();\n\t\t\tspotView.setSelectedCountry(values);\n\t\t\t\n\t\t\t//based on country selection, state needs to be updated\n\t\t\tspotView.UpdateStates(spotView.getSelectedCountry());\n\t\t}\n\n\t}", "protected void updateTypeList() {\n\t sequenceLabel.setText(\"Sequence = \" + theDoc.theSequence.getId());\n\t typeList.setListData(theDoc.theTypes);\n\t signalList.setListData(nullSignals);\n\t valueField.setEnabled(false);\n\t valueList.setEnabled(false);\n }", "@FXML\n /**\n * Initializes lists for combo boxes\n * @author Yuxi Sun\n */\n void initialize(){\n endOptions = FXCollections.observableArrayList();\n startOptions = FXCollections.observableArrayList();\n T3_startYear_ComboBox.setItems(startOptions);\n T3_endYear_ComboBox.setItems(endOptions);\n \t//perform link with T3_row_structure and fxml table\n T3_name_TableColumn.setCellValueFactory(new PropertyValueFactory<>(\"name\"));\n T3_start_rank_TableColumn.setCellValueFactory(new PropertyValueFactory<>(\"startRank\"));\n T3_start_year_TableColumn.setCellValueFactory(new PropertyValueFactory<>(\"startYear\"));\n T3_end_rank_TableColumn.setCellValueFactory(new PropertyValueFactory<>(\"endRank\"));\n T3_end_year_TableColumn.setCellValueFactory(new PropertyValueFactory<>(\"endYear\"));\n T3_trend_TableColumn.setCellValueFactory(new PropertyValueFactory<>(\"trend\"));\n this.t3_rows = FXCollections.<T3_row_structure>observableArrayList();\n T3_output_Table.setItems(t3_rows);\n \n //set type options\n types = FXCollections.observableArrayList(DatasetHandler.getTypes());\n T3_type_ComboBox.setItems(types);\n T3_type_ComboBox.setValue(\"human\");\n \n //set country options based on the default of usa\n countries = FXCollections.observableArrayList(DatasetHandler.getCountries(\"human\"));\n T3_country_ComboBox.setItems(countries);\n T3_country_ComboBox.setValue(\"usa\");\n \n //update ranges according to default\n Pair<String,String> validRange = DatasetHandler.getValidRange(\"human\",\"usa\");\n T3_startYear_ComboBox.setValue(validRange.getKey());\n T3_endYear_ComboBox.setValue(validRange.getValue());\n \n selectCountry();\n }", "public void countryComboBoxListener() {\n countryComboBox.getSelectionModel().selectedItemProperty().addListener((observable, oldValue, newValue) -> buildDivisionComboBox());\n }", "@Override\r\n\tprotected void InitComboBox() {\n\t\t\r\n\t}", "private void resetComboBoxes() {\n // empty dropdowns\n boxPlayer1.getItems().clear();\n boxPlayer2.getItems().clear();\n boxPlayer3.getItems().clear();\n boxPlayer4.getItems().clear();\n\n // create list for dropdowns\n if (!dbAccess.openConn()) {\n showAlertDBError();\n return;\n }\n ObservableList<String> playersBox1 = FXCollections.observableArrayList();\n ObservableList<String> playersBox2 = FXCollections.observableArrayList();\n ObservableList<String> playersBox3 = FXCollections.observableArrayList();\n ObservableList<String> playersBox4 = FXCollections.observableArrayList();\n\n // VERSION 1 (at least one game finished)\n // get all players that have at least one finished game\n // selecting just all players would reduce time to open window a lot\n// List<Map<String, Object>> resultList = dbAccess.selectSQL(\"SELECT * FROM players \" +\n// \"INNER JOIN participants ON participants.player = players.id \" +\n// \"INNER JOIn games ON participants.game = games.id \" +\n// \"WHERE games.end_time IS NOT null GROUP BY players.name;\");\n\n // VERSION 2 (all players)\n List<Map<String, Object>> resultList = dbAccess.selectSQL(\"SELECT * FROM players\");\n if (resultList == null) {\n showAlertDBError();\n return;\n } else {\n for (Map<String, Object> row : resultList) {\n playersBox1.add((String) row.get(\"name\"));\n playersBox2.add((String) row.get(\"name\"));\n playersBox3.add((String) row.get(\"name\"));\n playersBox4.add((String) row.get(\"name\"));\n }\n }\n // sort lists\n Collections.sort(playersBox1);\n Collections.sort(playersBox2);\n Collections.sort(playersBox3);\n Collections.sort(playersBox4);\n playersBox1.add(0, \"None\");\n playersBox2.add(0, \"None\");\n playersBox3.add(0, \"None\");\n playersBox4.add(0, \"None\");\n // fill comboBoxes\n boxPlayer1.getItems().addAll(playersBox1);\n boxPlayer1.getSelectionModel().selectFirst();\n boxPlayer2.getItems().addAll(playersBox2);\n boxPlayer2.getSelectionModel().selectFirst();\n boxPlayer3.getItems().addAll(playersBox3);\n boxPlayer3.getSelectionModel().selectFirst();\n boxPlayer4.getItems().addAll(playersBox4);\n boxPlayer4.getSelectionModel().selectFirst();\n }", "private void populateCountryList(JComboBox cmbCountryList)\n {\n cmbCountryList.removeAllItems();\n CountryEnterprise countryEnterprise;\n \n for(Enterprise country: internationalNetwork.getEnterpriseDirectory().getEnterpriseList())\n {\n cmbCountryList.addItem((CountryEnterprise) country);\n }\n \n }", "public void Loadata(){ // fill the choice box\n stats.removeAll(stats);\n String seller = \"Seller\";\n String customer = \"Customer\";\n stats.addAll(seller,customer);\n Status.getItems().addAll(stats);\n }", "private void dataValuesChanged(){\r\n ComboBoxBean cmbTypeCode =(ComboBoxBean)awardAddDocumentForm.cmbDocumentType.getSelectedItem();\r\n if(!cmbTypeCode.getCode().equals(\"\") && !cmbTypeCode.getDescription().equals(\"\")){\r\n if( !awardAddDocumentForm.txtDescription.getText().equals(EMPTY_STRING)\r\n || !awardAddDocumentForm.txtFileName.getText().equals(EMPTY_STRING) ||\r\n Integer.parseInt(cmbTypeCode.getCode())!= DOC_CODE){\r\n dataChanged = true;\r\n }\r\n }else{\r\n if( !awardAddDocumentForm.txtDescription.getText().equals(EMPTY_STRING)\r\n || !awardAddDocumentForm.txtFileName.getText().equals(EMPTY_STRING)){\r\n dataChanged = true;\r\n }else{\r\n dataChanged = false;\r\n } \r\n } \r\n }", "private void clearCountryCode() {\n\n countryCode_ = getDefaultInstance().getCountryCode();\n }", "public void refreshOfficeCodeComboBox() {\n\ttry {\n\tList<OfficesList> offices = db.showOffices();\n\tHashSet<String> unique = new HashSet<String>();\n\tofficeCodeComboBox.removeAllItems();\n\t\tfor (OfficesList officesList : offices) {\n\t\t\tif (unique.add(officesList.getOfficeCode())) {\n\t\t\t\tofficeCodeComboBox.addItem(officesList.getOfficeCode());\n\t\t\t}\n\t\t}\n\t}catch(SQLException err) {\n\t\terr.printStackTrace();\n\t}\n}", "private void clearStateInfo(){\r\n cmbState.removeAllItems();\r\n }", "public void onCountrySelect(ActionEvent actionEvent) {\n divisionCombo.getItems().clear();\n int selectedCountryId;\n if (countryCombo.getValue().equals(\"U.S\")) {\n selectedCountryId = 1;\n }\n else if (countryCombo.getValue().equals(\"UK\")) {\n selectedCountryId = 2;\n }\n else if (countryCombo.getValue().equals(\"Canada\")) {\n selectedCountryId = 3;\n }\n else {\n selectedCountryId = 0;\n }\n\n ObservableList<String> divisionNames = FXCollections.observableArrayList();\n for (FirstLevelDivisions f : DBFirstLevelDivisions.getAllDivisionsFromCountryID(selectedCountryId)) {\n divisionNames.add(f.getName());\n }\n divisionCombo.setItems(divisionNames);\n }", "private void jButtonClearActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButtonClearActionPerformed\n // TODO add your handling code here:\n jTextFieldActivityType.setText(\"\");\n jDateChooserStart.setDate(null);\n jDateChooserEnd.setDate(null);\n }", "public void clearfields()\r\n\t{\r\n\t\t/* assigns a new ID, if a new record is added this will increment the old one\r\n\t\t * if no change has occured it will just reassign the current one*/\r\n\t\tf1.assignID();\r\n\t\t//sets the text in the case link text field to null\r\n\t\tevidenceID.setText(null);\r\n\t\t//sets the value of the forensic id to the new value if changed or same value if not\r\n\t\tforensicID.setText(String.valueOf(f1.getForensicID()));\r\n\t\t\r\n\t\t/*\r\n\t\t * The following code uses unique models to set the comboboxes back to default values\r\n\t\t * this could not be achieved using a single model as all the boxes would change at the sme time\r\n\t\t * if a single model was used*/\r\n\t\tDefaultComboBoxModel model = new DefaultComboBoxModel(confirmation);\r\n\t\tbioBox.setModel(model);\r\n\t\tDefaultComboBoxModel model1 = new DefaultComboBoxModel(confirmation);\r\n\t\tprintsBox.setModel(model1);\r\n\t\tDefaultComboBoxModel model2 = new DefaultComboBoxModel(confirmation);\r\n\t\ttracksBox.setModel(model2);\r\n\t\tDefaultComboBoxModel model3 = new DefaultComboBoxModel(confirmation);\r\n\t\tdigitalBox.setModel(model3);\r\n\t\tDefaultComboBoxModel model4 = new DefaultComboBoxModel(confirmation);\r\n\t\ttoolMarkBox.setModel(model4);\r\n\t\tDefaultComboBoxModel model5 = new DefaultComboBoxModel(confirmation);\r\n\t\tnarcoticBox.setModel(model5);\r\n\t\tDefaultComboBoxModel model6 = new DefaultComboBoxModel(confirmation);\r\n\t\tfirearmBox.setModel(model6);\r\n\t\t\r\n\t}", "public void fillPLComboBox(){\n\t\tmonths.add(\"Select\");\n\t\tmonths.add(\"Current Month\");\n\t\tmonths.add(\"Last Month\");\n\t\tmonths.add(\"Last 3 Months\");\n\t\tmonths.add(\"View All\");\n\t}", "@FXML\r\n private void btnClean(ActionEvent event) {\r\n cmbCourses.getSelectionModel().select(\"Courses\");\r\n this.loadSpinnerDays();\r\n cmbPeriod.getSelectionModel().select(\"Period\");\r\n this.loadSpinnerStart(); \r\n }", "public void donutTypeChosen()\n {\n changeSubtotalTextField();\n }", "private void updateEnumDropDowns( final DSLDropDown source ) {\n\n //Copy selections in UI to data-model, used to drive dependent drop-downs\n updateSentence();\n\n final int sourceIndex = dropDownWidgets.indexOf( source );\n for ( DSLDropDown dd : dropDownWidgets ) {\n if ( dropDownWidgets.indexOf( dd ) > sourceIndex ) {\n dd.refreshDropDownData();\n }\n }\n\n //Copy selections in UI to data-model again, as updating the drop-downs\n //can lead to some selected values being cleared when dependent drop-downs\n //are used.\n updateSentence();\n }", "@Override\n\t\t\tpublic void actionPerformed(ActionEvent e) {\n\t\t\t\t@SuppressWarnings(\"unchecked\")\n\t\t\t\tJComboBox<String> cb = (JComboBox<String>) e.getSource();\n\t\t\t\tinputTypes_dropDown.setModel(new DefaultComboBoxModel<>(inputs[cb.getSelectedIndex()]));\n\t\t\t}", "public void clearInterface(){\n spinnerstd.setSelection(0);\n month.setSelection(0);\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 jC1 = new javax.swing.JComboBox<>();\n jC2 = new javax.swing.JComboBox<>();\n jButton1 = new javax.swing.JButton();\n jYearChooser1 = new com.toedter.calendar.JYearChooser();\n jC3 = new javax.swing.JComboBox<>();\n jLabel4 = new javax.swing.JLabel();\n jLabel5 = new javax.swing.JLabel();\n jLabel7 = new javax.swing.JLabel();\n jTextField1 = new javax.swing.JTextField();\n jLabel6 = new javax.swing.JLabel();\n jButton2 = new javax.swing.JButton();\n\n setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);\n\n jPanel1.setBackground(new java.awt.Color(0, 204, 204));\n\n jLabel1.setFont(new java.awt.Font(\"Andalus\", 1, 24)); // NOI18N\n jLabel1.setForeground(new java.awt.Color(0, 51, 255));\n jLabel1.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);\n jLabel1.setText(\"PAYMENT SLIP\");\n\n jLabel2.setFont(new java.awt.Font(\"Tahoma\", 1, 14)); // NOI18N\n jLabel2.setText(\"Department\");\n\n jLabel3.setFont(new java.awt.Font(\"Tahoma\", 1, 14)); // NOI18N\n jLabel3.setText(\"Faculty Id\");\n\n jC1.setFont(new java.awt.Font(\"Tahoma\", 1, 12)); // NOI18N\n jC1.setModel(new javax.swing.DefaultComboBoxModel<>(new String[] { \"Computer Science\", \"Mathematics\", \"Chemistry\", \"Physics\", \"Botony\", \"Zoology\" }));\n jC1.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n jC1ActionPerformed(evt);\n }\n });\n\n jC2.setFont(new java.awt.Font(\"Tahoma\", 1, 12)); // NOI18N\n jC2.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n jC2ActionPerformed(evt);\n }\n });\n\n jButton1.setFont(new java.awt.Font(\"Tahoma\", 1, 14)); // NOI18N\n jButton1.setText(\"Print\");\n jButton1.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n jButton1ActionPerformed(evt);\n }\n });\n\n jC3.setFont(new java.awt.Font(\"Tahoma\", 1, 12)); // NOI18N\n jC3.setModel(new javax.swing.DefaultComboBoxModel<>(new String[] { \"January\", \"February\", \"March\", \"April\", \"May\", \"June \", \"July\", \"August\", \"September\", \"October\", \"November\", \"December\" }));\n\n jLabel4.setFont(new java.awt.Font(\"Tahoma\", 1, 14)); // NOI18N\n jLabel4.setText(\"Month\");\n\n jLabel5.setFont(new java.awt.Font(\"Tahoma\", 1, 14)); // NOI18N\n jLabel5.setText(\"Year\");\n\n jLabel7.setFont(new java.awt.Font(\"Tahoma\", 1, 14)); // NOI18N\n jLabel7.setText(\"Name\");\n\n jTextField1.setFont(new java.awt.Font(\"Tahoma\", 1, 12)); // NOI18N\n\n jButton2.setFont(new java.awt.Font(\"Tahoma\", 1, 14)); // NOI18N\n jButton2.setText(\"Back\");\n jButton2.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n jButton2ActionPerformed(evt);\n }\n });\n\n javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1);\n jPanel1.setLayout(jPanel1Layout);\n jPanel1Layout.setHorizontalGroup(\n jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(jPanel1Layout.createSequentialGroup()\n .addGap(20, 20, 20)\n .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addComponent(jLabel2, javax.swing.GroupLayout.PREFERRED_SIZE, 86, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addComponent(jLabel3)\n .addComponent(jLabel5, javax.swing.GroupLayout.PREFERRED_SIZE, 60, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addComponent(jLabel4)\n .addComponent(jLabel7))\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)\n .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(jPanel1Layout.createSequentialGroup()\n .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addComponent(jC2, javax.swing.GroupLayout.PREFERRED_SIZE, 159, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addComponent(jTextField1, javax.swing.GroupLayout.PREFERRED_SIZE, 290, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addComponent(jC3, javax.swing.GroupLayout.PREFERRED_SIZE, 156, javax.swing.GroupLayout.PREFERRED_SIZE))\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)\n .addComponent(jLabel6, javax.swing.GroupLayout.PREFERRED_SIZE, 198, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addGap(66, 66, 66))\n .addGroup(jPanel1Layout.createSequentialGroup()\n .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addComponent(jYearChooser1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addComponent(jLabel1, javax.swing.GroupLayout.PREFERRED_SIZE, 463, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addComponent(jC1, javax.swing.GroupLayout.PREFERRED_SIZE, 159, javax.swing.GroupLayout.PREFERRED_SIZE))\n .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))))\n .addGroup(jPanel1Layout.createSequentialGroup()\n .addGap(179, 179, 179)\n .addComponent(jButton1, javax.swing.GroupLayout.PREFERRED_SIZE, 128, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addGap(47, 47, 47)\n .addComponent(jButton2, javax.swing.GroupLayout.PREFERRED_SIZE, 123, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addGap(0, 0, Short.MAX_VALUE))\n );\n jPanel1Layout.setVerticalGroup(\n jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(jPanel1Layout.createSequentialGroup()\n .addGap(12, 12, 12)\n .addComponent(jLabel1, javax.swing.GroupLayout.PREFERRED_SIZE, 36, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addGap(18, 18, 18)\n .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)\n .addComponent(jLabel2)\n .addComponent(jC1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))\n .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(jPanel1Layout.createSequentialGroup()\n .addGap(33, 33, 33)\n .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)\n .addComponent(jC2, javax.swing.GroupLayout.PREFERRED_SIZE, 21, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addComponent(jLabel3))\n .addGap(27, 27, 27)\n .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)\n .addComponent(jLabel7)\n .addComponent(jTextField1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))\n .addGap(25, 25, 25)\n .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)\n .addComponent(jLabel4)\n .addComponent(jC3, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)))\n .addGroup(jPanel1Layout.createSequentialGroup()\n .addGap(5, 5, 5)\n .addComponent(jLabel6, javax.swing.GroupLayout.PREFERRED_SIZE, 149, javax.swing.GroupLayout.PREFERRED_SIZE)))\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)\n .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addComponent(jLabel5)\n .addComponent(jYearChooser1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)\n .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)\n .addComponent(jButton2, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)\n .addComponent(jButton1, javax.swing.GroupLayout.DEFAULT_SIZE, 36, Short.MAX_VALUE))\n .addGap(21, 21, 21))\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 }", "@Override\n public void initialize(URL url, ResourceBundle rb) {\n // TODO\n counselorDetailsBEAN = new CounselorDetailsBEAN();\n counselorDetailsBEAN = Context.getInstance().currentProfile().getCounselorDetailsBEAN();\n ENQUIRY_ID = counselorDetailsBEAN.getEnquiryID();\n // JOptionPane.showMessageDialog(null, ENQUIRY_ID);\n countryCombo();\n cmbCountry.getSelectionModel().selectedItemProperty().addListener(new ChangeListener<Object>() {\n \n\n @Override\n public void changed(ObservableValue<? extends Object> observable, Object oldValue, Object newValue) {\n //JOptionPane.showMessageDialog(null, cmbCountry.getSelectionModel().getSelectedItem().toString());\n String[] parts = cmbCountry.getSelectionModel().getSelectedItem().toString().split(\",\");\n String value = parts[0];\n locationcombo(value);\n }\n\n private void locationcombo(String value) {\n List<String> locations = SuggestedCourseDAO.getLocation(value);\n for (String s : locations) {\n location.add(s);\n }\n cmbLocation.setItems(location);\n }\n\n });\n cmbLocation.getSelectionModel().selectedItemProperty().addListener(new ChangeListener<Object>() {\n\n @Override\n public void changed(ObservableValue<? extends Object> observable, Object oldValue, Object newValue) {\n universityCombo(cmbLocation.getSelectionModel().getSelectedItem().toString());\n }\n\n private void universityCombo(String value) {\n List<String> universities = SuggestedCourseDAO.getUniversities(value);\n for (String s : universities) {\n university.add(s);\n }\n cmbUniversity.setItems(university);\n }\n \n });\n cmbUniversity.getSelectionModel().selectedItemProperty().addListener(new ChangeListener<Object>() {\n\n @Override\n public void changed(ObservableValue<? extends Object> observable, Object oldValue, Object newValue) {\n levetCombo(cmbUniversity.getSelectionModel().getSelectedItem().toString());\n }\n\n private void levetCombo(String value) {\n List<String> levels = SuggestedCourseDAO.getLevels(value);\n for (String s : levels) {\n level.add(s);\n }\n cmbLevel.setItems(level);\n }\n });\n\n }", "@Override\r\n\t\t\tpublic void valueChanged(ListSelectionEvent ev) {\r\n\t\t\t\ttry {\r\n\t\t\t\t\tReservation selected = reservationsList.getSelectedValue();\r\n\t\t\t\t//Add other Values\r\n\t\t\t\t\tcodeTextField.setText(selected.getCode());\r\n\t\t\t\t\tflightTextField.setText(selected.getFlightCode());\r\n\t\t\t\t\tairlineTextField.setText(selected.getAirline());\r\n\t\t\t\t\tcostTextField.setText(\"$\"+selected.getCost());\r\n\t\t\t\t\tnameTextField.setText(selected.getName());\r\n\t\t\t\t\tcitizenshipTextField.setText(selected.getCitizenship());\r\n\t\t\t\t\tif(selected.isActive()) {\r\n\t\t\t\t\t\tstatusComboBox.setSelectedItem(\"Active\");\r\n\t\t\t\t\t}else {\r\n\t\t\t\t\t\tstatusComboBox.setSelectedItem(\"Inactive\");\r\n\t\t\t\t\t}\r\n\t\t\t\t}catch(NullPointerException ex) {\r\n\t\t\t\t\t//exists to stop crashing of program when it new list is selected.\r\n\t\t\t\t}\r\n\t\t\t}", "@FXML\n\tprivate void initialize() {\n\t\tlistNomType = FXCollections.observableArrayList();\n\t\tlistIdType=new ArrayList<Integer>();\n\t\ttry {\n\t\t\tfor (Type type : typeDAO.recupererAllType()) {\n listNomType.add(type.getNomTypeString());\n listIdType.add(type.getIdType());\n }\n\t\t} catch (ConnexionBDException e) {\n\t\t\tnew Popup(e.getMessage());\n\t\t}\n\t\tcomboboxtype.setItems(listNomType);\n\n\t}", "@FXML\n private void changeYear()\n {\n year = cmbYear.getValue();\n fillCalendar();\n setYear();\n parentContr.updatePieChart();\n\n }", "@Override\n\t\t\tpublic void valueChanged(ListSelectionEvent arg0) {\n\t\t\t\tif (!arg0.getValueIsAdjusting()){\n\t\t\t\t\ttimePeriodJListModel.clear();\n\t\t\t\t\tKIDSUIEventComponent selected = eventJList.getSelectedValue();\n\t\t\t\t\t\n\t\t\t\t\tSet<KIDSUITimePeriodComponent> tplist = selected.getAvailableTimePeriods();\n\n\t\t\t\t\t// Clear TimePeriodList selection (if any)\n\t\t\t\t\ttimePeriodJList.clearSelection();\n\t\t\t\t\t\n\t\t\t\t\tfor (KIDSUITimePeriodComponent t : tplist){\n\t\t\t\t\t\ttimePeriodJListModel.addElement(t);\n\t\t\t\t\t}\n\t\t\t\t\tselectedEvent = selected;\n\t\t\t\t}\n\t\t\t}", "private void buildCountryComboBox() {\n ResultSet rs = DatabaseConnection.performQuery(\n session.getConn(),\n Path.of(Constants.QUERY_SCRIPT_PATH_BASE + \"SelectCountryByID.sql\"),\n Collections.singletonList(Constants.WILDCARD)\n );\n\n ObservableList<Country> countries = FXCollections.observableArrayList();\n try {\n if (rs != null) {\n while (rs.next()) {\n int id = rs.getInt(\"Country_ID\");\n String name = rs.getString(\"Country\");\n countries.add(new Country(id, name));\n }\n }\n } catch (Exception e) {\n Common.handleException(e);\n }\n\n countryComboBox.setItems(countries);\n\n countryComboBox.setConverter(new StringConverter<>() {\n @Override\n public String toString(Country item) {\n return item.getCountryName();\n }\n\n @Override\n public Country fromString(String string) {\n return null;\n }\n });\n }", "@FXML\n void loadComboBoxLocationValues() {\n ArrayList<Location> locations = LocationDAO.LocationSEL(-1);\n comboBoxLocation.getItems().clear();\n if (!locations.isEmpty())\n for (Location location : locations) {\n comboBoxLocation.getItems().addAll(location.getLocationID());\n }\n }", "@FXML\n private void clearFiltersClicked() {\n try {\n // clear every filter and reload the cards\n datePicker.setValue(null);\n buildingComboBox.setValue(null);\n yesCheckBoxFood.setSelected(false);\n noCheckBoxFood.setSelected(false);\n yesCheckBoxTeacherOnly.setSelected(false);\n noCheckBoxTeacherOnly.setSelected(false);\n searchBar.setText(\"\");\n capacityComboBox.setValue(null);\n bikesAvailable.setValue(null);\n loadCards();\n } catch (Exception e) {\n logger.log(Level.SEVERE, e.toString());\n }\n }", "private void defaultdata()\n {\n try\n {\n \n StageBao stage_bao =\n new BaoFactory().createStageBao(); //create building bao object\n List<StageDto> stage_list =\n stage_bao.viewAll(); //get all building from DB\n \n stageComboBox.removeAllItems(); //remove all item from building combobox\n\n if(stage_list!=null&&!stage_list.isEmpty())\n {\n for(int i = 0; i<stage_list.size(); i++)\n {\n stageComboBox.addItem(stage_list.get(i).getNumber());\n }\n\n stageComboBox.setSelectedIndex(-1); //select no thing in this combo\n }\n \n \n DepartmentBao depart_bao = new BaoFactory().createDepartmentBao();\n List<DepartmentDto> depart_list = depart_bao.viewAll();\n DepartComboBox.removeAllItems();\n\n if(depart_list!=null&&!depart_list.isEmpty())\n {\n for(int i = 0; i<depart_list.size(); i++)\n {\n DepartComboBox.addItem(depart_list.get(i).getName());\n }\n DepartComboBox.setSelectedIndex(-1);\n }\n\n \n }\n \n catch(Exception e)\n {\n e.printStackTrace();\n }\n\n }", "@Override\n public final void init() {\n super.init();\n UIUtils.clearAllFields(upperPane);\n changeStatus(Status.NONE);\n intCombo();\n }", "private void updateFilterChoiceBox(){\r\n\t\tm_FilterChoices.clear();\r\n\t\tm_FilterChoices.add(\"All\");\r\n\t\tfor(BabelDomain cat : m_Categorizer.CategoriesToFrequency().keySet())\r\n\t\t\tm_FilterChoices.add(cat.toString());\r\n\t\t//Select \"All\" filter as a default\r\n\t\tm_FilterChoice.getSelectionModel().select(0);\r\n\t}", "private void handleCCCTypeChange() {\n\t\tString ccc = cbCCC.getText();\n\n\t\tif (optionB[2].equals(ccc) || optionB[3].equals(ccc)) {\n\t\t\ttxtCCCValue.setEnabled(false);\n\t\t\ttxtCCCValue.setText(EMPTYSTRING);\t\t\t\n\t\t} else {\n\t\t\ttxtCCCValue.setEnabled(true);\n\t\t}\n\t}", "private void resetValuesFromModel() {\r\n addressType.setSelectedItem(model.getType());\r\n address.setText(model.getAddress());\r\n }", "private void updateListBox() {\n String program = Utils.getListBoxItemText(listBox_Program);\n ArrayList<String> typeList = Classification.getTypeList(program);\n listBox_Type.clear();\n for (String item : typeList) {\n listBox_Type.addItem(item);\n }\n listBox_Type.setItemSelected(0, true);\n listBox_Type.setEnabled(typeList.size() > 1);\n listBox_Type.onBrowserEvent(Event.getCurrentEvent());\n }", "public void clearAll(){\n schoolID_comp.setText(\"\");\n fullname_comp.setText(\"\");\n contactNum_comp.setText(\"\");\n address_comp.setText(\"\");\n \n //set combobox on the first item\n grade_comp.setSelectedIndex(1);\n \n //uncheck checbox form form138 and nso/birthcertificate\n form138_comp.setSelected(false);\n nso_comp.setSelected(false);\n \n //clear image or icon in JLabel\n imageDisplayer.setIcon(null);\n imageDisplayer.revalidate();\n \n \n this.viewStudentinfo.displayData();\n \n \n }", "private void initComboBoxes()\n\t{\n\t\tsampling_combobox.getItems().clear();\n\t\tsampling_combobox.getItems().add(\"Random\");\n\t\tsampling_combobox.getItems().add(\"Cartesian\");\n\t\tsampling_combobox.getItems().add(\"Latin Hypercube\");\n\n\t\t// Set default value.\n\t\tsampling_combobox.setValue(\"Random\");\n\t}", "public void getoptions() {\n if (mydatepicker.getValue() != null) {\n ObservableList<String> options1 = FXCollections.observableArrayList(\n \"09:00\",\n \"09:30\",\n \"10:00\",\n \"10:30\",\n \"11:00\",\n \"11:30\",\n \"12:00\",\n \"12:30\",\n \"13:00\",\n \"13:30\",\n \"14:00\",\n \"14:30\"\n );\n ObservableList<String> options2 = FXCollections.observableArrayList(\n \"09:00\",\n \"09:30\",\n \"10:00\",\n \"10:30\",\n \"11:00\"\n );\n ObservableList<String> options3 = FXCollections.observableArrayList(\"NOT open on Sunday\");\n\n int a = mydatepicker.getValue().getDayOfWeek().getValue();\n if (a == 7) {\n time_input.setItems(options3);\n } else if (a == 6) {\n time_input.setItems(options2);\n } else {\n time_input.setItems(options1);\n }\n }\n }", "@Override\n\tpublic void widgetSelected(SelectionEvent e) {\n\t\tint i = typecombo.getSelectionIndex();\n\t\tif(i == 0){\n\t\t\tcosttext.setText(\"3元\");\n\t\t}\n\t\telse if(i == 1){\n\t\t\tcosttext.setText(\"5元\");\n\t\t}\n\t}", "private void clear() {\n\n machrefno.setText(null);\n machname.setText(null);\n manu.setSelectedItem(null);\n Date.setDate(null);\n dept.setSelectedItem(null);\n stat.setSelectedItem(null);\n \n }", "private void selectType(TypeInfo type) {\n if (type == null || !type.getWidget().getSelection()) {\n mInternalTypeUpdate = true;\n mCurrentTypeInfo = type;\n for (TypeInfo type2 : sTypes) {\n type2.getWidget().setSelection(type2 == type);\n }\n updateRootCombo(type);\n mInternalTypeUpdate = false;\n }\n }", "private void fillTravelTypeCb() {\n ObservableList travelsType = FXCollections.observableArrayList(\"Exportación\", \"Terrestre\");\n getTravelTypeCb().setItems(travelsType);\n }", "private void resetValue() {\n\t\t// TODO Auto-generated method stub\n\t\tthis.quesTxt.setText(\"\");\n\t\tthis.ansTxt.setText(\"\");\n\t\tthis.quizDescTxt.setText(\"\");\n\t\tif (this.quizTypeJcb.getItemCount() > 0) { // if type number is not 0, then select first one\n\t\t\tthis.quizTypeJcb.setSelectedIndex(0);\n\t\t}\n\t}", "@FXML\n private void populateTimeDropDownList(ActionEvent event) {\n\n try {\n Main.setSelectedFilmTitle(filmDropDownList.getValue());\n Film selectedFilm = Main.getFilmByTitle(Main.getSelectedFilmTitle());\n\n ObservableList<String> timesList = FXCollections.observableArrayList(selectedFilm.getTimes());\n for (int i = 0; i< timesList.size(); i++) {\n if (timesList.get(i).equals(\"hh:mm\")) {\n timesList.remove(i);\n i--;\n }\n }\n\n timeDropDownList.setItems(timesList);\n }\n catch (NullPointerException ex) {\n return;\n }\n }", "private void clearFields() {\r\n\t\tmCardNoValue1.setText(\"\");\r\n\t\tmCardNoValue1.setHint(\"-\");\r\n\t\tmCardNoValue2.setText(\"\");\r\n\t\tmCardNoValue2.setHint(\"-\");\r\n\t\tmCardNoValue3.setText(\"\");\r\n\t\tmCardNoValue3.setHint(\"-\");\r\n\t\tmCardNoValue4.setText(\"\");\r\n\t\tmCardNoValue4.setHint(\"-\");\r\n\t\tmZipCodeValue.setText(\"\");\r\n\t\tmZipCodeValue.setHint(\"Zipcode\");\r\n\t\tmCVVNoValue.setText(\"\");\r\n\t\tmCVVNoValue.setHint(\"CVV\");\r\n\t}", "@SuppressWarnings(\"unchecked\")\n // <editor-fold defaultstate=\"collapsed\" desc=\"Generated Code\">//GEN-BEGIN:initComponents\n private void initComponents() {\n\n jLabel1 = new javax.swing.JLabel();\n comboBoxSpecialization = new javax.swing.JComboBox<>();\n jLabel2 = new javax.swing.JLabel();\n textYearFounding = new javax.swing.JTextField();\n comboBoxIndicator = new javax.swing.JComboBox<>();\n jLabel3 = new javax.swing.JLabel();\n btnAddSpecializtion = new javax.swing.JButton();\n btnDeleteSpecializare = new javax.swing.JButton();\n btnSave = new javax.swing.JButton();\n btnCancel = new javax.swing.JButton();\n\n setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);\n\n jLabel1.setText(\"Profil\");\n\n comboBoxSpecialization.setModel(new javax.swing.DefaultComboBoxModel<>(new String[] { \"Item 1\", \"Item 2\", \"Item 3\", \"Item 4\" }));\n\n jLabel2.setText(\"Clasa\");\n\n comboBoxIndicator.setModel(new javax.swing.DefaultComboBoxModel<>(new String[] { \"A\", \"B\", \"C\", \"D\", \"E\", \"F\", \"G\", \"H\", \"I\", \"J\" }));\n comboBoxIndicator.setCursor(new java.awt.Cursor(java.awt.Cursor.DEFAULT_CURSOR));\n\n jLabel3.setText(\"Indicator\");\n\n btnAddSpecializtion.setText(\"Adauga\");\n btnAddSpecializtion.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n btnAddSpecializtionActionPerformed(evt);\n }\n });\n\n btnDeleteSpecializare.setText(\"Sterge\");\n btnDeleteSpecializare.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n btnDeleteSpecializareActionPerformed(evt);\n }\n });\n\n btnSave.setText(\"Salveaza\");\n btnSave.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n btnSaveActionPerformed(evt);\n }\n });\n\n btnCancel.setText(\"Anuleaza\");\n btnCancel.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n btnCancelActionPerformed(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(29, 29, 29)\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addComponent(jLabel3)\n .addGroup(layout.createSequentialGroup()\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false)\n .addGroup(layout.createSequentialGroup()\n .addComponent(btnSave)\n .addGap(38, 38, 38)\n .addComponent(btnCancel))\n .addComponent(jLabel2, javax.swing.GroupLayout.Alignment.LEADING)\n .addComponent(jLabel1, javax.swing.GroupLayout.Alignment.LEADING)\n .addComponent(comboBoxSpecialization, javax.swing.GroupLayout.Alignment.LEADING, 0, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)\n .addComponent(textYearFounding, javax.swing.GroupLayout.Alignment.LEADING)\n .addComponent(comboBoxIndicator, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.PREFERRED_SIZE, 244, javax.swing.GroupLayout.PREFERRED_SIZE))\n .addGap(18, 18, 18)\n .addComponent(btnAddSpecializtion)\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)\n .addComponent(btnDeleteSpecializare)))\n .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))\n );\n layout.setVerticalGroup(\n layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(layout.createSequentialGroup()\n .addContainerGap()\n .addComponent(jLabel1)\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)\n .addComponent(comboBoxSpecialization, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addComponent(btnAddSpecializtion)\n .addComponent(btnDeleteSpecializare))\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)\n .addComponent(jLabel2)\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)\n .addComponent(textYearFounding, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addGap(5, 5, 5)\n .addComponent(jLabel3)\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)\n .addComponent(comboBoxIndicator, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 88, Short.MAX_VALUE)\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)\n .addComponent(btnSave)\n .addComponent(btnCancel))\n .addGap(39, 39, 39))\n );\n\n pack();\n setLocationRelativeTo(null);\n }", "private void BuildingCombo() {\n \n }", "@Override\r\n\t\t\t\tpublic void stateChanged(ChangeEvent e) {\n\t\t\t\t\tif (!typeCheckBox.isSelected())\r\n\t\t\t\t\t\ttypeComboBox.setEnabled(false);\r\n\t\t\t\t\telse\r\n\t\t\t\t\t\ttypeComboBox.setEnabled(true);\r\n\t\t\t\t}", "private void initComboBox() {\n jComboBox1.removeAllItems();\n listaDeInstrutores = instrutorDao.recuperarInstrutor();\n listaDeInstrutores.forEach((ex) -> {\n jComboBox1.addItem(ex.getNome());\n });\n }", "@Override\r\n\t\t\t\tpublic void stateChanged(ChangeEvent e) {\n\t\t\t\t\tif (!timeCheckBox.isSelected()) {\r\n\t\t\t\t\t\tyearComboBox.setEnabled(false);\r\n\t\t\t\t\t\tmonthComboBox.setEnabled(false);\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\tyearComboBox.setEnabled(true);\r\n\t\t\t\t\t\tmonthComboBox.setEnabled(true);\r\n\t\t\t\t\t}\r\n\t\t\t\t}", "public void clearCombo() {\n\t\tcombo = false;\n\t}", "@PostConstruct\r\n private void init() {\n this.ccTypes = new ArrayList<SelectItem>();\r\n this.ccTypes.add(new SelectItem(CreditCardType.CARD_A, getCCTypeLabel(CreditCardType.CARD_A)));\r\n this.ccTypes.add(new SelectItem(CreditCardType.CARD_B, getCCTypeLabel(CreditCardType.CARD_B)));\r\n\r\n // Initialize categories select items\r\n this.categories = new ArrayList<SelectItem>();\r\n this.categories.add(new SelectItem(\"cat_it\", getCategoryLabel(\"cat_it\")));\r\n this.categories.add(new SelectItem(\"cat_gr\", getCategoryLabel(\"cat_gr\")));\r\n this.categories.add(new SelectItem(\"cat_at\", getCategoryLabel(\"cat_at\")));\r\n this.categories.add(new SelectItem(\"cat_mx\", getCategoryLabel(\"cat_mx\")));\r\n }", "void reset(){\n\t\tstatsRB.setSelected(true);\n\t\tcustTypeCB.setSelectedIndex(0);\n\t\tcustIdTF.setText(\"\");\n\t\toutputTA.setText(\"\");\n\t\t\n\t\tLong currentTime = System.currentTimeMillis();\n\t\t\n\t\t//THE TIME IN TIME SPINNERS ARE SET TO THE MAX POSSIBLE TIME WINDOW THAT IS \n\t\t//FROM THE TIME THAT THE SHOP STARTED TO THE CURRENT TIME.\n\t\t\n\t\t//THE STARTING DATE AND TIME OF SHOP OS CONSIDERED AS -- 1 JAN 2010 00:00\n\t\tstartDateS.setModel(new SpinnerDateModel(new Date(1262284200000L), new Date(1262284200000L), new Date(currentTime), Calendar.DAY_OF_MONTH));\n\t\t//AND END DATE AND TIME WILL THE THE CURRENT SYSTEM DATE AND TIME.\n\t\tendDateS.setModel(new SpinnerDateModel(new Date(currentTime), new Date(1262284200000L), new Date(currentTime), Calendar.DAY_OF_MONTH));\n\t\n\t}", "void hienThi() {\n LoaiVT.Open();\n ArrayList<LoaiVT> DSSP = LoaiVT.DSLOAIVT;\n VatTu PX = VatTu.getPX();\n \n try {\n txtMaVT.setText(PX.getMaVT());\n txtTenVT.setText(PX.getTenVT());\n txtDonVi.setText(PX.getDVT());\n DefaultComboBoxModel cb = new DefaultComboBoxModel();\n for(LoaiVT SP: DSSP){ \n cb.addElement(SP.getMaLoai());\n if(SP.getMaLoai().equals(PX.getMaLoai())){\n cb.setSelectedItem(SP.getMaLoai());\n }\n }\n cbMaloai.setModel(cb);\n } catch (Exception ex) {\n txtMaVT.setText(\"\");\n txtTenVT.setText(\"\");\n txtDonVi.setText(\"\");\n DefaultComboBoxModel cb = new DefaultComboBoxModel();\n cb.setSelectedItem(\"\");\n cbMaloai.setModel(cb);\n }\n \n \n }", "public void initialize() {\n fillCombobox();\n }", "@SuppressWarnings(\"unchecked\")\n /**\n * Method: clearAll\n * Clear and set JTextFields visible\n * @parem void\n * @return void\n * pre-condition: JTextFields with certain information\n * post-condition: empty JTextFields\n */ \n private void clearAll()\n {\n //Clear and set JTextFields visible\n listModel.clear();\n employeeJComboBox.setSelectedIndex(0);\n enablePrint(false);\n }", "public void setClear()\n\t{\n\t\tsbm_consignCom1.db.remove(text_BookingID.getSelectedItem());\n\t\tsbm_consignCom1.cb.setSelectedItem(\"\");\n\t\ttext_advance.setText(\"\");\n\t\ttext_adults.setText(\"\");\n\t\ttext_children.setText(\"\");\n\t}", "protected void setComboBoxes() { Something was changed in the row.\n //\n final Map<String, Integer> fields = new HashMap<>();\n\n // Add the currentMeta fields...\n fields.putAll(inputFields);\n\n Set<String> keySet = fields.keySet();\n List<String> entries = new ArrayList<>(keySet);\n\n String[] fieldNames = entries.toArray(new String[entries.size()]);\n Const.sortStrings(fieldNames);\n // Key fields\n ciKey[2].setComboValues(fieldNames);\n ciKey[3].setComboValues(fieldNames);\n }", "private void preencherComboEstados() {\n\t\tList<Estado> listEstado;\n\t\tObservableList<Estado> oListEstado;\n\t\tEstadosDAO estadosDao;\n\n\t\t//Instancia a DAO estados\n\t\testadosDao = new EstadosDAO();\n\n\t\t//Chama o metodo para listar todos os estados\n\t\tlistEstado = estadosDao.selecionar();\n\n\t\t//Verifica se a lista de estados está vazia\n\t\tif(listEstado.isEmpty()) \n\t\t{\n\t\t\treturn;\n\t\t}\n\t\t//Atribui a lista retornada ao observablearray\n\t\toListEstado = FXCollections.observableArrayList(listEstado);\n\n\t\t//Adiciona os itens no combobx\n\t\tcboEstado.setItems(oListEstado);\n\n\t\t//Seleciona o primeio item do combobox\n\t\tcboEstado.getSelectionModel().select(0);\n\t}", "public void refreshComboSubjects(){ \r\n bookSubjectData.clear();\r\n updateBookSubjects();\r\n }", "private void selectedDataSourceChanged() {\n\t\tselectedDataSource = (DataSource) jcbDataSource.getSelectedItem();\n\t\tif (selectedDataSource != null) {\n\t\t\ttry {\n\t\t\t\tList<DASType> dasTypeList = selectedDasConnector.getDASTypeList(selectedDataSource);\n\t\t\t\tjcbDasType.removeAllItems();\n\t\t\t\tfor (DASType currentDataType: dasTypeList) {\n\t\t\t\t\tjcbDasType.addItem(currentDataType);\n\t\t\t\t}\n\t\t\t} catch (Exception e) {\n\t\t\t\tExceptionManager.getInstance().caughtException(Thread.currentThread(), e, \"Error when retrieving the data types from \" + selectedDataSource);\n\t\t\t}\n\t\t}\n\t}", "private void actualizarCombos(){\n Set<String> listaAños = serviciosCuenta.obtieneAños();\n for (String año : listaAños) {\n this.jcbSeleccionAñoIni.addItem(año);\n this.jcbSeleccionAñoFin.addItem(año);\n }\n \n String AñoIni = this.jcbSeleccionAñoIni.getSelectedItem().toString();\n String AñoFin = this.jcbSeleccionAñoFin.getSelectedItem().toString();\n \n this.jcbSeleccionMesIni.removeAllItems();\n this.jcbSeleccionInicio.removeAllItems();\n Set<String> listaMesesIni = serviciosCuenta.obtieneMeses(AñoIni);\n Set<String> listaMesesFin = serviciosCuenta.obtieneMeses(AñoFin);\n for (String mes : listaMesesIni) {\n this.jcbSeleccionMesIni.addItem(mes);\n }\n for (String mes : listaMesesFin) {\n this.jcbSeleccionMesFin.addItem(mes);\n }\n \n String MesIni = this.jcbSeleccionMesIni.getSelectedItem().toString();\n String MesFin = this.jcbSeleccionMesFin.getSelectedItem().toString();\n ArrayList<String> listaDiasIni = serviciosCuenta.obtieneDias(AñoIni, MesIni);\n ArrayList<String> listaDiasFin = serviciosCuenta.obtieneDias(AñoFin, MesFin);\n \n for (String dia : listaDiasIni) {\n this.jcbSeleccionInicio.addItem(dia);\n }\n for (String dia : listaDiasFin) {\n this.jcbSeleccionFin.addItem(dia);\n }\n this.jcbSeleccionFin.setSelectedIndex(this.jcbSeleccionFin.getItemCount() - 1);\n //System.out.println(\"Saliendo: private void actualizarCombos()\");\n }", "public void actionPerformed(ActionEvent event) {\r\n if (JComboBox.class.isInstance(event.getSource())) {\r\n if (this.needDefaultValue && FeatureCollectionTools.isAttributeTypeNumeric((AttributeType) this.typeDropDown.getSelectedItem())) {\r\n AttributeType at = (AttributeType) this.typeDropDown.getSelectedItem();\r\n\r\n if (at.equals(AttributeType.INTEGER)) {\r\n try {\r\n Integer.parseInt(this.defValueTextField.getText());\r\n } catch (Exception e) {\r\n this.defValueTextField.setText(\"0\");\r\n }\r\n } else {\r\n try {\r\n Double.parseDouble(this.defValueTextField.getText());\r\n } catch (Exception e) {\r\n this.defValueTextField.setText(\"0.0\");\r\n }\r\n }\r\n }\r\n }\r\n\r\n }", "@FXML\n void clearFields(ActionEvent event) {\n \tfName_OpenClose.clear();\n \tlName_OpenClose.clear();\n \tmonth.clear();\n \tday.clear();\n \tyear.clear();\n \tbalance.clear();\n \ttgOpenClose.selectToggle(null);\n \tdirectDep.setSelected(false);\n \tdirectDep.setDisable(false);\n \tisLoyal.setSelected(false);\n \tisLoyal.setDisable(false);\n }", "public void dropDown1_processValueChange(ValueChangeEvent event) {\n \n }", "public void setContractTypeItems(){\r\n\t\tComboItem[] comboItems;\r\n\t\t//array list is used as interim solution due to the fact that regular arrays size is immutable\r\n\t\tArrayList<ComboItem> itemList = new ArrayList<ComboItem>();\r\n\t\t\r\n\t\ttry {\r\n\t\t\t//Query database and populate array list with values. \r\n\t\t\tResultSet result = CONTRACT_TYPE_OPTIONS.executeQuery();\r\n\t\t\twhile(result.next()){\r\n\t\t\t\titemList.add(new ComboItem(result.getInt(1), result.getString(2)));\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t//Initialise new array with needed size\r\n\t\t\tcomboItems = new ComboItem[itemList.size()];\r\n\t\t\t//convert arraylist object into array\r\n\t\t\tcomboItems = itemList.toArray(comboItems);\r\n\t\t} catch (SQLException e) {\r\n\t\t\t//initialise empty array to be returned\r\n\t\t\tcomboItems = new ComboItem[0];\r\n\t\t\tlogger.log(Level.SEVERE, e.getMessage());\r\n\t\t} \r\n\t\t\r\n\t\tthis.contract_types = comboItems;\r\n\t}", "@FXML\n private void resetFilters() {\n regionFilterComboBox.getSelectionModel().select(regionString);\n organFilterComboBox.getSelectionModel().select(organString);\n }", "private void clearEverything(){\n partTime.setSelected(false);\n fullTime.setSelected(false);\n management.setSelected(false);\n addIT.setSelected(false);\n addCS.setSelected(false);\n addECE.setSelected(false);\n dateAddText.clear();\n nameAddText.clear();\n hourlyAddText.clear();\n annualAddText.clear();\n managerRadio.setSelected(false);\n dHeadRadio.setSelected(false);\n directorRadio.setSelected(false);\n\n removeCS.setSelected(false);\n removeECE.setSelected(false);\n removeIT.setSelected(false);\n dateRemoveText.clear();\n nameRemoveText.clear();\n\n setCS.setSelected(false);\n setECE.setSelected(false);\n setIT.setSelected(false);\n dateSetText.clear();\n nameSetText.clear();\n hoursSetText.clear();\n\n }", "public void set_value_to_default() {\n this.selectionListStrike.setText(\"\");\n this.selectionListCal_iv.setText(\"\");\n this.selectionListUlast.setText(\"\");\n String format = new SimpleDateFormat(\"dd/MM/yyyy\").format(new Date());\n int parseInt = Integer.parseInt(format.substring(6, 10));\n int parseInt2 = Integer.parseInt(format.substring(3, 5));\n int parseInt3 = Integer.parseInt(format.substring(0, 2));\n this.selectedDate = parseInt + \"-\" + parseInt2 + \"-\" + parseInt3;\n this.selectionListExpiry.setSelectedText(format);\n this.selectionListExpiry.initItems(R.string.set_date, SelectionList.PopTypes.DATE, parseInt, parseInt2, parseInt3);\n if (!this.wtype.equals(\"C\")) {\n this.callputbutton.callOnClick();\n }\n }", "private void buildDivisionComboBox() {\n List<String> args = Collections.singletonList(Constants.WILDCARD);\n Country selectedCountry = countryComboBox.getSelectionModel().getSelectedItem();\n if (selectedCountry != null) {\n args = Collections.singletonList(String.valueOf(selectedCountry.getCountryID()));\n }\n\n ResultSet rs = DatabaseConnection.performQuery(\n session.getConn(),\n Path.of(Constants.QUERY_SCRIPT_PATH_BASE + \"SelectDivisionsByCountry.sql\"),\n args\n );\n\n ObservableList<FirstLevelDivision> divisions = FXCollections.observableArrayList();\n try {\n if (rs != null) {\n while (rs.next()) {\n int id = rs.getInt(\"Division_ID\");\n String name = rs.getString(\"Division\");\n int countryID = rs.getInt(\"Country_ID\");\n divisions.add(new FirstLevelDivision(id, name, countryID));\n }\n }\n } catch (Exception e) {\n Common.handleException(e);\n }\n\n divisionComboBox.setItems(divisions);\n\n divisionComboBox.setConverter(new StringConverter<>() {\n @Override\n public String toString(FirstLevelDivision item) {\n return item.getDivisionName();\n }\n\n @Override\n public FirstLevelDivision fromString(String string) {\n return null;\n }\n });\n }", "private void populateMyLocationsBox(){\n\t\t\t//locBar.removeActionListener(Jcombo);\n\t\t\tlocBar.removeAllItems();\n\t\t\tfor (int i = 0; i < app.getMyLocations().length; i ++){\n\t\t\t\tlocation tempLoc = app.getMyLocations()[i];\n\t\t\t\tif (tempLoc.getCityID() != 0){\n\t\t\t\t\tString val = tempLoc.getName() + \", \" + tempLoc.getCountryCode() + \" Lat: \" + tempLoc.getLatitude() + \" Long: \" + tempLoc.getLongitude();\n\t\t\t\t\tlocBar.addItem(val);\n\t\t\t\t} \n\t\t\t}\n\t\t\tif (locBar.getItemCount() == 0){\n\t\t\t\tlocBar.addItem(\"--Empty--\");\n\t\t\t} else {\n\t\t\t\tlocBar.addItem(\"--Remove?--\");\n\t\t\t}\n\t\t\tlocBar.addActionListener(Jcombo);\n\t\t}", "public void pulisciInput(){\n nomeVarTextField.setText(\"\");\n tipoVarComboBox.setSelectedIndex(-1);\n if(modalita == TRIGGER) triggerComboBox.setSelectedIndex(-1); \n else proceduraComboBox.setSelectedIndex(-1);\n }", "public void loadData(){\n mTipoEmpleadoList=TipoEmpleado.getTipoEmpleadoList();\n ArrayList<String> tipoEmpleadoName=new ArrayList();\n for(TipoEmpleado tipoEmpleado: mTipoEmpleadoList)\n tipoEmpleadoName.add(tipoEmpleado.getDescripcion()); \n mFrmMantenerEmpleado.cmbEmployeeType.setModel(new DefaultComboBoxModel(tipoEmpleadoName.toArray()));\n \n \n }", "@Override\n\t\t\tpublic void valueChanged(ListSelectionEvent arg0) {\n\t\t\t\tif (!arg0.getValueIsAdjusting()){\n\t\t\t\t\tKIDSUITimePeriodComponent selected = timePeriodJList.getSelectedValue();\n\t\t\t\t\tpopulateTree(top, eventJList.getSelectedValue(), selected);\n\t\t\t\t\tParameterTree.repaint();\n\t\t\t\t\tselectedTimePeriod = selected;\n\t\t\t\t}\n\t\t\t}", "public void valueChanged(ListSelectionEvent e){\n\t\tif(e.getValueIsAdjusting()) return;\n\t\t\n\t\t//\tget selected DataObjects\n\t\tclear();\n\t\taddAll(list != null ? JBNDUtil.castArray(list.getSelectedValues(), DataObject.class) : \n\t\t\tJBNDSwingUtil.selectedRecords(table));\n\t}", "private void clearBtn1ActionPerformed(java.awt.event.ActionEvent evt) {\n modelTxt.setText(\"\");\n catCombo.setSelectedIndex(0);\n rentTxt.setText(\"\");\n }", "public void setComboType(String comboType) {\r\n this.comboType = comboType == null ? null : comboType.trim();\r\n }", "public void country(String num) {\r\n\t\tSelect selectcountry = new Select(country);\r\n\t\tselectcountry.deselectByVisibleText(num);\r\n\t\tsleep(1000);\r\n\r\n\t}", "public void fillCombobox() {\n List<String> list = new ArrayList<String>();\n list.add(\"don't link\");\n if (dataHandler.persons.size() == 0) {\n list.add(\"No Persons\");\n ObservableList obList = FXCollections.observableList(list);\n cmb_linkedPerson.setItems(obList);\n cmb_linkedPerson.getSelectionModel().selectFirst();\n } else {\n for (int i = 0; i < dataHandler.persons.size(); i++) {\n list.add(dataHandler.persons.get(i).getName());\n ObservableList obList = FXCollections.observableList(list);\n cmb_linkedPerson.setItems(obList);\n cmb_linkedPerson.getSelectionModel().selectFirst();\n }\n }\n }", "public void populateQualityCombo() {\n\n // Making a list of poster qualities\n List<KeyValuePair> qualityList = new ArrayList<KeyValuePair>() {{\n\n add(new KeyValuePair(Constants.MEDIA_QUALITY_w92, \"Thumbnail\\t[ 92x138 ]\"));\n add(new KeyValuePair(Constants.MEDIA_QUALITY_w154, \"Tiny\\t\\t\\t[ 154x231 ]\"));\n add(new KeyValuePair(Constants.MEDIA_QUALITY_w185, \"Small\\t\\t[ 185x278 ]\"));\n add(new KeyValuePair(Constants.MEDIA_QUALITY_w342, \"Medium\\t\\t[ 342x513 ]\"));\n add(new KeyValuePair(Constants.MEDIA_QUALITY_w500, \"Large\\t\\t[ 500x750 ]\"));\n add(new KeyValuePair(Constants.MEDIA_QUALITY_w780, \"xLarge\\t\\t[ 780x1170 ]\"));\n add(new KeyValuePair(Constants.MEDIA_QUALITY_original, \"xxLarge\\t\\t[ HD ]\"));\n }};\n\n // Converting the list to an observable list\n ObservableList<KeyValuePair> obList = FXCollections.observableList(qualityList);\n\n // Filling the ComboBox\n cbPosterQuality.setItems(obList);\n\n // Setting the default value for the ComboBox\n cbPosterQuality.getSelectionModel().select(preferences.getInt(\"mediaQuality\", 3));\n }", "private void jComboBox2ActionPerformed(java.awt.event.ActionEvent evt) {\n \n if (jComboBox2.getSelectedItem() == \"MCA\")\n {\n jComboBox1.removeAllItems();\n jComboBox3.removeAllItems();\n \n jComboBox1.addItem(\"Computer\");\n jComboBox1.setSelectedItem(\"Computer\");\n jComboBox1.addItem(\"Management\");\n \n jComboBox3.addItem(\"FY\");\n jComboBox3.setSelectedItem(\"FY\");\n jComboBox3.addItem(\"SY\");\n jComboBox3.addItem(\"TY\");\n }\n else if (jComboBox2.getSelectedItem() == \"Engineering\")\n {\n jComboBox1.removeAllItems();\n jComboBox3.removeAllItems();\n \n jComboBox1.addItem(\"Mechanical\");\n jComboBox1.setSelectedItem(\"Mechanical\");\n jComboBox1.addItem(\"Computer\");\n \n jComboBox3.addItem(\"FE\");\n jComboBox3.setSelectedItem(\"FE\");\n jComboBox3.addItem(\"SE\");\n jComboBox3.addItem(\"BE\");\n }\n \n \n }", "private void updateDataType(){\n\t\tif(propertiesObj == null)\n\t\t\treturn;\n\n\t\tboolean deleteKids = false;\n\t\tint index = cbDataType.getSelectedIndex();\n\t\tQuestionDef questionDef = (QuestionDef)propertiesObj;\n\t\tif((questionDef.getDataType() == QuestionDef.QTN_TYPE_LIST_EXCLUSIVE ||\n\t\t\t\tquestionDef.getDataType() == QuestionDef.QTN_TYPE_LIST_MULTIPLE) &&\n\t\t\t\t!(index == DT_INDEX_SINGLE_SELECT || index == DT_INDEX_MULTIPLE_SELECT)){\n\t\t\tif(questionDef.getOptionCount() > 0 && !Window.confirm(LocaleText.get(\"changeWidgetTypePrompt\"))){\n\t\t\t\tindex = (questionDef.getDataType() == QuestionDef.QTN_TYPE_LIST_EXCLUSIVE) ? DT_INDEX_SINGLE_SELECT : DT_INDEX_MULTIPLE_SELECT;\n\t\t\t\tcbDataType.setSelectedIndex(index);\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tdeleteKids = true;\n\t\t}\n\t\telse if((questionDef.getDataType() == QuestionDef.QTN_TYPE_REPEAT) &&\n\t\t\t\t!(index == DT_INDEX_REPEAT)){\n\t\t\tif(!Window.confirm(LocaleText.get(\"changeWidgetTypePrompt\"))){\n\t\t\t\tindex = DT_INDEX_REPEAT;\n\t\t\t\tcbDataType.setSelectedIndex(index);\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tdeleteKids = true;\n\t\t}\n\n\t\t//cbDataType.setSelectedIndex(index);\n\t\tsetQuestionDataType((QuestionDef)propertiesObj);\n\t\tformChangeListener.onFormItemChanged(propertiesObj);\n\t\tif(deleteKids)\n\t\t\tformChangeListener.onDeleteChildren(propertiesObj);\n\t}", "private void handleDCCTypeChange() {\n\t\tString dcc = cbDCC.getText();\n\t\tif (optionB[2].equals(dcc) || optionB[3].equals(dcc)) {\n\t\t\ttxtDCCValue.setEnabled(false);\n\t\t\ttxtDCCValue.setText(EMPTYSTRING);\n\t\t} else {\n\t\t\ttxtDCCValue.setEnabled(true);\n\t\t}\n\t}", "private void ComboBoxLoader (){\n try {\n if (obslistCBOCategory.size()!=0)\n obslistCBOCategory.clear();\n /*add the records from the database to the ComboBox*/\n rset = connection.createStatement().executeQuery(\"SELECT * FROM category\");\n while (rset.next()) {\n String row =\"\";\n for(int i=1;i<=rset.getMetaData().getColumnCount();i++){\n row += rset.getObject(i) + \" \";\n }\n obslistCBOCategory.add(row); //add string to the observable list\n }\n\n cboCategory.setItems(obslistCBOCategory); //add observable list into the combo box\n //text alignment to center\n cboCategory.setButtonCell(new ListCell<String>() {\n @Override\n public void updateItem(String item, boolean empty) {\n super.updateItem(item, empty);\n if (item != null) {\n setText(item);\n setAlignment(Pos.CENTER);\n Insets old = getPadding();\n setPadding(new Insets(old.getTop(), 0, old.getBottom(), 0));\n }\n }\n });\n\n //listener to the chosen list in the combo box and displays it to the text fields\n cboCategory.getSelectionModel().selectedItemProperty().addListener((obs, oldValue, newValue)->{\n if(newValue!=null){\n Scanner textDisplay = new Scanner((String) newValue);\n txtCategoryNo.setText(textDisplay.next());\n txtCategoryName.setText(textDisplay.nextLine());}\n\n });\n\n } catch (SQLException throwables) {\n throwables.printStackTrace();\n }\n\n }", "@Override\r\n\tpublic void init(Map<String, Object> values) {\n\t\tsetValue(values);\r\n\t\tthis.setType(\"available\", FieldType.COMBOBOX);\r\n\t\tLinkedList<KV> avails = new LinkedList<>();\r\n\t\tKV avail=new KV().setField(\"available_avail\").setTitle(\"可用\").setValue(\"1\");\r\n\t\tKV not_avail=new KV().setField(\"available_not_avail\").setTitle(\"不可用\").setValue(\"0\");\r\n\t\tavail.setAttr(\"_default_\", values.get(\"available\").equals(\"0\")?not_avail:avail);\r\n\t\tavails.add(avail);\r\n\t\tavails.add(not_avail);\r\n\t\tSystem.out.println(values);\r\n\t\tsetValue(\"available\", avails.toArray(new KV[0]));\r\n\t}", "public void SetDefautValueCombo(Item item) \n {\n this.defautValueCombo=item;\n ;\n }", "private void fillYearFields() {\n\n\t\tfor (int i = 1990; i <= 2100; i++) {\n\t\t\tyearFieldDf.addItem(i);\n\t\t\tyearFieldDt.addItem(i);\n\t\t}\n\t}", "private void selectedDasTypeChanged() {\n\t\tselectedDasType = (DASType) jcbDasType.getSelectedItem();\n\t}", "public void populateChoiceBoxes() {\n subjects.setItems(FXCollections.observableArrayList(\"Select\", \"computers\", \"not-computers\", \"subjects\"));\n className.setItems(FXCollections.observableArrayList(\"Select\", \"101\", \"202\", \"303\", \"505\"));\n subjects.getSelectionModel().select(0);\n className.getSelectionModel().select(0);\n this.points.setPromptText(Integer.toString(100));\n\n }" ]
[ "0.70593286", "0.6651962", "0.63350475", "0.61583793", "0.60879934", "0.6058241", "0.60546356", "0.60083616", "0.58410317", "0.57768416", "0.574895", "0.57399803", "0.57178825", "0.5710163", "0.5698707", "0.5691944", "0.56661034", "0.56539816", "0.565386", "0.5636965", "0.5573295", "0.55264425", "0.5525155", "0.55194074", "0.5513611", "0.5499557", "0.54921174", "0.5491325", "0.5488103", "0.5483215", "0.5475888", "0.5474146", "0.5471283", "0.54630286", "0.54239225", "0.5423665", "0.5410728", "0.5385525", "0.53689545", "0.5368013", "0.5356566", "0.5348548", "0.5332229", "0.53259903", "0.53209877", "0.5320363", "0.5317715", "0.53173697", "0.531728", "0.53113884", "0.5306009", "0.5304744", "0.5302177", "0.53015995", "0.5299158", "0.52960354", "0.5278365", "0.52718693", "0.52702665", "0.52604765", "0.52580106", "0.52554196", "0.5254733", "0.52527106", "0.5244395", "0.5243772", "0.5243314", "0.52405214", "0.52340686", "0.52311647", "0.5229682", "0.5222969", "0.52209616", "0.5220773", "0.52102786", "0.5208696", "0.52065307", "0.5202008", "0.5193801", "0.5188552", "0.5184255", "0.5183209", "0.51795465", "0.51775587", "0.5176549", "0.51735127", "0.5172258", "0.5171525", "0.5166818", "0.5161266", "0.51553416", "0.51522595", "0.51518965", "0.5150953", "0.514793", "0.5147308", "0.5145353", "0.51439583", "0.5142648", "0.51362115" ]
0.7543185
0
Call this when a value of country is selected.
@FXML void selectCountry() { //hide all errors hideErrors(); //Getting start year and end year limits from /type/country/metadata.txt if (isComboBoxEmpty(T3_country_ComboBox.getValue())){ //if nothing has been selected do nothing return; } String type = T3_type_ComboBox.getValue(); // getting type String country = T3_country_ComboBox.getValue(); // getting country //update ranges Pair<String,String> validRange = DatasetHandler.getValidRange(type,country); //update relevant menus int start = Integer.parseInt(validRange.getKey()); int end = Integer.parseInt(validRange.getValue()); //set up end list endOptions.clear(); startOptions.clear(); for (int i = start; i <= end ; ++i){ endOptions.add(Integer.toString(i)); startOptions.add(Integer.toString(i)); } //set up comboBox default values and valid lists T3_startYear_ComboBox.setValue(Integer.toString(start)); T3_endYear_ComboBox.setValue(Integer.toString(end)); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\n public void onSelectCountry(Country country) {\n // get country name and country ID\n binding.editTextCountry.setText(country.getName());\n countryID = country.getCountryId();\n statePicker.equalStateObject.clear();\n cityPicker.equalCityObject.clear();\n \n //set state name text view and state pick button invisible\n setStateListener();\n \n // set text on main view\n// countryCode.setText(\"Country code: \" + country.getCode());\n// countryPhoneCode.setText(\"Country dial code: \" + country.getDialCode());\n// countryCurrency.setText(\"Country currency: \" + country.getCurrency());\n// flagImage.setBackgroundResource(country.getFlag());\n \n \n // GET STATES OF SELECTED COUNTRY\n for (int i = 0; i < stateObject.size(); i++) {\n // init state picker\n statePicker = new StatePicker.Builder().with(this).listener(this).build();\n State stateData = new State();\n if (stateObject.get(i).getCountryId() == countryID) {\n \n stateData.setStateId(stateObject.get(i).getStateId());\n stateData.setStateName(stateObject.get(i).getStateName());\n stateData.setCountryId(stateObject.get(i).getCountryId());\n stateData.setFlag(country.getFlag());\n statePicker.equalStateObject.add(stateData);\n }\n }\n }", "public void handleCountrySelection(ActionEvent actionEvent) {\n }", "public void countryComboBoxListener() {\n countryComboBox.getSelectionModel().selectedItemProperty().addListener((observable, oldValue, newValue) -> buildDivisionComboBox());\n }", "@Override\n public void onSelectCountry(Country country) {\n // get country name and country ID\n countryName.setText(country.getName());\n countryName.setVisibility(View.VISIBLE);\n countryID = country.getCountryId();\n statePicker.equalStateObject.clear();\n cityPicker.equalCityObject.clear();\n\n //set state name text view and state pick button invisible\n //pickStateButton.setVisibility(View.VISIBLE);\n //stateNameTextView.setVisibility(View.VISIBLE);\n stateNameTextView.setText(\"State\");\n cityName.setText(\"City\");\n // set text on main view\n flagImage.setBackgroundResource(country.getFlag());\n\n\n // GET STATES OF SELECTED COUNTRY\n for (int i = 0; i < stateObject.size(); i++) {\n // init state picker\n statePicker = new StatePicker.Builder().with(this).listener(this).build();\n State stateData = new State();\n if (stateObject.get(i).getCountryId() == countryID) {\n\n stateData.setStateId(stateObject.get(i).getStateId());\n stateData.setStateName(stateObject.get(i).getStateName());\n stateData.setCountryId(stateObject.get(i).getCountryId());\n stateData.setFlag(country.getFlag());\n statePicker.equalStateObject.add(stateData);\n }\n }\n }", "public void setCountry(java.lang.CharSequence value) {\n this.country = value;\n }", "@FXML\n public void changeCountry(ActionEvent event) {\n Countries countries = countryCB.getSelectionModel().getSelectedItem();\n\n showStatesProvinces(countries.getCountryID());\n }", "@OnClick(R.id.txt_country_code)\n void onCountryCodeClicked(){\n if (mCountryPickerDialog == null){\n mCountryPickerDialog = new CountryPickerDialog(this, (country, flagResId) -> {\n mSelectedCountry = country;\n setCountryCode(mSelectedCountry);\n });\n }\n\n mCountryPickerDialog.show();\n }", "@Override\n public void onCountrySelected(@NotNull Country country, View countryItemView) {\n\n mainCallBack.onCountrySelected(country, countryItemView);\n }", "public void valueChanged(ListSelectionEvent e) \n\t{\n\t\tif(!e.getValueIsAdjusting())\n\t\t{\n\t\t\t// gets values from your jList and added it to a list\n\t\t\tList values = spotView.getCountryJList().getSelectedValuesList();\n\t\t\tspotView.setSelectedCountry(values);\n\t\t\t\n\t\t\t//based on country selection, state needs to be updated\n\t\t\tspotView.UpdateStates(spotView.getSelectedCountry());\n\t\t}\n\n\t}", "public void setCountry(Country country) {\n this.country = country;\n }", "public void setCountry(String country) {\n this.country = country;\n }", "public void setCountry(String country) {\n this.country = country;\n }", "public void setCountry(String country) {\n this.country = country;\n }", "public void setCountry(String country) {\n this.country = country;\n }", "public void setCountry(String country) {\n this.country = country;\n }", "public void setCountry(String country) {\n this.country = country;\n }", "public void setCountry(String country) {\n this.country = country;\n }", "public void setCountryName(String value);", "public void onCountrySelect(ActionEvent actionEvent) {\n divisionCombo.getItems().clear();\n int selectedCountryId;\n if (countryCombo.getValue().equals(\"U.S\")) {\n selectedCountryId = 1;\n }\n else if (countryCombo.getValue().equals(\"UK\")) {\n selectedCountryId = 2;\n }\n else if (countryCombo.getValue().equals(\"Canada\")) {\n selectedCountryId = 3;\n }\n else {\n selectedCountryId = 0;\n }\n\n ObservableList<String> divisionNames = FXCollections.observableArrayList();\n for (FirstLevelDivisions f : DBFirstLevelDivisions.getAllDivisionsFromCountryID(selectedCountryId)) {\n divisionNames.add(f.getName());\n }\n divisionCombo.setItems(divisionNames);\n }", "public void setCountry(Integer country) {\n this.country = country;\n }", "public void setCountry(Integer country) {\n this.country = country;\n }", "public void setCountry(java.lang.String country) {\r\n this.country = country;\r\n }", "public void setCountry(java.lang.String country) {\n this.country = country;\n }", "public void setCountry(String country) {\r\n\t\tthis.country = country;\r\n\t}", "public void setCountry(String country) {\r\n\t\tthis.country = country;\r\n\t}", "public void setCountry(String country) {\r\n\t\tthis.country = country;\r\n\t}", "private void setCountrySelected(String countrySelected, String divisionSelected) {\n for (Countries country : countriesList) {\n if (country.getCountry().equals(countrySelected)){\n this.countryCB.setValue(country);\n this.firstLevelDivisions = FirstLevelDivisionsDAOImpl.getAllStatesProvinces(country.getCountryID());\n stateProvinceCB.setItems(this.firstLevelDivisions);\n setSelectedStateProvince(country.getCountryID(), divisionSelected);\n return;\n }\n }\n }", "public void setCountry(String value) {\n setAttributeInternal(COUNTRY, value);\n }", "public void setCountry(String value) {\n setAttributeInternal(COUNTRY, value);\n }", "public void setCountry(String value) {\n setAttributeInternal(COUNTRY, value);\n }", "public void CountryComboSelect(){\n errorLabel.setText(\"\");\n ObservableList<Divisions> divisionsList = DivisionsImp.getAllDivisions();\n ObservableList<Divisions> filteredDivisions = FXCollections.observableArrayList();\n if (countryCombo.getValue() != null){\n int countryId = countryCombo.getValue().getCountryId();\n for(Divisions division : divisionsList){\n if(division.getCountryId() == countryId){\n filteredDivisions.add(division);\n }\n }\n divisionCombo.setItems(filteredDivisions);\n divisionCombo.setValue(null);\n }\n }", "public void setCountry(java.lang.String Country) {\n this.Country = Country;\n }", "public Builder setCountry(\n java.lang.String value) {\n if (value == null) {\n throw new NullPointerException();\n }\n bitField0_ |= 0x00000080;\n country_ = value;\n onChanged();\n return this;\n }", "@Override\n\t\t\tpublic void onSelectCountry(String name, String code) {\n\t\t\t\tIntent intent = new Intent(contry.this, SignUpActivity.class);\n\t\t\t\t intent.putExtra(\"pays_iso\",code); \n\t\t\t\t intent.putExtra(\"pays_name\",name); \n\t\t\t\t intent.putExtra(\"device_key\",registrationId); \n\t\t\t\tstartActivityForResult(intent, 0);\n\t\t\t\toverridePendingTransition(R.anim.slidein, R.anim.slideout);\n\t\t\t\tfinish();\n\t\t\t}", "public void setCountry(String country) {\n\t\tthis.country = country;\n\t}", "public void setAddressCountry(String addressCountry) {\n this.addressCountry = addressCountry;\n }", "@Override\n\t\t\t\t\tpublic void onSelectCountry(String name, String code) {\n\t\t\t\t\t\tIntent intent = new Intent(contry.this, SignUpActivity.class);\n\t\t\t\t\t\t intent.putExtra(\"pays_iso\",code); \n\t\t\t\t\t\t intent.putExtra(\"pays_name\",name); \n\t\t\t\t\t\t intent.putExtra(\"device_key\",registrationId); \n\t\t\t\t\t\tstartActivityForResult(intent, 0);\n\t\t\t\t\t\toverridePendingTransition(R.anim.slidein, R.anim.slideout);\n\t\t\t\t\t\tfinish();\n\t\t\t\t\t}", "@Override\n public void onItemSelected(AdapterView<?> arg0, View arg1,\n int arg2, long arg3) {\n Country selectedCountry;\n country = new Country();\n if (!(ssWholeSale_Imported_Country.getSelectedItem() == null)) {\n selectedCountry = (Country) ssWholeSale_Imported_Country.getSelectedItem();\n app.setImportSugarCountryOfOrigin(selectedCountry);\n\n String country_id = (String) selectedCountry.getC_country_id();\n\n country = selectedCountry;\n\n }\n }", "private void ActionChooseCountry() {\n final AlertDialog.Builder dialog = new AlertDialog.Builder(getContext());\n dialog.setTitle(getString(R.string.dialog_title_choose_country));\n\n final List<String> countryNames = Arrays.asList(getResources().getStringArray(R.array.countries_names));\n final List<String> countryArgs = Arrays.asList(getResources().getStringArray(R.array.countries_arg));\n\n final ArrayAdapter<String> arrayAdapter = new ArrayAdapter<>(getContext(), android.R.layout.simple_list_item_1);\n arrayAdapter.addAll(countryNames);\n\n dialog.setNegativeButton(getString(R.string.dialog_btn_cancel), new DialogInterface.OnClickListener() {\n @Override\n public void onClick(DialogInterface dialogInterface, int i) {\n dialogInterface.dismiss();\n }\n });\n\n dialog.setAdapter(arrayAdapter, new DialogInterface.OnClickListener() {\n @Override\n public void onClick(DialogInterface dialogInterface, int i) {\n CoutryArg = countryArgs.get(i);\n\n tvChooseCountry.setText(countryNames.get(i));\n if (SourceId != null) {\n SourceId = null;\n tvChooseSource.setText(R.string.tv_pick_sourse);\n currentPage = 1;\n }\n }\n });\n dialog.show();\n }", "@Override\n\t\t\t\tpublic void onClick(View v) {\n\t\t\t\t\tshowCountrycode();\n\t\t\t\t}", "public void setCountry (java.lang.String country) {\n\t\tthis.country = country;\n\t}", "public void setDestinationCountry(String value) {\r\n this.destinationCountry = value;\r\n }", "public void setCountry(String country) {\r\n this.country = country.trim();\r\n }", "public com.luisjrz96.streaming.birthsgenerator.models.BirthInfo.Builder setCountry(java.lang.CharSequence value) {\n validate(fields()[2], value);\n this.country = value;\n fieldSetFlags()[2] = true;\n return this;\n }", "public String getCountry() {\r\n return this.country;\r\n }", "public void setCountryCode(String countryCode)\r\n\t{\r\n\t\tthis.countryCode = countryCode;\r\n\t}", "public void setCountryCode(int value) {\r\n\t\tthis.countryCode = value;\r\n\t}", "public void selectCountry() throws IOException {\n\t\tLoginSignupCompanyPage sp = new LoginSignupCompanyPage(driver);\n\t\tWebElement countryelement = driver.findElement(By.xpath(\"//select[@name='contact.countryCode']\"));\n\t\tSelect se = new Select(countryelement);\n\t\tse.selectByVisibleText(BasePage.getCellData(xlsxName, sheetName, 18, 0));\n\n\t}", "@Override\n\t\t\t\t\tpublic void onItemSelected(AdapterView<?> arg0, View arg1,\n\t\t\t\t\t\t\tint position, long id) {\n\t\t\t\t\t\tint itemlselectedposition = position;\n\t\t\t\t\t\tString countrycode = countrynameSpinner\n\t\t\t\t\t\t\t\t.getSelectedItem().toString();\n\n\t\t\t\t\t\tszBankCountryCode = bankcountrycodes[itemlselectedposition];\n\t\t\t\t\t}", "public void setCountryCode(String countryCode) {\n this.countryCode = countryCode;\n }", "void fetchCountryInformation();", "public final void setCountry(final String ccountry) {\n\t\tthis.country = ccountry;\n\t}", "private void setCountryCode(\n String value) {\n if (value == null) {\n throw new NullPointerException();\n }\n\n countryCode_ = value;\n }", "public void setCountryId(int value);", "public void setCountryId(String countryId) {\r\n this.countryId = countryId;\r\n }", "private void setSelectedStateProvince(int countryID, String divisionSelected) {\n for (FirstLevelDivisions division: firstLevelDivisions) {\n if (division.getCountryID() == countryID && division.getDivision().equals(divisionSelected)){\n stateProvinceCB.setValue(division);\n }\n\n }\n }", "@Override\n\t\tpublic void onClick(DialogInterface dialog, int which) {\n\t\t\tlastSelectCountryCode = which;\n\t\t\t((Button)(AccountForgetPSWActivity.this.findViewById(R.id.getpsw_choose_country_btn)))\n\t\t\t\t\t.setText(countryCodeManager.getCountryName(which));\n\t\t\tchooseCountryDialog.dismiss();\n\t\t}", "public void country(String num) {\r\n\t\tSelect selectcountry = new Select(country);\r\n\t\tselectcountry.deselectByVisibleText(num);\r\n\t\tsleep(1000);\r\n\r\n\t}", "public void setCountryCode(java.lang.String countryCode) {\n this.countryCode = countryCode;\n }", "public void setcountryCode(String countryCode) {\n this.countryCode = countryCode;\n }", "private void showStatesProvinces(int countryID){\n this.firstLevelDivisions = FirstLevelDivisionsDAOImpl.getAllStatesProvinces(countryID);\n if (countryID == 1){\n stateProvinceCB.setPromptText(\"Select A State\");\n }else{\n stateProvinceCB.setPromptText(\"Select A Province\");\n }\n stateProvinceCB.setItems(this.firstLevelDivisions);\n }", "public String getCountry() {\r\n return country;\r\n }", "public void setCountry_id(String country_id) {\n this.country_id = country_id;\n }", "public void actionPerformed(ActionEvent e) {\n\t\t\tcapitalBox.setText(getCapitalCity(countryBox.getSelectedItem().toString()));\n\t\t}", "public void setCountryName(String countryName) {\n this.countryName = countryName;\n }", "public void setCountryName(String countryName) {\n this.countryName = countryName;\n }", "private void setCountryFlag(View view, String country) {\n ImageView countryView = view.findViewById(R.id.collected_country);\n if (country != null) {\n String countryResource = String.format(\"country_%s\", country.toLowerCase());\n int id = mContext.getResources().getIdentifier(countryResource, \"drawable\", mContext.getPackageName());\n if (id != 0) {\n countryView.setImageResource(id);\n countryView.setVisibility(View.VISIBLE);\n return;\n }\n }\n countryView.setVisibility(View.GONE);\n }", "@Override\r\n\t\t\tpublic void onItemSelected(AdapterView<?> parent, View view, int position, long id) {\n\t\t\t\tCountry_ID = (Integer.parseInt(lst_countries.get(position).get(\"Country_ID\")));\r\n\t\t\t}", "public String getCountry() {\n return country;\n }", "@Override\n public void onItemSelected(AdapterView<?> parent, View view, int position, long id) {\n et_country = CountryNameSpinner.getSelectedItem().toString();\n et_mcode.setText(\"+\"+CountriesCode.get(position));\n }", "@Override\r\n\t\t\tpublic void vertexTraversed(VertexTraversalEvent<Country> e) {\n\t\t\t\t\r\n\t\t\t}", "public void setCountryFieldName(final String value) {\n setProperty(COUNTRY_FIELD_NAME_KEY, value);\n }", "@Override\n public void onMapClick(LatLng arg0) {\n try {\n Geocoder geo = new Geocoder(MapsActivity.this, Locale.getDefault());\n List<Address> add = geo.getFromLocation(arg0.latitude, arg0.longitude, 1);\n String selectedCountry;\n if (add.size() > 0) {\n selectedCountry = add.get(0).getCountryName();\n selectedStateOrCountry = selectedCountry;\n\n //Log.d(\"country\", selectedCountry);\n //For usa go with states . All other countries - it gives the capital\n if (selectedCountry.equalsIgnoreCase(\"United States\") ||\n selectedCountry.equalsIgnoreCase(\"US\")) {\n selectedStateOrCountry = add.get(0).getAdminArea();\n }\n //Log.d(\"state\", selectedStateOrCountry);\n ConvertTextToSpeech();\n }\n } catch (Exception e) {\n //Log.e(TAG, \"Failed to initialize map\", e);\n }\n }", "public void setCountryCode(String value) {\r\n setAttributeInternal(COUNTRYCODE, value);\r\n }", "@Override\n public void onItemSelected(AdapterView<?> adapter, View view,\n int position, long id) {\n chefRegCountry = countryList.get(position);\n countryid = countryId.get(position);\n\n if(!countryid.equalsIgnoreCase(\"-1\"))\n doStateList(countryid);\n }", "public void setCountryCode(String value) {\n setAttributeInternal(COUNTRYCODE, value);\n }", "public void setCountryCode(String value) {\n setAttributeInternal(COUNTRYCODE, value);\n }", "public String getCountry() {\n return country;\n }", "public CountryCode getCountry() {\n return country;\n }", "public void setCountryId(long countryId) {\n this.countryId = countryId;\n }", "public String getCountry() {\n return country;\n }", "public String getCountry() {\n return country;\n }", "public String getCountry() {\n return country;\n }", "public String getCountry() {\n return country;\n }", "public String getCountry() {\n return country;\n }", "public String getCountry() {\n return country;\n }", "public String getCountry() {\n return country;\n }", "public void setCountryId(java.lang.String countryId) {\r\n this.countryId = countryId;\r\n }", "static public void set_country_data(){\n\n\t\tEdit_row_window.attrs = new String[]{\"country name:\", \"area (1000 km^2):\", \"GDP per capita (1000 $):\",\n\t\t\t\t\"population (million):\", \"capital:\", \"GDP (billion $):\"};\n\t\tEdit_row_window.attr_vals = new String[]\n\t\t\t\t{Edit_row_window.selected[0].getText(1), Edit_row_window.selected[0].getText(2), \n\t\t\t\tEdit_row_window.selected[0].getText(3), Edit_row_window.selected[0].getText(4), \n\t\t\t\tEdit_row_window.selected[0].getText(5), Edit_row_window.selected[0].getText(6)};\n\t\t\n\t\tEdit_row_window.linked_query =\t\" select distinct l.id, l.name, l.num_links, l.population \" +\n\t\t\t\t\t\t\t\t\t\t\t\" from curr_places_locations l, \" +\n\t\t\t\t\t\t\t\t\t\t\t\" curr_places_location_country lc \" +\n\t\t\t\t\t\t\t\t\t\t\t\" where lc.location_id=l.id and lc.country_id=\"+Edit_row_window.id+\n\t\t\t\t\t\t\t\t\t\t\t\" order by num_links desc \";\n\t\t\t\t\n\t\tEdit_row_window.not_linked_query = \" select distinct l.id, l.name, l.num_links, l.population \" +\n\t\t\t\t\" from curr_places_locations l \";\n\t\t\n\t\tEdit_row_window.linked_attrs = new String[]{\"id\", \"location name\", \"rating\", \"population\"};\n\t\tEdit_row_window.label_min_parameter=\"min. population:\";\n\t\tEdit_row_window.linked_category_name = \"LOCATIONS\";\n\t}", "@FXML\n public void selectOneCountry(MouseEvent mouseEvent) {\n int countryIndex = lsv_ownedCountries.getSelectionModel().getSelectedIndex();\n ObservableList datalist = InfoRetriver.getAdjacentCountryObservablelist(Main.curRoundPlayerIndex, countryIndex);\n\n lsv_adjacentCountries.setItems(datalist);\n ListviewRenderer.renderCountryItems(lsv_adjacentCountries);\n }", "public Builder setCountryBytes(\n com.google.protobuf.ByteString value) {\n if (value == null) {\n throw new NullPointerException();\n }\n bitField0_ |= 0x00000080;\n country_ = value;\n onChanged();\n return this;\n }", "public void setCountryCode(String countryCode) {\r\n\t\t\tthis.countryCode = countryCode;\r\n\t\t}", "public Builder setCountryName(\n java.lang.String value) {\n if (value == null) {\n throw new NullPointerException();\n }\n \n countryName_ = value;\n onChanged();\n return this;\n }", "public String getCountry()\n {\n return country;\n }", "public String getCountry(){\n\t\treturn country;\n\t}", "public String getCountry(){\n\t\treturn country;\n\t}", "public String getCountry() {\r\n\t\treturn country;\r\n\t}", "public String getCountry() {\r\n\t\treturn country;\r\n\t}", "public String getCountry() {\r\n\t\treturn country;\r\n\t}", "public void setCountry(String country) {\n this.country = country == null ? null : country.trim();\n }" ]
[ "0.7400468", "0.7390081", "0.71376675", "0.71297646", "0.70937616", "0.7054839", "0.69229823", "0.68907064", "0.6813889", "0.6758525", "0.67171097", "0.67171097", "0.67171097", "0.67171097", "0.67171097", "0.67171097", "0.66870385", "0.66523165", "0.66164315", "0.6602865", "0.6602865", "0.65826505", "0.65541756", "0.6511114", "0.6511114", "0.6511114", "0.65062803", "0.65061694", "0.65061694", "0.65061694", "0.64681697", "0.64643055", "0.6447743", "0.6396106", "0.6369836", "0.6298958", "0.62882143", "0.6276466", "0.6264254", "0.62415034", "0.62269574", "0.6223959", "0.6170935", "0.6129543", "0.6103183", "0.6085532", "0.6079832", "0.60667014", "0.60609174", "0.6048605", "0.60484093", "0.60354114", "0.6032738", "0.60175884", "0.60124385", "0.6010061", "0.60072005", "0.600563", "0.6001832", "0.5990153", "0.59562254", "0.595071", "0.5946765", "0.59324044", "0.5910881", "0.5910881", "0.59093815", "0.5899888", "0.5898954", "0.5897577", "0.58959144", "0.5882718", "0.5882305", "0.58776665", "0.58709306", "0.5870157", "0.5870157", "0.58577037", "0.5847889", "0.5845553", "0.584153", "0.584153", "0.584153", "0.584153", "0.584153", "0.584153", "0.584153", "0.58364624", "0.58363307", "0.58337325", "0.5826447", "0.58114415", "0.5793973", "0.57911825", "0.5784971", "0.5784971", "0.5782944", "0.5782944", "0.5782944", "0.57763624" ]
0.6847116
8
Helper functions checks if a ComboBox is empty
private boolean isComboBoxEmpty(String entry){ return entry == null || entry.isBlank(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\n\tpublic boolean isEmpty() {\n\t\treturn (getSelection() == null);\n\t}", "public boolean hasValidItemSelected() {\n return !(autoComplete.getSelection() == null || ((Comboitem)autoComplete.getSelection()).getValue() == null);\n }", "private boolean noFieldsEmpty() {\n if ( nameField.getText().isEmpty()\n || addressField.getText().isEmpty()\n || cityField.getText().isEmpty()\n || countryComboBox.getSelectionModel().getSelectedItem() == null\n || divisionComboBox.getSelectionModel().getSelectedItem() == null\n || postalField.getText().isEmpty()\n || phoneField.getText().isEmpty() ) {\n errorLabel.setText(rb.getString(\"fieldBlank\"));\n return false;\n }\n return true;\n }", "public boolean isSelectionEmpty()\n/* */ {\n/* 215 */ return this.selectedDates.isEmpty();\n/* */ }", "private boolean campiVuoti(){\n return nomeVarTextField.getText().equals(\"\") || tipoVarComboBox.getSelectedIndex() == -1;\n }", "private boolean emptyBoxes() {\n return (FirstName.getText().toString().isEmpty() || LastName.getText().toString().isEmpty() ||\n ID.getText().toString().isEmpty() || PhoneNumber.getText().toString().isEmpty() ||\n EmailAddress.getText().toString().isEmpty() || CreditCard.getText().toString().isEmpty() ||\n Password.getText().toString().isEmpty());\n }", "public boolean isFilled() {\n return(!this.getText().trim().equals(\"\"));\n }", "private boolean haveEmptyField() {\n return getTextID(FIRST_NAME).isEmpty() ||\n getTextID(LAST_NAME).isEmpty() ||\n getTextID(ADDRESS).isEmpty();\n }", "@Override\n public boolean isEmpty() {\n return mBaseAdapter.isEmpty();\n }", "private boolean check()\n\t{\n\t\tComponent[] comp = contentPanel.getComponents();\n\t\tint check=0;\n\t\tfor(Component c:comp)\n\t\t{\n\t\t\tif(c instanceof JTextField)\n\t\t\t{\n\t\t\t\tif(((JTextField)c).getText().trim().equals(\"\"))\n\t\t\t\t\tcheck++;\n\t\t\t}\n\t\t\t\t\n\t\t}\n\t\t\n\t\treturn check==0 ? true : false;\n\t}", "@Override\n public boolean isEmpty(){\n return itemCount == 0;\n }", "public boolean isEmpty(){\n return(numItems == 0);\n }", "public boolean isSelectionEmpty() {\n\t\t\treturn tablecolselectmodel.isSelectionEmpty();\n\t\t}", "private boolean isAnyEmpty(){\n //get everything\n return (fname.getText().toString().trim().length() == 0)\n || (lname.getText().toString().trim().length() == 0)\n || (email.getText().toString().trim().length() == 0)\n || (password.getText().toString().trim().length() == 0);\n }", "public boolean isEmpty(){\n return (numItems==0);\n }", "public boolean textboxIsEmpty(EditText editText) {\n return editText.getText().toString().trim().length() == 0;\n }", "public boolean isEmpty(){\n return itemCount == 0;\n }", "@Override\n\tpublic boolean isEmpty() {\n\t\treturn bst.isEmpty();\n\t}", "public boolean isEmpty() {\n\t\treturn allItems.size() == 0;\n\t}", "private boolean isFormEmpty(){\n if(pickupLocationInput.getText().toString().length() != 0){\n return false;\n }\n\n if(destinationInput.getText().toString().length() != 0){\n return false;\n }\n\n if(notesInput.getText().toString().length() != 0){\n return false;\n }\n\n return true;\n }", "private Boolean isFieldEmpty(EditText field) {\n return field.getText().toString().trim().equals(\"\");\n }", "@Override\n public boolean isEmpty() {\n return this.size==0;\n }", "private boolean isEmpty() {\n\t\treturn size() == 0;\n\t}", "public boolean isEmpty()\r\n\t{\r\n\t\treturn numItems == 0 ;\r\n\t}", "@Override\n\tpublic boolean isEmpty() {\n\t\treturn frontier.isEmpty();\n\t}", "public boolean isEmpty(){\n\t\treturn setCommands.isEmpty();\n\t}", "public boolean isEmpty() {\n // YOUR CODE HERE\n return true;\n }", "boolean checkIfEmpty();", "public boolean isEmpty(){\n\t\treturn super.isEmpty();\n\t}", "@Override\n public boolean isEmpty() {\n return this.size == 0;\n }", "@Override\r\n\tpublic boolean isEmpty() {\n\t\treturn this.size == 0;\r\n\t}", "private boolean isEmpty() { return getSize() == 0; }", "@Override\n\tpublic boolean isEmpty() {\n\t\treturn (getSize() == 0);\n\t}", "@Override\n\tpublic boolean isEmpty() {\n\t\treturn(size() == 0);\n\t}", "public boolean isEmpty() {\r\n return NumItems == 0;\r\n }", "public void clearCombo() {\n\t\tcombo = false;\n\t}", "@Override\n public boolean isEmpty() {\n return size() == 0;\n }", "@Override\n public boolean isEmpty() {\n return size() == 0;\n }", "@Override\n public boolean isEmpty() {\n return size() == 0;\n }", "@Override\n public boolean isEmpty() {\n return size() == 0;\n }", "@Override\n public boolean isEmpty() {\n return size() == 0;\n }", "private boolean isEmptyField (EditText editText){\n boolean result = editText.getText().toString().length() <= 0;\n if (result)\n Toast.makeText(UserSignUp.this, \"Fill all fields!\", Toast.LENGTH_SHORT).show();\n return result;\n }", "protected boolean checkEmptyList(){\n boolean emptyArray = true;\n String empty= alertList.get(AppCSTR.FIRST_ELEMENT).get(AppCSTR.NAME);\n if(!empty.equals(\"null\") && !empty.equals(\"\")) {\n emptyArray = false;\n }\n return emptyArray;\n }", "public boolean isEmpty() {\r\n\t\tif (currentIndex == 0)\r\n\t\t\treturn true;\r\n\t\treturn false;\r\n\t}", "@Override\r\n\tpublic boolean isEmpty() {\r\n\t\treturn size() == 0;\r\n\t}", "public boolean hasValidAnnotatedItemSelected() {\n return !(autoComplete.getSelection() == null\n || ((Comboitem)autoComplete.getSelection()).getAnnotatedProperties() == null\n || ((Comboitem)autoComplete.getSelection()).getAnnotatedProperties().isEmpty());\n }", "public boolean isEmpty() {\n\t\treturn super.isEmpty();\n\t}", "boolean isItEmpty(){\n\t\t\tif (this.items.isEmpty() && (this.receptacle.isEmpty() || findSpecialtyContainers())){//if there's nothing in there.\n\t\t\t\tSystem.out.println(\"\\nThere's nothing here to do anything with.\");\n\t\t\t\treturn true;}\n\t\t\treturn false;\n\t\t}", "@Override\n public boolean isEmpty()\n {\n return false;\n }", "@Override\n public boolean isEmpty() { return true; }", "public boolean isEmpty() {\n return (this.text == null);\n }", "@Override\npublic boolean isEmpty() {\n\treturn false;\n}", "public static void isValid(JComboBox comboBox) {\n if (comboBox.getSelectedItem() == null) {\n throw new IllegalArgumentException();\n }\n }", "public boolean isEmpty() {\n \tif (numItems==0) {\n \t\treturn true;\n \t}\n \treturn false;\n }", "@Override\n public boolean isEmpty() {\n return mCursor == null || mCursor.getCount() < 1;\n }", "public boolean isEmpty() {\n\t\treturn (_items.size() == 0);\n\t}", "protected static void verifyNotEmpty(Text field, String fieldName)\r\n\t\t\tthrows MusicTunesException {\r\n\t\tif (field.getText().length() == 0) {\r\n\t\t\tfield.setFocus();\r\n\t\t\tfield.selectAll();\r\n\t\t\tthrow new MusicTunesException(fieldName\r\n\t\t\t\t\t+ \" field must be filled!\");\r\n\t\t}\r\n\t}", "public boolean isEmpty() {\r\n return items.isEmpty();\r\n }", "public boolean isEmpty() {\n return userListCtrl.isEmpty();\n }", "public boolean empty() {\r\n\r\n\t\tif(item_count>0)\r\n\t\t\treturn false;\r\n\t\treturn true;\r\n\t}", "@Override\n public boolean isEmpty() {\n return this.count() == 0;\n }", "public boolean isSelectionEmpty() {\n return selectionEmpty;\n }", "private boolean CheckParkSelection() {\n\t\tif (Park_ComboBox.getSelectionModel().isEmpty()) {\n\t\t\tif (!Park_ComboBox.getStyleClass().contains(\"error\"))\n\t\t\t\tPark_ComboBox.getStyleClass().add(\"error\");\n\t\t\tParkNote.setText(\"* Select park\");\n\t\t\treturn false;\n\t\t}\n\t\tPark_ComboBox.getStyleClass().remove(\"error\");\n\t\tParkNote.setText(\"*\");\n\t\treturn true;\n\t}", "public boolean isEmpty() {\n return items.isEmpty();\n }", "public boolean isEmpty() {\n return items.isEmpty();\n }", "@Override\n public boolean isEmpty() {\n return size()==0;\n }", "public boolean isEmpty() {\n return helpers.isEmpty();\n }", "private Boolean checkForEmptyList() {\n Boolean emptyListAvailable = tin_perLitrePrice.getText().toString().trim().isEmpty() ||\n tin_fuelQuantityLitres.getText().toString().trim().isEmpty() ||\n tin_totalFuelPrice.getText().toString().trim().isEmpty() ||\n tin_currentKm.getText().toString().trim().isEmpty() ||\n tin_startingKm.getText().toString().trim().isEmpty() ||\n tin_distanceCovered.getText().toString().trim().isEmpty() ||\n tv_calculatedAverage_addEdit.getText().toString().trim().isEmpty() ||\n tv_coverableDistance_addEdit.getText().toString().trim().isEmpty() ||\n tv_nextFuelFill_addEdit.getText().toString().trim().isEmpty();\n\n if (emptyListAvailable) {\n validationList(); // set error messages\n }\n Log.d(TAG, \"checkForEmptyList: emptyListAvailable = \" + emptyListAvailable);\n\n\n return emptyListAvailable; //\n }", "@Override\n public boolean isEmpty() {\n return _size == 0;\n }", "public static boolean isEmpty (ITextUnit textUnit) {\r\n \t\treturn ((textUnit == null) || textUnit.getSource().isEmpty());\r\n \t}", "private boolean isEmpty() {\n\t\treturn (size == 0);\n\t}", "public boolean isEmpty(){\r\n\t\treturn size() == 0;\r\n\t}", "boolean isEmpty(){\n return (book == null);\n }", "@Override\n\t\tpublic boolean isEmpty() {\n\t\t\treturn false;\n\t\t}", "@Override\n\t\tpublic boolean isEmpty() {\n\t\t\treturn false;\n\t\t}", "private void checkForEmptyFields() throws EmptyTextFieldException {\n\n if (date == null || title.equals(\"\") || function.equals(\"\") || protagonist.equals(\"\")\n || source.equals(\"\") || references.equals(\"\") || description.equals(\"\")) {\n throw new EmptyTextFieldException();\n }\n }", "@Override\n\tpublic boolean isEmpty() {\n\t\treturn size == 0;\n\t}", "@Override\n\tpublic boolean isEmpty() {\n\t\treturn size == 0;\n\t}", "public boolean check(){\n for(TextField texts:textFields){\n if(texts.getText().isEmpty()){\n return false;\n }\n }\n return true;\n }", "@Override\n\tpublic boolean isEmpty() {\n\t\treturn false;\n\t}", "@Override\n\tpublic boolean isEmpty() {\n\t\treturn false;\n\t}", "@Override\n\tpublic boolean isEmpty() {\n\t\treturn false;\n\t}", "@Override\n\tpublic boolean isEmpty() {\n\t\treturn false;\n\t}", "@Override\n\tpublic boolean isEmpty() {\n\t\treturn false;\n\t}", "@Override\n\tpublic boolean isEmpty() {\n\t\treturn false;\n\t}", "@Override\n\tpublic boolean isEmpty() {\n\t\treturn false;\n\t}", "public boolean isEmpty(){\n return this.size()==0;\n }", "@Override\n public boolean isEmpty() {\n return false;\n }", "public boolean isEmpty() {\n\t\tString v = getValue();\n\t\treturn v == null || v.isEmpty();\n\t}", "public boolean isEmpty(EditText etText){\n return etText.getText().toString().length() == 0;\n }", "public boolean is_empty() {\n\t\treturn false;\n\t}", "public abstract boolean IsEmpty();", "@Override\n\t\t\tpublic boolean isEmpty() {\n\t\t\t\treturn false;\n\t\t\t}", "@Override\r\n\tpublic boolean isEmpty() {\n\t\treturn lvConsumerIndex() == lvProducerIndex();\r\n\t}", "@Override\n public boolean isEmpty() {\n return size == 0;\n }", "@Override\n public boolean isEmpty() {\n return size == 0;\n }", "@Override\n public boolean isEmpty() {\n return size == 0;\n }", "@Override\n public boolean isEmpty() {\n return size == 0;\n }", "@Override\n public boolean isEmpty() {\n return size == 0;\n }", "public boolean empty() {\n\t\treturn (size() <= 0);\n\t}" ]
[ "0.6757778", "0.67239684", "0.65283036", "0.64282876", "0.64016885", "0.63683957", "0.63043356", "0.6249262", "0.62469596", "0.6132233", "0.6075939", "0.605766", "0.603656", "0.60344285", "0.6032206", "0.6017614", "0.6003121", "0.59844506", "0.59668875", "0.596504", "0.5963279", "0.59418625", "0.59401196", "0.5937424", "0.59321356", "0.5927555", "0.5912515", "0.59097606", "0.59043956", "0.5898788", "0.58950096", "0.5886339", "0.5885072", "0.5883968", "0.5876695", "0.5870896", "0.5868941", "0.5868941", "0.5868941", "0.5868941", "0.5868941", "0.58672816", "0.5864151", "0.5862857", "0.5861344", "0.5861205", "0.5855538", "0.58461255", "0.58377415", "0.58362037", "0.5834307", "0.58287406", "0.58254355", "0.58197755", "0.58189166", "0.5812591", "0.5806748", "0.58040005", "0.5802106", "0.58014345", "0.5800324", "0.57993454", "0.57992464", "0.57937753", "0.57937753", "0.57934964", "0.57898575", "0.57833624", "0.57794785", "0.5779325", "0.5773862", "0.5770642", "0.57681304", "0.57655907", "0.57655907", "0.5764437", "0.5764168", "0.5764168", "0.5762285", "0.5760171", "0.5760171", "0.5760171", "0.5760171", "0.5760171", "0.5760171", "0.5760171", "0.57595915", "0.57460475", "0.57407314", "0.57405967", "0.57404035", "0.573904", "0.5735529", "0.57314724", "0.5719608", "0.5719608", "0.5719608", "0.5719608", "0.5719608", "0.57194185" ]
0.8379461
0
validation Input validation and error message handler for T3 Controller
private boolean validateInputs(String iStart, String iEnd, String country, String type) { hideErrors(); int validStart; int validEnd; boolean valid = true; // //will not occur due to UI interface // if (isComboBoxEmpty(type)) { // valid = false; // T3_type_error_Text.setVisible(true); // } if (isComboBoxEmpty(country)) { valid = false; T3_country_error_Text.setVisible(true); } //checking if start year and end year are set if (isComboBoxEmpty(iStart)){ //start is empty T3_start_year_error_Text.setVisible(true); valid = false; } if (isComboBoxEmpty(iEnd)){ //end is empty T3_end_year_error_Text.setVisible(true); valid = false; } if (valid){ //if years are not empty and valid perform further testing //fetch valid data range Pair<String,String> validRange = DatasetHandler.getValidRange(type, country); validStart = Integer.parseInt(validRange.getKey()); validEnd = Integer.parseInt(validRange.getValue()); //check year range validity int start = Integer.parseInt(iStart); int end = Integer.parseInt(iEnd); if (start>=end) { T3_range_error_Text.setText("Start year should be < end year"); T3_range_error_Text.setVisible(true); valid=false; } // //will not occur due to UI interface // else if (start<validStart) { // T3_range_error_Text.setText("Start year should be >= " + Integer.toString(validStart)); // T3_range_error_Text.setVisible(true); // valid=false; // }else if (end>validEnd) { // T3_range_error_Text.setText("End year should be <= " + Integer.toString(validEnd)); // T3_range_error_Text.setVisible(true); // valid=false; // } } // //will not occur due to UI interface // if(isComboBoxEmpty(type)) { // //if type is not set // T3_type_error_Text.setVisible(true); // } if(isComboBoxEmpty(country)) { //if country is not set T3_country_error_Text.setVisible(true); } return valid; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private void validateInputParameters(){\n\n }", "@Override\n\tprotected void validate(Controller c) {\n\n\t}", "protected void validateInput()\r\n\t{\r\n\t\tString errorMessage = null;\r\n\t\tif ( validator != null ) {\r\n\t\t\terrorMessage = validator.isValid(text.getText());\r\n\t\t}\r\n\t\t// Bug 16256: important not to treat \"\" (blank error) the same as null\r\n\t\t// (no error)\r\n\t\tsetErrorMessage(errorMessage);\r\n\t}", "public ActionErrors validate(ActionMapping mapping, HttpServletRequest request) {\r\n ActionErrors actionErrors = new ActionErrors();\r\n try {\r\n UserDAO gObjUserDAO = new UserDAOImpl();\r\n if (userFirstName == null || userFirstName.length() < 1) {\r\n\r\n actionErrors.add(\"userFirstName\", new ActionMessage(\"error.userFirstName\"));\r\n // TODO: add 'error.name.required' key to your resources\r\n }\r\n if (getUserName() == null || getUserName().length() < 1) {\r\n\r\n actionErrors.add(\"userName\", new ActionMessage(\"error.userName\"));\r\n // TODO: add 'error.name.required' key to your resources\r\n }\r\n if (getUserPassword() == null || getUserPassword().length() < 1) {\r\n actionErrors.add(\"userPassword\", new ActionMessage(\"error.userPassword\"));\r\n // TODO: add 'error.name.required' key to your resources\r\n }\r\n if (getUserActivationCode() == null || getUserActivationCode().length() < 1) {\r\n actionErrors.add(\"userActivationCode\", new ActionMessage(\"error.userActivationCode\"));\r\n // TODO: add 'error.name.required' key to your resources\r\n }\r\n if (getUserName() != null && getUserName().length() > 0) {\r\n\r\n List<CmnUserMst> lLstCmnUserMst = new ArrayList<CmnUserMst>();\r\n lLstCmnUserMst = gObjUserDAO.validateUserName(getUserName().toUpperCase());\r\n if (!lLstCmnUserMst.isEmpty()) {\r\n actionErrors.add(\"userName\", new ActionMessage(\"error.duplicateUserName\"));\r\n\r\n }\r\n\r\n }\r\n if (getUserActivationCode() != null && getUserActivationCode().length() > 0) {\r\n\r\n System.out.println(\"userType.....\" + userType);\r\n logger.info(\"userType......\" + userType);\r\n if (userType != null && !\"\".equals(userType) && \"H\".equals(userType)) {\r\n roleActivationMpgList = gObjUserDAO.validateActivationCodeForHR(getUserActivationCode());\r\n if (roleActivationMpgList != null && !roleActivationMpgList.isEmpty()) {\r\n PcHrDtls lObjPcHrDtls = (PcHrDtls) roleActivationMpgList.get(0);\r\n universityId = lObjPcHrDtls.getUniversityId();\r\n }\r\n }\r\n else if (userType != null && !\"\".equals(userType) && (\"S\".equals(userType) || \"A\".equals(userType) || \"F\".equals(userType))) {\r\n roleActivationMpgList = gObjUserDAO.validateActnCodeForStudOrAlumniOfFaculty(userType,userActivationCode);\r\n if(roleActivationMpgList != null && !roleActivationMpgList.isEmpty())\r\n {\r\n List lLstResult = gObjUserDAO.validateActivationCodeWithExistingCode(userActivationCode);\r\n if(lLstResult != null && !lLstResult.isEmpty())\r\n {\r\n actionErrors.add(\"userActivationCode\", new ActionMessage(\"error.validateUserActivationCodeWithExistingCode\")); \r\n }\r\n else\r\n {\r\n TmpUserExcelData lObjTmpUserExcelData = (TmpUserExcelData) roleActivationMpgList.get(0);\r\n universityId = lObjTmpUserExcelData.getUniversityId();\r\n }\r\n }\r\n } \r\n else {\r\n roleActivationMpgList = gObjUserDAO.validateActivationCode(getUserActivationCode());\r\n if (roleActivationMpgList != null && !roleActivationMpgList.isEmpty()) {\r\n CmnRoleActivationMpg lObjCmnRoleActivationMpg = (CmnRoleActivationMpg) roleActivationMpgList.get(0);\r\n universityId = lObjCmnRoleActivationMpg.getUniversityId();\r\n }\r\n }\r\n\r\n if (roleActivationMpgList == null || roleActivationMpgList.isEmpty()) {\r\n actionErrors.add(\"userActivationCode\", new ActionMessage(\"error.validateUserActivationCode\"));\r\n\r\n }\r\n }\r\n request.setAttribute(\"fromFlag\", \"signUp\");\r\n } catch (Exception ex) {\r\n logger.error(\"Error while validating user data : \" + ex, ex);\r\n }\r\n return actionErrors;\r\n }", "ValidationResponse validate();", "private boolean checkInputFields(){\r\n\t\tString allertMsg = \"Invalid input: \" + System.getProperty(\"line.separator\");\r\n\t\t\r\n\t\t//Check input for MCS text field\r\n\t\ttry{\r\n\t\t\tFloat testValue = Float.parseFloat(m_MCSTf.getText());\r\n\t\t\tif(testValue < 0 || testValue > 1)\r\n\t\t\t\tthrow new NumberFormatException();\r\n\t\t}catch (NumberFormatException e){\r\n\t\t\tallertMsg += \"Please enter a number between 0 and 1 as a MCS score.\" + System.getProperty(\"line.separator\");\r\n\t\t}\r\n\t\t//Check input for relevance score weight and coherence score weight text fields\r\n\t\ttry{\r\n\t\t\tFloat relScoreW = Float.parseFloat(m_RelScoreTf.getText());\r\n\t\t\tFloat cohScoreW = Float.parseFloat(m_CohScoreTf.getText());\r\n\t\t\tif(relScoreW < 0 || relScoreW > 1)\r\n\t\t\t\tthrow new NumberFormatException();\r\n\t\t\tif(cohScoreW < 0 || cohScoreW > 1)\r\n\t\t\t\tthrow new NumberFormatException();\r\n\t\t\tif((relScoreW + cohScoreW) != 1)\r\n\t\t\t\tthrow new NumberFormatException();\r\n\t\t}catch (NumberFormatException e){\r\n\t\t\tallertMsg += \"Please enter a number between 0 and 1 as a weight for relevance and coherence score.\" + System.getProperty(\"line.separator\");\r\n\t\t\tallertMsg += \"Sum of the weights for relevance and coherence score must be 1.\" + System.getProperty(\"line.separator\");\r\n\t\t}\r\n\t\t//Check input for MCS text field\r\n\t\ttry{\r\n\t\t\tFloat testValue = Float.parseFloat(m_KeyTf.getText());\r\n\t\t\tif(testValue < 0)\r\n\t\t\t\tthrow new NumberFormatException();\r\n\t\t}catch (NumberFormatException e){\r\n\t\t\tallertMsg += \"Please enter a positive number as multiplier for keyword concepts.\" + System.getProperty(\"line.separator\");\r\n\t\t}\r\n\t\t//Check input for category confidence weight\r\n\t\ttry{\r\n\t\t\tFloat testValue = Float.parseFloat(m_CatConfTf.getText());\r\n\t\t\tif(testValue < 0)\r\n\t\t\t\tthrow new NumberFormatException();\r\n\t\t}catch (NumberFormatException e){\r\n\t\t\tallertMsg += \"Please enter a positive number as a weight for the weight of the category confidence of concepts.\" + System.getProperty(\"line.separator\");\r\n\t\t}\r\n\t\t//Check input for weight of repeated concepts\r\n\t\ttry{\r\n\t\t\tFloat testValue = Float.parseFloat(m_RepeatTf.getText());\r\n\t\t\tif(testValue < 0)\r\n\t\t\t\tthrow new NumberFormatException();\r\n\t\t}catch (NumberFormatException e){\r\n\t\t\tallertMsg += \"Please enter a positive number as a weight for repeated concepts.\" + System.getProperty(\"line.separator\");\r\n\t\t}\r\n\t\t//Check input for number of output categories\r\n\t\ttry{\r\n\t\t\tInteger testValue = Integer.parseInt(m_MaxCatsTf.getText());\r\n\t\t\tif(testValue < 1)\r\n\t\t\t\tthrow new NumberFormatException();\r\n\t\t}catch (NumberFormatException e){\r\n\t\t\tallertMsg += \"Please enter a positive number for the maximum number of output categories.\" + System.getProperty(\"line.separator\");\r\n\t\t}\r\n\t\ttry{\r\n\t\t\tInteger testValue = Integer.parseInt(m_MinCatsTf.getText());\r\n\t\t\tif(testValue < 1)\r\n\t\t\t\tthrow new NumberFormatException();\r\n\t\t}catch (NumberFormatException e){\r\n\t\t\tallertMsg += \"Please enter a positive number for the minimum number of output categories.\" + System.getProperty(\"line.separator\");\r\n\t\t}\r\n\t\ttry{\r\n\t\t\tFloat testValue = Float.parseFloat(m_MinCatScoreTf.getText());\r\n\t\t\tif(testValue < 0.0f || testValue > 1.0f)\r\n\t\t\t\tthrow new NumberFormatException();\r\n\t\t}catch (NumberFormatException e){\r\n\t\t\tallertMsg += \"Please enter a positive number between 0 and 1 as minimum category score.\" + System.getProperty(\"line.separator\");\r\n\t\t}\r\n\t\tif(allertMsg.length() > 18){\r\n\t\t\tAlert alert = new Alert(AlertType.ERROR);\r\n\t\t\talert.setContentText(allertMsg);\r\n\t\t\talert.showAndWait();\r\n\t\t\treturn false;\r\n\t\t}\r\n\t\treturn true;\r\n\t}", "public abstract ModelAndView handleValidForm(HttpServletRequest req, HttpServletResponse res, Object inputCommand, BindException be) throws Throwable;", "@Override\n\tprotected void validators() {\n\t\tString nsrmc = getDj_nsrxx().getNsrmc();\n\n\t\tif (ValidateUtils.isNullOrEmpty(nsrmc)) {\n\t\t\tthis.setSystemMessage(\"纳税人名称不能为空\", true, null);\n\t\t}\n\n\t}", "@Override\r\n\tprotected void validateData(ActionMapping arg0, HttpServletRequest arg1) {\n\t\t\r\n\t}", "public void validate() {}", "void onBoardUser(@Valid String x,HttpServletRequest request)throws Exception;", "protected void check() throws IOException, ServletException {\n if(value.length()==0)\n error(\"please specify at least one component\");\n else {\n \t\t//TODO add more checks\n \t\tok();\n }\n }", "@Override\n protected boolean validate(HttpServletRequest request) {\n\t\tlog.debug(\"ContectCtl validate method start\");\n boolean pass = true;\n\n if (DataValidator.isNull(request.getParameter(\"name\"))) {\n request.setAttribute(\"name\",\n PropertyReader.getValue(\"error.require\", \"Name\"));\n pass = false;\n }else if (!DataValidator.isName(request.getParameter(\"name\"))) {\n\t\t\trequest.setAttribute(\"name\",\n\t\t\t\t\tPropertyReader.getValue(\"error.name\", \"Name\"));\n\t\t\tpass = false;\n\t\t}\n \n if (DataValidator.isNull(request.getParameter(\"email\"))) {\n\t\t\trequest.setAttribute(\"email\",\n\t\t\t\t\tPropertyReader.getValue(\"error.require\", \"Email Address\"));\n\t\t\tpass = false;\n\t\t} else if (!DataValidator.isEmail(request.getParameter(\"email\"))) {\n\t\t\trequest.setAttribute(\"email\",\n\t\t\t\t\tPropertyReader.getValue(\"error.email\", \"Email Address\"));\n\t\t\tpass = false;\n\t\t}\n\n if (DataValidator.isNull(request.getParameter(\"message\"))) {\n request.setAttribute(\"message\",\n PropertyReader.getValue(\"error.require\", \"Message\"));\n pass = false;\n }\n\n log.debug(\"ContectCtl validate method end\");\n return pass;\n }", "private boolean validateInput(){\n Window owner=root.getScene().getWindow();\n inputFileds.addAll(txtfn,txtln,txtsurname,txtDOB,txtResidence,txtMobile,txtID,username);\n for (TextField textField : inputFileds) {\n if(textField.getText().isEmpty()){\n //set css stroke\n Dialog.showMessageDialog(owner,\"Missing Details\",\"Invalid Input\",DialogIcon.WARNING);\n textField.requestFocus();\n return false;\n }\n }\n inputFileds.removeAll(txtDOB,txtMobile,username);\n for (TextField textField : inputFileds) {\n if(textField.getText().length()>30){\n //set css stroke\n Dialog.showMessageDialog(owner,\"Sorry the text you entered can not be greater that 30 characters\",\"Text too Long\",DialogIcon.WARNING);\n textField.requestFocus();\n return false;\n }\n }\n if(username.getText().length()>20 || username.getText().length()<4){\n Dialog.showMessageDialog(owner, \"Sorry your Username has to be More than 3 Characters and can not Exceed 20 Charchaters\", \"Invalid input\",DialogIcon.WARNING);\n username.requestFocus();\n return false;\n }\n if(pass.getText().isEmpty()){\n Dialog.showMessageDialog(owner,\"Missing Details\",\"Invalid Input\",DialogIcon.WARNING);\n pass.requestFocus();\n return false;\n }\n if(pass.getText().length()>20 || pass.getText().length()<4){\n Dialog.showMessageDialog(owner, \"Sorry your Password has to be More than 3 Characters and can not Exceed 20 Charchaters\", \"Invalid Input\",DialogIcon.WARNING);\n pass.requestFocus();\n return false;\n }\n SimpleDateFormat dateFormat = new SimpleDateFormat(\"dd/MM/yyyy\");\n SimpleDateFormat yearFormat = new SimpleDateFormat(\"yyyy\");\n try {\n date = dateFormat.parse(txtDOB.getText());\n Calendar cal=Calendar.getInstance();\n int year=Integer.parseInt(yearFormat.format(date));\n if (year <= 1900 || year>cal.get(Calendar.YEAR)) {\n Dialog.showMessageDialog(owner,\"Invalid Date of Birth\", \"Invalid Input\",DialogIcon.WARNING);\n txtDOB.requestFocus();\n return false;\n }\n String initialEntry=txtDOB.getText();\n String parsedValue=dateFormat.format(date);\n if(!initialEntry.equals(parsedValue)){\n Dialog.showMessageDialog(owner, \"Note your Date of Birth has been corrected\", \"Date Corrected\",DialogIcon.INFORMATION);\n }\n txtDOB.setText(dateFormat.format(date));\n } catch (ParseException ex) {\n Dialog.showMessageDialog(owner,\"Invalid Date of Birth\", \"Invalid Input\",DialogIcon.WARNING);\n txtDOB.requestFocus();\n return false;\n }\n try {\n int mobile=Integer.parseInt(txtMobile.getText());\n } catch (NumberFormatException e) {\n Dialog.showMessageDialog(owner, \"Invalid Mobile Number\", \"Invalid data\",DialogIcon.WARNING);\n txtMobile.requestFocus();\n return false;\n }\n if(txtMobile.getText().length() != 10){\n Dialog.showMessageDialog(owner, \"Sorry your Mobile Number is invalid\", \"Invalid input\",DialogIcon.WARNING);\n txtMobile.requestFocus();\n return false;\n }\n String sql=\"select Username,Password from users where Username=?\";\n try(PreparedStatement prstmt=con.prepareStatement(sql)) {\n prstmt.setString(1, username.getText());\n ResultSet rs=prstmt.executeQuery();\n if(rs.next()){\n Dialog.showMessageDialog(owner, \"Sorry Username already exists\\n Please change to different Username\", \"Username Exists\",DialogIcon.WARNING);\n username.requestFocus();\n return false;\n }\n rs.close();\n } catch (SQLException e) {\n System.err.println(e);\n }\n return true;\n }", "public void validateInputs(ActionEvent actionEvent) {\n //retrieve the inputs\n try {\n productNameInput = productNameField.getText();\n if (productNameInput.equals(\"\")) {\n throw new myExceptions(\"Product Name: Enter a string.\\n\");\n }\n }\n catch (myExceptions ex) {\n errorMessageContainer += ex.getMessage();\n isInputValid = false;\n }\n\n try {\n productPriceInput = Double.parseDouble(productPriceField.getText());\n if (productPriceField.getText().equals(\"\")) {\n throw new myExceptions(\"Price field: enter a value..\\n\");\n }\n if (productPriceInput <= 0) {\n throw new myExceptions(\"Price field: enter a value greater than 0.\\n\");\n }\n }\n catch (myExceptions priceValidation) {\n errorMessageContainer += priceValidation.getMessage();\n isInputValid = false;\n\n }\n catch (NumberFormatException ex) {\n errorMessageContainer += \"Price field: enter a positive number. Your input can contain decimals. \\n\";\n isInputValid = false;\n\n }\n\n try {\n maxInventoryLevelInput = Integer.parseInt(maxInventoryField.getText());\n minInventoryLevelInput = Integer.parseInt(minInventoryField.getText());\n if (maxInventoryField.getText().equals(\"\") || minInventoryField.getText().equals(\"\") || maxInventoryLevelInput <= 0 || minInventoryLevelInput <= 0) {\n throw new myExceptions(\"Min and Max fields: enter values for the minimum and maximum inventory fields.\\n\");\n }\n if (maxInventoryLevelInput < minInventoryLevelInput) {\n throw new myExceptions(\"Max inventory MUST be larger than the minimum inventory.\\n\");\n }\n\n }\n catch (NumberFormatException ex) {\n errorMessageContainer += \"Min and Max fields: enter a positive whole number.\\n\";\n isInputValid = false;\n\n }\n catch (myExceptions minMaxValidation) {\n errorMessageContainer += minMaxValidation.getMessage();\n isInputValid = false;\n\n }\n\n try {\n productInventoryLevel = Integer.parseInt(inventoryLevelField.getText());\n if (inventoryLevelField.getText().equals(\"\")) {\n throw new myExceptions(\"Inventory level: enter a number greater than 0.\\n\");\n }\n if (productInventoryLevel <= 0) {\n throw new myExceptions(\"Inventory level: enter a number greater than 0.\\n\");\n }\n if (productInventoryLevel > maxInventoryLevelInput || productInventoryLevel < minInventoryLevelInput) {\n throw new myExceptions(\"Inventory level: value must be between max and min.\\n\");\n }\n }\n catch (NumberFormatException ex) {\n errorMessageContainer += \"Inventory level: enter a positive whole number.\\n\";\n isInputValid = false;\n\n }\n catch (myExceptions stockValidation) {\n errorMessageContainer += stockValidation.getMessage();\n isInputValid = false;\n\n }\n\n errorMessageLabel.setText(errorMessageContainer);\n errorMessageContainer = \"\";\n\n }", "@Override\n\tpublic void validate()\n\t{\n\n\t}", "protected void check() throws IOException, ServletException {\n if(value.length()==0)\n error(\"please type in the License Server\");\n else {\n \t//TODO add more checks\n \tok();\n }\n }", "public void validate() {\n\t\tlog(\"In validate of LoginAction\");\n\t\t//if (StringUtils.isEmpty(user.getUserId())) {\n\t if (StringUtils.isEmpty(userId)) {\t\n\t\t\tlog(\"In validate of LoginAction: userId is blank\");\n\t\t\taddFieldError(\"userId\", \"User ID cannot be blank\");\n\t\t}\n\t\t//if (StringUtils.isEmpty(user.getPassword())) {\n\t if (StringUtils.isEmpty(password)) {\n\t\t\tlog(\"In validate of LoginAction: password is blank\");\n\t\t\taddFieldError(\"password\", \"Password cannot be blank\");\n\t\t}\n\t\tlog(\"Completed validate of LoginAction\");\n\t}", "@Override\r\n\tpublic void validate() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void validate() {\n\t}", "@Override\n public void customValidation() {\n }", "@Override\n public void customValidation() {\n }", "@Override\n public void customValidation() {\n }", "public static void validation() {\n\t\tif ((!textFieldName.getText().isEmpty()) && (!textField_FirstName.getText().isEmpty())\n\t\t\t\t&& (!textField_Town.getText().isEmpty()) && (!textField_Town.getText().isEmpty())) {\n\n\t\t\tif ((isValidEmailAddress(textField_Email.getText()) == true)) {\n\t\t\t\ttextField_Email.setBackground(Color.white);\n\t\t\t\tif ((force(textField_Mtp.getText()) > 82)) {\n\t\t\t\t\ttextField_Mtp.setBackground(Color.white);\n\t\t\t\t\tactionGiveServeur();\n\n\t\t\t\t} else {\n\t\t\t\t\tshowMessageDialog(null, \"Votre mot de passe est trop faible\");\n\t\t\t\t\ttextField_Mtp.setText(\"Mot de passe trop simple : changer le \");\n\t\t\t\t\ttextField_Mtp.setBackground(Color.RED);\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\ttextField_Email.setText(\"Email invalide\");\n\t\t\t\ttextField_Email.setBackground(Color.RED);\n\t\t\t\tshowMessageDialog(null, \"Email est invalide\");\n\t\t\t}\n\t\t} else {\n\n\t\t\tshowMessageDialog(null, \"Certain champs sont vide !\");\n\t\t}\n\t}", "void validate();", "void validate();", "protected abstract boolean isInputValid(@NotNull ConversationContext context, @NotNull String input);", "@Override\r\n public void validate() {\r\n }", "@Override\n\tpublic void validate() {\n\t\t if(pname==null||pname.toString().equals(\"\")){\n\t\t\t addActionError(\"父项节点名称必填!\");\n\t\t }\n\t\t if(cname==null||cname.toString().equals(\"\")){\n\t\t\t addActionError(\"子项节点名称必填!\");\n\t\t }\n\t\t if(caction==null||caction.toString().equals(\"\")){\n\t\t\t addActionError(\"子项节点动作必填!\");\n\t\t }\n\t\t \n\t\t List l=new ArrayList();\n\t\t\tl=userService.QueryByTabId(\"Resfun\", \"resfunid\", resfunid);\n\t\t\t//判断是否修改\n\t\t\tif(l.size()!=0){\n\t\t\t\t\n\t\t\t\tfor(int i=0;i<l.size();i++){\n\t\t\t\t\tResfun rf=new Resfun();\n\t\t\t\t\trf=(Resfun)l.get(i);\n\t\t\t\t\tif(rf.getCaction().equals(caction.trim())&&rf.getCname().equals(cname)&&rf.getPname().equals(pname)){\n\t\t\t\t\t\tSystem.out.println(\"mei gai\");\n\t\t\t\t\t}else{\n\t\t\t\t\t\tList n=new ArrayList();\n\t\t\t\t\t\tn=userService.QueryByPcac(\"Resfun\", \"pname\", pname, \"cname\", cname, \"caction\", caction);\n\t\t\t\t\t\tif(n.size()!=0){\n\t\t\t\t\t\t\taddActionError(\"该记录已经存在!\");\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\n\t\t\t\n\t\t\t\t\n\t\t\t}\n\t\t \n\t\t \n\t\t \n\t\t \n\t}", "@RequestMapping(value = \"tpos/login/v1\", method = RequestMethod.POST)\r\n\tpublic @ResponseBody ControllerResponse2<Object> logintTposFormData(HttpServletRequest request,\r\n\t\t\tAcq_TposLogin_Model model) {\r\n\r\n\t\tlogger.info(\"tpos/login/v1\" + \"::\" + \"Controller\" + \"::\" + \"Begin\");\r\n\t\tControllerResponse2<Object> controllerResponse = new ControllerResponse2<Object>();\r\n\t\t\r\n\t\ttry {\r\n\t\t\tValidatorFactory vFactory = Validation.buildDefaultValidatorFactory();\r\n\t\t\tValidator modelValidator = vFactory.getValidator();\r\n\t\t\tSet<ConstraintViolation<Acq_TposLogin_Model>> modelErrors = modelValidator.validate(model);\r\n\t\t\t\r\n\t\t\tif (modelErrors.size() > 0) {\r\n\t\t\t\tString ValidationErrors = \"\";\r\n\t\t\t\t\r\n\t\t\t\ttry {\r\n\t\t\t\t\tIterator<ConstraintViolation<Acq_TposLogin_Model>> errorIterator = modelErrors\r\n\t\t\t\t\t\t\t.iterator();\r\n\t\t\t\t\twhile (errorIterator.hasNext()) {\r\n\t\t\t\t\t\tConstraintViolation<Acq_TposLogin_Model> violation = errorIterator.next();\r\n\t\t\t\t\t\tString vErrors = violation.getPropertyPath() + \"-\" + violation.getMessage()+ \"-\"+ violation.getInvalidValue();\r\n\t\t\t\t\t\tlogger.info(\"tpos/login/v1\" + \"::\" + \"Controller\" + \"::\" + \"ValidationError\" + \"::\"\r\n\t\t\t\t\t\t\t\t+ vErrors);\r\n\t\t\t\t\t\tValidationErrors = ValidationErrors + vErrors + \"--\";\r\n\t\t\t\t\t}\r\n\t\t\t\t} catch (Exception e) {\r\n\r\n\t\t\t\t\tlogger.info(\"tpos/login/v1\" + \"::\" + \"Controller\" + \"::\" + \"Exception in Validation Error Printing\");\r\n\t\t\t\t\te.printStackTrace();\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\tlogger.info(\"tpos/login/v1\" + \"::\" + \"Controller\" + \"::\" + \"Parameter Validation Failed\");\r\n\r\n\t\t\t\tcontrollerResponse.setStatusCode(Acq_Status_Definations.InvalidParameters.getId());\r\n\t\t\t\tcontrollerResponse.setStatusMessage(Acq_Status_Definations.InvalidParameters.getDescription());\r\n\t\t\t\tcontrollerResponse.setBody(ValidationErrors);\r\n\r\n\t\t\t} \r\n\t\t\telse \r\n\t\t\t{\r\n\t\t\t\tlogger.info(\"tpos/login/v1\" + \"::\" + \"Controller\" + \"::\" + \"Forwarded To Handler\");\r\n\t\t\t\tServiceDto2<Object> daoResponse = loginHanler.loginTposV1(model);\r\n\t\t\t\tlogger.info(\"tpos/login/v1\" + \"::\" + \"Controller\" + \"::\" + \"Return From Handler\");\r\n\r\n\t\t\t\tif (daoResponse.getStatusCode() == Acq_Status_Definations.Authenticated.getId()) {\r\n\t\t\t\t\t// User Authenticated For Login\r\n\r\n\t\t\t\t\tHttpSession session = request.getSession();\r\n\t\t\t\t\tsession.setAttribute(\"uname\", model.getLoginId());\r\n\t\t\t\t\tsession.setAttribute(\"userid\", daoResponse.getStatusMessage());\r\n\t\t\t\t\tlogger.info(\"tpos/login/v1\" + \"::\" + \"Controller\" + \"::\" + \"Session Created\");\r\n\r\n\t\t\t\t\tcontrollerResponse.setStatusCode(daoResponse.getStatusCode());\r\n\t\t\t\t\tcontrollerResponse.setStatusMessage(daoResponse.getStatusMessage());\r\n\r\n\t\t\t\t\tif (daoResponse.getBody() != null) {\r\n\t\t\t\t\t\tcontrollerResponse.setBody(daoResponse.getBody());\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\tcontrollerResponse.setBody(null);\r\n\t\t\t\t\t}\r\n\t\t\t\t} else {\r\n\t\t\t\t\t// User Not Authenticated For Login\r\n\t\t\t\t\tcontrollerResponse.setStatusCode(daoResponse.getStatusCode());\r\n\t\t\t\t\tcontrollerResponse.setStatusMessage(daoResponse.getStatusMessage());\r\n\t\t\t\t\tcontrollerResponse.setBody(null);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t} catch (Exception e) {\r\n\t\t\tlogger.info(\"tpos/login/v1\" + \"::\" + \"Controller\" + \"::\" + \"Unexpected Error\");\r\n\t\t\te.printStackTrace();\r\n\t\t\tcontrollerResponse.setStatusCode(Acq_Status_Definations.UnexpectedServerError.getId());\r\n\t\t\tcontrollerResponse.setStatusMessage(Acq_Status_Definations.UnexpectedServerError.getDescription());\r\n\t\t\tcontrollerResponse.setBody(null);\r\n\t\t}\r\n\t\treturn controllerResponse;\r\n\t}", "public void validationErr()\r\n\t{\n\t\tSystem.out.println(\"validation err\");\r\n\t}", "@Nullable\n/* */ protected String getFailedValidationText(@NotNull ConversationContext context, @NotNull Number invalidInput) {\n/* 87 */ return null;\n/* */ }", "private boolean validateInput() {\n boolean isValid = true;\n Alert errMsg = Util.getAlert(Alert.AlertType.ERROR);\n if (connectionsCB.getEditor().getText() == null || !Util.isValidAddress(connectionsCB.getEditor().getText())) {\n errMsg.setContentText(\"Invalid TRex Host Name or IP address\");\n isValid = false;\n } else if (!Util.isValidPort(rpcPort.getText())) {\n errMsg.setContentText(\"Invalid TRex Sync Port Number(\" + rpcPort.getText() + \")\");\n isValid = false;\n } else if (!Util.isValidPort(asyncPort.getText())) {\n errMsg.setContentText(\"Invalid Async Port Number(\" + asyncPort.getText() + \")\");\n isValid = false;\n } else if (Util.isNullOrEmpty(nameTF.getText())) {\n errMsg.setContentText(\"Name should not be empty\");\n isValid = false;\n }\n\n if (!isValid) {\n errMsg.show();\n }\n return isValid;\n }", "private void validate() {\n\n etCardNumber.validate();\n\n etCardExpiryDate.validate();\n\n etCardCvv.validate();\n\n etCardHolderName.validate();\n\n etPhoneNumber.validate();\n\n etCustomerName.validate();\n }", "@Override\n public void validateModel() {\n }", "public boolean validateForm() {\r\n\t\tint validNum;\r\n\t\tdouble validDouble;\r\n\t\tString lengthVal = lengthInput.getText();\r\n\t\tString widthVal = widthInput.getText();\r\n\t\tString minDurationVal = minDurationInput.getText();\r\n\t\tString maxDurationVal = maxDurationInput.getText();\r\n\t\tString evPercentVal = evPercentInput.getText();\r\n\t\tString disabilityPercentVal = disabilityPercentInput.getText();\r\n\t\t\r\n\t\t/**\r\n\t\t * Step.1 - Ensure all inputs are numbers\r\n\t\t */\r\n\t\t\r\n\t\t// Try to parse length as int\r\n\t\ttry {\r\n\t\t\tvalidNum = Integer.parseInt(lengthVal);\r\n\t } catch (NumberFormatException e) {\r\n\t \tsetErrorMessage(\"Length must be an integer\");\r\n\t return false;\r\n\t }\r\n\t\t\r\n\t\t// Try to parse width as int\r\n\t\ttry {\r\n\t\t\tvalidNum = Integer.parseInt(widthVal);\r\n\t } catch (NumberFormatException e) {\r\n\t \tsetErrorMessage(\"Width must be an integer\");\r\n\t return false;\r\n\t }\r\n\t\t\r\n\t\t// Try to parse width as int\r\n\t\ttry {\r\n\t\t\tvalidNum = Integer.parseInt(minDurationVal);\r\n\t } catch (NumberFormatException e) {\r\n\t \tsetErrorMessage(\"Min Duration must be an integer\");\r\n\t return false;\r\n\t }\r\n\t\t\r\n\t\t// Try to parse width as int\r\n\t\ttry {\r\n\t\t\tvalidNum = Integer.parseInt(maxDurationVal);\r\n\t } catch (NumberFormatException e) {\r\n\t \tsetErrorMessage(\"Max Duration must be an integer\");\r\n\t return false;\r\n\t }\r\n\t\t\r\n\t\t// Try to parse width as int\r\n\t\ttry {\r\n\t\t\tvalidDouble = Double.parseDouble(evPercentVal);\r\n\t } catch (NumberFormatException e) {\r\n\t \tsetErrorMessage(\"EV % must be a number\");\r\n\t return false;\r\n\t }\r\n\t\t\r\n\t\t// Try to parse width as int\r\n\t\ttry {\r\n\t\t\tvalidDouble = Double.parseDouble(disabilityPercentVal);\r\n\t } catch (NumberFormatException e) {\r\n\t \tsetErrorMessage(\"Disability % must be a number\");\r\n\t return false;\r\n\t }\r\n\t\t\r\n\t\t/**\r\n\t\t * Step.2 - Ensure all needed inputs are non-zero\r\n\t\t */\r\n\t\t\r\n\t\tvalidNum = Integer.parseInt(lengthVal);\r\n\t\tif (validNum <= 0) {\r\n\t\t\tsetErrorMessage(\"Length must be greater than 0\");\r\n\t\t\treturn false;\r\n\t\t}\r\n\t\t\r\n\t\tvalidNum = Integer.parseInt(widthVal);\r\n\t\tif (validNum <= 0) {\r\n\t\t\tsetErrorMessage(\"Width must be greater than 0\");\r\n\t\t\treturn false;\r\n\t\t}\r\n\t\t\r\n\t\tvalidNum = Integer.parseInt(minDurationVal);\r\n\t\tif (validNum < 10) {\r\n\t\t\tsetErrorMessage(\"Min Duration must be at least 10\");\r\n\t\t\treturn false;\r\n\t\t}\r\n\t\t\r\n\t\tvalidNum = Integer.parseInt(maxDurationVal);\r\n\t\tif (validNum < 10) {\r\n\t\t\tsetErrorMessage(\"Max Duration must be at least 10\");\r\n\t\t\treturn false;\r\n\t\t}\r\n\t\t\r\n\t\tvalidDouble = Double.parseDouble(evPercentVal);\r\n\t\tif (validDouble < 0) {\r\n\t\t\tsetErrorMessage(\"EV % can't be less than 0\");\r\n\t\t\treturn false;\r\n\t\t}\r\n\t\t\r\n\t\tvalidDouble = Double.parseDouble(disabilityPercentVal);\r\n\t\tif (validDouble < 0) {\r\n\t\t\tsetErrorMessage(\"Disability % can't be less than 0\");\r\n\t\t\treturn false;\r\n\t\t}\r\n\t\t\r\n\t\t/**\r\n\t\t * Step.3 - Ensure Max Duration can't be smaller than Min Duration\r\n\t\t */\r\n\t\t\r\n\t\tif (Integer.parseInt(minDurationVal) > Integer.parseInt(maxDurationVal)) {\r\n\t\t\tsetErrorMessage(\"Max Duration can't be less than Min Duration\");\r\n\t\t\treturn false;\r\n\t\t}\r\n\t\t\r\n\t\t/**\r\n\t\t * Step.4 - Ensure values aren't too large for the system to handle\r\n\t\t */\r\n\t\t\r\n\t\tif (Integer.parseInt(lengthVal) > 15) {\r\n\t\t\tsetErrorMessage(\"Carpark length can't be greater than 15 spaces\");\r\n\t\t\treturn false;\r\n\t\t}\r\n\r\n\t\tif (Integer.parseInt(widthVal) > 25) {\r\n\t\t\tsetErrorMessage(\"Carpark width can't be greater than 25 spaces\");\r\n\t\t\treturn false;\r\n\t\t}\r\n\t\tif (Integer.parseInt(minDurationVal) > 150) {\r\n\t\t\tsetErrorMessage(\"Min Duration can't be greater than 150\");\r\n\t\t\treturn false;\r\n\t\t}\r\n\t\t\r\n\t\tif (Integer.parseInt(maxDurationVal) > 300) {\r\n\t\t\tsetErrorMessage(\"Max Duration can't be greater than 300\");\r\n\t\t\treturn false;\r\n\t\t}\r\n\t\t\r\n\t\tif (Double.parseDouble(evPercentVal) > 100) {\r\n\t\t\tsetErrorMessage(\"EV % can't be greater than 100\");\r\n\t\t\treturn false;\r\n\t\t}\r\n\t\t\r\n\t\tif (Double.parseDouble(disabilityPercentVal) > 100) {\r\n\t\t\tsetErrorMessage(\"Disability % can't be greater than 100\");\r\n\t\t\treturn false;\r\n\t\t}\r\n\t\t\r\n\t\tif (Integer.parseInt(minDurationVal) > 150) {\r\n\t\t\tsetErrorMessage(\"Min Duration can't be greater than 150\");\r\n\t\t\treturn false;\r\n\t\t}\r\n\t\t\r\n\t\treturn true;\r\n\t}", "public abstract void validate () throws ModelValidationException;", "@Override\n\tpublic void validate() {\n\t}", "void validate(N ndcRequest, ErrorsType errorsType);", "void onValidationFailed();", "public String inputForm() {\n return inputDataTraveler.validateData();\n }", "protected void validate() {\n // no op\n }", "private void okAction()\r\n\t{\r\n\t\tString navn = txfInput[0].getText().trim();\r\n\r\n\t\tint telefonNr = -1;\r\n\t\ttry\r\n\t\t{\r\n\t\t\ttelefonNr = Integer.parseInt(txfInput[1].getText().trim());\r\n\t\t} catch (NumberFormatException ex)\r\n\t\t{\r\n\t\t\t// do nothing\r\n\t\t}\r\n\r\n\t\tString vej = txfInput[2].getText().trim();\r\n\r\n\t\tint nr = -1;\r\n\t\ttry\r\n\t\t{\r\n\t\t\tnr = Integer.parseInt(txfInput[3].getText().trim());\r\n\t\t} catch (NumberFormatException ex)\r\n\t\t{\r\n\t\t\t// do nothing\r\n\t\t}\r\n\r\n\t\tString etage = txfInput[4].getText().trim();\r\n\r\n\t\tint postNr = -1;\r\n\t\ttry\r\n\t\t{\r\n\t\t\tpostNr = Integer.parseInt(txfInput[5].getText().trim());\r\n\t\t} catch (NumberFormatException ex)\r\n\t\t{\r\n\t\t\t// do nothing\r\n\t\t}\r\n\r\n\t\tString by = txfInput[6].getText().trim();\r\n\t\tString land = txfInput[7].getText().trim();\r\n\r\n\t\tif (navn.length() == 0)\r\n\t\t{\r\n\t\t\tlblError.setText(\"Navn er tom\");\r\n\t\t\treturn;\r\n\t\t} else if (telefonNr <= 0)\r\n\t\t{\r\n\t\t\tlblError.setText(\"Telefon nr er ugyldigt\");\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\telse if (vej.length() == 0)\r\n\t\t{\r\n\t\t\tlblError.setText(\"Vej er tom\");\r\n\t\t\treturn;\r\n\t\t} else if (nr <= 0)\r\n\t\t{\r\n\t\t\tlblError.setText(\"Nr er ugyldigt\");\r\n\t\t\treturn;\r\n\t\t} else if (postNr <= 0)\r\n\t\t{\r\n\t\t\tlblError.setText(\"Post Nr er ugyldigt\");\r\n\t\t\treturn;\r\n\t\t} else if (by.length() == 0)\r\n\t\t{\r\n\t\t\tlblError.setText(\"By er ugyldigt\");\r\n\t\t\treturn;\r\n\t\t} else if (land.length() == 0)\r\n\t\t{\r\n\t\t\tlblError.setText(\"Land er tom\");\r\n\t\t\treturn;\r\n\t\t}\r\n\t\t\r\n\t\tFirma firma = null;\r\n\t\ttry\r\n\t\t{\r\n\t\t\tfirma = lvwFirmaer.getSelectionModel().getSelectedItem();\r\n\t\t} catch (NullPointerException ex)\r\n\t\t{\r\n\t\t\t// do nothing\r\n\t\t}\r\n\r\n\r\n\t\tLedsager ledsager = null;\r\n\t\ttry\r\n\t\t{\r\n\t\t\tledsager = lvwLedsagere.getSelectionModel().getSelectedItem();\r\n\t\t} catch (NullPointerException ex)\r\n\t\t{\r\n\t\t\t// do nothing\r\n\t\t}\r\n\t\t\r\n\r\n\t\tif (deltager != null)\r\n\t\t{\r\n\t\t\tService.updateDeltager(deltager, firma, ledsager, navn, telefonNr, null, vej, nr, etage, postNr, by, land);\r\n\t\t} else\r\n\t\t{\r\n\t\t\tService.createDeltager(navn, telefonNr, null, vej, nr, etage, postNr, by, land);\r\n\t\t}\r\n\r\n\t\tthis.hide();\r\n\t}", "private boolean isValidInput() {\n\t\treturn true;\n\t}", "public String validate() {\n\t\tString msg=\"\";\n\t\t// for name..\n\t\tif(name==null||name.equals(\"\"))\n\t\t{\n\t\t\tmsg=\"Task name should not be blank or null\";\n\t\t}\n\t\tif(name.split(\" \").length>1)\n\t\t{\n\t\t\tmsg=\"multiple words are not allowed\";\n\t\t}\n\t\telse\n\t\t{\n\t\t for(int i=0;i<name.length();i++)\n\t\t {\n\t\t\t char c=name.charAt(i);\n\t\t\t\tif(!(Character.isDigit(c)||Character.isLetter(c)))\n\t\t\t\t{\n\t\t\t\t\tmsg=\"special characters are not allowed\";\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t }\n\t\t}\n\t\t\t\n\t\t\n\t\t\t// for Description...\n\t\t\tif(desc==null||desc.equals(\"\"))\n\t\t\t{\n\t\t\t\tmsg=\"Task descrshould not be blank or null\";\n\t\t\t}\n\t\t\t\n\t\t\t\n\t\t\t // for tag...\n\t\t\t \n\t\t\t if(tag==null||tag.equals(\"\"))\n\t\t\t\t{\n\t\t\t\t\tmsg=\"Task tags not be blank or null\";\n\t\t\t\t}\n\t\t\t\t\n\t\t\t // for date { imp here}\n\t\t\t if(tarik!=null)\n\t\t\t {\n\t\t\t SimpleDateFormat sdf=new SimpleDateFormat(\"dd/MM/yyyy\");\n\t\t\t sdf.setLenient(false); // very imp here..\n\t\t\t try {\n\t\t\t\tDate d=sdf.parse(tarik);\n\t\t\t} catch (ParseException e) {\n\t\t\t\t\n\t\t\t//\tmsg=\"date should be correct foramat\";\n\t\t\t\tmsg=e.getMessage();\n\t\t\t}\n\t\t\t }\n\t\t\t// for prority..\n\t\t\t if(prio<1&&prio>10)\n\t\t\t {\n\t\t\t\t msg=\"prority range is 1 to 10 oly pa\";\n\t\t\t }\n\t\t\t\t\n\t\t\t\tif(msg.equals(\"\"))\n\t\t\t\t{\n\t\t\t\t\treturn Constant.SUCCESS;\n\t\t\t\t}\n\t\t\t\telse\n\t\t\treturn msg;\n\t}", "private boolean isInputValid() {\n return true;\n }", "private void validateData() {\n }", "private boolean isInputValid() {\n String errorMessage = \"\";\n\n if (ServiceName.getText() == null || ServiceName.getText().length() == 0) {\n errorMessage += \"No valid name!\\n\";\n }\n if (Serviceemail.getText() == null || Serviceemail.getText().length() == 0) {\n Pattern p = Pattern.compile(\"[_A-Za-z0-9][A-Za-z0-9._]*?@[_A-Za-z0-9]+([.][_A-Za-z]+)+\");\n Matcher m = p.matcher(Serviceemail.getText());\n if (m.find() && m.group().equals(Serviceemail.getText())) {\n errorMessage += \"No valid Mail Forment!\\n\";\n }\n }\n if (servicedescrip.getText() == null || servicedescrip.getText().length() == 0) {\n errorMessage += \"No valid description !\\n\";\n }\n if (f == null && s.getImage() == null) {\n errorMessage += \"No valid photo ( please upload a photo !)\\n\";\n }\n if (Serviceprice.getText() == null || Serviceprice.getText().length() == 0) {\n errorMessage += \"No valid prix !\\n\";\n } else {\n // try to parse the postal code into an int.\n try {\n Float.parseFloat(Serviceprice.getText());\n } catch (NumberFormatException e) {\n errorMessage += \"No valid prix (must be a Float)!\\n\";\n }\n }\n if ( !Weekly.isSelected() && !Daily.isSelected() && !Monthly.isSelected()) {\n errorMessage += \"No valid Etat ( select an item !)\\n\";\n }\n if (Servicesatet.getSelectionModel().getSelectedIndex() == -1) {\n errorMessage += \"No valid etat ( select an item !)\\n\";\n }\n if (ServiceCity.getSelectionModel().getSelectedIndex() == -1) {\n errorMessage += \"No valid City ( select an item !)\\n\";\n }\n if (servicetype.getSelectionModel().getSelectedIndex() == -1) {\n errorMessage += \"No valid Type ( select an item !)\\n\";\n }\n if (errorMessage.length() == 0) {\n return true;\n } else {\n // Show the error message.\n Alert alert = new Alert(Alert.AlertType.ERROR);\n alert.setTitle(\"Invalid Fields\");\n alert.setHeaderText(\"Please correct invalid fields\");\n alert.setContentText(errorMessage);\n alert.showAndWait();\n return false;\n }\n }", "protected abstract boolean isInputValid();", "public abstract void validateCommand(FORM target, Errors errors);", "@Override\n public void validate(ValidationContext vc) {\n Map<String,Property> beanProps = vc.getProperties(vc.getProperty().getBase());\n \n validateKode(vc, (String)beanProps.get(\"idKurikulum\").getValue(), (Boolean)vc.getValidatorArg(\"tambahBaru\")); \n validateDeskripsi(vc, (String)beanProps.get(\"deskripsi\").getValue()); \n }", "private boolean validationInput(String tenDMGT, String dMGTId, String maDMGT, String taiLieu, String dungLuong, String doiTuongSuDung, ActionRequest actionRequest) {\r\n\t\tif (maDMGT.trim().length() == 0) {\r\n\t\t\tSessionErrors.add(actionRequest, \"emptyMaDMGT\");\r\n\t\t}\r\n\t\tif (tenDMGT.trim().length() == 0) {\r\n\t\t\tSessionErrors.add(actionRequest, \"emptyTenDMGT\");\r\n\t\t}\r\n\t\tif (taiLieu.trim().length() == 0) {\r\n\t\t\tSessionErrors.add(actionRequest, \"emptyTaiLieuDMGT\");\r\n\t\t}\r\n\t\tif (dungLuong.trim().length() == 0) {\r\n\t\t\tSessionErrors.add(actionRequest, \"emptyDungLuongDMGT\");\r\n\t\t}\r\n\t\tif(FormatUtil.convertToInt(dungLuong) <=0)\r\n\t\t{\r\n\t\t\tSessionErrors.add(actionRequest, \"emptyDungLuongDMGT\");\r\n\t\t}\r\n\t\tif(Validator.isNull(doiTuongSuDung))\r\n\t\t{\r\n\t\t\tSessionErrors.add(actionRequest, \"emptyDoiTuongSuDung\");\r\n\t\t}\r\n\t\t// Neu thong tin nhap khac rong\r\n\t\tif (SessionErrors.isEmpty(actionRequest)) {\r\n\t\t\tDanhMucGiayTo dMGT = null;\r\n\t\t\ttry {\r\n\r\n\t\t\t\t// Kiem tra theo Ma\r\n\t\t\t\ttry {\r\n\t\t\t\t\tdMGT = null;\r\n\t\t\t\t\tdMGT = DanhMucGiayToLocalServiceUtil.findTheoMa(maDMGT);\r\n\t\t\t\t} catch (Exception es) {\r\n\t\t\t\t}\r\n\t\t\t\tif (dMGT != null) {\r\n\t\t\t\t\tif (dMGT.getDaXoa() == FormatUtil.DA_XOA_DEACTIVATE) {\r\n\t\t\t\t\t\treturn true;\r\n\t\t\t\t\t}\r\n\t\t\t\t\tif (dMGTId.trim().length() > 0) {\r\n\t\t\t\t\t\tif (FormatUtil.convertToLong(dMGTId) != dMGT.getId()) {\r\n\t\t\t\t\t\t\tSessionErrors.add(actionRequest, \"existMaDMGT\");\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\tSessionErrors.add(actionRequest, \"existMaDMGT\");\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\r\n\r\n\t\t\t} catch (Exception es) {\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tif (SessionErrors.isEmpty(actionRequest)) {\r\n\t\t\treturn true;\r\n\t\t}\r\n\r\n\t\treturn false;\r\n\t}", "protected boolean validate(HttpServletRequest request) {\r\n/* 54 */ log.debug(\"RoomCtl Method validate Started\");\r\n/* */ \r\n/* 56 */ boolean pass = true;\r\n/* */ \r\n/* */ \r\n/* */ \r\n/* */ \r\n/* 61 */ if (DataValidator.isNull(request.getParameter(\"room\"))) {\r\n/* 62 */ request.setAttribute(\"room\", \r\n/* 63 */ PropertyReader.getValue(\"error.require\", \" RoomNo\"));\r\n/* 64 */ pass = false;\r\n/* */ } \r\n/* */ \r\n/* */ \r\n/* */ \r\n/* */ \r\n/* 70 */ if (DataValidator.isNull(request.getParameter(\"description\"))) {\r\n/* 71 */ request.setAttribute(\"description\", \r\n/* 72 */ PropertyReader.getValue(\"error.require\", \"Description\"));\r\n/* 73 */ pass = false;\r\n/* */ } \r\n/* */ \r\n/* */ \r\n/* */ \r\n/* 78 */ if (\"-----Select-----\".equalsIgnoreCase(request.getParameter(\"hostelId\"))) {\r\n/* 79 */ request.setAttribute(\"hostelId\", \r\n/* 80 */ PropertyReader.getValue(\"error.require\", \"Hostel Name\"));\r\n/* 81 */ pass = false;\r\n/* */ } \r\n/* */ \r\n/* */ \r\n/* */ \r\n/* 86 */ log.debug(\"RoomCtl Method validate Ended\");\r\n/* */ \r\n/* 88 */ return pass;\r\n/* */ }", "@Override\n public void validate() {\n boolean b = false;\n\n //retrieving the contact us form details from request object\n String firstName = objContactUsForm.getName().trim();\n String email = objContactUsForm.getEmail().trim();\n String message = objContactUsForm.getMessage().trim();\n\n //now validating each of the field\n if (firstName.isEmpty()) {\n addFieldError(\"name\", getText(\"name.required\"));\n b = true;\n }\n\n if (email.isEmpty()) {\n addFieldError(\"email\", getText(\"email.required\"));\n b = true;\n }\n if (!b) {\n Pattern p = Pattern.compile(\".+@.+\\\\.[a-z]+\");\n Matcher m = p.matcher(email);\n boolean matchFound = m.matches();\n if (!matchFound) {\n addFieldError(\"email\", \"Please Provide Valid Email ID\");\n }\n }\n\n if (message.isEmpty()) {\n addFieldError(\"message\", getText(\"message.required\"));\n b = true;\n }\n\n if (!b) {\n boolean matches = message.matches(\"[<>!~@$%^&\\\"|!\\\\[#$]\");\n if (matches) {\n addFieldError(\"message\", \"Please Provide Valid Message Name\");\n b = true;\n }\n }\n }", "private void updateValidationMessages()\r\n {\r\n String errorMessage = myModel.getErrorMessage();\r\n String warningMessage = myModel.getWarningMessage();\r\n\r\n if (StringUtils.isNotEmpty(errorMessage))\r\n {\r\n myValidator.setValidationResult(ValidationStatus.ERROR, errorMessage);\r\n }\r\n else if (StringUtils.isNotEmpty(warningMessage))\r\n {\r\n myValidator.setValidationResult(ValidationStatus.WARNING, warningMessage);\r\n }\r\n else\r\n {\r\n myValidator.setValidationResult(ValidationStatus.VALID, null);\r\n }\r\n }", "public void setListener(JFXTextField field, int type) {\n if (type == 1) {\n NumberValidator numValidator = new NumberValidator();\n santa_List.add(numValidator);\n field.getValidators().add(numValidator);\n numValidator.setMessage(\"Enter a number\");\n RequiredFieldValidator validator = new RequiredFieldValidator();\n field.getValidators().add(validator);\n validator.setMessage(\"* Required\");\n }\n if (type == 2) {\n RegexValidator regexValidator = new RegexValidator();\n santa_List.add(regexValidator);\n regexValidator.setRegexPattern(\"^[a-zA-Z]+(([',. -][a-zA-Z ])?[a-zA-Z]*)*$\");\n field.getValidators().add(regexValidator);\n regexValidator.setMessage(\"Enter your name!\");\n RequiredFieldValidator validator = new RequiredFieldValidator();\n field.getValidators().add(validator);\n validator.setMessage(\"* Required\");\n }\n if (type == 3) {\n RegexValidator validEmail = new RegexValidator();\n santa_List.add(validEmail);\n validEmail.setRegexPattern(\".+\\\\@.+\\\\..+\");\n field.getValidators().add(validEmail);\n validEmail.setMessage(\"Enter a valid email\");\n RequiredFieldValidator validator = new RequiredFieldValidator();\n field.getValidators().add(validator);\n validator.setMessage(\"* Required\");\n }\n if (type == 4) {\n RegexValidator validEmail = new RegexValidator();\n santa_List.add(validEmail);\n validEmail.setRegexPattern(\"^\\\\D?(\\\\d{3})\\\\D?\\\\D?(\\\\d{3})\\\\D?(\\\\d{4})$\");\n field.getValidators().add(validEmail);\n validEmail.setMessage(\"Enter a valid phone number\");\n RequiredFieldValidator validator = new RequiredFieldValidator();\n field.getValidators().add(validator);\n validator.setMessage(\"* Required\");\n }\n if (type == 5) {\n RegexValidator validEmail = new RegexValidator();\n santa_List.add(validEmail);\n validEmail.setRegexPattern(\"^\\\\d{2}$\");\n field.getValidators().add(validEmail);\n validEmail.setMessage(\"Enter the last two digits of the year\");\n RequiredFieldValidator validator = new RequiredFieldValidator();\n field.getValidators().add(validator);\n validator.setMessage(\"* Required\");\n }\n if (type == 6) {\n RegexValidator validEmail = new RegexValidator();\n santa_List.add(validEmail);\n validEmail.setRegexPattern(\"^[0-9]+(\\\\.[0-9][0-9]*)?$\"); // Doesn't account for decimals\n field.getValidators().add(validEmail);\n validEmail.setMessage(\"Enter a valid pH\");\n RequiredFieldValidator validator = new RequiredFieldValidator();\n field.getValidators().add(validator);\n validator.setMessage(\"* Required\");\n }\n if (type == 7) {\n RegexValidator validRepId = new RegexValidator();\n santa_List.add(validRepId);\n validRepId.setRegexPattern(\"^[a-zA-Z0-9]{0,16}$\"); // Doesn't account for decimals\n field.getValidators().add(validRepId);\n validRepId.setMessage(\"Enter a valid rep id\");\n }\n if (type == 8) {\n RegexValidator validSerial = new RegexValidator();\n santa_List.add(validSerial);\n validSerial.setRegexPattern(\"^\\\\d{4}$\");\n field.getValidators().add(validSerial);\n validSerial.setMessage(\"The serial number must be at most four digits\");\n RequiredFieldValidator validator = new RequiredFieldValidator();\n field.getValidators().add(validator);\n validator.setMessage(\"* Required\");\n }\n\n field.focusedProperty().addListener(new ChangeListener<Boolean>() {\n @Override\n public void changed(ObservableValue<? extends Boolean> observable, Boolean oldValue, Boolean newValue) {\n if (!newValue) {\n field.validate();\n\n boolean t = true;\n for (ValidatorBase vb : santa_List) {\n t = t && !vb.getHasErrors();\n// System.out.println(vb.getHasErrors());\n }\n\n if (t) {\n// System.out.println(\"Fields has no errors\");\n SendApp.setOpacity(1);\n SendApp.setDisable(false);\n } else {\n// System.out.println(\"Fields has errors\");\n SendApp.setDisable(true);\n SendApp.setOpacity(0.5);\n\n }\n }\n }\n });\n }", "@Override\r\n\tprotected boolean validateFields(String action) {\r\n\t\t// Booleano para indicar que hubo error\r\n\t\tisError = false;\r\n\t\t// IRI Concepto\r\n\t\tif (this.isBlanks(object.getDcoiricaf())) {\r\n\t\t\tisError = true;\r\n\t\t\tthis.getErrorMessages().add(\r\n\t\t\t\t\tApplicationMessages.getMessage(\"USR0008\",\r\n\t\t\t\t\t\t\tApplicationMessages.getMessage(\"se010_iriDetail\")));\r\n\t\t}\r\n\t\t// Concepto Semántico\r\n\t\tif (this.isBlanks(object.getCosccosak())) {\r\n\t\t\tisError = true;\r\n\t\t\tthis.getErrorMessages().add(\r\n\t\t\t\t\tApplicationMessages.getMessage(\"USR0008\",\r\n\t\t\t\t\t\t\tApplicationMessages\r\n\t\t\t\t\t\t\t\t\t.getMessage(\"se010_semanticConcept\")));\r\n\t\t}\r\n\t\t// Valida relaciones\r\n\t\tfor (Sedrelco relco : object.getRelcos()) {\r\n\t\t\t// Valor Relacion\r\n\t\t\tif (this.isBlanks(relco.getDrcvalraf())) {\r\n\t\t\t\tisError = true;\r\n\t\t\t\tthis.getErrorMessages().add(\r\n\t\t\t\t\t\tApplicationMessages.getMessage(\"USR0008\",\r\n\t\t\t\t\t\t\t\tApplicationMessages\r\n\t\t\t\t\t\t\t\t\t\t.getMessage(\"se010_valueRelation\")));\r\n\t\t\t}\r\n\t\t}\r\n\t\t// Retorna\r\n\t\treturn !isError;\r\n\t}", "private void validation() {\n Pattern pattern = validationfilterStringData();\n if (pattern.matcher(txtDrug.getText().trim()).matches() && pattern.matcher(txtGenericName.getText().trim()).matches()) {\n try {\n TblTreatmentadvise treatmentadvise = new TblTreatmentadvise();\n treatmentadvise.setDrugname(txtDrug.getText());\n treatmentadvise.setGenericname(txtGenericName.getText());\n treatmentadvise.setTiming(cmbDosestiming.getSelectedItem().toString());\n cmbtiming.setSelectedItem(cmbDosestiming);\n treatmentadvise.setDoses(loadcomboDoses());\n treatmentadvise.setDuration(loadcomboDuration());\n PatientService.saveEntity(treatmentadvise);\n JOptionPane.showMessageDialog(this, \"SAVE SUCCESSFULLY\");\n } catch (Exception ex) {\n JOptionPane.showMessageDialog(this, \"STARTUP THE DATABASE CONNECTION\");\n }\n } else {\n JOptionPane.showMessageDialog(this, \"WRONG DATA ENTERED.\");\n }\n }", "protected boolean validateInputs() {\n if (KEY_EMPTY.equals(firstName)) {\n etFirstName.setError(\"First Name cannot be empty\");\n etFirstName.requestFocus();\n return false;\n }\n if (KEY_EMPTY.equals(lastName)) {\n etLastName.setError(\"Last Name cannot be empty\");\n etLastName.requestFocus();\n return false;\n }\n if (KEY_EMPTY.equals(username)) {\n etUsername.setError(\"Username cannot be empty\");\n etUsername.requestFocus();\n return false;\n }\n if (KEY_EMPTY.equals(email)) {\n etEmail.setError(\"Email cannot be empty\");\n etEmail.requestFocus();\n return false;\n }\n if (KEY_EMPTY.equals(password)) {\n etPassword.setError(\"Password cannot be empty\");\n etPassword.requestFocus();\n return false;\n }\n if (KEY_EMPTY.equals(confirmPassword)) {\n etConfirmPassword.setError(\"Confirm Password cannot be empty\");\n etConfirmPassword.requestFocus();\n return false;\n }\n if (!password.equals(confirmPassword)) {\n etConfirmPassword.setError(\"Password and Confirm Password does not match\");\n etConfirmPassword.requestFocus();\n return false;\n }\n if (KEY_EMPTY.equals(major)) {\n etMajor.setError(\"Major cannot be empty\");\n etMajor.requestFocus();\n return false;\n }\n if (KEY_EMPTY.equals(university)) {\n etUniversity.setError(\"university cannot be empty\");\n etUniversity.requestFocus();\n return false;\n }\n\n\n\n if(!isStudent && !isTutor){\n //Show a toast or some kind of error\n Toast toast = Toast.makeText(this, \"message\", Toast.LENGTH_SHORT);\n toast.setText(\"please check the account type\");\n toast.setGravity(Gravity.CENTER, 0, 0);\n //other setters\n toast.show();\n return false;\n }\n\n\n return true;\n }", "public interface IValidationHelper extends StateRestorer {\n\n\t/**\n\t * Initialization of the objects needed for the validation process.\n\t *\n\t * @throws HDIVException if there is an initialization error.\n\t */\n\tvoid init();\n\n\t/**\n\t * Checks if the values of the parameters received in the request <code>request</code> are valid. These values are valid if and only if\n\t * the noneditable parameters haven't been modified.<br>\n\t *\n\t * @param context request context\n\t * @return {@link ValidatorHelperResult} with true value If all the parameter values of the request <code>request</code> pass the the\n\t * HDIV validation. False, otherwise.\n\t * @throws HDIVException If the request doesn't pass the HDIV validation an exception is thrown explaining the cause of the error.\n\t */\n\tValidatorHelperResult validate(ValidationContext context);\n\n\t/**\n\t * It is called in the pre-processing stage of each user request.\n\t *\n\t * @param request HTTP servlet request\n\t */\n\tvoid startPage(RequestContextHolder request);\n\n\t/**\n\t * It is called in the post-processing stage of each user request.\n\t *\n\t * @param request HTTP servlet request\n\t */\n\tvoid endPage(RequestContextHolder request);\n\n\t/**\n\t * Internal Hdiv request\n\t * @param request HTTP servlet request\n\t * @param response HTTP servlet response\n\t * @return true if internal\n\t */\n\tboolean isInternal(HttpServletRequest request, HttpServletResponse response);\n\n\t/**\n\t * Find internal errors\n\t * @param t\n\t * @param target\n\t * @return\n\t */\n\tList<ValidatorError> findCustomErrors(final Throwable t, String target);\n\n\t/**\n\t * Check whether all the errors are legal\n\t * @param errors\n\t * @return\n\t */\n\tboolean areErrorsLegal(List<ValidatorError> errors);\n\n\tboolean processEditableValidationErrors(final RequestContextHolder request, final List<ValidatorError> errors);\n\n}", "public void validate() throws SpringBootBaseAppException,MessageValidationException;", "protected void check() throws IOException, ServletException {\n if(value.length()==0)\n error(\"please specify a configuration\");\n else {\n \t\t//TODO add more checks\n \t\tok();\n }\n }", "private void batchValidate() {\n lblIdError.setText(CustomValidator.validateLong(fieldId));\n lblNameError.setText(CustomValidator.validateString(fieldName));\n lblAgeError.setText(CustomValidator.validateInt(fieldAge));\n lblWageError.setText(CustomValidator.validateDouble(fieldWage));\n lblActiveError.setText(CustomValidator.validateBoolean(fieldActive));\n }", "public boolean Validate() {\n String[] testArr = {titleTxf.getText(), fNameTxf.getText(), sNameTxf.getText(),\n initialTxf.getText(), hNumTxf.getText(), cNumTxf.getText(), emailTxf.getText(), idNumTxf.getText(),\n (String) maritalCbx.getSelectedItem(), \n resTxf1.getText() + \"\" + resTxf2.getText(), zipResTxf.getText(),postTxf1.getText() + \"\" + postTxf2.getText(),\n zipPostTxf.getText() };\n\n // verify user has entered data into required fields\n String inputTest = \"\";\n\n for (int i = 0; i < testArr.length; i++) {\n if (testArr[i].equals(inputTest)) {\n\n JOptionPane.showMessageDialog(rootPane, \"please fill in all required fields\", \"ERROR\", ERROR_MESSAGE);\n \n return false;\n \n\n }\n \n \n }\n //verify Home number\n if(hNumTxf.getText().length()!=10){\n \n JOptionPane.showMessageDialog(rootPane, \"Invaild Home number\", \"ERROR\", ERROR_MESSAGE);\n errHNum.setText(\"!\");\n \n return false;\n }\n else{\n errHNum.setText(\"\");\n }\n //verify CellNo\n if(cNumTxf.getText().length()!=10){\n \n JOptionPane.showMessageDialog(rootPane, \"Invaild Cellphone number\", \"ERROR\", ERROR_MESSAGE);\n errCNum.setText(\"!\");\n \n return false;\n \n }\n else{\n errCNum.setText(\"\");\n }\n //verify email\n String email =emailTxf.getText(); \n if(!email.contains(\"@\")|| !email.contains(\".\")){\n \n JOptionPane.showMessageDialog(rootPane, \"Invaild email address\", \"ERROR\", ERROR_MESSAGE);\n errEmail.setText(\"!\");\n return false;\n }\n else{\n errEmail.setText(\"\");\n }\n \n //verify ID No. (Local)\n String ID = idNumTxf.getText();\n if(ID.length()!=13){\n \n JOptionPane.showMessageDialog(rootPane, \"Invaild ID number\", \"ERROR\", ERROR_MESSAGE);\n errID.setText(\"!\");\n return false;\n }\n else{\n errID.setText(\"\");\n }\n \n if(zipResTxf.getText().length()!=4){\n JOptionPane.showMessageDialog(rootPane, \"Invaild Zip Code\", \"ERROR\", ERROR_MESSAGE);\n errZipRes.setText(\"!\");\n return false;\n \n }\n else{\n \n errZipRes.setText(\"\");\n }\n if(zipPostTxf.getText().length()!=4){\n JOptionPane.showMessageDialog(rootPane, \"Invaild Zip Code\", \"ERROR\", ERROR_MESSAGE);\n errZipPost.setText(\"!\");\n return false;\n \n }\n else{\n \n errZipPost.setText(\"\");\n }\n \n \n return true;\n\n }", "@Override\r\n public void validate() {\n\r\n }", "@FXML\r\n\tprivate void regUser() throws Exception {\r\n\t\t// Connection LoginConn = null;\r\n\t\t// Check user's input is valid or not by using CusHandleException class\r\n\t\t// If not, throw exception\r\n\t\t\r\n\t\ttry {\r\n\t\t\tif (regFirstNameField.getText() == \"\" || regLastNameField.getText() == \"\" || regPhoneField.getText() == \"\"\r\n\t\t\t\t\t|| regAddressField.getText() == \"\" || regEmailField.getText() == \"\") {\r\n\t\t\t\tcusInfoText.setText(\"Please Input All information, before you submit!\");\r\n\t\t\t}\r\n\t\t\tif (CusHandleException.UserNameInputCheck(regUsernameField.getText()) == false) {\r\n\t\t\t\tcusInfoText.setText(\"Sorry! Username length cannot less than 3 or more than 17, and character only!\");\r\n\t\t\t\tthrow new Exception(\"Sorry! Username length cannot less than 3 or more than 17, and character only!\");\r\n\t\t\t}\r\n\t\t\tif (CusHandleException.UserNameInputCheck(regFirstNameField.getText()) == false) {\r\n\t\t\t\tcusInfoText.setText(\"Sorry! first name length cannot less than 3 or more than 17, and character only!\");\r\n\t\t\t\tthrow new Exception(\"Sorry! first name length cannot less than 3 or more than 17, and character only!\");\r\n\t\t\t}\r\n\t\t\tif (CusHandleException.UserNameInputCheck(regLastNameField.getText()) == false) {\r\n\t\t\t\tcusInfoText.setText(\"Sorry! last name length cannot less than 3 or more than 17, and character only!\");\r\n\t\t\t\tthrow new Exception(\"Sorry! last name length cannot less than 3 or more than 17, and character only!\");\r\n\t\t\t}\r\n\t\t\tif (CusHandleException.UserFuncPhoneInputCheck(regPhoneField.getText()) == false) {\r\n\t\t\t\tcusInfoText.setText(\"Sorry, Phone number length cannot less than 5 or more than 15, and number only!\");\r\n\t\t\t\tthrow new Exception(\"Sorry, Phone number length cannot less than 5 or more than 15, and number only!\");\r\n\t\t\t}\r\n\t\t\tif (CusHandleException.UserFuncAddressInputCheck(regAddressField.getText()) == false) {\r\n\t\t\t\tcusInfoText.setText(\"Address length between 15 to 150, and cannot only input number or characters!\");\r\n\t\t\t\tthrow new Exception(\"Address length between 15 to 150, and cannot only input number or characters!\");\r\n\t\t\t}\r\n\t\t\tif (CusHandleException.EmailInputCheck(regEmailField.getText()) == false) {\r\n\t\t\t\tcusInfoText.setText(\"Sorry, The email is not valid. Please input valid email. e.g: [email protected]\");\r\n\t\t\t\tthrow new Exception(\"Sorry, The email is not valid. Please input valid email. e.g: [email protected]\");\r\n\t\t\t}\r\n\t\t\tif (!regPassField.getText().equals(regConfField.getText())) {\r\n\t\t\t\tcusInfoText.setText(\"Sorry, The password that your input is not same, please try again!\");\r\n\t\t\t\tthrow new Exception(\"Sorry, The password that your input is not same, please try again!\");\r\n\t\t\t}\r\n\t\t\tif (CusHandleException.PasswordInputCheck(regPassField.getText()) == false) {\r\n\t\t\t\tcusInfoText.setText(\r\n\t\t\t\t\t\t\"The password needs include number, symbol and character, the length between 5 to 17!\");\r\n\t\t\t\tthrow new Exception(\r\n\t\t\t\t\t\t\"The password needs include number, symbol and character, the length between 5 to 17!\");\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t//String Business = BusinessList.getSelectionModel().getSelectedItem().toString();\r\n\t\t\tString Business = BusinessList.getSelectionModel().getSelectedItem();\r\n\t\t\tboolean checkExist = false;\r\n\t\t\t\r\n\t\t\tif (Business == null){\r\n\t\t\t\tcusInfoText.setText(\"Sorry, Please choose a business!\");\r\n\t\t\t\tthrow new Exception(\"Sorry, Please choose a business!\");\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tint BusId = getBusId(Business);\r\n\t\t\tSystem.out.println(Business);\r\n\t\t\tSystem.out.println(BusId);\r\n\t\t\tcheckExist = checkUserExist(regUsernameField.getText(), BusId);\r\n\t\t\t\r\n\t\t\tif (checkExist == false){\r\n\t\t\t\tcusInfoText.setText(\"Sorry, The User is exist, please try another username!\");\r\n\t\t\t\tthrow new Exception(\"Sorry, The User is exist, please try another username!\");\r\n\t\t\t}else{\r\n\t\t\t\r\n\t\t\tPreparedStatement rs = LoginConn\r\n\t\t\t\t\t.prepareStatement(\"INSERT INTO USERS(USERNAME,PASSWORD,USER_ID,PERMISSION) VALUES(?,?,?,1)\");\r\n\t\t\trs.setString(1, regUsernameField.getText());\r\n\t\t\trs.setString(2, regPassField.getText());\r\n\t\t\trs.setInt(3, userCount2);\r\n\t\t\t\r\n\t\t\t// excuteQuery for query. excuteUpdate for editing the database\r\n\t\t\t// Insert user name and password to the user table\r\n\t\t\trs.executeUpdate();\r\n\r\n\t\t\tPreparedStatement rs2 = LoginConn.prepareStatement(\r\n\t\t\t\t\t\"INSERT INTO DETAILS(USER_ID,FIRST_NAME,LAST_NAME,EMAIL,PHONE_NO,ADDRESS) VALUES(?,?,?,?,?,?)\");\r\n\t\t\trs2.setInt(1, userCount2);\r\n\t\t\trs2.setString(2, regFirstNameField.getText());\r\n\t\t\trs2.setString(3, regLastNameField.getText());\r\n\t\t\trs2.setString(4, regEmailField.getText());\r\n\t\t\trs2.setString(5, regPhoneField.getText());\r\n\t\t\trs2.setString(6, regAddressField.getText());\r\n\t\t\t// Insert firstname, lastname, and other inofrmation to detail\r\n\t\t\t// table.\r\n\t\t\trs2.executeUpdate();\r\n\t\t\tSystem.out.println(\"AAAA\");\r\n\t\t\t\r\n\t\t\tPreparedStatement rs4 = LoginConn.prepareStatement(\r\n\t\t\t\t\t\"INSERT INTO USERS_BUS(USER_ID,BUS_ID) VALUES(?,?)\");\r\n\t\t\tSystem.out.println(\"AAAA1\");\r\n\t\t\tSystem.out.println(userCount2);\r\n\t\t\tSystem.out.println(BusId);\r\n\t\t\trs4.setInt(1, userCount2);\r\n\t\t\trs4.setInt(2, BusId);\r\n\t\t\trs4.executeUpdate();\r\n\t\t\t\r\n\t\t\t\r\n\t\t\tcusInfoText.setText(\"Register succeed!\");\r\n\r\n\t\t} }catch (Exception e) {\r\n\r\n\t\t}\r\n\t}", "@RequestMapping(value = \"tpos/login/v2\", method = RequestMethod.POST)\r\n\tpublic @ResponseBody ControllerResponse2<Object> logintTposJsonData(HttpServletRequest request,\r\n\t\t\t@RequestBody final Acq_TposLogin_Model model) {\r\n\r\n\t\tlogger.info(\"tpos/login/v1\" + \"::\" + \"Controller\" + \"::\" + \"Begin\");\r\n\t\tControllerResponse2<Object> controllerResponse = new ControllerResponse2<Object>();\r\n\t\t\r\n\t\ttry {\r\n\t\t\tValidatorFactory vFactory = Validation.buildDefaultValidatorFactory();\r\n\t\t\tValidator modelValidator = vFactory.getValidator();\r\n\t\t\tSet<ConstraintViolation<Acq_TposLogin_Model>> modelErrors = modelValidator.validate(model);\r\n\t\t\t\r\n\t\t\tif (modelErrors.size() > 0) {\r\n\t\t\t\tString ValidationErrors = \"\";\r\n\t\t\t\t\r\n\t\t\t\ttry {\r\n\t\t\t\t\tIterator<ConstraintViolation<Acq_TposLogin_Model>> errorIterator = modelErrors\r\n\t\t\t\t\t\t\t.iterator();\r\n\t\t\t\t\twhile (errorIterator.hasNext()) {\r\n\t\t\t\t\t\tConstraintViolation<Acq_TposLogin_Model> violation = errorIterator.next();\r\n\t\t\t\t\t\tString vErrors = violation.getPropertyPath() + \"-\" + violation.getMessage()+ \"-\"+ violation.getInvalidValue();\r\n\t\t\t\t\t\tlogger.info(\"tpos/login/v1\" + \"::\" + \"Controller\" + \"::\" + \"ValidationError\" + \"::\"\r\n\t\t\t\t\t\t\t\t+ vErrors);\r\n\t\t\t\t\t\tValidationErrors = ValidationErrors + vErrors + \"--\";\r\n\t\t\t\t\t}\r\n\t\t\t\t} catch (Exception e) {\r\n\r\n\t\t\t\t\tlogger.info(\"tpos/login/v1\" + \"::\" + \"Controller\" + \"::\" + \"Exception in Validation Error Printing\");\r\n\t\t\t\t\te.printStackTrace();\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\tlogger.info(\"tpos/login/v1\" + \"::\" + \"Controller\" + \"::\" + \"Parameter Validation Failed\");\r\n\r\n\t\t\t\tcontrollerResponse.setStatusCode(Acq_Status_Definations.InvalidParameters.getId());\r\n\t\t\t\tcontrollerResponse.setStatusMessage(Acq_Status_Definations.InvalidParameters.getDescription());\r\n\t\t\t\tcontrollerResponse.setBody(ValidationErrors);\r\n\r\n\t\t\t} \r\n\t\t\telse \r\n\t\t\t{\r\n\t\t\t\tlogger.info(\"tpos/login/v1\" + \"::\" + \"Controller\" + \"::\" + \"Forwarded To Handler\");\r\n\t\t\t\tServiceDto2<Object> daoResponse = loginHanler.loginTposV1(model);\r\n\t\t\t\tlogger.info(\"tpos/login/v1\" + \"::\" + \"Controller\" + \"::\" + \"Return From Handler\");\r\n\r\n\t\t\t\tif (daoResponse.getStatusCode() == Acq_Status_Definations.Authenticated.getId()) {\r\n\t\t\t\t\t// User Authenticated For Login\r\n\r\n\t\t\t\t\tHttpSession session = request.getSession();\r\n\t\t\t\t\tsession.setAttribute(\"uname\", model.getLoginId());\r\n\t\t\t\t\tsession.setAttribute(\"userid\", daoResponse.getStatusMessage());\r\n\t\t\t\t\tlogger.info(\"tpos/login/v1\" + \"::\" + \"Controller\" + \"::\" + \"Session Created\");\r\n\r\n\t\t\t\t\tcontrollerResponse.setStatusCode(daoResponse.getStatusCode());\r\n\t\t\t\t\tcontrollerResponse.setStatusMessage(daoResponse.getStatusMessage());\r\n\r\n\t\t\t\t\tif (daoResponse.getBody() != null) {\r\n\t\t\t\t\t\tcontrollerResponse.setBody(daoResponse.getBody());\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\tcontrollerResponse.setBody(null);\r\n\t\t\t\t\t}\r\n\t\t\t\t} else {\r\n\t\t\t\t\t// User Not Authenticated For Login\r\n\t\t\t\t\tcontrollerResponse.setStatusCode(daoResponse.getStatusCode());\r\n\t\t\t\t\tcontrollerResponse.setStatusMessage(daoResponse.getStatusMessage());\r\n\t\t\t\t\tcontrollerResponse.setBody(null);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t} catch (Exception e) {\r\n\t\t\tlogger.info(\"tpos/login/v1\" + \"::\" + \"Controller\" + \"::\" + \"Unexpected Error\");\r\n\t\t\te.printStackTrace();\r\n\t\t\tcontrollerResponse.setStatusCode(Acq_Status_Definations.UnexpectedServerError.getId());\r\n\t\t\tcontrollerResponse.setStatusMessage(Acq_Status_Definations.UnexpectedServerError.getDescription());\r\n\t\t\tcontrollerResponse.setBody(null);\r\n\t\t}\r\n\t\treturn controllerResponse;\r\n\t}", "public abstract Error errorCheck(Model m, String command);", "@Override\n\tpublic void validate() {\n\t\tif(name==null||name.trim().equals(\"\")){\n\t\t\taddActionError(\"用户必须填写!\");\n\t\t}\n\t\t\n\t\tList l=new ArrayList();\n\t\tl=userService.QueryByTabId(\"Xxuser\", \"id\", id);\n\t\t//判断是否修改\n\t\tif(l.size()!=0){\n\t\t\t\n\t\t\tfor(int i=0;i<l.size();i++){\n\t\t\t\tXxuser xxuser=new Xxuser();\n\t\t\t\txxuser=(Xxuser)l.get(i);\n\t\t\t\tif(xxuser.getName().equals(name.trim())){\n\t\t\t\t\tSystem.out.println(\"mei gai\");\n\t\t\t\t}else{\n\t\t\t\t\tList n=new ArrayList();\n\t\t\t\t\tn=userService.QueryByTab(\"Xxuser\", \"name\", name);\n\t\t\t\t\tif(n.size()!=0){\n\t\t\t\t\t\taddActionError(\"该用户已经存在!\");\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\n\t\t\n\t\t\t\n\t\t}\n\t}", "@Override\n\tpublic void validate() {\n\t\tSystem.out.println(user+\"//\"+password);\n\t\tif (user == null || user.trim().equals(\"\")) {\n\t\t\taddFieldError(\"user\", \"The user is required\");\n\t\t}\n\t\tif (password == null || password.trim().equals(\"\")) {\n\t\t\taddFieldError(\"password\", \"password is required\");\n\t\t}\n\t}", "public ActionErrors validate(ActionMapping mapping, HttpServletRequest request) \r\n {\r\n \tActionErrors errors = super.validate(mapping, request);\r\n Validator validator = new Validator();\r\n \r\n try\r\n {\r\n \r\n // \t// checks the neoplasticCellularityPercentage\r\n \tif (neoplasticCellularityPercentage <= 0 || Double.isNaN(neoplasticCellularityPercentage) )\r\n {\r\n \t\terrors.add(ActionErrors.GLOBAL_ERROR, new ActionError(\"errors.item.required\",ApplicationProperties.getValue(\"tissuespecimenrevieweventparameters.neoplasticcellularitypercentage\")));\r\n }\r\n \r\n \r\n // \t// checks the necrosisPercentage\r\n \tif (necrosisPercentage <= 0 || Double.isNaN(necrosisPercentage) )\r\n {\r\n \t\terrors.add(ActionErrors.GLOBAL_ERROR, new ActionError(\"errors.item.required\",ApplicationProperties.getValue(\"tissuespecimenrevieweventparameters.necrosispercentage\")));\r\n }\r\n \r\n \r\n // \t// checks the lymphocyticPercentage\r\n \tif (lymphocyticPercentage <= 0 || Double.isNaN(lymphocyticPercentage) )\r\n {\r\n \t\terrors.add(ActionErrors.GLOBAL_ERROR, new ActionError(\"errors.item.required\",ApplicationProperties.getValue(\"tissuespecimenrevieweventparameters.lymphocyticpercentage\")));\r\n }\r\n \r\n \r\n // \t// checks the totalCellularityPercentage\r\n \tif (totalCellularityPercentage <= 0 || Double.isNaN(totalCellularityPercentage) )\r\n {\r\n \t\terrors.add(ActionErrors.GLOBAL_ERROR, new ActionError(\"errors.item.required\",ApplicationProperties.getValue(\"tissuespecimenrevieweventparameters.totalcellularitypercentage\")));\r\n }\r\n \r\n \r\n // \t// checks the histologicalQuality\r\n \tif (!validator.isValidOption(histologicalQuality) )\r\n {\r\n \t\terrors.add(ActionErrors.GLOBAL_ERROR, new ActionError(\"errors.item.required\",ApplicationProperties.getValue(\"tissuespecimenrevieweventparameters.histologicalquality\")));\r\n }\r\n \r\n }\r\n catch(Exception excp)\r\n {\r\n Logger.out.error(excp.getMessage());\r\n }\r\n return errors;\r\n }", "public void error(ValidationType type, String validationName, String content);", "ValidationError getValidationError();", "public void validate() {\n\t\terrors.clear();\n\t\t\n\t\tif(!this.id.isEmpty()) {\n\t\t\ttry {\n\t\t\t\tLong.parseLong(this.id);\n\t\t\t} catch(NumberFormatException ex) {\n\t\t\t\terrors.put(\"id\", \"Id is not valid.\");\n\t\t\t}\n\t\t}\n\t\t\n\t\tif(this.firstName.isEmpty()) {\n\t\t\terrors.put(\"firstName\", \"First name is obligatory!\");\n\t\t}\n\t\t\n\t\tif(this.lastName.isEmpty()) {\n\t\t\terrors.put(\"lastName\", \"Last name is obligatory!\");\n\t\t}\n\t\t\n\t\tif(this.nick.isEmpty()) {\n\t\t\terrors.put(\"nick\", \"Nick is obligatory!\");\n\t\t}\n\t\t\n\t\tif(DAOProvider.getDAO().doesNickAlreadyExist(nick)) {\n\t\t\terrors.put(\"nick\", \"Nick already exist!\");\n\t\t}\n\n\t\tif(this.email.isEmpty()) {\n\t\t\terrors.put(\"email\", \"EMail is obligatory!\");\n\t\t} else {\n\t\t\tint l = email.length();\n\t\t\tint p = email.indexOf('@');\n\t\t\tif(l<3 || p==-1 || p==0 || p==l-1) {\n\t\t\t\terrors.put(\"email\", \"EMail is not valid.\");\n\t\t\t}\n\t\t}\n\t\t\n\t\tif(this.password.isEmpty()) {\n\t\t\terrors.put(\"password\", \"Password is obligatory!\");\n\t\t}\n\t}", "public void validate(Object obj, Errors err) {\n\t\tUserLogin userLogin=(UserLogin)obj;\r\n\t\tValidationUtils.rejectIfEmptyOrWhitespace(err, \"fName\", \"fName.emptyOrSpace\");\r\n\t\tValidationUtils.rejectIfEmptyOrWhitespace(err, \"lName\", \"lName.emptyOrSpace\");\r\n\t\tValidationUtils.rejectIfEmptyOrWhitespace(err, \"mailId\", \"mailId.emptyOrSpace\");\r\n\t\tValidationUtils.rejectIfEmptyOrWhitespace(err, \"pass\", \"password.emptyOrSpace\");\r\n\t\tValidationUtils.rejectIfEmptyOrWhitespace(err, \"mob\", \"mob.emptyOrSpace\");\r\n\t\t\r\n\t\t//Business rule related Validation \r\n\t\tif(userLogin.getfName()!=null && userLogin.getfName().trim().length()>0) {\r\n\t\t\tif(userLogin.getfName().trim().length()>20)\r\n\t\t\t\terr.rejectValue(\"fName\", \"fName.length.exceeds\");\r\n\t\t}\r\n\t\t\r\n\t\tif(userLogin.getlName()!=null && userLogin.getlName().trim().length()>0) {\r\n\t\t\tif(userLogin.getlName().trim().length()>10)\r\n\t\t\t\terr.rejectValue(\"lName\", \"lName.length.exceeds\");\r\n\t\t}\r\n\t\t\r\n\t\tif(userLogin.getMob()!=null && userLogin.getMob().trim().length()>0) {\r\n\t\t\tif(userLogin.getMob().trim().length()!=10)\r\n\t\t\t\terr.rejectValue(\"mob\", \"mob.length.exceeds\");\r\n\t\t}\r\n\t\t\r\n\t\tif(userLogin.getMailId()!=null && userLogin.getMailId().trim().length()>0) {\r\n\t\t\tif(userLogin.getMailId().trim().length()>=20 ) {\r\n\t\t\t\terr.rejectValue(\"mailId\", \"mailId.length.exceeds\");\r\n\t\t\t}else if(!userLogin.getMailId().contains(\"@\")) {\r\n\t\t\t\terr.rejectValue(\"mailId\", \"mailId.format.first.rule\");\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\tif(userLogin.getPass()!=null && userLogin.getPass().trim().length()>0) {\r\n\t\t\tif(userLogin.getPass().trim().length()>=10 ) {\r\n\t\t\t\terr.rejectValue(\"pass\", \"pass.length.exceeds\");\r\n\t\t\t}\r\n\t\t}\r\n\t\t//DB validations\r\n\t\tif(!registerService.validateUser(userLogin)) {\r\n\t\t\terr.rejectValue(\"mailId\", \"mailId.alreadyRegistered\");\r\n\t\t}\r\n\t\t\r\n\t}", "@Nullable\n/* */ protected abstract Prompt acceptValidatedInput(@NotNull ConversationContext paramConversationContext, @NotNull Number paramNumber);", "private boolean validateInputs() {\n if (KEY_EMPTY.equals(tenchuxe)) {\n etTenChuXe.setError(\"Vui lòng điền Tên chủ xe\");\n etTenChuXe.requestFocus();\n return false;\n\n }\n if (KEY_EMPTY.equals(sdt)) {\n etSDT.setError(\"Vui lòng điền Số điện thoại\");\n etSDT.requestFocus();\n return false;\n\n }\n if (KEY_EMPTY.equals(mota)) {\n edMoTa.setError(\"Vui lòng điền Mô tả xe\");\n edMoTa.requestFocus();\n return false;\n\n }\n if (KEY_EMPTY.equals(biensoxe)) {\n etBienSoXe.setError(\"Vui lòng điền Biển số xe\");\n etBienSoXe.requestFocus();\n return false;\n }\n if (KEY_EMPTY.equals(passwordtx)) {\n etPasswordtx.setError(\"Vui lòng điền Mật khẩu\");\n etPasswordtx.requestFocus();\n return false;\n }\n\n if (KEY_EMPTY.equals(confirmPassword)) {\n etConfirmPassword.setError(\"Vui lòng điền Xác nhận mật khẩu\");\n etConfirmPassword.requestFocus();\n return false;\n }\n if (!passwordtx.equals(confirmPassword)) {\n etConfirmPassword.setError(\"Xác nhận mật khẩu sai !\");\n etConfirmPassword.requestFocus();\n return false;\n }\n\n return true;\n }", "private boolean validate(){\n return EditorUtils.editTextValidator(generalnformation,etGeneralnformation,\"Type in information\") &&\n EditorUtils.editTextValidator(symptoms,etSymptoms, \"Type in symptoms\") &&\n EditorUtils.editTextValidator(management,etManagement, \"Type in management\");\n }", "public void inputItemDetails()\r\n\t{\r\n\t\tserialNum = inputValidSerialNum();\r\n\t\tweight = inputValidWeight();\r\n\t}", "@Override\n\tpublic void validate() {\n\t\tsuper.validate();\n\t}", "public void validate(){\r\n\t\ttry{\r\n\t\t\t//First name, last name, date of birth and email are compulsory.\r\n\t\tif(FirstName==null||LastName==null||Dob==null||Email==null) \r\n\t\t\tthrow new Exception(\"One of the field is Empty :\\n(First name / last name / dob / email )\");\r\n\t\tif(TelephoneNumber!=0||MobileNumber!=0)\r\n\t\t\tthrow new Exception(\"Enter Contact Number\");\r\n\t\t\r\n\t\t}\r\n\t\tcatch(Exception e){\r\n\t\t\tSystem.out.println(e);\r\n\t\t}\r\n\t\t\r\n\t\t/*finally{\r\n\t\t\tSystem.out.println(\"Program Executed\");\r\n\t\t}*/\r\n\t}", "protected void validate() {\n // no implementation.\n }", "private boolean validateFields(){ \n ImplLogger.enterMethod(); \n StringBuffer validationMessage = new StringBuffer();\n boolean isValidationPassed = true;\n if(!ImplValidationUtils.isAlphaSpace(pharmaNameTextField.getText())){\n validationMessage.append(ImplConst.VALIDATE_NAME);\n validationMessage.append(ImplConst.NEXT_LINE);\n pharmaNameTextField.setBackground(Color.red);\n isValidationPassed = false;\n } \n if(!ImplValidationUtils.isAlphabetOnly(userNameTextField.getText())){\n validationMessage.append(ImplConst.VALIDATE_USERNAME);\n validationMessage.append(ImplConst.NEXT_LINE);\n userNameTextField.setBackground(Color.red);\n isValidationPassed = false;\n }\n if(ImplCommonUtil.isUserNameExist(userNameTextField.getText())){\n validationMessage.append(ImplConst.VALIDATE_USERNAME_EXIST);\n validationMessage.append(ImplConst.NEXT_LINE);\n userNameTextField.setBackground(Color.red);\n isValidationPassed = false;\n }\n if(!ImplValidationUtils.isInteger(contactTextField.getText())){\n validationMessage.append(ImplConst.VALIDATE_CONTACT);\n validationMessage.append(ImplConst.NEXT_LINE);\n contactTextField.setBackground(Color.red);\n isValidationPassed = false;\n }\n if(!ImplValidationUtils.isInteger(zipCodeTextField.getText())){\n validationMessage.append(ImplConst.VALIDATE_ZIPCODE);\n validationMessage.append(ImplConst.NEXT_LINE);\n zipCodeTextField.setBackground(Color.red);\n isValidationPassed = false;\n }\n if(ImplValidationUtils.isStringEmptyOrNull(passwordField.getText())){\n validationMessage.append(ImplConst.VALIDATE_PASSWORD);\n validationMessage.append(ImplConst.NEXT_LINE);\n passwordField.setBackground(Color.red);\n isValidationPassed = false;\n }\n if(ImplValidationUtils.isStringEmptyOrNull(confirmPasswordField.getText())){\n validationMessage.append(ImplConst.CONFIRM_VALIDATE_PASSWORD);\n validationMessage.append(ImplConst.NEXT_LINE);\n confirmPasswordField.setBackground(Color.red);\n isValidationPassed = false;\n }\n if (!ImplValidationUtils.isStringEmptyOrNull(confirmPasswordField.getText()) && !confirmPasswordField.getText().equals(passwordField.getText())){\n validationMessage.append(ImplConst.CONFIRM_VALIDATE_PASSWORD);\n validationMessage.append(ImplConst.NEXT_LINE);\n isValidationPassed = false; \n }\n if(!isValidationPassed){\n JOptionPane.showMessageDialog(null,validationMessage);\n } \n ImplLogger.exitMethod();\n return isValidationPassed;\n }", "protected void validate() {\n Validator mandatoryValidator = validateMandatoryOptions();\n Validator exclusionsValidator = validateOptionExclusions();\n Validator inapplicableOptionValidator = validateInapplicableOptions();\n Validator optionalValidator = validateOptionalParameters();\n\n List<String> validationMessages = new LinkedList<>();\n\n validationMessages.addAll(mandatoryValidator.getValidationMessages());\n validationMessages.addAll(exclusionsValidator.getValidationMessages());\n validationMessages.addAll(optionalValidator.getValidationMessages());\n validationMessages.addAll(inapplicableOptionValidator.getValidationMessages());\n\n if (!validationMessages.isEmpty()) {\n String tablePathString =\n (tablePath != null) ? SourceUtils.pathToString(tablePath) : \"null\";\n throw new DeltaOptionValidationException(tablePathString, validationMessages);\n }\n }", "private void setValidators() {\n getUtils().addNoNumbers(getOriginTxt(), getValidatorTxt());\n getUtils().addNoNumbers(getDestinationTxt(), getValidatorTxt());\n getUtils().addNoNumbers(getCollectionPlaceTxt(), getValidatorTxt());\n getUtils().addNoNumbers(getDeliveryPlaceTxt(), getValidatorTxt());\n getUtils().eurosListener(getTravelValueTxt(), getValidatorTxt());\n getUtils().eurosListener(getMoneyforDriverTxt(), getValidatorTxt());\n getUtils().eurosListener(getCustomsTxt(), getValidatorTxt());\n getUtils().eurosListener(getOtherExpensesTxt(), getValidatorTxt());\n getUtils().eurosListener(getShippingExpensesTxt(), getValidatorTxt());\n //No listenerValidator for distance because, finally it is a string\n// getUtils().distanceListener(getDistanceTxt(), getValidatorTxt());\n getUtils().dateValidator(getDateTxt(), getValidatorTxt());\n getUtils().timeListener(getArriveHourTxt(), getValidatorTxt());\n getUtils().timeListener(getExitHourTxt(), getValidatorTxt());\n getUtils().timeListener(getProvidedHourTxt(), getValidatorTxt());\n\n }", "public int ValidateAndGetSupplierFields()\n {\n int error = 0;\n \n if(txtSuplId.getText() == null || txtSuplId.getText().equals(\"\")) \n {\n saveSupl.setSupplId(Integer.valueOf(\"0\"));\n }else\n {\n saveSupl.setSupplId(Integer.valueOf(txtSuplId.getText())); //pk - not expected to be null!\n }\n \n if(!ValidateFields.validateStringCharTextField(txtSuplCode.getText())) \n {\n error++;\n txtSuplCode.requestFocus();\n txtSuplCode.setStyle(\"-fx-border-color: red;\");\n \n txtError.setText(ERR_SUPLIER_CODE);\n return error;\n }else\n {\n txtSuplCode.setStyle(\"-fx-border-color: transparent;\");\n txtError.setText(\"\");\n saveSupl.setSupplCode(txtSuplCode.getText()); //Save the value to supplier object\n }\n \n if(!ValidateFields.validateStringCharTextField(txtSuplContact.getText())) \n {\n error++;\n txtSuplContact.requestFocus();\n txtSuplContact.setStyle(\"-fx-border-color: red;\");\n \n txtError.setText(ERR_SUPLIER_CONTACT);\n return error;\n }else\n {\n txtSuplContact.setStyle(\"-fx-border-color: transparent;\");\n txtError.setText(\"\");\n saveSupl.setSuplContact(txtSuplContact.getText()); //Save the value to supplier object\n }\n \n \n if(!ValidateFields.validatePhoneNumberTextField(txtSuplTel.getText())) \n {\n error++;\n txtSuplTel.requestFocus();\n txtSuplTel.setStyle(\"-fx-border-color: red;\");\n \n txtError.setText(ERR_SUPLIER_TEL);\n return error;\n }else\n {\n txtSuplTel.setStyle(\"-fx-border-color: transparent;\");\n txtError.setText(\"\");\n saveSupl.setSuplTel(txtSuplTel.getText()); //save the value\n }\n \n if(!ValidateFields.validatePhoneNumberTextField(txtSuplCell.getText())) \n {\n error++;\n txtSuplCell.requestFocus();\n txtSuplCell.setStyle(\"-fx-border-color: red;\");\n \n txtError.setText(ERR_SUPLIER_TEL);\n return error;\n }else\n {\n txtSuplCell.setStyle(\"-fx-border-color: transparent;\");\n txtError.setText(\"\");\n saveSupl.setSuplCell(txtSuplCell.getText()); //save the value\n }\n \n if(!ValidateFields.validatePhoneNumberTextField(txtSuplFax.getText())) \n {\n error++;\n txtSuplFax.requestFocus();\n txtSuplFax.setStyle(\"-fx-border-color: red;\");\n \n txtError.setText(ERR_SUPLIER_FAX);\n return error;\n }else\n {\n txtSuplFax.setStyle(\"-fx-border-color: transparent;\");\n txtError.setText(\"\");\n saveSupl.setSuplFax(txtSuplFax.getText()); //save the value\n }\n \n if(!ValidateFields.validateEmailTextField(txtSuplEmail.getText())) \n {\n error++;\n txtSuplEmail.requestFocus();\n txtSuplEmail.setStyle(\"-fx-border-color: red;\");\n \n txtError.setText(ERR_SUPLIER_EMAIL);\n return error;\n }else\n {\n txtSuplEmail.setStyle(\"-fx-border-color: transparent;\");\n txtError.setText(\"\");\n saveSupl.setSuplEmail(txtSuplEmail.getText()); //save the value\n }\n \n if(!ValidateFields.validateStringCharTextField(txtSuplBank.getText())) \n {\n error++;\n txtSuplBank.requestFocus();\n txtSuplBank.setStyle(\"-fx-border-color: red;\");\n \n txtError.setText(ERR_SUPLIER_BANK);\n return error;\n }else\n {\n txtSuplBank.setStyle(\"-fx-border-color: transparent;\");\n txtError.setText(\"\");\n saveSupl.setSuplBank(txtSuplBank.getText()); //save the value\n }\n \n if(!ValidateFields.validateIntegerNumberTextField(txtSuplBranchCode.getText())) \n {\n error++;\n txtSuplBranchCode.requestFocus();\n txtSuplBranchCode.setStyle(\"-fx-border-color: red;\");\n \n txtError.setText(ERR_SUPLIER_BRANCH_CODE);\n return error;\n }else\n {\n txtSuplBranchCode.setStyle(\"-fx-border-color: transparent;\");\n txtError.setText(\"\");\n saveSupl.setSuplBranchCode(Integer.valueOf(txtSuplBranchCode.getText())); //save the value\n }\n \n if(!ValidateFields.validateIntegerNumberTextField(txtSuplAccNum.getText())) \n {\n error++;\n txtSuplAccNum.requestFocus();\n txtSuplAccNum.setStyle(\"-fx-border-color: red;\");\n \n txtError.setText(ERR_SUPLIER_ACC);\n return error;\n }else\n {\n txtSuplAccNum.setStyle(\"-fx-border-color: transparent;\");\n txtError.setText(\"\");\n saveSupl.setSuplAccNum(Integer.valueOf(txtSuplAccNum.getText())); //Save the value to supplier object\n }\n \n if(!ValidateFields.validateStringCharTextField(txtSuplAccType.getText())) \n {\n error++;\n txtSuplAccType.requestFocus();\n txtSuplAccType.setStyle(\"-fx-border-color: red;\");\n \n txtError.setText(ERR_SUPLIER_ACC_TYPE);\n return error;\n }else\n {\n txtSuplAccType.setStyle(\"-fx-border-color: transparent;\");\n txtError.setText(\"\");\n saveSupl.setSuplAccType(txtSuplAccType.getText()); //save the value\n }\n \n if(!ValidateFields.validateStringCharTextField(txtSuplComments.getText())) \n {\n error++;\n txtSuplComments.requestFocus();\n txtSuplComments.setStyle(\"-fx-border-color: red;\");\n \n txtError.setText(ERR_SUPLEMENT_DESC);\n return error;\n }else\n {\n txtSuplComments.setStyle(\"-fx-border-color: transparent;\");\n txtError.setText(\"\");\n saveSupl.setSuplComments(txtSuplComments.getText()); //save the value\n }\n \n return error;\n }", "private ValidationError() {\n }", "@Override\r\n\tpublic void Validate() {\n\r\n\t}", "private void checkUserInput() {\n }", "protected void validate(String operationType) throws Exception\r\n\t{\r\n\t\tsuper.validate(operationType);\r\n\r\n\t\tMPSString id_validator = new MPSString();\r\n\t\tid_validator.validate(operationType, id, \"\\\"id\\\"\");\r\n\t\t\r\n\t\tMPSBoolean secure_access_only_validator = new MPSBoolean();\r\n\t\tsecure_access_only_validator.validate(operationType, secure_access_only, \"\\\"secure_access_only\\\"\");\r\n\t\t\r\n\t\tMPSString svm_ns_comm_validator = new MPSString();\r\n\t\tsvm_ns_comm_validator.setConstraintMaxStrLen(MPSConstants.GENERIC_CONSTRAINT, 10);\r\n\t\tsvm_ns_comm_validator.setConstraintMinStrLen(MPSConstants.GENERIC_CONSTRAINT, 1);\r\n\t\tsvm_ns_comm_validator.validate(operationType, svm_ns_comm, \"\\\"svm_ns_comm\\\"\");\r\n\t\t\r\n\t\tMPSString ns_br_interface_validator = new MPSString();\r\n\t\tns_br_interface_validator.setConstraintMaxStrLen(MPSConstants.GENERIC_CONSTRAINT, 10);\r\n\t\tns_br_interface_validator.setConstraintMinStrLen(MPSConstants.GENERIC_CONSTRAINT, 1);\r\n\t\tns_br_interface_validator.validate(operationType, ns_br_interface, \"\\\"ns_br_interface\\\"\");\r\n\t\t\r\n\t\tMPSBoolean vm_auto_poweron_validator = new MPSBoolean();\r\n\t\tvm_auto_poweron_validator.validate(operationType, vm_auto_poweron, \"\\\"vm_auto_poweron\\\"\");\r\n\t\t\r\n\t\tMPSString ns_br_interface_2_validator = new MPSString();\r\n\t\tns_br_interface_2_validator.setConstraintMaxStrLen(MPSConstants.GENERIC_CONSTRAINT, 10);\r\n\t\tns_br_interface_2_validator.setConstraintMinStrLen(MPSConstants.GENERIC_CONSTRAINT, 1);\r\n\t\tns_br_interface_2_validator.validate(operationType, ns_br_interface_2, \"\\\"ns_br_interface_2\\\"\");\r\n\t\t\r\n\t\tMPSInt init_status_validator = new MPSInt();\r\n\t\tinit_status_validator.validate(operationType, init_status, \"\\\"init_status\\\"\");\r\n\t\t\r\n\t}", "public void textFieldValidator(KeyEvent event) {\n TextFieldLimited source =(TextFieldLimited) event.getSource();\n if (source.equals(partId)) {\n isIntegerValid(event);\n } else if (source.equals(maximumInventory)) {\n isIntegerValid(event);\n } else if (source.equals(partName)) {\n isCSVTextValid(event);\n } else if (source.equals(inventoryCount)) {\n isIntegerValid(event);\n } else if (source.equals(minimumInventory)) {\n isIntegerValid(event);\n } else if (source.equals(variableTextField)) {\n if (inHouse.isSelected()) {\n isIntegerValid(event);;\n } else {\n isCSVTextValid(event);\n }\n } else if (source.equals(partPrice)) {\n isDoubleValid(event);\n } else return;\n }", "@Nullable\n/* */ protected String getFailedValidationText(@NotNull ConversationContext context, @NotNull String invalidInput) {\n/* 57 */ if (NumberUtils.isNumber(invalidInput)) {\n/* 58 */ return getFailedValidationText(context, NumberUtils.createNumber(invalidInput));\n/* */ }\n/* 60 */ return getInputNotNumericText(context, invalidInput);\n/* */ }", "private void setupRequiredValidation() {\n requiredMafExpressions.put(FIELD_HUGO_SYMBOL, Pattern.compile(\"\\\\S+\"));\r\n requiredFieldDescriptions.put(FIELD_HUGO_SYMBOL, \"may not be blank\");\r\n requiredMafExpressions.put(FIELD_ENTREZ_GENE_ID, Pattern.compile(\"\\\\d+\")); // number\r\n requiredFieldDescriptions.put(FIELD_ENTREZ_GENE_ID, \"must be an integer number\");\r\n requiredMafExpressions.put(FIELD_MATCHED_NORM_SAMPLE_BARCODE, QcLiveBarcodeAndUUIDValidatorImpl.ALIQUOT_BARCODE_PATTERN);\r\n requiredFieldDescriptions.put(FIELD_MATCHED_NORM_SAMPLE_BARCODE, \"must be a full aliquot barcode\");\r\n requiredMafExpressions.put(FIELD_TUMOR_SAMPLE_BARCODE, QcLiveBarcodeAndUUIDValidatorImpl.ALIQUOT_BARCODE_PATTERN);\r\n requiredFieldDescriptions.put(FIELD_TUMOR_SAMPLE_BARCODE, \"must be a full aliquot barcode\");\r\n requiredMafExpressions.put(FIELD_VALIDATION_STATUS, Pattern.compile(\"Valid|Wildtype|Unknown|\\\\S?\"));\r\n requiredFieldDescriptions.put(FIELD_VALIDATION_STATUS, \"must be Valid, Wildtype, Unknown, or blank\");\r\n requiredMafExpressions.put(FIELD_CHROMOSOME, Pattern.compile(\"\\\\S+\"));\r\n requiredFieldDescriptions.put(FIELD_CHROMOSOME, \"must be one of: X, Y, M, 1-22, or full name of unassigned fragment\");\r\n setupMafSpecificChecks();\r\n }", "@Override\n public List<String> validateUserInput() throws STException {\n final List<String> msgs = new ArrayList<String>() ;\n\n String tmp = null ;\n if( super.useProxyCB.isSelected() ) {\n\n tmp = super.proxyHostTF.getText() ;\n if( StringUtil.isEmptyOrNull( tmp ) ) {\n msgs.add( I18N.MSG_PROXY_HOST_INVALID ) ;\n }\n\n tmp = super.proxyPortTF.getText() ;\n if( StringUtil.isEmptyOrNull( tmp ) ) {\n msgs.add( I18N.MSG_PROXY_PORT_INVALID ) ;\n }\n }\n\n if( super.useProxyAuthCB.isSelected() ) {\n\n if( !super.useProxyCB.isSelected() ) {\n msgs.add( I18N.MSG_PROXY_DISABLED ) ;\n }\n\n tmp = super.userIdTF.getText() ;\n if( StringUtil.isEmptyOrNull( tmp ) ) {\n msgs.add( I18N.MSG_PROXY_USER_INVALID ) ;\n }\n\n tmp = new String( super.passwordTF.getPassword() ) ;\n if( StringUtil.isEmptyOrNull( tmp ) ) {\n msgs.add( I18N.MSG_PROXY_PWD_INVALID ) ;\n }\n }\n\n return msgs ;\n }", "@Override\n public void validate(MessageContainer messages) {\n // Verify that they user entered a title\n if (StringUtils.isBlank(madlib.getTitle())) {\n messages.addError(INPUT_NAME_MADLIB, \"error.validation.title.missing\");\n }\n // Verify that they user entered all the nouns\n if (StringUtils.isBlank(madlib.getNoun1()) || StringUtils.isBlank(madlib.getNoun2()) ||\n StringUtils.isBlank(madlib.getNoun3())) {\n messages.addError(INPUT_NAME_MADLIB, \"error.validation.noun.missing\");\n }\n // Verify that they user entered all the adjectives\n if (StringUtils.isBlank(madlib.getAdjective1()) || StringUtils.isBlank(madlib.getAdjective2()) ||\n StringUtils.isBlank(madlib.getAdjective3())) {\n messages.addError(INPUT_NAME_MADLIB, \"error.validation.adjective.missing\");\n }\n }", "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 void validate() {\n ASPManager mgr = getASPManager();\n ASPTransactionBuffer trans = mgr.newASPTransactionBuffer();\n ASPCommand cmd;\n String val = mgr.readValue(\"VALIDATE\");\n// String PRICE = \"\";\n \n \n if (\"CONTRACT_ID\".equals(val)) {\n cmd = trans.addCustomFunction(\"GETCONTRACTNAME\", \n \"PROJECT_CONTRACT_API.Get_Contract_Desc\", \"CONTRACT_NAME\");\n cmd.addParameter(\"PROJ_NO,CONTRACT_ID\");\n \n cmd = trans.addCustomFunction(\"GETSECONDSIDE\", \n \"PROJECT_CONTRACT_API.Get_Secend_Side\", \"SECOND_SIDE\");\n cmd.addParameter(\"PROJ_NO,CONTRACT_ID\");\n \n trans = mgr.validate(trans);\n String contractName = trans.getValue(\"GETCONTRACTNAME/DATA/CONTRACT_NAME\");\n String SECONDSIDE = trans.getValue(\"GETSECONDSIDE/DATA/SECOND_SIDE\");\n trans.clear();\n cmd = trans.addCustomFunction(\"GETSECONDSIDENAME\", \n \"SUPPLIER_INFO_API.GET_NAME\", \"SECOND_SIDE_NAME\");\n cmd.addParameter(\"SECOND_SIDE\",SECONDSIDE);\n \n trans = mgr.validate(trans);\n \n String SECONDSIDENAME = trans.getValue(\"GETSECONDSIDENAME/DATA/SECOND_SIDE_NAME\");\n\n String txt = ((mgr.isEmpty(contractName)) ? \"\" : contractName ) + \"^\"\n + ((mgr.isEmpty(SECONDSIDE)) ? \"\" : SECONDSIDE ) + \"^\" \n + ((mgr.isEmpty(SECONDSIDENAME)) ? \"\" : SECONDSIDENAME ) + \"^\";\n \n mgr.responseWrite(txt);\n }\n mgr.endResponse();\n }", "public void validate() {\n ASPManager mgr = getASPManager();\n ASPTransactionBuffer trans = mgr.newASPTransactionBuffer();\n ASPCommand cmd;\n String val = mgr.readValue(\"VALIDATE\");\n// String PRICE = \"\";\n \n \n if (\"CONTRACT_ID\".equals(val)) {\n cmd = trans.addCustomFunction(\"GETCONTRACTNAME\", \n \"PROJECT_CONTRACT_API.Get_Contract_Desc\", \"CONTRACT_NAME\");\n cmd.addParameter(\"PROJ_NO,CONTRACT_ID\");\n \n cmd = trans.addCustomFunction(\"GETSECONDSIDE\", \n \"PROJECT_CONTRACT_API.Get_Secend_Side\", \"SECOND_SIDE\");\n cmd.addParameter(\"PROJ_NO,CONTRACT_ID\");\n \n trans = mgr.validate(trans);\n String contractName = trans.getValue(\"GETCONTRACTNAME/DATA/CONTRACT_NAME\");\n String SECONDSIDE = trans.getValue(\"GETSECONDSIDE/DATA/SECOND_SIDE\");\n trans.clear();\n cmd = trans.addCustomFunction(\"GETSECONDSIDENAME\", \n \"SUPPLIER_INFO_API.GET_NAME\", \"SECOND_SIDE_NAME\");\n cmd.addParameter(\"SECOND_SIDE\",SECONDSIDE);\n \n trans = mgr.validate(trans);\n \n String SECONDSIDENAME = trans.getValue(\"GETSECONDSIDENAME/DATA/SECOND_SIDE_NAME\");\n\n String txt = ((mgr.isEmpty(contractName)) ? \"\" : contractName ) + \"^\"\n + ((mgr.isEmpty(SECONDSIDE)) ? \"\" : SECONDSIDE ) + \"^\" \n + ((mgr.isEmpty(SECONDSIDENAME)) ? \"\" : SECONDSIDENAME ) + \"^\";\n \n mgr.responseWrite(txt);\n }\n mgr.endResponse();\n }", "private static Boolean validateForm() {\n\t\t\tBoolean valid = true;\n\t\t\tSystem.out.println(\"Index: \"+portfolio.findByCode(pCode.getText()));\n\t\t\tif(pCode.getText().equals(\"\")) {\n\t\t\t\tmsgCode.setText(\"Project code is required\");\n\t\t\t\tvalid = false;\n\t\t\t} else if(portfolio.findByCode(pCode.getText()) >= 0) {\n\t\t\t\tmsgCode.setText(\"Project already exists!\");\n\t\t\t\tvalid = false;\n\t\t\t} else {\n\t\t\t\tmsgCode.setText(\"\");\n\t\t\t}\n\t\t\t\n\t\t\tif(pName.getText().equals(\"\")) {\n\t\t\t\tmsgName.setText(\"Project Name is required!\");\n\t\t\t\tvalid = false;\n\t\t\t} else {\n\t\t\t\tmsgName.setText(\"\");\n\t\t\t}\n\t\t\t\n\t\t\tif(pClient.getText().equals(\"\")) {\n\t\t\t\tmsgClient.setText(\"Client is required!\");\n\t\t\t\tvalid = false;\n\t\t\t} else {\n\t\t\t\tmsgClient.setText(\"\");\n\t\t\t}\n\t\t\t\n\t\t\tif(pSDate.getText().equals(\"\")) {\n\t\t\t\tmsgSDate.setText(DATE_FORMAT + \" Start Date is required\");\n\t\t\t\tvalid = false;\n\t\t\t} else {\n\t\t\t\tmsgSDate.setText(DATE_FORMAT);\n\t\t\t}\n\t\t\t\n\t\t\tswitch(pType) {\n\t\t\tcase \"o\":\n\t\t\t\tif(pDeadline.getText().equals(\"\")) {\n\t\t\t\t\tmsgDeadline.setText(DATE_FORMAT + \" Deadline is required!\");\n\t\t\t\t\tvalid = false;\n\t\t\t\t} else {\n\t\t\t\t\tmsgDeadline.setText(DATE_FORMAT);\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\ttry {\n\t\t\t\t\tDouble b = Double.parseDouble(pBudget.getText());\n\t\t\t\t\tif(b<0) {\n\t\t\t\t\t\tmsgBudget.setText(\"Must be a positive value\");\n\t\t\t\t\t\tvalid=false;\n\t\t\t\t\t} else {\n\t\t\t\t\t\tmsgBudget.setText(\"\");\n\t\t\t\t\t}\n\t\t\t\t} catch (Exception e) {\n\t\t\t\t\tmsgBudget.setText(\"Invalid number!\");\n\t\t\t\t\tvalid = false;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\ttry {\n\t\t\t\t\tint c = Integer.parseInt(pCompletion.getText());\n\t\t\t\t\tif(c<0 || c>100) {\n\t\t\t\t\t\tmsgCompletion.setText(\"Value must be between 0 and 100\");\n\t\t\t\t\t\tvalid = false;\n\t\t\t\t\t} else {\n\t\t\t\t\t\tmsgCompletion.setText(\"\");\n\t\t\t\t\t}\n\t\t\t\t} catch (Exception e) {\n\t\t\t\t\tmsgCompletion.setText(\"Invalid number!\");\n\t\t\t\t\tvalid = false;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tbreak;\n\t\t\t\t\n\t\t\tcase \"f\":\n\t\t\t\tif(pEndDate.getText().equals(\"\")) {\n\t\t\t\t\tmsgEndDate.setText(DATE_FORMAT + \" End date is required!\");\n\t\t\t\t\tvalid = false;\n\t\t\t\t} else {\n\t\t\t\t\tmsgEndDate.setText(DATE_FORMAT);\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\ttry {\n\t\t\t\t\tDouble b = Double.parseDouble(pTotalCost.getText());\n\t\t\t\t\tif(b<0){\n\t\t\t\t\t\tmsgTotalCost.setText(\"Must be a positive number\");\n\t\t\t\t\t\tvalid=false;\n\t\t\t\t\t} else {\n\t\t\t\t\t\tmsgTotalCost.setText(\"\");\n\t\t\t\t\t}\n\t\t\t\t} catch (Exception e) {\n\t\t\t\t\tmsgTotalCost.setText(\"Invalid number!\");\n\t\t\t\t\tvalid = false;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t}\n\t\t\treturn valid;\n\t\t}", "@Override\n\tpublic void validate(Object arg0, Errors arg1) {\n\n\t}", "@Override\n\tpublic void validateRequest(BaseRequest request) {\n\t\t\n\t}" ]
[ "0.6481308", "0.6420802", "0.6228055", "0.6067439", "0.6052541", "0.6039231", "0.602913", "0.6005494", "0.59959084", "0.59722775", "0.59524703", "0.59511536", "0.593392", "0.5925371", "0.5912965", "0.58939177", "0.5887017", "0.58813673", "0.5877037", "0.58475095", "0.58286786", "0.58286786", "0.58286786", "0.58253413", "0.5821369", "0.5821369", "0.58110106", "0.5787412", "0.5775841", "0.57642496", "0.5749882", "0.5734501", "0.57258165", "0.5721417", "0.5715768", "0.5712042", "0.5708114", "0.570353", "0.56897634", "0.5689252", "0.5680709", "0.5673987", "0.5665732", "0.5648733", "0.5626948", "0.5619009", "0.5608512", "0.5604581", "0.5604454", "0.5601847", "0.55957824", "0.5586326", "0.5583646", "0.55781156", "0.5563393", "0.5563379", "0.55483764", "0.55415016", "0.55370516", "0.55353874", "0.5535205", "0.552293", "0.5504814", "0.54987603", "0.54970443", "0.54947716", "0.5494723", "0.5491532", "0.54863524", "0.5485472", "0.54833305", "0.54798573", "0.54724896", "0.5469482", "0.54530996", "0.544991", "0.54387677", "0.5438591", "0.54356897", "0.54304975", "0.54283756", "0.5422892", "0.541368", "0.5412609", "0.5410918", "0.54087067", "0.5408471", "0.5406462", "0.5403289", "0.5400214", "0.5395066", "0.5388005", "0.5381559", "0.5378921", "0.5376805", "0.5371482", "0.5370396", "0.5370396", "0.53684825", "0.5365881", "0.5363467" ]
0.0
-1
constructor Constructor of data structure
public T3_row_structure(String name, String startRank, String startYear, String endRank, String endYear, String trend){ this.name = new SimpleStringProperty(name); this.startRank = new SimpleStringProperty(startRank); this.startYear = new SimpleStringProperty(startYear); this.endRank = new SimpleStringProperty(endRank); this.endYear = new SimpleStringProperty(endYear); this.trend = new SimpleStringProperty(trend); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public DesignADataStructure() {\n arr = new ArrayList<>();\n map = new HashMap<>();\n }", "public Data() {}", "public DataStructure() {\r\n firstX = null;\r\n lastX = null;\r\n firstY = null;\r\n lastY = null;\r\n size = 0;\r\n }", "public Data() {\n }", "public Data() {\n }", "public AllOOneDataStructure() {\n map = new HashMap<>();\n vals = new HashMap<>();\n maxKey = minKey = \"\";\n max = min = 0;\n }", "public AllOOneDataStructure() {\n\t\thead=new Node(\"\", 0);\n\t\ttail=new Node(\"\", 0);\n\t\thead.next=tail;\n\t\ttail.prev=head;\n\t\tmap=new HashMap<>();\n\t}", "public OccList()\n {\n int capacity = 8;\n data = new Occ[capacity];\n // initialize data with empty occ\n for (int i=0; i<capacity; i++) data[i] = new Occ(); \n }", "public Data(SearchTree<Software> dataStructure){\n administratorMyArray = new ArrayList<>();\n IDList = new ArrayList<>();\n products = dataStructure;\n money=0.0;\n }", "public S()\n {\n // inizializzazione dell'array\n v = new Object[CAPACITY];\n\n // inizializzazione dei buckets\n for (int i = 0; i < v.length; i++)\n v[i] = new ListNode();\n \n // inizializzazione del numero di elementi\n size = 0;\n }", "public Data() {\n \n }", "public TreeDictionary() {\n\t\t\n\t}", "public MyHashMap() {\r\n data = new Node[DEFAULT_CAPACITY];\r\n }", "public Constructor(){\n\t\t\n\t}", "public Data()\n {\n //initialize the queues\n for (int i=0;i<10;i++)\n data[i] = new LinkedList<String >();\n }", "MyHashMap(int initialCapacity) {\r\n data = new Node[initialCapacity];\r\n }", "public CompositeData()\r\n {\r\n }", "public JdbTree() {\r\n this(new Object [] {});\r\n }", "public DesastreData() { //\r\n\t}", "Constructor() {\r\n\t\t \r\n\t }", "Data() {\n\t\t// dia = 01;\n\t\t// mes = 01;\n\t\t// ano = 1970;\n\t\tthis(1, 1, 1970); // usar um construtor dentro de outro\n\t}", "public DS_My() {\n // Set field variables\n this.CAPACITY = 500;\n this.ls = new Pair[CAPACITY];\n this.size = 0;\n }", "public Dictionary(){\n root = null;\n numItems = 0;\n }", "public BVHashtable()\n {\n super();\n }", "public TradeData() {\r\n\r\n\t}", "public DFSGraph() {\n this(new HashMap<>(), HashMap::new, HashSet::new, HashSet::new);\n }", "public MyHashTable( )\r\n\t{\r\n\t\tthis(DEFAULTTABLESIZE);\r\n\t\t\r\n\t\t\t\r\n\t}", "public SensorData() {\n\n\t}", "public InitialData(){}", "public Struct(String a, int b){\r\n\tid=a;\r\n\tsize=b;\t\r\n\tform=0;\r\n }", "public MyHashTable( )\n {\n this( DEFAULT_TABLE_SIZE );\n }", "public NetworkData() {\n }", "public JsonDataset() {\r\n\t\tsuper();\r\n\t\tlogger.trace(\"JsonDataset() - start\");\r\n\t\tlogger.trace(\"JsonDataset() - end\");\r\n\t}", "public DataSet() {\n labels = new HashMap<>();\n locations = new HashMap<>();\n counter= new AtomicInteger(0);\n }", "public mainData() {\n }", "public KdTree() \r\n\t{\r\n\t}", "public HashArray(){\n this(10);\n }", "public Graph()\r\n\t{\r\n\t\tthis.adjacencyMap = new HashMap<String, HashMap<String,Integer>>();\r\n\t\tthis.dataMap = new HashMap<String,E>();\r\n\t}", "public MagicDictionary() {\n root=new Node();\n }", "public Struct(String b){\r\n\tid=b;\r\n\tsize=0;\r\n\tform=0;\r\n }", "public BinarySearchTree() {\n\n\t}", "public CirArrayList() {\n // todo: default constructor\n head = tail = curSize = 0;\n data = (E[])new Object[10];\n }", "public StringDataList() {\n }", "public DataSet(){\r\n\t\tdocs = Lists.newArrayList();\r\n//\t\t_docs = Lists.newArrayList();\r\n\t\t\r\n\t\tnewId2trnId = HashBiMap.create();\r\n\t\t\r\n\t\tM = 0;\r\n\t\tV = 0;\r\n\t}", "public BinaryTree() {\n\t}", "public JdbTree(Object [] value) {\r\n super(value);\r\n commonInit();\r\n }", "public Graph()\r\n {\r\n this( \"x\", \"y\" );\r\n }", "@SuppressWarnings(\"unchecked\")\r\n\tpublic HashMap() {\r\n\t\tdata = (Node<MapEntry<K, V>>[])new Node[INITIAL_SIZE];\r\n\t\tfor(int i = 0; i < data.length; i++)\t\t\t\t\t\t\t//For every element in data...\r\n\t\t\tdata[i] = new Node<MapEntry<K,V>>(new MapEntry<K,V>(null));\t//Add a head node to it.\r\n\t\t\r\n\t\t//TODO: May have to just default as null and in the put method, if the slot is null, then put a head node in it. The post-ceding code after that is logically correct!\r\n\t\r\n\t\tsize = 0;\t//Redundant but helpful to see that the size is 0\r\n\t}", "public StringData1() {\n }", "public DataSet() {\r\n \r\n }", "public GraphInfo(){}", "public Dictionary () {\n list = new DoubleLinkedList<>();\n this.count = 0;\n }", "public MyHashTable() {\n\t\tthis(DefaultCapacity);\n\t}", "public Student()\r\n {\r\n // initialise variables with defult values\r\n ID=-1;\r\n Name=null;\r\n University=null;\r\n Department=null;\r\n term=0;\r\n cgpa=0.0;\r\n Gpa=new double[10];\r\n Creditsandgrades=new double[10][10][10];\r\n }", "public CompanyData() {\r\n }", "public Node(T data) {this.data = data;}", "public DataStructure() {\n\t\tthis.minx = null;\n\t\tthis.maxx = null;\n\t\tthis.miny = null;\n\t\tthis.maxy = null;\n\t\tthis.current = null;\n\t\tsize = 0;\n\t}", "public Stat() {\n\t\tdata = new SuperArray();\n }", "public MyHashMap() {\n\t\tthis(INIT_CAPACITY);\n\t}", "public Vector() {\n construct();\n }", "public Dictionary () {\n\t\tsuper();\n\t\t//words = new ArrayList < String > () ;\n\t}", "public StringData() {\n\n }", "public KdTree() \n\t {\n\t\t \n\t }", "public ListElement()\n\t{\n\t\tthis(null, null, null); //invokes constructor with 3 arguments\n\t}", "public MyHashMap() {\n array = new TreeNode[1024];\n\n }", "public BinaryTree(){}", "public TradeRecordStruct() {\n }", "public SimpleHashtable() {\r\n\t\tthis(DEFAULT_TABLE_SIZE);\r\n\t}", "public Datum() {\n id = idGen.incrementAndGet();\n parentDatumID = null;\n }", "public Structure() {\n this.universeSize = universeSize;\n this.E = GraphFactory.emptyGraph();\n this.relations = new HashMap<>();\n this.arity = new HashMap<>();\n this.universeSize = -1;\n }", "public MyArrayList() {\n data = new Object[10];\n }", "public DataTable() {\n\n\t\t// In this application, we use HashMap data structure defined in\n\t\t// java.util.HashMap\n\t\tdc = new HashMap<String, DataColumn>();\n\t}", "Structure createStructure();", "public CreateData() {\n\t\t\n\t\t// TODO Auto-generated constructor stub\n\t}", "public BinaryTree()\r\n\t{\r\n\t\t// Initialize field values\r\n\t\tthis.counter = 0;\r\n\t\tthis.arrayCounter = 0;\r\n\t\tthis.root = null;\r\n\t}", "@SuppressWarnings(\"unchecked\")\r\n\tpublic HashTableMap() {\r\n\t\tK = new LinkedList[10];\r\n\t\tV = new LinkedList[10];\r\n\t}", "public Graph() {\n\t\tdictionary=new HashMap<>();\n\t}", "public Data() {\n this.customers = new HashMap<>();\n this.orders = new HashMap<>();\n this.siteVisits = new HashMap<>();\n this.imageUploads = new HashMap<>();\n }", "public LineData()\n\t{\n\t}", "public UnivariateStatsData() {\n super();\n }", "public Datos(){\n }", "public ChainedHashTable()\n {\n this(DEFAULT_CAPACITY);\n }", "public DataInt() {\n }", "public Node(final Object key, final Object value) {\r\n this.k = new Object[]{key};\r\n this.v = new Object[]{value};\r\n this.c = null;\r\n this.kcount = 1;\r\n }", "public BstTable() {\n\t\tbst = new Empty<Key, Value>();\n\t}", "public Node(T data) {\n\n this.data = data;\n\n\n }", "public DoublyLinkedList() {\r\n\t\tinitializeDataFields();\r\n\t}", "public SegmentTree() {}", "public BinarySearchTree() {}", "public Dictionary(String dataname, String username){\n this(dataname, null, username);\n }", "public KdTree() {\n }", "public SegmentInformationTable()\n\t{\n\n\t}", "public MDS() {\n\t\ttreeMap = new TreeMap<>();\n\t\thashMap = new HashMap<>();\n\t}", "public BinarySearchTree()\n\t{\n\t\tsuper();\n\t}", "public KWArrayList(){\n capacity = INITIAL_CAPACITY;\n theData = (E[]) new Object[capacity];\n }", "public DynArrayList() {\n data =(E[]) new Object[CAPACITY];\n }", "DataHRecordData() {}", "public ContasCorrentes(){\n this(0,\"\",0.0,0.0,0);\n }", "public JdbTree(Hashtable value) {\r\n super(value);\r\n commonInit();\r\n }", "public MyHashMap() {\n keys = new MapNode[n];\n vals = new MapNode[n];\n for (int i=0; i < n ; ++i) {\n keys[i] = new MapNode();\n vals[i] = new MapNode();\n }\n }", "public MyHashMap() {\n\n }" ]
[ "0.7076258", "0.6998424", "0.69544095", "0.68752015", "0.68752015", "0.68295574", "0.67573947", "0.6727266", "0.6697593", "0.6695225", "0.668104", "0.66637754", "0.6638212", "0.6589588", "0.6563197", "0.64201564", "0.6413602", "0.63903725", "0.6375416", "0.6366404", "0.6351113", "0.6307385", "0.63050145", "0.63014716", "0.628246", "0.6281224", "0.6264161", "0.625714", "0.6249101", "0.6231748", "0.62313735", "0.6228461", "0.6226235", "0.62223315", "0.6201409", "0.6200091", "0.6199845", "0.61898124", "0.61799884", "0.61712474", "0.6170561", "0.6157853", "0.615498", "0.613963", "0.61386454", "0.6123438", "0.610577", "0.6090978", "0.60809404", "0.6074771", "0.6072735", "0.6069628", "0.6068139", "0.60581905", "0.6056912", "0.6055079", "0.6047375", "0.60454834", "0.6040137", "0.6024038", "0.6020284", "0.6019479", "0.60188097", "0.6017125", "0.6013186", "0.60107183", "0.6009942", "0.60058165", "0.600048", "0.59959257", "0.5986259", "0.5983824", "0.598382", "0.5979693", "0.59723395", "0.5969735", "0.5966317", "0.5958166", "0.5954611", "0.5953795", "0.59516627", "0.5947623", "0.59372514", "0.5937049", "0.5936035", "0.59311676", "0.59301025", "0.59228915", "0.5922656", "0.59171396", "0.59153295", "0.59138495", "0.5911947", "0.59003174", "0.5900237", "0.5891521", "0.5890983", "0.5889698", "0.58796984", "0.5879569", "0.58779985" ]
0.0
-1
The output of joystick axes can be slowed down so that after each update its output will only deviate from previous value at a maximum of the slow value.
public void setSlow(double s) { slow = Math.abs(s); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "void updateMaxTick();", "public void accelerateYU() {\n double temp;\n temp = this.getySpeed();\n if (temp >= -this.getMaxSpeed()) {\n temp += -this.getMaxSpeed() / 10;\n }\n this.setySpeed(temp);\n\n }", "public void slowDownY() {\n double temp;\n temp = this.getySpeed();\n if (temp > 0.1 || temp < -0.1) {\n temp /= 1.1;\n } else {\n temp = 0;\n }\n this.setySpeed(temp);\n }", "@Override\n public void loop() {\n float left = -gamepad1.left_stick_y;\n float right = -gamepad1.right_stick_y;\n // clip the right/left values so that the values never exceed +/- 1\n right = Range.clip(right, -1, 1);\n left = Range.clip(left, -1, 1);\n\n // scale the joystick value to make it easier to control\n // the robot more precisely at slower speeds.\n right = (float)scaleInput(right);\n left = (float)scaleInput(left);\n\n // write the values to the motors\n if (motor1!=null) {\n motor1.setPower(right);\n }\n if (motor2!=null) {\n motor2.setPower(left);\n }\n if (motor3!=null) {\n motor3.setPower(right);\n }\n if (motor4!=null) {\n motor4.setPower(left);\n }\n\n if (gamepad1.right_bumper && motor5Timer + 150 < timer) {\n motor5Forward = !motor5Forward;\n motor5Backward = false;\n motor5Timer = timer;\n } else if (gamepad1.left_bumper && motor5Timer + 150 < timer) {\n motor5Forward = false;\n motor5Backward = !motor5Backward;\n motor5Timer = timer;\n }\n if (motor5!=null) {\n if (gamepad1.dpad_left)\n {\n motor5Forward = false;\n motor5.setPower(1);\n }\n else if (gamepad1.dpad_right)\n {\n motor5Backward = false;\n motor5.setPower(-1);\n }\n else if (motor5Forward)\n {\n motor5.setPower(1);\n }\n else if (motor5Backward)\n {\n motor5.setPower(-1);\n }\n else\n {\n motor5.setPower(0);\n }\n }\n if (motor6!=null) {\n if (gamepad1.dpad_up)\n {\n motor6.setPower(1);\n }\n else if (gamepad1.dpad_down)\n {\n motor6.setPower(-1);\n }\n else\n {\n motor6.setPower(0);\n }\n\n\n }\n if (motor7!=null) {\n if (gamepad1.dpad_left)\n {\n motor7.setPower(1);\n }\n else if (gamepad1.dpad_right)\n {\n motor7.setPower(-1);\n }\n else\n {\n motor7.setPower(0);\n }\n }\n if (motor8!=null) {\n if (gamepad1.dpad_up)\n {\n motor8.setPower(1);\n }\n if (gamepad1.dpad_down)\n {\n motor8.setPower(-1);\n }\n else\n {\n motor8.setPower(0);\n }\n }\n if (timer == 0) {\n servo1pos=0.5;\n servo2pos=0.5;\n servo3pos=0.5;\n servo4pos=0.5;\n servo5pos=0.5;\n servo6pos=0.5;\n }\n timer++;\n\n if (servo1!=null){\n if (gamepad1.right_bumper) {\n servo1pos += 0.01;\n }\n if (gamepad1.left_bumper) {\n servo1pos -= 0.01;\n }\n servo1pos = Range.clip(servo1pos, 0.00, 1.0);\n\n servo1.setPosition(servo1pos);\n }\n if (servo2!=null){\n if (gamepad1.x) {\n servo2pos += 0.01;\n }\n if (gamepad1.y) {\n servo2pos -= 0.01;\n }\n servo2pos = Range.clip(servo2pos, 0.00, 1.0);\n\n servo2.setPosition(servo2pos);\n }\n if (servo3!=null){\n if (gamepad1.a) {\n servo3pos += 0.01;\n }\n if (gamepad1.b) {\n servo3pos -= 0.01;\n }\n servo3pos = Range.clip(servo3pos, 0.00, 1.0);\n\n servo3.setPosition(servo3pos);\n }\n if (servo4!=null){\n if (gamepad1.right_bumper) {\n servo4pos -= 0.01;\n }\n if (gamepad1.left_bumper) {\n servo4pos += 0.01;\n }\n servo4pos = Range.clip(servo4pos, 0.00, 1.0);\n\n servo4.setPosition(servo4pos);\n }\n if (servo5!=null){\n if (gamepad1.x) {\n servo5pos -= 0.01;\n }\n if (gamepad1.y) {\n servo5pos += 0.01;\n }\n servo5pos = Range.clip(servo5pos, 0.00, 1.0);\n\n servo5.setPosition(servo5pos);\n }\n if (servo6!=null){\n if (gamepad1.a) {\n servo6pos -= 0.01;\n }\n if (gamepad1.b) {\n servo6pos += 0.01;\n }\n servo6pos = Range.clip(servo6pos, 0.00, 1.0);\n\n servo6.setPosition(servo6pos);\n }\n if (servo1!=null){\n telemetry.addData(\"servoBumpers\", servo1.getPosition());}\n if (servo2!=null){\n telemetry.addData(\"servoX/Y\", servo2.getPosition());}\n if (servo3!=null){\n telemetry.addData(\"servoA/B\", servo3.getPosition());}\n if (servo4!=null){\n telemetry.addData(\"servoBumpers-\", servo4.getPosition());}\n if (servo5!=null){\n telemetry.addData(\"servoX/Y-\", servo5.getPosition());}\n if (servo6!=null){\n telemetry.addData(\"servoA/B-\", servo6.getPosition());}\n if (motor1 != null) {\n telemetry.addData(\"Motor1\", motor1.getCurrentPosition());\n }\n }", "public void SpeedControl(long iDasherX, long iDasherY, double dFrameRate) {}", "@Override\n public void loop() {\n double left;\n double right;\n\n // Run wheels in tank mode (note: The joystick goes negative when pushed forwards, so negate it)\n if(!reverseMode)\n {\n left = -gamepad1.left_stick_y;\n right = -gamepad1.right_stick_y;\n }\n else\n {\n left = gamepad1.right_stick_y;\n right = gamepad1.left_stick_y;\n }\n\n targetSpeedLeft = left * driveSpeed;\n targetSpeedRight = right * driveSpeed;\n\n currentLiftSpeed = 0.0;\n if(gamepad1.left_trigger >= 0.1) {\n currentLiftSpeed = -LIFT_MAX_DOWN_SPEED;\n }\n if(gamepad1.right_trigger >= 0.1) {\n currentLiftSpeed = LIFT_MAX_DOWN_SPEED;\n }\n //if(gamepad2.left_trigger) {\n // currentLiftSpeed = -gamepad2.left_bumper * LIFT_MAX_DOWN_SPEED;\n //}\n //if(gamepad2.right_trigger) {\n // currentLiftSpeed = gamepad2.right_bumper * LIFT_MAX_UP_SPEED;\n //}\n/*\n currentSpeedArm = 0.0;\n if(gamepad1.left_trigger) {\n currentSpeedArm = -gamepad1.left_bumper * ARM_MAX_DOWN_SPEED;\n }\n if(gamepad1.right_trigger) {\n currentSpeedArm = gamepad1.right_bumper * ARM_MAX_UP_SPEED;\n }\n\n /*\n // limit acceleration by only allowing MAX_ACCEL power change per UPDATE_TIME\n if(runtime.seconds() > UPDATE_TIME)\n {\n runtime.reset();\n \n if( ((currentSpeedLeft >= 0.0) && (targetSpeedLeft >= 0.0)) ||\n ((currentSpeedLeft <= 0.0) && (targetSpeedLeft <= 0.0)))\n {\n if(Math.abs(currentSpeedLeft) > Math.abs(targetSpeedLeft)) \n {\n currentSpeedLeft = targetSpeedLeft;\n }\n else \n {\n if (currentSpeedLeft != targetSpeedLeft) {\n if (Math.abs(targetSpeedLeft - currentSpeedLeft) <= MAX_ACCEL)\n currentSpeedLeft = targetSpeedLeft;\n else {\n if (currentSpeedLeft < targetSpeedLeft)\n currentSpeedLeft += MAX_ACCEL;\n else\n currentSpeedLeft -= MAX_ACCEL;\n }\n }\n }\n\n }\n else \n {\n currentSpeedLeft = 0.0;\n }\n\n if( ((currentSpeedRight >= 0.0) && (targetSpeedRight >= 0.0)) ||\n ((currentSpeedRight <= 0.0) && (targetSpeedRight <= 0.0)))\n {\n if(Math.abs(currentSpeedRight) > Math.abs(targetSpeedRight))\n {\n currentSpeedRight = targetSpeedRight;\n }\n else\n {\n if (currentSpeedRight != targetSpeedRight) {\n if (Math.abs(targetSpeedRight - currentSpeedRight) <= MAX_ACCEL)\n currentSpeedRight = targetSpeedRight;\n else {\n if (currentSpeedRight < targetSpeedRight)\n currentSpeedRight += MAX_ACCEL;\n else\n currentSpeedRight -= MAX_ACCEL;\n }\n }\n }\n\n }\n else\n {\n currentSpeedRight = 0.0;\n }\n\n }\n */\n\n // replace acceleration limit because no longer needed\n currentSpeedLeft = targetSpeedLeft;\n currentSpeedRight = targetSpeedRight;\n\n robot.leftDriveMotor.setPower(currentSpeedLeft);\n robot.rightDriveMotor.setPower(currentSpeedRight);\n // robot.armMotor.setPower(currentSpeedArm);\n robot.liftMotor.setPower(currentLiftSpeed);\n\n\n if(gamepad1.a)\n {\n if (!aButtonHeld)\n {\n aButtonHeld = true;\n if (servoOpen) {\n servoOpen = false;\n robot.leftGrabServo.setPosition(LEFT_SERVO_CLOSED);\n robot.rightGrabServo.setPosition(RIGHT_SERVO_CLOSED);\n }\n else {\n servoOpen = true;\n robot.leftGrabServo.setPosition(LEFT_SERVO_OPEN);\n robot.rightGrabServo.setPosition(RIGHT_SERVO_OPEN);\n }\n }\n }\n else {\n aButtonHeld = false;\n }\n/*\n if(gamepad1.b)\n {\n if (!bButtonHeld)\n {\n bButtonHeld = true;\n reverseMode = !reverseMode;\n }\n }\n else\n {\n bButtonHeld = false;\n }\n\n*/\n if(gamepad1.y)\n {\n if (!yButtonHeld)\n {\n yButtonHeld = true;\n\n if(driveSpeed == MAX_SPEED) {\n driveSpeed = 0.3 * MAX_SPEED;\n slowMode = true;\n }\n else\n {\n driveSpeed = MAX_SPEED;\n slowMode = false;\n }\n }\n }\n else\n {\n yButtonHeld = false;\n }\n\n\n if(gamepad1.x)\n {\n if(!xButtonHeld)\n {\n xButtonHeld = true;\n\n if(servoUp){\n servoUp=false;\n robot.leftDragServo.setPosition(LEFT_DOWN);\n }\n else\n {\n servoUp=true;\n robot.leftDragServo.setPosition(LEFT_UP);\n }\n }\n }\n else\n {\n xButtonHeld = false;\n }\n\n telemetry.addData(\"reverse\", reverseMode);\n\n // telemetry.addData(\"currentLeft\", currentSpeedLeft);\n // telemetry.addData(\"currentRight\", currentSpeedRight);\n // telemetry.addData(\"currentArm\", currentSpeedArm);\n // telemetry.addData(\"currentLift\", currentLiftSpeed);\n telemetry.addData(\"encoderLeft\", robot.leftDriveMotor.getCurrentPosition());\n telemetry.addData(\"encoderRight\", robot.rightDriveMotor.getCurrentPosition());\n // telemetry.addData(\"reverseMode\", reverseMode);\n telemetry.addData(\"slowMode\", slowMode);\n telemetry.addData(\"Drag Servo\", robot.leftDragServo.getPosition());\n telemetry.addData(\"Touch Sensor\", robot.rearTouch.getState());\n }", "@Override\n void slowDown() {\n if (this.speed>0){\n this.speed=this.speed-1;\n }\n }", "public void updateController() {\n\t\tjoystickLXAxis = controller.getRawAxis(portJoystickLXAxis);\t\t//returns a value [-1,1]\n\t\tjoystickLYAxis = controller.getRawAxis(portJoystickLYAxis);\t\t//returns a value [-1,1]\n\t\tjoystickLPress = controller.getRawButton(portJoystickLPress);\t//returns a value {0,1}\n\t\t\n\t\t//right joystick update\n\t\tjoystickRXAxis = controller.getRawAxis(portJoystickRXAxis);\t\t//returns a value [-1,1]\n\t\tjoystickRYAxis = controller.getRawAxis(portJoystickRYAxis);\t\t//returns a value [-1,1]\n\t\tjoystickRPress = controller.getRawButton(portJoystickRPress);\t//returns a value {0,1}\n\t\t\n\t\t//trigger updates\n\t\ttriggerL = controller.getRawAxis(portTriggerL);\t\t//returns a value [0,1]\n\t\ttriggerR = controller.getRawAxis(portTriggerR);\t\t//returns a value [0,1]\n\t\t\n\t\t//bumper updates\n\t\tbumperL = controller.getRawButton(portBumperL);\t\t//returns a value {0,1}\n\t\tbumperR = controller.getRawButton(portBumperR);\t\t//returns a value {0,1}\n\t\t\n\t\t//button updates\n\t\tbuttonX = controller.getRawButton(portButtonX);\t\t//returns a value {0,1}\n\t\tbuttonY = controller.getRawButton(portButtonY);\t\t//returns a value {0,1}\n\t\tbuttonA = controller.getRawButton(portButtonA);\t\t//returns a value {0,1}\n\t\tbuttonB = controller.getRawButton(portButtonB);\t\t//returns a value {0,1}\n\t\t\n\t\tbuttonBack = controller.getRawButton(portButtonBack);\t//returns a value {0,1}\n\t\tbuttonStart = controller.getRawButton(portButtonStart);\t//returns a value {0,1}\n\t\t\n\t\t//toggle checks\n\t\ttankDriveBool = checkButton(buttonX, tankDriveBool, portButtonX);\t\t//toggles boolean if button is pressed\n\t\tfastBool = checkButton(buttonB, fastBool, portButtonB);\t\t\t\t\t//toggles boolean if button is pressed\n\t\t\n\t\t\n\t\t//d-pad/POV updates\n\t\tdPad = controller.getPOV(portDPad);\t\t//returns a value {-1,0,45,90,135,180,225,270,315}\n\n\t\t//d-pad/POV turns\n\t\tif (dPad != -1) {\n\t\t\tdPad = 360 - dPad; //Converts the clockwise dPad rotation into a Gyro-readable counterclockwise rotation.\n\t\t\trotateTo(dPad);\n\t\t}\n\t\t\n\t\tjoystickDeadZone();\n\t}", "void changeUpdateSpeed();", "public void slowDownX() {\n double temp;\n temp = this.getxSpeed();\n\n if (temp > 0.1 || temp < -0.1) {\n temp /= 1.1;\n } else {\n temp = 0;\n }\n this.setxSpeed(temp);\n }", "public void increaseSpeed() {\r\n\tupdateTimer.setDelay((int)Math.floor(updateTimer.getDelay()*0.95));\r\n\t\t}", "public void up() {\n double speed = RobotContainer.m_BlackBox.getPotValueScaled(Constants.OIConstants.kControlBoxPotY, 0.0, 1.0);\n m_hook.set(speed);\n SmartDashboard.putNumber(\"forward speed\", speed);\n }", "public void up() {dy = -SPEED;}", "public static void updateDisplaySpeed()\n {\n double oneSecond = 1000;\n //speed.setText( Double.toString(((main.Game.worldTime.getDelay())/oneSecond)) + \" (sec./Day)\" );\n }", "public void doubleSpeed()\r\n {\r\n \tthis.speed= speed-125;\r\n \tgrafico.setVelocidad(speed);\r\n }", "@Override\n\tpublic void testPeriodic() {\n\t\tif (testJoystick.getRawButton(3)) {\n\t\t\tsparkMotor1.set(1.0);\n\t\t\tsparkMotor0.set(1.0);\n\t\t\ttestTalon.set(1.0);\n\t\t\t\n\t\t\ttalonMotor10.set(ControlMode.PercentOutput, 1.0);\n\t\t\ttalonMotor11.set(ControlMode.PercentOutput, 1.0);\n\t\t\ttalonMotor12.set(ControlMode.PercentOutput, 1.0);\n\t\t\ttalonMotor13.set(ControlMode.PercentOutput, 1.0);\n\t\t\ttalonMotor14.set(ControlMode.PercentOutput, 1.0);\n\t\t\ttalonMotor15.set(ControlMode.PercentOutput, 1.0);\n\t\t}\n\t\telse if (testJoystick.getRawButton(2)) {\n\t\t\tsparkMotor0.set(-1.0);\n\t\t\tsparkMotor1.set(-1.0);\n\t\t\ttestTalon.set(-1.0);\n\t\t\t\n\t\t\ttalonMotor10.set(ControlMode.PercentOutput, -1.0);\n\t\t\ttalonMotor11.set(ControlMode.PercentOutput, -1.0);\n\t\t\ttalonMotor12.set(ControlMode.PercentOutput, -1.0);\n\t\t\ttalonMotor13.set(ControlMode.PercentOutput, -1.0);\n\t\t\ttalonMotor14.set(ControlMode.PercentOutput, -1.0);\n\t\t\ttalonMotor15.set(ControlMode.PercentOutput, -1.0);\n\t\t}\n\t\telse {\n//\t\t\tsparkMotor0.set(0);\n\t\t\tsparkMotor1.set(0);\n\t\t\ttestTalon.set(0);\n\t\t\t\n\t\t\ttalonMotor10.set(ControlMode.PercentOutput, 0);\n\t\t\ttalonMotor11.set(ControlMode.PercentOutput, 0);\n\t\t\ttalonMotor12.set(ControlMode.PercentOutput, 0);\n\t\t\ttalonMotor13.set(ControlMode.PercentOutput, 0);\n\t\t\ttalonMotor14.set(ControlMode.PercentOutput, 0);\n\t\t\ttalonMotor15.set(ControlMode.PercentOutput, 0);\n\t\t\t\n\t\t\ttestSel.set(Value.kForward);\n\t\t}\n\t\t\n\t\tif (testJoystick.getRawButton(7)) {\n\t\t\ttestSel.set(Value.kForward);\n\t\t\tSystem.out.println(compressor.getCompressorCurrent());\n\t\t}\n\t}", "private void sentOutputAsRealMax() {\n outputAsRealMax = true;\n }", "void OnSpeedChanges(float speed);", "public void setSpeed() {\r\n\t\tint delay = 0;\r\n\t\tint value = h.getS(\"speed\").getValue();\r\n\t\t\r\n\t\tif(value == 0) {\r\n\t\t\ttimer.stop();\r\n\t\t} else if(value >= 1 && value < 50) {\r\n\t\t\tif(!timer.isRunning()) {\r\n\t\t\t\ttimer.start();\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t//exponential function. value (1) == delay (5000). value (50) == delay (25)\r\n\t\t\tdelay = (int)(a1 * (Math.pow(25/5000.0000, value / 49.0000)));\r\n\t\t} else if(value >= 50 && value <= 100) {\r\n\t\t\tif(!timer.isRunning()) {\r\n\t\t\t\ttimer.start();\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t//exponential function. value (50) == delay(25). value (100) == delay (1)\r\n\t\t\tdelay = (int)(a2 * (Math.pow(1/25.0000, value/50.0000)));\r\n\t\t}\r\n\t\ttimer.setDelay(delay);\r\n\t}", "@Override\n public void teleopPeriodic() {\n double y = -xbox.getRawAxis(0) * 0.7D * (1.0D + Math.max(0, xbox.getRawAxis(4)) * 1.4285714D);\n double rawSpeed = xbox.getRawAxis(2) - xbox.getRawAxis(3);\n\n if (SAFETY_MODE) {\n y *= 0.75D;\n\n if (xbox.getBumper(Hand.kLeft) && joystick.getRawButton(7)) {\n if (safetyCount > 0) {\n safetyCount--;\n SmartDashboard.putNumber(\"Safety Count\", safetyCount);\n\n if (safetyCount == 0) {\n safetyTripped = false;\n clearAllButtonStates();\n SmartDashboard.putBoolean(\"Safety Tripped\", safetyTripped);\n }\n } else {\n safetyTripped = false;\n }\n } else {\n safetyTripped = true;\n safetyCount = MAX_SAFETY_COUNT;\n SmartDashboard.putNumber(\"Safety Count\", safetyCount);\n SmartDashboard.putBoolean(\"Safety Tripped\", safetyTripped);\n }\n } else {\n safetyTripped = false;\n }\n\n // Climb Speed\n if (xbox.getRawButton(6)) {\n rawSpeed = -0.3D;\n }\n\n // Super slow mode\n if (xbox.getAButton() || SAFETY_MODE) {\n SpeedRamp.Setpoint = rawSpeed * 0.45D;\n } else {\n SpeedRamp.Setpoint = rawSpeed * 0.8D * (1.0D + Math.max(0, xbox.getRawAxis(4)) * 0.25);\n }\n\n SpeedRamp.update();\n\n boolean seesTape = TapeDetectedEntry.getBoolean(false);\n \n if (seesTape && !safetyTripped) {\n final double ADJUST_CONST = 0.13281734;\n //double tapePitch = TapePitchEntry.getNumber(0).doubleValue();\n double tapeYaw = TapeYawEntry.getNumber(0).doubleValue();\n final double TARGET_YAW = 0;//PitchYawAdjuster.GetYawFromPitch(tapePitch);\n\n //SmartDashboard.putNumber(\"tapePitch\", tapePitch);\n //SmartDashboard.putNumber(\"tapeYaw\", tapeYaw);\n \n double diff = tapeYaw - ADJUST_CONST;\n \n String s = \"\";\n\n if (diff > 0) {\n s = \"<-- (\" + diff + \")\";\n } else if (diff < 0) {\n s = \"--> (\" + diff + \")\";\n }\n\n if (/*xbox.getRawButton(5) This is now taken for the safety button*/false) {\n final double MAX_AFFECT = 0.4;\n if (diff > MAX_AFFECT) {\n diff = MAX_AFFECT;\n } else if (diff < -MAX_AFFECT) {\n diff = -MAX_AFFECT;\n }\n\n y -= diff;\n }\n\n SmartDashboard.putString(\"TapeDir\", s);\n } else {\n SmartDashboard.putString(\"TapeDir\", \"X\");\n }\n\n if (xbox.getRawButtonPressed(7)) {\n Lifter.setSelectedSensorPosition(0);\n LiftSetpoint = 0;\n LiftRamp.Setpoint = 0;\n LiftRamp.setOutput(0);\n }\n\n //Scheduler.getInstance().run();\n // Cargo ship is(n't anymore) -13120\n\n // The fine adjustment has nothing to do with hammers.\n // Don't try to use a hammer on the roboRIO. Ever.\n final int FINE_ADJUSTMENT_AMOUNT = -500;\n\n if (!safetyTripped) {\n if (joystick.getPOV() == 0) {\n if (!joyPOV0PressedLast) {\n joyPOV0PressedLast = true;\n if (LiftSetpoint - FINE_ADJUSTMENT_AMOUNT <= 0)\n LiftSetpoint -= FINE_ADJUSTMENT_AMOUNT;\n }\n } else {\n joyPOV0PressedLast = false;\n\n if (joystick.getPOV() == 180) {\n if (!joyPOV180PressedLast) {\n joyPOV180PressedLast = true;\n LiftSetpoint += FINE_ADJUSTMENT_AMOUNT;\n }\n } else {\n joyPOV180PressedLast = false;\n }\n }\n\n Drive.arcadeDrive(SpeedRamp.getOutput(), y);\n\n if (joystick.getRawButtonPressed(11)) {\n LiftSetpoint = HATCH_BOTTOM;\n } else if (joystick.getRawButtonPressed(9)) {\n LiftSetpoint = HATCH_MIDDLE;\n //} else if (joystick.getRawButtonPressed(7)) {\n // This button is now used for safety mode LiftSetpoint = HATCH_TOP;\n // and also for grab-hatch-on-impact mode\n } else if (joystick.getRawButtonPressed(12)) {\n LiftSetpoint = CARGO_BOTTOM;\n } else if (joystick.getRawButtonPressed(10)) {\n LiftSetpoint = CARGO_MIDDLE;\n //} else if (joystick.getRawButtonPressed(8)) {\n //LiftSetpoint = CARGO_TOP;\n } else if (joystick.getRawButtonPressed(1)) {\n LiftSetpoint = CARGO_FLOOR;\n }\n\n double liftY = -joystick.getRawAxis(1);\n final double deadband = 0.15;\n\n if (Math.abs(liftY) > deadband) {\n double change = (liftY < 0 ? liftY + 0.15 : liftY - 0.15) * 200;//(int)liftEntry.getDouble(0);//\n \n if (change > 100) {\n change = 100;\n } else if (change < -100) {\n change = -100;\n }\n\n LiftRamp.setOutput(LiftRamp.getOutput() + change);\n LiftRamp.Setpoint += change;\n LiftSetpoint = (int)LiftRamp.Setpoint;\n }\n\n if (LiftSetpoint < LIMIT_UP) {\n LiftSetpoint = LIMIT_UP;\n }\n } else {\n Drive.arcadeDrive(0, 0);\n }\n \n LiftRamp.Setpoint = LiftSetpoint;\n SmartDashboard.putNumber(\"LiftSetpoint\", LiftRamp.Setpoint);\n //SmartDashboard.putNumber(\"LiftEncoderPos\", Lifter.getSelectedSensorPosition());\n SmartDashboard.putNumber(\"LiftOutput\", LiftRamp.getOutput());\n LiftRamp.update();\n\n Lifter.set(ControlMode.Position, LiftRamp.getOutput());\n //Lifter.set(ControlMode.PercentOutput, -joystick.getRawAxis(1));\n\n if (!safetyTripped) {\n if (joystick.getRawButtonPressed(4)) {\n ArmsClosed = !ArmsClosed;\n } else if (!SAFETY_MODE) {\n // This is the same as the joystick safety button, so it only works outside\n // safety mode, and why would it be needed in safety mode anyway?\n // It should be disabled in safety mode anyway to make sure we don't\n // accidently attack someone's fingers at a Demo.\n\n // Holding joystick button 7 makes the limit switches on the hatch mechanism\n // active, so when the hatch contacts the switches, the mechanism automatically\n // grabs the hatch.\n // HatchSwitch0 does not have to be inverted. It's complicated.\n if (joystick.getRawButton(7) && (HatchSwitch0.get() || !HatchSwitch1.get())) {\n ArmsClosed = false;\n }\n }\n\n if (joystick.getRawButtonPressed(3)) {\n ArmsExtended = !ArmsExtended;\n }\n }\n\n ArmExtender.set(ArmsExtended);\n ArmOpener.set(ArmsClosed);\n\n //Diagnostics.writeDouble(\"DriveX\", x);\n //Diagnostics.writeDouble(\"DriveY\", y);\n\n // X = out, Y = in\n\n final double GRAB_SPEED;\n\n if (SAFETY_MODE) {\n GRAB_SPEED = 0.8D;\n } else {\n GRAB_SPEED = 1D; // TODO at one point we had this 0.8, is that what it's supposed to be?\n }\n \n if (!safetyTripped) {\n ArmGrippers.set(/*xbox.getXButton() || */joystick.getRawButton(6) ? -GRAB_SPEED : /*xbox.getYButton() ||*/ joystick.getRawButton(5) ? GRAB_SPEED : 0);\n } else {\n ArmGrippers.set(0);\n }\n\n\n // === Climbing stuff ===\n\n boolean climbSafety = /*joystick.getRawButton(2) &&*/ !safetyTripped;\n \n // Have to check all of these every update to make sure it was pressed\n // between now and the last update\n boolean retractFront = xbox.getYButton/*Pressed*/();\n boolean retractBack = xbox.getXButton/*Pressed*/();\n boolean climbBoth = xbox.getRawButton/*Pressed*/(8);\n\n final double CLIMB_SPEED = 1;\n final double RETRACT_SPEED = 0.75;\n final double HOLD_SPEED = 0.3;\n // If you multiply the hold by this, you get the climb value.\n // Avoids having to thing + or minus so many times.\n final double HOLD_CLIMB_MULTIPLIER = CLIMB_SPEED / HOLD_SPEED;\n\n // Left is negative, right is positive\n double xOff = Math.round((Accel.getX() - ZeroX) * 10) / 10D;\n // Forward is negative, backwards is positive\n double zOff = Math.round((Accel.getZ() - ZeroZ) * 10) / 10D;\n\n\n SmartDashboard.putNumber(\"X\", xOff);\n SmartDashboard.putNumber(\"Z\", zOff);\n\n\n if (climbSafety || IsHoldingBack || IsHoldingFront) {\n if (climbBoth) {\n IsHoldingBack = true;\n IsHoldingFront = true;\n\n \n double SpeedFR = CLIMB_SPEED;\n double SpeedFL = -CLIMB_SPEED;\n double SpeedBR = -CLIMB_SPEED;\n double SpeedBL = CLIMB_SPEED;\n\n final double SLOW_MULT = 0.3;\n\n if (xOff < 0 || zOff < 0) {\n SpeedBR *= SLOW_MULT;\n }\n\n if (xOff < 0 || zOff > 0) {\n SpeedFR *= SLOW_MULT;\n }\n\n if (xOff > 0 || zOff < 0) {\n SpeedBL *= SLOW_MULT;\n }\n\n if (xOff > 0 || zOff > 0) {\n SpeedFL *= SLOW_MULT;\n }\n \n LegFrontR.set(SpeedFR);\n LegFrontL.set(ControlMode.PercentOutput, SpeedFL);\n LegBackR.set(ControlMode.PercentOutput, SpeedBR);\n LegBackL.set(ControlMode.PercentOutput, SpeedBL);\n\n } else {\n if (retractBack) {\n IsHoldingBack = false;\n LegBackR.set(ControlMode.PercentOutput, RETRACT_SPEED);\n LegBackL.set(ControlMode.PercentOutput, -RETRACT_SPEED);\n } else if (IsHoldingBack) {\n double rightSpeed = -HOLD_SPEED;\n double leftSpeed = HOLD_SPEED;\n int pov = xbox.getPOV();\n\n // Front right leg\n if (pov >= 0 && pov <= 90) {\n\n }\n\n LegBackR.set(ControlMode.PercentOutput, -HOLD_SPEED);\n LegBackL.set(ControlMode.PercentOutput, HOLD_SPEED);\n } else {\n LegBackR.set(ControlMode.PercentOutput, 0);\n LegBackL.set(ControlMode.PercentOutput, 0);\n }\n\n if (retractFront) {\n IsHoldingFront = false;\n LegFrontR.set(-RETRACT_SPEED);\n LegFrontL.set(ControlMode.PercentOutput, RETRACT_SPEED);\n } else if (IsHoldingFront) {\n double rightSpeed = HOLD_SPEED;\n double leftSpeed = -HOLD_SPEED;\n int pov = xbox.getPOV();\n\n // Front right leg\n if (pov >= 0 && pov <= 90) {\n rightSpeed *= HOLD_CLIMB_MULTIPLIER;\n }\n\n LegFrontR.set(rightSpeed);\n LegFrontL.set(ControlMode.PercentOutput, leftSpeed);\n } else {\n LegFrontR.set(0);\n LegFrontL.set(ControlMode.PercentOutput, 0);\n }\n }\n } else {\n LegBackR.set(ControlMode.PercentOutput, 0);\n LegBackL.set(ControlMode.PercentOutput, 0);\n LegFrontR.set(0);\n LegFrontL.set(ControlMode.PercentOutput, 0);\n }\n \n double footSpeed = Math.max(-1.0, Math.min(rawSpeed * 3, 1.0F));\n\n if (IsHoldingBack) {\n // Drive back feet\n BackFootMover.set(footSpeed);\n } else {\n BackFootMover.set(0);\n }\n\n if (IsHoldingFront) {\n // Drive front feet\n FrontFootMover.set(footSpeed);\n } else {\n FrontFootMover.set(0);\n }\n\n // Publish values to dashboard for LEDs\n LedArmsClosed.setBoolean(ArmsClosed);\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 }", "@Override\n public void resetAccelY()\n {\n }", "public MotionChartPanel () {\n super( null );\n\n // Data set.\n setLayout( new BorderLayout() );\n\n// setMaximumDrawWidth( Toolkit.getDefaultToolkit().getScreenSize().width );\n// setMaximumDrawHeight( Toolkit.getDefaultToolkit().getScreenSize().height );\n\n final DynamicTimeSeriesCollection dataset1 = new DynamicTimeSeriesCollection( 1, COUNT, new Second() );\n dataset1.setTimeBase( new Second( 0, 0, 0, 1, 1, 2011 ) );\n dataset1.addSeries( initialPositionData(), 0, POSITION_SERIES_TEXT );\n\n final DynamicTimeSeriesCollection dataset2 = new DynamicTimeSeriesCollection( 1, COUNT, new Second() );\n dataset2.setTimeBase( new Second( 0, 0, 0, 1, 1, 2011 ) );\n dataset2.addSeries( initialSpeedData(), 0, SPEED_SERIES_TEXT );\n\n // Create the chart.\n JFreeChart chart = createChart( dataset1, dataset2 );\n setChart( chart );\n setRangeBound( 200000, 2500 );\n setMouseZoomable( false );\n\n // Timer (Refersh the chart).\n timer = new Timer( 10, new ActionListener() {\n\n /**\n * The speed previous plotted.\n */\n private float prevSpeed;\n\n /**\n * The position previous plotted.\n */\n private float prevPosition;\n @Override\n public void actionPerformed ( ActionEvent e ) {\n if ( speedQueue.isEmpty() == false && positionQueue.isEmpty() == false ) {\n long time = System.currentTimeMillis();\n prevSpeed = speedQueue.poll();\n prevPosition = positionQueue.poll();\n dataset1.advanceTime();\n dataset2.advanceTime();\n dataset1.appendData( new float[]{ prevPosition } );\n dataset2.appendData( new float[]{ prevSpeed } );\n }\n\n// else {\n // Maintain previous record once no new record/enough record could show.\n// dataset1.appendData( new float[]{ prevPosition } );\n// dataset2.appendData( new float[]{ prevSpeed } );\n// }\n }\n } );\n }", "public void accelerateYD() {\n double temp;\n temp = this.getySpeed();\n if (temp <= this.getMaxSpeed()) {\n temp += this.getMaxSpeed() / 10;\n }\n this.setySpeed(temp);\n\n }", "@Override\n public void onSensorChanged(SensorEvent event) {\n if (Minutes*60+Seconds==time){\n switch(event.sensor.getType()) {\n case Sensor.TYPE_STEP_DETECTOR:\n values[0]++;\n break;\n case Sensor.TYPE_ACCELEROMETER:\n values[1]+=(Math.sqrt(\n event.values[0]*event.values[0]+\n event.values[1]*event.values[1]+\n event.values[2]*event.values[2])\n );\n values[1]/=2;\n break;\n case Sensor.TYPE_GYROSCOPE:\n values[2]+=(Math.sqrt(\n event.values[0]*event.values[0]+\n event.values[1]*event.values[1]+\n event.values[2]*event.values[2])\n );\n values[2]/=2;\n break;\n }\n }\n else{\n if(values[0]==0||values[1]==0||values[2]==0){\n prediction.setText(\"00:00:00\");\n }\n else{\n predictionValue = Math.round(doInference(values));\n prediction.setText(\"00:\" + String.valueOf(predictionValue/60) + \":\" + String.valueOf(predictionValue%60));\n if(predictionValue>1.1*Double.parseDouble(target.getText().toString())){ //too slow\n pace.setBackgroundColor(Color.GREEN);\n pace.setText(\"SPEED UP!\");\n }\n else if(predictionValue<0.9*Double.parseDouble(target.getText().toString())){ //too fast\n pace.setBackgroundColor(Color.RED);\n pace.setText(\"SLOW DOWN!\");\n }\n else{\n pace.setBackgroundColor(Color.YELLOW);\n pace.setText(\"GOOD JOB!\");\n }\n }\n switch(event.sensor.getType()) {\n case Sensor.TYPE_STEP_DETECTOR:\n values[0]=1;\n values[1]=0;\n values[2]=0;\n break;\n case Sensor.TYPE_ACCELEROMETER:\n values[0]=0;\n values[1]=(Math.sqrt(\n event.values[0]*event.values[0]+\n event.values[1]*event.values[1]+\n event.values[2]*event.values[2])\n );\n values[2]=0;\n break;\n case Sensor.TYPE_GYROSCOPE:\n values[0]=0;\n values[1]=0;\n values[2]=(Math.sqrt(\n event.values[0]*event.values[0]+\n event.values[1]*event.values[1]+\n event.values[2]*event.values[2])\n );\n break;\n }\n time = Minutes*60+Seconds;\n }\n\n }", "public void update1() {\n\n if(gamepad1.a)\n aCount1++;\n else\n aCount1 = 0;\n if(aCount1 == DEBOUNCING_NUMBER_OF_SAMPLES)\n aToggle1 = !aToggle1;\n\n if(gamepad1.b)\n bCount1++;\n else\n bCount1 = 0;\n if(bCount1 == DEBOUNCING_NUMBER_OF_SAMPLES)\n bToggle1 = !bToggle1;\n\n if(gamepad1.x)\n xCount1++;\n else\n xCount1 = 0;\n if(xCount1 == DEBOUNCING_NUMBER_OF_SAMPLES)\n xToggle1 = !xToggle1;\n\n if(gamepad1.y)\n yCount1++;\n else\n yCount1 = 0;\n if(yCount1 == DEBOUNCING_NUMBER_OF_SAMPLES)\n yToggle1 = !yToggle1;\n\n if(gamepad1.dpad_down)\n dpadDownCount1++;\n else\n dpadDownCount1 = 0;\n if(dpadDownCount1 == DEBOUNCING_NUMBER_OF_SAMPLES)\n dpadDownToggle1 = !dpadDownToggle1;\n\n if(gamepad1.dpad_up)\n dpadUpCount1++;\n else\n dpadUpCount1 = 0;\n if(dpadUpCount1 == DEBOUNCING_NUMBER_OF_SAMPLES)\n dpadUpToggle1 = !dpadUpToggle1;\n\n if(gamepad1.left_bumper)\n leftBumperCount1++;\n else\n leftBumperCount1 = 0;\n if(leftBumperCount1 == DEBOUNCING_NUMBER_OF_SAMPLES)\n leftBumperToggle1 = !leftBumperToggle1;\n\n if(gamepad1.right_bumper)\n rightBumperCount1++;\n else\n rightBumperCount1 = 0;\n if(rightBumperCount1 == DEBOUNCING_NUMBER_OF_SAMPLES)\n rightBumperToggle1 = !rightBumperToggle1;\n\n if(gamepad1.left_stick_button)\n leftStick1++;\n else\n leftStick1 = 0;\n if(leftStick1 == DEBOUNCING_NUMBER_OF_SAMPLES)\n leftStickToggle1 = !leftStickToggle1;\n\n if(gamepad1.right_stick_button)\n rightStick1++;\n else\n rightStick1 = 0;\n if(rightStick1 == DEBOUNCING_NUMBER_OF_SAMPLES)\n rightStickToggle1 = !rightStickToggle1;\n\n if(gamepad2.left_stick_button)\n leftStick2++;\n else\n leftStick2 = 0;\n if(leftStick2 == DEBOUNCING_NUMBER_OF_SAMPLES)\n leftStickToggle2 = !leftStickToggle2;\n\n if(gamepad2.right_stick_button)\n rightStick2++;\n else\n rightStick2 = 0;\n if(rightStick2 == DEBOUNCING_NUMBER_OF_SAMPLES)\n rightStickToggle2 = !rightStickToggle2;\n\n }", "protected void execute() {\n\t\tif (joystickControl) {\n\t\t\tdouble spitPower = Robot.oi.driverController.triggers.getLeft();\n\t\t\ttargetSpeed = -(spitPower * spitPower);\n\t\t\tRobot.cubeCollector.setCubeCollector(ControlMode.PercentOutput, targetSpeed);\n\t\t} else {\n\t\t\tRobot.cubeCollector.setCubeCollector(ControlMode.PercentOutput, targetSpeed);\n\t\t}\n\n\t}", "public void changeSpeedD() {\n speedX *= -1;\n }", "public void updateOscilloscopeData() {\n rmsSum = 0;\n boolean overshoot = false;\n int reactorFrequency = getReactorFrequency().intValue();\n int reactorAmplitude = getReactorAmplitude().intValue();\n double reactorPhase = getReactorPhase().doubleValue();\n int controlFrequency = getControlFrequency().intValue();\n int controlAmplitude = getControlAmplitude().intValue();\n double controlPhase = getControlPhase().doubleValue();\n for (int i = 0; i < 40; i++) { \n Double reactorValue = reactorAmplitude * Math.sin(2 * Math.PI * reactorFrequency * ((double) i * 5 / 10000) + reactorPhase);\n Double controlValue = controlAmplitude * Math.sin(2 * Math.PI * controlFrequency * ((double) i * 5 / 10000) + controlPhase);\n if (reactorValue + controlValue > 150) {\n this.outputData.get(0).getData().get(i).setYValue(149);\n overshoot = true;\n } else if (reactorValue + controlValue < -150) {\n this.outputData.get(0).getData().get(i).setYValue(-149);\n overshoot = true;\n } else {\n this.outputData.get(0).getData().get(i).setYValue(reactorValue + controlValue);\n }\n if (this.online == true) {\n this.rmsSum = this.rmsSum + Math.pow(reactorValue + controlValue, 2);\n }\n }\n calculateOutputPower();\n checkForInstability(overshoot);\n }", "public void update() {\n\t\toldButtons = currentButtons;\n\t\tcurrentButtons = DriverStation.getInstance().getStickButtons(getPort());\n\t\tif (axisCount != DriverStation.getInstance().getStickAxisCount(getPort())) {\n\t\t\taxisCount = DriverStation.getInstance().getStickAxisCount(getPort());\n\t\t\toldAxis = new double[axisCount];\n\t\t\tcurrentAxis = new double[axisCount];\n\t\t}\n\t\tif (povCount != DriverStation.getInstance().getStickPOVCount(getPort())) {\n\t\t\tpovCount = DriverStation.getInstance().getStickPOVCount(getPort());\n\t\t\toldPOV = new int[povCount];\n\t\t\tcurrentPOV = new int[povCount];\n\t\t}\n\t\toldAxis = currentAxis;\n\t\tfor (int i = 0; i < axisCount; i++) {\n\t\t\tcurrentAxis[i] = DriverStation.getInstance().getStickAxis(getPort(), i);\n\t\t}\n\n\t\toldPOV = currentPOV;\n\t\tfor (int i = 0; i < povCount; i++) {\n\t\t\tcurrentPOV[i] = DriverStation.getInstance().getStickPOV(getPort(), i);\n\t\t}\n\t}", "private void setSpeed() {\n double cVel = cAccel*0.1;\n speed += round(mpsToMph(cVel), 2);\n speedOutput.setText(String.valueOf(speed));\n }", "public void accelerate(){\n double acceleration = .1;\n if(xVel<0)\n xVel-=acceleration;\n if(xVel>0)\n xVel+=acceleration;\n if(yVel<0)\n yVel-=acceleration;\n if(yVel>0)\n yVel+=acceleration;\n System.out.println(xVel + \" \" + yVel);\n \n }", "@Override\r\n protected void controlUpdate(float tpf) {\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 update() {\n // Update velocity\n velocity.add(acceleration);\n // Limit speed\n velocity.limit(maxspeed);\n position.add(velocity);\n // Reset accelertion to 0 each cycle\n acceleration.mult(0);\n }", "public void update() {\n // Update velocity\n velocity.add(acceleration);\n // Limit speed\n velocity.limit(maxspeed);\n position.add(velocity);\n // Reset accelertion to 0 each cycle\n acceleration.mult(0);\n }", "void driveStick(float x, float y) {\n speed = (Math.abs(x) > Math.abs(y) ? Math.abs(x) : Math.abs(y)) / 1.5;\n\n telemetry.addData(\"y\", y);\n telemetry.addData(\"x\", x);\n\n //One program to combine 8 directions of motion on one joystick using ranges of x and y values\n if (y > .10) {\n drive(\"left\");\n } else if (y < -.10) {\n drive(\"right\");\n } else if (x > .10) {\n drive(\"down\");\n } else if (x < -.10) {\n drive(\"up\");\n } else {\n drive(\"stop\");\n }\n\n\n }", "@Override\n\tprotected void controlUpdate(float tpf) {\n\t\t\n\t}", "@Override\n public void valueChanged(double control_val) {\n float current_audio_position = (float)samplePlayer.getPosition();\n\n if (current_audio_position < control_val){\n samplePlayer.setPosition(control_val);\n }\n loop_start.setValue((float)control_val);\n // Write your DynamicControl code above this line \n }", "public void teleopPeriodic() {\n joystick1X = leftStick.getAxis(Joystick.AxisType.kX);\n joystick1Y = leftStick.getAxis(Joystick.AxisType.kY);\n joystick2X = rightStick.getAxis(Joystick.AxisType.kX);\n joystick2Y = rightStick.getAxis(Joystick.AxisType.kY);\n \n mapped1Y = joystick1Y/2 + 0.5;\n mapped1X = joystick1X/2 + 0.5;\n mapped2X = joystick2X/2 + 0.5;\n mapped2Y = joystick2Y/2 + 0.5;\n \n X1testServo.set(mapped1X);\n Y1testServo.set(mapped1Y);\n X2testServo.set(mapped2X);\n Y2testServo.set(mapped2Y);\n }", "public static void speedup(){\n\t\tif(bossair.periodairinit > Framework.nanosecond){\n\t\t\t\tbossair.periodair-=Framework.nanosecond/18; \n\t\t\t\tbossair.xmoving-=0.03; \n\t\t}\n\t\t\t\n\t}", "protected void execute() {\n \t\n \tdouble rightJoystickXAxis, leftJoystickYAxis, leftMotorOutput, rightMotorOutput;\n \t\n \trightJoystickXAxis = JoystickAxisScaling.getY(Robot.oi.joystickDriver.getRawAxis(Constants.RIGHT_JOYSTICK_X),\n \t\t\t0.0, 0.0, 1.0, 1.0);\n \tif(Robot.driveTrain.isRightSideOutputInverted()) {\n \t\tleftJoystickYAxis = -JoystickAxisScaling.getY(Robot.oi.joystickDriver.getRawAxis(Constants.LEFT_JOYSTICK_Y),\n \t\t\t0.0, 0.0, 1.0, -1.0);\n \t}\n \telse\n \t{\n \t\tleftJoystickYAxis = JoystickAxisScaling.getY(Robot.oi.joystickDriver.getRawAxis(Constants.LEFT_JOYSTICK_Y),\n \t\t\t0.0, 0.0, 1.0, -1.0);\n \t}\n \t\n \t\n \tif ( rightJoystickXAxis == 0.0 && leftJoystickYAxis != 0.0 )\t//straight forward or reverse with the x axis in deadband\n \t{\n \t\tleftMotorOutput = leftJoystickYAxis;\n \t\trightMotorOutput = leftJoystickYAxis;\n \t}\n \t\n \telse if ( rightJoystickXAxis > 0.0 && leftJoystickYAxis != 0.0 )\t//quadrant I or IV\n \t{\n \t\tleftMotorOutput = leftJoystickYAxis;\n \t\trightMotorOutput = leftJoystickYAxis - rightJoystickXAxis;\n \t}\n \t\n \telse if ( rightJoystickXAxis < 0.0 && leftJoystickYAxis != 0.0 )\t//quadrant II or III\n \t{\n \t\trightMotorOutput = leftJoystickYAxis;\n \t\tleftMotorOutput = leftJoystickYAxis + rightJoystickXAxis;\n \t}\n \t\n \telse if ( leftJoystickYAxis == 0.0 && rightJoystickXAxis != 0.0 )\t//rotate left or right with the y axis in deadband\n \t{\n \t\tleftMotorOutput = rightJoystickXAxis;\n \t\trightMotorOutput = -rightJoystickXAxis;\n \t}\n \t\n \telse\t//x axis in deadband and y axis in deadband\n \t{\n \t\tleftMotorOutput = 0.0;\n \t\trightMotorOutput = 0.0;\n \t}\n \t\n \tbrakeFactor = JoystickAxisScaling.getY(Robot.oi.joystickDriver.getRawAxis(Constants.LEFT_TRIGGER),\n \t\t\t0.0, 0.0, 1.0, 0.8);\n \t\n \tRobot.driveTrain.updateDriveSpeeds(leftMotorOutput * (1-brakeFactor), rightMotorOutput * (1-brakeFactor));\n \t\n }", "@Override\n public final void onSensorChanged(SensorEvent event) {\n linearAccelerations = event.values;\n linearAccelerations[0] = linearAccelerations[0]-xOff;\n linearAccelerations[1] = linearAccelerations[1]-yOff;\n linearAccelerations[2] = linearAccelerations[2]-zOff;\n xAccel = (float) round(linearAccelerations[0]/9.8, 3);\n yAccel = (float) round(linearAccelerations[1]/9.8, 3);\n zAccel = (float) round(linearAccelerations[2]/9.8, 3);\n// Log.i(appLabel, \"Acceleration: (\"+xAccel+\", \"+yAccel+\", \"+zAccel+\")\");\n xAccelSquared = (float) round(xAccel*xAccel, 3);\n yAccelSquared = (float) round(yAccel*yAccel, 3);\n zAccelSquared = (float) round(zAccel*zAccel, 3);\n //If they are negative accelerations, squaring them will have made them positive\n if (xAccel < 0) {\n xAccelSquared = xAccelSquared*-1;\n }\n if (yAccel < 0) {\n yAccelSquared = yAccelSquared*-1;\n }\n if (zAccel < 0) {\n zAccelSquared = zAccelSquared*-1;\n }\n xAccelOutput.setText(String.valueOf(xAccel));\n yAccelOutput.setText(String.valueOf(yAccel));\n zAccelOutput.setText(String.valueOf(zAccel));\n// Log.i(appLabel, \"Acceleration squares: \"+xAccelSquared+\", \"+yAccelSquared+\", \"+zAccelSquared);\n float accelsSum = xAccelSquared+yAccelSquared+zAccelSquared;\n double accelsRoot;\n if (accelsSum < 0) {\n accelsSum = accelsSum * -1;\n accelsRoot = Math.sqrt(accelsSum) * -1;\n } else {\n accelsRoot = Math.sqrt(accelsSum);\n }\n// Log.i(appLabel, \"Acceleration squares sum: \"+accelsSum);\n// Log.i(appLabel, \"Acceleration sqrt:\"+accelsRoot);\n cAccel = (float) round(accelsRoot, 3);\n// Log.i(appLabel, \"Net Acceleration: \"+cAccel);\n //Store the maximum acceleration\n if (cAccel > maxAccel) {\n maxAccel = cAccel;\n }\n accelOutput.setText(String.valueOf(cAccel));\n if (isRunning) {\n setSpeed();\n }\n if (speed >= 60) {\n timeToSixty = seconds;\n timeToSixtyOutput.setText(String.valueOf(timeToSixty));\n stopTimer();\n }\n }", "protected void execute()\n\t{\n\t\tdouble speed = Robot.oi.getActuatorSpeed();\n\t\t// Treat a zone around the center position as zero to prevent fluctuating\n\t\t// motor speeds when the joystick is at rest in the center position.\n\t\tRobot.linearActuator.setSpeed(Math.abs(speed) >= .1 ? speed : 0);\n\t}", "public void update2() {\n\n if(gamepad2.a)\n aCount2++;\n else\n aCount2 = 0;\n if(aCount2 == DEBOUNCING_NUMBER_OF_SAMPLES)\n aToggle2 = !aToggle2;\n\n if(gamepad2.b)\n bCount2++;\n else\n bCount2 = 0;\n if(bCount2 == DEBOUNCING_NUMBER_OF_SAMPLES)\n bToggle2 = !bToggle2;\n\n if(gamepad2.x)\n xCount2++;\n else\n xCount2 = 0;\n if(xCount2 == DEBOUNCING_NUMBER_OF_SAMPLES)\n xToggle2 = !xToggle2;\n\n if(gamepad2.y)\n yCount2++;\n else\n yCount2 = 0;\n if(yCount2 == DEBOUNCING_NUMBER_OF_SAMPLES)\n yToggle2 = !yToggle2;\n\n if(gamepad2.dpad_down)\n dpadDownCount2++;\n else\n dpadDownCount2 = 0;\n if(dpadDownCount2 == DEBOUNCING_NUMBER_OF_SAMPLES)\n dpadDownToggle2 = !dpadDownToggle2;\n\n if(gamepad2.dpad_up)\n dpadUpCount2++;\n else\n dpadUpCount2 = 0;\n if(dpadUpCount2 == DEBOUNCING_NUMBER_OF_SAMPLES)\n dpadUpToggle2 = !dpadUpToggle2;\n\n if(gamepad2.left_bumper)\n leftBumperCount2++;\n else\n leftBumperCount2 = 0;\n if(leftBumperCount2 == DEBOUNCING_NUMBER_OF_SAMPLES)\n leftBumperToggle2 = !leftBumperToggle2;\n\n if(gamepad2.right_bumper)\n rightBumperCount2++;\n else\n rightBumperCount2 = 0;\n if(rightBumperCount2 == DEBOUNCING_NUMBER_OF_SAMPLES)\n rightBumperToggle2 = !rightBumperToggle2;\n\n }", "public void setSpeed(final double speed) {\n m_X.set(ControlMode.PercentOutput, speed); \n }", "@Override\n public void valueChanged(double control_val) {\n playbackRate.setValue((float)control_val);\n // Write your DynamicControl code above this line\n }", "void max_speed (double min_lift, double max_drag, boolean update_info) {\n velocity = kts_to_speed(20);\n find_aoa_of_min_drag();\n double pitch_of_min_drag = craft_pitch;\n trace(\"pitch_of_min_drag: \" + pitch_of_min_drag);\n\n // step 2. with current (lowest drag) pitch, iterate speed up\n // until drag exceeds max_drag.\n double speed = (total_drag() > max_drag) || foil_lift() > min_lift\n ? kts_to_speed(5) // pretty arbitrary...\n : velocity;\n\n for (; speed < v_max; speed += 1) { \n velocity = speed;\n //computeFlowAndRegenPlotAndAdjust();\n recomp_all_parts();\n if (total_drag() > max_drag) \n break;\n }\n\n trace(\"velocity after step2: \" + velocity);\n\n // // at min drag angle can not produce enough lift? unsolvable.\n // if (foil_lift() < min_lift) {\n // trace(\"can not solve 'fild max speed' task for given inputs.\\nincrease drag input or decrease lift input\");\n // return;\n // }\n\n // step 3. pitch_of_min_drag correction for too much lift...\n if (foil_lift() > min_lift) {\n // unsustainable, needs less pitch & speed...\n // reduce min_pitch until lift is OK\n while(pitch_of_min_drag > aoa_min) {\n pitch_of_min_drag -= 0.05;\n craft_pitch = pitch_of_min_drag;\n //computeFlowAndRegenPlotAndAdjust();\n recomp_all_parts();\n if (foil_lift() <= min_lift)\n break;\n }\n trace(\"corrected pitch_of_min_drag: \" + pitch_of_min_drag);\n }\n\n // step 4. from this speed, iterate speed down\n for (speed = velocity; speed >= 0; speed -= 1) {\n trace(\"speed: \" + speed);\n double lift = 0;\n double drag = 0;\n double pitch = pitch_of_min_drag;\n velocity = speed;\n set_mast_aoa_for_given_drag(max_drag);\n for (; pitch < aoa_max; pitch += 0.1) {\n craft_pitch = pitch;\n //computeFlowAndRegenPlotAndAdjust();\n recomp_all_parts();\n lift = foil_lift();\n drag = total_drag();\n if (drag >= max_drag) {\n // stop increasing pitch, won't work. \n //likely need less speed\n trace(\"too much drag, break. speed: \" + speed + \" pitch: \" + pitch);\n break;\n }\n if (lift >= min_lift) {\n trace(\"done \");\n if (update_info) {\n make_max_speed_info(min_lift, max_drag, velocity);\n System.out.println(\"\\nDone!\\n----------------\\n\" + max_speed_info);\n }\n return;\n } \n }\n // here pitch is at max. what about lift?\n if (pitch >= aoa_max && lift < min_lift) {\n trace(\"oops, can not be solved.\\nincrease drag limit or decrease lift threshold!\");\n return;\n }\n }\n }", "@Override\n public void loop() {\n// double left;\n robot.colorDrop.setPosition(0.45);\n\n double Righty, Lefty, sideRight, sideLeft;\n double phaseUp;\n double phaseDown;\n boolean straffeL,straffeR,straffeL2,straffeR2;\n double turnR,turnL;\n double Righty2, Lefty2, sideRight2, sideLeft2;\n double phaseUp2;\n double phaseDown2;\n\n // Run wheels in tank mode (note: The joystick goes negative when pushed forwards, so negate it)\n Lefty = gamepad1.right_stick_y;\n Righty = gamepad1.left_stick_y;\n sideRight= gamepad1.left_stick_x;\n sideLeft=gamepad1.right_stick_x;\n phaseUp = gamepad2.right_trigger;\n phaseDown = gamepad2.left_trigger;\n straffeL = gamepad1.right_bumper;\n straffeR = gamepad1.left_bumper;\n straffeL2 = gamepad2.right_bumper;\n straffeR2 = gamepad2.left_bumper;\n //turnL = gamepad1.left_trigger;\n //turnR= gamepad1.left_trigger;\n\n Lefty2 = gamepad1.right_stick_y;\n Righty2 = gamepad1.left_stick_y;\n sideRight2= gamepad1.left_stick_x;\n sideLeft2=gamepad1.right_stick_x;\n //phaseUp2 = gamepad1.right_trigger;\n //phaseDown2 = gamepad1.left_trigger;\n\n\n\n\n if(sideRight!=0&&sideLeft<0) {\n robot.leftFrontDrive.setPower(sideLeft);\n robot.rightFrontDrive.setPower(sideLeft);\n robot.leftRearDrive.setPower(sideLeft * -1);\n robot.rightRearDrive.setPower(sideLeft);\n }\n else if(sideRight!=0&&sideLeft>0)\n {\n robot.leftFrontDrive.setPower(sideLeft);\n robot.rightFrontDrive.setPower(sideLeft*-1);\n robot.leftRearDrive.setPower(sideLeft);\n robot.rightRearDrive.setPower(sideLeft);\n }\n else if(sideLeft!=0)\n {\n robot.leftFrontDrive.setPower(sideLeft);\n robot.rightFrontDrive.setPower(sideLeft*-1);\n robot.leftRearDrive.setPower(sideLeft*-1);\n robot.rightRearDrive.setPower(sideLeft);\n\n }\n else if(Righty<0&&sideRight<0)\n {\n robot.leftFrontDrive.setPower(-.5);\n robot.rightFrontDrive.setPower(-.9);\n robot.leftRearDrive.setPower(-.5);\n robot.rightRearDrive.setPower(-.9);\n }\n else if(Righty<0&&sideRight>0) {\n robot.leftFrontDrive.setPower(-.9);\n robot.rightFrontDrive.setPower(-.5);\n robot.leftRearDrive.setPower(-.9);\n robot.rightRearDrive.setPower(-.5);\n }\n else if(Righty==0&&sideRight!=0)\n {\n robot.leftFrontDrive.setPower(sideRight*-.7);\n robot.rightFrontDrive.setPower(sideRight*.7);\n robot.leftRearDrive.setPower(sideRight*-.7);\n robot.rightRearDrive.setPower(sideRight*.7);\n }\n else if(Righty<0&&sideRight==0)\n {\n robot.leftFrontDrive.setPower(Righty);\n robot.rightFrontDrive.setPower(Righty);\n robot.leftRearDrive.setPower(Righty);\n robot.rightRearDrive.setPower(Righty);\n\n }\n else if(Righty>0)\n {\n robot.leftFrontDrive.setPower(Righty);\n robot.rightFrontDrive.setPower(Righty);\n robot.leftRearDrive.setPower(Righty);\n robot.rightRearDrive.setPower(Righty);\n\n }\n else if(Lefty!=0&&sideLeft==0)\n {\n robot.leftFrontDrive.setPower(Lefty);\n robot.rightFrontDrive.setPower(Lefty);\n robot.leftRearDrive.setPower(Lefty);\n robot.rightRearDrive.setPower(Lefty);\n }\n else if(straffeL==true||straffeL2==true)\n {\n robot.leftFrontDrive.setPower(.2);\n robot.rightFrontDrive.setPower(-.2);\n robot.leftRearDrive.setPower(-.2);\n robot.rightRearDrive.setPower(.2);\n }\n\n else if(straffeR==true||straffeR2==true)\n {\n robot.leftFrontDrive.setPower(-.2);\n robot.rightFrontDrive.setPower(.2);\n robot.leftRearDrive.setPower(.2);\n robot.rightRearDrive.setPower(-.2);\n }\n else\n {\n robot.leftFrontDrive.setPower(0);\n robot.rightFrontDrive.setPower(0);\n robot.leftRearDrive.setPower(0);\n robot.rightRearDrive.setPower(0);\n\n }\n\n\n ///player 1\n if ((phaseDown >0)) {\n robot.leftStageOne.setPower(1);\n robot.rightStageOne.setPower(1);\n }\n\n else if ((phaseUp >0)) {\n robot.leftStageOne.setPower(-1);\n robot.rightStageOne.setPower(-1);\n }\n\n else {\n robot.rightStageOne.setPower(0);\n robot.leftStageOne.setPower(0);\n }\n\n/*\n if (gamepad1.y){\n robot.leftStageTwo.setPosition(1);\n robot.rightStageTwo.setPosition(0.1);\n }\n if(gamepad1.x)\n {\n robot.leftStageTwo.setPosition(.4);\n robot.rightStageTwo.setPosition(.7);\n }\n if (gamepad1.a){\n robot.leftStageTwo.setPosition(0.12);\n robot.rightStageTwo.setPosition(.98);\n }\n */\n if(gamepad1.a) {\n robot.align.setPosition(.57);\n }\n if(gamepad1.x)\n {\n robot.align.setPosition(0.95);\n }\n if (gamepad1.b){\n robot.colorDrop.setPosition(.35);\n }\n\n\n\n\n if (gamepad2.a){\n // robot.leftStageTwo.setPosition(1);\n // robot.rightStageTwo.setPosition(0.1);\n }\n if(gamepad2.x)\n {\n // robot.leftStageTwo.setPosition(.4);\n // robot.rightStageTwo.setPosition(.7);\n }\n if (gamepad2.y){//lift up\n // robot.leftStageTwo.setPosition(0.12);\n //robot.rightStageTwo.setPosition(.98);\n }\n if (gamepad2.b){\n robot.colorDrop.setPosition(.35);\n }\n\n\n\n\n\n\n /*\n if (gamepad1.right_bumper == true){\n // robot.leftBumper.setPosition(robot.leftBumper.getPosition()+.05);\n sleep(2000);\n }\n else if (gamepad1.left_bumper == true){\n /// robot.leftBumper.setPosition(robot.leftBumper.getPosition()-.05);\n\n }\n else{\n ///robot.leftBumper.setPosition(robot.leftBumper.getPosition());\n }\n */\n /*\n\n */\n // if (gamepad2.dpad_down){\n // robot.relicServo.setPosition(robot.relicServo.getPosition()+.025);\n // }\n //else if(gamepad2.dpad_up){\n // robot.relicServo.setPosition(robot.relicServo.getPosition()-.025);\n // }\n // else{\n // robot.relicServo.setPosition(robot.relicServo.getPosition());\n //}\n\n// if (gamepad2.dpad_left){\n // robot.relicDropperServo.setPosition(robot.relicDropperServo.getPosition()+.025);\n // }\n // else if (gamepad2.dpad_right){\n // robot.relicDropperServo.setPosition(robot.relicDropperServo.getPosition()-.025);\n // }\n // else {\n // robot.relicDropperServo.setPosition(robot.relicDropperServo.getPosition());\n //}\n // if (gamepad2.left_trigger>5){\n // robot.relicMotor.setPower(.5);\n // }\n //else if (gamepad2.left_bumper){\n // robot.relicMotor.setPower(-.5);\n //}\n //else{\n // robot.relicMotor.setPower(0);\n // }\n\n // Send telemetry message to signify robot running;\n // telemetry.addData(\"claw\", \"Offset = %.2f\", clawOffset);\n // telemetry.addData(\"sideright\", \"%.2f\", sideRight);\n // telemetry.addData(\"right\", \"%.2f\", Left);\n // telemetry.addData(\"sideright\", \"%.2f\", sideRight);\n // telemetry.addData(\"left\", \"%.2f\", sideLeft);\n/*\n //distance = robot.sensorDistance.getDistance(DistanceUnit.CM);\n // send the info back to driver station using telemetry function.\n telemetry.addData(\"Distance (cm)\",\n String.format(Locale.US, \"%.02f\", robot.sensorDistance.getDistance(DistanceUnit.CM)));\n telemetry.addData(\"Alpha\", robot.sensorColor.alpha());\n telemetry.addData(\"Red \", robot.sensorColor.red());\n telemetry.addData(\"Green\", robot.sensorColor.green());\n telemetry.addData(\"Blue \", robot.sensorColor.blue());\n */\n telemetry.addData(\"phaseUp \", phaseUp);\n telemetry.addData(\"sideRight \", sideRight);\n // telemetry.addData(\"right bumper: \", robot.rightBumper.getPosition());\n // telemetry.addData(\"left bumper: \", robot.leftBumper.getPosition());\n telemetry.update();\n }", "@Override\n public void update(){\n super.update();\n if(getPositionY() < -2.f){\n setAngleXYDeltaTheta(0.0f);\n setAngleXY(0.0f);\n setPositionY(1.0f);\n setDy(0.0f);\n setDx(0.0f);\n setInPlay(true);\n }\n }", "private void changeSpeed() {\n\t\tint t = ((JSlider)components.get(\"speedSlider\")).getValue();\n\t\tsim.setRunSpeed(t);\n\t}", "@Override\npublic void teleopPeriodic() {\nm_robotDrive.arcadeDrive(m_stick.getRawAxis(5)* (-0.5), m_stick.getRawAxis(4)*0.5);\n}", "@Override\n protected void accelerate() {\n System.out.println(\"Bike Specific Acceleration\");\n }", "private void updateOutputValues()\n {\n // TODO: You may place code here to update outputY and outputZ\n \t// Drawing code belongs in drawOnTheCanvas\n \t\n // example:\n outputY = inputA && inputC;\n }", "@Override\n\tpublic float getMaxAngularSpeed() {\n\t\treturn MaxAngularSpeed;\n\t}", "public double curSwing(){\r\n return swingGyro.getAngle();\r\n }", "public void setCurrentSpeed (double speed);", "@Override\n public void execute() {\n double rightTriggerValue = RobotContainer.joystickDriver.getRawAxis(Ports.OIDriverSlowmode);\n m_subsystem.setSlowmode((rightTriggerValue >= TuningParams.SLOWMODE_TRIGGER_THRESHOLD) ? true : false);\n\n double speedLeft = RobotContainer.joystickDriver.getFilteredAxis(Ports.OIDriverLeftDrive);\n double speedRight = RobotContainer.joystickDriver.getFilteredAxis(Ports.OIDriverRightDrive);\n m_subsystem.setSpeeds(speedLeft, speedRight);\n }", "public void accelerate(){\n speed += 5;\n }", "double scale_motor_power(double p_power) //Scales joystick value to output appropriate motor power\n {Scales joystick value to output appropriate motor power\n { //Use like \"scale_motor_power(gamepad1.left_stick_x)\"\n //\n // Assume no scaling.\n //\n double l_scale = 0.0;\n\n //\n // Ensure the values are legal.\n //\n double l_power = Range.clip(p_power, -1, 1);\n\n double[] l_array =\n {0.00, 0.05, 0.09, 0.10, 0.12\n , 0.15, 0.18, 0.24, 0.30, 0.36\n , 0.43, 0.50, 0.60, 0.72, 0.85\n , 1.00, 1.00\n };\n\n //\n // Get the corresponding index for the specified argument/parameter.\n //\n int l_index = (int) (l_power * 16.0);\n if (l_index < 0) {\n l_index = -l_index;\n } else if (l_index > 16) {\n l_index = 16;\n }\n\n if (l_power < 0) {\n l_scale = -l_array[l_index];\n } else {\n l_scale = l_array[l_index];\n }\n\n return l_scale;\n\n }", "@Override\n public void execute() {\n //How does one pass the joystick value here? There has to be a better way.\n driveTrainSubsystem.drive(1.0);\n\n\n //control pneumatics\n DoubleSolenoid doubleSolenoid = new DoubleSolenoid(1, 2);\n\n for(int i =0; i < 30000; i++) {\n doubleSolenoid.set(Value.kForward);\n System.out.println(\"Solenoid forward\");\n }\n\n for(int i =0; i < 30000; i++) {\n doubleSolenoid.set(Value.kReverse);\n System.out.println(\"Solenoid backward\");\n }\n\n\n System.out.println(\"Solenoid off\");\n doubleSolenoid.set(Value.kReverse);\n\n }", "private void updateVelocity() {\n\t \t//Update x velocity\n\t \tif (getNode().getTranslateX() > MAX_SPEED_X) {\n\t \t\tsetvX(MAX_SPEED_X);\n\t \t} else if (getNode().getTranslateX() < -MAX_SPEED_X) {\n\t \t\tsetvX(-MAX_SPEED_X);\n\t } else {\n\t \t\tsetvX(getNode().getTranslateX());\n\t \t}\n\n\t \t//Update x velocity\n\t \tif (getNode().getTranslateY() > MAX_SPEED_Y) {\n\t \t\tsetvY(MAX_SPEED_Y);\n\t \t} else if (getNode().getTranslateY() < -MAX_SPEED_Y) {\n\t \t\tsetvY(-MAX_SPEED_Y);\n\t \t} else {\n\t \t\tsetvY(getNode().getTranslateY());\n\t \t}\n\t }", "@Override\n public void teleopPeriodic() {\n double pi4 = (double)Math.PI/4;\n/*\n double deadzoneX = 0.1;\n double multiplierX = 1/deadzoneX;\n double deadzoneY = 0.1;\n double multiplierY = 1/deadzoneY;\n\n double maxSpeed = stick.getThrottle() * 1f;\nstick.getX()/Math.abs(stick.getX())\n double stickX;\n if (Math.abs(stick.getX())< deadzoneX){\n stickX = 0;\n }\n\n else {\n stickX = ((stick.getMagnitude() * Math.sin(stick.getDirectionRadians())) - deadzoneX)*multiplierX;\n }\n\n \n double stickY;\n if (Math.abs(stick.getY())< deadzoneY){\n stickY = 0;\n }\n\n else {\n stickY = (stick.getMagnitude() * Math.cos(stick.getDirectionRadians()) - deadzoneY)*multiplierY;\n }\n \n\n double stickTwist = stick.getTwist();\n\n double leftFrontForwardsPower = -stickY;\n double rightFrontForwardsPower = stickY;\n double leftBackForwardsPower = -stickY;\n double rightBackForwardsPower = stickY;\n\n double leftFrontSidePower = -stickX;\n double rightFrontSidePower = -stickX;\n double leftBackSidePower = +stickX;\n double rightBackSidePower = stickX;\n\n double leftFrontRotatePower = -stickTwist;\n double rightFrontRotatePower = -stickTwist;\n double leftBackRotatePower = -stickTwist;\n double rightBackRotatePower = -stickTwist;\n\n */\n\n /* get gyro from robot\n set gyro tto original gyro\n void()\n\n get X for joystick\n get Y for Joystick\n\n get gyro for robot\n\n if X = 0\n then Joystick angle pi/2\n else\n then Joystick angle = arctan(Y/X)\n\n newGyro = original gyro - gyro\n\n xfinal = cos(newGyro+joystickangle) * absolute(sqrt(x^2+y^2))\n yfinal = sin(newGyro+joystickangle) * absolute(sqrt(x^2+y^2))\n*/\n\n//Xbox COntroller\n \n double maxSpeed = stick.getThrottle() * 0.2f;\n double maxRot = 1f;\n\n double controllerX = -controller.getX(Hand.kRight);\n double controllerY = controller.getY(Hand.kRight);\n double joyAngle;\n boolean gyroRestart = controller.getAButtonPressed();\n\n if (gyroRestart){\n gyro.reset();\n origGyro = Math.toRadians(gyro.getAngle());\n }\n\n double mainGyro = Math.toRadians(gyro.getAngle());\n/*\n if (controllerX == 0 && controllerY > 0){\n joyAngle = (3*Math.PI)/2;\n }\n\n \n if (controllerX == 0 && controllerY < 0){\n joyAngle = Math.PI/2;\n }\n\n else{\n joyAngle = Math.atan(controllerY/controllerX);\n }\n\n if (controllerX > 0 && controllerY < 0){\n joyAngle = Math.abs(joyAngle + Math.toRadians(180));\n }\n if (controllerX > 0 && controllerY > 0){\n joyAngle -= Math.toRadians(180);\n }\n / * if (controllerX < 0 && controllerY > 0){\n joyAngle -= Math.toRadians(270);\n }* /\n*/\n joyAngle = Math.atan2(controllerY, controllerX);\n\n double newGyro = origGyro - mainGyro;\n //double newGyro = 0;\n\n double controllerTurn = -controller.getX(Hand.kLeft)*maxRot;\n\n double magnitude = Math.abs(Math.sqrt(Math.pow(controllerX,2) + Math.pow(controllerY, 2)));\n\n double xFinal = Math.cos(newGyro + joyAngle) * magnitude;\n double yFinal = Math.sin(newGyro + joyAngle) * magnitude;\n\n\n /* \n double leftFrontForwardsPower = -controllerY;\n double rightFrontForwardsPower = controllerY;\n double leftBackForwardsPower = -controllerY;\n double rightBackForwardsPower = controllerY;\n\n double leftFrontSidePower = -controllerX;\n double rightFrontSidePower = -controllerX;\n double leftBackSidePower = controllerX;\n double rightBackSidePower = controllerX;\n*/\n \n double leftFrontForwardsPower = -yFinal;\n double rightFrontForwardsPower = yFinal;\n double leftBackForwardsPower = -yFinal;\n double rightBackForwardsPower = yFinal;\n\n double leftFrontSidePower = -xFinal;\n double rightFrontSidePower = -xFinal;\n double leftBackSidePower = xFinal;\n double rightBackSidePower = xFinal;\n \n double leftFrontRotatePower = -controllerTurn;\n double rightFrontRotatePower = -controllerTurn;\n double leftBackRotatePower = -controllerTurn;\n double rightBackRotatePower = -controllerTurn;\n\n double forwardsWeight = 1;\n double sideWeight = 1;\n double rotateWeight = 1;\n\n double leftFrontPower = leftFrontForwardsPower * forwardsWeight + leftFrontSidePower * sideWeight + leftFrontRotatePower * rotateWeight;\n double rightFrontPower = rightFrontForwardsPower * forwardsWeight + rightFrontSidePower * sideWeight + rightFrontRotatePower * rotateWeight;\n double leftBackPower = leftBackForwardsPower * forwardsWeight + leftBackSidePower * sideWeight + leftBackRotatePower * rotateWeight;\n double rightBackPower = rightBackForwardsPower * forwardsWeight + rightBackSidePower * sideWeight + rightBackRotatePower * rotateWeight;\n\n leftFrontPower *= maxSpeed;\n rightFrontPower *= maxSpeed;\n leftBackPower *= maxSpeed;\n rightBackPower *= maxSpeed;\n\n\n double largest = Math.max( \n Math.max( Math.abs( leftFrontPower),\n Math.abs(rightFrontPower)),\n Math.max( Math.abs( leftBackPower), \n Math.abs( rightBackPower)));\n\n if (largest > 1) {\n leftFrontPower /= largest;\n rightFrontPower /= largest;\n leftBackPower /= largest;\n rightBackPower /= largest;\n }\n \n \n leftFrontMotor.set(leftFrontPower);\n rightFrontMotor.set(rightFrontPower); \n leftBackMotor.set(leftBackPower);\n rightBackMotor.set(rightBackPower);\n\n SmartDashboard.putNumber(\"Main Gyro\", mainGyro);\n SmartDashboard.putNumber(\"Original Gyro\", origGyro);\n SmartDashboard.putNumber(\"New Gyro\", newGyro);\n SmartDashboard.putNumber(\"Controller X\", controllerX);\n SmartDashboard.putNumber(\"Controller Y\", controllerY);\n SmartDashboard.putNumber(\"Magnitude \", magnitude);\n SmartDashboard.putNumber(\"Largest\", largest);\n SmartDashboard.putNumber(\"Joystick Angle\", Math.toDegrees(joyAngle));\n SmartDashboard.putNumber(\"X final\", xFinal);\n SmartDashboard.putNumber(\"Y final\", yFinal);\n SmartDashboard.putNumber(\"Left Front Power\", leftFrontPower);\n SmartDashboard.putNumber(\"Right Front Power\", rightFrontPower);\n SmartDashboard.putNumber(\"Left Back Power\", leftBackPower);\n SmartDashboard.putNumber(\"Right Back Power\", rightBackPower);\n }", "private void updateBit() {\r\n float frameTime = 10f;\r\n xVel += (xAccel * frameTime);\r\n yVel += (yAccel * frameTime);\r\n\r\n float xS = (xVel / 20) * frameTime; //PROVIDE THE ANGULE OF THE POSITION\r\n float yS = (yVel / 20) * frameTime; // WITH LESS DENOMINADOR THE BALL MOVE IS MORE DIFFICULT\r\n\r\n xPos -= xS;\r\n yPos -= yS;\r\n\r\n if (xPos > xMax) {\r\n xPos = xMax;\r\n } else if (xPos < 0) {\r\n xPos = 0;\r\n }\r\n\r\n if (yPos > yMax) {\r\n yPos = yMax;\r\n } else if (yPos < 0) {\r\n yPos = 0;\r\n }\r\n\r\n\r\n }", "public void testPeriodic() { \n joystick1X = leftStick.getAxis(Joystick.AxisType.kX);\n joystick1Y = leftStick.getAxis(Joystick.AxisType.kY);\n joystick2X = rightStick.getAxis(Joystick.AxisType.kX);\n joystick2Y = rightStick.getAxis(Joystick.AxisType.kY);\n \n mapped1Y = joystick1Y/2 + 0.5;\n mapped1X = joystick1X/2 + 0.5;\n mapped2X = joystick2X/2 + 0.5;\n mapped2Y = joystick2Y/2 + 0.5;\n \n X1testServo.set(mapped1X);\n Y1testServo.set(mapped1Y);\n X2testServo.set(mapped2X);\n Y2testServo.set(mapped2Y);\n \n \n //System.out.println(\"X Servo Value = \" + XtestServo.get());\n //System.out.println(\"Left Joystick X Value = \" + leftStick.getX());\n //System.out.println(\"Y Servo Value = \" + YtestServo.get());\n //System.out.println(\"Left Joystick Y Value = \" + leftStick.getY());\n \n \n }", "public void TeleopCode() {\n\t\tMLeft.set(-Controls.joy2.getRawAxis(5)+ 0.06); //(Controls.joy2.getRawAxis5 + 0.06);\n\t}", "@Override\n public void loop() {\n // Setup a variable for each drive wheel to save power level for telemetry\n double leftDrivePower;\n double rightDrivePower;\n double driveMultiplier;\n double slowMultiplier;\n double fastMultiplier;\n double BASE_DRIVE_SPEED = 0.6;\n double elevPower;\n double armPower;\n boolean lowerLimitPressed;\n boolean upperLimitPressed;\n\n\n\n\n // Tank Mode uses one stick to control each wheel.\n // - This requires no math, but it is hard to drive forward slowly and keep straight.\n armPower = -gamepad2.right_stick_x * 0.3;\n\n lowerLimitPressed = !lowerLimit.getState();\n upperLimitPressed = !upperLimit.getState();\n\n if((lowerLimitPressed && -gamepad2.left_stick_y < 0) || (upperLimitPressed && -gamepad2.left_stick_y > 0)){\n elevPower = 0;\n }\n else {\n elevPower = -gamepad2.left_stick_y * 1;\n }\n\n if (gamepad2.left_bumper){\n hookPosDeg = HOOK_UP;\n }\n else if (gamepad2.left_trigger > 0){\n hookPosDeg = HOOK_DOWN;\n }\n\n if (gamepad2.right_bumper){\n clawPosDeg = CLAW_OPEN;\n }\n else if (gamepad2.right_trigger > 0){\n clawPosDeg = CLAW_CLOSED;\n }\n\n if (gamepad1.left_trigger > 0){\n slowMultiplier = 0.10;\n }\n else\n slowMultiplier = 0;\n\n if (gamepad1.right_trigger > 0){\n fastMultiplier = 0.30;\n }\n else\n fastMultiplier = 0;\n\n driveMultiplier = BASE_DRIVE_SPEED + slowMultiplier + fastMultiplier;\n leftDrivePower = -gamepad1.left_stick_y * driveMultiplier;\n rightDrivePower = -gamepad1.right_stick_y * driveMultiplier;\n\n // Send power to actuators\n leftDrive.setPower(leftDrivePower);\n rightDrive.setPower(rightDrivePower);\n elev.setPower(elevPower);\n// arm.setTargetPosition(armTarget);\n// arm.setMode(DcMotor.RunMode.RUN_TO_POSITION);\n arm.setPower(armPower);\n hookPos = map(hookPosDeg, HOOK_MIN_POS_DEG, HOOK_MAX_POS_DEG, HOOK_MIN_POS, HOOK_MAX_POS);\n clawPos = map(clawPosDeg, CLAW_MIN_POS_DEG, CLAW_MAX_POS_DEG, CLAW_MIN_POS, CLAW_MAX_POS);\n hook.setPosition(hookPos);\n claw.setPosition(clawPos);\n\n // Show the elapsed game time and wheel power.\n telemetry.addData(\"Status\", \"Run Time: \" + runtime.toString());\n telemetry.addData(\"Drive\", \"left (%.2f), right (%.2f)\", leftDrivePower, rightDrivePower);\n telemetry.addData( \"Elev\", \"power (%.2f)\", elevPower);\n telemetry.addData(\"Limit\", \"lower (%b), upper (%b)\", lowerLimitPressed, upperLimitPressed);\n telemetry.addData(\"Arm Enc\", arm.getCurrentPosition());\n\n }", "void tickDeviceWrite(INDArray array);", "private void accelerate()\n {\n if(accelX < maxAccelRate)\n {\n accelX += accelerationRate;\n }\n }", "void onToggleSpeedSlider(Canvas canvas);", "public void setYSpeed(int speed){\n ySpeed = speed;\n }", "@Override\r\n\tpublic float getVerticalSpeed() {\n\t\treturn 0;\r\n\t}", "private void reverseCompSpeed() {\n this.compSpeed = -this.compSpeed;\n }", "@Override\n public void loop() {\n double left;\n double right;\n\n // // Run wheels in tank mode (note: The joystick goes negative when pushed forwards, so negate it)\n left = -gamepad1.left_stick_y;\n right = -gamepad1.right_stick_y;\n \n // double Target = 0;\n // robot.rightBack.setTargetPosition((int)Target);\n // robot.rightBack.setMode(DcMotor.RunMode.RUN_TO_POSITION);\n\n rightFront.setPower(left);\n rightBack.setPower(right);\n // robot.rightDrive.setPower(right);\n\n // // Use gamepad left & right Bumpers to open and close the claw\n // if (gamepad1.right_bumper)\n // clawOffset += CLAW_SPEED;\n // else if (gamepad1.left_bumper)\n // clawOffset -= CLAW_SPEED;\n\n // // Move both servos to new position. Assume servos are mirror image of each other.\n // clawOffset = Range.clip(clawOffset, -0.5, 0.5);\n // robot.leftClaw.setPosition(robot.MID_SERVO + clawOffset);\n // robot.rightClaw.setPosition(robot.MID_SERVO - clawOffset);\n\n // Use gamepad buttons to move the arm up (Y) and down (A)\n // if (gamepad1.y)\n // armPosition += ARM_SPEED;\n \n // if (gamepad1.a)\n // armPosition -= ARM_SPEED;\n \n // armPosition = Range.clip(armPosition, robot.ARM_MIN_RANGE, robot.ARM_MAX_RANGE); \n \n\n // // Send telemetry message to signify robot running;\n // telemetry.addData(\"arm\", \"%.2f\", armPosition);\n // telemetry.addData(\"left\", \"%.2f\", left);\n // telemetry.addData(\"right\", \"%.2f\", right);\n }", "public void reverseSpeeds() {\n\t\txSpeed = -xSpeed;\n\t\tySpeed = -ySpeed;\n\t}", "public void updateSpeed() {\n\t\t// should work b/c of integer arithmetic\n\t\tif(isTwoPlayer)\n\t\t\treturn;\n\t\t//System.out.println(\"speed up factor: \" + speedUpFactor);\n\t\t//System.out.println(\"numlinescleared/6: \" + numLinesCleared/6);\n\t\tif (speedUpFactor != numLinesCleared/6) {\n\t\t\t// speed by 10% every lines cleared, needs to be checked\n\t\t\tspeedUpFactor = numLinesCleared/6;\n\t\t\tif(!(defaultSpeed - 30*speedUpFactor <= 0))\n\t\t\t\tdefaultSpeed = defaultSpeed - 30*speedUpFactor;\n\t\t\tlevel = speedUpFactor;\n\t\t}\n\t\t//System.out.println(\"default speed: \" + defaultSpeed);\n\t}", "@Override\r\n\tpublic void update(float dt) {\n\r\n\t}", "public float getVerticalSpeed() { return VerticalSpeed; }", "@Override\n\tpublic void increaseSpeed() {\n\t\tSystem.out.println(\"increaseSpeed\");\n\t\t\n\t}", "public void speedUp(){\r\n\t\tmoveSpeed+=1;\r\n\t\tmoveTimer.setDelay(1000/moveSpeed);\r\n\t}", "@Override\r\n\tpublic void onSensorChanged(SensorEvent event) {\n\t\t\r\n\t\tax = - event.values[0] / 7;\r\n\t\tay = event.values[1] / 7;\r\n\t}", "@Override\n public void actionPerformed(ActionEvent e) {\n\n if (animationInProgress) {\n logger.info(\"Lost frame...\");\n return;\n }\n animationInProgress = true;\n\n java.util.List<Double> toIndex = indexFind.get(0);\n\n int value = Step + stepStep * animDirection;\n if (value < 1) {\n value = 1;\n }\n else if (value > toIndex.size()) {\n value = toIndex.size() - 1;\n }\n\n Step = value;\n\n try {\n long start = System.currentTimeMillis();\n XYPlot plot = (XYPlot)this.chartPanel.getChart().getPlot();\n currentIndex = Step - 1;\n plot.setDomainCrosshairValue(toIndex.get(currentIndex));\n //selectStructure(Step);\n //structureManagerInterface.selectStructure(currentIndex);\n float secs = (System.currentTimeMillis() - start) / 1000.0f;\n logger.info(\"Elapsed time: \" + secs);\n //setSnapshotValue(Step);\n }\n catch (Exception ex) {\n animationInProgress = false;\n timer.stop();\n JOptionPane.showMessageDialog(this, \"Error during animation: \" + ex.getMessage() + \"\\nAnimation stopped\", \"Error\",\n JOptionPane.ERROR_MESSAGE);\n return;\n }\n\n if (animationMode == 0) { // Animate once\n if (Step == 1 && animDirection == -1) {\n stopAnimation();\n }\n else if (Step == toIndex.size() && animDirection == 1) {\n stopAnimation();\n }\n }\n\n else if (animationMode == 1) { // Animate in loop\n if (Step == 1 && animDirection == -1) {\n Step = toIndex.size();\n }\n else if (Step == toIndex.size() && animDirection == 1) {\n Step = 1;\n }\n }\n\n else if (animationMode == 2) { // Animate back & forth\n if (Step == 1 && animDirection == -1) {\n if (toIndex.size() > 1) {\n Step = 1;\n animDirection = 1;\n }\n }\n else if (Step == toIndex.size() && animDirection == 1) {\n if (toIndex.size() > 1) {\n Step = toIndex.size() - 1;\n animDirection = -1;\n }\n }\n }\n\n animationInProgress = false;\n }", "public void setSpeed(float val) {speed = val;}", "public void joystickInput(Joystick main){\n \tif (RobotMap.elevatorscaleSwitch.get()==false){\n \t\tRobotMap.elevatorlinearMotor.set(0.0);\n \t}\n \tif (main.getRawButton(2)){\n \t\tshootMotorRight.set(0.8);\n \t\tshootMotorLeft.set(0.8);\n \t}\n \telse if (main.getRawButton(4)){\n \t\tshootMotorRight.set(-1);\n \t\tshootMotorLeft.set(-1);\n \t}\n \telse if (main.getRawButton(5)){\n \t\tshootMotorRight.set(-0.5);\n \t\tshootMotorLeft.set(-0.5);\n \t}\n \telse if (main.getRawAxis(2)!=0){\n \t\tshootMotorRight.set(-0.75);\n \t\tshootMotorLeft.set(0.75);\n \t}\n \telse if (main.getRawAxis(3)!=0){\n \t\tshootMotorRight.set(0.75);\n \t\tshootMotorLeft.set(-0.75);\n \t}\n \telse{\n \t\tshootMotorRight.stopMotor();\n \tshootMotorLeft.stopMotor();\n \t}\n }", "private void updateJump()\n {\n\t\tif(isJumping && jumpKeyDown)\n\t\t{\n\t\t\tif(ySpeed > maxJumpSpeed)\n\t\t\t{\n\t \t\tySpeed -= jumpIncr;\n\t \t\tSystem.out.println(\" Player.updateJump() : \" + ySpeed);\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tSystem.out.println(\n \t\t\t\t\"updateJump() --> maximum jump speed reached : \" + ySpeed);\n\t\t\t\tisJumping = false;\n\t\t\t}\n\t\t}\n\t}", "public abstract void update(float dt);", "public abstract void update(float dt);", "public abstract void update(float dt);", "@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 }", "@Override\n public void onUpdate(float v) {\n }", "protected void execute() {\n \tthis.LiftVertAxis.manualOverride(-(this.oi.getBMGamepadAxis5() * .75));\n }", "@Override\n\tpublic void onUpdate(float dt) {\n\t}", "public double getCurrentSpeed();", "public void update(){\n\t\ttime += System.currentTimeMillis() - lastTime;\n\t\tlastTime = System.currentTimeMillis();\n\t\t\n\t\t/*fin quando il tempo Ŕ maggiore della velocita incrementa gli indici*/\n\t\tif(time > velocity){\n\t\t\tindex++;\n\t\t\ttime = 0;\n\t\t\tif(index >= animation_frame.length)\n\t\t\t\t{\n\t\t\t\t\tindex = 0;\n\t\t\t\t}\n\t\t}\n\t}", "public Vector2 handleJoystickInput() {\n if(joystick.getKnobPercentX() == 0 && joystick.getKnobPercentY() == 0) {\n return Vector2.Zero;\n } else {\n return new Vector2(joystick.getKnobPercentX(), joystick.getKnobPercentY());\n }\n }", "public void intake(double up_speed, double down_speed) //上面&下面的intake\n {\n intake_up.set(ControlMode.PercentOutput, up_speed);\n intake_down.set(ControlMode.PercentOutput, down_speed);\n }", "public void updateVelocity(){\r\n if (getPosition().x <= 0 || getPosition().x >= GameBoard.MAX_X) {\r\n setVelocity(getVelocity().add(getVelocity().mul(reverse)));\r\n }\r\n }", "@Override\n\tpublic void update(float dt) {\n\t\t\n\t}", "@Override\r\n public void stateChanged(ChangeEvent e) {\n gameWindow.getTickDelayLabel().setText(\"Delay: \" + gameWindow.getSlider().getValue()*10 + \" ms\");\r\n }", "double getPlaybackSpeed();", "public void timer()\n{\n textSize(13);\n controlP5.getController(\"time\").setValue(runtimes);\n line(400, 748, 1192, 748);\n fill(255,0,0);\n for (int i =0; i<25; i++)\n {\n line(400+i*33, 743, 400+i*33, 753);\n text(i, 395 +i*33, 768);\n }\n if ((runtimes < 1 || runtimes > 28800) && s == true)\n {\n //origint = 0;\n runtimes = 1;\n //pausets = 0;\n runtimep = 0;\n } else if (runtimes > 0 && runtimes < 28800 && s == true)\n {\n runtimep = runtimes;\n runtimes = runtimes + speed;\n }\n timeh= runtimes/1200;\n timem= (runtimes%1200)/20;\n}" ]
[ "0.63613456", "0.6119397", "0.6032133", "0.58401823", "0.5828091", "0.5789473", "0.5753884", "0.57474893", "0.57435143", "0.5742727", "0.5706989", "0.56979316", "0.5675902", "0.56601083", "0.56503963", "0.5644606", "0.5635065", "0.56056696", "0.558435", "0.55409276", "0.5535756", "0.5522853", "0.5499368", "0.5494275", "0.54428875", "0.5441394", "0.5432306", "0.54307276", "0.54282564", "0.54228044", "0.5421377", "0.5414988", "0.5413548", "0.5404182", "0.53972363", "0.53972363", "0.53937787", "0.53925234", "0.53863", "0.5385049", "0.5374721", "0.5366662", "0.5360342", "0.5359816", "0.53588605", "0.53457415", "0.5343323", "0.53390735", "0.5337094", "0.5333573", "0.5328488", "0.53257024", "0.53191173", "0.53125715", "0.5306613", "0.5304223", "0.530412", "0.5300405", "0.52981114", "0.5284468", "0.5280194", "0.5276098", "0.5275251", "0.5274246", "0.52649736", "0.5264957", "0.52637917", "0.52609813", "0.5259487", "0.5256583", "0.5256374", "0.5252209", "0.5248094", "0.52479976", "0.52462566", "0.5241198", "0.522927", "0.5228719", "0.5228498", "0.522609", "0.52138937", "0.52087575", "0.5207097", "0.5207073", "0.5206711", "0.5205417", "0.5205417", "0.5205417", "0.5205069", "0.51992244", "0.5198531", "0.5189989", "0.51888436", "0.5186879", "0.5179745", "0.51793027", "0.5175996", "0.5173942", "0.5171379", "0.51629865", "0.51583344" ]
0.0
-1
Gets the button value
public boolean isPressed(int b) { if (b >= 0 && b < buttonPressed.length) { return buttonPressed[b] && !buttonLastPressed[b]; } else { return false; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public String getValue_click_Digital_coupons_button(){\r\n\t\treturn click_Digital_coupons_button.getAttribute(\"value\");\r\n\t}", "public String getValue_click_CloseModal_Button(){\r\n\t\treturn click_CloseModal_Button.getAttribute(\"value\");\r\n\t}", "public String getValue_txt_Fuel_Rewards_Page_Button(){\r\n\t\treturn txt_Fuel_Rewards_Page_Button.getAttribute(\"value\");\r\n\t}", "public String getValue_click_ActivateCoupon_Button(){\r\n\t\treturn click_ActivateCoupon_Button.getAttribute(\"value\");\r\n\t}", "public int getButton() {\n\t\t//Check what button it is then return the value\n\t\tif (this.isLeftButton)\n\t\t\treturn 0;\n\t\telse if (this.isRightButton)\n\t\t\treturn 1;\n\t\telse if (this.isMiddleButton)\n\t\t\treturn 2;\n\t\telse\n\t\t\treturn -1;\n\t}", "@Override\n\tpublic Object getCellEditorValue() {\n\t\treturn this.btn_delete.getText(); \n\t}", "Button getBtn();", "public Button getButton() {\n\t\treturn button;\n\t}", "public String GetButtonText() {\n\t\treturn getWrappedElement().getText();\n\t}", "public SimpleStringProperty getButtonInput() {\n return buttonInput;\n }", "public String getKey() {\r\n return this.buttonKey;\r\n }", "public JButton getButton(){\n\t\treturn item;\n\t}", "public String getText_click_Digital_coupons_button(){\r\n\t\treturn click_Digital_coupons_button.getText();\r\n\t}", "public final MouseButton getButton() {\n return button;\n }", "@Override\r\n public Object getAttribute() {\r\n return this.buttonKey;\r\n }", "public String getValue() {\n return getMethodValue(\"value\");\n }", "public JoystickButton getButtonB() {\n\t\treturn button[1];\n\t}", "public String getText_txt_Fuel_Rewards_Page_Button(){\r\n\t\treturn txt_Fuel_Rewards_Page_Button.getText();\r\n\t}", "public boolean getButton(XboxController.Button inputButton) {\n\t\treturn this.getRawButton(inputButton.value);\n\t}", "public JButton getBoton() {\n return boton;\n }", "private int getResult(){\n\t\t\t\tButtonModel\tbtnModel = btnGroup.getSelection();\r\n \t\t\tif(btnModel!=null){\r\n \t\t\t\treturn Integer.parseInt(btnModel.getActionCommand());\r\n\t\t\t\t}\r\n\t\t\t\treturn -10; //return -10 if user did not fill selection\r\n\t\t\t}", "public String getFieldValue() {\r\n\t\tString value = textBox.getValue();\r\n\t\t\t\r\n\t\treturn value;\r\n\t}", "public String getText_click_ActivateCoupon_Button(){\r\n\t\treturn click_ActivateCoupon_Button.getText();\r\n\t}", "public JButton getBoton1(){\n return this.perfilBT;\n }", "@objid (\"477ed32e-345e-478d-bf2d-285fddcaf06e\")\r\n public Text getTextButton() {\r\n return this.text;\r\n }", "public Object getValue() {\n return spinner.getValue();\n }", "public E getSelected() {\n ButtonModel selection = selectedModelRef.get();\n //noinspection UseOfSystemOutOrSystemErr\n final String actionCommand = selection.getActionCommand();\n //noinspection HardCodedStringLiteral,UseOfSystemOutOrSystemErr\n return Objects.requireNonNull(textMap.get(actionCommand));\n }", "@Override\n\tpublic String getValue() {\n\t\treturn PushyView.c.getValue();\n\t}", "public int getButtonID(){return i_ButtonID;}", "public String getText_click_CloseModal_Button(){\r\n\t\treturn click_CloseModal_Button.getText();\r\n\t}", "public MyButton getBoton() {\n\t\treturn boton;\n\t}", "public PromptValue getValue()\n {\n return value;\n }", "public Button getButton(String key) {\n return buttons.get(key);\n }", "public boolean getBButton() {\n\t\treturn getRawButton(B_Button);\n\t}", "public Button getNo() {\n return no;\n }", "public HTMLInputElement getElementBtnSalir() { return this.$element_BtnSalir; }", "public HTMLInputElement getElementBtnAyuda() { return this.$element_BtnAyuda; }", "@Override\n\tpublic void actionPerformed(ActionEvent e) {\n\t\tJButton b1= (JButton) e.getSource();\n\t\tSystem.out.println(b1.getText());\n\t}", "public JoystickButton getButtonX() {\n\t\treturn button[2];\n\t}", "public JButton getjButton1() {\n return jButton1;\n }", "public JButton getReturnButton() {\n return this.retour;\n }", "public static JButton getIncrBet(){\n\t\treturn incrBet;\n\t}", "private byte getValue() {\n\t\treturn value;\n\t}", "public boolean getAButton() {\n\t\treturn getRawButton(A_Button);\n\t}", "public JButton getBtnSalir() {\n return btnSalir;\n }", "public String getValue_click_Fuel_Rewards_Link(){\r\n\t\treturn click_Fuel_Rewards_Link.getAttribute(\"value\");\r\n\t}", "public String getValue_click_My_Rewards_Link(){\r\n\t\treturn click_My_Rewards_Link.getAttribute(\"value\");\r\n\t}", "public JButton getBtnBonus() {\n return btnBonus;\n }", "public boolean getButton(Button button) {\n return getButton(button.getNumber());\n }", "protected JButton getCheckAnswerButton() {\n return checkAnswerButton;\n }", "public int getValue(){\n return selectedValue;\n }", "public JoystickButton getButtonA() {\n\t\treturn button[0];\n\t}", "private JButton getJBValorPadrao()\n\t{\n\t\tif ( jBValorPadrao == null )\n\t\t{\n\t\t\tjBValorPadrao = new JButton();\n\t\t\tjBValorPadrao.setBounds(new Rectangle(870, 133, 126, 23));\n\t\t\tjBValorPadrao.setText(\"Valor Padrao\");\n\t\t\tjBValorPadrao.addActionListener(new java.awt.event.ActionListener()\n\t\t\t{\n\t\t\t\tpublic void actionPerformed(final java.awt.event.ActionEvent e)\n\t\t\t\t{\n\t\t\t\t\tsetValoresDefault();\n\t\t\t\t}\n\t\t\t});\n\t\t}\n\t\treturn jBValorPadrao;\n\t}", "public CommandValue getCommand() {\n\t\treturn value;\n\t}", "public boolean getBButton() {\n\t\treturn getRawButton(B_BUTTON);\n\t}", "public Button getYes() {\n return yes;\n }", "public Color getButtonColor(){\n\t\treturn buttonColor;\n\t}", "@Override\n public void onDataChange(DataSnapshot dataSnapshot) {\n String value = dataSnapshot.getValue(String.class);\n btnNumber.setText(value);\n // Log.d(TAG, \"Value is: \" + value);\n }", "public IButton getReturnButton() {\n return controls.getReturnButton();\n }", "public MouseButton getButton() {\n return GdkMouseButtonOverride.enumFor(GdkEventButton.getButton(this));\n }", "public Object getUserData(String key) {\n return button.getUserData(key);\n }", "public JCommandToggleButton getSelectedButton() {\n return this.buttonSelectionGroup.getSelected();\n }", "public byte getValue() {\n return value;\n }", "public String getIndicatorValue(WebElement element){\n wait.until(ExpectedConditions.visibilityOf(element));\n return element.getAttribute(\"value\");\n }", "public JButton getComenzar() {\n return comenzar;\n }", "public String getMessageButton() {\n return messageButton;\n }", "public JoystickButton getButtonStart() {\n\t\treturn button[7];\n\t}", "public String getValue() {\n return super.getAttributeValue();\n }", "public boolean getAButton() {\n\t\treturn getRawButton(A_BUTTON);\n\t}", "String getTextValue();", "int getSelectedButton() {\n for (int i = 0; i < buttons.length; i++) {\n if (buttons[i].isSelected()) {\n return (i);\n }\n }\n return (-1);\n }", "public String getValue_txt_Pick_Up_Text(){\r\n\t\treturn txt_Pick_Up_Text.getAttribute(\"value\");\r\n\t}", "String getVal();", "V getValue() {\n return value;\n }", "String getCurrentValue();", "public JButton getP1WinPoint() {\n return p1WinPoint;\n }", "int getEventValue();", "protected JButton getButton(int i)\n {\n //System.out.println(\"Button \" + i + \" retrieved\");\n return ticTacToeButtons[i];\n }", "public Object getOnclick() {\r\n\t\treturn getOnClick();\r\n\t}", "public int getValue(){\n return this.value;\n }", "public JButton getBoutonRetour() {\n\t\treturn this.retour;\n\t}", "@Override\n public void onDataChange(DataSnapshot dataSnapshot) {\n String value = dataSnapshot.getValue(String.class);\n btnAddres.setText(value);\n // Log.d(TAG, \"Value is: \" + value);\n }", "public int getNilaiBtn() {\n return nilaiBtn;\n }", "public double getX() {\n return GdkEventButton.getX(this);\n }", "public ButtonTag GetButtonTag(){\n if(buttonTag != null) {\n return ButtonTag.valueOf(buttonTag);\n }\n else{\n return null;\n }\n }", "protected void buttonPressed(int buttonId) {\r\n if (buttonId == IDialogConstants.OK_ID) {\r\n value = text.getText();\r\n } else {\r\n value = null;\r\n }\r\n super.buttonPressed(buttonId);\r\n }", "public JButton getRightButton1() { return this.right1; }", "public Object getValue(){\n \treturn this.value;\n }", "public String getValue(){\n\t\treturn this.value;\n\t}", "public int getControlValue() {\n\t\treturn d_controlValue;\n\t}", "public V valor() {\n return value;\n }", "public Value getValue(){\n return this.value;\n }", "public final String getBtnColor() {\n\t\treturn btnColor;\n\t}", "public Object getBtnCancel() {\n return btnCancel;\n }", "public boolean get() {\n\t\t\tint i = 0; \n\t\t\twhile(i < buttons.length) {\n\t\t\t\tif (!buttons[i].get()) {\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}", "public V value()\n\t\t{\n\t\t\treturn _value;\n\t\t}", "public String getText() {\n int i = tp.indexOfTabComponent(TabButtonComponent.this);\n if (i != -1) {\n return tp.getTitleAt(i);\n }\n return null;\n }", "public JButton getGoBtn() {\n\t\treturn go;\n\t}", "public static boolean getButton(int index) {\n\t\treturn SmartDashboard.getBoolean(\"DB/Button \" + index, false);\n\t}", "protected V getValue() {\n return this.value;\n }", "public HTMLInputElement getElementBtnGrabar() { return this.$element_BtnGrabar; }" ]
[ "0.7766747", "0.7692338", "0.7657276", "0.7492062", "0.70378983", "0.68987954", "0.68948376", "0.68232125", "0.67027164", "0.66557604", "0.66169006", "0.650922", "0.6386827", "0.6361043", "0.635144", "0.63487434", "0.63410944", "0.6325253", "0.6296426", "0.62941724", "0.6286432", "0.62797046", "0.6247807", "0.6239805", "0.6235398", "0.62223756", "0.6195786", "0.61944884", "0.6175137", "0.6172457", "0.61696905", "0.61640215", "0.61589515", "0.61516404", "0.613131", "0.6112894", "0.61031365", "0.60913026", "0.60657465", "0.6061276", "0.60568565", "0.6055742", "0.60542166", "0.60457474", "0.6031039", "0.6020815", "0.6020771", "0.6007672", "0.5991711", "0.59871393", "0.5980391", "0.59797156", "0.5969282", "0.5953602", "0.5944225", "0.5943035", "0.5937644", "0.59199685", "0.5915316", "0.5913674", "0.59082186", "0.5901949", "0.59011126", "0.58907044", "0.5886979", "0.58772", "0.58752614", "0.58739233", "0.5872918", "0.5866975", "0.58666176", "0.5863813", "0.58599424", "0.5856776", "0.5851214", "0.5850331", "0.58500195", "0.58416104", "0.5830911", "0.5815007", "0.58142745", "0.58087844", "0.5805472", "0.58051956", "0.5803959", "0.57936734", "0.5786774", "0.5782144", "0.57781196", "0.57778263", "0.5771659", "0.5763833", "0.5761878", "0.576036", "0.5756985", "0.57562876", "0.5750809", "0.5749751", "0.574637", "0.5744318", "0.5742839" ]
0.0
-1
Gets whether or not the button is being released
public boolean isReleased(int b) { if (b >= 0 && b < buttonPressed.length) { return !buttonPressed[b] && buttonLastPressed[b]; } else { return false; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public boolean getButtonReleased(Button button) {\n return getButtonReleased(button);\n }", "boolean getButtonRelease(Buttons but);", "public boolean isDown() {\n return pm.pen.hasPressedButtons();\n }", "private boolean releasedInBounds(int button) {\n if (pressedButton == button) {\n return true;\n }\n else {\n return false;\n }\n }", "public boolean isPressed() {\n\t\treturn get();\n\t}", "public static boolean isButtonPressed() {\n return button.isPressed();\n }", "public boolean wasButtonJustPressed(int playerNum) {\r\n if (button.clicked) {\r\n button.clicked = false;\r\n return true;\r\n } else {\r\n return false;\r\n }\r\n }", "public boolean getButtonHeld(Button button) {\n return getButtonHeld(button.getNumber());\n }", "public boolean pressed() {\n return pressed;\n }", "public boolean isButtonPressed(int playerNum) {\r\n return button.pressed;\r\n }", "public boolean isPressed(int b) {\n if (b >= 0 && b < buttonPressed.length) {\n return buttonPressed[b] && !buttonLastPressed[b];\n } else {\n return false;\n }\n }", "protected abstract boolean down(int button);", "protected abstract boolean up(int button);", "public boolean wasJustPressed() {\n\t\treturn (mNow && (!mLast));\n\t}", "@Override\n\tpublic boolean onMouseReleased(MouseButtonEvent event) {\n\t\treturn false;\n\t}", "public boolean isButton() {\n return this.type == Type.BUTTON;\n }", "public void mouseReleased() {\n\t\tthis.isPressed = false;\n\t}", "boolean isShutterPressed();", "public boolean getButtonPressed(Button button) {\n return getButtonPressed(button.getNumber());\n }", "public boolean buttonPressed(Button button) {\n return (!buttonsPressed.get(button.getId()) && joystick.getRawButton(button.getId()));\n }", "public boolean isMouseButtonDown(int keyCode) {\n\t\treturn input.isMouseButtonDown(keyCode);\n\t}", "public boolean isReleased() {\n return released;\n }", "@Override\n\tpublic boolean takeControl() {\n\t\treturn (touch_r.isPressed() || touch_l.isPressed());\n\t}", "public boolean getKeyJustReleased(InputKey key) {\n return justReleasedKeys.contains(key);\n }", "protected boolean dealWithKeyReleased(KeyEvent ke)\n {\n setUpMouseState(KEY_RELEASED);\n return true;\n }", "public boolean isRightDown() {\n return pm.pen.getButtonValue(PButton.Type.RIGHT);\n }", "public final boolean isControlDown() {\n return controlDown;\n }", "public boolean isCancelled()\n\t{\n\t\treturn _buttonHit;\n\t}", "public void checkRelease(){\n\n\t\t//Clear boolean to indicate that the GUIItem is no longer touched\n\t\twhileTouched = false;\n\t\tif (touchObject != null)\n\t\t\tonRelease = true;\n\t}", "public void mouseReleased(MouseEvent e) {\n mDown=false;\n }", "@Override\r\n\t\t\tpublic void keyReleased(KeyEvent e) {\n\t\t\t\tint key = e.getKeyCode();\r\n\t\t\t\tif(key == KeyEvent.VK_UP)\r\n\t\t\t\t\tisPress01 = false;\r\n\r\n\t\t\t\tif(key == KeyEvent.VK_DOWN)\r\n\t\t\t\t\tisPress02 = false;\r\n\r\n\t\t\t\tif(key == KeyEvent.VK_LEFT)\r\n\t\t\t\t\tisPress03 = false;\r\n\r\n\t\t\t\tif(key == KeyEvent.VK_RIGHT)\r\n\t\t\t\t\tisPress04 = false;\r\n\t\t\t}", "public void setButtonReleased(int button) {\n buttonHeldTime = 0;\n pressed = false;\n\n if (releasedInBounds(button) && !buttonHeld) {\n pressedButton(button);\n }\n pressedButton = CalculatorButtons.NONE;\n buttonHeld = false;\n }", "public boolean getClicked(){\n return this.isPressed;\n }", "protected void onRelease(){\n pressed = false;\n if(hovered) {\n onClick();\n }\n for(Runnable action : onRelease) action.run();\n }", "public boolean getBButton() {\n\t\treturn getRawButton(B_Button);\n\t}", "public boolean getBButton() {\n\t\treturn getRawButton(B_BUTTON);\n\t}", "public boolean getYButton() {\n\t\treturn getRawButton(Y_Button);\n\t}", "public boolean getYButton() {\n\t\treturn getRawButton(Y_BUTTON);\n\t}", "public boolean getIsOperator_GearStartSequence_BtnJustPressed()\n\t{\n\t\treturn super.getIsOperatorBlueBtnXJustPressed();\n\t}", "private boolean isActionDown(MotionEvent event){\n\n return event.getAction() == MotionEvent.ACTION_DOWN;\n }", "public boolean onDown(MotionEvent e) { return true; }", "boolean _mouseReleased(MouseEvent ev) {\n\t\treturn false;\n\t}", "@Override\n\tpublic boolean touchDown(float x, float y, int pointer, int button) {\n\t\treturn false;\n\t}", "public boolean isSwitchPressed() {\n\t\treturn !lightSwitch.get();\n\t}", "public void mouseReleased(MouseEvent release) {\r\n\t\tif (SwingUtilities.isLeftMouseButton(release)) {\r\n\t\t\twasReleased = true;\r\n\t\t}\r\n\r\n\t\telse if (SwingUtilities.isRightMouseButton(release)) {\r\n\t\t\trClick = false;\r\n\t\t}\r\n\t}", "public static boolean ctrlIsDown()\n\t{\n\t\treturn ctrlDown;\n\t}", "@Override\n\tpublic void mouseReleased(MouseEvent arg0) {\n\t\tint keycode = arg0.getButton();\n\t\tif (keycode == LEFT_CLICK)\n\t\t{\n\t\t\tleftDown = false;\n\t\t}\n\t\tif (keycode == RIGHT_CLICK)\n\t\t{\n\t\t\trightDown = false;\n\t\t\t\n\t\t}\n\t}", "@SimpleProperty(description = \"Whether the Released event should fire when the touch sensor is\" +\n \" released.\",\n category = PropertyCategory.BEHAVIOR)\n public boolean ReleasedEventEnabled() {\n return releasedEventEnabled;\n }", "private boolean isActionUpOrCancel(MotionEvent event){\n\n //return true if event.getAction is up or cancel\n //meaning the user has removed their finger from screen\n // or if the scrolling has reached end of scroll and android has triggered a cancel\n return event.getAction() == MotionEvent.ACTION_UP\n || event.getAction() == MotionEvent.ACTION_CANCEL;\n }", "@SuppressWarnings(\"unused\")\n\tprivate boolean wasAnyButtonPressed() {\n\t\tfor (ArcadeButton button : buttons) {\n\t\t\tif (button.getPressCounter() > 0) {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\t\treturn false;\n\t}", "public void mouseReleased() {\n super.mouseReleased();\n pressed = false;\n properties.post_mouseReleased(1);\n }", "public boolean isPressed() {\r\n List<Entity> entities = dungeon.getEntities();\r\n for (Entity e: entities) {\r\n if (e != null && e.getY() == getY() && e.getX() == getX()) {\r\n if (\"Boulder\".equals(e.getClass().getSimpleName()))\r\n return true;\r\n }\r\n }\r\n return false;\r\n }", "private boolean isPressed(KeyCode key) {\n\t\treturn keys.getOrDefault(key, false);\n\t}", "private boolean isPressed(KeyCode key) {\n \t\n return keys.getOrDefault(key, false);\n }", "@Override\n\tpublic boolean onDown(MotionEvent arg0) {\n\t\treturn false; // was false\n\t}", "public boolean handleMouseReleased(int mouseX, int mouseY, int state) {\n return false;\n }", "public static boolean ctrlOrCmdIsDown()\n\t{\n\t\treturn ctrl_cmd_Down;\n\t}", "@Override\n\t\t\t\tpublic boolean touchDown(com.badlogic.gdx.scenes.scene2d.InputEvent event, float x, float y, int pointer, int button) {\n\t\t\t\t\treturn true;\n\t\t\t\t}", "public boolean getPilotButton(int button) {\n return pilot.getRawButton(button);\n }", "@Override\n\tpublic boolean takeControl() {\n\t\tir.fetchSample(irSample, 0);\n\t\treturn isPressed() == true;\n\t}", "protected boolean dealWithMouseReleased(IFigure figure,\n int button,\n int x,\n int y,\n int state)\n {\n setUpMouseState(MOUSE_RELEASED);\n\n if (stopDynamic && ((x < 0) || (y < 0))) {\n cancelDynamicOperation();\n return false;\n }\n\n return true;\n }", "public boolean getIsReleased() {\n\t\treturn _isReleased;\n\t}", "boolean _keyReleased(KeyEvent ev) {\n\t\treturn false;\n\t}", "protected boolean dealWithMouseUp(org.eclipse.swt.events.MouseEvent e)\n {\n setUpMouseState(MOUSE_RELEASED);\n return true;\n }", "public boolean getIsOperator_FuelInfeed_BtnPressed()\n\t{\n\t\treturn super.getIsOperatorLeftBumperBtnPressed();\n\t}", "private boolean playerHasPressed(PlayerView p) {\n\t\treturn (!game.getPlayer(p.getId() - 1).getHasLost()\n\t\t\t\t&& keyListeners.get(p.getKeyCode()));\n\t}", "@Override\n\tpublic boolean mouseReleased(Point p) {\n\t\tif (isVisible()) {\n\t\t\tif (buildShipButton.mouseReleased(p)) {return true;}\n\t\t\tif (buildingsButton.mouseReleased(p)) {return true;}\n\t\t\telse {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t} else if (recruitMenu.isVisible()) {\n\t\t\trecruitMenu.mouseReleased(p);\n\t\t} else if (buildingMenu.isVisible()) {\n\t\t\tbuildingMenu.mouseReleased(p);\n\t\t}\n\t\treturn false;\n\t}", "public boolean getButton(Button button) {\n return getButton(button.getNumber());\n }", "public boolean get() {\n\t\t\tint i = 0; \n\t\t\twhile(i < buttons.length) {\n\t\t\t\tif (!buttons[i].get()) {\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}", "protected boolean isFinished() {\n \tif(Robot.oi.btnIdle.get()) {\n \t\treturn CommandUtils.stateChange(this, new Idle());\n \t}\n\n \tif( Robot.oi.btnShoot.get()) {\n \t\treturn CommandUtils.stateChange(this, new Shooting()); \n \t}\n \t\n \tif(Robot.oi.btnUnjam.get()){\n \t\treturn CommandUtils.stateChange(this, new Unjam());\n \t}\n return false;\n }", "public boolean isHolding();", "@Override\n\tpublic boolean onMousePressed(MouseButtonEvent event) {\n\t\treturn false;\n\t}", "public boolean getRightJoystickClick() {\n\t\treturn getRawButton(RIGHT_JOYSTICK_CLICK);\n\t}", "public Boolean isHeld() { return held; }", "public boolean canDismissWithTouchOutside() {\n return this.cameraOpened ^ 1;\n }", "public boolean getIsClick() {return isClick;}", "public boolean isClicked() { return clicked; }", "@Override\r\n\tpublic boolean onDown(MotionEvent e) {\n\t\treturn false;\r\n\t}", "@Override\r\n\tpublic boolean onDown(MotionEvent e) {\n\t\treturn false;\r\n\t}", "public boolean hasButton(String key) {\n return !getGUIButtons(key).isEmpty();\n }", "public boolean getButton(XboxController.Button inputButton) {\n\t\treturn this.getRawButton(inputButton.value);\n\t}", "public boolean takeControl() {\r\n\t\treturn (StandardRobot.ts.isPressed() || (StandardRobot.us.getRange() < 25));\r\n\t}", "@Override\n\tpublic void mouseReleased(MouseEvent e) {\n\t\tmouseDown = false;\n\t}", "@Override\r\n\tpublic int buttonPressed() {\n\t\tif ( state == 0)\r\n\t\t{\r\n\t\t\tSystem.out.println(\"Total Button Pressed\");\r\n\t\t\treturn 0;\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\treturn 1;\r\n\t\t}\r\n\t}", "@Override\n\t\tpublic boolean onDown(MotionEvent e) {\n\t\t\treturn false;\n\t\t}", "public boolean touchDown (InputEvent event, float x, float y, int pointer, int button) {\n\t\t\tmainMusic.toggleSound();\n\t\t\ttoggleMusicImgButton.getImage().setDrawable(toggleMusicImgButton.getStyle().imageChecked);\n\t\t\treturn false;\n\t\t\t\t}", "public static boolean tabIsDown()\n\t{\n\t\treturn tabDown;\n\t}", "@Override\n\tpublic boolean onDown(MotionEvent arg0) {\n\t\treturn false;\n\t}", "@Override\n\tpublic boolean onDown(MotionEvent arg0) {\n\t\treturn false;\n\t}", "@Override\n\tpublic boolean onDown(MotionEvent arg0) {\n\t\treturn false;\n\t}", "@Override\n\tpublic boolean onMouse(MouseEvent buttonEvent) {\n\t\treturn false;\n\t}", "@Override\n\tpublic boolean onDown(MotionEvent e) {\n\t\treturn false;\n\t}", "@Override\n\tpublic boolean onDown(MotionEvent e) {\n\t\treturn false;\n\t}", "@Override\n\tpublic boolean onDown(MotionEvent e) {\n\t\treturn false;\n\t}", "@Override\n\tpublic boolean onDown(MotionEvent e) {\n\t\treturn false;\n\t}", "@Override\n\tpublic boolean onDown(MotionEvent e) {\n\t\treturn false;\n\t}", "@Override\n\tpublic boolean onDown(MotionEvent e) {\n\t\treturn false;\n\t}", "@Override\n\tpublic boolean onDown(MotionEvent e) {\n\t\treturn false;\n\t}", "@Override\n\tpublic boolean onDown(MotionEvent e) {\n\t\treturn false;\n\t}", "@Override\n\tpublic boolean onDown(MotionEvent e) {\n\t\treturn false;\n\t}" ]
[ "0.82986814", "0.82547", "0.7791314", "0.7652561", "0.7522579", "0.7367631", "0.7103001", "0.7081722", "0.705728", "0.7045028", "0.7017005", "0.697376", "0.68347543", "0.68178993", "0.68052983", "0.6737691", "0.6730423", "0.672668", "0.6719503", "0.67126894", "0.6642276", "0.6619332", "0.660729", "0.65545917", "0.6547132", "0.65409565", "0.651602", "0.6513467", "0.6498511", "0.6479311", "0.6478951", "0.6441409", "0.6437334", "0.6426366", "0.6410719", "0.6395191", "0.6391482", "0.6338927", "0.6330994", "0.63131905", "0.62913644", "0.6286908", "0.62824374", "0.62785697", "0.6274881", "0.6251758", "0.6251272", "0.62279814", "0.6201357", "0.61942", "0.61857283", "0.61841357", "0.6181721", "0.61600995", "0.6159748", "0.6158548", "0.61242074", "0.6123782", "0.61191344", "0.6109076", "0.6106854", "0.6099741", "0.6093608", "0.6085111", "0.6063435", "0.60516375", "0.60236096", "0.6001097", "0.59917194", "0.59841084", "0.5980538", "0.5971433", "0.59544903", "0.59484416", "0.59465283", "0.59441364", "0.59390014", "0.59229314", "0.59229314", "0.5917415", "0.5914033", "0.5909111", "0.5906894", "0.59059066", "0.59016275", "0.5896993", "0.5889058", "0.5884605", "0.5884605", "0.5884605", "0.5881561", "0.5876987", "0.5876987", "0.5876987", "0.5876987", "0.5876987", "0.5876987", "0.5876987", "0.5876987", "0.5876987" ]
0.7940708
2
Gets the value of the axis.
public double getAxis(int b) { if (b >= 0 && b < axes.length) { //return axes[b]; return axisInfos[b].getValue(); } else { return 0; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public float getAxisValue(InputAxis axis) {\n Float value = axisValues.get(axis);\n return value != null ? value : 0;\n }", "public AXValue getValue() {\n return value;\n }", "public String getValueAxisLabel() {\n return this.valueAxisLabel;\n }", "public double getValue() {\n\t\treturn value;\n\t}", "public double getValue() {\n\t\treturn value;\n\t}", "public double getValue() {\n\t\treturn value;\n\t}", "public double getAxisValue(int axis) {\n\t\tif (axis < 0)\n\t\t\treturn 0;\n\t\t\n\t\tdouble sign = (axis == 1 || axis == 5) ? -1 : 1;\n\t\tdouble tempAxis = joystick.getRawAxis(axis);\n\t\treturn sign * (Math.abs(tempAxis) > DEAD_BAND ? tempAxis : 0.0);\n\t}", "public double getValue() {\r\n\t\treturn value;\r\n\t}", "public double getValue() {\n\t\treturn this.value; \n\t}", "public double getValue() {\n return value;\n }", "public double getValue() {\n return value;\n }", "public double getValue() {\n return value;\n }", "public double getValue(){\n\t\treturn slider.getValue() ;\n\t}", "public double getValue() {\n\t\treturn this.value;\n\t}", "public double getValue() {\n return value_;\n }", "public float getValue()\n\t{\n\t\treturn this.value;\n\t}", "public double getValue() {\r\n return this.value;\r\n }", "public Object getValueForAxis(AxisModel axis) {\n return null;\n }", "public double getValue()\n {\n return this.value;\n }", "public double getValue() {\n\t\treturn(value);\n\t}", "public double getValue() {\n return this.value;\n }", "public double getValue() {\n return this.value;\n }", "public float getValue() {\n\t\treturn value;\n\t}", "public double getValue() {\n return value_;\n }", "public double getValue()\r\n\t{\r\n\t\treturn (double) value;\r\n\t}", "@Override\n\tpublic double getValue() {\n\t\treturn value;\n\t}", "public Double getValue() {\n return value;\n }", "public Double getValue() {\n return value;\n }", "public Vector3 getValue() {\n\t\treturn this.value;\n\t}", "public final float getValue() {\r\n\t\treturn value;\r\n\t}", "public double getValue() {\n return this._value;\n }", "public String getValue() {\r\n return xValue;\r\n }", "public double getValue(){\n return value;\n }", "public float getValue() {\n return value;\n }", "public double value() {\r\n return value;\r\n }", "public float getValue() {\n return value_;\n }", "public Object getValue()\n {\n Object[] a = (Object[]) getArray().getValue();\n int i = ((Number) getIndex().getValue()).intValue();\n\n return a[i];\n }", "public V getValue() {\r\n\t\treturn value;\r\n\t}", "public double getValue() {\n\t\treturn sensorval;\n\t}", "public V getValue() {\n\t\treturn value;\n\t}", "public V getValue() {\n\t\treturn value;\n\t}", "public float getValue() {\n return value_;\n }", "public Float getValue() {\n\t\treturn value;\n\t}", "public Float getValue() {\n\t\treturn value;\n\t}", "public float getCurrentDimValue() {\n\t\treturn currentDimValue;\n\t}", "public double getValue()\n\t{\n\t\treturn ifD1.getValue();// X100 lux\n\t}", "public V getValue() {\n return value;\n }", "public V getValue() {\n return value;\n }", "public V getValue() {\n return value;\n }", "public V getValue() {\n return value;\n }", "public int getX()\n {\n return xaxis;\n }", "public double getAxis(Axis axis) {\n return joystick.getRawAxis(axis.getId());\n }", "public Number getValue() {\n return (Number) getAttributeInternal(VALUE);\n }", "private double getValue() {\n return value;\n }", "public Object getValue() {\n\t\t\treturn value;\n\t\t}", "public double getValue() {\n\t\treturn m_dValue;\n\t}", "@Override\n public double getValue()\n {\n return value;\n }", "public V getValue() {\n return value;\n }", "public V getValue() {\n return value;\n }", "public double getValue();", "public V getValue()\r\n\t\t{\r\n\t\t\treturn val;\r\n\t\t}", "public Object getValue() {\n\t\treturn value;\n\t}", "public Object getValue() {\n\t\treturn value;\n\t}", "public Double value() {\n return this.value;\n }", "public int getValue()\n {\n return value;\n }", "public int getValue() {\n\t\t\treturn value;\n\t\t}", "public Number getValue() {\n return currentVal;\n }", "V getValue() {\n return value;\n }", "public Object getValue()\r\n {\r\n return this.value;\r\n }", "public int getValue() {\n\t\treturn this.getValue();\n\t}", "public int getValue() {\n return value;\n }", "public int getValue() {\n return value;\n }", "public Object getValue() {\r\n return value;\r\n }", "public int getValue() {\n return this.value;\n }", "public int getValue() {\n return value_;\n }", "public int getValue() \n {\n return value;\n }", "public Object getValue() {\n return value;\n }", "public Object getValue() {\n return value;\n }", "public Object getValue() {\n return value;\n }", "public Object getValue() {\n return value;\n }", "public Object getValue() {\n return value;\n }", "public int getValue() {\r\n return value;\r\n }", "@Override\n\t\tpublic V getValue(){\n\t\t\treturn value;\n\t\t}", "public int getValue() {\n\t\treturn value;\n\t}", "public int getValue() {\n\t\treturn value;\n\t}", "public int getValue() {\n\t\treturn value;\n\t}", "public int getValue() {\n\t\treturn value;\n\t}", "public double getX()\n\t\t{\n\t\t\treturn this.x[0];\n\t\t}", "public int getValue() {\r\n return value;\r\n }", "public V value()\n\t\t{\n\t\t\treturn _value;\n\t\t}", "public int getValue()\n\t{\n\t\treturn value;\n\t}", "public int getValue()\n\t{\n\t\treturn value;\n\t}", "public int getValue()\n\t{\n\t\treturn value;\n\t}", "public Object getValue()\n {\n return value;\n }", "public int getValue () {\n return value;\n }", "public int getValue() {\r\n\t\treturn value;\r\n\t}", "public int getValue() {\r\n\t\treturn value;\r\n\t}", "public int getValue() {\r\n\t\treturn value;\r\n\t}", "public int getValue() {\r\n\t\treturn value;\r\n\t}", "public int getValue() {\r\n\t\treturn value;\r\n\t}", "public int getValue() {\r\n\t\treturn value;\r\n\t}" ]
[ "0.7466031", "0.71450996", "0.70620465", "0.6956378", "0.6956378", "0.6956378", "0.69488233", "0.69165385", "0.68759483", "0.68735135", "0.68735135", "0.68735135", "0.68473965", "0.68408746", "0.68378276", "0.6816907", "0.6815373", "0.6814392", "0.68078995", "0.6805024", "0.6801894", "0.6801894", "0.68016034", "0.67926246", "0.6777527", "0.6756194", "0.6728967", "0.6728967", "0.6723704", "0.6712829", "0.6708501", "0.67006", "0.6695081", "0.6672597", "0.66107357", "0.65970266", "0.6591494", "0.6590835", "0.6589058", "0.65819275", "0.65819275", "0.6578034", "0.6533452", "0.6533452", "0.6524288", "0.6523912", "0.65223306", "0.65223306", "0.65223306", "0.65223306", "0.6503991", "0.6499754", "0.6495983", "0.64791167", "0.64676666", "0.6466263", "0.646384", "0.6452955", "0.6452955", "0.6441622", "0.6431214", "0.641609", "0.641609", "0.64010626", "0.63991183", "0.63959426", "0.63729644", "0.6365489", "0.63508064", "0.6343718", "0.6339448", "0.6339448", "0.632348", "0.6320156", "0.6314374", "0.63115203", "0.6307746", "0.6307746", "0.6307746", "0.6307746", "0.6307746", "0.6306383", "0.63017625", "0.6295575", "0.6295575", "0.6295575", "0.6295575", "0.628982", "0.62870955", "0.6284563", "0.6277919", "0.6277919", "0.6277919", "0.62759227", "0.6273798", "0.62729704", "0.62729704", "0.62729704", "0.62729704", "0.62729704", "0.62729704" ]
0.0
-1
Scenario Outline: Normal Flow
@Given("a todo with the title {string}, done status {string} and description {string}") public void aTodoWithTheTitleDoneStatusAndDescription(String title, String doneStatus, String description){ JSONObject todo = new JSONObject(); todo.put("title", title); boolean status = false; if (doneStatus.equals("true")){ status = true; } todo.put("doneStatus", status); todo.put("description", description); String validID = "/todos"; try { TodoInstance.post(validID,todo.toString()); } catch (IOException e) { error = true; } try { Thread.sleep(200); } catch (InterruptedException e) { error = true; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\n public void scenario(gherkin.formatter.model.Scenario scenario) {\n }", "@Given(\"prepare to Analysis\")\npublic void preanalysis(){\n}", "@Given(\"I come in to the bar\")\r\n public void i_come_in_to_the_bar() {\n System.out.println(\"@Given: Entro al bar\");\r\n //throw new io.cucumber.java.PendingException();\r\n }", "@Test (priority = 4)\n\t@Then(\"^End of Scenario$\")\n\tpublic void end_of_Scenario() throws Throwable {\n\t \n\t}", "@Given(\"prepare to Access & exfiltrate data within the victim's security zone\")\npublic void preaccessexfiltratedatawithinthevictimssecurityzone(){\n}", "@Before\n public void beforeScenario() {\n }", "public static void enterFixtureOutcome()\n\t{\n\t}", "@Test\n void shouldExpandDifferentSeverities() {\n WorkflowJob job = createPipelineWithWorkspaceFilesWithSuffix(\"all-severities.xml\");\n\n job.setDefinition(new CpsFlowDefinition(\"node {\\n\"\n + \" stage ('Integration Test') {\\n\"\n + \" recordIssues tool: checkStyle(pattern: '**/\" + \"all-severities\" + \"*')\\n\"\n + \" def total = tm('${ANALYSIS_ISSUES_COUNT}')\\n\"\n + \" def error = tm('${ANALYSIS_ISSUES_COUNT, type=\\\"TOTAL_ERROR\\\"}')\\n\"\n + \" def high = tm('${ANALYSIS_ISSUES_COUNT, type=\\\"TOTAL_HIGH\\\"}')\\n\"\n + \" def normal = tm('${ANALYSIS_ISSUES_COUNT, type=\\\"TOTAL_NORMAL\\\"}')\\n\"\n + \" def low = tm('${ANALYSIS_ISSUES_COUNT, type=\\\"TOTAL_LOW\\\"}')\\n\"\n + \" echo '[total=' + total + ']' \\n\"\n + \" echo '[error=' + error + ']' \\n\"\n + \" echo '[high=' + high + ']' \\n\"\n + \" echo '[normal=' + normal + ']' \\n\"\n + \" echo '[low=' + low + ']' \\n\"\n + \" }\\n\"\n + \"}\", true));\n\n AnalysisResult baseline = scheduleBuildAndAssertStatus(job, Result.SUCCESS);\n\n assertThat(baseline).hasTotalSize(3);\n\n assertThat(baseline).hasTotalHighPrioritySize(0);\n assertThat(baseline).hasTotalErrorsSize(1);\n assertThat(baseline).hasTotalNormalPrioritySize(1);\n assertThat(baseline).hasTotalLowPrioritySize(1);\n\n assertThat(getConsoleLog(baseline)).contains(\"[total=\" + 3 + \"]\");\n\n assertThat(getConsoleLog(baseline)).contains(\"[error=\" + 1 + \"]\");\n assertThat(getConsoleLog(baseline)).contains(\"[high=\" + 0 + \"]\");\n assertThat(getConsoleLog(baseline)).contains(\"[normal=\" + 1 + \"]\");\n assertThat(getConsoleLog(baseline)).contains(\"[low=\" + 1 + \"]\");\n }", "@Test(priority = 75)\r\n@Epic(\"BILLS PAYMENT\")\r\n@Features(value = { @Feature(value = \"BUY GOODS USING MPESA\") })\r\n@Step (\"END OF BUY GOODS USING MPESA TILL TESTCASES\")\r\n@Severity(SeverityLevel.TRIVIAL)\r\npublic void End_Buy_Goods_Using_MPESA_Test_cases() {\n\tSystem.out.println(\"*************************End of buy Goods Using Mpesa Test cases***********************************\");\r\n\r\n}", "@Then(\"troubleshooting chart steps are displaying\")\n public void troubleshooting_chart_steps_are_displaying() {\n }", "protected void runBeforeStep() {}", "@Override\n\tpublic void step() {\n\t\t\n\t}", "@Override\n\tpublic void step() {\n\t\t\n\t}", "@Override\n\tpublic void step() {\n\t}", "@Override\n\tpublic void step() {\n\t}", "@Test(priority = 66)\r\n@Epic(\"BILLS PAYMENT\")\r\n@Features(value = { @Feature(value = \"BUY GOODS USING MPESA\") })\r\n@Step (\"BUY GOODS USING MPESA\")\r\n@Severity(SeverityLevel.TRIVIAL)\r\npublic void Buy_Goods_Using_MPESA_Test_cases() {\n\tSystem.out.println(\"BUY GOODS AND SERVICES\");\t\r\n\tSystem.out.println(\"*************************(1)Running Buy Goods Using MPESA Testcases***********************************\");\r\n\r\n}", "@Before\n\tpublic void keepScenario(Scenario scenario) {\n\t\tthis.scenario=scenario;\n\t}", "TeststepBlock createTeststepBlock();", "@Given(\"^I am in Given$\")\n public void i_am_in_Given() throws Throwable {\n System.out.println(\"in given\");\n }", "@When(\"Try to Analysis\")\npublic void tryanalysis(){\n}", "public void step();", "public void step();", "@Override\n\tpublic void step2() {\n\t\t\n\t}", "@Override\n public void scenarioOutline(ScenarioOutline scenarioOutline) {\n ScenarioDefinition scenarioDefinitionOut = new ScenarioDefinition();\n scenarioDefinitionOut.setType(ScenarioType.SCENARIO_OUTLINE);\n testedFeature.getScenarioDefinitionList().add(scenarioDefinitionOut);\n\n setTagStatementAttributes(scenarioDefinitionOut, scenarioOutline);\n }", "@Override\n public boolean step() {\n return false;\n }", "@Given(\"^Login to simplilearn$\")\r\n\tpublic void Login_to_simplilearn () throws Throwable\r\n\t{\n\t\t\r\n\t\tSystem.out.println(\" TC002 - Step 1 is passed\");\r\n\t\t\r\n\t}", "@Override\r\n\tpublic int getSteps() {\n\t\treturn 0;\r\n\t}", "@Given(\"^user is into website$\")\n public void userIsIntoWebsite() {\n }", "abstract int steps();", "@Given(\"prepare to Attempt well-known or guessable resource locations\")\npublic void preattemptwellknownorguessableresourcelocations(){\n}", "@Given(\"User is on google home page\")\npublic void user_is_on_google_home_page() {\n System.out.println(\"Given-Homepage\");\n}", "@Then(\"Assert the success of Analysis\")\npublic void assanalysis(){\n}", "public void scenarioChanged();", "@When(\"I find people\")\r\n public void i_find_people() {\n System.out.println(\"@When: Encuentro Gente\");\r\n //throw new io.cucumber.java.PendingException();\r\n }", "@Override\n public void onStepStopping(FlowStep flowStep) {\n }", "protected abstract R runStep();", "@Test\n public void testLogicStep_1()\n throws Exception {\n LogicStep result = new LogicStep();\n assertNotNull(result);\n }", "@Test\n public void testRun_DecisionOtherwise_IN_A1_D_A3_FN() {\n // Final node creation\n final Node fn = NodeFactory.createNode(\"#6\", NodeType.FINAL);\n\n // Action node 3 (id #5) creation and flow to final node\n final String A3_ID = \"#5\";\n final Node an3 = NodeFactory.createNode(A3_ID, NodeType.ACTION);\n final ExecutableActionMock objAn3 = ExecutableActionMock.create(KEY, A3_ID);\n ((ContextExecutable) an3).setObject(objAn3);\n ((ContextExecutable) an3).setMethod(objAn3.getPutIdInContextMethod());\n ((SingleControlFlowNode) an3).setFlow(fn);\n\n // Action node 2 (id #4) creation and flow to final node\n final String A2_ID = \"#4\";\n final Node an2 = NodeFactory.createNode(A2_ID, NodeType.ACTION);\n final ExecutableActionMock objAn2 = ExecutableActionMock.create(KEY, A2_ID);\n ((ContextExecutable) an2).setObject(objAn2);\n ((ContextExecutable) an2).setMethod(objAn2.getPutIdInContextMethod());\n ((SingleControlFlowNode) an2).setFlow(fn);\n\n final String A1_KEY = \"a1_key\";\n final String A1_ID = \"#2\";\n\n // Decision node (id #3) creation\n final Node dNode = NodeFactory.createNode(\"#3\", NodeType.DECISION);\n // Flow control from decision to action node 2 (if KEY == #2 goto A2)\n Map<FlowCondition, Node> flows = new HashMap<>(1);\n final FlowCondition fc2a2 = new FlowCondition(A1_KEY, ConditionType.EQ, \"ANYTHING WRONG\");\n flows.put(fc2a2, an2);\n // Otherwise, goto A3\n ((ConditionalControlFlowNode) dNode).setFlows(flows, an3);\n\n // Action node 1 (id #2) creation. Sets the context to be used by the decision\n final Node an1 = NodeFactory.createNode(A1_ID, NodeType.ACTION);\n final ExecutableActionMock objAn1 = ExecutableActionMock.create(A1_KEY, A1_ID);\n ((ContextExecutable) an1).setObject(objAn1);\n ((ContextExecutable) an1).setMethod(objAn1.getPutIdInContextMethod());\n ((SingleControlFlowNode) an1).setFlow(dNode);\n\n // Initial node (id #1) creation and flow to action node 1\n final Node iNode = NodeFactory.createNode(\"#1\", NodeType.INITIAL);\n ((SingleControlFlowNode) iNode).setFlow(an1);\n\n final Jk4flowWorkflow wf = Jk4flowWorkflow.create(iNode);\n\n ENGINE.run(wf);\n\n Assert.assertEquals(A3_ID, wf.getContext().get(KEY));\n }", "@Before\r\n public void startUp(Scenario scenario) {\r\n\r\n //this is used to add per scenario log to report with unique name\r\n long logging_start = System.nanoTime();\r\n\r\n //initialize Logger class, without this line log for the first scenario will not be attached\r\n Log.info(\"***\");\r\n Log.info(\"***\");\r\n\r\n //add appender to attach log for particular scenario to the report\r\n addAppender(out,scenario.getName()+logging_start);\r\n\r\n //start scenario\r\n String[] tId = scenario.getId().split(\";\");\r\n Log.info(\"*** Feature id: \" + tId[0] + \" ***\");\r\n Log.info(\"***\");\r\n Log.info(\"***\");\r\n Log.info(\"*** Scenario with name: \" + scenario.getName() + \" started! ***\");\r\n Log.info(\"***\");\r\n Log.info(\"***\");\r\n\r\n /* Global resources load */\r\n Log.info(\"Started resources initialisation\");\r\n Log.info(\"<- creating shared context ->\");\r\n ctx.Object = new Context();\r\n ctx.Object.put(\"FeatureId\", String.class, tId[0]);\r\n ctx.Object.put(\"ScenarioId\", String.class, scenario.getName());\r\n\r\n FileCore fileCore = new FileCore(ctx);\r\n ctx.Object.put(\"FileCore\", FileCore.class, fileCore);\r\n\r\n ConfigReader Config = new ConfigReader(ctx);\r\n ctx.Object.put(\"Config\", ConfigReader.class, Config);\r\n\r\n Storage storage = new Storage(ctx);\r\n ctx.Object.put(\"Storage\", Storage.class, storage);\r\n\r\n PropertyReader env = new PropertyReader(ctx);\r\n ctx.Object.put(\"Environment\", PropertyReader.class, env);\r\n\r\n Macro macro = new Macro(ctx);\r\n ctx.Object.put(\"Macro\", Macro.class, macro);\r\n\r\n ExecutorCore executorCore = new ExecutorCore(ctx);\r\n ctx.Object.put(\"ExecutorCore\", ExecutorCore.class, executorCore);\r\n\r\n AssertCore assertCore = new AssertCore(ctx);\r\n ctx.Object.put(\"AssertCore\", AssertCore.class, assertCore);\r\n\r\n PdfCore pdfCore = new PdfCore(ctx);\r\n ctx.Object.put(\"PdfCore\", PdfCore.class, pdfCore);\r\n\r\n SshCore sshCore = new SshCore(ctx);\r\n ctx.Object.put(\"SshCore\", SshCore.class, sshCore);\r\n\r\n WinRMCore winRmCore = new WinRMCore(ctx);\r\n ctx.Object.put(\"WinRMCore\", WinRMCore.class, winRmCore);\r\n\r\n SqlCore sqlCore = new SqlCore(ctx);\r\n ctx.Object.put(\"SqlCore\", SqlCore.class, sqlCore);\r\n\r\n StepCore step = new StepCore(ctx);\r\n ctx.Object.put(\"StepCore\", StepCore.class, step);\r\n\r\n //get resources from ctx object\r\n FileCore FileCore = ctx.Object.get(\"FileCore\", FileCore.class);\r\n Macro Macro = ctx.Object.get(\"Macro\", Macro.class);\r\n StepCore = ctx.Object.get(\"StepCore\", StepCore.class);\r\n Storage = ctx.Object.get(\"Storage\", Storage.class);\r\n\r\n Log.info(\"<- reading default configuration ->\");\r\n String defaultConfigDir = FileCore.getProjectPath() + File.separator + \"libs\" + File.separator + \"libCore\" + File.separator + \"config\";\r\n Log.debug(\"Default configuration directory is \" + defaultConfigDir);\r\n\r\n ArrayList<String> defaultConfigFiles = FileCore.searchForFile(defaultConfigDir,\".config\");\r\n if(defaultConfigFiles.size()!=0) {\r\n for (String globalConfigFile : defaultConfigFiles) {\r\n Config.create(globalConfigFile);\r\n }\r\n }\r\n\r\n Log.info(\"<- reading global configuration ->\");\r\n String globalConfigDir = FileCore.getGlobalConfigPath();\r\n Log.debug(\"Global configuration directory is \" + globalConfigDir);\r\n\r\n ArrayList<String> globalConfigFiles = FileCore.searchForFile(globalConfigDir,\".config\");\r\n if(globalConfigFiles.size()!=0) {\r\n for (String globalConfigFile : globalConfigFiles) {\r\n Config.create(globalConfigFile);\r\n }\r\n }\r\n\r\n //configuring logger for rest operations\r\n ToLoggerPrintStream loggerPrintStream = new ToLoggerPrintStream();\r\n Log.info(\"Finished resources initialisation\");\r\n\r\n /* Local resources load */\r\n Log.info(\"<- Started local config load ->\");\r\n String featureDir = FileCore.getCurrentFeatureDirPath();\r\n\r\n Log.debug(\"Feature dir is \" + featureDir);\r\n if( featureDir != null ){\r\n ctx.Object.put(\"FeatureFileDir\", String.class, featureDir);\r\n\r\n ArrayList<String> localConfigFiles = FileCore.searchForFile(featureDir,\".config\");\r\n if(localConfigFiles.size()!=0) {\r\n for (String localConfigFile : localConfigFiles) {\r\n Config.create(localConfigFile);\r\n }\r\n }else{\r\n Log.warn(\"No local config files found!\");\r\n }\r\n }\r\n\r\n //all global and local configuration loaded.\r\n //show default config\r\n Log.debug(\"Checking default environment configuration\");\r\n HashMap<String, Object> defaultEnvConfig = Storage.get(\"Environment.Default\");\r\n HashMap<String, Object> sshConfig = Storage.get(\"Ssh\");\r\n HashMap<String, Object> winRmConfig = Storage.get(\"WinRM\");\r\n Map<String, Object> finalEnvConfig = Storage.get(\"Environment.Active\");\r\n if ( defaultEnvConfig == null || defaultEnvConfig.size() == 0 ){\r\n Log.error(\"Default configuration Environment.\"\r\n + \" Default not found or empty. Please create it!\");\r\n }\r\n if ( finalEnvConfig == null ) {\r\n Log.error(\"Environment.Active object does not exists or null.\"\r\n + \" Please create such entry in global configuration\");\r\n }\r\n if ( sshConfig == null ) {\r\n Log.error(\"Ssh object does not exists or null. Please create it!\");\r\n }\r\n if ( winRmConfig == null ) {\r\n Log.error(\"WinRM object does not exists or null. Please create it!\");\r\n }\r\n //merge ssh with default\r\n defaultEnvConfig.put(\"Ssh\", sshConfig);\r\n //merge winRM with default\r\n defaultEnvConfig.put(\"WinRM\", winRmConfig);\r\n //check if cmd argument active_env was provided to overwrite active_env\r\n String cmd_arg = System.getProperty(\"active_env\");\r\n if ( cmd_arg != null ) {\r\n Log.info(\"Property Environment.Active.name overwritten by CMD arg -Dactive_env=\" + cmd_arg);\r\n Storage.set(\"Environment.Active.name\", cmd_arg);\r\n }\r\n //read name of the environment that shall be activated\r\n Log.debug(\"Checking active environment configuration\");\r\n String actEnvName = Storage.get(\"Environment.Active.name\");\r\n if ( actEnvName == null || actEnvName.equals(\"\") || actEnvName.equalsIgnoreCase(\"default\") ) {\r\n Log.debug(\"Environment.Active.name not set! Fallback to Environment.Default\");\r\n } else {\r\n //check if config with such name exists else fallback to default\r\n HashMap<String, Object> activeEnvConfig = Storage.get(\"Environment.\" + actEnvName);\r\n if ( activeEnvConfig == null || activeEnvConfig.size() == 0 ){\r\n Log.error(\"Environment config with name \" + actEnvName + \" not found or empty\");\r\n }\r\n //merge default and active\r\n deepMerge(defaultEnvConfig, activeEnvConfig);\r\n defaultEnvConfig = Storage.get(\"Environment.Default\");\r\n }\r\n //create final\r\n deepMerge(finalEnvConfig, defaultEnvConfig);\r\n\r\n //check if cmd argument widthXheight was provided to overwrite active_env\r\n String cmd_arg2 = System.getProperty(\"widthXheight\");\r\n if ( cmd_arg2 != null ) {\r\n Log.info(\"Property Environment.Active.Web.size overwritten by CMD arg -widthXheight=\" + cmd_arg2);\r\n Storage.set(\"Environment.Active.Web.size\", cmd_arg2);\r\n }\r\n\r\n Log.info(\"-- Following configuration Environment.Active is going to be used --\");\r\n for (HashMap.Entry<String, Object> entry : finalEnvConfig.entrySet()) {\r\n String[] tmp = entry.getValue().getClass().getName().split(Pattern.quote(\".\")); // Split on period.\r\n String type = tmp[2];\r\n Log.info( \"(\" + type + \")\" + entry.getKey() + \" = \" + entry.getValue() );\r\n }\r\n Log.info(\"-- end --\");\r\n\r\n //adjust default RestAssured config\r\n Log.debug(\"adjusting RestAssured config\");\r\n int maxConnections = Storage.get(\"Environment.Active.Rest.http_maxConnections\");\r\n Log.debug(\"Setting http.maxConnections to \" + maxConnections);\r\n System.setProperty(\"http.maxConnections\", \"\" + maxConnections);\r\n\r\n Boolean closeIdleConnectionsAfterEachResponseAfter = Storage.get(\"Environment.Active.Rest.closeIdleConnectionsAfterEachResponseAfter\");\r\n if ( closeIdleConnectionsAfterEachResponseAfter ) {\r\n int idleTime = Storage.get(\"Environment.Active.Rest.closeIdleConnectionsAfterEachResponseAfter_idleTime\");\r\n Log.debug(\"Setting closeIdleConnectionsAfterEachResponseAfter=true with idleTime \" + idleTime);\r\n RestAssured.config = RestAssured.config().connectionConfig(\r\n connectionConfig().closeIdleConnectionsAfterEachResponseAfter(\r\n idleTime,\r\n TimeUnit.SECONDS)\r\n );\r\n }\r\n\r\n Boolean reuseHttpClientInstance = Storage.get(\"Environment.Active.Rest.reuseHttpClientInstance\");\r\n if ( reuseHttpClientInstance ) {\r\n Log.debug(\"Setting reuseHttpClientInstance=true\");\r\n RestAssured.config = RestAssured.config().httpClient(\r\n httpClientConfig().reuseHttpClientInstance()\r\n );\r\n }\r\n\r\n Boolean relaxedHTTPSValidation = Storage.get(\"Environment.Active.Rest.relaxedHTTPSValidation\");\r\n if ( relaxedHTTPSValidation ) {\r\n Log.debug(\"Setting relaxedHTTPSValidation=true\");\r\n RestAssured.config = RestAssured.config().sslConfig(\r\n sslConfig().relaxedHTTPSValidation()\r\n );\r\n }\r\n\r\n Boolean followRedirects = Storage.get(\"Environment.Active.Rest.followRedirects\");\r\n if ( followRedirects != null ) {\r\n Log.debug(\"Setting followRedirects=\" + followRedirects);\r\n RestAssured.config = RestAssured.config().redirect(\r\n redirectConfig().followRedirects(followRedirects)\r\n );\r\n }\r\n\r\n RestAssured.config = RestAssured.config().decoderConfig(\r\n DecoderConfig.decoderConfig().defaultContentCharset(\"UTF-8\"));\r\n\r\n RestAssured.config = RestAssured.config().logConfig(\r\n new LogConfig( loggerPrintStream.getPrintStream(), true )\r\n );\r\n\r\n //check if macro evaluation shall be done in hooks\r\n Boolean doMacroEval = Storage.get(\"Environment.Active.MacroEval\");\r\n if ( doMacroEval == null ){\r\n Log.error(\"Environment.Active.MacroEval null or empty!\");\r\n }\r\n if( doMacroEval ){\r\n Log.info(\"Evaluating macros in TestData and Expected objects\");\r\n Macro.eval(\"TestData\");\r\n Macro.eval(\"Expected\");\r\n }\r\n\r\n Log.info(\"Test data storage is\");\r\n Storage.print(\"TestData\");\r\n\r\n Log.info(\"<- Finished local config load ->\");\r\n Log.info(\"***\");\r\n Log.info(\"*** Running steps for scenario: \" + scenario.getName());\r\n Log.info(\"***\");\r\n\r\n }", "@TestProperties(name=\"test scenario run mode stability\")\n\tpublic void testAddTestToScenarioEndInRunmode4() throws Exception{\n\t\tjsystem.setJSystemProperty(FrameworkOptions.RUN_MODE, RunMode.DROP_EVERY_SCENARIO.toString());\n\t\tjsystem.launch();\n\t\t//create a folder under default Scenarios folder named \"addTestToSubScenarioBug\" and inside it create\n\t\t//a scenario called child and one calld master\n\t\tScenarioUtils.createAndCleanScenario(jsystem,\"addTestToSubScenarioBug\"+File.separator+\"child\");\n\t\tScenarioUtils.createAndCleanScenario(jsystem,\"addTestToSubScenarioBug\"+File.separator+\"master\");\n\t\t\n\t\t//after adding the master to tree, add the child scenario\n\t\tjsystem.addTest(\"child\",\"addTestToSubScenarioBug\", true);\n\t\t\n\t\tjsystem.addTest(1,\"testShouldPass\", \"GenericBasic\", true);\n\t\tjsystem.addTest(2,\"testShouldPass\", \"GenericBasic\", true);\n\t\tjsystem.addTest(3,\"testShouldPass\", \"GenericBasic\", true);\n\t\tjsystem.play();\n\t\tjsystem.waitForRunEnd();\n\t\tjsystem.checkNumberOfTestsPass(3);\n\t\tjsystem.checkNumberOfTestExecuted(3);\n\t\tjsystem.addTest(\"testShouldPass\", \"GenericBasic\", true);\n\t\tjsystem.addTest(\"testShouldPass\", \"GenericBasic\", true);\n\t\tjsystem.initReporters();\n\t\tjsystem.play();\n\t\tjsystem.waitForRunEnd();\n\t\t//check that run mode doesn't interfere with correct program run\n\t\t//still all test will pass even though it's a run mode to change jvm\n\t\t//on each scenario\n\t\tjsystem.checkNumberOfTestsPass(5);\n\t\tjsystem.checkNumberOfTestExecuted(5);\n\n\t}", "public HooksScenario(SharedContext ctx) {\r\n this.ctx = ctx;\r\n }", "@Override\r\n\tpublic void step(SimState state) {\r\n\r\n\t}", "@Given(\"^User should be navigated to the ELEARNING UPSKILL URL$\")\npublic void user_should_be_navigated_to_the_ELEARNING_UPSKILL_URL() throws Throwable \n{\n\tdriver.manage().window().maximize();\n driver.manage().timeouts().implicitlyWait(30, TimeUnit.SECONDS);\n\tdriver.get(\"http://elearningm1.upskills.in/\");\n\tThread.sleep(100); \n\tSystem.out.println(\"User is successfully navigated to ELEARNING UPSKILL screen\");\n\t\n \n}", "@Then(\"I greet then\")\r\n public void i_greet_then() {\n System.out.println(\"@Then: Los saludo\");\r\n //throw new io.cucumber.java.PendingException();\r\n }", "public int step() {\n // PUT YOUR CODE HERE\n }", "public void step()\n {\n status = stepInternal();\n }", "public abstract void performStep();", "@Test\n public void testElementsTrackedIndividuallyForAStep() throws IOException {\n NameContext stepA = createStep(\"A\");\n NameContext stepB = createStep(\"B\");\n\n tracker.enter(stepA);\n tracker.enter(stepB);\n tracker.exit();\n tracker.enter(stepB);\n tracker.exit();\n tracker.exit();\n // Expected journal: IDLE A1 B1 A1 B2 A1 IDLE\n\n tracker.takeSample(70);\n assertThat(getCounterValue(stepA), equalTo(distribution(30)));\n assertThat(getCounterValue(stepB), equalTo(distribution(10, 10)));\n }", "@SuppressWarnings(\"unchecked\")\n @Test\n public void shouldPrependBeforeScenarioAndAppendAfterScenarioAnnotatedSteps() {\n CandidateSteps steps1 = mock(Steps.class);\n CandidateSteps steps2 = mock(Steps.class);\n Step stepBefore1 = mock(Step.class);\n Step stepBefore2 = mock(Step.class);\n Step stepAfter1 = mock(Step.class);\n Step stepAfter2 = mock(Step.class);\n\n when(steps1.runBeforeScenario()).thenReturn(asList(stepBefore1));\n when(steps2.runBeforeScenario()).thenReturn(asList(stepBefore2));\n when(steps1.runAfterScenario()).thenReturn(asList(stepAfter1));\n when(steps2.runAfterScenario()).thenReturn(asList(stepAfter2));\n\n // And which have a 'normal' step that matches our core\n CandidateStep candidate = mock(CandidateStep.class);\n Step normalStep = mock(Step.class);\n\n when(candidate.matches(\"my step\")).thenReturn(true);\n when(candidate.createFrom(tableRow, \"my step\")).thenReturn(normalStep);\n when(steps1.getSteps()).thenReturn(new CandidateStep[] { candidate });\n when(steps2.getSteps()).thenReturn(new CandidateStep[] {});\n\n // When we create the series of steps for the core\n MarkUnmatchedStepsAsPending stepCreator = new MarkUnmatchedStepsAsPending();\n List<Step> executableSteps = stepCreator.createStepsFrom(asList(steps1, steps2), new Scenario(asList(\"my step\")), tableRow\n );\n\n // Then all before and after steps should be added\n ensureThat(executableSteps, equalTo(asList(stepBefore2, stepBefore1, normalStep, stepAfter1, stepAfter2)));\n }", "private void runOneStepInScenario(HttpServletRequest request, HttpServletResponse response) throws InterruptedException, QueryExecutionException, IOException {\n String ifNextTick = SimApi.ifNextTick();\n if (!\"false\".equals(ifNextTick)) {\n SimApi.nextTick();\n response.getWriter().write(ifNextTick);\n } else {\n response.getWriter().write(\"false\");\n }\n }", "@Test(enabled = false)\n\tpublic void HardAssert(){\n\t\t\t\t\n\t\tSystem.out.println(\"Hard Asset Step 1\");\n\t\tAssert.assertEquals(false, false);\n\t\tSystem.out.println(\"Hard Asset Step 2\");\n\t\tAssert.assertEquals(false, true);\n\t\tSystem.out.println(\"Hard Asset Step 3\");\n\t}", "@Then(\"Assert the success of Access & exfiltrate data within the victim's security zone\")\npublic void assaccessexfiltratedatawithinthevictimssecurityzone(){\n}", "public void before(Scenario scenario) {\n\n logger.trace(\"Initializing Test-Framework for : \" + scenario.getName());\n\n if (scenario.getSourceTagNames().contains(\"@disabled-\" + ParameterMap.getParamBrowserType())) {\n throw new AssumptionViolatedException(String.format(\"The feature %s is disabled on browser \"\n + \"type : %s\", scenario.getName(), ParameterMap.getParamBrowserType()));\n }\n if (scenario.getSourceTagNames().contains(\"@disabled\")) {\n throw new AssumptionViolatedException(\n String.format(\"The feature %s is disabled %s\", scenario.getName(),\n ParameterMap.getParamBrowserType()));\n }\n\n TestDataCore.addToConfigStore(\"scenario\", scenario);\n TestDataCore.addToConfigStore(\"profile\", new QAUserProfile(scenario.getName()));\n\n if (ParameterMap.getParamAPIClearHeadersBeforeScenario()) {\n TestDataCore.removeFromDataStore(\"headers\");\n }\n }", "private void presentShowcaseSequence() {\n }", "boolean nextStep();", "protected TeststepRunner() {}", "public static boolean Scenario(PsiBuilder b, int l) {\n if (!recursion_guard_(b, l, \"Scenario\")) return false;\n boolean r, p;\n Marker m = enter_section_(b, l, _NONE_, \"<scenario>\");\n r = Scenario_0(b, l + 1);\n r = r && consumeToken(b, JB_TOKEN_SCENARIO);\n p = r; // pin = 2\n r = r && report_error_(b, WhiteSpace(b, l + 1));\n r = p && report_error_(b, Scenario_3(b, l + 1)) && r;\n r = p && report_error_(b, WhiteSpace(b, l + 1)) && r;\n r = p && report_error_(b, Scenario_5(b, l + 1)) && r;\n r = p && report_error_(b, WhiteSpace(b, l + 1)) && r;\n r = p && report_error_(b, Scenario_7(b, l + 1)) && r;\n r = p && report_error_(b, WhiteSpace(b, l + 1)) && r;\n r = p && report_error_(b, Scenario_9(b, l + 1)) && r;\n r = p && report_error_(b, WhiteSpace(b, l + 1)) && r;\n r = p && report_error_(b, Scenario_11(b, l + 1)) && r;\n r = p && Scenario_12(b, l + 1) && r;\n exit_section_(b, l, m, JB_SCENARIO, r, p, RecoverMeta_parser_);\n return r || p;\n }", "void writeScenario(ScenarioModel model) throws ModelSerializationException, ModelConversionException;", "public void LossEstimates(){\r\n\t\r\n\r\n\t\tclass Local {};\r\n\t\tReporter.log(\"TestStepComponent\"+Local.class.getEnclosingMethod().getName());\r\n\t\tReporter.log(\"TestStepInput:-\"+\"NA\");\r\n\t\tReporter.log(\"TestStepOutput:-\"+\"NA\");\r\n\t\tReporter.log(\"TestStepExpectedResult:- My Account should be clicked and user should get logged in\");\r\n\t\ttry{\r\n\t\t\t\r\n\t\t\t\r\n\t\t\t/*driver.switchTo().defaultContent();\r\n\t\t\t\t\tsleep(3000);\r\n\t\t\t System.out.println(\"switched frame\"+ switchframe(\"PegaGadget2Ifr\"));\r\n\t\t\t click(locator_split(\"tabLocationAssesment\"));\r\n\t\t\t click(locator_split(\"linkclickLocation\"));*/\r\n\t\t\t // driver.findElement(By.xpath(\"//*[@tabindex='4']/a/span\")).click();\r\n\t\t\t // driver.findElement(By.xpath(\"//a[@title='Click here to open Location Assessment']\")).click();\r\n\t\t\tsleep(5000);\r\n\t\t\tif(getValue(\"Account\").equals(\"EEA\")){\r\n\t\t\t driver.switchTo().defaultContent();\r\n\t\t\t System.out.println(\"switched frame\"+ switchframe(\"PegaGadget3Ifr\"));\r\n\t\t\t click(locator_split(\"tablossestimates\"));\r\n\t\t\t sleep(2000);\r\n\t\t\t click(locator_split(\"tabeml\"));\r\n\t\t\t sleep(5000);\r\n\t\t\t click(locator_split(\"linkexpandpdlossestimates\"));\r\n\t\t\t sleep(3000);\r\n\t\t\t if (getValue(\"Radiobutton\").contains(\"Value\")){\r\n\t\t\t \tClickRadiobutton(locator_split(\"radiovalue\"));\r\n\t\t\t \t\r\n\t\t\t \tsleep(1000);\r\n\t\t\t \tclearWebEdit(locator_split(\"txtbuildingdamage\"));\r\n\t\t\t \tsleep(3000);\r\n\t\t\t \tclearWebEdit(locator_split(\"txtbuildingdamage\"));\r\n\t\t\t \tsleep(2000);\r\n\t\t\t \tsendKeys(locator_split(\"txtbuildingdamage\"), getValue(\"BuildingDamage\"));\r\n\t\t\t \tsleep(1000);\r\n\t\t\t \tclearWebEdit(locator_split(\"txtmeDamage\"));\r\n\t\t\t \tsleep(2000);\r\n\t\t\t \tsendKeys(locator_split(\"txtmeDamage\"), getValue(\"MEDamage\"));\r\n\t\t\t \tsleep(1000);\r\n\t\t\t \tclearWebEdit(locator_split(\"txtcontentdamage\"));\r\n\t\t\t \tsleep(2000);\r\n\t\t\t \tsendKeys(locator_split(\"txtcontentdamage\"), getValue(\"ContentDamage\"));\r\n\t\t\t \tsleep(1000);\r\n\t\t\t \tclearWebEdit(locator_split(\"txtstockdamage\"));\r\n\t\t\t \tsleep(2000);\r\n\t\t\t \tsendKeys(locator_split(\"txtstockdamage\"), getValue(\"StockDamage\"));\r\n\t\t\t \tsleep(1000);\r\n\t\t\t \tclearWebEdit(locator_split(\"txtotherpddamage\"));\r\n\t\t\t \tsleep(2000);\r\n\t\t\t \tsendKeys(locator_split(\"txtotherpddamage\"), getValue(\"OtherPDDamage\"));\r\n\t\t\t \tsleep(1000);\r\n\t\t\t \t\r\n\t\t\t }else{\r\n\t\t\t \tClickRadiobutton(locator_split(\"radiopercentage\"));\r\n\t\t\t \tclearWebEdit(locator_split(\"txtbuildingdamagepc\"));\r\n\t\t\t \tsleep(2000);\r\n\t\t\t \tsendKeys(locator_split(\"txtbuildingdamagepc\"), getValue(\"BuildingDamagePC\"));\r\n\t\t\t \tsleep(1000);\r\n\t\t\t \tclearWebEdit(locator_split(\"txtmedamagepc\"));\r\n\t\t\t \tsleep(2000);\r\n\t\t\t \tsendKeys(locator_split(\"txtmedamagepc\"), getValue(\"MEDamagePC\"));\r\n\t\t\t \tsleep(1000);\r\n\t\t\t \tclearWebEdit(locator_split(\"txtcontentdamagepc\"));\r\n\t\t\t \tsleep(2000);\r\n\t\t\t \tsendKeys(locator_split(\"txtcontentdamagepc\"), getValue(\"ContentDamagePC\"));\r\n\t\t\t \tsleep(1000);\r\n\t\t\t \tclearWebEdit(locator_split(\"txtstockdamagepc\"));\r\n\t\t\t \tsleep(2000);\r\n\t\t\t \tsendKeys(locator_split(\"txtstockdamagepc\"), getValue(\"StockDamagePC\"));\r\n\t\t\t \tsleep(1000);\r\n\t\t\t \tclearWebEdit(locator_split(\"txtotherpddmagepc\"));\r\n\t\t\t \tsleep(2000);\r\n\t\t\t \tsendKeys(locator_split(\"txtotherpddmagepc\"), getValue(\"OtherPDDamagePC\"));\r\n\t\t\t \tsleep(1000);\r\n\t\t\t \t\r\n\t\t\t }\r\n\t\t\t \r\n\t\t\t click(locator_split(\"linkexpandbilossestimates\"));\r\n\t\t\t sleep(3000);\r\n\t\t\t // click(locator_split(\"linkaddroweml\"));\r\n\t\t\t // sleep(3000);\r\n\t\t\t // click(locator_split(\"linkaddroweml\"));\r\n\t\t\t// sleep(3000);\r\n\t\t\t \r\n\t\t\t selectListValue(locator_split(\"listbidowntime\"), getValue(\"BIDownTime\"));\r\n\t\t\t sleep(2000);\r\n\t\t\t clearWebEdit(locator_split(\"txtbiaffected\"));\r\n\t\t\t sleep(2000);\r\n\t\t\t sendKeys(locator_split(\"txtbiaffected\"), getValue(\"BIAffected\"));\r\n\t\t\t sleep(2000);\r\n\t\t\t clearWebEdit(locator_split(\"txtbidowntime\"));\r\n\t\t\t sleep(2000);\r\n\t\t\t sendKeys(locator_split(\"txtbidowntime\"), getValue(\"BIDownTimeValue\"));\r\n\t\t\t sleep(2000);\r\n\t\t\t //if (driver.findElement(By.xpath(\".//*[@id='LECompletedFlag']\")).isSelected()== true ){\r\n\t\t\t \t\r\n\t\t\t //}\r\n\t\t\t // click(locator_split(\"checklecompleted\"));\r\n\t\t\t// driver.findElement(By.xpath(\".//*[@id='LECompletedFlag']\")).click();\r\n\t\t\t driver.findElement(By.xpath(\"//input[@id='LECompletedFlag']\")).click();\r\n\t\t\t //sendkeys(driver.findElement(By.xpath(\"//input[@name='USER']\")),\"jkdkd\");\r\n\t\t\t sleep(2000);\r\n\t\t\t \r\n/////////////////////////////PML flag\r\n\t\t\t click(locator_split(\"tabpml\"));\r\n\t\t\t sleep(5000);\r\n\t\t\r\n\t\t\t // click(locator_split(\"linkexpandpdlossestimates\"));\r\n\t\t\t sleep(3000);\r\n\t\t\t if (getValue(\"Radiobutton\").contains(\"Value\")){\r\n\t\t\t \tSystem.out.println(\"inside if loop\");\r\n\t\t\t \tClickRadiobutton(locator_split(\"radiovalue\"));\r\n\t\t\t \tsleep(1000);\r\n\t\t\t \tclearWebEdit(locator_split(\"txtbuildingdamage\"));\r\n\t\t\t \tsleep(2000);\r\n\t\t\t \tSystem.out.println(\"inside pml tab\");\r\n\t\t\t \tclearWebEdit(locator_split(\"txtbuildingdamage\"));\r\n\t\t\t \tsleep(2000);\r\n\t\t\t \tsendKeys(locator_split(\"txtbuildingdamage\"), getValue(\"BuildingDamage1\"));\r\n\t\t\t \tsleep(1000);\r\n\t\t\t \tclearWebEdit(locator_split(\"txtmeDamage\"));\r\n\t\t\t \tsleep(2000);\r\n\t\t\t \tsendKeys(locator_split(\"txtmeDamage\"), getValue(\"MEDamage1\"));\r\n\t\t\t \tsleep(1000);\r\n\t\t\t \tclearWebEdit(locator_split(\"txtcontentdamage\"));\r\n\t\t\t \tsleep(2000);\r\n\t\t\t \tsendKeys(locator_split(\"txtcontentdamage\"), getValue(\"ContentDamage1\"));\r\n\t\t\t \tsleep(1000);\r\n\t\t\t \tclearWebEdit(locator_split(\"txtstockdamage\"));\r\n\t\t\t \tsleep(2000);\r\n\t\t\t \tsendKeys(locator_split(\"txtstockdamage\"), getValue(\"StockDamage1\"));\r\n\t\t\t \tsleep(1000);\r\n\t\t\t \tclearWebEdit(locator_split(\"txtotherpddamage\"));\r\n\t\t\t \tsleep(2000);\r\n\t\t\t \tsendKeys(locator_split(\"txtotherpddamage\"), getValue(\"OtherPDDamage1\"));\r\n\t\t\t \tsleep(1000);\r\n\t\t\t \t\r\n\t\t\t }else{\r\n\t\t\t \tClickRadiobutton(locator_split(\"radiopercentage\"));\r\n\t\t\t \t\r\n\t\t\t \tclearWebEdit(locator_split(\"txtbuildingdamagepc\"));\r\n\t\t\t \tsleep(2000);\r\n\t\t\t \t\r\n\t\t\t \tclearWebEdit(locator_split(\"txtbuildingdamagepc\"));\r\n\t\t\t \tsleep(2000);\r\n\t\t\t \tsendKeys(locator_split(\"txtbuildingdamagepc\"), getValue(\"BuildingDamagePC1\"));\r\n\t\t\t \tsleep(1000);\r\n\t\t\t \tclearWebEdit(locator_split(\"txtmedamagepc\"));\r\n\t\t\t \tsleep(2000);\r\n\t\t\t \tsendKeys(locator_split(\"txtmedamagepc\"), getValue(\"MEDamagePC1\"));\r\n\t\t\t \tsleep(1000);\r\n\t\t\t \tclearWebEdit(locator_split(\"txtcontentdamagepc\"));\r\n\t\t\t \tsleep(2000);\r\n\t\t\t \tsendKeys(locator_split(\"txtcontentdamagepc\"), getValue(\"ContentDamagePC1\"));\r\n\t\t\t \tsleep(1000);\r\n\t\t\t \tclearWebEdit(locator_split(\"txtstockdamagepc\"));\r\n\t\t\t \tsleep(2000);\r\n\t\t\t \tsendKeys(locator_split(\"txtstockdamagepc\"), getValue(\"StockDamagePC1\"));\r\n\t\t\t \tsleep(1000);\r\n\t\t\t \tclearWebEdit(locator_split(\"txtotherpddmagepc\"));\r\n\t\t\t \tsleep(2000);\r\n\t\t\t \tsendKeys(locator_split(\"txtotherpddmagepc\"), getValue(\"OtherPDDamagePC1\"));\r\n\t\t\t \tsleep(1000);\r\n\t\t\t \t\r\n\t\t\t }\r\n\t\t\t \r\n\t\t\t // click(locator_split(\"linkexpandbilossestimates\"));\r\n\t\t\t sleep(3000);\r\n\t\t\t selectListValue(locator_split(\"listbidowntime\"), getValue(\"BIDownTime1\"));\r\n\t\t\t sleep(2000);\r\n\t\t\t clearWebEdit(locator_split(\"txtbiaffected\"));\r\n\t\t\t sleep(2000);\r\n\t\t\t sendKeys(locator_split(\"txtbiaffected\"), getValue(\"BIAffected1\"));\r\n\t\t\t sleep(2000);\r\n\t\t\t clearWebEdit(locator_split(\"txtbidowntime\"));\r\n\t\t\t sleep(2000);\r\n\t\t\t sendKeys(locator_split(\"txtbidowntime\"), getValue(\"BIDownTimeValue1\"));\r\n\t\t\t sleep(2000);\r\n\t\t\t //if (driver.findElement(By.xpath(\".//*[@id='LECompletedFlag']\")).isSelected()== true ){\r\n\t\t\t \t\r\n\t\t\t //}\r\n\t\t\t // driver.findElement(By.xpath(\".//*[@id='LECompletedFlag']\")).click();\r\n\t\t\t driver.findElement(By.xpath(\"//input[@id='LECompletedFlag']\")).click();\r\n\t\t\t sleep(2000);\r\n\t\t\t //////////////////////////////////////////////\r\n\t\t\t \r\n\t\t\t \r\n\t\t //////////NLE///////////////////////////\r\n\t\t\t click(locator_split(\"tabnle\"));\r\n\t\t\t sleep(5000);\r\n\t\t\r\n\t\t\t // click(locator_split(\"linkexpandpdlossestimates\"));\r\n\t\t\t sleep(3000);\r\n\t\t\t if (getValue(\"Radiobutton\").contains(\"Value\")){\r\n\t\t\t \t\r\n\t\t\t \tClickRadiobutton(locator_split(\"radiovalue\"));\r\n\t\t\t \tsleep(1000);\r\n\t\t\t \tclearWebEdit(locator_split(\"txtbuildingdamage\"));\r\n\t\t\t \tsleep(2000);\r\n\t\t\t \tclearWebEdit(locator_split(\"txtbuildingdamage\"));\r\n\t\t\t \tsleep(2000);\r\n\t\t\t \tsendKeys(locator_split(\"txtbuildingdamage\"), getValue(\"BuildingDamage2\"));\r\n\t\t\t \tsleep(1000);\r\n\t\t\t \tclearWebEdit(locator_split(\"txtmeDamage\"));\r\n\t\t\t \tsleep(2000);\r\n\t\t\t \tsendKeys(locator_split(\"txtmeDamage\"), getValue(\"MEDamage2\"));\r\n\t\t\t \tsleep(1000);\r\n\t\t\t \tclearWebEdit(locator_split(\"txtcontentdamage\"));\r\n\t\t\t \tsleep(2000);\r\n\t\t\t \tsendKeys(locator_split(\"txtcontentdamage\"), getValue(\"ContentDamage2\"));\r\n\t\t\t \tsleep(1000);\r\n\t\t\t \tclearWebEdit(locator_split(\"txtstockdamage\"));\r\n\t\t\t \tsleep(2000);\r\n\t\t\t \tsendKeys(locator_split(\"txtstockdamage\"), getValue(\"StockDamage2\"));\r\n\t\t\t \tsleep(1000);\r\n\t\t\t \tclearWebEdit(locator_split(\"txtotherpddamage\"));\r\n\t\t\t \tsleep(2000);\r\n\t\t\t \tsendKeys(locator_split(\"txtotherpddamage\"), getValue(\"OtherPDDamage2\"));\r\n\t\t\t \tsleep(1000);\r\n\t\t\t \t\r\n\t\t\t }else{\r\n\t\t\t \tClickRadiobutton(locator_split(\"radiopercentage1\"));\r\n\t\t\t \t\r\n\t\t\t \tclearWebEdit(locator_split(\"txtbuildingdamagepc\"));\r\n\t\t\t \tsleep(2000);\r\n\t\t\t \tsendKeys(locator_split(\"txtbuildingdamagepc\"), getValue(\"BuildingDamagePC2\"));\r\n\t\t\t \tsleep(1000);\r\n\t\t\t \tclearWebEdit(locator_split(\"txtmedamagepc\"));\r\n\t\t\t \tsleep(2000);\r\n\t\t\t \tsendKeys(locator_split(\"txtmedamagepc\"), getValue(\"MEDamagePC2\"));\r\n\t\t\t \tsleep(1000);\r\n\t\t\t \tclearWebEdit(locator_split(\"txtcontentdamagepc\"));\r\n\t\t\t \tsleep(2000);\r\n\t\t\t \tsendKeys(locator_split(\"txtcontentdamagepc\"), getValue(\"ContentDamagePC2\"));\r\n\t\t\t \tsleep(1000);\r\n\t\t\t \tclearWebEdit(locator_split(\"txtstockdamagepc\"));\r\n\t\t\t \tsleep(2000);\r\n\t\t\t \tsendKeys(locator_split(\"txtstockdamagepc\"), getValue(\"StockDamagePC2\"));\r\n\t\t\t \tsleep(1000);\r\n\t\t\t \tclearWebEdit(locator_split(\"txtotherpddmagepc\"));\r\n\t\t\t \tsleep(2000);\r\n\t\t\t \tsendKeys(locator_split(\"txtotherpddmagepc\"), getValue(\"OtherPDDamagePC2\"));\r\n\t\t\t \tsleep(1000);\r\n\t\t\t \t\r\n\t\t\t }\r\n\t\t\t \r\n\t\t\t // click(locator_split(\"linkexpandbilossestimates\"));\r\n\t\t\t sleep(3000);\r\n\t\t\t selectListValue(locator_split(\"listbidowntime\"), getValue(\"BIDownTime2\"));\r\n\t\t\t sleep(2000);\r\n\t\t\t clearWebEdit(locator_split(\"txtbiaffected\"));\r\n\t\t\t sleep(2000);\r\n\t\t\t sendKeys(locator_split(\"txtbiaffected\"), getValue(\"BIAffected2\"));\r\n\t\t\t sleep(2000);\r\n\t\t\t clearWebEdit(locator_split(\"txtbidowntime\"));\r\n\t\t\t sleep(2000);\r\n\t\t\t sendKeys(locator_split(\"txtbidowntime\"), getValue(\"BIDownTimeValue2\"));\r\n\t\t\t sleep(2000);\r\n\t\t\t //if (driver.findElement(By.xpath(\".//*[@id='LECompletedFlag']\")).isSelected()== true ){\r\n\t\t\t \t\r\n\t\t\t //}\r\n\t\t\t if (driver.findElement(By.xpath(\".//*[@id='NLEScenarioComplete']\")).isSelected()== true ){\r\n\t\t\t\t driver.findElement(By.xpath(\"//*[@id='NLEScenarioComplete']\")).click();\r\n\t\t\t\t sleep(2000); \r\n\t\t\t }\r\n\t\t\t driver.findElement(By.xpath(\"//*[@id='NLEScenarioComplete']\")).click();\r\n\t\t\t sleep(2000); \r\n\t\t\t //////////////////////////////////////////////////////\r\n\t\t\t \r\n\t\t\t click(locator_split(\"tabnleprotected\"));\r\n\t\t\t sleep(2000);\r\n\t\t\t if (driver.findElement(By.xpath(\".//*[@id='NLEScenarioComplete']\")).isSelected()== true ){\r\n\t\t\t\t driver.findElement(By.xpath(\"//*[@id='NLEScenarioComplete']\")).click();\r\n\t\t\t\t sleep(2000);\r\n\t\t\t }\r\n\t\t\t driver.findElement(By.xpath(\"//*[@id='NLEScenarioComplete']\")).click();\r\n\t\t\t sleep(2000);\r\n\t\t\t \r\n\t\tclick(locator_split(\"tabnleprotectednonstorage\"));\r\n\t\t\t sleep(2000);\r\n\t\t\t// driver.findElement(By.xpath(\".//*[@id='NLEScenarioComplete']\")).click();\r\n\t\t\tsleep(2000);\r\n\t\t\tclick(locator_split(\"tabnlesummary\"));\r\n\t\t//\tdriver.findElement(By.xpath(\"tabnlesummary\")).click();\r\n\t\t\tsleep(2000);\r\n\t\t\t if (driver.findElement(By.xpath(\".//*[@id='LECompletedFlag']\")).isSelected()== true ){\r\n\t\t\t\t driver.findElement(By.xpath(\"//input[@id='LECompletedFlag']\")).click();\r\n\t\t\t\t\tsleep(2000);\r\n\t\t\t }\r\n\t\t\tdriver.findElement(By.xpath(\"//input[@id='LECompletedFlag']\")).click();\r\n\t\t\tsleep(2000);\r\n\t\t\t if (driver.findElement(By.xpath(\".//*[@id='SectionCompleted']\")).isSelected()== true ){\r\n\t\t\t\t driver.findElement(By.xpath(\"//input[@id='SectionCompleted']\")).click();\r\n\t\t\t\t sleep(2000);\r\n\t\t\t }\r\n\t\t\tdriver.findElement(By.xpath(\"//input[@id='SectionCompleted']\")).click();\r\n\t\t\tsleep(2000);\r\n\t\t//switchframe(\"PegaGadget2Ifr\");\r\n\t\t//\tsleep(3000);\r\n\t\t//clickbylinktext(\"No\");\r\n\t\t\t\r\n\t\t\t}else{\r\n\r\n\t\t\t driver.switchTo().defaultContent();\r\n\t\t\t System.out.println(\"switched frame\"+ switchframe(\"PegaGadget3Ifr\"));\r\n\t\t\t click(locator_split(\"tablossestimates\"));\r\n\t\t\t sleep(2000);\r\n\t\t\t click(locator_split(\"tabmas\"));\r\n\t\t\t sleep(5000);\r\n\t\t\t click(locator_split(\"linkexpandpdlossestimates\"));\r\n\t\t\t sleep(3000);\r\n\t\t\t if (getValue(\"Radiobutton\").contains(\"Value\")){\r\n\t\t\t \tClickRadiobutton(locator_split(\"radiovalue\"));\r\n\t\t\t \t\r\n\t\t\t \tsleep(1000);\r\n\t\t\t \tclearWebEdit(locator_split(\"txtbuildingdamage\"));\r\n\t\t\t \tsleep(3000);\r\n\t\t\t \tclearWebEdit(locator_split(\"txtbuildingdamage\"));\r\n\t\t\t \tsleep(2000);\r\n\t\t\t \tsendKeys(locator_split(\"txtbuildingdamage\"), getValue(\"BuildingDamageMas\"));\r\n\t\t\t \tsleep(1000);\r\n\t\t\t \t\r\n\t\t\t \tclearWebEdit(locator_split(\"txtmeDamage\"));\r\n\t\t\t \tsleep(2000);\r\n\t\t\t \tsendKeys(locator_split(\"txtmeDamage\"), getValue(\"MEDamageMas\"));\r\n\t\t\t \tsleep(1000);\r\n\t\t\t \tclearWebEdit(locator_split(\"txtcontentdamage\"));\r\n\t\t\t \tsleep(2000);\r\n\t\t\t \tsendKeys(locator_split(\"txtcontentdamage\"), getValue(\"ContentDamageMas\"));\r\n\t\t\t \tsleep(1000);\r\n\t\t\t \tclearWebEdit(locator_split(\"txtstockdamage\"));\r\n\t\t\t \tsleep(2000);\r\n\t\t\t \tsendKeys(locator_split(\"txtstockdamage\"), getValue(\"StockDamageMas\"));\r\n\t\t\t \tsleep(1000);\r\n\t\t\t \tclearWebEdit(locator_split(\"txtotherpddamage\"));\r\n\t\t\t \tsleep(2000);\r\n\t\t\t \tsendKeys(locator_split(\"txtotherpddamage\"), getValue(\"OtherPDDamageMas\"));\r\n\t\t\t \tsleep(1000);\r\n\t\t\t \t\r\n\t\t\t }else{\r\n\t\t\t \tClickRadiobutton(locator_split(\"radiopercentage\"));\r\n\t\t\t \tsleep(1000);\r\n\t\t\t \tclearWebEdit(locator_split(\"txtbuildingdamagepc\"));\r\n\t\t\t \tsleep(3000);\r\n\t\t\t \tclearWebEdit(locator_split(\"txtbuildingdamagepc\"));\r\n\t\t\t \tsleep(2000);\r\n\t\t\t \t\r\n\t\t\t \tsendKeys(locator_split(\"txtbuildingdamagepc\"), getValue(\"BuildingDamagePCMas\"));\r\n\t\t\t \tsleep(1000);\r\n\t\t\t \tclearWebEdit(locator_split(\"txtbuildingdamagepc\"));\r\n\t\t\t \tsleep(2000);\r\n\t\t\t \t\r\n\t\t\t \tsendKeys(locator_split(\"txtbuildingdamagepc\"), getValue(\"BuildingDamagePCMas\"));\r\n\t\t\t \tsleep(1000);\r\n\t\t\t \tclearWebEdit(locator_split(\"txtmedamagepc\"));\r\n\t\t\t \tsleep(2000);\r\n\t\t\t \tsendKeys(locator_split(\"txtmedamagepc\"), getValue(\"MEDamagePCMas\"));\r\n\t\t\t \tsleep(1000);\r\n\t\t\t \tclearWebEdit(locator_split(\"txtcontentdamagepc\"));\r\n\t\t\t \tsleep(2000);\r\n\t\t\t \tsendKeys(locator_split(\"txtcontentdamagepc\"), getValue(\"ContentDamagePCMas\"));\r\n\t\t\t \tsleep(1000);\r\n\t\t\t \tclearWebEdit(locator_split(\"txtstockdamagepc\"));\r\n\t\t\t \tsleep(2000);\r\n\t\t\t \tsendKeys(locator_split(\"txtstockdamagepc\"), getValue(\"StockDamagePCMas\"));\r\n\t\t\t \tsleep(1000);\r\n\t\t\t \tclearWebEdit(locator_split(\"txtotherpddmagepc\"));\r\n\t\t\t \tsleep(2000);\r\n\t\t\t \tsendKeys(locator_split(\"txtotherpddmagepc\"), getValue(\"OtherPDDamagePCMas\"));\r\n\t\t\t \tsleep(1000);\r\n\t\t\t \t\r\n\t\t\t }\r\n\t\t\t \r\n\t\t\t click(locator_split(\"linkexpandbilossestimates\"));\r\n\t\t\t sleep(3000);\r\n\t\t\t // click(locator_split(\"linkaddroweml\"));\r\n\t\t\t // sleep(3000);\r\n\t\t\t // click(locator_split(\"linkaddroweml\"));\r\n\t\t\t// sleep(3000);\r\n\t\t\t \r\n\t\t\t selectListValue(locator_split(\"listbidowntime\"), getValue(\"BIDownTimeMas\"));\r\n\t\t\t sleep(2000);\r\n\t\t\t clearWebEdit(locator_split(\"txtbiaffected\"));\r\n\t\t\t sleep(2000);\r\n\t\t\t sendKeys(locator_split(\"txtbiaffected\"), getValue(\"BIAffectedMas\"));\r\n\t\t\t sleep(2000);\r\n\t\t\t clearWebEdit(locator_split(\"txtbidowntime\"));\r\n\t\t\t sleep(2000);\r\n\t\t\t sendKeys(locator_split(\"txtbidowntime\"), getValue(\"BIDownTimeValueMas\"));\r\n\t\t\t sleep(2000);\r\n\t\t\t click(locator_split(\"linkexpandothertecobverage\"));\r\n\t\t\t sleep(2000);\r\n\t\t\t if (getValue(\"Radiobutton\").contains(\"Value\")){\r\n\t\t\t \tClickRadiobutton(locator_split(\"radiovalue2\"));\r\n\t\t\t \tsleep(2000);\r\n\t\t\t \tclearWebEdit(locator_split(\"txteeloss\"));\r\n\t\t\t\t sleep(2000);\r\n\t\t\t\t sendKeys(locator_split(\"txteeloss\"), getValue(\"EELoss1\"));\r\n\t\t\t\t sleep(2000);\r\n\t\t\t \tclearWebEdit(locator_split(\"txtothertecoverageloss\"));\r\n\t\t\t\t sleep(2000);\r\n\t\t\t\t sendKeys(locator_split(\"txtothertecoverageloss\"), getValue(\"OtherTE1CoverageLoss1\"));\r\n\t\t\t\t sleep(2000);\r\n\t\t\t \tclearWebEdit(locator_split(\"txtothertecoverage2loss\"));\r\n\t\t\t\t sleep(2000);\r\n\t\t\t\t sendKeys(locator_split(\"txtothertecoverage2loss\"), getValue(\"OtherTE2CoverageLoss1\"));\r\n\t\t\t\t sleep(2000);\r\n\t\t\t \tclearWebEdit(locator_split(\"txtothertecoverage3loss\"));\r\n\t\t\t\t sleep(2000);\r\n\t\t\t\t sendKeys(locator_split(\"txtothertecoverage3loss\"), getValue(\"OtherTE3CoverageLoss1\"));\r\n\t\t\t\t sleep(2000);\r\n\t\t\t \tclearWebEdit(locator_split(\"txtibiloss\"));\r\n\t\t\t\t sleep(2000);\r\n\t\t\t\t sendKeys(locator_split(\"txtibiloss\"), getValue(\"IBILoss1\"));\r\n\t\t\t\t sleep(2000);\r\n\t\t\t \tclearWebEdit(locator_split(\"txtcbiloss\"));\r\n\t\t\t\t sleep(2000);\r\n\t\t\t\t sendKeys(locator_split(\"txtcbiloss\"), getValue(\"CBILoss1\"));\r\n\t\t\t\t \r\n\t\t\t //if (driver.findElement(By.xpath(\".//*[@id='LECompletedFlag']\")).isSelected()== true ){\r\n\t\t\t \t\r\n\t\t\t //}\r\n\t\t\t // click(locator_split(\"checklecompleted\"));\r\n\t\t\t// driver.findElement(By.xpath(\".//*[@id='LECompletedFlag']\")).click();\r\n\t\t\t \t\r\n\t\t\t }else{\r\n\t\t\t \t\r\n\t\t\t \tClickRadiobutton(locator_split(\"radiopercentage2\"));\r\n\t\t\t \tsleep(2000);\r\n\t\t\t \tclearWebEdit(locator_split(\"txteelosspc\"));\r\n\t\t\t\t sleep(2000);\r\n\t\t\t\t sendKeys(locator_split(\"txteelosspc\"), getValue(\"EELoss1PC\"));\r\n\t\t\t\t sleep(2000);\r\n\t\t\t \tclearWebEdit(locator_split(\"txtothertecoveragelosspc\"));\r\n\t\t\t\t sleep(2000);\r\n\t\t\t\t sendKeys(locator_split(\"txtothertecoveragelosspc\"), getValue(\"OtherTE1CoverageLoss1PC\"));\r\n\t\t\t\t sleep(2000);\r\n\t\t\t \tclearWebEdit(locator_split(\"txtothertecoverage2losspc\"));\r\n\t\t\t\t sleep(2000);\r\n\t\t\t\t sendKeys(locator_split(\"txtothertecoverage2losspc\"), getValue(\"OtherTE2CoverageLoss1PC\"));\r\n\t\t\t\t sleep(2000);\r\n\t\t\t \tclearWebEdit(locator_split(\"txtothertecoverage3losspc\"));\r\n\t\t\t\t sleep(2000);\r\n\t\t\t\t sendKeys(locator_split(\"txtothertecoverage3losspc\"), getValue(\"OtherTE3CoverageLoss1PC\"));\r\n\t\t\t\t sleep(2000);\r\n\t\t\t \tclearWebEdit(locator_split(\"txtibilosspc\"));\r\n\t\t\t\t sleep(2000);\r\n\t\t\t\t sendKeys(locator_split(\"txtibilosspc\"), getValue(\"IBILoss1PC\"));\r\n\t\t\t\t sleep(2000);\r\n\t\t\t \tclearWebEdit(locator_split(\"txtcbilosspc\"));\r\n\t\t\t\t sleep(2000);\r\n\t\t\t\t sendKeys(locator_split(\"txtcbilosspc\"), getValue(\"CBILoss1PC\"));\r\n\t\t\t }\r\n\t\t\t if (driver.findElement(By.xpath(\".//*[@id='LECompletedFlag']\")).isSelected()== true ){\r\n\t\t\t\t\t driver.findElement(By.xpath(\"//input[@id='LECompletedFlag']\")).click();\r\n\t\t\t\t\t\tsleep(2000);\r\n\t\t\t\t }\r\n\t\t\t\tdriver.findElement(By.xpath(\"//input[@id='LECompletedFlag']\")).click();\r\n\t\t\t\tsleep(2000);\r\n\t\t\t// driver.findElement(By.xpath(\"//input[@id='LECompletedFlag']\")).click();\r\n\t\t\t //sendkeys(driver.findElement(By.xpath(\"//input[@name='USER']\")),\"jkdkd\");\r\n\t\t\t // sleep(2000);\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\t \r\n\t\t\t /////////////MFL/////////////////////\r\n\t\t\t \r\n\t\t\t click(locator_split(\"tabmfl\"));\r\n\t\t\t sleep(5000);\r\n\t\t\t // click(locator_split(\"linkexpandpdlossestimates\"));\r\n\t\t\t sleep(3000);\r\n\t\t\t if (getValue(\"Radiobutton\").contains(\"Value\")){\r\n\t\t\t \tClickRadiobutton(locator_split(\"radiovalue\"));\r\n\t\t\t \tsleep(2000);\r\n\t\t\t \tSystem.out.println(\"After clicking Radio button\");\r\n\t\t\t \tsleep(1000);\r\n\t\t\t \tclearWebEdit(locator_split(\"txtbuildingdamage\"));\r\n\t\t\t \tsleep(3000);\r\n\t\t\t \tclearWebEdit(locator_split(\"txtbuildingdamage\"));\r\n\t\t\t \tsleep(2000);\r\n\t\t\t \tsendKeys(locator_split(\"txtbuildingdamage\"), getValue(\"BuildingDamageMfl1\"));\r\n\t\t\t \tsleep(1000);\r\n\t\t\t \tclearWebEdit(locator_split(\"txtmeDamage\"));\r\n\t\t\t \tsleep(2000);\r\n\t\t\t \tsendKeys(locator_split(\"txtmeDamage\"), getValue(\"MEDamageMfl1\"));\r\n\t\t\t \tsleep(1000);\r\n\t\t\t \tclearWebEdit(locator_split(\"txtcontentdamage\"));\r\n\t\t\t \tsleep(2000);\r\n\t\t\t \tsendKeys(locator_split(\"txtcontentdamage\"), getValue(\"ContentDamageMfl1\"));\r\n\t\t\t \tsleep(1000);\r\n\t\t\t \tclearWebEdit(locator_split(\"txtstockdamage\"));\r\n\t\t\t \tsleep(2000);\r\n\t\t\t \tsendKeys(locator_split(\"txtstockdamage\"), getValue(\"StockDamageMfl1\"));\r\n\t\t\t \tsleep(1000);\r\n\t\t\t \tclearWebEdit(locator_split(\"txtotherpddamage\"));\r\n\t\t\t \tsleep(2000);\r\n\t\t\t \tsendKeys(locator_split(\"txtotherpddamage\"), getValue(\"OtherPDDamageMfl1\"));\r\n\t\t\t \tsleep(1000);\r\n\t\t\t \t\r\n\t\t\t }else{\r\n\t\t\t \tClickRadiobutton(locator_split(\"radiopercentage\"));\r\n\t\t\t \tsleep(2000);\r\n\t\t\t \tclearWebEdit(locator_split(\"txtbuildingdamagepc\"));\r\n\t\t\t \tsleep(2000);\r\n\t\t\t \tclearWebEdit(locator_split(\"txtbuildingdamagepc\"));\r\n\t\t\t \tsleep(2000);\r\n\t\t\t \tclearWebEdit(locator_split(\"txtbuildingdamagepc\"));\r\n\t\t\t \tsleep(2000);\r\n\t\t\t \tsendKeys(locator_split(\"txtbuildingdamagepc\"), getValue(\"BuildingDamageMflPC1\"));\r\n\t\t\t \tsleep(1000);\r\n\t\t\t \tclearWebEdit(locator_split(\"txtmedamagepc\"));\r\n\t\t\t \tsleep(2000);\r\n\t\t\t \tsendKeys(locator_split(\"txtmedamagepc\"), getValue(\"MEDamageMflPC1\"));\r\n\t\t\t \tsleep(1000);\r\n\t\t\t \tclearWebEdit(locator_split(\"txtcontentdamagepc\"));\r\n\t\t\t \tsleep(2000);\r\n\t\t\t \tsendKeys(locator_split(\"txtcontentdamagepc\"), getValue(\"ContentDamageMflPC1\"));\r\n\t\t\t \tsleep(1000);\r\n\t\t\t \tclearWebEdit(locator_split(\"txtstockdamagepc\"));\r\n\t\t\t \tsleep(2000);\r\n\t\t\t \tsendKeys(locator_split(\"txtstockdamagepc\"), getValue(\"StockDamageMflPC1\"));\r\n\t\t\t \tsleep(1000);\r\n\t\t\t \tclearWebEdit(locator_split(\"txtotherpddmagepc\"));\r\n\t\t\t \tsleep(2000);\r\n\t\t\t \tsendKeys(locator_split(\"txtotherpddmagepc\"), getValue(\"OtherPDDamageMflPC1\"));\r\n\t\t\t \tsleep(1000);\r\n\t\t\t \t\r\n\t\t\t }\r\n\t\t\t \r\n\t\t\t // click(locator_split(\"linkexpandbilossestimates\"));\r\n\t\t\t sleep(3000);\r\n\t\t\t /* click(locator_split(\"linkaddroweml\"));\r\n\t\t\t sleep(3000);\r\n\t\t\t click(locator_split(\"linkaddroweml\"));\r\n\t\t\t sleep(3000);*/\r\n\t\t\t \r\n\t\t\t selectListValue(locator_split(\"listbidowntime\"), getValue(\"BIDownTimeMfl1\"));\r\n\t\t\t sleep(2000);\r\n\t\t\t clearWebEdit(locator_split(\"txtbiaffected\"));\r\n\t\t\t sleep(2000);\r\n\t\t\t sendKeys(locator_split(\"txtbiaffected\"), getValue(\"BIAffectedMfl1\"));\r\n\t\t\t sleep(5000);\r\n\t\t\t clearWebEdit(locator_split(\"txtbidowntime\"));\r\n\t\t\t sleep(2000);\r\n\t\t\t sendKeys(locator_split(\"txtbidowntime\"), getValue(\"BIDownTimeValueMfl1\"));\r\n\t\t\t sleep(2000);\r\n\t\t\t // click(locator_split(\"linkexpandothertecobverage\"));\r\n\t\t\t sleep(2000);\r\n\t\t\t if (getValue(\"Radiobutton\").contains(\"Value\")){\r\n\t\t\t \tClickRadiobutton(locator_split(\"radiovaluemfs\"));\r\n\t\t\t \tsleep(2000);\r\n\t\t\t \tclearWebEdit(locator_split(\"txteeloss\"));\r\n\t\t\t\t sleep(2000);\r\n\t\t\t\t sendKeys(locator_split(\"txteeloss\"), getValue(\"EELossMfl\"));\r\n\t\t\t\t sleep(2000);\r\n\t\t\t \tclearWebEdit(locator_split(\"txtothertecoverageloss\"));\r\n\t\t\t\t sleep(2000);\r\n\t\t\t\t sendKeys(locator_split(\"txtothertecoverageloss\"), getValue(\"OtherTE1CoverageLossMfl\"));\r\n\t\t\t\t sleep(2000);\r\n\t\t\t \tclearWebEdit(locator_split(\"txtothertecoverage2loss\"));\r\n\t\t\t\t sleep(2000);\r\n\t\t\t\t sendKeys(locator_split(\"txtothertecoverage2loss\"), getValue(\"OtherTE2CoverageLossMfl\"));\r\n\t\t\t\t sleep(2000);\r\n\t\t\t \tclearWebEdit(locator_split(\"txtothertecoverage3loss\"));\r\n\t\t\t\t sleep(2000);\r\n\t\t\t\t sendKeys(locator_split(\"txtothertecoverage3loss\"), getValue(\"OtherTE3CoverageLossMfl\"));\r\n\t\t\t\t sleep(2000);\r\n\t\t\t \tclearWebEdit(locator_split(\"txtibiloss\"));\r\n\t\t\t\t sleep(2000);\r\n\t\t\t\t sendKeys(locator_split(\"txtibiloss\"), getValue(\"IBILossMfl\"));\r\n\t\t\t\t sleep(2000);\r\n\t\t\t \tclearWebEdit(locator_split(\"txtcbiloss\"));\r\n\t\t\t\t sleep(2000);\r\n\t\t\t\t sendKeys(locator_split(\"txtcbiloss\"), getValue(\"CBILossMfl\"));\r\n\t\t\t\t \r\n\t\t\t //if (driver.findElement(By.xpath(\".//*[@id='LECompletedFlag']\")).isSelected()== true ){\r\n\t\t\t \t\r\n\t\t\t //}\r\n\t\t\t // click(locator_split(\"checklecompleted\"));\r\n\t\t\t// driver.findElement(By.xpath(\".//*[@id='LECompletedFlag']\")).click();\r\n\t\t\t \t\r\n\t\t\t }else{\r\n\t\t\t \t\r\n\t\t\t \tClickRadiobutton(locator_split(\"radiopercentagemfl\"));\r\n\t\t\t \tsleep(2000);\r\n\t\t\t \tclearWebEdit(locator_split(\"txteelosspc\"));\r\n\t\t\t\t sleep(2000);\r\n\t\t\t\t sendKeys(locator_split(\"txteelosspc\"), getValue(\"EELossMflPC\"));\r\n\t\t\t\t sleep(2000);\r\n\t\t\t \tclearWebEdit(locator_split(\"txtothertecoveragelosspc\"));\r\n\t\t\t\t sleep(2000);\r\n\t\t\t\t sendKeys(locator_split(\"txtothertecoveragelosspc\"), getValue(\"OtherTE1CoverageLossMflPC\"));\r\n\t\t\t\t sleep(2000);\r\n\t\t\t \tclearWebEdit(locator_split(\"txtothertecoverage2losspc\"));\r\n\t\t\t\t sleep(2000);\r\n\t\t\t\t sendKeys(locator_split(\"txtothertecoverage2losspc\"), getValue(\"OtherTE2CoverageLossMflPC\"));\r\n\t\t\t\t sleep(2000);\r\n\t\t\t \tclearWebEdit(locator_split(\"txtothertecoverage3losspc\"));\r\n\t\t\t\t sleep(2000);\r\n\t\t\t\t sendKeys(locator_split(\"txtothertecoverage3losspc\"), getValue(\"OtherTE3CoverageLossMflPC\"));\r\n\t\t\t\t sleep(2000);\r\n\t\t\t \tclearWebEdit(locator_split(\"txtibilosspc\"));\r\n\t\t\t\t sleep(2000);\r\n\t\t\t\t sendKeys(locator_split(\"txtibilosspc\"), getValue(\"IBILossMflPC\"));\r\n\t\t\t\t sleep(2000);\r\n\t\t\t \tclearWebEdit(locator_split(\"txtcbilosspc\"));\r\n\t\t\t\t sleep(2000);\r\n\t\t\t\t sendKeys(locator_split(\"txtcbilosspc\"), getValue(\"CBILossMfPC\"));\r\n\t\t\t }\r\n\t\t\t if (driver.findElement(By.xpath(\".//*[@id='LECompletedFlag']\")).isSelected()== true ){\r\n\t\t\t\t\t driver.findElement(By.xpath(\"//input[@id='LECompletedFlag']\")).click();\r\n\t\t\t\t\t\tsleep(2000);\r\n\t\t\t\t }\r\n\t\t\t\tdriver.findElement(By.xpath(\"//input[@id='LECompletedFlag']\")).click();\r\n\t\t\t\tsleep(2000);\r\n\t\t\t // driver.findElement(By.xpath(\"//input[@id='LECompletedFlag']\")).click();\r\n\t\t\t //sendkeys(driver.findElement(By.xpath(\"//input[@name='USER']\")),\"jkdkd\");\r\n\t\t\t // sleep(2000);\r\n\t\t\t ///////////////MFL/////////////\r\n\t/////////////PML/////////////////////\r\n\t\t\t\t \r\n\t\t\t\t click(locator_split(\"tabpml\"));\r\n\t\t\t\t sleep(5000);\r\n\t\t\t\t // click(locator_split(\"linkexpandpdlossestimates\"));\r\n\t\t\t\t sleep(3000);\r\n\t\t\t\t if (getValue(\"Radiobutton\").contains(\"Value\")){\r\n\t\t\t\t \tClickRadiobutton(locator_split(\"radiovalue\"));\r\n\t\t\t\t \tsleep(2000);\r\n\t\t\t\t \tSystem.out.println(\"After clicking Radio button\");\r\n\t\t\t\t \tsleep(1000);\r\n\t\t\t\t \tclearWebEdit(locator_split(\"txtbuildingdamage\"));\r\n\t\t\t\t \tsleep(3000);\r\n\t\t\t\t \tclearWebEdit(locator_split(\"txtbuildingdamage\"));\r\n\t\t\t\t \tsleep(2000);\r\n\t\t\t\t \tsendKeys(locator_split(\"txtbuildingdamage\"), getValue(\"BuildingDamageMfl1\"));\r\n\t\t\t\t \tsleep(1000);\r\n\t\t\t\t \tclearWebEdit(locator_split(\"txtmeDamage\"));\r\n\t\t\t\t \tsleep(2000);\r\n\t\t\t\t \tsendKeys(locator_split(\"txtmeDamage\"), getValue(\"MEDamageMfl1\"));\r\n\t\t\t\t \tsleep(1000);\r\n\t\t\t\t \tclearWebEdit(locator_split(\"txtcontentdamage\"));\r\n\t\t\t\t \tsleep(2000);\r\n\t\t\t\t \tsendKeys(locator_split(\"txtcontentdamage\"), getValue(\"ContentDamageMfl1\"));\r\n\t\t\t\t \tsleep(1000);\r\n\t\t\t\t \tclearWebEdit(locator_split(\"txtstockdamage\"));\r\n\t\t\t\t \tsleep(2000);\r\n\t\t\t\t \tsendKeys(locator_split(\"txtstockdamage\"), getValue(\"StockDamageMfl1\"));\r\n\t\t\t\t \tsleep(1000);\r\n\t\t\t\t \tclearWebEdit(locator_split(\"txtotherpddamage\"));\r\n\t\t\t\t \tsleep(2000);\r\n\t\t\t\t \tsendKeys(locator_split(\"txtotherpddamage\"), getValue(\"OtherPDDamageMfl1\"));\r\n\t\t\t\t \tsleep(1000);\r\n\t\t\t\t \t\r\n\t\t\t\t }else{\r\n\t\t\t\t \tClickRadiobutton(locator_split(\"radiopercentage\"));\r\n\t\t\t\t \tsleep(2000);\r\n\t\t\t\t \tclearWebEdit(locator_split(\"txtbuildingdamagepc\"));\r\n\t\t\t\t \tsleep(2000);\r\n\t\t\t\t \tclearWebEdit(locator_split(\"txtbuildingdamagepc\"));\r\n\t\t\t\t \tsleep(2000);\r\n\t\t\t\t \tclearWebEdit(locator_split(\"txtbuildingdamagepc\"));\r\n\t\t\t\t \tsleep(2000);\r\n\t\t\t\t \tsendKeys(locator_split(\"txtbuildingdamagepc\"), getValue(\"BuildingDamageMflPC1\"));\r\n\t\t\t\t \tsleep(1000);\r\n\t\t\t\t \tclearWebEdit(locator_split(\"txtmedamagepc\"));\r\n\t\t\t\t \tsleep(2000);\r\n\t\t\t\t \tsendKeys(locator_split(\"txtmedamagepc\"), getValue(\"MEDamageMflPC1\"));\r\n\t\t\t\t \tsleep(1000);\r\n\t\t\t\t \tclearWebEdit(locator_split(\"txtcontentdamagepc\"));\r\n\t\t\t\t \tsleep(2000);\r\n\t\t\t\t \tsendKeys(locator_split(\"txtcontentdamagepc\"), getValue(\"ContentDamageMflPC1\"));\r\n\t\t\t\t \tsleep(1000);\r\n\t\t\t\t \tclearWebEdit(locator_split(\"txtstockdamagepc\"));\r\n\t\t\t\t \tsleep(2000);\r\n\t\t\t\t \tsendKeys(locator_split(\"txtstockdamagepc\"), getValue(\"StockDamageMflPC1\"));\r\n\t\t\t\t \tsleep(1000);\r\n\t\t\t\t \tclearWebEdit(locator_split(\"txtotherpddmagepc\"));\r\n\t\t\t\t \tsleep(2000);\r\n\t\t\t\t \tsendKeys(locator_split(\"txtotherpddmagepc\"), getValue(\"OtherPDDamageMflPC1\"));\r\n\t\t\t\t \tsleep(1000);\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 // click(locator_split(\"linkexpandbilossestimates\"));\r\n\t\t\t\t /* sleep(3000);\r\n\t\t\t\t click(locator_split(\"linkaddroweml\"));\r\n\t\t\t\t sleep(3000);\r\n\t\t\t\t click(locator_split(\"linkaddroweml\"));\r\n\t\t\t\t sleep(3000);*/\r\n\t\t\t\t sleep(3000);\r\n\t\t\t\t selectListValue(locator_split(\"listbidowntime\"), getValue(\"BIDownTimeMfl1\"));\r\n\t\t\t\t sleep(2000);\r\n\t\t\t\t clearWebEdit(locator_split(\"txtbiaffected\"));\r\n\t\t\t\t sleep(2000);\r\n\t\t\t\t sendKeys(locator_split(\"txtbiaffected\"), getValue(\"BIAffectedMfl1\"));\r\n\t\t\t\t sleep(5000);\r\n\t\t\t\t clearWebEdit(locator_split(\"txtbidowntime\"));\r\n\t\t\t\t sleep(2000);\r\n\t\t\t\t sendKeys(locator_split(\"txtbidowntime\"), getValue(\"BIDownTimeValueMfl1\"));\r\n\t\t\t\t sleep(2000);\r\n\t\t\t\t // click(locator_split(\"linkexpandothertecobverage\"));\r\n\t\t\t\t sleep(2000);\r\n\t\t\t\t if (getValue(\"Radiobutton\").contains(\"Value\")){\r\n\t\t\t\t \tSystem.out.println(\"Inside If Loop\");\r\n\t\t\t\t \t//ClickRadiobutton(locator_split(\"radiovaluepml\"));\r\n\t\t\t\t \tsleep(5000);\r\n\t\t\t\t \tclearWebEdit(locator_split(\"txteeloss\"));\r\n\t\t\t\t\t sleep(2000);\r\n\t\t\t\t\t sendKeys(locator_split(\"txteeloss\"), getValue(\"EELossMfl\"));\r\n\t\t\t\t\t sleep(2000);\r\n\t\t\t\t \tclearWebEdit(locator_split(\"txtothertecoverageloss\"));\r\n\t\t\t\t\t sleep(2000);\r\n\t\t\t\t\t sendKeys(locator_split(\"txtothertecoverageloss\"), getValue(\"OtherTE1CoverageLossMfl\"));\r\n\t\t\t\t\t sleep(2000);\r\n\t\t\t\t \tclearWebEdit(locator_split(\"txtothertecoverage2loss\"));\r\n\t\t\t\t\t sleep(3000);\r\n\t\t\t\t\t sendKeys(locator_split(\"txtothertecoverage2loss\"), getValue(\"OtherTE2CoverageLossMfl\"));\r\n\t\t\t\t\t sleep(3000);\r\n\t\t\t\t \tclearWebEdit(locator_split(\"txtothertecoverage3loss\"));\r\n\t\t\t\t\t sleep(2000);\r\n\t\t\t\t\t sendKeys(locator_split(\"txtothertecoverage3loss\"), getValue(\"OtherTE3CoverageLossMfl\"));\r\n\t\t\t\t\t sleep(2000);\r\n\t\t\t\t \tclearWebEdit(locator_split(\"txtibiloss\"));\r\n\t\t\t\t\t sleep(2000);\r\n\t\t\t\t\t sendKeys(locator_split(\"txtibiloss\"), getValue(\"IBILossPML\"));\r\n\t\t\t\t\t sleep(2000);\r\n\t\t\t\t \tclearWebEdit(locator_split(\"txtcbiloss\"));\r\n\t\t\t\t\t sleep(2000);\r\n\t\t\t\t\t sendKeys(locator_split(\"txtcbiloss\"), getValue(\"CBILossPML\"));\r\n\t\t\t\t\t \r\n\t\t\t\t //if (driver.findElement(By.xpath(\".//*[@id='LECompletedFlag']\")).isSelected()== true ){\r\n\t\t\t\t \t\r\n\t\t\t\t //}\r\n\t\t\t\t // click(locator_split(\"checklecompleted\"));\r\n\t\t\t\t// driver.findElement(By.xpath(\".//*[@id='LECompletedFlag']\")).click();\r\n\t\t\t\t \t\r\n\t\t\t\t }else{\r\n\t\t\t\t \t\r\n\t\t\t\t \tClickRadiobutton(locator_split(\"radiopercentage3\"));\r\n\t\t\t\t \tsleep(2000);\r\n\t\t\t\t \tclearWebEdit(locator_split(\"txteelosspc\"));\r\n\t\t\t\t\t sleep(2000);\r\n\t\t\t\t\t sendKeys(locator_split(\"txteelosspc\"), getValue(\"EELossPML1\"));\r\n\t\t\t\t\t sleep(2000);\r\n\t\t\t\t \tclearWebEdit(locator_split(\"txtothertecoveragelosspc\"));\r\n\t\t\t\t\t sleep(2000);\r\n\t\t\t\t\t sendKeys(locator_split(\"txtothertecoveragelosspc\"), getValue(\"OtherTE1CoverageLossPMLPC\"));\r\n\t\t\t\t\t sleep(2000);\r\n\t\t\t\t \tclearWebEdit(locator_split(\"txtothertecoverage2losspc\"));\r\n\t\t\t\t\t sleep(2000);\r\n\t\t\t\t\t sendKeys(locator_split(\"txtothertecoverage2losspc\"), getValue(\"OtherTE2CoverageLossPMLPC\"));\r\n\t\t\t\t\t sleep(2000);\r\n\t\t\t\t \tclearWebEdit(locator_split(\"txtothertecoverage3losspc\"));\r\n\t\t\t\t\t sleep(2000);\r\n\t\t\t\t\t sendKeys(locator_split(\"txtothertecoverage3losspc\"), getValue(\"OtherTE3CoverageLossPMLPC\"));\r\n\t\t\t\t\t sleep(2000);\r\n\t\t\t\t \tclearWebEdit(locator_split(\"txtibilosspc\"));\r\n\t\t\t\t\t sleep(2000);\r\n\t\t\t\t\t sendKeys(locator_split(\"txtibilosspc\"), getValue(\"IBILossPMLPC\"));\r\n\t\t\t\t\t sleep(2000);\r\n\t\t\t\t \tclearWebEdit(locator_split(\"txtcbilosspc\"));\r\n\t\t\t\t\t sleep(2000);\r\n\t\t\t\t\t sendKeys(locator_split(\"txtcbilosspc\"), getValue(\"CBILossPMLPC\"));\r\n\t\t\t\t\t sleep(2000);\r\n\t\t\t\t }\r\n\t\t\t\t if (driver.findElement(By.xpath(\".//*[@id='LECompletedFlag']\")).isSelected()== true ){\r\n\t\t\t\t\t\t driver.findElement(By.xpath(\"//input[@id='LECompletedFlag']\")).click();\r\n\t\t\t\t\t\t\tsleep(2000);\r\n\t\t\t\t\t }\r\n\t\t\t\t\tdriver.findElement(By.xpath(\"//input[@id='LECompletedFlag']\")).click();\r\n\t\t\t\t\tsleep(2000);\r\n\t\t\t\t // driver.findElement(By.xpath(\"//input[@id='LECompletedFlag']\")).click();\r\n\t\t\t\t //sendkeys(driver.findElement(By.xpath(\"//input[@name='USER']\")),\"jkdkd\");\r\n\t\t\t\t // sleep(2000);\r\n\t\t\t\t ///////////////PML/////////////\r\n\t\t\t\t //////////////NLE Manual////////////////\r\n\t\r\n\t\t\t\t\t \r\n\t\t\t\t\t click(locator_split(\"tabnlemanual\"));\r\n\t\t\t\t\t sleep(5000);\r\n\t\t\t\t\t // click(locator_split(\"linkexpandpdlossestimates\"));\r\n\t\t\t\t\t sleep(3000);\r\n\t\t\t\t\t if (getValue(\"Radiobutton\").contains(\"Value\")){\r\n\t\t\t\t\t \tClickRadiobutton(locator_split(\"radiovalue\"));\r\n\t\t\t\t\t \tsleep(2000);\r\n\t\t\t\t\t \tSystem.out.println(\"After clicking Radio button\");\r\n\t\t\t\t\t \tsleep(1000);\r\n\t\t\t\t\t \tclearWebEdit(locator_split(\"txtbuildingdamage\"));\r\n\t\t\t\t\t \tsleep(3000);\r\n\t\t\t\t\t \tclearWebEdit(locator_split(\"txtbuildingdamage\"));\r\n\t\t\t\t\t \tsleep(2000);\r\n\t\t\t\t\t \tsendKeys(locator_split(\"txtbuildingdamage\"), getValue(\"BuildingDamageNLE1\"));\r\n\t\t\t\t\t \tsleep(1000);\r\n\t\t\t\t\t \tclearWebEdit(locator_split(\"txtmeDamage\"));\r\n\t\t\t\t\t \tsleep(2000);\r\n\t\t\t\t\t \tsendKeys(locator_split(\"txtmeDamage\"), getValue(\"MEDamageNLE1\"));\r\n\t\t\t\t\t \tsleep(1000);\r\n\t\t\t\t\t \tclearWebEdit(locator_split(\"txtcontentdamage\"));\r\n\t\t\t\t\t \tsleep(2000);\r\n\t\t\t\t\t \tsendKeys(locator_split(\"txtcontentdamage\"), getValue(\"ContentDamageNLE1\"));\r\n\t\t\t\t\t \tsleep(1000);\r\n\t\t\t\t\t \tclearWebEdit(locator_split(\"txtstockdamage\"));\r\n\t\t\t\t\t \tsleep(2000);\r\n\t\t\t\t\t \tsendKeys(locator_split(\"txtstockdamage\"), getValue(\"StockDamageNLE1\"));\r\n\t\t\t\t\t \tsleep(1000);\r\n\t\t\t\t\t \tclearWebEdit(locator_split(\"txtotherpddamage\"));\r\n\t\t\t\t\t \tsleep(2000);\r\n\t\t\t\t\t \tsendKeys(locator_split(\"txtotherpddamage\"), getValue(\"OtherPDDamageNLE1\"));\r\n\t\t\t\t\t \tsleep(1000);\r\n\t\t\t\t\t \t\r\n\t\t\t\t\t }else{\r\n\t\t\t\t\t \tClickRadiobutton(locator_split(\"radiopercentage\"));\r\n\t\t\t\t\t \tsleep(2000);\r\n\t\t\t\t\t \tclearWebEdit(locator_split(\"txtbuildingdamagepc\"));\r\n\t\t\t\t\t \tsleep(2000);\r\n\t\t\t\t\t \tclearWebEdit(locator_split(\"txtbuildingdamagepc\"));\r\n\t\t\t\t\t \tsleep(2000);\r\n\t\t\t\t\t \tclearWebEdit(locator_split(\"txtbuildingdamagepc\"));\r\n\t\t\t\t\t \tsleep(2000);\r\n\t\t\t\t\t \tsendKeys(locator_split(\"txtbuildingdamagepc\"), getValue(\"BuildingDamageNLEPC1\"));\r\n\t\t\t\t\t \tsleep(1000);\r\n\t\t\t\t\t \tclearWebEdit(locator_split(\"txtmedamagepc\"));\r\n\t\t\t\t\t \tsleep(2000);\r\n\t\t\t\t\t \tsendKeys(locator_split(\"txtmedamagepc\"), getValue(\"MEDamageNLEPC1\"));\r\n\t\t\t\t\t \tsleep(1000);\r\n\t\t\t\t\t \tclearWebEdit(locator_split(\"txtcontentdamagepc\"));\r\n\t\t\t\t\t \tsleep(2000);\r\n\t\t\t\t\t \tsendKeys(locator_split(\"txtcontentdamagepc\"), getValue(\"ContentDamageNLEPC1\"));\r\n\t\t\t\t\t \tsleep(1000);\r\n\t\t\t\t\t \tclearWebEdit(locator_split(\"txtstockdamagepc\"));\r\n\t\t\t\t\t \tsleep(2000);\r\n\t\t\t\t\t \tsendKeys(locator_split(\"txtstockdamagepc\"), getValue(\"StockDamageNLEPC1\"));\r\n\t\t\t\t\t \tsleep(1000);\r\n\t\t\t\t\t \tclearWebEdit(locator_split(\"txtotherpddmagepc\"));\r\n\t\t\t\t\t \tsleep(2000);\r\n\t\t\t\t\t \tsendKeys(locator_split(\"txtotherpddmagepc\"), getValue(\"OtherPDDamageNLEPC1\"));\r\n\t\t\t\t\t \tsleep(1000);\r\n\t\t\t\t\t \t\r\n\t\t\t\t\t }\r\n\t\t\t\t\t \r\n\t\t\t\t\t // click(locator_split(\"linkexpandbilossestimates\"));\r\n\t\t\t\t\t /* sleep(3000);\r\n\t\t\t\t\t click(locator_split(\"linkaddroweml\"));\r\n\t\t\t\t\t sleep(3000);\r\n\t\t\t\t\t click(locator_split(\"linkaddroweml\"));\r\n\t\t\t\t\t sleep(3000);*/\r\n\t\t\t\t\t sleep(3000);\r\n\t\t\t\t\t selectListValue(locator_split(\"listbidowntime\"), getValue(\"BIDownTimeNLE1\"));\r\n\t\t\t\t\t sleep(2000);\r\n\t\t\t\t\t clearWebEdit(locator_split(\"txtbiaffected\"));\r\n\t\t\t\t\t sleep(2000);\r\n\t\t\t\t\t sendKeys(locator_split(\"txtbiaffected\"), getValue(\"BIAffectedNLE1\"));\r\n\t\t\t\t\t sleep(5000);\r\n\t\t\t\t\t clearWebEdit(locator_split(\"txtbidowntime\"));\r\n\t\t\t\t\t sleep(2000);\r\n\t\t\t\t\t sendKeys(locator_split(\"txtbidowntime\"), getValue(\"BIDownTimeValueNLE1\"));\r\n\t\t\t\t\t sleep(2000);\r\n\t\t\t\t\t // click(locator_split(\"linkexpandothertecobverage\"));\r\n\t\t\t\t\t sleep(2000);\r\n\t\t\t\t\t if (getValue(\"Radiobutton\").contains(\"Value\")){\r\n\t\t\t\t\t \tSystem.out.println(\"Inside If Loop\");\r\n\t\t\t\t\t \t//ClickRadiobutton(locator_split(\"radiovaluepml\"));\r\n\t\t\t\t\t \tsleep(5000);\r\n\t\t\t\t\t \tclearWebEdit(locator_split(\"txteeloss\"));\r\n\t\t\t\t\t\t sleep(2000);\r\n\t\t\t\t\t\t sendKeys(locator_split(\"txteeloss\"), getValue(\"EELossNLE\"));\r\n\t\t\t\t\t\t sleep(2000);\r\n\t\t\t\t\t \tclearWebEdit(locator_split(\"txtothertecoverageloss\"));\r\n\t\t\t\t\t\t sleep(2000);\r\n\t\t\t\t\t\t sendKeys(locator_split(\"txtothertecoverageloss\"), getValue(\"OtherTE1CoverageLossNLE\"));\r\n\t\t\t\t\t\t sleep(2000);\r\n\t\t\t\t\t \tclearWebEdit(locator_split(\"txtothertecoverage2loss\"));\r\n\t\t\t\t\t\t sleep(3000);\r\n\t\t\t\t\t\t sendKeys(locator_split(\"txtothertecoverage2loss\"), getValue(\"OtherTE2CoverageLossNLE\"));\r\n\t\t\t\t\t\t sleep(3000);\r\n\t\t\t\t\t \tclearWebEdit(locator_split(\"txtothertecoverage3loss\"));\r\n\t\t\t\t\t\t sleep(2000);\r\n\t\t\t\t\t\t sendKeys(locator_split(\"txtothertecoverage3loss\"), getValue(\"OtherTE3CoverageLossNLE\"));\r\n\t\t\t\t\t\t sleep(2000);\r\n\t\t\t\t\t \tclearWebEdit(locator_split(\"txtibiloss\"));\r\n\t\t\t\t\t\t sleep(2000);\r\n\t\t\t\t\t\t sendKeys(locator_split(\"txtibiloss\"), getValue(\"IBILossNLE\"));\r\n\t\t\t\t\t\t sleep(2000);\r\n\t\t\t\t\t \tclearWebEdit(locator_split(\"txtcbiloss\"));\r\n\t\t\t\t\t\t sleep(2000);\r\n\t\t\t\t\t\t sendKeys(locator_split(\"txtcbiloss\"), getValue(\"CBILossNLE\"));\r\n\t\t\t\t\t\t \r\n\t\t\t\t\t //if (driver.findElement(By.xpath(\".//*[@id='LECompletedFlag']\")).isSelected()== true ){\r\n\t\t\t\t\t \t\r\n\t\t\t\t\t //}\r\n\t\t\t\t\t // click(locator_split(\"checklecompleted\"));\r\n\t\t\t\t\t// driver.findElement(By.xpath(\".//*[@id='LECompletedFlag']\")).click();\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 \tClickRadiobutton(locator_split(\"radiopercentagenlemanual\"));\r\n\t\t\t\t\t \tsleep(2000);\r\n\t\t\t\t\t \tclearWebEdit(locator_split(\"txteelosspc\"));\r\n\t\t\t\t\t\t sleep(2000);\r\n\t\t\t\t\t\t sendKeys(locator_split(\"txteelosspc\"), getValue(\"EELossNLEPC\"));\r\n\t\t\t\t\t\t sleep(2000);\r\n\t\t\t\t\t \tclearWebEdit(locator_split(\"txtothertecoveragelosspc\"));\r\n\t\t\t\t\t\t sleep(2000);\r\n\t\t\t\t\t\t sendKeys(locator_split(\"txtothertecoveragelosspc\"), getValue(\"OtherTE1CoverageLossNLEPC\"));\r\n\t\t\t\t\t\t sleep(2000);\r\n\t\t\t\t\t \tclearWebEdit(locator_split(\"txtothertecoverage2losspc\"));\r\n\t\t\t\t\t\t sleep(2000);\r\n\t\t\t\t\t\t sendKeys(locator_split(\"txtothertecoverage2losspc\"), getValue(\"OtherTE2CoverageLossNLEPC\"));\r\n\t\t\t\t\t\t sleep(2000);\r\n\t\t\t\t\t \tclearWebEdit(locator_split(\"txtothertecoverage3losspc\"));\r\n\t\t\t\t\t\t sleep(2000);\r\n\t\t\t\t\t\t sendKeys(locator_split(\"txtothertecoverage3losspc\"), getValue(\"OtherTE3CoverageLossNLEPC\"));\r\n\t\t\t\t\t\t sleep(2000);\r\n\t\t\t\t\t \tclearWebEdit(locator_split(\"txtibilosspc\"));\r\n\t\t\t\t\t\t sleep(2000);\r\n\t\t\t\t\t\t sendKeys(locator_split(\"txtibilosspc\"), getValue(\"IBILossNLEPC\"));\r\n\t\t\t\t\t\t sleep(2000);\r\n\t\t\t\t\t \tclearWebEdit(locator_split(\"txtcbilosspc\"));\r\n\t\t\t\t\t\t sleep(2000);\r\n\t\t\t\t\t\t sendKeys(locator_split(\"txtcbilosspc\"), getValue(\"CBILossNLEPC\"));\r\n\t\t\t\t\t\t sleep(2000);\r\n\t\t\t\t\t }\r\n\t\t\t\t\t // driver.findElement(By.xpath(\"//input[@id='LECompletedFlag']\")).click();\r\n\t\t\t\t\t if (driver.findElement(By.xpath(\".//*[@id='NLEScenarioComplete']\")).isSelected()== true ){\r\n\t\t\t\t\t\t driver.findElement(By.xpath(\"//*[@id='NLEScenarioComplete']\")).click();\r\n\t\t\t\t\t\t sleep(2000); \r\n\t\t\t\t\t }\r\n\t\t\t\t\t driver.findElement(By.xpath(\"//*[@id='NLEScenarioComplete']\")).click();\r\n\t\t\t\t\t sleep(2000); \r\n\t\t\t\t\t //sendkeys(driver.findElement(By.xpath(\"//input[@name='USER']\")),\"jkdkd\");\r\n\t\t\t\t\t sleep(2000);\r\n\t\t\t\t\t \r\n\t\t\t\t /////////////NLE Manual/////////////\r\n\t\t\t\t\t ////////////////////Remaining tabs/////////////\r\n\t\t\t\t\t \r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t \r\n\t\t\t\t\t\t click(locator_split(\"tabnleprotected\"));\r\n\t\t\t\t\t\t sleep(2000);\r\n\t\t\t\t\t\t if (driver.findElement(By.xpath(\".//*[@id='NLEScenarioComplete']\")).isSelected()== true ){\r\n\t\t\t\t\t\t\t driver.findElement(By.xpath(\"//*[@id='NLEScenarioComplete']\")).click();\r\n\t\t\t\t\t\t\t sleep(2000);\r\n\t\t\t\t\t\t }\r\n\t\t\t\t\t\t driver.findElement(By.xpath(\"//*[@id='NLEScenarioComplete']\")).click();\r\n\t\t\t\t\t\t sleep(2000);\r\n\t\t\t\t\t\t \r\n\t\t\t\t\tclick(locator_split(\"tabnleprotectednonstorage\"));\r\n\t\t\t\t\t\t sleep(2000);\r\n\t\t\t\t\t\t if (driver.findElement(By.xpath(\".//*[@id='NLEScenarioComplete']\")).isSelected()== true ){\r\n\t\t\t\t\t\t\t driver.findElement(By.xpath(\"//*[@id='NLEScenarioComplete']\")).click();\r\n\t\t\t\t\t\t\t sleep(2000);\r\n\t\t\t\t\t\t }\r\n\t\t\t\t\t\t driver.findElement(By.xpath(\"//*[@id='NLEScenarioComplete']\")).click();\r\n\t\t\t\t\t\t sleep(2000);\r\n\t\t\t\t\t\t \r\n\t\t\t\t\t\t// driver.findElement(By.xpath(\".//*[@id='NLEScenarioComplete']\")).click();\r\n\t\t\t\t\t\tsleep(2000);\r\n\t\t\t\t\t\tclick(locator_split(\"tabnlesummary\"));\r\n\t\t\t\t\t//\tdriver.findElement(By.xpath(\"tabnlesummary\")).click();\r\n\t\t\t\t\t\tsleep(2000);\r\n\t\t\t\t\t\t if (driver.findElement(By.xpath(\".//*[@id='LECompletedFlag']\")).isSelected()== true ){\r\n\t\t\t\t\t\t\t driver.findElement(By.xpath(\"//input[@id='LECompletedFlag']\")).click();\r\n\t\t\t\t\t\t\t\tsleep(2000);\r\n\t\t\t\t\t\t }\r\n\t\t\t\t\t\tdriver.findElement(By.xpath(\"//input[@id='LECompletedFlag']\")).click();\r\n\t\t\t\t\t\tsleep(2000);\r\n\t\t\t\t\t\t if (driver.findElement(By.xpath(\".//*[@id='SectionCompleted']\")).isSelected()== true ){\r\n\t\t\t\t\t\t\t driver.findElement(By.xpath(\"//input[@id='SectionCompleted']\")).click();\r\n\t\t\t\t\t\t\t sleep(2000);\r\n\t\t\t\t\t\t }\r\n\t\t\t\t\t\tdriver.findElement(By.xpath(\"//input[@id='SectionCompleted']\")).click();\r\n\t\t\t\t\t\tsleep(2000);\r\n\t\t\t\t\t ///////////////Remaining tabs///////////////\r\n\t\t\t\t\t \r\n\t\t\t\t\t \r\n\t\t\t}\r\n////////////\r\n\t\r\n\t\t\tReporter.log(\"PASS_MESSAGE:- Report tab is clicked and user is logged in\");\r\n\t\t}\r\n\t\tcatch(Exception e){\r\n\t\t\tReporter.log(\"FAIL_MESSAGE:- Report tab is not clicked in\");\r\n\t\t\tthrow new NoSuchElementException(\"The element with\"\r\n\t\t\t\t\t+ elementProperties.getProperty(\"LoginLogout\")\r\n\t\t\t\t\t+ \" not found\");\r\n\r\n\t\t}\r\n\r\n\t}", "public static void main(String[] args) {\n\n\t\tScanner scn = new Scanner(System.in);\n\t\tint n = scn.nextInt();\n\t\tSystem.out.println(outcomes(n,\"\"));\n\t\tSystem.out.println(outcomesnoconsecutiveheads(n, \"\", false));\n\t\t\n\t\t\n\t\t\n\t}", "@Then(\"I land on controlgroup page\")\n public void i_land_on_controlgroup_page() {\n System.out.println(\"inside then\");\n }", "public IObserver applyScenario(IScenario scenario) throws ThinklabException;", "@Test\n\tpublic void testStep() {\n\t\tsimulator.step();\n\t\tassertEquals(0, (int)simulator.averageWaitTime());\n\t\tassertEquals(0, (int)simulator.averageProcessTime());\n\t\tassertEquals(false, simulator.packageLeftSimulation());\n\t\tassertEquals(0, simulator.getCurrentIndex());\n\t\tassertEquals(true, simulator.moreSteps());\n\n\t\tfor (int i = 0; i < 28; i++) {\n\t\t\tsimulator.step();\n\t\t}\n\t\tassertEquals(287, (int)(simulator.averageWaitTime() * 100));\n\t\tassertEquals(1525, (int)(100 * simulator.averageProcessTime()));\n\t\tassertEquals(false, simulator.packageLeftSimulation());\n\t\tassertEquals(0, simulator.getCurrentIndex());\n\t\tassertEquals(true, simulator.moreSteps());\n\t\t\n\t\tfor (int i = 0; i < 15; i++) {\n\t\t\tsimulator.step();\n\t\t}\n\t\tassertEquals(614, (int)(simulator.averageWaitTime() * 100));\n\t\tassertEquals(1457, (int)(100 * simulator.averageProcessTime()));\n\t\tassertEquals(true, simulator.packageLeftSimulation());\n\t\tassertEquals(0, simulator.getCurrentIndex());\n\t\tassertEquals(true, simulator.moreSteps());\n\t\tfor (int i = 0; i < 16; i++) {\n\t\t\tsimulator.step();\n\t\t}\n\t\tassertEquals(false, simulator.moreSteps());\t\n\t}", "@Given(\"prepare to Achieve arbitrary command execution through SQL Injection with the MSSQL_xp_cmdshell directive\")\npublic void preachievearbitrarycommandexecutionthroughsqlinjectionwiththemssqlxpcmdshelldirective(){\n}", "public String nextStep();", "public static void main (String[] args) {\n\n Config config = ConfigUtils.loadConfig(\"/home/gregor/git/matsim/examples/scenarios/pt-tutorial/0.config.xml\");\n// config.controler().setLastIteration(0);\n// config.plans().setHandlingOfPlansWithoutRoutingMode(PlansConfigGroup.HandlingOfPlansWithoutRoutingMode.useMainModeIdentifier);\n// Scenario scenario = ScenarioUtils.loadScenario(config);\n// Controler controler = new Controler(scenario);\n// controler.run();\n\n\n// Config config = this.utils.loadConfig(IOUtils.extendUrl(ExamplesUtils.getTestScenarioURL(\"pt-tutorial\"), \"0.config.xml\"));\n config.controler().setLastIteration(1);\n config.plans().setHandlingOfPlansWithoutRoutingMode(PlansConfigGroup.HandlingOfPlansWithoutRoutingMode.useMainModeIdentifier);\n\n\n// try {\n Controler controler = new Controler(config);\n// final EnterVehicleEventCounter enterVehicleEventCounter = new EnterVehicleEventCounter();\n// final StageActivityDurationChecker stageActivityDurationChecker = new StageActivityDurationChecker();\n// controler.addOverridingModule( new AbstractModule(){\n// @Override public void install() {\n// this.addEventHandlerBinding().toInstance( enterVehicleEventCounter );\n// this.addEventHandlerBinding().toInstance( stageActivityDurationChecker );\n// }\n// });\n controler.run();\n }", "@SuppressWarnings(\"unchecked\")\n @Test\n public void shouldReturnBeforeAndAfterStoryAnnotatedSteps() {\n CandidateSteps steps1 = mock(Steps.class);\n CandidateSteps steps2 = mock(Steps.class);\n Step stepBefore1 = mock(Step.class);\n Step stepBefore2 = mock(Step.class);\n Step stepAfter1 = mock(Step.class);\n Step stepAfter2 = mock(Step.class);\n\n boolean embeddedStory = false;\n when(steps1.runBeforeStory(embeddedStory)).thenReturn(asList(stepBefore1));\n when(steps2.runBeforeStory(embeddedStory)).thenReturn(asList(stepBefore2));\n when(steps1.runAfterStory(embeddedStory)).thenReturn(asList(stepAfter1));\n when(steps2.runAfterStory(embeddedStory)).thenReturn(asList(stepAfter2));\n\n // When we create the series of steps for the core\n MarkUnmatchedStepsAsPending stepCreator = new MarkUnmatchedStepsAsPending();\n List<Step> beforeSteps = stepCreator.createStepsFrom(asList(steps1, steps2), new Story(new Scenario()), Stage.BEFORE,\n embeddedStory);\n List<Step> afterSteps = stepCreator.createStepsFrom(asList(steps1, steps2), new Story(new Scenario()), Stage.AFTER,\n embeddedStory);\n\n // Then all before and after steps should be added\n ensureThat(beforeSteps, equalTo(asList(stepBefore1, stepBefore2)));\n ensureThat(afterSteps, equalTo(asList(stepAfter1, stepAfter2)));\n }", "public interface TestStepVisitor {\n\n /**\n * Handles email test step entity.\n *\n * @param emailTestStepEntity - email test step entity\n */\n default void visit(EmailTestStepEntity emailTestStepEntity) {\n throw new UnsupportedOperationException(\n String.format(\"Unsupported email step for request [%s]\",\n emailTestStepEntity.getEvaluationRequestEntity().getRequestId())\n );\n }\n\n /**\n * Handles experiment results test step entity.\n *\n * @param experimentResultsTestStepEntity - experiment results test step entity\n */\n default void visit(ExperimentResultsTestStepEntity experimentResultsTestStepEntity) {\n throw new UnsupportedOperationException(\n String.format(\"Unsupported experiment results step for request [%s]\",\n experimentResultsTestStepEntity.getEvaluationRequestEntity().getRequestId())\n );\n }\n\n /**\n * Handles evaluation results test step entity.\n *\n * @param evaluationResultsTestStepEntity - evaluation results test step entity\n */\n default void visit(EvaluationResultsTestStepEntity evaluationResultsTestStepEntity) {\n throw new UnsupportedOperationException(\n String.format(\"Unsupported evaluation results step for request [%s]\",\n evaluationResultsTestStepEntity.getEvaluationRequestEntity().getRequestId())\n );\n }\n}", "public static void beginStep() {\n\t\tTestNotify.log(STEP_SEPARATOR);\n\t TestNotify.log(GenLogTC() + \"is being tested ...\");\n\t}", "@Test\n\tpublic void test02_LikesunlikeYourActivities() {\n\t\tinfo(\"Test 2: Likes/unlike your activities\");\n\t\t/*Step Number: 1\n\t\t *Step Name: -\n\t\t *Step Description: \n\t\t\tStep 1: Add new activities\n\t\t *Input Data: \n\t\t\t- Sign in system\n\t\t\t- Select Activities page on User Toolbar portlet in the upper right corner of the screen\n\t\t\t- Select activity in the left pane\n\t\t\t- Enter some text into text box\n\t\t\t- Click on [Share] button\n\t\t *Expected Outcome: \n\t\t\tAdd an activity successfully:\n\t\t\t- This activity is added into users activities list.User who is in your contact, can view your active on his/her activity list*/\n\t\tString username1 = txData.getContentByArrayTypeRandom(4) + getRandomString();\n\t\tString email1 = username1+\"@gmail.com\";\n\t\tinfo(\"Add new user\");\n\t\tnavTool.goToAddUser();\n\t\taddUserPage.addUser(username1, password, email1, username1, username1);\n\t\tmagAc.signIn(username1,password);\n\t\tUtils.pause(3000);\n\n\t\tnavTool.goToMyActivities();\n\t\tString activity1 = txData.getContentByArrayTypeRandom(1)+getRandomNumber();\n\t\thpAct.addActivity(activity1, \"\");\n\t\t\n\t\t/*Step number: 2\n\t\t *Step Name: -\n\t\t *Step Description: \n\t\t\tStep 2: Like activity\n\t\t *Input Data: \n\t\t\t- Click on Like under activity\n\t\t *Expected Outcome: \n\t\t\tShow the message: “you like this”. Like link is change to Unlike link*/\n\t\thpAct.likeActivity(activity1);\n\t\t\n\t\t/*Step number: 3\n\t\t *Step Name: -\n\t\t *Step Description: \n\t\t\tStep 3: Unlike a activity\n\t\t *Input Data: \n\t\t\t- User who liked the activity logs in\n\t\t\t- Select the activity\n\t\t\t- Click on Unlike link\n\t\t *Expected Outcome: \n\t\t\tUser is moved out list of users like the activity. Unlike link is changed to Like link*/ \n\t\thpAct.unlikeActivity(activity1);\n\t}", "@Test(priority = 1, groups= {\"regression\",\"smoke\"})\r\n\tpublic void PrintHospitals()\r\n\t{\r\n\t\tlogger= report.createTest(\"Printing Hospitals as per requirement\");\r\n\t\tDisplayHospitalNames hp=Base.nextPage1();\r\n\t\thp.selectLocation();\r\n\t\thp.selectHospital();\r\n\t\thp.applyFilters();\r\n\t\thp.hospitals();\r\n\t\thp.Back();\r\n\t}", "public final void mT__19() throws RecognitionException {\n try {\n int _type = T__19;\n int _channel = DEFAULT_TOKEN_CHANNEL;\n // InternalCucumber.g:14:7: ( 'Scenario Outline:' )\n // InternalCucumber.g:14:9: 'Scenario Outline:'\n {\n match(\"Scenario Outline:\"); \n\n\n }\n\n state.type = _type;\n state.channel = _channel;\n }\n finally {\n }\n }", "@Given(\"prepare to Attempt sending crafted records to DNS cache\")\npublic void preattemptsendingcraftedrecordstodnscache(){\n}", "private S101() {\n\t\tsetType(RuleType.SCENARIO);\n\t}", "@Test(groups = { \"Interactive\" })\n public void troubleCases() {\n String defaultBlocks = \"[[1,1,1,\\\"Green\\\",[\\\"S\\\"]],[1,1,2,\\\"Green\\\",[]],[1,1,3,\\\"Green\\\",[]],[1,1,4,\\\"Green\\\",[]]]\";\n ContextValue context = getContext(defaultBlocks);\n LogInfo.begin_track(\"troubleCases\");\n runFormula(executor, \"(:s (: select *) (: select (or (call veryx top this) (call veryx bot this))))\", context,\n selectedSize(2));\n runFormula(executor, \" (: select (or (call veryx top (color green)) (call veryx bot (color green))))\", context,\n selectedSize(2));\n runFormula(executor, \" (: select (and (call veryx top (color green)) (call veryx bot (color green))))\", context,\n selectedSize(0));\n runFormula(executor, \" (: select (call adj top this))\", context, selectedSize(1));\n LogInfo.end_track();\n }", "@Test\n public void testPerformReverseStep_reverseThenAltAtInit() throws IOException {\n initializeTestWithModelPath(\"models/even_odd.als\");\n String dotString1 = String.join(\"\\n\",\n \"digraph graphname {\",\n \"\\tS1 -> S2\",\n \"\\tS2 -> S3\",\n \"\\tS3\",\n \"}\",\n \"\"\n );\n String dotString2 = String.join(\"\\n\",\n \"digraph graphname {\",\n \"\\tS1 -> S2\",\n \"\\tS2 -> S3\",\n \"\\tS3\",\n \"\\tS4\",\n \"}\",\n \"\"\n );\n String dotString3 = String.join(\"\\n\",\n \"digraph graphname {\",\n \"\\tS1 -> S2\",\n \"\\tS2 -> S3\",\n \"\\tS3\",\n \"\\tS4 -> S5\",\n \"\\tS5\",\n \"}\",\n \"\"\n );\n String state1 = String.join(\"\\n\",\n \"\",\n \"S1\",\n \"----\",\n \"i: { 0 }\",\n \"\"\n );\n String state2 = String.join(\"\\n\",\n \"\",\n \"S4\",\n \"----\",\n \"i: { 1 }\",\n \"\"\n );\n String state3 = String.join(\"\\n\",\n \"\",\n \"S5\",\n \"----\",\n \"i: { 3 }\",\n \"\"\n );\n String history = String.join(\"\\n\",\n \"\",\n \"S4 (-1)\",\n \"---------\",\n \"i: { 1 }\",\n \"\"\n );\n\n assertTrue(sm.initialize(modelFile, false));\n assertTrue(sm.performStep(2));\n sm.performReverseStep(2);\n assertEquals(state1, sm.getCurrentStateString());\n assertEquals(\"\", sm.getHistory(3));\n assertEquals(dotString1, sm.getDOTString());\n\n assertTrue(sm.selectAlternatePath(false));\n assertEquals(state2, sm.getCurrentStateString());\n assertEquals(\"\", sm.getHistory(3));\n assertEquals(dotString2, sm.getDOTString());\n\n assertTrue(sm.performStep(1));\n assertEquals(state3, sm.getCurrentStateString());\n assertEquals(history, sm.getHistory(3));\n assertEquals(dotString3, sm.getDOTString());\n }", "@Given(\"prepare to Determine application's/system's password policy\")\npublic void predetermineapplicationssystemspasswordpolicy(){\n}", "@Test\n void no_fall_through() {\n System.out.println(\"Result = \" + no_fall_through(\"TEST_1\"));\n System.out.println(\"Result = \" + no_fall_through(\"TEST_2\"));\n System.out.println(\"Result = \" + no_fall_through(\"TEST\"));\n }", "@Then(\"user inputs the answers of the questions as requirment information for GehaltsCheck\")\n public void user_inputs_the_answers_of_the_questions_as_requirment_information_for_GehaltsCheck() {\n throw new io.cucumber.java.PendingException();\n }", "void Step(String step);", "@MediumTest\n public void test_1314_2() throws Exception {\n String imagePath = Environment.getExternalStorageDirectory()+\"/LeCoder_Image/statement_without_prev.png\";\n //Load the file and process it\n activity.loadImageFile(imagePath);\n activity.processImage();\n //Generate the nodes and construct the graph\n activity.generateNodes();\n activity.generateGraph();\n //Print all nodes\n activity.printAllNodes();\n //Check whether the flowchart has no start point\n assertFalse(activity.checkAllNodes());\n }", "@Override\n\tpublic void step(int actionType) {\n\n\t}", "@Before\r\n\tpublic void beforeCucumber(Scenario sc)\r\n\t{\n\t\tstartResult();\r\n\r\n\t\t//Calling Before Class Method\r\n\t\ttestCaseName = sc.getName();\r\n\t\ttestCaseDescription =sc.getId();\r\n\t\tcategory = \"Smoke\";\r\n\t\tauthor= \"Babu\";\r\n\r\n\t\t//Calling Before Method\r\n\r\n\t\tstartTestCase();\r\n\r\n\t\t//Calling at test\r\n\r\n\t\tstartApp(\"chrome\",\"https://www.bankbazaar.com\");\r\n\r\n\t}", "@When(\"Try to Access & exfiltrate data within the victim's security zone\")\npublic void tryaccessexfiltratedatawithinthevictimssecurityzone(){\n}", "@Test\n public void testNoExecutionsSinceLastSample() throws IOException {\n tracker.takeSample(10); // Journal: IDLE\n\n NameContext step = createStep(\"A\");\n tracker.enter(step);\n tracker.takeSample(10); // Journal: IDLE A1\n tracker.takeSample(10); // Journal: A1\n\n tracker.exit();\n tracker.takeSample(10); // Journal: A1 IDLE\n assertThat(getCounterValue(step), equalTo(distribution(20)));\n\n tracker.takeSample(10); // Journal: IDLE\n assertThat(getCounterValue(step), equalTo(distribution(20)));\n }", "public abstract int getScenarioCount();", "@Test(description = \"Test to validate the EMI feature with different tenure and interest rate\", priority = 0)\n\tpublic void UserStory2() throws HeadlessException, AWTException, IOException, InterruptedException\n\t{\n\t\tLoanCalculatorPage loan_cal = new LoanCalculatorPage();\n\t\tloan_cal.validateCalHomePage();\n\t\t//testLog.log(Status.INFO, \"Loan calculator page launched\");\n\n\t\t\n\t\tint testCaseID = 3;\n\t\t\n\t\t//Enter the values in calculator and validate output\n\t\tloan_cal.ValidateDetails(loan_cal.GetEMI(testCaseID));\n\t\t\n\t}", "@Test\n public void functionalityTest() {\n new TestBuilder()\n .setModel(MODEL_PATH)\n .setContext(new ModelImplementationGroup3())\n .setPathGenerator(new RandomPath(new EdgeCoverage(100)))\n .setStart(\"e_GoToPage\")\n .execute();\n }", "@Override\r\n public void afterOriginalStep(TestCaseRunner testRunner, SecurityTestRunContext runContext,\r\n SecurityTestStepResult result) {\n\r\n }", "@Override\n public void act(AgentImp agent) {\n Coordinate coordinate = agent.generateRandomMove();\n if (coordinate != null)\n agent.step(coordinate.getX(), coordinate.getY());\n else\n agent.skip();\n }", "@Given(\"I will provide the data\")\r\n\tpublic void i_will_provide_the_data() {\n\t\tSystem.out.println(\"code for data\");\r\n\t}", "@Given(\"^User is on netbanking landing page$\")\r\n public void user_is_on_netbanking_landing_page() throws Throwable {\n System.out.println(\"Navigated to Login URL\");\r\n }", "@Override\n\tpublic void covidTreatment() {\n\tSystem.out.println(\"FH--covidTreatment\");\n\t\t\n\t}", "@Test(invocationCount=1,skipFailedInvocations=false)\n public void testDemo() throws TimeOut{\n \tMentalStateManager msmAgent1_0DeploymentUnitByType3=MSMRepository.getInstance().waitFor(\"Agent1_0DeploymentUnitByType3\");\n \t \t\t\t\n \t// wait for Agent1_0DeploymentUnitByType2 to initialise\n \tMentalStateManager msmAgent1_0DeploymentUnitByType2=MSMRepository.getInstance().waitFor(\"Agent1_0DeploymentUnitByType2\");\n \t \t\t\t\n \t// wait for Agent0_0DeploymentUnitByType1 to initialise\n \tMentalStateManager msmAgent0_0DeploymentUnitByType1=MSMRepository.getInstance().waitFor(\"Agent0_0DeploymentUnitByType1\");\n \t \t\t\t\n \t// wait for Agent0_0DeploymentUnitByType0 to initialise\n \tMentalStateManager msmAgent0_0DeploymentUnitByType0=MSMRepository.getInstance().waitFor(\"Agent0_0DeploymentUnitByType0\");\n \t\n \t\n \tGenericAutomata ga=null;\n \tga=new GenericAutomata();\n\t\t\t\n\t\t\tga.addInitialState(\"default_WFTestInitialState0\");\t\t\n\t\t\t\n\t\t\tga.addInitialState(\"default_WFTestInitialState1\");\t\t\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t\tga.addFinalState(\"WFTestFinalState0\");\t\t\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t\tga.addStateTransition(\"default_WFTestInitialState0\",\"Agent0_0DeploymentUnitByType0-Task0\",\"WFTestInitialState0\");\n\t\t\t\n\t\t\tga.addStateTransition(\"WFTestInitialState0\",\"Agent1_0DeploymentUnitByType2-Task1\",\"WFTestFinalState0\");\n\t\t\t\n\t\t\tga.addStateTransition(\"default_WFTestInitialState1\",\"Agent0_0DeploymentUnitByType1-Task0\",\"WFTestInitialState1\");\n\t\t\t\n\t\t\tga.addStateTransition(\"WFTestInitialState1\",\"Agent1_0DeploymentUnitByType2-Task1\",\"WFTestFinalState0\");\n\t\t\t\t\n\t\t\t\n\t\t\tTaskExecutionValidation tev=new TaskExecutionValidation(ga);\n \t\n \ttev.registerTask(\"Agent0_0DeploymentUnitByType0\",\"Task0\");\n \t\n \ttev.registerTask(\"Agent1_0DeploymentUnitByType2\",\"Task1\");\n \t\n \ttev.registerTask(\"Agent0_0DeploymentUnitByType1\",\"Task0\");\n \t\n \ttev.registerTask(\"Agent1_0DeploymentUnitByType2\",\"Task1\");\n \t\t\n \t\t\n \tRetrieveExecutionData cwfe=new \tRetrieveExecutionData();\n \tEventManager.getInstance().register(cwfe);\n\t\tlong step=100;\n\t\tlong currentTime=0;\n\t\tlong finishedTime=0;\n\t\tlong duration=2000;\n\t\tlong maxtimepercycle=2000;\n\t\t \n\t\tMainInteractionManager.goAutomatic(); // tells the agents to start working\t\t\t\n\t\twhile (currentTime<finishedTime){\n\t\t\t\ttry {\n\t\t\t\t\tThread.currentThread().sleep(step);\n\t\t\t\t\t\n\t\t\t\t} catch (InterruptedException e) {\t\t\t\t\t\n\t\t\t\t\te.printStackTrace();\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tcurrentTime=currentTime+step;\n\t\t\t}\n\t\t\t\n\t\t\tif (currentTime<duration){\n\t\t\t\tTestUtils.doNothing(duration-currentTime); // waits for tasks to execute\t\n\t\t\t}\n\t\t\t\t\t\n\t\t\t\n\t\t\tMainInteractionManager.goManual(); // now it commands to not execute more tasks\t\t\n\t\t\tEventManager.getInstance().unregister(cwfe);\n\t\t\t\n\t\t Vector<String> counterExamples=tev.validatePartialTermination(cwfe,ga,maxtimepercycle);\n\t\t assertTrue(\"The execution does not match the expected sequences. I found the following counter examples \"+counterExamples,counterExamples.isEmpty());\t\t\n\t\t\t\t\t\t\t\n }", "@Before\n public void setUp(Scenario scenario){\n DriverFactory.getDriver().manage().window().maximize();\n }", "@Test\n\tpublic void testStageProceed() {\n\t\t\n\t\tSystem.out.println(\"\\nTest case : Next stage\");\n\t\t\n\t\tStageScene test = new StageScene() ;\n\t\t\n\t\tassertEquals(0 , StageScene.stageCompleted) ;\n\t\t\n\t\tSystem.out.println(\"Before frog reach stage 1's goal :\") ;\n\t\tSystem.out.println(\"end : \" + StageScene.stageCompleted);\n\t\t\n\t\tGoal goal1 = new Goal(10,105) ;\n\t\t\n\t\tAnimal animal = new Animal(\"file:Resources/Frog/frogUp1.png\") ;\n\t\tanimal.setX(10) ;\n\t\tanimal.setY(105) ;\n\t\t\n\t\ttest.add(goal1) ;\n\t\ttest.add(animal) ;\n\t\t\n\t\tanimal.act(0);\n\t\t\n\t\ttest.createStageTimer();\n\t\t\n\t\tassertEquals(1 , StageScene.stageCompleted) ;\n\t\t\n\t\tSystem.out.println(\"After frog reached stage 1's goal :\") ;\n\t\tSystem.out.println(\"end : \" + StageScene.stageCompleted);\n\t\tSystem.out.println(\"Stage 1 is completed , proceed to stage 2\") ;\n\t\n\t\t\n\t\t\n\t\tSystem.out.println(\"Before frog reach stage 2's goal :\") ;\n\t\tSystem.out.println(\"end : \" + StageScene.stageCompleted);\n\t\t\n\t\tGoal goal2 = new Goal(140,105) ;\n\t\t\n\t\tanimal.setX(140) ;\n\t\tanimal.setY(105) ;\n\t\t\n\t\ttest.add(goal2);\n\t\t\n\t\tanimal.act(0);\n\t\t\n\t\tassertEquals(2 , StageScene.stageCompleted) ;\n\t\t\n\t\tSystem.out.println(\"After frog reached stage 2's goal :\") ;\n\t\tSystem.out.println(\"end : \" + StageScene.stageCompleted);\n\t\tSystem.out.println(\"Stage 2 is completed , proceed to stage 3\") ;\n\t\n\t\t\n\t\t\n\t\tSystem.out.println(\"Before frog reach stage 3's goal :\") ;\n\t\tSystem.out.println(\"end : \" + StageScene.stageCompleted);\n\t\t\n\t\tGoal goal3 = new Goal(265,105) ;\n\t\t\n\t\tanimal.setX(265) ;\n\t\tanimal.setY(105) ;\n\t\t\n\t\ttest.add(goal3);\n\t\t\n\t\tanimal.act(0);\n\t\t\n\t\tassertEquals(3 , StageScene.stageCompleted) ;\n\t\t\n\t\tSystem.out.println(\"After frog reached stage 3's goal :\") ;\n\t\tSystem.out.println(\"end : \" + StageScene.stageCompleted);\n\t\tSystem.out.println(\"Stage 3 is completed , proceed to stage 4\") ;\n\t\t\n\t\t\n\t\t\n\t\tSystem.out.println(\"Before frog reach stage 4's goal :\") ;\n\t\tSystem.out.println(\"end : \" + StageScene.stageCompleted);\n\t\t\n\t\tGoal goal4 = new Goal(393,105) ;\n\t\t\n\t\tanimal.setX(393) ;\n\t\tanimal.setY(105) ;\n\t\t\n\t\ttest.add(goal4);\n\t\t\n\t\tanimal.act(0);\n\t\t\n\t\tassertEquals(4 , StageScene.stageCompleted) ;\n\t\t\n\t\tSystem.out.println(\"After frog reached stage 4's goal :\") ;\n\t\tSystem.out.println(\"end : \" + StageScene.stageCompleted);\n\t\tSystem.out.println(\"Stage 4 is completed , proceed to stage 5\") ;\n\t\t\n\t\t\n\t\t\n\t\tSystem.out.println(\"Before frog reach stage 5's goal :\") ;\n\t\tSystem.out.println(\"end : \" + StageScene.stageCompleted);\n\t\t\n\t\tGoal goal5 = new Goal(520,105) ;\n\t\t\n\t\tanimal.setX(520) ;\n\t\tanimal.setY(105) ;\n\t\t\n\t\ttest.add(goal5);\n\t\t\n\t\tanimal.act(0);\n\t\t\n\t\tassertEquals(5 , StageScene.stageCompleted) ;\n\t\t\n\t\tSystem.out.println(\"After frog reached stage 5's goal :\") ;\n\t\tSystem.out.println(\"end : \" + StageScene.stageCompleted);\n\t\tSystem.out.println(\"Stage 5 is completed , end game\") ;\n\t}", "public interface NormalStep extends Step { // <-- [user code injected with eMoflon]\n\n\t// [user code injected with eMoflon] -->\n}", "@Test\r\n\tpublic void testShowStandings1() {\n\t\tassertTrue(\"Error displaying standings\", false);\r\n\t}", "@Test\n public void testNormalCase() {\n addCard(Zone.BATTLEFIELD, playerA, \"Mountain\", 1);\n addCard(Zone.HAND, playerA, \"Lightning Bolt\");\n addCard(Zone.BATTLEFIELD, playerB, \"Dryad Militant\");\n\n\n castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, \"Lightning Bolt\", playerB);\n setStopAt(1, PhaseStep.BEGIN_COMBAT);\n execute();\n \n assertLife(playerB, 17);\n assertExileCount(\"Lightning Bolt\", 1);\n }", "@AfterAll\n public void tearDownScenario(Scenario scenario) {\n if (scenario.isFailed()) {\n byte[] screenShot = ((TakesScreenshot) Driver.get()).getScreenshotAs(OutputType.BYTES);\n scenario.attach(screenShot, \"image/png\", scenario.getName());\n }\n //System.out.println(\"After annotation from Hooks is in action\");\n Driver.closeDriver();\n }", "@Test\n public void testRun_DecisionWithEquals_IN_A1_D_A2_FN() {\n // Final node creation\n final Node fn = NodeFactory.createNode(\"#6\", NodeType.FINAL);\n\n // Action node 3 (id #5) creation and flow set to final node\n final String A3_ID = \"#5\";\n final Node an3 = NodeFactory.createNode(A3_ID, NodeType.ACTION);\n final ExecutableActionMock objAn3 = ExecutableActionMock.create(KEY, A3_ID);\n ((ContextExecutable) an3).setObject(objAn3);\n ((ContextExecutable) an3).setMethod(objAn3.getPutIdInContextMethod());\n ((SingleControlFlowNode) an3).setFlow(fn);\n\n // Action node 2 (id #4) creation and flow set to final node\n final String A2_ID = \"#4\";\n final Node an2 = NodeFactory.createNode(A2_ID, NodeType.ACTION);\n final ExecutableActionMock objAn2 = ExecutableActionMock.create(KEY, A2_ID);\n ((ContextExecutable) an2).setObject(objAn2);\n ((ContextExecutable) an2).setMethod(objAn2.getPutIdInContextMethod());\n ((SingleControlFlowNode) an2).setFlow(fn);\n\n final String A1_KEY = \"a1_key\";\n final String A1_ID = \"#2\";\n\n // Decision node (id #3) creation\n final Node dn = NodeFactory.createNode(\"#3\", NodeType.DECISION);\n // Flow control from decision to action node 2 (if KEY == #2 goto A2)\n Map<FlowCondition, Node> flows = new HashMap<>(1);\n final FlowCondition fc2a2 = new FlowCondition(A1_KEY, ConditionType.EQ, A1_ID);\n flows.put(fc2a2, an2);\n // Otherwise, goto A3\n ((ConditionalControlFlowNode) dn).setFlows(flows, an3);\n\n // Action node 1 (id #2) creation. Sets the context to be used by the decision\n final Node an1 = NodeFactory.createNode(A1_ID, NodeType.ACTION);\n final ExecutableActionMock objAn1 = ExecutableActionMock.create(A1_KEY, A1_ID);\n ((ContextExecutable) an1).setObject(objAn1);\n ((ContextExecutable) an1).setMethod(objAn1.getPutIdInContextMethod());\n ((SingleControlFlowNode) an1).setFlow(dn);\n\n // Initial node (id #1) creation and flow set to action node 1\n final Node iNode = NodeFactory.createNode(\"#1\", NodeType.INITIAL);\n ((SingleControlFlowNode) iNode).setFlow(an1);\n\n final Jk4flowWorkflow wf = Jk4flowWorkflow.create(iNode);\n\n ENGINE.run(wf);\n\n Assert.assertEquals(A2_ID, wf.getContext().get(KEY));\n }" ]
[ "0.6967509", "0.66436493", "0.6543057", "0.65153295", "0.63684094", "0.6354681", "0.6314911", "0.61634755", "0.61576194", "0.6154193", "0.6142738", "0.60972106", "0.60972106", "0.6048274", "0.6048274", "0.59695566", "0.5938793", "0.593402", "0.59242296", "0.5922221", "0.59195495", "0.59195495", "0.5870984", "0.58515793", "0.5762991", "0.57629657", "0.56953084", "0.5691884", "0.56892574", "0.568678", "0.5679425", "0.5661359", "0.56580347", "0.5626117", "0.5622994", "0.56045604", "0.5583863", "0.55799675", "0.55593884", "0.5547773", "0.55418485", "0.5530089", "0.5527009", "0.55249417", "0.55114555", "0.55063766", "0.55054426", "0.55027807", "0.54757476", "0.544498", "0.54384965", "0.5430982", "0.5414284", "0.5405794", "0.5399097", "0.53983366", "0.5386408", "0.53794837", "0.53774977", "0.53629786", "0.5357358", "0.53563535", "0.53482014", "0.5342839", "0.5342044", "0.5332193", "0.53316265", "0.5329634", "0.5325372", "0.5320808", "0.5318312", "0.5312505", "0.5312345", "0.5306146", "0.5305835", "0.529841", "0.5294694", "0.52928257", "0.52821004", "0.5277069", "0.5267742", "0.52635044", "0.5263064", "0.52626604", "0.52509403", "0.5243878", "0.5243115", "0.52418727", "0.5241387", "0.52405715", "0.5238186", "0.5230983", "0.52296424", "0.5225988", "0.52249473", "0.52243125", "0.5219863", "0.52196777", "0.52195257", "0.5216666", "0.5216092" ]
0.0
-1
Scenario Outline: Alternative Flow
@Given("a todo with the title {string}, done status {string}, description {string} and category {string}") public void aTodoWithTheTitleDoneStatusDescriptionAndCategory(String title, String doneStatus, String description, String priority) throws IOException { JSONObject todo = new JSONObject(); todo.put("title", title); boolean status = false; if (doneStatus.equals("true")){ status = true; } todo.put("doneStatus", status); todo.put("description", description); String validID = "/todos"; try { TodoInstance.post(validID,todo.toString()); } catch (IOException e) { error = true; } try { Thread.sleep(200); } catch (InterruptedException e) { error = true; } JSONObject pResponse = TodoInstance.send("GET", "/categories?title=" + priority); String pID = pResponse.getJSONArray("categories").getJSONObject(0).getString("id"); JSONObject tResponse = TodoInstance.send("GET", "/todos?title=" + title); String tID = tResponse.getJSONArray("todos").getJSONObject(0).getString("id"); JSONObject body = new JSONObject(); body.put("id", pID); TodoInstance.post("/todos/" + tID + "/categories", body.toString()); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\n public void scenario(gherkin.formatter.model.Scenario scenario) {\n }", "@Given(\"I come in to the bar\")\r\n public void i_come_in_to_the_bar() {\n System.out.println(\"@Given: Entro al bar\");\r\n //throw new io.cucumber.java.PendingException();\r\n }", "@Given(\"prepare to Analysis\")\npublic void preanalysis(){\n}", "@Test (priority = 4)\n\t@Then(\"^End of Scenario$\")\n\tpublic void end_of_Scenario() throws Throwable {\n\t \n\t}", "@Test(priority = 75)\r\n@Epic(\"BILLS PAYMENT\")\r\n@Features(value = { @Feature(value = \"BUY GOODS USING MPESA\") })\r\n@Step (\"END OF BUY GOODS USING MPESA TILL TESTCASES\")\r\n@Severity(SeverityLevel.TRIVIAL)\r\npublic void End_Buy_Goods_Using_MPESA_Test_cases() {\n\tSystem.out.println(\"*************************End of buy Goods Using Mpesa Test cases***********************************\");\r\n\r\n}", "@Given(\"prepare to Access & exfiltrate data within the victim's security zone\")\npublic void preaccessexfiltratedatawithinthevictimssecurityzone(){\n}", "@Test(priority = 66)\r\n@Epic(\"BILLS PAYMENT\")\r\n@Features(value = { @Feature(value = \"BUY GOODS USING MPESA\") })\r\n@Step (\"BUY GOODS USING MPESA\")\r\n@Severity(SeverityLevel.TRIVIAL)\r\npublic void Buy_Goods_Using_MPESA_Test_cases() {\n\tSystem.out.println(\"BUY GOODS AND SERVICES\");\t\r\n\tSystem.out.println(\"*************************(1)Running Buy Goods Using MPESA Testcases***********************************\");\r\n\r\n}", "@Given(\"prepare to Attempt well-known or guessable resource locations\")\npublic void preattemptwellknownorguessableresourcelocations(){\n}", "@Test\n void shouldExpandDifferentSeverities() {\n WorkflowJob job = createPipelineWithWorkspaceFilesWithSuffix(\"all-severities.xml\");\n\n job.setDefinition(new CpsFlowDefinition(\"node {\\n\"\n + \" stage ('Integration Test') {\\n\"\n + \" recordIssues tool: checkStyle(pattern: '**/\" + \"all-severities\" + \"*')\\n\"\n + \" def total = tm('${ANALYSIS_ISSUES_COUNT}')\\n\"\n + \" def error = tm('${ANALYSIS_ISSUES_COUNT, type=\\\"TOTAL_ERROR\\\"}')\\n\"\n + \" def high = tm('${ANALYSIS_ISSUES_COUNT, type=\\\"TOTAL_HIGH\\\"}')\\n\"\n + \" def normal = tm('${ANALYSIS_ISSUES_COUNT, type=\\\"TOTAL_NORMAL\\\"}')\\n\"\n + \" def low = tm('${ANALYSIS_ISSUES_COUNT, type=\\\"TOTAL_LOW\\\"}')\\n\"\n + \" echo '[total=' + total + ']' \\n\"\n + \" echo '[error=' + error + ']' \\n\"\n + \" echo '[high=' + high + ']' \\n\"\n + \" echo '[normal=' + normal + ']' \\n\"\n + \" echo '[low=' + low + ']' \\n\"\n + \" }\\n\"\n + \"}\", true));\n\n AnalysisResult baseline = scheduleBuildAndAssertStatus(job, Result.SUCCESS);\n\n assertThat(baseline).hasTotalSize(3);\n\n assertThat(baseline).hasTotalHighPrioritySize(0);\n assertThat(baseline).hasTotalErrorsSize(1);\n assertThat(baseline).hasTotalNormalPrioritySize(1);\n assertThat(baseline).hasTotalLowPrioritySize(1);\n\n assertThat(getConsoleLog(baseline)).contains(\"[total=\" + 3 + \"]\");\n\n assertThat(getConsoleLog(baseline)).contains(\"[error=\" + 1 + \"]\");\n assertThat(getConsoleLog(baseline)).contains(\"[high=\" + 0 + \"]\");\n assertThat(getConsoleLog(baseline)).contains(\"[normal=\" + 1 + \"]\");\n assertThat(getConsoleLog(baseline)).contains(\"[low=\" + 1 + \"]\");\n }", "@When(\"Try to Analysis\")\npublic void tryanalysis(){\n}", "@Then(\"troubleshooting chart steps are displaying\")\n public void troubleshooting_chart_steps_are_displaying() {\n }", "@Test\n public void testRun_DecisionOtherwise_IN_A1_D_A3_FN() {\n // Final node creation\n final Node fn = NodeFactory.createNode(\"#6\", NodeType.FINAL);\n\n // Action node 3 (id #5) creation and flow to final node\n final String A3_ID = \"#5\";\n final Node an3 = NodeFactory.createNode(A3_ID, NodeType.ACTION);\n final ExecutableActionMock objAn3 = ExecutableActionMock.create(KEY, A3_ID);\n ((ContextExecutable) an3).setObject(objAn3);\n ((ContextExecutable) an3).setMethod(objAn3.getPutIdInContextMethod());\n ((SingleControlFlowNode) an3).setFlow(fn);\n\n // Action node 2 (id #4) creation and flow to final node\n final String A2_ID = \"#4\";\n final Node an2 = NodeFactory.createNode(A2_ID, NodeType.ACTION);\n final ExecutableActionMock objAn2 = ExecutableActionMock.create(KEY, A2_ID);\n ((ContextExecutable) an2).setObject(objAn2);\n ((ContextExecutable) an2).setMethod(objAn2.getPutIdInContextMethod());\n ((SingleControlFlowNode) an2).setFlow(fn);\n\n final String A1_KEY = \"a1_key\";\n final String A1_ID = \"#2\";\n\n // Decision node (id #3) creation\n final Node dNode = NodeFactory.createNode(\"#3\", NodeType.DECISION);\n // Flow control from decision to action node 2 (if KEY == #2 goto A2)\n Map<FlowCondition, Node> flows = new HashMap<>(1);\n final FlowCondition fc2a2 = new FlowCondition(A1_KEY, ConditionType.EQ, \"ANYTHING WRONG\");\n flows.put(fc2a2, an2);\n // Otherwise, goto A3\n ((ConditionalControlFlowNode) dNode).setFlows(flows, an3);\n\n // Action node 1 (id #2) creation. Sets the context to be used by the decision\n final Node an1 = NodeFactory.createNode(A1_ID, NodeType.ACTION);\n final ExecutableActionMock objAn1 = ExecutableActionMock.create(A1_KEY, A1_ID);\n ((ContextExecutable) an1).setObject(objAn1);\n ((ContextExecutable) an1).setMethod(objAn1.getPutIdInContextMethod());\n ((SingleControlFlowNode) an1).setFlow(dNode);\n\n // Initial node (id #1) creation and flow to action node 1\n final Node iNode = NodeFactory.createNode(\"#1\", NodeType.INITIAL);\n ((SingleControlFlowNode) iNode).setFlow(an1);\n\n final Jk4flowWorkflow wf = Jk4flowWorkflow.create(iNode);\n\n ENGINE.run(wf);\n\n Assert.assertEquals(A3_ID, wf.getContext().get(KEY));\n }", "public static void enterFixtureOutcome()\n\t{\n\t}", "@Before\n public void beforeScenario() {\n }", "TeststepBlock createTeststepBlock();", "@Given(\"^I am in Given$\")\n public void i_am_in_Given() throws Throwable {\n System.out.println(\"in given\");\n }", "public AlternativeFlowTest(String name) {\n\t\tsuper(name);\n\t}", "@Override\n\tpublic void step2() {\n\t\t\n\t}", "@Given(\"^Login to simplilearn$\")\r\n\tpublic void Login_to_simplilearn () throws Throwable\r\n\t{\n\t\t\r\n\t\tSystem.out.println(\" TC002 - Step 1 is passed\");\r\n\t\t\r\n\t}", "@Override\n\tpublic void step() {\n\t\t\n\t}", "@Override\n\tpublic void step() {\n\t\t\n\t}", "@Then(\"I greet then\")\r\n public void i_greet_then() {\n System.out.println(\"@Then: Los saludo\");\r\n //throw new io.cucumber.java.PendingException();\r\n }", "@Override\n\tpublic void step() {\n\t}", "@Override\n\tpublic void step() {\n\t}", "@When(\"I find people\")\r\n public void i_find_people() {\n System.out.println(\"@When: Encuentro Gente\");\r\n //throw new io.cucumber.java.PendingException();\r\n }", "public interface TestStepVisitor {\n\n /**\n * Handles email test step entity.\n *\n * @param emailTestStepEntity - email test step entity\n */\n default void visit(EmailTestStepEntity emailTestStepEntity) {\n throw new UnsupportedOperationException(\n String.format(\"Unsupported email step for request [%s]\",\n emailTestStepEntity.getEvaluationRequestEntity().getRequestId())\n );\n }\n\n /**\n * Handles experiment results test step entity.\n *\n * @param experimentResultsTestStepEntity - experiment results test step entity\n */\n default void visit(ExperimentResultsTestStepEntity experimentResultsTestStepEntity) {\n throw new UnsupportedOperationException(\n String.format(\"Unsupported experiment results step for request [%s]\",\n experimentResultsTestStepEntity.getEvaluationRequestEntity().getRequestId())\n );\n }\n\n /**\n * Handles evaluation results test step entity.\n *\n * @param evaluationResultsTestStepEntity - evaluation results test step entity\n */\n default void visit(EvaluationResultsTestStepEntity evaluationResultsTestStepEntity) {\n throw new UnsupportedOperationException(\n String.format(\"Unsupported evaluation results step for request [%s]\",\n evaluationResultsTestStepEntity.getEvaluationRequestEntity().getRequestId())\n );\n }\n}", "@Given(\"User is on google home page\")\npublic void user_is_on_google_home_page() {\n System.out.println(\"Given-Homepage\");\n}", "public void step();", "public void step();", "@Test(groups = { \"Interactive\" })\n public void troubleCases() {\n String defaultBlocks = \"[[1,1,1,\\\"Green\\\",[\\\"S\\\"]],[1,1,2,\\\"Green\\\",[]],[1,1,3,\\\"Green\\\",[]],[1,1,4,\\\"Green\\\",[]]]\";\n ContextValue context = getContext(defaultBlocks);\n LogInfo.begin_track(\"troubleCases\");\n runFormula(executor, \"(:s (: select *) (: select (or (call veryx top this) (call veryx bot this))))\", context,\n selectedSize(2));\n runFormula(executor, \" (: select (or (call veryx top (color green)) (call veryx bot (color green))))\", context,\n selectedSize(2));\n runFormula(executor, \" (: select (and (call veryx top (color green)) (call veryx bot (color green))))\", context,\n selectedSize(0));\n runFormula(executor, \" (: select (call adj top this))\", context, selectedSize(1));\n LogInfo.end_track();\n }", "@Test\n public void testRun_DecisionWithEquals_IN_A1_D_A2_FN() {\n // Final node creation\n final Node fn = NodeFactory.createNode(\"#6\", NodeType.FINAL);\n\n // Action node 3 (id #5) creation and flow set to final node\n final String A3_ID = \"#5\";\n final Node an3 = NodeFactory.createNode(A3_ID, NodeType.ACTION);\n final ExecutableActionMock objAn3 = ExecutableActionMock.create(KEY, A3_ID);\n ((ContextExecutable) an3).setObject(objAn3);\n ((ContextExecutable) an3).setMethod(objAn3.getPutIdInContextMethod());\n ((SingleControlFlowNode) an3).setFlow(fn);\n\n // Action node 2 (id #4) creation and flow set to final node\n final String A2_ID = \"#4\";\n final Node an2 = NodeFactory.createNode(A2_ID, NodeType.ACTION);\n final ExecutableActionMock objAn2 = ExecutableActionMock.create(KEY, A2_ID);\n ((ContextExecutable) an2).setObject(objAn2);\n ((ContextExecutable) an2).setMethod(objAn2.getPutIdInContextMethod());\n ((SingleControlFlowNode) an2).setFlow(fn);\n\n final String A1_KEY = \"a1_key\";\n final String A1_ID = \"#2\";\n\n // Decision node (id #3) creation\n final Node dn = NodeFactory.createNode(\"#3\", NodeType.DECISION);\n // Flow control from decision to action node 2 (if KEY == #2 goto A2)\n Map<FlowCondition, Node> flows = new HashMap<>(1);\n final FlowCondition fc2a2 = new FlowCondition(A1_KEY, ConditionType.EQ, A1_ID);\n flows.put(fc2a2, an2);\n // Otherwise, goto A3\n ((ConditionalControlFlowNode) dn).setFlows(flows, an3);\n\n // Action node 1 (id #2) creation. Sets the context to be used by the decision\n final Node an1 = NodeFactory.createNode(A1_ID, NodeType.ACTION);\n final ExecutableActionMock objAn1 = ExecutableActionMock.create(A1_KEY, A1_ID);\n ((ContextExecutable) an1).setObject(objAn1);\n ((ContextExecutable) an1).setMethod(objAn1.getPutIdInContextMethod());\n ((SingleControlFlowNode) an1).setFlow(dn);\n\n // Initial node (id #1) creation and flow set to action node 1\n final Node iNode = NodeFactory.createNode(\"#1\", NodeType.INITIAL);\n ((SingleControlFlowNode) iNode).setFlow(an1);\n\n final Jk4flowWorkflow wf = Jk4flowWorkflow.create(iNode);\n\n ENGINE.run(wf);\n\n Assert.assertEquals(A2_ID, wf.getContext().get(KEY));\n }", "@Given(\"^user is into website$\")\n public void userIsIntoWebsite() {\n }", "@Given(\"prepare to Attempt sending crafted records to DNS cache\")\npublic void preattemptsendingcraftedrecordstodnscache(){\n}", "@Test\n void no_fall_through() {\n System.out.println(\"Result = \" + no_fall_through(\"TEST_1\"));\n System.out.println(\"Result = \" + no_fall_through(\"TEST_2\"));\n System.out.println(\"Result = \" + no_fall_through(\"TEST\"));\n }", "protected void runBeforeStep() {}", "@Then(\"user inputs the answers of the questions as requirment information for GehaltsCheck\")\n public void user_inputs_the_answers_of_the_questions_as_requirment_information_for_GehaltsCheck() {\n throw new io.cucumber.java.PendingException();\n }", "@Then(\"Assert the success of Analysis\")\npublic void assanalysis(){\n}", "private void runOneStepInScenario(HttpServletRequest request, HttpServletResponse response) throws InterruptedException, QueryExecutionException, IOException {\n String ifNextTick = SimApi.ifNextTick();\n if (!\"false\".equals(ifNextTick)) {\n SimApi.nextTick();\n response.getWriter().write(ifNextTick);\n } else {\n response.getWriter().write(\"false\");\n }\n }", "@Given(\"I will provide the data\")\r\n\tpublic void i_will_provide_the_data() {\n\t\tSystem.out.println(\"code for data\");\r\n\t}", "boolean nextStep();", "@Test\n public void testLogicStep_1()\n throws Exception {\n LogicStep result = new LogicStep();\n assertNotNull(result);\n }", "@Given(\"^User should be navigated to the ELEARNING UPSKILL URL$\")\npublic void user_should_be_navigated_to_the_ELEARNING_UPSKILL_URL() throws Throwable \n{\n\tdriver.manage().window().maximize();\n driver.manage().timeouts().implicitlyWait(30, TimeUnit.SECONDS);\n\tdriver.get(\"http://elearningm1.upskills.in/\");\n\tThread.sleep(100); \n\tSystem.out.println(\"User is successfully navigated to ELEARNING UPSKILL screen\");\n\t\n \n}", "@Then(\"Assert the success of Attempt well-known or guessable resource locations\")\npublic void assattemptwellknownorguessableresourcelocations(){\n}", "abstract int steps();", "@TestProperties(name=\"test scenario run mode stability\")\n\tpublic void testAddTestToScenarioEndInRunmode4() throws Exception{\n\t\tjsystem.setJSystemProperty(FrameworkOptions.RUN_MODE, RunMode.DROP_EVERY_SCENARIO.toString());\n\t\tjsystem.launch();\n\t\t//create a folder under default Scenarios folder named \"addTestToSubScenarioBug\" and inside it create\n\t\t//a scenario called child and one calld master\n\t\tScenarioUtils.createAndCleanScenario(jsystem,\"addTestToSubScenarioBug\"+File.separator+\"child\");\n\t\tScenarioUtils.createAndCleanScenario(jsystem,\"addTestToSubScenarioBug\"+File.separator+\"master\");\n\t\t\n\t\t//after adding the master to tree, add the child scenario\n\t\tjsystem.addTest(\"child\",\"addTestToSubScenarioBug\", true);\n\t\t\n\t\tjsystem.addTest(1,\"testShouldPass\", \"GenericBasic\", true);\n\t\tjsystem.addTest(2,\"testShouldPass\", \"GenericBasic\", true);\n\t\tjsystem.addTest(3,\"testShouldPass\", \"GenericBasic\", true);\n\t\tjsystem.play();\n\t\tjsystem.waitForRunEnd();\n\t\tjsystem.checkNumberOfTestsPass(3);\n\t\tjsystem.checkNumberOfTestExecuted(3);\n\t\tjsystem.addTest(\"testShouldPass\", \"GenericBasic\", true);\n\t\tjsystem.addTest(\"testShouldPass\", \"GenericBasic\", true);\n\t\tjsystem.initReporters();\n\t\tjsystem.play();\n\t\tjsystem.waitForRunEnd();\n\t\t//check that run mode doesn't interfere with correct program run\n\t\t//still all test will pass even though it's a run mode to change jvm\n\t\t//on each scenario\n\t\tjsystem.checkNumberOfTestsPass(5);\n\t\tjsystem.checkNumberOfTestExecuted(5);\n\n\t}", "@Given(\"prepare to Determine application's/system's password policy\")\npublic void predetermineapplicationssystemspasswordpolicy(){\n}", "@Test(expected = Exception.class)\n public void testDescMixedContext() throws Throwable\n {\n testDescDeployment(\"mixed\");\n }", "protected abstract R runStep();", "@Test\n public void baseCommandTests_part2() throws Exception {\n ExecutionSummary executionSummary = testViaExcel(\"unitTest_base_part2.xlsx\");\n assertPassFail(executionSummary, \"crypto\", TestOutcomeStats.allPassed());\n assertPassFail(executionSummary, \"macro-test\", TestOutcomeStats.allPassed());\n assertPassFail(executionSummary, \"repeat-test\", TestOutcomeStats.allPassed());\n assertPassFail(executionSummary, \"expression-test\", TestOutcomeStats.allPassed());\n assertPassFail(executionSummary, \"multi-scenario2\", TestOutcomeStats.allPassed());\n assertPassFail(executionSummary, \"flow_controls\", new TestOutcomeStats(2, 14));\n }", "@Given(\"prepare to Achieve arbitrary command execution through SQL Injection with the MSSQL_xp_cmdshell directive\")\npublic void preachievearbitrarycommandexecutionthroughsqlinjectionwiththemssqlxpcmdshelldirective(){\n}", "public interface Scenarios {\n void runTrafficLightCycle();\n String getLog();\n}", "java.lang.String getNextStep();", "@Then(\"Assert the success of Access & exfiltrate data within the victim's security zone\")\npublic void assaccessexfiltratedatawithinthevictimssecurityzone(){\n}", "public interface MainFillingStep {\n CheeseStep meat(String meat);\n\n VegetableStep fish(String fish);\n }", "public abstract void performStep();", "public String nextStep();", "@When(\"Try to Access & exfiltrate data within the victim's security zone\")\npublic void tryaccessexfiltratedatawithinthevictimssecurityzone(){\n}", "@Test\n public void testElementsTrackedIndividuallyForAStep() throws IOException {\n NameContext stepA = createStep(\"A\");\n NameContext stepB = createStep(\"B\");\n\n tracker.enter(stepA);\n tracker.enter(stepB);\n tracker.exit();\n tracker.enter(stepB);\n tracker.exit();\n tracker.exit();\n // Expected journal: IDLE A1 B1 A1 B2 A1 IDLE\n\n tracker.takeSample(70);\n assertThat(getCounterValue(stepA), equalTo(distribution(30)));\n assertThat(getCounterValue(stepB), equalTo(distribution(10, 10)));\n }", "@Test\n\tpublic void test02_LikesunlikeYourActivities() {\n\t\tinfo(\"Test 2: Likes/unlike your activities\");\n\t\t/*Step Number: 1\n\t\t *Step Name: -\n\t\t *Step Description: \n\t\t\tStep 1: Add new activities\n\t\t *Input Data: \n\t\t\t- Sign in system\n\t\t\t- Select Activities page on User Toolbar portlet in the upper right corner of the screen\n\t\t\t- Select activity in the left pane\n\t\t\t- Enter some text into text box\n\t\t\t- Click on [Share] button\n\t\t *Expected Outcome: \n\t\t\tAdd an activity successfully:\n\t\t\t- This activity is added into users activities list.User who is in your contact, can view your active on his/her activity list*/\n\t\tString username1 = txData.getContentByArrayTypeRandom(4) + getRandomString();\n\t\tString email1 = username1+\"@gmail.com\";\n\t\tinfo(\"Add new user\");\n\t\tnavTool.goToAddUser();\n\t\taddUserPage.addUser(username1, password, email1, username1, username1);\n\t\tmagAc.signIn(username1,password);\n\t\tUtils.pause(3000);\n\n\t\tnavTool.goToMyActivities();\n\t\tString activity1 = txData.getContentByArrayTypeRandom(1)+getRandomNumber();\n\t\thpAct.addActivity(activity1, \"\");\n\t\t\n\t\t/*Step number: 2\n\t\t *Step Name: -\n\t\t *Step Description: \n\t\t\tStep 2: Like activity\n\t\t *Input Data: \n\t\t\t- Click on Like under activity\n\t\t *Expected Outcome: \n\t\t\tShow the message: “you like this”. Like link is change to Unlike link*/\n\t\thpAct.likeActivity(activity1);\n\t\t\n\t\t/*Step number: 3\n\t\t *Step Name: -\n\t\t *Step Description: \n\t\t\tStep 3: Unlike a activity\n\t\t *Input Data: \n\t\t\t- User who liked the activity logs in\n\t\t\t- Select the activity\n\t\t\t- Click on Unlike link\n\t\t *Expected Outcome: \n\t\t\tUser is moved out list of users like the activity. Unlike link is changed to Like link*/ \n\t\thpAct.unlikeActivity(activity1);\n\t}", "@Given(\"Iam offered with referal bonus\")\r\n\tpublic void iam_offered_with_referal_bonus() {\n\t\tSystem.out.println(\"code for referal bonus\");\r\n\t}", "public HooksScenario(SharedContext ctx) {\r\n this.ctx = ctx;\r\n }", "@Before\n\tpublic void keepScenario(Scenario scenario) {\n\t\tthis.scenario=scenario;\n\t}", "@Test\n public void testPerformReverseStep_reverseThenAltAtInit() throws IOException {\n initializeTestWithModelPath(\"models/even_odd.als\");\n String dotString1 = String.join(\"\\n\",\n \"digraph graphname {\",\n \"\\tS1 -> S2\",\n \"\\tS2 -> S3\",\n \"\\tS3\",\n \"}\",\n \"\"\n );\n String dotString2 = String.join(\"\\n\",\n \"digraph graphname {\",\n \"\\tS1 -> S2\",\n \"\\tS2 -> S3\",\n \"\\tS3\",\n \"\\tS4\",\n \"}\",\n \"\"\n );\n String dotString3 = String.join(\"\\n\",\n \"digraph graphname {\",\n \"\\tS1 -> S2\",\n \"\\tS2 -> S3\",\n \"\\tS3\",\n \"\\tS4 -> S5\",\n \"\\tS5\",\n \"}\",\n \"\"\n );\n String state1 = String.join(\"\\n\",\n \"\",\n \"S1\",\n \"----\",\n \"i: { 0 }\",\n \"\"\n );\n String state2 = String.join(\"\\n\",\n \"\",\n \"S4\",\n \"----\",\n \"i: { 1 }\",\n \"\"\n );\n String state3 = String.join(\"\\n\",\n \"\",\n \"S5\",\n \"----\",\n \"i: { 3 }\",\n \"\"\n );\n String history = String.join(\"\\n\",\n \"\",\n \"S4 (-1)\",\n \"---------\",\n \"i: { 1 }\",\n \"\"\n );\n\n assertTrue(sm.initialize(modelFile, false));\n assertTrue(sm.performStep(2));\n sm.performReverseStep(2);\n assertEquals(state1, sm.getCurrentStateString());\n assertEquals(\"\", sm.getHistory(3));\n assertEquals(dotString1, sm.getDOTString());\n\n assertTrue(sm.selectAlternatePath(false));\n assertEquals(state2, sm.getCurrentStateString());\n assertEquals(\"\", sm.getHistory(3));\n assertEquals(dotString2, sm.getDOTString());\n\n assertTrue(sm.performStep(1));\n assertEquals(state3, sm.getCurrentStateString());\n assertEquals(history, sm.getHistory(3));\n assertEquals(dotString3, sm.getDOTString());\n }", "@And(\"I enter the other fields with valid data\")\n public void i_enter_the_other_fields_with_valid_data() {\n throw new io.cucumber.java.PendingException();\n }", "@SuppressWarnings(\"unchecked\")\n @Test\n public void shouldPrependBeforeScenarioAndAppendAfterScenarioAnnotatedSteps() {\n CandidateSteps steps1 = mock(Steps.class);\n CandidateSteps steps2 = mock(Steps.class);\n Step stepBefore1 = mock(Step.class);\n Step stepBefore2 = mock(Step.class);\n Step stepAfter1 = mock(Step.class);\n Step stepAfter2 = mock(Step.class);\n\n when(steps1.runBeforeScenario()).thenReturn(asList(stepBefore1));\n when(steps2.runBeforeScenario()).thenReturn(asList(stepBefore2));\n when(steps1.runAfterScenario()).thenReturn(asList(stepAfter1));\n when(steps2.runAfterScenario()).thenReturn(asList(stepAfter2));\n\n // And which have a 'normal' step that matches our core\n CandidateStep candidate = mock(CandidateStep.class);\n Step normalStep = mock(Step.class);\n\n when(candidate.matches(\"my step\")).thenReturn(true);\n when(candidate.createFrom(tableRow, \"my step\")).thenReturn(normalStep);\n when(steps1.getSteps()).thenReturn(new CandidateStep[] { candidate });\n when(steps2.getSteps()).thenReturn(new CandidateStep[] {});\n\n // When we create the series of steps for the core\n MarkUnmatchedStepsAsPending stepCreator = new MarkUnmatchedStepsAsPending();\n List<Step> executableSteps = stepCreator.createStepsFrom(asList(steps1, steps2), new Scenario(asList(\"my step\")), tableRow\n );\n\n // Then all before and after steps should be added\n ensureThat(executableSteps, equalTo(asList(stepBefore2, stepBefore1, normalStep, stepAfter1, stepAfter2)));\n }", "@Test\n public void featureContainingOnlyAComment_stillParses() throws IOException {\n Optional<GherkinFeature> featureOptional = transformer.interpretGherkinFile(Path.of(resourcePath + \"incomplete_feature_3.feature\").toUri().toURL(), listener);\n assertThat(featureOptional.isPresent()).isTrue();\n }", "@Override\n public void onStepStopping(FlowStep flowStep) {\n }", "public void scenarioChanged();", "private void presentShowcaseSequence() {\n }", "@Test(invocationCount=1,skipFailedInvocations=false)\n public void testDemo() throws TimeOut{\n \tMentalStateManager msmAgent1_0DeploymentUnitByType3=MSMRepository.getInstance().waitFor(\"Agent1_0DeploymentUnitByType3\");\n \t \t\t\t\n \t// wait for Agent1_0DeploymentUnitByType2 to initialise\n \tMentalStateManager msmAgent1_0DeploymentUnitByType2=MSMRepository.getInstance().waitFor(\"Agent1_0DeploymentUnitByType2\");\n \t \t\t\t\n \t// wait for Agent0_0DeploymentUnitByType1 to initialise\n \tMentalStateManager msmAgent0_0DeploymentUnitByType1=MSMRepository.getInstance().waitFor(\"Agent0_0DeploymentUnitByType1\");\n \t \t\t\t\n \t// wait for Agent0_0DeploymentUnitByType0 to initialise\n \tMentalStateManager msmAgent0_0DeploymentUnitByType0=MSMRepository.getInstance().waitFor(\"Agent0_0DeploymentUnitByType0\");\n \t\n \t\n \tGenericAutomata ga=null;\n \tga=new GenericAutomata();\n\t\t\t\n\t\t\tga.addInitialState(\"default_WFTestInitialState0\");\t\t\n\t\t\t\n\t\t\tga.addInitialState(\"default_WFTestInitialState1\");\t\t\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t\tga.addFinalState(\"WFTestFinalState0\");\t\t\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t\tga.addStateTransition(\"default_WFTestInitialState0\",\"Agent0_0DeploymentUnitByType0-Task0\",\"WFTestInitialState0\");\n\t\t\t\n\t\t\tga.addStateTransition(\"WFTestInitialState0\",\"Agent1_0DeploymentUnitByType2-Task1\",\"WFTestFinalState0\");\n\t\t\t\n\t\t\tga.addStateTransition(\"default_WFTestInitialState1\",\"Agent0_0DeploymentUnitByType1-Task0\",\"WFTestInitialState1\");\n\t\t\t\n\t\t\tga.addStateTransition(\"WFTestInitialState1\",\"Agent1_0DeploymentUnitByType2-Task1\",\"WFTestFinalState0\");\n\t\t\t\t\n\t\t\t\n\t\t\tTaskExecutionValidation tev=new TaskExecutionValidation(ga);\n \t\n \ttev.registerTask(\"Agent0_0DeploymentUnitByType0\",\"Task0\");\n \t\n \ttev.registerTask(\"Agent1_0DeploymentUnitByType2\",\"Task1\");\n \t\n \ttev.registerTask(\"Agent0_0DeploymentUnitByType1\",\"Task0\");\n \t\n \ttev.registerTask(\"Agent1_0DeploymentUnitByType2\",\"Task1\");\n \t\t\n \t\t\n \tRetrieveExecutionData cwfe=new \tRetrieveExecutionData();\n \tEventManager.getInstance().register(cwfe);\n\t\tlong step=100;\n\t\tlong currentTime=0;\n\t\tlong finishedTime=0;\n\t\tlong duration=2000;\n\t\tlong maxtimepercycle=2000;\n\t\t \n\t\tMainInteractionManager.goAutomatic(); // tells the agents to start working\t\t\t\n\t\twhile (currentTime<finishedTime){\n\t\t\t\ttry {\n\t\t\t\t\tThread.currentThread().sleep(step);\n\t\t\t\t\t\n\t\t\t\t} catch (InterruptedException e) {\t\t\t\t\t\n\t\t\t\t\te.printStackTrace();\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tcurrentTime=currentTime+step;\n\t\t\t}\n\t\t\t\n\t\t\tif (currentTime<duration){\n\t\t\t\tTestUtils.doNothing(duration-currentTime); // waits for tasks to execute\t\n\t\t\t}\n\t\t\t\t\t\n\t\t\t\n\t\t\tMainInteractionManager.goManual(); // now it commands to not execute more tasks\t\t\n\t\t\tEventManager.getInstance().unregister(cwfe);\n\t\t\t\n\t\t Vector<String> counterExamples=tev.validatePartialTermination(cwfe,ga,maxtimepercycle);\n\t\t assertTrue(\"The execution does not match the expected sequences. I found the following counter examples \"+counterExamples,counterExamples.isEmpty());\t\t\n\t\t\t\t\t\t\t\n }", "public static void doExercise2() {\n // TODO: Complete Exercise 2 Below\n\n }", "@Test(description = \"Test to validate the EMI feature with different tenure and interest rate\", priority = 0)\n\tpublic void UserStory2() throws HeadlessException, AWTException, IOException, InterruptedException\n\t{\n\t\tLoanCalculatorPage loan_cal = new LoanCalculatorPage();\n\t\tloan_cal.validateCalHomePage();\n\t\t//testLog.log(Status.INFO, \"Loan calculator page launched\");\n\n\t\t\n\t\tint testCaseID = 3;\n\t\t\n\t\t//Enter the values in calculator and validate output\n\t\tloan_cal.ValidateDetails(loan_cal.GetEMI(testCaseID));\n\t\t\n\t}", "@Override\n public boolean step() {\n return false;\n }", "@When(\"Try to Attempt well-known or guessable resource locations\")\npublic void tryattemptwellknownorguessableresourcelocations(){\n}", "private boolean doTestsPass()\r\n {\r\n return minimalSteps(\"ABCDABCE\") == 8 && minimalSteps(\"ABCABCE\") == 5;\r\n }", "public static boolean Scenario(PsiBuilder b, int l) {\n if (!recursion_guard_(b, l, \"Scenario\")) return false;\n boolean r, p;\n Marker m = enter_section_(b, l, _NONE_, \"<scenario>\");\n r = Scenario_0(b, l + 1);\n r = r && consumeToken(b, JB_TOKEN_SCENARIO);\n p = r; // pin = 2\n r = r && report_error_(b, WhiteSpace(b, l + 1));\n r = p && report_error_(b, Scenario_3(b, l + 1)) && r;\n r = p && report_error_(b, WhiteSpace(b, l + 1)) && r;\n r = p && report_error_(b, Scenario_5(b, l + 1)) && r;\n r = p && report_error_(b, WhiteSpace(b, l + 1)) && r;\n r = p && report_error_(b, Scenario_7(b, l + 1)) && r;\n r = p && report_error_(b, WhiteSpace(b, l + 1)) && r;\n r = p && report_error_(b, Scenario_9(b, l + 1)) && r;\n r = p && report_error_(b, WhiteSpace(b, l + 1)) && r;\n r = p && report_error_(b, Scenario_11(b, l + 1)) && r;\n r = p && Scenario_12(b, l + 1) && r;\n exit_section_(b, l, m, JB_SCENARIO, r, p, RecoverMeta_parser_);\n return r || p;\n }", "@Then(\"troubleshooting chart notes are displaying\")\n public void troubleshooting_chart_notes_are_displaying() {\n }", "@When(\"I add that menu item\")\n public void i_add_that_menu_item() {\n throw new io.cucumber.java.PendingException();\n }", "@Test\n public void featureContainingOnlyTitle_stillParses() throws IOException {\n Optional<GherkinFeature> featureOptional = transformer.interpretGherkinFile(Path.of(resourcePath + \"incomplete_feature_2.feature\").toUri().toURL(), listener);\n assertThat(featureOptional.isPresent()).isTrue();\n GherkinFeature feature = featureOptional.get();\n assertThat(feature.getTitle().isPresent()).isTrue();\n assertThat(feature.getLongDescription().isPresent()).isFalse();\n // No scenarios or background\n assertThat(feature.getBackground().isEmpty()).isTrue();\n assertThat(feature.getOptionalGherkinScenarios().isPresent()).isFalse();\n }", "public IObserver applyScenario(IScenario scenario) throws ThinklabException;", "@Test(expected=RuntimeException.class)\n\tpublic void testWarm_DetailedElseAbort_ShouldAbort1() {\n\t\tEmissionModule emissionModule = setUpScenario(EmissionsConfigGroup.DetailedVsAverageLookupBehavior.onlyTryDetailedElseAbort);\n\n\t\tdouble travelTimeOnLink = 21; //sec. approx freeSpeed of link12 is : (200 m) / (9.72.. m/s) approx 20.57 s\n\t\temissionModule.getWarmEmissionAnalysisModule().checkVehicleInfoAndCalculateWarmEmissions(vehicleFallbackToTechnologyAverage, link, travelTimeOnLink);\n\t}", "@Test\n @When(\"I open URL\")\n public void s02_UrlOpen() {\n driver.get(urlHP);\n System.out.println(\"Step02 PASSED\");\n }", "private void verifyFlow(Scenario scenario, long time, long timeStep) {\r\n\t\tfor(Location location : scenario.getLocations()) {\r\n\t\t\tResource flowRate = ResourceFactory.create();\r\n\t\t\tfor(ElementImpl element : scenario.getElements()) {\r\n\t\t\t\tflowRate = flowRate.add(element.getNetFlow(location, timeStep));\r\n\t\t\t}\r\n\t\t\tif(!flowRate.isZero()) {\r\n\t\t\t\tlogger.warn(location + \" @ t = \" + time + \r\n\t\t\t\t\t\t\": Non-zero flow rate at \" + location + \": \" \r\n\t\t\t\t\t\t+ flowRate);\r\n\t\t\t}\r\n\t\t}\r\n\t}", "@Test\n public void testBasicScanWithBlock() throws Exception {\n WorkflowJob job = r.jenkins.createProject(WorkflowJob.class, \"Convoluted\");\n job.setDefinition(new CpsFlowDefinition(\n \"echo 'first'\\n\" +\n \"timeout(time: 10, unit: 'SECONDS') {\\n\" +\n \" echo 'second'\\n\" +\n \" echo 'third'\\n\" +\n \"}\\n\" +\n \"sleep 1\",\n true));\n /* Flow structure (ID - type)\n 2 - FlowStartNode\n 3 - EchoStep\n 4 - TimeoutStep\n 5 - TimeoutStep with BodyInvocationAction\n 6 - EchoStep\n 7 - EchoStep\n 8 - StepEndNode (BlockEndNode), startId=5\n 9 - StepEndNode (BlockEndNode), startId = 4\n 10 - SleepStep\n 11 - FlowEndNode\n */\n\n WorkflowRun b = r.assertBuildStatusSuccess(job.scheduleBuild2(0));\n Predicate<FlowNode> matchEchoStep = FlowTestUtils.predicateMatchStepDescriptor(\"org.jenkinsci.plugins.workflow.steps.EchoStep\");\n FlowExecution exec = b.getExecution();\n Collection<FlowNode> heads = exec.getCurrentHeads();\n\n // Linear analysis\n LinearScanner linearScanner = new LinearScanner();\n linearScanner.setup(heads);\n FlowTestUtils.assertNodeOrder(\"Linear scan with block\", linearScanner, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2);\n linearScanner.setup(exec.getNode(\"7\"));\n FlowTestUtils.assertNodeOrder(\"Linear scan with block from middle \", linearScanner, 7, 6, 5, 4, 3, 2);\n\n LinearBlockHoppingScanner linearBlockHoppingScanner = new LinearBlockHoppingScanner();\n\n // // Test block jump core\n FlowNode headCandidate = exec.getNode(\"8\");\n Assert.assertEquals(exec.getNode(\"4\"), linearBlockHoppingScanner.jumpBlockScan(headCandidate, Collections.emptySet()));\n Assert.assertTrue(\"Setup should return true if we can iterate\", linearBlockHoppingScanner.setup(headCandidate, null));\n\n // Test the actual iteration\n linearBlockHoppingScanner.setup(heads);\n Assert.assertFalse(linearBlockHoppingScanner.hasNext());\n linearBlockHoppingScanner.setup(exec.getNode(\"8\"));\n FlowTestUtils.assertNodeOrder(\"Hopping over one block\", linearBlockHoppingScanner, 4, 3, 2);\n linearBlockHoppingScanner.setup(exec.getNode(\"7\"));\n FlowTestUtils.assertNodeOrder(\"Hopping over one block\", linearBlockHoppingScanner, 7, 6, 5, 4, 3, 2);\n\n // Test the black list in combination with hopping\n linearBlockHoppingScanner.setup(exec.getNode(\"8\"), Collections.singleton(exec.getNode(\"5\")));\n Assert.assertFalse(linearBlockHoppingScanner.hasNext());\n linearBlockHoppingScanner.setup(exec.getNode(\"8\"), Collections.singleton(exec.getNode(\"4\")));\n Assert.assertFalse(linearBlockHoppingScanner.hasNext());\n }", "@ParameterizedTest\n @MethodSource(value = \"createEverythingGoals\")\n\tpublic void AC1MultiLevelled(Goal everythingGoal) {\n\t\tGame g1 = Game.createMockGame(everythingGoal, \"\"\n\t\t\t+ \"PS! \\n\"\n\t\t\t+ \"TE B_ \\n\"\n\t\t);\n\t\t\n\t\tg1.movePlayer(Direction.DOWN);\n\t\tg1.movePlayer(Direction.UP);\n\t\tg1.movePlayer(Direction.RIGHT);\n\t\t\n\t\tg1.swingSword(Direction.RIGHT);\n\t\t\n\t\tg1.movePlayer(Direction.DOWN);\n\t\tg1.movePlayer(Direction.RIGHT);\n\t\tg1.movePlayer(Direction.RIGHT);\n\t\t\n\t\tassertEquals(\"\"\n\t\t\t+ \" \\n\"\n\t\t\t+ \" E PB \\n\"\n\t\t\t, g1.getBoardString()\n\t\t);\n\t\t\n\t\tassertFalse(g1.getHasWon());\n\t\t\n\t\tg1.movePlayer(Direction.LEFT);\n\t\tg1.movePlayer(Direction.LEFT);\n\t\t\n\t\tassertTrue(g1.getHasWon());\n\t\t\n\t\tGame g2 = Game.createMockGame(everythingGoal, \"\"\n\t\t\t+ \"PS! \\n\"\n\t\t\t+ \"TE B_ E\\n\"\n\t\t);\n\t\t\n\t\tg2.movePlayer(Direction.DOWN);\n\t\tg2.movePlayer(Direction.UP);\n\t\tg2.movePlayer(Direction.RIGHT);\n\t\t\n\t\tg2.swingSword(Direction.RIGHT);\n\t\t\n\t\tg2.movePlayer(Direction.DOWN);\n\t\tg2.movePlayer(Direction.RIGHT);\n\t\tg2.movePlayer(Direction.RIGHT);\n\t\tg2.movePlayer(Direction.RIGHT);\n\t\t\n\t\tassertEquals(\"\"\n\t\t\t+ \" \\n\"\n\t\t\t+ \" E PBE\\n\"\n\t\t\t, g2.getBoardString()\n\t\t);\n\t\t\n\t\tg2.movePlayer(Direction.LEFT);\n\t\tg2.movePlayer(Direction.LEFT);\n\t\tg2.movePlayer(Direction.LEFT);\n\t\t\n\t\tassertEquals(\"\"\n\t\t\t+ \" \\n\"\n\t\t\t+ \" P _BE\\n\"\n\t\t\t, g2.getBoardString()\n\t\t);\n\t\t\n\t\tassertFalse(g2.getHasWon());\n\n\t\tg2.movePlayer(Direction.UP);\n\t\tg2.movePlayer(Direction.RIGHT);\n\t\tg2.movePlayer(Direction.RIGHT);\n\t\tg2.movePlayer(Direction.RIGHT);\n\t\tg2.movePlayer(Direction.RIGHT);\n\t\tg2.movePlayer(Direction.RIGHT);\n\t\tg2.movePlayer(Direction.DOWN);\n\t\tg2.movePlayer(Direction.LEFT);\n\n\t\tassertEquals(\"\"\n\t\t\t+ \" \\n\"\n\t\t\t+ \" E BPE\\n\"\n\t\t\t, g2.getBoardString()\n\t\t);\n\t\t\n\t\tassertFalse(g2.getHasWon());\n\n\t\tg2.movePlayer(Direction.RIGHT);\n\t\t\n\t\tassertTrue(g2.getHasWon());\n\t\n\t\tGame g3 = Game.createMockGame(everythingGoal, \"\"\n\t\t\t+ \"S! \\n\"\n\t\t\t+ \"BE \\n\"\n\t\t\t+ \"_T \\n\"\n\t\t\t, \"\"\n\t\t\t+ \"P \\n\"\n\t\t\t+ \" \\n\"\n\t\t\t+ \" \\n\"\n\t\t);\n\t\t\n\t\tg3.swingSword(Direction.RIGHT);\n\t\t\n\t\tg3.movePlayer(Direction.DOWN);\n\t\tg3.movePlayer(Direction.RIGHT);\n\t\tg3.movePlayer(Direction.DOWN);\n\t\t\n\t\tassertFalse(g3.getHasWon());\n\t\t\n\t\tg3.movePlayer(Direction.UP);\n\t\t\n\t\tassertTrue(g3.getHasWon());\n }", "@Test\n public void testPerformReverseStep_altThenReverseToInit() throws IOException {\n initializeTestWithModelPath(\"models/even_odd.als\");\n String dotString1 = String.join(\"\\n\",\n \"digraph graphname {\",\n \"\\tS1\",\n \"\\tS2 -> S3\",\n \"\\tS3 -> S4\",\n \"\\tS4\",\n \"}\",\n \"\"\n );\n String dotString2 = String.join(\"\\n\",\n \"digraph graphname {\",\n \"\\tS1\",\n \"\\tS2 -> S3\",\n \"\\tS3 -> S4\",\n \"\\tS4 -> S5\",\n \"\\tS5\",\n \"}\",\n \"\"\n );\n String state1 = String.join(\"\\n\",\n \"\",\n \"S2\",\n \"----\",\n \"i: { 1 }\",\n \"\"\n );\n String state2 = String.join(\"\\n\",\n \"\",\n \"S5\",\n \"----\",\n \"i: { 7 }\",\n \"\"\n );\n String history = String.join(\"\\n\",\n \"\",\n \"S2 (-3)\",\n \"---------\",\n \"i: { 1 }\",\n \"\",\n \"S3 (-2)\",\n \"---------\",\n \"i: { 3 }\",\n \"\",\n \"S4 (-1)\",\n \"---------\",\n \"i: { 5 }\",\n \"\"\n );\n\n assertTrue(sm.initialize(modelFile, false));\n assertTrue(sm.selectAlternatePath(false));\n assertTrue(sm.performStep(2));\n sm.performReverseStep(2);\n assertEquals(state1, sm.getCurrentStateString());\n assertEquals(\"\", sm.getHistory(3));\n assertEquals(dotString1, sm.getDOTString());\n\n assertTrue(sm.performStep(3));\n assertEquals(state2, sm.getCurrentStateString());\n assertEquals(history, sm.getHistory(4));\n assertEquals(dotString2, sm.getDOTString());\n }", "@Test void addIngredientBoundary()\n {\n }", "public static void doExercise1() {\n // TODO: Complete Exercise 1 Below\n\n }", "@Test(groups = { \"lock\", \"nightly\" }, enabled=false)\n public void testMultipleWorkflowsWithLocks() {\n RaptureURI workflowRepo = helper.getRandomAuthority(Scheme.WORKFLOW);\n HttpDecisionApi decisionApi = helper.getDecisionApi();\n HttpScriptApi scriptApi = helper.getScriptApi();\n List<Step> thirtyNine = new ArrayList<Step>();\n String scriptUri = RaptureURI.builder(helper.getRandomAuthority(Scheme.SCRIPT)).docPath(\"sleep\").asString();\n long scriptSleepTime=10000;\n long timeoutValueSeconds=2;\n int numWorkflows=15;\n \n if (!scriptApi.doesScriptExist(scriptUri)) {\n @SuppressWarnings(\"unused\")\n RaptureScript executable = scriptApi.createScript(scriptUri, RaptureScriptLanguage.REFLEX, RaptureScriptPurpose.PROGRAM,\n \"println(\\\"Thread sleeping\\\");\\nsleep(\"+scriptSleepTime+\");\\nreturn 'next';\");\n }\n\n Step s1 = new Step();\n s1.setName(\"first\");\n s1.setExecutable(scriptUri);\n s1.setDescription(\"first sleep step\");\n\n Transition trans1 = new Transition();\n trans1.setName(\"next\");\n trans1.setTargetStep(\"$RETURN\");\n\n Transition error = new Transition();\n error.setName(\"error\");\n error.setTargetStep(\"$FAIL\");\n\n s1.setTransitions(ImmutableList.of(trans1, error));\n thirtyNine.add(s1);\n\n String semaphoreConfig = \"{\\\"maxAllowed\\\":1, \\\"timeout\\\":\"+timeoutValueSeconds+\" }\";\n\n // Begin by creating a couple of workflows.\n // In the real world these would be created by two different threads/users/applications,\n // so they use the same URI and semaphore config.\n\n Workflow flow = new Workflow();\n flow.setStartStep(\"first\");\n flow.setSteps(thirtyNine);\n String flowUri = RaptureURI.builder(workflowRepo).docPath(\"lockTest\").asString();\n flow.setWorkflowURI(flowUri);\n flow.setSemaphoreType(SemaphoreType.WORKFLOW_BASED);\n flow.setSemaphoreConfig(semaphoreConfig);\n decisionApi.putWorkflow(flow);\n\n \n RaptureURI lockUri = RaptureURI.builder(helper.getRandomAuthority(Scheme.DOCUMENT)).build();\n\t\tRaptureLockConfig lockConfig = lockApi.createLockManager(lockUri.toString(), \"LOCKING USING ZOOKEEPER {}\", \"\");\n // Start the first workflow. It will sleep for 5s then exit\n Map<String, String> params = new HashMap<String, String>();\n CreateResponse orderUri = decisionApi.createWorkOrderP(flow.getWorkflowURI(), params, null);\n assertNotNull(orderUri);\n\n List<String>woList = new ArrayList<String> ();\n for (int woCount =0; woCount<=numWorkflows; woCount++) {\n \tCreateResponse woUri = decisionApi.createWorkOrderP(flow.getWorkflowURI(), params, null);\n \t\n \ttry {\n \t\tThread.sleep(225);\n } catch (InterruptedException e) {\n }\n \tReporter.log(\"Checking work order attempt \"+woCount,true);\n \tlong successfulWoNumber=scriptSleepTime/(timeoutValueSeconds*1000);\n \tif (woCount % successfulWoNumber ==0 && woCount >0) {\n \t\tAssert.assertNotNull(woUri.getUri());\n \t\twoList.add(woUri.getUri());\n \t}\n \telse\n \t\tAssert.assertNull(woUri.getUri());\n \t\n }\n try {\n \tThread.sleep(10000);\n } catch (Exception e) {}\n for (String wo : woList) {\n \tReporter.log (\"Checking status of \"+wo,true);\n \tAssert.assertEquals(decisionApi.getWorkOrderStatus(wo).getStatus(),WorkOrderExecutionState.FINISHED);\n }\n }", "public void VerifyShopinsightTitle(String Exptext){\r\n\t\tString countryy=\"Germany\";\r\n\t\tString ExpectedTitle[] = getValue(Exptext).split(\",\",2);\r\n\t\tclass Local {};\r\n\t\tReporter.log(\"TestStepComponent\"+Local.class.getEnclosingMethod().getName());\r\n\t\tReporter.log(\"TestStepInput:-\"+\"NA\");\r\n\t\tReporter.log(\"TestStepOutput:-\"+\"NA\");\r\n\t\tReporter.log(\"TestStepExpectedResult:- Shopping insight title should be present\");\r\n\t\ttry{\r\n\t\t\tif(countryy.contains(countries.get(countrycount))){\r\n\t\t\t\tif(getAndVerifyTextfromList(locator_split(\"txtShoppinginSightDesc\"), ExpectedTitle[1],1)){\r\n\t\t\t\t\tSystem.out.println(ExpectedTitle[1]+\" is present\");\r\n\t\t\t\t\tReporter.log(\"PASS_MESSAGE:- \"+ExpectedTitle[1]+\" is present in Shopping insight box\");\r\n\t\t\t\t} else{ \r\n\t\t\t\t\tthrow new Error(ExpectedTitle[1]+\" is not present\");\r\n\t\t\t\t}\r\n\t\t\t}else{\r\n\t\t\t\tif(getAndVerifyTextfromList(locator_split(\"txtTitle\"), ExpectedTitle[1],Integer.valueOf(ExpectedTitle[0]))){\r\n\t\t\t\t\tSystem.out.println(ExpectedTitle[1]+\" is present\");\r\n\t\t\t\t\tReporter.log(\"PASS_MESSAGE:- \"+ExpectedTitle[1]+\" is present in Shopping insight box\");\r\n\t\t\t\t} else{ \r\n\t\t\t\t\tthrow new Error(ExpectedTitle[1]+\" is not present\");\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\tcatch(NoSuchElementException e){\r\n\t\t\tReporter.log(\"FAIL_MESSAGE:- \"+elementProperties.getProperty(\"txtTitle\")+\" / \"+elementProperties.getProperty(\"txtShoppinginSightDesc\")+\" is not Present\");\r\n\t\t\tthrow new NoSuchElementException(\"The element with \"\r\n\t\t\t\t\t+ elementProperties.getProperty(\"txtTitle\")\r\n\t\t\t\t\t+ elementProperties.getProperty(\"txtShoppinginSightDesc\")\r\n\t\t\t\t\t+ \" not found\");\r\n\t\t}\r\n\t\tcatch(Error Er){\r\n\t\t\tReporter.log(\"FAIL_MESSAGE:- Expected text - '\"+ExpectedTitle[1]+\" is not present in Shopping insight box\");\r\n\t\t\tthrow new Error(\"Expected text - '\"+ExpectedTitle[1]+\" is not present\");\r\n\t\t}\r\n\t}", "public static void doExercise3() {\n // TODO: Complete Exercise 3 Below\n\n }", "@Test(groups ={Slingshot,Regression,SubmitMeterRead})\npublic void verifyYourdetailsElectricityOverLayLink()\t\n{\t\n\tReport.createTestLogHeader(\"Anonymous Submit meter read\", \"Verifies the Your details Electricity Page Overlay Links\");\n\t\tnew SubmitMeterReadAction()\n\t\t.openSMRpage(\"Electricity\")\t\t\n\t\t.verifyElectricWhyWeNeedThisLink()\n\t\t.verifyElectricAcctnoWhereCanIfindthisLink()\n\t\t.verifyElectricMeterPointWhereCanIfindthisLink()\n\t\t.verifyElectricMeterIDWhereCanIfindthisLink();\n}", "@Before\r\n public void startUp(Scenario scenario) {\r\n\r\n //this is used to add per scenario log to report with unique name\r\n long logging_start = System.nanoTime();\r\n\r\n //initialize Logger class, without this line log for the first scenario will not be attached\r\n Log.info(\"***\");\r\n Log.info(\"***\");\r\n\r\n //add appender to attach log for particular scenario to the report\r\n addAppender(out,scenario.getName()+logging_start);\r\n\r\n //start scenario\r\n String[] tId = scenario.getId().split(\";\");\r\n Log.info(\"*** Feature id: \" + tId[0] + \" ***\");\r\n Log.info(\"***\");\r\n Log.info(\"***\");\r\n Log.info(\"*** Scenario with name: \" + scenario.getName() + \" started! ***\");\r\n Log.info(\"***\");\r\n Log.info(\"***\");\r\n\r\n /* Global resources load */\r\n Log.info(\"Started resources initialisation\");\r\n Log.info(\"<- creating shared context ->\");\r\n ctx.Object = new Context();\r\n ctx.Object.put(\"FeatureId\", String.class, tId[0]);\r\n ctx.Object.put(\"ScenarioId\", String.class, scenario.getName());\r\n\r\n FileCore fileCore = new FileCore(ctx);\r\n ctx.Object.put(\"FileCore\", FileCore.class, fileCore);\r\n\r\n ConfigReader Config = new ConfigReader(ctx);\r\n ctx.Object.put(\"Config\", ConfigReader.class, Config);\r\n\r\n Storage storage = new Storage(ctx);\r\n ctx.Object.put(\"Storage\", Storage.class, storage);\r\n\r\n PropertyReader env = new PropertyReader(ctx);\r\n ctx.Object.put(\"Environment\", PropertyReader.class, env);\r\n\r\n Macro macro = new Macro(ctx);\r\n ctx.Object.put(\"Macro\", Macro.class, macro);\r\n\r\n ExecutorCore executorCore = new ExecutorCore(ctx);\r\n ctx.Object.put(\"ExecutorCore\", ExecutorCore.class, executorCore);\r\n\r\n AssertCore assertCore = new AssertCore(ctx);\r\n ctx.Object.put(\"AssertCore\", AssertCore.class, assertCore);\r\n\r\n PdfCore pdfCore = new PdfCore(ctx);\r\n ctx.Object.put(\"PdfCore\", PdfCore.class, pdfCore);\r\n\r\n SshCore sshCore = new SshCore(ctx);\r\n ctx.Object.put(\"SshCore\", SshCore.class, sshCore);\r\n\r\n WinRMCore winRmCore = new WinRMCore(ctx);\r\n ctx.Object.put(\"WinRMCore\", WinRMCore.class, winRmCore);\r\n\r\n SqlCore sqlCore = new SqlCore(ctx);\r\n ctx.Object.put(\"SqlCore\", SqlCore.class, sqlCore);\r\n\r\n StepCore step = new StepCore(ctx);\r\n ctx.Object.put(\"StepCore\", StepCore.class, step);\r\n\r\n //get resources from ctx object\r\n FileCore FileCore = ctx.Object.get(\"FileCore\", FileCore.class);\r\n Macro Macro = ctx.Object.get(\"Macro\", Macro.class);\r\n StepCore = ctx.Object.get(\"StepCore\", StepCore.class);\r\n Storage = ctx.Object.get(\"Storage\", Storage.class);\r\n\r\n Log.info(\"<- reading default configuration ->\");\r\n String defaultConfigDir = FileCore.getProjectPath() + File.separator + \"libs\" + File.separator + \"libCore\" + File.separator + \"config\";\r\n Log.debug(\"Default configuration directory is \" + defaultConfigDir);\r\n\r\n ArrayList<String> defaultConfigFiles = FileCore.searchForFile(defaultConfigDir,\".config\");\r\n if(defaultConfigFiles.size()!=0) {\r\n for (String globalConfigFile : defaultConfigFiles) {\r\n Config.create(globalConfigFile);\r\n }\r\n }\r\n\r\n Log.info(\"<- reading global configuration ->\");\r\n String globalConfigDir = FileCore.getGlobalConfigPath();\r\n Log.debug(\"Global configuration directory is \" + globalConfigDir);\r\n\r\n ArrayList<String> globalConfigFiles = FileCore.searchForFile(globalConfigDir,\".config\");\r\n if(globalConfigFiles.size()!=0) {\r\n for (String globalConfigFile : globalConfigFiles) {\r\n Config.create(globalConfigFile);\r\n }\r\n }\r\n\r\n //configuring logger for rest operations\r\n ToLoggerPrintStream loggerPrintStream = new ToLoggerPrintStream();\r\n Log.info(\"Finished resources initialisation\");\r\n\r\n /* Local resources load */\r\n Log.info(\"<- Started local config load ->\");\r\n String featureDir = FileCore.getCurrentFeatureDirPath();\r\n\r\n Log.debug(\"Feature dir is \" + featureDir);\r\n if( featureDir != null ){\r\n ctx.Object.put(\"FeatureFileDir\", String.class, featureDir);\r\n\r\n ArrayList<String> localConfigFiles = FileCore.searchForFile(featureDir,\".config\");\r\n if(localConfigFiles.size()!=0) {\r\n for (String localConfigFile : localConfigFiles) {\r\n Config.create(localConfigFile);\r\n }\r\n }else{\r\n Log.warn(\"No local config files found!\");\r\n }\r\n }\r\n\r\n //all global and local configuration loaded.\r\n //show default config\r\n Log.debug(\"Checking default environment configuration\");\r\n HashMap<String, Object> defaultEnvConfig = Storage.get(\"Environment.Default\");\r\n HashMap<String, Object> sshConfig = Storage.get(\"Ssh\");\r\n HashMap<String, Object> winRmConfig = Storage.get(\"WinRM\");\r\n Map<String, Object> finalEnvConfig = Storage.get(\"Environment.Active\");\r\n if ( defaultEnvConfig == null || defaultEnvConfig.size() == 0 ){\r\n Log.error(\"Default configuration Environment.\"\r\n + \" Default not found or empty. Please create it!\");\r\n }\r\n if ( finalEnvConfig == null ) {\r\n Log.error(\"Environment.Active object does not exists or null.\"\r\n + \" Please create such entry in global configuration\");\r\n }\r\n if ( sshConfig == null ) {\r\n Log.error(\"Ssh object does not exists or null. Please create it!\");\r\n }\r\n if ( winRmConfig == null ) {\r\n Log.error(\"WinRM object does not exists or null. Please create it!\");\r\n }\r\n //merge ssh with default\r\n defaultEnvConfig.put(\"Ssh\", sshConfig);\r\n //merge winRM with default\r\n defaultEnvConfig.put(\"WinRM\", winRmConfig);\r\n //check if cmd argument active_env was provided to overwrite active_env\r\n String cmd_arg = System.getProperty(\"active_env\");\r\n if ( cmd_arg != null ) {\r\n Log.info(\"Property Environment.Active.name overwritten by CMD arg -Dactive_env=\" + cmd_arg);\r\n Storage.set(\"Environment.Active.name\", cmd_arg);\r\n }\r\n //read name of the environment that shall be activated\r\n Log.debug(\"Checking active environment configuration\");\r\n String actEnvName = Storage.get(\"Environment.Active.name\");\r\n if ( actEnvName == null || actEnvName.equals(\"\") || actEnvName.equalsIgnoreCase(\"default\") ) {\r\n Log.debug(\"Environment.Active.name not set! Fallback to Environment.Default\");\r\n } else {\r\n //check if config with such name exists else fallback to default\r\n HashMap<String, Object> activeEnvConfig = Storage.get(\"Environment.\" + actEnvName);\r\n if ( activeEnvConfig == null || activeEnvConfig.size() == 0 ){\r\n Log.error(\"Environment config with name \" + actEnvName + \" not found or empty\");\r\n }\r\n //merge default and active\r\n deepMerge(defaultEnvConfig, activeEnvConfig);\r\n defaultEnvConfig = Storage.get(\"Environment.Default\");\r\n }\r\n //create final\r\n deepMerge(finalEnvConfig, defaultEnvConfig);\r\n\r\n //check if cmd argument widthXheight was provided to overwrite active_env\r\n String cmd_arg2 = System.getProperty(\"widthXheight\");\r\n if ( cmd_arg2 != null ) {\r\n Log.info(\"Property Environment.Active.Web.size overwritten by CMD arg -widthXheight=\" + cmd_arg2);\r\n Storage.set(\"Environment.Active.Web.size\", cmd_arg2);\r\n }\r\n\r\n Log.info(\"-- Following configuration Environment.Active is going to be used --\");\r\n for (HashMap.Entry<String, Object> entry : finalEnvConfig.entrySet()) {\r\n String[] tmp = entry.getValue().getClass().getName().split(Pattern.quote(\".\")); // Split on period.\r\n String type = tmp[2];\r\n Log.info( \"(\" + type + \")\" + entry.getKey() + \" = \" + entry.getValue() );\r\n }\r\n Log.info(\"-- end --\");\r\n\r\n //adjust default RestAssured config\r\n Log.debug(\"adjusting RestAssured config\");\r\n int maxConnections = Storage.get(\"Environment.Active.Rest.http_maxConnections\");\r\n Log.debug(\"Setting http.maxConnections to \" + maxConnections);\r\n System.setProperty(\"http.maxConnections\", \"\" + maxConnections);\r\n\r\n Boolean closeIdleConnectionsAfterEachResponseAfter = Storage.get(\"Environment.Active.Rest.closeIdleConnectionsAfterEachResponseAfter\");\r\n if ( closeIdleConnectionsAfterEachResponseAfter ) {\r\n int idleTime = Storage.get(\"Environment.Active.Rest.closeIdleConnectionsAfterEachResponseAfter_idleTime\");\r\n Log.debug(\"Setting closeIdleConnectionsAfterEachResponseAfter=true with idleTime \" + idleTime);\r\n RestAssured.config = RestAssured.config().connectionConfig(\r\n connectionConfig().closeIdleConnectionsAfterEachResponseAfter(\r\n idleTime,\r\n TimeUnit.SECONDS)\r\n );\r\n }\r\n\r\n Boolean reuseHttpClientInstance = Storage.get(\"Environment.Active.Rest.reuseHttpClientInstance\");\r\n if ( reuseHttpClientInstance ) {\r\n Log.debug(\"Setting reuseHttpClientInstance=true\");\r\n RestAssured.config = RestAssured.config().httpClient(\r\n httpClientConfig().reuseHttpClientInstance()\r\n );\r\n }\r\n\r\n Boolean relaxedHTTPSValidation = Storage.get(\"Environment.Active.Rest.relaxedHTTPSValidation\");\r\n if ( relaxedHTTPSValidation ) {\r\n Log.debug(\"Setting relaxedHTTPSValidation=true\");\r\n RestAssured.config = RestAssured.config().sslConfig(\r\n sslConfig().relaxedHTTPSValidation()\r\n );\r\n }\r\n\r\n Boolean followRedirects = Storage.get(\"Environment.Active.Rest.followRedirects\");\r\n if ( followRedirects != null ) {\r\n Log.debug(\"Setting followRedirects=\" + followRedirects);\r\n RestAssured.config = RestAssured.config().redirect(\r\n redirectConfig().followRedirects(followRedirects)\r\n );\r\n }\r\n\r\n RestAssured.config = RestAssured.config().decoderConfig(\r\n DecoderConfig.decoderConfig().defaultContentCharset(\"UTF-8\"));\r\n\r\n RestAssured.config = RestAssured.config().logConfig(\r\n new LogConfig( loggerPrintStream.getPrintStream(), true )\r\n );\r\n\r\n //check if macro evaluation shall be done in hooks\r\n Boolean doMacroEval = Storage.get(\"Environment.Active.MacroEval\");\r\n if ( doMacroEval == null ){\r\n Log.error(\"Environment.Active.MacroEval null or empty!\");\r\n }\r\n if( doMacroEval ){\r\n Log.info(\"Evaluating macros in TestData and Expected objects\");\r\n Macro.eval(\"TestData\");\r\n Macro.eval(\"Expected\");\r\n }\r\n\r\n Log.info(\"Test data storage is\");\r\n Storage.print(\"TestData\");\r\n\r\n Log.info(\"<- Finished local config load ->\");\r\n Log.info(\"***\");\r\n Log.info(\"*** Running steps for scenario: \" + scenario.getName());\r\n Log.info(\"***\");\r\n\r\n }", "void Step(String step);", "public void LossEstimates(){\r\n\t\r\n\r\n\t\tclass Local {};\r\n\t\tReporter.log(\"TestStepComponent\"+Local.class.getEnclosingMethod().getName());\r\n\t\tReporter.log(\"TestStepInput:-\"+\"NA\");\r\n\t\tReporter.log(\"TestStepOutput:-\"+\"NA\");\r\n\t\tReporter.log(\"TestStepExpectedResult:- My Account should be clicked and user should get logged in\");\r\n\t\ttry{\r\n\t\t\t\r\n\t\t\t\r\n\t\t\t/*driver.switchTo().defaultContent();\r\n\t\t\t\t\tsleep(3000);\r\n\t\t\t System.out.println(\"switched frame\"+ switchframe(\"PegaGadget2Ifr\"));\r\n\t\t\t click(locator_split(\"tabLocationAssesment\"));\r\n\t\t\t click(locator_split(\"linkclickLocation\"));*/\r\n\t\t\t // driver.findElement(By.xpath(\"//*[@tabindex='4']/a/span\")).click();\r\n\t\t\t // driver.findElement(By.xpath(\"//a[@title='Click here to open Location Assessment']\")).click();\r\n\t\t\tsleep(5000);\r\n\t\t\tif(getValue(\"Account\").equals(\"EEA\")){\r\n\t\t\t driver.switchTo().defaultContent();\r\n\t\t\t System.out.println(\"switched frame\"+ switchframe(\"PegaGadget3Ifr\"));\r\n\t\t\t click(locator_split(\"tablossestimates\"));\r\n\t\t\t sleep(2000);\r\n\t\t\t click(locator_split(\"tabeml\"));\r\n\t\t\t sleep(5000);\r\n\t\t\t click(locator_split(\"linkexpandpdlossestimates\"));\r\n\t\t\t sleep(3000);\r\n\t\t\t if (getValue(\"Radiobutton\").contains(\"Value\")){\r\n\t\t\t \tClickRadiobutton(locator_split(\"radiovalue\"));\r\n\t\t\t \t\r\n\t\t\t \tsleep(1000);\r\n\t\t\t \tclearWebEdit(locator_split(\"txtbuildingdamage\"));\r\n\t\t\t \tsleep(3000);\r\n\t\t\t \tclearWebEdit(locator_split(\"txtbuildingdamage\"));\r\n\t\t\t \tsleep(2000);\r\n\t\t\t \tsendKeys(locator_split(\"txtbuildingdamage\"), getValue(\"BuildingDamage\"));\r\n\t\t\t \tsleep(1000);\r\n\t\t\t \tclearWebEdit(locator_split(\"txtmeDamage\"));\r\n\t\t\t \tsleep(2000);\r\n\t\t\t \tsendKeys(locator_split(\"txtmeDamage\"), getValue(\"MEDamage\"));\r\n\t\t\t \tsleep(1000);\r\n\t\t\t \tclearWebEdit(locator_split(\"txtcontentdamage\"));\r\n\t\t\t \tsleep(2000);\r\n\t\t\t \tsendKeys(locator_split(\"txtcontentdamage\"), getValue(\"ContentDamage\"));\r\n\t\t\t \tsleep(1000);\r\n\t\t\t \tclearWebEdit(locator_split(\"txtstockdamage\"));\r\n\t\t\t \tsleep(2000);\r\n\t\t\t \tsendKeys(locator_split(\"txtstockdamage\"), getValue(\"StockDamage\"));\r\n\t\t\t \tsleep(1000);\r\n\t\t\t \tclearWebEdit(locator_split(\"txtotherpddamage\"));\r\n\t\t\t \tsleep(2000);\r\n\t\t\t \tsendKeys(locator_split(\"txtotherpddamage\"), getValue(\"OtherPDDamage\"));\r\n\t\t\t \tsleep(1000);\r\n\t\t\t \t\r\n\t\t\t }else{\r\n\t\t\t \tClickRadiobutton(locator_split(\"radiopercentage\"));\r\n\t\t\t \tclearWebEdit(locator_split(\"txtbuildingdamagepc\"));\r\n\t\t\t \tsleep(2000);\r\n\t\t\t \tsendKeys(locator_split(\"txtbuildingdamagepc\"), getValue(\"BuildingDamagePC\"));\r\n\t\t\t \tsleep(1000);\r\n\t\t\t \tclearWebEdit(locator_split(\"txtmedamagepc\"));\r\n\t\t\t \tsleep(2000);\r\n\t\t\t \tsendKeys(locator_split(\"txtmedamagepc\"), getValue(\"MEDamagePC\"));\r\n\t\t\t \tsleep(1000);\r\n\t\t\t \tclearWebEdit(locator_split(\"txtcontentdamagepc\"));\r\n\t\t\t \tsleep(2000);\r\n\t\t\t \tsendKeys(locator_split(\"txtcontentdamagepc\"), getValue(\"ContentDamagePC\"));\r\n\t\t\t \tsleep(1000);\r\n\t\t\t \tclearWebEdit(locator_split(\"txtstockdamagepc\"));\r\n\t\t\t \tsleep(2000);\r\n\t\t\t \tsendKeys(locator_split(\"txtstockdamagepc\"), getValue(\"StockDamagePC\"));\r\n\t\t\t \tsleep(1000);\r\n\t\t\t \tclearWebEdit(locator_split(\"txtotherpddmagepc\"));\r\n\t\t\t \tsleep(2000);\r\n\t\t\t \tsendKeys(locator_split(\"txtotherpddmagepc\"), getValue(\"OtherPDDamagePC\"));\r\n\t\t\t \tsleep(1000);\r\n\t\t\t \t\r\n\t\t\t }\r\n\t\t\t \r\n\t\t\t click(locator_split(\"linkexpandbilossestimates\"));\r\n\t\t\t sleep(3000);\r\n\t\t\t // click(locator_split(\"linkaddroweml\"));\r\n\t\t\t // sleep(3000);\r\n\t\t\t // click(locator_split(\"linkaddroweml\"));\r\n\t\t\t// sleep(3000);\r\n\t\t\t \r\n\t\t\t selectListValue(locator_split(\"listbidowntime\"), getValue(\"BIDownTime\"));\r\n\t\t\t sleep(2000);\r\n\t\t\t clearWebEdit(locator_split(\"txtbiaffected\"));\r\n\t\t\t sleep(2000);\r\n\t\t\t sendKeys(locator_split(\"txtbiaffected\"), getValue(\"BIAffected\"));\r\n\t\t\t sleep(2000);\r\n\t\t\t clearWebEdit(locator_split(\"txtbidowntime\"));\r\n\t\t\t sleep(2000);\r\n\t\t\t sendKeys(locator_split(\"txtbidowntime\"), getValue(\"BIDownTimeValue\"));\r\n\t\t\t sleep(2000);\r\n\t\t\t //if (driver.findElement(By.xpath(\".//*[@id='LECompletedFlag']\")).isSelected()== true ){\r\n\t\t\t \t\r\n\t\t\t //}\r\n\t\t\t // click(locator_split(\"checklecompleted\"));\r\n\t\t\t// driver.findElement(By.xpath(\".//*[@id='LECompletedFlag']\")).click();\r\n\t\t\t driver.findElement(By.xpath(\"//input[@id='LECompletedFlag']\")).click();\r\n\t\t\t //sendkeys(driver.findElement(By.xpath(\"//input[@name='USER']\")),\"jkdkd\");\r\n\t\t\t sleep(2000);\r\n\t\t\t \r\n/////////////////////////////PML flag\r\n\t\t\t click(locator_split(\"tabpml\"));\r\n\t\t\t sleep(5000);\r\n\t\t\r\n\t\t\t // click(locator_split(\"linkexpandpdlossestimates\"));\r\n\t\t\t sleep(3000);\r\n\t\t\t if (getValue(\"Radiobutton\").contains(\"Value\")){\r\n\t\t\t \tSystem.out.println(\"inside if loop\");\r\n\t\t\t \tClickRadiobutton(locator_split(\"radiovalue\"));\r\n\t\t\t \tsleep(1000);\r\n\t\t\t \tclearWebEdit(locator_split(\"txtbuildingdamage\"));\r\n\t\t\t \tsleep(2000);\r\n\t\t\t \tSystem.out.println(\"inside pml tab\");\r\n\t\t\t \tclearWebEdit(locator_split(\"txtbuildingdamage\"));\r\n\t\t\t \tsleep(2000);\r\n\t\t\t \tsendKeys(locator_split(\"txtbuildingdamage\"), getValue(\"BuildingDamage1\"));\r\n\t\t\t \tsleep(1000);\r\n\t\t\t \tclearWebEdit(locator_split(\"txtmeDamage\"));\r\n\t\t\t \tsleep(2000);\r\n\t\t\t \tsendKeys(locator_split(\"txtmeDamage\"), getValue(\"MEDamage1\"));\r\n\t\t\t \tsleep(1000);\r\n\t\t\t \tclearWebEdit(locator_split(\"txtcontentdamage\"));\r\n\t\t\t \tsleep(2000);\r\n\t\t\t \tsendKeys(locator_split(\"txtcontentdamage\"), getValue(\"ContentDamage1\"));\r\n\t\t\t \tsleep(1000);\r\n\t\t\t \tclearWebEdit(locator_split(\"txtstockdamage\"));\r\n\t\t\t \tsleep(2000);\r\n\t\t\t \tsendKeys(locator_split(\"txtstockdamage\"), getValue(\"StockDamage1\"));\r\n\t\t\t \tsleep(1000);\r\n\t\t\t \tclearWebEdit(locator_split(\"txtotherpddamage\"));\r\n\t\t\t \tsleep(2000);\r\n\t\t\t \tsendKeys(locator_split(\"txtotherpddamage\"), getValue(\"OtherPDDamage1\"));\r\n\t\t\t \tsleep(1000);\r\n\t\t\t \t\r\n\t\t\t }else{\r\n\t\t\t \tClickRadiobutton(locator_split(\"radiopercentage\"));\r\n\t\t\t \t\r\n\t\t\t \tclearWebEdit(locator_split(\"txtbuildingdamagepc\"));\r\n\t\t\t \tsleep(2000);\r\n\t\t\t \t\r\n\t\t\t \tclearWebEdit(locator_split(\"txtbuildingdamagepc\"));\r\n\t\t\t \tsleep(2000);\r\n\t\t\t \tsendKeys(locator_split(\"txtbuildingdamagepc\"), getValue(\"BuildingDamagePC1\"));\r\n\t\t\t \tsleep(1000);\r\n\t\t\t \tclearWebEdit(locator_split(\"txtmedamagepc\"));\r\n\t\t\t \tsleep(2000);\r\n\t\t\t \tsendKeys(locator_split(\"txtmedamagepc\"), getValue(\"MEDamagePC1\"));\r\n\t\t\t \tsleep(1000);\r\n\t\t\t \tclearWebEdit(locator_split(\"txtcontentdamagepc\"));\r\n\t\t\t \tsleep(2000);\r\n\t\t\t \tsendKeys(locator_split(\"txtcontentdamagepc\"), getValue(\"ContentDamagePC1\"));\r\n\t\t\t \tsleep(1000);\r\n\t\t\t \tclearWebEdit(locator_split(\"txtstockdamagepc\"));\r\n\t\t\t \tsleep(2000);\r\n\t\t\t \tsendKeys(locator_split(\"txtstockdamagepc\"), getValue(\"StockDamagePC1\"));\r\n\t\t\t \tsleep(1000);\r\n\t\t\t \tclearWebEdit(locator_split(\"txtotherpddmagepc\"));\r\n\t\t\t \tsleep(2000);\r\n\t\t\t \tsendKeys(locator_split(\"txtotherpddmagepc\"), getValue(\"OtherPDDamagePC1\"));\r\n\t\t\t \tsleep(1000);\r\n\t\t\t \t\r\n\t\t\t }\r\n\t\t\t \r\n\t\t\t // click(locator_split(\"linkexpandbilossestimates\"));\r\n\t\t\t sleep(3000);\r\n\t\t\t selectListValue(locator_split(\"listbidowntime\"), getValue(\"BIDownTime1\"));\r\n\t\t\t sleep(2000);\r\n\t\t\t clearWebEdit(locator_split(\"txtbiaffected\"));\r\n\t\t\t sleep(2000);\r\n\t\t\t sendKeys(locator_split(\"txtbiaffected\"), getValue(\"BIAffected1\"));\r\n\t\t\t sleep(2000);\r\n\t\t\t clearWebEdit(locator_split(\"txtbidowntime\"));\r\n\t\t\t sleep(2000);\r\n\t\t\t sendKeys(locator_split(\"txtbidowntime\"), getValue(\"BIDownTimeValue1\"));\r\n\t\t\t sleep(2000);\r\n\t\t\t //if (driver.findElement(By.xpath(\".//*[@id='LECompletedFlag']\")).isSelected()== true ){\r\n\t\t\t \t\r\n\t\t\t //}\r\n\t\t\t // driver.findElement(By.xpath(\".//*[@id='LECompletedFlag']\")).click();\r\n\t\t\t driver.findElement(By.xpath(\"//input[@id='LECompletedFlag']\")).click();\r\n\t\t\t sleep(2000);\r\n\t\t\t //////////////////////////////////////////////\r\n\t\t\t \r\n\t\t\t \r\n\t\t //////////NLE///////////////////////////\r\n\t\t\t click(locator_split(\"tabnle\"));\r\n\t\t\t sleep(5000);\r\n\t\t\r\n\t\t\t // click(locator_split(\"linkexpandpdlossestimates\"));\r\n\t\t\t sleep(3000);\r\n\t\t\t if (getValue(\"Radiobutton\").contains(\"Value\")){\r\n\t\t\t \t\r\n\t\t\t \tClickRadiobutton(locator_split(\"radiovalue\"));\r\n\t\t\t \tsleep(1000);\r\n\t\t\t \tclearWebEdit(locator_split(\"txtbuildingdamage\"));\r\n\t\t\t \tsleep(2000);\r\n\t\t\t \tclearWebEdit(locator_split(\"txtbuildingdamage\"));\r\n\t\t\t \tsleep(2000);\r\n\t\t\t \tsendKeys(locator_split(\"txtbuildingdamage\"), getValue(\"BuildingDamage2\"));\r\n\t\t\t \tsleep(1000);\r\n\t\t\t \tclearWebEdit(locator_split(\"txtmeDamage\"));\r\n\t\t\t \tsleep(2000);\r\n\t\t\t \tsendKeys(locator_split(\"txtmeDamage\"), getValue(\"MEDamage2\"));\r\n\t\t\t \tsleep(1000);\r\n\t\t\t \tclearWebEdit(locator_split(\"txtcontentdamage\"));\r\n\t\t\t \tsleep(2000);\r\n\t\t\t \tsendKeys(locator_split(\"txtcontentdamage\"), getValue(\"ContentDamage2\"));\r\n\t\t\t \tsleep(1000);\r\n\t\t\t \tclearWebEdit(locator_split(\"txtstockdamage\"));\r\n\t\t\t \tsleep(2000);\r\n\t\t\t \tsendKeys(locator_split(\"txtstockdamage\"), getValue(\"StockDamage2\"));\r\n\t\t\t \tsleep(1000);\r\n\t\t\t \tclearWebEdit(locator_split(\"txtotherpddamage\"));\r\n\t\t\t \tsleep(2000);\r\n\t\t\t \tsendKeys(locator_split(\"txtotherpddamage\"), getValue(\"OtherPDDamage2\"));\r\n\t\t\t \tsleep(1000);\r\n\t\t\t \t\r\n\t\t\t }else{\r\n\t\t\t \tClickRadiobutton(locator_split(\"radiopercentage1\"));\r\n\t\t\t \t\r\n\t\t\t \tclearWebEdit(locator_split(\"txtbuildingdamagepc\"));\r\n\t\t\t \tsleep(2000);\r\n\t\t\t \tsendKeys(locator_split(\"txtbuildingdamagepc\"), getValue(\"BuildingDamagePC2\"));\r\n\t\t\t \tsleep(1000);\r\n\t\t\t \tclearWebEdit(locator_split(\"txtmedamagepc\"));\r\n\t\t\t \tsleep(2000);\r\n\t\t\t \tsendKeys(locator_split(\"txtmedamagepc\"), getValue(\"MEDamagePC2\"));\r\n\t\t\t \tsleep(1000);\r\n\t\t\t \tclearWebEdit(locator_split(\"txtcontentdamagepc\"));\r\n\t\t\t \tsleep(2000);\r\n\t\t\t \tsendKeys(locator_split(\"txtcontentdamagepc\"), getValue(\"ContentDamagePC2\"));\r\n\t\t\t \tsleep(1000);\r\n\t\t\t \tclearWebEdit(locator_split(\"txtstockdamagepc\"));\r\n\t\t\t \tsleep(2000);\r\n\t\t\t \tsendKeys(locator_split(\"txtstockdamagepc\"), getValue(\"StockDamagePC2\"));\r\n\t\t\t \tsleep(1000);\r\n\t\t\t \tclearWebEdit(locator_split(\"txtotherpddmagepc\"));\r\n\t\t\t \tsleep(2000);\r\n\t\t\t \tsendKeys(locator_split(\"txtotherpddmagepc\"), getValue(\"OtherPDDamagePC2\"));\r\n\t\t\t \tsleep(1000);\r\n\t\t\t \t\r\n\t\t\t }\r\n\t\t\t \r\n\t\t\t // click(locator_split(\"linkexpandbilossestimates\"));\r\n\t\t\t sleep(3000);\r\n\t\t\t selectListValue(locator_split(\"listbidowntime\"), getValue(\"BIDownTime2\"));\r\n\t\t\t sleep(2000);\r\n\t\t\t clearWebEdit(locator_split(\"txtbiaffected\"));\r\n\t\t\t sleep(2000);\r\n\t\t\t sendKeys(locator_split(\"txtbiaffected\"), getValue(\"BIAffected2\"));\r\n\t\t\t sleep(2000);\r\n\t\t\t clearWebEdit(locator_split(\"txtbidowntime\"));\r\n\t\t\t sleep(2000);\r\n\t\t\t sendKeys(locator_split(\"txtbidowntime\"), getValue(\"BIDownTimeValue2\"));\r\n\t\t\t sleep(2000);\r\n\t\t\t //if (driver.findElement(By.xpath(\".//*[@id='LECompletedFlag']\")).isSelected()== true ){\r\n\t\t\t \t\r\n\t\t\t //}\r\n\t\t\t if (driver.findElement(By.xpath(\".//*[@id='NLEScenarioComplete']\")).isSelected()== true ){\r\n\t\t\t\t driver.findElement(By.xpath(\"//*[@id='NLEScenarioComplete']\")).click();\r\n\t\t\t\t sleep(2000); \r\n\t\t\t }\r\n\t\t\t driver.findElement(By.xpath(\"//*[@id='NLEScenarioComplete']\")).click();\r\n\t\t\t sleep(2000); \r\n\t\t\t //////////////////////////////////////////////////////\r\n\t\t\t \r\n\t\t\t click(locator_split(\"tabnleprotected\"));\r\n\t\t\t sleep(2000);\r\n\t\t\t if (driver.findElement(By.xpath(\".//*[@id='NLEScenarioComplete']\")).isSelected()== true ){\r\n\t\t\t\t driver.findElement(By.xpath(\"//*[@id='NLEScenarioComplete']\")).click();\r\n\t\t\t\t sleep(2000);\r\n\t\t\t }\r\n\t\t\t driver.findElement(By.xpath(\"//*[@id='NLEScenarioComplete']\")).click();\r\n\t\t\t sleep(2000);\r\n\t\t\t \r\n\t\tclick(locator_split(\"tabnleprotectednonstorage\"));\r\n\t\t\t sleep(2000);\r\n\t\t\t// driver.findElement(By.xpath(\".//*[@id='NLEScenarioComplete']\")).click();\r\n\t\t\tsleep(2000);\r\n\t\t\tclick(locator_split(\"tabnlesummary\"));\r\n\t\t//\tdriver.findElement(By.xpath(\"tabnlesummary\")).click();\r\n\t\t\tsleep(2000);\r\n\t\t\t if (driver.findElement(By.xpath(\".//*[@id='LECompletedFlag']\")).isSelected()== true ){\r\n\t\t\t\t driver.findElement(By.xpath(\"//input[@id='LECompletedFlag']\")).click();\r\n\t\t\t\t\tsleep(2000);\r\n\t\t\t }\r\n\t\t\tdriver.findElement(By.xpath(\"//input[@id='LECompletedFlag']\")).click();\r\n\t\t\tsleep(2000);\r\n\t\t\t if (driver.findElement(By.xpath(\".//*[@id='SectionCompleted']\")).isSelected()== true ){\r\n\t\t\t\t driver.findElement(By.xpath(\"//input[@id='SectionCompleted']\")).click();\r\n\t\t\t\t sleep(2000);\r\n\t\t\t }\r\n\t\t\tdriver.findElement(By.xpath(\"//input[@id='SectionCompleted']\")).click();\r\n\t\t\tsleep(2000);\r\n\t\t//switchframe(\"PegaGadget2Ifr\");\r\n\t\t//\tsleep(3000);\r\n\t\t//clickbylinktext(\"No\");\r\n\t\t\t\r\n\t\t\t}else{\r\n\r\n\t\t\t driver.switchTo().defaultContent();\r\n\t\t\t System.out.println(\"switched frame\"+ switchframe(\"PegaGadget3Ifr\"));\r\n\t\t\t click(locator_split(\"tablossestimates\"));\r\n\t\t\t sleep(2000);\r\n\t\t\t click(locator_split(\"tabmas\"));\r\n\t\t\t sleep(5000);\r\n\t\t\t click(locator_split(\"linkexpandpdlossestimates\"));\r\n\t\t\t sleep(3000);\r\n\t\t\t if (getValue(\"Radiobutton\").contains(\"Value\")){\r\n\t\t\t \tClickRadiobutton(locator_split(\"radiovalue\"));\r\n\t\t\t \t\r\n\t\t\t \tsleep(1000);\r\n\t\t\t \tclearWebEdit(locator_split(\"txtbuildingdamage\"));\r\n\t\t\t \tsleep(3000);\r\n\t\t\t \tclearWebEdit(locator_split(\"txtbuildingdamage\"));\r\n\t\t\t \tsleep(2000);\r\n\t\t\t \tsendKeys(locator_split(\"txtbuildingdamage\"), getValue(\"BuildingDamageMas\"));\r\n\t\t\t \tsleep(1000);\r\n\t\t\t \t\r\n\t\t\t \tclearWebEdit(locator_split(\"txtmeDamage\"));\r\n\t\t\t \tsleep(2000);\r\n\t\t\t \tsendKeys(locator_split(\"txtmeDamage\"), getValue(\"MEDamageMas\"));\r\n\t\t\t \tsleep(1000);\r\n\t\t\t \tclearWebEdit(locator_split(\"txtcontentdamage\"));\r\n\t\t\t \tsleep(2000);\r\n\t\t\t \tsendKeys(locator_split(\"txtcontentdamage\"), getValue(\"ContentDamageMas\"));\r\n\t\t\t \tsleep(1000);\r\n\t\t\t \tclearWebEdit(locator_split(\"txtstockdamage\"));\r\n\t\t\t \tsleep(2000);\r\n\t\t\t \tsendKeys(locator_split(\"txtstockdamage\"), getValue(\"StockDamageMas\"));\r\n\t\t\t \tsleep(1000);\r\n\t\t\t \tclearWebEdit(locator_split(\"txtotherpddamage\"));\r\n\t\t\t \tsleep(2000);\r\n\t\t\t \tsendKeys(locator_split(\"txtotherpddamage\"), getValue(\"OtherPDDamageMas\"));\r\n\t\t\t \tsleep(1000);\r\n\t\t\t \t\r\n\t\t\t }else{\r\n\t\t\t \tClickRadiobutton(locator_split(\"radiopercentage\"));\r\n\t\t\t \tsleep(1000);\r\n\t\t\t \tclearWebEdit(locator_split(\"txtbuildingdamagepc\"));\r\n\t\t\t \tsleep(3000);\r\n\t\t\t \tclearWebEdit(locator_split(\"txtbuildingdamagepc\"));\r\n\t\t\t \tsleep(2000);\r\n\t\t\t \t\r\n\t\t\t \tsendKeys(locator_split(\"txtbuildingdamagepc\"), getValue(\"BuildingDamagePCMas\"));\r\n\t\t\t \tsleep(1000);\r\n\t\t\t \tclearWebEdit(locator_split(\"txtbuildingdamagepc\"));\r\n\t\t\t \tsleep(2000);\r\n\t\t\t \t\r\n\t\t\t \tsendKeys(locator_split(\"txtbuildingdamagepc\"), getValue(\"BuildingDamagePCMas\"));\r\n\t\t\t \tsleep(1000);\r\n\t\t\t \tclearWebEdit(locator_split(\"txtmedamagepc\"));\r\n\t\t\t \tsleep(2000);\r\n\t\t\t \tsendKeys(locator_split(\"txtmedamagepc\"), getValue(\"MEDamagePCMas\"));\r\n\t\t\t \tsleep(1000);\r\n\t\t\t \tclearWebEdit(locator_split(\"txtcontentdamagepc\"));\r\n\t\t\t \tsleep(2000);\r\n\t\t\t \tsendKeys(locator_split(\"txtcontentdamagepc\"), getValue(\"ContentDamagePCMas\"));\r\n\t\t\t \tsleep(1000);\r\n\t\t\t \tclearWebEdit(locator_split(\"txtstockdamagepc\"));\r\n\t\t\t \tsleep(2000);\r\n\t\t\t \tsendKeys(locator_split(\"txtstockdamagepc\"), getValue(\"StockDamagePCMas\"));\r\n\t\t\t \tsleep(1000);\r\n\t\t\t \tclearWebEdit(locator_split(\"txtotherpddmagepc\"));\r\n\t\t\t \tsleep(2000);\r\n\t\t\t \tsendKeys(locator_split(\"txtotherpddmagepc\"), getValue(\"OtherPDDamagePCMas\"));\r\n\t\t\t \tsleep(1000);\r\n\t\t\t \t\r\n\t\t\t }\r\n\t\t\t \r\n\t\t\t click(locator_split(\"linkexpandbilossestimates\"));\r\n\t\t\t sleep(3000);\r\n\t\t\t // click(locator_split(\"linkaddroweml\"));\r\n\t\t\t // sleep(3000);\r\n\t\t\t // click(locator_split(\"linkaddroweml\"));\r\n\t\t\t// sleep(3000);\r\n\t\t\t \r\n\t\t\t selectListValue(locator_split(\"listbidowntime\"), getValue(\"BIDownTimeMas\"));\r\n\t\t\t sleep(2000);\r\n\t\t\t clearWebEdit(locator_split(\"txtbiaffected\"));\r\n\t\t\t sleep(2000);\r\n\t\t\t sendKeys(locator_split(\"txtbiaffected\"), getValue(\"BIAffectedMas\"));\r\n\t\t\t sleep(2000);\r\n\t\t\t clearWebEdit(locator_split(\"txtbidowntime\"));\r\n\t\t\t sleep(2000);\r\n\t\t\t sendKeys(locator_split(\"txtbidowntime\"), getValue(\"BIDownTimeValueMas\"));\r\n\t\t\t sleep(2000);\r\n\t\t\t click(locator_split(\"linkexpandothertecobverage\"));\r\n\t\t\t sleep(2000);\r\n\t\t\t if (getValue(\"Radiobutton\").contains(\"Value\")){\r\n\t\t\t \tClickRadiobutton(locator_split(\"radiovalue2\"));\r\n\t\t\t \tsleep(2000);\r\n\t\t\t \tclearWebEdit(locator_split(\"txteeloss\"));\r\n\t\t\t\t sleep(2000);\r\n\t\t\t\t sendKeys(locator_split(\"txteeloss\"), getValue(\"EELoss1\"));\r\n\t\t\t\t sleep(2000);\r\n\t\t\t \tclearWebEdit(locator_split(\"txtothertecoverageloss\"));\r\n\t\t\t\t sleep(2000);\r\n\t\t\t\t sendKeys(locator_split(\"txtothertecoverageloss\"), getValue(\"OtherTE1CoverageLoss1\"));\r\n\t\t\t\t sleep(2000);\r\n\t\t\t \tclearWebEdit(locator_split(\"txtothertecoverage2loss\"));\r\n\t\t\t\t sleep(2000);\r\n\t\t\t\t sendKeys(locator_split(\"txtothertecoverage2loss\"), getValue(\"OtherTE2CoverageLoss1\"));\r\n\t\t\t\t sleep(2000);\r\n\t\t\t \tclearWebEdit(locator_split(\"txtothertecoverage3loss\"));\r\n\t\t\t\t sleep(2000);\r\n\t\t\t\t sendKeys(locator_split(\"txtothertecoverage3loss\"), getValue(\"OtherTE3CoverageLoss1\"));\r\n\t\t\t\t sleep(2000);\r\n\t\t\t \tclearWebEdit(locator_split(\"txtibiloss\"));\r\n\t\t\t\t sleep(2000);\r\n\t\t\t\t sendKeys(locator_split(\"txtibiloss\"), getValue(\"IBILoss1\"));\r\n\t\t\t\t sleep(2000);\r\n\t\t\t \tclearWebEdit(locator_split(\"txtcbiloss\"));\r\n\t\t\t\t sleep(2000);\r\n\t\t\t\t sendKeys(locator_split(\"txtcbiloss\"), getValue(\"CBILoss1\"));\r\n\t\t\t\t \r\n\t\t\t //if (driver.findElement(By.xpath(\".//*[@id='LECompletedFlag']\")).isSelected()== true ){\r\n\t\t\t \t\r\n\t\t\t //}\r\n\t\t\t // click(locator_split(\"checklecompleted\"));\r\n\t\t\t// driver.findElement(By.xpath(\".//*[@id='LECompletedFlag']\")).click();\r\n\t\t\t \t\r\n\t\t\t }else{\r\n\t\t\t \t\r\n\t\t\t \tClickRadiobutton(locator_split(\"radiopercentage2\"));\r\n\t\t\t \tsleep(2000);\r\n\t\t\t \tclearWebEdit(locator_split(\"txteelosspc\"));\r\n\t\t\t\t sleep(2000);\r\n\t\t\t\t sendKeys(locator_split(\"txteelosspc\"), getValue(\"EELoss1PC\"));\r\n\t\t\t\t sleep(2000);\r\n\t\t\t \tclearWebEdit(locator_split(\"txtothertecoveragelosspc\"));\r\n\t\t\t\t sleep(2000);\r\n\t\t\t\t sendKeys(locator_split(\"txtothertecoveragelosspc\"), getValue(\"OtherTE1CoverageLoss1PC\"));\r\n\t\t\t\t sleep(2000);\r\n\t\t\t \tclearWebEdit(locator_split(\"txtothertecoverage2losspc\"));\r\n\t\t\t\t sleep(2000);\r\n\t\t\t\t sendKeys(locator_split(\"txtothertecoverage2losspc\"), getValue(\"OtherTE2CoverageLoss1PC\"));\r\n\t\t\t\t sleep(2000);\r\n\t\t\t \tclearWebEdit(locator_split(\"txtothertecoverage3losspc\"));\r\n\t\t\t\t sleep(2000);\r\n\t\t\t\t sendKeys(locator_split(\"txtothertecoverage3losspc\"), getValue(\"OtherTE3CoverageLoss1PC\"));\r\n\t\t\t\t sleep(2000);\r\n\t\t\t \tclearWebEdit(locator_split(\"txtibilosspc\"));\r\n\t\t\t\t sleep(2000);\r\n\t\t\t\t sendKeys(locator_split(\"txtibilosspc\"), getValue(\"IBILoss1PC\"));\r\n\t\t\t\t sleep(2000);\r\n\t\t\t \tclearWebEdit(locator_split(\"txtcbilosspc\"));\r\n\t\t\t\t sleep(2000);\r\n\t\t\t\t sendKeys(locator_split(\"txtcbilosspc\"), getValue(\"CBILoss1PC\"));\r\n\t\t\t }\r\n\t\t\t if (driver.findElement(By.xpath(\".//*[@id='LECompletedFlag']\")).isSelected()== true ){\r\n\t\t\t\t\t driver.findElement(By.xpath(\"//input[@id='LECompletedFlag']\")).click();\r\n\t\t\t\t\t\tsleep(2000);\r\n\t\t\t\t }\r\n\t\t\t\tdriver.findElement(By.xpath(\"//input[@id='LECompletedFlag']\")).click();\r\n\t\t\t\tsleep(2000);\r\n\t\t\t// driver.findElement(By.xpath(\"//input[@id='LECompletedFlag']\")).click();\r\n\t\t\t //sendkeys(driver.findElement(By.xpath(\"//input[@name='USER']\")),\"jkdkd\");\r\n\t\t\t // sleep(2000);\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\t \r\n\t\t\t /////////////MFL/////////////////////\r\n\t\t\t \r\n\t\t\t click(locator_split(\"tabmfl\"));\r\n\t\t\t sleep(5000);\r\n\t\t\t // click(locator_split(\"linkexpandpdlossestimates\"));\r\n\t\t\t sleep(3000);\r\n\t\t\t if (getValue(\"Radiobutton\").contains(\"Value\")){\r\n\t\t\t \tClickRadiobutton(locator_split(\"radiovalue\"));\r\n\t\t\t \tsleep(2000);\r\n\t\t\t \tSystem.out.println(\"After clicking Radio button\");\r\n\t\t\t \tsleep(1000);\r\n\t\t\t \tclearWebEdit(locator_split(\"txtbuildingdamage\"));\r\n\t\t\t \tsleep(3000);\r\n\t\t\t \tclearWebEdit(locator_split(\"txtbuildingdamage\"));\r\n\t\t\t \tsleep(2000);\r\n\t\t\t \tsendKeys(locator_split(\"txtbuildingdamage\"), getValue(\"BuildingDamageMfl1\"));\r\n\t\t\t \tsleep(1000);\r\n\t\t\t \tclearWebEdit(locator_split(\"txtmeDamage\"));\r\n\t\t\t \tsleep(2000);\r\n\t\t\t \tsendKeys(locator_split(\"txtmeDamage\"), getValue(\"MEDamageMfl1\"));\r\n\t\t\t \tsleep(1000);\r\n\t\t\t \tclearWebEdit(locator_split(\"txtcontentdamage\"));\r\n\t\t\t \tsleep(2000);\r\n\t\t\t \tsendKeys(locator_split(\"txtcontentdamage\"), getValue(\"ContentDamageMfl1\"));\r\n\t\t\t \tsleep(1000);\r\n\t\t\t \tclearWebEdit(locator_split(\"txtstockdamage\"));\r\n\t\t\t \tsleep(2000);\r\n\t\t\t \tsendKeys(locator_split(\"txtstockdamage\"), getValue(\"StockDamageMfl1\"));\r\n\t\t\t \tsleep(1000);\r\n\t\t\t \tclearWebEdit(locator_split(\"txtotherpddamage\"));\r\n\t\t\t \tsleep(2000);\r\n\t\t\t \tsendKeys(locator_split(\"txtotherpddamage\"), getValue(\"OtherPDDamageMfl1\"));\r\n\t\t\t \tsleep(1000);\r\n\t\t\t \t\r\n\t\t\t }else{\r\n\t\t\t \tClickRadiobutton(locator_split(\"radiopercentage\"));\r\n\t\t\t \tsleep(2000);\r\n\t\t\t \tclearWebEdit(locator_split(\"txtbuildingdamagepc\"));\r\n\t\t\t \tsleep(2000);\r\n\t\t\t \tclearWebEdit(locator_split(\"txtbuildingdamagepc\"));\r\n\t\t\t \tsleep(2000);\r\n\t\t\t \tclearWebEdit(locator_split(\"txtbuildingdamagepc\"));\r\n\t\t\t \tsleep(2000);\r\n\t\t\t \tsendKeys(locator_split(\"txtbuildingdamagepc\"), getValue(\"BuildingDamageMflPC1\"));\r\n\t\t\t \tsleep(1000);\r\n\t\t\t \tclearWebEdit(locator_split(\"txtmedamagepc\"));\r\n\t\t\t \tsleep(2000);\r\n\t\t\t \tsendKeys(locator_split(\"txtmedamagepc\"), getValue(\"MEDamageMflPC1\"));\r\n\t\t\t \tsleep(1000);\r\n\t\t\t \tclearWebEdit(locator_split(\"txtcontentdamagepc\"));\r\n\t\t\t \tsleep(2000);\r\n\t\t\t \tsendKeys(locator_split(\"txtcontentdamagepc\"), getValue(\"ContentDamageMflPC1\"));\r\n\t\t\t \tsleep(1000);\r\n\t\t\t \tclearWebEdit(locator_split(\"txtstockdamagepc\"));\r\n\t\t\t \tsleep(2000);\r\n\t\t\t \tsendKeys(locator_split(\"txtstockdamagepc\"), getValue(\"StockDamageMflPC1\"));\r\n\t\t\t \tsleep(1000);\r\n\t\t\t \tclearWebEdit(locator_split(\"txtotherpddmagepc\"));\r\n\t\t\t \tsleep(2000);\r\n\t\t\t \tsendKeys(locator_split(\"txtotherpddmagepc\"), getValue(\"OtherPDDamageMflPC1\"));\r\n\t\t\t \tsleep(1000);\r\n\t\t\t \t\r\n\t\t\t }\r\n\t\t\t \r\n\t\t\t // click(locator_split(\"linkexpandbilossestimates\"));\r\n\t\t\t sleep(3000);\r\n\t\t\t /* click(locator_split(\"linkaddroweml\"));\r\n\t\t\t sleep(3000);\r\n\t\t\t click(locator_split(\"linkaddroweml\"));\r\n\t\t\t sleep(3000);*/\r\n\t\t\t \r\n\t\t\t selectListValue(locator_split(\"listbidowntime\"), getValue(\"BIDownTimeMfl1\"));\r\n\t\t\t sleep(2000);\r\n\t\t\t clearWebEdit(locator_split(\"txtbiaffected\"));\r\n\t\t\t sleep(2000);\r\n\t\t\t sendKeys(locator_split(\"txtbiaffected\"), getValue(\"BIAffectedMfl1\"));\r\n\t\t\t sleep(5000);\r\n\t\t\t clearWebEdit(locator_split(\"txtbidowntime\"));\r\n\t\t\t sleep(2000);\r\n\t\t\t sendKeys(locator_split(\"txtbidowntime\"), getValue(\"BIDownTimeValueMfl1\"));\r\n\t\t\t sleep(2000);\r\n\t\t\t // click(locator_split(\"linkexpandothertecobverage\"));\r\n\t\t\t sleep(2000);\r\n\t\t\t if (getValue(\"Radiobutton\").contains(\"Value\")){\r\n\t\t\t \tClickRadiobutton(locator_split(\"radiovaluemfs\"));\r\n\t\t\t \tsleep(2000);\r\n\t\t\t \tclearWebEdit(locator_split(\"txteeloss\"));\r\n\t\t\t\t sleep(2000);\r\n\t\t\t\t sendKeys(locator_split(\"txteeloss\"), getValue(\"EELossMfl\"));\r\n\t\t\t\t sleep(2000);\r\n\t\t\t \tclearWebEdit(locator_split(\"txtothertecoverageloss\"));\r\n\t\t\t\t sleep(2000);\r\n\t\t\t\t sendKeys(locator_split(\"txtothertecoverageloss\"), getValue(\"OtherTE1CoverageLossMfl\"));\r\n\t\t\t\t sleep(2000);\r\n\t\t\t \tclearWebEdit(locator_split(\"txtothertecoverage2loss\"));\r\n\t\t\t\t sleep(2000);\r\n\t\t\t\t sendKeys(locator_split(\"txtothertecoverage2loss\"), getValue(\"OtherTE2CoverageLossMfl\"));\r\n\t\t\t\t sleep(2000);\r\n\t\t\t \tclearWebEdit(locator_split(\"txtothertecoverage3loss\"));\r\n\t\t\t\t sleep(2000);\r\n\t\t\t\t sendKeys(locator_split(\"txtothertecoverage3loss\"), getValue(\"OtherTE3CoverageLossMfl\"));\r\n\t\t\t\t sleep(2000);\r\n\t\t\t \tclearWebEdit(locator_split(\"txtibiloss\"));\r\n\t\t\t\t sleep(2000);\r\n\t\t\t\t sendKeys(locator_split(\"txtibiloss\"), getValue(\"IBILossMfl\"));\r\n\t\t\t\t sleep(2000);\r\n\t\t\t \tclearWebEdit(locator_split(\"txtcbiloss\"));\r\n\t\t\t\t sleep(2000);\r\n\t\t\t\t sendKeys(locator_split(\"txtcbiloss\"), getValue(\"CBILossMfl\"));\r\n\t\t\t\t \r\n\t\t\t //if (driver.findElement(By.xpath(\".//*[@id='LECompletedFlag']\")).isSelected()== true ){\r\n\t\t\t \t\r\n\t\t\t //}\r\n\t\t\t // click(locator_split(\"checklecompleted\"));\r\n\t\t\t// driver.findElement(By.xpath(\".//*[@id='LECompletedFlag']\")).click();\r\n\t\t\t \t\r\n\t\t\t }else{\r\n\t\t\t \t\r\n\t\t\t \tClickRadiobutton(locator_split(\"radiopercentagemfl\"));\r\n\t\t\t \tsleep(2000);\r\n\t\t\t \tclearWebEdit(locator_split(\"txteelosspc\"));\r\n\t\t\t\t sleep(2000);\r\n\t\t\t\t sendKeys(locator_split(\"txteelosspc\"), getValue(\"EELossMflPC\"));\r\n\t\t\t\t sleep(2000);\r\n\t\t\t \tclearWebEdit(locator_split(\"txtothertecoveragelosspc\"));\r\n\t\t\t\t sleep(2000);\r\n\t\t\t\t sendKeys(locator_split(\"txtothertecoveragelosspc\"), getValue(\"OtherTE1CoverageLossMflPC\"));\r\n\t\t\t\t sleep(2000);\r\n\t\t\t \tclearWebEdit(locator_split(\"txtothertecoverage2losspc\"));\r\n\t\t\t\t sleep(2000);\r\n\t\t\t\t sendKeys(locator_split(\"txtothertecoverage2losspc\"), getValue(\"OtherTE2CoverageLossMflPC\"));\r\n\t\t\t\t sleep(2000);\r\n\t\t\t \tclearWebEdit(locator_split(\"txtothertecoverage3losspc\"));\r\n\t\t\t\t sleep(2000);\r\n\t\t\t\t sendKeys(locator_split(\"txtothertecoverage3losspc\"), getValue(\"OtherTE3CoverageLossMflPC\"));\r\n\t\t\t\t sleep(2000);\r\n\t\t\t \tclearWebEdit(locator_split(\"txtibilosspc\"));\r\n\t\t\t\t sleep(2000);\r\n\t\t\t\t sendKeys(locator_split(\"txtibilosspc\"), getValue(\"IBILossMflPC\"));\r\n\t\t\t\t sleep(2000);\r\n\t\t\t \tclearWebEdit(locator_split(\"txtcbilosspc\"));\r\n\t\t\t\t sleep(2000);\r\n\t\t\t\t sendKeys(locator_split(\"txtcbilosspc\"), getValue(\"CBILossMfPC\"));\r\n\t\t\t }\r\n\t\t\t if (driver.findElement(By.xpath(\".//*[@id='LECompletedFlag']\")).isSelected()== true ){\r\n\t\t\t\t\t driver.findElement(By.xpath(\"//input[@id='LECompletedFlag']\")).click();\r\n\t\t\t\t\t\tsleep(2000);\r\n\t\t\t\t }\r\n\t\t\t\tdriver.findElement(By.xpath(\"//input[@id='LECompletedFlag']\")).click();\r\n\t\t\t\tsleep(2000);\r\n\t\t\t // driver.findElement(By.xpath(\"//input[@id='LECompletedFlag']\")).click();\r\n\t\t\t //sendkeys(driver.findElement(By.xpath(\"//input[@name='USER']\")),\"jkdkd\");\r\n\t\t\t // sleep(2000);\r\n\t\t\t ///////////////MFL/////////////\r\n\t/////////////PML/////////////////////\r\n\t\t\t\t \r\n\t\t\t\t click(locator_split(\"tabpml\"));\r\n\t\t\t\t sleep(5000);\r\n\t\t\t\t // click(locator_split(\"linkexpandpdlossestimates\"));\r\n\t\t\t\t sleep(3000);\r\n\t\t\t\t if (getValue(\"Radiobutton\").contains(\"Value\")){\r\n\t\t\t\t \tClickRadiobutton(locator_split(\"radiovalue\"));\r\n\t\t\t\t \tsleep(2000);\r\n\t\t\t\t \tSystem.out.println(\"After clicking Radio button\");\r\n\t\t\t\t \tsleep(1000);\r\n\t\t\t\t \tclearWebEdit(locator_split(\"txtbuildingdamage\"));\r\n\t\t\t\t \tsleep(3000);\r\n\t\t\t\t \tclearWebEdit(locator_split(\"txtbuildingdamage\"));\r\n\t\t\t\t \tsleep(2000);\r\n\t\t\t\t \tsendKeys(locator_split(\"txtbuildingdamage\"), getValue(\"BuildingDamageMfl1\"));\r\n\t\t\t\t \tsleep(1000);\r\n\t\t\t\t \tclearWebEdit(locator_split(\"txtmeDamage\"));\r\n\t\t\t\t \tsleep(2000);\r\n\t\t\t\t \tsendKeys(locator_split(\"txtmeDamage\"), getValue(\"MEDamageMfl1\"));\r\n\t\t\t\t \tsleep(1000);\r\n\t\t\t\t \tclearWebEdit(locator_split(\"txtcontentdamage\"));\r\n\t\t\t\t \tsleep(2000);\r\n\t\t\t\t \tsendKeys(locator_split(\"txtcontentdamage\"), getValue(\"ContentDamageMfl1\"));\r\n\t\t\t\t \tsleep(1000);\r\n\t\t\t\t \tclearWebEdit(locator_split(\"txtstockdamage\"));\r\n\t\t\t\t \tsleep(2000);\r\n\t\t\t\t \tsendKeys(locator_split(\"txtstockdamage\"), getValue(\"StockDamageMfl1\"));\r\n\t\t\t\t \tsleep(1000);\r\n\t\t\t\t \tclearWebEdit(locator_split(\"txtotherpddamage\"));\r\n\t\t\t\t \tsleep(2000);\r\n\t\t\t\t \tsendKeys(locator_split(\"txtotherpddamage\"), getValue(\"OtherPDDamageMfl1\"));\r\n\t\t\t\t \tsleep(1000);\r\n\t\t\t\t \t\r\n\t\t\t\t }else{\r\n\t\t\t\t \tClickRadiobutton(locator_split(\"radiopercentage\"));\r\n\t\t\t\t \tsleep(2000);\r\n\t\t\t\t \tclearWebEdit(locator_split(\"txtbuildingdamagepc\"));\r\n\t\t\t\t \tsleep(2000);\r\n\t\t\t\t \tclearWebEdit(locator_split(\"txtbuildingdamagepc\"));\r\n\t\t\t\t \tsleep(2000);\r\n\t\t\t\t \tclearWebEdit(locator_split(\"txtbuildingdamagepc\"));\r\n\t\t\t\t \tsleep(2000);\r\n\t\t\t\t \tsendKeys(locator_split(\"txtbuildingdamagepc\"), getValue(\"BuildingDamageMflPC1\"));\r\n\t\t\t\t \tsleep(1000);\r\n\t\t\t\t \tclearWebEdit(locator_split(\"txtmedamagepc\"));\r\n\t\t\t\t \tsleep(2000);\r\n\t\t\t\t \tsendKeys(locator_split(\"txtmedamagepc\"), getValue(\"MEDamageMflPC1\"));\r\n\t\t\t\t \tsleep(1000);\r\n\t\t\t\t \tclearWebEdit(locator_split(\"txtcontentdamagepc\"));\r\n\t\t\t\t \tsleep(2000);\r\n\t\t\t\t \tsendKeys(locator_split(\"txtcontentdamagepc\"), getValue(\"ContentDamageMflPC1\"));\r\n\t\t\t\t \tsleep(1000);\r\n\t\t\t\t \tclearWebEdit(locator_split(\"txtstockdamagepc\"));\r\n\t\t\t\t \tsleep(2000);\r\n\t\t\t\t \tsendKeys(locator_split(\"txtstockdamagepc\"), getValue(\"StockDamageMflPC1\"));\r\n\t\t\t\t \tsleep(1000);\r\n\t\t\t\t \tclearWebEdit(locator_split(\"txtotherpddmagepc\"));\r\n\t\t\t\t \tsleep(2000);\r\n\t\t\t\t \tsendKeys(locator_split(\"txtotherpddmagepc\"), getValue(\"OtherPDDamageMflPC1\"));\r\n\t\t\t\t \tsleep(1000);\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 // click(locator_split(\"linkexpandbilossestimates\"));\r\n\t\t\t\t /* sleep(3000);\r\n\t\t\t\t click(locator_split(\"linkaddroweml\"));\r\n\t\t\t\t sleep(3000);\r\n\t\t\t\t click(locator_split(\"linkaddroweml\"));\r\n\t\t\t\t sleep(3000);*/\r\n\t\t\t\t sleep(3000);\r\n\t\t\t\t selectListValue(locator_split(\"listbidowntime\"), getValue(\"BIDownTimeMfl1\"));\r\n\t\t\t\t sleep(2000);\r\n\t\t\t\t clearWebEdit(locator_split(\"txtbiaffected\"));\r\n\t\t\t\t sleep(2000);\r\n\t\t\t\t sendKeys(locator_split(\"txtbiaffected\"), getValue(\"BIAffectedMfl1\"));\r\n\t\t\t\t sleep(5000);\r\n\t\t\t\t clearWebEdit(locator_split(\"txtbidowntime\"));\r\n\t\t\t\t sleep(2000);\r\n\t\t\t\t sendKeys(locator_split(\"txtbidowntime\"), getValue(\"BIDownTimeValueMfl1\"));\r\n\t\t\t\t sleep(2000);\r\n\t\t\t\t // click(locator_split(\"linkexpandothertecobverage\"));\r\n\t\t\t\t sleep(2000);\r\n\t\t\t\t if (getValue(\"Radiobutton\").contains(\"Value\")){\r\n\t\t\t\t \tSystem.out.println(\"Inside If Loop\");\r\n\t\t\t\t \t//ClickRadiobutton(locator_split(\"radiovaluepml\"));\r\n\t\t\t\t \tsleep(5000);\r\n\t\t\t\t \tclearWebEdit(locator_split(\"txteeloss\"));\r\n\t\t\t\t\t sleep(2000);\r\n\t\t\t\t\t sendKeys(locator_split(\"txteeloss\"), getValue(\"EELossMfl\"));\r\n\t\t\t\t\t sleep(2000);\r\n\t\t\t\t \tclearWebEdit(locator_split(\"txtothertecoverageloss\"));\r\n\t\t\t\t\t sleep(2000);\r\n\t\t\t\t\t sendKeys(locator_split(\"txtothertecoverageloss\"), getValue(\"OtherTE1CoverageLossMfl\"));\r\n\t\t\t\t\t sleep(2000);\r\n\t\t\t\t \tclearWebEdit(locator_split(\"txtothertecoverage2loss\"));\r\n\t\t\t\t\t sleep(3000);\r\n\t\t\t\t\t sendKeys(locator_split(\"txtothertecoverage2loss\"), getValue(\"OtherTE2CoverageLossMfl\"));\r\n\t\t\t\t\t sleep(3000);\r\n\t\t\t\t \tclearWebEdit(locator_split(\"txtothertecoverage3loss\"));\r\n\t\t\t\t\t sleep(2000);\r\n\t\t\t\t\t sendKeys(locator_split(\"txtothertecoverage3loss\"), getValue(\"OtherTE3CoverageLossMfl\"));\r\n\t\t\t\t\t sleep(2000);\r\n\t\t\t\t \tclearWebEdit(locator_split(\"txtibiloss\"));\r\n\t\t\t\t\t sleep(2000);\r\n\t\t\t\t\t sendKeys(locator_split(\"txtibiloss\"), getValue(\"IBILossPML\"));\r\n\t\t\t\t\t sleep(2000);\r\n\t\t\t\t \tclearWebEdit(locator_split(\"txtcbiloss\"));\r\n\t\t\t\t\t sleep(2000);\r\n\t\t\t\t\t sendKeys(locator_split(\"txtcbiloss\"), getValue(\"CBILossPML\"));\r\n\t\t\t\t\t \r\n\t\t\t\t //if (driver.findElement(By.xpath(\".//*[@id='LECompletedFlag']\")).isSelected()== true ){\r\n\t\t\t\t \t\r\n\t\t\t\t //}\r\n\t\t\t\t // click(locator_split(\"checklecompleted\"));\r\n\t\t\t\t// driver.findElement(By.xpath(\".//*[@id='LECompletedFlag']\")).click();\r\n\t\t\t\t \t\r\n\t\t\t\t }else{\r\n\t\t\t\t \t\r\n\t\t\t\t \tClickRadiobutton(locator_split(\"radiopercentage3\"));\r\n\t\t\t\t \tsleep(2000);\r\n\t\t\t\t \tclearWebEdit(locator_split(\"txteelosspc\"));\r\n\t\t\t\t\t sleep(2000);\r\n\t\t\t\t\t sendKeys(locator_split(\"txteelosspc\"), getValue(\"EELossPML1\"));\r\n\t\t\t\t\t sleep(2000);\r\n\t\t\t\t \tclearWebEdit(locator_split(\"txtothertecoveragelosspc\"));\r\n\t\t\t\t\t sleep(2000);\r\n\t\t\t\t\t sendKeys(locator_split(\"txtothertecoveragelosspc\"), getValue(\"OtherTE1CoverageLossPMLPC\"));\r\n\t\t\t\t\t sleep(2000);\r\n\t\t\t\t \tclearWebEdit(locator_split(\"txtothertecoverage2losspc\"));\r\n\t\t\t\t\t sleep(2000);\r\n\t\t\t\t\t sendKeys(locator_split(\"txtothertecoverage2losspc\"), getValue(\"OtherTE2CoverageLossPMLPC\"));\r\n\t\t\t\t\t sleep(2000);\r\n\t\t\t\t \tclearWebEdit(locator_split(\"txtothertecoverage3losspc\"));\r\n\t\t\t\t\t sleep(2000);\r\n\t\t\t\t\t sendKeys(locator_split(\"txtothertecoverage3losspc\"), getValue(\"OtherTE3CoverageLossPMLPC\"));\r\n\t\t\t\t\t sleep(2000);\r\n\t\t\t\t \tclearWebEdit(locator_split(\"txtibilosspc\"));\r\n\t\t\t\t\t sleep(2000);\r\n\t\t\t\t\t sendKeys(locator_split(\"txtibilosspc\"), getValue(\"IBILossPMLPC\"));\r\n\t\t\t\t\t sleep(2000);\r\n\t\t\t\t \tclearWebEdit(locator_split(\"txtcbilosspc\"));\r\n\t\t\t\t\t sleep(2000);\r\n\t\t\t\t\t sendKeys(locator_split(\"txtcbilosspc\"), getValue(\"CBILossPMLPC\"));\r\n\t\t\t\t\t sleep(2000);\r\n\t\t\t\t }\r\n\t\t\t\t if (driver.findElement(By.xpath(\".//*[@id='LECompletedFlag']\")).isSelected()== true ){\r\n\t\t\t\t\t\t driver.findElement(By.xpath(\"//input[@id='LECompletedFlag']\")).click();\r\n\t\t\t\t\t\t\tsleep(2000);\r\n\t\t\t\t\t }\r\n\t\t\t\t\tdriver.findElement(By.xpath(\"//input[@id='LECompletedFlag']\")).click();\r\n\t\t\t\t\tsleep(2000);\r\n\t\t\t\t // driver.findElement(By.xpath(\"//input[@id='LECompletedFlag']\")).click();\r\n\t\t\t\t //sendkeys(driver.findElement(By.xpath(\"//input[@name='USER']\")),\"jkdkd\");\r\n\t\t\t\t // sleep(2000);\r\n\t\t\t\t ///////////////PML/////////////\r\n\t\t\t\t //////////////NLE Manual////////////////\r\n\t\r\n\t\t\t\t\t \r\n\t\t\t\t\t click(locator_split(\"tabnlemanual\"));\r\n\t\t\t\t\t sleep(5000);\r\n\t\t\t\t\t // click(locator_split(\"linkexpandpdlossestimates\"));\r\n\t\t\t\t\t sleep(3000);\r\n\t\t\t\t\t if (getValue(\"Radiobutton\").contains(\"Value\")){\r\n\t\t\t\t\t \tClickRadiobutton(locator_split(\"radiovalue\"));\r\n\t\t\t\t\t \tsleep(2000);\r\n\t\t\t\t\t \tSystem.out.println(\"After clicking Radio button\");\r\n\t\t\t\t\t \tsleep(1000);\r\n\t\t\t\t\t \tclearWebEdit(locator_split(\"txtbuildingdamage\"));\r\n\t\t\t\t\t \tsleep(3000);\r\n\t\t\t\t\t \tclearWebEdit(locator_split(\"txtbuildingdamage\"));\r\n\t\t\t\t\t \tsleep(2000);\r\n\t\t\t\t\t \tsendKeys(locator_split(\"txtbuildingdamage\"), getValue(\"BuildingDamageNLE1\"));\r\n\t\t\t\t\t \tsleep(1000);\r\n\t\t\t\t\t \tclearWebEdit(locator_split(\"txtmeDamage\"));\r\n\t\t\t\t\t \tsleep(2000);\r\n\t\t\t\t\t \tsendKeys(locator_split(\"txtmeDamage\"), getValue(\"MEDamageNLE1\"));\r\n\t\t\t\t\t \tsleep(1000);\r\n\t\t\t\t\t \tclearWebEdit(locator_split(\"txtcontentdamage\"));\r\n\t\t\t\t\t \tsleep(2000);\r\n\t\t\t\t\t \tsendKeys(locator_split(\"txtcontentdamage\"), getValue(\"ContentDamageNLE1\"));\r\n\t\t\t\t\t \tsleep(1000);\r\n\t\t\t\t\t \tclearWebEdit(locator_split(\"txtstockdamage\"));\r\n\t\t\t\t\t \tsleep(2000);\r\n\t\t\t\t\t \tsendKeys(locator_split(\"txtstockdamage\"), getValue(\"StockDamageNLE1\"));\r\n\t\t\t\t\t \tsleep(1000);\r\n\t\t\t\t\t \tclearWebEdit(locator_split(\"txtotherpddamage\"));\r\n\t\t\t\t\t \tsleep(2000);\r\n\t\t\t\t\t \tsendKeys(locator_split(\"txtotherpddamage\"), getValue(\"OtherPDDamageNLE1\"));\r\n\t\t\t\t\t \tsleep(1000);\r\n\t\t\t\t\t \t\r\n\t\t\t\t\t }else{\r\n\t\t\t\t\t \tClickRadiobutton(locator_split(\"radiopercentage\"));\r\n\t\t\t\t\t \tsleep(2000);\r\n\t\t\t\t\t \tclearWebEdit(locator_split(\"txtbuildingdamagepc\"));\r\n\t\t\t\t\t \tsleep(2000);\r\n\t\t\t\t\t \tclearWebEdit(locator_split(\"txtbuildingdamagepc\"));\r\n\t\t\t\t\t \tsleep(2000);\r\n\t\t\t\t\t \tclearWebEdit(locator_split(\"txtbuildingdamagepc\"));\r\n\t\t\t\t\t \tsleep(2000);\r\n\t\t\t\t\t \tsendKeys(locator_split(\"txtbuildingdamagepc\"), getValue(\"BuildingDamageNLEPC1\"));\r\n\t\t\t\t\t \tsleep(1000);\r\n\t\t\t\t\t \tclearWebEdit(locator_split(\"txtmedamagepc\"));\r\n\t\t\t\t\t \tsleep(2000);\r\n\t\t\t\t\t \tsendKeys(locator_split(\"txtmedamagepc\"), getValue(\"MEDamageNLEPC1\"));\r\n\t\t\t\t\t \tsleep(1000);\r\n\t\t\t\t\t \tclearWebEdit(locator_split(\"txtcontentdamagepc\"));\r\n\t\t\t\t\t \tsleep(2000);\r\n\t\t\t\t\t \tsendKeys(locator_split(\"txtcontentdamagepc\"), getValue(\"ContentDamageNLEPC1\"));\r\n\t\t\t\t\t \tsleep(1000);\r\n\t\t\t\t\t \tclearWebEdit(locator_split(\"txtstockdamagepc\"));\r\n\t\t\t\t\t \tsleep(2000);\r\n\t\t\t\t\t \tsendKeys(locator_split(\"txtstockdamagepc\"), getValue(\"StockDamageNLEPC1\"));\r\n\t\t\t\t\t \tsleep(1000);\r\n\t\t\t\t\t \tclearWebEdit(locator_split(\"txtotherpddmagepc\"));\r\n\t\t\t\t\t \tsleep(2000);\r\n\t\t\t\t\t \tsendKeys(locator_split(\"txtotherpddmagepc\"), getValue(\"OtherPDDamageNLEPC1\"));\r\n\t\t\t\t\t \tsleep(1000);\r\n\t\t\t\t\t \t\r\n\t\t\t\t\t }\r\n\t\t\t\t\t \r\n\t\t\t\t\t // click(locator_split(\"linkexpandbilossestimates\"));\r\n\t\t\t\t\t /* sleep(3000);\r\n\t\t\t\t\t click(locator_split(\"linkaddroweml\"));\r\n\t\t\t\t\t sleep(3000);\r\n\t\t\t\t\t click(locator_split(\"linkaddroweml\"));\r\n\t\t\t\t\t sleep(3000);*/\r\n\t\t\t\t\t sleep(3000);\r\n\t\t\t\t\t selectListValue(locator_split(\"listbidowntime\"), getValue(\"BIDownTimeNLE1\"));\r\n\t\t\t\t\t sleep(2000);\r\n\t\t\t\t\t clearWebEdit(locator_split(\"txtbiaffected\"));\r\n\t\t\t\t\t sleep(2000);\r\n\t\t\t\t\t sendKeys(locator_split(\"txtbiaffected\"), getValue(\"BIAffectedNLE1\"));\r\n\t\t\t\t\t sleep(5000);\r\n\t\t\t\t\t clearWebEdit(locator_split(\"txtbidowntime\"));\r\n\t\t\t\t\t sleep(2000);\r\n\t\t\t\t\t sendKeys(locator_split(\"txtbidowntime\"), getValue(\"BIDownTimeValueNLE1\"));\r\n\t\t\t\t\t sleep(2000);\r\n\t\t\t\t\t // click(locator_split(\"linkexpandothertecobverage\"));\r\n\t\t\t\t\t sleep(2000);\r\n\t\t\t\t\t if (getValue(\"Radiobutton\").contains(\"Value\")){\r\n\t\t\t\t\t \tSystem.out.println(\"Inside If Loop\");\r\n\t\t\t\t\t \t//ClickRadiobutton(locator_split(\"radiovaluepml\"));\r\n\t\t\t\t\t \tsleep(5000);\r\n\t\t\t\t\t \tclearWebEdit(locator_split(\"txteeloss\"));\r\n\t\t\t\t\t\t sleep(2000);\r\n\t\t\t\t\t\t sendKeys(locator_split(\"txteeloss\"), getValue(\"EELossNLE\"));\r\n\t\t\t\t\t\t sleep(2000);\r\n\t\t\t\t\t \tclearWebEdit(locator_split(\"txtothertecoverageloss\"));\r\n\t\t\t\t\t\t sleep(2000);\r\n\t\t\t\t\t\t sendKeys(locator_split(\"txtothertecoverageloss\"), getValue(\"OtherTE1CoverageLossNLE\"));\r\n\t\t\t\t\t\t sleep(2000);\r\n\t\t\t\t\t \tclearWebEdit(locator_split(\"txtothertecoverage2loss\"));\r\n\t\t\t\t\t\t sleep(3000);\r\n\t\t\t\t\t\t sendKeys(locator_split(\"txtothertecoverage2loss\"), getValue(\"OtherTE2CoverageLossNLE\"));\r\n\t\t\t\t\t\t sleep(3000);\r\n\t\t\t\t\t \tclearWebEdit(locator_split(\"txtothertecoverage3loss\"));\r\n\t\t\t\t\t\t sleep(2000);\r\n\t\t\t\t\t\t sendKeys(locator_split(\"txtothertecoverage3loss\"), getValue(\"OtherTE3CoverageLossNLE\"));\r\n\t\t\t\t\t\t sleep(2000);\r\n\t\t\t\t\t \tclearWebEdit(locator_split(\"txtibiloss\"));\r\n\t\t\t\t\t\t sleep(2000);\r\n\t\t\t\t\t\t sendKeys(locator_split(\"txtibiloss\"), getValue(\"IBILossNLE\"));\r\n\t\t\t\t\t\t sleep(2000);\r\n\t\t\t\t\t \tclearWebEdit(locator_split(\"txtcbiloss\"));\r\n\t\t\t\t\t\t sleep(2000);\r\n\t\t\t\t\t\t sendKeys(locator_split(\"txtcbiloss\"), getValue(\"CBILossNLE\"));\r\n\t\t\t\t\t\t \r\n\t\t\t\t\t //if (driver.findElement(By.xpath(\".//*[@id='LECompletedFlag']\")).isSelected()== true ){\r\n\t\t\t\t\t \t\r\n\t\t\t\t\t //}\r\n\t\t\t\t\t // click(locator_split(\"checklecompleted\"));\r\n\t\t\t\t\t// driver.findElement(By.xpath(\".//*[@id='LECompletedFlag']\")).click();\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 \tClickRadiobutton(locator_split(\"radiopercentagenlemanual\"));\r\n\t\t\t\t\t \tsleep(2000);\r\n\t\t\t\t\t \tclearWebEdit(locator_split(\"txteelosspc\"));\r\n\t\t\t\t\t\t sleep(2000);\r\n\t\t\t\t\t\t sendKeys(locator_split(\"txteelosspc\"), getValue(\"EELossNLEPC\"));\r\n\t\t\t\t\t\t sleep(2000);\r\n\t\t\t\t\t \tclearWebEdit(locator_split(\"txtothertecoveragelosspc\"));\r\n\t\t\t\t\t\t sleep(2000);\r\n\t\t\t\t\t\t sendKeys(locator_split(\"txtothertecoveragelosspc\"), getValue(\"OtherTE1CoverageLossNLEPC\"));\r\n\t\t\t\t\t\t sleep(2000);\r\n\t\t\t\t\t \tclearWebEdit(locator_split(\"txtothertecoverage2losspc\"));\r\n\t\t\t\t\t\t sleep(2000);\r\n\t\t\t\t\t\t sendKeys(locator_split(\"txtothertecoverage2losspc\"), getValue(\"OtherTE2CoverageLossNLEPC\"));\r\n\t\t\t\t\t\t sleep(2000);\r\n\t\t\t\t\t \tclearWebEdit(locator_split(\"txtothertecoverage3losspc\"));\r\n\t\t\t\t\t\t sleep(2000);\r\n\t\t\t\t\t\t sendKeys(locator_split(\"txtothertecoverage3losspc\"), getValue(\"OtherTE3CoverageLossNLEPC\"));\r\n\t\t\t\t\t\t sleep(2000);\r\n\t\t\t\t\t \tclearWebEdit(locator_split(\"txtibilosspc\"));\r\n\t\t\t\t\t\t sleep(2000);\r\n\t\t\t\t\t\t sendKeys(locator_split(\"txtibilosspc\"), getValue(\"IBILossNLEPC\"));\r\n\t\t\t\t\t\t sleep(2000);\r\n\t\t\t\t\t \tclearWebEdit(locator_split(\"txtcbilosspc\"));\r\n\t\t\t\t\t\t sleep(2000);\r\n\t\t\t\t\t\t sendKeys(locator_split(\"txtcbilosspc\"), getValue(\"CBILossNLEPC\"));\r\n\t\t\t\t\t\t sleep(2000);\r\n\t\t\t\t\t }\r\n\t\t\t\t\t // driver.findElement(By.xpath(\"//input[@id='LECompletedFlag']\")).click();\r\n\t\t\t\t\t if (driver.findElement(By.xpath(\".//*[@id='NLEScenarioComplete']\")).isSelected()== true ){\r\n\t\t\t\t\t\t driver.findElement(By.xpath(\"//*[@id='NLEScenarioComplete']\")).click();\r\n\t\t\t\t\t\t sleep(2000); \r\n\t\t\t\t\t }\r\n\t\t\t\t\t driver.findElement(By.xpath(\"//*[@id='NLEScenarioComplete']\")).click();\r\n\t\t\t\t\t sleep(2000); \r\n\t\t\t\t\t //sendkeys(driver.findElement(By.xpath(\"//input[@name='USER']\")),\"jkdkd\");\r\n\t\t\t\t\t sleep(2000);\r\n\t\t\t\t\t \r\n\t\t\t\t /////////////NLE Manual/////////////\r\n\t\t\t\t\t ////////////////////Remaining tabs/////////////\r\n\t\t\t\t\t \r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t \r\n\t\t\t\t\t\t click(locator_split(\"tabnleprotected\"));\r\n\t\t\t\t\t\t sleep(2000);\r\n\t\t\t\t\t\t if (driver.findElement(By.xpath(\".//*[@id='NLEScenarioComplete']\")).isSelected()== true ){\r\n\t\t\t\t\t\t\t driver.findElement(By.xpath(\"//*[@id='NLEScenarioComplete']\")).click();\r\n\t\t\t\t\t\t\t sleep(2000);\r\n\t\t\t\t\t\t }\r\n\t\t\t\t\t\t driver.findElement(By.xpath(\"//*[@id='NLEScenarioComplete']\")).click();\r\n\t\t\t\t\t\t sleep(2000);\r\n\t\t\t\t\t\t \r\n\t\t\t\t\tclick(locator_split(\"tabnleprotectednonstorage\"));\r\n\t\t\t\t\t\t sleep(2000);\r\n\t\t\t\t\t\t if (driver.findElement(By.xpath(\".//*[@id='NLEScenarioComplete']\")).isSelected()== true ){\r\n\t\t\t\t\t\t\t driver.findElement(By.xpath(\"//*[@id='NLEScenarioComplete']\")).click();\r\n\t\t\t\t\t\t\t sleep(2000);\r\n\t\t\t\t\t\t }\r\n\t\t\t\t\t\t driver.findElement(By.xpath(\"//*[@id='NLEScenarioComplete']\")).click();\r\n\t\t\t\t\t\t sleep(2000);\r\n\t\t\t\t\t\t \r\n\t\t\t\t\t\t// driver.findElement(By.xpath(\".//*[@id='NLEScenarioComplete']\")).click();\r\n\t\t\t\t\t\tsleep(2000);\r\n\t\t\t\t\t\tclick(locator_split(\"tabnlesummary\"));\r\n\t\t\t\t\t//\tdriver.findElement(By.xpath(\"tabnlesummary\")).click();\r\n\t\t\t\t\t\tsleep(2000);\r\n\t\t\t\t\t\t if (driver.findElement(By.xpath(\".//*[@id='LECompletedFlag']\")).isSelected()== true ){\r\n\t\t\t\t\t\t\t driver.findElement(By.xpath(\"//input[@id='LECompletedFlag']\")).click();\r\n\t\t\t\t\t\t\t\tsleep(2000);\r\n\t\t\t\t\t\t }\r\n\t\t\t\t\t\tdriver.findElement(By.xpath(\"//input[@id='LECompletedFlag']\")).click();\r\n\t\t\t\t\t\tsleep(2000);\r\n\t\t\t\t\t\t if (driver.findElement(By.xpath(\".//*[@id='SectionCompleted']\")).isSelected()== true ){\r\n\t\t\t\t\t\t\t driver.findElement(By.xpath(\"//input[@id='SectionCompleted']\")).click();\r\n\t\t\t\t\t\t\t sleep(2000);\r\n\t\t\t\t\t\t }\r\n\t\t\t\t\t\tdriver.findElement(By.xpath(\"//input[@id='SectionCompleted']\")).click();\r\n\t\t\t\t\t\tsleep(2000);\r\n\t\t\t\t\t ///////////////Remaining tabs///////////////\r\n\t\t\t\t\t \r\n\t\t\t\t\t \r\n\t\t\t}\r\n////////////\r\n\t\r\n\t\t\tReporter.log(\"PASS_MESSAGE:- Report tab is clicked and user is logged in\");\r\n\t\t}\r\n\t\tcatch(Exception e){\r\n\t\t\tReporter.log(\"FAIL_MESSAGE:- Report tab is not clicked in\");\r\n\t\t\tthrow new NoSuchElementException(\"The element with\"\r\n\t\t\t\t\t+ elementProperties.getProperty(\"LoginLogout\")\r\n\t\t\t\t\t+ \" not found\");\r\n\r\n\t\t}\r\n\r\n\t}", "@Test\n public void shouldPrioritiseAnnotatedSteps() {\n\n CandidateSteps steps1 = mock(Steps.class);\n CandidateSteps steps2 = mock(Steps.class);\n CandidateStep candidate1 = mock(CandidateStep.class);\n CandidateStep candidate2 = mock(CandidateStep.class);\n CandidateStep candidate3 = mock(CandidateStep.class);\n CandidateStep candidate4 = mock(CandidateStep.class);\n Step step1 = mock(Step.class);\n Step step2 = mock(Step.class);\n Step step3 = mock(Step.class);\n Step step4 = mock(Step.class);\n\n when(steps1.getSteps()).thenReturn(new CandidateStep[]{candidate1, candidate2});\n when(steps2.getSteps()).thenReturn(new CandidateStep[]{candidate3, candidate4});\n \n // all matching the same step string with different priorities\n String stepAsString = \"Given a step\";\n when(candidate1.matches(stepAsString)).thenReturn(true);\n when(candidate2.matches(stepAsString)).thenReturn(true);\n when(candidate3.matches(stepAsString)).thenReturn(true);\n when(candidate4.matches(stepAsString)).thenReturn(true);\n when(candidate1.getPriority()).thenReturn(1);\n when(candidate2.getPriority()).thenReturn(2);\n when(candidate3.getPriority()).thenReturn(3);\n when(candidate4.getPriority()).thenReturn(4);\n when(candidate1.createFrom(tableRow, stepAsString)).thenReturn(step1);\n when(candidate2.createFrom(tableRow, stepAsString)).thenReturn(step2);\n when(candidate3.createFrom(tableRow, stepAsString)).thenReturn(step3);\n when(candidate4.createFrom(tableRow, stepAsString)).thenReturn(step4);\n \n // When we create the series of steps for the core\n MarkUnmatchedStepsAsPending stepCreator = new MarkUnmatchedStepsAsPending();\n List<Step> steps = stepCreator.createStepsFrom(asList(steps1, steps2), new Scenario(asList(stepAsString)), tableRow\n );\n\n // Then the step with highest priority is returned\n ensureThat(step4, equalTo(steps.get(0)));\n }", "@Test(enabled = false)\n\tpublic void HardAssert(){\n\t\t\t\t\n\t\tSystem.out.println(\"Hard Asset Step 1\");\n\t\tAssert.assertEquals(false, false);\n\t\tSystem.out.println(\"Hard Asset Step 2\");\n\t\tAssert.assertEquals(false, true);\n\t\tSystem.out.println(\"Hard Asset Step 3\");\n\t}", "@Test\n public void mainFlowTest() {\n type.insert();\n engineer.insert();\n\n Equipment equipment1 = new Equipment(\"equipment1\", type.getId(), model, location, installTime1);\n Equipment equipment2 = new Equipment(\"equipment2\", type.getId(), model, location, installTime2);\n equipment1.insert();\n equipment2.insert();\n\n Plan plan1 = new Plan(\"plan1\", type.getId(), 30, \"large\", \"checking\");\n Plan plan2 = new Plan(\"plan2\", type.getId(), 60, \"small\", \"repairing\");\n plan1.insert();\n plan2.insert();\n\n Record record1 = new Record(\"r1\", plan1.getId(), equipment1.getId(), engineer.getId(),\n DateUtils.getCalendar(2015, 11, 1).getTime(), 2, \"换过滤网\");\n Record record2 = new Record(\"r2\", plan2.getId(), equipment1.getId(), engineer.getId(),\n DateUtils.getCalendar(2015, 11, 31).getTime(), 1, \"发动机清理\");\n Record record3 = new Record(\"r3\", plan1.getId(), equipment2.getId(), engineer.getId(),\n DateUtils.getCalendar(2015, 11, 5).getTime(), 3, \"cleaning\");\n Record record4 = new Record(\"r4\", plan2.getId(), equipment2.getId(), engineer.getId(),\n DateUtils.getCalendar(2016, 0, 4).getTime(), 2, \"tiny repairing\");\n record1.insert();\n record2.insert();\n record3.insert();\n record4.insert();\n\n // test the correctness of 10 days tasks\n List<Task> tenDayTasks = MaintenanceOperation.getTenDaysTask(DateUtils.getCalendar(2015, 11, 30).getTime());\n assertEquals(\"wrong with 10 days' tasks\", 2, tenDayTasks.size());\n\n // test the total maintenance time\n int time1 = MaintenanceOperation.getTotalMaintenanceTime(equipment1.getId());\n assertEquals(\"wrong with total time of equipment 1\", 3, time1);\n int time2 = MaintenanceOperation.getTotalMaintenanceTime(equipment2.getId());\n assertEquals(\"wrong with total time of equipment 2\", 5, time2);\n\n // test the total maintenance time of certain type\n int time3 = MaintenanceOperation.getTotalMaintenanceTime(equipment1, plan1.getId());\n assertEquals(\"wrong with total time of equipment 1 of plan 1\", 2, time3);\n int time4 = MaintenanceOperation.getTotalMaintenanceTime(equipment1, plan2.getId());\n assertEquals(\"wrong with total time of equipment 1 of plan 1\", 1, time4);\n int time5 = MaintenanceOperation.getTotalMaintenanceTime(equipment2, plan1.getId());\n assertEquals(\"wrong with total time of equipment 1 of plan 1\", 3, time5);\n int time6 = MaintenanceOperation.getTotalMaintenanceTime(equipment2, plan2.getId());\n assertEquals(\"wrong with total time of equipment 1 of plan 1\", 2, time6);\n }", "private EmissionModule setUpScenario(EmissionsConfigGroup.DetailedVsAverageLookupBehavior lookupBehavior) {\n//\t\tConfig config = ConfigUtils.createConfig();\n\t\tConfig config = ConfigUtils.loadConfig( IOUtils.extendUrl( ExamplesUtils.getTestScenarioURL( \"emissions-sampleScenario\" ), \"config_empty.xml\" ).toString() ) ;\n//\t\tConfig config = RunDetailedEmissionToolOnlineExample.prepareConfig( new String[]{\"./scenarios/sampleScenario/testv2_Vehv2/config_detailed.xml\"} ) ;\n\t\tEmissionsConfigGroup emissionsConfig = ConfigUtils.addOrGetModule( config, EmissionsConfigGroup.class );\n\t\temissionsConfig.setDetailedVsAverageLookupBehavior(lookupBehavior);\n//\t\temissionsConfig.setHbefaRoadTypeSource(EmissionsConfigGroup.HbefaRoadTypeSource.fromLinkAttributes);\t\t\t\t\t\t\t//Somehow needed even if deprecated, since a null pointer exception ids thrown when not set :( . kmt mar'20\n\t\temissionsConfig.setAverageColdEmissionFactorsFile(\"sample_41_EFA_ColdStart_vehcat_2020average.csv\");\n\t\temissionsConfig.setDetailedColdEmissionFactorsFile(\"sample_41_EFA_ColdStart_SubSegm_2020detailed.csv\");\n\t\temissionsConfig.setAverageWarmEmissionFactorsFile( \"sample_41_EFA_HOT_vehcat_2020average.csv\" );\n\t\temissionsConfig.setDetailedWarmEmissionFactorsFile(\"sample_41_EFA_HOT_SubSegm_2020detailed.csv\");\n\n\t\tScenario scenario = ScenarioUtils.loadScenario( config );\n\n\t\tEventsManager emissionEventManager = new HandlerToTestEmissionAnalysisModules();\n\n\t\treturn new EmissionModule(scenario, emissionEventManager);\n\t}", "public static void main(String[] args) {\n\n\t\tScanner scn = new Scanner(System.in);\n\t\tint n = scn.nextInt();\n\t\tSystem.out.println(outcomes(n,\"\"));\n\t\tSystem.out.println(outcomesnoconsecutiveheads(n, \"\", false));\n\t\t\n\t\t\n\t\t\n\t}", "@Test\n public void exerciseTwoTest() {\n driver.get(properties.getProperty(\"URL\"));\n\n // 2. Assert Browser title\n homePageAsserts.shouldReturnPageTitle();\n\n // 3. Perform login\n homePageSteps.login(properties.getProperty(\"username\"), properties.getProperty(\"password\"));\n\n // 4. Assert User name in the left-top side of screen that user is loggined\n homePageAsserts.shouldReturnUsernameText();\n\n // 5. Open through the header menu Service -> Different Elements Page\n homePageSteps.clickServiceButton();\n homePageSteps.openDifferentElementsPage();\n\n // 6. Select checkboxes\n differentElementsPageSteps.selectCheckbox(WATER.getValue());\n differentElementsPageSteps.selectCheckbox(WIND.getValue());\n\n // 7. Select radio\n differentElementsPageSteps.selectRadioButton(SELEN.getValue());\n\n // 8. Select in dropdown\n differentElementsPageSteps.selectDropdown(YELLOW.getValue());\n\n // 9.1 Assert that for each checkbox there is an individual log row\n // and value is corresponded to the status of checkbox\n differentElementsAsserts.shouldReturnSelectedCheckbox();\n differentElementsAsserts.shouldReturnLogRowText(WATER.getValue(), \"true\");\n differentElementsAsserts.shouldReturnLogRowText(WIND.getValue(), \"true\");\n\n // 9.2 Assert that for radio button there is a log row and value is corresponded to the status of radio button\n differentElementsAsserts.shouldReturnSelectedRadioButton();\n differentElementsAsserts.shouldReturnLogRowText(METAL.getValue(), SELEN.getValue());\n\n // 9.3 Assert that for dropdown there is a log row and value is corresponded to the selected value\n differentElementsAsserts.shouldReturnSelectedDropdown();\n differentElementsAsserts.shouldReturnLogRowText(COLORS.getValue(), YELLOW.getValue());\n }" ]
[ "0.67520106", "0.65973115", "0.6543981", "0.648328", "0.6470273", "0.63441044", "0.6282799", "0.62206805", "0.61617315", "0.61532134", "0.61378294", "0.611637", "0.6010019", "0.59825015", "0.5968007", "0.5967311", "0.58921885", "0.5864573", "0.58528155", "0.5813408", "0.5813408", "0.5801978", "0.5774161", "0.5774161", "0.5764255", "0.57548326", "0.57401156", "0.5719661", "0.5719661", "0.57131034", "0.5695905", "0.5688499", "0.5673336", "0.5665049", "0.56600595", "0.56556565", "0.56550634", "0.5640468", "0.5635106", "0.5625601", "0.56120056", "0.5599962", "0.55978394", "0.5565817", "0.5552913", "0.5548657", "0.5543313", "0.554303", "0.55396867", "0.5533767", "0.5496344", "0.5492496", "0.54910797", "0.5490704", "0.5487823", "0.5483421", "0.5467106", "0.54393417", "0.5435242", "0.5429934", "0.54269356", "0.54186666", "0.5411628", "0.54049695", "0.5398059", "0.5394723", "0.5393048", "0.5389454", "0.5382937", "0.5372998", "0.53701675", "0.5360558", "0.535734", "0.53510803", "0.53480834", "0.53465587", "0.5337077", "0.53359234", "0.53305364", "0.5329077", "0.5318426", "0.5315869", "0.5307955", "0.53071964", "0.5304383", "0.5302393", "0.5301652", "0.5300082", "0.52933913", "0.5288001", "0.5284744", "0.5279444", "0.52732354", "0.5268894", "0.5253841", "0.5253632", "0.52459395", "0.5245297", "0.5243569", "0.5236569", "0.52345407" ]
0.0
-1
private static final ExecutorService exec = Executors.newFixedThreadPool(NTHREADS);
public void start() throws IOException { ServerSocket socket = new ServerSocket(80); while (!exec.isShutdown()) { try { final Socket conn = socket.accept(); exec.execute(new Runnable() { @Override public void run() { handleRequest(conn); } }); } catch (RejectedExecutionException e) { if (!exec.isShutdown()) { System.out.println("task submission rejected" + e); } } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private void initExecService() {\n try {\n executorService = Executors.newFixedThreadPool(NO_OF_THREADS);\n } catch (Exception e) {\n log.error(e.getMessage(), e);\n }\n }", "public void testForNThreads();", "public static void main(String[] args) {\n ExecutorService es = Executors.newCachedThreadPool();\n es.execute(new Task(65));\n es.execute(new Task(5));\n System.out.println(\"结束执行!\");\n }", "public static void main(String[] args) {\n ExecutorService executor = Executors.newFixedThreadPool(5);\n\n for (int i = 0; i < 10; i++) {\n Runnable worker = new WorkerThreadSand(\" \" + i);\n executor.execute(worker);\n }\n executor.shutdown();\n\n// nasty path for executor\n try {\n ExecutorService nastyExecutor = Executors.newSingleThreadExecutor();\n nastyExecutor.execute(null);\n }catch (Exception e){\n System.out.println(\"Nulls don't work\");\n }\n\n\n System.out.println(\"Finished all threads\");\n\n }", "public static void main(String[] args) throws InterruptedException, ExecutionException {\n\t\tExecutorService executor = Executors.newFixedThreadPool(5);\n for (int i = 0; i < 10; i++) {\n \tCallable worker = new WorkerThread1(\"\" + i);\n \tFuture future = executor.submit(worker);\n \tSystem.out.println(\"Results\"+future.get());\n //executor.execute(worker);\n }\n executor.shutdown();\n while (!executor.isTerminated()) {\n }\n System.out.println(\"Finished all threads\");\n }", "public static void main(String[] args) {\n\t\tExecutorService pool = Executors.newFixedThreadPool(3);\n\t\t//ExecutorService pool = Executors.newSingleThreadExecutor();\n\t\t\n\t\tExecutorService pool2 = Executors.newCachedThreadPool();\n\t\t//this pool2 will add more thread into pool(when no other thread running), the new thread do not need to wait.\n\t\t//pool2 will delete un runing thread(unrun for 60 secs)\n\t\tThread t1 = new MyThread();\n\t\tThread t2 = new MyThread();\n\t\tThread t3 = new MyThread();\n\n\t\tpool.execute(t1);\n\t\tpool.execute(t2);\n\t\tpool.execute(t3);\n\t\tpool.shutdown();\n\t\t\n\t}", "private static void useCachedThreadPool() {\n ExecutorService executor = Executors.newCachedThreadPool();\n\n System.out.println(((ThreadPoolExecutor) executor).getActiveCount());\n\n\n executor.execute(() -> {\n System.out.println(\"==========\");\n });\n\n System.out.println(((ThreadPoolExecutor) executor).getActiveCount());\n\n IntStream.range(0, 100).boxed().forEach(i -> {\n executor.execute(() -> {\n sleepSeconds(10);\n System.out.println(Thread.currentThread().getName() + \"[\" + i + \"]\");\n });\n });\n sleepSeconds(1);\n System.out.println(((ThreadPoolExecutor) executor).getActiveCount());\n }", "public static void main(String args[]) {\n\t\t (new Thread(new Threads_and_Executors())).start();\r\n}", "public static void main(String[] args) {\n\n var pool = Executors.newFixedThreadPool(5);\n Future outcome = pool.submit(() -> 1);\n\n }", "public EngineConcurrency() {\n Runtime runtime = Runtime.getRuntime();\n int threads = runtime.availableProcessors();\n if (threads > 1) {\n threads++;\n }\n this.executor = Executors.newFixedThreadPool(threads);\n }", "public static void testES() {\n ExecutorService es = Executors.newFixedThreadPool(2);\n for (int i = 0; i < 10; i++)\n es.execute(new TestTask());\n }", "private static void threadPoolWithExecute() {\n\n Executor executor = Executors.newFixedThreadPool(3);\n IntStream.range(1, 10)\n .forEach((i) -> {\n executor.execute(() -> {\n System.out.println(\"started task for id - \"+i);\n try {\n if (i == 8) {\n Thread.sleep(4000);\n } else {\n Thread.sleep(1000);\n }\n System.out.println(\"In runnable task for id -\" + i);\n } catch (Exception e) {\n e.printStackTrace();\n }\n });\n });\n System.out.println(\"End of method .THis gets printed immdly since execute is not blocking call\");\n }", "private static void useFixedSizePool(){\n ExecutorService executor = Executors.newFixedThreadPool(10);\n\n System.out.println(((ThreadPoolExecutor) executor).getActiveCount());\n\n IntStream.range(0, 20).boxed().forEach(i -> {\n executor.execute(() -> {\n sleepSeconds(10);\n System.out.println(Thread.currentThread().getName() + \"[\" + i + \"]\");\n });\n });\n sleepSeconds(1);\n System.out.println(((ThreadPoolExecutor) executor).getActiveCount());\n }", "private ExecutorService getDroneThreads() {\n\t\treturn droneThreads;\n\t}", "public static void main(String[] args) throws ExecutionException, InterruptedException {\n ExecutorService executorService=Executors.newScheduledThreadPool(5);\n try{\n for (int i = 0; i < 10; i++) {\n Future<String> futures = executorService.submit(new TestCallable());\n System.out.println(\"result---------------------\"+futures.get());\n }\n }catch (Exception e){\n e.printStackTrace();\n }finally {\n executorService.shutdown();\n }\n }", "public static void main(String[] args){\n\t\tint tamPool=Integer.parseInt(args[0]);\r\n\t\tSystem.out.println(\"Cuantos numero quiere lanzar?\");\r\n\t\tn=Integer.parseInt(args[1]);\r\n\t\tlong time_start, time_end;\r\n\t\tint numeros=n/tamPool;\r\n\t\tThread []hilos= new Thread[tamPool];\r\n\t\ttime_start = System.currentTimeMillis();\r\n\t\t//System.out.println(\"Numeros: \"+numeros);\r\n\t\tint grueso=numeros;\r\n\t\t\t//ExecutorService exec = Executors.newCachedThreadPool();\r\n\t\t\tfor(int i=0;i<tamPool;++i){\r\n\t\t\t\thilos[i]= new Thread(new piParalelo(numeros));\r\n\t\t\t\thilos[i].start();\r\n\t\t\t//System.out.println(i+\" : \"+grueso);\r\n\t\t\t//exec.execute(new piParalelo(numeros));\r\n\t\t\tif((grueso+numeros)>=n)numeros=n-grueso;\r\n\t\t\telse grueso+=numeros;\r\n\r\n\t\t\t\t\t\t\t\t\t\t\t}\r\n\t\t\tfor(int i=0;i<tamPool;++i){\r\n\t\t\t\ttry{\r\n\t\t\t\thilos[i].join();\r\n\t\t\t\t}catch(Exception e){}\r\n\t\t\t\t\t\t\t\t\t\t}\r\n\t\t\t/**try{\r\n\t\t\texec.shutdown();\r\n\t\t\texec.awaitTermination(1, TimeUnit.DAYS);\r\n\t\t\t}catch(Exception e){}*/\r\n\t\tPI=4*((double)atomico.get()/(double)n);\r\n\t\tSystem.out.println(\"La aproximacion del numero PI por montecarlo es: \"+PI);\r\n\t\ttime_end = System.currentTimeMillis();\r\n\t\tSystem.out.println(\"the task has taken \"+ ( time_end - time_start ) +\" milliseconds\");\r\n\t\t\t\t\t\t\t}", "private void ejecutorDeServicio(){\r\n dbExeccutor = Executors.newFixedThreadPool(\r\n 1, \r\n new databaseThreadFactory()\r\n ); \r\n }", "public static void main(String args[]) {\n\t\tExecutorService executor = Executors.newFixedThreadPool(5);\n\t\t\n\t\t// Create a list to hold the Future object associated with Callable\n\t\tList<Future<String>> futureList = new ArrayList<Future<String>>();\n\n\t\t/**\n\t\t * Create MyCallable instance using Lambda expression which return\n\t\t * the thread name executing this callable task\n\t\t */\n\t\tCallable<String> callable = () -> {\n\t\t\tThread.sleep(2000);\n\t\t\treturn Thread.currentThread().getName();\n\t\t};\n\t\t\n\t\t/**\n\t\t * Submit Callable tasks to be executed by thread pool\n\t\t * Add Future to the list, we can get return value using Future\n\t\t **/\n\t\tfor (int i = 0; i < 20; i++) {\n\t\t\tFuture<String> future = executor.submit(callable);\n\t\t\tfutureList.add(future);\n\t\t}\n\t\t\n\t\t/**\n\t\t * Print the return value of Future, notice the output delay\n\t\t * in console because Future.get() waits for task to get completed\n\t\t **/\n\t\tfor (Future<String> future : futureList) {\n\t\t\ttry {\n\t\t\t\tSystem.out.println(new Date() + \" | \" + future.get());\n\t\t\t} catch (InterruptedException | ExecutionException e) {\n\t\t\t\te.printStackTrace();\n\t\t\t}\n\t\t}\n\t\t// shut down the executor service.\n\t\texecutor.shutdown();\n\t}", "public static void main(String[] args) {\n ThreadPoolExecutor threadPoolExecutor = new ThreadPoolExecutor(threadNum, threadNum, 10L, TimeUnit.SECONDS, linkedBlockingDeque);\n\n final CountDownLatch countDownLatch = new CountDownLatch(NUM);\n\n long start = System.currentTimeMillis();\n\n for (int i = 0; i < NUM; i++) {\n threadPoolExecutor.execute(\n () -> {\n inventory--;\n System.out.println(\"线程执行:\" + Thread.currentThread().getName());\n\n countDownLatch.countDown();\n }\n );\n }\n\n threadPoolExecutor.shutdown();\n\n try {\n countDownLatch.await();\n } catch (InterruptedException e) {\n e.printStackTrace();\n }\n\n long end = System.currentTimeMillis();\n System.out.println(\"执行线程数:\" + NUM + \" 总耗时:\" + (end - start) + \" 库存数为:\" + inventory);\n }", "public static void main(String[] args) {\r\n\t\tMyThread thread = new MyThread();\r\n\t\tfixedExecutorService.execute(thread);\r\n\t\tfixedExecutorService.execute(thread);\r\n\t\tfixedExecutorService.execute(thread);\r\n\t\tfixedExecutorService.execute(thread);\r\n\t\tfixedExecutorService.execute(thread);\r\n\t\tfixedExecutorService.execute(thread);\r\n\t\tfixedExecutorService.execute(thread);\r\n\t}", "@Test\n void test3() {\n ThreadPoolExecutor executor = new ThreadPoolExecutor(1,1,10L, TimeUnit.SECONDS,new LinkedBlockingDeque<>(2),new ThreadPoolExecutor.DiscardPolicy());\n for (int i = 0; i < 10; i++) {\n executor.execute(new Runnable() {\n @Override\n public void run() {\n System.out.println(Thread.currentThread().getName()+\"输出\");\n }\n });\n }\n }", "public static void main(String[] args)\n\t{\n\t\tint coreCount = Runtime.getRuntime().availableProcessors();\n\t\t//Create the pool\n\t\tExecutorService ec = Executors.newCachedThreadPool(); //Executors.newFixedThreadPool(coreCount);\n\t\tfor(int i=0;i<100;i++) \n\t\t{\n\t\t\t//Thread t = new Thread(new Task());\n\t\t\t//t.start();\n\t\t\tec.execute(new Task());\n\t\t\tSystem.out.println(\"Thread Name under main method:-->\"+Thread.currentThread().getName());\n\t\t}\n\t\t\n\t\t//for scheduling tasks\n\t\tScheduledExecutorService service = Executors.newScheduledThreadPool(10);\n\t\tservice.schedule(new Task(), 10, TimeUnit.SECONDS);\n\t\t\n\t\t//task to run repetatively 10 seconds after previous taks completes\n\t\tservice.scheduleWithFixedDelay(new Task(), 15, 10, TimeUnit.SECONDS);\n\t\t\n\t}", "@SuppressWarnings({ \"rawtypes\", \"unchecked\" })\r\n\tpublic static void main(String[] args) throws InterruptedException, ExecutionException{\n\t\tExecutorService e = Executors.newFixedThreadPool(2);\r\n//\t\tList<Future> list = new ArrayList<Future>();\r\n\t\tfor(int i=0;i<10;i++){\r\n\t\t\tCallable c = new JavaTestThread(i);\r\n\t\t\tFuture f = e.submit(c);\r\n\t\t\tSystem.out.println(\"-------\"+ f.get().toString());\r\n\t\t}\r\n\t\t\r\n\t\r\n\t\t\r\n\t}", "public static void main(String[] args) {\n ThreadPoolExecutor executorService = new ThreadPoolExecutor(3, 10, 1L, TimeUnit.SECONDS,\n new LinkedBlockingQueue<>(20),\n Executors.defaultThreadFactory(),\n new ThreadPoolExecutor.AbortPolicy());\n ABC abc = new ABC();\n try {\n for (int i = 1; i <= 10; i++) {\n executorService.execute(abc::print5);\n executorService.execute(abc::print10);\n executorService.execute(abc::print15);\n }\n\n }finally {\n executorService.shutdown();\n }\n }", "public static void main(String[] args) {\n\t\tExecutorService es = new Executors.\n\t}", "public ExecutorService createExecutor() {\n return getCamelContext().getExecutorServiceManager().newThreadPool(this, endpointName,\n 1, 5);\n }", "private void normalExecutorService() {\n ListeningExecutorService executor = MoreExecutors.listeningDecorator(Executors.newFixedThreadPool(numberOfThreadsInThePool));\n try {\n Set<Future<String>> printTaskFutures = new HashSet<Future<String>>();\n for (final String printRequest : printRequests) {\n// Future<String> printer = executor.submit(new Printer(printRequest));\n ListenableFuture<String> printer = executor.submit(new Printer(printRequest));\n printTaskFutures.add(printer);\n// Futures.addCallback(printer, new FutureCallback<String>() {\n// // we want this handler to run immediately after we push the big red button!\n// public void onSuccess(String explosion) {\n//// walkAwayFrom(explosion);\n// }\n//\n// public void onFailure(Throwable thrown) {\n//// battleArchNemesis(); // escaped the explosion!\n// }\n// });\n }\n for (Future<String> future : printTaskFutures) {\n System.out.print(future.get());\n\n }\n } catch (Exception e) {\n Thread.currentThread().interrupt();\n } finally {\n// if (executor != null) {\n executor.shutdownNow();\n// }\n }\n }", "public static void main(String[] args) {\n ExecutorService service = Executors.newCachedThreadPool();\n for (int i = 0; i < 100; i++) {\n service.submit(new Task());\n }\n System.out.println(\"Running Main\" + Thread.currentThread().getName());\n }", "private static void threadPoolInit() {\n ExecutorService service = Executors.newCachedThreadPool();\n try {\n for (int i = 1; i <= 10; i++) {\n service.execute(() -> {\n System.out.println(Thread.currentThread().getName() + \" 办理业务...\");\n });\n try {\n TimeUnit.MILLISECONDS.sleep(1L);\n } catch (InterruptedException e) {\n e.printStackTrace();\n }\n }\n } catch (Exception e) {\n e.printStackTrace();\n } finally {\n service.shutdown();\n }\n }", "public static void main(String[] args) {\n ThreadPoolExecutor executor = new ThreadPoolExecutor(7, 8, 5, TimeUnit.SECONDS,\r\n new LinkedBlockingQueue<Runnable>());\r\n System.out.println(executor.getCorePoolSize());\r\n System.out.println(executor.getMaximumPoolSize());\r\n System.out.println(\"***************************\");\r\n ThreadPoolExecutor executor2 = new ThreadPoolExecutor(7, 8, 5, TimeUnit.SECONDS,\r\n new SynchronousQueue<Runnable>());\r\n System.out.println(executor2.getCorePoolSize());\r\n System.out.println(executor2.getMaximumPoolSize());\r\n\r\n// 7\r\n// 8\r\n// ***************************\r\n// 7\r\n// 8\r\n\r\n // 熟悉下api,查询线程池中保存的core线程数量为7,最大为8\r\n }", "public static void main(String[] args) {\n ExecutorService executorService = Executors.newFixedThreadPool(100);\n\n for (int i=0;i<10000000;i++){\n executorService.execute(()->{\n System.out.println(generateTransId());\n });\n }\n }", "public static void main(String[] args) {\n ExecutorService threadPool = Executors.newCachedThreadPool();\n\n try{\n for (int i = 0; i < 10; i++) {\n threadPool.execute(() ->{\n System.out.println(Thread.currentThread().getName()+\"\\t 办理业务\");\n });\n //try {TimeUnit.SECONDS.sleep(1); } catch (InterruptedException e) {e.printStackTrace();}\n }\n\n } catch (Exception e) {\n e.printStackTrace();\n }finally {\n threadPool.shutdown();\n }\n\n\n\n }", "public static void main(String[] args) \n\t{\n\t\tForkJoinPool fjp = ForkJoinPool.commonPool();\n\t\t//ForkJoinPool fjp = new ForkJoinPool(2);\n\t\t\n\t\tSystem.out.println(fjp.getParallelism() + \" cores executing\");\n\t\tfjp.invoke(new MyAction());\n\t\tFuture<Integer> x = fjp.submit(new MyTask());\n\t\tfjp.invoke(new MyTask());\n\t\t\n\t\tList<Callable<Integer>> tasks = new ArrayList<>();\n\t\ttasks.add(()->{\n\t\t\tSystem.out.println(\"Task 1 running...\");\n\t\t\treturn 1;\n\t\t});\n\t\ttasks.add(()->{\n\t\t\tSystem.out.println(\"Task 2 running...\");\n\t\t\treturn 1;\n\t\t});\n\t\ttasks.add(()->{\n\t\t\tSystem.out.println(\"Task 3 running...\");\n\t\t\treturn 1;\n\t\t});\n\t\ttasks.add(()->{\n\t\t\tSystem.out.println(\"Task 4 running...\");\n\t\t\treturn 1;\n\t\t});\n\t\ttasks.add(()->{\n\t\t\tSystem.out.println(\"Task 5 running...\");\n\t\t\treturn 1;\n\t\t});\n\t\tint sum = 0;\n\t\tList<Future<Integer>> futureSums = fjp.invokeAll(tasks);\n\t\tfor(Future<Integer> num: futureSums)\n\t\t{\n\t\t\ttry \n\t\t\t{\n\t\t\t\tsum += num.get();\n\t\t\t} catch (InterruptedException | ExecutionException e1) {\n\t\t\t\t// TODO Auto-generated catch block\n\t\t\t\te1.printStackTrace();\n\t\t\t}\n\t\t}\n\t\tSystem.out.println(\"The sum is \" + sum);\n\t\t\n\t\tfjp.shutdown();\n\t\ttry {\n\t\t\tfjp.awaitTermination(30,TimeUnit.SECONDS);\n\t\t} catch (InterruptedException e) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\te.printStackTrace();\n\t\t}\n\t}", "public static void main(String[] args) {\n\t\tList<Future<String>> futureList = new ArrayList<Future<String>>();\r\n\r\n\t\t//collection of multiple tasks which we are supposed to give to thread pool to perform\r\n\t\tList<CallableDemo> taskList = new ArrayList<CallableDemo>();\r\n\t\t//adding multiple tasks to collection (tasks are created using 'Callable' Interface.\r\n\t\ttaskList.add(new CallableDemo(\"first\"));\r\n\t\ttaskList.add(new CallableDemo(\"second\"));\r\n\t\ttaskList.add(new CallableDemo(\"third\"));\r\n\t\ttaskList.add(new CallableDemo(\"fourth\"));\r\n\t\ttaskList.add(new CallableDemo(\"fifth\"));\r\n\t\ttaskList.add(new CallableDemo(\"sixth\"));\r\n\t\ttaskList.add(new CallableDemo(\"seventh\"));\r\n\r\n\t\t//creating a thread pool of size four\r\n\t\tExecutorService threadPool = Executors.newFixedThreadPool(4);\r\n\t\t\r\n\t\tfor (CallableDemo task : taskList) {\r\n\t\t\tfutureList.add(threadPool.submit(task));\r\n\t\t}\r\n threadPool.shutdown();\r\n\t\tfor (Future<String> future : futureList) {\r\n\t\t\ttry {\r\n//\t\t\t\t System.out.println(future.get());\r\n\t\t\t\tSystem.out.println(future.get(1L, TimeUnit.SECONDS));\r\n\t\t\t} catch (InterruptedException | ExecutionException e) {\r\n\t\t\t\t// TODO Auto-generated catch block\r\n\t\t\t\te.printStackTrace();\r\n\t\t\t}catch (TimeoutException e) {\r\n\t\t\t\tSystem.out.println(\"Sorry already waited for result for 1 second , can't wait anymore...\");\r\n\t\t\t}\r\n\r\n\t\t}\r\n\t}", "public static void main(String [] args) {\n\t\tExecutorService executor= Executors.newFixedThreadPool(2);\n\t\t\n\t\t//add the tasks that the threadpook executor should run\n\t\tfor(int i=0;i<5;i++) {\n\t\t\texecutor.submit(new Processor(i));\n\t\t}\n\t\t\n\t\t//shutdown after all have started\n\t\texecutor.shutdown();\n\t\t\n\t\tSystem.out.println(\"all submitted\");\n\t\t\n\t\t//wait 1 day till al the threads are finished \n\t\ttry {\n\t\t\texecutor.awaitTermination(1, TimeUnit.DAYS);\n\t\t} catch (InterruptedException e) {\n\t\t\t\te.printStackTrace();\n\t\t}\n\t\t\n\t\tSystem.out.println(\"all completed\");\n\t\t\n\t}", "public static void main(String[] args) {\n\t\tExecutorService threadPool = Executors.newCachedThreadPool();\r\n\t\ttry {\r\n\t\t\tfor (int i = 0; i < 10; i++) {\r\n\t\t\t\tthreadPool.execute(()->{\r\n\t\t\t\t\tSystem.out.println(Thread.currentThread().getName() + \"\\t 执行业务\");\r\n\t\t\t\t});\r\n\t\t\t\tTimeUnit.MICROSECONDS.sleep(200);\r\n\t\t\t}\r\n\t\t\t\r\n\t\t} catch (Exception e) {\r\n\t\t\t// TODO: handle exception\r\n\t\t}finally {\r\n\t\t\tthreadPool.shutdown();\r\n\t\t}\r\n\t\t\r\n\t\t\r\n\t}", "public static void main(String[] args) throws InterruptedException,\n ExecutionException {\n ExecutorService executor = Executors\n .newFixedThreadPool(THREAD_POOL_SIZE);\n\n Future future1 = executor.submit(new Counter());\n Future future2 = executor.submit(new Counter());\n\n System.out.println(Thread.currentThread().getName() + \" executing ...\");\n\n //asynchronously get from the worker threads\n System.out.println(future1.get());\n System.out.println(future2.get());\n\n }", "public void testNewFixedThreadPool3() {\n try {\n ExecutorService e = Executors.newFixedThreadPool(2, null);\n shouldThrow();\n } catch (NullPointerException success) {}\n }", "public static void main(String[] args) throws InterruptedException, ExecutionException {\t\r\n\t\tScanner reader = new Scanner(System.in);\r\n\t\t/*\r\n\t\t * Limite maximo de números. \r\n\t\t */\t\r\n\t\tList<Future<Long>> list = new ArrayList<Future<Long>>();\r\n\t\t/*\r\n\t\t * Lista que guarda los tiempos de ejecución de cada hilo. \r\n\t\t */\t\r\n\t\tArrayList<Long> ListaTiempo = new ArrayList<Long>();\r\n\t\tSystem.out.print(\"ingrese numeros limite de numeros para analizar:\");\r\n\t\t/*\r\n\t\t * Variable que guarda el numero captado por consola. \r\n\t\t */\t\r\n\t\tint numeros = reader.nextInt();\r\n\t\t/*\r\n\t\t * Variable que incrementa para generar los hilos. \r\n\t\t */\t\r\n\t\tint hilos = 1;\r\n\t\t/*\r\n\t\t * Variable que guarda el tiempo de ejecucion del hilo uno. \r\n\t\t */\t\r\n\t\tlong tiempoHiloUno = 0;\r\n\t\t\r\n\t\t//while que itera hasta 16 hilos.\r\n\t\twhile (hilos <= 16) {\r\n\t\t\t//Calculo del límite.\r\n\t\t\tint limite = numeros / hilos;\r\n\t\t\t/*\r\n\t\t\t * Se crea el pool de hilos. \r\n\t\t\t */\t\r\n\t\t\tExecutorService servicio = Executors.newFixedThreadPool(hilos);\r\n\t\t\tint inferior = 1;\r\n\t\t\tint superior = limite;\r\n\t\t\tlong initialTime = System.currentTimeMillis();\r\n\t\t\t//Itera segun el numero de hilos.\r\n\t\t\tfor (int i = 1; i <= hilos; i++) {\r\n\t\t\t\tFuture<Long> resultado = servicio.submit(new Nprimos(superior, inferior));\r\n\t\t\t\tlist.add(resultado);\r\n\t\t\t\tinferior = superior + 1;\r\n\t\t\t\tsuperior += limite;\r\n\t\t\t\t//Si supera el límite rompe el ciclo.\r\n\t\t\t\tif (superior > limite * hilos) {\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\t// se termina de ejecutar cuando todos los hilos terminan de trabajar.\r\n\t\t\tfor (Future<Long> resultado : list) {\r\n\t\t\t\ttry {\r\n\t\t\t\t\tListaTiempo.add(resultado.get());\r\n\t\t\t\t} catch (InterruptedException | ExecutionException e) {\r\n\t\t\t\t\te.printStackTrace();\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif(hilos==1) {\r\n\t\t\t\ttiempoHiloUno = System.currentTimeMillis() - initialTime; \r\n\t\t\t}\r\n\t\t\tSystem.out.print(\" \\n \" + \"(\" + hilos + \")\" + \"tiempo de ejecución: \"+ (System.currentTimeMillis() - initialTime) + \" ms\\n\");\r\n\t\t\tSystem.out.print(\" speed up = \" + (double)(tiempoHiloUno /(System.currentTimeMillis() - initialTime)) + \" \\n\");\r\n\t\t\tservicio.shutdown();\r\n\t\t\t//Se incrementa variable hilos.\r\n\t\t\thilos++;\r\n\t\t}\r\n\r\n\t}", "public static void main(String[] args) {\n SomeRunnable obj1 = new SomeRunnable();\n SomeRunnable obj2 = new SomeRunnable();\n SomeRunnable obj3 = new SomeRunnable();\n \n System.out.println(\"obj1 = \"+obj1);\n System.out.println(\"obj2 = \"+obj2);\n System.out.println(\"obj3 = \"+obj3);\n \n //Create fixed Thread pool, here pool of 2 thread will created\n ExecutorService pool = Executors.newFixedThreadPool(3);\n ExecutorService pool2 = Executors.newFixedThreadPool(2);\n pool.execute(obj1);\n pool.execute(obj2);\n pool2.execute(obj3);\n \n pool.shutdown();\n pool2.shutdown();\n }", "public static void main(String[] args)\n {\n Runnable r1 = new Task1();\n // Creates Thread task\n Task2 r2 = new Task2();\n ExecutorService pool = Executors.newFixedThreadPool(MAX_T);\n\n pool.execute(r1);\n r2.start();\n\n // pool shutdown\n pool.shutdown();\n }", "public static void main(String[] args) {\n\t\tfinal Lazy lazy = new LazyImpl();\n\t\t\n List<Callable<Long>> tasks = new ArrayList<Callable<Long>>(10);\n // make a runnable that walks the whole jdk model\n Callable<Long> runnable = new Callable<Long>(){\n @Override\n public Long call() throws Exception {\n System.out.println(\"Starting work from thread \" + Thread.currentThread().getName());\n Long l = doWork(lazy);\n System.out.println(\"Done work from thread \" + Thread.currentThread().getName());\n return l;\n }\n };\n // make ten tasks with the same runnable\n for(int i=0;i<10;i++){\n tasks.add(runnable);\n }\n // create an executor\n ThreadPoolExecutor executor = new ThreadPoolExecutor(10, 10, 1, TimeUnit.MINUTES, new ArrayBlockingQueue<Runnable>(10));\n try {\n System.out.println(\"Launching all threads\");\n // run them all\n List<Future<Long>> futures = executor.invokeAll(tasks);\n // and wait for them all to be done\n long total = 0;\n for(Future<Long> f : futures){\n total += f.get();\n }\n executor.shutdown();\n System.out.println(\"Done: \"+lazy.getCount()+\", \"+lazy.getResult()+\" in \"+total/1000000+\"ms\");\n } catch (InterruptedException e) {\n throw new RuntimeException(e);\n } catch (ExecutionException e) {\n throw new RuntimeException(e);\n }\n\t}", "public static void main( String[] args ) throws Exception\n {\n PrintTask task1 = new PrintTask( \"thread1\" );\n PrintTask task2 = new PrintTask( \"thread2\" );\n PrintTask task3 = new PrintTask( \"thread3\" );\n \n System.out.println( \"Starting threads\" );\n \n // create ExecutorService to manage threads \n ExecutorService threadExecutor = Executors.newFixedThreadPool( 3 );\n \n // start threads and place in runnable state \n threadExecutor.execute( task1 ); // start task1\n threadExecutor.execute( task2 ); // start task2\n threadExecutor.execute( task3 ); // start task3\n \n threadExecutor.shutdown(); // shutdown worker threads\n threadExecutor.awaitTermination(10, TimeUnit.SECONDS); \n System.out.println( \"Threads started, main ends\\n\" );\n }", "@Test\n @SneakyThrows\n void test() {\n ExecutorService executor = Executors.newSingleThreadExecutor();\n\n Runnable runnable = () -> {\n System.out.println(\"this is a new thread !!\");\n System.out.println(\"===============\");\n try {\n Thread.sleep(3000);\n } catch (InterruptedException e) {\n e.printStackTrace();\n }\n };\n\n for (int i = 0; i < 3; i++) {\n executor.submit(runnable);\n }\n Thread.sleep(10 * 1000);\n\n executor.shutdown();\n\n }", "public void startThread() \n { \n ExecutorService taskList = \n Executors.newFixedThreadPool(2); \n for (int i = 0; i < 5; i++) \n { \n // Makes tasks available for execution. \n // At the appropriate time, calls run \n // method of runnable interface \n taskList.execute(new Counter(this, i + 1, \n \"task \" + (i + 1))); \n } \n \n // Shuts the thread that's watching to see if \n // you have added new tasks. \n taskList.shutdown(); \n }", "public static void main(String[] args) {\n Runnable r1 = () -> {\n String thread = Thread.currentThread().getName();\n log.info(\"{} getting lock\", thread);\n lock.lock();\n log.info(\"{}, increment to {}\", thread, count++);\n log.info(\"{} unlock\", thread);\n lock.unlock();\n\n };\n\n for (int i=0; i <= 5; i++){\n executorService.execute(r1);\n }\n\n executorService.shutdown();\n\n }", "public void testExecuteInParallel_Collection_ThreadPoolExecutor() throws Exception\n {\n System.out.println( \"executeInParallel\" );\n Collection<Callable<Double>> tasks = createTasks( 10 );\n Collection<Double> result = ParallelUtil.executeInParallel( tasks, ParallelUtil.createThreadPool( 1 ) );\n assertEquals( result.size(), tasks.size() );\n }", "@Singleton\n\t@Provides\n\tExecutorService provideExecutorService() {\n\t\tThreadFactory threadFactory = new ThreadFactory() {\n\t\t\tprivate final AtomicInteger threadNumber = new AtomicInteger(1);\n\n\t\t\t@Override\n\t\t\tpublic Thread newThread(final Runnable r) {\n\t\t\t\t// Two-digit counter, used in load test.\n\t\t\t\tint id = threadNumber.getAndIncrement();\n\t\t\t\tString threadName = leftPad(String.valueOf(id), 2, \"0\");\n\t\t\t\tThread th = new Thread(r);\n\t\t\t\tth.setName(threadName);\n\t\t\t\tth.setDaemon(false);\n\t\t\t\treturn th;\n\t\t\t}\n\t\t};\n\t\treturn threadCount >= 0\n\t\t\t\t? Executors.newFixedThreadPool(threadCount, threadFactory)\n\t\t\t\t: Executors.newCachedThreadPool(threadFactory);\n\t}", "public void testNewFixedThreadPool4() {\n try {\n ExecutorService e = Executors.newFixedThreadPool(0);\n shouldThrow();\n } catch (IllegalArgumentException success) {}\n }", "@Bean(destroyMethod = \"shutdown\")\n public Executor threadPoolTaskExecutor(@Value(\"${thread.size}\") String argThreadSize) {\n this.threadSize = Integer.parseInt(argThreadSize);\n ThreadPoolTaskExecutor executor = new ThreadPoolTaskExecutor();\n executor.setCorePoolSize(this.threadSize);\n executor.setKeepAliveSeconds(15);\n executor.initialize();\n return executor;\n }", "int getExecutorCorePoolSize();", "public static void main(String[] args) throws Exception {\n Service1 service1 = new Service1();\n ExecutorService service = Executors.newFixedThreadPool(10);\n Future<String> f1 = service.submit(service1);\n\n\n }", "public static void main (String[] args) {\n logger.info (\"Creating a executor...\");\n ExecutorService executorService = Executors.newFixedThreadPool (3);\n\n\n\n /*\n * Create a lock counter class.\n * */\n logger.info (\"Creating a lock counter class...\");\n ReadWriteCounter counter = new ReadWriteCounter ();\n\n\n\n /*\n * Submit a thread.\n * */\n logger.info (\"Create a read thread...\");\n Runnable readTask = () -> logger.debug (Thread.currentThread ().getName () +\n \" Read Task : \" + counter.getCount ());\n\n\n\n /*\n * Submit a thread.\n * */\n logger.info (\"Create a write thread...\");\n Runnable writeTask = () -> logger.debug (Thread.currentThread().getName() +\n \" Write Task : \" + counter.incrementAndGetCount ());\n\n\n\n /*\n * Submit a threads.\n * */\n logger.info (\"Submit a read threads...\");\n executorService.submit (readTask);\n executorService.submit (readTask);\n\n /*\n * Submit a thread.\n * */\n logger.info (\"Submit a write thread...\");\n executorService.submit (writeTask);\n\n /*\n * Submit a threads.\n * */\n logger.info (\"Submit a read threads...\");\n executorService.submit (readTask);\n executorService.submit (readTask);\n\n\n\n /*\n * Shutdown executor.\n * */\n logger.info (\"Shutdown the executor...\");\n executorService.shutdown ();\n }", "public static void main(String[] args) {\r\n\r\n ExecutorService es = Executors.newFixedThreadPool(100);\r\n for (int i = 0; i < 10; i++) {\r\n es.execute(new Runnable() {\r\n @Override\r\n public void run() {\r\n // l++;\r\n // l--;\r\n l.incrementAndGet();\r\n l.decrementAndGet();\r\n }\r\n });\r\n }\r\n // for (int i = 0; i < 10; i++) {\r\n // es.execute(new Runnable() {\r\n // @Override\r\n // public void run() {\r\n // synchronized (l) {\r\n // l--;\r\n // }\r\n // // l.decrementAndGet();\r\n // }\r\n // });\r\n // }\r\n System.out.println(l);\r\n }", "public static void main(String[] args) {\n\n\t\tString word = args[0];\n\t\tString host = args[1];\n\t\tint port = Integer.parseInt(args[2]);\n\t\tint nPool = Integer.parseInt(args[3]);\n\t\tint apariciones = 0;\n\n\t\tExecutorService ex = Executors.newFixedThreadPool(nPool);\n\n\t\tArrayList<Future<Integer>> f = new ArrayList<Future<Integer>>();\n\n\t\tfor (int i = 1; i < 12; i++) {\n\t\t\tCountTarea c = new CountTarea(host, port, i, word);\n\t\t\tf.add(ex.submit(c));\n\t\t}\n\n\t\ttry {\n\t\t\tfor (Future<Integer> result : f) {\n\t\t\t\tapariciones += (Integer) result.get();\n\n\t\t\t}\n\t\t} catch (InterruptedException | ExecutionException e) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\te.printStackTrace();\n\t\t}\n\t\tSystem.out.printf(\"Total apariciones de '%s': %d\", word, apariciones);\n\t\tex.shutdown();\n\n\t\t// Obtener el ExecutorService\n\t\t// Crear una lista de Future<Integer> para almacenar lo que devuelva el método\n\t\t// submit\n\t\t// Para cada fichero\n\t\t// Crear una tarea (instancia de CountTarea)\n\t\t// Ejecutar la tarea en el ExecutorService y obtener el Future<Integer> que\n\t\t// devuelve\n\t\t// Almacenar el Future<Integer> en la lista\n\n\t\t// Para cada Future<Integer> de la lista\n\t\t// Obtener el resultado y acumularlo en apariciones\n\n\t\t// Mostrar el numero de apariciones\n\t}", "public List<String> runParallelCharacters() throws InterruptedException, ExecutionException {\n ExecutorService executor = Executors.newFixedThreadPool(10);\r\n\r\n // create a list to hold the Future object associated with Callable\r\n List<Future<String>> list = new ArrayList<>();\r\n list.add(executor.submit(new FetchResourceCallable(\"https://dueinator.dk/jwtbackend/api/car/all\")));\r\n executor.shutdown();\r\n List<String> urlStr = new ArrayList<>();\r\n for (Future<String> future : list) {\r\n urlStr.add(future.get());\r\n }\r\n return urlStr;\r\n }", "public static void main(String[] args) {\n\t\tBlockingQueue queue = new LinkedBlockingQueue(4);\n\n\t\t// Thread factory below is used to create new threads\n\t\tThreadFactory thFactory = Executors.defaultThreadFactory();\n\n\t\t// Rejection handler in case the task get rejected\n\t\tRejectTaskHandler rth = new RejectTaskHandler();\n\t\t// ThreadPoolExecutor constructor to create its instance\n\t\t// public ThreadPoolExecutor(int corePoolSize,int maximumPoolSize,long\n\t\t// keepAliveTime,\n\t\t// TimeUnit unit,BlockingQueue workQueue ,ThreadFactory\n\t\t// threadFactory,RejectedExecutionHandler handler) ;\n\t\tThreadPoolExecutor threadPoolExecutor = new ThreadPoolExecutor(1, 2, 10L, TimeUnit.MILLISECONDS, queue,\n\t\t\t\tthFactory, rth);\n\n\t\tfor (int i = 1; i <= 10; i++) {\n\t\t\tDataFileReader df = new DataFileReader(\"File \" + i);\n\t\t\tSystem.out.println(\"A new file has been added to read : \" + df.getFileName());\n\t\t\t// Submitting task to executor\n\t\t\tthreadPoolExecutor.execute(df);\n\t\t}\n\t\tthreadPoolExecutor.shutdown();\n\t}", "public static void main(String[] args) throws InterruptedException {\n for (int i = 0; i < 3; i++) {\n MyCountedCompleter myCountedCompleter = new MyCountedCompleter();\n// forkJoinPool.submit(myCountedCompleter);\n myCountedCompleter.fork();\n }\n System.out.println(ForkJoinPool.commonPool().getActiveThreadCount());\n Thread.sleep(200000000);\n// forkJoinPool.shutdown();\n// System.out.println(forkJoinPool.isShutdown());\n// System.out.println(\"quiescence: \" + forkJoinPool.awaitQuiescence(5000, TimeUnit.MILLISECONDS));\n// System.out.println(\"termination: \" + forkJoinPool.awaitTermination(1000000, TimeUnit.MILLISECONDS));\n// System.out.println(forkJoinPool.toString());\n }", "public static void main(String[] args) {\n\t\tExecutorService eservice = Executors.newFixedThreadPool(3);\n\t\tdoSomething ds = new doSomething();\n\t\tFuture<Integer> future = eservice.submit(ds);\n\t\ttry{\n\t\t\tSystem.out.println(future.get());\n\t\t}\n\t\tcatch (Exception e){\n\t\t\te.printStackTrace();\n\t\t}\n\t\teservice.shutdown();\n\t}", "public static void main(String[] args) {\n ExecutorService executorService= Executors.newCachedThreadPool();\n// executorService.execute(new FibonacciA(5));\n// executorService.execute(new FibonacciB(5));\n Future<Integer> result=executorService.submit(new FibonacciCall(5));\n try {\n System.out.println(\"result:\"+result.get());\n }catch ( InterruptedException e){\n e.printStackTrace();\n }\n catch (ExecutionException e){\n e.printStackTrace();\n }\n finally {\n executorService.shutdown();\n }\n\n }", "public static void main(String[] args) {\n\t\tExecutorService executor = Executors.newFixedThreadPool(1);\r\n\t\t\r\n\t\t// Submit tasks to the executor, which is also the pool?\r\n\t\texecutor.execute(new PrintChar('a', 100));\r\n\t\texecutor.execute(new PrintChar('b', 100));\r\n\t\texecutor.execute(new PrintNum(100));\r\n\t\t\r\n\t\t// Shutdown the executor\r\n\t\texecutor.shutdown();\r\n\t\t\r\n\t}", "private Thread[] newThreadArray() { \r\n\t int n_cpus = Runtime.getRuntime().availableProcessors(); \r\n\t return new Thread[n_cpus]; \r\n\t }", "public static void main(String args[])\n {\n\t ScheduledExecutorService executorService= Executors.newScheduledThreadPool(2);\n\t Runnable task1=new RunnableChild(\"task1\");\n\t Runnable task2=new RunnableChild(\"task2\");\n\t Runnable task3=new RunnableChild(\"task3\");\n\t executorService.submit(task1);\n\t executorService.submit(task2);\n\t executorService.submit(task3);\n\t executorService.schedule(task1,20, TimeUnit.SECONDS);\n\t System.out.println(\"*******shutting down called\");\n\t executorService.shutdown();\n }", "public MultiThreadBatchTaskEngine(int aNThreads)\n {\n setMaxThreads(aNThreads);\n }", "@Test\n public void testThread() {\n\n Thread thread1 = new Thread(() -> {\n //i++;\n for (int j = 0; j < 2000000; j++) {\n (this.i)++;\n }\n });\n\n Thread thread2 = new Thread(() -> {\n //System.out.println(\"i = \" + i);\n for (int j = 0; j < 2000000; j++) {\n System.out.println(\"i = \" + this.i);\n }\n });\n\n thread1.start();\n thread2.start();\n /*for (int j = 0; j < 20; j++) {\n thread1.start();\n thread2.start();\n }*/\n\n\n /* ValueTask valueTask = new ValueTask();\n PrintTask printTask = new PrintTask();*/\n\n /*for (int i = 0; i < 20; i++) {\n Worker1 worker1 = new Worker1(valueTask);\n Worker2 worker2 = new Worker2(printTask);\n\n worker1.start();\n worker2.start();\n }*/\n\n }", "public static void main(String[] args) {\n Runnable runnable = new Runnable() {\n @Override\n public void run() {\n for(int i =0; i<10000; i++){\n System.out.println(\n Thread.currentThread().getId() + \":\" + i\n );\n }\n }\n };\n\n // using functions, a bit cleaner\n Runnable runnable2 = () -> {\n for(int i =0; i<10000; i++){\n System.out.println(\n Thread.currentThread().getId() + \":\" + i\n );\n }\n };\n\n Thread thread = new Thread(runnable);\n thread.start();\n\n Thread thread2 = new Thread(runnable);\n thread2.start();\n\n Thread thread3 = new Thread(runnable);\n thread3.start();\n\n }", "public void doRun(int numIterations, int numWorkers) throws InterruptedException, ExecutionException \n {\n List<Callable<Long>> tasks = new ArrayList<Callable<Long>>();\n for (int i = 0; i < numWorkers; ++i) \n {\n tasks.add(new WorkerWithThreads(numIterations));\n }\n \n // Run them and receive a collection of Futures\n ExecutorService exec = Executors.newFixedThreadPool(numWorkers);\n \n long start = System.currentTimeMillis();\n List<Future<Long>> results = exec.invokeAll(tasks);\n long total = 0;\n \n // Assemble the results.\n for (Future<Long> f : results)\n {\n // Call to get() is an implicit barrier. This will block\n // until result from corresponding worker is ready.\n total += f.get();\n }\n double pi = 4.0 * total / numIterations / numWorkers;\n\n long elapsed = System.currentTimeMillis() - start;\n\n System.out.println(\"Pi : \" + pi);\n System.out.println(elapsed);\n exec.shutdown();\n }", "int getExecutorPoolSize();", "@Test\r\n\tpublic void test()\r\n\t{\n\t\t\r\n\t\tThreadPoolManager.addPool(\"1,UD,12,12,30000,200000\");\r\n//\t\tThreadPoolManager.addPool(\"2,UD,12,12,30000,200000\");\r\n\r\n// ThreadPoolManager.init(params);\r\n// ThreadPoolManager.getPool(\"1\");\r\n\t\t\r\n//\t\tThread t = new Thread(this.testCreaterun());\r\n//\t\tBaseTask\r\n\t\tBaseTask b = this.testCreaterun();\r\n\t\tThreadPoolManager.submit(\"1\", b);\r\n\t\t\r\n\t\tSystemUtil.sleep(2000);\r\n\t\tThreadPoolManager.shutdownNow(\"1\");\r\n\t\t\r\n\t\tSystemUtil.sleep(2000);\r\n\t\t\r\n\t\t\r\n\t\t\r\n\t\tSystemUtil.sleepForever();\r\n\t}", "public static void main(String[] args)\r\n\t{\r\n\t\tExecutorService executorService = Executors.newFixedThreadPool(1);\r\n\t\tList<Future<String>> futureList = new ArrayList<>();\r\n\t\t\r\n\t\tCallable<String> callable = new Thread1();\r\n\t\tCallable<String> callable2 = new Thread1();\r\n\t\tCallable<String> callable3 = new Thread1();\r\n\t\t\r\n\t\t// Future:\r\n\t\t/** A Future represents the result of an asynchronous computation. Methods are provided to check if the computation is complete, \r\n\t\t* to wait for its completion, and to retrieve the result of the computation. The result can only be retrieved using method get \r\n\t\t* when the computation has completed, blocking if necessary until it is ready. Cancellation is performed by the cancel method. \r\n\t\t* Additional methods are provided to determine if the task completed normally or was cancelled. Once a computation has completed, \r\n\t\t* the computation cannot be cancelled. If you would like to use a Future for the sake of cancellability but not provide a usable \r\n\t\t* result, you can declare types of the form Future<?> and return null as a result of the underlying task. **/\r\n\t\t\r\n\t\t// submit():\r\n\t\t/** Submits a value-returning task for execution and returns a Future representing the pending results of the task. \r\n\t\t* The Future's get method will return the task's result upon successful completion. \r\n\t\t* If you would like to immediately block waiting for a task, you can use constructions of the form result = exec.submit(aCallable).get(); **/ \r\n\t\tFuture<String> future = executorService.submit(callable);\r\n\t\tfutureList.add(future);\r\n\t\t\r\n\t\tFuture<String> future2 = executorService.submit(callable2);\r\n\t\tfutureList.add(future2);\r\n\t\t\r\n\t\tFuture<String> future3 = executorService.submit(callable3);\r\n\t\tfutureList.add(future3);\r\n\t\t\r\n\t\tSystem.out.println(\"futureList.size(): \"+futureList.size()); \r\n\t\t\r\n\t\tfor(Future<String> fut : futureList)\r\n\t\t{\r\n\t\t\ttry\r\n\t\t\t{\r\n\t\t\t\t// cancel(true)\r\n\t\t\t\t/** Attempts to cancel execution of this task. This attempt will fail if the task has already completed, has already been cancelled, \r\n\t\t\t\t* or could not be cancelled for some other reason. If successful, and this task has not started when cancel is called, this task should never run. \r\n\t\t\t\t* If the task has already started, then the mayInterruptIfRunning parameter determines whether the thread executing this task should be \r\n\t\t\t\t* interrupted in an attempt to stop the task. After this method returns, subsequent calls to isDone will always return true. \r\n\t\t\t\t* Subsequent calls to isCancelled will always return true if this method returned true. **/\r\n\t\t\t\t// System.out.println(fut.cancel(true));\r\n\t\t\t\t\r\n\t\t\t\t// get():\r\n\t\t\t\t// Waits if necessary for the computation to complete, and then retrieves its result.\r\n\t\t\t\tSystem.out.println(fut.get());\r\n\t\t\t\t\r\n\t\t\t\t// get(1000, TimeUnit.MILLISECONDS):\r\n\t\t\t\t/** Waits if necessary for at most the given time for the computation to complete, and then retrieves its result, if available.\r\n\t\t\t\t* Here, we can specify the time to wait for the result, itís useful to avoid current thread getting blocked for longer time. **/ \r\n\t\t\t\t// System.out.println(fut.get(1000, TimeUnit.MILLISECONDS));\r\n\t\t\t\t\r\n\t\t\t\t// isDone():\r\n\t\t\t\t/** Returns true if this task completed. \r\n\t\t\t\t* Completion may be due to normal termination, an exception, or cancellation -- in all of these cases, this method will return true **/\r\n\t\t\t\t// System.out.println(fut.isDone());\r\n\t\r\n\t\t\t\t// isCancelled(): \r\n\t\t\t\t/** Returns true if this task was cancelled before it completed normally. **/\r\n\t\t\t\t// System.out.println(fut.isCancelled());\r\n\t\t\t}\r\n\t\t\tcatch(Exception ex)\r\n\t\t\t{\r\n\t\t\t\tex.printStackTrace();\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\texecutorService.shutdown();\r\n\t}", "public interface ThreadExecutor extends Executor {\n}", "public void testGetNumThreads_ThreadPoolExecutor()\n {\n System.out.println( \"getNumThreads\" );\n int numThreads = 10;\n PA pa = new PA();\n assertEquals( 0, ParallelUtil.getNumThreads( pa.getThreadPool() ) );\n \n pa.threadPool = ParallelUtil.createThreadPool( 10 ); \n \n int result = ParallelUtil.getNumThreads( pa.getThreadPool() );\n assertEquals( numThreads, result );\n }", "public static void main(String[] args){ new ThreadPoolBlockingServer().processRequests(); }", "public static void main(String[] args) throws InterruptedException {\n\t\tThreadPoolExecutor executor = (ThreadPoolExecutor) Executors.newFixedThreadPool(3);\n\t\tint numPaletes = 5, ti, te, numMaons = 10;\n\t\t\n\t\t//instanciem els paletes\n\t\tPaletaP[] P = new PaletaP[numPaletes];\n\t\t\t\t\t\t\n\t\t//comencem a contar el temps\n\t\tti = (int) System.currentTimeMillis();\n\t\t//Donem nom als paletes i els posem a fer fer la paret\n\t\tfor (int i=0;i<numPaletes;i++) {\n\t\t\tP[i] = new PaletaP(\"Paleta-\"+i,numMaons);\n\t\t\texecutor.execute(P[i]);\n\t\t}\n\n\t\texecutor.shutdown();\n\t\texecutor.awaitTermination(Long.MAX_VALUE, TimeUnit.SECONDS);\n\t\t/*while (!executor.isTerminated()) {\n\t\t}*/\n\n\t\t//Han acabat i agafem el temps final\n\t\tte = (int) System.currentTimeMillis();\n\t\t\t\t\n\t\tSystem.out.println(\"Han trigat: \" + (te - ti)/1000 + \" segons\");\n\t\t\n\t}", "private void executeConcurrently() {\n String[] commandArgs = SysLib.stringToArgs(command);\n prevPID = SysLib.exec(commandArgs); //run command\n command = \"\"; //clear command\n }", "public void testExecuteInSequence() throws Exception\n {\n System.out.println( \"executeInSequence\" );\n Collection<Callable<Double>> tasks = createTasks( 10 );\n Collection<Double> result = ParallelUtil.executeInSequence( tasks );\n assertEquals( result.size(), tasks.size() );\n }", "private void initThreadPool(int numOfThreadsInPool, int[][] resultMat, Observer listener) {\n for(int i=0;i<numOfThreadsInPool; i++){\r\n PoolThread newPoolThread = new PoolThread(m_TaskQueue, resultMat);\r\n newPoolThread.AddResultMatListener(listener);\r\n m_Threads.add(newPoolThread);\r\n }\r\n // Start all Threads:\r\n for(PoolThread currThread: m_Threads){\r\n currThread.start();\r\n }\r\n }", "public static void main(String[] args) throws Exception {\n // construct a new executor that will run async tasks\n AsyncExecutor executor = new ThreadAsyncExecutor();\n\n // start few async tasks with varying processing times, two last with callback handlers\n AsyncResult<Integer> asyncResult1 = executor.startProcess(lazyval(10, 5000));\n AsyncResult<String> asyncResult2 = executor.startProcess(lazyval(\"test\", 3000));\n AsyncResult<Long> asyncResult3 = executor.startProcess(lazyval(50L, 7000));\n AsyncResult<Integer> asyncResult4 = executor.startProcess(lazyval(20, 4000), callback(9999));\n AsyncResult<String> asyncResult5 =\n executor.startProcess(lazyval(\"I am result5\", 6000), callback(\"Callback result 5\"));\n\n // emulate processing in the current thread while async tasks are running in their own threads\n Thread.sleep(3500); // Oh boy I'm working hard here\n log(\"Some hard work done\");\n\n // wait for completion of the tasks\n Integer result1 = executor.endProcess(asyncResult1);\n String result2 = executor.endProcess(asyncResult2);\n Long result3 = executor.endProcess(asyncResult3);\n asyncResult4.await();\n asyncResult5.await();\n\n // log the results of the tasks, callbacks log immediately when complete\n log(\"Result 1: \" + result1);\n log(\"Result 2: \" + result2);\n log(\"Result 3: \" + result3);\n log(\"Result 4: \" + asyncResult4.getValue());\n log(\"Result 5: \" + asyncResult5.getValue());\n }", "private static void test() {\n\t\tVector<Object> list = new Vector<Object>();\n\t\tint threadNum = 1000;\n\t\tCountDownLatch countDownLatch = new CountDownLatch(threadNum);\n\t\t\n\t\t//启动threadNum个子线程\n\t\tfor(int i=0;i<threadNum;i++){\n\t\t\tThread thread = new Thread(new MyThread(list,countDownLatch));\n\t\t\tthread.start();\n\t\t}\n\t\t\n\t\ttry{\n\t\t\t//主线程等待所有子线程执行完成,再向下执行\n\t\t\tcountDownLatch.await();;\n\t\t}catch(InterruptedException e){\n\t\t\te.printStackTrace();\n\t\t}\n\t\t\n\t\tSystem.out.println(list.size());\n\t}", "public void testNewSingleThreadExecutor1() {\n final ExecutorService e = Executors.newSingleThreadExecutor();\n try (PoolCleaner cleaner = cleaner(e)) {\n e.execute(new NoOpRunnable());\n e.execute(new NoOpRunnable());\n e.execute(new NoOpRunnable());\n }\n }", "public static void main(String[] args) {\n\n ScheduledExecutorService service = Executors.newScheduledThreadPool(4);\n\n //task to run after 10 seconds delay\n service.schedule(new Task(), 10, TimeUnit.SECONDS);\n\n //task to repeatedly every 10 seconds\n service.scheduleAtFixedRate(new Task(), 15, 10, TimeUnit.SECONDS);\n\n //task to run repeatedly 10 seconds after previous task completes\n service.scheduleWithFixedDelay(new Task(), 15, 10, TimeUnit.SECONDS);\n\n\n for (int i = 0; i < 100; i++) {\n System.out.println(\"task number - \" + i + \" \");\n service.execute(new Task());\n }\n System.out.println(\"Thread name: \" + Thread.currentThread().getName());\n\n }", "public static void main(String[] args) {\n\t\tForkJoinPool fjp = new ForkJoinPool(); \r\n\t\t \r\n double[] nums = new double[5000]; \r\n for (int i = 0; i < nums.length; i++) { \r\n nums[i] = (double)(((i % 2) == 0) ? i : -1); \r\n } \r\n Sum task = new Sum(nums, 0, nums.length); \r\n double summation = fjp.invoke(task); \r\n System.out.println(\"Summation \" + summation);\r\n \r\n\r\n\t}", "public void testNewFixedThreadPool1() {\n final ExecutorService e = Executors.newFixedThreadPool(2);\n try (PoolCleaner cleaner = cleaner(e)) {\n e.execute(new NoOpRunnable());\n e.execute(new NoOpRunnable());\n e.execute(new NoOpRunnable());\n }\n }", "public int getExecutors() {\r\n return executors;\r\n }", "@Test \n\t public static void Execute_Sessions() throws Exception\n\t {\n\t\t int MYTHREADS = 30; \n\t\t // ExecutorService pool = Executors.newFixedThreadPool(MYTHREADS); \n\t\t //CountDownLatch latch = new CountDownLatch(totalNumberOfTasks);\n\t\t ExecutorService executor = Executors.newFixedThreadPool(MYTHREADS);\n\t\t \n\t\t// CountDownLatch latch = new CountDownLatch(15);\n\t\t //ExecutorService executor = Executors.newFixedThreadPool(13);\n\t\t// ExecutorService pool = Executors.newFixedThreadPool(MYTHREADS); \n\t\t \n\t\t int NumberofTestScripts = 0;\n\t\t\tExcelApiTest3 eat = new ExcelApiTest3();\n\t\t\tNumberofTestScripts=eat.getRowCount(\"E://Batch2Source//Regression1.xls\",\"Sheet1\");\n\t\t\tSystem.out.println(\"Numberof TestScripts Count Regression1.xls :\"+NumberofTestScripts);\n\t\t\t\n\t\t\t\t\t\n\t\t\tfor (int iRow1=1;iRow1<NumberofTestScripts;iRow1++) // Number of Test Cases in Regression Sheet\n\t\t\t{\n\t\t\t\tRunnable worker = new DriverTest124(iRow1);\n\t\t\t\tThread.sleep(3000);\n\t\t\t\t\n\t \t\texecutor.execute(worker);\n\t \t\t\n\n\t\t\t\t//executor.awaitTermination(5, TimeUnit.HOURS);\n\t \t\t//Runnable worker = new WorkerThread(\"\" + iRow1);\n\t // executor.execute(worker);\n\t\t\t\t//Future f = executor.submit(new DriverTest124(iRow1));\n\t\t\t\t//f.get(60,TimeUnit.SECONDS);\n\t\t\t\t//Thread.sleep(9000);\n\t \t\n\t\n\t\t\t\t/*\n\t \t\tSystem.out.println(\"First Thread ID:\"+Thread.currentThread().getId());\n\t\t\t\tSystem.out.println(\"First Thread status:\"+Thread.currentThread().getState());\n\t\t\t\tSystem.out.println(\"First Thread Name:\"+Thread.currentThread().getName());\n\t\t\t\t\n\t\t\n\t\t\t\t String str=\"Row Iteration in for loop- \" + String.valueOf(iRow1);\n\t\t\t\t System.out.println(\"Row Iteration in for loop- \"+str);\n\t\t\t\t\n\t\t\t\tSystem.out.println(\"Thread ID:\"+Thread.currentThread().getId());\n\t\t\t\tSystem.out.println(\"Thread status:\"+Thread.currentThread().getState());\n\t\t\t\tSystem.out.println(\"Thread Name:\"+Thread.currentThread().getName());*/\n\t\t\t\t\n\t\t\t\t/*if(Thread.currentThread().isInterrupted())\n\t\t\t\t{\n\t\t\t\t\tSystem.out.println(\"Thread status:\"+Thread.currentThread().getId());\n\t\t\t\t\tSystem.out.println(\"Thread status:\"+Thread.currentThread().getState());\n\t\t\t\t}*/\n\t\t\t\t\n\t \t\n\t\t\t\t//f.wait();\n\t\t\t\t//System.out.println(\"Task Status - :\"+f.isCancelled());\n\t\t\t\t\n\t\t\t\t\t//f.isDone();\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\n\t\t\t/*try {\n\t\t\t latch.await();\n\t\t\t} catch (InterruptedException E) {\n\t\t\t\t\n\t\t\t}\n\t\t\t*/\n\t\t\t\n\t\t\tSystem.out.println(\"Finish tasks\");\n\t\t\t\n\t\t\t//awaitTerminationAfterShutdown\n\t\t\t\t\t\n\t\t\n\t\t\texecutor.shutdown();\n\t\t\texecutor.awaitTermination(5, TimeUnit.HOURS);\n\t\t\t\n\t\t\t// Wait until all threads are finish\n\t\t//\twhile (!executor.isTerminated()) {\n\t \n\t\t//\t}\n\t\t\tSystem.out.println(\"\\nFinished all threads\");\n\t\t\t\n\t\t\t\n\t\t}", "public static void main(String[] args) {\n ForkJoinPool forkJoinPool = new ForkJoinPool(Runtime.getRuntime().availableProcessors());\n\n //Create three FolderProcessor tasks. Initialize each one with a different folder path.\n FolderProcessor desktop = new FolderProcessor(\"/Users/neeraj/Desktop\", \"log\");\n FolderProcessor downloads = new FolderProcessor(\"/Users/neeraj/Downloads\", \"log\");\n FolderProcessor github = new FolderProcessor(\"/Users/neeraj/Projects/office\", \"log\");\n\n // Execute the 3 tasks in the ForkJoinPool.\n forkJoinPool.execute(desktop);\n forkJoinPool.execute(downloads);\n forkJoinPool.execute(github);\n\n //Write to the console information about the status of the pool every second\n //until the three tasks have finished their execution.\n do {\n System.out.printf(\"******************************************\\n\");\n System.out.printf(\"Main: Parallelism: %d\\n\", forkJoinPool.getParallelism());\n System.out.printf(\"Main: Active Threads: %d\\n\", forkJoinPool.getActiveThreadCount());\n System.out.printf(\"Main: Task Count: %d\\n\", forkJoinPool.getQueuedTaskCount());\n System.out.printf(\"Main: Steal Count: %d\\n\", forkJoinPool.getStealCount());\n System.out.printf(\"******************************************\\n\");\n try {\n TimeUnit.SECONDS.sleep(1);\n } catch (InterruptedException e) {\n e.printStackTrace();\n }\n } while ((!desktop.isDone()) || (!downloads.isDone()) || (!github.isDone()));\n\n //Shut down ForkJoinPool using the shutdown() method.\n forkJoinPool.shutdown();\n\n //Write the number of results generated by each task to the console.\n List<String> results;\n results = desktop.join();\n System.out.printf(\"Desktop: %d files found.\\n\", results.size());\n results = downloads.join();\n System.out.printf(\"Downloads: %d files found.\\n\", results.size());\n results = github.join();\n System.out.printf(\"Github: %d files found.\\n\", results.size());\n\n }", "private void YeWuMethod(String name) {\n\n for (int j = 0; j < 10; j++) {\n\n\n// Runnable task = new RunnableTask();\n// Runnable ttlRunnable = TtlRunnable.get(task);\n\n// executor.execute(ttlRunnable);\n\n executor.execute(() -> {\n System.out.println(\"==========\"+name+\"===\"+threadLocal.get());\n });\n }\n\n// for (int i = 0; i < 10; i++) {\n// new Thread(() -> {\n// System.out.println(name+\"===\"+threadLocal.get());\n// }, \"input thread name\").start();\n// }\n\n\n\n\n }", "public static void main(String[] args) throws InterruptedException {\n Runnable r1 = new Runnable() {\n @Override public void run() {\n try {\n Thread.sleep( 600);\n } catch (InterruptedException e) {\n e.printStackTrace();\n }\n System.out.println( \"A1 \" + Thread.currentThread() );\n System.out.println( \"A2 \" + Thread.currentThread() );\n }\n };\n\n Runnable r2 = new Runnable() {\n @Override public void run() {\n try {\n Thread.sleep(600);\n } catch (InterruptedException e) {\n e.printStackTrace();\n }\n System.out.println( \"B1 \" + Thread.currentThread() );\n System.out.println( \"B2 \" + Thread.currentThread() );\n }\n };\n\n ExecutorService executor = Executors.newCachedThreadPool();\n\n executor.submit( r1 );\n executor.submit( r2 );\n\n System.out.println(\"Pause beginnt ...\");\n Thread.sleep( 5000 );\n System.out.println(\"Pause beendet ...\");\n\n executor.execute( r1 );\n executor.execute( r2 );\n\n executor.shutdown();\n }", "public static void main(String[] args) {\n\t\tExecutorService executor = Executors.newFixedThreadPool(3);\n\t\t\n\t\t// Submit runnable tasks to the executor\n\t\texecutor.execute(new PrintChar('a', 100));\n\t\texecutor.execute(new PrintChar('b', 100));\n\t\texecutor.execute(new PrintNum(100));\n\t\t\n\t\t// Shut down the executor\n\t\texecutor.shutdown();\n\t}", "protected synchronized ExecutorService getService() {\r\n if(service == null) {\r\n //System.out.println(\"creating an executor service with a threadpool of size \" + threadPoolSize);\r\n service = Executors.newFixedThreadPool(threadPoolSize, new ThreadFactory() {\r\n private int count = 0;\r\n \r\n public Thread newThread(Runnable r) {\r\n Thread t = new Thread(r, \"tile-pool-\" + count++);\r\n t.setPriority(Thread.MIN_PRIORITY);\r\n t.setDaemon(true);\r\n return t;\r\n }\r\n });\r\n }\r\n return service;\r\n }", "private void completionService() {\n ListeningExecutorService executor = MoreExecutors.listeningDecorator(Executors.newFixedThreadPool(numberOfThreadsInThePool));\n ExecutorCompletionService<String> completionService = new ExecutorCompletionService<String>(executor);\n for (final String printRequest : printRequests) {\n// ListenableFuture<String> printer = completionService.submit(new Printer(printRequest));\n completionService.submit(new Printer(printRequest));\n }\n try {\n for (int t = 0, n = printRequests.size(); t < n; t++) {\n Future<String> f = completionService.take();\n System.out.print(f.get());\n }\n } catch (InterruptedException | ExecutionException e) {\n Thread.currentThread().interrupt();\n } finally {\n// if (executor != null) {\n executor.shutdownNow();\n// }\n }\n\n }", "int XInitThreads();", "public static void runThreads(int nthread, Counter counter, final int limit) {\n\t\tExecutorService executor = Executors.newFixedThreadPool(2 * nthread);\n\t\t// start the tasks\n\t\tSystem.out.println(\"Starting tasks\");\n\t\tlong startTime = System.nanoTime();\n\t\tfor (int k = 1; k <= nthread; k++) {\n\t\t\tRunnable addtask = new AddTask(counter, limit);\n\t\t\tRunnable subtask = new SubtractTask(counter, limit);\n\t\t\texecutor.submit(addtask);\n\t\t\texecutor.submit(subtask);\n\t\t}\n\t\t// wait for threads to finish\n\t\ttry {\n\t\t\texecutor.shutdown();\n\t\t\texecutor.awaitTermination(1, TimeUnit.MINUTES);\n\t\t} catch (InterruptedException e) {\n\t\t\tSystem.err.println(e.getMessage());\n\t\t}\n\t\tSystem.out.println(\"All down\");\n\t\t// print elapsed time and counter value\n\t\tdouble elapsed = 1.0E-9 * (System.nanoTime() - startTime);\n\t\tSystem.out.printf(\"Count 1 to %,d in %.6f sec\\n\", limit, elapsed);\n\t\t// the sum should be 0. Is it?\n\t\tSystem.out.printf(\"Counter total is %d\\n\", counter.get());\n\t}", "public static void main(String[] args) throws Exception {\n FutureTask<String> futureTask = new FutureTask<String>(new Callable<String>() {\n @Override\n public String call() throws Exception {\n Thread.sleep(10000);\n System.out.println(\"thread done ...\");\n return \"hello world\";\n }\n });\n futureTask.run();\n// executorService.submit(futureTask);\n System.out.println(futureTask.get());\n// executorService.shutdown();\n }", "public static ExecutorService m21543a() {\n return f19854a;\n }", "public static void main(String[] args) throws InterruptedException, ExecutionException {\n\t\tExecutorService executor = Executors.newFixedThreadPool(THREAD_POOL_SIZE);\n\n\t\tCallableInterfaceDemo counter = new CallableInterfaceDemo();\n\n\t\tFuture<String> future1 = executor.submit(counter); // Producer\n\t\tFuture<String> future2 = executor.submit(counter); // Producer\n\n\t\tSystem.out.println(Thread.currentThread().getName() + \" executing ...\");\n\n\t\t// asynchronously get from the worker threads\n\t\tSystem.out.println(future1.get());\n\t\tSystem.out.println(future2.get());\n\n\t}", "public static void main(String[] argv) throws Exception\n {\n String basePath = \"/data/TreeKernel/data/\";\n //basePath = \"/Users/u6042446/IdeaProjects/TreeKernels/data/\";\n\n //String readPath = basePath + argv[0];\n String index = argv[2];\n //String index = \"0\";\n int numThreads = Integer.parseInt(argv[0]);\n //int numThreads = 2;\n String readPath = argv[1];\n //String readPath = basePath + \"ANC_written_sentenceperline_v5.txt\";\n String writePath = basePath + \"stats\";\n\n BufferedReader reader = new BufferedReader(new InputStreamReader(new FileInputStream(readPath),\"UTF-8\"));\n BufferedWriter writer = new BufferedWriter(new OutputStreamWriter(new FileOutputStream(writePath),\"UTF-8\"));\n\n String line;\n\n int counter = 0;\n LinkedList<Sentence> allRecords = new LinkedList<Sentence>();\n while ((line=reader.readLine())!=null)\n {\n String[] split = line.split(\"\\t\");\n String text = split[1];\n int Id = Integer.parseInt(split[0]);\n int sentLength = Integer.parseInt(split[2]);\n if (sentLength>=lowSentLengthThreshold && sentLength<=highSentLengthThreshold)\n {\n allRecords.add(new Sentence(text,sentLength,Id));\n }\n }\n reader.close();\n //slice data\n\n //ANCExperiment experiment = new ANCExperiment(allRecords,writePath+\"_\"+index+\".txt\",index);\n //experiment.run();\n\n ExecutorService pool = Executors.newFixedThreadPool(numThreads);\n List<List<Sentence>> slices = sliceList(allRecords,allRecords.size()/numThreads);\n //pool.execute(new ANCExperiment(slices.get(0),writePath+\"_\"+0+\".txt\",0));\n\n //Create a list of tasks\n //System.out.print(slices.get(1).size()+\"\\n\");\n //System.exit(0);\n int workerId = 0;\n for (List<Sentence> slice: slices)\n {\n Runnable worker = new ANCExperiment(slice,writePath+\"_\"+workerId+ \"_\" + index + \".txt\",workerId);\n workerId+=1;\n pool.execute(worker);\n }\n pool.shutdown();\n // Wait until all threads are finish\n pool.awaitTermination(100,TimeUnit.HOURS);\n writer.close();\n }", "public static void main(String[] args) throws InterruptedException {\nfor(int i=0;i<5;i++){\n\t\tThread unsafe = new Thread(new ThreadSafe());\n\t\tunsafe.start();\n\t\tTimeUnit.SECONDS.sleep(2);\n}\n\t}", "public static ExecutorService m22730c() {\n if (f20302c == null) {\n synchronized (C7258h.class) {\n if (f20302c == null) {\n f20302c = C7268n.m22763a().mo18997a(C7265m.m22758a(ThreadPoolType.IO).mo18996a(), true);\n }\n }\n }\n return f20302c;\n }", "@Override\n\tpublic void execute() {\n\t\tThreadPool pool=ThreadPool.getInstance();\n\t\tpool.beginTaskRun(this);\n\t}", "public static void execAndPrint() {\n\t\tArrays.parallelSetAll(Main.arrays, value -> ThreadLocalRandom.current().nextInt(1000000));\n\t\tRunnable task = null;\n\t\tStopWatch watch = new StopWatch();\n\n\t\tfor (int i = 0; i < TaskFactory.values().length; i++) {\n\t\t\ttask = TaskFactory.values()[i].getTask();\n\n\t\t\tSystem.out.println(\"Starting Task: \" + task.toString());\n\n\t\t\twatch.start();\n\t\t\ttask.run();\n\t\t\twatch.stop();\n\n\t\t\tSystem.out.printf(\"Elapsed time is %.5f sec\\n\\n\", watch.getElapsed());\n\n\t\t\twatch.reset();\n\t\t}\n\n\n\t}" ]
[ "0.7162939", "0.68468124", "0.67974204", "0.67914236", "0.6680448", "0.6630503", "0.6595481", "0.65567297", "0.6540369", "0.6523513", "0.64987296", "0.6486301", "0.64604014", "0.6428719", "0.6419118", "0.64094955", "0.64050794", "0.6393713", "0.6375978", "0.6372931", "0.6357634", "0.63545275", "0.63409066", "0.6327714", "0.6324156", "0.63120604", "0.63116354", "0.6274953", "0.6258262", "0.6242332", "0.61997557", "0.618892", "0.6172869", "0.6164432", "0.6161732", "0.61337787", "0.6132651", "0.61270446", "0.61252224", "0.61225617", "0.61148316", "0.6107635", "0.6097568", "0.60969824", "0.6069813", "0.6057502", "0.60379523", "0.60221004", "0.6009738", "0.6006006", "0.5996423", "0.59837824", "0.59663284", "0.5964359", "0.59613806", "0.596113", "0.59542084", "0.59524876", "0.59403306", "0.5927813", "0.5926981", "0.590789", "0.5907696", "0.58849686", "0.58649766", "0.58436847", "0.58188903", "0.58077455", "0.57985586", "0.57942486", "0.5771351", "0.577016", "0.5768336", "0.5767665", "0.5767463", "0.5766775", "0.5754092", "0.5751754", "0.5743945", "0.5727964", "0.57244474", "0.57090956", "0.5708324", "0.5706297", "0.5705291", "0.57040906", "0.5703097", "0.56990445", "0.5692222", "0.5689715", "0.56886286", "0.5686499", "0.5686161", "0.5673878", "0.56684893", "0.5654758", "0.5654731", "0.56531686", "0.5650331", "0.5644021", "0.564207" ]
0.0
-1
This will reference one line at a time
public static ArrayList<String> getGeneSymbols(String filename){ String line = null; // This will contain the gene symbols ArrayList<String> geneSymbols = new ArrayList<String>(); try { // FileReader reads text files in the default encoding. FileReader fileReader = new FileReader(filename); // Always wrap FileReader in BufferedReader. BufferedReader bufferedReader = new BufferedReader(fileReader); while((line = bufferedReader.readLine()) != null) { String lineHolder = line.toString(); String delimiter = "\\t"; String [] strArray = lineHolder.split(delimiter); geneSymbols.add(strArray[0]); } // Always close files. bufferedReader.close(); } catch(FileNotFoundException ex) { System.out.println("Unable to open file '" + filename + "'"); } catch(IOException ex) { System.out.println("Error reading file '" + filename + "'"); // Or we could just do this: // ex.printStackTrace(); } return geneSymbols; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "void getNextLine()\n\t\t\tthrows IOException, FileNotFoundException {\n String nextLine = \"\";\n if (reader == null) {\n nextLine = textLineReader.readLine();\n } else {\n nextLine = reader.readLine();\n }\n if (nextLine == null) {\n atEnd = true;\n line = new StringBuffer();\n } else {\n\t\t line = new StringBuffer (nextLine);\n }\n if (context.isTextile()) {\n textilize ();\n }\n\t\tlineLength = line.length();\n\t\tlineIndex = 0;\n\t}", "LineReferenceType getLineReference();", "public abstract String getFirstLine();", "public void line(String line) {\n\t\t}", "void incrementLinesRead();", "protected void processLine(String line){}", "private void processLine(String line, String fileName) {\n splitedLine = textProcess.lemmatize(line);\n indexer.addLineToDoc(fileName, splitedLine);\n }", "String getCurrentLine();", "private String nextLine(BufferedReader reader) throws IOException {\n String ln = reader.readLine();\n if (ln != null) {\n int ci = ln.indexOf('#');\n if (ci >= 0)\n ln = ln.substring(0, ci);\n ln = ln.trim();\n }\n return ln;\n }", "public Line getLine(String targetLine);", "void showsame() {\n\t\tint count;\n\t\tprintstatus = idle;\n\t\tif (newinfo.other[printnewline] != printoldline) {\n\t\t\tSystem.err.println(\"BUG IN LINE REFERENCING\");\n\t\t\tSystem.exit(1);\n\t\t}\n\t\tcount = blocklen[printoldline];\n\t\tprintoldline += count;\n\t\tprintnewline += count;\n\t}", "public abstract String getLine(int lineNumber);", "private static void eachLine(BufferedReader br, List<String> lines) throws IOException {\n try {\n while (true) {\n String line = br.readLine();\n if (line == null) {\n break;\n } else {\n lines.add(line);\n }\n }\n } finally {\n br.close();\n }\n }", "public int getLine() {return _line;}", "void annotate(String line);", "public RubyIO each_lineInternal(ThreadContext context, IRubyObject[] args, Block block) {\n Ruby runtime = context.getRuntime();\n ByteList separator = getSeparatorForGets(runtime, args);\n \n ByteListCache cache = new ByteListCache();\n for (IRubyObject line = getline(runtime, separator); !line.isNil(); \n \t\tline = getline(runtime, separator, cache)) {\n block.yield(context, line);\n }\n \n return this;\n }", "@Override\n public Line getLine() {\n return line;\n }", "public void setLine ( String value )\n {\n line = value;\n }", "axiom Object readLine(Object BufferedReader(FileReaderr f)) {\n\treturn f.get(0);\n }", "private void raceFormat()\n {\n topLine();\n secondLine();\n thirdLine();\n fourthLine();\n }", "public String getLine1() {\n return line1;\n }", "public String nextLine() {\n\t\treturn null;\r\n\t}", "public void setLine1(String line1) {\n this.line1 = line1;\n }", "void visit(Line line);", "public abstract void visit(Line line);", "void markLine() {\n lineMark = cursor;\n }", "public String getLine ()\n {\n return line;\n }", "private void textilize () {\n\n textIndex = 0;\n int textEnd = line.length() - 1;\n listChars = new StringBuffer();\n linkAlias = false;\n while (textIndex < line.length()\n && (Character.isWhitespace(textChar()))) {\n textIndex++;\n }\n while (textEnd >= 0\n && textEnd >= textIndex\n && Character.isWhitespace (line.charAt (textEnd))) {\n textEnd--;\n }\n boolean blankLine = (textIndex >= line.length());\n if (blankLine) {\n textilizeBlankLine();\n }\n else\n if ((textIndex > 0)\n || ((line.length() > 0 )\n && (line.charAt(0) == '<'))) {\n // First character is white space of the beginning of an html tag:\n // Doesn't look like textile... process it without modification.\n }\n else\n if (((textEnd - textIndex) == 3)\n && line.substring(textIndex,textEnd + 1).equals (\"----\")) {\n // && (line.substring(textIndex, (textEnd + 1)).equals (\"----\")) {\n textilizeHorizontalRule(textIndex, textEnd);\n } else {\n textilizeNonBlankLine();\n };\n }", "@Test\n public void test() {\n bridge.chunk(\"file.txt\", new InputStreamReader(new ByteArrayInputStream(new byte[0]), StandardCharsets.UTF_8));\n List<TokensLine> lines = bridge.chunk(\"file.txt\", new InputStreamReader(new ByteArrayInputStream(new byte[0]), StandardCharsets.UTF_8));\n\n assertThat(lines.size(), is(3));\n\n TokensLine line = lines.get(0);\n // 2 tokens on 1 line\n assertThat(line.getStartUnit(), is(1));\n assertThat(line.getEndUnit(), is(2));\n\n assertThat(line.getStartLine(), is(1));\n assertThat(line.getEndLine(), is(1));\n assertThat(line.getHashCode(), is(\"t1t2\".hashCode()));\n\n line = lines.get(1);\n // 1 token on 2 line\n assertThat(line.getStartUnit(), is(3));\n assertThat(line.getEndUnit(), is(3));\n\n assertThat(line.getStartLine(), is(2));\n assertThat(line.getEndLine(), is(2));\n assertThat(line.getHashCode(), is(\"t3\".hashCode()));\n\n line = lines.get(2);\n // 3 tokens on 4 line\n assertThat(line.getStartUnit(), is(4));\n assertThat(line.getEndUnit(), is(6));\n\n assertThat(line.getStartLine(), is(4));\n assertThat(line.getEndLine(), is(4));\n assertThat(line.getHashCode(), is(\"t1t3t3\".hashCode()));\n }", "public List<String> nextOneLine() throws IOException {\n counterSeveralLines = linesAfter;\n if (StringUtils.isBlank(currentPath)) return null;\n String sCurrentLine;\n if ((sCurrentLine = bufferReader.readLine()) != null) {\n listBefore = addToArray(sCurrentLine);\n }\n return listBefore;\n }", "public Line getLine()\n {\n return line;\n }", "public String getLine1() {\n return line1;\n }", "public GetParse(String line){\r\n\r\n Inline = line;\r\n this.parseWord(line);\r\n }", "public int getLine()\n/* */ {\n/* 1312 */ return this.line;\n/* */ }", "public void map(String line, ImoocContext context);", "public void jumpToNextLine() {\n int currentLineNo = getCurrentLineByCursor();\n if (currentLineNo == textBuffer.getMaxLine()-1) {\n textBuffer.setCurToTail();\n return;\n }\n int curX = round(cursor.getX());\n textBuffer.setCurToTargetNo(currentLineNo+1);\n lineJumpHelper(curX);\n }", "private static void readLine(BufferedReader br, String field, String line, int pos, GameFile gameFile) throws IOException {\r\n\t\t\r\n\t\tString[] s = line.split(\"=\"); //splits the current line at equal sines\r\n\t\t\r\n\t\tString n = s[0];\r\n\t\t\r\n\t\tif(n.isEmpty()) return;\r\n\t\tif(n.startsWith(\"#\")) return; //if the line is a comment, skip the line\r\n\t\t\r\n\t\tString f = field + \".\" + n; //add the field name to the end of the field chain\r\n\t\t\r\n\t\t//if the line does not contain an equales sine than just add the line to the gamefile\r\n\t\tif(s.length == 1) {\r\n\t\t\tgameFile.add(field, n, pos);\r\n\t\t\treturn;\r\n\t\t}\r\n\t\t\r\n\t\t//if the rest of the current line starts with a currly bracket than read that line\r\n\t\tif(s[1].startsWith(\"{\")) {\r\n\t\t\tString newLine = line.substring(line.indexOf(\"{\")+1); //gets the line after the currly bracket\r\n\t\t\tif(f.contains(\"?\"))\r\n\t\t\t\tf = f.replace(\"?\", \":\");\r\n\t\t\tread(br, f, newLine.replace(\"\\\\}\", \"}\"), pos+1, gameFile); //replases the exscaped end currly bracket with a nonecaped one\r\n\t\t} else { //else add the line to the gamefile\r\n\t\t\t//if the line contains commas, run through whats between the commas as sepret entrys\r\n\t\t\tif(line.contains(\",\")) {\r\n\t\t\t\tString[] split = line.split(\",\");\r\n\t\t\t\tfor(String l: split) {\r\n\t\t\t\t\treadLine(br, field, l, pos, gameFile);\r\n\t\t\t\t}\r\n\t\t\t} else { //else add the line with out currly brackets\r\n\t\t\t\tgameFile.add(f, s[1].replace(\"}\", \"\"), pos);\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\treturn;\r\n\t\t\r\n\t}", "public void setLine (int Line);", "void endLine() {\n\t\tif (loaded != null && loaded.length() > 0) {\n\t\t\tlineContainer.set(loaded.toString());\n\t\t}\n\t\tloaded = new StringBuilder();\n\t}", "public void setline(String line) {\n\t\t_line = line;\n\t}", "String getLine (int line);", "public String getSourceLine (int line);", "public void setLine1(java.lang.String line1) {\r\n this.line1 = line1;\r\n }", "String snippet(int line);", "public String getline() {\n\t\treturn _line;\n\t}", "private String getNextLine(Scanner input)\n\t{\n\t\tString line = input.nextLine().trim();\n\t\twhile ((line.length() == 0 || line.startsWith(\"#\") || line.startsWith(\"!\")) && input.hasNext())\n\t\t\tline = input.nextLine().trim();\n\t\tif (line.startsWith(\"#\") || line.startsWith(\"!\"))\n\t\t\tline = \"\";\n\t\treturn line;\n\t}", "static boolean Line(PsiBuilder b, int l) {\n if (!recursion_guard_(b, l, \"Line\")) return false;\n boolean r;\n Marker m = enter_section_(b);\n r = Word(b, l + 1);\n r = r && Line_1(b, l + 1);\n exit_section_(b, m, null, r);\n return r;\n }", "@Override\r\n\tprotected String processLine(String line) {\n\t\treturn null;\r\n\t}", "public Address line1(String line1) {\n this.line1 = line1;\n return this;\n }", "public int line() {\r\n return line;\r\n }", "public java.lang.String getLine1() {\r\n return line1;\r\n }", "public void setLine(int line);", "private void newline() {}", "public void flushCurrentLine()\n {\n line = null;\n }", "private void processAssignment(String line) {\n\t\t//TODO: fill\n\t}", "void resetLine() {\n eof = (cursor == lineMark);\n cursor = lineMark;\n }", "private void passOne() {\r\n\t\t// clearDoc(docListing);\r\n\r\n\t\tint lineNumber;\r\n\t\tString sourceLine;\r\n\t\t// LineParser lineParser = new LineParser();\r\n\t\tSourceLineAnalyzer lineAnalyzer = new SourceLineAnalyzer();\r\n\t\tSourceLineParts sourceLineParts;\r\n\t\tScanner scannerPassOne = new Scanner(tpSource.getText());\r\n\t\twhile (scannerPassOne.hasNextLine()) {\r\n\t\t\tsourceLine = scannerPassOne.nextLine();\r\n\t\t\tif (sourceLine.equals(EMPTY_STRING)) {\r\n\t\t\t\tcontinue;\r\n\t\t\t} // if skip textbox's empty lines\r\n\r\n\t\t\tsourceLineParts = lineAnalyzer.analyze(sourceLine);\r\n\r\n\t\t\tif (!sourceLineParts.isLineActive()) {\r\n\t\t\t\tcontinue;\r\n\t\t\t} // if skip textbox's empty lines\r\n\r\n\t\t\tlineNumber = sourceLineParts.getLineNumber();\r\n\t\t\tallLineParts.add(sourceLineParts);\r\n\r\n\t\t\tif (sourceLineParts.hasLabel()) {\r\n\t\t\t\tprocessLabel(sourceLineParts, lineNumber);\r\n\t\t\t} // if - has label\r\n\r\n\t\t\tif (sourceLineParts.hasInstruction()) {\r\n\t\t\t\tinstructionCounter.incrementCurrentLocation(sourceLineParts.getOpCodeSize());\r\n\t\t\t} // if instruction\r\n\r\n\t\t\tif (sourceLineParts.hasDirective()) {\r\n\t\t\t\tprocessDirectiveForLineCounter(sourceLineParts, lineNumber);\r\n\t\t\t} // if directives\r\n\r\n\t\t\tif (sourceLineParts.hasName()) {\r\n\t\t\t\tprocessSymbol(sourceLineParts, lineNumber);\r\n\t\t\t} // if has symbol\r\n\r\n\t\t\t// displayStuff(lineParser);\r\n\t\t} // while\r\n\t\tSymbolTable.passOneDone();\r\n\t\tscannerPassOne.close();\r\n\t}", "public void tokenizeLines()\n {\n tokenizeLines(0, getDefaultRootElement().getElementCount());\n }", "public void computeLine ()\r\n {\r\n line = new BasicLine();\r\n\r\n for (GlyphSection section : glyph.getMembers()) {\r\n StickSection ss = (StickSection) section;\r\n line.includeLine(ss.getLine());\r\n }\r\n\r\n if (logger.isFineEnabled()) {\r\n logger.fine(\r\n line + \" pointNb=\" + line.getNumberOfPoints() +\r\n \" meanDistance=\" + (float) line.getMeanDistance());\r\n }\r\n }", "public String getLine() {\r\n\t\treturn currentString;\r\n\t}", "private void resolveInlined(ArrayList<String> order_content) {\n for (int i = 0; i < order_content.size(); i++) {\n String line = order_content.get(i);\n if (ColesReceiptItem.Contain_Price(line)) {\n if (!ColesReceiptItem.Is_Per_Unit_Price_Line(line) && (!ColesReceiptItem.Is_Price(line))) {\n String[] items = line.split(\" \");\n order_content.remove(i);\n for (int j = 0; j < items.length; j++)\n order_content.add(i + j, items[j]);\n }\n }\n }\n }", "public String getLine();", "private int getNextLine() {\n return peekToken().location.start.line;\n }", "private synchronized void updateLineCount(long lineCount) {\r\n\t\tthis.parsedLines += lineCount;\r\n\t}", "private String getLineAt(int linenum) {\n\t\ttry {\n\t\t\tint start = mainTextArea.getLineStartOffset(linenum);\n\t\t\tint end = mainTextArea.getLineEndOffset(linenum);\n\t\t\treturn mainTextArea.getText(start, end - start);\n\t\t} catch (BadLocationException e) {\n\t\t\treturn (\"\");\n\t\t}\n\t}", "public void drawMultiLine(SpriteBatch batch, String text, float x, float y, float alignWidth, HAlignment alignment);", "public T caseLine(Line object) {\n\t\treturn null;\n\t}", "private void readLine() throws IOException {\n line = reader.readLine(); // null at the end of the source\n currentPos = -1;\n\n if (line != null) {\n lineNum++;\n }\n\n if (line != null) {\n sendMessage(new Message(MessageType.SOURCE_LINE, new Object[]{lineNum, line}));\n }\n }", "public void setLine(String line) {\n this.line = line;\n //System.out.println(this.line + \" \" + line);\n }", "public CharSequence getLineContents(int line) {\n getLock().getReadLock();\n try {\n return lines.getLineContents(line);\n } finally {\n getLock().relinquishReadLock();\n }\n }", "public final void nextRow() {\n this.line++;\n }", "protected void readAhead() {\n if (! reader.hasNext()) {\n this.nextLine = null;\n } else {\n this.nextLine = reader.next();\n while (this.nextLine != null && this.nextLine.isEmpty() && reader.hasNext())\n this.nextLine = reader.next();\n }\n }", "public VCFLine getNextLine () throws IOException {\n\t\tgoNextLine();\n\t\treturn reader.getCurrentLine();\n\t}", "private void lineJumpHelper(int curX) {\n int accX = 0;\n while (true) {\n if (textBuffer.isEnd()) {\n textBuffer.decreCurrent(false);\n return;\n }\n if (textBuffer.currentPos_current().getText().equals(\"\\n\")) {\n textBuffer.decreCurrent(false);\n return;\n }\n Text text = textBuffer.currentPos_current();\n accX += round(text.getLayoutBounds().getWidth());\n if (accX > curX) {\n textBuffer.decreCurrent(false);\n return;\n }\n textBuffer.increCurrent(false);\n }\n }", "@Override\n\tprotected String processLine(String line) {\n\t\treturn null;\n\t}", "public Line getLine ()\r\n {\r\n if (line == null) {\r\n computeLine();\r\n }\r\n\r\n return line;\r\n }", "public void work() {\n\t\tfor(int i = 0; i < lines.size(); i++) {\n\t\t\tlines.get(i).work();\n\t\t}\n\t}", "public static void setLinesFromConcatString(String str, int index){\n String[] stringArr = str.split(\"\\n\");\n for (String singleString : stringArr){\n String[] dividedString = divideText(singleString);\n setMenuLines(dividedString[0], index++);\n while (!dividedString[1].equals(\"\")){\n dividedString = divideText(dividedString[1]);\n setMenuLines(dividedString[0], index++);\n }\n }\n }", "int nextLine(int allocate) throws IOException {\n final int length = lineLoader.nextLine(allocate);\n if(length>=0)\n lineNumber++;\n return length;\n }", "public int getLine() { return cl; }", "public String getLine() {\r\n\t\treturn content;\r\n\t}", "public void cosoleText(String line)\n\t{\n\t\tconsole.setText(line);\n\t}", "boolean handle(String line);", "public void next() {\n if (highlight.getMatchCount() > 0) {\n Point point = highlight.getNextMatch(cursor.getY(), cursor.getX());\n if (point != null) {\n cursor.moveTo(point);\n }\n return;\n }\n Point point = file.getNextModifiedPoint(cursor.getY(), cursor.getX());\n if (point != null) {\n cursor.moveTo(point);\n }\n }", "public void goNextLine () throws IOException {\n\t\treader.goNextLine();\n\t\tcurrentLine = reader.getCurrentLine();\n\t}", "public String getLine() {\n return this.line;\n }", "private void lineColor() {\n\n\t}", "void putLine(String line);", "public void setTextline(boolean textline) {\n this.textline = textline;\n }", "private void cmdMultiLine() {\n fMultiLineMode = true;\n }", "public void endLine() {\n if (currentLine != null) {\n lines.add(currentLine);\n currentLine = null;\n }\n }", "private int advanceBlock(ArrayList<byte[]> lines){\n\t\tfor(num++; num<lines.size(); num++){\n\t\t\tbyte[] line=lines.get(num);\n\t\t\tif(line!=null && line.length>0 && line[0]!=' '){break;}\n\t\t}\n\t\treturn num;\n\t}", "@Override\n\tpublic String readLine() throws IOException {\n\t\tString line = super.readLine();\n\t\n\t\tif(line==null){\n\t\t\treturn null;\n\t\t}\t\n\t\tline = count+\" \"+line;\n\t\tcount++;\n\t\treturn line;\n\t}", "private String getNextLine () {\n String line;\n if (endOfText()) {\n line = \"\";\n } else {\n int lineEndLength = 1;\n char c = ' ';\n char d = ' ';\n char x = ' ';\n lineEnd = index;\n boolean endOfLine = false;\n while (! endOfLine) {\n if (lineEnd >= blockIn.length()) {\n endOfLine = true;\n } else {\n c = blockIn.charAt (lineEnd);\n if (c == GlobalConstants.CARRIAGE_RETURN) {\n x = GlobalConstants.LINE_FEED;\n endOfLine = true;\n }\n else\n if (c == GlobalConstants.LINE_FEED) {\n x = GlobalConstants.CARRIAGE_RETURN;\n endOfLine = true;\n }\n if (endOfLine) {\n if ((lineEnd + 1) < blockIn.length()) {\n d = blockIn.charAt (lineEnd + 1);\n if (d == x) {\n lineEndLength = 2;\n }\n }\n } else { \n // not end of line\n lineEnd++;\n }\n } // end if another char to look at\n } // end while not end of line\n lineStart = index;\n if (lineEnd < lineStart) {\n lineEnd = blockIn.length();\n }\n if (lineEnd >= lineStart) {\n index = lineEnd + lineEndLength;\n line = blockIn.substring (lineStart, lineEnd);\n if (line.equals (getBlockEnd())) {\n blockEnded = true;\n }\n } else {\n line = \"\";\n } // end if no line to return\n } // end if more of block left\n checkNextField();\n return line;\n }", "public static void readFromLongFile(){\n String line;\n\n try {\n BufferedReader br = new BufferedReader(new FileReader(new File(\"longFile.txt\")));\n while ((line = readLine(br)) != null) {\n //nothing is done here\n }\n } catch (IOException e) {\n e.printStackTrace();\n }\n }", "private String readNextLine() {\n StringBuilder sb = new StringBuilder();\n\n try {\n BufferedReader br = new BufferedReader(new InputStreamReader(stream));\n sb.append(br.readLine());\n } catch (IOException e) {\n e.fillInStackTrace();\n }\n\n return sb.toString();\n }", "protected abstract DataTypes[] processLine(MutableCharArrayString line);", "private static String readNextLine(BufferedReader reader) {\n\t\t\n\t\ttry {\n\t\t\tString line = reader.readLine();\n\t\t\treturn line;\n\t\t} catch(IOException e) {\n\t\t\tGdx.app.error(TAG, \"Failed to read the file\", e);\n\t\t\ttry {\n\t\t\t\treader.close();\n\t\t\t} catch(IOException ex) {\n\t\t\t\tGdx.app.error(TAG, \"Failed to close file\");\n\t\t\t\tGdx.app.exit();\n\t\t\t}\n\t\t\tGdx.app.exit();\n\t\t\treturn null;\n\t\t}\n\t}", "public void fluctuateLine() {\n fluctuateLine(this.randomGenerator);\n }", "private void update(String word, int lineNumber)\n {\n //checks to see if its the first word of concordance or not\n if(this.concordance.size()>0)\n {\n //if it is not the first word it loops through the concordance\n for(int i = 0; i < this.concordance.size();i++)\n {\n int check = 0;\n //if word is in concordance it updates the WordRecord for that word\n if(word.equalsIgnoreCase(concordance.get(i).getWord()))\n {\n concordance.get(i).update(lineNumber);\n check++;\n }\n \n //if the word is not found it adds it to the concordance and breaks out of the loop\n if(check == 0 && i == concordance.size() - 1)\n {\n WordRecord temp = new WordRecord(word,lineNumber);\n this.concordance.add(temp);\n break;\n }\n \n }\n }\n \n else\n //if it is the first word of the concordance it adds it to the concordance\n {\n WordRecord temp = new WordRecord(word,lineNumber);\n this.concordance.add(temp);\n }\n }", "protected TextLine genText (String str, Text text, TextLine line, Context context) {\n\t\tTextLine tLine = line;\n\t\tString[] parts = str.split(\"\\\\n\");\n\t\tbyte charset = TextParams.ROMAN;\n\t\tbyte size = TextParams.ILIAD_SCHOLIA_FONT_SIZE;\n\n\t\tString part = parts[0];\n\t\tpart = part.replaceAll(\"\\\\s+\", \" \");\n\t\tTextRun run = new TextRun(part, charset, size);\n\t\tif (context.bold) run.setBold();\n\t\tif (context.italic) run.setItalic();\n\t\ttLine.appendRun(run);\n\n\t\tif(parts.length > 1) {\n\t\t\ttext.copyLine(tLine);\n\t\t\tfor(int i =1;i<parts.length;i++) {\n\t\t\t\tpart = parts[i];\n\t\t\t\tpart = part.replaceAll(\"\\\\s+\", \" \");\n\t\t\t\ttLine = new TextLine();\n\t\t\t\trun = new TextRun(part, charset, size);\n\t\t\t\tif (context.bold) run.setBold();\n\t\t\t\tif (context.italic) run.setItalic();\n\t\t\t\ttLine.appendRun(run);\n\t\t\t\tif(i<parts.length -1) {\n\t\t\t\t\ttext.copyLine(tLine);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn tLine;\n\t}" ]
[ "0.6375205", "0.6289187", "0.6014896", "0.60019493", "0.59689355", "0.5949497", "0.59227395", "0.5855108", "0.58271587", "0.58232486", "0.57955515", "0.57854056", "0.5673876", "0.5671955", "0.56669575", "0.56617135", "0.5636763", "0.5636292", "0.561826", "0.56154805", "0.55896294", "0.557029", "0.55501705", "0.5546914", "0.55298996", "0.5520813", "0.55076575", "0.54959416", "0.5484616", "0.54789305", "0.5448387", "0.54427975", "0.54376096", "0.5420403", "0.54050404", "0.5397944", "0.53754467", "0.53724", "0.5362701", "0.5353787", "0.5350815", "0.5349435", "0.53461057", "0.5345325", "0.5342064", "0.533592", "0.53304625", "0.5325923", "0.5324462", "0.53166056", "0.5314259", "0.5311151", "0.5309075", "0.5307549", "0.53046936", "0.5297319", "0.5288611", "0.52875835", "0.5270068", "0.52611613", "0.5256528", "0.52554846", "0.5254933", "0.5249655", "0.524747", "0.52235764", "0.52235365", "0.5219378", "0.5217253", "0.52162737", "0.52126443", "0.5212042", "0.521062", "0.5210531", "0.519466", "0.5190094", "0.5174134", "0.5173919", "0.5161782", "0.5160071", "0.51592726", "0.5155636", "0.5154899", "0.515194", "0.5151572", "0.5145497", "0.5144142", "0.5144135", "0.5139024", "0.51319414", "0.5129055", "0.5122165", "0.5117271", "0.511682", "0.51099104", "0.51080644", "0.51024973", "0.5101895", "0.5097276", "0.50836253", "0.50783587" ]
0.0
-1
basic constructor for Dealer object
public Dealer(String[] flop, String turn, String river) { setFlop(flop); setTurn(turn); setRiver(river); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public Dealer()\n {\n super(\"Dealer\");\n }", "public Dealer()\n {\n\n\n }", "public Dealer() {\n this(1);\n }", "public Dealer() {\n dealerHand = new Deck();\n }", "private DingnedDealManager() {}", "public Dealer(Bloc playerBloc)\n {\n super(\"Dealer Game\", playerBloc,MobileType.Lambda, Actions.Dialog, NameDialog.Seller);\n try\n {\n createList(getMyList());\n }\n catch (Exception e)\n {\n Gdx.app.error(\"Error in the instantiation : \",String.valueOf(e));\n }\n }", "public Merchant() {\n\n\t}", "public Merchant() {}", "public ExchangeDesk(){\n }", "public Purp() {\n }", "public Dealer() {\r\n\t\tthis.vehicleDatabase.put(BICYCLE, new ArrayList<>());\r\n\t\tthis.vehicleDatabase.put(TRICYCLE, new ArrayList<>());\r\n\t\tthis.vehicleDatabase.put(MOTORCYCLE, new ArrayList<>());\r\n\t\tthis.vehicleDatabase.put(CAR, new ArrayList<>());\r\n\t}", "public BrokerAlgo() {}", "protected Betaling()\r\n\t{\r\n\t\t\r\n\t}", "public LaundryCard() {\n\t}", "public VoucherPayment() {\r\n }", "public Desinscription() {\n\t\tsuper();\n\t\tinitialize();\n\t}", "public PaymentDetails () {\n\t}", "public Receiver() {\n\t\tsuper();\n\t}", "public dc_wallet() {}", "public Seller() {\n super();\n }", "public Lanceur() {\n\t}", "public DebtorsAgingBean() {\n }", "public PaymentCard() {\n\t}", "public Produit() {\n }", "public Deck()\n {\n this(1);\n }", "public Produit() {\n\t\tsuper();\n\t}", "public PackageCarrierDetails() {\n }", "protected Settlement() {\n // empty constructor\n }", "public Communicator() {\n\t}", "public MdrCreater()\n {\n super();\n client = new RawCdrAccess();\n }", "public Investment() {\r\n\t\t\r\n\t}", "public Chauffeur() {\r\n\t}", "protected Doodler() {\n\t}", "public PaymentMethod()\n {\n }", "public HLCPaymentDetails() { }", "public DesastreData() { //\r\n\t}", "private DishContract() {\n }", "public Communicator() {\n }", "public Communicator() {\n }", "public HGDClient() {\n \n \t}", "private Teller() {\n }", "public ExchangeInfo() {\n super();\n }", "public CashPayment()\n {\n super();\n }", "public Ship(){\n\t}", "public Customers(){\r\n \r\n }", "public BuddyInfo() {\n this(\"\", \"\", \"123-456-7890\");\n }", "public Payroll()\r\n\t{\r\n\t\t\r\n\t}", "public FundingDetails() {\n super();\n }", "public Trader(Brokerage broker, String name, String pswd)\r\n {\r\n brokerage = broker;\r\n screenName = name;\r\n password = pswd;\r\n myWindow = null;\r\n mailbox = new LinkedList<String>();\r\n }", "public CreditCard ()\r\n\t{\r\n\t\t\r\n\t}", "public Achterbahn() {\n }", "public Commercial()\n {\n super();\n payload = 0;\n }", "public GatewayInfo() {\n\n\t}", "private Bank() {\r\n\t\tsuper();\r\n\t\tlogService = new Logger(\"driverName\");\r\n\t\tlogger = new Logger(\"driverName\");\r\n\t\tthis.balance = balance;\r\n\t\tthis.clients = new Client[100];\r\n\t}", "public UDPclient()\n\t{\n\t}", "public Cliente() {\n }", "public AirAndPollen() {\n\n\t}", "public Implementor(){}", "public BoletoPaymentRequest() {\n\n }", "public FicheConnaissance() {\r\n }", "public Requisition() {\n\n }", "public DABeneficios() {\n }", "public Deck() {\n this.allocateMasterPack();\n this.init(1);\n }", "public Game() {\t\t\t\t\t\n\t\t\n\t\tmDeck = new Deck();\t\t\t\t\t\t\t\t\t\t\t\n\t\tmDealer = new Dealer(mDeck.getCard(), mDeck.getCard());\t//dealer gets a random value card twice to initialise the dealers hand with 2 cards\n\t\tmUser = new User();\t\t\t\t\t\t\t\t\t\t\t\n\t\tgiveCard();\t\t\t\t\t\n\t}", "public OrderOffered() {\r\n }", "private Instantiation(){}", "public SignaturEater()\r\n {\r\n }", "public LpsClient() {\n super();\n }", "private PumpManager() { }", "public SellerDTO() {\n\t\t\n\t}", "public Destruir() {\r\n }", "public Barrier() {\n }", "public EnchantHandler(){\n loadEnchants();\n }", "public Libro() {\r\n }", "public BaseballCard(){\r\n\r\n\t}", "public MoneyTransfer() {\n }", "public Aanbieder() {\r\n\t\t}", "public Potencial() {\r\n }", "private CardExchangeModel() {\n\t}", "public DetArqueoRunt () {\r\n\r\n }", "private PurchaseDB() {}", "public Bridge() {\n }", "Constructor() {\r\n\t\t \r\n\t }", "public AppliedHoldInfo() {\n }", "public Sc2Gears4DM() {\n\t}", "public Commune() {\n\t\tsuper();\n\t\t// TODO Auto-generated constructor stub\n\t}", "protected MoneyFactory() {\n\t}", "public Client() {\n }", "public Kanban() {\r\n\t}", "public AbstractRetriever() {\n }", "public PurchaseRequestAttachment() {\r\n }", "public Ov_Chipkaart() {\n\t\t\n\t}", "public PromoBonusImpl() {\n }", "public Offer() {\n }", "public Offer() {\n }", "public Telefone() {\n\t}", "public Carrier() {\n }", "@SuppressWarnings(\"unused\")\r\n private Rental() {\r\n }", "private ClientLoader() {\r\n }", "public Crate(){}", "public D() {}" ]
[ "0.864912", "0.8514317", "0.8510492", "0.7981466", "0.7215404", "0.7007", "0.6946557", "0.68979925", "0.68795884", "0.6721847", "0.6666651", "0.6632447", "0.65962416", "0.6534868", "0.65180165", "0.65153915", "0.6512481", "0.6505757", "0.65009475", "0.6495464", "0.6459268", "0.64157236", "0.64055276", "0.6398056", "0.6395998", "0.6384303", "0.63744676", "0.6369468", "0.6335016", "0.62927794", "0.6281577", "0.62551427", "0.62440795", "0.62358284", "0.62326777", "0.62310344", "0.6229463", "0.6227549", "0.6227549", "0.62216735", "0.62143826", "0.62129295", "0.62032235", "0.61731994", "0.6162268", "0.61621857", "0.6159489", "0.6154309", "0.615103", "0.6150402", "0.61502004", "0.6143672", "0.6137788", "0.6130096", "0.6129634", "0.6117706", "0.6114077", "0.6110249", "0.6105653", "0.6094331", "0.60887325", "0.6086406", "0.6085356", "0.6083025", "0.6082518", "0.6081076", "0.60800874", "0.6080009", "0.607232", "0.6063636", "0.6062063", "0.60450673", "0.60422534", "0.6040868", "0.6038634", "0.60360324", "0.60229254", "0.60215056", "0.60096604", "0.60059553", "0.6005195", "0.6005097", "0.59970987", "0.59963125", "0.5994709", "0.5989157", "0.5985245", "0.5984965", "0.5984175", "0.5978825", "0.5976017", "0.5974036", "0.59734267", "0.597211", "0.597211", "0.5970771", "0.59669995", "0.5965503", "0.59617573", "0.59545565", "0.5952591" ]
0.0
-1
basic getters / setters for dealer object
public String[] getFlop() { return this.flop; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void setDealerName(String dealerName);", "public String getDealMan() {\n return dealMan;\n }", "public void setDealerId(String dealerId);", "public DealOffer getDealOffer() {\n return dealOffer;\n }", "public Dealer() {\n dealerHand = new Deck();\n }", "public long getDeal() {\r\n/* 169 */ return this._deal;\r\n/* */ }", "public void setDeal(long deal) {\r\n/* 382 */ this._deal = deal;\r\n/* 383 */ this._has_deal = true;\r\n/* */ }", "private DingnedDealManager() {}", "public String getDealerName() {\n\t\treturn dealerName;\n\t}", "public SellerDTO(Seller entity) {\t\t\n\t\tid = entity.getId();\n\t\tname = entity.getName();\n\t}", "public Dealer()\n {\n super(\"Dealer\");\n }", "@Override\n\tpublic DealVO getDealInfo(int dNo) throws Exception {\n\t\treturn null;\n\t}", "public Dealer() {\r\n\t\tthis.vehicleDatabase.put(BICYCLE, new ArrayList<>());\r\n\t\tthis.vehicleDatabase.put(TRICYCLE, new ArrayList<>());\r\n\t\tthis.vehicleDatabase.put(MOTORCYCLE, new ArrayList<>());\r\n\t\tthis.vehicleDatabase.put(CAR, new ArrayList<>());\r\n\t}", "public String getDealerId() {\n\t\treturn dealerId;\n\t}", "@Test\r\n\tpublic void gettersSettersTest() {\r\n\t\tItem item = new Item();\r\n\t\titem.setCount(NUMBER);\r\n\t\tassertEquals(item.getCount(), NUMBER);\r\n\t\titem.setDescription(\"word\");\r\n\t\tassertEquals(item.getDescription(), \"word\");\r\n\t\titem.setId(NUMBER);\r\n\t\tassertEquals(item.getId(), NUMBER);\r\n\t\titem.setName(\"word\");\r\n\t\tassertEquals(item.getName(), \"word\");\r\n\t\titem.setPicture(\"picture\");\r\n\t\tassertEquals(item.getPicture(), \"picture\");\r\n\t\titem.setPrice(FLOATNUMBER);\r\n\t\tassertEquals(item.getPrice(), FLOATNUMBER, 0);\r\n\t\titem.setType(\"word\");\r\n\t\tassertEquals(item.getType(), \"word\");\r\n\t\titem.setSellerId(NUMBER);\r\n\t\tassertEquals(item.getSellerId(), NUMBER);\r\n\t\titem.setDeleted(false);\r\n\t\tassertEquals(item.isDeleted(), false);\r\n\t\titem.setDeleted(true);\r\n\t\tassertEquals(item.isDeleted(), true);\t\t\r\n\t}", "public Dealer()\n {\n\n\n }", "@Override\r\n\tpublic String detailDeal() {\n\t\treturn null;\r\n\t}", "public Integer getDealUid() {\r\n return dealUid;\r\n }", "public long getDealerId() {\n\t\treturn dealerId;\n\t}", "@Override\n public java.lang.String getDealerId() {\n return _entityCustomer.getDealerId();\n }", "public String getDealName() {\n\t\treturn this.name;\n\t}", "@Override\n public void setDealerId(java.lang.String dealerId) {\n _entityCustomer.setDealerId(dealerId);\n }", "public String getDealerCode() {\n\t\treturn dealerCode;\n\t}", "public Entity getDamageDealer();", "public String getBuyer() {\n return buyer;\n }", "public String getSeller() {\n return seller;\n }", "public String getSeller() {\n return seller;\n }", "public String getSupEntDeal() {\n return supEntDeal;\n }", "public long getUniversalDeal() {\r\n/* 275 */ return this._universalDeal;\r\n/* */ }", "public String getDealReason() {\r\n return dealReason;\r\n }", "@Override\n public EntityDealer create(String dealerId) {\n EntityDealer entityDealer = new EntityDealerImpl();\n\n entityDealer.setNew(true);\n entityDealer.setPrimaryKey(dealerId);\n\n return entityDealer;\n }", "public Book getBook() \t\t{ return this.myBook; }", "public Dealer(List<Car> owned_cars, HashSet<Integer> leasing_cars, List<Status> leasing_details, String city, String name, Integer budget, int objectId) {\r\n this.owned_cars = owned_cars;\r\n this.leasing_cars = leasing_cars;\r\n this.leasing_details = leasing_details;\r\n this.city = city;\r\n this.name = name;\r\n this.budget = budget;\r\n //this.objectId = objectId;\r\n }", "public void setBuyer(String buyer) {\n this.buyer = buyer;\n }", "private Payer getPayerInformation() {\n\n\t\tPayer payer = new Payer();\n\t\tpayer.setPaymentMethod(\"paypal\");\n\n\t\tPayerInfo payerInfo = new PayerInfo();\n\n\t\tpayerInfo.setFirstName(\"Nguyen\").setLastName(\"Bang\").setEmail(\"[email protected]\");\n\n\t\tpayer.setPayerInfo(payerInfo);\n\t\treturn payer;\n\n\t}", "public int getAmount() { return this.amount; }", "public Bill getBill() {\n return bill;\n }", "public SellerDTO() {\n\t\t\n\t}", "public void setDealerName(String dealerName) {\n\t\tthis.dealerName = dealerName == null ? null : dealerName.trim();\n\t}", "@Override\n\tpublic DataTablesResponseInfo getSupplier() {\n\t\tDataTablesResponseInfo info = new DataTablesResponseInfo();\n\t\tinfo.setData(purchaseDao.getSupplier());\n\t\treturn info;\n\t}", "public Payment getPayment(){\n return payment;\n }", "public double getAmount() { return amount; }", "public Book getBook() {\n return book;\n }", "void update(Seller obj);", "void update(Seller obj);", "public MdrCreater()\n {\n super();\n client = new RawCdrAccess();\n }", "@Override\n public EntityDealer fetchByPrimaryKey(String dealerId)\n throws SystemException {\n return fetchByPrimaryKey((Serializable) dealerId);\n }", "public static void main(String[] args) {\n c09_EmployeeInfo Abdul = new c09_EmployeeInfo();\n\n // how can I read the address of Abdul in this class?\n // I can call getter method to get address through the object Abdul\n System.out.println(Abdul.getAddress()); // null now because first we need to set it calling setter method\n\n Abdul.setAddress(\"Virginia\");\n System.out.println(Abdul.getAddress()); // Virginia\n\n // to get the company name:\n System.out.println(Abdul.companyName);\n\n // to get the salary:\n System.out.println(Abdul.getSalary()); // 0.0 first we need to set it\n\n Abdul.setSalary(120000.0);\n System.out.println(Abdul.getSalary()); // 120000.0\n\n\n\n\n\n\n\n }", "public Seller getSeller() {\n\t\treturn seller;\n\t}", "public Item() {\r\n this.name = \"\";\r\n this.description = \"\";\r\n this.price = 0F;\r\n this.type = \"\";\r\n this.available = 0;\r\n this.wholesaler = new Wholesaler();\r\n this.wholesalerId = 0;\r\n this.category = new Category();\r\n this.categoryId = 0; \r\n }", "public JavaHand getHand() {\r\n return this.dealerHand;\r\n }", "public double getPrice(){return price;}", "public void getBookDetails() {\n\t}", "public Manufacturer getManufacturer() {\n return manufacturer;\n }", "public Person getDoctor(){\n return doctor;\n }", "public int getPrice(){\n return price;\n }", "public void setPrice(double price){this.price=price;}", "public void deal() {\n\n\t}", "public void deal() {\n\n\t}", "public void deal() {\n\n\t}", "public double getPurchasePrice()\n {\n return purchasePrice;\n }", "private CarRental() {\r\n\t\tcompanyCars = new ArrayList<InterfaceAbstractCar>();\r\n\t\trentDetails = new HashMap<DriversLicense, InterfaceAbstractCar>();\r\n\t}", "void setDataIntoSuppBusObj() {\r\n supplierBusObj.setValue(txtSuppId.getText(),txtSuppName.getText(), txtAbbreName.getText(),\r\n txtContactName.getText(),txtContactPhone.getText());\r\n }", "public Ship getShip(){\n return this.ship;\n }", "@Override\r\n\tpublic Dinero getDinero() {\n\t\treturn super.getDinero();\r\n\t}", "public void setDealerId(String dealerId) {\n\t\tthis.dealerId = dealerId == null ? null : dealerId.trim();\n\t}", "public int getPrice()\n {\n return price;\n }", "public Amount getAmount() {\n return amount;\n }", "public int getSeatPrice()\n{\nreturn price;\n}", "protected Director getDirector() {\n\treturn director;\n }", "public Address getAddress() { return address; }", "public String getBuyerName() {\n return buyerName;\n }", "public interface Tradable {\n\n /**\n * Get method returns the product symbol (IBM, GOOG).\n *\n * @return product symbol\n */\n String getProduct();\n\n /**\n * Get method returns the price of the tradable.\n *\n * @return price object\n * @throws Exception\n */\n Price getPrice() throws Exception;\n\n /**\n * Get method returns the original volume (quantity) of the tradable.\n *\n * @return volume of tradable\n */\n int getOriginalVolume();\n\n /**\n * Get method returns the remaining volume of the tradable.\n *\n * @return remaining volume\n */\n int getRemainingVolume();\n\n /**\n * Get method returns the canceled volume of the tradable.\n *\n * @return canceled volume\n */\n int getCancelledVolume();\n\n /**\n * Set method sets the tradable canceled quantity to the value passed in.\n *\n * @param newCancelledVolume\n * @throws Exception\n */\n void setCancelledVolume(int newCancelledVolume) throws Exception;\n\n /**\n * Set method sets the tradable remaining quantity to the value passed in.\n *\n * @param newRemainingVolume\n * @throws Exception\n */\n void setRemainingVolume(int newRemainingVolume) throws Exception;\n\n /**\n * Get method returns the user id associated with the tradable.\n *\n * @return user id\n */\n String getUser();\n\n /**\n * Get method returns the \"side\" (BUY/SELL) of the tradable.\n *\n * @return side of book\n */\n BookSide getSide();\n\n /**\n * Is quote method returns true if the tradable is part of a quote, returns\n * false if not.\n *\n * @return boolean if quote\n */\n boolean isQuote();\n\n /**\n * Get method returns the tradable \"id\" or system id.\n *\n * @return id of tradable\n */\n String getId();\n}", "public Department getDepartment() {\n return department;\n }", "public void setSeller(String seller) {\n this.seller = seller;\n }", "public void setSeller(String seller) {\n this.seller = seller;\n }", "public String getAuthor(){return author;}", "public boolean hasDeal() {\r\n/* 285 */ return this._has_deal;\r\n/* */ }", "@Override\r\n\tpublic void get() {\n\t\t\r\n\t}", "public Customer getCustomer()\n {\n return customer;\n }", "public String getParty()\n {\n return party;\n}", "protected Doodler() {\n\t}", "java.lang.String getSeller();", "public void selectDeal() {\n\t}", "public Author getAuthor() {\r\n return author;\r\n }", "public void setDealUid(Integer dealUid) {\r\n this.dealUid = dealUid;\r\n }", "public Seller() {\n super();\n }", "public Dealer() {\n this(1);\n }", "public Money getCost(){\r\n return this.cost;\r\n }", "public float getHightPrice()\r\n{\r\n\treturn this.hightPrice;\r\n}", "public Customer getCustomer()\n {\n return customer;\n }", "Restaurant getRestaurant();", "public float getPrice() \n {\n return price;\n }", "public Empleado getEmpleado()\r\n/* 183: */ {\r\n/* 184:337 */ return this.empleado;\r\n/* 185: */ }", "private BookService getBookService() {\n return bookService;\n }", "@Override // Métodos que fazem a anulação\n\tpublic void getBonificação() {\n\t\t\n\t}", "public double getAmount()\n {\n return m_Amount;\n }", "public void setDealMan(String dealMan) {\n this.dealMan = dealMan == null ? null : dealMan.trim();\n }", "Offer getOffer();", "public String getDebtor() {\n return debtor;\n }", "@java.lang.Override\n public java.lang.String getSeller() {\n java.lang.Object ref = seller_;\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 seller_ = s;\n return s;\n }\n }" ]
[ "0.66602564", "0.6373635", "0.6361514", "0.62735194", "0.6214485", "0.61356914", "0.5969439", "0.58957356", "0.5715306", "0.5697886", "0.5665788", "0.56603384", "0.56464314", "0.5641233", "0.56091475", "0.5607764", "0.5542153", "0.5529029", "0.5516156", "0.5515362", "0.54772013", "0.5448057", "0.54045504", "0.5382154", "0.5348526", "0.5334823", "0.5334823", "0.53156847", "0.531403", "0.5313409", "0.5296723", "0.52942944", "0.52846414", "0.52604157", "0.5255467", "0.52514637", "0.52403265", "0.5235423", "0.52253044", "0.5223497", "0.5213977", "0.52026576", "0.5199124", "0.5196847", "0.5196847", "0.5183992", "0.51813203", "0.51800483", "0.51792234", "0.517087", "0.5169421", "0.5157722", "0.51511586", "0.5147119", "0.51391524", "0.5136878", "0.51326233", "0.5131566", "0.5131566", "0.5131566", "0.5130855", "0.5126747", "0.5126478", "0.51249164", "0.5124464", "0.5121553", "0.5120592", "0.51168", "0.5115925", "0.51152945", "0.5108805", "0.5098656", "0.50948185", "0.50901", "0.50883675", "0.50883675", "0.5086806", "0.5085816", "0.50832", "0.5082996", "0.50791883", "0.50779194", "0.50621945", "0.50611436", "0.5057459", "0.5055666", "0.50530666", "0.5051254", "0.5036457", "0.50338155", "0.5031961", "0.50307363", "0.50293833", "0.50282735", "0.5026458", "0.50234544", "0.50207657", "0.5019455", "0.50132436", "0.5004687", "0.49990782" ]
0.0
-1
EmployeeBean.address = "This is new company";
public static void main(String[] args) { EmployeeBean employeeBean = new EmployeeBean("Dileep", "Software Engineer"); //System.out.println(employeeBean.ADDRESS); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "Employee setFirstname(String firstname);", "public void setEmployee(String employee)\r\n/* 43: */ {\r\n/* 44:47 */ this.employee = employee;\r\n/* 45: */ }", "Employee setLastname(String lastname);", "public void setEmployeeID(int employeeID) { this.employeeID = employeeID; }", "public String changeContactDetails(final EmployeeAddressDTO employeeAddressDTO) throws ApplicationCustomException;", "public String getAddress()\n{\n return this.address;\n}", "public abstract void setCustomerAddress(Address address);", "public void setEmployeeAddress(String employeeAddress) {\r\n\r\n\t\tthis.employeeAddress = employeeAddress;\r\n\t}", "public void setExistingCustomer(Customer existingCustomer) { this.existingCustomer = existingCustomer; }", "@Override\n\tpublic void updateEmployee() {\n\n\t}", "public void updateEmployee(Employe employee) {\n\t\t\n\t}", "public void updateEmployeeDetails(EmployeeDetails employeeDetails);", "public void setAddress(java.lang.String newAddress) {\n\taddress = newAddress;\n}", "public void setAddress(java.lang.String newAddress) {\n\taddress = newAddress;\n}", "public void setAddress(String address) {\n this.address = address;\n }", "@Bean(name = \"bean\") //name=\" \" to change the bean name\n public Address addressBean() {\n \treturn new Address();\n }", "@Override\n\tpublic void ModifyEmployee() {\n\t\t\n\t}", "Employee(String name, String password, String username, String email) {\n this.name = name;\n this.username = username;\n this.email = email;\n this.password = password;\n\n }", "public EmployeBean() {\r\n\t\tpersonneFactory = new PersonneFactoryImpl();\r\n\t\tinitFields();\r\n\t\tidHotel = 0L;\r\n\t\tLOGGER.info(\"<=============== EmployeBean Initialization ===============>\");\r\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 }", "public EmployeeDTO updateEmployee(final EmployeeDTO createEmployeeDTO) throws ApplicationCustomException;", "public addressBean() {\n }", "public void setAddress(String address) { this.address = address; }", "public void saveEmployee(Employe employee) {\n\t\t\n\t}", "@PostMapping(value = \"/addEmployee\")\n\tpublic void addEmployee() {\n\t\tEmployee e = new Employee(\"Iftekhar Khan\");\n\t\tdataServiceImpl.add(e);\n\t}", "public void setAddress(String address);", "public void setAddress(String address);", "public void setAddress(String address);", "public void setAddress(String address);", "public void setAddressCity(String addressCity) {\n this.addressCity = addressCity;\n }", "Employee setBirthdate(Date birthdate);", "public static void main(String[] args) {\n c09_EmployeeInfo Abdul = new c09_EmployeeInfo();\n\n // how can I read the address of Abdul in this class?\n // I can call getter method to get address through the object Abdul\n System.out.println(Abdul.getAddress()); // null now because first we need to set it calling setter method\n\n Abdul.setAddress(\"Virginia\");\n System.out.println(Abdul.getAddress()); // Virginia\n\n // to get the company name:\n System.out.println(Abdul.companyName);\n\n // to get the salary:\n System.out.println(Abdul.getSalary()); // 0.0 first we need to set it\n\n Abdul.setSalary(120000.0);\n System.out.println(Abdul.getSalary()); // 120000.0\n\n\n\n\n\n\n\n }", "Restaurant setRestaurantAddress(Address address);", "public void setFirstName(java.lang.String newFirstName);", "public void setFirstName(String fname){ firstName.set(fname); }", "public PersonaBean() {\n domicilio = new Domicilio();\n telefono = new Telefono();\n correoElectronico = new CorreoElectronico();\n persona = new Persona();\n this.tipoOperacion = \"Alta\";\n\n }", "public void setCompany(Company aCompany) {\n company = aCompany;\n }", "@Test\r\n public void testSetUserOccupation()\r\n {\r\n System.out.println(\"setUserOccupation\");\r\n String userOccupation = \"Nurse\";\r\n String occupation = \"Doctor\";\r\n String[] hobbies = {\"Reading\", \"Cooking\"};\r\n int id = 5;\r\n LifeStyleBean instance = new LifeStyleBean(occupation, hobbies, id);\r\n instance.setUserOccupation(userOccupation);\r\n assertEquals(userOccupation, instance.getUserOccupation());\r\n }", "public void setFirstName(String newFirstName)\r\n {\r\n firstName = newFirstName;\r\n }", "public Address getAddress() { return address; }", "public String getAddress(){\n return address;\n\n }", "public void updateEmp(Emp emp) {\n\t\t\n\t}", "public void addEmployee(Employee emp) {\n\t\t\r\n\t}", "@Bean({\"colBean\" , \"collegeBean\" } )\n\tpublic College collegeBean()//method namecollegeBean is the bean id by default\n\t{\n\t\tCollege college=new College();\n\t\tcollege.setTeacher(teacher()); //setter injection\n\t\treturn college;\n\t}", "public Employee getEmployee() {\n return employee;\n }", "public Employee(){\n this.employeeName = new String();\n this.employeeSalary = null;\n this.employeeProjectList = new ArrayList<String>();\n this.employeeDepartmentLead = new String();\n }", "public void setFirstName(String firstName);", "public void setUWCompany(entity.UWCompany value);", "public String getAddress(){\n return address;\n }", "public String getAddress(){\n return address;\n }", "public String getAddress(){\n return address;\n }", "public void setEmployeeCode(String value) {\n this.employeeCode = value;\n }", "public String getAddress(){\r\n return address;\r\n }", "public void sauverEmploye(Employe employe) {\n\n\t}", "public void setEmployeeId(long employeeId);", "public void setContact(String email){ contact = email; }", "public String getEmployeeAddress() {\r\n\r\n\t\treturn employeeAddress;\r\n\t}", "public void setContactPerson(String contactPerson) {\n this.contactPerson = contactPerson;\n }", "public void setAddress2(String address2);", "public String getAddress() {return address;}", "public void setEmpresa(Empresa empresa)\r\n/* 89: */ {\r\n/* 90:141 */ this.empresa = empresa;\r\n/* 91: */ }", "public final void setBean(String bean) {\n this.bean = bean;\n }", "public void saveEmployee(Employee emp){\n System.out.println(\"saved\" + emp);\n\n }", "@Override\n\tpublic EmployeeBean updateEmployeeDetails(EmployeeBean employeeBean) throws Exception {\n\t\treturn employeeDao.updateEmployeeDetails(employeeBean);\n\t}", "public PeopleBean() {\n\n }", "@Override\n\tpublic Integer addEmployee(EmployeeBean employeeBean) throws Exception {\n\t\treturn employeeDao.addEmployee(employeeBean);\n\t}", "public void setCreateEmp(String createEmp) {\n this.createEmp = createEmp;\n }", "public void saveEmployee(CreateOrEditEmployeeRequestDto employee);", "public void setAddress(String newAddress) {\r\n\t\tthis.address = newAddress;\r\n\t}", "public void setCompany(String company)\r\n {\r\n m_company = company;\r\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}", "void setFirstName(String firstName);", "public Employee() {\n this.isActivated = false;\n this.salt = CryptographicHelper.getInstance().generateRandomString(32);\n\n this.address = new Address();\n this.reports = new ArrayList<>();\n }", "public Customer()\n{\n this.firstName = \"noFName\";\n this.lastName = \"noLName\";\n this.address = \"noAddress\";\n this.phoneNumber = 0;\n this.emailAddress = \"noEmail\";\n \n}", "public Address updateAddress(Address newAddress);", "public void setAddress(String _address){\n address = _address;\n }", "public void update(Employee e) {\n\t\t\r\n\t}", "public Large_Employee(\n String txtMobile,\n String txtEmail,\n String emailPassword,\n String corpPhoneType,\n String corpPhoneNumber,\n int employeeID){\n this.txtMobile = txtMobile;\n this.txtEmail = txtEmail;\n this.emailPassword = emailPassword;\n this.corpPhoneType = corpPhoneType;\n this.corpPhoneNumber = corpPhoneNumber;\n this.employeeID = employeeID;\n }", "public String getEmployeeName();", "public void setEmail_address(String email_address);", "public void setFirstName(String newFirstName) {\n _firstName = newFirstName;\n }", "public int getEmployeeID() { return employeeID; }", "@Override\n\tpublic void updateEmployee(Employee e) {\n\t\t\n\t}", "public boolean addCustomer(CustomerBean customer);", "public String getEmployee()\r\n/* 38: */ {\r\n/* 39:43 */ return this.employee;\r\n/* 40: */ }", "public Employee(String Name) {\r\n this.Name = Name;\r\n }", "public void setAddress(final String address){\n this.address=address;\n }", "public void setCity(String city);", "public EmployeeDTO createEmployee(final EmployeeDTO createEmployeeDTO) throws ApplicationCustomException;", "@Test\n\tvoid testSetAddress() {\n\t\tassertNull(this.customer.getAddress());\n\t\t\n\t\t//sets address for customer\n\t\tthis.customer.setAddress(\"Brooklyn, NY\");\n\t\t\n\t\t//checks that address was set correctly\n\t\tassertEquals(\"Brooklyn, NY\", this.customer.getAddress());\n\t\t\n\t\t//reset address for customer\n\t\tthis.customer.setAddress(\"Cranston, RI\");\n\t\t\n\t\t//checks that address was reset correctly\n\t\tassertEquals(\"Cranston, RI\", this.customer.getAddress());\n\t}", "public static void doStuff(){\n\t\tDatastoreService datastore = DatastoreServiceFactory.getDatastoreService();\n\n\t\t//As we omitted the argument, this will just create a new numeric ID\n\t\tEntity employee = new Entity(\"Employee\");\n\n\t\temployee.setProperty(\"firstName\", \"Patrick\");\n\t\temployee.setProperty(\"lastName\", \"MacDowell\");\n\n\t\tDate hireDate = new Date();\n\t\temployee.setProperty(\"hireDate\", hireDate);\n\n\t\temployee.setProperty(\"attendedHrTraining\", true);\n\n\t\tdatastore.put(employee);\n\t}", "public void setCompany(String company) {\n this.company = company;\n }", "@Override\n\tpublic void update(Employee employee) {\n\t}", "public interface Address {\r\n\tCollection<String> getNewAddresses();\r\n\t/**\r\n\t * The street of this address.\r\n\t */\r\n\tString getStreet();\r\n\t/**\r\n\t * The street of this address.\r\n\t */\r\n\tvoid setStreet(String street);\r\n\tPerson getPerson();\r\n\tvoid setPerson(Person person);\r\n\tAddressType getAddressType();\r\n\tvoid setAddressType(AddressType addressType);\r\n\tboolean isOld();\r\n\tvoid setOld(boolean old);\r\n}", "public String addAddress(Person bean, String addressBook)\n\t{\n\t\treturn controller.addNewAddress(bean, addressBook);\n\t}", "void save(Employee employee);", "public void setAddress(String address)\n {\n this.address = address;\n }", "public Employee(String firstName, String lastName, Date birthDate, \n Date hireDate, Address Address) {\n this.firstName = firstName;\n this.lastName = lastName;\n this.birthDate = birthDate;\n this.hireDate = hireDate;\n this.Address = Address;\n }", "public void setFirstName(String newFirstName) {\n this.firstName = newFirstName;\n }", "public void setCompanyname(java.lang.String newCompanyname) {\n\tcompanyname = newCompanyname;\n}" ]
[ "0.6541235", "0.64740705", "0.6305702", "0.6101772", "0.6069977", "0.60657865", "0.60355693", "0.5999078", "0.59415907", "0.59285945", "0.5878852", "0.58775663", "0.58737034", "0.58737034", "0.58523834", "0.58508974", "0.58492047", "0.5838598", "0.5796588", "0.57903093", "0.5789496", "0.5773558", "0.5762239", "0.5753409", "0.57311124", "0.5729", "0.5729", "0.5729", "0.5729", "0.5723048", "0.57111865", "0.5710445", "0.57082033", "0.56995195", "0.56889516", "0.56799734", "0.56670177", "0.5658731", "0.56527483", "0.5648578", "0.5646264", "0.56321645", "0.56287265", "0.56243587", "0.56217116", "0.56151927", "0.56133723", "0.56106114", "0.56064767", "0.56064767", "0.56064767", "0.5606329", "0.5604858", "0.5576395", "0.55579436", "0.5552952", "0.55499333", "0.5522617", "0.55209655", "0.5520729", "0.5507338", "0.55069244", "0.55052376", "0.54963684", "0.54917055", "0.5488138", "0.54857016", "0.54839826", "0.54792035", "0.54727507", "0.5462562", "0.5461656", "0.54607356", "0.54461735", "0.5445883", "0.5445874", "0.54427916", "0.5439203", "0.5435953", "0.5435112", "0.5428947", "0.5428237", "0.5425803", "0.54254377", "0.5423269", "0.54221755", "0.54036117", "0.540262", "0.53646415", "0.5361943", "0.53610504", "0.5359859", "0.53595024", "0.5353062", "0.535165", "0.5348622", "0.5345841", "0.5339846", "0.53393793", "0.5338387" ]
0.5742539
24
Connection mongo and DB
public static void main(String[] args) { MongoClient mongoClient = new MongoClient("localhost", 27017); ArrayList<DatabaseObj> databaseObjarray = new ArrayList<DatabaseObj>(); ListDatabasesIterable<Document> databaseDocList = mongoClient.listDatabases(); for (Document databaseDocument : databaseDocList){ String databaseName = databaseDocument.get("name").toString(); ArrayList<String> collectionNameList = new ArrayList<String>(); MongoDatabase database = mongoClient.getDatabase(databaseName); ListCollectionsIterable<Document> list = database.listCollections(); for (Document d : list){ String name = d.get("name").toString(); collectionNameList.add(name); } databaseObjarray.add(new DatabaseObj(databaseName, collectionNameList)); } //JOptionPane.showMessageDialog(null,"Eggs are not supposed to be green.","Inane error",JOptionPane.ERROR_MESSAGE); MainUserInterface mui = new MainUserInterface(databaseObjarray); mui.go(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static void init()\n\t{\n\t\tMongoClient mongoClient = new MongoClient(new MongoClientURI(\"mongodb://111.111.111.111:27017\"));\n\t\tdatabase=mongoClient.getDatabase(\"mydb\");\n\t}", "private void connect() throws UnknownHostException {\n mongoClient = new MongoClient(configurationFile.getHost(),configurationFile.getPort());\r\n db = mongoClient.getDB(configurationFile.getDatabaseName());\r\n }", "@Override\r\n\tpublic void start() {\n\t\t\r\n\t\tServerAddress serverurl=new ServerAddress(host, port);\r\n\t\tList<ServerAddress> listServer=new ArrayList<ServerAddress>();\r\n\t\tlistServer.add(serverurl);\r\n\t\tMongoCredential credential=MongoCredential.createCredential(user, database, password.toCharArray());\r\n\t\tList<MongoCredential> listCre=new ArrayList<MongoCredential>();\r\n\t\tlistCre.add(credential);\r\n\t\tmongoClient = new MongoClient(listServer, listCre);\r\n\t\tmongoDB = mongoClient.getDatabase(database);\r\n\t\tmongoCollection = mongoDB.getCollection(collection);\r\n\r\n\t}", "private static MongoClient getConnection() {\n if (instance == null) {\n instance = MongoClients.create();\n }\n return instance;\n }", "public static void main(String[] args) {\n\t\tMongoClient c;\r\n\t\t//\tc = new MongoClient(new MongoURI(\" mongodb://<dbuser>:<dbpassword>@ds023105.mlab.com\"),23105);\r\n\t\t\t/*List<ServerAddress> seeds = new ArrayList<ServerAddress>();\r\n\t\t\tseeds.add( new ServerAddress( \"localhost\" ));\r\n\t\t\tList<MongoCredential> credentials = new ArrayList<MongoCredential>();\r\n\t\t\tcredentials.add(\r\n\t\t\t MongoCredential.createMongoCRCredential(\r\n\t\t\t \"app_user\",\r\n\t\t\t \"data\",\r\n\t\t\t \"bestPo55word3v3r\".toCharArray()\r\n\t\t\t )\r\n\t\t\t);*/\r\n\t\t\tMongoClient mongo = new MongoClient( new MongoClientURI(\"mongodb://sarath:[email protected]:23105/samplemongo\") );\r\n\t\t//\tDB db=mongo.getDB(\"samplemongo\");\r\n\t\t\t/*MongoClient mongo = new MongoClient(\"ds023105.mlab.com\", 23105);\r\n\t\t\tDB db = mongo.getDB(\"samplemongo\");*/\r\n\t\t\t\t\t\r\n\t\t//\tboolean auth = db.authenticate(\"sarath\",\"sarath123\".toCharArray());\r\n\t\t\tMongoDatabase db=mongo.getDatabase(\"samplemongo\");\r\n\t\t\t//DB db = mongo.getDB(\"samplemongo\");\r\n\t\t\t//db.getCollection(\"test\");\r\n\t\t\tMongoCollection col=db.getCollection(\"test\");\r\n\t\t\tIterable<Document> cur1=col.find();\r\n\t\t\tIterator<Document> cur=cur1.iterator();\r\n\t\t\twhile(cur.hasNext()){\r\n\t\t\t\tSystem.out.println(cur.next());\r\n\t\t\t}\r\n\t\t\r\n\t}", "public static void main(final String[] args) throws Exception {\n MongoClient mongo = new MongoClient(\"localhost\", 27017);\n /**** Get database ****/\n // if database doesn't exists, MongoDB will create it for you\n DB db = mongo.getDB(\"enron\");\n DBCollection table = db.getCollection(\"demo\");\n BasicDBObject searchQuery = new BasicDBObject();\n searchQuery.put(\"_id\", 1);\n DBCursor cursor = table.find(searchQuery).limit(5);\n System.out.println(\"test\");\n System.out.println(JSON.serialize(cursor));\n\n }", "public MongoManager()\n\t{\n\t\ttry\n\t\t{\n\t\t/*\tmorphia = new Morphia();\n\t\t\tclient = new MongoClient();\n\t\t\tmorphia.mapPackage(\"com.glenwood.kernai.data.entity\");\n\t\t\tdatastore = morphia.createDatastore(client, \"Kernai\");\n\t\t\tdatastore.ensureIndexes();\n\t\t*/\t\n\t\t}\n\t\tcatch(Exception ex)\n\t\t{\n\t\t\tthrow ex;\n\t\t}\n\t\n\t}", "private static MongoClient initMongoClient() {\n\n\t\tServerAddress sa = new ServerAddress(DomainConstans.mongodb_host, DomainConstans.mongodb_port);\n\t\tList<MongoCredential> mongoCredentialList = Lists\n\t\t\t\t.newArrayList(MongoCredential.createCredential(DomainConstans.mongodb_userName, DomainConstans.mongodb_databaseName, DomainConstans.mongodb_password.toCharArray()));\n\t\treturn new MongoClient(sa, mongoCredentialList);\n//\t\treturn new MongoClient(sa);\n\t}", "private static MongoDatabase getDatabase(){\n\t\tint port_number = 27017;\n\t\tString host = \"localhost\";\n\n\t\tMongoClient mongoClient = new MongoClient(host, port_number);\n\t\treturn mongoClient.getDatabase(\"myDb\");\n\t}", "public static MongoDatabase init() {\n\n\t\tMongoClientURI connectionString = new MongoClientURI(\n\t\t\t\t\"mongodb+srv://xxxxx:[email protected]/test\");\n\t\tMongoClient mongoClient = new MongoClient(connectionString);\n\n\t\tMongoDatabase database = mongoClient.getDatabase(\"city\");\n\n\t\treturn database;\n\n\t}", "public void setupMongo(final String username, final String password, final String database2, final String host, final int port) {\n client = new MongoClient(new ServerAddress(\"localhost\", 27017));\n //client = new MongoClient(new MongoClientURI(\"mongodb://ulxi4s6tvez9ckircdpk:R7nFCkRGsMeLjq1c7Z7e@b60upaqifl4t0hi-mongodb.services.clever-cloud.com:27017/b60upaqifl4t0hi\"));\n }", "protected MongoDatabase getDB() {\n return mongoClient.getDatabase(\"comp391_yourusername\");\n }", "protected void initializeMongoDbConnection() {\n if (initialized) {\n log.debug(\"MongoDB connector initializing!\");\n Mongo mongoCon = new Mongo(mongoHost);\n mongoCon.setReadPreference(getPreferredRead());\n db = mongoCon.getDB(mongoDbName);\n\n if (getMongoUser() != null && getMongoPassword() != null) {\n boolean dbAuth = db.authenticate(getMongoUser(), getMongoPassword().toCharArray());\n if (!dbAuth) {\n log.error(\"MongoDB data connector {} authentication failed for database {}, username or password!\", getId(), mongoDbName);\n throw new MongoException(\"MongoDB data connector \" + getId() + \" authentication failed!\");\n } else {\n log.debug(\"MongoDB data connector {} authentication successful!\", getId());\n }\n }\n }\n }", "public static MongoDatabase loadAll() throws UnknownHostException\r\n\t{\n\t\tmongoClient = new MongoClient(\"localhost\");\r\n\t\tDB dataBase = mongoClient.getDB(\"prism\");\r\n\t\t//\t\tboolean auth = dataBase.authenticate(myUserName, myPassword);\r\n\r\n\t\t// initialize AccManager\r\n\t\tMongoDatabase db = new MongoDatabase(dataBase);\r\n\r\n\t\t//\t\tString name = \"lara\";\r\n\t\t//\t\tAccount a = new Account(new Text(name), new byte[32], name + \"@gmx.de\", new Date(), new Date());\r\n\t\t//\t\tam.createAccount(a);\r\n\t\t//\t\tam.findAccount(a.getAccName());\r\n\t\t//\r\n\t\t//\t\tList<String> list = mongoClient.getDatabaseNames();\r\n\t\t//\t\tSystem.out.print(\"databases: \");\r\n\t\t//\t\tfor (String s : list)\r\n\t\t//\t\t\tSystem.out.print(s + \", \");\r\n\t\t//\t\tSystem.out.println(\" (\" + list.size() + \")\");\r\n\t\t//\t\t// ----------------\r\n\t\t//\t\tDB db = mongoClient.getDB(\"test\");\r\n\t\t//\t\t//\t\t\tboolean auth = db.authenticate(myUserName, myPassword);\r\n\t\t//\r\n\t\t//\t\tSet<String> list2 = db.getCollectionNames();\r\n\t\t//\t\tSystem.out.print(\"collections: \");\r\n\t\t//\t\tfor (String s : list2)\r\n\t\t//\t\t\tSystem.out.print(s + \", \");\r\n\t\t//\t\tSystem.out.println(\" (\" + list2.size() + \")\");\r\n\t\t//\t\t// ----------------\r\n\t\t//\t\tDBCollection coll = db.getCollection(\"test\");\r\n\t\t//\t\tlong n = coll.count();\r\n\t\t//\t\tSystem.out.println(\"collection count: \" + n);\r\n\t\t//\t\t// ----------------\r\n\t\t//\r\n\t\t//\t\tSystem.out.print(\"done\");\r\n\r\n\t\treturn db;\r\n\t}", "public static void main(String[] args) {\r\n\r\n\t\t System.out.println(\"Hello\");\r\n\t try {\r\n\r\n\t\t/**** Connect to MongoDB ****/\r\n\t\t// Since 2.10.0, uses MongoClient\r\n\t\tMongoClient mongoClient = new MongoClient(\"localhost\",27017);\r\n\t\tSystem.out.println(\"Hello2\");\r\n //MongoDatabase db = mongoClient.getDatabase(\"test\");\r\n \r\n Collection<DB> dbs = mongoClient.getUsedDatabases();\r\n \r\n for (DB db : dbs) {\r\n System.out.println(\"- Database: \" + db);\r\n \r\n //DB db = mongoClient.getDB(dbName);\r\n \r\n Set<String> collections = db.getCollectionNames();\r\n for (String colName : collections) {\r\n System.out.println(\"\\t + Collection: \" + colName);\r\n }\r\n } \r\n mongoClient.close();\r\n \r\n } catch (Exception ex) {\r\n ex.printStackTrace();\r\n }\r\n\t }", "public MongoClient getConnection() {\n\t\treturn new MongoClient(host, port);\n\t}", "public DbHelper(){\n\t\tmongoDbHelper = new MongoDb();\n\t}", "public DbHelper(String collection){\n\t\tmongoDbHelper = new MongoDb(collection);\n\t}", "public static void main(String[] args) {\n\t\tMongoClientURI uri = new MongoClientURI(\n\t\t\t \"mongodb://admin:[email protected]:41208/springclouddb\");\n\n\t\t\tMongoClient mongoClient = new MongoClient(uri);\n\t\t\tMongoDatabase database = mongoClient.getDatabase(\"springclouddb\");\n\t\t\tMongoCollection<Document> collection = database.getCollection(\"vehicle\");\n\t\t\t\n\t\t\tcollection.insertOne(new Document(\"key\", \"value\"));\n\t\t\tSystem.out.println(collection);\n\t\t\t\n\t}", "public static DB getInstance(String db_name) {\n\n\t\tif (!is_DB_init) {\n\t\t\tinitInstance();\n\t\t}\n\n\t\tif (c == null) {\n\t\t\ttry {\n\t\t\t\tSystem.setProperty(\"javax.net.ssl.trustStore\", \"./res/mongodbS.ts\");\n\t\t\t\tSystem.setProperty(\"javax.net.ssl.trustStorePassword\", \"StorePass\");\n\n\t\t\t\tSystem.setProperty(\"javax.net.ssl.keyStore\", \"./res/mongodbS.jks\");\n\t\t\t\tSystem.setProperty(\"javax.net.ssl.keyStorePassword\", \"StorePass\");\n\n\t\t\t\tMongoClientOptions.Builder builder = MongoClientOptions.builder();\n\t\t\t\t// builder.sslEnabled(true).build();\n\t\t\t\tbuilder.sslEnabled(false).build();\n\t\t\t\t// builder.sslInvalidHostNameAllowed(true).build();\n\t\t\t\tbuilder.sslInvalidHostNameAllowed(false).build();\n\n\t\t\t\t// System.out.println(\"doPOST: url = \"+url);\n\t\t\t\t// System.out.println(\"doPOST: user = \"+user);\n\t\t\t\t// System.out.println(\"doPOST: passwd = \"+passwd);\n\t\t\t\tMongoClientURI uri = new MongoClientURI(\n\t\t\t\t\t\t\"mongodb://\" + user + \":\" + passwd + \"@\" + url + \"/?authSource=admin\", builder);\n\n\t\t\t\t// c = new MongoClient(uri); //ssl security\n\t\t\t\tc = new MongoClient();\n\t\t\t\tdb = c.getDB(db_name);\n\t\t\t} catch (Exception e) {\n\t\t\t\te.printStackTrace();\n\t\t\t}\n\t\t} else {\n\t\t\tdb = c.getDB(db_name);\n\t\t}\n\t\treturn db;\n\t}", "public interface Database {\n\n /**\n * connect mongo\n */\n public void connect();\n\n\n public void load();\n\n\n /**\n * close connection\n */\n public void close();\n\n\n\n}", "public void init() throws ServletException{\n\t\tmongo = new MongoClient(\"localhost\", 27017);\n\t}", "public boolean connect(){\n \ttry {\n \t\tString writeConcernType = test_properties.getProperty(\"writeConcern\");\n \t\tif (\"none\".equals(writeConcernType)) {\n \t\t\twriteConcern = WriteConcern.NONE;\n \t\t} else if (\"safe\".equals(writeConcernType)) {\n \t\t\twriteConcern = WriteConcern.SAFE;\n \t\t} else if (\"normal\".equals(writeConcernType)) {\n \t\twriteConcern = WriteConcern.NORMAL;\n \t\t} else if (\"journal\".equals(writeConcernType)) {\n \t\twriteConcern = WriteConcern.JOURNAL_SAFE;\n \t\t} else if (\"fsync\".equals(writeConcernType)) {\n \t\twriteConcern = WriteConcern.FSYNC_SAFE;\n \t\t}\n \t\n \t\tm = new Mongo (server, port);\n \t\tm.setWriteConcern(writeConcern);\n \t\tmdb = m.getDB(dbName);\n \n \t \t// Try to authenticate.\n \t\tif (!(user.equals(\"\") || pass.equals(\"\")))\n \t\t\tmdb.authenticate(user, pass.toCharArray());\n \t} catch (Exception e) {\n \t\te.printStackTrace();\n\t\t\treturn false;\n \t\t}\n \treturn true;\n \t }", "@Override\n\tpublic MongoClient mongoClient() {\n\t\treturn new MongoClient(new MongoClientURI(mongodburi));\n\t}", "private void initializeMongoConverter() {\n mongoTemplate = new MongoTemplate(new SimpleMongoDbFactory(new MongoClient(), databaseName));\n JaxbAnnotationModule jaxbAnnotationModule = new JaxbAnnotationModule();\n ObjectMapper objectMapper = new ObjectMapper();\n objectMapper.registerModule(jaxbAnnotationModule);\n }", "DBConnect() {\n \n }", "public void initDatabase() {\n Datastore mongoDataStore = DatabaseHandler.getInstance().getMongoDataStore();\n initUsers();\n initAccounts();\n mongoDataStore.save(users);\n }", "private MongoClient getDefaultConnection() {\n\t\tthis.mongoClient = new MongoClient();\n\t\treturn this.mongoClient;\n\t}", "@Bean\n public MongoDbFactory mongoDbFactory() throws Exception {\n // Set credentials\n// MongoCredential credential = MongoCredential.createCredential(\"\", \"task-db\", \"\".toCharArray());\n MongoCredential credential = MongoCredential.createCredential(\"admin\", \"admin\", \"project1\".toCharArray());\n\n ServerAddress serverAddress = new ServerAddress(\"localhost\",27017);\n MongoClientOptions options = MongoClientOptions.builder().socketTimeout(5000).build();\n\n // Mongo Client\n MongoClient mongoClient = new MongoClient(serverAddress, credential, options);\n\n // Mongo DB Factory\n SimpleMongoDbFactory factory = new SimpleMongoDbFactory(mongoClient, \"task-db\");\n\n return factory;\n }", "public static void main(String[] args){\n MongoClient mongoClient = new MongoClient(\"localhost\", 27017);\n\n //Creating a Mongo database\n MongoDatabase mongoDatabase = mongoClient.getDatabase(\"test\");\n\n //Creating a collection\n MongoCollection mongoCollection = mongoDatabase.getCollection(\"user\");\n\n //save(mongoCollection);\n //findAll(mongoCollection);\n //findByPosition(mongoCollection);\n //findByPositionAndSalary(mongoCollection);\n //updateOne(mongoCollection);\n //updateMany(mongoCollection);\n //replaceOne(mongoCollection);\n //deleteOne(mongoCollection);\n //deleteMultiple(mongoCollection);\n //sort(mongoCollection);\n //limit(mongoCollection);\n //aggregation(mongoCollection);\n //aggregationWithUsingProject(mongoCollection);\n }", "@Bean\n public MongoOperations mongoOperations() throws Exception {\n return new MongoTemplate(mongoDbFactory());\n }", "public void test1(){\n // 创建客户端\n MongoClient client = new MongoClient(\"localhost\");\n // 获得要查询的数据库\n MongoDatabase userdb = client.getDatabase(\"userdb\");\n // 得到要查询的集合\n MongoCollection<Document> spitcollection = userdb.getCollection(\"spit\");\n // 查询数据\n FindIterable<Document> documents = spitcollection.find();\n\n for (Document document: documents) {\n // 获得该字段的值\n System.out.println(\"id + \" + document.get(\"_id\"));\n // 获得该字段指定数据类型的值\n System.out.println(\"content : \" + document.getString(\"content\"));\n // 获得userid\n System.out.println(\"userid : \" + document.getString(\"userid\"));\n // 获得nickname\n System.out.println(\"nickname : \" + document.get(\"nickname\",String.class));\n // 获得integer id\n System.out.println(\"visits : \" + document.get(\"visits\",Integer.class));\n }\n }", "@Test\n public void helloWorld() {\n MongoClient mongoClient = new MongoClient(\"localhost\", subject.getPort());\n MongoDatabase db = mongoClient.getDatabase(\"TEST_DATABASE\");\n db.createCollection(\"TEST_COLLECTION\");\n db.getCollection(\"TEST_COLLECTION\").insertOne(new Document());\n\n assertThat(db.getCollection(\"TEST_COLLECTION\").count(), is(1L));\n }", "public static void main(String[] args) {\n\n MongoClientOptions mongoClientOptions = MongoClientOptions.builder().connectionsPerHost(500).build();\n MongoClient mongoClient = new MongoClient(new ServerAddress(), mongoClientOptions);\n final MongoDatabase db = mongoClient.getDatabase(\"varun_db\");\n final MongoCollection<Document> person = db.getCollection(\"person\");\n for (Document doc : person.find()) {\n printDoc(doc);\n }\n person.drop();\n for(int i=0;i<10;i++) {\n Document smith = new Document(\"name\", \"smith\"+i)\n .append(\"age\", 30)\n .append(\"profession\", \"programmer\"+i);\n person.insertOne(smith);\n }\n final Document document = person.find().first();\n printDoc(document);\n\n final ArrayList<Document> into = person.find().into(new ArrayList<Document>());\n for (Document doc : into)\n printDoc(doc);\n\n final MongoCursor<Document> mongoCursor = person.find().iterator();\n try {\n while (mongoCursor.hasNext())\n printDoc(mongoCursor.next());\n } finally {\n mongoCursor.close();\n }\n\n System.out.println(\"total count is \"+ person.count());\n\n System.out.println(\"filter\");\n Bson filterDoc=new Document(\"name\",\"smith9\");\n final FindIterable<Document> filter = person.find().filter(filterDoc);\n for(Document doc:filter)\n printDoc(doc);\n Bson filterDoc2=eq(\"name\",\"smith8\");\n final FindIterable<Document> filter2 = person.find().filter(filterDoc2);\n for(Document doc:filter2)\n printDoc(doc);\n\n }", "public static MongoDatabase getDatabase(ProcessSteps step) {\n MongoClient client = DBConnection.getConnection();\n MongoDatabase db = client.getDatabase(step.toString());\n return db;\n }", "public @Bean\r\n MongoDbFactory mongoDbFactory() throws Exception {\n MongoClient mongo = new MongoClient(\"198.15.127.150\");\r\n SimpleMongoDbFactory simpleMongoDbFactory = new SimpleMongoDbFactory(mongo, \"hmp\");\r\n// MongoClient mongo = new MongoClient(\"128.199.64.31\");\r\n// SimpleMongoDbFactory simpleMongoDbFactory = new SimpleMongoDbFactory(mongo, \"truckguru\");\r\n return simpleMongoDbFactory;\r\n\r\n }", "public MongoDBConnection(MongoDBConfig config) {\n // TODO setup correct configuration\n super(new HashMap<>());\n }", "protected DB getDb() throws UnknownHostException {\n return new Mongo(\"localhost\", MongoDBRule.MONGO_PORT).getDB(\"yawl\");\n }", "public static void main(String[] args) {\n\t\tMongoClient client = new MongoClient(\"localhost\", 27017);\n\t\t// getting access to database.. if not available, it will create new one with this name 'test'\n\t\tMongoDatabase database = client.getDatabase(\"test\");\n\t\t// getting Collections from database.if not available, it will create new one with this name 'Employee'\n\t\tMongoCollection<Document> collection = database.getCollection(\"Employee\");\n\t\t//put data in map Collection\n\t\t/*\n\t\t Map<String,Object> m=new HashMap<>();\n\t\t\tm.put(\"id\", \"500\");\n\t\t\tm.put(\"name\", \"krishna\");\n\t\t\tm.put(\"address\", \"mum\");\n\t\t\tm.put(\"phone\", \"546325\");\n\t\t*/\n\t\t/**\n\t\t * Map Collection can not be used to store data. for mongo, we have to use document class of mongo\n\t\t * To store multiple document at a time,add document in list collection and store.\n\t\t * e.g.,\n\t\t * \n\t\t */\n\t\t\n\t\t// Creating single documents to add in mongo collections\n\t\t/*\n\t\tDocument document = new Document();\n\t\tdocument.append(\"id\", \"200\");\n\t\tdocument.append(\"name\", \"radha\");\n\t\tdocument.append(\"address\", \"pune\");\n\t\tdocument.append(\"phone\", \"78564\");\n\t\t*/\n\t\t/*//adding document to collection\n\t\tcollection.insertOne(document);*/\n\t\t\n\t\t// Creating multiple documents to add in mongo collections\n\t\t/**\n\t\t * Creating multiple documents instances\n\t\t */\n\t\tDocument document1 = new Document();\n\t\tdocument1.append(\"id\", \"300\");\n\t\tdocument1.append(\"name\", \"rani\");\n\t\tdocument1.append(\"address\", \"kol\");\n\t\tdocument1.append(\"phone\", \"56975\");\n\t\t\n\t\tDocument document2 = new Document();\n\t\tdocument2.append(\"id\", \"301\");\n\t\tdocument2.append(\"name\", \"sushma\");\n\t\tdocument2.append(\"address\", \"shimla\");\n\t\tdocument2.append(\"phone\", \"65987\");\n\t\t\n\t\tDocument document3 = new Document();\n\t\tdocument3.append(\"id\", \"302\");\n\t\tdocument3.append(\"name\", \"mamta\");\n\t\tdocument3.append(\"address\", \"delhi\");\n\t\tdocument3.append(\"phone\", \"78564\");\n\t\t\n\t\t/**\n\t\t * Adding multiple document instances in list Collection\n\t\t */\n\t\tList<Document> listOfDocuments=new ArrayList<>();\n\t\tlistOfDocuments.add(document1);\n\t\tlistOfDocuments.add(document2);\n\t\tlistOfDocuments.add(document3);\n\t\t\n\t\t//----------Calling insertMany(-) to save multiple document instances placed in list\n\t\n\t\tcollection.insertMany(listOfDocuments);\n\t\t\n\t\tSystem.out.println(\"documents inserted successfully\");\n\t\t// closing connection\n\t\tclient.close();\n\n\t}", "public Scraper() {\n\n\t\tsuper();\n\t\tMorphiaManager.setup(MorphiaConstants.HOST, MorphiaConstants.PORT);\n\t\tthis.mDBh= new MongoDBHandler();\n\t}", "public MongoWriter() {\n\t\tmongoClient = new MongoClient(\"localhost\");\n\t\tMongoDatabase database = mongoClient.getDatabase(\"ai\");\n\t\tminPathsCollection = database.getCollection(\"min_paths\");\n\t\tedgesCollection = database.getCollection(\"edges\");\n\t\t// clear before starting\n\t\tminPathsCollection.drop();\n\t\tedgesCollection.drop();\n\t}", "@Before\n\tpublic void init() {\n\t\tmongoClient = new MongoClient(MongoActions.props.getHost(), MongoActions.props.getPort());\n\t\tclearCollection();\n\t}", "private DBCollection connectToEntry() {\n\t\tconf = new Properties();\n\t\tconf.setProperty(sHost, \"localhost\");\n\t\tconf.setProperty(sDB, \"blogentry\");\n\t\tconf.setProperty(sCollection, \"blogentry\");\n\t\ttry {\n\t\t\tif (collection1 != null && collection1.getName() != null) {\n\t\t\t\tSystem.out.println(\"Collection Name: \" + collection1);\n\t\t\t\treturn collection1;\n\t\t\t}\n\t\t} catch (Exception ex) {\n\t\t\tcollection1 = null;\n\t\t}\n\n\t\ttry {\n\t\t\tm = new Mongo(conf.getProperty(sHost));\n\t\t\tDB db = m.getDB(conf.getProperty(sDB));\n\t\t\tSystem.out.println(\"db name:\" + conf.getProperty(sDB));\n\t\t\tSystem.out.println(\"db name:\" + db);\n\t\t\tcollection1 = db.getCollection(conf.getProperty(sCollection));\n\t\t\tif (collection1 == null)\n\t\t\t\tthrow new RuntimeException(\"Missing collection: \"\n\t\t\t\t\t\t+ conf.getProperty(sCollection));\n\n\t\t\treturn collection1;\n\t\t} catch (Exception ex) {\n\t\t\t// should never get here unless no directory is available\n\t\t\tthrow new RuntimeException(\"Unable to connect to mongodb on \"\n\t\t\t\t\t+ conf.getProperty(sHost));\n\t\t}\n\t}", "@RequestMapping(value=\"/pokemon\", method =RequestMethod.GET)\n\tpublic boolean initDataBase() {//Inicializacion de la BD. Solo llamado una vez al iniciar la aplicacion\n\t\tboolean done = false;\n\t\thandler = new MongoDBQueries();//Inicializacion del objeto\n\t\thandler.initialize();//Inicializacion de la BD y la coleccion\n\t\thandler.getFile();//Lectura del fichero JSON e introduccion en la coleccion\n\t\tdone = true;\n\t\treturn done;\n\t}", "public void connect() {\n\n DatabaseGlobalAccess.getInstance().setEmf(Persistence.createEntityManagerFactory(\"PU_dashboarddb\"));\n DatabaseGlobalAccess.getInstance().setEm(DatabaseGlobalAccess.getInstance().getEmf().createEntityManager());\n DatabaseGlobalAccess.getInstance().getDatabaseData();\n DatabaseGlobalAccess.getInstance().setDbReachable(true);\n }", "DatabaseController() {\n\n\t\tloadDriver();\n\t\tconnection = getConnection(connection);\n\t}", "public MongoModule(Environment environment, Configuration configuration) {\n mongoHost = configuration.getString(\"mongodb.host\", \"mongohost\");\n mongoPort = configuration.getString(\"mongodb.port\", \"27017\");\n dbName = configuration.getString(\"mongodb.db\", \"redmart\");\n }", "private static void statisticOffer() {\n\t\tString url = \"localhost\";\n\t\tint port = 27017;\n\t\tString dbName = \"dulishuo\";\n\t\tDB db = MongoUtil.getConnection(url, port, dbName);\n\t\t\n\t\tDBCollection offer = db.getCollection(\"offer\"); \n\t DBCursor find = offer.find();\n\t \n\t while(find.hasNext()){\n\t \t\n\t }\n\t}", "public DBManager(){\r\n connect(DBConstant.driver,DBConstant.connetionstring);\r\n }", "public interface MongoBase<T> {\n\n public void insert(T object,String collectionName);\n\n public T findOne(Map<String,Object> params, String collectionName);\n\n public List<T> findAll(Map<String,Object> params, String collectionName);\n\n public void update(Map<String,Object> params,String collectionName);\n\n public void createCollection(String collectionName);\n\n public void remove(Map<String,Object> params,String collectionName);\n}", "public void DBConnect() {\n \tdatabase = new DatabaseAccess();\n \tif (database != null) {\n \t\ttry {\n \t\t\tString config = getServletContext().getInitParameter(\"dbConfig\");\n \t\t\tdatabase.GetConnectionProperties(config);\n \t\t\tdatabase.DatabaseConnect();\n \t\t}\n \t\tcatch (Exception e) {\n \t\t\te.printStackTrace();\n \t\t}\n \t}\n }", "public static void main(String[] args) {\n \r\n \r\n AluguelDaoMongodb adm = new AluguelDaoMongodb();\r\n \r\n adm.listAll().forEach(a -> System.out.println(a.toString()));\r\n }", "private MongoClient buildMongo(final AuthConfig c) {\n\t\ttry {\n\t\t\treturn new MongoClient(c.getMongoHost());\n\t\t} catch (MongoException e) {\n\t\t\tLoggerFactory.getLogger(getClass()).error(\n\t\t\t\t\t\"Failed to connect to MongoDB: \" + e.getMessage(), e);\n\t\t\tthrow e;\n\t\t}\n\t}", "public void clearDB() {\n String[] collections = {\"reviews\", \"products\", \"orders\", \"users\"};\n MongoClient mongoClient = null;\n try {\n mongoClient = getConnectionClient();\n MongoDatabase mongoDBConnect = mongoClient.getDatabase(\"cart\");\n mongoDBConnect.drop();\n mongoDBConnect = mongoClient.getDatabase(\"cart\");\n for (String collectionsToMake : collections) {\n mongoDBConnect.createCollection(collectionsToMake);\n MongoCollection<Document> collection = mongoDBConnect.getCollection(collectionsToMake);\n if (collectionsToMake.equals(\"reviews\")) {\n Document uniqueIndex = new Document(\"review_id\", 1);\n collection.createIndex(uniqueIndex, new IndexOptions().unique(true));\n } else if (collectionsToMake.equals(\"products\")) {\n Document uniqueIndex = new Document(\"product_id\", 1);\n collection.createIndex(uniqueIndex, new IndexOptions().unique(true));\n } else if (collectionsToMake.equals(\"users\")) {\n Document uniqueIndex = new Document(\"username\", 1);\n collection.createIndex(uniqueIndex, new IndexOptions().unique(true));\n }\n }\n System.out.println(\"Database is cleared, new data is being filled\");\n } catch (MongoCommandException mongoCommandException) {\n System.out.println(\"There was an error executing mongo command, please try again later\");\n } catch (MongoWriteException mongoWriteException) {\n System.out.println(\"There was an error writing to mongo db\");\n } catch (MongoSocketReadException mongoSocketReadException) {\n System.out.println(\"There was an error reading from socket\");\n } finally {\n mongoClient.close();\n }\n }", "private void connectToDB() {\n try {\n Class.forName(\"org.postgresql.Driver\");\n this.conn = DriverManager.getConnection(prs.getProperty(\"url\"),\n prs.getProperty(\"user\"), prs.getProperty(\"password\"));\n } catch (SQLException e1) {\n e1.printStackTrace();\n } catch (ClassNotFoundException e) {\n e.printStackTrace();\n }\n }", "private static void checkDatabaseConnectivity() throws IOException {\r\n\r\n Properties serverProperties = new Properties();\r\n FileInputStream input = new FileInputStream(SERVER_PROPERTIES_PATH);\r\n serverProperties.load(input);\r\n int port = Integer.valueOf(serverProperties.getProperty(\"server.port\"));\r\n\r\n if (!MongoDB.isConnected()) {\r\n System.err.println(\"No MongoDB running on localhost:\" + port);\r\n System.err.println(\"Application is shut down.\");\r\n System.exit(-1);\r\n }\r\n\r\n }", "public ConnectDB(){\r\n\r\n\t}", "private void initializeMongoDBUserCollection() {\n\t\trepository.deleteAll();\n\n\t\t// save a couple of Users\n\t\trepository\n\t\t\t\t.save(new User(\"demo\", \"password\", \"lastname\", Gender.Unknown));\n\t\trepository.save(new User(\"Alice\", \"secret\", \"Smith\", Gender.Female));\n\t\trepository.save(new User(\"Bob\", \"secret\", \"Smith\", Gender.Male));\n\t\trepository.save(new User(\"Tom\", \"2xa23!\", \"Oglesby\", Gender.Male));\n\t}", "public AssignmentDaoImpl(MongoDao mongoDao) {\n this.mongoDatabase = mongoDao.getDBConnection();\n }", "public MongoDatabase createDatabase(MongoClient mongoClient) {\n\t\ttry {\n\t \tmongoClient.dropDatabase(GenericConstants.dbName);\n\t }catch(Exception e){}\n\t MongoDatabase database = mongoClient.getDatabase(GenericConstants.dbName);\n\t\tSystem.out.println(\"Connected to the database successfully\");\n\t return database;\n\t}", "public static void main(String[] args) {\n\t\tMongoClient client = MongoClients.create(\"mongodb://localhost:27017\");\n\t\t//connection to database\n\t\tMongoDatabase database = client.getDatabase(\"College\");\n\t\t//Get collection\n\t\tMongoCollection<Document> collection = database.getCollection(\"Employee\");\n\t\tDocument document = new Document(\"Name\",\"Pallavi\");\n\t\tdocument.append(\"Specialied\", \"Java\");\n\t\tdocument.append(\"Phone\", \"4896314140\");\n\t\tdocument.append(\"Address\", \"BNGLR\");\n\t\tdocument.append(\"College\", \"VNR\");\n\t\t\n\t\tcollection.insertOne(document);\n\t\tSystem.out.println(\"Inserted Successfully\");\n\t}", "private Mongopool() {\n\t}", "private DBConnection() \n {\n initConnection();\n }", "private void connectDatabase(){\n }", "public interface MongoBase<T> {\n\n public abstract void insert(T Object, String collectionName);\n\n public abstract T findOne(Map<String, Object> params, String collectionName);\n\n public abstract List<T> findAll(Map<String, Object> params, String collectionName);\n\n public abstract void update(Map<String, Object> params, String collectionName);\n\n public abstract void createCollection(String collectionName);\n\n public abstract void remove(Map<String, Object> params, String collectionName);\n\n\n}", "private void initializeStore()\r\n {\r\n log.debug(\"initializing MongoStore\");\r\n try (InputStream is = getClass().getClassLoader().getResourceAsStream(\"visualharvester.properties\"))\r\n {\r\n final Properties properties = new Properties();\r\n properties.load(is);\r\n\r\n host = properties.get(\"mongo.host\").toString();\r\n final String portString = properties.get(\"mongo.port\").toString();\r\n port = Integer.valueOf(portString).intValue();\r\n database = properties.get(\"mongo.database\").toString();\r\n collection = properties.get(\"mongo.collection\").toString();\r\n\r\n }\r\n catch (final IOException e)\r\n {\r\n log.error(\"Could not open properties file, using defaults\", e);\r\n host = \"localhost\";\r\n port = 27017;\r\n database = \"visualdb\";\r\n collection = \"visualcollection\";\r\n }\r\n\r\n store = new MongoStorage(host, port, database, collection);\r\n\r\n }", "public Connection connectdb(){\n Connection con = null;\n try {\n Class.forName(\"com.mysql.cj.jdbc.Driver\");\n con = DriverManager.getConnection(url, user, pass);\n } catch (ClassNotFoundException | SQLException ex) {\n Logger.getLogger(ILocker.class.getName()).log(Level.SEVERE, null, ex);\n }\n return con;\n }", "private static void connectDatabase(){\n\t\t// register the driver\n\t\ttry{\n\t\t\tClass.forName(DRIVER).newInstance();\n\t\t\tconnection = DriverManager.getConnection(CONNECTION_URL);\n\t\t} catch (IllegalAccessException | InstantiationException | ClassNotFoundException e) {\n\t\t\te.printStackTrace();\n\t\t} catch (SQLException e) {\n\t\t\te.printStackTrace();\n\t\t}\n\n\t}", "public static void main(String[] args) {\n\t\tDBCollection coll= getMongoColl();\n\t\t///写入一个Document\n\t\t//BasicDBObject doc = new BasicDBObject(\"name\", \"MongoDB\")\n\t\t// .append(\"type\", \"database\")\n\t\t// .append(\"count\", 1)\n\t\t// .append(\"info\", new BasicDBObject(\"x\", 203).append(\"y\", 102));\n\t\t//coll.insert(doc);\n\t\tDBObject oneUser = coll.findOne();\n\t\t//System.out.print(\"==============\"+oneUser);\n\t\t//DBObject dbo = (DBObject) JSON.parse(user.toJson()); \n\t\t//coll.insert(dbo);\n\t\t//System.out.print(\"==============\"+doc);\n\t\t\n\t\tSimpleDateFormat df = new SimpleDateFormat(\"yyyy-MM-dd'T'HH:mm:ss.SSSZ\");\n\t\tCalendar c = Calendar.getInstance(); // 获得当前时间\n\t\tc.add(Calendar.DATE, - 11); \n\t\tString logJson = \"{\\\"id\\\":\\\"\"+UUID.randomUUID()+\"\\\",\" +\n\t\t\t\t\"\\\"sysCode\\\":\\\"test2\\\",\" +\n\t\t\t\t\"\\\"sysName\\\":\\\"beijingserver1\\\",\" + \n \"\\\"logLevel\\\":\\\"1\\\",\\\"logType\\\":\\\"1\\\",\" +\n \"\\\"userId\\\":\\\"1111111\\\",\" +\n \"\\\"userName\\\":\\\"test1\\\",\" +\n \"\\\"content\\\":\\\"1测试测试测试1\\\",\" +\n \"\\\"logTime\\\":\\\"\"+df.format(c.getTime())+\"\\\"}\";\n\t\tObjectMapper mapper = new ObjectMapper();\n\t\ttry {\n\t\t\tMap<?, ?> map = mapper.readValue(logJson, Map.class);\n\t\t\tString sysCode = map.get(\"sysCode\").toString();\n\t\t\t//mongoTemplate.insert(map, sysCode);\n\t\t\t\n\t\t} catch (JsonParseException e) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\te.printStackTrace();\n\t\t} catch (JsonMappingException e) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\te.printStackTrace();\n\t\t} catch (IOException e) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\te.printStackTrace();\n\t\t}\n\t\t//DBObject b = new BasicDBObject(\"_id\", \"1111111111111111\");\n\t\t//mongoTemplate.insert(b, \"tb_calllog5\");\n\t\tSystem.out.print(\"====\");\n\t}", "@Bean\r\n\t@Override\r\n\tpublic Mongo mongo() throws Exception {\n\t\treturn null;\r\n\t}", "public void connectToDb(){\n\t log.info(\"Fetching the database name and other details ... \");\n\t dbConnect.setDbName(properties.getProperty(\"dbName\"));\n\t dbConnect.setUsrName(properties.getProperty(\"dbUsrname\"));\n\t dbConnect.setPassword(properties.getProperty(\"dbPassword\"));\n\t dbConnect.setSQLType(properties.getProperty(\"sqlServer\").toLowerCase());\n\t log.info(\"Trying to connect to the database \"+dbConnect.getDbName()+\" ...\\n with user name \"+dbConnect.getUsrname()+\" and password ****** \");\n\t dbConnect.connectToDataBase(dbConnect.getSQLType(), dbConnect.getDbName(), dbConnect.getUsrname(), dbConnect.getPswd());\n\t log.info(\"Successfully connected to the database \"+dbConnect.getDbName());\n }", "private void connectToDB() throws Exception\n\t{\n\t\tcloseConnection();\n\t\t\n\t\tcon = Env.getConnectionBradawl();\n\t}", "public void getConnect() \n {\n con = new ConnectDB().getCn();\n \n }", "@Override\n\tpublic MongoClient getConnection(MqsConfigBean mqsConfigBean) {\n\t\tif (mongoClient == null) {\n\t\t\tConnectionBean connectionBean = new ConnectionBean(mqsConfigBean.getHost(), mqsConfigBean.getPort(),\n\t\t\t\t\tmqsConfigBean.getUsername(), mqsConfigBean.getPassword(), mqsConfigBean.getDbName());\n\t\t\tfinal ConnectionValidation hostPortValidation = ConnectionValidation.hostIsNotEmpty()\n\t\t\t\t\t.and(ConnectionValidation.portIsNotDefault());\n\t\t\tfinal ConnectionValidation userNamePasswordValidation = ConnectionValidation.userNameIsNotEmpty()\n\t\t\t\t\t.and(ConnectionValidation.passwordIsNotEmpty());\n\t\t\tif (hostPortValidation.apply(connectionBean) && userNamePasswordValidation.apply(connectionBean)) {\n\t\t\t\tServerAddress serverAddress = new ServerAddress(mqsConfigBean.getHost(), mqsConfigBean.getPort());\n\t\t\t\tMongoCredential credential = MongoCredential.createCredential(mqsConfigBean.getUsername(),\n\t\t\t\t\t\tmqsConfigBean.getDbName(), mqsConfigBean.getPassword().toCharArray());\n\t\t\t\tMongoClientOptions mongoClientOptions = new MongoClientOptions.Builder().build();\n\t\t\t\tmongoClient = new MongoClient(serverAddress, credential, mongoClientOptions);\n\t\t\t} else {\n\t\t\t\t\n\t\t\t\tif (ConnectionValidation.hostIsNotEmpty().apply(connectionBean)) {\n\t\t\t\t\treturn new MongoClient(mqsConfigBean.getHost(), mqsConfigBean.getPort());\n\t\t\t\t}\n\t\t\t\treturn getDefaultConnection();\n\t\t\t}\n\t\t}\n\t\treturn mongoClient;\n\t}", "public void connectDB() {\n\t\tSystem.out.println(\"CONNECTING TO DB\");\n\t\tSystem.out.print(\"Username: \");\n\t\tusername = scan.nextLine();\n\t\tConsole console = System.console(); // Hides password input in console\n\t\tpassword = new String(console.readPassword(\"Password: \"));\n\t\ttry {\n\t\t\tDriverManager.registerDriver (new oracle.jdbc.driver.OracleDriver());\n\t\t\tconnection = DriverManager.getConnection(url, username, password);\n\t\t} catch(Exception Ex) {\n\t\t\tSystem.out.println(\"Error connecting to database. Machine Error: \" + Ex.toString());\n\t\t\tEx.printStackTrace();\n\t\t\tSystem.out.println(\"\\nCONNECTION IS REQUIRED: EXITING\");\n\t\t\tSystem.exit(0); // No need to make sure connection is closed since it wasn't made\n\t\t}\n\t}", "private void setupDB(){\n try {\n Class.forName(\"oracle.jdbc.driver.OracleDriver\");\n String url = \"jdbc:oracle:thin:@localhost:1521:orcl\";\n String username = \"sys as sysdba\"; //Provide username for your database\n String password = \"oracle\"; //provide password for your database\n\n con = DriverManager.getConnection(url, username, password);\n }\n catch(Exception e){\n System.out.println(e);\n }\n }", "@Override\n\t\t\tpublic void actionPerformed(ActionEvent e) {\n\t\t\t\tconnectToMongo();\n\t\t\t}", "public MongoDataBase(String dbserver, String dbport, String dbname, String dbuser, String dbpass,int threadnumber, int testcase) {\n\t\tserver = dbserver;\n\t\tdbName = dbname;\n\t\tport = Integer.parseInt(dbport);\n\t\tthis.threadnumber = threadnumber;\n\t\tthis.testcase = testcase;\n\t\tuser = dbuser;\n\t\tpass = dbpass;\n\t\trg = RandomGenerator.getInstance();\n\t\t\n\t}", "public static void main(String[] args) {\n\t\tMongoClient mc = new MongoClient(\"localhost\", 27017);\n\n\t\t/* Point to database */\n\t\tMongoDatabase db = mc.getDatabase(\"Jan20db\");\n\n\t\t/* Point to collection */\n\t\tMongoCollection<Document> collection = db.getCollection(\"user\");\n\n\t\t/* Point to document */\n\t\tDocument doc = new Document();\n\t\tdoc.append(\"first\", \"sirisha\");\n\t\tdoc.append(\"last\", \"epari\");\n\n\t\t/* Insert document to collection */\n\t\tcollection.insertOne(doc);\n\n\t\tSystem.out.println(\"Record inserted \" + doc);\n\t\t\n\t\t\n\t\tDocument d = collection.find().first();\n\t\tSystem.out.println(d);\n\t\t\n\t\t/* Import file, read line by line , use collection.insertMany() */\n\t\t\n\n\t}", "public static void main(String[] args) {\n\t\tString reviewer=\"reviewer_\"; \n\t\tString client=\"client_\"; \n\t\tString review_text=\"review_text\"; \n\t\tString product=\"prod_\";\n\t\tint rating; \n\t\t\n\t\tMongoHelper m = new MongoHelper(); \n\t\tcoll = m.getCollectiono(); \n\t\t\n\t\tRandom rg=new Random(); \n\t\tSystem.out.println( \"reviewer \" + \"client \" +\n\t\t \" review_text \" + \" product \" ); \n\t\t\n\t\t client = \"cust_b\" ; \n\t\t for ( int pr=1; pr<5; pr++ ) {\n\t\t\t product = \"prod_a\" + pr; \n\t\t for ( int i=1 ; i< 5; ++i) {\n\t\t\t int rand=rg.nextInt(30); \n\t\t\t reviewer = \"reviewer_\" + rand; \n\t\t\t rating=rg.nextInt(10)+ 1; \n\t\t\t int d=rg.nextInt(200); \n\t\t\t Calendar cal= Calendar.getInstance();\n\t\t\t cal.add(Calendar.DATE, d*(-1) ); \n\t\t\t cal.add(Calendar.HOUR, d*(-1) );\n\t\t\t\t SimpleDateFormat sdf=new SimpleDateFormat(DATA_FORMAT_NOW); \n\t\t\t\t String review_date= sdf.format(cal.getTime()); \n\t\t\t\t ReviewData rd=new ReviewData(reviewer, client, review_text, product, rating, review_date); \n\t//\t\t System.out.println( reviewer + \" \" + client + \" \"+ \n\t//\t\t review_text + \" \"+ product + \" \" + rating + \" \"+ review_date); \n\t\t\t BasicDBObject doc = rd.getMongoDoc();\n\t\t\t System.out.println (doc); \n\t\t\t coll.insert(doc); \n\t\t }\n\t\t } \n\t\t\n\t\t System.out.println(\" ===============\"); \n\n\t\t DBCursor cursor=coll.find();\n\t\t\ttry {\n\t\t\t\tint i=1; \n\t\t\t\twhile (cursor.hasNext()) {\n\t\t\t\t\tDBObject obj=cursor.next(); \n\t\t\t\t\tSystem.out.println( \" db: \" + i + \"\\n\" + obj ); \n\t\t\t\t\ti++; \n\t\t\t\t}\n\t\t\t} finally {\n\t\t\t\tcursor.close(); \n\t\t\t}\n\t\t\n\t\t\n\t}", "private MongoCollection<Document> getSharesCollection() {\n return _mongoClient.getDatabase(\"Shares\")\n .getCollection(\"Shares\");\n }", "public Mongo create_mongo(Mongo Mongo, NeUser user) throws Exception {\n\n \t\t log.setLevel(Level.INFO);\n\t log.info(\"create_mongo service operation started !\");\n\n\t\ttry{\n\t\t\tMongo the_Mongo;\n\n\t\t\tthe_Mongo = mongo_Default_Activity_dao.create_mongo(Mongo, user);\n\n \t\t\tlog.info(\" Object returned from create_mongo service method !\");\n\t\t\treturn the_Mongo;\n\n\t\t}catch(Exception e){\n\n\t\t\tSystem.out.println(\"ServiceException: \" + e.toString());\n\t\t\tlog.error(\"create_mongo service throws exception : \"+ e.toString());\n\n\t\t}\n\t\treturn null;\n\n\n\n\t}", "private static void setConnection(){\n try{\n Class.forName(\"com.mysql.jdbc.Driver\");\n con = DriverManager.getConnection(\"jdbc:mysql://localhost:3306/novel_rental\",\"root\",\"\");\n } catch (Exception e) {\n Logger.getLogger(NovelRepository.class.getName()).log(Level.SEVERE, null, e);\n System.out.println(e.getMessage());\n }\n }", "public static MongoUtils getInstance() {\n\t\treturn new MongoUtils();\n\t}", "public void connect(){\n if (connected) {\n // connection already established\n return;\n }\n // Create connection to Database\n Properties props = new Properties();\n props.setProperty(\"user\", DB_USER);\n props.setProperty(\"password\", DB_PASSWORD);\n //props.setProperty(\"ssl\", \"true\");\n //\"Connecting to database...\"\n try {\n Class.forName(\"org.postgresql.Driver\");\n String connection_string = generateURL();\n dbConnect = DriverManager.getConnection(connection_string, props);\n //\"Connection established\"\n status = \"Connection established\";\n connected = true;\n } catch (SQLException e) {\n //\"Connection failed: SQL error\"\n status = \"Connection failed: \" + e.getMessage();\n connected = false;\n } catch (Exception e) {\n //\"Connection failed: unknown error\"\n status = \"Connection failed: \" + e.getMessage();\n connected = false;\n }\n }", "@Override\n public void run(String... args) {\n try {\n\n ClassLoader classLoader = Thread.currentThread().getContextClassLoader();\n\n ObjectMapper mapper = new ObjectMapper();\n\n final ObjectMapper configure = mapper.configure(\n DeserializationFeature.ACCEPT_SINGLE_VALUE_AS_ARRAY, true\n );\n\n InputStream inputStreamProducts = classLoader.getResourceAsStream(\"json/product.json\");\n InputStream inputStreamInventory = classLoader.getResourceAsStream(\"json/inventory.json\");\n\n Product[] product = mapper.readValue(inputStreamProducts, Product[].class);\n Inventory[] inventory = mapper.readValue(inputStreamInventory, Inventory[].class);\n\n MongoClient client1 = new MongoClient(\"localhost\");\n\n // Dropping the Warehouserest database in mongodb\n client1.dropDatabase(\"warehouse\");\n\n// ## Start Morphia part\n Morphia morphia = new Morphia();\n morphia.map(Product.class);\n morphia.map(Inventory.class);\n\n Datastore datastore = morphia.createDatastore(client1, \"warehouse\");\n\n for (Product valueProducts : product) {\n datastore.save(valueProducts);\n }\n\n for (Inventory inventories : inventory) {\n datastore.save(inventories);\n }\n\n\n\n/*\n// # Start populating mongodb from Inventory json\n InputStream inputStreamInventory = classLoader.getResourceAsStream(\"json/inventory.json\");\n\n // Load Inventory json at startup\n assert inputStreamInventory != null;\n InputStreamReader inputStreamReaderInventory = new InputStreamReader(inputStreamInventory);\n BufferedReader bufferedReaderInventory = new BufferedReader(inputStreamReaderInventory);\n StringBuilder stringBufferInventory = new StringBuilder();\n\n String line1 = \"\";\n while ((line1 = bufferedReaderInventory.readLine()) != null) {\n stringBufferInventory.append(line1);\n }\n\n MongoCollection<Document> collectionInventory = client1.getDatabase(\"warehouse\").getCollection(\"inventory\");\n Document doc1 = Document.parse(stringBufferInventory.toString());\n collectionInventory.insertOne(doc1);*/\n\n System.out.println(\"Inventory loaded!\");\n System.out.println(\"Products loaded!\");\n } catch (Exception e) {\n System.out.println(\"Not able to load products: \" + e.getMessage());\n }\n }", "public ArrayList<Mongo> get_all_mongo() throws Exception {\n\n \t\t log.setLevel(Level.INFO);\n\t log.info(\" service operation started !\");\n\n\t\ttry{\n\t\t\tArrayList<Mongo> Mongo_list;\n\n\t\t\tMongo_list = mongo_Default_Activity_dao.get_all_mongo();\n\n \t\t\tlog.info(\" Object returned from service method !\");\n\t\t\treturn Mongo_list;\n\n\t\t}catch(Exception e){\n\n\t\t\tSystem.out.println(\"ServiceException: \" + e.toString());\n\t\t\tlog.error(\" service throws exception : \"+ e.toString());\n\n\t\t}\n\t\treturn null;\n\n\n\n\t}", "public MongoEventStore(MongoTemplate mongo) {\n this(new XStreamSerializer(), mongo);\n }", "public void setMongoUser(String user) {\n mongoUser = user;\n }", "@After\n\tpublic void closeMongoClient() {\n\t\tmongoClient.close();\n\t}", "public void init(String databaseHost) {\n CodecRegistry defaultCodecReg = MongoClient.getDefaultCodecRegistry();\r\n Event.EventCodec eventCodec = new Event.EventCodec();\r\n User.UserCodec userCodec = new User.UserCodec();\r\n Feedback.FeedbackCodec feedbackCodec = new Feedback.FeedbackCodec();\r\n Response.ResponseCodec responseCodec = new Response.ResponseCodec();\r\n Template.TemplateCodec templateCodec = new Template.TemplateCodec();\r\n\r\n // Adds the event codec to the codec registry and saves it in the options\r\n CodecRegistry codecReg = CodecRegistries.fromRegistries(\r\n CodecRegistries.fromCodecs(eventCodec, userCodec, feedbackCodec, responseCodec, templateCodec),\r\n defaultCodecReg);\r\n MongoClientOptions options = MongoClientOptions.builder().codecRegistry(codecReg).build();\r\n\r\n // Creates a connection to the client with the custom codecs and access the\r\n // database\r\n mongoClient = new MongoClient(databaseHost, options);\r\n mongoDB = mongoClient.getDatabase(\"App\");\r\n boolean hasEvents = false;\r\n for (String name : mongoDB.listCollectionNames()) {\r\n if (name.equals(\"Events\")) {\r\n hasEvents = true;\r\n break;\r\n }\r\n }\r\n if (!hasEvents) {\r\n mongoDB.createCollection(\"Events\");\r\n }\r\n IndexOptions io = new IndexOptions();\r\n io.unique(true);\r\n mongoDB.getCollection(\"Events\").createIndex(new Document(\"eventCode\", 1), io);\r\n }", "private Connection database() {\n Connection con = null;\n String db_url = \"jdbc:mysql://localhost:3306/hospitalms\";\n String db_driver = \"com.mysql.jdbc.Driver\";\n String db_username = \"root\";\n String db_password = \"\";\n \n try {\n Class.forName(db_driver);\n con = DriverManager.getConnection(db_url,db_username,db_password);\n } \n catch (SQLException | ClassNotFoundException ex) { JOptionPane.showMessageDialog(null,ex); }\n return con;\n }", "public void setMongoPassword(String password) {\n mongoPassword = password;\n }", "private CabsDAO( String dbName )\n {\n this.fuberDB = dbName;\n this.collection = MongoConnector.getDB( this.fuberDB ).getCollection( FuberConstants.CABS_COLLECTION );\n }", "public interface PermissionDao extends MongoRepository<Permission, String> {\n\n}", "public interface TeapotRepository extends MongoRepository<Teapot, String> {\n\n}", "public static void main(String[] args) \r\n {\n \r\n MongoConnectionManager mongo = MongoConnectionManager.getInstance(); \r\n Datastore ds = mongo.getDatastore();\r\n \r\n AdminDAO admindao = new AdminDAO(AdminEntity.class, ds);\r\n EtudiantDAO etudiantDAO = new EtudiantDAO(EtudiantEntity.class, ds);\r\n ProfessorDAO profDao = new ProfessorDAO(ProfessorEntity.class, ds);\r\n ModuleDAO moduledao = new ModuleDAO(ModuleEntity.class, ds);\r\n ExamenDAO examenDAO = new ExamenDAO(ExamenEntity.class,ds);\r\n FiliereDAO filiereDAO = new FiliereDAO(FiliereEntity.class, ds);\r\n /*\r\n \r\n AdminEntity admin = new AdminEntity(\"jalil\", \"messaf\", \"[email protected]\", \"admin\", null, \"[[email protected]\");\r\n \r\n //admindao.save(admin);\r\n \r\n \r\n \r\n EtudiantEntity etudiant = new EtudiantEntity();\r\n etudiant.setEmail(\"[email protected]\");\r\n etudiant.setFirstName(\"anas\");\r\n \r\n etudiantDAO.updateEtudiant(etudiant);\r\n */\r\n \r\n \r\n \r\n //ProfessorEntity p = profDao.getByEmail(\"[email protected]\");\r\n //profDao.updateFieldByEmail(\"urlAvatar\",\"[[email protected]\",\"[email protected]\");\r\n /*\r\n ModuleEntity m1 = new ModuleEntity();\r\n ModuleEntity m2 = new ModuleEntity();\r\n ModuleEntity m3 = new ModuleEntity();\r\n \r\n \r\n m1 = moduledao.findByName(\"Objective C\");\r\n m2 = moduledao.findByName(\"GPI\");\r\n m3 = moduledao.findByName(\"Oracle\");\r\n \r\n \r\n long minute=60000;\r\n long hour = minute * 60;\r\n \r\n \r\n Calendar date = Calendar.getInstance();\r\n long now = date.getTimeInMillis();\r\n \r\n Date twoHoursAgo = new Date(now - 2*hour);\r\n Date twoHoursLater = new Date(now + 2*hour);\r\n */\r\n \r\n //ExamenEntity ex1 = new ExamenEntity(twoHoursAgo, twoHoursLater, m2);\r\n //moduledao.addExam(m2, ex1);\r\n \r\n //System.out.println(\"date debut : \"+twoHoursAgo);\r\n //System.out.println(\"date fin : \"+twoHoursLater);\r\n \r\n //OpEtudiant oe = new OpEtudiant();\r\n \r\n //List<ExamenEntity> list = oe.getExamEnCours(e);\r\n \r\n /*\r\n FiliereEntity filiereEntity = filiereDAO.getFiliereByname(FiliereEnum.GI);\r\n System.out.println(\"filiere\"+filiereEntity.getListModule());\r\n */\r\n //filiereDAO.addModule(filiereEntity, m);\r\n \r\n //OpEtudiant op = new OpEtudiant();\r\n \r\n //List<ExamenEntity> listExam = op.getExams();\r\n \r\n //System.out.println(\"exams : \"+listExam);\r\n \r\n \r\n //moduledao.addExam(m, ex);\r\n \r\n \r\n //m = moduledao.findByName(\"Metaeuristique\");\r\n \r\n //moduledao.updateName(\"Metaeuristique\", \"Metaeuristique 2\");\r\n \r\n \r\n //System.out.println(\"module modifié : \"+m);\r\n \r\n \r\n //p.modules.set(0, m);\r\n \r\n \r\n //profDao.updateProfessor(p);\r\n \r\n //p = profDao.getByEmail(\"[email protected]\");\r\n \r\n //profDao.addModule(p, m);\r\n \r\n //System.out.println(\"prof\"+p);\r\n //System.out.println(\"ses modules\"+p.modules);\r\n \r\n \r\n /**\r\n \r\n \r\n ModuleEntity m = moduledao.findByName(\"GPI\");\r\n \r\n System.out.println(\"module \"+m);\r\n \r\n ExamenEntity ex1 = new ExamenEntity(new Date(), m);\r\n ExamenEntity ex2 = new ExamenEntity(new Date(), m);\r\n \r\n List<ExamenEntity> examens = new ArrayList<>();\r\n examens.add(ex1);\r\n examens.add(ex2);\r\n \r\n m.setExamens(examens);\r\n **/\r\n \r\n \r\n \r\n //ProfessorEntity p = profDao.getByEmail(\"[email protected]\");\r\n \r\n \r\n /*\r\n p.setEmail(\"[email protected]\");\r\n p.setFirstName(\"prof\");\r\n p.setLastame(\"prof\");\r\n p.setPassword(\"prof\");\r\n p.setDateOfBirth(new Date());\r\n p.setUrlAvatar(\"[B@1d33e602\");\r\n \r\n ModuleEntity m1 = new ModuleEntity(\"Metaeuristique\", p);\r\n ModuleEntity m2 = new ModuleEntity(\"GPI\", p);\r\n ModuleEntity m3 = new ModuleEntity(\"Android\", p);\r\n ModuleEntity m4 = new ModuleEntity(\"Programmation System\", p);\r\n ModuleEntity m5 = new ModuleEntity(\"Oracle\", p);\r\n ModuleEntity m6 = new ModuleEntity(\"Francais\", p);\r\n ModuleEntity m7 = new ModuleEntity(\"Anglais\", p);\r\n \r\n List<ModuleEntity> list = new ArrayList<>();\r\n \r\n list.add(m1);\r\n list.add(m2);\r\n list.add(m3);\r\n list.add(m4);\r\n list.add(m5);\r\n list.add(m6);\r\n list.add(m7);\r\n \r\n \r\n \r\n FiliereEntity filiere = new FiliereEntity(FiliereEnum.GI, list);\r\n \r\n \r\n ModuleDAO moduledao = new ModuleDAO(ModuleEntity.class, ds);\r\n \r\n \r\n \r\n profDao.save(p);\r\n \r\n p.setModules(list);\r\n \r\n moduledao.save(m1);\r\n moduledao.save(m2);\r\n moduledao.save(m3);\r\n moduledao.save(m4);\r\n moduledao.save(m5);\r\n moduledao.save(m6);\r\n moduledao.save(m7);\r\n \r\n profDao.save(p);\r\n \r\n FiliereDAO filieredao = new FiliereDAO(FiliereEntity.class, ds);\r\n filieredao.save(filiere);\r\n \r\n \r\n \r\n \r\n \r\n \r\n EtudiantDAO etudiantDAO = new EtudiantDAO(EtudiantEntity.class, ds);\r\n AdminDAO adminDAO = new AdminDAO(AdminEntity.class, ds);\r\n \r\n \r\n \r\n \r\n //List<ModuleEntity> list = filieredao.getList(FiliereEnum.GI);\r\n \r\n //System.out.println(\"modules : \"+list);\r\n /*\r\n OpAdmin adminOp = new OpAdmin();\r\n \r\n List<FiliereEntity> listfFiliereEntitys = adminOp.getAllFilieres();\r\n List<ModuleEntity> listmod = listfFiliereEntitys.get(0).getListModule();\r\n \r\n System.out.println(\"modules : \"+listmod);\r\n \r\n //ProfessorEntity p = profDao.getByEmail(\"[email protected]\");\r\n \r\n //System.out.println(\"prof : \"+p);\r\n //System.out.println(\"modules : \"+p.modules);\r\n \r\n \r\n //ModuleEntity m = new ModuleEntity(\"Sport\", p);\r\n \r\n //profDao.addModuleTo(p, m);\r\n \r\n //p = profDao.getByEmail(\"[email protected]\");\r\n \r\n //System.out.println(\"after update module : \"+p.getModules());\r\n \r\n \r\n //EtudiantEntity e = etudiantDAO.findByEmail(\"[email protected]\");\r\n //System.out.println(\"etudiant : \"+e);\r\n \r\n //AdminEntity admin = adminDAO.findByEmail(\"[email protected]\");\r\n \r\n //System.out.println(\"after convert to admin metier : \"+admin.toAdmin());\r\n \r\n /*\r\n User etudiant = new Etudiant();\r\n \r\n if(etudiant instanceof Etudiant)\r\n System.out.println(\"yes\");\r\n \r\n if(etudiant instanceof Professor)\r\n System.out.println(\"no\");\r\n */\r\n \r\n Date t = new Date();\r\n \r\n \r\n //System.out.println(RandomStuff.displayBirthDay(t));\r\n \r\n \r\n \r\n }", "private static void dbConnect() {\r\n\t\tif (conn == null)\r\n\t\t\ttry {\r\n\t\t\t\tconn = DriverManager.getConnection(\"jdbc:mysql://localhost/sims?user=root&password=12345&useSSL=true\");\r\n\t\t\t} catch (Exception e) {\r\n\t\t\t\te.printStackTrace();\r\n\t\t\t}\r\n\t}", "public void connectToDatabase(){\n\t\ttry{\n\t\t connection = DriverManager.getConnection(dbConfig.getUrl(), dbConfig.getUser(), dbConfig.getPassword());\n\t\t System.out.println(\"Successfully connected to database.\");\n\t\t} catch (Exception e){\n\t\t\tSystem.out.println(\"An error occurred while attempting to connect to the database.\");\n\t\t\te.printStackTrace();\n\t\t\tSystem.exit(1);\n\t\t}\n\t}", "public DBConnection() {\n this(DB_USER, DB_PASSWORD, DB_NAME, DB_HOST, DB_PORT);\n }" ]
[ "0.7803248", "0.74803275", "0.7296866", "0.7135515", "0.7062728", "0.70411915", "0.7033728", "0.7022772", "0.7020117", "0.69946027", "0.69812924", "0.6952477", "0.6948292", "0.6905006", "0.68529797", "0.68155587", "0.68063784", "0.67627853", "0.67054737", "0.6594775", "0.6571698", "0.65550435", "0.65491635", "0.65421796", "0.652093", "0.64933455", "0.6410207", "0.6360515", "0.63386047", "0.62827337", "0.62668324", "0.62545115", "0.624402", "0.62306345", "0.6199876", "0.61718595", "0.61691695", "0.61411697", "0.61398464", "0.6053976", "0.6053085", "0.6052144", "0.600964", "0.59966105", "0.5976392", "0.59569585", "0.5953359", "0.5935063", "0.5910148", "0.5909724", "0.58902705", "0.5889109", "0.58789533", "0.5852856", "0.58524954", "0.58409274", "0.58191514", "0.58002377", "0.5765331", "0.57337475", "0.5713218", "0.570115", "0.56790406", "0.56721157", "0.56677204", "0.56638324", "0.5656605", "0.56462246", "0.5640466", "0.5634259", "0.56223166", "0.5612166", "0.5601817", "0.5599856", "0.5599644", "0.5596698", "0.5596513", "0.558752", "0.55824", "0.55807686", "0.55712664", "0.55705816", "0.55388755", "0.5530663", "0.55155605", "0.551255", "0.5492043", "0.5490533", "0.54720336", "0.5471527", "0.5470027", "0.5462949", "0.54619795", "0.54492843", "0.54252225", "0.54234916", "0.5420524", "0.54200536", "0.5404636", "0.5398112" ]
0.562891
70
destroy note:main merthod is not a servlet life cycle method ,main method is not require in servlet programming servlet programming in main method is not executed...because of , it is not a servlet life cycle method.
public static void main(String[] args){ System.out.println("main method(-)"); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void destroy() {\n\t\tsuper.destroy(); \n\t\tSystem.out.println(\"=====destory servlet=========\");\n\t}", "@Override\r\n\tpublic void destroy() {\n\t\tSystem.out.println(\"second servlet destory\");\r\n\t}", "@Override\n\tpublic void destroy() {\n\t\t// TODO Auto-generated method stub\n\t\tsuper.destroy();\n\t\tSystem.out.println(\"Servlet Destroy Call\");\n\t}", "@Override\n\tpublic void destroy() {\n\t\tsuper.destroy();\n\t\tSystem.out.println(\"Destory LoginServlet\");\n\t}", "public final void destroy()\n {\n log.info(\"PerformanceData Servlet: Done shutting down!\");\n }", "public static void destroy() {\n\t}", "public void destroy()\r\n\t{\r\n\t\tlog.fine(\"destroy\");\r\n\t}", "public void destroy() {\n\t\t\n\t}", "public void destroy() {\n\t\t\n\t}", "public void destroy() {\n\t\t\n\t}", "public void destroy() {\n\t\t\n\t}", "public void destroy() {\n\t\t\n\t}", "public void destroy() {\n\t\t\n\t}", "public void destroy()\r\n\t{\n\t\t\r\n\t}", "public void destroy()\n\t{\n\t}", "public void destroy() {\r\n\r\n\t}", "public void destroy() {\n \t\n }", "public void destroy() {\n\n\t}", "public void destroy() {\n\n\t}", "public void destroy() {\n\n\t}", "public void destroy() {\n\n\t}", "public void destroy() {\n\n\t}", "public void destroy() {\n\n\t}", "public void destroy() {\n\t\t\r\n\t}", "public void destroy() {\n\t\t\r\n\t}", "public void destroy() {\n\t\t\r\n\t}", "public void destroy() {\n\t\t\r\n\t}", "public void destroy()\r\n\t{\r\n\t}", "public void destroy() {\n\r\n\t}", "public void destroy() {\n\r\n\t}", "public void destroy() {\n\r\n\t}", "public void destroy() {\n\r\n\t}", "public void destroy() {\n\r\n\t}", "public void destroy() {\n\t}", "public void destroy() {\n\t}", "public void destroy() {\n\t}", "public void destroy() {\n\t}", "public void destroy() {\n\t}", "public void destroy() {\n\t}", "public void destroy() {\n\t}", "public void destroy() {\n\t}", "public void destroy() {\n\t}", "public void destroy() {\n\t}", "public void destroy() {\n\t}", "public void destroy() {\n\t}", "public void destroy() {\n\t}", "public void destroy() {\n\t}", "public void destroy() {\n\t}", "public void destroy()\r\n {\r\n }", "public void destroy()\r\n {\n }", "public void destroy() {\r\n }", "public void destroy() {\n }", "public void destroy() {\n }", "public void destroy() {\n }", "public void destroy() {\n }", "public void destroy() {\n }", "public void destroy() {\n }", "public void destroy() {\n }", "public void destroy() {\n }", "public void destroy() {\n }", "public void destroy() {\n }", "public void destroy() {\n }", "public void destroy() {\n }", "public void destroy() {\n }", "public void destroy()\n\t{\n\t\tM_log.info(\"destroy()\");\n\t}", "public void destroy() {\n }", "@Override\r\n\tpublic void destroy() {\r\n\t\tsuper.destroy(); // Just puts \"destroy\" string in log\r\n\t\t// Put your code here\r\n\t}", "public void destroy() {\r\n\t\tsuper.destroy(); // Just puts \"destroy\" string in log\r\n\t\t// Put your code here\r\n\t}", "public void destroy() {\r\n\t\tsuper.destroy(); // Just puts \"destroy\" string in log\r\n\t\t// Put your code here\r\n\t}", "public void destroy() {\r\n\t\tsuper.destroy(); // Just puts \"destroy\" string in log\r\n\t\t// Put your code here\r\n\t}", "public void destroy() {\r\n\t\tsuper.destroy(); // Just puts \"destroy\" string in log\r\n\t\t// Put your code here\r\n\t}", "public void destroy() {\r\n\t\tsuper.destroy(); // Just puts \"destroy\" string in log\r\n\t\t// Put your code here\r\n\t}", "public void destroy() {\r\n\t\tsuper.destroy(); // Just puts \"destroy\" string in log\r\n\t\t// Put your code here\r\n\t}", "public void destroy() {\r\n\t\tsuper.destroy(); // Just puts \"destroy\" string in log\r\n\t\t// Put your code here\r\n\t}", "public void destroy() {\r\n\t\tsuper.destroy(); // Just puts \"destroy\" string in log\r\n\t\t// Put your code here\r\n\t}", "public void destroy() {\r\n\t\tsuper.destroy(); // Just puts \"destroy\" string in log\r\n\t\t// Put your code here\r\n\t}", "public void destroy() {\r\n\t\tsuper.destroy(); // Just puts \"destroy\" string in log\r\n\t\t// Put your code here\r\n\t}", "public void destroy() {\r\n\t\tsuper.destroy(); // Just puts \"destroy\" string in log\r\n\t\t// Put your code here\r\n\t}", "public void destroy() {\r\n\t\tsuper.destroy(); // Just puts \"destroy\" string in log\r\n\t\t// Put your code here\r\n\t}", "public void destroy() {\r\n\t\tsuper.destroy(); // Just puts \"destroy\" string in log\r\n\t\t// Put your code here\r\n\t}", "public void destroy() {\r\n\t\tsuper.destroy(); // Just puts \"destroy\" string in log\r\n\t\t// Put your code here\r\n\t}", "public void destroy() {\r\n\t\tsuper.destroy(); // Just puts \"destroy\" string in log\r\n\t\t// Put your code here\r\n\t}", "public void destroy() {\r\n\t\tsuper.destroy(); // Just puts \"destroy\" string in log\r\n\t\t// Put your code here\r\n\t}", "public void destroy() {\r\n\t\tsuper.destroy(); // Just puts \"destroy\" string in log\r\n\t\t// Put your code here\r\n\t}", "public void destroy() {\r\n\t\tsuper.destroy(); // Just puts \"destroy\" string in log\r\n\t\t// Put your code here\r\n\t}", "public void destroy() {\r\n\t\tsuper.destroy(); // Just puts \"destroy\" string in log\r\n\t\t// Put your code here\r\n\t}", "public void destroy() {\r\n\t\tsuper.destroy(); // Just puts \"destroy\" string in log\r\n\t\t// Put your code here\r\n\t}", "public void destroy() {\r\n\t\tsuper.destroy(); // Just puts \"destroy\" string in log\r\n\t\t// Put your code here\r\n\t}", "public void destroy() {\r\n\t\tsuper.destroy(); // Just puts \"destroy\" string in log\r\n\t\t// Put your code here\r\n\t}", "public void destroy() {\r\n\t\tsuper.destroy(); // Just puts \"destroy\" string in log\r\n\t\t// Put your code here\r\n\t}", "public void destroy() {\r\n\t\tsuper.destroy(); // Just puts \"destroy\" string in log\r\n\t\t// Put your code here\r\n\t}", "public void destroy() {}", "public void destroy() {}", "public void destroy() {\n \n }", "public void destroy() {\n\t\tsuper.destroy(); // Just puts \"destroy\" string in log\n\t\t// Put your code here\n\t}", "public void destroy() {\n\t\tsuper.destroy(); // Just puts \"destroy\" string in log\n\t\t// Put your code here\n\t}", "public void destroy() {\n\t\tsuper.destroy(); // Just puts \"destroy\" string in log\n\t\t// Put your code here\n\t}", "public void destroy() {\n\t\tsuper.destroy(); // Just puts \"destroy\" string in log\n\t\t// Put your code here\n\t}", "public void destroy() {\n\t\tsuper.destroy(); // Just puts \"destroy\" string in log\n\t\t// Put your code here\n\t}", "public void destroy() {\n\t\tsuper.destroy(); // Just puts \"destroy\" string in log\n\t\t// Put your code here\n\t}", "public void destroy() {\n\t\tsuper.destroy(); // Just puts \"destroy\" string in log\n\t\t// Put your code here\n\t}" ]
[ "0.8398446", "0.805583", "0.8053632", "0.7605024", "0.747721", "0.7195919", "0.7072218", "0.70531094", "0.70531094", "0.70531094", "0.70531094", "0.70531094", "0.70531094", "0.7045484", "0.704093", "0.704069", "0.70284116", "0.70225775", "0.70225775", "0.70225775", "0.70225775", "0.70225775", "0.70225775", "0.70120585", "0.70120585", "0.70120585", "0.70120585", "0.70100254", "0.6997613", "0.6997613", "0.6997613", "0.6997613", "0.6997613", "0.6959602", "0.6959602", "0.6959602", "0.6959602", "0.6959602", "0.6959602", "0.6959602", "0.6959602", "0.6959602", "0.6959602", "0.6959602", "0.6959602", "0.6959602", "0.6959602", "0.6959602", "0.6919883", "0.69183874", "0.6915722", "0.6893738", "0.6893738", "0.6870205", "0.6870205", "0.6870205", "0.6870205", "0.6870205", "0.6870205", "0.6870205", "0.6870205", "0.6870205", "0.6870205", "0.6870205", "0.6857818", "0.6851609", "0.6846545", "0.6829947", "0.6829947", "0.6829947", "0.6829947", "0.6829947", "0.6829947", "0.6829947", "0.6829947", "0.6829947", "0.6829947", "0.6829947", "0.6829947", "0.6829947", "0.6829947", "0.6829947", "0.6829947", "0.6829947", "0.6829947", "0.6829947", "0.6829947", "0.6829947", "0.6829947", "0.6829947", "0.6829947", "0.6826647", "0.6826647", "0.6816445", "0.6812697", "0.6812697", "0.6812697", "0.6812697", "0.6812697", "0.6812697", "0.6812697" ]
0.0
-1
Constructor for the duke.tasks.Task object, which is not used due to the further categorization of duke.tasks.Task objects into the inherited duke.tasks.ToDo, duke.tasks.Event and duke.tasks.Deadline objects that extend the duke.tasks.ToDo Object.
public Task(String description) { this.description = description.trim(); this.isDone = false; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public Todo(String task) {\n super(task);\n }", "public Task() {\n\t}", "public Task(){\n super();\n }", "public Task(Task task) {\n id = task.id;\n taskType = task.taskType;\n title = task.title;\n period = task.period;\n deadline = task.deadline;\n wcet = task.wcet;\n //execTime = task.execTime;\n priority = task.priority;\n initialOffset = task.initialOffset;\n nextReleaseTime = task.nextReleaseTime;\n isSporadicTask = task.isSporadicTask;\n }", "public Task() {\r\n }", "public Task(){}", "public Tasks() {\n }", "public ToDoTask(String description, int id) {\n super(description, id);\n }", "public Task(Task T){\n\n\t\tcmd = T.cmd;\n\t\ttasknum = T.tasknum;\n\t\tterminated = T.terminated;\n\t\tcycle_term = T.cycle_term;\n\t\taborted = T.aborted;\n\t\twaiting = T.waiting;\n\t\ttime_wait = T.time_wait;\n\t\trunning = T.running;\n\n\t\tfor (int i = 0; i < T.actions.size(); i++){\n\n\t\t\tactions.add(T.actions.get(i));\n\t\t\tres_needed.add(T.res_needed.get(i));\n\t\t\treq_num.add(T.req_num.get(i));\n\t\t}\n\n\t\tfor(int i = 0; i < T.claims.size(); i++){\n\n\t\t\tclaims.add(T.claims.get(i));\n\t\t\tallocation.add(T.allocation.get(i));\n\t\t}\n\n\t}", "public Task() { }", "public Task(String taskName, String dueDate)\r\n {\r\n this.dueDate=dueDate;\r\n this.taskName=taskName;\r\n }", "public Task(Task task) {\r\n\t\tthis.id = task.id;\r\n\t\tthis.description = task.description;\r\n\t\tthis.processor = task.processor;\r\n\t\tthis.status = task.status;\r\n\r\n\t\tthis.dueDate = new GregorianCalendar(task.dueDate.get(GregorianCalendar.YEAR), \r\n\t\t\t\ttask.dueDate.get(GregorianCalendar.MONTH), \r\n\t\t\t\ttask.dueDate.get(GregorianCalendar.DAY_OF_MONTH));\r\n\r\n\t\tSimpleDateFormat sdf = new SimpleDateFormat(\"dd.MM.yyyy\");\r\n\t\tthis.formatedDueDate = sdf.format(dueDate.getTime());\r\n\t\tthis.next = task.next;\r\n\t}", "public Task(String task, Date dueDate) {\n this.task = task;\n this.dueDate = dueDate;\n }", "public ScheduledToDoTask(ToDoTask inTask, Duration inDur) {\n\t\tthis(inTask.getName(), inTask.getCategory(), inDur);\n\t}", "public Task() {\n }", "public Task(String description) {\n this.description = description;\n this.isDone = false;\n this.taskType = \"\";\n }", "public TaskDefinition() {\n\t\tthis.started = Boolean.FALSE; // default\n\t\tthis.startTime = new Date(); // makes it easier during task creation\n\t\t// as we have a default date populated\n\t\tthis.properties = new HashMap<>();\n\t}", "public Task(String name) {\r\n this(name, false);\r\n }", "public Task(String taskDescription) {\n this.taskDescription = taskDescription;\n this.isDone = false;\n this.completed = \"0\";\n }", "protected TaskFlow( ) { }", "public StudentTask() {\n\t\tthis(\"student_task\", null);\n\t}", "public TaskList(){}", "private TaskItem()\n {\n }", "protected Task(String description) {\n this.description = description;\n this.isComplete = false;\n this.tags = new ArrayList<>();\n }", "public Task(String description){\n this.description = description;\n this.isDone = false;\n }", "public Task(String description){\n this.description = description;\n this.isDone = false;\n }", "public Task(String taskDescription) {\n this.taskDescription = taskDescription;\n this.isDone = false;\n }", "public Task(String creator) {\r\n \t\tthis(creator, \"Untitled\", \"\", true, false);\r\n \t}", "public TimedTask(String task) {\n this.task = task;\n timeStart = System.currentTimeMillis();\n }", "public TaskList() {\n }", "public CompletedTask(Task task, String date)\r\n\t{\r\n\t\tsuper(task.ID, task.description, task.priority, task.order, STATUS_COMPLETE);\r\n\t\tthis.date = date;\r\n\t}", "public ToDoTask(String description, int id, int status) {\n super(description, id);\n super.isDone = status > 0;\n }", "public Task(String task, boolean isDone, Date dueDate) {\n this.task = task;\n this.isDone = isDone;\n this.dueDate = dueDate;\n }", "public Task(String description) {\n this.description = description;\n this.isDone = false;\n }", "public Task(String description) {\n this.description = description;\n this.isDone = false;\n }", "public TaskCurrent() {\n\t}", "public JBombardierAntTask(Task owner) {\r\n bindToOwner(owner);\r\n }", "public Task(String description) {\n this.description = description;\n this.isDone = false;\n this.tag = \"\";\n }", "public Task(String task, boolean isDone) {\n this.task = task;\n this.isDone = isDone;\n }", "public ServiceTask() {\n\t}", "public Task(String description) {\n\n this.description = description;\n this.isDone = false;\n taskCounter++;\n }", "public Task(String name) {\n\t\tthis.name=name;\n\t}", "public MemberTask(TaskName taskName, Project project, Progress progress) {\n super(taskName, null, project, progress );\n }", "Task(String name) {\n this.name = name;\n }", "public AddTasks() {\n }", "public Task(String original) {\n this(original, null);\n }", "public TaskList() {\n tasks = new ArrayList<>();\n }", "public TaskList() {\n tasks = new ArrayList<>();\n }", "public TaskList() {\n tasks = new ArrayList<>();\n }", "private Task makeTask(String taskType, Optional<String> taskDescription, \r\n Optional<LocalDateTime> taskDeadline, \r\n Optional<LocalDateTime> taskStartDateTime,\r\n Optional<LocalDateTime> taskEndDateTime) {\r\n \r\n Task task;\r\n \r\n if (taskDescription.get().isBlank()) {\r\n throw new InvalidTaskArgumentException(\r\n MESSAGE_ADD_COMMAND_INVALID_TASK_DESCRIPTION);\r\n }\r\n \r\n switch(taskType) {\r\n case \"todo\": \r\n task = new ToDos(TaskList.taskIdCounter, taskDescription.get());\r\n break;\r\n case \"deadline\":\r\n if (taskDeadline.isEmpty()) {\r\n throw new InvalidTaskArgumentException(\r\n MESSAGE_ADD_COMMAND_INVALID_TASK_REQUIREMENT_DEADLINES);\r\n }\r\n \r\n task = new Deadlines(TaskList.taskIdCounter, taskDescription.get(), \r\n taskDeadline.get()); \r\n break;\r\n case \"event\":\r\n if (taskStartDateTime.isEmpty() || taskEndDateTime.isEmpty()) {\r\n throw new InvalidTaskArgumentException(\r\n MESSAGE_ADD_COMMAND_INVALID_TASK_REQUIREMENT_EVENTS);\r\n }\r\n task = new Events(TaskList.taskIdCounter, taskDescription.get(), \r\n taskStartDateTime.get(), taskEndDateTime.get());\r\n break;\r\n default:\r\n throw new InvalidTaskArgumentException(MESSAGE_INVALID_TASK_TYPE);\r\n }\r\n return task;\r\n }", "public BuildEvent(Task task) {\n super(task);\n this.workspace = task.getProject().getWorkspace();\n this.project = task.getProject();\n this.target = task.getTarget();\n this.task = task;\n }", "public Task(String description) {\n this.description = description;\n this.isDone = false;\n this.logo = \"N\";\n }", "protected TaskChain() {\n\t}", "private Tasks createNoKeywordTask(Tasks task, String descriptionOfTask, ArrayList<String> timeArray,\n int numberOfArguments) {\n if (numberOfArguments == 1 || numberOfArguments == 2) { //deadline tasks\n task = createDeadlineTask(task, descriptionOfTask, timeArray);\n } else { //duration tasks\n task = createDurationTask(task, descriptionOfTask, timeArray);\n }\n return task;\n }", "protected Task(String s) {\n title = s;\n status = \"\\u2717\"; // A cross symbol indicating the task has not been done.\n }", "public Task(String description) {\n this.description = description;\n this.isDone = false;\n this.tag = \"\";\n this.isTagged = false;\n }", "public Task(String name) {\n this.name = name;\n this.isDone = false;\n }", "public Task(String name, int number) {\r\n this.name = name;\r\n this.id = number;\r\n this.timer = new Timer();\r\n }", "public TaskAdapter(List<Task> taskList) {\n this.taskList = taskList;\n }", "public TaskList(List<Task> tl) {\n tasks = tl;\n }", "public XmlAdaptedTask() {\n\t}", "private Task createTaskFromGivenArgs(Name name, TaskDate taskStartDate, TaskDate taskEndDate, Status taskStatus) {\n\t if (isEventTask(taskStartDate, taskEndDate)) {\n\t return new EventTask(name, taskStartDate, taskEndDate, taskStatus);\n\t }\n\t if (isDeadline(taskEndDate)) {\n\t return new DeadlineTask(name, taskEndDate, taskStatus);\n\t }\n\t return new Task(name, taskStatus);\n\t}", "public Tasks(String name, String subject, Date dueOnDate) {\n this(name, subject, dueOnDate, 1, 3, false, 0, null);\n }", "public Tasks(int id,String des, String type) {\n this.id = id;\n this.des = des;\n this.type = type;\n isChecked = false;\n }", "public TaskList() {\n tasks = new ArrayList<>();\n cachedTasks = new Stack<>();\n }", "public Task(String description, LocalDate date) {\n this.description = description;\n isDone = false;\n this.date = date;\n }", "public Task(DateTime deadline, String name, int priority) {\r\n\t\tthis.deadline = deadline;\r\n\t\tthis.name = name;\r\n\t\tthis.priority = priority;\r\n\t\tstart = new DateTime();\r\n\t}", "public Task(String creator, String name, String description,\r\n \t\t\tboolean requiresText, boolean requiresPhoto) {\r\n \r\n\t\t_creationDate = new SimpleDateFormat(\"MMM dd, yyyy | HH:mm\").format(Calendar\r\n \t\t\t\t.getInstance().getTime());\r\n\t\t\r\n\t\t// Store date as hex string with hex prefix.\r\n\t\t_dateHex = \"0x\" + Long.toHexString(Calendar.getInstance().getTimeInMillis());\r\n \r\n \t\t_creator = creator;\r\n \t\t_name = name;\r\n \t\t_requiresText = requiresText;\r\n \t\t_requiresPhoto = requiresPhoto;\r\n \t\t_fulfilled = false;\r\n \r\n \t\t_photos = new ArrayList<PhotoRequirement>();\r\n \t}", "public Task makeTask() {\n Task new_task = new Task();\n new_task.setAction(this);\n new_task.setDeadline(\n new Date(System.currentTimeMillis() + deadlineSeconds() * 1000L));\n\n return new_task;\n }", "public DoneUndefinedTaskException() {\n }", "public Task(Task source) {\n if (source.Application != null) {\n this.Application = new Application(source.Application);\n }\n if (source.TaskName != null) {\n this.TaskName = new String(source.TaskName);\n }\n if (source.TaskInstanceNum != null) {\n this.TaskInstanceNum = new Long(source.TaskInstanceNum);\n }\n if (source.ComputeEnv != null) {\n this.ComputeEnv = new AnonymousComputeEnv(source.ComputeEnv);\n }\n if (source.EnvId != null) {\n this.EnvId = new String(source.EnvId);\n }\n if (source.RedirectInfo != null) {\n this.RedirectInfo = new RedirectInfo(source.RedirectInfo);\n }\n if (source.RedirectLocalInfo != null) {\n this.RedirectLocalInfo = new RedirectLocalInfo(source.RedirectLocalInfo);\n }\n if (source.InputMappings != null) {\n this.InputMappings = new InputMapping[source.InputMappings.length];\n for (int i = 0; i < source.InputMappings.length; i++) {\n this.InputMappings[i] = new InputMapping(source.InputMappings[i]);\n }\n }\n if (source.OutputMappings != null) {\n this.OutputMappings = new OutputMapping[source.OutputMappings.length];\n for (int i = 0; i < source.OutputMappings.length; i++) {\n this.OutputMappings[i] = new OutputMapping(source.OutputMappings[i]);\n }\n }\n if (source.OutputMappingConfigs != null) {\n this.OutputMappingConfigs = new OutputMappingConfig[source.OutputMappingConfigs.length];\n for (int i = 0; i < source.OutputMappingConfigs.length; i++) {\n this.OutputMappingConfigs[i] = new OutputMappingConfig(source.OutputMappingConfigs[i]);\n }\n }\n if (source.EnvVars != null) {\n this.EnvVars = new EnvVar[source.EnvVars.length];\n for (int i = 0; i < source.EnvVars.length; i++) {\n this.EnvVars[i] = new EnvVar(source.EnvVars[i]);\n }\n }\n if (source.Authentications != null) {\n this.Authentications = new Authentication[source.Authentications.length];\n for (int i = 0; i < source.Authentications.length; i++) {\n this.Authentications[i] = new Authentication(source.Authentications[i]);\n }\n }\n if (source.FailedAction != null) {\n this.FailedAction = new String(source.FailedAction);\n }\n if (source.MaxRetryCount != null) {\n this.MaxRetryCount = new Long(source.MaxRetryCount);\n }\n if (source.Timeout != null) {\n this.Timeout = new Long(source.Timeout);\n }\n if (source.MaxConcurrentNum != null) {\n this.MaxConcurrentNum = new Long(source.MaxConcurrentNum);\n }\n if (source.RestartComputeNode != null) {\n this.RestartComputeNode = new Boolean(source.RestartComputeNode);\n }\n if (source.ResourceMaxRetryCount != null) {\n this.ResourceMaxRetryCount = new Long(source.ResourceMaxRetryCount);\n }\n }", "public interface Task {\n\n /**\n * Getter for the conversaitonal object concerned with this task.\n * @return the conversational object owning this task\n */\n ConversationalObject getTaskOwner();\n\n /**\n * Stter for the conversaitonal object concerned with this task.\n * @param taskOwner the task owner to set.\n */\n void setTaskOwner(ConversationalObject taskOwner);\n\n /**\n * Getter for the status of this task\n * @return the current status of this task\n */\n TaskStatus getStatus();\n\n /**\n * Setter for the status of this task\n * @param status\n */\n void setStatus(TaskStatus status);\n\n /**\n * Getter for the stage of this task. It is strongly recomended that concrete\n * task classes declare static final string variables to refer to there\n * possible stages.\n * @return The current stage of this task\n */\n String getStage();\n\n /**\n * Getter for the result of this task.\n * @return the result of this task, or {@code null} if the task is not\n * finished.\n */\n TaskResult getResult();\n\n /**\n * Getter for the set of tasks that depend from this task\n * @return The set of dependent tasks (can be null)\n */\n Set<Task> getDependentTasks();\n\n /**\n * Setter for the set of tasks that depend from this task\n * @param dependentTasks the set of dependent tasks to set\n */\n void setDependentTasks(Set<Task> dependentTasks);\n\n /**\n * Getter for the aggregated task this task has generated and is dependent on.\n * @return The aggregated task, if any (can be null)\n */\n Task getAggregatedTask();\n\n /**\n * Setter for the aggregated task this task has generated and is dependent on.\n * @param aggregatedTask the aggregated task to set\n */\n void setAggregatedTask(Task aggregatedTask);\n\n // TODO Other references could be added to extend the tasks model: e.g.\n // (1) subtasks: list of tasks composing this task, i.e. that should be\n // executed\n // in sequence in order to complete this task, and\n // (2) supertask: reversely, task this task is a subtask of.\n\n /**\n * Getter for the set of conversations this task generated and is now\n * dependent on.\n * @return the set of generated conversations\n */\n Set<OnGoingConversation> getGeneratedConversations();\n\n /**\n * Setter for generatedConversations.\n * @param generatedConversations the set of generatedConversations to set\n */\n void setGeneratedConversations(\n Set<OnGoingConversation> generatedConversations);\n\n /**\n * Cuts all references to other objects so that the garbage collector can\n * destroy them after having destroyed this task, if they are not referenced\n * by other objects than this task. Should be executed before removing the\n * last reference to this task (usually before removing this task from the set\n * of tasks of a conversational object)\n */\n void clean();\n\n /**\n * Executes the task. Specific to each concrete task class.\n */\n void execute();\n}", "public AddCommand(Task task){\r\n this.task = task;\r\n }", "public TaskManager() {\n\t\tcompletedTasks = new ArrayList<Tasks>();\n\t}", "public Task(String description, boolean done) {\r\n this.description = description;\r\n this.isDone = done;\r\n }", "public Task(String taskName, int startHour, int startMinute, int finishHour, int finishMinute) {\n this.taskName = taskName;\n this.startHour = startHour;\n this.startMinute = startMinute;\n this.finishHour = finishHour;\n this.finishMinute = finishMinute;\n }", "Task createTask();", "Task createTask();", "Task createTask();", "@Override\n\tpublic Task constructInstance(Robot robot) {\n\t\treturn null;\n\t}", "protected abstract void createTasks();", "public TaskList() {\n recordedTask = new ArrayList<>();\n }", "public Task(String name, String category, Date start, Date end, Time s, Time e) throws Exception{\n\t\tthis.setName(name);\n\t\tthis.setCategory(category);\n\t\tthis.setEndDate(end);\n\t\tthis.setStartDate(start);\n\t\tthis.setStartTime(s);\n\t\tthis.setEndTime(e);\n\t\tsetIfOverdue();\n\t}", "public Task(String name, String first_category, String location, String note, Date start, Date end) throws Exception {\n\t\tthis.setName(name);\n\t\tthis.setCategory(first_category);\n\t\tthis.setLocation(location);\n\t\tthis.setNote(note);\n\t\tthis.setEndDate(end);\n\t\tthis.startdate = start;\n\t\tthis.setStartTime(new Time());\n\t\tthis.setEndTime(new Time(23, 59));\n\t\tsetIfOverdue();\n\t}", "public TaskList(ArrayList<Task> taskList) {\n this.taskList = taskList;\n }", "public Task(Name name, UniqueTagList tags) {\n assert !CollectionUtil.isAnyNull(name, tags);\n this.name = name;\n this.tags = tags;\n this.taskType = TaskType.FLOATING;\n this.recurringType = RecurringType.NONE;\n this.recurringDates = new ArrayList<TaskOccurrence>();\n this.recurringDates.add(new TaskOccurrence(this, new TaskDate(), new TaskDate()));\n this.recurringPeriod = NO_RECURRING_PERIOD;\n }", "public Task(String msg) {\n this.msg = msg;\n completed = false;\n }", "public XmlAdaptedTask() {}", "public XmlAdaptedTask() {}", "public Task(String name, String category, Date start, Date end) throws Exception{\n\t\tthis.setName(name);\n\t\tthis.setCategory(category);\n\t\tthis.setEndDate(end);\n\t\tthis.setStartDate(start);\n\t\tthis.setStartTime(new Time());\n\t\tthis.setEndTime(new Time(23, 59));\n\t\tsetIfOverdue();\n\t}", "public TaskBookBuilder addTypicalDeadlineTasks() {\n final TypicalDeadlineTasks tdt = new TypicalDeadlineTasks();\n return addDeadlineTasks(tdt.getDeadlineTasks());\n }", "public Task(boolean isDone, String description) {\n this.description = description;\n this.isDone = isDone;\n }", "private Task(Parcel in) {\n\t\tid = in.readInt();\n\t\tuser_id = in.readInt();\n\t\ttitle = in.readString();\n\t\tdescription = in.readString();\n\t\tdate = (Calendar) in.readSerializable();\n\t\tcreated_at = (Calendar) in.readSerializable();\n\t\tupdated_at = (Calendar) in.readSerializable();\n\t}", "public AddCommand(String taskType, Optional<String> taskDescription, \r\n Optional<LocalDateTime> taskDeadline) {\r\n \r\n this.taskType = taskType;\r\n this.taskDescription = taskDescription;\r\n this.taskDeadline = taskDeadline;\r\n this.taskStartDateTime = Optional.empty();\r\n this.taskEndDateTime = Optional.empty();\r\n this.task = makeTask(taskType, taskDescription, taskDeadline, \r\n taskStartDateTime, taskEndDateTime); \r\n }", "Task(String description, boolean isDone) throws DateTimeException {\n this.description = description;\n this.isDone = isDone;\n }", "public Todo(String description) {\n super(description);\n }", "public Todo(String description) {\n super(description);\n }", "public Todo(String description) {\n super(description);\n }", "private Tasks createDeadlineTaskForInputWithoutTime(Tasks task, String descriptionOfTask, String endDate) {\n if (checkValidDate(endDate)) {\n Duration deadline = new Duration(endDate, \"2359\");\n task = new DeadlineTask(descriptionOfTask, deadline);\n }\n return task;\n }", "public TaskList(ArrayList<Task> tasks) {\n this.tasks = tasks;\n }" ]
[ "0.7798826", "0.7686791", "0.75932825", "0.7561345", "0.74721617", "0.74660134", "0.74617827", "0.741621", "0.73519105", "0.73457736", "0.73338664", "0.7315318", "0.7310624", "0.72833925", "0.7261841", "0.72615945", "0.7238827", "0.72273725", "0.72263646", "0.7225733", "0.7203903", "0.7186301", "0.71615124", "0.7147731", "0.71318924", "0.71318924", "0.71091807", "0.7061552", "0.70591223", "0.7056652", "0.7038752", "0.69887614", "0.69834054", "0.6965534", "0.6965534", "0.693434", "0.6911604", "0.69105977", "0.69013345", "0.68713963", "0.6869155", "0.6866321", "0.6859752", "0.68515587", "0.683955", "0.68221956", "0.6821482", "0.6821482", "0.6821482", "0.6816277", "0.6792761", "0.67847025", "0.67833334", "0.67636865", "0.67353606", "0.67153966", "0.66784626", "0.6663113", "0.66531026", "0.6644321", "0.6615632", "0.6600139", "0.6595124", "0.6594954", "0.6591999", "0.65875804", "0.6587184", "0.65820634", "0.65706307", "0.6568018", "0.6566622", "0.65601176", "0.6559396", "0.6532778", "0.6532766", "0.6507167", "0.649831", "0.649831", "0.649831", "0.6496287", "0.64932156", "0.6485783", "0.6477554", "0.6461092", "0.6444359", "0.64386773", "0.6430311", "0.64226115", "0.64226115", "0.6418996", "0.64187706", "0.6414737", "0.6411465", "0.63957113", "0.6391084", "0.6390112", "0.6390112", "0.6390112", "0.63814485", "0.6380938" ]
0.6795121
50
Returns the icon of the task that represents whether the task is done or not. v represents the task being done. x represents the task being not done.
public String getStatusIcon() { return (isDone ? "v" : "x"); // returns ticks (v) and crosses (x) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public String getStatusIcon() {\n return (isDone ? \"X\" : \" \"); //mark done task with X\n }", "public String getStatusIcon() {\n return (isDone? \"v\" : \"x\");\n }", "private String getStatusIcon() {\n return this.isDone ? \"X\" : \"\";\n }", "protected String getStatusIcon() {\n return isDone ? \"x\" : \" \";\n }", "public String getStatusIcon() {\n return (isDone ? \"X\" : \" \");\n }", "private String getStatusIcon() {\n return (isDone ? \"+\" : \"-\");\n }", "public String getStatusIcon() {\n return (isDone ? \"[X]\" : \"[ ]\");\n }", "public String getStatusIcon() {\n return (isDone ? \"✓\" : \"✘\"); //return tick or X symbols\n }", "@Override\n public String getStatusIcon() {\n if (isDone) {\n return \"[X]\";\n } else {\n return \"[ ]\";\n }\n }", "public String getStatusIcon() {\n return (isDone ? \"/\" : \"X\"); // Return / or X symbols\n }", "public String getStatusIcon() {\n return isDone\n ? \"\\u2713\"\n : \"\\u2718\";\n }", "public String getStatusIcon(){\n return (isDone ? \"\\u2713\" : \"\\u2718\");\n }", "public String printDone(Task task) {\n return \"´ ▽ ` )ノ Nice! I've marked this task as done:\\n\"\n + \"[\" + task.getStatusIcon() + \"]\" + task.getDescription() + \"\\n\";\n }", "public String getStatusIcon() {\n return (isDone ? \"\\u2713\" : \"\\u2718\"); //return tick or X symbols\n }", "public String getStatusIcon() {\n return (isDone ? \"\\u2713\" : \"\\u2718\"); //return tick or X symbols\n }", "public String getStatusIcon() {\n return (isDone ? \"\\u2713\" : \"\\u2718\"); //return tick or X symbols\n }", "public String getStatusIcon() {\r\n return (isDone ? \"\\u2718\" : \" \");\r\n }", "public String completionIcon() {\n return completionStatus ? \"[X]\" : \"[-]\";\n }", "@Override\n public String toString() {\n return \"[\" + this.getStatusIcon() + \"] \" + this.taskDescription;\n }", "@Override\n public String toString() {\n return \"[\" + this.getStatusIcon() + \"] \" + this.taskDescription;\n }", "public String markDone() {\n this.isDone = true;\n return String.format(\"Nice! I've marked this task as done:\\n [X] %s\", this.description);\n }", "public String GiveTask(){\n return \"[\" + getStatusIcon() + \"] \" + this.description;\n }", "private static String getStatus(Task task) {\n Status myStatus = task.getStatus();\n if (myStatus == Status.UP_NEXT) {\n return \"UP_NEXT\";\n } else if (myStatus == Status.IN_PROGRESS) {\n return \"IN_PROGRESS\";\n } else {\n return myStatus.toString();\n }\n }", "public String getDone() {\n return (isDone ? \"1\" : \"0\");\n }", "public void verifyDefaultStatusTrashToDoIcon() {\n try {\n waitForVisibleElement(trashToDoBtnEle, \"Trash ToDo icon\");\n validateAttributeElement(trashToDoBtnEle, \"class\", \"fa fa-trash disabled\");\n NXGReports.addStep(\"Verify default status trash ToDo icon\", LogAs.PASSED, null);\n } catch (AssertionError e) {\n AbstractService.sStatusCnt++;\n NXGReports.addStep(\"TestScript Failed: Verify default status trash ToDo icon\", LogAs.FAILED,\n new CaptureScreen(CaptureScreen.ScreenshotOf.BROWSER_PAGE));\n }\n }", "public String getIsDone() {\n if (isDone) {\n return \"1\";\n } else {\n return \"0\";\n }\n }", "public String showDone(Task t) {\n String doneMessage = \"YEEEEE-HAW!!! You've completed this task!\\n\" + t;\n return doneMessage;\n }", "public String determineTaskDoneStatusFromFileLine(String line) {\n int indexOfFirstSquareBracket = line.indexOf(\"[\");\n String doneStatus = String.valueOf(line.charAt(indexOfFirstSquareBracket + 1));\n assert (doneStatus.equals(\"V\") || doneStatus.equals(\"X\")) : \"Done status can only be X or V\";\n return doneStatus;\n }", "boolean hasIcon();", "boolean hasIcon();", "@Override\n public String toString() {\n return \"[\" + (isDone ? \"X\" : \" \") + \"] \" + description;\n }", "public String showDone(Task task) {\n String response = \"\";\n response += showLine();\n response += \"Nice! I've marked this task as done:\" + System.lineSeparator();\n response += \" \" + task + System.lineSeparator();\n response += showLine();\n return response;\n }", "public void verifyTrashToDoIcon() {\n try {\n waitForVisibleElement(trashToDoBtnEle, \"Trash ToDo icon\");\n NXGReports.addStep(\"Verify trash ToDo icon\", LogAs.PASSED, null);\n } catch (AssertionError e) {\n AbstractService.sStatusCnt++;\n NXGReports.addStep(\"TestScript Failed: Verify trash ToDo icon\", LogAs.FAILED, new CaptureScreen(CaptureScreen.ScreenshotOf.BROWSER_PAGE));\n }\n }", "public Task markAsDone() {\n isDone = true;\n status = \"\\u2713\"; // A tick symbol indicating the task is done.\n\n return this;\n }", "public WebElement getToDoSaveIconEle() {\n return toDoSaveIconEle;\n }", "public String markAsDone() {\n this.isComplete = true;\n return Ui.getTaskDoneMessage(this);\n }", "@Nullable\n @Override\n public Icon getIcon(boolean unused) {\n return ToolkitIcons.METHOD.get(method);\n }", "public String pendingToString() {\n InterruptibleTask interruptibleTask = this.task;\n if (interruptibleTask == null) {\n return super.pendingToString();\n }\n StringBuilder stringBuilder = new StringBuilder(\"task=[\");\n stringBuilder.append(interruptibleTask);\n stringBuilder.append(\"]\");\n return stringBuilder.toString();\n }", "ITaskView getTaskView();", "public String markAsDone(int index) {\n USER_TASKS.get(index).markAsDone();\n return \" \" + USER_TASKS.get(index).toString();\n }", "public String done(int i) {\n tasks.get(i - 1).setDone(true);\n return tasks.get(i - 1).toString();\n }", "public Icon apply(V v) {\n if (pi.isPicked(v))\n return picked_icon;\n else\n return icon;\n\t}", "@Override\n public String toString()\n {\n\n // IF TASK IS MARKED AS COMPLETE\n if(task_completion_boolean)\n {\n // IF THERE'S NO TASK DESCRIPTION\n if(task_description.isBlank() || task_description.equals(null))\n {\n return \"*** \" + String.format(\"[%s] %s\", task_due_date, task_title);\n } // END if\n\n return \"*** \" + String.format(\"[%s] %s | %s\", task_due_date, task_title, task_description);\n } // END if\n\n /***********************************************************/\n\n // OTHERWISE, TASK IS NOT COMPLETE\n else\n {\n // IF THERE'S NO TASK DESCRIPTION\n if(task_description.isBlank() || task_description.equals(null))\n {\n return String.format(\"[%s] %s\", task_due_date, task_title);\n } // END if\n\n return String.format(\"[%s] %s | %s\", task_due_date, task_title, task_description);\n } // END else\n\n }", "AsyncImageView getIconView();", "public static boolean toggleComplete(Task task) {\n Boolean complete = task.getCompleted(); // Get the current value\n\n // TOGGLE COMPLETE\n if (complete) // store the opposite of the current value\n complete = false;\n else\n complete = true;\n try{\n String query = \"UPDATE TASK SET ISCOMPLETE = ? WHERE (NAME = ? AND COLOUR = ? AND DATE = ?)\"; // Setup query for task\n PreparedStatement statement = DatabaseHandler.getConnection().prepareStatement(query); // Setup statement for query\n statement.setString(1, complete.toString()); // Store new isCompleted value\n statement.setString(2, task.getName()); // store values of task\n statement.setString(3, task.getColor().toString());\n statement.setString(4, Calendar.selectedDay.getDate().toString());\n int result = statement.executeUpdate(); // send out the statement\n if (result > 0){ // If swapped successfully, re-load the tasks\n getMainController().loadTasks(); // Reload the task list to update the graphics.\n }\n return (result > 0);\n } catch (SQLException e) {\n e.printStackTrace(); // If task was unable to be edited\n e.printStackTrace(); // Create alert for failing to edit\n Alert alert = new Alert(Alert.AlertType.ERROR);\n alert.setHeaderText(null);\n alert.setContentText(\"Unable to edit task.\");\n alert.showAndWait();\n }\n return false;\n }", "private void updateTask(ICompositeCheatSheetTask task) {\n \t\tif (task==null || task != selectedTask) return;\n \t\tif ( task instanceof EditableTask) {\n \t\t\tEditableTask editable = (EditableTask)task;\n \t\t\tif (editable.getState() == ICompositeCheatSheetTask.IN_PROGRESS) {\n \t\t\t\tshowEditor(editable);\n \t\t\t\treturn;\n \t\t\t} else if (editable.isUnderReview()) {\n \t\t\t\tif (editable.getState() == ICompositeCheatSheetTask.COMPLETED) {\n \t\t\t\t\tshowEditor(editable);\n \t\t\t\t} else {\n \t\t\t\t\tendReview(editable);\n \t\t\t\t}\n \t\t\t\treturn;\n \t\t\t}\n \t\t} \n \t\tshowDescription(task);\n \t}", "public static String obtenerIconoDelJuego(){\n return direccionIcono;\n }", "public String getStatus() {\n return isDone ? \"1\" : \"0\";\n }", "public String getIcon() {\n return icon;\n }", "public String getIcon() {\n return icon;\n }", "public String getIcon() {\n return icon;\n }", "public String getIcon() {\n return icon;\n }", "Icon getIcon();", "TaskStatus getStatus();", "public String tempIcon() {\n float tCode = 0;\n String tempIcon = \" \";\n if (readings.size() > 0) {\n tCode = readings.get(readings.size() - 1).temperature;\n if (tCode >= 11) {\n tempIcon = \"huge red temperature high icon\";\n } else if (tCode <= 10.99) {\n tempIcon = \"huge blue temperature low icon\";\n } else {\n tempIcon = \"huge temperature low icon\";\n }\n }\n return tempIcon;\n }", "public void onTaskComplete(){\n findViewById(R.id.downloadend).setVisibility(View.VISIBLE);\n findViewById(R.id.finito).setBackgroundResource(R.drawable.ok);\n }", "public Drawable getIcon(Drawable placeholder)\n\t{\n\t\tsynchronized (mCache) {\n\t\t\tmIcon = mCache.get(getSign());\n\t\t}\n\t\tif(mIcon != null)\n\t\t\treturn mIcon;\n\t\tmExecutor.execute(mTask);\n\t\t\n\t\treturn placeholder;\n\t}", "public boolean getDoneStatus(){\n return isDone;\n }", "@Override\n public String executeAndReturnMessage(TaskList tasks, Ui ui, Storage storage) throws DukeException {\n if (doIndex <= 0 || doIndex > tasks.getNumOfTasks()) {\n throw new DukeException(\"The specified task number does not exist!\");\n }\n\n Task chosenTask = tasks.getTask(doIndex - 1);\n chosenTask.markAsDone();\n try {\n storage.updateTaskInFile(doIndex);\n return (\"Nice! I've marked this task as done:\\n \"\n + chosenTask.toString() + \"\\n\");\n } catch (IOException ex) {\n throw new DukeException(\"Can't update task in the file\");\n }\n }", "String getIcon();", "String getIcon();", "private void handleMarkDone()\n throws InvalidTaskDisplayedException, DuplicateTaskException {\n Status done = new Status(true);\n ArrayList<ReadOnlyTask> markDoneTasks = tracker.getTasksFromIndexes(\n model, this.toDo.split(StringUtil.STRING_WHITESPACE), done);\n model.mark(markDoneTasks, done);\n }", "public String getStatus() {\r\n return \"[\" + getStatusIcon() + \"]\";\r\n }", "public org.netbeans.modules.j2ee.dd.api.common.Icon getIcon(){return null;}", "public static void printDoneSuccess(Task chosenTask) {\r\n CmdUx.printHBars(\"Nice! I've marked this task as done: \\n\"\r\n + \" \" + Checkbox.TICK.icon + \" \" + chosenTask.getTaskName());\r\n }", "public boolean hasIcon() {\n return ((bitField0_ & 0x00000002) == 0x00000002);\n }", "public boolean hasIcon() {\n return ((bitField0_ & 0x00000004) == 0x00000004);\n }", "public Vector getTaskVector()\n {\n return m_taskVector;\n }", "java.lang.String getIcon();", "java.lang.String getIcon();", "boolean getTaskResultAfterDone(ManagedObjectReference task)\n throws InvalidPropertyFaultMsg, RuntimeFaultFaultMsg,\n InvalidCollectorVersionFaultMsg {\n\n boolean retVal = false;\n\n // info has a property - state for state of the task\n Object[] result =\n waitForValues.wait(task, new String[]{\"info.state\", \"info.error\"},\n new String[]{\"state\"}, new Object[][]{new Object[]{\n TaskInfoState.SUCCESS, TaskInfoState.ERROR}});\n\n if (result[0].equals(TaskInfoState.SUCCESS)) {\n retVal = true;\n }\n if (result[1] instanceof LocalizedMethodFault) {\n throw new RuntimeException(\n ((LocalizedMethodFault) result[1]).getLocalizedMessage());\n }\n return retVal;\n }", "public Icon getIcon();", "public boolean hasIcon() {\n return ((bitField0_ & 0x00000002) == 0x00000002);\n }", "public String getIcon() {\n\t\treturn \"icon\";\n\t}", "public boolean hasIcon() {\n return ((bitField0_ & 0x00000004) == 0x00000004);\n }", "public boolean isCrossIconPresent() {\r\n\t\treturn isElementPresent(addMarkerOkButton.replace(\".ant-modal-footer button.ant-btn.ant-btn-primary\",\".anticon.anticon-close.ant-modal-close-icon\"), SHORTWAIT);\r\n\t}", "public String getBusyIconCls() {\n\t\tif (null != this.busyIconCls) {\n\t\t\treturn this.busyIconCls;\n\t\t}\n\t\tValueExpression _ve = getValueExpression(\"busyIconCls\");\n\t\tif (_ve != null) {\n\t\t\treturn (String) _ve.getValue(getFacesContext().getELContext());\n\t\t} else {\n\t\t\treturn null;\n\t\t}\n\t}", "public String getIconFileName() {\n\tif (this.isSuccess()) {\n\t return this.icon;\n\t} else {\n\t return null;\n\t}\n }", "com.google.protobuf.ByteString\n getTaskNameBytes();", "void deleteDoneTask(ReadOnlyTask floatingTask) throws TaskNotFoundException;", "public String getIcon(){\n\t\t\t\t\n\t\treturn inCity.getWeather().get(0).getIcon();\n\t}", "private String formatTask(Task task, int done, String activity, String timing, String tag) {\n String type = task.getType() == TaskType.DEADLINE ? \"D\" : \"E\";\n return String.format(\"%s---%d---%s---%s---%s\", type, done, activity, timing, tag);\n }", "@Override\n public String toString()\n {\n if(!isActive()) return \"Task \" + title + \" is inactive\";\n else\n {\n if(!isRepeated()) return \"Task \" + title + \" at \" + time;\n else return \"Task \" + title + \" from \" + start + \" to \" + end + \" every \" + repeat + \" seconds\";\n }\n }", "int getTask() {\n return task;\n }", "public void toggleDone() {\n this.done = !this.done;\n }", "@Override\n public String markComplete() {\n if (this.isDone) {\n return Ui.getTaskAlrCompletedMessage(this);\n } else {\n this.isDone = true;\n return Ui.getMarkCompleteEventMessage(this);\n }\n }", "public String iconResource() {\n return \"/org/netbeans/core/resources/actions/addJarArchive.gif\"; // NOI18N\n }", "@Override\n public Image getFlagImage() {\n Image image = AwsToolkitCore.getDefault().getImageRegistry().get(AwsToolkitCore.IMAGE_FLAG_PREFIX + id);\n if ( image == null ) {\n image = AwsToolkitCore.getDefault().getImageRegistry().get(AwsToolkitCore.IMAGE_AWS_ICON);\n }\n return image;\n }", "public static IIcon method_2666() {\r\n return class_1192.field_6027.field_2131;\r\n }", "public char getCurrentIcon(){\n\t\treturn icon;\r\n\t}", "public String getTask() {\n return task;\n }", "public String getTask() {\n return task;\n }", "public int getIconId(){\n return mIconId;\n }", "public String getPlayerTaskProgressText(int task) {\n\t\tString questtype = taskType.get(task);\n\t\tint taskprogress = getPlayerTaskProgress(task);\n\t\tint taskmax = getTaskAmount(task);\n\t\tString taskID = getTaskID(task);\n\t\tString message = null;\n\t\t\n\t\t//Convert stuff to task specifics\n\t\t//Quest types: Collect, Kill, Killplayer, Killanyplayer, Destroy, Place, Levelup, Enchant, Tame, Goto\n\t\tif(questtype.equalsIgnoreCase(\"killplayer\")){ questtype = \"Kill\"; }\n\t\tif(questtype.equalsIgnoreCase(\"killanyplayer\")){ questtype = \"Kill\"; }\n\t\tif(questtype.equalsIgnoreCase(\"levelup\")){ questtype = \"Level up\"; }\n\t\tif(questtype.equalsIgnoreCase(\"goto\")){ questtype = \"Go to\"; }\n\t\t\n\t\tif(questtype.equalsIgnoreCase(\"level up\")){ taskID = \"times\"; }\n\t\tif(questtype.equalsIgnoreCase(\"Go to\")){ taskID = getTaskID(task).split(\"=\")[2]; }\n\t\tif(questtype.equalsIgnoreCase(\"collect\")||\n\t\t\t\tquesttype.equalsIgnoreCase(\"destroy\")||\n\t\t\t\tquesttype.equalsIgnoreCase(\"place\")||\n\t\t\t\tquesttype.equalsIgnoreCase(\"enchant\")||\n\t\t\t\tquesttype.equalsIgnoreCase(\"craft\")||\n\t\t\t\tquesttype.equalsIgnoreCase(\"smelt\")){ \n\t\t\ttaskID = taskID.toLowerCase().replace(\"_\", \" \");\n\t\t}\n\t\t\n\t\t//Capitalize first letter (questtype)\n\t\tquesttype = WordUtils.capitalize(questtype);\n\t\t\n\t\t//Change certain types around for grammatical purposes\n\t\tif(getPlayerTaskCompleted(task)){\n\t\t\tif(questtype.equalsIgnoreCase(\"collect\")){ questtype = \"Collected\"; }\n\t\t\tif(questtype.equalsIgnoreCase(\"kill\")){ questtype = \"Killed\"; }\n\t\t\tif(questtype.equalsIgnoreCase(\"killplayer\")){ questtype = \"Killed\"; }\n\t\t\tif(questtype.equalsIgnoreCase(\"killanyplayer\")){ questtype = \"Killed\"; }\n\t\t\tif(questtype.equalsIgnoreCase(\"destroy\")){ questtype = \"Destroyed\"; }\n\t\t\tif(questtype.equalsIgnoreCase(\"place\")){ questtype = \"Placed\"; }\n\t\t\tif(questtype.equalsIgnoreCase(\"levelup\")){ questtype = \"Leveled up\"; }\n\t\t\tif(questtype.equalsIgnoreCase(\"enchant\")){ questtype = \"Enchant\"; }\n\t\t\tif(questtype.equalsIgnoreCase(\"tame\")){ questtype = \"Tamed\"; }\n\t\t\tif(questtype.equalsIgnoreCase(\"craft\")){ questtype = \"Crafted\"; }\n\t\t\tif(questtype.equalsIgnoreCase(\"smelt\")){ questtype = \"Smelted\"; }\n\t\t\tif(questtype.equalsIgnoreCase(\"goto\")){ questtype = \"Went to\"; }\n\t\t\t\n\t\t\t//Create the message if the task is finished\n\t\t\tif(!questtype.equalsIgnoreCase(\"go to\")){\n\t\t\t\tmessage = ChatColor.GREEN + questtype + \" \" + taskmax + \" \" + taskID + \".\";\n\t\t\t} else {\n\t\t\t\tmessage = ChatColor.GREEN + questtype + \" \" + taskID + \".\";\n\t\t\t}\n\t\t}else{\n\t\t\tif(!questtype.equalsIgnoreCase(\"go to\")){\n\t\t\t\tmessage = ChatColor.RED + questtype + \" \" + taskprogress + \"/\" + taskmax + \" \" + taskID + \".\";\n\t\t\t}else{\n\t\t\t\tmessage = ChatColor.RED + questtype + \" \" + taskID + \".\";\n\t\t\t}\n\t\t}\n\t\t\n\t\t//Return message\n\t\treturn message;\n\t}", "@Test\n public void setStatusDone_shouldReturnTrueForStatus() {\n Task task = new Task(\"Test\");\n task.setStatusDone();\n Assertions.assertTrue(task.getStatus());\n }", "public String toFileString() {\n return typeIcon() + \" \" + completionIcon() + \" \" + description;\n }", "public FSIcon getIcon() {\n return icon;\n }", "public boolean hasTaskId() {\n return fieldSetFlags()[9];\n }", "@Override // com.noname81.lmt.AsyncDrawableTask\n public Drawable doInBackground(Void... params) {\n return IconUtils.getIconForAction(\n CommandSelectActivity.this.getApplicationContext(),new Action(\n CommandSelectSimpleAdapter.this.mOffset + position + 1), null);\n }", "public byte[] getIcon()\r\n {\r\n return icon;\r\n }" ]
[ "0.74986345", "0.7346419", "0.7162234", "0.7044713", "0.69288564", "0.6920977", "0.67855203", "0.6688722", "0.6649154", "0.6635921", "0.6559722", "0.6506606", "0.6477624", "0.6428565", "0.6428565", "0.6428565", "0.6373771", "0.6319349", "0.6084691", "0.6084691", "0.6053052", "0.5980311", "0.5749229", "0.57266307", "0.57043976", "0.5686381", "0.5637622", "0.5600898", "0.5573892", "0.5573892", "0.5517871", "0.55029535", "0.5480923", "0.5478576", "0.54594696", "0.53805315", "0.53305715", "0.53269416", "0.53130025", "0.53098106", "0.5274216", "0.5250436", "0.5200382", "0.5199413", "0.5147537", "0.51337564", "0.5081596", "0.5081538", "0.50812614", "0.50812614", "0.50812614", "0.50812614", "0.5078828", "0.50709546", "0.5053738", "0.50459", "0.5038691", "0.50322324", "0.502714", "0.50245655", "0.50245655", "0.50216085", "0.5019342", "0.5010976", "0.49724847", "0.49712688", "0.49643958", "0.49631357", "0.49561745", "0.49561745", "0.49462935", "0.4941508", "0.49344024", "0.49337512", "0.49286857", "0.49026936", "0.48993862", "0.4895239", "0.4883721", "0.48826262", "0.48737797", "0.48697382", "0.48624015", "0.4858241", "0.48558", "0.4843869", "0.4836307", "0.48319122", "0.48276985", "0.48222935", "0.48213044", "0.48213044", "0.48073754", "0.48006564", "0.48004878", "0.479984", "0.4798278", "0.47959417", "0.4783197", "0.47792694" ]
0.71266025
3
Returns the description of the Task object.
public String getDescription() { return description; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public String get_task_description()\n {\n return task_description;\n }", "public String getTaskName() {\n return this.taskDescription;\n }", "public String getDescription()\r\n {\r\n return \"Approver of the task \"+taskName();\r\n }", "public String GiveTask(){\n return \"[\" + getStatusIcon() + \"] \" + this.description;\n }", "@Override\n public String toString()\n {\n\n // IF TASK IS MARKED AS COMPLETE\n if(task_completion_boolean)\n {\n // IF THERE'S NO TASK DESCRIPTION\n if(task_description.isBlank() || task_description.equals(null))\n {\n return \"*** \" + String.format(\"[%s] %s\", task_due_date, task_title);\n } // END if\n\n return \"*** \" + String.format(\"[%s] %s | %s\", task_due_date, task_title, task_description);\n } // END if\n\n /***********************************************************/\n\n // OTHERWISE, TASK IS NOT COMPLETE\n else\n {\n // IF THERE'S NO TASK DESCRIPTION\n if(task_description.isBlank() || task_description.equals(null))\n {\n return String.format(\"[%s] %s\", task_due_date, task_title);\n } // END if\n\n return String.format(\"[%s] %s | %s\", task_due_date, task_title, task_description);\n } // END else\n\n }", "@Override\n public String toString() {\n return \"[\" + this.getStatusIcon() + \"] \" + this.taskDescription;\n }", "@Override\n public String toString() {\n return \"[\" + this.getStatusIcon() + \"] \" + this.taskDescription;\n }", "public String getTask() {\n return task;\n }", "public String getTask() {\n return task;\n }", "public String getName()\r\n {\r\n return taskName;\r\n }", "public String taskName() {\n return this.taskName;\n }", "@Override\n public String toString() {\n return \"Task no \"+id ;\n }", "public Task(String description) {\n this.description = description;\n this.isDone = false;\n this.taskType = \"\";\n }", "public String getTaskName();", "@Override\n public String toString() {\n if (timeEnd == null) {\n stop();\n }\n return task + \" in \" + (timeEnd - timeStart) + \"ms\";\n }", "public String getTaskName(){\r\n\t\treturn this.taskName;\r\n\t}", "public String getTaskName() {\n return taskName;\n }", "public String getTaskName() {\n return taskName;\n }", "public String getTaskName() {\n return taskName;\n }", "public String getTaskName() {\n return taskName;\n }", "public Task(String description){\n this.description = description;\n this.isDone = false;\n }", "public Task(String description){\n this.description = description;\n this.isDone = false;\n }", "public String get_task_title()\n {\n return task_title;\n }", "public String getTaskDefinition() {\n return this.taskDefinition;\n }", "public String getTaskDefinition() {\n return this.taskDefinition;\n }", "@Override\n public String toString()\n {\n if(!isActive()) return \"Task \" + title + \" is inactive\";\n else\n {\n if(!isRepeated()) return \"Task \" + title + \" at \" + time;\n else return \"Task \" + title + \" from \" + start + \" to \" + end + \" every \" + repeat + \" seconds\";\n }\n }", "public Task(String taskDescription) {\n this.taskDescription = taskDescription;\n this.isDone = false;\n this.completed = \"0\";\n }", "public static String getInstruction() {\n return \"Adds a todo task to the tasks list\\n\"\n + \"Format: todo [desc]\\n\"\n + \"desc: The description of the todo task\\n\";\n }", "public TaskName getTaskName() {\n return this.taskName;\n }", "public Task(String description) {\n this.description = description;\n this.isDone = false;\n }", "public Task(String description) {\n this.description = description;\n this.isDone = false;\n }", "public Task(String taskDescription) {\n this.taskDescription = taskDescription;\n this.isDone = false;\n }", "public Task(String description) {\n this.description = description;\n this.isDone = false;\n this.tag = \"\";\n }", "public String getTask(){\n\treturn task;\n}", "public ITask getTask() {\n \t\treturn task;\n \t}", "public Task(String description) {\n this.description = description;\n this.isDone = false;\n this.logo = \"N\";\n }", "@Override\r\n public String toString()\r\n {\r\n return taskName + \",\" + dueDate + \"\";\r\n }", "public String getType() {\n return \"Task\";\n }", "String getTaskName();", "String getTaskName();", "@Override\n public String getTaskType() {\n return \"T\";\n }", "public Task getTask() {\n return task;\n }", "static String getReadableTask(int taskTypeRepresentation) {\n return taskDetails.get(taskTypeRepresentation).getDescription();\n }", "public abstract String getTaskName();", "public Task getTask() { return task; }", "public String getDescription() {\n return desc;\n }", "public String getDescription() {\n return desc;\n }", "public void printTask() {\r\n\t\tSystem.out.println(\"ID: \" + this.id + \" | Description: \" + this.description + \" | Processor: \" + this.processor);\r\n\t\tSystem.out.println(\"Status: \" + this.status + \" | Fälligkeitsdatum: \" + this.formatedDueDate);\r\n\t\tSystem.out.println(\"----------\");\r\n\t}", "public String getDescription() {\n return (desc);\n }", "public Task(String description) {\n this.description = description;\n this.isDone = false;\n this.tag = \"\";\n this.isTagged = false;\n }", "@Override\n public String getDescription() {\n return getClass().getName();\n }", "public Task gatherTaskInfo() {\n \t\n \tString title;\n \t\n \tEditText getTitle = (EditText)findViewById(R.id.titleTextBox);\n \t//EditText itemNum = (EditText)findViewById(R.id.showCurrentItemNum);\n \t \t\n \t//gathering the task information\n \ttitle = getTitle.getText().toString();\n\n \t//validate input \n \tboolean valid = validateInput(title);\n \t\n \t//if valid input and we have the properties create a task and return it\n \tif(valid && propertiesGrabbed) {\n \t\t\n\t \t//creating a task\n\t \tTask t = new TfTask();\n\t \tt.setTitle(title);\n\t \t\n\t \t//setting the visibility enum\n\t \tif(taskVisibility.equals(\"Public\")) { \t\t\n\t \t\tt.setVisibility(Visibility.PUBLIC); \t\t\n\t \t}else{\n\t \t\tt.setVisibility(Visibility.PRIVATE); \t\t\n\t \t}\n\t \t\n\t \t//creating each individual item\n\t \taddItemsToTask(t);\n\t \t\t \t\n\t \t//set the description\n\t \tt.setDescription(taskDescription);\n\n\t \t//set the email to respond to\n\t \tt.setEmail(taskResponseString);\n\t \t\n\t \t//return the task\t \t\n\t \treturn t;\n\t \t\n \t}else{\n \t\t//task not correct\n \t\treturn null;\n \t}\n }", "public String getTaskName() {\n Object ref = taskName_;\n if (!(ref instanceof String)) {\n com.google.protobuf.ByteString bs =\n (com.google.protobuf.ByteString) ref;\n String s = bs.toStringUtf8();\n taskName_ = s;\n return s;\n } else {\n return (String) ref;\n }\n }", "@Override\n public String getDescription() {\n return this.description;\n }", "public String getDescription() {\n return DESCRIPTION;\n }", "@Override\r\n\tpublic String getDescription() {\n\t\treturn this.description;\r\n\t}", "public java.lang.Object getDescription() {\n return description;\n }", "public String pendingToString() {\n InterruptibleTask interruptibleTask = this.task;\n if (interruptibleTask == null) {\n return super.pendingToString();\n }\n StringBuilder stringBuilder = new StringBuilder(\"task=[\");\n stringBuilder.append(interruptibleTask);\n stringBuilder.append(\"]\");\n return stringBuilder.toString();\n }", "public String getDescription () {\n return description;\n }", "public Task(String description) {\n this.description = description.trim();\n this.isDone = false;\n }", "public String getDescription()\n {\n return description;\n }", "public String getDescription() {\n return description;\n }", "@Override\r\n\tpublic String getDescription() {\n\t\treturn description;\r\n\t}", "public String getDescription()\n {\n return description;\n }", "public String getDescription()\n {\n return description;\n }", "public String getDescription()\n {\n return description;\n }", "public String getDescription()\n {\n return description;\n }", "public String getDescription()\n {\n return description;\n }", "public String getDescription()\n {\n return description;\n }", "public String getDescription()\n {\n return description;\n }", "public String getDescription()\n {\n return description;\n }", "public String getDescription()\n {\n return description;\n }", "public String getDescription()\n {\n return description;\n }", "public String getDescription()\n {\n return description;\n }", "public String getDescription()\n {\n return description;\n }", "public String getDescription() {\n if (description == null) {\n description = Description.getDescription(this);\n }\n return description;\n }", "public String getDescription()\n {\n return description;\n }" ]
[ "0.84254324", "0.8002562", "0.799731", "0.7430235", "0.73923856", "0.7291331", "0.7291331", "0.7211675", "0.7211675", "0.7152102", "0.70794654", "0.705331", "0.70403606", "0.70281726", "0.7018668", "0.6969061", "0.69661874", "0.69661874", "0.69661874", "0.69661874", "0.6953553", "0.6953553", "0.6927855", "0.6921739", "0.6921739", "0.6915429", "0.68556976", "0.6835218", "0.6822376", "0.6801821", "0.6801821", "0.6797911", "0.6794738", "0.67843425", "0.67814445", "0.6755595", "0.67316175", "0.67263013", "0.6684209", "0.6684209", "0.6667684", "0.66597426", "0.6652783", "0.6641382", "0.6629922", "0.6623597", "0.65985477", "0.6595634", "0.65643835", "0.6563576", "0.6552807", "0.6549033", "0.6523478", "0.650282", "0.65026", "0.64993674", "0.6494274", "0.64938205", "0.6489296", "0.64857835", "0.64760494", "0.64735264", "0.64684904", "0.6465996", "0.6465996", "0.6465996", "0.6465996", "0.6465996", "0.6465996", "0.6465996", "0.6465996", "0.6465996", "0.6465996", "0.6465996", "0.6465996", "0.6465953", "0.64586556" ]
0.0
-1
Return a String representation of the duke.tasks.Task, as displayed on the command line / in todo_list.txt
public String toString() { return "[" + this.getStatusIcon() + "] " + this.description; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public String getString() {\n assert tasks != null : \"tasks cannot be null\";\n StringBuilder str = new StringBuilder();\n for (int i = 1; i < parts.length; i++) {\n str.append(\" \");\n str.append(parts[i]);\n }\n String taskString = str.toString();\n Todo todo = new Todo(taskString);\n tasks.add(todo);\n return Ui.showAddText() + todo.toString() + tasks.getSizeString();\n }", "@Override\n public String toString()\n {\n\n // IF TASK IS MARKED AS COMPLETE\n if(task_completion_boolean)\n {\n // IF THERE'S NO TASK DESCRIPTION\n if(task_description.isBlank() || task_description.equals(null))\n {\n return \"*** \" + String.format(\"[%s] %s\", task_due_date, task_title);\n } // END if\n\n return \"*** \" + String.format(\"[%s] %s | %s\", task_due_date, task_title, task_description);\n } // END if\n\n /***********************************************************/\n\n // OTHERWISE, TASK IS NOT COMPLETE\n else\n {\n // IF THERE'S NO TASK DESCRIPTION\n if(task_description.isBlank() || task_description.equals(null))\n {\n return String.format(\"[%s] %s\", task_due_date, task_title);\n } // END if\n\n return String.format(\"[%s] %s | %s\", task_due_date, task_title, task_description);\n } // END else\n\n }", "public String toString() {\n\n\t\tString output = \"\";\n\n\t\tfor (Task i : tasks) {\n\t\t\toutput += i.toString() + \"\\n \\n\";\n\t\t}\n\n\t\treturn output;\n\t}", "public String toString() {\n String str = \"\";\n for (int i = 0; i < size; i++) {\n str += tasks[i].toString() + \"\\n\";\n }\n return str;\n }", "public void tostring(){\n\t\tfor(int i=0;i<taskList.size();i++){\n\t\t\tSystem.out.println(taskList.get(i).getPrint()); \n\t\t}\n\t}", "@Override\n public String toString() {\n return \"Task no \"+id ;\n }", "public String GiveTask(){\n return \"[\" + getStatusIcon() + \"] \" + this.description;\n }", "public String printDone(Task task) {\n return \"´ ▽ ` )ノ Nice! I've marked this task as done:\\n\"\n + \"[\" + task.getStatusIcon() + \"]\" + task.getDescription() + \"\\n\";\n }", "public String getTasks() {\n StringJoiner result = new StringJoiner(\"\\n\");\n for (int i = 0; i < tasks.size(); i++) {\n Task t = tasks.get(i);\n result.add(String.format(\"%d.%s\", i + 1, t));\n }\n\n return result.toString();\n }", "public String toString() {\n String s = \"\";\n for (int i = 0; i < size; i++) {\n s += taskarr[i].gettitle() + \", \" + taskarr[i].getassignedTo()\n + \", \" + taskarr[i].gettimetocomplete()\n + \", \" + taskarr[i].getImportant() + \", \" + taskarr[i].getUrgent()\n + \", \" + taskarr[i].getStatus() + \"\\n\";\n }\n return s;\n }", "public abstract String taskToText();", "public String listOfTasks() {\n String listOfTasks = Messages.LIST_TASKS_MESSAGE;\n for (int i = 0; i < Parser.getOrderAdded(); i++) {\n listOfTasks += recordedTask.get(i).getTaskNum() + DOT_OPEN_SQUARE_BRACKET\n + recordedTask.get(i).getCurrentTaskType() + CLOSE_SQUARE_BRACKET + OPEN_SQUARE_BRACKET\n + recordedTask.get(i).taskStatus() + CLOSE_SQUARE_BRACKET + Messages.BLANK_SPACE\n + recordedTask.get(i).getTaskName()\n + ((i == Parser.getOrderAdded() - 1) ? Messages.EMPTY_STRING : Messages.NEW_LINE);\n }\n return listOfTasks;\n }", "@Override\n public String toString()\n {\n if(!isActive()) return \"Task \" + title + \" is inactive\";\n else\n {\n if(!isRepeated()) return \"Task \" + title + \" at \" + time;\n else return \"Task \" + title + \" from \" + start + \" to \" + end + \" every \" + repeat + \" seconds\";\n }\n }", "public String addTask(Task t) {\n tasks.add(t);\n return tasks.get(tasks.size() - 1).toString();\n }", "@Override\r\n public String toString()\r\n {\r\n return taskName + \",\" + dueDate + \"\";\r\n }", "public String getTaskName();", "public String getTaskName() {\n return this.taskDescription;\n }", "public static String getInstruction() {\n return \"Adds a todo task to the tasks list\\n\"\n + \"Format: todo [desc]\\n\"\n + \"desc: The description of the todo task\\n\";\n }", "public String printList(TaskList tasks) {\n String taskList = \"\";\n for (int i = 0; i < tasks.size(); i++) {\n Task t = tasks.get(i);\n assert t != null;\n taskList = taskList + (i + 1) + \".\" + t.toString() + \"\\n\";\n }\n return \"(ノ◕ヮ◕)ノ*:・゚✧ Here are the task(s) in your list:\\n\"\n + taskList;\n }", "public String getTaskWithoutType() {\n String out = \"\";\n for (int i = 1; i < commandSeparate.length; i++) {\n out += i == commandSeparate.length - 1\n ? commandSeparate[i] : commandSeparate[i] + \" \";\n }\n return out;\n }", "String getTaskName();", "String getTaskName();", "private String formatTask(Task task) {\n String identifier = task.getType();\n String completionStatus = task.isComplete() ? \"1\" : \"0\";\n String dateString = \"\";\n if (task instanceof Deadline) {\n Deadline d = (Deadline) task;\n LocalDateTime date = d.getDate();\n dateString = date.format(FORMATTER);\n }\n if (task instanceof Event) {\n Event e = (Event) task;\n LocalDateTime date = e.getDate();\n dateString = date.format(FORMATTER);\n }\n return String.join(\"|\", identifier, completionStatus, task.getName(), dateString);\n }", "private String getTaskName() {\n \n \t\treturn this.environment.getTaskName() + \" (\" + (this.environment.getIndexInSubtaskGroup() + 1) + \"/\"\n \t\t\t+ this.environment.getCurrentNumberOfSubtasks() + \")\";\n \t}", "public String get_task_description()\n {\n return task_description;\n }", "private String formatTask(Task task, int done, String activity, String timing, String tag) {\n String type = task.getType() == TaskType.DEADLINE ? \"D\" : \"E\";\n return String.format(\"%s---%d---%s---%s---%s\", type, done, activity, timing, tag);\n }", "@Override\n public String toString() {\n return \"[\" + this.getStatusIcon() + \"] \" + this.taskDescription;\n }", "@Override\n public String toString() {\n return \"[\" + this.getStatusIcon() + \"] \" + this.taskDescription;\n }", "public void printTask() {\r\n\t\tSystem.out.println(\"ID: \" + this.id + \" | Description: \" + this.description + \" | Processor: \" + this.processor);\r\n\t\tSystem.out.println(\"Status: \" + this.status + \" | Fälligkeitsdatum: \" + this.formatedDueDate);\r\n\t\tSystem.out.println(\"----------\");\r\n\t}", "public String getTask() {\n return task;\n }", "public String getTask() {\n return task;\n }", "public String pendingToString() {\n InterruptibleTask interruptibleTask = this.task;\n if (interruptibleTask == null) {\n return super.pendingToString();\n }\n StringBuilder stringBuilder = new StringBuilder(\"task=[\");\n stringBuilder.append(interruptibleTask);\n stringBuilder.append(\"]\");\n return stringBuilder.toString();\n }", "public abstract String[] formatTask();", "public String getDescription()\r\n {\r\n return \"Approver of the task \"+taskName();\r\n }", "@Test\n\tpublic void testToString() {\n\t\tSystem.out.println(\"toString\");\n\t\tDeleteTask task = new DeleteTask(1);\n\t\tassertEquals(task.toString(), \"DeleteTask -- [filePath=1]\");\n\t}", "public String printAddTask(Task task, int sizeOfTaskList) {\n return \"ಥ◡ಥ Got it. I've added this task:\\n\" + task.toString() + \"\\n\"\n + \"Now you have \" + sizeOfTaskList + \" tasks in the list.\\n\";\n }", "public String showDone(Task t) {\n String doneMessage = \"YEEEEE-HAW!!! You've completed this task!\\n\" + t;\n return doneMessage;\n }", "String getTaskId();", "public String getTaskName(){\r\n\t\treturn this.taskName;\r\n\t}", "@Override\n public String toString() {\n\treturn \"Primzahlen von Task \" + taskID + \" \" + primzahlenListe;\n }", "@Override\n public String toString() {\n if (timeEnd == null) {\n stop();\n }\n return task + \" in \" + (timeEnd - timeStart) + \"ms\";\n }", "public String taskName() {\n return this.taskName;\n }", "public String toString()\n {\n\treturn \"Completed: \" + completed + \"\\n\" + \"To Do: \" + toDo;\n }", "public String getTaskName() {\n Object ref = taskName_;\n if (!(ref instanceof String)) {\n com.google.protobuf.ByteString bs =\n (com.google.protobuf.ByteString) ref;\n String s = bs.toStringUtf8();\n taskName_ = s;\n return s;\n } else {\n return (String) ref;\n }\n }", "public static void printTaskList(ArrayList<Task> taskList){\n if (taskList.size() != 0) {\n Task task; // declaring the temporary Task variable\n System.out.printf(\"%-11s%-5s%-22s%s\\n\", \"Completed\", \"No.\", \"Task\", \"Date\"); // printing the column headers\n for (int i = 0; i < taskList.size(); i++) { // iterating over each task in the user's task list\n task = taskList.get(i); // getting the current task in the list\n System.out.print(\" [ \"); // formatting \n if (task.getIsComplete()) { // if the task is complete\n System.out.print(\"✓\"); // marking the task as complete\n } else {\n System.out.print(\" \"); // marking the task as incomplete\n }\n System.out.print(\" ] \"); // formatting\n System.out.printf(\"%-5d\", i + 1); // printing the task number\n System.out.printf(\"%-22s\", task.getLabel()); // printing the label of the task\n System.out.printf(\"%s\", task.getDate()); // printing the date of the task\n System.out.print(\"\\n\"); // printing a newline for formatting\n }\n } else {\n System.out.println(\"You do not have any tasks. Be sure to check your task list and add a task.\"); // telling the user they do not have any tasks\n }\n System.out.print(\"\\n\"); // printing a newline for formatting\n pause(); // pauses the screen\n }", "public String getTaskId() {\n Object ref = taskId_;\n if (!(ref instanceof String)) {\n com.google.protobuf.ByteString bs =\n (com.google.protobuf.ByteString) ref;\n String s = bs.toStringUtf8();\n taskId_ = s;\n return s;\n } else {\n return (String) ref;\n }\n }", "public void createTask() {\n \tSystem.out.println(\"Inside createTask()\");\n \tTask task = Helper.inputTask(\"Please enter task details\");\n \t\n \ttoDoList.add(task);\n \tSystem.out.println(toDoList);\n }", "public String getName()\r\n {\r\n return taskName;\r\n }", "public String getTaskName() {\n return taskName;\n }", "public String getTaskName() {\n return taskName;\n }", "public String getTaskName() {\n return taskName;\n }", "public String getTaskName() {\n return taskName;\n }", "public String getTaskName() {\n Object ref = taskName_;\n if (ref instanceof String) {\n return (String) ref;\n } else {\n com.google.protobuf.ByteString bs =\n (com.google.protobuf.ByteString) ref;\n String s = bs.toStringUtf8();\n taskName_ = s;\n return s;\n }\n }", "public String showDone(Task task) {\n String response = \"\";\n response += showLine();\n response += \"Nice! I've marked this task as done:\" + System.lineSeparator();\n response += \" \" + task + System.lineSeparator();\n response += showLine();\n return response;\n }", "public String updateTaskToFile() {\n String updatedText = Messages.EMPTY_STRING;\n for (int i = 0; i < Parser.getOrderAdded(); i++) {\n updatedText = updatedText.concat(recordedTask.get(i).getCurrentTaskType()\n + Messages.SEPARATOR + recordedTask.get(i).taskStatus()\n + Messages.SEPARATOR + recordedTask.get(i).getTaskName()) + Messages.NEW_LINE;\n }\n return updatedText;\n }", "@Test\n public void toString_shouldReturnInCorrectFormat() {\n Task task = new Task(\"Test\");\n String expected = \"[N] Test\";\n Assertions.assertEquals(expected, task.toString());\n }", "public abstract String getTaskName();", "public String getTaskId() {\n Object ref = taskId_;\n if (ref instanceof String) {\n return (String) ref;\n } else {\n com.google.protobuf.ByteString bs =\n (com.google.protobuf.ByteString) ref;\n String s = bs.toStringUtf8();\n taskId_ = s;\n return s;\n }\n }", "public String getTaskDefinition() {\n return this.taskDefinition;\n }", "public String getTaskDefinition() {\n return this.taskDefinition;\n }", "public String getSerialisedToDo() {\n\t\tString placeholder = \"placeholder\";\n\t\treturn placeholder;\n\t}", "public String get_task_title()\n {\n return task_title;\n }", "public String goalToString() {\r\n return priority + \" - \" + task + \" - \" + date;\r\n }", "public java.lang.String getTaskId() {\n return taskId;\n }", "public java.lang.String getTaskId() {\n return taskId;\n }", "public void printTasks() {\n int i = 0;\n for (Task task : tasks) {\n StringBuilder message = new StringBuilder()\n .append(\"Task \").append(i++).append(\": \").append(task);\n\n for (Task blocker : task.firstToFinish) {\n message.append(\"\\n depends on completed task: \").append(blocker);\n }\n\n for (Task blocker : task.firstToSuccessfullyFinish) {\n message.append(\"\\n depends on successful task: \").append(blocker);\n }\n\n stdout.println(message.toString());\n }\n }", "com.google.protobuf.ByteString\n getTaskNameBytes();", "public String list() {\n final StringBuilder list = new StringBuilder(\"Here are the tasks in your list:\\n\\t\");\n records.forEach((el) -> list.append(\n String.format(\"%1$d. %2$s \\n\\t\",\n records.indexOf(el) + 1, el.toString())));\n return list.toString();\n }", "public String executeToString(TaskList tasks, Ui ui, Storage storage) {\n String result = \"Here are the tasks in your list:\";\n for (int i = 0; i < tasks.size(); i++) {\n result += \"\\n\" + (i + 1) + \". \" + tasks.get(i);\n\n }\n return result;\n }", "public String showDelete(Task t, TaskList tasks) {\n String deleteMessage = \"Got it! I'm removin' this task!\\n\" + t + \"\\n\"\n + \"Now you have \" + tasks.getSize() + \" tasks in your list!\";\n return deleteMessage;\n }", "public String getTask(){\n\treturn task;\n}", "public com.google.protobuf.ByteString\n getTaskNameBytes() {\n Object ref = taskName_;\n if (ref instanceof String) {\n com.google.protobuf.ByteString b =\n com.google.protobuf.ByteString.copyFromUtf8(\n (String) ref);\n taskName_ = b;\n return b;\n } else {\n return (com.google.protobuf.ByteString) ref;\n }\n }", "@Override\n public String getTaskType() {\n return \"T\";\n }", "public String getTask(int position) {\n HashMap<String, String> map = list.get(position);\n return map.get(TASK_COLUMN);\n }", "public com.google.protobuf.ByteString\n getTaskIdBytes() {\n Object ref = taskId_;\n if (ref instanceof String) {\n com.google.protobuf.ByteString b =\n com.google.protobuf.ByteString.copyFromUtf8(\n (String) ref);\n taskId_ = b;\n return b;\n } else {\n return (com.google.protobuf.ByteString) ref;\n }\n }", "public java.lang.String getTaskId() {\n return taskId;\n }", "public java.lang.String getTaskId() {\n return taskId;\n }", "public String getTaskId(){\r\n\t\treturn this.taskId;\r\n\t}", "public String getTaskId() {\n return this.taskId;\n }", "public com.google.protobuf.ByteString\n getTaskNameBytes() {\n Object ref = taskName_;\n if (ref instanceof String) {\n com.google.protobuf.ByteString b =\n com.google.protobuf.ByteString.copyFromUtf8(\n (String) ref);\n taskName_ = b;\n return b;\n } else {\n return (com.google.protobuf.ByteString) ref;\n }\n }", "protected String getTaskId() {\n\t\tDisplay.debug(\"getTaskId() devuelve %s\", taskId);\n\t\treturn taskId;\n\t}", "public TaskName getTaskName() {\n return this.taskName;\n }", "public String getPlayerTaskProgressText(int task) {\n\t\tString questtype = taskType.get(task);\n\t\tint taskprogress = getPlayerTaskProgress(task);\n\t\tint taskmax = getTaskAmount(task);\n\t\tString taskID = getTaskID(task);\n\t\tString message = null;\n\t\t\n\t\t//Convert stuff to task specifics\n\t\t//Quest types: Collect, Kill, Killplayer, Killanyplayer, Destroy, Place, Levelup, Enchant, Tame, Goto\n\t\tif(questtype.equalsIgnoreCase(\"killplayer\")){ questtype = \"Kill\"; }\n\t\tif(questtype.equalsIgnoreCase(\"killanyplayer\")){ questtype = \"Kill\"; }\n\t\tif(questtype.equalsIgnoreCase(\"levelup\")){ questtype = \"Level up\"; }\n\t\tif(questtype.equalsIgnoreCase(\"goto\")){ questtype = \"Go to\"; }\n\t\t\n\t\tif(questtype.equalsIgnoreCase(\"level up\")){ taskID = \"times\"; }\n\t\tif(questtype.equalsIgnoreCase(\"Go to\")){ taskID = getTaskID(task).split(\"=\")[2]; }\n\t\tif(questtype.equalsIgnoreCase(\"collect\")||\n\t\t\t\tquesttype.equalsIgnoreCase(\"destroy\")||\n\t\t\t\tquesttype.equalsIgnoreCase(\"place\")||\n\t\t\t\tquesttype.equalsIgnoreCase(\"enchant\")||\n\t\t\t\tquesttype.equalsIgnoreCase(\"craft\")||\n\t\t\t\tquesttype.equalsIgnoreCase(\"smelt\")){ \n\t\t\ttaskID = taskID.toLowerCase().replace(\"_\", \" \");\n\t\t}\n\t\t\n\t\t//Capitalize first letter (questtype)\n\t\tquesttype = WordUtils.capitalize(questtype);\n\t\t\n\t\t//Change certain types around for grammatical purposes\n\t\tif(getPlayerTaskCompleted(task)){\n\t\t\tif(questtype.equalsIgnoreCase(\"collect\")){ questtype = \"Collected\"; }\n\t\t\tif(questtype.equalsIgnoreCase(\"kill\")){ questtype = \"Killed\"; }\n\t\t\tif(questtype.equalsIgnoreCase(\"killplayer\")){ questtype = \"Killed\"; }\n\t\t\tif(questtype.equalsIgnoreCase(\"killanyplayer\")){ questtype = \"Killed\"; }\n\t\t\tif(questtype.equalsIgnoreCase(\"destroy\")){ questtype = \"Destroyed\"; }\n\t\t\tif(questtype.equalsIgnoreCase(\"place\")){ questtype = \"Placed\"; }\n\t\t\tif(questtype.equalsIgnoreCase(\"levelup\")){ questtype = \"Leveled up\"; }\n\t\t\tif(questtype.equalsIgnoreCase(\"enchant\")){ questtype = \"Enchant\"; }\n\t\t\tif(questtype.equalsIgnoreCase(\"tame\")){ questtype = \"Tamed\"; }\n\t\t\tif(questtype.equalsIgnoreCase(\"craft\")){ questtype = \"Crafted\"; }\n\t\t\tif(questtype.equalsIgnoreCase(\"smelt\")){ questtype = \"Smelted\"; }\n\t\t\tif(questtype.equalsIgnoreCase(\"goto\")){ questtype = \"Went to\"; }\n\t\t\t\n\t\t\t//Create the message if the task is finished\n\t\t\tif(!questtype.equalsIgnoreCase(\"go to\")){\n\t\t\t\tmessage = ChatColor.GREEN + questtype + \" \" + taskmax + \" \" + taskID + \".\";\n\t\t\t} else {\n\t\t\t\tmessage = ChatColor.GREEN + questtype + \" \" + taskID + \".\";\n\t\t\t}\n\t\t}else{\n\t\t\tif(!questtype.equalsIgnoreCase(\"go to\")){\n\t\t\t\tmessage = ChatColor.RED + questtype + \" \" + taskprogress + \"/\" + taskmax + \" \" + taskID + \".\";\n\t\t\t}else{\n\t\t\t\tmessage = ChatColor.RED + questtype + \" \" + taskID + \".\";\n\t\t\t}\n\t\t}\n\t\t\n\t\t//Return message\n\t\treturn message;\n\t}", "public String getDeleteString(int taskNumber) {\n StringBuilder response = new StringBuilder(\"Deleted task:\\n\");\n Task currentTask = storage.get(taskNumber);\n response.append(currentTask).append(\"\\n\");\n storage.remove(taskNumber);\n response.append(\"There are now \").append(storage.size()).append(\" task(s) remaining.\");\n return response.toString();\n }", "Object getTaskId();", "public String showHelp() {\n String helpMessage = \"I don't know nothin' about other commands but \"\n + \"here are the list of commands I understand!\\n\"\n + \"help: displays the list of commands available\\n\"\n + \"\\n\"\n + \"list: displays the list of tasks you have\\n\"\n + \"\\n\"\n + \"find *keyword*: displays the tasks with that keyword\\n\"\n + \"eg find karate\\n\"\n + \"\\n\"\n + \"todo *task description*: adds a task without any\\n\"\n + \"date/time attached to it\\n\" + \"eg todo scold spongebob\\n\"\n + \"\\n\"\n + \"deadline *task description* /by *date+time*: adds a\\n\"\n + \"task that needs to be done before a specific date and time\\n\"\n + \"(date and time to be written in yyyy-mm-dd HHMM format)\\n\"\n + \"eg deadline build spaceship /by 2019-10-15 2359\\n\"\n + \"\\n\"\n + \"event *task description* /at *date+time*: adds a task that\\n\"\n + \"starts at a specific time and ends at a specific time\\n\"\n + \"(date and time to be written in yyyy-mm-dd HHMM format)\\n\"\n + \"eg event karate competition /at 2019-10-15 1200\\n\"\n + \"\\n\"\n + \"done *task number*: marks the task with that number as done\\n\"\n + \"eg done 1\\n\"\n + \"\\n\"\n + \"delete *task number*: deletes the task with that number from the list\\n\"\n + \"eg delete 1\\n\"\n + \"\\n\"\n + \"update *task number* /name *task name*: updates the name of the task with \"\n + \"that number from the list\\n\" + \"update 1 /name help spongebob\\n\"\n + \"\\n\"\n + \"update *task number* /date *task date*: (only for deadline or event tasks!) \"\n + \"updates the date and time of the task with that number from the list\\n\"\n + \"update 1 /date 2020-02-20 1200\\n\"\n + \"\\n\"\n + \"bye: ends the session\";\n return helpMessage;\n }", "public com.google.protobuf.ByteString\n getTaskIdBytes() {\n Object ref = taskId_;\n if (ref instanceof String) {\n com.google.protobuf.ByteString b =\n com.google.protobuf.ByteString.copyFromUtf8(\n (String) ref);\n taskId_ = b;\n return b;\n } else {\n return (com.google.protobuf.ByteString) ref;\n }\n }", "@Override\n public String toString() {\n return \"ArrayTaskList{\" +\n \"list=\" + Arrays.toString(list) +\n \", currentPos=\" + currentPos +\n \", listLength=\" + listLength +\n '}';\n }", "static String getReadableTask(int taskTypeRepresentation) {\n return taskDetails.get(taskTypeRepresentation).getDescription();\n }", "public String getSaveString() {\n if (this.isDone()) {\n return String.format(\"[isDone] todo %s\\n\", description);\n } else {\n return String.format(\"todo %s\\n\", description);\n }\n }", "public interface Task {\n\t\t/** Insertion tuples */\n\t\tpublic TupleSet insertions();\n\n\t\t/** Deletion tuples. */\n\t\tpublic TupleSet deletions();\n\n\t\t/** The program name that should evaluate the tuples. */\n\t\tpublic String program();\n\n\t\t/** The name of the table to which the tuples belong. */\n\t\tpublic TableName name();\n\t}", "public Task gatherTaskInfo() {\n \t\n \tString title;\n \t\n \tEditText getTitle = (EditText)findViewById(R.id.titleTextBox);\n \t//EditText itemNum = (EditText)findViewById(R.id.showCurrentItemNum);\n \t \t\n \t//gathering the task information\n \ttitle = getTitle.getText().toString();\n\n \t//validate input \n \tboolean valid = validateInput(title);\n \t\n \t//if valid input and we have the properties create a task and return it\n \tif(valid && propertiesGrabbed) {\n \t\t\n\t \t//creating a task\n\t \tTask t = new TfTask();\n\t \tt.setTitle(title);\n\t \t\n\t \t//setting the visibility enum\n\t \tif(taskVisibility.equals(\"Public\")) { \t\t\n\t \t\tt.setVisibility(Visibility.PUBLIC); \t\t\n\t \t}else{\n\t \t\tt.setVisibility(Visibility.PRIVATE); \t\t\n\t \t}\n\t \t\n\t \t//creating each individual item\n\t \taddItemsToTask(t);\n\t \t\t \t\n\t \t//set the description\n\t \tt.setDescription(taskDescription);\n\n\t \t//set the email to respond to\n\t \tt.setEmail(taskResponseString);\n\t \t\n\t \t//return the task\t \t\n\t \treturn t;\n\t \t\n \t}else{\n \t\t//task not correct\n \t\treturn null;\n \t}\n }", "public static void listTasks(ArrayList<Task> taskList) {\r\n StringBuilder sb = new StringBuilder();\r\n int i = 1;\r\n sb.append(\"Here are the tasks in your list:\\n\");\r\n for (Task task : taskList) {\r\n sb.append(i++ + \".\" + task.toString() + \"\\n\");\r\n }\r\n CmdUx.printHBars(sb.toString());\r\n }", "private void helpCommand() {\n output.println(\"HELP COMMAND\");\n output.println(\"read tasks: 'r all/today/before/after', write new task: 'w dd/mm/yyyy taskName' (wrong format of date -> default today date)\");\n }", "@Override\n public String execute() throws DukeCommandException {\n try {\n ToDo toDo = taskManager.addToDo(this.desc);\n Storage.saveTasks(taskManager.getTasks());\n return ui.constructAddMessage(toDo, taskManager.getTasksSize());\n } catch (DukeException e) {\n throw new DukeCommandException(\"todo\", desc, e.getMessage());\n }\n }", "@Override\n public String execute(TaskList tasks, Storage storage) {\n return \"Here are the tasks in your list:\\n\" + tasks.toString();\n }", "public String getTaskId() {\n return taskId;\n }", "public String getTaskId() {\n return taskId;\n }", "public String showAdd(Task t, TaskList tasks) {\n String addMessage = \"Ain't no problem! I'm addin' this task:\\n\" + t + \"\\n\"\n + \"Now you have \" + tasks.getSize() + \" tasks in your list!\";\n return addMessage;\n }", "public static void printTaskAdded(){\n ui.showToUser(\n ui.DIVIDER,\n \" Got it. I've added this task:\\n\" + Tasks.get(Tasks.size()-1).toString(),\n \"Now you have \" + Tasks.size() + \" tasks in the list.\",\n ui.DIVIDER);\n }", "public String showUpdate(Task t) {\n String updateMessage = \"Got it! I'm updatin' this task to:\\n\" + t;\n return updateMessage;\n }" ]
[ "0.74328953", "0.7430281", "0.73929507", "0.70640063", "0.7043839", "0.7037553", "0.70347667", "0.7008083", "0.7003718", "0.6999432", "0.69390136", "0.69378245", "0.6926039", "0.68987864", "0.689064", "0.68662816", "0.6862438", "0.6857242", "0.6830236", "0.6826464", "0.67287713", "0.67287713", "0.6726364", "0.6716373", "0.6704627", "0.6679369", "0.6659352", "0.6659352", "0.6649161", "0.66098213", "0.66098213", "0.6600011", "0.6599393", "0.65923876", "0.6591603", "0.6581075", "0.65809304", "0.6569234", "0.6563352", "0.655855", "0.6537153", "0.65321016", "0.6509773", "0.65045995", "0.64392704", "0.6423971", "0.6422198", "0.64151716", "0.64127696", "0.64127696", "0.64127696", "0.64127696", "0.63947755", "0.63670146", "0.6366172", "0.63586056", "0.63579106", "0.634984", "0.6288795", "0.6288795", "0.62729067", "0.6261571", "0.62469", "0.624215", "0.624215", "0.6215939", "0.6205826", "0.61990935", "0.6197808", "0.61958575", "0.61884755", "0.6186694", "0.6162028", "0.6148103", "0.6131195", "0.612321", "0.612321", "0.6114114", "0.611403", "0.6097861", "0.6093438", "0.608734", "0.60838443", "0.6056774", "0.60562617", "0.6049316", "0.60434306", "0.6038367", "0.60285896", "0.60277575", "0.60215735", "0.60190463", "0.6010846", "0.6004432", "0.5999232", "0.5993966", "0.59762865", "0.59762865", "0.5972989", "0.59644383", "0.59625643" ]
0.0
-1
Sets the task as done. Note that conversion back to an undone state is perceived to be unnecessary as it does not make sense for done tasks to be undone.
public void setDone() { this.isDone = true; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public Task markAsDone() {\n isDone = true;\n status = \"\\u2713\"; // A tick symbol indicating the task is done.\n\n return this;\n }", "public void markAsDone() {\n this.isDone = true;\n this.completed = \"1\";\n }", "public void setDone(boolean value) {\n this.done = value;\n }", "public void setDone(boolean done) {\n this.done = done;\n }", "public void setDone(boolean done) {\n this.done = done;\n }", "public void setDone(boolean done) {\n this.done = done;\n }", "public void toggleDone() {\n this.done = !this.done;\n }", "public void setDone(boolean done) {\n\t\tthis.done = done;\n\t\t\n\t}", "public void SetDone(){\n this.isDone = true;\n }", "public void setDone(boolean done) {\n \tthis.done = done;\n }", "public void setDone(boolean doneIt)\n {\n notDone = doneIt;\n }", "public void setDone() {\n isDone = true;\n }", "public void markAsDone() {\r\n this.isDone = true;\r\n }", "public void markAsDone() {\n this.done = true;\n }", "public void markAsDone() {\n this.isDone = true;\n }", "public void markAsDone() {\n this.isDone = true;\n }", "public void markAsDone() {\n this.isDone = true;\n }", "public void markAsDone() {\n this.isDone = true;\n\n }", "public void setDone(int done) {\n\t\tthis.done = done;\n\t}", "public void markAsDone() {\n isDone = true;\n }", "public void markAsDone() {\n isDone = true;\n }", "public void markAsDone() {\n isDone = true;\n }", "public void done() {\n isDone = true;\n }", "protected void markAsDone() {\n isDone = true;\n }", "public void changeIsDone(boolean isDone) {\r\n this.isDone = isDone;\r\n }", "public void markAsDone() {\n // TODO consider adding assertion here\n isDone = true;\n }", "public void markAsDone(){\n isDone = true;\n }", "public void setTaskCompleted(TaskAttemptID taskID) {\n taskStatuses.get(taskID).setState(TaskStatus.SUCCEEDED);\n successfulTaskID = taskID;\n activeTasks.remove(taskID);\n }", "public void markDone() {\n isDone = true;\n }", "public void markAsDone() throws TaskAlreadyDoneException {\n if (!this.isDone) {\n this.isDone = true;\n } else {\n throw new TaskAlreadyDoneException();\n }\n }", "public String markDone() {\n this.isDone = true;\n return String.format(\"Nice! I've marked this task as done:\\n [X] %s\", this.description);\n }", "public void markAsUndone() {\n isDone = false;\n }", "public abstract Task markAsDone();", "public void markAsDone(String taskName) {\n \tSystem.out.println(\"Inside markAsDone()\");\n \tint count = 0;\n \t\n \tfor(Task task : toDoList) {\n \t\tif(task.getTaskName().equals(taskName)) {\n \t\t\ttask.setDone(true);\n \t\t\ttoDoList.set(count, task);\n \t\t\t}\n \t\tcount++;\n \t}\n System.out.println(\"Task Marked As Done Successfully\");\n \n System.out.println(toDoList);\n \t\n \tdisplay();\n }", "public void setisDone(boolean b) {\r\n isDone = b;\r\n }", "public void done() {\n done = true;\n }", "synchronized public void markDone() {\n this.done = true;\n }", "public String markAsDone() {\n this.isComplete = true;\n return Ui.getTaskDoneMessage(this);\n }", "private void handleMarkDone()\n throws InvalidTaskDisplayedException, DuplicateTaskException {\n Status done = new Status(true);\n ArrayList<ReadOnlyTask> markDoneTasks = tracker.getTasksFromIndexes(\n model, this.toDo.split(StringUtil.STRING_WHITESPACE), done);\n model.mark(markDoneTasks, done);\n }", "private void doMarkTaskAsCompleted() {\n System.out.println(\n \"Select the task you would like to mark as complete by entering the appropriate index number.\");\n int index = input.nextInt();\n todoList.markTaskAsCompleted(index);\n System.out.println(\"The selected task has been marked as complete. \");\n }", "public void completeTask()\n throws NumberFormatException, NullPointerException, IndexOutOfBoundsException {\n System.out.println(LINEBAR);\n try {\n int taskNumber = Integer.parseInt(userIn.split(\" \")[TASK_NUMBER]);\n\n int taskIndex = taskNumber - 1;\n\n tasks.get(taskIndex).markAsDone();\n storage.updateFile(tasks.TaskList);\n System.out.println(\"Bueno! The following task is marked as done: \\n\" + tasks.get(taskIndex));\n } catch (NumberFormatException e) {\n ui.printNumberFormatException();\n } catch (NullPointerException e) {\n ui.printNullPtrException();\n } catch (IndexOutOfBoundsException e) {\n ui.printIndexOOBException();\n }\n System.out.println(LINEBAR);\n }", "public void setDone(int entryIndex, boolean isDone) {\n\t\ttoDoList.get(entryIndex).setIsDone(isDone);\n\t}", "public void setDone(){\n this.status = \"Done\";\n }", "public void completeTask() {\n completed = true;\n }", "private TasksLists setTaskDone(ITaskCluster taskCluster, ICommonTask task, Object taskServiceResult) {\n return nextTasks(taskCluster, task, taskServiceResult);\n }", "private void setTOStateFinished(TCSObjectReference<TransportOrder> ref) {\n requireNonNull(ref, \"ref\");\n\n // Set the transport order's state.\n kernel.setTransportOrderState(ref, TransportOrder.State.FINISHED);\n TransportOrder order = kernel.getTCSObject(TransportOrder.class, ref);\n // If it is part of an order sequence, we should proceed to its next order.\n if (order.getWrappingSequence() != null) {\n OrderSequence seq = kernel.getTCSObject(OrderSequence.class,\n order.getWrappingSequence());\n // Sanity check: The finished order must be the next one in the sequence;\n // if it is not, something has already gone wrong.\n checkState(ref.equals(seq.getNextUnfinishedOrder()),\n \"Finished TO %s != next unfinished TO %s in sequence %s\",\n ref,\n seq.getNextUnfinishedOrder(),\n seq);\n kernel.setOrderSequenceFinishedIndex(seq.getReference(),\n seq.getFinishedIndex() + 1);\n // Get an up-to-date copy of the order sequence\n seq = kernel.getTCSObject(OrderSequence.class, seq.getReference());\n // If the sequence is complete and this was its last order, the sequence\n // is also finished.\n if (seq.isComplete() && seq.getNextUnfinishedOrder() == null) {\n kernel.setOrderSequenceFinished(seq.getReference());\n // Reset the processing vehicle's back reference on the sequence.\n kernel.setVehicleOrderSequence(seq.getProcessingVehicle(), null);\n }\n }\n }", "public void uncheckTask() {\n isDone = false;\n }", "void TaskFinished(Task task) {\n\n repository.finishTask(task);\n }", "public void checkOffTask() {\n isDone = true;\n }", "public static boolean toggleComplete(Task task) {\n Boolean complete = task.getCompleted(); // Get the current value\n\n // TOGGLE COMPLETE\n if (complete) // store the opposite of the current value\n complete = false;\n else\n complete = true;\n try{\n String query = \"UPDATE TASK SET ISCOMPLETE = ? WHERE (NAME = ? AND COLOUR = ? AND DATE = ?)\"; // Setup query for task\n PreparedStatement statement = DatabaseHandler.getConnection().prepareStatement(query); // Setup statement for query\n statement.setString(1, complete.toString()); // Store new isCompleted value\n statement.setString(2, task.getName()); // store values of task\n statement.setString(3, task.getColor().toString());\n statement.setString(4, Calendar.selectedDay.getDate().toString());\n int result = statement.executeUpdate(); // send out the statement\n if (result > 0){ // If swapped successfully, re-load the tasks\n getMainController().loadTasks(); // Reload the task list to update the graphics.\n }\n return (result > 0);\n } catch (SQLException e) {\n e.printStackTrace(); // If task was unable to be edited\n e.printStackTrace(); // Create alert for failing to edit\n Alert alert = new Alert(Alert.AlertType.ERROR);\n alert.setHeaderText(null);\n alert.setContentText(\"Unable to edit task.\");\n alert.showAndWait();\n }\n return false;\n }", "public Task(String task, boolean isDone) {\n this.task = task;\n this.isDone = isDone;\n }", "public static void printDoneSuccess(Task chosenTask) {\r\n CmdUx.printHBars(\"Nice! I've marked this task as done: \\n\"\r\n + \" \" + Checkbox.TICK.icon + \" \" + chosenTask.getTaskName());\r\n }", "public Event setDone() {\n return new Event(this.name, this.date, true);\n }", "public void updateToDone(int _id) {\n\n ContentValues values = new ContentValues();\n String date = DateFormat.getDateInstance().format(new Date());\n\n values.put(\"dateDone\", date);\n values.put(\"done\", 1);\n\n getWritableDatabase().update(\"tasks\", values, \"_id = '\"+_id+\"'\", null);\n }", "public void afterDone() {\n super.afterDone();\n if (wasInterrupted()) {\n InterruptibleTask interruptibleTask = this.task;\n if (interruptibleTask != null) {\n interruptibleTask.interruptTask();\n }\n }\n this.task = null;\n }", "public String printDone(Task task) {\n return \"´ ▽ ` )ノ Nice! I've marked this task as done:\\n\"\n + \"[\" + task.getStatusIcon() + \"]\" + task.getDescription() + \"\\n\";\n }", "public void completeNext()\n {\n\tTask t = toDo.get(0);\n\tt.complete();\n\ttoDo.remove(0);\n\tcompleted.add(t);\n }", "@Test\n\tpublic void testDoneCommand1() {\n\t\tString label = \"TEST\";\n\t\ttestData.getTaskMap().put(label, new ArrayList<Task>());\n\t\ttestData.addTask(new Task(1, label , \"Task 1\",\n\t\t\t\tnew TDTDateAndTime(), false));\n\t\ttestData.addTask(new Task(2, label, \"Task 2\",\n\t\t\t\tnew TDTDateAndTime(), false));\n\t\ttestData.addTask(new Task(3, label, \"Task 3\",\n\t\t\t\tnew TDTDateAndTime(), false));\n\n\t\tDoneCommand comd = new DoneCommand(label, 2);\n\t\tassertEquals(DoneCommand.MESSAGE_DONE_TASK_FEEDBACK, comd.execute(testData));\n\n\t\tArrayList<Task> taskList = testData.getTaskListFromLabel(label);\n\t\tassertEquals(3, taskList.size());\n\t\tassertTrue(taskList.get(1).isDone());\n\t\tassertFalse(taskList.get(0).isDone());\n\t\tassertFalse(taskList.get(2).isDone());\n\t}", "public void done() {\n\t\t}", "public void completeTask() {\r\n int selected = list.getSelectedIndex();\r\n if (selected >= 0) {\r\n Task task = myTodo.getTaskByIndex(selected + 1);\r\n myTodo.getTodo().get(task.getHashKey()).setComplete(true);\r\n showCompleted = true;\r\n playSound(\"c1.wav\");\r\n }\r\n todoListGui();\r\n }", "public void setDoneDate(Date doneDate) {\n this.doneDate = doneDate;\n }", "public void setDoneDate(Date doneDate) {\n this.doneDate = doneDate;\n }", "public void setDoneDate(Date doneDate) {\n this.doneDate = doneDate;\n }", "public void setDoneDate(Date doneDate) {\n this.doneDate = doneDate;\n }", "public void setCompleted() {\n this.completed = true;\n }", "@Test\n\tpublic void testDoneCommand2() {\n\t\tString label = \"TEST\";\n\t\ttestData.getTaskMap().put(label, new ArrayList<Task>());\n\t\ttestData.addTask(new Task(1, label , \"Task 1\",\n\t\t\t\tnew TDTDateAndTime(), false));\n\t\ttestData.addTask(new Task(2, label, \"Task 2\",\n\t\t\t\tnew TDTDateAndTime(), false));\n\t\ttestData.addTask(new Task(3, label, \"Task 3\",\n\t\t\t\tnew TDTDateAndTime(), false));\n\n\t\tDoneCommand comd = new DoneCommand(label, 3);\n\t\tassertEquals(DoneCommand.MESSAGE_DONE_TASK_FEEDBACK, comd.execute(testData));\n\n\t\tArrayList<Task> taskList = testData.getTaskListFromLabel(label);\n\t\tassertEquals(3, taskList.size());\n\t\tassertTrue(taskList.get(2).isDone());\n\t\tassertFalse(taskList.get(0).isDone());\n\t\tassertFalse(taskList.get(1).isDone());\n\t}", "@Override\n\t\tpublic void done() {\n\n\t\t}", "Task(String description, boolean isDone) throws DateTimeException {\n this.description = description;\n this.isDone = isDone;\n }", "public boolean getDone(){\r\n\t\treturn done;\r\n\t}", "public Task(String description, boolean done) {\r\n this.description = description;\r\n this.isDone = done;\r\n }", "public Task(boolean isDone, String description) {\n this.description = description;\n this.isDone = isDone;\n }", "public void CompleteTask() {\n\t\tCompletionDate = new Date();\n\t}", "public void setCompleted(boolean flag) {\r\n completed = flag;\r\n }", "public boolean getDone() {\n return isDone;\n }", "public void setCompleted(){\r\n\t\tisCompleted = true;\r\n\t}", "public DoneCommand(int taskNum) {\n this.taskNum = taskNum;\n }", "public void markTaskCompleted(int taskIndex) {\n Task taskToMark = tasks.get(taskIndex);\n taskToMark.markTaskAsCompleted();\n cachedTasks.push(new CachedTask(taskToMark, \"done\", taskIndex));\n }", "@Override\n public String markComplete() {\n if (this.isDone) {\n return Ui.getTaskAlrCompletedMessage(this);\n } else {\n this.isDone = true;\n return Ui.getMarkCompleteEventMessage(this);\n }\n }", "public void done() {\n try {\n AsyncTask.this.a(get());\n } catch (InterruptedException e) {\n Log.w(\"AsyncTask\", e);\n } catch (ExecutionException e2) {\n throw new RuntimeException(\"An error occured while executing doInBackground()\", e2.getCause());\n } catch (CancellationException unused) {\n AsyncTask.this.a(null);\n }\n }", "public void set_completed();", "public void done() {\n \t\t\t\t\t\t}", "public void undoCompleteTask() {\r\n int selected = list.getSelectedIndex();\r\n if (selected >= 0) {\r\n Task task = myTodo.getTaskByIndex(selected + 1);\r\n myTodo.getTodo().get(task.getHashKey()).setComplete(false);\r\n showCompleted = false;\r\n }\r\n todoListGui();\r\n }", "public boolean getDoneStatus(){\n return isDone;\n }", "public void done() {\n if (!isCancelled()) {\n try {\n C0637h.this.mo7991a(get());\n } catch (InterruptedException | ExecutionException e) {\n C0637h.this.mo7992a(e.getCause());\n }\n } else {\n C0637h.this.mo7992a((Throwable) new CancellationException());\n }\n }", "public void reset() {\n this.done = false;\n }", "public Task(String task, boolean isDone, Date dueDate) {\n this.task = task;\n this.isDone = isDone;\n this.dueDate = dueDate;\n }", "synchronized public void jobDone(){ // l'action a été réalisée\n\t\tdone = true; // changement d'état\n\t\tthis.notifyAll(); // on notifie tout le monde\n\t}", "@Override\n public Task markUndone() {\n ReadOnlyTask oldTask = this;\n \n TaskName newName = oldTask.getName();\n TaskTime newStartTime = oldTask.getStartTime();\n TaskTime newEndTime = oldTask.getEndTime();\n TaskTime newDeadline = oldTask.getDeadline();\n Tag newTag = oldTask.getTag();\n\n Task newTask = null;\n try {\n newTask = new Task(newName, newStartTime, newEndTime, newDeadline, newTag, false);\n } catch (IllegalValueException e) {\n assert false;\n }\n return newTask;\n }", "public void setTask(TaskDTO task) {\n\t\tthis.task = task;\r\n\t\t\r\n\t\t\r\n\t}", "public void markComplete(int taskNumber) {\n Task currentTask = storage.get(taskNumber);\n currentTask.complete();\n line();\n System.out.println(\"Marked task \" + (taskNumber + 1) + \" as complete.\");\n System.out.println(currentTask);\n line();\n }", "void addDoneTask(Task task);", "@Override\n\tpublic boolean done() {\n\t\tfor(Task t : details.getPendingTasks()){\n\t\t\tif(!t.isComplete())\n\t\t\t\treturn false;\n\t\t}\n\t\treturn true;\n\t}", "public void markDone(int index, ArrayList<Task> tasks) {\n if ((index <= tasks.size()) && (index > 0)) {\n (tasks.get(index - 1)).setDone();\n System.out.println(printUnderscores());\n System.out.println(\"Nice! I've marked this as done:\\n \" + tasks.get(index - 1).printTask());\n } else {\n System.out.println(\"Invalid index!\");\n }\n }", "@Override\n public boolean isDone() {\n return done;\n }", "@Test\n public void setStatusDone_shouldReturnTrueForStatus() {\n Task task = new Task(\"Test\");\n task.setStatusDone();\n Assertions.assertTrue(task.getStatus());\n }", "public String getDone() {\n return (isDone ? \"1\" : \"0\");\n }", "@Override\n\tprotected void done() {\n\t\tif (isCancelled()) {\n\t\t\tSystem.out.printf(\"%s: Has been canceled\\n\", name);\n\t\t} else {\n\t\t\tSystem.out.printf(\"%s: Has finished\\n\", name);\n\t\t}\n\t}", "void deleteDoneTask(ReadOnlyTask floatingTask) throws TaskNotFoundException;" ]
[ "0.7332076", "0.72991604", "0.72784877", "0.72768986", "0.72768986", "0.72572947", "0.7171763", "0.7150601", "0.71355486", "0.71331173", "0.7113931", "0.70548326", "0.7011048", "0.70032966", "0.6973069", "0.6973069", "0.6973069", "0.6947684", "0.69448876", "0.68455935", "0.68455935", "0.68455935", "0.6776539", "0.6761771", "0.6757642", "0.67513365", "0.6749604", "0.67467725", "0.67305565", "0.672428", "0.67093647", "0.6625252", "0.6582478", "0.6573149", "0.6496942", "0.64848834", "0.6429738", "0.641781", "0.637188", "0.6349731", "0.6305524", "0.626382", "0.6206336", "0.6196747", "0.61697125", "0.61431843", "0.6136251", "0.6114913", "0.6094988", "0.6012959", "0.60032314", "0.5995764", "0.59642136", "0.5916196", "0.5900839", "0.5864276", "0.5858938", "0.5850877", "0.58463514", "0.58454037", "0.58345175", "0.58345175", "0.58345175", "0.58345175", "0.58305293", "0.581916", "0.5773308", "0.57600564", "0.573768", "0.57235134", "0.5696893", "0.5672318", "0.56670517", "0.56604314", "0.5638835", "0.5628096", "0.5623453", "0.5600604", "0.5599674", "0.559853", "0.5597042", "0.5596168", "0.5589327", "0.5576982", "0.5575942", "0.55610347", "0.5556166", "0.5548332", "0.5531121", "0.55194116", "0.5515652", "0.55099356", "0.5496837", "0.547889", "0.5472051", "0.546387", "0.5443834", "0.5441858" ]
0.72633195
7
/ renamed from: b
public final C5894b mo27872b() { return new C5894b().mo28250a(this.f18207a); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "void mo2508a(bxb bxb);", "@Override\n public void func_104112_b() {\n \n }", "@Override\n public void b() {\n }", "public interface C19351a {\n /* renamed from: b */\n void mo30633b(int i, String str, byte[] bArr);\n }", "@Override\n\tpublic void b2() {\n\t\t\n\t}", "void metodo1(int a, int[] b) {\r\n\t\ta += 5;//Par\\u00e1metro con el mismo nombre que el campo de la clase.\r\n\t\tb[0] += 7;//se produce un env\\u00edo por referencia, apunta a una copia de un objeto, que se asigna aqu\\u00ed.\r\n\t}", "interface bxc {\n /* renamed from: a */\n void mo2508a(bxb bxb);\n}", "@Override\n\tpublic void b() {\n\n\t}", "interface C30585a {\n /* renamed from: b */\n void mo27952b(C5379a c5379a, int i, C46650a c46650a, C7620bi c7620bi);\n }", "public bb b() {\n return a(this.a);\n }", "@Override\n\tpublic void b1() {\n\t\t\n\t}", "public void b() {\r\n }", "@Override\n\tpublic void bbb() {\n\t\t\n\t}", "public interface C34379a {\n /* renamed from: a */\n void mo46242a(bmc bmc);\n }", "public abstract void b(StringBuilder sb);", "public void b() {\n }", "public void b() {\n }", "protected b(int mb) {\n/* 87 */ this.b = mb;\n/* */ }", "public u(b paramb)\r\n/* 7: */ {\r\n/* 8: 9 */ this.a = paramb;\r\n/* 9: */ }", "public interface b {\n void H_();\n\n void I_();\n\n void J_();\n\n void a(C0063d dVar);\n\n void a(byte[] bArr);\n\n void b(boolean z);\n }", "public b[] a() {\n/* 95 */ return this.a;\n/* */ }", "public interface C7654b {\n /* renamed from: a */\n C7904c mo24084a();\n\n /* renamed from: b */\n C7716a mo24085b();\n }", "public interface C1153a {\n /* renamed from: a */\n void mo4520a(byte[] bArr);\n }", "public interface C43499b {\n /* renamed from: a */\n void mo8445a(int i, String str, int i2, byte[] bArr);\n}", "public void b() {\n ((a) this.a).b();\n }", "public np a()\r\n/* 33: */ {\r\n/* 34:49 */ return this.b;\r\n/* 35: */ }", "b(a aVar) {\n super(0);\n this.this$0 = aVar;\n }", "public t b() {\n return a(this.a);\n }", "public interface C32456b<T> {\n /* renamed from: a */\n void mo83696a(T t);\n }", "public static String a(int c) {\n/* 89 */ return b.a(c);\n/* */ }", "private void m678b(byte b) {\n byte[] bArr = this.f523r;\n bArr[0] = b;\n this.f552g.mo502b(bArr);\n }", "public interface C23407b {\n /* renamed from: a */\n void mo60892a();\n\n /* renamed from: b */\n void mo60893b();\n }", "public abstract T zzm(B b);", "public b a()\r\n/* 12: */ {\r\n/* 13:13 */ return this.a;\r\n/* 14: */ }", "public void b(World paramaqu, BlockPosition paramdt, Block parambec)\r\n/* 27: */ {\r\n/* 28: 47 */ bcm localbcm = paramaqu.s(paramdt);\r\n/* 29: 48 */ if ((localbcm instanceof bdv)) {\r\n/* 30: 49 */ ((bdv)localbcm).h();\r\n/* 31: */ } else {\r\n/* 32: 51 */ super.b(paramaqu, paramdt, parambec);\r\n/* 33: */ }\r\n/* 34: */ }", "public abstract void zzc(B b, int i, int i2);", "public interface b {\n}", "public interface b {\n}", "private void m10263b(byte b) throws cf {\r\n this.f6483r[0] = b;\r\n this.g.m10347b(this.f6483r);\r\n }", "BSubstitution createBSubstitution();", "public void b(ahd paramahd) {}", "void b();", "public interface C18928d {\n /* renamed from: a */\n void mo50320a(C18924b bVar);\n\n /* renamed from: b */\n void mo50321b(C18924b bVar);\n}", "B database(S database);", "public interface C0615ja extends b<HomeFragment> {\n\n /* renamed from: c.c.a.h.b.ja$a */\n /* compiled from: FragmentModule_HomeFragment$app_bazaarRelease */\n public static abstract class a extends b.a<HomeFragment> {\n }\n}", "public abstract C0631bt mo9227aB();", "public an b() {\n return a(this.a);\n }", "protected abstract void a(bru parambru);", "static void go(Base b) {\n\t\tb.add(8);\n\t}", "void mo46242a(bmc bmc);", "public interface b extends c {\n void a(Float f);\n\n void a(Integer num);\n\n void b(Float f);\n\n void c(Float f);\n\n String d();\n\n void d(Float f);\n\n void d(String str);\n\n void e(Float f);\n\n void e(String str);\n\n void f(String str);\n\n void g(String str);\n\n Long j();\n\n LineChart k();\n }", "public interface bca extends bbn {\n bca a();\n\n bca a(String str);\n\n bca b(String str);\n\n bca c(String str);\n}", "public interface a extends com.bankeen.d.b.b.a {\n void a();\n\n void b();\n }", "public abstract BoundType b();", "public void b(amj paramamj)\r\n/* 538: */ {\r\n/* 539:579 */ this.f = paramamj;\r\n/* 540: */ }", "b(a aVar, com.bytedance.jedi.model.h.a aVar2) {\n super(aVar2);\n this.f21531a = aVar;\n this.f21532b = new com.bytedance.jedi.model.h.f(aVar);\n }", "private void b(int paramInt)\r\n/* 193: */ {\r\n/* 194:203 */ this.h.a(a(paramInt));\r\n/* 195: */ }", "public void b(ahb paramahb)\r\n/* 583: */ {\r\n/* 584:625 */ for (int i = 0; i < this.a.length; i++) {\r\n/* 585:626 */ this.a[i] = amj.b(paramahb.a[i]);\r\n/* 586: */ }\r\n/* 587:628 */ for (i = 0; i < this.b.length; i++) {\r\n/* 588:629 */ this.b[i] = amj.b(paramahb.b[i]);\r\n/* 589: */ }\r\n/* 590:631 */ this.c = paramahb.c;\r\n/* 591: */ }", "interface b {\n\n /* compiled from: CreditAccountContract */\n public interface a extends com.bankeen.d.b.b.a {\n void a();\n\n void b();\n }\n\n /* compiled from: CreditAccountContract */\n public interface b extends c {\n void a(Float f);\n\n void a(Integer num);\n\n void b(Float f);\n\n void c(Float f);\n\n String d();\n\n void d(Float f);\n\n void d(String str);\n\n void e(Float f);\n\n void e(String str);\n\n void f(String str);\n\n void g(String str);\n\n Long j();\n\n LineChart k();\n }\n}", "@Override\n\tpublic void visit(PartB partB) {\n\n\t}", "public abstract void zzb(B b, int i, long j);", "public abstract void zza(B b, int i, zzeh zzeh);", "int metodo2(int a, int b) {\r\n\r\n\t\tthis.a += 5; // se modifica el campo del objeto, el uso de la palabra reservada this se utiliza para referenciar al campo.\r\n\t\tb += 7;\r\n\t\treturn a; // modifica en la asignaci\\u00f3n\r\n\t}", "private void internalCopy(Board b) {\n for (int i = 0; i < SIDE * SIDE; i += 1) {\n set(i, b.get(i));\n }\n\n _directions = b._directions;\n _whoseMove = b._whoseMove;\n _history = b._history;\n }", "public int b()\r\n/* 69: */ {\r\n/* 70:74 */ return this.b;\r\n/* 71: */ }", "public void b(StringBuilder sb) {\n sb.append(this.a);\n sb.append(')');\n }", "public void b() {\n e$a e$a;\n try {\n e$a = this.b;\n }\n catch (IOException iOException) {\n return;\n }\n Object object = this.c;\n e$a.b(object);\n }", "public abstract void a(StringBuilder sb);", "public interface C45101e {\n /* renamed from: b */\n void mo3796b(int i);\n}", "public abstract void zzf(Object obj, B b);", "public interface bdp {\n\n /* renamed from: a */\n public static final bdp f3422a = new bdo();\n\n /* renamed from: a */\n bdm mo1784a(akh akh);\n}", "@Override\n\tpublic void parse(Buffer b) {\n\t\t\n\t}", "@Override\n\t\t\t\tpublic void a() {\n\n\t\t\t\t}", "public abstract void a(b paramb, int paramInt1, int paramInt2);", "public void mo1945a(byte b) throws cf {\r\n m10263b(b);\r\n }", "void mo83703a(C32456b<T> bVar);", "public void a(String str) {\n ((b.b) this.b).d(str);\n }", "public void selectB() { }", "BOperation createBOperation();", "void metodo1(int a, int b) {\r\n\t\ta += 5;//par\\u00e1metro con el mismo nombre que el campo.\r\n\t\tb += 7;\r\n\t}", "private static void m2196a(StringBuffer stringBuffer, byte b) {\n stringBuffer.append(\"0123456789ABCDEF\".charAt((b >> 4) & 15)).append(\"0123456789ABCDEF\".charAt(b & 15));\n }", "public interface C1799a {\n /* renamed from: b */\n void mo3314b(String str);\n }", "public void b(fv paramfv)\r\n/* 408: */ {\r\n/* 409:423 */ this.a = new amj[36];\r\n/* 410:424 */ this.b = new amj[4];\r\n/* 411:425 */ for (int i = 0; i < paramfv.c(); i++)\r\n/* 412: */ {\r\n/* 413:426 */ fn localfn = paramfv.b(i);\r\n/* 414:427 */ int j = localfn.d(\"Slot\") & 0xFF;\r\n/* 415:428 */ amj localamj = amj.a(localfn);\r\n/* 416:429 */ if (localamj != null)\r\n/* 417: */ {\r\n/* 418:430 */ if ((j >= 0) && (j < this.a.length)) {\r\n/* 419:431 */ this.a[j] = localamj;\r\n/* 420: */ }\r\n/* 421:433 */ if ((j >= 100) && (j < this.b.length + 100)) {\r\n/* 422:434 */ this.b[(j - 100)] = localamj;\r\n/* 423: */ }\r\n/* 424: */ }\r\n/* 425: */ }\r\n/* 426: */ }", "public void b(String str) {\n ((b.b) this.b).e(str);\n }", "public String b()\r\n/* 35: */ {\r\n/* 36:179 */ return a();\r\n/* 37: */ }", "public abstract void zza(B b, int i, T t);", "public Item b(World paramaqu, BlockPosition paramdt)\r\n/* 189: */ {\r\n/* 190:220 */ return null;\r\n/* 191: */ }", "public abstract void zza(B b, int i, long j);", "public interface C5101b {\n /* renamed from: a */\n void mo5289a(C5102c c5102c);\n\n /* renamed from: b */\n void mo5290b(C5102c c5102c);\n}", "private interface C0257a {\n /* renamed from: a */\n float mo196a(ViewGroup viewGroup, View view);\n\n /* renamed from: b */\n float mo195b(ViewGroup viewGroup, View view);\n }", "public abstract void mo9798a(byte b);", "public void mo9798a(byte b) {\n if (this.f9108f == this.f9107e) {\n mo9827i();\n }\n byte[] bArr = this.f9106d;\n int i = this.f9108f;\n this.f9108f = i + 1;\n bArr[i] = b;\n this.f9109g++;\n }", "public interface C1234b {\r\n /* renamed from: a */\r\n void m8367a();\r\n\r\n /* renamed from: b */\r\n void m8368b();\r\n}", "private void m676a(TField bkVar, byte b) {\n if (b == -1) {\n b = m687e(bkVar.f538b);\n }\n short s = bkVar.f539c;\n short s2 = this.f519n;\n if (s <= s2 || s - s2 > 15) {\n m678b(b);\n mo446a(bkVar.f539c);\n } else {\n m686d(b | ((s - s2) << 4));\n }\n this.f519n = bkVar.f539c;\n }", "private static void m831a(C0741g<?> gVar, C0747b bVar) {\n gVar.mo9477a(C0743i.f718b, (C0739e<? super Object>) bVar);\n gVar.mo9476a(C0743i.f718b, (C0738d) bVar);\n gVar.mo9474a(C0743i.f718b, (C0736b) bVar);\n }", "public interface C40453c {\n /* renamed from: a */\n void mo100442a(C40429b bVar);\n\n /* renamed from: a */\n void mo100443a(List<String> list);\n\n /* renamed from: b */\n void mo100444b(List<C40429b> list);\n}", "private void j()\n/* */ {\n/* 223 */ c localc = this.b;\n/* 224 */ this.b = this.c;\n/* 225 */ this.c = localc;\n/* 226 */ this.c.b();\n/* */ }", "public lj ar(byte b) {\n throw new Runtime(\"d2j fail translate: java.lang.RuntimeException: can not merge I and Z\\r\\n\\tat com.googlecode.dex2jar.ir.TypeClass.merge(TypeClass.java:100)\\r\\n\\tat com.googlecode.dex2jar.ir.ts.TypeTransformer$TypeRef.updateTypeClass(TypeTransformer.java:174)\\r\\n\\tat com.googlecode.dex2jar.ir.ts.TypeTransformer$TypeAnalyze.provideAs(TypeTransformer.java:780)\\r\\n\\tat com.googlecode.dex2jar.ir.ts.TypeTransformer$TypeAnalyze.e1expr(TypeTransformer.java:496)\\r\\n\\tat com.googlecode.dex2jar.ir.ts.TypeTransformer$TypeAnalyze.exExpr(TypeTransformer.java:713)\\r\\n\\tat com.googlecode.dex2jar.ir.ts.TypeTransformer$TypeAnalyze.exExpr(TypeTransformer.java:703)\\r\\n\\tat com.googlecode.dex2jar.ir.ts.TypeTransformer$TypeAnalyze.enexpr(TypeTransformer.java:698)\\r\\n\\tat com.googlecode.dex2jar.ir.ts.TypeTransformer$TypeAnalyze.exExpr(TypeTransformer.java:719)\\r\\n\\tat com.googlecode.dex2jar.ir.ts.TypeTransformer$TypeAnalyze.exExpr(TypeTransformer.java:703)\\r\\n\\tat com.googlecode.dex2jar.ir.ts.TypeTransformer$TypeAnalyze.s1stmt(TypeTransformer.java:810)\\r\\n\\tat com.googlecode.dex2jar.ir.ts.TypeTransformer$TypeAnalyze.sxStmt(TypeTransformer.java:840)\\r\\n\\tat com.googlecode.dex2jar.ir.ts.TypeTransformer$TypeAnalyze.analyze(TypeTransformer.java:206)\\r\\n\\tat com.googlecode.dex2jar.ir.ts.TypeTransformer.transform(TypeTransformer.java:44)\\r\\n\\tat com.googlecode.d2j.dex.Dex2jar$2.optimize(Dex2jar.java:162)\\r\\n\\tat com.googlecode.d2j.dex.Dex2Asm.convertCode(Dex2Asm.java:414)\\r\\n\\tat com.googlecode.d2j.dex.ExDex2Asm.convertCode(ExDex2Asm.java:42)\\r\\n\\tat com.googlecode.d2j.dex.Dex2jar$2.convertCode(Dex2jar.java:128)\\r\\n\\tat com.googlecode.d2j.dex.Dex2Asm.convertMethod(Dex2Asm.java:509)\\r\\n\\tat com.googlecode.d2j.dex.Dex2Asm.convertClass(Dex2Asm.java:406)\\r\\n\\tat com.googlecode.d2j.dex.Dex2Asm.convertDex(Dex2Asm.java:422)\\r\\n\\tat com.googlecode.d2j.dex.Dex2jar.doTranslate(Dex2jar.java:172)\\r\\n\\tat com.googlecode.d2j.dex.Dex2jar.to(Dex2jar.java:272)\\r\\n\\tat com.googlecode.dex2jar.tools.Dex2jarCmd.doCommandLine(Dex2jarCmd.java:108)\\r\\n\\tat com.googlecode.dex2jar.tools.BaseCmd.doMain(BaseCmd.java:288)\\r\\n\\tat com.googlecode.dex2jar.tools.Dex2jarCmd.main(Dex2jarCmd.java:32)\\r\\n\");\n }", "public interface AbstractC10485b {\n /* renamed from: a */\n void mo64153a(boolean z);\n }", "public interface C40108b {\n /* renamed from: a */\n void mo99838a(boolean z);\n }", "interface C8361a {\n /* renamed from: b */\n float mo18284b(ViewGroup viewGroup, View view);\n\n /* renamed from: c */\n float mo18281c(ViewGroup viewGroup, View view);\n }" ]
[ "0.64558864", "0.6283203", "0.6252635", "0.6250949", "0.6244743", "0.6216273", "0.6194491", "0.6193556", "0.61641675", "0.6140157", "0.60993093", "0.60974354", "0.6077849", "0.6001867", "0.5997364", "0.59737104", "0.59737104", "0.5905105", "0.5904295", "0.58908087", "0.5886636", "0.58828026", "0.5855491", "0.584618", "0.5842517", "0.5824137", "0.5824071", "0.58097327", "0.5802052", "0.58012927", "0.579443", "0.5792392", "0.57902914", "0.5785124", "0.57718205", "0.57589084", "0.5735892", "0.5735892", "0.5734873", "0.5727929", "0.5720821", "0.5712531", "0.5706813", "0.56896514", "0.56543154", "0.5651059", "0.5649904", "0.56496733", "0.5647035", "0.5640965", "0.5640109", "0.563993", "0.5631903", "0.5597427", "0.55843794", "0.5583287", "0.557783", "0.55734867", "0.55733293", "0.5572254", "0.55683887", "0.55624336", "0.55540246", "0.5553985", "0.55480546", "0.554261", "0.5535739", "0.5529958", "0.5519634", "0.5517503", "0.55160624", "0.5511545", "0.5505353", "0.5500533", "0.5491741", "0.5486198", "0.5481978", "0.547701", "0.54725856", "0.5471632", "0.5463497", "0.5460805", "0.5454913", "0.5454885", "0.54519916", "0.5441594", "0.5436747", "0.5432453", "0.5425923", "0.5424724", "0.54189867", "0.54162544", "0.54051477", "0.53998184", "0.53945845", "0.53887725", "0.5388146", "0.5387678", "0.53858143", "0.53850687", "0.5384439" ]
0.0
-1
/ renamed from: c
public final byte mo27873c() { return 6; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "void mo5289a(C5102c c5102c);", "public static void c0() {\n\t}", "void mo57278c();", "private static void cajas() {\n\t\t\n\t}", "void mo5290b(C5102c c5102c);", "void mo80457c();", "void mo12638c();", "void mo28717a(zzc zzc);", "void mo21072c();", "@Override\n\tpublic void ccc() {\n\t\t\n\t}", "public void c() {\n }", "void mo17012c();", "C2451d mo3408a(C2457e c2457e);", "void mo88524c();", "void mo86a(C0163d c0163d);", "void mo17021c();", "public abstract void mo53562a(C18796a c18796a);", "void mo4874b(C4718l c4718l);", "void mo4873a(C4718l c4718l);", "C12017a mo41088c();", "public abstract void mo70702a(C30989b c30989b);", "void mo72114c();", "public void mo12628c() {\n }", "C2841w mo7234g();", "public interface C0335c {\n }", "public void mo1403c() {\n }", "public static void c3() {\n\t}", "public static void c1() {\n\t}", "void mo8712a(C9714a c9714a);", "void mo67924c();", "public void mo97906c() {\n }", "public abstract void mo27385c();", "String mo20731c();", "public int c()\r\n/* 74: */ {\r\n/* 75:78 */ return this.c;\r\n/* 76: */ }", "public interface C0939c {\n }", "void mo1582a(String str, C1329do c1329do);", "void mo304a(C0366h c0366h);", "void mo1493c();", "private String getString(byte c) {\n\t\treturn c==1? \"$ \": \" \";\n\t}", "java.lang.String getC3();", "C45321i mo90380a();", "public interface C11910c {\n}", "void mo57277b();", "String mo38972c();", "static int type_of_cnc(String passed){\n\t\treturn 1;\n\t}", "public static void CC2_1() {\n\t}", "static int type_of_cc(String passed){\n\t\treturn 1;\n\t}", "public interface C7654b {\n /* renamed from: a */\n C7904c mo24084a();\n\n /* renamed from: b */\n C7716a mo24085b();\n }", "public void mo56167c() {\n }", "public interface C0136c {\n }", "private void kk12() {\n\n\t}", "abstract String mo1748c();", "public abstract void mo70710a(String str, C24343db c24343db);", "public interface C0303q extends C0291e {\n /* renamed from: a */\n void mo1747a(int i);\n\n /* renamed from: a */\n void mo1749a(C0288c cVar);\n\n /* renamed from: a */\n void mo1751a(byte[] bArr);\n\n /* renamed from: b */\n void mo1753b(int i);\n\n /* renamed from: c */\n void mo1754c(int i);\n\n /* renamed from: d */\n void mo1755d(int i);\n\n /* renamed from: e */\n int mo1756e(int i);\n\n /* renamed from: g */\n int mo1760g();\n\n /* renamed from: g */\n void mo1761g(int i);\n\n /* renamed from: h */\n void mo1763h(int i);\n}", "C3577c mo19678C();", "public abstract int c();", "public abstract int c();", "public final void mo11687c() {\n }", "byte mo30283c();", "private java.lang.String c(java.lang.String r7) {\n /*\n r6 = this;\n r2 = \"\";\n r0 = r6.e;\t Catch:{ FileNotFoundException -> 0x0052 }\n if (r0 == 0) goto L_0x0050;\n L_0x0006:\n r0 = new java.lang.StringBuilder;\t Catch:{ FileNotFoundException -> 0x0052 }\n r1 = java.lang.String.valueOf(r7);\t Catch:{ FileNotFoundException -> 0x0052 }\n r0.<init>(r1);\t Catch:{ FileNotFoundException -> 0x0052 }\n r1 = \".\";\n r0 = r0.append(r1);\t Catch:{ FileNotFoundException -> 0x0052 }\n r1 = r6.e;\t Catch:{ FileNotFoundException -> 0x0052 }\n r0 = r0.append(r1);\t Catch:{ FileNotFoundException -> 0x0052 }\n r0 = r0.toString();\t Catch:{ FileNotFoundException -> 0x0052 }\n L_0x001f:\n r1 = r6.d;\t Catch:{ FileNotFoundException -> 0x0052 }\n r1 = r1.openFileInput(r0);\t Catch:{ FileNotFoundException -> 0x0052 }\n L_0x0025:\n r3 = new java.io.BufferedReader;\n r4 = new java.io.InputStreamReader;\n r0 = r1;\n r0 = (java.io.InputStream) r0;\n r5 = \"UTF-8\";\n r5 = java.nio.charset.Charset.forName(r5);\n r4.<init>(r0, r5);\n r3.<init>(r4);\n r0 = new java.lang.StringBuffer;\n r0.<init>();\n L_0x003d:\n r4 = r3.readLine();\t Catch:{ IOException -> 0x0065, all -> 0x0073 }\n if (r4 != 0) goto L_0x0061;\n L_0x0043:\n r0 = r0.toString();\t Catch:{ IOException -> 0x0065, all -> 0x0073 }\n r1 = (java.io.InputStream) r1;\t Catch:{ IOException -> 0x007d }\n r1.close();\t Catch:{ IOException -> 0x007d }\n r3.close();\t Catch:{ IOException -> 0x007d }\n L_0x004f:\n return r0;\n L_0x0050:\n r0 = r7;\n goto L_0x001f;\n L_0x0052:\n r0 = move-exception;\n r0 = r6.d;\t Catch:{ IOException -> 0x005e }\n r0 = r0.getAssets();\t Catch:{ IOException -> 0x005e }\n r1 = r0.open(r7);\t Catch:{ IOException -> 0x005e }\n goto L_0x0025;\n L_0x005e:\n r0 = move-exception;\n r0 = r2;\n goto L_0x004f;\n L_0x0061:\n r0.append(r4);\t Catch:{ IOException -> 0x0065, all -> 0x0073 }\n goto L_0x003d;\n L_0x0065:\n r0 = move-exception;\n r1 = (java.io.InputStream) r1;\t Catch:{ IOException -> 0x0070 }\n r1.close();\t Catch:{ IOException -> 0x0070 }\n r3.close();\t Catch:{ IOException -> 0x0070 }\n r0 = r2;\n goto L_0x004f;\n L_0x0070:\n r0 = move-exception;\n r0 = r2;\n goto L_0x004f;\n L_0x0073:\n r0 = move-exception;\n r1 = (java.io.InputStream) r1;\t Catch:{ IOException -> 0x007f }\n r1.close();\t Catch:{ IOException -> 0x007f }\n r3.close();\t Catch:{ IOException -> 0x007f }\n L_0x007c:\n throw r0;\n L_0x007d:\n r1 = move-exception;\n goto L_0x004f;\n L_0x007f:\n r1 = move-exception;\n goto L_0x007c;\n */\n throw new UnsupportedOperationException(\"Method not decompiled: com.tencent.a.b.b.c(java.lang.String):java.lang.String\");\n }", "@Override\n\tpublic void compile(CodeBlock c, CompilerEnvironment environment) {\n\n\t}", "public interface C3196it extends C3208jc {\n /* renamed from: a */\n void mo30275a(long j);\n\n /* renamed from: b */\n C3197iu mo30281b(long j);\n\n /* renamed from: b */\n boolean mo30282b();\n\n /* renamed from: c */\n byte mo30283c();\n\n /* renamed from: c */\n String mo30285c(long j);\n\n /* renamed from: d */\n void mo30290d(long j);\n\n /* renamed from: e */\n int mo30291e();\n\n /* renamed from: f */\n long mo30295f();\n}", "public static void mmcc() {\n\t}", "java.lang.String getCit();", "public abstract C mo29734a();", "C15430g mo56154a();", "void mo41086b();", "@Override\n public void func_104112_b() {\n \n }", "public interface C9223b {\n }", "public abstract String mo11611b();", "void mo27952b(C5379a c5379a, int i, C46650a c46650a, C7620bi c7620bi);", "String getCmt();", "interface C30585a {\n /* renamed from: b */\n void mo27952b(C5379a c5379a, int i, C46650a c46650a, C7620bi c7620bi);\n }", "interface C2578d {\n}", "public interface C1803l extends C1813t {\n /* renamed from: b */\n C1803l mo7382b(C2778au auVar);\n\n /* renamed from: f */\n List<C1700ar> mo7233f();\n\n /* renamed from: g */\n C2841w mo7234g();\n\n /* renamed from: q */\n C1800i mo7384q();\n}", "double fFromC(double c) {\n return (c * 9 / 5) + 32;\n }", "void mo72113b();", "void mo1749a(C0288c cVar);", "public interface C0764b {\n}", "void mo41083a();", "String[] mo1153c();", "C1458cs mo7613iS();", "public interface C0333a {\n }", "public abstract int mo41077c();", "public interface C8843g {\n}", "public abstract void mo70709a(String str, C41018cm c41018cm);", "void mo28307a(zzgd zzgd);", "public static void mcdc() {\n\t}", "public interface C2459d {\n /* renamed from: a */\n C2451d mo3408a(C2457e c2457e);\n}", "C1435c mo1754a(C1433a c1433a, C1434b c1434b);", "public interface C0389gj extends C0388gi {\n}", "C5727e mo33224a();", "C12000e mo41087c(String str);", "public abstract String mo118046b();", "public interface C11113o {\n /* renamed from: a */\n void mo37759a(String str);\n }", "public interface C0938b {\n }", "void mo80455b();", "public interface C0385a {\n }", "public interface C5527c {\n /* renamed from: a */\n int mo4095a(int i);\n\n /* renamed from: b */\n C5537g mo4096b(int i);\n}", "public interface C32231g {\n /* renamed from: a */\n void mo8280a(int i, int i2, C1207m c1207m);\n}", "public interface C11994b {\n /* renamed from: a */\n C11996a mo41079a(String str);\n\n /* renamed from: a */\n C11996a mo41080a(String str, C11997b bVar, String... strArr);\n\n /* renamed from: a */\n C11998c mo41081a(String str, C11999d dVar, String... strArr);\n\n /* renamed from: a */\n C12000e mo41082a(String str, C12001f fVar, String... strArr);\n\n /* renamed from: a */\n void mo41083a();\n\n /* renamed from: a */\n void mo41084a(C12018b bVar, ConnectionState... connectionStateArr);\n\n /* renamed from: b */\n C11996a mo41085b(String str);\n\n /* renamed from: b */\n void mo41086b();\n\n /* renamed from: c */\n C12000e mo41087c(String str);\n\n /* renamed from: c */\n C12017a mo41088c();\n\n /* renamed from: d */\n void mo41089d(String str);\n\n /* renamed from: e */\n C11998c mo41090e(String str);\n\n /* renamed from: f */\n C12000e mo41091f(String str);\n\n /* renamed from: g */\n C11998c mo41092g(String str);\n}" ]
[ "0.64592767", "0.644052", "0.6431582", "0.6418656", "0.64118475", "0.6397491", "0.6250796", "0.62470585", "0.6244832", "0.6232792", "0.618864", "0.61662376", "0.6152657", "0.61496663", "0.6138441", "0.6137171", "0.6131197", "0.6103783", "0.60983956", "0.6077118", "0.6061723", "0.60513836", "0.6049069", "0.6030368", "0.60263443", "0.60089093", "0.59970635", "0.59756917", "0.5956231", "0.5949343", "0.5937446", "0.5911776", "0.59034705", "0.5901311", "0.5883238", "0.5871533", "0.5865361", "0.5851141", "0.581793", "0.5815705", "0.58012", "0.578891", "0.57870495", "0.5775621", "0.57608724", "0.5734331", "0.5731584", "0.5728505", "0.57239383", "0.57130504", "0.57094604", "0.570793", "0.5697671", "0.56975955", "0.56911296", "0.5684489", "0.5684489", "0.56768984", "0.56749034", "0.5659463", "0.56589085", "0.56573", "0.56537443", "0.5651912", "0.5648272", "0.5641736", "0.5639226", "0.5638583", "0.56299245", "0.56297386", "0.56186295", "0.5615729", "0.56117755", "0.5596015", "0.55905765", "0.55816257", "0.55813104", "0.55723965", "0.5572061", "0.55696625", "0.5566985", "0.55633485", "0.555888", "0.5555646", "0.55525774", "0.5549722", "0.5548184", "0.55460495", "0.5539394", "0.5535825", "0.55300397", "0.5527975", "0.55183905", "0.5517322", "0.5517183", "0.55152744", "0.5514932", "0.55128884", "0.5509501", "0.55044043", "0.54984957" ]
0.0
-1
/ renamed from: d
public final byte mo27874d() { return 15; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void d() {\n }", "@Override\n\tpublic void dtd() {\n\t\t\n\t}", "@Override\r\n\tpublic void dormir() {\n\t\t\r\n\t}", "public int d()\r\n/* 79: */ {\r\n/* 80:82 */ return this.d;\r\n/* 81: */ }", "public String d_()\r\n/* 445: */ {\r\n/* 446:459 */ return \"container.inventory\";\r\n/* 447: */ }", "public abstract int d();", "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 }", "public int d()\n {\n return 1;\n }", "public interface C19512d {\n /* renamed from: dd */\n void mo34676dd(int i, int i2);\n }", "void mo21073d();", "@Override\n public boolean d() {\n return false;\n }", "int getD();", "public void dor(){\n }", "public int getD() {\n\t\treturn d;\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}", "public String getD() {\n return d;\n }", "@Override\n\tpublic void dibuja() {\n\t\t\n\t}", "public final void mo91715d() {\n }", "public D() {}", "void mo17013d();", "public int getD() {\n return d_;\n }", "void mo83705a(C32458d<T> dVar);", "public void d() {\n\t\tSystem.out.println(\"d method\");\n\t}", "double d();", "public float d()\r\n/* 15: */ {\r\n/* 16:163 */ return this.b;\r\n/* 17: */ }", "protected DNA(Population pop, DNA d) {\n\t\t// TODO: implement this\n\t}", "public ahb(ahd paramahd)\r\n/* 12: */ {\r\n/* 13: 36 */ this.d = paramahd;\r\n/* 14: */ }", "public abstract C17954dh<E> mo45842a();", "@Override\n\tpublic void debite() {\n\t\t\n\t}", "@Override\n\tpublic void visitTdetree(Tdetree p) {\n\n\t}", "public abstract void mo56925d();", "void mo54435d();", "public void mo21779D() {\n }", "public void d() {\n this.f20599d.a(this.f20598c);\n this.f20598c.a(this);\n this.f20601f = new a(new d());\n d.a(this.f20596a, this.f20597b, this.f20601f);\n this.f20596a.setLayoutManager(new NPALinearLayoutManager(getContext()));\n ((s) this.f20596a.getItemAnimator()).setSupportsChangeAnimations(false);\n this.f20596a.setAdapter(this.f20601f);\n this.f20598c.a(this.f20602g);\n }", "@Override\r\n public String getStringRepresentation()\r\n {\r\n return \"D\";\r\n }", "void mo28307a(zzgd zzgd);", "List<String> d();", "d(l lVar, m mVar, b bVar) {\n super(mVar);\n this.f11484d = lVar;\n this.f11483c = bVar;\n }", "public int getD() {\n return d_;\n }", "public void addDField(String d){\n\t\tdfield.add(d);\n\t}", "public void mo3749d() {\n }", "public a dD() {\n return new a(this.HG);\n }", "public String amd_to_dma(java.sql.Date d)\n {\n String resp = \"\";\n if (d!=null)\n {\n String sdat = d.toString();\n String sano = sdat.substring(0,4);\n String smes = sdat.substring(5,7);\n String sdia = sdat.substring(8,10);\n resp = sdia+\"/\"+smes+\"/\"+sano;\n }\n return resp;\n }", "public void mo130970a(double d) {\n SinkDefaults.m149818a(this, d);\n }", "public abstract int getDx();", "public void mo97908d() {\n }", "public com.c.a.d.d d() {\n return this.k;\n }", "private static String toPsString(double d) {\n return \"(\" + d + \")\";\n }", "public boolean d() {\n return false;\n }", "void mo17023d();", "String dibujar();", "@Override\n\tpublic void setDurchmesser(int d) {\n\n\t}", "public void mo2470d() {\n }", "public abstract VH mo102583a(ViewGroup viewGroup, D d);", "public abstract String mo41079d();", "public void setD ( boolean d ) {\n\n\tthis.d = d;\n }", "public Dx getDx() {\n/* 32 */ return this.dx;\n/* */ }", "DoubleNode(int d) {\n\t data = d; }", "DD createDD();", "@java.lang.Override\n public float getD() {\n return d_;\n }", "public void setD(String d) {\n this.d = d == null ? null : d.trim();\n }", "public int d()\r\n {\r\n return 20;\r\n }", "float getD();", "public static int m22546b(double d) {\n return 8;\n }", "void mo12650d();", "String mo20732d();", "static void feladat4() {\n\t}", "void mo130799a(double d);", "public void mo2198g(C0317d dVar) {\n }", "@Override\n public void d(String TAG, String msg) {\n }", "private double convert(double d){\n\t\tDecimalFormatSymbols symbols = DecimalFormatSymbols.getInstance();\n\t\tsymbols.setDecimalSeparator('.');\n\t\tDecimalFormat df = new DecimalFormat(\"#.##\",symbols); \n\t\treturn Double.valueOf(df.format(d));\n\t}", "public void d(String str) {\n ((b.b) this.b).g(str);\n }", "public abstract void mo42329d();", "public abstract long mo9229aD();", "public abstract String getDnForPerson(String inum);", "public interface ddd {\n public String dan();\n\n}", "@Override\n public void func_104112_b() {\n \n }", "public Nodo (String d){\n\t\tthis.dato = d;\n\t\tthis.siguiente = null; //para que apunte el nodo creado a nulo\n\t}", "public void mo5117a(C0371d c0371d, double d) {\n new C0369b(this, c0371d, d).start();\n }", "public interface C27442s {\n /* renamed from: d */\n List<EffectPointModel> mo70331d();\n}", "public final void m22595a(double d) {\n mo4383c(Double.doubleToRawLongBits(d));\n }", "public void d() {\n this.f23522d.a(this.f23521c);\n this.f23521c.a(this);\n this.i = new a();\n this.i.a(new ae(this.f23519a));\n this.f23519a.setAdapter(this.i);\n this.f23519a.setOnItemClickListener(this);\n this.f23521c.e();\n this.h.a(hashCode(), this.f23520b);\n }", "public Vector2d(double d) {\n\t\tthis.x = d;\n\t\tthis.y = d;\n\t}", "DomainHelper dh();", "private Pares(PLoc p, PLoc s, int d){\n\t\t\tprimero=p;\n\t\t\tsegundo=s;\n\t\t\tdistancia=d;\n\t\t}", "static double DEG_to_RAD(double d) {\n return d * Math.PI / 180.0;\n }", "@java.lang.Override\n public float getD() {\n return d_;\n }", "private final VH m112826b(ViewGroup viewGroup, D d) {\n return mo102583a(viewGroup, d);\n }", "public Double getDx();", "public void m25658a(double d) {\n if (d <= 0.0d) {\n d = 1.0d;\n }\n this.f19276f = (float) (50.0d / d);\n this.f19277g = new C4658a(this, this.f19273c);\n }", "boolean hasD();", "public abstract void mo27386d();", "MergedMDD() {\n }", "@ReflectiveMethod(name = \"d\", types = {})\n public void d(){\n NMSWrapper.getInstance().exec(nmsObject);\n }", "@Override\n public Chunk d(int i0, int i1) {\n return null;\n }", "public void d(World paramaqu, BlockPosition paramdt, Block parambec)\r\n/* 47: */ {\r\n/* 48: 68 */ BlockPosition localdt = paramdt.offset(((EnumDirection)parambec.getData(a)).opposite());\r\n/* 49: 69 */ Block localbec = paramaqu.getBlock(localdt);\r\n/* 50: 70 */ if (((localbec.getType() instanceof bdq)) && (((Boolean)localbec.getData(bdq.b)).booleanValue())) {\r\n/* 51: 71 */ paramaqu.g(localdt);\r\n/* 52: */ }\r\n/* 53: */ }", "double defendre();", "public static int setDimension( int d ) {\n int temp = DPoint.d;\n DPoint.d = d;\n return temp;\n }", "public Datum(Datum d) {\n this.dan = d.dan;\n this.mesec = d.mesec;\n this.godina = d.godina;\n }", "public Nodo (String d, Nodo n){\n\t\tdato = d;\n\t\tsiguiente=n;\n\t}" ]
[ "0.63810617", "0.616207", "0.6071929", "0.59959275", "0.5877492", "0.58719957", "0.5825175", "0.57585526", "0.5701679", "0.5661244", "0.5651699", "0.56362265", "0.562437", "0.5615328", "0.56114155", "0.56114155", "0.5605659", "0.56001145", "0.5589302", "0.5571578", "0.5559222", "0.5541367", "0.5534182", "0.55326", "0.550431", "0.55041796", "0.5500838", "0.54946786", "0.5475938", "0.5466879", "0.5449981", "0.5449007", "0.54464436", "0.5439673", "0.543565", "0.5430978", "0.5428843", "0.5423923", "0.542273", "0.541701", "0.5416963", "0.54093426", "0.53927654", "0.53906536", "0.53793144", "0.53732955", "0.53695524", "0.5366731", "0.53530186", "0.535299", "0.53408253", "0.5333639", "0.5326304", "0.53250664", "0.53214055", "0.53208005", "0.5316437", "0.53121597", "0.52979535", "0.52763224", "0.5270543", "0.526045", "0.5247397", "0.5244388", "0.5243049", "0.5241726", "0.5241194", "0.523402", "0.5232349", "0.5231111", "0.5230985", "0.5219358", "0.52145815", "0.5214168", "0.5209237", "0.52059376", "0.51952434", "0.5193699", "0.51873696", "0.5179743", "0.5178796", "0.51700175", "0.5164517", "0.51595956", "0.5158281", "0.51572365", "0.5156627", "0.5155795", "0.51548296", "0.51545656", "0.5154071", "0.51532024", "0.5151545", "0.5143571", "0.5142079", "0.5140048", "0.51377696", "0.5133826", "0.5128858", "0.5125679", "0.5121545" ]
0.0
-1
/ renamed from: f
public final int mo27877f() { return this.f18208b; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void func_70305_f() {}", "public static Forca get_f(){\n\t\treturn f;\n\t}", "void mo84656a(float f);", "public final void mo8765a(float f) {\n }", "@Override\n public int f() {\n return 0;\n }", "public void f() {\n }", "void mo9704b(float f, float f2, int i);", "void mo56155a(float f);", "public void f() {\n }", "void mo9696a(float f, float f2, int i);", "@Override\n\tpublic void f2() {\n\t\t\n\t}", "public void f() {\n Message q_ = q_();\n e.c().a(new f(255, a(q_.toByteArray())), getClass().getSimpleName(), i().a(), q_);\n }", "void mo72112a(float f);", "void mo9694a(float f, float f2);", "void f1() {\r\n\t}", "public amj p()\r\n/* 543: */ {\r\n/* 544:583 */ return this.f;\r\n/* 545: */ }", "double cFromF(double f) {\n return (f-32) * 5 / 9;\n }", "void mo34547J(float f, float f2);", "@Override\n\tpublic void f1() {\n\n\t}", "public void f() {\n this.f25459e.J();\n }", "public abstract void mo70718c(String str, float f);", "public byte f()\r\n/* 89: */ {\r\n/* 90:90 */ return this.f;\r\n/* 91: */ }", "C3579d mo19694a(C3581f fVar) throws IOException;", "public abstract void mo70714b(String str, float f);", "void mo9705c(float f, float f2);", "FunctionCall getFc();", "@Override\n\tpublic void af(String t) {\n\n\t}", "void mo9695a(float f, float f2, float f3, float f4, float f5);", "public abstract void mo70705a(String str, float f);", "void mo21075f();", "static double transform(int f) {\n return (5.0 / 9.0 * (f - 32));\n\n }", "private int m216e(float f) {\n int i = (int) (f + 0.5f);\n return i % 2 == 1 ? i - 1 : i;\n }", "void mo9703b(float f, float f2);", "public abstract int mo123247f();", "void mo6072a(float f) {\n this.f2347q = this.f2342e.mo6054a(f);\n }", "public float mo12718a(float f) {\n return f;\n }", "public abstract void mo70706a(String str, float f, float f2);", "@Override\r\n\tprotected void doF4() {\n\t\t\r\n\t}", "protected float l()\r\n/* 72: */ {\r\n/* 73: 84 */ return 0.0F;\r\n/* 74: */ }", "public int getF() {\n\t\treturn f;\n\t}", "public void f()\r\n {\r\n float var1 = 0.5F;\r\n float var2 = 0.125F;\r\n float var3 = 0.5F;\r\n this.a(0.5F - var1, 0.5F - var2, 0.5F - var3, 0.5F + var1, 0.5F + var2, 0.5F + var3);\r\n }", "void mo9698a(String str, float f);", "private static float m82748a(float f) {\n if (f == 0.0f) {\n return 1.0f;\n }\n return 0.0f;\n }", "static void feladat4() {\n\t}", "public int getf(){\r\n return f;\r\n}", "private static double FToC(double f) {\n\t\treturn (f-32)*5/9;\n\t}", "public void a(Float f) {\n ((b.b) this.b).a(f);\n }", "public Flt(float f) {this.f = new Float(f);}", "static double f(double x){\n \treturn Math.sin(x);\r\n }", "private float m23258a(float f, float f2, float f3) {\n return f + ((f2 - f) * f3);\n }", "public double getF();", "protected float m()\r\n/* 234: */ {\r\n/* 235:247 */ return 0.03F;\r\n/* 236: */ }", "final void mo6072a(float f) {\n this.f2349i = this.f2348h.mo6057b(f);\n }", "private float m87322b(float f) {\n return (float) Math.sin((double) ((float) (((double) (f - 0.5f)) * 0.4712389167638204d)));\n }", "public void colores(int f) {\n this.f = f;\n }", "static float m51586b(float f, float f2, float f3) {\n return ((f2 - f) * f3) + f;\n }", "void mo3193f();", "public void mo3777a(float f) {\n this.f1443S = f;\n }", "@Override\r\n\tprotected void doF6() {\n\t\t\r\n\t}", "static void feladat9() {\n\t}", "private double f2c(double f)\n {\n return (f-32)*5/9;\n }", "public void e(Float f) {\n ((b.b) this.b).e(f);\n }", "int mo9691a(String str, String str2, float f);", "void mo196b(float f) throws RemoteException;", "public void d(Float f) {\n ((b.b) this.b).d(f);\n }", "static void feladat7() {\n\t}", "public void b(Float f) {\n ((b.b) this.b).b(f);\n }", "long mo54439f(int i);", "public void c(Float f) {\n ((b.b) this.b).c(f);\n }", "@java.lang.Override\n public java.lang.String getF() {\n java.lang.Object ref = f_;\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 f_ = s;\n return s;\n }\n }", "public static void detectComponents(String f) {\n\t\t\n\t}", "public void b(amj paramamj)\r\n/* 538: */ {\r\n/* 539:579 */ this.f = paramamj;\r\n/* 540: */ }", "public void f() {\n if (this instanceof b) {\n b bVar = (b) this;\n Message q_ = bVar.q_();\n e.c().a(new f(bVar.b(), q_.toByteArray()), getClass().getSimpleName(), i().a(), q_);\n return;\n }\n f a2 = a();\n if (a2 != null) {\n e.c().a(a2, getClass().getSimpleName(), i().a(), (Message) null);\n }\n }", "void mo54440f();", "public int F()\r\n/* 24: */ {\r\n/* 25: 39 */ return aqt.a(0.5D, 1.0D);\r\n/* 26: */ }", "@Override\r\n\tprotected void doF8() {\n\t\t\r\n\t}", "public abstract int mo9741f();", "void testMethod() {\n f();\n }", "public static int m22547b(float f) {\n return 4;\n }", "public float mo12728b(float f) {\n return f;\n }", "public void mo1963f() throws cf {\r\n }", "public abstract File mo41087j();", "@Override\n\tpublic void visit(Function arg0) {\n\t\t\n\t}", "public abstract int f(int i2);", "static void feladat6() {\n\t}", "public void furyo ()\t{\n }", "long mo30295f();", "public void a(zf zfVar, Canvas canvas, float f, float f2) {\n }", "public T fjern();", "public static void feec() {\n\t}", "@Override\n\tdouble f(double x) {\n\t\treturn x;\n\t}", "static void feladat3() {\n\t}", "static void feladat8() {\n\t}", "public void mo3797c(float f) {\n this.f1455ad[0] = f;\n }", "public abstract double fct(double x);", "public interface b {\n boolean f(@NonNull File file);\n }", "public void setF(){\n\t\tf=calculateF();\n\t}", "public FI_() {\n }", "static void feladat5() {\n\t}", "private final void m57544f(int i) {\n this.f47568d.m63092a(new C15335a(i, true));\n }", "public abstract long f();" ]
[ "0.7323683", "0.65213245", "0.649907", "0.64541733", "0.6415534", "0.63602704", "0.6325114", "0.63194084", "0.630473", "0.62578535", "0.62211406", "0.6209556", "0.6173324", "0.61725706", "0.61682224", "0.6135272", "0.6130462", "0.6092916", "0.6089471", "0.6073019", "0.6069227", "0.6045645", "0.60285485", "0.6017334", "0.60073197", "0.59810024", "0.59757596", "0.5967885", "0.5942414", "0.59418225", "0.5939683", "0.59241796", "0.58987755", "0.5894165", "0.58801377", "0.5879881", "0.5830818", "0.57981277", "0.5790314", "0.578613", "0.5775656", "0.5772591", "0.57630384", "0.5752546", "0.5752283", "0.5735288", "0.5733957", "0.57191586", "0.57179475", "0.57131994", "0.57131445", "0.5706053", "0.5689441", "0.56773764", "0.5667179", "0.56332076", "0.5623908", "0.56229013", "0.5620846", "0.5620233", "0.5616687", "0.5610022", "0.5601161", "0.55959773", "0.5594083", "0.55762523", "0.5570697", "0.5569185", "0.5552703", "0.55498457", "0.5549487", "0.5540512", "0.55403346", "0.5538902", "0.5538738", "0.55373883", "0.55234814", "0.55215186", "0.551298", "0.5508332", "0.5507449", "0.55046654", "0.550407", "0.55029416", "0.5494386", "0.5493873", "0.54900146", "0.5487203", "0.54866016", "0.54843825", "0.5478175", "0.547722", "0.54764897", "0.5472811", "0.54662675", "0.5460087", "0.5458977", "0.54567033", "0.54565614", "0.5454854", "0.5442333" ]
0.0
-1
/ renamed from: g
public final String mo27878g() { return this.f18209c; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void g() {\n }", "public void gored() {\n\t\t\n\t}", "public boolean g()\r\n/* 94: */ {\r\n/* 95:94 */ return this.g;\r\n/* 96: */ }", "public int g()\r\n/* 173: */ {\r\n/* 174:198 */ return 0;\r\n/* 175: */ }", "public void stg() {\n\n\t}", "public xm n()\r\n/* 274: */ {\r\n/* 275:287 */ if ((this.g == null) && (this.h != null) && (this.h.length() > 0)) {\r\n/* 276:288 */ this.g = this.o.a(this.h);\r\n/* 277: */ }\r\n/* 278:290 */ return this.g;\r\n/* 279: */ }", "int getG();", "private final zzgy zzgb() {\n }", "public int g()\r\n/* 601: */ {\r\n/* 602:645 */ return 0;\r\n/* 603: */ }", "private static void g() {\n h h10 = q;\n synchronized (h10) {\n h10.f();\n Object object = h10.e();\n object = object.iterator();\n boolean bl2;\n while (bl2 = object.hasNext()) {\n Object object2 = object.next();\n object2 = (g)object2;\n Object object3 = ((g)object2).getName();\n object3 = i.h.d.j((String)object3);\n ((g)object2).h((i.h.c)object3);\n }\n return;\n }\n }", "public int g()\r\n {\r\n return 1;\r\n }", "void mo28307a(zzgd zzgd);", "void mo21076g();", "void mo56163g();", "void mo98971a(C29296g gVar, int i);", "public int getG();", "void mo98970a(C29296g gVar);", "public abstract long g();", "public com.amap.api.col.n3.al g(java.lang.String r6) {\n /*\n r5 = this;\n r0 = 0\n if (r6 == 0) goto L_0x003a\n int r1 = r6.length()\n if (r1 > 0) goto L_0x000a\n goto L_0x003a\n L_0x000a:\n java.util.List<com.amap.api.col.n3.al> r1 = r5.c\n monitor-enter(r1)\n java.util.List<com.amap.api.col.n3.al> r2 = r5.c // Catch:{ all -> 0x0037 }\n java.util.Iterator r2 = r2.iterator() // Catch:{ all -> 0x0037 }\n L_0x0013:\n boolean r3 = r2.hasNext() // Catch:{ all -> 0x0037 }\n if (r3 == 0) goto L_0x0035\n java.lang.Object r3 = r2.next() // Catch:{ all -> 0x0037 }\n com.amap.api.col.n3.al r3 = (com.amap.api.col.n3.al) r3 // Catch:{ all -> 0x0037 }\n java.lang.String r4 = r3.getCity() // Catch:{ all -> 0x0037 }\n boolean r4 = r6.equals(r4) // Catch:{ all -> 0x0037 }\n if (r4 != 0) goto L_0x0033\n java.lang.String r4 = r3.getPinyin() // Catch:{ all -> 0x0037 }\n boolean r4 = r6.equals(r4) // Catch:{ all -> 0x0037 }\n if (r4 == 0) goto L_0x0013\n L_0x0033:\n monitor-exit(r1) // Catch:{ all -> 0x0037 }\n return r3\n L_0x0035:\n monitor-exit(r1)\n return r0\n L_0x0037:\n r6 = move-exception\n monitor-exit(r1)\n throw r6\n L_0x003a:\n return r0\n */\n throw new UnsupportedOperationException(\"Method not decompiled: com.amap.api.col.n3.am.g(java.lang.String):com.amap.api.col.n3.al\");\n }", "public int getG() {\r\n\t\treturn g;\r\n\t}", "private Gng() {\n }", "void mo57277b();", "int mo98967b(C29296g gVar);", "public void mo21782G() {\n }", "public final void mo74763d(C29296g gVar) {\n }", "private final java.lang.String m14284g() {\n /*\n r3 = this;\n b.h.b.a.b.b.ah r0 = r3.f8347b\n b.h.b.a.b.b.m r0 = r0.mo7065b()\n b.h.b.a.b.b.ah r1 = r3.f8347b\n b.h.b.a.b.b.az r1 = r1.mo7077p()\n b.h.b.a.b.b.az r2 = p073b.p085h.p087b.p088a.p090b.p094b.C1710ay.f5339d\n boolean r1 = p073b.p079e.p081b.C1489j.m6971a(r1, r2)\n if (r1 == 0) goto L_0x0056\n boolean r1 = r0 instanceof p073b.p085h.p087b.p088a.p090b.p127j.p128a.p129a.C2608e\n if (r1 == 0) goto L_0x0056\n b.h.b.a.b.j.a.a.e r0 = (p073b.p085h.p087b.p088a.p090b.p127j.p128a.p129a.C2608e) r0\n b.h.b.a.b.e.a$c r0 = r0.mo9643H()\n b.h.b.a.b.g.i$c r0 = (p073b.p085h.p087b.p088a.p090b.p117g.C2383i.C2387c) r0\n b.h.b.a.b.g.i$f<b.h.b.a.b.e.a$c, java.lang.Integer> r1 = p073b.p085h.p087b.p088a.p090b.p112e.p114b.C2330b.f7137i\n java.lang.String r2 = \"JvmProtoBuf.classModuleName\"\n p073b.p079e.p081b.C1489j.m6969a(r1, r2)\n java.lang.Object r0 = p073b.p085h.p087b.p088a.p090b.p112e.p113a.C2288f.m11197a(r0, r1)\n java.lang.Integer r0 = (java.lang.Integer) r0\n if (r0 == 0) goto L_0x003e\n b.h.b.a.b.e.a.c r1 = r3.f8350e\n java.lang.Number r0 = (java.lang.Number) r0\n int r0 = r0.intValue()\n java.lang.String r0 = r1.mo8811a(r0)\n if (r0 == 0) goto L_0x003e\n goto L_0x0040\n L_0x003e:\n java.lang.String r0 = \"main\"\n L_0x0040:\n java.lang.StringBuilder r1 = new java.lang.StringBuilder\n r1.<init>()\n java.lang.String r2 = \"$\"\n r1.append(r2)\n java.lang.String r0 = p073b.p085h.p087b.p088a.p090b.p116f.C2361g.m11709a(r0)\n r1.append(r0)\n java.lang.String r0 = r1.toString()\n return r0\n L_0x0056:\n b.h.b.a.b.b.ah r1 = r3.f8347b\n b.h.b.a.b.b.az r1 = r1.mo7077p()\n b.h.b.a.b.b.az r2 = p073b.p085h.p087b.p088a.p090b.p094b.C1710ay.f5336a\n boolean r1 = p073b.p079e.p081b.C1489j.m6971a(r1, r2)\n if (r1 == 0) goto L_0x00a0\n boolean r0 = r0 instanceof p073b.p085h.p087b.p088a.p090b.p094b.C1680ab\n if (r0 == 0) goto L_0x00a0\n b.h.b.a.b.b.ah r0 = r3.f8347b\n if (r0 == 0) goto L_0x0098\n b.h.b.a.b.j.a.a.j r0 = (p073b.p085h.p087b.p088a.p090b.p127j.p128a.p129a.C2638j) r0\n b.h.b.a.b.j.a.a.f r0 = r0.mo9635N()\n boolean r1 = r0 instanceof p073b.p085h.p087b.p088a.p090b.p100d.p110b.C2129i\n if (r1 == 0) goto L_0x00a0\n b.h.b.a.b.d.b.i r0 = (p073b.p085h.p087b.p088a.p090b.p100d.p110b.C2129i) r0\n b.h.b.a.b.i.d.b r1 = r0.mo8045e()\n if (r1 == 0) goto L_0x00a0\n java.lang.StringBuilder r1 = new java.lang.StringBuilder\n r1.<init>()\n java.lang.String r2 = \"$\"\n r1.append(r2)\n b.h.b.a.b.f.f r0 = r0.mo8042b()\n java.lang.String r0 = r0.mo9039a()\n r1.append(r0)\n java.lang.String r0 = r1.toString()\n return r0\n L_0x0098:\n b.u r0 = new b.u\n java.lang.String r1 = \"null cannot be cast to non-null type org.jetbrains.kotlin.serialization.deserialization.descriptors.DeserializedPropertyDescriptor\"\n r0.<init>(r1)\n throw r0\n L_0x00a0:\n java.lang.String r0 = \"\"\n return r0\n */\n throw new UnsupportedOperationException(\"Method not decompiled: p073b.p085h.p087b.p088a.C3008g.C3011c.m14284g():java.lang.String\");\n }", "void mo16687a(T t, C4621gg ggVar) throws IOException;", "public final void mo74759a(C29296g gVar) {\n }", "int mo98966a(C29296g gVar);", "void mo57278c();", "public double getG();", "public boolean h()\r\n/* 189: */ {\r\n/* 190:187 */ return this.g;\r\n/* 191: */ }", "private void kk12() {\n\n\t}", "gp(go goVar, String str) {\n super(str);\n this.f82115a = goVar;\n }", "@Override\n\tpublic void nghe() {\n\n\t}", "@Override\n\tpublic void draw(Graphics g) {\n\t\t\n\t}", "@Override\n\tpublic void draw(Graphics g) {\n\t\t\n\t}", "C2841w mo7234g();", "public abstract long g(int i2);", "public final h.c.b<java.lang.Object> g() {\n /*\n r2 = this;\n h.c.b<java.lang.Object> r0 = r2.f15786a\n if (r0 == 0) goto L_0x0005\n goto L_0x001d\n L_0x0005:\n h.c.e r0 = r2.b()\n h.c.c$b r1 = h.c.c.f14536c\n h.c.e$b r0 = r0.get(r1)\n h.c.c r0 = (h.c.c) r0\n if (r0 == 0) goto L_0x001a\n h.c.b r0 = r0.c(r2)\n if (r0 == 0) goto L_0x001a\n goto L_0x001b\n L_0x001a:\n r0 = r2\n L_0x001b:\n r2.f15786a = r0\n L_0x001d:\n return r0\n */\n throw new UnsupportedOperationException(\"Method not decompiled: kotlin.coroutines.jvm.internal.ContinuationImpl.g():h.c.b\");\n }", "void mo41086b();", "public abstract int mo123248g();", "public void getK_Gelisir(){\n K_Gelistir();\r\n }", "int mo54441g(int i);", "private static String m11g() {\n StringBuilder stringBuilder = new StringBuilder();\n stringBuilder.append(\"sh\");\n stringBuilder.append(\"el\");\n stringBuilder.append(\"la\");\n stringBuilder.append(\"_ve\");\n stringBuilder.append(\"rs\");\n stringBuilder.append(\"i\");\n stringBuilder.append(\"on\");\n return stringBuilder.toString();\n }", "@Override\n\tpublic void jugar() {\n\t\t\n\t}", "Groepen maakGroepsindeling(Groepen aanwezigheidsGroepen);", "public String getGg() {\n return gg;\n }", "public void g() {\n this.f25459e.Q();\n }", "void mo1761g(int i);", "public abstract void bepaalGrootte();", "public void referToGP(){\r\n\t\t//here is some code that we do not have access to\r\n\t}", "public final i g() {\n return new i();\n }", "public abstract void mo42331g();", "@Override\n public void func_104112_b() {\n \n }", "public int g2dsg(int v) { return g2dsg[v]; }", "void NhapGT(int thang, int nam) {\n }", "Gruppo getGruppo();", "public void method_4270() {}", "public abstract String mo41079d();", "public abstract String mo118046b();", "public void setGg(String gg) {\n this.gg = gg;\n }", "public abstract CharSequence mo2161g();", "void mo119582b();", "private void strin() {\n\n\t}", "public String a()\r\n/* 25: */ {\r\n/* 26:171 */ return \"dig.\" + this.a;\r\n/* 27: */ }", "public String BFS(int g) {\n\t\t//TODO\n\t}", "void mo21073d();", "private stendhal() {\n\t}", "public void golpearJugador(Jugador j) {\n\t\t\n\t}", "public void ganar() {\n // TODO implement here\n }", "public static Object gvRender(Object... arg) {\r\nUNSUPPORTED(\"e2g1sf67k7u629a0lf4qtd4w8\"); // int gvRender(GVC_t *gvc, graph_t *g, const char *format, FILE *out)\r\nUNSUPPORTED(\"erg9i1970wdri39osu8hx2a6e\"); // {\r\nUNSUPPORTED(\"1bh3yj957he6yv2dkeg4pzwdk\"); // int rc;\r\nUNSUPPORTED(\"1ag9dz4apxn0w3cz8w2bfm6se\"); // GVJ_t *job;\r\nUNSUPPORTED(\"8msotrfl0cngiua3j57ylm26b\"); // g = g->root;\r\nUNSUPPORTED(\"exts51afuertju5ed5v7pdpg7\"); // /* create a job for the required format */\r\nUNSUPPORTED(\"dn6z1r1bbrtmr58m8dnfgfnm0\"); // rc = gvjobs_output_langname(gvc, format);\r\nUNSUPPORTED(\"5apijrijm2r8b1g2l4x7iee7s\"); // job = gvc->job;\r\nUNSUPPORTED(\"5wvj0ph8uqfgg8jl3g39jsf51\"); // if (rc == 999) {\r\nUNSUPPORTED(\"4lkoedjryn54aff3fyrsewwu5\"); // agerr (AGERR, \"Format: \\\"%s\\\" not recognized. Use one of:%s\\n\",\r\nUNSUPPORTED(\"2pjgp86rkudo6mihbako5yps2\"); // format, gvplugin_list(gvc, API_device, format));\r\nUNSUPPORTED(\"f3a98gxettwtewduvje9y3524\"); // return -1;\r\nUNSUPPORTED(\"dvgyxsnyeqqnyzq696k3vskib\"); // }\r\nUNSUPPORTED(\"ect62lxc3zm51lhzifift55m\"); // job->output_lang = gvrender_select(job, job->output_langname);\r\nUNSUPPORTED(\"ewlceg1k4gs2e6syq4ear5kzo\"); // if (!(agbindrec(g, \"Agraphinfo_t\", 0, NOT(0)) && GD_drawing(g)) && !(job->flags & (1<<26))) {\r\nUNSUPPORTED(\"3yo4xyapbp7osp8uyz4kff98s\"); // \tagerrorf( \"Layout was not done\\n\");\r\nUNSUPPORTED(\"8d9xfgejx5vgd6shva5wk5k06\"); // \treturn -1;\r\nUNSUPPORTED(\"dvgyxsnyeqqnyzq696k3vskib\"); // }\r\nUNSUPPORTED(\"2ai20uylya195fbdqwjy9bz0n\"); // job->output_file = out;\r\nUNSUPPORTED(\"10kpqi6pvibjsxjyg0g76lix3\"); // if (out == NULL)\r\nUNSUPPORTED(\"d47ukby9krmz2k8ycmzzynnfr\"); // \tjob->flags |= (1<<27);\r\nUNSUPPORTED(\"9szsye4q9jykqvtk0bc1r91d0\"); // rc = gvRenderJobs(gvc, g);\r\nUNSUPPORTED(\"7l8ugws8ptgtlxc1ymmh3cf18\"); // gvrender_end_job(job);\r\nUNSUPPORTED(\"a9p7yonln7g91ge7xab3xf9dr\"); // gvjobs_delete(gvc);\r\nUNSUPPORTED(\"5bc9k4vsl6g7wejc5xefc5964\"); // return rc;\r\nUNSUPPORTED(\"c24nfmv9i7o5eoqaymbibp7m7\"); // }\r\n\r\nthrow new UnsupportedOperationException();\r\n}", "void mo41083a();", "@VisibleForTesting\n public final long g(long j) {\n long j2 = j - this.f10062b;\n this.f10062b = j;\n return j2;\n }", "void mo72113b();", "@Override\n\tpublic void render(Graphics g) {\n\t\t\n\t}", "@Override\n\tpublic void render(Graphics g) {\n\t\t\n\t}", "public void b(gy ☃) {}\r\n/* */ \r\n/* */ \r\n/* */ \r\n/* */ public void a(gy ☃) {}", "Gtr createGtr();", "TGG createTGG();", "public abstract String mo9239aw();", "public void setG(boolean g) {\n\tthis.g = g;\n }", "private static C8504ba m25889b(C2272g gVar) throws Exception {\n return m25888a(gVar);\n }", "void mo21074e();", "private String pcString(String g, String d) {\n return g+\"^part_of(\"+d+\")\";\n }", "public abstract String mo13682d();", "public void mo38117a() {\n }", "public abstract void mo70713b();", "public Gitlet(int a) {\n\n\t}", "protected boolean func_70814_o() { return true; }", "@Override\n\tpublic void draw(Graphics2D g) {\n\t\t\n\t}", "public abstract T zzg(T t, T t2);", "public int mo9232aG() {\n return 0;\n }", "public void mo3286a(C0813g gVar) {\n this.f2574g = gVar;\n }", "public void mo21787L() {\n }", "@Override\n public String toString(){\n return \"G(\"+this.getVidas()+\")\";\n }", "public String DFS(int g) {\n\t\t//TODO\n\t}", "public static Object gvRenderContext(Object... arg) {\r\nUNSUPPORTED(\"6bxfu9f9cshxn0i97berfl9bw\"); // int gvRenderContext(GVC_t *gvc, graph_t *g, const char *format, void *context)\r\nUNSUPPORTED(\"erg9i1970wdri39osu8hx2a6e\"); // {\r\nUNSUPPORTED(\"1bh3yj957he6yv2dkeg4pzwdk\"); // int rc;\r\nUNSUPPORTED(\"1ag9dz4apxn0w3cz8w2bfm6se\"); // GVJ_t *job;\r\nUNSUPPORTED(\"8msotrfl0cngiua3j57ylm26b\"); // g = g->root;\r\nUNSUPPORTED(\"exts51afuertju5ed5v7pdpg7\"); // /* create a job for the required format */\r\nUNSUPPORTED(\"dn6z1r1bbrtmr58m8dnfgfnm0\"); // rc = gvjobs_output_langname(gvc, format);\r\nUNSUPPORTED(\"5apijrijm2r8b1g2l4x7iee7s\"); // job = gvc->job;\r\nUNSUPPORTED(\"5wvj0ph8uqfgg8jl3g39jsf51\"); // if (rc == 999) {\r\nUNSUPPORTED(\"8r1a6szpsnku0jhatqkh0qo75\"); // \t\tagerr(AGERR, \"Format: \\\"%s\\\" not recognized. Use one of:%s\\n\",\r\nUNSUPPORTED(\"2pj79j8toe6bactkaedt54xcv\"); // \t\t\t format, gvplugin_list(gvc, API_device, format));\r\nUNSUPPORTED(\"b0epxudfxjm8kichhaautm2qi\"); // \t\treturn -1;\r\nUNSUPPORTED(\"dvgyxsnyeqqnyzq696k3vskib\"); // }\r\nUNSUPPORTED(\"ect62lxc3zm51lhzifift55m\"); // job->output_lang = gvrender_select(job, job->output_langname);\r\nUNSUPPORTED(\"ewlceg1k4gs2e6syq4ear5kzo\"); // if (!(agbindrec(g, \"Agraphinfo_t\", 0, NOT(0)) && GD_drawing(g)) && !(job->flags & (1<<26))) {\r\nUNSUPPORTED(\"3yo4xyapbp7osp8uyz4kff98s\"); // \tagerrorf( \"Layout was not done\\n\");\r\nUNSUPPORTED(\"b0epxudfxjm8kichhaautm2qi\"); // \t\treturn -1;\r\nUNSUPPORTED(\"dvgyxsnyeqqnyzq696k3vskib\"); // }\r\nUNSUPPORTED(\"ex1rhur9nlj950oe8r621uxxk\"); // job->context = context;\r\nUNSUPPORTED(\"3hvm1mza6yapsb3hi7bkw03cs\"); // job->external_context = NOT(0);\r\nUNSUPPORTED(\"9szsye4q9jykqvtk0bc1r91d0\"); // rc = gvRenderJobs(gvc, g);\r\nUNSUPPORTED(\"7l8ugws8ptgtlxc1ymmh3cf18\"); // gvrender_end_job(job);\r\nUNSUPPORTED(\"dql0bth0nzsrpiu9vnffonrhf\"); // gvdevice_finalize(job);\r\nUNSUPPORTED(\"a9p7yonln7g91ge7xab3xf9dr\"); // gvjobs_delete(gvc);\r\nUNSUPPORTED(\"5bc9k4vsl6g7wejc5xefc5964\"); // return rc;\r\nUNSUPPORTED(\"c24nfmv9i7o5eoqaymbibp7m7\"); // }\r\n\r\nthrow new UnsupportedOperationException();\r\n}", "private static void cajas() {\n\t\t\n\t}", "@Override\n\tpublic void ligar() {\n\t\t\n\t}", "void mo54435d();" ]
[ "0.678414", "0.67709124", "0.6522526", "0.64709187", "0.6450875", "0.62853396", "0.6246107", "0.6244691", "0.6212993", "0.61974055", "0.61380696", "0.6138033", "0.6105423", "0.6057178", "0.60355175", "0.60195917", "0.59741", "0.596904", "0.59063077", "0.58127505", "0.58101356", "0.57886875", "0.5771653", "0.57483286", "0.57415104", "0.5739937", "0.5737405", "0.5734033", "0.5716611", "0.5702987", "0.5702633", "0.568752", "0.5673585", "0.5656889", "0.5654594", "0.56383264", "0.56383264", "0.5633443", "0.5619376", "0.56107736", "0.55950445", "0.55687404", "0.5560633", "0.5544451", "0.553233", "0.55284953", "0.5526995", "0.5523609", "0.5522537", "0.5520261", "0.5508765", "0.54931", "0.5475987", "0.5471256", "0.5469798", "0.54696023", "0.5466119", "0.5450189", "0.5445573", "0.54424983", "0.54304206", "0.5423924", "0.54234356", "0.5420949", "0.54093313", "0.53971386", "0.53892636", "0.53887594", "0.5388692", "0.53799766", "0.5377014", "0.5375743", "0.53676707", "0.53666615", "0.53654546", "0.536411", "0.536411", "0.5361922", "0.53584075", "0.5357915", "0.53526837", "0.53503513", "0.534265", "0.5342214", "0.53399533", "0.533597", "0.5332819", "0.5331027", "0.5329743", "0.5329616", "0.5325393", "0.53252953", "0.5323291", "0.53207254", "0.5314264", "0.53122807", "0.53109974", "0.5310432", "0.53044266", "0.5304416", "0.5302328" ]
0.0
-1
Scanner sc = new Scanner(new FileInputStream("sample_input.txt"));
public static void main(String args[]) throws Exception { Scanner sc = new Scanner(System.in); int n = sc.nextInt(); calculate( n, 0 ); System.out.println( min ); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static void main(String[] args) throws IOException {\n\t\t FileInputStream file=new FileInputStream(\"C:\\\\Users\\\\DELL\\\\Desktop\\\\test.txt\");\r\n Scanner scan=new Scanner(file);\r\n while(scan.hasNextLine()){\r\n \t System.out.println(scan.nextLine());\r\n }\r\n \r\n file.close();\r\n\t}", "public static void main(String[] args) throws FileNotFoundException {\n Scanner scanner = new Scanner(new FileInputStream(\"/Users/guoziren/IdeaProjects/剑指offer for Java/src/main/java/com/ustc/leetcode/algorithmidea/dynamicprogramming/input.txt\"));\n }", "void readFile()\n {\n Scanner sc2 = new Scanner(System.in);\n try {\n sc2 = new Scanner(new File(\"src/main/java/ex45/exercise45_input.txt\"));\n } catch (FileNotFoundException e) {\n e.printStackTrace();\n }\n while (sc2.hasNextLine()) {\n Scanner s2 = new Scanner(sc2.nextLine());\n while (s2.hasNext()) {\n //s is the next word\n String s = s2.next();\n this.readFile.add(s);\n }\n }\n }", "public void openFile(){\n\t\ttry{\n\t\t\t//input = new Scanner (new File(\"input.txt\")); // creates file \"input.txt\" or will rewrite existing file\n\t\t\tFile inFile = new File(\"input.txt\");\n\t\t\tinput = new Scanner(inFile);\n\t\t\t//for (int i = 0; i < 25; i ++){\n\t\t\t\t//s = input.nextLine();\n\t\t\t\t//System.out.println(s);\n\t\t\t//}\n\t\t}catch (SecurityException securityException){ // catch errors\n\t\t\tSystem.err.println (\"You do not have the write access to this file.\");\n\t\t\tSystem.exit(1);\n\t\t}catch (FileNotFoundException fnf){// catch errors\n\t\t\tSystem.err.println (\"Trouble opening file\");\n\t\t\tSystem.exit(1);\n\t\t}\n\t}", "public static void main (String[] args) throws IOException\n {\n Scanner fileScan, lineScan;\n String fileName;\n\n Scanner scan = new Scanner(System.in);\n\n System.out.print (\"Enter the name of the input file: \");\n fileName = scan.nextLine();\n fileScan = new Scanner(new File(fileName));\n\n // Read and process each line of the file\n\n\n\n\n }", "private static Scanner determineInputSource(String[] args) throws FileNotFoundException{\n if (args.length > 0) {\n //Reading from file\n return new Scanner(new File(args[0]));\n }\n else {\n //Reading from standard Input\n return new Scanner(System.in);\n }\n }", "public Scanner( String filename ) throws IOException\n {\n sourceFile = new PushbackInputStream(new FileInputStream(filename));\n \n nextToken = null;\n }", "public Scanner(java.io.InputStream in) {\r\n this(new java.io.InputStreamReader(in));\r\n }", "public static Scanner openInput(String fname){\n\t Scanner infile = null;\n\t try {\n\t infile = new Scanner(new File(fname));\n\t } catch(FileNotFoundException e) {\n\t System.out.printf(\"Cannot open file '%s' for input\\n\", fname);\n\t System.exit(0);\n\t }\n\t return infile;\n\t }", "public Scanner(java.io.InputStream in) {\n this(new java.io.InputStreamReader(in));\n }", "public Scanner(java.io.InputStream in) {\n this(new java.io.InputStreamReader(in));\n }", "public static void main(String[] args) {\n String s = \"\";\n try {\n File file = new File(\"C:\\\\Users\\\\DELL\\\\Desktop\\\\bridgelabz\\\\example\\\\sample.txt\");\n Scanner sc = new Scanner(file);\n while (sc.hasNextLine()) {\n s = sc.nextLine();\n }\n System.out.println(s);\n String[] splt = s.split(\"\");\n for (int i = 0; i < splt.length; i++) {\n System.out.println(splt[i]);\n }\n } catch(Exception e) {\n System.out.println(\"Not Found\");\n }\n\n }", "private void readInter() throws FileNotFoundException {\n\t\t\r\n\t\tFile file = new File(\"input.txt\");\r\n\r\n\t\tScanner input = new Scanner(file);\r\n\r\n\t\twhile (input.hasNext()) {\r\n\r\n\t\t\tint x = input.nextInt();\r\n\t\t\tint y = input.nextInt();\r\n\t\t\t\r\n\t\t\tintervals.add(new Point(x, y));\r\n\t\t}\r\n\t\t\r\n\t\t//Close 'input.txt'\r\n\t\tinput.close();\r\n\t\t\r\n\t}", "private void readFile() {\r\n\t\tScanner sc = null; \r\n\t\ttry {\r\n\t\t\tsc = new Scanner(inputFile);\t\r\n\t\t\twhile(sc.hasNextLine()){\r\n\t\t\t\tgrade.add(sc.nextLine());\r\n\t } \r\n\t\t}\r\n\t\tcatch (FileNotFoundException e) {\r\n\t\t\te.printStackTrace();\r\n\t\t}\r\n\t\tfinally {\r\n\t\t\tsc.close();\r\n\t\t}\t\t\r\n\t}", "private Scanner getInput(String name) {\n try {\n return new Scanner(new File(name));\n } catch (IOException excp) {\n throw error(\"could not open %s\", name);\n }\n }", "public static void echoFile(Scanner in) {\n }", "private static Scanner createScanner(File inputFile)\n\t{\n\t\t/// create Scanner to read from file and also check if the file exists\n\t Scanner in = null; // closes before the end of readDataFile\n\t try \n\t {\n\t \tin=new Scanner(inputFile);\n\t }\n\t catch(FileNotFoundException e) \n\t {\n\t \tSystem.out.println(\"The file \"+ inputFile.getName() + \" can not be found!\");\n\t \tSystem.exit(0);\n\t }\n\t \n\t return in;\n\t}", "void openInput(String file)\r\n\t{\n\t\ttry{\r\n\t\t\tfstream = new FileInputStream(file);\r\n\t\t\tin = new DataInputStream(fstream);\r\n\t\t\tis = new BufferedReader(new InputStreamReader(in));\r\n\t\t}catch(Exception e)\r\n\t\t{\r\n\t\t\tSystem.err.println(e);\r\n\t\t}\r\n\r\n\t}", "public void inputForAnalysis() throws IOException\n {\n ArrayList<String> words = new ArrayList<String>(0);\n \n File fileName = new File(\"ciphertext.txt\");\n Scanner inFile = new Scanner(fileName);\n \n int index = 0;\n while(inFile.hasNext())\n {\n words.add(inFile.next());\n index++;\n }\n inFile.close();\n analyze(words);\n }", "public PasitoScanner(java.io.InputStream in) {\n this(new java.io.InputStreamReader(in));\n }", "private static void initializeInput(String filename) {\n\t\t// Reading from specified file.\n\t\ttry\n\t\t{\n\t\t\tfileInput = new Scanner(new FileInputStream(filename));\n\t\t}\n\t\tcatch(FileNotFoundException e) \n\t\t{ \n\t\t\tSystem.err.println(\"\\nFile not found. Please re-enter.\");\n\t\t\tinitializeInput(getFilename());\n\t\t}\n\t}", "public static int readScore() {\n try {\n Scanner diskScanner = new Scanner(new File(\"input.txt\"));\n while (diskScanner.hasNextLine()) {\n System.out.println(diskScanner.nextLine());\n }\n diskScanner.close();\n } catch (FileNotFoundException e) {\n e.printStackTrace();\n }\n return 0;\n }", "public static void main(String[] args) throws FileNotFoundException {\n\t\t\t\n\t\tScanner scan = new Scanner(new File(\"input.txt\"));\n\t\t\n\t\tParser parse;\n\t\tCode code = new Code();\n\t\tSymbolTable st = new SymbolTable();\n\t\t\n\t\twhile(scan.hasNextLine()) {\n\t\t\tString inCode = scan.nextLine();\t\n\t\t\tparse = new Parser(inCode);\n\t\t}\n\t\t\n\t}", "public Scanner(java.io.Reader in) {\r\n this.zzReader = in;\r\n }", "public Scanner(java.io.Reader in) {\n this.zzReader = in;\n }", "public Scanner(java.io.Reader in) {\n this.zzReader = in;\n }", "public void processInput(String theFile){processInput(new File(theFile));}", "public InputReader() {\n reader = new Scanner(System.in);\n }", "public void readData(String infile) throws Exception {\r\n \t\tScanner in = new Scanner(new FileReader(infile));\r\n \t}", "public static void readInFile(Scanner inFile) {\n\t\twhile(inFile.hasNext()) {\n\t\t\tString strIn = inFile.nextLine();\n\t\t\tSystem.out.println(strIn);\n\t\t}\n\t\tinFile.close();\n\t}", "static void experiment2Day1Part1() {\n\n File file = new File(\"src/main/java/weekone/input01.txt\");\n FileInputStream fis = null;\n\n try {\n fis = new FileInputStream(file);\n\n System.out.println(\"Total file size to read (in bytes) : \"\n + fis.available());\n\n int content;\n while ((content = fis.read()) != -1) {\n // convert to char and display it\n char converted = (char) content;\n System.out.print(converted);\n\n\n }\n\n } catch (IOException e) {\n e.printStackTrace();\n } finally {\n try {\n if (fis != null)\n fis.close();\n } catch (IOException ex) {\n ex.printStackTrace();\n }\n }\n\n\n }", "private static Scanner openFile(){\n\n System.out.println(\"Enter the input file name: \");\n Scanner kb = new Scanner(System.in);\n String fileName = kb.nextLine();\n try{\n return new Scanner(new File(fileName));\n }\n catch (Exception e){\n System.out.printf(\"Open Failed: \\n%s\\n\", e.toString());\n System.out.println(\"Please re-enter the filename.\");\n return openFile();\n }\n }", "private void readFromFile() {\n\t\tPath filePath = Paths.get(inputFile);\n\n\t\ttry (BufferedReader reader = Files.newBufferedReader(filePath,\n\t\t\t\tCharset.forName(\"UTF-8\"));) {\n\t\t\tString line = null;\n\n\t\t\twhile ((line = reader.readLine()) != null) {\n\t\t\t\tString[] splitLine = line.split(\",\");\n\t\t\t\tcurrentGen.setValue(Integer.parseInt(splitLine[0]),\n\t\t\t\t\t\tInteger.parseInt(splitLine[1]), true);\n\t\t\t}\n\t\t} catch (IOException e) {\n\t\t\tSystem.out.println(\"Could not find file provided.\");\n\t\t}\n\t}", "public Scanner(String source) {\n // The source code read in from stdin is stored here as a char array\n // TODO: if source is empty in Sc.java do something??\n this.source = source.toCharArray();\n this.position = 0;\n this.size = source.length();\n this.comments = false;\n this.depth = 0;\n this.called = false;\n }", "public InputReader(File file){\n try {\n inputStream = new Scanner(file);\n } catch (FileNotFoundException e) {\n e.printStackTrace();\n }\n instantiate();\n assert(invariant());\n }", "@Before\n public void setUp() throws Exception {\n wordFrequency = new WordFrequency();\n bufferedReader = new BufferedReader(new FileReader(\"/home/anurag/Desktop/P2/src/test/com/stackroute/practice/FileDemo.txt\"));\n }", "public MyInput() {\r\n\t\tthis.scanner = new Scanner(System.in);\r\n\t}", "public void readAndWrite() {\n Scanner scanner = new Scanner(System.in);\n String s = scanner.nextLine();\n List<String> passedFiles = new ArrayList<>();\n copy(new File(s), true, passedFiles);\n\n }", "private static void readInput() { input = sc.nextLine().toLowerCase().toCharArray(); }", "public TextFile(Scanner input) {\n \tSystem.out.println(\"Enter your Textfile name: \");\n \tString textfilename = input.nextLine(); \n \ttextFile = new File(textfilename);\n \tthis.checkFile();\n }", "public static void main(String[] args) throws FileNotFoundException {\n\n\t\tFile file = new File(\"B:\\\\output.txt\");\n\t\t\n\t\tScanner input = new Scanner(file);\n\t\t\n\t\twhile(input.hasNextLine()) {\n\t\t\tString tmp = input.nextLine();\n\t\t\t\n\t\t\tSystem.out.println(tmp);\n\t\t}\n\t\tinput.close();\n\t}", "public static Scanner getScanner(File file) {\n Scanner scanner = null;\n try {\n scanner = new Scanner(file);\n } catch (IOException e) {\n System.err.println(\"input error\");\n }\n return scanner;\n }", "public void readFile()\r\n\t{\r\n\t\t\r\n\t\ttry\r\n\t\t{\r\n\t\t\tx = new Scanner(new File(\"clean vipr measles results.txt\"));\r\n\t\t\t\r\n\t\t\twhile (x.hasNext())\r\n\t\t\t{\r\n\t\t\t\tString a = x.next();\r\n\t\t\t\tString b = x.next();\r\n\t\t\t\tString c = x.next();\r\n\t\t\t\t\r\n\t\t\t\tSystem.out.printf(\"%s %s %s \\n\\n\", a,b,c);\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tx.close();\r\n\t\t}\r\n\t\tcatch (Exception e)\r\n\t\t{\r\n\t\t\tSystem.out.println(\"file not found\");\r\n\t\t}\r\n\t\r\n\t}", "public static void main(String[] args) {\n try(Scanner scanner = new Scanner(Paths.get(\"data.txt\"))){\n \n // read the file until all lines have been read \n while(scanner.hasNextLine()){\n // read one line\n String row = scanner.nextLine();\n \n // print the line\n System.out.println(row);\n }\n }catch(Exception e){\n System.out.println(\"Error: \" + e.getMessage());\n }\n\n }", "public static void main(String[] args) {\n Scanner scan=new Scanner(System.in);\n\n\n\n }", "static void experiment1Day1Part1() {\n\n File file = new File(\"src/main/java/weekone/input01.txt\");\n FileReader fileReader = null;\n BufferedReader bufferedReader = null;\n int sum = 0;\n\n try {\n fileReader = new FileReader(file);\n bufferedReader = new BufferedReader(fileReader);\n\n while ((bufferedReader.read() != -1)) {\n String line = bufferedReader.readLine();\n System.out.println(\"\\nThe string is: \" + line);\n int number = Integer.valueOf(line);\n\n System.out.println(\"The number is: \" + number);\n\n }\n\n\n } catch (IOException e) {\n e.printStackTrace();\n } finally {\n try {\n if (fileReader != null)\n fileReader.close();\n } catch (IOException ex) {\n ex.printStackTrace();\n }\n }\n System.out.println(\"The sum is: \" + sum);\n }", "public static void reading(String fileName)\n {\n\n }", "public static void files(Scanner input) throws FileNotFoundException { \n File inputName = inputVerify(input); // call inputVerify method to get the name of the input file \n\n System.out.print(\"Output file name: \"); // ask user for output file name and save it to outputFile variable \n\t\tString outputName = input.next();\n\n Scanner inputFile = new Scanner(inputName); // reads input file\n\n // creates a new PrintStream object to print to the output file\n PrintStream output = new PrintStream(new File(outputName)); \n\n // while loop that runs as long as the input file has another line\n while (input.hasNextLine()){\n String line = inputFile.nextLine(); // reads entire line\n output.println(line + \":\"); // prints name to file\n String scoreLine = inputFile.nextLine(); // reads next line\n abCount(scoreLine, output); // call abCount method\n }\n }", "public Scanner(InputStream inStream)\n {\n in = new BufferedReader(new InputStreamReader(inStream));\n eof = false;\n getNextChar();\n }", "public static void main(String[] args) throws IOException, ScannerException{\n Scanner scan = new Scanner(\"test_input/ex1.tiger\");\n List<Token> tokens = scan.getTokens();\n for (Token tok : tokens) {\n System.out.println(tok.allDetails());\n }\n }", "Auditorium(java.util.Scanner input, java.io.File file){\r\n\t\t\r\n\t\tString line = input.next(); // read in next line from file // or nextLine()\r\n\t\tboolean flag = true;\r\n\t\tcolumns = line.length();\r\n\t\twhile(line != \"\" && flag != false) {\r\n\t\t\trows++; // increment number of rows\r\n\t\t\tif (!input.hasNext())\r\n\t\t\t\tflag = false;\r\n\t\t\tparseLine(line, rows, columns); // send line, array, and rows to a parse function\r\n\t\t\tif(input.hasNext())\r\n\t\t\t\tline = input.next(); //read in next line\r\n\t\t}\r\n\t}", "public void readFromFile() {\n\n\t}", "private void readRC(Scanner scan){\n\t\t//read in number of row and column in the first line\n\t\t\t\tString line = scan.nextLine();\n\t\t\t\t// read in number of rows and colums\n\t\t\t\t// declare a new scanner on the line. \n\t\t\t\tScanner scanLine = new Scanner(line);\n\t\t\t\t// assume col comes before row (the hw example)\n\t\t\t\t// try reading in the number of row\n\t\t\t\tif (scanLine.hasNextInt()) \n\t\t\t\t\t// scan that integer into row number or row\n\t\t\t\t\tcol=scanLine.nextInt(); \n\t\t\t\telse throw new InputMismatchException(\"The input file does not have number of columns\");\n\t\t\t\tif (scanLine.hasNextInt()) \n\t\t\t\t\t// scan that integer into row number or row\n\t\t\t\t\trow=scanLine.nextInt();\n\t\t\t\telse throw new InputMismatchException(\"The input file does not have number of rows\");\n\t\t\t\t// try reading in the number of cols\n\t\t\t\t// if there are more than 2 entries then throw an exception\n\t\t\t\tif (scanLine.hasNext()) throw new InputMismatchException(\"The \" +\n\t\t\t\t\t\t\"input file has wrong format of the number of rows and columns\");\n\t}", "private static List<String[]> readInput(String filePath) {\n List<String[]> result = new ArrayList<>();\n int numOfObject = 0;\n\n try {\n Scanner sc = new Scanner(new File(filePath));\n sc.useDelimiter(\"\");\n if (sc.hasNext()) {\n numOfObject = Integer.parseInt(sc.nextLine());\n }\n for (int i=0;i<numOfObject;i++) {\n if (sc.hasNext()) {\n String s = sc.nextLine();\n if (s.trim().isEmpty()) {\n continue;\n }\n result.add(s.split(\" \"));\n }\n }\n sc.close();\n }\n catch (FileNotFoundException e) {\n System.out.println(\"FileNotFoundException\");\n }\n return result;\n }", "public void input(Scanner in) { \r\n if (in.hasNext()) firstName = in.next();\r\n if (in.hasNext()) lastName = in.next();\r\n\t}", "public static void main(String[] args) throws FileNotFoundException {\n\t\tFile inFile = new File(\"result/in.txt\");\n\t\tFile outFile = new File(\"result/out.txt\");\n\t\tint begin = 4;\n\t\t\n\t\tScanner cs = new Scanner(inFile);\n\t\tPrintWriter out = new PrintWriter(outFile);\n\t\t\n\t\twhile(cs.hasNextLine())\n\t\t{\n\t\t\tString line = cs.nextLine();\n\t\t\tline = line.substring(begin);\n\t\t\tout.println(line);\n\t\t}\n\t\tcs.close();\n\t\tout.close();\n\t\t\n\t}", "public static void main(String[] args) throws FileNotFoundException,IOException {\n\t\tFileReader fr=new FileReader(\"E:\\\\iostreams\\\\question.txt\");\n\n\t\tBufferedReader br=new BufferedReader(fr);\n\n\t\tStreamTokenizer st=new StreamTokenizer(br);\n\n\t\tint token=0;\n\t\tdouble sum=0;\n\t\twhile((token=st.nextToken())!=StreamTokenizer.TT_EOF) {\n\n\t\t\tswitch(token) {\n\t\t\t\tcase StreamTokenizer. TT_NUMBER:\n\t\t\t\t{\n\t\t\t\t\t//System.out.println(st.nval);\n\t\t\t\t\tsum+=st.nval;\n\t\t\t\t\t//System.out.println(sum);\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tcase StreamTokenizer. TT_WORD:\n\t\t\t\t{\n\t\t\t\t\tif(sum!=0) {\n\t\t\t\t\t\tSystem.out.println((int)sum);\n\t\t\t\t\t}\n\t\t\t\t\tSystem.out.print(st.sval+\" \");\n\t\t\t\t\tsum=0;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tSystem.out.println((int)sum);\n\n\t}", "public static void readFile(String fileName)throws FileNotFoundException{ \r\n\t\t\r\n\t\tScanner sc = new Scanner(fileName);\r\n\t\t \r\n\t\twhile (sc.hasNextLine()) {\r\n\t\t\tString q1 = sc.next();\r\n\t\t\tString q1info = sc.next();\r\n\t\t}\r\n\t}", "public void fileRead() {\n\t\tString a, b;\n\t\t\n\t\twhile (input.hasNext()) {\n\t\t\ta = input.next();\n\t\t\tb = input.next();\n\t\t\tSystem.out.printf(\"%s %s\\n\", a, b);\n\t\t}\n\t}", "public SqlScanner (InputStream input)\n {\n mInputStream = new BufferedInputStream(input);\n }", "public static int getSize(){\n Scanner input;\n \n \n File f = new File(fName);\n \n \n int size = 0;\n \n try{\n input = new Scanner(f);\n input.nextLine();\n \n while(input.hasNextLine()){\n input.nextLine();\n size++;\n \n }\n input.close();\n }catch (IOException e){\n e.printStackTrace();\n }\n return size;\n}", "public static void main(String[] arg) {\n\t\tBufferedReader br = new BufferedReader(\r\n\t\t new FileReader(\"input.in\"));\r\n\r\n\t\t// PrintWriter class prints formatted representations\r\n\t\t// of objects to a text-output stream.\r\n\t\tPrintWriter pw = new PrintWriter(new\r\n\t\t BufferedWriter(new FileWriter(\"output.in\")));\r\n\r\n\t\t// Your code goes Here\r\n\r\n\t\tpw.flush();\r\n\t\tScanner sc = new Scanner(System.in);\r\n\t\tString x = sc.nextLine();\r\n\r\n\t\tSystem.out.println(\"hello world \" + x);\r\n\t}", "public static void main(String argv[]) {\n if (argv.length == 0) {\n System.out.println(\"Usage : java PasitoScanner <inputfile>\");\n }\n else {\n for (int i = 0; i < argv.length; i++) {\n PasitoScanner scanner = null;\n try {\n scanner = new PasitoScanner( new java.io.FileReader(argv[i]) );\n do {\n System.out.println(scanner.next_token());\n } while (!scanner.yy_atEOF);\n\n }\n catch (java.io.FileNotFoundException e) {\n System.out.println(\"File not found : \\\"\"+argv[i]+\"\\\"\");\n }\n catch (java.io.IOException e) {\n System.out.println(\"IO error scanning file \\\"\"+argv[i]+\"\\\"\");\n System.out.println(e);\n }\n catch (Exception e) {\n System.out.println(\"Unexpected exception:\");\n e.printStackTrace();\n }\n }\n }\n }", "public void setScan(InputStream inStream){\t\t\n\t\tthis.scan = new Scanner (inStream);\t\t\t\t\t\n\t}", "public static void Print(String fileName)\r\n {\n File file = new File(System.getProperty(\"user.dir\")+\"\\\\\"+fileName+\".txt\"); \r\n \r\n try \r\n {\r\n Scanner sc = new Scanner(file);\r\n \r\n while (sc.hasNextLine()) \r\n {\r\n System.out.println(sc.nextLine());\r\n }\r\n }\r\n catch (FileNotFoundException ex) \r\n {\r\n Logger.getLogger(TxtReader.class.getName()).log(Level.SEVERE, null, ex);\r\n }\r\n \r\n \r\n }", "public Ch12Ex1to9()\n {\n scan = new Scanner( System.in );\n }", "private static void inputs(Scanner fileScanner) {\n\t\tSystem.out.printf(\"You will now need to enter in the correct pathway to the files containing: \\n\\t1.) RNA table\\n\\t2.) RNA strand\\n\\t3.) Output Protien strand (this will create a new file)\\n\");\n\t\tSystem.out.println(\"Example pathway: C:/CSC142_143/DataFiles/RNATable.txt\");\n\t\tSystem.out.print(\"Please enter file pathway for the RNA Table: \");\n\t\tsetRNATablePathway(fileScanner.next());\n\t\tSystem.out.print(\"Please enter file pathway for the RNA Strand: \");\n\t\tsetRNAStrandPathway(fileScanner.next());\n\t\tSystem.out.print(\"Please enter file pathway for the decoded protien: \");\n\t\tsetRNAOutPathway(fileScanner.next());\n\t\tfileScanner.close();\n\t\t\n\t}", "public static void main(String[] args) // FileNotFoundException caught by this application\n {\n\n Scanner console = new Scanner(System.in);\n System.out.print(\"Input file: \");\n String inputFileName = console.next();\n System.out.print(\"Output file: \");\n String outputFileName = console.next();\n\n Scanner in = null;\n PrintWriter out =null;\n\n File inputFile = new File(inputFileName);\n try\n {\n in = new Scanner(inputFile);\n out = new PrintWriter(outputFileName);\n\n double total = 0;\n\n while (in.hasNextDouble())\n {\n double value = in.nextDouble();\n int x = in.nextInt();\n out.printf(\"%15.2f\\n\", value);\n total = total + value;\n }\n\n out.printf(\"Total: %8.2f\\n\", total);\n\n\n } catch (FileNotFoundException exception)\n {\n System.out.println(\"FileNotFoundException caught.\" + exception);\n exception.printStackTrace();\n }\n catch (InputMismatchException exception)\n {\n System.out.println(\"InputMismatchexception caught.\" + exception);\n }\n finally\n {\n\n in.close();\n out.close();\n }\n\n }", "public static void init()throws IOException{if(fileIO){f=new FastScanner(\"\");}else{f=new FastScanner(System.in);}}", "public void fileOpen () {\n\t\ttry {\n\t\t\tinput = new Scanner(new File(file));\n\t\t\tSystem.out.println(\"file created\");\n\t\t} catch (Exception e) {\n\t\t\tSystem.out.println(\"file could not be created\");\n\t\t}\n\t}", "public TokenScanner(final File f) throws FileNotFoundException {\n\t\tfileScanner = new Scanner(file = f);\n\t}", "public static void main (String [] args) throws IOException {\n BufferedReader f = new BufferedReader(new FileReader(\"test.in\"));\n // input file name goes above\n PrintWriter out = new PrintWriter(new BufferedWriter(new FileWriter(\"test.out\")));\n // Use StringTokenizer vs. readLine/split -- lots faster\n StringTokenizer st = new StringTokenizer(f.readLine());\n\t\t\t\t\t\t // Get line, break into tokens\n int i1 = Integer.parseInt(st.nextToken()); // first integer\n int i2 = Integer.parseInt(st.nextToken()); // second integer\n out.println(i1+i2); // output result\n out.close(); // close the output file\n}", "private static BST readDataFile(Scanner in)\n\t{\n\t\tBST tree=new BST();\n\t\t\n\t\t//read the file line by line\n\t\twhile(in.hasNextLine())\n\t\t{\n\t\t\t// Scanner to read 1 line; closed before end of while loop\n\t\t\tString currentLine=in.nextLine();\n\t\t\tScanner line=new Scanner(currentLine);\n\t\t\t\n\t\t\t// makes the scanner separate the information in the line by \",\" and \";\"\n\t\t\tline.useDelimiter(\",|;\");\n\t\t\t\n\t\t\t// create a profile from the line and insert it into the tree\n\t\t\tProfile p=createProfile(line);\n\t\t\ttree.insertProfile(p);\t\n\t\t\t\t\t\n\t\t\tline.close();\n\t\t}\n\t\t\n\t\tin.close();\n\t\treturn tree;\n\t}", "public WrongInputDataInScanner() {\n\tsuper();\n\t\n}", "@SuppressWarnings(\"resource\")\n public Scanner openFile() {\n boolean flag = false;\n Scanner input;\n\n while(!flag) {\n\t\t\tScanner scanned = new Scanner(System.in); \n\t if((scanned.next()).equals(\"game\")) {\n\t \tthis.fileName = scanned.next();\n\t try\n\t {\n\t File file = new File(\"./examples/\"+this.fileName);\n\t input = new Scanner(file);\n\t flag = true;\n\t return input;\n\t }\n\t catch (FileNotFoundException e)\n\t {\n\t \tSystem.err.println(\"File was not found, try again\");\n\t } \t\n\t }\n\t else {\n\t \tSystem.err.println(\"First command must be game, try again\");\n\t }\n }\n return null;\n }", "public static void main(String[] args) throws FileNotFoundException{ \n File file = new File(\"/Users/admin/NetBeansProjects/AlgoDataA3/src/algodataa3e3/output_interpret.txt\");\n Scanner input = new Scanner(file); \n \n SeparateChainingHash_A3E3<String, Integer> st = new SeparateChainingHash_A3E3<>(INTERVAL);\n //141491 words\n //9944 uniqe (with toLowerCase)\n \n //read file word by word and store in array\n while (input.hasNext()) {\n String key = input.next().toLowerCase();\n st.put(key, 1);\n }\n \n for(int i = 0; i < INTERVAL; i++){\n \n System.out.println(\"In hash #\" + (i+1) + \" there are \" + st.sizeOfList(i) + \" nodes\");\n }\n }", "void scanner() {\r\n\t\tSystem.out.println(\"---------- Scanner\" + ++exampleNumber\r\n\t\t\t\t+ \"----------\");\r\n\r\n\t\tString source = \"asdqw easd casa\";\r\n\t\tScanner s1 = new Scanner(source);\r\n\t\t// hasNext() - testuje wartosc kolejnego tokena, ale go nie pobiera\r\n\t\t// next() - pobiera kolejny token\r\n\t\t// domyslnie bialy znak jest delimiterem\r\n\t\twhile (s1.hasNext()) {\r\n\t\t\tSystem.out.println(s1.next());\r\n\t\t}\r\n\r\n\t\tSystem.out.println(\"---------- Scanner\" + ++exampleNumber\r\n\t\t\t\t+ \"----------\");\r\n\r\n\t\t// hasNextXxx() - dla wszystkich primitives oprocz chara\r\n\t\t// nextXxx() - pobiera kolejny prymitywny token\r\n\t\tScanner s2 = new Scanner(\"1 true 34 hi\");\r\n\t\tboolean b;\r\n\t\twhile (b = s2.hasNext()) {\r\n\t\t\tif (s2.hasNextInt()) {\r\n\t\t\t\tint i = s2.nextInt();\r\n\t\t\t\tSystem.out.println(\"integer token: \" + i);\r\n\t\t\t} else if (s2.hasNextBoolean()) {\r\n\t\t\t\tboolean b2 = s2.nextBoolean();\r\n\t\t\t\tSystem.out.println(\"boolean token: \" + b2);\r\n\t\t\t} else {\r\n\t\t\t\tString str = s2.next();\r\n\t\t\t\tSystem.out.println(\"String token: \" + str);\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tSystem.out.println(\"---------- Scanner\" + ++exampleNumber\r\n\t\t\t\t+ \"----------\");\r\n\r\n\t\t// useDelimiter(delimiter) - ustawienie delimitera (wyrazenia regularnego) wg ktorego bedzie przetwarzany strumien\r\n\t\t// domyslnym delimiterem jest spacja, tabulator, ogolnie bialy znak lub znaki\r\n\t\tScanner s3 = new Scanner(\"Test1 true 34 hi\");\r\n\t\ts3.useDelimiter(\"\\\\d\"); // delimiterem jest cyfra\r\n\t\twhile (s3.hasNext()) {\r\n\t\t\tSystem.out.println(s3.next());\r\n\t\t}\r\n\t}", "public static void main(String[] args) throws FileNotFoundException {\n\t\tFile file = new File(\"src/input.txt\");\n\t\tScanner scan = new Scanner(file);\n\t\tint N = scan.nextInt();\n\t\tscan.nextLine(); // clear buffer\n\t\tint[] arr = new int[N];\n\t\tfor (int i=0; i<N; i++) {\n\t\t\tarr[i] = scan.nextInt();\n\t\t}\n\t\tSystem.out.print(\"Before: \");\n\t\tfor (int el : arr) System.out.print(el + \" \");\n\t\tSystem.out.println();\n\t\tcountSwaps(arr);\n\t\tscan.close();\n\t\t\n\n\t}", "public Scanner createScanner(File file) {\n Scanner scanner;\n try {\n scanner = new Scanner(file);\n\n } catch (FileNotFoundException e) {\n scanner = null;\n }\n return scanner;\n }", "public static void main(String[] args) {\n\t\ttry {\r\n\t\t\tFileInputStream inputFile = new FileInputStream(\"C:\\\\Users\\\\lenovo\\\\Desktop\\\\input.txt.txt\");\r\n\r\n\t\t\twhile (inputFile.available() > 0) {\r\n\t\t\t\tint i = inputFile.read();\r\n\t\t\t\tSystem.out.println((char) i);\r\n\t\t\t\tinputFile.close();\r\n\t\t\t}\r\n\t\t} catch (IOException e) {\r\n\t\t\tSystem.out.println(e);\r\n\t\t}\r\n\t}", "public static void main(String[] args) {\n\t\t\n\t\ttry {\n\t\t\t\n\t\t\t\n\t\t\tFile file = new File(\"char_data.txt\");\n\t\t\tScanner sc = new Scanner(file, \"UTF-8\");\n\t\t\tSystem.out.println(sc.delimiter());\n\t\t\t\n\t\t\tchar ch1 = sc.next().charAt(0);\n\t\t\tint int1 = sc.nextInt();\n\t\t\tString str1 = sc.next();\n\t\t\tString str2 = \"sound\\\\\" + sc.next() + \".mp3\";\n\t\t\tString str3 = sc.next();\n\t\t\t//while (sc.next() == \"\\t\") {}\n\t\t\tString str4 = sc.nextLine();\n\t\t\t//sc.nextLine();\n\t\t\tSystem.out.print(\"The character is: \" + ch1 + \" at position: \" + int1);\n\t\t\tSystem.out.println(\" with the pinyin: \" + str1);\n\t\t\tSystem.out.println(\"The sound is in file: \" + str2);\n\t\t\tSystem.out.println(\"The construction of the character is: \" + str3);\n\t\t\tSystem.out.println(\"The meaning of the character is: \" + str4);\n\t\t\t\n\t\t\tSystem.out.println();\n\t\t\t\n\t\t\tch1 = sc.next().charAt(0);\n\t\t\tint1 = sc.nextInt();\n\t\t\tstr1 = sc.next();\n\t\t\tstr2 = \"sound\\\\\" + sc.next() + \".mp3\";\n\t\t\tstr3 = sc.next();\n\t\t\tstr4 = sc.nextLine();\n\t\t\tsc.nextLine();\n\t\t\tSystem.out.print(\"The character is: \" + ch1 + \" at position: \" + int1);\n\t\t\tSystem.out.println(\" with the pinyin: \" + str1);\n\t\t\tSystem.out.println(\"The sound is in file: \" + str2);\n\t\t\tSystem.out.println(\"The construction of the character is: \" + str3);\n\t\t\tSystem.out.println(\"The meaning of the character is: \" + str4);\n\t\t\t\n\t\t\t\n\t\t\tsc.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 load(FileInputStream input) {\n\t\t\r\n\t}", "public PasitoScanner(java.io.Reader in) {\n this.yy_reader = in;\n }", "@Test\r\n\tpublic void testSavedFile() throws FileNotFoundException {\r\n\r\n\t\tScanner in = new Scanner(new FileReader(\"FactoryScenarios/MyExample.txt\"));\r\n\t\tStringBuilder sb = new StringBuilder();\r\n\t\twhile (in.hasNext()) {\r\n\t\t\tsb.append(in.next());\r\n\t\t}\r\n\t\tin.close();\r\n\t\tString outString = sb.toString();\r\n\r\n\t\tString expected = \"Cell6Button4/~disp-string:hello/~repeat-button:2/~skip-button:02/~skip:3/~pause:5/~disp-clearAll\";\r\n\r\n\t\tassertEquals(expected, outString);\r\n\r\n\t}", "public Scanner(String inString)\n {\n in = new BufferedReader(new StringReader(inString));\n eof = false;\n getNextChar();\n }", "public void input(File inputFile){\n instantiateTable();\n try{\n String line = \"\";\n //method to scan certain words between 2 delimiting characters, usually blank lines or white spaces or tabs.\n Scanner read = new Scanner(inputFile).useDelimiter(\"\\\\W+|\\\\n|\\\\r|\\\\t|, \");\n //while there is a next word, keeps reading the file \n while (read.hasNext()){\n line = read.next().toLowerCase();\n LLNodeHash words = new LLNodeHash(line, 1, null);\n add(words);\n }\n read.close();\n }\n catch (FileNotFoundException e){\n System.out.print(\"Not found\");\n e.printStackTrace();\n }\n System.out.println(hashTable.length);\n System.out.println(space());\n System.out.println(loadFactor);\n System.out.println(collisionLength());\n print();\n }", "public void readFile();", "public static void main(String[] args) throws FileNotFoundException {\n\n\t\t// define a file object for the file on our computer we want to read\n\t\t// provide a path to the file when defining a File object\n\t\t//\n\t\t// paths can be: absolute - code all the parts from the root folder of your OS (Windows)\n\t\t//\n\t\t// paths can be: relative - code the part from the assumed current position to the file\n\t\t//\n\t\t// absolute paths should be avoided - they tightly couple the program to the directory structure it was created on\n\t\t//\t\t\t\t\t\t\t\t\t\t\tif the program is run on a machine with a different directory structure it won't work\n\t\t//\t\t\t\t\t\t\t\t\t\t\t\tbecause the absolute path doesn't exist in a different directory structure\n\t\t//\n\t\t// relative paths are preferred because you have loosely coupled the file to the directory structure\n\t\t//\t\t\tit is more likely that the relative paths will be the same from machine to machine\n\t\t//\n\t\t// path: . = current directory\n\t\t//\t\t/ = then (sub-directory or file follows)\n\t\t//\t\tnumbers.txt - file name\n\n\t\tFile theFile = new File(\"./data/numbers.txt\"); // give the File object the path to our file\n\n\t\t// define a scanner for the File object we created for the file on our computer\n\t\tScanner scannerForFile = new Scanner(theFile); // give Scanner the file object we created\n\n\t\tString aLine = \"\"; // hold a line of input from the file\n\n\n\t\tint sum = 0; // hold the sum of the numbers in a line\n\n\t\t// if we want to get all the lines in the file\n\t\t// we need to go through and get each line in the file one at a time\n\t\t// but we can't get a line from the file if there are no more lines in the file\n\t\t// we can use the Scanner class hasNextLine() method to see if there is another line in the file\n\t\t// we can set a loop to get a line from the file and process it as long as there are lines in the file\n\t\t// we will use while loop since we want loop based on a condition (as long as there are line in the file)\n\t\t// \t\t\tand not a count of lines in the file, in which case we would use a for-loop\n\t\t//\t\t\t\tfor-each-loops only work for collection classes\n\n\t\t// add up each line from my file\n\t\t// the file has one or more numbers separated by a single space in each line\n\n\t\twhile (scannerForFile.hasNextLine()) { // loop while there ia a line in the file\n\n\t\t\taLine = scannerForFile.nextLine(); // get a line from the file and store it in aLine\n\n\t\t\t// break apart the numbers in the line based on spaces\n\t\t\t// String .split() will create an array of Strings of the values separated by the delimiter\n\n\t\t\tString[] theNumbers = aLine.split(\" \"); // break apart the numbers in the line based on spaces\n\n\t\t\tSystem.out.println(\"Line from the file: \" + aLine); // display the line from the file\n\n\t\t\t// reset teh sum to 0 to clear it of the value from the last time through the loop\n\t\t\tsum = 0;\n\n\t\t\t// loop through the array of Strings holding the numbers from the line in the file\n\n\t\t\tfor (String aNumber : theNumbers) { // aNumber will hold the current element that is in the array\n\t\t\t\t\tsum = sum + Integer.parseInt(aNumber); // add the number to a sum after converting the String to an int\n\t\t\t}\n\n\t\t\t// now that we have the sum, we can display it\n\n\t\t\tSystem.out.println(\"Sum of the numbers is: \" + sum);\n\t\t\tSystem.out.println(\"Average of the numbers is: \" + sum / theNumbers.length);\n\n\t\t} // end of while loop\n\n\n\t\t\n}", "public static void main(String args[]) throws FileNotFoundException{\n\t\tFile file = new File(\"input.txt\");\r\n\t\tScanner scan = new Scanner(file);\r\n\t\twhile (scan.hasNext()) {\r\n\t\t\tString fName = scan.next();\r\n\t\t\tString lName = scan.next();\r\n\t\t\tSystem.out.println(\"Full name is: \" + fName + \" \" + lName);\r\n\t\t}\r\n\t\t\tscan.close();\r\n\t\t\r\n\t}", "private static void readFileIntoArray (String inputFileName) {\n Path path = Paths.get(inputFileName);\n array = new int[countLines(inputFileName)];\n try {\n Scanner sc = new Scanner(path);\n int i = 0;\n while (sc.hasNextLine()) {\n array[i] = Integer.parseInt(sc.nextLine());\n i++;\n }\n sc.close();\n //sort the array\n MergeSort.mergeSort(array);\n }\n catch(FileNotFoundException e) {\n System.out.println(\"File Error\");\n e.printStackTrace();\n }\n catch(IOException e) {\n System.out.println(\"File Error\");\n e.printStackTrace();\n }\n }", "public StreamReader() {}", "static void read()\n\t\t{\n\n\n\t\t\tString content=new String();\n\t\t\ttry {\n\t\t\t\tFile file=new File(\"Dic.txt\");\n\t\t\t\tScanner scan=new Scanner(file);\n\t\t\t\twhile(scan.hasNextLine()) {\n\t\t\t\t\tcontent=scan.nextLine();\n\t\t\t\t//\tSystem.out.println(content);\n\n\t\t\t\t//\tString [] array=content.split(\" \");\n\t\t\t\t\tlist.add(content.trim());\n\n\t\t\t\t}\n\t\t\t\tscan.close(); \n\t\t\t}\n\t\t\tcatch (Exception e) {\n\t\t\t\tSystem.out.println(e);\n\t\t\t}\n\n\n\t\t}", "public ScanOperator(File file){\r\n\t\tthis.file = file;\r\n\t\ttry{\r\n\t\t br = new RandomAccessFile(this.file, \"r\");\r\n\t\t}catch(FileNotFoundException e){\r\n\t\t\tSystem.out.println(\"File not found!\");\r\n\t\t}\r\n\t}", "public MyInputStream()\n {\n in = new BufferedReader\n (new InputStreamReader(System.in));\n }", "private ConsoleScanner() {}", "public Scanner getScanner(){\n\t\t\n\t\tboolean hasFile = false;\n\t\tString filename = \"\";\n\t\tfor(int i = 0; i<argList.size(); i++ ){\n\t\t\tif(argList.get(i).equals(\"-f\")){\n\t\t\t\thasFile = true;\n\t\t\t\tfilename = argList.get(i+1);\n\t\t\t}\n\t\t}\n\t\tSystem.out.println(System.getProperty(\"user.dir\") + \" ... \" + filename);\n\t\tFile file = new File(System.getProperty(\"user.dir\")+\"\\\\ARM230Compiler\\\\InputOutputFolder\\\\\", filename);\n\t\tScanner toReturn = null;\n\t\ttry {\n\t\t\ttoReturn = new Scanner(file);\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\treturn toReturn;\n\t}", "public void scan() throws ScanErrorException\n {\n while(! eof)\n {\n Token next = nextToken();\n if (next != null)\n System.out.println(next);\n }\n\n try\n {\n in.close();\n }\n catch (IOException e)\n {\n System.err.println(\"Catastrophic File IO error.\\n\" + e);\n System.exit(1); \n //exit with nonzero exit code to indicate catastrophic error\n }\n }", "public void readDataFromFile() {\n System.out.println(\"Enter address book name: \");\n String addressBookFile = sc.nextLine();\n Path filePath = Paths.get(\"C:\\\\Users\\\\Muthyala Aishwarya\\\\git\" + addressBookFile + \".txt\");\n try {\n Files.lines(filePath).map(line -> line.trim()).forEach(line -> System.out.println(line));\n } catch (IOException e) {\n e.printStackTrace();\n }\n }", "public Scanner getScanner(){\n\t\t\n\t\tString filename = \"\";\n\t\tfor(int i = 0; i<argList.size(); i++ ){\n\t\t\tif(argList.get(i).equals(\"-f\")){\n\t\t\t\tfilename = argList.get(i+1);\n\t\t\t\t//DIFFERENT FROM OTHER INIT FILE!\n\t\t\t\tfilename = filename.trim().replace(\".s230\", \".S230\");\n\t\t\t}\n\t\t}\n\t\tSystem.out.println(System.getProperty(\"user.dir\") + \" ... \" + filename);\n\t\tString dirName = System.getProperty(\"user.dir\");\n\t\tdirName = dirName.replace(\"\\\\Program_Files\\\\source\",\"\\\\\").trim();\n\t\tdirName = dirName.replace(\"\\\\Program_Files\\\\classes\",\"\\\\\").trim();\n\t\tdirName = dirName.concat(\"\\\\InputOutputFolder\\\\\");\n\t\tSystem.out.println(dirName+filename);\n\t\tFile file = new File(dirName, filename);\n\t\tScanner toReturn = null;\n\t\ttry {\n\t\t\ttoReturn = new Scanner(file);\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\treturn toReturn;\n\t}", "public static void main(String[] args) throws FileNotFoundException {\n Scanner input = new Scanner(System.in);\n files(input); // calls files method \n }", "public static void main(String[] args) throws IOException{\n\t\t\t\n\t\t\t FileReader fs = new FileReader(\"C:\\\\Users\\\\rk\\\\Desktop\\\\Test1.txt\");\n\t\t\t BufferedReader br = new BufferedReader(fs);\n\t\t\t \n\t\t\t String i=null;\n\t\t\t while((i=br.readLine())!=null){\n\t\t\t\t System.out.println(i);\n\t\t\t }\n\t\t\t \n \n\t\t}" ]
[ "0.69643706", "0.6922244", "0.6889643", "0.6859297", "0.6814297", "0.6660352", "0.66130334", "0.6489196", "0.6426292", "0.6412208", "0.6412208", "0.6284936", "0.62173074", "0.6166391", "0.61630523", "0.6139653", "0.6103596", "0.60544664", "0.60501283", "0.6049663", "0.60454535", "0.6032424", "0.59920454", "0.59557873", "0.59315485", "0.59315485", "0.59063286", "0.58534366", "0.5851512", "0.58472586", "0.58445036", "0.5839953", "0.5837358", "0.58205384", "0.58167857", "0.58064026", "0.5800913", "0.57924324", "0.5772717", "0.5749327", "0.57445985", "0.57302797", "0.57263523", "0.57086486", "0.56944126", "0.56907034", "0.5689977", "0.5688246", "0.5684038", "0.5674832", "0.5673953", "0.56470555", "0.56450903", "0.56433064", "0.56415635", "0.5640648", "0.56341356", "0.5624965", "0.56116676", "0.560817", "0.55941266", "0.55872625", "0.5572337", "0.5565935", "0.55655015", "0.55642986", "0.55560184", "0.5551493", "0.5548435", "0.5534097", "0.55331475", "0.55278116", "0.55243033", "0.55161446", "0.55143493", "0.55139333", "0.550195", "0.54968685", "0.5493731", "0.54802877", "0.54773176", "0.5473811", "0.5473402", "0.54534596", "0.54516256", "0.54501355", "0.54425836", "0.54379904", "0.5434156", "0.5433356", "0.5426407", "0.54236007", "0.54107636", "0.5403448", "0.54012865", "0.539775", "0.53960335", "0.5395092", "0.53898454", "0.5384856", "0.5384687" ]
0.0
-1
Reserve a location by the strategy
public Location reserveShippingStageLocation(ShippingStageAreaConfiguration shippingStageAreaConfiguration, Pick pick) { logger.debug("Start to reserve a ship stage location for the pick {}, by configuration {} / strategy {}", pick.getNumber(), shippingStageAreaConfiguration.getSequence(), shippingStageAreaConfiguration.getLocationReserveStrategy()); String reserveCode = ""; switch (shippingStageAreaConfiguration.getLocationReserveStrategy()) { case BY_ORDER: reserveCode = pick.getOrderNumber(); break; case BY_SHIPMENT: reserveCode = pick.getShipmentLine().getShipmentNumber(); break; case BY_WAVE: reserveCode = pick.getShipmentLine().getWave().getNumber(); break; } logger.debug(" will reserve ship stage with code: {}", reserveCode); if (StringUtils.isBlank(reserveCode)) { throw ShippingException.raiseException("Shipping Stage Area Configuration is no correctly defined"); } return warehouseLayoutServiceRestemplateClient.reserveLocationFromGroup( shippingStageAreaConfiguration.getLocationGroupId(), reserveCode, pick.getSize(), pick.getQuantity(), 1); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public boolean reserveRoom(int id, int customerID, String location)\n throws RemoteException, DeadlockException;", "private void doReserve() {\n pickParkingLot();\n pickParkingSpot();\n pickTime();\n pickDuration();\n int amount = pickedparkinglot.getPrice() * pickedduration;\n if (pickedAccount.getBalance() >= amount) {\n currentReservation = new Reservation(pickedparkingspot, pickedAccount, pickedtime, pickedduration);\n validateReservation(currentReservation);\n } else {\n System.out.println(\"Insufficient balance\");\n }\n }", "public boolean reserveCar(int id, int customerID, String location)\n throws RemoteException, DeadlockException;", "public abstract boolean freeSlot(LocationDto location ,SlotDto slot);", "Location createLocation();", "Location createLocation();", "Location createLocation();", "public void reserveSeat(String visitorName, String seatNumber) {\n\t}", "void makeUseOfNewLocation(Location location) {\n if ( isBetterLocation(location, currentBestLocation) ) {\n currentBestLocation = location;\n }\n }", "protected void createLocationRequest() {\n\t\tmLocationRequest = new LocationRequest();\n\t\tmLocationRequest.setInterval(UPDATE_INTERVAL);\n\t\tmLocationRequest.setFastestInterval(FATEST_INTERVAL);\n\t\tmLocationRequest.setPriority(LocationRequest.PRIORITY_HIGH_ACCURACY);\n\t\tmLocationRequest.setSmallestDisplacement(DISPLACEMENT);\n\t}", "Place resolveLocation( Place place );", "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 }", "@Override\r\n\tpublic void placeRoad(EdgeLocation edgeLoc) {\n\t\t\r\n\t}", "@Override\r\n\tpublic ErrorCode reserveRoom(\r\n\t\t\tString guestID, String hotelName, RoomType roomType, SimpleDate checkInDate, SimpleDate checkOutDate,\r\n\t\t\tlong resID) {\n\t\tErrorAndLogMsg m = clientProxy.reserveHotel(\r\n\t\t\t\tguestID, hotelName, roomType, checkInDate, checkOutDate, \r\n\t\t\t\t(int)resID);\r\n\t\t\r\n\t\tSystem.out.print(\"RESERVE INFO:\");\r\n\t\tm.print(System.out);\r\n\t\tSystem.out.println(\"\");\r\n\t\t\r\n\t\treturn m.errorCode();\r\n\t}", "public PlaceReserveInformationExample() {\n oredCriteria = new ArrayList<Criteria>();\n }", "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 }", "public void placeShip(Coordinate selected, int orientation) {\r\n HashSet<Coordinate> location = new HashSet<>();\r\n if (orientation == -1) { //user Xed the orientation window\r\n location.add(selected);\r\n data.orientationXedFlag = true;\r\n } \r\n else { //user didnt X the orientation window\r\n Boolean spaceIsFree = false;\r\n if (data.gameState == 1) {\r\n location = game.getPlayerOne().constructLocation(selected, orientation, data.shipToPlace);\r\n spaceIsFree = game.getPlayerOne().checkLegalPlacement(location, orientation);\r\n }\r\n else if (data.gameState == 2) {\r\n location = game.getPlayerTwo().constructLocation(selected, orientation, data.shipToPlace);\r\n spaceIsFree = game.getPlayerTwo().checkLegalPlacement(location, orientation);\r\n }\r\n\r\n if (spaceIsFree) {\r\n if (data.gameState == 1)\r\n game.getPlayerOne().placeShip(location, data.shipToPlace);\r\n else if (data.gameState == 2)\r\n game.getPlayerTwo().placeShip(location, data.shipToPlace);\r\n data.placementSuccessful = true;\r\n data.shipToPlace++;\r\n }\r\n else {\r\n data.placementSuccessful = false; \r\n location.clear();\r\n location.add(selected);\r\n } \r\n }\r\n data.placement = convertPlacementData(location);\r\n setChanged();\r\n notifyObservers(data);\r\n data.orientationXedFlag = false;\r\n data.placementSuccessful = false; //reset flags to false to avoid errornous updates \r\n }", "private void createLocationRequest() {\n mLocationRequest = new LocationRequest();\n mLocationRequest = LocationRequest.create();\n mLocationRequest.setPriority(LocationRequest.PRIORITY_HIGH_ACCURACY);\n }", "@Insert\n boolean upsertLocation(SpacecraftLocationOverTime reading);", "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 pickCurrentPlace() {\n if (mMap == null) {\n return;\n }\n\n if (mLocationPermissionGranted) {\n getDeviceLocation();\n } else {\n getLocationPermission();\n }\n }", "public boolean reserve(int reservation) {\n int index = reservation - this.loRange;\n if (this.freeSet.get(index)) { // FREE\n this.freeSet.clear(index);\n return true;\n } else {\n return false;\n }\n }", "@Override\r\n\tpublic void placeSettlement(VertexLocation vertLoc) {\n\t\t\r\n\t}", "public void locateParkedCar() {\n\t\tthis.generalRequest(LocalRequestType.LOCATE);\n\t}", "public Location (\n \t\tjava.lang.Long uniqueId,\n \t\tjava.lang.Long permanentId,\n \t\tjava.lang.Integer capacity,\n \t\tjava.lang.Integer coordinateX,\n \t\tjava.lang.Integer coordinateY,\n \t\tjava.lang.Boolean ignoreTooFar,\n \t\tjava.lang.Boolean ignoreRoomCheck) {\n \n \t\tsuper (\n \t\t\tuniqueId,\n \t\t\tpermanentId,\n \t\t\tcapacity,\n \t\t\tcoordinateX,\n \t\t\tcoordinateY,\n \t\t\tignoreTooFar,\n \t\t\tignoreRoomCheck);\n \t}", "private void fineLocationPermissionGranted() {\n UtilityService.addGeofences(this);\n UtilityService.requestLocation(this);\n }", "protected void createLocationRequest() {\n mLocationRequest = new LocationRequest();\n int UPDATE_INTERVAL = 1000 * 60 * 5;\n mLocationRequest.setInterval(UPDATE_INTERVAL);\n int FASTEST_INTERVAL = 5000;\n mLocationRequest.setFastestInterval(FASTEST_INTERVAL);\n mLocationRequest.setPriority(LocationRequest.PRIORITY_HIGH_ACCURACY);\n int DISPLACEMENT = 20;\n mLocationRequest.setSmallestDisplacement(DISPLACEMENT); // 20 meters\n }", "@Override\n\tpublic boolean reserve() {\n\t\treturn false;\n\t}", "public void createLocationRequest(){\n locationRequest = new LocationRequest();\n locationRequest.setInterval(1000);\n locationRequest.setFastestInterval(500);\n locationRequest.setPriority(LocationRequest.PRIORITY_HIGH_ACCURACY);\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 }", "void queueLocation(IfaceLocation loc);", "public Location spread()\n {\n // plant needs to be alive, ready to reproduce (# of turns) \n // square needs to have fewer than 10 plants, BUT a tree can kill \n // a grass plant\n }", "public DeployCardToLocationFromReserveDeckEffect(Action action, Filter cardFilter, Filter locationFilter, boolean forFree, boolean reshuffle) {\n super(action, cardFilter, Filters.locationAndCardsAtLocation(locationFilter), forFree, reshuffle);\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 LocationPoint(){\n this.mLocationID = UUID.randomUUID();\n }", "public abstract void updateLocation(Location location, String newLocationName, int newLocationCapacity);", "@Override\n protected void checkLocation() {\n // nothing\n }", "@Override\n public void onLocationAvailability(LocationAvailability availability) {\n }", "public void setLocation(entity.PolicyLocation value);", "private void getLocation() {\n\n }", "public void populateRegion(World world, String regionName, ProtectedRegion region) {\n long timeAtStart = System.currentTimeMillis();\n ProtectedPolygonalRegion polygonalRegion = (ProtectedPolygonalRegion) region;\n Location found;\n int attempt = 0;\n int minX = polygonalRegion.getMinimumPoint().getBlockX();\n int maxX = polygonalRegion.getMaximumPoint().getBlockX();\n int minY = polygonalRegion.getMinimumPoint().getBlockY();\n int maxY = polygonalRegion.getMaximumPoint().getBlockY();\n int minZ = polygonalRegion.getMinimumPoint().getBlockZ();\n int maxZ = polygonalRegion.getMaximumPoint().getBlockZ();\n List<Location> locationList = new ArrayList<>();\n // Increase the amount of attempts here.\n while (attempt < 100) {\n attempt++;\n int x = ThreadLocalRandom.current().nextInt(minX, maxX + 1);\n int z = ThreadLocalRandom.current().nextInt(minZ, maxZ + 1);\n int y = getHighestYAt(new Location(world, x, maxY, z), minY);\n if (y == -1) {\n continue;\n }\n found = new Location(world, x, y, z);\n Block block = found.getBlock();\n if (!main.validFloorMaterials.contains(block.getType()))\n continue;\n\n if (!polygonalRegion.contains(BukkitUtil.toVector(found)))\n continue;\n\n Block airSpaceAbove = found.add(0, 1, 0).getBlock();\n if (airSpaceAbove.getType() != Material.AIR)\n continue;\n\n Block airSpaceTwoAbove = found.add(0, 1, 0).getBlock();\n if (airSpaceTwoAbove.getType() != Material.AIR)\n continue;\n\n locationList.add(found.add(0, -1, 0));\n }\n main.preLoadedSpawnLocations.put(regionName, locationList);\n long duration = System.currentTimeMillis() - timeAtStart;\n System.out.print(\"Generated \" + locationList.size() + \" points for the region \" + regionName + \". (Took \" + duration + \" ms.)\");\n }", "public Population (Coordinate location){\n this.location = location;\n }", "boolean canPlaceRoad(EdgeLocation edgeLoc, boolean free);", "@Override\r\n public void getLocation(Location location) {\r\n if(!(REQUEST==PLACE_AUTOCOMPLETE_REQUEST_CODE || REQUEST==OPEN_SETTINGS)){\r\n mCurrentLocation = location;\r\n moveToCurrentLocation();\r\n }\r\n }", "int getLocation() throws IllegalStateException;", "private Location generateRandomStartLocation() {\n\t\tif (!atLeastOneNonWallLocation()) {\n\t\t\tthrow new IllegalStateException(\n\t\t\t\t\t\"There is no free tile available for the player to be placed\");\n\t\t}\n\n\t\twhile (true) {\n\t\t\t// Generate a random location\n\t\t\tfinal Random random = new Random();\n\t\t\tfinal int randomRow = random.nextInt(this.map.getMapHeight());\n\t\t\tfinal int randomCol = random.nextInt(this.map.getMapWidth());\n\n\t\t\tfinal Location location = new Location(randomCol, randomRow);\n\n\t\t\tif (this.map.getMapCell(location).isWalkable()\n\t\t\t\t\t&& !otherPlayerOnTile(location, -1)) {\n\t\t\t\t// If it's not a wall then we can put them there\n\t\t\t\treturn location;\n\t\t\t}\n\t\t}\n\t}", "@Override\r\n\tpublic void spawn(Location location) {\n\t\t\r\n\t}", "public void setLocation(Coordinate coordinate);", "private void enableLocation(){\n if(PermissionsManager.areLocationPermissionsGranted(this))\n {\n initializeLocationEngine();\n initializeLocationLayer();\n\n\n }else{\n permissionsManager = new PermissionsManager(this);\n permissionsManager.requestLocationPermissions(this);\n }\n }", "WithCreate withRegion(Region location);", "WithCreate withRegion(Region location);", "public GenericResponse<Booking> reserveRoom(Booking booking) {\n GenericResponse genericResponse = HotelBookingValidation.validateBookingInfo(logger, hotel, booking);\n if (genericResponse != null) {\n return genericResponse;\n }\n\n logger.info(booking.toString());\n\n if (hotel.getBookings().putIfAbsent(booking.getBookingRoom(), booking.getUser()) == null) {\n return GenericResponseUtils.generateFromSuccessfulData(booking);\n }\n\n logger.info(\"Oops. Please try again.\");\n return GenericResponseUtils.generateFromErrorMessage(\"Oops. Please try again.\");\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 }", "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 }", "private LocationContract() {}", "@Override\n\tpublic Location<Vector2> newLocation() {\n\t\treturn null;\n\t}", "public void updateLocation();", "private void playerReserve(String promoCode, String username)\n {\n\n Reservation myReservation = new Reservation(username,reservationStartsOn,reservationEndsOn,pitch.getVenueID(),pitch.getPitchName(),promoCode);\n connectionManager.reserve(myReservation, instance);\n }", "WithCreate withRegion(String location);", "WithCreate withRegion(String location);", "public void moveToLastAcceptableLocation(){\n\t\tthis.x=this.xTemp;\n\t\tthis.y=this.yTemp;\n\t}", "public DeployCardToLocationFromReserveDeckEffect(Action action, Filter cardFilter, Filter locationFilter, boolean forFree, DeploymentRestrictionsOption deploymentRestrictionsOption, boolean reshuffle) {\n super(action, cardFilter, Filters.locationAndCardsAtLocation(locationFilter), forFree, deploymentRestrictionsOption, reshuffle);\n }", "public interface Reservation extends Closeable {\n \n boolean isSentinel();\n \n Resource getResource();\n \n void free();\n }", "private void pickCurrentPlace() {\n if (mMap == null) {\n return;\n }\n\n if (mLocationPermissionGranted) {\n getDeviceLocation();\n } else {\n // The user has not granted permission.\n Log.i(TAG, \"The user did not grant location permission.\");\n\n // Add a default marker, because the user hasn't selected a place.\n mMap.addMarker(new MarkerOptions()\n .title(getString(R.string.default_info_title))\n .position(mDefaultLocation)\n .snippet(getString(R.string.default_info_snippet)));\n\n // Prompt the user for permission.\n getLocationPermission();\n }\n }", "@SuppressLint(\"MissingPermission\")\n private void requestLocationUpdate() {\n }", "private static void addReservationConstraint()\n {\n ReservationConstraints constraint = new ReservationConstraints(new Date(), new Date(), \"bogusCarType\");\n System.out.println(\"press any key to try to register quote : \" + constraint);\n Main.readLine();\n \n if(session.createQuote(constraint) != null)\n System.out.println(\"Quote registered\");\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 }", "@Override\r\n public void getLocation(Location location) {\r\n if (REQUEST != PLACE_AUTOCOMPLETE_REQUEST_CODE || REQUEST != OPEN_SETTINGS) {\r\n mCurrentLocation = location;\r\n moveToCurrentLocation();\r\n }\r\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 }", "protected Location nextLocation()\n {\n // Get list of neighboring empty locations.\n ArrayList emptyNbrs = emptyNeighbors();\n\n // Remove the location behind, since fish do not move backwards.\n Direction oppositeDir = direction().reverse();\n Location locationBehind = environment().getNeighbor(location(),\n oppositeDir);\n emptyNbrs.remove(locationBehind);\n Debug.print(\"Possible new locations are: \" + emptyNbrs.toString());\n\n // If there are no valid empty neighboring locations, then we're done.\n if ( emptyNbrs.size() == 0 )\n return location();\n\n // Return a randomly chosen neighboring empty location.\n Random randNumGen = RandNumGenerator.getInstance();\n int randNum = randNumGen.nextInt(emptyNbrs.size());\n\t return (Location) emptyNbrs.get(randNum);\n }", "public DeployCardToLocationFromReserveDeckEffect(Action action, PhysicalCard card, Filter locationFilter, boolean forFree, boolean asReact, boolean reshuffle) {\n super(action, card, Filters.locationAndCardsAtLocation(locationFilter), forFree, asReact, reshuffle);\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 }", "public Place(int x, int y){\n this.x=x;\n this.y=y;\n isFull=false;\n }", "protected void createLocationRequest() {\n mLocationRequest = new LocationRequest();\n\n // Sets the desired interval for active location updates. This interval is\n // inexact.\n mLocationRequest.setInterval(UPDATE_INTERVAL_IN_MILLISECONDS);\n\n // Sets the fastest rate for active location updates. This interval is exact, and your\n // application will never receive updates faster than this value.\n mLocationRequest.setFastestInterval(FASTEST_UPDATE_INTERVAL_IN_MILLISECONDS);\n\n mLocationRequest.setPriority(LocationRequest.PRIORITY_HIGH_ACCURACY);\n Log.d(Constants.LOCATION_REQUEST, Constants.LOCATION_REQUEST);\n }", "CurrentReservation createCurrentReservation();", "public void reserve(int customerId){\n\t\treserved = true;\n\t\tthis.customerId = customerId;\n\t}", "protected void reservePerson(Person person) {\n person.setIsWorking(true);\n this.setAvailablePersons(this.getAvailablePersons() - 1);\n this.countLabel.setText(\"Available: \" + String.valueOf(this.getAvailablePersons()));\n }", "protected void createLocationRequest() {\n mLocationRequest = new LocationRequest();\n //Sets the preferred interval for GPS location updates\n mLocationRequest.setInterval(UPDATE_INTERVAL_IN_MS);\n //Sets the fastest interval for GPS location updates\n mLocationRequest.setFastestInterval(FASTEST_UPDATE_INTERVAL_IN_MS);\n //Sets priority of the GPS location to accuracy\n mLocationRequest.setPriority(LocationRequest.PRIORITY_HIGH_ACCURACY);\n }", "public abstract void updateLocationXml(Location location, String newLocationName, int newLocationCapacity);", "@Test\n\tpublic void chooseCorrectStationsWhenPlanningShortestRide()\n\t\t\tthrows InvalidBikeTypeException, InvalidRidePlanPolicyException, NoValidStationFoundException {\n\t\tRidePlan bobRidePlan = n.createRidePlan(source, destination, bob, \"SHORTEST\", \"MECH\");\n\t\tRidePlan sRidePlan = new RidePlan(source, destination, sourceStationS, destStationS, \"SHORTEST\", \"MECH\", n);\n\t\tassertTrue(bobRidePlan.equals(sRidePlan));\n\t}", "public DeployCardToLocationFromReserveDeckEffect(Action action, Filter cardFilter, Filter locationFilter, boolean forFree, boolean asReact, boolean reshuffle) {\n super(action, cardFilter, Filters.locationAndCardsAtLocation(locationFilter), forFree, asReact, reshuffle);\n }", "public void fetchLocation() throws LocationException {\n if (listener != null && hasSystemFeature() && isProviderEnabled() && isSecure()) {\n try {\n locationManager.requestLocationUpdates(provider, DeviceConstant.MIN_TIME_BW_UPDATES,\n DeviceConstant.MIN_DISTANCE_CHANGE_FOR_UPDATES, listener);\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 }", "public void free(int reservation) {\n this.freeSet.set(reservation - this.loRange);\n }", "Reservation createReservation();", "public void setLocation(String location);", "@Override\r\n\tpublic Location updateLocation(Location location, boolean force) {\r\n\t\t\r\n\t\tif(force||\r\n\t\t\t\tlocation.getTimestampmilis()>=pos.getTimestampmilis()||\r\n\t\t\t\t(\r\n\t\t\t\t\tpos.getAccurancy()==-1||\r\n\t\t\t\t\tlocation.getAccurancy()>=0&&(location.getAccurancy()<pos.getAccurancy())\r\n\t\t\t\t)\r\n\t\t\t){\r\n\t\t\tpos=location;\r\n\t\t}else {\r\n\t\t\tLogger.d( \"Location not updated\");\r\n\t\t}\r\n\t\treturn pos;\r\n\t}", "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 }", "public interface LocationProvider {\r\n\t\r\n\t/**\r\n\t * Returns the current location.\r\n\t * \r\n\t * @return the current location\r\n\t */\r\n\tpublic Location getCurrentLocation();\r\n\t\r\n\t/**\r\n\t * Returns the previous locations, not including the current location.\r\n\t * \r\n\t * @return the previous locations\r\n\t */\r\n\tpublic List<Location> getPreviousLocations();\r\n\t\r\n\t/**\r\n\t * Tells if this location manager is prepared for the first speed checks, i.e., if it has received at\r\n\t * least two location updates.\r\n\t * \r\n\t * @return true if sufficient locations are available\r\n\t */\r\n\tpublic boolean isReady();\r\n\r\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 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 createNewLocationRequest(int priority,Long interval,long fastestInterval){\n\t mLocationRequest = LocationRequest.create();\n\t // Use high accuracy\n\t mLocationRequest.setPriority(priority);\n\t // Set the update interval to 5 seconds\n\t mLocationRequest.setInterval(interval);\n\t // Set the fastest update interval to 1 second\n\t mLocationRequest.setFastestInterval(fastestInterval);\n\t \n\t }", "public void setBedSpawnLocation ( Location location , boolean force ) {\n\t\texecute ( handle -> handle.setBedSpawnLocation ( location , force ) );\n\t}", "private void setPickupLocation(){\n \t\t// Defines the AutoCompleteTextView pickupText\n \t\tacPickup = (AutoCompleteTextView)findViewById(R.id.pickupText);\n \t\t// Controls if the user has entered an address\n \t\tif(!acPickup.getText().toString().equals(\"\")){\n \t\t\t// Gets the GeoPoint of the written address\n \t\t\tGeoPoint pickupGeo = GeoHelper.getGeoPoint(acPickup.getText().toString());\n \t\t\t// Gets the MapLocation of the GeoPoint\n \t\t\tMapLocation mapLocation = (MapLocation) GeoHelper.getLocation(pickupGeo);\n \t\t\t// Finds the pickup location on the route closest to the given address\n \t\t\tLocation temp = findClosestLocationOnRoute(mapLocation);\n \t\t\n \t\t\t//Controls if the user has entered a NEW address\n \t\t\tif(pickupPoint != temp){\n \t\t\t\t// Removes old pickup point (thumb)\n \t\t\t\tif(overlayPickupThumb != null){\n \t\t\t\t\tmapView.getOverlays().remove(overlayPickupThumb);\n \t\t\t\t\toverlayPickupThumb = null;\n \t\t\t\t}\n \t\t\t\tmapView.invalidate();\n \t\t\t\t\n \t\t\t\t// If no dropoff point is specified, we add the pickup point to the map.\n \t\t\t\tif(dropoffPoint == null){\n \t\t\t\t\tpickupPoint = temp;\n \t\t\t\t\toverlayPickupThumb = drawThumb(pickupPoint, true);\n \t\t\t\t}else{ // If a dropoff point is specified:\n \t\t\t\t\tList<Location> l = getApp().getSelectedJourney().getRoute().getRouteData();\n \t\t\t\t\t// Checks to make sure the pickup point is before the dropoff point.\n \t\t\t\t\tif(l.indexOf(temp) < l.indexOf(dropoffPoint)){\n \t\t\t\t\t\t//makeToast(\"The pickup point has to be before the dropoff point\");\n \t\t\t\t\t\tAlertDialog.Builder ad = new AlertDialog.Builder(MapActivityAddPickupAndDropoff.this); \n \t\t\t\t\t\tad.setMessage(\"The pickup point has to be before the dropoff point\");\n \t\t\t\t\t\tad.setTitle(\"Unable to send request\");\n \t\t\t\t\t\tad.setPositiveButton(\"Ok\",new DialogInterface.OnClickListener() {\n \t\t\t\t\t\t\tpublic void onClick(DialogInterface dialog,int id) {\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\tad.show();\n \t\t\t\t\t}else{\n \t\t\t\t\t\t// Adds the pickup point to the map by drawing a cross\n \t\t\t\t\t\tpickupPoint = temp;\n \t\t\t\t\t\toverlayPickupThumb = drawThumb(pickupPoint, true);\n \t\t\t\t\t}\n \t\t\t\t}\n \t\t\t}\n \t\t}else{\n \t\t\t//makeToast(\"Please add a pickup address\");\n \t\t\tAlertDialog.Builder ad = new AlertDialog.Builder(MapActivityAddPickupAndDropoff.this); \n \t\t\tad.setMessage(\"Please add a pickup address\");\n \t\t\tad.setTitle(\"Unable to send request\");\n \t\t\tad.setPositiveButton(\"Ok\",new DialogInterface.OnClickListener() {\n \t\t\t\tpublic void onClick(DialogInterface dialog,int id) {\n \t\t\t\t\t\n \t\t\t\t}\n \t\t\t });\n \t\t\tad.show();\n \t\t}\n \t}", "private LocationRequest createLocationRequest() {\r\n LocationRequest mLocationRequest = new LocationRequest();\r\n mLocationRequest.setInterval(2000);\r\n mLocationRequest.setFastestInterval(1000);\r\n mLocationRequest.setPriority(LocationRequest.PRIORITY_HIGH_ACCURACY);\r\n return mLocationRequest;\r\n }", "public void assignToLocation(Location location) {\n if (getAssignedLocation() != location) {\n if (this.location != null) {\n this.location.fireEmployee(this);\n }\n this.location = location;\n this.location.hireEmployee(this);\n }\n }", "public void moveRobber(HexLocation loc) {\n\n\t}", "Tower(Point location)\r\n\t{\r\n\t\tthis.location=location;\r\n\t}", "private void addPendingLocationRequest(LocationRequest locationRequest, LocationActivityResultListener listener) {\n mPendingLocationRequests.add(listener);\n\n // If it's the first pending request, let's ask the user to turn on high accuracy location.\n if (mPendingLocationRequests.size() == 1) {\n resolveUserSettingsForRequest(locationRequest);\n }\n }", "public abstract LocationDto defaultLocation(ScheduleDto schedule);" ]
[ "0.63310444", "0.5920073", "0.5885867", "0.58643454", "0.5808297", "0.5808297", "0.5808297", "0.5662932", "0.5662397", "0.5611594", "0.558931", "0.55637854", "0.5556583", "0.55399805", "0.55177474", "0.5507253", "0.5504436", "0.54616135", "0.5429298", "0.53980863", "0.5352123", "0.53368604", "0.5325925", "0.53156894", "0.5307774", "0.52994215", "0.5299074", "0.5289864", "0.52796865", "0.5278469", "0.5271185", "0.52692014", "0.52618015", "0.526029", "0.52231765", "0.5218557", "0.521122", "0.52082473", "0.52034295", "0.5165647", "0.5157519", "0.5154462", "0.5154055", "0.5150292", "0.511883", "0.5111522", "0.5100005", "0.50835735", "0.50811994", "0.5078873", "0.5078873", "0.5070975", "0.50697917", "0.5054352", "0.50543505", "0.50400954", "0.5039075", "0.5037865", "0.5032174", "0.5032174", "0.5024027", "0.5022598", "0.5020657", "0.5014737", "0.5011699", "0.50100815", "0.5007843", "0.50046533", "0.49955508", "0.49954817", "0.49894014", "0.49858057", "0.49858057", "0.4985378", "0.49824646", "0.497722", "0.4975446", "0.49550104", "0.49530894", "0.495141", "0.49480423", "0.4947812", "0.49446177", "0.4942299", "0.49422565", "0.49421942", "0.49409074", "0.49403962", "0.4935583", "0.49333993", "0.49281266", "0.4925023", "0.49068576", "0.49067876", "0.4903865", "0.49029213", "0.4896161", "0.48959795", "0.48902342", "0.488641" ]
0.58628124
4
create a list of integers
public static void main(String args[]) { List<Integer> number = Arrays.asList(2,3,4,5); // demonstration of map method List<Integer> square = number.stream().map(x -> x*x). collect(Collectors.toList()); System.out.println("Square od number using map()"+square); // create a list of String List<String> names = Arrays.asList("Reflection","Collection","Stream"); // demonstration of filter method List<String> result = names.stream().filter(s->s.startsWith("S")). collect(Collectors.toList()); System.out.println(result); // demonstration of sorted method List<String> show = names.stream().sorted().collect(Collectors.toList()); System.out.println(show); // create a list of integers List<Integer> numbers = Arrays.asList(2,3,4,5,2); // collect method returns a set Set<Integer> squareSet = numbers.stream().map(x->x*x).collect(Collectors.toSet()); System.out.println(squareSet); // demonstration of forEach method number.stream().map(x->x*x).forEach(y->System.out.println(y)); // demonstration of reduce method int even = number.stream().filter(x->x%2==0).reduce(0,(ans,i)-> ans+i); System.out.println(even); // Create a String with no repeated keys Stream<String[]> str = Stream .of(new String[][] { { "GFG", "GeeksForGeeks" }, { "g", "geeks" }, { "G", "Geeks" } }); // Convert the String to Map // using toMap() method Map<String, String> map = str.collect( Collectors.toMap(p -> p[0], p -> p[1])); // Print the returned Map System.out.println("Map:" + map); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private static ArrayList<Integer> makeListOfInts() {\n ArrayList<Integer> listOfInts = new ArrayList<>(Arrays.asList(7096, 3, 3924, 2404, 4502,\n 4800, 74, 91, 9, 7, 9, 6790, 5, 59, 9, 48, 6345, 88, 73, 88, 956, 94, 665, 7,\n 797, 3978, 1, 3922, 511, 344, 6, 10, 743, 36, 9289, 7117, 1446, 10, 7466, 9,\n 223, 2, 6, 528, 37, 33, 1616, 619, 494, 48, 9, 5106, 144, 12, 12, 2, 759, 813,\n 5156, 9779, 969, 3, 257, 3, 4910, 65, 1, 907, 4464, 15, 8685, 54, 48, 762, 7952,\n 639, 3, 4, 8239, 4, 21, 306, 667, 1, 2, 90, 42, 6, 1, 3337, 6, 803, 3912, 85,\n 31, 30, 502, 876, 8686, 813, 880, 5309, 20, 27, 2523, 266, 101, 8, 3058, 7,\n 56, 6961, 46, 199, 866, 4, 184, 4, 9675, 92));\n\n return listOfInts;\n }", "public static List<Integer> getIntegerList(){\n List<Integer> nums = new ArrayList<>();//ArrayList<Integer> list = new ArrayList<>();\n for(int i=0;i<=1_000_000;i++) {\n nums.add(i);\n }\n return nums;\n }", "public int[] getIntList();", "private List<Integer> toList(int[] array) {\n List<Integer> list = new LinkedList<Integer>();\n for (int item : array) {\n list.add(item);\n }\n return list;\n }", "private MyIntegerList generatedPopulatedList() {\n final MyIntegerList mil = new MyIntegerList();\n\n mil.push(1);\n mil.push(2);\n mil.push(1);\n mil.push(6);\n mil.push(6);\n mil.push(7);\n mil.push(2);\n mil.push(2);\n mil.push(0);\n mil.push(5);\n\n return mil;\n }", "private List<Integer> makeList(int max) {\n List<Integer> myList = new ArrayList<>();\n for (int i = 1; i < max; i++) {\n myList.add(i);\n }\n \n return myList;\n }", "public static List<Integer> asList(int[] a) {\n assert (a != null);\n List<Integer> ret = new ArrayList<>(a.length);\n for (int e : a)\n ret.add(e);\n return ret;\n }", "java.util.List<java.lang.Integer> getBlockNumbersList();", "public static List<Integer> getIntegerList(int size) {\n return integerLists.computeIfAbsent(size, createSize -> {\n List<Integer> newList = new ArrayList<>(createSize);\n for (int i = 0; i < createSize; i++)\n newList.add(i);\n return newList;\n });\n }", "java.util.List<java.lang.Integer> getListSnIdList();", "public static int[] convertIntegersToArray(List<Integer> integers){\n \n \tint[] newArray = new int[integers.size()]; \n \tIterator<Integer> iterator = integers.iterator(); // Declare and create iterator on integers arraylist.\n \n for (int i = 0; i < newArray.length; i++){\n newArray[i] = iterator.next().intValue(); // add elements to newArray \n }\n \n return newArray;\n }", "int[] getInts();", "public List<BigInteger> convertIntegerList(List<Integer> alist){\n\t\tList<BigInteger> blist = new ArrayList<BigInteger>(alist.size());\n\t\tfor(int i=0; i < alist.size(); i++){\n\t\t\tblist.add( BigInteger.valueOf( alist.get(i).intValue() ) );\n\t\t}\n\t\t\n\t\treturn blist;\n\t}", "public List<Integer> generateList(int size){\n List<Integer> data = new ArrayList<>();\n for (int i = 0; i < size; i++){\n data.add(i);\n }\n return data;\n }", "private ArrayIntList buildList(int size) {\n\t\tArrayIntList list = new ArrayIntList();\n\t\tfor (int i=1;i<=size;i++)\n\t\t\tlist.add(i);\n\t\treturn list; \n\t}", "public List<Integer> getListHundred() {\n List<Integer> myList = new ArrayList<>();\n for (int i = 1; i <= 100; i++) {\n myList.add(i);\n }\n\n return myList;\n }", "private List<Integer> createData() {\r\n\t\tList<Integer> data = new ArrayList<Integer>();\r\n\t\tfor (int i = 0; i < N; i++) {\r\n\t\t\tdata.add(i);\r\n\t\t}\r\n\t\treturn data;\r\n\t}", "public static ImmutableIntList identity(int count) {\n final int[] integers = new int[count];\n for (int i = 0; i < integers.length; i++) {\n integers[i] = i;\n }\n return new ImmutableIntList(integers);\n }", "public abstract ArrayList<Integer> getIdList();", "public static List<Integer> posList() {\n\t\tList<Integer> list = new ArrayList<Integer>();\n\t\tlist.add(1);\n\t\tlist.add(22);\n\t\tlist.add(93);\n\t\tlist.add(1002);\n\t\tlist.add(0);\n\t\treturn list;\n\t}", "public static List<Integer> asList(int[] array) {\n\t\treturn new IntList(array);\n\t}", "public static void convertIntArrayToList() {\n\t\tint[] inputArray = { 0, 3, 7, 1, 7, 9, 11, 6, 3, 5, 2, 13, 14 };\n\n\t\t// ********** 1 *************\n\t\tList<Integer> list = Arrays.stream(inputArray) // IntStream\n\t\t\t\t.boxed() // Stream<Integer>\n\t\t\t\t.collect(Collectors.toList());\n\t\tSystem.out.println(list);\n\n\t\t// ********** 2 *************\n\t\tList<Integer> list_2 = IntStream.of(inputArray) // returns IntStream\n\t\t\t\t.boxed().collect(Collectors.toList());\n\t\tSystem.out.println(list_2);\n\t}", "static List<Integer> arrayToList(int[] array) {\r\n List<Integer> list = new ArrayList<Integer>();\r\n for(int i : array)\r\n list.add(i);\r\n return list;\r\n }", "public static List<Integer> generateNumbers(int min, int max) {\n\t\treturn IntStream.rangeClosed(min, max).boxed().collect(Collectors.toList());\n\t}", "public static int[] convertIntegers(ArrayList<Integer> Y_list) {\r\n\t int[] Y = new int[Y_list.size()];\r\n\t Iterator<Integer> iterator = Y_list.iterator();\r\n\t for (int i = 0; i < Y.length; i++)\r\n\t {\r\n\t Y[i] = iterator.next().intValue();\r\n\t }\r\n\t return Y;\r\n\t}", "public static List<Integer> makeList(int size) {\r\n List<Integer> result = new ArrayList<>();\r\n /** \r\n * taking input from the user \r\n * by using Random class. \r\n * \r\n */\r\n for (int i = 0; i < size; i++) {\r\n int n = 10 + rng.nextInt(90);\r\n result.add(n);\r\n } // for\r\n\r\n return result;\r\n /**\r\n * @return result \r\n */\r\n }", "public List<Integer> getIntegerList(final String key) {\n return getIntegerList(key, new ArrayList<>());\n }", "@NonNull\n static IntConsList<Integer> intList(@NonNull int... elements) {\n IntConsList<Integer> cons = nil();\n for (int i = elements.length - 1; i >= 0; i--) {\n cons = new IntConsListImpl(elements[i], cons);\n }\n return cons;\n }", "java.util.List<java.lang.Integer> getItemsList();", "private void intListToArrayList(int[] list, ArrayList<Integer> arrayList){\n for(int integer: list){\n arrayList.add(integer);\n }\n }", "private ArrayList<Integer> fillDomain() {\n ArrayList<Integer> elements = new ArrayList<>();\n\n for (int i = 1; i <= 10; i++) {\n elements.add(i);\n }\n\n return elements;\n }", "private List<Integer> allIntegerInRange(int start, int end) {\n\t\tList<Integer> range = new ArrayList<Integer>();\n\n\t\tfor (int i = start; i <= end; i++) {\n\t\t\trange.add(i);\n\t\t}\n\n\t\treturn range;\n\t}", "public int[] numbers();", "public List<Integer> convertBigIntegerList(List<BigInteger> alist){\n\t\tList<Integer> blist = new ArrayList<Integer>(alist.size());\n\t\tfor(int i=0; i < alist.size(); i++){\n\t\t\tif(alist.get(i)!=null)\n\t\t\t{\n\t\t\tblist.add( new Integer( alist.get(i).intValue() ) );\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn blist;\n\t}", "private static List<Integer> initLista(int tamanho) {\r\n\t\tList<Integer> lista = new ArrayList<Integer>();\r\n\t\tRandom rand = new Random();\r\n\r\n\t\tfor (int i = 0; i < tamanho; i++) {\r\n\t\t\tlista.add(rand.nextInt(tamanho - (tamanho / 10) + 1)\r\n\t\t\t\t\t+ (tamanho / 10));\r\n\t\t}\r\n\t\treturn lista;\r\n\t}", "public static IntArrayList from(int... elements) {\n final IntArrayList list = new IntArrayList(elements.length);\n list.add(elements);\n return list;\n }", "java.util.List<java.lang.Integer> getOtherIdsList();", "public int[] toIntArray()\r\n {\r\n int[] a = new int[count];\r\n \r\n VectorItem<O> vi = first;\r\n \r\n for (int i=0;i<=count-1;i++)\r\n {\r\n a[i] = (Integer) vi.getObject();\r\n vi = vi.getNext();\r\n }\r\n\r\n return a; \r\n }", "List<Integer> fromScannerInput() throws IOException {\n\t\tfinal List<Integer> array = new ArrayList<>();\n\t\twhile (scanner.hasNext()) {\n\t\t\tarray.add(\n\t\t\t\t\tInteger.parseInt(\n\t\t\t\t\t\t\tscanner.next()));\n\t\t}\n\t\treturn array;\n\t}", "List<C45111a> mo107674a(Integer num);", "OrderedIntList(int size)\n\t{\n\t\tdata = new int[size];\n\t\tcount = 0;\n\t}", "public static void main(String[] args) {\n List<Integer> id = new ArrayList<>();\r\n for(int i=0 ; i<=10 ;i++){\r\n \t id.add(i);\r\n }\r\n System.out.println(id);\r\n\t}", "private int[] arrayListToIntList(ArrayList<Integer> arrayList){\n int[] list=new int[arrayList.size()];\n for(Integer integer:arrayList){\n list[arrayList.indexOf(integer)]=integer;\n }\n return list;\n }", "public List<Integer> getAsIntegerList(String itemName, List<Integer> defaultValue);", "java.util.List<java.lang.Integer> getRareIdList();", "java.util.List<java.lang.Integer> getRareIdList();", "java.util.List<java.lang.Integer> getBlockNumsList();", "java.util.List<java.lang.Integer> getBlockNumsList();", "public static ImmutableIntList of() {\n return EMPTY;\n }", "protected static ArrayList<String> GenNumber() {\n\n ArrayList<String> initialList = new ArrayList<>();\n\n initialList.add(\"1\"); //Add element\n initialList.add(\"2\");\n initialList.add(\"3\");\n initialList.add(\"4\");\n initialList.add(\"5\");\n initialList.add(\"6\");\n initialList.add(\"7\");\n initialList.add(\"8\");\n initialList.add(\"9\");\n\n Collections.shuffle(initialList); //Random the position\n\n return initialList;\n }", "public abstract ArrayList<Integer> getSudokuNumbersList();", "java.util.List<java.lang.Long> getIdsList();", "public List<Integer> getList() {\n return list;\n }", "public IntList(int size){\n\t\tprime = new ArrayList<Integer>(size);\n\t}", "java.util.List<java.lang.Integer> getItemList();", "public static ArrayList<Integer> randomIntegerList(int size, int range)\n {\n ArrayList<Integer> list = new ArrayList<Integer>();\n //int size = list.size();\n \n /*\n * The add method adds the specified object to the end of the list\n * \n * Autoboxing:\n * Primitve values are automatically converted to the \n * wrapper class. However, the type promotion\n * does not occur.\n */\n for (int i = 0; i<size; i++)\n {\n int value = (int)(Math.random() * range) +1;\n list.add(value);\n }\n \n return list;\n }", "public static ArrayList<Integer> extractAllIntegers2(String input) {\n String[] tokens = input.replaceAll(\"[^-+\\\\d]+\", \" \").split(\" \");\n int len = tokens.length;\n ArrayList<Integer> list = new ArrayList<>(len);\n\n String regex = \"[-+]?\\\\d+\";\n Pattern pattern = Pattern.compile(regex);\n for (int i = 0; i < len; i++) {\n Matcher matcher = pattern.matcher(tokens[i]);\n if (matcher.find()) {\n list.add(Integer.parseInt(matcher.group()));\n }\n }\n return list;\n }", "java.util.List<Integer> getSrcIdList();", "public List<Integer> getRowAsList(int i){\n\t\tList<Integer> row = new ArrayList<Integer>(size*size);\n\t\tfor (int j = 0; j < size*size; j++){\n\t\t\trow.add(numbers[i][j]);\n\t\t}\n\t\treturn row;\n\t}", "public IntegerList(int size)\n {\n list = new int[size];\n }", "@BeforeEach\n public void createList() {\n myListOfInts = new ArrayListDIY<>(LIST_SIZE);\n listOfInts = new ArrayList<>(LIST_SIZE);\n\n getRandomIntStream(0,10).limit(LIST_SIZE)\n .forEach(elem -> {\n listOfInts.add(elem);\n myListOfInts.add(elem);\n });\n }", "public IntegerList(int size)\n {\n list = new int[size];\n }", "public void genericIntegerArray() {\n\t\tArrayList<Integer> a1 = new ArrayList<Integer>();\n\t\ta1.add(20);\n\t\ta1.add(11);\n\t\tSystem.out.println(\"Integer generic ArrayList a1: \" + a1);\n\n\t}", "public ArrayList<Integer> repeatedNumber(final List<Integer> a) {\n long sum = 0, ssum = 0;\n for(int i = 0 ; i < a.size(); i++){\n long curi = i+1; // importnt to prevent overflow.\n long curn = a.get(i); // importnt to prevent overflow.\n sum += curn - curi;\n ssum +=curn*curn - curi*curi ;\n }\n ssum /= sum; // A + B \n long first = (sum + ssum)/2;\n long second = (ssum - first); \n ArrayList<Integer> result = new ArrayList<>();\n result.add((int)first);\n result.add((int)second);\n return result;\n }", "public static int[] intiArray(int num){\n\t\tint[] numArray = new int[num];\n\t\tfor(int i = 0; i < num; i++){\n\t\t\tnumArray[i] = i+1;\n\t\t}\n\t\treturn numArray;\n\t}", "public static ArrayList<Integer> ArraytoArrayList(int [] arr){\n ArrayList<Integer> list = new ArrayList<>();\n return list;\n }", "OrderedIntList ()\r\n\t{\r\n\t\tarray = new int[10];\r\n\t}", "java.util.List<java.lang.Integer> getRequestedValuesList();", "public static void convert (int arr[])\r\n\t{\n\t\tArrayList l = new ArrayList ();\r\n\t\t//loop and add element \r\n\t\tfor (int i = 0 ;i<arr.length ; i++) \r\n\t\t{\r\n\t\t\t// index element\r\n\t\t\t// | |\r\n\t\t\tl.add( i , arr[i] );\r\n\t\t\t\r\n\t\t}\r\n\t\t\r\n\t\t// ouput l element \r\n\t\tSystem.out.println(l);\r\n\t}", "public static ArrayList<Integer> createList(int listSize) {\n ArrayList<Integer> list = new ArrayList<>();\n for (int i = 0; i < listSize; i++) {\n list.add(i);\n }\n return list;\n }", "private ImmutableIntList(int... ints) {\n this.ints = ints;\n }", "List<C1111j> mo5869a(int i);", "List<C45111a> mo107675a(Integer num, Integer num2);", "private static List<Integer> nextInt() {\n\t\tRandom rnd = new Random();\n\t\tList<Integer> l = new ArrayList<Integer>();\n\t\tfor (;;) {\n\t\t\tfinal int r = rnd.nextInt(5);\n\t\t\tif (!l.contains(r)) {\n\t\t\t\tl.add(r);\n\t\t\t}\n\t\t\tif (l.size() == 5)\n\t\t\t\treturn l;\n\t\t}\n\t}", "public static Automaton.List rangeOf(Automaton automaton,\n\t\t\tAutomaton.Int _start, Automaton.Int _end) {\n\t\t// FIXME: there is a bug here for big integer values.\n\t\tint start = _start.intValue();\n\t\tint end = _end.intValue();\n\t\tint[] children = new int[end - start];\n\t\tfor (int i = 0; i < children.length; ++i, ++start) {\n\t\t\tchildren[i] = automaton.add(new Automaton.Int(start));\n\t\t}\n\t\treturn new Automaton.List(children);\n\t}", "public static ListUtilities arrayToList(int[] array){\n\t\tListUtilities startNode = new ListUtilities();\n\t\tif (array.length != 0){\n\t\t\tstartNode.setInt(array[0]);\n\t\t\tfor (int i = 1; i < array.length; i++){\n\t\t\t\tstartNode.addNum(array[i]);\n\t\t\t}\n\t\t}\n\t\treturn startNode;\n\t}", "private static int[] toIntArray(List<Integer> shorts) {\n int[] array = new int[shorts.size()];\n for (int i = 0; i < shorts.size(); i++)\n array[i] = shorts.get(i).shortValue();\n return array;\n }", "public List<Integer> convert (List<int[]> list) {\r\n\r\n List<Integer> result = new ArrayList<>();\r\n for(int[] array : list) {\r\n for (int i = 0; i < array.length; i++) {\r\n result.add(array[i]);\r\n }\r\n }\r\n return result;\r\n }", "public List<Integer> readLineAsIntegers() throws IOException {\n List<Integer> ret = new ArrayList<>();\n int idx = 0;\n byte c = read();\n while (c != -1) {\n if (c == '\\n' || c == '\\r')\n break;\n\n // next integer\n int i = 0;\n while (c <= ' ') {\n c = read();\n }\n boolean negative = (c == '-');\n if (negative) {\n c = read();\n }\n\n do {\n i = i * 10 + (c - '0');\n c = read();\n } while (c >= '0' && c <= '9');\n// ret[idx++] = (negative) ? -i : i;\n ret.add((negative) ? -i : i);\n }\n return ret;\n }", "public IntList() { // doesn't HAVE to be declared public, but doesn't hurt\n theList = new int[STARTING_SIZE];\n size = 0;\n }", "private static List<Integer> StringToIntForSelectBoxes(){\n\t\tString[] noOfEachPaxType = {pro.getProperty(\"noOfAdults\"), pro.getProperty(\"noOfChildren\"), pro.getProperty(\"noOfInfants\")};\n\t\tList<String> noOfEachPaxTypeList = Arrays.asList(noOfEachPaxType);\n\t\tList<Integer> noOfEachPaxTypeListAsInt = new ArrayList<>();\n\n\t\tfor(int i = 0; i < noOfEachPaxTypeList.size(); i++){\n\t\t\tInteger paxCount = Integer.parseInt(noOfEachPaxTypeList.get(i));\n\t\t\tnoOfEachPaxTypeListAsInt.add(paxCount);\n\t\t}\n\t\treturn noOfEachPaxTypeListAsInt;\n\t}", "public static void createListFromLong(ArrayList<Integer> list, long l) {\n\n\t\tint individualNum = 0;\n\t\n\t\twhile(l > 0) {\n\t\t\tindividualNum = (int) (l % 10);\n\t\t\tl /= 10;\n\t\t\t\n\t\t\tlist.add(individualNum);\n\t\t}\n\t\t\n\t\tCollections.reverse(list);\n\t}", "public static int [] getIntegers(int number) {\n\t\tScanner scanner =new Scanner(System.in);\n\t\tSystem.out.println(\"Enter \" +number+ \"integer value\");\n\t\tint[]values= new int[number];\n\t\tfor(int i=0; i<number; i++) {\n\tvalues[i]=scanner.nextInt();\t\n\t}\n\t\treturn values;\n\t}", "public Iterable<Integer> getIntegers(String key);", "public ArrayListInt(int cantidadDeNumerosDelArray)\n {\n numerosEnteros = new int[cantidadDeNumerosDelArray];\n tamañoDelArray = cantidadDeNumerosDelArray;\n }", "public abstract int[] toIntArray();", "java.util.List<java.lang.Integer> getStateValuesList();", "public ImmutableIntList appendAll(Iterable<Integer> list) {\n if (list instanceof Collection && ((Collection) list).isEmpty()) {\n return this;\n }\n return ImmutableIntList.copyOf(Iterables.concat(this, list));\n }", "private List<Integer> loadTestNumbers(ArrayList<Integer> arrayList) {\n for (int i = 1; i <= timetablepro.TimetablePro.MAX_TIMETABLE; i++) {\n arrayList.add(i);\n }\n return arrayList;\n }", "int[] toArray();", "public static ArrayList<Integer> extractAllIntegers1(String input) {\n ArrayList<Integer> list = new ArrayList<>();\n\n String regex = \"[-+]?\\\\d+\";\n Pattern pattern = Pattern.compile(regex);\n Matcher matcher = pattern.matcher(input);\n while (matcher.find()) {\n list.add(Integer.parseInt(matcher.group()));\n }\n return list;\n }", "java.util.List<java.lang.Integer> getStatusList();", "public static int[] getPositionalIntegers(List<Integer> IntegersList)\n\t{\n\t int[] returnintarray = new int[IntegersList.size()];\n\t for (int i=0; i < returnintarray.length; i++)\n\t {\n\t \treturnintarray[i] = i;\n\t }\n\t return returnintarray;\n\t}", "public static List<Integer> streamRange(int from, int limit)\r\n\t{\r\n\r\n\t\treturn IntStream.range(from, from + limit)\r\n\t\t\t\t.boxed()\r\n\t\t\t\t.collect(toList());\r\n\t}", "public ArrayList<Integer> repeatedNumber(final List<Integer> A) {\n ArrayList<Integer> res = new ArrayList<>();\n long n = A.size();\n int a = 0, b = 0;\n long sum = 0;\n long sum_of_n = n*(n+1)/2;\n HashSet<Integer> set = new HashSet<Integer>();\n for (int i = 0; i < n; i++){\n if(set.contains(A.get(i))){\n a = A.get(i);\n }\n else{\n set.add(A.get(i));\n }\n sum += A.get(i);\n }\n b = (int)(sum_of_n - sum) + a;\n res.add(a);\n res.add(b);\n return res;\n }", "public Integer[] createArray() {\n Integer[] value = new Integer[defaultLaenge];\n\n for (int i = 0; i < value.length; i++) {\n value[i] = (int)(value.length*Math.random());\n }\n\n return value;\n }", "public static int[] toArray(Collection<Integer> a) {\n assert (a != null);\n int[] ret = new int[a.size()];\n int i = 0;\n for (int e : a)\n ret[i++] = e;\n return ret;\n }", "public int[] getListOfId() {\r\n\t\tString sqlCommand = \"SELECT Barcode FROM ProductTable\";\r\n\t\tint[] idList = null;\r\n\t\tArrayList<Integer> tmpList = new ArrayList<Integer>();\r\n\t\tint counter = 0;\r\n\t\ttry (Connection conn = this.connect();\r\n\t\t\t\tStatement stmt = conn.createStatement();\r\n\t\t\t\tResultSet rs = stmt.executeQuery(sqlCommand)) {\r\n\t\t\twhile (rs.next()) {\r\n\t\t\t\ttmpList.add(rs.getInt(\"Barcode\"));\r\n\t\t\t\tcounter++;\r\n\t\t\t}\r\n\t\t\tidList = new int[counter];\r\n\t\t\tfor (int i = 0; i < counter; i++) {\r\n\t\t\t\tidList[i] = tmpList.get(i);\r\n\t\t\t}\r\n\t\t} catch (SQLException e) {\r\n\t\t\tSystem.out.println(\"getListOfId: \"+e.getMessage());\r\n\t\t\treturn new int[0]; \r\n\t\t}\r\n\t\treturn idList;\r\n\t}", "private ArrayList _getRandomList(int num, int min, int max) {\n ArrayList list = new ArrayList();\n ArrayList tmp = new ArrayList();\n for (int i = min; i <= max; i++) {\n tmp.add(new Integer(i));\n }\n \n for (int i = 0; i < num; i++) {\n \tif(tmp.size() > 1){\n\t int pos = _getRandomFromRange(0, tmp.size() - 1);\n\t list.add( (Integer) tmp.get(pos));\n\t tmp.remove(pos);\n \t}\n }\n\n return list;\n }", "public ArrayList<Integer> makeIndividual();", "public static IntArrayList constant(int size, int value) {\n IntArrayList result = new IntArrayList(size);\n Arrays.fill(result.buffer, value);\n result.elementsCount = size;\n return result;\n }" ]
[ "0.7886953", "0.755134", "0.7213843", "0.702643", "0.6951622", "0.6938611", "0.6803486", "0.6743979", "0.6728122", "0.67257625", "0.67232585", "0.66522443", "0.66423684", "0.66106904", "0.6598808", "0.65789604", "0.6576418", "0.65179884", "0.65151316", "0.6477692", "0.6462708", "0.6460067", "0.6439795", "0.6425073", "0.64213014", "0.63945556", "0.63839453", "0.6380123", "0.637648", "0.6365916", "0.6330456", "0.6313536", "0.6309042", "0.6296385", "0.62761056", "0.62645894", "0.62550586", "0.6251592", "0.62461793", "0.61996615", "0.6193878", "0.6182984", "0.6175799", "0.61641264", "0.61622757", "0.61622757", "0.6146467", "0.6146467", "0.6144407", "0.6137385", "0.6132728", "0.6126557", "0.61157244", "0.6108022", "0.6097527", "0.6058868", "0.60382915", "0.60219115", "0.6017652", "0.59997314", "0.598768", "0.59832597", "0.5971086", "0.5970278", "0.5957169", "0.5949318", "0.59423506", "0.5940355", "0.59262115", "0.59231377", "0.5913772", "0.590215", "0.59019756", "0.59013", "0.5900374", "0.588988", "0.5889657", "0.5884768", "0.58693266", "0.58567864", "0.58361316", "0.5783231", "0.575024", "0.5744551", "0.57442224", "0.573889", "0.57353914", "0.57343435", "0.57304275", "0.572628", "0.5721027", "0.5712207", "0.57119733", "0.56780636", "0.5677071", "0.56770146", "0.5665983", "0.5656127", "0.56509924", "0.564921", "0.56390774" ]
0.0
-1
TODO Autogenerated method stub
@Override public void onSelectedDayChange(CalendarView view, int year, int month, int dayOfMonth) { calendarListAdapter.removeALL(); calendarListAdapter = null; calendarListAdapter = new CalendarListAdapter(); calendarListView.setAdapter(calendarListAdapter); calendarListAdapter.add("내역", "카테고리", random.nextInt(10000)+1, 0, "지출", year, month+1, dayOfMonth); calendarListAdapter.add("내역", "카테고리", random.nextInt(10000)+1, 0, "지출", year, month+1, dayOfMonth); calendarListAdapter.add("내역", "카테고리", random.nextInt(10000)+1, 0, "지출", year, month+1, dayOfMonth); calendarListAdapter.add("내역", "카테고리", random.nextInt(10000)+1, 0, "지출", year, month+1, dayOfMonth); calendarListAdapter.add("내역", "카테고리", random.nextInt(10000)+1, 0, "지출", year, month+1, dayOfMonth); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\r\n\tpublic void comer() \r\n\t{\n\t\t\r\n\t}", "@Override\n\tpublic void comer() {\n\t\t\n\t}", "@Override\n public void perish() {\n \n }", "@Override\r\n\t\t\tpublic void annadir() {\n\r\n\t\t\t}", "@Override\n\tpublic void anular() {\n\n\t}", "@Override\n\tprotected void getExras() {\n\n\t}", "@Override\r\n\tpublic void anularFact() {\n\t\t\r\n\t}", "@Override\n\tpublic void entrenar() {\n\t\t\n\t}", "@Override\n\tpublic void nadar() {\n\t\t\n\t}", "@Override\r\n\tpublic void tires() {\n\t\t\r\n\t}", "@Override\r\n\t\t\tpublic void ayuda() {\n\r\n\t\t\t}", "@Override\n\tprotected void interr() {\n\t}", "@Override\n\tpublic void emprestimo() {\n\n\t}", "@Override\r\n\tpublic void bicar() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void bicar() {\n\t\t\r\n\t}", "@Override\n\tpublic void grabar() {\n\t\t\n\t}", "@Override\n\tpublic void gravarBd() {\n\t\t\n\t}", "@Override\r\n\tpublic void rozmnozovat() {\n\t}", "@Override\r\n\tpublic void dormir() {\n\t\t\r\n\t}", "@Override\n protected void getExras() {\n }", "@Override\r\n\tpublic void publierEnchere() {\n\t\t\r\n\t}", "@Override\n\tpublic void nefesAl() {\n\n\t}", "@Override\n\tpublic void ligar() {\n\t\t\n\t}", "@Override\n public void func_104112_b() {\n \n }", "@Override\n\tprotected void initdata() {\n\n\t}", "@Override\n\tpublic void nghe() {\n\n\t}", "@Override\n public void function()\n {\n }", "@Override\n public void function()\n {\n }", "public final void mo51373a() {\n }", "@Override\r\n\tpublic void stehReagieren() {\r\n\t\t//\r\n\t}", "@Override\n public void inizializza() {\n\n super.inizializza();\n }", "@Override\n\tprotected void initData() {\n\t\t\n\t}", "@Override\r\n\t\tpublic void init() {\n\t\t\t\r\n\t\t}", "@Override\n\tpublic void sacrifier() {\n\t\t\n\t}", "@Override\r\n\tprotected void InitData() {\n\t\t\r\n\t}", "public void designBasement() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initialize() {\r\n\t\t\r\n\t\t\r\n\t}", "public void gored() {\n\t\t\n\t}", "@Override\r\n\tprotected void initData() {\n\r\n\t}", "@Override\n\tpublic void einkaufen() {\n\t}", "@Override\n protected void initialize() {\n\n \n }", "public void mo38117a() {\n }", "@Override\n\tprotected void getData() {\n\t\t\n\t}", "Constructor() {\r\n\t\t \r\n\t }", "@Override\r\n\tpublic void dibujar() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void dibujar() {\n\t\t\r\n\t}", "@Override\n\tpublic void one() {\n\t\t\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "private stendhal() {\n\t}", "@Override\n\tprotected void update() {\n\t\t\n\t}", "@Override\n\t\t\tpublic void ic() {\n\t\t\t\t\n\t\t\t}", "@Override\n\tprotected void initData() {\n\n\t}", "@Override\n\tprotected void initData() {\n\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n public void init() {\n\n }", "@Override\n\tprotected void initialize() {\n\t\t\n\t}", "@Override\n\tprotected void initialize() {\n\t\t\n\t}", "@Override\r\n\tpublic void init() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void init() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void init() {\n\t\t\r\n\t}", "@Override\n\tpublic void debite() {\n\t\t\n\t}", "@Override\r\n\tpublic void init() {\n\r\n\t}", "@Override\r\n\tpublic void init() {\n\r\n\t}", "@Override\r\n\tpublic void init() {\n\r\n\t}", "public contrustor(){\r\n\t}", "@Override\n\tprotected void initialize() {\n\n\t}", "@Override\r\n\tpublic void dispase() {\n\r\n\t}", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "@Override\n\tpublic void dtd() {\n\t\t\n\t}", "@Override\n\tprotected void logic() {\n\n\t}", "@Override\n\tprotected void lazyLoad() {\n\t\t\n\t}", "public void mo4359a() {\n }", "@Override\r\n\tprotected void initialize() {\n\r\n\t}", "@Override\n public void memoria() {\n \n }", "@Override\n\t\tpublic void method() {\n\t\t\t\n\t\t}", "private RepositorioAtendimentoPublicoHBM() {\r\t}", "@Override\n protected void initialize() \n {\n \n }", "@Override\r\n\tpublic void getProposition() {\n\r\n\t}", "@Override\n\tpublic void particular1() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\n\t}", "@Override\n\tpublic void init() {\n\n\t}", "@Override\n\tpublic void init() {\n\n\t}", "@Override\n protected void prot() {\n }", "@Override\r\n\tpublic void init()\r\n\t{\n\t}", "@Override\n\tprotected void initValue()\n\t{\n\n\t}", "public void mo55254a() {\n }" ]
[ "0.6671074", "0.6567672", "0.6523024", "0.6481211", "0.6477082", "0.64591026", "0.64127725", "0.63762105", "0.6276059", "0.6254286", "0.623686", "0.6223679", "0.6201336", "0.61950207", "0.61950207", "0.61922914", "0.6186996", "0.6173591", "0.61327106", "0.61285484", "0.6080161", "0.6077022", "0.6041561", "0.6024072", "0.6020252", "0.59984857", "0.59672105", "0.59672105", "0.5965777", "0.59485507", "0.5940904", "0.59239364", "0.5910017", "0.5902906", "0.58946234", "0.5886006", "0.58839184", "0.58691067", "0.5857751", "0.58503544", "0.5847024", "0.58239377", "0.5810564", "0.5810089", "0.5806823", "0.5806823", "0.5800025", "0.5792378", "0.5792378", "0.5792378", "0.5792378", "0.5792378", "0.5792378", "0.5790187", "0.5789414", "0.5787092", "0.57844025", "0.57844025", "0.5774479", "0.5774479", "0.5774479", "0.5774479", "0.5774479", "0.5761362", "0.57596046", "0.57596046", "0.575025", "0.575025", "0.575025", "0.5747959", "0.57337177", "0.57337177", "0.57337177", "0.5721452", "0.5715831", "0.57142824", "0.57140535", "0.57140535", "0.57140535", "0.57140535", "0.57140535", "0.57140535", "0.57140535", "0.5711723", "0.57041645", "0.56991017", "0.5696783", "0.56881124", "0.56774884", "0.56734604", "0.56728", "0.56696945", "0.5661323", "0.5657007", "0.5655942", "0.5655942", "0.5655942", "0.56549734", "0.5654792", "0.5652974", "0.5650185" ]
0.0
-1
Created by hugoa on 4/17/2017.
public interface RESTfulAPI { @GET("posts") Call<List<Post>> getAllPosts(); @GET("posts") Call<List<Post>> getAllPostsByUserID(@Query("userID") int userID); @GET("post/{postID}") Call<Post> getPostByID(); // @POST("post") }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\n public void perish() {\n \n }", "private stendhal() {\n\t}", "public final void mo51373a() {\n }", "@Override\n\tpublic void grabar() {\n\t\t\n\t}", "@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}", "@Override\n public void func_104112_b() {\n \n }", "@Override\r\n\tpublic void tires() {\n\t\t\r\n\t}", "@Override\n\tpublic void entrenar() {\n\t\t\n\t}", "@Override\n\tprotected void getExras() {\n\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\tpublic void nadar() {\n\t\t\n\t}", "@Override\n\tpublic void anular() {\n\n\t}", "public void mo38117a() {\n }", "private void poetries() {\n\n\t}", "@Override\n\tprotected void interr() {\n\t}", "@Override\r\n\tpublic void rozmnozovat() {\n\t}", "@Override\n\tpublic void sacrifier() {\n\t\t\n\t}", "@Override\n\tpublic void gravarBd() {\n\t\t\n\t}", "@Override\n public void init() {\n\n }", "public void mo4359a() {\n }", "private static void cajas() {\n\t\t\n\t}", "private void m50366E() {\n }", "@Override\n protected void getExras() {\n }", "@Override\n public int describeContents() { return 0; }", "public void gored() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n public void init() {\n }", "@Override\n\tpublic void jugar() {\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 void init() {\n }", "private Rekenhulp()\n\t{\n\t}", "protected boolean func_70814_o() { return true; }", "@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 one() {\n\t\t\n\t}", "@Override\n protected void initialize() {\n\n \n }", "@Override\n public void memoria() {\n \n }", "@Override\n public void init() {}", "@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 anularFact() {\n\t\t\r\n\t}", "@Override\r\n\t\t\tpublic void ayuda() {\n\r\n\t\t\t}", "@Override\n\tpublic void einkaufen() {\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 protected void initialize() \n {\n \n }", "@Override\r\n\tpublic void init() {}", "@Override\n\tpublic void nghe() {\n\n\t}", "@Override\n\tpublic void ligar() {\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 init() {\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 public void init() {\n\n }", "@Override\n public void init() {\n\n }", "private void init() {\n\n\t}", "@Override\n\tprotected void initialize() {\n\n\t}", "@Override\r\n\tpublic void init() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void init() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void init() {\n\t\t\r\n\t}", "@Override\n public int retroceder() {\n return 0;\n }", "Petunia() {\r\n\t\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 public void inizializza() {\n\n super.inizializza();\n }", "@Override\n\tpublic int mettreAJour() {\n\t\treturn 0;\n\t}", "@Override\n\tpublic void init() {\n\t}", "public void mo6081a() {\n }", "@Override\r\n\tpublic void init()\r\n\t{\n\t}", "@Override\r\n\tprotected void doF4() {\n\t\t\r\n\t}", "@Override\n\tpublic void debite() {\n\t\t\n\t}", "public void mo12930a() {\n }", "@Override\n\tpublic void init()\n\t{\n\n\t}", "@Override\n public void initialize() { \n }", "@Override\n\tpublic void nefesAl() {\n\n\t}", "@Override\r\n\tprotected void initialize() {\r\n\t\t\r\n\t\t\r\n\t}", "private void kk12() {\n\n\t}", "public void m23075a() {\n }", "public Pitonyak_09_02() {\r\n }", "@Override\n\tpublic void emprestimo() {\n\n\t}", "private MetallicityUtils() {\n\t\t\n\t}" ]
[ "0.6168699", "0.60016143", "0.58729106", "0.5868131", "0.5824119", "0.57895094", "0.57895094", "0.57647973", "0.5736492", "0.5705222", "0.5694301", "0.5670465", "0.56671727", "0.5662889", "0.56492877", "0.5644921", "0.5642457", "0.5606048", "0.56055903", "0.5601539", "0.55788", "0.5576151", "0.5565304", "0.5544261", "0.554197", "0.5536867", "0.5532007", "0.55251884", "0.5522415", "0.5522415", "0.5522415", "0.5522415", "0.5522415", "0.55206656", "0.5513245", "0.5512403", "0.5497803", "0.5495591", "0.5484158", "0.5483113", "0.54808336", "0.54808336", "0.54808336", "0.54808336", "0.54808336", "0.54808336", "0.54728085", "0.5468107", "0.54675305", "0.545198", "0.54434943", "0.54434943", "0.54416245", "0.54385525", "0.54347456", "0.54276735", "0.54276735", "0.5427283", "0.542551", "0.54252064", "0.5423389", "0.5405392", "0.5405392", "0.5405392", "0.5402465", "0.5394626", "0.5394626", "0.5394626", "0.5394626", "0.5394626", "0.5394626", "0.5394626", "0.53892964", "0.53892964", "0.5382268", "0.5372537", "0.53684145", "0.53684145", "0.53684145", "0.53649783", "0.53615844", "0.5354509", "0.5354509", "0.5354509", "0.5343499", "0.5341372", "0.53377795", "0.5326842", "0.5319306", "0.5316042", "0.531071", "0.53071064", "0.5307083", "0.53057677", "0.52995795", "0.52937096", "0.5292318", "0.52920073", "0.5291338", "0.52848774", "0.5284265" ]
0.0
-1
/ if !(int|long|double t JDK8 jdk) Applies this function to the given argument.
R apply(char value);
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private void functionalInterfacesForDoubleIntLong() {\n double d = 1.0;\n DoubleToIntFunction f1 = x -> 1;\n f1.applyAsInt(d);\n\n }", "public int a(String paramString, int paramInt1, int paramInt2, int paramInt3)\r\n/* 239: */ {\r\n/* 240:247 */ return a(paramString, (float)paramInt1, (float)paramInt2, paramInt3, false);\r\n/* 241: */ }", "int mo16689b(T t);", "default T handleNumber(double val) {\n throw new UnsupportedOperationException();\n }", "@Override\n public double callJavaMath(String methodName, Object[] args) {\n\treturn 0;\n }", "public class_1036 method_2126(class_689 param1, double param2, double param4, double param6, float param8, boolean param9, boolean param10) {\r\n // $FF: Couldn't be decompiled\r\n }", "double apply(final double a);", "int mo16684a(T t);", "public abstract void mo9807a(long j);", "@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\tpublic void javaMethodBaseWithTwoParams(long longParam, double doubleParam) {\n\t\t\n\t}", "@Override\n\tpublic double applyFunction(double in) {\n\t\treturn 0;\n\t}", "void mo40877a(T t);", "public void method_2259(String param1, double param2, double param4, double param6, int param8, double param9, double param11, double param13, double param15) {\r\n // $FF: Couldn't be decompiled\r\n }", "void mo107677b(Integer num);", "private float a(int paramInt, char paramChar, boolean paramBoolean)\r\n/* 150: */ {\r\n/* 151:162 */ if (paramChar == ' ') {\r\n/* 152:163 */ return 4.0F;\r\n/* 153: */ }\r\n/* 154:164 */ if ((\"\".indexOf(paramChar) != -1) && (!this.k)) {\r\n/* 155:165 */ return a(paramInt, paramBoolean);\r\n/* 156: */ }\r\n/* 157:167 */ return a(paramChar, paramBoolean);\r\n/* 158: */ }", "abstract double apply(double x, double y);", "Datatype internalize(Datatype arg) throws CCAException;", "public abstract void mo20156a(long j);", "void apply(FnIntFloatToFloat lambda);", "void mo83698a(T t);", "public interface CalcPrimitive<T extends Number> {\n\t/**\n\t * Basic arithmetic operation which adds two numbers\n\t * \n\t * @param first\n\t * the addition operand\n\t * @param second\n\t * the addition operand\n\t * @return first + second\n\t */\n\tpublic T sum(T first, T second);\n\n\t/**\n\t * Basic arithmetic operation which subtracts two numbers\n\t * \n\t * @param first\n\t * the subtraction operand\n\t * @param second\n\t * the subtraction operand\n\t * @return first - second\n\t */\n\tpublic T sub(T first, T second);\n\n\t/**\n\t * Basic arithmetic operation which multiplies two numbers\n\t * \n\t * @param first\n\t * the multiplication operand\n\t * @param second\n\t * the multiplication operand\n\t * @return first * second\n\t */\n\tpublic T mul(T first, T second);\n\n\t/**\n\t * Basic arithmetic operation which divides two numbers\n\t * \n\t * @param first\n\t * the division operand\n\t * @param second\n\t * the division operand\n\t * @return first / second\n\t */\n\tpublic T div(T first, T second);\n\n\t/**\n\t * Basic operation which calculates the cosine of the value\n\t * \n\t * @param value\n\t * the operand of the cosine function in radians\n\t * @return the cosine of the value\n\t */\n\tpublic T cos(T value);\n\n\t/**\n\t * Basic operation which calculates the (value)^e\n\t * \n\t * @param value\n\t * the operand of the calculation\n\t * @return (value)^e\n\t */\n\tpublic T exp(T value);\n\n\t/**\n\t * Basic operation which calculates the square root of a value.\n\t * \n\t * @param value\n\t * the operand of the square root function\n\t * @return the square root of value\n\t */\n\tpublic T sqrt(T value);\n\n\t/**\n\t * Convert a String to a T value\n\t * \n\t * @param str\n\t * a String for converting\n\t * @return the value of the specified String as a T\n\t * @throws NumberFormatException\n\t * when str is incorrect\n\t */\n\tpublic T getFromString(String str) throws NumberFormatException;\n\n\t/**\n\t * Check a String on a possibility of converting\n\t * \n\t * @param str\n\t * a String for check\n\t * @return true for correct str and false for incorrect\n\t */\n\tpublic boolean isCorrect(String str);\n\n\t/**\n\t * Convert a T value to a String\n\t * \n\t * @param value\n\t * a T object to converting\n\t * @return the value of the specified number as a String\n\t */\n\tpublic String getString(T value);\n}", "int applyAsInt(T value);", "void apply(T input);", "public native double __doubleMethod( long __swiftObject, double arg );", "void mo83696a(T t);", "@Override\n\t\t\tpublic Ast unaryOp(UnaryOp ast, Void dummy) {\n\t\t\t\tsuper.unaryOp(ast, dummy);\n\t\t\t\ttry {\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 U_BOOL_NOT:\n\t\t\t\t\t\tboolValue = !asBool(ast.arg());\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase U_MINUS:\n\t\t\t\t\t\tintValue = -asInt(ast.arg());\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase U_PLUS:\n\t\t\t\t\t\tintValue = asInt(ast.arg());\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 e) {\n\t\t\t\t\t// non-constant argument, no effect\n\t\t\t\t\treturn ast;\n\t\t\t\t}\n\t\t\t}", "long mo25071a(long j);", "default boolean isPrimitive() {\n return false;\n }", "public static void main(String[] args) {\n\t\t\n\t\tbyte b1 = 12;\n\t\tshort s1 = b1;\n\t\tint i1 = b1;\n\t\tfloat f1 = b1;\n\t\t\n\t\t/*\n\t\t byte < short < int < long < float < double\n\t\n\t\t Buyuk data type'larini kucuk data type'larina cevrime isini Java otomatik olarak yapmaz.\n\t\t Bu cevirmeyi biz asagidaki gibi kod yazarak yapariz. Bunun ismi \"Explicit Narrowing Casting\" dir\n\t \n\t\t */\n\t\t\n\t\tshort s2 = 1210; \n\t\tbyte b2 = (byte)s2;\n\t\t\n\t}", "void mo16691c(T t);", "@Override\n\tpublic Type generateIntermediateCode(Function fun) {\n\t\tif(number instanceof Double)\n\t\t\treturn Type.FLOAT;\n\t\telse if (number instanceof Integer)\n\t\t\treturn Type.INT;\n\t\treturn Type.NULL;\n\t\t\t\n\t}", "public abstract void mo9243b(long j);", "public abstract int zzu(T t);", "void mo83695a(T t);", "void mo11495a(T t);", "long mo107678c(Integer num);", "void mo3312a(T t);", "void mo84656a(float f);", "public abstract boolean mo43853a(long j);", "public abstract void mo4369a(long j);", "protected abstract boolean a(axz paramaxz, long paramLong, int paramInt1, int paramInt2, double paramDouble1, double paramDouble2, double paramDouble3, double paramDouble4, double paramDouble5, BitSet paramBitSet);", "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 }", "public native float __floatMethod( long __swiftObject, float arg );", "public int a(String paramString, float paramFloat1, float paramFloat2, int paramInt)\r\n/* 234: */ {\r\n/* 235:243 */ return a(paramString, paramFloat1, paramFloat2, paramInt, true);\r\n/* 236: */ }", "public void a(long arg16, double arg18, double arg20) {\n }", "@Override\n\tdouble f(double x) {\n\t\treturn x;\n\t}", "public static void main(String[] args) {\n Foo foo = new Java8Default();\n foo.sumDefault(2,4);\n\n }", "public T caseInteger(sensorDeploymentLanguage.Integer object) {\n\t\treturn null;\n\t}", "void mo24142a(long j);", "public abstract int a(long j2, int i2);", "public abstract Out apply(In value);", "public double utility();", "Long mo20729a();", "@Nullable\n /* renamed from: a */\n public abstract C4891ao mo18474a(Object obj, boolean z);", "public abstract long a(long j2, long j3);", "static int type_of_inx(String passed){\n\t\treturn 1;\n\t}", "@Override\n\tpublic long javaMethodBaseWithLongLongRet() {\n\t\treturn 0;\n\t}", "static int type_of_jz(String passed){\n\t\treturn 1;\n\t}", "void mo28886a(int i, double d) throws zzlm;", "void mo30275a(long j);", "protected abstract Feature<T,?> convertArgument(Class<?> parameterType, Feature<T,?> originalArgument);", "void mo30271a(C11961o<T> oVar) throws Exception;", "public static void main(String[] args) {\n\t\tHolder<? super Number> h2 = new Holder<Object>();\r\n\t\tInteger i = 10;\r\n\t\th2.setT(i);\r\n\t\th2.setT(1.0);\r\n\t}", "public abstract void mo9813b(long j);", "boolean method_107(boolean var1, class_81 var2);", "private native double SumaC(double operador_1, double operador_2);", "private static double f(double x) {\n\t\treturn x;\n\t}", "protected void a(int paramInt1, int paramInt2, boolean paramBoolean, yz paramyz) {}", "static int type_of_jnz(String passed){\n\t\treturn 1;\n\t}", "public abstract void mo4383c(long j);", "private static native void PeiLinNormalization_0(long I_nativeObj, long T_nativeObj);", "@Override\n public void apply$mcVJ$sp (long arg0)\n {\n\n }", "@Override\n\tpublic double javaMethodBaseWithDoubleRet() {\n\t\treturn 0;\n\t}", "private native int nativeAdd(int x, int y);", "void mo83706a(C32459e<T> eVar);", "void mo130799a(double d);", "public PrimObject primitive351(PrimContext context) {\n final Integer value = (Integer) this.javaValue;\n final PrimObject argument = context.argumentAt(0);\n final PrimClass argClass = argument.selfClass();\n if (argClass.equals(resolveObject(\"Integer\"))) {\n Integer argValue = (Integer) context.argumentJavaValueAt(0);\n return smalltalkBoolean(value.equals(argValue));\n }\n else {\n //Converet types using next smalltalk code:\n // <code> (aNumber adaptInteger: self) = aNumber adaptToInteger </code>\n PrimObject leftOperand = argument.perform0(\"adaptInteger\", this);\n PrimObject rightOperand = argument.perform0(\"adaptInteger\");\n return leftOperand.perform0(\"=\", rightOperand);\n }\n }", "@Override\n public String visit(PrimitiveType n, Object arg) {\n return null;\n }", "public T caseDatatype(Datatype object)\n {\n return null;\n }", "public abstract double fct(double x);", "@Override\n public boolean apply$mcZJ$sp (long arg0)\n {\n return false;\n }", "public T convert(Number source)\r\n/* 26: */ {\r\n/* 27:56 */ return NumberUtils.convertNumberToTargetClass(source, this.targetType);\r\n/* 28: */ }", "public abstract void mo9806a(int i, boolean z);", "public static void main(String[] args) {\n\t\tbyte a = 1;\n\t\t\n\t\t//16 -bit = 32 -bit\n\t\tshort b = 1;\n\t\t\n\t\t\n\t\tint c = 1;\n\t\t\n\t\t// byte d = c; // NOT SAFE = what if c become 1.000.000 ??? \n\t\t\n\t\t// short s = c; // NOT SAFE\n\t\t\n\t\t\n\t}", "public void c(@Nullable ij ☃) {\r\n/* 167 */ this.f = ☃;\r\n/* */ }\r\n/* */ \r\n/* */ public void a(boolean ☃) {\r\n/* 171 */ this.e = ☃;\r\n/* */ }", "protected abstract double operation(double val);", "@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}", "default T handleBoolean(boolean val) {\n throw new UnsupportedOperationException();\n }", "void mo12648a(C3676k kVar);", "void mo72112a(float f);", "void mo83703a(C32456b<T> bVar);", "@Override\n public long apply$mcJI$sp (int arg0)\n {\n return 0;\n }", "public abstract int zzp(T t);", "public abstract Integer mo36212o();", "public PrimObject primitive350(PrimContext context) {\n final Integer value = (Integer) this.javaValue;\n final PrimObject argument = context.argumentAt(0);\n final PrimClass argClass = argument.selfClass();\n if (argClass.equals(resolveObject(\"Integer\"))) {\n Integer argValue = (Integer) context.argumentJavaValueAt(0);\n return smalltalkBoolean(value < argValue);\n }\n else {\n //Converet types using next smalltalk code:\n // <code> (aNumber adaptInteger: self) < aNumber adaptToInteger </code>\n PrimObject leftOperand = argument.perform0(\"adaptInteger\", this);\n PrimObject rightOperand = argument.perform0(\"adaptInteger\");\n return leftOperand.perform0(\"<\", rightOperand);\n }\n }", "long mo117970a();", "public abstract C7035a mo24417b(long j);", "void mo33732Px();", "public void testNegativeScalar() {\n\n /*\n * fixme Boolean converters not implemented at this point value = LocaleConvertUtils.convert(\"foo\", Boolean.TYPE); ...\n *\n * value = LocaleConvertUtils.convert(\"foo\", Boolean.class); ...\n */\n\n try {\n LocaleConvertUtils.convert(\"foo\", Byte.TYPE);\n fail(\"Should have thrown conversion exception (1)\");\n } catch (final ConversionException e) {\n // Expected result\n }\n\n try {\n LocaleConvertUtils.convert(\"foo\", Byte.class);\n fail(\"Should have thrown conversion exception (2)\");\n } catch (final ConversionException e) {\n // Expected result\n }\n\n /*\n * fixme - not implemented try { value = LocaleConvertUtils.convert(\"org.apache.commons.beanutils2.Undefined\", Class.class);\n * fail(\"Should have thrown conversion exception\"); } catch (ConversionException e) { ; // Expected result }\n */\n\n try {\n LocaleConvertUtils.convert(\"foo\", Double.TYPE);\n fail(\"Should have thrown conversion exception (3)\");\n } catch (final ConversionException e) {\n // Expected result\n }\n\n try {\n LocaleConvertUtils.convert(\"foo\", Double.class);\n fail(\"Should have thrown conversion exception (4)\");\n } catch (final ConversionException e) {\n // Expected result\n }\n\n try {\n LocaleConvertUtils.convert(\"foo\", Float.TYPE);\n fail(\"Should have thrown conversion exception (5)\");\n } catch (final ConversionException e) {\n // Expected result\n }\n\n try {\n LocaleConvertUtils.convert(\"foo\", Float.class);\n fail(\"Should have thrown conversion exception (6)\");\n } catch (final ConversionException e) {\n // Expected result\n }\n\n try {\n LocaleConvertUtils.convert(\"foo\", Integer.TYPE);\n fail(\"Should have thrown conversion exception (7)\");\n } catch (final ConversionException e) {\n // Expected result\n }\n\n try {\n LocaleConvertUtils.convert(\"foo\", Integer.class);\n fail(\"Should have thrown conversion exception (8)\");\n } catch (final ConversionException e) {\n // Expected result\n }\n\n try {\n LocaleConvertUtils.convert(\"foo\", Byte.TYPE);\n fail(\"Should have thrown conversion exception (9)\");\n } catch (final ConversionException e) {\n // Expected result\n }\n\n try {\n LocaleConvertUtils.convert(\"foo\", Long.class);\n fail(\"Should have thrown conversion exception (10)\");\n } catch (final ConversionException e) {\n // Expected result\n }\n\n try {\n LocaleConvertUtils.convert(\"foo\", Short.TYPE);\n fail(\"Should have thrown conversion exception (11)\");\n } catch (final ConversionException e) {\n // Expected result\n }\n\n try {\n LocaleConvertUtils.convert(\"foo\", Short.class);\n fail(\"Should have thrown conversion exception (12)\");\n } catch (final ConversionException e) {\n // Expected result\n }\n\n }", "boolean mo16692d(T t);" ]
[ "0.5513545", "0.5504476", "0.5397278", "0.5395374", "0.53927165", "0.5383686", "0.53311723", "0.5258227", "0.52556425", "0.52334976", "0.5213551", "0.5180291", "0.5162583", "0.5110002", "0.5101816", "0.50870216", "0.5061276", "0.5058611", "0.50525635", "0.50167763", "0.500283", "0.49886715", "0.49773347", "0.49645483", "0.49638644", "0.4963305", "0.49628323", "0.49591646", "0.4944496", "0.49325705", "0.4911756", "0.49114013", "0.48682043", "0.4867882", "0.48566005", "0.48542374", "0.48426938", "0.48362702", "0.4829325", "0.4807821", "0.47940525", "0.4790442", "0.47783026", "0.47751266", "0.4757189", "0.4755366", "0.4752367", "0.4746848", "0.4742061", "0.47401428", "0.47370988", "0.47346467", "0.47231442", "0.4721937", "0.4718815", "0.4714513", "0.47058725", "0.4695074", "0.4691995", "0.46874902", "0.4684016", "0.4676893", "0.46698478", "0.46690017", "0.46687937", "0.46661824", "0.46597844", "0.46569973", "0.46559167", "0.46530572", "0.46470243", "0.4645932", "0.46367392", "0.46290132", "0.46247333", "0.4620695", "0.46178636", "0.46175057", "0.4612316", "0.46084225", "0.46065712", "0.45959812", "0.45919585", "0.45908615", "0.45889133", "0.45878208", "0.45849586", "0.45845416", "0.45757112", "0.45736507", "0.4570684", "0.4569862", "0.45674133", "0.45566657", "0.45564532", "0.45555097", "0.45499948", "0.4548525", "0.4545179", "0.45451567", "0.45449167" ]
0.0
-1
Determines the version of this plugin.
public static String getVersion() { String result = "unkown version"; InputStream properties = DashboardMojo.class.getResourceAsStream( "/META-INF/maven/" + GROUP_ID + "/" + ARTIFACT_ID + "/pom.properties" ); if ( properties != null ) { try { Properties props = new Properties(); props.load( properties ); result = props.getProperty( "version" ); } catch ( IOException e ) { result = "problem determining version"; } finally { IOUtil.close( properties ); } } return result; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public PluginVersion getVersion() {\n return version;\n }", "int getCurrentVersion();", "Version getVersion();", "Version getVersion();", "Version getVersion();", "Version getVersion();", "public String getVersion();", "public String getVersion();", "public String getVersion();", "public String getVersion();", "java.lang.String getVersion();", "java.lang.String getVersion();", "java.lang.String getVersion();", "java.lang.String getVersion();", "java.lang.String getVersion();", "java.lang.String getVersion();", "java.lang.String getVersion();", "java.lang.String getVersion();", "String getVersion();", "String getVersion();", "String getVersion();", "String getVersion();", "String getVersion();", "String getVersion();", "String getVersion();", "String getVersion();", "String getVersion();", "String getVersion();", "String getVersion();", "public static String getVersion() {\n\t\treturn \"1.0.3\";\n\t}", "public abstract String getVersion();", "public abstract String getVersion();", "public abstract String getVersion();", "String offerVersion();", "public Version getVersion();", "public String getProductVersion();", "public static String getVersion() {\n\t\treturn version;\r\n\t}", "public static final String getVersion() { return version; }", "public static final String getVersion() { return version; }", "public static String getVersion() {\n\t\treturn version;\n\t}", "public static String getVersion() {\r\n\t\treturn VERSION;\r\n\t}", "public static String getVersion() {\n return version;\n }", "public static String getVersion() {\n return version;\n }", "public abstract int getVersion();", "String version();", "long getVersion();", "long getVersion();", "long getVersion();", "long getVersion();", "@Override\n\tpublic String getPluginVersion() {\n\t\treturn null;\n\t}", "public String getVersion () {\r\n return version;\r\n }", "public String getVersion(){\r\n return version;\r\n }", "public String getVersion()\n {\n return version;\n }", "public String getVersion()\n {\n return ver;\n }", "public String getVersion() {\r\n return version;\r\n }", "public String getVersion()\n {\n return version;\n }", "public String getVersion()\n {\n return version;\n }", "public default String getVersion() {\n return Constants.VERSION_1;\n }", "public String getVersion() {\n return version;\n }", "public String getVersion() {\n return version;\n }", "public String getVersion() {\n return version;\n }", "public String getVersion() {\n return version;\n }", "public String getVersion() {\n return version;\n }", "public String getVersion() {\n return version;\n }", "public String getVersion() {\n return version;\n }", "public String getVersion() {\n return version;\n }", "public String getVersion() {\n return version;\n }", "public String getVersion() {\n return version;\n }", "public String getVersion() {\n return version;\n }", "Long getVersion();", "public String version() {\n return this.version;\n }", "public String version() {\n return this.version;\n }", "public String version() {\n return this.version;\n }", "public String version() {\n return this.version;\n }", "public int getVersion() { return 1; }", "public static String getVersion() {\n\t\treturn \"0.9.4-SNAPSHOT\";\n\t}", "public float getVersion();", "public String getVersionNum();", "public static Version getVersion() {\r\n\t\tif (VERSION == null) {\r\n\t\t\tfinal Properties props = new Properties();\r\n\t\t\tint[] vs = { 0, 0, 0 };\r\n\t\t\tboolean stable = false;\r\n\t\t\ttry {\r\n\t\t\t\tprops.load(GoogleCalXPlugin.class.getResourceAsStream(\"/META-INF/maven/de.engehausen/googlecalx/pom.properties\"));\r\n\t\t\t\tfinal String pomVersion = props.getProperty(\"version\");\r\n\t\t\t\tstable = !pomVersion.contains(\"SNAPSHOT\");\r\n\t\t\t\tfinal StringTokenizer tok = new StringTokenizer(pomVersion, \".\");\r\n\t\t\t\tint i = 0;\r\n\t\t\t\twhile (i < 3 && tok.hasMoreTokens()) {\r\n\t\t\t\t\tfinal String str = tok.nextToken();\r\n\t\t\t\t\tfinal int cut = str.indexOf('-');\r\n\t\t\t\t\tif (cut > 0) {\r\n\t\t\t\t\t\tvs[i++] = Integer.parseInt(str.substring(0, cut));\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\tvs[i++] = Integer.parseInt(str);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t} catch (IOException e) {\r\n\t\t\t\tstable = false;\r\n\t\t\t}\r\n\t\t\tVERSION = new Version(vs[0], vs[1], vs[2], stable);\r\n\t\t}\r\n\t\treturn VERSION;\r\n\t}", "public String getVersion() {\n return version;\n }", "public String getVersion() {\n return version;\n }", "public String getVersion() {\n return version;\n }", "@CheckForNull\n String getVersion();", "public final String getVersion() {\n return version;\n }", "public java.lang.String getVersion() {\r\n return version;\r\n }", "public String getVersion() {\r\n\t\treturn version;\r\n\t}", "public String getVersionNumber ();", "Integer getVersion();", "public String getVersion() {\n\t\treturn (VERSION);\n\t}", "String buildVersion();", "public String getVersion() {\n\t\treturn version;\n\t}", "@Override\r\n\tpublic String getVersion() {\r\n\t\treturn \"1.0.5\";\r\n\t}", "@java.lang.Override\n public long getVersion() {\n return instance.getVersion();\n }", "@java.lang.Override\n public long getVersion() {\n return version_;\n }", "public int getVersion() {\n return version;\n }", "public int getVersion() {\n return version;\n }", "public int getVersion() {\n return version;\n }", "public int getVersion() {\n return version;\n }", "public int getVersion() {\n return version;\n }", "public String getVersion() {\n return \"1.0.4-SNAPSHOT\";\n }", "public CimString getVersion() {\n return version;\n }" ]
[ "0.73218083", "0.7271967", "0.72553843", "0.72553843", "0.72553843", "0.72553843", "0.7245391", "0.7245391", "0.7245391", "0.7245391", "0.7236185", "0.7236185", "0.7236185", "0.7236185", "0.7236185", "0.7236185", "0.7236185", "0.7236185", "0.7202209", "0.7202209", "0.7202209", "0.7202209", "0.7202209", "0.7202209", "0.7202209", "0.7202209", "0.7202209", "0.7202209", "0.7202209", "0.7149709", "0.70578533", "0.70578533", "0.70578533", "0.70561576", "0.7050911", "0.70351195", "0.70324266", "0.7030029", "0.7030029", "0.7024346", "0.69994223", "0.6994134", "0.6994134", "0.6983946", "0.69415826", "0.6935286", "0.6935286", "0.6935286", "0.6935286", "0.6916768", "0.6910215", "0.6862228", "0.6858641", "0.68300134", "0.6808339", "0.68054265", "0.68054265", "0.678996", "0.67858076", "0.67858076", "0.67858076", "0.67858076", "0.67858076", "0.67858076", "0.67858076", "0.67858076", "0.67858076", "0.67858076", "0.67858076", "0.6778318", "0.6771003", "0.6771003", "0.6771003", "0.6771003", "0.6767501", "0.6757852", "0.67557865", "0.6751533", "0.6750591", "0.67503756", "0.67503756", "0.67466366", "0.6743986", "0.6743188", "0.6741112", "0.6716075", "0.6713939", "0.6707404", "0.6691662", "0.6688647", "0.6687106", "0.6685177", "0.6665663", "0.6664726", "0.6660728", "0.6660728", "0.6660728", "0.6660728", "0.6660728", "0.66535854", "0.6646563" ]
0.0
-1
/ This method is called when a GET request is sent to the URL /admin. This method prepares and dispatches the Admin view
@RequestMapping(value="/admin", method=RequestMethod.GET) public String getAdminPage(Model model) { return "admin"; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@RequestMapping(value = \"/admin\", method = RequestMethod.GET)\n public ModelAndView adminPage() {\n logger.info(\"Admin GET request\");\n\n String login = authorizationUtils.getCurrentUserLogin();\n String message = MessageFormat.format(\"User login: {0}\", login);\n logger.info(message);\n\n ModelAndView model = new ModelAndView();\n model.addObject(\"search\", new SearchDto());\n model.setViewName(\"admin\");\n return model;\n }", "@RequestMapping(value = \"/admin\", method = RequestMethod.GET)\n\tpublic ModelAndView adminPage() {\n\t\tModelAndView model = new ModelAndView();\n\t\tmodel.addObject(\"categories\", myService.listGroups());\n\t\tmodel.addObject(\"products\", myService.displayProducts());\n\t\tmodel.setViewName(\"adminmy\");\n\t\treturn model;\n\t}", "@GET\n\t@RequestMapping(value = \"/admin\")\n\t@Secured(value = { \"ROLE_ADMIN\" })\n\tpublic String openAdminMainPage() {\n\t\t\n\t\treturn \"admin/admin\";\n\t}", "@RequestMapping(value=\"/admin\" , method= RequestMethod.GET)\n\tpublic String adminPage(ModelMap model) { \n\t\t\n\t\tmodel.addAttribute(\"user\",getUserData());\n\t\treturn\"admin\";\n\t}", "@RequestMapping(method = RequestMethod.GET)\n\tpublic String get(HttpServletRequest request, Model model) {\n\t\tlogger.trace(\"Admin Home\");\n\t\tif(!request.isUserInRole(AccountPrivilege.VIEW.getName())) {\n\t\t\tmodel.addAttribute(\"error\", \"You do not have access to view the admin pages\");\n\t\t\tLoginForm loginForm = new LoginForm();\n\t\t\tmodel.addAttribute(\"loginForm\", loginForm);\n\t\t\tAccountCreateForm accountCreateForm = new AccountCreateForm();\n\t\t\tmodel.addAttribute(\"accountCreateForm\", accountCreateForm);\n\t\t\treturn \"index\";\n\t\t}\n\t\treturn \"admin/home\";\n\t}", "@RequestMapping(value = \"/view\", method = RequestMethod.GET)\n\tpublic ModelAndView view(HttpServletRequest req, HttpServletResponse resp, Model model) {\n\t\tModelAndView mav = new ModelAndView(\"adminHome\");\n\t\tmav.addObject(\"allUsers\", userDao.findAllUsers());\n\t\tmav.addObject(\"allItems\", itemDao.findAllItems());\n\t\tmav.addObject(\"allTransactions\", transactionDao.findAllTransactions());\n\t\tmav.addObject(\"allFeedback\", feedbackDao.findAllFeedback());\n\t\tmav.addObject(\"allFacts\", factDao.findAllFacts());\n\t\tmodel.addAttribute(\"fact\", factDao.generateRandomFact());\n\t\tmodel.addAttribute(\"pageTitle\",\"Admin Home\");\n\t\treturn mav;\n\t}", "@GetMapping(\"/admin/home\")\n\tpublic ModelAndView goToAdminHome(){\n\t\t\n\t\tModelAndView modelAndView = new ModelAndView(\"admin/home\");\n\t\tAuthentication auth = SecurityContextHolder.getContext().getAuthentication();\n\t\tUser user = userService.findUserByEmail(auth.getName());\n\t\t\n\t\tmodelAndView.addObject(\"userName\", \"Welcome \" + user.getFirstname() + \" \" + user.getLastname() + \" (\" + user.getEmail() + \")\");\n\t\tmodelAndView.addObject(\"adminMessage\",\"Content Available Only for Users with Admin Role\");\n\t\t\n\t\treturn modelAndView;\n\t}", "@RequestMapping(value=\"admin\", method=RequestMethod.GET)\n\tpublic ModelAndView getPageAdmin(ModelAndView model) throws IOException{\n\t\tModelAndView model2 = new ModelAndView();\n\t\tmodel2.setViewName(\"pagina_usuario_main\");\n\t\t\n\t\treturn model2;\n\t}", "@Override\r\n\tpublic void login_admin() {\n\t\trender(\"admin/login.jsp\");\r\n\t}", "@RequestMapping(value = \"/admin\") public String getControlCentreAdminPage(final Model model) {\n List<Announcement> announcements = announcementService.getAllAnnouncements();\n\n logger.trace(\"Announcements list size: \" + announcements.size());\n\n model.addAttribute(\"announcements\", announcements);\n\n return ANNOUNCEMENT_ADMIN;\n }", "@RequestMapping(value = \"/admin/index\", method = GET)\r\n\tpublic String index() {\r\n\t\treturn \"admin/index\";\r\n\t}", "void doGetAdminInfo() {\n\t\tlog.config(\"doGetAdminInfo()...\");\n\t\tthis.rpcService.getAdminInfo(new AsyncCallback<DtoAdminInfo>() {\n\n\t\t\t@Override\n\t\t\tpublic void onFailure(Throwable caught) {\n\t\t\t\tString errorMessage = \"Error when getting admin info! : \" + caught.getMessage();\n\t\t\t\tlog.severe(errorMessage);\n\t\t\t\tgetAdminPanel().setActionResult(errorMessage, ResultType.error);\n\t\t\t}\n\n\t\t\t@Override\n\t\t\tpublic void onSuccess(DtoAdminInfo adminInfo) {\n\t\t\t\tlog.config(\"getAdminInfo() on success - \" + adminInfo.getListLogFilenames().size() + \" logs filenames.\");\n\t\t\t\tgetAdminPanel().setAdminInfo(adminInfo);\n\t\t\t}\n\t\t});\n\t}", "@RequestMapping(\"/admin\")\n public String admin() {\n \t//当前用户凭证\n\t\tSeller principal = (Seller)SecurityUtils.getSubject().getPrincipal();\n\t\tSystem.out.println(\"拿取用户凭证\"+principal);\n return \"index管理员\";\n\n }", "@RequestMapping(method = RequestMethod.GET)\r\n\tpublic String showAdmin(Map<String, Object> model) {\r\n\t\tAdminFormBean adminForm = new AdminFormBean();\r\n\t\tadminForm.setCategories(categoryService.getCategories());\r\n\t\tmodel.put(\"adminForm\", adminForm);\r\n\t\treturn \"admin\";\r\n\t}", "@PreAuthorize(\"hasAuthority('ROLE_ADMIN')\")\n @RequestMapping\n public String admin() {\n return \"admin\";\n }", "public admin() {\n\t\tsuper();\n\t}", "@GetMapping(\"/indexAdmin\")\n public String indexAdmin() {\n return \"indexAdmin\";\n }", "@GetMapping(\"/admin\")\n public String adminindex(){\n\n return \"adminindex\";\n }", "@Override\n protected ModelAndView handleRequestInternal(HttpServletRequest request,\n\t\t\tHttpServletResponse response) throws Exception {\n\t\t\t\n\t\tString result = \"indexAdmin\";\n\t\ttry {\n\t\t\tif(action.doWork(request))\n\t\t\t\tresult = \"viewFonti\";\n\t\t}catch(Exception e){e.printStackTrace();}\n\t\t\n\t\t/*Aggiungo la lista delle fonti alla pagina*/\n\t\tList<Fonte> listaFonti = (List<Fonte>)request.getAttribute(\"listaFonti\");\n\t\tList<Statistics> listaStatistiche = (List<Statistics>) request.getAttribute(\"listaStatistiche\");\n\t\tModelAndView m = new ModelAndView(result);\n\t\tm.addObject(\"listaFonti\", listaFonti);\n\t\tm.addObject(\"listaStatistiche\", listaStatistiche);\n\t\treturn m;\n\t}", "@GetMapping(\"/myCompetitionAdminRequest\")\n\tpublic ModelAndView showCompAdminRequest() {\n\n\t\tAuthentication authentication = SecurityContextHolder.getContext().getAuthentication();\n\t\tString currentPrincipalName = authentication.getName();\n\n\t\tModelAndView mav = new ModelAndView(\"compAdminRequests/compAdminRequestDetails\");\n\t\tmav.addObject(this.compAdminRequestService.findCompAdminRequestByUsername(currentPrincipalName));\n\t\treturn mav;\n\t}", "public AdminPage() {\n initComponents();\n }", "public URI getAdminURL() {\n return adminURL;\n }", "public AdminUI() {\n initComponents();\n wdh=new WebDataHandler();\n initList();\n }", "@RequestMapping(value = \"/adminpanelpage\", method = RequestMethod.GET)\n public String displayAdminPanelPage(Model model) {\n generateNavBar(model);\n return \"adminpanelpage\";\n }", "public adminUsuarios() {\n initComponents();\n showUsuarios();\n }", "public AdministradorView() {\n initComponents();\n }", "public String aktif() {\n performAktif();\n //recreatePagination();\n //recreateModel();\n return \"ListAdmin\";\n }", "@RequestMapping(value = \"/*/landingPage.do\", method = RequestMethod.GET)\n public String landingPageView(HttpServletRequest request, Model model) {\n logger.debug(\"SMNLOG:Landing page controller\");\n\n\n return \"admin/landingPage\";\n }", "@RequestMapping(value = \"/login\", method = RequestMethod.GET)\r\n\tpublic ModelAndView login() {\r\n\t\treturn new ModelAndView(\"admin/login\");\r\n\t}", "@RequestMapping(\"/admin/profile\")\n\tpublic ModelAndView adminprofile() {\n\t\tModelAndView mav = new ModelAndView();\n\t\tYourtaskuser yourtaskuser = authentication.getActiveUser();\n\t\tmav.addObject(\"yourtaskuser\", yourtaskuser);\n\t\tmav.setViewName(\"profile/adminprofile.jsp\");\n\t\treturn mav;\n\t}", "private void startAdmin() {\n final Intent adminActivity = new Intent(this, AdminActivity.class);\n finish();\n startActivity(adminActivity);\n }", "public GetAdminClassServlet() {\n\t\tsuper();\n\t}", "@Override\r\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\r\n throws ServletException, IOException {\r\n try {\r\n processRequest(request, response);\r\n } catch (SQLException ex) {\r\n Logger.getLogger(AdminController.class.getName()).log(Level.SEVERE, null, ex);\r\n } catch (Exception ex) {\r\n Logger.getLogger(AdminController.class.getName()).log(Level.SEVERE, null, ex);\r\n }\r\n \r\n }", "public AdminMainView() {\n initComponents();\n setComponent(new SearchEmployeeView(), mainPanel);\n }", "@RequestMapping(\"/\")\r\n String Adminhome() {\r\n return \"Welcome to Admin Home Page\";\r\n }", "java.lang.String getAdmin();", "@GetMapping(\"/admin\")\n public String admin(Model model){\n String nextPage = \"login\";\n User currentUser = (User) model.getAttribute(\"currentUser\");\n if (isValid(currentUser))\n nextPage = \"adminpage\";\n else{\n User user = new User();\n model.addAttribute(\"currentUser\", null);\n model.addAttribute(\"newUser\", user);\n }\n return nextPage;\n }", "void admin() {\n\t\tSystem.out.println(\"i am from admin\");\n\t}", "@Override\r\n\tpublic List<Admin> getAdminDetails() {\n\t\tList<Admin> admin =dao.getAdminDetails();\r\n return admin;\r\n\t}", "public static void ShowAdminPreferences() {\n if (Controller.permission.GetUserPermission(\"EditUser\")) {\n ToggleVisibility(UsersPage.adminWindow);\n } else {\n DialogWindow.NoAccessTo(\"Admin options\");\n }\n }", "@Override\n\t/*\n\t * (non-Javadoc)\n\t * @see AbCommand#dispatch(java.lang.String)\n\t */\n\t// @param request\n\tpublic void dispatch(String request) throws Exception {\n\t\t{\n\t\t\t \n\t\t\t if(request.equalsIgnoreCase(\"Admin\"))\n\t\t\t {\n\t\t\t\t admin.showView();\n\t\t\t }\n\t\t\t else\n\t\t\t {\n\t\t\t\t System.out.println(\"Enter only specified options\");\n\t\t\t }\n\t\t }\n\t}", "@RequestMapping(value={\"/manageProducts\",\"/Product\"}, method=RequestMethod.GET)\n\tpublic ModelAndView manageProducts()\n\t{\n\t\tModelAndView mv=new ModelAndView(\"admin/Product\");\n\t\tmv.addObject(\"isAdminClickedProducts\",\"true\");\n\t\tmv.addObject(\"product\", new Product());\n\t\tsetData();\n\t\treturn mv;\n\t}", "@Override\r\n\tpublic void one(HttpServletRequest request, HttpServletResponse response) throws IOException {\n\t\tthis.URL1=\"/admin/xiaoshuoedit.jsp\";\r\n\t\tsuper.one(request, response);\r\n\t}", "@RequestMapping(value = \"/login\", method = GET)\r\n\tpublic String login() {\r\n\t\treturn \"admin/login\";\r\n\t}", "public AdminINS() {\n initComponents();\n setLocationRelativeTo(null);\n getdata();\n }", "public AdminController(Admin a)\n {\n \tthis.adminModel=a;\t\n }", "@GET\n @Path(\"/admin\")\n public String isAdmin() {\n return ResponseUtil.SendSuccess(response, \"\\\"isAdmin\\\":\\\"\" + SessionUtil.isAdmin(request) + \"\\\"\");\n }", "@Override\n protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {\n if (Authentication.isAdminInDbByCookies(req)) {\n // Authentication.log(req.getCookies()[0].getValue() + \" - redirect to /admin/registration/registration.html\");\n req.getRequestDispatcher(\"/admin/registration/registration.html\")\n .forward(req, resp);\n\n } else {\n // Authentication.log(req.getCookies()[0].getValue() + \" - redirect to / . Error Authorization.\");\n resp.sendRedirect(\"/\");\n }\n\n }", "@Override\n\tpublic List<?> selectBoardAdminListView() {\n\t\treturn eduBbsDAO.selectBoardAdminList();\n\t}", "public RequestPromotionPageAdminController() {\n\t\tsuper(RequestPromotionPageAdminController.class, MAIN_ENTITY_NAME );\n\t\tlog(\"PromotionPageAdminController created.\");\n\t}", "private void logAdminUI() {\n\t\tString httpPort = environment.resolvePlaceholders(ADMIN_PORT);\n\t\tAssert.notNull(httpPort, \"Admin server port is not set.\");\n\t\tlogger.info(\"Admin web UI: \"\n\t\t\t\t+ String.format(\"http://%s:%s/%s\", RuntimeUtils.getHost(), httpPort,\n\t\t\t\t\t\tConfigLocations.XD_ADMIN_UI_BASE_PATH));\n\t}", "public HomeAdmin() {\n initComponents();\n }", "@Override\n public JSONObject viewSalesManagerTaskByAdmin() {\n\n return in_salesmanagerdao.viewSalesManagerTaskAdmin();\n }", "@Override\n protected String requiredPostPermission() {\n return \"admin\";\n }", "@GetMapping(\"/{id}\")\n public Optional<Admin> getAdmin(@PathVariable int id){\n return adminService.getAdmin(id);\n }", "@GetMapping(\"/\")\n\tpublic ResponseEntity<Object> getAdministrator(HttpServletRequest request){\n\t\tAdministrator admin = service.findByEmail(SessionManager.getInstance().getSessionEmail(request.getSession()));\n\t\tif(admin == null) return new ResponseEntity<>(HttpStatus.UNAUTHORIZED); \n\t\tMappingJacksonValue mappedAdmin = new MappingJacksonValue(admin);\n\t\tmappedAdmin.setFilters(new SimpleFilterProvider().addFilter(Administrator.FILTER, SimpleBeanPropertyFilter.filterOutAllExcept(\"email\", \"name\")));\n\t\treturn new ResponseEntity<>(mappedAdmin, HttpStatus.OK);\n\t}", "@FXML\r\n\tpublic void home(ActionEvent event) throws IOException, SQLException {\n\r\n\t\tFXMLLoader loader = new FXMLLoader(getClass().getResource(\"/GUI/AdminHomeMenu.fxml\"));\r\n\r\n\t\tParent mainMenu = loader.load();\r\n\r\n\t\tAdminHomeMenuContoller ahmc = loader.getController();\r\n\r\n\t\t// This method sets the admin object in home adminHomeMenu controller\r\n\r\n\t\tSystem.out.println(admin.getPassword());\r\n\t\t\r\n\t\tahmc.passAdminInfo(admin);\r\n\r\n\t\tScene mainMenuScene = new Scene(mainMenu);\r\n\r\n\t\tStage window = (Stage) ((Node) event.getSource()).getScene().getWindow();\r\n\r\n\t\twindow.setScene(mainMenuScene);\r\n\t\twindow.setResizable(false);\r\n\r\n\t}", "@RequestMapping(value = \"/admin/privatePage\", method = RequestMethod.GET)\n\tpublic String privatePage() {\n\t\treturn \"privatePage\";\n\t}", "@Override\n public String execute(HttpServletRequest request) {\n String page = null;\n int id = Integer.parseInt(request.getParameter(ID_PARAMETER));\n ArrayList<Client> list = ClientLogic.makeClientList(id);\n request.setAttribute(CLIENT_LIST,list);\n request.setAttribute(ID_PARAMETER,id);\n LOGGER.info(\"Admin take date about client\");\n page= ConfigurationManager.getProperty(\"path.page.client\");\n return page;\n }", "public void setAdminURL(URI adminURL) {\n this.adminURL = adminURL;\n }", "public static List<AdminDetails> list() {\n\t\treturn null;\r\n\t}", "@RequestMapping(value = \"/admin\", method = RequestMethod.GET)\r\n\tpublic String listar(Model model) {\r\n\t\tLOG.info(\"Entrando en admin\");\r\n\t\t\r\n\t\tmodel.addAttribute(\"cursos\", this.servicecurso.listar());\r\n\t\t\r\n\t\treturn \"admin/index\";\r\n\t\t\r\n\t}", "public Admin_Home() {\n initComponents();\n }", "@Override\r\n\tpublic Map<String, Action> getAdminActons() {\n\t\treturn null;\r\n\t}", "public Admin_MainPage() {\n initComponents();\n }", "java.lang.String getNewAdmin();", "public AdminLogInPage() {\n initComponents();\n }", "@RequestMapping(value = { \"/admin/login\" }, method = RequestMethod.GET)\r\n\t public String login(Model model) {\r\n\t return \"login\";\r\n\t }", "public ObservableList<Task> getAdminList() {\n return adminList;\n }", "public AdminView() {\n initComponents();\n \n staffTbl.setSelectionMode(\n ListSelectionModel.SINGLE_SELECTION);\n rentalTbl.setSelectionMode(\n ListSelectionModel.SINGLE_SELECTION);\n carTbl.setSelectionMode(\n ListSelectionModel.SINGLE_SELECTION);\n carClassTbl.setSelectionMode(\n ListSelectionModel.SINGLE_SELECTION);\n }", "@RequestMapping(value = \"/\", method = RequestMethod.GET)\n\tString index() {\n\t\tif (StringUtil.isNullOrEmpty(configuration.getHue().getIp())\n\t\t\t\t|| StringUtil.isNullOrEmpty(configuration.getHue().getUser())) {\n\t\t\treturn \"redirect:/setup\";\n\t\t}\n\n\t\treturn \"redirect:/dailySchedules\";\n\t}", "public Admin() {\n initComponents();\n }", "public Admin() {\n initComponents();\n }", "public Admin() {\n initComponents();\n }", "@GetMapping(\"/all\")\n public List<Admin> getAll(){\n return adminService.getAll();\n }", "@RequestMapping(value = \"/admin\", method = RequestMethod.GET)\n public String getAdmin(Authentication authentication, Model model) {\n UserAccount account = userAccountRepository.findByUsername(authentication.getName());\n model.addAttribute(\"name\", account.getName());\n List<Signup> signups = signupRepository.findAll();\n model.addAttribute(\"signups\", signups);\n return \"admin\";\n }", "public interface AdminController {\n\n Admin login(Admin admin) throws SQLException;\n\n List<Admin> listAdmin(String adminName, String adminRole) throws SQLException;\n\n int addAdmin(Admin admin) throws SQLException;\n\n boolean delete(Long id) throws SQLException;\n\n boolean updateAdmin(Admin admin) throws SQLException;\n}", "@Action( value=\"editAdmin\", results= {\n @Result(name=SUCCESS, type=\"dispatcher\", location=\"/jsp/editauser.jsp\") } ) \n public String editAdmin() \n {\n \t ActionContext contexto = ActionContext.getContext();\n \t \n \t ResultSet result1=null;\n \t\n \t PreparedStatement ps1=null;\n \t try \n \t {\n \t\t getConection();\n \t\t \n \t if ((String) contexto.getSession().get(\"loginId\")!=null)\n \t {\n String consulta1 =(\"SELECT * FROM USUARIO WHERE nick= '\"+ getNick()+\"';\");\n ps1 = con.prepareStatement(consulta1);\n result1=ps1.executeQuery();\n \n while(result1.next())\n {\n nombre= result1.getString(\"nombre\");\n apellido=result1.getString(\"apellido\");\n nick= result1.getString(\"nick\");\n passwd=result1.getString(\"passwd\");\n mail=result1.getString(\"mail\");\n \t \n }\n rol=\"ADMIN\";\n }\n \t } catch (Exception e) \n \t { \n \t \t System.err.println(\"Error\"+e); \n \t \t return SUCCESS;\n \t } finally\n \t { try\n \t {\n \t\tif(con != null) con.close();\n \t\tif(ps1 != null) ps1.close();\n \t\tif(result1 !=null) result1.close();\n \t\t\n } catch (Exception e) \n \t \t {\n \t System.err.println(\"Error\"+e); \n \t \t }\n \t }\n \t\t return SUCCESS;\n \t}", "protected final void runAsAdmin() {\n authenticationTestingUtil.grantAdminAuthority( this.applicationContext );\n }", "@RequestMapping(value = \"/endpoint_managerd\", method = RequestMethod.GET, produces = \"application/json; charset=utf-8\")\r\n public String endpointManagerDebug(HttpServletRequest request, ModelMap model) throws ServletException, IOException {\r\n UserAuthorities ua = userAuthoritiesProvider.getInstance();\r\n if (ua.userIsAdmin() || ua.userIsSuperUser()) {\r\n return(renderPage(request, model, \"endpoint_manager\", null, null, null, true));\r\n } else {\r\n throw new SuperUserOnlyException(\"You are not authorised to manage WMS endpoints for this server\");\r\n }\r\n }", "public String getAdminName() {\n return adminName;\n }", "public String getAdminName() {\n return adminName;\n }", "public static void index()\n {\n String adminId = session.get(\"logged_in_adminid\"); // to display page to logged-in administrator only\n if (adminId == null)\n {\n Logger.info(\"Donor Location: Administrator not logged-in\");\n Welcome.index();\n }\n else\n {\n Logger.info(\"Displaying geolocations of all donors\");\n render();\n }\n }", "public String[] browseAdmin(Session session) throws RemoteException{\n\t\tSystem.out.println(\"Server model invokes browseAdmin() method\");\n\t\treturn null;\n\t\t\n\t}", "@Override\n public Result onUnauthorized(Context ctx) {\n return redirect(routes.Admin.loginPage());\n }", "@Override\n\tpublic Response getAnswerAdmin(GetAnswerAdminRequest getAnswerAdminRequest)\n\t\t\tthrows CustomAdminException {\n\t\tGetAnswerAdminResponseList resp =new GetAnswerAdminResponseList();\n\t\t\n\t\tresp = serviceHelper.getAnswerAdmin(getAnswerAdminRequest);\n \n\t\tif (resp == null) {\n\t\t\t// Empty JSON Object - to create {} as notation for empty resultset\n\t\t\tJSONObject obj = new JSONObject();\t\t\t\n\t\t\treturn CDSOUtils.createOKResponse(obj.toString());\n\t\t} else {\n\t\t\treturn CDSOUtils.createOKResponse(resp);\n\t\t}\n\t\t\n\t}", "@Override\r\n protected void doPost(HttpServletRequest request, HttpServletResponse response)\r\n throws ServletException, IOException {\r\n try {\r\n processRequest(request, response);\r\n } catch (SQLException ex) {\r\n Logger.getLogger(AdminController.class.getName()).log(Level.SEVERE, null, ex);\r\n } catch (Exception ex) {\r\n Logger.getLogger(AdminController.class.getName()).log(Level.SEVERE, null, ex);\r\n }\r\n }", "@Override\n\tpublic List<Admin> getAdmins() {\n\t\treturn ar.findAll();\n\t}", "@RequestMapping(value = \"/manage\", method = RequestMethod.GET)\r\n public ModelAndView manage() {\r\n ModelAndView mav = new ModelAndView(\"manage\");\r\n User loggedIn = (User) SecurityContextHolder.getContext().getAuthentication().getPrincipal();\r\n User user = hibernateTemplate.get(User.class, loggedIn.getUsername());\r\n List<Project> leadProjects = dataAccessService.getLeadProjectsForUser(user);\r\n List<SubProject> researcherProjects = dataAccessService.getResearcherSubProjectsForUser(user);\r\n List<DataItem> dis = new ArrayList<DataItem>(dataAccessService.getCreatedDataForUser(user));\r\n Collections.sort(dis, new Comparator<DataItem>() {\r\n\r\n @Override\r\n public int compare(DataItem o1, DataItem o2) {\r\n return o1.getCreated().compareTo(o2.getCreated());\r\n }\r\n });\r\n for (Project p : leadProjects) {\r\n p.setSubProjects(dataAccessService.getSubProjectsForProject(p));\r\n }\r\n List<Result> createdResults = dataAccessService.getCreatedResultsForUser(user, 10);\r\n mav.addObject(\"lastResults\", createdResults);\r\n mav.addObject(\"uploadedData\", dis);\r\n mav.addObject(\"leadProjects\", leadProjects);\r\n mav.addObject(\"researcherProjects\", researcherProjects);\r\n mav.addObject(\"user\", user);\r\n return mav;\r\n }", "@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n String action = request.getParameter(\"action\");\n String id = request.getParameter(\"id\"); \n if (action==null) {\n List<User> users = userDao.findAll();\n request.setAttribute(\"users\", users);\n request.getRequestDispatcher(\"list-user.jsp\").forward(request, response);\n } else if (action.equals(\"delete\")){\n if (Controller.controller.deleteUser(Integer.parseInt(id))) {\n response.sendRedirect(\"doUser\");\n } else {\n response.sendRedirect(\"admin.jsp\");\n }\n }\n }", "@Override\r\n\tpublic String addAdmin(Admin admin) {\n\t\treturn adminDAO.addAdmin(admin);\r\n\t}", "public void gotoAdminLogin(){ application.gotoAdminLogin(); }", "public boolean isAdmin()\n {\n return admin;\n }", "public boolean isAdmin()\n {\n return admin;\n }", "@RequestMapping(value=\"admin/users\", method=RequestMethod.GET)\n\tpublic ModelAndView index(ModelAndView model) throws IOException{\n\t\tModelAndView model2 = new ModelAndView();\n\t\tmodel2.setViewName(\"usuarios_admin\");\n\t\t\n\t\treturn model2;\n\t}", "public AdminData() {\n initComponents();\n TampilData();\n }", "@Override\n public void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {\n boolean adminExists = false;\n PrintWriter out = response.getWriter();\n try {\n String adminExistsSQL = \"SELECT * FROM admin\";\n PreparedStatement stmt = conn.prepareStatement(adminExistsSQL);\n rs = stmt.executeQuery();\n //If there is a result there must be an admin\n if (rs.next()) {\n adminExists = true;\n }\n } catch (SQLException ex) {\n Logger.getLogger(Login.class.getName()).log(Level.SEVERE, null, ex);\n }\n //Send the admin a login page\n if (adminExists) {\n String logonTable = \"<!DOCTYPE html>\\n\"\n + \"<html>\\n\"\n + \" <head>\\n\"\n + \" <title>Log into Admin Portal</title>\\n\"\n + \" <meta charset=\\\"UTF-8\\\">\\n\"\n + \" <meta name=\\\"viewport\\\" content=\\\"width=device-width, initial-scale=1.0\\\">\\n\"\n + \" <link rel=\\\"stylesheet\\\" type=\\\"text/css\\\" href=\\\"css/loginStyle.css\\\" />\\n\"\n + \" </head>\\n\"\n + \" <body>\\n\"\n + \" <h1> Administrator Log In</h1>\\n\"\n + \" <div class='left'></div>\\n\"\n + \" <div class='right'></div>\\n\"\n + \" <div class=\\\"SignIn fadeInRight\\\">\\n\"\n + \"\\n\"\n + \" <form action='LoginAdmin' method='POST'>\\n\"\n + \" <h2 style='padding-left: 175px;'> name</h2> \\n\"\n + \" <label>\\n\"\n + \" <input type='text' name='username'/>\\n\"\n + \" </label>\\n\"\n + \" <br>\\n\"\n + \" <h2 style='padding-left: 160px;'>password</h2> \\n\"\n + \" <label>\\n\"\n + \" <input type='password' name='password'/> \\n\"\n + \" </label>\\n\"\n + \" <label>\\n\"\n + \" <input type='hidden' name='loginAttempt' value ='loginAttempt'/>\\n\"\n + \" </label>\\n\"\n + \" <br><br>\\n\"\n + \" <div class='submit'>\\n\"\n + \" <input type='submit' />\\n\"\n + \" </div>\\n\"\n + \"\\n\"\n + \" </form>\\n\"\n + \" </div>\\n\"\n + \"\\n\"\n + \"\\n\"\n + \" </body>\\n\"\n + \"</html>\\n\"\n + \"\";\n\n out.println(logonTable);\n //If there is no admin, send a sign up page\n } else {\n String signUpAdmin = \"<!DOCTYPE html>\\n\"\n + \"<html>\\n\"\n + \" <head>\\n\"\n + \" <title>Add an Admin</title>\\n\"\n + \" <meta charset=\\\"UTF-8\\\">\\n\"\n + \" <meta name=\\\"viewport\\\" content=\\\"width=device-width, initial-scale=1.0\\\">\\n\"\n + \" <link rel=\\\"stylesheet\\\" type=\\\"text/css\\\" href=\\\"css/loginStyle.css\\\" />\\n\"\n + \" </head>\\n\"\n + \" <body>\\n\"\n + \" <h1> User this form to create a username and password for admin </h1>\\n\"\n + \" <div class='left'></div>\\n\"\n + \" <div class='right'></div>\\n\"\n + \" <div class=\\\"SignIn fadeInRight\\\">\\n\"\n + \"\\n\"\n + \" <form action='SignUp' method='POST'>\\n\"\n + \" <h2 style='padding-left: 175px;'> name</h2> \\n\"\n + \" <label>\\n\"\n + \" <input type='text' name='username'/>\\n\"\n + \" </label>\\n\"\n + \" <br>\\n\"\n + \" <h2 style='padding-left: 160px;'>password</h2> \\n\"\n + \" <label>\\n\"\n + \" <input type='password' name='password'/> \\n\"\n + \" </label>\\n\"\n + \" <br><br>\\n\"\n + \" <div class='submit'>\\n\"\n + \" <input type='submit' />\\n\"\n + \" </div>\\n\"\n + \"\\n\"\n + \" </form>\\n\"\n + \" </div>\\n\"\n + \"\\n\"\n + \"\\n\"\n + \" </body>\\n\"\n + \"</html>\\n\"\n + \"\";\n\n out.println(signUpAdmin);\n }\n }", "@Override\n\tpublic Admin getModel() {\n\t\treturn admin;\n\t}", "@Override\n\tpublic String handlerRequest(HttpRequest req, HttpResponse res) {\n\t\treturn \"board_list.jsp\";\n\t}", "public boolean isAdmin() {\r\n return admin;\r\n }" ]
[ "0.77195543", "0.75742364", "0.6840917", "0.66437757", "0.64377224", "0.6379811", "0.63570946", "0.62139857", "0.62087476", "0.6207232", "0.61652255", "0.615585", "0.61446077", "0.60737026", "0.5988388", "0.5877289", "0.58715916", "0.5864857", "0.5861742", "0.5832931", "0.5816097", "0.58012223", "0.58003825", "0.5772457", "0.57651025", "0.5763683", "0.5739805", "0.57243145", "0.5715977", "0.57114744", "0.56781673", "0.5675566", "0.5630135", "0.5602005", "0.5598242", "0.5583781", "0.5554741", "0.5552988", "0.55524886", "0.5550874", "0.55384374", "0.5532938", "0.5527874", "0.55265033", "0.552431", "0.5467592", "0.54620916", "0.54555196", "0.5442631", "0.54335487", "0.5431447", "0.5425632", "0.54242814", "0.5424061", "0.542046", "0.5418427", "0.5410287", "0.5409642", "0.54064196", "0.54036194", "0.537427", "0.53638977", "0.53628093", "0.5351189", "0.53422153", "0.53401166", "0.53377736", "0.533662", "0.53346723", "0.53310704", "0.5324116", "0.53240037", "0.53240037", "0.53240037", "0.5323584", "0.5321916", "0.53176975", "0.53164524", "0.5312894", "0.5310445", "0.5289142", "0.5289142", "0.5284414", "0.5258478", "0.52522594", "0.525041", "0.5244797", "0.52447397", "0.52406305", "0.5239876", "0.5239461", "0.52341384", "0.52267736", "0.52267736", "0.522635", "0.5224108", "0.52059674", "0.5203449", "0.52033925", "0.52032757" ]
0.6437974
4
/ This method is called when a GET request is sent to the url /reservations/form. This method prepares and dispatches the Reservations Form view
@RequestMapping(value="/reservations/form", method=RequestMethod.GET) public String getAdminReservationForm(Model model) { model.addAttribute("onDate", new Reservation()); return "reservationsForm"; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@RequestMapping(value=\"/reservations/form\", method=RequestMethod.POST)\r\n\tpublic String getRoomsFromTo(@Valid @ModelAttribute(\"onDate\") Reservation reservation,\r\n\t\t\tBindingResult bindingResult, Model model) {\r\n\t\tthis.reservationValidator.adminValidate(reservation, bindingResult);\r\n\t\tif(!bindingResult.hasErrors()) {\r\n\t\t\tLocalDate localDate= reservation.getCheckIn();\r\n\t\t\tmodel.addAttribute(\"onDate\", reservation.getCheckIn());\r\n\t\t\tmodel.addAttribute(\"freeRooms\", this.roomService.getFreeOn(localDate));\r\n\t\t\tmodel.addAttribute(\"reservedRooms\", this.roomService.getReservedOn(localDate));\r\n\t\t\treturn \"roomsAdmin\";\r\n\t\t}\r\n\t\treturn \"reservationsForm\";\r\n\t}", "@RequestMapping(value = \"/createReservation.htm\", method = RequestMethod.POST)\n\tpublic ModelAndView createReservation(HttpServletRequest request) {\n\t\tModelAndView modelAndView = new ModelAndView();\t\n\t\t\n\t\tif(request.getSession().getAttribute(\"userId\") != null){\n\t\t\n\t\t\t\n\t\t\tBank bank = bankDao.retrieveBank(Integer.parseInt(request.getParameter(\"bankId\")));\t\t\n\t\t\tUser user = userDao.retrieveUser(Integer.parseInt(request.getParameter(\"id\")));\n\t\t\t\n\t\t\t\n\t\t\tNotes notes5 = noteskDao.retrieveNotes(500);\n\t\t\tNotes notes10 = noteskDao.retrieveNotes(1000);\n\t\t\t\n\t\t\tint quantity5 = Integer.parseInt(request.getParameter(\"five\"));\n\t\t\tint quantity10 = Integer.parseInt(request.getParameter(\"thousand\"));\n\t\t\t\n\t\t\t\n\t\t\tReservationDetailsId reservationDetailsId5 = new ReservationDetailsId();\n\t\t\treservationDetailsId5.setNotesId(notes5.getId());\n\t\t\treservationDetailsId5.setQuantity(quantity5);\n\t\t\t\n\t\t\tReservationDetailsId reservationDetailsId10 = new ReservationDetailsId();\n\t\t\treservationDetailsId10.setNotesId(notes10.getId());\n\t\t\treservationDetailsId10.setQuantity(quantity10);\n\t\t\t\n\t\t\t\n\t\t\tReservationDetails reservationDetails5= new ReservationDetails();\n\t\t\treservationDetails5.setId(reservationDetailsId5);\n\t\t\t\n\t\t\t\n\t\t\tReservationDetails reservationDetails10= new ReservationDetails();\n\t\t\treservationDetails10.setId(reservationDetailsId10);\n\t\t\t\n\t\t\t\n\t\t\tReservation reservation = new Reservation();\t\n\t\t\treservation.setBank(bank);\n\t\t\treservation.setDate(request.getParameter(\"date\"));\n\t\t\treservation.setTimeslot(request.getParameter(\"timeslot\"));\n\t\t\treservation.setUser(user);\n\t\t\treservation.setStatus(\"incomplete\");\n\t\t\treservation.getReservationDetailses().add(reservationDetails5);\n\t\t\treservation.getReservationDetailses().add(reservationDetails10);\n\t\t\t\n\t\t\tuser.getResevations().add(reservation);\n\t\t\tuserDao.createUser(user);\n\t\t\t\n\t\t\t\n\t\t\treservationDAO.createReservation(reservation);\n\t\t\treservationDetails5.setResevation(reservation);\n\t\t\treservationDetails10.setResevation(reservation);\n\t\t\t\n\t\t\treservationDetailsId10.setResevationId(reservation.getId());\n\t\t\treservationDetailsId5.setResevationId(reservation.getId());\n\t\t\t\n\t\t\treservationDetailsDAO.createReservationDetails(reservationDetails5);\n\t\t\treservationDetailsDAO.createReservationDetails(reservationDetails10);\n\t\t\t\n\t\t\tmodelAndView.setViewName(\"result_reservation\");\n\t\t\t\n\t\t}\n\t\telse{\n\t\t\tmodelAndView.setViewName(\"login\");\n\t\t\t\n\t\t\t\n\t\t}\t\n\t\t\n\t\treturn modelAndView;\n\t}", "@GetMapping\r\n public String getReservations(@RequestParam(value = \"date\", required = false) String dateString,\r\n Model model,\r\n HttpServletRequest request) {\n LocalDate date = DateUtils.createDateFromDateString(dateString);\r\n List<RoomReservation> roomReservations = reservationService.getRoomReservationForDate(date);\r\n model.addAttribute(\"roomReservations\", roomReservations);\r\n return \"reservations\";\r\n// return new ResponseEntity<>(roomReservations, HttpStatus.OK);\r\n }", "@GetMapping(\"/trip/{id}/reservation/add\")\n public String showReservationForm(@PathVariable(\"id\") long id, Model model) {\n \n \tReservation reservation = new Reservation();\n \treservation.setAddress(new Address());\n \tTrip trip = tripRepository.findById(id).get();\n model.addAttribute(\"reservation\", reservation);\n model.addAttribute(\"trip\", trip);\n return \"add-reservation\";\n }", "@GetMapping(\"/trip/{id}/reservation/edit/{reservationID}\")\n public String showReservationEditForm(@PathVariable(\"id\") long id, \n \t\t@PathVariable(\"reservationID\") long reservationID, Model model) {\n \tTrip trip = tripRepository.findById(id).get();\n \tReservation reservation = eManager.find(Reservation.class, reservationID); \n \tmodel.addAttribute(\"reservation\", reservation);\n \tmodel.addAttribute(\"trip\", trip);\n \treturn \"edit-reservation\";\n }", "public ModifyRoomReservation() {\n initComponents();\n\n btn_search.requestFocus();\n\n getAllIds();\n\n }", "private void createReservations() {\n final String username = extractUsername();\n final EMail email = extractEMail();\n if (!isReserved(username) || !isReserved(email)) {\n signupDelegate.enableNextButton(Boolean.FALSE);\n SwingUtil.setCursor(this, java.awt.Cursor.WAIT_CURSOR);\n UsernameReservation usernameReservation = null;\n EMailReservation emailReservation = null;\n try {\n errorMessageJLabel.setText(getString(\"CheckingUsername\"));\n errorMessageJLabel.paintImmediately(0, 0, errorMessageJLabel\n .getWidth(), errorMessageJLabel.getHeight());\n \n // get username reservation\n usernameReservation = createUsernameReservation(username);\n if (null == usernameReservation) {\n unacceptableUsername = username;\n } else {\n usernameReservations.put(username.toLowerCase(), usernameReservation);\n }\n \n // get email reservation\n emailReservation = createEMailReservation(email);\n if (null == emailReservation) {\n unacceptableEMail = email;\n } else {\n emailReservations.put(email, emailReservation);\n }\n } catch (final OfflineException ox) {\n logger.logError(ox, \"An offline error has occured.\");\n temporaryError = getSharedString(\"ErrorOffline\");\n } catch (final Throwable t) {\n logger.logError(t, \"An unexpected error has occured.\");\n temporaryError = getSharedString(\"ErrorUnexpected\");\n } finally {\n SwingUtil.setCursor(this, null);\n }\n validateInput();\n }\n }", "@RequestMapping(value = \"/completeReservation\", method = RequestMethod.POST)\r\n public String completeReservation(ReservationRequest request,ModelMap modelMap){\n Reservation reservation= reservationService.bookFlight(request);\r\n modelMap.addAttribute(\"msg\",\"Resevation created succesfully and id is \"+reservation.getId());\r\n\r\n return \"reservation Confirmed\";\r\n }", "protected void processRequest(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n response.setContentType(\"text/html;charset=UTF-8\");\n \n Reservacion res = new Reservacion();\n res.cliente = Integer.parseInt(request.getParameter(\"cliente\"));\n res.usuario = Integer.parseInt(request.getParameter(\"usuario\"));\n res.abonado = Double.parseDouble(request.getParameter(\"abonado\"));\n res.extras = Double.parseDouble(request.getParameter(\"extras\"));\n res.fecha_inicial = request.getParameter(\"fecha_inicial\");\n res.fecha_final = request.getParameter(\"fecha_final\");\n res.dias = Integer.parseInt(res.fecha_final.split(\"-\")[2]) - Integer.parseInt(res.fecha_inicial.split(\"-\")[2]);\n res.habitacion = request.getParameter(\"habitacion\");\n res.observaciones = request.getParameter(\"observaciones\");\n res.usuario = Integer.parseInt(request.getParameter(\"usuario\"));\n \n Habitacion hab = new Habitacion();\n ResultSet habitacion = hab.getOne(res.habitacion, \"string\");\n try {\n if(habitacion.next()){\n res.costo_total = hab.priceByDay(habitacion.getDouble(\"precio\"), res.dias, res.extras);\n \n if(res.create()){\n response.sendRedirect(\"reservaciones.jsp\");\n }else\n try (PrintWriter out = response.getWriter()) {\n out.println(\"<h1>Hubo un error al guardar... \" + res.costo_total + \"</h1>\");\n }\n }\n } catch (SQLException ex) {\n Logger.getLogger(NewReservationServlet.class.getName()).log(Level.SEVERE, null, ex);\n }\n \n \n }", "@RequestMapping(value = \"/Reservation\", method = RequestMethod.GET)\n\t@ResponseBody\n\tpublic List<Reservation> listReservations() {\n\t\treturn new java.util.ArrayList<Reservation>(reservationService.loadReservations());\n\t}", "@RequestMapping(value=\"/add\", method = RequestMethod.POST)\r\n public void addAction(@RequestBody Reservation reservation){\n reservationService.create(reservation);\r\n }", "public ListReservations() {\n\t\tsetTitle(\"Liste de Reservations\");\n\t\tsetBounds(100, 100, 450, 300);\n\t\tcontentPane = new JPanel();\n\t\tcontentPane.setBorder(new EmptyBorder(5, 5, 5, 5));\n\t\tsetContentPane(contentPane);\n\t\t//contentPane.setLayout(null);\n\t\t//Appel de la couche service\n\t\t\n\t\t\t\tIService service = new ServiceImpl();\n\t\t\t\t\n\t\t\t\t//Appel de la methode ListEtudiants de la couche service.\n\t\t\t\tList<Etudiant> etudiants;\n\t\t\t\t\n\t\t\t\tetudiants = service.listEtudiantsService();\n\t\t\t\t\n\t\t\t\tetudiantModel = new EtudiantModel (etudiants);\n\t\t\t\t //Insertion des attributs de la variable Etudiant model dans la table.\n\t\t table_1 = new JTable(etudiantModel);\t\n\t\ttable_1.setBounds(160, 105, 1, 1);\n\t\t//contentPane.add(table_1);\n\t\tJScrollPane scrollPane = new JScrollPane(table_1);\n\t\t//scrollPane.setBounds(0, 264, 435, -264);\n\t\tcontentPane.add(scrollPane, BorderLayout.CENTER);\n\t\t\n\t}", "public void readReservationList() {\n\n\t\tif (rList.size() == 0) {\n\t\t\tSystem.out.println(\"No reservations available!\");\n\t\t} else{\n\t\t\tSystem.out.println(\"\\nDisplaying Reservation List: \\n\");\n\t\t\tSystem.out.format(\"%-20s%-15s%-15s%-15s%-20s%-35s%-25s%-25s%-15s\\n\", \"Reservation No.\", \"Guest ID\", \"Num Adult\",\n\t\t\t\t\t\"Num Kid\", \"Room No.\", \"Reservation Status\", \"Check in\", \"Check out\", \"Reservation time\");\n\n\t\t\tfor (Reservation r : rList) {\n\t\t\t\tSystem.out.format(\"%-20d%-15s%-15s%-15s%-20s%-35s%-25s%-25s%-15.8s\\n\", r.getResvNo(), r.getGuestID(),\n\t\t\t\t\t\tr.getAdultNo(), r.getKidNo(), r.getRoomNo(), r.getResvStatus(), r.getDateCheckIn(), r.getDateCheckOut(),\n\t\t\t\t\t\tr.getResvTime());\n\t\t\t}\n\t\t}\n\t}", "protected void showReservations() {\n storageDao.findAllRented()\n .forEach(System.out::println);\n }", "private void handleBooking() {\n\t\tString customerID;\n\t\tint recNo = table.getSelectedRow();\n\t\tif(recNo == -1){\n\t\t\treturn;\n\t\t}\n\t\t\n\t\ttry {\n\t\t\tcustomerID = JOptionPane.showInputDialog(mainPanel,\n\t\t\t\t\t\"Enter Customer ID (8 Digits)\");\n\t\t\tif (customerID != null) {\t\n\t\t\t\tcontroller.reserveRoom(recNo, customerID);\n\t\n\t\t\t\tupdateTable(nameSearchBar.getText(),\n\t\t\t\t\t\tlocationSearchBar.getText());\n\t\t\t}\n\t\t} catch (final InvalidCustomerIDException icide) {\n\t\t\tJOptionPane.showMessageDialog(mainPanel, \"Invalid format!\");\n\t\t} catch (final BookingServiceException bse) {\n\t\t\tJOptionPane.showMessageDialog(mainPanel, bse.getMessage());\n\t\t} catch (final ServiceUnavailableException sue) {\n\t\t\tJOptionPane.showMessageDialog(null, sue.getMessage());\n\t\t\tSystem.exit(0);\n\t\t}\n\t}", "@RequestMapping(value = \"/Reservation\", method = RequestMethod.POST)\n\t@ResponseBody\n\tpublic Reservation newReservation(@RequestBody Reservation reservation) {\n\t\treservationService.saveReservation(reservation);\n\t\treturn reservationDAO.findReservationByPrimaryKey(reservation.getReservationId());\n\t}", "private void show_reviewform(HttpServletRequest request, HttpServletResponse response)\n\t\t\tthrows ServletException, IOException {\n\t\tString restaurant = request.getParameter(\"key_id\");\n\t\tString restaurant_Name = request.getParameter(\"key_restName\");\n\t\tString restaurant_loc = request.getParameter(\"key_restloc\");\n\t\trequest.setAttribute(\"rrid\", restaurant);\n\t\trequest.setAttribute(\"rrname\", restaurant_Name);\n\t\trequest.setAttribute(\"rrloc\", restaurant_loc);\n\t\trequest.getRequestDispatcher(\"/WEB-INF/jsp/view/reviewform.jsp\").forward(request, response);\n\n\t}", "@RequestMapping(method = RequestMethod.POST)\n public ReservationDTO createReservation(@Valid @RequestBody NewReservation reservation)\n throws InvalidReservationDateException {\n\n String email = reservation.getOwner().getEmail();\n String fullName = reservation.getOwner().getFullName();\n LocalDate arrival = reservation.getArrivalDate();\n LocalDate departure = reservation.getDepartureDate();\n\n Reservation newReservation = this.service\n .createReservation(email, fullName, arrival, departure);\n\n return this.parseReservation(newReservation);\n }", "public void actionPerformed(ActionEvent e) \n\t\t\t{\n\t\t\t\ttry\n\t\t\t\t{\n\t\t\t\t\tObject HotelID = cbHotelsOptions.getSelectedItem();\n\t\t\t\t\tHotel hotel;\n\t\t\t\t\thotel = (Hotel) HotelID;\n\t\t\t\t\tlong id = hotel.getUniqueId();\n\t\t\t\t\t//\tSystem.out.println(id);\n\t\t\t\t\tString inmonth = txtInMonth.getText();\n\t\t\t\t\tint inMonth = Integer.valueOf(inmonth);\n\t\t\t\t\tString inday = txtInDay.getText();\n\t\t\t\t\tint inDay = Integer.parseInt(inday);\n\t\t\t\t\tString outmonth = txtOutMonth.getText();\n\t\t\t\t\tint outMonth = Integer.valueOf(outmonth);\n\t\t\t\t\tString outday = txtOutDay.getText();\n\t\t\t\t\tint OutDay = Integer.parseInt(outday);\n\t\t\t\t\tFileOutputStream fos = new FileOutputStream(\"Reservation.txt\", true);\n\t\t\t\t\tPrintWriter pw = new PrintWriter(fos);\n\n\t\t\t\t\t/**\n\t\t\t\t\t * i then check the canBook method and according to the canBook method \n\t\t\t\t\t * i check if they can book, and if yes i add the reservation\n\t\t\t\t\t * otherwise it prints so the user may enter different values\n\t\t\t\t\t */\n\t\t\t\t\t{\n\t\t\t\t\t\tif(h.canBook(new Reservation(id,inMonth, inDay, OutDay)) == true) \n\t\t\t\t\t\t{\n\t\t\t\t\t\t\treservation.add(new Reservation (id,inMonth, inDay, outMonth, OutDay));\n\t\t\t\t\t\t\tr = new Reservation (id,inMonth, inDay, OutDay);\n\t\t\t\t\t\t\th.addResIfCanBook(new Reservation(id,inMonth, inDay, outMonth, OutDay));\n\t\t\t\t\t\t\treservationsModel.addElement(r);\n\t\t\t\t\t\t\tpw.println( id + \" - \" + inMonth + \"-\"+ inDay+ \" - \" + outMonth + \"-\" + OutDay);\n\t\t\t\t\t\t\tpw.close();\n\t\t\t\t\t\t\ttxtInMonth.setText(\"\");\n\t\t\t\t\t\t\ttxtOutMonth.setText(\"\");\n\t\t\t\t\t\t\ttxtInDay.setText(\"\");\n\t\t\t\t\t\t\ttxtOutDay.setText(\"\");\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse \n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tJOptionPane.showMessageDialog(null, \"These dates are already reserved\"\n\t\t\t\t\t\t\t\t\t+ \"\\nPlease try again!\");\t\n\t\t\t\t\t\t\ttxtInMonth.setText(\"\");\n\t\t\t\t\t\t\ttxtOutMonth.setText(\"\");\n\t\t\t\t\t\t\ttxtInDay.setText(\"\");\n\t\t\t\t\t\t\ttxtOutDay.setText(\"\");\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t} \n\t\t\t\t/**\n\t\t\t\t * Then the catch Block checks for file not found exception\n\t\t\t\t */\n\t\t\t\tcatch (FileNotFoundException fnfe) \n\t\t\t\t{\n\t\t\t\t\tSystem.err.println(\"File not found.\");\n\t\t\t\t}\n\t\t\t}", "@RequestMapping(value = {\"/reservations/reserve/step3_2/{id}\"}, method =RequestMethod.POST)\n public ModelAndView reservationStep3_2(@PathVariable String id,\n @RequestParam String firstName,\n @RequestParam String lastName,\n @RequestParam String address,\n @RequestParam String companyName,\n @RequestParam String phone,\n @RequestParam String fax,\n @RequestParam String mail,\n @RequestParam String homepage,\n @RequestParam String avatarUrl,\n @RequestParam String notes){\n ReservationInProgress reservationInProgress=reservationService.addNewCustomerToReservationInProgess(id, firstName, lastName, address, companyName, phone, fax, mail, homepage, avatarUrl, notes);\n\n ModelAndView model = new ModelAndView(\"reservation_confirm\");\n model.addObject(\"progressId\",id);\n model.addObject(\"reservationInProgress\",reservationInProgress);\n\n Date fromDate=new Date(reservationInProgress.getDateFrom());\n Date toDate=new Date(reservationInProgress.getDateTo()+CommonUtils.DAY_IN_MS);\n\n model.addObject(\"formattedDateFrom\", CommonUtils.getGermanWeekday(fromDate)+\" \"+CommonUtils.dateFormatter.format(fromDate));\n model.addObject(\"formattedDateTo\",CommonUtils.getGermanWeekday(toDate)+\" \"+CommonUtils.dateFormatter.format(toDate));\n\n return model;\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}", "private void $$$setupUI$$$() {\n SalonReservationForm = new JPanel();\n SalonReservationForm.setLayout(new GridLayoutManager(3, 4, new Insets(10, 10, 10, 10), -1, -1));\n SearchField = new JTextField();\n SalonReservationForm.add(SearchField, new GridConstraints(0, 0, 1, 3, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_HORIZONTAL, GridConstraints.SIZEPOLICY_WANT_GROW, GridConstraints.SIZEPOLICY_FIXED, null, new Dimension(150, -1), null, 0, false));\n final JScrollPane scrollPane1 = new JScrollPane();\n SalonReservationForm.add(scrollPane1, new GridConstraints(1, 0, 1, 4, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_BOTH, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_WANT_GROW, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_WANT_GROW, null, null, null, 0, false));\n SalonsTable = new JTable();\n scrollPane1.setViewportView(SalonsTable);\n editReservationButton = new JButton();\n editReservationButton.setText(\"Edit Reservation\");\n SalonReservationForm.add(editReservationButton, new GridConstraints(2, 1, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_HORIZONTAL, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false));\n newReservationButton = new JButton();\n newReservationButton.setText(\"New Reservation\");\n SalonReservationForm.add(newReservationButton, new GridConstraints(2, 0, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_HORIZONTAL, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false));\n searchButton = new JButton();\n searchButton.setText(\"Search\");\n SalonReservationForm.add(searchButton, new GridConstraints(0, 3, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_HORIZONTAL, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false));\n deleteReservationButton = new JButton();\n deleteReservationButton.setText(\"Delete Reservation\");\n SalonReservationForm.add(deleteReservationButton, new GridConstraints(2, 2, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_HORIZONTAL, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false));\n exitButton = new JButton();\n exitButton.setText(\"Exit\");\n SalonReservationForm.add(exitButton, new GridConstraints(2, 3, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_HORIZONTAL, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false));\n }", "@PostMapping(\"/trip/{id}/reservation/add\")\n public String addReservation(Model model, @PathVariable(\"id\") long id, \n \t\t@Valid Reservation reservation, BindingResult result) {\n \t\n \tTrip trip = tripRepository.findById(id).get();\n \treservation.setTrip(trip);\n \t\n\t\treservationValidator.validate(reservation, result);\n\t\t\n\t\tif (result.hasErrors()) {\n \t\tmodel.addAttribute(\"reservation\", reservation);\n \t\tmodel.addAttribute(\"trip\", trip);\n return \"add-reservation\";\n }\n \tservice.add(trip, reservation);\n \n return \"redirect:/trip/\" + id; //view\n }", "@RequestMapping(value = \"/Reservation/{reservation_reservationId}\", method = RequestMethod.GET)\n\t@ResponseBody\n\tpublic Reservation loadReservation(@PathVariable Integer reservation_reservationId) {\n\t\treturn reservationDAO.findReservationByPrimaryKey(reservation_reservationId);\n\t}", "@PostMapping(\"/reservation\")\n\tpublic String loadSeatPlan(@ModelAttribute SearchInfoEntity searchInfo, Model model) {\n\t\tSystem.out.println(\"|MTKTWEB Reservation POST CNTRL | \");\n\t\treturn \"reservation\";\n\t}", "Sporthall() {\n reservationsList = new ArrayList<>();\n }", "public FrmDetalles(Reservations res, Main prin) {\n initComponents();\n reser = res;\n princ = prin;\n \n this.setExtendedState(MAXIMIZED_BOTH);\n \n \n \n \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}", "Reservation createReservation();", "public Reservation getReservation(final String routeName, final LocalDate date, final UUID reservationId) {\n ReservationModel reservationModel = reservationRepository\n .findByRouteNameAndDateAndReservationId(routeName, date, reservationId).orElseThrow(() ->\n new NotFoundException(\"Reservation Not Found\"));\n\n return routeMapper.toReservation(reservationModel);\n }", "public boolean isSetReservations() {\n return this.reservations != null;\n }", "CurrentReservation createCurrentReservation();", "public void viewReservationList(RoomList roomList) {\n\t\tSystem.out.println(\"\");\t\t\t\t\t\t\t\t\t\t\n\t\tSystem.out.println(\"\\t\\tRESERVATION LIST\t\t\t\t \");\n\t\tSystem.out.println(\"**********************************************\\n\");\n\t\tfor(Room r: roomList.getList()){\t\t\t\t\t\t\t//search for all the rooms in the room list\n\t\t\tif(!r.isEmpty(r)) {\t\t\t\t\t\t\t\t\t\t//if a room is not empty(it has at least one guest)\n\t\t\t\tr.reservationList(r);\t\t\t\t\t\t\t\t//gets all the guests in non empty rooms\n\t\t\t}\n\t\t}\n\t\tSystem.out.println(\"\\n**********************************************\\n\");\n\t}", "@SuppressWarnings({ \"unchecked\", \"rawtypes\" })\n\tpublic void viewOwnReservations(View view) {\n\t\tLocalDatabase db = new LocalDatabase(this);\n\t\tSessionManager sm = new SessionManager(this);\n\t\tUser user = db.getUser(sm.getId());\n\t\tArrayList slots = new ArrayList<Slot>();\n\t\tfor (Place place : db.getPlaces(-1)) {\n\t\t\tfor (Slot slot : db.getSlots(place.getId())) {\n\t\t\t\tif (slot.isReserved() && slot.getUserId() == user.getId()) {\n\t\t\t\t\tslots.add(slot);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// http://www.codeofaninja.com/2013/09/android-listview-with-adapter-example.html\n\t\tAlertDialog.Builder alertDialogBuilder;\n\t\tArrayAdapterItem adapter = new ArrayAdapterItem(this,\n\t\t\t\tR.layout.list_view_row_item, slots);\n\t\tListView listViewItems = new ListView(this);\n\t\tlistViewItems.setAdapter(adapter);\n\t\tlistViewItems\n\t\t\t\t.setOnItemClickListener(new OnItemClickListenerListViewItem(\n\t\t\t\t\t\tadapter));\n\t\talertDialogBuilder = new AlertDialog.Builder(MainActivity.this)\n\t\t\t\t.setMessage(\"Click on a reservation to cancel it.\")\n\t\t\t\t.setView(listViewItems).setTitle(\"Your Reservations\");\n\t\talertDialogBuilder.setPositiveButton(\"Close\",\n\t\t\t\tnew DialogInterface.OnClickListener() {\n\t\t\t\t\t@Override\n\t\t\t\t\tpublic void onClick(DialogInterface dialog, int which) {\n\t\t\t\t\t\tdialog.dismiss();\n\t\t\t\t\t}\n\t\t\t\t});\n\t\talertDialogBuilder.show();\n\t}", "public ArrayList<Reservation> getReservation() {\n return reservations;\n }", "private void mostrarReservas() {\n\t\tJFReservasAdmin jfres =new JFReservasAdmin();\n\t\tjfres.setVisible(true);\n\t\t\n\t\tMap<Integer,Reserva> reservas = modelo.obtenerReservasPeriodo(per.getIdPeriodo());\n\t\tDefaultTableModel dtm = new DefaultTableModel(new Object[][] {},\n\t\t\t\tnew String[] { \"Dia\", \"Hora\", \"Email\" });\n\n\t\tfor (Integer key : reservas.keySet()) {\n\n\t\t\tdtm.addRow(new Object[] { reservas.get(key).getReserva_dia(), reservas.get(key).getReserva_hora(),reservas.get(key).getEmail() });\n\t\t}\n\t\tjfres.tReservas.setModel(dtm);\n\t}", "public ReservationView(Hotel h, JFrame parent)\n\t{\n\t\tsetSize(600, 600);\n\t\tsetTitle(\"Hotel Reservation System\");\n\t\tsetLayout(new BorderLayout());\n\t\tsetDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);\n\t\tsetResizable(false);\n\n\t\tJPanel resViewPanel = new JPanel();\n\t\tresViewPanel.setLayout(new BoxLayout(resViewPanel, BoxLayout.Y_AXIS));\n\n\n\t\tlblName= new JLabel(\"Guest Reservation Menu\");\n\n\t\tJButton btnMake = new JButton(\"Make A Reservation\");\n\t\tbtnMake.setMinimumSize(btnDim);\n\t\tbtnMake.addActionListener(new ActionListener()\n\t\t{\n\n\t\t\t@Override\n\t\t\tpublic void actionPerformed(ActionEvent e)\n\t\t\t{\n\n\t\t\t\tMakeReservationView r;\n\t\t\t\ttry\n\t\t\t\t{\n\t\t\t\t\th.flushRecentRes();\n\t\t\t\t\tr = new MakeReservationView(h, ReservationView.this);\n\t\t\t\t\tr.setLocation(ReservationView.this.getLocation());\n\t\t\t\t\tr.setVisible(true);\n\t\t\t\t\tReservationView.this.setVisible(false);\n\t\t\t\t}\n\t\t\t\tcatch (ParseException e1) {e1.printStackTrace();}\n\t\t\t}\n\t\t});\n\n\n\t\tJButton btnCancel = new JButton(\"Cancel Reservation\");\n\t\tbtnCancel.setMinimumSize(btnDim);\n\t\tbtnCancel.addActionListener(new ActionListener()\n\t\t{\n\n\t\t\t@Override\n\t\t\tpublic void actionPerformed(ActionEvent e)\n\t\t\t{\n\t\t\t\tDeleteReservationView r = new DeleteReservationView(h, ReservationView.this);\n\t\t\t\tr.setLocation(ReservationView.this.getLocation());\n\t\t\t\tr.setVisible(true);\n\t\t\t\tReservationView.this.setVisible(false);\n\t\t\t}\n\t\t});\n\n\t\t//-----------Back Button--------------\n\t\tJButton back = new JButton(\"<\");\n\t\tback.setPreferredSize(btnDim);\n\n\t\tback.addActionListener(new\n\t\t\t\tActionListener()\n\t\t{\n\t\t\t@Override\n\t\t\tpublic void actionPerformed(ActionEvent arg0)\n\t\t\t{\n\t\t\t\tparent.setLocation(ReservationView.this.getLocation());\n\t\t\t\tparent.setVisible(true);\n\t\t\t\tReservationView.this.dispose();\n\t\t\t}\n\t\t}\n\t\t\t\t);\n\t\t//-----------------------------\n\t\tresViewPanel.add(btnMake); resViewPanel.add(btnCancel);\n\t\tadd(lblName, BorderLayout.NORTH);\n\t\tadd(resViewPanel, BorderLayout.CENTER);\n\t\tadd(back,BorderLayout.SOUTH);\n\n\t}", "@Override\r\n\tpublic ActionForward execute(HttpServletRequest request, HttpServletResponse response) throws Exception {\n\t\tint pageSize = 10; // 한 페이지 당 출력될 글의 개수 지정\r\n\t\t\r\n\t\tString pageNum = request.getParameter(\"pageNum\"); // 페이지 번호를 받아온다.\r\n\t\tif(pageNum == null) {\r\n\t\t\tpageNum = \"1\"; // 페이지 번호를 눌러서 들어오지 않으면 게시판 1page를 보여준다.\r\n\t\t}\r\n\t\t\r\n\t\t// 페이지 번호를 사용해서 페이징 처리 시 연산을 수행할 것이므로\r\n\t\t// 페이지 번호값을 정수타입으로 변경\r\n\t\tint currentPage = Integer.parseInt(pageNum);\r\n\t\t\r\n\t\t// 해당 페이지에 출력되는 글들 중 가장 먼저 출력되는 글의 레코드 번호\r\n\t\tint startRow = (currentPage - 1) * pageSize + 1;\r\n\t\t// 현재 페이지 : 1\r\n\t\t// (1 - 1) * pageSize + 1 ---------> 1\r\n\t\t// 현재 페이지 : 2\r\n\t\t// (2 - 1) * pageSize + 1 ---------> 11\r\n\t\t\r\n\t\tint count = 0;\r\n\t\t// count : 총 글의 개수를 저장할 변수\r\n\t\tint number = 0;\r\n\t\t// number : 해당 페이지에 가장 먼저 출력되는 글의 번호\r\n\t\t\r\n\t\tList<ReservationInfo> reservationList = null; // 글 정보를 저장할 리스트\r\n\t\t// 해당 페이지에 출력되는 글 목록을 저장할 컬렉션\r\n\t\t\r\n\t\t// 비지니스 로직 처리를 위해 서비스 객체 생성\r\n\t\tReservationListService reservationListService = new ReservationListService();\r\n\t\t\r\n\t\tcount = reservationListService.getReservationCount(); // 총 예약의 개수를 가져온다.\r\n\t\tif(count > 0) { \r\n\t\t\t// 예약이 하나라도 있으면 리스팅할 예약 정보 얻어오기\r\n\t\t\treservationList = reservationListService.getReservationList(startRow, pageSize); // 해당 페이지의 레코드 10개씩 가져온다.\r\n\t\t}\r\n\t\t\r\n\t\t// 전체 페이지에서 현재페이지 -1을 해서 pageSize를 곱한다.\r\n\t\tnumber = count - (currentPage - 1) * pageSize;\r\n\t\t// 총 글의 개수 : 134\r\n\t\t// 현재 페이지 : 1\r\n\t\t// 134 - (1 - 1) * 10 -------> 134\r\n\t\t\r\n\t\tint startPage = 0;\r\n\t\tint pageCount = 0;\r\n\t\tint endPage = 0;\r\n\t\t\r\n\t\tif(count > 0) { // 글이 하나라도 존재하면...\r\n\t\t\tpageCount = count / pageSize + (count % pageSize == 0 ? 0 : 1);\r\n\t\t\t// 총 페이지 개수를 구함.\r\n\t\t\t// ex) 총 글의 개수 13개이면 페이지는 2개 필요..\r\n\t\r\n\t\t\tstartPage = ((currentPage -1) / pageSize) * pageSize + 1;\r\n\t\t\t// 현재 페이지 그룹의 첫번째 페이지를 구함.\r\n\t\t\t// [1][2][3][4][5][6][7]...[10] -------> 처음 페이지 그룹\r\n\t\t\t// 다음 페이지 스타트 페이지 : [11][12][13]....[20]\r\n\t\t\t\t\t\r\n\t\t\tint pageBlock = 10;\r\n\t\t\tendPage = startPage + pageBlock - 1;\r\n\t\t\t\r\n\t\t\t// 마지막 페이지 그룹인 경우..\r\n\t\t\tif(endPage > pageCount) endPage = pageCount;\r\n\t\t}\r\n\t\t\r\n\t\t// 포워딩 하기 전, 가져 온 글 공유\r\n\t\trequest.setAttribute(\"reservationList\", reservationList);\r\n\t\tPageInfo pageInfo = new PageInfo(); // 페이지에 관한 정보를 처리하는 객체 생성\r\n\t\tpageInfo.setCount(count);\r\n\t\tpageInfo.setCurrentPage(currentPage);\r\n\t\tpageInfo.setEndPage(endPage);\r\n\t\tpageInfo.setNumber(number);\r\n\t\tpageInfo.setPageCount(pageCount);\r\n\t\tpageInfo.setStartPage(startPage);\r\n\t\t\r\n\t\trequest.setAttribute(\"pageInfo\", pageInfo);\r\n\t\tActionForward forward = new ActionForward();\r\n\t\tforward.setUrl(\"/pc/reservationList.jsp\"); // list.jsp 페이지 포워딩\r\n\t\t\r\n\t\treturn forward;\r\n\t}", "public void actionPerformed(ActionEvent e) \n\t\t\t{\n\t\t\t\tHotel selectedHotel = (Hotel)cbHotelsOptions.getSelectedItem();\n\t\t\t\tJOptionPane.showMessageDialog(null, \"You selected the \" + selectedHotel.getHotelName());\n\t\t\t\tselectedHotel.getReservations();\n\t\t\t\tlblCheckIn.setVisible(true);\n\t\t\t\tlblInMonth.setVisible(true);\n\t\t\t\ttxtInMonth.setVisible(true);\n\t\t\t\tlblInDay.setVisible(true);\n\t\t\t\ttxtInDay.setVisible(true);\n\t\t\t\tlblCheckout.setVisible(true);\n\t\t\t\tlblOutMonth.setVisible(true);\n\t\t\t\ttxtOutMonth.setVisible(true);\n\t\t\t\tlblOutDay.setVisible(true);\n\t\t\t\ttxtOutDay.setVisible(true);\n\t\t\t\tbtnAdd.setVisible(true);\n\t\t\t\treservationsModel.removeAllElements();\n\n\t\t\t\t/////////////////////////////////////\n\t\t\t\t/////////////////////////////////////\n\t\t\t\t//Reading Info From Reservation.txt//\n\t\t\t\t/////////////////////////////////////\n\t\t\t\t/////////////////////////////////////\n\t\t\t\t/**\n\t\t\t\t * First i surround everything is a try.. catch blocks \n\t\t\t\t * then in the try block i declare the file input stream\n\t\t\t\t * then a scanner \n\t\t\t\t * then in a while loop i check if the file has next line \n\t\t\t\t * and a user a delimiter \"-\"\n\t\t\t\t * and it adds it to a new reservation\n\t\t\t\t * then it adds it to the ArrayList reservation\n\t\t\t\t * and it also adds it to the hotel object\n\t\t\t\t * then it checks if it can book that hotel\n\t\t\t\t * and if yes it adds it to the ReservationsModel\n\t\t\t\t */\n\t\t\t\ttry\n\t\t\t\t{\n\t\t\t\t\tFileInputStream fis = new FileInputStream(\"Reservation.txt\");\n\t\t\t\t\tScanner fscan = new Scanner (fis);\n\t\t\t\t\tint INMonth = 0;\n\t\t\t\t\tint INday = 0;\n\t\t\t\t\tint OUTmonth = 0;\n\t\t\t\t\tint OUTday = 0;\n\t\t\t\t\tlong iD = 0;\n\t\t\t\t\twhile (fscan.hasNextLine())\n\t\t\t\t\t{\n\t\t\t\t\t\tScanner ls = new Scanner (fscan.nextLine());\n\t\t\t\t\t\tls.useDelimiter(\"-\");\n\t\t\t\t\t\tiD = Integer.parseInt(ls.next().trim());\n\t\t\t\t\t\tINMonth = Integer.parseInt(ls.next().trim());\n\t\t\t\t\t\tINday = Integer.parseInt(ls.next().trim()); \n\t\t\t\t\t\tOUTmonth = Integer.parseInt(ls.next().trim());\n\t\t\t\t\t\tOUTday = Integer.parseInt(ls.next().trim()); \n\t\t\t\t\t\tr = new Reservation (iD,INMonth, INday, OUTmonth, OUTday);\n\t\t\t\t\t\th.addReservation(new Reservation(iD,INMonth, INday, OUTmonth, OUTday));\n\t\t\t\t\t\tHotel hotel = (Hotel) cbHotelsOptions.getSelectedItem();\n\t\t\t\t\t\tlong hotID = hotel.getUniqueId();\n\t\t\t\t\t\tif(iD == hotID)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\treservationsModel.addElement((new Reservation(iD, INMonth, INday, OUTday)));\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t/**\n\t\t\t\t * The catch block checks to make sure that the file is found\n\t\t\t\t */\n\t\t\t\tcatch( FileNotFoundException fnfe)\n\t\t\t\t{\n\t\t\t\t\tSystem.err.println(\"File not found!\");\n\t\t\t\t}\n\t\t\t}", "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 }", "public Collection<ReservationHistoryDTO> getCurrentReservations() throws ResourceNotFoundException{\n\t\tRegisteredUser currentUser = (RegisteredUser) SecurityContextHolder.getContext().getAuthentication().getPrincipal();\n\t\t\n\t\t\n\t\tRegisteredUser currentUserFromBase = registeredUserRepository.getOne(currentUser.getId());\n\t\t\n\t\tCollection<Reservation> reservations = currentUserFromBase.getReservations();\n\t\t\n\t\tif(reservations==null) {\n\t\t\tthrow new ResourceNotFoundException(\"User \"+currentUserFromBase.getUsername()+\" made non reservation!\");\n\t\t}\n\n\t\tHashSet<ReservationHistoryDTO> reservationsDTO = new HashSet<ReservationHistoryDTO>();\n\t\t\n\t\t\n\t\t\n\t\tfor(Reservation reservation : reservations) {\n\t\t\tif(!reservation.getHasPassed()) {\n\t\t\t\n\t\t\t\tReservationHistoryDTO reservationDTO = new ReservationHistoryDTO();\n\t\t\t\t\n\t\t\t\tFlightReservation flightReservation = reservation.getFlightReservation();\n\t\t\t\tRoomReservation roomReservation = reservation.getRoomReservation();\n\t\t\t\tVehicleReservation vehicleReservation = reservation.getVehicleReservation();\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t\n\t\t\t\tFlight flight = flightReservation.getSeat().getFlight();\n\t\t\t\t\n\t\t\t\t\n\t\t\t\tLong reservationId = reservation.getId();\n\t\t\t\tLong flightId = flight.getId();\n\t\t\t\tString departureName = flight.getDeparture().getName();\n\t\t\t\tString destinationName = flight.getDestination().getName();\n\t\t\t\tDate departureDate = flight.getDepartureDate();\n\t\t\t\tLong airlineId = flight.getAirline().getId();\n\t\t\t\t\n\t\t\t\treservationDTO.setReservationId(reservationId);\n\t\t\t\t\n\t\t\t\treservationDTO.setFlightId(flightId);\n\t\t\t\treservationDTO.setDepartureName(departureName);\n\t\t\t\treservationDTO.setDestinationName(destinationName);\n\t\t\t\treservationDTO.setDepartureDate(departureDate);\n\t\t\t\treservationDTO.setAirlineId(airlineId);\n\t\t\t\t\n\t\t\t\t\n\t\t\t\tif(roomReservation != null) {\n\t\t\t\t\tRoomType roomType = reservation.getRoomReservation().getRoom().getRoomType();\n\t\t\t\t\tif(roomType!= null) {\n\t\t\t\t\t\treservationDTO.setRoomTypeId(roomType.getId());\n\t\t\t\t\t\treservationDTO.setHotelId(roomReservation.getRoom().getHotel().getId());\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tif(vehicleReservation != null) {\n\t\t\t\t\tVehicle vehicle = reservation.getVehicleReservation().getReservedVehicle();\n\t\t\t\t\tif(vehicle != null) {\n\t\t\t\t\t\treservationDTO.setVehicleId(vehicle.getId());\n\t\t\t\t\t\treservationDTO.setRentACarId(vehicle.getBranchOffice().getMainOffice().getId());\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\n\t\t\t\treservationsDTO.add(reservationDTO);\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn reservationsDTO;\n\t\t\n\t}", "@GetMapping(\"/reservation\")\n public List<Reservation> getReservations(@RequestParam int userID) { return reservationDataTierConnection.getReservations(userID); }", "@PostMapping(\"/trip/{id}/reservation/update/{reservationID}\")\n public String updateReservation(@PathVariable(\"id\") long id, \n \t\t@PathVariable(\"reservationID\") long reservationID, @Valid Reservation reservation, \n BindingResult result, Model model) {\n \t\n \tTrip trip = tripRepository.findById(id).get();\n \treservation.setId(reservationID);\n \treservation.setTrip(trip);\n \treservationValidator.validate(reservation, result);\n \t\n if (result.hasErrors()) {\n \tmodel.addAttribute(\"reservation\", reservation);\n \t\tmodel.addAttribute(\"trip\", trip);\n return \"edit-reservation\";\n }\n service.update(trip, reservationID, reservation);\n\n return \"redirect:/trip/\" + id;\n }", "@DOpt(type=DOpt.Type.DerivedAttributeUpdater)\n @AttrRef(value=\"reservations\")\n public void doReportQuery() throws NotPossibleException, DataSourceException {\n\n QRM qrm = QRM.getInstance();\n\n // create a query to look up Reservation from the data source\n // and then populate the output attribute (reservations) with the result\n DSMBasic dsm = qrm.getDsm();\n\n //TODO: to conserve memory cache the query and only change the query parameter value(s)\n Query q = QueryToolKit.createSearchQuery(dsm, Reservation.class,\n new String[]{Reservation.AttributeName_Status},\n new Expression.Op[]{Expression.Op.MATCH},\n new Object[]{status});\n\n Map<Oid, Reservation> result = qrm.getDom().retrieveObjects(Reservation.class, q);\n\n if (result != null) {\n // update the main output data\n reservations = result.values();\n\n // update other output (if any)\n numReservations = reservations.size();\n } else {\n // no data found: reset output\n resetOutput();\n }\n }", "@SuppressWarnings(\"unchecked\")\n @Transactional(readOnly = true, propagation = Propagation.REQUIRES_NEW, isolation = Isolation.READ_COMMITTED)\n public List<Reservations> getAll() {\n Session s = sessionFactory.getCurrentSession();\n Query hql = s.createQuery(\"From Reservations\");\n return hql.list();\n }", "private void initialize() {\r\n\t\tfrmCreateReservation = new JFrame();\r\n\t\tfrmCreateReservation.setTitle(\"Create reservation\");\r\n\t\tfrmCreateReservation.setBounds(100, 100, 598, 441);\r\n\t\tfrmCreateReservation.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);\r\n\t\tfrmCreateReservation.getContentPane().setLayout(null);\r\n\r\n\t\tJPanel panel = new JPanel();\r\n\t\tpanel.setBounds(0, 0, 582, 402);\r\n\t\tfrmCreateReservation.getContentPane().add(panel);\r\n\t\tpanel.setLayout(null);\r\n\r\n\t\tJScrollPane scrollPane = new JScrollPane();\r\n\t\tscrollPane.setBounds(259, 26, 313, 213);\r\n\t\tpanel.add(scrollPane);\r\n\r\n\t\tlblUserEmail.setBounds(43, 0, 171, 14);\r\n\t\tpanel.add(lblUserEmail);\r\n\r\n\t\tJLabel lblRoomNumber = new JLabel(\"\");\r\n\t\tlblRoomNumber.setBounds(536, 254, 36, 19);\r\n\t\tpanel.add(lblRoomNumber);\r\n\r\n\t\tJLabel lblRn = new JLabel(\"Room number:\");\r\n\t\tlblRn.setBounds(10, 47, 89, 14);\r\n\t\tpanel.add(lblRn);\r\n\r\n\t\tJLabel lblPr = new JLabel(\"Price:\");\r\n\t\tlblPr.setBounds(10, 72, 70, 14);\r\n\t\tpanel.add(lblPr);\r\n\r\n\t\tJLabel lblRT = new JLabel(\"Room type:\");\r\n\t\tlblRT.setBounds(10, 97, 70, 14);\r\n\t\tpanel.add(lblRT);\r\n\r\n\t\tJLabel lblGetRN = new JLabel(\"\");\r\n\t\tlblGetRN.setBounds(99, 47, 100, 14);\r\n\t\tpanel.add(lblGetRN);\r\n\r\n\t\tJLabel lblGetPr = new JLabel(\"\");\r\n\t\tlblGetPr.setBounds(99, 72, 100, 14);\r\n\t\tpanel.add(lblGetPr);\r\n\r\n\t\tJLabel lblGetRT = new JLabel(\"\");\r\n\t\tlblGetRT.setBounds(99, 97, 100, 14);\r\n\t\tpanel.add(lblGetRT);\r\n\r\n\t\tJLabel lblCheckIn = new JLabel(\"Check in:\");\r\n\t\tlblCheckIn.setBounds(10, 122, 70, 14);\r\n\t\tpanel.add(lblCheckIn);\r\n\r\n\t\tJLabel lblCheckOut = new JLabel(\"Check out:\");\r\n\t\tlblCheckOut.setBounds(10, 147, 70, 14);\r\n\t\tpanel.add(lblCheckOut);\r\n\r\n\t\tJDateChooser dateCheckIn = new JDateChooser();\r\n\t\tdateCheckIn.setBounds(99, 122, 100, 20);\r\n\t\tpanel.add(dateCheckIn);\r\n\r\n\t\tJDateChooser dateCheckOut = new JDateChooser();\r\n\t\tdateCheckOut.setBounds(99, 147, 100, 20);\r\n\t\tpanel.add(dateCheckOut);\r\n\r\n\t\tJLabel lblInvalidDate = new JLabel(\"\");\r\n\t\tlblInvalidDate.setForeground(Color.RED);\r\n\t\tlblInvalidDate.setBounds(20, 172, 229, 14);\r\n\t\tpanel.add(lblInvalidDate);\r\n\t\tJScrollPane scrollPaneDates = new JScrollPane();\r\n\t\tscrollPaneDates.setBounds(30, 288, 229, 103);\r\n\t\tpanel.add(scrollPaneDates);\r\n\t\t\r\n\t\ttableDates = new JTable();\r\n//\t\tCreating table by making some specific rows.\r\n\t\tscrollPaneDates.setViewportView(tableDates);\r\n\t\tmodel = new DefaultTableModel();\r\n\t\tObject[] column = { \"Room number\", \"Price\", \"Room type\" };\r\n\t\tmodel.setColumnIdentifiers(column);\r\n\t\tObject[] row = new Object[3];\r\n\t\r\n\t\r\n\t\tmodelDates = new DefaultTableModel();\r\n\t\tObject[] columnDates = { \"CheckIn\" ,\"CheckOut\"};\r\n\t\tmodelDates.setColumnIdentifiers(columnDates);\r\n\t\tObject[] rowDates = new Object[2];\r\n\r\n\t\tJButton btnCreateReservation = new JButton(\"Create reservation\");\r\n\t\tbtnCreateReservation.addActionListener(new ActionListener() {\r\n\t\t\tpublic void actionPerformed(ActionEvent e) {\r\n//\t\t\tclearing the table with the reservations for the selected room\t\r\n\t\t\t\tmodelDates.setRowCount(0);\r\n\t\t\t\tif (dateCheckIn.getDate() == null || dateCheckOut.getDate() == null) {\r\n\t\t\t\t\tlblInvalidDate.setForeground(Color.RED);\r\n\t\t\t\t\tlblInvalidDate.setText(\"No date selected!\");\r\n\t\t\t\t} else {\r\n\r\n\t\t\t\t\tlong diffDays = ChronoUnit.DAYS.between(dateCheckIn.getDate().toInstant(),\r\n\t\t\t\t\t\t\tdateCheckOut.getDate().toInstant());\r\n\r\n\t\t\t\t\tint selectedRowIndex = table.getSelectedRow();\r\n\r\n\t\t\t\t\tPeriod pastDate = Period.between(date.toInstant().atZone(ZoneId.systemDefault()).toLocalDate(),\r\n\t\t\t\t\t\t\tdateCheckIn.getDate().toInstant().atZone(ZoneId.systemDefault()).toLocalDate());\r\n\r\n\t\t\t\t\tif (diffDays <= 0 || selectedRowIndex == -1 || pastDate.getDays() < 0) {\r\n\r\n\t\t\t\t\t\tlblInvalidDate.setForeground(Color.RED);\r\n\t\t\t\t\t\tlblInvalidDate.setText(\"Invalid dates or no room selected!\");\r\n\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\tSessionFactory factory = new Configuration().configure(\"hibernate.cfg.xml\")\r\n\t\t\t\t\t\t\t\t.addAnnotatedClass(Customer.class).addAnnotatedClass(Rooms.class)\r\n\t\t\t\t\t\t\t\t.addAnnotatedClass(Reservation.class).addAnnotatedClass(Review.class)\r\n\t\t\t\t\t\t\t\t.buildSessionFactory();\r\n\r\n\t\t\t\t\t\tSession session = factory.getCurrentSession();\r\n\r\n\t\t\t\t\t\ttry {\r\n\t\t\t\t\t\t\tsession.beginTransaction();\r\n\t\t\t\t\t\t\tQuery customerQ = session.createQuery(\"from Customer where email=:custEmail\");\r\n\t\t\t\t\t\t\tcustomerQ.setParameter(\"custEmail\", lblUserEmail.getText());\r\n\r\n\t\t\t\t\t\t\tCustomer customer = (Customer) customerQ.getResultList().get(0);\r\n\r\n\t\t\t\t\t\t\tQuery roomQ = session.createQuery(\"from Rooms where roomNumber=:roomNr\");\r\n\t\t\t\t\t\t\troomQ.setParameter(\"roomNr\", lblGetRN.getText());\r\n\t\t\t\t\t\t\tRooms room = (Rooms) roomQ.getResultList().get(0);\r\n\r\n\t\t\t\t\t\t\tQuery resQ = session.createQuery(\"from Reservation where room_id=:roomId\");\r\n\t\t\t\t\t\t\tresQ.setParameter(\"roomId\", room.getId());\r\n\t\t\t\t\t\t\t@SuppressWarnings(\"unchecked\")\r\n\t\t\t\t\t\t\tList<Reservation> resList = resQ.getResultList();\r\n\t\t\t\t\t\t\tint boolRes = 0;\r\n\t\t\t\t\t\t\tfor(int i = 0; i<resList.size();i++) {\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\tif((dateCheckIn.getDate().compareTo(resList.get(i).getCheckOut()) <0) && (dateCheckOut.getDate().compareTo(resList.get(i).getCheckIn()) > 0)) {\r\n\t\t\t\t\t\t\t\t\tJOptionPane.showMessageDialog(btnCreateReservation, \"The room is reserved at this date\");\r\n\t\t\t\t\t\t\t\t\tboolRes = 1;\r\n\t\t\t\t\t\t\t\t\trowDates[0] = resList.get(i).getCheckIn();\r\n\t\t\t\t\t\t\t\t\trowDates[1] = resList.get(i).getCheckOut();\r\n\t\t\t\t\t\t\t\t\tmodelDates.addRow(rowDates);\r\n\t\t\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\telse {\r\n\t\t\t\t\t\t\t\t\tboolRes= 0;\r\n\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\ttableDates.setModel(modelDates);\r\n\t\t\t\t\t\t\tif(boolRes == 0) {\r\n\t\t\t\t\t\t\t\t\r\n\r\n\t\t\t\t\t\t\tdouble totalPrice = room.getPrice() * diffDays;\r\n\r\n\t\t\t\t\t\t\tjava.sql.Date sqldateCheckIn = new java.sql.Date(dateCheckIn.getDate().getTime());\r\n\t\t\t\t\t\t\tjava.sql.Date sqldateCheckOut = new java.sql.Date(dateCheckOut.getDate().getTime());\r\n\r\n\t\t\t\t\t\t\tReservation reserve = new Reservation(customer, room, sqldateCheckIn, sqldateCheckOut,\r\n\t\t\t\t\t\t\t\t\ttotalPrice);\r\n\r\n\t\t\t\t\t\t\tint answer = JOptionPane.showConfirmDialog(btnCreateReservation,\r\n\t\t\t\t\t\t\t\t\t\"Total price is: \" + totalPrice + \". Are you agree?\", \"Warning\",\r\n\t\t\t\t\t\t\t\t\tJOptionPane.YES_NO_OPTION, JOptionPane.WARNING_MESSAGE);\r\n\t\t\t\t\t\t\tif (answer == JOptionPane.YES_OPTION) {\r\n\r\n\t\t\t\t\t\t\t\tsession.save(reserve);\r\n\t\t\t\t\t\t\t\tlblInvalidDate.setForeground(Color.GREEN);\r\n\t\t\t\t\t\t\t\tlblInvalidDate.setText(\"Reservation succesfully created!\");\r\n\r\n\t\t\t\t\t\t\t\t@SuppressWarnings(\"unchecked\")\r\n\t\t\t\t\t\t\t\tList<Rooms> roomsList = (List<Rooms>) session\r\n\t\t\t\t\t\t\t\t\t\t.createQuery(\"from Rooms\").list();\r\n\t\t\t\t\t\t\t\tmodel = new DefaultTableModel();\r\n\r\n\t\t\t\t\t\t\t\tmodel.setColumnIdentifiers(column);\r\n\r\n\t\t\t\t\t\t\t\tfor (int i = 0; i < roomsList.size(); i++) {\r\n\t\t\t\t\t\t\t\t\trow[0] = roomsList.get(i).getRoomNumber();\r\n\t\t\t\t\t\t\t\t\trow[1] = roomsList.get(i).getPrice();\r\n\t\t\t\t\t\t\t\t\trow[2] = roomsList.get(i).getRoomType();\r\n\t\t\t\t\t\t\t\t\tmodel.addRow(row);\r\n\t\t\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\t\t\ttable.setModel(model);\r\n\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\tsession.getTransaction().commit();\r\n\t\t\t\t\t\t\t}}\r\n\r\n\t\t\t\t\t\t} finally {\r\n\t\t\t\t\t\t\tfactory.close();\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\r\n\t\t\t}\r\n\t\t});\r\n\t\tbtnCreateReservation.setBounds(43, 197, 182, 23);\r\n\t\tpanel.add(btnCreateReservation);\r\n\t\ttable = new JTable();\r\n\t\ttable.addMouseListener(new MouseAdapter() {\r\n\t\t\t@Override\r\n\t\t\tpublic void mouseClicked(MouseEvent e) {\r\n\t\t\t\tDefaultTableModel model = (DefaultTableModel) table.getModel();\r\n\t\t\t\tint selectedRowIndex = table.getSelectedRow();\r\n\t\t\t\tif (selectedRowIndex > -1) {\r\n\t\t\t\t\tlblGetRN.setText(model.getValueAt(selectedRowIndex, 0).toString());\r\n\t\t\t\t\tlblGetPr.setText(model.getValueAt(selectedRowIndex, 1).toString());\r\n\t\t\t\t\tlblGetRT.setText(model.getValueAt(selectedRowIndex, 2).toString());\r\n\t\t\t\t\tlblRoomNumber.setText(model.getValueAt(selectedRowIndex, 0).toString());\r\n\t\t\t\t\tlblInvalidDate.setText(\"\");\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\tSessionFactory factory = new Configuration().configure(\"hibernate.cfg.xml\").addAnnotatedClass(Rooms.class)\r\n\t\t\t\t.addAnnotatedClass(Review.class).addAnnotatedClass(Customer.class).addAnnotatedClass(Reservation.class)\r\n\t\t\t\t.buildSessionFactory();\r\n\t\tSession session = factory.getCurrentSession();\r\n\r\n\t\ttry {\r\n\t\t\tsession.beginTransaction();\r\n\r\n\t\t\t@SuppressWarnings(\"unchecked\")\r\n\t\t\tList<Rooms> roomsList = (List<Rooms>) session.createQuery(\"from Rooms\").list();\r\n\r\n\t\t\tfor (int i = 0; i < roomsList.size(); i++) {\r\n\r\n\t\t\t\trow[0] = roomsList.get(i).getRoomNumber();\r\n\t\t\t\trow[1] = roomsList.get(i).getPrice();\r\n\t\t\t\trow[2] = roomsList.get(i).getRoomType();\r\n\r\n\t\t\t\tmodel.addRow(row);\r\n\r\n\t\t\t}\r\n\r\n\t\t\ttable.setModel(model);\r\n\t\t\tsession.getTransaction().commit();\r\n\r\n\t\t} finally {\r\n\r\n\t\t\tfactory.close();\r\n\r\n\t\t}\r\n\r\n\t\ttable.setModel(model);\r\n\r\n\t\tscrollPane.setViewportView(table);\r\n\r\n\t\tJButton btnAddReview = new JButton(\"Write a review for room:\");\r\n\t\tbtnAddReview.addActionListener(new ActionListener() {\r\n\t\t\tpublic void actionPerformed(ActionEvent e) {\r\n\t\t\t\tAddReviewPage addReview = new AddReviewPage();\r\n\r\n\t\t\t\tif (lblGetRN.getText().isEmpty()) {\r\n\r\n\t\t\t\t\tJOptionPane.showMessageDialog(btnAddReview, \"Please select a room!\");\r\n\t\t\t\t} else {\r\n\r\n\t\t\t\t\taddReview.frmAddReview.setVisible(true);\r\n\t\t\t\t\taddReview.lblRoomNumber.setText(lblGetRN.getText());\r\n\r\n\t\t\t\t}\r\n\r\n\t\t\t}\r\n\t\t});\r\n\t\tbtnAddReview.setBounds(310, 250, 222, 23);\r\n\t\tpanel.add(btnAddReview);\r\n\r\n\t\tJButton btnReviews = new JButton(\"View reviews for all rooms\");\r\n\r\n\t\tbtnReviews.setBounds(310, 284, 222, 23);\r\n\t\tpanel.add(btnReviews);\r\n\t\tbtnReviews.addActionListener(new ActionListener() {\r\n\t\t\tpublic void actionPerformed(ActionEvent e) {\r\n\t\t\t\tReviewPage review = new ReviewPage();\r\n\t\t\t\treview.frmReviews.setVisible(true);\r\n\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t\tJLabel lblNewLabel_1 = new JLabel(\"Hello,\");\r\n\t\tlblNewLabel_1.setBounds(10, 0, 46, 14);\r\n\t\tpanel.add(lblNewLabel_1);\r\n\r\n\t\tJButton btnLogout = new JButton(\"Log out\");\r\n\t\tbtnLogout.addActionListener(new ActionListener() {\r\n\t\t\tpublic void actionPerformed(ActionEvent e) {\r\n\t\t\t\tfrmCreateReservation.setVisible(false);\r\n\t\t\t\tLoginPage login = new LoginPage();\r\n\t\t\t\tlogin.frmLogin.setVisible(true);\r\n\t\t\t}\r\n\t\t});\r\n\t\tbtnLogout.setBounds(385, 0, 100, 23);\r\n\t\tpanel.add(btnLogout);\r\n\t\t\r\n\r\n\t\t\r\n\t\tJLabel lblNewLabel = new JLabel(\"The following periods are taken:\");\r\n\t\tlblNewLabel.setBounds(20, 267, 194, 14);\r\n\t\tpanel.add(lblNewLabel);\r\n\t\t\r\n\t\tJButton btnViewYourReservation = new JButton(\"View your reservations\");\r\n\t\tbtnViewYourReservation.addActionListener(new ActionListener() {\r\n\t\t\tpublic void actionPerformed(ActionEvent e) {\r\n\t\t\t\t\r\n\t\t\t\tSessionFactory factory = new Configuration().configure(\"hibernate.cfg.xml\")\r\n\t\t\t\t\t\t.addAnnotatedClass(Customer.class).addAnnotatedClass(Rooms.class)\r\n\t\t\t\t\t\t.addAnnotatedClass(Reservation.class).addAnnotatedClass(Review.class)\r\n\t\t\t\t\t\t.buildSessionFactory();\r\n\r\n\t\t\t\tSession session = factory.getCurrentSession();\r\n\r\n\t\t\t\ttry {\r\n\t\t\t\t\tsession.beginTransaction();\r\n\t\t\t\t\tQuery customerQ = session.createQuery(\"from Customer where email=:custEmail\");\r\n\t\t\t\t\tcustomerQ.setParameter(\"custEmail\", lblUserEmail.getText());\r\n\r\n\t\t\t\t\tCustomer customer = (Customer) customerQ.getResultList().get(0);\r\n\r\n\t\t\t\t\t\tCustomerReservationsPage customerReservations = new CustomerReservationsPage();\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\tcustomerReservations.setCustomerId(customer.getId());\r\n\t\t\t\t\t\tcustomerReservations.getReservationInfo();\r\n\t\t\t\t\t\tcustomerReservations.frmReservations.setVisible(true);\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\tsession.getTransaction().commit();\r\n\t\t\t\t\r\n\r\n\t\t\t\t} finally {\r\n\t\t\t\t\tfactory.close();\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t}\r\n\t\t});\r\n\t\tbtnViewYourReservation.setBounds(43, 231, 182, 23);\r\n\t\tpanel.add(btnViewYourReservation);\r\n\t\t\r\n\r\n\r\n\t}", "public void makeReservationRouteStata() {\n\t\tlog(String.format(\"Making DEBUG ResRequest for Stata-1\"));\n\t\tmakeRequest(new ResRequest(mId, ResRequest.RES_GET, \"Stata-1\"));\n\t}", "public void update() {\n\t\trl = DBManager.getReservationList();\n\t}", "public Calendar setReservationDate(){\n\t\t\n\t\t\n\t\tint currentMonth = Calendar.getInstance().get(Calendar.MONTH)+1; //Month starts from zero in Java\n\t\tint currentYear = Calendar.getInstance().get(Calendar.YEAR);\n\t\tint currentDate = Calendar.getInstance().get(Calendar.DAY_OF_MONTH);\n\t\tint currentHour = Calendar.getInstance().get(Calendar.HOUR_OF_DAY);\n\t\tint currentMinute = Calendar.getInstance().get(Calendar.MINUTE);\n\t\t\n\t\t\n\t\tSystem.out.println(\"Current Year \"+ currentYear );\n\t\tSystem.out.println(\"Current Month \"+ currentMonth );\n\t\tSystem.out.println(\"Today's date \"+ currentDate );\n\t\tSystem.out.println(\"Current Hour \"+ currentHour );\n\t\tSystem.out.println(\"Current Minute \"+ currentMinute );\n\t\tSystem.out.println(\"\\t---\\t---\\t---\\t---\\t---\");\n\t\tint inputMonth, inputYear, inputDate, inputHour, inputMinute;\n\t\t\n\t\tCalendar reserveDate = Calendar.getInstance();\n\t\t\n\t\tSystem.out.print(\"Enter the year: \");\n\t\tinputYear = scan.nextInt();\n\t\tscan.nextLine();\n\t\t\n\t\twhile( inputYear < currentYear){\n\t\t\tSystem.out.println(\"Old year entry is not allowed !\\n\");\n\t\t\tSystem.out.print(\"Enter the year: \");\n\t\t\tinputYear = scan.nextInt();\n\t\t\tscan.nextLine();\n\t\t}\t\n\t\treserveDate.set(Calendar.YEAR,inputYear); \n\t\n\t\tSystem.out.print(\"Enter the month: \");\n\t\tinputMonth = scan.nextInt();\t\n\t\tscan.nextLine();\n\t\t\n\t\twhile (inputMonth < 1 || inputMonth > 12){\n\t\t\tSystem.out.println(\"Invalid Month entry!\");\n\t\t\tSystem.out.print(\"Enter the month again: \");\n\t\t\tinputMonth = scan.nextInt();\n\t\t\tscan.nextLine();\n\t\t}\n\t\t\n\t\twhile((inputMonth < currentMonth) && (inputYear == currentYear)){\n\t\t\t\t\t\n\t\t\tSystem.out.println(\"Old month entry is not allowed !\\n\");\n\t\t\tSystem.out.print(\"Enter the month: \");\n\t\t\tinputMonth = scan.nextInt();\n\t\t\tscan.nextLine();\n\t\t\t\n\t\t}\n\t\treserveDate.set(Calendar.MONTH,inputMonth-1);//MONTH is from 0 to 11.\n\t\t\n\t\tSystem.out.print(\"Enter the date for reservation: \");\n\t\tinputDate = scan.nextInt();\n\t\tscan.nextLine();\n\t\t\n\t\twhile( inputDate < 1 || inputDate > 31){\n\t\t\tSystem.out.println(\"Invalid date entry!\");\n\t\t\tSystem.out.print(\"Enter the date again: \");\n\t\t\tinputDate = scan.nextInt();\n\t\t\tscan.nextLine();\n\t\t}\n\t\t\n\t\twhile((inputDate < currentDate) && (inputMonth == currentMonth)&&(inputYear==currentYear)){\n\t\t\tSystem.out.println(\"Past Day is not allowed!\\n\");\n\t\t\tSystem.out.print(\"Enter the date for reservation: \");\n\t\t\tinputDate = scan.nextInt();\n\t\t\tscan.nextLine();\n\t\t}\n\t\treserveDate.set(Calendar.DAY_OF_MONTH,inputDate);\n\t\t\n\t\tSystem.out.print(\"Enter hour (24-hr format): \");\n\t\tinputHour = scan.nextInt();\n\t\tscan.nextLine();\n\t\t\n\t\twhile( inputHour < 0 || inputHour > 23){\n\t\t\tSystem.out.println(\"Invalid hour entry!\");\n\t\t\tSystem.out.print(\"Enter the hour again: \");\n\t\t\tinputHour = scan.nextInt();\n\t\t\tscan.nextLine();\n\t\t}\n\t\t\n\t\twhile(inputHour < currentHour && inputDate == currentDate&&inputMonth == currentMonth&&inputYear==currentYear){\n\t\t\t\n\t\t\tif (inputHour < 0 && inputHour > 23){\n\t\t\t\tSystem.out.println(\"Invalid Hour entry\");\n\t\t\t}\n\t\t\telse{\n\t\t\t\tSystem.out.println(\"Past hour is not allowed!\\n\");\n\t\t\t\tSystem.out.print(\"Enter hour (24-hr format): \");\n\t\t\t\tinputHour = scan.nextInt();\n\t\t\t\tscan.nextLine();\n\t\t\t}\n\t\t}\n\t\treserveDate.set(Calendar.HOUR_OF_DAY,inputHour); //This uses 24 hour clock\n\t\t\n\t\tSystem.out.print(\"Enter minute: \");\n\t\tinputMinute = scan.nextInt();\n\t\tscan.nextLine();\n\t\t\n\t\twhile(inputMinute < 0 || inputMinute > 59){\n\t\t\tSystem.out.println(\"Invalid Minute entry\");\n\t\t\tSystem.out.print(\"Enter minute again: \");\n\t\t\tinputMinute = scan.nextInt();\n\t\t\tscan.nextLine();\n\t\t}\n\t\t\n\t\twhile((inputMinute-currentMinute) <= 0 && inputHour == currentHour){\n\t\t\t\n\t\t\t//System.out.println(\"Reservation can only be made 30 minutes earlier or invalid input !\");\n\t\t\tSystem.out.print(\"Invalid minute\");\n\t\t\tSystem.out.print(\"Enter minute again: \");\n\t\t\tinputMinute = scan.nextInt();\t\n\t\t\tscan.nextLine();\n\t\t}\n\t\t\n\t\treserveDate.set(Calendar.MINUTE,inputMinute);\n\t\tSystem.out.println(\"Date Reserved!\");\n\t\treturn reserveDate;\n\t}", "private void createEvent() \n\t{\n\t\t// When the user clicks on the add button\n\t\tbtnAdd.addActionListener(new ActionListener() \n\t\t{\n\t\t\tpublic void actionPerformed(ActionEvent e) \n\t\t\t{\n\t\t\t\t//////////////////////////////////\n\t\t\t\t//////////////////////////////////\n\t\t\t\t//Adding Info To Reservation.txt//\n\t\t\t\t//////////////////////////////////\n\t\t\t\t//////////////////////////////////\n\t\t\t\t/**\n\t\t\t\t * First i surround the whole with with try.. catch block\n\t\t\t\t * First in the try block \n\t\t\t\t * i get the values of the check-in and check-out info\n\t\t\t\t * i save them in strings \n\t\t\t\t * then cast them in integers \n\t\t\t\t * and finally add it to Reservation.txt\n\t\t\t\t * then i close the file.\n\t\t\t\t */\n\t\t\t\ttry\n\t\t\t\t{\n\t\t\t\t\tObject HotelID = cbHotelsOptions.getSelectedItem();\n\t\t\t\t\tHotel hotel;\n\t\t\t\t\thotel = (Hotel) HotelID;\n\t\t\t\t\tlong id = hotel.getUniqueId();\n\t\t\t\t\t//\tSystem.out.println(id);\n\t\t\t\t\tString inmonth = txtInMonth.getText();\n\t\t\t\t\tint inMonth = Integer.valueOf(inmonth);\n\t\t\t\t\tString inday = txtInDay.getText();\n\t\t\t\t\tint inDay = Integer.parseInt(inday);\n\t\t\t\t\tString outmonth = txtOutMonth.getText();\n\t\t\t\t\tint outMonth = Integer.valueOf(outmonth);\n\t\t\t\t\tString outday = txtOutDay.getText();\n\t\t\t\t\tint OutDay = Integer.parseInt(outday);\n\t\t\t\t\tFileOutputStream fos = new FileOutputStream(\"Reservation.txt\", true);\n\t\t\t\t\tPrintWriter pw = new PrintWriter(fos);\n\n\t\t\t\t\t/**\n\t\t\t\t\t * i then check the canBook method and according to the canBook method \n\t\t\t\t\t * i check if they can book, and if yes i add the reservation\n\t\t\t\t\t * otherwise it prints so the user may enter different values\n\t\t\t\t\t */\n\t\t\t\t\t{\n\t\t\t\t\t\tif(h.canBook(new Reservation(id,inMonth, inDay, OutDay)) == true) \n\t\t\t\t\t\t{\n\t\t\t\t\t\t\treservation.add(new Reservation (id,inMonth, inDay, outMonth, OutDay));\n\t\t\t\t\t\t\tr = new Reservation (id,inMonth, inDay, OutDay);\n\t\t\t\t\t\t\th.addResIfCanBook(new Reservation(id,inMonth, inDay, outMonth, OutDay));\n\t\t\t\t\t\t\treservationsModel.addElement(r);\n\t\t\t\t\t\t\tpw.println( id + \" - \" + inMonth + \"-\"+ inDay+ \" - \" + outMonth + \"-\" + OutDay);\n\t\t\t\t\t\t\tpw.close();\n\t\t\t\t\t\t\ttxtInMonth.setText(\"\");\n\t\t\t\t\t\t\ttxtOutMonth.setText(\"\");\n\t\t\t\t\t\t\ttxtInDay.setText(\"\");\n\t\t\t\t\t\t\ttxtOutDay.setText(\"\");\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse \n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tJOptionPane.showMessageDialog(null, \"These dates are already reserved\"\n\t\t\t\t\t\t\t\t\t+ \"\\nPlease try again!\");\t\n\t\t\t\t\t\t\ttxtInMonth.setText(\"\");\n\t\t\t\t\t\t\ttxtOutMonth.setText(\"\");\n\t\t\t\t\t\t\ttxtInDay.setText(\"\");\n\t\t\t\t\t\t\ttxtOutDay.setText(\"\");\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t} \n\t\t\t\t/**\n\t\t\t\t * Then the catch Block checks for file not found exception\n\t\t\t\t */\n\t\t\t\tcatch (FileNotFoundException fnfe) \n\t\t\t\t{\n\t\t\t\t\tSystem.err.println(\"File not found.\");\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\n\t\t// When the user selects a specific hotel \n\t\tcbHotelsOptions.addActionListener(new ActionListener()\n\t\t{\n\t\t\tpublic void actionPerformed(ActionEvent e) \n\t\t\t{\n\t\t\t\t/**\n\t\t\t\t * first i save selected hotel in a hotel object\n\t\t\t\t * then i get reservations for the selected hotel\n\t\t\t\t * then i make all the labels and text fields visible \n\t\t\t\t */\n\t\t\t\tHotel selectedHotel = (Hotel)cbHotelsOptions.getSelectedItem();\n\t\t\t\tJOptionPane.showMessageDialog(null, \"You selected the \" + selectedHotel.getHotelName());\n\t\t\t\tselectedHotel.getReservations();\n\t\t\t\tlblCheckIn.setVisible(true);\n\t\t\t\tlblInMonth.setVisible(true);\n\t\t\t\ttxtInMonth.setVisible(true);\n\t\t\t\tlblInDay.setVisible(true);\n\t\t\t\ttxtInDay.setVisible(true);\n\t\t\t\tlblCheckout.setVisible(true);\n\t\t\t\tlblOutMonth.setVisible(true);\n\t\t\t\ttxtOutMonth.setVisible(true);\n\t\t\t\tlblOutDay.setVisible(true);\n\t\t\t\ttxtOutDay.setVisible(true);\n\t\t\t\tbtnAdd.setVisible(true);\n\t\t\t\treservationsModel.removeAllElements();\n\n\t\t\t\t/////////////////////////////////////\n\t\t\t\t/////////////////////////////////////\n\t\t\t\t//Reading Info From Reservation.txt//\n\t\t\t\t/////////////////////////////////////\n\t\t\t\t/////////////////////////////////////\n\t\t\t\t/**\n\t\t\t\t * First i surround everything is a try.. catch blocks \n\t\t\t\t * then in the try block i declare the file input stream\n\t\t\t\t * then a scanner \n\t\t\t\t * then in a while loop i check if the file has next line \n\t\t\t\t * and a user a delimiter \"-\"\n\t\t\t\t * and it adds it to a new reservation\n\t\t\t\t * then it adds it to the ArrayList reservation\n\t\t\t\t * and it also adds it to the hotel object\n\t\t\t\t * then it checks if it can book that hotel\n\t\t\t\t * and if yes it adds it to the ReservationsModel\n\t\t\t\t */\n\t\t\t\ttry\n\t\t\t\t{\n\t\t\t\t\tFileInputStream fis = new FileInputStream(\"Reservation.txt\");\n\t\t\t\t\tScanner fscan = new Scanner (fis);\n\t\t\t\t\tint INMonth = 0;\n\t\t\t\t\tint INday = 0;\n\t\t\t\t\tint OUTmonth = 0;\n\t\t\t\t\tint OUTday = 0;\n\t\t\t\t\tlong iD = 0;\n\t\t\t\t\twhile (fscan.hasNextLine())\n\t\t\t\t\t{\n\t\t\t\t\t\tScanner ls = new Scanner (fscan.nextLine());\n\t\t\t\t\t\tls.useDelimiter(\"-\");\n\t\t\t\t\t\tiD = Integer.parseInt(ls.next().trim());\n\t\t\t\t\t\tINMonth = Integer.parseInt(ls.next().trim());\n\t\t\t\t\t\tINday = Integer.parseInt(ls.next().trim()); \n\t\t\t\t\t\tOUTmonth = Integer.parseInt(ls.next().trim());\n\t\t\t\t\t\tOUTday = Integer.parseInt(ls.next().trim()); \n\t\t\t\t\t\tr = new Reservation (iD,INMonth, INday, OUTmonth, OUTday);\n\t\t\t\t\t\th.addReservation(new Reservation(iD,INMonth, INday, OUTmonth, OUTday));\n\t\t\t\t\t\tHotel hotel = (Hotel) cbHotelsOptions.getSelectedItem();\n\t\t\t\t\t\tlong hotID = hotel.getUniqueId();\n\t\t\t\t\t\tif(iD == hotID)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\treservationsModel.addElement((new Reservation(iD, INMonth, INday, OUTday)));\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t/**\n\t\t\t\t * The catch block checks to make sure that the file is found\n\t\t\t\t */\n\t\t\t\tcatch( FileNotFoundException fnfe)\n\t\t\t\t{\n\t\t\t\t\tSystem.err.println(\"File not found!\");\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\n\t\t/**\n\t\t * This is the setRenderer to make the hotel appear in the hotelsOptions \n\t\t * just the hotel name.\n\t\t */\n\t\tcbHotelsOptions.setRenderer(new DefaultListCellRenderer() {\n\t\t\t@Override\n\t\t\tpublic Component getListCellRendererComponent(JList<?> list, Object value, int index, boolean isSelected, boolean cellHasFocus)\n\t\t\t{\n\t\t\t\tComponent renderer = super.getListCellRendererComponent(list, value, index, isSelected, cellHasFocus);\n\t\t\t\tif (renderer instanceof JLabel && value instanceof Hotel)\n\t\t\t\t{\n\t\t\t\t\t// Here value will be of the Type 'Hotel'\n\t\t\t\t\t((JLabel) renderer).setText(((Hotel) value).getHotelName());\n\t\t\t\t}\n\t\t\t\treturn renderer;\n\t\t\t}\n\t\t});\n\n\t\t/**\n\t\t * The setCallRenderer is for the reservation's list\n\t\t * it only prints the check-in and check-out info\n\t\t */\n\t\tlstReservation.setCellRenderer(new DefaultListCellRenderer() {\n\t\t\t@Override\n\t\t\tpublic Component getListCellRendererComponent(JList<?> list, Object value, int index, boolean isSelected, boolean cellHasFocus)\n\t\t\t{\n\t\t\t\tComponent renderer = super.getListCellRendererComponent(list, value, index, isSelected, cellHasFocus);\n\t\t\t\tif (renderer instanceof JLabel && value instanceof Reservation)\n\t\t\t\t{\n\t\t\t\t\t// Here value will be of the Type 'Reservation'\n\t\t\t\t\tHotel selectedHotel = (Hotel) cbHotelsOptions.getSelectedItem();\n\t\t\t\t\t((JLabel) renderer).setText(((Reservation) value).getFormattedDisplayString());\n\t\t\t\t}\n\t\t\t\treturn renderer;\n\t\t\t}\n\t\t});\t\n\t}", "@Override\n\tpublic List<Reservation> selectionnerReservations(final ContexteConsommation contexte)\n\t\t\tthrows IllegalArgumentException, ContexteConsommationInvalideException {\n\t\treturn null;\n\t}", "public int getReservationId() { return reservationId; }", "public void setReservationId(int reservationId) {\n\t\tthis.reservationId = reservationId;\n\t}", "private void loadReservation() {\n email = getIntent().getStringExtra(\"USER_EMAIL\");\n list = new ArrayList<>();\n FirebaseFirestore db = FirebaseFirestore.getInstance();\n /*\n Get list reservations of current customer\n */\n db.collection(\"customers\")\n .whereEqualTo(\"customerEmail\", email)\n .get()\n .addOnCompleteListener(new OnCompleteListener<QuerySnapshot>() {\n @Override\n public void onComplete(@NonNull @NotNull Task<QuerySnapshot> task) {\n if (task.isSuccessful() && !task.getResult().isEmpty()) {\n DocumentSnapshot doc = task.getResult().getDocuments().get(0);\n String docID = doc.getId();\n db.collection(\"reservations\")\n .whereEqualTo(\"customerId\", docID)\n .get()\n .addOnCompleteListener(new OnCompleteListener<QuerySnapshot>() {\n @Override\n public void onComplete(@NonNull @NotNull Task<QuerySnapshot> task) {\n if (task.isSuccessful()) {\n for (QueryDocumentSnapshot document : task.getResult()) {\n Reservation res = document.toObject(Reservation.class);\n res.setReservationId(document.getId());\n list.add(res);\n }\n /*\n Binding data to recyclerview\n */\n reserAdap = new ReservationAdapter(list, CancelReservation.this); //Call LecturerAdapter to set data set and show data\n LinearLayoutManager manager = new LinearLayoutManager(CancelReservation.this); //Linear Layout Manager use to handling layout for each Lecturer\n recyclerView.setAdapter(reserAdap);\n recyclerView.setLayoutManager(manager);\n } else {\n\n }\n }\n });\n }\n\n }\n });\n\n }", "public void readReservation(Reservation r) {\n\n\t\tif (r != null){\n\t\t\tSystem.out.println(\"\\nDisplaying Reservation No. \" + r.getResvNo() + \": \\n\");\n\t\t\tSystem.out.format(\"%-15s%-15s%-15s%-15s%-25s%-15s%-15s%-15s%-15s\\n\", \"Guest ID\", \"Num Adult\",\n\t\t\t\t\t\"Num Kid\", \"Room No.\", \"Reservation Status\", \"Check in\", \"Check out\", \"Num of nights\", \"Reservation time\");\n\n\t\t\t\tSystem.out.format(\"%-15d%-15s%-15s%-15s%-25s%-15s%-15s%-15s%-15.8s\\n\", r.getGuestID(),\n\t\t\t\t\t\tr.getAdultNo(), r.getKidNo(), r.getRoomNo(), r.getResvStatus(), r.getDateCheckIn(), r.getDateCheckOut(),\n\t\t\t\t\t\tr.getRoomDays(), r.getResvTime());\n\t\t}\n\t}", "public void doGet(HttpServletRequest req, HttpServletResponse res)\n\t\t\tthrows ServletException, IOException\n\t\t\t{\n\t\tString numS, dateS, heureS;\n\t\tServletOutputStream out = res.getOutputStream(); \n\n\t\tres.setContentType(\"text/html\");\n\n\t\tout.println(\"<HEAD><TITLE> Lister les places disponibles</TITLE></HEAD>\");\n\t\tout.println(\"<BODY bgproperties=\\\"fixed\\\" background=\\\"/images/rideau.JPG\\\">\");\n\t\tout.println(\"<font color=\\\"#FFFFFF\\\"><h1> Obtenir la liste des places disponibles d'une représentation </h1>\");\n\n\t\tnumS\t\t= req.getParameter(\"numS\");\n\t\tdateS\t\t= req.getParameter(\"date\");\n\t\theureS\t\t= req.getParameter(\"heure\");\n\t\tif (numS == null || dateS == null || heureS==null) {\n\t\t\tout.println(\"<font color=\\\"#FFFFFF\\\">Veuillez saisir les informations relatives &agrave; la repr&eacute;sentation dont on souhaite afficher les places disponibles:\");\n\t\t\tout.println(\"<P>\");\n\t\t\tout.print(\"<form action=\\\"\");\n\t\t\tout.print(\"PlaceDisponibleServlet\\\" \");\n\t\t\tout.println(\"method=POST>\");\n\t\t\tout.println(\"Num&eacute;ro de spectacle :\");\n\t\t\tout.println(\"<input type=text size=20 name=numS>\");\n\t\t\tout.println(\"<br>\");\n\t\t\tout.println(\"Date de la repr&eacute;sentation (au format dd-mm-yyyy):\");\n\t\t\tout.println(\"<input type=text size=20 name=date>\");\n\t\t\tout.println(\"<br>\");\n\t\t\tout.println(\"Heure de la repr&eacute;sentation (au format HH:mm):\");\n\t\t\tout.println(\"<input type=text size=20 name=heure>\");\n\t\t\tout.println(\"<br>\");\n\t\t\tout.println(\"<input type=submit>\");\n\t\t\tout.println(\"</form>\");\n\t\t} else {\n\t\t\t// Ajout de la nouvelle représentation.\n\t\t\t//connection à la BD\n\t\t\tString query = \"SELECT noRang, noPlace, numZ, count(numZ) FROM LesPlaces where (noRang, noPlace) NOT IN \"\n\t\t\t\t\t+\"(SELECT noRang, noPlace FROM LesTickets WHERE numS=? AND dateRep=?) \"\n\t\t\t\t\t+ \"GROUP BY (noRang, noPlace, numZ)\";\n\t\t\t\n\t\t\t\n\t\t\t/*Chargement du Driver:*/\ntry{ DriverManager.registerDriver(new oracle.jdbc.driver.OracleDriver()); \n } catch (SQLException ex) {\n Logger.getLogger(ProgrammeServlet.class.getName()).log(Level.SEVERE, null, ex);\n out.println(\"Impossible de charger le Driver\");\n }\n\n\n/* Connexion à la base de données */\nString url = \"jdbc:oracle:thin:@195.220.82.190:1521:ufrima\";\nString utilisateur = \"demarcje\";\nString motDePasse = \"bd2012\";\nConnection connexion = null;\nResultSet results = null; \nPreparedStatement stmt = null;\n\ntry {\nconnexion = DriverManager.getConnection( url, utilisateur, motDePasse );\n/* Ici, nous placons nos requêtes vers la BDD */\n/* ... */\n\n\n\t\t\t\ttry {\n\t\t\t\t\tstmt = connexion.prepareStatement(query);\n\t\t\t\t\t\n\t\t\t\t\tstmt.setInt(1, Integer.valueOf(numS));\n\t\t\t\t\tstmt.setTimestamp(2, new Timestamp((new SimpleDateFormat(\"dd-MM-yyyy HH:mm\")).parse(dateS+\" \"+heureS).getTime()));\n\t\t\t\t\t\n\t\t\t\t\tResultSet result=stmt.executeQuery();\n\t\t\t\t\tString sRang = new String();\n\t\t\t\t\tString sPlace = new String();\n\t\t\t\t\tString sZone = new String();\n\t\t\t\t\tString tmp = new String();\n\t\t\t\t\t\n\t\t\t\t\t//on affiche les places disponibles\n\t\t\t\t\tout.println(\"<p><i><font color=\\\"#FFFFFF\\\"><h2>Liste des place disponibles:</h2></i></p>\");\n\t\t\t\t\twhile( result.next() ){\n\t\t\t\t\t\tsRang=result.getString(1);\n\t\t\t\t\t\tsPlace=result.getString(2);\n\t\t\t\t\t\tsZone=result.getString(3);\n\t\t\t\t\t\t/*if(sRang.equals(tmp)) out.println(\"<p><i><font color=\\\"#FFFFFF\\\">Rang : \"+sRang+\"; Place : \"+sPlace+\"; Zone : \"+sZone+\"</i></p>\");\n\t\t\t\t\t\telse*/ out.println(\"<p><i><font color=\\\"#FFFFFF\\\">Rang : \"+sRang+\"; Place : \"+sPlace+\"; Zone : \"+sZone+\"</i></p>\");\n\t\t\t\t\t\ttmp = result.getString(1);\n\t\t\t\t\t}\n\t\t\t\t\t//on cré un formulaire pour effectuer une réservation\n\t\t\t\t\tout.println(\"<font color=\\\"#FFFFFF\\\">Veuillez saisir les informations relatives &agrave; la réservation :\");\n\t\t\t\t\tout.println(\"<P>\");\n\t\t\t\t\tout.print(\"<form action=\\\"\");\n\t\t\t\t\tout.print(\"ReservationServlet\\\" \");\n\t\t\t\t\tout.println(\"method=POST>\");\n\t\t\t\t\tout.println(\"Num&eacute;ro de spectacle :\");\n\t\t\t\t\tout.println(\"<input type=hidden value=\"+numS+\" size=20 name=numS>\");\n\t\t\t\t\tout.println(\"<br>\");\n\t\t\t\t\tout.println(\"Date de la repr&eacute;sentation (au format dd-mm-yyyy) :\");\n\t\t\t\t\tout.println(\"<input type=hidden value=\"+dateS+\" size=20 name=date>\");\n\t\t\t\t\tout.println(\"<br>\");\n\t\t\t\t\tout.println(\"Heure de la repr&eacute;sentation (au format hh:mm) :\");\n\t\t\t\t\tout.println(\"<input type=hidden value=\"+heureS+\" size=20 name=heure>\");\n\t\t\t\t\tout.println(\"<br>\");\n\t\t\t\t\tout.println(\"Zone désiré :\");\n\t\t\t\t\tout.println(\"<input type=text size=20 name=zone>\");\n\t\t\t\t\tout.println(\"<br>\");\n\t\t\t\t\tout.println(\"<input type=submit>\");\n\t\t\t\t\tout.println(\"</form>\");\n\n\t\t\t\t}\n\t\t\t\tcatch(Exception e){\n\t\t\t\t\tSystem.out.println(\"Exception du a la requete : \"+e);\n\t\t\t\t}\n\t\t\t} catch (SQLException ex) {\n \n }\n\n finally {\n \n if (results != null){\n try{ results.close(); } catch (SQLException ignore) {\n \n }\n }\n if ( stmt != null){\n try{ stmt.close(); } catch (SQLException ignore) {\n \n }\n}\n if ( connexion != null ){\n \n try{\n\n connexion.close(); } catch ( SQLException ignore ) {\n \n}\n}\n}\n }\n\n\t\tout.println(\"<hr><p><font color=\\\"#FFFFFF\\\"><a href=\\\"/admin/admin.html\\\">Page d'administration</a></p>\");\n\t\tout.println(\"<hr><p><font color=\\\"#FFFFFF\\\"><a href=\\\"/index.html\\\">Page d'accueil</a></p>\");\n\t\tout.println(\"</BODY>\");\n\t\tout.close();\n\n\t\t\t}", "public rentForm() {\n initComponents();\n }", "void onPrepareForRender() {\n\t\tcreatePersonsList();\n\n\t\t// If fresh start (ie. not rendering after a redirect), add an example person.\n\n\t\tif (form.isValid()) {\n\t\t\tpersons.set(0, new Person(\"Example\", \"Person\", Regions.EAST_COAST, getTodayDate()));\n\t\t}\n\t}", "protected void processRequest(HttpServletRequest request, HttpServletResponse response)\r\n throws ServletException, IOException, URISyntaxException {\r\n response.setContentType(\"text/html;charset=UTF-8\");\r\n try (PrintWriter out = response.getWriter()) {\r\n /* TODO output your page here. You may use following sample code. */\r\n\r\n String idaseo = request.getParameter(\"IdResidencia\");\r\n String propietario = request.getParameter(\"Propietario\");\r\n String direccion = request.getParameter(\"Direccion\");\r\n String fecha_inicio_contrato = request.getParameter(\"FechaInicioContrato\");\r\n String fecha_final_contrato = request.getParameter(\"FechaFinalContrato\");\r\n String numeroHabitaciones = request.getParameter(\"NumeroHabitaciones\");\r\n int s = 2;\r\n if (idaseo != null\r\n && propietario != null\r\n && direccion != null\r\n && fecha_inicio_contrato != null\r\n && fecha_final_contrato != null\r\n && numeroHabitaciones != null) {\r\n bd.conectar();\r\n s = bd.agregar(Integer.valueOf(idaseo), propietario, direccion, java.sql.Date.valueOf(fecha_inicio_contrato), java.sql.Date.valueOf(fecha_final_contrato), Integer.valueOf(numeroHabitaciones));\r\n bd.desconectar();\r\n\r\n } else {\r\n response.sendRedirect(\"Residencia.html\");\r\n }\r\n if (s == 1) {\r\n response.sendRedirect(\"Home.html\");\r\n } else {\r\n if (s == 0) {\r\n response.setContentType(\"text/html\");\r\n PrintWriter outs4 = response.getWriter();\r\n String docType4\r\n = \"<!DOCTYPE html PUBLIC -//W3C//DTD HTML 4.01//EN http://www.w3.org/TR/html4/strict.dtd>\\n\";\r\n out.println(docType4\r\n + \"<html>\\n\"\r\n + \"<head>\\n\"\r\n + \" <meta content=\\\"text/html; charset=ISO-8859-1\\\"\\n\"\r\n + \" http-equiv=\\\"content-type\\\">\\n\"\r\n + \" <title></title>\\n\"\r\n + \"</head>\\n\"\r\n + \"<body>\\n\"\r\n + \"<form action=\\\"Residencia\\\" name=\\\"Residencia\\\" method=\\\"post\\\">\\n\"\r\n + \" <table style=\\\"text-align: left; width: 100px;\\\" border=\\\"1\\\"\\n\"\r\n + \" cellpadding=\\\"2\\\" cellspacing=\\\"2\\\">\\n\"\r\n + \" <tbody>\\n\"\r\n + \" <tr>\\n\"\r\n + \" <td><img style=\\\"width: 432px; height: 256px;\\\"\\n\"\r\n + \" src=\\\"./Imagenes/Img_AsignarResidencia.jpg\\\"\\n\"\r\n + \" alt=\\\"\\\"></td>\\n\"\r\n + \" <tr>\\n\"\r\n + \" <td>Id duplicado, no se realizo el registro</td>\\n\"\r\n + \" </tr>\\n\"\r\n + \" </tr>\\n\"\r\n + \" <tr>\\n\"\r\n + \" <td>IdResidencia:<input name=\\\"IdResidencia\\\"></td>\\n\"\r\n + \" </tr>\\n\"\r\n + \" <tr>\\n\"\r\n + \" <td>IdResidencia:<input name=\\\"Propietario\\\"></td>\\n\"\r\n + \" </tr>\\n\"\r\n + \" <tr>\\n\"\r\n + \" <td>Compa�ia de Residencia:<input name=\\\"Direccion\\\"></td>\\n\"\r\n + \" </tr>\\n\"\r\n + \" <tr>\\n\"\r\n + \" <td>Fecha Inicio Contrato:<input\\n\"\r\n + \" name=\\\"FechaInicioContrato\\\"></td>\\n\"\r\n + \" </tr>\\n\"\r\n + \" <tr>\\n\"\r\n + \" <td>Fecha Final Contrato:<input\\n\"\r\n + \" name=\\\"FechaFinalContrato\\\"></td>\\n\"\r\n + \" </tr>\\n\"\r\n + \" <tr>\\n\"\r\n + \" <td>Precio Residencia:<input name=\\\"NumeroHabitaciones\\\"></td>\\n\"\r\n + \" </tr>\\n\"\r\n + \" <tr align=\\\"center\\\">\\n\"\r\n + \" <td><input name=\\\"Boton\\\" value=\\\"Ok\\\"\\n\"\r\n + \" type=\\\"submit\\\"></td>\\n\"\r\n + \" </tr>\\n\"\r\n + \" </tbody>\\n\"\r\n + \" </table>\\n\"\r\n + \" <br>\\n\"\r\n + \"</form>\\n\"\r\n + \"</body>\\n\"\r\n + \"</html>\\n\"\r\n + \"\");\r\n\r\n }\r\n\r\n }\r\n }\r\n }", "@RequestMapping(value=\"/room/form\", method=RequestMethod.GET)\r\n\tpublic String getRoomForm(Model model) {\r\n\t\tmodel.addAttribute(\"room\", new Room());\r\n\t\treturn \"roomForm\";\r\n\t}", "void addReservation(ReservationDto reservationDto) ;", "private void showNewForm(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {\n RequestDispatcher dispatcher = request.getRequestDispatcher(\"customer/newCustomer.jsp\");\n dispatcher.forward(request, response);\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 onReserveButtonClick() {\n DialogFragment datePickerFragment = new DatePickerFragment();\n datePickerFragment.show(getActivity().getFragmentManager(), \"datePicker\");\n }", "private void initHotelsAndReservations() \n\t{\n\t\ttry\n\t\t{\n\t\t\tFileInputStream fis = new FileInputStream(\"Hotels.txt\");\n\t\t\tScanner fs = new Scanner(fis);\n\t\t\twhile(fs.hasNextLine())\n\t\t\t{\n\t\t\t\tScanner is = new Scanner(fs.nextLine());\n\t\t\t\tis.useDelimiter(\",\");\n\t\t\t\tint id = Integer.parseInt(is.next().trim());\n\t\t\t\tString name = is.next().trim();\n\t\t\t\tString address = is.next().trim();\n\t\t\t\tString city = is.next().trim();\n\t\t\t\tString state = is.next().trim();\n\t\t\t\tint pricePerNight = Integer.parseInt(is.next().trim());\n\t\t\t\th = new Hotel (id, name, address, city, state, pricePerNight);\n\t\t\t\thotels.add(h);\n\t\t\t}\n\t\t}\n\t\t/**\n\t\t * The catch block checks to make sure that the file is found\n\t\t */\n\t\tcatch( FileNotFoundException fnfe)\n\t\t{\n\t\t\tSystem.err.println(\"File not found!\");\n\t\t}\n\n\t\t/**\n\t\t * Binding hotel reservations to model/JComboBox\n\t\t */\n\t\tfor(Hotel h1: hotels)\n\t\t\thotelsModel.addElement(h1);\n\t\t/**\n\t\t * Binding hotel reservations to model/JList\n\t\t */\n\t\tHotel selectedHotel = (Hotel)cbHotelsOptions.getSelectedItem();\n\t\tfor(Reservation r1 : selectedHotel.getReservations())\n\t\t\treservationsModel.addElement(r1);\n\t}", "public List<TblReservation>getAllDataReservationByPeriode(Date startDate,Date endDate,\r\n RefReservationStatus reservationStatus,\r\n TblTravelAgent travelAgent,\r\n RefReservationOrderByType reservationType,\r\n TblReservation reservation);", "public RentalResponse createReservation(Reservation argRequest) {\r\n\t\t\r\n\t\tRentalResponse response = service.processRequest(argRequest);\r\n\t\t\r\n\t\treturn response;\r\n\t\t\r\n\t}", "public Iterator <R> getAllReservations(){\n IterR iter = new IterR();\n return iter;\n }", "public void seeReservation(RoomList roomList){\n\t\tSystem.out.println(\"What is the name of the guest you wish to check a reservation for ?\");\n\t\tkeyboard.nextLine();\n\t\tString name = keyboard.nextLine();\n\t\tRoom room = null;\n\t\t\n\t\tfor(Room r: roomList.getList()){\n\t\t\tif(!r.isEmpty(r)) {\n\t\t\troom = r.findRoomByName(r, name);\n\t\t\troom.getGuestNames(room);\n\t\t\t}\n\t\t}\n\t}", "@RequestMapping(\"/ShowcompleteReservation\")\r\n public String ShowcompleteReservation(@RequestParam(\"flightId\") Long flightId , ModelMap modelMap )\r\n {\n Flight flight = flightRepository.findOne(flightId);\r\n modelMap.addAttribute(\"flight\",flight);\r\n return \"completeReservation\";\r\n }", "public RentalResponse createReservation(RentalRequest argRequest) {\r\n\t\t\r\n\t\tRentalResponse response = service.processRequest(argRequest);\r\n\t\t\r\n\t\treturn response;\r\n\t\t\r\n\t}", "@Override\n\tprotected void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {\n\t\tHttpSession hpSession = req.getSession();\n\t\tUser u = (User) hpSession.getAttribute(\"user\");\n\t\tString start=req.getParameter(\"Start\");\n\t\tString end=req.getParameter(\"End\");\n\t\tif(start==null||end==null){\n\t\t\tSimpleDateFormat sdf = new SimpleDateFormat(\"yyyyMMdd\");\n\t\t\tjava.util.Date now=new java.util.Date();\n\t\t\tjava.util.Date next=new Date(now.getTime()+24*3600*1000);\n\t\t\tstart=sdf.format(now.getTime());\n\t\t\tend=sdf.format(next.getTime());\n\t\t}\n//\t\t查找需要加上日期\n\n\t\tif (u != null && u.getUserType() == 1) {\n\t\t\tList<Roomdisplay> roomdisplayList = roomdisplayServiceImpl.findAll();\n\t\t\treq.setAttribute(\"roomdisplayList\", roomdisplayList);\n\n\t\t\treq.getRequestDispatcher(resp.encodeURL(\"/jsp/user/reserve.jsp\")).forward(req, resp);\n\t\t} else {\n\t\t\tSystem.out.println(\"ReserveServlet get user failed!\");\n\t\t\treq.getRequestDispatcher(resp.encodeURL(\"/jsp/common/login.jsp\")).forward(req, resp);\n\t\t}\n\n\t}", "@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}", "private void initViews(){\n // Parent View\n view = findViewById(android.R.id.content);\n\n // Initialize toolbar\n cancelBtn = findViewById(R.id.close_btn);\n createBtn = findViewById(R.id.submit_btn);\n TextView toolbarTitle = findViewById(R.id.title);\n toolbarTitle.setText(getString(R.string.create_new_booking));\n\n pickupLocationInput = findViewById(R.id.pickup_location_input);\n destinationInput = findViewById(R.id.destination_input);\n timeInput = findViewById(R.id.time_input);\n noPassengersInput = findViewById(R.id.number_of_passengers_input);\n notesInput = findViewById(R.id.notes_input);\n progressIndicator = findViewById(R.id.progress_indicator_overlay);\n\n pickupLocationInputContainer = findViewById(R.id.pickup_location_input_container);\n destinationInputContainer = findViewById(R.id.destination_input_container);\n timeInputContainer = findViewById(R.id.time_input_container);\n noPassengersInputContainer = findViewById(R.id.number_of_passengers_input_container);\n notesInputContainer = findViewById(R.id.notes_input_container);\n\n\n // Set Default Value of No_Passengers to 1\n noPassengersInput.setText(\"1\");\n\n // Set the default value of desired time to 15 mins from NOW\n Calendar cal = Calendar.getInstance();\n cal.add(Calendar.MINUTE, 15);\n bookingHour = cal.get(Calendar.HOUR_OF_DAY);\n bookingMinute = cal.get(Calendar.MINUTE);\n\n timeInput.setText(getString(R.string.desired_time_format, bookingHour, bookingMinute));\n\n // Add behaviour to relevant views\n noPassengersInput.setOnClickListener(this::showNumberPickerDialog);\n timeInput.setOnClickListener(v -> showTimePicker());\n cancelBtn.setOnClickListener(v -> cancel());\n createBtn.setOnClickListener(v -> createBooking());\n }", "@Operation(\n summary = \"Get a list of all reservations\"\n )\n @ApiResponses(\n @ApiResponse(\n responseCode = \"200\",\n description = \"Successful Response\",\n content = @Content(array = @ArraySchema(schema = @Schema(implementation =\n Reservation.class)))\n )\n )\n @GetMapping(\n path = \"/reservations\",\n produces = APPLICATION_JSON_VALUE\n )\n public ResponseEntity<List<Reservation>> getReservation() {\n List<Reservation> listofReservations = (List<Reservation>) reservationsRepository.findAll();\n return new ResponseEntity(listofReservations, HttpStatus.OK);\n }", "public Reservation makeReservation(Reservation trailRes){\n //Using a for each loop to chekc to see if a reservation can be made or not\n if(trailRes.getName().equals(\"\")) {\n System.out.println(\"Not a valid name\");\n return null;\n }\n \n \n for(Reservation r: listR){\n if(trailRes.getReservationTime() == r.getReservationTime()){\n System.out.println(\"Could not make the Reservation\");\n System.out.println(\"Reservation has already been made by someone else\");\n return null;\n }\n }\n\n //if the time slot is greater than 10 or less than 0, the reservation cannot be made\n if(trailRes.getReservationTime() > 10 || trailRes.getReservationTime() < 0){\n System.out.println(\"Time slot not available\");\n return null;\n }\n\n //check to see if the reservable list is empty or not\n if(listI.isEmpty())\n {\n System.out.println(\"No reservation available\");\n return null;\n }\n\n //find the item and fitnessValue that will most fit our reservation\n Reservable item = listI.get(0);\n int fitnessValue = item.findFitnessValue(trailRes);\n\n //loop through the table list and find the best fit for our reservation\n for(int i = 0; i < listI.size() ; i++){\n if(listI.get(i).findFitnessValue(trailRes) > fitnessValue){\n item = listI.get(i);\n fitnessValue = item.findFitnessValue(trailRes);\n }\n }\n //if we have found a table that works, then we can make our reservation\n if(fitnessValue > 0){\n //add reservation to our internal list\n //point our reservable to the appropriate reservation\n //set the reservable \n //print out the message here not using the iterator\n listR.add(trailRes);\n item.addRes(trailRes);\n trailRes.setMyReservable(item);\n System.out.println(\"Reservation made for \" + trailRes.getName() + \" at time \" + trailRes.getReservationTime() + \", \" + item.getId());\n return trailRes;\n }\n System.out.println(\"No reservation available, number of people in party may be too large\");\n return null; \n }", "protected void processRequest(HttpServletRequest request, HttpServletResponse response)\r\n throws ServletException, IOException, MessagingException {\r\n response.setContentType(\"text/html;charset=UTF-8\");\r\n try (PrintWriter out = response.getWriter()) {\r\n /* TODO output your page here. You may use following sample code. */\r\n out.println(\"<!DOCTYPE html>\");\r\n out.println(\"<html>\");\r\n out.println(\"<head>\");\r\n out.println(\"<title>Servlet reservation</title>\");\r\n out.println(\"</head>\");\r\n out.println(\"<body>\");\r\n HttpSession session = request.getSession();\r\n //String n = (String) session.getAttribute(\"username\");\r\n// out.println(n + \" \" + email);\r\n //String ValidatorEmailMSG = request.getSession().getAttribute(\"ValidatorEmailMSG\").toString();\r\n \r\n if (session.getAttribute(\"username\") == null) {\r\n\r\n String error = \"e\";\r\n HttpSession mailsession = request.getSession();\r\n mailsession.setAttribute(\"error\", error);\r\n response.sendRedirect(\"reservation.jsp\");\r\n } else {\r\n //out.println(\"in\");\r\n int hotelid;\r\n int roomNumber;\r\n Date checkIn;\r\n Date checkOut;\r\n int nights;\r\n double ppn;\r\n double tax;\r\n double total;\r\n int user_id;\r\n String firstName = request.getParameter(\"fName\");\r\n String lastName = request.getParameter(\"lName\");\r\n //String email = request.getParameter(\"email\");\r\n String email = request.getParameter(\"email\");\r\n\r\n String address = request.getParameter(\"address\");\r\n String phone = request.getParameter(\"phone\");\r\n\r\n String city = request.getParameter(\"city\");\r\n String country = request.getParameter(\"country\");\r\n String postalCode = request.getParameter(\"postalCode\");\r\n \r\n user_id = Integer.parseInt((String) request.getParameter((\"user_id\")));\r\n \r\n hotelid = Integer.parseInt((String) request.getParameter((\"hotelid\")));\r\n roomNumber = Integer.parseInt((String) request.getParameter((\"roomNumberSelected\")));\r\n\r\n checkIn = Date.valueOf(request.getParameter(\"checkInForRoom\"));\r\n checkOut = Date.valueOf(request.getParameter(\"checkOutForRoom\"));\r\n\r\n nights = Integer.parseInt(String.valueOf(request.getParameter(\"nights\")));\r\n ppn = Double.parseDouble(String.valueOf(request.getParameter(\"ppn\")));\r\n tax = Double.parseDouble(String.valueOf(request.getParameter(\"tax\")));\r\n total = Double.parseDouble(String.valueOf(request.getParameter(\"total\")));\r\n\r\n String cvv = request.getParameter(\"cvv\");\r\n String ccNumber = request.getParameter(\"ccNumber\");\r\n \r\n //out.println(email + \" \" + firstName + \" \" +lastName );\r\n try {\r\n\r\n Class.forName(\"com.mysql.jdbc.Driver\");\r\n String url = \"jdbc:mysql://localhost:3306/hrsystem\";\r\n String user = \"root\";\r\n String password = \"root\";\r\n Connection Con = null;\r\n Statement Stmt = null;\r\n\r\n Con = DriverManager.getConnection(url, user, password);\r\n Stmt = Con.createStatement();\r\n\r\n Email mail = new Email(\"[email protected]\", \"qwe123@thelover\");\r\n mail.setFrom(\"[email protected]\", \"Hotel Team Work\");\r\n mail.setSubject(\"reservation confirm\");\r\n mail.setContent(\"Confirm Your reservation\\n<a href=https://www.google.com >Click To Confirm Reservation Please</a>\", \"text/html\");\r\n //out.println(\"1\");\r\n mail.addRecipient(email);\r\n mail.send();\r\n int cancel_res = 1;\r\n String line = \"INSERT INTO reservation(user_first_name, user_last_name, user_email, user_address, user_phone, user_city, user_country, postel_code, hotel_hotelid, room_room_id, res_checkIn, res_checkout, res_nights, res_ppn, res_tax, res_total , cancel_res,user_id) VALUES(\"\r\n + \"'\" + firstName + \"',\"\r\n + \"'\" + lastName + \"',\"\r\n + \"'\" + email + \"',\"\r\n + \"'\" + address + \"',\"\r\n + \"'\" + phone + \"',\"\r\n + \"'\" + country + \"',\"\r\n + \"'\" + city + \"',\"\r\n + \"'\" + postalCode + \"',\"\r\n + \"'\" + hotelid + \"',\"\r\n + \"'\" + roomNumber + \"',\"\r\n + \"'\" + checkIn + \"',\"\r\n + \"'\" + checkOut + \"',\"\r\n + \"'\" + nights + \"',\"\r\n + \"'\" + ppn + \"',\"\r\n + \"'\" + tax + \"',\"\r\n + \"'\" + total + \"',\"\r\n + \"'\" + cancel_res + \"',\"\r\n + \"'\" + user_id + \"')\";\r\n int Rows = Stmt.executeUpdate(line);\r\n // out.println(\"2\");\r\n out.println(\"<script>\");\r\n out.println(\"alert('Thank You Please Confirm Your email');\");\r\n out.println(\"location='Index.jsp';\");\r\n out.println(\"</script>\");\r\n // response.sendRedirect(\"index.html\");\r\n\r\n Stmt.close();\r\n Con.close();\r\n } catch (Exception ex) {\r\n ex.printStackTrace();\r\n }\r\n }\r\n out.println(\"</body>\");\r\n out.println(\"</html>\");\r\n }\r\n }", "public List<Reservation> findReservations(ReservableRoomId reservableRoomId) {\n\n return reservationRepository.findByReservableRoomReservableRoomIdOrderByStartTimeAsc(reservableRoomId);\n\n }", "@Autowired\n public ReservationController(ReservationService service) {\n this.service = service;\n }", "@RequestMapping(path = \"/availability\", method = RequestMethod.GET)\n public List<ReservationDTO> getAvailability(\n @RequestParam(value = \"start_date\", required = false)\n @DateTimeFormat(iso = ISO.DATE) LocalDate startDate,\n @RequestParam(value = \"end_date\", required = false)\n @DateTimeFormat(iso = ISO.DATE) LocalDate endDate) {\n\n Optional<LocalDate> optStart = Optional.ofNullable(startDate);\n Optional<LocalDate> optEnd = Optional.ofNullable(endDate);\n\n if (!optStart.isPresent() && !optEnd.isPresent()) {\n //case both are not present, default time is one month from now\n startDate = LocalDate.now();\n endDate = LocalDate.now().plusMonths(1);\n } else if (optStart.isPresent() && !optEnd.isPresent()) {\n //case only start date is present, default time is one month from start date\n endDate = startDate.plusMonths(1);\n } else if (!optStart.isPresent()) {\n //case only end date is present, default time is one month before end date\n startDate = endDate.minusMonths(1);\n } // if both dates are present, do nothing just use them\n\n List<Reservation> reservationList = this.service\n .getAvailability(startDate, endDate);\n\n return reservationList.stream().map(this::parseReservation).collect(Collectors.toList());\n }", "@PostMapping(URLs.SCHEDULE)\n public ModelAndView stationSchedule(@RequestParam(value = \"start\") String stationName,\n @RequestParam(value = \"date\") String date) {\n Map<String, Object> modelMap = new HashMap<>();\n try {\n List<Schedule> sch = scheduleService.getAllTrainsOnStation(stationName, date);\n if (sch.size() == 0) {\n modelMap.put(\"noTrains\", \"true\");\n return new ModelAndView(VIEWs.SCHEDULE, \"model\", modelMap);\n }\n modelMap.put(\"showSchedule\", \"true\");\n modelMap.put(\"scheduleList\", sch);\n return new ModelAndView(VIEWs.SCHEDULE_TABLE, \"model\", modelMap);\n } catch (ParseException ex) {\n log.info(\"PARSE EXCEPTION inside schedule form\");\n modelMap.put(\"parseException\", \"true\");\n return new ModelAndView(VIEWs.SCHEDULE, \"model\", modelMap);\n }\n }", "protected void processRequest(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n\n response.setContentType(\"text/html;charset=UTF-8\");\n try {\n /* In questo caso non controllo che l'utente sia registrato perche boglio far vedere il calendario a tutti\n gli utenti e anche visitatori, tuttavia una sessione mi serve per tenere conto del mese corrente */\n HttpSession session = request.getSession(true);\n \n /* data di visualizzazione presa dalla sessione, se assente mese corrente */\n String strDate =(String) session.getAttribute(\"currentDate\");\n LocalDate visualizedDate;\n if (strDate != null && !strDate.isEmpty()){\n visualizedDate = LocalDate.parse(strDate);\n session.setAttribute(\"currentDate\", strDate);\n } else {\n visualizedDate = LocalDate.now().withDayOfMonth(1);\n session.setAttribute(\"currentDate\", visualizedDate.toString());\n }\n \n /* Gestisco le frecccette di navigazione per spostarmi nel mese \n * se ricevo il parametro azione allora cambio mese in sessione */\n String action = request.getParameter(\"navigationAction\");\n if(action != null && !action.isEmpty()) {\n if(action.equals(\"nextMonth\")){\n visualizedDate = visualizedDate.withMonth(visualizedDate.getMonthValue()+1);\n session.setAttribute(\"currentDate\", visualizedDate.toString());\n } else if(action.equals(\"previousMonth\")) {\n visualizedDate = visualizedDate.withMonth(visualizedDate.getMonthValue()-1);\n session.setAttribute(\"currentDate\", visualizedDate.toString());\n }\n }\n \n /* recupero i dati dal db e se non ci sono problemi restituisco la pagina renderizzata con jsp*/\n CommonResponse res = BookingRepo.getInstance().getSlotCalendar(visualizedDate);\n if(res.result) {\n ArrayList<SlotViewModel> a = (ArrayList<SlotViewModel>) res.payload;\n request.setAttribute(\"fullSlots\", a);\n\n request.getRequestDispatcher(\"CalendarSection.jsp\").forward(request, response);\n } else {\n /* in caso di errore rilancio l'eccezione per visualizzare il messaggio nella pagina di errore */\n throw new Exception(res.message);\n }\n \n } catch (Exception e) {\n /* forward to error page */\n request.setAttribute(\"errorMessage\", e.getMessage());\n request.getRequestDispatcher(\"ErrorHandle.jsp\").forward(request, response);\n System.out.println(e.getMessage());\n }\n\n }", "public Reservation(String userId, Show show, ArrayList<String> reservation) {\r\n this.userId = userId;\r\n this.show = show;\r\n this.seats = reservation;\r\n calculatePrice();\r\n }", "public static void writeReservations() throws Exception {\n\t\tBufferedWriter bw = new BufferedWriter(new FileWriter(reservations)); // Create a new buffered writer\n\n\t\t// We create an iterator to iterate through the Reservation database HashMap\n\t\tIterator hashMapIterator = ReservationManager.getAllReservations().entrySet().iterator();\n\t\twhile (hashMapIterator.hasNext()) {\n\t\t\tMap.Entry mapElement = (Map.Entry) hashMapIterator.next();\n\n\t\t\tString userKey = (String) mapElement.getKey();\n\t\t\tbw.write(\"User: \" + userKey); // Prints the username of the current user\n\t\t\tbw.write(\", Password: \" + UserManager.getUserDataBase().get(userKey));\n\t\t\tbw.newLine();\n\t\t\t// Prints all Reservations of the current user\n\t\t\tfor (Reservation res : ReservationManager.getUserReservations(userKey)) {\n\t\t\t\tbw.write(res.getShow().getMonth() + \" \" + res.getShow().getDate() + \", \" + res.getShow().getYear()\n\t\t\t\t\t\t+ \"; \" + res.getShow().getTime() + \"PM. \" + \"Seats reserved: \" + res.getSeats().toString());\n\t\t\t\tbw.newLine();\n\n\t\t\t}\n\t\t\tbw.newLine();\n\t\t\tbw.newLine();\n\t\t}\n\n\t\tbw.close();\n\t}", "@Override\r\n protected void doPost(HttpServletRequest request, HttpServletResponse response)\r\n throws ServletException, IOException {\r\n try {\r\n processRequest(request, response);\r\n } catch (MessagingException ex) {\r\n Logger.getLogger(reservation.class.getName()).log(Level.SEVERE, null, ex);\r\n }\r\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 }", "protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {\n\t\tMap<Long,Integer>gelukteReserveringen=(Map<Long,Integer>) request.getSession().getAttribute(\"gelukteReserveringen\");\n\t\tMap<Long,Integer>mislukteReserveringen=(Map<Long,Integer>) request.getSession().getAttribute(\"mislukteReserveringen\");\n\t\t//reserveringen gesorteerd op datum in een lijst stoppen\n\t\tList<Reservering> gelukteReservatieLijst=new ArrayList<>();\n\t\tList<Reservering> mislukteReservatieLijst=new ArrayList<>();\n\t\tfor(Entry<Long,Integer> entry:gelukteReserveringen.entrySet()){\n\t\t\tVoorstelling voorstelling=voorstellingsDAO.findByPK(entry.getKey().intValue());\n\t\t\tReservering reservering=new Reservering(voorstelling, entry.getValue());\n\t\t\tgelukteReservatieLijst.add(reservering);\n\t\t}\n\t\tfor(Entry<Long,Integer> entry:mislukteReserveringen.entrySet()){\n\t\t\tVoorstelling voorstelling=voorstellingsDAO.findByPK(entry.getKey().intValue());\n\t\t\tReservering reservering=new Reservering(voorstelling, entry.getValue());\n\t\t\tmislukteReservatieLijst.add(reservering);\n\t\t}\n\t\tCollections.sort(gelukteReservatieLijst, Reservering.getDatumComparator()); \n\t\tCollections.sort(mislukteReservatieLijst,Reservering.getDatumComparator());\n\t\trequest.setAttribute(\"gelukteReservatieLijst\", gelukteReservatieLijst);\n\t\trequest.setAttribute(\"mislukteReservatieLijst\", mislukteReservatieLijst);\n\t\trequest.getRequestDispatcher(VIEW).forward(request, response);\n\t\t\n\t}", "@RequestMapping(value = \"/register\", method = RequestMethod.GET)\n public ModelAndView displayRegisterForm() {\n return new ModelAndView(\"registerForm\", \"customer\", new Customer());\n }", "public List<ReservationModel> getReservationsByDoctorAndTimeSlot(Integer doctorId, String startDate,\n\t\t\tString startTime) {\n\t\tList<ReservationModel> result = new ArrayList<ReservationModel>();\n\t\tList<Reservation> reservationsList = this.reservationRepository.findByDoctorIdAndTimeSlot(doctorId, startDate,\n\t\t\t\tstartTime);\n\t\tif (reservationsList != null) {\n\t\t\tfor (Reservation reservation : reservationsList) {\n\t\t\t\tresult.add(reservation.toModel(this.mapper));\n\t\t\t}\n\t\t}\n\t\treturn result;\n\t}", "@Override\r\n\tpublic List<Reservation> rechercherReservation(Voyage v, Client c) {\n\t\treturn null;\r\n\t}", "@Override\n public Reservation call() throws ReservationNotCreatedException {\n return reservationService.create(reservation);\n }", "public static Result startNewForm() {\r\n\t\tString formName = ChangeOrderForm.NAME;\r\n\t\tDecision firstDecision = CMSGuidedFormFill.startNewForm(formName,\r\n\t\t\t\tCMSSession.getEmployeeName(), CMSSession.getEmployeeId());\r\n\t\treturn ok(backdrop.render(firstDecision));\r\n\t}", "@Override\n\tpublic List<ReservationDetails> getMyReservations(User user) {\n\t\t\n\t\t\n\t\treturn rdDAO.getMyReservations(user);\n\t}", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n View view = inflater.inflate(R.layout.fragment_flights, container, false);\n\n //initialization\n tvDate = view.findViewById(R.id.tvSearchDate);\n tvError = view.findViewById(R.id.emsgNoFlights);\n numberPicker = view.findViewById(R.id.npTravellers);\n fabSearch = view.findViewById(R.id.fabSearch);\n searchLayout = view.findViewById(R.id.layoutSearchFlights);\n listingsLayout = view.findViewById(R.id.layoutViewFlights);\n rvFlights = view.findViewById(R.id.rvFlights);\n spnSource = view.findViewById(R.id.spnSource);\n spnDestination = view.findViewById(R.id.spnDestination);\n\n tvDate.setOnClickListener(this);\n fabSearch.setOnClickListener(this);\n\n numberPicker.setMinValue(1);\n numberPicker.setMaxValue(10);\n numberPicker.setOnValueChangedListener(new NumberPicker.OnValueChangeListener() {\n @Override\n public void onValueChange(NumberPicker picker, int oldVal, int newVal) {\n passengerCount = picker.getValue();\n }\n });\n\n database = new Database(getActivity());\n flightsList = new ArrayList<>();\n linearLayoutManager = new LinearLayoutManager(getActivity(), LinearLayoutManager.VERTICAL, false);\n rvFlights.setLayoutManager(linearLayoutManager);\n\n //insert data into tables\n database.insertIntoFlight();\n database.insertIntoAirport();\n\n //get airports and load into adapter\n ArrayAdapter<String> spinnerAdapter = new ArrayAdapter<>(getActivity(), android.R.layout.simple_spinner_item, database.getAirports());\n spnSource.setAdapter(spinnerAdapter);\n spnDestination.setAdapter(spinnerAdapter);\n\n return view;\n }", "@RequestMapping(value = {\"/reservations/reserve/step3_1/{id}\"}, method =RequestMethod.POST)\n public ModelAndView reservationStep3_1(@PathVariable String id,@RequestParam String selectedCustomerId){\n\n ReservationInProgress reservationInProgress=reservationService.addCustomerToReservationInProgess(id, selectedCustomerId);\n\n ModelAndView model = new ModelAndView(\"reservation_confirm\");\n model.addObject(\"progressId\",id);\n model.addObject(\"reservationInProgress\",reservationInProgress);\n\n Date fromDate=new Date(reservationInProgress.getDateFrom());\n Date toDate=new Date(reservationInProgress.getDateTo()+CommonUtils.DAY_IN_MS);\n\n model.addObject(\"formattedDateFrom\", CommonUtils.getGermanWeekday(fromDate)+\" \"+CommonUtils.dateFormatter.format(fromDate));\n model.addObject(\"formattedDateTo\",CommonUtils.getGermanWeekday(toDate)+\" \"+CommonUtils.dateFormatter.format(toDate));\n\n return model;\n }", "public void setReservationTime(String reservationTime) {\n this.reservationTime = reservationTime;\n }", "public ReservaBean() {\r\n nrohabitacion=1;\r\n createLista(nrohabitacion);\r\n editable=true;\r\n sino=\"\";\r\n \r\n reserva = new TReserva();\r\n }", "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 }", "@Override\n protected void doPost(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n processRequest(request, response);\n String accion=request.getParameter(\"accion\");\n HttpSession session = request.getSession(true); // reusar\n switch (accion){\n case \"Reservar\":\n request.getRequestDispatcher(\"reservar.jsp\").forward(request, response);\n break;\n case \"ListarReservas\":\n //Buscar al cliente logeado\n String emailC=String.valueOf(session.getAttribute(\"email\"));\n ClienteDAO clDAO = new ClienteDAO();\n int rutSes = clDAO.traerCliente(emailC).getRut_cliente();\n \n //Listar las reservas del cliente\n List<Reserva>datos=resDAO.listarReservas(rutSes);\n System.out.println(Arrays.toString(datos.toArray()));\n request.setAttribute(\"datos\", datos);\n request.getRequestDispatcher(\"panelCliente.jsp\").forward(request, response);\n resDAO.listarReservas(rutSes);\n break;\n case \"Volver\":\n request.getRequestDispatcher(\"Resv?accion=ListarReservas\").forward(request, response);\n break;\n case \"Salir\":\n //Cerrar sesión\n session.removeAttribute(\"email\");\n response.sendRedirect(request.getContextPath() + \"/index.jsp\");\n break;\n case \"ModificarVentana\":\n request.getRequestDispatcher(\"modificarCliente.jsp\").forward(request, response);\n case \"MenuComprar\":\n request.getRequestDispatcher(\"menu_comprar.jsp\").forward(request, response);\n case \"PanelCliente\":\n request.getRequestDispatcher(\"Resv?accion=ListarReservas\").forward(request, response);\n case \"MenuCarro\":\n request.getRequestDispatcher(\"menu_carro.jsp\").forward(request, response);\n case \"Inicio\":\n request.getRequestDispatcher(\"Inicio.jsp\").forward(request, response);\n case \"Cancelar\":\n HorarioReservaDAO hrDAO = new HorarioReservaDAO();\n //Recuperar datos\n int id=Integer.parseInt(request.getParameter(\"id\"));\n String emailBuscar = String.valueOf(session.getAttribute(\"email\"));\n Date fechaActual = new Date(System.currentTimeMillis());\n Date fechaReservaExistente = resDAO.traerReserva(id).getFecha_reserva();\n int diferenciaDias = (int)((fechaReservaExistente.getTime() - fechaActual.getTime()) / (1000 * 60 * 60 * 24));\n \n //Condición para saber si la reserva se está cancelando el día antes o no\n if(diferenciaDias>1)\n {\n //Setear datos para que el correo recupere la información del cliente\n c.setRut_cliente(cDAO.traerCliente(emailBuscar).getRut_cliente());\n c.setDigito_verificador_cliente(cDAO.traerCliente(emailBuscar).getDigito_verificador_cliente());\n c.setNombre_cliente(String.valueOf(cDAO.traerCliente(emailBuscar).getNombre_cliente()));\n c.setPapellido_cliente(String.valueOf(cDAO.traerCliente(emailBuscar).getPapellido_cliente()));\n c.setSapellido_cliente(String.valueOf(cDAO.traerCliente(emailBuscar).getSapellido_cliente()));\n\n r.setFecha_registro(resDAO.traerReserva(id).getFecha_registro());\n r.setFecha_reserva(resDAO.traerReserva(id).getFecha_reserva());\n r.setRut_solicitante(resDAO.traerReserva(id).getRut_solicitante());\n r.setMesas_id_mesa(resDAO.traerReserva(id).getMesas_id_mesa());\n r.setHorario_reservas_id_horario_reserva(resDAO.traerReserva(id).getHorario_reservas_id_horario_reserva());\n int id_horario = resDAO.traerReserva(id).getHorario_reservas_id_horario_reserva();\n System.out.println(id_horario);\n String horario = hrDAO.recuperarHorario(id_horario).getHorario_reserva();\n r.setHorario_reserva(horario);\n System.out.println(horario);\n\n //Ejecutar las acciones\n resDAO.eliminarReserva(id);\n email.sendEmailReservaCancelada(c, r, emailBuscar);\n request.getRequestDispatcher(\"Resv?accion=ListarReservas\").forward(request, response);\n }else{\n boolean error = true;\n request.setAttribute(\"ErrorCancelar\", error);\n request.getRequestDispatcher(\"Resv?accion=ListarReservas\").forward(request, response);\n }\n break;\n case \"Registrar\":\n ClienteDAO cliDAO = new ClienteDAO();\n ReservaDAO resDAO = new ReservaDAO();\n HorarioReservaDAO horDAO = new HorarioReservaDAO();\n //Recuperar variables del formulario y el resto de datos\n HttpSession sessionReservar = request.getSession(true); // reusar\n String emailCliente=String.valueOf(sessionReservar.getAttribute(\"email\"));\n int rutSession = cliDAO.traerCliente(emailCliente).getRut_cliente();\n String fechaRegistro=java.time.LocalDate.now().toString();\n Date fechaReserva=Date.valueOf(request.getParameter(\"fechaReserva\"));\n int horarioReserva=Integer.parseInt(request.getParameter(\"horarioReserva\"));\n int idMesa=Integer.parseInt(request.getParameter(\"idMesa\"));\n String horario = horDAO.recuperarHorario(horarioReserva).getHorario_reserva();\n \n //Variables para determinar si la reserva ya está creada\n String fechaReservada = String.valueOf(resDAO.traerReservaPorFecha(fechaReserva).getFecha_reserva());\n String fechaReservadaEscogida=request.getParameter(\"fechaReserva\");\n int horarioReservado = resDAO.traerReservaPorFecha(fechaReserva).getHorario_reservas_id_horario_reserva();\n int MesaReservada = resDAO.traerReservaPorFecha(fechaReserva).getMesas_id_mesa();\n\n //Condición para validar si la reserva está creada o no\n if(horarioReserva==0 || idMesa==0){\n boolean error = true;\n request.setAttribute(\"errorData\", error);\n request.getRequestDispatcher(\"reservar.jsp\").forward(request, response);\n }else{\n if(fechaReservadaEscogida.equals(fechaReservada) && horarioReserva==horarioReservado && idMesa==MesaReservada){\n boolean error = true;\n request.setAttribute(\"ErrorReservar\", error);\n request.getRequestDispatcher(\"reservar.jsp\").forward(request, response);\n }else{\n c.setRut_cliente(rutSession);\n c.setDigito_verificador_cliente(String.valueOf(sessionReservar.getAttribute(\"dv\")));\n c.setNombre_cliente(String.valueOf(sessionReservar.getAttribute(\"nombre\")));\n c.setPapellido_cliente(String.valueOf(sessionReservar.getAttribute(\"papellido\")));\n c.setSapellido_cliente(String.valueOf(sessionReservar.getAttribute(\"sapellido\"))); \n\n r.setFecha_registro(Date.valueOf(fechaRegistro));\n r.setFecha_reserva(fechaReserva);\n r.setRut_solicitante(rutSession);\n r.setMesas_id_mesa(idMesa);\n r.setHorario_reservas_id_horario_reserva(horarioReserva);\n r.setHorario_reserva(horario);\n\n resDAO.crearReserva(r);\n email.sendEmailReserva(c, r, emailCliente);\n request.getRequestDispatcher(\"Resv?accion=ListarReservas\").forward(request, response);\n }\n }\n break;\n default:\n throw new AssertionError();\n }\n }", "public ViewBookings() {\n initComponents();\n showCBooking();\n showBookingH();\n \n }" ]
[ "0.65705824", "0.6216969", "0.6172476", "0.61408156", "0.59817064", "0.59588397", "0.5864783", "0.57553303", "0.573267", "0.57218057", "0.56306875", "0.5630168", "0.55585897", "0.5529961", "0.5475444", "0.5469221", "0.54292214", "0.5381031", "0.5341029", "0.53310263", "0.53225046", "0.53175455", "0.52971876", "0.52928233", "0.5276917", "0.52751786", "0.52700484", "0.52124435", "0.520114", "0.5191997", "0.51811713", "0.5153713", "0.51319027", "0.5120792", "0.508685", "0.5080576", "0.50562364", "0.50356275", "0.5030349", "0.5026245", "0.50216156", "0.50173205", "0.501246", "0.5010523", "0.5009819", "0.5007554", "0.499126", "0.4964567", "0.49618202", "0.4957866", "0.49522316", "0.4947663", "0.49450114", "0.49438664", "0.49354276", "0.49340576", "0.49334612", "0.4910503", "0.49028772", "0.49013233", "0.48756087", "0.48751092", "0.48738208", "0.48707184", "0.48642448", "0.48624545", "0.48569232", "0.48557988", "0.48473996", "0.48360157", "0.48328993", "0.48286235", "0.48285386", "0.48143172", "0.48133498", "0.4810429", "0.48049733", "0.48042032", "0.47979182", "0.47958076", "0.47954237", "0.47788122", "0.47766608", "0.47734854", "0.47732365", "0.47647762", "0.4762169", "0.47564447", "0.47490323", "0.47444192", "0.47440568", "0.4739667", "0.47356763", "0.47353682", "0.47345918", "0.47336227", "0.4731582", "0.4731536", "0.4727909", "0.47278562" ]
0.6932394
0
/ This method is called when a POST request is sent to the url /reservations/form. This method evaluates the recieved date from the form and prepares a List containing all the free rooms and all the reserved rooms on the recieved date
@RequestMapping(value="/reservations/form", method=RequestMethod.POST) public String getRoomsFromTo(@Valid @ModelAttribute("onDate") Reservation reservation, BindingResult bindingResult, Model model) { this.reservationValidator.adminValidate(reservation, bindingResult); if(!bindingResult.hasErrors()) { LocalDate localDate= reservation.getCheckIn(); model.addAttribute("onDate", reservation.getCheckIn()); model.addAttribute("freeRooms", this.roomService.getFreeOn(localDate)); model.addAttribute("reservedRooms", this.roomService.getReservedOn(localDate)); return "roomsAdmin"; } return "reservationsForm"; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@GetMapping\r\n public String getReservations(@RequestParam(value = \"date\", required = false) String dateString,\r\n Model model,\r\n HttpServletRequest request) {\n LocalDate date = DateUtils.createDateFromDateString(dateString);\r\n List<RoomReservation> roomReservations = reservationService.getRoomReservationForDate(date);\r\n model.addAttribute(\"roomReservations\", roomReservations);\r\n return \"reservations\";\r\n// return new ResponseEntity<>(roomReservations, HttpStatus.OK);\r\n }", "@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}", "public List<Room> getReservedOn(LocalDate of) {\r\n\t\tList<Room> l= new ArrayList<>(new HashSet<Room>(this.roomRepository.findByReservationsIn(\r\n\t\t\t\tthis.reservationService.getFromTo(of, of))));\r\n\t\treturn l;\r\n\t}", "public List<Reservation> findReservations(ReservableRoomId reservableRoomId) {\n\n return reservationRepository.findByReservableRoomReservableRoomIdOrderByStartTimeAsc(reservableRoomId);\n\n }", "List<Reservation> trouverlisteDeReservationAyantUneDateDenvoieDeMail();", "@CrossOrigin(origins = \"http//localhost:4200\")\n\t@RequestMapping(value = \"/api/availableRooms\", method = RequestMethod.POST)\n\tpublic List<HospitalRoom> availableRooms(@RequestBody SurgeryDTO surgeryDTO) throws ParseException {\n\t\tList<HospitalRoom> ret = new ArrayList<>();\n\t\tSurgery surgery = null;\n\t\ttry {\n\t\t\tsurgery = ss.findById(surgeryDTO.getId());\n\t\t} catch (Exception e) {\n\t\t\treturn null;\n\t\t}\n\n\t\tClinic clinic = surgery.getClinic();\n\t\t// Uzimamo milisekunde kad je zakazano\n\t\tSimpleDateFormat dateFormat = new SimpleDateFormat(\"yyyy-MM-dd'T'HH:mm\");\n\t\tDate date = dateFormat.parse(surgeryDTO.getDate());\n\t\t// Prolazimo kroz sve sale i gledamo koja je slobodna u tom trenutku\n\t\tList<HospitalRoom> allRooms = hrs.findByClinicId(surgery.getClinic().getId());\n\t\tfor (HospitalRoom hospitalRoom : allRooms) {\n\t\t\tboolean nadjenaOperacijaKojaJeUTomTerminu = false;\n\t\t\t// Proveravamo da li je zakazana neka operacija tada\n\t\t\tList<Surgery> roomSurgeries = ss.findByHospitalId(hospitalRoom.getId());\n\t\t\tfor (Surgery s : roomSurgeries) {\n\t\t\t\tif (nadjenaOperacijaKojaJeUTomTerminu == false) {\n\t\t\t\t\t// poredim datum moje operacije i datum operacije u ovom for-u\n\t\t\t\t\tif (surgery.getDate().equals(s.getDate())) {\n\t\t\t\t\t\tnadjenaOperacijaKojaJeUTomTerminu = true;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tList<Appointment> appsRoom = this.as.findByHospitalRoomId(hospitalRoom.getId());\n\t\t\tfor (Appointment appointment : appsRoom) {\n\t\t\t\tif (nadjenaOperacijaKojaJeUTomTerminu == false) {\n\t\t\t\t\t// Provaravamo datum moje operacije i datum operacije, ako je 0 onda su jednaki\n\t\t\t\t\tif (surgery.getDate().equals(appointment.getDate())) {\n\t\t\t\t\t\t// Da li se poklapaju satnice\n\t\t\t\t\t\tnadjenaOperacijaKojaJeUTomTerminu = true;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (!nadjenaOperacijaKojaJeUTomTerminu)\n\t\t\t\tret.add(hospitalRoom);\n\t\t\tSet<Appointment> roomAppointments = hospitalRoom.getAppointments();\n\t\t}\n\t\treturn ret;\n\t}", "public void readReservationList() {\n\n\t\tif (rList.size() == 0) {\n\t\t\tSystem.out.println(\"No reservations available!\");\n\t\t} else{\n\t\t\tSystem.out.println(\"\\nDisplaying Reservation List: \\n\");\n\t\t\tSystem.out.format(\"%-20s%-15s%-15s%-15s%-20s%-35s%-25s%-25s%-15s\\n\", \"Reservation No.\", \"Guest ID\", \"Num Adult\",\n\t\t\t\t\t\"Num Kid\", \"Room No.\", \"Reservation Status\", \"Check in\", \"Check out\", \"Reservation time\");\n\n\t\t\tfor (Reservation r : rList) {\n\t\t\t\tSystem.out.format(\"%-20d%-15s%-15s%-15s%-20s%-35s%-25s%-25s%-15.8s\\n\", r.getResvNo(), r.getGuestID(),\n\t\t\t\t\t\tr.getAdultNo(), r.getKidNo(), r.getRoomNo(), r.getResvStatus(), r.getDateCheckIn(), r.getDateCheckOut(),\n\t\t\t\t\t\tr.getResvTime());\n\t\t\t}\n\t\t}\n\t}", "public static List<ReserveTime> getUnitReservedTimesBetweenDays(ReserveTimeForm reserveTimeForm)\n\t{\n\t\tConnection conn = DBConnection.getConnection();\n\t\tList<ReserveTime> reserveTimes = new ArrayList<>();\n\t\tString middleQuery = reserveTimeForm.getDayNumbers() == null\n\t\t\t\t|| reserveTimeForm.getDayNumbers().isEmpty()\n\t\t\t\t?\n\t\t\t\t\"\"\n\t\t\t\t:\n\t\t\t\tgetToBeDeletedDayListMiddleQuery(reserveTimeForm.getDayNumbers());\n\t\ttry {\n\t\t\tStatement stmt = conn.createStatement();\n\t\t\tString command = \"SELECT\" +\n\t\t\t\t\t\" * FROM\" +\n\t\t\t\t\t\" RESERVETIMES rt , calendar cal\" +\n\t\t\t\t\t\" WHERE\" +\n\t\t\t\t\t\" rt.DAY_ID = cal.ID\" +\n\t\t\t\t\t\" AND\" +\n\t\t\t\t\t\" rt.STATUS = \" +\n\t\t\t\t\tReserveTimeStatus.RESERVED.getValue() +\n\t\t\t\t\t\" AND rt.UNIT_ID = \" +\n\t\t\t\t\treserveTimeForm.getUnitID() +\n\t\t\t\t\t\" AND rt.DAY_ID BETWEEN \" +\n\t\t\t\t\treserveTimeForm.getStartDate() +\n\t\t\t\t\t\" AND \" +\n\t\t\t\t\treserveTimeForm.getEndDate() +\n\t\t\t\t\tmiddleQuery;\n\t\t\tResultSet rs = stmt.executeQuery(command);\n\t\t\tfillReserveTimeList(rs, reserveTimes);\n\t\t}catch(SQLException e) {\n\t\t\tLogger.getLogger(\"Exception\").log(Level.SEVERE, \"Exception \" + e);\n\t\t\treturn null;\n\t\t}finally {\n\t\t\tif(conn != null) {\n\t\t\t\ttry {\n\t\t\t\t\t\tconn.close();\n\t\t\t\t} catch (SQLException e) {\n\t\t\t\t\tLogger.getLogger(\"Exception\").log(Level.SEVERE, \"Exception \" + e);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn reserveTimes;\n\t}", "public List<TblReservation>getAllDataReservationByPeriode(Date startDate,Date endDate,\r\n RefReservationStatus reservationStatus,\r\n TblTravelAgent travelAgent,\r\n RefReservationOrderByType reservationType,\r\n TblReservation reservation);", "public GenericResponse<Set<Room>> findAvailableRooms(LocalDate bookingDate) {\n logger.info(String.format(\"Booking date: %s\", bookingDate));\n\n GenericResponse genericResponse = HotelBookingValidation.validateBookingDate(logger, bookingDate);\n if (genericResponse != null) {\n return genericResponse;\n }\n\n Set<Room> availableRooms =\n hotel.getRooms()\n .stream()\n .filter(\n room -> !hotel.getBookings().containsKey(\n BookingRoom.NewBuilder().withRoom(room).withBookingDate(bookingDate).build()\n )\n )\n .collect(Collectors.toSet());\n return GenericResponseUtils.generateFromSuccessfulData(availableRooms);\n }", "@RequestMapping(path = \"/availability\", method = RequestMethod.GET)\n public List<ReservationDTO> getAvailability(\n @RequestParam(value = \"start_date\", required = false)\n @DateTimeFormat(iso = ISO.DATE) LocalDate startDate,\n @RequestParam(value = \"end_date\", required = false)\n @DateTimeFormat(iso = ISO.DATE) LocalDate endDate) {\n\n Optional<LocalDate> optStart = Optional.ofNullable(startDate);\n Optional<LocalDate> optEnd = Optional.ofNullable(endDate);\n\n if (!optStart.isPresent() && !optEnd.isPresent()) {\n //case both are not present, default time is one month from now\n startDate = LocalDate.now();\n endDate = LocalDate.now().plusMonths(1);\n } else if (optStart.isPresent() && !optEnd.isPresent()) {\n //case only start date is present, default time is one month from start date\n endDate = startDate.plusMonths(1);\n } else if (!optStart.isPresent()) {\n //case only end date is present, default time is one month before end date\n startDate = endDate.minusMonths(1);\n } // if both dates are present, do nothing just use them\n\n List<Reservation> reservationList = this.service\n .getAvailability(startDate, endDate);\n\n return reservationList.stream().map(this::parseReservation).collect(Collectors.toList());\n }", "public List<Integer> getBookedRooms(Date fromDate, Date toDate)\r\n {\r\n String fDate = DateFormat.getDateInstance(DateFormat.SHORT).format(fromDate);\r\n String tDate = DateFormat.getDateInstance(DateFormat.SHORT).format(toDate);\r\n \r\n List<Integer> bookedRooms = new LinkedList<>();\r\n \r\n Iterator<Booking> iter = bookings.iterator();\r\n \r\n while(iter.hasNext())\r\n {\r\n Booking booking = iter.next();\r\n String bookingFromDate = DateFormat.getDateInstance(DateFormat.SHORT).format\r\n (booking.getFromDate());\r\n \r\n String bookingToDate = DateFormat.getDateInstance(DateFormat.SHORT).format\r\n (booking.getToDate());\r\n \r\n if(!booking.getCancelled() && !(fDate.compareTo(bookingToDate) == 0) \r\n && fDate.compareTo(bookingToDate) <= 0 &&\r\n bookingFromDate.compareTo(fDate) <= 0 && bookingFromDate.compareTo(tDate) <= 0)\r\n { \r\n List<Integer> b = booking.getRoomNr();\r\n bookedRooms.addAll(b);\r\n }\r\n }// End of while\r\n \r\n return bookedRooms;\r\n }", "@Override\n\tpublic ArrayList<Reservation> getReservationsByDate(Date date, int duration) {\n\t\treturn null;\n\t}", "public static List<ReserveTime> getUnitMiddayReservedTimesBetweenDays(ReserveTimeForm reserveTimeForm) {\n\t\tConnection conn = DBConnection.getConnection();\n\t\tList<ReserveTime> reserveTimes = new ArrayList<>();\n\t\tString middleQuery = reserveTimeForm.getDayNumbers() == null\n\t\t\t\t|| reserveTimeForm.getDayNumbers().isEmpty()\n\t\t\t\t?\n\t\t\t\t\"\"\n\t\t\t\t:\n\t\t\t\tgetToBeDeletedDayListMiddleQuery(reserveTimeForm.getDayNumbers());\n\t\ttry {\n\t\t\tStatement stmt = conn.createStatement();\n\t\t\tString command = \"SELECT\" +\n\t\t\t\t\t\" * FROM\" +\n\t\t\t\t\t\" RESERVETIMES rt, calendar cal\" +\n\t\t\t\t\t\" WHERE\" +\n\t\t\t\t\t\" rt.DAY_ID = cal.ID AND \" +\n\t\t\t\t\t\" rt.STATUS = \" +\n\t\t\t\t\tReserveTimeStatus.RESERVED.getValue() +\n\t\t\t\t\t\" AND rt.UNIT_ID = \" +\n\t\t\t\t\treserveTimeForm.getUnitID() +\n\t\t\t\t\t\" AND rt.DAY_ID BETWEEN \" +\n\t\t\t\t\treserveTimeForm.getStartDate() +\n\t\t\t\t\t\" AND \" +\n\t\t\t\t\treserveTimeForm.getEndDate() +\n\t\t\t\t\t\" AND rt.MIDDAY_ID = \" + reserveTimeForm.getMidday().getValue() +\n\t\t\t\t\tmiddleQuery;\n\t\t\tResultSet rs = stmt.executeQuery(command);\n\t\t\tfillReserveTimeList(rs, reserveTimes);\n\t\t}catch(SQLException e) {\n\t\t\tLogger.getLogger(\"Exception\").log(Level.SEVERE, \"Exception \" + e);\n\t\t\treturn null;\n\t\t}finally {\n\t\t\tif(conn != null) {\n\t\t\t\ttry {\n\t\t\t\t\tconn.close();\n\t\t\t\t} catch (SQLException e) {\n\t\t\t\t\tLogger.getLogger(\"Exception\").log(Level.SEVERE, \"Exception \" + e);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn reserveTimes;\n\t}", "@RequestMapping(value = \"/createReservation.htm\", method = RequestMethod.POST)\n\tpublic ModelAndView createReservation(HttpServletRequest request) {\n\t\tModelAndView modelAndView = new ModelAndView();\t\n\t\t\n\t\tif(request.getSession().getAttribute(\"userId\") != null){\n\t\t\n\t\t\t\n\t\t\tBank bank = bankDao.retrieveBank(Integer.parseInt(request.getParameter(\"bankId\")));\t\t\n\t\t\tUser user = userDao.retrieveUser(Integer.parseInt(request.getParameter(\"id\")));\n\t\t\t\n\t\t\t\n\t\t\tNotes notes5 = noteskDao.retrieveNotes(500);\n\t\t\tNotes notes10 = noteskDao.retrieveNotes(1000);\n\t\t\t\n\t\t\tint quantity5 = Integer.parseInt(request.getParameter(\"five\"));\n\t\t\tint quantity10 = Integer.parseInt(request.getParameter(\"thousand\"));\n\t\t\t\n\t\t\t\n\t\t\tReservationDetailsId reservationDetailsId5 = new ReservationDetailsId();\n\t\t\treservationDetailsId5.setNotesId(notes5.getId());\n\t\t\treservationDetailsId5.setQuantity(quantity5);\n\t\t\t\n\t\t\tReservationDetailsId reservationDetailsId10 = new ReservationDetailsId();\n\t\t\treservationDetailsId10.setNotesId(notes10.getId());\n\t\t\treservationDetailsId10.setQuantity(quantity10);\n\t\t\t\n\t\t\t\n\t\t\tReservationDetails reservationDetails5= new ReservationDetails();\n\t\t\treservationDetails5.setId(reservationDetailsId5);\n\t\t\t\n\t\t\t\n\t\t\tReservationDetails reservationDetails10= new ReservationDetails();\n\t\t\treservationDetails10.setId(reservationDetailsId10);\n\t\t\t\n\t\t\t\n\t\t\tReservation reservation = new Reservation();\t\n\t\t\treservation.setBank(bank);\n\t\t\treservation.setDate(request.getParameter(\"date\"));\n\t\t\treservation.setTimeslot(request.getParameter(\"timeslot\"));\n\t\t\treservation.setUser(user);\n\t\t\treservation.setStatus(\"incomplete\");\n\t\t\treservation.getReservationDetailses().add(reservationDetails5);\n\t\t\treservation.getReservationDetailses().add(reservationDetails10);\n\t\t\t\n\t\t\tuser.getResevations().add(reservation);\n\t\t\tuserDao.createUser(user);\n\t\t\t\n\t\t\t\n\t\t\treservationDAO.createReservation(reservation);\n\t\t\treservationDetails5.setResevation(reservation);\n\t\t\treservationDetails10.setResevation(reservation);\n\t\t\t\n\t\t\treservationDetailsId10.setResevationId(reservation.getId());\n\t\t\treservationDetailsId5.setResevationId(reservation.getId());\n\t\t\t\n\t\t\treservationDetailsDAO.createReservationDetails(reservationDetails5);\n\t\t\treservationDetailsDAO.createReservationDetails(reservationDetails10);\n\t\t\t\n\t\t\tmodelAndView.setViewName(\"result_reservation\");\n\t\t\t\n\t\t}\n\t\telse{\n\t\t\tmodelAndView.setViewName(\"login\");\n\t\t\t\n\t\t\t\n\t\t}\t\n\t\t\n\t\treturn modelAndView;\n\t}", "@CrossOrigin(origins = \"http//localhost:4200\")\n\t@RequestMapping(value = \"/api/available-room-other-date\", method = RequestMethod.POST, consumes = MediaType.APPLICATION_JSON_VALUE, produces = MediaType.APPLICATION_JSON_VALUE)\n\tprivate AvailableHospitalRoomDTO availableRoomOtherDate(@RequestBody SurgeryDTO surgeryDTO) throws ParseException {\n\t\tAvailableHospitalRoomDTO ret = new AvailableHospitalRoomDTO();\n\t\tSurgery surgery = ss.findById(surgeryDTO.getId());\n\t\tList<HospitalRoom> rooms = hrs.findByClinicId(surgery.getClinic().getId());\n\t\tSimpleDateFormat dateFormat = new SimpleDateFormat(\"yyyy-MM-dd'T'HH:mm\");\n\t\tDate date = dateFormat.parse(surgery.getDate());\n\t\tlong startSurgery = date.getTime();\n\t\tboolean nadjenaSoba = false;\n\t\twhile (nadjenaSoba == false) {\n\t\t\tstartSurgery = startSurgery + 2 * 60 * 60 * 1000;\n\t\t\tString newDate = dateFormat.format(startSurgery);\n\t\t\tfor (HospitalRoom room : rooms) {\n\t\t\t\tif (nadjenaSoba == false) {\n\t\t\t\t\tList<Surgery> surgeries = ss.findByHospitalId(room.getId());\n\t\t\t\t\tList<Appointment> appointments = as.findByHospitalRoomId(room.getId());\n\t\t\t\t\tnadjenaSoba = checkTime(newDate, appointments, surgeries);\n\t\t\t\t\tif (nadjenaSoba) {\n\t\t\t\t\t\tret.setDate(newDate);\n\t\t\t\t\t\tret.setId(room.getId());\n\t\t\t\t\t\tret.setRoom_num(room.getRoom_number());\n\t\t\t\t\t\tret.setName(room.getName());\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn ret;\n\t}", "public void seeReservation(RoomList roomList){\n\t\tSystem.out.println(\"What is the name of the guest you wish to check a reservation for ?\");\n\t\tkeyboard.nextLine();\n\t\tString name = keyboard.nextLine();\n\t\tRoom room = null;\n\t\t\n\t\tfor(Room r: roomList.getList()){\n\t\t\tif(!r.isEmpty(r)) {\n\t\t\troom = r.findRoomByName(r, name);\n\t\t\troom.getGuestNames(room);\n\t\t\t}\n\t\t}\n\t}", "@RequestMapping(method = RequestMethod.POST)\n public ReservationDTO createReservation(@Valid @RequestBody NewReservation reservation)\n throws InvalidReservationDateException {\n\n String email = reservation.getOwner().getEmail();\n String fullName = reservation.getOwner().getFullName();\n LocalDate arrival = reservation.getArrivalDate();\n LocalDate departure = reservation.getDepartureDate();\n\n Reservation newReservation = this.service\n .createReservation(email, fullName, arrival, departure);\n\n return this.parseReservation(newReservation);\n }", "public List<TblReservationRoomTypeDetailRoomPriceDetail>getAllDataReservationRoomPriceDetailByDate(Date date);", "@Transactional\r\n\tpublic List<Room> getReservable(Integer posti, LocalDate from, LocalDate to){\r\n\t\tList<Room> l= this.getPosti(posti);\r\n\t\tl.removeAll(this.getReservedFromTo(from, to));\r\n\t\treturn l;\r\n\t}", "public void viewReservationList(RoomList roomList) {\n\t\tSystem.out.println(\"\");\t\t\t\t\t\t\t\t\t\t\n\t\tSystem.out.println(\"\\t\\tRESERVATION LIST\t\t\t\t \");\n\t\tSystem.out.println(\"**********************************************\\n\");\n\t\tfor(Room r: roomList.getList()){\t\t\t\t\t\t\t//search for all the rooms in the room list\n\t\t\tif(!r.isEmpty(r)) {\t\t\t\t\t\t\t\t\t\t//if a room is not empty(it has at least one guest)\n\t\t\t\tr.reservationList(r);\t\t\t\t\t\t\t\t//gets all the guests in non empty rooms\n\t\t\t}\n\t\t}\n\t\tSystem.out.println(\"\\n**********************************************\\n\");\n\t}", "@Transactional\r\n\tpublic List<Room> getReservedFromTo(LocalDate from, LocalDate to){\r\n\t\treturn this.roomRepository.findByReservationsIn(\r\n\t\t\t\tthis.reservationService.getFromTo(from, to));\r\n\t}", "@RequestMapping(value = \"/Reservation\", method = RequestMethod.GET)\n\t@ResponseBody\n\tpublic List<Reservation> listReservations() {\n\t\treturn new java.util.ArrayList<Reservation>(reservationService.loadReservations());\n\t}", "public void CheckAvail(LocalDate indate, LocalDate outdate)\r\n {\n if (Days.daysBetween(lastupdate, outdate).getDays() > 30)\r\n {\r\n System.out.println(\"more than 30\");\r\n return;\r\n }//Check if checkin date is before today\r\n if (Days.daysBetween(lastupdate, indate).getDays() < 0)\r\n {\r\n System.out.println(\"Less than 0\");\r\n return;\r\n }\r\n int first = Days.daysBetween(lastupdate, indate).getDays();\r\n int last = Days.daysBetween(lastupdate, outdate).getDays();\r\n for (int i = 0; i < roomtypes.size(); i++)\r\n {\r\n boolean ispossible = true;\r\n for (int j = first; j < last; j++)\r\n {\r\n if (roomtypes.get(i).reserved[j] >= roomtypes.get(i).roomcount)\r\n {\r\n ispossible = false;\r\n }\r\n } \r\n \r\n if (ispossible)\r\n System.out.println(roomtypes.get(i).roomname);\r\n }\r\n }", "public List<Room> getFreeOn(LocalDate of) {\r\n\t\tList<Room> l= this.getAllRooms();\r\n\t\tl.removeAll(this.getReservedOn(of));\r\n\t\treturn l;\r\n\t}", "public void actionPerformed(ActionEvent e) \n\t\t\t{\n\t\t\t\ttry\n\t\t\t\t{\n\t\t\t\t\tObject HotelID = cbHotelsOptions.getSelectedItem();\n\t\t\t\t\tHotel hotel;\n\t\t\t\t\thotel = (Hotel) HotelID;\n\t\t\t\t\tlong id = hotel.getUniqueId();\n\t\t\t\t\t//\tSystem.out.println(id);\n\t\t\t\t\tString inmonth = txtInMonth.getText();\n\t\t\t\t\tint inMonth = Integer.valueOf(inmonth);\n\t\t\t\t\tString inday = txtInDay.getText();\n\t\t\t\t\tint inDay = Integer.parseInt(inday);\n\t\t\t\t\tString outmonth = txtOutMonth.getText();\n\t\t\t\t\tint outMonth = Integer.valueOf(outmonth);\n\t\t\t\t\tString outday = txtOutDay.getText();\n\t\t\t\t\tint OutDay = Integer.parseInt(outday);\n\t\t\t\t\tFileOutputStream fos = new FileOutputStream(\"Reservation.txt\", true);\n\t\t\t\t\tPrintWriter pw = new PrintWriter(fos);\n\n\t\t\t\t\t/**\n\t\t\t\t\t * i then check the canBook method and according to the canBook method \n\t\t\t\t\t * i check if they can book, and if yes i add the reservation\n\t\t\t\t\t * otherwise it prints so the user may enter different values\n\t\t\t\t\t */\n\t\t\t\t\t{\n\t\t\t\t\t\tif(h.canBook(new Reservation(id,inMonth, inDay, OutDay)) == true) \n\t\t\t\t\t\t{\n\t\t\t\t\t\t\treservation.add(new Reservation (id,inMonth, inDay, outMonth, OutDay));\n\t\t\t\t\t\t\tr = new Reservation (id,inMonth, inDay, OutDay);\n\t\t\t\t\t\t\th.addResIfCanBook(new Reservation(id,inMonth, inDay, outMonth, OutDay));\n\t\t\t\t\t\t\treservationsModel.addElement(r);\n\t\t\t\t\t\t\tpw.println( id + \" - \" + inMonth + \"-\"+ inDay+ \" - \" + outMonth + \"-\" + OutDay);\n\t\t\t\t\t\t\tpw.close();\n\t\t\t\t\t\t\ttxtInMonth.setText(\"\");\n\t\t\t\t\t\t\ttxtOutMonth.setText(\"\");\n\t\t\t\t\t\t\ttxtInDay.setText(\"\");\n\t\t\t\t\t\t\ttxtOutDay.setText(\"\");\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse \n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tJOptionPane.showMessageDialog(null, \"These dates are already reserved\"\n\t\t\t\t\t\t\t\t\t+ \"\\nPlease try again!\");\t\n\t\t\t\t\t\t\ttxtInMonth.setText(\"\");\n\t\t\t\t\t\t\ttxtOutMonth.setText(\"\");\n\t\t\t\t\t\t\ttxtInDay.setText(\"\");\n\t\t\t\t\t\t\ttxtOutDay.setText(\"\");\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t} \n\t\t\t\t/**\n\t\t\t\t * Then the catch Block checks for file not found exception\n\t\t\t\t */\n\t\t\t\tcatch (FileNotFoundException fnfe) \n\t\t\t\t{\n\t\t\t\t\tSystem.err.println(\"File not found.\");\n\t\t\t\t}\n\t\t\t}", "private void createReservations() {\n final String username = extractUsername();\n final EMail email = extractEMail();\n if (!isReserved(username) || !isReserved(email)) {\n signupDelegate.enableNextButton(Boolean.FALSE);\n SwingUtil.setCursor(this, java.awt.Cursor.WAIT_CURSOR);\n UsernameReservation usernameReservation = null;\n EMailReservation emailReservation = null;\n try {\n errorMessageJLabel.setText(getString(\"CheckingUsername\"));\n errorMessageJLabel.paintImmediately(0, 0, errorMessageJLabel\n .getWidth(), errorMessageJLabel.getHeight());\n \n // get username reservation\n usernameReservation = createUsernameReservation(username);\n if (null == usernameReservation) {\n unacceptableUsername = username;\n } else {\n usernameReservations.put(username.toLowerCase(), usernameReservation);\n }\n \n // get email reservation\n emailReservation = createEMailReservation(email);\n if (null == emailReservation) {\n unacceptableEMail = email;\n } else {\n emailReservations.put(email, emailReservation);\n }\n } catch (final OfflineException ox) {\n logger.logError(ox, \"An offline error has occured.\");\n temporaryError = getSharedString(\"ErrorOffline\");\n } catch (final Throwable t) {\n logger.logError(t, \"An unexpected error has occured.\");\n temporaryError = getSharedString(\"ErrorUnexpected\");\n } finally {\n SwingUtil.setCursor(this, null);\n }\n validateInput();\n }\n }", "public ArrayList<Reservation> getReservation() {\n return reservations;\n }", "protected static String availableRooms(ArrayList<Room> roomList,String start_date){\n String stringList = \"\";\n for(Room room : roomList){\n System.out.println(room.getName());\n ArrayList<Meeting> meet = room.getMeetings();\n for(Meeting m : meet){\n stringList += m + \"\\t\";\n }\n System.out.println(\"RoomsList\"+stringList);\n }\n return \"\";\n }", "public ArrayList<CalendarRoom> getAvailableRooms(Date dtFrom, Date dtTo, String sType)\r\n \tthrows IllegalStateException, JiBXException, IOException {\r\n\r\n\tif (null==sSecurityToken) throw new IllegalStateException(\"Not connected to calendar service\");\r\n\r\n\tCalendarResponse oResponse = CalendarResponse.get(sBaseURL+\"?command=getAvailableRooms&token=\"+sSecurityToken+\"&type=\"+sType+\"&startdate=\"+oFmt.format(dtFrom)+\"&enddate=\"+oFmt.format(dtTo));\r\n \r\n iErrCode = oResponse.code;\r\n sErrMsg = oResponse.error;\r\n\r\n if (iErrCode==0) {\r\n return oResponse.oRooms;\r\n } else {\r\n return null;\r\n }\r\n }", "public ArrayList<CalendarRoom> getAvailableRooms(Date dtFrom, Date dtTo)\r\n \tthrows IllegalStateException, JiBXException, IOException {\r\n\r\n\tif (null==sSecurityToken) throw new IllegalStateException(\"Not connected to calendar service\");\r\n\r\n\tCalendarResponse oResponse = CalendarResponse.get(sBaseURL+\"?command=getAvailableRooms&token=\"+sSecurityToken+\"&startdate=\"+oFmt.format(dtFrom)+\"&enddate=\"+oFmt.format(dtTo));\r\n \r\n iErrCode = oResponse.code;\r\n sErrMsg = oResponse.error;\r\n\r\n if (iErrCode==0) {\r\n return oResponse.oRooms;\r\n } else {\r\n return null;\r\n }\r\n }", "private void twoDateOccupancyQuery(String startDate, String endDate){\n List<String> emptyRooms = findEmptyRoomsInRange(startDate, endDate);\n List<String> fullyOccupiedRooms = findOccupiedRoomsInRange(startDate, endDate, emptyRooms);\n List<String> partiallyOccupiedRooms = \n (generateListOfAllRoomIDS().removeAll(emptyRooms)).removeAll(fullyOccupiedRooms);\n\n occupancyColumns = new Vector<String>();\n occupancyData = new Vector<Vector<String>>();\n occupancyColumns.addElement(\"RoomId\");\n occupancyColumns.addElement(\"Occupancy Status\");\n\n for(String room: emptyRooms) {\n Vector<String> row = new Vector<String>();\n row.addElement(room);\n row.addElement(\"Empty\");\n occupancyData.addElement(row);\n }\n for(String room: fullyOccupiedRooms) {\n Vector<String> row = new Vector<String>();\n row.addElement(room);\n row.addElement(\"Fully Occupied\");\n occupancyData.addElement(row);\n }\n for(String room: partiallyOccupiedRooms) {\n Vector<String> row = new Vector<String>();\n row.addElement(room);\n row.addElement(\"Partially Occupied\");\n occupancyData.addElement(row);\n }\n return;\n}", "public void setMyRoomReservationOK() throws SQLException{\n int guestID = guest[guestIndex].getAccountID();\n int selRoomCount = getSelectedRoomsCounter();\n int[] tempRooms = getGuestSelRooms(); //Selected room by room number\n \n roomStartDate = convertMonthToDigit(startMonth) + \"/\" +startDay+ \"/\" + startYear;\n roomEndDate = convertMonthToDigit(endMonth) + \"/\" +endDay+ \"/\" + endYear; \n \n System.out.println(\"\\nSaving reservation\");\n System.out.println(\"roomStartDate\" + roomStartDate);\n System.out.println(\"roomEndDate:\" + roomEndDate);\n \n //Searching the reserved room number in the hotel rooms\n for(int i=0;i<selRoomCount;i++){\n for(int i2=0;i2<roomCounter;i2++){\n if(myHotel[i2].getRoomNum() == tempRooms[i]){ \n //if room number from array is equal to selected room number by guest\n System.out.println(\"Room Found:\"+tempRooms[i]); \n \n myHotel[i2].setOccupantID(guestID);\n myHotel[i2].setAvailability(false);\n myHotel[i2].setOccupant(guest[guestIndex].getName());\n myHotel[i2].setStartDate(roomStartDate);\n myHotel[i2].setEndDate(roomEndDate);\n }\n }\n }\n \n updateRoomChanges_DB(); //apply changes to the database\n \n //Updates room preference of the current guest \n String sqlstmt = \"UPDATE APP.GUEST \"\n + \" SET ROOMPREF = '\" + guest[guestIndex].getPref()\n + \"' WHERE ID = \"+ guest[guestIndex].getAccountID();\n \n CallableStatement cs = con.prepareCall(sqlstmt); \n cs.execute(); //execute the sql command \n cs.close(); \n }", "private List<String> findEmptyRoomsInRange(String startDate, String endDate) {\n /* startDate indices = 1,3,6 \n endDate indices = 2,4,5 */\n String emptyRoomsQuery = \"select r1.roomid \" +\n \"from rooms r1 \" +\n \"where r1.roomid NOT IN (\" +\n \"select roomid\" +\n \"from reservations\" + \n \"where roomid = r1.roomid and ((checkin <= to_date('?', 'DD-MON-YY') and\" +\n \"checkout > to_date('?', 'DD-MON-YY')) or \" +\n \"(checkin >= to_date('?', 'DD-MON-YY') and \" +\n \"checkin < to_date('?', 'DD-MON-YY')) or \" +\n \"(checkout < to_date('?', 'DD-MON-YY') and \" +\n \"checkout > to_date('?', 'DD-MON-YY'))));\";\n\n try {\n PreparedStatement erq = conn.prepareStatement(emptyRoomsQuery);\n erq.setString(1, startDate);\n erq.setString(3, startDate);\n erq.setString(6, startDate);\n erq.setString(2, endDate);\n erq.setString(4, endDate);\n erq.setString(5, endDate);\n ResultSet emptyRoomsQueryResult = erq.executeQuery();\n List<String> emptyRooms = getEmptyRoomsFromResultSet(emptyRoomsQueryResult);\n return emptyRooms;\n } catch (SQLException e) {\n System.out.println(\"Empty rooms query failed.\")\n }\n return null;\n}", "public RequestedDatesForAvailability getRequestedDatesForAvailability(com.kcdataservices.partners.kcdebdmnlib_hva.businessobjects.requesteddatesforavailability.v1.RequestedDatesForAvailability res){\n\t\tRequestedDatesForAvailability requestedDatesForAvailability = new RequestedDatesForAvailability();\n\t\t\n\t\trequestedDatesForAvailability.setNoOfRooms( res.getNoOfRooms() );\n\t\trequestedDatesForAvailability.setBookingDate( res.getBookingDate() );\t\n\t\trequestedDatesForAvailability.setBookingDuration( res.getBookingDuration() );\n\t\trequestedDatesForAvailability.setRoomDescription( res.getRoomDescription() );\n\t\trequestedDatesForAvailability.setRoomStatus( res.getRoomStatus() );\n\t\trequestedDatesForAvailability.setMaterialNumber( res.getMaterialNumber() );\n\t\t\n\t\trequestedDatesForAvailability.setReqDates( res.getReqDates() );\n\t\t\n\t\treturn requestedDatesForAvailability;\n\t}", "@Transactional\r\n\tpublic List<Room> getFreeFromTo(LocalDate from, LocalDate to){\r\n\t\tList<Room> l= this.roomRepository.findByReservationsNotIn(\r\n\t\t\t\tthis.reservationService.getFromTo(from, to));\r\n\t\tl.addAll(this.roomRepository.findByReservationsIsNull());\r\n\t\treturn l;\r\n\t}", "private void checkReservationValidityAndRemove(){\n\t\t\n\t\tfor (Reservation r: reservationArray){\n\t\t\tif (r.getBookingDateAndTime().get(Calendar.DAY_OF_MONTH)==Calendar.getInstance().get(Calendar.DAY_OF_MONTH)){\n\t\t\t\tif (r.getBookingDateAndTime().get(Calendar.MONTH)==Calendar.getInstance().get(Calendar.MONTH)){\n\t\t\t\t\tif (r.getBookingDateAndTime().get(Calendar.HOUR_OF_DAY)==Calendar.getInstance().get(Calendar.HOUR_OF_DAY)){\n\t\t\t\t\t\tif (r.getBookingDateAndTime().get(Calendar.MINUTE) > 30 + r.getBookingDateAndTime().get(Calendar.MINUTE) ){\n\t\t\t\t\t\t\treservationArray.remove(r);\n\t\t\t\t\t\t\ttablemanager.increaseAvailable();;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "@GetMapping(value=\"/ticket/alltickets/bookingdate?date={bookingDate}\")\n\tpublic List<Ticket> getTicketByBookingDate(@RequestParam(value=\"date\",required=true) @PathVariable(\"bookingDate\") Date bookingDate){\n\t\tSystem.out.println(\".inside getTicketByBookingDate controller.........\");\n\t\treturn ticketBookingService.getTicketByBookingDate(bookingDate);\n\t}", "public ModifyRoomReservation() {\n initComponents();\n\n btn_search.requestFocus();\n\n getAllIds();\n\n }", "public List<ReservationDTO> seachReservationBypid(int pid) {\n\t\treturn dao.seachReservationBypid(pid);\r\n\t}", "public void allBookings() {\n\t\t\tint i = 0;\r\n\t\t\tint k = 0;\r\n\t\t\tint j = 0;\r\n\t\t\tint roomNum; //Room number\r\n\t\t\tint buffNum; //buff room number\r\n\t\t\tint index = 0; //saves the index of the date stored in the arraylist dateArray\r\n\t\t\tBooking buff; //Booking buffer to use\r\n\t\t\tRooms roomCheck;\r\n\t\t\tArrayList<LocalDate> dateArray = new ArrayList<LocalDate>(); //Saves the booking dates of a room\r\n\t\t\tArrayList<Integer> nights = new ArrayList<Integer>(); //Saves the number of nights a room is booked for\r\n\t\t\t\r\n\t\t\twhile(i < RoomDetails.size()) { //Looping Room Number-wise\r\n\t\t\t\troomCheck = RoomDetails.get(i);\r\n\t\t\t\troomNum = roomCheck.getRoomNum();\r\n\t\t\t\tSystem.out.print(this.Name + \" \" + roomNum);\r\n\t\t\t\twhile(k < Bookings.size()) { //across all bookings\r\n\t\t\t\t\tbuff = Bookings.get(k);\r\n\t\t\t\t\twhile(j < buff.getNumOfRoom()) { //check each booked room\r\n\t\t\t\t\t\tbuffNum = buff.getRoomNumber(j);\r\n\t\t\t\t\t\tif(buffNum == roomNum) { //If a booking is found for a specific room (roomNum)\r\n\t\t\t\t\t\t\tdateArray.add(buff.getStartDate()); //add the date to the dateArray\r\n\t\t\t\t\t\t\tCollections.sort(dateArray); //sort the dateArray\r\n\t\t\t\t\t\t\tindex = dateArray.indexOf(buff.getStartDate()); //get the index of the newly add date\r\n\t\t\t\t\t\t\tnights.add(index, buff.getDays()); //add the number of nights to the same index as the date\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tj++;\r\n\t\t\t\t\t}\r\n\t\t\t\t\tk++;\r\n\t\t\t\t\tj=0;\r\n\t\t\t\t}\r\n\t\t\t\ti++;\r\n\t\t\t\tprintOccupancy(dateArray, nights); //print the occupancy of the room\r\n\t\t\t\tk=0;\r\n\t\t\t\tdateArray.clear(); //cleared to be used again\r\n\t\t\t\tnights.clear(); //cleared to be used again\r\n\t\t\t}\r\n\t\t}", "public com.kcdataservices.partners.kcdebdmnlib_hva.businessobjects.requesteddatesforavailability.v1.RequestedDatesForAvailability getRequestedDatesForAvailabilityReq(RequestedDatesForAvailability requestedDatesForAvailability){\n\t\tcom.kcdataservices.partners.kcdebdmnlib_hva.businessobjects.requesteddatesforavailability.v1.RequestedDatesForAvailability req = \n\t\tnew com.kcdataservices.partners.kcdebdmnlib_hva.businessobjects.requesteddatesforavailability.v1.RequestedDatesForAvailability();\n\t\t\n\t\treq.setNoOfRooms( requestedDatesForAvailability.getNoOfRooms() );\n\t\treq.setBookingDate( requestedDatesForAvailability.getBookingDate() );\t\n\t\treq.setBookingDuration( requestedDatesForAvailability.getBookingDuration() );\n\t\treq.setRoomDescription( requestedDatesForAvailability.getRoomDescription() );\n\t\treq.setRoomStatus( requestedDatesForAvailability.getRoomStatus() );\n\t\treq.setMaterialNumber( requestedDatesForAvailability.getMaterialNumber() );\n\t\tif( (requestedDatesForAvailability.getReqDates() != null) && (requestedDatesForAvailability.getReqDates().size() > 0) ){\n\t\t\tfor(int i=0; i < requestedDatesForAvailability.getReqDates().size(); i++){\n\t\t\t\treq.getReqDates().add( requestedDatesForAvailability.getReqDates().get(i) );\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn req;\n\t}", "@RequestMapping(value = \"/completeReservation\", method = RequestMethod.POST)\r\n public String completeReservation(ReservationRequest request,ModelMap modelMap){\n Reservation reservation= reservationService.bookFlight(request);\r\n modelMap.addAttribute(\"msg\",\"Resevation created succesfully and id is \"+reservation.getId());\r\n\r\n return \"reservation Confirmed\";\r\n }", "public Reservation makeReservation(String id, ArrayList<Room> rooms, LocalDate start, LocalDate end) {\n Reservation reservation = new Reservation(this, id, start, end);\n // Add the given rooms to the reservation.\n for (Room room : rooms) {\n reservation.addRoom(room);\n }\n // Add the reservation to this venue's list of reservations\n this.addReservation(reservation);\n return reservation;\n }", "public Reservation makeReservation(Reservation trailRes){\n //Using a for each loop to chekc to see if a reservation can be made or not\n if(trailRes.getName().equals(\"\")) {\n System.out.println(\"Not a valid name\");\n return null;\n }\n \n \n for(Reservation r: listR){\n if(trailRes.getReservationTime() == r.getReservationTime()){\n System.out.println(\"Could not make the Reservation\");\n System.out.println(\"Reservation has already been made by someone else\");\n return null;\n }\n }\n\n //if the time slot is greater than 10 or less than 0, the reservation cannot be made\n if(trailRes.getReservationTime() > 10 || trailRes.getReservationTime() < 0){\n System.out.println(\"Time slot not available\");\n return null;\n }\n\n //check to see if the reservable list is empty or not\n if(listI.isEmpty())\n {\n System.out.println(\"No reservation available\");\n return null;\n }\n\n //find the item and fitnessValue that will most fit our reservation\n Reservable item = listI.get(0);\n int fitnessValue = item.findFitnessValue(trailRes);\n\n //loop through the table list and find the best fit for our reservation\n for(int i = 0; i < listI.size() ; i++){\n if(listI.get(i).findFitnessValue(trailRes) > fitnessValue){\n item = listI.get(i);\n fitnessValue = item.findFitnessValue(trailRes);\n }\n }\n //if we have found a table that works, then we can make our reservation\n if(fitnessValue > 0){\n //add reservation to our internal list\n //point our reservable to the appropriate reservation\n //set the reservable \n //print out the message here not using the iterator\n listR.add(trailRes);\n item.addRes(trailRes);\n trailRes.setMyReservable(item);\n System.out.println(\"Reservation made for \" + trailRes.getName() + \" at time \" + trailRes.getReservationTime() + \", \" + item.getId());\n return trailRes;\n }\n System.out.println(\"No reservation available, number of people in party may be too large\");\n return null; \n }", "public Calendar setReservationDate(){\n\t\t\n\t\t\n\t\tint currentMonth = Calendar.getInstance().get(Calendar.MONTH)+1; //Month starts from zero in Java\n\t\tint currentYear = Calendar.getInstance().get(Calendar.YEAR);\n\t\tint currentDate = Calendar.getInstance().get(Calendar.DAY_OF_MONTH);\n\t\tint currentHour = Calendar.getInstance().get(Calendar.HOUR_OF_DAY);\n\t\tint currentMinute = Calendar.getInstance().get(Calendar.MINUTE);\n\t\t\n\t\t\n\t\tSystem.out.println(\"Current Year \"+ currentYear );\n\t\tSystem.out.println(\"Current Month \"+ currentMonth );\n\t\tSystem.out.println(\"Today's date \"+ currentDate );\n\t\tSystem.out.println(\"Current Hour \"+ currentHour );\n\t\tSystem.out.println(\"Current Minute \"+ currentMinute );\n\t\tSystem.out.println(\"\\t---\\t---\\t---\\t---\\t---\");\n\t\tint inputMonth, inputYear, inputDate, inputHour, inputMinute;\n\t\t\n\t\tCalendar reserveDate = Calendar.getInstance();\n\t\t\n\t\tSystem.out.print(\"Enter the year: \");\n\t\tinputYear = scan.nextInt();\n\t\tscan.nextLine();\n\t\t\n\t\twhile( inputYear < currentYear){\n\t\t\tSystem.out.println(\"Old year entry is not allowed !\\n\");\n\t\t\tSystem.out.print(\"Enter the year: \");\n\t\t\tinputYear = scan.nextInt();\n\t\t\tscan.nextLine();\n\t\t}\t\n\t\treserveDate.set(Calendar.YEAR,inputYear); \n\t\n\t\tSystem.out.print(\"Enter the month: \");\n\t\tinputMonth = scan.nextInt();\t\n\t\tscan.nextLine();\n\t\t\n\t\twhile (inputMonth < 1 || inputMonth > 12){\n\t\t\tSystem.out.println(\"Invalid Month entry!\");\n\t\t\tSystem.out.print(\"Enter the month again: \");\n\t\t\tinputMonth = scan.nextInt();\n\t\t\tscan.nextLine();\n\t\t}\n\t\t\n\t\twhile((inputMonth < currentMonth) && (inputYear == currentYear)){\n\t\t\t\t\t\n\t\t\tSystem.out.println(\"Old month entry is not allowed !\\n\");\n\t\t\tSystem.out.print(\"Enter the month: \");\n\t\t\tinputMonth = scan.nextInt();\n\t\t\tscan.nextLine();\n\t\t\t\n\t\t}\n\t\treserveDate.set(Calendar.MONTH,inputMonth-1);//MONTH is from 0 to 11.\n\t\t\n\t\tSystem.out.print(\"Enter the date for reservation: \");\n\t\tinputDate = scan.nextInt();\n\t\tscan.nextLine();\n\t\t\n\t\twhile( inputDate < 1 || inputDate > 31){\n\t\t\tSystem.out.println(\"Invalid date entry!\");\n\t\t\tSystem.out.print(\"Enter the date again: \");\n\t\t\tinputDate = scan.nextInt();\n\t\t\tscan.nextLine();\n\t\t}\n\t\t\n\t\twhile((inputDate < currentDate) && (inputMonth == currentMonth)&&(inputYear==currentYear)){\n\t\t\tSystem.out.println(\"Past Day is not allowed!\\n\");\n\t\t\tSystem.out.print(\"Enter the date for reservation: \");\n\t\t\tinputDate = scan.nextInt();\n\t\t\tscan.nextLine();\n\t\t}\n\t\treserveDate.set(Calendar.DAY_OF_MONTH,inputDate);\n\t\t\n\t\tSystem.out.print(\"Enter hour (24-hr format): \");\n\t\tinputHour = scan.nextInt();\n\t\tscan.nextLine();\n\t\t\n\t\twhile( inputHour < 0 || inputHour > 23){\n\t\t\tSystem.out.println(\"Invalid hour entry!\");\n\t\t\tSystem.out.print(\"Enter the hour again: \");\n\t\t\tinputHour = scan.nextInt();\n\t\t\tscan.nextLine();\n\t\t}\n\t\t\n\t\twhile(inputHour < currentHour && inputDate == currentDate&&inputMonth == currentMonth&&inputYear==currentYear){\n\t\t\t\n\t\t\tif (inputHour < 0 && inputHour > 23){\n\t\t\t\tSystem.out.println(\"Invalid Hour entry\");\n\t\t\t}\n\t\t\telse{\n\t\t\t\tSystem.out.println(\"Past hour is not allowed!\\n\");\n\t\t\t\tSystem.out.print(\"Enter hour (24-hr format): \");\n\t\t\t\tinputHour = scan.nextInt();\n\t\t\t\tscan.nextLine();\n\t\t\t}\n\t\t}\n\t\treserveDate.set(Calendar.HOUR_OF_DAY,inputHour); //This uses 24 hour clock\n\t\t\n\t\tSystem.out.print(\"Enter minute: \");\n\t\tinputMinute = scan.nextInt();\n\t\tscan.nextLine();\n\t\t\n\t\twhile(inputMinute < 0 || inputMinute > 59){\n\t\t\tSystem.out.println(\"Invalid Minute entry\");\n\t\t\tSystem.out.print(\"Enter minute again: \");\n\t\t\tinputMinute = scan.nextInt();\n\t\t\tscan.nextLine();\n\t\t}\n\t\t\n\t\twhile((inputMinute-currentMinute) <= 0 && inputHour == currentHour){\n\t\t\t\n\t\t\t//System.out.println(\"Reservation can only be made 30 minutes earlier or invalid input !\");\n\t\t\tSystem.out.print(\"Invalid minute\");\n\t\t\tSystem.out.print(\"Enter minute again: \");\n\t\t\tinputMinute = scan.nextInt();\t\n\t\t\tscan.nextLine();\n\t\t}\n\t\t\n\t\treserveDate.set(Calendar.MINUTE,inputMinute);\n\t\tSystem.out.println(\"Date Reserved!\");\n\t\treturn reserveDate;\n\t}", "public List<ConsultationReservation> getConsultationReservationsByUserToday(InternalUser user) throws SQLException{\n\t\t\n\t\treturn super.manager.getConsultationReservationByUser(user, LocalDate.now(), true, false);\n\t}", "public void addBookings(String name, ArrayList<Integer> roomToUse, int month, int date, int stay) {\n\t\t\t\r\n\t\t\tBooking newCust = new Booking();\r\n\t\t\tint i = 0;\r\n\t\t\tint k = 0;\r\n\t\t\tint roomCap = 0; //Roomtype / capacity\r\n\t\t\tint roomNum; //Room Number\r\n\t\t\tRooms buffer; //used to store the rooms to add to the bookings\r\n\t\t\t\r\n\t\t\twhile(i < roomToUse.size()) { //add all rooms from the available list\r\n\t\t\t\troomNum = roomToUse.get(i); //get Room number of the avalable, non-clashing room to be booked\r\n\t\t\t\twhile(k < RoomDetails.size()) { //Looping through all rooms in a hotel\r\n\t\t\t\t\tbuffer = RoomDetails.get(k); \r\n\t\t\t\t\tif (buffer.getRoomNum() == roomNum) { //To get the capacity of the matching room\r\n\t\t\t\t\t\troomCap = buffer.getCapacity();\r\n\t\t\t\t\t}\r\n\t\t\t\t\tk++;\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\tnewCust.addRoom(roomNum, roomCap); //Add those rooms to the bookings with room number and type filled in\r\n\t\t\t\ti++;\r\n\t\t\t\tk=0;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tnewCust.addName(name); //add customer name to booking\r\n\t\t\tnewCust.addDates(month, date, stay); //add dates to the booking\r\n\t\t\t\r\n\t\t\tBookings.add(newCust); //adds the new booking into the hotel bookings list\r\n\t\t}", "public void update() {\n\t\trl = DBManager.getReservationList();\n\t}", "public void refreshReservations(RoomMgr rm){\n\t\tint count=0;\n\t\tfor (Reservation r : rList){\n\t\t\tif ((r.getResvStatus() == rStatus[0] || r.getResvStatus() == rStatus[1]) && r.getDateCheckIn().isBefore(LocalDate.now())){\n\t\t\t\tr.setResvStatus(rStatus[4]);\n\t\t\t\trm.assignRoom(r.getRoomNo(),0);\n\t\t\t\tcount++;\n\t\t\t}\n\t\t}\n\t\tif (count > 0)\n\t\t\tSystem.out.println(count + \" Reservations expired!\");\n\t}", "@Override\n protected void doPost(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n Controladora control = new Controladora();\n String fecha = request.getParameter(\"fecha\");\n \n \n \n SimpleDateFormat fechaformato= new SimpleDateFormat(\"yyyy-MM-dd\");\n Date fechaFront= null;\n \n try {\n fechaFront= fechaformato.parse(fecha);\n \n } catch (ParseException ex) {\n Logger.getLogger(CrudEntradas.class.getName()).log(Level.SEVERE, null, ex);\n }\n \n \n List<Entrada> listaEntradas = control.getListaEntradas();\n List<Entrada> listaFinalvendidasdia= new ArrayList<Entrada>();\n \n for (Entrada ent:listaEntradas ){\n if(ent.getFecha().equals(fechaFront)){\n \n listaFinalvendidasdia.add(ent);\n \n \n \n }\n \n \n \n }\n \n \n \n \n request.setAttribute(\"listaFinalvendidasdia\", listaFinalvendidasdia);\n \n request.getRequestDispatcher(\"ListarEntradasVendidasDia.jsp\").forward(request, response);\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n processRequest(request, response);\n }", "protected void processRequest(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n response.setContentType(\"text/html;charset=UTF-8\");\n \n Reservacion res = new Reservacion();\n res.cliente = Integer.parseInt(request.getParameter(\"cliente\"));\n res.usuario = Integer.parseInt(request.getParameter(\"usuario\"));\n res.abonado = Double.parseDouble(request.getParameter(\"abonado\"));\n res.extras = Double.parseDouble(request.getParameter(\"extras\"));\n res.fecha_inicial = request.getParameter(\"fecha_inicial\");\n res.fecha_final = request.getParameter(\"fecha_final\");\n res.dias = Integer.parseInt(res.fecha_final.split(\"-\")[2]) - Integer.parseInt(res.fecha_inicial.split(\"-\")[2]);\n res.habitacion = request.getParameter(\"habitacion\");\n res.observaciones = request.getParameter(\"observaciones\");\n res.usuario = Integer.parseInt(request.getParameter(\"usuario\"));\n \n Habitacion hab = new Habitacion();\n ResultSet habitacion = hab.getOne(res.habitacion, \"string\");\n try {\n if(habitacion.next()){\n res.costo_total = hab.priceByDay(habitacion.getDouble(\"precio\"), res.dias, res.extras);\n \n if(res.create()){\n response.sendRedirect(\"reservaciones.jsp\");\n }else\n try (PrintWriter out = response.getWriter()) {\n out.println(\"<h1>Hubo un error al guardar... \" + res.costo_total + \"</h1>\");\n }\n }\n } catch (SQLException ex) {\n Logger.getLogger(NewReservationServlet.class.getName()).log(Level.SEVERE, null, ex);\n }\n \n \n }", "protected void processRequest(HttpServletRequest request, HttpServletResponse response)\r\n throws ServletException, IOException, MessagingException {\r\n response.setContentType(\"text/html;charset=UTF-8\");\r\n try (PrintWriter out = response.getWriter()) {\r\n /* TODO output your page here. You may use following sample code. */\r\n out.println(\"<!DOCTYPE html>\");\r\n out.println(\"<html>\");\r\n out.println(\"<head>\");\r\n out.println(\"<title>Servlet reservation</title>\");\r\n out.println(\"</head>\");\r\n out.println(\"<body>\");\r\n HttpSession session = request.getSession();\r\n //String n = (String) session.getAttribute(\"username\");\r\n// out.println(n + \" \" + email);\r\n //String ValidatorEmailMSG = request.getSession().getAttribute(\"ValidatorEmailMSG\").toString();\r\n \r\n if (session.getAttribute(\"username\") == null) {\r\n\r\n String error = \"e\";\r\n HttpSession mailsession = request.getSession();\r\n mailsession.setAttribute(\"error\", error);\r\n response.sendRedirect(\"reservation.jsp\");\r\n } else {\r\n //out.println(\"in\");\r\n int hotelid;\r\n int roomNumber;\r\n Date checkIn;\r\n Date checkOut;\r\n int nights;\r\n double ppn;\r\n double tax;\r\n double total;\r\n int user_id;\r\n String firstName = request.getParameter(\"fName\");\r\n String lastName = request.getParameter(\"lName\");\r\n //String email = request.getParameter(\"email\");\r\n String email = request.getParameter(\"email\");\r\n\r\n String address = request.getParameter(\"address\");\r\n String phone = request.getParameter(\"phone\");\r\n\r\n String city = request.getParameter(\"city\");\r\n String country = request.getParameter(\"country\");\r\n String postalCode = request.getParameter(\"postalCode\");\r\n \r\n user_id = Integer.parseInt((String) request.getParameter((\"user_id\")));\r\n \r\n hotelid = Integer.parseInt((String) request.getParameter((\"hotelid\")));\r\n roomNumber = Integer.parseInt((String) request.getParameter((\"roomNumberSelected\")));\r\n\r\n checkIn = Date.valueOf(request.getParameter(\"checkInForRoom\"));\r\n checkOut = Date.valueOf(request.getParameter(\"checkOutForRoom\"));\r\n\r\n nights = Integer.parseInt(String.valueOf(request.getParameter(\"nights\")));\r\n ppn = Double.parseDouble(String.valueOf(request.getParameter(\"ppn\")));\r\n tax = Double.parseDouble(String.valueOf(request.getParameter(\"tax\")));\r\n total = Double.parseDouble(String.valueOf(request.getParameter(\"total\")));\r\n\r\n String cvv = request.getParameter(\"cvv\");\r\n String ccNumber = request.getParameter(\"ccNumber\");\r\n \r\n //out.println(email + \" \" + firstName + \" \" +lastName );\r\n try {\r\n\r\n Class.forName(\"com.mysql.jdbc.Driver\");\r\n String url = \"jdbc:mysql://localhost:3306/hrsystem\";\r\n String user = \"root\";\r\n String password = \"root\";\r\n Connection Con = null;\r\n Statement Stmt = null;\r\n\r\n Con = DriverManager.getConnection(url, user, password);\r\n Stmt = Con.createStatement();\r\n\r\n Email mail = new Email(\"[email protected]\", \"qwe123@thelover\");\r\n mail.setFrom(\"[email protected]\", \"Hotel Team Work\");\r\n mail.setSubject(\"reservation confirm\");\r\n mail.setContent(\"Confirm Your reservation\\n<a href=https://www.google.com >Click To Confirm Reservation Please</a>\", \"text/html\");\r\n //out.println(\"1\");\r\n mail.addRecipient(email);\r\n mail.send();\r\n int cancel_res = 1;\r\n String line = \"INSERT INTO reservation(user_first_name, user_last_name, user_email, user_address, user_phone, user_city, user_country, postel_code, hotel_hotelid, room_room_id, res_checkIn, res_checkout, res_nights, res_ppn, res_tax, res_total , cancel_res,user_id) VALUES(\"\r\n + \"'\" + firstName + \"',\"\r\n + \"'\" + lastName + \"',\"\r\n + \"'\" + email + \"',\"\r\n + \"'\" + address + \"',\"\r\n + \"'\" + phone + \"',\"\r\n + \"'\" + country + \"',\"\r\n + \"'\" + city + \"',\"\r\n + \"'\" + postalCode + \"',\"\r\n + \"'\" + hotelid + \"',\"\r\n + \"'\" + roomNumber + \"',\"\r\n + \"'\" + checkIn + \"',\"\r\n + \"'\" + checkOut + \"',\"\r\n + \"'\" + nights + \"',\"\r\n + \"'\" + ppn + \"',\"\r\n + \"'\" + tax + \"',\"\r\n + \"'\" + total + \"',\"\r\n + \"'\" + cancel_res + \"',\"\r\n + \"'\" + user_id + \"')\";\r\n int Rows = Stmt.executeUpdate(line);\r\n // out.println(\"2\");\r\n out.println(\"<script>\");\r\n out.println(\"alert('Thank You Please Confirm Your email');\");\r\n out.println(\"location='Index.jsp';\");\r\n out.println(\"</script>\");\r\n // response.sendRedirect(\"index.html\");\r\n\r\n Stmt.close();\r\n Con.close();\r\n } catch (Exception ex) {\r\n ex.printStackTrace();\r\n }\r\n }\r\n out.println(\"</body>\");\r\n out.println(\"</html>\");\r\n }\r\n }", "private static boolean availabilityQuery(String roomid, String date1, String date2)\n {\n String query = \"SELECT status\"\n + \" FROM (\"\n + \" SELECT DISTINCT ro.RoomId, 'occupied' AS status\"\n + \" FROM myReservations re JOIN myRooms ro ON (re.Room = ro.RoomId)\"\n + \" WHERE (DATEDIFF(CheckIn, DATE(\" + date1 + \")) <= 0\"\n + \" AND DATEDIFF(CheckOut, DATE(\" + date2 + \")) > 0)\" \n + \" OR (DATEDIFF(CheckIn, DATE(\" + date1 + \")) > 0\" \n + \" AND DATEDIFF(CheckIn, DATE(\" + date2 + \")) <= 0)\" \n + \" OR (DATEDIFF(CheckOut, DATE(\" + date1 + \")) > 0\" \n + \" AND DATEDIFF(CheckOut, DATE(\" + date2 + \")) < 0)\"\n + \" UNION\"\n + \" SELECT DISTINCT RoomId, 'empty' AS status\"\n + \" FROM myRooms\"\n + \" WHERE RoomId NOT IN (\"\n + \" SELECT DISTINCT re.Room\"\n + \" FROM myReservations re JOIN myRooms ro ON (re.Room = ro.RoomId)\"\n + \" WHERE (DATEDIFF(CheckIn, DATE(\" + date1 + \")) <= 0\"\n + \" AND DATEDIFF(CheckOut, DATE(\" + date2 + \")) > 0)\"\n + \" OR (DATEDIFF(CheckIn, DATE(\" + date1 + \")) > 0\"\n + \" AND DATEDIFF(CheckIn, DATE(\" + date2 + \")) <= 0)\" \n + \" OR (DATEDIFF(CheckOut, DATE(\" + date1 + \")) > 0\" \n + \" AND DATEDIFF(CheckOut, DATE(\" + date2 + \")) < 0)\" \n + \" )) AS tb\"\n + \" WHERE RoomId = '\" + roomid + \"'\";\n\n PreparedStatement stmt = null;\n ResultSet rset = null;\n\n try\n {\n stmt = conn.prepareStatement(query);\n rset = stmt.executeQuery();\n rset.next();\n if(rset.getString(\"status\").equals(\"empty\"))\n return true;\n }\n catch (Exception ex){\n ex.printStackTrace();\n }\n finally {\n try {\n stmt.close();\n }\n catch (Exception ex) {\n ex.printStackTrace( ); \n } \t\n }\n \n return false;\n\n }", "private ArrayList<Room> roomAvailability(LocalDate start, LocalDate end, int small, int medium, int large) {\n ArrayList<Room> availableRooms = new ArrayList<Room>();\n // Iterate for all rooms in the venue\n for (Room room : rooms) {\n // Search the venue's reservations that contain the specified room.\n ArrayList<Reservation> reservationsWithRoom = Reservation.searchReservation(reservations, room);\n // Try to find rooms that fulfil the request.\n switch(room.getSize()) {\n case \"small\":\n // Ignore if no small rooms are needed.\n if (small > 0) {\n // If there no reservations with the room or the reserved dates do not\n // overlap, then add the room sinced it is available.\n if(reservationsWithRoom.size() == 0 ||\n !Reservation.hasDateOverlap(reservationsWithRoom, start, end)) {\n\n availableRooms.add(room);\n small--;\n } \n }\n break;\n\n case \"medium\":\n // Ignore if no medium rooms are needed.\n if (medium > 0) {\n \n if (reservationsWithRoom.size() == 0 ||\n !Reservation.hasDateOverlap(reservationsWithRoom, start, end)) {\n \n availableRooms.add(room);\n medium--;\n }\n }\n break;\n\n case \"large\":\n // Ignore if no large rooms ar eneeded.\n if (large > 0) {\n if (reservationsWithRoom.size() == 0 ||\n !Reservation.hasDateOverlap(reservationsWithRoom, start, end)) {\n \n availableRooms.add(room);\n large--;\n }\n break;\n }\n }\n }\n // A request cannot be fulfilled if there are no rooms available in the venue\n if (small > 0 || medium > 0 || large > 0) {\n \n return null;\n } else {\n return availableRooms;\n }\n }", "@RequestMapping(value=\"/add\", method = RequestMethod.POST)\r\n public void addAction(@RequestBody Reservation reservation){\n reservationService.create(reservation);\r\n }", "public Reservation requestRoom(String guestName){\n\t\tfor (int i = 0; i<rooms.length; i++){\n\t\tif (rooms[i] == null){\n\t\t//then create a reservation for an empty room for the specified guest\n\t\t//and return the new Reservation;\n\t\t\trooms[i] = new Reservation(guestName, i);\n\t\t\treturn rooms[i];\n\t\t}\n\t\t}\n\t\t//Otherwise, add the guest into the end of waitList and return null\n\t\twaitList.add(guestName);\n\t\treturn null;\n\t}", "public List<Reservation> sortByDate(List<Reservation> reservations){\n\t\tList<Reservation> sorted = new ArrayList<>(reservations);\n\t\tsorted.sort(Comparator.comparing(Reservation::getDate));\n\t\treturn sorted;\n\t}", "public void updateResv(RoomMgr rm, Reservation r, int choice, int numGuest) {\n\n\t\tScanner sc = new Scanner(System.in);\n\t\tLocalDate localDateNow = LocalDate.now();\n\t\tDateTimeFormatter format = DateTimeFormatter.ofPattern(\"dd-MMM-yyyy\");\n\t\t\n\t\tswitch (choice) {\n\t\tcase 1:\n\t\t\trm.viewAllVacantRoom(numGuest);\n\t\t\twhile (true) {\n\t\t\t\tSystem.out.print(\"Enter Room No to book: \");\n\t\t\t\tString roomNo = sc.nextLine();\n\t\t\t\tif (rm.checkRoomEmpty(roomNo)) {\n\t\t\t\t\tr.setRoomNo(roomNo);\n\t\t\t\t\tbreak;\n\t\t\t\t} else {\n\t\t\t\t\tSystem.out.println(\"Error input!\\n\");\n\t\t\t\t}\n\t\t\t}\n\t\t\tbreak;\n\n\t\tcase 2:\n\t\t\tint adultNo = errorCheckingInt(\"Enter number of adult: \");\n\t\t\tr.setAdultNo(adultNo);\n\t\t\tbreak;\n\n\t\tcase 3:\n\t\t\tint kidNo = errorCheckingInt(\"Enter number of kids: \");\t\n\t\t\tsc.nextLine();\n\t\t\tr.setKidNo(kidNo);\n\t\t\tbreak;\n\n\t\tcase 4:\n\t\t\twhile (true) {\n\t\t\t\tSystem.out.print(\"Enter date check-in (dd-MM-yyyy): \");\n\t\t\t\tString dateIn = sc.nextLine();\n\n\t\t\t\ttry {\n\t\t\t\t\tLocalDate localDateIn = LocalDate.parse(dateIn, format);\n\t\t\t\t\tif (localDateIn.isBefore(localDateNow)) {\n\t\t\t\t\t\tSystem.out.println(\"Error input. Check in date must be after today!\");\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\t\t\t\t\tSystem.out.println(format.format(localDateIn));\n\t\t\t\t\tr.setDateCheckIn(localDateIn);\n\t\t\t\t\tbreak;\n\t\t\t\t} catch (DateTimeParseException e) {\n\t\t\t\t\tSystem.out.println(\"Error input. dd-MM-yyyy = 01-02-2018\");\n\t\t\t\t}\n\t\t\t}\n\t\t\tbreak;\n\n\t\tcase 5:\n\t\t\twhile (true) {\n\t\t\t\tSystem.out.print(\"Enter date check-out (dd-MM-yyyy): \");\n\t\t\t\tString dateOut = sc.nextLine();\n\n\t\t\t\ttry {\n\n\t\t\t\t\tLocalDate localDateOut = LocalDate.parse(dateOut, format);\n\t\t\t\t\tif (localDateOut.isBefore(localDateNow)) {\n\t\t\t\t\t\tSystem.out.println(\"Error input. Check in date must be after today!\");\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\t\t\t\t\tSystem.out.println(format.format(localDateOut));\n\t\t\t\t\tr.setDateCheckOut(localDateOut);\n\t\t\t\t\tbreak;\n\t\t\t\t} catch (DateTimeParseException e) {\n\t\t\t\t\tSystem.out.println(\"Error input. dd-MM-yyyy = 01-02-2018\");\n\t\t\t\t}\n\t\t\t}\n\n\t\tcase 6:\n\t\t\tSystem.out.printf(\"\\n===>Please select from the following:\\n\");\n\t\t\tSystem.out.println(\"(1) \" + rStatus[0]);\n\t\t\tSystem.out.println(\"(2) \" + rStatus[1]);\n\t\t\tSystem.out.println(\"(3) \" + rStatus[2]);\n\t\t\tSystem.out.println(\"(4) \" + rStatus[3]);\n\t\t\tSystem.out.println(\"(5) Return\");\n\t\t\tchoice = errorCheckingInt(\"Select option: \", 5);\n\t\t\tsc.nextLine();\n\n\t\t\tif (choice != 5) {\n\t\t\t\tr.setResvStatus(rStatus[choice - 1]);\n\t\t\t} else {\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tbreak;\n\n\t\tcase 7:\n\t\t\tSystem.out.println(\"Returning.....\");\n\t\t\tbreak;\n\t\t\t\n\t\tdefault:\n\t\t\tSystem.out.println(\"Error input\");\n\t\t\tbreak;\n\n\t\t}\n\t}", "public double MakeReserve(String type, LocalDate indate, LocalDate outdate)\r\n {\n if (Days.daysBetween(lastupdate, outdate).getDays() > 30)\r\n return 0.0;\r\n //Check if checkin date is before today\r\n if (Days.daysBetween(lastupdate, indate).getDays() < 0)\r\n return 0.0;\r\n \r\n int first = Days.daysBetween(lastupdate, indate).getDays();\r\n int last = Days.daysBetween(lastupdate, outdate).getDays();\r\n for (int i = 0; i < roomtypes.size(); i++)\r\n {\r\n boolean ispossible = false;\r\n if (type.equals(roomtypes.get(i).roomname))\r\n {\r\n ispossible = true;\r\n for (int j = first; j < last; j++)\r\n {\r\n if (roomtypes.get(i).reserved[j] >= roomtypes.get(i).roomcount)\r\n ispossible = false;\r\n } \r\n }\r\n if (ispossible)\r\n {\r\n for (int j = first; j < last; j++)\r\n roomtypes.get(i).reserved[j]++;\r\n return roomtypes.get(i).roomlist.get(0).getPrice();\r\n }\r\n }\r\n return 0.0;\r\n }", "public List<ReservationModel> getReservationsByDoctorAndTimeSlot(Integer doctorId, String startDate,\n\t\t\tString startTime) {\n\t\tList<ReservationModel> result = new ArrayList<ReservationModel>();\n\t\tList<Reservation> reservationsList = this.reservationRepository.findByDoctorIdAndTimeSlot(doctorId, startDate,\n\t\t\t\tstartTime);\n\t\tif (reservationsList != null) {\n\t\t\tfor (Reservation reservation : reservationsList) {\n\t\t\t\tresult.add(reservation.toModel(this.mapper));\n\t\t\t}\n\t\t}\n\t\treturn result;\n\t}", "@Override\n\tprotected void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {\n\t\tHttpSession hpSession = req.getSession();\n\t\tUser u = (User) hpSession.getAttribute(\"user\");\n\t\tString start=req.getParameter(\"Start\");\n\t\tString end=req.getParameter(\"End\");\n\t\tif(start==null||end==null){\n\t\t\tSimpleDateFormat sdf = new SimpleDateFormat(\"yyyyMMdd\");\n\t\t\tjava.util.Date now=new java.util.Date();\n\t\t\tjava.util.Date next=new Date(now.getTime()+24*3600*1000);\n\t\t\tstart=sdf.format(now.getTime());\n\t\t\tend=sdf.format(next.getTime());\n\t\t}\n//\t\t查找需要加上日期\n\n\t\tif (u != null && u.getUserType() == 1) {\n\t\t\tList<Roomdisplay> roomdisplayList = roomdisplayServiceImpl.findAll();\n\t\t\treq.setAttribute(\"roomdisplayList\", roomdisplayList);\n\n\t\t\treq.getRequestDispatcher(resp.encodeURL(\"/jsp/user/reserve.jsp\")).forward(req, resp);\n\t\t} else {\n\t\t\tSystem.out.println(\"ReserveServlet get user failed!\");\n\t\t\treq.getRequestDispatcher(resp.encodeURL(\"/jsp/common/login.jsp\")).forward(req, resp);\n\t\t}\n\n\t}", "public Collection<ReservationHistoryDTO> getCurrentReservations() throws ResourceNotFoundException{\n\t\tRegisteredUser currentUser = (RegisteredUser) SecurityContextHolder.getContext().getAuthentication().getPrincipal();\n\t\t\n\t\t\n\t\tRegisteredUser currentUserFromBase = registeredUserRepository.getOne(currentUser.getId());\n\t\t\n\t\tCollection<Reservation> reservations = currentUserFromBase.getReservations();\n\t\t\n\t\tif(reservations==null) {\n\t\t\tthrow new ResourceNotFoundException(\"User \"+currentUserFromBase.getUsername()+\" made non reservation!\");\n\t\t}\n\n\t\tHashSet<ReservationHistoryDTO> reservationsDTO = new HashSet<ReservationHistoryDTO>();\n\t\t\n\t\t\n\t\t\n\t\tfor(Reservation reservation : reservations) {\n\t\t\tif(!reservation.getHasPassed()) {\n\t\t\t\n\t\t\t\tReservationHistoryDTO reservationDTO = new ReservationHistoryDTO();\n\t\t\t\t\n\t\t\t\tFlightReservation flightReservation = reservation.getFlightReservation();\n\t\t\t\tRoomReservation roomReservation = reservation.getRoomReservation();\n\t\t\t\tVehicleReservation vehicleReservation = reservation.getVehicleReservation();\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t\n\t\t\t\tFlight flight = flightReservation.getSeat().getFlight();\n\t\t\t\t\n\t\t\t\t\n\t\t\t\tLong reservationId = reservation.getId();\n\t\t\t\tLong flightId = flight.getId();\n\t\t\t\tString departureName = flight.getDeparture().getName();\n\t\t\t\tString destinationName = flight.getDestination().getName();\n\t\t\t\tDate departureDate = flight.getDepartureDate();\n\t\t\t\tLong airlineId = flight.getAirline().getId();\n\t\t\t\t\n\t\t\t\treservationDTO.setReservationId(reservationId);\n\t\t\t\t\n\t\t\t\treservationDTO.setFlightId(flightId);\n\t\t\t\treservationDTO.setDepartureName(departureName);\n\t\t\t\treservationDTO.setDestinationName(destinationName);\n\t\t\t\treservationDTO.setDepartureDate(departureDate);\n\t\t\t\treservationDTO.setAirlineId(airlineId);\n\t\t\t\t\n\t\t\t\t\n\t\t\t\tif(roomReservation != null) {\n\t\t\t\t\tRoomType roomType = reservation.getRoomReservation().getRoom().getRoomType();\n\t\t\t\t\tif(roomType!= null) {\n\t\t\t\t\t\treservationDTO.setRoomTypeId(roomType.getId());\n\t\t\t\t\t\treservationDTO.setHotelId(roomReservation.getRoom().getHotel().getId());\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tif(vehicleReservation != null) {\n\t\t\t\t\tVehicle vehicle = reservation.getVehicleReservation().getReservedVehicle();\n\t\t\t\t\tif(vehicle != null) {\n\t\t\t\t\t\treservationDTO.setVehicleId(vehicle.getId());\n\t\t\t\t\t\treservationDTO.setRentACarId(vehicle.getBranchOffice().getMainOffice().getId());\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\n\t\t\t\treservationsDTO.add(reservationDTO);\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn reservationsDTO;\n\t\t\n\t}", "public int checkRooms(LocalDate bookdate, int stay, int type, int req, ArrayList<Integer> array) {\n\t\t\t\r\n\t\t\tint i = 0;\r\n\t\t\tint k = 0;\r\n\t\t\tint j = 0;\r\n\t\t\tint count = 0;\r\n\t\t\tBooking bookChecker = null; //Saves the bookings of a hotel to be checked\r\n\t\t\tRooms roomChecker = null; //Saves the rooms of the hotel\r\n\t\t\tLocalDate endBook = bookdate.plusDays(stay); //booking start date + number of nights\r\n\t\t\tboolean booked = false;\r\n\r\n\t\t\tif(req == 0) return 0; //if theres no need for single/double/triple room\r\n\t\t\t\r\n\t\t\twhile(i < RoomDetails.size()) { //checking room-wise order\r\n\t\t\t\troomChecker = RoomDetails.get(i);\r\n\t\t\t\tif(type == roomChecker.getCapacity()) { //only check if its the same room type as needed\r\n\t\t\t\t\tk = 0;\r\n\t\t\t\t\twhile(k < Bookings.size()) { //check for bookings of a room\r\n\t\t\t\t\t\tbookChecker = Bookings.get(k);\r\n\t\t\t\t\t\tj=0;\r\n\t\t\t\t\t\tbooked = false;\r\n\t\t\t\t\t\twhile(j < bookChecker.getNumOfRoom()) { //To check if a booked room have clashing schedule with new booking\r\n\t\t\t\t\t\t\tif(roomChecker.getRoomNum() == bookChecker.getRoomNumber(j)) { //if there is a booking for the room\r\n\t\t\t\t\t\t\t\tif(bookdate.isEqual(bookChecker.endDate()) || endBook.isEqual(bookChecker.getStartDate())) {\r\n\t\t\t\t\t\t\t\t\t//New booking starts at the same day where another booking ends\r\n\t\t\t\t\t\t\t\t\tbooked = false; //No clash\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\telse if(bookdate.isAfter(bookChecker.endDate()) || endBook.isBefore(bookChecker.getStartDate())) {\r\n\t\t\t\t\t\t\t\t\t//New booking starts days after other booking ends, or new booking ends before other booking starts\r\n\t\t\t\t\t\t\t\t\tbooked = false; //no clash\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\telse { //Any other way means that it clashes and hence room cant be booked\r\n\t\t\t\t\t\t\t\t\tbooked = true;\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t\tif(booked == true) break; //if booked and clash , break\r\n\t\t\t\t\t\t\tj++;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tif(booked == true) break; //if booked and clash , break\r\n\t\t\t\t\t\tk++;\r\n\t\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\t\tif(booked == false) {\r\n\t\t\t\t\t\tarray.add(roomChecker.getRoomNum()); //if no clashing dates, book the room for new cust\r\n\t\t\t\t\t\tcount++;\r\n\t\t\t\t\t}\r\n\t\t\t\t\tif (count == req) break; //if there is enough room already, finish\r\n\t\t\t\t}\r\n\t\t\t\ti++;\r\n\t\t\t}\r\n\t\t\treturn count; //returns the number of available rooms acquired\r\n\t\t}", "public static void main(String[] args) throws IOException {\n Scanner scanner = new Scanner(System.in);\r\n \r\n RoomManager rm = new RoomManager();\r\n String text;\r\n int input = 0;\r\n while (input != 5)\r\n {\r\n System.out.println(\"1. add type, 2. add room, 3. rooms avail, 4. reserve\");\r\n input = scanner.nextInt();\r\n \r\n if (input == 1)\r\n {\r\n System.out.println(\"Enter name of room type\");\r\n text = scanner.next();\r\n rm.AddRoomType(text);\r\n }\r\n if (input == 2)\r\n {\r\n System.out.println(\"Enter room type\");\r\n text = scanner.next();\r\n double money;\r\n int roomn;\r\n System.out.println(\"Enter room number\");\r\n roomn = scanner.nextInt();\r\n System.out.println(\"Enter room cost\");\r\n money = scanner.nextDouble();\r\n rm.AddRoom(text, roomn, money);\r\n }\r\n if (input == 3)\r\n {\r\n LocalDate before = new LocalDate();\r\n LocalDate after = new LocalDate();\r\n System.out.println(\"Enter number of day from now to checkin\");\r\n int days = scanner.nextInt();\r\n before = before.plusDays(days);\r\n System.out.println(\"Enter number of day from now to checkout\");\r\n days = scanner.nextInt();\r\n after = after.plusDays(days);\r\n rm.CheckAvail(before, after);\r\n }\r\n if (input == 4)\r\n {\r\n LocalDate before = new LocalDate();\r\n LocalDate after = new LocalDate();\r\n System.out.println(\"Enter number of day from now to checkin\");\r\n int days = scanner.nextInt();\r\n before.plusDays(days);\r\n System.out.println(\"Enter number of day from now to checkout\");\r\n days = scanner.nextInt();\r\n after.plusDays(days);\r\n System.out.println(\"Enter room type\");\r\n text = scanner.next();\r\n double rmprice = rm.MakeReserve(text, before, after);\r\n System.out.println(rmprice);\r\n //rm.CheckAvail(before, after);\r\n }\r\n }\r\n }", "private static void getReview() {\n try {\n //Check if the driver class is available\n Class.forName(JDBC_DRIVER).newInstance();\n\n // Do the base connection\n Connection connection = DriverManager.getConnection(JDNC_DB_URL, JDBC_USER, JDBC_PASS);\n\n // Add the statement\n PreparedStatement preparedStatement = connection.prepareStatement(\"select roomName, Month, sum(rev) as Revenue from\\n\" +\n \"\\t(select roomName, MONTH(checkOut) as Month, r2.rate * DATEDIFF(checkOut, CheckIn) as Rev from \\n\" +\n \"\\tReservations r1 join Rooms r2 on r1.roomID = r2.roomID) as Prices\\n\" +\n \" group by roomName, Month\\n\" +\n \" order by roomName, Month;\");\n\n ResultSet resultSet = preparedStatement.executeQuery();\n\n int month = 1;\n\n ManagerRoom currentRoom = new ManagerRoom(\"filler\");\n ArrayList<ManagerRoom> rooms = new ArrayList<>();\n\n while (resultSet.next()) {\n if (month == 13){\n currentRoom.setTotal();\n rooms.add(currentRoom);\n month = 1;\n }\n int m = resultSet.getInt(\"Month\");\n int rev = resultSet.getInt(\"Revenue\");\n\n if (month == 1) {\n String name = resultSet.getString(\"roomName\");\n currentRoom = new ManagerRoom(name);\n }\n\n currentRoom.addMonthRevenue(m-1, rev);\n\n month += 1;\n }\n\n String header = String.format(\"%27s%10s%10s%10s%10s%10s%10s%10s%10s%10s%10s%10s%10s%10s\\n\", \"Room Name\",\n \"Jan.\", \"Feb.\", \"Mar.\", \"Apr.\", \"May.\", \"Jun.\", \"Jul.\", \"Aug.\", \"Sept.\", \"Oct.\", \"Nov.\", \"Dec.\", \"Total\");\n\n String barrier = \"\";\n for (int i = 0; i < header.length(); i++){\n barrier += \"-\";\n }\n\n System.out.println(barrier);\n System.out.println(\"YEARLY REPORT\");\n System.out.println(barrier);\n System.out.println(header + barrier);\n\n for (ManagerRoom r : rooms){\n System.out.println(r.toString());\n }\n\n System.out.println(barrier + \"\\n\");\n\n } catch (Exception sqlException) {\n sqlException.printStackTrace();\n }\n }", "Collection<Reservation> getReservations() throws DataAccessException;", "protected static String scheduleRoom(ArrayList<Room> roomList) {\n if (roomList.size() > 0) {\n System.out.println(\"Schedule a room:\");\n String name = getRoomName();\n // if (findRoomIndex(roomList, name) != -1) {\n System.out.println(\"Start Date? (yyyy-mm-dd):\");\n String startDate = keyboard.next();\n System.out.println(\"Start Time?\");\n String startTime = keyboard.next();\n startTime = startTime + \":00.0\";\n \n String tStartDate = startDate + startTime;\n String avRooms = availableRooms(roomList,tStartDate);\n \n System.out.println(\"End Date? (yyyy-mm-dd):\");\n String endDate = keyboard.next();\n System.out.println(\"End Time?\");\n String endTime = keyboard.next();\n endTime = endTime + \":00.0\";\n Timestamp startTimestamp = Timestamp.valueOf(startDate + \" \"\n + startTime);\n Timestamp endTimestamp = Timestamp.valueOf(endDate + \" \" + endTime);\n\n System.out.println(\"Subject?\");\n String subject = keyboard.next();\n Room curRoom = getRoomFromName(roomList, name);\n Meeting meeting = new Meeting(startTimestamp, endTimestamp, subject);\n\n // check wheather time is already exists for timestamp\n curRoom.addMeeting(meeting);\n return \"Successfully scheduled meeting!\";\n\n } else {\n return \"No room is available for schedule\";\n }\n }", "Sporthall() {\n reservationsList = new ArrayList<>();\n }", "@Query(value = FIND_BOOKED_DATES)\n\tpublic List<BookingDate> getBooking(Date startDate, Date endDate);", "public boolean isSetReservations() {\n return this.reservations != null;\n }", "public static int room_booking(int start, int end){\r\n\r\n\t\tint selected_room = -1;\r\n\t\t// booking_days list is to store all the days between start and end day\r\n\t\tList<Integer> booking_days = new ArrayList<>();\r\n\t\tfor(int i=start;i<=end; i++) {\r\n\t\t\tbooking_days.add(i);\r\n\t\t}\r\n\r\n\t\tfor(int roomNo : hotel_size) {\r\n\r\n\t\t\tif(room_bookings.keySet().contains(roomNo)) {\r\n\t\t\t\tfor (Map.Entry<Integer, Map<Integer,List<Integer>>> entry : room_bookings.entrySet()) {\r\n\r\n\t\t\t\t\tList<Integer> booked_days_for_a_room = new ArrayList<Integer>();\r\n\t\t\t\t\tif(roomNo == entry.getKey()) {\r\n\t\t\t\t\t\tentry.getValue().forEach((bookingId, dates)->{\r\n\t\t\t\t\t\t\tbooked_days_for_a_room.addAll(dates);\r\n\t\t\t\t\t\t});\r\n\t\t\t\t\t\tList<Integer> check_elements = new ArrayList<Integer>();\r\n\t\t\t\t\t\tfor(int element : booking_days) {\r\n\t\t\t\t\t\t\tif(booked_days_for_a_room.contains(element)) {\r\n\t\t\t\t\t\t\t\tstatus = false;\r\n\t\t\t\t\t\t\t\tbreak;\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\tcheck_elements.add(element);\r\n\t\t\t\t\t\t\t\tselected_room = roomNo;\r\n\t\t\t\t\t\t\t\tstatus = true;\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tif(status) {\r\n\t\t\t\t\t\t\tselected_room = roomNo;\r\n\t\t\t\t\t\t\treturn selected_room;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\tselected_room = roomNo;\r\n\t\t\t\tstatus = true;\r\n\t\t\t\treturn selected_room;\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn selected_room;\r\n\t}", "Reservation createReservation();", "@Override\n\tpublic List<PropertyRooms> findRoomByTenancyDetailsIncludingVacantRooms(\n\t\t\tTenancyForm occupiedBy) {\n\t\tList<PropertyRooms> rooms1=hibernateTemplate.find(\"from PropertyRooms where occupiedBy=? \",occupiedBy);\n\t\tList<PropertyRooms> rooms2=hibernateTemplate.find(\"from PropertyRooms where isOccupied=?\",'N');\n\t\t\n\t\trooms1.addAll(rooms2);\n\t\t\n\t\treturn rooms1;\n\t}", "@Operation(\n summary = \"Get a list of all reservations\"\n )\n @ApiResponses(\n @ApiResponse(\n responseCode = \"200\",\n description = \"Successful Response\",\n content = @Content(array = @ArraySchema(schema = @Schema(implementation =\n Reservation.class)))\n )\n )\n @GetMapping(\n path = \"/reservations\",\n produces = APPLICATION_JSON_VALUE\n )\n public ResponseEntity<List<Reservation>> getReservation() {\n List<Reservation> listofReservations = (List<Reservation>) reservationsRepository.findAll();\n return new ResponseEntity(listofReservations, HttpStatus.OK);\n }", "List<Doctor> getAvailableDoctors(java.util.Date date, String slot) throws CliniqueException;", "public void actionPerformed(ActionEvent e) {\n\t\t\t\tmodelDates.setRowCount(0);\r\n\t\t\t\tif (dateCheckIn.getDate() == null || dateCheckOut.getDate() == null) {\r\n\t\t\t\t\tlblInvalidDate.setForeground(Color.RED);\r\n\t\t\t\t\tlblInvalidDate.setText(\"No date selected!\");\r\n\t\t\t\t} else {\r\n\r\n\t\t\t\t\tlong diffDays = ChronoUnit.DAYS.between(dateCheckIn.getDate().toInstant(),\r\n\t\t\t\t\t\t\tdateCheckOut.getDate().toInstant());\r\n\r\n\t\t\t\t\tint selectedRowIndex = table.getSelectedRow();\r\n\r\n\t\t\t\t\tPeriod pastDate = Period.between(date.toInstant().atZone(ZoneId.systemDefault()).toLocalDate(),\r\n\t\t\t\t\t\t\tdateCheckIn.getDate().toInstant().atZone(ZoneId.systemDefault()).toLocalDate());\r\n\r\n\t\t\t\t\tif (diffDays <= 0 || selectedRowIndex == -1 || pastDate.getDays() < 0) {\r\n\r\n\t\t\t\t\t\tlblInvalidDate.setForeground(Color.RED);\r\n\t\t\t\t\t\tlblInvalidDate.setText(\"Invalid dates or no room selected!\");\r\n\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\tSessionFactory factory = new Configuration().configure(\"hibernate.cfg.xml\")\r\n\t\t\t\t\t\t\t\t.addAnnotatedClass(Customer.class).addAnnotatedClass(Rooms.class)\r\n\t\t\t\t\t\t\t\t.addAnnotatedClass(Reservation.class).addAnnotatedClass(Review.class)\r\n\t\t\t\t\t\t\t\t.buildSessionFactory();\r\n\r\n\t\t\t\t\t\tSession session = factory.getCurrentSession();\r\n\r\n\t\t\t\t\t\ttry {\r\n\t\t\t\t\t\t\tsession.beginTransaction();\r\n\t\t\t\t\t\t\tQuery customerQ = session.createQuery(\"from Customer where email=:custEmail\");\r\n\t\t\t\t\t\t\tcustomerQ.setParameter(\"custEmail\", lblUserEmail.getText());\r\n\r\n\t\t\t\t\t\t\tCustomer customer = (Customer) customerQ.getResultList().get(0);\r\n\r\n\t\t\t\t\t\t\tQuery roomQ = session.createQuery(\"from Rooms where roomNumber=:roomNr\");\r\n\t\t\t\t\t\t\troomQ.setParameter(\"roomNr\", lblGetRN.getText());\r\n\t\t\t\t\t\t\tRooms room = (Rooms) roomQ.getResultList().get(0);\r\n\r\n\t\t\t\t\t\t\tQuery resQ = session.createQuery(\"from Reservation where room_id=:roomId\");\r\n\t\t\t\t\t\t\tresQ.setParameter(\"roomId\", room.getId());\r\n\t\t\t\t\t\t\t@SuppressWarnings(\"unchecked\")\r\n\t\t\t\t\t\t\tList<Reservation> resList = resQ.getResultList();\r\n\t\t\t\t\t\t\tint boolRes = 0;\r\n\t\t\t\t\t\t\tfor(int i = 0; i<resList.size();i++) {\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\tif((dateCheckIn.getDate().compareTo(resList.get(i).getCheckOut()) <0) && (dateCheckOut.getDate().compareTo(resList.get(i).getCheckIn()) > 0)) {\r\n\t\t\t\t\t\t\t\t\tJOptionPane.showMessageDialog(btnCreateReservation, \"The room is reserved at this date\");\r\n\t\t\t\t\t\t\t\t\tboolRes = 1;\r\n\t\t\t\t\t\t\t\t\trowDates[0] = resList.get(i).getCheckIn();\r\n\t\t\t\t\t\t\t\t\trowDates[1] = resList.get(i).getCheckOut();\r\n\t\t\t\t\t\t\t\t\tmodelDates.addRow(rowDates);\r\n\t\t\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\telse {\r\n\t\t\t\t\t\t\t\t\tboolRes= 0;\r\n\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\ttableDates.setModel(modelDates);\r\n\t\t\t\t\t\t\tif(boolRes == 0) {\r\n\t\t\t\t\t\t\t\t\r\n\r\n\t\t\t\t\t\t\tdouble totalPrice = room.getPrice() * diffDays;\r\n\r\n\t\t\t\t\t\t\tjava.sql.Date sqldateCheckIn = new java.sql.Date(dateCheckIn.getDate().getTime());\r\n\t\t\t\t\t\t\tjava.sql.Date sqldateCheckOut = new java.sql.Date(dateCheckOut.getDate().getTime());\r\n\r\n\t\t\t\t\t\t\tReservation reserve = new Reservation(customer, room, sqldateCheckIn, sqldateCheckOut,\r\n\t\t\t\t\t\t\t\t\ttotalPrice);\r\n\r\n\t\t\t\t\t\t\tint answer = JOptionPane.showConfirmDialog(btnCreateReservation,\r\n\t\t\t\t\t\t\t\t\t\"Total price is: \" + totalPrice + \". Are you agree?\", \"Warning\",\r\n\t\t\t\t\t\t\t\t\tJOptionPane.YES_NO_OPTION, JOptionPane.WARNING_MESSAGE);\r\n\t\t\t\t\t\t\tif (answer == JOptionPane.YES_OPTION) {\r\n\r\n\t\t\t\t\t\t\t\tsession.save(reserve);\r\n\t\t\t\t\t\t\t\tlblInvalidDate.setForeground(Color.GREEN);\r\n\t\t\t\t\t\t\t\tlblInvalidDate.setText(\"Reservation succesfully created!\");\r\n\r\n\t\t\t\t\t\t\t\t@SuppressWarnings(\"unchecked\")\r\n\t\t\t\t\t\t\t\tList<Rooms> roomsList = (List<Rooms>) session\r\n\t\t\t\t\t\t\t\t\t\t.createQuery(\"from Rooms\").list();\r\n\t\t\t\t\t\t\t\tmodel = new DefaultTableModel();\r\n\r\n\t\t\t\t\t\t\t\tmodel.setColumnIdentifiers(column);\r\n\r\n\t\t\t\t\t\t\t\tfor (int i = 0; i < roomsList.size(); i++) {\r\n\t\t\t\t\t\t\t\t\trow[0] = roomsList.get(i).getRoomNumber();\r\n\t\t\t\t\t\t\t\t\trow[1] = roomsList.get(i).getPrice();\r\n\t\t\t\t\t\t\t\t\trow[2] = roomsList.get(i).getRoomType();\r\n\t\t\t\t\t\t\t\t\tmodel.addRow(row);\r\n\t\t\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\t\t\ttable.setModel(model);\r\n\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\tsession.getTransaction().commit();\r\n\t\t\t\t\t\t\t}}\r\n\r\n\t\t\t\t\t\t} finally {\r\n\t\t\t\t\t\t\tfactory.close();\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}", "public List<Reservation>reporteFechas(String date1, String date2){\n\n\t\t\tSimpleDateFormat parser = new SimpleDateFormat(\"yyyy-MM-dd\");\n\t\t\tDate dateOne = new Date();\n\t\t\tDate dateTwo = new Date();\n\n\t\t\ttry {\n\t\t\t\tdateOne = parser.parse(date1);\n\t\t\t\tdateTwo = parser.parse(date2);\n\t\t\t} catch (ParseException e) {\n\n\t\t\t\te.printStackTrace();\n\t\t\t}\n\t\t\tif(dateOne.before(dateTwo)){\n\t\t\t\treturn repositoryR.reporteFechas(dateOne, dateTwo);\n\t\t\t}else{\n\t\t\t\treturn new ArrayList<>();\n\t\t\t}\n\n\t \t\n\t }", "protected void processRequest(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException, SQLException, ClassNotFoundException {\n response.setContentType(\"text/html;charset=UTF-8\");\n SQLpooler sqlpooler = new SQLpooler();\n Connection conn = sqlpooler.makeMyConnection();\n try\n {\n String sp = request.getParameter(\"specialiazation\");\n String date = request.getParameter(\"appdate\");\n Date date1 = new Date();\n SimpleDateFormat formatter = new SimpleDateFormat (\"dd-MMM-yy\");\n \n Date date2 = formatter.parse(date);\n \n if(date2.compareTo(date1)< 0 )\n {\n request.setAttribute(\"apperror\", \"invaid date entry\");\n request.getRequestDispatcher(\"/makeNewAppointment.jsp\").forward(request, response); \n }\n else\n {\n String sql = \"select * from timeslots ts inner join doctors d on slotNo \"\n + \"NOT IN ( select slotNo from doctors d inner join appointments a on \"\n + \"d.doctorId = a.doctorId and a.appdate = '\" + date + \"') where d.doctorid in (select \"\n + \"do.doctorid from doctors do inner join doctorspecialization ds on \"\n + \"do.doctorid = ds.doctorId where specialization = '\" + sp + \"')\";\n PreparedStatement preStatement = conn.prepareStatement(sql);\n String sch = \"\";\n ResultSet result = preStatement.executeQuery();\n while (result.next())\n {\n sch = sch + result.getString(\"DOCTORID\") + \";\" + result.getString(\"DOCTORNAME\") + \";\" + result.getString(\"STARTTIME\")+ \";\" + result.getString(\"ENDTIME\") + \";\" + result.getString(\"TYPE\") + \",\"; \n }\n HttpSession session = request.getSession(true);\n request.setAttribute(\"sch\", sch);\n session.setAttribute(\"date\", date);\n session.setAttribute(\"sp\", sp);\n request.getRequestDispatcher(\"/scheduleForAppointment.jsp\").forward(request, response);\n }\n }catch (ParseException pe)\n {\n request.setAttribute(\"apperror\", \"invaid data entry\");\n request.getRequestDispatcher(\"/makeNewAppointment.jsp\").forward(request, response); \n\n }finally {\n\t\t\tconn.close();\n\t\t}\n }", "@RequestMapping(value = \"/vacantrooms\", method = RequestMethod.GET)\n public ArrayList<Room> vacantRooms(){\n ArrayList<Room> listroom = DatabaseRoom.getVacantRooms();\n return listroom;\n }", "@Test\n\tpublic void testListReservationsOfFacilityAfterInterval() {\n\t\t// create a reservation\n\t\tCalendar cal = Calendar.getInstance();\n\n\t\t// list start is now\n\t\tDate listStart = cal.getTime();\n\t\tcal.add(Calendar.HOUR, 24);\n\t\t// list end is now + 24h\n\t\tDate listEnd = cal.getTime();\n\n\t\t// first reservation is 1 second after list end\n\t\tcal.add(Calendar.SECOND, 1);\n\t\tDate reservation1StartDate = cal.getTime();\n\t\tcal.add(Calendar.HOUR, +2);\n\t\tDate reservation1EndDate = cal.getTime();\n\t\tdataHelper.createPersistedReservation(USER_ID, Arrays.asList(room1.getId()), reservation1StartDate,\n\t\t\t\treservation1EndDate);\n\n\t\t// should not find above reservation\n\t\tCollection<Reservation> reservationsOfFacility;\n\t\treservationsOfFacility = bookingManagement.listReservationsOfFacility(room1.getId(), listStart, listEnd);\n\n\t\tassertNotNull(reservationsOfFacility);\n\t\tassertTrue(reservationsOfFacility.isEmpty());\n\t}", "public Reservation getReservation(final String routeName, final LocalDate date, final UUID reservationId) {\n ReservationModel reservationModel = reservationRepository\n .findByRouteNameAndDateAndReservationId(routeName, date, reservationId).orElseThrow(() ->\n new NotFoundException(\"Reservation Not Found\"));\n\n return routeMapper.toReservation(reservationModel);\n }", "CurrentReservation createCurrentReservation();", "List<Reservierung> selectAll() throws ReservierungException;", "public void ReservaEfetivadas () {\n Date hoje = new Date ();\n for (int z = 0; z < vecReserva.size(); z++) {\n if (((int) ((((entReserva)vecReserva.elementAt(z)).getDatain().getTime() - (hoje.getTime())) / 86400000L)) == 0){// Reserva será relaizada hj\n if (((entReserva)vecReserva.elementAt(z)).getPagamento().getSituacao() == 0){//Cliente fez todo o pagamento e o quarto será\n vecReservaEfetivadas.add(vecReserva.elementAt(z));\n }\n \n }\n }\n }", "@RequestMapping(value = \"/Reservation\", method = RequestMethod.POST)\n\t@ResponseBody\n\tpublic Reservation newReservation(@RequestBody Reservation reservation) {\n\t\treservationService.saveReservation(reservation);\n\t\treturn reservationDAO.findReservationByPrimaryKey(reservation.getReservationId());\n\t}", "public List<Reserva> getReservasPeriod(String dateOne, String dateTwo){\n /**\n * Instancia de SimpleDateFormat para dar formato correcto a fechas.\n */\n SimpleDateFormat parser = new SimpleDateFormat(\"yyyy-MM-dd\");\n /**\n * Crear nuevos objetos Date para recibir fechas fomateadas.\n */\n Date dateOneFormatted = new Date();\n Date dateTwoFormatted = new Date();\n /**\n * Intentar convertir las fechas a objetos Date; mostrar registro de\n * la excepción si no se puede.\n */\n try {\n dateOneFormatted = parser.parse(dateOne);\n dateTwoFormatted = parser.parse(dateTwo);\n } catch (ParseException except) {\n except.printStackTrace();\n }\n /**\n * Si la fecha inicial es anterior a la fecha final, devuelve una lista\n * de Reservas creadas dentro del intervalo de fechas; si no, devuelve\n * un ArrayList vacío.\n */\n if (dateOneFormatted.before(dateTwoFormatted)){\n return repositorioReserva.findAllByStartDateAfterAndStartDateBefore\n (dateOneFormatted, dateTwoFormatted);\n } else {\n return new ArrayList<>();\n }\n }", "@PostMapping(URLs.SCHEDULE)\n public ModelAndView stationSchedule(@RequestParam(value = \"start\") String stationName,\n @RequestParam(value = \"date\") String date) {\n Map<String, Object> modelMap = new HashMap<>();\n try {\n List<Schedule> sch = scheduleService.getAllTrainsOnStation(stationName, date);\n if (sch.size() == 0) {\n modelMap.put(\"noTrains\", \"true\");\n return new ModelAndView(VIEWs.SCHEDULE, \"model\", modelMap);\n }\n modelMap.put(\"showSchedule\", \"true\");\n modelMap.put(\"scheduleList\", sch);\n return new ModelAndView(VIEWs.SCHEDULE_TABLE, \"model\", modelMap);\n } catch (ParseException ex) {\n log.info(\"PARSE EXCEPTION inside schedule form\");\n modelMap.put(\"parseException\", \"true\");\n return new ModelAndView(VIEWs.SCHEDULE, \"model\", modelMap);\n }\n }", "@Test\n\tpublic void testListReservationsOfFacilityInInterval() {\n\t\t// create a reservation\n\t\tCalendar cal = Calendar.getInstance();\n\n\t\t// list start is now\n\t\tDate listStart = cal.getTime();\n\t\tcal.add(Calendar.HOUR, 24);\n\t\t// list end is now + 24h\n\t\tDate listEnd = cal.getTime();\n\n\t\tcal.add(Calendar.HOUR, -23);\n\n\t\t// first reservation is from now +1 to now +3\n\t\tDate reservation1StartDate = cal.getTime();\n\t\tcal.add(Calendar.HOUR, +2);\n\t\tDate reservation1EndDate = cal.getTime();\n\t\tReservation reservation1 = dataHelper.createPersistedReservation(USER_ID, Arrays.asList(room1.getId()),\n\t\t\t\treservation1StartDate, reservation1EndDate);\n\n\t\t// second reservation is from now +4 to now +5\n\t\tcal.add(Calendar.HOUR, 1);\n\t\tDate reservation2StartDate = cal.getTime();\n\n\t\tcal.add(Calendar.HOUR, 1);\n\t\tDate reservation2EndDate = cal.getTime();\n\n\t\tReservation reservation2 = dataHelper.createPersistedReservation(USER_ID,\n\t\t\t\tArrays.asList(room1.getId(), infoBuilding.getId()), reservation2StartDate, reservation2EndDate);\n\n\t\t// should find both above reservation\n\t\tCollection<Reservation> reservationsOfFacility;\n\t\treservationsOfFacility = bookingManagement.listReservationsOfFacility(room1.getId(), listStart, listEnd);\n\n\t\tassertNotNull(reservationsOfFacility);\n\t\tassertEquals(2, reservationsOfFacility.size());\n\t\tassertTrue(reservationsOfFacility.contains(reservation1));\n\t\tassertTrue(reservationsOfFacility.contains(reservation2));\n\t}", "@Test\n\tpublic void testListReservationsOfFacilityBeforeInterval() {\n\t\t// create a reservation\n\t\tCalendar cal = Calendar.getInstance();\n\n\t\t// list start is now\n\t\tDate listStart = cal.getTime();\n\t\tcal.add(Calendar.HOUR, 24);\n\t\t// list end is now + 24h\n\t\tDate listEnd = cal.getTime();\n\n\t\t// first reservation start date is 1 hour before list start\n\t\tcal.add(Calendar.HOUR, -26);\n\t\tDate reservation1StartDate = cal.getTime();\n\t\tcal.add(Calendar.HOUR, +1);\n\t\tDate reservation1EndDate = cal.getTime();\n\t\tdataHelper.createPersistedReservation(USER_ID, Arrays.asList(room1.getId()), reservation1StartDate,\n\t\t\t\treservation1EndDate);\n\n\t\t// should not find above reservation\n\t\tCollection<Reservation> reservationsOfFacility;\n\t\treservationsOfFacility = bookingManagement.listReservationsOfFacility(room1.getId(), listStart, listEnd);\n\n\t\tassertNotNull(reservationsOfFacility);\n\t\tassertTrue(reservationsOfFacility.isEmpty());\n\t}", "void addReservation(ReservationDto reservationDto) ;", "@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n try {\n Database db = Database.getDatabase();\n String check = request.getParameter(\"btnCheck\");\n String checkIn = request.getParameter(\"txtCheckIn\");\n String checkOut = request.getParameter(\"txtCheckOut\");\n String rType = request.getParameter(\"ddlRoomTypes\");\n String q = request.getParameter(\"ddlNumRooms\");\n\n String msg = null;\n\n int rmAvail = db.getAvailableRoomQuantity(checkIn, checkOut, rType);\n\n if (check != null && !checkIn.isEmpty() && !checkOut.isEmpty() && rType != null && q != null) {\n int qty = Integer.parseInt(q);\n if (qty <= rmAvail) {\n msg = \"From \" + checkIn + \" to \" + checkOut + \", \" + rmAvail + \" \" + rType + \" room/s left.\";\n } else if (qty > rmAvail) {\n msg = \"Arrival Date: \" + checkIn + \"<br/>\"\n + \"Departure Date: \" + checkOut + \"<br/>\"\n + \"You have selected \" + qty + \" rooms.<br/>\"\n + \"No available \" + rType + \" rooms.<br/>\";\n } \n } else {\n msg = \"Please enter empty fields.\"; \n }\n request.setAttribute(\"msg\", msg);\n RequestDispatcher rd = request.getRequestDispatcher(\"_home.jsp\");\n rd.forward(request, response);\n\n } catch (Exception ex) {\n Logger.getLogger(CheckAvailable.class.getName()).log(Level.SEVERE, null, ex);\n }\n\n }", "@RequestMapping(value = \"/Reservation/{reservation_reservationId}/room\", method = RequestMethod.POST)\n\t@ResponseBody\n\tpublic Room newReservationRoom(@PathVariable Integer reservation_reservationId, @RequestBody Room room) {\n\t\treservationService.saveReservationRoom(reservation_reservationId, room);\n\t\treturn roomDAO.findRoomByPrimaryKey(room.getRoomId());\n\t}", "@Test\n\tpublic void testListReservationsOfFacilityNoMatch() {\n\t\t// create a reservation of another user\n\t\tdataHelper.createPersistedReservation(USER_ID, Arrays.asList(room1.getId()), validStartDate, validEndDate);\n\n\t\t// should not find above reservation\n\t\tCollection<Reservation> reservationsOfFacility;\n\t\treservationsOfFacility = bookingManagement.listReservationsOfFacility(infoBuilding.getId(),\n\t\t\t\tvalidStartDate, validEndDate);\n\t\tassertNotNull(reservationsOfFacility);\n\t\tassertTrue(reservationsOfFacility.isEmpty());\n\t}", "private void createEvent() \n\t{\n\t\t// When the user clicks on the add button\n\t\tbtnAdd.addActionListener(new ActionListener() \n\t\t{\n\t\t\tpublic void actionPerformed(ActionEvent e) \n\t\t\t{\n\t\t\t\t//////////////////////////////////\n\t\t\t\t//////////////////////////////////\n\t\t\t\t//Adding Info To Reservation.txt//\n\t\t\t\t//////////////////////////////////\n\t\t\t\t//////////////////////////////////\n\t\t\t\t/**\n\t\t\t\t * First i surround the whole with with try.. catch block\n\t\t\t\t * First in the try block \n\t\t\t\t * i get the values of the check-in and check-out info\n\t\t\t\t * i save them in strings \n\t\t\t\t * then cast them in integers \n\t\t\t\t * and finally add it to Reservation.txt\n\t\t\t\t * then i close the file.\n\t\t\t\t */\n\t\t\t\ttry\n\t\t\t\t{\n\t\t\t\t\tObject HotelID = cbHotelsOptions.getSelectedItem();\n\t\t\t\t\tHotel hotel;\n\t\t\t\t\thotel = (Hotel) HotelID;\n\t\t\t\t\tlong id = hotel.getUniqueId();\n\t\t\t\t\t//\tSystem.out.println(id);\n\t\t\t\t\tString inmonth = txtInMonth.getText();\n\t\t\t\t\tint inMonth = Integer.valueOf(inmonth);\n\t\t\t\t\tString inday = txtInDay.getText();\n\t\t\t\t\tint inDay = Integer.parseInt(inday);\n\t\t\t\t\tString outmonth = txtOutMonth.getText();\n\t\t\t\t\tint outMonth = Integer.valueOf(outmonth);\n\t\t\t\t\tString outday = txtOutDay.getText();\n\t\t\t\t\tint OutDay = Integer.parseInt(outday);\n\t\t\t\t\tFileOutputStream fos = new FileOutputStream(\"Reservation.txt\", true);\n\t\t\t\t\tPrintWriter pw = new PrintWriter(fos);\n\n\t\t\t\t\t/**\n\t\t\t\t\t * i then check the canBook method and according to the canBook method \n\t\t\t\t\t * i check if they can book, and if yes i add the reservation\n\t\t\t\t\t * otherwise it prints so the user may enter different values\n\t\t\t\t\t */\n\t\t\t\t\t{\n\t\t\t\t\t\tif(h.canBook(new Reservation(id,inMonth, inDay, OutDay)) == true) \n\t\t\t\t\t\t{\n\t\t\t\t\t\t\treservation.add(new Reservation (id,inMonth, inDay, outMonth, OutDay));\n\t\t\t\t\t\t\tr = new Reservation (id,inMonth, inDay, OutDay);\n\t\t\t\t\t\t\th.addResIfCanBook(new Reservation(id,inMonth, inDay, outMonth, OutDay));\n\t\t\t\t\t\t\treservationsModel.addElement(r);\n\t\t\t\t\t\t\tpw.println( id + \" - \" + inMonth + \"-\"+ inDay+ \" - \" + outMonth + \"-\" + OutDay);\n\t\t\t\t\t\t\tpw.close();\n\t\t\t\t\t\t\ttxtInMonth.setText(\"\");\n\t\t\t\t\t\t\ttxtOutMonth.setText(\"\");\n\t\t\t\t\t\t\ttxtInDay.setText(\"\");\n\t\t\t\t\t\t\ttxtOutDay.setText(\"\");\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse \n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tJOptionPane.showMessageDialog(null, \"These dates are already reserved\"\n\t\t\t\t\t\t\t\t\t+ \"\\nPlease try again!\");\t\n\t\t\t\t\t\t\ttxtInMonth.setText(\"\");\n\t\t\t\t\t\t\ttxtOutMonth.setText(\"\");\n\t\t\t\t\t\t\ttxtInDay.setText(\"\");\n\t\t\t\t\t\t\ttxtOutDay.setText(\"\");\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t} \n\t\t\t\t/**\n\t\t\t\t * Then the catch Block checks for file not found exception\n\t\t\t\t */\n\t\t\t\tcatch (FileNotFoundException fnfe) \n\t\t\t\t{\n\t\t\t\t\tSystem.err.println(\"File not found.\");\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\n\t\t// When the user selects a specific hotel \n\t\tcbHotelsOptions.addActionListener(new ActionListener()\n\t\t{\n\t\t\tpublic void actionPerformed(ActionEvent e) \n\t\t\t{\n\t\t\t\t/**\n\t\t\t\t * first i save selected hotel in a hotel object\n\t\t\t\t * then i get reservations for the selected hotel\n\t\t\t\t * then i make all the labels and text fields visible \n\t\t\t\t */\n\t\t\t\tHotel selectedHotel = (Hotel)cbHotelsOptions.getSelectedItem();\n\t\t\t\tJOptionPane.showMessageDialog(null, \"You selected the \" + selectedHotel.getHotelName());\n\t\t\t\tselectedHotel.getReservations();\n\t\t\t\tlblCheckIn.setVisible(true);\n\t\t\t\tlblInMonth.setVisible(true);\n\t\t\t\ttxtInMonth.setVisible(true);\n\t\t\t\tlblInDay.setVisible(true);\n\t\t\t\ttxtInDay.setVisible(true);\n\t\t\t\tlblCheckout.setVisible(true);\n\t\t\t\tlblOutMonth.setVisible(true);\n\t\t\t\ttxtOutMonth.setVisible(true);\n\t\t\t\tlblOutDay.setVisible(true);\n\t\t\t\ttxtOutDay.setVisible(true);\n\t\t\t\tbtnAdd.setVisible(true);\n\t\t\t\treservationsModel.removeAllElements();\n\n\t\t\t\t/////////////////////////////////////\n\t\t\t\t/////////////////////////////////////\n\t\t\t\t//Reading Info From Reservation.txt//\n\t\t\t\t/////////////////////////////////////\n\t\t\t\t/////////////////////////////////////\n\t\t\t\t/**\n\t\t\t\t * First i surround everything is a try.. catch blocks \n\t\t\t\t * then in the try block i declare the file input stream\n\t\t\t\t * then a scanner \n\t\t\t\t * then in a while loop i check if the file has next line \n\t\t\t\t * and a user a delimiter \"-\"\n\t\t\t\t * and it adds it to a new reservation\n\t\t\t\t * then it adds it to the ArrayList reservation\n\t\t\t\t * and it also adds it to the hotel object\n\t\t\t\t * then it checks if it can book that hotel\n\t\t\t\t * and if yes it adds it to the ReservationsModel\n\t\t\t\t */\n\t\t\t\ttry\n\t\t\t\t{\n\t\t\t\t\tFileInputStream fis = new FileInputStream(\"Reservation.txt\");\n\t\t\t\t\tScanner fscan = new Scanner (fis);\n\t\t\t\t\tint INMonth = 0;\n\t\t\t\t\tint INday = 0;\n\t\t\t\t\tint OUTmonth = 0;\n\t\t\t\t\tint OUTday = 0;\n\t\t\t\t\tlong iD = 0;\n\t\t\t\t\twhile (fscan.hasNextLine())\n\t\t\t\t\t{\n\t\t\t\t\t\tScanner ls = new Scanner (fscan.nextLine());\n\t\t\t\t\t\tls.useDelimiter(\"-\");\n\t\t\t\t\t\tiD = Integer.parseInt(ls.next().trim());\n\t\t\t\t\t\tINMonth = Integer.parseInt(ls.next().trim());\n\t\t\t\t\t\tINday = Integer.parseInt(ls.next().trim()); \n\t\t\t\t\t\tOUTmonth = Integer.parseInt(ls.next().trim());\n\t\t\t\t\t\tOUTday = Integer.parseInt(ls.next().trim()); \n\t\t\t\t\t\tr = new Reservation (iD,INMonth, INday, OUTmonth, OUTday);\n\t\t\t\t\t\th.addReservation(new Reservation(iD,INMonth, INday, OUTmonth, OUTday));\n\t\t\t\t\t\tHotel hotel = (Hotel) cbHotelsOptions.getSelectedItem();\n\t\t\t\t\t\tlong hotID = hotel.getUniqueId();\n\t\t\t\t\t\tif(iD == hotID)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\treservationsModel.addElement((new Reservation(iD, INMonth, INday, OUTday)));\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t/**\n\t\t\t\t * The catch block checks to make sure that the file is found\n\t\t\t\t */\n\t\t\t\tcatch( FileNotFoundException fnfe)\n\t\t\t\t{\n\t\t\t\t\tSystem.err.println(\"File not found!\");\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\n\t\t/**\n\t\t * This is the setRenderer to make the hotel appear in the hotelsOptions \n\t\t * just the hotel name.\n\t\t */\n\t\tcbHotelsOptions.setRenderer(new DefaultListCellRenderer() {\n\t\t\t@Override\n\t\t\tpublic Component getListCellRendererComponent(JList<?> list, Object value, int index, boolean isSelected, boolean cellHasFocus)\n\t\t\t{\n\t\t\t\tComponent renderer = super.getListCellRendererComponent(list, value, index, isSelected, cellHasFocus);\n\t\t\t\tif (renderer instanceof JLabel && value instanceof Hotel)\n\t\t\t\t{\n\t\t\t\t\t// Here value will be of the Type 'Hotel'\n\t\t\t\t\t((JLabel) renderer).setText(((Hotel) value).getHotelName());\n\t\t\t\t}\n\t\t\t\treturn renderer;\n\t\t\t}\n\t\t});\n\n\t\t/**\n\t\t * The setCallRenderer is for the reservation's list\n\t\t * it only prints the check-in and check-out info\n\t\t */\n\t\tlstReservation.setCellRenderer(new DefaultListCellRenderer() {\n\t\t\t@Override\n\t\t\tpublic Component getListCellRendererComponent(JList<?> list, Object value, int index, boolean isSelected, boolean cellHasFocus)\n\t\t\t{\n\t\t\t\tComponent renderer = super.getListCellRendererComponent(list, value, index, isSelected, cellHasFocus);\n\t\t\t\tif (renderer instanceof JLabel && value instanceof Reservation)\n\t\t\t\t{\n\t\t\t\t\t// Here value will be of the Type 'Reservation'\n\t\t\t\t\tHotel selectedHotel = (Hotel) cbHotelsOptions.getSelectedItem();\n\t\t\t\t\t((JLabel) renderer).setText(((Reservation) value).getFormattedDisplayString());\n\t\t\t\t}\n\t\t\t\treturn renderer;\n\t\t\t}\n\t\t});\t\n\t}", "@Override\n\tpublic List<Reservation> selectionnerReservations(final ContexteConsommation contexte)\n\t\t\tthrows IllegalArgumentException, ContexteConsommationInvalideException {\n\t\treturn null;\n\t}", "@DOpt(type=DOpt.Type.DerivedAttributeUpdater)\n @AttrRef(value=\"reservations\")\n public void doReportQuery() throws NotPossibleException, DataSourceException {\n\n QRM qrm = QRM.getInstance();\n\n // create a query to look up Reservation from the data source\n // and then populate the output attribute (reservations) with the result\n DSMBasic dsm = qrm.getDsm();\n\n //TODO: to conserve memory cache the query and only change the query parameter value(s)\n Query q = QueryToolKit.createSearchQuery(dsm, Reservation.class,\n new String[]{Reservation.AttributeName_Status},\n new Expression.Op[]{Expression.Op.MATCH},\n new Object[]{status});\n\n Map<Oid, Reservation> result = qrm.getDom().retrieveObjects(Reservation.class, q);\n\n if (result != null) {\n // update the main output data\n reservations = result.values();\n\n // update other output (if any)\n numReservations = reservations.size();\n } else {\n // no data found: reset output\n resetOutput();\n }\n }", "@Override\n public List<LocalTime> getAvailableTimesForServiceAndDate(final com.wellybean.gersgarage.model.Service service, LocalDate date) {\n\n LocalTime garageOpening = LocalTime.of(9,0);\n LocalTime garageClosing = LocalTime.of(17, 0);\n\n // List of all slots set as available\n List<LocalTime> listAvailableTimes = new ArrayList<>();\n for(LocalTime slot = garageOpening; slot.isBefore(garageClosing); slot = slot.plusHours(1)) {\n listAvailableTimes.add(slot);\n }\n\n Optional<List<Booking>> optionalBookingList = bookingService.getAllBookingsForDate(date);\n\n // This removes slots that are occupied by bookings on the same day\n if(optionalBookingList.isPresent()) {\n List<Booking> bookingsList = optionalBookingList.get();\n for(Booking booking : bookingsList) {\n int bookingDurationInHours = booking.getService().getDurationInMinutes() / 60;\n // Loops through all slots used by the booking and removes them from list of available slots\n for(LocalTime bookingTime = booking.getTime();\n bookingTime.isBefore(booking.getTime().plusHours(bookingDurationInHours));\n bookingTime = bookingTime.plusHours(1)) {\n\n listAvailableTimes.remove(bookingTime);\n }\n }\n }\n\n int serviceDurationInHours = service.getDurationInMinutes() / 60;\n\n // To avoid concurrent modification of list\n List<LocalTime> listAvailableTimesCopy = new ArrayList<>(listAvailableTimes);\n\n // This removes slots that are available but that are not enough to finish the service. Example: 09:00 is\n // available but 10:00 is not. For a service that takes two hours, the 09:00 slot should be removed.\n for(LocalTime slot : listAvailableTimesCopy) {\n boolean isSlotAvailable = true;\n // Loops through the next slots within the duration of the service\n for(LocalTime nextSlot = slot.plusHours(1); nextSlot.isBefore(slot.plusHours(serviceDurationInHours)); nextSlot = nextSlot.plusHours(1)) {\n if(!listAvailableTimes.contains(nextSlot)) {\n isSlotAvailable = false;\n break;\n }\n }\n if(!isSlotAvailable) {\n listAvailableTimes.remove(slot);\n }\n }\n\n return listAvailableTimes;\n }", "@Override\n public void actionPerformed(NetworkEvent evt) {\n JSONParser jsonp = new JSONParser();\n\n try {\n Map<String, Object> r = jsonp.parseJSON(new CharArrayReader(new String(con.getResponseData()).toCharArray()));\n System.out.println(\"rrrrrrrrrrrrrr\" + r);\n //System.out.println(tasks);\n List<Map<String, Object>> list = (List<Map<String, Object>>) r.get(\"root\");\n for (Map<String, Object> obj : list) {\n Reservation reserv = new Reservation();\n\n float idR = Float.parseFloat(obj.get(\"id_reservation\").toString());\n reserv.setId_reservation((int) idR);\n float idE = Float.parseFloat(obj.get(\"id_even\").toString());\n reserv.setId_even((int) idE);\n\n float idU = Float.parseFloat(obj.get(\"id_client\").toString());\n reserv.setId_client((int) idU);\n\n float idT = Float.parseFloat(obj.get(\"nbre_ticket\").toString());\n\n reserv.setNbre_ticket((int) idT);\n reserv.setDate_reservation((String) obj.get(\"date_reservation\"));\n\n listresrvation.add(reserv);\n\n }\n } catch (IOException ex) {\n }\n\n }", "@Override\n\tpublic List<Booking> getRequest() {\n\t\tSession session = factory.getCurrentSession();\n\t\tQuery query = session\n\t\t\t\t.createQuery(\"from Booking where bookingStatus='request'\");\n\t\treturn query.list();\n\t}" ]
[ "0.6920008", "0.64906096", "0.6359034", "0.61769724", "0.6171354", "0.61378706", "0.6076478", "0.6074799", "0.6073999", "0.6058082", "0.59891105", "0.59416574", "0.5823858", "0.5816581", "0.5815228", "0.58150184", "0.5806527", "0.5788406", "0.5764524", "0.5760437", "0.5744849", "0.57262766", "0.5722728", "0.5709569", "0.56982124", "0.56970567", "0.5679005", "0.564965", "0.55945265", "0.55718416", "0.5558577", "0.5547048", "0.5541553", "0.5531164", "0.55008876", "0.5496553", "0.5495428", "0.54921275", "0.5467074", "0.5465479", "0.54634607", "0.5459595", "0.5442369", "0.54323334", "0.54309785", "0.54234815", "0.5397682", "0.5385091", "0.53726393", "0.53574884", "0.53563136", "0.5352549", "0.5341091", "0.53209907", "0.5304953", "0.5291883", "0.5280371", "0.52653855", "0.5245667", "0.5245468", "0.5244128", "0.52370995", "0.52275836", "0.5226222", "0.52158827", "0.5213656", "0.5209633", "0.5208276", "0.5205212", "0.51772606", "0.5176732", "0.5147954", "0.5146028", "0.51455903", "0.51361173", "0.5118865", "0.5094246", "0.5090942", "0.5090922", "0.5090703", "0.5075983", "0.5074622", "0.50710106", "0.50551313", "0.5038921", "0.5036572", "0.50363225", "0.5033763", "0.50307953", "0.50207824", "0.50123775", "0.50070685", "0.50022215", "0.50015545", "0.49962902", "0.49944213", "0.4990515", "0.498392", "0.49810958", "0.49701837" ]
0.76793796
0
/ This method is called when a GET request is sent to the URL /room/form. This method prepares and dispatches the Room Form view
@RequestMapping(value="/room/form", method=RequestMethod.GET) public String getRoomForm(Model model) { model.addAttribute("room", new Room()); return "roomForm"; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@GetMapping(\"/showFormForAddRoom\")\r\n\tpublic String showFormForAddRoom(Model theModel) {\n\t\tRoom theRoom = new Room();\r\n\t\t\r\n\t\ttheModel.addAttribute(\"room\", theRoom);\r\n\t\t\r\n\t\treturn \"/rooms/room-form\";\r\n\t}", "@RequestMapping(value=\"/room/form\", method=RequestMethod.POST)\r\n\tpublic String postRoom(@Valid @ModelAttribute(\"room\") Room room,\r\n\t\t\tBindingResult bindingResult, Model model) {\r\n\t\tthis.roomValidator.validate(room, bindingResult);\r\n\t\tif(!bindingResult.hasErrors()) {\r\n\t\t\tmodel.addAttribute(\"room\", this.roomService.save(room));\r\n\t\t\treturn \"roomCreated\";\r\n\t\t}\r\n\t\treturn \"roomForm\";\r\n\t}", "public Result createRoom() {\n\n DynamicForm dynamicForm = Form.form().bindFromRequest();\n String roomType = dynamicForm.get(\"roomType\");\n Double price = Double.parseDouble(dynamicForm.get(\"price\"));\n int bedCount = Integer.parseInt(dynamicForm.get(\"beds\"));\n String wifi = dynamicForm.get(\"wifi\");\n String smoking = dynamicForm.get(\"smoking\");\n\n RoomType roomTypeObj = new RoomType(roomType, price, bedCount, wifi, smoking);\n\n if (dynamicForm.get(\"AddRoomType\") != null) {\n\n Ebean.save(roomTypeObj);\n String message = \"New Room type is created Successfully\";\n\n return ok(views.html.RoomTypeUpdateSuccess.render(message));\n } else{\n\n String message = \"Failed to create a new Room type\";\n\n return ok(views.html.RoomTypeUpdateSuccess.render(message));\n\n }\n\n\n\n }", "@GetMapping(\"/showFormForUpdateRoom\")\r\n\tpublic String showFormForUpdateRoom(@RequestParam(\"roomId\") int theId,\r\n\t\t\t\t\t\t\t\t\tModel theModel) {\n\t\tRoom theRoom = roomService.findById(theId);\r\n\t\t\r\n\t\t// set employee as a model attribute to pre-populate the form\r\n\t\ttheModel.addAttribute(\"room\", theRoom);\r\n\t\t\r\n\t\t// send over to our form\r\n\t\treturn \"/rooms/room-form\";\t\t\t\r\n\t}", "public RoomDetailsUpdate() {\n initComponents();\n initExtraComponents();\n }", "public Result addNewRoomType() {\n\n DynamicForm dynamicform = Form.form().bindFromRequest();\n if (dynamicform.get(\"AdminAddRoom\") != null) {\n\n return ok(views.html.AddRoomType.render());\n }\n\n\n return ok(\"Something went wrong\");\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.POST)\r\n\tpublic String getRoomsFromTo(@Valid @ModelAttribute(\"onDate\") Reservation reservation,\r\n\t\t\tBindingResult bindingResult, Model model) {\r\n\t\tthis.reservationValidator.adminValidate(reservation, bindingResult);\r\n\t\tif(!bindingResult.hasErrors()) {\r\n\t\t\tLocalDate localDate= reservation.getCheckIn();\r\n\t\t\tmodel.addAttribute(\"onDate\", reservation.getCheckIn());\r\n\t\t\tmodel.addAttribute(\"freeRooms\", this.roomService.getFreeOn(localDate));\r\n\t\t\tmodel.addAttribute(\"reservedRooms\", this.roomService.getReservedOn(localDate));\r\n\t\t\treturn \"roomsAdmin\";\r\n\t\t}\r\n\t\treturn \"reservationsForm\";\r\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}", "public void onGetRoom(GlobalMessage message) {\n JPanel newRoomPanel = new JPanel();\n NewRoomInfo newRoomInfo = (NewRoomInfo)message.getData();\n renderRoom(newRoomInfo.getRoomName(), newRoomPanel);\n roomContainer.add(newRoomPanel, roomListConstraints);\n ++roomListConstraints.gridy;\n roomEntries.put(newRoomInfo.getRoomName(), newRoomPanel);\n\n roomContainer.revalidate();\n roomContainer.repaint();\n }", "public void buildAndShowMenuForm() {\n SimpleForm.Builder builder =\n SimpleForm.builder()\n .translator(MinecraftLocale::getLocaleString, session.locale())\n .title(\"gui.advancements\");\n\n List<String> rootAdvancementIds = new ArrayList<>();\n for (Map.Entry<String, GeyserAdvancement> advancement : storedAdvancements.entrySet()) {\n if (advancement.getValue().getParentId() == null) { // No parent means this is a root advancement\n builder.button(MessageTranslator.convertMessage(advancement.getValue().getDisplayData().getTitle(), session.locale()));\n rootAdvancementIds.add(advancement.getKey());\n }\n }\n\n if (rootAdvancementIds.isEmpty()) {\n builder.content(\"advancements.empty\");\n }\n\n builder.validResultHandler((response) -> {\n String id = rootAdvancementIds.get(response.clickedButtonId());\n if (!id.equals(\"\")) {\n if (id.equals(currentAdvancementCategoryId)) {\n // The server thinks we are already on this tab\n buildAndShowListForm();\n } else {\n // Send a packet indicating that we intend to open this particular advancement window\n ServerboundSeenAdvancementsPacket packet = new ServerboundSeenAdvancementsPacket(id);\n session.sendDownstreamPacket(packet);\n // Wait for a response there\n }\n }\n });\n\n session.sendForm(builder);\n }", "@RequestMapping(value = \"/rmselect.do\", method = RequestMethod.POST)\n\tpublic ModelAndView roomproc(RoomDTO dto, HttpServletRequest req) {\n\t\tModelAndView mav=new ModelAndView();\n\t\tmav.setViewName(\"room/msgView\");\n\t\tmav.addObject(\"root\",Utility.getRoot());\n\t\treturn mav;\n\t}", "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 }", "public ModifyRoomReservation() {\n initComponents();\n\n btn_search.requestFocus();\n\n getAllIds();\n\n }", "public void buildAndShowListForm() {\n GeyserAdvancement categoryAdvancement = storedAdvancements.get(currentAdvancementCategoryId);\n String language = session.locale();\n\n SimpleForm.Builder builder =\n SimpleForm.builder()\n .title(MessageTranslator.convertMessage(categoryAdvancement.getDisplayData().getTitle(), language))\n .content(MessageTranslator.convertMessage(categoryAdvancement.getDisplayData().getDescription(), language));\n\n List<GeyserAdvancement> visibleAdvancements = new ArrayList<>();\n if (currentAdvancementCategoryId != null) {\n for (GeyserAdvancement advancement : storedAdvancements.values()) {\n boolean earned = isEarned(advancement);\n if (earned || !advancement.getDisplayData().isHidden()) {\n if (advancement.getParentId() != null && currentAdvancementCategoryId.equals(advancement.getRootId(this))) {\n String color = earned ? advancement.getDisplayColor() : \"\";\n builder.button(color + MessageTranslator.convertMessage(advancement.getDisplayData().getTitle()) + '\\n');\n\n visibleAdvancements.add(advancement);\n }\n }\n }\n }\n\n builder.button(GeyserLocale.getPlayerLocaleString(\"gui.back\", language));\n\n builder.closedResultHandler(() -> {\n // Indicate that we have closed the current advancement tab\n session.sendDownstreamPacket(new ServerboundSeenAdvancementsPacket());\n\n }).validResultHandler((response) -> {\n if (response.getClickedButtonId() < visibleAdvancements.size()) {\n GeyserAdvancement advancement = visibleAdvancements.get(response.clickedButtonId());\n buildAndShowInfoForm(advancement);\n } else {\n buildAndShowMenuForm();\n // Indicate that we have closed the current advancement tab\n session.sendDownstreamPacket(new ServerboundSeenAdvancementsPacket());\n }\n });\n\n session.sendForm(builder);\n }", "public ViewRoom(Room r) {\n initComponents();\n this.room = r;\n this.workoutNum = 0;\n updateRoom();\n \n }", "@RequestMapping(value = \"/room\", method = RequestMethod.GET)\n public ModelAndView listRoom() {\n List<Group> groups = userBean.getAllGroups();\n for (int i = 0; i < groups.size(); i++) {\n userBean.getGroupByStreamId(groups.get(1));\n }\n ModelAndView view = new ModelAndView(\"room\");\n // view.addObject(\"list\", room);\n // view.addObject(\"note\", rooms);\n //view.addObject(\"st\", streamGroups);\n return view;\n }", "public void loadForm() {\n if (!selectedTipo.equals(\"accion\")) {\n this.renderPaginaForm = true;\n } else {\n this.renderPaginaForm = false;\n }\n if (selectedTipo.equals(null) || selectedTipo.equals(\"menu\")) {\n this.renderGrupoForm = false;\n } else {\n this.renderGrupoForm = true;\n }\n populateListaObjetos();\n }", "@GetMapping(value = { \"/\", \"/addContact\" })\r\n\tpublic String loadForm(Model model) {\r\n\t\tmodel.addAttribute(\"contact\", new Contact());\r\n\t\treturn \"contactInfo\";\r\n\t}", "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 }", "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 }", "public ActionForward execute(\n\t\tActionMapping mapping,\n\t\tActionForm form,\n\t\tHttpServletRequest request,\n\t\tHttpServletResponse response) throws Exception {\n\t\tRoomListForm roomListForm = (RoomListForm) form;\n\t\t\n\t\tsessionContext.checkPermission(Right.Rooms);\n\t\troomListForm.load(request.getSession());\n\t\t\n\t\tString deptCode = roomListForm.getDeptCodeX();\n\t\tif (deptCode==null) {\n\t\t\tdeptCode = (String)sessionContext.getAttribute(SessionAttribute.DepartmentCodeRoom);\n\t\t}\n\t\tif (deptCode==null) {\n\t\t\tdeptCode = request.getParameter(\"default\");\n\t\t if (deptCode != null)\n\t\t \tsessionContext.setAttribute(SessionAttribute.DepartmentCodeRoom, deptCode);\n\t\t}\n\t\t\n\t\tif (deptCode != null && !deptCode.isEmpty() && (\"All\".equals(deptCode) || deptCode.matches(\"Exam[0-9]*\") || sessionContext.hasPermission(deptCode, \"Department\", Right.Rooms))) {\n\t\t\troomListForm.setDeptCodeX(deptCode);\n\t\t\treturn mapping.findForward(\"roomList\");\n\t\t\t\n\t\t} else {\n\t\t\tif (sessionContext.getUser().getCurrentAuthority().getQualifiers(\"Department\").size() == 1) {\n\t\t\t\troomListForm.setDeptCodeX(sessionContext.getUser().getCurrentAuthority().getQualifiers(\"Department\").get(0).getQualifierReference());\n\t\t\t\treturn mapping.findForward(\"roomList\");\n\t\t\t}\n\t\t\t\n\t\t\tLookupTables.setupDepartments(request, sessionContext, true);\n\t\t\tLookupTables.setupExamTypes(request, sessionContext.getUser().getCurrentAcademicSessionId());\n\t\t\t\n\t\t\treturn mapping.findForward(\"showRoomSearch\");\n\t\t}\n\n\t}", "public ModelAndView populateAndGetFormView(Game entity, Model model) {\n // Populate the form with all the necessary elements\n populateForm(model);\n // Add concurrency attribute to the model to show the concurrency form\n // in the current edit view\n model.addAttribute(\"concurrency\", true);\n // Add the new version value to the model.\n model.addAttribute(\"newVersion\", getLastVersion(entity));\n // Add the current pet values to maintain the values introduced by the user\n model.addAttribute(getModelName(), entity);\n // Return the edit view path\n return new org.springframework.web.servlet.ModelAndView(getEditViewPath(), model.asMap());\n }", "protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {\r\n/* 119 */ log.debug(\"RoomCtl Method doGet Started\");\r\n/* */ \r\n/* 121 */ String op = DataUtility.getString(request.getParameter(\"operation\"));\r\n/* */ \r\n/* */ \r\n/* 124 */ RoomModel model = new RoomModel();\r\n/* */ \r\n/* 126 */ long id = DataUtility.getLong(request.getParameter(\"id\"));\r\n/* */ \r\n/* 128 */ if (id > 0L || op != null) {\r\n/* */ \r\n/* */ try {\r\n/* */ \r\n/* */ \r\n/* 133 */ RoomBean bean = model.findByPK(id);\r\n/* */ \r\n/* 135 */ ServletUtility.setBean((BaseBean)bean, request);\r\n/* */ }\r\n/* 137 */ catch (ApplicationException e) {\r\n/* 138 */ log.error(e);\r\n/* */ \r\n/* 140 */ ServletUtility.handleException((Exception)e, request, response);\r\n/* */ \r\n/* */ return;\r\n/* */ } \r\n/* */ }\r\n/* 145 */ ServletUtility.forward(getView(), request, response);\r\n/* 146 */ log.debug(\"RoomCtl Method doGet Ended\");\r\n/* */ }", "private void loadRoom(Room room) {\n if(currentRooms.isEmpty()) {\n // Add the passed-in Room to the list of selected Rooms.\n this.currentRooms.add(room);\n // Load the data from the Room into the InfoPanel.\n this.roomNameField.setText(room.getName());\n this.includeField.setText(room.getInclude());\n this.inheritField.setText(room.getInherit());\n this.streetNameField.setSelectedItem(room.getStreetName());\n this.determinateField.setText(room.getDeterminate());\n this.lightField.setText(room.getLight());\n this.shortDescriptionField.setText(room.getShort());\n this.longDescriptionField.setText(room.getLong());\n updateExitPanel(room);\n } else {\n this.currentRooms.add(room);\n }\n }", "@RequestMapping(value = \"/enrollment.html\", method = RequestMethod.GET)\n public String displayForm(Model model) {\n model.addAttribute(\"fixture\", new FixtureModel());\n return \"fixtures/enrollment\";\n }", "@Override\n public void buildView(IModelForm modelForm) {\n FormSection inputSection = modelForm.addSection(\"Input\");\n inputSection.addEntityListField(_inputGrids, new Grid3dTimeDepthSpecification());\n inputSection.addEntityComboField(_velocityVolume, new VelocityVolumeSpecification());\n inputSection.addEntityComboField(_aoi, AreaOfInterest.class).showActiveFieldToggle(_aoiFlag);\n\n // Build the conversion section.\n FormSection parameterSection = modelForm.addSection(\"Conversion\");\n parameterSection.addRadioGroupField(_conversionMethod, Method.values());\n\n // Build the output section.\n FormSection outputSection = modelForm.addSection(\"Output\");\n outputSection.addTextField(_outputGridSuffix);\n }", "private void loadForm() {\n CodingProxy icd9 = problem.getIcd9Code();\n \n if (icd9 != null) {\n txtICD.setText(icd9.getProxiedObject().getCode());\n }\n \n String narr = problem.getProviderNarrative();\n \n if (narr == null) {\n narr = icd9 == null ? \"\" : icd9.getProxiedObject().getDisplay();\n }\n \n String probId = problem.getNumberCode();\n \n if (probId == null || probId.isEmpty()) {\n probId = getBroker().callRPC(\"BGOPROB NEXTID\", PatientContext.getActivePatient().getIdElement().getIdPart());\n }\n \n String pcs[] = probId.split(\"\\\\-\", 2);\n lblPrefix.setValue(pcs[0] + \" - \");\n txtID.setValue(pcs.length < 2 ? \"\" : pcs[1]);\n txtNarrative.setText(narr);\n datOnset.setValue(problem.getOnsetDate());\n \n if (\"P\".equals(problem.getProblemClass())) {\n radPersonal.setSelected(true);\n } else if (\"F\".equals(problem.getProblemClass())) {\n radFamily.setSelected(true);\n } else if (\"I\".equals(problem.getStatus())) {\n radInactive.setSelected(true);\n } else {\n radActive.setSelected(true);\n }\n \n int priority = NumberUtils.toInt(problem.getPriority());\n cboPriority.setSelectedIndex(priority < 0 || priority > 5 ? 0 : priority);\n loadNotes();\n }", "private void setFields() {\n\t\tfirstname.setText(guest.getFirstName());\n\t\tlastname.setText(guest.getLastName());\n\t\tpassport.setText(guest.getPassportNumber());\n\t\ttelephone.setText(guest.getTelephoneNumber());\n\t\tarrival.setText(arrivalDate.toString());\n\t\tdeparture.setText(departureDate.toString());\n\n\t\tif (hotelChoice.getName() != null && hotelChoice.getName() != \"\"\n\t\t\t\t&& !(hotelChoice.getName() == Controller.DEFAULT_HOTEL_CHOICE)) {\n\t\t\thotel.setText(hotelChoice.getName());\n\t\t} else {\n\t\t\thotelChoice = new Hotel();\n\t\t\thotelChoice.setName(\"\");\n\t\t\thotel.clear();\n\t\t}\n\t\tif (roomQualityChoice.getQuality() != null && roomQualityChoice.getQuality() != \"\"\n\t\t\t\t&& !(roomQualityChoice.getQuality() == Controller.DEFAULT_QUALITY_CHOICE)) {\n\t\t\tquality.setText(roomQualityChoice.getQuality());\n\t\t} else {\n\t\t\troomQualityChoice = new RoomQuality();\n\t\t\troomQualityChoice.setQuality(\"\");\n\t\t\tquality.clear();\n\t\t}\n\t\tif (discountChoice > 0) {\n\t\t\tdiscount.setText(\"(-\" + discountChoice + \"%)\");\n\t\t}\n\n\t\tloadAvailableRooms();\n\n\t}", "private static void viewRooms() \n {\n String option, roomCode;\n\n displayMyRooms(\" \");\n\n Scanner input = new Scanner(System.in);\n\n System.out.print(\"Type (v)iew [room code] or \"\n + \"(r)eservations [room code], or (q)uit to exit: \");\n \n option = input.next().toLowerCase();\n \n while (!option.equals(\"q\"))\n {\n if (option.equals(\"v\") || option.equals(\"r\"))\n {\n System.out.print(\"Enter a room code: \");\n roomCode = \" '\" + input.next().toUpperCase() + \"'\";\n\n if(option.equals(\"v\"))\n displayDetailedRooms(roomCode);\n else\n displayDetailedReservations(\"WHERE ro.RoomId = \" + roomCode);\n }\n\n System.out.print(\"Type (v)iew [room code] or \"\n + \"(r)eservations [room code], or (q)uit to exit: \");\n \n option = input.next().toLowerCase();\n }\n \n }", "protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {\r\n/* 153 */ log.debug(\"RoomCtl Method doPost Started\");\r\n/* 154 */ String op = DataUtility.getString(request.getParameter(\"operation\"));\r\n/* */ \r\n/* 156 */ RoomModel model = new RoomModel();\r\n/* */ \r\n/* 158 */ long id = DataUtility.getLong(request.getParameter(\"id\"));\r\n/* */ \r\n/* 160 */ if (\"Save\".equalsIgnoreCase(op))\r\n/* 161 */ { RoomBean bean = (RoomBean)populateBean(request);\r\n/* */ \r\n/* */ try {\r\n/* 164 */ if (id > 0L) {\r\n/* 165 */ model.update(bean);\r\n/* */ \r\n/* 167 */ ServletUtility.setSuccessMessage(\"Data is successfully Updated\", request);\r\n/* */ } else {\r\n/* 169 */ long pk = model.add(bean);\r\n/* */ \r\n/* 171 */ ServletUtility.setSuccessMessage(\"Data is successfully saved\", request);\r\n/* */ }\r\n/* */ \r\n/* */ }\r\n/* 175 */ catch (ApplicationException e) {\r\n/* 176 */ log.error(e);\r\n/* 177 */ ServletUtility.handleException((Exception)e, request, response);\r\n/* */ return;\r\n/* 179 */ } catch (DuplicateRecordException e) {\r\n/* 180 */ ServletUtility.setBean((BaseBean)bean, request);\r\n/* 181 */ ServletUtility.setErrorMessage(e.getMessage(), request);\r\n/* */ } \r\n/* 183 */ ServletUtility.forward(getView(), request, response); }\r\n/* 184 */ else { if (\"Delete\".equalsIgnoreCase(op)) {\r\n/* */ \r\n/* 186 */ RoomBean bean = (RoomBean)populateBean(request);\r\n/* */ try {\r\n/* 188 */ model.delete(bean);\r\n/* 189 */ ServletUtility.redirect(\"/Hostel-Management/ctl/roomList\", request, \r\n/* 190 */ response);\r\n/* */ return;\r\n/* 192 */ } catch (ApplicationException e) {\r\n/* 193 */ log.error(e);\r\n/* 194 */ ServletUtility.handleException((Exception)e, request, response);\r\n/* */ \r\n/* */ return;\r\n/* */ } \r\n/* */ } \r\n/* 199 */ if (\"Cancel\".equalsIgnoreCase(op)) {\r\n/* 200 */ ServletUtility.redirect(\"/Hostel-Management/ctl/roomList\", request, response);\r\n/* */ }\r\n/* 202 */ else if (\"Reset\".equalsIgnoreCase(op)) {\r\n/* 203 */ ServletUtility.redirect(\"/Hostel-Management/ctl/room\", request, response);\r\n/* */ return;\r\n/* */ } }\r\n/* */ \r\n/* 207 */ ServletUtility.forward(getView(), request, response);\r\n/* */ \r\n/* */ \r\n/* 210 */ log.debug(\"RoomCtl Method doPostEnded\");\r\n/* */ }", "FrmViewContacts() {\n startupForm();\n }", "@GetMapping(\"/room\")\n public String room(Model model) {\n return \"room\";\n }", "@GetMapping(value = \"/showForm\")\n\tpublic String showForm(Model model) {\n\t\tmodel.addAttribute(\"person\", new Person());\n\n\t\t// In order to test 500 internal server error\n\t\t// int g = 7/0;\n\n\t\treturn FORM_VIEW;\n\t}", "private String prepareAndReturnEditPage(Model model) {\n this.populateDentistVisitFormModel(model);\n return \"editForm\";\n }", "@GetMapping(value = \"/edit-form\", name = \"editForm\")\n public ModelAndView editForm(@ModelAttribute Game game, Model model) {\n populateForm(model);\n model.addAttribute(\"game\", game);\n return new ModelAndView(\"games/edit\");\n }", "public static Result newForm() {\n return ok(newForm.render(palletForm, setOfArticleForm));\n }", "@Override\n\t\t\tpublic void onGET(OgemaHttpRequest req) {\n\t\t\t\tupdate(appController.getActiveRooms(), req);\n\t\t\t}", "public void populateRooms(){\n }", "@GetMapping\r\n\tpublic String viewForm(Model model) {\n\t\tif (model == null) {\r\n\t\t\treturn \"error\";\r\n\t\t} else {\r\n\t\t\treturn \"bikelistsaveform\";\r\n\t\t}\r\n\t\t\r\n\t}", "public ActionForward execute(ActionMapping mapping, ActionForm form, HttpServletRequest request,\n\t\t\tHttpServletResponse response) {\n\t\tif (!CommonUtil.validateSessionUser(request, SessionConstants.Common.ADMIN_PRIVILAGE_ID)) {\n\t\t\treturn mapping.findForward(SessionConstants.Common.SESSION_INVALID_GLOBAL_FORWARD);\n\t\t}\n\n\t\tString status = \"\";\n\t\tmanager = (Manager) BeanUtil.getBean(\"hotelmanager\");\n\n\t\tRoomTypeFormBean roomTypeFormBean = (RoomTypeFormBean) form;\n\t\ttry {\n\n\t\t\t// Occation of insert a new room category or edit existing one after\n\t\t\t// modify values.\n\t\t\tif (request.getParameter(\"hdnMode\") == null) {\n\n\t\t\t\tif (FormDataValidatorUtil.isRoomTypeDataValid(roomTypeFormBean, request)) {\n\t\t\t\t\tRoomType roomTypeToSave = populateRoomType(roomTypeFormBean);\n\n\t\t\t\t\tmanager.saveOrUpdateRoomType(roomTypeToSave);\n\t\t\t\t\trequest.setAttribute(\"successMessage\", resourceBundleUtil\n\t\t\t\t\t\t\t.getLocaleSpecificValue(\"room.type.success.save\"));\n\t\t\t\t\tgetAllRoomTypes(request);\n\n\t\t\t\t\tstatus = \"success\";\n\t\t\t\t} else {\n\n\t\t\t\t\trequest.setAttribute(\"roomTypeObject\", populateRoomType(roomTypeFormBean));\n\t\t\t\t\tgetAllRoomTypes(request);\n\t\t\t\t\tstatus = \"invalidRoomTypeData\";\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\t// Load the page from administrator profile\n\t\t\tif (request.getParameter(\"hdnMode\") != null && request.getParameter(\"hdnMode\").equals(\"getAllRoomType\")) {\n\n\t\t\t\tgetAllRoomTypes(request);\n\t\t\t\tstatus = \"success\";\n\n\t\t\t} else {\n\t\t\t\t// Request for edit an existing room category. Load particular\n\t\t\t\t// category by\n\t\t\t\t// id. and send back to user interface\n\t\t\t\tif (request.getParameter(\"hdnMode\") != null && request.getParameter(\"hdnMode\").equals(\"editRoomType\")) {\n\t\t\t\t\tInteger idOfEditingType = Integer.valueOf(request.getParameter(\"id\"));\n\t\t\t\t\tRoomType roomTypeLoaded = manager.getRoomTypeById(idOfEditingType);\n\n\t\t\t\t\trequest.setAttribute(\"roomTypeObject\", roomTypeLoaded);\n\t\t\t\t\tgetAllRoomTypes(request);\n\t\t\t\t\tstatus = \"success\";\n\n\t\t\t\t} else {\n\t\t\t\t\t// delete an existing room category.\n\t\t\t\t\tif (request.getParameter(\"hdnMode\") != null\n\t\t\t\t\t\t\t&& request.getParameter(\"hdnMode\").equals(\"deleteRoomType\")) {\n\n\t\t\t\t\t\t// get the id of object need to delete\n\t\t\t\t\t\tInteger idOfDeletingType = Integer.valueOf(request.getParameter(\"id\"));\n\n\t\t\t\t\t\t// get the version of object need to delete\n\t\t\t\t\t\tInteger versionOfDeletingType = Integer.valueOf(request.getParameter(\"version\"));\n\n\t\t\t\t\t\t// Load the existing object need to delete\n\t\t\t\t\t\tRoomType roomTypeLoaded = manager.getRoomTypeById(idOfDeletingType);\n\n\t\t\t\t\t\t// set the version of ui side object to loaded object.\n\t\t\t\t\t\troomTypeLoaded.setVersion(versionOfDeletingType);\n\n\t\t\t\t\t\tmanager.deleteRoomType(roomTypeLoaded);\n\t\t\t\t\t\trequest.setAttribute(\"successDeleteMessage\", resourceBundleUtil\n\t\t\t\t\t\t\t\t.getLocaleSpecificValue(\"room.type.success.delete\"));\n\t\t\t\t\t\tgetAllRoomTypes(request);\n\t\t\t\t\t\tstatus = \"success\";\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t} catch (DataIntegrityViolationException e) {\n\n\t\t\trequest.setAttribute(\"RoomTypeException\", resourceBundleUtil\n\t\t\t\t\t.getLocaleSpecificValue(\"roomType.already.engaged\"));\n\n\t\t\tgetAllRoomTypes(request);\n\t\t\tstatus = \"exceptionInRoomType\";\n\n\t\t} catch (NestedRuntimeException e) {\n\t\t\tstatus = \"databaseException\";\n\t\t} catch (Exception e) {\n\t\t\tstatus = \"generalException\";\n\t\t}\n\n\t\treturn mapping.findForward(status);\n\t}", "public String fillEditPage() {\n\t\t\n\t\ttry{\n\t\t\t// Putting attribute of playlist inside the page to view it \n\t\t\tFacesContext.getCurrentInstance().getExternalContext().getRequestMap().put(\"playlist\", service.viewPlaylist());\n\t\t\t\n\t\t\t// Send user to EditPlaylistPage\n\t\t\treturn \"EditPlaylistPage\";\n\t\t}\n\t\t// Catch exceptions and send to ErrorPage\n\t\tcatch(Exception e) {\n\t\t\treturn \"ErrorPage.xhtml\";\n\t\t}\n\t}", "@FXML\n public void fieldsEntered() {\n single.setLastTime();\n RoomAccess ra = new RoomAccess();\n int startTimeMil = 0;\n int endTimeMil = 0;\n String date = \"\";\n String endDate = \"\";\n\n if (startTime.getValue() != null && endTime.getValue() != null && datePicker.getValue() != null) {\n date = datePicker.getValue().toString();\n endDate = endDatePicker.getValue().toString();\n date += \"T\" + String.format(\"%02d\", startTime.getValue().getHour()) + \":\" + String.format(\"%02d\", startTime.getValue().getMinute()) + \":00\";\n endDate += \"T\" + String.format(\"%02d\", endTime.getValue().getHour()) + \":\" + String.format(\"%02d\", endTime.getValue().getMinute()) + \":00\";\n availableRooms.getSelectionModel().clearSelection();\n\n rooms = ra.getAvailRooms(date, endDate);\n /*for (int i = 0; i < rooms.size(); i++) {\n System.out.println(\"Available Rooms: \" + rooms.get(i));\n }*/\n\n listOfRooms.clear();\n\n for (int i = 0; i < DisplayRooms.size(); i++) {\n DisplayRooms.get(i).setAvailable(false);\n }\n\n //System.out.println(\"startTimeMil: \" + startTimeMil + \"\\n endTimeMil:\" + endTimeMil);\n rooms = ra.getAvailRooms(date, endDate);\n\n for (int j = 0; j < rooms.size(); j++) {\n listOfRooms.add(rooms.get(j));\n for (int i = 0; i < DisplayRooms.size(); i++) {\n //System.out.println(\"COMPARE \" + DisplayRooms.get(i).roomName + \" AND \" + rooms.get(j));\n if (DisplayRooms.get(i).roomName.equals(rooms.get(j))) {\n DisplayRooms.get(i).setAvailable(true);\n //System.out.println(\"True: \" + i);\n break;\n }\n }\n }\n\n eventName.clear();\n eventDescription.clear();\n eventType.getSelectionModel().clearSelection();\n error.setText(\"\");\n privateEvent.setSelected(false);\n EmployeeAccess ea = new EmployeeAccess();\n ArrayList<ArrayList<String>> emps = ea.getEmployees(\"\",\"\");\n for(int i = 0; i < emps.size(); i++) {\n eventEmployees.getCheckModel().clearCheck(i);\n }\n availableRooms.setItems(listOfRooms);\n displayAllRooms();\n }\n }", "@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}", "private void enterRoom() {\n connect();\n\n clientName = nameTextFiled.getText();\n try {\n toServer.writeInt(ENTERROOM);\n toServer.writeUTF(clientName);\n toServer.flush();\n report(\"Client ----> Server: \" + ENTERROOM + \" \" + clientId + \" \" + nameTextFiled.getText());\n\n clientFrame.setTitle(clientName);\n btnNewGame.setEnabled(true);\n\n// loginPanel.setVisible(false);\n// centerPanel.setVisible(true);\n // disable the login frame component\n nameTextFiled.removeActionListener(clientAction);\n nameTextFiled.setEnabled(false);\n btnEnterRoom.removeActionListener(clientAction);\n btnEnterRoom.setEnabled(false);\n\n // close the login frame\n loginFrame.setVisible(false);\n loginFrame.dispose();\n\n // open the client frame\n clientFrame.setVisible(true);\n\n } catch (IOException e) {\n e.printStackTrace();\n }\n }", "@RequestMapping(value = \"classroom\", method = RequestMethod.GET)\n public ModelAndView displayClassroom() {\n ModelAndView mv = new ModelAndView();\n\n //open the database and get all the classrooms and store them in a linked list\n dbManager.initializeDatabase();\n StringBuilder sb = new StringBuilder();\n LinkedList<Classroom> classroomLinkedList=dbManager.getClassroomList();\n\n //loop through all the classroom in the list and make them displayable in a tabular form\n //the table header is already set up in the 'classroom.jsp' page\n //add a edit and delete button to each classroom\n sb.append(\"<tr>\");\n for (Classroom classroom:classroomLinkedList) {\n sb.append(\"<tr data-id='\"+classroom.getId()+\"'><td>\"+classroom.getName()+\"</td><td>\"+classroom.getCity()+\"</td>\");\n sb.append(\"<td>\"+classroom.getAddress()+\"</td><td>\"+classroom.getCapacity()+\"</td><td>\"+classroom.getType()+\"</td>\");\n sb.append(\"<td>\"+classroom.getProjector()+\"</td><td>\"+classroom.getStudentComp()+\"</td><td>\"+classroom.getWhiteboard()+\"</td>\");\n sb.append(\"<td>\"+classroom.getAudioRecording()+\"</td><td>\"+classroom.getVideoRecording()+\"</td>\");\n sb.append(\"<td>\"+classroom.getWheelchairAccess()+\"</td><td>\"+classroom.getListeningSystem()+\"</td>\");\n sb.append(\"<td><button class='btn btn-danger btn-delete' data-name='\"+classroom.getName()+\"' id='\"+classroom.getId()+\"'>Delete</button>\");\n sb.append(\"<button class='btn btn-info btn-edit' data-name='\"+classroom.getName()+\"' id='\"+classroom.getId()+\"'>Edit</button></td></tr>\");\n }\n\n //close the database connection and display the page\n dbManager.closeDatabase();\n mv.addObject(\"table\", sb.toString());\n mv.setViewName(\"classroom\");\n\n return mv;\n }", "@Override\n\tpublic Object getModel() \n\t{\n\t\treturn room;\n\t}", "@Override\n protected void doGet( HttpServletRequest req, HttpServletResponse resp )\n throws ServletException, IOException {\n log( \"GET\" );\n createInputBloodDonationForm( req, resp );\n }", "public static Result startNewForm() {\r\n\t\tString formName = ChangeOrderForm.NAME;\r\n\t\tDecision firstDecision = CMSGuidedFormFill.startNewForm(formName,\r\n\t\t\t\tCMSSession.getEmployeeName(), CMSSession.getEmployeeId());\r\n\t\treturn ok(backdrop.render(firstDecision));\r\n\t}", "private void readForm() {\n }", "@PostMapping(path = \"/rooms\")\n public ResponseEntity<Room> generateNewRoom() {\n Room newRoom = roomService.generateNewRoom();\n return new ResponseEntity<>(newRoom, HttpStatus.CREATED);\n }", "@Override protected void cadastroAction() {\n try {\n // JOptionPane.showMessageDialog(this, codigoTxtField.getText() +\n // descricaoTextArea.getText() + capacidadeTxtField.getText(),\n // \"teste\", JOptionPane.INFORMATION_MESSAGE, null);\n MaintainRoom.getInstance().insertRooms(codigoTxtField.getText(), descricaoTextArea.getText(), capacidadeTxtField.getText());\n\n JOptionPane.showMessageDialog(this, \"Sala Cadastrada com sucesso\", \"Sucesso\", JOptionPane.INFORMATION_MESSAGE, null);\n this.setVisible(false);\n\n } catch (PatrimonyException ex) {\n JOptionPane.showMessageDialog(this, ex.getMessage(), \"Erro\", JOptionPane.ERROR_MESSAGE, null);\n } catch (SQLException ex) {\n JOptionPane.showMessageDialog(this, ex.getSQLState() + \"\\n\" + ex.getMessage(), \"Erro\", JOptionPane.ERROR_MESSAGE, null);\n }\n\n }", "@RequestMapping(value = \"/{id}/edit.html\", method = RequestMethod.GET)\n public String provideForm(@PathVariable(\"id\") Long id, Model model) \n throws Exception {\n FixtureModel fixture = fixtureService.findFixtureById(id); \n model.addAttribute(\"fixture\", fixture);\n return FORM_VIEW_NAME;\n }", "@RequestMapping(value = \"/Reservation/{reservation_reservationId}/room\", method = RequestMethod.POST)\n\t@ResponseBody\n\tpublic Room newReservationRoom(@PathVariable Integer reservation_reservationId, @RequestBody Room room) {\n\t\treservationService.saveReservationRoom(reservation_reservationId, room);\n\t\treturn roomDAO.findRoomByPrimaryKey(room.getRoomId());\n\t}", "private void initFormEditMode() {\n initSpinnerSelectionChamps();\n //encodage de la chaine de caracteres correspondant au nom du produit pour etre passé dans l'URL\n String urlCategorieName = null;\n try {\n urlCategorieName = URLEncoder.encode(this.nomCategorie, ENCODING);\n } catch (UnsupportedEncodingException e) {\n e.printStackTrace();\n }\n //preparation de l'URL\n String[] params = {urlCategorieName};\n final String url = WebService.buildUrlForRequest(Metier.DOMAIN, Metier.NOM_MODELE_CATEGORIES, WebService.ACTION_GET, params);\n\n //requete pour recuperer la categorie a editer (asynchrone)\n asyncHttpClient.get(getActivity(), url, new AsyncHttpResponseHandler() {\n\n @Override\n public void onSuccess(int statusCode, Header[] headers, byte[] responseBody) {\n String response = null;\n try {\n response = new String(responseBody, ENCODING);\n JSONObject jsonObject = new JSONObject(response);\n //TODO PAUSE\n } catch (UnsupportedEncodingException e) {\n e.printStackTrace();\n } catch (JSONException e) {\n e.printStackTrace();\n }\n }\n\n @Override\n public void onFailure(int statusCode, Header[] headers, byte[] responseBody, Throwable error) {\n Log.e(\"CATEGORIE_EDIT\", \"fail to connect: \" + url + \" \" + statusCode);\n }\n });\n }", "public static void showAllRoom(){\n ArrayList<Room> roomList = getListFromCSV(FuncGeneric.EntityType.ROOM);\n displayList(roomList);\n showServices();\n }", "@Override\n\tpublic void execute(Model model) throws Exception {\n\t\tMap<String, Object> map = model.asMap();\n\t\tHttpServletRequest request = (HttpServletRequest) map.get(\"request\");\n\t\t\n\t\tString mroom = request.getParameter(\"mroomname\");\n\t\tmbookingDAO dao = new mbookingDAO();\n\t\tmbookingDTO dto = dao.mpopup(mroom);\n\n\t\tmodel.addAttribute(\"mpopup\", dto);\n\t}", "public SpeciesForm() {\n initComponents();\n setTitle(Application.TITLE_APP + \" Species\");\n processor = new SpeciesProcessor();\n loadData(); \n \n \n }", "@RequestMapping(value = \"getinput.htm\")\n public ModelAndView getInput() {\n ModelAndView modelAndView = new ModelAndView();\n modelAndView.addObject(\"inputentity\", new InputFormBean());\n return modelAndView;\n }", "@RequestMapping(method = RequestMethod.GET)\n public String showValidatinForm(Map model) {\n ValidationForm validationForm = new ValidationForm();\n model.put(\"validationForm\", validationForm);\n return \"validationform\";\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 }", "public void onCreate() {\r\n Session session = sessionService.getCurrentSession();\r\n Map<String, Region> items = ControlUtility.createForm(Pc.class);\r\n\r\n ControlUtility.fillComboBox((ComboBox<Kind>) items.get(\"Kind\"), session.getCampaign().getCampaignVariant().getKinds());\r\n ControlUtility.fillComboBox((ComboBox<Race>) items.get(\"Race\"), session.getCampaign().getCampaignVariant().getRaces());\r\n ControlUtility.fillCheckComboBox((CheckComboBox<Ability>) items.get(\"SavingThrows\"), Arrays.asList(Ability.values()));\r\n ControlUtility.fillCheckComboBox((CheckComboBox<Proficiency>) items.get(\"Proficiencies\"), session.getCampaign().getCampaignVariant().getProficiencies());\r\n ControlUtility.fillCheckComboBox((CheckComboBox<Feature>) items.get(\"Features\"), session.getCampaign().getCampaignVariant().getFeatures());\r\n ControlUtility.fillCheckComboBox((CheckComboBox<Trait>) items.get(\"Traits\"), session.getCampaign().getCampaignVariant().getTraits());\r\n ControlUtility.fillCheckComboBox((CheckComboBox<Equipment>) items.get(\"Equipment\"), session.getCampaign().getCampaignVariant().getEquipments());\r\n\r\n Campaign campaign = session.getCampaign();\r\n\r\n Dialog<String> dialog = ControlUtility.createDialog(\"Create Playable Character\", items);\r\n dialog.show();\r\n\r\n dialog.setResultConverter(buttonType -> {\r\n if (buttonType != null) {\r\n Pc pc = null;\r\n try {\r\n pc = ControlUtility.controlsToValues(Pc.class, items);\r\n } catch (NoSuchMethodException | IllegalAccessException | InvocationTargetException | InstantiationException | ClassNotFoundException e) {\r\n e.printStackTrace();\r\n }\r\n if (pc != null) {\r\n try {\r\n characterService.createPlayerCharacter(pc);\r\n } catch (SessionAlreadyExists | IndexAlreadyExistsException sessionAlreadyExists) {\r\n sessionAlreadyExists.printStackTrace();\r\n }\r\n try {\r\n playerManagementService.addOrUpdatePcForRegisteredPlayer(pc);\r\n Player player = playerManagementService.getRegisteredPlayer();\r\n campaign.addPlayer(player);\r\n campaign.addCharacter(pc);\r\n if (campaignListingService.campaignExists(campaign.getId())) {\r\n manipulationService.updateCampaign(campaign);\r\n } else {\r\n manipulationService.createCampaign(campaign);\r\n }\r\n } catch (MultiplePlayersException | EntityNotFoundException | SessionAlreadyExists | IndexAlreadyExistsException e) {\r\n e.printStackTrace();\r\n }\r\n try {\r\n playerManagementService.addOrUpdatePcForRegisteredPlayer(pc);\r\n } catch (MultiplePlayersException | EntityNotFoundException e) {\r\n e.printStackTrace();\r\n }\r\n try {\r\n sessionService.updateParticipant(playerManagementService.getRegisteredPlayer().getId(), pc.getId());\r\n sessionService.updateCampaign(campaign);\r\n } catch (EntityNotFoundException e) {\r\n e.printStackTrace();\r\n }\r\n render();\r\n return pc.toString();\r\n }\r\n }\r\n return null;\r\n });\r\n }", "public void addRoom(){\r\n String enteredRoomNumber = mRoomNumber.getText().toString();\r\n if (!enteredRoomNumber.equals(\"\")){\r\n RoomPojo roomPojo = new RoomPojo(enteredRoomNumber,\r\n mAllergy.getText().toString(),\r\n mPlateType.getText().toString(),\r\n mChemicalDiet.getText().toString(),\r\n mTextureDiet.getText().toString(),\r\n mLiquidDiet.getText().toString(),\r\n mLikes.getText().toString(),\r\n mDislikes.getText().toString(),\r\n mNotes.getText().toString(),\r\n mMeal.getText().toString(),\r\n mDessert.getText().toString(),\r\n mBeverage.getText().toString(),\r\n RoomActivity.mFacilityKey);\r\n mFirebaseDatabaseReference.push().setValue(roomPojo);\r\n Utils.countCensus(RoomActivity.mFacilityKey);\r\n Utils.countNumRoomsFilled(RoomActivity.mHallKey, RoomActivity.mHallStart, RoomActivity.mHallEnd);\r\n }\r\n //close the dialog fragment\r\n RoomDialog.this.getDialog().cancel();\r\n }", "private void processRequest(HttpServletRequest req, HttpServletResponse resp) throws IOException {\n HttpSession session = req.getSession();\n Order order = (Order) session.getAttribute(ORDER_PARAM);\n\n String roomId = req.getParameter(ROOM_ID_PARAM);\n\n if (order != null && roomId != null && !roomId.isEmpty()) {\n int roomNumber = Integer.parseInt(roomId);\n\n RoomService roomService = new RoomService();\n roomService.refreshStatus(roomNumber, RoomStatus.NOT_AVAILABLE.getName());\n Room room = roomService.findRoomByNumber(roomNumber);\n\n OrderService orderService = new OrderService();\n orderService.addRoomInfo(order.getId(), roomNumber, room.getPrice(), room.getRoomClass());\n orderService.refreshStatus(order.getId(), OrderStatus.IN_CONFIRM.getName());\n }\n resp.sendRedirect(\"/manager-order-pagination\");\n }", "public ViewRoom(Customer cust,Room r, int wrkNum) {\n initComponents();\n this.room = r;\n this.workoutNum = wrkNum;\n customer = cust;\n updateRoom();\n \n }", "@RequestMapping(value = \"/newrecipe\", method = RequestMethod.GET)\n\tpublic String newRecipeForm(Model model) {\n\t\tmodel.addAttribute(\"recipe\", new Recipe()); //empty recipe object\n\t\tmodel.addAttribute(\"categories\", CatRepo.findAll());\n\t\treturn \"newrecipe\";\n\t}", "private void createForm(ArrayList<HashMap<String, String>> data) {\n\t\tLayoutInflater inflater = LayoutInflater.from(IPropertyRegistrationActivity.this);\n\t\tLinearLayout.LayoutParams params = new LinearLayout.LayoutParams(android.widget.LinearLayout.LayoutParams.MATCH_PARENT,\n\t\t\t\tandroid.widget.LinearLayout.LayoutParams.WRAP_CONTENT);\n\t\tparams.topMargin = 10;\n\n\t\tfields = data;\n\t\tLinearLayout layout = null;\n\t\tint len = fields.size();\n\t\tfor (int j = 0; j < len; j++) {\n\t\t\tfinal HashMap<String, String> field = fields.get(j);\n\t\t\tView fieldView = inflater.inflate(R.layout.iproperty_registration_dynamic_view_item, null);\n\n\t\t\tif (field.get(TYPE).equals(LABEL)) {\n\t\t\t\tfinal IjoomerEditText edit;\n\t\t\t\tlayout = ((LinearLayout) fieldView.findViewById(R.id.lnrLabel));\n\t\t\t\tlayout.setVisibility(View.VISIBLE);\n\t\t\t\tedit = ((IjoomerEditText) layout.findViewById(R.id.txtValue));\n\t\t\t} else if (field.get(TYPE).equals(PASSWORD)) {\n\t\t\t\tfinal IjoomerEditText edit;\n\t\t\t\tlayout = ((LinearLayout) fieldView.findViewById(R.id.lnrEdit));\n\t\t\t\tlayout.setVisibility(View.VISIBLE);\n\t\t\t\tedit = ((IjoomerEditText) layout.findViewById(R.id.txtValue));\n\t\t\t\tif (field.get(NAME).contains(getString(R.string.phone)) || field.get(NAME).contains(getString(R.string.year))) {\n\t\t\t\t\tedit.setInputType(InputType.TYPE_CLASS_NUMBER);\n\t\t\t\t} else if (field.get(NAME).contains(getString(R.string.website)) || field.get(NAME).contains(getString(R.string.email))) {\n\t\t\t\t\tedit.setInputType(InputType.TYPE_TEXT_VARIATION_EMAIL_ADDRESS);\n\t\t\t\t}\n\t\t\t} else if (field.get(TYPE).equals(TEXT)) {\n\t\t\t\tfinal IjoomerEditText edit;\n\t\t\t\tlayout = ((LinearLayout) fieldView.findViewById(R.id.lnrEdit));\n\t\t\t\tlayout.setVisibility(View.VISIBLE);\n\t\t\t\tedit = ((IjoomerEditText) layout.findViewById(R.id.txtValue));\n\t\t\t\tif (field.get(NAME).contains(getString(R.string.phone)) || field.get(NAME).contains(getString(R.string.year))) {\n\t\t\t\t\tedit.setInputType(InputType.TYPE_CLASS_NUMBER);\n\t\t\t\t} else if (field.get(NAME).contains(getString(R.string.website)) || field.get(NAME).contains(getString(R.string.email))) {\n\t\t\t\t\tedit.setInputType(InputType.TYPE_TEXT_VARIATION_EMAIL_ADDRESS);\n\t\t\t\t}\n\t\t\t} else if (field.get(TYPE).equals(TEXTAREA)) {\n\t\t\t\tfinal IjoomerEditText edit;\n\t\t\t\tlayout = ((LinearLayout) fieldView.findViewById(R.id.lnrEditArea));\n\t\t\t\tlayout.setVisibility(View.VISIBLE);\n\t\t\t\tedit = ((IjoomerEditText) layout.findViewById(R.id.txtValue));\n\n\t\t\t\tif (field.get(VALUE).toString().trim().length() > 0) {\n\t\t\t\t\tedit.setText(field.get(VALUE));\n\t\t\t\t} else {\n\t\t\t\t}\n\n\t\t\t} else if (field.get(TYPE).equals(MAP)) {\n\t\t\t\tfinal IjoomerEditText edit;\n\t\t\t\tfinal ImageView imgMap;\n\t\t\t\tlayout = ((LinearLayout) fieldView.findViewById(R.id.lnrEditMap));\n\t\t\t\tlayout.setVisibility(View.VISIBLE);\n\t\t\t\tedit = ((IjoomerEditText) layout.findViewById(R.id.txtValue));\n\t\t\t\timgMap = ((ImageView) layout.findViewById(R.id.imgMap));\n\t\t\t\tif (field.get(NAME).equalsIgnoreCase(getString(R.string.state))) {\n\t\t\t\t\ttry {\n\t\t\t\t\t\tAddress address = IjoomerUtilities.getAddressFromLatLong(0, 0);\n\t\t\t\t\t\tedit.setText(address.getAdminArea().replace(address.getCountryName() == null ? \"\" : address.getCountryName(), \"\")\n\t\t\t\t\t\t\t\t.replace(address.getPostalCode() == null ? \"\" : address.getPostalCode(), \"\"));\n\t\t\t\t\t} catch (Throwable e) {\n\t\t\t\t\t\tedit.setText(\"\");\n\t\t\t\t\t}\n\t\t\t\t} else if (field.get(NAME).equalsIgnoreCase(getString(R.string.city_town))) {\n\t\t\t\t\ttry {\n\t\t\t\t\t\tAddress address = IjoomerUtilities.getAddressFromLatLong(0, 0);\n\t\t\t\t\t\tedit.setText(address.getSubAdminArea());\n\t\t\t\t\t} catch (Throwable e) {\n\t\t\t\t\t\tedit.setText(\"\");\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\timgMap.setOnClickListener(new OnClickListener() {\n\n\t\t\t\t\t@Override\n\t\t\t\t\tpublic void onClick(View v) {\n\t\t\t\t\t\teditMap = edit;\n\t\t\t\t\t\tIntent intent = new Intent(IPropertyRegistrationActivity.this, IjoomerMapAddress.class);\n\t\t\t\t\t\tstartActivityForResult(intent, GET_ADDRESS_FROM_MAP);\n\t\t\t\t\t}\n\t\t\t\t});\n\n\t\t\t} else if (field.get(TYPE).equals(SELECT)) {\n\t\t\t\tlayout = ((LinearLayout) fieldView.findViewById(R.id.lnrSpin));\n\t\t\t\tlayout.setVisibility(View.VISIBLE);\n\t\t\t\tfinal Spinner spn;\n\t\t\t\tspn = ((Spinner) layout.findViewById(R.id.txtValue));\n\t\t\t\tspn.setAdapter(IjoomerUtilities.getSpinnerAdapter(field));\n\t\t\t\tif (field.get(NAME).equalsIgnoreCase(getString(R.string.country))) {\n\n\t\t\t\t\ttry {\n\t\t\t\t\t\tAddress address = IjoomerUtilities.getAddressFromLatLong(0, 0);\n\t\t\t\t\t\tString country = address.getCountryName();\n\t\t\t\t\t\tint selectedIndex = 0;\n\t\t\t\t\t\tJSONArray jsonArray = null;\n\n\t\t\t\t\t\tjsonArray = new JSONArray(field.get(OPTIONS));\n\t\t\t\t\t\tint optionSize = jsonArray.length();\n\t\t\t\t\t\tfor (int k = 0; k < optionSize; k++) {\n\t\t\t\t\t\t\tJSONObject options = (JSONObject) jsonArray.get(k);\n\n\t\t\t\t\t\t\tif (options.getString(VALUE).equalsIgnoreCase(country)) {\n\t\t\t\t\t\t\t\tselectedIndex = k;\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\tspn.setSelection(selectedIndex);\n\t\t\t\t\t} catch (Throwable e) {\n\t\t\t\t\t\te.printStackTrace();\n\t\t\t\t\t\tspn.setSelection(0);\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\t\t\t} else if (field.get(TYPE).equals(DATE)) {\n\t\t\t\tfinal IjoomerEditText edit;\n\t\t\t\tlayout = ((LinearLayout) fieldView.findViewById(R.id.lnrEditClickable));\n\t\t\t\tlayout.setVisibility(View.VISIBLE);\n\t\t\t\tedit = ((IjoomerEditText) layout.findViewById(R.id.txtValue));\n\t\t\t\tedit.setOnClickListener(new OnClickListener() {\n\n\t\t\t\t\t@Override\n\t\t\t\t\tpublic void onClick(final View v) {\n\t\t\t\t\t\tIjoomerUtilities.getDateDialog(((IjoomerEditText) v).getText().toString(), true, new CustomClickListner() {\n\n\t\t\t\t\t\t\t@Override\n\t\t\t\t\t\t\tpublic void onClick(String value) {\n\t\t\t\t\t\t\t\t((IjoomerEditText) v).setText(value);\n\t\t\t\t\t\t\t\t((IjoomerEditText) v).setError(null);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t});\n\n\t\t\t\t\t}\n\t\t\t\t});\n\n\t\t\t} else if (field.get(TYPE).equals(TIME)) {\n\t\t\t\tfinal IjoomerEditText edit;\n\t\t\t\tlayout = ((LinearLayout) fieldView.findViewById(R.id.lnrEditClickable));\n\t\t\t\tlayout.setVisibility(View.VISIBLE);\n\t\t\t\tedit = ((IjoomerEditText) layout.findViewById(R.id.txtValue));\n\t\t\t\tedit.setOnClickListener(new OnClickListener() {\n\n\t\t\t\t\t@Override\n\t\t\t\t\tpublic void onClick(final View v) {\n\t\t\t\t\t\tIjoomerUtilities.getTimeDialog(((IjoomerEditText) v).getText().toString(), new CustomClickListner() {\n\n\t\t\t\t\t\t\t@Override\n\t\t\t\t\t\t\tpublic void onClick(String value) {\n\t\t\t\t\t\t\t\t((IjoomerEditText) v).setText(value);\n\t\t\t\t\t\t\t\t((IjoomerEditText) v).setError(null);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t});\n\n\t\t\t\t\t}\n\t\t\t\t});\n\n\t\t\t} else if (field.get(TYPE).equals(MULTIPLESELECT)) {\n\t\t\t\tfinal IjoomerEditText edit;\n\t\t\t\tlayout = ((LinearLayout) fieldView.findViewById(R.id.lnrEditClickable));\n\t\t\t\tlayout.setVisibility(View.VISIBLE);\n\t\t\t\tedit = ((IjoomerEditText) layout.findViewById(R.id.txtValue));\n\t\t\t\tedit.setOnClickListener(new OnClickListener() {\n\n\t\t\t\t\t@Override\n\t\t\t\t\tpublic void onClick(final View v) {\n\t\t\t\t\t\tIjoomerUtilities.getMultiSelectionDialog(field.get(NAME), field.get(OPTIONS), ((IjoomerEditText) v).getText().toString(), new CustomClickListner() {\n\n\t\t\t\t\t\t\t@Override\n\t\t\t\t\t\t\tpublic void onClick(String value) {\n\t\t\t\t\t\t\t\t((IjoomerEditText) v).setText(value);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t});\n\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t}\n\n\t\t\tif (field.get(REQUIRED).equalsIgnoreCase(\"1\")) {\n\t\t\t\t((IjoomerTextView) layout.findViewById(R.id.txtLable)).setText(field.get(NAME) + \" *\");\n\t\t\t} else {\n\t\t\t\t((IjoomerTextView) layout.findViewById(R.id.txtLable)).setText(field.get(NAME));\n\t\t\t}\n\n\t\t\t((LinearLayout) fieldView.findViewById(R.id.lnrEdit)).setVisibility(View.GONE);\n\t\t\t((LinearLayout) fieldView.findViewById(R.id.lnrEditArea)).setVisibility(View.GONE);\n\t\t\t((LinearLayout) fieldView.findViewById(R.id.lnrSpin)).setVisibility(View.GONE);\n\t\t\t((LinearLayout) fieldView.findViewById(R.id.lnrEditClickable)).setVisibility(View.GONE);\n\t\t\t((LinearLayout) fieldView.findViewById(R.id.lnrLabel)).setVisibility(View.GONE);\n\n\t\t\tlayout = ((LinearLayout) fieldView.findViewById(R.id.lnrReadOnly));\n\t\t\tlayout.setVisibility(View.VISIBLE);\n\n\t\t\t((IjoomerTextView) layout.findViewById(R.id.txtLable)).setText(field.get(NAME));\n\t\t\t((IjoomerEditText) layout.findViewById(R.id.txtValue)).setText(field.get(VALUE));\n\t\t\tfieldView.setTag(field);\n\t\t\tlnr_form.addView(fieldView, params);\n\t\t}\n\t}", "@GetMapping(\"/listRoom\")\r\n\tpublic String listRooms(Model theModel) {\n\t\tList<Room> theRooms = roomService.findAll();\r\n\t\t\r\n\t\t// add to the spring model\r\n\t\ttheModel.addAttribute(\"rooms\", theRooms);\r\n\t\t\r\n\t\treturn \"/rooms/list-rooms\";\r\n\t}", "@Override\n\tprotected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {\n\t\treq.getRequestDispatcher(\"/views/form.jsp\").forward(req, resp);\n\t}", "@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}", "@Override\n\tpublic void onFormCreate(AbstractForm arg0, DataMsgBus arg1) {\n\t}", "@RequestMapping(method = RequestMethod.GET)\n \tpublic String createForm(Model model, ForgotLoginForm form) {\n \t\tmodel.addAttribute(\"form\", form);\n \t\treturn \"forgotlogin/index\";\n \t}", "@Override\n\tprotected void on_room_entered(String room_door_name) {\n\n\t}", "@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}", "@RequestMapping(value = \"/newsAdmin\", method = RequestMethod.GET)\n public String loadFormPage(final Model model) {\n LOGGER.log(Level.INFO, \"in loadFormPage\");\n model.addAttribute(NEWS_ARTICLE, new NewsArticle());\n return NEWS_ADMIN_PAGE;\n }", "@RequestMapping(value=\"/update\", method = RequestMethod.GET)\n public String conferenceUpdateForm(Model model) {\n model.addAttribute(\"conference\", new Conference());\n return \"admin/updateForm\";\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}", "public viewForm() {\n this.addGLEventListener(this);\n }", "@Override\r\n protected void onForm(ClientForm form) {\n \r\n }", "@RequestMapping(value = \"form\", method = RequestMethod.GET)\n public String form() {\n return \"user_form\";\n }", "@PostMapping(\"/rooms\")\n public Room createRoom (\n @Valid\n @RequestBody Room room){\n return roomRepository.save(room);\n }", "@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}", "@GetMapping(path = \"/realizar\")\n public ModelAndView getForm(){\n\n return new ModelAndView(ViewConstant.MANTCOMPRASMINO).addObject(\"compraMinorista\", new CompraMinorista());\n }", "public void populateForm(Model model) {\n populateFormats(model);\n }", "private void initialiseController() \r\n {\r\n defaultVectors();\r\n if(grantsByPIForm == null) \r\n {\r\n grantsByPIForm = new GrantsByPIForm(); //(Component) parent,modal);\r\n }\r\n grantsByPIForm.descriptionLabel.setText(UnitName);\r\n grantsByPIForm.descriptionLabel.setFont(new Font(\"SansSerif\",Font.BOLD,14));\r\n queryEngine = QueryEngine.getInstance();\r\n coeusMessageResources = CoeusMessageResources.getInstance();\r\n registerComponents();\r\n try {\r\n setFormData(null);\r\n }\r\n catch(Exception e) {\r\n e.printStackTrace(System.out);\r\n }\r\n }", "public abstract FullResponse onServeFormParams(Map<String, List<String>> formParams);", "void showCreatorWaitingRoom();", "@Override\n\tprotected ModelAndView handleRequestInternal(HttpServletRequest arg0, HttpServletResponse arg1) throws Exception {\n\t\tModelAndView model = new ModelAndView(\"contact\");\n\t\tmodel.addObject(\"command\", getMsg());\n\n\t\treturn model;\n\t}", "@RequestMapping(method=RequestMethod.GET)\r\n\tpublic String displayClaimForm(Model model){\r\n\t\tmodel.addAttribute(\"client\", new Client());\r\n\t\t\r\n\t\treturn \"clientForm\";\r\n\t}", "protected BaseBean populateBean(HttpServletRequest request) {\r\n/* 95 */ log.debug(\"RoomCtl Method populatebean Started\");\r\n/* */ \r\n/* 97 */ RoomBean bean = new RoomBean();\r\n/* */ \r\n/* 99 */ bean.setId(DataUtility.getLong(request.getParameter(\"id\")));\r\n/* */ \r\n/* 101 */ bean.setRoomNo(DataUtility.getString(request.getParameter(\"room\")));\r\n/* */ \r\n/* 103 */ bean.setHostelId(DataUtility.getLong(request.getParameter(\"hostelId\")));\r\n/* */ \r\n/* */ \r\n/* 106 */ bean.setDescription(DataUtility.getString(request.getParameter(\"description\")));\r\n/* */ \r\n/* 108 */ populateDTO((BaseBean)bean, request);\r\n/* */ \r\n/* 110 */ log.debug(\"RoomCtl Method populatebean Ended\");\r\n/* */ \r\n/* 112 */ return (BaseBean)bean;\r\n/* */ }", "public NewRoomFrame() {\n initComponents();\n }", "@RequestMapping(value = \"/application\", method = RequestMethod.GET)\n\tpublic ModelAndView goToApplicationForm() {\n\n\t\tlogger.info(\"application page requested\");\n\n\t\treturn new ModelAndView(\"application\");\n\n\t}", "private void createRooms()//refactored\n {\n currentRoom = RoomCreator.buildCurrentRooms();//new\n }", "@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n try {\n Database db = Database.getDatabase();\n String check = request.getParameter(\"btnCheck\");\n String checkIn = request.getParameter(\"txtCheckIn\");\n String checkOut = request.getParameter(\"txtCheckOut\");\n String rType = request.getParameter(\"ddlRoomTypes\");\n String q = request.getParameter(\"ddlNumRooms\");\n\n String msg = null;\n\n int rmAvail = db.getAvailableRoomQuantity(checkIn, checkOut, rType);\n\n if (check != null && !checkIn.isEmpty() && !checkOut.isEmpty() && rType != null && q != null) {\n int qty = Integer.parseInt(q);\n if (qty <= rmAvail) {\n msg = \"From \" + checkIn + \" to \" + checkOut + \", \" + rmAvail + \" \" + rType + \" room/s left.\";\n } else if (qty > rmAvail) {\n msg = \"Arrival Date: \" + checkIn + \"<br/>\"\n + \"Departure Date: \" + checkOut + \"<br/>\"\n + \"You have selected \" + qty + \" rooms.<br/>\"\n + \"No available \" + rType + \" rooms.<br/>\";\n } \n } else {\n msg = \"Please enter empty fields.\"; \n }\n request.setAttribute(\"msg\", msg);\n RequestDispatcher rd = request.getRequestDispatcher(\"_home.jsp\");\n rd.forward(request, response);\n\n } catch (Exception ex) {\n Logger.getLogger(CheckAvailable.class.getName()).log(Level.SEVERE, null, ex);\n }\n\n }", "@GetMapping(\"/showNewDeliveryManForm\")\n\tpublic String showNewDeliveryManForm(Model model){\n\t\tDeliveryMan dm = new DeliveryMan();\n\t\tmodel.addAttribute(\"deliveryMan\",dm);\n\t\tmodel.addAttribute(\"cities\", City.values());\n\t\treturn \"new_deliveryMan\";\n\t}", "public GestaoFormando() {\n \n initComponents();\n listarEquipamentos();\n listarmapainscritos();\n }", "public void onCreate() {\r\n\t\trelayState = null;\r\n\t\tdomainName = ((Person) SecurityContextHolder.getContext().getAuthentication().getPrincipal()).getDomain().getName();\r\n\t\tgoogleAccount = ((Person) SecurityContextHolder.getContext().getAuthentication().getPrincipal()).getGoogleAccount();\r\n\t\tregistry = ((Person) SecurityContextHolder.getContext().getAuthentication().getPrincipal()).getRegistry();\r\n\t\tacsForm = new AcsForm(domainName);\r\n\t\tappendChild(acsForm);\r\n\t\ticeForm = new IceForm();\r\n\t\tappendChild(iceForm);\r\n\t\ticeAppsController = (IceAppsController) SpringUtil.getBean(\"iceAppsController\");\r\n\t}", "IFormView getFormView();", "@RequestMapping(\"showForm\")\n\tpublic String showForm( Model theModel) {\n\t\t\n\t\t//create a student\n\t\tStudent theStudent = new Student();\n\t\t\n\t\t//add student to the model\n\t\ttheModel.addAttribute(\"student\", theStudent);\n\t\t\n\t\treturn \"student-form\";\n\t}", "private void buildView() {\n this.setHeaderInfo(model.getHeaderInfo());\n\n CWButtonPanel buttonPanel = this.getButtonPanel();\n \n buttonPanel.add(saveButton);\n buttonPanel.add(saveAndCloseButton);\n buttonPanel.add(cancelButton);\n \n FormLayout layout = new FormLayout(\"pref, 4dlu, 200dlu, 4dlu, min\",\n \"pref, 2dlu, pref, 2dlu, pref, 2dlu, pref\"); // rows\n\n layout.setRowGroups(new int[][]{{1, 3, 5}});\n \n CellConstraints cc = new CellConstraints();\n this.getContentPanel().setLayout(layout);\n \n this.getContentPanel().add(nameLabel, cc.xy (1, 1));\n this.getContentPanel().add(nameTextField, cc.xy(3, 1));\n this.getContentPanel().add(descLabel, cc.xy(1, 3));\n this.getContentPanel().add(descTextField, cc.xy(3, 3));\n this.getContentPanel().add(amountLabel, cc.xy(1, 5));\n this.getContentPanel().add(amountTextField, cc.xy(3, 5));\n }" ]
[ "0.7191519", "0.6221935", "0.6050594", "0.6008833", "0.59524226", "0.59232384", "0.58459383", "0.57894737", "0.57649183", "0.57090724", "0.5660444", "0.5632656", "0.5613718", "0.5569199", "0.5558411", "0.5516135", "0.55005157", "0.5461937", "0.5452367", "0.54463834", "0.5386108", "0.5372401", "0.53430843", "0.5341678", "0.5310678", "0.5307549", "0.53003657", "0.5277987", "0.5226066", "0.5216246", "0.51867133", "0.5184881", "0.518289", "0.5170835", "0.5167932", "0.5151789", "0.5150503", "0.51360977", "0.51173365", "0.5111668", "0.5108649", "0.5079142", "0.5072908", "0.5070875", "0.50588965", "0.5058532", "0.505608", "0.5055139", "0.5054052", "0.5048486", "0.5034938", "0.50276995", "0.50249106", "0.5021694", "0.50073683", "0.50015825", "0.49987316", "0.49953192", "0.49931982", "0.49897754", "0.4982602", "0.49779865", "0.49776927", "0.49681374", "0.49680465", "0.49618763", "0.49588808", "0.49517924", "0.4942226", "0.4939718", "0.49257725", "0.4920224", "0.4910406", "0.49055636", "0.4901403", "0.4895414", "0.48897737", "0.48830163", "0.487896", "0.4873405", "0.48725626", "0.4867336", "0.48672765", "0.48670977", "0.4860911", "0.4859568", "0.48555085", "0.48499697", "0.48459622", "0.4844135", "0.48364905", "0.4836324", "0.48248383", "0.4824582", "0.48162225", "0.48119083", "0.48084074", "0.48032248", "0.47986308", "0.4784716" ]
0.76083046
0
/ This method is called when a POST request is sent to the URL /room/form This method evaluates the recieved room and prepares and dispatches the Room Created view
@RequestMapping(value="/room/form", method=RequestMethod.POST) public String postRoom(@Valid @ModelAttribute("room") Room room, BindingResult bindingResult, Model model) { this.roomValidator.validate(room, bindingResult); if(!bindingResult.hasErrors()) { model.addAttribute("room", this.roomService.save(room)); return "roomCreated"; } return "roomForm"; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public Result createRoom() {\n\n DynamicForm dynamicForm = Form.form().bindFromRequest();\n String roomType = dynamicForm.get(\"roomType\");\n Double price = Double.parseDouble(dynamicForm.get(\"price\"));\n int bedCount = Integer.parseInt(dynamicForm.get(\"beds\"));\n String wifi = dynamicForm.get(\"wifi\");\n String smoking = dynamicForm.get(\"smoking\");\n\n RoomType roomTypeObj = new RoomType(roomType, price, bedCount, wifi, smoking);\n\n if (dynamicForm.get(\"AddRoomType\") != null) {\n\n Ebean.save(roomTypeObj);\n String message = \"New Room type is created Successfully\";\n\n return ok(views.html.RoomTypeUpdateSuccess.render(message));\n } else{\n\n String message = \"Failed to create a new Room type\";\n\n return ok(views.html.RoomTypeUpdateSuccess.render(message));\n\n }\n\n\n\n }", "@PostMapping(\"/rooms\")\n public Room createRoom (\n @Valid\n @RequestBody Room room){\n return roomRepository.save(room);\n }", "@PostMapping(path = \"/rooms\")\n public ResponseEntity<Room> generateNewRoom() {\n Room newRoom = roomService.generateNewRoom();\n return new ResponseEntity<>(newRoom, HttpStatus.CREATED);\n }", "@RequestMapping(value=\"/room/form\", method=RequestMethod.GET)\r\n\tpublic String getRoomForm(Model model) {\r\n\t\tmodel.addAttribute(\"room\", new Room());\r\n\t\treturn \"roomForm\";\r\n\t}", "@GetMapping(\"/showFormForAddRoom\")\r\n\tpublic String showFormForAddRoom(Model theModel) {\n\t\tRoom theRoom = new Room();\r\n\t\t\r\n\t\ttheModel.addAttribute(\"room\", theRoom);\r\n\t\t\r\n\t\treturn \"/rooms/room-form\";\r\n\t}", "@RequestMapping(value = \"/Reservation/{reservation_reservationId}/room\", method = RequestMethod.POST)\n\t@ResponseBody\n\tpublic Room newReservationRoom(@PathVariable Integer reservation_reservationId, @RequestBody Room room) {\n\t\treservationService.saveReservationRoom(reservation_reservationId, room);\n\t\treturn roomDAO.findRoomByPrimaryKey(room.getRoomId());\n\t}", "public Result addNewRoomType() {\n\n DynamicForm dynamicform = Form.form().bindFromRequest();\n if (dynamicform.get(\"AdminAddRoom\") != null) {\n\n return ok(views.html.AddRoomType.render());\n }\n\n\n return ok(\"Something went wrong\");\n }", "@PostMapping(\"/rooms/create\")\n public ResponseEntity create(HttpServletRequest req, HttpServletResponse res,\n @RequestBody String roomDetails) throws JsonProcessingException {\n roomService.create(roomDetails);\n return ResponseEntity.status(200).build();\n }", "public void addRoom(){\r\n String enteredRoomNumber = mRoomNumber.getText().toString();\r\n if (!enteredRoomNumber.equals(\"\")){\r\n RoomPojo roomPojo = new RoomPojo(enteredRoomNumber,\r\n mAllergy.getText().toString(),\r\n mPlateType.getText().toString(),\r\n mChemicalDiet.getText().toString(),\r\n mTextureDiet.getText().toString(),\r\n mLiquidDiet.getText().toString(),\r\n mLikes.getText().toString(),\r\n mDislikes.getText().toString(),\r\n mNotes.getText().toString(),\r\n mMeal.getText().toString(),\r\n mDessert.getText().toString(),\r\n mBeverage.getText().toString(),\r\n RoomActivity.mFacilityKey);\r\n mFirebaseDatabaseReference.push().setValue(roomPojo);\r\n Utils.countCensus(RoomActivity.mFacilityKey);\r\n Utils.countNumRoomsFilled(RoomActivity.mHallKey, RoomActivity.mHallStart, RoomActivity.mHallEnd);\r\n }\r\n //close the dialog fragment\r\n RoomDialog.this.getDialog().cancel();\r\n }", "@Override\n public Room create(RoomResponseDTO roomResponseDTO) {\n return roomRepository.save(new Room(\n roomResponseDTO.getClassroomNumber()\n ));\n }", "public Room createRoom(Room room);", "@PostMapping(\"/chat-rooms\")\n public ResponseEntity<ChatRoom> createChatRoom(@RequestBody ChatRoom chatRoom) throws URISyntaxException {\n log.debug(\"REST request to save ChatRoom : {}\", chatRoom);\n if (chatRoom.getId() != null) {\n throw new BadRequestAlertException(\"A new chatRoom cannot already have an ID\", ENTITY_NAME, \"idexists\");\n }\n ChatRoom result = chatRoomRepository.save(chatRoom);\n return ResponseEntity.created(new URI(\"/api/chat-rooms/\" + result.getId()))\n .headers(HeaderUtil.createEntityCreationAlert(ENTITY_NAME, result.getId().toString()))\n .body(result);\n }", "@PostMapping(\"/createNewGameRoom\")\n @ResponseStatus(HttpStatus.CREATED)\n public Game generateNewGameRoom() {\n String entrycode = service.generateEntryCode();\n currentGame.setEntrycode(entrycode);\n currentGame = gameDao.add(currentGame);\n return currentGame;\n }", "RoomModel createRoomModel(RoomModel roomModel);", "private void createRooms()//refactored\n {\n currentRoom = RoomCreator.buildCurrentRooms();//new\n }", "@RequestMapping(method = RequestMethod.POST)\n public ResponseEntity<?> addGameRoom(@RequestBody Game gameRoom) {\n try {\n ls.addGameRoom(gameRoom);\n return new ResponseEntity<>(HttpStatus.CREATED);\n } catch (LacmanPersistenceException ex) {\n Logger.getLogger(LacmanController.class.getName()).log(Level.SEVERE, null, ex);\n return new ResponseEntity<>(ex.getMessage(), HttpStatus.FORBIDDEN);\n }\n }", "@RequestMapping(value=\"/reservations/form\", method=RequestMethod.POST)\r\n\tpublic String getRoomsFromTo(@Valid @ModelAttribute(\"onDate\") Reservation reservation,\r\n\t\t\tBindingResult bindingResult, Model model) {\r\n\t\tthis.reservationValidator.adminValidate(reservation, bindingResult);\r\n\t\tif(!bindingResult.hasErrors()) {\r\n\t\t\tLocalDate localDate= reservation.getCheckIn();\r\n\t\t\tmodel.addAttribute(\"onDate\", reservation.getCheckIn());\r\n\t\t\tmodel.addAttribute(\"freeRooms\", this.roomService.getFreeOn(localDate));\r\n\t\t\tmodel.addAttribute(\"reservedRooms\", this.roomService.getReservedOn(localDate));\r\n\t\t\treturn \"roomsAdmin\";\r\n\t\t}\r\n\t\treturn \"reservationsForm\";\r\n\t}", "@PostMapping(\"/create\")\n public String createClassroom(Model model, @RequestParam Map<String, String> params){\n Object principal = SecurityContextHolder.getContext().getAuthentication().getPrincipal();\n CustomUser user = userRepo.findById(((CustomUserDetails)principal).getId());\n if(!user.getRole().equals(\"TEACHER\")) return \"redirect:/permission-denied\";\n String className = params.get(\"className\");\n String classDesc = params.get(\"classDesc\");\n /**\n * There is front end validation on this as well and only resorts to this if a user\n * messes with the front end or have JavaScript disabled, etc\n */\n if(className == null || classDesc == null) return \"redirect:/classrooms/new?error=1\";\n if(className.length() <= 0 || className.length() > 60) return \"redirect:/classrooms/new?error=1\"; // classname requirements error\n if(classDesc.length() <= 0|| classDesc.length() > 500) return \"redirect:/classrooms/new?error=2\"; // classDesc requirements error\n if(className.contains(\";\") || classDesc.contains(\";\")) return \"redirect:/classrooms/new?error=5\";\n\n int id = 0;\n while(classroomRepo.existsById(id)) id++;\n Classroom classroom = new Classroom(id, user, className, classDesc);\n classroomRepo.save(classroom);\n return \"redirect:/classroom/teacher/\" + id; \n \n }", "@Override\n\tprotected void on_room_entered(String room_door_name) {\n\n\t}", "public void onGetRoom(GlobalMessage message) {\n JPanel newRoomPanel = new JPanel();\n NewRoomInfo newRoomInfo = (NewRoomInfo)message.getData();\n renderRoom(newRoomInfo.getRoomName(), newRoomPanel);\n roomContainer.add(newRoomPanel, roomListConstraints);\n ++roomListConstraints.gridy;\n roomEntries.put(newRoomInfo.getRoomName(), newRoomPanel);\n\n roomContainer.revalidate();\n roomContainer.repaint();\n }", "protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {\r\n/* 153 */ log.debug(\"RoomCtl Method doPost Started\");\r\n/* 154 */ String op = DataUtility.getString(request.getParameter(\"operation\"));\r\n/* */ \r\n/* 156 */ RoomModel model = new RoomModel();\r\n/* */ \r\n/* 158 */ long id = DataUtility.getLong(request.getParameter(\"id\"));\r\n/* */ \r\n/* 160 */ if (\"Save\".equalsIgnoreCase(op))\r\n/* 161 */ { RoomBean bean = (RoomBean)populateBean(request);\r\n/* */ \r\n/* */ try {\r\n/* 164 */ if (id > 0L) {\r\n/* 165 */ model.update(bean);\r\n/* */ \r\n/* 167 */ ServletUtility.setSuccessMessage(\"Data is successfully Updated\", request);\r\n/* */ } else {\r\n/* 169 */ long pk = model.add(bean);\r\n/* */ \r\n/* 171 */ ServletUtility.setSuccessMessage(\"Data is successfully saved\", request);\r\n/* */ }\r\n/* */ \r\n/* */ }\r\n/* 175 */ catch (ApplicationException e) {\r\n/* 176 */ log.error(e);\r\n/* 177 */ ServletUtility.handleException((Exception)e, request, response);\r\n/* */ return;\r\n/* 179 */ } catch (DuplicateRecordException e) {\r\n/* 180 */ ServletUtility.setBean((BaseBean)bean, request);\r\n/* 181 */ ServletUtility.setErrorMessage(e.getMessage(), request);\r\n/* */ } \r\n/* 183 */ ServletUtility.forward(getView(), request, response); }\r\n/* 184 */ else { if (\"Delete\".equalsIgnoreCase(op)) {\r\n/* */ \r\n/* 186 */ RoomBean bean = (RoomBean)populateBean(request);\r\n/* */ try {\r\n/* 188 */ model.delete(bean);\r\n/* 189 */ ServletUtility.redirect(\"/Hostel-Management/ctl/roomList\", request, \r\n/* 190 */ response);\r\n/* */ return;\r\n/* 192 */ } catch (ApplicationException e) {\r\n/* 193 */ log.error(e);\r\n/* 194 */ ServletUtility.handleException((Exception)e, request, response);\r\n/* */ \r\n/* */ return;\r\n/* */ } \r\n/* */ } \r\n/* 199 */ if (\"Cancel\".equalsIgnoreCase(op)) {\r\n/* 200 */ ServletUtility.redirect(\"/Hostel-Management/ctl/roomList\", request, response);\r\n/* */ }\r\n/* 202 */ else if (\"Reset\".equalsIgnoreCase(op)) {\r\n/* 203 */ ServletUtility.redirect(\"/Hostel-Management/ctl/room\", request, response);\r\n/* */ return;\r\n/* */ } }\r\n/* */ \r\n/* 207 */ ServletUtility.forward(getView(), request, response);\r\n/* */ \r\n/* */ \r\n/* 210 */ log.debug(\"RoomCtl Method doPostEnded\");\r\n/* */ }", "@RequestMapping(value = \"/rmselect.do\", method = RequestMethod.POST)\n\tpublic ModelAndView roomproc(RoomDTO dto, HttpServletRequest req) {\n\t\tModelAndView mav=new ModelAndView();\n\t\tmav.setViewName(\"room/msgView\");\n\t\tmav.addObject(\"root\",Utility.getRoot());\n\t\treturn mav;\n\t}", "@RequestMapping(value = \"/createReservation.htm\", method = RequestMethod.POST)\n\tpublic ModelAndView createReservation(HttpServletRequest request) {\n\t\tModelAndView modelAndView = new ModelAndView();\t\n\t\t\n\t\tif(request.getSession().getAttribute(\"userId\") != null){\n\t\t\n\t\t\t\n\t\t\tBank bank = bankDao.retrieveBank(Integer.parseInt(request.getParameter(\"bankId\")));\t\t\n\t\t\tUser user = userDao.retrieveUser(Integer.parseInt(request.getParameter(\"id\")));\n\t\t\t\n\t\t\t\n\t\t\tNotes notes5 = noteskDao.retrieveNotes(500);\n\t\t\tNotes notes10 = noteskDao.retrieveNotes(1000);\n\t\t\t\n\t\t\tint quantity5 = Integer.parseInt(request.getParameter(\"five\"));\n\t\t\tint quantity10 = Integer.parseInt(request.getParameter(\"thousand\"));\n\t\t\t\n\t\t\t\n\t\t\tReservationDetailsId reservationDetailsId5 = new ReservationDetailsId();\n\t\t\treservationDetailsId5.setNotesId(notes5.getId());\n\t\t\treservationDetailsId5.setQuantity(quantity5);\n\t\t\t\n\t\t\tReservationDetailsId reservationDetailsId10 = new ReservationDetailsId();\n\t\t\treservationDetailsId10.setNotesId(notes10.getId());\n\t\t\treservationDetailsId10.setQuantity(quantity10);\n\t\t\t\n\t\t\t\n\t\t\tReservationDetails reservationDetails5= new ReservationDetails();\n\t\t\treservationDetails5.setId(reservationDetailsId5);\n\t\t\t\n\t\t\t\n\t\t\tReservationDetails reservationDetails10= new ReservationDetails();\n\t\t\treservationDetails10.setId(reservationDetailsId10);\n\t\t\t\n\t\t\t\n\t\t\tReservation reservation = new Reservation();\t\n\t\t\treservation.setBank(bank);\n\t\t\treservation.setDate(request.getParameter(\"date\"));\n\t\t\treservation.setTimeslot(request.getParameter(\"timeslot\"));\n\t\t\treservation.setUser(user);\n\t\t\treservation.setStatus(\"incomplete\");\n\t\t\treservation.getReservationDetailses().add(reservationDetails5);\n\t\t\treservation.getReservationDetailses().add(reservationDetails10);\n\t\t\t\n\t\t\tuser.getResevations().add(reservation);\n\t\t\tuserDao.createUser(user);\n\t\t\t\n\t\t\t\n\t\t\treservationDAO.createReservation(reservation);\n\t\t\treservationDetails5.setResevation(reservation);\n\t\t\treservationDetails10.setResevation(reservation);\n\t\t\t\n\t\t\treservationDetailsId10.setResevationId(reservation.getId());\n\t\t\treservationDetailsId5.setResevationId(reservation.getId());\n\t\t\t\n\t\t\treservationDetailsDAO.createReservationDetails(reservationDetails5);\n\t\t\treservationDetailsDAO.createReservationDetails(reservationDetails10);\n\t\t\t\n\t\t\tmodelAndView.setViewName(\"result_reservation\");\n\t\t\t\n\t\t}\n\t\telse{\n\t\t\tmodelAndView.setViewName(\"login\");\n\t\t\t\n\t\t\t\n\t\t}\t\n\t\t\n\t\treturn modelAndView;\n\t}", "@PostMapping(MappingConstants.CREATE_MEETING)\n public ModelAndView createMeeting(@ModelAttribute MeetingBindingModel bindingModel,\n ModelAndView model) {\n\n Long projectIdforRedirect = bindingModel.getProject().getId();\n Meeting meeting = meetingService.registerMeeting(bindingModel);\n\n if (meeting == null) {\n model.addObject(AttributeConstants.ERROR, AttributeConstants.ERROR_REGISTER_MEETING);\n return this.view(ViewNameConstants.MEETING_CREATE, model);\n }\n\n return new ModelAndView(new RedirectView(MappingConstants.MEETINGS_GET_ALL\n .replace(AttributeConstants.DYNAMIC_PROJECT_ID, projectIdforRedirect.toString() )));\n }", "private Room createRooms(){\n Room inicio, pasilloCeldas, celdaVacia1,celdaVacia2, pasilloExterior,vestuarioGuardias, \n comedorReclusos,enfermeria,ventanaAbierta,salidaEnfermeria,patioReclusos,tunelPatio,salidaPatio;\n\n Item mochila,medicamentos,comida,itemInutil,itemPesado;\n mochila = new Item(\"Mochila\",1,50,true,true);\n medicamentos = new Item(\"Medicamentos\",5,10,true,false);\n comida = new Item(\"Comida\",2,5,true,false);\n itemInutil = new Item(\"Inutil\",10,0,false,false);\n itemPesado = new Item(\"Pesas\",50,0,false,false);\n\n // create the rooms\n inicio = new Room(\"Tu celda de la prision\");\n pasilloCeldas = new Room(\"Pasillo donde se encuentan las celdas\");\n celdaVacia1 = new Room(\"Celda vacia enfrente de la tuya\");\n celdaVacia2 = new Room(\"Celda de tu compaņero, esta vacia\");\n pasilloExterior = new Room(\"Pasillo exterior separado de las celdas\");\n vestuarioGuardias = new Room(\"Vestuario de los guardias de la prision\");\n comedorReclusos = new Room(\"Comedor de reclusos\");\n enfermeria = new Room(\"Enfermeria de la prision\");\n ventanaAbierta = new Room(\"Saliente de ventana de la enfermeria\");\n salidaEnfermeria = new Room(\"Salida de la prision por la enfermeria\");\n patioReclusos = new Room(\"Patio exterior de los reclusos\");\n tunelPatio = new Room(\"Tunel escondido para escapar de la prision\");\n salidaPatio = new Room(\"Salida de la prision a traves del tunel del patio\");\n\n // initialise room items\n\n comedorReclusos.addItem(\"Comida\",comida);\n enfermeria.addItem(\"Medicamentos\",medicamentos);\n pasilloCeldas.addItem(\"Inutil\",itemInutil);\n patioReclusos.addItem(\"Pesas\",itemPesado);\n vestuarioGuardias.addItem(\"Mochila\",mochila);\n\n // initialise room exits\n\n inicio.setExits(\"east\", pasilloCeldas);\n pasilloCeldas.setExits(\"north\",pasilloExterior);\n pasilloCeldas.setExits(\"east\",celdaVacia1);\n pasilloCeldas.setExits(\"south\",patioReclusos);\n pasilloCeldas.setExits(\"west\",inicio);\n pasilloCeldas.setExits(\"suroeste\",celdaVacia2);\n celdaVacia1.setExits(\"west\", pasilloCeldas);\n pasilloExterior.setExits(\"north\",comedorReclusos);\n pasilloExterior.setExits(\"west\",enfermeria);\n pasilloExterior.setExits(\"east\",vestuarioGuardias);\n comedorReclusos.setExits(\"south\", pasilloExterior);\n enfermeria.setExits(\"east\",pasilloExterior);\n enfermeria.setExits(\"south\", ventanaAbierta);\n ventanaAbierta.setExits(\"north\",enfermeria);\n ventanaAbierta.setExits(\"south\", salidaEnfermeria);\n patioReclusos.setExits(\"north\", pasilloCeldas);\n patioReclusos.setExits(\"east\", tunelPatio);\n tunelPatio.setExits(\"east\",salidaPatio);\n tunelPatio.setExits(\"west\", patioReclusos);\n // casilla de salida\n\n return inicio;\n }", "@Override\n\tpublic void onRoomCreated(RoomData arg0) {\n\t\t\n\t}", "private void createRooms()\n {\n Room outside, theatre, pub, lab, office , hallway, backyard,chickenshop;\n \n // create the rooms\n outside = new Room(\"outside the main entrance of the university\");\n theatre = new Room(\"in a lecture theatre\");\n pub = new Room(\"in the campus pub\");\n lab = new Room(\"in a computing lab\");\n office = new Room(\"in the computing admin office\");\n hallway=new Room (\"in the hallway of the university\");\n backyard= new Room( \"in the backyard of the university\");\n chickenshop= new Room(\"in the chicken shop\");\n \n \n \n // initialise room exits\n outside.setExit(\"east\", theatre);\n outside.setExit(\"south\", lab);\n outside.setExit(\"west\", pub);\n\n theatre.setExit(\"west\", outside);\n theatre.setExit(\"north\", backyard);\n\n pub.setExit(\"east\", outside);\n\n lab.setExit(\"north\", outside);\n lab.setExit(\"east\", office);\n \n office.setExit(\"south\", hallway);\n office.setExit(\"west\", lab);\n \n chickenshop.setExit(\"west\", lab);\n\n currentRoom = outside; // start game outside\n \n }", "@Override\n public void onClickCreateRoom(String code) {\n\n boolean status = networkControl.checkDialogPresence(getApplicationContext(),MultiplayerActivity.this);\n if(status){\n loadingDialog = new LoadingDialog(MultiplayerActivity.this);\n loadingDialog.startDialog(getResources().getString(R.string.wait_access_room));\n loadingDialog.setDataToCancel(code);\n loadingDialog.setVisibleClick(true);\n\n HashMap<String,String> data = new HashMap<>();\n data.putAll((Map<String,String>) preferences.getAll());\n String nickname = data.get(KEY_NICKNAME_PREFERENCES);\n\n addRoomsEventListener(loadingDialog,code,nickname);\n }\n\n\n }", "private void enterRoom() {\n connect();\n\n clientName = nameTextFiled.getText();\n try {\n toServer.writeInt(ENTERROOM);\n toServer.writeUTF(clientName);\n toServer.flush();\n report(\"Client ----> Server: \" + ENTERROOM + \" \" + clientId + \" \" + nameTextFiled.getText());\n\n clientFrame.setTitle(clientName);\n btnNewGame.setEnabled(true);\n\n// loginPanel.setVisible(false);\n// centerPanel.setVisible(true);\n // disable the login frame component\n nameTextFiled.removeActionListener(clientAction);\n nameTextFiled.setEnabled(false);\n btnEnterRoom.removeActionListener(clientAction);\n btnEnterRoom.setEnabled(false);\n\n // close the login frame\n loginFrame.setVisible(false);\n loginFrame.dispose();\n\n // open the client frame\n clientFrame.setVisible(true);\n\n } catch (IOException e) {\n e.printStackTrace();\n }\n }", "@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(value=\"/insert/hotel\", consumes=MediaType.APPLICATION_JSON_VALUE)\r\n\tpublic ResponseClient insertNewRoom(@RequestBody Hotel hotel){\r\n\t\thotelSer.save(hotel);\r\n\t\tResponseClient res = new ResponseClient();\r\n\t\tres.setResponse(\"successfull hotel_id: \");\r\n\t\treturn res;\r\n\t}", "@GetMapping(\"/room\")\n public String room(Model model) {\n return \"room\";\n }", "public void createRooms()//Method was given\n { \n \n // create the rooms, format is name = new Room(\"description of the situation\"); ex. desc = 'in a small house' would print 'you are in a small house.'\n outside = new Room(\"outside\", \"outside of a small building with a door straight ahead. There is a welcome mat, a mailbox, and a man standing in front of the door.\", false);\n kitchen = new Room(\"kitchen\", \"in what appears to be a kitchen. There is a sink and some counters with an easter egg on top of the counter. There is a locked door straight ahead, and a man standing next to a potted plant. There is also a delicious looking chocolate bar sitting on the counter... how tempting\", true);\n poolRoom = new Room(\"pool room\", \"in a new room that appears much larger than the first room.You see a table with a flashlight, towel, and scissors on it. There is also a large swimming pool with what looks like a snorkel deep in the bottom of the pool. Straight ahead of you stands the same man as before.\", true);\n library = new Room(\"library\", \"facing east in a new, much smaller room than before. There are endless rows of bookshelves filling the room. All of the books have a black cover excpet for two: one red book and one blue book. The man stands in front of you, next to the first row of bookshelves\", true);\n exitRoom = new Room(\"exit\", \"outside of the building again. You have successfully escaped, congratulations! Celebrate with a non-poisonous chocolate bar\",true);\n \n // initialise room exits, goes (north, east, south, west)\n outside.setExits(kitchen, null, null, null);\n kitchen.setExits(poolRoom, null, outside, null);\n poolRoom.setExits(null, library, kitchen, null);\n library.setExits(null, null, exitRoom, poolRoom);\n exitRoom.setExits(null, null, null, null); \n \n currentRoom = outside; // start game outside\n }", "public ViewRoom(Room r) {\n initComponents();\n this.room = r;\n this.workoutNum = 0;\n updateRoom();\n \n }", "protected void makeRoom(String roomID)\n {\n mChat.child(roomID).child(\"sender1\").setValue(uid1);\n mChat.child(roomID).child(\"sender2\").setValue(uid);\n goToChat(roomID);\n }", "public void onButtonClick(View v) {\n // initialize editText with method findViewById()\n // here editText will hold the name of room which is given by user\n EditText editText = findViewById(R.id.conferenceName);\n\n // store the string input by user in editText in\n // an local variable named text of string type\n String text = editText.getText().toString();\n\n // if user has typed some text in\n // EditText then only room will create\n if (text.length() > 0) {\n // creating a room using JitsiMeetConferenceOptions class\n // here .setRoom() method will set the text in room name\n // here launch method with launch a new room to user where\n // they can invite others too.\n JitsiMeetConferenceOptions options\n = new JitsiMeetConferenceOptions.Builder()\n .setRoom(text)\n .build();\n JitsiMeetActivity.launch(this, options);\n }\n\n }", "@Override protected void cadastroAction() {\n try {\n // JOptionPane.showMessageDialog(this, codigoTxtField.getText() +\n // descricaoTextArea.getText() + capacidadeTxtField.getText(),\n // \"teste\", JOptionPane.INFORMATION_MESSAGE, null);\n MaintainRoom.getInstance().insertRooms(codigoTxtField.getText(), descricaoTextArea.getText(), capacidadeTxtField.getText());\n\n JOptionPane.showMessageDialog(this, \"Sala Cadastrada com sucesso\", \"Sucesso\", JOptionPane.INFORMATION_MESSAGE, null);\n this.setVisible(false);\n\n } catch (PatrimonyException ex) {\n JOptionPane.showMessageDialog(this, ex.getMessage(), \"Erro\", JOptionPane.ERROR_MESSAGE, null);\n } catch (SQLException ex) {\n JOptionPane.showMessageDialog(this, ex.getSQLState() + \"\\n\" + ex.getMessage(), \"Erro\", JOptionPane.ERROR_MESSAGE, null);\n }\n\n }", "@Override\n\tpublic boolean fnCreateRoom(String adminId, String date, String roomNumber,\n\t\t\tString timeSlots) {\n\t\tfnTracelog(\"entry admmin\" + adminId.substring(0, 4));\n\t\tHashMap<String, HashMap<String, HashMap<String, String>>> roomDetails = null;\n\t\tString campus = adminId.substring(0, 4);\n\n\t\tswitch (campus.toUpperCase()) {\n\t\tcase \"DVLA\":\n\t\t\troomDetails = hmDorvalRoomDetails;\n\t\t\tbreak;\n\n\t\tcase \"KKLA\":\n\t\t\troomDetails = hmKirklandRoomDetails;\n\t\t\tbreak;\n\n\t\tcase \"WSTA\":\n\t\t\troomDetails = hmWestmountRoomDetails;\n\t\t\tbreak;\n\n\t\tdefault:\n\t\t\treturn false;\n\t\t}\n\n\t\tHashMap<String, HashMap<String, String>> allRoomDetailsOfADay = roomDetails\n\t\t\t\t.get(date);\n\t\tif (allRoomDetailsOfADay == null) {\n\t\t\tallRoomDetailsOfADay = new HashMap<>();\n\t\t\troomDetails.put(date, allRoomDetailsOfADay);\n\t\t}\n\t\tHashMap<String, String> timeSlotsOfRoom = allRoomDetailsOfADay\n\t\t\t\t.get(roomNumber);\n\t\tif (timeSlotsOfRoom == null) {\n\t\t\ttimeSlotsOfRoom = new HashMap<>();\n\t\t\tallRoomDetailsOfADay.put(roomNumber, timeSlotsOfRoom);\n\t\t}\n\t\tfor (String timeSlot : timeSlots.split(\",\")) {\n\t\t\tif (!timeSlotsOfRoom.containsKey(timeSlot))\n\t\t\t\ttimeSlotsOfRoom.put(timeSlot, null);\n\t\t}\n\t\tfnTracelog(\"successful\");\n\t\treturn true;\n\n\t}", "public ModifyRoomReservation() {\n initComponents();\n\n btn_search.requestFocus();\n\n getAllIds();\n\n }", "private void createRooms()\n {\n // create the rooms\n prison = new Room(\"Prison\", \"Prison. You awake in a cold, dark cell. Luckily, the wall next to you has been blown open. \\nUnaware of your current circumstances, you press on... \\n\");\n promenade = new Room(\"Promenade\",\"Promenade. After stumbling upon a ladder, you decided to climb up. \\n\" + \n \"You appear outside a sprawling promenade. There appears to be something shiny stuck in the ground... \\n\");\n sewers = new Room(\"Sewers\",\"Sewers. It smells... interesting. As you dive deeper, you hear something creak\");\n ramparts = new Room(\"Ramparts\", \"Ramparts. You feel queasy as you peer down below. \\nAs you make your way along, you're greated by a wounded soldier.\" +\n \"\\nIn clear agony, he slowly closes his eyes as he says, 'the king... ki.. kil... kill the king..' \\n\");\n depths = new Room(\"Depths\", \"Depths. You can hardly see as to where you're going...\" + \"\\n\");\n ossuary = new Room(\"Ossuary\", \"Ossuary. A chill runs down your spine as you examine the skulls... \\n\" +\n \"but wait... is.. is one of them... moving? \\n\" +\"\\n\" + \"\\n\" + \"There seems to be a chest in this room!\" + \"\\n\");\n bridge = new Room(\"Bridge\", \"Bridge. A LOUD SHREIK RINGS OUT BEHIND YOU!!! \\n\");\n crypt = new Room(\"Crypt\", \"Crypt. An eerire feeling begins to set in. Something about this place doesn't seem quite right...\" + \"\\n\");\n graveyard = new Room(\"Graveyard\", \"Graveyard. The soil looks rather soft. \\n\" +\n \"As you being to dive deeper, you begin to hear moans coming from behind you...\");\n forest = new Room(\"Forest\", \"Forest. It used to be gorgeous, and gleaming with life; that is, until the king came...\" + \"\\n\" +\n \"there's quite a tall tower in front of you... if only you had something to climb it.\" + \"\\n\");\n tower = new Room(\"Tower\", \"Tower. As you look over the land, you're astounded by the ruin and destruction the malice and king have left behind. \\n\");\n castle = new Room(\"Castle\", \"Castle. Used to be the most elegant and awe-inspiring building in the land. \\n\" +\n \"That is, before the king showed up... \\n\" +\n \"wait... is that... is that a chest? \\n\");\n throneRoomEntrance = new Room(\"Throne Entrance\", \"You have made it to the throne room entrance. Press on, if you dare.\");\n throne = new Room(\"Throne Room\", \"You have entered the throne room. As you enter, the door slams shut behind you! \\n\" +\n \"Before you stands, the king of all malice and destruction, Mr. Rusch\" + \"\\n\");\n deathRoom1 = new Room(\"Death Room\", \"THE DOOR SLAMS SHUT BEHIND YOU\");\n deathRoom2 = new Room(\"Death Room\", \"THE DOOR SLAMS SHUT BEHIND YOU\");\n deathRoom3 = new Room(\"Death Room\", \"THE DOOR SLAMS SHUT BEHIND YOU\");\n deathRoom4 = new Room(\"Death Room\", \"depths of the earth... well part of you at least.\" + \"\\n\" + \"You fell off the peaks of the castle to your untimely death\");\n \n // initialise room exits\n\n currentRoom = prison; // start game outside player.setRoom(currentRoom);\n player.setRoom(currentRoom);\n \n }", "public void addRoom(Chatroom room){\n\n }", "public Room(String roomName) {\n guests = new ArrayList<>();\n roomTier = null;\n this.roomName = roomName;\n this.roomId = RoomId.generate(roomName);\n }", "public static void addNewRoom() {\n Services room = new Room();\n room = addNewService(room);\n\n ((Room) room).setFreeService(FuncValidation.getValidFreeServices(ENTER_FREE_SERVICES,INVALID_FREE_SERVICE));\n\n //Get room list from CSV\n ArrayList<Room> roomList = FuncGeneric.getListFromCSV(FuncGeneric.EntityType.ROOM);\n\n //Add room to list\n roomList.add((Room) room);\n\n //Write room list to CSV\n FuncReadWriteCSV.writeRoomToFileCSV(roomList);\n System.out.println(\"----Room \"+room.getNameOfService()+\" added to list---- \");\n addNewServices();\n\n }", "@RequestMapping(value = \"/Reservation/{reservation_reservationId}/room\", method = RequestMethod.PUT)\n\t@ResponseBody\n\tpublic Room saveReservationRoom(@PathVariable Integer reservation_reservationId, @RequestBody Room room) {\n\t\treservationService.saveReservationRoom(reservation_reservationId, room);\n\t\treturn roomDAO.findRoomByPrimaryKey(room.getRoomId());\n\t}", "private void createRooms()\n {\n Room a1, a2, a3, b1, b2, b3, c1, c2, c3, bridge, outskirts;\n \n // create the rooms\n a1= new Room(\"see a strong river flowing south to the west. The trees seem to be letting up a little to the north.\");\n a2 = new Room(\" are still in a very dense forest. Maybe the trees are clearing up the the north?\");\n a3 = new Room(\"see a 30 foot cliff looming over the forest to the east. No way you could climb that. Every other direction is full of trees.\");\n b1 = new Room(\"see a strong river flowing to the west. Heavily wooded areas are in all other directions.\");\n b2 = new Room(\"see only trees around you.\");\n b3 = new Room(\"see a 30 foot cliff to the east. There might be one spot that is climbable. Trees surround you every other way.\");\n c1 = new Room(\" see the river cuts east here, but there seems to be a small wooden bridge to the south over it. The trees are less the direction that the river flows.\");\n c2 = new Room(\"are on a peaceful riverbank. If you weren't lost, this might be a nice spot for a picnic.\");\n c3 = new Room(\"see a 30 foot cliff to your east and a strong flowing river to the south. Your options are definitely limited.\");\n outskirts = new Room(\"make your way out of the trees and find yourself in an open field.\");\n cliff = new Room(\"managed to climb up the rocks to the top of the cliff. Going down, doesn't look as easy. You have to almost be out though now!\");\n bridge = new Room(\"cross the bridge and find a small trail heading south!\");\n win = new Room(\" manage to spot a road not too far off! Congratulations on finding your way out of the woods! Have a safe ride home! :)\" );\n fail = new Room(\" are entirely lost. It is pitch black out and there is no way that you are getting out of here tonight. I'm sorry, you LOSE.\");\n \n // initialise room exits\n a1.setExit(\"north\", outskirts);\n a1.setExit(\"east\", a2);\n a1.setExit(\"south\", b1);\n \n a2.setExit(\"east\", a3);\n a2.setExit(\"west\", a1);\n a2.setExit(\"south\", b2);\n a2.setExit(\"north\", outskirts);\n \n a3.setExit(\"north\", outskirts);\n a3.setExit(\"west\", a2);\n a3.setExit(\"south\", b3);\n \n b1.setExit(\"north\", a1);\n b1.setExit(\"east\", b2);\n b1.setExit(\"south\", c1);\n \n b2.setExit(\"east\", b3);\n b2.setExit(\"west\", b1);\n b2.setExit(\"south\", c2);\n b2.setExit(\"north\", a2);\n \n b3.setExit(\"north\", a3);\n b3.setExit(\"west\", b2);\n b3.setExit(\"south\", c3);\n b3.setExit(\"up\", cliff);\n \n c1.setExit(\"north\", b1);\n c1.setExit(\"east\", c2);\n c1.setExit(\"south\" , bridge);\n \n c2.setExit(\"east\", c3);\n c2.setExit(\"west\", c1);\n c2.setExit(\"north\", b2);\n \n c3.setExit(\"west\", c2);\n c3.setExit(\"north\", b3);\n \n outskirts.setExit(\"north\", win);\n outskirts.setExit(\"east\", a3);\n outskirts.setExit(\"west\", a1);\n outskirts.setExit(\"south\", a2);\n \n cliff.setExit(\"north\", outskirts);\n cliff.setExit(\"east\", win);\n \n bridge.setExit(\"north\", c1);\n bridge.setExit(\"south\", win);\n \n c3.addItem(new Item (\"shiny stone\", 0.1));\n a1.addItem(new Item (\"sturdy branch\", 2));\n a3.addItem(new Item(\"water bottle\" , 0.5));\n a3.addItem(new Item(\"ripped backpack\" , 1));\n currentRoom = b2; // start game outside\n }", "void showCreatorWaitingRoom();", "@PostMapping(\"/new\")\n @ResponseStatus(HttpStatus.CREATED)\n public Boolean newChat(@RequestBody NewChatEvent event) {\n notificationService.notifyAboutNewChat(event.getChatId(), event.getDepartmentId());\n scheduleService.scheduleReassignment(event.getChatId());\n return Boolean.TRUE;\n }", "@Override\n public void onDataChange(@NonNull DataSnapshot nodeRooms) {\n if(!nodeRooms.hasChild(code)){\n // non esiste nelle rooms una room con il codice inserito\n DataSnapshot roomToHaveAccess = nodeRooms.child(code);\n createRoom(load,code,nickname,roomToHaveAccess);\n\n } else {\n //esiste nelle rooms una room con il codice inserito\n showErrorMessage(getResources().getString(R.string.error_exist_room));\n }\n }", "protected void onSubmit() {\n\n Building b = new Building(c.BuildingTypeId, c.StyleId, c.CityId,\n c.Architectural_element_Id, c.Agesid, c.Latitude, c.Longtitude,\n c.buildingname, c.Address);\n BuildingCollection bc = new BuildingCollection();\n bc.AddBuilding(b);\n this.setResponsePage(new BuildingListWithPropertiesPage());\n\n }", "RoomInfo room(String name);", "public EventRoom getNewRoom(){\r\n newRoom.setRoomItems(eventRoomItems);\r\n return newRoom;\r\n }", "@RequestMapping(\"/post\")\n public String createPost(Model model) {\n if(!model.containsAttribute(\"message\")){\n model.addAttribute(\"message\", new Message());\n }\n\n return \"form\";\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 }", "@RequestMapping(value = \"/completeReservation\", method = RequestMethod.POST)\r\n public String completeReservation(ReservationRequest request,ModelMap modelMap){\n Reservation reservation= reservationService.bookFlight(request);\r\n modelMap.addAttribute(\"msg\",\"Resevation created succesfully and id is \"+reservation.getId());\r\n\r\n return \"reservation Confirmed\";\r\n }", "@RequestMapping(value=\"/add\", method = RequestMethod.POST)\r\n public void addAction(@RequestBody Reservation reservation){\n reservationService.create(reservation);\r\n }", "@Override\r\n\tpublic void OnCreateResult(cmdNotifyCreateResult createresult) {\n\t\tboolean isOK = createresult.getIsok();\r\n\t\tlong roomid = createresult.getRoomid();\r\n\t\tint roomtype = createresult.getType().ordinal();\r\n\t\tLog.d(TAG, \"OnCreateResult -------1\");\r\n\t\tCreateResult(isOK,String.valueOf(roomid),roomtype);\r\n\t}", "public static String addRoom(ArrayList<Room> roomList) {\n System.out.println(\"Add a room:\");\n String name = getRoomName();\n System.out.println(\"Room capacity?\");\n int capacity = keyboard.nextInt();\n System.out.println(\"Room buliding?\");\n String building1 = keyboard.next();\n System.out.println(\"Room location?\");\n String location1 = keyboard.next();\n Room newRoom = new Room(name, capacity, building1, location1);\n roomList.add(newRoom);\n if (capacity == 0)\n System.out.println(\"\");\n return \"Room '\" + newRoom.getName() + \"' added successfully!\";\n\n }", "@RequestMapping(value = \"/Reservation\", method = RequestMethod.POST)\n\t@ResponseBody\n\tpublic Reservation newReservation(@RequestBody Reservation reservation) {\n\t\treservationService.saveReservation(reservation);\n\t\treturn reservationDAO.findReservationByPrimaryKey(reservation.getReservationId());\n\t}", "@PostMapping(value = \"/competitionAdminRequest/new\")\n\tpublic String processCreationForm(@Valid final CompAdminRequest compAdminRequest, final BindingResult result) throws DataAccessException {\n\n\t\t//Obtenemos el username del usuario actual conectado\n\t\tAuthentication authentication = SecurityContextHolder.getContext().getAuthentication();\n\t\tString currentPrincipalName = authentication.getName();\n\n\t\tAuthenticated thisUser = this.authenticatedService.findAuthenticatedByUsername(currentPrincipalName);\n\n\t\t//Si hay errores seguimos en la vista de creación\n\t\tif (result.hasErrors()) {\n\t\t\treturn CompAdminRequestController.VIEWS_COMP_ADMIN_REQUEST_CREATE_OR_UPDATE_FORM;\n\t\t} else {\n\t\t\tcompAdminRequest.setUser(thisUser.getUser());\n\t\t\tcompAdminRequest.setStatus(RequestStatus.ON_HOLD);\n\n\t\t\tthis.compAdminRequestService.saveCompAdminRequest(compAdminRequest);\n\n\t\t\t//Si todo sale bien vamos a la vista de mi club\n\t\t\treturn \"redirect:/myCompetitionAdminRequest\";\n\t\t}\n\t}", "@Test\r\n\tpublic final void testAddRoom() {\n\t\tboolean success = roomServices.addRoom(expected2);\r\n\t\t// check if added successfully\r\n\t\tassertTrue(success);\r\n\t\t// need to copy the id from database since it autoincrements\r\n\t\tRoom actual = roomServices.getRoomByName(expected2.getName());\r\n\t\texpected2.setId(actual.getId());\r\n\t\t// check content of data\r\n\t\tassertEquals(expected2, actual);\r\n\t\t// delete room on exit\r\n\t\troomServices.deleteRoom(actual);\r\n\t}", "@FXML\n private void CreateLobbySubmit(ActionEvent actionEvent) {\n FireStoreController fireStoreController = (FireStoreController) ControllerRegistry.get(FireStoreController.class);\n generateToken();\n\n //while(true){\n try {\n if (!fireStoreController.checkExistence(token)) {}//break;\n } catch (ExecutionException | InterruptedException e) {\n e.printStackTrace();\n }\n generateToken();\n //}\n\n PlayerController playerController = (PlayerController) ControllerRegistry.get(PlayerController.class);\n name = CreateLobbyViewNameTextField.getText();\n try {\n playerController.setPlayer(name);\n } catch (Exception e) {\n e.printStackTrace();\n }\n\n fireStoreController.createLobby(token);\n\n\n //Open the lobby view\n goToLobby(actionEvent);\n }", "private static void performRoomManagement() {\n\t\t\r\n\t\t\r\n\r\n\t}", "public abstract void enterRoom();", "public void makeTestRoom() {\r\n\t\tthis.boardData = new BoardData();\r\n\t\tthis.boardData.loadLevelOne();\r\n\r\n\t\tif (boardData.getAllRooms().isEmpty()) {\r\n\t\t\tSystem.out.println(\"room list is empty\");\r\n\t\t} else if (boardData.getAllRooms().get(0).getRoomInventory().isEmpty()) {\r\n\t\t\tSystem.out.println(\"room's inventory is empty\");\r\n\t\t}\r\n\t}", "public void setRoomId( String roomId ) {\n this.roomId = roomId;\n }", "public void setRoom(String room) {\n\t\tthis.room = room;\n\t}", "private static void createRooms() {\n// Room airport, beach, jungle, mountain, cave, camp, raft, seaBottom;\n\n airport = new Room(\"airport\");\n beach = new Room(\"beach\");\n jungle = new Room(\"jungle\");\n mountain = new Room(\"mountain\");\n cave = new Room(\"cave\");\n camp = new Room(\"camp\");\n seaBottom = new Room(\"seabottom\");\n\n //Setting the the exits in different rooms\n beach.setExit(\"north\", jungle);\n beach.setExit(\"south\", seaBottom);\n beach.setExit(\"west\", camp);\n\n jungle.setExit(\"north\", mountain);\n jungle.setExit(\"east\", cave);\n jungle.setExit(\"south\", beach);\n\n mountain.setExit(\"south\", jungle);\n\n cave.setExit(\"west\", jungle);\n\n camp.setExit(\"east\", beach);\n\n seaBottom.setExit(\"north\", beach);\n\n // Starting room\n currentRoom = airport;\n }", "private CreateRoomRequest toCreateRoomRequest(OffsetDateTime validFrom, OffsetDateTime validUntil,\n Iterable<RoomParticipant> participants) {\n CreateRoomRequest createRoomRequest = new CreateRoomRequest();\n if (validFrom != null) {\n createRoomRequest.setValidFrom(validFrom);\n }\n\n if (validUntil != null) {\n createRoomRequest.setValidUntil(validUntil);\n }\n\n Map<String, ParticipantProperties> roomParticipants = new HashMap<>();\n\n if (participants != null) {\n roomParticipants = convertRoomParticipantsToMapForAddOrUpdate(participants);\n }\n\n if (participants != null) {\n createRoomRequest.setParticipants(roomParticipants);\n }\n\n return createRoomRequest;\n }", "public static Result newForm() {\n return ok(newForm.render(palletForm, setOfArticleForm));\n }", "public void populateRooms(){\n }", "public void setRoomId(String roomId) {\n this.roomId = roomId;\n }", "public void createLevel() {\n room = 1;\n currentLevelFinish = false;\n createRoom();\n }", "@Transactional\n @PostMapping(path = \"/create/{name}\")\n public Player createPlayer(@PathVariable String name,\n @RequestParam(name = \"room\", defaultValue = \"\") String room,\n @RequestParam(name = \"rid\", defaultValue = \"\") String roomId,\n @RequestParam(name = \"photo\", defaultValue = \"\") String photo) {\n Player player = null;\n try {\n if (photo.equals(\"\")) {\n player = playerService.create(name);\n } else {\n player = playerService.create(name, photo);\n }\n log.info(\"Created player \" + player.getName());\n if (!roomId.equals(\"\") && Integer.valueOf(roomId) > 0) {\n log.info(\"Processing optional parameter room id: \" + roomId);\n player.setRoom(Integer.valueOf(roomId));\n }\n if (!room.equals(\"\")) {\n log.info(\"Processing optional parameter room: \" + room);\n Optional<Room> r = roomService.get(room);\n if (r.isPresent()) {\n log.info(\"Room \" + room + \" was found. Joining player \" + name);\n player.setRoom(r.get().getId());\n }\n }\n } catch (Exception e) {\n log.error(\"Error creating player: \" + e.getMessage());\n }\n // log.info(\"Player created!\");\n return player;\n }", "public interface RoomFactory\n{\n public Room createRoom(int floorNumber, Booking booking, RoomType roomType);\n}", "@Test\n @SuppressWarnings({\"PMD.JUnitTestsShouldIncludeAssert\"})\n public void testCreateRoomOkResponse() {\n // given\n final CreateRoomRequest createRoomRequest = CreateRoomRequest.builder().name(TEST_ROOM).build();\n given(clientResponseProvider.sendPostRequest(\n MultiUserChatConstants.MULTI_USER_CHAT_CREATE_ROOM_COMMAND, createRoomRequest))\n .willReturn(OK_RESPONSE);\n\n // when\n multiUserChatService.createRoom(TEST_ROOM);\n\n // then\n\n }", "public Room(int roomNumber) \n\t{\n\t\tthis.roomNumber=roomNumber;\n\t}", "public String getRoom() {\r\n return room;\r\n }", "public void onCreate() {\r\n Session session = sessionService.getCurrentSession();\r\n Map<String, Region> items = ControlUtility.createForm(Pc.class);\r\n\r\n ControlUtility.fillComboBox((ComboBox<Kind>) items.get(\"Kind\"), session.getCampaign().getCampaignVariant().getKinds());\r\n ControlUtility.fillComboBox((ComboBox<Race>) items.get(\"Race\"), session.getCampaign().getCampaignVariant().getRaces());\r\n ControlUtility.fillCheckComboBox((CheckComboBox<Ability>) items.get(\"SavingThrows\"), Arrays.asList(Ability.values()));\r\n ControlUtility.fillCheckComboBox((CheckComboBox<Proficiency>) items.get(\"Proficiencies\"), session.getCampaign().getCampaignVariant().getProficiencies());\r\n ControlUtility.fillCheckComboBox((CheckComboBox<Feature>) items.get(\"Features\"), session.getCampaign().getCampaignVariant().getFeatures());\r\n ControlUtility.fillCheckComboBox((CheckComboBox<Trait>) items.get(\"Traits\"), session.getCampaign().getCampaignVariant().getTraits());\r\n ControlUtility.fillCheckComboBox((CheckComboBox<Equipment>) items.get(\"Equipment\"), session.getCampaign().getCampaignVariant().getEquipments());\r\n\r\n Campaign campaign = session.getCampaign();\r\n\r\n Dialog<String> dialog = ControlUtility.createDialog(\"Create Playable Character\", items);\r\n dialog.show();\r\n\r\n dialog.setResultConverter(buttonType -> {\r\n if (buttonType != null) {\r\n Pc pc = null;\r\n try {\r\n pc = ControlUtility.controlsToValues(Pc.class, items);\r\n } catch (NoSuchMethodException | IllegalAccessException | InvocationTargetException | InstantiationException | ClassNotFoundException e) {\r\n e.printStackTrace();\r\n }\r\n if (pc != null) {\r\n try {\r\n characterService.createPlayerCharacter(pc);\r\n } catch (SessionAlreadyExists | IndexAlreadyExistsException sessionAlreadyExists) {\r\n sessionAlreadyExists.printStackTrace();\r\n }\r\n try {\r\n playerManagementService.addOrUpdatePcForRegisteredPlayer(pc);\r\n Player player = playerManagementService.getRegisteredPlayer();\r\n campaign.addPlayer(player);\r\n campaign.addCharacter(pc);\r\n if (campaignListingService.campaignExists(campaign.getId())) {\r\n manipulationService.updateCampaign(campaign);\r\n } else {\r\n manipulationService.createCampaign(campaign);\r\n }\r\n } catch (MultiplePlayersException | EntityNotFoundException | SessionAlreadyExists | IndexAlreadyExistsException e) {\r\n e.printStackTrace();\r\n }\r\n try {\r\n playerManagementService.addOrUpdatePcForRegisteredPlayer(pc);\r\n } catch (MultiplePlayersException | EntityNotFoundException e) {\r\n e.printStackTrace();\r\n }\r\n try {\r\n sessionService.updateParticipant(playerManagementService.getRegisteredPlayer().getId(), pc.getId());\r\n sessionService.updateCampaign(campaign);\r\n } catch (EntityNotFoundException e) {\r\n e.printStackTrace();\r\n }\r\n render();\r\n return pc.toString();\r\n }\r\n }\r\n return null;\r\n });\r\n }", "@PostMapping(\"/forum/messages\")\n\t@Timed\n\tpublic ResponseEntity<ForumRoomMessage> createForumRoomMessage(@Valid @RequestBody ForumMessageDto fm)\n\t\t\tthrows URISyntaxException {\n\t\tLOGGER.debug(\"REST request to save ForumRoomMessage : {}\");\n\n\t\tForumRoomMessage forumRoomMessage = new ForumRoomMessage();\n\t\tforumRoomMessage.setMessage(fm.getMessage());\n\n\t\tif (forumRoomMessage.getId() != null) {\n\t\t\treturn ResponseEntity.badRequest().headers(HeaderUtil.createFailureAlert(\"forumRoomMessage\", \"idexists\",\n\t\t\t\t\t\"A new forumRoomMessage cannot already have an ID\")).body(null);\n\t\t}\n\n\t\tif (forumRoomMessage.getMessageDatetime() == null) {\n\t\t\tforumRoomMessage.setMessageDatetime(ZonedDateTime.now());\n\t\t}\n\n\t\tif (forumRoomMessage.getUser() == null) {\n\t\t\tUser user = userRepository.findByUserIsCurrentUser();\n\t\t\tforumRoomMessage.setUser(user);\n\t\t}\n\n\t\tForumRoom forumRoom = forumRoomRepository.findOne(fm.getCourseID());\n\t\tforumRoomMessage.setForumRoom(forumRoom);\n\n\t\tForumRoomMessage result = forumRoomMessageRepository.save(forumRoomMessage);\n\t\treturn ResponseEntity.created(new URI(\"/api/forum-room-messages/\" + result.getId()))\n\t\t\t\t.headers(HeaderUtil.createEntityCreationAlert(\"forumRoom\", result.getId().toString())).body(result);\n\t}", "@Override\n\tpublic Object getModel() \n\t{\n\t\treturn room;\n\t}", "@RequestMapping(value = \"/create\" , method = RequestMethod.POST, params=\"create\")\n\tpublic ModelAndView save(@Valid TripForm tripForm, BindingResult binding){\n\t\tModelAndView res;\n\t\t\t\t\n\t\tif (binding.hasErrors()) {\n\t\t\tfor(ObjectError a : binding.getAllErrors()){\n\t\t\t\tSystem.out.println(a);\n\t\t\t}\n\t\t\tres = createEditModelAndView(tripForm);\n\t\t}\n\t\telse {\n\t\t\t\tRoute route = routeService.reconstruct(tripForm);\n\t\t\t\tROUTE_CREATED = route;\n\t\t\t//\trouteService.save(route);\n\t\t\t\tres = new ModelAndView(\"redirect:/route/list.do\");\n\n\t\t}\n\treturn res;\n\t}", "public void nextRoom() {\n room++;\n createRoom();\n }", "@ServiceMethod(returns = ReturnType.SINGLE)\n public Mono<CommunicationRoom> createRoom(CreateRoomOptions createRoomOptions) {\n return createRoom(createRoomOptions, null);\n }", "public void createRoom(LoadingDialog load, String code, String nickname, DataSnapshot roomToHaveAccess) {\n DatabaseReference roomRef = firebaseDatabase.getReference(ROOMS_NODE + \"/\" + code);\n room = new Room(nickname,EMPTY_STRING,0,0,0,0,0,0,false,0,0,0,0,0,3);\n\n roomRef.setValue(room, new DatabaseReference.CompletionListener() {\n @Override\n public void onComplete(@Nullable DatabaseError error, @NonNull DatabaseReference ref) {\n ref.child(PLAYER2_NODE).addValueEventListener(new ValueEventListener() {\n @Override\n public void onDataChange(@NonNull DataSnapshot fieldPlayer2) {\n if(fieldPlayer2.getValue() != null){\n if(! fieldPlayer2.getValue().equals(EMPTY_STRING)){\n // il giocatore accede alla stanza poichè passa tutti i controlli sulla disponibilità del posto in stanza\n load.dismissDialog();\n Intent intent = new Intent(MultiplayerActivity.this,ActualGameActivity.class);\n intent.putExtra(CODE_ROOM_EXTRA,code);\n intent.putExtra(CODE_PLAYER_EXTRA,ROLE_PLAYER1);\n ref.child(PLAYER2_NODE).removeEventListener(this);\n startActivity(intent);\n }\n } else {\n ref.child(PLAYER2_NODE).removeEventListener(this);\n }\n\n }\n\n @Override\n public void onCancelled(@NonNull DatabaseError error) {\n OfflineFragment offlineFragment = new OfflineFragment();\n offlineFragment.show(getSupportFragmentManager(),\"Dialog\");\n }\n });\n\n }\n });\n\n\n\n }", "@BodyParser.Of(play.mvc.BodyParser.Json.class)\n public static Result create() throws JsonParseException, JsonMappingException, IOException {\n JsonNode json = request().body().asJson();\n Thing thing = mapper.treeToValue(json, Thing.class);\n thing.save();\n return ok(mapper.valueToTree(thing));\n }", "@Override\r\n public void actionPerformed(ActionEvent e) {\r\n try {\r\n organizer.saveRoom(organizer.getRoom());\r\n } catch (IOException ioException) {\r\n ioException.printStackTrace();\r\n }\r\n }", "@Override\n public void onClick(View v) {\n button.setText(\"CREATING ROOM\");\n button.setEnabled(false);\n writeStringDB(playerName,\"rooms/\" + playerName + \"/Player 1\" + \"/Name\");\n Intent intent = new Intent(getApplicationContext(), WaitingRoom.class);\n intent.putExtra(\"roomName\", roomName);\n intent.putExtra(\"playerID\",1);\n startActivity(intent);\n }", "public void createRoom() {\n int hp = LabyrinthFactory.HP_PLAYER;\n if (hero != null) hp = hero.getHp();\n try {\n labyrinth = labyrinthLoader.createLabyrinth(level, room);\n } catch (IOException e) {\n e.printStackTrace();\n }\n\n try {\n characterLoader.createCharacter(level, room);\n hero = characterLoader.getPlayer();\n if (room > 1) hero.setHp(hp);\n createMonsters();\n } catch (IOException e) {\n e.printStackTrace();\n }\n }", "public RoomDetailsUpdate() {\n initComponents();\n initExtraComponents();\n }", "@RequestMapping(value = \"/blog/newpost\", method = RequestMethod.POST)\n\tpublic String newPost(HttpServletRequest request, Model model) {\n\t\tString title=request.getParameter(\"title\");\n\t\tString body=request.getParameter(\"body\");\n\t\t\n\t\t//Validate parameters if not valid send back to form w/ error message\n\t\tif (title==\"\" || body==\"\"){\n\t\t\tif (title!=\"\"){\n\t\t\t\tmodel.addAttribute(\"title\",title);\n\t\t\t}\n\t\t\tif(body!=\"\"){\n\t\t\t\tmodel.addAttribute(\"body\",body);\n\t\t\t}\n\t\t\tmodel.addAttribute(\"error\",\"Post must have a Title and Body!\");\n\t\t\treturn \"newpost\";\n\t\t}\n\t\t\n\t\t//if they validate, create a new post\n\t\tInteger userId = (Integer) request.getSession().getAttribute(AbstractController.userSessionKey);\n\t\tUser author= userDao.findByUid(userId);\n\t\tPost post = new Post(title,body,author);\n\t\tpostDao.save(post);\n\t\tmodel.addAttribute(\"post\", post);\n\t\treturn \"redirect:\"+ post.getAuthor().getUsername()+\"/\"+ post.getUid(); \t\t\n\t}", "public void setNewlyCreatedRoomID(String roomID)\r\n\t{\r\n\t\ttheGridView.shopWindow.addRoomInfo(\"ID\", roomID);\r\n\t}", "public Room() {\n }", "public void createRoom(String roomHost, String roomName) throws IOException {\n ChatRoom newRoom = new ChatRoom(roomHost, roomName);\n chatRooms.add(newRoom);\n }", "public MyRoom() {\r\n }", "RoomInfo room(int id);", "private ArrayList<Room> createRooms() {\n //Adding starting position, always rooms(index0)\n\n rooms.add(new Room(\n \"Du sidder på dit kontor. Du kigger på uret og opdager, at du er sent på den. WTF! FISKEDAG! Bare der er fiskefilet tilbage, når du når kantinen. Du må hellere finde en vej ud herfra og hen til kantinen.\",\n false,\n null,\n null\n ));\n\n //Adding offices to <>officerooms, randomly placed later \n officeRooms.add(new Room(\n \"Du bliver kort blændet af en kontorlampe, som peger lige mod døråbningen. Du ser en gammel dame.\",\n false,\n monsterList.getMonster(4),\n itemList.getItem(13)\n ));\n\n officeRooms.add(new Room(\n \"Der er ingen i rummet, men rodet afslører, at det nok er Phillipas kontor.\",\n false,\n null,\n itemList.getItem(15)\n ));\n\n officeRooms.add(new Room(\n \"Du vader ind i et lokale, som er dunkelt oplyst af små, blinkende lamper og har en stank, der siger så meget spar fem, at det kun kan være IT-lokalet. Du når lige at høre ordene \\\"Rick & Morty\\\".\",\n false,\n monsterList.getMonster(6),\n itemList.getItem(7)\n ));\n\n officeRooms.add(new Room(\n \"Det var ikke kantinen det her, men hvorfor er der så krummer på gulvet?\",\n false,\n null,\n itemList.getItem(1)\n ));\n\n officeRooms.add(new Room(\n \"Tine sidder ved sit skrivebord. Du kan se, at hun er ved at skrive en lang indkøbsseddel. Hun skal nok have gæster i aften.\",\n false,\n monsterList.getMonster(0),\n itemList.getItem(18)\n ));\n\n officeRooms.add(new Room(\n \"Du træder ind i det tekøkken, hvor Thomas plejer at opholde sig. Du ved, hvad det betyder!\",\n false,\n null,\n itemList.getItem(0)\n ));\n\n officeRooms.add(new Room(\n \"Du går ind i det nok mest intetsigende rum, som du nogensinde har set. Det er så intetsigende, at der faktisk ikke er mere at sige om det.\",\n false,\n monsterList.getMonster(1),\n itemList.getItem(9)\n ));\n\n //Adding copyrooms to <>copyrooms, randomly placed later \n copyRooms.add(new Room(\n \"Døren knirker, som du åbner den. Et kopirum! Det burde du have set komme. Især fordi det var en glasdør.\",\n false,\n null,\n itemList.getItem(19)\n ));\n\n copyRooms.add(new Room(\n \"Kopimaskinen summer stadig. Den er åbenbart lige blevet færdig. Du går nysgerrigt over og kigger på alle de udskrevne papirer.\",\n false,\n null,\n itemList.getItem(12)\n ));\n\n //Adding restrooms to <>restrooms, randomly placed later \n restRooms.add(new Room(\n \"Ups! Dametoilettet. Der hænger en klam stank i luften. Det må være Ruth, som har været i gang.\",\n false,\n null,\n itemList.getItem(5)\n ));\n\n restRooms.add(new Room(\n \"Pedersen er på vej ud fra toilettet. Han vasker ikke fingre! Slut med at give ham hånden.\",\n false,\n monsterList.getMonster(7),\n itemList.getItem(11)\n ));\n\n restRooms.add(new Room(\n \"Du kommer ind på herretoilettet. Du skal simpelthen tisse så meget, at fiskefileterne må vente lidt. Du åbner toiletdøren.\",\n false,\n monsterList.getMonster(2),\n null\n ));\n\n restRooms.add(new Room(\n \"Lisette står og pudrer næse på dametoilettet. Hvorfor gik du herud?\",\n false,\n monsterList.getMonster(8),\n itemList.getItem(14)\n ));\n\n //Adding meetingrooms to<>meetingrooms, randomly placed later\n meetingRooms.add(new Room(\n \"Du træder ind i et lokale, hvor et vigtigt møde med en potentiel kunde er i gang. Du bliver nødt til at lade som om, at du er en sekretær.\",\n false,\n monsterList.getMonster(9),\n itemList.getItem(6)\n ));\n\n meetingRooms.add(new Room(\n \"Mødelokalet er tomt, men der står kopper og service fra sidste møde. Sikke et rod!\",\n false,\n null,\n itemList.getItem(3)\n ));\n\n meetingRooms.add(new Room(\n \"Projektgruppen sidder i mødelokalet. Vil du forsøge at forsinke dem i at nå fiskefileterne i kantinen?\",\n false,\n monsterList.getMonster(10),\n itemList.getItem(2)\n ));\n\n //Adding specialrooms to<>specialrooms, randomly placed later\n specialRooms.add(new Room(\n \"Du vader ind på chefens kontor. På hans skrivebord sidder sekretæren Phillipa.\",\n false,\n monsterList.getMonster(5),\n itemList.getItem(8)\n ));\n\n specialRooms.add(new Room(\n \"Det her ligner øjensynligt det kosteskab, Harry Potter boede i.\",\n false,\n monsterList.getMonster(3),\n itemList.getItem(4)\n ));\n\n specialRooms.add(new Room(\n \"OMG! Hvad er det syn?! KANTINEN!! Du klarede det! Du skynder dig op i køen lige foran ham den arrogante fra din afdeling. Da du når frem til fadet er der kun 4 fiskefileter tilbage. Du snupper alle 4!\",\n true,\n null,\n null\n ));\n\n //Adding rooms(Inde1-5)\n addOfficeRoom();\n addRestRoom(rooms, restRooms);\n addMeetingRoom(rooms, meetingRooms);\n addOfficeRoom();\n addRestRoom(rooms, restRooms);\n\n //Adding rooms(Inde6-10)\n addMeetingRoom(rooms, meetingRooms);\n addCopyRoom(rooms, copyRooms);\n addRestRoom(rooms, restRooms);\n addOfficeRoom();\n addCopyRoom(rooms, copyRooms);\n\n //Adding rooms(Inde11-15)\n addOfficeRoom();\n addSpecialRoom(rooms, specialRooms);\n addOfficeRoom();\n addRestRoom(rooms, restRooms);\n addOfficeRoom();\n\n //Adding rooms(Inde16-19)\n addOfficeRoom();\n addSpecialRoom(rooms, specialRooms);\n addSpecialRoom(rooms, specialRooms);\n addMeetingRoom(rooms, meetingRooms);\n\n return rooms;\n }", "@PostMapping(\"/ninjas\")\n\tpublic String createNinja(@Valid @ModelAttribute Ninja ninja, BindingResult bindingResult, Model model) {\n\t\tif (bindingResult.hasErrors()) {\n\t\t\tmodel.addAttribute(\"doa\", service.allDojos());\n\t\t\treturn \"ninja.jsp\";\n\t\t} else {\n\t\t\tservice.createNinja(ninja);\n\t\t\treturn \"redirect:/\";\n\t\t}\n\t}", "private void createRooms()\n {\n Room outside, garden, kitchen, frontyard, garage, livingroom,\n upperhallway, downhallway, bedroom1, bedroom2, toilet,teleporter;\n\n // create the rooms\n outside = new Room(\"outside the house\",\"Outside\");\n garden = new Room(\"in the Garden\", \"Garden\");\n kitchen = new Room(\"in the Kitchen\",\"Kitchen\");\n frontyard = new Room(\"in the Frontyard of the house\", \"Frontyard\");\n garage = new Room(\"in the Garage\", \"Garage\");\n livingroom = new Room(\"in the Living room\", \"Living Room\");\n upperhallway = new Room(\"in the Upstairs Hallway\",\"Upstairs Hallway\");\n downhallway = new Room(\"in the Downstairs Hallway\", \"Downstairs Hallway\");\n bedroom1 = new Room(\"in one of the Bedrooms\", \"Bedroom\");\n bedroom2 = new Room(\"in the other Bedroom\", \"Bedroom\");\n toilet = new Room(\"in the Toilet upstairs\",\"Toilet\");\n teleporter = new Room(\"in the Warp Pipe\", \"Warp Pipe\");\n\n // initialise room exits\n outside.setExit(\"north\", garden);\n outside.setExit(\"east\", frontyard);\n\n garden.setExit(\"south\", outside);\n garden.setExit(\"east\", kitchen);\n\n kitchen.setExit(\"west\", garden);\n kitchen.setExit(\"north\", livingroom);\n kitchen.setExit(\"south\", downhallway);\n\n frontyard.setExit(\"west\", outside);\n frontyard.setExit(\"north\", downhallway);\n frontyard.setExit(\"east\", garage);\n\n garage.setExit(\"west\", frontyard);\n garage.setExit(\"north\", downhallway);\n\n livingroom.setExit(\"west\", kitchen);\n\n downhallway.setExit(\"north\",kitchen);\n downhallway.setExit(\"west\",frontyard);\n downhallway.setExit(\"south\",garage);\n downhallway.setExit(\"east\",upperhallway);\n\n upperhallway.setExit(\"north\", bedroom2);\n upperhallway.setExit(\"east\", bedroom1);\n upperhallway.setExit(\"south\", toilet);\n upperhallway.setExit(\"west\", downhallway);\n\n toilet.setExit(\"north\", upperhallway);\n\n bedroom1.setExit(\"west\",upperhallway);\n\n bedroom2.setExit(\"south\", upperhallway);\n\n rooms.add(outside);\n rooms.add(garden);\n rooms.add(kitchen);\n rooms.add(frontyard);\n rooms.add(garage);\n rooms.add(livingroom);\n rooms.add(upperhallway);\n rooms.add(downhallway);\n rooms.add(bedroom1);\n rooms.add(bedroom2);\n rooms.add(toilet);\n }", "@RequestMapping(value= \"/create\", method = RequestMethod.POST)\n public String create(Film film) { //Hier gaat Spring ervanuit dat 'Film' een Java Bean is en dan gaat hij automatisch de setters gebruiken\n filmRepository.save(film);\n return \"redirect:/films\";\n }", "public static Result postAddPaper() {\n Form<PaperFormData> formData = Form.form(PaperFormData.class).bindFromRequest();\n Paper info1 = new Paper(formData.get().title, formData.get().authors, formData.get().pages,\n formData.get().channel);\n info1.save();\n return redirect(routes.PaperController.listProject());\n }" ]
[ "0.7401794", "0.7059239", "0.68739545", "0.6815284", "0.68037504", "0.67834216", "0.6715179", "0.6618208", "0.61830145", "0.605328", "0.6036056", "0.60021144", "0.5965407", "0.59434515", "0.5900094", "0.5888357", "0.5738676", "0.5683716", "0.5630846", "0.55877995", "0.55502665", "0.54773366", "0.53864884", "0.53441674", "0.5326583", "0.53124934", "0.5309565", "0.5289917", "0.5278701", "0.52671206", "0.5246359", "0.5230121", "0.5219595", "0.5206378", "0.5198947", "0.51699436", "0.5161366", "0.5134358", "0.5127066", "0.51270443", "0.5122902", "0.5120772", "0.5110398", "0.5105402", "0.5086999", "0.5084189", "0.5082991", "0.50755596", "0.5073683", "0.50622547", "0.50565577", "0.50532013", "0.5053074", "0.5046984", "0.5044048", "0.5036613", "0.50358343", "0.5010712", "0.50089437", "0.50034636", "0.4991653", "0.4975821", "0.49748865", "0.4974853", "0.4974005", "0.49676245", "0.49667937", "0.4956289", "0.4950424", "0.4949824", "0.4942215", "0.49283826", "0.49234", "0.49192613", "0.49182928", "0.49167463", "0.49142092", "0.49118826", "0.49093327", "0.49039382", "0.49023262", "0.49020225", "0.49012303", "0.48925874", "0.48914945", "0.48906076", "0.48894456", "0.4886359", "0.48817736", "0.48809624", "0.48783776", "0.4877487", "0.48705393", "0.48667246", "0.4864817", "0.48569828", "0.4855533", "0.4842628", "0.48415285", "0.48387623" ]
0.7592033
0
Check whether the user is authorized for the particular organization.
public boolean isUserAuthorized(User user, String resourceId, String action, String orgId, int tenantId) throws UserStoreException { OrganizationMgtAuthzDAOImpl organizationMgtAuthzDAOImpl = new OrganizationMgtAuthzDAOImpl(); return organizationMgtAuthzDAOImpl.isUserAuthorized(user, resourceId, action, orgId, tenantId); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public Boolean isAuthorized(String userId);", "boolean getIsAuthorized();", "public boolean isAuthorised(SessionObjectDTO sessionDTO) {\n\t\ttry {\n\t\t\tIUserService service = (IUserService) BusinessServiceLocator.locate(IUserService.class);\n\t\t\tsessionDTO = (SessionObjectDTO) session.get(\"sessionDTO\");\n\t\t\tservice.getAuthorisations(userDetailsDTO, sessionDTO.getRoleId());\n\t\t\tservice.getAuthorisedPagesForUser(sessionDTO.getRoleId(), sessionDTO.getUserId(), userDetailsDTO);\n\t \tif(userDetailsDTO.getAuthorisedPagesList() != null && userDetailsDTO.getAuthorisedPagesList().contains((LinMobileConstants.APP_VIEWS[2]).split(LinMobileConstants.ARRAY_SPLITTER)[1].trim())) {\n\t \t\tsessionDTO.setPageName((LinMobileConstants.APP_VIEWS[2]).split(LinMobileConstants.ARRAY_SPLITTER)[1].trim());\n\t \t\treturn true;\n\t \t}\n\t \t}\n\t\tcatch (Exception e) {\n\t\t\t\n\t\t\tlog.severe(\"Exception in execution of isAuthorised : \" + e.getMessage());\n\t\t}\n\t\treturn false;\n\t}", "public static void assertCanAdministrateOrg(Person user, String organizationUuid) {\n logger.debug(\"Asserting canAdministrateOrg status for {} in {}\", user, organizationUuid);\n if (canAdministrateOrg(user, organizationUuid)) {\n return;\n }\n throw new WebApplicationException(UNAUTH_MESSAGE, Status.FORBIDDEN);\n }", "boolean isAuthorized(SiteUser user, Long transmissionId);", "public boolean isAuthorized(){\n\t\treturn authorized;\n\t}", "public boolean isAuthorized() {\n return authorized;\n }", "private boolean isAuthorized() {\n return true;\n }", "public boolean isAuthorized() {\n return isAuthorized;\n }", "public boolean isUserAuthorized(User user, String resourceId, String action, int tenantId)\n throws UserStoreException {\n\n OrganizationMgtAuthzDAOImpl organizationMgtAuthzDAOImpl = new OrganizationMgtAuthzDAOImpl();\n return organizationMgtAuthzDAOImpl.isUserAuthorized(user, resourceId, action, tenantId);\n }", "@Override\n public boolean hasAccess(User user) {\n return user.hasRole(RoleValue.APP_ADMIN) || this.equals(user.company);\n }", "public boolean isAuthorized() {\r\n // TODO - implement User.isAuthorized\r\n throw new UnsupportedOperationException();\r\n }", "private static Boolean isAuthorised(Page page, List<GrantedAuthority> userAuthorities ) {\n if ( page.getAllowedRoles().size() == 0 ) {\n return true;\n }\n \n for ( GrantedAuthority role : userAuthorities ) {\n for ( String requiredRole : page.getAllowedRoles() ) {\n if ( role.getAuthority().equals(requiredRole) ) {\n return true;\n }\n }\n }\n return false;\n }", "boolean hasAuth();", "public boolean isSetOrganizationId()\r\n {\r\n synchronized (monitor())\r\n {\r\n check_orphaned();\r\n return get_store().count_elements(ORGANIZATIONID$4) != 0;\r\n }\r\n }", "private boolean isOnePerOrg(String org){\r\n\t\tfor(int i = 0; i < users.size(); i++){\r\n\t\t\tif(users.get(i).organization.equalsIgnoreCase(org)){\r\n\t\t\t\tSystem.out.println(\"Sorry only one person can represent the Nonprofit Organization\");\r\n\t\t\t\treturn true;\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn false;\r\n\t}", "default Optional<Boolean> doesCalendarAccessAuthorized() {\n return Optional.ofNullable(toSafeBoolean(getCapability(CALENDAR_ACCESS_AUTHORIZED_OPTION)));\n }", "private void checkUserAuthorities() {\n\t\tAuthority auth = authorityRepository.findTop1ByName(AuthorityType.ROLE_ADMIN);\n\t\tif (null == auth) {\n\t\t\tauth = Authority.createAdmin();\n\t\t\tauthorityRepository.save(auth);\n\t\t}\n\t\tAuthority authUser = authorityRepository.findTop1ByName(AuthorityType.ROLE_USER);\n\t\tif (null == authUser) {\n\t\t\tauthUser = Authority.createUser();\n\t\t\tauthorityRepository.save(authUser);\n\t\t}\n\t}", "public static boolean authorize(User user) {\n\t\t\n\t\treturn true;\n\t}", "public static int checkAuthorizedToEdit(String schema, Long sim_id, Long user_id){\r\n\t\t\r\n\t\tUser user = User.getById(schema, user_id);\r\n\t\t\r\n\t\tif ((sim_id == null) || (user == null) || (!(user.isSim_author()))){\r\n\t\t\treturn USER_NOT_AUTHOR;\r\n\t\t}\r\n\t\t\r\n\t\tSimulation sim = Simulation.getById(schema, sim_id);\r\n\t\t\r\n\t\tif (sim.getSimEditingRestrictions() == Simulation.CAN_BE_EDITED_BY_SPECIFIC_USERS){\r\n\t\t\t// need to check to see if this user is autorized\r\n\t\t\tif (!(SimEditors.checkIfAuthorized(schema, sim_id, user_id))){\r\n\t\t\t\treturn NOT_AUTHORIZED;\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\tif (sim.getPublishedState() != Simulation.NOT_PUBLISHED){\r\n\t\t\treturn SIM_LOCKED;\r\n\t\t}\r\n\t\t\r\n\t\treturn SIM_CAN_BE_EDITED;\r\n\t}", "boolean hasCustomerUserAccess();", "@Override\n protected boolean isAuthorized(PipelineData pipelineData) throws Exception\n {\n \t// use data.getACL() \n \treturn true;\n }", "private boolean isAuthorized(String decodedToken) {\n if(StringUtils.isBlank(decodedToken)){\n return false;\n }\n \n String[] credentials = decodedToken.split(\":\", 2);\n String clientid = credentials[0];\n String clientsc = credentials[1];\n \n ClientDto client = clientService.findByClientId(clientid);\n if(null == client) {\n return false;\n }\n BCryptPasswordEncoder encoder = new BCryptPasswordEncoder();\n if(encoder.matches(clientsc, client.getClientSecret())) {\n return true;\n }\n \n return false;\n }", "public static boolean canAccess (HttpServletRequest req, AccessRights requiredRights) {\n\t\tif (requiredRights.equals(AccessRights.PUBLIC)) {\n\t\t\treturn true;\n\t\t}\n\n\t\tif (req.getSession().getAttribute(SESS_IS_EMPLOYEE) != null) {\n\t\t\tif (requiredRights.equals(AccessRights.AUTHENTICATED) || requiredRights.equals(AccessRights.EMPLOYEE)) {\n\t\t\t\treturn true;\n\t\t\t}\n\n\t\t\treturn req.getSession().getAttribute(SESS_IS_ADMIN) != null && (boolean) req.getSession().getAttribute(SESS_IS_ADMIN);\n\t\t}\n\n\t\treturn false;\n\t}", "public boolean isAuthorized(Priviliges priviliges) {\n return priviliges.equals(this.priviliges);\n }", "HasValue<Boolean> getIsOrgUser();", "public boolean isToolsAuthorized() {\n\t\treturn isFdAuth || isGaAuth || isPeAuth;\n\t}", "private Boolean authorize() {\n\n return Session.getInstance().login(user.getText(), password.getText());\n }", "public static boolean isAuthenticated() {\n SecurityContext securityContext = SecurityContextHolder.getContext();\n Authentication authentication = securityContext.getAuthentication();\n if (authentication != null) {\n return authentication.getAuthorities().stream()\n .noneMatch(grantedAuthority -> grantedAuthority.getAuthority().equals(Authorities.ANONYMOUS));\n }\n return false;\n }", "public boolean isAdmin(String accessToken, String appName) {\n if (accessToken == null) {\n return false;\n }\n AuthAccessInfo access = accessTokens.get(accessToken);\n if (access != null) {\n return !access.getReadonly() && appName.equals(access.getAppName());\n }\n return false;\n }", "void setAnAuthorized(int userAuth, int acctAuth) {\n\t\tthis.isAnAuth = userAuth == 1 || acctAuth == 1;\n\t}", "boolean hasQueryAuthorizations();", "public boolean checkAuth() {\n SharedPreferences sharedPreferences = getSharedPreferences(SHARED_PREFS, MODE_PRIVATE);\n return sharedPreferences.getBoolean(AUTH, false);\n }", "@Override\r\n\tpublic boolean isAuthorized(Account account, String permission) {\r\n\t\tboolean isAuthorized = false;\r\n\t\tif ( cookieValue != null && !cookieValue.isEmpty() && account != null ) { // for FCL authenticated users\r\n\t\t\tisAuthorized = CXSHttpRequestAuthnAuthzUtil.isAccountAssociated(cookieValue, account.getAccountNumber().getValue());\r\n\t\t} else if ( httpRequest != null ) { // for WSTM authenticated users\r\n\t\t\ttry {\r\n\t\t\t\tisAuthorized = CXSHttpRequestAuthnAuthzUtil.isAccountAssociated(httpRequest);\r\n\t\t\t} catch (CALException e) {\r\n\t\t\t\tAppLogger.error(\"Failed in isAccountAssociated::: {0}\", e);\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn isAuthorized;\r\n\t}", "@Override\n public boolean hasAccessPermission(String user, NamespaceKey key, DatasetConfig datasetConfig) {\n return userPredicate.test(user);\n }", "private boolean isAuthenticated(final ContainerRequestContext requestContext) {\n // Return true if the user is authenticated or false otherwise\n return requestContext.getSecurityContext().getUserPrincipal() != null;\n }", "@Test\n public void authorisedTest() {\n assertTrue(authResponse.isAuthorised());\n }", "public boolean checkPermission(Authentication auth, Integer ctId, String... authority) throws NoSuchPageException {\n List<AuthorityDTO> lstAuthority = authorityMapper.getContestAuthority(ctId, auth.getName());\n for(AuthorityDTO curAuth : lstAuthority){\n for(String requireAuth : authority){\n if (requireAuth.equals(curAuth.getName())){\n return true;\n }\n }\n }\n return false;\n }", "public static boolean isUserAuthorized(DSUser user) {\n\t\tDSUsers dsUsers = getUsersFromFile();\n\t\treturn (existedUser(dsUsers, user) != null && passwordCorrect(dsUsers,\n\t\t\t\tuser));\n\t}", "public boolean isAuthenticated() {\r\n\t\treturn user != null;\r\n\t}", "public boolean hasAdminAccess(User user){\n return (user.hasOneOf(RoleValue.COMPANY_ADMIN, RoleValue.APP_ADMIN) && hasAccess(user));\n }", "boolean isAuthenticated();", "public boolean isUserAuthorized(String userName) throws Exception {\n HDFSNameNodeComponentManager componentManager = HDFSNameNodeComponentManager.getInstance();\n boolean isUserexist = componentManager.getRealmForCurrentTenant().getUserStoreManager().isExistingUser(userName);\n List<String> userRoles = Arrays.asList(componentManager.getRealmForCurrentTenant().getUserStoreManager().getRoleListOfUser(userName));\n //get protocol list\n //authorize user to protocol\n if (isUserexist) {\n return true;\n }\n return false;\n\n }", "@Override\n public boolean isUserInRole(final String roleName) {\n return scopes.contains(roleName);\n }", "@Override\n\tpublic boolean checkAuthorization(HttpServletRequest request) {\n\t\treturn true;\n\t}", "private boolean isValidUser(OfferRequest offerRequest) {\n String currentUser = securityContextService.getCurrentUser();\n Optional<User> optionalUser = userRepository.findByUsername(currentUser);\n\n if (optionalUser.isPresent()) {\n\n String organisationalUnitNameFromOffer = offerRequest.getOrganisationalUnit();\n\n String userOrganisationalUnit = optionalUser.get().getOrganisationalUnit().getName();\n\n if (userOrganisationalUnit.equals(organisationalUnitNameFromOffer)) {\n return true;\n } else {\n throw new UnauthorizedException(String.format(\"Access to Organisational Unit %s not permitted\",\n organisationalUnitNameFromOffer));\n }\n }\n throw new NotFoundException(\"User not found\");\n\n }", "boolean hasRole();", "boolean hasCustomerUserAccessInvitation();", "public static Result isUser() {\n String email = session().get(\"email\");\n if (email == null) {\n return unauthorized(\"unauthorized - you must be logged in!\");\n }\n // Otherwise, all good:\n User user = User.findByEmail(email);\n response().setHeader(\"X-Auth-Remote-User\", user.name);\n response().setHeader(\"X-Auth-Remote-User-Email\", user.email);\n response().setHeader(\"X-Auth-Remote-User-Primary-Role\",\n user.getRole().name);\n return ok(Json.toJson(\"isUser\"));\n }", "@Override\n public boolean isPermitted(HttpServletRequest request, int permittedRole) {\n boolean result = false;\n HttpSession session = request.getSession();\n String userName = (String) session.getAttribute(\"userName\");\n String token = (String) session.getAttribute(\"token\");\n int role = Integer.parseInt((String) session.getAttribute(\"role\"));\n if (userName != null && token != null) {\n CrUser user = userRepo.findByUserName(userName);\n if (user != null && isTokenValid(user, token) && role == permittedRole) {\n result = true;\n }\n }\n return result;\n }", "@Test\n public void test_hasAuthority_DEVELOPER() {\n DbUser user = new DbUser();\n user.setAuthoritiesEnum(Collections.singleton(Authority.DEVELOPER));\n user = userDao.save(user);\n\n for (Authority auth : Authority.values()) {\n assertThat(userService.hasAuthority(user.getUserId(), auth)).isTrue();\n }\n }", "boolean hasAuthAccountFlags();", "public boolean isAuthRequired() {\n return !AfUtil.anyEmpty(_username);\n }", "boolean isAuthorized(String login, String password, Connection connection) throws DAOException;", "public boolean authorize(String username, String principal) {\n return getAuthorized(username).contains(principal);\n }", "private void checkAuthorization(RoutingContext context, List<CaptureMap> resolvedCaptureCollections,\n Handler<AsyncResult<Boolean>> handler) {\n AuthHandler auth = context.get(AuthenticationController.AUTH_HANDLER_PROP);\n if (auth != null && auth instanceof RedirectAuthHandlerBt) {\n MemberUtil.getCurrentUser(context, getNetRelay(), result -> {\n if (result.failed()) {\n handler.handle(Future.failedFuture(result.cause()));\n } else {\n IAuthenticatable member = result.result();\n if (member == null) {\n // this is an error\n handler.handle(Future.failedFuture(\n new IllegalArgumentException(\"This should not happen, we need an instance of IAuthenticatable here\")));\n } else {\n checkAuthorization(resolvedCaptureCollections, auth, member, handler);\n }\n }\n });\n } else {\n handler.handle(Future.succeededFuture(true));\n }\n }", "public static boolean checkAuthorisation(HttpSession session) {\r\n\t\tif (session.getAttribute(CommandParameter.PARAM_NAME_ID) == null) {\r\n\t\t\treturn true;\r\n\t\t}\r\n\t\treturn false;\r\n\t}", "public void testUserIsBlogOwner() {\n rootBlog.setProperty(SimpleBlog.BLOG_OWNERS_KEY, \"user1\");\n assertTrue(rootBlog.isUserInRole(Constants.BLOG_OWNER_ROLE, \"user1\"));\n assertFalse(rootBlog.isUserInRole(Constants.BLOG_OWNER_ROLE, \"user2\"));\n }", "void setGaAuthorized(int userAuth, int acctAuth) {\n\t\tthis.isGaAuth = userAuth != -1 && acctAuth == 1;\n\t}", "public boolean thisUserIsOwner(GHRepository repo) throws IOException {\n String repoOwner = repo.getOwnerName();\n GHMyself myself = gitHubUtil.getMyself();\n if (myself == null) {\n throw new IOException(\"Could not retrieve authenticated user.\");\n }\n String myselfLogin = myself.getLogin();\n return repoOwner.equals(myselfLogin);\n }", "public boolean isLoggedIn()\n {\n AccessToken accessToken = AccessToken.getCurrentAccessToken();\n return (accessToken != null);\n }", "public boolean getAuthorisedUser() {\n return authorisedUser;\n }", "boolean hasPrincipal();", "void setUpAuthorized(int userAuth, int acctAuth) {\n\t\tthis.isUpAuth = userAuth == 1 || acctAuth == 1;\n\t}", "boolean isAccessible(Object dbobject, int rights) throws HsqlException {\n\n /*\n * The deep recusion is all done in getAllRoles(). This method\n * only recurses one level into isDirectlyAccessible().\n */\n if (isDirectlyAccessible(dbobject, rights)) {\n return true;\n }\n\n if (pubGrantee != null && pubGrantee.isAccessible(dbobject, rights)) {\n return true;\n }\n\n RoleManager rm = getRoleManager();\n Iterator it = getAllRoles().iterator();\n\n while (it.hasNext()) {\n if (((Grantee) rm.getGrantee(\n (String) it.next())).isDirectlyAccessible(\n dbobject, rights)) {\n return true;\n }\n }\n\n return false;\n }", "public boolean checkAccess(HasUuid object) {\n // Allow newly-instantiated objects\n if (!wasResolved(object)) {\n return true;\n }\n // Allow anything when there are no roles in use\n if (getRoles().isEmpty()) {\n return true;\n }\n Principal principal = getPrincipal();\n // Check for superusers\n if (!principalMapper.isAccessEnforced(principal, object)) {\n return true;\n }\n\n List<PropertyPath> paths = typeContext.getPrincipalPaths(object.getClass());\n PropertyPathChecker checker = checkers.get();\n for (PropertyPath path : paths) {\n path.evaluate(object, checker);\n if (checker.getResult()) {\n return true;\n }\n }\n addWarning(object, \"User %s does not have permission to edit this %s\", principal,\n typeContext.getPayloadName(object.getClass()));\n return false;\n }", "public boolean checkAccountPermission() {\n return EasyPermissions.hasPermissions(context, Manifest.permission.GET_ACCOUNTS);\n }", "public boolean isUserLoggedIn();", "boolean equals(String accessToken);", "private void checkRights() {\n image.setEnabled(true);\n String user = fc.window.getUserName();\n \n for(IDataObject object : objects){\n ArrayList<IRights> rights = object.getRights();\n \n if(rights != null){\n boolean everybodyperm = false;\n \n for(IRights right : rights){\n String name = right.getName();\n \n //user found, therefore no other check necessary.\n if(name.equals(user)){\n if(!right.getOwner()){\n image.setEnabled(false);\n }else{\n image.setEnabled(true);\n }\n return;\n //if no user found, use everybody\n }else if(name.equals(BUNDLE.getString(\"Everybody\"))){\n everybodyperm = right.getOwner();\n }\n }\n image.setEnabled(everybodyperm);\n if(!everybodyperm){\n return;\n }\n }\n }\n }", "@Override\n public boolean isAuthenticated() {\n return !person.isGuest();\n }", "@Step(\"Verify that right user is signed in\")\n public boolean isSignedIn() {\n if (!(Driver.driver.getCurrentUrl().equals(url))) open();\n WebElement email = Driver.driver.findElement(By.id(\"email\"));\n return email.getAttribute(\"value\").equals(SignUpPage.getEmail());\n }", "@UpnpAction(out = {@UpnpOutputArgument(name = \"Result\", stateVariable = \"A_ARG_TYPE_Result\")})\n/* */ public int isAuthorized(@UpnpInputArgument(name = \"DeviceID\", stateVariable = \"A_ARG_TYPE_DeviceID\") String deviceID) {\n/* 118 */ return 1;\n/* */ }", "default T calendarAccessAuthorized() {\n return amend(CALENDAR_ACCESS_AUTHORIZED_OPTION, true);\n }", "@Test\n\tpublic void testIsPermitted_2()\n\t\tthrows Exception {\n\t\tSimpleAuthorizingAccount fixture = new SimpleAuthorizingAccount();\n\t\tfixture.setSimpleRoles(new HashSet());\n\t\tList<Permission> permissions = new Vector();\n\n\t\tboolean[] result = fixture.isPermitted(permissions);\n\n\t\t// add additional test code here\n\t\tassertNotNull(result);\n\t}", "@Test\n\tpublic void testIsPermitted_1()\n\t\tthrows Exception {\n\t\tSimpleAuthorizingAccount fixture = new SimpleAuthorizingAccount();\n\t\tfixture.setSimpleRoles(new HashSet());\n\t\tList<Permission> permissions = null;\n\n\t\tboolean[] result = fixture.isPermitted(permissions);\n\n\t\t// add additional test code here\n\t\tassertNotNull(result);\n\t}", "private boolean hasRole(Roles role) {\n\t\tSecurityContext context = SecurityContextHolder.getContext();\n\t\t\n\t\tif(context == null) {\n\t\t\treturn false;\n\t\t}\n\t\t\n\t\tAuthentication aut = context.getAuthentication();\n\t\tif(aut == null) {\n\t\t\treturn false;\n\t\t}\n\t\t\n\t\tCollection<? extends GrantedAuthority> autohotities = aut.getAuthorities();\n\t\tfor(GrantedAuthority ga : autohotities) {\n\t\t\tif(role.toString().equals(ga.getAuthority())) {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\t\treturn false;\n\t}", "boolean authNeeded();", "public Boolean isAuthorizedForDataset() {\n return (attributes.containsKey(KEY_IS_AUTHORIZED_FOR_DS) ? (Boolean) attributes\n .get(KEY_IS_AUTHORIZED_FOR_DS) : null);\n }", "@GetMapping(\"/users/is-admin\")\n @ResponseStatus(HttpStatus.OK)\n public boolean isAdmin(@AuthenticationPrincipal User user) {\n return userService.isAdmin(user);\n }", "public boolean isAuthorized(String messageBoxId, String operation) throws MessageBoxException {\n String loggedInUser = MultitenantUtils.getTenantAwareUsername(CarbonContext.getCurrentContext().getUsername());\n try {\n AuthorizationManager authorizationManager = Utils.getUserRelam().getAuthorizationManager();\n\n String messageBoxPath = MessageBoxConstants.MB_MESSAGE_BOX_STORAGE_PATH + \"/\" +\n messageBoxId;\n\n return authorizationManager.isUserAuthorized(loggedInUser, messageBoxPath, operation);\n } catch (UserStoreException e) {\n String error = \"Failed to check is \" + loggedInUser + \" authorized to \" + operation +\n \" to \" + messageBoxId;\n log.error(error);\n throw new MessageBoxException(error, e);\n }\n }", "boolean hasAccount();", "boolean hasAccount();", "boolean hasAccount();", "@SuppressWarnings(\"UnusedDeclaration\")\n boolean authorizeUser(\n String userName,\n int verificationCode,\n int window)\n throws GoogleAuthenticatorException;", "private boolean hasPermission(String username, SOAPMessage msg) {\r\n\t\ttry {\r\n\t\t\tNodeList email = msg.getSOAPBody().getElementsByTagName(SOAP_EMAIL_TAG);\r\n\r\n\t\t\t// if request has email\r\n\t\t\tif(email.getLength() > 0) {\r\n\t\t\t\treturn username.equals(msg.getSOAPBody().getElementsByTagName(SOAP_EMAIL_TAG).item(0).getTextContent());\r\n\t\t\t}\r\n\t\t\t// if there's no email field, every user has permissions to access\r\n\t\t\treturn true;\r\n\t\t\t\r\n\t\t} catch (SOAPException e) {\r\n\t\t\treturn false;\r\n\t\t}\r\n\t}", "private boolean validateUser(HttpServletResponse resp, HttpServletRequest req, String username) throws IOException {\n\n SessionHandler session = (SessionHandler) req.getSession().getAttribute(\"authorized\");\n\n String sessionUsername = session.getUsername();\n\n if((!sessionUsername.equalsIgnoreCase(\"admin\")\n && !username.equalsIgnoreCase(sessionUsername))\n || !session.isAuthorized()\n ){\n page.redirectTo(\"/account\", resp, req,\n \"errorMessage\", \"Action not permitted!\");\n return false;\n }\n return true;\n }", "public boolean isLoggedIn() {\n AccessToken accessToken = AccessToken.getCurrentAccessToken();\n if (accessToken == null) {\n return false;\n }\n return !accessToken.isExpired();\n }", "public void checkAuthority() {\n }", "public boolean authorizeCollections(DICOMQuery query) {\n boolean returnValue = true;\n AuthorizationCriteria auth = query.getAuthorizationCriteria();\n\n if (auth == null) {\n // Add authorization criteria if it does not\n // already exist\n auth = new AuthorizationCriteria();\n query.setCriteria(auth);\n }\n\n CollectionCriteria cc = query.getCollectionCriteria();\n\n if (cc == null) {\n // User didn't choose any collections, so filter by the collections\n // they are authorized to see\n auth.setCollections(getAuthorizedCollections());\n } else {\n List<String> authorizedCollections = getAuthorizedCollections();\n List<String> collectionsToRemove = new ArrayList<String>();\n\n // Look at each collection to ensure that user is allowed to view it\n for (String selectedCollection : cc.getCollectionObjects()) {\n if (!authorizedCollections.contains(selectedCollection)) {\n returnValue = false;\n collectionsToRemove.add(selectedCollection);\n }\n }\n\n for (String collectionToRemove : collectionsToRemove) {\n cc.removeCollection(collectionToRemove);\n }\n }\n\n return returnValue;\n }", "public boolean isLoggedIn(@NotNull Http.Context ctx) {\n Session session = this.getSession(ctx.request());\n return session != null && !(session.getUsername() == null || session.getUsername().isEmpty());\n }", "public boolean isAuthenticated() {\r\n return SecurityContextHolder.getContext().getAuthentication() != null;\r\n }", "private static boolean isAuthorized(\n @Nonnull Authorizer authorizer,\n @Nonnull String actor,\n @Nonnull ConjunctivePrivilegeGroup requiredPrivileges,\n @Nonnull Optional<ResourceSpec> resourceSpec) {\n for (final String privilege : requiredPrivileges.getRequiredPrivileges()) {\n // Create and evaluate an Authorization request.\n final AuthorizationRequest request = new AuthorizationRequest(actor, privilege, resourceSpec);\n final AuthorizationResult result = authorizer.authorize(request);\n if (AuthorizationResult.Type.DENY.equals(result.getType())) {\n // Short circuit.\n return false;\n }\n }\n return true;\n }", "public boolean hasAccount(String user);", "boolean isAdmin() {\n\n if (isAdminDirect()) {\n return true;\n }\n\n RoleManager rm = getRoleManager();\n Iterator it = getAllRoles().iterator();\n\n while (it.hasNext()) {\n try {\n if (((Grantee) rm.getGrantee(\n (String) it.next())).isAdminDirect()) {\n return true;\n }\n } catch (HsqlException he) {\n throw Trace.runtimeError(Trace.RETRIEVE_NEST_ROLE_FAIL,\n he.getMessage());\n }\n }\n\n return false;\n }", "public static boolean hasAdministrativePermissions(@NotNull Session session, String... additionalAdminAuthorizableIdsOrPrincipalNames) throws RepositoryException {\n List<String> additionalAdminIdsOrPrincipalNames = Arrays.asList(Optional.ofNullable(additionalAdminAuthorizableIdsOrPrincipalNames).orElse(new String[0]));\n final JackrabbitSession jackrabbitSession;\n if (session instanceof JackrabbitSession) {\n jackrabbitSession = (JackrabbitSession) session;\n if (isOakVersionExposingBoundPrincipals(session.getRepository())) {\n if (hasAdministrativePermissionsWithPrincipals(jackrabbitSession, additionalAdminIdsOrPrincipalNames)) {\n return true;\n }\n }\n } else {\n jackrabbitSession = null;\n }\n // then evaluate user id\n String userId = session.getUserID();\n if (hasAdministrativePermissionsWithAuthorizableId(userId, additionalAdminIdsOrPrincipalNames)) {\n return true;\n }\n if (jackrabbitSession != null) {\n Authorizable authorizable = jackrabbitSession.getUserManager().getAuthorizable(userId);\n if (authorizable == null) {\n return false;\n }\n \n Iterator<Group> groupIterator = authorizable.memberOf();\n while (groupIterator.hasNext()) {\n String groupId = groupIterator.next().getID();\n if (hasAdministrativePermissionsWithAuthorizableId(groupId, additionalAdminIdsOrPrincipalNames)) {\n return true;\n }\n }\n } else {\n log.warn(\"could not evaluate group permissions but just user name\");\n }\n return false;\n }", "boolean hasUser();", "boolean hasUser();", "boolean hasUser();", "boolean hasUser();" ]
[ "0.6519076", "0.63191813", "0.62942225", "0.6144809", "0.6135034", "0.6081322", "0.60489404", "0.5936824", "0.59140706", "0.5774425", "0.5756465", "0.5730463", "0.5674786", "0.563301", "0.5605835", "0.5592255", "0.55774415", "0.5566448", "0.5555858", "0.5489106", "0.54866236", "0.5460797", "0.5456494", "0.54430604", "0.54362077", "0.5427511", "0.5427027", "0.5412116", "0.5402951", "0.53690165", "0.5365131", "0.5358829", "0.53559667", "0.5327108", "0.5310027", "0.5309492", "0.5306244", "0.5302946", "0.528625", "0.52751094", "0.52725136", "0.52613604", "0.5247652", "0.52420217", "0.52413774", "0.5223846", "0.5221008", "0.5206862", "0.52034646", "0.5196361", "0.5189847", "0.51753163", "0.51520175", "0.51516086", "0.51489216", "0.513274", "0.5114634", "0.5104635", "0.5101519", "0.5077846", "0.5072319", "0.5069064", "0.5068384", "0.5065487", "0.50585055", "0.5058146", "0.5052001", "0.5051165", "0.5046594", "0.50456876", "0.504331", "0.50380206", "0.50335133", "0.5032755", "0.502846", "0.50264627", "0.50258374", "0.5023641", "0.49985528", "0.4998411", "0.4997867", "0.4984347", "0.4984347", "0.4984347", "0.49830455", "0.49752745", "0.4972315", "0.49504557", "0.49391997", "0.49389002", "0.49367514", "0.49352497", "0.4927454", "0.49127153", "0.4912539", "0.49089563", "0.49077806", "0.49077806", "0.49077806", "0.49077806" ]
0.6006948
7
Check whether the user has permission at least for one organization.
public boolean isUserAuthorized(User user, String resourceId, String action, int tenantId) throws UserStoreException { OrganizationMgtAuthzDAOImpl organizationMgtAuthzDAOImpl = new OrganizationMgtAuthzDAOImpl(); return organizationMgtAuthzDAOImpl.isUserAuthorized(user, resourceId, action, tenantId); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "boolean isHasPermissions();", "@Override\n\tpublic boolean can(String permission)\n\t{\n\t\treturn this.auth() != null && this.auth().getRole() != null && this.auth().getRole().getPermissions().parallelStream().filter(p -> Pattern.compile(p.getName()).matcher(permission).groupCount() == 0).count() != 0;\n\t}", "private boolean permisos() {\n for(String permission : PERMISSION_REQUIRED) {\n if(ContextCompat.checkSelfPermission(getContext(), permission) != PackageManager.PERMISSION_GRANTED) {\n return false;\n }\n }\n return true;\n }", "private boolean isOnePerOrg(String org){\r\n\t\tfor(int i = 0; i < users.size(); i++){\r\n\t\t\tif(users.get(i).organization.equalsIgnoreCase(org)){\r\n\t\t\t\tSystem.out.println(\"Sorry only one person can represent the Nonprofit Organization\");\r\n\t\t\t\treturn true;\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn false;\r\n\t}", "public boolean isSetOrganizationId()\r\n {\r\n synchronized (monitor())\r\n {\r\n check_orphaned();\r\n return get_store().count_elements(ORGANIZATIONID$4) != 0;\r\n }\r\n }", "public boolean checkPerms()\n {\n boolean perms = hasPerms();\n if (!perms) {\n ActivityCompat.requestPermissions(\n itsActivity, new String[] { itsPerm }, itsPermsRequestCode);\n }\n return perms;\n }", "private boolean checkAndRequestPermissions() {\n List<String> listPermissionsNeeded = new ArrayList<>();\n for (String pem : appPermissions){\n if (ContextCompat.checkSelfPermission(this, pem) != PackageManager.PERMISSION_GRANTED){\n listPermissionsNeeded.add(pem);\n }\n }\n\n //ask for non-granted permissions\n if (!listPermissionsNeeded.isEmpty()) {\n ActivityCompat.requestPermissions(this, listPermissionsNeeded.toArray(new String[listPermissionsNeeded.size()]), PERMISSION_REQUEST_CODE);\n return false;\n }\n return true;\n }", "public boolean hasPerms()\n {\n return ContextCompat.checkSelfPermission(itsActivity, itsPerm) ==\n PackageManager.PERMISSION_GRANTED;\n }", "public boolean hasRights(Right... permissions) {\n if (rights != null) {\n for (Right permission : permissions) {\n if (!rights.contains(permission)) {\n return false;\n }\n }\n\n return true;\n }\n\n return false;\n }", "public boolean hasPermissions(Set<Permission> p) {\n if (p.isEmpty()) {\n return true;\n }\n return hasPermissionsFor(request, subject, p);\n }", "public void hasPermissions(String[] permissions) {\r\n\r\n\t\t// user has no permissions\r\n\t\tif (user.getUserPermissions() == null || user.getUserPermissions().size() < 1) {\r\n\t\t\tthrow new PermissionException(NO_PERMISSION);\r\n\t\t}\r\n\r\n\t\t// user has no permissions\r\n\t\tif (permissions == null || permissions.length < 1) {\r\n\t\t\tthrow new PermissionException(NO_PERMISSION);\r\n\t\t}\r\n\t\t\r\n\t\t// check the permissions\r\n\t\tif (!doHasPermissions(permissions)) {\r\n\t\t\t// user does not have the permission requested\r\n\t\t\tthrow new PermissionException(NO_PERMISSION);\r\n\t\t}\r\n\t\t\r\n\t}", "public void checkPermissions(){\n //Check if some of the core permissions are not already granted\n if ((ContextCompat.checkSelfPermission(LoginActivity.this, Manifest.permission.ACCESS_FINE_LOCATION)!= PackageManager.PERMISSION_GRANTED)\n || (ContextCompat.checkSelfPermission(LoginActivity.this,Manifest.permission.CAMERA)!= PackageManager.PERMISSION_GRANTED)\n || (ContextCompat.checkSelfPermission(LoginActivity.this,Manifest.permission.WRITE_EXTERNAL_STORAGE)!= PackageManager.PERMISSION_GRANTED)) {\n Toast.makeText(this, \"Some permissions are not granted. Please enable them.\", Toast.LENGTH_SHORT).show();\n\n //If so, request the activation of this permissions\n ActivityCompat.requestPermissions(LoginActivity.this,\n new String[]{\n Manifest.permission.ACCESS_FINE_LOCATION,\n Manifest.permission.CAMERA,\n Manifest.permission.WRITE_EXTERNAL_STORAGE},\n REQUEST_CODE_ASK_PERMISSIONS);\n }\n else{\n //Permissions already granted\n }\n }", "public boolean checkPermissions(String... permissions) {\n if (permissions != null) {\n for (String permission : permissions) {\n if (ActivityCompat.checkSelfPermission(this, permission) != PackageManager.PERMISSION_GRANTED) {\n return false;\n }\n }\n }\n return true;\n }", "public boolean checkPermissions(String permission) {\r\n Log.d(TAG, \"checkPermissions: checking permission: \" + permission);\r\n\r\n int permissionRequest = ActivityCompat.checkSelfPermission(EditProfileActivity.this, permission);\r\n\r\n if (permissionRequest != PackageManager.PERMISSION_GRANTED) {\r\n Log.d(TAG, \"checkPermissions: \\n Permission was not granted for: \" + permission);\r\n Toast.makeText(this, \"Permissions not granted to access camera,\\n\" +\r\n \"please give permissions to GetAplot\", Toast.LENGTH_SHORT).show();\r\n return false;\r\n } else {\r\n Log.d(TAG, \"checkPermissions: \\n Permission was granted for: \" + permission);\r\n return true;\r\n }\r\n }", "private static boolean hasPermissions(Context context, String... permissions) {\n for (String permission : permissions) {\n if (ContextCompat.checkSelfPermission(context, permission)\n != PackageManager.PERMISSION_GRANTED) {\n return false;\n }\n }\n return true;\n }", "private boolean checkPermissions(Activity activity) {\n String[] permissions = getRequiredAndroidPermissions();\n return handler.areAllPermissionsGranted(activity, permissions);\n }", "public boolean isAllGranted(){\n //PackageManager.PERMISSION_GRANTED\n return false;\n }", "private boolean checkPermission() {\r\n int result = ContextCompat.checkSelfPermission(getApplicationContext(), READ_CONTACTS);\r\n int result1 = ContextCompat.checkSelfPermission(getApplicationContext(), CAMERA);\r\n int result2 = ContextCompat.checkSelfPermission(getApplicationContext(), ACCESS_FINE_LOCATION);\r\n int result3 = ContextCompat.checkSelfPermission(getApplicationContext(), READ_EXTERNAL_STORAGE);\r\n int result4 = ContextCompat.checkSelfPermission(getApplicationContext(), WRITE_EXTERNAL_STORAGE);\r\n int result5 = ContextCompat.checkSelfPermission(getApplicationContext(), READ_PHONE_STATE);\r\n int result6 = ContextCompat.checkSelfPermission(getApplicationContext(), RECORD_AUDIO);\r\n int result7 = ContextCompat.checkSelfPermission(getApplicationContext(), SEND_SMS);\r\n //int result8 = ContextCompat.checkSelfPermission(getApplicationContext(), BLUETOOTH);\r\n\r\n return result == PackageManager.PERMISSION_GRANTED && result1 == PackageManager.PERMISSION_GRANTED && result2 == PackageManager.PERMISSION_GRANTED &&\r\n result3 == PackageManager.PERMISSION_GRANTED && result4 == PackageManager.PERMISSION_GRANTED && result5 == PackageManager.PERMISSION_GRANTED &&\r\n result6 == PackageManager.PERMISSION_GRANTED && result7 == PackageManager.PERMISSION_GRANTED/*&& result8== PackageManager.PERMISSION_GRANTED*/;\r\n }", "@Override\n public boolean hasAccess(User user) {\n return user.hasRole(RoleValue.APP_ADMIN) || this.equals(user.company);\n }", "private Boolean checkRuntimePermission() {\n List<String> permissionsNeeded = new ArrayList<String>();\n\n final List<String> permissionsList = new ArrayList<String>();\n if (!addPermission(permissionsList, Manifest.permission.READ_EXTERNAL_STORAGE))\n permissionsNeeded.add(\"Storage\");\n if (!addPermission(permissionsList, Manifest.permission.CAMERA))\n permissionsNeeded.add(\"Camera\");\n /* if (!addPermission(permissionsList, Manifest.permission.WRITE_CONTACTS))\n permissionsNeeded.add(\"Write Contacts\");*/\n\n if (permissionsList.size() > 0) {\n if (permissionsNeeded.size() > 0) {\n // Need Rationale\n String message = \"You need to grant access to \" + permissionsNeeded.get(0);\n for (int i = 1; i < permissionsNeeded.size(); i++)\n message = message + \", \" + permissionsNeeded.get(i);\n showMessageOKCancel(message,\n 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(permissionsList.toArray(new String[permissionsList.size()]),\n REQUEST_CODE_ASK_MULTIPLE_PERMISSIONS);\n }\n }\n });\n return false;\n }\n if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {\n requestPermissions(permissionsList.toArray(new String[permissionsList.size()]),\n REQUEST_CODE_ASK_MULTIPLE_PERMISSIONS);\n }\n return false;\n }\n return true;\n }", "public boolean checkPermission(Permission permission);", "private void checkUserAuthorities() {\n\t\tAuthority auth = authorityRepository.findTop1ByName(AuthorityType.ROLE_ADMIN);\n\t\tif (null == auth) {\n\t\t\tauth = Authority.createAdmin();\n\t\t\tauthorityRepository.save(auth);\n\t\t}\n\t\tAuthority authUser = authorityRepository.findTop1ByName(AuthorityType.ROLE_USER);\n\t\tif (null == authUser) {\n\t\t\tauthUser = Authority.createUser();\n\t\t\tauthorityRepository.save(authUser);\n\t\t}\n\t}", "private boolean checkPermissions() {\n int permissionState1 = ActivityCompat.checkSelfPermission(this,\n android.Manifest.permission.ACCESS_FINE_LOCATION);\n\n int permissionState2 = ActivityCompat.checkSelfPermission(this,\n Manifest.permission.ACCESS_COARSE_LOCATION);\n return permissionState1 == PackageManager.PERMISSION_GRANTED && permissionState2 == PackageManager.PERMISSION_GRANTED;\n }", "public boolean isSetAccession()\r\n {\r\n synchronized (monitor())\r\n {\r\n check_orphaned();\r\n return get_store().count_elements(ACCESSION$2) != 0;\r\n }\r\n }", "public static boolean hasAdministrativePermissions(@NotNull Session session, String... additionalAdminAuthorizableIdsOrPrincipalNames) throws RepositoryException {\n List<String> additionalAdminIdsOrPrincipalNames = Arrays.asList(Optional.ofNullable(additionalAdminAuthorizableIdsOrPrincipalNames).orElse(new String[0]));\n final JackrabbitSession jackrabbitSession;\n if (session instanceof JackrabbitSession) {\n jackrabbitSession = (JackrabbitSession) session;\n if (isOakVersionExposingBoundPrincipals(session.getRepository())) {\n if (hasAdministrativePermissionsWithPrincipals(jackrabbitSession, additionalAdminIdsOrPrincipalNames)) {\n return true;\n }\n }\n } else {\n jackrabbitSession = null;\n }\n // then evaluate user id\n String userId = session.getUserID();\n if (hasAdministrativePermissionsWithAuthorizableId(userId, additionalAdminIdsOrPrincipalNames)) {\n return true;\n }\n if (jackrabbitSession != null) {\n Authorizable authorizable = jackrabbitSession.getUserManager().getAuthorizable(userId);\n if (authorizable == null) {\n return false;\n }\n \n Iterator<Group> groupIterator = authorizable.memberOf();\n while (groupIterator.hasNext()) {\n String groupId = groupIterator.next().getID();\n if (hasAdministrativePermissionsWithAuthorizableId(groupId, additionalAdminIdsOrPrincipalNames)) {\n return true;\n }\n }\n } else {\n log.warn(\"could not evaluate group permissions but just user name\");\n }\n return false;\n }", "private void checkRights() {\n image.setEnabled(true);\n String user = fc.window.getUserName();\n \n for(IDataObject object : objects){\n ArrayList<IRights> rights = object.getRights();\n \n if(rights != null){\n boolean everybodyperm = false;\n \n for(IRights right : rights){\n String name = right.getName();\n \n //user found, therefore no other check necessary.\n if(name.equals(user)){\n if(!right.getOwner()){\n image.setEnabled(false);\n }else{\n image.setEnabled(true);\n }\n return;\n //if no user found, use everybody\n }else if(name.equals(BUNDLE.getString(\"Everybody\"))){\n everybodyperm = right.getOwner();\n }\n }\n image.setEnabled(everybodyperm);\n if(!everybodyperm){\n return;\n }\n }\n }\n }", "boolean hasSetAcl();", "public boolean checkPermission(PermissionCheckContext context) {\n PolarAccountInfo account = accountPrivilegeData.getAndCheckById(context.getAccountId());\n if (PolarAuthorizer.hasPermission(account, context.getPermission())) {\n return true;\n }\n\n return account.getRolePrivileges().getActiveRoleIds(context.getActiveRoles(), config.getMandatoryRoleIds())\n .stream()\n .map(accountPrivilegeData::getById)\n .filter(Objects::nonNull)\n .anyMatch(role -> PolarAuthorizer.hasPermission(role, context.getPermission()));\n }", "boolean hasQueryAuthorizations();", "private static boolean isPermissionGranted(Context context, String permission) {\n if (ContextCompat.checkSelfPermission(context, permission)\n == PackageManager.PERMISSION_GRANTED) {\n Log.i(TAG, permission + \" granted\");\n return true;\n }\n Log.i(TAG, permission + \" not granted yet\");\n return false;\n }", "@Test\n\tpublic void testIsPermitted_1()\n\t\tthrows Exception {\n\t\tSimpleAuthorizingAccount fixture = new SimpleAuthorizingAccount();\n\t\tfixture.setSimpleRoles(new HashSet());\n\t\tList<Permission> permissions = null;\n\n\t\tboolean[] result = fixture.isPermitted(permissions);\n\n\t\t// add additional test code here\n\t\tassertNotNull(result);\n\t}", "private boolean checkPermission() {\n if (Build.VERSION.SDK_INT >= 23 &&\n ContextCompat.checkSelfPermission(this,\n Manifest.permission.ACCESS_FINE_LOCATION) != PackageManager.PERMISSION_GRANTED) {\n // Permission is not granted\n return false;\n } else {\n return true;// Permission has already been granted }\n }\n }", "private boolean hasPermission(String username, SOAPMessage msg) {\r\n\t\ttry {\r\n\t\t\tNodeList email = msg.getSOAPBody().getElementsByTagName(SOAP_EMAIL_TAG);\r\n\r\n\t\t\t// if request has email\r\n\t\t\tif(email.getLength() > 0) {\r\n\t\t\t\treturn username.equals(msg.getSOAPBody().getElementsByTagName(SOAP_EMAIL_TAG).item(0).getTextContent());\r\n\t\t\t}\r\n\t\t\t// if there's no email field, every user has permissions to access\r\n\t\t\treturn true;\r\n\t\t\t\r\n\t\t} catch (SOAPException e) {\r\n\t\t\treturn false;\r\n\t\t}\r\n\t}", "public boolean isAccessGranted() {\n try {\n PackageManager packageManager = getPackageManager();\n ApplicationInfo applicationInfo = packageManager.getApplicationInfo(getPackageName(), 0);\n AppOpsManager appOpsManager = (AppOpsManager) getSystemService(Context.APP_OPS_SERVICE);\n int mode;\n assert appOpsManager != null;\n mode = appOpsManager.checkOpNoThrow(AppOpsManager.OPSTR_GET_USAGE_STATS,\n applicationInfo.uid, applicationInfo.packageName);\n return (mode == AppOpsManager.MODE_ALLOWED);\n\n } catch (PackageManager.NameNotFoundException e) {\n return false;\n }\n }", "@Override\n public boolean hasAccessPermission(String user, NamespaceKey key, DatasetConfig datasetConfig) {\n return userPredicate.test(user);\n }", "private boolean isPermissionAndRoleConfigExist(IdentityProvider identityProvider) {\n\n return identityProvider.getPermissionAndRoleConfig() != null\n && identityProvider.getPermissionAndRoleConfig().getRoleMappings() != null;\n }", "private void checkIfPermissionGranted() {\n\n //if user already allowed the permission, this condition will be true\n if (ContextCompat.checkSelfPermission(this, PERMISSION_CODE)\n == PackageManager.PERMISSION_GRANTED) {\n Intent launchIntent = getPackageManager().getLaunchIntentForPackage(\"com.example.a3\");\n if (launchIntent != null) {\n startActivity(launchIntent);//null pointer check in case package name was not found\n }\n }\n //if user didn't allow the permission yet, then ask for permission\n else {\n ActivityCompat.requestPermissions(this, new String[]{PERMISSION_CODE}, 0);\n }\n }", "private boolean mayRequestContacts() {\n if (checkSelfPermission(READ_CONTACTS) == PackageManager.PERMISSION_GRANTED) {\n return true;\n }\n if (shouldShowRequestPermissionRationale(READ_CONTACTS)) {\n // Requests permission to read contacts if it has not been granted yet\n Snackbar.make(mEmailView, R.string.permission_rationale, Snackbar.LENGTH_INDEFINITE)\n .setAction(android.R.string.ok, new View.OnClickListener() {\n @Override\n @TargetApi(Build.VERSION_CODES.M)\n public void onClick(View v) {\n requestPermissions(new String[]{READ_CONTACTS}, REQUEST_READ_CONTACTS);\n }\n });\n } else {\n requestPermissions(new String[]{READ_CONTACTS}, REQUEST_READ_CONTACTS);\n }\n return false;\n }", "public boolean validatePermissions()\r\n\t{\n\t\treturn true;\r\n\t}", "public boolean checkAccess(HasUuid object) {\n // Allow newly-instantiated objects\n if (!wasResolved(object)) {\n return true;\n }\n // Allow anything when there are no roles in use\n if (getRoles().isEmpty()) {\n return true;\n }\n Principal principal = getPrincipal();\n // Check for superusers\n if (!principalMapper.isAccessEnforced(principal, object)) {\n return true;\n }\n\n List<PropertyPath> paths = typeContext.getPrincipalPaths(object.getClass());\n PropertyPathChecker checker = checkers.get();\n for (PropertyPath path : paths) {\n path.evaluate(object, checker);\n if (checker.getResult()) {\n return true;\n }\n }\n addWarning(object, \"User %s does not have permission to edit this %s\", principal,\n typeContext.getPayloadName(object.getClass()));\n return false;\n }", "public boolean hasPermission(T object, Permission permission, User user);", "private static boolean hasPermission(String username, Permission requiredPermission) throws IOException, SQLException {\n ArrayList<Boolean> userPermissions = retrieveUserPermissionsFromDb(username);\n switch (requiredPermission) {\n case CreateBillboard:\n if (userPermissions.get(0)) return true;\n return false;\n case EditBillboard:\n if (userPermissions.get(1)) return true;\n return false;\n case ScheduleBillboard:\n if (userPermissions.get(2)) return true;\n return false;\n case EditUser:\n if (userPermissions.get(3)) return true;\n return false;\n default:\n return false; // Default to false if permission cannot be identified\n }\n }", "public void verifyAppPermissions() {\n boolean hasAll = true;\n mHasBluetoothPermissions = ActivityCompat.checkSelfPermission(this, Manifest.permission.BLUETOOTH) == PackageManager.PERMISSION_GRANTED;\n mHasBluetoothAdminPermissions = ActivityCompat.checkSelfPermission(this, Manifest.permission.BLUETOOTH_ADMIN) == PackageManager.PERMISSION_GRANTED;\n hasAll &= ActivityCompat.checkSelfPermission(this, Manifest.permission.ACCESS_FINE_LOCATION) == PackageManager.PERMISSION_GRANTED;\n hasAll &= ActivityCompat.checkSelfPermission(this, Manifest.permission.ACCESS_COARSE_LOCATION) == PackageManager.PERMISSION_GRANTED;\n\n if (!hasAll) {\n // We don't have permission so prompt the user\n ActivityCompat.requestPermissions(\n this,\n APP_PERMISSIONS,\n REQUEST_PERMISSIONS\n );\n }\n }", "private boolean checkPermission() {\n\n if ((ContextCompat.checkSelfPermission(this, Manifest.permission.CAMERA)\n != PackageManager.PERMISSION_GRANTED) &&\n (ContextCompat.checkSelfPermission(this, Manifest.permission.WRITE_EXTERNAL_STORAGE)\n != PackageManager.PERMISSION_GRANTED) &&\n (ContextCompat.checkSelfPermission(this, Manifest.permission.READ_EXTERNAL_STORAGE)\n != PackageManager.PERMISSION_GRANTED) &&\n (ContextCompat.checkSelfPermission(this,\n Manifest.permission.RECORD_AUDIO) != PackageManager.PERMISSION_GRANTED)\n\n ) {\n\n // Permission is not granted\n return false;\n\n }\n return true;\n }", "@Override\n public boolean hasPermission(GenericValue entity, String argument, User user, boolean issueCreation)\n {\n\n if (user != null && entity != null)\n {\n if (\"Issue\".equals(entity.getEntityName()))\n {\n return hasIssuePermission(user, issueCreation, entity, argument);\n }\n else if (\"Project\".equals(entity.getEntityName()))\n {\n return hasProjectPermission(user, issueCreation, entity);\n }\n }\n return false;\n }", "@Override\n public boolean hasPermission(Permission permission) {\n // FacesContext context = FacesContext.getCurrentInstance();\n String imp = (String)ADFContext.getCurrent().getSessionScope().get(\"isImpersonationOn\");\n// String imp = (String)context.getExternalContext().getSessionMap().get(\"isImpersonationOn\");\n if(imp == null || !imp.equals(\"Y\")){\n return super.hasPermission(permission);\n }\n else{\n return true;\n \n }\n \n }", "private boolean hasPermission(String permission) {\n if (canMakeSmores()) {\n if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {\n return (checkSelfPermission(permission) == PackageManager.PERMISSION_GRANTED);\n }\n }\n return true;\n }", "private boolean checkAndRequestPermissions() {\n\n List<String> listPermissionsNeeded = new ArrayList<>();\n /*if (camera != PackageManager.PERMISSION_GRANTED) {\n listPermissionsNeeded.add(android.Manifest.permission.CAMERA);\n }\n\n if (wstorage != PackageManager.PERMISSION_GRANTED) {\n listPermissionsNeeded.add(android.Manifest.permission.WRITE_EXTERNAL_STORAGE);\n }\n\n if (rstorage != PackageManager.PERMISSION_GRANTED) {\n listPermissionsNeeded.add(Manifest.permission.READ_EXTERNAL_STORAGE);\n }\n if (rphoneState != PackageManager.PERMISSION_GRANTED)\n {\n listPermissionsNeeded.add(Manifest.permission.READ_PHONE_STATE);\n }*/\n\n// if(cLocation != PackageManager.PERMISSION_GRANTED){\n// listPermissionsNeeded.add(Manifest.permission.ACCESS_COARSE_LOCATION);\n// }\n//\n// if(fLocation != PackageManager.PERMISSION_GRANTED){\n// listPermissionsNeeded.add(Manifest.permission.ACCESS_FINE_LOCATION);\n// }\n\n if (!listPermissionsNeeded.isEmpty()) {\n ActivityCompat.requestPermissions(this, listPermissionsNeeded.toArray\n (new String[listPermissionsNeeded.size()]), REQUEST_ID_MULTIPLE_PERMISSIONS);\n return false;\n }\n success();\n return true;\n }", "@Test\n public void testCheckExistsPermission() throws Exception\n {\n permission = permissionManager.getPermissionInstance(\"OPEN_OFFICE\");\n permissionManager.addPermission(permission);\n assertTrue(permissionManager.checkExists(permission));\n Permission permission2 = permissionManager.getPermissionInstance(\"CLOSE_OFFICE\");\n assertFalse(permissionManager.checkExists(permission2));\n }", "public boolean isPermissionGranted(String permission){\n return true;\n// else\n// return false;\n }", "private static Boolean isAuthorised(Page page, List<GrantedAuthority> userAuthorities ) {\n if ( page.getAllowedRoles().size() == 0 ) {\n return true;\n }\n \n for ( GrantedAuthority role : userAuthorities ) {\n for ( String requiredRole : page.getAllowedRoles() ) {\n if ( role.getAuthority().equals(requiredRole) ) {\n return true;\n }\n }\n }\n return false;\n }", "private void checkPermissions() {\n final ArrayList<String> missedPermissions = new ArrayList<>();\n\n for (final String permission : PERMISSIONS_REQUIRED) {\n if (ActivityCompat.checkSelfPermission(this, permission) != PackageManager.PERMISSION_GRANTED) {\n missedPermissions.add(permission);\n }\n }\n\n if (!missedPermissions.isEmpty()) {\n final String[] permissions = new String[missedPermissions.size()];\n missedPermissions.toArray(permissions);\n\n ActivityCompat.requestPermissions(this, permissions, PERMISSION_REQUEST_CODE);\n }\n }", "private boolean checkPermissions() {\n int permissionState = ActivityCompat.checkSelfPermission(Objects.requireNonNull(getActivity()),\n Manifest.permission.ACCESS_COARSE_LOCATION);\n return permissionState == PackageManager.PERMISSION_GRANTED;\n }", "boolean anyGranted(String roles);", "public boolean hasPermission(String permission)\n throws Exception\n {\n Permission permissionObject = null;\n try\n {\n permissionObject = securityService.getPermissionManager().getPermissionByName(permission);\n }\n catch (UnknownEntityException e)\n {\n if(initialize)\n {\n permissionObject = securityService.getPermissionManager().getPermissionInstance(permission);\n securityService.getPermissionManager().addPermission(permissionObject);\n\n Role role = null;\n TurbineAccessControlList<?> acl = data.getACL();\n RoleSet roles = acl.getRoles();\n if(roles.size() > 0)\n {\n\t\t\t\t\trole = roles.toArray(new Role[0])[0];\n\t\t\t\t}\n\n if(role == null)\n {\n /*\n * The User within data has no roles yet, let us grant the permission\n * to the first role available through SecurityService.\n */\n roles = securityService.getRoleManager().getAllRoles();\n if(roles.size() > 0)\n {\n\t\t\t\t\t\trole = roles.toArray(new Role[0])[0];\n\t\t\t\t\t}\n }\n\n if(role != null)\n {\n /*\n * If we have no role, there is nothing we can do about it. So only grant it,\n * if we have a role to grant it to.\n */\n TurbineModelManager modelManager = (TurbineModelManager)securityService.getModelManager();\n modelManager.grant(role, permissionObject);\n }\n }\n else\n {\n throw(e);\n }\n }\n\n return hasPermission(permissionObject);\n }", "@Test\n\tpublic void testIsPermittedAll_1()\n\t\tthrows Exception {\n\t\tSimpleAuthorizingAccount fixture = new SimpleAuthorizingAccount();\n\t\tfixture.setSimpleRoles(new HashSet());\n\t\tCollection<Permission> permissions = new Vector();\n\n\t\tboolean result = fixture.isPermittedAll(permissions);\n\n\t\t// add additional test code here\n\t\tassertTrue(result);\n\t}", "@Test\n\tpublic void testIsPermittedAll_2()\n\t\tthrows Exception {\n\t\tSimpleAuthorizingAccount fixture = new SimpleAuthorizingAccount();\n\t\tfixture.setSimpleRoles(new HashSet());\n\t\tCollection<Permission> permissions = new Vector();\n\n\t\tboolean result = fixture.isPermittedAll(permissions);\n\n\t\t// add additional test code here\n\t\tassertTrue(result);\n\t}", "public boolean checkPermission() {\n int cameraPermissionResult = ContextCompat.checkSelfPermission(getApplicationContext(), Manifest.permission.CAMERA);\n int readContactPermissionResult = ContextCompat.checkSelfPermission(getApplicationContext(), Manifest.permission.READ_CONTACTS);\n return cameraPermissionResult == PackageManager.PERMISSION_GRANTED && readContactPermissionResult == PackageManager.PERMISSION_GRANTED;\n }", "public boolean checkIfUserHasPermission(long userId, Permission permission) {\n final Optional<User> user = userRepository.findById(userId);\n\n return user.isPresent()\n && permission != null\n && user.get().getRole().getPermissions().contains(permission);\n\n }", "private boolean checkPermission() {\n Log.d(TAG, \"checkPermission()\");\n // Ask for permission if it wasn't granted yet\n return (ContextCompat.checkSelfPermission(this, Manifest.permission.ACCESS_FINE_LOCATION)\n == PackageManager.PERMISSION_GRANTED);\n }", "public static void assertCanAdministrateOrg(Person user, String organizationUuid) {\n logger.debug(\"Asserting canAdministrateOrg status for {} in {}\", user, organizationUuid);\n if (canAdministrateOrg(user, organizationUuid)) {\n return;\n }\n throw new WebApplicationException(UNAUTH_MESSAGE, Status.FORBIDDEN);\n }", "@Test\n\tpublic void testIsPermitted_2()\n\t\tthrows Exception {\n\t\tSimpleAuthorizingAccount fixture = new SimpleAuthorizingAccount();\n\t\tfixture.setSimpleRoles(new HashSet());\n\t\tList<Permission> permissions = new Vector();\n\n\t\tboolean[] result = fixture.isPermitted(permissions);\n\n\t\t// add additional test code here\n\t\tassertNotNull(result);\n\t}", "public boolean hasPermissions(Player player) {\n\t\tif (!m_bHasPermissions && player.isOp())\n\t\t\treturn true;\n\t\telse if (m_bHasPermissions && m_PermissionHandler.has(player, \"lord.orbitalstrike\"))\n\t\t\treturn true;\n\t\telse {\n\t\t\tOrbitalStrike.sendMessage(player, \"You do not have permission to use this plugin.\");\n\t\t\tOrbitalStrike.logInfo(\"Player \" + player + \" does not have permission.\", 1);\n\t\t\treturn false;\n\t\t}\n\t}", "public boolean hasPermission(String username, ActionContext ctx) {\r\n return username != null;\r\n }", "private boolean checkPermissions() {\n boolean hasPermission = true;\n\n int result = ContextCompat.checkSelfPermission(\n this,\n Manifest.permission.ACCESS_FINE_LOCATION\n );\n if (result == PERMISSION_DENIED) {\n hasPermission = false;\n }\n\n // ACCESS_BACKGROUND_LOCATION is only required on API 29 and higher\n if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.Q) {\n result = ContextCompat.checkSelfPermission(\n this,\n Manifest.permission.ACCESS_BACKGROUND_LOCATION\n );\n if (result == PERMISSION_DENIED) {\n hasPermission = false;\n }\n }\n\n return hasPermission;\n }", "private boolean checkPermission() {\n Log.d(\"TAG\", \"checkPermission()\");\n // Ask for permission if it wasn't granted yet\n return (ContextCompat.checkSelfPermission(this, Manifest.permission.ACCESS_FINE_LOCATION) == PackageManager.PERMISSION_GRANTED );\n }", "public boolean checkAccountPermission() {\n return EasyPermissions.hasPermissions(context, Manifest.permission.GET_ACCOUNTS);\n }", "public boolean hasPermission(TwitchAccount account, String permissionKey) {\n\n // Team has global access\n User user = ServiceRegistry.get(DataService.class).get(UserRepository.class).getByTwitchId(account.getTwitchId());\n if (user != null && user.getRank().equals(UserRank.TEAM)) {\n return true;\n }\n\n for (Permissions perm : getPermissions()) {\n if (perm.hasPermission(account, permissionKey)) {\n return true;\n }\n }\n\n return false;\n }", "private boolean checkDeviceSettings()\n {\n List<String> listPermissionNeeded= new ArrayList<>();\n boolean ret = true;\n for(String perm : permission)\n {\n if(ContextCompat.checkSelfPermission(this,perm)!= PackageManager.PERMISSION_GRANTED)\n listPermissionNeeded.add(perm);\n }\n if(!listPermissionNeeded.isEmpty())\n {\n ActivityCompat.requestPermissions(this,listPermissionNeeded.toArray(new String[listPermissionNeeded.size()]),REQUEST_PERMISSION);\n ret = false;\n }\n\n return ret;\n }", "public Boolean isPermissions() {\n return (Boolean) get(\"permissions\");\n }", "public boolean hasPermission ( String name ) {\n\t\treturn extract ( handle -> handle.hasPermission ( name ) );\n\t}", "public boolean accesspermission()\n {\n AppOpsManager appOps = (AppOpsManager) context.getSystemService(Context.APP_OPS_SERVICE);\n int mode = 0;\n if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) {\n mode = appOps.checkOpNoThrow(AppOpsManager.OPSTR_GET_USAGE_STATS,\n Process.myUid(),context.getPackageName());\n }\n if (mode == AppOpsManager.MODE_ALLOWED) {\n\n return true;\n }\n return false;\n\n }", "public boolean isPermissionSet(GitLabPermissionIdentity identity, Permission permission) {\n return folderACL.isPermissionSet(identity, permission);\n }", "public static boolean hasPermissions(Context context, String... permissions) {\n for (String permission : permissions) {\n if (PermissionChecker.checkSelfPermission(context, permission) != PackageManager.PERMISSION_GRANTED) {\n return false;\n }\n }\n return true;\n }", "public boolean checkPermission(final DataBucketBean bucket, final String permission) {\r\n\t\t\treturn _security_service.isUserPermitted(principalName, bucket, Optional.of(permission));\r\n\t\t}", "public boolean checkForPermission() {\r\n int permissionCAMERA = ContextCompat.checkSelfPermission(this, Manifest.permission.CAMERA);\r\n int storagePermission = ContextCompat.checkSelfPermission(this, Manifest.permission.READ_EXTERNAL_STORAGE);\r\n int accessCoarseLocation = ContextCompat.checkSelfPermission(this, Manifest.permission.ACCESS_COARSE_LOCATION);\r\n int accessFineLocation = ContextCompat.checkSelfPermission(this, Manifest.permission.ACCESS_FINE_LOCATION);\r\n\r\n List<String> listPermissionsNeeded = new ArrayList<>();\r\n if (storagePermission != PackageManager.PERMISSION_GRANTED) {\r\n listPermissionsNeeded.add(Manifest.permission.READ_EXTERNAL_STORAGE);\r\n }\r\n if (permissionCAMERA != PackageManager.PERMISSION_GRANTED) {\r\n listPermissionsNeeded.add(Manifest.permission.CAMERA);\r\n }\r\n if (accessCoarseLocation != PackageManager.PERMISSION_GRANTED) {\r\n listPermissionsNeeded.add(Manifest.permission.ACCESS_COARSE_LOCATION);\r\n }\r\n if (accessFineLocation != PackageManager.PERMISSION_GRANTED) {\r\n listPermissionsNeeded.add(Manifest.permission.ACCESS_FINE_LOCATION);\r\n }\r\n if (!listPermissionsNeeded.isEmpty()) {\r\n ActivityCompat.requestPermissions(this,\r\n listPermissionsNeeded.toArray(new String[listPermissionsNeeded.size()]), MY_PERMISSIONS_REQUEST);\r\n return false;\r\n }\r\n\r\n return true;\r\n }", "HasValue<Boolean> getIsOrgUser();", "private boolean validateAccess(String permission) {\n\t\tif (\"READ\".equalsIgnoreCase(permission)) {\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t}", "public boolean hasAdminAccess(User user){\n return (user.hasOneOf(RoleValue.COMPANY_ADMIN, RoleValue.APP_ADMIN) && hasAccess(user));\n }", "public void permission_check() {\n //Usage Permission\n if (!isAccessGranted()) {\n new LovelyStandardDialog(MainActivity.this)\n .setTopColorRes(R.color.colorPrimaryDark)\n .setIcon(R.drawable.ic_perm_device_information_white_48dp)\n .setTitle(getString(R.string.permission_check_title))\n .setMessage(getString(R.string.permission_check_message))\n .setPositiveButton(android.R.string.ok, new View.OnClickListener() {\n @Override\n public void onClick(View v) {\n Intent intent = new Intent(android.provider.Settings.ACTION_USAGE_ACCESS_SETTINGS);\n startActivity(intent);\n }\n })\n .setNegativeButton(android.R.string.no, null)\n .show();\n }\n }", "private boolean checkAndRequestPermissions() {\n int locationPermission = ContextCompat.checkSelfPermission(this, Manifest.permission.ACCESS_FINE_LOCATION);\n List<String> listPermissionsNeeded = new ArrayList<>();\n if (locationPermission != PackageManager.PERMISSION_GRANTED) {\n listPermissionsNeeded.add(Manifest.permission.ACCESS_FINE_LOCATION);\n }\n// if (permissionSendMessage != PackageManager.PERMISSION_GRANTED) {\n// listPermissionsNeeded.add(Manifest.permission.SEND_SMS);\n// }\n if (!listPermissionsNeeded.isEmpty()) {\n ActivityCompat.requestPermissions(this, listPermissionsNeeded.toArray(new String[listPermissionsNeeded.size()]), REQUEST_ID_MULTIPLE_PERMISSIONS);\n return false;\n }\n return true;\n }", "public static boolean canAccess (HttpServletRequest req, AccessRights requiredRights) {\n\t\tif (requiredRights.equals(AccessRights.PUBLIC)) {\n\t\t\treturn true;\n\t\t}\n\n\t\tif (req.getSession().getAttribute(SESS_IS_EMPLOYEE) != null) {\n\t\t\tif (requiredRights.equals(AccessRights.AUTHENTICATED) || requiredRights.equals(AccessRights.EMPLOYEE)) {\n\t\t\t\treturn true;\n\t\t\t}\n\n\t\t\treturn req.getSession().getAttribute(SESS_IS_ADMIN) != null && (boolean) req.getSession().getAttribute(SESS_IS_ADMIN);\n\t\t}\n\n\t\treturn false;\n\t}", "public boolean checkPermission(Authentication auth, Integer ctId, String... authority) throws NoSuchPageException {\n List<AuthorityDTO> lstAuthority = authorityMapper.getContestAuthority(ctId, auth.getName());\n for(AuthorityDTO curAuth : lstAuthority){\n for(String requireAuth : authority){\n if (requireAuth.equals(curAuth.getName())){\n return true;\n }\n }\n }\n return false;\n }", "public boolean hasPermission(String username, MenuComponent menuComponent) {\r\n return username != null;\r\n }", "@RequiresApi(api = Build.VERSION_CODES.M)\n private boolean arePermissionsEnabled(){\n for(String permission : mPermissions){\n if(checkSelfPermission(permission) != PackageManager.PERMISSION_GRANTED)\n return false;\n }\n return true;\n }", "boolean hasRole();", "@Test\n\tpublic void testIsPermitted_3()\n\t\tthrows Exception {\n\t\tSimpleAuthorizingAccount fixture = new SimpleAuthorizingAccount();\n\t\tfixture.setSimpleRoles(new HashSet());\n\t\tList<Permission> permissions = new Vector();\n\n\t\tboolean[] result = fixture.isPermitted(permissions);\n\n\t\t// add additional test code here\n\t\tassertNotNull(result);\n\t}", "@Test\n\tpublic void testCheckPermission_1()\n\t\tthrows Exception {\n\t\tSimpleAuthorizingAccount fixture = new SimpleAuthorizingAccount();\n\t\tfixture.setSimpleRoles(new HashSet());\n\t\tPermission permission = new AllPermission();\n\n\t\tfixture.checkPermission(permission);\n\n\t\t// add additional test code here\n\t}", "default Optional<Boolean> doesCalendarAccessAuthorized() {\n return Optional.ofNullable(toSafeBoolean(getCapability(CALENDAR_ACCESS_AUTHORIZED_OPTION)));\n }", "public boolean checkPermissions() {\n if (ContextCompat.checkSelfPermission(this,\n Manifest.permission.ACCESS_FINE_LOCATION)\n != PackageManager.PERMISSION_GRANTED) {\n\n // Should we show an explanation?\n if (ActivityCompat.shouldShowRequestPermissionRationale(this,\n Manifest.permission.ACCESS_FINE_LOCATION)) {\n\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 new AlertDialog.Builder(this)\n .setTitle(\"TITLE\")\n .setMessage(\"TEXT\")\n .setPositiveButton(\"OKAY\", new DialogInterface.OnClickListener() {\n @Override\n public void onClick(DialogInterface dialogInterface, int i) {\n //Prompt the user once explanation has been shown\n ActivityCompat.requestPermissions(MapsActivity.this,\n new String[]{\n Manifest.permission.ACCESS_FINE_LOCATION},\n PERMISSION_REQ_LOC);\n }\n })\n .create()\n .show();\n\n\n } else {\n // No explanation needed, we can request the permission.\n ActivityCompat.requestPermissions(this,\n new String[]{\n Manifest.permission.ACCESS_FINE_LOCATION},\n PERMISSION_REQ_LOC);\n }\n return false;\n } else {\n return true;\n }\n }", "@Test\n\tpublic void testIsPermittedAll_3()\n\t\tthrows Exception {\n\t\tSimpleAuthorizingAccount fixture = new SimpleAuthorizingAccount();\n\t\tfixture.setSimpleRoles(new HashSet());\n\t\tCollection<Permission> permissions = new Vector();\n\n\t\tboolean result = fixture.isPermittedAll(permissions);\n\n\t\t// add additional test code here\n\t\tassertTrue(result);\n\t}", "public void checkPermission() {\n Log.e(\"checkPermission\", \"checkPermission\");\n\n // Here, thisActivity is the current activity\n if (ContextCompat.checkSelfPermission(RegisterActivity.this,\n Manifest.permission.ACCESS_FINE_LOCATION)\n != PackageManager.PERMISSION_GRANTED) {\n\n // Should we show an explanation?\n if (ActivityCompat.shouldShowRequestPermissionRationale(RegisterActivity.this,\n Manifest.permission.ACCESS_FINE_LOCATION)) {\n ActivityCompat.requestPermissions(RegisterActivity.this,\n new String[]{Manifest.permission.ACCESS_FINE_LOCATION},\n MY_PERMISSIONS_REQUEST_READ_CONTACTS);\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\n } else {\n\n // No explanation needed, we can request the permission.\n\n ActivityCompat.requestPermissions(RegisterActivity.this,\n new String[]{Manifest.permission.ACCESS_FINE_LOCATION},\n MY_PERMISSIONS_REQUEST_READ_CONTACTS);\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 }\n\n\n }", "public boolean hasPermission(CommandSender sender) {\n return this.reason == Reason.PROPERTY_NOT_FOUND ||\n this.property.hasPermission(sender, this.name);\n }", "private boolean checkPermissions() {\n int permissionState = ActivityCompat.checkSelfPermission(this,\n Manifest.permission.ACCESS_COARSE_LOCATION);\n return permissionState == PackageManager.PERMISSION_GRANTED;\n }", "@Test\n\tpublic void testCheckPermissions_3()\n\t\tthrows Exception {\n\t\tSimpleAuthorizingAccount fixture = new SimpleAuthorizingAccount();\n\t\tfixture.setSimpleRoles(new HashSet());\n\t\tCollection<Permission> permissions = null;\n\n\t\tfixture.checkPermissions(permissions);\n\n\t\t// add additional test code here\n\t}", "private boolean doesSessionUserHaveDataSetPermission(DataverseRequest req, Dataset dataset, Permission permissionToCheck) {\n if (permissionToCheck == null) {\n return false;\n }\n\n // Has this check already been done? \n // \n if (datasetPermissionMap.containsKey(permissionToCheck)) {\n // Yes, return previous answer\n return datasetPermissionMap.get(permissionToCheck);\n }\n\n // Check the permission\n boolean hasPermission = permissionService.requestOn(req, dataset).has(permissionToCheck);\n\n // Save the permission\n datasetPermissionMap.put(permissionToCheck, hasPermission);\n\n // return true/false\n return hasPermission;\n }", "public boolean CheckingPermissionIsEnabledOrNot() {\n int FirstPermissionResult = ContextCompat.checkSelfPermission(getApplicationContext(), INTERNET);\n int SecondPermissionResult = ContextCompat.checkSelfPermission(getApplicationContext(), ACCESS_NETWORK_STATE);\n int ThirdPermissionResult = ContextCompat.checkSelfPermission(getApplicationContext(), WRITE_EXTERNAL_STORAGE);\n int ForthPermissionResult = ContextCompat.checkSelfPermission(getApplicationContext(), READ_EXTERNAL_STORAGE);\n int FifthPermissionResult = ContextCompat.checkSelfPermission(getApplicationContext(), ACCESS_COARSE_LOCATION);\n int SixthPermissionResult = ContextCompat.checkSelfPermission(getApplicationContext(), ACCESS_FINE_LOCATION);\n int SeventhPermissionResult = ContextCompat.checkSelfPermission(getApplicationContext(), VIBRATE);\n// int EighthPermissionResult = ContextCompat.checkSelfPermission(getApplicationContext(), CALL_PHONE);\n// int NinethPermissionResult = ContextCompat.checkSelfPermission(getApplicationContext(), SEND_SMS);\n\n return FirstPermissionResult == PackageManager.PERMISSION_GRANTED &&\n SecondPermissionResult == PackageManager.PERMISSION_GRANTED &&\n ThirdPermissionResult == PackageManager.PERMISSION_GRANTED &&\n ForthPermissionResult == PackageManager.PERMISSION_GRANTED &&\n FifthPermissionResult == PackageManager.PERMISSION_GRANTED &&\n SixthPermissionResult == PackageManager.PERMISSION_GRANTED &&\n SeventhPermissionResult == PackageManager.PERMISSION_GRANTED;\n// EighthPermissionResult == PackageManager.PERMISSION_GRANTED &&\n// NinethPermissionResult == PackageManager.PERMISSION_GRANTED;\n }", "public boolean hasPermission(Permission permission)\n throws Exception\n {\n boolean value = false;\n TurbineAccessControlList<?> acl = data.getACL();\n if (acl == null ||\n !acl.hasPermission(permission))\n {\n data.setScreen(failScreen);\n data.setMessage(message);\n }\n else\n {\n value = true;\n }\n return value;\n }", "private boolean checkPermissionFromDevice(int permissions) {\n\n switch (permissions) {\n case RECORD_AUDIO_PERMISSION_CODE: {\n // int variables will be 0 if permissions are not granted already\n int write_external_storage_result =\n ContextCompat.checkSelfPermission(this, Manifest.permission.WRITE_EXTERNAL_STORAGE);\n int record_audio_result =\n ContextCompat.checkSelfPermission(this, Manifest.permission.RECORD_AUDIO);\n\n // returns true if both permissions are already granted\n return write_external_storage_result == PackageManager.PERMISSION_GRANTED &&\n record_audio_result == PackageManager.PERMISSION_GRANTED;\n }\n default:\n return false;\n }\n }", "private boolean checkIfHasRequiredFields(BoxItem shareItem){\n return shareItem.getSharedLink() != null && shareItem.getAllowedSharedLinkAccessLevels() != null;\n }", "public boolean isPermisoAgendaPersonal() {\n for(Rolpermiso rp : LoginController.getUsuarioLogged().getRol1().getRolpermisoList()){\n if(rp.getPermiso().getDescripcion().equals(\"AAgenda\")){\n return true;\n }\n }\n return false;\n }" ]
[ "0.68809897", "0.628632", "0.6281366", "0.62557447", "0.6079818", "0.6066579", "0.6043727", "0.59480834", "0.5938893", "0.593797", "0.58753794", "0.58457625", "0.58167434", "0.5801026", "0.57775915", "0.5742852", "0.57411677", "0.5736852", "0.57189405", "0.57186043", "0.57031465", "0.5691556", "0.56913465", "0.5678242", "0.5668142", "0.5664073", "0.5648768", "0.56486213", "0.56461066", "0.5641937", "0.56277907", "0.56262004", "0.56257945", "0.55998534", "0.55864316", "0.55710274", "0.55485713", "0.5547255", "0.55341464", "0.55341303", "0.5517279", "0.5500602", "0.5492021", "0.5488078", "0.5485251", "0.5470886", "0.544881", "0.54485166", "0.5448037", "0.54477584", "0.5440104", "0.54357874", "0.54284674", "0.5418458", "0.5414324", "0.5407866", "0.54073524", "0.53948957", "0.5392045", "0.53882474", "0.53856075", "0.5383851", "0.5380639", "0.5369979", "0.5365091", "0.53631", "0.5362737", "0.5350689", "0.5346748", "0.5345099", "0.5335003", "0.53319955", "0.5331297", "0.5324787", "0.53226066", "0.53207546", "0.5318761", "0.5316714", "0.5316088", "0.53130996", "0.5312214", "0.5301104", "0.5301101", "0.53009665", "0.5299764", "0.52982897", "0.5297549", "0.5297113", "0.5294251", "0.5287282", "0.52836055", "0.52672386", "0.5260576", "0.5258848", "0.5254589", "0.5253737", "0.52521527", "0.5251432", "0.52468145", "0.52457947", "0.5243904" ]
0.0
-1
Make it false in Prod
private Logger(){ }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\n\tpublic boolean paie() {\n\t\treturn false;\n\t}", "protected boolean func_70814_o() { return true; }", "public boolean method_2453() {\r\n return false;\r\n }", "public boolean method_4088() {\n return false;\n }", "public boolean method_2434() {\r\n return false;\r\n }", "public boolean isSoft();", "@Override\n public boolean isSoft() {\n return true;\n }", "public boolean mo64135b() {\n return false;\n }", "public boolean mo55998a() {\n return false;\n }", "public boolean method_4093() {\n return false;\n }", "protected boolean func_70041_e_() { return false; }", "public boolean method_4102() {\n return false;\n }", "public boolean method_218() {\r\n return false;\r\n }", "public boolean mo56165b() {\n return false;\n }", "public boolean mo6546a() {\n return false;\n }", "public boolean mo100108c() {\n return false;\n }", "public boolean mo8810b() {\n return false;\n }", "public boolean mo72a() {\n return false;\n }", "public final boolean aox() {\n return false;\n }", "@Override\n\tpublic boolean canBeFalsey() {\n\t\treturn false;\n\t}", "public boolean mo7339w() {\n return false;\n }", "public boolean mo7081t() {\n return false;\n }", "public boolean method_4132() {\n return false;\n }", "protected String getFalse() {\n return \"false\";\n }", "@Override\n\tpublic boolean test() {\n\t\treturn false;\n\t}", "public boolean method_210() {\r\n return false;\r\n }", "public final boolean mo18967c() {\n return false;\n }", "public boolean mo2469c() {\n return false;\n }", "public boolean mo1490a() {\n return false;\n }", "public boolean whiteCheckmate() {\n\t\treturn false;\n\t}", "public boolean mo7079r() {\n return false;\n }", "public final boolean mo18969d() {\n return false;\n }", "public void check_always_false_condition(boolean on){\r\n this.e_always_false_condition = on;\r\n }", "public boolean mo2467a() {\n return false;\n }", "public boolean simulateProductionLatencies() {\n return false;\n }", "public boolean method_214() {\r\n return false;\r\n }", "protected boolean isFreeStyle(){\r\n\t\treturn false;\r\n\t}", "public boolean mo9210d() {\n return false;\n }", "private boolean Verific() {\n\r\n\treturn true;\r\n\t}", "public boolean method_216() {\r\n return false;\r\n }", "public boolean method_3897() {\r\n return false;\r\n }", "protected boolean asEaten() {\n return false;\n }", "public boolean mo7084v() {\n return false;\n }", "public boolean isDontCare(){\n return hasDontCare;\n }", "public final boolean zze() {\n return false;\n }", "@Test\n\tpublic void testBooleanFalse() throws Exception {\n\t\tprepareTest(Arrays.asList(\"/tests/basic/data01endpoint1.ttl\", \"/tests/basic/data01endpoint2.ttl\"));\n\t\texecute(\"/tests/basic/query04.rq\", \"/tests/basic/query04.srx\", false);\n\t}", "@Override\r\n\tpublic boolean isConcave() {\n\t\treturn false;\r\n\t}", "public void genRepCheck(){\r\n if (tx_cb.getValue() == null || paModules.getValue() == null || mainExciterSW.getValue() == null\r\n || filter.getValue() == null || switchPatch.getValue() == null || testLoad.getValue() == null\r\n || mainAntFeed.getValue() == null)\r\n genRep.setDisable(true);\r\n else\r\n genRep.setDisable(false);\r\n }", "@Override\r\n\tpublic boolean seLanceSurServiteurProprietaire() {\n\t\treturn false;\r\n\t}", "boolean isSetIsManaged();", "@Ignore\n @Test\n @Override\n public void testBoolean(TestContext ctx) {\n super.testBoolean(ctx);\n }", "@Override\n public boolean isProgrammable() {\n return false;\n }", "public boolean method_208() {\r\n return false;\r\n }", "public boolean isOn() {\n\t\treturn false;\n\t}", "@Override\n\tpublic boolean paie() {\n\n\t\treturn true;\n\t}", "boolean shouldRescore() {\n return false;\n }", "public boolean isNotNullProduction() {\n return genClient.cacheValueIsNotNull(CacheKey.production);\n }", "protected boolean mo11180a() {\n return true;\n }", "@Override\n\tpublic boolean vender(String placa) {\n\t\treturn false;\n\t}", "public default boolean canBePermanent(){ return false; }", "private CheckBoolean() {\n\t}", "public final boolean aow() {\n return false;\n }", "@Override\n\tpublic boolean status() {\n\t\treturn false;\n\t}", "@Override\n\tpublic boolean status() {\n\t\treturn false;\n\t}", "public boolean mo4689g() {\n return !this.f1123i.isEnabled();\n }", "public boolean mo1517e() {\n return false;\n }", "boolean internal();", "public boolean method_108() {\r\n return false;\r\n }", "default boolean isSpecial() { return false; }", "public abstract Boolean isImportant();", "public boolean mo7083u() {\n return false;\n }", "boolean hasAutomatic();", "public static void normalDebug(){\n enableVerbos = false;\n }", "public boolean method_198() {\r\n return false;\r\n }", "Boolean getIndemnity();", "public boolean mo9240ax() {\n return false;\n }", "@Override\n void generateFalseData() {\n \n }", "public Boolean() {\n\t\tsuper(false);\n\t}", "public final boolean mo18965b() {\n return false;\n }", "public boolean method_196() {\r\n return false;\r\n }", "public boolean isRepairMode() {\n return false;\n }", "boolean test() {\n return false; // REPLACE WITH SOLUTION\n }", "protected synchronized boolean getBooleanValue(String tag) {\n boolean returnFlag = false;\n if (actualProperties != null) {\n String stringFlag = actualProperties.getProperty(tag, QVCSConstants.QVCS_NO);\n if (stringFlag.compareToIgnoreCase(QVCSConstants.QVCS_YES) == 0) {\n returnFlag = true;\n }\n }\n return returnFlag;\n }", "public boolean isRequiresTaxCertificate() \n{\nObject oo = get_Value(COLUMNNAME_RequiresTaxCertificate);\nif (oo != null) \n{\n if (oo instanceof Boolean) return ((Boolean)oo).booleanValue();\n return \"Y\".equals(oo);\n}\nreturn false;\n}", "public final boolean zzc() {\n return false;\n }", "public boolean whiteCheck() {\n\t\treturn false;\n\t}", "public boolean aUnPrix() {\n return false;\n }", "boolean isSetSystem();", "@Override\n public boolean d() {\n return false;\n }", "public default boolean hasAltFire(){ return false; }", "public boolean mo9236at() {\n return false;\n }", "public boolean isUforeberegning() {\n\t\treturn false;\n\t}", "public boolean mo7078q() {\n return false;\n }", "@Override\n\tpublic boolean livre() {\n\t\treturn true;\n\t}", "public final boolean mo18963a() {\n return false;\n }", "@Override\r\n\tpublic boolean isEnabled() {\n\t\treturn false;\r\n\t}", "@Override\r\n\tpublic boolean isEnabled() {\n\t\treturn false;\r\n\t}", "@Override\n\tpublic void updateFalse(MetodoPagamento object) {\n\t\t\n\t}", "public void setForua(boolean newValue);", "public boolean b()\r\n {\r\n return false;\r\n }", "public boolean method_1456() {\r\n return true;\r\n }" ]
[ "0.7144241", "0.70949197", "0.6896427", "0.68289757", "0.6815012", "0.675061", "0.6721855", "0.67181015", "0.67082185", "0.6700269", "0.6690336", "0.66742367", "0.6666277", "0.66220695", "0.6613516", "0.6607828", "0.660709", "0.6591409", "0.6585597", "0.6582819", "0.6549498", "0.6545076", "0.65346867", "0.65290844", "0.65239775", "0.6518902", "0.6482696", "0.6474293", "0.646508", "0.6454494", "0.64538205", "0.64475584", "0.6447394", "0.6415467", "0.6414359", "0.64086235", "0.6374286", "0.6365497", "0.63600254", "0.635701", "0.63549584", "0.6353934", "0.63444114", "0.63419867", "0.6339048", "0.6336109", "0.6335673", "0.63312596", "0.6322436", "0.63179874", "0.63138676", "0.63131154", "0.6309237", "0.63007146", "0.6299647", "0.6298136", "0.62878746", "0.62863666", "0.6274894", "0.62731135", "0.62701726", "0.62682205", "0.6264444", "0.6264444", "0.6256574", "0.6250144", "0.62468106", "0.6243709", "0.62435424", "0.6242591", "0.62400335", "0.6213678", "0.62122524", "0.6205361", "0.62012917", "0.6197986", "0.6192768", "0.6182876", "0.6178719", "0.61780614", "0.61724323", "0.6161072", "0.615761", "0.6153759", "0.61504513", "0.6146454", "0.61368906", "0.6133939", "0.61290926", "0.61249447", "0.6116636", "0.61157024", "0.61067486", "0.6103154", "0.60969365", "0.6095136", "0.6095136", "0.60944915", "0.6090212", "0.60895234", "0.60859734" ]
0.0
-1
Temporary hack: the TreeNodeRepository should be created and maintained upstream!
@Override public SpawnResult exec(Spawn spawn, SpawnExecutionPolicy policy) throws InterruptedException, IOException, ExecException { TreeNodeRepository repository = new TreeNodeRepository(execRoot, policy.getActionInputFileCache()); SortedMap<PathFragment, ActionInput> inputMap = policy.getInputMapping(); TreeNode inputRoot = repository.buildFromActionInputs(inputMap); repository.computeMerkleDigests(inputRoot); Command command = RemoteSpawnRunner.buildCommand(spawn.getArguments(), spawn.getEnvironment()); Action action = RemoteSpawnRunner.buildAction( spawn.getOutputFiles(), Digests.computeDigest(command), repository.getMerkleDigest(inputRoot), platform, policy.getTimeout()); // Look up action cache, and reuse the action output if it is found. ActionKey actionKey = Digests.computeActionKey(action); ActionResult result = this.options.remoteAcceptCached ? remoteCache.getCachedActionResult(actionKey) : null; if (result != null) { // We don't cache failed actions, so we know the outputs exist. // For now, download all outputs locally; in the future, we can reuse the digests to // just update the TreeNodeRepository and continue the build. try { remoteCache.download(result, execRoot, policy.getFileOutErr()); return new SpawnResult.Builder() .setStatus(Status.SUCCESS) .setExitCode(result.getExitCode()) .build(); } catch (CacheNotFoundException e) { // There's a cache miss. Fall back to local execution. } } SpawnResult spawnResult = delegate.exec(spawn, policy); if (options.remoteUploadLocalResults && spawnResult.status() == Status.SUCCESS && spawnResult.exitCode() == 0) { List<Path> outputFiles = RemoteSpawnRunner.listExistingOutputFiles(execRoot, spawn); remoteCache.upload(actionKey, execRoot, outputFiles, policy.getFileOutErr()); } return spawnResult; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "TreeNode getTreeNode();", "private static TreeNode getNode() {\n TreeNode treeNode = new TreeNode(1);\n TreeNode left = new TreeNode(2);\n TreeNode right = new TreeNode(3);\n treeNode.left = left;\n treeNode.right = right;\n\n left.left = new TreeNode(4);\n right.left = new TreeNode(5);\n right.right = new TreeNode(6);\n return treeNode;\n }", "public interface TreeNode {\n Collection<TreeNode> getChildren();\n boolean isDirectory();\n}", "public interface TreeNodeService {\n\n /**\n * Gets tree.\n * 根据parent_id 生成tree\n *\n * @param pid the pid\n * @param list the list\n * @return tree tree\n */\n List<TreeNode> getTree(long pid, List<TreeNode> list);\n\n}", "public interface TreeNode{\r\n\t\r\n\t// enumerated node types\r\n\tpublic enum NodeType {\r\n\t\tMIN {\r\n\t\t\t@Override\r\n\t\t\tpublic NodeType opposite() {\r\n\t\t\t\treturn MAX;\r\n\t\t\t}\r\n\t\t}, MAX {\r\n\t\t\t@Override\r\n\t\t\tpublic NodeType opposite() {\r\n\t\t\t\treturn MIN;\r\n\t\t\t}\r\n\t\t};\r\n\t\r\n\t\tpublic abstract NodeType opposite();\r\n\t};\r\n\t\r\n\t// the type of node represented\r\n\tpublic NodeType getNodeType();\r\n\t\r\n\t// a possibly empty list of children\r\n\tpublic List<TreeNode> getChildrenNodes();\r\n\t\r\n\t// request a new child node after executing a move\r\n\tpublic TreeNode getChildNode(GameMove move) throws IllegalArgumentException;\r\n\t\r\n\t// the parent node of the current node\r\n\t// current Node == getParentNode for ROOT\r\n\tpublic TreeNode getParentNode();\r\n \r\n\t// whether the current node is the root node\r\n\tpublic Boolean isRootNode();\r\n \r\n\t// returns an object modeling some external state \r\n\tpublic GameState getGameState();\r\n \r\n\t// depth of node in tree\r\n\tpublic int getDepth();\r\n \r\n\t// evaluates/scores the leaf node\r\n\tpublic int scoreLeafNode();\r\n}", "public abstract TreeNode getNode(int i);", "public TreeNode() {\n }", "public TreeNode(String name) {\r\n setName(name);\r\n }", "public abstract TreeNode copy();", "GitTree(RevTree aRT, String aPath) { _rev = aRT; _path = aPath; }", "public TreeNode() {\n // do nothing\n }", "@Override\n public Component getTreeCellRendererComponent(\n JTree tree,\n Object value,\n boolean sel,\n boolean expanded,\n boolean leaf,\n int row,\n boolean hasFocus) {\n\n component.removeAll();\n SiteNode node = null;\n if (value instanceof SiteNode) {\n node = (SiteNode) value;\n }\n\n if (node != null) {\n if (node.isFiltered()) {\n // Hide the node\n setPreferredSize(new Dimension(0, 0));\n return this;\n }\n\n setPreferredSize(null); // clears the preferred size, making the node visible\n super.getTreeCellRendererComponent(tree, value, sel, expanded, leaf, row, hasFocus);\n\n // folder / file icons with scope 'target' if relevant\n if (node.isRoot()) {\n component.add(wrap(DisplayUtils.getScaledIcon(ROOT_ICON))); // 'World' icon\n } else {\n OverlayIcon icon;\n if (node.isDataDriven()) {\n if (node.isIncludedInScope() && !node.isExcludedFromScope()) {\n icon = new OverlayIcon(DATA_DRIVEN_IN_SCOPE_ICON);\n } else {\n icon = new OverlayIcon(DATA_DRIVEN_ICON);\n }\n } else if (leaf) {\n if (node.isIncludedInScope() && !node.isExcludedFromScope()) {\n icon = new OverlayIcon(LEAF_IN_SCOPE_ICON);\n } else {\n icon = new OverlayIcon(LEAF_ICON);\n }\n } else {\n if (expanded) {\n if (node.isIncludedInScope() && !node.isExcludedFromScope()) {\n icon = new OverlayIcon(FOLDER_OPEN_IN_SCOPE_ICON);\n } else {\n icon = new OverlayIcon(FOLDER_OPEN_ICON);\n }\n } else {\n if (node.isIncludedInScope() && !node.isExcludedFromScope()) {\n icon = new OverlayIcon(FOLDER_CLOSED_IN_SCOPE_ICON);\n } else {\n icon = new OverlayIcon(FOLDER_CLOSED_ICON);\n }\n }\n }\n if (node.getParent().isRoot() && node.getNodeName().startsWith(\"https://\")) {\n // Add lock icon to site nodes with https\n icon.add(LOCK_OVERLAY_ICON);\n }\n\n component.add(wrap(DisplayUtils.getScaledIcon(icon)));\n\n Alert alert = node.getHighestAlert();\n if (alert != null) {\n component.add(wrap(alert.getIcon()));\n }\n\n for (ImageIcon ci : node.getCustomIcons()) {\n component.add(wrap(DisplayUtils.getScaledIcon(ci)));\n }\n }\n setText(node.toString());\n setIcon(null);\n component.add(this);\n\n for (SiteMapListener listener : listeners) {\n listener.onReturnNodeRendererComponent(this, leaf, node);\n }\n return component;\n }\n\n return this;\n }", "public TreeNode getLeft(){ return leftChild;}", "@Override\n public Node getNode() throws ItemNotFoundException, ValueFormatException,\n RepositoryException {\n return null;\n }", "TreeStorage getTreeStorage();", "public TreeNodeImpl(N value) {\n this.value = value;\n }", "public TreeNode(Object e) {\n element = e;\n //this.parent = null;\n left = null;\n right = null;\n }", "public interface TreeNodeIdsHandler<T extends BaseEntity> {\n\n //获取待处理根节点列表\n List<String> getRootNodeIds();\n\n //处理原始的根节点列表\n List<String> getRootNodeIdsForQueryTrees(List<String> rootNodeIds);\n\n List<T> getChildrenTree(String nodeId);\n\n TreeNodeGenerateStrategy<T> getTreeNodeGenerateStrategy();\n\n default TreeNodeIdsHandlerResult handle() {\n TreeNodeIdsHandlerResult treeNodeIdsHandlerResult = new TreeNodeIdsHandlerResult();\n List<String> rootNodeIds = getRootNodeIdsForQueryTrees(getRootNodeIds());\n treeNodeIdsHandlerResult.setRootNodeIds(rootNodeIds);\n treeNodeIdsHandlerResult.setAllTreeNodes(getTreeNodes(rootNodeIds));\n return treeNodeIdsHandlerResult;\n }\n\n default List<TreeUtil.TreeNode> getTreeNodes(List<String> rootNodeIds){\n List<T> entities = Lists.newArrayList();\n for (String nodeId : rootNodeIds) {\n entities.addAll(getChildrenTree(nodeId));\n }\n\n return TreeNodeConverter.buildTreeNodeConverter(getTreeNodeGenerateStrategy()).convert(entities);\n }\n}", "TreeNode returnNode(TreeNode node);", "public TreeNode(){ this(null, null, 0);}", "public interface TreeNode {\r\n\r\n /**\r\n * Function to return Code of this node.\r\n *\r\n * @return Character that is the code that the node represents.\r\n */\r\n Character getCode();\r\n\r\n /**\r\n * Method to add a child to a Tree node. The method returns reference to the node that was just\r\n * added or the node with the entered code if it was already present.\r\n *\r\n * @param node a treenode with the code to be added to the intermediate node\r\n * @return an already existing tree node with given code or create a new tree node and return it.\r\n */\r\n TreeNode addChild(TreeNode node);\r\n\r\n /**\r\n * Given a node with a character code, return the node in the tree with the same code.\r\n *\r\n * @param node the node with character to be checked for in the tree.\r\n * @return the node with code equal to the code of the parameter passed.\r\n */\r\n TreeNode returnNode(TreeNode node);\r\n\r\n /**\r\n * Given a size, check if all nodes in the tree have number of children equal to the size passed.\r\n *\r\n * @param size the value to be checked against.\r\n * @return true or false according to if the check passes or fails.\r\n */\r\n boolean isCodeComplete(int size);\r\n}", "void setLeft(TreeNode<T> left);", "List<CMSObject> getNodeByPath(String path, ConnectionInfo connectionInfo) throws RepositoryAccessException;", "@Test(expected = IllegalArgumentException.class)\n\tpublic void withParentsNullRepository2() {\n\t\tTreeUtils.withParents(null, Constants.MASTER);\n\t}", "public TreeNode getRight(){ return rightChild;}", "public TreeImpl(T dato) {\r\n\t\traiz = new NodeImpl<T>(dato, null);// El null dice que es raiz\r\n\t}", "public TreeNode(T nodeData){\n data = nodeData;\n leftNode = rightNode = null;\n }", "public interface NodeManager<K extends Comparable<K>, V> extends Closeable, Monitorable {\n\n /**\n * Returns the root node of the specified <code>BTree</code>.\n * \n * @param btree the BTree.\n * @return the root node.\n * @throws IOException if an I/O problem occurs.\n */\n Node<K, V> getRoot(BTree<K, V> btree) throws IOException;\n\n /**\n * Sets the new root node.\n * \n * @param root the new root node.\n * @throws IOException if an I/O problem occurs.\n */\n void setRoot(Node<K, V> root) throws IOException;\n\n /**\n * Allows this manager to take control of the storage of specified node.\n * \n * @param node the node.\n * @return the decorated node.\n * @throws IOException if an I/O problem occurs.\n */\n @SuppressWarnings(\"unchecked\")\n Node<K, V>[] wrapNodes(Node<K, V>... nodes) throws IOException;\n\n /**\n * Allows this manager to take control of the storage of specified node.\n * \n * @param node the node.\n * @return the decorated node.\n * @throws IOException if an I/O problem occurs.\n */\n Node<K, V> wrapNode(Node<K, V> node) throws IOException;\n\n /**\n * Allows the user of the node to retrieve the original node.\n * \n * @param node the decorated node.\n * @return the node.\n * @throws IOException if an I/O problem occurs.\n */\n Node<K, V> unwrapNode(Node<K, V> node) throws IOException;\n\n /**\n * Allows this manager to take control of the storage of specified value.\n * \n * @param value the value.\n * @return the decorated value.\n * @throws IOException if an I/O problem occurs.\n */\n ValueWrapper<V> wrapValue(V value) throws IOException;\n \n /**\n * {@inheritDoc}\n */\n @Override\n void close();\n}", "public interface TreeNodeLocator<K, V> {\n /**\n * Return next TreeNode instance from some source\n * @return {@see TreeNode} instance\n */\n TreeNode<K, V> getNextTreeNode();\n\n /**\n * Identifies presence of another TreeNode instances\n * @return <b>true</b> if there's another tree instances\n * <b>false</b> otherwise\n */\n boolean hasMore();\n}", "public interface TreeNodeValueModel<T>\r\n\textends WritablePropertyValueModel<T>\r\n{\r\n\r\n\t/**\r\n\t * Return the node's parent node; null if the node\r\n\t * is the root.\r\n\t */\r\n\tTreeNodeValueModel<T> parent();\r\n\r\n\t/**\r\n\t * Return the path to the node.\r\n\t */\r\n\tTreeNodeValueModel<T>[] path();\r\n\r\n\t/**\r\n\t * Return a list value model of the node's child nodes.\r\n\t */\r\n\tListValueModel<TreeNodeValueModel<T>> childrenModel();\r\n\r\n\t/**\r\n\t * Return the node's child at the specified index.\r\n\t */\r\n\tTreeNodeValueModel<T> child(int index);\r\n\r\n\t/**\r\n\t * Return the size of the node's list of children.\r\n\t */\r\n\tint childrenSize();\r\n\r\n\t/**\r\n\t * Return the index in the node's list of children of the specified child.\r\n\t */\r\n\tint indexOfChild(TreeNodeValueModel<T> child);\r\n\r\n\t/**\r\n\t * Return whether the node is a leaf (i.e. it has no children)\r\n\t */\r\n\tboolean isLeaf();\r\n\r\n}", "protected TreeNode(NodeLayout node, TreeLayoutObserver owner) {\n\t\t\tthis.node = node;\n\t\t\tthis.owner = owner;\n\t\t}", "public JdbNavTree(TreeNode root) {\r\n super(root);\r\n commonInit();\r\n }", "public TtreeNode() {\n\t numberOfNodes++;\n\t }", "private DefaultMutableTreeNode buildSortedTree(DefaultMutableTreeNode oldNode) {\n return buildSortedTree(oldNode, \n new DefaultMutableTreeNode(oldNode.getUserObject()));\n }", "@Override\r\n\tpublic Node getRootNode() throws RepositoryException {\n\t\treturn null;\r\n\t}", "TreeNode(){\n this.elem = null;\n this.left = null;\n this.right = null;\n }", "@Test\n public void testManipulateObjectByReference() {\n TreeNode root = new TreeNode(0);\n root.left = new TreeNode(1);\n root.right = new TreeNode(2);\n setLeftChildToNull(root);\n System.out.println(root.left);\n }", "@Test(expected = IllegalArgumentException.class)\n\tpublic void withParentsNullRepository() {\n\t\tTreeUtils.withParents(null, ObjectId.zeroId());\n\t}", "public JdbNavTree(TreeModel treeModel) {\r\n super(treeModel);\r\n commonInit();\r\n }", "public JdbNavTree() {\r\n super(new Object [] {});\r\n commonInit();\r\n }", "List<CMSObject> getNodeByName(String name, ConnectionInfo connectionInfo) throws RepositoryAccessException;", "private RestTreeNode createRemoteOrVirtualFolderNode(BaseBrowsableItem pathItem, String repoType,\n RepoPath repositoryPath) {\n RestTreeNode child;\n String repoKey = pathItem.getRepoKey();\n repositoryPath = pathItem.getRepoPath();\n if (repoKey.endsWith(\"-cache\")) {\n repoKey = repoKey.replace(\"-cache\", \"\");\n repositoryPath = InternalRepoPathFactory.create(repoKey, pathItem.getRepoPath().getPath());\n }\n child = new VirtualRemoteFolderNode(repositoryPath, pathItem, pathItem.getName(), repoType);\n return child;\n }", "private TreeNode(int x) {\n val = x;\n left = null;\n right = null;\n }", "private DataFetcherResult<NodeContent> baseNodeFetcher(DataFetchingEnvironment env) {\n\t\tContentDao contentDao = Tx.get().contentDao();\n\t\tGraphQLContext gc = env.getContext();\n\t\tHibProject project = env.getSource();\n\t\tHibNode node = project.getBaseNode();\n\t\tgc.requiresPerm(node, READ_PERM, READ_PUBLISHED_PERM);\n\t\tList<String> languageTags = getLanguageArgument(env);\n\t\tContainerType type = getNodeVersion(env);\n\n\t\tHibNodeFieldContainer container = contentDao.findVersion(node, gc, languageTags, type);\n\t\treturn NodeTypeProvider.createNodeContentWithSoftPermissions(env, gc, node, languageTags, type, container);\n\t}", "private PersistentLinkedList<T> setHelper(int treeIndex, T data) {\n int newSize = this.treeSize;\n if (newSize == treeIndex) {\n newSize++;\n }\n\n TraverseData traverseData = traverse(treeIndex);\n\n traverseData.currentNewNode.set(traverseData.index, new Node<>(branchingFactor, data));\n for (int i = 0; i < branchingFactor; i++) {\n if (i == traverseData.index) {\n continue;\n }\n traverseData.currentNewNode.set(i, traverseData.currentNode.get(i));\n }\n\n return new PersistentLinkedList<>(traverseData.newRoot, branchingFactor, depth, base,\n newSize, unusedTreeIndices, indexCorrespondingToTheFirstElement,\n indexCorrespondingToTheLatestElement);\n }", "public interface SelectionTreeNode extends TreeNode {\n public static enum State {\n NONE_SELECTED, SOME_SELECTED, ALL_SELECTED\n }\n\n /**\n * Returns this node's current state.\n *\n * @return this node's current state.\n */\n public State getState();\n\n /**\n * Updates this node's current state.\n *\n * @param state new state for this node.\n */\n public void setState(final State state);\n\n /**\n * Instructs the node to update its state. The node will then scan its children to determine whether all, some or\n * none of them are selected. If the node does not have children, the value provided by the last call of setState\n * will be retained.\n */\n public void updateState();\n\n /**\n * Adds a selection listener to the node, which will be notified when the node's state changes.\n *\n * @param listener listener to add.\n * @see net.sarcommand.swingextensions.selectiontree.SelectionTreeListener\n */\n public void addSelectionTreeListener(final SelectionTreeListener listener);\n\n /**\n * Removes a selection listener from the node.\n *\n * @param listener listener to remove.\n * @see net.sarcommand.swingextensions.selectiontree.SelectionTreeListener\n */\n public void removeSelectionTreeListener(final SelectionTreeListener listener);\n}", "public TreeNode(int ID) {\n this.ID = ID;\n right = null;\n left = null;\n }", "public interface INode {\n INode[] children();\n INode getParent();\n void setParent(INode parent);\n INode copySubTree();\n INode copyWholeTree();\n String getNodeChar();\n void setChildren(INode[] newKids);\n void setNodeChar(String c);\n INode getRoot();\n boolean isRoot();\n Bit getBit();\n void setBit(Bit bit);\n void tellChildAboutParent();\n INode addBrackets();\n INode removeBrackets();\n String toPlainText();\n}", "public static void main(String[] args) {\n// TreeNode node1 = new TreeNode(0);\n// TreeNode node2l = new TreeNode(3);\n// TreeNode node2r = new TreeNode(5);\n//// TreeNode node3l = new TreeNode(2);\n// TreeNode node3r = new TreeNode(2);\n//// TreeNode node4l = new TreeNode(4);\n// TreeNode node4r = new TreeNode(1);\n//\n// node1.left = node2l;\n// node1.right = node2r;\n//// node2l.left = node3l;\n// node2l.right = node3r;\n// node3r.right = node4r;\n//\n\n int[] nums = {3, 2, 1, 6, 0, 5};\n\n }", "public TreeNode()\r\n\t\t{\r\n\t\t\thead = null; //no data so set head to null\r\n\t\t}", "public interface TreeProcessor<N extends TreeNode<N>> {\n\n /**\n * Will start the processing at the originating node\n * @param origin the node from which the processing will originate\n * @param processor the processor to run on each node\n */\n void process(N origin, TreeNodeProcessor<N> processor);\n\n}", "public NamedTree()\r\n {\r\n head = null;\r\n }", "private void refreshTagsTree(){\n List<TreeItem<String>> treeItemsList = new ArrayList<TreeItem<String>>();\n USER.getImagesByTags().forEach((key, value) -> {\n TreeItem<String> tagTreeItem = new TreeItem<>(key);\n tagTreeItem.getChildren().setAll(\n value.stream()\n .map(imageData -> new TreeItem<>(IMAGE_DATA.inverse().get(imageData).getName()))\n .collect(Collectors.toList())\n );\n treeItemsList.add(tagTreeItem);\n });\n ROOT.getChildren().setAll(treeItemsList);\n }", "@Override\n\tpublic void visit(OracleHierarchicalExpression arg0) {\n\t\t\n\t}", "public interface OperationalViewTree extends LayeredViewTree {\n\n public static final String UPLOADED_PREFIX = \"(CURR) \";\n\n AbstractLayer switchCurrentLayer(AbstractLayer fromLayer, AbstractLayer toLayer);\n\n boolean hasPrivateSession();\n\n}", "public void interactiveTreeXXEditingRToL() {\r\n JTree tree = new JTree(); \r\n tree.setEditable(true);\r\n DefaultTreeCellRenderer renderer = new DynamicIconRenderer();\r\n tree.setCellRenderer(renderer);\r\n DefaultTreeEditor treeCellEditor = new DefaultTreeEditor();\r\n tree.setCellEditor(treeCellEditor);\r\n JXTree xTree = new JXTree();\r\n xTree.setCellRenderer(renderer);\r\n xTree.setEditable(true);\r\n xTree.setCellEditor(new DefaultTreeEditor());\r\n\r\n final JXFrame frame = wrapWithScrollingInFrame(tree, xTree, \"XXEditing: compare tree and xtree\");\r\n Action toggleComponentOrientation = new AbstractAction(\"toggle orientation\") {\r\n\r\n public void actionPerformed(ActionEvent e) {\r\n ComponentOrientation current = frame.getComponentOrientation();\r\n if (current == ComponentOrientation.LEFT_TO_RIGHT) {\r\n frame.applyComponentOrientation(ComponentOrientation.RIGHT_TO_LEFT);\r\n } else {\r\n frame.applyComponentOrientation(ComponentOrientation.LEFT_TO_RIGHT);\r\n\r\n }\r\n\r\n }\r\n\r\n };\r\n addAction(frame, toggleComponentOrientation);\r\n frame.setVisible(true);\r\n \r\n }", "CMSObject getFirstNodeByPath(String path, ConnectionInfo connectionInfo) throws RepositoryAccessException;", "@Test\n public void test2() throws Throwable {\n Object object0 = new Object();\n DefaultMenuItem defaultMenuItem0 = new DefaultMenuItem(object0);\n defaultMenuItem0.setParent(object0);\n assertEquals(true, defaultMenuItem0.isLeaf());\n }", "List<CMSObject> getNodeById(String id, ConnectionInfo connectionInfo) throws RepositoryAccessException;", "public TreeNode getTreeNode() {\n return treeNode;\n }", "public void interactiveTreeEditingRToL() {\r\n JTree tree = new JTree(); \r\n TreeCellRenderer renderer = new DynamicIconRenderer();\r\n tree.setCellRenderer(renderer);\r\n tree.setEditable(true);\r\n JXTree xTree = new JXTree();\r\n xTree.setCellRenderer(renderer);\r\n xTree.setEditable(true);\r\n final JXFrame frame = wrapWithScrollingInFrame(tree, xTree, \"standard Editing: compare tree and xtree\");\r\n Action toggleComponentOrientation = new AbstractAction(\"toggle orientation\") {\r\n\r\n public void actionPerformed(ActionEvent e) {\r\n ComponentOrientation current = frame.getComponentOrientation();\r\n if (current == ComponentOrientation.LEFT_TO_RIGHT) {\r\n frame.applyComponentOrientation(ComponentOrientation.RIGHT_TO_LEFT);\r\n } else {\r\n frame.applyComponentOrientation(ComponentOrientation.LEFT_TO_RIGHT);\r\n\r\n }\r\n\r\n }\r\n\r\n };\r\n addAction(frame, toggleComponentOrientation);\r\n frame.setVisible(true);\r\n \r\n }", "void nodeUpdated(Node n) throws RepositoryException;", "protected void defaultHandle(TreeNode changedNode) {\n\t\t}", "public interface BPTreeNode {\n\n /*\n * Method returns the node index in the B+ tree organization.\n *\n * Returns:\n * node index in B+ tree\n * */\n public long getNodeIndex();\n\n\n /*\n * Method identifies the node as a leaf node or a child (non-leaf) node.\n *\n * Returns:\n * true, if leaf node; false if child node\n * */\n public boolean isLeaf();\n\n /*\n * Method inserts the node item appropriate to the item's key value.\n *\n * Returns:\n * Node item inserted successfully.\n * */\n public boolean insertItem(BPTreeNodeItem item);\n\n /*\n * Method deletes the node item appropriate to the item's index.\n *\n * Returns:\n * Node item deleted successfully.\n * */\n public boolean deleteItem(int index);\n\n /*\n * Method returns the number of items assigned to the node.\n *\n * Returns:\n * Count of node items contained in the node\n * */\n public int getItemCount();\n\n /*\n * Method returns the indexed node item.\n *\n * Returns:\n * Indexed node item.\n * */\n public BPTreeNodeItem getItem(int index);\n\n /*\n * Method returns the lowest chromosome name key belonging to the node.\n *\n * Returns:\n * Lowest contig/chromosome name key; or null for no node items.\n * */\n public String getLowestChromKey();\n\n /*\n * Method returns the highest chromosome name key belonging to the node.\n *\n * Returns:\n * Highest contig/chromosome name key; or null for no node items.\n * */\n public String getHighestChromKey();\n\n /*\n * Method returns the lowest chromosome ID belonging to the node.\n *\n * Returns:\n * Lowest contig/chromosome ID; or -1 for no node items.\n * */\n public int getLowestChromID();\n\n /*\n * Method returns the highest chromosome ID belonging to the node.\n *\n * Returns:\n * Highest contig/chromosome ID; or -1 for no node items.\n * */\n public int getHighestChromID();\n\n /*\n * Method prints the nodes items and sub-node items.\n * Node item deleted successfully.\n * */\n public void printItems();\n\n}", "public JdbTree(TreeModel treeModel) {\r\n super(treeModel);\r\n commonInit();\r\n }", "public void treeStructureChanged(TreeModelEvent e) {\n //To change body of implemented methods use Options | File Templates.\n }", "public interface Tree {\n\n //查找节点\n Node find(int val);\n\n //插入新节点\n boolean insert(int val);\n\n //中序遍历\n void infixOrder(Node current);\n\n //前序遍历\n void preOrder(Node current);\n\n //后序遍历\n void postOrder(Node current);\n\n //找到最大值\n Node findMax();\n\n //找到最小值\n Node findMin();\n\n //删除节点\n boolean delete(int val);\n\n}", "static TreeNode newNode(int item) \n\t{ \n\t\tTreeNode temp = new TreeNode(); \n\t temp.key = item; \n\t temp.left = null; \n\t temp.right = null; \n\t return temp; \n\t}", "public AppDbObjectTreeExtensionUsageToggleNode() {\n super(TOGGLENODEID_TREEUSAGE);\n inUseItem = new JMenuItem(new AbstractAction(\"treeusage\") { // NOI18N\n public void actionPerformed(ActionEvent e) {\n if (inUseItem.getText().equals(TEXT_HIDE_TREEUSGE)) {\n getTree().hideInUseTree(getChildIndex());\n }\n else {\n getTree().showInUseTree();\n }\n }\n });\n }", "public Tree(){\n root = null;\n }", "@Test\n public void test7() throws Throwable {\n DefaultMenuItem defaultMenuItem0 = new DefaultMenuItem((Object) null);\n defaultMenuItem0.getParent();\n assertEquals(true, defaultMenuItem0.isLeaf());\n }", "public void interactiveTreeEditingRToLDatePicker() {\r\n DefaultMutableTreeNode root = new DefaultMutableTreeNode(new Date());\r\n root.add(new DefaultMutableTreeNode(new Date()));\r\n TreeModel model = new DefaultTreeModel(root);\r\n JTree tree = new JTree(model); \r\n DefaultTreeCellRenderer renderer = new DynamicIconRenderer();\r\n tree.setCellRenderer(renderer);\r\n tree.setEditable(true);\r\n tree.setCellEditor(new DefaultTreeCellEditor(tree, renderer, new DatePickerCellEditor()));\r\n JXTree xTree = new JXTree(model);\r\n xTree.setCellRenderer(renderer);\r\n xTree.setEditable(true);\r\n xTree.setCellEditor(new DefaultTreeCellEditor(tree, renderer, new DatePickerCellEditor()));\r\n final JXFrame frame = wrapWithScrollingInFrame(tree, xTree, \"standard Editing (DatePicker): compare tree and xtree\");\r\n Action toggleComponentOrientation = new AbstractAction(\"toggle orientation\") {\r\n\r\n public void actionPerformed(ActionEvent e) {\r\n ComponentOrientation current = frame.getComponentOrientation();\r\n if (current == ComponentOrientation.LEFT_TO_RIGHT) {\r\n frame.applyComponentOrientation(ComponentOrientation.RIGHT_TO_LEFT);\r\n } else {\r\n frame.applyComponentOrientation(ComponentOrientation.LEFT_TO_RIGHT);\r\n\r\n }\r\n\r\n }\r\n\r\n };\r\n addAction(frame, toggleComponentOrientation);\r\n frame.setVisible(true);\r\n \r\n }", "@Override\r\n\tpublic TreeCell<Object> call(TreeView<Object> param) {\n\r\n\t\tfinal TreeCell<Object> treeCell = new TreeCell<Object>() {\r\n\r\n\t\t\tObject currentItem = null;\r\n\t\t\tICellEditHandler cellEditHandler;\r\n\r\n\t\t\tAdapterImpl adapter = new AdapterImpl() {\r\n\t\t\t\t@Override\r\n\t\t\t\tpublic void notifyChanged(Notification msg) {\r\n\t\t\t\t\tupdate(msg.getNotifier());\r\n\t\t\t\t}\r\n\t\t\t};\r\n\r\n\t\t\t@Override\r\n\t\t\tpublic void startEdit() {\r\n\t\t\t\tsuper.startEdit();\r\n\r\n\t\t\t\ttry {\r\n\t\t\t\t\tMethod getCellEditHandler = AdapterFactoryCellFactory.class.getDeclaredMethod(\"getCellEditHandler\",\r\n\t\t\t\t\t\t\tCell.class);\r\n\t\t\t\t\tgetCellEditHandler.setAccessible(true);\r\n\t\t\t\t\tcellEditHandler = (ICellEditHandler) getCellEditHandler\r\n\t\t\t\t\t\t\t.invoke(PatchedAdapterFactoryTreeCellFactory.this, this);\r\n\r\n\t\t\t\t\tif (cellEditHandler != null)\r\n\t\t\t\t\t\tcellEditHandler.startEdit(this);\r\n\t\t\t\t} catch (Exception e) {\r\n\t\t\t\t\tthrow new RuntimeException(e);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\t@Override\r\n\t\t\tpublic void commitEdit(Object newValue) {\r\n\t\t\t\tsuper.commitEdit(newValue);\r\n\t\t\t\tif (cellEditHandler != null)\r\n\t\t\t\t\tcellEditHandler.commitEdit(this, newValue);\r\n\t\t\t}\r\n\r\n\t\t\t@Override\r\n\t\t\tpublic void cancelEdit() {\r\n\t\t\t\tsuper.cancelEdit();\r\n\t\t\t\tif (cellEditHandler != null)\r\n\t\t\t\t\tcellEditHandler.cancelEdit(this);\r\n\t\t\t\tupdate(getItem());\r\n\t\t\t}\r\n\r\n\t\t\t@Override\r\n\t\t\tprotected void updateItem(Object item, boolean empty) {\r\n\t\t\t\tsuper.updateItem(item, empty);\r\n\t\t\t\t// check if the item changed\r\n\t\t\t\tif (item != currentItem) {\r\n\r\n\t\t\t\t\t// remove the adapter if attached\r\n\t\t\t\t\tif (currentItem instanceof Notifier)\r\n\t\t\t\t\t\t((Notifier) currentItem).eAdapters().remove(adapter);\r\n\r\n\t\t\t\t\t// update the current item\r\n\t\t\t\t\tcurrentItem = item;\r\n\r\n\t\t\t\t\t// attach the adapter to the new item\r\n\t\t\t\t\tif (currentItem instanceof Notifier)\r\n\t\t\t\t\t\t((Notifier) currentItem).eAdapters().add(adapter);\r\n\t\t\t\t}\r\n\r\n\t\t\t\ttry {\r\n\t\t\t\t\tField cellUpdateListenersField = AdapterFactoryCellFactory.class\r\n\t\t\t\t\t\t\t.getDeclaredField(\"cellUpdateListeners\");\r\n\t\t\t\t\tcellUpdateListenersField.setAccessible(true);\r\n\t\t\t\t\t@SuppressWarnings(\"unchecked\")\r\n\t\t\t\t\tList<ICellUpdateListener> cellUpdateListeners = (List<ICellUpdateListener>) cellUpdateListenersField\r\n\t\t\t\t\t\t\t.get(PatchedAdapterFactoryTreeCellFactory.this);\r\n\t\t\t\t\t// notify the listeners\r\n\t\t\t\t\tfor (ICellUpdateListener cellUpdateListener : cellUpdateListeners)\r\n\t\t\t\t\t\tcellUpdateListener.updateItem(this, item, empty);\r\n\t\t\t\t} catch (Exception e) {\r\n\t\t\t\t\tthrow new RuntimeException(e);\r\n\t\t\t\t}\r\n\r\n\t\t\t\tupdate(item);\r\n\r\n\t\t\t\tif (empty) {\r\n\t\t\t\t\tsetText(null);\r\n\t\t\t\t\tsetGraphic(null);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\tprivate void update(Object item) {\r\n\t\t\t\t// setText(item == null ? \"null\" : item.toString());\r\n\r\n\t\t\t\ttry {\r\n\t\t\t\t\tMethod applyItemProviderStyle = AdapterFactoryCellFactory.class.getDeclaredMethod(\r\n\t\t\t\t\t\t\t\"applyItemProviderStyle\", Object.class, Cell.class, AdapterFactory.class);\r\n\t\t\t\t\tapplyItemProviderStyle.setAccessible(true);\r\n\t\t\t\t\tapplyItemProviderStyle.invoke(PatchedAdapterFactoryTreeCellFactory.this, item, this,\r\n\t\t\t\t\t\t\tadapterFactory);\r\n\r\n\t\t\t\t} catch (Exception e) {\r\n\t\t\t\t\tthrow new RuntimeException(e);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t};\r\n\r\n\t\ttry {\r\n\t\t\tField cellCreationListenersField = AdapterFactoryCellFactory.class\r\n\t\t\t\t\t.getDeclaredField(\"cellCreationListeners\");\r\n\t\t\tcellCreationListenersField.setAccessible(true);\r\n\t\t\t@SuppressWarnings(\"unchecked\")\r\n\t\t\tList<ICellCreationListener> cellCreationListeners = (List<ICellCreationListener>) cellCreationListenersField\r\n\t\t\t\t\t.get(PatchedAdapterFactoryTreeCellFactory.this);\r\n\t\t\t// notify the listeners\r\n\t\t\tfor (ICellCreationListener cellCreationListener : cellCreationListeners)\r\n\t\t\t\tcellCreationListener.cellCreated(treeCell);\r\n\r\n\t\t} catch (Exception e) {\r\n\t\t\tthrow new RuntimeException(e);\r\n\t\t}\r\n\r\n\t\treturn treeCell;\r\n\t}", "List<CMSObject> getNodeByName(String name, Object session) throws RepositoryAccessException;", "@Test(expected = IllegalArgumentException.class)\n\tpublic void visitNullTreeId() throws IOException {\n\t\tTreeUtils.visit(new FileRepository(testRepo), null, new ITreeVisitor() {\n\n\t\t\tpublic boolean accept(FileMode mode, String path, String name,\n\t\t\t\t\tAnyObjectId id) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t});\n\t}", "@Override\r\n\tpublic Node getNode(String absPath) throws PathNotFoundException,\r\n\t\t\tRepositoryException {\n\t\treturn null;\r\n\t}", "public void interactiveTreeXXEditingRToLDatePicker() {\r\n DefaultMutableTreeNode root = new DefaultMutableTreeNode(new Date());\r\n root.add(new DefaultMutableTreeNode(new Date()));\r\n TreeModel model = new DefaultTreeModel(root);\r\n JTree tree = new JTree(model); \r\n tree.setEditable(true);\r\n DefaultTreeCellRenderer renderer = new DynamicIconRenderer();\r\n tree.setCellRenderer(renderer);\r\n DefaultTreeEditor treeCellEditor = new DefaultTreeEditor(new DatePickerCellEditor());\r\n tree.setCellEditor(treeCellEditor);\r\n JXTree xTree = new JXTree(model);\r\n xTree.setCellRenderer(renderer);\r\n xTree.setEditable(true);\r\n xTree.setCellEditor(new DefaultTreeEditor(new DatePickerCellEditor()));\r\n\r\n final JXFrame frame = wrapWithScrollingInFrame(tree, xTree, \"XXEditing(DatePicker): compare tree and xtree\");\r\n Action toggleComponentOrientation = new AbstractAction(\"toggle orientation\") {\r\n\r\n public void actionPerformed(ActionEvent e) {\r\n ComponentOrientation current = frame.getComponentOrientation();\r\n if (current == ComponentOrientation.LEFT_TO_RIGHT) {\r\n frame.applyComponentOrientation(ComponentOrientation.RIGHT_TO_LEFT);\r\n } else {\r\n frame.applyComponentOrientation(ComponentOrientation.LEFT_TO_RIGHT);\r\n\r\n }\r\n\r\n }\r\n\r\n };\r\n addAction(frame, toggleComponentOrientation);\r\n frame.setVisible(true);\r\n \r\n }", "public void initTreeModel() {\n\t\t\n\t}", "public void initTreeModel() {\n\t\t\n\t}", "public interface Node {\n static class NodeComparor implements Comparator<Node>{\n @Override\n public int compare(Node o1, Node o2) {\n return o1.getNodeId().compareTo(o2.getNodeId());\n }\n }\n\n public String getNodeId();\n\n public Chunk getChunck(String id) throws ChunkNotFound;\n\n public void addChunk(Chunk c);\n\n public boolean doesManage(String chunkId);\n\n public void sendMessage(Message m) throws IOException;\n\n public NodeWorkGroup getWorkGroup();\n}", "public interface CRAccess {\n\n\t/**\n\t * Returns the node for the given path - The path must be a simple canonical path.\n\t * (No filters, relative paths, etc.)\n\t */\n\tNode getNode(String path);\n\n\t/**\n\t * Returns all nodes in the given path (e.g. /cmsblog/articles/ will return\n\t * { Node(/cmsblog), Node(/articles) }\n\t */\n\tNode[] getNodesInPath(String path);\n\t\n\tNodeType getNodeType(String path);\n\n\tNode getParentNode(Node node);\n\n\tNode resolveNode(Node currentNodeContext, String ref);\n\t\n\t/**\n\t * Returns all direct children of the current node.\n\t */\n\tNode[] getChildren(Node node);\n\t\n\t/* Node[] filterNode() */\n\t\n\t/**\n\t * close the repository/transaction, if the repository is writable this will also commit the changes\n\t */\n\tvoid close();\n\t\n\t/**\n\t * @return <code>true</code> if the repository supports transactions, otherwhise return <code>false</code>.\n\t */\n\tboolean supportsTransaction();\n\t\n\tpublic <T extends CRAdapter> T getAdapter(Class<T> adapterInterface);\n}", "@Test(expected = IllegalArgumentException.class)\n\tpublic void visitNullRepository() {\n\t\tTreeUtils.visit(null, ObjectId.zeroId(), new ITreeVisitor() {\n\n\t\t\tpublic boolean accept(FileMode mode, String path, String name,\n\t\t\t\t\tAnyObjectId id) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t});\n\t}", "io.dstore.values.IntegerValue getTreeNodeId();", "@Test(expected = IllegalArgumentException.class)\n\tpublic void withParentsNullRevision() throws IOException {\n\t\tTreeUtils.withParents(new FileRepository(testRepo), (String) null);\n\t}", "@Test\n public void treeSample() {\n this.pool.invoke(JobTrees.buildTree());\n }", "public SearchableTreePanel() {\n super();\n initialize();\n }", "private static void test2() {\n BinaryTreeNode node1 = new BinaryTreeNode(1);\n BinaryTreeNode node2 = new BinaryTreeNode(2);\n BinaryTreeNode node3 = new BinaryTreeNode(3);\n BinaryTreeNode node4 = new BinaryTreeNode(4);\n BinaryTreeNode node5 = new BinaryTreeNode(5);\n BinaryTreeNode node6 = new BinaryTreeNode(6);\n BinaryTreeNode node7 = new BinaryTreeNode(7);\n node1.left = node2;\n node1.right = node3;\n node2.left = node4;\n node2.right = node5;\n node5.left = node7;\n node3.right = node6;\n test(\"Test2\", node1, true);\n }", "public TreeNode(String syscall){\r\n\t\t\tthis.syscall = syscall;\r\n\t\t\tchildren = new ArrayList<TreeNode>();\r\n\t\t\tfrequency = 0;\r\n\t\t\t//parent = null;\r\n\t\t\tindex = -1;\r\n\t\t}", "private boolean getData() {\n if ( tiTree != null && !tiTree.isDisposed() ) {\n tiTree.dispose();\n }\n\n tiTree = new TreeItem( wTree, SWT.NONE );\n tiTree.setImage( GUIResource.getInstance().getImageFolder() );\n RepositoryDirectoryUI.getDirectoryTree( tiTree, dircolor, repositoryTree );\n tiTree.setExpanded( true );\n\n return true;\n }", "protected TreeNode<T> createTreeNode(T value) {\n return new TreeNode<T>(this, value);\n }", "@Override\n public void accept(TreeVisitor visitor) {\n }", "@Override\r\n public NamedTreeNode<T> getRoot()\r\n {\r\n return head;\r\n }", "@Test\n public void testExpandTree() {\n // TODO: test ExpandTree\n }", "public void setTree(MyTree t) {\r\n\t\ttree = t;\r\n\t}", "public RelocateBranch() {\n }", "public void setTree(Tree tree) {\n this.tree = tree;\n }", "public interface RMITreeNode extends Remote {\n\n\t/**\n\t * Set the father of the RMITreeNodeImpl. If it's set to null, the RMITreeNodeImpl becomes a root.\n\t * @param father The father of the RMITreeNodeImpl. If it's null, the RMITreeNodeImpl is a root.\n\t */\n\tpublic void setFather(RMITreeNode father) throws RemoteException;\n\t\n\tpublic void addChild(RMITreeNode child) throws RemoteException;\n\t\n\tpublic void removeChild(int index) throws RemoteException;\n\t\n\tpublic void removeChild(RMITreeNode child) throws RemoteException;\n\t\n\t/**\n\t * Remove every child of the RMITreeNode so it becomes a leaf.\n\t */\n\tpublic void clearChildren() throws RemoteException;\n\t\n\tpublic RMITreeNode getFather() throws RemoteException;\n\t\n\tpublic List<RMITreeNode> getChildren() throws RemoteException;\n\t\n\tpublic RMITreeNode getChild(int index) throws RemoteException;\n\t\n\tpublic String getName() throws RemoteException;\n\t\n\t/**\n\t * Return a String containing the trace of the propogation since its beginning.\n\t * @return The trace of the propogation.\n\t * @throws RemoteException\n\t */\n\tpublic String getTrace() throws RemoteException;\n\t\n\t/**\n\t * Give data as an array of byte to the RMITreeNode in order to propagate to the leaves of the tree.\n\t * @param data The data to propagate to the leaves of the tree.\n\t * @return The trace of the entire propagation.\n\t * @throws RemoteException\n\t */\n\tpublic String propagate(byte[] data) throws RemoteException;\n\t\n\t/**\n\t * Send data as an array of byte to every children of the RMITreeNode.\n\t * If the node is a leaf, put the message in the trace.\n\t * @param data An array of byte containing the data to send to the children.\n\t * @return The trace of the children receiving the data.\n\t * @throws RemoteException\n\t */\n\tpublic String sendDataToChildren(byte[] data) throws RemoteException;\n\n}", "@Override\r\n\tprotected Object createLowerView(Composite parent) {\n\t\tfTree = new Tree(parent, SWT.BORDER );\r\n\t\tfTree.addSelectionListener(new SelectionAdapter() {\r\n\r\n\t\t\t@Override\r\n\t\t\tpublic void widgetSelected(SelectionEvent arg0) {\r\n\t\t\t\t// https://jira.jboss.org/browse/JBIDE-7107\r\n\t\t\t\t// update \"OK\" button enablement\r\n\t\t\t\tupdateOkState();\r\n\t\t\t}\r\n\t\t\t\r\n\t\t});\r\n\t\t \r\n\t\tfTreeViewer = new TreeViewer(fTree);\r\n\t\tfTreeViewer.setContentProvider( treeContentProvider );\r\n\t\tfTreeViewer.setLabelProvider(new ModelTreeLabelProvider());\r\n\t\tfTreeViewer.setInput ( null );\r\n\t\tfTreeViewer.setAutoExpandLevel( getAutoExpandLevel() );\r\n\t\t// end tree viewer for variable structure\r\n\t\tGridData data = new GridData(); \r\n\t data.grabExcessVerticalSpace = true;\r\n\t data.grabExcessHorizontalSpace = true;\r\n\t data.horizontalAlignment = GridData.FILL;\r\n\t data.verticalAlignment = GridData.FILL;\r\n\t data.minimumHeight = 200;\r\n\t fTree.setLayoutData(data);\r\n\t \r\n\t\treturn fTree;\r\n\t}", "@Before\n public void setUp() {\n this.tree = new SimpleBinarySearchTree<>();\n }", "public String getTreeType();", "INodeState getCurrentNode();" ]
[ "0.6427663", "0.60223436", "0.5986839", "0.5971029", "0.59677935", "0.59504753", "0.59277874", "0.59123296", "0.58865494", "0.58356094", "0.5829203", "0.57961744", "0.5795769", "0.5785961", "0.57720816", "0.5756286", "0.57180524", "0.5705918", "0.57035744", "0.56929266", "0.5680489", "0.5653617", "0.565221", "0.5651867", "0.5651799", "0.5649223", "0.56471723", "0.56280106", "0.5627769", "0.562773", "0.5620031", "0.55624145", "0.5560825", "0.5559432", "0.5558728", "0.55554485", "0.5550682", "0.5537928", "0.55336595", "0.55298483", "0.5529132", "0.5520854", "0.55094767", "0.5507418", "0.5504981", "0.5498906", "0.5495035", "0.54747057", "0.5455684", "0.5452534", "0.5448128", "0.54334044", "0.54274225", "0.54268295", "0.5418964", "0.5412433", "0.54117835", "0.541018", "0.5407218", "0.54028004", "0.5398415", "0.53975177", "0.53942674", "0.53930914", "0.53918105", "0.53894246", "0.5389045", "0.53714275", "0.53667754", "0.53651303", "0.5361227", "0.5357845", "0.53520817", "0.5350999", "0.53474", "0.53465384", "0.5343535", "0.5334763", "0.5334763", "0.5332105", "0.53213394", "0.53205466", "0.53184474", "0.53178144", "0.53139615", "0.5312367", "0.531053", "0.5308052", "0.5307232", "0.52983934", "0.52979326", "0.5282517", "0.52815753", "0.5280688", "0.527633", "0.5267865", "0.5265062", "0.5264758", "0.52602583", "0.52573407", "0.5256078" ]
0.0
-1
Called by the containing screen to set the panel size
void setSize(int width, int height) { this.controls.clear(); this.width = width; this.height = height; this.innerHeight = this.height - TOP - BOTTOM; this.innerWidth = this.width - (MARGIN * 2) - 6; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\n public void settings() {\n setSize(WIDTH, HEIGHT);\n }", "private void basicSize(){\n setSize(375,400);\n }", "public void setSize();", "private void extendedSize(){\n setSize(600,400);\n }", "public void updateSize() {\n\t\tint mpVis = (csub.isMorePanelVisible()) ? 1 : 0;\n\t\tint csubAwake = (csub.isAwake()) ? 1 : 0;\n\t\t\n\t\tint height = csubAwake * (CSub.INTERFACE_PANEL_HEIGHT + mpVis * CSub.MORE_PANEL_HEIGHT);\n\t\t\n\t\tsetPreferredSize(new Dimension(csub.getWidth() - 2 * CSub.RESIZE_BORDER_WIDTH, height));\n\t\tsetSize(new Dimension(csub.getWidth() - 2 * CSub.RESIZE_BORDER_WIDTH, height));\n\t}", "@Override\n\tpublic Dimension getSize() \n\t{\n\t\treturn panel.getSize();\n\t}", "public void settings() {\r\n size(WIDTH, HEIGHT); // Set size of screen\r\n }", "private void setGuiSizeToWorldSize() {\n worldPanel.setPreferredSize(new Dimension(worldPanel.getWorld()\n .getWidth(), worldPanel.getWorld().getHeight()));\n worldPanel.setSize(new Dimension(worldPanel.getWorld().getWidth(),\n worldPanel.getWorld().getHeight()));\n this.getParentFrame().pack();\n }", "public void setSizePlayingFields()\r\n {\n setPreferredSize(new Dimension(109*8,72*8));//powieżchnia o 2 m z każdej strony większa niz boisko 106 i 69 pomnożone o 8\r\n //większe boisko żeby było widać\r\n setMaximumSize(getMaximumSize());\r\n setBackground(Color.green);\r\n }", "void setSize(Dimension size);", "private void customize() {\r\n panel.setSize(new Dimension(width, height));\r\n panel.setLayout(new BorderLayout());\r\n }", "@Before\n public void setDimension() {\n this.view.setDimension(new Dimension(WITDH, HEIGHT));\n }", "public void settings() { size(1200, 800); }", "protected abstract void setSize();", "public void settings() {\r\n size(750, 550);\r\n }", "public void setfixedSize(){\n this.setPreferredSize( new Dimension( PANELWIDTH,0) );\n this.setMaximumSize( new Dimension( PANELWIDTH,0) );\n this.setMinimumSize( new Dimension( PANELWIDTH,0) );\n }", "public void resize() {\n\t\tsp.doLayout();\n\t}", "private void setGridSize() {\n int width = Math.max(boardView.windowWidth(), buttonPanel.getWidth());\n\n int height = points.getHeight() + boardView.windowHeight() + buttonPanel.getHeight();\n\n setSize(width, height);\n }", "public void setSize(float width, float height);", "private void settings() {\n\t\tthis.setVisible(true);\n\t\tthis.setSize(800,200);\n\t}", "@Override\n public void componentResized(ComponentEvent e) {\n window.setShape(new Ellipse2D.Double(0, 0, window.getWidth(), window.getHeight()));\n window.add(panel);\n window.setLocation((screenSize.width - window.getSize().width) / 2, (screenSize.height - window.getSize().height) / 2);\n window.setVisible(true);\n }", "public void setFrameSize();", "private void setCorrectSize() {\n double newHeight = this.getContentPane().getPreferredSize().getHeight() +\n this.getContentPane().getPreferredSize().getHeight()/10 * 7;\n int newHeightInt = (int)Math.round(newHeight);\n \n this.setSize(this.getWidth(),newHeightInt);\n }", "public void setSize( Point size ) {\n checkWidget();\n if ( size == null )\n error( SWT.ERROR_NULL_ARGUMENT );\n setSize( size.x, size.y );\n }", "public MazePanel(int size) \r\n\t{\r\n\t\tthis.size = size;\r\n\t\tthis.setPreferredSize( getSize() );\r\n\t\tReset ( );\r\n\t}", "protected void adjustSize() {\r\n fieldDim = mineField.getSquareLength() * mineField.getFieldLength();\r\n setSize( fieldDim + X_BORDER * 2, fieldDim + Y_BORDER * 3 );\r\n validate();\r\n }", "@Override\n public void settings(){\n size(500, 500);\n }", "public void setPreferredSize( Point size ) {\n checkWidget();\n if ( size == null )\n error( SWT.ERROR_NULL_ARGUMENT );\n setPreferredSize( size.x, size.y );\n }", "@Override\n public Dimension getPreferredSize() {\n return new Dimension(PANEL_SIZE, PANEL_SIZE);\n }", "protected void resizePanel() {\n\t\tif (drawingAreaIsBlank) { // may have become blank after deleting the last node manually, so panel must still be shrunk\n\t\t\tsetPreferredSize(new Dimension(0,0)); // put back to small size so scrollbars disappear\n\t\t\trevalidate();\n\t\t\treturn;\n\t\t}\n\t\tgetMaxMin(); // get the extent of the tree to the left, right, bottom\n\t\tsetPreferredSize(new Dimension(maxX, maxY));\n\t\trevalidate();\n\t}", "public void componentResized(ComponentEvent e) {\n\t\t\t\t\n\t\t\t\tDimension size = e.getComponent().getSize();\n\t\t\t\tint infoWidth = 200;\n\t\t\t\tint tabPaneWidth = 200;\n\t\t\t\tint padY = 80;\n\t\t\t\tint padX = 40;\n\t\t\t\tint canvasWidth = (int) (size.width - padX - infoWidth - tabPaneWidth);\n\t\t\t\tint canvasHeight = (int) (size.height - padY);\n\t\t\t\tcanvas.setSize(canvasWidth, canvasHeight);\n\t\t\t\twindow.setSize(canvasWidth, canvasHeight);\n\t\t\t\tinfoPanel.setSize(infoWidth, canvasHeight); \n\t\t\t\t\n\t\t\t\tint tabPadX = 10;\n\t\t\t\tint tabPadY = 30;\n\t\t\t\ttabbedPane.setSize(tabPaneWidth, canvasHeight);\n\t\t\t\texplorerPanel.setSize(tabPaneWidth-tabPadX, canvasHeight-tabPadY);\n\t\t\t\tplanPanel.setSize(tabPaneWidth-tabPadX, canvasHeight-tabPadY);\n\t\t\t\tcanvas.revalidate();\n\t\t\t}", "protected void setSize(Dimension dim) {}", "public void initSize() {\n WIDTH = 320;\n //WIDTH = 640;\n HEIGHT = 240;\n //HEIGHT = 480;\n SCALE = 2;\n //SCALE = 1;\n }", "private void setUpPanel() {\n this.panel = new JPanel();\n functions = new JPanel();\n panel.setPreferredSize(new Dimension(Screen.screenWidth, Screen.screenHeight));\n\n int borderBottom = Screen.screenHeight / 8;\n if (Screen.screenHeight > 1400) {\n borderBottom = Screen.screenHeight / 7;\n }\n\n panel.setBorder(BorderFactory.createEmptyBorder(80, Screen.border, borderBottom, Screen.border));\n panel.setLayout(new BoxLayout(panel, BoxLayout.Y_AXIS));\n functions.setPreferredSize(new Dimension(600, 500));\n functions.setLayout(cardLayout);\n }", "public void settings() {\r\n\t\tthis.size(PlayGame.WIDTH,PlayGame.HEIGHT);\r\n\t}", "public void setPanels() {\n\t\tframe.setPreferredSize(new Dimension(3000, 2000));\n\n\t\tcontainer.setBackground(lightGray);\n\t\tcontainer.setPreferredSize(new Dimension(2300, 120));\n\t\tcontainer.setBorder(BorderFactory.createLineBorder(black));\n\n\t\tagePanel.setBackground(lightGray);\n\t\tagePanel.setPreferredSize(new Dimension(2400, 120));\n\t\tagePanel.setBorder(BorderFactory.createLineBorder(black));\n\n\t\theightPanel.setBackground(lightGray);\n\t\theightPanel.setPreferredSize(new Dimension(1200, 120));\n\t\theightPanel.setBorder(BorderFactory.createLineBorder(black));\n\n\t\tweightPanel.setBackground(lightGray);\n\t\tweightPanel.setPreferredSize(new Dimension(850, 120));\n\t\tweightPanel.setBorder(BorderFactory.createLineBorder(black));\n\n\t\thairPanel.setBackground(lightGray);\n\t\thairPanel.setPreferredSize(new Dimension(900, 120));\n\t\thairPanel.setBorder(BorderFactory.createLineBorder(black));\n\n\t\teyePanel.setBackground(lightGray);\n\t\teyePanel.setPreferredSize(new Dimension(900, 120));\n\t\teyePanel.setBorder(BorderFactory.createLineBorder(black));\n\n\t\tabilitySelectionPanel.setBackground(lightGray);\n\t\tabilitySelectionPanel.setPreferredSize(new Dimension(2400, 120));\n\t\tabilitySelectionPanel.setBorder(BorderFactory.createLineBorder(black));\n\n\t\tphysicalAbilityPanel.setBackground(lightGray);\n\t\tphysicalAbilityPanel.setPreferredSize(new Dimension(2400, 400));\n\t\tphysicalAbilityPanel.setBorder(BorderFactory.createLineBorder(black));\n\n\t\tmentalAbilityPanel.setBackground(lightGray);\n\t\tmentalAbilityPanel.setPreferredSize(new Dimension(2400, 400));\n\t\tmentalAbilityPanel.setBorder(BorderFactory.createLineBorder(black));\n\t}", "public void adjustSize() {\r\n /*\r\n * Calculate target width: max of header, adjusted window, content\r\n * \r\n * TODO: restrict to available desktop space\r\n */\r\n int targetWidth = TOTAL_BORDER_THICKNESS\r\n + MathUtils.maxInt(headerBar.getOffsetWidth(),\r\n contentWidget.getOffsetWidth(), getWidth()\r\n - TOTAL_BORDER_THICKNESS);\r\n /*\r\n * Calculate target height: max of adjusted window, content\r\n * \r\n * TODO: restrict to available desktop space\r\n */\r\n int targetHeight = TOTAL_BORDER_THICKNESS\r\n + MathUtils.maxInt(contentWidget.getOffsetHeight(), getHeight()\r\n - TOTAL_BORDER_THICKNESS - headerBar.getOffsetHeight());\r\n\r\n setPixelSize(targetWidth, targetHeight);\r\n }", "void setSize(float w, float h) {\n _w = w;\n _h = h;\n }", "public void setSize(int size);", "protected void doResize() {\r\n\t\tif (renderer.surface == null) {\r\n\t\t\tdoNew();\r\n\t\t\treturn;\r\n\t\t}\r\n\t\tNewResizeDialog dlg = new NewResizeDialog(labels, false);\r\n\t\tdlg.widthText.setText(\"\" + renderer.surface.width);\r\n\t\tdlg.heightText.setText(\"\" + renderer.surface.height);\r\n\t\tdlg.setLocationRelativeTo(this);\r\n\t\tdlg.setVisible(true);\r\n\t\tif (dlg.success) {\r\n\t\t\trenderer.surface.width = dlg.width;\r\n\t\t\trenderer.surface.height = dlg.height;\r\n\t\t\trenderer.surface.computeRenderingLocations();\r\n\t\t}\r\n\t}", "public void setSize(Dimension size) {\r\n this.size = size;\r\n }", "@Override\n public void settings() {\n size(800, 800, P3D);\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 }", "public void setSize(Vector2ic size){\n glfwSetWindowSize(handle, size.x(), size.y());\n this.size.set(size);\n sizeMultiplexer.handle(new WindowSizeEvent(handle, size.x(), size.y()));\n }", "public abstract void setSize(Dimension d);", "@Override\n\tpublic void settings() {\n\t\tSystem.out.println(\"settings\");\n\t\tsize(800, 800);\n\t}", "private void actionModifySize() {\n CSizePanel csizePanel = new CSizePanel(layoutPanel.getLayoutSize(),\n false);\n int result = JOptionPane.showConfirmDialog(this, csizePanel,\n \"Modify layout size\", JOptionPane.OK_CANCEL_OPTION);\n if (result == JOptionPane.OK_OPTION) { // Afirmative\n try {\n int sizeX = Integer\n .parseInt(csizePanel.tfields[CSizePanel.idxX].getText());\n int sizeY = Integer\n .parseInt(csizePanel.tfields[CSizePanel.idxY].getText());\n if (sizeX >= LayoutPanel.minXCells\n && sizeX <= LayoutPanel.maxXCells\n && sizeY >= LayoutPanel.minYCells\n && sizeY <= LayoutPanel.maxYCells) {\n RepType rtype = RepType.CLEAR;\n if (csizePanel.newButton.isSelected()) {\n rtype = RepType.CLEAR;\n } else if (csizePanel.rptButton.isSelected()) {\n rtype = RepType.REPEAT;\n } else if (csizePanel.altButton.isSelected()) {\n rtype = RepType.ALT;\n }\n\n changeLayoutSize(new Dimension(sizeX, sizeY), rtype);\n } else {\n JOptionPane.showMessageDialog(null,\n \"Size x must be between \" + LayoutPanel.minXCells\n + \" and \" + LayoutPanel.maxXCells\n + \", or size y must be between \"\n + LayoutPanel.minYCells + \" and \"\n + LayoutPanel.maxYCells + \".\");\n }\n } catch (NumberFormatException ne) {\n JOptionPane.showMessageDialog(null, \"Invalid number.\");\n }\n }\n }", "public void resize_screen(){\r\n \tstop_scn_updates();\r\n \tscn_font_size = min_font_size+1;\r\n \twhile (scn_font_size < max_font_size){\r\n \t\tscn_font = new Font(tz390.z390_font,Font.BOLD,scn_font_size);\r\n \t\tcalc_screen_size();\r\n \t\tif (scn_image.getWidth() < main_panel_width\r\n \t\t\t&& scn_image.getHeight() < main_panel_height){\r\n \t\t\tscn_font_size++;\r\n \t\t} else {\r\n \t\t scn_font_size--;\r\n \t\t break;\r\n \t\t}\r\n \t} \t\r\n \tscn_font = new Font(tz390.z390_font,Font.BOLD,scn_font_size);\r\n \tcalc_screen_size();\r\n start_scn_updates();\r\n }", "private void configurePanel(ContentPanel panel){\r\n\t\t\t\tpanel.setSize(325, 185);\t\t\t\t\r\n\t\t\t\tpanel.setHeaderVisible(false);\r\n\t\t\t\tpanel.setBodyStyle(\"padding:7px\");\r\n\t\t\t\tpanel.setScrollMode(Scroll.AUTOY);\r\n\t\t\t\tpanel.setStyleAttribute(\"marginTop\", \"15px\");\r\n\t\t\t}", "public MySWsDecoderSizesAutoLayoutTests() {\n initComponents();\n \n \n }", "public FrmMenuAdmin() {\n initComponents(); \n \n this.setExtendedState(FrmMenuAdmin.MAXIMIZED_BOTH);\n jDesktopPane1.setMaximumSize(this.getMaximumSize()); \n //tester();\n \n Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize();\n width = (int) screenSize.getWidth();\n height = (int) screenSize.getHeight(); \n this.setSize((int)width,(int)height);\n this.setExtendedState(FrmMenuAdmin.MAXIMIZED_BOTH); \n }", "@Override\n public void resize(int width, int height) {game.screenPort.update(width, height, true);}", "@Override\r\npublic void componentResized(ComponentEvent arg0) {\n\tsetSizeBackgr(getSize());\r\n\tsetSizeHat (getSize());\r\n\tsetSizeGift(getSize());\r\n}", "public void setSize(double aWidth, double aHeight) { setWidth(aWidth); setHeight(aHeight); }", "public void changeSize()\n {\n //if mouse is on the play button, make it bigger\n if(Greenfoot.mouseMoved(this))\n setImage(\"play button bigger.png\");\n //if mouse is on the background, return play button to regular size\n else if(Greenfoot.mouseMoved(getWorld()))\n setImage(\"play button.png\");\n }", "@Override\n\tpublic Dimension getPreferredSize()\n\t{\n\t\treturn new Dimension(PANEL_WIDTH, PANEL_HEIGHT);\n\t}", "public void setSize( int width, int height ) {\n checkWidget();\n int newHeight = height;\n int newWidth = width;\n Point point = parent.fixPoint( newWidth, newHeight );\n newWidth = Math.max( point.x, minimumWidth + MINIMUM_WIDTH );\n newHeight = Math.max( point.y, 0 );\n if ( !ideal ) {\n preferredWidth = newWidth;\n preferredHeight = newHeight;\n }\n itemBounds.width = requestedWidth = newWidth;\n itemBounds.height = newHeight;\n if ( control != null ) {\n int controlWidth = newWidth - MINIMUM_WIDTH;\n if ( (style & SWT.DROP_DOWN) != 0 && newWidth < preferredWidth ) {\n controlWidth -= CHEVRON_IMAGE_WIDTH + CHEVRON_HORIZONTAL_TRIM\n + CHEVRON_LEFT_MARGIN;\n }\n control.setSize( parent.fixPoint( controlWidth, newHeight ) );\n }\n parent.relayout();\n updateChevron();\n }", "void setDimension(double width, double height);", "public void init() {\n\t\tsetSize(500,300);\n\t}", "@Override\n protected void sizeChanged () {\n }", "public void showRectangleSizeSetup() {\n sizeArea.removeAllViewsInLayout();\n sizeArea.addView(heightEdit);\n sizeArea.addView(widthEdit);\n }", "private void inputGridSize() {\n \ttest = new TextField();\n \ttest.setPrefSize(BUTTON_SIZE, TEXT_INPUT_BAR_HEIGHT);\n \tstartScreen.add(test, 2, 2);\n }", "private void initialize() {\r\n this.setSize(new Dimension(666, 723));\r\n this.setContentPane(getJPanel());\r\n\t\t\t\r\n\t}", "@SuppressWarnings(\"UnnecessaryBoxing\")\r\n private void initLayoutDimensions() {\r\n leftPanelWidth = Page.getScreenWidth() * 20 / 100;\r\n leftPanelHeight = Page.getScreenHeight() - 225;\r\n middlePanelWidth = Page.getScreenWidth() / 2;\r\n if (Double.valueOf(middlePanelWidth) % 2.0 > 0.0) {\r\n middlePanelWidth = middlePanelWidth - 1;\r\n }\r\n rightPanelWidth = Page.getScreenWidth() - (leftPanelWidth + 2 + middlePanelWidth + 2);\r\n }", "public void componentResized(ComponentEvent e)\n/* 410: */ {\n/* 411:478 */ TileGIS.this.mapPanel.setSize(TileGIS.this.placeholder.getJComponent().getSize());\n/* 412: */ }", "public void setSizeModifier(Dimension size) {\n\t\tthis.size = size;\n\t}", "public abstract void windowResized();", "public void setSize(int w, int h) {\n\n\t}", "public void setSize(Dimension comp_dim){\n\t\tswingComponent.setSize(comp_dim);\n\t}", "@Override\n\tpublic Dimension getPreferredSize() {\n\t\treturn new Dimension(800,600);\n\t}", "public void setPreferredSize( int width, int height ) {\n checkWidget();\n ideal = true;\n Point point = parent.fixPoint( width, height );\n preferredWidth = Math.max( point.x, MINIMUM_WIDTH );\n preferredHeight = point.y;\n }", "@Override\n\tpublic void setResolution(Dimension size) {\n\n\t}", "void setWidthHeight() {\n\t\tsetWidthHeight(getNcols() * grid().gridW, getNvisibleRows() * grid().gridH);\n\t}", "public void setSize(RMSize aSize) { setSize(aSize.width, aSize.height); }", "private void cbxSizeActionPerformed(java.awt.event.ActionEvent evt) {\n\n String size = (String) cbxSize.getSelectedItem();\n if (size.contains(\"4\")) {\n panelSize = 4;\n } else if (size.contains(\"5\")) {\n panelSize = 5;\n } else {\n panelSize = 3;\n }\n initPanel();\n }", "public void ResizeActionPerformed(ActionEvent evt){\r\n int w = Integer.parseInt(imageWidth.getText());\r\n int h = Integer.parseInt(imageHeight.getText());\r\n drawingPanel.setImageSize(w, h);\r\n }", "public void setScale() {\n Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize();\n scaleAffine();\n Scalebar.putZoomLevelDistances();\n\n //Set up the JFrame using the monitors resolution.\n setSize(screenSize); //screenSize\n setPreferredSize(new Dimension(800, 600)); //screenSize\n setExtendedState(Frame.NORMAL); //Frame.MAXIMIZED_BOTH\n }", "@Override\n\tprotected void changeSize(int x, int y, int previousX, int previousY) {\n this.setWidth(this.getWidth()+(x-previousX));\n this.setHeight(this.getHeight()+(y-previousY));\n this.setX(this.getX()+(x-previousX));\n\t}", "@Override\n public void onSizeChanged(int w, int h, int oldW, int oldH) {\n // Set the movement bounds for the ballParent\n box.set(0, 0, w, h);\n }", "void setPaperSize(short size);", "@Override\n public void setupPanel()\n {\n\n }", "private void init(){\r\n\t\tsetLayout(new FlowLayout());\r\n\t\tsetPreferredSize(new Dimension(40,40));\r\n\t\tsetVisible(true);\r\n\t}", "private void changeLayoutSize(Dimension newSize, RepType rtype) {\n layoutPanel.inhNList = repPattern(newSize, layoutPanel.inhNList, rtype);\n layoutPanel.activeNList = repPattern(newSize, layoutPanel.activeNList,\n rtype);\n layoutPanel.probedNList = repPattern(newSize, layoutPanel.activeNList,\n rtype);\n\n layoutPanel.changeLayoutSize(newSize);\n }", "@Override\n\tpublic Dimension getPreferredSize(){\n\t\treturn new Dimension(640, 480);\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 Dimension getPreferredSize(){\n return new Dimension(400,350);\n }", "public void size(final int theWidth, final int theHeight);", "public void configure(T aView) { aView.setPrefSize(110,20); }", "private void updateDimensions() {\r\n width = gui.getWidth();\r\n height = gui.getHeight();\r\n yLabelsMargin = (int) gui.getLabelWidth(Integer.toString(((int) maximumDB / 10) * 10), true) + 2;\r\n if (track != null)\r\n scaleXpx = ((float) width - yLabelsMargin) / track.getBufferCapacity();\r\n else\r\n scaleXpx = 1;\r\n scaleYpx = (float) ((height - 1) / (maximumDB - minimumDB));\r\n if (scaleYpx == 0)\r\n scaleYpx = 1;\r\n }", "public void settings() {\n size(640, 384);\n }", "@Override\r\n\tprotected void onSizeChanged(int w, int h, int oldw, int oldh) {\n\t\tsuper.onSizeChanged(w, h, oldw, oldh);\r\n\t\tif (w > 0 && h > 0) {\r\n\t\t\tcontainerWidth = w;\r\n\t\t\tcontainerHeight = h;\r\n\t\t}\r\n\t}", "public void setSize(int newSize);", "public void setSize(int newSize);", "public void resizeCanvas(int w, int h) {\n this.setPreferredSize(new Dimension(w,h));\n revalidate();\n}", "public void componentResized(ComponentEvent e) {\n notifyViewportListeners(getXOrigin(), getYOrigin(), panelWidth, panelHeight);\n }", "public void setLocationAndSize()\n {\n\t welcome.setBounds(150,50,200,30);\n\t amountLabel.setBounds(50,100,150,30);\n\t amountText.setBounds(200,100,150,30);\n\t depositButton.setBounds(150,150,100,30);\n \n \n }", "private void setupPanels() {\n\t\tsplitPanel.addEast(east, Window.getClientWidth() / 5);\n\t\tsplitPanel.add(battleMatCanvasPanel);\n\t\tpanelsSetup = true;\n\t}", "private void changeSize(float omegaDeg) {\n\n setSize(resolutionIntoWorldUnits(currentRegion.getRegionWidth(), WORLD_SIZE, 1080),\n resolutionIntoWorldUnits(currentRegion.getRegionHeight(), WORLD_SIZE, 1080)); // Change 1080 based on the targetResolution of the shields' own targetResolution.\n //Gdx.app.log(TAG, \"After = (\" + getWidth() + \", \" + getHeight() + \")\");\n\n float theTipOfTheShield = SHIELDS_RADIUS + (SHIELDS_RADIUS - SHIELDS_INNER_RADIUS);\n /*setY(theTipOfTheShield - getHeight());\n setX(getWidth()/2f);*/\n setX(theTipOfTheShield - getWidth());\n setY(-getHeight()/2f);\n\n setOrigin(-getX(), -getY());\n setRotation(90);\n }", "public Dimension getPreferredSize() {\n Dimension size = super.getPreferredSize();\n size.width += extraWindowWidth;\n return size;\n }", "@Override\n public void componentResized(ComponentEvent componentEvent) {\n ControlFrame.this.pack();\n }" ]
[ "0.7529072", "0.7354276", "0.7321035", "0.7320598", "0.72673875", "0.722796", "0.72113395", "0.7182685", "0.7151642", "0.7140505", "0.7127763", "0.7094293", "0.7084563", "0.7047757", "0.70332223", "0.69872713", "0.6951867", "0.689219", "0.68078905", "0.67811227", "0.67317015", "0.6727619", "0.67231804", "0.67185783", "0.66933846", "0.6677988", "0.6669103", "0.66678756", "0.6654142", "0.664937", "0.66422373", "0.6638006", "0.6637951", "0.6627934", "0.66203326", "0.66114295", "0.6608412", "0.6595886", "0.6593615", "0.6591993", "0.65793484", "0.6578509", "0.65615636", "0.65613806", "0.6559781", "0.65506756", "0.6541858", "0.6532839", "0.6531822", "0.65303624", "0.65252346", "0.65245837", "0.6515328", "0.6498053", "0.64956707", "0.6493063", "0.64783007", "0.6473952", "0.6458515", "0.6457835", "0.6441771", "0.64339364", "0.6433386", "0.6428193", "0.6415174", "0.64045465", "0.6402013", "0.6401562", "0.6398145", "0.6397725", "0.6386723", "0.6376364", "0.6372821", "0.6362354", "0.63358396", "0.6333683", "0.633246", "0.6331646", "0.63299596", "0.63188726", "0.6315539", "0.6310906", "0.63024086", "0.63002205", "0.62969655", "0.6293826", "0.6293364", "0.62920654", "0.6286447", "0.62782943", "0.627174", "0.62711483", "0.62711483", "0.62699735", "0.6263333", "0.6258172", "0.6256201", "0.6254789", "0.6249496", "0.62475294" ]
0.62642926
94
Get whether the client wants to close the panel
boolean isCloseRequested() { return this.closeRequested; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "boolean isCloseButtonDisplayed();", "public boolean requestCloseWindow() \n {\n return true; \n }", "public boolean isCloseRequested(){\n return glfwWindowShouldClose(handle);\n }", "public boolean canClose(){\n return true;\n }", "private final void closePanel() {\r\n\r\n\t\tthis.pnlMain.getRootPane().getParent().setVisible(false);\r\n\t\t\r\n\t}", "public static void closeBtnPressed () {\r\n PCNMClientStart.switchPanels(new NetMapSCR());\r\n }", "public boolean getUnselectedCloseVisible() {\n checkWidget();\n return showUnselectedClose;\n }", "public boolean onClose() {\n\t\topenScreen(new Noticias());\n\t\treturn true ;\n\t}", "public boolean isDisplayed_click_CloseModal_Button(){\r\n\t\tif(click_CloseModal_Button.isDisplayed()) { return true; } else { return false;} \r\n\t}", "public HasClickHandlers getCloseButton() {\n\t\treturn null;\r\n\t}", "public boolean isEnabled_click_CloseModal_Button(){\r\n\t\tif(click_CloseModal_Button.isEnabled()) { return true; } else { return false;} \r\n\t}", "void close() {\n boolean closeable = true;\n if (progressPanel.getStatus() != ReportStatus.CANCELED && progressPanel.getStatus() != ReportStatus.COMPLETE && progressPanel.getStatus() != ReportStatus.ERROR) {\n closeable = false;\n }\n if (closeable) {\n actionListener.actionPerformed(null);\n } else {\n int result = JOptionPane.showConfirmDialog(this,\n NbBundle.getMessage(this.getClass(),\n \"ReportGenerationPanel.confDlg.sureToClose.msg\"),\n NbBundle.getMessage(this.getClass(),\n \"ReportGenerationPanel.confDlg.title.closing\"),\n JOptionPane.YES_NO_OPTION);\n if (result == 0) {\n progressPanel.cancel();\n actionListener.actionPerformed(null);\n }\n }\n }", "public void close()\n {\n setVisible (false);\n dispose();\n }", "protected void closeDialog() { setVisible(false); dispose(); }", "protected boolean hasModalWindow() {\n return false;\n }", "public boolean onClose() {\n\t\t\n\t\t TransitionContext transition = new TransitionContext(TransitionContext.TRANSITION_SLIDE);\n\t transition.setIntAttribute(TransitionContext.ATTR_DURATION, 200);\n\t transition.setIntAttribute(TransitionContext.ATTR_DIRECTION, TransitionContext.DIRECTION_RIGHT);\n\t transition.setIntAttribute(TransitionContext.ATTR_STYLE, TransitionContext.STYLE_PUSH);\n\t \n\t UiEngineInstance engine = Ui.getUiEngineInstance();\n\t engine.setTransition(this, null, UiEngineInstance.TRIGGER_PUSH, transition);\n\t // openScreen(new Menu());\n\t\treturn true;\n\t}", "private void closeDialog(java.awt.event.WindowEvent evt) {//GEN-FIRST:event_closeDialog\n setVisible(false); \n actionCommand = false;\n dispose();\n }", "public abstract void windowClose(CloseEvent e);", "public boolean checkAutoClose();", "public boolean getCloseOnClickOutside() {\n\t\treturn closeOnClickOutside;\n\t}", "public boolean isCloseOnFocusLoss ()\n {\n return closeOnFocusLoss;\n }", "@Override\n public void windowClosing(java.awt.event.WindowEvent e) {\n setVisible(false);\n }", "public boolean doClose() {\n\n if (canChangeDocuments()) {\n setVisible(false);\n dispose();\n fApplication.removeDocumentWindow(this);\n return true;\n }\n else {\n return false;\n }\n }", "public void closeWindow() {\n\t\tframeUnableToBuyPopup.dispose();\n\t}", "@Override\n public void windowClosing(WindowEvent e) {\n getTextArea().append(\"Hide log via window button\\n\");\n setVisible(false);\n }", "public static boolean isWindowClosed() {\n\t\treturn windowClosed;\n\t}", "public void windowClosing(WindowEvent e)\r\n {\n if(panel.hasActiveDownloads())\r\n {\r\n int choice = JOptionPane.showConfirmDialog(frameInstance, \"Cancel all active downloads?\",\r\n \"Active downloads\", JOptionPane.OK_CANCEL_OPTION, JOptionPane.QUESTION_MESSAGE);\r\n if (choice == JOptionPane.CANCEL_OPTION)\r\n return;\r\n\r\n // Cancel active downloads and clear the monitor panel\r\n panel.cancelActiveDownloads();\r\n panel.clearInactiveDownloads();\r\n }\r\n // Clear sector selector\r\n panel.clearSector();\r\n // Close now\r\n setVisible(false);\r\n }", "@Override\n public void closeWindow() {\n \n }", "boolean isPopUpOpened();", "private void closeDialog(java.awt.event.WindowEvent evt)//GEN-FIRST:event_closeDialog\r\n {\r\n setVisible(false);\r\n }", "void windowClosed();", "public void onClickCancel()\n\t{\n\t\tsetVisible(false);\n\t\tdispose();\t\n\t}", "public void close() {\n closePopup();\n }", "@Override\n\tpublic void windowClose(CloseEvent e) {\n\t\t\n\t}", "@Override\n public boolean canClose() {\n if (!isRunningSession()) {\n return true;\n } else {\n // Running. Abort?\n boolean canClose = false;\n NotifyDescriptor descriptor\n = new NotifyDescriptor(\n NbBundle.getMessage(SessionTopComponent.class,\n \"MSG_CloseRunningSession\",\n session.getName()),\n \"Arkade\",\n NotifyDescriptor.YES_NO_CANCEL_OPTION,\n NotifyDescriptor.WARNING_MESSAGE,\n SessionTopComponent.YES_NO_OPTIONS,\n SessionTopComponent.YES_NO_OPTIONS[1]);\n Object notifyValue\n = DialogDisplayer.getDefault().notify(descriptor);\n if (descriptor.getValue().equals(\n SessionTopComponent.YES_NO_OPTIONS[0])) {\n // Yes\n // Can close session\n canClose = true;\n }\n return canClose;\n }\n }", "public boolean onCloseButtonClicked(AjaxRequestTarget target) {\n return true;\r\n }", "void close() {\r\n this.setVisible(false);\r\n this.dispose();\r\n }", "public void closeContainer(){\n\t\tElement containerPanel = nifty.getScreen(\"hud\").findElementByName(\"ContainerPanel\");\n\t\tcontainerPanel.setVisible(false);\n\t\tif (openContainer == null) throw new AssertionError(\"Trying to close a container that is not open\");\n\t\tscreenManager.getInventoryManager().hideContainer(((AbstractContainerItem)openContainer).getContainerInventory());\n\t\topenContainer = null;\n\t}", "public boolean hideClosedPorts(){\n return hideClosedP.isSelected();\n }", "public boolean isSelected_click_CloseModal_Button(){\r\n\t\tif(click_CloseModal_Button.isSelected()) { return true; } else { return false;} \r\n\t}", "private void closeDialog(java.awt.event.WindowEvent evt) {//GEN-FIRST:event_closeDialog\r\n setVisible(false);\r\n setVisible(false);\r\n }", "public void closeDialog(java.awt.event.WindowEvent evt) {\n setVisible(false);\n dispose();\n }", "private void closeButtonActionPerformed(java.awt.event.ActionEvent evt) {\n\t\tsetVisible(false);\n\t}", "private void closeDialog(java.awt.event.WindowEvent evt) {//GEN-FIRST:event_closeDialog\n setVisible (false);\n dispose ();\n }", "public boolean canDismissWithTouchOutside() {\n return this.cameraOpened ^ 1;\n }", "private void closeDialog(java.awt.event.WindowEvent evt) {//GEN-FIRST:event_closeDialog\r\n setVisible(false);\r\n dispose();\r\n }", "@Override\r\n\tpublic void onPanelClosed(Panel panel) {\n\r\n\t}", "void implClose() {\n/* 293 */ enableControls(this.controls, false);\n/* */ }", "@Override\n public boolean isFinishPanel() {\n return false;\n }", "public void helpPaneClose(ActionEvent actionEvent) {\n darkPane.setDisable(true);\n darkPane.setVisible(false);\n helpPane.setDisable(true);\n helpPane.setVisible(false);\n }", "public void windowClosing(WindowEvent we) {\n \t\t\t\toptionPane.setValue(\"Close\");\n \t\t\t}", "@Override\n public void actionPerformed(ActionEvent e) {\n guiD.closeWindow(rootPanel);\n }", "private void openExitWindowConfirmation() {\n\t\t// int opcion = JOptionPane.showConfirmDialog(this, \"Desea salir del\n\t\t// Chat\", \"Confirmación\",\n\t\t// JOptionPane.YES_NO_OPTION);\n\t\t// if (opcion == JOptionPane.YES_OPTION) {\n\t\tthis.setVisible(false);\n\t\t// }\n\t}", "public boolean close() {\n\t\tpopupCloser.removeListeners();\n\t\tif (infoPopup != null) {\n\t\t\tinfoPopup.close();\n\t\t}\n\t\tboolean ret = super.close();\n\t\tadapter.notifyPopupClosed();\n\t\treturn ret;\n\t}", "private void closeDialog(java.awt.event.WindowEvent evt) {//GEN-FIRST:event_closeDialog\n setVisible(false);\n dispose();\n }", "private void closeDialog(java.awt.event.WindowEvent evt) {//GEN-FIRST:event_closeDialog\n setVisible(false);\n dispose();\n }", "private void closeDialog(java.awt.event.WindowEvent evt) {//GEN-FIRST:event_closeDialog\n setVisible(false);\n dispose();\n }", "private void closeDialog(java.awt.event.WindowEvent evt) {//GEN-FIRST:event_closeDialog\n setVisible(false);\n dispose();\n }", "private void closeDialog(java.awt.event.WindowEvent evt) {//GEN-FIRST:event_closeDialog\n setVisible(false);\n dispose();\n }", "boolean isIsClosable();", "public void actionPerformed(ActionEvent e) {\r\n if(ACTION_CLOSE.equals(e.getActionCommand())) {\r\n setVisible(false);\r\n dispose();\r\n }\r\n }", "private void closeProgram(){\n boolean answer = ConfirmBox.display(\"Title\", \"Sure you want to exit?\");\n if(answer==true){\n window.close();\n }\n }", "public void close() \r\n {\r\n ((GrantsByPIForm) getControlledUI()).setVisible(false);\r\n }", "interface PanelClosedKeys {\n /**\n * The user clicked the See More button linking deeper into Settings.\n */\n String KEY_SEE_MORE = \"see_more\";\n\n /**\n * The user clicked the Done button, closing the Panel.\n */\n String KEY_DONE = \"done\";\n\n /**\n * The user closed the panel by other ways, for example: clicked outside of dialog, tapping\n * on back button, etc.\n */\n String KEY_OTHERS = \"others\";\n }", "public boolean getClose()\n\t{\n\t\treturn getBooleanIOValue(\"Close\", true);\n\t}", "@Override\n public void windowClosing(WindowEvent e) {\n closeWindow();\n }", "@Override\n protected void close(boolean isEscaped)\n {\n if(isEscaped)\n {\n ChatPanel chatPanel = getCurrentChat();\n\n if(chatPanel == null\n || chatPanel.getChatConversationPanel() == null)\n return;\n\n ChatRightButtonMenu chatRightMenu\n = chatPanel.getChatConversationPanel().getRightButtonMenu();\n\n ChatWritePanel chatWritePanel = chatPanel.getChatWritePanel();\n WritePanelRightButtonMenu writePanelRightMenu\n = chatWritePanel.getRightButtonMenu();\n\n if (chatRightMenu.isVisible())\n {\n chatRightMenu.setVisible(false);\n }\n else if (writePanelRightMenu.isVisible())\n {\n writePanelRightMenu.setVisible(false);\n }\n else if ((menuBar.getSelectedMenu() != null)\n || mainToolBar.getSmileysBox()\n .getPopupMenu().isVisible())\n {\n MenuSelectionManager.defaultManager().clearSelectedPath();\n }\n else\n {\n GuiActivator\n .getUIService().getChatWindowManager().closeChat(chatPanel);\n }\n }\n else\n { \n if(ConfigurationUtils.isMultiChatWindowEnabled())\n {\n GuiActivator\n .getUIService().getChatWindowManager().closeAllChats(this, true);\n }\n else\n {\n ChatPanel chatPanel = getCurrentChat();\n \n if(chatPanel == null\n || chatPanel.getChatConversationPanel() == null)\n return;\n \n GuiActivator\n .getUIService().getChatWindowManager().closeChat(chatPanel);\n }\n }\n }", "@Override\n\tpublic void windowClosing(WindowEvent we) {\n\t\tif (we.getSource() == this) {\n\t\t\tdExit.setBounds(this.getX() + this.getWidth() / 2 - dExit_Width / 2,\n\t\t\t\tthis.getY() + this.getHeight() /2 - dExit_Height / 2,\n\t\t\t\tdExit_Width, dExit_Height);\n\t\t\tdExit.setVisible(true);\n\t\t}\n\t\telse if (we.getSource() == dColor) {\n\t\t\tdColor.setVisible(false);\n\t\t\t\n\t\t}\n\t\telse if (we.getSource() == dExit) {\n\t\t\tdExit.setVisible(false);\n\t\t}\n\t}", "public boolean validateSignOnShadeIsClosed(){\n return getBtnSignOn().isDisplayed();\n }", "private void close(){\n\t\tparent.setEnabled(true);\n\t\tparent.requestFocus();\n\t\tdispose();\n\t}", "public void dama_DamaCloseButtonListener() {\n this.buttonDisabled = false;\n }", "private void actionOnClicExit() {\r\n\t\tframe.setVisible(false);\r\n\t\tframe.dispose();\r\n\t}", "private void doClose() {\n\t if (parent==null)\n\t System.exit(0);\n\t else {\n setVisible(false);\n dispose();\n }\n\t}", "public void cancel() { Common.exitWindow(cancelBtn); }", "MenuItem getMenuItemClose();", "void onClose();", "protected boolean isAutoCloseEnabled() {\r\n\t\treturn false;\r\n\t}", "@Override\n public boolean canClose() {\n if (obj != null && obj.isModified()) {\n NotifyDescriptor.Confirmation mesg = new NotifyDescriptor.Confirmation(\"Scene has not been saved,\\ndo you want to save it?\",\n \"Not Saved\",\n NotifyDescriptor.YES_NO_CANCEL_OPTION);\n DialogDisplayer.getDefault().notify(mesg);\n if (mesg.getValue() == NotifyDescriptor.Confirmation.YES_OPTION) {\n try {\n obj.getCookie(SaveCookie.class).save();\n } catch (IOException ex) {\n Exceptions.printStackTrace(ex);\n }\n } else if (mesg.getValue() == NotifyDescriptor.Confirmation.CANCEL_OPTION) {\n return false;\n } else if (mesg.getValue() == NotifyDescriptor.Confirmation.NO_OPTION) {\n obj.setModified(false);\n return true;\n }\n }\n return true;\n }", "public void closeQuery (CPanel panel)\n\t{\n\t\tpanel.setVisible(false);\n\t\tf_checkout.setVisible(true);\n\t\tf_basicKeys.setVisible(true);\n\t\tf_lines.setVisible(true);\n\t\tf_functionKeys.setVisible(true);\n\t}", "public void close() {\n getCloseButton().click();\n }", "public Button getCloseButton() {\n\t\treturn closeButton;\n\t}", "public boolean isCancelButtonPresent() {\r\n\t\treturn isElementPresent(manageVehiclesSideBar.replace(\"Manage Vehicles\", \"Cancel\"), SHORTWAIT);\r\n\t}", "public void closeActionPerformed(java.awt.event.ActionEvent evt) {\n\t\t\n\t\tthis.dispose();\n\t\tgetJCpgUIReference().setEnabled(true);\n\t\t\n\t}", "protected void closeThis() {\n\t\tthis.setVisible(false);\n\t}", "private void close() {\n\t\t\t\t// name.getScene().getWindow().hide();\n\t\t\t\tdialogStage.fireEvent(new WindowEvent(dialogStage,WindowEvent.WINDOW_CLOSE_REQUEST));\n\t\t\t}", "public void windowClosing(WindowEvent e)\n {\n this.setVisible(false); /* hide frame which can be shown later */\n //e.getWindow().dispose();\n }", "public void clickOnCloseButton(){\n\t\tDynamicFramePage.dynamicFrameForPanchart();\n\t\tDynamicFramePage.switchtoFraFrame();\n\t\tSeleniumUtil.getElementWithFluentWait(panProfileCloseicon).click();\n\t}", "private void closeDialog(java.awt.event.WindowEvent evt) {//GEN-FIRST:event_closeDialog\r\n scheduleSelected = false;\r\n setVisible(false);\r\n dispose();\r\n }", "@Override\r\n\t\t\tpublic void windowClosing(WindowEvent e) {\r\n\t\t\t\tsetVisible(false);\r\n\t\t\t\tzamknij = true;\r\n\t\t\t\tdispose();\r\n\t\t\t\tSystem.exit(0);\r\n\t\t\t}", "@FXML\n protected void closeMsg() {\n messageContainer.setVisible(false);\n }", "public void windowClosed(WindowEvent e){}", "private void exitForm(java.awt.event.WindowEvent evt) {\n int aux = Funcoes.voltar(\"Deseja voltar ao menu de opções?\",\"SIM\",\"NÃO\");\n if (aux == 1){\n new MenuOpcoes().setVisible(true);\n this.dispose();\n }\n }", "public boolean isCancelled()\n\t{\n\t\treturn _buttonHit;\n\t}", "public abstract boolean isClosed();", "public void closeButtonPushed(ActionEvent actionEvent) {\n editTeamPane.setDisable(true);\n editTeamPane.setVisible(false);\n darkPane.setDisable(true);\n darkPane.setVisible(false);\n editTeamLogoFile = null;\n }", "@Override\n\t\t\tpublic void buttonClick(ClickEvent event) {\n\t\t\t\tclose();\n\t\t\t}", "void deactivatePopupContainer();", "@Override\n public void windowClosing(WindowEvent e) {\n synchronized(USER) {\n// USER[CANCELLED] = true;\n exit(1);\n }\n }", "@Override\n\tprotected void cmdCloseWidgetSelected() {\n\t\tcmdCloseSelected();\n\t}", "public boolean closeOnExit() {\n return false;\n }" ]
[ "0.7319708", "0.7162049", "0.6947274", "0.67296046", "0.67176443", "0.66816455", "0.66184133", "0.64981866", "0.6386431", "0.63696", "0.6331231", "0.6312606", "0.6296227", "0.6250629", "0.61881983", "0.6179918", "0.6175662", "0.6165656", "0.6164919", "0.6132484", "0.61087364", "0.6088998", "0.6080321", "0.60613656", "0.6045262", "0.6029303", "0.6013729", "0.6013526", "0.60096514", "0.6007515", "0.60026884", "0.5998203", "0.59849584", "0.5984167", "0.59825784", "0.5957249", "0.5956579", "0.5935044", "0.5924329", "0.592424", "0.5923048", "0.5917175", "0.591424", "0.5906065", "0.5904179", "0.5900617", "0.58967483", "0.58912385", "0.5885201", "0.5883449", "0.58769166", "0.5875463", "0.5872935", "0.5869659", "0.586417", "0.586417", "0.586417", "0.586417", "0.586417", "0.58635014", "0.58376235", "0.5833525", "0.5825474", "0.5822053", "0.5802397", "0.57903475", "0.5786613", "0.5782671", "0.5766839", "0.57638127", "0.57427055", "0.5737437", "0.57273656", "0.57260394", "0.5725851", "0.5711131", "0.5696293", "0.568886", "0.5682611", "0.5682446", "0.56743014", "0.56680363", "0.56655234", "0.5662872", "0.5658629", "0.5652079", "0.5650372", "0.5639585", "0.563879", "0.5638724", "0.56384224", "0.5637844", "0.5631085", "0.5627011", "0.56183255", "0.56144285", "0.56113577", "0.5605809", "0.56042403", "0.56030124" ]
0.62788445
13
Called after the screen is hidden
abstract void onHidden();
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void hideScreen() {\n\t}", "@Override\n\tpublic void hide() {\n\t\tGdx.app.log(\"GameScreen\", \"Hidden\");\n\n\t}", "@Override\n\tpublic void onHide (ScreenState mode) {\n\n\t}", "@Override\n\tpublic void onHide (ScreenState mode) {\n\n\t}", "@Override\n\tpublic void hide() {\n\t\tGdx.app.log(\"GameScreen\", \"hide called\"); \n\t}", "@Override\n public void wasHidden() {\n hide();\n }", "@Override\n public void hide() {\n mHandler.post(mHide);\n }", "private void finalScreen() {\r\n\t\tdisplay.setLegend(GAME_OVER);\r\n\t\tdisplay.removeKeyListener(this);\r\n\t}", "protected void hide() {\n fQuickAssistAssistantImpl.closeBox();\n }", "@Override\n\tpublic void onHide() {\n\n\t}", "@Override\n public final void onGuiClosed() {\n\t\tKeyboard.enableRepeatEvents(false);\n\t\t\n\t\tif(behindScreen != null) {\n\t\t\tTaleCraft.proxy.asClient().sheduleClientTickTask(new Runnable() {\n\t\t\t\t@Override public void run() {\n\t\t\t\t\tmc.displayGuiScreen(behindScreen);\n\t\t\t\t}\n\t\t\t});\n\t\t}\n\t\t\n }", "public void hide() {\n\t\thidden = true;\n\t}", "@Override\n\tpublic void hide() {\n\t\tdispose();\n\n\t}", "@Override\n\tpublic void onHideScene() {\n\t\t\n\t}", "private void hide() {\n\t}", "public void hide() {\n hidden = true;\n }", "@Override\r\n\tpublic void hide() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void hide() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void hide() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void hide() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void hide() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void hide() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void hide() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void hide() {\n\t\t\r\n\t}", "private void anullerAction()\r\n\t{\r\n\t\tthis.hide();\r\n\t}", "@Override\r\n\tpublic void hide() {\n\t\tthis.dispose();\r\n\t\t\r\n\t}", "@Override\n\tpublic void hide() {\n\t\tdispose();\n\t}", "@Override\r\n public void hide() {\r\n\r\n }", "@Override\r\n\tpublic void aboutToBeHidden() {\n\t\tsuper.aboutToBeHidden();\r\n\t}", "@Override\r\n public void onGameStart(){\r\n this.setVisible(false);\r\n }", "public void hide() {\n visible=false;\n }", "@Override\n\tpublic void dispose() { if(screen != null) screen.hide(); }", "@Override\n\tpublic void hide()\n\t{\n\n\t}", "@Override\n\tpublic void hide()\n\t{\n\n\t}", "public void finished() {\n this.setVisible(false);\n this.dispose();\n }", "@Override\n public void hide() {\n \n }", "public void hide() {\n\t\t\n\t\tfor(CustomScoreboardEntry entry : entries)\n\t\t\tentry.hide();\n\t\t\n\t\tthis.board.clearSlot(DisplaySlot.SIDEBAR);\n\t\t\n\t\tshown = false;\n\t}", "@Override\r\n public void hide() {\n }", "@Override\n\tpublic void hide() {\n\t\t\n\t}", "@Override\n\tpublic void hide() {\n\t\t\n\t}", "@Override\n\tpublic void hide() {\n\t\t\n\t}", "@Override\n\tpublic void hide() {\n\t\t\n\t}", "@Override\n\tpublic void hide() {\n\t\t\n\t}", "@Override\n\tpublic void hide() {\n\t\t\n\t}", "@Override\n\tpublic void hide() {\n\t\t\n\t}", "@Override\n\tpublic void hide() {\n\t\t\n\t}", "@Override\n\tpublic void hide() {\n\t\t\n\t}", "@Override\n\tpublic void hide() {\n\t\t\n\t}", "@Override\n\tpublic void hide() {\n\t\t\n\t}", "@Override\n\tpublic void hide() {\n\t\t\n\t}", "@Override\n\tpublic void hide() {\n\t\t\n\t}", "@Override\n\tpublic void hide() {\n\t\t\n\t}", "@Override\n\tpublic void hide() {\n\t\t\n\t}", "@Override\n\tpublic void hide() {\n\t\t\n\t}", "@Override\n\tpublic void hide() {\n\t\t\n\t}", "@Override\n\tpublic void hide() {\n\t\t\n\t}", "@Override\n\tpublic void hide() {\n\t\t\n\t}", "@Override\n\tpublic void hide() {\n\t\t\n\t}", "@Override\n\tpublic void hide() {\n\t\t\n\t}", "@Override\n\tpublic void hide() {\n\t\t\n\t}", "@Override\n public void onWebContentsLostFocus() {\n hide();\n }", "@Override\n public void hide() {\n\n }", "@Override\n public void hide() {\n\n }", "@Override\n public void hide() {\n\n }", "@Override\r\n\tpublic void hide() {\n\r\n\t}", "@Override\r\n\tpublic void hide() {\n\r\n\t}", "@Override\r\n\tpublic void hide() {\n\r\n\t}", "@Override\r\n\tpublic void hide() {\n\r\n\t}", "@Override\n\tpublic void hide() {\n\n\t}", "@Override\n\tpublic void hide() {\n\n\t}", "@Override\n\tpublic void hide() {\n\n\t}", "@Override\n\tpublic void hide() {\n\n\t}", "@Override\n\tpublic void hide() {\n\n\t}", "@Override\n\tpublic void hide() {\n\n\t}", "@Override\n\tpublic void hide() {\n\n\t}", "@Override\n\tpublic void hide() {\n\n\t}", "@Override\n\tpublic void hide() {\n\n\t}", "@Override\n\tpublic void hide() {\n\n\t}", "public void hide() {\n\t\t// Useless if called in outside animation loop\n\t\tactive = false;\n\t}", "@Override\n public void hide() {\n if (!unit.player.isPlayerDead) {\n MyPreference.setIsNewGame(false);\n saves.Save();\n }\n GameController.allFalse();\n dispose();\n }", "public void hide() {\n \t\tmContext.unregisterReceiver(mHUDController.mConfigChangeReceiver);\n \t\tmHighlighter.hide();\n \t\tmHUDController.hide();\n \t}", "@Override\r\n public void onGameEnded() {\r\n this.setVisible(true);\r\n }", "@Override\n\tpublic void hide() {\n\t}", "@Override\n\tpublic void hide() {\n\t}", "@Override\n\tpublic void hide() {\n\t}", "@Override\n\tpublic void hide() {\n\t}", "@Override\r\n public void hide() {\r\n dispose();\r\n }", "public void setHide()\n\t{\n\t\tMainController.getInstance().setVisible(name, false);\n\t}", "public void onDisplay() {\n\n\t}", "public void hideLoadingScreen() {\n setCursor(Cursor.getPredefinedCursor(Cursor.DEFAULT_CURSOR));\n getSelectGameScreenIfActive().ifPresent((gameScreen) -> gameScreen.setEnabled());\n }", "@Override\n public void postHideEt() {\n }", "void hide();", "public void leavepage() {\n this.setVisible(false);\n }", "void onFinishHiding();", "@Override\n\tpublic void onInvisible() {\n\n\t}", "public void hide() {\n super.hide();\n }", "@Override\n\tpublic void hide() {\n\t\thits.remove();\n\t\ttimeLeft.remove();\n\t\tdarken.remove();\n\t\tcontainer.remove();\n\t\ttimer = null;\n\t\ttrainingBag = null;\n\t}", "public void onGuiClosed()\n {\n Keyboard.enableRepeatEvents(false);\n mc.ingameGUI.func_50014_d();\n }", "protected abstract void onHideRuntime();", "@Override\n\t\t\tpublic void onPause() {\n\t\t\t\tsuper.onPause();\n\t\t\t\tisonshow=false;\n\n\t\t\t}" ]
[ "0.7591473", "0.7389779", "0.7382656", "0.7382656", "0.7350558", "0.72455174", "0.7221072", "0.7154431", "0.70584506", "0.70088094", "0.69937253", "0.69079506", "0.68653786", "0.68411356", "0.68268645", "0.68245316", "0.68228114", "0.68228114", "0.68228114", "0.68228114", "0.68228114", "0.68228114", "0.68228114", "0.68228114", "0.6817763", "0.68121016", "0.68103594", "0.6795806", "0.6782528", "0.677403", "0.6737612", "0.66933745", "0.66930985", "0.66930985", "0.66892546", "0.6688485", "0.6671104", "0.66593343", "0.6637847", "0.6637847", "0.6637847", "0.6637847", "0.6637847", "0.6637847", "0.6637847", "0.6637847", "0.6637847", "0.6637847", "0.6637847", "0.6637847", "0.6637847", "0.6637847", "0.6637847", "0.6637847", "0.6637847", "0.6637847", "0.6637847", "0.6637847", "0.6637847", "0.6637847", "0.6623493", "0.6622684", "0.6622684", "0.6622684", "0.6618819", "0.6618819", "0.6618819", "0.6618819", "0.6610939", "0.6610939", "0.6610939", "0.6610939", "0.6610939", "0.6610939", "0.6610939", "0.6610939", "0.6610939", "0.6610939", "0.66095424", "0.6603212", "0.6595523", "0.6570552", "0.6568182", "0.6568182", "0.6568182", "0.6568182", "0.65275455", "0.65176845", "0.65171176", "0.6516073", "0.65159416", "0.65089494", "0.6497944", "0.6493477", "0.64901066", "0.6483046", "0.64646345", "0.6433145", "0.6421185", "0.6410599" ]
0.66290766
60
Called when the panel is shown
abstract void onShown();
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\n\tpublic void shown() {\n\n\t}", "@Override\r\n\t\t\tpublic void componentShown(ComponentEvent e) {\n\t\t\t\t\r\n\t\t\t}", "void zeigeFenster() {\r\n\t\t_panel.setVisible(true);\r\n\t}", "@Override\n public void componentShown(ComponentEvent e) {\n }", "@Override\r\n public void componentShown(ComponentEvent e) {\n }", "@Override\r\n\t\t\tpublic void componentShown(ComponentEvent arg0) {\n\t\t\t\t\r\n\t\t\t}", "@Override\n public void componentShown(ComponentEvent e)\n {\n \n }", "@Override\n public void componentShown(ComponentEvent e) {\n\n }", "@Override\n\tpublic void componentShown(ComponentEvent e) {\n\t}", "@Override\n\tpublic void componentShown(ComponentEvent e) {\n\t\t\n\t}", "@Override\n\tpublic void componentShown(ComponentEvent e) {\n\t\t\n\t}", "@Override\r\n\t\tpublic void componentShown(ComponentEvent arg0) {\n\t\t\t\r\n\t\t}", "@Override\n public void componentShown(ComponentEvent arg0) {\n\n }", "@Override\n\tpublic void componentShown(ComponentEvent e) {\n\n\t}", "@Override\r\n\tpublic void componentShown(ComponentEvent arg0) {\n\t\t\r\n\t}", "@Override\n\t\t\t\t\t\tpublic void componentShown(ComponentEvent arg0) {\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t}", "@Override\n\t\t\t\t\t\tpublic void componentShown(ComponentEvent arg0) {\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t}", "@Override\n\tpublic void componentShown(ComponentEvent arg0) {\n\t\t\n\t}", "@Override\n\tpublic void componentShown(ComponentEvent arg0) {\n\t\t\n\t}", "@Override\r\n\tpublic void componentShown(ComponentEvent arg0) {\n\r\n\t}", "public void showPanel() {\n\t\tslidingPanel.heightProperty().removeListener(slidingPanelHeightListener);\n\t\tslidingPanel.setVisible(true);\n\t\ttranslateTrans.setToY(0);\n\t\ttranslateTrans.setOnFinished(null);\n\t\ttranslateTrans.play();\n\t\tisSlidingPaneShown = true;\n\t}", "@Override\r\n\tpublic void onPanelOpened(Panel panel) {\n\r\n\t}", "@Override\r\n\tpublic void aboutToBeShown() {\n\t\tsuper.aboutToBeShown();\r\n\t}", "public void show() {\r\n\t\tinitWidget(vpanel);\r\n\t\tRootPanel.get(\"content\").add(this);\r\n\t\t\r\n\t\tthis.setVisible(true);\r\n\t}", "public void show() {\n visible=true;\n }", "void init() {\n setVisible(true);\n\n }", "@Override\r\n\tpublic void onShow() {\n\t\t\r\n\t}", "@Override\n public void setupPanel()\n {\n\n }", "public void componentShown(ComponentEvent e) {\n\t\t\t\n\t\t}", "@Override\r\npublic void componentShown(ComponentEvent arg0) {\n\t\r\n}", "@Override\n public boolean isShown() {\n return super.isShown();\n }", "public void onStart() {\r\n\t\tthis.setVisible(true);\r\n\t}", "private void jPanel1ComponentShown(java.awt.event.ComponentEvent evt) {\n }", "private void HalKelasComponentShown(java.awt.event.ComponentEvent evt) {\n\t\n }", "public void start() {\n\t\t setVisible(true);\n\t}", "@Override\r\n\tpublic void show() {\n\t\t\r\n\t\t\r\n\t}", "public void show() {\n isVisible = true;\n this.saveBorderColor(playerColor);\n this.setBorderColor(playerColor);\n }", "@Override\r\n public void show()\r\n {\r\n\r\n }", "@Override\r\n public void show()\r\n {\r\n\r\n }", "public void setupAndShow() {\n\t\t\tfMaxTextField.setText(BarGraphDisplayer.this.getMaxLabel());\n\t\t\tfMinTextField.setText(BarGraphDisplayer.this.getMinLabel());\n\t\t\tfMinTextField.selectAll();\n\t\t\tfMinTextField.requestFocus();\n\t\t\tthis.setVisible(true);\n\t\t}", "@Override\r\n \tpublic void start(AcceptsOneWidget panel, EventBus eventBus) {\n \t\tpanel.setWidget(view);\t\t\r\n \t}", "public void display() {\r\n\t\tsetVisible(true);\r\n\t}", "@Override\n\tpublic void show() {\n\t\tsuper.show();\n\t\t\n\t}", "public void show() {\n\t\tsetLocation(\n\t\t\tgetOwner().getX() + (getOwner().getWidth() - getWidth()) / 2, \n\t\t\tgetOwner().getY() + (getOwner().getHeight() - getHeight()) / 2 );\n\n\t\tsuper.show();\n\t}", "@Override\r\n\tpublic void show() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void show() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void show() {\n\t\t\r\n\t}", "public void show(){\n initializeTouchpad();\n initializeButtons();\n initializeShieldBar();\n }", "public void componentShown(ComponentEvent e) {\n\t\tsuper.componentShown(e);\r\n\t}", "public void show() {\n\t\thidden = false;\n\t}", "public void componentShown(ComponentEvent arg0) {\n\t\t\n\t}", "public void show() {\n hidden = false;\n }", "private void showPanel()\n {\n currentPanel = this;\n isLiked = thisIsLiked;\n currentActivityId = thisActivityId;\n viewAll.setVisible(false);\n avatarPanel.clear();\n DOM.setStyleAttribute(usersWhoLikedPanelWrapper.getElement(), \"top\", likeCountLink.getAbsoluteTop() + \"px\");\n DOM.setStyleAttribute(usersWhoLikedPanelWrapper.getElement(), \"left\", likeCountLink.getAbsoluteLeft() + \"px\");\n \n for (PersonModelView liker : likers)\n {\n avatarPanel.add(new AvatarLinkPanel(EntityType.PERSON, liker.getUniqueId(), liker.getId(), liker\n .getAvatarId(), Size.VerySmall, liker.getDisplayName()));\n }\n \n if (likeCount > MAXLIKERSSHOWN)\n {\n viewAll.setVisible(true);\n }\n likedLabel.setText(likeCount + \" people liked this\");\n innerLikeCountLink.setText(likeCount.toString());\n }", "@Override\r\n\tpublic void show() {\n\t}", "public boolean shown();", "public void display() {\n\t\tthis.setVisible(true);\n\t}", "@Override\n public void show() {\n\n }", "@Override\n public void show() {\n\n }", "public void update(){\n\t\tthis.setVisible(true);\n\t}", "@Override\n public void show() {\n }", "@Override\n public void componentShown(final ComponentEvent e) {\n // Do nothing\n }", "public void showIt(){\n this.setVisible(true);\n }", "private void showPanel(Container panel)\r\n\t{\r\n\t\tthis.setContentPane(panel);\r\n\t\tpanel.setVisible(true);\r\n\t\tsetVisible(true);\r\n\t}", "@Override\r\n\tpublic void show() {\n\r\n\t}", "@Override\r\n\tpublic void show() {\n\r\n\t}", "@Override\n public void show() {\n \n }", "public void showInstructionsPanel()\n {\n setWidgetAsExample(introPanel);\n }", "@Override\n\tpublic void show() {\n\t\t\n\t}", "@Override\n\tpublic void show() {\n\t\t\n\t}", "@Override\n\tpublic void show() {\n\t\t\n\t}", "@Override\n\tpublic void show() {\n\t\t\n\t}", "@Override\n\tpublic void show() {\n\t\t\n\t}", "@Override\n\tpublic void show() {\n\t\t\n\t}", "@Override\n\tpublic void show() {\n\t\t\n\t}", "@Override\n\tpublic void show() {\n\t\t\n\t}", "@Override\n\tpublic void show() {\n\t\t\n\t}", "@Override\n\tpublic void show() {\n\t\t\n\t}", "@Override\n\tpublic void show() {\n\t\t\n\t}", "@Override\n\tpublic void show() {\n\t\t\n\t}", "@Override\n\tpublic void show() {\n\t\t\n\t}", "@Override\n\tpublic void show() {\n\t\t\n\t}", "@Override\n\tpublic void show() {\n\t\t\n\t}", "@Override\n\tpublic void show() {\n\n\t}", "@Override\n\tpublic void show() {\n\n\t}", "@Override\n\tpublic void show() {\n\n\t}", "@Override\n\tpublic void show() {\n\n\t}", "@Override\n\tpublic void show() {\n\n\t}", "@Override\n\tpublic void show() {\n\n\t}", "@Override\n\tpublic void show() {\n\n\t}", "@Override\n\tpublic void show() {\n\n\t}", "public void setVisible()\r\n\t{\r\n\t\tthis.setVisible(true);\r\n\t}", "public void onShow() {\n this.controller.notifyAdEvent(\"adsWillShow\");\n }", "public void onModuleLoad() { \n\t\tsingleton = this;\n\t\t\n\t\tdockPanel.setWidth(\"100%\");\n\t\tdockPanel.setSpacing(8);\n\t\t\n\t\tmenuBar.setVisible(false);\n\t\tmenuBar.setStyleName(\"menu\");\n\t\t\n\t\tflowPanel.setWidth(\"100%\");\n\t\tflowPanel.add(menuBar);\n\t\t\n\t\tstatusBar.setVisible(false);\n\t\tstatusBar.setStyleName(\"status\");\n\t\t\n\t\tflowPanel.add(statusBar);\n\t\t\n\t\tdockPanel.add(flowPanel,DockPanel.NORTH);\n\t\t\n\t\tloginPanel.setVisible(false);\n\t\tdockPanel.add(loginPanel,DockPanel.WEST);\n\t\t\n\t\tpublisherListPanel.setVisible(false);\n\t\tpublisherListPanel.setWidth(\"100%\");\n\t\tdockPanel.add(publisherListPanel,DockPanel.CENTER);\n\t\t\n\t\tRootPanel.get(\"publisher\").add(dockPanel);\n\t}", "public void showPane(){\n\t\tpane.draw();\n\t}", "@Override\n\tpublic void show() {\n\t}", "@Override\n\tpublic void show() {\n\t}", "public void show() {\n super.show();\n }", "public void componentShown(ComponentEvent arg0) {\n }", "public void openPharmacyPanel(){\n\t\tpanel.setVisible(true);\n\t}", "@Override\n\tpublic void onShow (int screenWidth, int screenHeight) {\n\n\t}" ]
[ "0.7483933", "0.7461789", "0.74503034", "0.7427413", "0.742057", "0.73910934", "0.73862815", "0.73773706", "0.7363544", "0.73472756", "0.73472756", "0.73242116", "0.7303475", "0.7296417", "0.7286727", "0.724253", "0.724253", "0.72393495", "0.72393495", "0.7215881", "0.720378", "0.71918684", "0.7185545", "0.71770585", "0.717386", "0.71433336", "0.71147126", "0.70767325", "0.7023838", "0.699743", "0.6957344", "0.69298863", "0.6889157", "0.68105286", "0.678359", "0.676258", "0.67493916", "0.67325187", "0.67325187", "0.67304206", "0.6729407", "0.6705235", "0.670312", "0.66990966", "0.6691714", "0.6691714", "0.6691714", "0.6679886", "0.6675609", "0.6662767", "0.66435057", "0.65984446", "0.65840197", "0.6580253", "0.6579582", "0.6575302", "0.657471", "0.657471", "0.65605664", "0.65580916", "0.65523285", "0.6539454", "0.65326446", "0.65228075", "0.65228075", "0.65004504", "0.6496317", "0.6494587", "0.6494587", "0.6494587", "0.6494587", "0.6494587", "0.6494587", "0.6494587", "0.6494587", "0.6494587", "0.6494587", "0.6494587", "0.6494587", "0.6494587", "0.6494587", "0.6494587", "0.6494433", "0.6494433", "0.6494433", "0.6494433", "0.6494433", "0.6494433", "0.6494433", "0.6494433", "0.6475316", "0.6462194", "0.646116", "0.64595044", "0.6448422", "0.6448422", "0.64433527", "0.6435886", "0.64332384", "0.642635" ]
0.71755916
24
Inflate the layout for this fragment
@Override public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { return inflater.inflate(R.layout.fragment_navagation_drawer, container, false); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n return inflater.inflate(R.layout.fragment_main_allinfo, container, false);\n }", "@Override\r\n\tpublic View onCreateView(LayoutInflater inflater, ViewGroup container,\r\n\t\t\tBundle savedInstanceState) {\n\t\treturn inflater.inflate(R.layout.wallpager_layout, null);\r\n\t}", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n return inflater.inflate(R.layout.fragment_invit_friends, container, false);\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n View inflate = inflater.inflate(R.layout.fragment_zhuye, container, false);\n initView(inflate);\n initData();\n return inflate;\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup parent, Bundle savedInstanceState) {\n // Defines the xml file for the fragment\n return inflater.inflate(R.layout.fragment_posts, parent, false);\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {\n return inflater.inflate(R.layout.ilustration_fragment, container, false);\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n View v = inflater.inflate(R.layout.fragment_sow_drug_cost_per_week, container, false);\n\n db = new DataBaseAdapter(getActivity());\n hc = new HelperClass();\n pop = new FeedSowsFragment();\n\n infltr = (LayoutInflater) getActivity().getSystemService(Context.LAYOUT_INFLATER_SERVICE);\n parent = (LinearLayout) v.findViewById(R.id.layout_for_add);\n tvTotalCost = (TextView) v.findViewById(R.id.totalCost);\n\n getData();\n setData();\n\n return v;\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n return inflater.inflate(R.layout.fragment_stream_list, container, false);\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n View v = inflater.inflate(R.layout.fragment_event, container, false);\n\n\n\n\n\n\n\n\n return v;\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n return inflater.inflate(R.layout.fragment_feed, container, false);\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n return inflater.inflate(R.layout.screen_select_list_student, container, false);\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n View rootView = inflater.inflate(R.layout.fragment_overall, container, false);\n mNamesLayout = (LinearLayout) rootView.findViewById(R.id.fragment_overall_names_layout);\n mOverallView = (OverallView) rootView.findViewById(R.id.fragment_overall_view);\n return rootView;\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState)\n {\n\n\n view = inflater.inflate(R.layout.fragment_earning_fragmant, container, false);\n ini(view);\n return view;\n }", "@Nullable\n @Override\n public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {\n super.onCreateView(inflater, container, savedInstanceState);\n final View rootview = inflater.inflate(R.layout.activity_email_frag, container, false);\n ConfigInnerElements(rootview);\n return rootview;\n }", "@Override\r\n\tpublic View onCreateView(LayoutInflater inflater, ViewGroup container,\r\n\t\t\tBundle savedInstanceState) {\n\t\trootView = inflater.inflate(R.layout.fragment_attack_armor, container, false);\r\n\r\n\t\tfindInterfaceElements();\r\n\t\taddRangeSelector();\r\n\t\tupdateHeadings();\r\n\t\tsetListeners();\r\n\r\n\t\tsetFromData();\r\n\r\n\t\treturn rootView;\r\n\t}", "@SuppressLint(\"InflateParams\")\r\n\t@Override\r\n\tpublic View initLayout(LayoutInflater inflater) {\n\t\tView view = inflater.inflate(R.layout.frag_customer_all, null);\r\n\t\treturn view;\r\n\t}", "@Override\r\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\r\n Bundle savedInstanceState) {\n view = inflater.inflate(R.layout.fragment_fore_cast, container, false);\r\n initView();\r\n mainLayout.setVisibility(View.GONE);\r\n apiInterface = RestClinet.getClient().create(ApiInterface.class);\r\n loadData();\r\n return view;\r\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n return inflater.inflate(R.layout.fragment_friend, container, false);\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n rootView = inflater.inflate(R.layout.fragment_detail, container, false);\n image = rootView.findViewById(R.id.fr_image);\n name = rootView.findViewById(R.id.fr_name);\n phoneNumber = rootView.findViewById(R.id.fr_phone_number);\n email = rootView.findViewById(R.id.fr_email);\n street = rootView.findViewById(R.id.fr_street);\n city = rootView.findViewById(R.id.fr_city);\n state = rootView.findViewById(R.id.fr_state);\n zipcode = rootView.findViewById(R.id.fr_zipcode);\n dBrith = rootView.findViewById(R.id.date_brith);\n return rootView;\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n return inflater.inflate(R.layout.fragment_pm25, container, false);\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n return inflater.inflate(R.layout.fragment_kkbox_playlist, container, false);\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n View rootView = inflater.inflate(R.layout.fragment_feed_pager, container, false);\n\n// loadData();\n\n findViews(rootView);\n\n setViews();\n\n return rootView;\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {\n layout = (FrameLayout) inflater.inflate(R.layout.fragment_actualites, container, false);\n\n relLayout = (RelativeLayout) layout.findViewById(R.id.relLayoutActus);\n\n initListView();\n getXMLData();\n\n return layout;\n }", "@Nullable\n @Override\n public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {\n rootView = inflater.inflate(R.layout.frag_post_prayer_video, container, false);\n setCustomDesign();\n setCustomClickListeners();\n return rootView;\n }", "@Override\n\tpublic View onCreateView(LayoutInflater inflater, ViewGroup container,\n\t\t\tBundle savedInstanceState) {\n\t\treturn inflater.inflate(R.layout.lf_em4305_fragment, container, false);\n\t}", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n return inflater.inflate(R.layout.fragment_recordings, container, false);\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n View view=inflater.inflate(R.layout.fragment_category, container, false);\n initView(view);\n bindRefreshListener();\n loadParams();\n return view;\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n return inflater.inflate(R.layout.fragment_cm_box_details, container, false);\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n view=inflater.inflate(R.layout.fragment_layout12, container, false);\n\n iniv();\n\n init();\n\n return view;\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n view = inflater.inflate(R.layout.fragment_details, container, false);\n //return inflater.inflate(R.layout.fragment_details, container, false);\n getIntentValues();\n initViews();\n return view;\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n return inflater.inflate(R.layout.fragment_mem_body_blood, container, false);\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n return inflater.inflate(R.layout.fragment_qiugouxiaoxi, container, false);\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n View inflate = inflater.inflate(R.layout.fragment_coll_blank, container, false);\n initView(inflate);\n initData();\n return inflate;\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n View view = inflater.inflate(R.layout.fragment_attendance_divide, container, false);\n\n initView(view);\n return view;\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup parent, Bundle savedInstanceState) {\n // Defines the xml file for the fragment\n return inflater.inflate(R.layout.show_program_fragment, parent, false);\n }", "@Override\n public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container,\n @Nullable Bundle savedInstanceState) {\n return inflater.inflate(R.layout.visualization_fragment, container, false);\n\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n rootView = inflater.inflate(R.layout.fragment_category_details_page, container, false);\n initializeAll();\n\n return rootView;\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n final View v = inflater.inflate(R.layout.fragemnt_reserve, container, false);\n\n\n\n\n return v;\n }", "protected int getLayoutResId() {\n return R.layout.activity_fragment;\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n return inflater.inflate(R.layout.fragment_all_quizs, container, false);\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n role = getArguments().getInt(\"role\");\n rootview = inflater.inflate(R.layout.fragment_application, container, false);\n layout = rootview.findViewById(R.id.patentDetails);\n progressBar = rootview.findViewById(R.id.progressBar);\n try {\n run();\n } catch (IOException e) {\n e.printStackTrace();\n }\n return rootview;\n }", "@Override\n\tpublic View onCreateView(LayoutInflater inflater, ViewGroup container,\n\t\t\tBundle savedInstanceState) {\n\t\tview = inflater.inflate(R.layout.fragment_zhu, null);\n\t\tinitView();\n\t\tinitData();\n\t\treturn view;\n\t}", "@Override\n\t\tpublic View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState)\n\t\t{\n\t\t\tView rootView = inflater.inflate(R.layout.maimfragment, container, false);\n\t\t\treturn rootView;\n\t\t}", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n // Inflate the layout for this fragment\n return inflater.inflate(R.layout.fragment__record__week, container, false);\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n return inflater.inflate(R.layout.fragment_porishongkhan, container, false);\n\n\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n View view = inflater.inflate(R.layout.fragment_dashboard, container, false);\n resultsRv = view.findViewById(R.id.db_results_rv);\n resultText = view.findViewById(R.id.db_search_empty);\n progressBar = view.findViewById(R.id.db_progressbar);\n lastVisitText = view.findViewById(R.id.db_last_visit);\n return view;\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n View view = inflater.inflate(getLayoutId(), container, false);\n init(view);\n return view;\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n view = inflater.inflate(R.layout.fragment_feedback, container, false);\n self = getActivity();\n initUI(view);\n initControlUI();\n initData();\n return view;\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n View v = inflater.inflate(R.layout.fragment_service_summery, container, false);\n tvVoiceMS = v.findViewById(R.id.tvVoiceValue);\n tvDataMS = v.findViewById(R.id.tvdataValue);\n tvSMSMS = v.findViewById(R.id.tvSMSValue);\n tvVoiceFL = v.findViewById(R.id.tvVoiceFLValue);\n tvDataBS = v.findViewById(R.id.tvDataBRValue);\n tvTotal = v.findViewById(R.id.tvTotalAccountvalue);\n return v;\n }", "@Override\r\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\r\n Bundle savedInstanceState) {\n return inflater.inflate(R.layout.fragment_clan_rank_details, container, false);\r\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n return inflater.inflate(R.layout.fragment_star_wars_list, container, false);\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n View inflate = inflater.inflate(R.layout.fragment_lei, container, false);\n\n initView(inflate);\n initData();\n return inflate;\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n return inflater.inflate(R.layout.fragment_quotation, container, false);\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n return inflater.inflate(R.layout.fragment_wode_ragment, container, false);\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup parent, Bundle savedInstanceState) {\n\n\n\n\n\n return inflater.inflate(R.layout.fragment_appoint_list, parent, false);\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {\n if (rootView == null) {\n rootView = inflater.inflate(R.layout.fragment_ip_info, container, false);\n initView();\n }\n return rootView;\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n return inflater.inflate(R.layout.fragment_offer, container, false);\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n return inflater.inflate(R.layout.fragment_rooms, container, false);\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {\n\n View view = inflater.inflate(R.layout.fragment_img_eva, container, false);\n\n getSendData();\n\n initView(view);\n\n initData();\n\n return view;\n }", "@Override\n public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {\n View view = inflater.inflate(R.layout.fragment_project_collection, container, false);\n ButterKnife.bind(this, view);\n fragment = this;\n initView();\n getCollectionType();\n // getCategoryList();\n initBroadcastReceiver();\n return view;\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n view = inflater.inflate(R.layout.fragment_yzm, container, false);\n initView(view);\n return view;\n }", "@Override\r\n\tpublic View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {\n\t\tmainLayout = inflater.inflate(R.layout.fragment_play, container, false);\r\n\t\treturn mainLayout;\r\n\t}", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n view = inflater.inflate(R.layout.fragment_invite_request, container, false);\n initialiseVariables();\n return view;\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {\n getLocationPermission();\n return inflater.inflate(R.layout.centrum_fragment, container, false);\n\n\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n View rootView = inflater.inflate(R.layout.fragment_habit_type_details, container, false);\n\n habitTitle = rootView.findViewById(R.id.textViewTitle);\n habitReason = rootView.findViewById(R.id.textViewReason);\n habitStartDate = rootView.findViewById(R.id.textViewStartDate);\n habitWeeklyPlan = rootView.findViewById(R.id.textViewWeeklyPlan);\n\n return rootView;\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n View v = inflater.inflate(R.layout.fragment_information_friends4, container, false);\n\n if (getArguments() != null) {\n FriendsID = getArguments().getString(\"keyFriends\");\n }\n\n return v;\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n return inflater.inflate(R.layout.fragment_post_details, container, false);\n\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n return inflater.inflate(R.layout.fragment_hotel, container, false);\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n view=inflater.inflate(R.layout.fragment_bus_inquiry, container, false);\n initView();\n initData();\n initDialog();\n getDataFromNet();\n return view;\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n return inflater.inflate(R.layout.fragment_weather, container, false);\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n return inflater.inflate(R.layout.fragment_srgl, container, false);\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n view = inflater.inflate(R.layout.fragment_ground_detail_frgment, container, false);\n init();\n return view;\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n return inflater.inflate(R.layout.fragment_book_appointment, container, false);\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n view = inflater.inflate(R.layout.fragment_wheretogo, container, false);\n ids();\n setup();\n click();\n return view;\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n binding = DataBindingUtil\n .inflate(inflater, R.layout.fragment_learning_leaders, container, false);\n init();\n\n return rootView;\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {\n View view = inflater.inflate(R.layout.fragment_end_game_tab, container, false);\n\n setupWidgets();\n setupTextFields(view);\n setupSpinners(view);\n\n // Inflate the layout for this fragment\n return view;\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {\n View view = inflater.inflate(R.layout.memoir_fragment, container, false);\n\n getUserIdFromSharedPref();\n configureUI(view);\n configureSortSpinner();\n configureFilterSpinner();\n\n networkConnection = new NetworkConnection();\n new GetAllMemoirTask().execute();\n\n return view;\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n return inflater.inflate(R.layout.fragment_jadwal, container, false);\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n view = inflater.inflate(R.layout.fragment_delivery_detail, container, false);\n initialise();\n\n\n\n return view;\n }", "@Nullable\n @Override\n public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {\n return inflater.inflate(R.layout.fragment_4, container, false);\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n return inflater.inflate(R.layout.fragment_all_product, container, false);\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n return inflater.inflate(R.layout.fragment_group_details, container, false);\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n View view = inflater.inflate(R.layout.fragment06_7, container, false);\n initView(view);\n setLegend();\n setXAxis();\n setYAxis();\n setData();\n return view;\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n return inflater.inflate(R.layout.fragment_downloadables, container, false);\n }", "@Override\n public View onCreateView(@NonNull LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n return inflater.inflate(R.layout.movie_list_fragment, container, false);\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n return inflater.inflate(R.layout.fragment_like, container, false);\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n return inflater.inflate(R.layout.fragment_hall, container, false);\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {\n View view = inflater.inflate(R.layout.fragment_unit_main, container, false);\n TextView mTxvBusinessAassistant = (TextView) view.findViewById(R.id.txv_business_assistant);\n TextView mTxvCardINformation = (TextView) view.findViewById(R.id.txv_card_information);\n RelativeLayout mRelOfficialWebsite = (RelativeLayout) view.findViewById(R.id.rel_official_website);\n RelativeLayout mRelPictureAblum = (RelativeLayout) view.findViewById(R.id.rel_picture_album);\n TextView mTxvQrCodeCard = (TextView) view.findViewById(R.id.txv_qr_code_card);\n TextView mTxvShareCard = (TextView) view.findViewById(R.id.txv_share_card);\n mTxvBusinessAassistant.setOnClickListener(this.mOnClickListener);\n mTxvCardINformation.setOnClickListener(this.mOnClickListener);\n mRelOfficialWebsite.setOnClickListener(this.mOnClickListener);\n mRelPictureAblum.setOnClickListener(this.mOnClickListener);\n mTxvQrCodeCard.setOnClickListener(this.mOnClickListener);\n mTxvShareCard.setOnClickListener(this.mOnClickListener);\n return view;\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n return inflater.inflate(R.layout.fragment_moviespage, container, false);\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n return inflater.inflate(R.layout.fragment_s, container, false);\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n View view = inflater.inflate(R.layout.fragment_overview, container, false);\n\n initOverviewComponents(view);\n registerListeners();\n initTagListener();\n return view;\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n View view = inflater.inflate(R.layout.fragment_bahan_ajar, container, false);\n initView(view);\n return view;\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {\n root = (ViewGroup) inflater.inflate(R.layout.money_main, container, false);\n context = getActivity();\n initHeaderView(root);\n initView(root);\n\n getDate();\n initEvetn();\n return root;\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup parent, Bundle savedInstanceState) {\n // Defines the xml file for the fragment\n return inflater.inflate(R.layout.fragment_historical_event, parent, false);\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n return inflater.inflate(R.layout.fragment_event_details, container, false);\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n View view = inflater.inflate(R.layout.fragment_video, container, false);\n unbinder = ButterKnife.bind(this, view);\n initView();\n initData();\n return view;\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n\n v= inflater.inflate(R.layout.fragment_post_contacts, container, false);\n this.mapping(v);\n return v;\n }", "@Nullable\n @Override\n public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {\n return inflater.inflate(R.layout.fragment_measures, container, false);\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n View view = inflater.inflate(R.layout.fragment_feed, container, false);\n findViews(view);\n return view;\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n return inflater.inflate(R.layout.fragment_surah_list, container, false);\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n return inflater.inflate(R.layout.fragment_data_binded, container, false);\n }" ]
[ "0.6739604", "0.67235583", "0.6721706", "0.6698254", "0.6691869", "0.6687986", "0.66869223", "0.6684548", "0.66766286", "0.6674615", "0.66654444", "0.66654384", "0.6664403", "0.66596216", "0.6653321", "0.6647136", "0.66423255", "0.66388357", "0.6637491", "0.6634193", "0.6625158", "0.66195583", "0.66164845", "0.6608733", "0.6596594", "0.65928894", "0.6585293", "0.65842897", "0.65730995", "0.6571248", "0.6569152", "0.65689117", "0.656853", "0.6566686", "0.65652984", "0.6553419", "0.65525705", "0.65432084", "0.6542382", "0.65411425", "0.6538022", "0.65366334", "0.65355957", "0.6535043", "0.65329415", "0.65311074", "0.65310687", "0.6528645", "0.65277404", "0.6525902", "0.6524516", "0.6524048", "0.65232015", "0.65224624", "0.65185034", "0.65130377", "0.6512968", "0.65122765", "0.65116245", "0.65106046", "0.65103024", "0.6509013", "0.65088093", "0.6508651", "0.6508225", "0.6504662", "0.650149", "0.65011525", "0.6500686", "0.64974767", "0.64935696", "0.6492234", "0.6490034", "0.6487609", "0.6487216", "0.64872116", "0.6486594", "0.64861935", "0.6486018", "0.6484269", "0.648366", "0.6481476", "0.6481086", "0.6480985", "0.6480396", "0.64797544", "0.647696", "0.64758915", "0.6475649", "0.6474114", "0.6474004", "0.6470706", "0.6470275", "0.64702207", "0.6470039", "0.6467449", "0.646602", "0.6462256", "0.64617974", "0.6461681", "0.6461214" ]
0.0
-1
TODO Autogenerated method stub
@Override public void onSpy(SpyEvent arg0) { if (arg0.getSnapshot() == null) { spy = arg0.getMsg(); } else { spy = arg0.getSnapshot().toString(); } }
{ "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 onOutput(OutputEvent arg0) { output = arg0.getMsg(); }
{ "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 a rule set with a given array of rules.
public static RuleSet ofList(RelOptRule... rules) { return new ListRuleSet(ImmutableList.copyOf(rules)); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static RuleSet ofList(Iterable<? extends RelOptRule> rules) {\n return new ListRuleSet(ImmutableList.copyOf(rules));\n }", "public RulesBook(Collection<Rule<A, B>> rules) {\n this(rules, StreamingRulesEngine.create());\n }", "@Required\n public void setRules(Set<Rule> rules)\n {\n this.rules = new TreeSet<Rule>(new RuleComparator());\n this.rules.addAll(rules);\n }", "public Taboo(List<T> rules) {\n\t\trule = new HashMap<>();\n\t\tfor(int i = 0; i < rules.size() - 1; i++) {\n\t\t\tif(rules.get(i) == null || rules.get(i+1) == null) continue;\n\t\t\tint hash = rules.get(i).hashCode();\n\t\t\tif(rule.containsKey(hash)) {\n\t\t\t\trule.get(hash).add(rules.get(i+1));\n\t\t\t}else {\n\t\t\t\tSet<T> val = new HashSet<>();\n\t\t\t\tval.add(rules.get(i+1));\n\t\t\t\trule.put(hash, val); \t\n\t\t\t}\n\t\t}\n\t}", "public void setRules(ArrayList<Rule> rules) {\n\t\tthis.rules = rules;\n\t}", "IRuleset add(IRuleset...rules);", "public void setRules(List<T> rules) {\n\t\tthis.rules = rules;\n\t}", "public RuleRegistrySet( RuleRegistry... ruleRegistries )\n {\n this( Arrays.asList( ruleRegistries ) );\n }", "public Grammar(List<String> rules) throws IllegalArgumentException {\n\t\tif (rules == null || rules.isEmpty()) {\n\t\t\tthrow new IllegalArgumentException();\n\t\t}\n\t\tfor (String line : rules) {\n\t\t\tString[] pieces = line.split(\"::=\");\n\t\t\tString[] subpieces = pieces[1].split(\"\\\\|\");\n\t\t\tfor (int i = 0; i < subpieces.length; i++) {\n\t\t\t\tsubpieces[i] = subpieces[i].trim();\n\t\t\t}\n List<String> listSubpieces = Arrays.asList(subpieces);\n\t\t\tif (!this.grammarRules.containsKey(pieces[0])) {\n\t\t\t\tthis.grammarRules.put(pieces[0].trim(), listSubpieces);\n\t\t\t} else {\n List<String> newSymbols = new ArrayList<String>();\n newSymbols.addAll(this.grammarRules.get(pieces[0]));\n newSymbols.addAll(listSubpieces);\n this.grammarRules.put(pieces[0].trim(), newSymbols);\n }\n\t\t}\t\n\t}", "IRuleset add(IRuleset rule);", "public RuleSet (RuleList rulelist, SensorList sList) {\n \n this.references = new ArrayList();\n this.rulelist = rulelist;\n this.totalProb = -1.0;\n this.id = counter.incrementAndGet();\n this.indexesOfPrec = new ArrayList();\n this.precedences = new ArrayList ();\n this.sList = sList;\n }", "Rule createRule();", "Rule createRule();", "Rule createRule();", "public void setData(Rule[] rules, String[] criteres) {\n\n\t\t// get all data\n\t\tthis.rules = rules;\n\t\tthis.criteres = criteres;\n\t\tdrawGraph();\n\t}", "public RETEReasoner addRules(List rules) {\n List combined = new List( this.rules );\n combined.addAll( rules );\n setRules( combined );\n return this;\n }", "private ExecutionPolicy[] makeRuleArray(ExecutionPolicy rule, ExecutionPolicy[] ruleArray)\n\t{\n\t\tExecutionPolicy[] result = new ExecutionPolicy[ruleArray.length + 1];\n\t\tint count = 0;\n\t\tresult[count++] = rule;\n\t\tfor (ExecutionPolicy r: ruleArray) result[count++] = r;\n\t\treturn result;\n\t}", "public LogicalRule(ExecutionPolicy...rules)\n\t\t{\n\t\t\tthis.rules = rules;\n\t\t}", "public RBGPProgram(final Rule[] rules) {\r\n super();\r\n this.m_rules = rules;\r\n }", "public ParallelProcessor(List<Rule> rules) {\n _rules = rules;\n }", "@SuppressWarnings(\"unchecked\")\n\tprivate void setRules() {\n\t\tthis.result = Result.START;\n\t\t// Create all initial rule executors, and shuffle them if needed.\n\t\tthis.rules = new LinkedList<>();\n\t\tModule module = getModule();\n\t\tfor (Rule rule : module.getRules()) {\n\t\t\tRuleStackExecutor executor = (RuleStackExecutor) getExecutor(rule, getSubstitution());\n\t\t\texecutor.setContext(module);\n\t\t\tthis.rules.add(executor);\n\t\t}\n\t\tif (getRuleOrder() == RuleEvaluationOrder.RANDOM || getRuleOrder() == RuleEvaluationOrder.RANDOMALL) {\n\t\t\tCollections.shuffle((List<RuleStackExecutor>) this.rules);\n\t\t}\n\t}", "public static List catenizeRules(String [][][] arrays)\t{\n\t\treturn catenizeRules(arrays, false);\n\t}", "protected void assertRules(Rule[] rules, String[] expected) {\n assertRules(rules, expected, true);\n }", "protected PmdRuleset createPmdRuleset(List<ActiveRule> activeRules, String profileName) {\n PmdRuleset ruleset = new PmdRuleset(profileName);\n\n for (ActiveRule activeRule : activeRules) {\n if (activeRule.getRule().getRepositoryKey().equals(PhpmdRuleRepository.PHPMD_REPOSITORY_KEY)) {\n String configKey = activeRule.getRule().getConfigKey();\n PmdRule rule = new PmdRule(configKey, mapper.to(activeRule.getSeverity()));\n List<ActiveRuleParam> activeRuleParams = activeRule.getActiveRuleParams();\n if (activeRuleParams != null && !activeRuleParams.isEmpty()) {\n List<PmdProperty> properties = new ArrayList<PmdProperty>();\n for (ActiveRuleParam activeRuleParam : activeRuleParams) {\n properties.add(new PmdProperty(activeRuleParam.getRuleParam().getKey(), activeRuleParam.getValue()));\n }\n rule.setProperties(properties);\n }\n ruleset.addRule(rule);\n processXPathRule(activeRule.getRuleKey(), rule);\n }\n }\n return ruleset;\n }", "ExprListRule createExprListRule();", "public RETEReasoner(List rules) {\n if (rules == null) throw new NullPointerException( \"null rules\" );\n this.rules = rules;\n }", "public static JsonObject ruleAll(final Collection<KRuleTerm> rules, final JsonObject input) {\n return Unique.ruleAll(rules, input);\n }", "public void xsetRules(com.walgreens.rxit.ch.cda.StrucDocTable.Rules rules)\n {\n synchronized (monitor())\n {\n check_orphaned();\n com.walgreens.rxit.ch.cda.StrucDocTable.Rules target = null;\n target = (com.walgreens.rxit.ch.cda.StrucDocTable.Rules)get_store().find_attribute_user(RULES$26);\n if (target == null)\n {\n target = (com.walgreens.rxit.ch.cda.StrucDocTable.Rules)get_store().add_attribute_user(RULES$26);\n }\n target.set(rules);\n }\n }", "@Override\n public void setRules(List rules) {\n this.rules = rules;\n if (schemaGraph != null) {\n // The change of rules invalidates the existing precomputed schema graph\n // This might be recoverable but for now simply flag the error and let the\n // user reorder their code to set the rules before doing a bind!\n throw new ReasonerException(\"Cannot change the rule set for a bound rule reasoner.\\nSet the rules before calling bindSchema\");\n }\n }", "private Set<Condition> getConditions(List<RuleInstance> rules)\n{\n Set<Condition> conds = new HashSet<Condition>();\n\n getTimeConditions(rules,conds);\n getSensorConditions(rules,conds);\n getCalendarConditions(rules,conds);\n\n return null;\n}", "private void createRules(List<PatternToken> elemList,\n List<PatternToken> tmpPatternTokens, int numElement) {\n String shortMessage = \"\";\n if (this.shortMessage != null && this.shortMessage.length() > 0) {\n shortMessage = this.shortMessage.toString();\n } else if (shortMessageForRuleGroup != null && shortMessageForRuleGroup.length() > 0) {\n shortMessage = this.shortMessageForRuleGroup.toString();\n }\n if (numElement >= elemList.size()) {\n AbstractPatternRule rule;\n if (tmpPatternTokens.size() > 0) {\n rule = new PatternRule(id, language, tmpPatternTokens, name,\n message.toString(), shortMessage,\n suggestionsOutMsg.toString(), phrasePatternTokens.size() > 1, interpretPosTagsPreDisambiguation);\n rule.addTags(ruleTags);\n rule.addTags(ruleGroupTags);\n rule.addTags(categoryTags);\n rule.setSourceFile(sourceFile);\n } else if (regex.length() > 0) {\n int flags = regexCaseSensitive ? 0 : Pattern.CASE_INSENSITIVE|Pattern.UNICODE_CASE;\n String regexStr = regex.toString();\n if (regexMode == RegexpMode.SMART) {\n // Note: it's not that easy to add \\b because the regex might look like '(foo)' or '\\d' so we cannot just look at the last character\n regexStr = replaceSpacesInRegex(regexStr);\n }\n if (ruleAntiPatterns.size() > 0 || rulegroupAntiPatterns.size() > 0) {\n throw new RuntimeException(\"<regexp> rules currently cannot be used together with <antipattern>. Rule id: \" + id + \"[\" + subId + \"]\");\n }\n rule = new RegexPatternRule(id, name, message.toString(), shortMessage, suggestionsOutMsg.toString(), language, Pattern.compile(regexStr, flags), regexpMark);\n rule.setSourceFile(sourceFile);\n } else {\n throw new IllegalStateException(\"Neither '<pattern>' tokens nor '<regex>' is set in rule '\" + id + \"'\");\n }\n setRuleFilter(filterClassName, filterArgs, rule);\n prepareRule(rule);\n rules.add(rule);\n } else {\n PatternToken patternToken = elemList.get(numElement);\n if (patternToken.hasOrGroup()) {\n // When creating a new rule, we finally clear the backed-up variables. All the elements in\n // the OR group should share the values of backed-up variables. That's why these variables\n // are backed-up.\n List<Match> suggestionMatchesBackup = new ArrayList<>(suggestionMatches);\n List<Match> suggestionMatchesOutMsgBackup = new ArrayList<>(suggestionMatchesOutMsg);\n int startPosBackup = startPos;\n int endPosBackup = endPos;\n List<DisambiguationPatternRule> ruleAntiPatternsBackup = new ArrayList<>(ruleAntiPatterns);\n for (PatternToken patternTokenOfOrGroup : patternToken.getOrGroup()) {\n List<PatternToken> tmpElements2 = new ArrayList<>();\n tmpElements2.addAll(tmpPatternTokens);\n tmpElements2.add(ObjectUtils.clone(patternTokenOfOrGroup));\n createRules(elemList, tmpElements2, numElement + 1);\n startPos = startPosBackup;\n endPos = endPosBackup;\n suggestionMatches = suggestionMatchesBackup;\n suggestionMatchesOutMsg = suggestionMatchesOutMsgBackup;\n ruleAntiPatterns.addAll(ruleAntiPatternsBackup);\n }\n }\n tmpPatternTokens.add(ObjectUtils.clone(patternToken));\n createRules(elemList, tmpPatternTokens, numElement + 1);\n }\n }", "public void setRules(com.walgreens.rxit.ch.cda.StrucDocTable.Rules.Enum rules)\n {\n synchronized (monitor())\n {\n check_orphaned();\n org.apache.xmlbeans.SimpleValue target = null;\n target = (org.apache.xmlbeans.SimpleValue)get_store().find_attribute_user(RULES$26);\n if (target == null)\n {\n target = (org.apache.xmlbeans.SimpleValue)get_store().add_attribute_user(RULES$26);\n }\n target.setEnumValue(rules);\n }\n }", "@Test\r\n public void testAddRule() throws Exception{\r\n System.out.println(\"addRule\");\r\n RuleSetImpl instance = new RuleSetImpl(\"Test\", true);\r\n instance.addRule(new RegExRule(\".*\", \"string\"));\r\n instance.addRule(new RegExRule(\"a.*\", \"aString\"));\r\n List<Rule> rules = instance.getRules();\r\n assertTrue(rules.size()==2);\r\n }", "public Grammar(List<String> rules) {\r\n if (rules == null || rules.isEmpty()) {\r\n throw new IllegalArgumentException();\r\n }\r\n // initialize map for BNF rules.\r\n this.bnfRuleMap = new TreeMap<String, List<String>>();\r\n this.num = new Random();\r\n // process each BNF rule into the map.\r\n for (int i = 0; i < rules.size(); i++) {\r\n String rule = rules.get(i);\r\n // Separate the non-terminal from terminal.\r\n String[] pieces = rule.split(\"::=\");\r\n String nonTerminal = pieces[0].trim();\r\n // Separate different terminals.\r\n String[] terminals = pieces[1].split(\"\\\\|\");\r\n List<String> valueTerminals = new ArrayList<String>();\r\n valueTerminals = Arrays.asList(terminals);\r\n if (!this.bnfRuleMap.containsKey(nonTerminal)) {\r\n this.bnfRuleMap.put(nonTerminal, new ArrayList<String>());\r\n }\r\n this.bnfRuleMap.get(nonTerminal).addAll(valueTerminals);\r\n }\r\n }", "public static final List catenizeRulesUnique(String [][][] arrays)\t{\n\t\treturn catenizeRules(arrays, true);\n\t}", "public OrRule(ExecutionPolicy...rules)\n\t\t{\n\t\t\tsuper(rules);\n\t\t}", "void setRule(Rule rule);", "public void setRuleColumnSet(Set<String> ruleColumnSet) {\n this.ruleColumnSet = ruleColumnSet;\n }", "ExprRule createExprRule();", "private static void go(List<CodeShapeRule> rules, List<State> states) {\n\t\trules.stream().map(rule -> new Feature(rule, rule.index)).collect(Collectors.toList());\n\n\t}", "List<? extends Rule> getRules();", "public static ArrayList<Rule> getRulesFromItemset(ArrayList<String> itemSet, DataSet dataSet, double minConfidence) {\n\t\tArrayList<Rule> rules = new ArrayList<Rule>();\n\t\t\n\t\tArrayList<ArrayList<String>> subsets = allSubsets(itemSet);\n\t\t\n\t\tfor(ArrayList<String> subset : subsets) {\n\t\t\tRule r = new Rule();\n\t\t\tr.LHS = subset;\n\t\t\tr.RHS = complement(itemSet, subset);\n\t\t\t\n\t\t\tArrayList<String> allItems = new ArrayList<String>();\n\t\t\tallItems.addAll(r.LHS);\n\t\t\tallItems.addAll(r.RHS);\n\t\t\tr.supportFound = dataSet.findSupport(allItems);\n\t\t\tr.confidenceFound = dataSet.findConfidence(r);\n\t\t\t\n\t\t\tif(r.confidenceFound >= minConfidence) {\n\t\t\t\trules.add(r);\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn rules;\n\t}", "public XorRule(ExecutionPolicy...rules)\n\t\t{\n\t\t\tsuper(rules);\n\t\t}", "@Test\n public void createRule() {\n // BEGIN: com.azure.messaging.servicebus.servicebusrulemanagerclient.createRule\n RuleFilter trueRuleFilter = new TrueRuleFilter();\n CreateRuleOptions options = new CreateRuleOptions(trueRuleFilter);\n ruleManager.createRule(\"new-rule\", options);\n // END: com.azure.messaging.servicebus.servicebusrulemanagerclient.createRule\n\n ruleManager.close();\n }", "public static List<Rule> fromRDF(final Iterable<Statement> model) {\n\n // Load namespaces from model metadata, reusing default prefix/ns mappings\n final Map<String, String> namespaces = new HashMap<>(Namespaces.DEFAULT.uriMap());\n if (model instanceof Model) {\n for (final Namespace namespace : ((Model) model).getNamespaces()) {\n namespaces.put(namespace.getPrefix(), namespace.getName());\n }\n }\n for (final Statement stmt : model) {\n if (stmt.getSubject() instanceof URI && stmt.getObject() instanceof Literal\n && stmt.getPredicate().equals(RR.PREFIX_PROPERTY)) {\n namespaces.put(stmt.getObject().stringValue(), stmt.getSubject().stringValue());\n }\n }\n\n // Use a 5-fields Object[] record to collect the attributes of each rule.\n // fields: 0 = fixpoint, 1 = phase, 2 = delete expr, 3 = insert expr, 4 = where expr\n final Map<URI, Object[]> records = new HashMap<>();\n\n // Scan the statements, extracting rule properties and populating the records map\n for (final Statement stmt : model) {\n try {\n if (stmt.getSubject() instanceof URI) {\n\n // Extract relevant statement components\n final URI subj = (URI) stmt.getSubject();\n final URI pred = stmt.getPredicate();\n final Value obj = stmt.getObject();\n\n // Identify field and value (if any) of corresponding Object[] record\n int field = -1;\n Object value = null;\n if (pred.equals(RDF.TYPE)) {\n field = 0;\n if (obj.equals(RR.FIXPOINT_RULE)) {\n value = true;\n } else if (obj.equals(RR.NON_FIXPOINT_RULE)) {\n value = false;\n }\n } else if (pred.equals(RR.PHASE)) {\n field = 1;\n value = ((Literal) obj).intValue();\n } else if (pred.equals(RR.DELETE)) {\n field = 2;\n } else if (pred.equals(RR.INSERT) || pred.equals(RR.HEAD)) {\n field = 3;\n } else if (pred.equals(RR.WHERE) || pred.equals(RR.BODY)) {\n field = 4;\n }\n if (field == 2 || field == 3 || field == 4) {\n value = Algebra.parseTupleExpr(stmt.getObject().stringValue(), null,\n namespaces);\n }\n\n // Update Object[] records if the statement is about a rule\n if (value != null) {\n Object[] record = records.get(subj);\n if (record == null) {\n record = new Object[] { true, 0, null, null, null };\n records.put(subj, record);\n }\n record[field] = value;\n }\n }\n } catch (final Throwable ex) {\n throw new IllegalArgumentException(\"Invalid rule attribute in statement: \" + stmt,\n ex);\n }\n }\n\n // Generate the rules from parsed heads and bodies\n final List<Rule> rules = new ArrayList<>();\n for (final Map.Entry<URI, Object[]> entry : records.entrySet()) {\n final URI id = entry.getKey();\n final Object[] record = entry.getValue();\n rules.add(new Rule(id, (Boolean) record[0], (Integer) record[1],\n (TupleExpr) record[2], (TupleExpr) record[3], (TupleExpr) record[4]));\n }\n return rules;\n }", "ArrayTypeRule createArrayTypeRule();", "public AndRule(ExecutionPolicy...rules)\n\t\t{\n\t\t\tsuper(rules);\n\t\t}", "public static void printRules(Rule[] rules) {\n System.out.println(\"\\nRulebase generated\\n------------------\");\n int i =1;\n for (Rule rule : rules) {\n String cond = \"\";\n for (int j = 0; j < rule.cond.length; j++) {\n cond = cond + rule.cond[j];\n }\n String output = rule.output;\n System.out.println(\"Rule\" + i + \" : \" + cond + \" = \" + output);\n i++;\n }\n System.out.println(\"\\n\");\n }", "RuleCatalog createRuleCatalog();", "@Override\r\n protected void initializeRules(List<AbstractValidationCheck> rules) {\n\r\n }", "protected RETEReasoner(List rules, Graph schemaGraph) {\n this(rules);\n this.schemaGraph = schemaGraph;\n }", "private void createQoSRules() {\n JsonObject settings = new JsonObject();\n JsonObject config = new JsonObject();\n JsonObject sentinels = new JsonObject();\n JsonObject rules = new JsonObject();\n\n // config\n config.put(\"percentile\", 75);\n config.put(\"quorum\", 40);\n config.put(\"period\", 3);\n config.put(\"minSampleCount\", 1000);\n config.put(\"minSentinelCount\", 5);\n settings.put(\"config\", config);\n\n // sentinels\n JsonObject sentinel1 = new JsonObject();\n sentinel1.put(\"percentile\", 50);\n JsonObject sentinel2 = new JsonObject();\n JsonObject sentinel3 = new JsonObject();\n JsonObject sentinel4 = new JsonObject();\n JsonObject sentinel5 = new JsonObject();\n sentinels.put(\"sentinelA\", sentinel1);\n sentinels.put(\"sentinelB\", sentinel2);\n sentinels.put(\"sentinelC\", sentinel3);\n sentinels.put(\"sentinelD\", sentinel4);\n sentinels.put(\"sentinelE\", sentinel5);\n settings.put(\"sentinels\", sentinels);\n\n // rules\n JsonObject rule1 = new JsonObject();\n rule1.put(\"reject\", 1.3);\n rule1.put(\"warn\", 1.1);\n rules.put(\"/playground/myapi1/v1/.*\", rule1);\n\n JsonObject rule2 = new JsonObject();\n rule2.put(\"reject\", 1.7);\n rules.put(\"/playground/myapi2/v1/.*\", rule2);\n\n settings.put(\"rules\", rules);\n\n // PUT the QoS rules\n given().body(settings.toString()).put(\"server/admin/v1/qos\").then().assertThat().statusCode(200);\n }", "IdListRule createIdListRule();", "public Rule(List<ICondition> conditions)\r\n\t{\r\n\t\tif (conditions != null)\r\n\t\t{\r\n\t\t\tthis.conditions = conditions;\r\n\t\t}\r\n\t}", "private void loadRuleSets() throws CSSException {\n StyleSheet stylesheet = cssCode.getParsedCSS();\n for (RuleBlock block : stylesheet) {\n if (block instanceof RuleSet) {\n\n StringBuilder selectorString = new StringBuilder();\n RuleSet ruleSet = (RuleSet) block;\n\n List<CombinedSelector> selectors = ruleSet.getSelectors();\n Iterator<CombinedSelector> selectorsIterator = selectors.iterator();\n while (selectorsIterator.hasNext()) {\n CombinedSelector selector = selectorsIterator.next();\n selectorString.append(selector.toString());\n if (selectorsIterator.hasNext()) {\n selectorString.append(\", \");\n }\n }\n\n List<CSSRule> cssRules = new ArrayList<>();\n CSSRule cssRule;\n Declaration.Source source;\n DeclarationPosition declarationPosition;\n\n for (Declaration declaration : ruleSet) {\n cssRule = new CSSRule(declaration.getProperty(), \"\");\n\n source = declaration.getSource();\n if (source == null) {\n declarationPosition = null;\n } else {\n declarationPosition = new DeclarationPosition(source.getLine(), source.getPosition());\n }\n cssRule.setDeclarationPosition(declarationPosition);\n\n cssRules.add(cssRule);\n }\n\n CSSRuleSet cssRuleSet = new CSSRuleSet(selectorString.toString(), cssRules);\n\n this.cssRuleBlocks.add(cssRuleSet);\n\n // add record to the position-declaration map\n for (CSSRule iCssRule : cssRuleSet.getCssRules()) {\n this.declarationPositionMap.put(\n iCssRule.getDeclarationPosition(),\n new DeclarationSource(cssRuleSet, iCssRule)\n );\n }\n }\n }\n }", "StatementRule createStatementRule();", "public boolean addRules( ArrayList<Rule> ruleList ) {\n\t\tfor( int i=0; i < ruleList.size(); i++ ) {\n\t\t\tif( !validRule(ruleList.get(i)) ) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\t\tthis.rules = ruleList;\n\t\treturn true;\n\t}", "public static List<Rule> mergeSameWhereExpr(final Iterable<Rule> rules) {\n\n // Group together rules with the same fixpoint, phase and WHERE expression\n final Map<List<Object>, List<Rule>> clusters = new HashMap<>();\n for (final Rule rule : rules) {\n final List<Object> key = Arrays.asList(rule.fixpoint, rule.phase, rule.whereExpr);\n List<Rule> cluster = clusters.get(key);\n if (cluster == null) {\n cluster = new ArrayList<>();\n clusters.put(key, cluster);\n }\n cluster.add(rule);\n }\n\n // Create a merged rule for each cluster obtained before\n final List<Rule> mergedRules = new ArrayList<>();\n for (final List<Rule> cluster : clusters.values()) {\n final Rule first = cluster.get(0);\n final String namespace = first.getID().getNamespace();\n final Set<String> names = new TreeSet<>();\n TupleExpr newDeleteExpr = null;\n TupleExpr newInsertExpr = null;\n for (int i = 0; i < cluster.size(); ++i) {\n final Rule rule = cluster.get(i);\n final String s = rule.getID().getLocalName();\n final int index = s.indexOf(\"__\");\n names.add(index < 0 ? s : s.substring(0, index));\n newDeleteExpr = newDeleteExpr == null ? rule.deleteExpr //\n : new Join(newDeleteExpr, rule.deleteExpr);\n newInsertExpr = newInsertExpr == null ? rule.insertExpr //\n : new Join(newInsertExpr, rule.insertExpr);\n }\n final URI id = newID(namespace + String.join(\"_\", names));\n mergedRules.add(new Rule(id, first.fixpoint, first.phase, newDeleteExpr,\n newInsertExpr, first.whereExpr));\n }\n return mergedRules;\n }", "public PropertySchema(String name, boolean array, String type, boolean optional, IPropertyValidationRule[] rules) {\n\t\t_name = name;\n\t\t_array = array;\n\t\t_optional = optional;\n\t\t_type = type;\n\t\t\n\t\tif (rules != null) {\n\t\t\tfor (IPropertyValidationRule rule : rules)\n\t\t\t\t_rules.add(rule);\n\t\t}\n\t}", "public PropertySchema(String name, boolean array, Schema schema, boolean optional, IPropertyValidationRule[] rules) {\n\t\t_name = name;\n\t\t_array = array;\n\t\t_optional = optional;\n\t\t_schema = schema;\n\n\t\tif (rules != null) {\n\t\t\tfor (IPropertyValidationRule rule : rules)\n\t\t\t\t_rules.add(rule);\n\t\t}\n\t}", "private static void getRulesFromFile() {\n File ruleFolder = new File(\"rules\");\n List<String> packageManagersWithRules = Stream.of(ruleFolder.list())\n .filter(f -> f.endsWith(\".rules\"))\n .map(f -> f.substring(0,f.lastIndexOf('.')))\n .sorted()\n .collect(Collectors.toList());\n\n RULES_BY_PACKAGE = new HashMap<>();\n for (String packagemanager : packageManagersWithRules) {\n RULES_BY_PACKAGE.put(packagemanager, parseRules(ruleFolder, packagemanager));\n }\n\n }", "public void addExceptionRules(Collection<PatternActionRule> rules) {\n\t\tthis.patternActionRules.addAll(rules);\n\t\tCollections.sort(this.patternActionRules);\n\t}", "private void generateRules(TreeNode tn)\n{\n if (!tn.isLeaf()) {\n generateRules(tn.getPassTree());\n generateRules(tn.getFailTree());\n return;\n }\n RuleInstance ri = tn.getRules().get(0);\n if (ri.getBaseRule() != null) return;\t// rule already in set\n\n Condition c = tn.getCondition();\n List<UpodCondition> cset = new ArrayList<UpodCondition>();\n if (c != null) {\n UpodCondition cond = c.getConditionTest(for_program);\n if (cond != null) cset.add(cond);\n }\n for (TreeNode pn = tn.getParent(); pn != null; pn = pn.getParent()) {\n Condition pc = pn.getCondition();\n if (pc == null) continue;\n UpodCondition pcond = pc.getConditionTest(for_program);\n if (pcond != null) cset.add(pcond);\n }\n\n UpodCondition rcond = null;\n if (cset.isEmpty()) return;\n if (cset.size() == 1) rcond = cset.get(0);\n else {\n UpodCondition [] conds = new UpodCondition[cset.size()];\n conds = cset.toArray(conds);\n rcond = new BasisConditionLogical.And(conds);\n }\n List<UpodAction> racts = ri.getActions();\n if (rcond == null || racts == null) return;\n\n BasisRule rule = new BasisRule(rcond,racts,null,100);\n for_program.addRule(rule);\n}", "private Rule[] sortRules(Rule[] rules){\n \t\t\n \t\tArrayList<Rule> temp = new ArrayList<Rule>();\n \t\t\n \t\tfor(int i = 0; i < rules.length; i++){\n \t\t\t\n \t\t\tif(!rules[i].isElseFilter()){\n \t\t\t\ttemp.add(rules[i]);\n \t\t\t}\n \t\t}\n \t\t\n \t\tfor(int i = 0; i < rules.length; i++){\n \t\t\t\n \t\t\tif(rules[i].isElseFilter()){\n \t\t\t\ttemp.add(rules[i]);\n \t\t\t}\n \t\t\t\n \t\t}\n \t\t\n \t\tRule[] newRules = new Rule[temp.size()];\t\t\n \t\treturn temp.toArray(newRules);\n \t}", "public void setRuleFinders(List ruleFinders) {\n this.ruleFinders = ruleFinders;\n }", "private static Collection<? extends Rule> getRules(ObjectFactory objFactory, Value cwe, Repository repository, Value segment)\n {\n HashMap<String, Rule> ruleSet = new HashMap<String, CWECoverageClaimType.Claims.Claim.RuleSet.Rule>();\n RepositoryConnection con = null;\n try\n {\n con = getRepositoryConnection(repository);\n \n String adaptorQuery = \"SELECT ?descriptionText WHERE {<\"+segment+\"> <http://toif/contains> ?finding. ?finding <http://toif/toif:FindingHasCWEIdentifier> <\" + cwe + \"> . \"\n + \"?finding <http://toif/toif:FindingIsDescribedByWeaknessDescription> ?description . \"\n + \"?description <http://toif/description> ?descriptionText . }\";\n \n TupleQuery adaptorTupleQuery = con.prepareTupleQuery(QueryLanguage.SPARQL, adaptorQuery);\n \n TupleQueryResult queryResult = adaptorTupleQuery.evaluate();\n \n while (queryResult.hasNext())\n {\n BindingSet adaptorSet = queryResult.next();\n Value name = adaptorSet.getValue(\"descriptionText\");\n \n String nameString = name.stringValue();\n \n String[] descArray = nameString.split(\":\");\n \n String ident = descArray[0];\n String description = descArray[1];\n \n if (!ruleSet.containsKey(ident))\n {\n Rule rule = objFactory.createCWECoverageClaimTypeClaimsClaimRuleSetRule();\n ruleSet.put(ident, rule);\n }\n \n Rule rule = ruleSet.get(ident);\n rule.setRuleID(ident);\n rule.setRuleName(ident);\n rule.setRuleComments(description);\n \n }\n \n queryResult.close();\n }\n catch (RepositoryException e)\n {\n e.printStackTrace();\n }\n catch (MalformedQueryException e)\n {\n e.printStackTrace();\n }\n catch (QueryEvaluationException e)\n {\n e.printStackTrace();\n }\n finally\n {\n try\n {\n con.close();\n }\n catch (RepositoryException e)\n {\n e.printStackTrace();\n }\n }\n return ruleSet.values();\n \n }", "public RulesEngineInner withRules(List<RulesEngineRule> rules) {\n if (this.innerProperties() == null) {\n this.innerProperties = new RulesEngineProperties();\n }\n this.innerProperties().withRules(rules);\n return this;\n }", "private void getTimeConditions(List<RuleInstance> rules,Set<Condition> conds)\n{\n for (RuleInstance ri : rules) {\n getTimeConditions(ri,rules,conds);\n }\n}", "public abstract void setRules (CellProfile rules);", "public abstract void setEventRulesOfSentence(List<EventRule> eventRulesOfSentence);", "@SuppressWarnings({ \"rawtypes\", \"unchecked\" })\n public static void main(String[] args) throws ConfigurationException,\n RuleExecutionSetCreateException, IOException,\n RuleSessionTypeUnsupportedException, RuleSessionCreateException,\n RuleExecutionSetNotFoundException, InvalidRuleSessionException,\n ClassNotFoundException, RuleExecutionSetRegisterException {\n\n String ruleEngineServiceUri = UriConstants.RULE_ENGINE_SERVICE_URI;\n\n Class.forName(UriConstants.RULE_SERVICE_PROVIDER_CLASS_NAME);\n\n RuleServiceProvider serviceProvider = RuleServiceProviderManager\n .getRuleServiceProvider(ruleEngineServiceUri);\n\n RuleAdministrator ruleAdministrator = serviceProvider\n .getRuleAdministrator();\n\n RuleEngineLog.debug(ruleAdministrator.toString());\n\n Map params = null;\n // InputStream stream = null;\n\n String bindUri = null;\n\n LogisticsRule logisticsRule = buildLogisticsRule();\n\n FlavorRule flavorRule = buildFlavorRule();\n\n RuleSet ruleSet = new RuleSet(\"multi-logisitic--ruleset\");\n\n ruleSet.addRule(logisticsRule);\n ruleSet.addRule(flavorRule);\n // ruleSet.add(logisticsRule1);\n\n RuleExecutionSet ruleExecutionSet = ruleAdministrator\n .getLocalRuleExecutionSetProvider(params).createRuleExecutionSet(\n ruleSet, null);\n\n bindUri = ruleExecutionSet.getName();\n\n ruleAdministrator.registerRuleExecutionSet(bindUri, ruleExecutionSet, null);\n\n RuleEngineLog.debug(ruleExecutionSet);\n //\n RuleRuntime ruleRunTime = serviceProvider.getRuleRuntime();\n\n StatelessRuleSession srs = (StatelessRuleSession) ruleRunTime\n .createRuleSession(bindUri, params, RuleRuntime.STATELESS_SESSION_TYPE);\n\n List inputList = new LinkedList();\n\n String productReview1 = \"一直在你们家购买,感觉奶粉是保真的。就是发货速度稍微再快一些就好了。先谢谢了\";\n\n String productReview2 = \"说什么原装进口的 但是和我原本进口的奶粉还是有区别 奶很甜 宝宝吃了这个奶粉后胃口很差 都不爱吃其他东西 本来每天定时有吃两顿饭的 现在吃了这个奶粉后 饭也不要吃了 现在一个没有开 另一罐开了放着没有喝\";\n\n ProductReview pr1 = new ProductReview(\"uid1\", productReview1);\n\n ProductReview pr2 = new ProductReview(\"uid2\", productReview2);\n\n inputList.add(pr1);\n inputList.add(pr2);\n\n // inputList.add(new String(\"Bar\"));\n // inputList.add(new Integer(5));\n // inputList.add(new Float(6));\n List resultList = srs.executeRules(inputList);\n\n // release the session\n srs.release();\n\n // System.out.println(\"executeRules: \" + resultList);\n for (Object o : resultList) {\n System.out.println(o);\n }\n\n }", "public RefAlertRuleModel[] createRefAlertRule(RefAlertRuleModel[] refAlertRules) throws AAException,\r\n\t\t\tRemoteException;", "RequireExprsRule createRequireExprsRule();", "public RulesBook() {\n this(new ArrayList<>());\n }", "public AdornedRules(final Mapping map) {\n adornedRules = new ArrayList<>();\n adornedPredicates = new ArrayList<>();\n init(map);\n }", "public ArrayList<RuleSet> getRuleSets() {\n return ruleSets;\n }", "E7Rule createE7Rule();", "E3Rule createE3Rule();", "public AscendingRules() {}", "public void add_rule(Rule rule) throws Exception;", "NFRuleSet findRuleSet(String name)\n/* */ throws IllegalArgumentException\n/* */ {\n/* 1799 */ for (int i = 0; i < this.ruleSets.length; i++) {\n/* 1800 */ if (this.ruleSets[i].getName().equals(name)) {\n/* 1801 */ return this.ruleSets[i];\n/* */ }\n/* */ }\n/* 1804 */ throw new IllegalArgumentException(\"No rule set named \" + name);\n/* */ }", "AssignmentRule createAssignmentRule();", "@BeforeClass\n public static void setUpClass() throws Exception {\n List<String> classNames = ClassListHelper.getClasses();\n \n System.out.println(\"# of classes: \"+classNames.size());\n \n Random random = new Random(System.currentTimeMillis());\n \n StringBuilder builder = new StringBuilder(\"package com.drools.test;\\n\\n\");\n for (int i = 0; i < NUMBER_OF_RULES; i++) {\n builder.append(\"rule \\\"Rule\");\n builder.append(i);\n builder.append(\"\\\"\\n\");\n builder.append(\"when\\n\");\n builder.append(\"\\t$o: \");\n builder.append(classNames.get(random.nextInt(classNames.size())));\n builder.append(\"()\\n\");\n builder.append(\"\\t\");\n builder.append(classNames.get(random.nextInt(classNames.size())));\n builder.append(\"\\t(this == $o)\\n\");\n builder.append(\"\\t$a: \");\n builder.append(classNames.get(random.nextInt(classNames.size())));\n builder.append(\"()\\n\");\n builder.append(\"\\t\");\n builder.append(classNames.get(random.nextInt(classNames.size())));\n builder.append(\"\\t(this == $a)\\n\");\n builder.append(\"then\\n\");\n builder.append(\"end\\n\\n\");\n }\n \n RULES = builder.toString();\n }", "public void setRuleValueSet(Set<Map<String, Object>> ruleValueSet) {\n this.ruleValueSet = ruleValueSet;\n }", "com.appscode.api.kubernetes.v1beta2.Rule getRules(int index);", "CmdRule createCmdRule();", "public RuleBasedValidator() {\n globalRules = new ArrayList();\n rulesByProperty = new HashMap();\n }", "private ColourRuleSet parse(List<String> properties)\n\t{\n\t\t@SuppressWarnings(\"unused\")\n\t\tString ruleSetName = \"\";\n\t\t\n\t\tColourRuleSet ruleSet = new ColourRuleSet(properties.size());\n\t\t\n\t\tif(!expect(\"colourset\"))\n\t\t\treturn null;\n\t\t\n\t\tSymbol symbol = scanner.getSymbol();\n\t\t\n\t\tif(symbol.type == Symbol.Type.STRING)\n\t\t{\n\t\t\truleSetName = symbol.text;\n\t\t}\n\t\telse\n\t\t{\n\t\t\terror(\"Expected a name for the ruleset\");\n\t\t\treturn null;\n\t\t}\n\t\t\n\t\tif(!expect(\"{\"))\n\t\t\treturn null;\n\t\t\n\t\twhile(scanner.isValid()) \n\t\t{\n\t\t\tsymbol = scanner.peakSymbol();\n\t\t\tif(!symbol.text.equals(\"property\"))\n\t\t\t\tbreak;\n\t\t\t\n\t\t\treadColourRule(ruleSet, properties);\n\t\t}\n\n\t\texpect(\"}\");\n\t\t\n\t\treturn ruleSet;\n\t}", "public void addRule(String rulename, Rule rule, SpriteGroup[] obedients)\r\n\t{\r\n\t\tmyRuleBook.put(rulename, rule);\r\n\t\tmyRuleMap.put(rule, obedients);\r\n\t}", "java.util.List<com.appscode.api.kubernetes.v1beta2.Rule> \n getRulesList();", "public void addAllRules(Iterable<? extends ContextRule> values) {\n ensureRulesIsMutable();\n AbstractMessageLite.addAll(values, this.rules_);\n }", "public static List<IPattern> explodeRules(Grammar grammar, String rules)\n\t{\n\t\tList<GrammarRule> rules2 = parseGrammar(grammar, rules);\n\t\treturn grammar.setGrammarRules(rules2);\n\t}", "public static List ruleArrayToList(String [][] array)\t{\n\t\treturn appendToSyntax(array, new ArrayList(array.length));\n\t}", "private void getSensorConditions(List<RuleInstance> rules,Set<Condition> conds)\n{\n for (int i = 0; i < rules.size(); ++i) {\n RuleInstance ri1 = rules.get(i);\n for (int j = i+1; j < rules.size(); ++j) {\n\t RuleInstance ri2 = rules.get(j);\n\t if (ri1.getStateId() == ri2.getStateId()) continue;\n\t addSensorConditions(ri1,ri2,conds);\n }\n }\n}", "E1Rule createE1Rule();", "@SafeVarargs\n public static <T> Set<T> makeSet(T... entries) {\n return new HashSet<>(Arrays.asList(entries));\n }", "public T addRuleSet(final RuleSet ruleSet) {\n ruleSets.add(ruleSet);\n return (T)this;\n }", "ModelRule createModelRule();", "com.appscode.api.kubernetes.v1beta2.RuleOrBuilder getRulesOrBuilder(\n int index);", "public void deduceRules()\n{\n List<RuleInstance> allrules = loadRules();\n\n List<UpodRule> rules = new ArrayList<UpodRule>();\n for (UpodRule ur : for_program.getRules()) {\n if (ur.isExplicit()) {\n\t rules.add(ur);\n\t RuleInstance ri = new RuleInstance(ur,from_world.getUniverse());\n\t allrules.add(ri);\n }\n }\n\n Set<Condition> allconds = getConditions(allrules);\n\n tree_root = new TreeNode(allrules,null);\n\n expandTree(tree_root,allconds);\n\n generateRules(tree_root);\n}" ]
[ "0.6631089", "0.65375865", "0.6508029", "0.6377702", "0.6362703", "0.63551587", "0.6346002", "0.603954", "0.59138316", "0.5886966", "0.58798176", "0.5829861", "0.5829861", "0.5829861", "0.58206165", "0.58142036", "0.58068365", "0.57976943", "0.57484883", "0.56726205", "0.56341255", "0.5606531", "0.5451279", "0.54362345", "0.5433488", "0.54092765", "0.539878", "0.5390925", "0.5366657", "0.53293", "0.53267014", "0.530636", "0.52276975", "0.52216977", "0.521772", "0.5216115", "0.5210371", "0.5196144", "0.5185336", "0.51843446", "0.5170694", "0.51660675", "0.5155297", "0.51506245", "0.51495844", "0.5135688", "0.5112342", "0.5106318", "0.5078094", "0.50463235", "0.5045019", "0.5044253", "0.5041066", "0.5022493", "0.5020544", "0.501599", "0.501215", "0.5002545", "0.5001435", "0.49989152", "0.49837735", "0.4979686", "0.4975266", "0.4948231", "0.49290985", "0.4922031", "0.49030456", "0.48814854", "0.48795876", "0.4846926", "0.48210612", "0.48055652", "0.4804015", "0.4802061", "0.4783174", "0.4782345", "0.47551867", "0.47421494", "0.4729636", "0.4727953", "0.47192514", "0.4704857", "0.46979225", "0.4691414", "0.46885106", "0.4688446", "0.46852553", "0.46831855", "0.46762562", "0.4673706", "0.46705157", "0.46691385", "0.4665707", "0.4648207", "0.4641141", "0.46364117", "0.4630908", "0.46307206", "0.4627406", "0.46236068" ]
0.6552558
1
Creates a rule set with a given collection of rules.
public static RuleSet ofList(Iterable<? extends RelOptRule> rules) { return new ListRuleSet(ImmutableList.copyOf(rules)); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public RulesBook(Collection<Rule<A, B>> rules) {\n this(rules, StreamingRulesEngine.create());\n }", "IRuleset add(IRuleset...rules);", "@Required\n public void setRules(Set<Rule> rules)\n {\n this.rules = new TreeSet<Rule>(new RuleComparator());\n this.rules.addAll(rules);\n }", "public static RuleSet ofList(RelOptRule... rules) {\n return new ListRuleSet(ImmutableList.copyOf(rules));\n }", "public Taboo(List<T> rules) {\n\t\trule = new HashMap<>();\n\t\tfor(int i = 0; i < rules.size() - 1; i++) {\n\t\t\tif(rules.get(i) == null || rules.get(i+1) == null) continue;\n\t\t\tint hash = rules.get(i).hashCode();\n\t\t\tif(rule.containsKey(hash)) {\n\t\t\t\trule.get(hash).add(rules.get(i+1));\n\t\t\t}else {\n\t\t\t\tSet<T> val = new HashSet<>();\n\t\t\t\tval.add(rules.get(i+1));\n\t\t\t\trule.put(hash, val); \t\n\t\t\t}\n\t\t}\n\t}", "IRuleset add(IRuleset rule);", "public void setRules(List<T> rules) {\n\t\tthis.rules = rules;\n\t}", "public void setRules(ArrayList<Rule> rules) {\n\t\tthis.rules = rules;\n\t}", "public RuleSet (RuleList rulelist, SensorList sList) {\n \n this.references = new ArrayList();\n this.rulelist = rulelist;\n this.totalProb = -1.0;\n this.id = counter.incrementAndGet();\n this.indexesOfPrec = new ArrayList();\n this.precedences = new ArrayList ();\n this.sList = sList;\n }", "public RuleRegistrySet( RuleRegistry... ruleRegistries )\n {\n this( Arrays.asList( ruleRegistries ) );\n }", "@SuppressWarnings(\"unchecked\")\n\tprivate void setRules() {\n\t\tthis.result = Result.START;\n\t\t// Create all initial rule executors, and shuffle them if needed.\n\t\tthis.rules = new LinkedList<>();\n\t\tModule module = getModule();\n\t\tfor (Rule rule : module.getRules()) {\n\t\t\tRuleStackExecutor executor = (RuleStackExecutor) getExecutor(rule, getSubstitution());\n\t\t\texecutor.setContext(module);\n\t\t\tthis.rules.add(executor);\n\t\t}\n\t\tif (getRuleOrder() == RuleEvaluationOrder.RANDOM || getRuleOrder() == RuleEvaluationOrder.RANDOMALL) {\n\t\t\tCollections.shuffle((List<RuleStackExecutor>) this.rules);\n\t\t}\n\t}", "public RETEReasoner addRules(List rules) {\n List combined = new List( this.rules );\n combined.addAll( rules );\n setRules( combined );\n return this;\n }", "public ParallelProcessor(List<Rule> rules) {\n _rules = rules;\n }", "public Grammar(List<String> rules) throws IllegalArgumentException {\n\t\tif (rules == null || rules.isEmpty()) {\n\t\t\tthrow new IllegalArgumentException();\n\t\t}\n\t\tfor (String line : rules) {\n\t\t\tString[] pieces = line.split(\"::=\");\n\t\t\tString[] subpieces = pieces[1].split(\"\\\\|\");\n\t\t\tfor (int i = 0; i < subpieces.length; i++) {\n\t\t\t\tsubpieces[i] = subpieces[i].trim();\n\t\t\t}\n List<String> listSubpieces = Arrays.asList(subpieces);\n\t\t\tif (!this.grammarRules.containsKey(pieces[0])) {\n\t\t\t\tthis.grammarRules.put(pieces[0].trim(), listSubpieces);\n\t\t\t} else {\n List<String> newSymbols = new ArrayList<String>();\n newSymbols.addAll(this.grammarRules.get(pieces[0]));\n newSymbols.addAll(listSubpieces);\n this.grammarRules.put(pieces[0].trim(), newSymbols);\n }\n\t\t}\t\n\t}", "Rule createRule();", "Rule createRule();", "Rule createRule();", "private void loadRuleSets() throws CSSException {\n StyleSheet stylesheet = cssCode.getParsedCSS();\n for (RuleBlock block : stylesheet) {\n if (block instanceof RuleSet) {\n\n StringBuilder selectorString = new StringBuilder();\n RuleSet ruleSet = (RuleSet) block;\n\n List<CombinedSelector> selectors = ruleSet.getSelectors();\n Iterator<CombinedSelector> selectorsIterator = selectors.iterator();\n while (selectorsIterator.hasNext()) {\n CombinedSelector selector = selectorsIterator.next();\n selectorString.append(selector.toString());\n if (selectorsIterator.hasNext()) {\n selectorString.append(\", \");\n }\n }\n\n List<CSSRule> cssRules = new ArrayList<>();\n CSSRule cssRule;\n Declaration.Source source;\n DeclarationPosition declarationPosition;\n\n for (Declaration declaration : ruleSet) {\n cssRule = new CSSRule(declaration.getProperty(), \"\");\n\n source = declaration.getSource();\n if (source == null) {\n declarationPosition = null;\n } else {\n declarationPosition = new DeclarationPosition(source.getLine(), source.getPosition());\n }\n cssRule.setDeclarationPosition(declarationPosition);\n\n cssRules.add(cssRule);\n }\n\n CSSRuleSet cssRuleSet = new CSSRuleSet(selectorString.toString(), cssRules);\n\n this.cssRuleBlocks.add(cssRuleSet);\n\n // add record to the position-declaration map\n for (CSSRule iCssRule : cssRuleSet.getCssRules()) {\n this.declarationPositionMap.put(\n iCssRule.getDeclarationPosition(),\n new DeclarationSource(cssRuleSet, iCssRule)\n );\n }\n }\n }\n }", "public LogicalRule(ExecutionPolicy...rules)\n\t\t{\n\t\t\tthis.rules = rules;\n\t\t}", "@Test\r\n public void testAddRule() throws Exception{\r\n System.out.println(\"addRule\");\r\n RuleSetImpl instance = new RuleSetImpl(\"Test\", true);\r\n instance.addRule(new RegExRule(\".*\", \"string\"));\r\n instance.addRule(new RegExRule(\"a.*\", \"aString\"));\r\n List<Rule> rules = instance.getRules();\r\n assertTrue(rules.size()==2);\r\n }", "public void setRuleColumnSet(Set<String> ruleColumnSet) {\n this.ruleColumnSet = ruleColumnSet;\n }", "public void setData(Rule[] rules, String[] criteres) {\n\n\t\t// get all data\n\t\tthis.rules = rules;\n\t\tthis.criteres = criteres;\n\t\tdrawGraph();\n\t}", "private Set<Condition> getConditions(List<RuleInstance> rules)\n{\n Set<Condition> conds = new HashSet<Condition>();\n\n getTimeConditions(rules,conds);\n getSensorConditions(rules,conds);\n getCalendarConditions(rules,conds);\n\n return null;\n}", "List<? extends Rule> getRules();", "@Override\n public void setRules(List rules) {\n this.rules = rules;\n if (schemaGraph != null) {\n // The change of rules invalidates the existing precomputed schema graph\n // This might be recoverable but for now simply flag the error and let the\n // user reorder their code to set the rules before doing a bind!\n throw new ReasonerException(\"Cannot change the rule set for a bound rule reasoner.\\nSet the rules before calling bindSchema\");\n }\n }", "public void xsetRules(com.walgreens.rxit.ch.cda.StrucDocTable.Rules rules)\n {\n synchronized (monitor())\n {\n check_orphaned();\n com.walgreens.rxit.ch.cda.StrucDocTable.Rules target = null;\n target = (com.walgreens.rxit.ch.cda.StrucDocTable.Rules)get_store().find_attribute_user(RULES$26);\n if (target == null)\n {\n target = (com.walgreens.rxit.ch.cda.StrucDocTable.Rules)get_store().add_attribute_user(RULES$26);\n }\n target.set(rules);\n }\n }", "public ArrayList<RuleSet> getRuleSets() {\n return ruleSets;\n }", "ExprListRule createExprListRule();", "protected PmdRuleset createPmdRuleset(List<ActiveRule> activeRules, String profileName) {\n PmdRuleset ruleset = new PmdRuleset(profileName);\n\n for (ActiveRule activeRule : activeRules) {\n if (activeRule.getRule().getRepositoryKey().equals(PhpmdRuleRepository.PHPMD_REPOSITORY_KEY)) {\n String configKey = activeRule.getRule().getConfigKey();\n PmdRule rule = new PmdRule(configKey, mapper.to(activeRule.getSeverity()));\n List<ActiveRuleParam> activeRuleParams = activeRule.getActiveRuleParams();\n if (activeRuleParams != null && !activeRuleParams.isEmpty()) {\n List<PmdProperty> properties = new ArrayList<PmdProperty>();\n for (ActiveRuleParam activeRuleParam : activeRuleParams) {\n properties.add(new PmdProperty(activeRuleParam.getRuleParam().getKey(), activeRuleParam.getValue()));\n }\n rule.setProperties(properties);\n }\n ruleset.addRule(rule);\n processXPathRule(activeRule.getRuleKey(), rule);\n }\n }\n return ruleset;\n }", "public static JsonObject ruleAll(final Collection<KRuleTerm> rules, final JsonObject input) {\n return Unique.ruleAll(rules, input);\n }", "RuleCatalog createRuleCatalog();", "private static Collection<? extends Rule> getRules(ObjectFactory objFactory, Value cwe, Repository repository, Value segment)\n {\n HashMap<String, Rule> ruleSet = new HashMap<String, CWECoverageClaimType.Claims.Claim.RuleSet.Rule>();\n RepositoryConnection con = null;\n try\n {\n con = getRepositoryConnection(repository);\n \n String adaptorQuery = \"SELECT ?descriptionText WHERE {<\"+segment+\"> <http://toif/contains> ?finding. ?finding <http://toif/toif:FindingHasCWEIdentifier> <\" + cwe + \"> . \"\n + \"?finding <http://toif/toif:FindingIsDescribedByWeaknessDescription> ?description . \"\n + \"?description <http://toif/description> ?descriptionText . }\";\n \n TupleQuery adaptorTupleQuery = con.prepareTupleQuery(QueryLanguage.SPARQL, adaptorQuery);\n \n TupleQueryResult queryResult = adaptorTupleQuery.evaluate();\n \n while (queryResult.hasNext())\n {\n BindingSet adaptorSet = queryResult.next();\n Value name = adaptorSet.getValue(\"descriptionText\");\n \n String nameString = name.stringValue();\n \n String[] descArray = nameString.split(\":\");\n \n String ident = descArray[0];\n String description = descArray[1];\n \n if (!ruleSet.containsKey(ident))\n {\n Rule rule = objFactory.createCWECoverageClaimTypeClaimsClaimRuleSetRule();\n ruleSet.put(ident, rule);\n }\n \n Rule rule = ruleSet.get(ident);\n rule.setRuleID(ident);\n rule.setRuleName(ident);\n rule.setRuleComments(description);\n \n }\n \n queryResult.close();\n }\n catch (RepositoryException e)\n {\n e.printStackTrace();\n }\n catch (MalformedQueryException e)\n {\n e.printStackTrace();\n }\n catch (QueryEvaluationException e)\n {\n e.printStackTrace();\n }\n finally\n {\n try\n {\n con.close();\n }\n catch (RepositoryException e)\n {\n e.printStackTrace();\n }\n }\n return ruleSet.values();\n \n }", "public static ArrayList<Rule> getRulesFromItemset(ArrayList<String> itemSet, DataSet dataSet, double minConfidence) {\n\t\tArrayList<Rule> rules = new ArrayList<Rule>();\n\t\t\n\t\tArrayList<ArrayList<String>> subsets = allSubsets(itemSet);\n\t\t\n\t\tfor(ArrayList<String> subset : subsets) {\n\t\t\tRule r = new Rule();\n\t\t\tr.LHS = subset;\n\t\t\tr.RHS = complement(itemSet, subset);\n\t\t\t\n\t\t\tArrayList<String> allItems = new ArrayList<String>();\n\t\t\tallItems.addAll(r.LHS);\n\t\t\tallItems.addAll(r.RHS);\n\t\t\tr.supportFound = dataSet.findSupport(allItems);\n\t\t\tr.confidenceFound = dataSet.findConfidence(r);\n\t\t\t\n\t\t\tif(r.confidenceFound >= minConfidence) {\n\t\t\t\trules.add(r);\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn rules;\n\t}", "public RulesEngineInner withRules(List<RulesEngineRule> rules) {\n if (this.innerProperties() == null) {\n this.innerProperties = new RulesEngineProperties();\n }\n this.innerProperties().withRules(rules);\n return this;\n }", "public static List<Rule> fromRDF(final Iterable<Statement> model) {\n\n // Load namespaces from model metadata, reusing default prefix/ns mappings\n final Map<String, String> namespaces = new HashMap<>(Namespaces.DEFAULT.uriMap());\n if (model instanceof Model) {\n for (final Namespace namespace : ((Model) model).getNamespaces()) {\n namespaces.put(namespace.getPrefix(), namespace.getName());\n }\n }\n for (final Statement stmt : model) {\n if (stmt.getSubject() instanceof URI && stmt.getObject() instanceof Literal\n && stmt.getPredicate().equals(RR.PREFIX_PROPERTY)) {\n namespaces.put(stmt.getObject().stringValue(), stmt.getSubject().stringValue());\n }\n }\n\n // Use a 5-fields Object[] record to collect the attributes of each rule.\n // fields: 0 = fixpoint, 1 = phase, 2 = delete expr, 3 = insert expr, 4 = where expr\n final Map<URI, Object[]> records = new HashMap<>();\n\n // Scan the statements, extracting rule properties and populating the records map\n for (final Statement stmt : model) {\n try {\n if (stmt.getSubject() instanceof URI) {\n\n // Extract relevant statement components\n final URI subj = (URI) stmt.getSubject();\n final URI pred = stmt.getPredicate();\n final Value obj = stmt.getObject();\n\n // Identify field and value (if any) of corresponding Object[] record\n int field = -1;\n Object value = null;\n if (pred.equals(RDF.TYPE)) {\n field = 0;\n if (obj.equals(RR.FIXPOINT_RULE)) {\n value = true;\n } else if (obj.equals(RR.NON_FIXPOINT_RULE)) {\n value = false;\n }\n } else if (pred.equals(RR.PHASE)) {\n field = 1;\n value = ((Literal) obj).intValue();\n } else if (pred.equals(RR.DELETE)) {\n field = 2;\n } else if (pred.equals(RR.INSERT) || pred.equals(RR.HEAD)) {\n field = 3;\n } else if (pred.equals(RR.WHERE) || pred.equals(RR.BODY)) {\n field = 4;\n }\n if (field == 2 || field == 3 || field == 4) {\n value = Algebra.parseTupleExpr(stmt.getObject().stringValue(), null,\n namespaces);\n }\n\n // Update Object[] records if the statement is about a rule\n if (value != null) {\n Object[] record = records.get(subj);\n if (record == null) {\n record = new Object[] { true, 0, null, null, null };\n records.put(subj, record);\n }\n record[field] = value;\n }\n }\n } catch (final Throwable ex) {\n throw new IllegalArgumentException(\"Invalid rule attribute in statement: \" + stmt,\n ex);\n }\n }\n\n // Generate the rules from parsed heads and bodies\n final List<Rule> rules = new ArrayList<>();\n for (final Map.Entry<URI, Object[]> entry : records.entrySet()) {\n final URI id = entry.getKey();\n final Object[] record = entry.getValue();\n rules.add(new Rule(id, (Boolean) record[0], (Integer) record[1],\n (TupleExpr) record[2], (TupleExpr) record[3], (TupleExpr) record[4]));\n }\n return rules;\n }", "public static SectionSets createFromSections (Collection<Section> sections)\r\n {\r\n SectionSets sectionSets = new SectionSets();\r\n sectionSets.sets = new ArrayList<>();\r\n sectionSets.sets.add(sections);\r\n\r\n return sectionSets;\r\n }", "private void createQoSRules() {\n JsonObject settings = new JsonObject();\n JsonObject config = new JsonObject();\n JsonObject sentinels = new JsonObject();\n JsonObject rules = new JsonObject();\n\n // config\n config.put(\"percentile\", 75);\n config.put(\"quorum\", 40);\n config.put(\"period\", 3);\n config.put(\"minSampleCount\", 1000);\n config.put(\"minSentinelCount\", 5);\n settings.put(\"config\", config);\n\n // sentinels\n JsonObject sentinel1 = new JsonObject();\n sentinel1.put(\"percentile\", 50);\n JsonObject sentinel2 = new JsonObject();\n JsonObject sentinel3 = new JsonObject();\n JsonObject sentinel4 = new JsonObject();\n JsonObject sentinel5 = new JsonObject();\n sentinels.put(\"sentinelA\", sentinel1);\n sentinels.put(\"sentinelB\", sentinel2);\n sentinels.put(\"sentinelC\", sentinel3);\n sentinels.put(\"sentinelD\", sentinel4);\n sentinels.put(\"sentinelE\", sentinel5);\n settings.put(\"sentinels\", sentinels);\n\n // rules\n JsonObject rule1 = new JsonObject();\n rule1.put(\"reject\", 1.3);\n rule1.put(\"warn\", 1.1);\n rules.put(\"/playground/myapi1/v1/.*\", rule1);\n\n JsonObject rule2 = new JsonObject();\n rule2.put(\"reject\", 1.7);\n rules.put(\"/playground/myapi2/v1/.*\", rule2);\n\n settings.put(\"rules\", rules);\n\n // PUT the QoS rules\n given().body(settings.toString()).put(\"server/admin/v1/qos\").then().assertThat().statusCode(200);\n }", "void setRule(Rule rule);", "public boolean addRules( ArrayList<Rule> ruleList ) {\n\t\tfor( int i=0; i < ruleList.size(); i++ ) {\n\t\t\tif( !validRule(ruleList.get(i)) ) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\t\tthis.rules = ruleList;\n\t\treturn true;\n\t}", "public RETEReasoner(List rules) {\n if (rules == null) throw new NullPointerException( \"null rules\" );\n this.rules = rules;\n }", "public void setRuleFinders(List ruleFinders) {\n this.ruleFinders = ruleFinders;\n }", "public T addRuleSet(final RuleSet ruleSet) {\n ruleSets.add(ruleSet);\n return (T)this;\n }", "public void addExceptionRules(Collection<PatternActionRule> rules) {\n\t\tthis.patternActionRules.addAll(rules);\n\t\tCollections.sort(this.patternActionRules);\n\t}", "public Rule(List<ICondition> conditions)\r\n\t{\r\n\t\tif (conditions != null)\r\n\t\t{\r\n\t\t\tthis.conditions = conditions;\r\n\t\t}\r\n\t}", "public void setRules(com.walgreens.rxit.ch.cda.StrucDocTable.Rules.Enum rules)\n {\n synchronized (monitor())\n {\n check_orphaned();\n org.apache.xmlbeans.SimpleValue target = null;\n target = (org.apache.xmlbeans.SimpleValue)get_store().find_attribute_user(RULES$26);\n if (target == null)\n {\n target = (org.apache.xmlbeans.SimpleValue)get_store().add_attribute_user(RULES$26);\n }\n target.setEnumValue(rules);\n }\n }", "@Autowired(required=false)\n public void addRuleAssociations(Set<DecideRuledSheetAssociation> associations) {\n // always keep sorted by order\n this.ruleAssociations.clear();\n this.ruleAssociations.addAll(associations);\n }", "private static void getRulesFromFile() {\n File ruleFolder = new File(\"rules\");\n List<String> packageManagersWithRules = Stream.of(ruleFolder.list())\n .filter(f -> f.endsWith(\".rules\"))\n .map(f -> f.substring(0,f.lastIndexOf('.')))\n .sorted()\n .collect(Collectors.toList());\n\n RULES_BY_PACKAGE = new HashMap<>();\n for (String packagemanager : packageManagersWithRules) {\n RULES_BY_PACKAGE.put(packagemanager, parseRules(ruleFolder, packagemanager));\n }\n\n }", "private void createRules(List<PatternToken> elemList,\n List<PatternToken> tmpPatternTokens, int numElement) {\n String shortMessage = \"\";\n if (this.shortMessage != null && this.shortMessage.length() > 0) {\n shortMessage = this.shortMessage.toString();\n } else if (shortMessageForRuleGroup != null && shortMessageForRuleGroup.length() > 0) {\n shortMessage = this.shortMessageForRuleGroup.toString();\n }\n if (numElement >= elemList.size()) {\n AbstractPatternRule rule;\n if (tmpPatternTokens.size() > 0) {\n rule = new PatternRule(id, language, tmpPatternTokens, name,\n message.toString(), shortMessage,\n suggestionsOutMsg.toString(), phrasePatternTokens.size() > 1, interpretPosTagsPreDisambiguation);\n rule.addTags(ruleTags);\n rule.addTags(ruleGroupTags);\n rule.addTags(categoryTags);\n rule.setSourceFile(sourceFile);\n } else if (regex.length() > 0) {\n int flags = regexCaseSensitive ? 0 : Pattern.CASE_INSENSITIVE|Pattern.UNICODE_CASE;\n String regexStr = regex.toString();\n if (regexMode == RegexpMode.SMART) {\n // Note: it's not that easy to add \\b because the regex might look like '(foo)' or '\\d' so we cannot just look at the last character\n regexStr = replaceSpacesInRegex(regexStr);\n }\n if (ruleAntiPatterns.size() > 0 || rulegroupAntiPatterns.size() > 0) {\n throw new RuntimeException(\"<regexp> rules currently cannot be used together with <antipattern>. Rule id: \" + id + \"[\" + subId + \"]\");\n }\n rule = new RegexPatternRule(id, name, message.toString(), shortMessage, suggestionsOutMsg.toString(), language, Pattern.compile(regexStr, flags), regexpMark);\n rule.setSourceFile(sourceFile);\n } else {\n throw new IllegalStateException(\"Neither '<pattern>' tokens nor '<regex>' is set in rule '\" + id + \"'\");\n }\n setRuleFilter(filterClassName, filterArgs, rule);\n prepareRule(rule);\n rules.add(rule);\n } else {\n PatternToken patternToken = elemList.get(numElement);\n if (patternToken.hasOrGroup()) {\n // When creating a new rule, we finally clear the backed-up variables. All the elements in\n // the OR group should share the values of backed-up variables. That's why these variables\n // are backed-up.\n List<Match> suggestionMatchesBackup = new ArrayList<>(suggestionMatches);\n List<Match> suggestionMatchesOutMsgBackup = new ArrayList<>(suggestionMatchesOutMsg);\n int startPosBackup = startPos;\n int endPosBackup = endPos;\n List<DisambiguationPatternRule> ruleAntiPatternsBackup = new ArrayList<>(ruleAntiPatterns);\n for (PatternToken patternTokenOfOrGroup : patternToken.getOrGroup()) {\n List<PatternToken> tmpElements2 = new ArrayList<>();\n tmpElements2.addAll(tmpPatternTokens);\n tmpElements2.add(ObjectUtils.clone(patternTokenOfOrGroup));\n createRules(elemList, tmpElements2, numElement + 1);\n startPos = startPosBackup;\n endPos = endPosBackup;\n suggestionMatches = suggestionMatchesBackup;\n suggestionMatchesOutMsg = suggestionMatchesOutMsgBackup;\n ruleAntiPatterns.addAll(ruleAntiPatternsBackup);\n }\n }\n tmpPatternTokens.add(ObjectUtils.clone(patternToken));\n createRules(elemList, tmpPatternTokens, numElement + 1);\n }\n }", "@SuppressWarnings({ \"rawtypes\", \"unchecked\" })\n public static void main(String[] args) throws ConfigurationException,\n RuleExecutionSetCreateException, IOException,\n RuleSessionTypeUnsupportedException, RuleSessionCreateException,\n RuleExecutionSetNotFoundException, InvalidRuleSessionException,\n ClassNotFoundException, RuleExecutionSetRegisterException {\n\n String ruleEngineServiceUri = UriConstants.RULE_ENGINE_SERVICE_URI;\n\n Class.forName(UriConstants.RULE_SERVICE_PROVIDER_CLASS_NAME);\n\n RuleServiceProvider serviceProvider = RuleServiceProviderManager\n .getRuleServiceProvider(ruleEngineServiceUri);\n\n RuleAdministrator ruleAdministrator = serviceProvider\n .getRuleAdministrator();\n\n RuleEngineLog.debug(ruleAdministrator.toString());\n\n Map params = null;\n // InputStream stream = null;\n\n String bindUri = null;\n\n LogisticsRule logisticsRule = buildLogisticsRule();\n\n FlavorRule flavorRule = buildFlavorRule();\n\n RuleSet ruleSet = new RuleSet(\"multi-logisitic--ruleset\");\n\n ruleSet.addRule(logisticsRule);\n ruleSet.addRule(flavorRule);\n // ruleSet.add(logisticsRule1);\n\n RuleExecutionSet ruleExecutionSet = ruleAdministrator\n .getLocalRuleExecutionSetProvider(params).createRuleExecutionSet(\n ruleSet, null);\n\n bindUri = ruleExecutionSet.getName();\n\n ruleAdministrator.registerRuleExecutionSet(bindUri, ruleExecutionSet, null);\n\n RuleEngineLog.debug(ruleExecutionSet);\n //\n RuleRuntime ruleRunTime = serviceProvider.getRuleRuntime();\n\n StatelessRuleSession srs = (StatelessRuleSession) ruleRunTime\n .createRuleSession(bindUri, params, RuleRuntime.STATELESS_SESSION_TYPE);\n\n List inputList = new LinkedList();\n\n String productReview1 = \"一直在你们家购买,感觉奶粉是保真的。就是发货速度稍微再快一些就好了。先谢谢了\";\n\n String productReview2 = \"说什么原装进口的 但是和我原本进口的奶粉还是有区别 奶很甜 宝宝吃了这个奶粉后胃口很差 都不爱吃其他东西 本来每天定时有吃两顿饭的 现在吃了这个奶粉后 饭也不要吃了 现在一个没有开 另一罐开了放着没有喝\";\n\n ProductReview pr1 = new ProductReview(\"uid1\", productReview1);\n\n ProductReview pr2 = new ProductReview(\"uid2\", productReview2);\n\n inputList.add(pr1);\n inputList.add(pr2);\n\n // inputList.add(new String(\"Bar\"));\n // inputList.add(new Integer(5));\n // inputList.add(new Float(6));\n List resultList = srs.executeRules(inputList);\n\n // release the session\n srs.release();\n\n // System.out.println(\"executeRules: \" + resultList);\n for (Object o : resultList) {\n System.out.println(o);\n }\n\n }", "public void setRuleValueSet(Set<Map<String, Object>> ruleValueSet) {\n this.ruleValueSet = ruleValueSet;\n }", "public RulesBook() {\n this(new ArrayList<>());\n }", "@Test\n public void createRule() {\n // BEGIN: com.azure.messaging.servicebus.servicebusrulemanagerclient.createRule\n RuleFilter trueRuleFilter = new TrueRuleFilter();\n CreateRuleOptions options = new CreateRuleOptions(trueRuleFilter);\n ruleManager.createRule(\"new-rule\", options);\n // END: com.azure.messaging.servicebus.servicebusrulemanagerclient.createRule\n\n ruleManager.close();\n }", "public RuleBasedValidator() {\n globalRules = new ArrayList();\n rulesByProperty = new HashMap();\n }", "@Override\r\n protected void initializeRules(List<AbstractValidationCheck> rules) {\n\r\n }", "public abstract void registerRuleSet(String bindUri, String ruleSetName) throws RemoteException, RuleException;", "public void deduceRules()\n{\n List<RuleInstance> allrules = loadRules();\n\n List<UpodRule> rules = new ArrayList<UpodRule>();\n for (UpodRule ur : for_program.getRules()) {\n if (ur.isExplicit()) {\n\t rules.add(ur);\n\t RuleInstance ri = new RuleInstance(ur,from_world.getUniverse());\n\t allrules.add(ri);\n }\n }\n\n Set<Condition> allconds = getConditions(allrules);\n\n tree_root = new TreeNode(allrules,null);\n\n expandTree(tree_root,allconds);\n\n generateRules(tree_root);\n}", "private void getTimeConditions(List<RuleInstance> rules,Set<Condition> conds)\n{\n for (RuleInstance ri : rules) {\n getTimeConditions(ri,rules,conds);\n }\n}", "IdListRule createIdListRule();", "public RBGPProgram(final Rule[] rules) {\r\n super();\r\n this.m_rules = rules;\r\n }", "public Set<Class<? extends Rule<?, ?>>> getTransformationRules();", "private static void go(List<CodeShapeRule> rules, List<State> states) {\n\t\trules.stream().map(rule -> new Feature(rule, rule.index)).collect(Collectors.toList());\n\n\t}", "NFRuleSet findRuleSet(String name)\n/* */ throws IllegalArgumentException\n/* */ {\n/* 1799 */ for (int i = 0; i < this.ruleSets.length; i++) {\n/* 1800 */ if (this.ruleSets[i].getName().equals(name)) {\n/* 1801 */ return this.ruleSets[i];\n/* */ }\n/* */ }\n/* 1804 */ throw new IllegalArgumentException(\"No rule set named \" + name);\n/* */ }", "public AdornedRules(final Mapping map) {\n adornedRules = new ArrayList<>();\n adornedPredicates = new ArrayList<>();\n init(map);\n }", "StatementRule createStatementRule();", "public Grammar(List<String> rules) {\r\n if (rules == null || rules.isEmpty()) {\r\n throw new IllegalArgumentException();\r\n }\r\n // initialize map for BNF rules.\r\n this.bnfRuleMap = new TreeMap<String, List<String>>();\r\n this.num = new Random();\r\n // process each BNF rule into the map.\r\n for (int i = 0; i < rules.size(); i++) {\r\n String rule = rules.get(i);\r\n // Separate the non-terminal from terminal.\r\n String[] pieces = rule.split(\"::=\");\r\n String nonTerminal = pieces[0].trim();\r\n // Separate different terminals.\r\n String[] terminals = pieces[1].split(\"\\\\|\");\r\n List<String> valueTerminals = new ArrayList<String>();\r\n valueTerminals = Arrays.asList(terminals);\r\n if (!this.bnfRuleMap.containsKey(nonTerminal)) {\r\n this.bnfRuleMap.put(nonTerminal, new ArrayList<String>());\r\n }\r\n this.bnfRuleMap.get(nonTerminal).addAll(valueTerminals);\r\n }\r\n }", "public void add_rule(Rule rule) throws Exception;", "protected RETEReasoner(List rules, Graph schemaGraph) {\n this(rules);\n this.schemaGraph = schemaGraph;\n }", "public RuleRegistrySet( Collection<RuleRegistry> ruleRegistries )\n {\n this.ruleRegistries.addAll( ruleRegistries );\n\n for( RuleRegistry ruleRegistry : ruleRegistries )\n {\n if( Collections.frequency( this.ruleRegistries, ruleRegistry ) > 1 )\n throw new IllegalArgumentException( \"may not include duplicate registries\" );\n }\n }", "public List<Rule> findAll();", "public OrRule(ExecutionPolicy...rules)\n\t\t{\n\t\t\tsuper(rules);\n\t\t}", "public XorRule(ExecutionPolicy...rules)\n\t\t{\n\t\t\tsuper(rules);\n\t\t}", "private void generateRules(TreeNode tn)\n{\n if (!tn.isLeaf()) {\n generateRules(tn.getPassTree());\n generateRules(tn.getFailTree());\n return;\n }\n RuleInstance ri = tn.getRules().get(0);\n if (ri.getBaseRule() != null) return;\t// rule already in set\n\n Condition c = tn.getCondition();\n List<UpodCondition> cset = new ArrayList<UpodCondition>();\n if (c != null) {\n UpodCondition cond = c.getConditionTest(for_program);\n if (cond != null) cset.add(cond);\n }\n for (TreeNode pn = tn.getParent(); pn != null; pn = pn.getParent()) {\n Condition pc = pn.getCondition();\n if (pc == null) continue;\n UpodCondition pcond = pc.getConditionTest(for_program);\n if (pcond != null) cset.add(pcond);\n }\n\n UpodCondition rcond = null;\n if (cset.isEmpty()) return;\n if (cset.size() == 1) rcond = cset.get(0);\n else {\n UpodCondition [] conds = new UpodCondition[cset.size()];\n conds = cset.toArray(conds);\n rcond = new BasisConditionLogical.And(conds);\n }\n List<UpodAction> racts = ri.getActions();\n if (rcond == null || racts == null) return;\n\n BasisRule rule = new BasisRule(rcond,racts,null,100);\n for_program.addRule(rule);\n}", "@Test\r\n\tpublic void testRuleSets2() throws Exception{\r\n\t\t\r\n\t\tAssert.assertEquals(0L, testAdminCon.size());\r\n\t\ttestAdminCon.add(micah, lname, micahlname, dirgraph1);\r\n\t\ttestAdminCon.add(micah, fname, micahfname, dirgraph1);\r\n\t\ttestAdminCon.add(micah, developPrototypeOf, semantics, dirgraph1);\r\n\t\ttestAdminCon.add(micah, type, sEngineer, dirgraph1);\r\n\t\ttestAdminCon.add(micah, worksFor, ml, dirgraph1);\r\n\t\t\r\n\t\ttestAdminCon.add(john, fname, johnfname,dirgraph);\r\n\t\ttestAdminCon.add(john, lname, johnlname,dirgraph);\r\n\t\ttestAdminCon.add(john, writeFuncSpecOf, inference, dirgraph);\r\n\t\ttestAdminCon.add(john, type, lEngineer, dirgraph);\r\n\t\ttestAdminCon.add(john, worksFor, ml, dirgraph);\r\n\t\t\r\n\t\ttestAdminCon.add(writeFuncSpecOf, subProperty, design, dirgraph1);\r\n\t\ttestAdminCon.add(developPrototypeOf, subProperty, design, dirgraph1);\r\n\t\ttestAdminCon.add(design, subProperty, develop, dirgraph1);\r\n\t\t\r\n\t\ttestAdminCon.add(lEngineer, subClass, engineer, dirgraph1);\r\n\t\ttestAdminCon.add(sEngineer, subClass, engineer, dirgraph1);\r\n\t\ttestAdminCon.add(engineer, subClass, employee, dirgraph1);\r\n\t\t\r\n\t\tString query = \"select (count (?s) as ?totalcount) where {?s ?p ?o .} \";\r\n\t\tTupleQuery tupleQuery = testAdminCon.prepareTupleQuery(QueryLanguage.SPARQL, query);\r\n\t\t((MarkLogicQuery) tupleQuery).setRulesets(SPARQLRuleset.RDFS_PLUS_FULL);\r\n\t\tTupleQueryResult result\t= tupleQuery.evaluate();\r\n\t\t\r\n\t\ttry {\r\n\t\t\tassertThat(result, is(notNullValue()));\r\n\t\t\tassertThat(result.hasNext(), is(equalTo(true)));\r\n\t\t\twhile (result.hasNext()) {\r\n\t\t\t\tBindingSet solution = result.next();\r\n\t\t\t\tassertThat(solution.hasBinding(\"totalcount\"), is(equalTo(true)));\r\n\t\t\t\tValue count = solution.getValue(\"totalcount\");\r\n\t\t\t\tAssert.assertEquals(374, Integer.parseInt(count.stringValue()));\r\n\t\t\t}\r\n\t\t}\r\n\t\tfinally {\r\n\t\t\tresult.close();\r\n\t\t}\r\n\t\r\n\t\tRepositoryResult<Statement> resultg = testAdminCon.getStatements(null, null, null, true, dirgraph, dirgraph1);\r\n\t\t\r\n\t\tassertNotNull(\"Iterator should not be null\", resultg);\r\n\t\tassertTrue(\"Iterator should not be empty\", resultg.hasNext());\r\n\t\t\t\t\r\n\t\ttupleQuery = testAdminCon.prepareTupleQuery(QueryLanguage.SPARQL, query);\r\n\t\t((MarkLogicQuery) tupleQuery).setRulesets(SPARQLRuleset.EQUIVALENT_CLASS);\r\n\t\tresult = tupleQuery.evaluate();\r\n\t\t\r\n\t\ttry {\r\n\t\t\tassertThat(result, is(notNullValue()));\r\n\t\t\tassertThat(result.hasNext(), is(equalTo(true)));\r\n\t\t\twhile (result.hasNext()) {\r\n\t\t\t\tBindingSet solution = result.next();\r\n\t\t\t\tassertThat(solution.hasBinding(\"totalcount\"), is(equalTo(true)));\r\n\t\t\t\tValue count = solution.getValue(\"totalcount\");\r\n\t\t\t\tAssert.assertEquals(18, Integer.parseInt(count.stringValue()));\r\n\t\t\t}\r\n\t\t}\r\n\t\tfinally {\r\n\t\t\tresult.close();\r\n\t\t}\r\n\t\t\r\n\t\ttupleQuery = testAdminCon.prepareTupleQuery(QueryLanguage.SPARQL, query);\r\n\t\t((MarkLogicQuery) tupleQuery).setRulesets(SPARQLRuleset.RDFS,SPARQLRuleset.INVERSE_OF);\r\n\t\tresult = tupleQuery.evaluate();\r\n\t\t\r\n\t\ttry {\r\n\t\t\tassertThat(result, is(notNullValue()));\r\n\t\t\tassertThat(result.hasNext(), is(equalTo(true)));\r\n\t\t\twhile (result.hasNext()) {\r\n\t\t\t\tBindingSet solution = result.next();\r\n\t\t\t\tassertThat(solution.hasBinding(\"totalcount\"), is(equalTo(true)));\r\n\t\t\t\tValue count = solution.getValue(\"totalcount\");\r\n\t\t\t\tAssert.assertEquals(86, Integer.parseInt(count.stringValue()));\r\n\t\t\t}\r\n\t\t}\r\n\t\tfinally {\r\n\t\t\tresult.close();\r\n\t\t}\r\n\t\t\r\n\t\ttupleQuery = testAdminCon.prepareTupleQuery(QueryLanguage.SPARQL, query);\r\n\t\t((MarkLogicQuery) tupleQuery).setRulesets(null,SPARQLRuleset.INVERSE_OF);\r\n\t\tresult = tupleQuery.evaluate();\r\n\t\t\r\n\t\ttry {\r\n\t\t\tassertThat(result, is(notNullValue()));\r\n\t\t\tassertThat(result.hasNext(), is(equalTo(true)));\r\n\t\t\twhile (result.hasNext()) {\r\n\t\t\t\tBindingSet solution = result.next();\r\n\t\t\t\tassertThat(solution.hasBinding(\"totalcount\"), is(equalTo(true)));\r\n\t\t\t\tValue count = solution.getValue(\"totalcount\");\r\n\t\t\t\tAssert.assertEquals(18, Integer.parseInt(count.stringValue()));\r\n\t\t\t}\r\n\t\t}\r\n\t\tfinally {\r\n\t\t\tresult.close();\r\n\t\t}\r\n\t\t\r\n\t\ttupleQuery = testAdminCon.prepareTupleQuery(QueryLanguage.SPARQL, query);\r\n\t\t((MarkLogicQuery) tupleQuery).setRulesets((SPARQLRuleset)null, null);\r\n\t\ttupleQuery.setIncludeInferred(false);\r\n\t\tresult = tupleQuery.evaluate();\r\n\t\t\r\n\t\ttry {\r\n\t\t\tassertThat(result, is(notNullValue()));\r\n\t\t\tassertThat(result.hasNext(), is(equalTo(true)));\r\n\t\t\twhile (result.hasNext()) {\r\n\t\t\t\tBindingSet solution = result.next();\r\n\t\t\t\tassertThat(solution.hasBinding(\"totalcount\"), is(equalTo(true)));\r\n\t\t\t\tValue count = solution.getValue(\"totalcount\");\r\n\t\t\t\tAssert.assertEquals(16, Integer.parseInt(count.stringValue()));\r\n\t\t\t}\r\n\t\t}\r\n\t\tfinally {\r\n\t\t\tresult.close();\r\n\t\t}\r\n\t}", "public abstract void setEventRulesOfSentence(List<EventRule> eventRulesOfSentence);", "public void addAllRules(Iterable<? extends ContextRule> values) {\n ensureRulesIsMutable();\n AbstractMessageLite.addAll(values, this.rules_);\n }", "public abstract void setRules (CellProfile rules);", "private ExecutionPolicy[] makeRuleArray(ExecutionPolicy rule, ExecutionPolicy[] ruleArray)\n\t{\n\t\tExecutionPolicy[] result = new ExecutionPolicy[ruleArray.length + 1];\n\t\tint count = 0;\n\t\tresult[count++] = rule;\n\t\tfor (ExecutionPolicy r: ruleArray) result[count++] = r;\n\t\treturn result;\n\t}", "public static List<Rule> mergeSameWhereExpr(final Iterable<Rule> rules) {\n\n // Group together rules with the same fixpoint, phase and WHERE expression\n final Map<List<Object>, List<Rule>> clusters = new HashMap<>();\n for (final Rule rule : rules) {\n final List<Object> key = Arrays.asList(rule.fixpoint, rule.phase, rule.whereExpr);\n List<Rule> cluster = clusters.get(key);\n if (cluster == null) {\n cluster = new ArrayList<>();\n clusters.put(key, cluster);\n }\n cluster.add(rule);\n }\n\n // Create a merged rule for each cluster obtained before\n final List<Rule> mergedRules = new ArrayList<>();\n for (final List<Rule> cluster : clusters.values()) {\n final Rule first = cluster.get(0);\n final String namespace = first.getID().getNamespace();\n final Set<String> names = new TreeSet<>();\n TupleExpr newDeleteExpr = null;\n TupleExpr newInsertExpr = null;\n for (int i = 0; i < cluster.size(); ++i) {\n final Rule rule = cluster.get(i);\n final String s = rule.getID().getLocalName();\n final int index = s.indexOf(\"__\");\n names.add(index < 0 ? s : s.substring(0, index));\n newDeleteExpr = newDeleteExpr == null ? rule.deleteExpr //\n : new Join(newDeleteExpr, rule.deleteExpr);\n newInsertExpr = newInsertExpr == null ? rule.insertExpr //\n : new Join(newInsertExpr, rule.insertExpr);\n }\n final URI id = newID(namespace + String.join(\"_\", names));\n mergedRules.add(new Rule(id, first.fixpoint, first.phase, newDeleteExpr,\n newInsertExpr, first.whereExpr));\n }\n return mergedRules;\n }", "public RuleSet (RuleSet RS1, RuleSet RS2, SensorList sList, SensorMap sMap, RuleMap rMap) {\n \n // CREATING COMBINATION RULESET FROM RS1 & RS2\n \n this.references = new ArrayList();\n this.sList = sList;\n this.rulelist = RS1.rulelist;\n this.totalProb = 0.0;\n this.id = counter.incrementAndGet();\n this.precedences = new ArrayList ();\n Sensor precondition = RS1.getPrecursorWithID().merge(RS2.getPrecursorWithID());\n\n \n ArrayList <Integer> common_non_wildcarded_indexes = RS1.getSuccessor().detectCommonNonWilcardedIndexes(RS2.getSuccessor());\n\n Sensor root = new Sensor(RS1.getPrecursorWithID().tokenMap);\n \n int number = common_non_wildcarded_indexes.size();\n \n boolean insert;\n \n // THERE IS A CONFLICT ONLY IF SOME COMMON NON WILDCARDED INDEXES EXIST\n if (number >= 1) {\n SensorList conflicted_indexes_list = root.expand(common_non_wildcarded_indexes.get(0));\n \n if (number >= 2) { \n \n // Expanding the conflicted indexes in ArrayList\n for (int h = 2; h<=number; h++) {\n \n conflicted_indexes_list.expandListAt(common_non_wildcarded_indexes.get(h-1));\n }\n }\n \n for (int j = 0; j < conflicted_indexes_list.size(); j++) {\n \n // We only need to insert the Rules with postcondition corresponding to either RS1 or RS2\n //\n // So we check for post. matches in the first and then second RuleSet\n insert = false;\n\n // SEARCHING FOR MATCH IN FIRST RULESET\n for (int h1 = 0; h1 < RS1.size(); h1++) {\n ///\n if (RS1.getSuccessor(h1).sensorMatch(conflicted_indexes_list.getSensor(j+1))) {\n insert = true;\n \n break;\n }\n }\n \n // SEARCHING FOR MATCH IN SECOND RULESET\n if (!insert) {\n \n for (int h2 = 0; h2 < RS2.size(); h2++) {\n \n \n if (RS2.getSuccessor(h2).sensorMatch(conflicted_indexes_list.getSensor(j+1))) {\n insert = true;\n \n break;\n }\n \n\n }\n }\n \n // If the Rule postcondition was found in RS1 or RS2, we shall create it\n if (insert) {\n \n Rule rule = new Rule(precondition, conflicted_indexes_list.getSensor(j+1));\n \n rule.ruleset_id = this.id;\n \n int aa = sMap.getMatchingOccurencies(precondition);\n \n int tt = rMap.getMatchingOccurencies(rule);\n \n \n rule.prec_occurrencies = aa;\n rule.occurrencies = tt;\n \n this.rulelist.addRule(rule);\n this.add(rule);\n \n }\n \n }\n \n }\n \n \n // UPDATING RULESET PROBABILITY\n if (this.size() > 0) {\n for (int i = 0; i < this.size(); i++) {\n\n totalProb = totalProb + this.getRule(i).getProb();\n totalProb = Math.round(totalProb * 1000);\n totalProb = totalProb/1000;\n \n }\n }\n \n }", "abstract protected AbstractCSSStyleSheet createRuleStyleSheet(AbstractCSSRule ownerRule, String title,\n\t\t\tMediaQueryList mediaList);", "@Override\n\tpublic List<DiagnosisCoreRule> generateRules(List<DiagnosisCoreResult> allDataList) {\n\t\treturn null;\n\t}", "private ColourRuleSet parse(List<String> properties)\n\t{\n\t\t@SuppressWarnings(\"unused\")\n\t\tString ruleSetName = \"\";\n\t\t\n\t\tColourRuleSet ruleSet = new ColourRuleSet(properties.size());\n\t\t\n\t\tif(!expect(\"colourset\"))\n\t\t\treturn null;\n\t\t\n\t\tSymbol symbol = scanner.getSymbol();\n\t\t\n\t\tif(symbol.type == Symbol.Type.STRING)\n\t\t{\n\t\t\truleSetName = symbol.text;\n\t\t}\n\t\telse\n\t\t{\n\t\t\terror(\"Expected a name for the ruleset\");\n\t\t\treturn null;\n\t\t}\n\t\t\n\t\tif(!expect(\"{\"))\n\t\t\treturn null;\n\t\t\n\t\twhile(scanner.isValid()) \n\t\t{\n\t\t\tsymbol = scanner.peakSymbol();\n\t\t\tif(!symbol.text.equals(\"property\"))\n\t\t\t\tbreak;\n\t\t\t\n\t\t\treadColourRule(ruleSet, properties);\n\t\t}\n\n\t\texpect(\"}\");\n\t\t\n\t\treturn ruleSet;\n\t}", "@BeforeClass\n public static void setUpClass() throws Exception {\n List<String> classNames = ClassListHelper.getClasses();\n \n System.out.println(\"# of classes: \"+classNames.size());\n \n Random random = new Random(System.currentTimeMillis());\n \n StringBuilder builder = new StringBuilder(\"package com.drools.test;\\n\\n\");\n for (int i = 0; i < NUMBER_OF_RULES; i++) {\n builder.append(\"rule \\\"Rule\");\n builder.append(i);\n builder.append(\"\\\"\\n\");\n builder.append(\"when\\n\");\n builder.append(\"\\t$o: \");\n builder.append(classNames.get(random.nextInt(classNames.size())));\n builder.append(\"()\\n\");\n builder.append(\"\\t\");\n builder.append(classNames.get(random.nextInt(classNames.size())));\n builder.append(\"\\t(this == $o)\\n\");\n builder.append(\"\\t$a: \");\n builder.append(classNames.get(random.nextInt(classNames.size())));\n builder.append(\"()\\n\");\n builder.append(\"\\t\");\n builder.append(classNames.get(random.nextInt(classNames.size())));\n builder.append(\"\\t(this == $a)\\n\");\n builder.append(\"then\\n\");\n builder.append(\"end\\n\\n\");\n }\n \n RULES = builder.toString();\n }", "ExprRule createExprRule();", "java.util.List<com.appscode.api.kubernetes.v1beta2.Rule> \n getRulesList();", "protected void assertRules(Rule[] rules, String[] expected) {\n assertRules(rules, expected, true);\n }", "public Rule selectRule(Vector ruleSet) {\r\n Enumeration enum2 = ruleSet.elements() ;\r\n long numClauses ;\r\n Rule nextRule ;\r\n\r\n Rule bestRule = (Rule)enum2.nextElement() ;\r\n long max = bestRule.numAntecedents() ;\r\n while (enum2.hasMoreElements()) {\r\n nextRule = (Rule)enum2.nextElement() ;\r\n if ((numClauses = nextRule.numAntecedents()) > max) {\r\n max = numClauses ;\r\n bestRule = nextRule ;\r\n }\r\n }\r\n return bestRule ;\r\n }", "public AndRule(ExecutionPolicy...rules)\n\t\t{\n\t\t\tsuper(rules);\n\t\t}", "Set createSet();", "private void prepareRuleFiles() {\n\n if (IronSyslog.class.getResource(RULE_FOLDER) == null\n || IronSyslog.class.getResource(RULE_FOLDER + \"service/\") == null\n || IronSyslog.class.getResource(RULE_FOLDER + \"publish/\") == null\n || IronSyslog.class.getResource(RULE_FOLDER + \"other/\") == null) {\n LOGGER.error(\"Error while preparing rule files. Broken file system folder structure. \\n\"\n + \"Make sure that: rules/drools/ and its subfolders service/, publish/ and other/ exist\");\n System.exit(1);\n }\n\n // Prepare Configuration\n Yaml yaml = new Yaml();\n InputStream input = IronSyslog.class.getResourceAsStream(RULE_FOLDER\n + \"config.yml\");\n RulesConfiguration config = yaml\n .loadAs(input, RulesConfiguration.class);\n\n try {\n // Add only the service rules (in the service folder) specified in\n // the configuration\n for (String service : config.getServiceInclude()) {\n String fileName = RULE_FOLDER + \"service/\" + service + \".drl\";\n if (IronSyslog.class.getResource(fileName) != null) {\n LOGGER.debug(\"Adding rule file: \" + fileName);\n mRuleFiles.add(RULE_FOLDER + \"service/\" + service + \".drl\");\n } else {\n LOGGER.warn(\"Failed to add rule file: \" + fileName);\n }\n }\n\n // Add all publish rules (in the \"publish\" folder) excluding the one\n // specified on the\n // configuration\n File publishFolder = new File(IronSyslog.class.getResource(\n RULE_FOLDER + \"publish/\").toURI());\n File[] publishFiles = publishFolder.listFiles();\n for (int i = 0; i < publishFiles.length; i++) {\n String fileName = publishFiles[i].getName();\n if (fileName.endsWith(\".drl\")\n && !config.getPublishExclude().contains(\n fileName.substring(0, fileName.length() - 4))) {\n LOGGER.debug(\"Adding rule file: \" + RULE_FOLDER\n + \"publish/\" + fileName);\n mRuleFiles.add(RULE_FOLDER + \"publish/\" + fileName);\n }\n }\n\n // Add all other rules (\"other\" folder, including subfolders)\n addAllRuleFilesInFolder(RULE_FOLDER + \"other/\");\n } catch (URISyntaxException e) {\n LOGGER.debug(\"Error while searching for rule files. \" + e);\n }\n }", "public static List catenizeRules(String [][][] arrays)\t{\n\t\treturn catenizeRules(arrays, false);\n\t}", "public static Set<RelOptRule> elasticSearchRules() {\n Set<RelOptRule> rules = Arrays.stream(ElasticsearchRules.RULES)\n .filter(RULE_PREDICATE)\n .collect(Collectors.toSet());\n rules.add(ENUMERABLE_INTERMEDIATE_PREL_CONVERTER_RULE);\n rules.add(ELASTIC_DREL_CONVERTER_RULE);\n rules.add(ElasticsearchProjectRule.INSTANCE);\n rules.add(ElasticsearchFilterRule.INSTANCE);\n return rules;\n }", "public OrderRules() {\n this(DSL.name(\"order_rules\"), null);\n }", "private void createRuleList()\n {\n\n ArrayList<String> tempList0 = new ArrayList<String>();\n ArrayList<String> tempList1 = new ArrayList<String>();\n ArrayList<String> tempList2 = new ArrayList<String>();\n ArrayList<String> tempList3 = new ArrayList<String>();\n ArrayList<String> tempList4 = new ArrayList<String>();\n ArrayList<String> tempList5 = new ArrayList<String>();\n ArrayList<String> tempList6 = new ArrayList<String>();\n ArrayList<String> tempList7 = new ArrayList<String>();\n ArrayList<String> tempList8 = new ArrayList<String>();\n ArrayList<String> tempList9 = new ArrayList<String>();\n ArrayList<String> tempList10 = new ArrayList<String>();\n ArrayList<String> tempList11 = new ArrayList<String>();\n ArrayList<String> tempList12 = new ArrayList<String>();\n ArrayList<String> tempList13 = new ArrayList<String>();\n ArrayList<String> tempList14 = new ArrayList<String>();\n ArrayList<String> tempList15 = new ArrayList<String>();\n ArrayList<String> tempList16 = new ArrayList<String>();\n ArrayList<String> tempList17 = new ArrayList<String>();\n ArrayList<String> tempList18 = new ArrayList<String>();\n ArrayList<String> tempList19 = new ArrayList<String>();\n ArrayList<String> tempList20 = new ArrayList<String>();\n ArrayList<String> tempList21 = new ArrayList<String>();\n ArrayList<String> tempList22 = new ArrayList<String>();\n ArrayList<String> tempList23 = new ArrayList<String>();\n ArrayList<String> tempList24 = new ArrayList<String>();\n ArrayList<String> tempList25 = new ArrayList<String>();\n ArrayList<String> tempList26 = new ArrayList<String>();\n ArrayList<String> tempList27 = new ArrayList<String>();\n ArrayList<String> tempList28 = new ArrayList<String>();\n ArrayList<String> tempList29 = new ArrayList<String>();\n ArrayList<String> tempList30 = new ArrayList<String>();\n ArrayList<String> tempList31 = new ArrayList<String>();\n ArrayList<String> tempList32 = new ArrayList<String>();\n ArrayList<String> tempList33 = new ArrayList<String>();\n ArrayList<String> tempList34 = new ArrayList<String>();\n ArrayList<String> tempList35 = new ArrayList<String>();\n ArrayList<String> tempList36 = new ArrayList<String>();\n ArrayList<String> tempList37 = new ArrayList<String>();\n ArrayList<String> tempList38 = new ArrayList<String>();\n ArrayList<String> tempList39 = new ArrayList<String>();\n ArrayList<String> tempList40 = new ArrayList<String>();\n ArrayList<String> tempList41 = new ArrayList<String>();\n ArrayList<String> tempList42 = new ArrayList<String>();\n ArrayList<String> tempList43 = new ArrayList<String>();\n ArrayList<String> tempList44 = new ArrayList<String>();\n ArrayList<String> tempList45 = new ArrayList<String>();\n ArrayList<String> tempList46 = new ArrayList<String>();\n ArrayList<String> tempList47 = new ArrayList<String>();\n ArrayList<String> tempList48 = new ArrayList<String>();\n\n //There is no rule 0, so index 0 is left blank\n tempList0.add(\"\");\n ruleList.add(tempList0);\n //Create a list for each index position, then add it on to the overall list of lists\n tempList1.add(\"make-<PROGRAM>\");\n tempList1.add(\"DEFINITIONS\");\n ruleList.add(tempList1);\n tempList2.add(\"NULL\");\n ruleList.add(tempList2);\n tempList3.add(\"DEFINITIONS\");\n tempList3.add(\"DEF\");\n ruleList.add(tempList3);\n tempList4.add(\"make-<DEF>\");\n tempList4.add(\"BODY\");\n tempList4.add(\"TYPE\");\n tempList4.add(\"colon\");\n tempList4.add(\"rightParen\");\n tempList4.add(\"FORMALS\");\n tempList4.add(\"leftParen\");\n tempList4.add(\"make-<IDENTIFIER>\");\n tempList4.add(\"IDENTIFIER\");\n tempList4.add(\"function\");\n ruleList.add(tempList4);\n tempList5.add(\"make-<FORMALS>\");\n ruleList.add(tempList5);\n tempList6.add(\"NONEMPTYFORMALS\");\n ruleList.add(tempList6);\n tempList7.add(\"NEFREST\");\n tempList7.add(\"FORMAL\");\n ruleList.add(tempList7);\n tempList8.add(\"NONEMPTYFORMALS\");\n tempList8.add(\"comma\");\n ruleList.add(tempList8);\n tempList9.add(\"make-<FORMALS>\");\n ruleList.add(tempList9);\n tempList10.add(\"make-<FORMAL>\");\n tempList10.add(\"TYPE\");\n tempList10.add(\"colon\");\n tempList10.add(\"make-<IDENTIFIER>\");\n tempList10.add(\"IDENTIFIER\");\n ruleList.add(tempList10);\n tempList11.add(\"PRINTBODY\");\n ruleList.add(tempList11);\n tempList12.add(\"make-<BODY>\");\n tempList12.add(\"EXPR\");\n ruleList.add(tempList12);\n tempList13.add(\"BODY\");\n tempList13.add(\"PRINTSTATEMENT\");\n ruleList.add(tempList13);\n tempList14.add(\"make-integer\");\n tempList14.add(\"integer\");\n ruleList.add(tempList14);\n tempList15.add(\"make-boolean\");\n tempList15.add(\"boolean\");\n ruleList.add(tempList15);\n tempList16.add(\"EXPRREST\");\n tempList16.add(\"SIMPLEEXPR\");\n ruleList.add(tempList16);\n tempList17.add(\"EXPRREST\");\n tempList17.add(\"make-<BINARY>\");\n tempList17.add(\"EXPR\");\n tempList17.add(\"lessThan\");\n ruleList.add(tempList17);\n tempList18.add(\"EXPRREST\");\n tempList18.add(\"make-<BINARY>\");\n tempList18.add(\"EXPR\");\n tempList18.add(\"equals\");\n ruleList.add(tempList18);\n tempList19.add(\"make-<EXPR>\");\n ruleList.add(tempList19);\n tempList20.add(\"SIMPLEEXPRREST\");\n tempList20.add(\"TERM\");\n ruleList.add(tempList20);\n tempList21.add(\"SIMPLEEXPRREST\");\n tempList21.add(\"make-<BINARY>\");\n tempList21.add(\"SIMPLEEXPR\");\n tempList21.add(\"or\");\n ruleList.add(tempList21);\n tempList22.add(\"SIMPLEEXPRREST\");\n tempList22.add(\"make-<BINARY>\");\n tempList22.add(\"SIMPLEEXPR\");\n tempList22.add(\"plus\");\n ruleList.add(tempList22);\n tempList23.add(\"SIMPLEEXPRREST\");\n tempList23.add(\"make-<BINARY>\");\n tempList23.add(\"SIMPLEEXPR\");\n tempList23.add(\"minus\");\n ruleList.add(tempList23);\n tempList24.add(\"NULL\");\n ruleList.add(tempList24);\n tempList25.add(\"TERMREST\");\n tempList25.add(\"FACTOR\");\n ruleList.add(tempList25);\n tempList26.add(\"TERMREST\");\n tempList26.add(\"make-<BINARY>\");\n tempList26.add(\"TERM\");\n tempList26.add(\"and\");\n ruleList.add(tempList26);\n tempList27.add(\"TERMREST\");\n tempList27.add(\"make-<BINARY>\");\n tempList27.add(\"TERM\");\n tempList27.add(\"multiply\");\n ruleList.add(tempList27);\n tempList28.add(\"TERMREST\");\n tempList28.add(\"make-<BINARY>\");\n tempList28.add(\"TERM\");\n tempList28.add(\"divide\");\n ruleList.add(tempList28);\n tempList29.add(\"NULL\");\n ruleList.add(tempList29);\n tempList30.add(\"make-<if-EXPR>\");\n tempList30.add(\"EXPR\");\n tempList30.add(\"else\");\n tempList30.add(\"EXPR\");\n tempList30.add(\"then\");\n tempList30.add(\"EXPR\");\n tempList30.add(\"if\");\n ruleList.add(tempList30);\n tempList31.add(\"NOTFACTOR\");\n ruleList.add(tempList31);\n tempList32.add(\"IDENTIFIERMAIN\");\n ruleList.add(tempList32);\n tempList33.add(\"LITERAL\");\n ruleList.add(tempList33);\n tempList34.add(\"NEGFACTOR\");\n ruleList.add(tempList34);\n tempList35.add(\"rightParen\");\n tempList35.add(\"EXPR\");\n tempList35.add(\"leftParen\");\n ruleList.add(tempList35);\n tempList36.add(\"make-<UNARY>\");\n tempList36.add(\"FACTOR\");\n tempList36.add(\"not\");\n ruleList.add(tempList36);\n tempList37.add(\"make-<UNARY>\");\n tempList37.add(\"FACTOR\");\n tempList37.add(\"minus\");\n ruleList.add(tempList37);\n tempList38.add(\"IDENTIFIERREST\");\n tempList38.add(\"make-<IDENTIFIER>\");\n tempList38.add(\"IDENTIFIER\");\n ruleList.add(tempList38);\n tempList39.add(\"rightParen\");\n tempList39.add(\"ACTUALS\");\n tempList39.add(\"leftParen\");\n ruleList.add(tempList39);\n tempList40.add(\"NULL\");\n ruleList.add(tempList40);\n tempList41.add(\"NULL\");\n ruleList.add(tempList41);\n tempList42.add(\"NONEMPTYACTUALS\");\n ruleList.add(tempList42);\n tempList43.add(\"NEAREST\");\n tempList43.add(\"EXPR\");\n ruleList.add(tempList43);\n tempList44.add(\"NONEMPTYACTUALS\");\n tempList44.add(\"comma\");\n ruleList.add(tempList44);\n tempList45.add(\"make-Function-Call\");\n tempList45.add(\"make-<ACTUALS>\");\n ruleList.add(tempList45);\n tempList46.add(\"make-<NUMBER>\");\n tempList46.add(\"NUMBER\");\n ruleList.add(tempList46);\n tempList47.add(\"make-<BOOLEAN>\");\n tempList47.add(\"BOOLEAN\");\n ruleList.add(tempList47);\n tempList48.add(\"make-Function-Call\");\n tempList48.add(\"rightParen\");\n tempList48.add(\"EXPR\");\n tempList48.add(\"leftParen\");\n tempList48.add(\"make-<IDENTIFIER>\");\n tempList48.add(\"print\");\n ruleList.add(tempList48);\n }", "ModelRule createModelRule();", "@Test\r\n\tvoid testRulesList() {\r\n\t\tassertSame(email1.getRulesPerMail().size(), 5);\r\n\t\tassertSame(email3.getRulesPerMail().size(), 2);\r\n\t\tassertNotEquals(email1.getRulesPerMail(), email3.getRulesPerMail());\r\n\t\tassertEquals(email1.getRulesPerMail(), email4.getRulesPerMail());\r\n\t}", "public SectionSets (Collection<Collection<Section>> sets)\r\n {\r\n this.sets = sets;\r\n }", "public RuleConfiguration() {\n\t\trule = new Rule();\n\t}", "public static SectionSets createFromGlyphs (Collection<Glyph> glyphs)\r\n {\r\n SectionSets sectionSets = new SectionSets();\r\n sectionSets.sets = new ArrayList<>();\r\n\r\n for (Glyph glyph : glyphs) {\r\n sectionSets.sets.add(new ArrayList<>(glyph.getMembers()));\r\n }\r\n\r\n return sectionSets;\r\n }", "public static <T> Set<T> createSet(T... setEntries) {\n\t\tif (setEntries == null) {\n\t\t\treturn null;\n\t\t}\n\t\treturn new HashSet<T>(Arrays.asList(setEntries));\n\t}" ]
[ "0.6794694", "0.66959316", "0.65793335", "0.65416265", "0.64189726", "0.64178085", "0.6304526", "0.6289067", "0.6270146", "0.6260109", "0.5929581", "0.5914926", "0.5707264", "0.56874335", "0.5680131", "0.5680131", "0.5680131", "0.5592316", "0.5563639", "0.5512916", "0.55005485", "0.5468774", "0.5463698", "0.5433108", "0.5402819", "0.5382424", "0.5364697", "0.5344393", "0.53368574", "0.531741", "0.52924836", "0.52775055", "0.5241661", "0.5241008", "0.5229344", "0.52262074", "0.52211", "0.5217318", "0.51946783", "0.5167876", "0.5161987", "0.5155021", "0.5133699", "0.51060826", "0.50975806", "0.5093937", "0.5089503", "0.5081077", "0.50809777", "0.5066064", "0.5065167", "0.505859", "0.5041688", "0.5037907", "0.5016205", "0.50094104", "0.49993867", "0.49857777", "0.49739584", "0.49730223", "0.49687797", "0.49671918", "0.4965012", "0.49349025", "0.49342045", "0.49333388", "0.49190518", "0.49074852", "0.4891775", "0.48907986", "0.48882133", "0.48823172", "0.4880775", "0.48690796", "0.48652273", "0.48584408", "0.4852888", "0.48518267", "0.48485374", "0.4827212", "0.48163515", "0.481489", "0.48123974", "0.4809946", "0.48078606", "0.48041108", "0.48024592", "0.47995514", "0.47728118", "0.47693276", "0.47666064", "0.47474068", "0.473725", "0.47270507", "0.4700266", "0.46974996", "0.46845037", "0.46814033", "0.4663839", "0.46604252" ]
0.6701491
1
Parse the ClientLogin response and return the auth token
protected String parseClientLoginResponse(HttpResponse response) throws AuthClientException, IOException { int status = response.getStatusLine().getStatusCode(); if (status != HttpStatus.SC_OK && status != HttpStatus.SC_FORBIDDEN) { throw new AuthClientException("Unexpected ClientLogin HTTP status " + status); } String body = EntityUtils.toString(response.getEntity()); Map<String, String> responseMap = parseClientLoginBody(body); if (status == HttpStatus.SC_OK) { String authToken = responseMap.get("Auth"); if (authToken == null) { throw new AuthClientException("Auth token missing from ClientLogin response"); } return authToken; } else { String message = "ClientLogin forbidden"; // Base error code (eg. BadAuthentication) String error = responseMap.get("Error"); if (error != null) { message += ": " + error; } // Additional error code, not usually present (eg. InvalidSecondFactor) String info = responseMap.get("Info"); if (info != null) { message += " (" + info + ")"; } throw new AuthClientException(message); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public int getTokenViaClientCredentials(){\n\t\t//Do we have credentials?\n\t\tif (Is.nullOrEmpty(clientId) || Is.nullOrEmpty(clientSecret)){\n\t\t\treturn 1;\n\t\t}\n\t\ttry{\n\t\t\t//Build auth. header entry\n\t\t\tString authString = \"Basic \" + Base64.getEncoder().encodeToString((clientId + \":\" + clientSecret).getBytes());\n\t\t\t\n\t\t\t//Request headers\n\t\t\tMap<String, String> headers = new HashMap<>();\n\t\t\theaders.put(\"Content-Type\", \"application/x-www-form-urlencoded\");\n\t\t\theaders.put(\"Authorization\", authString);\n\t\t\t\n\t\t\t//Request data\n\t\t\tString data = ContentBuilder.postForm(\"grant_type\", \"client_credentials\");\n\t\t\t\n\t\t\t//Call\n\t\t\tlong tic = System.currentTimeMillis();\n\t\t\tthis.lastRefreshTry = tic;\n\t\t\tJSONObject res = Connectors.httpPOST(spotifyAuthUrl, data, headers);\n\t\t\tStatistics.addExternalApiHit(\"SpotifyApi getTokenViaClientCredentials\");\n\t\t\tStatistics.addExternalApiTime(\"SpotifyApi getTokenViaClientCredentials\", tic);\n\t\t\t//System.out.println(res.toJSONString()); \t\t//DEBUG\n\t\t\tif (!Connectors.httpSuccess(res)){\n\t\t\t\treturn 2;\n\t\t\t}\n\t\t\tString token = JSON.getString(res, \"access_token\");\n\t\t\tString tokenType = JSON.getString(res, \"token_type\");\n\t\t\tlong expiresIn = JSON.getLongOrDefault(res, \"expires_in\", 0);\n\t\t\tif (Is.nullOrEmpty(token)){\n\t\t\t\treturn 4;\n\t\t\t}else{\n\t\t\t\tthis.token = token;\n\t\t\t\tthis.tokenType = tokenType;\n\t\t\t\tthis.tokenValidUntil = System.currentTimeMillis() + (expiresIn * 1000);\n\t\t\t}\n\t\t\treturn 0;\n\t\t\t\n\t\t}catch (Exception e){\n\t\t\tStatistics.addExternalApiHit(\"SpotifyApi-error getTokenViaClientCredentials\");\n\t\t\treturn 3;\n\t\t}\n\t}", "public String getLoginToken() {\n return loginToken;\n }", "private CdekAuthToken getAuthToken()\n {\n String authEndpoint = conf.ENDPOINT + \"/oauth/token?grant_type={grant_type}&client_id={client_id}&client_secret={client_secret}\";\n\n HttpHeaders defaultHeaders = new HttpHeaders();\n HttpEntity req = new HttpEntity(defaultHeaders);\n\n return rest.postForObject(authEndpoint, req, CdekAuthToken.class, conf.getAuthData());\n }", "com.bingo.server.msg.REQ.LoginRequest getLogin();", "private static Object doAuth(Request req, Response res) {\n \n HashMap<String, String> response = new HashMap<>();\n\t\t \n String email = Jsoup.parse(req.queryParams(\"email\")).text();\n\t\t String password = Jsoup.parse(req.queryParams(\"password\")).text();\n\t\t\n res.type(Path.Web.JSON_TYPE);\n \t\t\n\t\t\n\t\tif(email != null && !email.isEmpty() && password != null && !password.isEmpty() ) {\n \n authenticate = new Authenticate(password);\n\t\t\t//note that the server obj has been created during call to login()\n\t\t\tString M2 = authenticate.getM2(server);\n\t\t\t\n if(M2 != null || !M2.isEmpty()) {\n \n \n\t\t\tSession session = req.session(true);\n\t\t\tsession.maxInactiveInterval(Path.Web.SESSION_TIMEOUT);\n\t\t\tUser user = UserController.getUserByEmail(email);\n\t\t\tsession.attribute(Path.Web.ATTR_USER_NAME, user.getUsername());\n session.attribute(Path.Web.ATTR_USER_ID, user.getId().toString()); //saves the id as String\n\t\t\tsession.attribute(Path.Web.AUTH_STATUS, authenticate.authenticated);\n\t\t\tsession.attribute(Path.Web.ATTR_EMAIL, user.getEmail());\n logger.info(user.toString() + \" Has Logged In Successfully\");\n \n response.put(\"M2\", M2);\n response.put(\"code\", \"200\");\n response.put(\"status\", \"success\");\n response.put(\"target\", Path.Web.DASHBOARD);\n \n String respjson = gson.toJson(response);\n logger.info(\"Final response sent By doAuth to client = \" + respjson);\n res.status(200);\n return respjson;\n }\n\t\t\t\t\n\t\t} \n \n res.status(401);\n response.put(\"code\", \"401\");\n response.put(\"status\", \"Error! Invalid Login Credentials\");\n \n return gson.toJson(response);\n }", "public void loginSuccess(String response) {\n \ttry {\n \t\t// Parse the json data and create a json object.\n \t\tJSONObject jsonRes = new JSONObject(response);\n \t\tJSONObject data = jsonRes.getJSONObject(\"data\");\n \t\t\n \t\t// Now add the token into the shared preferences file.\n \t\tContext context = getApplicationContext();\n \t\tSharedPreferences sharedPref = context.getSharedPreferences(\n \t\t\t\"com.example.traffic.pref_file\", \n \t\t\tContext.MODE_PRIVATE\n \t\t);\n \t\t\n \t\t// Now get the editor to the file and add the token \n \t\t// recieved as a response.\n \t\tSharedPreferences.Editor editor = sharedPref.edit();\n \t\teditor.putString(\"token\" , data.getString(\"token\"));\n \t\teditor.commit();\n \tToast toast = Toast.makeText(getApplicationContext(),\n \t\t\t\"Logged in.\", \n \t\t\tToast.LENGTH_SHORT \n \t);\n \ttoast.show();\n \t} catch(Exception e) {\n \t\te.printStackTrace();\n \t}\n \t\n }", "public String getAuthToken() throws Exception {\n _log.info(\"3PARDriver:getAuthToken enter, after expiry\");\n String authToken = null;\n ClientResponse clientResp = null;\n String body= \"{\\\"user\\\":\\\"\" + _user + \"\\\", \\\"password\\\":\\\"\" + _password + \"\\\"}\";\n\n try {\n clientResp = _client.post_json(_baseUrl.resolve(URI_LOGIN), body);\n if (clientResp == null) {\n _log.error(\"3PARDriver:There is no response from 3PAR\");\n throw new HP3PARException(\"There is no response from 3PAR\");\n } else if (clientResp.getStatus() != 201) {\n String errResp = getResponseDetails(clientResp);\n throw new HP3PARException(errResp);\n } else {\n JSONObject jObj = clientResp.getEntity(JSONObject.class);\n authToken = jObj.getString(\"key\");\n }\n this._authToken = authToken;\n return authToken;\n } catch (Exception e) {\n throw e;\n } finally {\n if (clientResp != null) {\n clientResp.close();\n }\n _log.info(\"3PARDriver:getAuthToken leave, after expiry\");\n } //end try/catch/finally\n }", "private void handleAuthenticationResponse(JsonResponse response) {\n // Check if there is an authentication token in the response\n if (response.getAuthToken() != null && response.getAuthToken().length() > 0) {\n // Get the username\n final String username = this.mUsernameInput.getText().toString();\n // Add the Account and associate the authentication token\n final Account account = new Account(username, Constants.ACCOUNT_TYPE);\n this.mAccountManager.addAccountExplicitly(account, null, null);\n this.mAccountManager.setAuthToken(account, Constants.AUTH_TOKEN_TYPE, response.getAuthToken());\n // Finish\n final Intent intent = new Intent();\n intent.putExtra(AccountManager.KEY_ACCOUNT_NAME, username);\n intent.putExtra(AccountManager.KEY_ACCOUNT_TYPE, Constants.ACCOUNT_TYPE);\n this.setAccountAuthenticatorResult(intent.getExtras());\n this.setResult(RESULT_OK);\n this.finish();\n } else {\n // There was no authentication token\n List<String> errors = new ArrayList<String>();\n errors.add(this.getString(R.string.error_missing_auth_token));\n this.setMessages(errors);\n }\n }", "private static String doLogin(Request req, Response res) {\n HashMap<String, String> respMap;\n \n res.type(Path.Web.JSON_TYPE);\n \n \n\t String email = Jsoup.parse(req.queryParams(\"email\")).text();\n \n logger.info(\"email from the client = \" + email);\n \n if(email != null && !email.isEmpty()) { \n \n\t server = new SRP6JavascriptServerSessionSHA256(CryptoParams.N_base10, CryptoParams.g_base10);\n\t \t\t\n\t gen = new ChallengeGen(email);\n\t\t\n\t respMap = gen.getChallenge(server);\n \n if(respMap != null) {\n\t\t logger.info(\"JSON RESP SENT TO CLIENT = \" + respMap.toString());\n res.status(200);\n respMap.put(\"code\", \"200\");\n respMap.put(\"status\", \"success\");\n return gson.toJson(respMap);\n }\n }\n respMap = new HashMap<>();\n \n res.status(401);\n respMap.put(\"status\", \"Invalid User Credentials\");\n respMap.put(\"code\", \"401\");\n logger.error(\"getChallenge() return null map most likely due to null B value and Invalid User Credentials\");\n \treturn gson.toJson(respMap);\n}", "public LoginToken getLoginToken() {\n return loginToken;\n }", "com.bingo.server.msg.REQ.LoginRequestOrBuilder getLoginOrBuilder();", "public interface LoginResponse {\n\tpublic static final String IS_VALID = \"isValid\";\n\tpublic static final String ERROR_CODE = \"errorCode\";\n\tpublic static final String ERROR_MESSAGE = \"errorMessage\";\n\n\tpublic boolean isValid();\n\tpublic String authToken();\n\tpublic int errorCode();\n\tpublic String errorMessage();\n\tpublic User user();\n}", "@Test\n public void cTestGetLoginToken() {\n token = given()\n .param(\"username\", \"playlist\")\n .param(\"password\", \"playlist\")\n .post(\"/login\")\n .jsonPath().getString(\"token\");\n }", "protected synchronized String authenticated() throws JSONException {\n JSONObject principal = new JSONObject()\n .put(FIELD_USERNAME, USER)\n .put(FIELD_PASSWORD, PASSWORD);\n if (token == null){ //Avoid authentication in each call\n token =\n given()\n .basePath(\"/\")\n .contentType(ContentType.JSON)\n .body(principal.toString())\n .when()\n .post(LOGIN)\n .then()\n .statusCode(200)\n .extract()\n .header(HEADER_AUTHORIZATION);\n\n }\n return token;\n }", "@Override\n public void authenticate() throws IOException, BadAccessIdOrKeyException {\n try{\n HttpPost post = new HttpPost(Constants.FRGXAPI_TOKEN);\n List<NameValuePair> params = new ArrayList<>();\n params.add(new BasicNameValuePair(\"grant_type\", \"apiAccessKey\"));\n params.add(new BasicNameValuePair(\"apiAccessId\", accessId));\n params.add(new BasicNameValuePair(\"apiAccessKey\", accessKey));\n post.setEntity(new UrlEncodedFormEntity(params, \"UTF-8\"));\n\n HttpResponse response = client.execute(post);\n String a = response.getStatusLine().toString();\n\n if(a.equals(\"HTTP/1.1 400 Bad Request\")){\n throw (new BadAccessIdOrKeyException(\"Bad Access Id Or Key\"));\n }\n HttpEntity entity = response.getEntity();\n String responseString = EntityUtils.toString(response.getEntity());\n\n JsonParser jsonParser = new JsonParser();\n JsonObject jo = (JsonObject) jsonParser.parse(responseString);\n if(jo.get(\"access_token\") == null){\n throw new NullResponseException(\"The Access Token you get is null.\");\n }\n String accessToken = jo.get(\"access_token\").getAsString();\n List<Header> headers = new ArrayList<>();\n headers.add(new BasicHeader(HttpHeaders.CONTENT_TYPE, \"application/json\"));\n headers.add(new BasicHeader(\"Authorization\", \"Bearer \" + accessToken));\n\n client = HttpClients.custom().setDefaultHeaders(headers).build();\n } catch (NullResponseException e) {\n System.out.println(e.getMsg());\n }\n }", "public static void GetAuthToken() throws IOException, ClassNotFoundException {\n Socket client = ConnectionToServer();\n\n // connects to the server with information and attempts to get the auth token for the user after successful Login\n if (client.isConnected()) {\n\n OutputStream outputStream = client.getOutputStream();\n InputStream inputStream = client.getInputStream();\n\n ObjectOutputStream send = new ObjectOutputStream(outputStream);\n ObjectInputStream receiver = new ObjectInputStream(inputStream);\n\n send.writeUTF(\"AuthToken\");\n send.writeUTF(loggedInUser);\n send.flush(); // Must be done before switching to reading state\n\n // Store the auth token for the user\n token = (String) receiver.readObject();\n// System.out.println(token);\n\n// End connections\n send.close();\n receiver.close();\n client.close();\n }\n }", "private static Tuple<Integer, String> getToken() {\n\t\tTuple<Integer, String> result = new Tuple<Integer, String>();\n\t\tresult = GETRequest(AUTH_URL, AUTH_HEADER, \"\", \"\");\n\t\treturn result;\n\t}", "java.lang.String getAuth();", "java.lang.String getAuth();", "java.lang.String getAuth();", "@Override\n public void onResponse(String response) {\n editor.putBoolean(\"credentials_validity\", true);\n editor.putInt(\"last_login_method\", Constants.USER_PASS_LOGIN);\n editor.commit();\n saveCredentials(email, password);\n onLoginFinished(false);\n }", "public Login.Res getLoginRes() {\n if (rspCase_ == 6) {\n return (Login.Res) rsp_;\n }\n return Login.Res.getDefaultInstance();\n }", "private boolean handleLogin(String serverMessage){\r\n\t\t// Separating the message STATUS + TOKEN\r\n\t\tString[] messageParts = serverMessage.split(SEPARATOR);\r\n\r\n\t\t// Get status code from message\r\n\t\tint messageStatus = Integer.parseInt(messageParts[0]);\r\n\r\n\t\t//Process status\r\n\t\tswitch (messageStatus) {\r\n\t\tcase REQUEST_OK:\r\n\r\n\t\t\t// Status OK set TOKEN to Authenticated User\r\n\t\t\tSystem.out.println(\"Login request OK\");\r\n\t\t\tcontroller.getModel().getAuthUser().setToken(messageParts[1]);\r\n\t\t\treturn true;\r\n\r\n\t\tcase INCORRECT_REQUEST_FORMAT:\r\n\r\n\t\t\tSystem.err.println(\"Oups! \\nSomethin went wrong!\\n Request format was invalid\");\r\n\t\t\tbreak;\r\n\r\n\t\tcase INCORRECT_USER_OR_PASSWOROD:\r\n\r\n\t\t\tJOptionPane.showMessageDialog(null,\"Username or password is incorrect!\", \"Error\",\r\n\t\t\t\t\tJOptionPane.ERROR_MESSAGE);\r\n\t\t\tbreak;\r\n\r\n\t\tdefault:\r\n\t\t\tbreak;\r\n\t\t}\r\n\r\n\t\treturn false;\r\n\t}", "java.lang.String getRemoteToken();", "private ResponseEntity<TokenLoginResponse> requestLoginResponse() {\n LoginRequest userLogin = new LoginRequest();\n userLogin.setUsername(\"user\");\n userLogin.setPassword(\"password\");\n ResponseEntity<TokenLoginResponse> loginResponse = new TestRestTemplate().postForEntity(\"http://localhost:\" + port + \"/login/api\", userLogin, TokenLoginResponse.class);\n assertEquals(HttpStatus.OK, loginResponse.getStatusCode());\n return loginResponse;\n }", "void onAuthenticationSucceeded(String token);", "RequestResult loginRequest() throws Exception;", "Login.Req getLoginReq();", "@Override\r\n public void onResponse(Call call, Response response) throws IOException{\r\n String responseText = response.body().string();\r\n Slog.d(TAG, \"response token: \"+responseText);\r\n if(!TextUtils.isEmpty(responseText)){\r\n try {\r\n JSONObject responseObject = new JSONObject(responseText);\r\n token = responseObject.getString(\"token\");\r\n // Slog.d(TAG, \"token : \"+token);\r\n login_finally(token, user_name);\r\n }catch (JSONException e){\r\n e.printStackTrace();\r\n }\r\n }\r\n\r\n }", "private String GetAccessToken() {\n final String grantType = \"password\";\n final String resourceId = \"https%3A%2F%2Fgraph.microsoft.com%2F\";\n final String tokenEndpoint = \"https://login.microsoftonline.com/common/oauth2/token\";\n\n try {\n URL url = new URL(tokenEndpoint);\n HttpURLConnection conn;\n if (configuration.isProxyUsed()) {\n Proxy proxy = new Proxy(Proxy.Type.HTTP, new InetSocketAddress(configuration.getProxyServer(), configuration.getProxyPort()));\n conn = (HttpURLConnection) url.openConnection(proxy);\n } else {\n conn = (HttpURLConnection) url.openConnection();\n }\n\n String line;\n StringBuilder jsonString = new StringBuilder();\n\n conn.setRequestProperty(\"Content-Type\", \"application/x-www-form-urlencoded; charset=UTF-8\");\n conn.setRequestMethod(\"POST\");\n conn.setDoInput(true);\n conn.setDoOutput(true);\n conn.setInstanceFollowRedirects(false);\n conn.connect();\n\n try (OutputStreamWriter outputStreamWriter = new OutputStreamWriter(conn.getOutputStream(), StandardCharsets.UTF_8)) {\n String payload = String.format(\"grant_type=%1$s&resource=%2$s&client_id=%3$s&username=%4$s&password=%5$s\",\n grantType,\n resourceId,\n clientId,\n username,\n password);\n outputStreamWriter.write(payload);\n }\n\n try (BufferedReader br = new BufferedReader(new InputStreamReader(conn.getInputStream()))) {\n while((line = br.readLine()) != null) {\n jsonString.append(line);\n }\n }\n\n conn.disconnect();\n\n JsonObject res = new GsonBuilder()\n .create()\n .fromJson(jsonString.toString(), JsonObject.class);\n\n return res\n .get(\"access_token\")\n .toString()\n .replaceAll(\"\\\"\", \"\");\n\n } catch (IOException e) {\n throw new IllegalAccessError(\"Unable to read authorization response: \" + e.getLocalizedMessage());\n }\n }", "private void getAccessToken() {\n\n\t\tMediaType mediaType = MediaType.parse(\"application/x-www-form-urlencoded\");\n\t\tRequestBody body = RequestBody.create(mediaType,\n\t\t\t\t\"client_id=\" + CONSUMER_KEY + \"&client_secret=\" + CONSUMER_SECRET + \"&grant_type=client_credentials\");\n\t\tRequest request = new Request.Builder().url(\"https://api.yelp.com/oauth2/token\").post(body)\n\t\t\t\t.addHeader(\"cache-control\", \"no-cache\").build();\n\n\t\ttry {\n\t\t\tokhttp3.Response response = client.newCall(request).execute();\n\t\t\tString respbody = response.body().string().trim();\n\t\t\tJSONParser parser = new JSONParser();\n\t\t\tJSONObject json = (JSONObject) parser.parse(respbody);\n\t\t\taccessToken = (String) json.get(\"access_token\");\n\t\t} catch (IOException | ParseException e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t}", "protected Map<String, String> parseClientLoginBody(String body) {\n Map<String, String> responseMap = new HashMap<>();\n for (String line : body.split(\"\\n\")) {\n int idx = line.indexOf(\"=\");\n if (idx > 0) {\n responseMap.put(line.substring(0, idx), line.substring(idx + 1));\n }\n }\n return responseMap;\n }", "public String LoginServiceToken(String token) {\n return token =\n given().log().all().accept(\"text/plain, */*\")\n .headers(\n \"App-Code\", APPCODE,\n \"X-IBM-Client-Id\", IBMCLIENTID\n )\n .and().given().contentType(\"application/x-www-form-urlencoded\")\n .and().given().body(\"grant_type=password&scope=security&username=\"+MXUSER+\"&password=\"+PWD+\"&client_id=\"+IBMCLIENTID)\n .when().post(AZUREURL+\"/v2/secm/oam/oauth2/token\")\n .then().log().ifError().assertThat().statusCode(200)\n .extract().path(\"oauth2.access_token\").toString();\n\n }", "public String getToken();", "String getComponentAccessToken();", "private byte[] readToken() throws IOException, AuthenticationException {\n int status = conn.getResponseCode();\n if (status == HttpURLConnection.HTTP_OK || status == HttpURLConnection.HTTP_UNAUTHORIZED) {\n List<String> authHeaders = readHeaderField(conn, WWW_AUTHENTICATE);\n if (authHeaders.isEmpty()) {\n throw new AuthenticationException(\"Invalid SPNEGO sequence, '\" + WWW_AUTHENTICATE +\n \"' header missing\",\n AuthenticationException.AuthenticationExceptionCode.INVALID_SPNEGO_SEQUENCE);\n }\n for (String authHeader : authHeaders) {\n if (authHeader != null && authHeader.trim().startsWith(NEGOTIATE)) {\n String negotiation = authHeader.trim().substring((NEGOTIATE + \" \").length()).trim();\n return base64.decode(negotiation);\n }\n }\n }\n throw new AuthenticationException(\"Invalid SPNEGO sequence, status code: \" + status,\n AuthenticationException.AuthenticationExceptionCode.INVALID_SPNEGO_SEQUENCE);\n }", "public LoginMessageResponse getLoginMessageResponse() {\n return localLoginMessageResponse;\n }", "public static LoginResponse parse(\n javax.xml.stream.XMLStreamReader reader)\n throws java.lang.Exception {\n LoginResponse object = new LoginResponse();\n\n int event;\n javax.xml.namespace.QName currentQName = null;\n java.lang.String nillableValue = null;\n java.lang.String prefix = \"\";\n java.lang.String namespaceuri = \"\";\n\n try {\n while (!reader.isStartElement() && !reader.isEndElement())\n reader.next();\n\n currentQName = reader.getName();\n\n if (reader.getAttributeValue(\n \"http://www.w3.org/2001/XMLSchema-instance\",\n \"type\") != null) {\n java.lang.String fullTypeName = reader.getAttributeValue(\"http://www.w3.org/2001/XMLSchema-instance\",\n \"type\");\n\n if (fullTypeName != null) {\n java.lang.String nsPrefix = null;\n\n if (fullTypeName.indexOf(\":\") > -1) {\n nsPrefix = fullTypeName.substring(0,\n fullTypeName.indexOf(\":\"));\n }\n\n nsPrefix = (nsPrefix == null) ? \"\" : nsPrefix;\n\n java.lang.String type = fullTypeName.substring(fullTypeName.indexOf(\n \":\") + 1);\n\n if (!\"LoginResponse\".equals(type)) {\n //find namespace for the prefix\n java.lang.String nsUri = reader.getNamespaceContext()\n .getNamespaceURI(nsPrefix);\n\n return (LoginResponse) ExtensionMapper.getTypeObject(nsUri,\n type, reader);\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 reader.next();\n\n while (!reader.isStartElement() && !reader.isEndElement())\n reader.next();\n\n if (reader.isStartElement() &&\n new javax.xml.namespace.QName(\n \"http://tempuri.org/\", \"LoginResult\").equals(\n reader.getName())) {\n nillableValue = reader.getAttributeValue(\"http://www.w3.org/2001/XMLSchema-instance\",\n \"nil\");\n\n if (\"true\".equals(nillableValue) ||\n \"1\".equals(nillableValue)) {\n object.setLoginResult(null);\n reader.next();\n\n reader.next();\n } else {\n object.setLoginResult(LoginMessageResponse.Factory.parse(\n reader));\n\n reader.next();\n }\n } // End of if for expected property start element\n\n else {\n }\n\n while (!reader.isStartElement() && !reader.isEndElement())\n reader.next();\n\n if (reader.isStartElement()) {\n // 2 - A start element we are not expecting indicates a trailing invalid property\n throw new org.apache.axis2.databinding.ADBException(\n \"Unexpected subelement \" + reader.getName());\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 onResponse(JSONObject response) {\n editor.putBoolean(\"credentials_validity\", true);\n editor.putInt(\"last_login_method\", Constants.FACEBOOK_LOGIN);\n editor.commit();\n onLoginFinished(false);\n }", "private void getAUTH_REQUEST() throws Exception {\n\t\t\n\t\tboolean status = true;\n\t\tboolean status2 = false;\n\t\tString msg = \"\";\n\t\t\n\t\t//File filePK = new File(\"identity\");\n\t\n\t\ttry {\n\t\t\t\n\t\t\tmsg = br.readLine();\n\t\t\tGetTimestamp(\"Received Authorization Request from Client: \" + msg);\n\t\t\t\n\t\t\tJSONObject REQUEST = (JSONObject) parser.parse(msg);\n\t String identity = REQUEST.get(\"identity\").toString();\n\t\t\t\n\t\t\t\n\t if((identity.contains(\"aaron@krusty\"))) {\n\n\t \tGetTimestamp(\"Authorization Request from Client is approved: \");\n\n\t \tGetTimestamp(\"Client Publickey is stored: \" ) ;\n\n\t \tString tosend = encrypt1(getSharedKey(), getClientPublicKey());\n\n\t \tGetTimestamp(\"Server sharedkey is being encrypted with Client's publickey to be sent: \") ;\n\n\t \tJSONObject RESPONSE = new JSONObject();\n\t \tRESPONSE.put(\"command\",\"AUTH_RESPONSE\");\n\t \tRESPONSE.put(\"AES128\", tosend);\n\t \tRESPONSE.put(\"status\", status);\n\t \tRESPONSE.put(\"message\", \"public key found\");\n\n\t \tStringWriter out = new StringWriter();\n\t \tRESPONSE.writeJSONString(out);\n\n\t \tString AUTH_RESPONSE = out.toString();\n\t \tSystem.out.println(AUTH_RESPONSE);\n\n\t \tGetTimestamp(\"Sending Authorization Response to Client: \");\n\n\t \tpw.println(AUTH_RESPONSE);\n\t \tpw.flush();\n\n\n\n\t }\n\t else {\n\n\t \tSystem.out.println(\"Client \" + REQUEST.get(\"identity\") + \" has been rejected\");\n\n\t \tJSONObject RESPONSE = new JSONObject();\n\t \tRESPONSE.put(\"command\",\"AUTH_RESPONSE\");\n\t \tRESPONSE.put(\"status\", status2);\n\t \tRESPONSE.put(\"message\", \"public key not found\");\n\n\t \tStringWriter out = new StringWriter();\n\t \tRESPONSE.writeJSONString(out);\n\n\t \tString AUTH_RESPONSE = out.toString();\n\t \tSystem.out.println(AUTH_RESPONSE);\n\n\t \tpw.println(AUTH_RESPONSE);\n\t \tpw.flush();\n\n\t \tcloseConnection();\n\t }\n\t\t\t\t\n\t\t\t\n\t\t} catch (IOException ex) {\n\t\t\tLogger.getLogger(ServerTCP.class.getName()).log(Level.SEVERE, null, ex);\n\t\t}\n\t\tif (msg.equalsIgnoreCase(\"bye\")) {\n\t\t\tSystem.out.println(\"Client has signed out!\");\n\t\t\tcloseConnection();\n\n\t\t} else {\t\n\t\t\tgetMessage();\n\t\t}\n\t}", "public String getAuthToken(String user, String password) throws Exception {\n _log.info(\"3PARDriver:getAuthToken enter\");\n String authToken = null;\n ClientResponse clientResp = null;\n String body= \"{\\\"user\\\":\\\"\" + user + \"\\\", \\\"password\\\":\\\"\" + password + \"\\\"}\";\n\n try {\n clientResp = _client.post_json(_baseUrl.resolve(URI_LOGIN), body);\n if (clientResp == null) {\n _log.error(\"3PARDriver:There is no response from 3PAR\");\n throw new HP3PARException(\"There is no response from 3PAR\");\n } else if (clientResp.getStatus() != 201) {\n String errResp = getResponseDetails(clientResp);\n throw new HP3PARException(errResp);\n } else {\n JSONObject jObj = clientResp.getEntity(JSONObject.class);\n authToken = jObj.getString(\"key\");\n this._authToken = authToken;\n this._user = user;\n this._password = password;\n _log.info(\"3PARDriver:getAuthToken set\");\n }\n return authToken;\n } catch (Exception e) {\n throw e;\n } finally {\n if (clientResp != null) {\n clientResp.close();\n }\n _log.info(\"3PARDriver:getAuthToken leave\");\n } //end try/catch/finally\n }", "@Override\n public Auth call() throws IOException {\n OkHttpClient client = new OkHttpClient();\n client.setFollowRedirects(false);\n client.setFollowSslRedirects(false);\n\n Request initRequest = new Request.Builder()\n .url(\"https://lobste.rs/login\")\n .build();\n\n Response initResponse = client.newCall(initRequest).execute();\n String initCookie = initResponse.header(\"Set-Cookie\").split(\";\")[0];\n String initBody = initResponse.body().string();\n String authenticity_token = Jsoup.parse(initBody).body().select(\"[name=authenticity_token]\").val();\n\n // Phase 2 is to authenticate given the cookie and authentication token\n RequestBody loginBody = new FormEncodingBuilder()\n .add(\"utf8\", \"\\u2713\")\n .add(\"authenticity_token\", authenticity_token)\n .add(\"email\", login)\n .add(\"password\", password)\n .add(\"commit\", \"Login\")\n .add(\"referer\", \"https://lobste.rs/\")\n .build();\n Request loginRequest = new Request.Builder()\n .url(\"https://lobste.rs/login\")\n .header(\"Cookie\", initCookie) // We must use #header instead of #addHeader\n .post(loginBody)\n .build();\n\n Response loginResponse = client.newCall(loginRequest).execute();\n String loginCookie = loginResponse.header(\"Set-Cookie\").split(\";\")[0];\n\n // Phase 3 is to grab the actual username/email from the settings page\n Request detailsRequest = new Request.Builder()\n .url(\"https://lobste.rs/settings\")\n .header(\"Cookie\", loginCookie)\n .build();\n Response detailsResponse = client.newCall(detailsRequest).execute();\n String detailsHtml = detailsResponse.body().string();\n\n Document dom = Jsoup.parse(detailsHtml);\n String username = dom.select(\"#user_username\").val();\n String email = dom.select(\"#user_email\").val();\n\n // And then we return the result of all three phases\n return new Auth(email, username, loginCookie);\n }", "public LoginMessageResponse getLoginResult() {\n return localLoginResult;\n }", "@Override\n public void onResponse(String json) {\n parseLogInResponse(json);\n }", "private void respAuth() throws Exception {\n DataOutputStream dos = new DataOutputStream(os);\n dos.writeInt(1);\n dos.writeByte(Message.MSG_RESP_AUTH);\n if (haslogin) {\n dos.writeByte(Message.SUCCESS_AUTH);\n } else {\n dos.writeByte(Message.FAILED_AUTH);\n }\n }", "java.lang.String getToken();", "java.lang.String getToken();", "java.lang.String getToken();", "java.lang.String getToken();", "java.lang.String getToken();", "java.lang.String getToken();", "public OIDCTokenResponse getOidcTokenResponse() {\n log.trace(\"Entering & Leaving\");\n return oidcTknResponse;\n }", "private static String getCloudAuth(String accessToken) {\n\t\ttry {\n\t\t\tURL urlResource = new URL(\"https://myapi.pathomation.com/api/v1/authenticate\");\n\t\t\tURLConnection conn = urlResource.openConnection();\n\t\t\tconn.setRequestProperty( \"Authorization\", \"Bearer \" + accessToken);\n\t\t\tconn.setUseCaches( false );\n\t\t\treturn getResponseString(conn);\n\t\t} catch (Exception e) {\n\t\t\treturn null;\n\t\t}\n\t}", "String getAccessToken();", "String getAccessToken();", "private HashMap<String, String> getclientCredentials(String strRequestXML) {\r\n\t\tlogger.info(\"Entering RequestValidator.getclientCredentials()\");\r\n\t\tHashMap<String, String> clientCredentialMap = new HashMap<String, String>();\r\n\t\ttry {\r\n\t\t\tDocumentBuilderFactory factory = DocumentBuilderFactory\r\n\t\t\t\t\t.newInstance();\r\n\t\t\tDocumentBuilder builder = factory.newDocumentBuilder();\r\n\t\t\tfactory.setNamespaceAware(true);\r\n\t\t\tDocument document = null;\r\n\t\t\tXPath xpath = XPathFactory.newInstance().newXPath();\r\n\t\t\tXPathExpression expression;\r\n\r\n\t\t\tdocument = builder.parse(new InputSource(new StringReader(\r\n\t\t\t\t\tstrRequestXML)));\r\n\t\t\tObject result;\r\n\t\t\tNodeList nodes;\r\n\r\n\t\t\texpression = xpath.compile(\"//\"\r\n\t\t\t\t\t+ PublicAPIConstant.IDENTIFICATION_USERNAME + \"/text()\");\r\n\t\t\tresult = expression.evaluate(document, XPathConstants.NODESET);\r\n\t\t\tnodes = (NodeList) result;\r\n\t\t\tclientCredentialMap.put(PublicAPIConstant.LOGIN_USERNAME, nodes\r\n\t\t\t\t\t.item(0).getNodeValue());\r\n\t\t\texpression = xpath.compile(\"//\"\r\n\t\t\t\t\t+ PublicAPIConstant.IDENTIFICATION_APPLICATIONKEY\r\n\t\t\t\t\t+ \"/text()\");\r\n\t\t\tresult = expression.evaluate(document, XPathConstants.NODESET);\r\n\t\t\tnodes = (NodeList) result;\r\n\t\t\tclientCredentialMap.put(PublicAPIConstant.API_KEY, nodes.item(0)\r\n\t\t\t\t\t.getNodeValue());\r\n\t\t\texpression = xpath.compile(\"//\"\r\n\t\t\t\t\t+ PublicAPIConstant.IDENTIFICATION_PASSWORD + \"/text()\");\r\n\t\t\tresult = expression.evaluate(document, XPathConstants.NODESET);\r\n\t\t\tnodes = (NodeList) result;\r\n\t\t\tclientCredentialMap.put(PublicAPIConstant.LOGIN_PASSWORD,\r\n\t\t\t\t\tCryptoUtil.generateHash(nodes.item(0).getNodeValue()));\r\n\t\t} catch (Exception e) {\r\n\t\t\tlogger.error(e);\r\n\t\t}\r\n\t\tlogger.info(\"Leaving RequestValidator.getclientCredentials()\");\r\n\t\treturn clientCredentialMap;\r\n\t}", "private void requestToken(){\n APIAuth auth = new APIAuth(this.prefs.getString(\"email\", \"\"), this.prefs.getString(\"password\", \"\"), this.prefs.getString(\"fname\", \"\") + \" \" +this.prefs.getString(\"lname\", \"\"), this.prefs, null);\n auth.authenticate();\n }", "public String getClientToken() {\n return clientToken;\n }", "public String getClientToken() {\n return clientToken;\n }", "String getToken(String username, String password, String grant_type) throws IllegalAccessException{\n\n String URI = serviceUrl + \"/oauth/token\" + \"?\" +\n String.format(\"%s=%s&%s=%s&%s=%s\", \"grant_type\", grant_type, \"username\", username, \"password\", password);\n// String CONTENT_TYPE = \"application/x-www-form-urlencoded\";\n // TODO clientId and clientSecret !!!\n String ENCODING = \"Basic \" +\n Base64.getEncoder().encodeToString(String.format(\"%s:%s\", \"clientId\", \"clientSecret\").getBytes());\n\n// AtomicReference<String> token = null;\n// authorization.subscribe(map -> {\n// token.set((String) map.get(ACCESS_TOKEN));\n// });\n\n String token = null;\n try {\n token = (String)WebClient.create().post()\n .uri(URI)\n .accept(MediaType.APPLICATION_FORM_URLENCODED)\n .contentType(MediaType.APPLICATION_FORM_URLENCODED)\n .header(\"Authorization\", ENCODING)\n .retrieve()\n .bodyToMono(Map.class)\n .block().get(ACCESS_TOKEN);\n } catch (Exception e){\n throw new IllegalAccessException(\"Can't reach access token\");\n }\n\n return token;\n }", "public String getClientToken() {\n return this.clientToken;\n }", "public String getClientToken() {\n return this.clientToken;\n }", "public String getClientToken() {\n return this.clientToken;\n }", "public String getClientToken() {\n return this.clientToken;\n }", "public java.lang.String getAccessToken(java.lang.String userName, java.lang.String password) throws java.rmi.RemoteException;", "public Result authenticate() {\r\n // 1. Define class to send JSON response back\r\n class Login {\r\n public Long id;\r\n public String gamerTag;\r\n public String token;\r\n\r\n public Login() {\r\n }\r\n }\r\n\r\n // 2. Read email and password from request()\r\n JsonNode request = request().body().asJson();\r\n String gamerTag = request.get(\"gamerTag\").asText();\r\n String password = request.get(\"password\").asText();\r\n\r\n // 3. Find user with given gamerTag\r\n Login ret = new Login();\r\n User user = User.gamerTagLogin(gamerTag);\r\n if (user == null) {\r\n return unauthorized(Json.toJson(ret));\r\n }\r\n // 4. Compare password.\r\n String sha256 = User.getSha256(request.get(\"password\").asText());\r\n if (sha256.equals(user.getPassword())) {\r\n // Success\r\n String authToken = generateAuthToken();\r\n user.setToken(authToken);\r\n Ebean.update(user);\r\n ret.token = authToken;\r\n ret.gamerTag = user.getGamerTag();\r\n ret.id = user.getId();\r\n return ok(Json.toJson(ret));\r\n\r\n }\r\n // 5. Unauthorized access\r\n return unauthorized();\r\n }", "private boolean authenticate (HttpRequest request, HttpResponse response) throws UnsupportedEncodingException\n\t{\n\t\tString[] requestSplit=request.getPath().split(\"/\",3);\n\t\tif(requestSplit.length<2)\n\t\t\treturn false;\n\t\tString serviceName=requestSplit[1];\n\t\tfinal int BASIC_PREFIX_LENGTH=\"BASIC \".length();\n\t\tString userPass=\"\";\n\t\tString username=\"\";\n\t\tString password=\"\";\n\t\t\n\t\t//Check for authentication information in header\n\t\tif(request.hasHeaderField(AUTHENTICATION_FIELD)\n\t\t\t\t&&(request.getHeaderField(AUTHENTICATION_FIELD).length()>BASIC_PREFIX_LENGTH))\n\t\t{\n\t\t\tuserPass=request.getHeaderField(AUTHENTICATION_FIELD).substring(BASIC_PREFIX_LENGTH);\n\t\t\tuserPass=new String(Base64.decode(userPass), \"UTF-8\");\n\t\t\tint separatorPos=userPass.indexOf(':');\n\t\t\t//get username and password\n\t\t\tusername=userPass.substring(0,separatorPos);\n\t\t\tpassword=userPass.substring(separatorPos+1);\n\t\t\t\n\t\t\t\n\t\t\ttry\n\t\t\t{\n\t\t\t\t\n\t\t\t\tlong userId;\n\t\t\t\tAgent userAgent;\n\t\t\t\t\n\t\t\t\tif ( username.matches (\"-?[0-9].*\") ) {\n\t\t\t\t\ttry {\n\t\t\t\t\t\tuserId = Long.valueOf(username);\n\t\t\t\t\t} catch ( NumberFormatException e ) {\n\t\t\t\t\t\tthrow new L2pSecurityException (\"The given user does not contain a valid agent id!\");\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tuserId = l2pNode.getAgentIdForLogin(username);\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tuserAgent = l2pNode.getAgent(userId);\n\t\t\t\t\n\t\t\t\tif ( ! (userAgent instanceof PassphraseAgent ))\n\t\t\t\t\tthrow new L2pSecurityException (\"Agent is not passphrase protected!\");\n\t\t\t\t((PassphraseAgent)userAgent).unlockPrivateKey(password);\n\t\t\t\t_currentUserId=userId;\n\t\t\t\t\n\t\t\t\tif(!_userSessions.containsKey(userId))//if user not registered\n\t\t\t\t{\t\t\t\t\n\t\t\t\t\tMediator mediator = l2pNode.getOrRegisterLocalMediator(userAgent);\n\t\t\t\t\t_userSessions.put(userId, new UserSession(mediator));\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t_userSessions.get(userId).updateServiceTime(serviceName,new Date().getTime());//update last access time for service\n\t\t\t\t\n\t\t\t\tconnector.logMessage(\"Login: \"+username);\n\t\t\t\tconnector.logMessage(\"Sessions: \"+Integer.toString(_userSessions.size()));\n\t\t\t\t\n\t\t\t\treturn true;\n\t\t\t\t\n\t\t\t}catch (AgentNotKnownException e) {\n\t\t\t\tsendUnauthorizedResponse(response, null, request.getRemoteAddress() + \": login denied for user \" + username);\n\t\t\t} catch (L2pSecurityException e) {\n\t\t\t\tsendUnauthorizedResponse( response, null, request.getRemoteAddress() + \": unauth access - prob. login problems\");\n\t\t\t} catch (Exception e) {\n\t\t\t\t\n\t\t\t\tsendInternalErrorResponse(\n\t\t\t\t\t\tresponse, \n\t\t\t\t\t\t\"The server was unable to process your request because of an internal exception!\", \n\t\t\t\t\t\t\"Exception in processing create session request: \" + e);\n\t\t\t}\n\t\t\t\n\t\t}\n\t\telse\n\t\t{\n\t\t\tresponse.setStatus ( HttpResponse.STATUS_BAD_REQUEST );\n\t\t\tresponse.setContentType( \"text/plain\" );\n\t\t\tresponse.print ( \"No authentication provided!\" );\n\t\t\tconnector.logError( \"No authentication provided!\" );\n\t\t}\n\t\treturn false;\n\t}", "@Override\n public void onSuccess(int statusCode, Header[] headers, byte[] server_response) {\n try {\n String response = String.valueOf(new String(server_response, \"UTF-8\"));\n Log.e(TAG, \"response login=>\" + response);\n /* hide progressbar */\n progress.dismiss();\n\n /* parse xml response */\n XMLParser parser = new XMLParser();\n Document doc = parser.getDomElement(response, url);\n\n if (doc == null) {\n Dialog.simpleWarning(Lang.get(\"returned_xml_failed\"), context);\n } else {\n NodeList errorsNode = doc.getElementsByTagName(\"errors\");\n\n /* handle errors */\n if (errorsNode.getLength() > 0) {\n Element element = (Element) errorsNode.item(0);\n NodeList errors = element.getChildNodes();\n\n if (errors.getLength() > 0) {\n Element error = (Element) errors.item(0);\n String key_error = error.getTextContent();\n Dialog.simpleWarning(Lang.get(key_error), context);\n }\n }\n /* process login */\n else {\n NodeList accountNode = doc.getElementsByTagName(\"account\");\n confirmLogin(accountNode);\n alertDialog.dismiss();\n }\n }\n\n } catch (UnsupportedEncodingException e1) {\n\n }\n }", "public String getAccessToken();", "@POST\n @Path(\"/UserAuth\")\n @Produces(MediaType.APPLICATION_JSON)\n public Response authenticateUser(final LoginRequest loginRequest) {\n final String methodName = \"authenticateUser\";\n log.entering(CLASS_NAME, methodName);\n Status status = Response.Status.OK;\n loginRequest.setImsAction(WipsConstant.WIPS_LOGIN_ACTION);\n final PendingApprovalResponse pendingApprovalResponse =\n this.wipsLoginBF.authenticateUser(loginRequest);\n if (pendingApprovalResponse.isValidUser()) {\n final String lterm =\n createUserSessionDetailsIntoCache(loginRequest.getRacfId(),\n pendingApprovalResponse);\n pendingApprovalResponse.setLtermToken(WipsUtil.encrpyt(lterm));\n } else {\n status = Response.Status.BAD_REQUEST;\n }\n log.exiting(CLASS_NAME, methodName);\n return buildResponse(pendingApprovalResponse, status);\n }", "private void _parseResponse(JSONObject response) {\n // Parse JSON response\n try {\n int responseCode = response.getInt(\"responseCode\");\n if (responseCode == AuthenticationChallengeResponseCodeSuccess) {\n String message = getString(R.string.authentication_success_message, _getChallenge().getIdentity().getDisplayName(), _getChallenge().getIdentityProvider().getDisplayName());\n _showAlertWithMessage(getString(R.string.authentication_success_title), message, true, false);\n } else {\n boolean retry = false;\n String message = getString(R.string.error_auth_unknown_error);\n if (responseCode == AuthenticationChallengeResponseCodeInvalidChallenge) {\n message = getString(R.string.error_auth_invalid_challenge);\n } else if (responseCode == AuthenticationChallengeResponseCodeInvalidRequest) {\n message = getString(R.string.error_auth_invalid_request);\n } else if (responseCode == AuthenticationChallengeResponseCodeInvalidUsernamePasswordPin) {\n message = getString(R.string.error_auth_invalid_userid);\n }\n\n _showAlertWithMessage(getString(R.string.authentication_failure_title), message, false, retry);\n }\n } catch (JSONException e) {\n _showAlertWithMessage(getString(R.string.authentication_failure_title), getString(R.string.error_auth_invalid_challenge), false, false);\n }\n }", "private void _parseResponse(String response) {\n if (response != null && response.equals(\"OK\")) {\n String message = getString(R.string.authentication_success_message, _getChallenge().getIdentity().getDisplayName(), _getChallenge().getIdentityProvider().getDisplayName());\n _showAlertWithMessage(getString(R.string.authentication_success_title), message, true, false);\n } else {\n String message = getString(R.string.error_auth_unknown_error);\n boolean retry = false;\n if (response.equals(\"INVALID_CHALLENGE\")) {\n message = getString(R.string.error_auth_invalid_challenge);\n } else if (response.equals(\"INVALID_REQUEST\")) {\n message = getString(R.string.error_auth_invalid_request);\n } else if (response.equals(\"INVALID_RESPONSE\")) {\n message = getString(R.string.error_auth_invalid_response);\n retry = true;\n } else if (response.equals(\"INVALID_USERID\")) {\n message = getString(R.string.error_auth_invalid_userid);\n }\n _showAlertWithMessage(getString(R.string.authentication_failure_title), message, false, retry);\n }\n\n }", "public void authenticate(LoginRequest loginRequest) {\n\n }", "AuthenticationTokenInfo authenticationTokenInfo(String headerToken);", "@Override\n public Bundle getAuthToken(AccountAuthenticatorResponse response, Account account, String authTokenType, Bundle options) throws NetworkErrorException {\n Log.d(LOG_TAG, \"getAuthToken() for account: \" + account.type + \", authTokenType=\" + authTokenType);\n\n // Extract the username and password from the Account Manager, and ask\n // the server for an appropriate AuthToken.\n final AccountManager am = AccountManager.get(mContext);\n\n String authToken = am.peekAuthToken(account, authTokenType);\n\n // Lets give another try to authenticate the user\n if (TextUtils.isEmpty(authToken)) {\n final String password = am.getPassword(account);\n if (password != null) {\n // perform a new server request for an auth token with known password\n// authToken = sServerAuthenticate.userSignIn(account.name, password, authTokenType);\n authToken = \"stub_token\";\n }\n }\n\n // if we got a new authToken or have stored one\n if (!TextUtils.isEmpty(authToken)) {\n // we get have a stored auth token - return it\n final Bundle result = new Bundle();\n result.putString(AccountManager.KEY_ACCOUNT_NAME, account.name);\n result.putString(AccountManager.KEY_ACCOUNT_TYPE, account.type);\n // diagram: get auth token from KEY_AUTHTOKEN\n result.putString(AccountManager.KEY_AUTHTOKEN, authToken);\n return result;\n }\n\n // If we get here, then we couldn't access the user's password - so we\n // need to re-prompt them for their credentials. We do that by creating\n // an intent to display our AuthenticatorActivity.\n final Intent intent = new Intent(mContext, AuthenticatorActivity.class);\n intent.putExtra(AccountManager.KEY_ACCOUNT_AUTHENTICATOR_RESPONSE, response);\n intent.putExtra(AuthenticatorActivity.ARG_ACCOUNT_TYPE, account.type);\n intent.putExtra(AuthenticatorActivity.ARG_AUTH_TYPE, authTokenType);\n final Bundle bundle = new Bundle();\n // diagram: Response includes KEY_INTENT? => AccountManager will launch authenticator intent\n bundle.putParcelable(AccountManager.KEY_INTENT, intent);\n return bundle;\n\n }", "public com.outlook.octavio.armenta.ws.SOAPServiceStub.LoginResponse login(\n com.outlook.octavio.armenta.ws.SOAPServiceStub.Login login2)\n throws java.rmi.RemoteException {\n org.apache.axis2.context.MessageContext _messageContext = new org.apache.axis2.context.MessageContext();\n\n try {\n org.apache.axis2.client.OperationClient _operationClient = _serviceClient.createClient(_operations[1].getName());\n _operationClient.getOptions()\n .setAction(\"http://tempuri.org/ISOAPService/Login\");\n _operationClient.getOptions().setExceptionToBeThrownOnSOAPFault(true);\n\n addPropertyToOperationClient(_operationClient,\n org.apache.axis2.description.WSDL2Constants.ATTR_WHTTP_QUERY_PARAMETER_SEPARATOR,\n \"&\");\n\n // create SOAP envelope with that payload\n org.apache.axiom.soap.SOAPEnvelope env = null;\n\n env = toEnvelope(getFactory(_operationClient.getOptions()\n .getSoapVersionURI()),\n login2,\n optimizeContent(\n new javax.xml.namespace.QName(\"http://tempuri.org/\",\n \"login\")),\n new javax.xml.namespace.QName(\"http://tempuri.org/\", \"Login\"));\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 org.apache.axis2.context.MessageContext _returnMessageContext = _operationClient.getMessageContext(org.apache.axis2.wsdl.WSDLConstants.MESSAGE_LABEL_IN_VALUE);\n org.apache.axiom.soap.SOAPEnvelope _returnEnv = _returnMessageContext.getEnvelope();\n\n java.lang.Object object = fromOM(_returnEnv.getBody()\n .getFirstElement(),\n com.outlook.octavio.armenta.ws.SOAPServiceStub.LoginResponse.class);\n\n return (com.outlook.octavio.armenta.ws.SOAPServiceStub.LoginResponse) object;\n } catch (org.apache.axis2.AxisFault f) {\n org.apache.axiom.om.OMElement faultElt = f.getDetail();\n\n if (faultElt != null) {\n if (faultExceptionNameMap.containsKey(\n new org.apache.axis2.client.FaultMapKey(\n faultElt.getQName(), \"Login\"))) {\n //make the fault by reflection\n try {\n java.lang.String exceptionClassName = (java.lang.String) faultExceptionClassNameMap.get(new org.apache.axis2.client.FaultMapKey(\n faultElt.getQName(), \"Login\"));\n java.lang.Class exceptionClass = java.lang.Class.forName(exceptionClassName);\n java.lang.reflect.Constructor constructor = exceptionClass.getConstructor(java.lang.String.class);\n java.lang.Exception ex = (java.lang.Exception) constructor.newInstance(f.getMessage());\n\n //message class\n java.lang.String messageClassName = (java.lang.String) faultMessageMap.get(new org.apache.axis2.client.FaultMapKey(\n faultElt.getQName(), \"Login\"));\n java.lang.Class messageClass = java.lang.Class.forName(messageClassName);\n java.lang.Object messageObject = fromOM(faultElt,\n messageClass);\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 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 if (_messageContext.getTransportOut() != null) {\n _messageContext.getTransportOut().getSender()\n .cleanup(_messageContext);\n }\n }\n }", "public AuthResponse loginAccount(Account acc){\n Call<AuthResponse> call = endpoints.loginAcc(acc);\n AuthResponse serverResponse = null;\n try {\n serverResponse = call.execute().body();\n } catch (IOException e) {\n e.printStackTrace();\n }\n return serverResponse;\n }", "@RequestMapping(value = \"/mqtt/auth\", method = { RequestMethod.POST, RequestMethod.GET })\r\n\tpublic String auth4MQTT(HttpServletRequest request, HttpServletResponse response) {\r\n\t\tString r = new String();\r\n\t\tEnumeration<String> params = request.getParameterNames();\r\n\t\tString userName = request.getParameter(\"username\");\r\n\t\tString pwd = request.getParameter(\"password\");\r\n\t\tString clientid = request.getParameter(\"clientid\");\r\n\t\t// ACL access 方式,1: 发布 2:订阅\r\n\t\t// 3:发布/订阅,可用于判断是否是acl校验,null表示是auth校验,非空时表示是acl校验\r\n\t\tString access = request.getParameter(\"access\");\r\n\t\tString topic = request.getParameter(\"topic\");\r\n\t\tString ip = request.getParameter(\"ipaddr\");\r\n\t\tif (clientid != null) {\r\n\t\t\tif (userName != null) {\r\n\t\t\t\t// check user auth\r\n\t\t\t\t// ....\r\n\t\t\t\t// check silo self\r\n\t\t\t\tif (!offlineMsgService.checkAuthForSilo(userName, pwd)) {\r\n\t\t\t\t\tresponse.setStatus(HttpServletResponse.SC_FORBIDDEN);\r\n\t\t\t\t}\r\n\r\n\t\t\t} else {\r\n\t\t\t\tresponse.setStatus(HttpServletResponse.SC_FORBIDDEN);\r\n\t\t\t}\r\n\t\t}\r\n\t\tlog.info(\"=======Mqtt auth clientId:{},user:{},access:{},topic:{},ip:{}========\", clientid, userName, access,\r\n\t\t\t\ttopic, ip);\r\n\t\treturn r;\r\n\t}", "public String getAuthCode()\n\t{\n\t\tif(response.containsKey(\"AUTH_CODE\")) {\n\t\t\treturn response.get(\"AUTH_CODE\");\n\t\t} else {\n\t\t\treturn null;\n\t\t}\n\t}", "@ApiOperation(value=\"Login\", notes=\"Login action\")\n @RequestMapping(value=\"/user/login\",method= RequestMethod.POST)\n @ResponseBody\n public LoginResVO loginHomeconnect(@ApiParam(value = \"account login\", required = true)@RequestHeader(value = \"PlatID\", required = true) String platID,@RequestHeader(value = \"AppID\", required = false) String appID,\n\t\t\t\t\t@RequestHeader HttpHeaders httpHeaders,\n\t\t\t\t\t@RequestBody(required = false) LoginReqVO body,HttpServletResponse response){\n\tString url = \"/api/translator/user/login\";\n\tLoginResVO result = new LoginResVO(RetObject.fail());\n\tMap<String,String> headerMap = new HashedMap();\n\theaderMap.put(\"PlatID\", platID);\n\theaderMap.put(\"AppID\", appID);\n\tString headers = getJSONString(headerMap);\n\tString bodyText = getJSONString(body);\n\tError headerError = validateHeaders(platID,appID);\n\tError bodyError = validateLoginBodyError(body);\n\tif ( bodyError == null && headerError == null){\n\t\tresponse.addHeader(\"AccessToken\",\"12345678\");\n\t\tresult = new LoginResVO();\n\t}\n\treturn result;\n}", "public String loginAAA(String userName, String password) {\n\t\tString token = null;\n\n\t\tHttpURLConnection httpConn = null;\n\t\ttry {\n\t\t\thttpConn = this.setHttpConnection(openAMLocation\n\t\t\t\t\t+ \"/json/authenticate\");\n\t\t\tthis.setHttpLoginAAARequestProperty(httpConn, userName, password);\n\t\t\tthis.setPostHttpConnection(httpConn, \"application/json\");\n\n\t\t\tBufferedReader bufReader = this.getHttpInputReader(httpConn);\n\t\t\tStringBuffer sb = new StringBuffer();\n\t\t\tString str = null;\n\n\t\t\twhile ((str = bufReader.readLine()) != null) {\n\t\t\t\tlogger.info(\"{}\", str);\n\t\t\t\tsb.append(str);\n\t\t\t}\n\n\t\t\tif (httpConn.getResponseCode() == 200) {\n\t\t\t\tString responseContentType = httpConn.getContentType();\n\t\t\t\tif (responseContentType.contains(\"json\")) {\n\t\t\t\t\tJSONObject JsonObj = new JSONObject(sb.toString());\n\t\t\t\t\tif (JsonObj.has(\"tokenId\"))\n\t\t\t\t\t\ttoken = JsonObj.getString(\"tokenId\");\n\t\t\t\t}\n\t\t\t\tlogger.info(\"token: {}\", token);\n\t\t\t}\n\n\t\t\tbufReader.close();\n\t\t} catch (IOException e) {\n\t\t\tlogger.error(\"IOException:\", e);\n\t\t} catch (JSONException e) {\n\t\t\tlogger.error(\"JSONException:\", e);\n\t\t} catch (Exception e) {\n\t\t\tlogger.error(\"Exception:\", e);\n\t\t}\n\n\t\treturn token;\n\t}", "@CrossOrigin(origins=\"*\")\n\t@RequestMapping(value=\"/login\", method=RequestMethod.POST)\n\tpublic ResponseSender loginMethod(Authentication authResult)\n\t{\n\t\t\n\t\tClientDetailsImpl clientDetailsImpl=((ClientDetailsImpl)authResult.getPrincipal());\n\t\t\n\t\tClient clientReg=clientDetailsImpl.getClient();\n\t\t\n\t\tResponseSender responseSender=new ResponseSender();\t\n\t\t\n\t\tClient client=clientService.getClientById(clientReg.getClientId());\n\t\tString firstName=clientReg.getFirstName();\n\t\t\t\n\t\tSystem.out.println(\"Inside LoginController loginMethod() firstName is :-\"+firstName );\n\t\t\n\t\t//user found in the db, make token for it\n\t\t\n\t\t//Loginid is email in client table\n\t\tjwtClient.setClientId(clientReg.getClientId());\n\t\tjwtClient.setEmail(clientReg.getEmail());\n\t\t//ProfileType id role in client table\n\t\t\n\t\t\n\t\tString token=jwtGenerator.generate();\n\t\t\n\t\tSystem.out.println(\"Inside LoginController loginMethod() token is :- \"+token);\n\t\t//adding token in the response \n\t\t\n\t\tresponseSender.setMessage(\"You are login Successfully\");\n\t\tresponseSender.setFlag(true);\n\t\tresponseSender.setFirstName(firstName);\n\t\t\n\t\t//Setting token to the JwtAuthenticationToken to ensure that when user will come again in future\n\t\t//he/she must be logged in\n\t\t\n\t\tjwtAuthenticationToken.setToken(token);\n\t\t\n\t\t\n\t\treturn responseSender;\n\t}", "OAuth2Token getToken();", "private AuthenticationResult processTokenResponse(HttpWebResponse webResponse, final HttpEvent httpEvent)\n throws AuthenticationException {\n final String methodName = \":processTokenResponse\";\n AuthenticationResult result;\n String correlationIdInHeader = null;\n String speRing = null;\n if (webResponse.getResponseHeaders() != null) {\n if (webResponse.getResponseHeaders().containsKey(\n AuthenticationConstants.AAD.CLIENT_REQUEST_ID)) {\n // headers are returning as a list\n List<String> listOfHeaders = webResponse.getResponseHeaders().get(\n AuthenticationConstants.AAD.CLIENT_REQUEST_ID);\n if (listOfHeaders != null && listOfHeaders.size() > 0) {\n correlationIdInHeader = listOfHeaders.get(0);\n }\n }\n\n if (webResponse.getResponseHeaders().containsKey(AuthenticationConstants.AAD.REQUEST_ID_HEADER)) {\n // headers are returning as a list\n List<String> listOfHeaders = webResponse.getResponseHeaders().get(\n AuthenticationConstants.AAD.REQUEST_ID_HEADER);\n if (listOfHeaders != null && listOfHeaders.size() > 0) {\n Logger.v(TAG + methodName, \"Set request id header. \" + \"x-ms-request-id: \" + listOfHeaders.get(0));\n httpEvent.setRequestIdHeader(listOfHeaders.get(0));\n }\n }\n\n if (null != webResponse.getResponseHeaders().get(X_MS_CLITELEM) && !webResponse.getResponseHeaders().get(X_MS_CLITELEM).isEmpty()) {\n final CliTelemInfo cliTelemInfo =\n TelemetryUtils.parseXMsCliTelemHeader(\n webResponse.getResponseHeaders()\n .get(X_MS_CLITELEM).get(0)\n );\n\n if (null != cliTelemInfo) {\n httpEvent.setXMsCliTelemData(cliTelemInfo);\n speRing = cliTelemInfo.getSpeRing();\n }\n }\n }\n\n final int statusCode = webResponse.getStatusCode();\n\n if (statusCode == HttpURLConnection.HTTP_OK\n || statusCode == HttpURLConnection.HTTP_BAD_REQUEST\n || statusCode == HttpURLConnection.HTTP_UNAUTHORIZED) {\n try {\n result = parseJsonResponse(webResponse.getBody());\n if (result != null) {\n if (null != result.getErrorCode()) {\n result.setHttpResponse(webResponse);\n }\n\n final CliTelemInfo cliTelemInfo = new CliTelemInfo();\n cliTelemInfo._setSpeRing(speRing);\n result.setCliTelemInfo(cliTelemInfo);\n httpEvent.setOauthErrorCode(result.getErrorCode());\n }\n } catch (final JSONException jsonException) {\n throw new AuthenticationException(ADALError.SERVER_INVALID_JSON_RESPONSE,\n \"Can't parse server response. \" + webResponse.getBody(),\n webResponse, jsonException);\n }\n } else if (statusCode >= HttpURLConnection.HTTP_INTERNAL_ERROR && statusCode <= MAX_RESILIENCY_ERROR_CODE) {\n throw new ServerRespondingWithRetryableException(\"Server Error \" + statusCode + \" \"\n + webResponse.getBody(), webResponse);\n } else {\n throw new AuthenticationException(ADALError.SERVER_ERROR,\n \"Unexpected server response \" + statusCode + \" \" + webResponse.getBody(),\n webResponse);\n }\n\n // Set correlationId in the result\n if (correlationIdInHeader != null && !correlationIdInHeader.isEmpty()) {\n try {\n UUID correlation = UUID.fromString(correlationIdInHeader);\n if (!correlation.equals(mRequest.getCorrelationId())) {\n Logger.w(TAG + methodName, \"CorrelationId is not matching\", \"\",\n ADALError.CORRELATION_ID_NOT_MATCHING_REQUEST_RESPONSE);\n }\n\n Logger.v(TAG + methodName, \"Response correlationId:\" + correlationIdInHeader);\n } catch (IllegalArgumentException ex) {\n Logger.e(TAG + methodName, \"Wrong format of the correlation ID:\" + correlationIdInHeader, \"\",\n ADALError.CORRELATION_ID_FORMAT, ex);\n }\n }\n\n if (null != webResponse.getResponseHeaders()) {\n final List<String> xMsCliTelemValues = webResponse.getResponseHeaders().get(X_MS_CLITELEM);\n if (null != xMsCliTelemValues && !xMsCliTelemValues.isEmpty()) {\n // Only one value is expected to be present, so we'll grab the first element...\n final String speValue = xMsCliTelemValues.get(0);\n final CliTelemInfo cliTelemInfo = TelemetryUtils.parseXMsCliTelemHeader(speValue);\n if (result != null) {\n result.setCliTelemInfo(cliTelemInfo);\n }\n }\n }\n\n return result;\n }", "@Override\n /**\n * Handles a HTTP GET request. This implements obtaining an authentication token from the server.\n */\n protected void handleGet(Request request, Response response) throws IllegalStateException {\n String username = String.valueOf(request.getAttributes().get(\"username\"));\n String password = String.valueOf(request.getAttributes().get(\"password\"));\n /* Construct MySQL Query. */\n String query = \"SELECT COUNT(id) AS `CNT`, `authToken` FROM accounts WHERE `username` = '\" + username + \"' AND \" +\n \"`password` = '\" + password + \"' LIMIT 0,1;\";\n /* Obtain the account count and existing token pair, as object array. */\n Object[] authenticationArray = dataHandler.handleAuthentication(database.ExecuteQuery(query,\n new ArrayList<String>()));\n int cnt = (int) authenticationArray[0];\n String existingToken = (String) authenticationArray[1];\n String authenticationToken = null;\n if (cnt == 1) { // There is exactly one account matching the parameterised username and password.\n if (existingToken == null) { // No token yet existed, generate one.\n authenticationToken = TokenGenerator.getInstance().generateAuthenticationToken(TOKEN_LENGTH);\n } else {\n authenticationToken = existingToken;\n }\n } else {\n this.returnStatus(response, new IllegalArgumentStatus(null));\n }\n if (!(authenticationToken == null || authenticationToken == \"\")) { // Update the database with the new token.\n Database.getInstance().ExecuteUpdate(\"UPDATE `accounts` SET `authToken` = '\" + authenticationToken +\n \"', `authTokenCreated` = CURRENT_TIMESTAMP WHERE `username` = '\" + username + \"';\",\n new ArrayList<String>());\n this.returnResponse(response, authenticationToken, new TokenSerializer());\n } else {\n this.returnStatus(response, new IllegalArgumentStatus(null));\n }\n }", "private String login() throws AxisFault {\n APIManagerConfiguration config = ServiceReferenceHolder.getInstance().\n getAPIManagerConfigurationService().getAPIManagerConfiguration();\n String user = config.getFirstProperty(APIConstants.API_GATEWAY_USERNAME);\n String password = config.getFirstProperty(APIConstants.API_GATEWAY_PASSWORD);\n String url = config.getFirstProperty(APIConstants.API_GATEWAY_SERVER_URL);\n\n if (url == null || user == null || password == null) {\n throw new AxisFault(\"Required API gateway admin configuration unspecified\");\n }\n\n String host;\n try {\n host = new URL(url).getHost();\n } catch (MalformedURLException e) {\n throw new AxisFault(\"API gateway URL is malformed\", e);\n }\n\n AuthenticationAdminStub authAdminStub = new AuthenticationAdminStub(\n ServiceReferenceHolder.getContextService().getClientConfigContext(),\n url + \"AuthenticationAdmin\");\n ServiceClient client = authAdminStub._getServiceClient();\n Options options = client.getOptions();\n options.setManageSession(true);\n try {\n authAdminStub.login(user, password, host);\n ServiceContext serviceContext = authAdminStub.\n _getServiceClient().getLastOperationContext().getServiceContext();\n String sessionCookie = (String) serviceContext.getProperty(HTTPConstants.COOKIE_STRING);\n return sessionCookie;\n } catch (RemoteException e) {\n throw new AxisFault(\"Error while contacting the authentication admin services\", e);\n } catch (LoginAuthenticationExceptionException e) {\n throw new AxisFault(\"Error while authenticating against the API gateway admin\", e);\n }\n }", "java.lang.String getAuthentication(int index);", "String getUsernameFromToken(String token);", "@POST\n @Path(\"/salesforce/auth\")\n @Consumes(MediaType.APPLICATION_JSON)\n @Produces(MediaType.APPLICATION_JSON)\n public Response postAuth() {\n\n JSONObject jsonObject = new JSONObject();\n\n jsonObject.put(\"access_token\", \"abcdefghijklmnopqrstuvwxyz\");\n\n return Response.status(202).entity(jsonObject).build();\n }", "public java.lang.String getOauth_token(){\r\n return localOauth_token;\r\n }", "AuthenticationToken authenticate(String username, CharSequence password) throws Exception;", "@Request(opcode = OpCode.CSLogin)\n public RetPacket handlerLogin(Object clientData, Session session){\n return null;\n }", "public void setToken(){\n token=null;\n try {\n OkHttpClient client = new OkHttpClient();\n RequestBody reqbody = RequestBody.create(null, new byte[0]); \n Request request = new Request.Builder()\n .url(\"https://api.mercadolibre.com/oauth/token?grant_type=client_credentials&client_id=\"+clienteID +\"&client_secret=\"+secretKey)\n .post(reqbody)\n .addHeader(\"content-type\", \"application/json\")\n .addHeader(\"cache-control\", \"no-cache\")\n .addHeader(\"postman-token\", \"67053bf3-5397-e19a-89ad-dfb1903d50c4\")\n .build();\n \n Response response = client.newCall(request).execute();\n String respuesta=response.body().string();\n token=respuesta.substring(respuesta.indexOf(\"APP\"),respuesta.indexOf(\",\")-1);\n System.out.println(token);\n } catch (IOException ex) {\n Logger.getLogger(MercadoLibreAPI.class.getName()).log(Level.SEVERE, null, ex);\n token=null;\n }\n }", "@Override\n\tpublic void sendLogin() {\n\t\t// TODO Auto-generated method stub\n\t\ttry{\n\t\t\tString result = \"\";\n\t\t\tif (this.servType.equals(SERVICE_TYPE_SOAP)){\n\t\t\t\tresult = server.login();\n\t\t\t} else {\n\t\t\t\tWebResource loginService = service.path(URI_LOGIN);\n\t\t\t\tresult = loginService.accept(MediaType.TEXT_PLAIN).get(String.class);\n\t\t\t}\n\t\t\t//get the clientId\n\t\t\tclientId = Integer.parseInt(result);\n\t\t\t//set the status\n\t\t\tgui.setStatus(\"Successfully logged in! Obtained client ID: \"+clientId+\" from server!\");\n\t\t\t//immediately send the request for the list of items\n\t\t\tsendItemListRequest();\n\t\t} catch (ClientHandlerException ex){\n\t\t\t//exceptions for REST service\n\t\t\tex.printStackTrace();\n\t\t\tsetOKDialog(\"Error\", \"The RESTFul server is not responding!! Closing application...\");\n\t\t\tSystem.exit(0);\n\t\t} catch (WebServiceException ex){\n\t\t\t//exceptions for SOAP-RPC service\n\t\t\tex.printStackTrace();\n\t\t\tsetOKDialog(\"Error\", \"The SOAP-RPC server is not responding!! Closing application...\");\n\t\t\tSystem.exit(0);\n\t\t}\n\t}", "public static Map<String,Object> authCodeProcess(authCodeProcessModel authVal,HttpServletResponse resp) throws IOException, InterruptedException\n\t{\n // Concatenate clientid and clientsecret and use base64 to encode the concatenated string for security purpose to authenticate the client\n String clientandSecret = authVal.getClientid() + \":\" + authVal.getClientsecret();\n //encoding the clientid with client secret\n String base64ClientandSecret = new String(Base64.getEncoder().encode(clientandSecret.getBytes()));\n \n //Create http client for request to token endpoint for get access token and refresh token \n HttpClient client = HttpClient.newHttpClient();\n\n // Create HTTP POST request object for Token Request\n HttpRequest tokRequest = HttpRequest.newBuilder()\n .uri(URI.create(\"http://localhost:8080/OPENID/msOIDC/token\"))\n .POST(BodyPublishers.ofString(\"\"))\n .header(\"Authorization\",base64ClientandSecret)\n .header(\"grant_type\", \"authorization_code\")\n .header(\"redirect_uri\",authVal.getRedirecturi())\n .header(\"code\", authVal.getCode())\n .header(\"Content-Type\", \"application/json\")\n .build();\n // Send HTTP request\n\t\t\tHttpResponse<String> tokenResponse;\n\t\t\t\ttokenResponse = client.send(tokRequest,\n\t\t\t\t HttpResponse.BodyHandlers.ofString());\n\t //Enclosed the response in map datastructure ,it is easy to parse the response\n\t Map<String,Object> tokenResp=processJSON(tokenResponse.body().replace(\"{\", \"\").replace(\"}\",\"\"));\n\t return tokenResp;\n\t}", "public void authenticate() {\n JSONObject jsonRequest = new JSONObject();\n try {\n jsonRequest.put(\"action\", \"authenticate\");\n jsonRequest.put(\"label\", \"label\");\n JSONObject dataObject = new JSONObject();\n dataObject.put(\"device_token\", CMAppGlobals.TOKEN);\n jsonRequest.put(\"data\", dataObject);\n\n if(CMAppGlobals.DEBUG) Logger.i(TAG, \":: AuthWsManager.authenticate : jsonRequest : \" + jsonRequest);\n\n // send JSON data\n WSManager.getInstance().con(mContext).sendJSONData(jsonRequest);\n\n\n } catch (JSONException e) {\n\n mContext.onWsFailure(e);\n }\n\n }", "@Nullable\n @Override\n public Request authenticate(@NonNull Route route, @NonNull okhttp3.Response response) throws IOException {\n ABBYYLingvoAPI abbyyLingvoAPI = getApi();\n\n Call<ResponseBody> myCall = abbyyLingvoAPI.getBasicToken();\n Response<ResponseBody> response1;\n try {\n response1 = myCall.execute();\n if (response1.isSuccessful()) {\n accessToken = response1.body().string();\n Log.d(Constants.LOG_TAG, \"basic response is success, got accessToken\");\n } else {\n Log.e(Constants.LOG_TAG, \"basic response isn't successful, response code is: \" + response1.code());\n }\n } catch (IOException e) {\n Log.e(Constants.LOG_TAG, \"basic response isn't successful cause error: \" + e.toString());\n }\n\n // Add new header to rejected request and retry it\n accessTokenRequest = response.request().newBuilder()\n .addHeader(\"Authorization\", \"Bearer \" + accessToken)\n .build();\n\n return accessTokenRequest;\n }", "@Override\n public JsonResponse duringAuthentication(String... params) {\n try {\n final String username = params[0];\n final String password = params[1];\n return RequestHandler.authenticate(this.getApplicationContext(), username, password);\n } catch (IOException e) {\n return null;\n }\n }", "String getLoginapiavgrtt();", "@Override\n public Object getCredentials() {\n return token;\n }" ]
[ "0.6134843", "0.61101246", "0.608185", "0.6056327", "0.5921681", "0.5875011", "0.58730996", "0.58707833", "0.5862427", "0.58372766", "0.58188635", "0.5777905", "0.57625014", "0.57422477", "0.5725542", "0.569055", "0.5690288", "0.5680749", "0.5680749", "0.5680749", "0.56780744", "0.56697786", "0.56688005", "0.56636906", "0.56615037", "0.5649469", "0.5611882", "0.5601262", "0.55925304", "0.5592009", "0.5590751", "0.5582582", "0.5569953", "0.5568929", "0.5559691", "0.5557035", "0.55498016", "0.55481565", "0.5522862", "0.5519974", "0.55184025", "0.5517739", "0.5503633", "0.5491287", "0.54863405", "0.548399", "0.548399", "0.548399", "0.548399", "0.548399", "0.548399", "0.5467517", "0.5463736", "0.54626495", "0.54626495", "0.5446497", "0.5435321", "0.5427323", "0.5427323", "0.5427253", "0.5426853", "0.5426853", "0.5426853", "0.5426853", "0.54249036", "0.54244953", "0.5423056", "0.5423053", "0.54211724", "0.54162544", "0.5400676", "0.5396961", "0.5393207", "0.53768265", "0.5375155", "0.5371297", "0.537006", "0.5369134", "0.53648245", "0.5350401", "0.53495115", "0.534845", "0.5343808", "0.5340664", "0.53403276", "0.5333497", "0.5328151", "0.5316934", "0.5313501", "0.5308877", "0.53065", "0.530049", "0.5294729", "0.5278919", "0.5276378", "0.52660173", "0.52655506", "0.52523255", "0.5249341", "0.5243988" ]
0.79928786
0
The body of the response is lines of keyvalue pairs
protected Map<String, String> parseClientLoginBody(String body) { Map<String, String> responseMap = new HashMap<>(); for (String line : body.split("\n")) { int idx = line.indexOf("="); if (idx > 0) { responseMap.put(line.substring(0, idx), line.substring(idx + 1)); } } return responseMap; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private String getBody(CloseableHttpResponse response) throws IOException {\n HttpEntity entity = response.getEntity();\n return EntityUtils.toString(entity, \"UTF-8\");\n }", "private static String paseResponse(HttpResponse response) {\n\t\tHttpEntity entity = response.getEntity();\n\t\t\n//\t\tlog.info(\"response status: \" + response.getStatusLine());\n\t\tString charset = EntityUtils.getContentCharSet(entity);\n//\t\tlog.info(charset);\n\t\t\n\t\tString body = null;\n\t\ttry {\n if (entity != null) { \n InputStream instreams = entity.getContent(); \n body = convertStreamToString(instreams); \n// System.out.println(\"result:\" + body);\n } \n//\t\t\tlog.info(body);\n\t\t} catch (ParseException e) {\n\t\t\te.printStackTrace();\n\t\t} catch (IOException e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t\t\n\t\treturn body;\n\t}", "public void parseResponse();", "private static ArrayList<Map> formatResponse(String response) {\n\t\tObjectMapper mapper = new ObjectMapper();\r\n\t try {\r\n\t\t\tMap res1 = mapper.readValue(response, HashMap.class);\r\n\t\t\t\r\n\t\t\t return (ArrayList<Map>) res1.get(SESSION);\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\treturn null;\t \r\n\t}", "java.lang.String getResponse();", "java.lang.String getBody();", "@Override\n public Object parseNetworkResponse(Response response, int i) throws Exception {\n return response.body().string();\n }", "void parseBody(Map<String, String> files) throws IOException, ResponseException;", "private String getBody(InputStream stream) throws IOException {\r\n\t\t// retrieve response body\r\n\t\tBufferedReader br = null;\r\n\r\n\t\ttry {\r\n\t\t\tbr = new BufferedReader(new InputStreamReader(stream));\r\n\t\t\tStringBuffer buffer = new StringBuffer();\r\n\t\t\tString line;\r\n\r\n\t\t\twhile ((line = br.readLine()) != null) {\r\n\t\t\t\tbuffer.append(line);\r\n\t\t\t}\r\n\r\n\t\t\treturn buffer.toString();\r\n\t\t} finally {\r\n\t\t\tif (br != null) {\r\n\t\t\t\tbr.close();\r\n\t\t\t}\r\n\t\t}\r\n\t}", "private static List<Map<String, String>> proceessResponse(InputStream is) throws IOException {\r\n\t\tList<Map<String, String>> result = new ArrayList<Map<String, String>>();\r\n\t\tHashMap<String, String> record;\r\n\t\tBufferedReader rd = new BufferedReader(new InputStreamReader(is));\r\n\t\tString line = rd.readLine();\r\n\t\tString[] columns = line.split(\",\");\r\n\t\twhile ((line = rd.readLine()) != null) {\r\n\t\t\tString[] values = line.split(\",\");\r\n\t\t\trecord = new HashMap<String, String>();\r\n\t\t\tfor (int i = 0; i < values.length && i < columns.length; i++) {\r\n\t\t\t\trecord.put(columns[i], values[i]);\r\n\t\t\t}\r\n\t\t\tresult.add(record);\r\n\t\t}\r\n\t\treturn result;\r\n\t}", "public String readResponse(HttpResponse httpResp) {\n String response = \"\";\n try {\n int code = httpResp.getStatusLine().getStatusCode();\n Log(\"Response code=\" + code);\n InputStream is = httpResp.getEntity().getContent();\n BufferedReader inb = new BufferedReader(new InputStreamReader(is));\n StringBuilder sb = new StringBuilder(\"\");\n String line;\n String NL = System.getProperty(\"line.separator\");\n while ((line = inb.readLine()) != null) {\n sb.append(line).append(NL);\n Log(\"Read \" + line);\n }\n inb.close();\n response = sb.toString();\n } catch (Exception ex) {\n ex.printStackTrace();\n }\n return response;\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 String getResponseBody() {\n return this.responseBody;\n }", "public String getBody() {\n\t\tif(body == null) {\n\t\t\ttry {\n\t\t\t\tbody = streamToString(response.getEntity().getContent());\n\t\t\t\treturn body;\n\t\t\t} catch (IllegalStateException e) {\n\t\t\t\tLog.e(Integrum.TAG, e.getStackTrace().toString());\n\t\t\t\treturn \"\";\n\t\t\t} catch (IOException e) {\n\t\t\t\tLog.e(Integrum.TAG, e.getStackTrace().toString());\n\t\t\t\treturn \"\";\n\t\t\t}\n\t\t} else {\n\t\t\treturn body;\n\t\t}\n\t}", "@Override\n public void onSuccess(int statusCode, Header[] headers, JSONObject response) {\n\n try {\n JSONArray jsonArray = response.getJSONArray(\"value\");\n\n for (int i = 0; i < jsonArray.length(); i++) {\n JSONObject mPJSONArray = jsonArray.getJSONObject(i);\n\n Log.i(\"AsyncHttpClient1\", jsonArray.toString());\n\n String description = mPJSONArray.getString(\"Description\");\n\n addRecord( description);\n }\n\n } catch (JSONException e) {\n e.printStackTrace();\n }\n }", "@Override\n public void onSuccess(int statusCode, Header[] headers, byte[] responseBody) {\n String response = null;\n try {\n response = new String(responseBody, ENCODING);\n JSONArray jsonArray = new JSONArray(response);\n Log.e(\"JSONARRAY\", jsonArray.toString(1));\n } catch (UnsupportedEncodingException e) {\n e.printStackTrace();\n } catch (JSONException e) {\n e.printStackTrace();\n }\n\n }", "private String getServerStatusData() throws IOException {\r\n File keyFile = resources.ResourceLoader.getFile(\"key.txt\");\r\n String key = new Scanner(keyFile).nextLine();\r\n\r\n URLConnection conn = new URL(baseURL).openConnection();\r\n conn.setDoOutput(true);\r\n conn.setRequestProperty(\"X-Riot-Token\", key);\r\n\r\n try(BufferedReader in = new BufferedReader(new InputStreamReader(conn.getInputStream()))) {\r\n String line = in.readLine();\r\n in.close();\r\n return line.replace(\"\\\\r\\\\n\", \"\");\r\n }\r\n catch(UnknownHostException e) {\r\n System.out.println(e);\r\n throw e;\r\n }\r\n }", "protected String getBody(VitroRequest vreq, Map<String, Object> body, Configuration config) {\n return \"\";\n }", "public com.google.protobuf.ByteString\n getResponseBodyBytes() {\n return com.google.protobuf.ByteString.copyFromUtf8(responseBody_);\n }", "@Override\n\t\t\tpublic void onResponse(Response response) throws IOException {\n Log.i(\"info\",response.body().string());\n\t\t\t}", "@Override\n public Boolean onCompleted(Response response) throws Exception {\n System.out.println(response.getResponseBody());\n Type type = new TypeToken<Map<String, String>>() {\n }.getType();\n Map<String, String> jsonMap = jsonSeralizer.fromJson(response.getResponseBody(), type);\n //System.out.println(\"Results of Permssions set: \"+jsonMap);\n if (!jsonMap.get(\"success\").equals(1)) {\n System.out.println(\"File has been made available.\");\n return true;\n } else {\n System.out.println(jsonMap.get(\"error_message\"));\n return false;\n\n }\n }", "private String readResponseBody() {\n try {\n StringBuilder s_buffer = new StringBuilder();\n InputStream is = new BufferedInputStream(httpConn.getInputStream());\n BufferedReader br = new BufferedReader(new InputStreamReader(is));\n String inputLine;\n while ((inputLine = br.readLine()) != null) {\n s_buffer.append(inputLine);\n }\n return s_buffer.toString();\n } catch (Exception e) {\n Log.e(TAG, e.getMessage());\n return null;\n }\n }", "private BufferedReader getResponse(IRequest request) throws Exception {\n\t\tString url = this.getBasePath() + request.getEndpoint();\n\t\tURL obj = new URL(url);\n\t\tHttpURLConnection connection = (HttpURLConnection) obj.openConnection();\n\n\t\t// Set header values\n\t\t//System.out.println(request.getRequestMethod());\n\t\t//System.out.println(request.getEndpoint());\n\t\tconnection.setRequestMethod(request.getRequestMethod());\n\t\tconnection.setRequestProperty(\"Content-Type\", \"application/json\");\n\n\t\t// Write Cookies\n\t\tif (cookieManager.getCookieStore().getCookies().size() > 0) {\n\t\t\t// Cookies are stored as a comma delimited list\n\t\t\tString delim = \"\";// This ensures that there is no comma before the\n\t\t\t\t\t\t\t\t// first value\n\t\t\tStringBuilder builder = new StringBuilder();\n\t\t\tfor (HttpCookie i : cookieManager.getCookieStore().getCookies()) {\n\t\t\t\tbuilder.append(delim).append(i);\n\t\t\t\tdelim = \"; \";// faster than using an if statement every iteration\n\t\t\t}\n\t\t\tconnection.setRequestProperty(\"Cookie\", builder.toString());\n\t\t}\n\n\t\t\n\t\tconnection.setDoOutput(true);\n\t\t\n\t\t// Write the body\n\n\t\tString bodyString = request.getBody();\n\t\tbyte[] outputInBytes = bodyString.getBytes(\"UTF-8\");\n\t\tOutputStream os = connection.getOutputStream();\n\t\tos.write(outputInBytes);\n\t\tos.close();\n\t\tint responseCode = connection.getResponseCode();\n\t\tif(responseCode != 200){\n\t\t\tthrow new RequestException(responseCode);\n\t\t}\n\n\t\tBufferedReader response = new BufferedReader(new InputStreamReader(\n\t\t\t\tconnection.getInputStream()));\n\n\t\t// Save Cookies\n\t\tMap<String, List<String>> headerFields = connection.getHeaderFields();\n\t\tList<String> cookiesHeader = headerFields.get(COOKIES_HEADER);\n\t\tif (cookiesHeader != null) {\n\t\t\tfor (String cookie : cookiesHeader) {\n\t\t\t\tcookieManager.getCookieStore().add(obj.toURI(),\n\t\t\t\t\t\tHttpCookie.parse(cookie).get(0));\n\t\t\t}\n\t\t}\n\n\t\treturn response;\n\t}", "public java.lang.String getResponseBody() {\n return responseBody_;\n }", "@Test\n public void Task7() {\n Body[] body=\n given()\n .when()\n .get(\"https://jsonplaceholder.typicode.com/todos\")\n .then()\n .extract().as(Body[].class)\n ;\n System.out.println(\"body\"+\" \"+ Arrays.toString(body));\n // diger bir yolu\n List<Body> bodies= Arrays.asList(body);\n System.out.println(\"bodies = \" + bodies);\n }", "private String getResponse(InputStream input) throws IOException {\n\t\ttry (BufferedReader buffer = new BufferedReader(new InputStreamReader(input))) {\n\t\t\treturn buffer.lines().collect(Collectors.joining(\"\\n\"));\n\t\t}\n\t}", "private void writeResponseLine(final DataOutput out) throws IOException {\n out.writeBytes(HTTP_VERSION);\n out.writeBytes(SP);\n out.writeBytes(code + \"\");\n out.writeBytes(SP);\n if (responseString != null) {\n out.writeBytes(responseString);\n }\n out.writeBytes(CRLF);\n }", "String getResponse();", "public int getLinesResource(){\n return response.body().split(\"\\n\").length;\n }", "private static void readResponse(ClientResponse response)\r\n\t{\r\n\t// Response\r\n\tSystem.out.println();\r\n\tSystem.out.println(\"Response: \" + response.toString());\r\n\r\n\t}", "@Override\r\n public Reader contentReader() {\r\n try {\r\n return okResponse.body().charStream();\r\n } catch (IOException e) {\r\n throw fail(e);\r\n }\r\n }", "private static String parseResponse(HttpResponse response) throws Exception {\r\n \t\tString result = null;\r\n \t\tBufferedReader reader = null;\r\n \t\ttry {\r\n \t\t\tHeader contentEncoding = response\r\n \t\t\t\t\t.getFirstHeader(\"Content-Encoding\");\r\n \t\t\tif (contentEncoding != null\r\n \t\t\t\t\t&& contentEncoding.getValue().equalsIgnoreCase(\"gzip\")) {\r\n \t\t\t\treader = new BufferedReader(new InputStreamReader(\r\n \t\t\t\t\t\tnew GZIPInputStream(response.getEntity().getContent())));\r\n \t\t\t} else {\r\n \t\t\t\treader = new BufferedReader(new InputStreamReader(response\r\n \t\t\t\t\t\t.getEntity().getContent()));\r\n \t\t\t}\r\n \t\t\tStringBuilder sb = new StringBuilder();\r\n \t\t\tString line = null;\r\n \r\n \t\t\twhile ((line = reader.readLine()) != null) {\r\n \t\t\t\tsb.append(line + \"\\n\");\r\n \t\t\t}\r\n \t\t\tresult = sb.toString();\r\n \t\t} finally {\r\n \t\t\tif (reader != null) {\r\n \t\t\t\treader.close();\r\n \t\t\t}\r\n \t\t}\r\n \t\treturn result;\r\n \t}", "JsonNode readNextResponse() {\n try {\n String responseLine = this.stdout.readLine();\n if (responseLine == null) {\n throw new JsiiException(\"Child process exited unexpectedly!\");\n }\n final JsonNode response = JsiiObjectMapper.INSTANCE.readTree(responseLine);\n JsiiRuntime.notifyInspector(response, MessageInspector.MessageType.Response);\n return response;\n } catch (IOException e) {\n throw new JsiiException(\"Unable to read reply from jsii-runtime: \" + e.toString(), e);\n }\n }", "public IMAPUntaggedResponse(String keyword, byte [] response) {\n super(response); \n this.keyword = keyword; \n }", "protected static JsonElement bodyAsJson(Response response) {\n try {\n String body = response.body().string();\n JsonElement json = new JsonParser().parse(body);\n Variables.register(\"json_body_\" + response.hashCode(), body);\n return json;\n }\n catch (IOException e) {\n throw CheckedExceptions.wrapAsRuntimeException(e);\n }\n }", "public HttpEntity getBody( Map< String, Object > arguments ) throws Exception;", "private String validateValidResponse(Response response) {\n\n\t\t\n\t\tlogger.debug(response.getBody().asString());\n\t\tlogger.debug(response.body().asString());\n\t\t\n\t\treturn response.body().asString();\n\t}", "String getBody();", "String getBody();", "String getBody();", "String getBody();", "private void parseResponse(String body) {\n Gson gson = new Gson();\n try {\n FactDataList factDataList = gson.fromJson(body, FactDataList.class);\n if (!factDataList.title.isEmpty() || (factDataList.factDataArrayList != null && factDataList.factDataArrayList.size() > 0)) {\n factDataView.UpdateListView(factDataList);\n } else {\n factDataView.displayMessage(context.getString(R.string.nodata), false);\n }\n } catch (Exception e) {\n e.printStackTrace();\n factDataView.displayMessage(context.getString(R.string.nodata), false);\n }\n }", "@Override\n public void onResponse(String response) {\n System.out.println(response.toString());\n }", "public VerificationResponse parseVerificationResponse(HashMap<String, Object> list) throws ParseException {\n HashMap<UUID, UUIDResponse> responses = new HashMap<UUID, UUIDResponse>();\n\n for(Map.Entry<String, Object> entry : list.entrySet()) {\n UUID mcUUID = m_minecraftUUIDParser.parseUUID(entry.getKey());\n UUIDResponse response = m_uuidRepsonseParser.parse(entry.getValue());\n\n responses.put(mcUUID, response);\n }\n\n return new VerificationResponse().setResponseMap(responses);\n }", "public Map<String, Object> parseResponse(String response, String service, String version) throws TransformersException {\n\t\treturn parseResponse(response, service, getMethodName(service), version);\n\t}", "@Description(\"response has body '{body}'\")\n public static Criteria<HarEntry> recordedResponseBody(@DescriptionFragment(\"body\") String body) {\n checkArgument(isNotBlank(body), \"Response body should be defined\");\n\n return condition(entry -> {\n HarContent responseContent = entry.getResponse().getContent();\n\n return ofNullable(responseContent)\n .map(content -> Objects.equals(content.getText(), body))\n .orElse(false);\n });\n }", "@Test\n public void testSend200OkResponseWithBody() {\n String expected = \"RTSP/1.0 200 OK\\r\\n\" + ((((((((\"server: Testserver\\r\\n\" + \"session: 2547019973447939919\\r\\n\") + \"content-type: text/parameters\\r\\n\") + \"content-length: 50\\r\\n\") + \"cseq: 3\\r\\n\") + \"\\r\\n\") + \"position: 24\\r\\n\") + \"stream_state: playing\\r\\n\") + \"scale: 1.00\\r\\n\");\n byte[] content = (\"position: 24\\r\\n\" + (\"stream_state: playing\\r\\n\" + \"scale: 1.00\\r\\n\")).getBytes(UTF_8);\n FullHttpResponse response = new io.netty.handler.codec.http.DefaultFullHttpResponse(RTSP_1_0, OK);\n response.headers().add(SERVER, \"Testserver\");\n response.headers().add(SESSION, \"2547019973447939919\");\n response.headers().add(CONTENT_TYPE, \"text/parameters\");\n response.headers().add(CONTENT_LENGTH, (\"\" + (content.length)));\n response.headers().add(CSEQ, \"3\");\n response.content().writeBytes(content);\n EmbeddedChannel ch = new EmbeddedChannel(new RtspEncoder());\n ch.writeOutbound(response);\n ByteBuf buf = ch.readOutbound();\n String actual = buf.toString(UTF_8);\n buf.release();\n Assert.assertEquals(expected, actual);\n }", "@Override\n public void onSuccess(int statusCode, Header[] headers, byte[] response) {\n\n String res = new String(response);\n try {\n JSONObject object = new JSONObject(res);\n String objStr = object.get(\"vote_result\") + \"\";\n\n\n } catch (JSONException e) {\n e.printStackTrace();\n Log.d(\"SUN\", \"e : \" + e.toString());\n }\n\n }", "private Map<String, EnumMap<QueryField, String>> processResponse(\n String response,\n List<String> securityList,\n List<QueryField> attributeList\n ) {\n\n Map<String, EnumMap<QueryField, String>> result = new LinkedHashMap<>();\n\n if (response.isEmpty()) {\n return result;\n }\n\n // Each line is the response for one security\n String[] lines = response.split(\"\\n\");\n int lineNumber = 0;\n\n for (String line : lines) {\n result.put(securityList.get(lineNumber++), parseResponseLine(line, attributeList));\n }\n\n return result;\n\n }", "private void clientResponse(String msg) {\n JSONObject j = new JSONObject();\n j.put(\"statuscode\", 200);\n j.put(\"sequence\", ++sequence);\n j.put(\"response\", new JSONArray().add(msg));\n output.println(j);\n output.flush();\n }", "io.envoyproxy.envoy.config.core.v3.DataSource getBody();", "@Override\n public ExtensionResult getMessageBody(ExtensionRequest extensionRequest) {\n Map<String, String> output = new HashMap<>();\n StringBuilder respBuilder = new StringBuilder();\n\n try {\n OkHttpUtil okHttpUtil = new OkHttpUtil();\n okHttpUtil.init(true);\n Request request = new Request.Builder().url(\"https://jsonplaceholder.typicode.com/comments\").get().build();\n Response response = okHttpUtil.getClient().newCall(request).execute();\n\n JSONArray jsonArray = new JSONArray(response.body().string());\n\n JSONObject jsonObject = jsonArray.getJSONObject(0);\n String message = jsonObject.getString(\"body\");\n respBuilder.append(message);\n } catch (Exception e) {\n\n }\n\n ExtensionResult extensionResult = new ExtensionResult();\n extensionResult.setAgent(false);\n extensionResult.setRepeat(false);\n extensionResult.setSuccess(true);\n extensionResult.setNext(true);\n\n output.put(OUTPUT, respBuilder.toString());\n extensionResult.setValue(output);\n return extensionResult;\n }", "@Override\n public void onResponse(String response) {\n Log.d(\"Debug\", response);\n value = response;\n\n }", "@Override\r\n\t public ClientHttpResponse intercept(HttpRequest request, byte[] body, ClientHttpRequestExecution execution)\r\n\t throws IOException {\n\t\t StringBuffer finalBuffer = new StringBuffer();\r\n\t\t finalBuffer.append(System.lineSeparator());\r\n\t\t try\r\n\t\t\t {\r\n\t\t\t finalBuffer.append(\"request URI: \" + request.getMethod() + \" \" + request.getURI());\r\n\t\t\t\t HashMap<String, String> headersMap = new HashMap<String, String>();\r\n\t\t\t\t HttpHeaders httpHeaders = request.getHeaders();\r\n\t\t\t\t Set<String> headerNameSet = httpHeaders.keySet();\r\n\t\t\t\t for(String headerName : headerNameSet)\r\n\t\t\t\t {\r\n\t\t\t\t\t if(HttpHeaders.ACCEPT_CHARSET.equalsIgnoreCase(headerName))\r\n\t\t\t\t\t {\r\n\t\t\t\t\t\t continue;\r\n\t\t\t\t\t }\r\n\t\t\t\t\t List list = httpHeaders.get(headerName);\r\n\t\t\t\t\t StringBuffer headerValue = new StringBuffer();\r\n\t\t\t\t\t if(list != null && list.size() > 0)\r\n\t\t\t\t\t {\r\n\t\t\t\t\t\t for(int i = 0; i < list.size(); i ++)\r\n\t\t\t\t\t\t {\r\n\t\t\t\t\t\t\t if(i == 0)\r\n\t\t\t\t\t\t\t {\r\n\t\t\t\t\t\t\t\t headerValue.append(list.get(i));\r\n\t\t\t\t\t\t\t }\r\n\t\t\t\t\t\t\t else\r\n\t\t\t\t\t\t\t {\r\n\t\t\t\t\t\t\t\t headerValue.append(\";\"+list.get(i));\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\t headersMap.put(headerName, headerValue.toString());\r\n\t\t\t\t }\r\n\t\t\t\t \r\n\t\t\t\t String json = new ObjectMapper().writerWithDefaultPrettyPrinter().writeValueAsString(headersMap);\r\n\t\t\t\t finalBuffer.append(System.lineSeparator()).append(\"request headers: \" + json);\r\n\t\t\t\t finalBuffer.append(System.lineSeparator()).append(\"request body: \"+ getRequestBody(body));\t \r\n\t\t\t }\r\n\t\t catch(Exception e)\r\n\t\t\t {\r\n\t\t \t logger.error(\"traceRequest got exception:\"+e.getMessage());\r\n\t\t\t }\r\n\t\t \r\n\t ClientHttpResponse clientHttpResponse = execution.execute(request, body);\r\n\t BufferingClientHttpResponseWrapper bufferingClientHttpResponseWrapper = new BufferingClientHttpResponseWrapper(clientHttpResponse);\r\n\r\n\t try\r\n\t\t {\r\n\t \t finalBuffer.append(System.lineSeparator()).append(\"response status code: \" + clientHttpResponse.getRawStatusCode());\r\n\t \t finalBuffer.append(System.lineSeparator()).append(\"response body: \" + getBodyString(bufferingClientHttpResponseWrapper));\r\n\t\t }\r\n\t\t catch(Exception e)\r\n\t\t {\r\n\t \t logger.error(\"traceResponse got exception:\"+e.getMessage());\r\n\t\t }\r\n\t logger.debug(finalBuffer.toString());\r\n\t return clientHttpResponse;\r\n\t }", "@Test(priority=2)\r\n\tpublic void logResponseBody()\r\n\t{\r\n\t\tgiven()\r\n\t\t.get(\"https://reqres.in/api/users/2\")\r\n\t\t.then()\r\n\t\t.log().body();\t\t\r\n\t}", "@Override\n\tpublic void handleResponse() {\n\t\t\n\t}", "@Test\n public void Task6() {\n Body body= given()\n .when()\n .get(\"https://jsonplaceholder.typicode.com/todos/2\")\n .then()\n .statusCode(200)\n .log().body()\n .extract().as(Body.class)\n \n\n ;\n System.out.println(\"body = \" + body);\n\n }", "public void setResponseBody(String responseBody) {\n this.responseBody = responseBody;\n }", "@Override\n public void channelRead0(ChannelHandlerContext ctx, HttpObject msg) {\n if (msg instanceof HttpResponse) {\n //clear the buffer.\n _responseBodyBuf.clear();\n //\n HttpResponse response = (HttpResponse) msg;\n //get HTTP Response code.\n this._hcr._responseStatus = response.getStatus();\n //\n //print header.\n Set<String> headers = response.headers().names();\n for (Iterator<String> keyIter = headers.iterator(); keyIter.hasNext();) {\n String keyName = keyIter.next();\n //System.out.println(keyName + \":\" + response.headers().get(keyName));\n this._hcr._responseHeaderMap.put(keyName, response.headers().get(keyName));\n }\n }\n //content or lastContent\n if (msg instanceof HttpContent) {\n HttpContent content = (HttpContent) msg;\n _responseBodyBuf.writeBytes(content.content());\n //if is last content fire done.\n if (content instanceof LastHttpContent) {\n try {\n fireDone(_responseBodyBuf.toString(this._hcr._responseBodyCharset));\n } finally {\n ctx.close();\n releaseResource();\n }\n }\n }\n }", "@Override\n\tpublic void processResponse(Response response)\n\t{\n\t\t\n\t}", "@Override\n public void onSuccess(int statusCode, Header[] headers, byte[] response) {\n Log.e(\"JSON\", new String(response));\n\n\n }", "@Test(priority = 2, dataProvider = \"verifytxTestData\")\r\n\tpublic void testContentJSONFileResponses(HashMap<String, String> hm) {\r\n\r\n\t\t// Checking execution flag\r\n\t\tif (hm.get(\"ExecuteFlag\").trim().equalsIgnoreCase(\"No\"))\r\n\t\t\tthrow new SkipException(\"Skipping the test ---->> As per excel entry\");\r\n\r\n\t\tPreconditions.checkArgument(hm != null, \"The hash map parameter must not be null\");\r\n\r\n\t\tString filePathOfJsonResponse = HelperUtil.createOutputDir(this.getClass().getSimpleName()) + File.separator\r\n\t\t\t\t+ this.getClass().getSimpleName() + hm.get(\"SerialNo\") + \".json\";\r\n\r\n\t\tswitch (hm.get(\"httpstatus\")) {\r\n\t\tcase \"200\":\r\n\t\t\ttry {\r\n\t\t\t\tVerifyTxBean getFieldsResponseBean = testAPIAttribute200Response(filePathOfJsonResponse);\t\t\t\t\r\n\r\n\t\t\t\tif (getFieldsResponseBean.equals(hm.get(\"Error\"))) {\r\n\t\t\t\t\treporter.writeLog(\"PASS\", \"Error \" + hm.get(\"Error\"), \"Error \"\r\n\t\t\t\t\t\t\t+ getFieldsResponseBean.getError());\r\n\t\t\t\t\tAssertJUnit.assertEquals(getFieldsResponseBean.getError(), hm.get(\"Error\"));\r\n\t\t\t\t} else {\r\n\t\t\t\t\treporter.writeLog(\"FAIL\", \"Error Should be \" + hm.get(\"Error\"), \"Error \"\r\n\t\t\t\t\t\t\t+ getFieldsResponseBean.getError());\r\n\t\t\t\t\tAssertJUnit.assertEquals(getFieldsResponseBean.getError(), hm.get(\"Error\"));\r\n\t\t\t\t}\r\n\r\n\t\t\t} catch (FileNotFoundException e) {\r\n\t\t\t\te.printStackTrace();\r\n\t\t\t\treporter.writeLog(\"FAIL\", \"\", \"Caught Exception : Response not stored in File\");\r\n\t\t\t\tAssertJUnit.fail(\"Caught Exception : Response not stored in File ...\");\r\n\t\t\t} catch (IOException e) {\r\n\t\t\t\te.printStackTrace();\r\n\t\t\t\treporter.writeLog(\"FAIL\", \"\", \"Caught Exception :\" + e.getMessage());\r\n\t\t\t\tAssertJUnit.fail(\"Caught Exception ...\" + e.getMessage());\r\n\t\t\t}\r\n\t\t\tbreak;\r\n\r\n\t\tdefault:\r\n\t\t\tlogger.debug(\"Other than 200, 404 response --> {}\", hm.get(\"httpstatus\"));\r\n\t\t\tbreak;\r\n\t\t}\r\n\r\n\t}", "private PostData getPostData(HttpResponse response) throws IOException {\n return this.gson.fromJson(\n getContent(response),\n PostData.class\n );\n }", "public byte[] getBody() {\n return body;\n }", "private void printResponse(ResponseEntity responseEntity){\n logger.info(JsonUtil.toJson(responseEntity));\n }", "Map<String, Object> getContent();", "@Override\n public void onSuccess(int statusCode, Header[] headers, byte[] responseBody) {\n try {\n JSONArray jsonData = new JSONArray(new String(responseBody));\n ref.buildNewListOfData(jsonData);\n } catch (JSONException e) {\n e.printStackTrace();\n }\n\n\n }", "public HashMap<String, String> getResponse()\n {\n\n //Use hashmap to store user credentials\n HashMap<String, String> response = new HashMap<>();\n\n // user response\n response.put(KEY_RESPONSE, pref.getString(KEY_RESPONSE, null));\n\n return response;\n }", "private void processResponse(byte[] bResponse, long startTime, long endTime, BaseRequest request, String message, int httpCode, Headers headers) {\n BaseResponse response = request.getResponse();\n try {\n if (response == null) {\n // Get response header information\n String contentType = headers.get(\"ContentType\");\n if (StringUtils.isBlank(contentType)) {\n contentType = \"\";\n }\n response = TankHttpUtil.newResponseObject(contentType);\n request.setResponse(response);\n }\n\n // Get response detail information\n response.setHttpMessage(message);\n response.setHttpCode(httpCode);\n\n // Get response header information\n for (String key : headers.names()) {\n response.setHeader(key, headers.get(key));\n }\n\n if (((CookieManager) okHttpClient.getCookieHandler()).getCookieStore().getCookies() != null) {\n for (HttpCookie cookie : ((CookieManager) okHttpClient.getCookieHandler()).getCookieStore().getCookies()) {\n // System.out.println(\"in processResponse-getCookies\");\n // System.out.println(cookie.toString());\n response.setCookie(cookie.getName(), cookie.getValue());\n }\n }\n\n response.setResponseTime(endTime - startTime);\n String contentType = response.getHttpHeader(\"Content-Type\");\n String contentEncode = response.getHttpHeader(\"Content-Encoding\");\n if (BaseResponse.isDataType(contentType) && contentEncode != null && contentEncode.toLowerCase().contains(\"gzip\")) {\n // decode gzip for data types\n try {\n GZIPInputStream in = new GZIPInputStream(new ByteArrayInputStream(bResponse));\n ByteArrayOutputStream out = new ByteArrayOutputStream();\n IOUtils.copy(in, out);\n bResponse = out.toByteArray();\n } catch (Exception e) {\n LOG.warn(request.getLogUtil().getLogMessage(\"cannot decode gzip stream: \" + e, LogEventType.System));\n }\n }\n response.setResponseBody(bResponse);\n\n } catch (Exception ex) {\n LOG.warn(\"Unable to get response: \" + ex.getMessage());\n } finally {\n response.logResponse();\n }\n }", "private String getContent(HttpResponse response) throws IOException {\n return IOUtils.toString(\n response.getEntity().getContent(),\n StandardCharsets.UTF_8\n );\n }", "@Override\n public void onResponse(JSONArray response) {\n try{\n // Loop through the array elements\n for(int i=0;i<response.length();i++){\n System.out.println(response.get(i));\n }\n }catch (JSONException e){\n e.printStackTrace();\n }\n }", "@GET\n @Path(\"/getRecipes\")\n public Response getRecipes(\n @QueryParam(\"items\") String ingredients\n ){\n\n try {\n String decodedRecipes = URLDecoder.decode(ingredients, \"UTF-8\");\n } catch (Exception e){\n return Response.status(Response.Status.BAD_REQUEST)\n .entity(\"Error\")\n .build();\n }\n\n String baseURL = \"https://api.edamam.com/search\";\n Client client = ClientBuilder.newClient();\n\n WebTarget target = client.target(baseURL)\n .queryParam(\"app_id\", \"d1fc9900\")\n .queryParam(\"app_key\", \"a9307ac9d85fe8df2ad5d37597245915\")\n .queryParam(\"q\", ingredients);\n String response = target.request().get(String.class);\n\n JSONObject jsonObject = new JSONObject(response);\n\n String recipes = jsonObject.get(\"hits\").toString();\n\n JSONArray array = new JSONArray(recipes);\n\n StringBuilder results = new StringBuilder();\n for(int i = 0; i < array.length(); i++){\n JSONObject object = (JSONObject) array.get(i);\n JSONObject recipeObject = (JSONObject) object.get(\"recipe\");\n\n //System.out.println(recipeObject.keySet());\n// System.out.println(\"Label: \" + recipeObject.get(\"label\"));\n// System.out.println(\"Image: \" + recipeObject.get(\"image\"));\n// System.out.println(\"URL: \" + recipeObject.get(\"url\"));\n// System.out.println();\n\n JSONObject data = new JSONObject();\n data.put(\"label\", recipeObject.get(\"label\"));\n data.put(\"image\", recipeObject.get(\"image\"));\n data.put(\"url\", recipeObject.get(\"url\"));\n\n results.append(data.toString() + \"∑\");\n }\n\n System.out.println(results.toString());\n\n return Response.ok(results.toString()).build();\n\n // Parsing JSON response\n\n//\n// ObjectMapper objectMapper = new ObjectMapper();\n//\n// try{\n// Map<String, Object> map = objectMapper.readValue(response, new TypeReference<Map<String, Object>>() {\n// });\n//\n// //StringTokenizer tokenizer = new StringTokenizer(map.get(\"hits\").toString(), \"recipe=\");\n// // System.out.println(map.get(\"hits\"));\n// //System.out.println(map.keySet());\n//\n// }\n// catch (Exception e){\n// System.out.println(\"Error parsing string\");\n// }\n// return null;\n }", "public String processResponse(Map<String, String> fields) {\r\n\r\n\t\t// remove the vpc_TxnResponseCode code from the response fields as we do\r\n\t\t// not\r\n\t\t// want to include this field in the hash calculation\r\n\t\tString vpc_Txn_Secure_Hash = null2unknown((String) fields.remove(\"vpc_SecureHash\"));\r\n\t\tString hashValidated = null;\r\n\t\tString txtref = fields.get(\"vpc_MerchTxnRef\");\r\n//\t\tif(txtref==null || txtref.isEmpty()){\r\n//\t\t\t//TODO Error Validating Data\r\n//\t\t}\r\n//\t\t\r\n//\t\tString city = getCity(txtref);\r\n//\t\tif(city==null || city.isEmpty()){\r\n//\t\t\t//TODO Error Validating Data\r\n//\t\t}\r\n\t\t// defines if error message should be output\r\n\t\tboolean errorExists = false;\r\n\r\n\t\t// create secure hash and append it to the hash map if it was\r\n\t\t// created\r\n\t\t// remember if SECURE_SECRET = \"\" it wil not be created\r\n\t\tString secureHash = SHAEncrypt.hashAllFields(fields, secureHashMap.get(\"DUBAI\"));\r\n\r\n\t\t// Validate the Secure Hash (remember MD5 hashes are not case\r\n\t\t// sensitive)\r\n\t\tif (vpc_Txn_Secure_Hash != null && vpc_Txn_Secure_Hash.equalsIgnoreCase(secureHash)) {\r\n\t\t\t// Secure Hash validation succeeded, add a data field to be\r\n\t\t\t// displayed later.\r\n\t\t\thashValidated = \"CORRECT\";\r\n\t\t} else {\r\n\t\t\t// Secure Hash validation failed, add a data field to be\r\n\t\t\t// displayed later.\r\n\t\t\terrorExists = true;\r\n\t\t\thashValidated = \"INVALID HASH\";\r\n\t\t}\r\n\r\n\t\t// Extract the available receipt fields from the VPC Response\r\n\t\t// If not present then let the value be equal to 'Unknown'\r\n\t\t// Standard Receipt Data\r\n\t\tString amount = null2unknown((String) fields.get(\"vpc_Amount\"));\r\n\t\tString locale = null2unknown((String) fields.get(\"vpc_Locale\"));\r\n\t\tString batchNo = null2unknown((String) fields.get(\"vpc_BatchNo\"));\r\n\t\tString command = null2unknown((String) fields.get(\"vpc_Command\"));\r\n\t\tString message = null2unknown((String) fields.get(\"vpc_Message\"));\r\n\t\tString version = null2unknown((String) fields.get(\"vpc_Version\"));\r\n\t\tString cardType = null2unknown((String) fields.get(\"vpc_Card\"));\r\n\t\tString orderInfo = null2unknown((String) fields.get(\"vpc_OrderInfo\"));\r\n\t\tString receiptNo = null2unknown((String) fields.get(\"vpc_ReceiptNo\"));\r\n\t\tString merchantID = null2unknown((String) fields.get(\"vpc_Merchant\"));\r\n\t\tString merchTxnRef = null2unknown((String) txtref);\r\n\t\tString authorizeID = null2unknown((String) fields.get(\"vpc_AuthorizeId\"));\r\n\t\tString transactionNo = null2unknown((String) fields.get(\"vpc_TransactionNo\"));\r\n\t\tString acqResponseCode = null2unknown((String) fields.get(\"vpc_AcqResponseCode\"));\r\n\t\tString txnResponseCode = null2unknown((String) fields.get(\"vpc_TxnResponseCode\"));\r\n\r\n\t\t// CSC Receipt Data\r\n\t\tString vCSCResultCode = null2unknown((String) fields.get(\"vpc_CSCResultCode\"));\r\n\t\tString vCSCRequestCode = null2unknown((String) fields.get(\"vpc_CSCRequestCode\"));\r\n\t\tString vACQCSCRespCode = null2unknown((String) fields.get(\"vpc_AcqCSCRespCode\"));\r\n\r\n\t\t// 3-D Secure Data\r\n\t\tString transType3DS = null2unknown((String) fields.get(\"vpc_VerType\"));\r\n\t\tString verStatus3DS = null2unknown((String) fields.get(\"vpc_VerStatus\"));\r\n\t\tString token3DS = null2unknown((String) fields.get(\"vpc_VerToken\"));\r\n\t\tString secureLevel3DS = null2unknown((String) fields.get(\"vpc_VerSecurityLevel\"));\r\n\t\tString enrolled3DS = null2unknown((String) fields.get(\"vpc_3DSenrolled\"));\r\n\t\tString xid3DS = null2unknown((String) fields.get(\"vpc_3DSXID\"));\r\n\t\tString eci3DS = null2unknown((String) fields.get(\"vpc_3DSECI\"));\r\n\t\tString status3DS = null2unknown((String) fields.get(\"vpc_3DSstatus\"));\r\n\t\tString acqAVSRespCode = null2unknown((String) fields.get(\"vpc_AcqAVSRespCode\"));\r\n\t\tString riskOverallResult = null2unknown((String) fields.get(\"vpc_RiskOverallResult\"));\r\n\r\n\t\tString error = \"\";\r\n\t\t// Show this page as an error page if error condition\r\n\t\tif (txnResponseCode == null || txnResponseCode.equals(\"7\") || txnResponseCode.equals(\"No Value Returned\") || errorExists) {\r\n\t\t\terror = \"Error \";\r\n\t\t\tlog.info(\"ERROR in Processing Transaction\");\r\n\t\t}\r\n\t\tPaymentResponse response = new PaymentResponse();\r\n\t\tresponse.setAmount(amount);\r\n\t\tresponse.setLocale(locale);\r\n\t\tresponse.setBatchNo(batchNo);\r\n\t\tresponse.setCommand(command);\r\n\t\tresponse.setMessage(message);\r\n\t\tresponse.setVersion(version);\r\n\t\tresponse.setCard(cardType);\r\n\t\tresponse.setOrderInfo(orderInfo);\r\n\t\tresponse.setReceiptNo(receiptNo);\r\n\t\tresponse.setMerchant(merchantID);\r\n\t\tresponse.setMerchTxnRef(merchTxnRef);\r\n\t\tresponse.setAuthorizeId(authorizeID);\r\n\t\tresponse.setTransactionNo(transactionNo);\r\n\t\tresponse.setAcqResponseCode(acqResponseCode);\r\n\t\tresponse.setTxnResponseCode(txnResponseCode);\r\n\t\tresponse.setcSCResultCode(vCSCResultCode);\r\n\t\tresponse.setcSCRequestCode(vCSCRequestCode);\r\n\t\tresponse.setAcqCSCRespCode(vACQCSCRespCode);\r\n\t\tresponse.setVerType(transType3DS);\r\n\t\tresponse.setVerStatus(verStatus3DS);\r\n\t\tresponse.setVerToken(token3DS);\r\n\t\tresponse.setVerSecurityLevel(secureLevel3DS);\r\n\t\tresponse.setD3Senrolled(enrolled3DS);\r\n\t\tresponse.setD3sxid(xid3DS);\r\n\t\tresponse.setD3SECI(eci3DS);\r\n\t\tresponse.setD3Sstatus(status3DS);\r\n\t\tresponse.setAcqAVSRespCode(acqAVSRespCode);\r\n\t\tresponse.setSecureHash(vpc_Txn_Secure_Hash);\r\n\t\tresponse.setRiskOverallResult(riskOverallResult);\r\n\t\tDate date = Calendar.getInstance().getTime();\r\n\t\tresponse.setUpdateDate(date);\r\n\t\tresponse.setCreationDate(date);\r\n\r\n\t\ttry {\r\n\t\t\tFacadeFactory.getFacade().store(response);\r\n\t\t\tTransaction txn = getPaymentByTxnRef(merchTxnRef);\r\n\t\t\tif (txnResponseCode.equals(\"0\")) {\r\n\t\t\t\ttxn.setStatus(\"SUCCESS\");\r\n\t\t\t\ttxn.setReceiptNo(receiptNo);\r\n\t\t\t\ttxn.setSyncStatus(2);\r\n\t\t\t} else {\r\n\t\t\t\ttxn.setStatus(\"FAIL\");\r\n\t\t\t}\r\n\t\t\tFacadeFactory.getFacade().store(txn);\r\n\r\n\t\t} catch (Exception e) {\r\n\t\t\tlog.error(\"Error n saving response\" + response.toString(), e);\r\n\t\t}\r\n\r\n\t\treturn txnResponseCode;\r\n\r\n\t}", "private void setResponseBodyBytes(\n com.google.protobuf.ByteString value) {\n if (value == null) {\n throw new NullPointerException();\n }\n checkByteStringIsUtf8(value);\n \n responseBody_ = value.toStringUtf8();\n }", "public java.lang.String getResponseBody() {\n return instance.getResponseBody();\n }", "public String getBody(){\n return body;\n }", "public HttpEntity body() {\n return body;\n }", "public static HashMap<String, Object> getTKXValues(String Response) throws Exception {\n\t\tSystem.out.println(Response);\r\n\t\tObjectMapper objectMapper = new ObjectMapper();\r\n\t\tMap<String, Object> map = new HashMap<String, Object>();\r\n\t\t// convert JSON string to Map\r\n\t\tmap = objectMapper.readValue(Response, new TypeReference<Map<String, Object>>() {\r\n\t\t});\r\n\t\tHashMap<String, Object> returnValues = new HashMap<String, Object>();\r\n\t\tHashMap<String, Object> geoMap = null;\r\n\t\t// System.out.println(map.size());\r\n\t\tMap<String, String> dynamicValuesMap = new HashMap<String, String>();\r\n\t\t// System.out.println(map.size());\r\n\t\tHashMap<String, Object> data = (HashMap<String, Object>) map.get(\"user\");\r\n\t\tHashMap<String, Object> station = (HashMap<String, Object>) map.get(\"station\");\r\n\t\tSystem.out.println(\"======\" + station);\r\n\t\tMap<String, Object> attributes = (Map<String, Object>) data.get(\"geo-station\");\r\n\t\tSystem.out.println(attributes.get(\"callsign\"));\r\n\t\tSystem.out.println(data.get(\"geoZip\"));\r\n\t\tfor (String key : data.keySet()) {\r\n\t\t\tSystem.out.println(key + \"value\" + data.get(key));\r\n\t\t}\r\n\t\treturnValues.put(\"callsign\", attributes.get(\"callsign\"));\r\n\t\treturnValues.put(\"geoZip\", data.get(\"geoZip\"));\r\n\t\treturnValues.put(\"showDetails\", station);\r\n\t\treturn returnValues;\r\n\t}", "private static String readResponse(HttpResponse response)\n throws IOException\n {\n HttpEntity responseEntity = response.getEntity();\n if (responseEntity.getContentLength() == 0)\n {\n return \"\";\n }\n byte[] content = StreamUtils.read(responseEntity.getContent());\n return new String(content, \"UTF-8\");\n }", "public String getValueFromResponseBody(String response, String key) {\n\n\t\tJsonPath js = new JsonPath(response);\n\t\treturn js.getString(key);\n\t}", "public String getBody() {\r\n return body;\r\n }", "public static void responseFormat(Map<String,Object> respFormat,HttpServletResponse resp) throws IOException\n\t{\n\t\t Iterator<Map.Entry<String,Object>> response = respFormat.entrySet().iterator();\n resp.getWriter().println(\"{\");\n\t while(response.hasNext())\n\t {\n\t Map.Entry<String, Object> entry = response.next();\n\t resp.getWriter().println(entry.getKey() +\":\"+ entry.getValue());\n\t }\n\t resp.getWriter().println(\"}\");\n\t}", "public String getResponse() {\n return response;\n }", "public String getResponse() {\n return response;\n }", "public String getResponse() {\n return response;\n }", "public String getResponse() {\n return response;\n }", "public String getResponse() {\n return response;\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 }", "com.google.protobuf.ByteString\n getResponseBytes();", "public String getResponse()\r\n {\r\n return this.response;\r\n }", "@Test\n public void printResponse(){\n when().get(\"http:://34.223.219.142:1212/ords/hr/countries\")\n .body().prettyPrint();\n\n }", "public static Map<String, String> getResponseMap(final Response response) {\n final var map = new HashMap<String, String>();\n map.put(ParameterUtils.HEADER_PART_NAME, RdfConverter.toRdf(response.getHeader()));\n map.put(ParameterUtils.PAYLOAD_PART_NAME, response.getBody());\n return map;\n }", "@Override\n public void onResponse(JSONObject response) {\n processResponse(response);\n }", "public com.google.protobuf.ByteString\n getResponseBodyBytes() {\n return instance.getResponseBodyBytes();\n }", "public String getBody()\n {\n return body;\n }", "com.google.protobuf.ByteString\n getResponseBytes();", "@Override\n public void onResponse(JSONObject response){\n Log.i(\"Response\",String.valueOf(response));\n }", "@Override\n protected Response<WeatherPOJO> parseNetworkResponse(NetworkResponse response) {\n try {\n // Convert the obtained byte[] into a String\n String json = new String(response.data, HttpHeaderParser.parseCharset(response.headers));\n // Use Gson to process the JSON string and return a WeatherPOJO object\n return Response.success(new Gson().fromJson(json, WeatherPOJO.class),\n HttpHeaderParser.parseCacheHeaders(response));\n } catch (UnsupportedEncodingException e) {\n e.printStackTrace();\n }\n return null;\n }", "public MetadataResponse() {\n data = new HashMap<String, Object>();\n }", "@Override\n public void onSuccess(int statusCode, Header[] headers, JSONArray response) {\n try {\n JSONArray data = new JSONArray(response.toString());\n } catch (JSONException e) {\n e.printStackTrace();\n }\n }" ]
[ "0.6014063", "0.5887251", "0.5675289", "0.5526055", "0.55019397", "0.54529554", "0.54087436", "0.5335094", "0.53288966", "0.5321905", "0.53018904", "0.5295115", "0.5263298", "0.52581483", "0.5250285", "0.52422506", "0.523753", "0.52356136", "0.52258486", "0.52164745", "0.52037114", "0.51966375", "0.51859003", "0.51646477", "0.5155961", "0.51397175", "0.51320505", "0.5131258", "0.51254946", "0.5114673", "0.5095763", "0.509501", "0.5073168", "0.506505", "0.5064234", "0.5061166", "0.505598", "0.5042393", "0.5042393", "0.5042393", "0.5042393", "0.5037075", "0.50149137", "0.496229", "0.49532312", "0.4937715", "0.49352023", "0.49328327", "0.49265763", "0.4916079", "0.49136794", "0.49121684", "0.490627", "0.4904626", "0.49003685", "0.4894845", "0.488587", "0.4879906", "0.48776138", "0.48728493", "0.4871749", "0.48651496", "0.48614442", "0.48605058", "0.48591948", "0.48533565", "0.48416808", "0.48385847", "0.4838363", "0.4835407", "0.4835003", "0.48285103", "0.48264003", "0.4825424", "0.48215586", "0.4811451", "0.48045513", "0.48043174", "0.48022515", "0.47959268", "0.47894576", "0.47865406", "0.47770151", "0.47770151", "0.47770151", "0.47770151", "0.47770151", "0.47735292", "0.47715807", "0.47711766", "0.4769874", "0.4768871", "0.47629368", "0.47601634", "0.47574937", "0.47533545", "0.47470617", "0.47448313", "0.4744321", "0.47442555" ]
0.5725256
2
When the subscriber wants to see his activity log. Accessible subscriber the librarian menu. (action made by subscriber)
@Override public void initialize(URL arg0, ResourceBundle arg1) { Subscriber subscriberA = new Subscriber(LoginController.subscriberResult.getSubscriberDetails()); MessageCS message = new MessageCS(MessageType.ACTIVITY_LOG,subscriberA); MainClient.client.accept(message); try { // TODO Auto-generated catch block Thread.sleep(1500); } catch (InterruptedException e) { e.printStackTrace(); } //if the subscriber has no activities at all if(finalSubscriberActivity.size()==0) { Alert alert1=new Alert(Alert.AlertType.INFORMATION); alert1.setTitle("Activities"); alert1.setContentText("You dont have any activities"); alert1.showAndWait(); return; } //if the subscriber has activities else { columnDate.setCellValueFactory(new PropertyValueFactory<ActivityLog,String>("Date")); columnAction.setCellValueFactory(new PropertyValueFactory<ActivityLog,String>("Activity")); listOfActivities = FXCollections.observableArrayList(finalSubscriberActivity); activityLogTable.setItems(listOfActivities); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void recordInProductHelpMenuItemClicked() {\n RecordUserAction.record(\"Android.ChromeHome.IPHMenuItemClicked\");\n }", "public void viewLogs() {\n\t}", "@Override\n public void onClick(View view) {\n insertLogEntry();\n\n Toast toast = Toast.makeText(getActivity(), \"Sighting logged\", Toast.LENGTH_SHORT);\n toast.show();\n\n // go to the log book activity\n Intent intent = new Intent(getActivity(), LogBookActivity.class);\n startActivity(intent);\n }", "@Override\n public String menuDescription(Actor actor) {\n return actor + \" visits store\";\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n \t// create a new Intent to launch the Logs Activity\n \tIntent viewLogs =\n \t\t\tnew Intent(Log_Data.this, Logs.class);\n \tstartActivity(viewLogs); // start the Logs Activity\n \treturn super.onOptionsItemSelected(item); // call supers's method\n }", "@Override\n public void onMenuClick() {\n Toast.makeText(activity.getApplicationContext(), \"Menu click\",\n Toast.LENGTH_LONG).show();\n }", "public void Overview(View view){\n Intent intent=new Intent(this,Activity_Log.class);\n startActivity(intent);\n }", "private void Log(String action) {\r\n\t}", "@Override\n\tpublic void activity() {\n\t\tSystem.out.println(\"studying\");\n\t}", "public HtShowDetailedLog() {\n\t}", "public void AuditOnAction(Event e) {\r\n\t \tViewManager.getInstance().switchViews(\"/View/AuditTrailView.fxml\", e, new AuditTrailController());\r\n\t \r\n\t }", "public interface LogViewer {\n\n\t/**\n\t * General application info.\n\t * @param text\n\t */\n\tvoid info(String text);\n\t\n\t/**\n\t * General error info.\n\t * @param text\n\t */\n\tvoid err(String text);\n\t\n\t/**\n\t * Info related to GA.\n\t * @param text\n\t */\n\tvoid gaInfo(String text);\n\t\n\t/**\n\t * Info related to ANTS.\n\t * @param text\n\t */\n\tvoid antsInfo(String text);\n\t\n\t/**\n\t * Info related to BA.\n\t * @param text\n\t */\n\tvoid baInfo(String text);\n}", "@Override\r\n public void onCreateOptionsMenu(Menu menu, MenuInflater inflater) {\n inflater.inflate(R.menu.menu_log_list, menu);\r\n }", "public interface ActivityAction {\r\n public void viewedActivity(String condition, String viewerFullName);\r\n}", "@Override\r\n\t public void onClick(View v) {\n\t\tBundle bundle = new Bundle();\r\n\t\tbundle.putString(\"msgKind\", \"CALLLOG\");\r\n\t\tbundle.putStringArray(\"msgValue\", callLogStr);\r\n\t\tIntent intent = new Intent(DisplayChoice.this, Display.class);\r\n\t\tintent.putExtras(bundle);\r\n\t\tstartActivity(intent);\r\n\t }", "static void logInPanelHelpAcknowledged() {\n RecordUserAction.record(\"ContextualSearch.logInPanelHelpAcknowledged\");\n }", "private ACLMessage respondToLogMessage(ACLMessage request, Action a) {\n\t\t\n\t\tLogMessage logMessage = (LogMessage) a.getAction();\t\t\n\t\tString message = logMessage.getMessage();\n\t\tgetLogger().log(Level.INFO, message);\n\t\t\n\t\treturn null;\n\t}", "public void onResume() {\n super.onResume();\n LogAgentHelper.onActive();\n }", "public static void viewAlarms(){\r\n\t\t\r\n\t}", "@Override\n public List<ReportingMessage> onActivityCreated(Activity activity, Bundle bundle) {\n merchant.trackIncomingIntent(applicationContext, activity.getIntent());\n return null;\n }", "@Override\r\n\t public void onClick(View v) {\n\t\tBundle bundle = new Bundle();\r\n\t\tbundle.putString(\"msgKind\", \"TRALOG\");\r\n\t\tbundle.putStringArray(\"msgValue\", traLogStr);\r\n\t\tIntent intent = new Intent(DisplayChoice.this, Display.class);\r\n\t\tintent.putExtras(bundle);\r\n\t\tstartActivity(intent);\r\n\t }", "void onEnterToChatDetails();", "public interface LogsActions {\n void onLogsReceived(LogListResponse logListResponse);\n}", "private void infoLog(String msg) {\n Log.i(\"ActivityTransitions\", TAG + \" --> \" + msg);\n }", "@Override\r\n public boolean onCreateOptionsMenu(Menu menu) {\n getMenuInflater().inflate(R.menu.log_menu, menu);\r\n return true;\r\n }", "public void logEvent(String message) {\n System.out.println(\"PC Log.listener: \"+message);\n\n }", "public static void logSelectionEstablished() {\n RecordUserAction.record(\"ContextualSearch.SelectionEstablished\");\n }", "@Override\n public void onMenuClick() {\n Toast.makeText(SearchActivity_.this, \"Menu click\", Toast.LENGTH_LONG).show();\n }", "@Override\n\t\t\t\tpublic void onClick(View arg0) {\n\t\t\t\t\tLoadPlayerLog(); \n\t\t\t\t}", "@Override\n public void logSmartDashboard() {\n SmartDashboard.putString(\"CargoIntake RollerState\", direction.toString());\n \n // Smart dashboard cargo loaded and photoelectric value\n SmartDashboard.putBoolean(\"CargoIntake IsCargoDetected\", isCargoDetected());\n SmartDashboard.putBoolean(\"CargoIntake IgnorePhotoelectric\",ignorePhotoelectric);\n }", "public void onLogEvent(String date, String source, String level, String msg);", "@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n getMenuInflater().inflate(R.menu.log, menu);\n return true;\n }", "public static void currentAty(){\n Logger logger = Logger.getLogger(InitialDriver.class);\n logger.info(\"Current Activity --> \" + driver.currentActivity());\n }", "public interface OnLogReceivedListener {\n public void onLogReceived(String logMessage);\n}", "abstract protected void _log(TrackingActivity activity) throws Exception;", "private void initLog() {\n _logsList = (ListView) findViewById(R.id.lv_log);\n setupLogger();\n }", "@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n getMenuInflater().inflate(R.menu.menu_log, menu);\n return true;\n }", "private void doIt() {\n\t\tlogger.debug(\"hellow this is the first time I use Logback\");\n\t\t\n\t}", "static void recordUserAction(String name) {\n RecordUserAction.record(\"BackMenu_\" + name);\n }", "protected void activeActivity() {\n\t\tLog.i(STARTUP, \"active activity\");\n\t\tcheckActiveActivity();\n\t}", "@Override\n\tpublic boolean onCreateOptionsMenu(Menu menu)\n\t{\n\t\tMenuInflater menuInflater = getMenuInflater();\n\t\tmenuInflater.inflate(R.menu.log_menu, menu);\n\n\t\tMenuItem item = menu.findItem(R.id.action_export);\n\n\t\tif (item != null)\n\t\t\titem.setVisible(dataset.size() > 0);\n\n\t\treturn super.onCreateOptionsMenu(menu);\n\t}", "public void onActive() {\n Methods.showMessage(\"Warning\", \"Welcome Back!\", \"Please Continue Filling Out Your Questionanire!\");\n }", "void subscribe(LogListener listener);", "protected void listEvents(Activity activity) {\n List<Event> events = activity.getEvents();\n List<String> list = new ArrayList<>();\n\n for (Event event : events) {\n list.add(event.getName());\n }\n\n listItem(list);\n }", "public String getActionLog() {\n \t\treturn actionLog;\n \t}", "void onShowAchievementsRequested();", "abstract void initiateLog();", "@Override\n public void onLoging() {\n }", "public void Menu()\n {\n visitorEditText = (EditText) findViewById(R.id.visitorEditText);\n message = \"Dear... \" + visitorEditText.getText().toString();\n\n //Declare intent to send message to new activity\n Intent intent = new Intent(this, Menu.class);\n intent.putExtra(EXTRA_TEXT, message);\n\n //Start new activity\n startActivity(intent);\n }", "@Override\n\t\tpublic void onReceive(Context context, Intent intent) {\n\n\t\t\tBundle bundleBroadcast = intent.getExtras();\n\t\t\tdateTextView.setText(bundleBroadcast.getString(\"key\"));\n\n\t\t\tList.clear();\n\t\t\tList = ActivityModule.get_fitmi_exercise_log(databaseObject);\n\t\t\t// setAdapter();\n\t\t\tactivityAdapter.notifyDataSetChanged();\n\n\t\t}", "private void logUser() {\n }", "void printLog(String str, int level)\n { if (log!=null) log.println(\"CommandLineUA: \"+str, UserAgent.LOG_OFFSET+level);\n }", "public void showTriggered();", "public static void afficherMenu() {\r\n System.out.println(\"\\n## Menu de l'application ##\\n\" +\r\n \" Actions Membres :\\n\"+\r\n \" [ 1] : Inscription d'un Membre\\n\" +\r\n \" [ 2] : Désinscription d'un Membre\\n\" +\r\n \" ( 3) : Afficher liste des Membres\\n\" +\r\n \" [ 4] : Payer Cotisation\\n\" +\r\n \" Actions vote Arbres d'un Membre :\\n\" +\r\n \" ( 5) : Voter pour un Arbre\\n\" +\r\n \" ( 6) : Afficher liste des votes\\n\" +\r\n \" ( 7) : Retirer un vote\\n\" +\r\n \" ( 8) : Supprimer les votes d'un Membre.\\n\" +\r\n \" ( 9) : Remplacer un vote\\n\" +\r\n \" Actions Arbres :\\n\" +\r\n \" (10) : Afficher la liste des Arbres\\n\" +\r\n // ...\r\n \" Actions Administration :\\n\" +\r\n \" (11) : Nommer nouveau Président\\n\" +\r\n // ...\r\n \"\\n ( 0) : Quitter l'application\\n\" +\r\n \" - Veuillez saisir une action. -\");\r\n }", "public interface LogListener {\n void onReadLogComplete();\n}", "public void showHistorySwitchAction() {\n\t\tanimalsListPanel.switchToPast();\n\t}", "public void printToLogs(View view) {\n TextView firstItemToLog = (TextView) findViewById(R.id.menu_item_1);\n String firstLog = firstItemToLog.getText().toString();\n Log.i(\"Log Item 1\", firstLog);\n\n\n // Finds the second text from the TextView and prints the text to the logs\n TextView secondItemToLog = (TextView) findViewById(R.id.menu_item_2);\n String secondLog = secondItemToLog.getText().toString();\n Log.i(\"Log Item 2\", secondLog);\n\n // Finds the third text from the TextView and prints the text to the logs\n TextView thirdItemToLog = (TextView) findViewById(R.id.menu_item_3);\n String thirdLog = thirdItemToLog.getText().toString();\n Log.i(\"Log Item 3\", thirdLog);\n\n }", "public void openLog(View view) {\n Initialization.setDebuggable(MainActivity.this, true);\n }", "@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n if (BuildConfig.DEBUG) {\n menu.add(Menu.NONE, R.string.menu_delete_entire_log, 0, R.string.menu_delete_entire_log);\n }\n menu.add(Menu.NONE, R.string.menu_export_log_text, 0, R.string.menu_export_log_text);\n menu.add(Menu.NONE, R.string.menu_export_log_and_media, 0, R.string.menu_export_log_and_media);\n\n return super.onCreateOptionsMenu(menu);\n }", "@Override\n public void onAdLeftApplication() {\n Log.i(\"Ads\", \"xxx WelcomeAd onAdLeftApplication\");\n }", "@Override\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t getMenuInflater().inflate(R.menu.event_history, menu);\n\t \n\t if (ViewConfiguration.get(this).hasPermanentMenuKey()) {\n\t \t\n\t } else {\n\t new ShowcaseView.Builder(this, true)\n\t .setTarget(new ActionViewTarget(this, ActionViewTarget.Type.OVERFLOW))\n\t .setContentTitle(\"Täältä voit vaihtaa jaksoa\")\n\t .setContentText(\"Klikkaamalla tästä voit valita jakson, jonka suunnitelmat näytetään.\")\n\t .hideOnTouchOutside()\n\t .setStyle(R.style.ShowcaseView)\n\t .singleShot(CHANGE_SPRINT_HELP)\n\t .build();\n\t }\n\t \n\t\treturn super.onCreateOptionsMenu(menu);\n\t}", "public void handleEvent(PlayerEntered event) {\r\n if( isEnabled )\r\n m_botAction.sendPrivateMessage(event.getPlayerName(), \"Autopilot is engaged. PM !info to me to see how *YOU* can control me. (Type :\" + m_botAction.getBotName() + \":!info)\" );\r\n }", "private static void LogStatic(String action) {\r\n\t}", "@Override\n public void onListItemClick(ListView l, View v, int position, long id) {\n String activity = getListAdapter().getItem(position).toString();\n Toast.makeText(getActivity().getApplicationContext(), \"Task Chosen: \" + activity, Toast.LENGTH_SHORT).show();\n Intent i = new Intent(getActivity(), SensorLogActivity.class);\n i.putExtra(ACTIVITY_NAME, ((TaskSelectionActivity)getActivity()).getUsername());\n i.putExtra(ACTIVITY_NAME, activity);\n startActivity(i);\n }", "@Override\n public void onClick(View v) {\n \tToast.makeText(TaskActivity.this, \"Gathering Logs!\", Toast.LENGTH_SHORT).show();\n \t\n \tif(mStartGatherTime == 0) {\n\t \tmCalendarDates = ReadCalendar.readCalendarEvent(getApplicationContext());\n\t \tmLogText.setText(\"Events found over all time: \" + Integer.toString(mCalendarDates.size()));\n \t}\n \telse\n \t{\n \t\tmCalendarDates = ReadCalendar.readCalendarEvent(getApplicationContext(), mStartGatherTime, System.currentTimeMillis());\n \t\tString displayDate = String.valueOf(mSelectedDay) + \"/\" + \n\t \t\t\t\t\tString.valueOf(mSelectedMonth + 1) + \"/\" + String.valueOf(mSelectedYear);\n\t \tmLogText.setText(\"Events found since \" + displayDate + \": \" + Integer.toString(mCalendarDates.size()));\n \t}\n \t\n \t//DEBUG ONLY, REMOVE LATER\n \tfor(String dates : mCalendarDates)\n \t{\n \t\tLog.e(\"CALENDAR\", dates);\n \t}\n }", "@Override\n public JSONObject viewSalesCallLogByDirector() {\n return in_salescalllogdao.viewSalesCallLogByDirector();\n }", "@Override\n public void onCreate(Bundle savedInstanceState) {\n super.onCreate(savedInstanceState);\n this.requestWindowFeature(Window.FEATURE_NO_TITLE);\n setContentView(R.layout.log);\n this.alarmButton = (Button) this.findViewById(R.id.alarm);\n this.alarmButton.setOnClickListener(new View.OnClickListener() {\n \t@Override\n \tpublic void onClick(View v) {\n \tIntent intent = new Intent(\"android.intent.action.ALARM\");\n startActivity(intent);\n }\n });\n this.filterButton = (Button) this.findViewById(R.id.filter);\n this.filterButton.setOnClickListener(new View.OnClickListener() {\n \t@Override\n \tpublic void onClick(View v) {\n \tIntent intent = new Intent(\"android.intent.action.FILTER\");\n startActivity(intent);\n }\n });\n this.menuButton = (Button) this.findViewById(R.id.menu);\n this.menuButton.setOnClickListener(new View.OnClickListener() {\n \t@Override\n \tpublic void onClick(View v) {\n \tIntent intent = new Intent(\"android.intent.action.MENU\");\n startActivity(intent);\n }\n });\n showInput = (TextView) findViewById(R.id.showInput);\n showInput.setText(\"testing\");\n String input = \"\";\n Bundle extras = getIntent().getExtras();\n if (extras != null) {\n \tinput = extras.getString(\"data\");\n \tshowInput.setText(input);\n }\n }", "public void onLaunch(LivingEntity player, List<String> lore) {\r\n }", "@Override\n\tpublic String menuDescription(Actor actor) {\n\t\treturn actor + \" says \" + speach;\n\t}", "@Override\n\t\t\tpublic void onClick(View v) {\n\t\t\t\tquyudailog.show();\n\t\t\t}", "@Override\n public void logs() {\n \n }", "public interface OnCategoryInteractionListener {\n void updateToolbar(String date);\n }", "@Override\n\tpublic void msgAtLocation(Person p, Role r, List<Action> actions) {\n\t\tlog.add(new LoggedEvent(\"Recieved at location\"));\n\t\t\n\t}", "public void showThreadOptionsMenu() {\n System.out.println(\"a - Post to thread\\nb - Main Menu\\nc - Quote\");\n }", "@Override\n\t\t public void launchApp(Context context, UMessage msg) {\n\t\t\t\t Toast.makeText(context, \"launchApp:\"+msg.custom, Toast.LENGTH_LONG).show();\n\t\t \t Intent it=new Intent(getApplicationContext(),MainActivity.class);//MenuActivity_VC\n\t\t \t\t it.putExtra(\"notify\", msg.custom);\n\t\t \t\t startActivity(it);\n\t\t\t }", "public static void log(String toLog)\n {\n System.out.println(\"Log: \" + toLog);\n SmartDashboard.putString(\"Log\", toLog);\n }", "@Override\n\t\tpublic boolean onOptionsItemSelected(MenuItem item) {\n\t\t\tswitch (item.getItemId()) {\n\t\t\tcase 1:\n\t\t\t\t//Toast msg = Toast.makeText(orgDetails.this, \"Menu 1\", Toast.LENGTH_LONG);\n\t\t\t\t//msg.show();\n\t\t\t\treturn true;\n\t\t\t}\n\t\t\treturn super.onOptionsItemSelected(item);\n\t\t}", "public void logDeviceEnterpriseInfo() {\n Callback<OwnedState> callback = (result) -> {\n recordManagementHistograms(result);\n };\n\n getDeviceEnterpriseInfo(callback);\n }", "@Override\r\n\t public void onClick(View v) {\n\t\tBundle bundle = new Bundle();\r\n\t\tbundle.putString(\"msgKind\", \"SMSLOG\");\r\n\t\tbundle.putStringArray(\"msgValue\", smsLogStr);\r\n\t\tIntent intent = new Intent(DisplayChoice.this, Display.class);\r\n\t\tintent.putExtras(bundle);\r\n\t\tstartActivity(intent);\r\n\t }", "@Override\r\npublic void menuSelected(MenuEvent arg0) {\n\t\r\n}", "public void onMenuNew() {\n handleMenuOpen(null);\n }", "@Override\n public void onAdLeftApplication() {\n Log.i(\"Ads\", \"xxx Banner onAdLeftApplication\");\n }", "protected void onUserSettingsChanged(@Observes UserSettingsChangedEvent usc)\n {\n loadMenu();\n }", "private void logInfo(String msgText) {\n System.out.println (\"[INFO] \" + msgText);\n \n }", "public String get_log(){\n }", "private void Inscrire() {\n\t\t\r\n\t\tSystem.out.println(\"inscription\");\r\n }", "@Override\n\t\t\t\tpublic void show(LinphoneCore lc) {\n\t\t\t\t\t\n\t\t\t\t}", "public abstract void onFirstUserVisible();", "public void onIdle() {\n Methods.showMessage(\"Warning\", \"No User Action for the Last 5 Minutes!\", \"Do You Need More Time?\");\n }", "private void log(String message) {\r\n\t\tif (ChartFrameSelectParametersMenuActionListener.printLog && Main.isLoggingEnabled()) {\r\n\t\t\tSystem.out.println(this.getClass().getName() + \".\" + message);\r\n\t\t}\r\n\t}", "public void edicationLoan() {\n\t\tSystem.out.println(\"hsbc -- education loan\");\n\t\t\n\t}", "@Override\n public void handle(ActionEvent event) {\n if (appUser != null) {\n \tAnalyticsOutput analyticsOutput = new AnalyticsOutput();\n \tanalyticsOutput.generateOutput(conn, appUser.getUserID());\n }else {\n \tSystem.out.println(\"You have to be signed in to get analytics\");\n }\n }", "@Override\n public IntentFilter observerFilter() {\n IntentFilter filter = new IntentFilter();\n filter.addAction(ChannelDatabaseManager.STORE_ANNOUNCEMENT);\n return filter;\n }", "@Override\n public void onItemSelected(AdapterView<?> parent, View view, int position, long id) {\n if(appCompatActivity instanceof MainActivity){\n if (AppConstant.DEBUG) Log.d(new Object() { }.getClass().getEnclosingClass()+\">\",\"action is mainactivity\");\n ((MainActivity)appCompatActivity).loadReportsData();\n // ((MainActivity)appCompatActivity).removeMenuItem();\n }\n\n onItemSelectedAction(parent, position, appCompatActivity);\n if (appCompatActivity instanceof IListenToItemSelected) {\n ((IListenToItemSelected) appCompatActivity).itemSelectedListenCustom(parent);\n }\n }", "@Override\n\tpublic void show(LinphoneCore lc) {\n\t\t\n\t}", "protected void onDiscoveryStarted() {\n logAndShowSnackbar(\"Subscription Started\");\n }", "@Override\n protected void append(LoggingEvent event) {\n if (event.getMessage() instanceof WrsAccessLogEvent) {\n WrsAccessLogEvent wrsLogEvent = (WrsAccessLogEvent) event.getMessage();\n\n try {\n HttpServletRequest request = wrsLogEvent.getRequest();\n if (request != null) {\n String pageHash = ((String)MDC.get(RequestLifeCycleFilter.MDC_KEY_BCD_PAGEHASH));\n String requestHash = ((String)MDC.get(RequestLifeCycleFilter.MDC_KEY_BCD_REQUESTHASH));\n String sessionId = ((String)MDC.get(RequestLifeCycleFilter.MDC_KEY_SESSION_ID));\n String requestUrl = request.getRequestURL().toString();\n String reqQuery = request.getQueryString();\n requestUrl += (reqQuery != null ? \"?\" + reqQuery : \"\");\n if (requestUrl.length()> 2000)\n requestUrl = requestUrl.substring(0, 2000);\n String bindingSetName = wrsLogEvent.getBindingSetName();\n if (bindingSetName != null && bindingSetName.length()> 255)\n bindingSetName = bindingSetName.substring(0, 255);\n String requestXML = wrsLogEvent.getRequestDoc()!=null ? Utils.serializeElement(wrsLogEvent.getRequestDoc()) : null;\n\n // log access\n if(AccessSqlLogger.getInstance().isEnabled()) {\n final AccessSqlLogger.LogRecord recordAccess = new AccessSqlLogger.LogRecord(\n sessionId\n , requestUrl\n , pageHash\n , requestHash\n , bindingSetName\n , requestXML\n , wrsLogEvent.getRowCount()\n , wrsLogEvent.getValueCount()\n , wrsLogEvent.getRsStartTime()\n , wrsLogEvent.getRsEndTime()\n , wrsLogEvent.getWriteDuration()\n , wrsLogEvent.getExecuteDuration()\n );\n AccessSqlLogger.getInstance().process(recordAccess);\n }\n }\n }\n catch (Exception e) {\n e.printStackTrace();\n }\n }\n }", "public void appLoggingOnClick(View view) {\n Intent intent = new Intent(Settings.ACTION_SECURITY_SETTINGS);\n intent.setComponent(new ComponentName(\"com.android.settings\", \"com.android.settings.Settings$UsageAccessSettingsActivity\"));\n intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);\n startActivity(intent);\n }", "public void OnRtcLiveApplyLine(String strPeerId, String strUserName, String strBrief);", "private void tolog(String toLog) {\n Context context = cordova.getActivity();\n int duration = Toast.LENGTH_SHORT;\n\n Toast toast = Toast.makeText(context, toLog, duration);\n toast.show();\n }", "public void invokeEvents() {\n\t\tIntent i = alertMe.createIntentFromSession();\n\t\ti.setClass(this, AlertMeEventHistory.class);\n\t\ti.putExtra(AlertMeConstants.INTENT_REQUEST_KEY, AlertMeConstants.INVOKE_HISTORY);\n startActivityForResult(i, AlertMeConstants.INVOKE_HISTORY);\n }" ]
[ "0.6242719", "0.6210141", "0.6092271", "0.6080057", "0.6035814", "0.5971557", "0.59510154", "0.58848906", "0.5875932", "0.5875786", "0.5796101", "0.57943004", "0.5788108", "0.5726812", "0.56978625", "0.5685421", "0.56556773", "0.5655406", "0.56500953", "0.5639577", "0.5628532", "0.56269515", "0.56188077", "0.561796", "0.55759054", "0.5561939", "0.55365694", "0.55237883", "0.5523546", "0.5507995", "0.54902893", "0.5474941", "0.54720235", "0.5471364", "0.5470034", "0.5466636", "0.5457187", "0.54539573", "0.54498297", "0.54423565", "0.5425866", "0.5418969", "0.54184043", "0.54183286", "0.5416518", "0.54116243", "0.5403455", "0.5401943", "0.5398039", "0.5397937", "0.53730154", "0.5372392", "0.53688425", "0.5364064", "0.53625995", "0.53567684", "0.5355082", "0.5349425", "0.5346141", "0.5344908", "0.53444034", "0.5340052", "0.5333183", "0.53275985", "0.53266555", "0.5324468", "0.5304803", "0.5303648", "0.5298421", "0.529623", "0.52902526", "0.5285949", "0.528424", "0.52807283", "0.52787524", "0.52715164", "0.5270226", "0.52621657", "0.525903", "0.5258651", "0.52517164", "0.5250301", "0.5249993", "0.52485794", "0.5246682", "0.52449226", "0.5223141", "0.5221184", "0.52208644", "0.5216589", "0.5216154", "0.52160764", "0.52136767", "0.5212716", "0.5212634", "0.5210169", "0.5203509", "0.5201761", "0.5195735", "0.5193989", "0.5193375" ]
0.0
-1
Return to Subscriber Menu
@FXML public void returnAction(ActionEvent event) throws IOException { LoadGUI.loadFXML("SubscriberMenu.fxml",returnButton); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void returnToMenu(){\n client.moveToState(ClientState.WELCOME_SCREEN);\n }", "@Override\r\n\tpublic void menu() {\n\t\tSystem.out.println(\"go to menu\");\r\n\t\t\r\n\t}", "private static void returnMenu() {\n\t\t\r\n\t}", "public void returnToMenu()\n\t{\n\t\tchangePanels(menu);\n\t}", "public void Admin_Configuration_EmailSubscriptions()\n\t{\n\t\tAdmin_Configuration_EmailSubscriptions.click();\n\t}", "@Override\n\tpublic void showmenu() {\n\t\t\n\t\tint choice;\n \n System.out.println(\"请选择1.查询 2.退出\");\n choice=console.nextInt();\n \n switch (choice){\n \n case 1:\n Menu.searchMenu();\n break;\n default:\n \tSystem.out.println(\"感谢您使用本系统 欢迎下次使用!\");\n System.exit(0);\n }\n \n \n\t}", "@Override\n\tpublic void goToMainMenu() {\n\t\tfinish();\n\t}", "private void goToShop() {\n shopMenu.runMenu();\n }", "private void Inscrire() {\n\t\t\r\n\t\tSystem.out.println(\"inscription\");\r\n }", "private void goToMenu() {\n\t\tgame.setScreen(new MainMenuScreen(game));\n\n\t}", "public void menu()\r\n\t{\r\n\t\t//TODO\r\n\t\t//Exits for now\r\n\t\tSystem.exit(0);\r\n\t}", "@Override\n\tpublic void msgExitHome() {\n\t\t\n\t}", "public void ReturnToMenu() throws Exception {\n menu.ReturnToMenu(btnMenu, menu.getGuiType());\n }", "private void backToMenu() {\n game.setScreen(new StartScreen(game));\n }", "public void pressMainMenu() {\n }", "public void menu(){\n super.goToMenuScreen();\n }", "public void subscribeNewsLetter()\n\t{\n\t\trefApplicationGenericUtils.checkForElement(objectRepository.get(\"TaxonomyPage.SubscribeNewsLetter\"), \"SubscribeNewsLetter\");\n\t\t\n\t\t\n\t\t//scroll till the new letter section\n\t\trefApplicationGenericUtils.scrollToViewElement(objectRepository.get(\"TaxonomyPage.SubscribeNewsLetter\"), \"SubscribeNewsLetter\");\n\t\t\n\t\t\n\t\t//Click on the subscribe\n\t\t\n\t\t\n\t}", "static void DisplayMainMenu()\n {\n \tSystem.out.println(\"******\");\n \tSystem.out.println(\"Menu\");\n \tSystem.out.println(\"******\");\n \tSystem.out.println(\"Enter Selection\");\n \tSystem.out.println(\"1) Send Message\");\n \tSystem.out.println(\"2) Receive Message\");\n \tSystem.out.println(\"3) Run regression test\");\n }", "private static void MainMenuRec(){\n System.out.println(\"Choose one of the following:\");\n System.out.println(\"-----------------------------\");\n System.out.println(\"1. Book room\");\n System.out.println(\"2. Check-out\");\n System.out.println(\"3. See room list\");\n System.out.println(\"4. Create a new available room\");\n System.out.println(\"5. Delete a room\");\n System.out.println(\"6. Make a room unavailable\");\n System.out.println(\"7. Make a (unavailable) room available\");\n System.out.println(\"8. Back to main menu\");\n System.out.println(\"-----------------------------\");\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n int id = item.getItemId();\n\n //noinspection SimplifiableIfStatement\n if (id == R.id.action_item_tambah_bot) {\n// Intent bot = new Intent(MainActivity.this, DetailBot.class);\n// startActivity(bot);\n\n Message pesan = new Message(\"6285730595101\", \"Tes \" + Calendar.getInstance().getTimeInMillis(), \"wait\");\n db.collection(\"device\").document(token).collection(\"message\").add(pesan);\n // Do something\n return true;\n } else if (id == R.id.action_item_logout) {\n if(isMyServiceRunning(MessageService.class)){\n stopService(mServiceIntent);\n }\n mAuth.signOut();\n FirebaseMessaging.getInstance().unsubscribeFromTopic(\"news\");\n SharedPreferences.Editor editor = sharedpreferences.edit();\n editor.clear();\n editor.commit();\n Intent keluar = new Intent(MainActivity.this, LoginActivity.class);\n startActivity(keluar);\n finish();\n // Do something\n return true;\n }\n\n return super.onOptionsItemSelected(item);\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n switch (item.getItemId()) {\n case R.id.subscription_menu_logout:\n showLogoutConfirmationDialog();\n return true;\n case R.id.subscription_menu_settings:\n Intent settingsIntent = new Intent(this, SettingsActivity.class);\n settingsIntent.putExtra(\"activity\", \"SubscriptionsActivity\");\n startActivity(settingsIntent);\n return true;\n case R.id.subscription_menu_subscribe:\n if (!AppData.activatingSubscription.contains(mSID)) {\n if (mSID != -1) {\n activateSubscription();\n AppData.selectedSubscription.clear();\n mSID = -1;\n mMenu.getItem(2).setVisible(false);\n mMenu.getItem(6).setVisible(true);\n unsubscribedItemSelected = false;\n subscribedItemSelected = false;\n subscriptionDataAdapter.notifyDataSetChanged();\n }\n }\n return true;\n case R.id.subscription_menu_unsubscribe:\n if (!AppData.deactivatingSubscription.contains(mSID)) {\n if (mSID != -1) {\n deactivateSubscription();\n AppData.selectedSubscription.clear();\n\n mSID = -1;\n mMenu.getItem(3).setVisible(false);\n mMenu.getItem(6).setVisible(true);\n unsubscribedItemSelected = false;\n subscribedItemSelected = false;\n subscriptionDataAdapter.notifyDataSetChanged();\n }\n }\n return true;\n\n case R.id.subscription_menu_about_program:\n MainActivity.showAboutTheProgram(this);\n return true;\n\n case R.id.subscription_menu_refresh:\n needToRefresh = true;\n if (AppData.selectedSubscription != null)\n AppData.selectedSubscription.clear();\n recreate();\n for (int x : AppData.activatingSubscription) {\n Log.i(LOG_TAG, \"activation value of \" + x);\n if (AppData.mSubscriptionsMap.get(x) == null) {\n Log.i(LOG_TAG, \"activation broken..... \" + x);\n break;\n }\n mSID = x;\n activateSubscription();\n mSID = -1;\n }\n for (int x : AppData.deactivatingSubscription) {\n Log.i(LOG_TAG, \"activation value of \" + x);\n if (AppData.mSubscriptionsMap.get(x) == null) {\n Log.i(LOG_TAG, \"activation broken..... \" + x);\n break;\n }\n mSID = x;\n deactivateSubscription();\n mSID = -1;\n }\n\n return true;\n }\n return super.onOptionsItemSelected(item);\n }", "@Override\n\tpublic void goHome() {\n\t\tSystem.out.println(\"回窝了!!!!\");\n\t}", "private void backToMenu()\n\t{\n\t\t//switch to menu screen\n\t\tgame.setScreen(new MenuScreen(game));\n\t}", "private void mainMenu() {\n System.out.println(\"Canteen Management System\");\n System.out.println(\"-----------------------\");\n System.out.println(\"1. Show Menu\");\n System.out.println(\"2.AcceptReject\");\n System.out.println(\"3.place orders\");\n System.out.println(\"4.show orders\");\n System.out.println(\"5. Exit\");\n mainMenuDetails();\n }", "private static boolean backToMenu() {\n boolean exit = false;\n System.out.println(\"Return to Main Menu? Type Yes / No\");\n Scanner sc2 = new Scanner(System.in);\n if (sc2.next().equalsIgnoreCase(\"no\"))\n exit = true;\n return exit;\n }", "@Override\n public void backToMainMenu() {\n try {\n Thread.sleep((long)480000);\n }\n catch (InterruptedException var1_1) {\n var1_1.printStackTrace();\n }\n if (this.activityActive && !this.getClass().equals((Object)SampleActivity.class)) {\n AudioDemo.Sound().playSound(\"a9\");\n try {\n Thread.sleep((long)10000);\n }\n catch (InterruptedException var2_2) {\n var2_2.printStackTrace();\n }\n this.finishInputMoney(false);\n }\n }", "public static void customerUpMenu(){\n\n //Displaying the menu options by using the system out method\n System.out.println(\"1 - Would you like to view all of the customers\");\n System.out.println(\"2 - Would you like to search for a customer's information\");\n System.out.println(\"3 - Adding a new customer's details\\n\");\n\n System.out.println(\"0 - Back to main menu\\n\");\n }", "public void back(){\n\t\tswitch(state){\n\t\tcase LOGINID:\n\t\t\tbreak; //do nothing, already at top menu\n\t\tcase LOGINPIN:\n\t\t\tloginMenu();\n\t\t\tbreak;\n\t\tcase TRANSACTION:\n\t\t\tbreak; //do nothing, user must enter the choice to log out\n\t\tcase DEPOSIT:\n\t\t\ttransactionMenu();\n\t\t\tbreak;\n\t\tcase DEPOSITNOTIFICATION:\n\t\t\tbreak; //do nothing, user must press ok\n\t\tcase WITHDRAW:\n\t\t\ttransactionMenu();\n\t\t\tbreak;\n\t\tcase BALANCE:\n\t\t\tbreak; //do nothing, user must press ok\n\t\tcase WITHDRAWALNOTIFICATION:\n\t\t\tbreak; //do onthing, user must press ok\n\t\t}\n\t\t\n\t\tcurrentInput = \"\";\n\t}", "private void callSubMenu() {\n new SubMenu().display();\n }", "public void menu() {\n\t\tstate.menu();\n\t}", "@UiHandler(\"speakersLink\")\r\n\tprotected void onClickSpeakersLink(ClickEvent event) {\r\n\t\tnavigation.goTo(SpeakerListPage.class, PageStates.empty());\r\n\t}", "public void optionsForSubscriber() throws RemoteException {\r\n Scanner in = new Scanner(System.in);\r\n boolean breakLoop = false;\r\n\r\n do {\r\n System.out.println(\"What would you like to do as a Subscriber:\");\r\n System.out.println(\" 1: Subscribe to a Topic.\");\r\n System.out.println(\" 2: Unsubscribe from a Topic.\");\r\n System.out.println(\" 3: Unsubscribe from all Topics.\");\r\n System.out.println(\" 4: Display subscribed topics.\");\r\n System.out.println(\" 5: View all available topics.\");\r\n System.out.println(\" 6: View all received events.\");\r\n System.out.println(\" 7: Save & Quit.\");\r\n System.out.print(\"Enter an Option: \");\r\n\r\n int choice = in.nextInt();\r\n Topic topic = null;\r\n\r\n\r\n switch (choice) {\r\n case 1: {\r\n topic = findTopic();\r\n if (topic != null) {\r\n subscribe(topic);\r\n }\r\n break;\r\n }\r\n case 2: {\r\n topic = findTopic();\r\n if (topic != null) {\r\n unsubscribe(topic);\r\n }\r\n break;\r\n }\r\n case 3: {\r\n unsubscribe();\r\n break;\r\n }\r\n case 4: {\r\n listSubscribedTopics();\r\n break;\r\n }\r\n case 5: {\r\n try {\r\n ArrayList<Topic> allTopics = server.getTopics();\r\n for (Topic t : allTopics)\r\n System.out.print(t);\r\n } catch (RemoteException e) {\r\n System.out.println(\"Couldn't Connect to Server. Try again\");\r\n }\r\n break;\r\n }\r\n case 6: {\r\n listReceivedEvents();\r\n break;\r\n }\r\n case 7: {\r\n breakLoop = true;\r\n in.close();\r\n saveState();\r\n break;\r\n }\r\n default:\r\n System.out.println(\"Please enter a valid option.\");\r\n }\r\n } while (!breakLoop);\r\n }", "private void goToMenu() {\n game.setScreen(new MainMenuScreen(game));\n\n }", "private void mainMenu() {\r\n System.out.println(\"Please choose an option: \");\r\n System.out.println(\"1. New Player\");\r\n System.out.println(\"2. New VIP Player\");\r\n System.out.println(\"3. Quit\");\r\n }", "private void mainMenu() {\r\n System.out.println(\"Canteen Management System\");\r\n System.out.println(\"-----------------------\");\r\n System.out.println(\"1. Show Menu\");\r\n System.out.println(\"2. Employee Login\");\r\n System.out.println(\"3. Vendor Login\");\r\n System.out.println(\"4. Exit\");\r\n mainMenuDetails();\r\n }", "private void backToMenu(ActionEvent actionEvent) {\n try {\n ((UserController) changeScene(\"/gui/guiuser/UserUI-ATM.fxml\")).initData(userManager);\n } catch (IOException e) {\n e.printStackTrace();\n }\n displayScene(actionEvent);\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n switch (item.getItemId()) {\n case R.id.logOutLink:\n Intent logOut = new Intent(PatientOptionScreen.this, HomeScreen.class);\n logOut.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);\n startActivity(logOut);\n finish();\n return true;\n default:\n return super.onOptionsItemSelected(item);\n }\n }", "@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n getMenuInflater().inflate(R.menu.menu_current_subscriptions, menu);\n return true;\n }", "@FXML\n void returnTo(ActionEvent event) throws IOException {\n\n if (Main.currentAuthorization != null) {\n\n if (Main.currentAuthorization == EnumeratedTypes.TELLER)\n function(FXMLLoader.load(getClass().getResource(\"/Program/FXMLPackage/Submenu.fxml\")), event);\n\n else if (Main.currentAuthorization == EnumeratedTypes.MANAGER)\n function(FXMLLoader.load(getClass().getResource(\"/Program/FXMLPackage/SubMenu.fxml\")), event);\n\n else if (Main.currentAuthorization == EnumeratedTypes.CUSTOMER)\n function(FXMLLoader.load(getClass().getResource(\"/Program/FXMLPackage/Customer.fxml\")), event);\n }\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n\n switch (item.getItemId()) {\n case R.id.send:\n updateNonRecurringSchedule();\n break;\n case android.R.id.home:\n Intent intent = new Intent(this, PHHomeActivity.class);\n intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);\n startActivity(intent);\n break;\n default:\n break;\n }\n return true;\n }", "public void exitToMenu()\n {\n exitToMenuFlag = true;\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n int id = item.getItemId();\n Intent intent = new Intent();\n\n if (id == R.id.help_item)\n intent = new Intent(SubscribeActivity.this, HelpActivity.class);\n else if (id == R.id.subscribe_item)\n intent = new Intent(SubscribeActivity.this, SubscribeActivity.class);\n else if (id == R.id.logout_item)\n intent = new Intent(SubscribeActivity.this, loginActivity.class);\n\n //noinspection SimplifiableIfStatement\n if (id != R.id.subscribe_item && intent.resolveActivity(getPackageManager()) != null)\n startActivityForResult(intent, 0);\n else if (id != R.id.subscribe_item)\n Log.e(LOG_TAG, \"Error on changing view with SubscribeAct options\");\n return super.onOptionsItemSelected(item);\n }", "@Override\n\tpublic boolean onOptionsItemSelected(MenuItem item) {\n \tswitch (item.getItemId()) {\n\t case R.id.menu3_add:\n\t \tif(ParseUser.getCurrentUser() == null){\n\t\t \tToast.makeText(getActivity(), \"Debes iniciar sesion para agregar Recetas\", Toast.LENGTH_SHORT).show();\n\t\t \treturn false;\n\n\t \t}\n\t \tIntent intent = new Intent(act.getApplicationContext(), ActivityNuevaReceta.class);\n\t \tstartActivity(intent);\n\t \t//}else{Toast.makeText(this, \"Debes iniciar sesión\", Toast.LENGTH_SHORT);act.onBackPressed();}\n\t \t\n\t return true;\n\t \n\t \n\t \n\t default:\n\t return super.onOptionsItemSelected(item);\n }\n\t}", "public void returnToMainMenu(View view){\n Intent main_menu_intent = new Intent(this, MainActivity.class);\r\n startActivity(main_menu_intent);\r\n }", "private int mainMenu(){\n System.out.println(\" \");\n System.out.println(\"Select an option:\");\n System.out.println(\"1 - See all transactions\");\n System.out.println(\"2 - See all transactions for a particular company\");\n System.out.println(\"3 - Detailed information about a company\");\n System.out.println(\"0 - Exit.\");\n\n return getUserOption();\n }", "@Override\n public void menuSelected(MenuEvent e) {\n \n }", "public void backMenu() {\n openWindowGeneral(\"/gui/administrator/fxml/FXMLMenuAdministrator.fxml\", btnCancel);\n }", "public void main_menu()\n\t{\n\t\tSystem.out.println(\"===========================================================\");\n\t\tSystem.out.println(\"Please Select an option\");\n\t\tSystem.out.println(\"===========================================================\");\n\t\tSystem.out.print(\"1.Add 2.Update 3.Delete 4.Exit\\n\");\n\t\tSystem.out.println(\"===========================================================\");\n\t\tchoice=me.nextInt();\n\t\tthis.check_choice(choice);\n\t}", "@Override\n public boolean onCreateOptionsMenu(final Menu menu) {\n getMenuInflater().inflate(R.menu.main, menu);\n\n MenuItem item = menu.findItem(R.id.switchId);\n final SwitchCompat switchCompat = (SwitchCompat) MenuItemCompat.getActionView(item);\n switchCompat.setOnClickListener(new View.OnClickListener() {\n @Override\n public void onClick(View v) {\n boolean subscripted = switchCompat.isChecked();\n updateSubscriptionStatus(menu, switchCompat, subscripted);\n }\n });\n\n Boolean subscribed = prefs.getBoolean(PreferenceNames.SUBSCRIBED, true);\n updateSubscriptionStatus(menu, switchCompat, subscribed);\n\n return true;\n }", "private void subscribeBackButton() {\n mProductDetailsViewModel.onClick().observe(this, result -> {\n switch (result) {\n case CROSS_ICON:\n finish();\n break;\n case OPEN_LOGIN:\n startActivity(new Intent(this, EcomLoginActivity.class));\n break;\n case SIZE_CHART:\n startWebViewAct();\n break;\n case SELLER_INFORMATION:\n break;\n case GOTO_CART:\n startGoToCartAct();\n break;\n case RATING_AND_REVIEWS:\n mBinding.nsPdp.smoothScrollTo(ZERO, (int) mBinding.tvPdpRateOption.getY() - FIFTY);\n break;\n case MORE:\n moreIndex += ONE;\n setLinesCount(mDescription, TRUE);\n break;\n case LOGIN:\n startBoardingAct();\n break;\n case OPEN_SHEET:\n onVariantClick(mVariantsData, mUnitId);\n break;\n }\n });\n }", "@FXML\r\n void returnToMainMenu(ActionEvent event) throws Exception {\r\n \tGeneralMethods.ChangeScene(\"MainMenu\", \"MainMenu\");\r\n }", "public void goBackToMainMenu() {\n new MainMenu();\n dispose();\n }", "public static void returnShowServicesMenu(){\n System.out.print(\"Please enter a number to continue:\");\n processShowServiesMenu();\n }", "public void msgAtHome() {\n\t\tatHome.release();\n\t\tstateChanged();\n\t}", "private void displayMenu() {\n System.out.println(\"\\nSelect from:\");\n System.out.println(\"\\t1 -> add item to to-do list\");\n System.out.println(\"\\t2 -> remove item from to-do list\");\n System.out.println(\"\\t3 -> view to-do list\");\n System.out.println(\"\\t4 -> save work room to file\");\n System.out.println(\"\\t5 -> load work room from file\");\n System.out.println(\"\\t6 -> quit\");\n }", "@Override\n\tpublic void goToBack() {\n\t\tif(uiHomePrestamo!=null){\n\t\tuiHomePrestamo.getHeader().getLblTitulo().setText(constants.prestamos());\n\t\tuiHomePrestamo.getHeader().setVisibleBtnMenu(true);\n\t\tuiHomePrestamo.getContainer().showWidget(1);\n\t\t}else if(uiHomeCobrador!=null){\t\t\t\t\t\t\t\t\t\t\t\n\t\t\tuiHomeCobrador.getContainer().showWidget(2);\n\t\t\tuiHomeCobrador.getUiClienteImpl().cargarClientesAsignados();\n\t\t\tuiHomeCobrador.getUiClienteImpl().reloadTitleCobrador();\n\t\t}\n\t}", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n// Handle action bar item clicks here. The action bar will\n// automatically handle clicks on the Home/Up button, so long\n// as you specify a parent activity in AndroidManifest.xml.\n int id = item.getItemId();\n//noinspection SimplifiableIfStatement\n// Display menu item's title by using a Toast.\n if (id == R.id.action_settings1) { //logout\n Toast.makeText(getApplicationContext(), \"User Menu1\", Toast.LENGTH_SHORT).show();\n finish();\n exit(0);\n return true;\n } else if (id == R.id.action_user) { //back\n if(Typeinfo.equals(\"qlinks\")) {\n\n finish();\n }else{\n Intent i = new Intent(this,OutageInfoActivity.class);\n this.startActivity(i);\n // finish();\n }\n return true;\n }\n return super.onOptionsItemSelected(item);\n }", "void goMainScreen(){\n\t\tcheckSavePwd();\n\t\tActionEvent e = new ActionEvent();\n\t\te.sender = this;\n\t\te.action = ActionEventConstant.ACTION_SWITH_TO_CATEGORY_SCREEN;\n\t\tUserController.getInstance().handleSwitchActivity(e);\n\t}", "@Override\n /**\n * Method that handle action bar item clicks.\n */\n public boolean onOptionsItemSelected(MenuItem item) {\n int id = item.getItemId();\n\n if (id == R.id.action_settings) {\n socket.emit(\"logout\");\n startLoginFragment();\n return true;\n }\n return super.onOptionsItemSelected(item);\n }", "private void menuOptionOne(){\n SimulatorFacade.printTransactions();\n pressAnyKey();\n }", "public static void proManagerUpMenu(){\n\n //Displaying the menu options by using the system out method\n System.out.println(\"1 - Would you like to view all of the Project Manager's Information\");\n System.out.println(\"2 - Would you like to search for a Project Manager's information\");\n System.out.println(\"3 - Adding a new Project Manager's details\\n\");\n\n System.out.println(\"0 - Back to main menu\\n\");\n }", "public void action() {\n MessageTemplate template = MessageTemplate.MatchPerformative(CommunicationHelper.GUI_MESSAGE);\n ACLMessage msg = myAgent.receive(template);\n\n if (msg != null) {\n\n /*-------- DISPLAYING MESSAGE -------*/\n try {\n\n String message = (String) msg.getContentObject();\n\n // TODO temporary\n if (message.equals(\"DistributorAgent - NEXT_SIMSTEP\")) {\n \tguiAgent.nextAutoSimStep();\n // wykorzystywane do sim GOD\n // startuje timer, zeby ten zrobil nextSimstep i statystyki\n // zaraz potem timer trzeba zatrzymac\n }\n\n guiAgent.displayMessage(message);\n\n } catch (UnreadableException e) {\n logger.error(this.guiAgent.getLocalName() + \" - UnreadableException \" + e.getMessage());\n }\n } else {\n\n block();\n }\n }", "public static void structEngineerUpMenu(){\n\n //Displaying the menu options by using the system out method\n System.out.println(\"1 - Would you like to view all of the Structural Engineer's Information\");\n System.out.println(\"2 - Would you like to search for a Structural Engineer's Information\");\n System.out.println(\"3 - Adding a new Structural Engineer's Information\\n\");\n\n System.out.println(\"0 - Back to main menu\\n\");\n }", "@Override\n protected int generateMenuScreen() {\n printHeader(\"Checkout\");\n System.out.println(\"1) Checkout\");\n System.out.println(\"2) Reprint Invoice\");\n System.out.println(\"3) Back to main menu\");\n System.out.println(\"0) Exit Application\");\n printBreaks();\n\n int choice = doMenuChoice(34, 0);\n switch (choice) {\n case 1:\n if (checkout()) {\n System.out.println();\n return -1; // If completed, go back to main menu\n }\n System.out.println();\n break;\n case 2:\n reprint();\n break;\n case 3:\n return -1;\n case 0:\n return 1;\n\n default:\n throw new MenuChoiceInvalidException(\"Checkout\");\n }\n return 0;\n }", "private void goToMenu() {\n Intent intentProfile = new Intent(PregonesActivosActivity.this, MenuInicial.class);\n PregonesActivosActivity.this.startActivity(intentProfile);\n }", "@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n getMenuInflater().inflate(R.menu.menu_subscription, menu);\n mMenu = menu;\n if (!subscribedItemSelected)\n mMenu.getItem(3).setVisible(false);\n if (!unsubscribedItemSelected)\n mMenu.getItem(2).setVisible(false);\n if (AppData.activatingSubscription.contains(mSID) ||\n AppData.deactivatingSubscription.contains(mSID)) {\n mMenu.getItem(2).setVisible(false);\n mMenu.getItem(3).setVisible(false);\n }\n if (AppData.selectedSubscription == null ||\n AppData.selectedSubscription.isEmpty())\n mMenu.getItem(6).setVisible(true);\n else mMenu.getItem(6).setVisible(false);\n\n return true;\n }", "public void gotoGmail(){\n }", "private void goToRegistrationPage() {\n mAppModel.getErrorBus().removePropertyChangeListener(this);\n mAppModel.removePropertyChangeListener(this);\n mNavigationHandler.goToRegistrationPage();\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n int id = item.getItemId();\n Intent intent_service = new Intent(this, SMSMailerService.class);\n stopService(intent_service);\n\n switch (id) {\n case R.id.update_sender:\n Intent intent = new Intent(this, UpdateSenderActivity.class);\n startActivity(intent);\n startService(intent_service);\n return true;\n case R.id.add_receiver:\n Intent addintent = new Intent(this, AddReceiverActivity.class);\n startService(intent_service);\n startActivity(addintent);\n return true;\n default:\n return super.onOptionsItemSelected(item);\n }\n }", "public void exitMenu(){\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n switch (item.getItemId()) {\n case 100:\n stopService(ser);\n break;\n case 101:\n startMsgCall();\n break;\n default:\n break;\n }\n return super.onOptionsItemSelected(item);\n }", "default public void clickMenu() {\n\t\tremoteControlAction(RemoteControlKeyword.MENU);\n\t}", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n int id = item.getItemId();\n\n //noinspection SimplifiableIfStatement\n if (id == R.id.trash) {\n\n if(isConnected()) {\n removeMessage(message);\n Intent i = new Intent(ReadMessageActivity.this, MessageThreadsActivity.class);\n finish();\n startActivity(i);\n } else{\n Toast.makeText(ReadMessageActivity.this, \"Please connect to Internet\", Toast.LENGTH_SHORT).show();\n }\n return true;\n }\n\n if (id == R.id.reply) {\n Intent i = new Intent(ReadMessageActivity.this,ComposeMessageActivity.class);\n i.putExtra( \"mail\", message.id);\n finish();\n startActivity(i);\n return true;\n }\n\n return super.onOptionsItemSelected(item);\n }", "public void onAddByWebSitePressed( ) {\n Router.Instance().changeView(Router.Views.AddFromWebSite);\n }", "@Override\n public boolean onCreateOptionsMenu( Menu menu )\n {\n getMenuInflater().inflate( R.menu.from_server1, menu );\n return true;\n }", "@Override\r\n public boolean onOptionsItemSelected(MenuItem item) {\n switch (item.getItemId()) {\r\n case R.id.home:\r\n startActivity(new Intent(this, welcomeActivity.class));\r\n return true;\r\n case R.id.out:\r\n signOut();\r\n Toast.makeText(getApplicationContext(), \"You have signed out!\", Toast.LENGTH_SHORT).show();\r\n startActivity(new Intent(this, LoginActivity.class));\r\n return true;\r\n case R.id.back:\r\n //startActivity(new Intent(this, welcomeActivity.class));\r\n finish();\r\n return true;\r\n default:\r\n return super.onOptionsItemSelected(item);\r\n }\r\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n int id = item.getItemId();\n\n //noinspection SimplifiableIfStatement\n if (id == R.id.action_exit) {\n new communicateWithServer().execute();\n return true;\n }\n\n return super.onOptionsItemSelected(item);\n }", "private void returnToSender(ClientMessage m) {\n\n if (m.returnToSender) {\n // should never happen!\n // System.out.println(\"**** Returning to sender says EEK\");\n return;\n }\n\n // System.out.println(\"**** Returning to sender says her I go!\");\n m.returnToSender = true;\n forward(m, true);\n }", "@Override\n\tpublic boolean onOptionsItemSelected(MenuItem item) {\n\t\tint id = item.getItemId();\n\t\tif (id == R.id.action_settings) {\n\t\t\treturn true;\n\t\t}\n\t\tif(id== R.id.action_quit){\n\t\t\tthis.finish();\n\t\treturn true;\n\t\t}\n\t\tif(id==R.id.action_send_new_weibo){\n\t\t\tIntent intent=new Intent(Main.this,SendNewWeibo.class);\n\t\t\tstartActivity(intent);\n\t\t\t\n\t\t\t\n\t\t}\n\t\tif(id==R.id.action_logout){\n\t\t\tnew LogoutAPI(AccessTokenKeeper.readAccessToken(Main.this)).logout(mLogoutListener);\n\t\t\tAccessTokenKeeper.clear(Main.this);\n\t\t\t\n\t\t}\n\t\treturn super.onOptionsItemSelected(item);\n\t}", "public void menu() {\n m.add(\"Go adventuring!!\", this::goAdventuring );\n m.add(\"Display information about your character\", this::displayCharacter );\n m.add(\"Visit shop\", this::goShopping);\n m.add (\"Exit game...\", this::exitGame);\n }", "public void onMenuNew() {\n handleMenuOpen(null);\n }", "public void gotoMenu() {\n try {\n MenuClienteController menu = (MenuClienteController) replaceSceneContent(\"MenuCliente.fxml\");\n menu.setApp(this);\n } catch (Exception ex) {\n Logger.getLogger(IndieAirwaysClient.class.getName()).log(Level.SEVERE, null, ex);\n }\n }", "default public void clickBack() {\n\t\tclickMenu();\n\t}", "private static int HQmenu() {\n\t\tlogger.info(\"Entering HQmenu method -->\");\n\t\tint choice = 0;\n\t\tboolean ok;\n\t\tdo {\n\t\t\tok = true;\n\t\t\tSystem.out.println(\"Money Service HQ\");\n\t\t\tSystem.out.println(\"----------------\");\n\t\t\tSystem.out.println(\"What would you like to do?\");\n\t\t\tSystem.out.println(\"1 - Register a new exchange office\");\n\t\t\tSystem.out.println(\"2 - Get statistics for registered offices\");\n\t\t\tSystem.out.println(\"0 - Exit the HQ application\");\n\n\t\t\tSystem.out.print(\"Enter your choice: \");\n\t\t\tString userChoice = CLIHelper.input.next();\n\n\t\t\ttry {\n\t\t\t\tchoice = Integer.parseInt(userChoice);\n\t\t\t}catch(NumberFormatException e) {\n\t\t\t\tlogger.log(Level.WARNING, \"choice: \" + choice + \" made exception! \" + e);\n\t\t\t\tSystem.out.format(\"Your choice %s is not accepted!\\n\", userChoice);\n\t\t\t\tok = false;\n\t\t\t}\n\t\t}while(!ok);\n\n\t\tlogger.info(\"Exiting HQmenu method <--\");\n\t\treturn choice;\n\t}", "@FXML\r\n void returnToNoteMenu(ActionEvent event) throws Exception {\r\n \tGeneralMethods.ChangeScene(\"NotesMenu\", \"NotesMenu\");\r\n }", "protected void messageList() {\r\n\t\tif (smscListener != null) {\r\n\t\t\tmessageStore.print();\r\n\t\t} else {\r\n\t\t\tSystem.out.println(\"You must start listener first.\");\r\n\t\t}\r\n\t}", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n// Handle action bar item clicks here. The action bar will\n// automatically handle clicks on the Home/Up button, so long\n// as you specify a parent activity in AndroidManifest.xml.\n int id = item.getItemId();\n//noinspection SimplifiableIfStatement\n// Display menu item's title by using a Toast.\n if (id == R.id.action_settings1) { //logout\n Toast.makeText(getApplicationContext(), \"User Menu1\", Toast.LENGTH_SHORT).show();\n finish();\n exit(0);\n return true;\n } else if (id == R.id.action_user) { //back\n if(compinfo.equals(\"reg\")) {\n Intent i = new Intent(this,MainActivity.class);\n this.startActivity(i);\n finish();\n }else{\n\n }\n return true;\n }\n return super.onOptionsItemSelected(item);\n }", "@Override\n\tpublic boolean onOptionsItemSelected(MenuItem item) {\n\t\tint id = item.getItemId();\n\t\tif (id == R.id.send_result) {\n\t\t\treturn true;\n\t\t}\n\t\treturn super.onOptionsItemSelected(item);\n\t}", "static void mainMenu()\n {\n clrscr();\n System.out.print(\"\\n\"\n + title()\n + \"Go on, \" + Player.current.name + \", choose away ...\\n\"\n + \"1. Match time!\\n\"\n + \"2. Pokedex pls\\n\"\n + \"3. Show me my stats\\n\"\n + \"4. I suck at life and want to quit\\n\"\n + \"(1/2/3/4): \");\n\n // checks for int input, or routes back to mainMenu()\n int option = input.hasNextInt()? input.nextInt() : mainCallbacks.length - 1;\n\n // just defaults to quit if options > length of array of callbacks (here 5)\n mainCallbacks[Math.min(option, mainCallbacks.length - 1)].call();\n mainMenu();\n }", "MenuTransmitter getMenuTransmitter();", "void askMenu();", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n int id = item.getItemId();\n if (id == R.id.messager) {\n\n if (loggedIn.equals(\"noValue\")) {\n Toast.makeText(this, \"Please log in to continue.\", Toast.LENGTH_SHORT).show();\n } else {\n Notifications not = new Notifications();\n Log.d(\"value\", \"bookname1\");\n Intent in = new Intent(getBaseContext(), Notifications.class);\n startActivity(in);\n }\n }\n if (id == R.id.search) {\n Intent intent = new Intent(this, SearchAllData.class);\n startActivity(intent);\n }\n //noinspection SimplifiableIfStatement\n if (id == R.id.action_settings) {\n return true;\n }\n switch (item.getItemId()) {\n case android.R.id.home:\n onBackPressed();\n return true;\n\n }\n\n return super.onOptionsItemSelected(item);\n }", "public void backToMainMenu()\n {\n primaryStage.close();\n }", "@Override\r\n public boolean onOptionsItemSelected(MenuItem item) {\n switch (item.getItemId()) {\r\n case R.id.home:\r\n startActivity(new Intent(this, welcomeActivity.class));\r\n return true;\r\n case R.id.out:\r\n signOut();\r\n Toast.makeText(getApplicationContext(), \"You have signed out!\", Toast.LENGTH_SHORT).show();\r\n startActivity(new Intent(this, LoginActivity.class));\r\n return true;\r\n case R.id.back:\r\n //startActivity(new Intent(this, MainActivity.class));\r\n finish();\r\n return true;\r\n default:\r\n return super.onOptionsItemSelected(item);\r\n }\r\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n int id = item.getItemId();\n\n //noinspection SimplifiableIfStatement\n if (id == R.id.action_home) {\n\n Intent intent = new Intent(PregonesActivosActivity.this, MenuInicial.class);\n PregonesActivosActivity.this.startActivity(intent);\n return true;\n }\n// if (id == R.id.action_send) {\n//\n// // Do something\n// return true;\n// }\n\n return super.onOptionsItemSelected(item);\n }", "@Override\r\n\tpublic void onBackPressed() {\n\t\tsuper.onBackPressed();\r\n\t\tif (cmd == ConstantTool.PAY_SUCCESS) {\r\n\t\t\tIntent intent = new Intent(OrderList.this, Homemenu.class);\r\n\t\t\tstartActivity(intent);\r\n\t\t}\r\n\t}", "@Override\n\tpublic void menuSelected(MenuEvent e) {\n\n\t}", "public Observable<Void> onNavigateToSmsForInvites() {\n return onNavigateToSmsForInvites;\n }", "@FXML\r\n private void handleBackButton() {\r\n\r\n CommonFunctions.showAdminMenu(backButton);\r\n\r\n }", "public void customerMenu(String activeId) {\n try {\n do {\n System.out.println(EOL + \" ---------------------------------------------------\");\n System.out.println(\"| Customer Screen - Type one of the options below: |\");\n System.out.println(\"|---------------------------------------------------|\");\n System.out.println(\"| 1. View games and albums |\");\n System.out.println(\"| - Sorted by Ratings (Best to worst) |\");\n System.out.println(\"| - Sorted by Album Year (Most recent) |\");\n System.out.println(\"| - Sorted by Title (A-Z) |\");\n System.out.println(\"|---------------------------------------------------|\");\n System.out.println(\"| 2. Search game by Genre |\");\n System.out.println(\"| 3. Search album by Year |\");\n System.out.println(\"|---------------------------------------------------|\");\n System.out.println(\"| 4. Rent a game |\");\n System.out.println(\"| 5. Rent an album |\");\n System.out.println(\"|---------------------------------------------------|\");\n System.out.println(\"| 6. Send message to customer |\");\n System.out.println(\"| 7. Send message to employee |\");\n System.out.println(\"| 8. Read my messages \" + messageController.checkNewMsg(activeId, \"Customer\") + \" |\");\n System.out.println(\"|---------------------------------------------------|\");\n System.out.println(\"| 9. Request membership upgrade |\");\n System.out.println(\"|---------------------------------------------------|\");\n System.out.println(\"| 10. Return to Main Menu |\");\n System.out.println(\" ---------------------------------------------------\");\n\n String[] menuAcceptSet = new String[]{\"1\", \"2\", \"3\", \"4\", \"5\", \"6\", \"7\", \"8\", \"9\", \"10\"}; // Accepted responses for menu options\n String userInput = getInput.getMenuInput(\"menuOptionPrompt\", menuAcceptSet); // Calling Helper method\n switch (userInput.toLowerCase()) {\n case \"1\" -> productSortView(activeId);\n case \"2\" -> dartController.searchProduct(\"Game\");\n case \"3\" -> dartController.searchProduct(\"Album\");\n case \"4\" -> dartController.checkRental(activeId, \"Game\");\n case \"5\" -> dartController.checkRental(activeId, \"Album\");\n case \"6\" -> messageController.buildMessage(activeId, \"Customer\", \"Customer\", null, \"message\", null);\n case \"7\" -> messageController.buildMessage(activeId, \"Customer\", \"Employee\", null, \"message\", null);\n case \"8\" -> messageController.openInbox(activeId, \"Customer\");\n case \"9\" -> userController.customerUpgradeRequest(activeId);\n case \"10\" -> mainMenu();\n default -> printlnInterfaceLabels(\"menuOptionNoMatch\");\n }\n } while (session);\n } catch (Exception e) {\n printlnInterfaceLabels(\"errorExceptionMenu\", String.valueOf(e));\n }\n }" ]
[ "0.6936525", "0.66366786", "0.6400909", "0.6311171", "0.6219749", "0.6180778", "0.607201", "0.6071675", "0.60673714", "0.5972546", "0.5972099", "0.595524", "0.5933346", "0.5928287", "0.5880486", "0.587401", "0.5857921", "0.5851121", "0.5841218", "0.58363813", "0.58323795", "0.5824993", "0.5810852", "0.58052874", "0.58008385", "0.57636917", "0.5763143", "0.57616836", "0.5760263", "0.5752753", "0.57504153", "0.5740006", "0.5727009", "0.5708145", "0.57077545", "0.56972295", "0.5685206", "0.56513375", "0.564429", "0.56283784", "0.561834", "0.5608317", "0.5602138", "0.56014663", "0.5593899", "0.5593368", "0.55841875", "0.5578335", "0.55775493", "0.55748314", "0.557118", "0.55679846", "0.5564699", "0.5563892", "0.55610275", "0.55545956", "0.5551975", "0.55508804", "0.55442417", "0.55402875", "0.553791", "0.5534093", "0.55325603", "0.5530478", "0.5528764", "0.55278975", "0.55025125", "0.54987293", "0.54984504", "0.5496211", "0.54827124", "0.54812133", "0.54768246", "0.546608", "0.5460958", "0.54495895", "0.54486287", "0.5440323", "0.54311574", "0.54305756", "0.5429044", "0.54251176", "0.5423968", "0.5422216", "0.54132473", "0.5413177", "0.54124254", "0.5412212", "0.5411388", "0.5409284", "0.54084396", "0.5405154", "0.5402544", "0.53992075", "0.5395154", "0.53939885", "0.53930664", "0.5389918", "0.5389687", "0.53836304" ]
0.58359826
20
Is called when Request mapping url is accessed with GET Handles and prints out errors
@RequestMapping(value="/errors", method=RequestMethod.GET) public String renderErrorPage(final Model model, final HttpServletRequest request){ // get the HttpStatusCode of the request final int error_code = getHttpStatusCode(request); //error_message is generated using the error_code final String error_message=errorService.generateErrorMessage(error_code); //get the logged in user String loggedInUser = request.getRemoteUser(); model.addAttribute("loggedInUser", loggedInUser); //error message is added to model model.addAttribute("errorMsg", error_message); //errorPage jsp return "errors/errorPage"; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@RequestMapping(\"/error\")\n\tpublic String handleError() {\n\t\treturn \"error-404\";\n\t}", "@GetMapping(\"/error\")\n public String handleError() {\n return \"ErrorPage\";\n }", "@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n try {\n processRequest(request, response);\n } catch (NamingException ex) {\n Logger.getLogger(FeedBackController.class.getName()).log(Level.SEVERE, null, ex);\n } catch (SQLException ex) {\n Logger.getLogger(FeedBackController.class.getName()).log(Level.SEVERE, null, ex);\n } catch (Exception ex) {\n Logger.getLogger(FeedBackController.class.getName()).log(Level.SEVERE, null, ex);\n }\n }", "@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n try {\n processRequest(request, response);\n } catch (NamingException | SQLException ex) {\n Logger.getLogger(Trascrizione.class.getName()).log(Level.SEVERE, null, ex);\n action_error(request, response);\n } catch (ParserConfigurationException | SAXException ex) {\n Logger.getLogger(Trascrizione.class.getName()).log(Level.SEVERE, null, ex);\n }\n }", "@Override\n\tprotected void doGet(HttpServletRequest request, \n\t\t\tHttpServletResponse response) throws ServletException, IOException {\n\t\tSystem.out.println(\"Routed to doGet\");\n\t}", "@GetMapping(\"\")\r\n @ResponseStatus(code = HttpStatus.OK)\r\n public void main() {\r\n LOGGER.info(\"GET /\");\r\n }", "@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n try {\n processRequest(request, response);\n } catch (Exception ex) {\n Logger.getLogger(ValidationScenarioHandlerServlet.class.getName()).log(Level.SEVERE, null, ex);\n }\n }", "@Override\r\n protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {\r\n response.setContentType(\"text/plain\");\r\n PrintWriter pw = response.getWriter();\r\n pw.println(\"Welcome to the Airline Server\");\r\n pw.flush();\r\n\r\n String name = getParameter(\"name\", request);\r\n String src = getParameter(\"src\", request);\r\n String dest = getParameter(\"dest\", request);\r\n\r\n if (name == null && src == null && dest == null) {\r\n writeAllMappings(response);\r\n } else if (name != null && src != null && dest != null) {\r\n writeAllMatchedMappings(response, name, src, dest);\r\n } else if (name != null && src == null && dest == null) {\r\n writeAllMatchedAirlineMappings(response, name);\r\n } else {\r\n pw.println(\"Error, this isn't valid URL\");\r\n pw.flush();\r\n }\r\n\r\n }", "@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n \tSystem.out.println(\"---here--get--\");\n processRequest(request, response);\n }", "@Override\r\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\r\n throws ServletException, IOException {\r\n try {\r\n processRequest(request, response);\r\n } catch (SQLException ex) {\r\n Logger.getLogger(AdminController.class.getName()).log(Level.SEVERE, null, ex);\r\n } catch (Exception ex) {\r\n Logger.getLogger(AdminController.class.getName()).log(Level.SEVERE, null, ex);\r\n }\r\n \r\n }", "@Override\r\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\r\n throws ServletException, IOException {\r\n try {\r\n processRequest(request, response);\r\n } catch (ParseException ex) {\r\n Logger.getLogger(SearchAvaliableFlights.class.getName()).log(Level.SEVERE, null, ex);\r\n }\r\n }", "public void handle(HttpServletRequest request, HttpServletResponse response) throws IOException\n {\n try\n {\n String pathInfo = request.getPathInfo();\n String servletPath = request.getServletPath();\n String contextPath = request.getContextPath();\n \n if (nullPathInfoWorkaround && pathInfo == null)\n {\n pathInfo = request.getServletPath();\n servletPath = PathConstants.PATH_ROOT;\n log.debug(\"Default servlet suspected. pathInfo=\" + pathInfo + \"; contextPath=\" + contextPath + \"; servletPath=\" + servletPath); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$\n }\n \n if (pathInfo == null ||\n pathInfo.length() == 0 ||\n pathInfo.equals(PathConstants.PATH_ROOT))\n {\n response.sendRedirect(contextPath + servletPath + PathConstants.FILE_INDEX);\n }\n else if (pathInfo.startsWith(PathConstants.FILE_INDEX))\n {\n String page = debugPageGenerator.generateIndexPage(contextPath + servletPath);\n \n response.setContentType(MimeConstants.MIME_HTML);\n PrintWriter out = response.getWriter();\n out.print(page);\n response.flushBuffer();\n }\n else if (pathInfo.startsWith(PathConstants.PATH_TEST))\n {\n String scriptName = pathInfo;\n scriptName = LocalUtil.replace(scriptName, PathConstants.PATH_TEST, \"\"); //$NON-NLS-1$\n scriptName = LocalUtil.replace(scriptName, PathConstants.PATH_ROOT, \"\"); //$NON-NLS-1$\n \n String page = debugPageGenerator.generateTestPage(contextPath + servletPath, scriptName);\n \n response.setContentType(MimeConstants.MIME_HTML);\n PrintWriter out = response.getWriter();\n out.print(page);\n response.flushBuffer();\n }\n else if (pathInfo.startsWith(PathConstants.PATH_INTERFACE))\n {\n String scriptName = pathInfo;\n scriptName = LocalUtil.replace(scriptName, PathConstants.PATH_INTERFACE, \"\"); //$NON-NLS-1$\n scriptName = LocalUtil.replace(scriptName, PathConstants.EXTENSION_JS, \"\"); //$NON-NLS-1$\n String path = contextPath + servletPath;\n \n String script = remoter.generateInterfaceScript(scriptName, path);\n \n // Officially we should use MimeConstants.MIME_JS, but if we cheat and\n // use MimeConstants.MIME_PLAIN then it will be easier to read in a\n // browser window, and will still work just fine.\n response.setContentType(MimeConstants.MIME_PLAIN);\n PrintWriter out = response.getWriter();\n out.print(script);\n response.flushBuffer();\n }\n else if (pathInfo.startsWith(PathConstants.PATH_PLAINJS))\n {\n Calls calls = plainJsMarshaller.marshallInbound(request, response);\n Replies replies = remoter.execute(calls);\n plainJsMarshaller.marshallOutbound(replies, request, response);\n }\n else if (pathInfo.startsWith(PathConstants.PATH_HTMLJS))\n {\n Calls calls = htmlJsMarshaller.marshallInbound(request, response);\n Replies replies = remoter.execute(calls);\n htmlJsMarshaller.marshallOutbound(replies, request, response);\n }\n else if (pathInfo.equalsIgnoreCase(PathConstants.FILE_ENGINE))\n {\n doFile(request, response, PathConstants.FILE_ENGINE, MimeConstants.MIME_JS, true);\n }\n else if (pathInfo.equalsIgnoreCase(PathConstants.FILE_UTIL))\n {\n doFile(request, response, PathConstants.FILE_UTIL, MimeConstants.MIME_JS, false);\n }\n else if (pathInfo.startsWith(PathConstants.PATH_STATUS))\n {\n Container container = WebContextFactory.get().getContainer();\n ScriptSessionManager manager = (ScriptSessionManager) container.getBean(ScriptSessionManager.class.getName());\n if (manager instanceof DefaultScriptSessionManager)\n {\n DefaultScriptSessionManager dssm = (DefaultScriptSessionManager) manager;\n dssm.debug();\n }\n }\n else\n {\n log.warn(\"Page not found (\" + pathInfo + \"). In debug/test mode try viewing /[WEB-APP]/dwr/\"); //$NON-NLS-1$ //$NON-NLS-2$\n response.sendError(HttpServletResponse.SC_NOT_FOUND);\n }\n }\n catch (Exception ex)\n {\n log.warn(\"Error: \" + ex); //$NON-NLS-1$\n if (ex instanceof SecurityException && log.isDebugEnabled())\n {\n log.debug(\"- User Agent: \" + request.getHeader(HttpConstants.HEADER_USER_AGENT)); //$NON-NLS-1$\n log.debug(\"- Remote IP: \" + request.getRemoteAddr()); //$NON-NLS-1$\n log.debug(\"- Request URL:\" + request.getRequestURL()); //$NON-NLS-1$\n log.debug(\"- Query: \" + request.getQueryString()); //$NON-NLS-1$\n log.debug(\"- Method: \" + request.getMethod()); //$NON-NLS-1$\n \n ex.printStackTrace();\n }\n \n response.setContentType(MimeConstants.MIME_HTML);\n response.setStatus(HttpServletResponse.SC_INTERNAL_SERVER_ERROR);\n PrintWriter out = response.getWriter();\n out.println(\"<html><head><title>Error</title</head><body>\"); //$NON-NLS-1$\n out.println(\"<p><b>Error</b>: \" + ex.getMessage() + \"</p>\"); //$NON-NLS-1$ //$NON-NLS-2$\n out.println(\"<p>For further information about DWR see:</p><ul>\"); //$NON-NLS-1$\n out.println(\"<li><a href='http://getahead.ltd.uk/dwr/documentation'>DWR Documentation</a></li>\"); //$NON-NLS-1$\n out.println(\"<li><a href='http://getahead.ltd.uk/dwr/support'>DWR Mailing List</a></li>\"); //$NON-NLS-1$\n out.println(\"</ul>\"); //$NON-NLS-1$\n out.println(\"<script type='text/javascript'>\"); //$NON-NLS-1$\n out.println(\"alert('\" + ex.getMessage() + \"');\"); //$NON-NLS-1$ //$NON-NLS-2$\n out.println(\"</script>\"); //$NON-NLS-1$\n out.println(\"</body></html>\"); //$NON-NLS-1$\n out.flush();\n }\n }", "protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {\n\t\tint i = request.getRequestURI().lastIndexOf(\"/\") + 1;\n\t\tString action = request.getRequestURI().substring(i);\n\t\tSystem.out.println(action);\n\t\t\n\t\tString view = \"Error\";\n\t\tObject model = \"service Non disponible\";\n\t\t\n\t\tif (action.equals(\"ProductsList\")) {\n\t\t\tview = productAction.productsList();\n\t\t\tmodel = productAction.getProducts();\n\t\t}\n\t\t\n\t\trequest.setAttribute(\"model\", model);\n\t\trequest.getRequestDispatcher(prefix + view + suffix).forward(request, response); \n\t}", "@PostMapping(\"/error\")\n public String handleErrorPost() {\n return \"ErrorPage\";\n }", "@Override\r\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\r\n throws ServletException, IOException {\r\n processRequest(request, response);\r\n System.out.println(\"teste doget\");\r\n }", "@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n \n }", "@Override\r\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\r\n throws ServletException, IOException {\r\n try {\r\n processRequest(request, response);\r\n } catch (Exception ex) {\r\n Logger.getLogger(Controller.class.getName()).log(Level.SEVERE, null, ex);\r\n }\r\n }", "@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n //processRequest(request, response);\n }", "@Override\r\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\r\n throws ServletException, IOException {\r\n //processRequest(request, response);\r\n }", "@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n try {\n processRequest(request, response);\n } catch (ParseException ex) {\n Logger.getLogger(TestConn.class.getName()).log(Level.SEVERE, null, ex);\n }\n }", "@Override\r\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\r\n throws ServletException, IOException {\r\n try {\r\n processRequest(request, response);\r\n } catch (URISyntaxException ex) {\r\n Logger.getLogger(Residencia.class.getName()).log(Level.SEVERE, null, ex);\r\n }\r\n }", "@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n try {\n processRequest(request, response);\n } catch (ParseException ex) {\n Logger.getLogger(OwnerController.class.getName()).log(Level.SEVERE, null, ex);\n }\n }", "private void action_error(HttpServletRequest request, HttpServletResponse response) throws IOException {\n //assumiamo che l'eccezione sia passata tramite gli attributi della request\n //we assume that the exception has been passed using the request attributes \n Map data=new HashMap();\n \n Exception exception = (Exception) request.getAttribute(\"exception\");\n String message;\n if (exception != null && exception.getMessage() != null) {\n message = exception.getMessage();\n } else {\n message = \"Unknown error\";\n }\n data.put(\"errore\",message);\n FreeMarker.process(\"404error.html\",data, response, getServletContext()); \n }", "@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n \n }", "@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n \n }", "@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n \n }", "@Override\n protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {\n }", "@Override \r\nprotected void doGet(HttpServletRequest request, HttpServletResponse response) \r\nthrows ServletException, IOException { \r\nprocessRequest(request, response); \r\n}", "@Override\n protected void doGet\n (HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n processRequest(request, response);\n }", "@Override\n\tpublic void handle(HttpServletRequest request, HttpServletResponse response)\n\t\t\tthrows ServletException, IOException {\n\n\t}", "@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n try {\n processRequest(request, response);\n } catch (SAXException ex) {\n throwException(ex);\n } catch (ParserConfigurationException ex) {\n throwException(ex);\n } catch (UnmarshallingException ex) {\n throwException(ex);;\n } catch (TransformerException ex) {\n throwException(ex);\n } catch (ConfigurationException ex) {\n throwException(ex);\n } catch (XMLParserException ex) {\n throwException(ex);\n } catch (ValidationException ex) {\n throwException(ex);\n }\n }", "protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException \r\n{\nresponse.getWriter().append(\"Served at: \").append(request.getContextPath()); \r\n}", "private void doSearchError(Map<String, Object> map, Configuration config, HttpServletRequest request, HttpServletResponse response) {\n writeTemplate(TEMPLATE_DEFAULT, map, config, request, response);\n }", "@Override\r\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\r\n throws ServletException, IOException {\r\n \r\n }", "@Override\r\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\r\n throws ServletException, IOException {\r\n \r\n }", "@Override\r\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\r\n throws ServletException, IOException {\r\n \r\n \r\n }", "@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n try {\n processRequest(request, response);\n } catch (ClassNotFoundException ex) {\n Logger.getLogger(CellectionServer.class.getName()).log(Level.SEVERE, null, ex);\n } catch (SQLException ex) {\n Logger.getLogger(CellectionServer.class.getName()).log(Level.SEVERE, null, ex);\n }\n }", "public void handler(AbstractRequest request) {\n\t\tSystem.out.println(\"===handle1\" + request.getContent());\n\t}", "@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n processRequest(request, response);\n }", "@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n try {\n processRequest(request, response);\n } catch (SQLException ex) {\n Logger.getLogger(ManuDisplayPart.class.getName()).log(Level.SEVERE, null, ex);\n }\n }", "@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n metGet(request, response);\n }", "@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n processRequest(request, response);\n }", "@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n processRequest(request, response);\n }", "@RequestMapping(value = \"/index\", method = { RequestMethod.GET,\r\n\t\t\tRequestMethod.POST })\r\n\tpublic ModelAndView handleRequest(HttpServletRequest arg0,\r\n\t\t\tHttpServletResponse arg1) throws Exception {\n\t\tModelAndView modelAndView = new ModelAndView();\r\n\t\tmodelAndView.addObject(\"message\", \"test/index\");\r\n\t\tmodelAndView.setViewName(\"helloWorld\");\r\n\t\treturn modelAndView;\r\n\t}", "@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n processRequest(request, response);\n }", "@Override\r\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\r\n throws ServletException, IOException {\r\n processRequest(request, response);\r\n }", "@Override\r\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\r\n throws ServletException, IOException {\r\n processRequest(request, response);\r\n }", "protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {\n\t\tfinal String URI = request.getRequestURI().replace(\"/HelloFrontController/\", \"\"); // this is the name of the root project folder\n\t\t\n\t\tswitch(URI) {\n\t\tcase \"login\":\n\t\t\t// call a method from a request helper......\t\n\t\t\tRequestHelper.processLogin(request, response);\n\t\t\tbreak;\n\t\tcase \"employees\":\n\t\t\t// call method show all employees -- this means we'll be querying our DB...\n\t\t\tRequestHelper.processEmployees(request, response);\n\t\t\tbreak;\n\t\tcase \"error\":\n\t\t\tRequestHelper.processError(request, response);\n\t\t\tbreak;\n\t\tdefault:\n\t\t\tRequestHelper.processError(request, response);\n\t\t\tbreak;\n\t\t}\n\t\t\n\t}", "@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n try {\n processRequest(request, response);\n } catch (SQLException ex) {\n Logger.getLogger(TuotteenmuokkausServlet.class.getName()).log(Level.SEVERE, null, ex);\n } catch (NamingException ex) {\n Logger.getLogger(TuotteenmuokkausServlet.class.getName()).log(Level.SEVERE, null, ex);\n } catch (Exception ex) {\n Logger.getLogger(TuotteenmuokkausServlet.class.getName()).log(Level.SEVERE, null, ex);\n }\n }", "@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n processRequest(request, response);\n }", "@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {\n processRequest(request,response);\n }", "@RequestMapping({\"\", \"/\", \"/index\"})\n public String getIndexPage() {\n System.out.println(\"Some message to say...1234e\");\n return \"index\";\n }", "@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n try {\n processRequest(request, response);\n } catch (ParseException ex) {\n Logger.getLogger(Controlador.class.getName()).log(Level.SEVERE, null, ex);\n }\n }", "@Override\n\tprotected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {\n\t\tSystem.out.println(\"servlet\");\n\t}", "@ExceptionHandler(NoHandlerFoundException.class)\n public ModelAndView handleError404(Exception e) {\n ModelAndView model = new ModelAndView(\"genericError\");\n model.addObject(\"errCode\", \"404\");\n model.addObject(\"errMsg\", \"Zadana stranka nebyla na serveru bikeo.cz nalezena\");\n return model;\n }", "@Override\r\n\tprotected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {\n\t}", "@Override\r\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\r\n throws ServletException, IOException {\r\n processRequest(request, response);\r\n }", "@Override\n protected void doGet\n (HttpServletRequest request, HttpServletResponse response\n )\n throws ServletException\n , IOException {\n processRequest(request, response);\n }", "@Override\n\tprotected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {\n\t\t\n\t}", "@ExceptionHandler(NoHandlerFoundException.class)\r\n\tpublic ModelAndView handlerNoHandlerFoundException() {\r\n\t\t\r\n\t\tModelAndView mv = new ModelAndView(\"/clientViews/page\");\r\n\t\t\r\n\t\tmv.addObject(\"title\",\"404 Error Page\");\r\n\t\tmv.addObject(\"error404\", true);\r\n\t\treturn mv;\r\n\t\t\r\n\t}", "@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n }", "@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n }", "@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n\t throws ServletException, IOException {\n\tprocessRequest(request, response);\n }", "@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n processRequest(request, response);\n }", "@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n processRequest(request, response);\n }", "@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n processRequest(request, response);\n }", "@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n processRequest(request, response);\n }", "@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n processRequest(request, response);\n }", "@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n processRequest(request, response);\n }", "@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n processRequest(request, response);\n }", "@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n processRequest(request, response);\n }", "@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n processRequest(request, response);\n }", "@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n processRequest(request, response);\n }", "@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n processRequest(request, response);\n }", "@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n processRequest(request, response);\n }", "@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n processRequest(request, response);\n }", "@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n processRequest(request, response);\n }", "@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n processRequest(request, response);\n }", "@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n processRequest(request, response);\n }", "@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n processRequest(request, response);\n }", "@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n processRequest(request, response);\n }", "@Override\r\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\r\n throws ServletException, IOException {\r\n\r\n }", "@Override\r\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\r\n throws ServletException, IOException {\r\n processRequest(request, response);\r\n }", "@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException\n {\n processRequest(request, response);\n }", "void handleRequest();", "@RequestMapping(\"/home\")\n\tpublic String home() throws FileNotFoundException, IOException {\n\t\tlog.info(\"accessed info\");\n\t\tlog.warn(\"accessed warn\");\n\t\tlog.error(\"accessed error\");\n\t\tlog.debug(\"accessed debug\");\n\t\tlog.trace(\"accessed trace\");\n\t\treturn \"home\";\n\n\t}", "@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {\n processRequest(request, response);\n }", "@Override\r\nprotected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {\n\t process(req,resp);\r\n\t }", "@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n try {\n processRequest(request, response);\n } catch (ClassNotFoundException ex) {\n Logger.getLogger(OrgDisplay.class.getName()).log(Level.SEVERE, null, ex);\n } catch (SQLException ex) {\n Logger.getLogger(OrgDisplay.class.getName()).log(Level.SEVERE, null, ex);\n }\n }", "@Override\n\tprotected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {\n\t}", "@Override\n\tprotected void doGet(HttpServletRequest request, HttpServletResponse response)\n\t\t\tthrows ServletException, IOException {\n\t\ttry {\n\t\t\tprocessRequest(request, response);\n\t\t} catch (Exception e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t}", "@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n try {\n processRequest(request, response);\n } catch (ClassNotFoundException ex) {\n Logger.getLogger(Hint.class.getName()).log(Level.SEVERE, null, ex);\n } catch (SQLException ex) {\n Logger.getLogger(Hint.class.getName()).log(Level.SEVERE, null, ex);\n }\n }", "@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n\n }", "@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n\n }", "@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n \n }", "@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n try {\n processRequest(request, response);\n } catch (NamingException ex) {\n Logger.getLogger(UpdateLibro.class.getName()).log(Level.SEVERE, null, ex);\n }\n }", "@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n try {\n processRequest(request, response);\n } catch (SQLException ex) {\n Logger.getLogger(ResultsDisplay2.class.getName()).log(Level.SEVERE, null, ex);\n }\n }", "@Override\n public void handle(HttpExchange exchange) throws IOException {\n boolean wasSuccessful = false;\n try {\n // Only allow POST requests for this operation.\n // This operation requires a POST request, because the\n // client is \"posting\" information to the server for processing.\n if (exchange.getRequestMethod().toLowerCase().equals(\"get\")) {\n\n //String containing the url desired\n String URLrequested = exchange.getRequestURI().toString();\n\n //Checks to see if it is just the open URL as ex: localhost:8080, this is mapped to index.html, this is the case for nothing added.\n if (URLrequested.length() == 1){\n\n\n String location = \"web/index.html\";\n Path path = FileSystems.getDefault().getPath(location);\n\n exchange.sendResponseHeaders(HttpURLConnection.HTTP_OK, 0);\n\n Files.copy(path, exchange.getResponseBody());\n\n exchange.getResponseBody().close();\n\n } else if (URLrequested.equals(\"/\")) {\n\n //\n String location = \"web\" + URLrequested;\n\n //Obtain the file path, this is the same method used for the name and locations data draw\n Path filePath = FileSystems.getDefault().getPath(location);\n\n exchange.sendResponseHeaders(HttpURLConnection.HTTP_OK, 0);\n\n //Copies Files into the exchange's responsive body header\n Files.copy(filePath, exchange.getResponseBody());\n\n exchange.getResponseBody().close();\n\n }\n else if(URLrequested.equals(\"/css/main.css\")){\n String location = \"web/css/main.css\";\n //Obtain the file path, this is the same method used for the name and locations data draw\n Path filePath = FileSystems.getDefault().getPath(location);\n\n exchange.sendResponseHeaders(HttpURLConnection.HTTP_OK, 0);\n\n //Copies Files into the response body\n Files.copy(filePath, exchange.getResponseBody());\n\n exchange.getResponseBody().close();\n\n }\n else{\n String location = \"web/HTML/404.html\";\n\n //Obtain the file path, this is the same method used for the name and locations data draw\n Path filePath = FileSystems.getDefault().getPath(location);\n\n //Response header needs to come first.\n exchange.sendResponseHeaders(HttpURLConnection.HTTP_NOT_FOUND, 0);\n\n //Copies Files into the response body\n Files.copy(filePath, exchange.getResponseBody());\n\n\n //Completes the exchange\n exchange.getResponseBody().close();\n }\n wasSuccessful = true;\n\n\n }\n\n if (!wasSuccessful) {\n //Bad Server Response\n exchange.sendResponseHeaders(HttpURLConnection.HTTP_BAD_REQUEST, 0);\n\n //Completes the exchange\n exchange.getResponseBody().close();\n }\n }\n catch (IOException e) {\n //Bad Server Response\n exchange.sendResponseHeaders(HttpURLConnection.HTTP_SERVER_ERROR, 0);\n //Completes the exchange\n exchange.getResponseBody().close();\n e.printStackTrace();\n }\n }", "@Override\r\n protected void doGet(HttpServletRequest request,\r\n HttpServletResponse response) throws ServletException, IOException {\r\n\r\n String path = request.getPathInfo();\r\n Map<String, Object> data = getDefaultData();\r\n Writer writer = response.getWriter();\r\n\r\n if (path == null) {\r\n throw new IOException(\"The associated path information is null\");\r\n }\r\n\r\n if (path.equals(\"/\")) {\r\n processTemplate(MAIN_SITE, data, writer);\r\n } else if (path.equals(\"/login\")) {\r\n processTemplate(LOGIN_SITE, data, writer);\r\n } else if (path.startsWith(\"/login/error\")) {\r\n data.put(\"hasLoginFailed\", true);\r\n AppServlet.processTemplate(LOGIN_SITE, data, response.getWriter());\r\n } else if (path.equals(\"/logout\")) {\r\n request.getSession().invalidate();\r\n response.sendRedirect(\"/login\");\r\n } else if (path.equals(\"/signup\")) {\r\n processTemplate(SIGNUP_SITE, data, response.getWriter());\r\n } else {\r\n processTemplate(NOT_FOUND_SITE, data, writer);\r\n }\r\n }", "protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {\r\n\t\t// TODO Auto-generated method stub\r\n\t\tresponse.getWriter().append(\"Served at: \").append(request.getContextPath());\r\n\t}", "protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {\r\n\t\t// TODO Auto-generated method stub\r\n\t\tresponse.getWriter().append(\"Served at: \").append(request.getContextPath());\r\n\t}" ]
[ "0.67014486", "0.6626598", "0.64899063", "0.63360924", "0.62985224", "0.6289932", "0.62122846", "0.6176699", "0.6175338", "0.6138631", "0.6123818", "0.6123514", "0.61115104", "0.60941803", "0.60845673", "0.60742414", "0.60737914", "0.60334367", "0.60314053", "0.60215455", "0.6011392", "0.600953", "0.5982001", "0.5980188", "0.5980188", "0.5980188", "0.5975764", "0.59608006", "0.59569824", "0.5954174", "0.5950238", "0.59373665", "0.5934067", "0.59328145", "0.59328145", "0.592879", "0.59263986", "0.591883", "0.59181523", "0.5911704", "0.5907204", "0.5906653", "0.5906653", "0.5903765", "0.5900611", "0.5900562", "0.5900562", "0.58994794", "0.58925086", "0.5890281", "0.58893764", "0.58871526", "0.58858746", "0.58684593", "0.5866252", "0.58579344", "0.58529764", "0.5850357", "0.58475685", "0.5847295", "0.5847045", "0.5847045", "0.5842953", "0.583932", "0.583932", "0.583932", "0.583932", "0.583932", "0.583932", "0.583932", "0.583932", "0.583932", "0.583932", "0.583932", "0.583932", "0.583932", "0.583932", "0.583932", "0.583932", "0.583932", "0.583932", "0.5828338", "0.5828077", "0.58240426", "0.5823133", "0.5822046", "0.58203775", "0.581999", "0.58157885", "0.58134115", "0.58112925", "0.5807838", "0.5804521", "0.5804521", "0.58029234", "0.57981867", "0.57971776", "0.57940996", "0.5793098", "0.57923776", "0.57923776" ]
0.0
-1
Generate a String representation of the object.
@Override public String toString() { final StringBuilder sb = new StringBuilder("AbstractStock{"); sb.append("stockSymbol='").append(stockSymbol).append('\''); sb.append(", lastDividend=").append(formatter.format(lastDividend)); sb.append(", parValue=").append(formatter.format(parValue)); sb.append(", stockPrice=").append(formatter.format(stockPrice)); sb.append('}'); return sb.toString(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public String toString()\r\n\t{\r\n\t\tStringBuffer OutString = new StringBuffer();\r\n\t\t// Open tag\r\n\t\tOutString.append(\"<\");\r\n\t\t// Add the object's type\r\n\t\tOutString.append(getType());\r\n\t\t// attach the ID if required.\r\n\t\tif (DEBUG)\r\n\t\t\tOutString.append(getObjID());\r\n\t\t// add the class attribute if required; default: don't.\r\n\t\tif (getIncludeClassAttribute() == true)\r\n\t\t\tOutString.append(getClassAttribute());\r\n\t\t// Add any transformation information,\r\n\t\t// probably the minimum is the x and y values.\r\n\t\t// again this is new to Java 1.4;\r\n\t\t// this function returns a StringBuffer.\r\n\t\tOutString.append(getAttributes());\r\n\t\t// close the tag.\r\n\t\tOutString.append(\">\");\r\n\t\tOutString.append(\"&\"+entityReferenceName+\";\");\r\n\t\t// close tag\r\n\t\tOutString.append(\"</\");\r\n\t\tOutString.append(getType());\r\n\t\tOutString.append(\">\");\r\n\r\n\t\treturn OutString.toString();\r\n\t}", "public String objectToString() {\n \n StringBuilder s = new StringBuilder(new String(\"\"));\n if(aggressor instanceof Town) {\n s.append(((Town) aggressor).getName()).append(\" \");\n } else {\n s.append(((Nation) aggressor).getName()).append(\" \");\n }\n if(defender instanceof Town) {\n s.append(((Town) defender).getName()).append(\" \");\n } else {\n s.append(((Nation) defender).getName()).append(\" \");\n }\n s.append(aggressorPoints).append(\" \");\n s.append(defenderPoints).append(\" \");\n for (Town town : towns.keySet()) {\n s.append(town.getName()).append(\" \");\n s.append(towns.get(town)).append(\" \");\n }\n\n if (rebelwar != null)\n s.append(\" \").append(rebelwar.getName());\n else\n s.append(\" \" + \"n u l l\");\n\n return s.toString();\n }", "public String toString(){\r\n\t\tString superString = super.toString();\r\n\t\tStringBuilder builder = new StringBuilder();\r\n\t\t//Add the object to the string\r\n\t\tbuilder.append(\". \");\r\n\t\tif (this.error != null) {\r\n\t\t\tbuilder.append(error.toString());\r\n\t\t\tbuilder.append(\". \");\r\n\t\t}\r\n\t\tbuilder.append(\"Object: \");\r\n\t\tbuilder.append(object.toString());\r\n\t\tif (this.recordRoute)\r\n\t\t\tbuilder.append(\", [RECORD_ROUTE]\");\r\n\t\tif (this.reRouting) \r\n\t\t\tbuilder.append(\", [RE-ROUTING]\");\r\n\t\t//Add the masks to the string\r\n\t\tif (this.mask != null) {\r\n\t\t\tbuilder.append(\", label set: \");\r\n\t\t\tbuilder.append(mask.toString());\r\n\t\t}\r\n\t\treturn superString.concat(builder.toString());\r\n\t}", "public String toString() { return stringify(this, true); }", "@Override\n public String toString() {\n return stringBuilder.toString() + OBJECT_SUFFIX;\n }", "public String toString() {\n StringWriter writer = new StringWriter();\n this.write(writer);\n return writer.toString();\n }", "public String toString() {\n return ToStringBuilder.reflectionToString(this);\n }", "@Override\n public String toString() {\n // TODO: Using Serializer\n return Serializer.toByteArray(this).toString();\n }", "public String toString() {\n StringBuffer buffer = new StringBuffer();\n\n buffer.append(getClass().getName());\n buffer.append(\"@\");\n buffer.append(Integer.toHexString(hashCode()));\n buffer.append(\" [\");\n buffer.append(objectToString(\"Id\", getId()));\n buffer.append(objectToString(\"ProjectName\", getProjectName()));\n buffer.append(objectToStringFK(\"DataProvider\", getDataProvider()));\n buffer.append(objectToStringFK(\"PrimaryInvestigator\", getPrimaryInvestigator()));\n buffer.append(objectToStringFK(\"CreatedBy\", getCreatedBy()));\n buffer.append(objectToString(\"CreatedTime\", getCreatedTime()));\n buffer.append(\"]\");\n\n return buffer.toString();\n }", "public String toString() {\n\t\treturn this.toJSON().toString();\n\t}", "public String toString() {\n\t\treturn this.toJSON().toString();\n\t}", "public String toString()\n\t{\n\t\treturn Printer.stringify(this, false);\n\t}", "@Override\n\tpublic String toString() {\n\t\treturn \"Object [name = \" + name.get() + \", typ = \" + typ.get() + \"]\";\n\t}", "@Override\n\tpublic String toString() {\n\t\treturn toStringBuilder(new StringBuilder()).toString();\n\t}", "@Override()\n public String toString()\n {\n final StringBuilder buffer = new StringBuilder();\n toString(buffer);\n return buffer.toString();\n }", "public String toString() {\n\t\treturn toString(true);\n\t}", "@Override\n public String toString() {\n final Map<String, Object> augmentedToStringFields = Reflect.getStringInstanceVarEntries(this);\n augmentToStringFields(augmentedToStringFields);\n return Reflect.joinStringMap(augmentedToStringFields, this);\n }", "@Override\n public String toString() {\n return new Gson().toJson(this);\n }", "@Override\n public String toString() {\n ByteArrayOutputStream bs = new ByteArrayOutputStream();\n PrintStream out = new PrintStream(bs);\n output(out, \"\");\n return bs.toString();\n }", "@Override\n public String toString() {\n return new JSONSerializer().serialize(this);\n }", "@Override\n\tpublic String toString() {\n\t\treturn toText();\n\t}", "String objectWrite();", "public String toString() {\n\treturn createString(data);\n }", "@Override\n public String toString() {\n return toString(false, true, true, null);\n }", "@Override\n public final String toString() {\n return asString(0, 4);\n }", "public String toString();", "public String toString();", "public String toString();", "public String toString();", "public String toString();", "public String toString();", "public String toString();", "public String toString();", "public String toString();", "public String toString();", "public String toString();", "public String toString();", "public String toString();", "public String toString();", "public String toString();", "public String toString();", "public String toString();", "public String toString();", "public String toString();", "public String toString();", "public String toString();", "public String toString();", "public String toString() {\n StringBuilder stringBuilder = new StringBuilder(40);\n stringBuilder.append(\"property '\").append(this.getName()).append(\"' (\");\n if (this._accessorMethod != null) {\n stringBuilder.append(\"via method \").append(this._accessorMethod.getDeclaringClass().getName()).append(\"#\").append(this._accessorMethod.getName());\n } else {\n stringBuilder.append(\"field \\\"\").append(this._field.getDeclaringClass().getName()).append(\"#\").append(this._field.getName());\n }\n if (this._serializer == null) {\n stringBuilder.append(\", no static serializer\");\n } else {\n stringBuilder.append(\", static serializer of type \" + this._serializer.getClass().getName());\n }\n stringBuilder.append(')');\n return stringBuilder.toString();\n }", "@Override\n public String toString() {\n // TODO this is a sudo method only for testing puroposes\n return \"{name: 5aled, age:15}\";\n }", "@Override\n public String toString() {\n String str = \"\";\n\n //TODO: Complete Method\n\n return str;\n }", "@Override\n public String toString() {\n return ObjectContracts.toString(this, \"objectType\", \"name\", \"atPath\");\n }", "@Override\r\n\tpublic String toString();", "@Override public String toString();", "public final String toString() {\n\t\tStringWriter write = new StringWriter();\n\t\tString out = null;\n\t\ttry {\n\t\t\toutput(write);\n\t\t\twrite.flush();\n\t\t\tout = write.toString();\n\t\t\twrite.close();\n\t\t} catch (UnsupportedEncodingException use) {\n\t\t\tuse.printStackTrace();\n\t\t} catch (IOException ioe) {\n\t\t\tioe.printStackTrace();\n\t\t}\n\t\treturn (out);\n\t}", "public String toString ( ) {\r\n String returnString = _name + \"{ id: \" + _uniqueID + \" pos: [\"+ getPosition().getPosition() + \"] }\";\r\n return returnString;\r\n }", "public String toString() ;", "@Override\r\n public String toString() {\r\n return JsonSerializer.SerializeObject(this);\r\n }", "public String toString() {\n StringBuffer buffer = new StringBuffer();\n\n buffer.append(getClass().getName());\n buffer.append(\"@\");\n buffer.append(Integer.toHexString(hashCode()));\n buffer.append(\" [\");\n buffer.append(objectToString(\"Id\", getId()));\n buffer.append(objectToStringFK(\"Project\", getProject()));\n buffer.append(objectToStringFK(\"User\", getUser()));\n buffer.append(objectToString(\"Status\", getStatus()));\n buffer.append(objectToString(\"LastActivityDate\", getLastActivityDate()));\n buffer.append(objectToString(\"HasPiSeen\", getHasPiSeen()));\n buffer.append(objectToString(\"HasDpSeen\", getHasDpSeen()));\n buffer.append(objectToString(\"HasAdminSeen\", getHasAdminSeen()));\n buffer.append(objectToString(\"HasRequestorSeen\", getHasRequestorSeen()));\n buffer.append(objectToString(\"EmailStatus\", getEmailStatus()));\n buffer.append(\"]\");\n\n return buffer.toString();\n }", "@Override\n public String toString() {\n return JsonSerializer.SerializeObject(this);\n }", "@Override\n public String toString() {\n return JsonSerializer.SerializeObject(this);\n }", "@Override\n public String toString() {\n return JsonSerializer.SerializeObject(this);\n }", "@Override\n public String toString() {\n return Helper.concat(this.getClass().getName(), \"{\",\n \"id:\", getId(),\n \", name:\", getName(),\n \", positions:\", positions,\n \", resourceRoles:\", resourceRoles,\n \"}\");\n }", "@Override\n public String toString() {\n return gson.toJson(this);\n }", "public String toString(){\n \treturn \"todo: use serialize() method\";\r\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 public String toString() {\n Gson gson = new Gson();\n\n String json = gson.toJson(this);\n System.out.println(\"json \\n\" + json);\n return json;\n }", "@Override\n\tpublic String toString() {\n\t\treturn toJSON().toString();\n\t}", "@Override\n public String toString() {\n StringBuilder sb = new StringBuilder();\n sb.append(this.getName());\n sb.append(\"\\n name=\").append(this.getName());\n sb.append(\"\\n type=\").append(this.getType());\n sb.append(\"\\n parentType=\").append(this.getParentType());\n sb.append(\"\\n resourceUrl=\").append(this.getResourceUrl());\n sb.append(\"\\n restUrl=\").append(this.getRestUrl());\n sb.append(\"\\n soapUrl=\").append(this.getSoapUrl());\n sb.append(\"\\n thumbnailUrl=\").append(this.getThumbnailUrl());\n sb.append(\"\\n capabilities=\").append(this.getCapabilities());\n sb.append(\"\\n creator=\").append(this.getCreator());\n sb.append(\"\\n description=\").append(this.getDescription());\n sb.append(\"\\n keywords=\").append(this.getKeywords());\n if (this.getEnvelope() != null) {\n if (this.getEnvelope() instanceof EnvelopeN) {\n EnvelopeN envn = (EnvelopeN) this.getEnvelope();\n sb.append(\"\\n envelope=\");\n sb.append(envn.getXMin()).append(\", \").append(envn.getYMin()).append(\", \");\n sb.append(envn.getXMax()).append(\", \").append(envn.getYMax());\n if (envn.getSpatialReference() != null) {\n sb.append(\" wkid=\").append(envn.getSpatialReference().getWKID());\n }\n }\n }\n return sb.toString();\n }", "@Override\r\n public String toString();", "@Override\r\n String toString();", "public String toString() {\n\t\t//TODO add your own field name here\t\t\n\t\t//return buffer.append(this.yourFieldName).toString();\n\t\treturn \"\";\n\t}", "public String toString() {\n return toDisplayString();\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() {\n\t\tString str = \"\";\r\n\t\treturn str;\r\n\t}", "public static String toString(Object obj)\n {\n return obj.getClass().getName() + \"@\" + Integer.toHexString(obj.hashCode()); //$NON-NLS-1$\n }", "@Override\n\tpublic String toString();", "@Override\n public String toString() {\n ObjectMapper mapper = new ObjectMapper();\n try {\n return mapper.writeValueAsString(this);\n } catch (JsonProcessingException e) {\n return null;\n }\n }", "@Override\n public String toString() {\n return new GsonBuilder().serializeNulls().create().toJson(this).toString();\n }", "@Override\n String toString();", "@Override\n String toString();", "public String toString() {\n\t\treturn toString(this);\n\t}", "@Override\n\tpublic String toString() {\n\t\tif (repr == null)\n\t\t\trepr = toString(null);\n\n\t\treturn repr;\n\t}", "public String toString() {\n\t\tByteArrayOutputStream bos = new ByteArrayOutputStream();\n\n\t\tDocument document = XMLUtils.newDocument();\n\t\tdocument.appendChild(toXML(document));\n\t\tXMLUtils.write(bos, document);\n\n\t\treturn bos.toString();\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 String toString(){ \n //--------------------------------------------------------------------------- \n StringBuffer buffer=new StringBuffer(\"*****GeneratorProperties:\"); \n buffer.append(\"\\tdatabaseDriver\"+databaseDriver); \n buffer.append(\"\\turlString\"+urlString); \n buffer.append(\"\\tuserName=\"+userName); \n buffer.append(\"\\tpassword=\"+password); \n buffer.append(\"\\tpackageName=\"+packageName); \n buffer.append(\"\\toutputDirectory=\"+outputDirectory); \n buffer.append(\"\\tjarFilename=\"+jarFilename); \n buffer.append(\"\\twhereToPlaceJar=\"+whereToPlaceJar); \n buffer.append(\"\\ttmpWorkDir=\"+tmpWorkDir); \n buffer.append(\"\\taitworksPackageBase=\"+aitworksPackageBase); \n buffer.append(\"\\tincludeClasses=\"+includeClasses); \n buffer.append(\"\\tincludeSource=\"+includeSource); \n buffer.append(\"\\tgeneratedClasses=\"+generatedClasses); \n return buffer.toString();\n }", "public String toString() {\n\t\treturn toString(0, 0);\n\t}", "@Override String toString();", "public String toString()\n\t{\n\t\tField[] fields = this.getClass().getDeclaredFields();\n\t\tint i, max = fields.length;\n\t\tString fieldName = \"\";\n\t\tString fieldType = \"\";\n\t\tString ret = \"\";\n\t\tString value = \"\";\n\t\tboolean skip = false;\n\t\tint j = 0;\n\t\tfor(i = 0; i < max; i++)\n\t\t{\n\t\t\tfieldName = fields[i].getName().toString();\n\t\t\tfieldType = fields[i].getType().toString();\n\t\t\tif(i == 0)\n\t\t\t{\n\t\t\t\tret += \"{\";\n\t\t\t}\n\t\t\tif(fieldType.equals(\"int\") || fieldType.equals(\"long\") || fieldType.equals(\"float\") || fieldType.equals(\"double\") || fieldType.equals(\"boolean\"))\n\t\t\t{\n\t\t\t\ttry \n\t\t\t\t{\n\t\t\t\t\tvalue = fields[i].get(this).toString();\n\t\t\t\t} \n\t\t\t\tcatch (Exception e) \n\t\t\t\t{\n\t\t\t\t\tvalue = \"0\";\n\t\t\t\t}\n\t\t\t\tskip = false;\n\t\t\t}\n\t\t\telse if(fieldType.contains(\"String\"))\n\t\t\t{\n\t\t\t\ttry \n\t\t\t\t{\n\t\t\t\t\tvalue = \"\\\"\"+Utility.escapeJSON((String) fields[i].get(this))+\"\\\"\";\n\t\t\t\t} \n\t\t\t\tcatch (Exception e) \n\t\t\t\t{\n\t\t\t\t\tvalue = \"\\\"\"+\"\\\"\";\n\t\t\t\t}\n\t\t\t\tskip = false;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tvalue = \"\\\"\"+\"\\\"\";\n\t\t\t\tskip = true;\n\t\t\t}\n\t\t\tif(!skip)\n\t\t\t{\n\t\t\t\tif(j > 0)\n\t\t\t\t{\n\t\t\t\t\tret += \",\";\n\t\t\t\t}\n\t\t\t\tj++;\n\t\t\t\tret += \"\\r\\n\\t\\\"\"+fieldName+\"\\\":\"+value;\n\t\t\t}\n\t\t\tif(i == max-1)\n\t\t\t{\n\t\t\t\tret += \"\\r\\n}\";\n\t\t\t}\n\t\t}\n\t\treturn ret;\n\t}", "public String toString() {\n final StringBuffer sb = new StringBuffer();\n sb.append(\"\\n [ Id: \" + id + \" ]\");\n sb.append(\"\\n [ ClassName: \" + className + \" ]\");\n sb.append(\"\\n [ MethodName : \" + methodName + \" ]\");\n if (bextraInfo) {\n for (int i = 0; i < extraInfo.length; i++) {\n sb.append(\n \"\\n [ Parameter \" + i + \" : \" + extraInfo[i]\n + \" ]\");\n }\n }\n sb.append(\"\\n [ Calendar: \" + cal + \" ]\");\n sb.append(\"\\n [ TimeMillis: \" + timeMillis + \" ] \");\n sb.append(\"\\n \");\n return sb.toString();\n }", "@Override\r\n\tpublic String toString() {\n\t\treturn \"\";\r\n\t}", "public String toString(){\n\t\treturn \"<== at \" + time + \": \" + name + \", \" + type + \", \" + data + \"==>\"; \n\t}", "public String toString() {\n\t\treturn EPPUtil.toString(this);\n\t}", "public String toString() {\n\t\treturn EPPUtil.toString(this);\n\t}", "String toString();", "String toString();", "String toString();", "String toString();", "String toString();", "String toString();", "String toString();", "String toString();" ]
[ "0.79704773", "0.77526873", "0.76128995", "0.7590809", "0.75719756", "0.75289893", "0.7521804", "0.75027454", "0.74220514", "0.739193", "0.739193", "0.7390753", "0.73666406", "0.73228884", "0.7303857", "0.72611403", "0.72378707", "0.7232711", "0.72308385", "0.72260356", "0.7219157", "0.72117", "0.7184974", "0.7183505", "0.71786964", "0.71669924", "0.71669924", "0.71669924", "0.71669924", "0.71669924", "0.71669924", "0.71669924", "0.71669924", "0.71669924", "0.71669924", "0.71669924", "0.71669924", "0.71669924", "0.71669924", "0.71669924", "0.71669924", "0.71669924", "0.71669924", "0.71669924", "0.71669924", "0.71669924", "0.71669924", "0.7165664", "0.71652484", "0.7161938", "0.71432686", "0.71428835", "0.71345395", "0.7123794", "0.7109594", "0.71067184", "0.7103494", "0.7102208", "0.71017146", "0.71017146", "0.71017146", "0.7092167", "0.7091471", "0.70766574", "0.7073665", "0.70660233", "0.7064342", "0.7056547", "0.7056346", "0.7054952", "0.70466536", "0.7045701", "0.70444584", "0.7044451", "0.70299107", "0.70178574", "0.7013942", "0.70103955", "0.70095843", "0.70095843", "0.7006896", "0.7005463", "0.7000606", "0.6992283", "0.69922656", "0.69903386", "0.6988809", "0.6976711", "0.69764656", "0.69636893", "0.69632334", "0.6961016", "0.6961016", "0.69476455", "0.69476455", "0.69476455", "0.69476455", "0.69476455", "0.69476455", "0.69476455", "0.69476455" ]
0.0
-1
Equals method comparing member variables.
@Override public boolean equals(Object o) { if (this == o) return true; if (o == null || getClass() != o.getClass()) return false; AbstractStock that = (AbstractStock) o; if (stockSymbol != null ? !stockSymbol.equals(that.stockSymbol) : that.stockSymbol != null) return false; if (lastDividend != null ? !lastDividend.equals(that.lastDividend) : that.lastDividend != null) return false; if (parValue != null ? !parValue.equals(that.parValue) : that.parValue != null) return false; return stockPrice != null ? stockPrice.equals(that.stockPrice) : that.stockPrice == null; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\r\n\tpublic boolean equals(Object o) {\n\t\tboolean res= false;\r\n\t\t\r\n\t\tif (o instanceof Member) {\r\n\t\t\tMember other = (Member) o;\t\t\t\t\t\r\n\t\t\tres= _name.equals(other._name);\t\r\n\t\t}\t\t\r\n\t\treturn res;\r\n\t}", "private Equals() {}", "@Override\n public boolean equals(Object obj) {\n if (obj == null) {\n return false;\n }\n\n if (TkRefexAbstractMember.class.isAssignableFrom(obj.getClass())) {\n TkRefexAbstractMember<?> another = (TkRefexAbstractMember<?>) obj;\n\n // =========================================================\n // Compare properties of 'this' class to the 'another' class\n // =========================================================\n // Compare refsetUuid\n if (!this.refexUuid.equals(another.refexUuid)) {\n return false;\n }\n\n // Compare componentUuid\n if (!this.componentUuid.equals(another.componentUuid)) {\n return false;\n }\n\n // Compare their parents\n return super.equals(obj);\n }\n\n return false;\n }", "@Test\n public void testEquals() {\n System.out.println(\"equals\");\n Receta instance = new Receta();\n instance.setNombre(\"nom1\");\n Receta instance2 = new Receta();\n instance.setNombre(\"nom2\");\n boolean expResult = false;\n boolean result = instance.equals(instance2);\n assertEquals(expResult, result);\n }", "@Override\n\tpublic boolean equals(Object obj) {\n if (obj == this) { \n return true; \n } \n // Check if obj is an instance of Position or not \n if (!(obj instanceof Player)) { \n return false; \n } \n // Type cast obj to \"Player\" so that we can compare the name & side attributes \n Player p = (Player) obj; \n return ( this.name == p.getName() && this.side == p.getSide() ); \n }", "@Test\n void testEquals() {\n final boolean expected_boolean = true;\n\n // Properties for the objects\n final String username = \"username\";\n final String name = \"their_name\";\n final String password = \"password\";\n\n // Create two LoginAccount objects\n LoginAccount first_account = new LoginAccount(username, name, password);\n LoginAccount second_account = new LoginAccount(username, name, password);\n\n // Variable to check\n boolean objects_are_equal = first_account.equals(second_account);\n\n // Assert that the two boolean values are the same\n assertEquals(expected_boolean, objects_are_equal);\n }", "@Test\n public void testEquals_sameParameters() {\n CellIdentityNr cellIdentityNr =\n new CellIdentityNr(PCI, TAC, NRARFCN, BANDS, MCC_STR, MNC_STR, NCI,\n ALPHAL, ALPHAS, Collections.emptyList());\n CellIdentityNr anotherCellIdentityNr =\n new CellIdentityNr(PCI, TAC, NRARFCN, BANDS, MCC_STR, MNC_STR, NCI,\n ALPHAL, ALPHAS, Collections.emptyList());\n\n // THEN this two objects are equivalent\n assertThat(cellIdentityNr).isEqualTo(anotherCellIdentityNr);\n }", "@Override\n protected boolean doEquals(Object obj) {\n if (obj instanceof BsMemberFollowing) {\n BsMemberFollowing other = (BsMemberFollowing)obj;\n if (!xSV(_memberFollowingId, other._memberFollowingId)) { return false; }\n return true;\n } else {\n return false;\n }\n }", "@Override\n public boolean equals(Object obj) {\n return ((Variable)obj).name.equals(this.name) && ((Variable)obj).initialValue == this.initialValue;\n }", "@Test\n public void testEqualsMethodEqualObjects() {\n String name = \"A modifier\";\n int cost = 12;\n\n Modifier m1 = new Modifier(name, cost) {\n @Override\n public int getValue() {\n return 0;\n }\n };\n Modifier m2 = new Modifier(name, cost) {\n @Override\n public int getValue() {\n return 0;\n }\n };\n\n assertTrue(m1.equals(m2));\n }", "@Override\n public boolean equals(Object obj) {\n if(!(obj instanceof Member))\n return false;\n Member that = (Member) obj;\n return displayName.equals(that.displayName);\n }", "@Test\n public void testEquals() {\n System.out.println(\"equals\");\n Commissioner instance = new Commissioner();\n Commissioner instance2 = new Commissioner();\n instance.setLogin(\"genie\");\n instance2.setLogin(\"genie\");\n boolean expResult = true;\n boolean result = instance.equals(instance2);\n assertEquals(expResult, result);\n }", "@Test\n\tpublic void testEquals() {\n\t\tPMUser user = new PMUser(\"Smith\", \"John\", \"[email protected]\");\n\t\tPark a = new Park(\"name\", \"address\", user);\n\t\tPark b = new Park(\"name\", \"address\", user);\n\t\tPark c = new Park(\"name\", \"different address\", user);\n\t\tassertEquals(a, a);\n\t\tassertEquals(a, b);\n\t\tassertEquals(b, a);\n\t\tassertFalse(a.equals(c));\n\t}", "public boolean betterEquals(Object obj)\n\t{\n\t\tif (obj instanceof Player)\n\t\t{\n\t\t\tPlayer other = (Player) obj;\n\t\t\treturn this.name.equals(other.name) && this.pawn == other.pawn;\n\t\t}\n\t\treturn false;\n\t}", "@Override\r\n public boolean equals(Object object) {\n if (!(object instanceof Member1)) {\r\n return false;\r\n }\r\n Member1 other = (Member1) object;\r\n if ((this.username == null && other.username != null) || (this.username != null && !this.username.equals(other.username))) {\r\n return false;\r\n }\r\n return true;\r\n }", "@Override\n public boolean equals(Object obj)\n {\n if (obj instanceof A)\n {\n A temp = (A) obj;\n if (temp.xValue == this.xValue)\n {\n return true;\n }\n }\n return false;\n }", "@Override\n public boolean equals(Object obj) {\n return this == obj;\n }", "@Test\n public void equalsTrueMySelf() {\n Player player1 = new Player(PlayerColor.BLACK, \"\");\n assertTrue(player1.equals(player1));\n assertTrue(player1.hashCode() == player1.hashCode());\n }", "boolean equalTo(ObjectPassDemo o) {\n return (o.a == a && o.b == b);\n }", "@Test\n void equals1() {\n Student s1=new Student(\"emina\",\"milanovic\",18231);\n Student s2=new Student(\"emina\",\"milanovic\",18231);\n assertEquals(true,s1.equals(s2));\n }", "public boolean equalsImpl(Object obj)\n {\n boolean ivarsEqual = true;\n\n final EntityTypeVP rhs = (EntityTypeVP)obj;\n\n if( ! (recordType == rhs.recordType)) ivarsEqual = false;\n if( ! (changeIndicator == rhs.changeIndicator)) ivarsEqual = false;\n if( ! (entityType.equals( rhs.entityType) )) ivarsEqual = false;\n if( ! (padding == rhs.padding)) ivarsEqual = false;\n if( ! (padding1 == rhs.padding1)) ivarsEqual = false;\n return ivarsEqual;\n }", "@Override\n public boolean equals(Object object) {\n if (!(object instanceof Memberpass)) {\n return false;\n }\n Memberpass other = (Memberpass) object;\n if ((this.username == null && other.username != null) || (this.username != null && !this.username.equals(other.username))) {\n return false;\n }\n return true;\n }", "@Override\n public boolean equals(Object obj) {\n return this == obj;\n }", "@Test\n public void testEquals() {\n System.out.println(\"Animal.equals\");\n Animal newAnimal = new Animal(252, \"Candid Chandelier\", 10, \"Cheetah\", 202);\n assertTrue(animal1.equals(newAnimal));\n assertFalse(animal2.equals(newAnimal));\n }", "@Override\n public boolean equals(Object obj) {\n // this code provided by Dave Houtman [2020] personal communication\n if (!(obj instanceof Property))\n return false;\n Property prop = (Property) obj;\n return this.getXLeft() == prop.getXLeft() && this.getYTop() == prop.getYTop() && hasSameSides(prop);\n }", "@Override\n public boolean equals(Object other) {\n return this == other;\n }", "@Test\n public void testEquals01() {\n System.out.println(\"equals\");\n Object otherObject = new SocialNetwork();\n SocialNetwork sn = new SocialNetwork();\n boolean result = sn.equals(otherObject);\n assertTrue(result);\n }", "@Test\n public void testEquals() {\n \n Beneficiaire instance = ben2;\n Beneficiaire unAutreBeneficiaire = ben3;\n boolean expResult = false;\n boolean result = instance.equals(unAutreBeneficiaire);\n assertEquals(expResult, result);\n\n unAutreBeneficiaire = ben2;\n expResult = true;\n result = instance.equals(unAutreBeneficiaire);\n assertEquals(expResult, result);\n }", "public void testObjEqual()\n {\n assertEquals( true, Util.objEqual(null,null) );\n assertEquals( false,Util.objEqual(this,null) );\n assertEquals( false,Util.objEqual(null,this) );\n assertEquals( true, Util.objEqual(this,this) );\n assertEquals( true, Util.objEqual(\"12\",\"12\") );\n }", "@Override\n public boolean equals(Object obj) {\n if (obj == null) {\n return false;\n }\n if (getClass() != obj.getClass()) {\n return false;\n }\n final Parametro other = (Parametro) obj;\n if ((this.nombre == null) ? (other.nombre != null) : !this.nombre.equals(other.nombre)) {\n return false;\n }\n if ((this.unidad == null) ? (other.unidad != null) : !this.unidad.equals(other.unidad)) {\n return false;\n }\n return true;\n }", "@Override public boolean equals(Object obj) {\r\n\t\tif(this==obj)return true;\r\n\t\tif (obj instanceof Field) {\r\n\t\t\tField field = (Field) obj;\r\n\t\t\treturn field.getID() == getID() && field.getName().equals(getName());\r\n\t\t}\r\n\t\treturn false;\r\n\t}", "@Test\n public void testEquals_differentParameters() {\n CellIdentityNr cellIdentityNr =\n new CellIdentityNr(PCI, TAC, NRARFCN, BANDS, MCC_STR, MNC_STR, NCI,\n ALPHAL, ALPHAS, Collections.emptyList());\n CellIdentityNr anotherCellIdentityNr =\n new CellIdentityNr(PCI, TAC, NRARFCN, BANDS, MCC_STR, MNC_STR, NCI + 1,\n ALPHAL, ALPHAS, Collections.emptyList());\n\n // THEN this two objects are different\n assertThat(cellIdentityNr).isNotEqualTo(anotherCellIdentityNr);\n }", "@Override\n public boolean equals(Object o) {\n return this == o;\n }", "@Override public boolean equals(Object o) { // since 1.3.1\n // should these ever match actually?\n return (o == this);\n }", "@Test\n public void testEquals() {\n System.out.println(\"equals\");\n Object object = null;\n Paciente instance = new Paciente();\n boolean expResult = false;\n boolean result = instance.equals(object);\n assertEquals(expResult, result);\n\n }", "@Test\n public void checkEquals() {\n EqualsVerifier.forClass(GenericMessageDto.class).usingGetClass()\n .suppress(Warning.NONFINAL_FIELDS).verify();\n }", "@Override \n boolean equals(Object obj);", "@Test\n\tpublic void test_TCM__boolean_equals_Object() {\n\t\tfinal Attribute attribute = new Attribute(\"test\", \"value\");\n\n assertFalse(\"attribute equal to null\", attribute.equals(null));\n\n final Object object = attribute;\n assertTrue(\"object not equal to attribute\", attribute.equals(object));\n assertTrue(\"attribute not equal to object\", object.equals(attribute));\n\n // current implementation checks only for identity\n// final Attribute clonedAttribute = (Attribute) attribute.clone();\n// assertTrue(\"attribute not equal to its clone\", attribute.equals(clonedAttribute));\n// assertTrue(\"clone not equal to attribute\", clonedAttribute.equals(attribute));\n\t}", "@Test\n\tpublic void testEquals1() {\n\t\tDistance d1 = new Distance(0, 0);\n\t\tDistance d2 = new Distance();\n\t\tassertEquals(false, d1.equals(d2));\n\t}", "@Test\n public void equals() {\n CsvAdaptedPatient alice = new CsvAdaptedPatient(ALICE);\n CsvAdaptedPatient aliceCopy = new CsvAdaptedPatient(new PatientBuilder(ALICE).build());\n\n assertTrue(alice.equals(aliceCopy));\n\n // same object -> returns true\n assertTrue(alice.equals(alice));\n\n // null -> returns false\n assertFalse(alice.equals(null));\n\n // different type -> returns false\n assertFalse(alice.equals(5));\n\n // different patient -> returns false\n assertFalse(alice.equals(new CsvAdaptedPatient(BOB)));\n\n // different name -> returns false\n Patient editedAlice = new PatientBuilder(ALICE).withName(VALID_NAME_BOB).build();\n assertFalse(alice.equals(new CsvAdaptedPatient(editedAlice)));\n\n // different phone -> returns false\n editedAlice = new PatientBuilder(ALICE).withPhone(VALID_PHONE_BOB).build();\n assertFalse(alice.equals(new CsvAdaptedPatient(editedAlice)));\n\n // different address -> returns false\n editedAlice = new PatientBuilder(ALICE).withAddress(VALID_ADDRESS_BOB).build();\n assertFalse(alice.equals(new CsvAdaptedPatient(editedAlice)));\n\n // different remark -> returns false\n editedAlice = new PatientBuilder(ALICE).withRemark(VALID_REMARK_BOB).build();\n assertFalse(alice.equals(new CsvAdaptedPatient(editedAlice)));\n }", "@Override\n public boolean equals(Object that) {\n if (this == that) {\n return true;\n }\n if (that == null) {\n return false;\n }\n if (getClass() != that.getClass()) {\n return false;\n }\n BCGlobalProps other = (BCGlobalProps) that;\n return (this.getLogUuid() == null ? other.getLogUuid() == null : this.getLogUuid().equals(other.getLogUuid()))\n && (this.getBversion() == null ? other.getBversion() == null : this.getBversion().equals(other.getBversion()))\n && (this.getBlockHeight() == null ? other.getBlockHeight() == null : this.getBlockHeight().equals(other.getBlockHeight()))\n && (this.getPropKey() == null ? other.getPropKey() == null : this.getPropKey().equals(other.getPropKey()))\n && (this.getPropValue() == null ? other.getPropValue() == null : this.getPropValue().equals(other.getPropValue()))\n && (this.getMptType() == null ? other.getMptType() == null : this.getMptType().equals(other.getMptType()))\n && (this.getHashValue() == null ? other.getHashValue() == null : this.getHashValue().equals(other.getHashValue()))\n && (this.getTxid() == null ? other.getTxid() == null : this.getTxid().equals(other.getTxid()))\n && (this.getPrevHashValue() == null ? other.getPrevHashValue() == null : this.getPrevHashValue().equals(other.getPrevHashValue()))\n && (this.getPrevBlockHeight() == null ? other.getPrevBlockHeight() == null : this.getPrevBlockHeight().equals(other.getPrevBlockHeight()))\n && (this.getCreateTime() == null ? other.getCreateTime() == null : this.getCreateTime().equals(other.getCreateTime()))\n && (this.getUpdateTime() == null ? other.getUpdateTime() == null : this.getUpdateTime().equals(other.getUpdateTime()));\n }", "@Test\n\tpublic void test_equals1() {\n\tTvShow t1 = new TvShow(\"Sherlock\",\"BBC\");\n\tTvShow t2 = new TvShow(\"Sherlock\",\"BBC\");\n\tassertTrue(t1.equals(t2));\n }", "public boolean equals(Object other) {\r\n if (other == null || !(other instanceof BsMemberAddress)) { return false; }\r\n BsMemberAddress otherEntity = (BsMemberAddress)other;\r\n if (!xSV(getMemberAddressId(), otherEntity.getMemberAddressId())) { return false; }\r\n return true;\r\n }", "@Test\n public void testEquals02() {\n System.out.println(\"equals\");\n Object otherObject = new SocialNetwork();\n boolean result = sn10.equals(otherObject);\n assertFalse(result);\n }", "@Override\n\tpublic boolean equals(Object obj) {\n\t\tif(obj!=null && obj instanceof Test1){\n\t\t\tTest1 obj2 = (Test1)obj;\n\t\t\tif(x==obj2.x && y==obj2.y){\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\t\treturn false;\n\t}", "public boolean equals(DetonationPdu rhs)\n {\n boolean ivarsEqual = true;\n\n if(rhs.getClass() != this.getClass())\n return false;\n\n if( ! (munitionID.equals( rhs.munitionID) )) ivarsEqual = false;\n if( ! (eventID.equals( rhs.eventID) )) ivarsEqual = false;\n if( ! (velocity.equals( rhs.velocity) )) ivarsEqual = false;\n if( ! (locationInWorldCoordinates.equals( rhs.locationInWorldCoordinates) )) ivarsEqual = false;\n if( ! (burstDescriptor.equals( rhs.burstDescriptor) )) ivarsEqual = false;\n if( ! (detonationResult == rhs.detonationResult)) ivarsEqual = false;\n if( ! (numberOfArticulationParameters == rhs.numberOfArticulationParameters)) ivarsEqual = false;\n if( ! (pad == rhs.pad)) ivarsEqual = false;\n\n for(int idx = 0; idx < articulationParameters.size(); idx++)\n {\n ArticulationParameter x = (ArticulationParameter)articulationParameters.get(idx);\n if( ! ( articulationParameters.get(idx).equals(rhs.articulationParameters.get(idx)))) ivarsEqual = false;\n }\n\n\n return ivarsEqual;\n }", "public boolean isEqual(Object objectname1, Object objectname2, Class<?> voClass) {\n\t\treturn false;\n\t}", "@Override\n public abstract boolean equals(Object obj);", "@Test\n public void testEquals() {\n System.out.println(\"equals\");\n Setting s = Setting.factory();\n Setting s1 = Setting.factory();\n Setting s2 = Setting.factory();\n Setting s3 = Setting.getSetting(\"test1\");\n Setting s4 = Setting.getSetting(\"test1\");\n\n Object o = null;\n Setting instance = s;\n assertFalse(s.equals(o));\n o = new Object();\n assertFalse(s.equals(o));\n assertFalse(s.equals(s1));\n assertEquals(s3, s4);\n // TODO review the generated test code and remove the default call to fail.\n fail(\"The test case is a prototype. need more tests\");\n }", "@Override\n public boolean equals(Object o)\n {\n boolean answer = false;\n if (o instanceof VariableNode)\n {\n VariableNode other = (VariableNode) o;\n if (this.name.equals(other.name)) answer = true;\n }\n return answer;\n }", "@Override\n\tpublic abstract boolean equals(Object other);", "@Test\n\tpublic void test_equals1() {\n\tTennisPlayer c1 = new TennisPlayer(11,\"Joe Tsonga\");\n\tTennisPlayer c2 = new TennisPlayer(11,\"Joe Tsonga\");\n\tassertTrue(c1.equals(c2));\n }", "@Override\n protected boolean doEquals(Object obj) {\n if (obj instanceof BsProject) {\n BsProject other = (BsProject)obj;\n if (!xSV(_projectId, other._projectId)) { return false; }\n return true;\n } else {\n return false;\n }\n }", "@Override\n public boolean equals(final Object obj)\n {\n return this == obj;\n /*\n if (this == obj)\n {\n return true;\n }\n if (!(obj instanceof Month))\n {\n return false;\n }\n final Month other = (Month)obj;\n return false; // this.month == other.month;\n */\n }", "@Override\n public boolean equals(Object object) {\n if (!(object instanceof MemMemberShipMaster)) {\n return false;\n }\n MemMemberShipMaster other = (MemMemberShipMaster) object;\n if ((this.nMemberID == null && other.nMemberID != null) || (this.nMemberID != null && !this.nMemberID.equals(other.nMemberID))) {\n return false;\n }\n return true;\n }", "@Override\n public boolean equals(Object o) \n {\n if (o == null) return false;\n if (o instanceof Person) {\n Person p = (Person)o;\n return (vorname.equals(p.vorname) && nachname.equals(p.nachname));\n } else\n return false;\n }", "@Override\n public boolean equals(Object other) {\n /* Check this and other refer to the same object */\n if (this == other) {\n return true;\n }\n\n /* Check other is Person and not null */\n if (!(other instanceof Person)) {\n return false;\n }\n\n Person person = (Person) other;\n\n /* Compare all required fields */\n return age == person.age &&\n Objects.equals(firstName, person.firstName) &&\n Objects.equals(lastName, person.lastName);\n }", "@Test\n public void testEquals() {\n\tLoadCategoriesForm obj = new LoadCategoriesForm();\n\tobj.setLoadCategory(new LoadCategories());\n\tLoadCategoriesForm instance = new LoadCategoriesForm();\n\tinstance.setLoadCategory(new LoadCategories());\n\tboolean expResult = true;\n\tboolean result = instance.equals(obj);\n\tassertEquals(expResult, result);\n }", "public void testEquals() throws Exception {\n State state1 = new State();\n state1.setCanJump(1);\n state1.setDirection(1);\n state1.setGotHit(1);\n state1.setHeight(1);\n state1.setMarioMode(1);\n state1.setOnGround(1);\n state1.setEnemiesSmall(new boolean[3]);\n state1.setObstacles(new boolean[4]);\n state1.setDistance(1);\n state1.setStuck(1);\n\n State state2 = new State();\n state2.setCanJump(1);\n state2.setDirection(1);\n state2.setGotHit(1);\n state2.setHeight(1);\n state2.setMarioMode(1);\n state2.setOnGround(1);\n state2.setEnemiesSmall(new boolean[3]);\n state2.setObstacles(new boolean[4]);\n state2.setStuck(1);\n\n State state3 = new State();\n state3.setCanJump(1);\n state3.setDirection(1);\n state3.setGotHit(1);\n state3.setHeight(1);\n state3.setMarioMode(2);\n state3.setOnGround(1);\n state3.setEnemiesSmall(new boolean[3]);\n state3.setObstacles(new boolean[4]);\n assertEquals(state1,state2);\n assertTrue(state1.equals(state2));\n assertFalse(state1.equals(state3));\n Set<State> qTable = new HashSet<State>();\n qTable.add(state1);\n qTable.add(state2);\n assertEquals(1,qTable.size());\n qTable.add(state3);\n assertEquals(2,qTable.size());\n\n }", "public void testEquals(PCEPObject object1, PCEPObject object2) {\n \tInteger test1=new Integer(2);\n\t\tobject1.equals(test1);\n \t//Test same object\n \tobject1.equals(object1);\n \t//Test change in parent\n \tobject2.setObjectClass(object1.getObjectClass()+1);\n \tobject1.equals(object2);\n \tobject2.setObjectClass(object1.getObjectClass());\n \t//Test changes in fields\n\t\tList<Field> fieldListNS = new ArrayList<Field>();\n\t\tList<Field> fieldList= Arrays.asList(object1.getClass().getDeclaredFields());\n\t\tfor (Field field : fieldList) {\n\t\t\tfieldListNS.add(field);\n\t\t\tType ty=field.getGenericType();\n\t\t\tif (!java.lang.reflect.Modifier.isStatic(field.getModifiers())) {\n\t\t\t\tif (ty instanceof Class){\n\t\t\t\t\tClass c =(Class)ty;\n\t\t\t\t\tSystem.out.println(\"XXXXXXXXXXXXXXXXXClass name: \"+c.getName()); \n\t\t\t\t\tMethod method;\n\t\t\t\t\tMethod methods;\n\t\t\t\t\tif (c.isPrimitive()){\n\t\t\t\t\ttry {\n\t\t\t\t\t\tif (c.getName().equals(\"boolean\")) {\n\t\t\t\t\t\t\tmethod = object1.getClass().getMethod(\"is\"+field.getName().replaceFirst(field.getName().substring(0, 1), field.getName().substring(0, 1).toUpperCase()));\n\t\t\t\t\t\t\tmethods = object2.getClass().getMethod(\"set\"+field.getName().replaceFirst(field.getName().substring(0, 1), field.getName().substring(0, 1).toUpperCase()),boolean.class);\n\t\t\t\t\t\t\tif (((boolean)method.invoke(object1,null))==true) {\n\t\t\t\t\t\t\t\tmethods.invoke(object2,false);\n\t\t\t\n\t\t\t\t\t\t\t}else {\n\t\t\t\t\t\t\t\tmethods.invoke(object2,true);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tobject1.equals(object2);\n\t\t\t\t\t\t\tmethods.invoke(object2,(boolean)method.invoke(object1,null));\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse {\n\t\t\t\t\t\t\tmethod = object1.getClass().getMethod(\"get\"+field.getName().replaceFirst(field.getName().substring(0, 1), field.getName().substring(0, 1).toUpperCase()));\n\t\t\t\t\t\t\tmethods = object2.getClass().getMethod(\"set\"+field.getName().replaceFirst(field.getName().substring(0, 1), field.getName().substring(0, 1).toUpperCase()),c);\n\t\t\t\t\t\t\tmethods.invoke(object2,77);\n\t\t\t\t\t\t\tobject1.equals(object2);\n\t\t\t\t\t\t\tmethods.invoke(object2,method.invoke(object1,null));\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t} 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}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n \t\n }", "@Test\n public void testEquals() {\n\tSystem.out.println(\"equals\");\n\tObject obj = null;\n\tJenkinsBuild instance = new JenkinsBuild();\n\tboolean expResult = false;\n\tboolean result = instance.equals(obj);\n\tassertEquals(expResult, result);\n\tJenkinsBuild newObj = new JenkinsBuild();\n\tnewObj.setBuildNumber(0);\n\tnewObj.setSystemLoadId(\"\");\n\tnewObj.setJobName(\"\");\n\tassertEquals(expResult, instance.equals(newObj));\n }", "public boolean equals(Object obj) {\n if(obj == null) return false;\n if(!(obj instanceof JFMViewRepresentation)) return false;\n JFMViewRepresentation viewObj = (JFMViewRepresentation)obj;\n //if any of the members are null, return false\n if(this.getName() == null || this.getClassName() == null) return false;\n if(viewObj.getName() == null || viewObj.getClassName() == null) return false; \n if(!getName().equals(viewObj.getName())) return false;\n if(!getClassName().equals(viewObj.getClassName())) return false;\n return true;\n }", "@Override\n boolean equals(Object obj);", "@Override\n\tpublic boolean equal() {\n\t\treturn false;\n\t}", "boolean equalProps(InstanceProperties props) {\n String propsName = props.getString(PROPERTY_NAME, null);\n return propsName != null\n ? propsName.equals(name)\n : name == null;\n }", "@Override\n public boolean equals(Object obj) {\n \n //TODO: Complete Method\n \n return true;\n }", "public boolean equals(Personnel p){\nreturn numPers.equals(p.numPers);\n}", "@Test\n public void testEquals_2()\n throws Exception {\n Project fixture = new Project();\n fixture.setWorkloadNames(\"\");\n fixture.setName(\"\");\n fixture.setScriptDriver(ScriptDriver.SilkPerformer);\n fixture.setWorkloads(new LinkedList());\n fixture.setComments(\"\");\n fixture.setProductName(\"\");\n Object obj = new Project();\n\n boolean result = fixture.equals(obj);\n\n assertEquals(true, result);\n }", "public boolean equals(Object o) {\r\n\t\tif (!(o instanceof IValuedField)) return false; //get rid of non fields\r\n\t\tIValuedField field= (IValuedField)o;\r\n\t\tboolean areEqual = type.equals(field.getType());//same type \r\n\t\tif (formal){\r\n\t\t\treturn (areEqual && field.isFormal());\r\n\t\t} else //the current field is actual\r\n\t\t\tif (((IValuedField) field).isFormal()) { //if the other is formal\r\n\t\t\t\treturn false;\r\n\t\t\t} else //if they're both actual then their values must match\r\n\t\t\t{\r\n\t\t\t\tif (varname != null) // there is a variable name\r\n\t\t\t\t\t{\r\n\t\t\t\t\tif (!(o instanceof NameValueField))\r\n\t\t\t\t\t\treturn false;\r\n\t\t\t\t\telse //check that names match\r\n\t\t\t\t\t\tareEqual = (areEqual && (varname.equals(((NameValueField)field).getVarName())));\r\n\t\t\t\t\t}\r\n\t\t\t\treturn areEqual && value.equals(field.getValue()); //values are the same\r\n\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\t\r\n\t\t\r\n\t\t\t\t\r\n\t\t\r\n\t}", "@Override\n public final boolean equals(final Object other) {\n return super.equals(other);\n }", "@Override\n public boolean equals(Object other) {\n if (other.getClass() == getClass()) {\n return hashCode() == other.hashCode();\n }\n\n return false;\n }", "@Test\n public void equals() throws Exception {\n SmartPlayer x = new SmartPlayer(0, 0);\n SmartPlayer y = new SmartPlayer(0, 0);\n assertTrue(x.equals(y));\n }", "@Override\n public boolean equals(Object o) {\n return true;\n }", "@Test\r\n public void testEquals() {\r\n System.out.println(\"equals\");\r\n Object obj = null;\r\n RevisorParentesis instance = null;\r\n boolean expResult = false;\r\n boolean result = instance.equals(obj);\r\n assertEquals(expResult, result);\r\n // TODO review the generated test code and remove the default call to fail.\r\n fail(\"The test case is a prototype.\");\r\n }", "@Override\n public abstract boolean equals(Object other);", "@Override\n public abstract boolean equals(Object other);", "@Test\n\tpublic void testEquals2() {\n\t\tDistance d2 = new Distance();\n\t\tDistance d4 = new Distance(1, 1);\n\t\tassertEquals(true, d2.equals(d4));\n\t}", "public boolean equals(Object obj) {\r\n\t\t\r\n if (obj == null || getClass() != obj.getClass()) {\r\n return false;\r\n }\r\n\t\t\r\n \r\n\t\telse if ( this == obj) {\r\n return true;\r\n }\r\n try {\r\n\t final Forward other = (Forward) obj;\r\n\t \r\n\t if (this.name != null || other.name != null )\r\n\t \t if (!this.name.equals(other.name))\r\n\t \t\t return false;\r\n\t \t\r\n\t if ( this.countryName != null || other.countryName != null )\t\r\n\t \t if (!this.countryName.equals(other.countryName))\r\n\t \t\t return false;\r\n\t \r\n\t if(this.clubName != null || other.clubName != null)\r\n\t \t if(!this.clubName.equals(other.clubName))\r\n\t \t return false;\r\n\t \r\n\t \r\n\t if (this.numYellowCards != other.numYellowCards ||this.numRedCards != other.numRedCards || \r\n\t \tthis.gamesPlayed != other.gamesPlayed) {\r\n\t \t return false;\r\n\t }\r\n\t \r\n\r\n\t if (this.dob != other.dob) {\r\n\t \tif(this.dob.getDay( )!= other.dob.getDay() || this.dob.getMonth( ) != other.dob.getMonth() ||\r\n\t \t this.dob.getYear( ) != other.dob.getYear())\r\n\t \t \r\n\t \t\treturn false;\r\n\t\t } \r\n\t \r\n\t //forward\r\n\t\t if (this.goalsScored != other.goalsScored) {\r\n\t\t \treturn false;\r\n\t\t }\r\n\t\t \r\n\t\t if (this.numAssists != other.numAssists) {\r\n\t\t \treturn false;\r\n\t\t }\r\n\t\t \r\n\t\t if (this.shotsOnTarget != other.shotsOnTarget) {\r\n\t\t \treturn false;\r\n\t\t }\r\n\t\t \r\n\t } catch (NullPointerException e) {\r\n \t return false;\r\n }\r\n \r\n\t \r\n\t\t\treturn true;\r\n\t\t\t\r\n\t\t}", "@Test\r\n public void testEquals() {\r\n Articulo art = new Articulo();\r\n articuloPrueba.setCodigo(1212);\r\n art.setCodigo(1212);\r\n boolean expResult = true;\r\n boolean result = articuloPrueba.equals(art);\r\n assertEquals(expResult, result);\r\n }", "public abstract boolean equals(Object other);", "public boolean mojeEquals(Obj o1, Obj o2) {\r\n\t\t//System.out.println(o1.getName() + \" \" + o2.getName());\r\n\t\tboolean sameRight = true; // 21.06.2020. provera prava pristupa\r\n\t\tboolean sameName = true;\t// 22.06.2020. ako nisu metode ne moraju da imaju isto ime\r\n\t\tboolean sameArrayType = true; //22.6.2020 ako je parametar niz mora isti tip niza da bude\r\n\t\t\r\n\t\tif (o1.getKind() == Obj.Meth && o2.getKind() == Obj.Meth) {\r\n\t\t\tsameRight = o1.getFpPos() == o2.getFpPos()+10; \r\n\t\t\tsameName = o1.getName().equals(o2.getName());\r\n\t\t}\r\n\t\telse {\r\n\t\t\tif (o1.getType().getKind() == Struct.Array && o2.getType().getKind() == Struct.Array) {\r\n\t\t\t\tif (!(o1.getType().getElemType() == o2.getType().getElemType())) { // ZA KLASE MOZDA TREBA equals\r\n\t\t\t\t\tsameArrayType = false;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\t// 16.08.2020.\r\n//\t\tif (o1.getType().getKind() == Struct.Class || o1.getType().getKind() == Struct.Interface)\r\n//\t\t\treturn true;\r\n\t\t\r\n\t\t\r\n\t\treturn o1.getKind() == o2.getKind() \r\n\t\t\t\t&& sameName\r\n\t\t\t\t&& o1.getType().equals(o2.getType())\r\n\t\t\t\t&& /*adr == other.adr*/ o1.getLevel() == o2.getLevel()\r\n\t\t\t\t&& equalsCompleteHash(o1.getLocalSymbols(), o2.getLocalSymbols())\r\n\t\t\t\t&& sameRight // 21.06.2020. provera prava pristupa\r\n\t\t\t\t&& sameArrayType; //22.6.2020 ako je parametar niz mora isti tip niza da bude\r\n\t}", "@Override\n public boolean equals(Object o) {\n if (o instanceof TestElementProperty) {\n if (this == o) {\n return true;\n }\n if (value != null) {\n return value.equals(((JMeterProperty) o).getObjectValue());\n }\n }\n return false;\n }", "public boolean isEqual(Stack msg, Object obj) {\n if (!(obj instanceof ConstNameAndType)) {\n msg.push(\"obj/obj.getClass() = \"\n + (obj == null ? null : obj.getClass()));\n msg.push(\"this.getClass() = \"\n + this.getClass());\n return false;\n }\n ConstNameAndType other = (ConstNameAndType)obj;\n\n if (!super.isEqual(msg, other)) {\n return false;\n }\n\n if (!this.theName.isEqual(msg, other.theName)) {\n msg.push(String.valueOf(\"theName = \"\n + other.theName));\n msg.push(String.valueOf(\"theName = \"\n + this.theName));\n return false;\n }\n if (!this.typeSignature.isEqual(msg, other.typeSignature)) {\n msg.push(String.valueOf(\"typeSignature = \"\n + other.typeSignature));\n msg.push(String.valueOf(\"typeSignature = \"\n + this.typeSignature));\n return false;\n }\n return true;\n }", "public boolean equals(Object o) {\r\n\t\t// TODO and replace return false with the appropriate code.\r\n\t\tif (o == null || o.getClass() != this.getClass())\r\n\t\t\treturn false;\r\n\t\tProperty p = (Property) o;\r\n\t\treturn Arrays.deepEquals(p.positive, this.positive)\r\n\t\t\t\t&& Arrays.deepEquals(p.negative, this.negative)\r\n\t\t\t\t&& Arrays.deepEquals(p.stop, this.stop)\r\n\t\t\t\t&& p.scoringmethod == this.scoringmethod\r\n\t\t\t\t&& Math.abs(p.mindistance - this.mindistance) < 0.000001;\r\n\t}", "@Test\n public void testEquals_4()\n throws Exception {\n ColumnPreferences fixture = new ColumnPreferences(\"\", \"\", 1, ColumnPreferences.Visibility.HIDDEN, ColumnPreferences.Hidability.HIDABLE);\n fixture.setVisible(true);\n Object obj = new ColumnPreferences(\"\", \"\", 1, ColumnPreferences.Visibility.HIDDEN, ColumnPreferences.Hidability.HIDABLE);\n\n boolean result = fixture.equals(obj);\n\n assertEquals(true, result);\n }", "@Override\r\n\tpublic boolean equals(Object obj) {\r\n\t\tif( !(obj instanceof Person ) ) {\r\n\t\t\treturn false;\r\n\t\t}\r\n\t\t\r\n\t\tPerson p2 = (Person) obj;\r\n\t\treturn vorname.equals(p2.vorname) && nachname.equals(p2.nachname);\r\n\t}", "@Test\r\n\tpublic void testEquality(){\n\t\t assertEquals(object1, object2);\r\n\t}", "public boolean equals(ArticulationParameter rhs) {\n boolean ivarsEqual = true;\n\n if (rhs.getClass() != this.getClass()) {\n return false;\n }\n\n if (!(parameterTypeDesignator == rhs.parameterTypeDesignator)) {\n ivarsEqual = false;\n }\n if (!(changeIndicator == rhs.changeIndicator)) {\n ivarsEqual = false;\n }\n if (!(partAttachedTo == rhs.partAttachedTo)) {\n ivarsEqual = false;\n }\n if (!(parameterType == rhs.parameterType)) {\n ivarsEqual = false;\n }\n if (!(parameterValue == rhs.parameterValue)) {\n ivarsEqual = false;\n }\n\n return ivarsEqual;\n }", "@Override\n public final boolean equals( Object obj ) {\n return super.equals(obj);\n }", "@Override\n boolean equals(Object other);", "@Override\n public boolean equals(Object o) {\n if (o instanceof AccessSymbol) {\n AccessSymbol other = (AccessSymbol)o;\n return (base.equals(other.base) && member.equals(other.member));\n } else {\n return false;\n }\n }", "@Override\n public boolean equals(Object other) {\n return super.equals(other);\n }", "@Test\n public void equals_trulyEqual() {\n SiteInfo si1 = new SiteInfo(\n Amount.valueOf(12000, SiteInfo.CUBIC_FOOT),\n Amount.valueOf(76, NonSI.FAHRENHEIT),\n Amount.valueOf(92, NonSI.FAHRENHEIT),\n Amount.valueOf(100, NonSI.FAHRENHEIT),\n Amount.valueOf(100, NonSI.FAHRENHEIT),\n 56,\n Damage.CLASS2,\n Country.USA,\n \"Default Site\"\n );\n SiteInfo si2 = new SiteInfo(\n Amount.valueOf(12000, SiteInfo.CUBIC_FOOT),\n Amount.valueOf(76, NonSI.FAHRENHEIT),\n Amount.valueOf(92, NonSI.FAHRENHEIT),\n Amount.valueOf(100, NonSI.FAHRENHEIT),\n Amount.valueOf(100, NonSI.FAHRENHEIT),\n 56,\n Damage.CLASS2,\n Country.USA,\n \"Default Site\"\n );\n\n Assert.assertEquals(si1, si2);\n }", "private boolean equalKeys(Object other) {\n if (this==other) {\n return true;\n }\n if (!(other instanceof Sanpham)) {\n return false;\n }\n Sanpham that = (Sanpham) other;\n Object myMasp = this.getMasp();\n Object yourMasp = that.getMasp();\n if (myMasp==null ? yourMasp!=null : !myMasp.equals(yourMasp)) {\n return false;\n }\n return true;\n }", "public abstract boolean equals(Object o);", "public boolean equals(Object obj)\n {\n if (!super.equals(obj))\n return false;\n\n PSSearchField s2 = (PSSearchField) obj;\n\n return m_strDescription.equals(s2.m_strDescription)\n && m_strDisplayName.equals(s2.m_strDisplayName)\n && m_mnemonic.equals(s2.getMnemonic())\n && m_strFieldType.equals(s2.m_strFieldType)\n && m_strFieldName.equals(s2.m_strFieldName)\n && m_values.equals(s2.m_values)\n && m_strOperator.equals(s2.m_strOperator)\n && m_extOperator.equals(s2.m_extOperator)\n && m_sequence == s2.m_sequence\n && compare(m_choices, s2.m_choices);\n }", "@Test\n\tpublic void testEqualsObject_True() {\n\t\tbook3 = new Book(DEFAULT_TITLE, DEFAULT_AUTHOR, DEFAULT_YEAR, DEFAULT_ISBN);\n\t\tassertEquals(book1, book3);\n\t}", "@Test\n public void testEquals_2()\n throws Exception {\n ColumnPreferences fixture = new ColumnPreferences(\"\", \"\", 1, ColumnPreferences.Visibility.HIDDEN, ColumnPreferences.Hidability.HIDABLE);\n fixture.setVisible(true);\n Object obj = new Object();\n\n boolean result = fixture.equals(obj);\n\n assertEquals(false, result);\n }", "@Override\n public abstract boolean equals(Object abc);", "public boolean equals( Object other ) {\n if ( super.equals( other ) && ( other instanceof Point ) ) {\n \tPoint p = (Point)other;\n boolean flagEq = Math.abs( getX() - p.getX() ) < mute &&\n \t \t\t\t Math.abs( getY() - p.getY() ) < mute;\n if ( getCoordinateDimension() == 3 ) {\n \tflagEq = flagEq && Math.abs( getZ() - p.getZ() ) < mute;\n }\n return flagEq;\n }\n\n return false;\n }", "@Test\n public void equals() {\n assertTrue(defaultGuiSettings.equals(defaultGuiSettings));\n assertTrue(userGuiSettings.equals(userGuiSettings));\n\n // same values -> return true\n assertTrue(defaultGuiSettings.equals(new GuiSettings()));\n assertTrue(userGuiSettings.equals(new GuiSettings(700, 900, 200, 300)));\n\n // null -> false\n assertFalse(defaultGuiSettings.equals(null));\n assertFalse(userGuiSettings.equals(null));\n\n // different type -> false\n assertFalse(defaultGuiSettings.equals(0.5f));\n assertFalse(userGuiSettings.equals(0.5f));\n\n // different window width -> false\n GuiSettings guiSettingsDifferentWindowWith = new GuiSettings(1234, 1234, 12, 34);\n assertFalse(userGuiSettings.equals(guiSettingsDifferentWindowWith));\n\n // different window coordinates -> false\n GuiSettings guiSettingsDifferentWindowCoordinate = new GuiSettings(700, 900, 20, 30);\n assertFalse(userGuiSettings.equals(guiSettingsDifferentWindowCoordinate));\n }" ]
[ "0.6663968", "0.6592529", "0.64728475", "0.62925506", "0.6273526", "0.62590164", "0.6174743", "0.6151963", "0.61312556", "0.6120565", "0.610936", "0.6085546", "0.60825276", "0.607657", "0.60632473", "0.6057842", "0.60481876", "0.604152", "0.604139", "0.60390526", "0.60205936", "0.60106736", "0.60083115", "0.6004956", "0.59564453", "0.5950569", "0.5949191", "0.59471816", "0.5939862", "0.59357196", "0.59288293", "0.5925818", "0.59172994", "0.59063256", "0.58925813", "0.5889466", "0.58893436", "0.5886857", "0.5885199", "0.5883786", "0.58835787", "0.5879703", "0.5877447", "0.587542", "0.58712953", "0.5862608", "0.5861821", "0.5858642", "0.5851575", "0.5851055", "0.5843606", "0.5842626", "0.5841746", "0.5840304", "0.5839434", "0.5837604", "0.583693", "0.58346266", "0.5831647", "0.5828903", "0.58277845", "0.5826615", "0.5822121", "0.5814829", "0.5813035", "0.581268", "0.5805323", "0.57969373", "0.5791743", "0.57907265", "0.5785765", "0.5785107", "0.5780989", "0.5779164", "0.5774921", "0.5774921", "0.5769361", "0.57674617", "0.57662284", "0.5765537", "0.5765411", "0.57644314", "0.57611144", "0.57606107", "0.575251", "0.5749258", "0.57484365", "0.57470286", "0.57424533", "0.5738095", "0.57377285", "0.57288074", "0.5727745", "0.5719038", "0.57176095", "0.571319", "0.5711334", "0.5708563", "0.57062805", "0.57049465", "0.5704903" ]
0.0
-1
Generate a hashcode for the object using member fields.
@Override public int hashCode() { int result = stockSymbol != null ? stockSymbol.hashCode() : 0; result = 31 * result + (lastDividend != null ? lastDividend.hashCode() : 0); result = 31 * result + (parValue != null ? parValue.hashCode() : 0); result = 31 * result + (stockPrice != null ? stockPrice.hashCode() : 0); return result; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static int calculateHash(final Field field) {\n int hash = 17;\n hash = (37 * hash) + field.getName().hashCode();\n Class type = field.getType();\n hash = (37 * hash) + type.getName().hashCode();\n return hash;\n }", "@Override\n public int hashCode() {\n \tif (member == null) {\n \t\treturn base.hashCode();\n \t}\n return (base.hashCode() ^ member.hashCode());\n }", "protected int computeHashCode() {\n return flags * 17\n + (var != null ? var.hashCode() : 0)\n + (num != null ? num.hashCode() : 0)\n + (str != null ? str.hashCode() : 0)\n + (object_labels != null ? object_labels.hashCode() : 0)\n + (getters != null ? getters.hashCode() : 0)\n + (setters != null ? setters.hashCode() : 0)\n + (excluded_strings != null ? excluded_strings.hashCode() : 0)\n + (included_strings != null ? included_strings.hashCode() : 0)\n + (functionPartitions != null ? functionPartitions.hashCode() : 0)\n + (functionTypeSignatures != null ? functionTypeSignatures.hashCode() : 0);\n }", "public int generateHashCode() {\n int code = getClass().hashCode();\n ASTSpanInfo temp_info = getInfo();\n code ^= temp_info.hashCode();\n LHS temp_obj = getObj();\n code ^= temp_obj.hashCode();\n Expr temp_index = getIndex();\n code ^= temp_index.hashCode();\n return code;\n }", "public int hashCode() {\r\n int result = 17;\r\n result = xCH(result, getTableDbName());\r\n result = xCH(result, getMemberAddressId());\r\n return result;\r\n }", "public int generateHashCode() {\n int code = getClass().hashCode();\n boolean temp_fromSource = isFromSource();\n code ^= temp_fromSource ? 1231 : 1237;\n IRId temp_name = getName();\n code ^= temp_name.hashCode();\n List<IRId> temp_params = getParams();\n code ^= temp_params.hashCode();\n List<IRStmt> temp_args = getArgs();\n code ^= temp_args.hashCode();\n List<IRFunDecl> temp_fds = getFds();\n code ^= temp_fds.hashCode();\n List<IRVarStmt> temp_vds = getVds();\n code ^= temp_vds.hashCode();\n List<IRStmt> temp_body = getBody();\n code ^= temp_body.hashCode();\n return code;\n }", "@Override\n public int hashCode() {\n return Objects.hash(field);\n }", "@Override\n\tpublic int hashCode() {\n\t\t\n\t\treturn (int)id * name.hashCode() * email.hashCode();\n\t\t//int hash = new HashCodeBuilder(17,37).append(id).append(name); //can be added from Apache Commons Lang's HashCodeBuilder class\n\t}", "private int local_hashCode() {\n return _field != null ? _field.hashCode() : 0x31337;\n }", "@Override\n public int hashCode() {\n int hash = 7;\n hash = 29 * hash + Objects.hashCode(this.id);\n hash = 29 * hash + Objects.hashCode(this.name);\n return hash;\n }", "@Override\n public int hashCode() {\n return new HashCodeBuilder(17, 37)\n .append(getName())\n .append(getType())\n .toHashCode();\n }", "public int hashCode() {\n int result = 1;\n Object $pageSize = this.getPageSize();\n result = result * 59 + ($pageSize == null ? 43 : $pageSize.hashCode());\n Object $pageNo = this.getPageNo();\n result = result * 59 + ($pageNo == null ? 43 : $pageNo.hashCode());\n Object $sort = this.getSort();\n result = result * 59 + ($sort == null ? 43 : $sort.hashCode());\n Object $orderByField = this.getOrderByField();\n result = result * 59 + ($orderByField == null ? 43 : $orderByField.hashCode());\n return result;\n }", "public int hashcode();", "public int hashCode() {\n final int HASH_MULTIPLIER = 29;\n int h = HASH_MULTIPLIER * FName.hashCode() + LName.hashCode();\n h = HASH_MULTIPLIER * h + ((Integer)ID).hashCode();\n return h;\n }", "@Override\n public int hashCode() {\n int hash = 7;\n hash = 29 * hash + Objects.hashCode(this.firstName);\n hash = 29 * hash + Objects.hashCode(this.lastName);\n hash = 29 * hash + this.studentNumber;\n return hash;\n }", "@Override\n public int hashCode() {\n int hash = 17;\n hash = 31 * hash + month;\n hash = 31 * hash + day;\n hash = 31 * hash + year;\n return hash;\n }", "@Override\n public int hashCode()\n {\n return new HashCodeBuilder(17, 31).\n append(_name).\n toHashCode();\n }", "public int hashCode()\r\n {\r\n int hash = super.hashCode();\r\n hash ^= hashValue( m_name );\r\n hash ^= hashValue( m_classname );\r\n if( m_implicit )\r\n {\r\n hash ^= 35;\r\n }\r\n hash ^= hashValue( m_production );\r\n hash ^= hashArray( m_dependencies );\r\n hash ^= hashArray( m_inputs );\r\n hash ^= hashArray( m_validators );\r\n hash ^= hashValue( m_data );\r\n return hash;\r\n }", "final int hash(E object)\n {\n // Spread bits to regularize both segment and index locations,\n // using variant of single-word Wang/Jenkins hash.\n int h = object.hashCode();\n h += (h << 15) ^ 0xffffcd7d;\n h ^= (h >>> 10);\n h += (h << 3);\n h ^= (h >>> 6);\n h += (h << 2) + (h << 14);\n h = h ^ (h >>> 16);\n return h;\n }", "@Override\r\n\tpublic int hashCode() {\n\t\tint result = 17;\r\n\t\tresult = 37*result+(int) (id ^ (id>>>32));\r\n\t\t//result = 37*result+(name==null?0:name.hashCode());\r\n\t\t//result = 37*result+displayOrder;\r\n\t\t//result = 37*result+(this.url==null?0:url.hashCode());\r\n\t\treturn result;\r\n\t}", "public int hashCode() {\n\t\t// simple recipe for generating hashCode given by\n\t\t// Effective Java (Addison-Wesley, 2001)\n\t\tint result = 17;\n\t\tresult = 37 * result + methodName.hashCode();\n\t\treturn result;\n\t}", "public int hashCode() {\n return (name.ordinal() + 5) * 51;\n }", "@Override\n public int hashCode() {\n // name's hashCode is multiplied by an arbitrary prime number (13)\n // in order to make sure there is a difference in the hashCode between\n // these two parameters:\n // name: a value: aa\n // name: aa value: a\n return key.hashCode() * 13 + (value == null ? 0 : value.hashCode());\n }", "@Override\n public int hashCode() {\n // Declare hash and assign value\n int hash = 7;\n // Generate hash integer\n hash = 31 * hash + (int) this.getCrossingTime();\n hash = 31 * hash + (this.getName() == null ? 0 : this.getName().hashCode());\n return hash;\n }", "public static int defaultHashCode(DataValue obj) {\r\n final int prime = 31;\r\n int result = 1;\r\n result = prime * result + obj.getName().hashCode();\r\n if (obj.getObject() == null) {\r\n result = prime * result;\r\n } else if (obj.getObject().getClass().isArray()) {\r\n result = prime * result + Arrays.hashCode((byte[]) obj.getObject());\r\n } else {\r\n result = prime * result + obj.getObject().hashCode();\r\n }\r\n return result;\r\n }", "@Override\r\n public int hashCode() {\n return 37 * (37 * (37 * 23 \r\n + typeVariable.getName().hashCode()) \r\n + typeVariable.getGenericDeclaration().hashCode())\r\n + base.hashCode();\r\n }", "public String getHashCode();", "public int hashCode() {\n int hash = 104473;\n if (token_ != null) {\n // Obtain unencrypted form as common base for comparison\n byte[] tkn = getToken();\n for (int i=0; i<tkn.length; i++)\n hash ^= (int)tkn[i];\n }\n hash ^= (type_ ^ 14401);\n hash ^= (timeoutInterval_ ^ 21327);\n hash ^= (isPrivate() ? 15501 : 12003);\n if (getPrincipal() != null)\n hash ^= getPrincipal().hashCode();\n if (getSystem() != null)\n hash ^= getSystem().getSystemName().hashCode();\n return hash;\n }", "public int hashCode() {\n long hash = UtilConstants.HASH_INITIAL;\n hash = hash * UtilConstants.HASH_PRIME + objectHashCode(getProjectName());\n hash = hash * UtilConstants.HASH_PRIME + objectHashCodeFK(getDataProvider());\n hash = hash * UtilConstants.HASH_PRIME + objectHashCodeFK(getPrimaryInvestigator());\n hash = hash * UtilConstants.HASH_PRIME + objectHashCodeFK(getCreatedBy());\n hash = hash * UtilConstants.HASH_PRIME + objectHashCode(getCreatedTime());\n return (int)(hash % Integer.MAX_VALUE);\n }", "public int hashCode()\n {\n int nHash = super.hashCode();\n\n StringBuilder buf = new StringBuilder(m_strDescription.toLowerCase()\n + m_strFieldType + m_strFieldName.toLowerCase() + m_strOperator\n + m_sequence + m_extOperator);\n Iterator iter = m_values.iterator();\n while (iter.hasNext())\n {\n buf.append((String) iter.next());\n }\n return nHash + buf.toString().hashCode() + (m_choices != null ?\n m_choices.hashCode() : 0);\n }", "@Override\n public int hashCode() {\n return Objects.hash(name, type, id);\n }", "static int getHash(Object obj) {\n return getHash(new HashSet<Class>(), obj, 0);\n }", "@Override\r\n public int hashCode() {\r\n final int prime = 31;\r\n int result = 1;\r\n result = prime * result + ((getId() == null) ? 0 : getId().hashCode());\r\n result = prime * result + ((getName() == null) ? 0 : getName().hashCode());\r\n result = prime * result + ((getPost() == null) ? 0 : getPost().hashCode());\r\n result = prime * result + ((getWageNumber() == null) ? 0 : getWageNumber().hashCode());\r\n result = prime * result + ((getUuid() == null) ? 0 : getUuid().hashCode());\r\n result = prime * result + ((getToken() == null) ? 0 : getToken().hashCode());\r\n result = prime * result + ((getPassword() == null) ? 0 : getPassword().hashCode());\r\n return result;\r\n }", "public int hashCode() {\n // For speed, this hash code relies only on the hash codes of its select\n // and criteria clauses, not on the from, order by, or option clauses\n int myHash = 0;\n myHash = HashCodeUtil.hashCode(myHash, this.operation);\n myHash = HashCodeUtil.hashCode(myHash, getProjectedQuery());\n return myHash;\n }", "@Override\n public int hashCode() {\n int B = 31, M = 1000000007, code = 0;\n for(int pos = 0; pos < this.objectA.length(); pos++) {\n code = ((this.objectA.charAt(pos) - 'a') + B * code) % M;\n }\n return (code * this.objectB) % M;\n }", "@Override\n\tpublic int hashCode() {\n\t\tfinal int prime = 31;\n\t\tint result = 1;\n\t\tresult = prime * result + ((getId() == null) ? 0 : getId().hashCode());\n\t\tresult = prime * result\n\t\t\t\t+ ((getMemberId() == null) ? 0 : getMemberId().hashCode());\n\t\tresult = prime * result\n\t\t\t\t+ ((getActivityId() == null) ? 0 : getActivityId().hashCode());\n\t\treturn result;\n\t}", "int\thashCode();", "public int hashCode(){\n int hashcode = name == null ? 0 : name.hashCode() / 2;\n return hashcode += ( value == null ? 0 : value.hashCode()/2 );\n }", "@Override public int hashCode() {\r\n int result = 17;\r\n result = 31 * result + fID;\r\n result = 31 * result + fName.hashCode();\r\n return result;\r\n }", "@Override\n public int hashCode() {\n final int prime = 31;\n int result = 1;\n result = prime * result + ((getId() == null) ? 0 : getId().hashCode());\n result = prime * result + ((getUid() == null) ? 0 : getUid().hashCode());\n result = prime * result + ((getName() == null) ? 0 : getName().hashCode());\n result = prime * result + ((getAccount() == null) ? 0 : getAccount().hashCode());\n result = prime * result + ((getModifyTime() == null) ? 0 : getModifyTime().hashCode());\n result = prime * result + ((getCreateTime() == null) ? 0 : getCreateTime().hashCode());\n return result;\n }", "@Override\n public int hashCode() {\n final int prime = 31;\n int result = 1;\n result = prime * result + ((getLogUuid() == null) ? 0 : getLogUuid().hashCode());\n result = prime * result + ((getBversion() == null) ? 0 : getBversion().hashCode());\n result = prime * result + ((getBlockHeight() == null) ? 0 : getBlockHeight().hashCode());\n result = prime * result + ((getPropKey() == null) ? 0 : getPropKey().hashCode());\n result = prime * result + ((getPropValue() == null) ? 0 : getPropValue().hashCode());\n result = prime * result + ((getMptType() == null) ? 0 : getMptType().hashCode());\n result = prime * result + ((getHashValue() == null) ? 0 : getHashValue().hashCode());\n result = prime * result + ((getTxid() == null) ? 0 : getTxid().hashCode());\n result = prime * result + ((getPrevHashValue() == null) ? 0 : getPrevHashValue().hashCode());\n result = prime * result + ((getPrevBlockHeight() == null) ? 0 : getPrevBlockHeight().hashCode());\n result = prime * result + ((getCreateTime() == null) ? 0 : getCreateTime().hashCode());\n result = prime * result + ((getUpdateTime() == null) ? 0 : getUpdateTime().hashCode());\n return result;\n }", "@Override\n public int hashCode() {\n final int prime = 31;\n int result = 1;\n result = prime * result + ((getGid() == null) ? 0 : getGid().hashCode());\n result = prime * result + ((getpObjObjectGid() == null) ? 0 : getpObjObjectGid().hashCode());\n result = prime * result + ((getLayoutName() == null) ? 0 : getLayoutName().hashCode());\n result = prime * result + ((getLayoutType() == null) ? 0 : getLayoutType().hashCode());\n result = prime * result + ((getDf() == null) ? 0 : getDf().hashCode());\n result = prime * result + ((getFields() == null) ? 0 : getFields().hashCode());\n result = prime * result + ((getJsondata() == null) ? 0 : getJsondata().hashCode());\n result = prime * result + ((getCreateBy() == null) ? 0 : getCreateBy().hashCode());\n result = prime * result + ((getCreateTime() == null) ? 0 : getCreateTime().hashCode());\n result = prime * result + ((getUpdateBy() == null) ? 0 : getUpdateBy().hashCode());\n result = prime * result + ((getUpdateTime() == null) ? 0 : getUpdateTime().hashCode());\n result = prime * result + ((getActive() == null) ? 0 : getActive().hashCode());\n result = prime * result + ((getDelete() == null) ? 0 : getDelete().hashCode());\n return result;\n }", "public int hashCode() {\n int hash = UtilConstants.HASH_INITIAL;\n hash = hash * UtilConstants.HASH_PRIME + (userId != null ? userId.hashCode() : 0);\n hash = hash * UtilConstants.HASH_PRIME + (role != null ? role.hashCode() : 0);\n return hash;\n }", "@Override\n public int hashCode() {\n return DEFAULT_HASH_CODE + getType() + getUserName().hashCode() + message.hashCode();\n }", "private static int getHashOfAppClass(\n HashSet<Class> pre, Object obj, int prevDepth) {\n int hash = 0;\n for (Field f : getAllFields(obj.getClass())) {\n if (Modifier.isStatic(f.getModifiers())) {\n continue;\n }\n\n try {\n String fieldName = f.getName();\n // TODO: Handle special characters. What do they mean?\n if (fieldName.contains(\"$\") || fieldName.contains(\"#\")) {\n continue;\n }\n\n // Get a reference of the field, and get its hash code.\n Class objCls = obj.getClass();\n Method fieldGetter = objCls.getMethod(\"yGet_\" + fieldName);\n Object fieldAsRef = fieldGetter.invoke(obj);\n pre.add(objCls);\n hash ^= getHash(pre, fieldAsRef, prevDepth + 1);\n pre.remove(objCls);\n } catch (Throwable t) {\n logger.info(\"Error when hashing field \" + f, t);\n }\n }\n return hash;\n }", "private static int initHash() {\n return 0x811c9DC5; // unsigned 2166136261\n }", "@Override\r\n\tpublic int hashCode() {\r\n\t\tint hash = 1;\r\n hash = hash * 17 + (name == null ? 0 : name.hashCode());\r\n hash = hash * 13 + (duration);\r\n return hash;\r\n\t}", "public native int __hashCode( long __swiftObject );", "public int hashCode() {\n long hash = UtilConstants.HASH_INITIAL;\n hash = hash * UtilConstants.HASH_PRIME + objectHashCodeFK(getProject());\n hash = hash * UtilConstants.HASH_PRIME + objectHashCodeFK(getUser());\n hash = hash * UtilConstants.HASH_PRIME + objectHashCode(getStatus());\n hash = hash * UtilConstants.HASH_PRIME + objectHashCode(getLastActivityDate());\n hash = hash * UtilConstants.HASH_PRIME + objectHashCode(getHasPiSeen());\n hash = hash * UtilConstants.HASH_PRIME + objectHashCode(getHasDpSeen());\n hash = hash * UtilConstants.HASH_PRIME + objectHashCode(getHasAdminSeen());\n hash = hash * UtilConstants.HASH_PRIME + objectHashCode(getHasRequestorSeen());\n hash = hash * UtilConstants.HASH_PRIME + objectHashCode(getEmailStatus());\n return (int)(hash % Integer.MAX_VALUE);\n }", "@Override // com.google.common.base.Equivalence\n public int doHash(Object o) {\n return System.identityHashCode(o);\n }", "public static int calculateHash(final Class klass) {\n return klass.getName().hashCode();\n }", "protected abstract int hashOfObject(Object key);", "public int hashCode(){\n return name.hashCode();\n }", "@Override // com.google.common.base.Equivalence\n public int doHash(Object o) {\n return o.hashCode();\n }", "public int hashCode() {\n return 37 * 17;\n }", "@Override\r\n\t public int hashCode()\r\n\t {\n\t final int PRIME = 31;\r\n\t int result = 1;\r\n\t result = (int) (PRIME * result + (getId()==null?\r\n\t \t\tgetName().hashCode()\r\n\t \t\t:getName().hashCode()+getId()));\r\n\t return result;\r\n\t }", "@Override\n public int hashCode() {\n final int prime = 31;\n int result = 1;\n result = prime * result + ((getId() == null) ? 0 : getId().hashCode());\n result = prime * result + ((getAdditionalInfo() == null) ? 0 : getAdditionalInfo().hashCode());\n result = prime * result + ((getApiToken() == null) ? 0 : getApiToken().hashCode());\n result = prime * result + ((getPluginClass() == null) ? 0 : getPluginClass().hashCode());\n result = prime * result + ((getConfiguration() == null) ? 0 : getConfiguration().hashCode());\n result = prime * result + ((getName() == null) ? 0 : getName().hashCode());\n result = prime * result + ((getPublicAccess() == null) ? 0 : getPublicAccess().hashCode());\n result = prime * result + ((getSearchText() == null) ? 0 : getSearchText().hashCode());\n result = prime * result + ((getState() == null) ? 0 : getState().hashCode());\n result = prime * result + ((getTenantId() == null) ? 0 : getTenantId().hashCode());\n return result;\n }", "@Override\n public int hashCode() {\n int hash = 7;\n hash = 71 * hash + this.id;\n hash = 71 * hash + Objects.hashCode(this.name);\n hash = 71 * hash + Objects.hashCode(this.cash);\n hash = 71 * hash + Objects.hashCode(this.skills);\n hash = 71 * hash + Objects.hashCode(this.potions);\n return hash;\n }", "@Override\r\n public int hashCode() {\r\n final int prime = 31;\r\n int result = 1;\r\n result = prime * result + ((name == null) ? 0 : name.hashCode());\r\n result = prime * result + ((phoneNo == null) ? 0 : phoneNo.hashCode());\r\n return result;\r\n }", "public int hashCode() {\n/* 254 */ if (this.hashCode == 0) {\n/* 255 */ int i = 17;\n/* 256 */ i = 37 * i + this.methodName.hashCode();\n/* 257 */ if (this.argClasses != null) {\n/* 258 */ for (byte b = 0; b < this.argClasses.length; b++)\n/* */ {\n/* 260 */ i = 37 * i + ((this.argClasses[b] == null) ? 0 : this.argClasses[b].hashCode());\n/* */ }\n/* */ }\n/* 263 */ this.hashCode = i;\n/* */ } \n/* 265 */ return this.hashCode;\n/* */ }", "@Override\r\n public int hashCode() {\r\n final int prime = 31;\r\n int result = 1;\r\n result = prime * result + ((getShareholderid() == null) ? 0 : getShareholderid().hashCode());\r\n result = prime * result + ((getName() == null) ? 0 : getName().hashCode());\r\n result = prime * result + ((getPhone() == null) ? 0 : getPhone().hashCode());\r\n result = prime * result + ((getEmail() == null) ? 0 : getEmail().hashCode());\r\n result = prime * result + ((getHoldscale() == null) ? 0 : getHoldscale().hashCode());\r\n result = prime * result + ((getIdcard() == null) ? 0 : getIdcard().hashCode());\r\n result = prime * result + ((getIdimgZ() == null) ? 0 : getIdimgZ().hashCode());\r\n result = prime * result + ((getIdimgF() == null) ? 0 : getIdimgF().hashCode());\r\n result = prime * result + ((getCreatetime() == null) ? 0 : getCreatetime().hashCode());\r\n return result;\r\n }", "@Override\n public int hashCode()\n {\n if (hash != 0) {\n return hash;\n }\n\n hash = provider.hashCode() * 127 + id.hashCode();\n return hash;\n }", "@Override\n\tpublic int hashCode() {\n\t\treturn year*10000+month*100+day; \n\t}", "public int hashCode() {\n return 31 * firstName.hashCode() + lastName.hashCode();\n }", "@Override\n public int hashCode() {\n\tint hash = 7;\n\thash = 67 * hash + Objects.hashCode(this.targetType);\n\thash = 67 * hash + Objects.hashCode(this.unresolvedType);\n\thash = 67 * hash + Objects.hashCode(this.targetName);\n\thash = 67 * hash + Objects.hashCode(this.targetActions);\n\treturn hash;\n }", "public int hashCode()\n {\n return this.getSQLTypeName().hashCode();\n }", "public int hashCode() {\n int result = 6;\n result = 31 * result * name.hashCode();\n return result;\n }", "@Override\n public int hashCode() {\n int hash = 3;\n hash = 97 * hash + this.x;\n hash = 97 * hash + this.y;\n return hash;\n }", "public int hashCode()\n {\n int hash = this.getClass().hashCode();\n\n hash = ( hash << 1 | hash >>> 31 ) ^ Arrays.hashCode(genome);\n\n return hash;\n }", "public int hashCode()\n\t{\n\t\treturn y<<16+x;\n\t}", "public int generateHash(StudentClass item)\n {\n \t return item.hashCode() % tableSize;\n }", "public int hashCode();", "public int hashCode();", "public int hashCode();", "public int hashCode();", "public int hashCode() {\n\t\treturn new HashCodeBuilder().append(obox).append(wordOffsets).append(occlusions).toHashCode();\n\t}", "@Override\n public int hashCode() {\n if (hash == 0)\n hash = MD5.getHash(owner.getLogin() + description).hashCode();\n return hash;\n }", "public int hashCode(){\n\t\treturn toString().hashCode();\n\t}", "@Override\n\tpublic int hashCode() {\n\t\tfinal int prime = 31;\n\t\tint result = 1;\n\t\tresult = prime * result + ((firstName == null) ? 0 : firstName.hashCode());\n\t\tresult = prime * result + ((lastName == null) ? 0 : lastName.hashCode());\n\t\tresult = prime * result\t+ ((middleName == null) ? 0 : middleName.hashCode());\n\t\treturn result;\n\t}", "public int hashCode() {\n return name.hashCode();\n }", "@Override\n public int hashCode() {\n int result;\n long temp;\n result = type.hashCode();\n result = 31 * result + (name != null ? name.hashCode() : 0);\n result = 31 * result + (mainColor != null ? mainColor.hashCode() : 0);\n result = 31 * result + (material != null ? material.hashCode() : 0);\n result = 31 * result + (origin != null ? origin.hashCode() : 0);\n temp = Double.doubleToLongBits(price);\n result = 31 * result + (int) (temp ^ (temp >>> 32));\n result = 31 * result + Arrays.hashCode(ageDelta);\n return result;\n }", "@Override\n\tpublic int hashCode() {\n\t\treturn this.name.hashCode();\n\t}", "@Override\n\tpublic int hashCode() {\n\t\treturn this.name.hashCode();\n\t}", "@Override\n public int hashCode() {\n return _foreignPropertyName.hashCode() + _localDBMeta.hashCode() + _foreignDBMeta.hashCode();\n }", "public int hashCode()\n {\n return ((calendar.get(Calendar.DAY_OF_MONTH) & 0x0000001F) << 0)\n | ((calendar.get(Calendar.MONTH ) & 0x0000000F) << 5)\n | ((calendar.get(Calendar.YEAR ) & 0x007FFFFF) << 9);\n }", "@Override\n public int hashCode() {\n final int prime = 31;\n int result = 1;\n result = prime * result + ((name == null) ? 0 : name.hashCode());\n result = prime * result + ((identifierPrefix == null) ? 0 : identifierPrefix.hashCode());\n return result;\n }", "@Override\n public int hashCode() {\n return Objects.hash(getAssociatedUsername(), getEventID(), getPersonID(), getLatitude(),\n getLongitude(), getCountry(), getCity(), getEventType(), getYear());\n }", "@Override\n\tpublic int hashCode() {\n\t\tfinal int prime = 31;\n\t\tint result = 1;\n\t\tlong temp;\n\t\ttemp = Double.doubleToLongBits(duration);\n\t\tresult = prime * result + (int) (temp ^ (temp >>> 32));\n\t\tresult = prime * result + ((name == null) ? 0 : name.hashCode());\n\t\ttemp = Double.doubleToLongBits(startingTime);\n\t\tresult = prime * result + (int) (temp ^ (temp >>> 32));\n\t\tresult = prime * result + tab;\n\t\treturn result;\n\t}", "public int hashCode() {\n return name.hashCode();\n }", "public int hashCode() {\n\t\treturn src.hashCode() ^ dst.hashCode() ^ data_len ^ type ^ group ^ data.hashCode();\n\t}", "public abstract int hashCode();", "public int hashCode() {\n /*\n r7 = this;\n com.unboundid.ldap.matchingrules.CaseIgnoreStringMatchingRule r0 = com.unboundid.ldap.matchingrules.CaseIgnoreStringMatchingRule.getInstance()\n byte r1 = r7.filterType\n r2 = -121(0xffffffffffffff87, float:NaN)\n if (r1 == r2) goto L_0x009a\n r2 = 0\n switch(r1) {\n case -96: goto L_0x008b;\n case -95: goto L_0x008b;\n case -94: goto L_0x0084;\n case -93: goto L_0x006e;\n case -92: goto L_0x0034;\n case -91: goto L_0x006e;\n case -90: goto L_0x006e;\n default: goto L_0x000e;\n }\n L_0x000e:\n switch(r1) {\n case -88: goto L_0x006e;\n case -87: goto L_0x0013;\n default: goto L_0x0011;\n }\n L_0x0011:\n goto L_0x00a5\n L_0x0013:\n java.lang.String r2 = r7.attrName\n if (r2 == 0) goto L_0x0020\n java.lang.String r2 = com.unboundid.util.StaticUtils.toLowerCase(r2)\n int r2 = r2.hashCode()\n int r1 = r1 + r2\n L_0x0020:\n java.lang.String r2 = r7.matchingRuleID\n if (r2 == 0) goto L_0x002d\n java.lang.String r2 = com.unboundid.util.StaticUtils.toLowerCase(r2)\n int r2 = r2.hashCode()\n int r1 = r1 + r2\n L_0x002d:\n boolean r2 = r7.dnAttributes\n if (r2 == 0) goto L_0x0079\n int r1 = r1 + 1\n goto L_0x0079\n L_0x0034:\n java.lang.String r3 = r7.attrName\n java.lang.String r3 = com.unboundid.util.StaticUtils.toLowerCase(r3)\n int r3 = r3.hashCode()\n int r1 = r1 + r3\n com.unboundid.asn1.ASN1OctetString r3 = r7.subInitial\n if (r3 == 0) goto L_0x004e\n r4 = -128(0xffffffffffffff80, float:NaN)\n com.unboundid.asn1.ASN1OctetString r3 = r0.normalizeSubstring(r3, r4)\n int r3 = r3.hashCode()\n int r1 = r1 + r3\n L_0x004e:\n com.unboundid.asn1.ASN1OctetString[] r3 = r7.subAny\n int r4 = r3.length\n L_0x0051:\n if (r2 >= r4) goto L_0x0063\n r5 = r3[r2]\n r6 = -127(0xffffffffffffff81, float:NaN)\n com.unboundid.asn1.ASN1OctetString r5 = r0.normalizeSubstring(r5, r6)\n int r5 = r5.hashCode()\n int r1 = r1 + r5\n int r2 = r2 + 1\n goto L_0x0051\n L_0x0063:\n com.unboundid.asn1.ASN1OctetString r2 = r7.subFinal\n if (r2 == 0) goto L_0x00a5\n r3 = -126(0xffffffffffffff82, float:NaN)\n com.unboundid.asn1.ASN1OctetString r0 = r0.normalizeSubstring(r2, r3)\n goto L_0x007f\n L_0x006e:\n java.lang.String r2 = r7.attrName\n java.lang.String r2 = com.unboundid.util.StaticUtils.toLowerCase(r2)\n int r2 = r2.hashCode()\n int r1 = r1 + r2\n L_0x0079:\n com.unboundid.asn1.ASN1OctetString r2 = r7.assertionValue\n com.unboundid.asn1.ASN1OctetString r0 = r0.normalize(r2)\n L_0x007f:\n int r0 = r0.hashCode()\n goto L_0x00a4\n L_0x0084:\n com.unboundid.ldap.sdk.Filter r0 = r7.notComp\n int r0 = r0.hashCode()\n goto L_0x00a4\n L_0x008b:\n com.unboundid.ldap.sdk.Filter[] r0 = r7.filterComps\n int r3 = r0.length\n L_0x008e:\n if (r2 >= r3) goto L_0x00a5\n r4 = r0[r2]\n int r4 = r4.hashCode()\n int r1 = r1 + r4\n int r2 = r2 + 1\n goto L_0x008e\n L_0x009a:\n java.lang.String r0 = r7.attrName\n java.lang.String r0 = com.unboundid.util.StaticUtils.toLowerCase(r0)\n int r0 = r0.hashCode()\n L_0x00a4:\n int r1 = r1 + r0\n L_0x00a5:\n return r1\n */\n throw new UnsupportedOperationException(\"Method not decompiled: com.unboundid.ldap.sdk.Filter.hashCode():int\");\n }", "private String hash(){\r\n return Utility.SHA512(this.simplify());\r\n }", "@Override\n public int hashCode() {\n return Objects.hash(id,address1, address2, zip, city, state_long, state, phone);\n }", "@Override\n\tpublic int hashCode() {\n\t\tfinal int prime = 31;\n\t\tint result = 1;\n\t\tresult = prime * result + ((name == null) ? 0 : name.hashCode());\n\t\treturn result;\n\t}", "public int hashCode() {\n return new HashCodeBuilder(7, 29)\n .append(meaning)\n .append(type)\n .append(target)\n .toHashCode(); \n }", "public int hashCode()\n {\n return hash;\n }", "@Override\n\tpublic int hashCode()\n\t{\n\t\tint hash = 5;\n\t\thash = 41 * hash + (int) (Double.doubleToLongBits(this.latitude) ^ (Double.doubleToLongBits(this.latitude) >>> 32));\n\t\thash = 41 * hash + (int) (Double.doubleToLongBits(this.longitude) ^ (Double.doubleToLongBits(this.longitude) >>> 32));\n\t\treturn hash;\n\t}", "public int hashCode() {\n int result;\n result = (this.time != null ? this.time.hashCode() : 0);\n result = 29 * result + (this.value != null ? this.value.hashCode() : 0);\n return result;\n }", "@Override\n\tpublic int hashCode() {\n\t\treturn name.hashCode();\n\t}", "public int hashCode() {\n int result = 17;\n result = 37 * result + column;\n result = 37 * result + sortOrder.hashCode();\n return result;\n }" ]
[ "0.71863073", "0.7075676", "0.7012904", "0.68610007", "0.67551297", "0.6722827", "0.6719625", "0.6546281", "0.6521307", "0.6516643", "0.64888656", "0.6479804", "0.64485484", "0.64409184", "0.6432153", "0.6405596", "0.6396035", "0.6365839", "0.63551646", "0.6319873", "0.6298076", "0.6295824", "0.6287827", "0.6287611", "0.62684685", "0.62600154", "0.62345594", "0.6214966", "0.6210195", "0.62014914", "0.61940527", "0.61925507", "0.617604", "0.6162869", "0.6158048", "0.6155038", "0.6116742", "0.61115503", "0.61100554", "0.61066574", "0.6100852", "0.60967624", "0.6096537", "0.60839844", "0.6066116", "0.6065541", "0.60627884", "0.60560113", "0.60560083", "0.6047151", "0.6046918", "0.6041036", "0.60403407", "0.60388196", "0.60375184", "0.60333115", "0.6031299", "0.6022255", "0.602015", "0.60200226", "0.60200006", "0.60163605", "0.60146993", "0.6009771", "0.6006089", "0.6004927", "0.59986824", "0.5995416", "0.59898806", "0.5986406", "0.5982104", "0.5981335", "0.5981335", "0.5981335", "0.5981335", "0.5972959", "0.5971483", "0.5965001", "0.59648573", "0.5962996", "0.5961211", "0.59609956", "0.59609956", "0.596065", "0.5958667", "0.5956879", "0.59559965", "0.5947251", "0.5944593", "0.59427345", "0.5940884", "0.59365946", "0.5936042", "0.59339184", "0.5931378", "0.59301376", "0.59280485", "0.59269696", "0.59235865", "0.59213305", "0.59209037" ]
0.0
-1